From nobody Mon Oct 18 00:54:40 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 60A6B1802C5D; Mon, 18 Oct 2021 00:54: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 4HXdgh1xGKz4Z94; Mon, 18 Oct 2021 00:54: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 224D8174C2; Mon, 18 Oct 2021 00:54: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 19I0seI0000682; Mon, 18 Oct 2021 00:54:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19I0seBh000681; Mon, 18 Oct 2021 00:54:40 GMT (envelope-from git) Date: Mon, 18 Oct 2021 00:54:40 GMT Message-Id: <202110180054.19I0seBh000681@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: d95c0a12a2dd - main - nfscl: Modify Close RPC so that it does not use "owner" for NFSv4.1/4.2 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: d95c0a12a2dd58b4b13cbc2d1a9fccd848f8ac5e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=d95c0a12a2dd58b4b13cbc2d1a9fccd848f8ac5e commit d95c0a12a2dd58b4b13cbc2d1a9fccd848f8ac5e Author: Rick Macklem AuthorDate: 2021-10-18 00:50:56 +0000 Commit: Rick Macklem CommitDate: 2021-10-18 00:50:56 +0000 nfscl: Modify Close RPC so that it does not use "owner" for NFSv4.1/4.2 This patch modifies the function that does the Close RPC (nfsrpc_closerpc) so that it does not use the open_owner (nfso_own) for NFSv4.1/4.2. Use of the seqid in the open_owner structure is only needed for NFSv4.0. Same applies to a NFSERR_STALESTATEID reply, which should only happen for NFSv4.0. This allows nfsrpc_closerpc() to be called when nfso_own is no longer valid. This, in turn, allows nfsrpc_closerpc() to be called after the shared lock on the clientID is released, for NFSv4.1/4.2. This is being done to prepare the code for a future patch that fixes the case where an NFSv4.1/4.2 server replies NFSERR_DELAY to a Close operation. MFC after: 2 week --- sys/fs/nfsclient/nfs_clrpcops.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 08c9117a8fc1..6b6fdc03441f 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -868,11 +868,13 @@ nfsrpc_closerpc(struct nfsrv_descript *nd, struct nfsmount *nmp, nfscl_reqstart(nd, NFSPROC_CLOSE, nmp, op->nfso_fh, op->nfso_fhlen, NULL, NULL, 0, 0); NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_STATEID); - *tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); - if (NFSHASNFSV4N(nmp)) + if (NFSHASNFSV4N(nmp)) { *tl++ = 0; - else + *tl++ = 0; + } else { + *tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); *tl++ = op->nfso_stateid.seqid; + } *tl++ = op->nfso_stateid.other[0]; *tl++ = op->nfso_stateid.other[1]; *tl = op->nfso_stateid.other[2]; @@ -882,11 +884,12 @@ nfsrpc_closerpc(struct nfsrv_descript *nd, struct nfsmount *nmp, NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL); if (error) return (error); - NFSCL_INCRSEQID(op->nfso_own->nfsow_seqid, nd); + if (!NFSHASNFSV4N(nmp)) + NFSCL_INCRSEQID(op->nfso_own->nfsow_seqid, nd); if (nd->nd_repstat == 0) NFSM_DISSECT(tl, u_int32_t *, NFSX_STATEID); error = nd->nd_repstat; - if (error == NFSERR_STALESTATEID) + if (!NFSHASNFSV4N(nmp) && error == NFSERR_STALESTATEID) nfscl_initiate_recovery(op->nfso_own->nfsow_clp); nfsmout: m_freem(nd->nd_mrep); From nobody Mon Oct 18 06:22:28 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0DE0917F69AD; Mon, 18 Oct 2021 06:22: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 4HXmxy73Njz4jy4; Mon, 18 Oct 2021 06:22: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 D27B51BB99; Mon, 18 Oct 2021 06:22: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 19I6MUti040968; Mon, 18 Oct 2021 06:22:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19I6MSpc040964; Mon, 18 Oct 2021 06:22:28 GMT (envelope-from git) Date: Mon, 18 Oct 2021 06:22:28 GMT Message-Id: <202110180622.19I6MSpc040964@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Philip Paeps Subject: git: 6b7d3b4de8bc - main - contrib/tzdata: import tzdata 2021d List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6b7d3b4de8bc80d0c67a9ab2768405d4545d66a7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by philip: URL: https://cgit.FreeBSD.org/src/commit/?id=6b7d3b4de8bc80d0c67a9ab2768405d4545d66a7 commit 6b7d3b4de8bc80d0c67a9ab2768405d4545d66a7 Merge: d95c0a12a2dd c28d35783173 Author: Philip Paeps AuthorDate: 2021-10-18 06:19:42 +0000 Commit: Philip Paeps CommitDate: 2021-10-18 06:19:42 +0000 contrib/tzdata: import tzdata 2021d Merge commit 'c28d35783173c0b09ca1f7e29d2565b1602f733d' Changes: https://github.com/eggert/tz/blob/2021d/NEWS MFC after: 3 days contrib/tzdata/NEWS | 23 +++++++++++++++++++++-- contrib/tzdata/australasia | 24 +++++++++++++++++++----- contrib/tzdata/europe | 13 ++++++++----- contrib/tzdata/northamerica | 6 +++--- contrib/tzdata/version | 2 +- 5 files changed, 52 insertions(+), 16 deletions(-) From nobody Mon Oct 18 07:40:25 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F364F18170A7; Mon, 18 Oct 2021 07:40: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 4HXpgs6X9Fz3Ktr; Mon, 18 Oct 2021 07:40: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 B5FE11CB86; Mon, 18 Oct 2021 07:40: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 19I7ePDs044734; Mon, 18 Oct 2021 07:40:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19I7ePlP044733; Mon, 18 Oct 2021 07:40:25 GMT (envelope-from git) Date: Mon, 18 Oct 2021 07:40:25 GMT Message-Id: <202110180740.19I7ePlP044733@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: 26c1772071f7 - main - stress2: Added a syzkaller reproducer List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 26c1772071f70b6266fe95a2f235c7a50813732b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=26c1772071f70b6266fe95a2f235c7a50813732b commit 26c1772071f70b6266fe95a2f235c7a50813732b Author: Peter Holm AuthorDate: 2021-10-18 07:39:55 +0000 Commit: Peter Holm CommitDate: 2021-10-18 07:39:55 +0000 stress2: Added a syzkaller reproducer --- syzkaller45.sh | 289 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 289 insertions(+) diff --git a/syzkaller45.sh b/syzkaller45.sh new file mode 100755 index 000000000000..6c38b96ab12b --- /dev/null +++ b/syzkaller45.sh @@ -0,0 +1,289 @@ +#!/bin/sh + +# panic: Assertion (cnp->cn_flags & (LOCKPARENT | WANTPARENT)) == 0 failed at ../../../kern/vfs_cache.c:4790 +# cpuid = 5 +# time = 1634453452 +# KDB: stack backtrace: +# db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0146912830 +# vpanic() at vpanic+0x187/frame 0xfffffe0146912890 +# panic() at panic+0x43/frame 0xfffffe01469128f0 +# cache_fplookup_emptypath() at cache_fplookup_emptypath+0x1b2/frame 0xfffffe0146912930 +# cache_fplookup_noentry() at cache_fplookup_noentry+0xbc/frame 0xfffffe01469129a0 +# cache_fplookup() at cache_fplookup+0x605/frame 0xfffffe0146912a90 +# namei() at namei+0x203/frame 0xfffffe0146912b50 +# vn_open_cred() at vn_open_cred+0x12c/frame 0xfffffe0146912cb0 +# kern_openat() at kern_openat+0x285/frame 0xfffffe0146912e00 +# amd64_syscall() at amd64_syscall+0x147/frame 0xfffffe0146912f30 +# fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe0146912f30 +# --- syscall (0, FreeBSD ELF64, nosys), rip = 0x8003aeafa, rsp = 0x7fffdfffdf28, rbp = 0x7fffdfffdf70 --- +# KDB: enter: panic +# [ thread pid 2864 tid 100315 ] +# Stopped at kdb_enter+0x37: movq $0,0x126f74e(%rip) +# db> x/s version +# version: FreeBSD 14.0-CURRENT #0 main-n250087-a7d137fcbcac: Sun Oct 17 08:46:08 CEST 2021 +# pho@mercat1.netperf.freebsd.org:/usr/src/sys/amd64/compile/PHO\012 +# db> + +# Fixed by 1045352f1503 + +[ `uname -p` != "amd64" ] && exit 0 +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg +cat > /tmp/syzkaller45.c < +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static __thread int skip_segv; +static __thread jmp_buf segv_env; + +static void segv_handler(int sig, siginfo_t* info, void* ctx __unused) +{ + uintptr_t addr = (uintptr_t)info->si_addr; + const uintptr_t prog_start = 1 << 20; + const uintptr_t prog_end = 100 << 20; + int skip = __atomic_load_n(&skip_segv, __ATOMIC_RELAXED) != 0; + int valid = addr < prog_start || addr > prog_end; + if (sig == SIGBUS) + valid = 1; + if (skip && valid) { + _longjmp(segv_env, 1); + } + exit(sig); +} + +static void install_segv_handler(void) +{ + struct sigaction sa; + memset(&sa, 0, sizeof(sa)); + sa.sa_sigaction = segv_handler; + sa.sa_flags = SA_NODEFER | SA_SIGINFO; + sigaction(SIGSEGV, &sa, NULL); + sigaction(SIGBUS, &sa, NULL); +} + +#define NONFAILING(...) \ + ({ \ + int ok = 1; \ + __atomic_fetch_add(&skip_segv, 1, __ATOMIC_SEQ_CST); \ + if (_setjmp(segv_env) == 0) { \ + __VA_ARGS__; \ + } else \ + ok = 0; \ + __atomic_fetch_sub(&skip_segv, 1, __ATOMIC_SEQ_CST); \ + ok; \ + }) + +static void sleep_ms(uint64_t ms) +{ + usleep(ms * 1000); +} + +static uint64_t current_time_ms(void) +{ + struct timespec ts; + if (clock_gettime(CLOCK_MONOTONIC, &ts)) + exit(1); + return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000; +} + +static void thread_start(void* (*fn)(void*), void* arg) +{ + pthread_t th; + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setstacksize(&attr, 128 << 10); + int i = 0; + for (; i < 100; i++) { + if (pthread_create(&th, &attr, fn, arg) == 0) { + pthread_attr_destroy(&attr); + return; + } + if (errno == EAGAIN) { + usleep(50); + continue; + } + break; + } + exit(1); +} + +typedef struct { + pthread_mutex_t mu; + pthread_cond_t cv; + int state; +} event_t; + +static void event_init(event_t* ev) +{ + if (pthread_mutex_init(&ev->mu, 0)) + exit(1); + if (pthread_cond_init(&ev->cv, 0)) + exit(1); + ev->state = 0; +} + +static void event_reset(event_t* ev) +{ + ev->state = 0; +} + +static void event_set(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + if (ev->state) + exit(1); + ev->state = 1; + pthread_mutex_unlock(&ev->mu); + pthread_cond_broadcast(&ev->cv); +} + +static void event_wait(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + while (!ev->state) + pthread_cond_wait(&ev->cv, &ev->mu); + pthread_mutex_unlock(&ev->mu); +} + +static int event_isset(event_t* ev) +{ + pthread_mutex_lock(&ev->mu); + int res = ev->state; + pthread_mutex_unlock(&ev->mu); + return res; +} + +static int event_timedwait(event_t* ev, uint64_t timeout) +{ + uint64_t start = current_time_ms(); + uint64_t now = start; + pthread_mutex_lock(&ev->mu); + for (;;) { + if (ev->state) + break; + uint64_t remain = timeout - (now - start); + struct timespec ts; + ts.tv_sec = remain / 1000; + ts.tv_nsec = (remain % 1000) * 1000 * 1000; + pthread_cond_timedwait(&ev->cv, &ev->mu, &ts); + now = current_time_ms(); + if (now - start > timeout) + break; + } + int res = ev->state; + pthread_mutex_unlock(&ev->mu); + return res; +} + +struct thread_t { + int created, call; + event_t ready, done; +}; + +static struct thread_t threads[16]; +static void execute_call(int call); +static int running; + +static void* thr(void* arg) +{ + struct thread_t* th = (struct thread_t*)arg; + for (;;) { + event_wait(&th->ready); + event_reset(&th->ready); + execute_call(th->call); + __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED); + event_set(&th->done); + } + return 0; +} + +static void loop(void) +{ + int i, call, thread; + int collide = 0; +again: + for (call = 0; call < 3; call++) { + for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0])); + thread++) { + struct thread_t* th = &threads[thread]; + if (!th->created) { + th->created = 1; + event_init(&th->ready); + event_init(&th->done); + event_set(&th->done); + thread_start(thr, th); + } + if (!event_isset(&th->done)) + continue; + event_reset(&th->done); + th->call = call; + __atomic_fetch_add(&running, 1, __ATOMIC_RELAXED); + event_set(&th->ready); + if (collide && (call % 2) == 0) + break; + event_timedwait(&th->done, 50); + break; + } + } + for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++) + sleep_ms(1); + if (!collide) { + collide = 1; + goto again; + } +} + +uint64_t r[1] = {0xffffffffffffffff}; + +void execute_call(int call) +{ + intptr_t res = 0; + switch (call) { + case 0: + NONFAILING(memcpy((void*)0x20000480, "./file0\000", 8)); + res = syscall(SYS_open, 0x20000480ul, 0x80400000000206ul, 0ul); + if (res != -1) + r[0] = res; + break; + case 1: + syscall(SYS_mmap, 0x20000000ul, 0x200000ul, 1ul, 0x12ul, r[0], 0ul); + break; + case 2: + syscall(SYS_ftruncate, r[0], 5ul); + break; + } +} +int main(void) +{ + syscall(SYS_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x1012ul, -1, 0ul); + install_segv_handler(); + loop(); + return 0; +} +EOF +mycc -o /tmp/syzkaller45 -Wall -Wextra -O0 /tmp/syzkaller45.c -lpthread || exit 1 + +(cd /tmp; ./syzkaller45) + +rm -rf /tmp/syzkaller45 /tmp/syzkaller45.c /tmp/syzkaller.* /tmp/file0 +exit 0 From nobody Mon Oct 18 11:02:52 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F106917FF762 for ; Mon, 18 Oct 2021 11:03:04 +0000 (UTC) (envelope-from mw@semihalf.com) Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) (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 4HXv9h1bdVz3MNg for ; Mon, 18 Oct 2021 11:03:04 +0000 (UTC) (envelope-from mw@semihalf.com) Received: by mail-yb1-xb33.google.com with SMTP id z5so7707134ybj.2 for ; Mon, 18 Oct 2021 04:03:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=jcUtu16+f1FP5Oa8/QOstqsGOXBRU7A22DSEpTV6yvs=; b=J0jrZcULks6TUBGlY3/RoQ8e0YzgWpjpEPO5WNm14MM2sp52f/X49Nx9nsHUtLZo2c kJoSrtgjz2t9hL73ncWy2G+osKZmT5Lp1VS/OEaMffwnHZrcY6jWnLYZ4kasqIhWP+EC hzBubJh+kuRnkJI22IDlnlOn9VNRYqcdUpAsyMF+/t3jThVNqHyb6ovQqv66TPGFDefY inBuEk4invtanhsm1DQVwsoRpDP2eh6U93vcHBMb0sU9PM9mUCwGxhs4D2zEJ185co8M EWpDJrhskfoQD70bprByfmwHSL53N1dkea8EnfrrCyRqYptftJbZjgfDItqSVW8GCby/ 4k8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=jcUtu16+f1FP5Oa8/QOstqsGOXBRU7A22DSEpTV6yvs=; b=iA8jQv5+LniEDMLCvzJr8n/ZvqSe5iOHCFzQT0vEkC5Ai+XhPzj6qQb+SLmWHM+zlF RqlqJm2m7vP/svdnp/zmuga8pSf8MFEDYl44XqTahGdsPWjTT+rJbYGke5Vtg+XRpz3+ VuwZCt5Gq9IpLWiTGHfHgTF7gAmAWy+5QvXOYa+na8vIo+IXi9y0efpVePtYJBLVeiXT m0S/Xu8reQis0ZtF5af4CWpdoEG+AmUWiWJyhl7qwZJgIvghu1roMh/HwpOdbVw6QWlQ xnwRVvrE0rr2cHrCOmijuEw8ci5KIFGkXPRBZSwtqTPf8nny3/CX1KEpGJLJIzdo+Frm 21yg== X-Gm-Message-State: AOAM530ZtQl9X3AOuR3MwzGQuSNdWN08Hj59Z2xcwXPfm6GrMvBrqD6i HFl7bLpPWRG7auehSmCuaFw1elOH/JU5LGdsX9cgwA== X-Google-Smtp-Source: ABdhPJwnwMLArsfCLjcH9C3DhjmUD12ssbdXTkNUCZMrrqbLtEEIuaFLAqO/Q+IGnkLZ7qEHQJwGpT03tze19LIfT+I= X-Received: by 2002:a25:2c01:: with SMTP id s1mr29590261ybs.159.1634554983488; Mon, 18 Oct 2021 04:03:03 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202110150823.19F8NEr9047194@gitrepo.freebsd.org> <202110161602.19GG2FYs004292@slippy.cwsent.com> In-Reply-To: <202110161602.19GG2FYs004292@slippy.cwsent.com> From: Marcin Wojtas Date: Mon, 18 Oct 2021 13:02:52 +0200 Message-ID: Subject: Re: git: 889b56c8cd84 - main - setrlimit: Take stack gap into account. To: Cy Schubert Cc: Marcin Wojtas , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4HXv9h1bdVz3MNg X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=semihalf-com.20210112.gappssmtp.com header.s=20210112 header.b=J0jrZcUL; dmarc=none; spf=none (mx1.freebsd.org: domain of mw@semihalf.com has no SPF policy when checking 2607:f8b0:4864:20::b33) smtp.mailfrom=mw@semihalf.com X-Spamd-Result: default: False [0.70 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[semihalf-com.20210112.gappssmtp.com:s=20210112]; FREEFALL_USER(0.00)[mw]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(1.00)[1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[semihalf.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[semihalf-com.20210112.gappssmtp.com:+]; NEURAL_SPAM_LONG(1.00)[1.000]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::b33:from]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Hi Cy, sob., 16 pa=C5=BA 2021 o 18:02 Cy Schubert napi= sa=C5=82(a): > > In message <202110150823.19F8NEr9047194@gitrepo.freebsd.org>, Marcin Wojt= as > wri > tes: > > The branch main has been updated by mw: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D889b56c8cd84c9a9f2d9e3b0= 19c154d6 > > f14d9021 > > > > commit 889b56c8cd84c9a9f2d9e3b019c154d6f14d9021 > > Author: Dawid Gorecki > > AuthorDate: 2021-10-13 19:01:08 +0000 > > Commit: Marcin Wojtas > > CommitDate: 2021-10-15 08:21:47 +0000 > > > > setrlimit: Take stack gap into account. > > > > Calling setrlimit with stack gap enabled and with low values of sta= ck > > resource limit often caused the program to abort immediately after > > exiting the syscall. This happened due to the fact that the resourc= e > > limit was calculated assuming that the stack started at sv_usrstack= , > > while with stack gap enabled the stack is moved by a random number > > of bytes. > > > > Save information about stack size in struct vmspace and adjust the > > rlim_cur value. If the rlim_cur and stack gap is bigger than rlim_m= ax, > > then the value is truncated to rlim_max. > > > > PR: 253208 > > Reviewed by: kib > > Obtained from: Semihalf > > Sponsored by: Stormshield > > MFC after: 1 month > > Differential Revision: https://reviews.freebsd.org/D31516 > > --- > > sys/kern/imgact_elf.c | 5 +++-- > > sys/kern/kern_exec.c | 11 ++++++++--- > > sys/kern/kern_resource.c | 3 +++ > > sys/sys/imgact_elf.h | 2 +- > > sys/sys/sysent.h | 2 +- > > sys/vm/vm_map.c | 2 ++ > > sys/vm/vm_map.h | 1 + > > 7 files changed, 19 insertions(+), 7 deletions(-) > > > > diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c > > index ef1edfcabaf0..898f0f66a532 100644 > > --- a/sys/kern/imgact_elf.c > > +++ b/sys/kern/imgact_elf.c > > @@ -2684,7 +2684,7 @@ __elfN(untrans_prot)(vm_prot_t prot) > > return (flags); > > } > > > > -void > > +vm_size_t > > __elfN(stackgap)(struct image_params *imgp, uintptr_t *stack_base) > > { > > uintptr_t range, rbase, gap; > > @@ -2692,7 +2692,7 @@ __elfN(stackgap)(struct image_params *imgp, uintp= tr_t * > > stack_base) > > > > pct =3D __elfN(aslr_stack_gap); > > if (pct =3D=3D 0) > > - return; > > + return (0); > > if (pct > 50) > > pct =3D 50; > > range =3D imgp->eff_stack_sz * pct / 100; > > @@ -2700,4 +2700,5 @@ __elfN(stackgap)(struct image_params *imgp, uintp= tr_t * > > stack_base) > > gap =3D rbase % range; > > gap &=3D ~(sizeof(u_long) - 1); > > *stack_base -=3D gap; > > + return (gap); > > } > > diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c > > index 50e75fda6cfb..9dceebdd8441 100644 > > --- a/sys/kern/kern_exec.c > > +++ b/sys/kern/kern_exec.c > > @@ -1148,6 +1148,7 @@ exec_new_vmspace(struct image_params *imgp, struc= t syse > > ntvec *sv) > > stack_prot, error, vm_mmap_to_errno(error)); > > return (vm_mmap_to_errno(error)); > > } > > + vmspace->vm_stkgap =3D 0; > > > > /* > > * vm_ssize and vm_maxsaddr are somewhat antiquated concepts, but= they > > @@ -1493,12 +1494,16 @@ exec_args_get_begin_envv(struct image_args *arg= s) > > void > > exec_stackgap(struct image_params *imgp, uintptr_t *dp) > > { > > + struct proc *p =3D imgp->proc; > > + > > if (imgp->sysent->sv_stackgap =3D=3D NULL || > > - (imgp->proc->p_fctl0 & (NT_FREEBSD_FCTL_ASLR_DISABLE | > > + (p->p_fctl0 & (NT_FREEBSD_FCTL_ASLR_DISABLE | > > NT_FREEBSD_FCTL_ASG_DISABLE)) !=3D 0 || > > - (imgp->map_flags & MAP_ASLR) =3D=3D 0) > > + (imgp->map_flags & MAP_ASLR) =3D=3D 0) { > > + p->p_vmspace->vm_stkgap =3D 0; > > return; > > - imgp->sysent->sv_stackgap(imgp, dp); > > + } > > + p->p_vmspace->vm_stkgap =3D imgp->sysent->sv_stackgap(imgp, dp); > > } > > > > /* > > diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c > > index 4c62961e1bc4..b556d4fded51 100644 > > --- a/sys/kern/kern_resource.c > > +++ b/sys/kern/kern_resource.c > > @@ -671,6 +671,9 @@ kern_proc_setrlimit(struct thread *td, struct proc = *p, u_ > > int which, > > if (limp->rlim_max < 0) > > limp->rlim_max =3D RLIM_INFINITY; > > > > + if (which =3D=3D RLIMIT_STACK && limp->rlim_cur !=3D RLIM_INFINIT= Y) > > + limp->rlim_cur +=3D p->p_vmspace->vm_stkgap; > > + > > oldssiz.rlim_cur =3D 0; > > newlim =3D lim_alloc(); > > PROC_LOCK(p); > > diff --git a/sys/sys/imgact_elf.h b/sys/sys/imgact_elf.h > > index 97383c6eeeb8..294f17c87b6f 100644 > > --- a/sys/sys/imgact_elf.h > > +++ b/sys/sys/imgact_elf.h > > @@ -118,7 +118,7 @@ int __elfN(remove_brand_entry)(Elf_Brandinfo = *entry > > ); > > int __elfN(freebsd_fixup)(uintptr_t *, struct image_params *); > > int __elfN(coredump)(struct thread *, struct vnode *, off_t, int); > > size_t __elfN(populate_note)(int, void *, void *, size_t, void *= *); > > -void __elfN(stackgap)(struct image_params *, uintptr_t *); > > +vm_size_t __elfN(stackgap)(struct image_params *, uintptr_t *); > > int __elfN(freebsd_copyout_auxargs)(struct image_params *, uintptr_t)= ; > > void __elfN(puthdr)(struct thread *, void *, size_t, int, size_t, int)= ; > > void __elfN(prepare_notes)(struct thread *, struct note_info_list *, > > diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h > > index ad50bf56e87d..ea96c87a79af 100644 > > --- a/sys/sys/sysent.h > > +++ b/sys/sys/sysent.h > > @@ -119,7 +119,7 @@ struct sysentvec { > > void (*sv_elf_core_prepare_notes)(struct thread *, > > struct note_info_list *, size_t *); > > int (*sv_imgact_try)(struct image_params *); > > - void (*sv_stackgap)(struct image_params *, uintptr_t *= ); > > + vm_size_t (*sv_stackgap)(struct image_params *, uintptr_t *= ); > > int (*sv_copyout_auxargs)(struct image_params *, > > uintptr_t); > > int sv_minsigstksz; /* minimum signal stack size */ > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > > index 1ac4ccf72f11..87a290b998b9 100644 > > --- a/sys/vm/vm_map.c > > +++ b/sys/vm/vm_map.c > > @@ -343,6 +343,7 @@ vmspace_alloc(vm_offset_t min, vm_offset_t max, pma= p_pini > > t_t pinit) > > vm->vm_taddr =3D 0; > > vm->vm_daddr =3D 0; > > vm->vm_maxsaddr =3D 0; > > + vm->vm_stkgap =3D 0; > > return (vm); > > } > > > > @@ -4265,6 +4266,7 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *f= ork_ch > > arge) > > vm2->vm_taddr =3D vm1->vm_taddr; > > vm2->vm_daddr =3D vm1->vm_daddr; > > vm2->vm_maxsaddr =3D vm1->vm_maxsaddr; > > + vm2->vm_stkgap =3D vm1->vm_stkgap; > > vm_map_lock(old_map); > > if (old_map->busy) > > vm_map_wait_busy(old_map); > > diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h > > index ace205b21b42..873ff62eec4a 100644 > > --- a/sys/vm/vm_map.h > > +++ b/sys/vm/vm_map.h > > @@ -293,6 +293,7 @@ struct vmspace { > > caddr_t vm_taddr; /* (c) user virtual address of text */ > > caddr_t vm_daddr; /* (c) user virtual address of data */ > > caddr_t vm_maxsaddr; /* user VA at max stack growth */ > > + vm_size_t vm_stkgap; /* stack gap size in bytes */ > > u_int vm_refcnt; /* number of references */ > > /* > > * Keep the PMAP last, so that CPU-specific variations of that > > > > Is it possible to have a __FreeBSD_version bump for ports? > > At a first glance I don't see the ports' global versioning apart from creating tags, but maybe ports' maintainers will have more insight. Best regards, Marcin From nobody Mon Oct 18 13:02:34 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 697BB180FDD0; Mon, 18 Oct 2021 13:02:38 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (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 4HXxqf1WXCz4cPS; Mon, 18 Oct 2021 13:02:38 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTP id cRVBm8gYWczbLcSHlmm6y7; Mon, 18 Oct 2021 13:02:37 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id cSHjm7lzVa8XRcSHkmmT5q; Mon, 18 Oct 2021 13:02:37 +0000 X-Authority-Analysis: v=2.4 cv=Ov8sdwzt c=1 sm=1 tr=0 ts=616d706d a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=8nJEP1OIZ-IA:10 a=8gfv0ekSlNoA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=oCJs8q-oAAAA:8 a=EkcXrb_YAAAA:8 a=lYWpZslvAE-qNA2gE9QA:9 a=wPNLvfGTeEIA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=qUF70SbvcHBaGhGVny9j:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id D7181298; Mon, 18 Oct 2021 06:02:34 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 19ID2YGj005682; Mon, 18 Oct 2021 06:02:34 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202110181302.19ID2YGj005682@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: Marcin Wojtas cc: Cy Schubert , Marcin Wojtas , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 889b56c8cd84 - main - setrlimit: Take stack gap into account. In-reply-to: References: <202110150823.19F8NEr9047194@gitrepo.freebsd.org> <202110161602.19GG2FYs004292@slippy.cwsent.com> Comments: In-reply-to Marcin Wojtas message dated "Mon, 18 Oct 2021 13:02:52 +0200." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Mon, 18 Oct 2021 06:02:34 -0700 X-CMAE-Envelope: MS4xfBaLWPMcMT+qelIXGJqz+HK9cnldawPOOQRl6/32w+/PgnZVFkLseBDP4wBZ6j1fjOBs3d4uI6jlhUpEA6xY99QqPyZCyNoYPgA8uTZmbf/fzklcfNOz WDlSa+lmWYVhaNugNfivnjuhq+bBRD9xP22ZqEWPtAeXVm885Ib4BT+/y6LukcPziItu498rO8pDMQJXggF37hWu1wGiwjYau/EZ3fY+ehpDCSgMX0afQ3/q fx9YcxCtw3mBKyED0sgZI+TcQsKvoQO0nafgQ5th7Z5tbbYIM4Fg5+fESj4NP4ohJRpqd1A9jIY3J6SEjHjbeW84aQk4kRutYcqoUzCWF/ij2OGIXuWSrC4K S4nnx1Xw X-Rspamd-Queue-Id: 4HXxqf1WXCz4cPS X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N In message , Marcin Wojtas writes: > Hi Cy, > > > > sob., 16 paź 2021 o 18:02 Cy Schubert napisaÅ‚(a > ): > > > > In message <202110150823.19F8NEr9047194@gitrepo.freebsd.org>, Marcin Wojtas > > wri > > tes: > > > The branch main has been updated by mw: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=889b56c8cd84c9a9f2d9e3b019c1 > 54d6 > > > f14d9021 > > > > > > commit 889b56c8cd84c9a9f2d9e3b019c154d6f14d9021 > > > Author: Dawid Gorecki > > > AuthorDate: 2021-10-13 19:01:08 +0000 > > > Commit: Marcin Wojtas > > > CommitDate: 2021-10-15 08:21:47 +0000 > > > > > > setrlimit: Take stack gap into account. > > > > > > Calling setrlimit with stack gap enabled and with low values of stack > > > resource limit often caused the program to abort immediately after > > > exiting the syscall. This happened due to the fact that the resource > > > limit was calculated assuming that the stack started at sv_usrstack, > > > while with stack gap enabled the stack is moved by a random number > > > of bytes. > > > > > > Save information about stack size in struct vmspace and adjust the > > > rlim_cur value. If the rlim_cur and stack gap is bigger than rlim_max > , > > > then the value is truncated to rlim_max. > > > > > > PR: 253208 > > > Reviewed by: kib > > > Obtained from: Semihalf > > > Sponsored by: Stormshield > > > MFC after: 1 month > > > Differential Revision: https://reviews.freebsd.org/D31516 > > > --- > > > sys/kern/imgact_elf.c | 5 +++-- > > > sys/kern/kern_exec.c | 11 ++++++++--- > > > sys/kern/kern_resource.c | 3 +++ > > > sys/sys/imgact_elf.h | 2 +- > > > sys/sys/sysent.h | 2 +- > > > sys/vm/vm_map.c | 2 ++ > > > sys/vm/vm_map.h | 1 + > > > 7 files changed, 19 insertions(+), 7 deletions(-) > > > > > > diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c > > > index ef1edfcabaf0..898f0f66a532 100644 > > > --- a/sys/kern/imgact_elf.c > > > +++ b/sys/kern/imgact_elf.c > > > @@ -2684,7 +2684,7 @@ __elfN(untrans_prot)(vm_prot_t prot) > > > return (flags); > > > } > > > > > > -void > > > +vm_size_t > > > __elfN(stackgap)(struct image_params *imgp, uintptr_t *stack_base) > > > { > > > uintptr_t range, rbase, gap; > > > @@ -2692,7 +2692,7 @@ __elfN(stackgap)(struct image_params *imgp, uintptr > _t * > > > stack_base) > > > > > > pct = __elfN(aslr_stack_gap); > > > if (pct == 0) > > > - return; > > > + return (0); > > > if (pct > 50) > > > pct = 50; > > > range = imgp->eff_stack_sz * pct / 100; > > > @@ -2700,4 +2700,5 @@ __elfN(stackgap)(struct image_params *imgp, uintptr > _t * > > > stack_base) > > > gap = rbase % range; > > > gap &= ~(sizeof(u_long) - 1); > > > *stack_base -= gap; > > > + return (gap); > > > } > > > diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c > > > index 50e75fda6cfb..9dceebdd8441 100644 > > > --- a/sys/kern/kern_exec.c > > > +++ b/sys/kern/kern_exec.c > > > @@ -1148,6 +1148,7 @@ exec_new_vmspace(struct image_params *imgp, struct > syse > > > ntvec *sv) > > > stack_prot, error, vm_mmap_to_errno(error)); > > > return (vm_mmap_to_errno(error)); > > > } > > > + vmspace->vm_stkgap = 0; > > > > > > /* > > > * vm_ssize and vm_maxsaddr are somewhat antiquated concepts, but t > hey > > > @@ -1493,12 +1494,16 @@ exec_args_get_begin_envv(struct image_args *args) > > > void > > > exec_stackgap(struct image_params *imgp, uintptr_t *dp) > > > { > > > + struct proc *p = imgp->proc; > > > + > > > if (imgp->sysent->sv_stackgap == NULL || > > > - (imgp->proc->p_fctl0 & (NT_FREEBSD_FCTL_ASLR_DISABLE | > > > + (p->p_fctl0 & (NT_FREEBSD_FCTL_ASLR_DISABLE | > > > NT_FREEBSD_FCTL_ASG_DISABLE)) != 0 || > > > - (imgp->map_flags & MAP_ASLR) == 0) > > > + (imgp->map_flags & MAP_ASLR) == 0) { > > > + p->p_vmspace->vm_stkgap = 0; > > > return; > > > - imgp->sysent->sv_stackgap(imgp, dp); > > > + } > > > + p->p_vmspace->vm_stkgap = imgp->sysent->sv_stackgap(imgp, dp); > > > } > > > > > > /* > > > diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c > > > index 4c62961e1bc4..b556d4fded51 100644 > > > --- a/sys/kern/kern_resource.c > > > +++ b/sys/kern/kern_resource.c > > > @@ -671,6 +671,9 @@ kern_proc_setrlimit(struct thread *td, struct proc *p > , u_ > > > int which, > > > if (limp->rlim_max < 0) > > > limp->rlim_max = RLIM_INFINITY; > > > > > > + if (which == RLIMIT_STACK && limp->rlim_cur != RLIM_INFINITY) > > > + limp->rlim_cur += p->p_vmspace->vm_stkgap; > > > + > > > oldssiz.rlim_cur = 0; > > > newlim = lim_alloc(); > > > PROC_LOCK(p); > > > diff --git a/sys/sys/imgact_elf.h b/sys/sys/imgact_elf.h > > > index 97383c6eeeb8..294f17c87b6f 100644 > > > --- a/sys/sys/imgact_elf.h > > > +++ b/sys/sys/imgact_elf.h > > > @@ -118,7 +118,7 @@ int __elfN(remove_brand_entry)(Elf_Brandinfo *e > ntry > > > ); > > > int __elfN(freebsd_fixup)(uintptr_t *, struct image_params *); > > > int __elfN(coredump)(struct thread *, struct vnode *, off_t, int); > > > size_t __elfN(populate_note)(int, void *, void *, size_t, void **) > ; > > > -void __elfN(stackgap)(struct image_params *, uintptr_t *); > > > +vm_size_t __elfN(stackgap)(struct image_params *, uintptr_t *); > > > int __elfN(freebsd_copyout_auxargs)(struct image_params *, uintptr_t); > > > void __elfN(puthdr)(struct thread *, void *, size_t, int, size_t, int); > > > void __elfN(prepare_notes)(struct thread *, struct note_info_list *, > > > diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h > > > index ad50bf56e87d..ea96c87a79af 100644 > > > --- a/sys/sys/sysent.h > > > +++ b/sys/sys/sysent.h > > > @@ -119,7 +119,7 @@ struct sysentvec { > > > void (*sv_elf_core_prepare_notes)(struct thread *, > > > struct note_info_list *, size_t *); > > > int (*sv_imgact_try)(struct image_params *); > > > - void (*sv_stackgap)(struct image_params *, uintptr_t *); > > > + vm_size_t (*sv_stackgap)(struct image_params *, uintptr_t *); > > > int (*sv_copyout_auxargs)(struct image_params *, > > > uintptr_t); > > > int sv_minsigstksz; /* minimum signal stack size */ > > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > > > index 1ac4ccf72f11..87a290b998b9 100644 > > > --- a/sys/vm/vm_map.c > > > +++ b/sys/vm/vm_map.c > > > @@ -343,6 +343,7 @@ vmspace_alloc(vm_offset_t min, vm_offset_t max, pmap_ > pini > > > t_t pinit) > > > vm->vm_taddr = 0; > > > vm->vm_daddr = 0; > > > vm->vm_maxsaddr = 0; > > > + vm->vm_stkgap = 0; > > > return (vm); > > > } > > > > > > @@ -4265,6 +4266,7 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *for > k_ch > > > arge) > > > vm2->vm_taddr = vm1->vm_taddr; > > > vm2->vm_daddr = vm1->vm_daddr; > > > vm2->vm_maxsaddr = vm1->vm_maxsaddr; > > > + vm2->vm_stkgap = vm1->vm_stkgap; > > > vm_map_lock(old_map); > > > if (old_map->busy) > > > vm_map_wait_busy(old_map); > > > diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h > > > index ace205b21b42..873ff62eec4a 100644 > > > --- a/sys/vm/vm_map.h > > > +++ b/sys/vm/vm_map.h > > > @@ -293,6 +293,7 @@ struct vmspace { > > > caddr_t vm_taddr; /* (c) user virtual address of text */ > > > caddr_t vm_daddr; /* (c) user virtual address of data */ > > > caddr_t vm_maxsaddr; /* user VA at max stack growth */ > > > + vm_size_t vm_stkgap; /* stack gap size in bytes */ > > > u_int vm_refcnt; /* number of references */ > > > /* > > > * Keep the PMAP last, so that CPU-specific variations of that > > > > > > > Is it possible to have a __FreeBSD_version bump for ports? > > > > > > At a first glance I don't see the ports' global versioning apart from > creating tags, but maybe ports' maintainers will have more insight. I'm also the ntp port maintainer, hence the request. But no worries. I used the prior __FreeBSD_version bump at the time. There was another __FreeBSD_version bump yesterday (Sunday). Since this commit is in between the two I'll update the patch to use the second one and send the patch upstream. -- 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 nobody Mon Oct 18 13:03:29 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C76A3181046F for ; Mon, 18 Oct 2021 13:03:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ua1-x936.google.com (mail-ua1-x936.google.com [IPv6:2607:f8b0:4864:20::936]) (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 4HXxrv0fFpz4cnv for ; Mon, 18 Oct 2021 13:03:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ua1-x936.google.com with SMTP id a17so1935204uax.12 for ; Mon, 18 Oct 2021 06:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hwMbT7zkAaodKlgdcGGK6mQsGWZRjNtTeoX9mF3fpkI=; b=cl3wPFmcpO14gHMsZRttrZ60l4O7Pty0JQqCgrY10rCMMlsFNCpWbaZvEHjjc4g6IG H1hYTKkJQFSdqfbWlXSCe8Kj4u4sCRXsrEqnp6Arsh0fYac906ja6n+hxIdLtDG/Rd5q 70rR3roD7WhsoML8UX/lgkkTeniTI3yo7MsECp/dozKamP5xCTP8jPuBIKkOU20laurF RR3evk/XkIN/MyOuPXVZaZpmYb4E1C5MLCaLsmcuExGnXVJkbX+MwEr34fonXGuqMclJ af3N3oH6O+jy18fM0k1cxhacWEh26zPuvPBszzVvPa4rJ01gKS5zdJZr0Yxx39Okz1pZ wAcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hwMbT7zkAaodKlgdcGGK6mQsGWZRjNtTeoX9mF3fpkI=; b=0DaO794Z/Cm8OyEgee/nfkCUs6Yzp1/C15CmlqVSLhM9Vq+InbLzKjbMWzAOetZzKk 0KzrKH+irSpu+ZVPHaKJVDN6oEvRdlvNMvuUnsVr8LH3Xw/vcOUbBwfFFP+xCDGU8OBm YloUGFJMe6O8BTLLDmeYZl5iRU2AbaJ1mwTrt/dg81aAcB2XmePxZ5pwLg6J4qwG1Q6y X3q8jyC/e3m8GGgBSD4aswReU5ToKmB17/RcJTHTKx7t7BF3wXmBEEGWaXcertFHhNma xZVUPibEMVKQjvQv9lODFd7FmgzKX7eqnb859bla0XOSn8JQWYHx3mp/ps6Q+cIT2Cba eV7Q== X-Gm-Message-State: AOAM531IqqAm+lzBIB6ty5VLLoko+nu/SSwLv3dqcLI87nmZuqJcw/mG hMb4Suhe2ksf/1bHmp1wrvdQkEtx69hdwluP0IL+uw== X-Google-Smtp-Source: ABdhPJyVGkRQ2dTHXH67ihoWxOh/LHqy9oSrx9r8zxvivnug6X9g19Bv2EihFAE2JDG+GEQCpnpeybhaWO2auVNBSh8= X-Received: by 2002:ab0:3010:: with SMTP id f16mr1576390ual.11.1634562222176; Mon, 18 Oct 2021 06:03:42 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202110150823.19F8NEr9047194@gitrepo.freebsd.org> <202110161602.19GG2FYs004292@slippy.cwsent.com> In-Reply-To: <202110161602.19GG2FYs004292@slippy.cwsent.com> From: Warner Losh Date: Mon, 18 Oct 2021 07:03:29 -0600 Message-ID: Subject: Re: git: 889b56c8cd84 - main - setrlimit: Take stack gap into account. To: Cy Schubert Cc: Marcin Wojtas , src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000009dcc8205cea02c1b" X-Rspamd-Queue-Id: 4HXxrv0fFpz4cnv X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20210112.gappssmtp.com header.s=20210112 header.b=cl3wPFmc; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::936) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-0.83 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20210112.gappssmtp.com:s=20210112]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20210112.gappssmtp.com:+]; NEURAL_SPAM_LONG(1.00)[1.000]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::936:from]; NEURAL_HAM_SHORT(-0.83)[-0.829]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N --0000000000009dcc8205cea02c1b Content-Type: text/plain; charset="UTF-8" On Sat, Oct 16, 2021, 10:02 AM Cy Schubert wrote: > In message <202110150823.19F8NEr9047194@gitrepo.freebsd.org>, Marcin > Wojtas > wri > tes: > > The branch main has been updated by mw: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=889b56c8cd84c9a9f2d9e3b019c154d6 > > f14d9021 > > > > commit 889b56c8cd84c9a9f2d9e3b019c154d6f14d9021 > > Author: Dawid Gorecki > > AuthorDate: 2021-10-13 19:01:08 +0000 > > Commit: Marcin Wojtas > > CommitDate: 2021-10-15 08:21:47 +0000 > > > > setrlimit: Take stack gap into account. > > > > Calling setrlimit with stack gap enabled and with low values of stack > > resource limit often caused the program to abort immediately after > > exiting the syscall. This happened due to the fact that the resource > > limit was calculated assuming that the stack started at sv_usrstack, > > while with stack gap enabled the stack is moved by a random number > > of bytes. > > > > Save information about stack size in struct vmspace and adjust the > > rlim_cur value. If the rlim_cur and stack gap is bigger than > rlim_max, > > then the value is truncated to rlim_max. > > > > PR: 253208 > > Reviewed by: kib > > Obtained from: Semihalf > > Sponsored by: Stormshield > > MFC after: 1 month > > Differential Revision: https://reviews.freebsd.org/D31516 > > --- > > sys/kern/imgact_elf.c | 5 +++-- > > sys/kern/kern_exec.c | 11 ++++++++--- > > sys/kern/kern_resource.c | 3 +++ > > sys/sys/imgact_elf.h | 2 +- > > sys/sys/sysent.h | 2 +- > > sys/vm/vm_map.c | 2 ++ > > sys/vm/vm_map.h | 1 + > > 7 files changed, 19 insertions(+), 7 deletions(-) > > > > diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c > > index ef1edfcabaf0..898f0f66a532 100644 > > --- a/sys/kern/imgact_elf.c > > +++ b/sys/kern/imgact_elf.c > > @@ -2684,7 +2684,7 @@ __elfN(untrans_prot)(vm_prot_t prot) > > return (flags); > > } > > > > -void > > +vm_size_t > > __elfN(stackgap)(struct image_params *imgp, uintptr_t *stack_base) > > { > > uintptr_t range, rbase, gap; > > @@ -2692,7 +2692,7 @@ __elfN(stackgap)(struct image_params *imgp, > uintptr_t * > > stack_base) > > > > pct = __elfN(aslr_stack_gap); > > if (pct == 0) > > - return; > > + return (0); > > if (pct > 50) > > pct = 50; > > range = imgp->eff_stack_sz * pct / 100; > > @@ -2700,4 +2700,5 @@ __elfN(stackgap)(struct image_params *imgp, > uintptr_t * > > stack_base) > > gap = rbase % range; > > gap &= ~(sizeof(u_long) - 1); > > *stack_base -= gap; > > + return (gap); > > } > > diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c > > index 50e75fda6cfb..9dceebdd8441 100644 > > --- a/sys/kern/kern_exec.c > > +++ b/sys/kern/kern_exec.c > > @@ -1148,6 +1148,7 @@ exec_new_vmspace(struct image_params *imgp, struct > syse > > ntvec *sv) > > stack_prot, error, vm_mmap_to_errno(error)); > > return (vm_mmap_to_errno(error)); > > } > > + vmspace->vm_stkgap = 0; > > > > /* > > * vm_ssize and vm_maxsaddr are somewhat antiquated concepts, but > they > > @@ -1493,12 +1494,16 @@ exec_args_get_begin_envv(struct image_args *args) > > void > > exec_stackgap(struct image_params *imgp, uintptr_t *dp) > > { > > + struct proc *p = imgp->proc; > > + > > if (imgp->sysent->sv_stackgap == NULL || > > - (imgp->proc->p_fctl0 & (NT_FREEBSD_FCTL_ASLR_DISABLE | > > + (p->p_fctl0 & (NT_FREEBSD_FCTL_ASLR_DISABLE | > > NT_FREEBSD_FCTL_ASG_DISABLE)) != 0 || > > - (imgp->map_flags & MAP_ASLR) == 0) > > + (imgp->map_flags & MAP_ASLR) == 0) { > > + p->p_vmspace->vm_stkgap = 0; > > return; > > - imgp->sysent->sv_stackgap(imgp, dp); > > + } > > + p->p_vmspace->vm_stkgap = imgp->sysent->sv_stackgap(imgp, dp); > > } > > > > /* > > diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c > > index 4c62961e1bc4..b556d4fded51 100644 > > --- a/sys/kern/kern_resource.c > > +++ b/sys/kern/kern_resource.c > > @@ -671,6 +671,9 @@ kern_proc_setrlimit(struct thread *td, struct proc > *p, u_ > > int which, > > if (limp->rlim_max < 0) > > limp->rlim_max = RLIM_INFINITY; > > > > + if (which == RLIMIT_STACK && limp->rlim_cur != RLIM_INFINITY) > > + limp->rlim_cur += p->p_vmspace->vm_stkgap; > > + > > oldssiz.rlim_cur = 0; > > newlim = lim_alloc(); > > PROC_LOCK(p); > > diff --git a/sys/sys/imgact_elf.h b/sys/sys/imgact_elf.h > > index 97383c6eeeb8..294f17c87b6f 100644 > > --- a/sys/sys/imgact_elf.h > > +++ b/sys/sys/imgact_elf.h > > @@ -118,7 +118,7 @@ int __elfN(remove_brand_entry)(Elf_Brandinfo > *entry > > ); > > int __elfN(freebsd_fixup)(uintptr_t *, struct image_params *); > > int __elfN(coredump)(struct thread *, struct vnode *, off_t, int); > > size_t __elfN(populate_note)(int, void *, void *, size_t, void > **); > > -void __elfN(stackgap)(struct image_params *, uintptr_t *); > > +vm_size_t __elfN(stackgap)(struct image_params *, uintptr_t *); > > int __elfN(freebsd_copyout_auxargs)(struct image_params *, uintptr_t); > > void __elfN(puthdr)(struct thread *, void *, size_t, int, size_t, int); > > void __elfN(prepare_notes)(struct thread *, struct note_info_list *, > > diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h > > index ad50bf56e87d..ea96c87a79af 100644 > > --- a/sys/sys/sysent.h > > +++ b/sys/sys/sysent.h > > @@ -119,7 +119,7 @@ struct sysentvec { > > void (*sv_elf_core_prepare_notes)(struct thread *, > > struct note_info_list *, size_t *); > > int (*sv_imgact_try)(struct image_params *); > > - void (*sv_stackgap)(struct image_params *, uintptr_t *); > > + vm_size_t (*sv_stackgap)(struct image_params *, uintptr_t *); > > int (*sv_copyout_auxargs)(struct image_params *, > > uintptr_t); > > int sv_minsigstksz; /* minimum signal stack size */ > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > > index 1ac4ccf72f11..87a290b998b9 100644 > > --- a/sys/vm/vm_map.c > > +++ b/sys/vm/vm_map.c > > @@ -343,6 +343,7 @@ vmspace_alloc(vm_offset_t min, vm_offset_t max, > pmap_pini > > t_t pinit) > > vm->vm_taddr = 0; > > vm->vm_daddr = 0; > > vm->vm_maxsaddr = 0; > > + vm->vm_stkgap = 0; > > return (vm); > > } > > > > @@ -4265,6 +4266,7 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t > *fork_ch > > arge) > > vm2->vm_taddr = vm1->vm_taddr; > > vm2->vm_daddr = vm1->vm_daddr; > > vm2->vm_maxsaddr = vm1->vm_maxsaddr; > > + vm2->vm_stkgap = vm1->vm_stkgap; > > vm_map_lock(old_map); > > if (old_map->busy) > > vm_map_wait_busy(old_map); > > diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h > > index ace205b21b42..873ff62eec4a 100644 > > --- a/sys/vm/vm_map.h > > +++ b/sys/vm/vm_map.h > > @@ -293,6 +293,7 @@ struct vmspace { > > caddr_t vm_taddr; /* (c) user virtual address of text */ > > caddr_t vm_daddr; /* (c) user virtual address of data */ > > caddr_t vm_maxsaddr; /* user VA at max stack growth */ > > + vm_size_t vm_stkgap; /* stack gap size in bytes */ > > u_int vm_refcnt; /* number of references */ > > /* > > * Keep the PMAP last, so that CPU-specific variations of that > > > > Is it possible to have a __FreeBSD_version bump for ports? > There was a bump for linuxkpi you should use for this. It was a day or so after the stackgap change. Warner Warner -- > 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. > > > > --0000000000009dcc8205cea02c1b-- From nobody Mon Oct 18 13:10:11 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 06E731813D7D; Mon, 18 Oct 2021 13:10:14 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (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 4HXy0P66SCz4gWg; Mon, 18 Oct 2021 13:10:13 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTP id c6DimkAQWps7PcSP7mGSyG; Mon, 18 Oct 2021 13:10:13 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id cSP6m7oVva8XRcSP6mmUDZ; Mon, 18 Oct 2021 13:10:13 +0000 X-Authority-Analysis: v=2.4 cv=Ov8sdwzt c=1 sm=1 tr=0 ts=616d7235 a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=8gfv0ekSlNoA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=oCJs8q-oAAAA:8 a=EkcXrb_YAAAA:8 a=lYWpZslvAE-qNA2gE9QA:9 a=CjuIK1q_8ugA:10 a=UJ0tAi3fqDAA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=qUF70SbvcHBaGhGVny9j:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id A2200263; Mon, 18 Oct 2021 06:10:11 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 19IDABYd005908; Mon, 18 Oct 2021 06:10:11 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202110181310.19IDABYd005908@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: Warner Losh cc: Cy Schubert , Marcin Wojtas , src-committers , "" , dev-commits-src-main@freebsd.org Subject: Re: git: 889b56c8cd84 - main - setrlimit: Take stack gap into account. In-reply-to: References: <202110150823.19F8NEr9047194@gitrepo.freebsd.org> <202110161602.19GG2FYs004292@slippy.cwsent.com> Comments: In-reply-to Warner Losh message dated "Mon, 18 Oct 2021 07:03:29 -0600." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 18 Oct 2021 06:10:11 -0700 X-CMAE-Envelope: MS4xfHOq2+XhK3NvqIqSNoPxGrc7cG2ZWu0LATSbjfiOT+pHENzlcqKU4h4z003n4OZ0ouV3NZGTultcQwlEWDvoAE78BCz0ABuJTi/cu3owZT/lgcc35pGF NUji0TDndOWbaPaZ85Ewo/09ZfxkW/GN80M8IUsjXnM7iryqHEhAmfHfiu1NAzJ1DO/+Zb3LAQ4diEpxxYMNmHRNUjjp4sCAdB4RgwhR9jgjkiwcQlVMGaH3 GGEkvFK6hlZoGRtS/aWHBgMGU+BNgMVYzNac2P50yQi0uxoLlBFJD7ZKBk1ZoadP0rCohYf57mO8Qc0A27CKNO9xDrrk3vxP4SswKSLHZJVon4c5kIzEvbJ6 gGzsXCgf X-Rspamd-Queue-Id: 4HXy0P66SCz4gWg X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N In message , Warner Losh writes: > On Sat, Oct 16, 2021, 10:02 AM Cy Schubert > wrote: > > > In message <202110150823.19F8NEr9047194@gitrepo.freebsd.org>, Marcin > > Wojtas > > wri > > tes: > > > The branch main has been updated by mw: > > > > > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=889b56c8cd84c9a9f2d9e3b019c154d6 > > > f14d9021 > > > > > > commit 889b56c8cd84c9a9f2d9e3b019c154d6f14d9021 > > > Author: Dawid Gorecki > > > AuthorDate: 2021-10-13 19:01:08 +0000 > > > Commit: Marcin Wojtas > > > CommitDate: 2021-10-15 08:21:47 +0000 > > > > > > setrlimit: Take stack gap into account. > > > > > > Calling setrlimit with stack gap enabled and with low values of stack > > > resource limit often caused the program to abort immediately after > > > exiting the syscall. This happened due to the fact that the resource > > > limit was calculated assuming that the stack started at sv_usrstack, > > > while with stack gap enabled the stack is moved by a random number > > > of bytes. > > > > > > Save information about stack size in struct vmspace and adjust the > > > rlim_cur value. If the rlim_cur and stack gap is bigger than > > rlim_max, > > > then the value is truncated to rlim_max. > > > > > > PR: 253208 > > > Reviewed by: kib > > > Obtained from: Semihalf > > > Sponsored by: Stormshield > > > MFC after: 1 month > > > Differential Revision: https://reviews.freebsd.org/D31516 > > > --- > > > sys/kern/imgact_elf.c | 5 +++-- > > > sys/kern/kern_exec.c | 11 ++++++++--- > > > sys/kern/kern_resource.c | 3 +++ > > > sys/sys/imgact_elf.h | 2 +- > > > sys/sys/sysent.h | 2 +- > > > sys/vm/vm_map.c | 2 ++ > > > sys/vm/vm_map.h | 1 + > > > 7 files changed, 19 insertions(+), 7 deletions(-) > > > > > > diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c > > > index ef1edfcabaf0..898f0f66a532 100644 > > > --- a/sys/kern/imgact_elf.c > > > +++ b/sys/kern/imgact_elf.c > > > @@ -2684,7 +2684,7 @@ __elfN(untrans_prot)(vm_prot_t prot) > > > return (flags); > > > } > > > > > > -void > > > +vm_size_t > > > __elfN(stackgap)(struct image_params *imgp, uintptr_t *stack_base) > > > { > > > uintptr_t range, rbase, gap; > > > @@ -2692,7 +2692,7 @@ __elfN(stackgap)(struct image_params *imgp, > > uintptr_t * > > > stack_base) > > > > > > pct = __elfN(aslr_stack_gap); > > > if (pct == 0) > > > - return; > > > + return (0); > > > if (pct > 50) > > > pct = 50; > > > range = imgp->eff_stack_sz * pct / 100; > > > @@ -2700,4 +2700,5 @@ __elfN(stackgap)(struct image_params *imgp, > > uintptr_t * > > > stack_base) > > > gap = rbase % range; > > > gap &= ~(sizeof(u_long) - 1); > > > *stack_base -= gap; > > > + return (gap); > > > } > > > diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c > > > index 50e75fda6cfb..9dceebdd8441 100644 > > > --- a/sys/kern/kern_exec.c > > > +++ b/sys/kern/kern_exec.c > > > @@ -1148,6 +1148,7 @@ exec_new_vmspace(struct image_params *imgp, struct > > syse > > > ntvec *sv) > > > stack_prot, error, vm_mmap_to_errno(error)); > > > return (vm_mmap_to_errno(error)); > > > } > > > + vmspace->vm_stkgap = 0; > > > > > > /* > > > * vm_ssize and vm_maxsaddr are somewhat antiquated concepts, but > > they > > > @@ -1493,12 +1494,16 @@ exec_args_get_begin_envv(struct image_args *args) > > > void > > > exec_stackgap(struct image_params *imgp, uintptr_t *dp) > > > { > > > + struct proc *p = imgp->proc; > > > + > > > if (imgp->sysent->sv_stackgap == NULL || > > > - (imgp->proc->p_fctl0 & (NT_FREEBSD_FCTL_ASLR_DISABLE | > > > + (p->p_fctl0 & (NT_FREEBSD_FCTL_ASLR_DISABLE | > > > NT_FREEBSD_FCTL_ASG_DISABLE)) != 0 || > > > - (imgp->map_flags & MAP_ASLR) == 0) > > > + (imgp->map_flags & MAP_ASLR) == 0) { > > > + p->p_vmspace->vm_stkgap = 0; > > > return; > > > - imgp->sysent->sv_stackgap(imgp, dp); > > > + } > > > + p->p_vmspace->vm_stkgap = imgp->sysent->sv_stackgap(imgp, dp); > > > } > > > > > > /* > > > diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c > > > index 4c62961e1bc4..b556d4fded51 100644 > > > --- a/sys/kern/kern_resource.c > > > +++ b/sys/kern/kern_resource.c > > > @@ -671,6 +671,9 @@ kern_proc_setrlimit(struct thread *td, struct proc > > *p, u_ > > > int which, > > > if (limp->rlim_max < 0) > > > limp->rlim_max = RLIM_INFINITY; > > > > > > + if (which == RLIMIT_STACK && limp->rlim_cur != RLIM_INFINITY) > > > + limp->rlim_cur += p->p_vmspace->vm_stkgap; > > > + > > > oldssiz.rlim_cur = 0; > > > newlim = lim_alloc(); > > > PROC_LOCK(p); > > > diff --git a/sys/sys/imgact_elf.h b/sys/sys/imgact_elf.h > > > index 97383c6eeeb8..294f17c87b6f 100644 > > > --- a/sys/sys/imgact_elf.h > > > +++ b/sys/sys/imgact_elf.h > > > @@ -118,7 +118,7 @@ int __elfN(remove_brand_entry)(Elf_Brandinfo > > *entry > > > ); > > > int __elfN(freebsd_fixup)(uintptr_t *, struct image_params *); > > > int __elfN(coredump)(struct thread *, struct vnode *, off_t, int); > > > size_t __elfN(populate_note)(int, void *, void *, size_t, void > > **); > > > -void __elfN(stackgap)(struct image_params *, uintptr_t *); > > > +vm_size_t __elfN(stackgap)(struct image_params *, uintptr_t *); > > > int __elfN(freebsd_copyout_auxargs)(struct image_params *, uintptr_t); > > > void __elfN(puthdr)(struct thread *, void *, size_t, int, size_t, int); > > > void __elfN(prepare_notes)(struct thread *, struct note_info_list *, > > > diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h > > > index ad50bf56e87d..ea96c87a79af 100644 > > > --- a/sys/sys/sysent.h > > > +++ b/sys/sys/sysent.h > > > @@ -119,7 +119,7 @@ struct sysentvec { > > > void (*sv_elf_core_prepare_notes)(struct thread *, > > > struct note_info_list *, size_t *); > > > int (*sv_imgact_try)(struct image_params *); > > > - void (*sv_stackgap)(struct image_params *, uintptr_t *); > > > + vm_size_t (*sv_stackgap)(struct image_params *, uintptr_t *); > > > int (*sv_copyout_auxargs)(struct image_params *, > > > uintptr_t); > > > int sv_minsigstksz; /* minimum signal stack size */ > > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > > > index 1ac4ccf72f11..87a290b998b9 100644 > > > --- a/sys/vm/vm_map.c > > > +++ b/sys/vm/vm_map.c > > > @@ -343,6 +343,7 @@ vmspace_alloc(vm_offset_t min, vm_offset_t max, > > pmap_pini > > > t_t pinit) > > > vm->vm_taddr = 0; > > > vm->vm_daddr = 0; > > > vm->vm_maxsaddr = 0; > > > + vm->vm_stkgap = 0; > > > return (vm); > > > } > > > > > > @@ -4265,6 +4266,7 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t > > *fork_ch > > > arge) > > > vm2->vm_taddr = vm1->vm_taddr; > > > vm2->vm_daddr = vm1->vm_daddr; > > > vm2->vm_maxsaddr = vm1->vm_maxsaddr; > > > + vm2->vm_stkgap = vm1->vm_stkgap; > > > vm_map_lock(old_map); > > > if (old_map->busy) > > > vm_map_wait_busy(old_map); > > > diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h > > > index ace205b21b42..873ff62eec4a 100644 > > > --- a/sys/vm/vm_map.h > > > +++ b/sys/vm/vm_map.h > > > @@ -293,6 +293,7 @@ struct vmspace { > > > caddr_t vm_taddr; /* (c) user virtual address of text */ > > > caddr_t vm_daddr; /* (c) user virtual address of data */ > > > caddr_t vm_maxsaddr; /* user VA at max stack growth */ > > > + vm_size_t vm_stkgap; /* stack gap size in bytes */ > > > u_int vm_refcnt; /* number of references */ > > > /* > > > * Keep the PMAP last, so that CPU-specific variations of that > > > > > > > Is it possible to have a __FreeBSD_version bump for ports? > > > > There was a bump for linuxkpi you should use for this. It was a day or so > after the stackgap change. That's the one I intend to use. I used the prior one at the time but will update the patch to use this one instead. Probably today sometime. -- 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 nobody Mon Oct 18 13:32:44 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D9B9717F7396; Mon, 18 Oct 2021 13:32: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 4HXyVN5h6zz4p0v; Mon, 18 Oct 2021 13:32: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 A3BE6213EB; Mon, 18 Oct 2021 13:32: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 19IDWiIY026218; Mon, 18 Oct 2021 13:32:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IDWiRF026217; Mon, 18 Oct 2021 13:32:44 GMT (envelope-from git) Date: Mon, 18 Oct 2021 13:32:44 GMT Message-Id: <202110181332.19IDWiRF026217@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: 6deacc1b3b7a - main - stress2: Move test added by mistake Reported by: markj List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 6deacc1b3b7a11eee90815d51fb046f019ecfa6a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=6deacc1b3b7a11eee90815d51fb046f019ecfa6a commit 6deacc1b3b7a11eee90815d51fb046f019ecfa6a Author: Peter Holm AuthorDate: 2021-10-18 13:30:42 +0000 Commit: Peter Holm CommitDate: 2021-10-18 13:30:42 +0000 stress2: Move test added by mistake Reported by: markj --- syzkaller45.sh => tools/test/stress2/misc/syzkaller45.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/syzkaller45.sh b/tools/test/stress2/misc/syzkaller45.sh similarity index 100% rename from syzkaller45.sh rename to tools/test/stress2/misc/syzkaller45.sh From nobody Mon Oct 18 14:08:09 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2C79618042BB; Mon, 18 Oct 2021 14:08: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 4HXzHG0f8Kz3C0n; Mon, 18 Oct 2021 14:08: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 E5B1421AF3; Mon, 18 Oct 2021 14:08: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 19IE89ip066376; Mon, 18 Oct 2021 14:08:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IE89dK066375; Mon, 18 Oct 2021 14:08:09 GMT (envelope-from git) Date: Mon, 18 Oct 2021 14:08:09 GMT Message-Id: <202110181408.19IE89dK066375@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: b0423d0f5eec - main - amd64: Zero the PML5 PTI page when initializing a pmap List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: b0423d0f5eec89bd6c11c32649603031e3dbbfe1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b0423d0f5eec89bd6c11c32649603031e3dbbfe1 commit b0423d0f5eec89bd6c11c32649603031e3dbbfe1 Author: Mark Johnston AuthorDate: 2021-10-18 13:29:20 +0000 Commit: Mark Johnston CommitDate: 2021-10-18 13:50:42 +0000 amd64: Zero the PML5 PTI page when initializing a pmap The root page is not zeroed at allocation time since with 4-level tables each entry is copied from a template. However, with 5-level tables only a single entry is filled, so the rest need to be cleared. Reported by: alc Reviewed by: alc, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32525 --- sys/amd64/amd64/pmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index f1ddbe548c0f..168c9eec1b66 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -4293,6 +4293,7 @@ pmap_pinit_pml5_pti(vm_page_t pml5pgu) pml5_entry_t *pm_pml5u; pm_pml5u = (pml5_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pml5pgu)); + pagezero(pm_pml5u); /* * Add pml5 entry at top of KVA pointing to existing pml4 pti From nobody Mon Oct 18 14:08:10 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A1991180442F; Mon, 18 Oct 2021 14:08: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 4HXzHH1Pnvz3CD3; Mon, 18 Oct 2021 14:08: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 0FD1C21D45; Mon, 18 Oct 2021 14:08: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 19IE8AR1066400; Mon, 18 Oct 2021 14:08:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IE8AK1066399; Mon, 18 Oct 2021 14:08:10 GMT (envelope-from git) Date: Mon, 18 Oct 2021 14:08:10 GMT Message-Id: <202110181408.19IE8AK1066399@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: 36e4dcf47d45 - main - safexcel: Set the context record unconditionally List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 36e4dcf47d45bbb87875ee4a9f5cc26a72a9f048 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=36e4dcf47d45bbb87875ee4a9f5cc26a72a9f048 commit 36e4dcf47d45bbb87875ee4a9f5cc26a72a9f048 Author: Mark Johnston AuthorDate: 2021-10-18 13:40:47 +0000 Commit: Mark Johnston CommitDate: 2021-10-18 13:50:42 +0000 safexcel: Set the context record unconditionally The condition added in commit 5bdb8b273aaf excludes plain SHA transforms, so for such sessions crypto operations would return incorrect results. Fixes: 5bdb8b273aaf ("safexcel: Maintain per-session context records") MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/dev/safexcel/safexcel.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/sys/dev/safexcel/safexcel.c b/sys/dev/safexcel/safexcel.c index b844a167b078..36bd65642403 100644 --- a/sys/dev/safexcel/safexcel.c +++ b/sys/dev/safexcel/safexcel.c @@ -2520,15 +2520,12 @@ safexcel_newsession(device_t dev, crypto_session_t cses, if (csp->csp_auth_mlen != 0) sess->digestlen = csp->csp_auth_mlen; - if ((csp->csp_cipher_alg == 0 || csp->csp_cipher_key != NULL) && - (csp->csp_auth_alg == 0 || csp->csp_auth_key != NULL)) { - sess->encctx.len = safexcel_set_context(&sess->encctx.ctx, - CRYPTO_OP_ENCRYPT, csp->csp_cipher_key, csp->csp_auth_key, - sess); - sess->decctx.len = safexcel_set_context(&sess->decctx.ctx, - CRYPTO_OP_DECRYPT, csp->csp_cipher_key, csp->csp_auth_key, - sess); - } + sess->encctx.len = safexcel_set_context(&sess->encctx.ctx, + CRYPTO_OP_ENCRYPT, csp->csp_cipher_key, csp->csp_auth_key, + sess); + sess->decctx.len = safexcel_set_context(&sess->decctx.ctx, + CRYPTO_OP_DECRYPT, csp->csp_cipher_key, csp->csp_auth_key, + sess); return (0); } From nobody Mon Oct 18 14:08:12 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D67E21804275; Mon, 18 Oct 2021 14:08: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 4HXzHJ2v87z3C89; Mon, 18 Oct 2021 14:08: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 2D31421D46; Mon, 18 Oct 2021 14:08: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 19IE8CWO066424; Mon, 18 Oct 2021 14:08:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IE8CSq066423; Mon, 18 Oct 2021 14:08:12 GMT (envelope-from git) Date: Mon, 18 Oct 2021 14:08:12 GMT Message-Id: <202110181408.19IE8CSq066423@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: 51425cb2107c - main - bitset: Reimplement BIT_FOREACH_IS(SET|CLR) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 51425cb2107c07ff379639edfbad65c77b55c3b8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=51425cb2107c07ff379639edfbad65c77b55c3b8 commit 51425cb2107c07ff379639edfbad65c77b55c3b8 Author: Mark Johnston AuthorDate: 2021-10-16 13:38:26 +0000 Commit: Mark Johnston CommitDate: 2021-10-18 13:56:58 +0000 bitset: Reimplement BIT_FOREACH_IS(SET|CLR) Eliminate the nested loops and re-implement following a suggestion from rlibby. Add some simple regression tests. Reviewed by: rlibby, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32472 --- share/man/man9/bitset.9 | 4 +++ sys/sys/bitset.h | 31 ++++++++++++---- tests/sys/sys/Makefile | 7 +++- tests/sys/sys/bitset_test.c | 88 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 123 insertions(+), 7 deletions(-) diff --git a/share/man/man9/bitset.9 b/share/man/man9/bitset.9 index 5788f09f2465..1a5ec05b01c6 100644 --- a/share/man/man9/bitset.9 +++ b/share/man/man9/bitset.9 @@ -357,6 +357,10 @@ Similarly, .Fn BIT_FOREACH_ISCLR iterates over all clear bits in .Fa bitset . +In the loop body, the currently indexed bit may be set or cleared. +However, setting or clearing bits other than the currently indexed +bit does not guarantee that they will or will not be returned in +subsequent iterations of the same loop. .Pp The .Fn BIT_COUNT diff --git a/sys/sys/bitset.h b/sys/sys/bitset.h index ab6eaf85b8df..1c154d5601ab 100644 --- a/sys/sys/bitset.h +++ b/sys/sys/bitset.h @@ -271,12 +271,31 @@ __count; \ }) -/* Non-destructively loop over all set or clear bits in the set. */ -#define _BIT_FOREACH(_s, i, p, op) \ - for (__size_t __i = 0; __i < __bitset_words(_s); __i++) \ - for (long __j = op((p)->__bits[__i]), __b = ffsl(__j); \ - (i = (__b - 1) + __i * _BITSET_BITS), __j != 0; \ - __j &= ~(1l << i), __b = ffsl(__j)) +#define _BIT_FOREACH_ADVANCE(_s, i, p, op) __extension__ ({ \ + int __found; \ + for (;;) { \ + if (__bits != 0) { \ + int __bit = ffsl(__bits) - 1; \ + __bits &= ~(1ul << __bit); \ + (i) = __i * _BITSET_BITS + __bit; \ + __found = 1; \ + break; \ + } \ + if (++__i == __bitset_words(_s)) { \ + __found = 0; \ + break; \ + } \ + __bits = op((p)->__bits[__i]); \ + } \ + __found != 0; \ +}) + +/* + * Non-destructively loop over all set or clear bits in the set. + */ +#define _BIT_FOREACH(_s, i, p, op) \ + for (long __i = -1, __bits = 0; \ + _BIT_FOREACH_ADVANCE(_s, i, p, op); ) #define BIT_FOREACH_ISSET(_s, i, p) _BIT_FOREACH(_s, i, p, ) #define BIT_FOREACH_ISCLR(_s, i, p) _BIT_FOREACH(_s, i, p, ~) diff --git a/tests/sys/sys/Makefile b/tests/sys/sys/Makefile index 95739c127632..f6c45971d93c 100644 --- a/tests/sys/sys/Makefile +++ b/tests/sys/sys/Makefile @@ -4,7 +4,12 @@ TESTSDIR= ${TESTSBASE}/sys/sys -ATF_TESTS_C= arb_test bitstring_test qmath_test rb_test splay_test +ATF_TESTS_C= arb_test \ + bitset_test \ + bitstring_test \ + qmath_test \ + rb_test \ + splay_test .if ${COMPILER_TYPE} == "gcc" CFLAGS.bitstring_test= -fno-strict-overflow diff --git a/tests/sys/sys/bitset_test.c b/tests/sys/sys/bitset_test.c new file mode 100644 index 000000000000..781b523dae97 --- /dev/null +++ b/tests/sys/sys/bitset_test.c @@ -0,0 +1,88 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 The FreeBSD Foundation + * + * This software was developed by Mark Johnston under sponsorship from + * the FreeBSD Foundation. + */ + +#include +#include +#include +#include +#include + +#include + +BITSET_DEFINE(bs256, 256); + +ATF_TC_WITHOUT_HEAD(bit_foreach); +ATF_TC_BODY(bit_foreach, tc) +{ + struct bs256 bs0, bs1, bsrand; + int setc, clrc, i; + +#define _BIT_FOREACH_COUNT(s, bs) do { \ + int prev = -1; \ + setc = clrc = 0; \ + BIT_FOREACH_ISSET((s), i, (bs)) { \ + ATF_REQUIRE_MSG(prev < i, "incorrect bit ordering"); \ + ATF_REQUIRE_MSG(BIT_ISSET((s), i, (bs)), \ + "bit %d is not set", i); \ + setc++; \ + prev = i; \ + } \ + prev = -1; \ + BIT_FOREACH_ISCLR((s), i, (bs)) { \ + ATF_REQUIRE_MSG(prev < i, "incorrect bit ordering"); \ + ATF_REQUIRE_MSG(!BIT_ISSET((s), i, (bs)), \ + "bit %d is set", i); \ + clrc++; \ + prev = i; \ + } \ +} while (0) + + /* + * Create several bitsets, and for each one count the number + * of set and clear bits and make sure they match what we expect. + */ + + BIT_FILL(256, &bs1); + _BIT_FOREACH_COUNT(256, &bs1); + ATF_REQUIRE_MSG(setc == 256, "incorrect set count %d", setc); + ATF_REQUIRE_MSG(clrc == 0, "incorrect clear count %d", clrc); + + BIT_ZERO(256, &bs0); + _BIT_FOREACH_COUNT(256, &bs0); + ATF_REQUIRE_MSG(setc == 0, "incorrect set count %d", setc); + ATF_REQUIRE_MSG(clrc == 256, "incorrect clear count %d", clrc); + + BIT_ZERO(256, &bsrand); + for (i = 0; i < 256; i++) + if (random() % 2 != 0) + BIT_SET(256, i, &bsrand); + _BIT_FOREACH_COUNT(256, &bsrand); + ATF_REQUIRE_MSG(setc + clrc == 256, "incorrect counts %d, %d", + setc, clrc); + + /* + * Try to verify that we can safely clear bits in the set while + * iterating. + */ + BIT_FOREACH_ISSET(256, i, &bsrand) { + ATF_REQUIRE(setc-- > 0); + BIT_CLR(256, i, &bsrand); + } + _BIT_FOREACH_COUNT(256, &bsrand); + ATF_REQUIRE_MSG(setc == 0, "incorrect set count %d", setc); + ATF_REQUIRE_MSG(clrc == 256, "incorrect clear count %d", clrc); + +#undef _BIT_FOREACH_COUNT +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, bit_foreach); + return (atf_no_error()); +} From nobody Mon Oct 18 14:08:13 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8135D18043D0; Mon, 18 Oct 2021 14: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 4HXzHK4bxBz3C8L; Mon, 18 Oct 2021 14:08: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 5655721E88; Mon, 18 Oct 2021 14:08: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 19IE8DSk066448; Mon, 18 Oct 2021 14:08:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IE8Deb066447; Mon, 18 Oct 2021 14:08:13 GMT (envelope-from git) Date: Mon, 18 Oct 2021 14:08:13 GMT Message-Id: <202110181408.19IE8Deb066447@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: de8554295b47 - main - cpuset(9): Add CPU_FOREACH_IS(SET|CLR) and modify consumers to use it List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: de8554295b47475e758a573ab7418265f21fee7e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=de8554295b47475e758a573ab7418265f21fee7e commit de8554295b47475e758a573ab7418265f21fee7e Author: Mark Johnston AuthorDate: 2021-09-21 15:36:55 +0000 Commit: Mark Johnston CommitDate: 2021-10-18 13:56:58 +0000 cpuset(9): Add CPU_FOREACH_IS(SET|CLR) and modify consumers to use it This implementation is faster and doesn't modify the cpuset, so it lets us avoid some unnecessary copying as well. No functional change intended. This is a re-application of commit 9068f6ea697b1b28ad1326a4c7a9ba86f08b985e. Reviewed by: cem, kib, jhb MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32029 --- sys/amd64/amd64/mp_machdep.c | 11 +++-------- sys/amd64/vmm/io/vlapic.c | 13 +++---------- sys/amd64/vmm/vmm_lapic.c | 4 +--- sys/i386/i386/mp_machdep.c | 4 +--- sys/sys/cpuset.h | 2 ++ sys/x86/x86/mp_x86.c | 4 +--- 6 files changed, 11 insertions(+), 27 deletions(-) diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 6c66bd622855..16ec277e9c34 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -618,7 +618,7 @@ static void smp_targeted_tlb_shootdown(cpuset_t mask, pmap_t pmap, vm_offset_t addr1, vm_offset_t addr2, smp_invl_cb_t curcpu_cb, enum invl_op_codes op) { - cpuset_t other_cpus, mask1; + cpuset_t other_cpus; uint32_t generation, *p_cpudone; int cpu; bool is_all; @@ -662,10 +662,7 @@ smp_targeted_tlb_shootdown(cpuset_t mask, pmap_t pmap, vm_offset_t addr1, /* Fence between filling smp_tlb fields and clearing scoreboard. */ atomic_thread_fence_rel(); - mask1 = mask; - while ((cpu = CPU_FFS(&mask1)) != 0) { - cpu--; - CPU_CLR(cpu, &mask1); + CPU_FOREACH_ISSET(cpu, &mask) { KASSERT(*invl_scoreboard_slot(cpu) != 0, ("IPI scoreboard is zero, initiator %d target %d", PCPU_GET(cpuid), cpu)); @@ -686,9 +683,7 @@ smp_targeted_tlb_shootdown(cpuset_t mask, pmap_t pmap, vm_offset_t addr1, ipi_selected(mask, IPI_INVLOP); } curcpu_cb(pmap, addr1, addr2); - while ((cpu = CPU_FFS(&other_cpus)) != 0) { - cpu--; - CPU_CLR(cpu, &other_cpus); + CPU_FOREACH_ISSET(cpu, &other_cpus) { p_cpudone = invl_scoreboard_slot(cpu); while (atomic_load_int(p_cpudone) != generation) ia32_pause(); diff --git a/sys/amd64/vmm/io/vlapic.c b/sys/amd64/vmm/io/vlapic.c index 06df1c1a87e5..4e7ddbafd447 100644 --- a/sys/amd64/vmm/io/vlapic.c +++ b/sys/amd64/vmm/io/vlapic.c @@ -860,10 +860,7 @@ vlapic_calcdest(struct vm *vm, cpuset_t *dmask, uint32_t dest, bool phys, */ CPU_ZERO(dmask); amask = vm_active_cpus(vm); - while ((vcpuid = CPU_FFS(&amask)) != 0) { - vcpuid--; - CPU_CLR(vcpuid, &amask); - + CPU_FOREACH_ISSET(vcpuid, &amask) { vlapic = vm_lapic(vm, vcpuid); dfr = vlapic->apic_page->dfr; ldr = vlapic->apic_page->ldr; @@ -1003,9 +1000,7 @@ vlapic_icrlo_write_handler(struct vlapic *vlapic, bool *retu) break; } - while ((i = CPU_FFS(&dmask)) != 0) { - i--; - CPU_CLR(i, &dmask); + CPU_FOREACH_ISSET(i, &dmask) { if (mode == APIC_DELMODE_FIXED) { lapic_intr_edge(vlapic->vm, i, vec); vmm_stat_array_incr(vlapic->vm, vlapic->vcpuid, @@ -1554,9 +1549,7 @@ vlapic_deliver_intr(struct vm *vm, bool level, uint32_t dest, bool phys, */ vlapic_calcdest(vm, &dmask, dest, phys, lowprio, false); - while ((vcpuid = CPU_FFS(&dmask)) != 0) { - vcpuid--; - CPU_CLR(vcpuid, &dmask); + CPU_FOREACH_ISSET(vcpuid, &dmask) { if (delmode == IOART_DELEXINT) { vm_inject_extint(vm, vcpuid); } else { diff --git a/sys/amd64/vmm/vmm_lapic.c b/sys/amd64/vmm/vmm_lapic.c index 89a1ebc8eff9..8191da758100 100644 --- a/sys/amd64/vmm/vmm_lapic.c +++ b/sys/amd64/vmm/vmm_lapic.c @@ -87,9 +87,7 @@ lapic_set_local_intr(struct vm *vm, int cpu, int vector) else CPU_SETOF(cpu, &dmask); error = 0; - while ((cpu = CPU_FFS(&dmask)) != 0) { - cpu--; - CPU_CLR(cpu, &dmask); + CPU_FOREACH_ISSET(cpu, &dmask) { vlapic = vm_lapic(vm, cpu); error = vlapic_trigger_lvt(vlapic, vector); if (error) diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c index 156702118c45..777aefa021b3 100644 --- a/sys/i386/i386/mp_machdep.c +++ b/sys/i386/i386/mp_machdep.c @@ -598,9 +598,7 @@ smp_targeted_tlb_shootdown(cpuset_t mask, u_int vector, pmap_t pmap, ipi_selected(mask, vector); } curcpu_cb(pmap, addr1, addr2); - while ((cpu = CPU_FFS(&other_cpus)) != 0) { - cpu--; - CPU_CLR(cpu, &other_cpus); + CPU_FOREACH_ISSET(cpu, &other_cpus) { p_cpudone = &cpuid_to_pcpu[cpu]->pc_smp_tlb_done; while (*p_cpudone != generation) ia32_pause(); diff --git a/sys/sys/cpuset.h b/sys/sys/cpuset.h index 1a96bb4766ce..9ef1a65f4506 100644 --- a/sys/sys/cpuset.h +++ b/sys/sys/cpuset.h @@ -66,6 +66,8 @@ #define CPU_COPY_STORE_REL(f, t) BIT_COPY_STORE_REL(CPU_SETSIZE, f, t) #define CPU_FFS(p) BIT_FFS(CPU_SETSIZE, p) #define CPU_FLS(p) BIT_FLS(CPU_SETSIZE, p) +#define CPU_FOREACH_ISSET(i, p) BIT_FOREACH_ISSET(CPU_SETSIZE, i, p) +#define CPU_FOREACH_ISCLR(i, p) BIT_FOREACH_ISCLR(CPU_SETSIZE, i, p) #define CPU_COUNT(p) ((int)BIT_COUNT(CPU_SETSIZE, p)) #define CPUSET_FSET BITSET_FSET(_NCPUWORDS) #define CPUSET_T_INITIALIZER BITSET_T_INITIALIZER diff --git a/sys/x86/x86/mp_x86.c b/sys/x86/x86/mp_x86.c index 54ca82a2c90d..ca1125886619 100644 --- a/sys/x86/x86/mp_x86.c +++ b/sys/x86/x86/mp_x86.c @@ -1346,9 +1346,7 @@ ipi_selected(cpuset_t cpus, u_int ipi) if (ipi == IPI_STOP_HARD) CPU_OR_ATOMIC(&ipi_stop_nmi_pending, &cpus); - while ((cpu = CPU_FFS(&cpus)) != 0) { - cpu--; - CPU_CLR(cpu, &cpus); + CPU_FOREACH_ISSET(cpu, &cpus) { CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu, ipi); ipi_send_cpu(cpu, ipi); } From nobody Mon Oct 18 14:08:14 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6109018042E6; Mon, 18 Oct 2021 14:08: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 4HXzHL6KDtz3C13; Mon, 18 Oct 2021 14: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 75F0621AF4; Mon, 18 Oct 2021 14: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 19IE8Ep2066478; Mon, 18 Oct 2021 14: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 19IE8EQq066477; Mon, 18 Oct 2021 14:08:14 GMT (envelope-from git) Date: Mon, 18 Oct 2021 14:08:14 GMT Message-Id: <202110181408.19IE8EQq066477@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: 81f2e9063d64 - main - signal: Add SIG_FOREACH and refactor issignal() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 81f2e9063d64cc976b47e7ee1e9c35692cda7cb4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=81f2e9063d64cc976b47e7ee1e9c35692cda7cb4 commit 81f2e9063d64cc976b47e7ee1e9c35692cda7cb4 Author: Mark Johnston AuthorDate: 2021-10-16 13:44:40 +0000 Commit: Mark Johnston CommitDate: 2021-10-18 13:56:58 +0000 signal: Add SIG_FOREACH and refactor issignal() Add a SIG_FOREACH macro that can be used to iterate over a signal set. This is a bit cleaner and more efficient than calling sig_ffs() in a loop. The implementation is based on BIT_FOREACH_ISSET(), except that the bitset limbs are always 32 bits wide, and signal sets are 1-indexed rather than 0-indexed like bitset(9) sets. issignal() cannot really be modified to use SIG_FOREACH() directly. Take this opportunity to split the function into two explicit loops. I've always found this function hard to read and think that this change is an improvement. Remove sig_ffs(), nothing uses it now. Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32473 --- sys/kern/kern_sig.c | 386 +++++++++++++++++++++++++++++----------------------- sys/sys/signalvar.h | 1 - 2 files changed, 217 insertions(+), 170 deletions(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index b7155074aa5a..d6826e8dc507 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -249,6 +249,29 @@ static int sigproptbl[NSIG] = { [SIGUSR2] = SIGPROP_KILL, }; +#define _SIG_FOREACH_ADVANCE(i, set) ({ \ + int __found; \ + for (;;) { \ + if (__bits != 0) { \ + int __sig = ffs(__bits); \ + __bits &= ~(1u << (__sig - 1)); \ + sig = __i * sizeof((set)->__bits[0]) * NBBY + __sig; \ + __found = 1; \ + break; \ + } \ + if (++__i == _SIG_WORDS) { \ + __found = 0; \ + break; \ + } \ + __bits = (set)->__bits[__i]; \ + } \ + __found != 0; \ +}) + +#define SIG_FOREACH(i, set) \ + for (int32_t __i = -1, __bits = 0; \ + _SIG_FOREACH_ADVANCE(i, set); ) \ + sigset_t fastblock_mask; static void @@ -660,17 +683,6 @@ sigprop(int sig) return (0); } -int -sig_ffs(sigset_t *set) -{ - int i; - - for (i = 0; i < _SIG_WORDS; i++) - if (set->__bits[i]) - return (ffs(set->__bits[i]) + (i * 32)); - return (0); -} - static bool sigact_flag_test(const struct sigaction *act, int flag) { @@ -2761,8 +2773,7 @@ reschedule_signals(struct proc *p, sigset_t block, int flags) return; SIGSETAND(block, p->p_siglist); fastblk = (flags & SIGPROCMASK_FASTBLK) != 0; - while ((sig = sig_ffs(&block)) != 0) { - SIGDELSET(block, sig); + SIG_FOREACH(sig, &block) { td = sigtd(p, sig, fastblk); /* @@ -2894,13 +2905,188 @@ sigallowstop_impl(int prev) } } +enum sigstatus { + SIGSTATUS_HANDLE, + SIGSTATUS_HANDLED, + SIGSTATUS_IGNORE, + SIGSTATUS_SBDRY_STOP, +}; + +/* + * The thread has signal "sig" pending. Figure out what to do with it: + * + * _HANDLE -> the caller should handle the signal + * _HANDLED -> handled internally, reload pending signal set + * _IGNORE -> ignored, remove from the set of pending signals and try the + * next pending signal + * _SBDRY_STOP -> the signal should stop the thread but this is not + * permitted in the current context + */ +static enum sigstatus +sigprocess(struct thread *td, int sig) +{ + struct proc *p; + struct sigacts *ps; + struct sigqueue *queue; + ksiginfo_t ksi; + int prop; + + KASSERT(_SIG_VALID(sig), ("%s: invalid signal %d", __func__, sig)); + + p = td->td_proc; + ps = p->p_sigacts; + mtx_assert(&ps->ps_mtx, MA_OWNED); + PROC_LOCK_ASSERT(p, MA_OWNED); + + /* + * We should allow pending but ignored signals below + * only if there is sigwait() active, or P_TRACED was + * on when they were posted. + */ + if (SIGISMEMBER(ps->ps_sigignore, sig) && + (p->p_flag & P_TRACED) == 0 && + (td->td_flags & TDF_SIGWAIT) == 0) { + return (SIGSTATUS_IGNORE); + } + + if ((p->p_flag & (P_TRACED | P_PPTRACE)) == P_TRACED) { + /* + * If traced, always stop. + * Remove old signal from queue before the stop. + * XXX shrug off debugger, it causes siginfo to + * be thrown away. + */ + queue = &td->td_sigqueue; + ksiginfo_init(&ksi); + if (sigqueue_get(queue, sig, &ksi) == 0) { + queue = &p->p_sigqueue; + sigqueue_get(queue, sig, &ksi); + } + td->td_si = ksi.ksi_info; + + mtx_unlock(&ps->ps_mtx); + sig = ptracestop(td, sig, &ksi); + mtx_lock(&ps->ps_mtx); + + td->td_si.si_signo = 0; + + /* + * Keep looking if the debugger discarded or + * replaced the signal. + */ + if (sig == 0) + return (SIGSTATUS_HANDLED); + + /* + * If the signal became masked, re-queue it. + */ + if (SIGISMEMBER(td->td_sigmask, sig)) { + ksi.ksi_flags |= KSI_HEAD; + sigqueue_add(&p->p_sigqueue, sig, &ksi); + return (SIGSTATUS_HANDLED); + } + + /* + * If the traced bit got turned off, requeue the signal and + * reload the set of pending signals. This ensures that p_sig* + * and p_sigact are consistent. + */ + if ((p->p_flag & P_TRACED) == 0) { + ksi.ksi_flags |= KSI_HEAD; + sigqueue_add(queue, sig, &ksi); + return (SIGSTATUS_HANDLED); + } + } + + /* + * Decide whether the signal should be returned. + * Return the signal's number, or fall through + * to clear it from the pending mask. + */ + switch ((intptr_t)p->p_sigacts->ps_sigact[_SIG_IDX(sig)]) { + case (intptr_t)SIG_DFL: + /* + * Don't take default actions on system processes. + */ + if (p->p_pid <= 1) { +#ifdef DIAGNOSTIC + /* + * Are you sure you want to ignore SIGSEGV + * in init? XXX + */ + printf("Process (pid %lu) got signal %d\n", + (u_long)p->p_pid, sig); +#endif + return (SIGSTATUS_IGNORE); + } + + /* + * If there is a pending stop signal to process with + * default action, stop here, then clear the signal. + * Traced or exiting processes should ignore stops. + * Additionally, a member of an orphaned process group + * should ignore tty stops. + */ + prop = sigprop(sig); + if (prop & SIGPROP_STOP) { + mtx_unlock(&ps->ps_mtx); + if ((p->p_flag & (P_TRACED | P_WEXIT | + P_SINGLE_EXIT)) != 0 || ((p->p_pgrp-> + pg_flags & PGRP_ORPHANED) != 0 && + (prop & SIGPROP_TTYSTOP) != 0)) { + mtx_lock(&ps->ps_mtx); + return (SIGSTATUS_IGNORE); + } + if (TD_SBDRY_INTR(td)) { + KASSERT((td->td_flags & TDF_SBDRY) != 0, + ("lost TDF_SBDRY")); + mtx_lock(&ps->ps_mtx); + return (SIGSTATUS_SBDRY_STOP); + } + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, + &p->p_mtx.lock_object, "Catching SIGSTOP"); + sigqueue_delete(&td->td_sigqueue, sig); + sigqueue_delete(&p->p_sigqueue, sig); + p->p_flag |= P_STOPPED_SIG; + p->p_xsig = sig; + PROC_SLOCK(p); + sig_suspend_threads(td, p, 0); + thread_suspend_switch(td, p); + PROC_SUNLOCK(p); + mtx_lock(&ps->ps_mtx); + return (SIGSTATUS_HANDLED); + } else if ((prop & SIGPROP_IGNORE) != 0 && + (td->td_flags & TDF_SIGWAIT) == 0) { + /* + * Default action is to ignore; drop it if + * not in kern_sigtimedwait(). + */ + return (SIGSTATUS_IGNORE); + } else { + return (SIGSTATUS_HANDLE); + } + + case (intptr_t)SIG_IGN: + if ((td->td_flags & TDF_SIGWAIT) == 0) + return (SIGSTATUS_IGNORE); + else + return (SIGSTATUS_HANDLE); + + default: + /* + * This signal has an action, let postsig() process it. + */ + return (SIGSTATUS_HANDLE); + } +} + /* * If the current process has received a signal (should be caught or cause * termination, should interrupt current syscall), return the signal number. * Stop signals with default action are processed immediately, then cleared; * they aren't returned. This is checked after each entry to the system for - * a syscall or trap (though this can usually be done without calling issignal - * by checking the pending signal masks in cursig.) The normal call + * a syscall or trap (though this can usually be done without calling + * issignal by checking the pending signal masks in cursig.) The normal call * sequence is * * while (sig = cursig(curthread)) @@ -2910,16 +3096,12 @@ static int issignal(struct thread *td) { struct proc *p; - struct sigacts *ps; - struct sigqueue *queue; sigset_t sigpending; - ksiginfo_t ksi; - int prop, sig; + int sig; p = td->td_proc; - ps = p->p_sigacts; - mtx_assert(&ps->ps_mtx, MA_OWNED); PROC_LOCK_ASSERT(p, MA_OWNED); + for (;;) { sigpending = td->td_sigqueue.sq_signals; SIGSETOR(sigpending, p->p_sigqueue.sq_signals); @@ -2957,160 +3139,27 @@ issignal(struct thread *td) * execute the debugger attach ritual in * order. */ - sig = SIGSTOP; td->td_dbgflags |= TDB_FSTP; - } else { - sig = sig_ffs(&sigpending); + SIGEMPTYSET(sigpending); + SIGADDSET(sigpending, SIGSTOP); } - /* - * We should allow pending but ignored signals below - * only if there is sigwait() active, or P_TRACED was - * on when they were posted. - */ - if (SIGISMEMBER(ps->ps_sigignore, sig) && - (p->p_flag & P_TRACED) == 0 && - (td->td_flags & TDF_SIGWAIT) == 0) { - sigqueue_delete(&td->td_sigqueue, sig); - sigqueue_delete(&p->p_sigqueue, sig); - continue; - } - if ((p->p_flag & (P_TRACED | P_PPTRACE)) == P_TRACED) { - /* - * If traced, always stop. - * Remove old signal from queue before the stop. - * XXX shrug off debugger, it causes siginfo to - * be thrown away. - */ - queue = &td->td_sigqueue; - ksiginfo_init(&ksi); - if (sigqueue_get(queue, sig, &ksi) == 0) { - queue = &p->p_sigqueue; - sigqueue_get(queue, sig, &ksi); - } - td->td_si = ksi.ksi_info; - - mtx_unlock(&ps->ps_mtx); - sig = ptracestop(td, sig, &ksi); - mtx_lock(&ps->ps_mtx); - - td->td_si.si_signo = 0; - - /* - * Keep looking if the debugger discarded or - * replaced the signal. - */ - if (sig == 0) - continue; - - /* - * If the signal became masked, re-queue it. - */ - if (SIGISMEMBER(td->td_sigmask, sig)) { - ksi.ksi_flags |= KSI_HEAD; - sigqueue_add(&p->p_sigqueue, sig, &ksi); - continue; - } - - /* - * If the traced bit got turned off, requeue - * the signal and go back up to the top to - * rescan signals. This ensures that p_sig* - * and p_sigact are consistent. - */ - if ((p->p_flag & P_TRACED) == 0) { - ksi.ksi_flags |= KSI_HEAD; - sigqueue_add(queue, sig, &ksi); - continue; - } - } - - prop = sigprop(sig); - - /* - * Decide whether the signal should be returned. - * Return the signal's number, or fall through - * to clear it from the pending mask. - */ - switch ((intptr_t)p->p_sigacts->ps_sigact[_SIG_IDX(sig)]) { - case (intptr_t)SIG_DFL: - /* - * Don't take default actions on system processes. - */ - if (p->p_pid <= 1) { -#ifdef DIAGNOSTIC - /* - * Are you sure you want to ignore SIGSEGV - * in init? XXX - */ - printf("Process (pid %lu) got signal %d\n", - (u_long)p->p_pid, sig); -#endif - break; /* == ignore */ - } - /* - * If there is a pending stop signal to process with - * default action, stop here, then clear the signal. - * Traced or exiting processes should ignore stops. - * Additionally, a member of an orphaned process group - * should ignore tty stops. - */ - if (prop & SIGPROP_STOP) { - mtx_unlock(&ps->ps_mtx); - if ((p->p_flag & (P_TRACED | P_WEXIT | - P_SINGLE_EXIT)) != 0 || ((p->p_pgrp-> - pg_flags & PGRP_ORPHANED) != 0 && - (prop & SIGPROP_TTYSTOP) != 0)) { - mtx_lock(&ps->ps_mtx); - break; /* == ignore */ - } - if (TD_SBDRY_INTR(td)) { - KASSERT((td->td_flags & TDF_SBDRY) != 0, - ("lost TDF_SBDRY")); - mtx_lock(&ps->ps_mtx); - return (-1); - } - WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, - &p->p_mtx.lock_object, "Catching SIGSTOP"); + SIG_FOREACH(sig, &sigpending) { + switch (sigprocess(td, sig)) { + case SIGSTATUS_HANDLE: + return (sig); + case SIGSTATUS_HANDLED: + goto next; + case SIGSTATUS_IGNORE: sigqueue_delete(&td->td_sigqueue, sig); sigqueue_delete(&p->p_sigqueue, sig); - p->p_flag |= P_STOPPED_SIG; - p->p_xsig = sig; - PROC_SLOCK(p); - sig_suspend_threads(td, p, 0); - thread_suspend_switch(td, p); - PROC_SUNLOCK(p); - mtx_lock(&ps->ps_mtx); - goto next; - } else if ((prop & SIGPROP_IGNORE) != 0 && - (td->td_flags & TDF_SIGWAIT) == 0) { - /* - * Default action is to ignore; drop it if - * not in kern_sigtimedwait(). - */ - break; /* == ignore */ - } else - return (sig); - /*NOTREACHED*/ - - case (intptr_t)SIG_IGN: - if ((td->td_flags & TDF_SIGWAIT) == 0) - break; /* == ignore */ - else - return (sig); - - default: - /* - * This signal has an action, let - * postsig() process it. - */ - return (sig); + break; + case SIGSTATUS_SBDRY_STOP: + return (-1); + } } - sigqueue_delete(&td->td_sigqueue, sig); /* take the signal! */ - sigqueue_delete(&p->p_sigqueue, sig); next:; } - /* NOTREACHED */ } void @@ -4119,8 +4168,7 @@ sig_drop_caught(struct proc *p) ps = p->p_sigacts; PROC_LOCK_ASSERT(p, MA_OWNED); mtx_assert(&ps->ps_mtx, MA_OWNED); - while (SIGNOTEMPTY(ps->ps_sigcatch)) { - sig = sig_ffs(&ps->ps_sigcatch); + SIG_FOREACH(sig, &ps->ps_sigcatch) { sigdflt(ps, sig); if ((sigprop(sig) & SIGPROP_IGNORE) != 0) sigqueue_delete_proc(p, sig); diff --git a/sys/sys/signalvar.h b/sys/sys/signalvar.h index a7fe174b40bf..4e86f54856f6 100644 --- a/sys/sys/signalvar.h +++ b/sys/sys/signalvar.h @@ -404,7 +404,6 @@ int sig_ast_needsigchk(struct thread *td); void sig_drop_caught(struct proc *p); void sigexit(struct thread *td, int sig) __dead2; int sigev_findtd(struct proc *p, struct sigevent *sigev, struct thread **); -int sig_ffs(sigset_t *set); void sigfastblock_clear(struct thread *td); void sigfastblock_fetch(struct thread *td); void sigfastblock_setpend(struct thread *td, bool resched); From nobody Mon Oct 18 14:08:15 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 704E918044DA; Mon, 18 Oct 2021 14:08: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 4HXzHN2frrz3CDm; Mon, 18 Oct 2021 14:08: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 A5A5E21AF5; Mon, 18 Oct 2021 14:08: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 19IE8F2d066503; Mon, 18 Oct 2021 14:08:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IE8F9q066502; Mon, 18 Oct 2021 14:08:15 GMT (envelope-from git) Date: Mon, 18 Oct 2021 14:08:15 GMT Message-Id: <202110181408.19IE8F9q066502@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: 06ebadc5f555 - main - x86: Remove some leftover APM support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 06ebadc5f555fd7fa6f869af1e5daf834b1bb04e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=06ebadc5f555fd7fa6f869af1e5daf834b1bb04e commit 06ebadc5f555fd7fa6f869af1e5daf834b1bb04e Author: Mark Johnston AuthorDate: 2021-10-16 13:46:43 +0000 Commit: Mark Johnston CommitDate: 2021-10-18 13:56:59 +0000 x86: Remove some leftover APM support This is obsolete since commit 8c576a279ed5 ("Remove APM BIOS support"). Reviewed by: imp, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32510 --- sys/x86/x86/tsc.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c index 15e6037c68ee..a6c7ec7a8307 100644 --- a/sys/x86/x86/tsc.c +++ b/sys/x86/x86/tsc.c @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -585,23 +584,6 @@ init_TSC_tc(void) */ max_freq = UINT_MAX; - /* - * We can not use the TSC if we support APM. Precise timekeeping - * on an APM'ed machine is at best a fools pursuit, since - * any and all of the time spent in various SMM code can't - * be reliably accounted for. Reading the RTC is your only - * source of reliable time info. The i8254 loses too, of course, - * but we need to have some kind of time... - * We don't know at this point whether APM is going to be used - * or not, nor when it might be activated. Play it safe. - */ - if (power_pm_get_type() == POWER_PM_TYPE_APM) { - tsc_timecounter.tc_quality = -1000; - if (bootverbose) - printf("TSC timecounter disabled: APM enabled.\n"); - goto init; - } - /* * Intel CPUs without a C-state invariant TSC can stop the TSC * in either C2 or C3. Disable use of C2 and C3 while using @@ -637,7 +619,6 @@ init_TSC_tc(void) tsc_timecounter.tc_quality = 1000; max_freq >>= tsc_shift; -init: for (shift = 0; shift <= 31 && (tsc_freq >> shift) > max_freq; shift++) ; From nobody Mon Oct 18 14:08:16 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C95041804539; Mon, 18 Oct 2021 14:08: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 4HXzHP2vMnz3CDq; Mon, 18 Oct 2021 14:08: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 BCFA521CC8; Mon, 18 Oct 2021 14:08: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 19IE8GwB066527; Mon, 18 Oct 2021 14:08:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IE8G8T066526; Mon, 18 Oct 2021 14:08:16 GMT (envelope-from git) Date: Mon, 18 Oct 2021 14:08:16 GMT Message-Id: <202110181408.19IE8G8T066526@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: 621fd9dcb2d8 - main - timecounter: Lock the timecounter list List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 621fd9dcb2d83daab477c130bc99b905f6fc27dc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=621fd9dcb2d83daab477c130bc99b905f6fc27dc commit 621fd9dcb2d83daab477c130bc99b905f6fc27dc Author: Mark Johnston AuthorDate: 2021-10-16 13:46:55 +0000 Commit: Mark Johnston CommitDate: 2021-10-18 13:56:59 +0000 timecounter: Lock the timecounter list Timecounter registration is dynamic, i.e., there is no requirement that timecounters must be registered during single-threaded boot. Loadable drivers may in principle register timecounters (which can be switched to automatically). Timecounters cannot be unregistered, though this could be implemented. Registered timecounters belong to a global linked list. Add a mutex to synchronize insertions and the traversals done by (mpsafe) sysctl handlers. No functional change intended. Reviewed by: imp, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32511 --- sys/kern/kern_tc.c | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index be4142e19d77..9a928ca37aff 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -97,6 +97,10 @@ static struct timehands *volatile timehands = &ths[0]; struct timecounter *timecounter = &dummy_timecounter; static struct timecounter *timecounters = &dummy_timecounter; +/* Mutex to protect the timecounter list. */ +static struct mtx tc_lock; +MTX_SYSINIT(tc_lock, &tc_lock, "tc", MTX_DEF); + int tc_min_ticktock_freq = 1; volatile time_t time_second = 1; @@ -1188,8 +1192,6 @@ tc_init(struct timecounter *tc) tc->tc_quality); } - tc->tc_next = timecounters; - timecounters = tc; /* * Set up sysctl tree for this counter. */ @@ -1211,6 +1213,11 @@ tc_init(struct timecounter *tc) SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(tc_root), OID_AUTO, "quality", CTLFLAG_RD, &(tc->tc_quality), 0, "goodness of time counter"); + + mtx_lock(&tc_lock); + tc->tc_next = timecounters; + timecounters = tc; + /* * Do not automatically switch if the current tc was specifically * chosen. Never automatically use a timecounter with negative quality. @@ -1218,22 +1225,24 @@ tc_init(struct timecounter *tc) * worse since this timecounter may not be monotonic. */ if (tc_chosen) - return; + goto unlock; if (tc->tc_quality < 0) - return; + goto unlock; 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; + goto unlock; if (tc->tc_quality == timecounter->tc_quality && tc->tc_frequency < timecounter->tc_frequency) - return; + goto unlock; } (void)tc->tc_get_timecount(tc); timecounter = tc; +unlock: + mtx_unlock(&tc_lock); } /* Report the frequency of the current timecounter. */ @@ -1479,16 +1488,22 @@ sysctl_kern_timecounter_hardware(SYSCTL_HANDLER_ARGS) struct timecounter *newtc, *tc; int error; + mtx_lock(&tc_lock); tc = timecounter; strlcpy(newname, tc->tc_name, sizeof(newname)); + mtx_unlock(&tc_lock); error = sysctl_handle_string(oidp, &newname[0], sizeof(newname), req); if (error != 0 || req->newptr == NULL) return (error); + + mtx_lock(&tc_lock); /* Record that the tc in use now was specifically chosen. */ tc_chosen = 1; - if (strcmp(newname, tc->tc_name) == 0) + if (strcmp(newname, tc->tc_name) == 0) { + mtx_unlock(&tc_lock); return (0); + } for (newtc = timecounters; newtc != NULL; newtc = newtc->tc_next) { if (strcmp(newname, newtc->tc_name) != 0) continue; @@ -1506,11 +1521,11 @@ sysctl_kern_timecounter_hardware(SYSCTL_HANDLER_ARGS) * use any locking and that it can be called in hard interrupt * context via 'tc_windup()'. */ - return (0); + break; } - return (EINVAL); + mtx_unlock(&tc_lock); + return (newtc != NULL ? 0 : EINVAL); } - SYSCTL_PROC(_kern_timecounter, OID_AUTO, hardware, CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, 0, 0, sysctl_kern_timecounter_hardware, "A", @@ -1524,12 +1539,17 @@ sysctl_kern_timecounter_choice(SYSCTL_HANDLER_ARGS) struct timecounter *tc; int error; + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); sbuf_new_for_sysctl(&sb, NULL, 0, req); + mtx_lock(&tc_lock); for (tc = timecounters; tc != NULL; tc = tc->tc_next) { if (tc != timecounters) sbuf_putc(&sb, ' '); sbuf_printf(&sb, "%s(%d)", tc->tc_name, tc->tc_quality); } + mtx_unlock(&tc_lock); error = sbuf_finish(&sb); sbuf_delete(&sb); return (error); From nobody Mon Oct 18 14:08:17 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 99F1A180470D; Mon, 18 Oct 2021 14:08: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 4HXzHQ1LLnz3CPQ; Mon, 18 Oct 2021 14:08: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 D64F521F80; Mon, 18 Oct 2021 14:08: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 19IE8HUp066551; Mon, 18 Oct 2021 14:08:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IE8HIS066550; Mon, 18 Oct 2021 14:08:17 GMT (envelope-from git) Date: Mon, 18 Oct 2021 14:08:17 GMT Message-Id: <202110181408.19IE8HIS066550@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: 77bc75c7abd2 - main - bhyve: Fix the WITH_BHYVE_SNAPSHOT build List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 77bc75c7abd29de69d3ef35b66c23c7baba95094 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=77bc75c7abd29de69d3ef35b66c23c7baba95094 commit 77bc75c7abd29de69d3ef35b66c23c7baba95094 Author: Mark Johnston AuthorDate: 2021-10-16 17:13:26 +0000 Commit: Mark Johnston CommitDate: 2021-10-18 13:56:59 +0000 bhyve: Fix the WITH_BHYVE_SNAPSHOT build Note, this breaks compatibility with snapshots generated by older builds of bhyve(8). Fixes: 7fa233534736 ("bhyve: Map the MSI-X table unconditionally for passthrough") Reported by: Greg V Reviewed by: grehan, bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32523 --- usr.sbin/bhyve/pci_emul.c | 1 - 1 file changed, 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c index fd18fdbdaeab..86a2f995126e 100644 --- a/usr.sbin/bhyve/pci_emul.c +++ b/usr.sbin/bhyve/pci_emul.c @@ -2079,7 +2079,6 @@ pci_snapshot_pci_dev(struct vm_snapshot_meta *meta) SNAPSHOT_VAR_OR_LEAVE(pi->pi_msix.pba_offset, meta, ret, done); SNAPSHOT_VAR_OR_LEAVE(pi->pi_msix.pba_size, meta, ret, done); SNAPSHOT_VAR_OR_LEAVE(pi->pi_msix.function_mask, meta, ret, done); - SNAPSHOT_VAR_OR_LEAVE(pi->pi_msix.pba_page_offset, meta, ret, done); SNAPSHOT_BUF_OR_LEAVE(pi->pi_cfgdata, sizeof(pi->pi_cfgdata), meta, ret, done); From nobody Mon Oct 18 14:17:56 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 120E7180A543 for ; Mon, 18 Oct 2021 14:18:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-vk1-xa35.google.com (mail-vk1-xa35.google.com [IPv6:2607:f8b0:4864:20::a35]) (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 4HXzVp0N7yz3JXD for ; Mon, 18 Oct 2021 14:18:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-vk1-xa35.google.com with SMTP id o42so8659813vkf.9 for ; Mon, 18 Oct 2021 07:18:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Gyr9lZWmZ96MuJxr4ILM+Z/OtD+ZO7YgM4PwlUs5v/w=; b=ALcgnSm+8he/K6Ps+9iq9xAb4ssWuHk1UaDe6FmIA66hJMIk/MgDUU4IEcdMHULNKT tlg5ZUNTKFXGG48Z1ReLSrYRRNaZnbFHRqvGqdG8xzJFbFZNmvmQOQi7y22sjedIhU3m 6g0kV1ggue6JVc2RhxQ7VAroezy3bvPYhFzBFAvbAhY18HZ9GS64hIGUWyo0+uVXmHDZ D7sFg1siXFOM3KVupcX1HTAsKpy9ND2/B4InFRWtA14qo7ynQ7aROVfT2nIbnXaRNS44 0B0SsSVouD69IH9w9tsyCDWNJudpJg1GyfNLHbwF+3akIF8stL/AkBvGIcIevRck5nsN 0xxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Gyr9lZWmZ96MuJxr4ILM+Z/OtD+ZO7YgM4PwlUs5v/w=; b=CvaEOq36KLyW1ZqR4aopn14y/nthgHPeJkGVtAmVvVi/2kI31vSUTQMJ7tsC9lJJxG 3I/X+4iUwqdKROb0DUKYtvWNWjYLI4dpAAExN0o6TTxtBMEQwgUOGmdHcdhC+qWqCEq8 pKfi+FcDnsSS9A8ttQYDrWiDi5lujnM70P8tKIZgaCiTqjV7+GA/RBFB1G7WRDRmYNRn IIRts1u1M2cO2db1k2wL+I7baDG+R07njciNv+m1Vsq2nuCJAoaoU+5Bmdbs92H1RW3V 5U9ZzLfi5Mi5gGo/YT+Iboq9Lay7wWEDrXWH7Vjow05CeXE/G3vpe+4t+OQLhFygc8F6 WTxA== X-Gm-Message-State: AOAM531fla2+1sS+trxj9SK8zhgg+N/4sF0Pta+zUH+dwKh4kQPLjxxD 957nOyE7pNxexK7lyYyuZ4HQPAIRRZMIGwL82goBhA== X-Google-Smtp-Source: ABdhPJxNX5H0sarq7Y9pFR7qwsE3JQyhtsNyGuW7LObPxkJqciisBpShc/kW33nO/Bv9XC1Wf3qcSPtu9ttDNw5vyOQ= X-Received: by 2002:a1f:264a:: with SMTP id m71mr24982713vkm.5.1634566688072; Mon, 18 Oct 2021 07:18:08 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202110150823.19F8NEr9047194@gitrepo.freebsd.org> <202110161602.19GG2FYs004292@slippy.cwsent.com> <202110181310.19IDABYd005908@slippy.cwsent.com> In-Reply-To: <202110181310.19IDABYd005908@slippy.cwsent.com> From: Warner Losh Date: Mon, 18 Oct 2021 08:17:56 -0600 Message-ID: Subject: Re: git: 889b56c8cd84 - main - setrlimit: Take stack gap into account. To: Cy Schubert Cc: Marcin Wojtas , src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000ce3ee805cea136fb" X-Rspamd-Queue-Id: 4HXzVp0N7yz3JXD X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20210112.gappssmtp.com header.s=20210112 header.b=ALcgnSm+; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::a35) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [0.09 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20210112.gappssmtp.com:s=20210112]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.09)[0.091]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20210112.gappssmtp.com:+]; NEURAL_SPAM_LONG(1.00)[1.000]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::a35:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com] X-ThisMailContainsUnwantedMimeParts: N --000000000000ce3ee805cea136fb Content-Type: text/plain; charset="UTF-8" On Mon, Oct 18, 2021 at 7:10 AM Cy Schubert wrote: > In message > om> > , Warner Losh writes: > > On Sat, Oct 16, 2021, 10:02 AM Cy Schubert > > wrote: > > > > > In message <202110150823.19F8NEr9047194@gitrepo.freebsd.org>, Marcin > > > Wojtas > > > wri > > > tes: > > > > The branch main has been updated by mw: > > > > > > > > URL: > > > > https://cgit.FreeBSD.org/src/commit/?id=889b56c8cd84c9a9f2d9e3b019c154d6 > > > > f14d9021 > > > > > > > > commit 889b56c8cd84c9a9f2d9e3b019c154d6f14d9021 > > > > Author: Dawid Gorecki > > > > AuthorDate: 2021-10-13 19:01:08 +0000 > > > > Commit: Marcin Wojtas > > > > CommitDate: 2021-10-15 08:21:47 +0000 > > > > > > > > setrlimit: Take stack gap into account. > > > > > > > > Calling setrlimit with stack gap enabled and with low values of > stack > > > > resource limit often caused the program to abort immediately > after > > > > exiting the syscall. This happened due to the fact that the > resource > > > > limit was calculated assuming that the stack started at > sv_usrstack, > > > > while with stack gap enabled the stack is moved by a random > number > > > > of bytes. > > > > > > > > Save information about stack size in struct vmspace and adjust > the > > > > rlim_cur value. If the rlim_cur and stack gap is bigger than > > > rlim_max, > > > > then the value is truncated to rlim_max. > > > > > > > > PR: 253208 > > > > Reviewed by: kib > > > > Obtained from: Semihalf > > > > Sponsored by: Stormshield > > > > MFC after: 1 month > > > > Differential Revision: https://reviews.freebsd.org/D31516 > > > > --- > > > > sys/kern/imgact_elf.c | 5 +++-- > > > > sys/kern/kern_exec.c | 11 ++++++++--- > > > > sys/kern/kern_resource.c | 3 +++ > > > > sys/sys/imgact_elf.h | 2 +- > > > > sys/sys/sysent.h | 2 +- > > > > sys/vm/vm_map.c | 2 ++ > > > > sys/vm/vm_map.h | 1 + > > > > 7 files changed, 19 insertions(+), 7 deletions(-) > > > > > > > > diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c > > > > index ef1edfcabaf0..898f0f66a532 100644 > > > > --- a/sys/kern/imgact_elf.c > > > > +++ b/sys/kern/imgact_elf.c > > > > @@ -2684,7 +2684,7 @@ __elfN(untrans_prot)(vm_prot_t prot) > > > > return (flags); > > > > } > > > > > > > > -void > > > > +vm_size_t > > > > __elfN(stackgap)(struct image_params *imgp, uintptr_t *stack_base) > > > > { > > > > uintptr_t range, rbase, gap; > > > > @@ -2692,7 +2692,7 @@ __elfN(stackgap)(struct image_params *imgp, > > > uintptr_t * > > > > stack_base) > > > > > > > > pct = __elfN(aslr_stack_gap); > > > > if (pct == 0) > > > > - return; > > > > + return (0); > > > > if (pct > 50) > > > > pct = 50; > > > > range = imgp->eff_stack_sz * pct / 100; > > > > @@ -2700,4 +2700,5 @@ __elfN(stackgap)(struct image_params *imgp, > > > uintptr_t * > > > > stack_base) > > > > gap = rbase % range; > > > > gap &= ~(sizeof(u_long) - 1); > > > > *stack_base -= gap; > > > > + return (gap); > > > > } > > > > diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c > > > > index 50e75fda6cfb..9dceebdd8441 100644 > > > > --- a/sys/kern/kern_exec.c > > > > +++ b/sys/kern/kern_exec.c > > > > @@ -1148,6 +1148,7 @@ exec_new_vmspace(struct image_params *imgp, > struct > > > syse > > > > ntvec *sv) > > > > stack_prot, error, vm_mmap_to_errno(error)); > > > > return (vm_mmap_to_errno(error)); > > > > } > > > > + vmspace->vm_stkgap = 0; > > > > > > > > /* > > > > * vm_ssize and vm_maxsaddr are somewhat antiquated concepts, > but > > > they > > > > @@ -1493,12 +1494,16 @@ exec_args_get_begin_envv(struct image_args > *args) > > > > void > > > > exec_stackgap(struct image_params *imgp, uintptr_t *dp) > > > > { > > > > + struct proc *p = imgp->proc; > > > > + > > > > if (imgp->sysent->sv_stackgap == NULL || > > > > - (imgp->proc->p_fctl0 & (NT_FREEBSD_FCTL_ASLR_DISABLE | > > > > + (p->p_fctl0 & (NT_FREEBSD_FCTL_ASLR_DISABLE | > > > > NT_FREEBSD_FCTL_ASG_DISABLE)) != 0 || > > > > - (imgp->map_flags & MAP_ASLR) == 0) > > > > + (imgp->map_flags & MAP_ASLR) == 0) { > > > > + p->p_vmspace->vm_stkgap = 0; > > > > return; > > > > - imgp->sysent->sv_stackgap(imgp, dp); > > > > + } > > > > + p->p_vmspace->vm_stkgap = imgp->sysent->sv_stackgap(imgp, dp); > > > > } > > > > > > > > /* > > > > diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c > > > > index 4c62961e1bc4..b556d4fded51 100644 > > > > --- a/sys/kern/kern_resource.c > > > > +++ b/sys/kern/kern_resource.c > > > > @@ -671,6 +671,9 @@ kern_proc_setrlimit(struct thread *td, struct > proc > > > *p, u_ > > > > int which, > > > > if (limp->rlim_max < 0) > > > > limp->rlim_max = RLIM_INFINITY; > > > > > > > > + if (which == RLIMIT_STACK && limp->rlim_cur != RLIM_INFINITY) > > > > + limp->rlim_cur += p->p_vmspace->vm_stkgap; > > > > + > > > > oldssiz.rlim_cur = 0; > > > > newlim = lim_alloc(); > > > > PROC_LOCK(p); > > > > diff --git a/sys/sys/imgact_elf.h b/sys/sys/imgact_elf.h > > > > index 97383c6eeeb8..294f17c87b6f 100644 > > > > --- a/sys/sys/imgact_elf.h > > > > +++ b/sys/sys/imgact_elf.h > > > > @@ -118,7 +118,7 @@ int > __elfN(remove_brand_entry)(Elf_Brandinfo > > > *entry > > > > ); > > > > int __elfN(freebsd_fixup)(uintptr_t *, struct image_params *); > > > > int __elfN(coredump)(struct thread *, struct vnode *, off_t, int); > > > > size_t __elfN(populate_note)(int, void *, void *, size_t, void > > > **); > > > > -void __elfN(stackgap)(struct image_params *, uintptr_t *); > > > > +vm_size_t __elfN(stackgap)(struct image_params *, uintptr_t *); > > > > int __elfN(freebsd_copyout_auxargs)(struct image_params *, > uintptr_t); > > > > void __elfN(puthdr)(struct thread *, void *, size_t, int, size_t, > int); > > > > void __elfN(prepare_notes)(struct thread *, struct note_info_list *, > > > > diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h > > > > index ad50bf56e87d..ea96c87a79af 100644 > > > > --- a/sys/sys/sysent.h > > > > +++ b/sys/sys/sysent.h > > > > @@ -119,7 +119,7 @@ struct sysentvec { > > > > void (*sv_elf_core_prepare_notes)(struct thread *, > > > > struct note_info_list *, size_t *); > > > > int (*sv_imgact_try)(struct image_params *); > > > > - void (*sv_stackgap)(struct image_params *, > uintptr_t *); > > > > + vm_size_t (*sv_stackgap)(struct image_params *, > uintptr_t *); > > > > int (*sv_copyout_auxargs)(struct image_params *, > > > > uintptr_t); > > > > int sv_minsigstksz; /* minimum signal stack size */ > > > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > > > > index 1ac4ccf72f11..87a290b998b9 100644 > > > > --- a/sys/vm/vm_map.c > > > > +++ b/sys/vm/vm_map.c > > > > @@ -343,6 +343,7 @@ vmspace_alloc(vm_offset_t min, vm_offset_t max, > > > pmap_pini > > > > t_t pinit) > > > > vm->vm_taddr = 0; > > > > vm->vm_daddr = 0; > > > > vm->vm_maxsaddr = 0; > > > > + vm->vm_stkgap = 0; > > > > return (vm); > > > > } > > > > > > > > @@ -4265,6 +4266,7 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t > > > *fork_ch > > > > arge) > > > > vm2->vm_taddr = vm1->vm_taddr; > > > > vm2->vm_daddr = vm1->vm_daddr; > > > > vm2->vm_maxsaddr = vm1->vm_maxsaddr; > > > > + vm2->vm_stkgap = vm1->vm_stkgap; > > > > vm_map_lock(old_map); > > > > if (old_map->busy) > > > > vm_map_wait_busy(old_map); > > > > diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h > > > > index ace205b21b42..873ff62eec4a 100644 > > > > --- a/sys/vm/vm_map.h > > > > +++ b/sys/vm/vm_map.h > > > > @@ -293,6 +293,7 @@ struct vmspace { > > > > caddr_t vm_taddr; /* (c) user virtual address of text */ > > > > caddr_t vm_daddr; /* (c) user virtual address of data */ > > > > caddr_t vm_maxsaddr; /* user VA at max stack growth */ > > > > + vm_size_t vm_stkgap; /* stack gap size in bytes */ > > > > u_int vm_refcnt; /* number of references */ > > > > /* > > > > * Keep the PMAP last, so that CPU-specific variations of that > > > > > > > > > > Is it possible to have a __FreeBSD_version bump for ports? > > > > > > > There was a bump for linuxkpi you should use for this. It was a day or so > > after the stackgap change. > > That's the one I intend to use. I used the prior one at the time but will > update the patch to use this one instead. Probably today sometime. > Might want to document it in the handbook as well. The 'doubling up' changes are harder to reconstruct later... Warner > > -- > 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. > > > > --000000000000ce3ee805cea136fb-- From nobody Mon Oct 18 14:45:03 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CD4EC17F507D; Mon, 18 Oct 2021 14:45:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HY05q5Wkpz3QPq; Mon, 18 Oct 2021 14:45: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 9AF9F22718; Mon, 18 Oct 2021 14:45:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19IEj3Xi019474; Mon, 18 Oct 2021 14:45:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IEj36g019473; Mon, 18 Oct 2021 14:45:03 GMT (envelope-from git) Date: Mon, 18 Oct 2021 14:45:03 GMT Message-Id: <202110181445.19IEj36g019473@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: 7881db834647 - main - Remove POWER_PM_TYPE_APM. It's now unused. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 7881db83464759ba783454d2d2eb1b970e352cd3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7881db83464759ba783454d2d2eb1b970e352cd3 commit 7881db83464759ba783454d2d2eb1b970e352cd3 Author: Warner Losh AuthorDate: 2021-10-18 14:41:17 +0000 Commit: Warner Losh CommitDate: 2021-10-18 14:41:17 +0000 Remove POWER_PM_TYPE_APM. It's now unused. Sponsored by: Netflix Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D32549 --- sys/sys/power.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/sys/power.h b/sys/sys/power.h index 524bc3fabb24..b0535312d1f7 100644 --- a/sys/sys/power.h +++ b/sys/sys/power.h @@ -34,7 +34,6 @@ #include /* Power management system type */ -#define POWER_PM_TYPE_APM 0x00 #define POWER_PM_TYPE_ACPI 0x01 #define POWER_PM_TYPE_NONE 0xff From nobody Mon Oct 18 14:48:04 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4070017F8B40; Mon, 18 Oct 2021 14:48: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 4HY09K1D9rz3jTw; Mon, 18 Oct 2021 14:48: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 09F6D224E7; Mon, 18 Oct 2021 14:48: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 19IEm4p4019803; Mon, 18 Oct 2021 14:48:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IEm4XZ019802; Mon, 18 Oct 2021 14:48:04 GMT (envelope-from git) Date: Mon, 18 Oct 2021 14:48:04 GMT Message-Id: <202110181448.19IEm4XZ019802@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: 576b58108c17 - main - libssh: correct libssh src file list List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 576b58108c1723c85e4dd00355e29bfe301dab11 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=576b58108c1723c85e4dd00355e29bfe301dab11 commit 576b58108c1723c85e4dd00355e29bfe301dab11 Author: Ed Maste AuthorDate: 2021-10-15 16:21:23 +0000 Commit: Ed Maste CommitDate: 2021-10-18 14:47:20 +0000 libssh: correct libssh src file list Link against the ssh-sk-helper client rather than the sk internal implementation. PR: 258384 Tested by: madpilot Fixes: f448c3ed4ae1 ("openssh: Add new source files to libssl") Fixes: 19261079b743 ("openssh: update to OpenSSH v8.7p1") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32529 --- secure/lib/libssh/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/secure/lib/libssh/Makefile b/secure/lib/libssh/Makefile index 95024efa192e..e835ef3c1b2a 100644 --- a/secure/lib/libssh/Makefile +++ b/secure/lib/libssh/Makefile @@ -5,7 +5,7 @@ LIB= ssh PRIVATELIB= true SHLIB_MAJOR= 5 -SRCS= ssh_api.c ssh-sk.c ssh-ecdsa-sk.c ssh-ed25519-sk.c ssherr.c \ +SRCS= ssh_api.c ssh-sk-client.c ssh-ecdsa-sk.c ssh-ed25519-sk.c ssherr.c \ sshbuf.c sshkey.c sshbuf-getput-basic.c \ sshbuf-misc.c sshbuf-getput-crypto.c krl.c bitmap.c SRCS+= authfd.c authfile.c \ From nobody Mon Oct 18 16:09:33 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E48BA17F06AD; Mon, 18 Oct 2021 16:09: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 4HY1zK6BBVz4Yts; Mon, 18 Oct 2021 16:09: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 AFE07236F2; Mon, 18 Oct 2021 16:09: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 19IG9XHx026768; Mon, 18 Oct 2021 16:09:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IG9XxW026767; Mon, 18 Oct 2021 16:09:33 GMT (envelope-from git) Date: Mon, 18 Oct 2021 16:09:33 GMT Message-Id: <202110181609.19IG9XxW026767@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: 8c22b9f3ba58 - main - Fix cross-building on Linux/aarch64 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 8c22b9f3ba586e008e8e55a6215a1d46eb6830b9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=8c22b9f3ba586e008e8e55a6215a1d46eb6830b9 commit 8c22b9f3ba586e008e8e55a6215a1d46eb6830b9 Author: Kyle Evans AuthorDate: 2021-10-18 02:26:47 +0000 Commit: Kyle Evans CommitDate: 2021-10-18 16:09:00 +0000 Fix cross-building on Linux/aarch64 Add necessary bits to detect ELF format on Linux/aarch64; note that Linux calls it aarch64 where we would typically call it arm64 (uname -m) Reviewed by: arichardson, emaste, imp Sponsored by: Ampere Computing LLC Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D32542 --- contrib/elftoolchain/common/native-elf-format | 2 ++ tools/build/Makefile | 3 +++ 2 files changed, 5 insertions(+) diff --git a/contrib/elftoolchain/common/native-elf-format b/contrib/elftoolchain/common/native-elf-format index cef29e75111e..903dc37d0fbe 100755 --- a/contrib/elftoolchain/common/native-elf-format +++ b/contrib/elftoolchain/common/native-elf-format @@ -39,6 +39,8 @@ $1 ~ "Machine:" { elfarch = "EM_X86_64"; } else if (match($0, "PowerPC64")) { elfarch = "EM_PPC64"; + } else if (match($0, "AArch64")) { + elfarch = "EM_AARCH64"; } else { elfarch = "unknown"; } diff --git a/tools/build/Makefile b/tools/build/Makefile index 742432872c49..ec9b11398ae9 100644 --- a/tools/build/Makefile +++ b/tools/build/Makefile @@ -125,6 +125,9 @@ _host_arch=${MACHINE} .if ${_host_arch} == "x86_64" # bmake on Linux/mac often prints that instead of amd64 _host_arch=amd64 +.elif ${_host_arch} == "aarch64" +# Linux calls arm64, aarch64, across the board +_host_arch=arm64 .elif ${_host_arch:Mppc*} _host_arch=powerpc .endif From nobody Mon Oct 18 16:37:45 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id ABD3917FE264; Mon, 18 Oct 2021 16:37:47 +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 4HY2bv4V3sz4hjq; Mon, 18 Oct 2021 16:37:47 +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 0C36F22A4B; Mon, 18 Oct 2021 16:37:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: 7881db834647 - main - Remove POWER_PM_TYPE_APM. It's now unused. To: Warner Losh , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202110181445.19IEj36g019473@gitrepo.freebsd.org> From: John Baldwin Message-ID: Date: Mon, 18 Oct 2021 09:37:45 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 In-Reply-To: <202110181445.19IEj36g019473@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 10/18/21 7:45 AM, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=7881db83464759ba783454d2d2eb1b970e352cd3 > > commit 7881db83464759ba783454d2d2eb1b970e352cd3 > Author: Warner Losh > AuthorDate: 2021-10-18 14:41:17 +0000 > Commit: Warner Losh > CommitDate: 2021-10-18 14:41:17 +0000 > > Remove POWER_PM_TYPE_APM. It's now unused. > > Sponsored by: Netflix > Reviewed by: markj > Differential Revision: https://reviews.freebsd.org/D32549 > --- > sys/sys/power.h | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/sys/sys/power.h b/sys/sys/power.h > index 524bc3fabb24..b0535312d1f7 100644 > --- a/sys/sys/power.h > +++ b/sys/sys/power.h > @@ -34,7 +34,6 @@ > #include > > /* Power management system type */ > -#define POWER_PM_TYPE_APM 0x00 > #define POWER_PM_TYPE_ACPI 0x01 > #define POWER_PM_TYPE_NONE 0xff Do we want to leave a comment that 0x00 was previously used? I don't know if we ever exposed this value to userland as part of any ABI? -- John Baldwin From nobody Mon Oct 18 16:50:23 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F24D518042B5; Mon, 18 Oct 2021 16:50:31 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HY2tb3fBtz4mWt; Mon, 18 Oct 2021 16:50:31 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 19IGoN5D064503 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 18 Oct 2021 09:50:23 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 19IGoNT1064502; Mon, 18 Oct 2021 09:50:23 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Mon, 18 Oct 2021 09:50:23 -0700 From: Gleb Smirnoff To: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 0a76c63dd498 - main - ng_l2tp: improve seq structure locking. Message-ID: References: <202109101828.18AIS0W5077246@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202109101828.18AIS0W5077246@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4HY2tb3fBtz4mWt X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US] X-ThisMailContainsUnwantedMimeParts: N Replying to my own commit. Looks like either this commit or following 89042ff77668 has a bug that leaks locked mutex to the kernel interrupt thread. It is really hard to reproduce it, happened just once for me. I failed to find the leak just reviewing the code. If you are using ng_l2tp and experience a bug when some network-associated program (usually ifconfig) blocks forever in kernel, please get in touch with me. On Fri, Sep 10, 2021 at 06:28:00PM +0000, Gleb Smirnoff wrote: T> The branch main has been updated by glebius: T> T> URL: https://cgit.FreeBSD.org/src/commit/?id=0a76c63dd4987d8f7af37fe93569ce8a020cf43e T> T> commit 0a76c63dd4987d8f7af37fe93569ce8a020cf43e T> Author: Gleb Smirnoff T> AuthorDate: 2021-08-06 22:49:51 +0000 T> Commit: Gleb Smirnoff T> CommitDate: 2021-09-10 18:27:13 +0000 T> T> ng_l2tp: improve seq structure locking. T> T> Cover few cases of access to seq without lock missed in 702f98951d5. T> There are no known bugs fixed with this change, however. With INVARIANTS T> embed ng_l2tp_seq_check() into lock/unlock macros. Slightly reduce number T> of locks/unlocks per packet keeping the lock between functions. T> T> Reviewed by: mjg, markj T> Differential Revision: https://reviews.freebsd.org/D31476 T> --- T> sys/netgraph/ng_l2tp.c | 147 ++++++++++++++++++++----------------------------- T> 1 file changed, 61 insertions(+), 86 deletions(-) T> T> diff --git a/sys/netgraph/ng_l2tp.c b/sys/netgraph/ng_l2tp.c T> index 9b6f19f9f0ad..c62bde0c54f7 100644 T> --- a/sys/netgraph/ng_l2tp.c T> +++ b/sys/netgraph/ng_l2tp.c T> @@ -188,10 +188,6 @@ static void ng_l2tp_seq_rack_timeout(node_p node, hook_p hook, T> static hookpriv_p ng_l2tp_find_session(priv_p privp, u_int16_t sid); T> static ng_fn_eachhook ng_l2tp_reset_session; T> T> -#ifdef INVARIANTS T> -static void ng_l2tp_seq_check(struct l2tp_seq *seq); T> -#endif T> - T> /* Parse type for struct ng_l2tp_seq_config. */ T> static const struct ng_parse_struct_field T> ng_l2tp_seq_config_fields[] = NG_L2TP_SEQ_CONFIG_TYPE_INFO; T> @@ -335,12 +331,22 @@ static struct ng_type ng_l2tp_typestruct = { T> }; T> NETGRAPH_INIT(l2tp, &ng_l2tp_typestruct); T> T> -/* Sequence number state sanity checking */ T> +/* Sequence number state locking & sanity checking */ T> #ifdef INVARIANTS T> -#define L2TP_SEQ_CHECK(seq) ng_l2tp_seq_check(seq) T> +static void ng_l2tp_seq_check(struct l2tp_seq *seq); T> +#define SEQ_LOCK(seq) do { \ T> + mtx_lock(&(seq)->mtx); \ T> + ng_l2tp_seq_check(seq); \ T> +} while (0) T> +#define SEQ_UNLOCK(seq) do { \ T> + ng_l2tp_seq_check(seq); \ T> + mtx_unlock(&(seq)->mtx); \ T> +} while (0) T> #else T> -#define L2TP_SEQ_CHECK(x) do { } while (0) T> +#define SEQ_LOCK(seq) mtx_lock(&(seq)->mtx) T> +#define SEQ_UNLOCK(seq) mtx_unlock(&(seq)->mtx) T> #endif T> +#define SEQ_LOCK_ASSERT(seq) mtx_assert(&(seq)->mtx, MA_OWNED) T> T> /* Whether to use m_copypacket() or m_dup() */ T> #define L2TP_COPY_MBUF m_copypacket T> @@ -650,11 +656,10 @@ ng_l2tp_shutdown(node_p node) T> const priv_p priv = NG_NODE_PRIVATE(node); T> struct l2tp_seq *const seq = &priv->seq; T> T> - /* Sanity check */ T> - L2TP_SEQ_CHECK(seq); T> - T> /* Reset sequence number state */ T> + SEQ_LOCK(seq); T> ng_l2tp_seq_reset(priv); T> + SEQ_UNLOCK(seq); T> T> /* Free private data if neither timer is running */ T> ng_uncallout(&seq->rack_timer, node); T> @@ -757,9 +762,6 @@ ng_l2tp_rcvdata_lower(hook_p h, item_p item) T> int error; T> int len, plen; T> T> - /* Sanity check */ T> - L2TP_SEQ_CHECK(&priv->seq); T> - T> /* If not configured, reject */ T> if (!priv->conf.enabled) { T> NG_FREE_ITEM(item); T> @@ -899,18 +901,20 @@ ng_l2tp_rcvdata_lower(hook_p h, item_p item) T> if ((hdr & L2TP_HDR_CTRL) != 0) { T> struct l2tp_seq *const seq = &priv->seq; T> T> + SEQ_LOCK(seq); T> + T> /* Handle receive ack sequence number Nr */ T> ng_l2tp_seq_recv_nr(priv, nr); T> T> /* Discard ZLB packets */ T> if (m->m_pkthdr.len == 0) { T> + SEQ_UNLOCK(seq); T> priv->stats.recvZLBs++; T> NG_FREE_ITEM(item); T> NG_FREE_M(m); T> ERROUT(0); T> } T> T> - mtx_lock(&seq->mtx); T> /* T> * If not what we expect or we are busy, drop packet and T> * send an immediate ZLB ack. T> @@ -920,23 +924,16 @@ ng_l2tp_rcvdata_lower(hook_p h, item_p item) T> priv->stats.recvDuplicates++; T> else T> priv->stats.recvOutOfOrder++; T> - mtx_unlock(&seq->mtx); T> ng_l2tp_xmit_ctrl(priv, NULL, seq->ns); T> NG_FREE_ITEM(item); T> NG_FREE_M(m); T> ERROUT(0); T> } T> - /* T> - * Until we deliver this packet we can't receive next one as T> - * we have no information for sending ack. T> - */ T> - seq->inproc = 1; T> - mtx_unlock(&seq->mtx); T> T> /* Prepend session ID to packet. */ T> M_PREPEND(m, 2, M_NOWAIT); T> if (m == NULL) { T> - seq->inproc = 0; T> + SEQ_UNLOCK(seq); T> priv->stats.memoryFailures++; T> NG_FREE_ITEM(item); T> ERROUT(ENOBUFS); T> @@ -944,10 +941,17 @@ ng_l2tp_rcvdata_lower(hook_p h, item_p item) T> mtod(m, u_int8_t *)[0] = sid >> 8; T> mtod(m, u_int8_t *)[1] = sid & 0xff; T> T> + /* T> + * Until we deliver this packet we can't receive next one as T> + * we have no information for sending ack. T> + */ T> + seq->inproc = 1; T> + SEQ_UNLOCK(seq); T> + T> /* Deliver packet to upper layers */ T> NG_FWD_NEW_DATA(error, item, priv->ctrl, m); T> T> - mtx_lock(&seq->mtx); T> + SEQ_LOCK(seq); T> /* Ready to process next packet. */ T> seq->inproc = 0; T> T> @@ -962,7 +966,7 @@ ng_l2tp_rcvdata_lower(hook_p h, item_p item) T> NULL, 0); T> } T> } T> - mtx_unlock(&seq->mtx); T> + SEQ_UNLOCK(seq); T> T> ERROUT(error); T> } T> @@ -997,8 +1001,6 @@ ng_l2tp_rcvdata_lower(hook_p h, item_p item) T> /* Deliver data */ T> NG_FWD_NEW_DATA(error, item, hook, m); T> done: T> - /* Done */ T> - L2TP_SEQ_CHECK(&priv->seq); T> return (error); T> } T> T> @@ -1016,9 +1018,6 @@ ng_l2tp_rcvdata_ctrl(hook_p hook, item_p item) T> int i; T> u_int16_t ns; T> T> - /* Sanity check */ T> - L2TP_SEQ_CHECK(&priv->seq); T> - T> /* If not configured, reject */ T> if (!priv->conf.enabled) { T> NG_FREE_ITEM(item); T> @@ -1043,12 +1042,12 @@ ng_l2tp_rcvdata_ctrl(hook_p hook, item_p item) T> ERROUT(EOVERFLOW); T> } T> T> - mtx_lock(&seq->mtx); T> + SEQ_LOCK(seq); T> T> /* Find next empty slot in transmit queue */ T> for (i = 0; i < L2TP_MAX_XWIN && seq->xwin[i] != NULL; i++); T> if (i == L2TP_MAX_XWIN) { T> - mtx_unlock(&seq->mtx); T> + SEQ_UNLOCK(seq); T> priv->stats.xmitDrops++; T> m_freem(m); T> ERROUT(ENOBUFS); T> @@ -1057,7 +1056,7 @@ ng_l2tp_rcvdata_ctrl(hook_p hook, item_p item) T> T> /* If peer's receive window is already full, nothing else to do */ T> if (i >= seq->cwnd) { T> - mtx_unlock(&seq->mtx); T> + SEQ_UNLOCK(seq); T> ERROUT(0); T> } T> T> @@ -1068,10 +1067,9 @@ ng_l2tp_rcvdata_ctrl(hook_p hook, item_p item) T> T> ns = seq->ns++; T> T> - mtx_unlock(&seq->mtx); T> - T> /* Copy packet */ T> if ((m = L2TP_COPY_MBUF(m, M_NOWAIT)) == NULL) { T> + SEQ_UNLOCK(seq); T> priv->stats.memoryFailures++; T> ERROUT(ENOBUFS); T> } T> @@ -1079,8 +1077,6 @@ ng_l2tp_rcvdata_ctrl(hook_p hook, item_p item) T> /* Send packet and increment xmit sequence number */ T> error = ng_l2tp_xmit_ctrl(priv, m, ns); T> done: T> - /* Done */ T> - L2TP_SEQ_CHECK(&priv->seq); T> return (error); T> } T> T> @@ -1098,9 +1094,6 @@ ng_l2tp_rcvdata(hook_p hook, item_p item) T> int error; T> int i = 2; T> T> - /* Sanity check */ T> - L2TP_SEQ_CHECK(&priv->seq); T> - T> /* If not configured, reject */ T> if (!priv->conf.enabled) { T> NG_FREE_ITEM(item); T> @@ -1161,8 +1154,6 @@ ng_l2tp_rcvdata(hook_p hook, item_p item) T> /* Send packet */ T> NG_FWD_NEW_DATA(error, item, priv->lower, m); T> done: T> - /* Done */ T> - L2TP_SEQ_CHECK(&priv->seq); T> return (error); T> } T> T> @@ -1204,7 +1195,6 @@ ng_l2tp_seq_init(priv_p priv) T> ng_callout_init(&seq->rack_timer); T> ng_callout_init(&seq->xack_timer); T> mtx_init(&seq->mtx, "ng_l2tp", NULL, MTX_DEF); T> - L2TP_SEQ_CHECK(seq); T> } T> T> /* T> @@ -1240,10 +1230,13 @@ ng_l2tp_seq_adjust(priv_p priv, const struct ng_l2tp_config *conf) T> { T> struct l2tp_seq *const seq = &priv->seq; T> u_int16_t new_wmax; T> + int error = 0; T> T> + SEQ_LOCK(seq); T> /* If disabling node, reset state sequence number */ T> if (!conf->enabled) { T> ng_l2tp_seq_reset(priv); T> + SEQ_UNLOCK(seq); T> return (0); T> } T> T> @@ -1252,13 +1245,14 @@ ng_l2tp_seq_adjust(priv_p priv, const struct ng_l2tp_config *conf) T> if (new_wmax > L2TP_MAX_XWIN) T> new_wmax = L2TP_MAX_XWIN; T> if (new_wmax == 0) T> - return (EINVAL); T> + ERROUT(EINVAL); T> if (new_wmax < seq->wmax) T> - return (EBUSY); T> + ERROUT(EBUSY); T> seq->wmax = new_wmax; T> T> - /* Done */ T> - return (0); T> +done: T> + SEQ_UNLOCK(seq); T> + return (error); T> } T> T> /* T> @@ -1271,8 +1265,7 @@ ng_l2tp_seq_reset(priv_p priv) T> hook_p hook; T> int i; T> T> - /* Sanity check */ T> - L2TP_SEQ_CHECK(seq); T> + SEQ_LOCK_ASSERT(seq); T> T> /* Stop timers */ T> ng_uncallout(&seq->rack_timer, priv->node); T> @@ -1299,9 +1292,6 @@ ng_l2tp_seq_reset(priv_p priv) T> seq->acks = 0; T> seq->rexmits = 0; T> bzero(seq->xwin, sizeof(seq->xwin)); T> - T> - /* Done */ T> - L2TP_SEQ_CHECK(seq); T> } T> T> /* T> @@ -1316,15 +1306,12 @@ ng_l2tp_seq_recv_nr(priv_p priv, u_int16_t nr) T> int i, j; T> uint16_t ns; T> T> - mtx_lock(&seq->mtx); T> + SEQ_LOCK_ASSERT(seq); T> T> /* Verify peer's ACK is in range */ T> - if ((nack = L2TP_SEQ_DIFF(nr, seq->rack)) <= 0) { T> - mtx_unlock(&seq->mtx); T> + if ((nack = L2TP_SEQ_DIFF(nr, seq->rack)) <= 0) T> return; /* duplicate ack */ T> - } T> if (L2TP_SEQ_DIFF(nr, seq->ns) > 0) { T> - mtx_unlock(&seq->mtx); T> priv->stats.recvBadAcks++; /* ack for packet not sent */ T> return; T> } T> @@ -1375,10 +1362,8 @@ ng_l2tp_seq_recv_nr(priv_p priv, u_int16_t nr) T> ng_uncallout(&seq->rack_timer, priv->node); T> T> /* If transmit queue is empty, we're done for now */ T> - if (seq->xwin[0] == NULL) { T> - mtx_unlock(&seq->mtx); T> + if (seq->xwin[0] == NULL) T> return; T> - } T> T> /* Start restransmit timer again */ T> ng_callout(&seq->rack_timer, priv->node, NULL, T> @@ -1396,8 +1381,6 @@ ng_l2tp_seq_recv_nr(priv_p priv, u_int16_t nr) T> seq->ns++; T> } T> T> - mtx_unlock(&seq->mtx); T> - T> /* T> * Send prepared. T> * If there is a memory error, pretend packet was sent, as it T> @@ -1407,8 +1390,10 @@ ng_l2tp_seq_recv_nr(priv_p priv, u_int16_t nr) T> struct mbuf *m; T> if ((m = L2TP_COPY_MBUF(xwin[i], M_NOWAIT)) == NULL) T> priv->stats.memoryFailures++; T> - else T> + else { T> ng_l2tp_xmit_ctrl(priv, m, ns); T> + SEQ_LOCK(seq); T> + } T> ns++; T> } T> } T> @@ -1428,17 +1413,13 @@ ng_l2tp_seq_xack_timeout(node_p node, hook_p hook, void *arg1, int arg2) T> (!callout_active(&seq->xack_timer))) T> return; T> T> - /* Sanity check */ T> - L2TP_SEQ_CHECK(seq); T> + SEQ_LOCK(seq); T> T> /* Send a ZLB */ T> ng_l2tp_xmit_ctrl(priv, NULL, seq->ns); T> T> /* callout_deactivate() is not needed here T> as ng_uncallout() was called by ng_l2tp_xmit_ctrl() */ T> - T> - /* Sanity check */ T> - L2TP_SEQ_CHECK(seq); T> } T> T> /* T> @@ -1453,14 +1434,12 @@ ng_l2tp_seq_rack_timeout(node_p node, hook_p hook, void *arg1, int arg2) T> struct mbuf *m; T> u_int delay; T> T> - /* Sanity check */ T> - L2TP_SEQ_CHECK(seq); T> + SEQ_LOCK(seq); T> T> - mtx_lock(&seq->mtx); T> /* Make sure callout is still active before doing anything */ T> if (callout_pending(&seq->rack_timer) || T> !callout_active(&seq->rack_timer)) { T> - mtx_unlock(&seq->mtx); T> + SEQ_UNLOCK(seq); T> return; T> } T> T> @@ -1485,41 +1464,39 @@ ng_l2tp_seq_rack_timeout(node_p node, hook_p hook, void *arg1, int arg2) T> T> /* Retransmit oldest unack'd packet */ T> m = L2TP_COPY_MBUF(seq->xwin[0], M_NOWAIT); T> - mtx_unlock(&seq->mtx); T> - if (m == NULL) T> + if (m == NULL) { T> + SEQ_UNLOCK(seq); T> priv->stats.memoryFailures++; T> - else T> + } else T> ng_l2tp_xmit_ctrl(priv, m, seq->ns++); T> T> /* callout_deactivate() is not needed here T> as ng_callout() is getting called each time */ T> - T> - /* Sanity check */ T> - L2TP_SEQ_CHECK(seq); T> } T> T> /* T> * Transmit a control stream packet, payload optional. T> * The transmit sequence number is not incremented. T> + * Requires seq lock, returns unlocked. T> */ T> static int T> ng_l2tp_xmit_ctrl(priv_p priv, struct mbuf *m, u_int16_t ns) T> { T> struct l2tp_seq *const seq = &priv->seq; T> uint8_t *p; T> - u_int16_t session_id = 0; T> + uint16_t nr, session_id = 0; T> int error; T> T> - mtx_lock(&seq->mtx); T> + SEQ_LOCK_ASSERT(seq); T> T> /* Stop ack timer: we're sending an ack with this packet. T> Doing this before to keep state predictable after error. */ T> if (callout_active(&seq->xack_timer)) T> ng_uncallout(&seq->xack_timer, priv->node); T> T> - seq->xack = seq->nr; T> + nr = seq->xack = seq->nr; T> T> - mtx_unlock(&seq->mtx); T> + SEQ_UNLOCK(seq); T> T> /* If no mbuf passed, send an empty packet (ZLB) */ T> if (m == NULL) { T> @@ -1570,8 +1547,8 @@ ng_l2tp_xmit_ctrl(priv_p priv, struct mbuf *m, u_int16_t ns) T> p[7] = session_id & 0xff; T> p[8] = ns >> 8; T> p[9] = ns & 0xff; T> - p[10] = seq->nr >> 8; T> - p[11] = seq->nr & 0xff; T> + p[10] = nr >> 8; T> + p[11] = nr & 0xff; T> T> /* Update sequence number info and stats */ T> priv->stats.xmitPackets++; T> @@ -1594,7 +1571,7 @@ ng_l2tp_seq_check(struct l2tp_seq *seq) T> T> #define CHECK(p) KASSERT((p), ("%s: not: %s", __func__, #p)) T> T> - mtx_lock(&seq->mtx); T> + SEQ_LOCK_ASSERT(seq); T> T> self_unack = L2TP_SEQ_DIFF(seq->nr, seq->xack); T> peer_unack = L2TP_SEQ_DIFF(seq->ns, seq->rack); T> @@ -1617,8 +1594,6 @@ ng_l2tp_seq_check(struct l2tp_seq *seq) T> for ( ; i < seq->cwnd; i++) /* verify peer's recv window full */ T> CHECK(seq->xwin[i] == NULL); T> T> - mtx_unlock(&seq->mtx); T> - T> #undef CHECK T> } T> #endif /* INVARIANTS */ T> _______________________________________________ T> dev-commits-src-all@freebsd.org mailing list T> https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all T> To unsubscribe, send any mail to "dev-commits-src-all-unsubscribe@freebsd.org" -- Gleb Smirnoff From nobody Mon Oct 18 16:50:36 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 02EF318044F8 for ; Mon, 18 Oct 2021 16:50:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ua1-x92c.google.com (mail-ua1-x92c.google.com [IPv6:2607:f8b0:4864:20::92c]) (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 4HY2tv5L8Hz4mlJ for ; Mon, 18 Oct 2021 16:50:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ua1-x92c.google.com with SMTP id h4so5763800uaw.1 for ; Mon, 18 Oct 2021 09:50:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=F8mO1182pyGjT9F2hZrNvrjWBm77zaBl9dQWHTXWexo=; b=f1/lHuBvxESqBnCEouWUB6h3IpBgWarrMeC9jFAUhzgN//86JsD7YCUtf/RoxAnxsx mxyI54iazmCoHW1F3iyyeKt2Be0CTrvLHJ6dJD+DztxdVBuZ7x3ZgNyCPFyk7ykkBqtG dM4Dl5gV6GNDWpwqmr4nzhLjIzu7/hgdLCRh0ADIP5X0m/O5vvYlJ6fcAZfBiDWV1+Gg 7QawG5Asijx/JP+BLfUelYAqqjs+kENSO/SO1HOsOjk7KxSNlY37r2LxYSGHEWBZOt3U Yi/85ouc9ftPX2/ECx2GiSSWL7VaBa3mTzFX/Dk9yBGLOSJB+Qhl7c2fakzAilF1JZD0 0Q3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=F8mO1182pyGjT9F2hZrNvrjWBm77zaBl9dQWHTXWexo=; b=01xh/UkwEknl5k3aoK/q4ou3KA/3SP8+oTKg9rU2t2TC6VNHj68I54OnbERn05ob/s sD+OnYDu/MGljpNwMJlo/dzOAXrVWKfpdTQ3FNoY/eCKCvEBsZBDYTAORewBdfFNwpSu 5B1xX3YMSpjFEACxqBDeJwyG3/r73BQu4fIC8AzTk+dQMc+D5IghLPxJAlesPt3j6dHk MQnfbvep7QllPJEIYSAqUdlwfXV8k8Ubkm7kjtHf8TtndGWtRtfQHaP75lcFfoIe1Zz3 rTdEpSCbNtygXKo+ez55HsuqAX03lRpjKnhmyEWvVp3ZOpGF6HdTpT/68scTnODU0w5H tNjg== X-Gm-Message-State: AOAM533KBbrCWB2/wdkhZmybd1ubTeDlHYmdQSKtTYyxMheRJpRnchEm aCxQZBNgk0gn+vSUPl1k3IIItm13wVmPGMI/0A453Q== X-Google-Smtp-Source: ABdhPJyb45XpOiveGyj6y6giFEFfNAb00qVzS2Q+1MDOrJobH5DYED/U2kuLYKKFjXFlm+4Gy04SPcWZCWTPINAvWsk= X-Received: by 2002:a67:c903:: with SMTP id w3mr28994375vsk.6.1634575847119; Mon, 18 Oct 2021 09:50:47 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202110181445.19IEj36g019473@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Mon, 18 Oct 2021 10:50:36 -0600 Message-ID: Subject: Re: git: 7881db834647 - main - Remove POWER_PM_TYPE_APM. It's now unused. To: John Baldwin Cc: Warner Losh , src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000b9f10e05cea358cf" X-Rspamd-Queue-Id: 4HY2tv5L8Hz4mlJ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N --000000000000b9f10e05cea358cf Content-Type: text/plain; charset="UTF-8" On Mon, Oct 18, 2021 at 10:37 AM John Baldwin wrote: > On 10/18/21 7:45 AM, Warner Losh wrote: > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=7881db83464759ba783454d2d2eb1b970e352cd3 > > > > commit 7881db83464759ba783454d2d2eb1b970e352cd3 > > Author: Warner Losh > > AuthorDate: 2021-10-18 14:41:17 +0000 > > Commit: Warner Losh > > CommitDate: 2021-10-18 14:41:17 +0000 > > > > Remove POWER_PM_TYPE_APM. It's now unused. > > > > Sponsored by: Netflix > > Reviewed by: markj > > Differential Revision: https://reviews.freebsd.org/D32549 > > --- > > sys/sys/power.h | 1 - > > 1 file changed, 1 deletion(-) > > > > diff --git a/sys/sys/power.h b/sys/sys/power.h > > index 524bc3fabb24..b0535312d1f7 100644 > > --- a/sys/sys/power.h > > +++ b/sys/sys/power.h > > @@ -34,7 +34,6 @@ > > #include > > > > /* Power management system type */ > > -#define POWER_PM_TYPE_APM 0x00 > > #define POWER_PM_TYPE_ACPI 0x01 > > #define POWER_PM_TYPE_NONE 0xff > > Do we want to leave a comment that 0x00 was previously used? I don't know > if we ever > exposed this value to userland as part of any ABI? > Good question, but I believe the answer is no. power_pm_type is static in sys/kern/subr_power.c. It's only exported from that module with power_pm_get_type(). This is only called from acpi.c to make decisions about whether or not to load, attach, or identify devices. There's also no sysctl that publish this, nor is this value used in userland in base. The whole sys/power.h file has the look of an internal kernel file because there's no #ifdef _KERNEL section around all the prototypes it defines. Have I missed something? Warner --000000000000b9f10e05cea358cf-- From nobody Mon Oct 18 17:33:51 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A05B117F7210; Mon, 18 Oct 2021 17:33: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 4HY3rb3CzSz3H22; Mon, 18 Oct 2021 17:33: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 4E7EC24A1D; Mon, 18 Oct 2021 17:33: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 19IHXpgx045810; Mon, 18 Oct 2021 17:33:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IHXpHM045809; Mon, 18 Oct 2021 17:33:51 GMT (envelope-from git) Date: Mon, 18 Oct 2021 17:33:51 GMT Message-Id: <202110181733.19IHXpHM045809@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 5a78df20ce77 - main - in_pcb: garbage collect unused structure in_pcblist List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5a78df20ce77e418503d0264d3daa26487908b1f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=5a78df20ce77e418503d0264d3daa26487908b1f commit 5a78df20ce77e418503d0264d3daa26487908b1f Author: Gleb Smirnoff AuthorDate: 2021-04-27 17:43:56 +0000 Commit: Gleb Smirnoff CommitDate: 2021-10-18 17:06:39 +0000 in_pcb: garbage collect unused structure in_pcblist --- sys/netinet/in_pcb.c | 22 ---------------------- sys/netinet/in_pcb.h | 8 -------- 2 files changed, 30 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 189f73028198..fc2914730e43 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1665,28 +1665,6 @@ in_pcbrele(struct inpcb *inp) return (in_pcbrele_wlocked(inp)); } -void -in_pcblist_rele_rlocked(epoch_context_t ctx) -{ - struct in_pcblist *il; - struct inpcb *inp; - struct inpcbinfo *pcbinfo; - int i, n; - - il = __containerof(ctx, struct in_pcblist, il_epoch_ctx); - pcbinfo = il->il_pcbinfo; - n = il->il_count; - INP_INFO_WLOCK(pcbinfo); - for (i = 0; i < n; i++) { - inp = il->il_inp_list[i]; - INP_RLOCK(inp); - if (!in_pcbrele_rlocked(inp)) - INP_RUNLOCK(inp); - } - INP_INFO_WUNLOCK(pcbinfo); - free(il, M_TEMP); -} - static void inpcbport_free(epoch_context_t ctx) { diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index c20c516628b8..77a99e666663 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -407,13 +407,6 @@ struct inpcbport { u_short phd_port; }; -struct in_pcblist { - int il_count; - struct epoch_context il_epoch_ctx; - struct inpcbinfo *il_pcbinfo; - struct inpcb *il_inp_list[0]; -}; - /*- * Global data structure for each high-level protocol (UDP, TCP, ...) in both * IPv4 and IPv6. Holds inpcb lists and information for managing them. @@ -872,7 +865,6 @@ void in_pcbrehash_mbuf(struct inpcb *, struct mbuf *); int in_pcbrele(struct inpcb *); int in_pcbrele_rlocked(struct inpcb *); int in_pcbrele_wlocked(struct inpcb *); -void in_pcblist_rele_rlocked(epoch_context_t ctx); void in_losing(struct inpcb *); void in_pcbsetsolabel(struct socket *so); int in_getpeeraddr(struct socket *so, struct sockaddr **nam); From nobody Mon Oct 18 17:33:52 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9F03017F73EE; Mon, 18 Oct 2021 17:33: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 4HY3rc3v1Tz3GPH; Mon, 18 Oct 2021 17:33: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 6608A24AB6; Mon, 18 Oct 2021 17:33: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 19IHXqad045834; Mon, 18 Oct 2021 17:33:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IHXqVf045833; Mon, 18 Oct 2021 17:33:52 GMT (envelope-from git) Date: Mon, 18 Oct 2021 17:33:52 GMT Message-Id: <202110181733.19IHXqVf045833@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 744a64bd920c - main - in_pcb: garbage collect in_pcbrele() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 744a64bd920c79b74a695a53cddfbecee4935c05 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=744a64bd920c79b74a695a53cddfbecee4935c05 commit 744a64bd920c79b74a695a53cddfbecee4935c05 Author: Gleb Smirnoff AuthorDate: 2021-04-27 22:11:08 +0000 Commit: Gleb Smirnoff CommitDate: 2021-10-18 17:07:16 +0000 in_pcb: garbage collect in_pcbrele() --- sys/netinet/in_pcb.c | 10 ---------- sys/netinet/in_pcb.h | 1 - 2 files changed, 11 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index fc2914730e43..e267d25c4f69 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1655,16 +1655,6 @@ in_pcbrele_wlocked(struct inpcb *inp) return (1); } -/* - * Temporary wrapper. - */ -int -in_pcbrele(struct inpcb *inp) -{ - - return (in_pcbrele_wlocked(inp)); -} - static void inpcbport_free(epoch_context_t ctx) { diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 77a99e666663..861c0ba5f0aa 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -862,7 +862,6 @@ void in_pcbnotifyall(struct inpcbinfo *pcbinfo, struct in_addr, void in_pcbref(struct inpcb *); void in_pcbrehash(struct inpcb *); void in_pcbrehash_mbuf(struct inpcb *, struct mbuf *); -int in_pcbrele(struct inpcb *); int in_pcbrele_rlocked(struct inpcb *); int in_pcbrele_wlocked(struct inpcb *); void in_losing(struct inpcb *); From nobody Mon Oct 18 17:33:53 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EDC6717F750E; Mon, 18 Oct 2021 17:33: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 4HY3rd51w1z3H5n; Mon, 18 Oct 2021 17:33: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 866FE248E2; Mon, 18 Oct 2021 17:33: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 19IHXr7B045858; Mon, 18 Oct 2021 17:33:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IHXrFJ045857; Mon, 18 Oct 2021 17:33:53 GMT (envelope-from git) Date: Mon, 18 Oct 2021 17:33:53 GMT Message-Id: <202110181733.19IHXrFJ045857@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 147f018a720b - main - Move in6_pcbsetport() to in6_pcb.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 147f018a720b80da4ba61bec90a6efc6eaa4913e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=147f018a720b80da4ba61bec90a6efc6eaa4913e commit 147f018a720b80da4ba61bec90a6efc6eaa4913e Author: Gleb Smirnoff AuthorDate: 2021-10-18 17:11:20 +0000 Commit: Gleb Smirnoff CommitDate: 2021-10-18 17:19:03 +0000 Move in6_pcbsetport() to in6_pcb.c This function was originally carved out of in6_pcbbind(), which is in in6_pcb.c. This function also uses KPI private to the PCB database - in_pcb_lport(). --- sys/netinet6/in6_pcb.c | 38 ++++++++++++++++++++++++++++++++++++++ sys/netinet6/in6_src.c | 42 ------------------------------------------ 2 files changed, 38 insertions(+), 42 deletions(-) diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 14b95dfe0254..10a29f339773 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -114,6 +114,44 @@ __FBSDID("$FreeBSD$"); #include #include +int +in6_pcbsetport(struct in6_addr *laddr, struct inpcb *inp, struct ucred *cred) +{ + struct socket *so = inp->inp_socket; + u_int16_t lport = 0; + int error, lookupflags = 0; +#ifdef INVARIANTS + struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; +#endif + + INP_WLOCK_ASSERT(inp); + INP_HASH_WLOCK_ASSERT(pcbinfo); + + error = prison_local_ip6(cred, laddr, + ((inp->inp_flags & IN6P_IPV6_V6ONLY) != 0)); + if (error) + return(error); + + /* XXX: this is redundant when called from in6_pcbbind */ + if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT|SO_REUSEPORT_LB)) == 0) + lookupflags = INPLOOKUP_WILDCARD; + + inp->inp_flags |= INP_ANONPORT; + + error = in_pcb_lport(inp, NULL, &lport, cred, lookupflags); + if (error != 0) + return (error); + + inp->inp_lport = lport; + if (in_pcbinshash(inp) != 0) { + inp->in6p_laddr = in6addr_any; + inp->inp_lport = 0; + return (EAGAIN); + } + + return (0); +} + int in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, struct ucred *cred) diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c index 7f623709de13..875e0a63745c 100644 --- a/sys/netinet6/in6_src.c +++ b/sys/netinet6/in6_src.c @@ -926,48 +926,6 @@ in6_selecthlim(struct inpcb *inp, struct ifnet *ifp) return (V_ip6_defhlim); } -/* - * XXX: this is borrowed from in6_pcbbind(). If possible, we should - * share this function by all *bsd*... - */ -int -in6_pcbsetport(struct in6_addr *laddr, struct inpcb *inp, struct ucred *cred) -{ - struct socket *so = inp->inp_socket; - u_int16_t lport = 0; - int error, lookupflags = 0; -#ifdef INVARIANTS - struct inpcbinfo *pcbinfo = inp->inp_pcbinfo; -#endif - - INP_WLOCK_ASSERT(inp); - INP_HASH_WLOCK_ASSERT(pcbinfo); - - error = prison_local_ip6(cred, laddr, - ((inp->inp_flags & IN6P_IPV6_V6ONLY) != 0)); - if (error) - return(error); - - /* XXX: this is redundant when called from in6_pcbbind */ - if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT|SO_REUSEPORT_LB)) == 0) - lookupflags = INPLOOKUP_WILDCARD; - - inp->inp_flags |= INP_ANONPORT; - - error = in_pcb_lport(inp, NULL, &lport, cred, lookupflags); - if (error != 0) - return (error); - - inp->inp_lport = lport; - if (in_pcbinshash(inp) != 0) { - inp->in6p_laddr = in6addr_any; - inp->inp_lport = 0; - return (EAGAIN); - } - - return (0); -} - void addrsel_policy_init(void) { From nobody Mon Oct 18 17:33:54 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B244A17F7590; Mon, 18 Oct 2021 17:33: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 4HY3rf65fDz3Gw9; Mon, 18 Oct 2021 17:33: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 A02A524B14; Mon, 18 Oct 2021 17:33: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 19IHXsqb045889; Mon, 18 Oct 2021 17:33:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IHXsqw045888; Mon, 18 Oct 2021 17:33:54 GMT (envelope-from git) Date: Mon, 18 Oct 2021 17:33:54 GMT Message-Id: <202110181733.19IHXsqw045888@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 0f617ae48a91 - main - Add in_pcb_var.h for KPIs that are private to in_pcb.c and in6_pcb.c. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0f617ae48a911caab3130d0e80cfb425bc3b653b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=0f617ae48a911caab3130d0e80cfb425bc3b653b commit 0f617ae48a911caab3130d0e80cfb425bc3b653b Author: Gleb Smirnoff AuthorDate: 2021-10-18 17:14:03 +0000 Commit: Gleb Smirnoff CommitDate: 2021-10-18 17:19:57 +0000 Add in_pcb_var.h for KPIs that are private to in_pcb.c and in6_pcb.c. --- sys/netinet/in_pcb.c | 1 + sys/netinet/in_pcb.h | 8 ------- sys/netinet/in_pcb_var.h | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ sys/netinet6/in6_pcb.c | 1 + 4 files changed, 57 insertions(+), 8 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index e267d25c4f69..1a7639c0137b 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$"); #if defined(INET) || defined(INET6) #include #include +#include #ifdef INET #include #include diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 861c0ba5f0aa..d6a335236599 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -826,11 +826,6 @@ void in_pcbgroup_update_mbuf(struct inpcb *, struct mbuf *); void in_pcbpurgeif0(struct inpcbinfo *, struct ifnet *); int in_pcballoc(struct socket *, struct inpcbinfo *); int in_pcbbind(struct inpcb *, struct sockaddr *, struct ucred *); -int in_pcb_lport_dest(struct inpcb *inp, struct sockaddr *lsa, - u_short *lportp, struct sockaddr *fsa, u_short fport, - struct ucred *cred, int lookupflags); -int in_pcb_lport(struct inpcb *, struct in_addr *, u_short *, - struct ucred *, int); int in_pcbbind_setup(struct inpcb *, struct sockaddr *, in_addr_t *, u_short *, struct ucred *); int in_pcbconnect(struct inpcb *, struct sockaddr *, struct ucred *); @@ -848,9 +843,6 @@ int in_pcbinshash_mbuf(struct inpcb *, struct mbuf *); int in_pcbladdr(struct inpcb *, struct in_addr *, struct in_addr *, struct ucred *); int in_pcblbgroup_numa(struct inpcb *, int arg); -struct inpcb * - in_pcblookup_local(struct inpcbinfo *, - struct in_addr, u_short, int, struct ucred *); struct inpcb * in_pcblookup(struct inpcbinfo *, struct in_addr, u_int, struct in_addr, u_int, int, struct ifnet *); diff --git a/sys/netinet/in_pcb_var.h b/sys/netinet/in_pcb_var.h new file mode 100644 index 000000000000..5038ab404871 --- /dev/null +++ b/sys/netinet/in_pcb_var.h @@ -0,0 +1,55 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1982, 1986, 1990, 1993 + * The Regents of the University of California. + * Copyright (c) 2010-2011 Juniper Networks, Inc. + * All rights reserved. + * + * Portions of this software were developed by Robert N. M. Watson under + * contract to Juniper Networks, Inc. + * + * 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. + * 3. Neither the name of the University 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 REGENTS 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 REGENTS 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. + * + * @(#)in_pcb.h 8.1 (Berkeley) 6/10/93 + * $FreeBSD$ + */ + +#ifndef _NETINET_IN_PCB_VAR_H_ +#define _NETINET_IN_PCB_VAR_H_ + +/* + * Definitions shared between netinet/in_pcb.c and netinet6/in6_pcb.c + */ + +int in_pcb_lport(struct inpcb *, struct in_addr *, u_short *, + struct ucred *, int); +int in_pcb_lport_dest(struct inpcb *inp, struct sockaddr *lsa, + u_short *lportp, struct sockaddr *fsa, u_short fport, + struct ucred *cred, int lookupflags); +struct inpcb * in_pcblookup_local(struct inpcbinfo *, struct in_addr, u_short, + int, struct ucred *); + +#endif /* !_NETINET_IN_PCB_VAR_H_ */ diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 10a29f339773..9a5d69e16a1c 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -110,6 +110,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From nobody Mon Oct 18 18:41:57 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8FCDB181553C; Mon, 18 Oct 2021 18:41: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 4HY5M93bdGz3t7d; Mon, 18 Oct 2021 18:41: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 5CE8B256FD; Mon, 18 Oct 2021 18:41: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 19IIfvSo037770; Mon, 18 Oct 2021 18:41:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IIfvA5037769; Mon, 18 Oct 2021 18:41:57 GMT (envelope-from git) Date: Mon, 18 Oct 2021 18:41:57 GMT Message-Id: <202110181841.19IIfvA5037769@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 9b7501e7977c - main - in_mcast: garbage collect inp_gcmoptions() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9b7501e7977c1f4a0a4a798cdf0af64846009df8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=9b7501e7977c1f4a0a4a798cdf0af64846009df8 commit 9b7501e7977c1f4a0a4a798cdf0af64846009df8 Author: Gleb Smirnoff AuthorDate: 2021-10-18 18:36:07 +0000 Commit: Gleb Smirnoff CommitDate: 2021-10-18 18:36:07 +0000 in_mcast: garbage collect inp_gcmoptions() It is is used only once, merge it into inp_freemoptions(). --- sys/netinet/in_mcast.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c index ad2d7af799a5..f307be283e64 100644 --- a/sys/netinet/in_mcast.c +++ b/sys/netinet/in_mcast.c @@ -1588,13 +1588,16 @@ inp_findmoptions(struct inpcb *inp) return (imo); } -static void -inp_gcmoptions(struct ip_moptions *imo) +void +inp_freemoptions(struct ip_moptions *imo) { struct in_mfilter *imf; struct in_multi *inm; struct ifnet *ifp; + if (imo == NULL) + return; + while ((imf = ip_mfilter_first(&imo->imo_head)) != NULL) { ip_mfilter_remove(&imo->imo_head, imf); @@ -1613,20 +1616,6 @@ inp_gcmoptions(struct ip_moptions *imo) free(imo, M_IPMOPTS); } -/* - * Discard the IP multicast options (and source filters). To minimize - * the amount of work done while holding locks such as the INP's - * pcbinfo lock (which is used in the receive path), the free - * operation is deferred to the epoch callback task. - */ -void -inp_freemoptions(struct ip_moptions *imo) -{ - if (imo == NULL) - return; - inp_gcmoptions(imo); -} - /* * Atomically get source filters on a socket for an IPv4 multicast group. * Called with INP lock held; returns with lock released. From nobody Mon Oct 18 19:19:15 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 66AD917F8399; Mon, 18 Oct 2021 19:19: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 4HY6BC2WRrz4cRd; Mon, 18 Oct 2021 19:19: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 35B88260B5; Mon, 18 Oct 2021 19:19: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 19IJJF1o080135; Mon, 18 Oct 2021 19:19:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IJJFAO080134; Mon, 18 Oct 2021 19:19:15 GMT (envelope-from git) Date: Mon, 18 Oct 2021 19:19:15 GMT Message-Id: <202110181919.19IJJFAO080134@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: 8e53cd709943 - main - ipq4018: add TCSR definitions from Linux. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 8e53cd70994369510b24248aad1352aed70727c9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=8e53cd70994369510b24248aad1352aed70727c9 commit 8e53cd70994369510b24248aad1352aed70727c9 Author: Adrian Chadd AuthorDate: 2021-10-16 03:11:46 +0000 Commit: Adrian Chadd CommitDate: 2021-10-18 19:18:01 +0000 ipq4018: add TCSR definitions from Linux. These are hardware configuration options which are required in the linux/openwrt device trees for the IPQ4018/IPQ4019 devices. Since this isn't obtained from linux upstream but instead from openwrt, this can't go in contrib; instead it is going in sys/dts/include/ . Obtained from: OpenWRT Tested: * IPQ4019 ASUS RT-AC58U AP, initial bootstrapping --- sys/conf/Makefile.arm | 2 +- sys/dts/include/dt-bindings/soc/qcom,tcsr.h | 27 +++++++++++++++++++++++++++ sys/tools/fdt/make_dtb.sh | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/sys/conf/Makefile.arm b/sys/conf/Makefile.arm index 754b43131d6d..9034ffb5e29a 100644 --- a/sys/conf/Makefile.arm +++ b/sys/conf/Makefile.arm @@ -30,7 +30,7 @@ S= ../../.. .endif .include "$S/conf/kern.pre.mk" -INCLUDES+= -I$S/contrib/libfdt -I$S/contrib/device-tree/include +INCLUDES+= -I$S/contrib/libfdt -I$S/contrib/device-tree/include -I$$/dts/include LINUX_DTS_VERSION!= awk '/freebsd,dts-version/ { sub(/;$$/,"", $$NF); print $$NF }' $S/dts/freebsd-compatible.dts CFLAGS += -DLINUX_DTS_VERSION=\"${LINUX_DTS_VERSION}\" diff --git a/sys/dts/include/dt-bindings/soc/qcom,tcsr.h b/sys/dts/include/dt-bindings/soc/qcom,tcsr.h new file mode 100644 index 000000000000..47540b3b8a04 --- /dev/null +++ b/sys/dts/include/dt-bindings/soc/qcom,tcsr.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. */ +#ifndef __DT_BINDINGS_QCOM_TCSR_H__ +#define __DT_BINDINGS_QCOM_TCSR_H__ + +#define TCSR_USB_SELECT_USB3_P0 0x1 +#define TCSR_USB_SELECT_USB3_P1 0x2 +#define TCSR_USB_SELECT_USB3_DUAL 0x3 + +#define TCSR_USB_HSPHY_HOST_MODE 0x00E700E7 +#define TCSR_USB_HSPHY_DEVICE_MODE 0x00C700E7 + +#define TCSR_ESS_PSGMII 0 +#define TCSR_ESS_PSGMII_RGMII5 1 +#define TCSR_ESS_PSGMII_RMII0 2 +#define TCSR_ESS_PSGMII_RMII1 4 +#define TCSR_ESS_PSGMII_RMII0_RMII1 6 +#define TCSR_ESS_PSGMII_RGMII4 9 + +#define TCSR_WIFI_GLB_CFG 0x41000000 + +#define TCSR_WIFI_NOC_MEMTYPE_M0_M2 0x02222222 + +#define IPQ806X_TCSR_REG_A_ADM_CRCI_MUX_SEL 0 +#define IPQ806X_TCSR_REG_B_ADM_CRCI_MUX_SEL 1 + +#endif diff --git a/sys/tools/fdt/make_dtb.sh b/sys/tools/fdt/make_dtb.sh index 09d0b3bd9f42..e1a2fa4b1d8a 100755 --- a/sys/tools/fdt/make_dtb.sh +++ b/sys/tools/fdt/make_dtb.sh @@ -23,6 +23,6 @@ fi for d in ${dts}; do dtb="${dtb_path}/$(basename "$d" .dts).dtb" ${ECHO} "converting $d -> $dtb" - ${CPP} -P -x assembler-with-cpp -I "$S/contrib/device-tree/include" -I "$S/dts/${MACHINE}" -I "$S/contrib/device-tree/src/${MACHINE}" -I "$S/contrib/device-tree/src/" -include "$d" -include "$S/dts/freebsd-compatible.dts" /dev/null | + ${CPP} -P -x assembler-with-cpp -I "$S/dts/include" -I "$S/contrib/device-tree/include" -I "$S/dts/${MACHINE}" -I "$S/contrib/device-tree/src/${MACHINE}" -I "$S/contrib/device-tree/src/" -include "$d" -include "$S/dts/freebsd-compatible.dts" /dev/null | ${DTC} -@ -O dtb -o "$dtb" -b 0 -p 1024 -i "$S/dts/${MACHINE}" -i "$S/contrib/device-tree/src/${MACHINE}" -i "$S/contrib/device-tree/src/" done From nobody Mon Oct 18 19:19:16 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A816917F815F; Mon, 18 Oct 2021 19:19: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 4HY6BD3990z4cRf; Mon, 18 Oct 2021 19:19: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 4A56826138; Mon, 18 Oct 2021 19:19: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 19IJJGAT080159; Mon, 18 Oct 2021 19:19:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IJJGwd080158; Mon, 18 Oct 2021 19:19:16 GMT (envelope-from git) Date: Mon, 18 Oct 2021 19:19:16 GMT Message-Id: <202110181919.19IJJGwd080158@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: 9264bd386cfc - main - ipq4018: add a device tree file for the ASUS rt-ac58u router List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 9264bd386cfcb3c081f9b7e2a695f25c367c0891 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=9264bd386cfcb3c081f9b7e2a695f25c367c0891 commit 9264bd386cfcb3c081f9b7e2a695f25c367c0891 Author: Adrian Chadd AuthorDate: 2021-10-16 03:13:04 +0000 Commit: Adrian Chadd CommitDate: 2021-10-18 19:18:46 +0000 ipq4018: add a device tree file for the ASUS rt-ac58u router This is the initial device tree file describing the ASUS RT-AC58U 2GHz/5GHz 11ac router. Obtained from: OpenWRT --- sys/dts/arm/qcom-ipq4018-rt-ac58u.dts | 312 ++++++++++++++++++++++++++++++++++ 1 file changed, 312 insertions(+) diff --git a/sys/dts/arm/qcom-ipq4018-rt-ac58u.dts b/sys/dts/arm/qcom-ipq4018-rt-ac58u.dts new file mode 100644 index 000000000000..8a280c79e942 --- /dev/null +++ b/sys/dts/arm/qcom-ipq4018-rt-ac58u.dts @@ -0,0 +1,312 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "ASUS RT-AC58U"; + compatible = "asus,rt-ac58u"; + + memory { + device_type = "memory"; + reg = <0x80000000 0x8000000>; + }; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + serial0 = &blsp1_uart1; + }; + + chosen { + bootargs-append = " ubi.mtd=UBI_DEV"; +// stdout-path = "serial0:115200n8"; + stdout-path = "serial0"; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + usb3@8af8800 { + status = "okay"; + + dwc3@8a00000 { + #address-cells = <1>; + #size-cells = <0>; + + usb3_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + + usb3_port2: port@2 { + reg = <2>; + #trigger-source-cells = <0>; + }; + }; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 4 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: status { + label = "blue:status"; + gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + }; + + wan { + label = "blue:wan"; + gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; + }; + + wlan2G { + label = "blue:wlan2G"; + gpios = <&tlmm 58 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + wlan5G { + label = "blue:wlan5G"; + gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy1tpt"; + }; + + usb { + label = "blue:usb"; + gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; + trigger-sources = <&usb3_port1>, <&usb3_port2>; + linux,default-trigger = "usbport"; + }; + + lan { + label = "blue:lan"; + gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&cryptobam { + status = "okay"; +}; + +&blsp_dma { + status = "okay"; +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio60", "gpio61"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + mux { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + drive-strength = <12>; + bias-disable; + }; + + mux_cs { + function = "gpio"; + pins = "gpio54", "gpio59"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&blsp1_spi1 { /* BLSP1 QUP1 */ + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + status = "okay"; + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>, + <&tlmm 59 GPIO_ACTIVE_HIGH>; + + flash@0 { + /* + * U-boot looks for "n25q128a11" node, + * if we don't have it, it will spit out the following warning: + * "ipq: fdt fixup unable to find compatible node". + */ + compatible = "jedec,spi-nor"; + reg = <0>; + linux,modalias = "m25p80", "mx25l1606e", "n25q128a11"; + spi-max-frequency = <30000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "SBL1"; + reg = <0x00000000 0x00040000>; + read-only; + }; + partition@40000 { + label = "MIBIB"; + reg = <0x00040000 0x00020000>; + read-only; + }; + partition@60000 { + label = "QSEE"; + reg = <0x00060000 0x00060000>; + read-only; + }; + partition@c0000 { + label = "CDT"; + reg = <0x000c0000 0x00010000>; + read-only; + }; + partition@d0000 { + label = "DDRPARAMS"; + reg = <0x000d0000 0x00010000>; + read-only; + }; + partition@e0000 { + label = "APPSBLENV"; /* uboot env*/ + reg = <0x000e0000 0x00010000>; + read-only; + }; + partition@f0000 { + label = "APPSBL"; /* uboot */ + reg = <0x000f0000 0x00080000>; + read-only; + }; + partition@170000 { + label = "ART"; + reg = <0x00170000 0x00010000>; + read-only; + }; + /* 0x00180000 - 0x00200000 unused */ + }; + }; + + spi-nand@1 { + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <30000000>; + + /* + * U-boot looks for "spinand,mt29f" node, + * if we don't have it, it will spit out the following warning: + * "ipq: fdt fixup unable to find compatible node". + */ + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + /* + * TODO: change to label = "ubi" once we drop 4.14. + * also drop the bootargs-append and all the + * userspace CI_UBIPART="UBI_DEV" remains. + */ + label = "UBI_DEV"; + reg = <0x00000000 0x08000000>; + }; + }; + }; +}; + +&blsp1_uart1 { + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&usb3_ss_phy { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&wifi0 { + status = "okay"; + qcom,ath10k-calibration-variant = "RT-AC58U"; +}; + +&wifi1 { + status = "okay"; + qcom,ath10k-calibration-variant = "RT-AC58U"; +}; From nobody Mon Oct 18 19:19:17 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 06CF317F82D4; Mon, 18 Oct 2021 19:19: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 4HY6BF4hNgz4cBn; Mon, 18 Oct 2021 19:19: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 75D79260B6; Mon, 18 Oct 2021 19:19: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 19IJJHhQ080183; Mon, 18 Oct 2021 19:19:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IJJHws080182; Mon, 18 Oct 2021 19:19:17 GMT (envelope-from git) Date: Mon, 18 Oct 2021 19:19:17 GMT Message-Id: <202110181919.19IJJHws080182@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: 8398d52d6541 - main - arm: print out the undefined instruction upon an undefined instruction panic List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 8398d52d6541d316fcd88c856b5a72bb9cce0534 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=8398d52d6541d316fcd88c856b5a72bb9cce0534 commit 8398d52d6541d316fcd88c856b5a72bb9cce0534 Author: Adrian Chadd AuthorDate: 2021-10-16 03:15:15 +0000 Commit: Adrian Chadd CommitDate: 2021-10-18 19:18:52 +0000 arm: print out the undefined instruction upon an undefined instruction panic It's SUPER useful to be able to see the actual undefined instruction when we hit said undefined instruction. --- sys/arm/arm/undefined.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/arm/arm/undefined.c b/sys/arm/arm/undefined.c index ef9e72c89163..4e9a5295d338 100644 --- a/sys/arm/arm/undefined.c +++ b/sys/arm/arm/undefined.c @@ -341,7 +341,8 @@ undefinedinstruction(struct trapframe *frame) return; } else - panic("Undefined instruction in kernel.\n"); + panic("Undefined instruction in kernel (0x%08x).\n", + fault_instruction); } userret(td, frame); From nobody Mon Oct 18 19:19:18 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C6F8617F8351; Mon, 18 Oct 2021 19:19: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 4HY6BG5Xy7z4cH3; Mon, 18 Oct 2021 19:19: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 9830026027; Mon, 18 Oct 2021 19:19: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 19IJJIUv080207; Mon, 18 Oct 2021 19:19:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IJJILE080206; Mon, 18 Oct 2021 19:19:18 GMT (envelope-from git) Date: Mon, 18 Oct 2021 19:19:18 GMT Message-Id: <202110181919.19IJJILE080206@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: c29c0e68765f - main - arm: allow the debug stuff in CP14 to be disabled at compile time List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: c29c0e68765f4b98c8507d0dabb976e589b74d4b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=c29c0e68765f4b98c8507d0dabb976e589b74d4b commit c29c0e68765f4b98c8507d0dabb976e589b74d4b Author: Adrian Chadd AuthorDate: 2021-10-16 18:32:08 +0000 Commit: Adrian Chadd CommitDate: 2021-10-18 19:18:56 +0000 arm: allow the debug stuff in CP14 to be disabled at compile time The upcoming QCA ipq401x support detects the CP14 debug features, but any attempt to use it causes an undefined instruction error. It apparently needs a specific TZ image loaded by the early bootloader (SBL) in order to enable these kinds of features. So add a new kernel option that explicitly disables this in the arm code - the debugger works fine without it. --- sys/arm/arm/debug_monitor.c | 5 +++++ sys/conf/options.arm | 1 + 2 files changed, 6 insertions(+) diff --git a/sys/arm/arm/debug_monitor.c b/sys/arm/arm/debug_monitor.c index b73249bedcf1..b9678a5040af 100644 --- a/sys/arm/arm/debug_monitor.c +++ b/sys/arm/arm/debug_monitor.c @@ -960,6 +960,10 @@ vectr_clr: void dbg_monitor_init(void) { +#ifdef ARM_FORCE_DBG_MONITOR_DISABLE + db_printf("ARM Debug Architecture disabled in kernel compilation.\n"); + return; +#else int err; /* Fetch ARM Debug Architecture model */ @@ -1001,6 +1005,7 @@ dbg_monitor_init(void) db_printf("HW Breakpoints/Watchpoints not enabled on CPU%d\n", PCPU_GET(cpuid)); +#endif /* ARM_FORCE_DBG_MONITOR_DISABLE */ } CTASSERT(sizeof(struct dbreg) == sizeof(((struct pcpu *)NULL)->pc_dbreg)); diff --git a/sys/conf/options.arm b/sys/conf/options.arm index 62f1a79fe314..0e5726e9713e 100644 --- a/sys/conf/options.arm +++ b/sys/conf/options.arm @@ -1,6 +1,7 @@ #$FreeBSD$ ARMV6 opt_global.h ARMV7 opt_global.h +ARM_FORCE_DBG_MONITOR_DISABLE opt_ddb.h CPSW_ETHERSWITCH opt_cpsw.h CPU_ARM1176 opt_global.h CPU_CORTEXA opt_global.h From nobody Mon Oct 18 19:19:19 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id ECB7517F81DE; Mon, 18 Oct 2021 19:19:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HY6BJ2SySz4cQ3; Mon, 18 Oct 2021 19:19: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 B8C0525E45; Mon, 18 Oct 2021 19:19: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 19IJJJmt080231; Mon, 18 Oct 2021 19:19:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IJJJYk080230; Mon, 18 Oct 2021 19:19:19 GMT (envelope-from git) Date: Mon, 18 Oct 2021 19:19:19 GMT Message-Id: <202110181919.19IJJJYk080230@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: 02438ce5fd18 - main - ipq4018: add initial IPQ4018/IPQ4019 support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 02438ce5fd1892e3f59e4f1e83a0ac810396853f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=02438ce5fd1892e3f59e4f1e83a0ac810396853f commit 02438ce5fd1892e3f59e4f1e83a0ac810396853f Author: Adrian Chadd AuthorDate: 2021-10-16 18:47:44 +0000 Commit: Adrian Chadd CommitDate: 2021-10-18 19:19:00 +0000 ipq4018: add initial IPQ4018/IPQ4019 support This is for the Qualcomm Atheros quad-core ARMv7 SoC with built-in 2x2 2GHz and 5GHz ath10k devices. It's enough (with an upcoming set of config files) to netboot on an ASUS router I have here and get to a single core mountroot prompt. --- sys/arm/qualcomm/ipq4018_machdep.c | 194 +++++++++++++++++++++++++++++++++++++ sys/arm/qualcomm/ipq4018_machdep.h | 38 ++++++++ sys/arm/qualcomm/ipq4018_mp.c | 61 ++++++++++++ sys/arm/qualcomm/ipq4018_reg.h | 42 ++++++++ sys/arm/qualcomm/std.ipq4018 | 2 + 5 files changed, 337 insertions(+) diff --git a/sys/arm/qualcomm/ipq4018_machdep.c b/sys/arm/qualcomm/ipq4018_machdep.c new file mode 100644 index 000000000000..b3f841575ebb --- /dev/null +++ b/sys/arm/qualcomm/ipq4018_machdep.c @@ -0,0 +1,194 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Adrian Chadd + * + * 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 "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include "platform_if.h" + +static int +ipq4018_attach(platform_t plat) +{ + return (0); +} + +static void +ipq4018_late_init(platform_t plat) +{ + /* + * XXX FIXME This is needed because we're not parsing + * the fdt reserved memory regions in a consistent way + * between arm/arm64. Once the reserved region parsing + * is fixed up this will become unneccessary. + * + * These cover the SRAM/TZ regions that are not fully + * accessible from the OS. They're in the ipq4018.dtsi + * tree. + * + * Without these, the system fails to boot because we + * aren't parsing the regions correctly. + * + * These will be unnecessary once the parser and setup + * code is fixed. + */ + physmem_exclude_region(IPQ4018_MEM_SMEM_START, + IPQ4018_MEM_SMEM_SIZE, + EXFLAG_NODUMP | EXFLAG_NOALLOC); + physmem_exclude_region(IPQ4018_MEM_TZ_START, + IPQ4018_MEM_TZ_SIZE, + EXFLAG_NODUMP | EXFLAG_NOALLOC); +} + +static int +ipq4018_devmap_init(platform_t plat) +{ + /* + * This covers the boot UART. Without it we can't boot successfully: + * there's a mutex uninit panic in subr_vmem.c that occurs when doing + * a call to pmap_mapdev() when the bus space code is doing its thing. + */ + devmap_add_entry(IPQ4018_MEM_UART1_START, IPQ4018_MEM_UART1_SIZE); + return (0); +} + +static void +ipq4018_cpu_reset(platform_t plat) +{ +} + +/* + * Early putc routine for EARLY_PRINTF support. To use, add to kernel config: + * option SOCDEV_PA=0x07800000 + * option SOCDEV_VA=0x07800000 + * option EARLY_PRINTF + * Resist the temptation to change the #if 0 to #ifdef EARLY_PRINTF here. It + * makes sense now, but if multiple SOCs do that it will make early_putc another + * duplicate symbol to be eliminated on the path to a generic kernel. + */ +#if 0 +void +qca_msm_early_putc(int c) +{ + static int is_init = 0; + + int limit; +/* + * This must match what's put into SOCDEV_VA. You have to change them + * both together. + * + * XXX TODO I should really go and just make UART_BASE here depend upon + * SOCDEV_VA so they move together. + */ +#define UART_BASE IPQ4018_MEM_UART1_START + volatile uint32_t * UART_DM_TF0 = (uint32_t *)(UART_BASE + 0x70); + volatile uint32_t * UART_DM_SR = (uint32_t *)(UART_BASE + 0x08); +#define UART_DM_SR_TXEMT (1 << 3) +#define UART_DM_SR_TXRDY (1 << 2) + volatile uint32_t * UART_DM_ISR = (uint32_t *)(UART_BASE + 0x14); + volatile uint32_t * UART_DM_CR = (uint32_t *)(UART_BASE + 0x10); +#define UART_DM_TX_READY (1 << 7) +#define UART_DM_CLEAR_TX_READY 0x300 + volatile uint32_t * UART_DM_NO_CHARS_FOR_TX = (uint32_t *)(UART_BASE + 0x40); + volatile uint32_t * UART_DM_TFWR = (uint32_t *)(UART_BASE + 0x1c); +#define UART_DM_TFW_VALUE 0 + volatile uint32_t * UART_DM_IPR = (uint32_t *)(UART_BASE + 0x18); +#define UART_DM_STALE_TIMEOUT_LSB 0xf + + if (is_init == 0) { + is_init = 1; + *UART_DM_TFWR = UART_DM_TFW_VALUE; + wmb(); + *UART_DM_IPR = UART_DM_STALE_TIMEOUT_LSB; + wmb(); + } + + /* Wait until TXFIFO is empty via ISR */ + limit = 100000; + if ((*UART_DM_SR & UART_DM_SR_TXEMT) == 0) { + while (((*UART_DM_ISR & UART_DM_TX_READY) == 0) && --limit) { + /* Note - can't use DELAY here yet, too early */ + rmb(); + } + *UART_DM_CR = UART_DM_CLEAR_TX_READY; + wmb(); + } + + /* FIFO is ready. Say we're going to write one byte */ + *UART_DM_NO_CHARS_FOR_TX = 1; + wmb(); + + limit = 100000; + while (((*UART_DM_SR & UART_DM_SR_TXRDY) == 0) && --limit) { + /* Note - can't use DELAY here yet, too early */ + rmb(); + } + + /* Put character in first fifo slot */ + *UART_DM_TF0 = c; + wmb(); +} +early_putc_t *early_putc = qca_msm_early_putc; +#endif + +static platform_method_t ipq4018_methods[] = { + PLATFORMMETHOD(platform_attach, ipq4018_attach), + PLATFORMMETHOD(platform_devmap_init, ipq4018_devmap_init), + PLATFORMMETHOD(platform_late_init, ipq4018_late_init), + PLATFORMMETHOD(platform_cpu_reset, ipq4018_cpu_reset), + +#ifdef SMP + PLATFORMMETHOD(platform_mp_start_ap, ipq4018_mp_start_ap), + PLATFORMMETHOD(platform_mp_setmaxid, ipq4018_mp_setmaxid), +#endif + + PLATFORMMETHOD_END, +}; + +FDT_PLATFORM_DEF2(ipq4018, ipq4018_ac58u, "ASUS RT-AC58U", 0, + "asus,rt-ac58u", 80); diff --git a/sys/arm/qualcomm/ipq4018_machdep.h b/sys/arm/qualcomm/ipq4018_machdep.h new file mode 100644 index 000000000000..8fbd26de14a8 --- /dev/null +++ b/sys/arm/qualcomm/ipq4018_machdep.h @@ -0,0 +1,38 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Adrian Chadd + * + * 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$ + */ + +#ifndef IPQ4018_MACHDEP_H +#define IPQ4018_MACHDEP_H + +#include + +void ipq4018_mp_setmaxid(platform_t plat); +void ipq4018_mp_start_ap(platform_t plat); + +#endif diff --git a/sys/arm/qualcomm/ipq4018_mp.c b/sys/arm/qualcomm/ipq4018_mp.c new file mode 100644 index 000000000000..37b7cc3e097d --- /dev/null +++ b/sys/arm/qualcomm/ipq4018_mp.c @@ -0,0 +1,61 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Adrian Chadd + * + * 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 "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include + +#include + +#include "platform_if.h" + +void +ipq4018_mp_setmaxid(platform_t plat) +{ +} + +void +ipq4018_mp_start_ap(platform_t plat) +{ +} diff --git a/sys/arm/qualcomm/ipq4018_reg.h b/sys/arm/qualcomm/ipq4018_reg.h new file mode 100644 index 000000000000..945d650dcfd6 --- /dev/null +++ b/sys/arm/qualcomm/ipq4018_reg.h @@ -0,0 +1,42 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Adrian Chadd + * + * 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$ + */ + +#ifndef IPQ4018_REG_H +#define IPQ4018_REG_H + +#define IPQ4018_MEM_SMEM_START 0x87e00000 +#define IPQ4018_MEM_SMEM_SIZE 0x00080000 + +#define IPQ4018_MEM_TZ_START 0x87e80000 +#define IPQ4018_MEM_TZ_SIZE 0x00180000 + +#define IPQ4018_MEM_UART1_START 0x078af000 +#define IPQ4018_MEM_UART1_SIZE 0x00001000 + +#endif diff --git a/sys/arm/qualcomm/std.ipq4018 b/sys/arm/qualcomm/std.ipq4018 new file mode 100644 index 000000000000..9a9801fa6415 --- /dev/null +++ b/sys/arm/qualcomm/std.ipq4018 @@ -0,0 +1,2 @@ +arm/qualcomm/ipq4018_machdep.c standard +arm/qualcomm/ipq4018_mp.c optional smp From nobody Mon Oct 18 19:19:20 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C64FE17F836C; Mon, 18 Oct 2021 19:19: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 4HY6BK13npz4cN3; Mon, 18 Oct 2021 19:19: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 DECDD26028; Mon, 18 Oct 2021 19:19:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19IJJKWo080262; Mon, 18 Oct 2021 19:19:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IJJK9F080261; Mon, 18 Oct 2021 19:19:20 GMT (envelope-from git) Date: Mon, 18 Oct 2021 19:19:20 GMT Message-Id: <202110181919.19IJJK9F080261@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: fb7a00772898 - main - arm: add a std.qca for 32 bit armv7 platforms List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: fb7a00772898a6dce16f790e013cbdc7e8591363 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=fb7a00772898a6dce16f790e013cbdc7e8591363 commit fb7a00772898a6dce16f790e013cbdc7e8591363 Author: Adrian Chadd AuthorDate: 2021-10-16 18:48:02 +0000 Commit: Adrian Chadd CommitDate: 2021-10-18 19:19:03 +0000 arm: add a std.qca for 32 bit armv7 platforms This is the minimal config required to boot on the IPQ4018 SoC and likely future ones as well in this family. --- sys/arm/conf/std.qca | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/sys/arm/conf/std.qca b/sys/arm/conf/std.qca new file mode 100644 index 000000000000..cabd5f309121 --- /dev/null +++ b/sys/arm/conf/std.qca @@ -0,0 +1,28 @@ +# +# QCA SoC support (32 bit) +# + +machine arm armv7 +cpu CPU_CORTEXA +makeoptions CONF_CFLAGS="-march=armv7a" + +files "../qualcomm/std.ipq4018" + +# Serial (COM) ports +device uart +device uart_msm # Qualcomm MSM UART driver + +device gic + +# MMC/SD/SDIO Card slot support +device mmc +device sdhci + +# Timers +device generic_timer +device mpcore_timer + +options FDT + +# Disable CP14 work in DDB as TZ won't let us by default +options ARM_FORCE_DBG_MONITOR_DISABLE From nobody Mon Oct 18 19:19:21 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2043D17F868C; Mon, 18 Oct 2021 19:19: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 4HY6BL4fBCz4cVR; Mon, 18 Oct 2021 19:19: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 0BA5826029; Mon, 18 Oct 2021 19:19: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 19IJJLPQ080286; Mon, 18 Oct 2021 19:19:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IJJLAZ080285; Mon, 18 Oct 2021 19:19:21 GMT (envelope-from git) Date: Mon, 18 Oct 2021 19:19:21 GMT Message-Id: <202110181919.19IJJLAZ080285@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: 015ff812d6b7 - main - ipq4018: add initial IPQ4018/IPQ4019 support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 015ff812d6b7eda57f87789173bad675ca685bb2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=015ff812d6b7eda57f87789173bad675ca685bb2 commit 015ff812d6b7eda57f87789173bad675ca685bb2 Author: Adrian Chadd AuthorDate: 2021-10-16 18:48:37 +0000 Commit: Adrian Chadd CommitDate: 2021-10-18 19:19:06 +0000 ipq4018: add initial IPQ4018/IPQ4019 support Summary: This adds required IPQ4018/IPQ4019 SoC support to boot. It also includes support for disabling the ARMv7 hardware breakpoint / debug stuff at compile time as this is required for the IPQ SoCs, and printing out the undefined instruction itself. Test Plan: * compiled/booted on an IPQ4019 SoC AP Reviewers: #core_team! Subscribers: imp, andrew Differential Revision: https://reviews.freebsd.org/D32538 --- sys/arm/conf/ASUS_AC1300 | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/sys/arm/conf/ASUS_AC1300 b/sys/arm/conf/ASUS_AC1300 new file mode 100644 index 000000000000..73d3d9f37eb7 --- /dev/null +++ b/sys/arm/conf/ASUS_AC1300 @@ -0,0 +1,52 @@ +# +# ASUS_AC1300 -- Qualcomm kernel configuration file for FreeBSD/arm +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (https://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# + +#NO_UNIVERSE + +include "std.armv7" +include "std.qca" + +cpu CPU_CORTEXA +ident ASUS_AC1300 +machine arm armv7 + +# Use a low VA here so we get the early printf stuff working all the +# way up to cninit(). +#options SOCDEV_PA=0x07800000 +#options SOCDEV_VA=0x07800000 +#options EARLY_PRINTF +options BOOTVERBOSE + +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=qcom-ipq4018-rt-ac58u.dts + +options LINUX_BOOT_ABI +options SCHED_ULE +# DEFINITELY not ready for SMP yet! +# options SMP +options PLATFORM + +device loop +device pty +device md +device gpio + +device ether +device mii +device bpf From nobody Mon Oct 18 20:14:24 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 05AF817F775A for ; Mon, 18 Oct 2021 20:14:32 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HY7Pz6dR5z3LdP for ; Mon, 18 Oct 2021 20:14:31 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f53.google.com with SMTP id k7so43304651wrd.13 for ; Mon, 18 Oct 2021 13:14:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=yFHswOQIa+gczhwdN8rjXNDvURoC7ilhOQhfss62qjQ=; b=SyfzbVFH1q7GYOiifQupF5/GkQlc9AqfS5C/9eHI3epFqOr4MwreadRED/3PWxJkjf tRKKIshoNqoR2vwLnIzJEqVik8GcZPBivdEUuEft2hhl6p06YWZKQM6K7O6i7XteqA8u NlTfW3FuPU2p5IkdxJmuyn2L8peU9gPVvSnZUgPjXBkN6U82lHQFtXj+q9lHQdpgDkLZ 7ET4ZEtIfk2pB7nQ4baEiJRSWHG2qxOnmpx0k7/A/vagHst79rYSkLIIwuWPcx/xHVT4 nHmupzllwzKm//s17rcdgZZQ8cUBqzRq4tjZx2OjfB1Hy8t9NgHl5SbupF8F/esAvvSj XstQ== X-Gm-Message-State: AOAM533WqaQQkJ1ZqTbOog/BOdsk/CulHlASRG/VbsTzX7XeUbfJ57II B1TCiNh7FbkWIO4XjN064bT4Ww== X-Google-Smtp-Source: ABdhPJy2zzdTAgWUefwkH2k24benHogmGzlya9opOe8970OM+WaPiYptivEtm+8xO4UpwR7P1rR0zA== X-Received: by 2002:a5d:59a3:: with SMTP id p3mr38828102wrr.146.1634588065047; Mon, 18 Oct 2021 13:14:25 -0700 (PDT) Received: from smtpclient.apple (global-5-141.nat-2.net.cam.ac.uk. [131.111.5.141]) by smtp.gmail.com with ESMTPSA id w5sm13197045wra.87.2021.10.18.13.14.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Oct 2021 13:14:24 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: 8398d52d6541 - main - arm: print out the undefined instruction upon an undefined instruction panic From: Jessica Clarke In-Reply-To: <202110181919.19IJJHws080182@gitrepo.freebsd.org> Date: Mon, 18 Oct 2021 21:14:24 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202110181919.19IJJHws080182@gitrepo.freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4HY7Pz6dR5z3LdP X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 18 Oct 2021, at 20:19, Adrian Chadd wrote: >=20 > The branch main has been updated by adrian: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D8398d52d6541d316fcd88c856b5a72bb= 9cce0534 >=20 > commit 8398d52d6541d316fcd88c856b5a72bb9cce0534 > Author: Adrian Chadd > AuthorDate: 2021-10-16 03:15:15 +0000 > Commit: Adrian Chadd > CommitDate: 2021-10-18 19:18:52 +0000 >=20 > arm: print out the undefined instruction upon an undefined = instruction panic >=20 > It's SUPER useful to be able to see the actual undefined = instruction > when we hit said undefined instruction. > --- > sys/arm/arm/undefined.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/sys/arm/arm/undefined.c b/sys/arm/arm/undefined.c > index ef9e72c89163..4e9a5295d338 100644 > --- a/sys/arm/arm/undefined.c > +++ b/sys/arm/arm/undefined.c > @@ -341,7 +341,8 @@ undefinedinstruction(struct trapframe *frame) > return; > } > else > - panic("Undefined instruction in kernel.\n"); > + panic("Undefined instruction in kernel = (0x%08x).\n", > + fault_instruction); As I said in the review, printing this without the PSR_T bit in SPSR isn=E2=80=99t all that helpful, you can=E2=80=99t decode it without = knowing what SPSR is (though you may be able to guess by seeing whether one decoding is total junk and the other might plausibly trap). Jess From nobody Mon Oct 18 20:15:50 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 67B4417F8117; Mon, 18 Oct 2021 20:15:52 +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 4HY7RX2NKjz3M7x; Mon, 18 Oct 2021 20:15:52 +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 A171A254DA; Mon, 18 Oct 2021 20:15:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: 7881db834647 - main - Remove POWER_PM_TYPE_APM. It's now unused. To: Warner Losh Cc: Warner Losh , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202110181445.19IEj36g019473@gitrepo.freebsd.org> From: John Baldwin Message-ID: Date: Mon, 18 Oct 2021 13:15:50 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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-ThisMailContainsUnwantedMimeParts: N On 10/18/21 9:50 AM, Warner Losh wrote: > On Mon, Oct 18, 2021 at 10:37 AM John Baldwin wrote: > >> On 10/18/21 7:45 AM, Warner Losh wrote: >>> The branch main has been updated by imp: >>> >>> URL: >> https://cgit.FreeBSD.org/src/commit/?id=7881db83464759ba783454d2d2eb1b970e352cd3 >>> >>> commit 7881db83464759ba783454d2d2eb1b970e352cd3 >>> Author: Warner Losh >>> AuthorDate: 2021-10-18 14:41:17 +0000 >>> Commit: Warner Losh >>> CommitDate: 2021-10-18 14:41:17 +0000 >>> >>> Remove POWER_PM_TYPE_APM. It's now unused. >>> >>> Sponsored by: Netflix >>> Reviewed by: markj >>> Differential Revision: https://reviews.freebsd.org/D32549 >>> --- >>> sys/sys/power.h | 1 - >>> 1 file changed, 1 deletion(-) >>> >>> diff --git a/sys/sys/power.h b/sys/sys/power.h >>> index 524bc3fabb24..b0535312d1f7 100644 >>> --- a/sys/sys/power.h >>> +++ b/sys/sys/power.h >>> @@ -34,7 +34,6 @@ >>> #include >>> >>> /* Power management system type */ >>> -#define POWER_PM_TYPE_APM 0x00 >>> #define POWER_PM_TYPE_ACPI 0x01 >>> #define POWER_PM_TYPE_NONE 0xff >> >> Do we want to leave a comment that 0x00 was previously used? I don't know >> if we ever >> exposed this value to userland as part of any ABI? >> > > Good question, but I believe the answer is no. > > power_pm_type is static in sys/kern/subr_power.c. It's only exported from > that module > with power_pm_get_type(). This is only called from acpi.c to make decisions > about > whether or not to load, attach, or identify devices. There's also no sysctl > that publish > this, nor is this value used in userland in base. The whole sys/power.h > file has the look > of an internal kernel file because there's no #ifdef _KERNEL section around > all the > prototypes it defines. > > Have I missed something? No, that sounds about right. -- John Baldwin From nobody Mon Oct 18 21:22:58 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A30B517F645E; Mon, 18 Oct 2021 21:22: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 4HY8wy4B7Sz4R1B; Mon, 18 Oct 2021 21:22: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 6F45427D2A; Mon, 18 Oct 2021 21:22: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 19ILMwef055255; Mon, 18 Oct 2021 21:22:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19ILMw77055254; Mon, 18 Oct 2021 21:22:58 GMT (envelope-from git) Date: Mon, 18 Oct 2021 21:22:58 GMT Message-Id: <202110182122.19ILMw77055254@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: e1d6d6f9249d - main - lorder: process read-only data symbols List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: e1d6d6f9249d37c10a0df68024c7dacebdc7bf98 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e1d6d6f9249d37c10a0df68024c7dacebdc7bf98 commit e1d6d6f9249d37c10a0df68024c7dacebdc7bf98 Author: Ed Maste AuthorDate: 2021-10-18 21:19:53 +0000 Commit: Ed Maste CommitDate: 2021-10-18 21:21:17 +0000 lorder: process read-only data symbols Previously they were skipped. lorder(1) serves no functional purpose today but we might as well address this longstanding bug while it is still in the tree. PR: 133860 MFC after: 1 week Submitted by: John Hein --- usr.bin/lorder/lorder.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/lorder/lorder.sh b/usr.bin/lorder/lorder.sh index 390b0b7fe845..676f8995fc92 100644 --- a/usr.bin/lorder/lorder.sh +++ b/usr.bin/lorder/lorder.sh @@ -57,14 +57,14 @@ for i in $*; do echo $i $i done -# if the line has " [TDW] " it's a globally defined symbol, put it +# if the line has " [RTDW] " it's a globally defined symbol, put it # into the symbol file. # # if the line has " U " it's a globally undefined symbol, put it into # the reference file. ${NM} ${NMFLAGS} -go $* | sed " - / [TDW] / { - s/:.* [TDW] / / + / [RTDW] / { + s/:.* [RTDW] / / w $S d } From nobody Mon Oct 18 22:03:37 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9D67C1807674; Mon, 18 Oct 2021 22:03: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 4HY9qs3mG0z4cgH; Mon, 18 Oct 2021 22:03: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 610FA1D2; Mon, 18 Oct 2021 22:03: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 19IM3b1Y008927; Mon, 18 Oct 2021 22:03:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IM3bCs008926; Mon, 18 Oct 2021 22:03:37 GMT (envelope-from git) Date: Mon, 18 Oct 2021 22:03:37 GMT Message-Id: <202110182203.19IM3bCs008926@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: 73dddffc3175 - main - crt_malloc: more accurate handling of mmap(2) failure List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 73dddffc3175581ba99f6ced9a2e508a0e880e59 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=73dddffc3175581ba99f6ced9a2e508a0e880e59 commit 73dddffc3175581ba99f6ced9a2e508a0e880e59 Author: Konstantin Belousov AuthorDate: 2021-10-15 17:59:37 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-18 22:02:47 +0000 crt_malloc: more accurate handling of mmap(2) failure Reset both pagepool_start and pagepool_end after a mmap(2) failure, to avoid using invalid pagepool either for allocation or munmap(2). PR: 259076 Noted by: Denis Koreshkov Reviewed by: arichardson Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32514 --- libexec/rtld-elf/rtld_malloc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libexec/rtld-elf/rtld_malloc.c b/libexec/rtld-elf/rtld_malloc.c index 64218b5bb786..63fa6f5e2ee7 100644 --- a/libexec/rtld-elf/rtld_malloc.c +++ b/libexec/rtld-elf/rtld_malloc.c @@ -271,21 +271,21 @@ morepages(int n) } } - if (pagepool_start == MAP_FAILED) - pagepool_start = 0; offset = (uintptr_t)pagepool_start - rounddown2( (uintptr_t)pagepool_start, pagesz); - pagepool_start = mmap(0, n * pagesz, PROT_READ | PROT_WRITE, + addr = mmap(0, n * pagesz, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); - if (pagepool_start == MAP_FAILED) { + if (addr == MAP_FAILED) { #ifdef IN_RTLD rtld_fdprintf(STDERR_FILENO, _BASENAME_RTLD ": morepages: " "cannot mmap anonymous memory: %s\n", rtld_strerror(errno)); #endif + pagepool_start = pagepool_end = NULL; return (0); } + pagepool_start = addr; pagepool_end = pagepool_start + n * pagesz; pagepool_start += offset; From nobody Mon Oct 18 22:09:57 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 39772180AC81; Mon, 18 Oct 2021 22:09: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 4HY9z96z4Hz4fbl; Mon, 18 Oct 2021 22:09: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 CB7CD5B1; Mon, 18 Oct 2021 22:09: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 19IM9vm7009649; Mon, 18 Oct 2021 22:09:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IM9vUl009648; Mon, 18 Oct 2021 22:09:57 GMT (envelope-from git) Date: Mon, 18 Oct 2021 22:09:57 GMT Message-Id: <202110182209.19IM9vUl009648@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: 52dee2bc0355 - main - nfscl: Handle NFSv4.1/4.2 Close RPC NFSERR_DELAY replies better List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 52dee2bc035545f7ae2b838d8a0449f65043cd8a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=52dee2bc035545f7ae2b838d8a0449f65043cd8a commit 52dee2bc035545f7ae2b838d8a0449f65043cd8a Author: Rick Macklem AuthorDate: 2021-10-18 22:02:21 +0000 Commit: Rick Macklem CommitDate: 2021-10-18 22:05:34 +0000 nfscl: Handle NFSv4.1/4.2 Close RPC NFSERR_DELAY replies better Without this patch, if a NFSv4.1/4.2 server replies NFSERR_DELAY to a Close operation, the client loops retrying the Close while holding a shared lock on the clientID. This shared lock blocks returns of delegations, even though the server has issued a CB_RECALL to request the delegation return. This patch delays doing a retry of a Close that received a reply of NFSERR_DELAY until after the shared lock on the clientID is released, for NFSv4.1/4.2. To fix this for NFSv4.0 would be very difficult and since the only known NFSv4 server to reply NFSERR_DELAY to Close only does NFSv4.1/4.2, this fix is hoped to be sufficient. This problem was detected during a recent IETF working group NFSv4 testing event. MFC after: 2 week --- sys/fs/nfs/nfs_var.h | 3 ++- sys/fs/nfsclient/nfs_clrpcops.c | 11 +++++++---- sys/fs/nfsclient/nfs_clstate.c | 23 +++++++++++++++++++++-- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 3f0fbc535166..7f0ca990540d 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -604,7 +604,8 @@ void nfscl_dumpstate(struct nfsmount *, int, int, int, int); void nfscl_dupopen(vnode_t, int); int nfscl_getclose(vnode_t, struct nfsclclient **); int nfscl_doclose(vnode_t, struct nfsclclient **, NFSPROC_T *); -void nfsrpc_doclose(struct nfsmount *, struct nfsclopen *, NFSPROC_T *); +int nfsrpc_doclose(struct nfsmount *, struct nfsclopen *, NFSPROC_T *, bool, + bool); int nfscl_deleg(mount_t, struct nfsclclient *, u_int8_t *, int, struct ucred *, NFSPROC_T *, struct nfscldeleg **); void nfscl_lockinit(struct nfsv4lock *); diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 6b6fdc03441f..fa0df1c37261 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -760,8 +760,9 @@ nfsrpc_close(vnode_t vp, int doclose, NFSPROC_T *p) /* * Close the open. */ -void -nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen *op, NFSPROC_T *p) +int +nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen *op, NFSPROC_T *p, + bool loop_on_delayed, bool freeop) { struct nfsrv_descript nfsd, *nd = &nfsd; struct nfscllockowner *lp, *nlp; @@ -840,7 +841,7 @@ nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen *op, NFSPROC_T *p) nfscl_lockexcl(&op->nfso_own->nfsow_rwlock, NFSCLSTATEMUTEXPTR); NFSUNLOCKCLSTATE(); do { - error = nfscl_tryclose(op, tcred, nmp, p, true); + error = nfscl_tryclose(op, tcred, nmp, p, loop_on_delayed); if (error == NFSERR_GRACE) (void) nfs_catnap(PZERO, error, "nfs_close"); } while (error == NFSERR_GRACE); @@ -849,9 +850,11 @@ nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen *op, NFSPROC_T *p) LIST_FOREACH_SAFE(lp, &op->nfso_lock, nfsl_list, nlp) nfscl_freelockowner(lp, 0); - nfscl_freeopen(op, 0, true); + if (freeop && error != NFSERR_DELAY) + nfscl_freeopen(op, 0, true); NFSUNLOCKCLSTATE(); NFSFREECRED(tcred); + return (error); } /* diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 7ad0f1c1a364..36f8bbd6b51f 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -3327,8 +3327,10 @@ int nfscl_doclose(vnode_t vp, struct nfsclclient **clpp, NFSPROC_T *p) { struct nfsclclient *clp; + struct nfsmount *nmp; struct nfsclowner *owp, *nowp; - struct nfsclopen *op; + struct nfsclopen *op, *nop; + struct nfsclopenhead delayed; struct nfscldeleg *dp; struct nfsfh *nfhp; struct nfsclrecalllayout *recallp; @@ -3339,6 +3341,7 @@ nfscl_doclose(vnode_t vp, struct nfsclclient **clpp, NFSPROC_T *p) return (error); *clpp = clp; + nmp = VFSTONFS(vp->v_mount); nfhp = VTONFS(vp)->n_fhp; recallp = malloc(sizeof(*recallp), M_NFSLAYRECALL, M_WAITOK); NFSLOCKCLSTATE(); @@ -3363,6 +3366,7 @@ nfscl_doclose(vnode_t vp, struct nfsclclient **clpp, NFSPROC_T *p) nfscl_retoncloselayout(vp, clp, nfhp->nfh_fh, nfhp->nfh_len, &recallp); /* Now process the opens against the server. */ + LIST_INIT(&delayed); lookformore: LIST_FOREACH(op, NFSCLOPENHASH(clp, nfhp->nfh_fh, nfhp->nfh_len), nfso_hash) { @@ -3376,8 +3380,16 @@ lookformore: op->nfso_opencnt)); #endif NFSUNLOCKCLSTATE(); - nfsrpc_doclose(VFSTONFS(vp->v_mount), op, p); + if (NFSHASNFSV4N(nmp)) + error = nfsrpc_doclose(nmp, op, p, false, true); + else + error = nfsrpc_doclose(nmp, op, p, true, true); NFSLOCKCLSTATE(); + if (error == NFSERR_DELAY) { + nfscl_unlinkopen(op); + op->nfso_own = NULL; + LIST_INSERT_HEAD(&delayed, op, nfso_list); + } goto lookformore; } } @@ -3388,6 +3400,13 @@ lookformore: * used by the function, but calling free() with a NULL pointer is ok. */ free(recallp, M_NFSLAYRECALL); + + /* Now, loop retrying the delayed closes. */ + LIST_FOREACH_SAFE(op, &delayed, nfso_list, nop) { + nfsrpc_doclose(nmp, op, p, true, false); + LIST_REMOVE(op, nfso_list); + nfscl_freeopen(op, 0, false); + } return (0); } From nobody Mon Oct 18 23:35:16 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6015818070A8; Mon, 18 Oct 2021 23:35: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 4HYCsc2Bhhz3Kbp; Mon, 18 Oct 2021 23:35: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 2C19D14F5; Mon, 18 Oct 2021 23:35: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 19INZGkH028731; Mon, 18 Oct 2021 23:35:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19INZGYA028730; Mon, 18 Oct 2021 23:35:16 GMT (envelope-from git) Date: Mon, 18 Oct 2021 23:35:16 GMT Message-Id: <202110182335.19INZGYA028730@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: 1a724aa97265 - main - Makefile.inc1: remove lorder from build/cross tools List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 1a724aa97265c9023d2aa69b444b46c4f7c5d9f2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1a724aa97265c9023d2aa69b444b46c4f7c5d9f2 commit 1a724aa97265c9023d2aa69b444b46c4f7c5d9f2 Author: Ed Maste AuthorDate: 2021-10-18 20:27:34 +0000 Commit: Ed Maste CommitDate: 2021-10-18 23:29:22 +0000 Makefile.inc1: remove lorder from build/cross tools As lorder is not used by the base system build there is no need to include it in bootstrap-tools or NXBDIRS. Fixes: 0e1e341b486c ("Stop using lorder and ranlib when...") Sponsored by: The FreeBSD Foundation --- Makefile.inc1 | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 86d2fe58a0d8..423bc00b3f29 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2500,7 +2500,6 @@ bootstrap-tools: ${_bt}-links .PHONY ${_cat} \ ${_kbdcontrol} \ ${_elftoolchain_libs} \ - usr.bin/lorder \ lib/libopenbsd \ usr.bin/mandoc \ usr.bin/rpcgen \ @@ -2732,7 +2731,6 @@ NXBDIRS+= \ usr.bin/id \ usr.bin/lex \ usr.bin/limits \ - usr.bin/lorder \ usr.bin/mandoc \ usr.bin/mktemp \ usr.bin/mt \ From nobody Tue Oct 19 04:41:08 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0A86017F6034; Tue, 19 Oct 2021 04:41: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 4HYLfX6s5Rz3Qfh; Tue, 19 Oct 2021 04:41: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 CB4805C33; Tue, 19 Oct 2021 04:41: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 19J4f8tf038012; Tue, 19 Oct 2021 04:41:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19J4f8pi038011; Tue, 19 Oct 2021 04:41:08 GMT (envelope-from git) Date: Tue, 19 Oct 2021 04:41:08 GMT Message-Id: <202110190441.19J4f8pi038011@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Guangyuan Yang Subject: git: bad324ace4f8 - main - devd(8): Note default config file search locations List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ygy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bad324ace4f817206baf86ae7379c35c8199048e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ygy (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=bad324ace4f817206baf86ae7379c35c8199048e commit bad324ace4f817206baf86ae7379c35c8199048e Author: Felix Johnson AuthorDate: 2021-10-19 04:37:40 +0000 Commit: Guangyuan Yang CommitDate: 2021-10-19 04:37:40 +0000 devd(8): Note default config file search locations PR: 197003 MFC after: 3 days Reported by: Harald Schmalzbauer --- sbin/devd/devd.8 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sbin/devd/devd.8 b/sbin/devd/devd.8 index fa05db734b88..77c8e4aac2fb 100644 --- a/sbin/devd/devd.8 +++ b/sbin/devd/devd.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 5, 2016 +.Dd October 19, 2021 .Dt DEVD 8 .Os .Sh NAME @@ -115,10 +115,16 @@ option and uses that file to drive the rest of the process. While the format of this file is described in .Xr devd.conf 5 , some basics are covered here. +.Pp In the .Ic options section, one can define multiple directories to search for config files. +The default config file specifies +.Pa /etc/devd +and +.Pa /usr/local/etc/devd +as directories to search. All files in these directories whose names match the pattern .Pa *.conf are parsed. From nobody Tue Oct 19 07:38:15 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4D4B317F08BD; Tue, 19 Oct 2021 07:38: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 4HYQZw1SpGz3DDY; Tue, 19 Oct 2021 07:38: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 1191310428; Tue, 19 Oct 2021 07:38: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 19J7cFIH067995; Tue, 19 Oct 2021 07:38:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19J7cFtw067994; Tue, 19 Oct 2021 07:38:15 GMT (envelope-from git) Date: Tue, 19 Oct 2021 07:38:15 GMT Message-Id: <202110190738.19J7cFtw067994@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: 225639e7db68 - main - vt: Disable bell by default List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 225639e7db685a4047e384abdbc296c0e02bd147 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=225639e7db685a4047e384abdbc296c0e02bd147 commit 225639e7db685a4047e384abdbc296c0e02bd147 Author: Emmanuel Vadot AuthorDate: 2021-10-18 08:16:41 +0000 Commit: Emmanuel Vadot CommitDate: 2021-10-19 07:37:28 +0000 vt: Disable bell by default Bell is either useless if you're working on remote servers or really annoying when you're working with a local machine that have a loud buzzer. Switch the default to have it disable. Reviewed by: imp, pstef, tsoome Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D32543 --- sys/dev/vt/vt_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index fac1ad898db9..075b23597f68 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -127,7 +127,7 @@ const struct terminal_class vt_termclass = { static SYSCTL_NODE(_kern, OID_AUTO, vt, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "vt(9) parameters"); static VT_SYSCTL_INT(enable_altgr, 1, "Enable AltGr key (Do not assume R.Alt as Alt)"); -static VT_SYSCTL_INT(enable_bell, 1, "Enable bell"); +static VT_SYSCTL_INT(enable_bell, 0, "Enable bell"); static VT_SYSCTL_INT(debug, 0, "vt(9) debug level"); static VT_SYSCTL_INT(deadtimer, 15, "Time to wait busy process in VT_PROCESS mode"); static VT_SYSCTL_INT(suspendswitch, 1, "Switch to VT0 before suspend"); From nobody Tue Oct 19 11:21:33 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3707918140BC; Tue, 19 Oct 2021 11:21:43 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HYWXk6snwz3Ltv; Tue, 19 Oct 2021 11:21:42 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1mcnBV-000K7D-1z; Tue, 19 Oct 2021 14:21:33 +0300 Date: Tue, 19 Oct 2021 14:21:33 +0300 From: Slawa Olhovchenkov To: Emmanuel Vadot Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: <20211019112132.GC80160@zxy.spb.ru> References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-Rspamd-Queue-Id: 4HYWXk6snwz3Ltv X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Tue, Oct 19, 2021 at 07:38:15AM +0000, Emmanuel Vadot wrote: > The branch main has been updated by manu: > > URL: https://cgit.FreeBSD.org/src/commit/?id=225639e7db685a4047e384abdbc296c0e02bd147 > > commit 225639e7db685a4047e384abdbc296c0e02bd147 > Author: Emmanuel Vadot > AuthorDate: 2021-10-18 08:16:41 +0000 > Commit: Emmanuel Vadot > CommitDate: 2021-10-19 07:37:28 +0000 > > vt: Disable bell by default > > Bell is either useless if you're working on remote servers or really annoying > when you're working with a local machine that have a loud buzzer. > Switch the default to have it disable. For you, not for me, for example. Also, this is violate POLA. From nobody Tue Oct 19 11:37:00 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0811617F130E; Tue, 19 Oct 2021 11:37:04 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mail.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HYWtR3bxkz3PvD; Tue, 19 Oct 2021 11:37:03 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1634643421; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hbUTVnIqweqxR9wR98qFMFOIYq4upR/vXIaNSZzQ2CI=; b=q+N1Wi3Av/BeRLdJN4dVkSGetUwnFRpwCd8xLhc+myR+sAP+ex+82tmk/V4tX/tcODZHUT 7iJfTTtVkCOOlsd/d+hWEo/AbGry1J7mFMT6icRt1LsabwDqrYeehcdcKsIiJjT2Q3kK4e xIDgIJMA7cSunhruwDviYr5I118z260= Received: from amy (lfbn-idf2-1-644-191.w86-247.abo.wanadoo.fr [86.247.100.191]) by mx.blih.net (OpenSMTPD) with ESMTPSA id dc38d4a5 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 19 Oct 2021 11:37:01 +0000 (UTC) Date: Tue, 19 Oct 2021 13:37:00 +0200 From: Emmanuel Vadot To: Slawa Olhovchenkov Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-Id: <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> In-Reply-To: <20211019112132.GC80160@zxy.spb.ru> References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HYWtR3bxkz3PvD X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Tue, 19 Oct 2021 14:21:33 +0300 Slawa Olhovchenkov wrote: > On Tue, Oct 19, 2021 at 07:38:15AM +0000, Emmanuel Vadot wrote: > > > The branch main has been updated by manu: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=225639e7db685a4047e384abdbc296c0e02bd147 > > > > commit 225639e7db685a4047e384abdbc296c0e02bd147 > > Author: Emmanuel Vadot > > AuthorDate: 2021-10-18 08:16:41 +0000 > > Commit: Emmanuel Vadot > > CommitDate: 2021-10-19 07:37:28 +0000 > > > > vt: Disable bell by default > > > > Bell is either useless if you're working on remote servers or really annoying > > when you're working with a local machine that have a loud buzzer. > > Switch the default to have it disable. > > For you, not for me, for example. Also, this is violate POLA. Just set kern.vt.enable_bell=1 in /etc/sysctl.conf and you will be happy again. I'll do some UPDATING note. And POLA doesn't means that we can't change a thing. -- Emmanuel Vadot From nobody Tue Oct 19 11:53:27 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6E03B17F9D86; Tue, 19 Oct 2021 11:53:44 +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 4HYXFh275Wz3kxZ; Tue, 19 Oct 2021 11:53:44 +0000 (UTC) (envelope-from hps@selasky.org) Received: from [10.36.2.165] (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 CBD58260258; Tue, 19 Oct 2021 13:53:41 +0200 (CEST) Message-ID: <4bc59b6c-e35e-3bca-a004-aa2f862f652e@selasky.org> Date: Tue, 19 Oct 2021 13:53:27 +0200 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Content-Language: en-US To: Emmanuel Vadot , Slawa Olhovchenkov Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> From: Hans Petter Selasky In-Reply-To: <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HYXFh275Wz3kxZ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N On 10/19/21 13:37, Emmanuel Vadot wrote: > Just set kern.vt.enable_bell=1 in /etc/sysctl.conf and you will be > happy again. I'll do some UPDATING note. > And POLA doesn't means that we can't change a thing. Is this option also RDTUN ? Can it be set in /boot/loader.conf too? --HPS From nobody Tue Oct 19 11:54:42 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 39BDF17FA3AB for ; Tue, 19 Oct 2021 11:54:50 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HYXGy0rs2z3ljs for ; Tue, 19 Oct 2021 11:54:50 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f51.google.com with SMTP id g2so11651191wme.4 for ; Tue, 19 Oct 2021 04:54:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ZoFvz5aff9MBY286iB2wbm1p4roBgPxylSwEUfFqVJQ=; b=jL9tnPTAafyQwgfGBa2W+q31jUzeCMuXlOv1A7L6Air6Ely+0PeBL3aUKCjVesko1x ONmWaMPo1KrQXipTjmRaQT0ZsDkjAcyn228c23+zgc3jYRVc+joR6fZyykQaVddda4za 91uNwTQl7bn+heOlhT2rB2ZxfELxkfOjUcKQMlqgB7LMJCj1E4vyu9xY2rrgMviUTVZZ 3J0cYV62zM82gwTRlbc5w2xOsQlhS0GxOwlukkpv49Fu6JRxggGnT97JRaf+H9Yc4hde mEmXB23PP3D+4AbneShLgZK3LWGy/CVCQy5SK1AVhB0U3SWxI9DzqqrbUQ4Irx6qVeQ7 ANgg== X-Gm-Message-State: AOAM530BTs97PGmKvbQ3+qmcB89udVvO2OSNsYBPK5kpQ+vFMermi+P9 Iyp/V83Y3YWBRigVAt4YS6BbRQ== X-Google-Smtp-Source: ABdhPJz7mi1Wd7fd2I4qkmJNbaig+2fgTS2+vrWSVOdCeCKlLV3BscejF8ReKhr2Qn9JJMaBY69XDw== X-Received: by 2002:a1c:7f56:: with SMTP id a83mr5787131wmd.20.1634644483414; Tue, 19 Oct 2021 04:54:43 -0700 (PDT) Received: from smtpclient.apple (global-5-141.nat-2.net.cam.ac.uk. [131.111.5.141]) by smtp.gmail.com with ESMTPSA id q12sm11444722wrp.13.2021.10.19.04.54.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Oct 2021 04:54:43 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default From: Jessica Clarke In-Reply-To: <4bc59b6c-e35e-3bca-a004-aa2f862f652e@selasky.org> Date: Tue, 19 Oct 2021 12:54:42 +0100 Cc: Emmanuel Vadot , Slawa Olhovchenkov , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <51B79717-E927-472A-86FC-A6293E28048D@freebsd.org> References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <4bc59b6c-e35e-3bca-a004-aa2f862f652e@selasky.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4HYXGy0rs2z3ljs X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 19 Oct 2021, at 12:53, Hans Petter Selasky wrote: >=20 > On 10/19/21 13:37, Emmanuel Vadot wrote: >> Just set kern.vt.enable_bell=3D1 in /etc/sysctl.conf and you will be >> happy again. I'll do some UPDATING note. >> And POLA doesn't means that we can't change a thing. >=20 > Is this option also RDTUN ? Can it be set in /boot/loader.conf too? It=E2=80=99s RWTUN. Jess From nobody Tue Oct 19 12:04:27 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9DBED17FD572; Tue, 19 Oct 2021 12:04: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 4HYXV33gJ8z3nYc; Tue, 19 Oct 2021 12:04: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 5D99213F8E; Tue, 19 Oct 2021 12:04: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 19JC4Rcv029674; Tue, 19 Oct 2021 12:04:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19JC4Ru4029673; Tue, 19 Oct 2021 12:04:27 GMT (envelope-from git) Date: Tue, 19 Oct 2021 12:04:27 GMT Message-Id: <202110191204.19JC4Ru4029673@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: bcd4c17ccaac - main - pf: fix some cc --analyze warnings List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: bcd4c17ccaacf995224882dc1d05e2a51867bdf2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=bcd4c17ccaacf995224882dc1d05e2a51867bdf2 commit bcd4c17ccaacf995224882dc1d05e2a51867bdf2 Author: Mateusz Guzik AuthorDate: 2021-10-19 11:57:47 +0000 Commit: Mateusz Guzik CommitDate: 2021-10-19 11:59:11 +0000 pf: fix some cc --analyze warnings Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/if_pfsync.c | 2 +- sys/netpfil/pf/pf_ioctl.c | 2 +- sys/netpfil/pf/pf_norm.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 7208444d65d7..e959fdbc8553 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -2474,7 +2474,7 @@ VNET_SYSINIT(vnet_pfsync_init, SI_SUB_PROTO_FIREWALL, SI_ORDER_ANY, static void vnet_pfsync_uninit(const void *unused __unused) { - int ret; + int ret __diagused; pfsync_pointers_uninit(); diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 89ab2b08c64a..ee265de65b45 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -5612,7 +5612,7 @@ hook_pf(void) { struct pfil_hook_args pha; struct pfil_link_args pla; - int ret; + int ret __diagused; if (V_pf_pfil_hooked) return; diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 796d445607e7..8e14fa35bf59 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -1002,7 +1002,7 @@ pf_refragment6(struct ifnet *ifp, struct mbuf **m0, struct m_tag *mtag) DPFPRINTF(("refragment error %d\n", error)); action = PF_DROP; } - for (t = m; m; m = t) { + for (; m; m = t) { t = m->m_nextpkt; m->m_nextpkt = NULL; m->m_flags |= M_SKIP_FIREWALL; From nobody Tue Oct 19 16:48:28 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 88B4C180A252; Tue, 19 Oct 2021 16:48: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 4HYfnm3L7lz4h3L; Tue, 19 Oct 2021 16:48: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 5269417B1A; Tue, 19 Oct 2021 16:48: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 19JGmSHL002764; Tue, 19 Oct 2021 16:48:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19JGmSOL002763; Tue, 19 Oct 2021 16:48:28 GMT (envelope-from git) Date: Tue, 19 Oct 2021 16:48:28 GMT Message-Id: <202110191648.19JGmSOL002763@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: 98e805b4a18d - main - loader: net_open() should not replace f->f_devdata List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 98e805b4a18d6ef4d3c9924166e1217e0430290d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=98e805b4a18d6ef4d3c9924166e1217e0430290d commit 98e805b4a18d6ef4d3c9924166e1217e0430290d Author: Toomas Soome AuthorDate: 2021-09-24 15:04:31 +0000 Commit: Toomas Soome CommitDate: 2021-10-19 16:43:56 +0000 loader: net_open() should not replace f->f_devdata net_open() does replace f_devdata with pointer to netdev_sock, this will cause memory leak when device is closed, but also does alter the devopen() logic. We should store &netdev_sock to dev->d_opendata instead, this would preserve and follow the devopen() logic. Fixes network boot on aarch64 (tested by bz). Reviewed-by: imp MFC After: 2 weeks Differential Revision: https://reviews.freebsd.org/D32227 --- stand/common/dev_net.c | 8 +++++--- stand/libsa/nfs.c | 4 +++- stand/libsa/tftp.c | 7 +++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/stand/common/dev_net.c b/stand/common/dev_net.c index db13e618e822..70b571047d56 100644 --- a/stand/common/dev_net.c +++ b/stand/common/dev_net.c @@ -114,7 +114,7 @@ net_init(void) /* * Called by devopen after it sets f->f_dev to our devsw entry. - * This opens the low-level device and sets f->f_devdata. + * This opens the low-level device and sets dev->d_opendata. * This is declared with variable arguments... */ static int @@ -193,20 +193,22 @@ net_open(struct open_file *f, ...) } netdev_opens++; - f->f_devdata = &netdev_sock; + dev->d_opendata = &netdev_sock; return (error); } static int net_close(struct open_file *f) { + struct devdesc *dev; #ifdef NETIF_DEBUG if (debug) printf("%s: opens=%d\n", __func__, netdev_opens); #endif - f->f_devdata = NULL; + dev = f->f_devdata; + dev->d_opendata = NULL; return (0); } diff --git a/stand/libsa/nfs.c b/stand/libsa/nfs.c index 084c7261f054..5757395caba2 100644 --- a/stand/libsa/nfs.c +++ b/stand/libsa/nfs.c @@ -464,6 +464,7 @@ nfs_readdata(struct nfs_iodesc *d, off_t off, void *addr, size_t len) int nfs_open(const char *upath, struct open_file *f) { + struct devdesc *dev; struct iodesc *desc; struct nfs_iodesc *currfd = NULL; char buf[2 * NFS_V3MAXFHSIZE + 3]; @@ -484,6 +485,7 @@ nfs_open(const char *upath, struct open_file *f) if (netproto != NET_NFS) return (EINVAL); + dev = f->f_devdata; #ifdef NFS_DEBUG if (debug) printf("nfs_open: %s (rootip=%s rootpath=%s)\n", upath, @@ -497,7 +499,7 @@ nfs_open(const char *upath, struct open_file *f) if (f->f_dev->dv_type != DEVT_NET) return (EINVAL); - if (!(desc = socktodesc(*(int *)(f->f_devdata)))) + if (!(desc = socktodesc(*(int *)(dev->d_opendata)))) return (EINVAL); /* Bind to a reserved port. */ diff --git a/stand/libsa/tftp.c b/stand/libsa/tftp.c index 22e03ab58da1..01f5753a2163 100644 --- a/stand/libsa/tftp.c +++ b/stand/libsa/tftp.c @@ -37,7 +37,8 @@ __FBSDID("$FreeBSD$"); /* * Simple TFTP implementation for libsa. * Assumes: - * - socket descriptor (int) at open_file->f_devdata + * - socket descriptor (int) at dev->d_opendata, dev stored at + * open_file->f_devdata * - server host IP in global rootip * Restrictions: * - read only @@ -432,6 +433,7 @@ tftp_getnextblock(struct tftp_handle *h) static int tftp_open(const char *path, struct open_file *f) { + struct devdesc *dev; struct tftp_handle *tftpfile; struct iodesc *io; int res; @@ -452,7 +454,8 @@ tftp_open(const char *path, struct open_file *f) return (ENOMEM); tftpfile->tftp_blksize = TFTP_REQUESTED_BLKSIZE; - tftpfile->iodesc = io = socktodesc(*(int *)(f->f_devdata)); + dev = f->f_devdata; + tftpfile->iodesc = io = socktodesc(*(int *)(dev->d_opendata)); if (io == NULL) { free(tftpfile); return (EINVAL); From nobody Tue Oct 19 16:51:53 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A0D49180ABF2; Tue, 19 Oct 2021 16:51: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 4HYfsj4Cxmz4hnm; Tue, 19 Oct 2021 16:51: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 724A017E00; Tue, 19 Oct 2021 16:51: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 19JGpr3A013723; Tue, 19 Oct 2021 16:51:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19JGprM4013722; Tue, 19 Oct 2021 16:51:53 GMT (envelope-from git) Date: Tue, 19 Oct 2021 16:51:53 GMT Message-Id: <202110191651.19JGprM4013722@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 32723a3ba961 - main - sockstat: make err(3) on jail errors more verbose. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 32723a3ba9611d7947ccf639fcdef5fa0b330571 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=32723a3ba9611d7947ccf639fcdef5fa0b330571 commit 32723a3ba9611d7947ccf639fcdef5fa0b330571 Author: Gleb Smirnoff AuthorDate: 2021-10-19 16:46:41 +0000 Commit: Gleb Smirnoff CommitDate: 2021-10-19 16:49:35 +0000 sockstat: make err(3) on jail errors more verbose. --- usr.bin/sockstat/sockstat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c index 5318a43f8585..d30f1cad0498 100644 --- a/usr.bin/sockstat/sockstat.c +++ b/usr.bin/sockstat/sockstat.c @@ -1352,7 +1352,7 @@ main(int argc, char *argv[]) case 'j': opt_j = jail_getid(optarg); if (opt_j < 0) - errx(1, "%s", jail_errmsg); + errx(1, "jail_getid: %s", jail_errmsg); break; case 'L': opt_L = 1; @@ -1403,7 +1403,7 @@ main(int argc, char *argv[]) if (opt_j > 0) { switch (jail_getvnet(opt_j)) { case -1: - errx(2, "%s", jail_errmsg); + errx(2, "jail_getvnet: %s", jail_errmsg); case JAIL_SYS_NEW: if (jail_attach(opt_j) < 0) err(3, "jail_attach()"); From nobody Tue Oct 19 16:51:54 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 57F4A180ACE9; Tue, 19 Oct 2021 16:51: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 4HYfsl0PMWz4hZG; Tue, 19 Oct 2021 16:51: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 A0CEA17936; Tue, 19 Oct 2021 16:51: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 19JGpsir013747; Tue, 19 Oct 2021 16:51:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19JGpskq013746; Tue, 19 Oct 2021 16:51:54 GMT (envelope-from git) Date: Tue, 19 Oct 2021 16:51:54 GMT Message-Id: <202110191651.19JGpskq013746@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 1fec1fa8146d - main - sockstat: don't query jail vnet if system is running without VIMAGE. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1fec1fa8146dc3b3244955afe337c4e9892ccb4b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=1fec1fa8146dc3b3244955afe337c4e9892ccb4b commit 1fec1fa8146dc3b3244955afe337c4e9892ccb4b Author: Gleb Smirnoff AuthorDate: 2021-10-19 16:47:54 +0000 Commit: Gleb Smirnoff CommitDate: 2021-10-19 16:49:35 +0000 sockstat: don't query jail vnet if system is running without VIMAGE. Fixes: f1cd4902bf17 --- usr.bin/sockstat/sockstat.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c index d30f1cad0498..d7fdb87b7490 100644 --- a/usr.bin/sockstat/sockstat.c +++ b/usr.bin/sockstat/sockstat.c @@ -1292,6 +1292,10 @@ jail_getvnet(int jid) { struct iovec jiov[6]; int vnet; + size_t len = sizeof(vnet); + + if (sysctlbyname("kern.features.vimage", &vnet, &len, NULL, 0) != 0) + return (0); vnet = -1; jiov[0].iov_base = __DECONST(char *, "jid"); From nobody Tue Oct 19 20:04:44 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 78E6817F5038; Tue, 19 Oct 2021 20:04: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 4HYl8D30pTz4bBD; Tue, 19 Oct 2021 20:04: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 486F51A4C6; Tue, 19 Oct 2021 20:04: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 19JK4iik069821; Tue, 19 Oct 2021 20:04:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19JK4iPw069820; Tue, 19 Oct 2021 20:04:44 GMT (envelope-from git) Date: Tue, 19 Oct 2021 20:04:44 GMT Message-Id: <202110192004.19JK4iPw069820@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: 31faa565edea - main - sys_procctl(2): remove sysproto and argused List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 31faa565edea908a8caf71cc6783066c02fd6844 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=31faa565edea908a8caf71cc6783066c02fd6844 commit 31faa565edea908a8caf71cc6783066c02fd6844 Author: Konstantin Belousov AuthorDate: 2021-10-15 18:55:53 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-19 20:04:33 +0000 sys_procctl(2): remove sysproto and argused Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32513 --- sys/kern/kern_procctl.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index 53626caa0fd9..eb36f0822938 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -656,15 +656,6 @@ wxmap_status(struct thread *td, struct proc *p, int *data) return (0); } -#ifndef _SYS_SYSPROTO_H_ -struct procctl_args { - idtype_t idtype; - id_t id; - int com; - void *data; -}; -#endif -/* ARGSUSED */ int sys_procctl(struct thread *td, struct procctl_args *uap) { From nobody Tue Oct 19 20:04:45 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1BBB517F5283; Tue, 19 Oct 2021 20:04:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HYl8F4J5gz4bSR; Tue, 19 Oct 2021 20:04: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 6361D1A447; Tue, 19 Oct 2021 20:04: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 19JK4jIO069845; Tue, 19 Oct 2021 20:04:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19JK4jN3069844; Tue, 19 Oct 2021 20:04:45 GMT (envelope-from git) Date: Tue, 19 Oct 2021 20:04:45 GMT Message-Id: <202110192004.19JK4jN3069844@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: 7ae879b14a20 - main - kern_procctl(): convert the function to be table-driven List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 7ae879b14a2086df521c59c4a379d3a072e08bc6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7ae879b14a2086df521c59c4a379d3a072e08bc6 commit 7ae879b14a2086df521c59c4a379d3a072e08bc6 Author: Konstantin Belousov AuthorDate: 2021-10-15 18:57:17 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-19 20:04:34 +0000 kern_procctl(): convert the function to be table-driven Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32513 --- sys/kern/kern_procctl.c | 123 +++++++++++++++++++++++++++--------------------- 1 file changed, 69 insertions(+), 54 deletions(-) diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index eb36f0822938..90c5e63c7219 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -656,6 +656,57 @@ wxmap_status(struct thread *td, struct proc *p, int *data) return (0); } +struct procctl_cmd_info { + int lock_tree; + bool one_proc : 1; +}; +static const struct procctl_cmd_info procctl_cmds_info[] = { + [PROC_SPROTECT] = + { .lock_tree = SA_SLOCKED, .one_proc = false, }, + [PROC_REAP_ACQUIRE] = + { .lock_tree = SA_XLOCKED, .one_proc = true, }, + [PROC_REAP_RELEASE] = + { .lock_tree = SA_XLOCKED, .one_proc = true, }, + [PROC_REAP_STATUS] = + { .lock_tree = SA_SLOCKED, .one_proc = true, }, + [PROC_REAP_GETPIDS] = + { .lock_tree = SA_SLOCKED, .one_proc = true, }, + [PROC_REAP_KILL] = + { .lock_tree = SA_SLOCKED, .one_proc = true, }, + [PROC_TRACE_CTL] = + { .lock_tree = SA_SLOCKED, .one_proc = false, }, + [PROC_TRACE_STATUS] = + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + [PROC_TRAPCAP_CTL] = + { .lock_tree = SA_SLOCKED, .one_proc = false, }, + [PROC_TRAPCAP_STATUS] = + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + [PROC_PDEATHSIG_CTL] = + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + [PROC_PDEATHSIG_STATUS] = + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + [PROC_ASLR_CTL] = + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + [PROC_ASLR_STATUS] = + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + [PROC_PROTMAX_CTL] = + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + [PROC_PROTMAX_STATUS] = + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + [PROC_STACKGAP_CTL] = + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + [PROC_STACKGAP_STATUS] = + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + [PROC_NO_NEW_PRIVS_CTL] = + { .lock_tree = SA_SLOCKED, .one_proc = true, }, + [PROC_NO_NEW_PRIVS_STATUS] = + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + [PROC_WXMAP_CTL] = + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + [PROC_WXMAP_STATUS] = + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, +}; + int sys_procctl(struct thread *td, struct procctl_args *uap) { @@ -812,33 +863,14 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id, int com, void *data) { struct pgrp *pg; struct proc *p; + const struct procctl_cmd_info *cmd_info; int error, first_error, ok; int signum; - bool tree_locked; - switch (com) { - case PROC_ASLR_CTL: - case PROC_ASLR_STATUS: - case PROC_PROTMAX_CTL: - case PROC_PROTMAX_STATUS: - case PROC_REAP_ACQUIRE: - case PROC_REAP_RELEASE: - case PROC_REAP_STATUS: - case PROC_REAP_GETPIDS: - case PROC_REAP_KILL: - case PROC_STACKGAP_CTL: - case PROC_STACKGAP_STATUS: - case PROC_TRACE_STATUS: - case PROC_TRAPCAP_STATUS: - case PROC_PDEATHSIG_CTL: - case PROC_PDEATHSIG_STATUS: - case PROC_NO_NEW_PRIVS_CTL: - case PROC_NO_NEW_PRIVS_STATUS: - case PROC_WXMAP_CTL: - case PROC_WXMAP_STATUS: - if (idtype != P_PID) - return (EINVAL); - } + MPASS(com > 0 && com < nitems(procctl_cmds_info)); + cmd_info = &procctl_cmds_info[com]; + if (idtype != P_PID && cmd_info->one_proc) + return (EINVAL); switch (com) { case PROC_PDEATHSIG_CTL: @@ -861,37 +893,13 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id, int com, void *data) return (0); } - switch (com) { - case PROC_SPROTECT: - case PROC_REAP_STATUS: - case PROC_REAP_GETPIDS: - case PROC_REAP_KILL: - case PROC_TRACE_CTL: - case PROC_TRAPCAP_CTL: - case PROC_NO_NEW_PRIVS_CTL: - sx_slock(&proctree_lock); - tree_locked = true; - break; - case PROC_REAP_ACQUIRE: - case PROC_REAP_RELEASE: + switch (cmd_info->lock_tree) { + case SA_XLOCKED: sx_xlock(&proctree_lock); - tree_locked = true; break; - case PROC_ASLR_CTL: - case PROC_ASLR_STATUS: - case PROC_PROTMAX_CTL: - case PROC_PROTMAX_STATUS: - case PROC_STACKGAP_CTL: - case PROC_STACKGAP_STATUS: - case PROC_TRACE_STATUS: - case PROC_TRAPCAP_STATUS: - case PROC_NO_NEW_PRIVS_STATUS: - case PROC_WXMAP_CTL: - case PROC_WXMAP_STATUS: - tree_locked = false; + case SA_SLOCKED: + sx_slock(&proctree_lock); break; - default: - return (EINVAL); } switch (idtype) { @@ -949,7 +957,14 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id, int com, void *data) error = EINVAL; break; } - if (tree_locked) - sx_unlock(&proctree_lock); + + switch (cmd_info->lock_tree) { + case SA_XLOCKED: + sx_xunlock(&proctree_lock); + break; + case SA_SLOCKED: + sx_sunlock(&proctree_lock); + break; + } return (error); } From nobody Tue Oct 19 20:04:46 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B03BE17F5063; Tue, 19 Oct 2021 20:04: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 4HYl8H09p6z4bNC; Tue, 19 Oct 2021 20:04:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89F851A2D8; Tue, 19 Oct 2021 20:04:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19JK4kV4069869; Tue, 19 Oct 2021 20:04:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19JK4kxU069868; Tue, 19 Oct 2021 20:04:46 GMT (envelope-from git) Date: Tue, 19 Oct 2021 20:04:46 GMT Message-Id: <202110192004.19JK4kxU069868@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: f833ab9dd187 - main - procctl(2): add consistent shortcut P_ID:0 as curproc List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: f833ab9dd187328306fa1601330fbc8332392abe Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f833ab9dd187328306fa1601330fbc8332392abe commit f833ab9dd187328306fa1601330fbc8332392abe Author: Konstantin Belousov AuthorDate: 2021-10-15 19:01:42 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-19 20:04:34 +0000 procctl(2): add consistent shortcut P_ID:0 as curproc Reported by: bdrewery, emaste Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32513 --- lib/libc/sys/procctl.2 | 2 ++ sys/kern/kern_procctl.c | 16 +++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/lib/libc/sys/procctl.2 b/lib/libc/sys/procctl.2 index 30933875ccbc..7412c2ee9d56 100644 --- a/lib/libc/sys/procctl.2 +++ b/lib/libc/sys/procctl.2 @@ -62,6 +62,8 @@ The following identifier types are supported: .It Dv P_PID Control the process with the process ID .Fa id . +.Fa id +zero is a shortcut for the calling process ID. .It Dv P_PGID Control processes belonging to the process group with the ID .Fa id . diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index 90c5e63c7219..613fabc4ca34 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -904,12 +904,18 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id, int com, void *data) switch (idtype) { case P_PID: - p = pfind(id); - if (p == NULL) { - error = ESRCH; - break; + if (id == 0) { + p = td->td_proc; + error = 0; + PROC_LOCK(p); + } else { + p = pfind(id); + if (p == NULL) { + error = ESRCH; + break; + } + error = p_cansee(td, p); } - error = p_cansee(td, p); if (error == 0) error = kern_procctl_single(td, p, com, data); PROC_UNLOCK(p); From nobody Tue Oct 19 20:04:47 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0FB7917F51EC; Tue, 19 Oct 2021 20:04: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 4HYl8H6hjkz4bF9; Tue, 19 Oct 2021 20:04: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 A628D1A2D9; Tue, 19 Oct 2021 20:04: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 19JK4lEe069893; Tue, 19 Oct 2021 20:04:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19JK4lJB069892; Tue, 19 Oct 2021 20:04:47 GMT (envelope-from git) Date: Tue, 19 Oct 2021 20:04:47 GMT Message-Id: <202110192004.19JK4lJB069892@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: 34f39a8c0e2a - main - procctl: convert PDEATHSIG_CTL/STATUS to regular kern_procctl_single() cases List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 34f39a8c0e2a4100837eb406ae24a7d6a357d696 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=34f39a8c0e2a4100837eb406ae24a7d6a357d696 commit 34f39a8c0e2a4100837eb406ae24a7d6a357d696 Author: Konstantin Belousov AuthorDate: 2021-10-15 19:06:22 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-19 20:04:34 +0000 procctl: convert PDEATHSIG_CTL/STATUS to regular kern_procctl_single() cases Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32513 --- sys/kern/kern_procctl.c | 114 +++++++++++++++++++++++++++++------------------- 1 file changed, 69 insertions(+), 45 deletions(-) diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index 613fabc4ca34..1e29429aacf2 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -656,55 +656,96 @@ wxmap_status(struct thread *td, struct proc *p, int *data) return (0); } +static int +pdeathsig_ctl(struct thread *td, struct proc *p, int data) +{ + if (p != td->td_proc || (data != 0 && !_SIG_VALID(data))) + return (EINVAL); + p->p_pdeathsig = data; + return (0); +} + +static int +pdeathsig_status(struct thread *td, struct proc *p, int *data) +{ + if (p != td->td_proc) + return (EINVAL); + *(int *)data = p->p_pdeathsig; + return (0); +} + struct procctl_cmd_info { int lock_tree; bool one_proc : 1; + bool esrch_is_einval : 1; }; static const struct procctl_cmd_info procctl_cmds_info[] = { [PROC_SPROTECT] = - { .lock_tree = SA_SLOCKED, .one_proc = false, }, + { .lock_tree = SA_SLOCKED, .one_proc = false, + .esrch_is_einval = false, }, [PROC_REAP_ACQUIRE] = - { .lock_tree = SA_XLOCKED, .one_proc = true, }, + { .lock_tree = SA_XLOCKED, .one_proc = true, + .esrch_is_einval = false, }, [PROC_REAP_RELEASE] = - { .lock_tree = SA_XLOCKED, .one_proc = true, }, + { .lock_tree = SA_XLOCKED, .one_proc = true, + .esrch_is_einval = false, }, [PROC_REAP_STATUS] = - { .lock_tree = SA_SLOCKED, .one_proc = true, }, + { .lock_tree = SA_SLOCKED, .one_proc = true, + .esrch_is_einval = false, }, [PROC_REAP_GETPIDS] = - { .lock_tree = SA_SLOCKED, .one_proc = true, }, + { .lock_tree = SA_SLOCKED, .one_proc = true, + .esrch_is_einval = false, }, [PROC_REAP_KILL] = - { .lock_tree = SA_SLOCKED, .one_proc = true, }, + { .lock_tree = SA_SLOCKED, .one_proc = true, + .esrch_is_einval = false, }, [PROC_TRACE_CTL] = - { .lock_tree = SA_SLOCKED, .one_proc = false, }, + { .lock_tree = SA_SLOCKED, .one_proc = false, + .esrch_is_einval = false, }, [PROC_TRACE_STATUS] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + { .lock_tree = SA_UNLOCKED, .one_proc = true, + .esrch_is_einval = false, }, [PROC_TRAPCAP_CTL] = - { .lock_tree = SA_SLOCKED, .one_proc = false, }, + { .lock_tree = SA_SLOCKED, .one_proc = false, + .esrch_is_einval = false, }, [PROC_TRAPCAP_STATUS] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + { .lock_tree = SA_UNLOCKED, .one_proc = true, + .esrch_is_einval = false, }, [PROC_PDEATHSIG_CTL] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + { .lock_tree = SA_UNLOCKED, .one_proc = true, + .esrch_is_einval = true, }, [PROC_PDEATHSIG_STATUS] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + { .lock_tree = SA_UNLOCKED, .one_proc = true, + .esrch_is_einval = true, }, [PROC_ASLR_CTL] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + { .lock_tree = SA_UNLOCKED, .one_proc = true, + .esrch_is_einval = false, }, [PROC_ASLR_STATUS] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + { .lock_tree = SA_UNLOCKED, .one_proc = true, + .esrch_is_einval = false, }, [PROC_PROTMAX_CTL] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + { .lock_tree = SA_UNLOCKED, .one_proc = true, + .esrch_is_einval = false, }, [PROC_PROTMAX_STATUS] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + { .lock_tree = SA_UNLOCKED, .one_proc = true, + .esrch_is_einval = false, }, [PROC_STACKGAP_CTL] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + { .lock_tree = SA_UNLOCKED, .one_proc = true, + .esrch_is_einval = false, }, [PROC_STACKGAP_STATUS] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + { .lock_tree = SA_UNLOCKED, .one_proc = true, + .esrch_is_einval = false, }, [PROC_NO_NEW_PRIVS_CTL] = - { .lock_tree = SA_SLOCKED, .one_proc = true, }, + { .lock_tree = SA_SLOCKED, .one_proc = true, + .esrch_is_einval = false, }, [PROC_NO_NEW_PRIVS_STATUS] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + { .lock_tree = SA_UNLOCKED, .one_proc = true, + .esrch_is_einval = false, }, [PROC_WXMAP_CTL] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + { .lock_tree = SA_UNLOCKED, .one_proc = true, + .esrch_is_einval = false, }, [PROC_WXMAP_STATUS] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, }, + { .lock_tree = SA_UNLOCKED, .one_proc = true, + .esrch_is_einval = false, }, }; int @@ -845,6 +886,10 @@ kern_procctl_single(struct thread *td, struct proc *p, int com, void *data) return (trapcap_ctl(td, p, *(int *)data)); case PROC_TRAPCAP_STATUS: return (trapcap_status(td, p, data)); + case PROC_PDEATHSIG_CTL: + return (pdeathsig_ctl(td, p, *(int *)data)); + case PROC_PDEATHSIG_STATUS: + return (pdeathsig_status(td, p, data)); case PROC_NO_NEW_PRIVS_CTL: return (no_new_privs_ctl(td, p, *(int *)data)); case PROC_NO_NEW_PRIVS_STATUS: @@ -865,34 +910,12 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id, int com, void *data) struct proc *p; const struct procctl_cmd_info *cmd_info; int error, first_error, ok; - int signum; MPASS(com > 0 && com < nitems(procctl_cmds_info)); cmd_info = &procctl_cmds_info[com]; if (idtype != P_PID && cmd_info->one_proc) return (EINVAL); - switch (com) { - case PROC_PDEATHSIG_CTL: - signum = *(int *)data; - p = td->td_proc; - if ((id != 0 && id != p->p_pid) || - (signum != 0 && !_SIG_VALID(signum))) - return (EINVAL); - PROC_LOCK(p); - p->p_pdeathsig = signum; - PROC_UNLOCK(p); - return (0); - case PROC_PDEATHSIG_STATUS: - p = td->td_proc; - if (id != 0 && id != p->p_pid) - return (EINVAL); - PROC_LOCK(p); - *(int *)data = p->p_pdeathsig; - PROC_UNLOCK(p); - return (0); - } - switch (cmd_info->lock_tree) { case SA_XLOCKED: sx_xlock(&proctree_lock); @@ -911,7 +934,8 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id, int com, void *data) } else { p = pfind(id); if (p == NULL) { - error = ESRCH; + error = cmd_info->esrch_is_einval ? + EINVAL : ESRCH; break; } error = p_cansee(td, p); From nobody Tue Oct 19 20:04:48 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 28F1417F51F3; Tue, 19 Oct 2021 20:04: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 4HYl8K2bLxz4bFG; Tue, 19 Oct 2021 20:04: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 B21971A34C; Tue, 19 Oct 2021 20:04: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 19JK4meR069921; Tue, 19 Oct 2021 20:04:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19JK4mQU069920; Tue, 19 Oct 2021 20:04:48 GMT (envelope-from git) Date: Tue, 19 Oct 2021 20:04:48 GMT Message-Id: <202110192004.19JK4mQU069920@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: 68dc5b381a29 - main - kern_procctl_single(): convert to use table data List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 68dc5b381a29aaa418064324519105a8c2a4a080 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=68dc5b381a29aaa418064324519105a8c2a4a080 commit 68dc5b381a29aaa418064324519105a8c2a4a080 Author: Konstantin Belousov AuthorDate: 2021-10-15 19:22:18 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-19 20:04:34 +0000 kern_procctl_single(): convert to use table data Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32513 --- sys/kern/kern_procctl.c | 220 +++++++++++++++++++++++++----------------------- 1 file changed, 114 insertions(+), 106 deletions(-) diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index 1e29429aacf2..06efcf0e8c74 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -102,10 +102,11 @@ protect_setchildren(struct thread *td, struct proc *top, int flags) } static int -protect_set(struct thread *td, struct proc *p, int flags) +protect_set(struct thread *td, struct proc *p, void *data) { - int error, ret; + int error, flags, ret; + flags = *(int *)data; switch (PPROT_OP(flags)) { case PPROT_SET: case PPROT_CLEAR: @@ -131,7 +132,7 @@ protect_set(struct thread *td, struct proc *p, int flags) } static int -reap_acquire(struct thread *td, struct proc *p) +reap_acquire(struct thread *td, struct proc *p, void *data __unused) { sx_assert(&proctree_lock, SX_XLOCKED); @@ -148,7 +149,7 @@ reap_acquire(struct thread *td, struct proc *p) } static int -reap_release(struct thread *td, struct proc *p) +reap_release(struct thread *td, struct proc *p, void *data __unused) { sx_assert(&proctree_lock, SX_XLOCKED); @@ -163,11 +164,12 @@ reap_release(struct thread *td, struct proc *p) } static int -reap_status(struct thread *td, struct proc *p, - struct procctl_reaper_status *rs) +reap_status(struct thread *td, struct proc *p, void *data) { struct proc *reap, *p2, *first_p; + struct procctl_reaper_status *rs; + rs = data; sx_assert(&proctree_lock, SX_LOCKED); bzero(rs, sizeof(*rs)); if ((p->p_treeflag & P_TREE_REAPER) == 0) { @@ -198,13 +200,15 @@ reap_status(struct thread *td, struct proc *p, } static int -reap_getpids(struct thread *td, struct proc *p, struct procctl_reaper_pids *rp) +reap_getpids(struct thread *td, struct proc *p, void *data) { struct proc *reap, *p2; struct procctl_reaper_pidinfo *pi, *pip; + struct procctl_reaper_pids *rp; u_int i, n; int error; + rp = data; sx_assert(&proctree_lock, SX_LOCKED); PROC_UNLOCK(p); reap = (p->p_treeflag & P_TREE_REAPER) == 0 ? p->p_reaper : p; @@ -276,14 +280,16 @@ reap_kill_sched(struct reap_kill_tracker_head *tracker, struct proc *p2) } static int -reap_kill(struct thread *td, struct proc *p, struct procctl_reaper_kill *rk) +reap_kill(struct thread *td, struct proc *p, void *data) { struct proc *reap, *p2; ksiginfo_t ksi; struct reap_kill_tracker_head tracker; struct reap_kill_tracker *t; + struct procctl_reaper_kill *rk; int error; + rk = data; sx_assert(&proctree_lock, SX_LOCKED); if (IN_CAPABILITY_MODE(td)) return (ECAPMODE); @@ -336,10 +342,12 @@ reap_kill(struct thread *td, struct proc *p, struct procctl_reaper_kill *rk) } static int -trace_ctl(struct thread *td, struct proc *p, int state) +trace_ctl(struct thread *td, struct proc *p, void *data) { + int state; PROC_LOCK_ASSERT(p, MA_OWNED); + state = *(int *)data; /* * Ktrace changes p_traceflag from or to zero under the @@ -376,26 +384,30 @@ trace_ctl(struct thread *td, struct proc *p, int state) } static int -trace_status(struct thread *td, struct proc *p, int *data) +trace_status(struct thread *td, struct proc *p, void *data) { + int *status; + status = data; if ((p->p_flag2 & P2_NOTRACE) != 0) { KASSERT((p->p_flag & P_TRACED) == 0, ("%d traced but tracing disabled", p->p_pid)); - *data = -1; + *status = -1; } else if ((p->p_flag & P_TRACED) != 0) { - *data = p->p_pptr->p_pid; + *status = p->p_pptr->p_pid; } else { - *data = 0; + *status = 0; } return (0); } static int -trapcap_ctl(struct thread *td, struct proc *p, int state) +trapcap_ctl(struct thread *td, struct proc *p, void *data) { + int state; PROC_LOCK_ASSERT(p, MA_OWNED); + state = *(int *)data; switch (state) { case PROC_TRAPCAP_CTL_ENABLE: @@ -411,19 +423,23 @@ trapcap_ctl(struct thread *td, struct proc *p, int state) } static int -trapcap_status(struct thread *td, struct proc *p, int *data) +trapcap_status(struct thread *td, struct proc *p, void *data) { + int *status; - *data = (p->p_flag2 & P2_TRAPCAP) != 0 ? PROC_TRAPCAP_CTL_ENABLE : + status = data; + *status = (p->p_flag2 & P2_TRAPCAP) != 0 ? PROC_TRAPCAP_CTL_ENABLE : PROC_TRAPCAP_CTL_DISABLE; return (0); } static int -no_new_privs_ctl(struct thread *td, struct proc *p, int state) +no_new_privs_ctl(struct thread *td, struct proc *p, void *data) { + int state; PROC_LOCK_ASSERT(p, MA_OWNED); + state = *(int *)data; if (state != PROC_NO_NEW_PRIVS_ENABLE) return (EINVAL); @@ -432,18 +448,21 @@ no_new_privs_ctl(struct thread *td, struct proc *p, int state) } static int -no_new_privs_status(struct thread *td, struct proc *p, int *data) +no_new_privs_status(struct thread *td, struct proc *p, void *data) { - *data = (p->p_flag2 & P2_NO_NEW_PRIVS) != 0 ? + *(int *)data = (p->p_flag2 & P2_NO_NEW_PRIVS) != 0 ? PROC_NO_NEW_PRIVS_ENABLE : PROC_NO_NEW_PRIVS_DISABLE; return (0); } static int -protmax_ctl(struct thread *td, struct proc *p, int state) +protmax_ctl(struct thread *td, struct proc *p, void *data) { + int state; + PROC_LOCK_ASSERT(p, MA_OWNED); + state = *(int *)data; switch (state) { case PROC_PROTMAX_FORCE_ENABLE: @@ -464,7 +483,7 @@ protmax_ctl(struct thread *td, struct proc *p, int state) } static int -protmax_status(struct thread *td, struct proc *p, int *data) +protmax_status(struct thread *td, struct proc *p, void *data) { int d; @@ -481,15 +500,17 @@ protmax_status(struct thread *td, struct proc *p, int *data) } if (kern_mmap_maxprot(p, PROT_READ) == PROT_READ) d |= PROC_PROTMAX_ACTIVE; - *data = d; + *(int *)data = d; return (0); } static int -aslr_ctl(struct thread *td, struct proc *p, int state) +aslr_ctl(struct thread *td, struct proc *p, void *data) { + int state; PROC_LOCK_ASSERT(p, MA_OWNED); + state = *(int *)data; switch (state) { case PROC_ASLR_FORCE_ENABLE: @@ -510,7 +531,7 @@ aslr_ctl(struct thread *td, struct proc *p, int state) } static int -aslr_status(struct thread *td, struct proc *p, int *data) +aslr_status(struct thread *td, struct proc *p, void *data) { struct vmspace *vm; int d; @@ -538,14 +559,17 @@ aslr_status(struct thread *td, struct proc *p, int *data) PROC_LOCK(p); _PRELE(p); } - *data = d; + *(int *)data = d; return (0); } static int -stackgap_ctl(struct thread *td, struct proc *p, int state) +stackgap_ctl(struct thread *td, struct proc *p, void *data) { + int state; + PROC_LOCK_ASSERT(p, MA_OWNED); + state = *(int *)data; if ((state & ~(PROC_STACKGAP_ENABLE | PROC_STACKGAP_DISABLE | PROC_STACKGAP_ENABLE_EXEC | PROC_STACKGAP_DISABLE_EXEC)) != 0) @@ -580,26 +604,31 @@ stackgap_ctl(struct thread *td, struct proc *p, int state) } static int -stackgap_status(struct thread *td, struct proc *p, int *data) +stackgap_status(struct thread *td, struct proc *p, void *data) { + int d; + PROC_LOCK_ASSERT(p, MA_OWNED); - *data = (p->p_flag2 & P2_STKGAP_DISABLE) != 0 ? PROC_STACKGAP_DISABLE : + d = (p->p_flag2 & P2_STKGAP_DISABLE) != 0 ? PROC_STACKGAP_DISABLE : PROC_STACKGAP_ENABLE; - *data |= (p->p_flag2 & P2_STKGAP_DISABLE_EXEC) != 0 ? + d |= (p->p_flag2 & P2_STKGAP_DISABLE_EXEC) != 0 ? PROC_STACKGAP_DISABLE_EXEC : PROC_STACKGAP_ENABLE_EXEC; + *(int *)data = d; return (0); } static int -wxmap_ctl(struct thread *td, struct proc *p, int state) +wxmap_ctl(struct thread *td, struct proc *p, void *data) { struct vmspace *vm; vm_map_t map; + int state; PROC_LOCK_ASSERT(p, MA_OWNED); if ((p->p_flag & P_WEXIT) != 0) return (ESRCH); + state = *(int *)data; switch (state) { case PROC_WX_MAPPINGS_PERMIT: @@ -628,7 +657,7 @@ wxmap_ctl(struct thread *td, struct proc *p, int state) } static int -wxmap_status(struct thread *td, struct proc *p, int *data) +wxmap_status(struct thread *td, struct proc *p, void *data) { struct vmspace *vm; int d; @@ -652,21 +681,24 @@ wxmap_status(struct thread *td, struct proc *p, int *data) } PROC_LOCK(p); _PRELE(p); - *data = d; + *(int *)data = d; return (0); } static int -pdeathsig_ctl(struct thread *td, struct proc *p, int data) +pdeathsig_ctl(struct thread *td, struct proc *p, void *data) { - if (p != td->td_proc || (data != 0 && !_SIG_VALID(data))) + int signum; + + signum = *(int *)data; + if (p != td->td_proc || (signum != 0 && !_SIG_VALID(signum))) return (EINVAL); - p->p_pdeathsig = data; + p->p_pdeathsig = signum; return (0); } static int -pdeathsig_status(struct thread *td, struct proc *p, int *data) +pdeathsig_status(struct thread *td, struct proc *p, void *data) { if (p != td->td_proc) return (EINVAL); @@ -678,74 +710,97 @@ struct procctl_cmd_info { int lock_tree; bool one_proc : 1; bool esrch_is_einval : 1; + int (*exec)(struct thread *, struct proc *, void *); }; static const struct procctl_cmd_info procctl_cmds_info[] = { [PROC_SPROTECT] = { .lock_tree = SA_SLOCKED, .one_proc = false, - .esrch_is_einval = false, }, + .esrch_is_einval = false, + .exec = protect_set, }, [PROC_REAP_ACQUIRE] = { .lock_tree = SA_XLOCKED, .one_proc = true, - .esrch_is_einval = false, }, + .esrch_is_einval = false, + .exec = reap_acquire, }, [PROC_REAP_RELEASE] = { .lock_tree = SA_XLOCKED, .one_proc = true, - .esrch_is_einval = false, }, + .esrch_is_einval = false, + .exec = reap_release, }, [PROC_REAP_STATUS] = { .lock_tree = SA_SLOCKED, .one_proc = true, - .esrch_is_einval = false, }, + .esrch_is_einval = false, + .exec = reap_status, }, [PROC_REAP_GETPIDS] = { .lock_tree = SA_SLOCKED, .one_proc = true, - .esrch_is_einval = false, }, + .esrch_is_einval = false, + .exec = reap_getpids, }, [PROC_REAP_KILL] = { .lock_tree = SA_SLOCKED, .one_proc = true, - .esrch_is_einval = false, }, + .esrch_is_einval = false, + .exec = reap_kill, }, [PROC_TRACE_CTL] = { .lock_tree = SA_SLOCKED, .one_proc = false, - .esrch_is_einval = false, }, + .esrch_is_einval = false, + .exec = trace_ctl, }, [PROC_TRACE_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = false, }, + .esrch_is_einval = false, + .exec = trace_status, }, [PROC_TRAPCAP_CTL] = { .lock_tree = SA_SLOCKED, .one_proc = false, - .esrch_is_einval = false, }, + .esrch_is_einval = false, + .exec = trapcap_ctl, }, [PROC_TRAPCAP_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = false, }, + .esrch_is_einval = false, + .exec = trapcap_status, }, [PROC_PDEATHSIG_CTL] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = true, }, + .esrch_is_einval = true, + .exec = pdeathsig_ctl, }, [PROC_PDEATHSIG_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = true, }, + .esrch_is_einval = true, + .exec = pdeathsig_status, }, [PROC_ASLR_CTL] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = false, }, + .esrch_is_einval = false, + .exec = aslr_ctl, }, [PROC_ASLR_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = false, }, + .esrch_is_einval = false, + .exec = aslr_status, }, [PROC_PROTMAX_CTL] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = false, }, + .esrch_is_einval = false, + .exec = protmax_ctl, }, [PROC_PROTMAX_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = false, }, + .esrch_is_einval = false, + .exec = protmax_status, }, [PROC_STACKGAP_CTL] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = false, }, + .esrch_is_einval = false, + .exec = stackgap_ctl, }, [PROC_STACKGAP_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = false, }, + .esrch_is_einval = false, + .exec = stackgap_status, }, [PROC_NO_NEW_PRIVS_CTL] = { .lock_tree = SA_SLOCKED, .one_proc = true, - .esrch_is_einval = false, }, + .esrch_is_einval = false, + .exec = no_new_privs_ctl, }, [PROC_NO_NEW_PRIVS_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = false, }, + .esrch_is_einval = false, + .exec = no_new_privs_status, }, [PROC_WXMAP_CTL] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = false, }, + .esrch_is_einval = false, + .exec = wxmap_ctl, }, [PROC_WXMAP_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = false, }, + .esrch_is_einval = false, + .exec = wxmap_status, }, }; int @@ -853,54 +908,7 @@ kern_procctl_single(struct thread *td, struct proc *p, int com, void *data) { PROC_LOCK_ASSERT(p, MA_OWNED); - switch (com) { - case PROC_ASLR_CTL: - return (aslr_ctl(td, p, *(int *)data)); - case PROC_ASLR_STATUS: - return (aslr_status(td, p, data)); - case PROC_SPROTECT: - return (protect_set(td, p, *(int *)data)); - case PROC_PROTMAX_CTL: - return (protmax_ctl(td, p, *(int *)data)); - case PROC_PROTMAX_STATUS: - return (protmax_status(td, p, data)); - case PROC_STACKGAP_CTL: - return (stackgap_ctl(td, p, *(int *)data)); - case PROC_STACKGAP_STATUS: - return (stackgap_status(td, p, data)); - case PROC_REAP_ACQUIRE: - return (reap_acquire(td, p)); - case PROC_REAP_RELEASE: - return (reap_release(td, p)); - case PROC_REAP_STATUS: - return (reap_status(td, p, data)); - case PROC_REAP_GETPIDS: - return (reap_getpids(td, p, data)); - case PROC_REAP_KILL: - return (reap_kill(td, p, data)); - case PROC_TRACE_CTL: - return (trace_ctl(td, p, *(int *)data)); - case PROC_TRACE_STATUS: - return (trace_status(td, p, data)); - case PROC_TRAPCAP_CTL: - return (trapcap_ctl(td, p, *(int *)data)); - case PROC_TRAPCAP_STATUS: - return (trapcap_status(td, p, data)); - case PROC_PDEATHSIG_CTL: - return (pdeathsig_ctl(td, p, *(int *)data)); - case PROC_PDEATHSIG_STATUS: - return (pdeathsig_status(td, p, data)); - case PROC_NO_NEW_PRIVS_CTL: - return (no_new_privs_ctl(td, p, *(int *)data)); - case PROC_NO_NEW_PRIVS_STATUS: - return (no_new_privs_status(td, p, data)); - case PROC_WXMAP_CTL: - return (wxmap_ctl(td, p, *(int *)data)); - case PROC_WXMAP_STATUS: - return (wxmap_status(td, p, data)); - default: - return (EINVAL); - } + return (procctl_cmds_info[com].exec(td, p, data)); } int From nobody Tue Oct 19 20:04:49 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C241A17F550F; Tue, 19 Oct 2021 20:04: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 4HYl8L5lRBz4bHs; Tue, 19 Oct 2021 20:04: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 DB32F1A4C7; Tue, 19 Oct 2021 20:04: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 19JK4nEP069948; Tue, 19 Oct 2021 20:04:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19JK4nBJ069947; Tue, 19 Oct 2021 20:04:49 GMT (envelope-from git) Date: Tue, 19 Oct 2021 20:04:49 GMT Message-Id: <202110192004.19JK4nBJ069947@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: 56d5323b4d7d - main - sys_procctl(): use table data to do copyin/copyout List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 56d5323b4d7d9ccbe1ca3e620400afd165519a12 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=56d5323b4d7d9ccbe1ca3e620400afd165519a12 commit 56d5323b4d7d9ccbe1ca3e620400afd165519a12 Author: Konstantin Belousov AuthorDate: 2021-10-15 19:56:12 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-19 20:04:34 +0000 sys_procctl(): use table data to do copyin/copyout Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32513 --- sys/kern/kern_procctl.c | 210 ++++++++++++++++++++---------------------------- 1 file changed, 88 insertions(+), 122 deletions(-) diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index 06efcf0e8c74..7a88ef24d987 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -710,195 +710,161 @@ struct procctl_cmd_info { int lock_tree; bool one_proc : 1; bool esrch_is_einval : 1; + bool copyout_on_error : 1; + bool no_nonnull_data : 1; + int copyin_sz; + int copyout_sz; int (*exec)(struct thread *, struct proc *, void *); }; static const struct procctl_cmd_info procctl_cmds_info[] = { [PROC_SPROTECT] = { .lock_tree = SA_SLOCKED, .one_proc = false, - .esrch_is_einval = false, - .exec = protect_set, }, + .esrch_is_einval = false, .no_nonnull_data = false, + .copyin_sz = sizeof(int), .copyout_sz = 0, + .exec = protect_set, .copyout_on_error = false, }, [PROC_REAP_ACQUIRE] = { .lock_tree = SA_XLOCKED, .one_proc = true, - .esrch_is_einval = false, - .exec = reap_acquire, }, + .esrch_is_einval = false, .no_nonnull_data = true, + .copyin_sz = 0, .copyout_sz = 0, + .exec = reap_acquire, .copyout_on_error = false, }, [PROC_REAP_RELEASE] = { .lock_tree = SA_XLOCKED, .one_proc = true, - .esrch_is_einval = false, - .exec = reap_release, }, + .esrch_is_einval = false, .no_nonnull_data = true, + .copyin_sz = 0, .copyout_sz = 0, + .exec = reap_release, .copyout_on_error = false, }, [PROC_REAP_STATUS] = { .lock_tree = SA_SLOCKED, .one_proc = true, - .esrch_is_einval = false, - .exec = reap_status, }, + .esrch_is_einval = false, .no_nonnull_data = false, + .copyin_sz = 0, + .copyout_sz = sizeof(struct procctl_reaper_status), + .exec = reap_status, .copyout_on_error = false, }, [PROC_REAP_GETPIDS] = { .lock_tree = SA_SLOCKED, .one_proc = true, - .esrch_is_einval = false, - .exec = reap_getpids, }, + .esrch_is_einval = false, .no_nonnull_data = false, + .copyin_sz = sizeof(struct procctl_reaper_pids), + .copyout_sz = 0, + .exec = reap_getpids, .copyout_on_error = false, }, [PROC_REAP_KILL] = { .lock_tree = SA_SLOCKED, .one_proc = true, - .esrch_is_einval = false, - .exec = reap_kill, }, + .esrch_is_einval = false, .no_nonnull_data = false, + .copyin_sz = sizeof(struct procctl_reaper_kill), + .copyout_sz = sizeof(struct procctl_reaper_kill), + .exec = reap_kill, .copyout_on_error = true, }, [PROC_TRACE_CTL] = { .lock_tree = SA_SLOCKED, .one_proc = false, - .esrch_is_einval = false, - .exec = trace_ctl, }, + .esrch_is_einval = false, .no_nonnull_data = false, + .copyin_sz = sizeof(int), .copyout_sz = 0, + .exec = trace_ctl, .copyout_on_error = false, }, [PROC_TRACE_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = false, - .exec = trace_status, }, + .esrch_is_einval = false, .no_nonnull_data = false, + .copyin_sz = 0, .copyout_sz = sizeof(int), + .exec = trace_status, .copyout_on_error = false, }, [PROC_TRAPCAP_CTL] = { .lock_tree = SA_SLOCKED, .one_proc = false, - .esrch_is_einval = false, - .exec = trapcap_ctl, }, + .esrch_is_einval = false, .no_nonnull_data = false, + .copyin_sz = sizeof(int), .copyout_sz = 0, + .exec = trapcap_ctl, .copyout_on_error = false, }, [PROC_TRAPCAP_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = false, - .exec = trapcap_status, }, + .esrch_is_einval = false, .no_nonnull_data = false, + .copyin_sz = 0, .copyout_sz = sizeof(int), + .exec = trapcap_status, .copyout_on_error = false, }, [PROC_PDEATHSIG_CTL] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = true, - .exec = pdeathsig_ctl, }, + .esrch_is_einval = true, .no_nonnull_data = false, + .copyin_sz = sizeof(int), .copyout_sz = 0, + .exec = pdeathsig_ctl, .copyout_on_error = false, }, [PROC_PDEATHSIG_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = true, - .exec = pdeathsig_status, }, + .esrch_is_einval = true, .no_nonnull_data = false, + .copyin_sz = 0, .copyout_sz = sizeof(int), + .exec = pdeathsig_status, .copyout_on_error = false, }, [PROC_ASLR_CTL] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = false, - .exec = aslr_ctl, }, + .esrch_is_einval = false, .no_nonnull_data = false, + .copyin_sz = sizeof(int), .copyout_sz = 0, + .exec = aslr_ctl, .copyout_on_error = false, }, [PROC_ASLR_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = false, - .exec = aslr_status, }, + .esrch_is_einval = false, .no_nonnull_data = false, + .copyin_sz = 0, .copyout_sz = sizeof(int), + .exec = aslr_status, .copyout_on_error = false, }, [PROC_PROTMAX_CTL] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = false, - .exec = protmax_ctl, }, + .esrch_is_einval = false, .no_nonnull_data = false, + .copyin_sz = sizeof(int), .copyout_sz = 0, + .exec = protmax_ctl, .copyout_on_error = false, }, [PROC_PROTMAX_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = false, - .exec = protmax_status, }, + .esrch_is_einval = false, .no_nonnull_data = false, + .copyin_sz = 0, .copyout_sz = sizeof(int), + .exec = protmax_status, .copyout_on_error = false, }, [PROC_STACKGAP_CTL] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = false, - .exec = stackgap_ctl, }, + .esrch_is_einval = false, .no_nonnull_data = false, + .copyin_sz = sizeof(int), .copyout_sz = 0, + .exec = stackgap_ctl, .copyout_on_error = false, }, [PROC_STACKGAP_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = false, - .exec = stackgap_status, }, + .esrch_is_einval = false, .no_nonnull_data = false, + .copyin_sz = 0, .copyout_sz = sizeof(int), + .exec = stackgap_status, .copyout_on_error = false, }, [PROC_NO_NEW_PRIVS_CTL] = { .lock_tree = SA_SLOCKED, .one_proc = true, - .esrch_is_einval = false, - .exec = no_new_privs_ctl, }, + .esrch_is_einval = false, .no_nonnull_data = false, + .copyin_sz = sizeof(int), .copyout_sz = 0, + .exec = no_new_privs_ctl, .copyout_on_error = false, }, [PROC_NO_NEW_PRIVS_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = false, - .exec = no_new_privs_status, }, + .esrch_is_einval = false, .no_nonnull_data = false, + .copyin_sz = 0, .copyout_sz = sizeof(int), + .exec = no_new_privs_status, .copyout_on_error = false, }, [PROC_WXMAP_CTL] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = false, - .exec = wxmap_ctl, }, + .esrch_is_einval = false, .no_nonnull_data = false, + .copyin_sz = sizeof(int), .copyout_sz = 0, + .exec = wxmap_ctl, .copyout_on_error = false, }, [PROC_WXMAP_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, - .esrch_is_einval = false, - .exec = wxmap_status, }, + .esrch_is_einval = false, .no_nonnull_data = false, + .copyin_sz = 0, .copyout_sz = sizeof(int), + .exec = wxmap_status, .copyout_on_error = false, }, }; int sys_procctl(struct thread *td, struct procctl_args *uap) { - void *data; union { struct procctl_reaper_status rs; struct procctl_reaper_pids rp; struct procctl_reaper_kill rk; + int flags; } x; - int error, error1, flags, signum; + const struct procctl_cmd_info *cmd_info; + int error, error1; if (uap->com >= PROC_PROCCTL_MD_MIN) return (cpu_procctl(td, uap->idtype, uap->id, uap->com, uap->data)); - - switch (uap->com) { - case PROC_ASLR_CTL: - case PROC_PROTMAX_CTL: - case PROC_SPROTECT: - case PROC_STACKGAP_CTL: - case PROC_TRACE_CTL: - case PROC_TRAPCAP_CTL: - case PROC_NO_NEW_PRIVS_CTL: - case PROC_WXMAP_CTL: - error = copyin(uap->data, &flags, sizeof(flags)); - if (error != 0) - return (error); - data = &flags; - break; - case PROC_REAP_ACQUIRE: - case PROC_REAP_RELEASE: - if (uap->data != NULL) - return (EINVAL); - data = NULL; - break; - case PROC_REAP_STATUS: - data = &x.rs; - break; - case PROC_REAP_GETPIDS: - error = copyin(uap->data, &x.rp, sizeof(x.rp)); - if (error != 0) - return (error); - data = &x.rp; - break; - case PROC_REAP_KILL: - error = copyin(uap->data, &x.rk, sizeof(x.rk)); - if (error != 0) - return (error); - data = &x.rk; - break; - case PROC_ASLR_STATUS: - case PROC_PROTMAX_STATUS: - case PROC_STACKGAP_STATUS: - case PROC_TRACE_STATUS: - case PROC_TRAPCAP_STATUS: - case PROC_NO_NEW_PRIVS_STATUS: - case PROC_WXMAP_STATUS: - data = &flags; - break; - case PROC_PDEATHSIG_CTL: - error = copyin(uap->data, &signum, sizeof(signum)); + if (uap->com == 0 || uap->com >= nitems(procctl_cmds_info)) + return (EINVAL); + cmd_info = &procctl_cmds_info[uap->com]; + if (cmd_info->copyin_sz > 0) { + error = copyin(uap->data, &x, cmd_info->copyin_sz); if (error != 0) return (error); - data = &signum; - break; - case PROC_PDEATHSIG_STATUS: - data = &signum; - break; - default: + } else if (cmd_info->no_nonnull_data && uap->data != NULL) { return (EINVAL); } - error = kern_procctl(td, uap->idtype, uap->id, uap->com, data); - switch (uap->com) { - case PROC_REAP_STATUS: - if (error == 0) - error = copyout(&x.rs, uap->data, sizeof(x.rs)); - break; - case PROC_REAP_KILL: - error1 = copyout(&x.rk, uap->data, sizeof(x.rk)); + + error = kern_procctl(td, uap->idtype, uap->id, uap->com, &x); + + if (cmd_info->copyout_sz > 0 && (error == 0 || + cmd_info->copyout_on_error)) { + error1 = copyout(&x, uap->data, cmd_info->copyout_sz); if (error == 0) error = error1; - break; - case PROC_ASLR_STATUS: - case PROC_PROTMAX_STATUS: - case PROC_STACKGAP_STATUS: - case PROC_TRACE_STATUS: - case PROC_TRAPCAP_STATUS: - case PROC_NO_NEW_PRIVS_STATUS: - case PROC_WXMAP_STATUS: - if (error == 0) - error = copyout(&flags, uap->data, sizeof(flags)); - break; - case PROC_PDEATHSIG_STATUS: - if (error == 0) - error = copyout(&signum, uap->data, sizeof(signum)); - break; } return (error); } From nobody Tue Oct 19 20:04:50 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E47B117F53DF; Tue, 19 Oct 2021 20:04: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 4HYl8N29Fgz4bTB; Tue, 19 Oct 2021 20:04: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 081FD1A4C8; Tue, 19 Oct 2021 20:04: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 19JK4oWn069974; Tue, 19 Oct 2021 20:04:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19JK4oOt069973; Tue, 19 Oct 2021 20:04:50 GMT (envelope-from git) Date: Tue, 19 Oct 2021 20:04:50 GMT Message-Id: <202110192004.19JK4oOt069973@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: 32026f5983ed - main - sys_procctl(): zero the data buffer once, on syscall entry List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 32026f5983ed00e64829f8c20b09748077809729 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=32026f5983ed00e64829f8c20b09748077809729 commit 32026f5983ed00e64829f8c20b09748077809729 Author: Konstantin Belousov AuthorDate: 2021-10-16 18:28:03 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-19 20:04:34 +0000 sys_procctl(): zero the data buffer once, on syscall entry and remove zeroing of it from specific functions. This way it is guaranteed that we do not leak kernel data. Suggested by: markj Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32513 --- sys/kern/kern_procctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index 7a88ef24d987..387706a0cb1e 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -171,7 +171,6 @@ reap_status(struct thread *td, struct proc *p, void *data) rs = data; sx_assert(&proctree_lock, SX_LOCKED); - bzero(rs, sizeof(*rs)); if ((p->p_treeflag & P_TREE_REAPER) == 0) { reap = p->p_reaper; } else { @@ -850,6 +849,8 @@ sys_procctl(struct thread *td, struct procctl_args *uap) if (uap->com == 0 || uap->com >= nitems(procctl_cmds_info)) return (EINVAL); cmd_info = &procctl_cmds_info[uap->com]; + bzero(&x, sizeof(x)); + if (cmd_info->copyin_sz > 0) { error = copyin(uap->data, &x, cmd_info->copyin_sz); if (error != 0) From nobody Tue Oct 19 20:04:52 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AB64617F54CC; Tue, 19 Oct 2021 20:04: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 4HYl8P3vqPz4bNY; Tue, 19 Oct 2021 20:04: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 2538F1A0C1; Tue, 19 Oct 2021 20:04: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 19JK4quQ070007; Tue, 19 Oct 2021 20:04:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19JK4qEa070006; Tue, 19 Oct 2021 20:04:52 GMT (envelope-from git) Date: Tue, 19 Oct 2021 20:04:52 GMT Message-Id: <202110192004.19JK4qEa070006@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: 1c4dbee5dd22 - main - procctl: make it possible to specify that some operations require debug privilege over the target List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 1c4dbee5dd224c08241c0922ff577bb226171e81 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1c4dbee5dd224c08241c0922ff577bb226171e81 commit 1c4dbee5dd224c08241c0922ff577bb226171e81 Author: Konstantin Belousov AuthorDate: 2021-10-15 20:02:06 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-19 20:04:34 +0000 procctl: make it possible to specify that some operations require debug privilege over the target Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32513 --- sys/kern/kern_procctl.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index 387706a0cb1e..6229d2140228 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -711,6 +711,7 @@ struct procctl_cmd_info { bool esrch_is_einval : 1; bool copyout_on_error : 1; bool no_nonnull_data : 1; + bool need_candebug : 1; int copyin_sz; int copyout_sz; int (*exec)(struct thread *, struct proc *, void *); @@ -719,114 +720,136 @@ static const struct procctl_cmd_info procctl_cmds_info[] = { [PROC_SPROTECT] = { .lock_tree = SA_SLOCKED, .one_proc = false, .esrch_is_einval = false, .no_nonnull_data = false, + .need_candebug = false, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = protect_set, .copyout_on_error = false, }, [PROC_REAP_ACQUIRE] = { .lock_tree = SA_XLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = true, + .need_candebug = false, .copyin_sz = 0, .copyout_sz = 0, .exec = reap_acquire, .copyout_on_error = false, }, [PROC_REAP_RELEASE] = { .lock_tree = SA_XLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = true, + .need_candebug = false, .copyin_sz = 0, .copyout_sz = 0, .exec = reap_release, .copyout_on_error = false, }, [PROC_REAP_STATUS] = { .lock_tree = SA_SLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, + .need_candebug = false, .copyin_sz = 0, .copyout_sz = sizeof(struct procctl_reaper_status), .exec = reap_status, .copyout_on_error = false, }, [PROC_REAP_GETPIDS] = { .lock_tree = SA_SLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, + .need_candebug = false, .copyin_sz = sizeof(struct procctl_reaper_pids), .copyout_sz = 0, .exec = reap_getpids, .copyout_on_error = false, }, [PROC_REAP_KILL] = { .lock_tree = SA_SLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, + .need_candebug = false, .copyin_sz = sizeof(struct procctl_reaper_kill), .copyout_sz = sizeof(struct procctl_reaper_kill), .exec = reap_kill, .copyout_on_error = true, }, [PROC_TRACE_CTL] = { .lock_tree = SA_SLOCKED, .one_proc = false, .esrch_is_einval = false, .no_nonnull_data = false, + .need_candebug = false, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = trace_ctl, .copyout_on_error = false, }, [PROC_TRACE_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, + .need_candebug = false, .copyin_sz = 0, .copyout_sz = sizeof(int), .exec = trace_status, .copyout_on_error = false, }, [PROC_TRAPCAP_CTL] = { .lock_tree = SA_SLOCKED, .one_proc = false, .esrch_is_einval = false, .no_nonnull_data = false, + .need_candebug = false, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = trapcap_ctl, .copyout_on_error = false, }, [PROC_TRAPCAP_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, + .need_candebug = false, .copyin_sz = 0, .copyout_sz = sizeof(int), .exec = trapcap_status, .copyout_on_error = false, }, [PROC_PDEATHSIG_CTL] = { .lock_tree = SA_UNLOCKED, .one_proc = true, .esrch_is_einval = true, .no_nonnull_data = false, + .need_candebug = false, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = pdeathsig_ctl, .copyout_on_error = false, }, [PROC_PDEATHSIG_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, .esrch_is_einval = true, .no_nonnull_data = false, + .need_candebug = false, .copyin_sz = 0, .copyout_sz = sizeof(int), .exec = pdeathsig_status, .copyout_on_error = false, }, [PROC_ASLR_CTL] = { .lock_tree = SA_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, + .need_candebug = false, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = aslr_ctl, .copyout_on_error = false, }, [PROC_ASLR_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, + .need_candebug = false, .copyin_sz = 0, .copyout_sz = sizeof(int), .exec = aslr_status, .copyout_on_error = false, }, [PROC_PROTMAX_CTL] = { .lock_tree = SA_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, + .need_candebug = false, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = protmax_ctl, .copyout_on_error = false, }, [PROC_PROTMAX_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, + .need_candebug = false, .copyin_sz = 0, .copyout_sz = sizeof(int), .exec = protmax_status, .copyout_on_error = false, }, [PROC_STACKGAP_CTL] = { .lock_tree = SA_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, + .need_candebug = false, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = stackgap_ctl, .copyout_on_error = false, }, [PROC_STACKGAP_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, + .need_candebug = false, .copyin_sz = 0, .copyout_sz = sizeof(int), .exec = stackgap_status, .copyout_on_error = false, }, [PROC_NO_NEW_PRIVS_CTL] = { .lock_tree = SA_SLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, + .need_candebug = false, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = no_new_privs_ctl, .copyout_on_error = false, }, [PROC_NO_NEW_PRIVS_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, + .need_candebug = false, .copyin_sz = 0, .copyout_sz = sizeof(int), .exec = no_new_privs_status, .copyout_on_error = false, }, [PROC_WXMAP_CTL] = { .lock_tree = SA_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, + .need_candebug = false, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = wxmap_ctl, .copyout_on_error = false, }, [PROC_WXMAP_STATUS] = { .lock_tree = SA_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, + .need_candebug = false, .copyin_sz = 0, .copyout_sz = sizeof(int), .exec = wxmap_status, .copyout_on_error = false, }, }; @@ -913,7 +936,8 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id, int com, void *data) EINVAL : ESRCH; break; } - error = p_cansee(td, p); + error = cmd_info->need_candebug ? p_candebug(td, p) : + p_cansee(td, p); } if (error == 0) error = kern_procctl_single(td, p, com, data); @@ -936,7 +960,8 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id, int com, void *data) first_error = 0; LIST_FOREACH(p, &pg->pg_members, p_pglist) { PROC_LOCK(p); - if (p->p_state == PRS_NEW || p_cansee(td, p) != 0) { + if (p->p_state == PRS_NEW || (cmd_info->need_candebug ? + p_candebug(td, p) : p_cansee(td, p)) != 0) { PROC_UNLOCK(p); continue; } From nobody Tue Oct 19 20:04:53 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 26F4017F5535; Tue, 19 Oct 2021 20:04: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 4HYl8Q4MHvz4bNb; Tue, 19 Oct 2021 20:04: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 3D8731A2DA; Tue, 19 Oct 2021 20:04: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 19JK4rRl070031; Tue, 19 Oct 2021 20:04:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19JK4roM070030; Tue, 19 Oct 2021 20:04:53 GMT (envelope-from git) Date: Tue, 19 Oct 2021 20:04:53 GMT Message-Id: <202110192004.19JK4roM070030@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: f5bb6e5a6d48 - main - procctl: actually require debug privileges over target List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: f5bb6e5a6d488740e451ad4acd82a70b95e786cd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f5bb6e5a6d488740e451ad4acd82a70b95e786cd commit f5bb6e5a6d488740e451ad4acd82a70b95e786cd Author: Konstantin Belousov AuthorDate: 2021-10-15 20:09:39 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-19 20:04:34 +0000 procctl: actually require debug privileges over target for state control over TRACE, TRAPCAP, ASLR, PROTMAX, STACKGAP, NO_NEWPRIVS, and WXMAP. Reported by: emaste Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32513 --- lib/libc/sys/procctl.2 | 8 ++++++++ sys/kern/kern_procctl.c | 14 +++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/libc/sys/procctl.2 b/lib/libc/sys/procctl.2 index 7412c2ee9d56..97509d0fbf06 100644 --- a/lib/libc/sys/procctl.2 +++ b/lib/libc/sys/procctl.2 @@ -72,6 +72,14 @@ Control processes belonging to the process group with the ID The control request to perform is specified by the .Fa cmd argument. +.Pp +All status changing requests +.Dv *_CTL +require the caller to have the right to debug the target. +All status query requests +.DV *_STATUS +require the caller to have the right to observe the target. +.Pp The following commands are supported: .Bl -tag -width PROC_TRAPCAP_STATUS .It Dv PROC_ASLR_CTL diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index 6229d2140228..c3f078f96e80 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -759,7 +759,7 @@ static const struct procctl_cmd_info procctl_cmds_info[] = { [PROC_TRACE_CTL] = { .lock_tree = SA_SLOCKED, .one_proc = false, .esrch_is_einval = false, .no_nonnull_data = false, - .need_candebug = false, + .need_candebug = true, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = trace_ctl, .copyout_on_error = false, }, [PROC_TRACE_STATUS] = @@ -771,7 +771,7 @@ static const struct procctl_cmd_info procctl_cmds_info[] = { [PROC_TRAPCAP_CTL] = { .lock_tree = SA_SLOCKED, .one_proc = false, .esrch_is_einval = false, .no_nonnull_data = false, - .need_candebug = false, + .need_candebug = true, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = trapcap_ctl, .copyout_on_error = false, }, [PROC_TRAPCAP_STATUS] = @@ -795,7 +795,7 @@ static const struct procctl_cmd_info procctl_cmds_info[] = { [PROC_ASLR_CTL] = { .lock_tree = SA_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, - .need_candebug = false, + .need_candebug = true, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = aslr_ctl, .copyout_on_error = false, }, [PROC_ASLR_STATUS] = @@ -807,7 +807,7 @@ static const struct procctl_cmd_info procctl_cmds_info[] = { [PROC_PROTMAX_CTL] = { .lock_tree = SA_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, - .need_candebug = false, + .need_candebug = true, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = protmax_ctl, .copyout_on_error = false, }, [PROC_PROTMAX_STATUS] = @@ -819,7 +819,7 @@ static const struct procctl_cmd_info procctl_cmds_info[] = { [PROC_STACKGAP_CTL] = { .lock_tree = SA_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, - .need_candebug = false, + .need_candebug = true, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = stackgap_ctl, .copyout_on_error = false, }, [PROC_STACKGAP_STATUS] = @@ -831,7 +831,7 @@ static const struct procctl_cmd_info procctl_cmds_info[] = { [PROC_NO_NEW_PRIVS_CTL] = { .lock_tree = SA_SLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, - .need_candebug = false, + .need_candebug = true, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = no_new_privs_ctl, .copyout_on_error = false, }, [PROC_NO_NEW_PRIVS_STATUS] = @@ -843,7 +843,7 @@ static const struct procctl_cmd_info procctl_cmds_info[] = { [PROC_WXMAP_CTL] = { .lock_tree = SA_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, - .need_candebug = false, + .need_candebug = true, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = wxmap_ctl, .copyout_on_error = false, }, [PROC_WXMAP_STATUS] = From nobody Tue Oct 19 20:04:54 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AC5A617F564C; Tue, 19 Oct 2021 20:04: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 4HYl8S28Fsz4bFv; Tue, 19 Oct 2021 20:04: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 68A601A619; Tue, 19 Oct 2021 20:04: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 19JK4shi070055; Tue, 19 Oct 2021 20:04:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19JK4sgC070054; Tue, 19 Oct 2021 20:04:54 GMT (envelope-from git) Date: Tue, 19 Oct 2021 20:04:54 GMT Message-Id: <202110192004.19JK4sgC070054@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: 3692877a6cf8 - main - kern_procctl.c: use td->td_proc instead of curproc List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 3692877a6cf8fc374349f3d9b2cbb190fec484a0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3692877a6cf8fc374349f3d9b2cbb190fec484a0 commit 3692877a6cf8fc374349f3d9b2cbb190fec484a0 Author: Konstantin Belousov AuthorDate: 2021-10-18 21:07:25 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-19 20:04:34 +0000 kern_procctl.c: use td->td_proc instead of curproc Suggested by: markj Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32513 --- sys/kern/kern_procctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index c3f078f96e80..890a2e05bb27 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -136,7 +136,7 @@ reap_acquire(struct thread *td, struct proc *p, void *data __unused) { sx_assert(&proctree_lock, SX_XLOCKED); - if (p != curproc) + if (p != td->td_proc) return (EPERM); if ((p->p_treeflag & P_TREE_REAPER) != 0) return (EBUSY); @@ -153,7 +153,7 @@ reap_release(struct thread *td, struct proc *p, void *data __unused) { sx_assert(&proctree_lock, SX_XLOCKED); - if (p != curproc) + if (p != td->td_proc) return (EPERM); if (p == initproc) return (EINVAL); From nobody Tue Oct 19 20:04:55 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8925017F56D4; Tue, 19 Oct 2021 20:04: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 4HYl8T5DRKz4bRC; Tue, 19 Oct 2021 20:04: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 7D5C91A4C9; Tue, 19 Oct 2021 20:04: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 19JK4taU070085; Tue, 19 Oct 2021 20:04:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19JK4thx070084; Tue, 19 Oct 2021 20:04:55 GMT (envelope-from git) Date: Tue, 19 Oct 2021 20:04:55 GMT Message-Id: <202110192004.19JK4thx070084@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: 49db81aa053b - main - kern_procctl: skip zombies for process group operations List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 49db81aa053beb131ba9dbf5519a5f0eacf28265 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=49db81aa053beb131ba9dbf5519a5f0eacf28265 commit 49db81aa053beb131ba9dbf5519a5f0eacf28265 Author: Konstantin Belousov AuthorDate: 2021-10-18 21:29:01 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-19 20:04:34 +0000 kern_procctl: skip zombies for process group operations When iterating over the process group members, skip zombies same as it is done by pfind() for single-process operation. Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32513 --- sys/kern/kern_procctl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index 890a2e05bb27..00c68359f375 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -960,8 +960,10 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id, int com, void *data) first_error = 0; LIST_FOREACH(p, &pg->pg_members, p_pglist) { PROC_LOCK(p); - if (p->p_state == PRS_NEW || (cmd_info->need_candebug ? - p_candebug(td, p) : p_cansee(td, p)) != 0) { + if (p->p_state == PRS_NEW || + p->p_state == PRS_ZOMBIE || + (cmd_info->need_candebug ? p_candebug(td, p) : + p_cansee(td, p)) != 0) { PROC_UNLOCK(p); continue; } From nobody Tue Oct 19 20:35:13 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BBF9018066E9; Tue, 19 Oct 2021 20:35:22 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (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 4HYlqZ4Jjxz4qgJ; Tue, 19 Oct 2021 20:35:22 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTP id cmw0m9mfqczbLcvpMmsRma; Tue, 19 Oct 2021 20:35:16 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id cvpKmIiiDa8XRcvpLmrMdE; Tue, 19 Oct 2021 20:35:16 +0000 X-Authority-Analysis: v=2.4 cv=Ov8sdwzt c=1 sm=1 tr=0 ts=616f2c04 a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=8gfv0ekSlNoA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=hKvH7l_OExtEQXvJCF4A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 90EB2590; Tue, 19 Oct 2021 13:35:13 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 19JKZDqM026085; Tue, 19 Oct 2021 13:35:13 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202110192035.19JKZDqM026085@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: Konstantin Belousov cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 7ae879b14a20 - main - kern_procctl(): convert the function to be table-driven In-reply-to: <202110192004.19JK4jN3069844@gitrepo.freebsd.org> References: <202110192004.19JK4jN3069844@gitrepo.freebsd.org> Comments: In-reply-to Konstantin Belousov message dated "Tue, 19 Oct 2021 20:04:45 +0000." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 19 Oct 2021 13:35:13 -0700 X-CMAE-Envelope: MS4xfAy3Wl8Knz7fpbJbwbPhs97kltqAw7sLhEHxv+Igmu1XiqOph3mdIFT/4u6WbX06/hIWu0Vy+TTnQVF0FSiYlVGr0+t3LmdHgCAHe70XrvRFU8GH8OqV 7xfbuvBK2nKIf8u0JkcWKpDnUF5k3V98PijcmkMQpGicvdfssgXa50kVKmjrKgULiAY4kdUH4ZF39L6dpxkJiDHirXVfNfEtAo2zpEOhAZpPq4P7ZV641UxZ KY0vJj1YTzz0FXjLfj0odTY/fQGrd1mTJJSRku4HUfoziEepwoGvSyDtoRrABbYT151a41lJitDbsssIjwObJ0wF7UMA13/bQLYTcXFma3Y= X-Rspamd-Queue-Id: 4HYlqZ4Jjxz4qgJ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N In message <202110192004.19JK4jN3069844@gitrepo.freebsd.org>, Konstantin Belous ov writes: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=7ae879b14a2086df521c59c4a379d3a0 > 72e08bc6 > > commit 7ae879b14a2086df521c59c4a379d3a072e08bc6 > Author: Konstantin Belousov > AuthorDate: 2021-10-15 18:57:17 +0000 > Commit: Konstantin Belousov > CommitDate: 2021-10-19 20:04:34 +0000 > > kern_procctl(): convert the function to be table-driven > > Reviewed by: emaste, markj > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D32513 > --- > sys/kern/kern_procctl.c | 123 +++++++++++++++++++++++++++------------------- > -- > 1 file changed, 69 insertions(+), 54 deletions(-) > > diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c > index eb36f0822938..90c5e63c7219 100644 > --- a/sys/kern/kern_procctl.c > +++ b/sys/kern/kern_procctl.c > @@ -656,6 +656,57 @@ wxmap_status(struct thread *td, struct proc *p, int *dat > a) > return (0); > } > > +struct procctl_cmd_info { > + int lock_tree; > + bool one_proc : 1; > +}; > +static const struct procctl_cmd_info procctl_cmds_info[] = { > + [PROC_SPROTECT] = > + { .lock_tree = SA_SLOCKED, .one_proc = false, }, > + [PROC_REAP_ACQUIRE] = > + { .lock_tree = SA_XLOCKED, .one_proc = true, }, > + [PROC_REAP_RELEASE] = > + { .lock_tree = SA_XLOCKED, .one_proc = true, }, > + [PROC_REAP_STATUS] = > + { .lock_tree = SA_SLOCKED, .one_proc = true, }, > + [PROC_REAP_GETPIDS] = > + { .lock_tree = SA_SLOCKED, .one_proc = true, }, > + [PROC_REAP_KILL] = > + { .lock_tree = SA_SLOCKED, .one_proc = true, }, > + [PROC_TRACE_CTL] = > + { .lock_tree = SA_SLOCKED, .one_proc = false, }, > + [PROC_TRACE_STATUS] = > + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, > + [PROC_TRAPCAP_CTL] = > + { .lock_tree = SA_SLOCKED, .one_proc = false, }, > + [PROC_TRAPCAP_STATUS] = > + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, > + [PROC_PDEATHSIG_CTL] = > + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, > + [PROC_PDEATHSIG_STATUS] = > + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, > + [PROC_ASLR_CTL] = > + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, > + [PROC_ASLR_STATUS] = > + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, > + [PROC_PROTMAX_CTL] = > + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, > + [PROC_PROTMAX_STATUS] = > + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, > + [PROC_STACKGAP_CTL] = > + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, > + [PROC_STACKGAP_STATUS] = > + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, > + [PROC_NO_NEW_PRIVS_CTL] = > + { .lock_tree = SA_SLOCKED, .one_proc = true, }, > + [PROC_NO_NEW_PRIVS_STATUS] = > + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, > + [PROC_WXMAP_CTL] = > + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, > + [PROC_WXMAP_STATUS] = > + { .lock_tree = SA_UNLOCKED, .one_proc = true, }, > +}; > + > int > sys_procctl(struct thread *td, struct procctl_args *uap) > { > @@ -812,33 +863,14 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t i > d, int com, void *data) > { > struct pgrp *pg; > struct proc *p; > + const struct procctl_cmd_info *cmd_info; > int error, first_error, ok; > int signum; > - bool tree_locked; > > - switch (com) { > - case PROC_ASLR_CTL: > - case PROC_ASLR_STATUS: > - case PROC_PROTMAX_CTL: > - case PROC_PROTMAX_STATUS: > - case PROC_REAP_ACQUIRE: > - case PROC_REAP_RELEASE: > - case PROC_REAP_STATUS: > - case PROC_REAP_GETPIDS: > - case PROC_REAP_KILL: > - case PROC_STACKGAP_CTL: > - case PROC_STACKGAP_STATUS: > - case PROC_TRACE_STATUS: > - case PROC_TRAPCAP_STATUS: > - case PROC_PDEATHSIG_CTL: > - case PROC_PDEATHSIG_STATUS: > - case PROC_NO_NEW_PRIVS_CTL: > - case PROC_NO_NEW_PRIVS_STATUS: > - case PROC_WXMAP_CTL: > - case PROC_WXMAP_STATUS: > - if (idtype != P_PID) > - return (EINVAL); > - } > + MPASS(com > 0 && com < nitems(procctl_cmds_info)); > + cmd_info = &procctl_cmds_info[com]; > + if (idtype != P_PID && cmd_info->one_proc) > + return (EINVAL); > > switch (com) { > case PROC_PDEATHSIG_CTL: > @@ -861,37 +893,13 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t i > d, int com, void *data) > return (0); > } > > - switch (com) { > - case PROC_SPROTECT: > - case PROC_REAP_STATUS: > - case PROC_REAP_GETPIDS: > - case PROC_REAP_KILL: > - case PROC_TRACE_CTL: > - case PROC_TRAPCAP_CTL: > - case PROC_NO_NEW_PRIVS_CTL: > - sx_slock(&proctree_lock); > - tree_locked = true; > - break; > - case PROC_REAP_ACQUIRE: > - case PROC_REAP_RELEASE: > + switch (cmd_info->lock_tree) { > + case SA_XLOCKED: > sx_xlock(&proctree_lock); > - tree_locked = true; > break; > - case PROC_ASLR_CTL: > - case PROC_ASLR_STATUS: > - case PROC_PROTMAX_CTL: > - case PROC_PROTMAX_STATUS: > - case PROC_STACKGAP_CTL: > - case PROC_STACKGAP_STATUS: > - case PROC_TRACE_STATUS: > - case PROC_TRAPCAP_STATUS: > - case PROC_NO_NEW_PRIVS_STATUS: > - case PROC_WXMAP_CTL: > - case PROC_WXMAP_STATUS: > - tree_locked = false; > + case SA_SLOCKED: > + sx_slock(&proctree_lock); > break; > - default: > - return (EINVAL); > } > > switch (idtype) { > @@ -949,7 +957,14 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id > , int com, void *data) > error = EINVAL; > break; > } > - if (tree_locked) > - sx_unlock(&proctree_lock); > + > + switch (cmd_info->lock_tree) { > + case SA_XLOCKED: > + sx_xunlock(&proctree_lock); > + break; > + case SA_SLOCKED: > + sx_sunlock(&proctree_lock); > + break; > + } > return (error); > } > Should SA_* in fact be LA_*? SA_* in sys/sx.h assumes INVARIANTS whereas LA_* in sys/lock.h has no such requirement. -- 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 nobody Tue Oct 19 20:40:26 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5F16218099EA; Tue, 19 Oct 2021 20:40:28 +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 4HYlxS2GJPz4s82; Tue, 19 Oct 2021 20:40:28 +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 A152F1706; Tue, 19 Oct 2021 20:40:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: 7ae879b14a20 - main - kern_procctl(): convert the function to be table-driven To: Cy Schubert , Konstantin Belousov Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202110192004.19JK4jN3069844@gitrepo.freebsd.org> <202110192035.19JKZDqM026085@slippy.cwsent.com> From: John Baldwin Message-ID: <91ebf9d8-5547-8570-18cb-26a58baf89ba@FreeBSD.org> Date: Tue, 19 Oct 2021 13:40:26 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 In-Reply-To: <202110192035.19JKZDqM026085@slippy.cwsent.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 10/19/21 1:35 PM, Cy Schubert wrote: > In message <202110192004.19JK4jN3069844@gitrepo.freebsd.org>, Konstantin > Belous > ov writes: >> The branch main has been updated by kib: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=7ae879b14a2086df521c59c4a379d3a0 >> 72e08bc6 >> >> commit 7ae879b14a2086df521c59c4a379d3a072e08bc6 >> Author: Konstantin Belousov >> AuthorDate: 2021-10-15 18:57:17 +0000 >> Commit: Konstantin Belousov >> CommitDate: 2021-10-19 20:04:34 +0000 >> >> kern_procctl(): convert the function to be table-driven >> >> Reviewed by: emaste, markj >> Sponsored by: The FreeBSD Foundation >> MFC after: 1 week >> Differential revision: https://reviews.freebsd.org/D32513 >> --- >> sys/kern/kern_procctl.c | 123 +++++++++++++++++++++++++++------------------- >> -- >> 1 file changed, 69 insertions(+), 54 deletions(-) >> >> diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c >> index eb36f0822938..90c5e63c7219 100644 >> --- a/sys/kern/kern_procctl.c >> +++ b/sys/kern/kern_procctl.c >> @@ -949,7 +957,14 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id >> , int com, void *data) >> error = EINVAL; >> break; >> } >> - if (tree_locked) >> - sx_unlock(&proctree_lock); >> + >> + switch (cmd_info->lock_tree) { >> + case SA_XLOCKED: >> + sx_xunlock(&proctree_lock); >> + break; >> + case SA_SLOCKED: >> + sx_sunlock(&proctree_lock); >> + break; >> + } >> return (error); >> } >> > > Should SA_* in fact be LA_*? SA_* in sys/sx.h assumes INVARIANTS whereas > LA_* in sys/lock.h has no such requirement. Both are for "assertions". The LA_* constants aren't really public but are the values used for witness_assert() that various foo_assert() routines in locking APIs (mtx_assert/sx_assert, etc.) can use. For locking APIs, the type-specific macros are the ones you use, e.g. SA_* with sx_assert(). Given that, SA_* is the closest match here. -- John Baldwin From nobody Tue Oct 19 20:51:31 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 83485180CA1D; Tue, 19 Oct 2021 20:51:38 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (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 4HYmBL2Ybzz4v5W; Tue, 19 Oct 2021 20:51:38 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTP id clgLmlwDpps7Pcw5BmMq4Z; Tue, 19 Oct 2021 20:51:37 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id cw59m5oJeXoZRcw5BmaK1Y; Tue, 19 Oct 2021 20:51:37 +0000 X-Authority-Analysis: v=2.4 cv=R8NgpfdX c=1 sm=1 tr=0 ts=616f2fd9 a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=8gfv0ekSlNoA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=uYMzMxvLi9Vu3-3Hz7EA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 7AC98554; Tue, 19 Oct 2021 13:51:34 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 19JKpV66059807; Tue, 19 Oct 2021 13:51:32 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202110192051.19JKpV66059807@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: John Baldwin cc: Cy Schubert , Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 7ae879b14a20 - main - kern_procctl(): convert the function to be table-driven In-reply-to: <91ebf9d8-5547-8570-18cb-26a58baf89ba@FreeBSD.org> References: <202110192004.19JK4jN3069844@gitrepo.freebsd.org> <202110192035.19JKZDqM026085@slippy.cwsent.com> <91ebf9d8-5547-8570-18cb-26a58baf89ba@FreeBSD.org> Comments: In-reply-to John Baldwin message dated "Tue, 19 Oct 2021 13:40:26 -0700." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 19 Oct 2021 13:51:31 -0700 X-CMAE-Envelope: MS4xfD0v5VugFG5qoKsPUtWx7tgCnj25LKn6HpsVyJb3mr+GIzTM0F4zbWln5yFv7soVDEFJRz0dE9j6if2UtEiHWOw0gGVbCxpdY1df7ShGde97tAvg8Apz Xx0Z8xF3GCNJO6iCziJpkm90i0qutlDtHVvD0NYb7hBy8QpA0+jqAQwX4VPGPUDeI1Nmw5Wp2MSs5B3K5RCR0tTCpS7plDCub4jVavoCoshzRvhozmlvRSGK 5Ik9Y1VTUwjwf2rOMsK+zBOCnHRGZcd3t0V08ye72HckePIsHVMI/i92RkrY0GtOXxwzzlavhQ34wPw4te/yNYa3uom3AQKVAhxqQ5kSF62ZOdZh2e0grRxV veU12rrZ X-Rspamd-Queue-Id: 4HYmBL2Ybzz4v5W X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N In message <91ebf9d8-5547-8570-18cb-26a58baf89ba@FreeBSD.org>, John Baldwin wri tes: > On 10/19/21 1:35 PM, Cy Schubert wrote: > > In message <202110192004.19JK4jN3069844@gitrepo.freebsd.org>, Konstantin > > Belous > > ov writes: > >> The branch main has been updated by kib: > >> > >> URL: https://cgit.FreeBSD.org/src/commit/?id=7ae879b14a2086df521c59c4a379d > 3a0 > >> 72e08bc6 > >> > >> commit 7ae879b14a2086df521c59c4a379d3a072e08bc6 > >> Author: Konstantin Belousov > >> AuthorDate: 2021-10-15 18:57:17 +0000 > >> Commit: Konstantin Belousov > >> CommitDate: 2021-10-19 20:04:34 +0000 > >> > >> kern_procctl(): convert the function to be table-driven > >> > >> Reviewed by: emaste, markj > >> Sponsored by: The FreeBSD Foundation > >> MFC after: 1 week > >> Differential revision: https://reviews.freebsd.org/D32513 > >> --- > >> sys/kern/kern_procctl.c | 123 +++++++++++++++++++++++++++--------------- > ---- > >> -- > >> 1 file changed, 69 insertions(+), 54 deletions(-) > >> > >> diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c > >> index eb36f0822938..90c5e63c7219 100644 > >> --- a/sys/kern/kern_procctl.c > >> +++ b/sys/kern/kern_procctl.c > >> @@ -949,7 +957,14 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t > id > >> , int com, void *data) > >> error = EINVAL; > >> break; > >> } > >> - if (tree_locked) > >> - sx_unlock(&proctree_lock); > >> + > >> + switch (cmd_info->lock_tree) { > >> + case SA_XLOCKED: > >> + sx_xunlock(&proctree_lock); > >> + break; > >> + case SA_SLOCKED: > >> + sx_sunlock(&proctree_lock); > >> + break; > >> + } > >> return (error); > >> } > >> > > > > Should SA_* in fact be LA_*? SA_* in sys/sx.h assumes INVARIANTS whereas > > LA_* in sys/lock.h has no such requirement. > > Both are for "assertions". The LA_* constants aren't really public but are > the values used for witness_assert() that various foo_assert() routines in > locking APIs (mtx_assert/sx_assert, etc.) can use. For locking APIs, the > type-specific macros are the ones you use, e.g. SA_* with sx_assert(). > > Given that, SA_* is the closest match here. We'll need some #ifdefs for non-INVARIANTS built kernels, as it stands buildkernel is broken. -- 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 nobody Tue Oct 19 21:04:15 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4DAEB1812198; Tue, 19 Oct 2021 21:04: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 4HYmSx1XDWz3F70; Tue, 19 Oct 2021 21:04: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 847F71C84; Tue, 19 Oct 2021 21:04:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: 7ae879b14a20 - main - kern_procctl(): convert the function to be table-driven To: Cy Schubert Cc: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202110192004.19JK4jN3069844@gitrepo.freebsd.org> <202110192035.19JKZDqM026085@slippy.cwsent.com> <91ebf9d8-5547-8570-18cb-26a58baf89ba@FreeBSD.org> <202110192051.19JKpV66059807@slippy.cwsent.com> From: John Baldwin Message-ID: Date: Tue, 19 Oct 2021 14:04:15 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 In-Reply-To: <202110192051.19JKpV66059807@slippy.cwsent.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 10/19/21 1:51 PM, Cy Schubert wrote: > In message <91ebf9d8-5547-8570-18cb-26a58baf89ba@FreeBSD.org>, John Baldwin > wri > tes: >> On 10/19/21 1:35 PM, Cy Schubert wrote: >>> In message <202110192004.19JK4jN3069844@gitrepo.freebsd.org>, Konstantin >>> Belous >>> ov writes: >>>> The branch main has been updated by kib: >>>> >>>> URL: https://cgit.FreeBSD.org/src/commit/?id=7ae879b14a2086df521c59c4a379d >> 3a0 >>>> 72e08bc6 >>>> >>>> commit 7ae879b14a2086df521c59c4a379d3a072e08bc6 >>>> Author: Konstantin Belousov >>>> AuthorDate: 2021-10-15 18:57:17 +0000 >>>> Commit: Konstantin Belousov >>>> CommitDate: 2021-10-19 20:04:34 +0000 >>>> >>>> kern_procctl(): convert the function to be table-driven >>>> >>>> Reviewed by: emaste, markj >>>> Sponsored by: The FreeBSD Foundation >>>> MFC after: 1 week >>>> Differential revision: https://reviews.freebsd.org/D32513 >>>> --- >>>> sys/kern/kern_procctl.c | 123 +++++++++++++++++++++++++++--------------- >> ---- >>>> -- >>>> 1 file changed, 69 insertions(+), 54 deletions(-) >>>> >>>> diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c >>>> index eb36f0822938..90c5e63c7219 100644 >>>> --- a/sys/kern/kern_procctl.c >>>> +++ b/sys/kern/kern_procctl.c >>>> @@ -949,7 +957,14 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t >> id >>>> , int com, void *data) >>>> error = EINVAL; >>>> break; >>>> } >>>> - if (tree_locked) >>>> - sx_unlock(&proctree_lock); >>>> + >>>> + switch (cmd_info->lock_tree) { >>>> + case SA_XLOCKED: >>>> + sx_xunlock(&proctree_lock); >>>> + break; >>>> + case SA_SLOCKED: >>>> + sx_sunlock(&proctree_lock); >>>> + break; >>>> + } >>>> return (error); >>>> } >>>> >>> >>> Should SA_* in fact be LA_*? SA_* in sys/sx.h assumes INVARIANTS whereas >>> LA_* in sys/lock.h has no such requirement. >> >> Both are for "assertions". The LA_* constants aren't really public but are >> the values used for witness_assert() that various foo_assert() routines in >> locking APIs (mtx_assert/sx_assert, etc.) can use. For locking APIs, the >> type-specific macros are the ones you use, e.g. SA_* with sx_assert(). >> >> Given that, SA_* is the closest match here. > > We'll need some #ifdefs for non-INVARIANTS built kernels, as it stands > buildkernel is broken. So it is helpeful if your e-mail starts with "the build is broken". :) That said, I think the issue is that SA_* (and LA_*) have to date only been used for assertions and are thus only relevant when INVARIANTS is defined. It's probably simplest to just expose SA_* always if that is what is needed. -- John Baldwin From nobody Tue Oct 19 21:26:36 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7911B17EDAD4; Tue, 19 Oct 2021 21:26: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 4HYmyj1wWvz3MkT; Tue, 19 Oct 2021 21:26: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 1EEE51B801; Tue, 19 Oct 2021 21:26: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 19JLQaqf076666; Tue, 19 Oct 2021 21:26:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19JLQaNT076665; Tue, 19 Oct 2021 21:26:36 GMT (envelope-from git) Date: Tue, 19 Oct 2021 21:26:36 GMT Message-Id: <202110192126.19JLQaNT076665@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: c7f38a2df1f0 - main - procctl: stop using SA_*LOCKED, define local enum List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: c7f38a2df1f0d15346f4405407d89365f6ae3fe1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c7f38a2df1f0d15346f4405407d89365f6ae3fe1 commit c7f38a2df1f0d15346f4405407d89365f6ae3fe1 Author: Konstantin Belousov AuthorDate: 2021-10-19 21:25:19 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-19 21:25:19 +0000 procctl: stop using SA_*LOCKED, define local enum Using SA_*LOCKED constants breaks !INVARIANT builds Reported by: cy Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/kern/kern_procctl.c | 62 ++++++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index 00c68359f375..f90c0e146e2b 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -705,6 +705,12 @@ pdeathsig_status(struct thread *td, struct proc *p, void *data) return (0); } +enum { + PCTL_SLOCKED, + PCTL_XLOCKED, + PCTL_UNLOCKED, +}; + struct procctl_cmd_info { int lock_tree; bool one_proc : 1; @@ -718,136 +724,136 @@ struct procctl_cmd_info { }; static const struct procctl_cmd_info procctl_cmds_info[] = { [PROC_SPROTECT] = - { .lock_tree = SA_SLOCKED, .one_proc = false, + { .lock_tree = PCTL_SLOCKED, .one_proc = false, .esrch_is_einval = false, .no_nonnull_data = false, .need_candebug = false, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = protect_set, .copyout_on_error = false, }, [PROC_REAP_ACQUIRE] = - { .lock_tree = SA_XLOCKED, .one_proc = true, + { .lock_tree = PCTL_XLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = true, .need_candebug = false, .copyin_sz = 0, .copyout_sz = 0, .exec = reap_acquire, .copyout_on_error = false, }, [PROC_REAP_RELEASE] = - { .lock_tree = SA_XLOCKED, .one_proc = true, + { .lock_tree = PCTL_XLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = true, .need_candebug = false, .copyin_sz = 0, .copyout_sz = 0, .exec = reap_release, .copyout_on_error = false, }, [PROC_REAP_STATUS] = - { .lock_tree = SA_SLOCKED, .one_proc = true, + { .lock_tree = PCTL_SLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, .need_candebug = false, .copyin_sz = 0, .copyout_sz = sizeof(struct procctl_reaper_status), .exec = reap_status, .copyout_on_error = false, }, [PROC_REAP_GETPIDS] = - { .lock_tree = SA_SLOCKED, .one_proc = true, + { .lock_tree = PCTL_SLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, .need_candebug = false, .copyin_sz = sizeof(struct procctl_reaper_pids), .copyout_sz = 0, .exec = reap_getpids, .copyout_on_error = false, }, [PROC_REAP_KILL] = - { .lock_tree = SA_SLOCKED, .one_proc = true, + { .lock_tree = PCTL_SLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, .need_candebug = false, .copyin_sz = sizeof(struct procctl_reaper_kill), .copyout_sz = sizeof(struct procctl_reaper_kill), .exec = reap_kill, .copyout_on_error = true, }, [PROC_TRACE_CTL] = - { .lock_tree = SA_SLOCKED, .one_proc = false, + { .lock_tree = PCTL_SLOCKED, .one_proc = false, .esrch_is_einval = false, .no_nonnull_data = false, .need_candebug = true, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = trace_ctl, .copyout_on_error = false, }, [PROC_TRACE_STATUS] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, + { .lock_tree = PCTL_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, .need_candebug = false, .copyin_sz = 0, .copyout_sz = sizeof(int), .exec = trace_status, .copyout_on_error = false, }, [PROC_TRAPCAP_CTL] = - { .lock_tree = SA_SLOCKED, .one_proc = false, + { .lock_tree = PCTL_SLOCKED, .one_proc = false, .esrch_is_einval = false, .no_nonnull_data = false, .need_candebug = true, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = trapcap_ctl, .copyout_on_error = false, }, [PROC_TRAPCAP_STATUS] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, + { .lock_tree = PCTL_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, .need_candebug = false, .copyin_sz = 0, .copyout_sz = sizeof(int), .exec = trapcap_status, .copyout_on_error = false, }, [PROC_PDEATHSIG_CTL] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, + { .lock_tree = PCTL_UNLOCKED, .one_proc = true, .esrch_is_einval = true, .no_nonnull_data = false, .need_candebug = false, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = pdeathsig_ctl, .copyout_on_error = false, }, [PROC_PDEATHSIG_STATUS] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, + { .lock_tree = PCTL_UNLOCKED, .one_proc = true, .esrch_is_einval = true, .no_nonnull_data = false, .need_candebug = false, .copyin_sz = 0, .copyout_sz = sizeof(int), .exec = pdeathsig_status, .copyout_on_error = false, }, [PROC_ASLR_CTL] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, + { .lock_tree = PCTL_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, .need_candebug = true, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = aslr_ctl, .copyout_on_error = false, }, [PROC_ASLR_STATUS] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, + { .lock_tree = PCTL_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, .need_candebug = false, .copyin_sz = 0, .copyout_sz = sizeof(int), .exec = aslr_status, .copyout_on_error = false, }, [PROC_PROTMAX_CTL] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, + { .lock_tree = PCTL_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, .need_candebug = true, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = protmax_ctl, .copyout_on_error = false, }, [PROC_PROTMAX_STATUS] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, + { .lock_tree = PCTL_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, .need_candebug = false, .copyin_sz = 0, .copyout_sz = sizeof(int), .exec = protmax_status, .copyout_on_error = false, }, [PROC_STACKGAP_CTL] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, + { .lock_tree = PCTL_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, .need_candebug = true, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = stackgap_ctl, .copyout_on_error = false, }, [PROC_STACKGAP_STATUS] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, + { .lock_tree = PCTL_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, .need_candebug = false, .copyin_sz = 0, .copyout_sz = sizeof(int), .exec = stackgap_status, .copyout_on_error = false, }, [PROC_NO_NEW_PRIVS_CTL] = - { .lock_tree = SA_SLOCKED, .one_proc = true, + { .lock_tree = PCTL_SLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, .need_candebug = true, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = no_new_privs_ctl, .copyout_on_error = false, }, [PROC_NO_NEW_PRIVS_STATUS] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, + { .lock_tree = PCTL_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, .need_candebug = false, .copyin_sz = 0, .copyout_sz = sizeof(int), .exec = no_new_privs_status, .copyout_on_error = false, }, [PROC_WXMAP_CTL] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, + { .lock_tree = PCTL_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, .need_candebug = true, .copyin_sz = sizeof(int), .copyout_sz = 0, .exec = wxmap_ctl, .copyout_on_error = false, }, [PROC_WXMAP_STATUS] = - { .lock_tree = SA_UNLOCKED, .one_proc = true, + { .lock_tree = PCTL_UNLOCKED, .one_proc = true, .esrch_is_einval = false, .no_nonnull_data = false, .need_candebug = false, .copyin_sz = 0, .copyout_sz = sizeof(int), @@ -915,12 +921,14 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id, int com, void *data) return (EINVAL); switch (cmd_info->lock_tree) { - case SA_XLOCKED: + case PCTL_XLOCKED: sx_xlock(&proctree_lock); break; - case SA_SLOCKED: + case PCTL_SLOCKED: sx_slock(&proctree_lock); break; + default: + break; } switch (idtype) { @@ -991,12 +999,14 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id, int com, void *data) } switch (cmd_info->lock_tree) { - case SA_XLOCKED: + case PCTL_XLOCKED: sx_xunlock(&proctree_lock); break; - case SA_SLOCKED: + case PCTL_SLOCKED: sx_sunlock(&proctree_lock); break; + default: + break; } return (error); } From nobody Tue Oct 19 21:27:16 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B67B117EE25F; Tue, 19 Oct 2021 21:27:35 +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 4HYmzq301lz3N5q; Tue, 19 Oct 2021 21:27:35 +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 19JLRGfB041640 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 20 Oct 2021 00:27:19 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 19JLRGfB041640 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 19JLRGQC041639; Wed, 20 Oct 2021 00:27:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 20 Oct 2021 00:27:16 +0300 From: Konstantin Belousov To: John Baldwin Cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7ae879b14a20 - main - kern_procctl(): convert the function to be table-driven Message-ID: References: <202110192004.19JK4jN3069844@gitrepo.freebsd.org> <202110192035.19JKZDqM026085@slippy.cwsent.com> <91ebf9d8-5547-8570-18cb-26a58baf89ba@FreeBSD.org> <202110192051.19JKpV66059807@slippy.cwsent.com> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4HYmzq301lz3N5q X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Tue, Oct 19, 2021 at 02:04:15PM -0700, John Baldwin wrote: > On 10/19/21 1:51 PM, Cy Schubert wrote: > > In message <91ebf9d8-5547-8570-18cb-26a58baf89ba@FreeBSD.org>, John Baldwin > > wri > > tes: > > > On 10/19/21 1:35 PM, Cy Schubert wrote: > > > > In message <202110192004.19JK4jN3069844@gitrepo.freebsd.org>, Konstantin > > > > Belous > > > > ov writes: > > > > > The branch main has been updated by kib: > > > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=7ae879b14a2086df521c59c4a379d > > > 3a0 > > > > > 72e08bc6 > > > > > > > > > > commit 7ae879b14a2086df521c59c4a379d3a072e08bc6 > > > > > Author: Konstantin Belousov > > > > > AuthorDate: 2021-10-15 18:57:17 +0000 > > > > > Commit: Konstantin Belousov > > > > > CommitDate: 2021-10-19 20:04:34 +0000 > > > > > > > > > > kern_procctl(): convert the function to be table-driven > > > > > Reviewed by: emaste, markj > > > > > Sponsored by: The FreeBSD Foundation > > > > > MFC after: 1 week > > > > > Differential revision: https://reviews.freebsd.org/D32513 > > > > > --- > > > > > sys/kern/kern_procctl.c | 123 +++++++++++++++++++++++++++--------------- > > > ---- > > > > > -- > > > > > 1 file changed, 69 insertions(+), 54 deletions(-) > > > > > > > > > > diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c > > > > > index eb36f0822938..90c5e63c7219 100644 > > > > > --- a/sys/kern/kern_procctl.c > > > > > +++ b/sys/kern/kern_procctl.c > > > > > @@ -949,7 +957,14 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t > > > id > > > > > , int com, void *data) > > > > > error = EINVAL; > > > > > break; > > > > > } > > > > > - if (tree_locked) > > > > > - sx_unlock(&proctree_lock); > > > > > + > > > > > + switch (cmd_info->lock_tree) { > > > > > + case SA_XLOCKED: > > > > > + sx_xunlock(&proctree_lock); > > > > > + break; > > > > > + case SA_SLOCKED: > > > > > + sx_sunlock(&proctree_lock); > > > > > + break; > > > > > + } > > > > > return (error); > > > > > } > > > > > > > > > > > > > Should SA_* in fact be LA_*? SA_* in sys/sx.h assumes INVARIANTS whereas > > > > LA_* in sys/lock.h has no such requirement. > > > > > > Both are for "assertions". The LA_* constants aren't really public but are > > > the values used for witness_assert() that various foo_assert() routines in > > > locking APIs (mtx_assert/sx_assert, etc.) can use. For locking APIs, the > > > type-specific macros are the ones you use, e.g. SA_* with sx_assert(). > > > > > > Given that, SA_* is the closest match here. > > > > We'll need some #ifdefs for non-INVARIANTS built kernels, as it stands > > buildkernel is broken. > > So it is helpeful if your e-mail starts with "the build is broken". :) > > That said, I think the issue is that SA_* (and LA_*) have to date only been > used for assertions and are thus only relevant when INVARIANTS is defined. > It's probably simplest to just expose SA_* always if that is what is > needed. Should be fixed by c7f38a2df1f0. From nobody Tue Oct 19 21:28:10 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 17FE817EE902; Tue, 19 Oct 2021 21:28:13 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (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 4HYn0X6Tbkz3NmR; Tue, 19 Oct 2021 21:28:12 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTP id cnXem9nbQczbLcweamsgTT; Tue, 19 Oct 2021 21:28:12 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id cweZm64S4XoZRcweamaRiB; Tue, 19 Oct 2021 21:28:12 +0000 X-Authority-Analysis: v=2.4 cv=R8NgpfdX c=1 sm=1 tr=0 ts=616f386c a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=8gfv0ekSlNoA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=-Yqpzd8UySGSmqUZtDMA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 90C31573; Tue, 19 Oct 2021 14:28:10 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 19JLSAfC019369; Tue, 19 Oct 2021 14:28:10 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202110192128.19JLSAfC019369@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: John Baldwin cc: Cy Schubert , Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 7ae879b14a20 - main - kern_procctl(): convert the function to be table-driven In-reply-to: References: <202110192004.19JK4jN3069844@gitrepo.freebsd.org> <202110192035.19JKZDqM026085@slippy.cwsent.com> <91ebf9d8-5547-8570-18cb-26a58baf89ba@FreeBSD.org> <202110192051.19JKpV66059807@slippy.cwsent.com> Comments: In-reply-to John Baldwin message dated "Tue, 19 Oct 2021 14:04:15 -0700." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 19 Oct 2021 14:28:10 -0700 X-CMAE-Envelope: MS4xfKV1tNt4CAslWBPjlAMVrCsA+vWYTgDX6ezWBHMrYKTbxP8lkaUcLLt+v5r7LTfuBJQh5w9QppS+vmXhOc6mmORrNMVy46xSwr6KJZzflbPrvQU1x+qH GtVGhAVw9/NcsU4qgCWXP1bzWpCZnmhjApeuHOsp6n5hryoDgx9TBoCzjjmOmzI5uQ0DAN0WiCk5rkxlzdwQxAxG1X99NO4WDa0LKSmKfi4cGcu6d80Gv5rB B2d1LeL9reGbOZnNdrh2N/FAtSRwVWj8UyBLja5upa3batEMqK5b6EduifBC6kcBvED6CUxAGzUjQYW/KFlQ+TnEeMxXvTb4B46jXhbgcgUKNRO1rE4xuW6C +8QZKo3w X-Rspamd-Queue-Id: 4HYn0X6Tbkz3NmR X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N In message , John Baldwin wri tes: > On 10/19/21 1:51 PM, Cy Schubert wrote: > > In message <91ebf9d8-5547-8570-18cb-26a58baf89ba@FreeBSD.org>, John Baldwin > > wri > > tes: > >> On 10/19/21 1:35 PM, Cy Schubert wrote: > >>> In message <202110192004.19JK4jN3069844@gitrepo.freebsd.org>, Konstantin > >>> Belous > >>> ov writes: > >>>> The branch main has been updated by kib: > >>>> > >>>> URL: https://cgit.FreeBSD.org/src/commit/?id=7ae879b14a2086df521c59c4a37 > 9d > >> 3a0 > >>>> 72e08bc6 > >>>> > >>>> commit 7ae879b14a2086df521c59c4a379d3a072e08bc6 > >>>> Author: Konstantin Belousov > >>>> AuthorDate: 2021-10-15 18:57:17 +0000 > >>>> Commit: Konstantin Belousov > >>>> CommitDate: 2021-10-19 20:04:34 +0000 > >>>> > >>>> kern_procctl(): convert the function to be table-driven > >>>> > >>>> Reviewed by: emaste, markj > >>>> Sponsored by: The FreeBSD Foundation > >>>> MFC after: 1 week > >>>> Differential revision: https://reviews.freebsd.org/D32513 > >>>> --- > >>>> sys/kern/kern_procctl.c | 123 +++++++++++++++++++++++++++------------ > --- > >> ---- > >>>> -- > >>>> 1 file changed, 69 insertions(+), 54 deletions(-) > >>>> > >>>> diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c > >>>> index eb36f0822938..90c5e63c7219 100644 > >>>> --- a/sys/kern/kern_procctl.c > >>>> +++ b/sys/kern/kern_procctl.c > >>>> @@ -949,7 +957,14 @@ kern_procctl(struct thread *td, idtype_t idtype, id > _t > >> id > >>>> , int com, void *data) > >>>> error = EINVAL; > >>>> break; > >>>> } > >>>> - if (tree_locked) > >>>> - sx_unlock(&proctree_lock); > >>>> + > >>>> + switch (cmd_info->lock_tree) { > >>>> + case SA_XLOCKED: > >>>> + sx_xunlock(&proctree_lock); > >>>> + break; > >>>> + case SA_SLOCKED: > >>>> + sx_sunlock(&proctree_lock); > >>>> + break; > >>>> + } > >>>> return (error); > >>>> } > >>>> > >>> > >>> Should SA_* in fact be LA_*? SA_* in sys/sx.h assumes INVARIANTS whereas > >>> LA_* in sys/lock.h has no such requirement. > >> > >> Both are for "assertions". The LA_* constants aren't really public but ar > e > >> the values used for witness_assert() that various foo_assert() routines in > >> locking APIs (mtx_assert/sx_assert, etc.) can use. For locking APIs, the > >> type-specific macros are the ones you use, e.g. SA_* with sx_assert(). > >> > >> Given that, SA_* is the closest match here. > > > > We'll need some #ifdefs for non-INVARIANTS built kernels, as it stands > > buildkernel is broken. > > So it is helpeful if your e-mail starts with "the build is broken". :) Sorry about that. Next time I will. > > That said, I think the issue is that SA_* (and LA_*) have to date only been > used for assertions and are thus only relevant when INVARIANTS is defined. > It's probably simplest to just expose SA_* always if that is what is > needed. Thinking the same thing. -- 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 nobody Wed Oct 20 00:11:17 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 44C3417C48D8; Wed, 20 Oct 2021 00:11:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HYrcj1Yl4z4qm7; Wed, 20 Oct 2021 00:11:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1624C1D7B8; Wed, 20 Oct 2021 00:11:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19K0BHkb000285; Wed, 20 Oct 2021 00:11:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K0BHNB000284; Wed, 20 Oct 2021 00:11:17 GMT (envelope-from git) Date: Wed, 20 Oct 2021 00:11:17 GMT Message-Id: <202110200011.19K0BHNB000284@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: 1c99af1ebe61 - main - libssh: Rearrange Makefile SRCS to match upstream Makefile.in List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 1c99af1ebe61cbaf633792941640dcd254acf921 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1c99af1ebe61cbaf633792941640dcd254acf921 commit 1c99af1ebe61cbaf633792941640dcd254acf921 Author: Ed Maste AuthorDate: 2021-10-20 00:09:46 +0000 Commit: Ed Maste CommitDate: 2021-10-20 00:10:56 +0000 libssh: Rearrange Makefile SRCS to match upstream Makefile.in SRCS entries are kept in the same order and with the same line breaks as upstream, to make comparison easier. Reported by: des --- secure/lib/libssh/Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/secure/lib/libssh/Makefile b/secure/lib/libssh/Makefile index e835ef3c1b2a..49b5319d2b54 100644 --- a/secure/lib/libssh/Makefile +++ b/secure/lib/libssh/Makefile @@ -5,7 +5,7 @@ LIB= ssh PRIVATELIB= true SHLIB_MAJOR= 5 -SRCS= ssh_api.c ssh-sk-client.c ssh-ecdsa-sk.c ssh-ed25519-sk.c ssherr.c \ +SRCS= ssh_api.c ssherr.c \ sshbuf.c sshkey.c sshbuf-getput-basic.c \ sshbuf-misc.c sshbuf-getput-crypto.c krl.c bitmap.c SRCS+= authfd.c authfile.c \ @@ -15,17 +15,20 @@ SRCS+= authfd.c authfile.c \ log.c match.c moduli.c nchan.c packet.c \ readpass.c ttymodes.c xmalloc.c addr.c addrmatch.c \ atomicio.c dispatch.c mac.c misc.c utf8.c \ - monitor_fdpass.c rijndael.c ssh-dss.c ssh-ecdsa.c ssh-rsa.c dh.c \ + monitor_fdpass.c rijndael.c ssh-dss.c ssh-ecdsa.c ssh-ecdsa-sk.c \ + ssh-ed25519-sk.c ssh-rsa.c dh.c \ msg.c progressmeter.c dns.c entropy.c umac.c umac128.c \ ssh-pkcs11.c smult_curve25519_ref.c \ poly1305.c chacha.c cipher-chachapoly.c cipher-chachapoly-libcrypto.c \ - ssh-ed25519.c digest-openssl.c digest-libc.c hmac.c \ - sc25519.c ge25519.c fe25519.c ed25519.c verify.c hash.c \ + ssh-ed25519.c digest-openssl.c digest-libc.c \ + hmac.c sc25519.c ge25519.c fe25519.c ed25519.c verify.c hash.c \ kex.c kexdh.c kexgex.c kexecdh.c kexc25519.c \ kexgexc.c kexgexs.c \ kexsntrup761x25519.c sntrup761.c kexgen.c \ sftp-realpath.c platform-pledge.c platform-tracing.c platform-misc.c \ sshbuf-io.c +SRCS+= ssh-sk-client.c + PACKAGE= ssh # gss-genr.c should be in $SRCS but causes linking problems, so it is From nobody Wed Oct 20 01:23:14 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 491DC180F9C4; Wed, 20 Oct 2021 01:23: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 4HYtCl1XYVz3lgJ; Wed, 20 Oct 2021 01:23: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 155CB1E9D4; Wed, 20 Oct 2021 01:23: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 19K1NEFY095439; Wed, 20 Oct 2021 01:23:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K1NEvq095438; Wed, 20 Oct 2021 01:23:14 GMT (envelope-from git) Date: Wed, 20 Oct 2021 01:23:14 GMT Message-Id: <202110200123.19K1NEvq095438@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: a23e6a1078d6 - main - vm_page: Move vm_page_alloc_check() to after page allocator definitions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: a23e6a1078d6d6c361481ab4f835449f177edac3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a23e6a1078d6d6c361481ab4f835449f177edac3 commit a23e6a1078d6d6c361481ab4f835449f177edac3 Author: Mark Johnston AuthorDate: 2021-10-20 01:22:50 +0000 Commit: Mark Johnston CommitDate: 2021-10-20 01:22:50 +0000 vm_page: Move vm_page_alloc_check() to after page allocator definitions This way all of the vm_page_alloc_*() allocator functions are grouped together. MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/vm/vm_page.c | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 25e6dce32aa6..bc1c6bbe4ce1 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -2394,28 +2394,6 @@ found: return (m_ret); } -/* - * Check a page that has been freshly dequeued from a freelist. - */ -static void -vm_page_alloc_check(vm_page_t m) -{ - - KASSERT(m->object == NULL, ("page %p has object", m)); - KASSERT(m->a.queue == PQ_NONE && - (m->a.flags & PGA_QUEUE_STATE_MASK) == 0, - ("page %p has unexpected queue %d, flags %#x", - m, m->a.queue, (m->a.flags & PGA_QUEUE_STATE_MASK))); - KASSERT(m->ref_count == 0, ("page %p has references", m)); - KASSERT(vm_page_busy_freed(m), ("page %p is not freed", m)); - KASSERT(m->dirty == 0, ("page %p is dirty", m)); - KASSERT(pmap_page_get_memattr(m) == VM_MEMATTR_DEFAULT, - ("page %p has unexpected memattr %d", - m, pmap_page_get_memattr(m))); - KASSERT(m->valid == 0, ("free page %p is valid", m)); - pmap_vm_page_alloc_check(m); -} - /* * vm_page_alloc_freelist: * @@ -2494,6 +2472,27 @@ again: return (m); } +/* + * Check a page that has been freshly dequeued from a freelist. + */ +static void +vm_page_alloc_check(vm_page_t m) +{ + KASSERT(m->object == NULL, ("page %p has object", m)); + KASSERT(m->ref_count == 0, ("page %p has references", m)); + KASSERT(vm_page_busy_freed(m), ("page %p is not freed", m)); + KASSERT(m->a.queue == PQ_NONE && + (m->a.flags & PGA_QUEUE_STATE_MASK) == 0, + ("page %p has unexpected queue %d, flags %#x", + m, m->a.queue, (m->a.flags & PGA_QUEUE_STATE_MASK))); + KASSERT(m->valid == 0, ("free page %p is valid", m)); + KASSERT(m->dirty == 0, ("page %p is dirty", m)); + KASSERT(pmap_page_get_memattr(m) == VM_MEMATTR_DEFAULT, + ("page %p has unexpected memattr %d", + m, pmap_page_get_memattr(m))); + pmap_vm_page_alloc_check(m); +} + static int vm_page_zone_import(void *arg, void **store, int cnt, int domain, int flags) { From nobody Wed Oct 20 01:23:15 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B5195180F8CA; Wed, 20 Oct 2021 01:23:15 +0000 (UTC) (envelope-from danfe@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 4HYtCl4pRWz3lgK; Wed, 20 Oct 2021 01:23:15 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1634692995; 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=TzeDPt7OWvzZXa7IP4RQTUrvnKEQvjRZrilANL2dW6Y=; b=nw9fdocQYBhWkIxD4j1hlt7y2k+RQKEGAWezQTvuBm9sD+Znm6w8A8toJQqnmptsQQrYM8 dZEDe/IsUK9No5LfQ0LdYCWO8E3VjZFttpZYm0SrvzOU+qeE2efSi7zIiWnBLgMeeaGL6O ctHrS/gLERdEzS9fz1Y0T0jdHYw3k19CGYTjYTpgT0QeeDMTTS9k1VEGYishHRQq5xuMhx l+exfPGdwGob7EyO/7SLpyAF5WwzgjYmCuvrmfJgTqSlu7XvAvudHQ4AbWmemXBxvHZ2tE kRslfpjxA0mkn1oEd0yPXS9oOQDEfR1wXF9QSnEGYPKmOcI4Nns7aAYNRNNiQw== Received: by freefall.freebsd.org (Postfix, from userid 1033) id 957B619B22; Wed, 20 Oct 2021 01:23:15 +0000 (UTC) Date: Wed, 20 Oct 2021 01:23:15 +0000 From: Alexey Dokuchaev To: Emmanuel Vadot Cc: Slawa Olhovchenkov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1634692995; 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=TzeDPt7OWvzZXa7IP4RQTUrvnKEQvjRZrilANL2dW6Y=; b=yKLLigL+UQMZpkSKeOQbaxZdqb05/B/4HKa/VCP5GdGdAvjNxPqRsKuaiwOjrNycvQXszM vCil4cMYXjsEnERk353JpUWMPnThHh/NQLyHM0nuD6akhiWNsudxb0oOJCzeIPDg80C/QS kCGnfMro+TsvWGIln/G4dtH/XkFZXKjbEmuqsqQW1iMzVhXbOuiL7LuYoelyshB+bc2qhp 0g06RzQNYhnwcf0dVt3lUkQgzmf21iMLy2TjeRfvFBCatQSVgCxQI1ZUW6ILIOaU0d5lZb wMRlJvHYeMebvTX8IeaLOA2TWXJvSPDXzqoATVc3FAVqUtjp0ZMvDakNQDHaGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1634692995; a=rsa-sha256; cv=none; b=oz9aEyc6kyg9+VT86oLMEDhVpSct1B5VYWG5J7tLkErQV3aSjkpCY0zqTWmSQ30MZbKqHE be1haJrC4mbprQMx64jdK8LEz/pjKAvB3WXPc5txWK5bOkUnPjJ+KO9FHF1V3FNtsiLzTM OKghAgHx0/quByXmNc77P1WkQ7NE77rfPMMm0KEPvJ2N9PPOAMDkVR9LLdfg7Hp69xKpwf S6MQyoVag89fXA/kxNfEBsbPN9ewy/MLLPhltrQ6nmMqPHQeg/ENzFH8Cqk37fYoh4ckjU ILfXnlJGE3t72tebSYSKvRKuD5+GHaGxpR0WBOj6MyPt90zLmlPfdVWtw8lEGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On Tue, Oct 19, 2021 at 01:37:00PM +0200, Emmanuel Vadot wrote: > On Tue, 19 Oct 2021 14:21:33 +0300, Slawa Olhovchenkov wrote: > > On Tue, Oct 19, 2021 at 07:38:15AM +0000, Emmanuel Vadot wrote: > > > commit 225639e7db685a4047e384abdbc296c0e02bd147 > > > > > > vt: Disable bell by default > > > > > > Bell is either useless if you're working on remote servers or > > > really annoying when you're working with a local machine that > > > have a loud buzzer. Switch the default to have it disable. > > > > For you, not for me, for example. Also, this is violate POLA. > > Just set kern.vt.enable_bell=1 in /etc/sysctl.conf and you will be > happy again. Actually, it should've been the other way around: it if annoys *you*, then you should just set kern.vt.enable_bell=0 in /etc/sysctl.conf and be happy. I'm also used to it, it's a nice indicator that things work normally, including the bell itself. > And POLA doesn't means that we can't change a thing. FWIW, controversial changes like this should go through the formal review process, giving everyone interested a chance to chime in, not like closing the differential in less than 24 hours. ./danfe From nobody Wed Oct 20 01:23:16 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 47201180F860; Wed, 20 Oct 2021 01:23: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 4HYtCm3dTkz3lcy; Wed, 20 Oct 2021 01:23: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 529421E6E5; Wed, 20 Oct 2021 01:23: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 19K1NGJE095467; Wed, 20 Oct 2021 01:23:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K1NGJh095466; Wed, 20 Oct 2021 01:23:16 GMT (envelope-from git) Date: Wed, 20 Oct 2021 01:23:16 GMT Message-Id: <202110200123.19K1NGJh095466@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: b498f71bc56a - main - vm_page: Add a new page allocator interface for unnamed pages List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: b498f71bc56af0069d9a4685b8385ee613a00727 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b498f71bc56af0069d9a4685b8385ee613a00727 commit b498f71bc56af0069d9a4685b8385ee613a00727 Author: Mark Johnston AuthorDate: 2021-10-20 00:22:12 +0000 Commit: Mark Johnston CommitDate: 2021-10-20 01:22:55 +0000 vm_page: Add a new page allocator interface for unnamed pages The diff adds vm_page_alloc_noobj() and vm_page_alloc_noobj_domain(). These mostly correspond to vm_page_alloc() and vm_page_alloc_domain() when no VM object is specified, with the exception that they handle VM_ALLOC_ZERO by zeroing the page, rather than by preserving PG_ZERO. This simplifies callers and will permit simplification of the vm_page_alloc_domain() definition. Since the new allocator variant is similar to vm_page_alloc_freelist(), implement both of them using a common backend allocator function. No functional change intended. Reviewed by: alc, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31985 --- sys/vm/vm_page.c | 141 +++++++++++++++++++++++++++++++++++-------------------- sys/vm/vm_page.h | 14 +++--- 2 files changed, 98 insertions(+), 57 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index bc1c6bbe4ce1..74b09fc27be5 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -2395,54 +2395,41 @@ found: } /* - * vm_page_alloc_freelist: - * - * Allocate a physical page from the specified free page list. - * - * The caller must always specify an allocation class. - * - * allocation classes: - * VM_ALLOC_NORMAL normal process request - * VM_ALLOC_SYSTEM system *really* needs a page - * VM_ALLOC_INTERRUPT interrupt time request - * - * optional allocation flags: - * VM_ALLOC_COUNT(number) the number of additional pages that the caller - * intends to allocate - * VM_ALLOC_WIRED wire the allocated page - * VM_ALLOC_ZERO prefer a zeroed page + * Allocate a physical page that is not intended to be inserted into a VM + * object. If the "freelist" parameter is not equal to VM_NFREELIST, then only + * pages from the specified vm_phys freelist will be returned. */ -vm_page_t -vm_page_alloc_freelist(int freelist, int req) -{ - struct vm_domainset_iter di; - vm_page_t m; - int domain; - - vm_domainset_iter_page_init(&di, NULL, 0, &domain, &req); - do { - m = vm_page_alloc_freelist_domain(domain, freelist, req); - if (m != NULL) - break; - } while (vm_domainset_iter_page(&di, NULL, &domain) == 0); - - return (m); -} - -vm_page_t -vm_page_alloc_freelist_domain(int domain, int freelist, int req) +static __always_inline vm_page_t +_vm_page_alloc_noobj_domain(int domain, const int freelist, int req) { struct vm_domain *vmd; vm_page_t m; - u_int flags; + int flags; - m = NULL; + KASSERT((req & (VM_ALLOC_SBUSY | VM_ALLOC_IGN_SBUSY | + VM_ALLOC_NOOBJ)) == 0, + ("%s: invalid req %#x", __func__, req)); + + flags = (req & VM_ALLOC_NODUMP) != 0 ? PG_NODUMP : 0; vmd = VM_DOMAIN(domain); again: + if (freelist == VM_NFREELIST && + vmd->vmd_pgcache[VM_FREEPOOL_DIRECT].zone != NULL) { + m = uma_zalloc(vmd->vmd_pgcache[VM_FREEPOOL_DIRECT].zone, + M_NOWAIT | M_NOVM); + if (m != NULL) { + flags |= PG_PCPU_CACHE; + goto found; + } + } + if (vm_domain_allocate(vmd, req, 1)) { vm_domain_free_lock(vmd); - m = vm_phys_alloc_freelist_pages(domain, freelist, - VM_FREEPOOL_DIRECT, 0); + if (freelist == VM_NFREELIST) + m = vm_phys_alloc_pages(domain, VM_FREEPOOL_DIRECT, 0); + else + m = vm_phys_alloc_freelist_pages(domain, freelist, + VM_FREEPOOL_DIRECT, 0); vm_domain_free_unlock(vmd); if (m == NULL) vm_domain_freecnt_inc(vmd, 1); @@ -2452,44 +2439,96 @@ again: goto again; return (NULL); } + +found: vm_page_dequeue(m); vm_page_alloc_check(m); - /* - * Initialize the page. Only the PG_ZERO flag is inherited. - */ + /* Consumers should not rely on a useful default pindex value. */ + m->pindex = 0xdeadc0dedeadc0de; + m->flags = (m->flags & PG_ZERO) | flags; m->a.flags = 0; - flags = 0; - if ((req & VM_ALLOC_ZERO) != 0) - flags = PG_ZERO; - m->flags &= flags; + m->oflags = VPO_UNMANAGED; + m->busy_lock = VPB_UNBUSIED; if ((req & VM_ALLOC_WIRED) != 0) { vm_wire_add(1); m->ref_count = 1; } - /* Unmanaged pages don't use "act_count". */ - m->oflags = VPO_UNMANAGED; + + if ((req & VM_ALLOC_ZERO) != 0 && (m->flags & PG_ZERO) == 0) + pmap_zero_page(m); + + return (m); +} + +vm_page_t +vm_page_alloc_freelist(int freelist, int req) +{ + struct vm_domainset_iter di; + vm_page_t m; + int domain; + + vm_domainset_iter_page_init(&di, NULL, 0, &domain, &req); + do { + m = vm_page_alloc_freelist_domain(domain, freelist, req); + if (m != NULL) + break; + } while (vm_domainset_iter_page(&di, NULL, &domain) == 0); + + return (m); +} + +vm_page_t +vm_page_alloc_freelist_domain(int domain, int freelist, int req) +{ + KASSERT(freelist >= 0 && freelist < VM_NFREELIST, + ("%s: invalid freelist %d", __func__, freelist)); + + return (_vm_page_alloc_noobj_domain(domain, freelist, req)); +} + +vm_page_t +vm_page_alloc_noobj(int req) +{ + struct vm_domainset_iter di; + vm_page_t m; + int domain; + + vm_domainset_iter_page_init(&di, NULL, 0, &domain, &req); + do { + m = vm_page_alloc_noobj_domain(domain, req); + if (m != NULL) + break; + } while (vm_domainset_iter_page(&di, NULL, &domain) == 0); + return (m); } +vm_page_t +vm_page_alloc_noobj_domain(int domain, int req) +{ + return (_vm_page_alloc_noobj_domain(domain, VM_NFREELIST, req)); +} + /* * Check a page that has been freshly dequeued from a freelist. */ static void vm_page_alloc_check(vm_page_t m) { + KASSERT(m->object == NULL, ("page %p has object", m)); - KASSERT(m->ref_count == 0, ("page %p has references", m)); - KASSERT(vm_page_busy_freed(m), ("page %p is not freed", m)); KASSERT(m->a.queue == PQ_NONE && (m->a.flags & PGA_QUEUE_STATE_MASK) == 0, ("page %p has unexpected queue %d, flags %#x", m, m->a.queue, (m->a.flags & PGA_QUEUE_STATE_MASK))); - KASSERT(m->valid == 0, ("free page %p is valid", m)); + KASSERT(m->ref_count == 0, ("page %p has references", m)); + KASSERT(vm_page_busy_freed(m), ("page %p is not freed", m)); KASSERT(m->dirty == 0, ("page %p is dirty", m)); KASSERT(pmap_page_get_memattr(m) == VM_MEMATTR_DEFAULT, ("page %p has unexpected memattr %d", m, pmap_page_get_memattr(m))); + KASSERT(m->valid == 0, ("free page %p is valid", m)); pmap_vm_page_alloc_check(m); } diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index 6e0a4328e260..600619b00eaf 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -527,8 +527,8 @@ vm_page_t PHYS_TO_VM_PAGE(vm_paddr_t pa); * Legend: * (a) - vm_page_alloc() supports the flag. * (c) - vm_page_alloc_contig() supports the flag. - * (f) - vm_page_alloc_freelist() supports the flag. * (g) - vm_page_grab() supports the flag. + * (n) - vm_page_alloc_noobj() and vm_page_alloc_freelist() support the flag. * (p) - vm_page_grab_pages() supports the flag. * Bits above 15 define the count of additional pages that the caller * intends to allocate. @@ -537,10 +537,10 @@ vm_page_t PHYS_TO_VM_PAGE(vm_paddr_t pa); #define VM_ALLOC_INTERRUPT 1 #define VM_ALLOC_SYSTEM 2 #define VM_ALLOC_CLASS_MASK 3 -#define VM_ALLOC_WAITOK 0x0008 /* (acf) Sleep and retry */ -#define VM_ALLOC_WAITFAIL 0x0010 /* (acf) Sleep and return error */ -#define VM_ALLOC_WIRED 0x0020 /* (acfgp) Allocate a wired page */ -#define VM_ALLOC_ZERO 0x0040 /* (acfgp) Allocate a prezeroed page */ +#define VM_ALLOC_WAITOK 0x0008 /* (acn) Sleep and retry */ +#define VM_ALLOC_WAITFAIL 0x0010 /* (acn) Sleep and return error */ +#define VM_ALLOC_WIRED 0x0020 /* (acgnp) Allocate a wired page */ +#define VM_ALLOC_ZERO 0x0040 /* (acgnp) Allocate a zeroed page */ #define VM_ALLOC_NORECLAIM 0x0080 /* (c) Do not reclaim after failure */ #define VM_ALLOC_NOOBJ 0x0100 /* (acg) No associated object */ #define VM_ALLOC_NOBUSY 0x0200 /* (acgp) Do not excl busy the page */ @@ -548,7 +548,7 @@ vm_page_t PHYS_TO_VM_PAGE(vm_paddr_t pa); #define VM_ALLOC_IGN_SBUSY 0x1000 /* (gp) Ignore shared busy flag */ #define VM_ALLOC_NODUMP 0x2000 /* (ag) don't include in dump */ #define VM_ALLOC_SBUSY 0x4000 /* (acgp) Shared busy the page */ -#define VM_ALLOC_NOWAIT 0x8000 /* (acfgp) Do not sleep */ +#define VM_ALLOC_NOWAIT 0x8000 /* (acgnp) Do not sleep */ #define VM_ALLOC_COUNT_SHIFT 16 #define VM_ALLOC_COUNT(count) ((count) << VM_ALLOC_COUNT_SHIFT) @@ -614,6 +614,8 @@ vm_page_t vm_page_alloc_contig_domain(vm_object_t object, vm_memattr_t memattr); vm_page_t vm_page_alloc_freelist(int, int); vm_page_t vm_page_alloc_freelist_domain(int, int, int); +vm_page_t vm_page_alloc_noobj(int); +vm_page_t vm_page_alloc_noobj_domain(int, int); void vm_page_bits_set(vm_page_t m, vm_page_bits_t *bits, vm_page_bits_t set); bool vm_page_blacklist_add(vm_paddr_t pa, bool verbose); vm_page_t vm_page_grab(vm_object_t, vm_pindex_t, int); From nobody Wed Oct 20 01:23:17 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6194A180F8DC; Wed, 20 Oct 2021 01:23: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 4HYtCn4t1bz3lRK; Wed, 20 Oct 2021 01:23: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 67FF01E89D; Wed, 20 Oct 2021 01:23: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 19K1NHmd095494; Wed, 20 Oct 2021 01:23:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K1NHcA095493; Wed, 20 Oct 2021 01:23:17 GMT (envelope-from git) Date: Wed, 20 Oct 2021 01:23:17 GMT Message-Id: <202110200123.19K1NHcA095493@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: a4667e09e652 - main - Convert vm_page_alloc() callers to use vm_page_alloc_noobj(). List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: a4667e09e6520dc2c4b0b988051f060fed695a91 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a4667e09e6520dc2c4b0b988051f060fed695a91 commit a4667e09e6520dc2c4b0b988051f060fed695a91 Author: Mark Johnston AuthorDate: 2021-10-20 00:23:39 +0000 Commit: Mark Johnston CommitDate: 2021-10-20 01:22:56 +0000 Convert vm_page_alloc() callers to use vm_page_alloc_noobj(). Remove page zeroing code from consumers and stop specifying VM_ALLOC_NOOBJ. In a few places, also convert an allocation loop to simply use VM_ALLOC_WAITOK. Similarly, convert vm_page_alloc_domain() callers. Note that callers are now responsible for assigning the pindex. Reviewed by: alc, hselasky, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31986 --- sys/amd64/amd64/mp_machdep.c | 3 +- sys/amd64/amd64/pmap.c | 44 +++++++++--------------- sys/amd64/amd64/uma_machdep.c | 6 ++-- sys/arm/arm/pmap-v6.c | 20 +++++------ sys/arm64/arm64/pmap.c | 44 +++++++++--------------- sys/arm64/arm64/uma_machdep.c | 6 ++-- sys/arm64/iommu/iommu_pmap.c | 15 +++------ sys/compat/linuxkpi/common/src/linux_page.c | 2 +- sys/dev/drm2/ttm/ttm_page_alloc.c | 7 +--- sys/dev/ti/if_ti.c | 3 +- sys/dev/virtio/balloon/virtio_balloon.c | 3 +- sys/dev/xen/balloon/balloon.c | 21 ++++-------- sys/dev/xen/gntdev/gntdev.c | 11 ++---- sys/fs/nfs/nfs_commonsubs.c | 9 ++--- sys/fs/nfsclient/nfs_clrpcops.c | 9 ++--- sys/i386/i386/pmap.c | 44 +++++++++--------------- sys/kern/kern_mbuf.c | 4 +-- sys/kern/uipc_ktls.c | 8 ++--- sys/kern/uipc_mbuf.c | 5 ++- sys/kern/vfs_bio.c | 5 ++- sys/mips/mips/pmap.c | 4 --- sys/mips/mips/uma_machdep.c | 2 -- sys/powerpc/aim/mmu_oea64.c | 7 ++-- sys/powerpc/aim/mmu_radix.c | 36 ++++++++------------ sys/powerpc/booke/pmap_32.c | 4 +-- sys/powerpc/booke/pmap_64.c | 9 ++--- sys/powerpc/powerpc/uma_machdep.c | 7 ++-- sys/riscv/riscv/pmap.c | 52 ++++++++++------------------- sys/riscv/riscv/uma_machdep.c | 6 ++-- sys/vm/uma_core.c | 22 ++++++------ sys/vm/vm_kern.c | 5 +-- sys/vm/vm_page.c | 3 +- 32 files changed, 146 insertions(+), 280 deletions(-) diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 16ec277e9c34..33defe79c8b9 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -305,8 +305,7 @@ mp_realloc_pcpu(int cpuid, int domain) oa = (vm_offset_t)&__pcpu[cpuid]; if (vm_phys_domain(pmap_kextract(oa)) == domain) return; - m = vm_page_alloc_domain(NULL, 0, domain, - VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ); + m = vm_page_alloc_noobj_domain(domain, 0); if (m == NULL) return; na = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 168c9eec1b66..8d6c81a5459b 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -2342,10 +2342,9 @@ pmap_init_pv_table(void) highest = start + (s / sizeof(*pvd)) - 1; for (j = 0; j < s; j += PAGE_SIZE) { - vm_page_t m = vm_page_alloc_domain(NULL, 0, - domain, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ); + vm_page_t m = vm_page_alloc_noobj_domain(domain, 0); if (m == NULL) - panic("vm_page_alloc_domain failed for %lx\n", (vm_offset_t)pvd + j); + panic("failed to allocate PV table page"); pmap_qenter((vm_offset_t)pvd + j, &m, 1); } @@ -4312,15 +4311,11 @@ pmap_alloc_pt_page(pmap_t pmap, vm_pindex_t pindex, int flags) { vm_page_t m; - m = vm_page_alloc(NULL, pindex, flags | VM_ALLOC_NOOBJ); + m = vm_page_alloc_noobj(flags); if (__predict_false(m == NULL)) return (NULL); - + m->pindex = pindex; pmap_pt_page_count_adj(pmap, 1); - - if ((flags & VM_ALLOC_ZERO) != 0 && (m->flags & PG_ZERO) == 0) - pmap_zero_page(m); - return (m); } @@ -4358,8 +4353,8 @@ pmap_pinit_type(pmap_t pmap, enum pmap_type pm_type, int flags) /* * allocate the page directory page */ - pmltop_pg = pmap_alloc_pt_page(NULL, 0, VM_ALLOC_NORMAL | - VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_WAITOK); + pmltop_pg = pmap_alloc_pt_page(NULL, 0, VM_ALLOC_WIRED | VM_ALLOC_ZERO | + VM_ALLOC_WAITOK); pmltop_phys = VM_PAGE_TO_PHYS(pmltop_pg); pmap->pm_pmltop = (pml5_entry_t *)PHYS_TO_DMAP(pmltop_phys); @@ -4389,8 +4384,7 @@ pmap_pinit_type(pmap_t pmap, enum pmap_type pm_type, int flags) pmap_pinit_pml4(pmltop_pg); if ((curproc->p_md.md_flags & P_MD_KPTI) != 0) { pmltop_pgu = pmap_alloc_pt_page(NULL, 0, - VM_ALLOC_WIRED | VM_ALLOC_NORMAL | - VM_ALLOC_WAITOK); + VM_ALLOC_WIRED | VM_ALLOC_WAITOK); pmap->pm_pmltopu = (pml4_entry_t *)PHYS_TO_DMAP( VM_PAGE_TO_PHYS(pmltop_pgu)); if (pmap_is_la57(pmap)) @@ -5480,8 +5474,7 @@ retry: } } /* No free items, allocate another chunk */ - m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | - VM_ALLOC_WIRED); + m = vm_page_alloc_noobj(VM_ALLOC_WIRED); if (m == NULL) { if (lockp == NULL) { PV_STAT(counter_u64_add(pc_chunk_tryfail, 1)); @@ -5584,8 +5577,7 @@ retry: break; } for (reclaimed = false; avail < needed; avail += _NPCPV) { - m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | - VM_ALLOC_WIRED); + m = vm_page_alloc_noobj(VM_ALLOC_WIRED); if (m == NULL) { m = reclaim_pv_chunk(pmap, lockp); if (m == NULL) @@ -5957,8 +5949,7 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, vm_offset_t va, * priority is normal. */ mpte = pmap_alloc_pt_page(pmap, pmap_pde_pindex(va), - (in_kernel ? VM_ALLOC_INTERRUPT : VM_ALLOC_NORMAL) | - VM_ALLOC_WIRED); + (in_kernel ? VM_ALLOC_INTERRUPT : 0) | VM_ALLOC_WIRED); /* * If the allocation of the new page table page fails, @@ -10355,8 +10346,7 @@ pmap_quick_remove_page(vm_offset_t addr) static vm_page_t pmap_large_map_getptp_unlocked(void) { - return (pmap_alloc_pt_page(kernel_pmap, 0, - VM_ALLOC_NORMAL | VM_ALLOC_ZERO)); + return (pmap_alloc_pt_page(kernel_pmap, 0, VM_ALLOC_ZERO)); } static vm_page_t @@ -11411,12 +11401,10 @@ pmap_kasan_enter_alloc_4k(void) { vm_page_t m; - m = vm_page_alloc(NULL, 0, VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | - VM_ALLOC_WIRED | VM_ALLOC_ZERO); + m = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED | + VM_ALLOC_ZERO); if (m == NULL) panic("%s: no memory to grow shadow map", __func__); - if ((m->flags & PG_ZERO) == 0) - pmap_zero_page(m); return (m); } @@ -11481,12 +11469,10 @@ pmap_kmsan_enter_alloc_4k(void) { vm_page_t m; - m = vm_page_alloc(NULL, 0, VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | - VM_ALLOC_WIRED | VM_ALLOC_ZERO); + m = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED | + VM_ALLOC_ZERO); if (m == NULL) panic("%s: no memory to grow shadow map", __func__); - if ((m->flags & PG_ZERO) == 0) - pmap_zero_page(m); return (m); } diff --git a/sys/amd64/amd64/uma_machdep.c b/sys/amd64/amd64/uma_machdep.c index 2fc981f23c83..479cb4e37d9e 100644 --- a/sys/amd64/amd64/uma_machdep.c +++ b/sys/amd64/amd64/uma_machdep.c @@ -49,16 +49,14 @@ uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int domain, u_int8_t *flags, void *va; *flags = UMA_SLAB_PRIV; - m = vm_page_alloc_domain(NULL, 0, domain, - malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); + m = vm_page_alloc_noobj_domain(domain, malloc2vm_flags(wait) | + VM_ALLOC_WIRED); if (m == NULL) return (NULL); pa = m->phys_addr; if ((wait & M_NODUMP) == 0) dump_add_page(pa); va = (void *)PHYS_TO_DMAP(pa); - if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) - pagezero(va); return (va); } diff --git a/sys/arm/arm/pmap-v6.c b/sys/arm/arm/pmap-v6.c index f596ace35ba7..51438274f1ff 100644 --- a/sys/arm/arm/pmap-v6.c +++ b/sys/arm/arm/pmap-v6.c @@ -2069,12 +2069,12 @@ pmap_growkernel(vm_offset_t addr) /* * Install new PT2s page into kernel PT2TAB. */ - m = vm_page_alloc(NULL, - pte1_index(kernel_vm_end) & ~PT2PG_MASK, - VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | + m = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED | VM_ALLOC_ZERO); if (m == NULL) panic("%s: no memory to grow kernel", __func__); + m->pindex = pte1_index(kernel_vm_end) & ~PT2PG_MASK; + /* * QQQ: To link all new L2 page tables from L1 page * table now and so pmap_kenter_pte1() them @@ -2488,8 +2488,7 @@ _pmap_allocpte2(pmap_t pmap, vm_offset_t va, u_int flags) /* * Install new PT2s page into pmap PT2TAB. */ - m = vm_page_alloc(NULL, pte1_idx & ~PT2PG_MASK, - VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO); + m = vm_page_alloc_noobj(VM_ALLOC_WIRED | VM_ALLOC_ZERO); if (m == NULL) { if ((flags & PMAP_ENTER_NOSLEEP) == 0) { PMAP_UNLOCK(pmap); @@ -2505,6 +2504,7 @@ _pmap_allocpte2(pmap_t pmap, vm_offset_t va, u_int flags) */ return (NULL); } + m->pindex = pte1_idx & ~PT2PG_MASK; pmap->pm_stats.resident_count++; pt2pg_pa = pmap_pt2pg_init(pmap, va, m); } else { @@ -3062,8 +3062,8 @@ retry: * global lock. If "pv_vafree" is currently non-empty, it will * remain non-empty until pmap_pte2list_alloc() completes. */ - if (pv_vafree == 0 || (m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | - VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) { + if (pv_vafree == 0 || + (m = vm_page_alloc_noobj(VM_ALLOC_WIRED)) == NULL) { if (try) { pv_entry_count--; PV_STAT(pc_chunk_tryfail++); @@ -3711,9 +3711,8 @@ pmap_demote_pte1(pmap_t pmap, pt1_entry_t *pte1p, vm_offset_t va) * "failure" if the mapping was never accessed or the * allocation of the new page table page fails. */ - if ((opte1 & PTE1_A) == 0 || (m = vm_page_alloc(NULL, - pte1_index(va) & ~PT2PG_MASK, VM_ALLOC_NOOBJ | - VM_ALLOC_NORMAL | VM_ALLOC_WIRED)) == NULL) { + if ((opte1 & PTE1_A) == 0 || + (m = vm_page_alloc_noobj(VM_ALLOC_WIRED)) == NULL) { SLIST_INIT(&free); pmap_remove_pte1(pmap, pte1p, pte1_trunc(va), &free); vm_page_free_pages_toq(&free, false); @@ -3721,6 +3720,7 @@ pmap_demote_pte1(pmap_t pmap, pt1_entry_t *pte1p, vm_offset_t va) __func__, va, pmap); return (FALSE); } + m->pindex = pte1_index(va) & ~PT2PG_MASK; if (va < VM_MAXUSER_ADDRESS) pmap->pm_stats.resident_count++; diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 9fbd473abe3a..ab62ca2934f0 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -1766,16 +1766,11 @@ pmap_pinit_stage(pmap_t pmap, enum pmap_stage stage, int levels) /* * allocate the l0 page */ - while ((m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | - VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) - vm_wait(NULL); - + m = vm_page_alloc_noobj(VM_ALLOC_WAITOK | VM_ALLOC_WIRED | + VM_ALLOC_ZERO); pmap->pm_l0_paddr = VM_PAGE_TO_PHYS(m); pmap->pm_l0 = (pd_entry_t *)PHYS_TO_DMAP(pmap->pm_l0_paddr); - if ((m->flags & PG_ZERO) == 0) - pagezero(pmap->pm_l0); - pmap->pm_root.rt_root = 0; bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); pmap->pm_cookie = COOKIE_FROM(-1, INT_MAX); @@ -1841,8 +1836,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp) /* * Allocate a page table page. */ - if ((m = vm_page_alloc(NULL, ptepindex, VM_ALLOC_NOOBJ | - VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) { + if ((m = vm_page_alloc_noobj(VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) { if (lockp != NULL) { RELEASE_PV_LIST_LOCK(lockp); PMAP_UNLOCK(pmap); @@ -1856,8 +1850,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp) */ return (NULL); } - if ((m->flags & PG_ZERO) == 0) - pmap_zero_page(m); + m->pindex = ptepindex; /* * Because of AArch64's weak memory consistency model, we must have a @@ -2191,13 +2184,11 @@ pmap_growkernel(vm_offset_t addr) l1 = pmap_l0_to_l1(l0, kernel_vm_end); if (pmap_load(l1) == 0) { /* We need a new PDP entry */ - nkpg = vm_page_alloc(NULL, kernel_vm_end >> L1_SHIFT, - VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | + nkpg = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED | VM_ALLOC_ZERO); if (nkpg == NULL) panic("pmap_growkernel: no memory to grow kernel"); - if ((nkpg->flags & PG_ZERO) == 0) - pmap_zero_page(nkpg); + nkpg->pindex = kernel_vm_end >> L1_SHIFT; /* See the dmb() in _pmap_alloc_l3(). */ dmb(ishst); paddr = VM_PAGE_TO_PHYS(nkpg); @@ -2214,13 +2205,11 @@ pmap_growkernel(vm_offset_t addr) continue; } - nkpg = vm_page_alloc(NULL, kernel_vm_end >> L2_SHIFT, - VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | + nkpg = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED | VM_ALLOC_ZERO); if (nkpg == NULL) panic("pmap_growkernel: no memory to grow kernel"); - if ((nkpg->flags & PG_ZERO) == 0) - pmap_zero_page(nkpg); + nkpg->pindex = kernel_vm_end >> L2_SHIFT; /* See the dmb() in _pmap_alloc_l3(). */ dmb(ishst); paddr = VM_PAGE_TO_PHYS(nkpg); @@ -2565,8 +2554,7 @@ retry: } } /* No free items, allocate another chunk */ - m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | - VM_ALLOC_WIRED); + m = vm_page_alloc_noobj(VM_ALLOC_WIRED); if (m == NULL) { if (lockp == NULL) { PV_STAT(pc_chunk_tryfail++); @@ -2631,8 +2619,7 @@ retry: break; } for (reclaimed = false; avail < needed; avail += _NPCPV) { - m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | - VM_ALLOC_WIRED); + m = vm_page_alloc_noobj(VM_ALLOC_WIRED); if (m == NULL) { m = reclaim_pv_chunk(pmap, lockp); if (m == NULL) @@ -6148,8 +6135,8 @@ pmap_demote_l1(pmap_t pmap, pt_entry_t *l1, vm_offset_t va) return (NULL); } - if ((ml2 = vm_page_alloc(NULL, 0, VM_ALLOC_INTERRUPT | - VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) { + if ((ml2 = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED)) == + NULL) { CTR2(KTR_PMAP, "pmap_demote_l1: failure for va %#lx" " in pmap %p", va, pmap); l2 = NULL; @@ -6282,9 +6269,9 @@ pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_offset_t va, * priority (VM_ALLOC_INTERRUPT). Otherwise, the * priority is normal. */ - ml3 = vm_page_alloc(NULL, pmap_l2_pindex(va), - (VIRT_IN_DMAP(va) ? VM_ALLOC_INTERRUPT : VM_ALLOC_NORMAL) | - VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); + ml3 = vm_page_alloc_noobj( + (VIRT_IN_DMAP(va) ? VM_ALLOC_INTERRUPT : 0) | + VM_ALLOC_WIRED); /* * If the allocation of the new page table page fails, @@ -6296,6 +6283,7 @@ pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_offset_t va, " in pmap %p", va, pmap); goto fail; } + ml3->pindex = pmap_l2_pindex(va); if (!ADDR_IS_KERNEL(va)) { ml3->ref_count = NL3PG; diff --git a/sys/arm64/arm64/uma_machdep.c b/sys/arm64/arm64/uma_machdep.c index 3ef3dd3cc9e9..d1c656a3b9f1 100644 --- a/sys/arm64/arm64/uma_machdep.c +++ b/sys/arm64/arm64/uma_machdep.c @@ -47,16 +47,14 @@ uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int domain, u_int8_t *flags, void *va; *flags = UMA_SLAB_PRIV; - m = vm_page_alloc_domain(NULL, 0, domain, - malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); + m = vm_page_alloc_noobj_domain(domain, malloc2vm_flags(wait) | + VM_ALLOC_WIRED); if (m == NULL) return (NULL); pa = m->phys_addr; if ((wait & M_NODUMP) == 0) dump_add_page(pa); va = (void *)PHYS_TO_DMAP(pa); - if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) - pagezero(va); return (va); } diff --git a/sys/arm64/iommu/iommu_pmap.c b/sys/arm64/iommu/iommu_pmap.c index 354c213569ff..7ea8a7ee93a3 100644 --- a/sys/arm64/iommu/iommu_pmap.c +++ b/sys/arm64/iommu/iommu_pmap.c @@ -387,16 +387,11 @@ iommu_pmap_pinit_levels(pmap_t pmap, int levels) /* * allocate the l0 page */ - while ((m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | - VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) - vm_wait(NULL); - + m = vm_page_alloc_noobj(VM_ALLOC_WAITOK | VM_ALLOC_WIRED | + VM_ALLOC_ZERO); pmap->pm_l0_paddr = VM_PAGE_TO_PHYS(m); pmap->pm_l0 = (pd_entry_t *)PHYS_TO_DMAP(pmap->pm_l0_paddr); - if ((m->flags & PG_ZERO) == 0) - pagezero(pmap->pm_l0); - pmap->pm_root.rt_root = 0; bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); @@ -446,16 +441,14 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex) /* * Allocate a page table page. */ - if ((m = vm_page_alloc(NULL, ptepindex, VM_ALLOC_NOOBJ | - VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) { + if ((m = vm_page_alloc_noobj(VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) { /* * Indicate the need to retry. While waiting, the page table * page may have been allocated. */ return (NULL); } - if ((m->flags & PG_ZERO) == 0) - pmap_zero_page(m); + m->pindex = ptepindex; /* * Because of AArch64's weak memory consistency model, we must have a diff --git a/sys/compat/linuxkpi/common/src/linux_page.c b/sys/compat/linuxkpi/common/src/linux_page.c index 8da4736ab7d5..f712c0c155a4 100644 --- a/sys/compat/linuxkpi/common/src/linux_page.c +++ b/sys/compat/linuxkpi/common/src/linux_page.c @@ -97,7 +97,7 @@ linux_alloc_pages(gfp_t flags, unsigned int order) if ((flags & M_ZERO) != 0) req |= VM_ALLOC_ZERO; if (order == 0 && (flags & GFP_DMA32) == 0) { - page = vm_page_alloc(NULL, 0, req); + page = vm_page_alloc_noobj(req); if (page == NULL) return (NULL); } else { diff --git a/sys/dev/drm2/ttm/ttm_page_alloc.c b/sys/dev/drm2/ttm/ttm_page_alloc.c index fbb830405de0..b35a06520e07 100644 --- a/sys/dev/drm2/ttm/ttm_page_alloc.c +++ b/sys/dev/drm2/ttm/ttm_page_alloc.c @@ -178,12 +178,7 @@ ttm_vm_page_alloc_any(int req, vm_memattr_t memattr) { vm_page_t p; - while (1) { - p = vm_page_alloc(NULL, 0, req); - if (p != NULL) - break; - vm_wait(NULL); - } + p = vm_page_alloc_noobj(req | VM_ALLOC_WAITOK); pmap_page_set_memattr(p, memattr); return (p); } diff --git a/sys/dev/ti/if_ti.c b/sys/dev/ti/if_ti.c index 9871212d6379..e8b4eb537883 100644 --- a/sys/dev/ti/if_ti.c +++ b/sys/dev/ti/if_ti.c @@ -1609,8 +1609,7 @@ ti_newbuf_jumbo(struct ti_softc *sc, int idx, struct mbuf *m_old) "failed -- packet dropped!\n"); goto nobufs; } - frame = vm_page_alloc(NULL, 0, - VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | + frame = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED); if (frame == NULL) { device_printf(sc->ti_dev, "buffer allocation " diff --git a/sys/dev/virtio/balloon/virtio_balloon.c b/sys/dev/virtio/balloon/virtio_balloon.c index 3e2d967dd9af..bf4e5cf916f7 100644 --- a/sys/dev/virtio/balloon/virtio_balloon.c +++ b/sys/dev/virtio/balloon/virtio_balloon.c @@ -460,8 +460,7 @@ vtballoon_alloc_page(struct vtballoon_softc *sc) { vm_page_t m; - m = vm_page_alloc(NULL, 0, - VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_NODUMP); + m = vm_page_alloc_noobj(VM_ALLOC_NODUMP); if (m != NULL) sc->vtballoon_current_npages++; diff --git a/sys/dev/xen/balloon/balloon.c b/sys/dev/xen/balloon/balloon.c index 01d75204f5bf..007fada24259 100644 --- a/sys/dev/xen/balloon/balloon.c +++ b/sys/dev/xen/balloon/balloon.c @@ -228,25 +228,18 @@ decrease_reservation(unsigned long nr_pages) nr_pages = nitems(frame_list); for (i = 0; i < nr_pages; i++) { - if ((page = vm_page_alloc(NULL, 0, - VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | - VM_ALLOC_ZERO)) == NULL) { + /* + * Zero the page, or else we might be leaking important data to + * other domains on the same host. Xen doesn't scrub ballooned + * out memory pages, the guest is in charge of making sure that + * no information is leaked. + */ + if ((page = vm_page_alloc_noobj(VM_ALLOC_ZERO)) == NULL) { nr_pages = i; need_sleep = 1; break; } - if ((page->flags & PG_ZERO) == 0) { - /* - * Zero the page, or else we might be leaking - * important data to other domains on the same - * host. Xen doesn't scrub ballooned out memory - * pages, the guest is in charge of making - * sure that no information is leaked. - */ - pmap_zero_page(page); - } - frame_list[i] = (VM_PAGE_TO_PHYS(page) >> PAGE_SHIFT); TAILQ_INSERT_HEAD(&ballooned_pages, page, plinks.q); diff --git a/sys/dev/xen/gntdev/gntdev.c b/sys/dev/xen/gntdev/gntdev.c index 8249eaba8bcc..0c89133ca1b0 100644 --- a/sys/dev/xen/gntdev/gntdev.c +++ b/sys/dev/xen/gntdev/gntdev.c @@ -368,20 +368,13 @@ gntdev_alloc_gref(struct ioctl_gntdev_alloc_gref *arg) grefs[i].file_index = file_offset + i * PAGE_SIZE; grefs[i].gref_id = GRANT_REF_INVALID; grefs[i].notify = NULL; - grefs[i].page = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL - | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO); + grefs[i].page = vm_page_alloc_noobj(VM_ALLOC_WIRED | + VM_ALLOC_ZERO); if (grefs[i].page == NULL) { log(LOG_ERR, "Page allocation failed."); error = ENOMEM; break; } - if ((grefs[i].page->flags & PG_ZERO) == 0) { - /* - * Zero the allocated page, as we don't want to - * leak our memory to other domains. - */ - pmap_zero_page(grefs[i].page); - } grefs[i].page->valid = VM_PAGE_BITS_ALL; error = gnttab_grant_foreign_access(arg->domid, diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 73ce2afefd20..98f1f3d642b3 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -4913,13 +4913,8 @@ nfsm_add_ext_pgs(struct mbuf *m, int maxextsiz, int *bextpg) *bextpg = 0; m->m_next = mp; } else { - do { - pg = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | - VM_ALLOC_NOOBJ | VM_ALLOC_NODUMP | - VM_ALLOC_WIRED); - if (pg == NULL) - vm_wait(NULL); - } while (pg == NULL); + pg = vm_page_alloc_noobj(VM_ALLOC_WAITOK | VM_ALLOC_NODUMP | + VM_ALLOC_WIRED); m->m_epg_pa[m->m_epg_npgs] = VM_PAGE_TO_PHYS(pg); *bextpg = m->m_epg_npgs; m->m_epg_npgs++; diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index fa0df1c37261..35ce9be88405 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -8920,13 +8920,8 @@ nfsm_split(struct mbuf *mp, uint64_t xfer) * page. */ if (left < plen) { - do { - pg = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | - VM_ALLOC_NOOBJ | VM_ALLOC_NODUMP | - VM_ALLOC_WIRED); - if (pg == NULL) - vm_wait(NULL); - } while (pg == NULL); + pg = vm_page_alloc_noobj(VM_ALLOC_WAITOK | VM_ALLOC_NODUMP | + VM_ALLOC_WIRED); m2->m_epg_pa[0] = VM_PAGE_TO_PHYS(pg); m2->m_epg_npgs = 1; diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index ffd41304be43..62fcbcd90b0b 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -2057,7 +2057,6 @@ __CONCAT(PMTYPE, pinit0)(pmap_t pmap) static int __CONCAT(PMTYPE, pinit)(pmap_t pmap) { - vm_page_t m; int i; /* @@ -2085,11 +2084,10 @@ __CONCAT(PMTYPE, pinit)(pmap_t pmap) * allocate the page directory page(s) */ for (i = 0; i < NPGPTD; i++) { - m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | - VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_WAITOK); - pmap->pm_ptdpg[i] = m; + pmap->pm_ptdpg[i] = vm_page_alloc_noobj(VM_ALLOC_WIRED | + VM_ALLOC_ZERO | VM_ALLOC_WAITOK); #ifdef PMAP_PAE_COMP - pmap->pm_pdpt[i] = VM_PAGE_TO_PHYS(m) | PG_V; + pmap->pm_pdpt[i] = VM_PAGE_TO_PHYS(pmap->pm_ptdpg[i]) | PG_V; #endif } @@ -2103,10 +2101,6 @@ __CONCAT(PMTYPE, pinit)(pmap_t pmap) } #endif - for (i = 0; i < NPGPTD; i++) - if ((pmap->pm_ptdpg[i]->flags & PG_ZERO) == 0) - pagezero(pmap->pm_pdir + (i * NPDEPG)); - /* Install the trampoline mapping. */ pmap->pm_pdir[TRPTDI] = PTD[TRPTDI]; @@ -2130,8 +2124,7 @@ _pmap_allocpte(pmap_t pmap, u_int ptepindex, u_int flags) /* * Allocate a page table page. */ - if ((m = vm_page_alloc(NULL, ptepindex, VM_ALLOC_NOOBJ | - VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) { + if ((m = vm_page_alloc_noobj(VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) { if ((flags & PMAP_ENTER_NOSLEEP) == 0) { PMAP_UNLOCK(pmap); rw_wunlock(&pvh_global_lock); @@ -2146,8 +2139,7 @@ _pmap_allocpte(pmap_t pmap, u_int ptepindex, u_int flags) */ return (NULL); } - if ((m->flags & PG_ZERO) == 0) - pmap_zero_page(m); + m->pindex = ptepindex; /* * Map the pagetable page into the process address space, if @@ -2271,16 +2263,13 @@ __CONCAT(PMTYPE, growkernel)(vm_offset_t addr) continue; } - nkpg = vm_page_alloc(NULL, kernel_vm_end >> PDRSHIFT, - VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | + nkpg = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED | VM_ALLOC_ZERO); if (nkpg == NULL) panic("pmap_growkernel: no memory to grow kernel"); - + nkpg->pindex = kernel_vm_end >> PDRSHIFT; nkpt++; - if ((nkpg->flags & PG_ZERO) == 0) - pmap_zero_page(nkpg); ptppaddr = VM_PAGE_TO_PHYS(nkpg); newpdir = (pd_entry_t) (ptppaddr | PG_V | PG_RW | PG_A | PG_M); pdir_pde(KPTD, kernel_vm_end) = newpdir; @@ -2575,8 +2564,8 @@ retry: * global lock. If "pv_vafree" is currently non-empty, it will * remain non-empty until pmap_ptelist_alloc() completes. */ - if (pv_vafree == 0 || (m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | - VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) { + if (pv_vafree == 0 || + (m = vm_page_alloc_noobj(VM_ALLOC_WIRED)) == NULL) { if (try) { pv_entry_count--; PV_STAT(pc_chunk_tryfail++); @@ -2808,9 +2797,8 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va) * "failure" if the mapping was never accessed or the * allocation of the new page table page fails. */ - if ((oldpde & PG_A) == 0 || (mpte = vm_page_alloc(NULL, - va >> PDRSHIFT, VM_ALLOC_NOOBJ | VM_ALLOC_NORMAL | - VM_ALLOC_WIRED)) == NULL) { + if ((oldpde & PG_A) == 0 || + (mpte = vm_page_alloc_noobj(VM_ALLOC_WIRED)) == NULL) { SLIST_INIT(&free); sva = trunc_4mpage(va); pmap_remove_pde(pmap, pde, sva, &free); @@ -2821,6 +2809,7 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va) " in pmap %p", va, pmap); return (FALSE); } + mpte->pindex = va >> PDRSHIFT; if (pmap != kernel_pmap) { mpte->ref_count = NPTEPG; pmap->pm_stats.resident_count++; @@ -5914,8 +5903,7 @@ pmap_trm_import(void *unused __unused, vmem_size_t size, int flags, prev_addr += trm_guard; trm_pte = PTmap + atop(prev_addr); for (af = prev_addr; af < addr; af += PAGE_SIZE) { - m = vm_page_alloc(NULL, 0, VM_ALLOC_NOOBJ | VM_ALLOC_NOBUSY | - VM_ALLOC_NORMAL | VM_ALLOC_WIRED | VM_ALLOC_WAITOK); + m = vm_page_alloc_noobj(VM_ALLOC_WIRED | VM_ALLOC_WAITOK); pte_store(&trm_pte[atop(af - prev_addr)], VM_PAGE_TO_PHYS(m) | PG_M | PG_A | PG_RW | PG_V | pgeflag | pmap_cache_bits(kernel_pmap, VM_MEMATTR_DEFAULT, FALSE)); @@ -5934,10 +5922,8 @@ pmap_init_trm(void) trm_guard = 0; pmap_trm_arena = vmem_create("i386trampoline", 0, 0, 1, 0, M_WAITOK); vmem_set_import(pmap_trm_arena, pmap_trm_import, NULL, NULL, PAGE_SIZE); - pd_m = vm_page_alloc(NULL, 0, VM_ALLOC_NOOBJ | VM_ALLOC_NOBUSY | - VM_ALLOC_NORMAL | VM_ALLOC_WIRED | VM_ALLOC_WAITOK | VM_ALLOC_ZERO); - if ((pd_m->flags & PG_ZERO) == 0) - pmap_zero_page(pd_m); + pd_m = vm_page_alloc_noobj(VM_ALLOC_WIRED | VM_ALLOC_WAITOK | + VM_ALLOC_ZERO); PTD[TRPTDI] = VM_PAGE_TO_PHYS(pd_m) | PG_M | PG_A | PG_RW | PG_V | pmap_cache_bits(kernel_pmap, VM_MEMATTR_DEFAULT, TRUE); } diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c index 36316f2bc3ff..d1f2fd2bd9e4 100644 --- a/sys/kern/kern_mbuf.c +++ b/sys/kern/kern_mbuf.c @@ -1624,8 +1624,8 @@ mb_alloc_ext_plus_pages(int len, int how) npgs = howmany(len, PAGE_SIZE); for (i = 0; i < npgs; i++) { do { - pg = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | - VM_ALLOC_NOOBJ | VM_ALLOC_NODUMP | VM_ALLOC_WIRED); + pg = vm_page_alloc_noobj(VM_ALLOC_NODUMP | + VM_ALLOC_WIRED); if (pg == NULL) { if (how == M_NOWAIT) { m->m_epg_npgs = i; diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index bde9fca97f50..f6179592fb11 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -2101,12 +2101,8 @@ ktls_encrypt_record(struct ktls_wq *wq, struct mbuf *m, } else { off = m->m_epg_1st_off; for (i = 0; i < m->m_epg_npgs; i++, off = 0) { - do { - pg = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | - VM_ALLOC_NOOBJ | VM_ALLOC_NODUMP | - VM_ALLOC_WIRED | VM_ALLOC_WAITFAIL); - } while (pg == NULL); - + pg = vm_page_alloc_noobj(VM_ALLOC_NODUMP | + VM_ALLOC_WIRED | VM_ALLOC_WAITOK); len = m_epg_pagelen(m, i, off); state->parray[i] = VM_PAGE_TO_PHYS(pg); state->dst_iov[i].iov_base = diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 0f1a0c5e4e0c..e0793a16d76f 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1767,8 +1767,7 @@ m_uiotombuf_nomap(struct uio *uio, int how, int len, int maxseg, int flags) vm_page_t pg_array[MBUF_PEXT_MAX_PGS]; int error, length, i, needed; ssize_t total; - int pflags = malloc2vm_flags(how) | VM_ALLOC_NOOBJ | VM_ALLOC_NODUMP | - VM_ALLOC_WIRED; + int pflags = malloc2vm_flags(how) | VM_ALLOC_NODUMP | VM_ALLOC_WIRED; MPASS((flags & M_PKTHDR) == 0); MPASS((how & M_ZERO) == 0); @@ -1816,7 +1815,7 @@ m_uiotombuf_nomap(struct uio *uio, int how, int len, int maxseg, int flags) needed = length = MIN(maxseg, total); for (i = 0; needed > 0; i++, needed -= PAGE_SIZE) { retry_page: - pg_array[i] = vm_page_alloc(NULL, 0, pflags); + pg_array[i] = vm_page_alloc_noobj(pflags); if (pg_array[i] == NULL) { if (how & M_NOWAIT) { goto failed; diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index e234bf2d6563..352c341d05f7 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -4926,9 +4926,8 @@ vm_hold_load_pages(struct buf *bp, vm_offset_t from, vm_offset_t to) * could interfere with paging I/O, no matter which * process we are. */ - p = vm_page_alloc(NULL, 0, VM_ALLOC_SYSTEM | VM_ALLOC_NOOBJ | - VM_ALLOC_WIRED | VM_ALLOC_COUNT((to - pg) >> PAGE_SHIFT) | - VM_ALLOC_WAITOK); + p = vm_page_alloc_noobj(VM_ALLOC_SYSTEM | VM_ALLOC_WIRED | + VM_ALLOC_COUNT((to - pg) >> PAGE_SHIFT) | VM_ALLOC_WAITOK); pmap_qenter(pg, &p, 1); bp->b_pages[index] = p; } diff --git a/sys/mips/mips/pmap.c b/sys/mips/mips/pmap.c index d459bbeab1b2..a41614c5457b 100644 --- a/sys/mips/mips/pmap.c +++ b/sys/mips/mips/pmap.c @@ -1115,10 +1115,6 @@ pmap_alloc_direct_page(unsigned int index, int req) VM_ALLOC_ZERO); if (m == NULL) return (NULL); - - if ((m->flags & PG_ZERO) == 0) - pmap_zero_page(m); - m->pindex = index; return (m); } diff --git a/sys/mips/mips/uma_machdep.c b/sys/mips/mips/uma_machdep.c index 5b57447edd6a..321804d634d5 100644 --- a/sys/mips/mips/uma_machdep.c +++ b/sys/mips/mips/uma_machdep.c @@ -75,8 +75,6 @@ uma_small_alloc(uma_zone_t zone, vm_size_t bytes, int domain, u_int8_t *flags, if ((wait & M_NODUMP) == 0) dump_add_page(pa); va = (void *)MIPS_PHYS_TO_DIRECT(pa); - if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) - bzero(va, PAGE_SIZE); return (va); } diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c index 55147d47b2bf..2a9318446c0f 100644 --- a/sys/powerpc/aim/mmu_oea64.c +++ b/sys/powerpc/aim/mmu_oea64.c @@ -1915,8 +1915,8 @@ moea64_uma_page_alloc(uma_zone_t zone, vm_size_t bytes, int domain, *flags = UMA_SLAB_PRIV; needed_lock = !PMAP_LOCKED(kernel_pmap); - m = vm_page_alloc_domain(NULL, 0, domain, - malloc2vm_flags(wait) | VM_ALLOC_WIRED | VM_ALLOC_NOOBJ); + m = vm_page_alloc_noobj_domain(domain, malloc2vm_flags(wait) | + VM_ALLOC_WIRED); if (m == NULL) return (NULL); @@ -1938,9 +1938,6 @@ moea64_uma_page_alloc(uma_zone_t zone, vm_size_t bytes, int domain, if (needed_lock) PMAP_UNLOCK(kernel_pmap); - if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) - bzero((void *)va, PAGE_SIZE); - return (void *)va; } diff --git a/sys/powerpc/aim/mmu_radix.c b/sys/powerpc/aim/mmu_radix.c index ca1a4d2f4797..d29ca730d7d6 100644 --- a/sys/powerpc/aim/mmu_radix.c +++ b/sys/powerpc/aim/mmu_radix.c @@ -1214,8 +1214,7 @@ retry: break; } for (reclaimed = false; avail < needed; avail += _NPCPV) { - m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | - VM_ALLOC_WIRED); + m = vm_page_alloc_noobj(VM_ALLOC_WIRED); if (m == NULL) { m = reclaim_pv_chunk(pmap, lockp); if (m == NULL) @@ -1637,8 +1636,7 @@ retry: } } /* No free items, allocate another chunk */ - m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | - VM_ALLOC_WIRED); + m = vm_page_alloc_noobj(VM_ALLOC_WIRED); if (m == NULL) { if (lockp == NULL) { PV_STAT(pc_chunk_tryfail++); @@ -3529,13 +3527,11 @@ mmu_radix_growkernel(vm_offset_t addr) l2e = pmap_pml2e(kernel_pmap, kernel_vm_end); if ((be64toh(*l2e) & PG_V) == 0) { /* We need a new PDP entry */ - nkpg = vm_page_alloc(NULL, kernel_vm_end >> L2_PAGE_SIZE_SHIFT, - VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | + nkpg = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED | VM_ALLOC_ZERO); if (nkpg == NULL) panic("pmap_growkernel: no memory to grow kernel"); - if ((nkpg->flags & PG_ZERO) == 0) - mmu_radix_zero_page(nkpg); + nkpg->pindex = kernel_vm_end >> L2_PAGE_SIZE_SHIFT; paddr = VM_PAGE_TO_PHYS(nkpg); pde_store(l2e, paddr); continue; /* try again */ @@ -3550,13 +3546,11 @@ mmu_radix_growkernel(vm_offset_t addr) continue; } - nkpg = vm_page_alloc(NULL, pmap_l3e_pindex(kernel_vm_end), - VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | + nkpg = vm_page_alloc_noobj(VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED | VM_ALLOC_ZERO); if (nkpg == NULL) panic("pmap_growkernel: no memory to grow kernel"); - if ((nkpg->flags & PG_ZERO) == 0) - mmu_radix_zero_page(nkpg); + nkpg->pindex = pmap_l3e_pindex(kernel_vm_end); paddr = VM_PAGE_TO_PHYS(nkpg); pde_store(l3e, paddr); @@ -4243,8 +4237,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp) /* * Allocate a page table page. */ - if ((m = vm_page_alloc(NULL, ptepindex, VM_ALLOC_NOOBJ | - VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) { + if ((m = vm_page_alloc_noobj(VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) { if (lockp != NULL) { RELEASE_PV_LIST_LOCK(lockp); PMAP_UNLOCK(pmap); @@ -4257,8 +4250,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp) */ return (NULL); } - if ((m->flags & PG_ZERO) == 0) - mmu_radix_zero_page(m); + m->pindex = ptepindex; /* * Map the pagetable page into the process address space, if @@ -4915,10 +4907,9 @@ pmap_demote_l3e_locked(pmap_t pmap, pml3_entry_t *l3e, vm_offset_t va, * is the only part of the kernel address space that must be * handled here. */ - if ((oldpde & PG_A) == 0 || (mpte = vm_page_alloc(NULL, - pmap_l3e_pindex(va), (va >= DMAP_MIN_ADDRESS && va < - DMAP_MAX_ADDRESS ? VM_ALLOC_INTERRUPT : VM_ALLOC_NORMAL) | - VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) { *** 361 LINES SKIPPED *** From nobody Wed Oct 20 01:23:18 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AB42D180FC19; Wed, 20 Oct 2021 01:23:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HYtCp4pvgz3lbH; Wed, 20 Oct 2021 01:23: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 79B751EA31; Wed, 20 Oct 2021 01:23: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 19K1NI71095518; Wed, 20 Oct 2021 01:23:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K1NIGI095517; Wed, 20 Oct 2021 01:23:18 GMT (envelope-from git) Date: Wed, 20 Oct 2021 01:23:18 GMT Message-Id: <202110200123.19K1NIGI095517@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: 92db9f3bb762 - main - Introduce vm_page_alloc_noobj_contig() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 92db9f3bb7623883231214e74ec38788c3dffc6a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=92db9f3bb7623883231214e74ec38788c3dffc6a commit 92db9f3bb7623883231214e74ec38788c3dffc6a Author: Mark Johnston AuthorDate: 2021-10-20 00:24:21 +0000 Commit: Mark Johnston CommitDate: 2021-10-20 01:22:56 +0000 Introduce vm_page_alloc_noobj_contig() This is the same as vm_page_alloc_noobj(), but allocates physically contiguous runs of memory. For now it is implemented in terms of vm_page_alloc_contig(), with the difference that vm_page_alloc_noobj_contig() implements VM_ALLOC_ZERO by zeroing the page. Reviewed by: alc, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32005 --- sys/vm/vm_page.c | 43 +++++++++++++++++++++++++++++++++++++++++++ sys/vm/vm_page.h | 6 ++++++ 2 files changed, 49 insertions(+) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 0190f67dd7da..6927d7af4409 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -2509,6 +2509,49 @@ vm_page_alloc_noobj_domain(int domain, int req) return (_vm_page_alloc_noobj_domain(domain, VM_NFREELIST, req)); } +vm_page_t +vm_page_alloc_noobj_contig(int req, u_long npages, vm_paddr_t low, + vm_paddr_t high, u_long alignment, vm_paddr_t boundary, + vm_memattr_t memattr) +{ + struct vm_domainset_iter di; + vm_page_t m; + int domain; + + vm_domainset_iter_page_init(&di, NULL, 0, &domain, &req); + do { + m = vm_page_alloc_noobj_contig_domain(domain, req, npages, low, + high, alignment, boundary, memattr); + if (m != NULL) + break; + } while (vm_domainset_iter_page(&di, NULL, &domain) == 0); + + return (m); +} + +vm_page_t +vm_page_alloc_noobj_contig_domain(int domain, int req, u_long npages, + vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, + vm_memattr_t memattr) +{ + vm_page_t m; + u_long i; + + KASSERT((req & (VM_ALLOC_SBUSY | VM_ALLOC_IGN_SBUSY | + VM_ALLOC_NOOBJ)) == 0, + ("%s: invalid req %#x", __func__, req)); + + m = vm_page_alloc_contig_domain(NULL, 0, domain, req | VM_ALLOC_NOOBJ, + npages, low, high, alignment, boundary, memattr); + if (m != NULL && (req & VM_ALLOC_ZERO) != 0) { + for (i = 0; i < npages; i++) { + if ((m[i].flags & PG_ZERO) == 0) + pmap_zero_page(&m[i]); + } + } + return (m); +} + /* * Check a page that has been freshly dequeued from a freelist. */ diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index 600619b00eaf..b31ea0241cc7 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -616,6 +616,12 @@ vm_page_t vm_page_alloc_freelist(int, int); vm_page_t vm_page_alloc_freelist_domain(int, int, int); vm_page_t vm_page_alloc_noobj(int); vm_page_t vm_page_alloc_noobj_domain(int, int); +vm_page_t vm_page_alloc_noobj_contig(int req, u_long npages, vm_paddr_t low, + vm_paddr_t high, u_long alignment, vm_paddr_t boundary, + vm_memattr_t memattr); +vm_page_t vm_page_alloc_noobj_contig_domain(int domain, int req, u_long npages, + vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, + vm_memattr_t memattr); void vm_page_bits_set(vm_page_t m, vm_page_bits_t *bits, vm_page_bits_t set); bool vm_page_blacklist_add(vm_paddr_t pa, bool verbose); vm_page_t vm_page_grab(vm_object_t, vm_pindex_t, int); From nobody Wed Oct 20 01:23:20 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E0587180FB7E; Wed, 20 Oct 2021 01:23: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 4HYtCs6q5Wz3ldN; Wed, 20 Oct 2021 01:23:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDE721E89E; Wed, 20 Oct 2021 01:23:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19K1NKmS095566; Wed, 20 Oct 2021 01:23:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K1NKuT095565; Wed, 20 Oct 2021 01:23:20 GMT (envelope-from git) Date: Wed, 20 Oct 2021 01:23:20 GMT Message-Id: <202110200123.19K1NKuT095565@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: c40cf9bc6271 - main - vm_page: Stop handling VM_ALLOC_NOOBJ in vm_page_alloc_domain_after() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: c40cf9bc62718241d4afdb3ef48a68052cb37b50 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c40cf9bc62718241d4afdb3ef48a68052cb37b50 commit c40cf9bc62718241d4afdb3ef48a68052cb37b50 Author: Mark Johnston AuthorDate: 2021-10-20 00:25:14 +0000 Commit: Mark Johnston CommitDate: 2021-10-20 01:22:56 +0000 vm_page: Stop handling VM_ALLOC_NOOBJ in vm_page_alloc_domain_after() This makes the allocator simpler since it can assume object != NULL. Also modify the function to unconditionally preserve PG_ZERO, so VM_ALLOC_ZERO is effectively ignored (and still must be implemented by the caller for now). Reviewed by: alc, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32033 --- sys/vm/vm_page.c | 104 +++++++++++++++++++++++++++---------------------------- sys/vm/vm_page.h | 8 ++++- 2 files changed, 58 insertions(+), 54 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 0644c1167984..c289bdb6d3da 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -1963,8 +1963,6 @@ vm_page_rename(vm_page_t m, vm_object_t new_object, vm_pindex_t new_pindex) * intends to allocate * VM_ALLOC_NOBUSY do not exclusive busy the page * VM_ALLOC_NODUMP do not include the page in a kernel core dump - * VM_ALLOC_NOOBJ page is not associated with an object and - * should not be exclusive busy * VM_ALLOC_SBUSY shared busy the allocated page * VM_ALLOC_WIRED wire the allocated page * VM_ALLOC_ZERO prefer a zeroed page @@ -1973,8 +1971,8 @@ vm_page_t vm_page_alloc(vm_object_t object, vm_pindex_t pindex, int req) { - return (vm_page_alloc_after(object, pindex, req, object != NULL ? - vm_radix_lookup_le(&object->rtree, pindex) : NULL)); + return (vm_page_alloc_after(object, pindex, req, + vm_radix_lookup_le(&object->rtree, pindex))); } vm_page_t @@ -1983,8 +1981,7 @@ vm_page_alloc_domain(vm_object_t object, vm_pindex_t pindex, int domain, { return (vm_page_alloc_domain_after(object, pindex, domain, req, - object != NULL ? vm_radix_lookup_le(&object->rtree, pindex) : - NULL)); + vm_radix_lookup_le(&object->rtree, pindex))); } /* @@ -2071,24 +2068,24 @@ vm_page_alloc_domain_after(vm_object_t object, vm_pindex_t pindex, int domain, { struct vm_domain *vmd; vm_page_t m; - int flags, pool; + int flags; - KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0) && - (object != NULL || (req & VM_ALLOC_SBUSY) == 0) && - ((req & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) != +#define VPA_FLAGS (VM_ALLOC_CLASS_MASK | VM_ALLOC_WAITFAIL | \ + VM_ALLOC_NOWAIT | VM_ALLOC_NOBUSY | \ + VM_ALLOC_SBUSY | VM_ALLOC_WIRED | \ + VM_ALLOC_NODUMP | VM_ALLOC_ZERO | VM_ALLOC_COUNT_MASK) + KASSERT((req & ~VPA_FLAGS) == 0, + ("invalid request %#x", req)); + KASSERT(((req & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) != (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)), - ("inconsistent object(%p)/req(%x)", object, req)); - KASSERT(object == NULL || (req & VM_ALLOC_WAITOK) == 0, - ("Can't sleep and retry object insertion.")); + ("invalid request %#x", req)); KASSERT(mpred == NULL || mpred->pindex < pindex, ("mpred %p doesn't precede pindex 0x%jx", mpred, (uintmax_t)pindex)); - if (object != NULL) - VM_OBJECT_ASSERT_WLOCKED(object); + VM_OBJECT_ASSERT_WLOCKED(object); flags = 0; m = NULL; - pool = object != NULL ? VM_FREEPOOL_DEFAULT : VM_FREEPOOL_DIRECT; again: #if VM_NRESERVLEVEL > 0 /* @@ -2101,8 +2098,9 @@ again: } #endif vmd = VM_DOMAIN(domain); - if (vmd->vmd_pgcache[pool].zone != NULL) { - m = uma_zalloc(vmd->vmd_pgcache[pool].zone, M_NOWAIT | M_NOVM); + if (vmd->vmd_pgcache[VM_FREEPOOL_DEFAULT].zone != NULL) { + m = uma_zalloc(vmd->vmd_pgcache[VM_FREEPOOL_DEFAULT].zone, + M_NOWAIT | M_NOVM); if (m != NULL) { flags |= PG_PCPU_CACHE; goto found; @@ -2113,7 +2111,7 @@ again: * If not, allocate it from the free page queues. */ vm_domain_free_lock(vmd); - m = vm_phys_alloc_pages(domain, pool, 0); + m = vm_phys_alloc_pages(domain, VM_FREEPOOL_DEFAULT, 0); vm_domain_free_unlock(vmd); if (m == NULL) { vm_domain_freecnt_inc(vmd, 1); @@ -2142,15 +2140,13 @@ found: /* * Initialize the page. Only the PG_ZERO flag is inherited. */ - if ((req & VM_ALLOC_ZERO) != 0) - flags |= (m->flags & PG_ZERO); + flags |= m->flags & PG_ZERO; if ((req & VM_ALLOC_NODUMP) != 0) flags |= PG_NODUMP; m->flags = flags; m->a.flags = 0; - m->oflags = object == NULL || (object->flags & OBJ_UNMANAGED) != 0 ? - VPO_UNMANAGED : 0; - if ((req & (VM_ALLOC_NOBUSY | VM_ALLOC_NOOBJ | VM_ALLOC_SBUSY)) == 0) + m->oflags = (object->flags & OBJ_UNMANAGED) != 0 ? VPO_UNMANAGED : 0; + if ((req & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) == 0) m->busy_lock = VPB_CURTHREAD_EXCLUSIVE; else if ((req & VM_ALLOC_SBUSY) != 0) m->busy_lock = VPB_SHARERS_WORD(1); @@ -2162,31 +2158,28 @@ found: } m->a.act_count = 0; - if (object != NULL) { - if (vm_page_insert_after(m, object, pindex, mpred)) { - if (req & VM_ALLOC_WIRED) { - vm_wire_sub(1); - m->ref_count = 0; - } - KASSERT(m->object == NULL, ("page %p has object", m)); - m->oflags = VPO_UNMANAGED; - m->busy_lock = VPB_UNBUSIED; - /* Don't change PG_ZERO. */ - vm_page_free_toq(m); - if (req & VM_ALLOC_WAITFAIL) { - VM_OBJECT_WUNLOCK(object); - vm_radix_wait(); - VM_OBJECT_WLOCK(object); - } - return (NULL); + if (vm_page_insert_after(m, object, pindex, mpred)) { + if (req & VM_ALLOC_WIRED) { + vm_wire_sub(1); + m->ref_count = 0; + } + KASSERT(m->object == NULL, ("page %p has object", m)); + m->oflags = VPO_UNMANAGED; + m->busy_lock = VPB_UNBUSIED; + /* Don't change PG_ZERO. */ + vm_page_free_toq(m); + if (req & VM_ALLOC_WAITFAIL) { + VM_OBJECT_WUNLOCK(object); + vm_radix_wait(); + VM_OBJECT_WLOCK(object); } + return (NULL); + } - /* Ignore device objects; the pager sets "memattr" for them. */ - if (object->memattr != VM_MEMATTR_DEFAULT && - (object->flags & OBJ_FICTITIOUS) == 0) - pmap_page_set_memattr(m, object->memattr); - } else - m->pindex = pindex; + /* Ignore device objects; the pager sets "memattr" for them. */ + if (object->memattr != VM_MEMATTR_DEFAULT && + (object->flags & OBJ_FICTITIOUS) == 0) + pmap_page_set_memattr(m, object->memattr); return (m); } @@ -2405,9 +2398,12 @@ _vm_page_alloc_noobj_domain(int domain, const int freelist, int req) vm_page_t m; int flags; - KASSERT((req & (VM_ALLOC_SBUSY | VM_ALLOC_IGN_SBUSY | - VM_ALLOC_NOOBJ)) == 0, - ("%s: invalid req %#x", __func__, req)); +#define VPAN_FLAGS (VM_ALLOC_CLASS_MASK | VM_ALLOC_WAITFAIL | \ + VM_ALLOC_NOWAIT | VM_ALLOC_WAITOK | \ + VM_ALLOC_NOBUSY | VM_ALLOC_WIRED | \ + VM_ALLOC_NODUMP | VM_ALLOC_ZERO | VM_ALLOC_COUNT_MASK) + KASSERT((req & ~VPAN_FLAGS) == 0, + ("invalid request %#x", req)); flags = (req & VM_ALLOC_NODUMP) != 0 ? PG_NODUMP : 0; vmd = VM_DOMAIN(domain); @@ -2443,7 +2439,9 @@ found: vm_page_dequeue(m); vm_page_alloc_check(m); - /* Consumers should not rely on a useful default pindex value. */ + /* + * Consumers should not rely on a useful default pindex value. + */ m->pindex = 0xdeadc0dedeadc0de; m->flags = (m->flags & PG_ZERO) | flags; m->a.flags = 0; @@ -4508,7 +4506,7 @@ vm_page_grab_pflags(int allocflags) pflags = allocflags & ~(VM_ALLOC_NOWAIT | VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL | - VM_ALLOC_NOBUSY); + VM_ALLOC_NOBUSY | VM_ALLOC_IGN_SBUSY); if ((allocflags & VM_ALLOC_NOWAIT) == 0) pflags |= VM_ALLOC_WAITFAIL; if ((allocflags & VM_ALLOC_IGN_SBUSY) != 0) @@ -4681,7 +4679,7 @@ vm_page_grab_valid(vm_page_t *mp, vm_object_t object, vm_pindex_t pindex, int al ("vm_page_grab_valid: Invalid flags 0x%X", allocflags)); VM_OBJECT_ASSERT_WLOCKED(object); pflags = allocflags & ~(VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY | - VM_ALLOC_WIRED); + VM_ALLOC_WIRED | VM_ALLOC_IGN_SBUSY); pflags |= VM_ALLOC_WAITFAIL; retrylookup: diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index b31ea0241cc7..140ea7e2fadb 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -549,8 +549,14 @@ vm_page_t PHYS_TO_VM_PAGE(vm_paddr_t pa); #define VM_ALLOC_NODUMP 0x2000 /* (ag) don't include in dump */ #define VM_ALLOC_SBUSY 0x4000 /* (acgp) Shared busy the page */ #define VM_ALLOC_NOWAIT 0x8000 /* (acgnp) Do not sleep */ +#define VM_ALLOC_COUNT_MAX 0xffff #define VM_ALLOC_COUNT_SHIFT 16 -#define VM_ALLOC_COUNT(count) ((count) << VM_ALLOC_COUNT_SHIFT) +#define VM_ALLOC_COUNT_MASK (VM_ALLOC_COUNT(VM_ALLOC_COUNT_MAX)) +#define VM_ALLOC_COUNT(count) ({ \ + KASSERT((count) <= VM_ALLOC_COUNT_MAX, \ + ("%s: invalid VM_ALLOC_COUNT value", __func__)); \ + (count) << VM_ALLOC_COUNT_SHIFT; \ +}) #ifdef M_NOWAIT static inline int From nobody Wed Oct 20 01:23:19 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2CDE5180FD02; Wed, 20 Oct 2021 01:23: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 4HYtCr06v2z3lVH; Wed, 20 Oct 2021 01:23: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 9BCC01EA32; Wed, 20 Oct 2021 01:23: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 19K1NJxe095542; Wed, 20 Oct 2021 01:23:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K1NJ4h095541; Wed, 20 Oct 2021 01:23:19 GMT (envelope-from git) Date: Wed, 20 Oct 2021 01:23:19 GMT Message-Id: <202110200123.19K1NJ4h095541@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: 84c3922243a7 - main - Convert consumers to vm_page_alloc_noobj_contig() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 84c3922243a7b7fd510dcfb100aec59c878c57d0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=84c3922243a7b7fd510dcfb100aec59c878c57d0 commit 84c3922243a7b7fd510dcfb100aec59c878c57d0 Author: Mark Johnston AuthorDate: 2021-10-20 00:25:04 +0000 Commit: Mark Johnston CommitDate: 2021-10-20 01:22:56 +0000 Convert consumers to vm_page_alloc_noobj_contig() Remove now-unneeded page zeroing. No functional change intended. Reviewed by: alc, hselasky, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32006 --- sys/amd64/amd64/mp_machdep.c | 3 +-- sys/amd64/amd64/pmap.c | 28 ++++++---------------------- sys/arm/nvidia/drm2/tegra_bo.c | 12 ++++-------- sys/compat/linuxkpi/common/src/linux_page.c | 17 +++-------------- sys/dev/drm2/ttm/ttm_bo.c | 11 +++++------ sys/dev/drm2/ttm/ttm_page_alloc.c | 6 +++--- sys/kern/uipc_ktls.c | 7 +++---- sys/powerpc/aim/mmu_radix.c | 8 ++++---- sys/powerpc/aim/slb.c | 9 +++------ sys/riscv/riscv/pmap.c | 2 -- sys/vm/uma_core.c | 19 +++++++------------ sys/vm/vm_page.c | 28 ++++++++++++++-------------- 12 files changed, 53 insertions(+), 97 deletions(-) diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index 33defe79c8b9..e954e8cebbb9 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -334,8 +334,7 @@ start_all_aps(void) mtx_init(&ap_boot_mtx, "ap boot", NULL, MTX_SPIN); MPASS(bootMP_size <= PAGE_SIZE); - m_boottramp = vm_page_alloc_contig(NULL, 0, VM_ALLOC_NORMAL | - VM_ALLOC_NOBUSY | VM_ALLOC_NOOBJ, 1, 0, + m_boottramp = vm_page_alloc_noobj_contig(0, 1, 0, (1ULL << 20), /* Trampoline should be below 1M for real mode */ PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); boot_address = VM_PAGE_TO_PHYS(m_boottramp); diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 8d6c81a5459b..f8bb384afdaf 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -2110,14 +2110,8 @@ pmap_init_pat(void) vm_page_t pmap_page_alloc_below_4g(bool zeroed) { - vm_page_t m; - - m = vm_page_alloc_contig(NULL, 0, (zeroed ? VM_ALLOC_ZERO : 0) | - VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY | VM_ALLOC_NOOBJ, - 1, 0, (1ULL << 32), PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); - if (m != NULL && zeroed && (m->flags & PG_ZERO) == 0) - pmap_zero_page(m); - return (m); + return (vm_page_alloc_noobj_contig((zeroed ? VM_ALLOC_ZERO : 0), + 1, 0, (1ULL << 32), PAGE_SIZE, 0, VM_MEMATTR_DEFAULT)); } extern const char la57_trampoline[], la57_trampoline_gdt_desc[], @@ -11411,13 +11405,8 @@ pmap_kasan_enter_alloc_4k(void) static vm_page_t pmap_kasan_enter_alloc_2m(void) { - vm_page_t m; - - m = vm_page_alloc_contig(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | - VM_ALLOC_WIRED, NPTEPG, 0, ~0ul, NBPDR, 0, VM_MEMATTR_DEFAULT); - if (m != NULL) - memset((void *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)), 0, NBPDR); - return (m); + return (vm_page_alloc_noobj_contig(VM_ALLOC_WIRED | VM_ALLOC_ZERO, + NPTEPG, 0, ~0ul, NBPDR, 0, VM_MEMATTR_DEFAULT)); } /* @@ -11479,13 +11468,8 @@ pmap_kmsan_enter_alloc_4k(void) static vm_page_t pmap_kmsan_enter_alloc_2m(void) { - vm_page_t m; - - m = vm_page_alloc_contig(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | - VM_ALLOC_WIRED, NPTEPG, 0, ~0ul, NBPDR, 0, VM_MEMATTR_DEFAULT); - if (m != NULL) - memset((void *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)), 0, NBPDR); - return (m); + return (vm_page_alloc_noobj_contig(VM_ALLOC_ZERO | VM_ALLOC_WIRED, + NPTEPG, 0, ~0ul, NBPDR, 0, VM_MEMATTR_DEFAULT)); } /* diff --git a/sys/arm/nvidia/drm2/tegra_bo.c b/sys/arm/nvidia/drm2/tegra_bo.c index 7479fd8bc8da..be5177973f4f 100644 --- a/sys/arm/nvidia/drm2/tegra_bo.c +++ b/sys/arm/nvidia/drm2/tegra_bo.c @@ -97,21 +97,19 @@ tegra_bo_alloc_contig(size_t npages, u_long alignment, vm_memattr_t memattr, vm_page_t **ret_page) { vm_page_t m; - int pflags, tries, i; + int tries, i; vm_paddr_t low, high, boundary; low = 0; high = -1UL; boundary = 0; - pflags = VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_NOBUSY | - VM_ALLOC_WIRED | VM_ALLOC_ZERO; tries = 0; retry: - m = vm_page_alloc_contig(NULL, 0, pflags, npages, low, high, alignment, - boundary, memattr); + m = vm_page_alloc_noobj_contig(VM_ALLOC_WIRE | VM_ALLOC_ZERO, npages, + low, high, alignment, boundary, memattr); if (m == NULL) { if (tries < 3) { - if (!vm_page_reclaim_contig(pflags, npages, low, high, + if (!vm_page_reclaim_contig(0, npages, low, high, alignment, boundary)) vm_wait(NULL); tries++; @@ -121,8 +119,6 @@ retry: } for (i = 0; i < npages; i++, m++) { - if ((m->flags & PG_ZERO) == 0) - pmap_zero_page(m); m->valid = VM_PAGE_BITS_ALL; (*ret_page)[i] = m; } diff --git a/sys/compat/linuxkpi/common/src/linux_page.c b/sys/compat/linuxkpi/common/src/linux_page.c index f712c0c155a4..3c8bc2bd3c5b 100644 --- a/sys/compat/linuxkpi/common/src/linux_page.c +++ b/sys/compat/linuxkpi/common/src/linux_page.c @@ -92,7 +92,7 @@ linux_alloc_pages(gfp_t flags, unsigned int order) if (PMAP_HAS_DMAP) { unsigned long npages = 1UL << order; - int req = VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_NORMAL; + int req = VM_ALLOC_WIRED; if ((flags & M_ZERO) != 0) req |= VM_ALLOC_ZERO; @@ -104,9 +104,8 @@ linux_alloc_pages(gfp_t flags, unsigned int order) vm_paddr_t pmax = (flags & GFP_DMA32) ? BUS_SPACE_MAXADDR_32BIT : BUS_SPACE_MAXADDR; retry: - page = vm_page_alloc_contig(NULL, 0, req, - npages, 0, pmax, PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); - + page = vm_page_alloc_noobj_contig(req, npages, 0, pmax, + PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); if (page == NULL) { if (flags & M_WAITOK) { if (!vm_page_reclaim_contig(req, @@ -119,16 +118,6 @@ linux_alloc_pages(gfp_t flags, unsigned int order) return (NULL); } } - if (flags & M_ZERO) { - unsigned long x; - - for (x = 0; x != npages; x++) { - vm_page_t pgo = page + x; - - if ((pgo->flags & PG_ZERO) == 0) - pmap_zero_page(pgo); - } - } } else { vm_offset_t vaddr; diff --git a/sys/dev/drm2/ttm/ttm_bo.c b/sys/dev/drm2/ttm/ttm_bo.c index 010afe6d8b3b..d5c11ecff25d 100644 --- a/sys/dev/drm2/ttm/ttm_bo.c +++ b/sys/dev/drm2/ttm/ttm_bo.c @@ -1488,21 +1488,20 @@ int ttm_bo_global_init(struct drm_global_reference *ref) struct ttm_bo_global_ref *bo_ref = container_of(ref, struct ttm_bo_global_ref, ref); struct ttm_bo_global *glob = ref->object; - int req, ret; + int ret; int tries; sx_init(&glob->device_list_mutex, "ttmdlm"); mtx_init(&glob->lru_lock, "ttmlru", NULL, MTX_DEF); glob->mem_glob = bo_ref->mem_glob; - req = VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ; tries = 0; retry: - glob->dummy_read_page = vm_page_alloc_contig(NULL, 0, req, - 1, 0, VM_MAX_ADDRESS, PAGE_SIZE, 0, VM_MEMATTR_UNCACHEABLE); + glob->dummy_read_page = vm_page_alloc_noobj_contig(0, 1, 0, + VM_MAX_ADDRESS, PAGE_SIZE, 0, VM_MEMATTR_UNCACHEABLE); if (unlikely(glob->dummy_read_page == NULL)) { - if (tries < 1 && vm_page_reclaim_contig(req, 1, - 0, VM_MAX_ADDRESS, PAGE_SIZE, 0)) { + if (tries < 1 && vm_page_reclaim_contig(0, 1, 0, + VM_MAX_ADDRESS, PAGE_SIZE, 0)) { tries++; goto retry; } diff --git a/sys/dev/drm2/ttm/ttm_page_alloc.c b/sys/dev/drm2/ttm/ttm_page_alloc.c index b35a06520e07..6fc12cad121f 100644 --- a/sys/dev/drm2/ttm/ttm_page_alloc.c +++ b/sys/dev/drm2/ttm/ttm_page_alloc.c @@ -163,8 +163,8 @@ ttm_vm_page_alloc_dma32(int req, vm_memattr_t memattr) int tries; for (tries = 0; ; tries++) { - p = vm_page_alloc_contig(NULL, 0, req, 1, 0, 0xffffffff, - PAGE_SIZE, 0, memattr); + p = vm_page_alloc_noobj_contig(req, 1, 0, 0xffffffff, PAGE_SIZE, + 0, memattr); if (p != NULL || tries > 2) return (p); if (!vm_page_reclaim_contig(req, 1, 0, 0xffffffff, @@ -191,7 +191,7 @@ ttm_vm_page_alloc(int flags, enum ttm_caching_state cstate) int req; memattr = ttm_caching_state_to_vm(cstate); - req = VM_ALLOC_NORMAL | VM_ALLOC_WIRED | VM_ALLOC_NOOBJ; + req = VM_ALLOC_WIRED; if ((flags & TTM_PAGE_FLAG_ZERO_ALLOC) != 0) req |= VM_ALLOC_ZERO; diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index f6179592fb11..1d3321fd4ff6 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -341,16 +341,15 @@ static int ktls_buffer_import(void *arg, void **store, int count, int domain, int flags) { vm_page_t m; - int i; + int i, req; KASSERT((ktls_maxlen & PAGE_MASK) == 0, ("%s: ktls max length %d is not page size-aligned", __func__, ktls_maxlen)); + req = VM_ALLOC_WIRED | VM_ALLOC_NODUMP | malloc2vm_flags(flags); for (i = 0; i < count; i++) { - m = vm_page_alloc_contig_domain(NULL, 0, domain, - VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | - VM_ALLOC_NODUMP | malloc2vm_flags(flags), + m = vm_page_alloc_noobj_contig_domain(domain, req, atop(ktls_maxlen), 0, ~0ul, PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); if (m == NULL) diff --git a/sys/powerpc/aim/mmu_radix.c b/sys/powerpc/aim/mmu_radix.c index d29ca730d7d6..95c3f5f009e4 100644 --- a/sys/powerpc/aim/mmu_radix.c +++ b/sys/powerpc/aim/mmu_radix.c @@ -3570,14 +3570,14 @@ static int radix_pgd_import(void *arg __unused, void **store, int count, int domain __unused, int flags) { + int req; + req = VM_ALLOC_WIRED | malloc2vm_flags(flags); for (int i = 0; i < count; i++) { - vm_page_t m = vm_page_alloc_contig(NULL, 0, - VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | - VM_ALLOC_ZERO | VM_ALLOC_WAITOK, RADIX_PGD_SIZE/PAGE_SIZE, + vm_page_t m = vm_page_alloc_noobj_contig(req, + RADIX_PGD_SIZE / PAGE_SIZE, 0, (vm_paddr_t)-1, RADIX_PGD_SIZE, L1_PAGE_SIZE, VM_MEMATTR_DEFAULT); - /* XXX zero on alloc here so we don't have to later */ store[i] = (void *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); } return (count); diff --git a/sys/powerpc/aim/slb.c b/sys/powerpc/aim/slb.c index 886e11c9b356..c107fcbcfc43 100644 --- a/sys/powerpc/aim/slb.c +++ b/sys/powerpc/aim/slb.c @@ -500,9 +500,9 @@ slb_uma_real_alloc(uma_zone_t zone, vm_size_t bytes, int domain, realmax = platform_real_maxaddr(); *flags = UMA_SLAB_PRIV; - m = vm_page_alloc_contig_domain(NULL, 0, domain, - malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED, - 1, 0, realmax, PAGE_SIZE, PAGE_SIZE, VM_MEMATTR_DEFAULT); + m = vm_page_alloc_noobj_contig_domain(domain, malloc2vm_flags(wait) | + VM_ALLOC_WIRED, 1, 0, realmax, PAGE_SIZE, PAGE_SIZE, + VM_MEMATTR_DEFAULT); if (m == NULL) return (NULL); @@ -513,9 +513,6 @@ slb_uma_real_alloc(uma_zone_t zone, vm_size_t bytes, int domain, pmap_kenter((vm_offset_t)va, VM_PAGE_TO_PHYS(m)); } - if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) - bzero(va, PAGE_SIZE); - return (va); } diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index e1ff056117eb..9abf75a731f5 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -2757,8 +2757,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, VM_ALLOC_ZERO); if (l3_m == NULL) panic("pmap_enter: l3 pte_m == NULL"); - if ((l3_m->flags & PG_ZERO) == 0) - pmap_zero_page(l3_m); l3_pa = VM_PAGE_TO_PHYS(l3_m); l3_pn = (l3_pa / PAGE_SIZE); diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index a510295b3c65..68553bda2249 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -1885,17 +1885,15 @@ startup_alloc(uma_zone_t zone, vm_size_t bytes, int domain, uint8_t *pflag, { vm_paddr_t pa; vm_page_t m; - void *mem; - int pages; - int i; + int i, pages; pages = howmany(bytes, PAGE_SIZE); KASSERT(pages > 0, ("%s can't reserve 0 pages", __func__)); *pflag = UMA_SLAB_BOOT; - m = vm_page_alloc_contig_domain(NULL, 0, domain, - malloc2vm_flags(wait) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED, pages, - (vm_paddr_t)0, ~(vm_paddr_t)0, 1, 0, VM_MEMATTR_DEFAULT); + m = vm_page_alloc_noobj_contig_domain(domain, malloc2vm_flags(wait) | + VM_ALLOC_WIRED, pages, (vm_paddr_t)0, ~(vm_paddr_t)0, 1, 0, + VM_MEMATTR_DEFAULT); if (m == NULL) return (NULL); @@ -1907,13 +1905,10 @@ startup_alloc(uma_zone_t zone, vm_size_t bytes, int domain, uint8_t *pflag, dump_add_page(pa); #endif } - /* Allocate KVA and indirectly advance bootmem. */ - mem = (void *)pmap_map(&bootmem, m->phys_addr, - m->phys_addr + (pages * PAGE_SIZE), VM_PROT_READ | VM_PROT_WRITE); - if ((wait & M_ZERO) != 0) - bzero(mem, pages * PAGE_SIZE); - return (mem); + /* Allocate KVA and indirectly advance bootmem. */ + return ((void *)pmap_map(&bootmem, m->phys_addr, + m->phys_addr + (pages * PAGE_SIZE), VM_PROT_READ | VM_PROT_WRITE)); } static void diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 6927d7af4409..0644c1167984 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -2883,32 +2883,32 @@ vm_page_reclaim_run(int req_class, int domain, u_long npages, vm_page_t m_run, * "m_run" and "high" only as a last * resort. */ - req = req_class | VM_ALLOC_NOOBJ; + req = req_class; if ((m->flags & PG_NODUMP) != 0) req |= VM_ALLOC_NODUMP; if (trunc_page(high) != ~(vm_paddr_t)PAGE_MASK) { - m_new = vm_page_alloc_contig( - NULL, 0, req, 1, - round_page(high), - ~(vm_paddr_t)0, - PAGE_SIZE, 0, - VM_MEMATTR_DEFAULT); + m_new = + vm_page_alloc_noobj_contig( + req, 1, round_page(high), + ~(vm_paddr_t)0, PAGE_SIZE, + 0, VM_MEMATTR_DEFAULT); } else m_new = NULL; if (m_new == NULL) { pa = VM_PAGE_TO_PHYS(m_run); - m_new = vm_page_alloc_contig( - NULL, 0, req, 1, - 0, pa - 1, PAGE_SIZE, 0, + m_new = + vm_page_alloc_noobj_contig( + req, 1, 0, pa - 1, + PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); } if (m_new == NULL) { pa += ptoa(npages); - m_new = vm_page_alloc_contig( - NULL, 0, req, 1, - pa, high, PAGE_SIZE, 0, - VM_MEMATTR_DEFAULT); + m_new = + vm_page_alloc_noobj_contig( + req, 1, pa, high, PAGE_SIZE, + 0, VM_MEMATTR_DEFAULT); } if (m_new == NULL) { vm_page_xunbusy(m); From nobody Wed Oct 20 01:23:21 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2456F180FC43; Wed, 20 Oct 2021 01:23: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 4HYtCt2Dc6z3ltb; Wed, 20 Oct 2021 01:23: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 D48EF1EB89; Wed, 20 Oct 2021 01:23: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 19K1NLm8095590; Wed, 20 Oct 2021 01:23:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K1NLCG095589; Wed, 20 Oct 2021 01:23:21 GMT (envelope-from git) Date: Wed, 20 Oct 2021 01:23:21 GMT Message-Id: <202110200123.19K1NLCG095589@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: 02fb0585e7b3 - main - vm_page: Drop handling of VM_ALLOC_NOOBJ in vm_page_alloc_contig_domain() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 02fb0585e7b31718b392f62bebe6efd426074793 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=02fb0585e7b31718b392f62bebe6efd426074793 commit 02fb0585e7b31718b392f62bebe6efd426074793 Author: Mark Johnston AuthorDate: 2021-10-20 00:26:09 +0000 Commit: Mark Johnston CommitDate: 2021-10-20 01:22:56 +0000 vm_page: Drop handling of VM_ALLOC_NOOBJ in vm_page_alloc_contig_domain() As in vm_page_alloc_domain_after(), unconditionally preserve PG_ZERO. Implement vm_page_alloc_noobj_contig_domain(). Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32034 --- sys/vm/vm_page.c | 178 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 107 insertions(+), 71 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index c289bdb6d3da..eca5d0801b7f 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -2217,8 +2217,6 @@ found: * optional allocation flags: * VM_ALLOC_NOBUSY do not exclusive busy the page * VM_ALLOC_NODUMP do not include the page in a kernel core dump - * VM_ALLOC_NOOBJ page is not associated with an object and - * should not be exclusive busy * VM_ALLOC_SBUSY shared busy the allocated page * VM_ALLOC_WIRED wire the allocated page * VM_ALLOC_ZERO prefer a zeroed page @@ -2252,28 +2250,21 @@ vm_page_alloc_contig_domain(vm_object_t object, vm_pindex_t pindex, int domain, vm_page_t m, m_ret, mpred; u_int busy_lock, flags, oflags; - mpred = NULL; /* XXX: pacify gcc */ - KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0) && - (object != NULL || (req & VM_ALLOC_SBUSY) == 0) && - ((req & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) != +#define VPAC_FLAGS VPA_FLAGS + KASSERT((req & ~VPAC_FLAGS) == 0, + ("invalid request %#x", req)); + KASSERT(((req & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) != (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)), - ("vm_page_alloc_contig: inconsistent object(%p)/req(%x)", object, - req)); - KASSERT(object == NULL || (req & VM_ALLOC_WAITOK) == 0, - ("Can't sleep and retry object insertion.")); - if (object != NULL) { - VM_OBJECT_ASSERT_WLOCKED(object); - KASSERT((object->flags & OBJ_FICTITIOUS) == 0, - ("vm_page_alloc_contig: object %p has fictitious pages", - object)); - } + ("invalid request %#x", req)); + VM_OBJECT_ASSERT_WLOCKED(object); + KASSERT((object->flags & OBJ_FICTITIOUS) == 0, + ("vm_page_alloc_contig: object %p has fictitious pages", + object)); KASSERT(npages > 0, ("vm_page_alloc_contig: npages is zero")); - if (object != NULL) { - mpred = vm_radix_lookup_le(&object->rtree, pindex); - KASSERT(mpred == NULL || mpred->pindex != pindex, - ("vm_page_alloc_contig: pindex already allocated")); - } + mpred = vm_radix_lookup_le(&object->rtree, pindex); + KASSERT(mpred == NULL || mpred->pindex != pindex, + ("vm_page_alloc_contig: pindex already allocated")); /* * Can we allocate the pages without the number of free pages falling @@ -2325,14 +2316,11 @@ found: /* * Initialize the pages. Only the PG_ZERO flag is inherited. */ - flags = 0; - if ((req & VM_ALLOC_ZERO) != 0) - flags = PG_ZERO; + flags = PG_ZERO; if ((req & VM_ALLOC_NODUMP) != 0) flags |= PG_NODUMP; - oflags = object == NULL || (object->flags & OBJ_UNMANAGED) != 0 ? - VPO_UNMANAGED : 0; - if ((req & (VM_ALLOC_NOBUSY | VM_ALLOC_NOOBJ | VM_ALLOC_SBUSY)) == 0) + oflags = (object->flags & OBJ_UNMANAGED) != 0 ? VPO_UNMANAGED : 0; + if ((req & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) == 0) busy_lock = VPB_CURTHREAD_EXCLUSIVE; else if ((req & VM_ALLOC_SBUSY) != 0) busy_lock = VPB_SHARERS_WORD(1); @@ -2340,11 +2328,9 @@ found: busy_lock = VPB_UNBUSIED; if ((req & VM_ALLOC_WIRED) != 0) vm_wire_add(npages); - if (object != NULL) { - if (object->memattr != VM_MEMATTR_DEFAULT && - memattr == VM_MEMATTR_DEFAULT) - memattr = object->memattr; - } + if (object->memattr != VM_MEMATTR_DEFAULT && + memattr == VM_MEMATTR_DEFAULT) + memattr = object->memattr; for (m = m_ret; m < &m_ret[npages]; m++) { m->a.flags = 0; m->flags = (m->flags | PG_NODUMP) & flags; @@ -2353,32 +2339,29 @@ found: m->ref_count = 1; m->a.act_count = 0; m->oflags = oflags; - if (object != NULL) { - if (vm_page_insert_after(m, object, pindex, mpred)) { - if ((req & VM_ALLOC_WIRED) != 0) - vm_wire_sub(npages); - KASSERT(m->object == NULL, - ("page %p has object", m)); - mpred = m; - for (m = m_ret; m < &m_ret[npages]; m++) { - if (m <= mpred && - (req & VM_ALLOC_WIRED) != 0) - m->ref_count = 0; - m->oflags = VPO_UNMANAGED; - m->busy_lock = VPB_UNBUSIED; - /* Don't change PG_ZERO. */ - vm_page_free_toq(m); - } - if (req & VM_ALLOC_WAITFAIL) { - VM_OBJECT_WUNLOCK(object); - vm_radix_wait(); - VM_OBJECT_WLOCK(object); - } - return (NULL); - } + if (vm_page_insert_after(m, object, pindex, mpred)) { + if ((req & VM_ALLOC_WIRED) != 0) + vm_wire_sub(npages); + KASSERT(m->object == NULL, + ("page %p has object", m)); mpred = m; - } else - m->pindex = pindex; + for (m = m_ret; m < &m_ret[npages]; m++) { + if (m <= mpred && + (req & VM_ALLOC_WIRED) != 0) + m->ref_count = 0; + m->oflags = VPO_UNMANAGED; + m->busy_lock = VPB_UNBUSIED; + /* Don't change PG_ZERO. */ + vm_page_free_toq(m); + } + if (req & VM_ALLOC_WAITFAIL) { + VM_OBJECT_WUNLOCK(object); + vm_radix_wait(); + VM_OBJECT_WLOCK(object); + } + return (NULL); + } + mpred = m; if (memattr != VM_MEMATTR_DEFAULT) pmap_page_set_memattr(m, memattr); pindex++; @@ -2532,22 +2515,75 @@ vm_page_alloc_noobj_contig_domain(int domain, int req, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr) { - vm_page_t m; - u_long i; - - KASSERT((req & (VM_ALLOC_SBUSY | VM_ALLOC_IGN_SBUSY | - VM_ALLOC_NOOBJ)) == 0, - ("%s: invalid req %#x", __func__, req)); - - m = vm_page_alloc_contig_domain(NULL, 0, domain, req | VM_ALLOC_NOOBJ, - npages, low, high, alignment, boundary, memattr); - if (m != NULL && (req & VM_ALLOC_ZERO) != 0) { - for (i = 0; i < npages; i++) { - if ((m[i].flags & PG_ZERO) == 0) - pmap_zero_page(&m[i]); + struct vm_domain *vmd; + vm_page_t m, m_ret; + u_int flags; + +#define VPANC_FLAGS VPAN_FLAGS + KASSERT((req & ~VPANC_FLAGS) == 0, + ("invalid request %#x", req)); + KASSERT(((req & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) != + (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)), + ("invalid request %#x", req)); + KASSERT(npages > 0, ("vm_page_alloc_contig: npages is zero")); + + m_ret = NULL; +again: + vmd = VM_DOMAIN(domain); + if (vm_domain_allocate(vmd, req, npages)) { + /* + * allocate them from the free page queues. + */ + vm_domain_free_lock(vmd); + m_ret = vm_phys_alloc_contig(domain, npages, low, high, + alignment, boundary); + vm_domain_free_unlock(vmd); + if (m_ret == NULL) { + vm_domain_freecnt_inc(vmd, npages); } } - return (m); + if (m_ret == NULL) { + if (vm_domain_alloc_fail(vmd, NULL, req)) + goto again; + return (NULL); + } + + /* + * Initialize the pages. Only the PG_ZERO flag is inherited. + */ + flags = PG_ZERO; + if ((req & VM_ALLOC_NODUMP) != 0) + flags |= PG_NODUMP; + if ((req & VM_ALLOC_WIRED) != 0) + vm_wire_add(npages); + for (m = m_ret; m < &m_ret[npages]; m++) { + vm_page_dequeue(m); + vm_page_alloc_check(m); + + /* + * Consumers should not rely on a useful default pindex value. + */ + m->pindex = 0xdeadc0dedeadc0de; + m->a.flags = 0; + m->flags = (m->flags | PG_NODUMP) & flags; + m->busy_lock = VPB_UNBUSIED; + if ((req & VM_ALLOC_WIRED) != 0) + m->ref_count = 1; + m->a.act_count = 0; + m->oflags = VPO_UNMANAGED; + + /* + * Zero the page before updating any mappings since the page is + * not yet shared with any devices which might require the + * non-default memory attribute. pmap_page_set_memattr() + * flushes data caches before returning. + */ + if ((req & VM_ALLOC_ZERO) != 0 && (m->flags & PG_ZERO) == 0) + pmap_zero_page(m); + if (memattr != VM_MEMATTR_DEFAULT) + pmap_page_set_memattr(m, memattr); + } + return (m_ret); } /* From nobody Wed Oct 20 01:23:22 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2CF80180FE83; Wed, 20 Oct 2021 01:23:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HYtCv6CDdz3lgs; Wed, 20 Oct 2021 01:23: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 0BFE41E9D5; Wed, 20 Oct 2021 01:23:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19K1NMos095620; Wed, 20 Oct 2021 01:23:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K1NMpV095619; Wed, 20 Oct 2021 01:23:22 GMT (envelope-from git) Date: Wed, 20 Oct 2021 01:23:22 GMT Message-Id: <202110200123.19K1NMpV095619@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: 6d3c78d97028 - main - Rewrite the vm_page_alloc manual page List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 6d3c78d970283dc5e64eaf10a4ae40b54613d608 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6d3c78d970283dc5e64eaf10a4ae40b54613d608 commit 6d3c78d970283dc5e64eaf10a4ae40b54613d608 Author: Mark Johnston AuthorDate: 2021-10-20 00:26:30 +0000 Commit: Mark Johnston CommitDate: 2021-10-20 01:22:56 +0000 Rewrite the vm_page_alloc manual page Document the new allocator variants and flesh out the description of some details of the page allocator interface. Reviewed by: kib, alc Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32035 --- share/man/man9/Makefile | 11 ++ share/man/man9/vm_page_alloc.9 | 339 ++++++++++++++++++++++++++++++++++------- 2 files changed, 292 insertions(+), 58 deletions(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index fdaa14bc93e4..eb4465259226 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -2330,6 +2330,17 @@ MLINKS+=vm_map_stack.9 vm_map_growstack.9 MLINKS+=vm_map_wire.9 vm_map_wire_mapped.9 \ vm_page_wire.9 vm_page_unwire.9 \ vm_page_wire.9 vm_page_unwire_noq.9 +MLINKS+=vm_page_alloc.9 vm_page_alloc_after.9 \ + vm_page_alloc.9 vm_page_alloc_contig.9 \ + vm_page_alloc.9 vm_page_alloc_contig_domain.9 \ + vm_page_alloc.9 vm_page_alloc_domain.9 \ + vm_page_alloc.9 vm_page_alloc_domain_after.9 \ + vm_page_alloc.9 vm_page_alloc_freelist.9 \ + vm_page_alloc.9 vm_page_alloc_freelist_domain.9 \ + vm_page_alloc.9 vm_page_alloc_noobj.9 \ + vm_page_alloc.9 vm_page_alloc_noobj_contig.9 \ + vm_page_alloc.9 vm_page_alloc_noobj_contig_domain.9 \ + vm_page_alloc.9 vm_page_alloc_noobj_domain.9 MLINKS+=vm_page_bits.9 vm_page_clear_dirty.9 \ vm_page_bits.9 vm_page_dirty.9 \ vm_page_bits.9 vm_page_is_valid.9 \ diff --git a/share/man/man9/vm_page_alloc.9 b/share/man/man9/vm_page_alloc.9 index aa3854b47aea..1b587339b0cd 100644 --- a/share/man/man9/vm_page_alloc.9 +++ b/share/man/man9/vm_page_alloc.9 @@ -1,5 +1,9 @@ .\" .\" Copyright (C) 2001 Chad David . All rights reserved. +.\" Copyright (c) 2021 The FreeBSD Foundation +.\" +.\" Portions of this documentation were written by Mark Johnston 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 @@ -26,102 +30,321 @@ .\" .\" $FreeBSD$ .\" -.Dd November 16, 2016 +.Dd October 17, 2021 .Dt VM_PAGE_ALLOC 9 .Os .Sh NAME .Nm vm_page_alloc -.Nd "allocate a page for a" -.Vt vm_object +.Nd "allocate a page of memory" .Sh SYNOPSIS .In sys/param.h .In vm/vm.h .In vm/vm_page.h .Ft vm_page_t .Fn vm_page_alloc "vm_object_t object" "vm_pindex_t pindex" "int req" +.Ft vm_page_t +.Fo vm_page_alloc_after +.Fa "vm_object_t object" +.Fa "vm_pindex_t pindex" +.Fa "int req" +.Fa "vm_page_t mpred" +.Fc +.Ft vm_page_t +.Fo vm_page_alloc_contig +.Fa "vm_object_t object" +.Fa "vm_pindex_t pindex" +.Fa "int req" +.Fa "u_long npages" +.Fa "vm_paddr_t low" +.Fa "vm_paddr_t high" +.Fa "u_long alignment" +.Fa "vm_paddr_t boundary" +.Fa "vm_memattr_t memattr" +.Fc +.Ft vm_page_t +.Fo vm_page_alloc_contig_domain +.Fa "vm_object_t object" +.Fa "vm_pindex_t pindex" +.Fa "int req" +.Fa "u_long npages" +.Fa "vm_paddr_t low" +.Fa "vm_paddr_t high" +.Fa "u_long alignment" +.Fa "vm_paddr_t boundary" +.Fa "vm_memattr_t memattr" +.Fc +.Ft vm_page_t +.Fo vm_page_alloc_domain +.Fa "vm_object_t object" +.Fa "vm_pindex_t pindex" +.Fa "int domain" +.Fa "int req" +.Fc +.Ft vm_page_t +.Fo vm_page_alloc_domain_after +.Fa "vm_object_t object" +.Fa "vm_pindex_t pindex" +.Fa "int domain" +.Fa "int req" +.Fa "vm_page_t mpred" +.Fc +.Ft vm_page_t +.Fo vm_page_alloc_freelist +.Fa "int freelist" +.Fa "int req" +.Fc +.Ft vm_page_t +.Fo vm_page_alloc_freelist_domain +.Fa "int domain" +.Fa "int freelist" +.Fa "int req" +.Fc +.Ft vm_page_t +.Fo vm_page_alloc_noobj +.Fa "int req" +.Fc +.Ft vm_page_t +.Fo vm_page_alloc_noobj_contig +.Fa "int req" +.Fa "u_long npages" +.Fa "vm_paddr_t low" +.Fa "vm_paddr_t high" +.Fa "u_long alignment" +.Fa "vm_paddr_t boundary" +.Fa "vm_memattr_t memattr" +.Fc +.Ft vm_page_t +.Fo vm_page_alloc_noobj_contig_domain +.Fa "int domain" +.Fa "int req" +.Fa "u_long npages" +.Fa "vm_paddr_t low" +.Fa "vm_paddr_t high" +.Fa "u_long alignment" +.Fa "vm_paddr_t boundary" +.Fa "vm_memattr_t memattr" +.Fc +.Ft vm_page_t +.Fo vm_page_alloc_noobj_domain +.Fa "int domain" +.Fa "int req" +.Fc .Sh DESCRIPTION The .Fn vm_page_alloc -function allocates a page at +family of functions allocate one or more pages of physical memory. +Most kernel code should not call these functions directly but should instead +use a kernel memory allocator such as +.Xr malloc 9 +or +.Xr uma 9 , +or should use a higher-level interface to the page cache, such as +.Xr vm_page_grab 9 . +.Pp +All of the functions take a +.Fa req +parameter which encodes the allocation priority and optional modifier flags, +described below. +The functions whose names do not include +.Dq noobj +additionally insert the pages starting at index .Fa pindex -within +in the +VM object .Fa object . -It is assumed that a page has not already been allocated at -.Fa pindex . -The page returned is inserted into the object, unless -.Dv VM_ALLOC_NOOBJ -is specified in the -.Fa req . +The object must be write-locked and not have a page already resident at the +specified index. +The functions whose names include +.Dq domain +support NUMA-aware allocation by returning pages from the +.Xr numa 4 +domain specified by +.Fa domain . .Pp +The +.Fn vm_page_alloc_after +and +.Fn vm_page_alloc_domain_after +functions behave identically to .Fn vm_page_alloc -will not sleep. +and +.Fn vm_page_alloc_domain , +respectively, except that they take an additional parameter +.Fa mpred +which must be the page resident in +.Fa object +with largest index smaller than +.Fa pindex , +or +.Dv NULL +if no such page exists. +These functions exist to optimize the common case of loops that allocate +multiple pages at successive indices within an object. .Pp -Its arguments are: -.Bl -tag -width ".Fa object" -.It Fa object -The VM object to allocate the page for. The -.Fa object -must be locked if -.Dv VM_ALLOC_NOOBJ -is not specified. -.It Fa pindex -The index into the object at which the page should be inserted. -.It Fa req -The bitwise-inclusive OR of a class and any optional flags indicating -how the page should be allocated. +.Fn vm_page_alloc_contig +and +.Fn vm_page_alloc_noobj_contig +functions and their NUMA-aware variants allocate a physically contiguous run of +.Fa npages +pages which satisfies the specified constraints. +The +.Fa low +and +.Fa high +parameters specify a physical address range from which the run is to +be allocated. +The +.Fa alignment +parameter specifies the requested alignment of the first page in the run +and must be a power of two. +If the +.Fa boundary +parameter is non-zero, the pages constituting the run will not cross a +physical address that is a multiple of the parameter value, which must be a +power of two. +If +.Fa memattr +is not equal to +.Dv VM_MEMATTR_DEFAULT , +then mappings of the returned pages created by, e.g., +.Xr pmap_enter 9 +or +.Xr pmap_qenter 9 , +will carry the machine-dependent encoding of the memory attribute. +Additionally, the direct mapping of the page, if any, will be updated to +reflect the requested memory attribute. +.Pp +The +.Fn vm_page_alloc_freelist +and +.Fn vm_page_alloc_freelist_domain +functions behave identically to +.Fn vm_page_alloc_noobj +and +.Fn vm_page_alloc_noobj_domain , +respectively, except that a successful allocation will return a page from the +specified physical memory freelist. +These functions are not intended for use outside of the virtual memory +subsystem and exist only to support the requirements of certain platforms. +.Sh REQUEST FLAGS +All page allocator functions accept a +.Fa req +parameter that governs certain aspects of the function's behavior. +.Pp +The +.Dv VM_ALLOC_WAITOK , +.Dv VM_ALLOC_WAITFAIL , +and +.Dv VM_ALLOC_NOWAIT +flags specify the behavior of the allocator if free pages could not be +immediately allocated. +The +.Dv VM_ALLOC_WAITOK +flag can only be used with the +.Dq noobj +variants. +If +.Dv VM_ALLOC_NOWAIT +is specified, then the allocator gives up and returns +.Dv NULL . +.Dv VM_ALLOC_NOWAIT +is specified implicitly if none of the flags are present in the request. +If either +.Dv VM_ALLOC_WAITOK +or +.Dv VM_ALLOC_WAITFAIL +is specified, the allocator will put the calling thread to sleep until +sufficient free pages become available. +At this point, if +.Dv VM_ALLOC_WAITFAIL +is specified the allocator will return +.Dv NULL , +and if +.Dv VM_ALLOC_WAITOK +is specified the allocator will retry the allocation. +After a failed +.Dv VM_ALLOC_WAITFAIL +allocation returns, the VM object, if any, will have been unlocked while the +thread was sleeping. +In this case the VM object write lock will be re-acquired before the function +call returns. .Pp -Exactly one of the following classes must be specified: +.Fa req +also encodes the allocation request priority. +By default the page(s) are allocated with no special treatment. +If the number of available free pages is below a certain watermark, the +allocation will fail or the allocating thread will sleep, depending on +the specified wait flag. +The watermark is computed at boot time and corresponds to a small (less than +one percent) fraction of the system's total physical memory. +To allocate memory more aggressively, one of following flags may be specified. .Bl -tag -width ".Dv VM_ALLOC_INTERRUPT" -.It Dv VM_ALLOC_NORMAL -The page should be allocated with no special treatment. .It Dv VM_ALLOC_SYSTEM -The page can be allocated if the cache is empty and the free -page count is above the interrupt reserved water mark. +The page can be allocated if the free page count is above the interrupt +reserved water mark. This flag should be used only when the system really needs the page. .It Dv VM_ALLOC_INTERRUPT -.Fn vm_page_alloc -is being called during an interrupt. -A page will be returned successfully if the free page count is greater -than zero. +The allocation will fail only if zero free pages are available. +This flag should be used only if the consequences of an allocation failure +are worse than leaving the system without free memory. +For example, this flag is used when allocating kernel page table pages, where +allocation failures trigger a kernel panic. .El .Pp -The optional flags are: +The following optional flags can further modify allocator behavior: .Bl -tag -width ".Dv VM_ALLOC_NOBUSY" +.It Dv VM_ALLOC_SBUSY +The returned page will be shared-busy. +This flag may only be specified when allocating pages in a VM object. .It Dv VM_ALLOC_NOBUSY -The returned page will not be exclusive busy. +The returned page will not be busy. +This flag is implicit when allocating pages without a VM object. +When allocating pages in a VM object, and neither +.Dv VM_ALLOC_SBUSY +nor +.Dv VM_ALLOC_NOBUSY +are specified, the returned pages will be exclusively busied. .It Dv VM_ALLOC_NODUMP The returned page will not be included in any kernel core dumps regardless of whether or not it is mapped in to KVA. -.It Dv VM_ALLOC_NOOBJ -Do not associate the allocated page with a vm object. -The -.Fa object -argument is ignored. -.It Dv VM_ALLOC_SBUSY -The returned page will be shared busy. .It Dv VM_ALLOC_WIRED The returned page will be wired. .It Dv VM_ALLOC_ZERO -Indicate a preference for a pre-zeroed page. -There is no guarantee that the returned page will be zeroed, but it -will have the -.Dv PG_ZERO -flag set if it is zeroed. -.El +If this flag is specified, the +.Dq noobj +variants will return zeroed pages. +The other allocator interfaces ignore this flag. +.It Dv VM_ALLOC_COUNT(n) +Hint that at least +.Fa n +pages will be allocated by the caller in the near future. +.Fa n +must be no larger than 65535. +If the system is short of free pages, this hint may cause the kernel +to reclaim memory more aggressively than it would otherwise. .El .Sh RETURN VALUES -The -.Vt vm_page_t -that was allocated is returned if successful; otherwise, +If the allocation was successful, a pointer to the +.Vt struct vm_page +corresponding to the allocated page is returned. +If the allocation request specified multiple pages, the returned +pointer points to an array of +.Vt struct vm_page +constituting the run. +Upon failure, .Dv NULL is returned. -.Sh NOTES -The pager process is always upgraded to -.Dv VM_ALLOC_SYSTEM -unless -.Dv VM_ALLOC_INTERRUPT -is set. +Regardless of whether the allocation succeeds or fails, the VM +object +.Fa object +will be write-locked upon return. +.Sh SEE ALSO +.Xr numa 4 , +.Xr malloc 9 , +.Xr uma 9 , +.Xr vm_page_grab 9 , +.Xr vm_page_sbusy 9 .Sh AUTHORS This manual page was written by .An Chad David Aq Mt davidc@acns.ab.ca . From nobody Wed Oct 20 01:23:24 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E1DC4180FDA0; Wed, 20 Oct 2021 01:23: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 4HYtCx0kMYz3llr; Wed, 20 Oct 2021 01:23:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23D5E1EB8A; Wed, 20 Oct 2021 01:23: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 19K1NOQf095644; Wed, 20 Oct 2021 01:23:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K1NOo7095643; Wed, 20 Oct 2021 01:23:24 GMT (envelope-from git) Date: Wed, 20 Oct 2021 01:23:24 GMT Message-Id: <202110200123.19K1NOo7095643@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: b801c79dda53 - main - vm_fault: Stop specifying VM_ALLOC_ZERO List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: b801c79dda53294b55fa19b81d43be25e00ec81f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b801c79dda53294b55fa19b81d43be25e00ec81f commit b801c79dda53294b55fa19b81d43be25e00ec81f Author: Mark Johnston AuthorDate: 2021-10-20 00:27:23 +0000 Commit: Mark Johnston CommitDate: 2021-10-20 01:22:56 +0000 vm_fault: Stop specifying VM_ALLOC_ZERO Now vm_page_alloc() and friends will unconditionally preserve PG_ZERO, so there is no point in setting this flag. Eliminate a local variable and add a comment explaining why we prioritize the allocation when the process is doomed. No functional change intended. Reviewed by: kib, alc Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32036 --- sys/vm/vm_fault.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 8a4b5a543dd6..6bc59222b50e 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -1113,7 +1113,6 @@ static int vm_fault_allocate(struct faultstate *fs) { struct domainset *dset; - int alloc_req; int rv; if ((fs->object->flags & OBJ_SIZEVNLOCK) != 0) { @@ -1150,9 +1149,14 @@ vm_fault_allocate(struct faultstate *fs) /* * Allocate a new page for this object/offset pair. * - * Unlocked read of the p_flag is harmless. At worst, the P_KILLED - * might be not observed there, and allocation can fail, causing - * restart and new reading of the p_flag. + * If the process has a fatal signal pending, prioritize the allocation + * with the expectation that the process will exit shortly and free some + * pages. In particular, the signal may have been posted by the page + * daemon in an attempt to resolve an out-of-memory condition. + * + * The unlocked read of the p_flag is harmless. At worst, the P_KILLED + * might be not observed here, and allocation fails, causing a restart + * and new reading of the p_flag. */ dset = fs->object->domain.dr_policy; if (dset == NULL) @@ -1161,12 +1165,8 @@ vm_fault_allocate(struct faultstate *fs) #if VM_NRESERVLEVEL > 0 vm_object_color(fs->object, atop(fs->vaddr) - fs->pindex); #endif - alloc_req = P_KILLED(curproc) ? - VM_ALLOC_SYSTEM : VM_ALLOC_NORMAL; - if (fs->object->type != OBJT_VNODE && - fs->object->backing_object == NULL) - alloc_req |= VM_ALLOC_ZERO; - fs->m = vm_page_alloc(fs->object, fs->pindex, alloc_req); + fs->m = vm_page_alloc(fs->object, fs->pindex, + P_KILLED(curproc) ? VM_ALLOC_SYSTEM : 0); } if (fs->m == NULL) { if (vm_fault_allocate_oom(fs)) From nobody Wed Oct 20 01:23:25 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 24F1817F0098; Wed, 20 Oct 2021 01:23: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 4HYtCz5f62z3ljh; Wed, 20 Oct 2021 01:23: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 50C661EB11; Wed, 20 Oct 2021 01:23: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 19K1NPKb095668; Wed, 20 Oct 2021 01:23:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K1NPnV095667; Wed, 20 Oct 2021 01:23:25 GMT (envelope-from git) Date: Wed, 20 Oct 2021 01:23:25 GMT Message-Id: <202110200123.19K1NPnV095667@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: a9d6f1fe0a2f - main - Remove some remaining references to VM_ALLOC_NOOBJ List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: a9d6f1fe0a2f852efe7a324f65d7142537b2c14e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a9d6f1fe0a2f852efe7a324f65d7142537b2c14e commit a9d6f1fe0a2f852efe7a324f65d7142537b2c14e Author: Mark Johnston AuthorDate: 2021-10-20 00:28:54 +0000 Commit: Mark Johnston CommitDate: 2021-10-20 01:22:56 +0000 Remove some remaining references to VM_ALLOC_NOOBJ Reviewed by: alc, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32037 --- sys/vm/uma.h | 3 ++- sys/vm/uma_core.c | 2 +- sys/vm/vm_page.h | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/vm/uma.h b/sys/vm/uma.h index 5d473ba909b6..743e02cdddf9 100644 --- a/sys/vm/uma.h +++ b/sys/vm/uma.h @@ -483,7 +483,8 @@ void uma_zone_reserve(uma_zone_t zone, int nitems); /* * Reserves the maximum KVA space required by the zone and configures the zone - * to use a VM_ALLOC_NOOBJ-based backend allocator. + * to use a backend that allocates physical memory and maps it using the + * reserved KVA. * * Arguments: * zone The zone to update. diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 68553bda2249..35ed473da5ca 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -2014,7 +2014,7 @@ fail: } /* - * Allocates a number of pages from within an object + * Allocates a number of pages not belonging to a VM object * * Arguments: * bytes The number of bytes requested diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index 140ea7e2fadb..21e33facc0a8 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -542,9 +542,10 @@ vm_page_t PHYS_TO_VM_PAGE(vm_paddr_t pa); #define VM_ALLOC_WIRED 0x0020 /* (acgnp) Allocate a wired page */ #define VM_ALLOC_ZERO 0x0040 /* (acgnp) Allocate a zeroed page */ #define VM_ALLOC_NORECLAIM 0x0080 /* (c) Do not reclaim after failure */ -#define VM_ALLOC_NOOBJ 0x0100 /* (acg) No associated object */ +#define VM_ALLOC_AVAIL0 0x0100 #define VM_ALLOC_NOBUSY 0x0200 /* (acgp) Do not excl busy the page */ #define VM_ALLOC_NOCREAT 0x0400 /* (gp) Don't create a page */ +#define VM_ALLOC_AVAIL1 0x0800 #define VM_ALLOC_IGN_SBUSY 0x1000 /* (gp) Ignore shared busy flag */ #define VM_ALLOC_NODUMP 0x2000 /* (ag) don't include in dump */ #define VM_ALLOC_SBUSY 0x4000 /* (acgp) Shared busy the page */ From nobody Wed Oct 20 01:23:26 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 24E6C17F0097; Wed, 20 Oct 2021 01:23: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 4HYtCz3KP9z3lww; Wed, 20 Oct 2021 01:23: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 670ED1E89F; Wed, 20 Oct 2021 01:23: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 19K1NQHG095692; Wed, 20 Oct 2021 01:23:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K1NQlc095691; Wed, 20 Oct 2021 01:23:26 GMT (envelope-from git) Date: Wed, 20 Oct 2021 01:23:26 GMT Message-Id: <202110200123.19K1NQlc095691@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: ff93447d8ed6 - main - Use the vm_radix_init() helper when initializing pmaps List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: ff93447d8ed61081adfe00a23a1e4c7bee479e53 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ff93447d8ed61081adfe00a23a1e4c7bee479e53 commit ff93447d8ed61081adfe00a23a1e4c7bee479e53 Author: Mark Johnston AuthorDate: 2021-10-20 00:29:05 +0000 Commit: Mark Johnston CommitDate: 2021-10-20 01:22:56 +0000 Use the vm_radix_init() helper when initializing pmaps No functional change intended. Reviewed by: alc, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32527 --- sys/amd64/amd64/pmap.c | 4 ++-- sys/arm64/arm64/pmap.c | 4 ++-- sys/arm64/iommu/iommu_pmap.c | 2 +- sys/i386/i386/pmap.c | 4 ++-- sys/powerpc/aim/mmu_radix.c | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index f8bb384afdaf..8d6379ab170c 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -4177,7 +4177,7 @@ pmap_pinit0(pmap_t pmap) pmap->pm_cr3 = kernel_pmap->pm_cr3; /* hack to keep pmap_pti_pcid_invalidate() alive */ pmap->pm_ucr3 = PMAP_NO_CR3; - pmap->pm_root.rt_root = 0; + vm_radix_init(&pmap->pm_root); CPU_ZERO(&pmap->pm_active); TAILQ_INIT(&pmap->pm_pvchunk); bzero(&pmap->pm_stats, sizeof pmap->pm_stats); @@ -4398,7 +4398,7 @@ pmap_pinit_type(pmap_t pmap, enum pmap_type pm_type, int flags) break; } - pmap->pm_root.rt_root = 0; + vm_radix_init(&pmap->pm_root); CPU_ZERO(&pmap->pm_active); TAILQ_INIT(&pmap->pm_pvchunk); bzero(&pmap->pm_stats, sizeof pmap->pm_stats); diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index ab62ca2934f0..cd499e026036 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -1748,7 +1748,7 @@ pmap_pinit0(pmap_t pmap) bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); pmap->pm_l0_paddr = READ_SPECIALREG(ttbr0_el1); pmap->pm_l0 = (pd_entry_t *)PHYS_TO_DMAP(pmap->pm_l0_paddr); - pmap->pm_root.rt_root = 0; + vm_radix_init(&pmap->pm_root); pmap->pm_cookie = COOKIE_FROM(ASID_RESERVED_FOR_PID_0, INT_MIN); pmap->pm_stage = PM_STAGE1; pmap->pm_levels = 4; @@ -1771,7 +1771,7 @@ pmap_pinit_stage(pmap_t pmap, enum pmap_stage stage, int levels) pmap->pm_l0_paddr = VM_PAGE_TO_PHYS(m); pmap->pm_l0 = (pd_entry_t *)PHYS_TO_DMAP(pmap->pm_l0_paddr); - pmap->pm_root.rt_root = 0; + vm_radix_init(&pmap->pm_root); bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); pmap->pm_cookie = COOKIE_FROM(-1, INT_MAX); diff --git a/sys/arm64/iommu/iommu_pmap.c b/sys/arm64/iommu/iommu_pmap.c index 7ea8a7ee93a3..0f7b9ba24b0a 100644 --- a/sys/arm64/iommu/iommu_pmap.c +++ b/sys/arm64/iommu/iommu_pmap.c @@ -392,7 +392,7 @@ iommu_pmap_pinit_levels(pmap_t pmap, int levels) pmap->pm_l0_paddr = VM_PAGE_TO_PHYS(m); pmap->pm_l0 = (pd_entry_t *)PHYS_TO_DMAP(pmap->pm_l0_paddr); - pmap->pm_root.rt_root = 0; + vm_radix_init(&pmap->pm_root); bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); MPASS(levels == 3 || levels == 4); diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 62fcbcd90b0b..3b8e335701d2 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -2043,7 +2043,7 @@ __CONCAT(PMTYPE, pinit0)(pmap_t pmap) #ifdef PMAP_PAE_COMP pmap->pm_pdpt = IdlePDPT; #endif - pmap->pm_root.rt_root = 0; + vm_radix_init(&pmap->pm_root); CPU_ZERO(&pmap->pm_active); TAILQ_INIT(&pmap->pm_pvchunk); bzero(&pmap->pm_stats, sizeof pmap->pm_stats); @@ -2075,7 +2075,7 @@ __CONCAT(PMTYPE, pinit)(pmap_t pmap) KASSERT(pmap_kextract((vm_offset_t)pmap->pm_pdpt) < (4ULL<<30), ("pmap_pinit: pdpt above 4g")); #endif - pmap->pm_root.rt_root = 0; + vm_radix_init(&pmap->pm_root); } KASSERT(vm_radix_is_empty(&pmap->pm_root), ("pmap_pinit: pmap has reserved page table page(s)")); diff --git a/sys/powerpc/aim/mmu_radix.c b/sys/powerpc/aim/mmu_radix.c index 95c3f5f009e4..420a7a227c10 100644 --- a/sys/powerpc/aim/mmu_radix.c +++ b/sys/powerpc/aim/mmu_radix.c @@ -4202,7 +4202,7 @@ mmu_radix_pinit(pmap_t pmap) for (int j = 0; j < RADIX_PGD_SIZE_SHIFT; j++) pagezero((vm_offset_t)pmap->pm_pml1 + j * PAGE_SIZE); - pmap->pm_radix.rt_root = 0; + vm_radix_init(&pmap->pm_radix); TAILQ_INIT(&pmap->pm_pvchunk); bzero(&pmap->pm_stats, sizeof pmap->pm_stats); pmap->pm_flags = PMAP_PDE_SUPERPAGE; @@ -4433,7 +4433,7 @@ mmu_radix_pinit0(pmap_t pmap) pmap->pm_pml1 = kernel_pmap->pm_pml1; pmap->pm_pid = kernel_pmap->pm_pid; - pmap->pm_radix.rt_root = 0; + vm_radix_init(&pmap->pm_radix); TAILQ_INIT(&pmap->pm_pvchunk); bzero(&pmap->pm_stats, sizeof pmap->pm_stats); kernel_pmap->pm_flags = From nobody Wed Oct 20 01:23:27 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3A606180FD5F; Wed, 20 Oct 2021 01:23: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 4HYtD11R1Sz3lpF; Wed, 20 Oct 2021 01:23: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 8560E1E81D; Wed, 20 Oct 2021 01:23: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 19K1NRJn095716; Wed, 20 Oct 2021 01:23:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K1NRrx095715; Wed, 20 Oct 2021 01:23:27 GMT (envelope-from git) Date: Wed, 20 Oct 2021 01:23:27 GMT Message-Id: <202110200123.19K1NRrx095715@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: 34fac29e9831 - main - amd64: Add comments to pmap_pinit_type() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 34fac29e98313fb0bfba0503e2e19e352b452516 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=34fac29e98313fb0bfba0503e2e19e352b452516 commit 34fac29e98313fb0bfba0503e2e19e352b452516 Author: Mark Johnston AuthorDate: 2021-10-20 00:29:18 +0000 Commit: Mark Johnston CommitDate: 2021-10-20 01:22:57 +0000 amd64: Add comments to pmap_pinit_type() ... explaining why we don't pass the pmap pointer to pmap_alloc_pt_page(). Reported by: alc Reviewed by: alc, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32528 --- sys/amd64/amd64/pmap.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 8d6379ab170c..66d7ac6669da 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -4345,7 +4345,9 @@ pmap_pinit_type(pmap_t pmap, enum pmap_type pm_type, int flags) int i; /* - * allocate the page directory page + * Allocate the page directory page. Pass NULL instead of a pointer to + * the pmap here to avoid recording this page in the resident count, as + * optimizations in pmap_remove() depend on this. */ pmltop_pg = pmap_alloc_pt_page(NULL, 0, VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_WAITOK); @@ -4377,6 +4379,10 @@ pmap_pinit_type(pmap_t pmap, enum pmap_type pm_type, int flags) else pmap_pinit_pml4(pmltop_pg); if ((curproc->p_md.md_flags & P_MD_KPTI) != 0) { + /* + * As with pmltop_pg, pass NULL instead of a pointer to + * the pmap to ensure that the PTI page isn't counted. + */ pmltop_pgu = pmap_alloc_pt_page(NULL, 0, VM_ALLOC_WIRED | VM_ALLOC_WAITOK); pmap->pm_pmltopu = (pml4_entry_t *)PHYS_TO_DMAP( From nobody Wed Oct 20 01:23:29 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C4B0F17F0207; Wed, 20 Oct 2021 01:23: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 4HYtD450vxz3lph; Wed, 20 Oct 2021 01:23: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 D6DFA1EB8B; Wed, 20 Oct 2021 01:23: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 19K1NTaK095770; Wed, 20 Oct 2021 01:23:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K1NTZ9095769; Wed, 20 Oct 2021 01:23:29 GMT (envelope-from git) Date: Wed, 20 Oct 2021 01:23:29 GMT Message-Id: <202110200123.19K1NTZ9095769@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: 4c812fe61b7c - main - vlapic: Schedule callouts on the local CPU List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 4c812fe61b7ce2f297a381950ff7bd87fd51f698 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4c812fe61b7ce2f297a381950ff7bd87fd51f698 commit 4c812fe61b7ce2f297a381950ff7bd87fd51f698 Author: Mark Johnston AuthorDate: 2021-10-20 00:50:06 +0000 Commit: Mark Johnston CommitDate: 2021-10-20 01:22:57 +0000 vlapic: Schedule callouts on the local CPU The virtual LAPIC driver uses callouts to implement the LAPIC timer. Callouts are armed using callout_reset_sbt(), which currently puts everything on CPU 0. On systems running many bhyve VMs this results in a large amount of contention for CPU 0's callout lock. Modify vlapic to schedule callouts on the local CPU instead. This allows timer interrupts to be scheduled more evenly among CPUs where bhyve is running. Reviewed by: grehan, jhb MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32559 --- sys/amd64/vmm/io/vlapic.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/sys/amd64/vmm/io/vlapic.c b/sys/amd64/vmm/io/vlapic.c index 4e7ddbafd447..940e45cce458 100644 --- a/sys/amd64/vmm/io/vlapic.c +++ b/sys/amd64/vmm/io/vlapic.c @@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$"); #define VLAPIC_BUS_FREQ (128 * 1024 * 1024) static void vlapic_set_error(struct vlapic *, uint32_t, bool); +static void vlapic_callout_handler(void *arg); static __inline uint32_t vlapic_get_id(struct vlapic *vlapic) @@ -710,6 +711,13 @@ vlapic_trigger_lvt(struct vlapic *vlapic, int vector) return (0); } +static void +vlapic_callout_reset(struct vlapic *vlapic, sbintime_t t) +{ + callout_reset_sbt_curcpu(&vlapic->callout, t, 0, + vlapic_callout_handler, vlapic, 0); +} + static void vlapic_callout_handler(void *arg) { @@ -765,8 +773,7 @@ vlapic_callout_handler(void *arg) } bintime_add(&vlapic->timer_fire_bt, &vlapic->timer_period_bt); - callout_reset_sbt(&vlapic->callout, rem_sbt, 0, - vlapic_callout_handler, vlapic, 0); + vlapic_callout_reset(vlapic, rem_sbt); } done: VLAPIC_TIMER_UNLOCK(vlapic); @@ -792,8 +799,7 @@ vlapic_icrtmr_write_handler(struct vlapic *vlapic) bintime_add(&vlapic->timer_fire_bt, &vlapic->timer_period_bt); sbt = bttosbt(vlapic->timer_period_bt); - callout_reset_sbt(&vlapic->callout, sbt, 0, - vlapic_callout_handler, vlapic, 0); + vlapic_callout_reset(vlapic, sbt); } else callout_stop(&vlapic->callout); @@ -1667,8 +1673,7 @@ vlapic_reset_callout(struct vlapic *vlapic, uint32_t ccr) bintime_add(&vlapic->timer_fire_bt, &bt); sbt = bttosbt(bt); - callout_reset_sbt(&vlapic->callout, sbt, 0, - vlapic_callout_handler, vlapic, 0); + vlapic_callout_reset(vlapic, sbt); } else { /* even if the CCR was 0, periodic timers should be reset */ if (vlapic_periodic_timer(vlapic)) { @@ -1678,8 +1683,7 @@ vlapic_reset_callout(struct vlapic *vlapic, uint32_t ccr) sbt = bttosbt(vlapic->timer_period_bt); callout_stop(&vlapic->callout); - callout_reset_sbt(&vlapic->callout, sbt, 0, - vlapic_callout_handler, vlapic, 0); + vlapic_callout_reset(vlapic, sbt); } } From nobody Wed Oct 20 01:23:30 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BEBD4180FFEE; Wed, 20 Oct 2021 01:23: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 4HYtD44mp4z3m34; Wed, 20 Oct 2021 01:23: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 F24F11EA33; Wed, 20 Oct 2021 01:23: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 19K1NUqn095795; Wed, 20 Oct 2021 01:23:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K1NUIX095794; Wed, 20 Oct 2021 01:23:30 GMT (envelope-from git) Date: Wed, 20 Oct 2021 01:23:30 GMT Message-Id: <202110200123.19K1NUIX095794@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: 0ac2a6498375 - main - sysctl.3: sys/types.h no longer needs to be explicitly included List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 0ac2a649837512c7694cc8f5af84d470b3209fdd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0ac2a649837512c7694cc8f5af84d470b3209fdd commit 0ac2a649837512c7694cc8f5af84d470b3209fdd Author: Mark Johnston AuthorDate: 2021-10-20 01:19:18 +0000 Commit: Mark Johnston CommitDate: 2021-10-20 01:22:57 +0000 sysctl.3: sys/types.h no longer needs to be explicitly included Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32562 --- lib/libc/gen/sysctl.3 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/libc/gen/sysctl.3 b/lib/libc/gen/sysctl.3 index c8f1430656a6..2d8da3974086 100644 --- a/lib/libc/gen/sysctl.3 +++ b/lib/libc/gen/sysctl.3 @@ -28,7 +28,7 @@ .\" @(#)sysctl.3 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd October 30, 2020 +.Dd October 18, 2021 .Dt SYSCTL 3 .Os .Sh NAME @@ -39,7 +39,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/sysctl.h .Ft int .Fn sysctl "const int *name" "u_int namelen" "void *oldp" "size_t *oldlenp" "const void *newp" "size_t newlen" From nobody Wed Oct 20 01:23:28 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AC53B180FFEC; Wed, 20 Oct 2021 01:23: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 4HYtD40v1Nz3lmB; Wed, 20 Oct 2021 01:23: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 ABD2A1E6E6; Wed, 20 Oct 2021 01:23: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 19K1NS6C095746; Wed, 20 Oct 2021 01:23:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K1NST3095745; Wed, 20 Oct 2021 01:23:28 GMT (envelope-from git) Date: Wed, 20 Oct 2021 01:23:28 GMT Message-Id: <202110200123.19K1NST3095745@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: bd49c454ca62 - main - Bump __FreeBSD_version for the preceding page allocator changes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: bd49c454ca62170506a98959c1acab7ad50c3276 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bd49c454ca62170506a98959c1acab7ad50c3276 commit bd49c454ca62170506a98959c1acab7ad50c3276 Author: Mark Johnston AuthorDate: 2021-10-20 00:30:28 +0000 Commit: Mark Johnston CommitDate: 2021-10-20 01:22:57 +0000 Bump __FreeBSD_version for the preceding page allocator changes None of the usual suspects (e.g., drm-kmod, virtualbox-ose-kmod, nvidia-driver) seem to be affected by the changes, but it is likely that something else is affected. Sponsored by: The FreeBSD Foundation --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index ecdd233c4c2b..42e200de2eae 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -76,7 +76,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400038 +#define __FreeBSD_version 1400039 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Wed Oct 20 01:55:34 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EA8621802CF0 for ; Wed, 20 Oct 2021 01:55:46 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) (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 4HYtxG682Kz4Xmf for ; Wed, 20 Oct 2021 01:55:46 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-yb1-xb32.google.com with SMTP id v195so7290222ybb.0 for ; Tue, 19 Oct 2021 18:55:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EQ2cNebXoIMPXPZK/W9XOi+eA7cy+4JGj9+Skk4AZS8=; b=kQxNrfO8OcBtO0iLhR0zCgP+ITPh+qivcaijq7/6dk/o7CsDCzp+T2VDxHEA8tzJ+j fnkaxAQ5ZbJjw4hV/1eZ75cL4slQv1MPolbUkXJxq4+kPlU3000Qdw5/Xe6x8C5SyW0X 96EwFYoOg+0ywXud3sPEzKuCsBsCBd8L6dinM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EQ2cNebXoIMPXPZK/W9XOi+eA7cy+4JGj9+Skk4AZS8=; b=ezqpSO3Bo/NxDPQ76l8aGnPpyHcCGNvlPCBeYzchQO0rBQo60KcYf6sXfpi/LRkffP 403QhqzVVLq90MYmNRPoEynf0hY1qbKtPfFkVWohVVTxVa449h2gv/oS4aZsTzoWrAg6 mUEC1H3LR8/zKhT6H0IJ18OCTSncoQF6dy8EwPSj73evKZmv6EGmD9oqOLBNzh9cycWU 46lrS3vogv3aj1SGPLs8qkyCPog/QVwSxuvoV6iq16JPNfO73aMyvmTNEyTGs3/zO2UP P/e0Ymy5xwaPVxUEYvnQRIzJV7wPh9PPrBUU6lVRyu+H69PMeFuPMQfKAxPt+QWqnDxQ 7CcQ== X-Gm-Message-State: AOAM531YTHsp5cFV8dladSanAh+C6AyoENAtC9n2QKN1VtKvpnK+KVv0 93n4EKJVOwySjEQ+G4aE98v1w75io5yj5U8cgjj79Q== X-Google-Smtp-Source: ABdhPJyTeyG2vnEL/yhEOkReZpE01y3jjNVxhzHGzTQr3+eatLQGSypiCOotPB6VZPqB7Rfh53FYpDw/jl3/Sx4kM+M= X-Received: by 2002:a05:6902:120a:: with SMTP id s10mr41513564ybu.224.1634694946044; Tue, 19 Oct 2021 18:55:46 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> In-Reply-To: From: Kevin Bowling Date: Tue, 19 Oct 2021 18:55:34 -0700 Message-ID: Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default To: Alexey Dokuchaev Cc: Emmanuel Vadot , Slawa Olhovchenkov , src-committers , "" , "dev-commits-src-main@FreeBSD.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4HYtxG682Kz4Xmf X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Tue, Oct 19, 2021 at 6:25 PM Alexey Dokuchaev wrote: > > On Tue, Oct 19, 2021 at 01:37:00PM +0200, Emmanuel Vadot wrote: > > On Tue, 19 Oct 2021 14:21:33 +0300, Slawa Olhovchenkov wrote: > > > On Tue, Oct 19, 2021 at 07:38:15AM +0000, Emmanuel Vadot wrote: > > > > commit 225639e7db685a4047e384abdbc296c0e02bd147 > > > > > > > > vt: Disable bell by default > > > > > > > > Bell is either useless if you're working on remote servers or > > > > really annoying when you're working with a local machine that > > > > have a loud buzzer. Switch the default to have it disable. > > > > > > For you, not for me, for example. Also, this is violate POLA. > > > > Just set kern.vt.enable_bell=1 in /etc/sysctl.conf and you will be > > happy again. > > Actually, it should've been the other way around: it if annoys *you*, > then you should just set kern.vt.enable_bell=0 in /etc/sysctl.conf > and be happy. I'm also used to it, it's a nice indicator that things > work normally, including the bell itself. > > > And POLA doesn't means that we can't change a thing. I think a POLA violation here was that some equipment emits a jarringly loud noise, and rushing to turn that off is more stressful than the change of turning it on if you value it. Safe defaults. > FWIW, controversial changes like this should go through the formal > review process, giving everyone interested a chance to chime in, not > like closing the differential in less than 24 hours. > > ./danfe > From nobody Wed Oct 20 02:40:24 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3F45A1815EEC; Wed, 20 Oct 2021 02:40:24 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HYvwm1GCJz4lcH; Wed, 20 Oct 2021 02:40:24 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1634697624; 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=qAdhK5q30r4SBgCm/LPjtzG2Ki64EDQtEuhAMY/tHvk=; b=L6rS2MyufdC2gDTL2DsMWxFxpJRRe8tw46cNoVW30NwWpnZUlSgTmblXbwn9jL0jDhEuoY 5/D1W1L4Rt3GzeBnPPEzkurkxoL6TUK324Th2mA9XIXvB0yvu3rL+6eHlZ7dZdAv+KZ+26 Ed3xM51z3w25LgOWMfx8a3QWKcEcHuV1pW0KVNqh9Hxj75WnSU5V0GGUSBuA4Mrw5PJvLe RbP4MzMY+nKzKT0atOVPGRQffkjcgspgbokUXFAwTqQ225fcjaBaTuE8LTINas5cPHYavj rb73BsKJCsCgpoUnWiry1iuz6Tni3kvZ9M2Gjqyk952cKqA6k1su1/NY5wlm/w== Received: by freefall.freebsd.org (Postfix, from userid 1033) id 1374D1A32C; Wed, 20 Oct 2021 02:40:24 +0000 (UTC) Date: Wed, 20 Oct 2021 02:40:24 +0000 From: Alexey Dokuchaev To: Kevin Bowling Cc: Emmanuel Vadot , Slawa Olhovchenkov , src-committers , "" , "dev-commits-src-main@FreeBSD.org" Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1634697624; 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=qAdhK5q30r4SBgCm/LPjtzG2Ki64EDQtEuhAMY/tHvk=; b=tbK5pRp72dCvyk+AwREvXCbkU5+3yVILOMw6u6jws3DiTEro7GIGwfBJQzm5xf+74g1P4i meujwzMDKLlH1lkzpWXQq+1gWBw7ahrE5UbZOkdXm6g473gEtMfIXLKTfb1IxSHStkzUdk VidHATJ/Toq4RXuUtob5p0oNhwfAlJ/rnWUf/s8u0TyZ5nBvhhs/E6ifUZITNZ6U+ZVa2y 1VQ+x7gIJHJ36TNxZ3YXcqmd4LbqosScqyH1vOFOADhwlAtrk7B0Tm9hAiT3IZ+/fuCPFT qv0NlpjeBYF1JihvYilbGxUWliqrsZ6zUlJLY2YPfwQq1OCljAHX/Tln0inQ2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1634697624; a=rsa-sha256; cv=none; b=LeDdoQ5BYLFoghkQyhG+9Sngmcp/lZxiLBuD6n6v7+QaBBHiX9KY5bdfZTKWuEZ8YGQUvu A1KN+BE4emuG5k6Wck1ZYLTU+MmbGb3zzEZTgdm7TV8VpZD7PX03uYfmUvJCL8t7vsVsQ+ WqeEPBt6RqHsaxq45rnik0zk8Uyj2r1CUAbhzMeecdlbvNjWt/Lu0x9igzicKd7mlSEO3t WzX176iSE0vHgsmHywezgAMnlcbzDJa1genmxjdmtgZhIqv4qo9cyrwYTPngBU+foY+eBB lC8PcvfFXIL5E8ql3FLIArUeJpfBfeiiGBKswGY1ru8SyTdyvdUpTXEJa2pOsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On Tue, Oct 19, 2021 at 06:55:34PM -0700, Kevin Bowling wrote: > On Tue, Oct 19, 2021 at 6:25 PM Alexey Dokuchaev wrote: > > On Tue, Oct 19, 2021 at 01:37:00PM +0200, Emmanuel Vadot wrote: > > > On Tue, 19 Oct 2021 14:21:33 +0300, Slawa Olhovchenkov wrote: > > > > On Tue, Oct 19, 2021 at 07:38:15AM +0000, Emmanuel Vadot wrote: > > > > > commit 225639e7db685a4047e384abdbc296c0e02bd147 > > > > > > > > > > vt: Disable bell by default > > > > > > > > > > Bell is either useless if you're working on remote servers or > > > > > really annoying when you're working with a local machine that > > > > > have a loud buzzer. Switch the default to have it disable. > > > > > > > > For you, not for me, for example. Also, this is violate POLA. > > > > > > Just set kern.vt.enable_bell=1 in /etc/sysctl.conf and you will be > > > happy again. > > > > Actually, it should've been the other way around: it if annoys *you*, > > then you should just set kern.vt.enable_bell=0 in /etc/sysctl.conf > > and be happy. I'm also used to it, it's a nice indicator that things > > work normally, including the bell itself. > > > > > And POLA doesn't means that we can't change a thing. > > I think a POLA violation here was that some equipment emits a > jarringly loud noise, and rushing to turn that off is more stressful > than the change of turning it on if you value it. If "some equipment" has a buzzer so annoying that it stresses one enough that she gets lost as to how to turn it off then perhaps admin of such equipment should complain to its vendor instead. > Safe defaults. When I issue BEL (\a) on the console, I expect to hear the beep, and should not do anything to enable it. Computers don't have many ways to talk back to us, muting one of the low-level signals like this is dubious at the very least and should've undergone broader discussion. ./danfe From nobody Wed Oct 20 03:35:39 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 559471804677; Wed, 20 Oct 2021 03:35: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 4HYx8X1p6Fz3GMP; Wed, 20 Oct 2021 03:35: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 172232078C; Wed, 20 Oct 2021 03:35: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 19K3ZdKf070861; Wed, 20 Oct 2021 03:35:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K3ZdfS070860; Wed, 20 Oct 2021 03:35:39 GMT (envelope-from git) Date: Wed, 20 Oct 2021 03:35:39 GMT Message-Id: <202110200335.19K3ZdfS070860@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Guangyuan Yang Subject: git: 262717e270c3 - main - arswitch(4): Add new manpage List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ygy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 262717e270c3e8a28fa2937db750ba946be8c836 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ygy (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=262717e270c3e8a28fa2937db750ba946be8c836 commit 262717e270c3e8a28fa2937db750ba946be8c836 Author: Felix Johnson AuthorDate: 2021-10-20 03:29:11 +0000 Commit: Guangyuan Yang CommitDate: 2021-10-20 03:35:04 +0000 arswitch(4): Add new manpage PR: 211668 Reported by: O. Hartmann Reviewed by: adrian, debdrup, imp Differential Revision: https://reviews.freebsd.org/D32476 --- share/man/man4/arswitch.4 | 91 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/share/man/man4/arswitch.4 b/share/man/man4/arswitch.4 new file mode 100644 index 000000000000..481a3a08f339 --- /dev/null +++ b/share/man/man4/arswitch.4 @@ -0,0 +1,91 @@ +.\"- +.\" Copyright (c) 2021 Felix Johnson +.\" +.\" 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$ +.\" +.Dd October 19, 2021 +.Dt ARSWITCH 4 +.Os +.Sh NAME +.Nm arswitch +.Nd driver for Atheros Fast Ethernet switch +.Sh SYNOPSIS +.Cd "device mdio" +.Cd "device etherswitch" +.Cd "device arswitch" +.Sh DESCRIPTION +The +.Nm +device driver provides a management interface to multiple Atheros +fast ethernet switch chips: +.Bl -tag -compact -width "AR7240" +.It AR7240 +Wireless Network Processor SOC with five Fast Ethernet PHYs +.It AR8216 +Fast Ethernet Switch +.It AR8226 +.It AR8316 +Six-port Gigabit Ethernet Switch +.It AR8327 +Seven-port Gigabit Ethernet Switch +.It AR9340 +Wireless networking SoC +.El +.Pp +The driver uses an +.Xr mdio 4 +or +.Xr miibus 4 +interface to configure the ethernet interface. +.Pp +This driver supports port based vlan, and +IEEE 802.1Q (QinQ). +These options can be configured with the +.Xr etherswitchcfg 8 +command. +.Nm +supports +.Dv addtag , +.Dv striptag , +and +.Dv doubletag . +.Dv addtag +and +.Dv striptag +are mutually exclusive. +.Pp +Setting the switch MAC address is not supported. +.Sh SEE ALSO +.Xr etherswitch 4 , +.Xr etherswitchcfg 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +The +.Nm +manual was written by +.An Felix Johnson . From nobody Wed Oct 20 04:37:18 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6A44B1800B08; Wed, 20 Oct 2021 04:37: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 4HYyWf24Kjz3nkV; Wed, 20 Oct 2021 04:37: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 276FC20F42; Wed, 20 Oct 2021 04:37: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 19K4bI6O050235; Wed, 20 Oct 2021 04:37:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K4bIjA050234; Wed, 20 Oct 2021 04:37:18 GMT (envelope-from git) Date: Wed, 20 Oct 2021 04:37:18 GMT Message-Id: <202110200437.19K4bIjA050234@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Guangyuan Yang Subject: git: d4cf7dc0df28 - main - camcontrol(8): Clean up references to removed symbols List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ygy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d4cf7dc0df289ad0e16b5b40b076311c71e663dc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ygy (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=d4cf7dc0df289ad0e16b5b40b076311c71e663dc commit d4cf7dc0df289ad0e16b5b40b076311c71e663dc Author: Felix Johnson AuthorDate: 2021-10-20 04:32:54 +0000 Commit: Guangyuan Yang CommitDate: 2021-10-20 04:32:54 +0000 camcontrol(8): Clean up references to removed symbols Patch the manpage to remove references to devq_openings and devq_queued. Document the allocated tag that has been added in the same commit. The relevant code change was committed as r271588 (959ec2581b23aefebb3bae26c527c1b25834a9e3) by mav@. PR: 223651 MFH after: 3 days Reported by: Bertrand Petit --- sbin/camcontrol/camcontrol.8 | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/sbin/camcontrol/camcontrol.8 b/sbin/camcontrol/camcontrol.8 index 7790d047a255..6f1d00269633 100644 --- a/sbin/camcontrol/camcontrol.8 +++ b/sbin/camcontrol/camcontrol.8 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 6, 2019 +.Dd October 20, 2021 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -1092,18 +1092,8 @@ to print out the tagged queueing related fields of the XPT_GDEV_TYPE CCB: This is the amount of capacity for transactions queued to a given device. .It dev_active This is the number of transactions currently queued to a device. -.It devq_openings -This is the kernel queue space for transactions. -This count usually mirrors -dev_openings except during error recovery operations when -the device queue is frozen (device is not allowed to receive -commands), the number of dev_openings is reduced, or transaction -replay is occurring. -.It devq_queued -This is the number of transactions waiting in the kernel queue for capacity -on the device. -This number is usually zero unless error recovery is in -progress. +.It allocated +This is the number of CCBs allocated for the device. .It held The held count is the number of CCBs held by peripheral drivers that have either just been completed or are about to be released to the transport From nobody Wed Oct 20 04:42:22 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 659B01802464; Wed, 20 Oct 2021 04:42:32 +0000 (UTC) (envelope-from ygy@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 4HYydh0Nrlz3q2P; Wed, 20 Oct 2021 04:42:32 +0000 (UTC) (envelope-from ygy@freebsd.org) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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: ygy) by smtp.freebsd.org (Postfix) with ESMTPSA id D1F255A18; Wed, 20 Oct 2021 04:42:31 +0000 (UTC) (envelope-from ygy@freebsd.org) Received: by mail-wm1-f53.google.com with SMTP id s198-20020a1ca9cf000000b0030d6986ea9fso7144702wme.1; Tue, 19 Oct 2021 21:42:31 -0700 (PDT) X-Gm-Message-State: AOAM530ZxGMqd7kKt32QWGL1YRG8FYk6aUCU4Wx8n7YLMn2rYlW5Y5/2 WWRTygnB8+MnmV7nhSDYcW1IL+Fpt029QPaQV3A= X-Google-Smtp-Source: ABdhPJwojibUhTHZsbZWsbvHVRbxcgzv9uR39e/vmauqfd4sL0aQ80fLlxLj31tvwk8WZsmqhUYSS3cfSIuwLmsXwCc= X-Received: by 2002:a05:6000:1544:: with SMTP id 4mr51106810wry.374.1634704950475; Tue, 19 Oct 2021 21:42:30 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202110200437.19K4bIjA050234@gitrepo.freebsd.org> In-Reply-To: <202110200437.19K4bIjA050234@gitrepo.freebsd.org> From: Guangyuan Yang Date: Wed, 20 Oct 2021 00:42:22 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: d4cf7dc0df28 - main - camcontrol(8): Clean up references to removed symbols To: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-ThisMailContainsUnwantedMimeParts: N Guangyuan Yang =E4=BA=8E2021=E5=B9=B410=E6=9C=8820=E6=97= =A5=E5=91=A8=E4=B8=89 =E4=B8=8A=E5=8D=8812:37=E5=86=99=E9=81=93=EF=BC=9A > > The branch main has been updated by ygy (doc, ports committer): > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Dd4cf7dc0df289ad0e16b5b40b0= 76311c71e663dc > > commit d4cf7dc0df289ad0e16b5b40b076311c71e663dc > Author: Felix Johnson > AuthorDate: 2021-10-20 04:32:54 +0000 > Commit: Guangyuan Yang > CommitDate: 2021-10-20 04:32:54 +0000 > > camcontrol(8): Clean up references to removed symbols > > Patch the manpage to remove references to devq_openings and devq_queu= ed. > Document the allocated tag that has been added in the same commit. Th= e > relevant code change was committed as r271588 > (959ec2581b23aefebb3bae26c527c1b25834a9e3) by mav@. > > PR: 223651 > MFH after: 3 days > Reported by: Bertrand Petit Typo - s/MFH/MFC/. /facepalm --=20 Guangyuan Yang ygy@FreeBSD.org From nobody Wed Oct 20 06:03:35 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2DEE017FC2D0; Wed, 20 Oct 2021 06:03: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 4HZ0RD0Z46z4g2b; Wed, 20 Oct 2021 06:03: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 E6CF62242A; Wed, 20 Oct 2021 06:03: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 19K63ZBI070616; Wed, 20 Oct 2021 06:03:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K63ZJj070615; Wed, 20 Oct 2021 06:03:35 GMT (envelope-from git) Date: Wed, 20 Oct 2021 06:03:35 GMT Message-Id: <202110200603.19K63ZJj070615@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: 8d7fe65348a2 - main - stress2: Added a "mdconfig -o force" test scenario List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 8d7fe65348a2fa13fe007975a0560567ac141458 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=8d7fe65348a2fa13fe007975a0560567ac141458 commit 8d7fe65348a2fa13fe007975a0560567ac141458 Author: Peter Holm AuthorDate: 2021-10-20 06:01:58 +0000 Commit: Peter Holm CommitDate: 2021-10-20 06:01:58 +0000 stress2: Added a "mdconfig -o force" test scenario --- tools/test/stress2/misc/force9.sh | 92 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/tools/test/stress2/misc/force9.sh b/tools/test/stress2/misc/force9.sh new file mode 100755 index 000000000000..325b227888a6 --- /dev/null +++ b/tools/test/stress2/misc/force9.sh @@ -0,0 +1,92 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Peter Holm +# +# 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. +# + +# "mdconfig -o force" test scenario. +# "panic: ffs_checkblk: cylinder group read failed" seen: +# https://people.freebsd.org/~pho/stress/log/log0170.txt + +" "panic: softdep_update_inodeblock inconsistent ip ..." seen: +# https://people.freebsd.org/~pho/stress/log/log0184.txt + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +. ../default.cfg + +log=/tmp/force7.sh.log +mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart +truncate -s 10g $diskimage +mdconfig -a -t vnode -f $diskimage -u $mdstart +flags=$newfs_flags +echo "newfs $flags md$mdstart" +newfs $flags md$mdstart > /dev/null 2>&1 + +export TESTPROGS=`cd ..; find testcases/ -perm -1 -type f | \ + egrep -Ev "/run/|/badcode/|/pty/|/shm/|/socket/|sysctl|tcp|thr|udp"` +export runRUNTIME=3m +export RUNDIR=$mntpoint/stressX +start=`date +%s` +while [ $((`date +%s` - start)) -lt $((15 * 60)) ]; do + mount /dev/md$mdstart $mntpoint + rm -fr $mntpoint/lost+found + chmod 777 $mntpoint + + echo "Start tests" + su $testuser -c 'cd ..; ./testcases/run/run $TESTPROGS' > \ + /dev/null 2>&1 & + + sleep `jot -r 1 60 180` + echo "Force destroy MD disk" + while mdconfig -l | grep -q md$mdstart; do + mdconfig -d -u $mdstart -o force || sleep 1 + done + sleep 1 + ../tools/killall.sh + wait + n=0 + while mount | grep $mntpoint | grep -q /dev/md; do + umount $mntpoint || sleep 1 + [ $((n += 1)) -gt 300 ] && { echo FAIL; exit 1; } + done + mdconfig -a -t vnode -f $diskimage -u $mdstart + fsck_ffs -fyR /dev/md$mdstart > $log 2>&1; s=$? + [ $s -ne 0 ] && break + grep -Eq "IS CLEAN|MARKED CLEAN" $log || { s=100; break; } +done +if [ $s -eq 0 ]; then + mount /dev/md$mdstart $mntpoint + cp -R /usr/include $mntpoint + dd if=/dev/zero of=$mntpoint/big bs=1m count=10 status=none + find $mntpoint/* -delete + umount $mntpoint + mdconfig -d -u $mdstart + rm -f $diskimage $log +else + cat $log +fi +exit $s From nobody Wed Oct 20 06:25:10 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F148618052E4; Wed, 20 Oct 2021 06:25:10 +0000 (UTC) (envelope-from pstef@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HZ0w66Ty9z4mYw; Wed, 20 Oct 2021 06:25:10 +0000 (UTC) (envelope-from pstef@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1634711110; 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=K6/wPiEmG7Lhd2/D/NPX/Km8eOUwLUoQP4mP5U5xT60=; b=ONaglU0sBY4RhzGkJG1pvluJOZ+dx+E9WpIq9zUCbXej7v4lXbtXyRo+D5p3rOJ4h/ASgy /UvoTKm2QB/vPTovHwCB1cFxGx9hzxz8XAC2aQi741NMHcsQaUH9+6yFHxFJbzRVT56i9V zBpoTVkCdqKIWdJbi6iSEW9LM8megD3zF+J829AlZSmqu3lOGKlVl9m/OvGuXBtKnLhc1b TY5432VRI82y1Dxbq5sfUrRmaEQtbw4j33dWmLxnp5ZMcN7U4kCrrMbHGkL4kbZu64h0RF 6d9oosyZ8w5KuEzqW261aiSPJGTYOIPr8jrOUhkObx3COUr5M5FfzQQpYEpqew== Received: by freefall.freebsd.org (Postfix, from userid 1403) id C27611B116; Wed, 20 Oct 2021 06:25:10 +0000 (UTC) Date: Wed, 20 Oct 2021 06:25:10 +0000 From: "Piotr P. Stefaniak" To: Alexey Dokuchaev Cc: Kevin Bowling , Emmanuel Vadot , Slawa Olhovchenkov , src-committers , "" , "dev-commits-src-main@FreeBSD.org" Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1634711110; 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=K6/wPiEmG7Lhd2/D/NPX/Km8eOUwLUoQP4mP5U5xT60=; b=ZsMpIpTNukyY7gNlLtisjPfS7hppemSbxfLJKG6zwTdqWEL+ZNi3LuTyinRHdpjlRXYKX2 fttgnbBTcIu3Ypn5egatDU+TDDd6jePJGmfxoe1oU5aTU6DL1Ig5SiEySIW7loWB96SMEp c9UizzwYi6JoNjoOhWNSnDxkJhYpXXV+qd/pVaPXZvGXURLXPczdA/Tfo4L6178HPTqUUQ tmGZo9KHGjs/B0rztOurGXxZEzEVNOPCzMcZtAq92bKgnB0YfzrPiUQM1cVDhlq0qY5dvw TiX8Uqd2LwfSBnXsUzrIcKDS3RVytOIPccQP79BctyAFfETCk+on0p1vzYugKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1634711110; a=rsa-sha256; cv=none; b=cdG26VLQ0hoIxeZ1NEAij7EWHqTjoQQeVpwjNBHOWlfYgLRqAS+GAZuuO2FIm+7l/eMnmn vzGbLDK1lwYHEFUZFdb1JFXN3ulJatlrMXZNM2ipfY77BwduUfDdDIhO3FOiuzehPF6oqe ku9OGJk0Dr6Fy5RzCIsm/WySAgrmWQVi1V9DLCUC2Za3VT8UOtwrh28IOlL+PJ0R5gT7Cq X6olKxkI3lCOooPs5PU8BsZtxpxf6ov8yFbzmK06q+IIA+/jxe9j4UhJIRJP8TRSwqF+Lm 8KN0fHeh6g69euZgyZ8/C4SSFtiF+iYXdPfCzWACLG77X1sJBFRZIQRnw3AWew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On 2021-10-20 02:40:24, Alexey Dokuchaev wrote: >On Tue, Oct 19, 2021 at 06:55:34PM -0700, Kevin Bowling wrote: >> >> I think a POLA violation here was that some equipment emits a >> jarringly loud noise, and rushing to turn that off is more stressful >> than the change of turning it on if you value it. > >If "some equipment" has a buzzer so annoying that it stresses one >enough that she gets lost as to how to turn it off then perhaps admin >of such equipment should complain to its vendor instead. When I installed FreeBSD on my laptop, I was mostly happy with how it worked, except it had an Astonishingly loud beeper. I had to waste Colin's time to learn about how to disable it. Me complaining to vendor of an old laptop won't buy us anything. In general, the defaults are really not for you or me. We use FreeBSD no matter what and whenever a setting is not what we like, we change it, or the sources. The defaults are for the people who don't have any FreeBSD configs yet and probably don't intend to write them for some time. Some people will want to grow their own configs over time, unless they're discouraged by the generally unfriendly look and feel of FreeBSD. Piotr From nobody Wed Oct 20 07:34:30 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D283F17FADC1; Wed, 20 Oct 2021 07:34: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 4HZ2S65T8kz56N3; Wed, 20 Oct 2021 07:34: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 9CBDF2376A; Wed, 20 Oct 2021 07:34: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 19K7YU2w090832; Wed, 20 Oct 2021 07:34:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K7YURw090831; Wed, 20 Oct 2021 07:34:30 GMT (envelope-from git) Date: Wed, 20 Oct 2021 07:34:30 GMT Message-Id: <202110200734.19K7YURw090831@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: 5aeb26000a41 - main - ncurses: documents the latest changes in RELNOTES List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 5aeb26000a41efb54fae2f0c631db6fcda268bb5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=5aeb26000a41efb54fae2f0c631db6fcda268bb5 commit 5aeb26000a41efb54fae2f0c631db6fcda268bb5 Author: Baptiste Daroussin AuthorDate: 2021-10-19 06:43:39 +0000 Commit: Baptiste Daroussin CommitDate: 2021-10-20 07:33:04 +0000 ncurses: documents the latest changes in RELNOTES --- RELNOTES | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RELNOTES b/RELNOTES index c5d4c038cfe7..225872fe497b 100644 --- a/RELNOTES +++ b/RELNOTES @@ -10,6 +10,12 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +396851c20ae: + libncursesw has been split into libtinfow and libncursesw, linker + scripts should make it transparent for consumers. pkg-config files + are also now installed to ease ports detecting the ncurses setup from + base. + 422084abbda: LLVM's MemorySanitizer can now be used in amd64 kernels. See the kmsan(9) manual page for more information. From nobody Wed Oct 20 07:34:31 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4989F17FAE06; Wed, 20 Oct 2021 07:34: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 4HZ2S80SV9z56BM; Wed, 20 Oct 2021 07:34: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 C910C2376B; Wed, 20 Oct 2021 07:34: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 19K7YVlg090856; Wed, 20 Oct 2021 07:34:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K7YVTH090855; Wed, 20 Oct 2021 07:34:31 GMT (envelope-from git) Date: Wed, 20 Oct 2021 07:34:31 GMT Message-Id: <202110200734.19K7YVTH090855@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: ef0d94a3d34c - main - sh(1): interactive mode improvement List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: ef0d94a3d34c880bd9f86cd842ee01b6075bc1d8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=ef0d94a3d34c880bd9f86cd842ee01b6075bc1d8 commit ef0d94a3d34c880bd9f86cd842ee01b6075bc1d8 Author: Baptiste Daroussin AuthorDate: 2021-10-19 06:37:47 +0000 Commit: Baptiste Daroussin CommitDate: 2021-10-20 07:33:04 +0000 sh(1): interactive mode improvement In the default configuration add 2 bindings which has been requested by many during the HEADSUP discussion: * csh like arrow history navigation * ctrl-arrow to jump from word to words Add an alias to make the history command exist as an alias to fc -l. --- bin/sh/dot.shrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bin/sh/dot.shrc b/bin/sh/dot.shrc index 5277e5b07b0a..5a111a61a38d 100644 --- a/bin/sh/dot.shrc +++ b/bin/sh/dot.shrc @@ -31,6 +31,15 @@ # alias mv='mv -i' # alias rm='rm -i' +# # csh like history on arrow up and down +bind ^[[A ed-search-prev-history +bind ^[[B ed-search-next-history + +# # ctrl+arrow allow to jump from words to words +bind "\\e[1;5C" em-next-word +bind "\\e[1;5D" ed-prev-word +alias history='fc -l' + # read(2) of directories may not be desirable by default, as this will provoke # EISDIR errors from each directory encountered. # alias grep='grep -d skip' From nobody Wed Oct 20 07:34:32 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 97FF517FA925; Wed, 20 Oct 2021 07:34: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 4HZ2S91pY3z56b6; Wed, 20 Oct 2021 07:34: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 E283123832; Wed, 20 Oct 2021 07:34: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 19K7YWc3090886; Wed, 20 Oct 2021 07:34:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K7YWgT090885; Wed, 20 Oct 2021 07:34:32 GMT (envelope-from git) Date: Wed, 20 Oct 2021 07:34:32 GMT Message-Id: <202110200734.19K7YWgT090885@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: d410b585b6f0 - main - sh(1): make it the default shell for the root user List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: d410b585b6f00a26c2de7724d6576a3ea7d548b7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=d410b585b6f00a26c2de7724d6576a3ea7d548b7 commit d410b585b6f00a26c2de7724d6576a3ea7d548b7 Author: Baptiste Daroussin AuthorDate: 2021-10-19 06:46:12 +0000 Commit: Baptiste Daroussin CommitDate: 2021-10-20 07:34:05 +0000 sh(1): make it the default shell for the root user In the recent history sh(1) has gain the missing features for it to become a usable interractive shell: - command completion - persistent history support - improvements on the default bindings in emacs mode - improvements in the vi mode (repect $EDITOR) - print a newline when exiting via ^D - default prompt and improvements on how PS1 can be configured - and more. This changes also simplifies making tiny freebsd images with only sh(1) as a shell --- UPDATING | 6 ++++++ etc/master.passwd | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 6184d2df8a8d..798f188971b8 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20211020: + sh(1) is now the default shell for the root user. to force root to use + the csh shell, please run the following command as root: + + $ chsh -s csh + 20211004: Ncurses distribution has been split between libtinfow and libncurses with libncurses.so becoming a linker (ld) script to seamlessly link diff --git a/etc/master.passwd b/etc/master.passwd index a1be886f1e8d..b61c13fdd9fe 100644 --- a/etc/master.passwd +++ b/etc/master.passwd @@ -1,6 +1,6 @@ # $FreeBSD$ # -root::0:0::0:0:Charlie &:/root:/bin/csh +root::0:0::0:0:Charlie &:/root:/bin/sh toor:*:0:0::0:0:Bourne-again Superuser:/root: daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin operator:*:2:5::0:0:System &:/:/usr/sbin/nologin From nobody Wed Oct 20 07:35:34 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 84DCA17FC1FA; Wed, 20 Oct 2021 07:35:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HZ2TM1q8kz57Sv; Wed, 20 Oct 2021 07:35:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 188E2236DD; Wed, 20 Oct 2021 07:35: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 19K7ZYTc091076; Wed, 20 Oct 2021 07:35:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K7ZYcr091075; Wed, 20 Oct 2021 07:35:34 GMT (envelope-from git) Date: Wed, 20 Oct 2021 07:35:34 GMT Message-Id: <202110200735.19K7ZYcr091075@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: 1fca3dca2339 - main - RELNOTES: document the change of the default shell List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 1fca3dca2339cceda5efce0d6b87846faac3dba9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=1fca3dca2339cceda5efce0d6b87846faac3dba9 commit 1fca3dca2339cceda5efce0d6b87846faac3dba9 Author: Baptiste Daroussin AuthorDate: 2021-10-20 07:35:07 +0000 Commit: Baptiste Daroussin CommitDate: 2021-10-20 07:35:07 +0000 RELNOTES: document the change of the default shell --- RELNOTES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RELNOTES b/RELNOTES index 225872fe497b..60942ddd5422 100644 --- a/RELNOTES +++ b/RELNOTES @@ -10,6 +10,9 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +d410b585b6f: + sh(1) is now the default shell for the root user. + 396851c20ae: libncursesw has been split into libtinfow and libncursesw, linker scripts should make it transparent for consumers. pkg-config files From nobody Wed Oct 20 07:43:01 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CB5AE1800DC4; Wed, 20 Oct 2021 07:43:01 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HZ2dx5BYFz3DX6; Wed, 20 Oct 2021 07:43:01 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1634715781; 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=ODqGkhTUaXOKnPs71LpK9VD1tvf0WD1yJQxVpWye2II=; b=GlOSpwx1n1hOp6FKYq9OL7u+dButX+AATqgp3Sv7I0yRproUsVQfZhZ2VhZZfqa49kh+Xh rUY1/x5cdDJY6gWBmmvtUTC9CkRYRngQQJ23HBP8iU1HrDVFc9mSuFHQB5wtKAt8pq26B0 LBrA3vR7LQIgSpbbTG9GCqR+827CLpPGUTtq1yt237kl7r2ABgtEG45+j0beLc8g013IvG q5lnfZ4nBG4rUvOtZMLXYUKCRDpHsEBlO6q8TXp6bYoV+xFlJmNs6vsrUSyrM4iaqGJJxG OUali6mDUoIgDiVNtAnLBhtk3Nb8gxxVfF1pE3GEhpmf4OrSMl73hdsxPU6Qrw== Received: by freefall.freebsd.org (Postfix, from userid 1033) id 95CC21B66D; Wed, 20 Oct 2021 07:43:01 +0000 (UTC) Date: Wed, 20 Oct 2021 07:43:01 +0000 From: Alexey Dokuchaev To: Baptiste Daroussin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: d410b585b6f0 - main - sh(1): make it the default shell for the root user Message-ID: References: <202110200734.19K7YWgT090885@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202110200734.19K7YWgT090885@gitrepo.freebsd.org> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1634715781; 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=ODqGkhTUaXOKnPs71LpK9VD1tvf0WD1yJQxVpWye2II=; b=c2eiey4sIEy49NqOK1BWpXH6XZbHyT3WJxrYBgP8un9qZVP20eT7Ooyc5u4HFO52wrQCmI eCB30VfOYYO/iknyFL5JOehna4NU+b8g8T7jcrNMcvxf0OjS5F6JQ6DGaD9qsBdX32cJ2s niF/Vb/XnWON0aI2+3DHevq9i/77qbI8wa+nBAZjgZhwYwbElGWfYsIdlO2U5eWIJLVamj EbkK122Ws62V4G1FhjmC7QRWIpV4RdGSmD/4PAeJ4fSUe+eSB5qP9mFwyxT+8fdJ0sygeW AxP5y6JJ5/bpLpX3/UL+kYB8JgKTgMz3GuADyKB14QR69P0VoFmSDG+YOFMAuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1634715781; a=rsa-sha256; cv=none; b=gnDWw7/X7wbww/y2D8TlVwUFEI2dukgKBsGPEDW+ALNPtyZSBKP7rktO9grWCuH7o6v2I2 uScQWNXWxMcPs95YvduvVOuNA95hKOKySDjF7iCPpncfG7N3x/KkplH6JjkBU8iwSnKmxJ BOnlpBm8gtpzHv0BVTM2dnLh0dmfvghWT+ilc7rcCTTwbiOQbnKhgsuKGB9w99GgwDqt89 g0OjOIwyD5PIxIJZmR8sgFzjwweHRF7FNgqJH8GQjAyHS5MHqxarRe9056jh/IeEJuQU6y unIKuD9vcdmcOCUYdTgxuSh7Crx2RQ97zSP9knSsTth+vpPdWSjsJ/IukuiEtA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On Wed, Oct 20, 2021 at 07:34:32AM +0000, Baptiste Daroussin wrote: > commit d410b585b6f00a26c2de7724d6576a3ea7d548b7 > > sh(1): make it the default shell for the root user > > @@ -27,6 +27,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW: > world, or to merely disable the most expensive debugging functionality > at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > +20211020: > + sh(1) is now the default shell for the root user. to force root to use New sentences start with capital letter. We also typically use double space to separate sentences as it makes easier to read text with fixed- width fonts, e.g. on the terminal. > + the csh shell, please run the following command as root: > + > + $ chsh -s csh Suggesting to run the command as root and using non-root prompt ($) in the example is confusing. ./danfe From nobody Wed Oct 20 07:47:08 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 03C8418030D9; Wed, 20 Oct 2021 07:47: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 4HZ2kh65bbz3Fsg; Wed, 20 Oct 2021 07:47: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 B096323BAC; Wed, 20 Oct 2021 07:47: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 19K7l8To004643; Wed, 20 Oct 2021 07:47:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K7l8RL004642; Wed, 20 Oct 2021 07:47:08 GMT (envelope-from git) Date: Wed, 20 Oct 2021 07:47:08 GMT Message-Id: <202110200747.19K7l8RL004642@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: 6ae38ab45396 - main - UPDATING: fix style List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 6ae38ab45396edaea26b4725e0c7db8cffa5f208 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=6ae38ab45396edaea26b4725e0c7db8cffa5f208 commit 6ae38ab45396edaea26b4725e0c7db8cffa5f208 Author: Baptiste Daroussin AuthorDate: 2021-10-20 07:44:44 +0000 Commit: Baptiste Daroussin CommitDate: 2021-10-20 07:44:44 +0000 UPDATING: fix style Reported by: danfe --- UPDATING | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UPDATING b/UPDATING index 798f188971b8..8028c5f192cb 100644 --- a/UPDATING +++ b/UPDATING @@ -28,10 +28,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW: at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) 20211020: - sh(1) is now the default shell for the root user. to force root to use + sh(1) is now the default shell for the root user. To force root to use the csh shell, please run the following command as root: - $ chsh -s csh + # chsh -s csh 20211004: Ncurses distribution has been split between libtinfow and libncurses From nobody Wed Oct 20 07:47:40 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AF618180365D; Wed, 20 Oct 2021 07:47:42 +0000 (UTC) (envelope-from bapt@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 4HZ2lL4cg5z3GHX; Wed, 20 Oct 2021 07:47:42 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: from aniel.nours.eu (nours.eu [IPv6:2001:41d0:8:3a4d::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 625586B2C; Wed, 20 Oct 2021 07:47:42 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: by aniel.nours.eu (Postfix, from userid 1001) id 24868B2CCC; Wed, 20 Oct 2021 09:47:40 +0200 (CEST) Date: Wed, 20 Oct 2021 09:47:40 +0200 From: Baptiste Daroussin To: Alexey Dokuchaev Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: d410b585b6f0 - main - sh(1): make it the default shell for the root user Message-ID: <20211020074740.dn5qnunqwmtxzhpq@aniel.nours.eu> References: <202110200734.19K7YWgT090885@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ThisMailContainsUnwantedMimeParts: N On Wed, Oct 20, 2021 at 07:43:01AM +0000, Alexey Dokuchaev wrote: > On Wed, Oct 20, 2021 at 07:34:32AM +0000, Baptiste Daroussin wrote: > > commit d410b585b6f00a26c2de7724d6576a3ea7d548b7 > > > > sh(1): make it the default shell for the root user > > > > @@ -27,6 +27,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW: > > world, or to merely disable the most expensive debugging functionality > > at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > > > +20211020: > > + sh(1) is now the default shell for the root user. to force root to use > > New sentences start with capital letter. We also typically use double > space to separate sentences as it makes easier to read text with fixed- > width fonts, e.g. on the terminal. > > > + the csh shell, please run the following command as root: > > + > > + $ chsh -s csh > > Suggesting to run the command as root and using non-root prompt ($) in > the example is confusing. > > ./danfe Fixed, Thanks, Bapt From nobody Wed Oct 20 08:08:40 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EA0C0180C27E; Wed, 20 Oct 2021 08:08:40 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HZ3CX62XPz3MZs; Wed, 20 Oct 2021 08:08:40 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1634717320; 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=wikI98zyGaY+ofUNc0H3FaXcErzdFVQffnc83CNPuJM=; b=slqeiJWTRZsbb21xU96pVQ646SFTQ+NohqltqIgiRKzu4v8xSpvYJ/3YluFKQ9PbEvUDNu FHKIBhS62+OXffe6JQCx+ZhQ+WGrsO9ztpvmURnTQ0buz5rZR/UIl3wzTdfku6zu4gF24w sNcrA4hcuM0F9YYpS9zab0z2jRjfeZnv73kRbkyDsIgc9XS7Fib/WhM0WJ/ie8Ua8MsRju CqwO7Kw2obBlyyCkfvrIMO+lmA5v3rDI7zhyKG7HBYrmjEMmg/GYu4uQrk0q7cXiKGKXoG UHmTbJoVa2Wdl8Ma+PK4rxTyhv94QJpMadN2MvS8KS+yRdkSbhx5lHz9cdnxJg== Received: by freefall.freebsd.org (Postfix, from userid 1033) id AE2121BB8E; Wed, 20 Oct 2021 08:08:40 +0000 (UTC) Date: Wed, 20 Oct 2021 08:08:40 +0000 From: Alexey Dokuchaev To: Baptiste Daroussin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: d410b585b6f0 - main - sh(1): make it the default shell for the root user Message-ID: References: <202110200734.19K7YWgT090885@gitrepo.freebsd.org> <20211020074740.dn5qnunqwmtxzhpq@aniel.nours.eu> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211020074740.dn5qnunqwmtxzhpq@aniel.nours.eu> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1634717320; 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=wikI98zyGaY+ofUNc0H3FaXcErzdFVQffnc83CNPuJM=; b=s4sHM9q8yD957B7Etvt3QdPJhCp0fooOOuptBJU/x+DoEu4dJLWAhqE/ML9b0VfIKqXLHa KKwfAONJnZJGUzfNhgGuIR5H+baP9XyyaWvyLchow1Kh52Sdl4AjwZQjPh3qZhLgnGlxfF tEMf0JxlrPFahkKxFmr+Di1jJmWM7Q+gxwWS5A9juCu5dPVLEl9oCBjnJoUenM65rE///n OaCfQ8mSRTJwxxRMpuyCWyIb8SE9djxWKRdV22AgEeyLp7GHksoEzJUWcN/0/5Si5p3759 6AfwMQThr8zpsXlzgAU98y/y9h8fjybM2SaZTEQPzehH81hdmeLY6dfmTeaAEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1634717320; a=rsa-sha256; cv=none; b=Xd2/8oy/VaJsJxJ7K12OfSBfGhUL09rriRDo4vM9XaCk2kSylVzU1DAaTpShBD3KWkUt5h uG4LwrSGYtblfMFLmqfoT3oudlcR5UhUo52QWC54Z0mKrmDIp8r0McoROmRx8yljYmIeZ1 tFoDPXyG+7HbqJodkQhS85UVJIRihydblXcO6ejKNXX0RozpDqJbnCi3sCU/NUpSN9GUGd PBBKyyATS89yMtTxKevanY9GwRLaGguFNwDPDzlXbdBGAgFHEsjN1uM3YdfcdGcFFtlGwL T8jg/ATJbDylcoVPn2i4MmmxlQGissPmm4r1cdwANYJ9Z0vhrGYBQIzBB+vmlw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On Wed, Oct 20, 2021 at 09:47:40AM +0200, Baptiste Daroussin wrote: > On Wed, Oct 20, 2021 at 07:43:01AM +0000, Alexey Dokuchaev wrote: > > On Wed, Oct 20, 2021 at 07:34:32AM +0000, Baptiste Daroussin wrote: > > > commit d410b585b6f00a26c2de7724d6576a3ea7d548b7 > > > > > > sh(1): make it the default shell for the root user > > > > > > @@ -27,6 +27,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW: > > > world, or to merely disable the most expensive debugging functionality > > > at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > > > > > +20211020: > > > + sh(1) is now the default shell for the root user. to force root to use > > > > New sentences start with capital letter. We also typically use double > > space to separate sentences as it makes easier to read text with fixed- > > width fonts, e.g. on the terminal. > > > > > + the csh shell, please run the following command as root: > > > + > > > + $ chsh -s csh > > > > Suggesting to run the command as root and using non-root prompt ($) in > > the example is confusing. > > Fixed, Very nice, thank you! ./danfe From nobody Wed Oct 20 09:04:13 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B80051805A05; Wed, 20 Oct 2021 09:04: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 4HZ4Rd4prqz3rl9; Wed, 20 Oct 2021 09:04: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 7A7B524A4A; Wed, 20 Oct 2021 09:04: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 19K94DeZ011790; Wed, 20 Oct 2021 09:04:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K94DTj011789; Wed, 20 Oct 2021 09:04:13 GMT (envelope-from git) Date: Wed, 20 Oct 2021 09:04:13 GMT Message-Id: <202110200904.19K94DTj011789@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: 68914dab436a - main - timeout: eliminate usage of sysexits List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 68914dab436acf166b8f851c4fa0acecb7c7c510 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=68914dab436acf166b8f851c4fa0acecb7c7c510 commit 68914dab436acf166b8f851c4fa0acecb7c7c510 Author: Baptiste Daroussin AuthorDate: 2021-10-20 08:39:34 +0000 Commit: Baptiste Daroussin CommitDate: 2021-10-20 08:39:34 +0000 timeout: eliminate usage of sysexits It brings no value at all the sysexits and maybe misleading as the return value of timeout(1) matters. --- usr.bin/timeout/timeout.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/usr.bin/timeout/timeout.c b/usr.bin/timeout/timeout.c index d682541e9162..6af795ba7408 100644 --- a/usr.bin/timeout/timeout.c +++ b/usr.bin/timeout/timeout.c @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #define EXIT_TIMEOUT 124 @@ -58,7 +57,7 @@ usage(void) " [--kill-after time | -k time] [--foreground] " " \n", getprogname()); - exit(EX_USAGE); + exit(EXIT_FAILURE); } static double @@ -75,7 +74,7 @@ parse_duration(const char *duration) return (ret); if (end != NULL && *(end + 1) != '\0') - errx(EX_USAGE, "invalid duration"); + errx(125, "invalid duration"); switch (*end) { case 's': @@ -156,7 +155,7 @@ set_interval(double iv) tim.it_value.tv_usec = (suseconds_t)(iv * 1000000UL); if (setitimer(ITIMER_REAL, &tim, NULL) == -1) - err(EX_OSERR, "setitimer()"); + err(EXIT_FAILURE, "setitimer()"); } int @@ -229,7 +228,7 @@ main(int argc, char **argv) if (!foreground) { /* Acquire a reaper */ if (procctl(P_PID, getpid(), PROC_REAP_ACQUIRE, NULL) == -1) - err(EX_OSERR, "Fail to acquire the reaper"); + err(EXIT_FAILURE, "Fail to acquire the reaper"); } memset(&signals, 0, sizeof(signals)); @@ -247,14 +246,14 @@ main(int argc, char **argv) for (i = 0; i < sizeof(signums) / sizeof(signums[0]); i ++) if (signums[i] != -1 && signums[i] != 0 && sigaction(signums[i], &signals, NULL) == -1) - err(EX_OSERR, "sigaction()"); + err(EXIT_FAILURE, "sigaction()"); signal(SIGTTIN, SIG_IGN); signal(SIGTTOU, SIG_IGN); pid = fork(); if (pid == -1) - err(EX_OSERR, "fork()"); + err(EXIT_FAILURE, "fork()"); else if (pid == 0) { /* child process */ signal(SIGTTIN, SIG_DFL); @@ -270,7 +269,7 @@ main(int argc, char **argv) } if (sigprocmask(SIG_BLOCK, &signals.sa_mask, NULL) == -1) - err(EX_OSERR, "sigprocmask()"); + err(EXIT_FAILURE, "sigprocmask()"); /* parent continues here */ set_interval(first_kill); @@ -344,7 +343,7 @@ main(int argc, char **argv) while (!child_done && wait(&pstat) == -1) { if (errno != EINTR) - err(EX_OSERR, "waitpid()"); + err(EXIT_FAILURE, "waitpid()"); } if (!foreground) From nobody Wed Oct 20 09:04:14 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 01717180592D; Wed, 20 Oct 2021 09:04: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 4HZ4Rf5yTjz3rw4; Wed, 20 Oct 2021 09:04: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 A872624D89; Wed, 20 Oct 2021 09:04: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 19K94EQO011814; Wed, 20 Oct 2021 09:04:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K94EYr011813; Wed, 20 Oct 2021 09:04:14 GMT (envelope-from git) Date: Wed, 20 Oct 2021 09:04:14 GMT Message-Id: <202110200904.19K94EYr011813@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: 3f550f019185 - main - timeout: style fixes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 3f550f01918511ac73884828f98ad1eaae2c18b4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=3f550f01918511ac73884828f98ad1eaae2c18b4 commit 3f550f01918511ac73884828f98ad1eaae2c18b4 Author: Baptiste Daroussin AuthorDate: 2021-10-20 08:44:32 +0000 Commit: Baptiste Daroussin CommitDate: 2021-10-20 08:44:32 +0000 timeout: style fixes --- usr.bin/timeout/timeout.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.bin/timeout/timeout.c b/usr.bin/timeout/timeout.c index 6af795ba7408..d6b82373c0a1 100644 --- a/usr.bin/timeout/timeout.c +++ b/usr.bin/timeout/timeout.c @@ -127,7 +127,7 @@ sig_handler(int signo) return; } - switch(signo) { + switch (signo) { case 0: case SIGINT: case SIGHUP: @@ -237,13 +237,13 @@ main(int argc, char **argv) if (killsig != SIGKILL && killsig != SIGSTOP) signums[0] = killsig; - for (i = 0; i < sizeof(signums) / sizeof(signums[0]); i ++) + for (i = 0; i < sizeof(signums) / sizeof(signums[0]); i++) sigaddset(&signals.sa_mask, signums[i]); signals.sa_handler = sig_handler; signals.sa_flags = SA_RESTART; - for (i = 0; i < sizeof(signums) / sizeof(signums[0]); i ++) + for (i = 0; i < sizeof(signums) / sizeof(signums[0]); i++) if (signums[i] != -1 && signums[i] != 0 && sigaction(signums[i], &signals, NULL) == -1) err(EXIT_FAILURE, "sigaction()"); @@ -351,7 +351,7 @@ main(int argc, char **argv) if (WEXITSTATUS(pstat)) pstat = WEXITSTATUS(pstat); - else if(WIFSIGNALED(pstat)) + else if (WIFSIGNALED(pstat)) pstat = 128 + WTERMSIG(pstat); if (timedout && !preserve) From nobody Wed Oct 20 09:24:42 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 970D0180EA0A; Wed, 20 Oct 2021 09:24: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 4HZ4vG3jMPz4SNW; Wed, 20 Oct 2021 09:24: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 5B7BA25120; Wed, 20 Oct 2021 09:24: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 19K9Ogud037917; Wed, 20 Oct 2021 09:24:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K9Ogpc037916; Wed, 20 Oct 2021 09:24:42 GMT (envelope-from git) Date: Wed, 20 Oct 2021 09:24:42 GMT Message-Id: <202110200924.19K9Ogpc037916@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: 5fe973734866 - main - skel: update .shrc as well List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 5fe97373486619373e3eeecb25582b5c937a26c5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=5fe97373486619373e3eeecb25582b5c937a26c5 commit 5fe97373486619373e3eeecb25582b5c937a26c5 Author: Baptiste Daroussin AuthorDate: 2021-10-20 09:23:13 +0000 Commit: Baptiste Daroussin CommitDate: 2021-10-20 09:23:13 +0000 skel: update .shrc as well Somehow we end up having 2 definition of the same .shrc in the source tree, both of them should have been updated. A batter fix would be to only keep one copy of the same file. but that would be for another commit Reported by: lme --- share/skel/dot.shrc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/share/skel/dot.shrc b/share/skel/dot.shrc index f497bd66f819..56a6b1828131 100644 --- a/share/skel/dot.shrc +++ b/share/skel/dot.shrc @@ -31,6 +31,14 @@ alias g='egrep -i' # alias mv='mv -i' # alias rm='rm -i' +# # csh like history on arrow up and down +bind ^[[A ed-search-prev-history +bind ^[[B ed-search-next-history + +# # ctrl+arrow allow to jump from words to words +bind "\\e[1;5C" em-next-word +bind "\\e[1;5D" ed-prev-word +alias history='fc -l' # set prompt: ``username@hostname:directory $ '' PS1="\u@\h:\w \\$ " From nobody Wed Oct 20 09:52:06 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DC77717F0862; Wed, 20 Oct 2021 09:52:09 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HZ5Vx58Qyz4ZC7; Wed, 20 Oct 2021 09:52:09 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1md8GU-000681-4e; Wed, 20 Oct 2021 12:52:06 +0300 Date: Wed, 20 Oct 2021 12:52:06 +0300 From: Slawa Olhovchenkov To: Emmanuel Vadot Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: <20211020095206.GA77338@zxy.spb.ru> References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-Rspamd-Queue-Id: 4HZ5Vx58Qyz4ZC7 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Tue, Oct 19, 2021 at 01:37:00PM +0200, Emmanuel Vadot wrote: > On Tue, 19 Oct 2021 14:21:33 +0300 > Slawa Olhovchenkov wrote: > > > On Tue, Oct 19, 2021 at 07:38:15AM +0000, Emmanuel Vadot wrote: > > > > > The branch main has been updated by manu: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=225639e7db685a4047e384abdbc296c0e02bd147 > > > > > > commit 225639e7db685a4047e384abdbc296c0e02bd147 > > > Author: Emmanuel Vadot > > > AuthorDate: 2021-10-18 08:16:41 +0000 > > > Commit: Emmanuel Vadot > > > CommitDate: 2021-10-19 07:37:28 +0000 > > > > > > vt: Disable bell by default > > > > > > Bell is either useless if you're working on remote servers or really annoying > > > when you're working with a local machine that have a loud buzzer. > > > Switch the default to have it disable. > > > > For you, not for me, for example. Also, this is violate POLA. > > Just set kern.vt.enable_bell=1 in /etc/sysctl.conf and you will be > happy again. I'll do some UPDATING note. > And POLA doesn't means that we can't change a thing. Modify bsdinstall to set kern.vt.enable_bell=0 in /etc/sysctl.conf, this is don't break POLA for updating existing install and be happy you. From nobody Wed Oct 20 10:02:20 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 04C1617F686D; Wed, 20 Oct 2021 10:02: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 4HZ5kh6mkJz4dRV; Wed, 20 Oct 2021 10:02:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8456253FF; Wed, 20 Oct 2021 10:02:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19KA2Kku091233; Wed, 20 Oct 2021 10:02:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19KA2Kfr091232; Wed, 20 Oct 2021 10:02:20 GMT (envelope-from git) Date: Wed, 20 Oct 2021 10:02:20 GMT Message-Id: <202110201002.19KA2Kfr091232@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 4fb002805e0d - main - Pass the ACPI ID when reading the ACPI domain List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4fb002805e0dc0d08825bce65a0f4e533c53ec54 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=4fb002805e0dc0d08825bce65a0f4e533c53ec54 commit 4fb002805e0dc0d08825bce65a0f4e533c53ec54 Author: Andrew Turner AuthorDate: 2021-10-18 09:04:06 +0000 Commit: Andrew Turner CommitDate: 2021-10-20 10:02:06 +0000 Pass the ACPI ID when reading the ACPI domain The ACPI ID may not be the same as the FreeBSD CPU id. Use the former when finding the CPU domain as there is no requirement for it to be identical to the latter. Reported by: dch, kevans Reviewed by: kevans Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32546 --- sys/arm64/arm64/mp_machdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c index 5f88900f4074..15e05ef46262 100644 --- a/sys/arm64/arm64/mp_machdep.c +++ b/sys/arm64/arm64/mp_machdep.c @@ -569,7 +569,7 @@ madt_handler(ACPI_SUBTABLE_HEADER *entry, void *arg) domain = 0; #ifdef NUMA if (vm_ndomains > 1) - domain = acpi_pxm_get_cpu_locality(*cpuid); + domain = acpi_pxm_get_cpu_locality(intr->Uid); #endif if (start_cpu(id, intr->ArmMpidr, domain)) { MPASS(cpuid_to_pcpu[id] != NULL); From nobody Wed Oct 20 11:42:37 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 359BC17FA8E6; Wed, 20 Oct 2021 11:42:46 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mail.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HZ7yY5JWFz3Ly8; Wed, 20 Oct 2021 11:42:45 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1634730158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hccGPi8jlaK8bMaxtX/0phPhC6vwEudJU0OpRlsraus=; b=CPZnfx0tUvoVdlPOPfDK3KRL2BRNPeX15V2hYxnFur7epZIUbJOksqjC2BobBJ+gSYFf/k Ai8GDYrDHv+BvlVweC4IcSUeZLKfdvMiwOr+2n6yxtRmyFWVLQAGPqNrHjyPEw1WlF3/8t QIrS9rcsVrSkr2ZMgDVXLqOSHwCbgEM= Received: from amy (lfbn-idf2-1-644-191.w86-247.abo.wanadoo.fr [86.247.100.191]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 185098ab (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 20 Oct 2021 11:42:37 +0000 (UTC) Date: Wed, 20 Oct 2021 13:42:37 +0200 From: Emmanuel Vadot To: Slawa Olhovchenkov Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-Id: <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> In-Reply-To: <20211020095206.GA77338@zxy.spb.ru> References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HZ7yY5JWFz3Ly8 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Wed, 20 Oct 2021 12:52:06 +0300 Slawa Olhovchenkov wrote: > On Tue, Oct 19, 2021 at 01:37:00PM +0200, Emmanuel Vadot wrote: > > > On Tue, 19 Oct 2021 14:21:33 +0300 > > Slawa Olhovchenkov wrote: > > > > > On Tue, Oct 19, 2021 at 07:38:15AM +0000, Emmanuel Vadot wrote: > > > > > > > The branch main has been updated by manu: > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=225639e7db685a4047e384abdbc296c0e02bd147 > > > > > > > > commit 225639e7db685a4047e384abdbc296c0e02bd147 > > > > Author: Emmanuel Vadot > > > > AuthorDate: 2021-10-18 08:16:41 +0000 > > > > Commit: Emmanuel Vadot > > > > CommitDate: 2021-10-19 07:37:28 +0000 > > > > > > > > vt: Disable bell by default > > > > > > > > Bell is either useless if you're working on remote servers or really annoying > > > > when you're working with a local machine that have a loud buzzer. > > > > Switch the default to have it disable. > > > > > > For you, not for me, for example. Also, this is violate POLA. > > > > Just set kern.vt.enable_bell=1 in /etc/sysctl.conf and you will be > > happy again. I'll do some UPDATING note. > > And POLA doesn't means that we can't change a thing. > > Modify bsdinstall to set kern.vt.enable_bell=0 in /etc/sysctl.conf, > this is don't break POLA for updating existing install and be happy you. Stop using POLA for "This is a change that I don't agree with". In the past weeks we had commits that changed mixer(8) cli in a non-backward compatible way and changed the root shell. For both you haven't complain so it means that either you don't care or you agree with those changes. I agree that the bell is clearly a user preference and also I could have left the review opened for more time (but I've been there and usually you have review/feedback the first day and after it's silent). I wish there was an easy way for developer (and community member) to create a poll for changes like that but we don't have one right now. Now based on the number of people who reviewed and the people who sent me private message to thanks me for this change I think that more people are annoyed by the bell than people who wants it and we want sane default that most users agrees on in base FreeBSD. If you don't agree with the defaults we have a way to change them. Cheers, -- Emmanuel Vadot From nobody Wed Oct 20 12:00:22 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D4FFF1803EFC; Wed, 20 Oct 2021 12: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 4HZ8Lt5jQsz3jg2; Wed, 20 Oct 2021 12: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 A402B27126; Wed, 20 Oct 2021 12: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 19KC0MTI046086; Wed, 20 Oct 2021 12: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 19KC0MJq046085; Wed, 20 Oct 2021 12:00:22 GMT (envelope-from git) Date: Wed, 20 Oct 2021 12:00:22 GMT Message-Id: <202110201200.19KC0MJq046085@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: f3aad18d5e57 - main - sh(1): fix home/del key on mobaxterm env List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: f3aad18d5e57328469be0e3be9e17d7bc48e6822 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=f3aad18d5e57328469be0e3be9e17d7bc48e6822 commit f3aad18d5e57328469be0e3be9e17d7bc48e6822 Author: Baptiste Daroussin AuthorDate: 2021-10-20 11:58:18 +0000 Commit: Baptiste Daroussin CommitDate: 2021-10-20 12:00:20 +0000 sh(1): fix home/del key on mobaxterm env For $reason mobaxterm default on sending unusual sequence from home/del key, which makes libedit unabel to catch them and bind them correctly. mobaxterm seems popular on the windows environment, so add proper keybinding to default shrc configuration so it works out of box. Reported by: lme --- bin/sh/dot.shrc | 4 ++++ share/skel/dot.shrc | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/bin/sh/dot.shrc b/bin/sh/dot.shrc index 5a111a61a38d..75d0ec047734 100644 --- a/bin/sh/dot.shrc +++ b/bin/sh/dot.shrc @@ -40,6 +40,10 @@ bind "\\e[1;5C" em-next-word bind "\\e[1;5D" ed-prev-word alias history='fc -l' +# Fix home/del for mobaxterm +bind ^[[5~ ed-move-to-beg +bind ^[[6~ ed-move-to-end + # read(2) of directories may not be desirable by default, as this will provoke # EISDIR errors from each directory encountered. # alias grep='grep -d skip' diff --git a/share/skel/dot.shrc b/share/skel/dot.shrc index 56a6b1828131..1f33504db0c0 100644 --- a/share/skel/dot.shrc +++ b/share/skel/dot.shrc @@ -40,6 +40,10 @@ bind "\\e[1;5C" em-next-word bind "\\e[1;5D" ed-prev-word alias history='fc -l' +# Fix home/del for mobaxterm +bind ^[[5~ ed-move-to-beg +bind ^[[6~ ed-move-to-end + # set prompt: ``username@hostname:directory $ '' PS1="\u@\h:\w \\$ " From nobody Wed Oct 20 12:15:32 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1C4D3180AD6B; Wed, 20 Oct 2021 12:15:41 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HZ8hX6bNVz3nxd; Wed, 20 Oct 2021 12:15:40 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1mdAVI-0006k6-NJ; Wed, 20 Oct 2021 15:15:32 +0300 Date: Wed, 20 Oct 2021 15:15:32 +0300 From: Slawa Olhovchenkov To: Emmanuel Vadot Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: <20211020121532.GX33191@zxy.spb.ru> References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-Rspamd-Queue-Id: 4HZ8hX6bNVz3nxd X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Wed, Oct 20, 2021 at 01:42:37PM +0200, Emmanuel Vadot wrote: > On Wed, 20 Oct 2021 12:52:06 +0300 > Slawa Olhovchenkov wrote: > > > On Tue, Oct 19, 2021 at 01:37:00PM +0200, Emmanuel Vadot wrote: > > > > > On Tue, 19 Oct 2021 14:21:33 +0300 > > > Slawa Olhovchenkov wrote: > > > > > > > On Tue, Oct 19, 2021 at 07:38:15AM +0000, Emmanuel Vadot wrote: > > > > > > > > > The branch main has been updated by manu: > > > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=225639e7db685a4047e384abdbc296c0e02bd147 > > > > > > > > > > commit 225639e7db685a4047e384abdbc296c0e02bd147 > > > > > Author: Emmanuel Vadot > > > > > AuthorDate: 2021-10-18 08:16:41 +0000 > > > > > Commit: Emmanuel Vadot > > > > > CommitDate: 2021-10-19 07:37:28 +0000 > > > > > > > > > > vt: Disable bell by default > > > > > > > > > > Bell is either useless if you're working on remote servers or really annoying > > > > > when you're working with a local machine that have a loud buzzer. > > > > > Switch the default to have it disable. > > > > > > > > For you, not for me, for example. Also, this is violate POLA. > > > > > > Just set kern.vt.enable_bell=1 in /etc/sysctl.conf and you will be > > > happy again. I'll do some UPDATING note. > > > And POLA doesn't means that we can't change a thing. > > > > Modify bsdinstall to set kern.vt.enable_bell=0 in /etc/sysctl.conf, > > this is don't break POLA for updating existing install and be happy you. > > Stop using POLA for "This is a change that I don't agree with". > In the past weeks we had commits that changed mixer(8) cli in a > non-backward compatible way and changed the root shell. For both you > haven't complain so it means that either you don't care or you agree > with those changes. root shell change promises same behavior as present (and don't changed on existing install w/o manual confirm by etcupdate), mixer cli don't used by me daily (every time I am read manual) > I agree that the bell is clearly a user preference and also I could > have left the review opened for more time (but I've been there and > usually you have review/feedback the first day and after it's silent). > I wish there was an easy way for developer (and community member) to > create a poll for changes like that but we don't have one right now. > Now based on the number of people who reviewed and the people who sent > me private message to thanks me for this change I think that more > people are annoyed by the bell than people who wants it and we want > sane default that most users agrees on in base FreeBSD. If you don't > agree with the defaults we have a way to change them. I am say not about for new install, I am say about change behavior of existing install after upgrade to 14. Modify bsdinstall satisfy people are annoyed by the bell and don't touch people accepted bell on existing install. win-win mostly. From nobody Wed Oct 20 12:24:23 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 46E3E180EEAE; Wed, 20 Oct 2021 12:24: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 4HZ8tc1Pjtz3s4x; Wed, 20 Oct 2021 12:24: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 105BE27916; Wed, 20 Oct 2021 12:24:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19KCONQC077045; Wed, 20 Oct 2021 12:24:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19KCONV8077044; Wed, 20 Oct 2021 12:24:23 GMT (envelope-from git) Date: Wed, 20 Oct 2021 12:24:23 GMT Message-Id: <202110201224.19KCONV8077044@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: 2a213a2e2829 - main - OptionalObsoleteFiles: add more googletest files to remove List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 2a213a2e2829e026cf374480ee2402c8d6c35a7c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=2a213a2e2829e026cf374480ee2402c8d6c35a7c commit 2a213a2e2829e026cf374480ee2402c8d6c35a7c Author: Baptiste Daroussin AuthorDate: 2021-10-20 12:18:37 +0000 Commit: Baptiste Daroussin CommitDate: 2021-10-20 12:18:37 +0000 OptionalObsoleteFiles: add more googletest files to remove --- tools/build/mk/OptionalObsoleteFiles.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index acd578912e77..141f691ba83e 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -2250,6 +2250,7 @@ OLD_FILES+=usr/tests/lib/googletest/gtest/gtest-death-test_ex_nocatch_test OLD_FILES+=usr/tests/lib/googletest/gtest/gtest-unittest-api_test OLD_FILES+=usr/tests/lib/googletest/gtest/Kyuafile OLD_DIRS+=usr/tests/lib/googletest/gtest +OLD_FILES+=usr/tests/lib/googletest/gtest_main/Kyuafile OLD_FILES+=usr/tests/lib/googletest/gtest_main/googletest-death-test-test OLD_FILES+=usr/tests/lib/googletest/gtest_main/googletest-filepath-test OLD_FILES+=usr/tests/lib/googletest/gtest_main/googletest-linked-ptr-test @@ -2259,16 +2260,17 @@ OLD_FILES+=usr/tests/lib/googletest/gtest_main/googletest-options-test OLD_FILES+=usr/tests/lib/googletest/gtest_main/googletest-port-test OLD_FILES+=usr/tests/lib/googletest/gtest_main/googletest-printers-test OLD_FILES+=usr/tests/lib/googletest/gtest_main/googletest-test-part-test +OLD_FILES+=usr/tests/lib/googletest/gtest_main/gtest-typed-test_test OLD_FILES+=usr/tests/lib/googletest/gtest_main/gtest_help_test_ OLD_FILES+=usr/tests/lib/googletest/gtest_main/gtest_main_unittest OLD_FILES+=usr/tests/lib/googletest/gtest_main/gtest_pred_impl_unittest OLD_FILES+=usr/tests/lib/googletest/gtest_main/gtest_prod_test +OLD_FILES+=usr/tests/lib/googletest/gtest_main/gtest_skip_in_environment_setup_test +OLD_FILES+=usr/tests/lib/googletest/gtest_main/gtest_skip_test OLD_FILES+=usr/tests/lib/googletest/gtest_main/gtest_sole_header_test OLD_FILES+=usr/tests/lib/googletest/gtest_main/gtest_unittest OLD_FILES+=usr/tests/lib/googletest/gtest_main/gtest_xml_outfile1_test_ OLD_FILES+=usr/tests/lib/googletest/gtest_main/gtest_xml_outfile2_test_ -OLD_FILES+=usr/tests/lib/googletest/gtest_main/gtest-typed-test_test -OLD_FILES+=usr/tests/lib/googletest/gtest_main/Kyuafile OLD_DIRS+=usr/tests/lib/googletest/gtest_main OLD_FILES+=usr/tests/lib/googletest/Kyuafile OLD_DIRS+=usr/tests/lib/googletest/ From nobody Wed Oct 20 13:57:04 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1BEF1180FE09 for ; Wed, 20 Oct 2021 13:57:12 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) (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 4HZBxg1d2Fz4ms4 for ; Wed, 20 Oct 2021 13:57:11 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x82e.google.com with SMTP id i1so3056560qtr.6 for ; Wed, 20 Oct 2021 06:57:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=V9EefiqIWTg55GqTiYdCzRwBuMFS+YbiEwebUn2RmnI=; b=B/cYwzk+NnSyCNgXev9wiYZJRP9V91h8Tnq9Tv5DXQgivyyW0m99JLTfttpH6AR2Ld mOWXZOr1+SS8QVLadfhtbiL+h/D/vaIUppHfbVn8UTCKisTSr5ik+CpuRFGJgI9/F+19 SGI41nINFh+CoSGUTy30RK3UDIr+v3WdFY0nD4SUj7NUF3GanUMcnMhZw581LDJHSSfH dxKygMfskmcCdxK4NdQ15o2i6bzxf1e+FA9ReRh4DaQbNycEYLMhm5TUrvZkIAZQOUwR 0GiJ9bN9EOWUqWtpGUImrWCHpj3lK2Aia28ZNnHMzZktPeC+pIf18TlAmVVZHadWAyro iiJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=V9EefiqIWTg55GqTiYdCzRwBuMFS+YbiEwebUn2RmnI=; b=42xSJLmn9CNMI79a7LWd498Va9q6DbsBrb5Nsrpc9daWt7yePRCAjbqt+c7humUtVg N8f7flCV7kngWU5dquS2ebuA8fmtakogCiy8cyG5X9w9m1jVMAzL8EvX+i1/IgHYpSiB GikQW/7TvkDET1mqqswjz+l8x0Bgpu2T3GAxWpOp1/8vJv/XkIsgp1bxueyJETuBnF5g pZCUyhiFIRJ9evpSGZl+nVyGcwfzkMlPFCLz55UgdAX6T8CHD7f8VMRTRo3iOeTKvFfx O2U9kNbUZBYw86l5R0fGvtxIe4I1KW6KcXxODFHTNwsI053qB7YjXFsiDUztJawhtnKj AKfg== X-Gm-Message-State: AOAM5316iJzXa3gOVzWHLqWQdyiTqM1f4+iNivBRUWIzNdxRLoWRXypM W/xjEJF8LICWoBsIT4QViTQwtQ== X-Google-Smtp-Source: ABdhPJyvw8HbCrZ4Gbr0WpDgY1fyxYNJTth2lQNA+PYhS/JRop0/WICguEtAkt7ToFXNtiHvg7lTCQ== X-Received: by 2002:a05:622a:550:: with SMTP id m16mr8661qtx.343.1634738225471; Wed, 20 Oct 2021 06:57:05 -0700 (PDT) Received: from mutt-hbsd (pool-100-16-224-136.bltmmd.fios.verizon.net. [100.16.224.136]) by smtp.gmail.com with ESMTPSA id m6sm1004348qkh.69.2021.10.20.06.57.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Oct 2021 06:57:05 -0700 (PDT) Date: Wed, 20 Oct 2021 09:57:04 -0400 From: Shawn Webb To: Emmanuel Vadot Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: <20211020135704.e2krf765elhscvfd@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 14.0-CURRENT-HBSD FreeBSD 14.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="bcgmyc4tcxzttycz" Content-Disposition: inline In-Reply-To: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4HZBxg1d2Fz4ms4 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b="B/cYwzk+"; dmarc=none; spf=pass (mx1.freebsd.org: domain of shawn.webb@hardenedbsd.org designates 2607:f8b0:4864:20::82e as permitted sender) smtp.mailfrom=shawn.webb@hardenedbsd.org X-Spamd-Result: default: False [-4.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; NEURAL_HAM_SHORT(-0.00)[-0.003]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::82e:from]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; MID_RHS_NOT_FQDN(0.50)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[100.16.224.136:received] X-ThisMailContainsUnwantedMimeParts: N --bcgmyc4tcxzttycz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 19, 2021 at 07:38:15AM +0000, Emmanuel Vadot wrote: > The branch main has been updated by manu: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3D225639e7db685a4047e384abdb= c296c0e02bd147 >=20 > commit 225639e7db685a4047e384abdbc296c0e02bd147 > Author: Emmanuel Vadot > AuthorDate: 2021-10-18 08:16:41 +0000 > Commit: Emmanuel Vadot > CommitDate: 2021-10-19 07:37:28 +0000 >=20 > vt: Disable bell by default > =20 > Bell is either useless if you're working on remote servers or really = annoying > when you're working with a local machine that have a loud buzzer. > Switch the default to have it disable. I have no objection to the change (or any opinion on the matter), but I wonder if changes like this carry an accessibility impact. I wonder if any hard-of-sight folks relied on the original behavior. Just thinkin' out loud. ;-) Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --bcgmyc4tcxzttycz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmFwICwACgkQ/y5nonf4 4fpgqBAAgZgl1QLjaTd41QjDJYCae5V8JsrI0oC86OncBDu1l4eUq3TCD5UIiIKl CsnwG1nJU9dKyQH373wu9F/EtHrXoN4LXUsYu+kD2PNg3562qL100WPg2loVBmHl 8RQrakCH9ew8OsVdr9sGXC4+gXMbfC4AmsAbPTK1peABwWKpIbxBDiWVZj8N2Huh uh+XwPik0Be2SHllsbpt9DoFopNmD/bQeJwTD5hNqAVwpSz4MT2NJ+MClAH8rN5X r8TuysVY7iXikbkzi3F8ybyAJnbVLs/ycF5pZHD7eMnQtr/+MlDdN4cJUeEwSXkb S3/qVy/3WXerK3FEQvbVUJUdfC8OR0W9aahsW88AUzjwlwhtHV7LAepKZvihFIGt mJx6MPGqHt5+61ZHytIZD6y2QAqd51lYXcaCM6trOx7M/GUosXRNaMEOV2yTcJQr 4QpfwP4KCtjpZaxR2ygmgFHg8smalMa9T1HAkwb1B3jOe3xXXR1FXR2DTUu7Xx7t mG42Y4DRPZvYsJmczuMH+8YCdwuxBqzSsQz81j8RpP9ogV7pSDYR6mmIQsOBDy3L 9N1jT/zN5mhHspFFBo75gNH2xXYxrbsbBt0kR0YdcHyoECvDfISq/70xXqicDCiD XjfvYjgH0Kb5jUjL55gPJGW2EZn3mdGYMuYepkXr3iNlHA0zswc= =xQor -----END PGP SIGNATURE----- --bcgmyc4tcxzttycz-- From nobody Wed Oct 20 15:59:52 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C04021802188; Wed, 20 Oct 2021 15:59:54 +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 4HZFgG4lvSz4T0F; Wed, 20 Oct 2021 15:59:54 +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 10BA0B375; Wed, 20 Oct 2021 15:59:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: 262717e270c3 - main - arswitch(4): Add new manpage To: Guangyuan Yang , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202110200335.19K3ZdfS070860@gitrepo.freebsd.org> From: John Baldwin Message-ID: <35663cb8-bddb-e108-48f8-9d09a2b2345d@FreeBSD.org> Date: Wed, 20 Oct 2021 08:59:52 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 In-Reply-To: <202110200335.19K3ZdfS070860@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 10/19/21 8:35 PM, Guangyuan Yang wrote: > The branch main has been updated by ygy (doc, ports committer): > > URL: https://cgit.FreeBSD.org/src/commit/?id=262717e270c3e8a28fa2937db750ba946be8c836 > > commit 262717e270c3e8a28fa2937db750ba946be8c836 > Author: Felix Johnson > AuthorDate: 2021-10-20 03:29:11 +0000 > Commit: Guangyuan Yang > CommitDate: 2021-10-20 03:35:04 +0000 > > arswitch(4): Add new manpage > > PR: 211668 > Reported by: O. Hartmann > Reviewed by: adrian, debdrup, imp > Differential Revision: https://reviews.freebsd.org/D32476 > --- > share/man/man4/arswitch.4 | 91 +++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 91 insertions(+) Do you need to add this to the Makefile so it is installed? -- John Baldwin From nobody Wed Oct 20 17:11:05 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 79F15180400E; Wed, 20 Oct 2021 17:11:12 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HZHFX1xdlz4thR; Wed, 20 Oct 2021 17:11:12 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 19KHB6GJ005593 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 20 Oct 2021 10:11:06 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 19KHB5VO005592; Wed, 20 Oct 2021 10:11:05 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Wed, 20 Oct 2021 10:11:05 -0700 From: Gleb Smirnoff To: Emmanuel Vadot Cc: Slawa Olhovchenkov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> X-Rspamd-Queue-Id: 4HZHFX1xdlz4thR X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N Emmanuel, On Wed, Oct 20, 2021 at 01:42:37PM +0200, Emmanuel Vadot wrote: E> Stop using POLA for "This is a change that I don't agree with". A change that just changes the system behaviour and nothing else, is a POLA violation. E> In the past weeks we had commits that changed mixer(8) cli in a E> non-backward compatible way and changed the root shell. For both you E> haven't complain so it means that either you don't care or you agree E> with those changes. Mixer and root shell weren't like your change. Mixer is a complete rewrite which has some technical background to justify it. Root shell is also different to what you did. It is not flip of a binary switch. E> I agree that the bell is clearly a user preference and also I could E> have left the review opened for more time (but I've been there and E> usually you have review/feedback the first day and after it's silent). E> I wish there was an easy way for developer (and community member) to E> create a poll for changes like that but we don't have one right now. E> Now based on the number of people who reviewed and the people who sent E> me private message to thanks me for this change I think that more E> people are annoyed by the bell than people who wants it and we want E> sane default that most users agrees on in base FreeBSD. If you don't E> agree with the defaults we have a way to change them. To me this looks like abuse of committer priveleges. I got commit bit, so I can change the defaults. Speaking of the bell itself. It is of course very annoying on some laptops, especially if the laptop is used by someone else, not you. But it is extremely useful when working in a loud server room on a console, reviving a crashed machine, usually in a very stressful environment. Gives feeling of machine being responsive or not being responsive. So it is more a question of server vs desktop default. Okay, let's ignore the biased opinion that FreeBSD is a server OS. But I would assert that vt(4) is a way more used on servers, rather than on laptops. If somebody is using vt(4) instead of X on a laptop, then this person is special. Either really impared, as Shawn suggested, or just a geek who hates GUI. In the latter case, they should tweak the configuration. -- Gleb Smirnoff From nobody Wed Oct 20 18:30:21 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 87A8418049B2; Wed, 20 Oct 2021 18:30: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 4HZK0t1dk9z4Rss; Wed, 20 Oct 2021 18:30: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 0D6D84B16; Wed, 20 Oct 2021 18:30: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 19KIUL2Y070460; Wed, 20 Oct 2021 18:30:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19KIUL1l070453; Wed, 20 Oct 2021 18:30:21 GMT (envelope-from git) Date: Wed, 20 Oct 2021 18:30:21 GMT Message-Id: <202110201830.19KIUL1l070453@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: 80bca63cf48d - main - tmpfs: remove write-only variables List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 80bca63cf48d0f4f1c6cfc1dace1369947eaaa47 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=80bca63cf48d0f4f1c6cfc1dace1369947eaaa47 commit 80bca63cf48d0f4f1c6cfc1dace1369947eaaa47 Author: Konstantin Belousov AuthorDate: 2021-10-20 01:54:48 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-20 18:29:49 +0000 tmpfs: remove write-only variables Reviewed by: imp, mjg Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32577 --- sys/fs/tmpfs/tmpfs_subr.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 1b7521cf0b0d..9810c1776314 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -454,7 +454,6 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *tmp, enum vtype type, const char *target, dev_t rdev, struct tmpfs_node **node) { struct tmpfs_node *nnode; - vm_object_t obj; char *symlink; char symlink_smr; @@ -566,7 +565,7 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *tmp, enum vtype type, break; case VREG: - obj = nnode->tn_reg.tn_aobj = + nnode->tn_reg.tn_aobj = vm_pager_allocate(tmpfs_pager_type, NULL, 0, VM_PROT_DEFAULT, 0, NULL /* XXXKIB - tmpfs needs swap reservation */); @@ -1785,7 +1784,6 @@ tmpfs_reg_resize(struct vnode *vp, off_t newsize, boolean_t ignerr) int tmpfs_reg_punch_hole(struct vnode *vp, off_t *offset, off_t *length) { - struct tmpfs_mount *tmp; struct tmpfs_node *node; vm_object_t object; vm_pindex_t pistart, pi, piend; @@ -1799,7 +1797,6 @@ tmpfs_reg_punch_hole(struct vnode *vp, off_t *offset, off_t *length) KASSERT(node->tn_type == VREG, ("%s: node is not regular file", __func__)); object = node->tn_reg.tn_aobj; - tmp = VFS_TO_TMPFS(vp->v_mount); off = *offset; len = omin(node->tn_size - off, *length); startofs = off & PAGE_MASK; From nobody Wed Oct 20 18:30:23 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 999F91804845; Wed, 20 Oct 2021 18:30: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 4HZK0v2YGNz4SB9; Wed, 20 Oct 2021 18:30: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 31B02492A; Wed, 20 Oct 2021 18:30: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 19KIUNuu070555; Wed, 20 Oct 2021 18:30:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19KIUNLT070554; Wed, 20 Oct 2021 18:30:23 GMT (envelope-from git) Date: Wed, 20 Oct 2021 18:30:23 GMT Message-Id: <202110201830.19KIUNLT070554@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: 2bd6d910b243 - main - msdosfs_rename: remove write-only variables List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 2bd6d910b24343f7678be7482a78fd7d596e6753 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2bd6d910b24343f7678be7482a78fd7d596e6753 commit 2bd6d910b24343f7678be7482a78fd7d596e6753 Author: Konstantin Belousov AuthorDate: 2021-10-20 01:55:50 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-20 18:29:49 +0000 msdosfs_rename: remove write-only variables Reviewed by: imp, mjg Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32577 --- sys/fs/msdosfs/msdosfs_vnops.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 44026c270f1c..a431190d7089 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -941,14 +941,12 @@ msdosfs_rename(struct vop_rename_args *ap) struct componentname *fcnp, *tcnp; struct denode *fdip, *fip, *tdip, *tip, *nip; u_char toname[12], oldname[11]; - u_long from_diroffset, to_diroffset; + u_long to_diroffset; bool checkpath_locked, doingdirectory, newparent; - u_char to_count; int error; u_long cn, pcl, blkoff; daddr_t bn, wait_scn, scn; struct msdosfsmount *pmp; - struct mount *mp; struct direntry *dotdotp; struct buf *bp; @@ -968,7 +966,6 @@ msdosfs_rename(struct vop_rename_args *ap) /* * Check for cross-device rename. */ - mp = fvp->v_mount; if (fvp->v_mount != tdvp->v_mount || (tvp != NULL && fvp->v_mount != tvp->v_mount)) { error = EXDEV; @@ -1031,7 +1028,6 @@ relock: } vrele(fvp); fvp = DETOV(nip); - from_diroffset = fdip->de_fndoffset; error = msdosfs_lookup_ino(tdvp, NULL, tcnp, &scn, &blkoff); if (error != 0 && error != EJUSTRETURN) { @@ -1077,7 +1073,6 @@ relock: * Remember direntry place to use for destination */ to_diroffset = tdip->de_fndoffset; - to_count = tdip->de_fndcnt; /* * Be sure we are not renaming ".", "..", or an alias of ".". This From nobody Wed Oct 20 18:30:24 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EA1AB18049BB; Wed, 20 Oct 2021 18:30: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 4HZK0w5YxJz4S0q; Wed, 20 Oct 2021 18:30: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 5F30448BE; Wed, 20 Oct 2021 18:30: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 19KIUOnY070579; Wed, 20 Oct 2021 18:30:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19KIUOhJ070578; Wed, 20 Oct 2021 18:30:24 GMT (envelope-from git) Date: Wed, 20 Oct 2021 18:30:24 GMT Message-Id: <202110201830.19KIUOhJ070578@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: 2ff7c2cc4f28 - main - sys/bus.h: silence warnings about write-only variables List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 2ff7c2cc4f28ab05caccb2936ba0d74c6734dd39 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2ff7c2cc4f28ab05caccb2936ba0d74c6734dd39 commit 2ff7c2cc4f28ab05caccb2936ba0d74c6734dd39 Author: Konstantin Belousov AuthorDate: 2021-10-20 13:23:30 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-20 18:29:49 +0000 sys/bus.h: silence warnings about write-only variables in the generated functions for bus accessors. These are the most noising instances for drivers when non-debug kernel is compiled with clang 13. Reviewed by: imp Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32578 --- sys/sys/bus.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/bus.h b/sys/sys/bus.h index bf51bdbef387..8544aa32cff8 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -805,7 +805,7 @@ DECLARE_MODULE(name##_##busname, name##_##busname##_mod, \ static __inline type varp ## _get_ ## var(device_t dev) \ { \ uintptr_t v; \ - int e; \ + int e __diagused; \ e = BUS_READ_IVAR(device_get_parent(dev), dev, \ ivarp ## _IVAR_ ## ivar, &v); \ KASSERT(e == 0, ("%s failed for %s on bus %s, error = %d", \ @@ -817,7 +817,7 @@ static __inline type varp ## _get_ ## var(device_t dev) \ static __inline void varp ## _set_ ## var(device_t dev, type t) \ { \ uintptr_t v = (uintptr_t) t; \ - int e; \ + int e __diagused; \ e = BUS_WRITE_IVAR(device_get_parent(dev), dev, \ ivarp ## _IVAR_ ## ivar, v); \ KASSERT(e == 0, ("%s failed for %s on bus %s, error = %d", \ From nobody Wed Oct 20 19:01:55 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3281317F3979; Wed, 20 Oct 2021 19:01: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 4HZKjJ0sckz4djR; Wed, 20 Oct 2021 19:01: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 F1ECA4E70; Wed, 20 Oct 2021 19:01: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 19KJ1tUZ015623; Wed, 20 Oct 2021 19:01:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19KJ1t2l015622; Wed, 20 Oct 2021 19:01:55 GMT (envelope-from git) Date: Wed, 20 Oct 2021 19:01:55 GMT Message-Id: <202110201901.19KJ1t2l015622@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: f83288645cd9 - main - powerpc64le: stand fixes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: f83288645cd9726c24ca67292fbc3abb4eb65a36 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by luporl: URL: https://cgit.FreeBSD.org/src/commit/?id=f83288645cd9726c24ca67292fbc3abb4eb65a36 commit f83288645cd9726c24ca67292fbc3abb4eb65a36 Author: Leandro Lupori AuthorDate: 2021-10-20 18:48:33 +0000 Commit: Leandro Lupori CommitDate: 2021-10-20 18:48:33 +0000 powerpc64le: stand fixes Fix boot1 and loader on PowerPC64 little-endian (LE). Due to endian issues, boot1 couldn't find the UFS boot partition and loader wasn't able to load the kernel. Most of the issues happened because boot1 and loader were BE binaries trying to access LE UFS partitions and because loader expects the kernel ELF image to use the same endian as itself. To fix these issues, boot1 and loader are now built as LE binaries on PPC64LE. To support this, the functions that call OpenFirmware were enhanced to correctly perform endian conversion on its input and output arguments and to change the CPU into BE mode before making the calls, as OpenFirmware always runs in BE. Besides that, some other small fixes were needed. Submitted by: bdragon (initial version) Reviewed by: alfredo, jhibbits Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D32160 --- stand/common/load_elf.c | 18 -- stand/defs.mk | 8 +- stand/libofw/openfirm.c | 344 +++++++++++++++-------------------- stand/libofw/openfirm.h | 7 +- stand/powerpc/Makefile | 6 +- stand/powerpc/boot1.chrp/boot1.c | 102 ++++++++++- stand/powerpc/ofw/Makefile | 14 +- stand/powerpc/ofw/cas.c | 14 +- stand/powerpc/ofw/ldscript.powerpcle | 142 +++++++++++++++ stand/powerpc/ofw/main.c | 37 +++- stand/powerpc/ofw/ofwfdt.c | 7 +- stand/powerpc/ofw/trampolineLE.S | 71 ++++++++ 12 files changed, 525 insertions(+), 245 deletions(-) diff --git a/stand/common/load_elf.c b/stand/common/load_elf.c index c163b50c9737..a213b34970f0 100644 --- a/stand/common/load_elf.c +++ b/stand/common/load_elf.c @@ -750,13 +750,6 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_t ef, uint64_t off) } #endif size = shdr[i].sh_size; -#if defined(__powerpc__) - #if __ELF_WORD_SIZE == 64 - size = htobe64(size); - #else - size = htobe32(size); - #endif -#endif archsw.arch_copyin(&size, lastaddr, sizeof(size)); lastaddr += sizeof(size); @@ -802,17 +795,6 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_t ef, uint64_t off) printf("]"); #endif -#if defined(__powerpc__) - /* On PowerPC we always need to provide BE data to the kernel */ - #if __ELF_WORD_SIZE == 64 - ssym = htobe64((uint64_t)ssym); - esym = htobe64((uint64_t)esym); - #else - ssym = htobe32((uint32_t)ssym); - esym = htobe32((uint32_t)esym); - #endif -#endif - file_addmetadata(fp, MODINFOMD_SSYM, sizeof(ssym), &ssym); file_addmetadata(fp, MODINFOMD_ESYM, sizeof(esym), &esym); diff --git a/stand/defs.mk b/stand/defs.mk index aee4636985ac..765fd046a879 100644 --- a/stand/defs.mk +++ b/stand/defs.mk @@ -120,10 +120,12 @@ CFLAGS+= -DLOADER_DISK_SUPPORT # Machine specific flags for all builds here -# Ensure PowerPC64 and PowerPC64LE boot loaders are compiled as 32 bit -# and in big endian. -.if ${MACHINE_ARCH:Mpowerpc64*} != "" +# Ensure PowerPC64 and PowerPC64LE boot loaders are compiled as 32 bit. +# PowerPC64LE boot loaders are 32-bit little-endian. +.if ${MACHINE_ARCH} == "powerpc64" CFLAGS+= -m32 -mcpu=powerpc -mbig-endian +.elif ${MACHINE_ARCH} == "powerpc64le" +CFLAGS+= -m32 -mcpu=powerpc -mlittle-endian .endif # For amd64, there's a bit of mixed bag. Some of the tree (i386, lib*32) is diff --git a/stand/libofw/openfirm.c b/stand/libofw/openfirm.c index 0b4198d281fd..b2b89581ae70 100644 --- a/stand/libofw/openfirm.c +++ b/stand/libofw/openfirm.c @@ -58,6 +58,8 @@ #include __FBSDID("$FreeBSD$"); +#include + #include #include @@ -71,6 +73,13 @@ ihandle_t mmu; ihandle_t memory; int real_mode = 0; +#define IN(x) htobe32((cell_t)x) +#define OUT(x) be32toh(x) +#define SETUP(a, b, c, d) \ + a.name = IN( (b) ); \ + a.nargs = IN( (c) ); \ + a.nreturns = IN( (d) ); + /* Initialiser */ void @@ -117,16 +126,13 @@ OF_test(char *name) cell_t nreturns; cell_t service; cell_t missing; - } args = { - (cell_t)"test", - 1, - 1, - }; + } args = {}; + SETUP(args, "test", 1, 1); - args.service = (cell_t)name; + args.service = IN(name); if (openfirmware(&args) == -1) return (-1); - return (args.missing); + return (OUT(args.missing)); } /* Return firmware millisecond count. */ @@ -138,14 +144,11 @@ OF_milliseconds() cell_t nargs; cell_t nreturns; cell_t ms; - } args = { - (cell_t)"milliseconds", - 0, - 1, - }; + } args = {}; + SETUP(args, "milliseconds", 0, 1); openfirmware(&args); - return (args.ms); + return (OUT(args.ms)); } /* @@ -162,11 +165,8 @@ OF_peer(phandle_t node) cell_t nreturns; cell_t node; cell_t next; - } args = { - (cell_t)"peer", - 1, - 1, - }; + } args = {}; + SETUP(args, "peer", 1, 1); args.node = node; if (openfirmware(&args) == -1) @@ -184,11 +184,8 @@ OF_child(phandle_t node) cell_t nreturns; cell_t node; cell_t child; - } args = { - (cell_t)"child", - 1, - 1, - }; + } args = {}; + SETUP(args, "child", 1, 1); args.node = node; if (openfirmware(&args) == -1) @@ -206,11 +203,8 @@ OF_parent(phandle_t node) cell_t nreturns; cell_t node; cell_t parent; - } args = { - (cell_t)"parent", - 1, - 1, - }; + } args = {}; + SETUP(args, "parent", 1, 1); args.node = node; if (openfirmware(&args) == -1) @@ -228,11 +222,8 @@ OF_instance_to_package(ihandle_t instance) cell_t nreturns; cell_t instance; cell_t package; - } args = { - (cell_t)"instance-to-package", - 1, - 1, - }; + } args = {}; + SETUP(args, "instance-to-package", 1, 1); args.instance = instance; if (openfirmware(&args) == -1) @@ -251,17 +242,14 @@ OF_getproplen(phandle_t package, const char *propname) cell_t package; cell_t propname; cell_t proplen; - } args = { - (cell_t)"getproplen", - 2, - 1, - }; + } args = {}; + SETUP(args, "getproplen", 2, 1); args.package = package; - args.propname = (cell_t)propname; + args.propname = IN(propname); if (openfirmware(&args) == -1) return (-1); - return (args.proplen); + return (OUT(args.proplen)); } /* Get the value of a property of a package. */ @@ -277,19 +265,31 @@ OF_getprop(phandle_t package, const char *propname, void *buf, int buflen) cell_t buf; cell_t buflen; cell_t size; - } args = { - (cell_t)"getprop", - 4, - 1, - }; + } args = {}; + SETUP(args, "getprop", 4, 1); args.package = package; - args.propname = (cell_t)propname; - args.buf = (cell_t)buf; - args.buflen = buflen; + args.propname = IN(propname); + args.buf = IN(buf); + args.buflen = IN(buflen); if (openfirmware(&args) == -1) return (-1); - return (args.size); + return (OUT(args.size)); +} + +/* Decode a binary property from a package. */ +int +OF_getencprop(phandle_t package, const char *propname, cell_t *buf, int buflen) +{ + int retval, i; + retval = OF_getprop(package, propname, buf, buflen); + if (retval == -1) + return (retval); + + for (i = 0; i < buflen/4; i++) + buf[i] = be32toh((uint32_t)buf[i]); + + return (retval); } /* Get the next property of a package. */ @@ -304,18 +304,15 @@ OF_nextprop(phandle_t package, const char *previous, char *buf) cell_t previous; cell_t buf; cell_t flag; - } args = { - (cell_t)"nextprop", - 3, - 1, - }; + } args = {}; + SETUP(args, "nextprop", 3, 1); args.package = package; - args.previous = (cell_t)previous; - args.buf = (cell_t)buf; + args.previous = IN(previous); + args.buf = IN(buf); if (openfirmware(&args) == -1) return (-1); - return (args.flag); + return (OUT(args.flag)); } /* Set the value of a property of a package. */ @@ -332,19 +329,16 @@ OF_setprop(phandle_t package, const char *propname, void *buf, int len) cell_t buf; cell_t len; cell_t size; - } args = { - (cell_t)"setprop", - 4, - 1, - }; + } args = {}; + SETUP(args, "setprop", 4, 1); args.package = package; - args.propname = (cell_t)propname; - args.buf = (cell_t)buf; - args.len = len; + args.propname = IN(propname); + args.buf = IN(buf); + args.len = IN(len); if (openfirmware(&args) == -1) return (-1); - return (args.size); + return (OUT(args.size)); } /* Convert a device specifier to a fully qualified pathname. */ @@ -359,18 +353,15 @@ OF_canon(const char *device, char *buf, int len) cell_t buf; cell_t len; cell_t size; - } args = { - (cell_t)"canon", - 3, - 1, - }; - - args.device = (cell_t)device; - args.buf = (cell_t)buf; - args.len = len; + } args = {}; + SETUP(args, "canon", 3, 1); + + args.device = IN(device); + args.buf = IN(buf); + args.len = IN(len); if (openfirmware(&args) == -1) return (-1); - return (args.size); + return (OUT(args.size)); } /* Return a package handle for the specified device. */ @@ -383,13 +374,10 @@ OF_finddevice(const char *device) cell_t nreturns; cell_t device; cell_t package; - } args = { - (cell_t)"finddevice", - 1, - 1, - }; + } args = {}; + SETUP(args, "finddevice", 1, 1); - args.device = (cell_t)device; + args.device = IN(device); if (openfirmware(&args) == -1) return (-1); return (args.package); @@ -407,18 +395,15 @@ OF_instance_to_path(ihandle_t instance, char *buf, int len) cell_t buf; cell_t len; cell_t size; - } args = { - (cell_t)"instance-to-path", - 3, - 1, - }; + } args = {}; + SETUP(args, "instance-to-path", 3, 1); args.instance = instance; - args.buf = (cell_t)buf; - args.len = len; + args.buf = IN(buf); + args.len = IN(len); if (openfirmware(&args) == -1) return (-1); - return (args.size); + return (OUT(args.size)); } /* Return the fully qualified pathname corresponding to a package. */ @@ -433,18 +418,15 @@ OF_package_to_path(phandle_t package, char *buf, int len) cell_t buf; cell_t len; cell_t size; - } args = { - (cell_t)"package-to-path", - 3, - 1, - }; + } args = {}; + SETUP(args, "package-to-path", 3, 1); args.package = package; - args.buf = (cell_t)buf; - args.len = len; + args.buf = IN(buf); + args.len = IN(len); if (openfirmware(&args) == -1) return (-1); - return (args.size); + return (OUT(args.size)); } /* Call the method in the scope of a given instance. */ @@ -459,30 +441,26 @@ OF_call_method(char *method, ihandle_t instance, int nargs, int nreturns, ...) cell_t method; cell_t instance; cell_t args_n_results[12]; - } args = { - (cell_t)"call-method", - 2, - 1, - }; + } args = {}; + SETUP(args, "call-method", nargs + 2, nreturns + 1); cell_t *cp; int n; if (nargs > 6) return (-1); - args.nargs = nargs + 2; - args.nreturns = nreturns + 1; - args.method = (cell_t)method; + args.method = IN(method); args.instance = instance; va_start(ap, nreturns); for (cp = (cell_t *)(args.args_n_results + (n = nargs)); --n >= 0;) - *--cp = va_arg(ap, cell_t); + *--cp = IN(va_arg(ap, cell_t)); if (openfirmware(&args) == -1) return (-1); if (args.args_n_results[nargs]) - return (args.args_n_results[nargs]); - for (cp = (cell_t *)(args.args_n_results + nargs + (n = args.nreturns)); - --n > 0;) - *va_arg(ap, cell_t *) = *--cp; + return (OUT(args.args_n_results[nargs])); + /* XXX what if ihandles or phandles are returned */ + for (cp = (cell_t *)(args.args_n_results + nargs + + (n = be32toh(args.nreturns))); --n > 0;) + *va_arg(ap, cell_t *) = OUT(*--cp); va_end(ap); return (0); } @@ -501,13 +479,10 @@ OF_open(char *device) cell_t nreturns; cell_t device; cell_t instance; - } args = { - (cell_t)"open", - 1, - 1, - }; + } args = {}; + SETUP(args, "open", 1, 1); - args.device = (cell_t)device; + args.device = IN(device); if (openfirmware(&args) == -1 || args.instance == 0) { return (-1); } @@ -523,10 +498,8 @@ OF_close(ihandle_t instance) cell_t nargs; cell_t nreturns; cell_t instance; - } args = { - (cell_t)"close", - 1, - }; + } args = {}; + SETUP(args, "close", 1, 0); args.instance = instance; openfirmware(&args); @@ -544,19 +517,16 @@ OF_read(ihandle_t instance, void *addr, int len) cell_t addr; cell_t len; cell_t actual; - } args = { - (cell_t)"read", - 3, - 1, - }; + } args = {}; + SETUP(args, "read", 3, 1); args.instance = instance; - args.addr = (cell_t)addr; - args.len = len; + args.addr = IN(addr); + args.len = IN(len); #if defined(OPENFIRM_DEBUG) printf("OF_read: called with instance=%08x, addr=%p, len=%d\n", - args.instance, args.addr, args.len); + instance, addr, len); #endif if (openfirmware(&args) == -1) @@ -564,10 +534,10 @@ OF_read(ihandle_t instance, void *addr, int len) #if defined(OPENFIRM_DEBUG) printf("OF_read: returning instance=%d, addr=%p, len=%d, actual=%d\n", - args.instance, args.addr, args.len, args.actual); + args.instance, OUT(args.addr), OUT(args.len), OUT(args.actual)); #endif - return (args.actual); + return (OUT(args.actual)); } /* Write to an instance. */ @@ -582,18 +552,15 @@ OF_write(ihandle_t instance, void *addr, int len) cell_t addr; cell_t len; cell_t actual; - } args = { - (cell_t)"write", - 3, - 1, - }; + } args = {}; + SETUP(args, "write", 3, 1); args.instance = instance; - args.addr = (cell_t)addr; - args.len = len; + args.addr = IN(addr); + args.len = IN(len); if (openfirmware(&args) == -1) return (-1); - return (args.actual); + return (OUT(args.actual)); } /* Seek to a position. */ @@ -608,18 +575,15 @@ OF_seek(ihandle_t instance, uint64_t pos) cell_t poshi; cell_t poslo; cell_t status; - } args = { - (cell_t)"seek", - 3, - 1, - }; + } args = {}; + SETUP(args, "seek", 3, 1); args.instance = instance; - args.poshi = pos >> 32; - args.poslo = pos; + args.poshi = IN(((uint64_t)pos >> 32)); + args.poslo = IN(pos); if (openfirmware(&args) == -1) return (-1); - return (args.status); + return (OUT(args.status)); } /* Blocks. */ @@ -633,16 +597,13 @@ OF_blocks(ihandle_t instance) cell_t instance; cell_t result; cell_t blocks; - } args = { - (cell_t)"#blocks", - 2, - 1, - }; + } args = {}; + SETUP(args, "#blocks", 2, 1); args.instance = instance; if (openfirmware(&args) == -1) return ((unsigned int)-1); - return (args.blocks); + return (OUT(args.blocks)); } /* Block size. */ @@ -656,16 +617,13 @@ OF_block_size(ihandle_t instance) cell_t instance; cell_t result; cell_t size; - } args = { - (cell_t)"block-size", - 2, - 1, - }; + } args = {}; + SETUP(args, "block-size", 2, 1); args.instance = instance; if (openfirmware(&args) == -1) return (512); - return (args.size); + return (OUT(args.size)); } /* @@ -684,18 +642,15 @@ OF_claim(void *virt, u_int size, u_int align) cell_t size; cell_t align; cell_t baseaddr; - } args = { - (cell_t)"claim", - 3, - 1, - }; - - args.virt = (cell_t)virt; - args.size = size; - args.align = align; + } args = {}; + SETUP(args, "claim", 3, 1); + + args.virt = IN(virt); + args.size = IN(size); + args.align = IN(align); if (openfirmware(&args) == -1) return ((void *)-1); - return ((void *)args.baseaddr); + return ((void *)OUT(args.baseaddr)); } /* Release an area of memory. */ @@ -708,13 +663,11 @@ OF_release(void *virt, u_int size) cell_t nreturns; cell_t virt; cell_t size; - } args = { - (cell_t)"release", - 2, - }; + } args = {}; + SETUP(args, "release", 2, 0); - args.virt = (cell_t)virt; - args.size = size; + args.virt = IN(virt); + args.size = IN(size); openfirmware(&args); } @@ -731,12 +684,10 @@ OF_boot(char *bootspec) cell_t nargs; cell_t nreturns; cell_t bootspec; - } args = { - (cell_t)"boot", - 1, - }; + } args = {}; + SETUP(args, "boot", 1, 0); - args.bootspec = (cell_t)bootspec; + args.bootspec = IN(bootspec); openfirmware(&args); for (;;) /* just in case */ ; @@ -750,9 +701,8 @@ OF_enter() cell_t name; cell_t nargs; cell_t nreturns; - } args = { - (cell_t)"enter", - }; + } args = {}; + SETUP(args, "enter", 0, 0); openfirmware(&args); /* We may come back. */ @@ -766,9 +716,8 @@ OF_exit() cell_t name; cell_t nargs; cell_t nreturns; - } args = { - (cell_t)"exit", - }; + } args = {}; + SETUP(args, "exit", 0, 0); openfirmware(&args); for (;;) /* just in case */ @@ -782,9 +731,8 @@ OF_quiesce() cell_t name; cell_t nargs; cell_t nreturns; - } args = { - (cell_t)"quiesce", - }; + } args = {}; + SETUP(args, "quiesce", 0, 0); openfirmware(&args); } @@ -803,16 +751,14 @@ OF_chain(void *virt, u_int size, void (*entry)(), void *arg, u_int len) cell_t entry; cell_t arg; cell_t len; - } args = { - (cell_t)"chain", - 5, - }; - - args.virt = (cell_t)virt; - args.size = size; - args.entry = (cell_t)entry; - args.arg = (cell_t)arg; - args.len = len; + } args = {}; + SETUP(args, "chain", 5, 0); + + args.virt = IN(virt); + args.size = IN(size); + args.entry = IN(entry); + args.arg = IN(arg); + args.len = IN(len); openfirmware(&args); } #else diff --git a/stand/libofw/openfirm.h b/stand/libofw/openfirm.h index b83cf4b0b27f..0981dbf093eb 100644 --- a/stand/libofw/openfirm.h +++ b/stand/libofw/openfirm.h @@ -65,9 +65,9 @@ #include #include -typedef unsigned int ihandle_t; -typedef unsigned int phandle_t; -typedef unsigned long int cell_t; +typedef uint32_t ihandle_t; +typedef uint32_t phandle_t; +typedef uint32_t cell_t; extern int (*openfirmware)(void *); extern phandle_t chosen; @@ -91,6 +91,7 @@ phandle_t OF_parent(phandle_t); phandle_t OF_instance_to_package(ihandle_t); int OF_getproplen(phandle_t, const char *); int OF_getprop(phandle_t, const char *, void *, int); +int OF_getencprop(phandle_t, const char *, cell_t *, int); int OF_nextprop(phandle_t, const char *, char *); int OF_setprop(phandle_t, const char *, void *, int); int OF_canon(const char *, char *, int); diff --git a/stand/powerpc/Makefile b/stand/powerpc/Makefile index 888fe0e97028..a16d3933ff7e 100644 --- a/stand/powerpc/Makefile +++ b/stand/powerpc/Makefile @@ -4,7 +4,11 @@ NO_OBJ=t .include -SUBDIR.yes= boot1.chrp ofw uboot +SUBDIR.yes= boot1.chrp ofw + +.if "${MACHINE_ARCH}" != "powerpc64le" +SUBDIR.${MK_FDT}+= uboot +.endif .if "${MACHINE_ARCH}" == "powerpc64" SUBDIR.${MK_FDT}+= kboot diff --git a/stand/powerpc/boot1.chrp/boot1.c b/stand/powerpc/boot1.chrp/boot1.c index 4d152efe1a70..ed7c55d11d6f 100644 --- a/stand/powerpc/boot1.chrp/boot1.c +++ b/stand/powerpc/boot1.chrp/boot1.c @@ -20,6 +20,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -82,11 +83,11 @@ static char *__ultoa(char *buf, u_long val, int base); */ typedef uint32_t ofwcell_t; typedef uint32_t u_ofwh_t; -typedef int (*ofwfp_t)(void *); +typedef int (*ofwfp_t)(ofwcell_t *); ofwfp_t ofw; /* the prom Open Firmware entry */ ofwh_t chosenh; -void ofw_init(void *, int, int (*)(void *), char *, int); +void ofw_init(void *, int, ofwfp_t, char *, int); static ofwh_t ofw_finddevice(const char *); static ofwh_t ofw_open(const char *); static int ofw_close(ofwh_t); @@ -101,6 +102,16 @@ static void ofw_exit(void) __dead2; ofwh_t bootdevh; ofwh_t stdinh, stdouth; +/* + * Note about the entry point: + * + * For some odd reason, the first page of the load appears to have trouble + * when entering in LE. The first five instructions decode weirdly. + * I suspect it is some cache weirdness between the ELF headers and .text. + * + * Ensure we have a gap between the start of .text and the entry as a + * workaround. + */ __asm(" \n\ .data \n\ .align 4 \n\ @@ -108,6 +119,8 @@ stack: \n\ .space 16384 \n\ \n\ .text \n\ + /* SLOF cache hack */ \n\ + .space 4096 \n\ .globl _start \n\ _start: \n\ lis %r1,stack@ha \n\ @@ -117,18 +130,95 @@ _start: \n\ b ofw_init \n\ "); +ofwfp_t realofw; + +#if BYTE_ORDER == LITTLE_ENDIAN +/* + * Minimal endianness-swap trampoline for LE. + */ +__attribute__((naked)) int +ofwtramp(void *buf, ofwfp_t cb) +{ +__asm(" \n\ + mflr %r0 \n\ + stw %r0, 4(%r1) \n\ + stwu %r1, -16(%r1) \n\ + stw %r30, 8(%r1) \n\ + /* Save current MSR for restoration post-call. */ \n\ + mfmsr %r30 \n\ + mr %r5, %r30 \n\ + /* Remove LE bit from MSR. */ \n\ + clrrwi %r5, %r5, 1 \n\ + mtsrr0 %r4 \n\ + mtsrr1 %r5 \n\ + bcl 20, 31, .+4 /* LOAD_LR_NIA */ \n\ +1: \n\ + mflr %r4 \n\ + addi %r4, %r4, (2f - 1b) \n\ + mtlr %r4 \n\ + /* Switch to BE and transfer control to OF entry */ \n\ + rfid \n\ +2: \n\ + /* Control is returned here, but in BE. */ \n\ + .long 0x05009f42 /* LOAD_LR_NIA */\n\ + /* 0: */\n\ + .long 0xa603db7f /* mtsrr1 %r30 */\n\ + .long 0xa602c87f /* mflr %r30 */\n\ + .long 0x1400de3b /* addi %r30, %r30, (1f - 0b) */\n\ + .long 0xa603da7f /* mtsrr0 %r30 */\n\ + .long 0x2400004c /* rfid */\n\ + /* 1: */\n\ +1: \n\ + /* Back to normal. Tidy up for return. */ \n\ + lwz %r30, 8(%r1) \n\ + lwz %r0, 20(%r1) \n\ + addi %r1, %r1, 16 \n\ + mtlr %r0 \n\ + blr \n\ +"); +} + +/* + * Little-endian OFW entrypoint replacement. + * + * We are doing all the byteswapping in one place here to save space. + * This means instance handles will be byteswapped as well. + */ +int +call_ofw(ofwcell_t* buf) +{ + int ret, i, ncells; + + ncells = 3 + buf[1] + buf[2]; + for (i = 0; i < ncells; i++) + buf[i] = htobe32(buf[i]); + + ret = (ofwtramp(buf, realofw)); + for (i = 0; i < ncells; i++) + buf[i] = be32toh(buf[i]); + return (ret); +} +#endif + void -ofw_init(void *vpd, int res, int (*openfirm)(void *), char *arg, int argl) +ofw_init(void *vpd, int res, ofwfp_t openfirm, char *arg, int argl) { char *av[16]; char *p; int ac; - ofw = openfirm; +#if BYTE_ORDER == LITTLE_ENDIAN + realofw = openfirm; + ofw = call_ofw; +#else + realofw = ofw = openfirm; +#endif chosenh = ofw_finddevice("/chosen"); ofw_getprop(chosenh, "stdin", &stdinh, sizeof(stdinh)); + stdinh = be32toh(stdinh); ofw_getprop(chosenh, "stdout", &stdouth, sizeof(stdouth)); + stdouth = be32toh(stdouth); ofw_getprop(chosenh, "bootargs", bootargs, sizeof(bootargs)); ofw_getprop(chosenh, "bootpath", bootpath, sizeof(bootpath)); @@ -537,8 +627,8 @@ load(const char *fname) __syncicache(p, ph.p_memsz); } ofw_close(bootdev); - (*(void (*)(void *, int, ofwfp_t, char *, int))eh.e_entry)(NULL, 0, - ofw,NULL,0); + (*(void (*)(void *, int, ofwfp_t, char *, int))eh.e_entry)(NULL, 0, + realofw, NULL, 0); } static int diff --git a/stand/powerpc/ofw/Makefile b/stand/powerpc/ofw/Makefile index 7c2e97ebb382..03844301f094 100644 --- a/stand/powerpc/ofw/Makefile +++ b/stand/powerpc/ofw/Makefile @@ -28,11 +28,15 @@ CFLAGS.gfx_fb.c += -I${SRCTOP}/sys/teken SRCS+= ofwfdt.c .endif -.if ${MACHINE_ARCH} == "powerpc64" +.if ${MACHINE_ARCH:Mpowerpc64*} != "" SRCS+= cas.c CFLAGS+= -DCAS .endif +.if ${MACHINE_ARCH} == "powerpc64le" +SRCS+= trampolineLE.S +.endif + HELP_FILES= ${FDTSRC}/help.fdt # Always add MI sources @@ -44,7 +48,13 @@ HELP_FILES= ${FDTSRC}/help.fdt RELOC?= 0x1C00000 CFLAGS+= -DRELOC=${RELOC} -g -LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc +LDFLAGS= -nostdlib -static + +.if ${MACHINE_ARCH} == "powerpc64le" +LDFLAGS+= -T ${.CURDIR}/ldscript.powerpcle +.else +LDFLAGS+= -T ${.CURDIR}/ldscript.powerpc +.endif # Open Firmware standalone support library LIBOFW= ${BOOTOBJ}/libofw/libofw.a diff --git a/stand/powerpc/ofw/cas.c b/stand/powerpc/ofw/cas.c index 6292e04794a8..0a12f31d1a1a 100644 --- a/stand/powerpc/ofw/cas.c *** 372 LINES SKIPPED *** From nobody Wed Oct 20 23:31:28 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 95C9D17F402C; Wed, 20 Oct 2021 23:31: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 4HZRhJ3tWMz4n3Z; Wed, 20 Oct 2021 23:31: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 66045108D7; Wed, 20 Oct 2021 23:31: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 19KNVSA9074531; Wed, 20 Oct 2021 23:31:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19KNVSbL074530; Wed, 20 Oct 2021 23:31:28 GMT (envelope-from git) Date: Wed, 20 Oct 2021 23:31:28 GMT Message-Id: <202110202331.19KNVSbL074530@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: 5c5340108e9c - main - net: Allow binding of unspecified address without address existance List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 5c5340108e9c2e384ca646720e17d037c69acc4c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5c5340108e9c2e384ca646720e17d037c69acc4c commit 5c5340108e9c2e384ca646720e17d037c69acc4c Author: Roy Marples AuthorDate: 2021-10-20 15:47:29 +0000 Commit: Ed Maste CommitDate: 2021-10-20 23:25:51 +0000 net: Allow binding of unspecified address without address existance Previously in_pcbbind_setup returned EADDRNOTAVAIL for empty V_in_ifaddrhead (i.e., no IPv4 addresses configured) and in6_pcbbind did the same for empty V_in6_ifaddrhead (no IPv6 addresses). An equivalent test has existed since 4.4-Lite. It was presumably done to avoid extra work (assuming the address isn't going to be found later). In normal system operation *_ifaddrhead will not be empty: they will at least have the loopback address(es). In practice no work will be avoided. Further, this case caused net/dhcpd to fail when run early in boot before assignment of any addresses. It should be possible to bind the unspecified address even if no addresses have been configured yet, so just remove the tests. The now-removed "XXX broken" comments were added in 59562606b9d3, which converted the ifaddr lists to TAILQs. As far as I (emaste) can tell the brokenness is the issue described above, not some aspect of the TAILQ conversion. PR: 253166 Reviewed by: ae, bz, donner, emaste, glebius MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D32563 --- sys/netinet/in_pcb.c | 2 -- sys/netinet6/in6_pcb.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 1a7639c0137b..b8b5c6fbdcd5 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -932,8 +932,6 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp, INP_LOCK_ASSERT(inp); INP_HASH_LOCK_ASSERT(pcbinfo); - if (CK_STAILQ_EMPTY(&V_in_ifaddrhead)) /* XXX broken! */ - return (EADDRNOTAVAIL); laddr.s_addr = *laddrp; if (nam != NULL && laddr.s_addr != INADDR_ANY) return (EINVAL); diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index 9a5d69e16a1c..ad4cda9d48ab 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -173,8 +173,6 @@ in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, INP_WLOCK_ASSERT(inp); INP_HASH_WLOCK_ASSERT(pcbinfo); - if (CK_STAILQ_EMPTY(&V_in6_ifaddrhead)) /* XXX broken! */ - return (EADDRNOTAVAIL); if (inp->inp_lport || !IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) return (EINVAL); if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT|SO_REUSEPORT_LB)) == 0) From nobody Thu Oct 21 00:05:56 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D35AD1802DB2; Thu, 21 Oct 2021 00:05: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 4HZSS45Q1vz3CXd; Thu, 21 Oct 2021 00:05: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 9AF9A1134B; Thu, 21 Oct 2021 00:05: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 19L05uuf015032; Thu, 21 Oct 2021 00:05:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19L05uVB015031; Thu, 21 Oct 2021 00:05:56 GMT (envelope-from git) Date: Thu, 21 Oct 2021 00:05:56 GMT Message-Id: <202110210005.19L05uVB015031@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 9ce201f2ee3c - main - ping: fix parsing of options including '4' and '6' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9ce201f2ee3ca340032d9cc71d91a36b3b45a4c3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=9ce201f2ee3ca340032d9cc71d91a36b3b45a4c3 commit 9ce201f2ee3ca340032d9cc71d91a36b3b45a4c3 Author: Alan Somers AuthorDate: 2021-10-06 22:54:59 +0000 Commit: Alan Somers CommitDate: 2021-10-21 00:05:43 +0000 ping: fix parsing of options including '4' and '6' ping uses a two-pass option parser. The first pass determines whether ipv4 or ipv6 is desired, and the second parses the rest of the options. But the first pass wrongly detects a '4' or '6' in an option's value as a request to use ipv6 or ipv6 respectively, for example in an invocation like "ping -c6 1.2.3.4". Fix this confusion by including all options in the first round of parsing, but ignoring those unrelated to ipv4/ipv6 selection. PR: 258048 Reported by: ghuckriede@blackberry.com Submitted by: ghuckriede@blackberry.com MFC after: 2 weeks Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D32344 --- sbin/ping/main.c | 14 +++++------ sbin/ping/main.h | 20 +++++++++++++++ sbin/ping/ping.c | 10 +------- sbin/ping/ping6.c | 20 ++++++--------- sbin/ping/tests/ping_test.sh | 58 +++++++++++++++++++++++++++++++++++++------- 5 files changed, 84 insertions(+), 38 deletions(-) diff --git a/sbin/ping/main.c b/sbin/ping/main.c index 01442679efff..c021e2c26b14 100644 --- a/sbin/ping/main.c +++ b/sbin/ping/main.c @@ -52,13 +52,11 @@ __FBSDID("$FreeBSD$"); #endif #if defined(INET) && defined(INET6) -#define OPTSTR ":46" +#define OPTSTR PING6OPTS PING4OPTS #elif defined(INET) -#define OPTSTR ":4" +#define OPTSTR PING4OPTS #elif defined(INET6) -#define OPTSTR ":6" -#else -#define OPTSTR "" +#define OPTSTR PING6OPTS #endif int @@ -82,7 +80,7 @@ main(int argc, char *argv[]) ipv6 = true; #endif - while ((ch = getopt(argc, argv, OPTSTR)) != -1) { + while ((ch = getopt(argc, argv, ":" OPTSTR)) != -1) { switch(ch) { #ifdef INET case '4': @@ -170,7 +168,7 @@ usage(void) "[-G sweepmaxsize]\n" " [-g sweepminsize] [-h sweepincrsize] [-i wait] " "[-l preload]\n" - " [-M mask | time] [-m ttl]" + " [-M mask | time] [-m ttl] " #ifdef IPSEC "[-P policy] " #endif @@ -188,7 +186,7 @@ usage(void) " [-z tos] IPv4-mcast-group\n" #endif /* INET */ #ifdef INET6 - "\tping [-6aADd" + "\tping [-6AaDd" #if defined(IPSEC) && !defined(IPSEC_POLICY_IPSEC) "E" #endif diff --git a/sbin/ping/main.h b/sbin/ping/main.h index f9707ccfb5ff..0f987e9a20ae 100644 --- a/sbin/ping/main.h +++ b/sbin/ping/main.h @@ -31,6 +31,26 @@ #ifndef MAIN_H #define MAIN_H 1 +#ifdef IPSEC +#include +#endif /*IPSEC*/ + +#if defined(INET) && defined(IPSEC) && defined(IPSEC_POLICY_IPSEC) + #define PING4ADDOPTS "P:" +#else + #define PING4ADDOPTS +#endif +#define PING4OPTS "4AaC:c:DdfG:g:Hh:I:i:Ll:M:m:nop:QqRrS:s:T:t:vW:z:" PING4ADDOPTS + +#if defined(INET6) && defined(IPSEC) && defined(IPSEC_POLICY_IPSEC) + #define PING6ADDOPTS "P:" +#elif defined(INET6) && defined(IPSEC) && !defined(IPSEC_POLICY_IPSEC) + #define PING6ADDOPTS "ZE" +#else + #define PING6ADDOPTS +#endif +#define PING6OPTS "6Aab:C:c:Dde:fHI:i:k:l:m:nNoOp:qS:s:t:uvyYW:z:" PING6ADDOPTS + void usage(void) __dead2; #endif diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index fe197928085e..be535f72146a 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -301,15 +301,7 @@ ping(int argc, char *const *argv) alarmtimeout = df = preload = tos = pcp = 0; outpack = outpackhdr + sizeof(struct ip); - while ((ch = getopt(argc, argv, - "4AaC:c:DdfG:g:Hh:I:i:Ll:M:m:nop:QqRrS:s:T:t:vW:z:" -#ifdef IPSEC -#ifdef IPSEC_POLICY_IPSEC - "P:" -#endif /*IPSEC_POLICY_IPSEC*/ -#endif /*IPSEC*/ - )) != -1) - { + while ((ch = getopt(argc, argv, PING4OPTS)) != -1) { switch(ch) { case '4': /* This option is processed in main(). */ diff --git a/sbin/ping/ping6.c b/sbin/ping/ping6.c index 4cbeae770372..76a96f0631ff 100644 --- a/sbin/ping/ping6.c +++ b/sbin/ping/ping6.c @@ -293,7 +293,11 @@ static void pr_rthdr(void *, size_t); static int pr_bitrange(u_int32_t, int, int); static void pr_retip(struct ip6_hdr *, u_char *); static void summary(void); +#ifdef IPSEC +#ifdef IPSEC_POLICY_IPSEC static int setpolicy(int, char *); +#endif +#endif static char *nigroup(char *, int); int @@ -345,18 +349,8 @@ ping6(int argc, char *argv[]) alarmtimeout = preload = 0; datap = &outpack[ICMP6ECHOLEN + ICMP6ECHOTMLEN]; capdns = capdns_setup(); -#ifndef IPSEC -#define ADDOPTS -#else -#ifdef IPSEC_POLICY_IPSEC -#define ADDOPTS "P:" -#else -#define ADDOPTS "ZE" -#endif /*IPSEC_POLICY_IPSEC*/ -#endif - while ((ch = getopt(argc, argv, - "6k:b:C:c:DdfHe:m:I:i:l:unNop:qaAS:s:OvyYW:t:z:" ADDOPTS)) != -1) { -#undef ADDOPTS + + while ((ch = getopt(argc, argv, PING6OPTS)) != -1) { switch (ch) { case '6': /* This option is processed in main(). */ @@ -2667,7 +2661,9 @@ pr_retip(struct ip6_hdr *ip6, u_char *end) nh = ip6->ip6_nxt; cp += hlen; while (end - cp >= 8) { +#ifdef IPSEC struct ah ah; +#endif switch (nh) { case IPPROTO_HOPOPTS: diff --git a/sbin/ping/tests/ping_test.sh b/sbin/ping/tests/ping_test.sh index ed95594abbd2..54af89f4a22b 100644 --- a/sbin/ping/tests/ping_test.sh +++ b/sbin/ping/tests/ping_test.sh @@ -27,14 +27,23 @@ # # $FreeBSD$ +require_ipv4() { + if ! getaddrinfo -f inet localhost 1>/dev/null 2>&1; then + atf_skip "IPv4 is not configured" + fi +} +require_ipv6() { + if ! getaddrinfo -f inet6 localhost 1>/dev/null 2>&1; then + atf_skip "IPv6 is not configured" + fi +} + atf_test_case ping_c1_s56_t1 ping_c1_s56_t1_head() { atf_set "descr" "Stop after receiving 1 ECHO_RESPONSE packet" } ping_c1_s56_t1_body() { - if ! getaddrinfo -f inet localhost 1>/dev/null 2>&1; then - atf_skip "IPv4 is not configured" - fi + require_ipv4 atf_check -s exit:0 -o save:std.out -e empty \ ping -4 -c 1 -s 56 -t 1 localhost check_ping_statistics std.out $(atf_get_srcdir)/ping_c1_s56_t1.out @@ -45,9 +54,7 @@ ping_6_c1_s8_t1_head() { atf_set "descr" "Stop after receiving 1 ECHO_RESPONSE packet" } ping_6_c1_s8_t1_body() { - if ! getaddrinfo -f inet6 localhost 1>/dev/null 2>&1; then - atf_skip "IPv6 is not configured" - fi + require_ipv6 atf_check -s exit:0 -o save:std.out -e empty \ ping -6 -c 1 -s 8 -t 1 localhost check_ping_statistics std.out $(atf_get_srcdir)/ping_6_c1_s8_t1.out @@ -58,18 +65,51 @@ ping6_c1_s8_t1_head() { atf_set "descr" "Use IPv6 when invoked as ping6" } ping6_c1_s8_t1_body() { - if ! getaddrinfo -f inet6 localhost 1>/dev/null 2>&1; then - atf_skip "IPv6 is not configured" - fi + require_ipv6 atf_check -s exit:0 -o save:std.out -e empty \ ping6 -c 1 -s 8 -t 1 localhost check_ping_statistics std.out $(atf_get_srcdir)/ping_6_c1_s8_t1.out } +ping_c1t6_head() { + atf_set "descr" "-t6 is not interpreted as -t -6 by ping" +} +ping_c1t6_body() { + require_ipv4 + atf_check -s exit:0 -o ignore -e empty ping -c1 -t6 127.0.0.1 +} + +ping6_c1t4_head() { + atf_set "descr" "-t4 is not interpreted as -t -4 by ping6" +} +ping6_c1t4_body() { + require_ipv6 + atf_check -s exit:0 -o ignore -e empty ping6 -c1 -t4 ::1 +} + +ping_46_head() { + atf_set "descr" "-4 and -6 may not be used together" +} +ping_46_body() { + atf_check -s exit:1 -e ignore ping -4 -6 +} + +ping6_46_head() { + atf_set "descr" "-4 and -6 may not be used together" +} +ping6_46_body() { + atf_check -s exit:1 -e ignore ping6 -4 -6 +} + + atf_init_test_cases() { atf_add_test_case ping_c1_s56_t1 atf_add_test_case ping_6_c1_s8_t1 atf_add_test_case ping6_c1_s8_t1 + atf_add_test_case ping_c1t6 + atf_add_test_case ping6_c1t4 + atf_add_test_case ping_46 + atf_add_test_case ping6_46 } check_ping_statistics() { From nobody Thu Oct 21 00:10:54 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E1D9C1806CD8; Thu, 21 Oct 2021 00:10:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HZSYp4k7Bz3GTy; Thu, 21 Oct 2021 00:10:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82D1B116B9; Thu, 21 Oct 2021 00:10:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19L0Ase7024847; Thu, 21 Oct 2021 00:10:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19L0Asb2024846; Thu, 21 Oct 2021 00:10:54 GMT (envelope-from git) Date: Thu, 21 Oct 2021 00:10:54 GMT Message-Id: <202110210010.19L0Asb2024846@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: 33dba3bb0ec2 - main - rtld-elf/paths.h: Make it usable outside rtld List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 33dba3bb0ec2a0f0a401bed145cc0ef95f37a5c3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=33dba3bb0ec2a0f0a401bed145cc0ef95f37a5c3 commit 33dba3bb0ec2a0f0a401bed145cc0ef95f37a5c3 Author: Konstantin Belousov AuthorDate: 2021-10-12 15:50:49 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-21 00:08:54 +0000 rtld-elf/paths.h: Make it usable outside rtld but still for tightly coupled things like ldd(1) Rename paths.h to rtld_paths.h. Add guard for rtld-specific externs declarations. Add _COMPAT32_BASENAME_RTLD and _COMPAT32_PATH_RTLD. Reviewed by: arichardson, jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32464 --- libexec/rtld-elf/arm/reloc.c | 2 +- libexec/rtld-elf/libmap.c | 2 +- libexec/rtld-elf/rtld.c | 2 +- libexec/rtld-elf/rtld_malloc.c | 2 +- libexec/rtld-elf/{paths.h => rtld_paths.h} | 18 ++++++++++++++---- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/libexec/rtld-elf/arm/reloc.c b/libexec/rtld-elf/arm/reloc.c index 4e551b0948ad..b6eafa59b299 100644 --- a/libexec/rtld-elf/arm/reloc.c +++ b/libexec/rtld-elf/arm/reloc.c @@ -16,7 +16,7 @@ __FBSDID("$FreeBSD$"); #include "debug.h" #include "rtld.h" -#include "paths.h" +#include "rtld_paths.h" #ifdef __ARM_FP /* diff --git a/libexec/rtld-elf/libmap.c b/libexec/rtld-elf/libmap.c index e4388d14b951..854c73f39ef7 100644 --- a/libexec/rtld-elf/libmap.c +++ b/libexec/rtld-elf/libmap.c @@ -16,7 +16,7 @@ #include "debug.h" #include "rtld.h" #include "libmap.h" -#include "paths.h" +#include "rtld_paths.h" #include "rtld_libc.h" TAILQ_HEAD(lm_list, lm); diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index d598bb044f8e..8b1f84c6901a 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); #include "debug.h" #include "rtld.h" #include "libmap.h" -#include "paths.h" +#include "rtld_paths.h" #include "rtld_tls.h" #include "rtld_printf.h" #include "rtld_malloc.h" diff --git a/libexec/rtld-elf/rtld_malloc.c b/libexec/rtld-elf/rtld_malloc.c index 63fa6f5e2ee7..d08254b67d9f 100644 --- a/libexec/rtld-elf/rtld_malloc.c +++ b/libexec/rtld-elf/rtld_malloc.c @@ -55,7 +55,7 @@ static char *rcsid = "$FreeBSD$"; #include #include "rtld.h" #include "rtld_printf.h" -#include "paths.h" +#include "rtld_paths.h" /* * Pre-allocate mmap'ed pages diff --git a/libexec/rtld-elf/paths.h b/libexec/rtld-elf/rtld_paths.h similarity index 88% rename from libexec/rtld-elf/paths.h rename to libexec/rtld-elf/rtld_paths.h index 75f3b1d47dd4..4ce423ce6dbb 100644 --- a/libexec/rtld-elf/paths.h +++ b/libexec/rtld-elf/rtld_paths.h @@ -26,15 +26,19 @@ * $FreeBSD$ */ -#ifndef PATHS_H -#define PATHS_H +#ifndef _RTLD_PATHS_H +#define _RTLD_PATHS_H #undef _PATH_ELF_HINTS +#ifndef _COMPAT32_BASENAME_RTLD +#define _COMPAT32_BASENAME_RTLD "ld-elf32.so.1" +#endif + #ifdef COMPAT_32BIT #define _PATH_ELF_HINTS "/var/run/ld-elf32.so.hints" #define _PATH_LIBMAP_CONF "/etc/libmap32.conf" -#define _BASENAME_RTLD "ld-elf32.so.1" +#define _BASENAME_RTLD _COMPAT32_BASENAME_RTLD #define STANDARD_LIBRARY_PATH "/lib32:/usr/lib32" #define LD_ "LD_32_" #endif @@ -55,6 +59,10 @@ #define _PATH_RTLD "/libexec/" _BASENAME_RTLD #endif +#ifndef _COMPAT32_PATH_RTLD +#define _COMPAT32_PATH_RTLD "/libexec/" _COMPAT32_BASENAME_RTLD +#endif + #ifndef STANDARD_LIBRARY_PATH #define STANDARD_LIBRARY_PATH "/lib/casper:/lib:/usr/lib" #endif @@ -69,10 +77,12 @@ #define SOFT_STANDARD_LIBRARY_PATH "/usr/libsoft" #define LD_SOFT_ "LD_SOFT_" +#ifdef IN_RTLD extern const char *ld_elf_hints_default; extern const char *ld_path_libmap_conf; extern const char *ld_path_rtld; extern const char *ld_standard_library_path; extern const char *ld_env_prefix; +#endif -#endif /* PATHS_H */ +#endif /* _RTLD_PATHS_H */ From nobody Thu Oct 21 00:10:55 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 299601806C73; Thu, 21 Oct 2021 00:10:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HZSYr0GCGz3GWX; Thu, 21 Oct 2021 00:10: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 C11A41135D; Thu, 21 Oct 2021 00:10:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19L0AtKp024872; Thu, 21 Oct 2021 00:10:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19L0AtMN024871; Thu, 21 Oct 2021 00:10:55 GMT (envelope-from git) Date: Thu, 21 Oct 2021 00:10:55 GMT Message-Id: <202110210010.19L0AtMN024871@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: ca8c576d10e2 - main - ldd: style List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: ca8c576d10e22830d0c7ac865af21aad9ae44181 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ca8c576d10e22830d0c7ac865af21aad9ae44181 commit ca8c576d10e22830d0c7ac865af21aad9ae44181 Author: Konstantin Belousov AuthorDate: 2021-10-12 11:39:32 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-21 00:09:03 +0000 ldd: style Reviewed by: arichardson, jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32464 --- usr.bin/ldd/ldd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/usr.bin/ldd/ldd.c b/usr.bin/ldd/ldd.c index 3353345d549d..ee3f2070598d 100644 --- a/usr.bin/ldd/ldd.c +++ b/usr.bin/ldd/ldd.c @@ -134,7 +134,7 @@ int main(int argc, char *argv[]) { char *fmt1, *fmt2; - int rval, c, aflag; + int aflag, c, fd, rval, status, is_shlib, rv, type; aflag = 0; fmt1 = fmt2 = NULL; @@ -167,8 +167,6 @@ main(int argc, char *argv[]) rval = 0; for (; argc > 0; argc--, argv++) { - int fd, status, is_shlib, rv, type; - if ((fd = open(*argv, O_RDONLY, 0)) < 0) { warn("%s", *argv); rval |= 1; @@ -244,7 +242,7 @@ main(int argc, char *argv[]) } } - return rval; + return (rval); } static void From nobody Thu Oct 21 00:10:56 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 53BC61806E28; Thu, 21 Oct 2021 00:10:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HZSYs0VL4z3GMp; Thu, 21 Oct 2021 00:10:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D646E114E6; Thu, 21 Oct 2021 00:10:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19L0AuSt024902; Thu, 21 Oct 2021 00:10:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19L0AuFr024901; Thu, 21 Oct 2021 00:10:56 GMT (envelope-from git) Date: Thu, 21 Oct 2021 00:10:56 GMT Message-Id: <202110210010.19L0AuFr024901@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: 2c7a6dad4de1 - main - ldd: do not use dlopen(RTLD_TRACE) for dso when format is specified List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 2c7a6dad4de17c357eb91c723bad860c6512a598 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2c7a6dad4de17c357eb91c723bad860c6512a598 commit 2c7a6dad4de17c357eb91c723bad860c6512a598 Author: Konstantin Belousov AuthorDate: 2021-10-11 22:35:56 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-21 00:09:14 +0000 ldd: do not use dlopen(RTLD_TRACE) for dso when format is specified Problem is that rtld cannot reliably access updated environment. This was made more obvious by bfd4c875a10560aaa2. The application environment can be in arbitrary state and place, system components can observe it only during execve(2), or in case of rtld, right after execve, when environment is still at know location and format. Instead spawn ld-elf.so.1 in direct exec mode which can correctly read all inherited updates to the environment. PR: 259069 Reviewed by: arichardson, jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32464 --- usr.bin/ldd/Makefile | 1 + usr.bin/ldd/ldd.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/usr.bin/ldd/Makefile b/usr.bin/ldd/Makefile index 78e551d80a33..1a671bc9f402 100644 --- a/usr.bin/ldd/Makefile +++ b/usr.bin/ldd/Makefile @@ -3,6 +3,7 @@ PROG?= ldd SRCS= ldd.c +CFLAGS+= -I${SRCTOP}/libexec/rtld-elf LIBADD= elf .include diff --git a/usr.bin/ldd/ldd.c b/usr.bin/ldd/ldd.c index ee3f2070598d..492e29dff211 100644 --- a/usr.bin/ldd/ldd.c +++ b/usr.bin/ldd/ldd.c @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -134,6 +135,7 @@ int main(int argc, char *argv[]) { char *fmt1, *fmt2; + const char *rtld; int aflag, c, fd, rval, status, is_shlib, rv, type; aflag = 0; @@ -234,9 +236,17 @@ main(int argc, char *argv[]) if (is_shlib == 0) { execl(*argv, *argv, (char *)NULL); warn("%s", *argv); - } else { + } else if (fmt1 == NULL && fmt2 == NULL) { dlopen(*argv, RTLD_TRACE); warnx("%s: %s", *argv, dlerror()); + } else { + rtld = _PATH_RTLD; +#if __ELF_WORD_SIZE > 32 && defined(ELF32_SUPPORTED) + if (type == TYPE_ELF32) + rtld = _COMPAT32_PATH_RTLD; +#endif + execl(rtld, rtld, "-d", "--", + *argv, (char *)NULL); } _exit(1); } From nobody Thu Oct 21 03:24:20 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BBB7B1807D5A; Thu, 21 Oct 2021 03:24:20 +0000 (UTC) (envelope-from danfe@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 4HZXs04zG8z4sFP; Thu, 21 Oct 2021 03:24:20 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1634786660; 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=HFk8rnM0x/5Xx8TjE4d9M/H6TgER410TfqB1E44tN1g=; b=dE/jJReJ4smbIZQa4w+l0QFG8pd2CTXqG3K21A+ZSenuu7rWixMlHv2UXYElRxXweW+bL5 84ctA/OQPspXJER5LMRYpZybLo8T12bIGHfl3qKROVue3hW8dscipK2iNOwNz5d5cbAJrW UsBKWeta+mmdv/xb+rV6EFxaX1Ciut0mN1hQxUTvXZfMrWV4GKSVL1gNz1l/gn/X1SZ0ah 2OHsZMzd5j1rBUkErbwMBnqb1Albod0mnqC9Wlwpi9YhjGq1n6lCF7xrktJq0Oymhf+76T BNOJ27OMr0MhttM98nYQmt8w1Hh6YuUdacQ9455SJSKtPelyQiXQveX0R6s7Gw== Received: by freefall.freebsd.org (Postfix, from userid 1033) id 9487DB6B; Thu, 21 Oct 2021 03:24:20 +0000 (UTC) Date: Thu, 21 Oct 2021 03:24:20 +0000 From: Alexey Dokuchaev To: Shawn Webb Cc: Emmanuel Vadot , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211020135704.e2krf765elhscvfd@mutt-hbsd> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211020135704.e2krf765elhscvfd@mutt-hbsd> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1634786660; 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=HFk8rnM0x/5Xx8TjE4d9M/H6TgER410TfqB1E44tN1g=; b=o3qQLoUMwtBw9YYO8g27OCn7aPCHJWvmLSeNLTa2Jl23IwtoNDuQdm0Yx4bIkLjWprZeax ZaBxJiSe54to3AHU7m5UgWP8qbpOguubcOkk5hC0raoouDNtDTaohfpMqdrXfzb+ikt8qg dbt9vw+4LZuFxkCbpvc8YI96YDAiafl85aocSjqL61EOwRNqbV535Z9c7bb9wiAQrFitUF /GZF+0AXtPeeeTx3fqZo7WIh6AOCV3gthg8CjxdE66cOrOy46EnOnRCC2L74as08yhVxkU dvB9QAakNb3GJ2pelU7R2na47eXMq6RVLXJunuzioQNpP8ZuWSpvdgjJAoYiqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1634786660; a=rsa-sha256; cv=none; b=QCg6NevSNSn1X7wyq3PB4nBbJUel3QGiud++ohfT5gy62ykO8YrmeSWmt5AGrJOC1cAGzY kO66z2fGSzqDfeyV+bdJ1RDNY6mjhLVrcd7vsdUsBDkj6nwSPsdtRYN2DxFUJoXtRdTWAA RtKd2K/8mL7At5bjaiekeIrZm3Uc0WY4Y4buGJVxRpw/QCGQV5nMWtEzGsf4Kjco3ssMnH MA/2Uuc4F+wUYcVhBteUAisPFNl/h8HWr3o0m0OUt+pwQ4EoMgnA84+qOFFgAG9TLzPvaf VoGEfM77zHz3vdUoebIgykT68FmtCMGsNJeQZruTYjrgoyIEfRBrfah0Vv6SRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On Wed, Oct 20, 2021 at 09:57:04AM -0400, Shawn Webb wrote: > On Tue, Oct 19, 2021 at 07:38:15AM +0000, Emmanuel Vadot wrote: > > commit 225639e7db685a4047e384abdbc296c0e02bd147 > > > > vt: Disable bell by default > > > > Bell is either useless if you're working on remote servers or > > really annoying when you're working with a local machine that > > have a loud buzzer. Switch the default to have it disable. > > I have no objection to the change (or any opinion on the matter), but > I wonder if changes like this carry an accessibility impact. I wonder > if any hard-of-sight folks relied on the original behavior. Pretty sure it does; as explained by Gleb and me earlier, PC speaker is important diagnostic communication channel; unfortunately Emmanuel sees it just as annoying useless buzzer. :( ./danfe From nobody Thu Oct 21 04:15:11 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AFE4E17FE268; Thu, 21 Oct 2021 04:15:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HZYzg4Yc9z3M4r; Thu, 21 Oct 2021 04:15:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C08614BAC; Thu, 21 Oct 2021 04:15:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19L4FBwg047797; Thu, 21 Oct 2021 04:15:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19L4FBOh047796; Thu, 21 Oct 2021 04:15:11 GMT (envelope-from git) Date: Thu, 21 Oct 2021 04:15:11 GMT Message-Id: <202110210415.19L4FBOh047796@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rebecca Cran Subject: git: 35175e100add - main - bhyve: Bump the SMBIOS firmware version to 14.0 for 14-CURRENT List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bcran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 35175e100add6fc2bc73a826aeafbb8e198adb97 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bcran: URL: https://cgit.FreeBSD.org/src/commit/?id=35175e100add6fc2bc73a826aeafbb8e198adb97 commit 35175e100add6fc2bc73a826aeafbb8e198adb97 Author: Rebecca Cran AuthorDate: 2021-10-21 02:33:49 +0000 Commit: Rebecca Cran CommitDate: 2021-10-21 04:10:33 +0000 bhyve: Bump the SMBIOS firmware version to 14.0 for 14-CURRENT Bump the firmware version to 14.0 and set the firmware release date to today. Reviewed by: jhb, bz, imp Differential Revision: https://reviews.freebsd.org/D32534 --- usr.sbin/bhyve/smbiostbl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyve/smbiostbl.c b/usr.sbin/bhyve/smbiostbl.c index ca68f8d95363..ada3177105a9 100644 --- a/usr.sbin/bhyve/smbiostbl.c +++ b/usr.sbin/bhyve/smbiostbl.c @@ -52,9 +52,9 @@ __FBSDID("$FreeBSD$"); #define SMBIOS_BASE 0xF1000 -#define FIRMWARE_VERSION "13.0" +#define FIRMWARE_VERSION "14.0" /* The SMBIOS specification defines the date format to be mm/dd/yyyy */ -#define FIRMWARE_RELEASE_DATE "11/10/2020" +#define FIRMWARE_RELEASE_DATE "10/17/2021" /* BHYVE_ACPI_BASE - SMBIOS_BASE) */ #define SMBIOS_MAX_LENGTH (0xF2400 - 0xF1000) From nobody Thu Oct 21 06:13:25 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2DF391808882; Thu, 21 Oct 2021 06:13:35 +0000 (UTC) (envelope-from bapt@etoilebsd.net) Received: from aniel.nours.eu (nours.eu [176.31.115.77]) (using TLSv1.3 with cipher TLS_AES_256_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 4HZccH0HMqz4ccZ; Thu, 21 Oct 2021 06:13:34 +0000 (UTC) (envelope-from bapt@etoilebsd.net) Received: from dummy.faircode.eu (10.246.39.62.rev.sfr.net [62.39.246.10]) (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 aniel.nours.eu (Postfix) with ESMTPSA id 714173EAD4; Thu, 21 Oct 2021 08:13:26 +0200 (CEST) Date: Thu, 21 Oct 2021 06:13:25 +0000 (UTC) From: Baptiste Daroussin To: Gleb Smirnoff Cc: Emmanuel Vadot , Slawa Olhovchenkov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Message-ID: In-Reply-To: References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Correlation-ID: X-Rspamd-Queue-Id: 4HZccH0HMqz4ccZ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N 20 oct. 2021 19:11:15 Gleb Smirnoff : > =C2=A0 Emmanuel, > > On Wed, Oct 20, 2021 at 01:42:37PM +0200, Emmanuel Vadot wrote: > E>=C2=A0 Stop using POLA for "This is a change that I don't agree with". > > A change that just changes the system behaviour and nothing else, > is a POLA violation. > > E>=C2=A0 In the past weeks we had commits that changed mixer(8) cli in a > E> non-backward compatible way and changed the root shell. For both you > E> haven't complain so it means that either you don't care or you agree > E> with those changes. > > Mixer and root shell weren't like your change. Mixer is a complete > rewrite which has some technical background to justify it. Root shell > is also different to what you did. It is not flip of a binary switch. > > E>=C2=A0 I agree that the bell is clearly a user preference and also I co= uld > E> have left the review opened for more time (but I've been there and > E> usually you have review/feedback the first day and after it's silent). > E> I wish there was an easy way for developer (and community member) to > E> create a poll for changes like that but we don't have one right now. > E>=C2=A0 Now based on the number of people who reviewed and the people wh= o sent > E> me private message to thanks me for this change I think that more > E> people are annoyed by the bell than people who wants it and we want > E> sane default that most users agrees on in base FreeBSD. If you don't > E> agree with the defaults we have a way to change them. > > To me this looks like abuse of committer priveleges. I got commit bit, > so I can change the defaults. > > Speaking of the bell itself. It is of course very annoying on some > laptops, especially if the laptop is used by someone else, not you. > But it is extremely useful when working in a loud server room on > a console, reviving a crashed machine, usually in a very stressful > environment. Gives feeling of machine being responsive or not being > responsive. > > So it is more a question of server vs desktop default. Okay, let's > ignore the biased opinion that FreeBSD is a server OS. But I would > assert that vt(4) is a way more used on servers, rather than on > laptops. If somebody is using vt(4) instead of X on a laptop, then > this person is special. Either really impared, as Shawn suggested, > or just a geek who hates GUI. In the latter case, they should tweak > the configuration. > > -- > Gleb Smirnoff Interrestingly my experience in datacenters is the exact opposite, the firs= t thing everyone I know is doing when installing freebsd in datacenter is d= isabling the bell, because the last thing you want is add noise on top of t= he noise. And use the bell only for very specific purpose. So your claim that it is server usage vs laptop is not true. It seems that there are very different habbits their and no way to really p= oll what the majority would like. Note that I am for both laptop/desktop and servers part of the people consi= dering the default should be off as well. Best regards, Bapt From nobody Thu Oct 21 07:40:00 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4A507180637D; Thu, 21 Oct 2021 07:40:02 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mail.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HZfX15PSPz3DKN; Thu, 21 Oct 2021 07:40:01 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1634802000; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8fFlpaN17Ilfn/PZGYvycCFIJEr0b9mChxrRB0bG/lo=; b=fY089KirmgjX49/Nvo40TP92WAXCMKYvv8eWXogZYDwUa8ugBt1FwgrRyjaPinBED928GM cCdJKiTOP0NIIXeO8KUK94h6DSCKNDt3gXESAslnxecdoikaJ0LO8KfmvTDkmJX45eRokK oyWK8xIxgUZQDWCTFbYWgybxHZw1YOA= Received: from skull.home.blih.net (lfbn-idf2-1-644-191.w86-247.abo.wanadoo.fr [86.247.100.191]) by mx.blih.net (OpenSMTPD) with ESMTPSA id cd10684c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 21 Oct 2021 07:40:00 +0000 (UTC) Date: Thu, 21 Oct 2021 09:40:00 +0200 From: Emmanuel Vadot To: Gleb Smirnoff Cc: Slawa Olhovchenkov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-Id: <20211021094000.58097dbece05fcd445aa3d87@bidouilliste.com> In-Reply-To: References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HZfX15PSPz3DKN X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Wed, 20 Oct 2021 10:11:05 -0700 Gleb Smirnoff wrote: > Emmanuel, > > On Wed, Oct 20, 2021 at 01:42:37PM +0200, Emmanuel Vadot wrote: > E> Stop using POLA for "This is a change that I don't agree with". > > A change that just changes the system behaviour and nothing else, > is a POLA violation. > > E> In the past weeks we had commits that changed mixer(8) cli in a > E> non-backward compatible way and changed the root shell. For both you > E> haven't complain so it means that either you don't care or you agree > E> with those changes. > > Mixer and root shell weren't like your change. Mixer is a complete > rewrite which has some technical background to justify it. Root shell > is also different to what you did. It is not flip of a binary switch. > > E> I agree that the bell is clearly a user preference and also I could > E> have left the review opened for more time (but I've been there and > E> usually you have review/feedback the first day and after it's silent). > E> I wish there was an easy way for developer (and community member) to > E> create a poll for changes like that but we don't have one right now. > E> Now based on the number of people who reviewed and the people who sent > E> me private message to thanks me for this change I think that more > E> people are annoyed by the bell than people who wants it and we want > E> sane default that most users agrees on in base FreeBSD. If you don't > E> agree with the defaults we have a way to change them. > > To me this looks like abuse of committer priveleges. I got commit bit, > so I can change the defaults. Oh common ... > Speaking of the bell itself. It is of course very annoying on some > laptops, especially if the laptop is used by someone else, not you. > But it is extremely useful when working in a loud server room on > a console, reviving a crashed machine, usually in a very stressful > environment. Gives feeling of machine being responsive or not being > responsive. Let's agree to disagree, I think that a high pitch noise like the bell in a stressful environment is horrible and makes me want to punch things (keyboard, screen, co-worker etc ...) > So it is more a question of server vs desktop default. Okay, let's > ignore the biased opinion that FreeBSD is a server OS. But I would > assert that vt(4) is a way more used on servers, rather than on > laptops. That's probably true. Now, I don't think that nowadays people spend a lot of time in datacenter installing FreeBSD on their server, they rack the machine, make sure that the BMC is working and leave. This makes the bell useless. > If somebody is using vt(4) instead of X on a laptop, then > this person is special. Either really impared, as Shawn suggested, > or just a geek who hates GUI. In the latter case, they should tweak > the configuration. > > -- > Gleb Smirnoff Except that FreeBSD doesn't include drm drivers or graphical env by default so the first thing that a user (new or not) have to deal with is vt(4). So they will login, do a bunch of command to configure the machine and will probably use tab for completion, and what will they hear when multiple commands are possible ? The bell. What will they hear if they try to go left or right in the shell and arrive at one of the ends ? The bell. And they will hear it in a bunch of other situation. Again it's clearly user preference and as you can see I really hate this bell. I'm sure that more people than the one who answered this commit like the bell but the question is do more people wants it on be default or not ? The non-scientific method that is twitter seems to agree with me (https://twitter.com/FreeBSDHelp/status/1450955125002887170). So, do we really want to make a poll so users can vote on what to do with a freaking bell ??? -- Emmanuel Vadot From nobody Thu Oct 21 07:40:50 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 615541806C07; Thu, 21 Oct 2021 07:40: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 4HZfXy1V5Tz3F2D; Thu, 21 Oct 2021 07:40: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 14C6C170EA; Thu, 21 Oct 2021 07:40: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 19L7eo0V023467; Thu, 21 Oct 2021 07:40:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19L7eoDS023466; Thu, 21 Oct 2021 07:40:50 GMT (envelope-from git) Date: Thu, 21 Oct 2021 07:40:50 GMT Message-Id: <202110210740.19L7eoDS023466@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Roger Pau Monn=C3=A9?= Subject: git: 535badd1b8d2 - main - xen/pcifront: purge from tree List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: royger X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 535badd1b8d210961be977161aa17cc3077edb46 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=535badd1b8d210961be977161aa17cc3077edb46 commit 535badd1b8d210961be977161aa17cc3077edb46 Author: Roger Pau Monné AuthorDate: 2021-10-20 10:39:33 +0000 Commit: Roger Pau Monné CommitDate: 2021-10-21 07:39:16 +0000 xen/pcifront: purge from tree Xen pcifront has been unhooked from the build for a long time, as it's only used by PV mode which FreeBSD doesn't support. Remove it from the tree. --- sys/dev/xen/pcifront/pcifront.c | 688 ---------------------------------------- 1 file changed, 688 deletions(-) diff --git a/sys/dev/xen/pcifront/pcifront.c b/sys/dev/xen/pcifront/pcifront.c deleted file mode 100644 index cc8cc92fac3c..000000000000 --- a/sys/dev/xen/pcifront/pcifront.c +++ /dev/null @@ -1,688 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * - * Copyright (c) 2006, Cisco Systems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Cisco Systems, Inc. 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) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include "pcib_if.h" - -#ifdef XEN_PCIDEV_FE_DEBUG -#define DPRINTF(fmt, args...) \ - printf("pcifront (%s:%d): " fmt, __FUNCTION__, __LINE__, ##args) -#else -#define DPRINTF(fmt, args...) ((void)0) -#endif -#define WPRINTF(fmt, args...) \ - printf("pcifront (%s:%d): " fmt, __FUNCTION__, __LINE__, ##args) - -#define INVALID_GRANT_REF (0) -#define INVALID_EVTCHN (-1) -#define virt_to_mfn(x) (vtophys(x) >> PAGE_SHIFT) - -struct pcifront_device { - STAILQ_ENTRY(pcifront_device) next; - - struct xenbus_device *xdev; - - int unit; - int evtchn; - int gnt_ref; - - /* Lock this when doing any operations in sh_info */ - struct mtx sh_info_lock; - struct xen_pci_sharedinfo *sh_info; - - device_t ndev; - - int ref_cnt; -}; - -static STAILQ_HEAD(pcifront_dlist, pcifront_device) pdev_list = STAILQ_HEAD_INITIALIZER(pdev_list); - -struct xpcib_softc { - int domain; - int bus; - struct pcifront_device *pdev; -}; - -/* Allocate a PCI device structure */ -static struct pcifront_device * -alloc_pdev(struct xenbus_device *xdev) -{ - struct pcifront_device *pdev = NULL; - int err, unit; - - err = sscanf(xdev->nodename, "device/pci/%d", &unit); - if (err != 1) { - if (err == 0) - err = -EINVAL; - xenbus_dev_fatal(pdev->xdev, err, "Error scanning pci device instance number"); - goto out; - } - - pdev = (struct pcifront_device *)malloc(sizeof(struct pcifront_device), M_DEVBUF, M_NOWAIT); - if (pdev == NULL) { - err = -ENOMEM; - xenbus_dev_fatal(xdev, err, "Error allocating pcifront_device struct"); - goto out; - } - pdev->unit = unit; - pdev->xdev = xdev; - pdev->ref_cnt = 1; - - pdev->sh_info = (struct xen_pci_sharedinfo *)malloc(PAGE_SIZE, M_DEVBUF, M_NOWAIT); - if (pdev->sh_info == NULL) { - free(pdev, M_DEVBUF); - pdev = NULL; - err = -ENOMEM; - xenbus_dev_fatal(xdev, err, "Error allocating sh_info struct"); - goto out; - } - pdev->sh_info->flags = 0; - - xdev->data = pdev; - - mtx_init(&pdev->sh_info_lock, "info_lock", "pci shared dev info lock", MTX_DEF); - - pdev->evtchn = INVALID_EVTCHN; - pdev->gnt_ref = INVALID_GRANT_REF; - - STAILQ_INSERT_TAIL(&pdev_list, pdev, next); - - DPRINTF("Allocated pdev @ 0x%p (unit=%d)\n", pdev, unit); - - out: - return pdev; -} - -/* Hold a reference to a pcifront device */ -static void -get_pdev(struct pcifront_device *pdev) -{ - pdev->ref_cnt++; -} - -/* Release a reference to a pcifront device */ -static void -put_pdev(struct pcifront_device *pdev) -{ - if (--pdev->ref_cnt > 0) - return; - - DPRINTF("freeing pdev @ 0x%p (ref_cnt=%d)\n", pdev, pdev->ref_cnt); - - if (pdev->evtchn != INVALID_EVTCHN) - xenbus_free_evtchn(pdev->xdev, pdev->evtchn); - - if (pdev->gnt_ref != INVALID_GRANT_REF) - gnttab_end_foreign_access(pdev->gnt_ref, 0, (void *)pdev->sh_info); - - pdev->xdev->data = NULL; - - free(pdev, M_DEVBUF); -} - -/* Write to the xenbus info needed by backend */ -static int -pcifront_publish_info(struct pcifront_device *pdev) -{ - int err = 0; - struct xenbus_transaction *trans; - - err = xenbus_grant_ring(pdev->xdev, virt_to_mfn(pdev->sh_info)); - if (err < 0) { - WPRINTF("error granting access to ring page\n"); - goto out; - } - - pdev->gnt_ref = err; - - err = xenbus_alloc_evtchn(pdev->xdev, &pdev->evtchn); - if (err) - goto out; - - do_publish: - trans = xenbus_transaction_start(); - if (IS_ERR(trans)) { - xenbus_dev_fatal(pdev->xdev, err, - "Error writing configuration for backend " - "(start transaction)"); - goto out; - } - - err = xenbus_printf(trans, pdev->xdev->nodename, - "pci-op-ref", "%u", pdev->gnt_ref); - if (!err) - err = xenbus_printf(trans, pdev->xdev->nodename, - "event-channel", "%u", pdev->evtchn); - if (!err) - err = xenbus_printf(trans, pdev->xdev->nodename, - "magic", XEN_PCI_MAGIC); - if (!err) - err = xenbus_switch_state(pdev->xdev, trans, - XenbusStateInitialised); - - if (err) { - xenbus_transaction_end(trans, 1); - xenbus_dev_fatal(pdev->xdev, err, - "Error writing configuration for backend"); - goto out; - } else { - err = xenbus_transaction_end(trans, 0); - if (err == -EAGAIN) - goto do_publish; - else if (err) { - xenbus_dev_fatal(pdev->xdev, err, - "Error completing transaction for backend"); - goto out; - } - } - - out: - return err; -} - -/* The backend is now connected so complete the connection process on our side */ -static int -pcifront_connect(struct pcifront_device *pdev) -{ - device_t nexus; - devclass_t nexus_devclass; - - /* We will add our device as a child of the nexus0 device */ - if (!(nexus_devclass = devclass_find("nexus")) || - !(nexus = devclass_get_device(nexus_devclass, 0))) { - WPRINTF("could not find nexus0!\n"); - return -1; - } - - /* Create a newbus device representing this frontend instance */ - pdev->ndev = BUS_ADD_CHILD(nexus, 0, "xpcife", pdev->unit); - if (!pdev->ndev) { - WPRINTF("could not create xpcife%d!\n", pdev->unit); - return -EFAULT; - } - get_pdev(pdev); - device_set_ivars(pdev->ndev, pdev); - - /* Good to go connected now */ - xenbus_switch_state(pdev->xdev, NULL, XenbusStateConnected); - - printf("pcifront: connected to %s\n", pdev->xdev->nodename); - - mtx_lock(&Giant); - device_probe_and_attach(pdev->ndev); - mtx_unlock(&Giant); - - return 0; -} - -/* The backend is closing so process a disconnect */ -static int -pcifront_disconnect(struct pcifront_device *pdev) -{ - int err = 0; - XenbusState prev_state; - - prev_state = xenbus_read_driver_state(pdev->xdev->nodename); - - if (prev_state < XenbusStateClosing) { - err = xenbus_switch_state(pdev->xdev, NULL, XenbusStateClosing); - if (!err && prev_state == XenbusStateConnected) { - /* TODO - need to detach the newbus devices */ - } - } - - return err; -} - -/* Process a probe from the xenbus */ -static int -pcifront_probe(struct xenbus_device *xdev, - const struct xenbus_device_id *id) -{ - int err = 0; - struct pcifront_device *pdev; - - DPRINTF("xenbus probing\n"); - - if ((pdev = alloc_pdev(xdev)) == NULL) - goto out; - - err = pcifront_publish_info(pdev); - - out: - if (err) - put_pdev(pdev); - return err; -} - -/* Remove the xenbus PCI device */ -static int -pcifront_remove(struct xenbus_device *xdev) -{ - DPRINTF("removing xenbus device node (%s)\n", xdev->nodename); - if (xdev->data) - put_pdev(xdev->data); - return 0; -} - -/* Called by xenbus when our backend node changes state */ -static void -pcifront_backend_changed(struct xenbus_device *xdev, - XenbusState be_state) -{ - struct pcifront_device *pdev = xdev->data; - - switch (be_state) { - case XenbusStateClosing: - DPRINTF("backend closing (%s)\n", xdev->nodename); - pcifront_disconnect(pdev); - break; - - case XenbusStateClosed: - DPRINTF("backend closed (%s)\n", xdev->nodename); - pcifront_disconnect(pdev); - break; - - case XenbusStateConnected: - DPRINTF("backend connected (%s)\n", xdev->nodename); - pcifront_connect(pdev); - break; - - default: - break; - } -} - -/* Process PCI operation */ -static int -do_pci_op(struct pcifront_device *pdev, struct xen_pci_op *op) -{ - int err = 0; - struct xen_pci_op *active_op = &pdev->sh_info->op; - evtchn_port_t port = pdev->evtchn; - time_t timeout; - - mtx_lock(&pdev->sh_info_lock); - - memcpy(active_op, op, sizeof(struct xen_pci_op)); - - /* Go */ - wmb(); - set_bit(_XEN_PCIF_active, (unsigned long *)&pdev->sh_info->flags); - notify_remote_via_evtchn(port); - - timeout = time_uptime + 2; - - clear_evtchn(port); - - /* Spin while waiting for the answer */ - while (test_bit - (_XEN_PCIF_active, (unsigned long *)&pdev->sh_info->flags)) { - int err = HYPERVISOR_poll(&port, 1, 3 * hz); - if (err) - panic("Failed HYPERVISOR_poll: err=%d", err); - clear_evtchn(port); - if (time_uptime > timeout) { - WPRINTF("pciback not responding!!!\n"); - clear_bit(_XEN_PCIF_active, - (unsigned long *)&pdev->sh_info->flags); - err = XEN_PCI_ERR_dev_not_found; - goto out; - } - } - - memcpy(op, active_op, sizeof(struct xen_pci_op)); - - err = op->err; - out: - mtx_unlock(&pdev->sh_info_lock); - return err; -} - -/* ** XenBus Driver registration ** */ - -static struct xenbus_device_id pcifront_ids[] = { - { "pci" }, - { "" } -}; - -static struct xenbus_driver pcifront = { - .name = "pcifront", - .ids = pcifront_ids, - .probe = pcifront_probe, - .remove = pcifront_remove, - .otherend_changed = pcifront_backend_changed, -}; - -/* Register the driver with xenbus during sys init */ -static void -pcifront_init(void *unused) -{ - if ((xen_start_info->flags & SIF_INITDOMAIN)) - return; - - DPRINTF("xenbus registering\n"); - - xenbus_register_frontend(&pcifront); -} - -SYSINIT(pciif, SI_SUB_PSEUDO, SI_ORDER_ANY, pcifront_init, NULL) - -/* Newbus xpcife device driver probe */ -static int -xpcife_probe(device_t dev) -{ -#ifdef XEN_PCIDEV_FE_DEBUG - struct pcifront_device *pdev = (struct pcifront_device *)device_get_ivars(dev); - DPRINTF("xpcife probe (unit=%d)\n", pdev->unit); -#endif - return (BUS_PROBE_NOWILDCARD); -} - -/* Newbus xpcife device driver attach */ -static int -xpcife_attach(device_t dev) -{ - struct pcifront_device *pdev = (struct pcifront_device *)device_get_ivars(dev); - int i, num_roots, len, err; - char str[64]; - unsigned int domain, bus; - - DPRINTF("xpcife attach (unit=%d)\n", pdev->unit); - - err = xenbus_scanf(NULL, pdev->xdev->otherend, - "root_num", "%d", &num_roots); - if (err != 1) { - if (err == 0) - err = -EINVAL; - xenbus_dev_fatal(pdev->xdev, err, - "Error reading number of PCI roots"); - goto out; - } - - /* Add a pcib device for each root */ - for (i = 0; i < num_roots; i++) { - device_t child; - - len = snprintf(str, sizeof(str), "root-%d", i); - if (unlikely(len >= (sizeof(str) - 1))) { - err = -ENOMEM; - goto out; - } - - err = xenbus_scanf(NULL, pdev->xdev->otherend, str, - "%x:%x", &domain, &bus); - if (err != 2) { - if (err >= 0) - err = -EINVAL; - xenbus_dev_fatal(pdev->xdev, err, - "Error reading PCI root %d", i); - goto out; - } - err = 0; - if (domain != pdev->xdev->otherend_id) { - err = -EINVAL; - xenbus_dev_fatal(pdev->xdev, err, - "Domain mismatch %d != %d", domain, pdev->xdev->otherend_id); - goto out; - } - - child = device_add_child(dev, "pcib", bus); - if (!child) { - err = -ENOMEM; - xenbus_dev_fatal(pdev->xdev, err, - "Unable to create pcib%d", bus); - goto out; - } - } - - out: - return bus_generic_attach(dev); -} - -static devclass_t xpcife_devclass; - -static device_method_t xpcife_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, xpcife_probe), - DEVMETHOD(device_attach, xpcife_attach), - DEVMETHOD(device_detach, bus_generic_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - /* Bus interface */ - DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - - DEVMETHOD_END -}; - -static driver_t xpcife_driver = { - "xpcife", - xpcife_methods, - 0, -}; - -DRIVER_MODULE(xpcife, nexus, xpcife_driver, xpcife_devclass, 0, 0); - -/* Newbus xen pcib device driver probe */ -static int -xpcib_probe(device_t dev) -{ - struct xpcib_softc *sc = (struct xpcib_softc *)device_get_softc(dev); - struct pcifront_device *pdev = (struct pcifront_device *)device_get_ivars(device_get_parent(dev)); - - DPRINTF("xpcib probe (bus=%d)\n", device_get_unit(dev)); - - sc->domain = pdev->xdev->otherend_id; - sc->bus = device_get_unit(dev); - sc->pdev = pdev; - - return 0; -} - -/* Newbus xen pcib device driver attach */ -static int -xpcib_attach(device_t dev) -{ - struct xpcib_softc *sc = (struct xpcib_softc *)device_get_softc(dev); - - DPRINTF("xpcib attach (bus=%d)\n", sc->bus); - - device_add_child(dev, "pci", -1); - return bus_generic_attach(dev); -} - -static int -xpcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) -{ - struct xpcib_softc *sc = (struct xpcib_softc *)device_get_softc(dev); - switch (which) { - case PCIB_IVAR_BUS: - *result = sc->bus; - return 0; - } - return ENOENT; -} - -/* Return the number of slots supported */ -static int -xpcib_maxslots(device_t dev) -{ - return 31; -} - -#define PCI_DEVFN(slot,func) ((((slot) & 0x1f) << 3) | ((func) & 0x07)) - -/* Read configuration space register */ -static u_int32_t -xpcib_read_config(device_t dev, int bus, int slot, int func, - int reg, int bytes) -{ - struct xpcib_softc *sc = (struct xpcib_softc *)device_get_softc(dev); - struct xen_pci_op op = { - .cmd = XEN_PCI_OP_conf_read, - .domain = sc->domain, - .bus = sc->bus, - .devfn = PCI_DEVFN(slot, func), - .offset = reg, - .size = bytes, - }; - int err; - - err = do_pci_op(sc->pdev, &op); - - DPRINTF("read config (b=%d, s=%d, f=%d, reg=%d, len=%d, val=%x, err=%d)\n", - bus, slot, func, reg, bytes, op.value, err); - - if (err) - op.value = ~0; - - return op.value; -} - -/* Write configuration space register */ -static void -xpcib_write_config(device_t dev, int bus, int slot, int func, - int reg, u_int32_t data, int bytes) -{ - struct xpcib_softc *sc = (struct xpcib_softc *)device_get_softc(dev); - struct xen_pci_op op = { - .cmd = XEN_PCI_OP_conf_write, - .domain = sc->domain, - .bus = sc->bus, - .devfn = PCI_DEVFN(slot, func), - .offset = reg, - .size = bytes, - .value = data, - }; - int err; - - err = do_pci_op(sc->pdev, &op); - - DPRINTF("write config (b=%d, s=%d, f=%d, reg=%d, len=%d, val=%x, err=%d)\n", - bus, slot, func, reg, bytes, data, err); -} - -static int -xpcib_route_interrupt(device_t pcib, device_t dev, int pin) -{ - struct pci_devinfo *dinfo = device_get_ivars(dev); - pcicfgregs *cfg = &dinfo->cfg; - - DPRINTF("route intr (pin=%d, line=%d)\n", pin, cfg->intline); - - return cfg->intline; -} - -static device_method_t xpcib_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, xpcib_probe), - DEVMETHOD(device_attach, xpcib_attach), - DEVMETHOD(device_detach, bus_generic_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - - /* Bus interface */ - DEVMETHOD(bus_read_ivar, xpcib_read_ivar), - DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - - /* pcib interface */ - DEVMETHOD(pcib_maxslots, xpcib_maxslots), - DEVMETHOD(pcib_read_config, xpcib_read_config), - DEVMETHOD(pcib_write_config, xpcib_write_config), - DEVMETHOD(pcib_route_interrupt, xpcib_route_interrupt), - DEVMETHOD(pcib_request_feature, pcib_request_feature_allow), - - DEVMETHOD_END -}; - -static devclass_t xpcib_devclass; - -DEFINE_CLASS_0(pcib, xpcib_driver, xpcib_methods, sizeof(struct xpcib_softc)); -DRIVER_MODULE(pcib, xpcife, xpcib_driver, xpcib_devclass, 0, 0); - -/* - * Local variables: - * mode: C - * c-set-style: "BSD" - * c-basic-offset: 4 - * tab-width: 4 - * indent-tabs-mode: t - * End: - */ From nobody Thu Oct 21 07:40:51 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DF8081806B3A; Thu, 21 Oct 2021 07:40: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 4HZfXz3XX7z3DvT; Thu, 21 Oct 2021 07:40: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 475CB170EB; Thu, 21 Oct 2021 07:40: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 19L7epim023502; Thu, 21 Oct 2021 07:40:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19L7epoq023501; Thu, 21 Oct 2021 07:40:51 GMT (envelope-from git) Date: Thu, 21 Oct 2021 07:40:51 GMT Message-Id: <202110210740.19L7epoq023501@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Roger Pau Monn=C3=A9?= Subject: git: 5bb67f5f3f59 - main - xen/devices: purge uses of intr_machdep.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: royger X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5bb67f5f3f59d77e6f5d67b1a7fa7c514fdaff50 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=5bb67f5f3f59d77e6f5d67b1a7fa7c514fdaff50 commit 5bb67f5f3f59d77e6f5d67b1a7fa7c514fdaff50 Author: Elliott Mitchell AuthorDate: 2021-04-23 02:59:22 +0000 Commit: Roger Pau Monné CommitDate: 2021-10-21 07:39:16 +0000 xen/devices: purge uses of intr_machdep.h Devices in sys/dev should be architecture-independent and NOT #include intr_machdep.h. Reviewed by: mhorne royger Differential Revision: https://reviews.freebsd.org/D29959 --- sys/dev/xen/blkfront/blkfront.c | 1 - sys/dev/xen/evtchn/evtchn_dev.c | 1 - 2 files changed, 2 deletions(-) diff --git a/sys/dev/xen/blkfront/blkfront.c b/sys/dev/xen/blkfront/blkfront.c index 7078cb16caa1..4f67d1f827e7 100644 --- a/sys/dev/xen/blkfront/blkfront.c +++ b/sys/dev/xen/blkfront/blkfront.c @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include diff --git a/sys/dev/xen/evtchn/evtchn_dev.c b/sys/dev/xen/evtchn/evtchn_dev.c index fd8e290431ba..c970404cce3c 100644 --- a/sys/dev/xen/evtchn/evtchn_dev.c +++ b/sys/dev/xen/evtchn/evtchn_dev.c @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include From nobody Thu Oct 21 08:02:14 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1FE9B180FA2B; Thu, 21 Oct 2021 08:02:17 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HZg1h6kvzz3LYQ; Thu, 21 Oct 2021 08:02:16 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1mdT1i-000I7Y-EN; Thu, 21 Oct 2021 11:02:14 +0300 Date: Thu, 21 Oct 2021 11:02:14 +0300 From: Slawa Olhovchenkov To: Gleb Smirnoff Cc: Emmanuel Vadot , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: <20211021080214.GB77338@zxy.spb.ru> References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-Rspamd-Queue-Id: 4HZg1h6kvzz3LYQ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Wed, Oct 20, 2021 at 10:11:05AM -0700, Gleb Smirnoff wrote: > laptops. If somebody is using vt(4) instead of X on a laptop, then This change disable bell in X11 too. This is completly disable speaker bell. From nobody Thu Oct 21 11:08:00 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CBC3D1817A86; Thu, 21 Oct 2021 11:08: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 4HZl804LVxz4sFn; Thu, 21 Oct 2021 11:08: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 71EA71A11F; Thu, 21 Oct 2021 11:08: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 19LB80lM092725; Thu, 21 Oct 2021 11:08:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19LB80ed092724; Thu, 21 Oct 2021 11:08:00 GMT (envelope-from git) Date: Thu, 21 Oct 2021 11:08:00 GMT Message-Id: <202110211108.19LB80ed092724@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 12615938c6e0 - main - timeout.1: Fix typos in examples List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 12615938c6e0bc3ca7604a8b0614ff23d9964370 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=12615938c6e0bc3ca7604a8b0614ff23d9964370 commit 12615938c6e0bc3ca7604a8b0614ff23d9964370 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-10-21 11:06:45 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-10-21 11:07:32 +0000 timeout.1: Fix typos in examples MFC after: 3 days --- usr.bin/timeout/timeout.1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.bin/timeout/timeout.1 b/usr.bin/timeout/timeout.1 index 87a86c81e6ee..27f022c48636 100644 --- a/usr.bin/timeout/timeout.1 +++ b/usr.bin/timeout/timeout.1 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 20, 2021 +.Dd October 21, 2021 .Dt TIMEOUT 1 .Os .Sh NAME @@ -161,7 +161,7 @@ $ echo $? .Pp Same as above but preserving status. Exit status is 128 + signal number (15 for -.Va SIGTERM ) +.Va SIGTERM ) : .Bd -literal -offset indent $ timeout --preserve-status 2 sleep 4 $ echo $? @@ -171,7 +171,7 @@ $ echo $? Same as above but sending .Va SIGALRM (signal number 14) instead of -.Va SIGTERM +.Va SIGTERM : .Bd -literal -offset indent $ timeout --preserve-status -s SIGALRM 2 sleep 4 $ echo $? @@ -189,8 +189,8 @@ signal after 1 minute and send a .Va SIGKILL signal 5 seconds later if the process refuses to stop: .Bd -literal -offset indent -timeout -k 5s 1m fetch \\ -https://download.freebsd.org/ftp/doc/en/books/handbook/book.pdf +$ timeout -k 5s 1m fetch \\ +> https://download.freebsd.org/ftp/doc/en/books/handbook/book.pdf .Ed .Sh SEE ALSO .Xr kill 1 , From nobody Thu Oct 21 11:24:12 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F0C2717F0AE7; Thu, 21 Oct 2021 11:24: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 4HZlVh56rgz4xkb; Thu, 21 Oct 2021 11:24: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 903221A6A0; Thu, 21 Oct 2021 11:24: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 19LBOCAc019018; Thu, 21 Oct 2021 11:24:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19LBOCot019017; Thu, 21 Oct 2021 11:24:12 GMT (envelope-from git) Date: Thu, 21 Oct 2021 11:24:12 GMT Message-Id: <202110211124.19LBOCot019017@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 01593a0ff9f1 - main - Only change the fadt revision in acpidump on i386 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 01593a0ff9f16e2cb23ab2ebc4ca3b8bd2434425 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=01593a0ff9f16e2cb23ab2ebc4ca3b8bd2434425 commit 01593a0ff9f16e2cb23ab2ebc4ca3b8bd2434425 Author: Andrew Turner AuthorDate: 2021-10-20 09:19:55 +0000 Commit: Andrew Turner CommitDate: 2021-10-21 11:20:32 +0000 Only change the fadt revision in acpidump on i386 There is a workaround in acpidump for an old IBM laptop. This is being hit on a modern arm64 system causing acpidump to use the wrong field when reading a later address. As the laptop has a 32-bit CPU the only FreeBSD support for it is i386. As such limit the workaround to that architecture. Reviewed by: emaste, jkim, jhb (all earlier version) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32573 --- usr.sbin/acpi/acpidump/acpi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index adb5b968f441..0e91a85f6a90 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -219,16 +219,22 @@ acpi_get_fadt_revision(ACPI_TABLE_FADT *fadt) if (addr_size == 8) { fadt_revision = 2; +#if defined(__i386__) /* * A few systems (e.g., IBM T23) have an RSDP that claims * revision 2 but the 64 bit addresses are invalid. If * revision 2 and the 32 bit address is non-zero but the * 32 and 64 bit versions don't match, prefer the 32 bit * version for all subsequent tables. + * + * The only known ACPI systems this affects are early + * implementations on 32-bit x86. Because of this limit the + * workaround to i386. */ if (fadt->Facs != 0 && (fadt->XFacs & 0xffffffff) != fadt->Facs) fadt_revision = 1; +#endif } else fadt_revision = 1; return (fadt_revision); From nobody Thu Oct 21 13:47:21 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EA2AE180CE66; Thu, 21 Oct 2021 13:47: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 4HZpgs678nz3qgC; Thu, 21 Oct 2021 13:47: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 AE10B1C168; Thu, 21 Oct 2021 13:47: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 19LDlLQC004710; Thu, 21 Oct 2021 13:47:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19LDlLoS004709; Thu, 21 Oct 2021 13:47:21 GMT (envelope-from git) Date: Thu, 21 Oct 2021 13:47:21 GMT Message-Id: <202110211347.19LDlLoS004709@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: 6ba2210ee039 - main - zfs: merge openzfs/zfs@ec64fdb93 (master) into main List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 6ba2210ee039f2f12878c217bcf058e9c8b26b29 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=6ba2210ee039f2f12878c217bcf058e9c8b26b29 commit 6ba2210ee039f2f12878c217bcf058e9c8b26b29 Merge: 01593a0ff9f1 ec64fdb93d14 Author: Martin Matuska AuthorDate: 2021-10-21 11:58:45 +0000 Commit: Martin Matuska CommitDate: 2021-10-21 13:06:06 +0000 zfs: merge openzfs/zfs@ec64fdb93 (master) into main Notable upstream pull request merges: #12392 Avoid panic in case of pool errors and missing L2ARC #12448 skip snapshot in zfs_iter_mounted() #12516 Fix NFS and large reads on older kernels #12533 Fail invalid incremental recursive send gracefully #12569 FreeBSD: Really zero the zero page #12575 Reject zfs send -RI with nonexistent fromsnap #12602 Correct refcount_add in dmu_zfetch #12650 zpool should call zfs_nicestrtonum() with non-NULL handle Obtained from: OpenZFS OpenZFS commit: ec64fdb93d144ab1884097cfd36e18b62a2db848 cddl/lib/libzfs/Makefile | 1 - cddl/lib/libzfs_core/Makefile | 7 +- cddl/lib/libzutil/Makefile | 5 +- sys/contrib/openzfs/META | 2 +- sys/contrib/openzfs/cmd/arcstat/arcstat.in | 66 +- sys/contrib/openzfs/cmd/vdev_id/vdev_id | 4 +- sys/contrib/openzfs/cmd/zdb/zdb.c | 9 +- .../openzfs/cmd/zed/zed.d/statechange-notify.sh | 5 +- sys/contrib/openzfs/cmd/zpool/Makefile.am | 3 +- sys/contrib/openzfs/cmd/zpool/zpool_iter.c | 50 +- sys/contrib/openzfs/cmd/zpool/zpool_main.c | 10 +- sys/contrib/openzfs/cmd/zpool/zpool_util.h | 2 +- sys/contrib/openzfs/contrib/initramfs/hooks/zfs.in | 1 - sys/contrib/openzfs/contrib/initramfs/scripts/zfs | 1 + sys/contrib/openzfs/include/libzfs.h | 1 + sys/contrib/openzfs/include/libzfs_core.h | 3 + sys/contrib/openzfs/include/libzutil.h | 11 +- .../include/os/freebsd/zfs/sys/zfs_ioctl_compat.h | 1 - sys/contrib/openzfs/include/sys/dmu.h | 2 + sys/contrib/openzfs/include/sys/zfs_refcount.h | 8 + sys/contrib/openzfs/include/sys/zio.h | 72 +- sys/contrib/openzfs/lib/Makefile.am | 39 + sys/contrib/openzfs/lib/libshare/os/linux/nfs.c | 47 +- sys/contrib/openzfs/lib/libspl/page.c | 1 + sys/contrib/openzfs/lib/libzfs/Makefile.am | 2 +- sys/contrib/openzfs/lib/libzfs/libzfs.abi | 1893 +++++++++++++++++++- sys/contrib/openzfs/lib/libzfs/libzfs_dataset.c | 5 +- sys/contrib/openzfs/lib/libzfs/libzfs_iter.c | 7 +- sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c | 28 +- .../openzfs/lib/libzfs/os/freebsd/libzfs_compat.c | 9 +- .../lib/libzfs/os/freebsd/libzfs_ioctl_compat.c | 432 ----- .../openzfs/lib/libzfs/os/linux/libzfs_util_os.c | 6 + sys/contrib/openzfs/lib/libzfs_core/Makefile.am | 20 +- .../openzfs/lib/libzfs_core/libzfs_core.abi | 946 +--------- sys/contrib/openzfs/lib/libzfs_core/libzfs_core.c | 10 +- .../os/freebsd/libzfs_core_ioctl.c} | 5 +- .../os/linux/libzfs_core_ioctl.c} | 4 +- sys/contrib/openzfs/lib/libzpool/Makefile.am | 4 +- sys/contrib/openzfs/lib/libzpool/util.c | 98 +- sys/contrib/openzfs/lib/libzutil/Makefile.am | 12 +- .../lib/libzutil/os/freebsd/zutil_import_os.c | 5 + .../lib/libzutil/os/linux/zutil_import_os.c | 67 +- sys/contrib/openzfs/lib/libzutil/zutil_import.c | 68 + sys/contrib/openzfs/man/man8/zfs-send.8 | 3 + sys/contrib/openzfs/man/man8/zfs.8 | 2 +- sys/contrib/openzfs/module/Makefile.in | 9 +- sys/contrib/openzfs/module/os/freebsd/zfs/abd_os.c | 1 + sys/contrib/openzfs/module/os/freebsd/zfs/dmu_os.c | 19 - sys/contrib/openzfs/module/zfs/arc.c | 7 +- sys/contrib/openzfs/module/zfs/dmu.c | 6 +- sys/contrib/openzfs/module/zfs/dmu_zfetch.c | 3 +- sys/contrib/openzfs/module/zfs/dnode.c | 75 +- sys/contrib/openzfs/module/zfs/refcount.c | 8 + sys/contrib/openzfs/module/zfs/vdev.c | 24 + sys/contrib/openzfs/module/zfs/zfs_vnops.c | 8 + sys/contrib/openzfs/tests/runfiles/linux.run | 2 +- sys/contrib/openzfs/tests/runfiles/sanity.run | 2 +- .../openzfs/tests/test-runner/bin/zts-report.py.in | 4 +- .../openzfs/tests/test-runner/include/logapi.shlib | 50 + .../cmd/libzfs_input_check/libzfs_input_check.c | 6 +- .../openzfs/tests/zfs-tests/cmd/mkbusy/Makefile.am | 2 - .../openzfs/tests/zfs-tests/cmd/mkbusy/mkbusy.c | 20 +- .../openzfs/tests/zfs-tests/include/blkdev.shlib | 2 +- .../functional/cli_root/zfs_share/Makefile.am | 1 + .../cli_root/zfs_share/zfs_share_007_neg.ksh | 2 +- .../cli_root/zfs_share/zfs_share_013_pos.ksh | 80 + .../cli_root/zfs_unmount/zfs_unmount_nested.ksh | 8 +- .../tests/functional/compression/Makefile.am | 4 +- .../functional/compression/compress_zstd_bswap.ksh | 55 + .../functional/compression/testpool_zstd.tar.gz | Bin 0 -> 1286794 bytes .../zfs-tests/tests/functional/ctime/Makefile.am | 2 - .../tests/zfs-tests/tests/functional/ctime/ctime.c | 10 +- .../tests/functional/deadman/deadman_sync.ksh | 4 +- .../tests/functional/rsend/rsend_016_neg.ksh | 14 +- .../zvol/zvol_misc/zvol_misc_common.kshlib | 11 +- .../zvol/zvol_misc/zvol_misc_rename_inuse.ksh | 4 +- .../zvol/zvol_misc/zvol_misc_snapdev.ksh | 2 +- .../zvol/zvol_misc/zvol_misc_volmode.ksh | 46 +- .../functional/zvol/zvol_misc/zvol_misc_zil.ksh | 4 +- .../openzfs/tests/zfs-tests/tests/perf/perf.shlib | 1 - .../tests/perf/regression/random_reads.ksh | 1 + .../tests/perf/regression/random_readwrite.ksh | 1 + .../perf/regression/random_readwrite_fixed.ksh | 1 + .../tests/perf/regression/random_writes.ksh | 1 + .../tests/perf/regression/random_writes_zil.ksh | 3 +- .../tests/perf/regression/sequential_reads.ksh | 1 + .../regression/sequential_reads_arc_cached.ksh | 3 +- .../sequential_reads_arc_cached_clone.ksh | 3 +- .../regression/sequential_reads_dbuf_cached.ksh | 1 + .../tests/perf/regression/sequential_writes.ksh | 3 +- sys/modules/zfs/zfs_config.h | 21 +- sys/modules/zfs/zfs_gitrev.h | 2 +- 92 files changed, 2750 insertions(+), 1764 deletions(-) diff --cc cddl/lib/libzfs/Makefile index 6de09d1b7333,000000000000..63bfcb39d4d8 mode 100644,000000..100644 --- a/cddl/lib/libzfs/Makefile +++ b/cddl/lib/libzfs/Makefile @@@ -1,109 -1,0 +1,108 @@@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/contrib/openzfs/module/icp +.PATH: ${SRCTOP}/sys/contrib/openzfs/module/zcommon +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzfs +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzfs/os/freebsd +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libshare +.PATH: ${SRCTOP}/sys/contrib/openzfs/include +.PATH: ${SRCTOP}/sys/contrib/openzfs/module/zstd +.PATH: ${SRCTOP}/sys/contrib/openzfs/module/zstd/lib + +PACKAGE= runtime +LIB= zfs +LIBADD= \ + avl \ + bsdxml \ + crypto \ + geom \ + m \ + md \ + nvpair \ + pthread \ + umem \ + util \ + uutil \ + z \ + zfs_core \ + zutil + +INCS= libzfs.h +USER_C = \ + libzfs_changelist.c \ + libzfs_config.c \ + libzfs_crypto.c \ + libzfs_dataset.c \ + libzfs_diff.c \ + libzfs_import.c \ + libzfs_iter.c \ + libzfs_mount.c \ + libzfs_pool.c \ + libzfs_sendrecv.c \ + libzfs_status.c \ + libzfs_util.c + +# FreeBSD +USER_C += \ + libzfs_compat.c \ - libzfs_ioctl_compat.c \ + libzfs_zmount.c + +# libshare +USER_C += \ + libshare.c \ + nfs.c \ + os/freebsd/nfs.c \ + os/freebsd/smb.c + +KERNEL_C = \ + algs/sha2/sha2.c \ + cityhash.c \ + zfeature_common.c \ + zfs_comutil.c \ + zfs_deleg.c \ + zfs_fletcher.c \ + zfs_fletcher_superscalar.c \ + zfs_fletcher_superscalar4.c \ + zfs_namecheck.c \ + zfs_prop.c \ + zpool_prop.c \ + zprop_common.c + + +ARCH_C = +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" +ARCH_C += zfs_fletcher_intel.c \ + zfs_fletcher_sse.c +CFLAGS += -DHAVE_SSE2 +.endif +.if ${MACHINE_ARCH} == "amd64" +ARCH_C += zfs_fletcher_avx512.c +CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_AVX512F +.endif +.if ${MACHINE_CPUARCH} == "aarch64" +ARCH_C += zfs_fletcher_aarch64_neon.c +.endif + +SRCS= $(USER_C) $(KERNEL_C) $(ARCH_C) + +WARNS?= 2 +SHLIB_MAJOR= 4 +CSTD= c99 +CFLAGS+= -DIN_BASE +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libshare +CFLAGS+= -I${SRCTOP}/sys/contrib/ck/include +CFLAGS+= -I${SRCTOP}/sys +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h +CFLAGS+= -DHAVE_ISSETUGID +CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h +CFLAGS+= -DSYSCONFDIR=\"/etc\" +CFLAGS+= -DPKGDATADIR=\"/usr/share/zfs\" + + +.include diff --cc cddl/lib/libzfs_core/Makefile index 52747bfcc2d8,000000000000..abe0348f2313 mode 100644,000000..100644 --- a/cddl/lib/libzfs_core/Makefile +++ b/cddl/lib/libzfs_core/Makefile @@@ -1,28 -1,0 +1,33 @@@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzfs_core +.PATH: ${SRCTOP}/sys/contrib/openzfs/include ++.PATH: ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/zfs ++.PATH: ${SRCTOP}/sys/contrib/openzfs/module/os/freebsd/zfs + + +LIB= zfs_core +LIBADD= nvpair +PACKAGE= runtime + +INCS= libzfs_core.h - SRCS= libzfs_core.c ++SRCS= libzfs_core.c \ ++ os/freebsd/libzfs_core_ioctl.c \ ++ zfs_ioctl_compat.c + +WARNS?= 2 +CSTD= c99 +CFLAGS+= -DIN_BASE +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libzfs_core/common +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd ++CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/zfs +CFLAGS+= -I${SRCTOP}/sys +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h +CFLAGS+= -DHAVE_ISSETUGID +CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h + +.include diff --cc cddl/lib/libzutil/Makefile index 7aea9da14e90,000000000000..85467151a5bb mode 100644,000000..100644 --- a/cddl/lib/libzutil/Makefile +++ b/cddl/lib/libzutil/Makefile @@@ -1,42 -1,0 +1,41 @@@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzutil +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzutil/os/freebsd +.PATH: ${SRCTOP}/sys/contrib/openzfs/module/os/freebsd/zfs + +LIB= zutil +LIBADD= avl tpool +PACKAGE= runtime + +INCS = zutil_import.h + +SRCS = \ + zutil_device_path.c \ + zutil_import.c \ + zutil_import.h \ + zutil_nicenum.c \ + zutil_pool.c + +SRCS += \ - zutil_device_path_os.c \ - zutil_import_os.c \ - zutil_compat.c ++ os/freebsd/zutil_device_path_os.c \ ++ os/freebsd/zutil_import_os.c + +SRCS += zfs_ioctl_compat.c + + +WARNS?= 2 +CSTD= c99 + +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/zfs +CFLAGS+= -I${SRCTOP}/sys +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libzutil +CFLAGS+= -DHAVE_ISSETUGID -DIN_BASE +CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h + +.include diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_013_pos.ksh index 000000000000,150eddac0ebb..150eddac0ebb mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_013_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_013_pos.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/compression/compress_zstd_bswap.ksh index 000000000000,9726cf0dd5a6..9726cf0dd5a6 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/compression/compress_zstd_bswap.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/compression/compress_zstd_bswap.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/compression/testpool_zstd.tar.gz index 000000000000,4096f7fcbe44..4096f7fcbe44 mode 000000,100644..100644 Binary files differ diff --cc sys/modules/zfs/zfs_config.h index 82f6d415f966,000000000000..8bbe141827db mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,849 -1,0 +1,864 @@@ +/* + * $FreeBSD$ + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* bio_end_io_t wants 1 arg */ +/* #undef HAVE_1ARG_BIO_END_IO_T */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* submit_bio() wants 1 arg */ +/* #undef HAVE_1ARG_SUBMIT_BIO */ + +/* bdi_setup_and_register() wants 2 args */ +/* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 2 args */ +/* #undef HAVE_2ARGS_VFS_GETATTR */ + +/* zlib_deflate_workspacesize() wants 2 args */ +/* #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */ + +/* bdi_setup_and_register() wants 3 args */ +/* #undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 3 args */ +/* #undef HAVE_3ARGS_VFS_GETATTR */ + +/* vfs_getattr wants 4 args */ +/* #undef HAVE_4ARGS_VFS_GETATTR */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* posix_acl has refcount_t */ +/* #undef HAVE_ACL_REFCOUNT */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio->bi_bdev->bd_disk exists */ +/* #undef HAVE_BIO_BDEV_DISK */ + +/* bio->bi_opf is defined */ +/* #undef HAVE_BIO_BI_OPF */ + +/* bio->bi_status exists */ +/* #undef HAVE_BIO_BI_STATUS */ + +/* bio has bi_iter */ +/* #undef HAVE_BIO_BVEC_ITER */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_max_segs() is implemented */ +/* #undef HAVE_BIO_MAX_SEGS */ + +/* bio_set_dev() is available */ +/* #undef HAVE_BIO_SET_DEV */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + +/* blk_alloc_disk() exists */ +/* #undef HAVE_BLK_ALLOC_DISK */ + +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_flag_clear() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_CLEAR */ + +/* blk_queue_flag_set() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_SET */ + +/* blk_queue_flush() is available */ +/* #undef HAVE_BLK_QUEUE_FLUSH */ + +/* blk_queue_flush() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY */ + +/* blk_queue_secdiscard() is available */ +/* #undef HAVE_BLK_QUEUE_SECDISCARD */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + ++/* blk_queue_update_readahead() exists */ ++/* #undef HAVE_BLK_QUEUE_UPDATE_READAHEAD */ ++ +/* blk_queue_write_cache() exists */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE */ + +/* blk_queue_write_cache() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY */ + +/* Define if revalidate_disk() in block_device_operations */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK */ + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + +/* clear_inode() is available */ +/* #undef HAVE_CLEAR_INODE */ + +/* dentry uses const struct dentry_operations */ +/* #undef HAVE_CONST_DENTRY_OPERATIONS */ + +/* copy_from_iter() is available */ +/* #undef HAVE_COPY_FROM_ITER */ + +/* copy_to_iter() is available */ +/* #undef HAVE_COPY_TO_ITER */ + +/* yes */ +/* #undef HAVE_CPU_HOTPLUG */ + +/* current_time() exists */ +/* #undef HAVE_CURRENT_TIME */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* DECLARE_EVENT_CLASS() is available */ +/* #undef HAVE_DECLARE_EVENT_CLASS */ + +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + +/* sops->dirty_inode() wants flags */ +/* #undef HAVE_DIRTY_INODE_WITH_FLAGS */ + +/* disk_*_io_acct() available */ +/* #undef HAVE_DISK_IO_ACCT */ + ++/* disk_update_readahead() exists */ ++/* #undef HAVE_DISK_UPDATE_READAHEAD */ ++ +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* d_make_root() is available */ +/* #undef HAVE_D_MAKE_ROOT */ + +/* d_prune_aliases() is available */ +/* #undef HAVE_D_PRUNE_ALIASES */ + +/* dops->d_revalidate() operation takes nameidata */ +/* #undef HAVE_D_REVALIDATE_NAMEIDATA */ + +/* eops->encode_fh() wants child and parent inodes */ +/* #undef HAVE_ENCODE_FH_WITH_INODE */ + +/* sops->evict_inode() exists */ +/* #undef HAVE_EVICT_INODE */ + +/* fops->aio_fsync() exists */ +/* #undef HAVE_FILE_AIO_FSYNC */ + +/* file_dentry() is available */ +/* #undef HAVE_FILE_DENTRY */ + +/* file_inode() is available */ +/* #undef HAVE_FILE_INODE */ + +/* iops->follow_link() cookie */ +/* #undef HAVE_FOLLOW_LINK_COOKIE */ + +/* iops->follow_link() nameidata */ +/* #undef HAVE_FOLLOW_LINK_NAMEIDATA */ + +/* fops->fsync() with range */ +/* #undef HAVE_FSYNC_RANGE */ + +/* fops->fsync() without dentry */ +/* #undef HAVE_FSYNC_WITHOUT_DENTRY */ + +/* generic_fillattr requires struct user_namespace* */ +/* #undef HAVE_GENERIC_FILLATTR_USERNS */ + +/* generic_*_io_acct() 3 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_3ARG */ + +/* generic_*_io_acct() 4 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_4ARG */ + +/* generic_readlink is global */ +/* #undef HAVE_GENERIC_READLINK */ + +/* generic_setxattr() exists */ +/* #undef HAVE_GENERIC_SETXATTR */ + +/* generic_write_checks() takes kiocb */ +/* #undef HAVE_GENERIC_WRITE_CHECKS_KIOCB */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + ++/* iops->get_acl() exists */ ++/* #undef HAVE_GET_ACL */ ++ ++/* iops->get_acl() takes rcu */ ++/* #undef HAVE_GET_ACL_RCU */ ++ +/* iops->get_link() cookie */ +/* #undef HAVE_GET_LINK_COOKIE */ + +/* iops->get_link() delayed */ +/* #undef HAVE_GET_LINK_DELAYED */ + +/* group_info->gid exists */ +/* #undef HAVE_GROUP_INFO_GID */ + +/* has_capability() is available */ +/* #undef HAVE_HAS_CAPABILITY */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* yes */ +/* #undef HAVE_INODE_LOCK_SHARED */ + +/* inode_owner_or_capable() exists */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE */ + +/* inode_owner_or_capable() takes user_ns */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_IDMAPPED */ + +/* inode_set_flags() exists */ +/* #undef HAVE_INODE_SET_FLAGS */ + +/* inode_set_iversion() exists */ +/* #undef HAVE_INODE_SET_IVERSION */ + +/* inode->i_*time's are timespec64 */ +/* #undef HAVE_INODE_TIMESPEC64_TIMES */ + +/* timestamp_truncate() exists */ +/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* in_compat_syscall() is available */ +/* #undef HAVE_IN_COMPAT_SYSCALL */ + +/* iops->create() takes struct user_namespace* */ +/* #undef HAVE_IOPS_CREATE_USERNS */ + +/* iops->mkdir() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKDIR_USERNS */ + +/* iops->mknod() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKNOD_USERNS */ + +/* iops->rename() takes struct user_namespace* */ +/* #undef HAVE_IOPS_RENAME_USERNS */ + +/* iops->symlink() takes struct user_namespace* */ +/* #undef HAVE_IOPS_SYMLINK_USERNS */ + +/* iov_iter_advance() is available */ +/* #undef HAVE_IOV_ITER_ADVANCE */ + +/* iov_iter_count() is available */ +/* #undef HAVE_IOV_ITER_COUNT */ + +/* iov_iter_fault_in_readable() is available */ +/* #undef HAVE_IOV_ITER_FAULT_IN_READABLE */ + +/* iov_iter_revert() is available */ +/* #undef HAVE_IOV_ITER_REVERT */ + +/* iov_iter types are available */ +/* #undef HAVE_IOV_ITER_TYPES */ + +/* yes */ +/* #undef HAVE_IO_SCHEDULE_TIMEOUT */ + +/* Define to 1 if you have the `issetugid' function. */ +#define HAVE_ISSETUGID 1 + +/* kernel has kernel_fpu_* functions */ +/* #undef HAVE_KERNEL_FPU */ + +/* kernel has asm/fpu/api.h */ +/* #undef HAVE_KERNEL_FPU_API_HEADER */ + +/* kernel fpu internal */ +/* #undef HAVE_KERNEL_FPU_INTERNAL */ + +/* uncached_acl_sentinel() exists */ +/* #undef HAVE_KERNEL_GET_ACL_HANDLE_CACHE */ + +/* kernel does stack verification */ +/* #undef HAVE_KERNEL_OBJTOOL */ + +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + +/* kernel_read() take loff_t pointer */ +/* #undef HAVE_KERNEL_READ_PPOS */ + +/* timer_list.function gets a timer_list */ +/* #undef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST */ + +/* struct timer_list has a flags member */ +/* #undef HAVE_KERNEL_TIMER_LIST_FLAGS */ + +/* timer_setup() is available */ +/* #undef HAVE_KERNEL_TIMER_SETUP */ + +/* kernel_write() take loff_t pointer */ +/* #undef HAVE_KERNEL_WRITE_PPOS */ + +/* kmem_cache_create_usercopy() exists */ +/* #undef HAVE_KMEM_CACHE_CREATE_USERCOPY */ + +/* kstrtoul() exists */ +/* #undef HAVE_KSTRTOUL */ + +/* ktime_get_coarse_real_ts64() exists */ +/* #undef HAVE_KTIME_GET_COARSE_REAL_TS64 */ + +/* ktime_get_raw_ts64() exists */ +/* #undef HAVE_KTIME_GET_RAW_TS64 */ + +/* kvmalloc exists */ +/* #undef HAVE_KVMALLOC */ + +/* Define if you have [aio] */ +/* #undef HAVE_LIBAIO */ + +/* Define if you have [blkid] */ +/* #undef HAVE_LIBBLKID */ + +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 + +/* Define if you have [tirpc] */ +/* #undef HAVE_LIBTIRPC */ + +/* Define if you have [udev] */ +/* #undef HAVE_LIBUDEV */ + +/* Define if you have [uuid] */ +/* #undef HAVE_LIBUUID */ + +/* lseek_execute() is available */ +/* #undef HAVE_LSEEK_EXECUTE */ + +/* makedev() is declared in sys/mkdev.h */ +/* #undef HAVE_MAKEDEV_IN_MKDEV */ + +/* makedev() is declared in sys/sysmacros.h */ +/* #undef HAVE_MAKEDEV_IN_SYSMACROS */ + +/* Noting that make_request_fn() returns blk_qc_t */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_QC */ + +/* Noting that make_request_fn() returns void */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_VOID */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* iops->mkdir() takes umode_t */ +/* #undef HAVE_MKDIR_UMODE_T */ + +/* Define to 1 if you have the `mlockall' function. */ +#define HAVE_MLOCKALL 1 + +/* lookup_bdev() wants mode arg */ +/* #undef HAVE_MODE_LOOKUP_BDEV */ + +/* Define if host toolchain supports MOVBE */ +#define HAVE_MOVBE 1 + +/* new_sync_read()/new_sync_write() are available */ +/* #undef HAVE_NEW_SYNC_READ */ + +/* iops->getattr() takes a path */ +/* #undef HAVE_PATH_IOPS_GETATTR */ + +/* Define if host toolchain supports PCLMULQDQ */ +#define HAVE_PCLMULQDQ 1 + +/* percpu_counter_add_batch() is defined */ +/* #undef HAVE_PERCPU_COUNTER_ADD_BATCH */ + +/* percpu_counter_init() wants gfp_t */ +/* #undef HAVE_PERCPU_COUNTER_INIT_WITH_GFP */ + +/* posix_acl_chmod() exists */ +/* #undef HAVE_POSIX_ACL_CHMOD */ + +/* posix_acl_from_xattr() needs user_ns */ +/* #undef HAVE_POSIX_ACL_FROM_XATTR_USERNS */ + +/* posix_acl_release() is available */ +/* #undef HAVE_POSIX_ACL_RELEASE */ + +/* posix_acl_release() is GPL-only */ +/* #undef HAVE_POSIX_ACL_RELEASE_GPL_ONLY */ + +/* posix_acl_valid() wants user namespace */ +/* #undef HAVE_POSIX_ACL_VALID_WITH_NS */ + +/* proc_ops structure exists */ +/* #undef HAVE_PROC_OPS_STRUCT */ + +/* iops->put_link() cookie */ +/* #undef HAVE_PUT_LINK_COOKIE */ + +/* iops->put_link() delayed */ +/* #undef HAVE_PUT_LINK_DELAYED */ + +/* iops->put_link() nameidata */ +/* #undef HAVE_PUT_LINK_NAMEIDATA */ + +/* If available, contains the Python version number currently in use. */ +#define HAVE_PYTHON "3.7" + +/* qat is enabled and existed */ +/* #undef HAVE_QAT */ + +/* iops->rename() wants flags */ +/* #undef HAVE_RENAME_WANTS_FLAGS */ + +/* REQ_DISCARD is defined */ +/* #undef HAVE_REQ_DISCARD */ + +/* REQ_FLUSH is defined */ +/* #undef HAVE_REQ_FLUSH */ + +/* REQ_OP_DISCARD is defined */ +/* #undef HAVE_REQ_OP_DISCARD */ + +/* REQ_OP_FLUSH is defined */ +/* #undef HAVE_REQ_OP_FLUSH */ + +/* REQ_OP_SECURE_ERASE is defined */ +/* #undef HAVE_REQ_OP_SECURE_ERASE */ + +/* REQ_PREFLUSH is defined */ +/* #undef HAVE_REQ_PREFLUSH */ + +/* revalidate_disk() is available */ +/* #undef HAVE_REVALIDATE_DISK */ + +/* revalidate_disk_size() is available */ +/* #undef HAVE_REVALIDATE_DISK_SIZE */ + +/* struct rw_semaphore has member activity */ +/* #undef HAVE_RWSEM_ACTIVITY */ + +/* struct rw_semaphore has atomic_long_t member count */ +/* #undef HAVE_RWSEM_ATOMIC_LONG_COUNT */ + +/* linux/sched/signal.h exists */ +/* #undef HAVE_SCHED_SIGNAL_HEADER */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SECURITY_PAM_MODULES_H 1 + +/* setattr_prepare() is available, doesn't accept user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_NO_USERNS */ + +/* setattr_prepare() accepts user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_USERNS */ + +/* iops->set_acl() exists, takes 3 args */ +/* #undef HAVE_SET_ACL */ + +/* iops->set_acl() takes 4 args */ +/* #undef HAVE_SET_ACL_USERNS */ + +/* set_cached_acl() is usable */ +/* #undef HAVE_SET_CACHED_ACL_USABLE */ + +/* set_special_state() exists */ +/* #undef HAVE_SET_SPECIAL_STATE */ + +/* struct shrink_control exists */ +/* #undef HAVE_SHRINK_CONTROL_STRUCT */ + +/* kernel_siginfo_t exists */ +/* #undef HAVE_SIGINFO */ + +/* signal_stop() exists */ +/* #undef HAVE_SIGNAL_STOP */ + +/* new shrinker callback wants 2 args */ +/* #undef HAVE_SINGLE_SHRINKER_CALLBACK */ + +/* ->count_objects exists */ +/* #undef HAVE_SPLIT_SHRINKER_CALLBACK */ + +#if defined(__amd64__) || defined(__i386__) +/* Define if host toolchain supports SSE */ +#define HAVE_SSE 1 + +/* Define if host toolchain supports SSE2 */ +#define HAVE_SSE2 1 + +/* Define if host toolchain supports SSE3 */ +#define HAVE_SSE3 1 + +/* Define if host toolchain supports SSE4.1 */ +#define HAVE_SSE4_1 1 + +/* Define if host toolchain supports SSE4.2 */ +#define HAVE_SSE4_2 1 + +/* Define if host toolchain supports SSSE3 */ +#define HAVE_SSSE3 1 +#endif + +/* STACK_FRAME_NON_STANDARD is defined */ +/* #undef HAVE_STACK_FRAME_NON_STANDARD */ + ++/* standalone exists */ ++/* #undef HAVE_STANDALONE_LINUX_STDARG */ ++ +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlcat' function. */ +#define HAVE_STRLCAT 1 + +/* Define to 1 if you have the `strlcpy' function. */ +#define HAVE_STRLCPY 1 + +/* submit_bio is member of struct block_device_operations */ +/* #undef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */ + +/* super_setup_bdi_name() exits */ +/* #undef HAVE_SUPER_SETUP_BDI_NAME */ + +/* super_block->s_user_ns exists */ +/* #undef HAVE_SUPER_USER_NS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* i_op->tmpfile() exists */ +/* #undef HAVE_TMPFILE */ + *** 237 LINES SKIPPED *** From nobody Thu Oct 21 15:20:35 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6280D17F0CD8; Thu, 21 Oct 2021 15:20: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 4HZrlS0W4wz3CKs; Thu, 21 Oct 2021 15:20:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BEEAF1D825; Thu, 21 Oct 2021 15:20: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 19LFKZo3037261; Thu, 21 Oct 2021 15:20:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19LFKZoh037260; Thu, 21 Oct 2021 15:20:35 GMT (envelope-from git) Date: Thu, 21 Oct 2021 15:20:35 GMT Message-Id: <202110211520.19LFKZoh037260@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: 8cb175ba0c61 - main - Enable stack gap on arm64 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8cb175ba0c61dd8956ae96b8b4f25e494025cc62 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=8cb175ba0c61dd8956ae96b8b4f25e494025cc62 commit 8cb175ba0c61dd8956ae96b8b4f25e494025cc62 Author: Dawid Gorecki AuthorDate: 2021-10-21 15:18:46 +0000 Commit: Marcin Wojtas CommitDate: 2021-10-21 15:20:08 +0000 Enable stack gap on arm64 Stack gap code used on amd64 can also be reused for arm64. Point sv_stackgap to elf64_stackgap to enable this feature. Reviewed by: mw, kib, emaste Tested by: mw MFC: after 1 month Differential Revision: https://reviews.freebsd.org/D32588 --- sys/arm64/arm64/elf_machdep.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/arm64/arm64/elf_machdep.c b/sys/arm64/arm64/elf_machdep.c index eafaf4150dff..bb9e7e8fee4c 100644 --- a/sys/arm64/arm64/elf_machdep.c +++ b/sys/arm64/arm64/elf_machdep.c @@ -93,6 +93,7 @@ static struct sysentvec elf64_freebsd_sysvec = { .sv_schedtail = NULL, .sv_thread_detach = NULL, .sv_trap = NULL, + .sv_stackgap = elf64_stackgap, .sv_hwcap = &elf_hwcap, .sv_hwcap2 = &elf_hwcap2, .sv_onexec_old = exec_onexec_old, From nobody Thu Oct 21 16:31:07 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F1363181ED46; Thu, 21 Oct 2021 16:31: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 4HZtJq6YBpz4VvR; Thu, 21 Oct 2021 16:31: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 C18261E674; Thu, 21 Oct 2021 16:31: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 19LGV7CF038164; Thu, 21 Oct 2021 16:31:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19LGV7Mk038163; Thu, 21 Oct 2021 16:31:07 GMT (envelope-from git) Date: Thu, 21 Oct 2021 16:31:07 GMT Message-Id: <202110211631.19LGV7Mk038163@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: f1f7f31366e5 - main - cmp: initialize limit to avoid stack garbage limits List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: f1f7f31366e5830f4f5b96c6394a0b91475744f4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=f1f7f31366e5830f4f5b96c6394a0b91475744f4 commit f1f7f31366e5830f4f5b96c6394a0b91475744f4 Author: Kyle Evans AuthorDate: 2021-10-21 16:30:55 +0000 Commit: Kyle Evans CommitDate: 2021-10-21 16:30:55 +0000 cmp: initialize limit to avoid stack garbage limits Pointy hat: kevans Fixes: 4e380e847460 ("cmp: add -n, --bytes to limit number of bytes [...]") Sponsored by: Klara, Inc. --- usr.bin/cmp/cmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/cmp/cmp.c b/usr.bin/cmp/cmp.c index 98ae96c73375..83ea7ae7eee0 100644 --- a/usr.bin/cmp/cmp.c +++ b/usr.bin/cmp/cmp.c @@ -105,7 +105,7 @@ main(int argc, char *argv[]) bool special; const char *file1, *file2; - skip1 = skip2 = 0; + limit = skip1 = skip2 = 0; oflag = O_RDONLY; while ((ch = getopt_long(argc, argv, "+bhi:ln:sxz", long_opts, NULL)) != -1) switch (ch) { From nobody Thu Oct 21 17:03:05 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 15BF3180456A; Thu, 21 Oct 2021 17:03:16 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HZv1v584qz4fpk; Thu, 21 Oct 2021 17:03:15 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 19LH365e010537 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 21 Oct 2021 10:03:07 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 19LH35S2010536; Thu, 21 Oct 2021 10:03:05 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Thu, 21 Oct 2021 10:03:05 -0700 From: Gleb Smirnoff To: Slawa Olhovchenkov Cc: Emmanuel Vadot , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> <20211021080214.GB77338@zxy.spb.ru> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211021080214.GB77338@zxy.spb.ru> X-Rspamd-Queue-Id: 4HZv1v584qz4fpk X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Thu, Oct 21, 2021 at 11:02:14AM +0300, Slawa Olhovchenkov wrote: S> > laptops. If somebody is using vt(4) instead of X on a laptop, then S> S> This change disable bell in X11 too. S> This is completly disable speaker bell. Are you sure? I haven't yet upgraded my desktop to this point, so can't test. How is that possible that vt(4) affects X11? -- Gleb Smirnoff From nobody Thu Oct 21 17:08:54 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E989F180A956; Thu, 21 Oct 2021 17:08: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 4HZv8Q5X8qz4jvY; Thu, 21 Oct 2021 17:08: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 7B7F61F20F; Thu, 21 Oct 2021 17:08: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 19LH8sG6080997; Thu, 21 Oct 2021 17:08:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19LH8sDX080996; Thu, 21 Oct 2021 17:08:54 GMT (envelope-from git) Date: Thu, 21 Oct 2021 17:08:54 GMT Message-Id: <202110211708.19LH8sDX080996@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: c57dbec69a6c - main - ktls: Add a routine to query information in a receive socket buffer. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: c57dbec69a6cb20098b691b9cd5246f390d83e80 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c57dbec69a6cb20098b691b9cd5246f390d83e80 commit c57dbec69a6cb20098b691b9cd5246f390d83e80 Author: John Baldwin AuthorDate: 2021-10-21 16:36:29 +0000 Commit: John Baldwin CommitDate: 2021-10-21 16:36:29 +0000 ktls: Add a routine to query information in a receive socket buffer. In particular, ktls_pending_rx_info() determines which TLS record is at the end of the current receive socket buffer (including not-yet-decrypted data) along with how much data in that TLS record is not yet present in the socket buffer. This is useful for future changes to support NIC TLS receive offload and enhancements to TOE TLS receive offload. Those use cases need a way to synchronize a state machine on the NIC with the TLS record boundaries in the TCP stream. Reviewed by: gallatin, hselasky Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32564 --- sys/kern/uipc_ktls.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ sys/sys/ktls.h | 1 + 2 files changed, 64 insertions(+) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 1d3321fd4ff6..eb1f8dec8c1e 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -1082,6 +1082,69 @@ sb_mark_notready(struct sockbuf *sb) sb->sb_ccc)); } +/* + * Return information about the pending TLS data in a socket + * buffer. On return, 'seqno' is set to the sequence number + * of the next TLS record to be received, 'resid' is set to + * the amount of bytes still needed for the last pending + * record. The function returns 'false' if the last pending + * record contains a partial TLS header. In that case, 'resid' + * is the number of bytes needed to complete the TLS header. + */ +bool +ktls_pending_rx_info(struct sockbuf *sb, uint64_t *seqnop, size_t *residp) +{ + struct tls_record_layer hdr; + struct mbuf *m; + uint64_t seqno; + size_t resid; + u_int offset, record_len; + + SOCKBUF_LOCK_ASSERT(sb); + MPASS(sb->sb_flags & SB_TLS_RX); + seqno = sb->sb_tls_seqno; + resid = sb->sb_tlscc; + m = sb->sb_mtls; + offset = 0; + + if (resid == 0) { + *seqnop = seqno; + *residp = 0; + return (true); + } + + for (;;) { + seqno++; + + if (resid < sizeof(hdr)) { + *seqnop = seqno; + *residp = sizeof(hdr) - resid; + return (false); + } + + m_copydata(m, offset, sizeof(hdr), (void *)&hdr); + + record_len = sizeof(hdr) + ntohs(hdr.tls_length); + if (resid <= record_len) { + *seqnop = seqno; + *residp = record_len - resid; + return (true); + } + resid -= record_len; + + while (record_len != 0) { + if (m->m_len - offset > record_len) { + offset += record_len; + break; + } + + record_len -= (m->m_len - offset); + offset = 0; + m = m->m_next; + } + } +} + int ktls_enable_rx(struct socket *so, struct tls_enable *en) { diff --git a/sys/sys/ktls.h b/sys/sys/ktls.h index cd0a786bb345..4258d2c342dc 100644 --- a/sys/sys/ktls.h +++ b/sys/sys/ktls.h @@ -224,6 +224,7 @@ int ktls_output_eagain(struct inpcb *inp, struct ktls_session *tls); #ifdef RATELIMIT int ktls_modify_txrtlmt(struct ktls_session *tls, uint64_t max_pacing_rate); #endif +bool ktls_pending_rx_info(struct sockbuf *sb, uint64_t *seqnop, size_t *residp); static inline struct ktls_session * ktls_hold(struct ktls_session *tls) From nobody Thu Oct 21 17:08:55 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9F6BE180A95F; Thu, 21 Oct 2021 17:08: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 4HZv8S1HQHz4jkC; Thu, 21 Oct 2021 17:08: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 B6EFD1F211; Thu, 21 Oct 2021 17:08: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 19LH8thb081021; Thu, 21 Oct 2021 17:08:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19LH8t0R081020; Thu, 21 Oct 2021 17:08:55 GMT (envelope-from git) Date: Thu, 21 Oct 2021 17:08:55 GMT Message-Id: <202110211708.19LH8t0R081020@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: b33ff94123a6 - main - ktls: Change struct ktls_session.cipher to an OCF-specific type. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: b33ff94123a666d0f38541f97f1c64c512f90a56 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b33ff94123a666d0f38541f97f1c64c512f90a56 commit b33ff94123a666d0f38541f97f1c64c512f90a56 Author: John Baldwin AuthorDate: 2021-10-21 16:36:53 +0000 Commit: John Baldwin CommitDate: 2021-10-21 16:36:53 +0000 ktls: Change struct ktls_session.cipher to an OCF-specific type. As a followup to SW KTLS assuming an OCF backend, rename struct ocf_session to struct ktls_ocf_session and forward declare it in to use as the type of struct ktls_session.cipher. Reviewed by: gallatin, hselasky Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32565 --- sys/opencrypto/ktls_ocf.c | 30 +++++++++++++++--------------- sys/sys/ktls.h | 3 ++- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/sys/opencrypto/ktls_ocf.c b/sys/opencrypto/ktls_ocf.c index a3b9ab49e4f0..0753f4bafb1a 100644 --- a/sys/opencrypto/ktls_ocf.c +++ b/sys/opencrypto/ktls_ocf.c @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include -struct ocf_session { +struct ktls_ocf_session { crypto_session_t sid; crypto_session_t mac_sid; struct mtx lock; @@ -64,7 +64,7 @@ struct ocf_session { }; struct ocf_operation { - struct ocf_session *os; + struct ktls_ocf_session *os; bool done; }; @@ -142,7 +142,7 @@ ktls_ocf_callback_async(struct cryptop *crp) } static int -ktls_ocf_dispatch(struct ocf_session *os, struct cryptop *crp) +ktls_ocf_dispatch(struct ktls_ocf_session *os, struct cryptop *crp) { struct ocf_operation oo; int error; @@ -228,7 +228,7 @@ ktls_ocf_tls_cbc_encrypt(struct ktls_ocf_encrypt_state *state, struct uio *uio; struct tls_mac_data *ad; struct cryptop *crp; - struct ocf_session *os; + struct ktls_ocf_session *os; struct iovec iov[m->m_epg_npgs + 2]; u_int pgoff; int i, error; @@ -237,7 +237,7 @@ ktls_ocf_tls_cbc_encrypt(struct ktls_ocf_encrypt_state *state, MPASS(outiovcnt + 1 <= nitems(iov)); - os = tls->cipher; + os = tls->ocf_session; hdr = (const struct tls_record_layer *)m->m_epg_hdr; crp = &state->crp; uio = &state->uio; @@ -376,11 +376,11 @@ ktls_ocf_tls12_aead_encrypt(struct ktls_ocf_encrypt_state *state, struct uio *uio; struct tls_aead_data *ad; struct cryptop *crp; - struct ocf_session *os; + struct ktls_ocf_session *os; int error; uint16_t tls_comp_len; - os = tls->cipher; + os = tls->ocf_session; hdr = (const struct tls_record_layer *)m->m_epg_hdr; crp = &state->crp; uio = &state->uio; @@ -457,12 +457,12 @@ ktls_ocf_tls12_aead_decrypt(struct ktls_session *tls, { struct tls_aead_data ad; struct cryptop crp; - struct ocf_session *os; + struct ktls_ocf_session *os; struct ocf_operation oo; int error; uint16_t tls_comp_len; - os = tls->cipher; + os = tls->ocf_session; oo.os = os; oo.done = false; @@ -526,11 +526,11 @@ ktls_ocf_tls13_aead_encrypt(struct ktls_ocf_encrypt_state *state, struct uio *uio; struct tls_aead_data_13 *ad; struct cryptop *crp; - struct ocf_session *os; + struct ktls_ocf_session *os; char nonce[12]; int error; - os = tls->cipher; + os = tls->ocf_session; hdr = (const struct tls_record_layer *)m->m_epg_hdr; crp = &state->crp; uio = &state->uio; @@ -598,9 +598,9 @@ ktls_ocf_tls13_aead_encrypt(struct ktls_ocf_encrypt_state *state, void ktls_ocf_free(struct ktls_session *tls) { - struct ocf_session *os; + struct ktls_ocf_session *os; - os = tls->cipher; + os = tls->ocf_session; crypto_freesession(os->sid); mtx_destroy(&os->lock); zfree(os, M_KTLS_OCF); @@ -610,7 +610,7 @@ int ktls_ocf_try(struct socket *so, struct ktls_session *tls, int direction) { struct crypto_session_params csp, mac_csp; - struct ocf_session *os; + struct ktls_ocf_session *os; int error, mac_len; memset(&csp, 0, sizeof(csp)); @@ -745,7 +745,7 @@ ktls_ocf_try(struct socket *so, struct ktls_session *tls, int direction) } mtx_init(&os->lock, "ktls_ocf", NULL, MTX_DEF); - tls->cipher = os; + tls->ocf_session = os; if (tls->params.cipher_algorithm == CRYPTO_AES_NIST_GCM_16 || tls->params.cipher_algorithm == CRYPTO_CHACHA20_POLY1305) { if (direction == KTLS_TX) { diff --git a/sys/sys/ktls.h b/sys/sys/ktls.h index 4258d2c342dc..aea13d2d8ce1 100644 --- a/sys/sys/ktls.h +++ b/sys/sys/ktls.h @@ -167,6 +167,7 @@ struct tls_session_params { #define KTLS_RX 2 struct iovec; +struct ktls_ocf_session; struct ktls_ocf_encrypt_state; struct ktls_session; struct m_snd_tag; @@ -184,7 +185,7 @@ struct ktls_session { uint64_t seqno, int *trailer_len); }; union { - void *cipher; + struct ktls_ocf_session *ocf_session; struct m_snd_tag *snd_tag; }; struct tls_session_params params; From nobody Thu Oct 21 17:08:56 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0BD73180A9C2; Thu, 21 Oct 2021 17:08: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 4HZv8T313Bz4jxs; Thu, 21 Oct 2021 17:08: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 CD6451ED79; Thu, 21 Oct 2021 17:08: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 19LH8u4w081045; Thu, 21 Oct 2021 17:08:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19LH8ukn081044; Thu, 21 Oct 2021 17:08:56 GMT (envelope-from git) Date: Thu, 21 Oct 2021 17:08:56 GMT Message-Id: <202110211708.19LH8ukn081044@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: 96668a81aef7 - main - ktls: Always create a software backend for receive sessions. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 96668a81aef7e9be74386820f1583961eee43ea6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=96668a81aef7e9be74386820f1583961eee43ea6 commit 96668a81aef7e9be74386820f1583961eee43ea6 Author: John Baldwin AuthorDate: 2021-10-21 16:37:17 +0000 Commit: John Baldwin CommitDate: 2021-10-21 16:37:17 +0000 ktls: Always create a software backend for receive sessions. A future change to TOE TLS will require a software fallback for the first few TLS records received. Future support for NIC TLS on receive will also require a software fallback for certain cases. Reviewed by: gallatin, hselasky Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32566 --- sys/kern/uipc_ktls.c | 36 ++++++++++++++++++++++-------------- sys/sys/ktls.h | 6 ++---- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index eb1f8dec8c1e..f97bf9d1117f 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -784,7 +784,6 @@ ktls_cleanup(struct ktls_session *tls) counter_u64_add(ktls_sw_chacha20, -1); break; } - ktls_ocf_free(tls); break; case TCP_TLS_MODE_IFNET: switch (tls->params.cipher_algorithm) { @@ -817,6 +816,8 @@ ktls_cleanup(struct ktls_session *tls) break; #endif } + if (tls->ocf_session != NULL) + ktls_ocf_free(tls); if (tls->params.auth_key != NULL) { zfree(tls->params.auth_key, M_KTLS); tls->params.auth_key = NULL; @@ -1004,14 +1005,9 @@ ktls_try_ifnet(struct socket *so, struct ktls_session *tls, bool force) return (error); } -static int -ktls_try_sw(struct socket *so, struct ktls_session *tls, int direction) +static void +ktls_use_sw(struct ktls_session *tls) { - int error; - - error = ktls_ocf_try(so, tls, direction); - if (error) - return (error); tls->mode = TCP_TLS_MODE_SW; switch (tls->params.cipher_algorithm) { case CRYPTO_AES_CBC: @@ -1024,6 +1020,17 @@ ktls_try_sw(struct socket *so, struct ktls_session *tls, int direction) counter_u64_add(ktls_sw_chacha20, 1); break; } +} + +static int +ktls_try_sw(struct socket *so, struct ktls_session *tls, int direction) +{ + int error; + + error = ktls_ocf_try(so, tls, direction); + if (error) + return (error); + ktls_use_sw(tls); return (0); } @@ -1184,17 +1191,18 @@ ktls_enable_rx(struct socket *so, struct tls_enable *en) if (error) return (error); -#ifdef TCP_OFFLOAD - error = ktls_try_toe(so, tls, KTLS_RX); - if (error) -#endif - error = ktls_try_sw(so, tls, KTLS_RX); - + error = ktls_ocf_try(so, tls, KTLS_RX); if (error) { ktls_cleanup(tls); return (error); } +#ifdef TCP_OFFLOAD + error = ktls_try_toe(so, tls, KTLS_RX); + if (error) +#endif + ktls_use_sw(tls); + /* Mark the socket as using TLS offload. */ SOCKBUF_LOCK(&so->so_rcv); so->so_rcv.sb_tls_seqno = be64dec(en->rec_seq); diff --git a/sys/sys/ktls.h b/sys/sys/ktls.h index aea13d2d8ce1..a3eac69b5eeb 100644 --- a/sys/sys/ktls.h +++ b/sys/sys/ktls.h @@ -184,10 +184,8 @@ struct ktls_session { const struct tls_record_layer *hdr, struct mbuf *m, uint64_t seqno, int *trailer_len); }; - union { - struct ktls_ocf_session *ocf_session; - struct m_snd_tag *snd_tag; - }; + struct ktls_ocf_session *ocf_session; + struct m_snd_tag *snd_tag; struct tls_session_params params; u_int wq_index; volatile u_int refcount; From nobody Thu Oct 21 17:10:18 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 51388180DB1A; Thu, 21 Oct 2021 17:10:24 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HZvB75754z4l8d; Thu, 21 Oct 2021 17:10:23 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 19LHAIug010675 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 21 Oct 2021 10:10:18 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 19LHAIVd010674; Thu, 21 Oct 2021 10:10:18 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Thu, 21 Oct 2021 10:10:18 -0700 From: Gleb Smirnoff To: Emmanuel Vadot Cc: Slawa Olhovchenkov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> <20211021094000.58097dbece05fcd445aa3d87@bidouilliste.com> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211021094000.58097dbece05fcd445aa3d87@bidouilliste.com> X-Rspamd-Queue-Id: 4HZvB75754z4l8d X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Thu, Oct 21, 2021 at 09:40:00AM +0200, Emmanuel Vadot wrote: E> > E> sane default that most users agrees on in base FreeBSD. If you don't E> > E> agree with the defaults we have a way to change them. E> > E> > To me this looks like abuse of committer priveleges. I got commit bit, E> > so I can change the defaults. E> E> Oh common ... This is not the answer I'd like to hear. :( I'd rather hear why your opinion matters more than for example Slawa's. E> Except that FreeBSD doesn't include drm drivers or graphical env by E> default so the first thing that a user (new or not) have to deal with E> is vt(4). So they will login, do a bunch of command to configure the E> machine and will probably use tab for completion, and what will they E> hear when multiple commands are possible ? The bell. What will they E> hear if they try to go left or right in the shell and arrive at one of E> the ends ? The bell. And they will hear it in a bunch of other E> situation. So the problem is that we are forcing people to go through painful graphics setup, rather than in the bell. E> Again it's clearly user preference and as you can see I really hate E> this bell. I'm sure that more people than the one who answered this E> commit like the bell but the question is do more people wants it on be E> default or not ? E> The non-scientific method that is twitter seems to agree with me E> (https://twitter.com/FreeBSDHelp/status/1450955125002887170). E> So, do we really want to make a poll so users can vote on what to do E> with a freaking bell ??? Well, if you put it like that, I can compose a 100% symmetrical answer: As you see I really LOVE the bell. And I'm looking forward to upgrade my desktop past your commit and expecting my BELOVED bell to be turned off. Just like you, I hate idea of tweaking configuration, I want it ON by default as it used to be from the beginning of times. Unlike Slawa, I got commit bit, so I can go and turn it back on. So, yeah, looks like creating a poll about a precious bell could be a solution of this dispute. -- Gleb Smirnoff From nobody Thu Oct 21 17:16:23 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8D7021812383 for ; Thu, 21 Oct 2021 17:16:37 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound5c.ore.mailhop.org (outbound5c.ore.mailhop.org [54.244.192.240]) (using TLSv1.3 with cipher TLS_AES_256_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 4HZvKJ113Qz4sPG for ; Thu, 21 Oct 2021 17:16:35 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1634836589; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=QQTJo8aIpalQhSXqU642oBFeMbU+/MrZuPmYpyYW7T5hioSq9e1nSDXuRi3W/m5FfD3aCUvqtPZX3 wUEVD4vWKQoOm9H5gNudSli8nwwi6zSeu/E1jPcB9+19QTfQvRCaR7wglv4FNbMm2npcP+I0k4s6kG DBGo6O4iBAUvagJchJqfZAbTovNaSQr9j402apOXZ6renKOO6Q54r+r+A+Sw046gYBlvXl+C+oC3tV e8mnMcMJTZiBnMuWCI3e7ufqbfEmvqoVNLUXjTJt+AgoicGSqaJCQ4TNhEuECILLGK2j5bm7zh3mJg 7+gvqy9Te6piIbdyFIQ+TenSuq1uW8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=vU7aKlrLSvToiOF+SnfI/O+VbzkbkF/JstCSuvYTwv8=; b=e03zGjhUDIGqPP5Qv/yo6ObNYXJ1q7XX9hx2ctwm//tG5xUHd/Yp+6OvO3eQIFrSeypg2RAebNWk0 L1clWH56hhhXCNEJGSnAHCyXndIm7E/NNXYoMMQ91p2llDcD3BarnE9IFDbvL33ML0aE4zzcJQxtdl ceYMUbSolKqZZVA9AexBdlzhOvf/c3SLoYt4SowpN9hoJiyihQMlsyikHisgDGCU+dypFN6glFmK4a F2V6WA1Jr7/4gzG9+KJvbLjvdU52feYnvh+lyPmJCco5Cy1a/46KANTr5YWCXK667lzDHf2xBFNOPv 8VHiFWXJWSjMj0wNtZZAR0dqsVvT1xw== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=24.8.225.114; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=vU7aKlrLSvToiOF+SnfI/O+VbzkbkF/JstCSuvYTwv8=; b=YQOus3qdszRu4W8j+H78NU9Xl9LItSJ1Gz3MsOOs2Ya/6vEWfdZMxOscgHwaTRrsBGy72Vmcw9oYT r/QQ9DMAXF2SGubhHdkiuZYr7lQdhfFaN4B+EeRaJ8MR7c7olTub2ZaaSBRSf6+rbwjNhV5f38PFO6 eGgNBetiqwNfVv+tP1wa7mJfVdLx+lUAgoK48QpaIvoBbdnMDXCMcBWR7PiSApQbZu3ja2BXB3zO4e jb9jmqi7TEFEiYFEnxichUIoxHhb1ye1a2z9LX6umO4j9S3ZNDIO1FLxXbvJAyFLiP1qeb0S4cVJpv wS5OS41gDoDu049W1KbJcqW+ILX8atA== X-Originating-IP: 24.8.225.114 X-MHO-RoutePath: aGlwcGll X-MHO-User: 9e3543af-3292-11ec-9e1e-bf9d68d023b6 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-24-8-225-114.hsd1.co.comcast.net [24.8.225.114]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 9e3543af-3292-11ec-9e1e-bf9d68d023b6; Thu, 21 Oct 2021 17:16:28 +0000 (UTC) Received: from [172.22.42.84] (rev2.hippie.lan [172.22.42.84]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 19LHGNfw079281; Thu, 21 Oct 2021 11:16:23 -0600 (MDT) (envelope-from ian@freebsd.org) X-Authentication-Warning: paranoia.hippie.lan: Host rev2.hippie.lan [172.22.42.84] claimed to be [172.22.42.84] Message-ID: <5df6d661f6bbc4952398a1c6f1f2d6a36fae2cc2.camel@freebsd.org> Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default From: Ian Lepore To: Gleb Smirnoff , Emmanuel Vadot Cc: Slawa Olhovchenkov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Date: Thu, 21 Oct 2021 11:16:23 -0600 In-Reply-To: References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> <20211021094000.58097dbece05fcd445aa3d87@bidouilliste.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.3 FreeBSD GNOME Team List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4HZvKJ113Qz4sPG X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:16509, ipnet:54.244.128.0/17, country:US]; local_wl_from(0.00)[freebsd.org] X-ThisMailContainsUnwantedMimeParts: N On Thu, 2021-10-21 at 10:10 -0700, Gleb Smirnoff wrote: > On Thu, Oct 21, 2021 at 09:40:00AM +0200, Emmanuel Vadot wrote: > E> > E> sane default that most users agrees on in base FreeBSD. If > you don't > E> > E> agree with the defaults we have a way to change them. > E> > > E> > To me this looks like abuse of committer priveleges. I got > commit bit, > E> > so I can change the defaults. > E> > E>  Oh common ... > > This is not the answer I'd like to hear. :( > > I'd rather hear why your opinion matters more than for example > Slawa's. > > E>  Except that FreeBSD doesn't include drm drivers or graphical env > by > E> default so the first thing that a user (new or not) have to deal > with > E> is vt(4). So they will login, do a bunch of command to configure > the > E> machine and will probably use tab for completion, and what will > they > E> hear when multiple commands are possible ? The bell. What will > they > E> hear if they try to go left or right in the shell and arrive at > one of > E> the ends ? The bell. And they will hear it in a bunch of other > E> situation. > > So the problem is that we are forcing people to go through painful > graphics setup, rather than in the bell. > > E>  Again it's clearly user preference and as you can see I really > hate > E> this bell. I'm sure that more people than the one who answered > this > E> commit like the bell but the question is do more people wants it > on be > E> default or not ? > E>  The non-scientific method that is twitter seems to agree with me > E> (https://twitter.com/FreeBSDHelp/status/1450955125002887170). > E>  So, do we really want to make a poll so users can vote on what to > do > E> with a freaking bell ??? > > Well, if you put it like that, I can compose a 100% symmetrical > answer: > > As you see I really LOVE the bell. And I'm looking forward to upgrade > my desktop past your commit and expecting my BELOVED bell to be > turned > off. Just like you, I hate idea of tweaking configuration, I want it > ON > by default as it used to be from the beginning of times. Unlike > Slawa, > I got commit bit, so I can go and turn it back on. > > So, yeah, looks like creating a poll about a precious bell could be a > solution of this dispute. > I can't believe this conversation is still going on. It's not 1983 anymore. We don't use TTY devices that simply stop and overwrite the last position on a line repeatedly if you write too many characters without a return, so we don't need an audible alarm to warn us of that condition. I agree 100% with whoever said earlier something like: POLA cannot be a reason for blocking every change. This change makes sense in the modern world. For the few people (and I'm sure it is a VERY few people) left who like the noise, there is an option to keep hearing it. Can we just move on? -- Ian From nobody Thu Oct 21 17:20:20 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5FADC1813FD7; Thu, 21 Oct 2021 17:20:27 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) (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 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HZvPk064Rz3DJ8; Thu, 21 Oct 2021 17:20:25 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-ed1-x531.google.com with SMTP id w14so3930241edv.11; Thu, 21 Oct 2021 10:20:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=vvKaL823Ach/szHN3EIWTQ+FXeQJXnfZihlB5cTWU7Y=; b=BwuTKb29bFAJ71Md6qOSGrjvGZK5QS+gJEXskWKT2o9MA8db6P81crRh5tvps1bR2/ JQIiHmxwfTA8UqOSKiKJAEuPIdi4ZK6WjyViCvFuYfOHMR7U5qXCB8z9p35QYQHsueBA Dme/AQiW200KGCa9my8PbD4J4bWLhUe39vC1liyza5aphyDVM++v3a4hDkwN/iGGSC9g vNGMye3sIWiqxYIYvskLVsn6m95LXGz0m6D56PLW8NOa5R7UiQjuqyZ4C9MDVZP9FedA 1Fa3w1fIdqqotaXZVRYEcLtKyCizvSHnz3/FSadD9R49MqcBzZzB7bS3ttMnXKPFrUJa gnRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=vvKaL823Ach/szHN3EIWTQ+FXeQJXnfZihlB5cTWU7Y=; b=buLt+c7pUuALwT9J/6XvOfZU8TY3ijvtQHg72UcW55fpMWlERkRn2Us16vbX+Tdh1x TpkaZnHaLzbBS5W8zp4g+uJ/BChsflakCKPrKiOMvliAZAXTtObyWLCsKXqme4/5LMUK 8wPNB5p3yFmHFi7qfw5RO+9ze6SSCmzPxA7C2wjlKDTF9q0f4jZjnuEiVmHH9+MzwqPN rNRDcBa6U+AAeTFfW2SJZmVfgV2CPOHCFGf/gLG12RiLGgq8nEaAA3+DFXwh3EXDMVrd YL9ofi8ki2X1ox1axb6b/vHutcOhjqgOXPoqWsmt8q0p7PfdoRoc8A6Q74EUdJo6p6k9 C+bQ== X-Gm-Message-State: AOAM533DXIJtzopeuAP2PwVfzj2d142GyMtjENxKmR+xd9KsahlBJtpr aULts7fjoAdn1yuUxvDjxyNhXy3x114= X-Google-Smtp-Source: ABdhPJzTZMCqYxA4le4VqA5UmPZp6q7cMRGu/I8CIpELNz7mF3kR/Eq86bEh1mZuhJADlXguJm96iw== X-Received: by 2002:a17:907:da8:: with SMTP id go40mr8829532ejc.240.1634836822652; Thu, 21 Oct 2021 10:20:22 -0700 (PDT) Received: from ernst.home (p5b3becad.dip0.t-ipconnect.de. [91.59.236.173]) by smtp.gmail.com with ESMTPSA id a1sm3152978edu.43.2021.10.21.10.20.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 10:20:22 -0700 (PDT) Date: Thu, 21 Oct 2021 19:20:20 +0200 From: Gary Jennejohn To: Gleb Smirnoff Cc: Slawa Olhovchenkov , Emmanuel Vadot , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: <20211021192020.6dcb95c1@ernst.home> In-Reply-To: References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> <20211021080214.GB77338@zxy.spb.ru> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HZvPk064Rz3DJ8 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Thu, 21 Oct 2021 10:03:05 -0700 Gleb Smirnoff wrote: > On Thu, Oct 21, 2021 at 11:02:14AM +0300, Slawa Olhovchenkov wrote: > S> > laptops. If somebody is using vt(4) instead of X on a laptop, then > S> > S> This change disable bell in X11 too. > S> This is completly disable speaker bell. > > Are you sure? I haven't yet upgraded my desktop to this point, so can't test. > How is that possible that vt(4) affects X11? > He could be right. I don't use vt, but syscons also has a bell setting: sysctl -d hw.syscons.bell hw.syscons.bell: enable bell With this set to 1 a ^G in xterm results in a beep. After setting the sysctl to 0 a ^G in xterm produces no sound at all. -- Gary Jennejohn From nobody Thu Oct 21 17:56:32 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 339451803494; Thu, 21 Oct 2021 17:56:33 +0000 (UTC) (envelope-from jkim@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 4HZwCP0xXmz3PVs; Thu, 21 Oct 2021 17:56:33 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (pool-100-8-53-238.nwrknj.fios.verizon.net [100.8.53.238]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jkim/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id D3BBC2727D; Thu, 21 Oct 2021 17:56:32 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Message-ID: <23455738-85b6-604d-de67-157474811248@FreeBSD.org> Date: Thu, 21 Oct 2021 13:56:32 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Content-Language: en-US To: gljennjohn@gmail.com, Gleb Smirnoff Cc: Slawa Olhovchenkov , Emmanuel Vadot , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> <20211021080214.GB77338@zxy.spb.ru> <20211021192020.6dcb95c1@ernst.home> From: Jung-uk Kim Organization: FreeBSD.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default In-Reply-To: <20211021192020.6dcb95c1@ernst.home> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 21. 10. 21., Gary Jennejohn wrote: > On Thu, 21 Oct 2021 10:03:05 -0700 > Gleb Smirnoff wrote: > >> On Thu, Oct 21, 2021 at 11:02:14AM +0300, Slawa Olhovchenkov wrote: >> S> > laptops. If somebody is using vt(4) instead of X on a laptop, then >> S> >> S> This change disable bell in X11 too. >> S> This is completly disable speaker bell. >> >> Are you sure? I haven't yet upgraded my desktop to this point, so can't test. >> How is that possible that vt(4) affects X11? >> > > He could be right. I don't use vt, but syscons also has a bell setting: > sysctl -d hw.syscons.bell hw.syscons.bell: enable bell > > With this set to 1 a ^G in xterm results in a beep. After setting the > sysctl to 0 a ^G in xterm produces no sound at all. FYI, Xorg server beeps via xf86OSRingBell(), i.e., https://gitlab.freedesktop.org/xorg/xserver/-/blob/master/hw/xfree86/os-support/bsd/bsd_bell.c#L61 IOW, if console cannot beep, xterm does not beep. Jung-uk Kim From nobody Thu Oct 21 18:41:34 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C1B1E18172AD; Thu, 21 Oct 2021 18:41: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 4HZxCL56YBz3s7q; Thu, 21 Oct 2021 18:41: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 8FACB20325; Thu, 21 Oct 2021 18:41: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 19LIfYWt010298; Thu, 21 Oct 2021 18:41:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19LIfYBU010297; Thu, 21 Oct 2021 18:41:34 GMT (envelope-from git) Date: Thu, 21 Oct 2021 18:41:34 GMT Message-Id: <202110211841.19LIfYBU010297@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: 2030ee0e1b17 - main - ufs: remove write-only variables List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 2030ee0e1b17e45a162bba6a636e07886a9eb67c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2030ee0e1b17e45a162bba6a636e07886a9eb67c commit 2030ee0e1b17e45a162bba6a636e07886a9eb67c Author: Konstantin Belousov AuthorDate: 2021-10-20 01:42:31 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-21 18:40:46 +0000 ufs: remove write-only variables Mark variables as __diagused for invariant-only vars Reviewed by: imp, mjg Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32577 --- sys/ufs/ffs/ffs_inode.c | 6 ++---- sys/ufs/ffs/ffs_softdep.c | 12 ++++-------- sys/ufs/ffs/ffs_vfsops.c | 5 ++--- sys/ufs/ffs/ffs_vnops.c | 4 ---- 4 files changed, 8 insertions(+), 19 deletions(-) diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index 17a9dceeb654..4b31b4febcbd 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -244,8 +244,8 @@ ffs_truncate(vp, length, flags, cred) ufs2_daddr_t bn, lbn, lastblock, lastiblock[UFS_NIADDR]; ufs2_daddr_t indir_lbn[UFS_NIADDR], oldblks[UFS_NDADDR + UFS_NIADDR]; ufs2_daddr_t newblks[UFS_NDADDR + UFS_NIADDR]; - ufs2_daddr_t count, blocksreleased = 0, datablocks, blkno; - struct bufobj *bo; + ufs2_daddr_t count, blocksreleased = 0, blkno; + struct bufobj *bo __diagused; struct fs *fs; struct buf *bp; struct ufsmount *ump; @@ -297,10 +297,8 @@ ffs_truncate(vp, length, flags, cred) if (journaltrunc == 0 && DOINGSOFTDEP(vp) && length == 0) softdeptrunc = !softdep_slowdown(vp); extblocks = 0; - datablocks = DIP(ip, i_blocks); if (fs->fs_magic == FS_UFS2_MAGIC && ip->i_din2->di_extsize > 0) { extblocks = btodb(fragroundup(fs, ip->i_din2->di_extsize)); - datablocks -= extblocks; } if ((flags & IO_EXT) && extblocks > 0) { if (length != 0) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index ff55a918ade5..969f7554dd0a 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -5064,7 +5064,7 @@ softdep_setup_create(dp, ip) struct inode *ip; { struct inodedep *inodedep; - struct jaddref *jaddref; + struct jaddref *jaddref __diagused; struct vnode *dvp; KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0, @@ -5205,11 +5205,9 @@ softdep_setup_rmdir(dp, ip) struct inode *dp; struct inode *ip; { - struct vnode *dvp; KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0, ("softdep_setup_rmdir called on non-softdep filesystem")); - dvp = ITOV(dp); ACQUIRE_LOCK(ITOUMP(dp)); (void) inodedep_lookup_ip(ip); (void) inodedep_lookup_ip(dp); @@ -5225,11 +5223,9 @@ softdep_setup_unlink(dp, ip) struct inode *dp; struct inode *ip; { - struct vnode *dvp; KASSERT(MOUNTEDSOFTDEP(ITOVFS(dp)) != 0, ("softdep_setup_unlink called on non-softdep filesystem")); - dvp = ITOV(dp); ACQUIRE_LOCK(ITOUMP(dp)); (void) inodedep_lookup_ip(ip); (void) inodedep_lookup_ip(dp); @@ -6424,7 +6420,7 @@ setup_allocindir_phase2(bp, ip, inodedep, aip, lbn) struct allocindir *aip; /* allocindir allocated by the above routines */ ufs_lbn_t lbn; /* Logical block number for this block. */ { - struct fs *fs; + struct fs *fs __diagused; struct indirdep *indirdep; struct allocindir *oldaip; struct freefrag *freefrag; @@ -10626,7 +10622,7 @@ initiate_write_inodeblock_ufs1(inodedep, bp) #ifdef INVARIANTS ufs_lbn_t prevlbn = 0; #endif - int deplist; + int deplist __diagused; if (inodedep->id_state & IOSTARTED) panic("initiate_write_inodeblock_ufs1: already started"); @@ -10798,7 +10794,7 @@ initiate_write_inodeblock_ufs2(inodedep, bp) #ifdef INVARIANTS ufs_lbn_t prevlbn = 0; #endif - int deplist; + int deplist __diagused; if (inodedep->id_state & IOSTARTED) panic("initiate_write_inodeblock_ufs2: already started"); diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 94afcae05ba6..d1773402002e 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -347,7 +347,8 @@ ffs_mount(struct mount *mp) struct thread *td; struct ufsmount *ump = NULL; struct fs *fs; - int error, error1, flags; + int error, flags; + int error1 __diagused; uint64_t mntorflags, saved_mnt_flag; accmode_t accmode; struct nameidata ndp; @@ -1613,11 +1614,9 @@ ffs_sync_lazy(mp) { struct vnode *mvp, *vp; struct inode *ip; - struct thread *td; int allerror, error; allerror = 0; - td = curthread; if ((mp->mnt_flag & MNT_NOATIME) != 0) { #ifdef QUOTA qsync(mp); diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index a1657db9ece2..24bb39a3d48f 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1399,7 +1399,6 @@ static int ffs_open_ea(struct vnode *vp, struct ucred *cred, struct thread *td) { struct inode *ip; - struct ufs2_dinode *dp; int error; ip = VTOI(vp); @@ -1410,7 +1409,6 @@ ffs_open_ea(struct vnode *vp, struct ucred *cred, struct thread *td) ffs_unlock_ea(vp); return (0); } - dp = ip->i_din2; error = ffs_rdextattr(&ip->i_ea_area, vp, td); if (error) { ffs_unlock_ea(vp); @@ -1994,7 +1992,6 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) struct inode *dp, *ip; ino_t ip_ino; u_int64_t ip_gen; - off_t old_size; int error, vp_locked; dvp = ap->a_dvp; @@ -2031,7 +2028,6 @@ ffs_vput_pair(struct vop_vput_pair_args *ap) VNASSERT(I_ENDOFF(dp) != 0 && I_ENDOFF(dp) < dp->i_size, dvp, ("IN_ENDOFF set but I_ENDOFF() is not")); dp->i_flag &= ~IN_ENDOFF; - old_size = dp->i_size; error = UFS_TRUNCATE(dvp, (off_t)I_ENDOFF(dp), IO_NORMAL | (DOINGASYNC(dvp) ? 0 : IO_SYNC), curthread->td_ucred); if (error != 0 && error != ERELOOKUP) { From nobody Thu Oct 21 18:41:35 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2541A181717A; Thu, 21 Oct 2021 18:41: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 4HZxCM6r7qz3sJr; Thu, 21 Oct 2021 18:41:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B49B12016C; Thu, 21 Oct 2021 18:41: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 19LIfZ1U010328; Thu, 21 Oct 2021 18:41:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19LIfZCD010327; Thu, 21 Oct 2021 18:41:35 GMT (envelope-from git) Date: Thu, 21 Oct 2021 18:41:35 GMT Message-Id: <202110211841.19LIfZCD010327@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: bded8fa3009a - main - umtxq_requeue: remove write-only variable uh2 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: bded8fa3009aa76c4a8255ebe884cff44cc6142c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bded8fa3009aa76c4a8255ebe884cff44cc6142c commit bded8fa3009aa76c4a8255ebe884cff44cc6142c Author: Konstantin Belousov AuthorDate: 2021-10-21 17:10:42 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-21 18:40:46 +0000 umtxq_requeue: remove write-only variable uh2 umtxq_queue_lookup() does not change state. It is redone inside umtxq_insert() later, anyway. Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/kern/kern_umtx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index ea87259161c8..c738cf178866 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -641,7 +641,7 @@ int umtxq_requeue(struct umtx_key *key, int n_wake, struct umtx_key *key2, int n_requeue) { - struct umtxq_queue *uh, *uh2; + struct umtxq_queue *uh; struct umtx_q *uq, *uq_temp; int ret; @@ -649,7 +649,6 @@ umtxq_requeue(struct umtx_key *key, int n_wake, struct umtx_key *key2, UMTXQ_LOCKED_ASSERT(umtxq_getchain(key)); UMTXQ_LOCKED_ASSERT(umtxq_getchain(key2)); uh = umtxq_queue_lookup(key, UMTX_SHARED_QUEUE); - uh2 = umtxq_queue_lookup(key2, UMTX_SHARED_QUEUE); if (uh == NULL) return (0); TAILQ_FOREACH_SAFE(uq, &uh->head, uq_link, uq_temp) { From nobody Thu Oct 21 18:41:36 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 693131817444; Thu, 21 Oct 2021 18:41: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 4HZxCP0870z3sK4; Thu, 21 Oct 2021 18:41: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 D339220526; Thu, 21 Oct 2021 18:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19LIfa0G010352; Thu, 21 Oct 2021 18:41:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19LIfaAJ010351; Thu, 21 Oct 2021 18:41:36 GMT (envelope-from git) Date: Thu, 21 Oct 2021 18:41:36 GMT Message-Id: <202110211841.19LIfaAJ010351@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: 661bd70bd72d - main - DMAR: clean up warnings about write-only variables List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 661bd70bd72d510ad7153df530d55a300046d619 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=661bd70bd72d510ad7153df530d55a300046d619 commit 661bd70bd72d510ad7153df530d55a300046d619 Author: Konstantin Belousov AuthorDate: 2021-10-21 17:23:45 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-21 18:40:46 +0000 DMAR: clean up warnings about write-only variables For some of them, used only when KTR or KMSAN are configured, apply __unused attribute directly. Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/dev/iommu/busdma_iommu.c | 5 +++-- sys/dev/iommu/iommu_gas.c | 4 ++-- sys/x86/iommu/intel_ctx.c | 4 ++-- sys/x86/iommu/intel_drv.c | 2 -- sys/x86/iommu/intel_idpgtbl.c | 3 +-- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/sys/dev/iommu/busdma_iommu.c b/sys/dev/iommu/busdma_iommu.c index 75835d7484e5..d32beee19be7 100644 --- a/sys/dev/iommu/busdma_iommu.c +++ b/sys/dev/iommu/busdma_iommu.c @@ -398,7 +398,8 @@ iommu_bus_dma_tag_set_domain(bus_dma_tag_t dmat) static int iommu_bus_dma_tag_destroy(bus_dma_tag_t dmat1) { - struct bus_dma_tag_iommu *dmat, *dmat_copy, *parent; + struct bus_dma_tag_iommu *dmat, *parent; + struct bus_dma_tag_iommu *dmat_copy __unused; int error; error = 0; @@ -920,7 +921,7 @@ static void iommu_bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map1, bus_dmasync_op_t op) { - struct bus_dmamap_iommu *map; + struct bus_dmamap_iommu *map __unused; map = (struct bus_dmamap_iommu *)map1; kmsan_bus_dmamap_sync(&map->kmsan_mem, op); diff --git a/sys/dev/iommu/iommu_gas.c b/sys/dev/iommu/iommu_gas.c index ae54f41953c8..c4faebec9d08 100644 --- a/sys/dev/iommu/iommu_gas.c +++ b/sys/dev/iommu/iommu_gas.c @@ -354,7 +354,7 @@ iommu_gas_match_one(struct iommu_gas_match_args *a, iommu_gaddr_t beg, static void iommu_gas_match_insert(struct iommu_gas_match_args *a) { - bool found; + bool found __diagused; /* * The prev->end is always aligned on the page size, which @@ -475,7 +475,7 @@ iommu_gas_alloc_region(struct iommu_domain *domain, struct iommu_map_entry *entr u_int flags) { struct iommu_map_entry *next, *prev; - bool found; + bool found __diagused; IOMMU_DOMAIN_ASSERT_LOCKED(domain); diff --git a/sys/x86/iommu/intel_ctx.c b/sys/x86/iommu/intel_ctx.c index dc8ee4e2f9a2..34730306000b 100644 --- a/sys/x86/iommu/intel_ctx.c +++ b/sys/x86/iommu/intel_ctx.c @@ -521,7 +521,7 @@ dmar_get_ctx_for_dev1(struct dmar_unit *dmar, device_t dev, uint16_t rid, { struct dmar_domain *domain, *domain1; struct dmar_ctx *ctx, *ctx1; - struct iommu_unit *unit; + struct iommu_unit *unit __diagused; dmar_ctx_entry_t *ctxp; struct sf_buf *sf; int bus, slot, func, error; @@ -904,7 +904,7 @@ dmar_domain_unload(struct dmar_domain *domain, struct dmar_unit *unit; struct iommu_domain *iodom; struct iommu_map_entry *entry, *entry1; - int error; + int error __diagused; iodom = DOM2IODOM(domain); unit = DOM2DMAR(domain); diff --git a/sys/x86/iommu/intel_drv.c b/sys/x86/iommu/intel_drv.c index a19084eb3e66..0b470d7bbf7a 100644 --- a/sys/x86/iommu/intel_drv.c +++ b/sys/x86/iommu/intel_drv.c @@ -762,7 +762,6 @@ dmar_find_by_scope(int dev_domain, int dev_busno, struct dmar_unit * dmar_find(device_t dev, bool verbose) { - device_t dmar_dev; struct dmar_unit *unit; const char *banner; int i, dev_domain, dev_busno, dev_path_len; @@ -774,7 +773,6 @@ dmar_find(device_t dev, bool verbose) devclass_find("pci")) return (NULL); - dmar_dev = NULL; dev_domain = pci_get_domain(dev); dev_path_len = dmar_dev_depth(dev); ACPI_DMAR_PCI_PATH dev_path[dev_path_len]; diff --git a/sys/x86/iommu/intel_idpgtbl.c b/sys/x86/iommu/intel_idpgtbl.c index 2346640ce015..be421fee7aa9 100644 --- a/sys/x86/iommu/intel_idpgtbl.c +++ b/sys/x86/iommu/intel_idpgtbl.c @@ -425,7 +425,7 @@ domain_map_buf_locked(struct dmar_domain *domain, iommu_gaddr_t base, { dmar_pte_t *pte; struct sf_buf *sf; - iommu_gaddr_t pg_sz, base1, size1; + iommu_gaddr_t pg_sz, base1; vm_pindex_t pi, c, idx, run_sz; int lvl; bool superpage; @@ -433,7 +433,6 @@ domain_map_buf_locked(struct dmar_domain *domain, iommu_gaddr_t base, DMAR_DOMAIN_ASSERT_PGLOCKED(domain); base1 = base; - size1 = size; flags |= IOMMU_PGF_OBJL; TD_PREP_PINNED_ASSERT; From nobody Thu Oct 21 18:41:37 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 23370181751D; Thu, 21 Oct 2021 18:41: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 4HZxCQ2VNZz3sPk; Thu, 21 Oct 2021 18:41: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 0121B203A7; Thu, 21 Oct 2021 18:41: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 19LIfbuF010376; Thu, 21 Oct 2021 18:41:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19LIfbev010375; Thu, 21 Oct 2021 18:41:37 GMT (envelope-from git) Date: Thu, 21 Oct 2021 18:41:37 GMT Message-Id: <202110211841.19LIfbev010375@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: 993446638ce7 - main - alq_open_flags(): mark local td variable as unused List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 993446638ce701109d29c520b85d7ca31b5c5fe8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=993446638ce701109d29c520b85d7ca31b5c5fe8 commit 993446638ce701109d29c520b85d7ca31b5c5fe8 Author: Konstantin Belousov AuthorDate: 2021-10-21 17:39:15 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-21 18:40:46 +0000 alq_open_flags(): mark local td variable as unused It is passed to the NDINIT() macro which ignores the thread argument for some time. Sponsored by: The FreeBSD Foundation --- sys/kern/kern_alq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_alq.c b/sys/kern/kern_alq.c index 6db4ab300828..4b30e519d335 100644 --- a/sys/kern/kern_alq.c +++ b/sys/kern/kern_alq.c @@ -431,7 +431,7 @@ int alq_open_flags(struct alq **alqp, const char *file, struct ucred *cred, int cmode, int size, int flags) { - struct thread *td; + struct thread *td __unused; struct nameidata nd; struct alq *alq; int oflags; From nobody Thu Oct 21 18:41:39 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 96DBC1817259; Thu, 21 Oct 2021 18:41: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 4HZxCS0ffYz3s8M; Thu, 21 Oct 2021 18:41: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 187C1205B1; Thu, 21 Oct 2021 18:41: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 19LIfddO010400; Thu, 21 Oct 2021 18:41:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19LIfdAc010399; Thu, 21 Oct 2021 18:41:39 GMT (envelope-from git) Date: Thu, 21 Oct 2021 18:41:39 GMT Message-Id: <202110211841.19LIfdAc010399@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: 6776747a0e0b - main - subr_firmware.c::unloadentry(): remote write-only variable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 6776747a0e0b1c0e3fb916685ac2180ca4ce2f3d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6776747a0e0b1c0e3fb916685ac2180ca4ce2f3d commit 6776747a0e0b1c0e3fb916685ac2180ca4ce2f3d Author: Konstantin Belousov AuthorDate: 2021-10-21 17:40:24 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-21 18:40:46 +0000 subr_firmware.c::unloadentry(): remote write-only variable The function ignores result returned by linker_release_module(). The FW_UNLOAD flag on the file is cleared, so even on error it would not be tried again. Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/kern/subr_firmware.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/kern/subr_firmware.c b/sys/kern/subr_firmware.c index 0465f2a88483..aafb2a2ba265 100644 --- a/sys/kern/subr_firmware.c +++ b/sys/kern/subr_firmware.c @@ -412,7 +412,6 @@ static void unloadentry(void *unused1, int unused2) { struct priv_fw *fp; - int err; mtx_lock(&firmware_mtx); restart: @@ -434,7 +433,7 @@ restart: * on unload to actually free the entry. */ mtx_unlock(&firmware_mtx); - err = linker_release_module(NULL, NULL, fp->file); + (void)linker_release_module(NULL, NULL, fp->file); mtx_lock(&firmware_mtx); /* From nobody Thu Oct 21 18:41:40 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 713D318173C4; Thu, 21 Oct 2021 18:41: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 4HZxCS5TB7z3sKZ; Thu, 21 Oct 2021 18:41: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 47E50205B2; Thu, 21 Oct 2021 18:41: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 19LIfeZE010424; Thu, 21 Oct 2021 18:41:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19LIfeua010423; Thu, 21 Oct 2021 18:41:40 GMT (envelope-from git) Date: Thu, 21 Oct 2021 18:41:40 GMT Message-Id: <202110211841.19LIfeua010423@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: 3d2778515aa4 - main - sig_ast_checksusp(): mark the local p as __diagused List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 3d2778515aa4748f5d561a282d44c7a8c8acfe35 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3d2778515aa4748f5d561a282d44c7a8c8acfe35 commit 3d2778515aa4748f5d561a282d44c7a8c8acfe35 Author: Konstantin Belousov AuthorDate: 2021-10-21 17:43:32 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-21 18:40:46 +0000 sig_ast_checksusp(): mark the local p as __diagused It is only used to assert that the (current) process is locked Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/kern/kern_sig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index d6826e8dc507..15d509eca52d 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -3262,7 +3262,7 @@ postsig(int sig) int sig_ast_checksusp(struct thread *td) { - struct proc *p; + struct proc *p __diagused; int ret; p = td->td_proc; From nobody Thu Oct 21 18:41:41 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BD6E518174E3; Thu, 21 Oct 2021 18:41: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 4HZxCV6bYvz3sFq; Thu, 21 Oct 2021 18:41: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 5D31620256; Thu, 21 Oct 2021 18:41: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 19LIfffP010448; Thu, 21 Oct 2021 18:41:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19LIffSI010447; Thu, 21 Oct 2021 18:41:41 GMT (envelope-from git) Date: Thu, 21 Oct 2021 18:41:41 GMT Message-Id: <202110211841.19LIffSI010447@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: 3b5331dd8d41 - main - uipc_shm: silent warnings about write-only variables in largepage code List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 3b5331dd8d413807cf1d6cb26630ccf9028168e6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3b5331dd8d413807cf1d6cb26630ccf9028168e6 commit 3b5331dd8d413807cf1d6cb26630ccf9028168e6 Author: Konstantin Belousov AuthorDate: 2021-10-21 17:46:36 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-21 18:40:46 +0000 uipc_shm: silent warnings about write-only variables in largepage code In shm_largepage_phys_populate(), the result from vm_page_grab() is only needed for assertion. In shm_dotruncate_largepage(), there is a commented-out prototype code for managed largepages. The oldobjsz is saved for its sake, so mark the variable as __unused directly. Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/kern/uipc_shm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index 14d808bfc166..6fb083498e18 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -267,7 +267,7 @@ static int shm_largepage_phys_populate(vm_object_t object, vm_pindex_t pidx, int fault_type, vm_prot_t max_prot, vm_pindex_t *first, vm_pindex_t *last) { - vm_page_t m; + vm_page_t m __diagused; int psind; psind = object->un_pager.phys.data_val; @@ -751,7 +751,8 @@ shm_dotruncate_largepage(struct shmfd *shmfd, off_t length, void *rl_cookie) { vm_object_t object; vm_page_t m; - vm_pindex_t newobjsz, oldobjsz; + vm_pindex_t newobjsz; + vm_pindex_t oldobjsz __unused; int aflags, error, i, psind, try; KASSERT(length >= 0, ("shm_dotruncate: length < 0")); From nobody Thu Oct 21 18:58:31 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A68CD17F1473; Thu, 21 Oct 2021 18:59:17 +0000 (UTC) (envelope-from wulf@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 4HZxbn3WmCz4Wtd; Thu, 21 Oct 2021 18:59:17 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from [192.168.0.30] (unknown [176.120.247.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: wulf) by smtp.freebsd.org (Postfix) with ESMTPSA id 693FB2857D; Thu, 21 Oct 2021 18:59:16 +0000 (UTC) (envelope-from wulf@FreeBSD.org) To: Gleb Smirnoff , Slawa Olhovchenkov Cc: Emmanuel Vadot , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> <20211021080214.GB77338@zxy.spb.ru> From: Vladimir Kondratyev Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: <99e7aecf-9ab7-8b8f-ff30-b5fce3e031c2@FreeBSD.org> Date: Thu, 21 Oct 2021 21:58:31 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-ThisMailContainsUnwantedMimeParts: N On 21.10.2021 20:03, Gleb Smirnoff wrote: > On Thu, Oct 21, 2021 at 11:02:14AM +0300, Slawa Olhovchenkov wrote: > S> > laptops. If somebody is using vt(4) instead of X on a laptop, then= > S>=20 > S> This change disable bell in X11 too. > S> This is completly disable speaker bell. > > Are you sure? I haven't yet upgraded my desktop to this point, so can't= test. > How is that possible that vt(4) affects X11? > pre-evdev X11 got keyboard input from tty subsystem and post-evdev X11 still affected by it. We have local X11 patch which disables bell on ttyv8, otherwise you'll hear annoying sound as soon as tty buffer get filled up. But you have to have custom X11 build to hear bell under X11 --=20 WBR Vladimir Kondratyev From nobody Thu Oct 21 19:24:09 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B438918044A2; Thu, 21 Oct 2021 19:24: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 4HZy8T4jPpz4fqn; Thu, 21 Oct 2021 19:24: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 812D320AE1; Thu, 21 Oct 2021 19:24: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 19LJO9UE066276; Thu, 21 Oct 2021 19:24:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19LJO9j5066275; Thu, 21 Oct 2021 19:24:09 GMT (envelope-from git) Date: Thu, 21 Oct 2021 19:24:09 GMT Message-Id: <202110211924.19LJO9j5066275@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Guangyuan Yang Subject: git: d677560dd071 - main - arswitch(4): Hook new manpage to build List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ygy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d677560dd0711d49ab00c6c54a017cca581e15c0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ygy (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=d677560dd0711d49ab00c6c54a017cca581e15c0 commit d677560dd0711d49ab00c6c54a017cca581e15c0 Author: Guangyuan Yang AuthorDate: 2021-10-21 19:22:34 +0000 Commit: Guangyuan Yang CommitDate: 2021-10-21 19:23:48 +0000 arswitch(4): Hook new manpage to build PR: 211668 Fixes: 262717e270c3e8a28fa2937db750ba946be8c836 Reported by: jhb --- share/man/man4/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 421de8728a05..af3ad94c9e2e 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -50,6 +50,7 @@ MAN= aac.4 \ ${_aout.4} \ ${_apic.4} \ arcmsr.4 \ + arswitch.4 \ ${_asmc.4} \ at45d.4 \ ata.4 \ From nobody Thu Oct 21 19:25:26 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9E6321805D5D; Thu, 21 Oct 2021 19:25:38 +0000 (UTC) (envelope-from ygy@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 4HZyBB3nhtz4h0h; Thu, 21 Oct 2021 19:25:38 +0000 (UTC) (envelope-from ygy@freebsd.org) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) (Authenticated sender: ygy) by smtp.freebsd.org (Postfix) with ESMTPSA id 5D35B28A80; Thu, 21 Oct 2021 19:25:38 +0000 (UTC) (envelope-from ygy@freebsd.org) Received: by mail-wm1-f44.google.com with SMTP id y22-20020a1c7d16000000b003231ea3d705so787365wmc.4; Thu, 21 Oct 2021 12:25:38 -0700 (PDT) X-Gm-Message-State: AOAM530Zq6iYRS/p/wFdmNuhDRnjsIJgJg3CImBUBl3jigKmP2XAX6Yj sByzaW9OQkjUA8hLxwE5KOOjVjwCg7+IhToB4k0= X-Google-Smtp-Source: ABdhPJx9yrDNITWKLXty2ZV9utZkKEy01oQxw8tEsvWQwj/JdIlP7pJ9mgDzwibED0Y/23TWZ7H/op/hlbZAwpc+go4= X-Received: by 2002:a1c:2246:: with SMTP id i67mr23922716wmi.72.1634844337211; Thu, 21 Oct 2021 12:25:37 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202110200335.19K3ZdfS070860@gitrepo.freebsd.org> <35663cb8-bddb-e108-48f8-9d09a2b2345d@FreeBSD.org> In-Reply-To: <35663cb8-bddb-e108-48f8-9d09a2b2345d@FreeBSD.org> From: Guangyuan Yang Date: Thu, 21 Oct 2021 15:25:26 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 262717e270c3 - main - arswitch(4): Add new manpage To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-ThisMailContainsUnwantedMimeParts: N John Baldwin =E4=BA=8E2021=E5=B9=B410=E6=9C=8820=E6=97=A5= =E5=91=A8=E4=B8=89 =E4=B8=8A=E5=8D=8811:59=E5=86=99=E9=81=93=EF=BC=9A > > On 10/19/21 8:35 PM, Guangyuan Yang wrote: > > The branch main has been updated by ygy (doc, ports committer): > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D262717e270c3e8a28fa2937d= b750ba946be8c836 > > > > commit 262717e270c3e8a28fa2937db750ba946be8c836 > > Author: Felix Johnson > > AuthorDate: 2021-10-20 03:29:11 +0000 > > Commit: Guangyuan Yang > > CommitDate: 2021-10-20 03:35:04 +0000 > > > > arswitch(4): Add new manpage > > > > PR: 211668 > > Reported by: O. Hartmann > > Reviewed by: adrian, debdrup, imp > > Differential Revision: https://reviews.freebsd.org/D32476 > > --- > > share/man/man4/arswitch.4 | 91 ++++++++++++++++++++++++++++++++++++++= +++++++++ > > 1 file changed, 91 insertions(+) > > Do you need to add this to the Makefile so it is installed? > My bad. Fixed in https://cgit.freebsd.org/src/commit/?id=3Dd677560dd0711d49ab00c6c54a017cca5= 81e15c0. Thank you! --=20 Guangyuan Yang ygy@FreeBSD.org From nobody Thu Oct 21 19:52:26 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0B6721812A16 for ; Thu, 21 Oct 2021 19:52:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ua1-x932.google.com (mail-ua1-x932.google.com [IPv6:2607:f8b0:4864:20::932]) (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 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HZynK5jZjz4pdk for ; Thu, 21 Oct 2021 19:52:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ua1-x932.google.com with SMTP id q13so3477562uaq.2 for ; Thu, 21 Oct 2021 12:52:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:cc; bh=fpUpVpCAFigJqDwO10ruA7OcKTMjgtZ3ChPKm68inbQ=; b=upZmhKQ/SsLIhZNzg2N+e/8LpoNS05O9D8sC1KFPK0OzKUqxO0iQbU+HxajLa/O82P m5mJQE3GLy+AWPMNjuCvyAc1BUwh9FGWA1mnwOiRH/Y6yT9ehiZBgISoLuvt+9bAPAEa k2M9J1PRnRRNtj/82Gp6KN2Yg75hCukQ5mIHpVLH0pMw8/fITk28+HZiOndzlAzZzjyt yOhb8pK5bl0kZvO8SulYA4LCF3BIN096X/9aT4svakV/O9f7wod3CC0ucAnVFhOtH7TX 6LhjbGBQqFZbrY/akQCkVbRwUn352DSHDxdEriAKyFBUFFe4N7HAqhI1DAJvxDHRpOSU 9Q/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:cc; bh=fpUpVpCAFigJqDwO10ruA7OcKTMjgtZ3ChPKm68inbQ=; b=ZwVcyUh6cK4Nw1kden0jNAHsmBPb3wGdgnSIqalAyG4RvERr47hDqJq8fJ59eMxBkC tWy6lreolweBRA0WlEaHjKQdRG3DLE8NbKYO08XjTLH3g3cs5pE9ZIkxn0BrG4bTNR/N OneKxTBmLH2GAq3bRXOkmKCma2sa+59eQ5Ca9+uWBWHU0ovymqw5NNj6POIv45gRrrmV IKzeoGbcf7uSojxAQSwc6NLYQ9rnQulUKPY4bZW+stw1XGtWTb5F5pF8tLP8hJBvQAtp 1z9ok5pWLJeiUzdOC3uGjgx7fqAVghEtIPzm47Uy1F74a2G7iqQF+t4cQPd4aXO05H1s 7XOg== X-Gm-Message-State: AOAM531zUrDEDhcg2N9Wz3UTzfMGY2RaGGowbEIy7rG5fns2n8ZSbLks zXGhElg6PQOKkCh+CMBDpdlRNqpR7ZiTwgKBI1Jw84U3K40= X-Received: by 2002:a9f:2c97:: with SMTP id w23mt4139948uaj.69.1634845957055; Thu, 21 Oct 2021 12:52:37 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> <20211021080214.GB77338@zxy.spb.ru> <99e7aecf-9ab7-8b8f-ff30-b5fce3e031c2@FreeBSD.org> In-Reply-To: <99e7aecf-9ab7-8b8f-ff30-b5fce3e031c2@FreeBSD.org> From: Warner Losh Date: Thu, 21 Oct 2021 13:52:26 -0600 Message-ID: Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="00000000000089c23705cee23c13" X-Rspamd-Queue-Id: 4HZynK5jZjz4pdk X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20210112.gappssmtp.com header.s=20210112 header.b="upZmhKQ/"; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::932) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-0.33 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20210112.gappssmtp.com:s=20210112]; NEURAL_HAM_MEDIUM(-1.00)[-0.998]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; NEURAL_HAM_LONG(-0.33)[-0.331]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20210112.gappssmtp.com:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::932:from]; MISSING_TO(2.00)[]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com] X-ThisMailContainsUnwantedMimeParts: N --00000000000089c23705cee23c13 Content-Type: text/plain; charset="UTF-8" This discussion to date has been data free. I created a poll... https://twitter.com/bsdimp/status/1451274644439265308 On Thu, Oct 21, 2021 at 12:59 PM Vladimir Kondratyev wrote: > On 21.10.2021 20:03, Gleb Smirnoff wrote: > > On Thu, Oct 21, 2021 at 11:02:14AM +0300, Slawa Olhovchenkov wrote: > > S> > laptops. If somebody is using vt(4) instead of X on a laptop, then > > S> > > S> This change disable bell in X11 too. > > S> This is completly disable speaker bell. > > > > Are you sure? I haven't yet upgraded my desktop to this point, so can't > test. > > How is that possible that vt(4) affects X11? > > > pre-evdev X11 got keyboard input from tty subsystem > > and post-evdev X11 still affected by it. We have local X11 patch which > disables bell on ttyv8, otherwise you'll hear annoying sound as soon as > tty buffer get filled up. > > But you have to have custom X11 build to hear bell under X11 > > -- > WBR > Vladimir Kondratyev > > > --00000000000089c23705cee23c13-- From nobody Thu Oct 21 20:18:05 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 081D6181AAFE; Thu, 21 Oct 2021 20:18:10 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HZzLn61Hvz4v3N; Thu, 21 Oct 2021 20:18:09 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1mdeVp-000MxJ-K8; Thu, 21 Oct 2021 23:18:05 +0300 Date: Thu, 21 Oct 2021 23:18:05 +0300 From: Slawa Olhovchenkov To: Gleb Smirnoff Cc: Emmanuel Vadot , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: <20211021201804.GY33191@zxy.spb.ru> References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> <20211021080214.GB77338@zxy.spb.ru> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-Rspamd-Queue-Id: 4HZzLn61Hvz4v3N X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Thu, Oct 21, 2021 at 10:03:05AM -0700, Gleb Smirnoff wrote: > On Thu, Oct 21, 2021 at 11:02:14AM +0300, Slawa Olhovchenkov wrote: > S> > laptops. If somebody is using vt(4) instead of X on a laptop, then > S> > S> This change disable bell in X11 too. > S> This is completly disable speaker bell. > > Are you sure? I haven't yet upgraded my desktop to this point, so can't test. You don't need to any upgrade. Just do `sysctl kern.vt.enable_bell=0` > How is that possible that vt(4) affects X11? MB bell controlled by vt(4) Any ^G from X11 routed to MB speeker (vt bell). From nobody Thu Oct 21 20:18:14 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9723E181ADA2; Thu, 21 Oct 2021 20:18: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 4HZzLv2Rlvz4tv5; Thu, 21 Oct 2021 20:18: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 EA25021460; Thu, 21 Oct 2021 20: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 19LKIExQ033623; Thu, 21 Oct 2021 20:18:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19LKIE8E033622; Thu, 21 Oct 2021 20:18:14 GMT (envelope-from git) Date: Thu, 21 Oct 2021 20:18:14 GMT Message-Id: <202110212018.19LKIE8E033622@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 6fa58bfb3ecf - main - uefi(8): loader.efi does not search for loader.efi List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6fa58bfb3ecfad4aece948fd7e6a8ca3d60a18c2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=6fa58bfb3ecfad4aece948fd7e6a8ca3d60a18c2 commit 6fa58bfb3ecfad4aece948fd7e6a8ca3d60a18c2 Author: Colin Percival AuthorDate: 2021-10-21 20:15:57 +0000 Commit: Colin Percival CommitDate: 2021-10-21 20:17:33 +0000 uefi(8): loader.efi does not search for loader.efi This man page formerly referred to boot1.efi searching for loader.efi; when boot1.efi was obsoleted in favour of having loader.efi launched directly, this was left claiming that loader.efi searched for loader.efi. Reviewed by: bcran Fixes: db8b56134506 Rework UEFI ESP generation Differential Revision: https://reviews.freebsd.org/D32334 --- share/man/man8/uefi.8 | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/share/man/man8/uefi.8 b/share/man/man8/uefi.8 index 64bc30139f97..76fcedbfff16 100644 --- a/share/man/man8/uefi.8 +++ b/share/man/man8/uefi.8 @@ -88,24 +88,6 @@ or .Pa /boot/config . .It .Pa loader.efi -searches partitions of type -.Li freebsd-ufs -and -.Li freebsd-zfs -for -.Pa loader.efi . -The search begins with partitions on the device from which -.Pa loader.efi -was loaded, and continues with other available partitions. -If both -.Li freebsd-ufs -and -.Li freebsd-zfs -partitions exist on the same device the -.Li freebsd-zfs -partition is preferred. -.It -.Pa loader.efi loads and boots the kernel, as described in .Xr loader 8 . .El From nobody Fri Oct 22 03:17:02 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4E022181C124; Fri, 22 Oct 2021 03:17:02 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hb8f61gQTz3D04; Fri, 22 Oct 2021 03:17:02 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1634872622; 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=lYUe9SoWbU5zlfs6MVKTMtM7bJ8ZOxJX7m3VYeWeYkc=; b=uPyBSGtzMXXb+fB/K8cnHdY1SwG4hs9xYF5LxKyjdg6vCgVK9D95rpsA96c+/I86CY+IU3 sIZIdKMrBfUQvFCKNxzBLBm0Ge8tJd0Uj6VbGuaA6cqytcPSs7kh9RZkKL2Rv1z9SRsTVK 0hU6iiGa54xuo7qkfZ2Cr7PLfVdscFQPAnfqmtUQXErYiR+qbg2abSJombQpt77XkA0xh5 Imm9KPREOA14dw9NmuXv8K8vcHp9onTKG/NOlU108HuAX9EdTwYZ92KSEd36aA0jjPCCj1 nk4Ncl/YrzxhJVpbEY+MrnDEvvL5YYxkjEg6Iwz6kQgVYyRGuS6VCdNXclSWQw== Received: by freefall.freebsd.org (Postfix, from userid 1033) id 243D08453; Fri, 22 Oct 2021 03:17:02 +0000 (UTC) Date: Fri, 22 Oct 2021 03:17:02 +0000 From: Alexey Dokuchaev To: Warner Losh Cc: src-committers , "" , dev-commits-src-main@freebsd.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> <20211021080214.GB77338@zxy.spb.ru> <99e7aecf-9ab7-8b8f-ff30-b5fce3e031c2@FreeBSD.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1634872622; 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=lYUe9SoWbU5zlfs6MVKTMtM7bJ8ZOxJX7m3VYeWeYkc=; b=aLDEb8ZuTcJJBDOymYFn+/t2MkmY9LDPpRuSKiB5WvUOjym/CzxASur+RgbF4eg05AmrmD CissBJmpH/w/GExyza10LV/EOwKt4mS7loHe8I3zfauELeIZpVIxw6aG4YM/nSA41ZtFsW sVh83yGg+kyIFRsojepvmtUknZhx3eQQZKAnkm4lRud1lTmU9VIsHmgQcg9RTo1LBEOp5C L74wEMiqqED8EAEeHHdoBS+5c2YUKdoI9QV9QHaAMS3NkyCvFcdG78jQiLIEo6zD6hELne YbwA6eYYm7U7H3A8sQE0HJ7cu9jqOrKj3uIeYziPcGbi805UjAfGYC+FjJOa6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1634872622; a=rsa-sha256; cv=none; b=AxU0P2zPrLuaWcRX7ovvTx7uYYvdMOvHDyRTiKNi1PUAuF28k/5pL3K/tU0BHwmnlIIECT qLM4DhaTZBAO6Xi6ela+PZlfmxmHw2ymQkupAdQh4vGiJSFgFYoZEqxFwOVOloJrU/iVhF DzWSvJ1mzI8FUyue0Vl12CktqlAPmSpB3oeeqsZgJUUctd4t31uab6TgX6/8hiHIrd9OIY MSkDyEAGmg0U20zZb5MTIbaQgkzr/STIBIhiDnADBWnBbVJ/sTGhJbSYtRgqHg12WtuvyV L+H879tiEcR18RCr3naQk4+YahwRrymBJOIGDQ+dIbS5XUNtl+VcuBO5UOSFcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On Thu, Oct 21, 2021 at 01:52:26PM -0600, Warner Losh wrote: > This discussion to date has been data free. I created a poll... > > https://twitter.com/bsdimp/status/1451274644439265308 You couldn't use neutral wording, could you? The poll is loaded with bias, this is not the way to collect answers. FWIW, FreeBSD itself does not make "loud, annoying noise", it simply instructs the underlying hardware to beep. You've asked if people enjoy loud, annoying beeps -- well, nobody does, but that's not what we're discussing here. ./danfe From nobody Fri Oct 22 03:54:26 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 608FA180375C; Fri, 22 Oct 2021 03:54: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 4Hb9TG2HsQz3NHp; Fri, 22 Oct 2021 03:54: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 3026C27A17; Fri, 22 Oct 2021 03:54: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 19M3sQEF045465; Fri, 22 Oct 2021 03:54:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19M3sQYp045464; Fri, 22 Oct 2021 03:54:26 GMT (envelope-from git) Date: Fri, 22 Oct 2021 03:54:26 GMT Message-Id: <202110220354.19M3sQYp045464@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: 73f8667ed4d5 - main - Document my doc commit bit history List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 73f8667ed4d5c483ef5602698cdd7cd24b1c2290 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=73f8667ed4d5c483ef5602698cdd7cd24b1c2290 commit 73f8667ed4d5c483ef5602698cdd7cd24b1c2290 Author: Li-Wen Hsu AuthorDate: 2021-10-22 03:54:06 +0000 Commit: Li-Wen Hsu CommitDate: 2021-10-22 03:54:06 +0000 Document my doc commit bit history Reminded by: ygy --- share/misc/committers-doc.dot | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/share/misc/committers-doc.dot b/share/misc/committers-doc.dot index a4297f2442db..8a256548e758 100644 --- a/share/misc/committers-doc.dot +++ b/share/misc/committers-doc.dot @@ -82,6 +82,7 @@ joel [label="Joel Dahl\njoel@FreeBSD.org\n2005/04/05"] keramida [label="Giorgos Keramidas\nkeramida@FreeBSD.org\n2001/10/12"] linimon [label="Mark Linimon\nlinimon@FreeBSD.org\n2004/03/31"] loader [label="Fukang Chen\nloader@FreeBSD.org\n2007/07/30"] +lwhsu [label="Li-Wen Hsu\nlwhsu@FreeBSD.org\n2021/08/01"] manolis [label="Manolis Kiagias\nmanolis@FreeBSD.org\n2008/05/24"] marck [label="Dmitry Morozovsky\nmarck@FreeBSD.org\n2004/08/10"] maxim [label="Maxim Konovalov\nmaxim@FreeBSD.org\n2002/02/07"] @@ -132,6 +133,8 @@ blackend -> ceri brueffer -> joel +carlavilla -> lwhsu + ceri -> brd ceri -> brueffer ceri -> linimon @@ -210,4 +213,6 @@ trhodes -> jcamou wblock -> jgh wblock -> allanjude + +ygy -> lwhsu } From nobody Fri Oct 22 04:55:00 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 50E5C181D1B7 for ; Fri, 22 Oct 2021 04:55:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ua1-x92b.google.com (mail-ua1-x92b.google.com [IPv6:2607:f8b0:4864:20::92b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HbBqL1FdMz3tgC for ; Fri, 22 Oct 2021 04:55:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ua1-x92b.google.com with SMTP id q13so5444366uaq.2 for ; Thu, 21 Oct 2021 21:55:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jqBJ1tsfuYUf7teV3iTtFxUn97wSyUwtOOrLlrRZtH0=; b=WvvJrugS3d/OqfeDeDCnqjIX3PBJl8F59TK85wrWFuCtjeHbGrqkB37cNb868CGzob oFNSAGvLlzOWTA9CLfrfNwN5pggjUq0S2CEC86oZcDIV0DgxHsd+MoUZsWJ/jMAAMBVp r6YoO2yVlpQj8OwkHjODNJVY0vLsmzzLQyzk75R1G9nxdcD1qTBXMecEZF6NGHHJkK4i qySw6KqQBPcoZ8mO6pwoe7rYNUipnj8MYX84lWi8JKkp7xHr5Ik2wPwAythQc2E2AhiN CiE1mqAbuBB63rCn4JrAfeWXYRhatzVCJJEM35XjXTCVf/BdS7VK/NeWkNIi7jVP1GCf LeFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jqBJ1tsfuYUf7teV3iTtFxUn97wSyUwtOOrLlrRZtH0=; b=lCWfKpiHKd7kh9SGS5xt4zatsHqoBD5SWKs7xrXQtL0ydH57yFVHwB7U5DNDkMroyp v7+fzAn06EBUSKwYnw9exQDUGSAiFrfm/SBUA7toyEzd/LzKrYz5CNtHtXHocU2FyhSV vx6jhZdxXwiyQKhRFNZoc6unwVrgefOqUBlvcX+8ydh85gSqeE1F8joT+thLFhnW5xDk dSVoDfnkovL24HdZAf4KngDX5Rj/ZiUnamE1L54oI3zNEGjbIi44oQinb9moi9Ln899L 2UUp447bLwzscXJhAwARm2kGu+e+khaX8/V38yoVtlmXwxa043n2NCP4L+YYr7ruxHWO YwkA== X-Gm-Message-State: AOAM530H8LVJ8QXsH6FN0bHNpUQBO+o0g3HgVnckYEk0LObcrEH/qtcX D8hQNO3F5i23JaZVIISqo/apslD4Y4vkTBwr4adERw== X-Google-Smtp-Source: ABdhPJzpy3+ArY3ZE+MksfY2CyJRh37TGQqMNPtUWGEKtphCatYMEY0JhMNB6It3vAUpvqwfQ18txAcRrbMuObpyhiU= X-Received: by 2002:a67:ab48:: with SMTP id k8mr12933297vsh.30.1634878509332; Thu, 21 Oct 2021 21:55:09 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> <20211021080214.GB77338@zxy.spb.ru> <99e7aecf-9ab7-8b8f-ff30-b5fce3e031c2@FreeBSD.org> In-Reply-To: From: Warner Losh Date: Thu, 21 Oct 2021 22:55:00 -0600 Message-ID: Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default To: Alexey Dokuchaev Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000ccd16005cee9d0b2" X-Rspamd-Queue-Id: 4HbBqL1FdMz3tgC X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N --000000000000ccd16005cee9d0b2 Content-Type: text/plain; charset="UTF-8" On Thu, Oct 21, 2021 at 9:17 PM Alexey Dokuchaev wrote: > On Thu, Oct 21, 2021 at 01:52:26PM -0600, Warner Losh wrote: > > This discussion to date has been data free. I created a poll... > > > > https://twitter.com/bsdimp/status/1451274644439265308 > > You couldn't use neutral wording, could you? The poll is loaded > with bias, this is not the way to collect answers. FWIW, FreeBSD > itself does not make "loud, annoying noise", it simply instructs > the underlying hardware to beep. You've asked if people enjoy > loud, annoying beeps -- well, nobody does, but that's not what > we're discussing here. > FreeBSD controls the pitch and duration of the noise. And there's at least one bug in it. It looks like we want 800Hz: #define VT_BELLPITCH 800 But we ring the bell with sysbeep(1193182 / VT_BELLPITCH, VT_BELLDURATION); which looks almost sane. 1.193182MHz is the clock frequency of the IBM PC PIT square wave generator. And normally it's programmed by dividing this base clock by the desired clock. So we're passing in 1491 into sysbeep. We have a tuneable for the 8254 frequency that the PIT uses, so it's a bug that we're ignoring that and hard coding this value. Now, sysbeep is only defined on x86, where this is timer_spkr_setfreq(pitch); otherwise it's nothing. So, timer_spkr_setfreq looks like: freq = i8254_freq / freq; outb(TIMER_CNTR2, freq & 0xff); outb(TIMER_CNTR2, freq >> 8); so this computation means we are actually playing a 1491Hz tone for 50ms. You can verify this will be the frequency with any PC speaker tutorial. This corresponds to no natural note in western music. F#6 is 1480Hz and F6 is 1397Hz. So the tone that's generated is a dissonant note. C4 is middle C, so this is two octaves higher and a little bit. Even the 800Hz is between G5 and G5#. Not a great note, but at least it's an octave lower. So even the desired beep is dissonant. Since most people find music pleasing, that makes it objectively annoying. A similar analysis for the other common tunings (where A4 is one of 432, 436, 438, 440 (the most common these days), 442, 444, and 446Hz) yields similar results with varying degrees of subtonal dissonance. Also, 50ms is 1/20th of a second (give of take), which translates to about 600 beats per minute, which is annoyingly fast, as any musician would tell you. The only saving grace is that it's done only once. Also, the poll is running 4 to 1 for silence by default. While any bias in wording mighthave pushed it a little one way or the other, when it's this lopsided it's hard to argue that such bias affected the actual outcome. Our users aren't so unsophisticated as to be totally swayed by the choice of wording. The reply tweets suggest people know exactly what I'm talking about. Iknow it isn't scientific, but it is highly suggestive given the 60 point spread. Even had I used differentwording, my followers on twitter are self selecting which is likely a biggersource of error, and lord knows what Twitter's algorithms do to distort who sees it. And likely a dozen other factors I've not even thought of. Warner P.S. We likely should fix this bug, and also change the note to 880, which is A5 (the second A above middle C). Please see https://reviews.freebsd.org/D32594 for a fix for the bug I found here. --000000000000ccd16005cee9d0b2-- From nobody Fri Oct 22 05:22:13 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 927D9180104A; Fri, 22 Oct 2021 05:22: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 4HbCQc3q0Zz4Wb9; Fri, 22 Oct 2021 05:22: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 63E4FD21; Fri, 22 Oct 2021 05:22: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 19M5MGqJ065389; Fri, 22 Oct 2021 05:22:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19M5MDY7065386; Fri, 22 Oct 2021 05:22:13 GMT (envelope-from git) Date: Fri, 22 Oct 2021 05:22:13 GMT Message-Id: <202110220522.19M5MDY7065386@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Philip Paeps Subject: git: b02df2322c86 - main - contrib/tzdata: import tzdata 2021e List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: philip X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b02df2322c861221ae60c5b06886f6f68368307d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by philip: URL: https://cgit.FreeBSD.org/src/commit/?id=b02df2322c861221ae60c5b06886f6f68368307d commit b02df2322c861221ae60c5b06886f6f68368307d Merge: 73f8667ed4d5 c66f7aacfc78 Author: Philip Paeps AuthorDate: 2021-10-22 05:20:20 +0000 Commit: Philip Paeps CommitDate: 2021-10-22 05:20:20 +0000 contrib/tzdata: import tzdata 2021e Merge commit 'c66f7aacfc78e5e86469f85f20d3d4fc7d1e9a74' Changes: https://github.com/eggert/tz/blob/2021e/NEWS MFC after: 3 days contrib/tzdata/NEWS | 8 ++++++++ contrib/tzdata/asia | 19 +++++++++++++------ contrib/tzdata/version | 2 +- 3 files changed, 22 insertions(+), 7 deletions(-) From nobody Fri Oct 22 06:06:27 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 175E318121E2; Fri, 22 Oct 2021 06:06:31 +0000 (UTC) (envelope-from avg@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 4HbDPg08yhz4hVm; Fri, 22 Oct 2021 06:06:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from [192.168.0.88] (unknown [195.64.148.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: avg/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 03E8C2D558; Fri, 22 Oct 2021 06:06:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) To: Warner Losh Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> <20211021080214.GB77338@zxy.spb.ru> <99e7aecf-9ab7-8b8f-ff30-b5fce3e031c2@FreeBSD.org> From: Andriy Gapon Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: <718707f9-57e9-057e-1811-f9229f2da9de@FreeBSD.org> Date: Fri, 22 Oct 2021 09:06:27 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.14.0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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-ThisMailContainsUnwantedMimeParts: N On 21/10/2021 22:52, Warner Losh wrote: > This discussion to date has been data free. I created a poll... > > https://twitter.com/bsdimp/status/1451274644439265308 > I tried to abstain from this discussion on whether the bike shed should have been repainted although I do have an opinion :-) Don't have we have anything better than twitter for such a poll? Something on FreeBSD infra maybe? I recall some polls and surveys in the past and they weren't on twitter. Reading some comments on twitter (thankfully I don't need to sign up for that) I see a valid point about feature discoverability. If it beeps, I know that it can beep. And if that annoys me, I'll try to research how to disable it. If it doesn't beep, how would I even know that it can beep? (Asking for a 15 year old friend). Maybe I would find the beeping useful and pleasant, but what are my chances of learning that it exists? -- Andriy Gapon From nobody Fri Oct 22 06:28:22 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 06D7A17F4DFC; Fri, 22 Oct 2021 06:28:23 +0000 (UTC) (envelope-from danfe@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 4HbDtt1Pzlz4qTj; Fri, 22 Oct 2021 06:28:22 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1634884102; 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=k0N9R22+Ecpb/SnnoiPv7mQYZQuedt+e+xLhK1Ukpzw=; b=nD0TIuYfOPjtTJReqSU3rUS8HFgfu1oJi8p7QFBcrCrwAKVRoiQ1zuy3GspLEhOgoZqJar H+BIvl7MGmdZ9AjiP/jy1hOcZou+/ohCKZdnEHSOLF/zbiW0Oi1qfHG1R23OXbqxtjpZXD 8aL9aZoIpxs1WLPvicjjZ+4hXWI5MJ4L0XgtOxkWwjYalTx9QqXva+xLPRLN0aW63+toU7 xwl/Q1H6YCwmCMK/dPImzwirc+pbueJ/9lTvc9zQ10eYt5qVGN282Yn5eaS2LNdJBdQm1b n6/4f9WC3aNUR90NOL0ELmn50OOaYZMxzyLoQX3DsL4jyLc1mxdSARuLXAJYtg== Received: by freefall.freebsd.org (Postfix, from userid 1033) id 15B9D8DDD; Fri, 22 Oct 2021 06:28:22 +0000 (UTC) Date: Fri, 22 Oct 2021 06:28:22 +0000 From: Alexey Dokuchaev To: Warner Losh Cc: src-committers , "" , dev-commits-src-main@freebsd.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: References: <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> <20211021080214.GB77338@zxy.spb.ru> <99e7aecf-9ab7-8b8f-ff30-b5fce3e031c2@FreeBSD.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1634884102; 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=k0N9R22+Ecpb/SnnoiPv7mQYZQuedt+e+xLhK1Ukpzw=; b=ZK88VP+4WsCeEEPTehxJb0xDDbU5/vY1GT74DBB0rgwDTdgOJpx1HQcKkjsrLKTft+waos uH45SlBS/q9gAFEU5SkFRLZJiEnE7PfRL5NAfcUhceKjTwGQwHEbUtbTdUDvzaaJAjO5cB MSgHps6fbYl8vJdFst/dYBKcN0z+vjS91qDL9n7azjBaahcEhM6ZvguzTjv6Ar5SybpDCg lttx+S1mbkaoQoC0D0UIKqnmyhOVkJ1s1Zv72iHvVXg6J16WSkrP9eiGrCKt/G4/AFdCOy 2yPheEXtIQxCgjEoRiL5ss5LhkKNlT9eU2HoVEDJ1nIPGFMzCxKLJH9/UxLBCw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1634884102; a=rsa-sha256; cv=none; b=CFXI3llnv9Dc0fWtCaf9PL1p5gn1qtCoOYZN+QtsjQK/m2wRizHKff6psaBQNk18B8axsO fuFVFUA35yuicBGUXDOXu0q8K3B4AMbmi1PEhhVMVJrBF44+ngOJ2rzaePEkv+yex20961 H2snoUFQWCVWqDFuqXjteylyPrxFNhpolIY9WKBeXP3aI2qOSRK7D2X8NuJAvylo4mNTMC OEJ7Cmw1+8L3yp4vBO/FRDcihTFxsutgTR9AVCzxfVS7uFeoE6hV2yvyS3bBdtbdewb7G3 +fErsPsYhsiaunAcCmZa05ua0F9qfkuUvfTLxHcLhfs9/mDWfybASgst3E7ckg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On Thu, Oct 21, 2021 at 10:55:00PM -0600, Warner Losh wrote: > On Thu, Oct 21, 2021 at 9:17 PM Alexey Dokuchaev wrote: > > On Thu, Oct 21, 2021 at 01:52:26PM -0600, Warner Losh wrote: > > > This discussion to date has been data free. I created a poll... > > > > > > https://twitter.com/bsdimp/status/1451274644439265308 > > > > You couldn't use neutral wording, could you? The poll is loaded > > with bias, this is not the way to collect answers. FWIW, FreeBSD > > itself does not make "loud, annoying noise", it simply instructs > > the underlying hardware to beep. You've asked if people enjoy > > loud, annoying beeps -- well, nobody does, but that's not what > > we're discussing here. > > FreeBSD controls the pitch and duration of the noise. And there's > at least one bug in it. > > [ technical details skipped ] > Since most people find music pleasing, that makes it objectively > annoying. A similar analysis for the other common tunings (where > A4 is one of 432, 436, 438, 440 (the most common these days), 442, > 444, and 446Hz) yields similar results with varying degrees of > subtonal dissonance. Good, so let's fix the bug and make emitted sound more pleasant by default, good catch! > Also, the poll is running 4 to 1 for silence by default. While any > bias in wording mighthave pushed it a little one way or the other, > when it's this lopsided it's hard to argue that such bias affected > the actual outcome. Or it could, should you have worded it differently, we don't know. > Our users aren't so unsophisticated as to be totally swayed by the > choice of wording. This is not how it works Warner, you don't first offer biased poll and then defend skewed results by appealing to observed ratio and how smart your target audience is. ./danfe From nobody Fri Oct 22 07:27:45 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B5DC4181554C; Fri, 22 Oct 2021 07:27:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HbGCP4mkdz3MGt; Fri, 22 Oct 2021 07:27: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 7FF7522DE; Fri, 22 Oct 2021 07:27:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19M7RjoI026045; Fri, 22 Oct 2021 07:27:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19M7RjfZ026044; Fri, 22 Oct 2021 07:27:45 GMT (envelope-from git) Date: Fri, 22 Oct 2021 07:27:45 GMT Message-Id: <202110220727.19M7RjfZ026044@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: cfd8fda15939 - main - RELNOTES: Fix KMSAN entry List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: cfd8fda15939c931d3788d49d6cad586c7899bd9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=cfd8fda15939c931d3788d49d6cad586c7899bd9 commit cfd8fda15939c931d3788d49d6cad586c7899bd9 Author: Elliott Mitchell AuthorDate: 2021-10-22 07:16:54 +0000 Commit: Li-Wen Hsu CommitDate: 2021-10-22 07:16:54 +0000 RELNOTES: Fix KMSAN entry The lead digit was lost in 05eba8e068c1 making it impossible to find the commit. The two subsequent RELNOTES commits gave one less digit of the commit hash, which is what `git rev-parse --short` thinks the minimal length is, but keep them to align with other entries. Fixes: 05eba8e068c1 Differential Revision: https://reviews.freebsd.org/D32595 --- RELNOTES | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RELNOTES b/RELNOTES index 60942ddd5422..0c6c1c2f4ffc 100644 --- a/RELNOTES +++ b/RELNOTES @@ -10,16 +10,16 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. -d410b585b6f: +d410b585b6f0: sh(1) is now the default shell for the root user. -396851c20ae: +396851c20aeb: libncursesw has been split into libtinfow and libncursesw, linker scripts should make it transparent for consumers. pkg-config files are also now installed to ease ports detecting the ncurses setup from base. -422084abbda: +a422084abbda: LLVM's MemorySanitizer can now be used in amd64 kernels. See the kmsan(9) manual page for more information. From nobody Fri Oct 22 08:56:52 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C85731813D1C; Fri, 22 Oct 2021 08:56: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 4HbJBD5FRVz4WsB; Fri, 22 Oct 2021 08:56: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 91EF13ACB; Fri, 22 Oct 2021 08:56: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 19M8uqGR044656; Fri, 22 Oct 2021 08:56:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19M8uqxw044655; Fri, 22 Oct 2021 08:56:52 GMT (envelope-from git) Date: Fri, 22 Oct 2021 08:56:52 GMT Message-Id: <202110220856.19M8uqxw044655@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: ab238f14544b - main - pf: ensure we have the correct source/destination IP address in ICMP errors List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: ab238f14544b2415561c4fed674ee360aa8b5860 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ab238f14544b2415561c4fed674ee360aa8b5860 commit ab238f14544b2415561c4fed674ee360aa8b5860 Author: Luiz Otavio O Souza AuthorDate: 2021-10-19 11:37:54 +0000 Commit: Kristof Provost CommitDate: 2021-10-22 07:52:17 +0000 pf: ensure we have the correct source/destination IP address in ICMP errors When we route-to a packet that later turns out to not fit in the outbound interface MTU we generate an ICMP error. However, if we've already changed those (i.e. we've passed through a NAT rule) we have to undo the transformation first. Obtained from: pfSense MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32571 --- sys/netpfil/pf/pf.c | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 101 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 2c625703c5d9..17253373628c 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -320,6 +320,8 @@ static u_int pf_purge_expired_states(u_int, int); static void pf_purge_unlinked_rules(void); static int pf_mtag_uminit(void *, int, int); static void pf_mtag_free(struct m_tag *); +static void pf_packet_rework_nat(struct mbuf *, struct pf_pdesc *, + int, struct pf_state_key *); #ifdef INET static void pf_route(struct mbuf **, struct pf_krule *, int, struct ifnet *, struct pf_kstate *, @@ -341,6 +343,16 @@ extern struct proc *pf_purge_proc; VNET_DEFINE(struct pf_limit, pf_limits[PF_LIMIT_MAX]); +#define PACKET_UNDO_NAT(_m, _pd, _off, _s, _dir) \ + do { \ + struct pf_state_key *nk; \ + if ((_dir) == PF_OUT) \ + nk = (_s)->key[PF_SK_STACK]; \ + else \ + nk = (_s)->key[PF_SK_WIRE]; \ + pf_packet_rework_nat(_m, _pd, _off, nk); \ + } while (0) + #define PACKET_LOOPED(pd) ((pd)->pf_mtag && \ (pd)->pf_mtag->flags & PF_PACKET_LOOPED) @@ -446,6 +458,83 @@ pf_addr_cmp(struct pf_addr *a, struct pf_addr *b, sa_family_t af) return (0); } +static void +pf_packet_rework_nat(struct mbuf *m, struct pf_pdesc *pd, int off, + struct pf_state_key *nk) +{ + + switch (pd->proto) { + case IPPROTO_TCP: { + struct tcphdr *th = &pd->hdr.tcp; + + if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], pd->af)) + pf_change_ap(m, pd->src, &th->th_sport, pd->ip_sum, + &th->th_sum, &nk->addr[pd->sidx], + nk->port[pd->sidx], 0, pd->af); + if (PF_ANEQ(pd->dst, &nk->addr[pd->didx], pd->af)) + pf_change_ap(m, pd->dst, &th->th_dport, pd->ip_sum, + &th->th_sum, &nk->addr[pd->didx], + nk->port[pd->didx], 0, pd->af); + m_copyback(m, off, sizeof(*th), (caddr_t)th); + break; + } + case IPPROTO_UDP: { + struct udphdr *uh = &pd->hdr.udp; + + if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], pd->af)) + pf_change_ap(m, pd->src, &uh->uh_sport, pd->ip_sum, + &uh->uh_sum, &nk->addr[pd->sidx], + nk->port[pd->sidx], 1, pd->af); + if (PF_ANEQ(pd->dst, &nk->addr[pd->didx], pd->af)) + pf_change_ap(m, pd->dst, &uh->uh_dport, pd->ip_sum, + &uh->uh_sum, &nk->addr[pd->didx], + nk->port[pd->didx], 1, pd->af); + m_copyback(m, off, sizeof(*uh), (caddr_t)uh); + break; + } + case IPPROTO_ICMP: { + struct icmp *ih = &pd->hdr.icmp; + + if (nk->port[pd->sidx] != ih->icmp_id) { + pd->hdr.icmp.icmp_cksum = pf_cksum_fixup( + ih->icmp_cksum, ih->icmp_id, + nk->port[pd->sidx], 0); + ih->icmp_id = nk->port[pd->sidx]; + pd->sport = &ih->icmp_id; + + m_copyback(m, off, ICMP_MINLEN, (caddr_t)ih); + } + /* FALLTHROUGH */ + } + default: + if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], pd->af)) { + switch (pd->af) { + case AF_INET: + pf_change_a(&pd->src->v4.s_addr, + pd->ip_sum, nk->addr[pd->sidx].v4.s_addr, + 0); + break; + case AF_INET6: + PF_ACPY(pd->src, &nk->addr[pd->sidx], pd->af); + break; + } + } + if (PF_ANEQ(pd->dst, &nk->addr[pd->didx], pd->af)) { + switch (pd->af) { + case AF_INET: + pf_change_a(&pd->dst->v4.s_addr, + pd->ip_sum, nk->addr[pd->didx].v4.s_addr, + 0); + break; + case AF_INET6: + PF_ACPY(pd->dst, &nk->addr[pd->didx], pd->af); + break; + } + } + break; + } +} + static __inline uint32_t pf_hashkey(struct pf_state_key *sk) { @@ -5937,6 +6026,11 @@ pf_route(struct mbuf **m, struct pf_krule *r, int dir, struct ifnet *oifp, error = EMSGSIZE; KMOD_IPSTAT_INC(ips_cantfrag); if (r->rt != PF_DUPTO) { + if (s && pd->nat_rule != NULL) + PACKET_UNDO_NAT(m0, pd, + (ip->ip_hl << 2) + (ip_off & IP_OFFMASK), + s, dir); + icmp_error(m0, ICMP_UNREACH, ICMP_UNREACH_NEEDFRAG, 0, ifp->if_mtu); goto done; @@ -6104,9 +6198,14 @@ pf_route6(struct mbuf **m, struct pf_krule *r, int dir, struct ifnet *oifp, nd6_output_ifp(ifp, ifp, m0, &dst, NULL); else { in6_ifstat_inc(ifp, ifs6_in_toobig); - if (r->rt != PF_DUPTO) + if (r->rt != PF_DUPTO) { + if (s && pd->nat_rule != NULL) + PACKET_UNDO_NAT(m0, pd, + ((caddr_t)ip6 - m0->m_data) + + sizeof(struct ip6_hdr), s, dir); + icmp6_error(m0, ICMP6_PACKET_TOO_BIG, 0, ifp->if_mtu); - else + } else goto bad; } From nobody Fri Oct 22 08:56:53 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4C1FA1813D21; Fri, 22 Oct 2021 08:56: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 4HbJBF6d7vz4Wmg; Fri, 22 Oct 2021 08:56: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 BAD543C48; Fri, 22 Oct 2021 08:56: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 19M8urSp044686; Fri, 22 Oct 2021 08:56:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19M8urgr044685; Fri, 22 Oct 2021 08:56:53 GMT (envelope-from git) Date: Fri, 22 Oct 2021 08:56:53 GMT Message-Id: <202110220856.19M8urgr044685@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: 30276ef12cbb - main - pf tests: test NAT-ed ICMP errors List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 30276ef12cbb47cdd302741096262041be30ec11 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=30276ef12cbb47cdd302741096262041be30ec11 commit 30276ef12cbb47cdd302741096262041be30ec11 Author: Kristof Provost AuthorDate: 2021-10-19 11:52:21 +0000 Commit: Kristof Provost CommitDate: 2021-10-22 07:52:17 +0000 pf tests: test NAT-ed ICMP errors Ensure that the ICMP error is returned with the correct source and destination addresses. MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32572 --- tests/sys/netpfil/common/Makefile | 2 + tests/sys/netpfil/common/pft_icmp_check.py | 112 +++++++++++++++++++++++++++++ tests/sys/netpfil/pf/route_to.sh | 59 +++++++++++++++ 3 files changed, 173 insertions(+) diff --git a/tests/sys/netpfil/common/Makefile b/tests/sys/netpfil/common/Makefile index 749e0dd99469..189b8b44cfce 100644 --- a/tests/sys/netpfil/common/Makefile +++ b/tests/sys/netpfil/common/Makefile @@ -16,10 +16,12 @@ ATF_TESTS_SH+= \ ${PACKAGE}FILES+= \ utils.subr \ runner.subr \ + pft_icmp_check.py \ pft_ping.py \ pft_synflood.py \ sniffer.py +${PACKAGE}FILESMODE_pft_icmp_check.py= 0555 ${PACKAGE}FILESMODE_pft_ping.py= 0555 ${PACKAGE}FILESMODE_pft_synflood.py= 0555 diff --git a/tests/sys/netpfil/common/pft_icmp_check.py b/tests/sys/netpfil/common/pft_icmp_check.py new file mode 100644 index 000000000000..e3c5b927aa63 --- /dev/null +++ b/tests/sys/netpfil/common/pft_icmp_check.py @@ -0,0 +1,112 @@ +#!/usr/bin/env python3 +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2021 Rubicon Communications, LLC (Netgate) +# +# 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. +# + +import argparse +import logging +logging.getLogger("scapy").setLevel(logging.CRITICAL) +import random +import scapy.all as sp +import socket +import sys +from sniffer import Sniffer + +PAYLOAD_MAGIC = bytes.fromhex('42c0ffee') + +def ping(send_if, dst_ip, args): + ether = sp.Ether() + ip = sp.IP(dst=dst_ip, src=args.fromaddr[0]) + icmp = sp.ICMP(type='echo-request') + raw = sp.raw(PAYLOAD_MAGIC * 250) # We want 1000 bytes payload, -ish + + ip.flags = 2 # Don't fragment + icmp.seq = random.randint(0, 65535) + args.icmp_seq = icmp.seq + + req = ether / ip / icmp / raw + sp.sendp(req, iface=send_if, verbose=False) + +def check_icmp_too_big(args, packet): + """ + Verify that this is an ICMP packet too big error, and that the IP addresses + in the payload packet match expectations. + """ + icmp = packet.getlayer(sp.ICMP) + if not icmp: + return False + + if not icmp.type == 3: + return False + ip = packet.getlayer(sp.IPerror) + if not ip: + return False + + if ip.src != args.fromaddr[0]: + print("Incorrect src addr %s" % ip.src) + return False + if ip.dst != args.to[0]: + print("Incorrect dst addr %s" % ip.dst) + return False + + icmp2 = packet.getlayer(sp.ICMPerror) + if not icmp2: + print("IPerror doesn't contain ICMP") + return False + if icmp2.seq != args.icmp_seq: + print("Incorrect icmp seq %d != %d" % (icmp2.seq, args.icmp_seq)) + return False + return True + +def main(): + parser = argparse.ArgumentParser("pft_icmp_check.py", + description="ICMP error validation tool") + parser.add_argument('--to', nargs=1, required=True, + help='The destination IP address') + parser.add_argument('--fromaddr', nargs=1, required=True, + help='The source IP address') + parser.add_argument('--sendif', nargs=1, required=True, + help='The interface through which the packet(s) will be sent') + parser.add_argument('--recvif', nargs=1, + help='The interface on which to expect the ICMP error') + + args = parser.parse_args() + sniffer = None + if not args.recvif is None: + sniffer = Sniffer(args, check_icmp_too_big) + + ping(args.sendif[0], args.to[0], args) + + if sniffer: + sniffer.join() + + if sniffer.foundCorrectPacket: + sys.exit(0) + else: + sys.exit(1) + +if __name__ == '__main__': + main() diff --git a/tests/sys/netpfil/pf/route_to.sh b/tests/sys/netpfil/pf/route_to.sh index 957317eb462e..e7646a5fb7f7 100644 --- a/tests/sys/netpfil/pf/route_to.sh +++ b/tests/sys/netpfil/pf/route_to.sh @@ -27,6 +27,8 @@ . $(atf_get_srcdir)/utils.subr +common_dir=$(atf_get_srcdir)/../common + atf_test_case "v4" "cleanup" v4_head() { @@ -250,10 +252,67 @@ multiwanlocal_cleanup() pft_cleanup } +atf_test_case "icmp_nat" "cleanup" +icmp_nat_head() +{ + atf_set descr 'Test that ICMP packets are correct for route-to + NAT' + atf_set require.user root +} + +icmp_nat_body() +{ + pft_init + + epair_one=$(vnet_mkepair) + epair_two=$(vnet_mkepair) + epair_three=$(vnet_mkepair) + + vnet_mkjail gw ${epair_one}b ${epair_two}a ${epair_three}a + vnet_mkjail srv ${epair_two}b + vnet_mkjail srv2 ${epair_three}b + + ifconfig ${epair_one}a 192.0.2.2/24 up + route add -net 198.51.100.0/24 192.0.2.1 + jexec gw sysctl net.inet.ip.forwarding=1 + jexec gw ifconfig ${epair_one}b 192.0.2.1/24 up + jexec gw ifconfig ${epair_two}a 198.51.100.1/24 up + jexec gw ifconfig ${epair_three}a 203.0.113.1/24 up mtu 500 + jexec srv ifconfig ${epair_two}b 198.51.100.2/24 up + jexec srv route add default 198.51.100.1 + jexec srv2 ifconfig ${epair_three}b 203.0.113.2/24 up mtu 500 + jexec srv2 route add default 203.0.113.1 + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 198.51.100.2 + + jexec gw pfctl -e + pft_set_rules gw \ + "nat on ${epair_two}a inet from 192.0.2.0/24 to any -> (${epair_two}a)" \ + "nat on ${epair_three}a inet from 192.0.2.0/24 to any -> (${epair_three}a)" \ + "pass out route-to (${epair_three}a 203.0.113.2) proto icmp icmp-type echoreq" + + # Now ensure that we get an ICMP error with the correct IP addresses in it. + atf_check -s exit:0 ${common_dir}/pft_icmp_check.py \ + --to 198.51.100.2 \ + --fromaddr 192.0.2.2 \ + --recvif ${epair_one}a \ + --sendif ${epair_one}a + + # ping reports the ICMP error, so check of that too. + atf_check -s exit:2 -o match:'frag needed and DF set' \ + ping -D -c 1 -s 1000 198.51.100.2 +} + +icmp_nat_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "v4" atf_add_test_case "v6" atf_add_test_case "multiwan" atf_add_test_case "multiwanlocal" + atf_add_test_case "icmp_nat" } From nobody Fri Oct 22 09:58:46 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 354B7180F3FE; Fri, 22 Oct 2021 09:58: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 4HbKYf5g17z4qDQ; Fri, 22 Oct 2021 09:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A1554B14; Fri, 22 Oct 2021 09:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19M9wkYx025264; Fri, 22 Oct 2021 09:58:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19M9wkjX025263; Fri, 22 Oct 2021 09:58:46 GMT (envelope-from git) Date: Fri, 22 Oct 2021 09:58:46 GMT Message-Id: <202110220958.19M9wkjX025263@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 9a6695532b39 - main - net80211/drivers: improve ieee80211_rx_stats for band List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9a6695532b3997e4e2bc3fe57481cc49be5e9e93 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9a6695532b3997e4e2bc3fe57481cc49be5e9e93 commit 9a6695532b3997e4e2bc3fe57481cc49be5e9e93 Author: Bjoern A. Zeeb AuthorDate: 2021-06-06 21:14:28 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-10-22 09:55:54 +0000 net80211/drivers: improve ieee80211_rx_stats for band While IEEE80211_R_BAND was defined, there was no place to store the band. Add a field for that, adjust ieee80211_lookup_channel_rxstatus() to require it, and update drivers passing "R_{FREQ|IEEE}" in already to provide the band as well. For the moment keep the fall-back code requiring all three fields. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D30662 --- sys/dev/iwm/if_iwm.c | 5 +++++ sys/dev/rtwn/rtl8188e/r88e_rx.c | 2 ++ sys/dev/rtwn/rtl8812a/r12a_rx.c | 2 ++ sys/dev/usb/wlan/if_rsu.c | 2 ++ sys/net80211/_ieee80211.h | 3 +++ sys/net80211/ieee80211.c | 17 ++++++++++++++--- 6 files changed, 28 insertions(+), 3 deletions(-) diff --git a/sys/dev/iwm/if_iwm.c b/sys/dev/iwm/if_iwm.c index b89c895efb50..f994e8e75307 100644 --- a/sys/dev/iwm/if_iwm.c +++ b/sys/dev/iwm/if_iwm.c @@ -3303,12 +3303,15 @@ iwm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, */ bzero(&rxs, sizeof(rxs)); rxs.r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ; + rxs.r_flags |= IEEE80211_R_BAND; rxs.r_flags |= IEEE80211_R_NF | IEEE80211_R_RSSI; rxs.c_ieee = le16toh(phy_info->channel); if (le16toh(phy_info->phy_flags & IWM_RX_RES_PHY_FLAGS_BAND_24)) { rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, IEEE80211_CHAN_2GHZ); + rxs.c_band = IEEE80211_CHAN_2GHZ; } else { rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, IEEE80211_CHAN_5GHZ); + rxs.c_band = IEEE80211_CHAN_5GHZ; } /* rssi is in 1/2db units */ @@ -3414,10 +3417,12 @@ iwm_rx_mpdu_mq(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, */ bzero(&rxs, sizeof(rxs)); rxs.r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ; + rxs.r_flags |= IEEE80211_R_BAND; rxs.r_flags |= IEEE80211_R_NF | IEEE80211_R_RSSI; rxs.c_ieee = channel; rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, channel <= 14 ? IEEE80211_CHAN_2GHZ : IEEE80211_CHAN_5GHZ); + rxs.c_band = channel <= 14 ? IEEE80211_CHAN_2GHZ : IEEE80211_CHAN_5GHZ; /* rssi is in 1/2db units */ rxs.c_rssi = rssi * 2; diff --git a/sys/dev/rtwn/rtl8188e/r88e_rx.c b/sys/dev/rtwn/rtl8188e/r88e_rx.c index dad1bc56446a..16510839bd44 100644 --- a/sys/dev/rtwn/rtl8188e/r88e_rx.c +++ b/sys/dev/rtwn/rtl8188e/r88e_rx.c @@ -240,8 +240,10 @@ r88e_get_rx_stats(struct rtwn_softc *sc, struct ieee80211_rx_stats *rxs, if (!sc->sc_ht40) { /* XXX center channel */ rxs->r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ; + rxs->r_flags |= IEEE80211_R_BAND; rxs->c_ieee = physt->chan; rxs->c_freq = ieee80211_ieee2mhz(rxs->c_ieee, IEEE80211_CHAN_2GHZ); + rxs->c_band = IEEE80211_CHAN_2GHZ; } } diff --git a/sys/dev/rtwn/rtl8812a/r12a_rx.c b/sys/dev/rtwn/rtl8812a/r12a_rx.c index d8dcb3de12c5..98e0cabdff7c 100644 --- a/sys/dev/rtwn/rtl8812a/r12a_rx.c +++ b/sys/dev/rtwn/rtl8812a/r12a_rx.c @@ -321,8 +321,10 @@ r12a_get_rx_stats(struct rtwn_softc *sc, struct ieee80211_rx_stats *rxs, */ #if 0 rxs->r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ; + rxs->r_flags |= IEEE80211_R_BAND; rxs->c_ieee = MS(le16toh(physt->phyw1), R12A_PHYW1_CHAN); rxs->c_freq = ieee80211_ieee2mhz(rxs->c_ieee, (rxs->c_ieee < 36) ? IEEE80211_CHAN_2GHZ : IEEE80211_CHAN_5GHZ); + rxs->c_band = (rxs->c_ieee < 36) ? IEEE80211_CHAN_2GHZ : IEEE80211_CHAN_5GHZ; #endif } diff --git a/sys/dev/usb/wlan/if_rsu.c b/sys/dev/usb/wlan/if_rsu.c index 4dd1c624b9d0..747e3532cde4 100644 --- a/sys/dev/usb/wlan/if_rsu.c +++ b/sys/dev/usb/wlan/if_rsu.c @@ -2081,9 +2081,11 @@ rsu_event_survey(struct rsu_softc *sc, uint8_t *buf, int len) /* Set channel flags for input path */ bzero(&rxs, sizeof(rxs)); rxs.r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ; + rxs.r_flags |= IEEE80211_R_BAND; rxs.r_flags |= IEEE80211_R_NF | IEEE80211_R_RSSI; rxs.c_ieee = le32toh(bss->config.dsconfig); rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, IEEE80211_CHAN_2GHZ); + rxs.c_band = IEEE80211_CHAN_2GHZ; /* This is a number from 0..100; so let's just divide it down a bit */ rxs.c_rssi = le32toh(bss->rssi) / 2; rxs.c_nf = -96; diff --git a/sys/net80211/_ieee80211.h b/sys/net80211/_ieee80211.h index dc6773afac09..754e4647e82f 100644 --- a/sys/net80211/_ieee80211.h +++ b/sys/net80211/_ieee80211.h @@ -612,6 +612,9 @@ struct ieee80211_rx_stats { uint8_t c_ieee; /* Channel */ uint8_t c_width; /* channel width, FW flags above */ + /* 32 bits */ + uint32_t c_band; /* Band; XXX we do not have a real band. */ + /* Force alignment to DWORD */ union { uint8_t evm[IEEE80211_MAX_CHAINS][IEEE80211_MAX_EVM_PILOTS]; diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index 2e98e67edc47..35cf7abdbf3b 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -1818,6 +1818,8 @@ ieee80211_lookup_channel_rxstatus(struct ieee80211vap *vap, return (NULL); if ((rxs->r_flags & IEEE80211_R_IEEE) == 0) return (NULL); + if ((rxs->r_flags & IEEE80211_R_BAND) == 0) + return (NULL); /* * If the rx status contains a valid ieee/freq, then @@ -1828,11 +1830,20 @@ ieee80211_lookup_channel_rxstatus(struct ieee80211vap *vap, */ /* Determine a band */ - /* XXX should be done by the driver? */ - if (rxs->c_freq < 3000) { + switch (rxs->c_band) { + case IEEE80211_CHAN_2GHZ: flags = IEEE80211_CHAN_G; - } else { + break; + case IEEE80211_CHAN_5GHZ: flags = IEEE80211_CHAN_A; + break; + default: + if (rxs->c_freq < 3000) { + flags = IEEE80211_CHAN_G; + } else { + flags = IEEE80211_CHAN_A; + } + break; } /* Channel lookup */ From nobody Fri Oct 22 10:45:44 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9171C17F1B76; Fri, 22 Oct 2021 10:45: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 4HbLbs0KHYz3JQk; Fri, 22 Oct 2021 10:45: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 CBF56514F; Fri, 22 Oct 2021 10:45: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 19MAjiHB091334; Fri, 22 Oct 2021 10:45:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19MAjiib091333; Fri, 22 Oct 2021 10:45:44 GMT (envelope-from git) Date: Fri, 22 Oct 2021 10:45:44 GMT Message-Id: <202110221045.19MAjiib091333@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 3dc7a1897e0b - main - net80211: correct input_sta length checks and control frame handling List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3dc7a1897e0bb9e4b529c01cb3f88e1c387af5e8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3dc7a1897e0bb9e4b529c01cb3f88e1c387af5e8 commit 3dc7a1897e0bb9e4b529c01cb3f88e1c387af5e8 Author: Bjoern A. Zeeb AuthorDate: 2021-09-30 16:41:19 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-10-22 10:42:06 +0000 net80211: correct input_sta length checks and control frame handling Correct input_sta "assertion" checks. CTS/ACK CTRL frames are shorter then sizeof(struct ieee80211_frame_min) and were thus running into the is_rx_tooshort error case. Use ieee80211_anyhdrsize() to handle this better but make sure we do at least have the first 2 octets needed for that. While here move the safety checks before any code which may not obey them later, just for good style. The non-scanning check further down assumes a frame format also not matching control frames. For now skip the checks for control frames which allows us to deal with some of them at least now. Sponsored by: The FreeBSD Foundation Obtained from: 20210906 wireless v0.91 code drop MFC after: 3 days Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D32238 --- sys/net80211/ieee80211_sta.c | 66 +++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c index cd62266ab942..7ea6187332b1 100644 --- a/sys/net80211/ieee80211_sta.c +++ b/sys/net80211/ieee80211_sta.c @@ -552,6 +552,35 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m, int is_hw_decrypted = 0; int has_decrypted = 0; + KASSERT(ni != NULL, ("%s: null node, mbuf %p", __func__, m)); + + /* Early init in case of early error case. */ + type = -1; + + /* + * Bit of a cheat here, we use a pointer for a 3-address + * frame format but don't reference fields past outside + * ieee80211_frame_min (or other shorter frames) w/o first + * validating the data is present. + */ + wh = mtod(m, struct ieee80211_frame *); + + if (m->m_pkthdr.len < 2 || m->m_pkthdr.len < ieee80211_anyhdrsize(wh)) { + IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, + ni->ni_macaddr, NULL, + "too short (1): len %u", m->m_pkthdr.len); + vap->iv_stats.is_rx_tooshort++; + goto err; + } + if ((wh->i_fc[0] & IEEE80211_FC0_VERSION_MASK) != + IEEE80211_FC0_VERSION_0) { + IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, + ni->ni_macaddr, NULL, "wrong version, fc %02x:%02x", + wh->i_fc[0], wh->i_fc[1]); + vap->iv_stats.is_rx_badversion++; + goto err; + } + /* * Some devices do hardware decryption all the way through * to pretending the frame wasn't encrypted in the first place. @@ -569,7 +598,6 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m, * with the M_AMPDU_MPDU flag and we can bypass most of * the normal processing. */ - wh = mtod(m, struct ieee80211_frame *); type = IEEE80211_FC0_TYPE_DATA; dir = wh->i_fc[1] & IEEE80211_FC1_DIR_MASK; subtype = IEEE80211_FC0_SUBTYPE_QOS; @@ -577,39 +605,19 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m, goto resubmit_ampdu; } - KASSERT(ni != NULL, ("null node")); ni->ni_inact = ni->ni_inact_reload; - type = -1; /* undefined */ - - if (m->m_pkthdr.len < sizeof(struct ieee80211_frame_min)) { - IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, - ni->ni_macaddr, NULL, - "too short (1): len %u", m->m_pkthdr.len); - vap->iv_stats.is_rx_tooshort++; - goto out; - } - /* - * Bit of a cheat here, we use a pointer for a 3-address - * frame format but don't reference fields past outside - * ieee80211_frame_min w/o first validating the data is - * present. - */ - wh = mtod(m, struct ieee80211_frame *); - - if ((wh->i_fc[0] & IEEE80211_FC0_VERSION_MASK) != - IEEE80211_FC0_VERSION_0) { - IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, - ni->ni_macaddr, NULL, "wrong version, fc %02x:%02x", - wh->i_fc[0], wh->i_fc[1]); - vap->iv_stats.is_rx_badversion++; - goto err; - } - dir = wh->i_fc[1] & IEEE80211_FC1_DIR_MASK; type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; - if ((ic->ic_flags & IEEE80211_F_SCAN) == 0) { + /* + * Control frames are not folowing the header scheme of data and mgmt + * frames so we do not apply extra checks here. + * We probably should do checks on RA (+TA) where available for those + * too, but for now do not drop them. + */ + if (type != IEEE80211_FC0_TYPE_CTL && + (ic->ic_flags & IEEE80211_F_SCAN) == 0) { bssid = wh->i_addr2; if (!IEEE80211_ADDR_EQ(bssid, ni->ni_bssid)) { /* not interested in */ From nobody Fri Oct 22 10:50:12 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4C1E117F32FD; Fri, 22 Oct 2021 10:50: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 4HbLj01frfz3KXc; Fri, 22 Oct 2021 10:50: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 194BF5244; Fri, 22 Oct 2021 10:50: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 19MAoCRO095479; Fri, 22 Oct 2021 10:50:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19MAoC9V095475; Fri, 22 Oct 2021 10:50:12 GMT (envelope-from git) Date: Fri, 22 Oct 2021 10:50:12 GMT Message-Id: <202110221050.19MAoC9V095475@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Grehan Subject: git: 5a3eb6207a35 - main - igc: correctly update RCTL when changing multicast filters. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: grehan X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5a3eb6207a353c3a18da8abcf00a2d75276dd29e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by grehan: URL: https://cgit.FreeBSD.org/src/commit/?id=5a3eb6207a353c3a18da8abcf00a2d75276dd29e commit 5a3eb6207a353c3a18da8abcf00a2d75276dd29e Author: Peter Grehan AuthorDate: 2021-10-11 17:49:01 +0000 Commit: Peter Grehan CommitDate: 2021-10-22 11:16:12 +0000 igc: correctly update RCTL when changing multicast filters. Fix clearing of bits in RCTL for the non-bpf/non-allmulti case. Update RCTL after modifying the multicast filter registers as per the Linux driver. This fixes LACP on igc interfaces, where incoming LACP multicasti control packets were being dropped. Reviewed by: kbowling Obtained from: Rubicon Communications, LLC ("Netgate") MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D32574 --- sys/dev/igc/if_igc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c index 6d94a7c223c7..436493185d5c 100644 --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -1172,12 +1172,12 @@ igc_if_multi_set(if_ctx_t ctx) reg_rctl |= IGC_RCTL_MPE; reg_rctl &= ~IGC_RCTL_UPE; } else - reg_rctl = ~(IGC_RCTL_UPE | IGC_RCTL_MPE); - - IGC_WRITE_REG(&adapter->hw, IGC_RCTL, reg_rctl); + reg_rctl &= ~(IGC_RCTL_UPE | IGC_RCTL_MPE); if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) igc_update_mc_addr_list(&adapter->hw, mta, mcnt); + + IGC_WRITE_REG(&adapter->hw, IGC_RCTL, reg_rctl); } /********************************************************************* From nobody Fri Oct 22 11:11:52 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 626CB1804956; Fri, 22 Oct 2021 11:11: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 4HbMB02DZgz3QJB; Fri, 22 Oct 2021 11:11: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 2D8FB57C9; Fri, 22 Oct 2021 11:11: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 19MBBqdU031765; Fri, 22 Oct 2021 11:11:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19MBBqs9031764; Fri, 22 Oct 2021 11:11:52 GMT (envelope-from git) Date: Fri, 22 Oct 2021 11:11:52 GMT Message-Id: <202110221111.19MBBqs9031764@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Randall Stewart Subject: git: 4e4c84f8d101 - main - tcp: Add hystart-plus to cc_newreno and rack. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4e4c84f8d101216ebf303f04ce9d4327c3328059 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rrs: URL: https://cgit.FreeBSD.org/src/commit/?id=4e4c84f8d101216ebf303f04ce9d4327c3328059 commit 4e4c84f8d101216ebf303f04ce9d4327c3328059 Author: Randall Stewart AuthorDate: 2021-10-22 11:10:28 +0000 Commit: Randall Stewart CommitDate: 2021-10-22 11:10:28 +0000 tcp: Add hystart-plus to cc_newreno and rack. TCP Hystart draft version -03: https://datatracker.ietf.org/doc/html/draft-ietf-tcpm-hystartplusplus Is a new version of hystart that allows one to carefully exit slow start if the RTT spikes too much. The newer version has a slower-slow-start so to speak that then kicks in for five round trips. To see if you exited too early, if not into congestion avoidance. This commit will add that feature to our newreno CC and add the needed bits in rack to be able to enable it. Reviewed by: tuexen Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D32373 --- sys/netinet/cc/cc.h | 9 + sys/netinet/cc/cc_newreno.c | 335 ++++++++++++++++++++++++++++++++++---- sys/netinet/cc/cc_newreno.h | 22 ++- sys/netinet/tcp.h | 2 +- sys/netinet/tcp_log_buf.h | 3 +- sys/netinet/tcp_stacks/rack.c | 167 +++++++++++++++---- sys/netinet/tcp_stacks/tcp_rack.h | 3 + 7 files changed, 476 insertions(+), 65 deletions(-) diff --git a/sys/netinet/cc/cc.h b/sys/netinet/cc/cc.h index be84a6841d15..e5fc328cc0c2 100644 --- a/sys/netinet/cc/cc.h +++ b/sys/netinet/cc/cc.h @@ -163,6 +163,15 @@ struct cc_algo { /* Called for an additional ECN processing apart from RFC3168. */ void (*ecnpkt_handler)(struct cc_var *ccv); + /* Called when a new "round" begins, if the transport is tracking rounds. */ + void (*newround)(struct cc_var *ccv, uint32_t round_cnt); + + /* + * Called when a RTT sample is made (fas = flight at send, if you dont have it + * send the cwnd in). + */ + void (*rttsample)(struct cc_var *ccv, uint32_t usec_rtt, uint32_t rxtcnt, uint32_t fas); + /* Called for {get|set}sockopt() on a TCP socket with TCP_CCALGOOPT. */ int (*ctl_output)(struct cc_var *, struct sockopt *, void *); diff --git a/sys/netinet/cc/cc_newreno.c b/sys/netinet/cc/cc_newreno.c index 8f939ad70695..23d2b273f6aa 100644 --- a/sys/netinet/cc/cc_newreno.c +++ b/sys/netinet/cc/cc_newreno.c @@ -63,15 +63,21 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include #include +#include +#include #include #include #include +#include +#include #include #include #include @@ -85,6 +91,9 @@ static void newreno_after_idle(struct cc_var *ccv); static void newreno_cong_signal(struct cc_var *ccv, uint32_t type); static void newreno_post_recovery(struct cc_var *ccv); static int newreno_ctl_output(struct cc_var *ccv, struct sockopt *sopt, void *buf); +static void newreno_newround(struct cc_var *ccv, uint32_t round_cnt); +static void newreno_rttsample(struct cc_var *ccv, uint32_t usec_rtt, uint32_t rxtcnt, uint32_t fas); +static int newreno_cb_init(struct cc_var *ccv); VNET_DEFINE(uint32_t, newreno_beta) = 50; VNET_DEFINE(uint32_t, newreno_beta_ecn) = 80; @@ -99,23 +108,95 @@ struct cc_algo newreno_cc_algo = { .cong_signal = newreno_cong_signal, .post_recovery = newreno_post_recovery, .ctl_output = newreno_ctl_output, + .newround = newreno_newround, + .rttsample = newreno_rttsample, + .cb_init = newreno_cb_init, }; -static inline struct newreno * -newreno_malloc(struct cc_var *ccv) -{ - struct newreno *nreno; +static uint32_t hystart_lowcwnd = 16; +static uint32_t hystart_minrtt_thresh = 4000; +static uint32_t hystart_maxrtt_thresh = 16000; +static uint32_t hystart_n_rttsamples = 8; +static uint32_t hystart_css_growth_div = 4; +static uint32_t hystart_css_rounds = 5; +static uint32_t hystart_bblogs = 0; - nreno = malloc(sizeof(struct newreno), M_NEWRENO, M_NOWAIT); - if (nreno != NULL) { - /* NB: nreno is not zeroed, so initialise all fields. */ - nreno->beta = V_newreno_beta; - nreno->beta_ecn = V_newreno_beta_ecn; - nreno->newreno_flags = 0; - ccv->cc_data = nreno; +static void +newreno_log_hystart_event(struct cc_var *ccv, struct newreno *nreno, uint8_t mod, uint32_t flex1) +{ + /* + * Types of logs (mod value) + * 1 - rtt_thresh in flex1, checking to see if RTT is to great. + * 2 - rtt is too great, rtt_thresh in flex1. + * 3 - CSS is active incr in flex1 + * 4 - A new round is beginning flex1 is round count + * 5 - A new RTT measurement flex1 is the new measurement. + * 6 - We enter CA ssthresh is also in flex1. + * 7 - Socket option to change hystart executed opt.val in flex1. + * 8 - Back out of CSS into SS, flex1 is the css_baseline_minrtt + */ + struct tcpcb *tp; + + if (hystart_bblogs == 0) + return; + tp = ccv->ccvc.tcp; + if (tp->t_logstate != TCP_LOG_STATE_OFF) { + union tcp_log_stackspecific log; + struct timeval tv; + + memset(&log, 0, sizeof(log)); + log.u_bbr.flex1 = flex1; + log.u_bbr.flex2 = nreno->css_current_round_minrtt; + log.u_bbr.flex3 = nreno->css_lastround_minrtt; + log.u_bbr.flex4 = nreno->css_rttsample_count; + log.u_bbr.flex5 = nreno->css_entered_at_round; + log.u_bbr.flex6 = nreno->css_baseline_minrtt; + /* We only need bottom 16 bits of flags */ + log.u_bbr.flex7 = nreno->newreno_flags & 0x0000ffff; + log.u_bbr.flex8 = mod; + log.u_bbr.epoch = nreno->css_current_round; + log.u_bbr.timeStamp = tcp_get_usecs(&tv); + log.u_bbr.lt_epoch = nreno->css_fas_at_css_entry; + log.u_bbr.pkts_out = nreno->css_last_fas; + log.u_bbr.delivered = nreno->css_lowrtt_fas; + TCP_LOG_EVENTP(tp, NULL, + &tp->t_inpcb->inp_socket->so_rcv, + &tp->t_inpcb->inp_socket->so_snd, + TCP_HYSTART, 0, + 0, &log, false, &tv); } +} + +static int +newreno_cb_init(struct cc_var *ccv) +{ + struct newreno *nreno; - return (nreno); + ccv->cc_data = NULL; + ccv->cc_data = malloc(sizeof(struct newreno), M_NEWRENO, M_NOWAIT); + if (ccv->cc_data == NULL) + return (ENOMEM); + nreno = (struct newreno *)ccv->cc_data; + /* NB: nreno is not zeroed, so initialise all fields. */ + nreno->beta = V_newreno_beta; + nreno->beta_ecn = V_newreno_beta_ecn; + /* + * We set the enabled flag so that if + * the socket option gets strobed and + * we have not hit a loss + */ + nreno->newreno_flags = CC_NEWRENO_HYSTART_ENABLED; + /* At init set both to infinity */ + nreno->css_lastround_minrtt = 0xffffffff; + nreno->css_current_round_minrtt = 0xffffffff; + nreno->css_current_round = 0; + nreno->css_baseline_minrtt = 0xffffffff; + nreno->css_rttsample_count = 0; + nreno->css_entered_at_round = 0; + nreno->css_fas_at_css_entry = 0; + nreno->css_lowrtt_fas = 0; + nreno->css_last_fas = 0; + return (0); } static void @@ -127,6 +208,9 @@ newreno_cb_destroy(struct cc_var *ccv) static void newreno_ack_received(struct cc_var *ccv, uint16_t type) { + struct newreno *nreno; + + nreno = (struct newreno *)ccv->cc_data; if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) && (ccv->flags & CCF_CWND_LIMITED)) { u_int cw = CCV(ccv, snd_cwnd); @@ -160,6 +244,16 @@ newreno_ack_received(struct cc_var *ccv, uint16_t type) * avoid capping cwnd. */ if (cw > CCV(ccv, snd_ssthresh)) { + if (nreno->newreno_flags & CC_NEWRENO_HYSTART_IN_CSS) { + /* + * We have slipped into CA with + * CSS active. Deactivate all. + */ + /* Turn off the CSS flag */ + nreno->newreno_flags &= ~CC_NEWRENO_HYSTART_IN_CSS; + /* Disable use of CSS in the future except long idle */ + nreno->newreno_flags &= ~CC_NEWRENO_HYSTART_ENABLED; + } if (V_tcp_do_rfc3465) { if (ccv->flags & CCF_ABC_SENTAWND) ccv->flags &= ~CCF_ABC_SENTAWND; @@ -184,12 +278,48 @@ newreno_ack_received(struct cc_var *ccv, uint16_t type) abc_val = ccv->labc; else abc_val = V_tcp_abc_l_var; + if ((nreno->newreno_flags & CC_NEWRENO_HYSTART_ALLOWED) && + (nreno->newreno_flags & CC_NEWRENO_HYSTART_ENABLED) && + ((nreno->newreno_flags & CC_NEWRENO_HYSTART_IN_CSS) == 0)) { + /* + * Hystart is allowed and still enabled and we are not yet + * in CSS. Lets check to see if we can make a decision on + * if we need to go into CSS. + */ + if ((nreno->css_rttsample_count >= hystart_n_rttsamples) && + (CCV(ccv, snd_cwnd) > + (hystart_lowcwnd * tcp_fixed_maxseg(ccv->ccvc.tcp)))) { + uint32_t rtt_thresh; + + /* Clamp (minrtt_thresh, lastround/8, maxrtt_thresh) */ + rtt_thresh = (nreno->css_lastround_minrtt >> 3); + if (rtt_thresh < hystart_minrtt_thresh) + rtt_thresh = hystart_minrtt_thresh; + if (rtt_thresh > hystart_maxrtt_thresh) + rtt_thresh = hystart_maxrtt_thresh; + newreno_log_hystart_event(ccv, nreno, 1, rtt_thresh); + if (nreno->css_current_round_minrtt >= (nreno->css_lastround_minrtt + rtt_thresh)) { + /* Enter CSS */ + nreno->newreno_flags |= CC_NEWRENO_HYSTART_IN_CSS; + nreno->css_fas_at_css_entry = nreno->css_lowrtt_fas; + nreno->css_baseline_minrtt = nreno->css_current_round_minrtt; + nreno->css_entered_at_round = nreno->css_current_round; + newreno_log_hystart_event(ccv, nreno, 2, rtt_thresh); + } + } + } if (CCV(ccv, snd_nxt) == CCV(ccv, snd_max)) incr = min(ccv->bytes_this_ack, ccv->nsegs * abc_val * CCV(ccv, t_maxseg)); else incr = min(ccv->bytes_this_ack, CCV(ccv, t_maxseg)); + + /* Only if Hystart is enabled will the flag get set */ + if (nreno->newreno_flags & CC_NEWRENO_HYSTART_IN_CSS) { + incr /= hystart_css_growth_div; + newreno_log_hystart_event(ccv, nreno, 3, incr); + } } /* ABC is on by default, so incr equals 0 frequently. */ if (incr > 0) @@ -201,8 +331,10 @@ newreno_ack_received(struct cc_var *ccv, uint16_t type) static void newreno_after_idle(struct cc_var *ccv) { + struct newreno *nreno; uint32_t rw; + nreno = (struct newreno *)ccv->cc_data; /* * If we've been idle for more than one retransmit timeout the old * congestion window is no longer current and we have to reduce it to @@ -226,6 +358,16 @@ newreno_after_idle(struct cc_var *ccv) CCV(ccv, snd_cwnd)-(CCV(ccv, snd_cwnd)>>2)); CCV(ccv, snd_cwnd) = min(rw, CCV(ccv, snd_cwnd)); + if ((nreno->newreno_flags & CC_NEWRENO_HYSTART_ENABLED) == 0) { + if (CCV(ccv, snd_cwnd) <= (hystart_lowcwnd * tcp_fixed_maxseg(ccv->ccvc.tcp))) { + /* + * Re-enable hystart if our cwnd has fallen below + * the hystart lowcwnd point. + */ + nreno->newreno_flags &= ~CC_NEWRENO_HYSTART_IN_CSS; + nreno->newreno_flags |= CC_NEWRENO_HYSTART_ENABLED; + } + } } /* @@ -240,15 +382,9 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) cwin = CCV(ccv, snd_cwnd); mss = tcp_fixed_maxseg(ccv->ccvc.tcp); - /* - * Other TCP congestion controls use newreno_cong_signal(), but - * with their own private cc_data. Make sure the cc_data is used - * correctly. - */ - nreno = (CC_ALGO(ccv->ccvc.tcp) == &newreno_cc_algo) ? ccv->cc_data : NULL; - beta = (nreno == NULL) ? V_newreno_beta : nreno->beta; - beta_ecn = (nreno == NULL) ? V_newreno_beta_ecn : nreno->beta_ecn; - + nreno = (struct newreno *) ccv->cc_data; + beta = nreno->beta; + beta_ecn = nreno->beta_ecn; /* * Note that we only change the backoff for ECN if the * global sysctl V_cc_do_abe is set the stack itself @@ -257,7 +393,7 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) */ if ((type == CC_ECN) && (V_cc_do_abe || - ((nreno != NULL) && (nreno->newreno_flags & CC_NEWRENO_BETA_ECN)))) + ((nreno != NULL) && (nreno->newreno_flags & CC_NEWRENO_BETA_ECN_ENABLED)))) factor = beta_ecn; else factor = beta; @@ -271,6 +407,11 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) switch (type) { case CC_NDUPACK: + if (nreno->newreno_flags & CC_NEWRENO_HYSTART_ENABLED) { + /* Make sure the flags are all off we had a loss */ + nreno->newreno_flags &= ~CC_NEWRENO_HYSTART_ENABLED; + nreno->newreno_flags &= ~CC_NEWRENO_HYSTART_IN_CSS; + } if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) { if (IN_CONGRECOVERY(CCV(ccv, t_flags) && V_cc_do_abe && V_cc_abe_frlossreduce)) { @@ -284,6 +425,11 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) } break; case CC_ECN: + if (nreno->newreno_flags & CC_NEWRENO_HYSTART_ENABLED) { + /* Make sure the flags are all off we had a loss */ + nreno->newreno_flags &= ~CC_NEWRENO_HYSTART_ENABLED; + nreno->newreno_flags &= ~CC_NEWRENO_HYSTART_IN_CSS; + } if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { CCV(ccv, snd_ssthresh) = cwin; CCV(ccv, snd_cwnd) = cwin; @@ -346,17 +492,10 @@ newreno_ctl_output(struct cc_var *ccv, struct sockopt *sopt, void *buf) if (CC_ALGO(ccv->ccvc.tcp) != &newreno_cc_algo) return (ENOPROTOOPT); - nreno = ccv->cc_data; + nreno = (struct newreno *)ccv->cc_data; opt = buf; - switch (sopt->sopt_dir) { case SOPT_SET: - /* We cannot set without cc_data memory. */ - if (nreno == NULL) { - nreno = newreno_malloc(ccv); - if (nreno == NULL) - return (ENOMEM); - } switch (opt->name) { case CC_NEWRENO_BETA: nreno->beta = opt->val; @@ -365,6 +504,19 @@ newreno_ctl_output(struct cc_var *ccv, struct sockopt *sopt, void *buf) if ((!V_cc_do_abe) && ((nreno->newreno_flags & CC_NEWRENO_BETA_ECN) == 0)) return (EACCES); nreno->beta_ecn = opt->val; + nreno->newreno_flags |= CC_NEWRENO_BETA_ECN_ENABLED; + break; + case CC_NEWRENO_ENABLE_HYSTART: + /* Allow hystart on this connection */ + if (opt->val != 0) { + nreno->newreno_flags |= CC_NEWRENO_HYSTART_ALLOWED; + if (opt->val > 1) + nreno->newreno_flags |= CC_NEWRENO_HYSTART_CAN_SH_CWND; + if (opt->val > 2) + nreno->newreno_flags |= CC_NEWRENO_HYSTART_CONS_SSTH; + } else + nreno->newreno_flags &= ~(CC_NEWRENO_HYSTART_ALLOWED|CC_NEWRENO_HYSTART_CAN_SH_CWND|CC_NEWRENO_HYSTART_CONS_SSTH); + newreno_log_hystart_event(ccv, nreno, 7, opt->val); break; default: return (ENOPROTOOPT); @@ -380,6 +532,17 @@ newreno_ctl_output(struct cc_var *ccv, struct sockopt *sopt, void *buf) opt->val = (nreno == NULL) ? V_newreno_beta_ecn : nreno->beta_ecn; break; + case CC_NEWRENO_ENABLE_HYSTART: + if (nreno->newreno_flags & CC_NEWRENO_HYSTART_ALLOWED) { + if (nreno->newreno_flags & CC_NEWRENO_HYSTART_CONS_SSTH) + opt->val = 3; + else if (nreno->newreno_flags & CC_NEWRENO_HYSTART_CAN_SH_CWND) + opt->val = 2; + else + opt->val = 1; + } else + opt->val = 0; + break; default: return (ENOPROTOOPT); } @@ -411,6 +574,78 @@ newreno_beta_handler(SYSCTL_HANDLER_ARGS) return (error); } +static void +newreno_newround(struct cc_var *ccv, uint32_t round_cnt) +{ + struct newreno *nreno; + + nreno = (struct newreno *)ccv->cc_data; + /* We have entered a new round */ + nreno->css_lastround_minrtt = nreno->css_current_round_minrtt; + nreno->css_current_round_minrtt = 0xffffffff; + nreno->css_rttsample_count = 0; + nreno->css_current_round = round_cnt; + if ((nreno->newreno_flags & CC_NEWRENO_HYSTART_IN_CSS) && + ((round_cnt - nreno->css_entered_at_round) >= hystart_css_rounds)) { + /* Enter CA */ + if (nreno->newreno_flags & CC_NEWRENO_HYSTART_CAN_SH_CWND) { + /* + * We engage more than snd_ssthresh, engage + * the brakes!! Though we will stay in SS to + * creep back up again, so lets leave CSS active + * and give us hystart_css_rounds more rounds. + */ + if (nreno->newreno_flags & CC_NEWRENO_HYSTART_CONS_SSTH) { + CCV(ccv, snd_ssthresh) = ((nreno->css_lowrtt_fas + nreno->css_fas_at_css_entry) / 2); + } else { + CCV(ccv, snd_ssthresh) = nreno->css_lowrtt_fas; + } + CCV(ccv, snd_cwnd) = nreno->css_fas_at_css_entry; + nreno->css_entered_at_round = round_cnt; + } else { + CCV(ccv, snd_ssthresh) = CCV(ccv, snd_cwnd); + /* Turn off the CSS flag */ + nreno->newreno_flags &= ~CC_NEWRENO_HYSTART_IN_CSS; + /* Disable use of CSS in the future except long idle */ + nreno->newreno_flags &= ~CC_NEWRENO_HYSTART_ENABLED; + } + newreno_log_hystart_event(ccv, nreno, 6, CCV(ccv, snd_ssthresh)); + } + newreno_log_hystart_event(ccv, nreno, 4, round_cnt); +} + +static void +newreno_rttsample(struct cc_var *ccv, uint32_t usec_rtt, uint32_t rxtcnt, uint32_t fas) +{ + struct newreno *nreno; + + nreno = (struct newreno *)ccv->cc_data; + if (rxtcnt > 1) { + /* + * Only look at RTT's that are non-ambiguous. + */ + return; + } + nreno->css_rttsample_count++; + nreno->css_last_fas = fas; + if (nreno->css_current_round_minrtt > usec_rtt) { + nreno->css_current_round_minrtt = usec_rtt; + nreno->css_lowrtt_fas = nreno->css_last_fas; + } + if ((nreno->newreno_flags & CC_NEWRENO_HYSTART_IN_CSS) && + (nreno->css_rttsample_count >= hystart_n_rttsamples) && + (nreno->css_baseline_minrtt > nreno->css_current_round_minrtt)) { + /* + * We were in CSS and the RTT is now less, we + * entered CSS erroneously. + */ + nreno->newreno_flags &= ~CC_NEWRENO_HYSTART_IN_CSS; + newreno_log_hystart_event(ccv, nreno, 8, nreno->css_baseline_minrtt); + nreno->css_baseline_minrtt = 0xffffffff; + } + newreno_log_hystart_event(ccv, nreno, 5, usec_rtt); +} + SYSCTL_DECL(_net_inet_tcp_cc_newreno); SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, newreno, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, @@ -426,5 +661,45 @@ SYSCTL_PROC(_net_inet_tcp_cc_newreno, OID_AUTO, beta_ecn, &VNET_NAME(newreno_beta_ecn), 3, &newreno_beta_handler, "IU", "New Reno beta ecn, specified as number between 1 and 100"); +SYSCTL_NODE(_net_inet_tcp_cc_newreno, OID_AUTO, hystartplusplus, + CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, + "New Reno related HyStart++ settings"); + +SYSCTL_UINT(_net_inet_tcp_cc_newreno_hystartplusplus, OID_AUTO, lowcwnd, + CTLFLAG_RW, + &hystart_lowcwnd, 16, + "The number of MSS in the CWND before HyStart++ is active"); + +SYSCTL_UINT(_net_inet_tcp_cc_newreno_hystartplusplus, OID_AUTO, minrtt_thresh, + CTLFLAG_RW, + &hystart_minrtt_thresh, 4000, + "HyStarts++ minimum RTT thresh used in clamp (in microseconds)"); + +SYSCTL_UINT(_net_inet_tcp_cc_newreno_hystartplusplus, OID_AUTO, maxrtt_thresh, + CTLFLAG_RW, + &hystart_maxrtt_thresh, 16000, + "HyStarts++ maximum RTT thresh used in clamp (in microseconds)"); + +SYSCTL_UINT(_net_inet_tcp_cc_newreno_hystartplusplus, OID_AUTO, n_rttsamples, + CTLFLAG_RW, + &hystart_n_rttsamples, 8, + "The number of RTT samples that must be seen to consider HyStart++"); + +SYSCTL_UINT(_net_inet_tcp_cc_newreno_hystartplusplus, OID_AUTO, css_growth_div, + CTLFLAG_RW, + &hystart_css_growth_div, 4, + "The divisor to the growth when in Hystart++ CSS"); + +SYSCTL_UINT(_net_inet_tcp_cc_newreno_hystartplusplus, OID_AUTO, css_rounds, + CTLFLAG_RW, + &hystart_css_rounds, 5, + "The number of rounds HyStart++ lasts in CSS before falling to CA"); + +SYSCTL_UINT(_net_inet_tcp_cc_newreno_hystartplusplus, OID_AUTO, bblogs, + CTLFLAG_RW, + &hystart_bblogs, 0, + "Do we enable HyStart++ Black Box logs to be generated if BB logging is on"); + + DECLARE_CC_MODULE(newreno, &newreno_cc_algo); MODULE_VERSION(newreno, 1); diff --git a/sys/netinet/cc/cc_newreno.h b/sys/netinet/cc/cc_newreno.h index 16cf1757e830..42c41c7db287 100644 --- a/sys/netinet/cc/cc_newreno.h +++ b/sys/netinet/cc/cc_newreno.h @@ -35,6 +35,15 @@ struct newreno { uint32_t beta; uint32_t beta_ecn; uint32_t newreno_flags; + uint32_t css_baseline_minrtt; + uint32_t css_current_round_minrtt; + uint32_t css_lastround_minrtt; + uint32_t css_rttsample_count; + uint32_t css_entered_at_round; + uint32_t css_current_round; + uint32_t css_fas_at_css_entry; + uint32_t css_lowrtt_fas; + uint32_t css_last_fas; }; struct cc_newreno_opts { @@ -42,6 +51,15 @@ struct cc_newreno_opts { uint32_t val; }; -#define CC_NEWRENO_BETA 1 /* Beta for normal DUP-ACK/Sack recovery */ -#define CC_NEWRENO_BETA_ECN 2 /* ECN Beta for Abe */ +#define CC_NEWRENO_BETA 1 /* Beta for normal DUP-ACK/Sack recovery */ +#define CC_NEWRENO_BETA_ECN 2 /* ECN Beta for Abe */ +#define CC_NEWRENO_ENABLE_HYSTART 3 /* Enable hystart */ + +/* Flags values */ +#define CC_NEWRENO_HYSTART_ALLOWED 0x0001 /* Does the tcp connection allow hystart? */ +#define CC_NEWRENO_HYSTART_ENABLED 0x0002 /* We can do hystart, a loss removes this flag */ +#define CC_NEWRENO_HYSTART_IN_CSS 0x0004 /* If we enter hystart CSS this flag is set */ +#define CC_NEWRENO_HYSTART_CAN_SH_CWND 0x0008 /* Can hystart when going CSS -> CA slam the cwnd */ +#define CC_NEWRENO_HYSTART_CONS_SSTH 0x0010 /* Should hystart use the more conservative sstrhesh */ +#define CC_NEWRENO_BETA_ECN_ENABLED 0x0020 #endif /* _CC_NEWRENO_H */ diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index 29c1e376c8de..e7c47e85bb7b 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -310,7 +310,7 @@ struct tcphdr { #define TCP_RACK_PACING_BETA_ECN 1139 /* Changing the beta for ecn with pacing */ #define TCP_RACK_TIMER_SLOP 1140 /* Set or get the timer slop used */ #define TCP_RACK_DSACK_OPT 1141 /* How do we setup rack timer DSACK options bit 1/2 */ - +#define TCP_RACK_ENABLE_HYSTART 1142 /* Do we allow hystart in the CC modules */ /* Start of reserved space for third-party user-settable options. */ #define TCP_VENDOR SO_VENDOR diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h index 2203fd061213..820f345a758f 100644 --- a/sys/netinet/tcp_log_buf.h +++ b/sys/netinet/tcp_log_buf.h @@ -235,7 +235,8 @@ enum tcp_log_events { TCP_LOG_ACCOUNTING, /* Log of TCP Accounting data 62 */ TCP_LOG_FSB, /* FSB information 63 */ RACK_DSACK_HANDLING, /* Handling of DSACK in rack for reordering window 64 */ - TCP_LOG_END /* End (keep at end) 65 */ + TCP_HYSTART, /* TCP Hystart logging 65 */ + TCP_LOG_END /* End (keep at end) 66 */ }; enum tcp_log_states { diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 00f830caf217..059c7d26d81e 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -204,6 +204,7 @@ static int32_t rack_hw_rate_to_low = 0; /* 1200000; */ static int32_t rack_hw_up_only = 1; static int32_t rack_stats_gets_ms_rtt = 1; static int32_t rack_prr_addbackmax = 2; +static int32_t rack_do_hystart = 0; static int32_t rack_pkt_delay = 1000; static int32_t rack_send_a_lot_in_prr = 1; @@ -624,7 +625,7 @@ rack_set_cc_pacing(struct tcp_rack *rack) * Hack alert we need to set in our newreno_flags * so that Abe behavior is also applied. */ - ((struct newreno *)tp->ccv->cc_data)->newreno_flags = CC_NEWRENO_BETA_ECN; + ((struct newreno *)tp->ccv->cc_data)->newreno_flags |= CC_NEWRENO_BETA_ECN_ENABLED; opt.name = CC_NEWRENO_BETA_ECN; opt.val = rack->r_ctl.rc_saved_beta.beta_ecn; error = CC_ALGO(tp)->ctl_output(tp->ccv, &sopt, &opt); @@ -835,6 +836,7 @@ rack_init_sysctls(void) struct sysctl_oid *rack_timers; struct sysctl_oid *rack_tlp; struct sysctl_oid *rack_misc; + struct sysctl_oid *rack_features; struct sysctl_oid *rack_measure; struct sysctl_oid *rack_probertt; struct sysctl_oid *rack_hw_pacing; @@ -1362,6 +1364,43 @@ rack_init_sysctls(void) OID_AUTO, "min_measure_tim", CTLFLAG_RW, &rack_min_measure_usec, 0, "What is the Minimum time time for a measurement if 0, this is off"); + /* Features */ + rack_features = SYSCTL_ADD_NODE(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_sysctl_root), + OID_AUTO, + "features", + CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Feature controls"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_features), + OID_AUTO, "cmpack", CTLFLAG_RW, + &rack_use_cmp_acks, 1, + "Should RACK have LRO send compressed acks"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_features), + OID_AUTO, "fsb", CTLFLAG_RW, + &rack_use_fsb, 1, + "Should RACK use the fast send block?"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_features), + OID_AUTO, "rfo", CTLFLAG_RW, + &rack_use_rfo, 1, + "Should RACK use rack_fast_output()?"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_features), + OID_AUTO, "rsmrfo", CTLFLAG_RW, + &rack_use_rsm_rfo, 1, + "Should RACK use rack_fast_rsm_output()?"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_features), + OID_AUTO, "non_paced_lro_queue", CTLFLAG_RW, + &rack_enable_mqueue_for_nonpaced, 0, + "Should RACK use mbuf queuing for non-paced connections"); + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_features), + OID_AUTO, "hystartplusplus", CTLFLAG_RW, + &rack_do_hystart, 0, + "Should RACK enable HyStart++ on connections?"); /* Misc rack controls */ rack_misc = SYSCTL_ADD_NODE(&rack_sysctl_ctx, SYSCTL_CHILDREN(rack_sysctl_root), @@ -1376,7 +1415,6 @@ rack_init_sysctls(void) &rack_tcp_accounting, 0, "Should we turn on TCP accounting for all rack sessions?"); #endif - SYSCTL_ADD_S32(&rack_sysctl_ctx, SYSCTL_CHILDREN(rack_misc), OID_AUTO, "rack_dsack_ctl", CTLFLAG_RW, @@ -1402,26 +1440,6 @@ rack_init_sysctls(void) OID_AUTO, "defprofile", CTLFLAG_RW, &rack_def_profile, 0, "Should RACK use a default profile (0=no, num == profile num)?"); - SYSCTL_ADD_S32(&rack_sysctl_ctx, - SYSCTL_CHILDREN(rack_misc), - OID_AUTO, "cmpack", CTLFLAG_RW, - &rack_use_cmp_acks, 1, - "Should RACK have LRO send compressed acks"); - SYSCTL_ADD_S32(&rack_sysctl_ctx, - SYSCTL_CHILDREN(rack_misc), - OID_AUTO, "fsb", CTLFLAG_RW, - &rack_use_fsb, 1, - "Should RACK use the fast send block?"); - SYSCTL_ADD_S32(&rack_sysctl_ctx, - SYSCTL_CHILDREN(rack_misc), - OID_AUTO, "rfo", CTLFLAG_RW, - &rack_use_rfo, 1, - "Should RACK use rack_fast_output()?"); - SYSCTL_ADD_S32(&rack_sysctl_ctx, - SYSCTL_CHILDREN(rack_misc), - OID_AUTO, "rsmrfo", CTLFLAG_RW, - &rack_use_rsm_rfo, 1, - "Should RACK use rack_fast_rsm_output()?"); SYSCTL_ADD_S32(&rack_sysctl_ctx, SYSCTL_CHILDREN(rack_misc), OID_AUTO, "shared_cwnd", CTLFLAG_RW, @@ -1432,11 +1450,6 @@ rack_init_sysctls(void) OID_AUTO, "limits_on_scwnd", CTLFLAG_RW, &rack_limits_scwnd, 1, "Should RACK place low end time limits on the shared cwnd feature"); - SYSCTL_ADD_S32(&rack_sysctl_ctx, - SYSCTL_CHILDREN(rack_misc), - OID_AUTO, "non_paced_lro_queue", CTLFLAG_RW, - &rack_enable_mqueue_for_nonpaced, 0, - "Should RACK use mbuf queuing for non-paced connections"); SYSCTL_ADD_S32(&rack_sysctl_ctx, SYSCTL_CHILDREN(rack_misc), OID_AUTO, "iMac_dack", CTLFLAG_RW, @@ -6139,6 +6152,7 @@ rack_clone_rsm(struct tcp_rack *rack, struct rack_sendmap *nrsm, nrsm->r_dupack = rsm->r_dupack; nrsm->r_no_rtt_allowed = rsm->r_no_rtt_allowed; nrsm->r_rtr_bytes = 0; + nrsm->r_fas = rsm->r_fas; rsm->r_end = nrsm->r_start; nrsm->r_just_ret = rsm->r_just_ret; for (idx = 0; idx < nrsm->r_rtr_cnt; idx++) { @@ -7260,6 +7274,12 @@ rack_update_rsm(struct tcpcb *tp, struct tcp_rack *rack, } idx = rsm->r_rtr_cnt - 1; rsm->r_tim_lastsent[idx] = ts; + /* + * Here we don't add in the len of send, since its already + * in snduna <->snd_max. + */ + rsm->r_fas = ctf_flight_size(rack->rc_tp, + rack->r_ctl.rc_sacked); stripped_flags = rsm->r_flags & ~(RACK_SENT_SP|RACK_SENT_FP); if (rsm->r_flags & RACK_ACKED) { /* Problably MTU discovery messing with us */ @@ -7479,6 +7499,13 @@ again: */ rsm->m = s_mb; rsm->soff = s_moff; + /* + * Here we do add in the len of send, since its not yet + * reflected in in snduna <->snd_max + */ + rsm->r_fas = (ctf_flight_size(rack->rc_tp, + rack->r_ctl.rc_sacked) + + (rsm->r_end - rsm->r_start)); /* rsm->m will be NULL if RACK_HAS_SYN or RACK_HAS_FIN is set */ if (rsm->m) { if (rsm->m->m_len <= rsm->soff) { @@ -7927,6 +7954,7 @@ static int rack_update_rtt(struct tcpcb *tp, struct tcp_rack *rack, struct rack_sendmap *rsm, struct tcpopt *to, uint32_t cts, int32_t ack_type, tcp_seq th_ack) { + uint32_t us_rtt; int32_t i, all; uint32_t t, len_acked; @@ -7951,7 +7979,6 @@ rack_update_rtt(struct tcpcb *tp, struct tcp_rack *rack, all = 0; } if (rsm->r_rtr_cnt == 1) { - uint32_t us_rtt; t = cts - (uint32_t)rsm->r_tim_lastsent[(rsm->r_rtr_cnt - 1)]; if ((int)t <= 0) @@ -7971,6 +7998,10 @@ rack_update_rtt(struct tcpcb *tp, struct tcp_rack *rack, us_rtt = tcp_get_usecs(NULL) - (uint32_t)rsm->r_tim_lastsent[(rsm->r_rtr_cnt-1)]; if (us_rtt == 0) us_rtt = 1; + if (CC_ALGO(tp)->rttsample != NULL) { + /* Kick the RTT to the CC */ + CC_ALGO(tp)->rttsample(tp->ccv, us_rtt, 1, rsm->r_fas); + } rack_apply_updated_usrtt(rack, us_rtt, tcp_tv_to_usectick(&rack->r_ctl.act_rcv_time)); if (ack_type == SACKED) { rack_log_rtt_sample_calc(rack, t, (uint32_t)rsm->r_tim_lastsent[(rsm->r_rtr_cnt - 1)], cts, 1); @@ -8057,12 +8088,29 @@ rack_update_rtt(struct tcpcb *tp, struct tcp_rack *rack, t = cts - (uint32_t)rsm->r_tim_lastsent[i]; if ((int)t <= 0) t = 1; + if (CC_ALGO(tp)->rttsample != NULL) { + /* + * Kick the RTT to the CC, here + * we lie a bit in that we know the + * retransmission is correct even though + * we retransmitted. This is because + * we match the timestamps. + */ + if (TSTMP_GT(tcp_tv_to_usectick(&rack->r_ctl.act_rcv_time), rsm->r_tim_lastsent[i])) + us_rtt = tcp_tv_to_usectick(&rack->r_ctl.act_rcv_time) - (uint32_t)rsm->r_tim_lastsent[i]; + else + us_rtt = tcp_get_usecs(NULL) - (uint32_t)rsm->r_tim_lastsent[i]; + CC_ALGO(tp)->rttsample(tp->ccv, us_rtt, 1, rsm->r_fas); + } if ((i + 1) < rsm->r_rtr_cnt) { /* * The peer ack'd from our previous * transmission. We have a spurious * retransmission and thus we dont * want to update our rack_rtt. + * + * Hmm should there be a CC revert here? + * */ return (0); } @@ -12548,10 +12596,11 @@ rack_init(struct tcpcb *tp) rack->r_ctl.rc_saved_beta.beta = V_newreno_beta_ecn; rack->r_ctl.rc_saved_beta.beta_ecn = V_newreno_beta_ecn; /* We want abe like behavior as well */ - rack->r_ctl.rc_saved_beta.newreno_flags = CC_NEWRENO_BETA_ECN; + rack->r_ctl.rc_saved_beta.newreno_flags |= CC_NEWRENO_BETA_ECN_ENABLED; rack->r_ctl.rc_reorder_fade = rack_reorder_fade; rack->rc_allow_data_af_clo = rack_ignore_data_after_close; rack->r_ctl.rc_tlp_threshold = rack_tlp_thresh; + rack->r_ctl.roundends = tp->snd_max; if (use_rack_rr) rack->use_rack_rr = 1; if (V_tcp_delack_enabled) @@ -12730,6 +12779,17 @@ rack_init(struct tcpcb *tp) */ rack_convert_rtts(tp); tp->t_rttlow = TICKS_2_USEC(tp->t_rttlow); + if (rack_do_hystart) { + struct sockopt sopt; + struct cc_newreno_opts opt; + + sopt.sopt_valsize = sizeof(struct cc_newreno_opts); + sopt.sopt_dir = SOPT_SET; + opt.name = CC_NEWRENO_ENABLE_HYSTART; + opt.val = rack_do_hystart; + if (CC_ALGO(tp)->ctl_output != NULL) + (void)CC_ALGO(tp)->ctl_output(tp->ccv, &sopt, &opt); + } if (rack_def_profile) rack_set_profile(rack, rack_def_profile); /* Cancel the GP measurement in progress */ @@ -13576,6 +13636,13 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mb (((ae->ack - high_seq) + segsiz - 1) / segsiz)); #endif high_seq = ae->ack; + if (SEQ_GEQ(high_seq, rack->r_ctl.roundends)) { + rack->r_ctl.current_round++; + rack->r_ctl.roundends = tp->snd_max; + if (CC_ALGO(tp)->newround != NULL) { + CC_ALGO(tp)->newround(tp->ccv, rack->r_ctl.current_round); + } + } /* Setup our act_rcv_time */ if ((ae->flags & TSTMP_LRO) || (ae->flags & TSTMP_HDWR)) { ts.tv_sec = ae->timestamp / 1000000000; @@ -14464,6 +14531,14 @@ do_output_now: rack_start_hpts_timer(rack, tp, cts, 0, 0, 0); rack_free_trim(rack); } + /* Update any rounds needed */ + if (SEQ_GEQ(tp->snd_una, rack->r_ctl.roundends)) { + rack->r_ctl.current_round++; + rack->r_ctl.roundends = tp->snd_max; + if (CC_ALGO(tp)->newround != NULL) { + CC_ALGO(tp)->newround(tp->ccv, rack->r_ctl.current_round); + } + } if ((nxt_pkt == 0) && ((rack->r_ctl.rc_hpts_flags & PACE_TMR_MASK) == 0) && (SEQ_GT(tp->snd_max, tp->snd_una) || @@ -16936,7 +17011,6 @@ again: goto just_return_nolock; } rsm = TAILQ_FIRST(&rack->r_ctl.rc_tmap); - KASSERT(rsm != NULL, ("rsm is NULL rack:%p r_must_retran set", rack)); if (rsm == NULL) { /* TSNH */ rack->r_must_retran = 0; @@ -19565,7 +19639,7 @@ rack_process_option(struct tcpcb *tp, struct tcp_rack *rack, int sopt_name, * rack pcb storage. */ rack->r_ctl.rc_saved_beta.beta_ecn = optval; - rack->r_ctl.rc_saved_beta.newreno_flags = CC_NEWRENO_BETA_ECN; + rack->r_ctl.rc_saved_beta.newreno_flags = CC_NEWRENO_BETA_ECN_ENABLED; } break; case TCP_DEFER_OPTIONS: @@ -19998,6 +20072,21 @@ rack_process_option(struct tcpcb *tp, struct tcp_rack *rack, int sopt_name, RACK_OPTS_INC(tcp_rack_early_seg); rack->r_ctl.rc_early_recovery_segs = optval; break; + case TCP_RACK_ENABLE_HYSTART: + { + struct sockopt sopt; + struct cc_newreno_opts opt; + + sopt.sopt_valsize = sizeof(struct cc_newreno_opts); + sopt.sopt_dir = SOPT_SET; + opt.name = CC_NEWRENO_ENABLE_HYSTART; + opt.val = optval; + if (CC_ALGO(tp)->ctl_output != NULL) + error = CC_ALGO(tp)->ctl_output(tp->ccv, &sopt, &opt); + else + error = EINVAL; + } + break; case TCP_RACK_REORD_THRESH: /* RACK reorder threshold (shift amount) */ RACK_OPTS_INC(tcp_rack_reord_thresh); @@ -20210,6 +20299,7 @@ rack_set_sockopt(struct socket *so, struct sockopt *sopt, case TCP_RACK_PACING_BETA: /* URL:pacing_beta */ case TCP_RACK_PACING_BETA_ECN: /* URL:pacing_beta_ecn */ case TCP_RACK_TIMER_SLOP: /* URL:timer_slop */ + case TCP_RACK_ENABLE_HYSTART: /* URL:hystart */ break; default: /* Filter off all unknown options to the base stack */ @@ -20394,6 +20484,21 @@ rack_get_sockopt(struct socket *so, struct sockopt *sopt, optval |= 2; } break; + case TCP_RACK_ENABLE_HYSTART: + { + struct sockopt sopt; + struct cc_newreno_opts opt; + + sopt.sopt_valsize = sizeof(struct cc_newreno_opts); + sopt.sopt_dir = SOPT_GET; + opt.name = CC_NEWRENO_ENABLE_HYSTART; + if (CC_ALGO(tp)->ctl_output != NULL) + error = CC_ALGO(tp)->ctl_output(tp->ccv, &sopt, &opt); + else + error = EINVAL; + optval = opt.val; + } + break; case TCP_FAST_RSM_HACK: optval = rack->fast_rsm_hack; break; diff --git a/sys/netinet/tcp_stacks/tcp_rack.h b/sys/netinet/tcp_stacks/tcp_rack.h index 71c7c692ef52..0ada2116dc6f 100644 --- a/sys/netinet/tcp_stacks/tcp_rack.h +++ b/sys/netinet/tcp_stacks/tcp_rack.h @@ -73,6 +73,7 @@ struct rack_sendmap { uint64_t r_tim_lastsent[RACK_NUM_OF_RETRANS]; uint64_t r_ack_arrival; /* This is the time of ack-arrival (if SACK'd) */ RB_ENTRY(rack_sendmap) r_next; /* RB Tree next */ + uint32_t r_fas; /* Flight at send */ }; struct deferred_opt_list { @@ -465,6 +466,8 @@ struct rack_control { uint32_t rc_loss_at_start; /* At measurement window where was our lost value */ uint32_t dsack_round_end; /* In a round of seeing a DSACK */ + uint32_t current_round; /* Starting at zero */ + uint32_t roundends; /* acked value above which round ends */ uint32_t num_dsack; /* Count of dsack's seen (1 per window)*/ uint32_t forced_ack_ts; uint32_t rc_lower_rtt_us_cts; /* Time our GP rtt was last lowered */ From nobody Fri Oct 22 13:17:40 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 65CB318172A3 for ; Fri, 22 Oct 2021 13:17:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-vk1-xa2b.google.com (mail-vk1-xa2b.google.com [IPv6:2607:f8b0:4864:20::a2b]) (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 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HbPzN27fvz4rKX for ; Fri, 22 Oct 2021 13:17:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-vk1-xa2b.google.com with SMTP id ba39so1443718vkb.11 for ; Fri, 22 Oct 2021 06:17:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ipdlCUY0j7C2wiQxXFY6vxLnxrQXShsrws5cLOmW9tU=; b=YdsPdpnCyBklkV4EqGOmKXdQabh/z/JRvtrdfb+obJ8EGDbp/Lr27+WmeQu1PRiGLV JIj8ngxLLAzYaKBNkur4PPyUYkWmOzLgWkUqfqht3SxStkdYMLFQVf4nvg406Srvq+v/ 7il3Eiohp5R/KlNvOxIGeg0P53I888xyhtI4Wp2jMl0kiaZcpyWkyIEV8QW/rTR2W748 Wd1k1gP/JUME3hXda55BsaSk2XSKAVseG4m/IHkbuFhWlh8QO6Pt/oPiaIgrzk+MPpo6 JVtAFgznX270OmzA3G7M/N723xhoGa6TCbblvSD64KQo9WMRh8yvujf1gOxmcUZhcCnm jOgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ipdlCUY0j7C2wiQxXFY6vxLnxrQXShsrws5cLOmW9tU=; b=e4zKXLd7lJO3tAeTda0P2K0Ge/ne7q/MGZIIPjZ+P9xPV65bceEZC3LpUP0+Afn9/K FKF1b8bOqWKqvyUryT5zLj/9ExgGl4FYcaPjn98/V4fBj02sXX1NYAjSY0aRR+YxevuQ ywRqIq6AgYezsiv4WHssS7+HtvqHd32dv4lqQBwdSUS+PyqbBh8r+UnW32ssbgoS5F5F Vne8RHW/00GVKk6VJe5QLWarSvVjuxUIMHVn6A74QH4638ZITewutGXWfpn3yTHoNdFy FA0zHsxY7lvMrkOI3FHywT0h4BPLGO8yWmS+jbbWX3+dmFdgX5tu2Wm1520WMn8vLXYv HRKA== X-Gm-Message-State: AOAM533yGt8u0sUsSIa2X/razZhgTDDJXcJhaBGH5OAinAa1bx9fPYIa mA2AN4W+hYtPWQqkBoi2xFsgmezqvZZDdfam/xAqjw== X-Google-Smtp-Source: ABdhPJxQcx6znsxiJKmd6/sKFwvO/7Ups7G2imjA7C1CI1XdhKS/ATykjntCSZ0emSeA1W3GK51i291H2v9Gd8iAN7k= X-Received: by 2002:a05:6122:180d:: with SMTP id ay13mr14469572vkb.21.1634908671487; Fri, 22 Oct 2021 06:17:51 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> <20211021080214.GB77338@zxy.spb.ru> <99e7aecf-9ab7-8b8f-ff30-b5fce3e031c2@FreeBSD.org> In-Reply-To: From: Warner Losh Date: Fri, 22 Oct 2021 07:17:40 -0600 Message-ID: Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default To: Alexey Dokuchaev Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000009ac35705cef0d6a7" X-Rspamd-Queue-Id: 4HbPzN27fvz4rKX X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N --0000000000009ac35705cef0d6a7 Content-Type: text/plain; charset="UTF-8" On Fri, Oct 22, 2021 at 12:28 AM Alexey Dokuchaev wrote: > > This is not how it works Warner, you don't first offer biased poll > and then defend skewed results by appealing to observed ratio and > how smart your target audience is. > Infinitely criticizing things isn't how it works Alexey. Data is always imperfect. Don't like it? Do better yourself. Warner --0000000000009ac35705cef0d6a7-- From nobody Fri Oct 22 13:33:30 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A874317F589E; Fri, 22 Oct 2021 13:33: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 4HbQKQ40zRz4vmM; Fri, 22 Oct 2021 13:33: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 6915B78C2; Fri, 22 Oct 2021 13:33: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 19MDXUne018818; Fri, 22 Oct 2021 13:33:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19MDXUd8018817; Fri, 22 Oct 2021 13:33:30 GMT (envelope-from git) Date: Fri, 22 Oct 2021 13:33:30 GMT Message-Id: <202110221333.19MDXUd8018817@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: d7acbe481d17 - main - vm_page: Break reservations to handle noobj allocations List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: d7acbe481d17ccb81c2b879b9731c83b018f3094 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d7acbe481d17ccb81c2b879b9731c83b018f3094 commit d7acbe481d17ccb81c2b879b9731c83b018f3094 Author: Mark Johnston AuthorDate: 2021-10-21 15:46:25 +0000 Commit: Mark Johnston CommitDate: 2021-10-22 13:25:59 +0000 vm_page: Break reservations to handle noobj allocations vm_reserv_reclaim_*() will release pages to the default freepool, not the direct freepool from which noobj allocations are drawn. But if both pools are empty, the noobj allocator variants must break reservations to make progress. Reported by: cy Reviewed by: kib (previous version) Fixes: b498f71bc56a ("vm_page: Add a new page allocator interface for unnamed pages") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32592 --- sys/vm/vm_page.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index eca5d0801b7f..76e9ba4db403 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -2409,8 +2409,14 @@ again: m = vm_phys_alloc_freelist_pages(domain, freelist, VM_FREEPOOL_DIRECT, 0); vm_domain_free_unlock(vmd); - if (m == NULL) + if (m == NULL) { vm_domain_freecnt_inc(vmd, 1); +#if VM_NRESERVLEVEL > 0 + if (freelist == VM_NFREELIST && + vm_reserv_reclaim_inactive(domain)) + goto again; +#endif + } } if (m == NULL) { if (vm_domain_alloc_fail(vmd, NULL, req)) @@ -2540,6 +2546,11 @@ again: vm_domain_free_unlock(vmd); if (m_ret == NULL) { vm_domain_freecnt_inc(vmd, npages); +#if VM_NRESERVLEVEL > 0 + if (vm_reserv_reclaim_contig(domain, npages, low, + high, alignment, boundary)) + goto again; +#endif } } if (m_ret == NULL) { From nobody Fri Oct 22 13:42:29 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A7FE51801E81 for ; Fri, 22 Oct 2021 13:42:36 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) (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 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HbQWw3N4tz4y76 for ; Fri, 22 Oct 2021 13:42:36 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt1-x836.google.com with SMTP id b12so3528951qtq.3 for ; Fri, 22 Oct 2021 06:42:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=bbBhz+WT/CMfj5LNNucyzJiBBbtXRmd8LesgYEolwk4=; b=XoeGljw25Lp5g1mXXka6VtB632bau0cV2r9Q/batxMS2Ptj511SeZjKTNnB/WasIY9 eR2nm9PrldKzI7PLOQqb00UOlvW7qMNmV2OHz7QbXmn4Wsd8qE91NywMxpK2b0D/basm JF6NiTio0ihvloDZQhAcIYaK4+kZwcZVS/Qk/wclZ0v5iHuiKKL+eizZhMz2BQTYgz5v cq002wtuBzZUE/U4AJmdxpm5KhylCPUgNHlKvUQ6xGTnGpt+Wtxfwovbl9Ii09EzVwnp xK++OY/5mtqyftGxUZR09bUGmfahA71I1BHlQn6zlCbmT4aPKCaP/1AfLN6TsTtCWa2o MZ8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=bbBhz+WT/CMfj5LNNucyzJiBBbtXRmd8LesgYEolwk4=; b=eGHooqtwXf7PpzdWUUrky+sBQVYZQ+7grLyCWH5L6Yv6Lxvq+7wmdvLDRbZvHSghX1 m/D/5HwXO8+M09GqUe60WCHchcTZ67y0LLDQZbtDASgjLILBSSvmhJRN2ULW3Qrt7lkY PgQ27eCuXpDzRtAR8rIaQHReUcWojkSxYzSPfrHzkwXwpGgs/caTguumDP7OAKSBTVT4 vhZn3vQRMUS1SPA7kyQ1Ea8qJSOkfm+8yLk5HNaOJruYAvcEUqWF4CXs8qPmvmKDFEDw orUxKX0ftd9yz9QNRMdxay0b+EvVESfur9N+Y+kTdcj0H54kKPEempjL3Bbi6hzpmfH1 pdxA== X-Gm-Message-State: AOAM530LlIbhDC95YIAah+bp3OhrowMA9KFE+dtAUy6fk2OeUVjaQv1E AygnxPC66MomeXnd0Qc3l2LpBw== X-Google-Smtp-Source: ABdhPJyxMGSekpxuHbqdXTbBuIh7+TpK00A8I0isXTEWP0RSn536Nmi8KPWTQch1fJMfLkmfqu+4iw== X-Received: by 2002:ac8:5f91:: with SMTP id j17mr13547409qta.138.1634910150339; Fri, 22 Oct 2021 06:42:30 -0700 (PDT) Received: from mutt-hbsd (pool-100-16-224-136.bltmmd.fios.verizon.net. [100.16.224.136]) by smtp.gmail.com with ESMTPSA id 74sm4093165qke.109.2021.10.22.06.42.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Oct 2021 06:42:29 -0700 (PDT) Date: Fri, 22 Oct 2021 09:42:29 -0400 From: Shawn Webb To: Warner Losh Cc: Alexey Dokuchaev , src-committers , "" , dev-commits-src-main@freebsd.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: <20211022134229.jrkkgahnu6bz2aec@mutt-hbsd> X-Operating-System: FreeBSD mutt-hbsd 14.0-CURRENT-HBSD FreeBSD 14.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> <20211021080214.GB77338@zxy.spb.ru> <99e7aecf-9ab7-8b8f-ff30-b5fce3e031c2@FreeBSD.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cqp53tsgsjljfk5g" Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4HbQWw3N4tz4y76 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N --cqp53tsgsjljfk5g Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 21, 2021 at 10:55:00PM -0600, Warner Losh wrote: > On Thu, Oct 21, 2021 at 9:17 PM Alexey Dokuchaev wrot= e: >=20 > > On Thu, Oct 21, 2021 at 01:52:26PM -0600, Warner Losh wrote: > > > This discussion to date has been data free. I created a poll... > > > > > > https://twitter.com/bsdimp/status/1451274644439265308 > > > > You couldn't use neutral wording, could you? The poll is loaded > > with bias, this is not the way to collect answers. FWIW, FreeBSD > > itself does not make "loud, annoying noise", it simply instructs > > the underlying hardware to beep. You've asked if people enjoy > > loud, annoying beeps -- well, nobody does, but that's not what > > we're discussing here. > > > P.S. We likely should fix this bug, and also change the note to 880, which > is > A5 (the second A above middle C). Please see > https://reviews.freebsd.org/D32594 > for a fix for the bug I found here. Tangentially related for curious minds: Tom Scott did a video in 2014 about how the types of trucks that beep when reversing are changing from the traditional beep to a white noise type of beep: https://www.youtube.com/watch?v=3Dfa28lIGuxq8 --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --cqp53tsgsjljfk5g Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmFyv8IACgkQ/y5nonf4 4frlew/+LbAe/krwG273WNnMEFJwAKldY0cIStpX8Sit00gSJbEIZpn1pejT8xL6 nf7yWWN3Bb7/WAhVUD6nQQUTb8wdKz6oS8bClP94I+BX03FpbJHnWe2CgthnZ7rS GJli4totuc+/T9ZKwoQiFr67iEYHJ8sDz3uQhv2hT05KVnDY7bR6E8UoEjGxXccN /Mn7WSQkopipJN3j6LEX5b+hlwgiZt32pnE3cdjxkXSllnEvAcz4cMFQ4KpVGaqN 6JwNoNOa3JsX4lgvn7cyjr8+gxoSfSix/2UkkdGnqu34/H6hy8uSY6ihG6PME/qZ 0USfjkQbBjr07+rhy0UHBqPBY27+Rtb+wab1Upx/3o4qdxObSynFP1AfRFFYcogF u9dkAVNcQGp6kwCP0ptnoaZC6MDCAXgZ7jK1YIKUe98oR0cp5t0HYu4UNdeqHfAu v68i5xEqxilRJXajpR56ZkDolYERRPe2DVD0KNs4sTZ550VNrNsuwUh8KlLIHv2l nUhav2aYgIB3b3iODfF0pNV3FrHrgtx9rjQt++daHz97B3vng/AsmU4ryVv8+0aI ACJOCdiXHh2e0nnDPQ7zEk88EwW0IPbSaBomhd26Oy8MGsxUqI2MR+RtE1d9pTOd n7k7lo+mOEGXMFqRLKFT3iHKIl9SWli1NrkAwMdKejv+JLj/bhU= =c0fF -----END PGP SIGNATURE----- --cqp53tsgsjljfk5g-- From nobody Fri Oct 22 15:55:04 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E5A711814A68; Fri, 22 Oct 2021 15:55:08 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) (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 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HbTSr0rJgz3v1M; Fri, 22 Oct 2021 15:55:08 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x830.google.com with SMTP id y11so3868710qtn.13; Fri, 22 Oct 2021 08:55:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=rQIX1ZNv69UapXkXdQ4X1hOjCxYLoCsgSmH11Lr2URc=; b=phZCXjXtaCXTU56ZJK/t3qIRZe2uWvRGILp34xToFqlBgNvVEG121eG6ZoghmwW/FR z4BYERaYGsC3R0fuI8q36wTU4OaMPlTw2DU9EberMyEsZ6aRjXDJgnyZwKQsxygJ7qww 26XI16HCmhHxuyG9UqZPbsHmLGitqsr5L2BRT1sc8UXT/Izh+a4cJ1g+XWpqWH2g2Bz2 QskSmtJx26ZbAWcZCL4nDuCHDPJioCpMNpb7kenfIt8UPLSm0b9WuryovVTAc5pDb2BI qv/wwxNLKI/EXuT5BnHPCx3B2UiJC9g8jhlYqwQmmYq4OqDUNxp2UvsaCAbBpC8e5+Pn yEhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=rQIX1ZNv69UapXkXdQ4X1hOjCxYLoCsgSmH11Lr2URc=; b=D8ZJ+NX16qq1SKfu6eF53lEFG17Jgi7Po+YmA0aXvHlYVyLQ8k1fcAvudVFIzRCVo8 UazCXaceI04Cc1jf+sb+UoQh4z2Ss9TCgSVHU++k0EraYAMSa8lZHleuhIkgl3gQribJ qdSkpA1++YEuZD0zgMw4g4d2MUp7EBOkU5gIFNxtqYxvdsltcVriqNgImpATrco8mbuM GV+rwTqPE+lG8ix7oDll/8K5UoSqNQX1CQKrF0rtHA+kgD8QcGpTVUKgu/D5lPBlq7AT 82qzeJKYEaJaf7H5AfBUOPCMNvEWIugaHe020kae6HacsLtkSek1u3bmjRXSS6/o62q0 wUYA== X-Gm-Message-State: AOAM531duj6aPjGJiSRIwoG0ecxuQ8utuQ1lLOvZPhCwS+b1qDqLMjCE 9drZsd7KaJ8t3pq8nU13eWeuzM7W+0Y= X-Google-Smtp-Source: ABdhPJwDTM8baV8WSx11sYoR/s5mG0XauPvdhibKhLPElsVE/kyVd+oJXaT6tT6nxge6/u6rBVbeMw== X-Received: by 2002:ac8:7c53:: with SMTP id o19mr817766qtv.228.1634918107128; Fri, 22 Oct 2021 08:55:07 -0700 (PDT) Received: from nuc ([142.126.186.191]) by smtp.gmail.com with ESMTPSA id w185sm4456206qkd.30.2021.10.22.08.55.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Oct 2021 08:55:06 -0700 (PDT) Sender: Mark Johnston Date: Fri, 22 Oct 2021 11:55:04 -0400 From: Mark Johnston To: Martin Matuska Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 6ba2210ee039 - main - zfs: merge openzfs/zfs@ec64fdb93 (master) into main Message-ID: References: <202110211347.19LDlLoS004709@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202110211347.19LDlLoS004709@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4HbTSr0rJgz3v1M X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=phZCXjXt; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::830 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-2.69 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; NEURAL_HAM_MEDIUM(-1.00)[-0.995]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_NA(0.00)[freebsd.org]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-1.00)[-0.998]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::830:from]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-ThisMailContainsUnwantedMimeParts: N On Thu, Oct 21, 2021 at 01:47:21PM +0000, Martin Matuska wrote: > The branch main has been updated by mm: > > URL: https://cgit.FreeBSD.org/src/commit/?id=6ba2210ee039f2f12878c217bcf058e9c8b26b29 > > commit 6ba2210ee039f2f12878c217bcf058e9c8b26b29 > Merge: 01593a0ff9f1 ec64fdb93d14 > Author: Martin Matuska > AuthorDate: 2021-10-21 11:58:45 +0000 > Commit: Martin Matuska > CommitDate: 2021-10-21 13:06:06 +0000 > > zfs: merge openzfs/zfs@ec64fdb93 (master) into main > > Notable upstream pull request merges: > #12392 Avoid panic in case of pool errors and missing L2ARC > #12448 skip snapshot in zfs_iter_mounted() > #12516 Fix NFS and large reads on older kernels > #12533 Fail invalid incremental recursive send gracefully > #12569 FreeBSD: Really zero the zero page > #12575 Reject zfs send -RI with nonexistent fromsnap > #12602 Correct refcount_add in dmu_zfetch > #12650 zpool should call zfs_nicestrtonum() with non-NULL handle > > Obtained from: OpenZFS > OpenZFS commit: ec64fdb93d144ab1884097cfd36e18b62a2db848 Hi, I'm seeing some strange errors after the merge. For instance, kldxref segfaults during an installkernel to a dir on ZFS, and it seems to be due to some mishandling of short read()s. I also get filesystem panics in guest VMs with disk images on ZFS. The problems seem to go away with a revert of https://cgit.freebsd.org/src/commit/?id=59eab1093a361ca76849ca76b2ec079c8736e8e3 From nobody Fri Oct 22 16:03:53 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E5DFA1819A75; Fri, 22 Oct 2021 16:04:02 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (mail.vx.sk [144.76.20.103]) by mx1.freebsd.org (Postfix) with ESMTP id 4HbTg6599nz4SsQ; Fri, 22 Oct 2021 16:04:02 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (localhost [127.0.0.1]) by mail.vx.sk (Postfix) with ESMTP id CDF692D5DD2; Fri, 22 Oct 2021 18:03:55 +0200 (CEST) X-Virus-Scanned: amavisd-new at mail.vx.sk Received: from mail.vx.sk by mail.vx.sk (amavisd-new, unix socket) with LMTP id fJ-5lCwPa2sg; Fri, 22 Oct 2021 18:03:55 +0200 (CEST) Received: from [10.0.9.123] (188-167-171-2.static.chello.sk [188.167.171.2]) by mail.vx.sk (Postfix) with ESMTPSA id 82A6A2D5DCF; Fri, 22 Oct 2021 18:03:55 +0200 (CEST) Message-ID: <040e1f76-9884-b416-7ec2-8c4bbc24d89b@FreeBSD.org> Date: Fri, 22 Oct 2021 18:03:53 +0200 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.2 Subject: Re: git: 6ba2210ee039 - main - zfs: merge openzfs/zfs@ec64fdb93 (master) into main Content-Language: en-US To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202110211347.19LDlLoS004709@gitrepo.freebsd.org> From: Martin Matuska In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HbTg6599nz4SsQ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N Hi Mark, if you can confirm it working without that commit, we can revert that single commit on main for now and it would be great if you open an issue at OpenZFS. Cheers, mm On 22. 10. 2021 17:55, Mark Johnston wrote: > On Thu, Oct 21, 2021 at 01:47:21PM +0000, Martin Matuska wrote: >> The branch main has been updated by mm: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=6ba2210ee039f2f12878c217bcf058e9c8b26b29 >> >> commit 6ba2210ee039f2f12878c217bcf058e9c8b26b29 >> Merge: 01593a0ff9f1 ec64fdb93d14 >> Author: Martin Matuska >> AuthorDate: 2021-10-21 11:58:45 +0000 >> Commit: Martin Matuska >> CommitDate: 2021-10-21 13:06:06 +0000 >> >> zfs: merge openzfs/zfs@ec64fdb93 (master) into main >> >> Notable upstream pull request merges: >> #12392 Avoid panic in case of pool errors and missing L2ARC >> #12448 skip snapshot in zfs_iter_mounted() >> #12516 Fix NFS and large reads on older kernels >> #12533 Fail invalid incremental recursive send gracefully >> #12569 FreeBSD: Really zero the zero page >> #12575 Reject zfs send -RI with nonexistent fromsnap >> #12602 Correct refcount_add in dmu_zfetch >> #12650 zpool should call zfs_nicestrtonum() with non-NULL handle >> >> Obtained from: OpenZFS >> OpenZFS commit: ec64fdb93d144ab1884097cfd36e18b62a2db848 > Hi, > > I'm seeing some strange errors after the merge. For instance, kldxref > segfaults during an installkernel to a dir on ZFS, and it seems to be > due to some mishandling of short read()s. I also get filesystem panics > in guest VMs with disk images on ZFS. The problems seem to go away with > a revert of > https://cgit.freebsd.org/src/commit/?id=59eab1093a361ca76849ca76b2ec079c8736e8e3 From nobody Fri Oct 22 16:53:41 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 806F21808520; Fri, 22 Oct 2021 16: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 4HbVmP335hz4jX8; Fri, 22 Oct 2021 16: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 4840F12546; Fri, 22 Oct 2021 16: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 19MGrfnT084919; Fri, 22 Oct 2021 16: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 19MGrfa1084918; Fri, 22 Oct 2021 16:53:41 GMT (envelope-from git) Date: Fri, 22 Oct 2021 16:53:41 GMT Message-Id: <202110221653.19MGrfa1084918@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: a23e18ea5456 - main - powerpc64: tell kernel when radix is not available List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: a23e18ea545675aca7551ef2395f6df40a3acb29 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by luporl: URL: https://cgit.FreeBSD.org/src/commit/?id=a23e18ea545675aca7551ef2395f6df40a3acb29 commit a23e18ea545675aca7551ef2395f6df40a3acb29 Author: Leandro Lupori AuthorDate: 2021-10-22 16:44:21 +0000 Commit: Leandro Lupori CommitDate: 2021-10-22 16:44:21 +0000 powerpc64: tell kernel when radix is not available If CAS detects that radix is not supported, set radix_mmu to 0 to avoid the kernel trying to use it and panic. MFC after: 2 weeks Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) --- stand/powerpc/ofw/cas.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/stand/powerpc/ofw/cas.c b/stand/powerpc/ofw/cas.c index 0a12f31d1a1a..e95af42762a5 100644 --- a/stand/powerpc/ofw/cas.c +++ b/stand/powerpc/ofw/cas.c @@ -234,9 +234,15 @@ ppc64_cas(void) } } - if ((var = getenv("radix_mmu")) != NULL && var[0] == '0') + if (!radix_mmu) + /* + * If radix is not supported, set radix_mmu to 0 to avoid + * the kernel trying to use it and panic. + */ + setenv("radix_mmu", "0", 1); + else if ((var = getenv("radix_mmu")) != NULL && var[0] == '0') radix_mmu = 0; - if (radix_mmu) + else ov5[OV5_MMU_INDEX] = OV5_MMU_RADIX; inst = OF_open("/"); From nobody Fri Oct 22 16:59:28 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 73434180B6B1 for ; Fri, 22 Oct 2021 16:59:32 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound5a.ore.mailhop.org (outbound5a.ore.mailhop.org [44.233.67.66]) (using TLSv1.3 with cipher TLS_AES_256_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 4HbVv81MS0z4lCx for ; Fri, 22 Oct 2021 16:59:32 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1634921971; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=mAdf2zYOfC2to/XsVfoR8ZkfWxHcExnL6NaKEzMK/PsEwQxNcdqz3czuGSpNiezsShKgfCC2duUzB 6I2tgPDqas4EjQZG5H10BwVgDoybxMpcRv0Oek+JBV8diaMCt2SNs2mgW7/ygrB2TkJp1CfOZ4EbtJ yUhS77OkzkfKkWOzkFQd23TUrMbpGw/2L7sXUyQkv8zHEk7LjH1fPG5Y6XNNvnV/BfbTX6JgDth3C9 jaqENvt3V/7JdlNBi3kz8PmfL5yntDxPX8HPqAxVGUMumWiS7QcEdOS6EhW1DeyiXC0LH26vTQ/3ri OrBCHW1dfIl6xGyvsslzh/MPXPsAmVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=75L4NOhp8svR+3asHh9nEXk0PCm2q7y+tvGcukBdXqQ=; b=LDZZ8IYq4Uxum6KnBCrWBBGUUvRXMyiwyS7DDRg/tBwWe5jnhiiscktc16M+AIjHaFRqIn/ov9bvg ASCjUxK/UXg5+84+wByfN7BOfT5LwhPtMiHhMfgfFFdaqsiivBFtOahRAjq6cmZ0M0mOvpbbMWp77u Y66AZUJBf7C2XNNbMmiJRDfwWdt6ZkU59OFBIFfnXjY10mjsfFmDTP7drrErHldY+pJHEtaCS4jq9V EsczvDyS3UTm/sC6swlF539wbcRY3/3N1DZ0Tc/wO2C/gXZnfvmJkfNvrLn1wQjxnxFaq8tewGtg6b tdJPx4PR6r/pEt21iDALBEI2WJPwVeQ== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=24.8.225.114; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=75L4NOhp8svR+3asHh9nEXk0PCm2q7y+tvGcukBdXqQ=; b=wjkLSr3qrCUDS/vWxz6jR3rJfcYYXrB0LyiIzBWAAXC5yjSIps/CAp3QQneejSz3vYlGBrkeh9WfT 1C0jxpIP+HsQNd8S2iZL7T4hBkpTCMAmSOfwUkQqAxbW7Upadkez6RdhNIZ8bqyqlRVX1/r31q948r 3x8In6AmIAUXZ8vXOQEkdkVwzTxjNdxH4sUVGdMfwO/Rn7EuQUDe5SlGH9fLn2cXFOIIw5djz53J3p lZORNRLEGyWaGfdi07PIVFa+HsAEfWb5xdu/cdSes0GuucEdbpSibN/TfA/crUwBSMV9v3808iVT+K ucATVFcdskRCcQNqF6K+loQ7K8vqnAA== X-Originating-IP: 24.8.225.114 X-MHO-RoutePath: aGlwcGll X-MHO-User: 6b9c9b3b-3359-11ec-9e58-bf9d68d023b6 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-24-8-225-114.hsd1.co.comcast.net [24.8.225.114]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 6b9c9b3b-3359-11ec-9e58-bf9d68d023b6; Fri, 22 Oct 2021 16:59:30 +0000 (UTC) Received: from [172.22.42.84] (rev2.hippie.lan [172.22.42.84]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 19MGxSNt083324; Fri, 22 Oct 2021 10:59:29 -0600 (MDT) (envelope-from ian@freebsd.org) X-Authentication-Warning: paranoia.hippie.lan: Host rev2.hippie.lan [172.22.42.84] claimed to be [172.22.42.84] Message-ID: <2d9f9df5958cec23b11d6e23e0b20c236db44574.camel@freebsd.org> Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default From: Ian Lepore To: Alexey Dokuchaev , Warner Losh Cc: src-committers , "" , dev-commits-src-main@freebsd.org Date: Fri, 22 Oct 2021 10:59:28 -0600 In-Reply-To: References: <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> <20211021080214.GB77338@zxy.spb.ru> <99e7aecf-9ab7-8b8f-ff30-b5fce3e031c2@FreeBSD.org> Content-Type: text/plain; charset="ASCII" User-Agent: Evolution 3.40.3 FreeBSD GNOME Team List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HbVv81MS0z4lCx X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Fri, 2021-10-22 at 06:28 +0000, Alexey Dokuchaev wrote: > > Our users aren't so unsophisticated as to be totally swayed by the > > choice of wording. > > This is not how it works Warner, you don't first offer biased poll > and then defend skewed results by appealing to observed ratio and > how smart your target audience is. Do you really believe different words would change the result from 4:1 against to some number in favor? Of course you don't, you're only complaining because your opinion is VERY CLEARLY the minority one. -- Ian From nobody Fri Oct 22 17:04:15 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BD022180BF37; Fri, 22 Oct 2021 17:04:18 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HbW0f39wfz4lfb; Fri, 22 Oct 2021 17:04:18 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 19MH4GUM075995; Fri, 22 Oct 2021 10:04:16 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 19MH4FDn075994; Fri, 22 Oct 2021 10:04:15 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202110221704.19MH4FDn075994@gndrsh.dnsmgr.net> Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default In-Reply-To: <20211021192020.6dcb95c1@ernst.home> To: gljennjohn@gmail.com Date: Fri, 22 Oct 2021 10:04:15 -0700 (PDT) CC: Gleb Smirnoff , Slawa Olhovchenkov , Emmanuel Vadot , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4HbW0f39wfz4lfb X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N > On Thu, 21 Oct 2021 10:03:05 -0700 > Gleb Smirnoff wrote: > > > On Thu, Oct 21, 2021 at 11:02:14AM +0300, Slawa Olhovchenkov wrote: > > S> > laptops. If somebody is using vt(4) instead of X on a laptop, then > > S> > > S> This change disable bell in X11 too. > > S> This is completly disable speaker bell. > > > > Are you sure? I haven't yet upgraded my desktop to this point, so can't test. > > How is that possible that vt(4) affects X11? > > > > He could be right. I don't use vt, but syscons also has a bell setting: > sysctl -d hw.syscons.bell hw.syscons.bell: enable bell > > With this set to 1 a ^G in xterm results in a beep. After setting the > sysctl to 0 a ^G in xterm produces no sound at all. I also suspect that this kills "visual bell" which is a bright flash of the terminal. We need to STOP these "I dont like the 20 year old defaults, so I am going to change them to what I like and use" It is NOT forward progress on making a better system, it is tilting at defaults, very long established defaults, that should probably just be left alone. I dont like a lot of the defaults on a lot of OS's, I tweak them to my needs. FreeBSD keeps tweaking things such that I have to tweak my tweaks to keep things as I see fit. THAT IS A POLA VIOLATION! -- Rod Grimes rgrimes@freebsd.org From nobody Fri Oct 22 17:12:16 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 016611810AF4; Fri, 22 Oct 2021 17:12:19 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HbW9t4nM1z4pL1; Fri, 22 Oct 2021 17:12:18 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 19MHCGTO076029; Fri, 22 Oct 2021 10:12:16 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 19MHCGfO076028; Fri, 22 Oct 2021 10:12:16 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202110221712.19MHCGfO076028@gndrsh.dnsmgr.net> Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default In-Reply-To: <718707f9-57e9-057e-1811-f9229f2da9de@FreeBSD.org> To: Andriy Gapon Date: Fri, 22 Oct 2021 10:12:16 -0700 (PDT) CC: Warner Losh , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4HbW9t4nM1z4pL1 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N > On 21/10/2021 22:52, Warner Losh wrote: > > This discussion to date has been data free. I created a poll... > > > > https://twitter.com/bsdimp/status/1451274644439265308 > > > I tried to abstain from this discussion on whether the bike shed should have > been repainted although I do have an opinion :-) > > Don't have we have anything better than twitter for such a poll? > Something on FreeBSD infra maybe? > I recall some polls and surveys in the past and they weren't on twitter. This is a survey of the overlap of people on the freebsd-commit mailling list, and Twitter users, not what I would call a very valid polling of FreeBSD users. Someone register my "continue to make sound" vote. Warner, please fix the broken code with respect to pitch, that is probably WHY people find it overtly annoying. > > Reading some comments on twitter (thankfully I don't need to sign up for that) I > see a valid point about feature discoverability. If it beeps, I know that it > can beep. And if that annoys me, I'll try to research how to disable it. If it > doesn't beep, how would I even know that it can beep? (Asking for a 15 year old > friend). Maybe I would find the beeping useful and pleasant, but what are my > chances of learning that it exists? Interesting perspective, and I agree. I am also concerned about loss of beep function in X11 terminals. -- Rod Grimes rgrimes@freebsd.org From nobody Fri Oct 22 17:16:37 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D28E31812558; Fri, 22 Oct 2021 17:16:51 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HbWH748r8z4qmD; Fri, 22 Oct 2021 17:16:51 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 19MHGbwS005943 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 22 Oct 2021 10:16:37 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 19MHGbWT005942; Fri, 22 Oct 2021 10:16:37 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Fri, 22 Oct 2021 10:16:37 -0700 From: Gleb Smirnoff To: Vladimir Kondratyev Cc: Slawa Olhovchenkov , Emmanuel Vadot , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> <20211021080214.GB77338@zxy.spb.ru> <99e7aecf-9ab7-8b8f-ff30-b5fce3e031c2@FreeBSD.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <99e7aecf-9ab7-8b8f-ff30-b5fce3e031c2@FreeBSD.org> X-Rspamd-Queue-Id: 4HbWH748r8z4qmD X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Thu, Oct 21, 2021 at 09:58:31PM +0300, Vladimir Kondratyev wrote: V> On 21.10.2021 20:03, Gleb Smirnoff wrote: V> > On Thu, Oct 21, 2021 at 11:02:14AM +0300, Slawa Olhovchenkov wrote: V> > S> > laptops. If somebody is using vt(4) instead of X on a laptop, then V> > S> V> > S> This change disable bell in X11 too. V> > S> This is completly disable speaker bell. V> > V> > Are you sure? I haven't yet upgraded my desktop to this point, so can't test. V> > How is that possible that vt(4) affects X11? V> > V> pre-evdev X11 got keyboard input from tty subsystem V> V> and post-evdev X11 still affected by it. We have local X11 patch which V> disables bell on ttyv8, otherwise you'll hear annoying sound as soon as V> tty buffer get filled up. V> V> But you have to have custom X11 build to hear bell under X11 I definitely don't have a custom build of X11 and I got bell in xterm. Of course I haven't yet upgaded to the discussed revision. -- Gleb Smirnoff From nobody Fri Oct 22 17:17:39 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8DB031812E9D; Fri, 22 Oct 2021 17:17:40 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HbWJ422Gjz4r0v; Fri, 22 Oct 2021 17:17:40 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 19MHHdlW005958 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 22 Oct 2021 10:17:39 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 19MHHdP8005957; Fri, 22 Oct 2021 10:17:39 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Fri, 22 Oct 2021 10:17:39 -0700 From: Gleb Smirnoff To: Jung-uk Kim Cc: gljennjohn@gmail.com, Slawa Olhovchenkov , Emmanuel Vadot , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> <20211021080214.GB77338@zxy.spb.ru> <20211021192020.6dcb95c1@ernst.home> <23455738-85b6-604d-de67-157474811248@FreeBSD.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <23455738-85b6-604d-de67-157474811248@FreeBSD.org> X-Rspamd-Queue-Id: 4HbWJ422Gjz4r0v X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Thu, Oct 21, 2021 at 01:56:32PM -0400, Jung-uk Kim wrote: J> >> S> This is completly disable speaker bell. J> >> J> >> Are you sure? I haven't yet upgraded my desktop to this point, so can't test. J> >> How is that possible that vt(4) affects X11? J> > J> > He could be right. I don't use vt, but syscons also has a bell setting: J> > sysctl -d hw.syscons.bell hw.syscons.bell: enable bell J> > J> > With this set to 1 a ^G in xterm results in a beep. After setting the J> > sysctl to 0 a ^G in xterm produces no sound at all. J> J> FYI, Xorg server beeps via xf86OSRingBell(), i.e., J> J> https://gitlab.freedesktop.org/xorg/xserver/-/blob/master/hw/xfree86/os-support/bsd/bsd_bell.c#L61 J> J> IOW, if console cannot beep, xterm does not beep. Oh! Thanks for explanation! -- Gleb Smirnoff From nobody Fri Oct 22 14:14:26 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 03AFC17F0700; Fri, 22 Oct 2021 17:26:59 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) (using TLSv1.3 with cipher TLS_AES_256_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 4HbWVp5lftz4v6s; Fri, 22 Oct 2021 17:26:58 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from kent.sdaoden.eu (kent.sdaoden.eu [10.5.0.2]) by sdaoden.eu (Postfix) with ESMTPS id C510016057; Fri, 22 Oct 2021 19:26:48 +0200 (CEST) Received: by kent.sdaoden.eu (Postfix, from userid 1000) id 9A4521924; Fri, 22 Oct 2021 16:14:26 +0200 (CEST) Date: Fri, 22 Oct 2021 16:14:26 +0200 Author: Steffen Nurpmeso From: Steffen Nurpmeso To: Shawn Webb Cc: Warner Losh , Alexey Dokuchaev , src-committers , "" , dev-commits-src-main@freebsd.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: <20211022141426.CQ2u0%steffen@sdaoden.eu> In-Reply-To: <20211022134229.jrkkgahnu6bz2aec@mutt-hbsd> References: <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> <20211021080214.GB77338@zxy.spb.ru> <99e7aecf-9ab7-8b8f-ff30-b5fce3e031c2@FreeBSD.org> <20211022134229.jrkkgahnu6bz2aec@mutt-hbsd> User-Agent: s-nail v14.9.22-181-g014ab7c7a4 OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. X-Rspamd-Queue-Id: 4HbWVp5lftz4v6s X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Shawn Webb wrote in <20211022134229.jrkkgahnu6bz2aec@mutt-hbsd>: ... |Tangentially related for curious minds: | |Tom Scott did a video in 2014 about how the types of trucks that beep |when reversing are changing from the traditional beep to a white noise |type of beep: https://www.youtube.com/watch?v=fa28lIGuxq8 Oh! This terrible sound, how i hated when German producers adding this!!! And i always asked myself, why didn't they use something more mindful, say Beethoven ta-ta-ta-taam, or something? American trucks could have used something like Dylan's A Hard Rain's gonna fall, or what do i know from American songbook. The thrill is gone maybe, though with that Baldwin accident maybe not so good. --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) From nobody Fri Oct 22 14:21:16 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 03AD117F059C; Fri, 22 Oct 2021 17:26:59 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) (using TLSv1.3 with cipher TLS_AES_256_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 4HbWVp5lgqz4vCY; Fri, 22 Oct 2021 17:26:58 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from kent.sdaoden.eu (kent.sdaoden.eu [10.5.0.2]) by sdaoden.eu (Postfix) with ESMTPS id AAE4816056; Fri, 22 Oct 2021 19:26:48 +0200 (CEST) Received: by kent.sdaoden.eu (Postfix, from userid 1000) id 4E59B1927; Fri, 22 Oct 2021 16:21:16 +0200 (CEST) Date: Fri, 22 Oct 2021 16:21:16 +0200 Author: Steffen Nurpmeso From: Steffen Nurpmeso To: Andriy Gapon Cc: Warner Losh , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: <20211022142116.h0ROX%steffen@sdaoden.eu> In-Reply-To: <718707f9-57e9-057e-1811-f9229f2da9de@FreeBSD.org> References: <202110190738.19J7cFtw067994@gitrepo.freebsd.org> <20211019112132.GC80160@zxy.spb.ru> <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> <20211021080214.GB77338@zxy.spb.ru> <99e7aecf-9ab7-8b8f-ff30-b5fce3e031c2@FreeBSD.org> <718707f9-57e9-057e-1811-f9229f2da9de@FreeBSD.org> User-Agent: s-nail v14.9.22-181-g014ab7c7a4 OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. X-Rspamd-Queue-Id: 4HbWVp5lgqz4vCY X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-Spam: Yes X-ThisMailContainsUnwantedMimeParts: N List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Andriy Gapon wrote in <718707f9-57e9-057e-1811-f9229f2da9de@FreeBSD.org>: |On 21/10/2021 22:52, Warner Losh wrote: ... |> https://twitter.com/bsdimp/status/1451274644439265308 ... |Don't have we have anything better than twitter for such a poll? |Something on FreeBSD infra maybe? I am not a FreeBSD member, but i loved that. It is nice to see FreeBSD names that you know for twenty years and more, ... more often than not you have to open the browser and look in Phabricator to see their names. But they are there! I am sure there are also other FreeBSD fans who would love to have a ML where that storyboard you see on the right is posted in exactly the same format. This would be noisy of course. --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) From nobody Fri Oct 22 17:30:40 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9459517F1411; Fri, 22 Oct 2021 17:30:43 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HbWb71lYPz3Bn7; Fri, 22 Oct 2021 17:30:43 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 19MHUelL006018 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 22 Oct 2021 10:30:40 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 19MHUeO3006017; Fri, 22 Oct 2021 10:30:40 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Fri, 22 Oct 2021 10:30:40 -0700 From: Gleb Smirnoff To: Ian Lepore Cc: Alexey Dokuchaev , Warner Losh , src-committers , "" , dev-commits-src-main@freebsd.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: References: <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> <20211021080214.GB77338@zxy.spb.ru> <99e7aecf-9ab7-8b8f-ff30-b5fce3e031c2@FreeBSD.org> <2d9f9df5958cec23b11d6e23e0b20c236db44574.camel@freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2d9f9df5958cec23b11d6e23e0b20c236db44574.camel@freebsd.org> X-Rspamd-Queue-Id: 4HbWb71lYPz3Bn7 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Fri, Oct 22, 2021 at 10:59:28AM -0600, Ian Lepore wrote: I> On Fri, 2021-10-22 at 06:28 +0000, Alexey Dokuchaev wrote: I> > > Our users aren't so unsophisticated as to be totally swayed by the I> > > choice of wording. I> > I> > This is not how it works Warner, you don't first offer biased poll I> > and then defend skewed results by appealing to observed ratio and I> > how smart your target audience is. I> I> Do you really believe different words would change the result from 4:1 I> against to some number in favor? Of course you don't, you're only I> complaining because your opinion is VERY CLEARLY the minority one. I don't think unbiased wording would affect voting result if we did the vote within developers@FreeBSD.org. But the vote with biased wording was placed on.. hold my beer! ... on TWITTER, the most unbiased platform in the world! So, Warner has 1280 followers and I would claim that many of them are not FreeBSD users, and some probably doesn't have idea what FreeBSD bell problem is. It was retweeted by 7 people, some of whom has hundreds of followers. Given twitter algorithms, the poll may show up even in feed of people who don't follow Warner or retwitters directly. You know, some people love to express their opinion on social media, so why not to click on the poll, to help those FreeBSD guys? To sum up, we are asking semi-random set of people a question charged with a correct answer. What would you expect? -- Gleb Smirnoff From nobody Fri Oct 22 17:31:45 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 36BFA17F238C; Fri, 22 Oct 2021 17:31:48 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HbWcM6B4Qz3CRb; Fri, 22 Oct 2021 17:31:47 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 19MHVjGC006036 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 22 Oct 2021 10:31:45 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 19MHVjKY006035; Fri, 22 Oct 2021 10:31:45 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Fri, 22 Oct 2021 10:31:45 -0700 From: Gleb Smirnoff To: Warner Losh Cc: Alexey Dokuchaev , src-committers , "" , dev-commits-src-main@freebsd.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: References: <20211019133700.77c0ca7ac488eb99df50551b@bidouilliste.com> <20211020095206.GA77338@zxy.spb.ru> <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> <20211021080214.GB77338@zxy.spb.ru> <99e7aecf-9ab7-8b8f-ff30-b5fce3e031c2@FreeBSD.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4HbWcM6B4Qz3CRb X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N Warner, sorry for top quoting. I love this email very much :) Can we please improve the tone of the bell? On Thu, Oct 21, 2021 at 10:55:00PM -0600, Warner Losh wrote: W> FreeBSD controls the pitch and duration of the noise. And there's W> at least one bug in it. W> W> It looks like we want 800Hz: W> W> #define VT_BELLPITCH 800 W> W> But we ring the bell with W> W> sysbeep(1193182 / VT_BELLPITCH, VT_BELLDURATION); W> W> which looks almost sane. 1.193182MHz is the clock frequency W> of the IBM PC PIT square wave generator. And normally it's programmed W> by dividing this base clock by the desired clock. So we're passing W> in 1491 into sysbeep. We have a tuneable for the 8254 frequency that W> the PIT uses, so it's a bug that we're ignoring that and hard coding this W> value. W> W> Now, sysbeep is only defined on x86, where this is W> timer_spkr_setfreq(pitch); W> otherwise it's nothing. So, timer_spkr_setfreq looks like: W> freq = i8254_freq / freq; W> outb(TIMER_CNTR2, freq & 0xff); W> outb(TIMER_CNTR2, freq >> 8); W> so this computation means we are actually playing a 1491Hz tone for 50ms. W> You can verify this will be the frequency with any PC speaker tutorial. W> W> This corresponds to no natural note in western music. F#6 is 1480Hz and F6 W> is 1397Hz. So the tone that's generated is a dissonant note. C4 is middle C, W> so this is two octaves higher and a little bit. W> W> Even the 800Hz is between G5 and G5#. Not a great note, but at least W> it's an octave lower. So even the desired beep is dissonant. W> W> Since most people find music pleasing, that makes it objectively annoying. W> A similar analysis for the other common tunings (where A4 is one of 432, W> 436, W> 438, 440 (the most common these days), 442, 444, and 446Hz) yields W> similar results with varying degrees of subtonal dissonance. W> W> Also, 50ms is 1/20th of a second (give of take), which translates to about W> 600 beats per minute, which is annoyingly fast, as any musician would W> tell you. The only saving grace is that it's done only once. W> W> Also, the poll is running 4 to 1 for silence by default. While any bias in W> wording mighthave pushed it a little one way or the other, when it's this W> lopsided it's hard to argue that such bias affected the actual outcome. Our W> users aren't so unsophisticated as to be totally swayed by the choice of W> wording. The reply tweets suggest people know exactly what I'm talking W> about. Iknow it isn't scientific, but it is highly suggestive given the 60 W> point spread. Even had I used differentwording, my followers on twitter W> are self selecting which is likely a biggersource of error, and lord knows W> what Twitter's algorithms do to distort who sees it. And likely a dozen W> other W> factors I've not even thought of. W> W> Warner W> W> P.S. We likely should fix this bug, and also change the note to 880, which W> is W> A5 (the second A above middle C). Please see W> https://reviews.freebsd.org/D32594 W> for a fix for the bug I found here. -- Gleb Smirnoff From nobody Fri Oct 22 17:39:05 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3BCD417F63FA for ; Fri, 22 Oct 2021 17:39:14 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2q.ore.mailhop.org (outbound2q.ore.mailhop.org [54.187.71.48]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HbWmx6fRZz3FYJ for ; Fri, 22 Oct 2021 17:39:13 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1634924347; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=leVhWN4306UOctocXpnEnjFoasIfqxUXs6efWd5msWk7iz8XSEPY/Bn5f3m7oVPJe/3MIbTeXUVZN c/qH+jCOPtAs1g1qPVvj22+qcD44aQB0ASR2zh4tqKTqmyhpvdWDVuOpa473a1JnmaeCCgQraPl3LI /JRS9d+7rZZWlDfcuhQ9rEwCKFTrGoyaVSLXcMOh06uZIrReIFnaIi+/P9pv2tXLTfkJViPRn9+ROX dLK0SvoEJoxaReHumWP7Ks8mg4Yx0AmIuxOWBYtah5ylFvgHBc5nMYQu8gJyInFCRvEB3WVTLMHW8A McQ12tgDlvrWvG3avM7Ji1e4vwivcZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=2MD/lar3OLMhDchGyO4D7Ab/p2Eded+i7U7HCQb/1Po=; b=A5003Oe23oQr0Qd5bM3xffZSIw3dKguIYSM09iRBqIL2iJM82GwhB/ckZp5TKNGz+2A1cDHqNb0nA f5kMyAbTthnfgPiYyn5hyI3MJ6353KcokZDVYQ53Z1JZZZsrEbq5xxA4w1SBcjYBuk49FOOLfOZOlv 9B6TZ36xQH+QE3vnLruKpQ6N0BUmKP2KPvI1PQ5p0zLvWM3Gye1YaxsEE0q0mbfw7lz2XJIx5Hqx2Q LQNxhBL5epaJ1NPsx7EtagZMgcfCuL3RVasiKSAM/4jPmHFPKOL6hHe9seqXrJa2cU8M81D/dO608u xLNdfP0S6RLyl3/IhC27xYeN+XCoYHA== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=24.8.225.114; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=2MD/lar3OLMhDchGyO4D7Ab/p2Eded+i7U7HCQb/1Po=; b=iPtbul42lBDZKQO4GTpyKMtx5/IJlbcV/UJFLU7bgjwtrt4IfFmPzsPvBLnVPLPi95clFooOQPV07 3lPP/RlP4CKaFMqlOGkPtq2oFNP+tKFVkGwpUxg0RGjp2gL4uMd5hp9WebzT5tqOmr6rW6O8VjB4mg nTPQs7MLYxPVHk4MZLjHwZ2FiAL2abStAKswCd70QRYHuAxy3IPA+oRAg0M8swb+QGrKjg8+uyIP5m LKDNVWjdVtbUOgoEDau6V421Xn2oPoJtg/8kWOt7RIHePQNrhHpC81N2T/v3tpAnTA3/b9oLV0mAGl 1XzrQibOu9+bc/137TILzJi7sbX9fpg== X-Originating-IP: 24.8.225.114 X-MHO-RoutePath: aGlwcGll X-MHO-User: f4009066-335e-11ec-a67c-89389772cfc7 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-24-8-225-114.hsd1.co.comcast.net [24.8.225.114]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id f4009066-335e-11ec-a67c-89389772cfc7; Fri, 22 Oct 2021 17:39:06 +0000 (UTC) Received: from [172.22.42.84] (rev2.hippie.lan [172.22.42.84]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 19MHd5sU083609; Fri, 22 Oct 2021 11:39:05 -0600 (MDT) (envelope-from ian@freebsd.org) X-Authentication-Warning: paranoia.hippie.lan: Host rev2.hippie.lan [172.22.42.84] claimed to be [172.22.42.84] Message-ID: Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default From: Ian Lepore To: Gleb Smirnoff Cc: Alexey Dokuchaev , Warner Losh , src-committers , "" , dev-commits-src-main@freebsd.org Date: Fri, 22 Oct 2021 11:39:05 -0600 In-Reply-To: References: <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> <20211021080214.GB77338@zxy.spb.ru> <99e7aecf-9ab7-8b8f-ff30-b5fce3e031c2@FreeBSD.org> <2d9f9df5958cec23b11d6e23e0b20c236db44574.camel@freebsd.org> Content-Type: text/plain; charset="ASCII" User-Agent: Evolution 3.40.3 FreeBSD GNOME Team List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HbWmx6fRZz3FYJ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Fri, 2021-10-22 at 10:30 -0700, Gleb Smirnoff wrote: > To sum up, we are asking semi-random set of people a question charged > with > a correct answer. What would you expect? I would expect the winning side to rejoice about the poll supporting their position while the losing side whines about the process being the reason for their loss. -- Ian From nobody Fri Oct 22 17:47:17 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6C4FA18036C2; Fri, 22 Oct 2021 17:47:25 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mail.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HbWyN5yHGz3JJV; Fri, 22 Oct 2021 17:47:24 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1634924837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MS3L86jMWBBrEQK0itcL7Smid7266DiIBpHeqrAB+Fo=; b=uZS/K3t7yaVMVlyn2+CphzadWaWBpvUnXiE8+lLhBKykTXAvhq37j0tVwYmEO9Q5zD8u38 mDadJY422T/RGjzx0otpebwMamlfvonByW6rcLAvBKCYSaJUXy+LmAIKaUpm8MttwlFly3 LKbkm9YDUQfPVOWjbSjLdHLqyItPXW4= Received: from skull.home.blih.net (lfbn-idf2-1-644-191.w86-247.abo.wanadoo.fr [86.247.100.191]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 881b6cd2 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 22 Oct 2021 17:47:17 +0000 (UTC) Date: Fri, 22 Oct 2021 19:47:17 +0200 From: Emmanuel Vadot To: rgrimes@freebsd.org Cc: "Rodney W. Grimes" , gljennjohn@gmail.com, Gleb Smirnoff , Slawa Olhovchenkov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-Id: <20211022194717.8c94d2fa302339b55882497f@bidouilliste.com> In-Reply-To: <202110221704.19MH4FDn075994@gndrsh.dnsmgr.net> References: <20211021192020.6dcb95c1@ernst.home> <202110221704.19MH4FDn075994@gndrsh.dnsmgr.net> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HbWyN5yHGz3JJV X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Fri, 22 Oct 2021 10:04:15 -0700 (PDT) "Rodney W. Grimes" wrote: > > On Thu, 21 Oct 2021 10:03:05 -0700 > > Gleb Smirnoff wrote: > > > > > On Thu, Oct 21, 2021 at 11:02:14AM +0300, Slawa Olhovchenkov wrote: > > > S> > laptops. If somebody is using vt(4) instead of X on a laptop, then > > > S> > > > S> This change disable bell in X11 too. > > > S> This is completly disable speaker bell. > > > > > > Are you sure? I haven't yet upgraded my desktop to this point, so can't test. > > > How is that possible that vt(4) affects X11? > > > > > > > He could be right. I don't use vt, but syscons also has a bell setting: > > sysctl -d hw.syscons.bell hw.syscons.bell: enable bell > > > > With this set to 1 a ^G in xterm results in a beep. After setting the > > sysctl to 0 a ^G in xterm produces no sound at all. > > I also suspect that this kills "visual bell" which is a bright > flash of the terminal. There is no visual bell in vt(4) and this doesn't affect xterm*visualBell obviously. But yes this does affect the bell in xterm (and so I guess any other terminal that default to have a bell) but that was also the point of this change. > We need to STOP these "I dont like the 20 year old defaults, > so I am going to change them to what I like and use" It is NOT > forward progress on making a better system, it is tilting at > defaults, very long established defaults, that should probably > just be left alone. It's not "I don't like", it's "We don't like". If we can't change FreeBSD default to what most of our users want I don't know why we're still working on this OS. > I dont like a lot of the defaults on a lot of OS's, I tweak them > to my needs. FreeBSD keeps tweaking things such that I have to > tweak my tweaks to keep things as I see fit. THAT IS A POLA VIOLATION! > > -- > Rod Grimes rgrimes@freebsd.org The future is now, old man -- Emmanuel Vadot From nobody Fri Oct 22 17:53:02 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AD5EA18064A4; Fri, 22 Oct 2021 17:53:04 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mail.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HbX4v75g4z3LjK; Fri, 22 Oct 2021 17:53:03 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1634925182; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E+mock3xlNC9Tl8/vPiVCsbvUl7rNZ3wwvPcejBsjEA=; b=C3OuWPX3grRdhr9LRtarLd32KroFrw8Xux4/6ZN/BMIZkC7S1OgtH7ZCvtPdvpuj01k+YZ pVL6W3i6Y1EFYzbXU/OTsEE2K2+Y7F/yooFWvX7mE+LspCHNTOe4DWJbjdrKMK5wO1W6ND afoFiXjdN5AmWVsDCwuVo2YxP3Z8reo= Received: from amy (lfbn-idf2-1-644-191.w86-247.abo.wanadoo.fr [86.247.100.191]) by mx.blih.net (OpenSMTPD) with ESMTPSA id 97c38981 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 22 Oct 2021 17:53:02 +0000 (UTC) Date: Fri, 22 Oct 2021 19:53:02 +0200 From: Emmanuel Vadot To: Gleb Smirnoff Cc: Ian Lepore , Alexey Dokuchaev , Warner Losh , src-committers , "" , dev-commits-src-main@freebsd.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-Id: <20211022195302.4470bc13ca02a35a3169e798@bidouilliste.com> In-Reply-To: References: <20211020134237.17596440e1fabda5d40f6985@bidouilliste.com> <20211021080214.GB77338@zxy.spb.ru> <99e7aecf-9ab7-8b8f-ff30-b5fce3e031c2@FreeBSD.org> <2d9f9df5958cec23b11d6e23e0b20c236db44574.camel@freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HbX4v75g4z3LjK X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Fri, 22 Oct 2021 10:30:40 -0700 Gleb Smirnoff wrote: > On Fri, Oct 22, 2021 at 10:59:28AM -0600, Ian Lepore wrote: > I> On Fri, 2021-10-22 at 06:28 +0000, Alexey Dokuchaev wrote: > I> > > Our users aren't so unsophisticated as to be totally swayed by the > I> > > choice of wording. > I> > > I> > This is not how it works Warner, you don't first offer biased poll > I> > and then defend skewed results by appealing to observed ratio and > I> > how smart your target audience is. > I> > I> Do you really believe different words would change the result from 4:1 > I> against to some number in favor? Of course you don't, you're only > I> complaining because your opinion is VERY CLEARLY the minority one. > > I don't think unbiased wording would affect voting result if we did > the vote within developers@FreeBSD.org. But the vote with biased > wording was placed on.. hold my beer! ... on TWITTER, the most unbiased > platform in the world! So, Warner has 1280 followers and I would claim > that many of them are not FreeBSD users, and some probably doesn't > have idea what FreeBSD bell problem is. It was retweeted by 7 people, > some of whom has hundreds of followers. Given twitter algorithms, the > poll may show up even in feed of people who don't follow Warner or > retwitters directly. You know, some people love to express their opinion > on social media, so why not to click on the poll, to help those FreeBSD guys? > To sum up, we are asking semi-random set of people a question charged with > a correct answer. What would you expect? > > -- > Gleb Smirnoff Let's ask our community then : https://discord.com/channels/727023752348434432/757543661058654269/901166071078322267 -- Emmanuel Vadot From nobody Fri Oct 22 17:59:29 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C88561809489; Fri, 22 Oct 2021 17:59:34 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) (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 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HbXDQ4pVkz3NbX; Fri, 22 Oct 2021 17:59:34 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-ed1-x530.google.com with SMTP id e19so6036765edy.0; Fri, 22 Oct 2021 10:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=7QVSQ93AHteGVg+oKJfUDZ3loYzwKb4ZiaZTXsXSA/M=; b=egAUYQolaULLSznWVkDQ5zcOb0tan/1OMYv01ciAxU8z5xiQt8hYyX941ByypwSZoV xNiL5Ysc6gWwW8617QDAtc1PldO0WeJIo4Z8vcbRXqI+hGoIANFy++qSgIndenclWZoJ QFDxgv3GHJt3vDXtZeywRc9Wx0OElXyBkhDvC9vZb7m9uXjLpYqdkIoFGnB/NiN3dOT3 StUsIw35bQZrSwIaRK03xa7cobJrS7jcZ7sYCknYdq6ePofA4XNpI05rQd7uiOrBrgai NA13yXhll8Ayb/vW6odu4LojXkdhHmLT9eTWPiep7zDl0M2pO1CIW8cjN8ilDd0xEm/Y CsxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=7QVSQ93AHteGVg+oKJfUDZ3loYzwKb4ZiaZTXsXSA/M=; b=ULcEjR2Z9EDi6j1xvkuVEF0bFrvUBsK/8TyU/cxZrGMirvApVI1oobKYnK7PtnKwJ1 b0umuMHoEZEQ8qAe7rt1x0zejDs7oYuQwgW+oPiJxtT63jLCjA/D9dWUEafWdTXvguCi 2kkw3wdFF6dbspWBP0mTzzOw4ADa6FmafZoHXeOMSuRQUHtAaTY8mTMEiTLu5YwRghEv OpVDtOAbg+gldvwXc2aNJMIn6IUACxbjq87y784kr/GW2BexZ4LebSdyX7WcllKEEUdw wJhhczfC5ctN09pk4VgBvfwNLJK8BqSF0Hw2j2AXse12WNftWqm3uYRCCqI1v4I06Ji2 Ch7g== X-Gm-Message-State: AOAM531S4XqLtlF3z8rchmyEoDqlfxkKkIBC50ZwxMMy68ZOWVqBthgg dZAdE7KH14dCbZeN2N5ZLEY= X-Google-Smtp-Source: ABdhPJytCSbFwvQNmCwEacvnElkz2VcB+C7EL+kAbOhfSNtUQ3lIyLrU+UeSN4aH0nfJsvOGzmS5hw== X-Received: by 2002:aa7:da16:: with SMTP id r22mr1971374eds.75.1634925573657; Fri, 22 Oct 2021 10:59:33 -0700 (PDT) Received: from ernst.home (p5b3becad.dip0.t-ipconnect.de. [91.59.236.173]) by smtp.gmail.com with ESMTPSA id go33sm1140088ejc.120.2021.10.22.10.59.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Oct 2021 10:59:32 -0700 (PDT) Date: Fri, 22 Oct 2021 19:59:29 +0200 From: Gary Jennejohn To: "Rodney W. Grimes" Cc: rgrimes@freebsd.org, Gleb Smirnoff , Slawa Olhovchenkov , Emmanuel Vadot , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-ID: <20211022195929.4e25c1d0@ernst.home> In-Reply-To: <202110221704.19MH4FDn075994@gndrsh.dnsmgr.net> References: <20211021192020.6dcb95c1@ernst.home> <202110221704.19MH4FDn075994@gndrsh.dnsmgr.net> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HbXDQ4pVkz3NbX X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Fri, 22 Oct 2021 10:04:15 -0700 (PDT) "Rodney W. Grimes" wrote: > > On Thu, 21 Oct 2021 10:03:05 -0700 > > Gleb Smirnoff wrote: > > > > > On Thu, Oct 21, 2021 at 11:02:14AM +0300, Slawa Olhovchenkov wrote: > > > S> > laptops. If somebody is using vt(4) instead of X on a laptop, then > > > S> > > > S> This change disable bell in X11 too. > > > S> This is completly disable speaker bell. > > > > > > Are you sure? I haven't yet upgraded my desktop to this point, so can't test. > > > How is that possible that vt(4) affects X11? > > > > > > > He could be right. I don't use vt, but syscons also has a bell setting: > > sysctl -d hw.syscons.bell hw.syscons.bell: enable bell > > > > With this set to 1 a ^G in xterm results in a beep. After setting the > > sysctl to 0 a ^G in xterm produces no sound at all. > > I also suspect that this kills "visual bell" which is a bright > flash of the terminal. > Yes, it does. I use mrxvt, which is set up to use a visual bell. With the syscons bell sysctl set to 0 there's no visual bell. As jkim@ explained in his reply, if the console can't beep then Xorg also can't beep/flash, irregardless of whether it's vt or syscons. > We need to STOP these "I dont like the 20 year old defaults, > so I am going to change them to what I like and use" It is NOT > forward progress on making a better system, it is tilting at > defaults, very long established defaults, that should probably > just be left alone. > > I dont like a lot of the defaults on a lot of OS's, I tweak them > to my needs. FreeBSD keeps tweaking things such that I have to > tweak my tweaks to keep things as I see fit. THAT IS A POLA VIOLATION! > -- Gary Jennejohn From nobody Fri Oct 22 18:41:57 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7EFC5181C2F2; Fri, 22 Oct 2021 18:41: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 4HbY9K37dVz3rtV; Fri, 22 Oct 2021 18:41: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 4B76414099; Fri, 22 Oct 2021 18:41: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 19MIfvLt029122; Fri, 22 Oct 2021 18:41:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19MIfvqY029121; Fri, 22 Oct 2021 18:41:57 GMT (envelope-from git) Date: Fri, 22 Oct 2021 18:41:57 GMT Message-Id: <202110221841.19MIfvqY029121@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 6aae3517ed25 - main - Retire synchronous PPP kernel driver sppp(4). List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6aae3517ed2500fb963ba0a4264b4756088dd0f4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=6aae3517ed2500fb963ba0a4264b4756088dd0f4 commit 6aae3517ed2500fb963ba0a4264b4756088dd0f4 Author: Gleb Smirnoff AuthorDate: 2021-10-21 04:08:13 +0000 Commit: Gleb Smirnoff CommitDate: 2021-10-22 18:41:36 +0000 Retire synchronous PPP kernel driver sppp(4). The last two drivers that required sppp are cp(4) and ce(4). These devices are still produced and can be purchased at Cronyx . Since Roman Kurakin has quit them, they no longer support FreeBSD officially. Later they have dropped support for Linux drivers to. As of mid-2020 they don't even have a developer to maintain their Windows driver. However, their support verbally told me that they could provide aid to a FreeBSD developer with documentaion in case if there appears a new customer for their devices. These drivers have a feature to not use sppp(4) and create an interface, but instead expose the device as netgraph(4) node. Then, you can attach ng_ppp(4) with help of ports/net/mpd5 on top of the node and get your synchronous PPP. Alternatively you can attach ng_frame_relay(4) or ng_cisco(4) for HDLC. Actually, last time I used cp(4) back in 2004, using netgraph(4) instead of sppp(4) was already the right way to do. Thus, remove the sppp(4) related part of the drivers and enable by default the negraph(4) part. Further maintenance of these drivers in the tree shouldn't be a big deal. While doing that, remove some cruft and enable cp(4) compilation on amd64. The ce(4) for some unknown reason marks its internal DDK functions with __attribute__ fastcall, which most likely is safe to remove, but without hardware I'm not going to do that, so ce(4) remains i386-only. Reviewed by: emaste, imp, donner Differential Revision: https://reviews.freebsd.org/D32590 See also: https://reviews.freebsd.org/D23928 --- ObsoleteFiles.inc | 11 + UPDATING | 5 + lib/libc/net/getnameinfo.c | 2 +- lib/libnetgraph/debug.c | 2 - libexec/rc/netstart | 1 - libexec/rc/rc.conf | 6 - libexec/rc/rc.d/Makefile | 1 - libexec/rc/rc.d/netif | 2 +- libexec/rc/rc.d/sppp | 37 - rescue/rescue/Makefile | 2 +- sbin/Makefile | 1 - sbin/sconfig/sconfig.8 | 5 - sbin/spppcontrol/Makefile | 9 - sbin/spppcontrol/Makefile.depend | 17 - sbin/spppcontrol/spppcontrol.8 | 275 -- sbin/spppcontrol/spppcontrol.c | 266 -- share/man/man4/Makefile | 2 - share/man/man4/man4.i386/ce.4 | 44 +- share/man/man4/man4.i386/cp.4 | 44 +- share/man/man4/netgraph.4 | 1 - share/man/man4/ng_sppp.4 | 172 - share/man/man4/sppp.4 | 238 -- share/man/man5/rc.conf.5 | 15 - sys/conf/NOTES | 5 - sys/conf/files | 6 +- sys/conf/files.i386 | 3 - sys/conf/files.x86 | 3 + sys/conf/options.i386 | 3 - sys/dev/ce/if_ce.c | 328 +- sys/dev/ce/ng_ce.h | 4 - sys/{i386/include => dev/cp}/cserial.h | 0 sys/dev/cp/if_cp.c | 316 +- sys/dev/cp/ng_cp.h | 4 - sys/i386/conf/NOTES | 9 +- sys/modules/Makefile | 2 - sys/modules/ce/Makefile | 21 +- sys/modules/cp/Makefile | 21 +- sys/modules/netgraph/Makefile | 1 - sys/modules/netgraph/sppp/Makefile | 7 - sys/modules/sppp/Makefile | 18 - sys/net/if_sppp.h | 234 -- sys/net/if_spppfr.c | 611 ---- sys/net/if_spppsubr.c | 5418 ------------------------------- sys/netgraph/ng_sppp.c | 411 --- sys/netgraph/ng_sppp.h | 39 - sys/x86/conf/NOTES | 5 + targets/pseudo/userland/Makefile.depend | 1 - 47 files changed, 71 insertions(+), 8557 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 7c5e534d21d4..b6a2d299bc8c 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -40,6 +40,17 @@ # xargs -n1 | sort | uniq -d; # done +# 20211022 +OLD_FILES+=sbin/spppcontrol +.if ${TARGET_ARCH} == "i386" +OLD_FILES+=usr/include/machine/cserial.h +.endif +OLD_FILES+=usr/include/net/if_sppp.h +OLD_FILES+=usr/include/netgraph/ng_sppp.h +OLD_FILES+=usr/share/man/man4/ng_sppp.4.gz +OLD_FILES+=usr/share/man/man4/sppp.4.gz +OLD_FILES+=usr/share/man/man8/spppcontrol.8.gz + # 20210929: OLD_FILES+=usr/sbin/hcseriald OLD_FILES+=usr/share/man/man8/hcseriald.8.gz diff --git a/UPDATING b/UPDATING index 8028c5f192cb..765722b62617 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20211022: + The synchronous PPP kernel driver sppp(4) has been removed. + The cp(4) and ce(4) drivers are now always compiled with netgraph(4) + support, formerly enabled by NETGRAPH_CRONYX option. + 20211020: sh(1) is now the default shell for the root user. To force root to use the csh shell, please run the following command as root: diff --git a/lib/libc/net/getnameinfo.c b/lib/libc/net/getnameinfo.c index ad54920aa793..b72734e56ed3 100644 --- a/lib/libc/net/getnameinfo.c +++ b/lib/libc/net/getnameinfo.c @@ -467,7 +467,7 @@ getnameinfo_link(const struct afd *afd, * The following have zero-length addresses. * IFT_GIF (net/if_gif.c) * IFT_LOOP (net/if_loop.c) - * IFT_PPP (net/if_ppp.c, net/if_spppsubr.c) + * IFT_PPP (net/if_tuntap.c) * IFT_SLIP (net/if_sl.c, net/if_strip.c) * IFT_STF (net/if_stf.c) * IFT_L2VLAN (net/if_vlan.c) diff --git a/lib/libnetgraph/debug.c b/lib/libnetgraph/debug.c index f44504140b8b..513d3350760d 100644 --- a/lib/libnetgraph/debug.c +++ b/lib/libnetgraph/debug.c @@ -96,7 +96,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -172,7 +171,6 @@ static const struct ng_cookie cookies[] = { COOKIE(SOCKET), COOKIE(SOURCE), COOKIE(SPLIT), - COOKIE(SPPP), COOKIE(TAG), COOKIE(TCPMSS), COOKIE(TEE), diff --git a/libexec/rc/netstart b/libexec/rc/netstart index fa4ce382e4ff..d40ee05edd4d 100755 --- a/libexec/rc/netstart +++ b/libexec/rc/netstart @@ -43,7 +43,6 @@ _start=quietstart /etc/rc.d/ipfilter ${_start} /etc/rc.d/ipnat ${_start} /etc/rc.d/ipfs ${_start} -/etc/rc.d/sppp ${_start} /etc/rc.d/netif ${_start} /etc/rc.d/ipsec ${_start} /etc/rc.d/ppp ${_start} diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index 6f4a3a1eb3f3..0cfee2d9c194 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -262,12 +262,6 @@ cloned_interfaces="" # List of cloned network interfaces to create. # #autobridge_interfaces="bridge0" # List of bridges to check #autobridge_bridge0="tap* vlan0" # Interface glob to automatically add to the bridge -# -# If you have any sppp(4) interfaces above, you might also want to set -# the following parameters. Refer to spppcontrol(8) for their meaning. -sppp_interfaces="" # List of sppp interfaces. -#sppp_interfaces="...0" # example: sppp over ... -#spppconfig_...0="authproto=chap myauthname=foo myauthsecret='top secret' hisauthname=some-gw hisauthsecret='another secret'" # User ppp configuration. ppp_enable="NO" # Start user-ppp (or NO). diff --git a/libexec/rc/rc.d/Makefile b/libexec/rc/rc.d/Makefile index 5981b3b03d17..4c7267552526 100644 --- a/libexec/rc/rc.d/Makefile +++ b/libexec/rc/rc.d/Makefile @@ -96,7 +96,6 @@ CONFS= DAEMON \ savecore \ securelevel \ serial \ - sppp \ statd \ static_arp \ static_ndp \ diff --git a/libexec/rc/rc.d/netif b/libexec/rc/rc.d/netif index 3dbb3e1a9588..ae30299bfc52 100755 --- a/libexec/rc/rc.d/netif +++ b/libexec/rc/rc.d/netif @@ -26,7 +26,7 @@ # # PROVIDE: netif -# REQUIRE: FILESYSTEMS iovctl serial sppp sysctl +# REQUIRE: FILESYSTEMS iovctl serial sysctl # REQUIRE: hostid # KEYWORD: nojailvnet diff --git a/libexec/rc/rc.d/sppp b/libexec/rc/rc.d/sppp deleted file mode 100755 index b6b02876d4fe..000000000000 --- a/libexec/rc/rc.d/sppp +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# - -# PROVIDE: sppp -# REQUIRE: root -# BEFORE: netif -# KEYWORD: nojail - -. /etc/rc.subr - -name="sppp" -desc="Point to point protocol network layer for synchronous lines" -start_cmd="sppp_start" -stop_cmd=":" - -sppp_start() -{ - # Special options for sppp(4) interfaces go here. These need - # to go _before_ the general ifconfig since in the case - # of hardwired (no link1 flag) but required authentication, you - # cannot pass auth parameters down to the already running interface. - # - for ifn in ${sppp_interfaces}; do - eval spppcontrol_args=\$spppconfig_${ifn} - if [ -n "${spppcontrol_args}" ]; then - # The auth secrets might contain spaces; in order - # to retain the quotation, we need to eval them - # here. - eval spppcontrol ${ifn} ${spppcontrol_args} - fi - done -} - -load_rc_config $name -run_rc_command "$1" diff --git a/rescue/rescue/Makefile b/rescue/rescue/Makefile index 42094340e768..90aaea3cb709 100644 --- a/rescue/rescue/Makefile +++ b/rescue/rescue/Makefile @@ -101,7 +101,7 @@ CRUNCH_PROGS_sbin= \ mount_udf mount_unionfs newfs \ newfs_msdos nos-tun ping reboot \ restore rcorder route savecore \ - shutdown spppcontrol swapon sysctl tunefs umount + shutdown swapon sysctl tunefs umount .if ${MK_CCD} != "no" CRUNCH_PROGS_sbin+= ccdconfig diff --git a/sbin/Makefile b/sbin/Makefile index 6d6b647651ad..ade73fc8b0ee 100644 --- a/sbin/Makefile +++ b/sbin/Makefile @@ -63,7 +63,6 @@ SUBDIR=adjkerntz \ savecore \ setkey \ shutdown \ - spppcontrol \ swapon \ sysctl \ tunefs \ diff --git a/sbin/sconfig/sconfig.8 b/sbin/sconfig/sconfig.8 index 713f76d88c9d..a55bf911e3dd 100644 --- a/sbin/sconfig/sconfig.8 +++ b/sbin/sconfig/sconfig.8 @@ -216,9 +216,6 @@ Select the Frame Relay synchronous protocol T1.617 Annex D). .It Cm ppp Select the synchronous PPP protocol. -PPP parameters can be configured using the -.Xr spppcontrol 8 -utility. .It Sm Cm keepalive No = Bro Cm on , off Brc Sm Turn on/off transmission of keepalive messages. This option is used only for synchronous PPP. @@ -569,10 +566,8 @@ Test error (G.703 only). .Sh SEE ALSO .Xr stty 1 , .Xr ioctl 2 , -.Xr sppp 4 , .Xr ifconfig 8 , .Xr route 8 , -.Xr spppcontrol 8 .\"-------------------------------------------------------------- .Sh HISTORY The diff --git a/sbin/spppcontrol/Makefile b/sbin/spppcontrol/Makefile deleted file mode 100644 index 04173201cfde..000000000000 --- a/sbin/spppcontrol/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# $FreeBSD$ - -PACKAGE= ppp - -PROG= spppcontrol -MAN= spppcontrol.8 -WARNS?= 2 - -.include diff --git a/sbin/spppcontrol/Makefile.depend b/sbin/spppcontrol/Makefile.depend deleted file mode 100644 index 6cfaab1c3644..000000000000 --- a/sbin/spppcontrol/Makefile.depend +++ /dev/null @@ -1,17 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - gnu/lib/csu \ - include \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libcompiler_rt \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/sbin/spppcontrol/spppcontrol.8 b/sbin/spppcontrol/spppcontrol.8 deleted file mode 100644 index 4d948a60651a..000000000000 --- a/sbin/spppcontrol/spppcontrol.8 +++ /dev/null @@ -1,275 +0,0 @@ -.\" Copyright (C) 1997, 2001 by Joerg Wunsch, Dresden -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``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(S) 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$ -.\" -.Dd December 30, 2001 -.Dt SPPPCONTROL 8 -.Os -.Sh NAME -.Nm spppcontrol -.Nd display or set parameters for an sppp interface -.Sh SYNOPSIS -.Nm -.Op Fl v -.Ar ifname -.Op Ar parameter Ns Op Li = Ns Ar value -.Op Ar ... -.Sh DESCRIPTION -The -.Xr sppp 4 -driver might require a number of additional arguments or optional -parameters besides the settings that can be adjusted with -.Xr ifconfig 8 . -These are things like authentication protocol parameters, but also -other tunable configuration variables. -The -.Nm -utility can be used to display the current settings, or adjust these -parameters as required. -.Pp -For whatever intent -.Nm -is being called, at least the parameter -.Ar ifname -needs to be specified, naming the interface for which the settings -are to be performed or displayed. -Use -.Xr ifconfig 8 , -or -.Xr netstat 1 -to see which interfaces are available. -.Pp -If no other parameter is given, -.Nm -will just list the current settings for -.Ar ifname -and exit. -The reported settings include the current PPP phase the -interface is in, which can be one of the names -.Em dead , -.Em establish , -.Em authenticate , -.Em network , -or -.Em terminate . -If an authentication protocol is configured for the interface, the -name of the protocol to be used, as well as the system name to be used -or expected will be displayed, plus any possible options to the -authentication protocol if applicable. -Note that the authentication -secrets (sometimes also called -.Em keys ) -are not being returned by the underlying system call, and are thus not -displayed. -.Pp -If any additional parameter is supplied, superuser privileges are -required, and the command works in the -.Dq set -mode. -This is normally done quietly, unless the option -.Fl v -is also enabled, which will cause a final printout of the settings as -described above once all other actions have been taken. -Use of this -mode will be rejected if the interface is currently in any other phase -than -.Em dead . -Note that you can force an interface into -.Em dead -phase by calling -.Xr ifconfig 8 -with the parameter -.Cm down . -.Pp -The currently supported parameters include: -.Bl -tag -offset indent -width indent -.It Va authproto Ns Li = Ns Ar protoname -Set both, his and my authentication protocol to -.Ar protoname . -The protocol name can be one of -.Dq Li chap , -.Dq Li pap , -or -.Dq Li none . -In the latter case, the use of an authentication protocol will be -turned off for the named interface. -This has the side-effect of -clearing the other authentication-related parameters for this -interface as well (i.e., system name and authentication secret will -be forgotten). -.It Va myauthproto Ns Li = Ns Ar protoname -Same as above, but only for my end of the link. -I.e., this is the -protocol when remote is authenticator, and I am the peer required to -authenticate. -.It Va hisauthproto Ns Li = Ns Ar protoname -Same as above, but only for his end of the link. -.It Va myauthname Ns Li = Ns Ar name -Set my system name for the authentication protocol. -.It Va hisauthname Ns Li = Ns Ar name -Set his system name for the authentication protocol. -For CHAP, this -will only be used as a hint, causing a warning message if remote did -supply a different name. -For PAP, it is the name remote must use to -authenticate himself (in connection with his secret). -.It Va myauthsecret Ns Li = Ns Ar secret -Set my secret (key, password) for use in the authentication phase. -For CHAP, this will be used to compute the response hash value, based -on remote's challenge. -For PAP, it will be transmitted as plain text -together with the system name. -Do not forget to quote the secrets from -the shell if they contain shell metacharacters (or white space). -.It Va myauthkey Ns Li = Ns Ar secret -Same as above. -.It Va hisauthsecret Ns Li = Ns Ar secret -Same as above, to be used if we are an authenticator and the remote peer -needs to authenticate. -.It Va hisauthkey Ns Li = Ns Va secret -Same as above. -.It Va callin -Require remote to authenticate himself only when he is calling in, but -not when we are caller. -This is required for some peers that do not -implement the authentication protocols symmetrically (like Ascend -routers, for example). -.It Va always -The opposite of -.Va callin . -Require remote to always authenticate, regardless of which side is -placing the call. -This is the default, and will not be explicitly -displayed in the -.Dq list -mode. -.It Va norechallenge -Only meaningful with CHAP. -Do not re-challenge peer once the initial -CHAP handshake was successful. -Used to work around broken peer -implementations that cannot grok being re-challenged once the -connection is up. -.It Ar rechallenge -With CHAP, send re-challenges at random intervals while the connection -is in network phase. -(The intervals are currently in the range of 300 -through approximately 800 seconds.) -This is the default, and will not -be explicitly displayed in the -.Dq list -mode. -.It Va lcp-timeout Ns Li = Ns Ar timeout-value -Allows to change the value of the LCP restart timer. -Values are -specified in milliseconds. -The value must be between 10 and 20000 ms, -defaulting to 3000 ms. -.It Va enable-vj -Enable negotiation of Van Jacobsen header compression. -(Enabled by default.) -.It Va disable-vj -Disable negotiation of Van Jacobsen header compression. -.It Va enable-ipv6 -Enable negotiation of the IPv6 network control protocol. -(Enabled by default if the kernel has IPv6 enabled.) -.It Va disable-ipv6 -Disable negotiation of the IPv6 network control protocol. -Since every -IPv4 interface in an IPv6-enabled kernel automatically gets an IPv6 -address assigned, this option provides for a way to administratively -prevent the link from attempting to negotiate IPv6. -Note that -initialization of an IPv6 interface causes a multicast packet to be -sent, which can cause unwanted traffic costs (for dial-on-demand -interfaces). -.El -.Sh EXAMPLES -.Bd -literal -# spppcontrol bppp0 -bppp0: phase=dead - myauthproto=chap myauthname="uriah" - hisauthproto=chap hisauthname="ifb-gw" norechallenge - lcp-timeout=3000 - enable-vj - enable-ipv6 -.Ed -.Pp -Display the settings for -.Li bppp0 . -The interface is currently in -.Em dead -phase, i.e., the LCP layer is down, and no traffic is possible. -Both -ends of the connection use the CHAP protocol, my end tells remote the -system name -.Dq Li uriah , -and remote is expected to authenticate by the name -.Dq Li ifb-gw . -Once the initial CHAP handshake was successful, no further CHAP -challenges will be transmitted. -There are supposedly some known CHAP -secrets for both ends of the link which are not being shown. -.Bd -literal -# spppcontrol bppp0 \e - authproto=chap \e - myauthname=uriah myauthsecret='some secret' \e - hisauthname=ifb-gw hisauthsecret='another' \e - norechallenge -.Ed -.Pp -A possible call to -.Nm -that could have been used to bring the interface into the state shown -by the previous example. -.Sh SEE ALSO -.Xr netstat 1 , -.Xr sppp 4 , -.Xr ifconfig 8 -.Rs -.%A B. Lloyd -.%A W. Simpson -.%T "PPP Authentication Protocols" -.%O RFC 1334 -.Re -.Rs -.%A W. Simpson, Editor -.%T "The Point-to-Point Protocol (PPP)" -.%O RFC 1661 -.Re -.Rs -.%A W. Simpson -.%T "PPP Challenge Handshake Authentication Protocol (CHAP)" -.%O RFC 1994 -.Re -.Sh HISTORY -The -.Nm -utility appeared in -.Fx 3.0 . -.Sh AUTHORS -The program was written by -.An J\(:org Wunsch , -Dresden. diff --git a/sbin/spppcontrol/spppcontrol.c b/sbin/spppcontrol/spppcontrol.c deleted file mode 100644 index e56310c635e9..000000000000 --- a/sbin/spppcontrol/spppcontrol.c +++ /dev/null @@ -1,266 +0,0 @@ -/*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * - * Copyright (c) 1997, 2001 Joerg Wunsch - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -static void usage(void); -void print_vals(const char *ifname, struct spppreq *sp); -const char *phase_name(enum ppp_phase phase); -const char *proto_name(u_short proto); -const char *authflags(u_short flags); - -#define PPP_PAP 0xc023 -#define PPP_CHAP 0xc223 - -int -main(int argc, char **argv) -{ - int s, c; - int errs = 0, verbose = 0; - size_t off; - long to; - char *endp; - const char *ifname, *cp; - struct ifreq ifr; - struct spppreq spr; - - while ((c = getopt(argc, argv, "v")) != -1) - switch (c) { - case 'v': - verbose++; - break; - - default: - errs++; - break; - } - argv += optind; - argc -= optind; - - if (errs || argc < 1) - usage(); - - ifname = argv[0]; - strncpy(ifr.ifr_name, ifname, sizeof ifr.ifr_name); - - /* use a random AF to create the socket */ - if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) - err(EX_UNAVAILABLE, "ifconfig: socket"); - - argc--; - argv++; - - spr.cmd = (uintptr_t) SPPPIOGDEFS; - ifr.ifr_data = (caddr_t)&spr; - - if (ioctl(s, SIOCGIFGENERIC, &ifr) == -1) - err(EX_OSERR, "SIOCGIFGENERIC(SPPPIOGDEFS)"); - - if (argc == 0) { - /* list only mode */ - print_vals(ifname, &spr); - return 0; - } - -#define startswith(s) strncmp(argv[0], s, (off = strlen(s))) == 0 - - while (argc > 0) { - if (startswith("authproto=")) { - cp = argv[0] + off; - if (strcmp(cp, "pap") == 0) - spr.defs.myauth.proto = - spr.defs.hisauth.proto = PPP_PAP; - else if (strcmp(cp, "chap") == 0) - spr.defs.myauth.proto = - spr.defs.hisauth.proto = PPP_CHAP; - else if (strcmp(cp, "none") == 0) - spr.defs.myauth.proto = - spr.defs.hisauth.proto = 0; - else - errx(EX_DATAERR, "bad auth proto: %s", cp); - } else if (startswith("myauthproto=")) { - cp = argv[0] + off; - if (strcmp(cp, "pap") == 0) - spr.defs.myauth.proto = PPP_PAP; - else if (strcmp(cp, "chap") == 0) - spr.defs.myauth.proto = PPP_CHAP; - else if (strcmp(cp, "none") == 0) - spr.defs.myauth.proto = 0; - else - errx(EX_DATAERR, "bad auth proto: %s", cp); - } else if (startswith("myauthname=")) - strncpy(spr.defs.myauth.name, argv[0] + off, - AUTHNAMELEN); - else if (startswith("myauthsecret=") || - startswith("myauthkey=")) - strncpy(spr.defs.myauth.secret, argv[0] + off, - AUTHKEYLEN); - else if (startswith("hisauthproto=")) { - cp = argv[0] + off; - if (strcmp(cp, "pap") == 0) - spr.defs.hisauth.proto = PPP_PAP; - else if (strcmp(cp, "chap") == 0) - spr.defs.hisauth.proto = PPP_CHAP; - else if (strcmp(cp, "none") == 0) - spr.defs.hisauth.proto = 0; - else - errx(EX_DATAERR, "bad auth proto: %s", cp); - } else if (startswith("hisauthname=")) - strncpy(spr.defs.hisauth.name, argv[0] + off, - AUTHNAMELEN); - else if (startswith("hisauthsecret=") || - startswith("hisauthkey=")) - strncpy(spr.defs.hisauth.secret, argv[0] + off, - AUTHKEYLEN); - else if (strcmp(argv[0], "callin") == 0) - spr.defs.hisauth.flags |= AUTHFLAG_NOCALLOUT; - else if (strcmp(argv[0], "always") == 0) - spr.defs.hisauth.flags &= ~AUTHFLAG_NOCALLOUT; - else if (strcmp(argv[0], "norechallenge") == 0) - spr.defs.hisauth.flags |= AUTHFLAG_NORECHALLENGE; - else if (strcmp(argv[0], "rechallenge") == 0) - spr.defs.hisauth.flags &= ~AUTHFLAG_NORECHALLENGE; - else if (startswith("lcp-timeout=")) { - cp = argv[0] + off; - to = strtol(cp, &endp, 10); - if (*cp == '\0' || *endp != '\0' || - /* - * NB: 10 ms is the minimal possible value for - * hz=100. We assume no kernel has less clock - * frequency than that... - */ - to < 10 || to > 20000) - errx(EX_DATAERR, "bad lcp timeout value: %s", - cp); - spr.defs.lcp.timeout = to; - } else if (strcmp(argv[0], "enable-vj") == 0) - spr.defs.enable_vj = 1; - else if (strcmp(argv[0], "disable-vj") == 0) - spr.defs.enable_vj = 0; - else if (strcmp(argv[0], "enable-ipv6") == 0) - spr.defs.enable_ipv6 = 1; - else if (strcmp(argv[0], "disable-ipv6") == 0) - spr.defs.enable_ipv6 = 0; - else - errx(EX_DATAERR, "bad parameter: \"%s\"", argv[0]); - - argv++; - argc--; - } - - spr.cmd = (uintptr_t)SPPPIOSDEFS; - - if (ioctl(s, SIOCSIFGENERIC, &ifr) == -1) - err(EX_OSERR, "SIOCSIFGENERIC(SPPPIOSDEFS)"); - - if (verbose) - print_vals(ifname, &spr); - - return 0; -} - -static void -usage(void) -{ - fprintf(stderr, "%s\n%s\n", - "usage: spppcontrol [-v] ifname [{my|his}auth{proto|name|secret}=...]", - " spppcontrol [-v] ifname callin|always"); - exit(EX_USAGE); -} - -void -print_vals(const char *ifname, struct spppreq *sp) -{ - printf("%s:\tphase=%s\n", ifname, phase_name(sp->defs.pp_phase)); - if (sp->defs.myauth.proto) { - printf("\tmyauthproto=%s myauthname=\"%.*s\"\n", - proto_name(sp->defs.myauth.proto), - AUTHNAMELEN, sp->defs.myauth.name); - } - if (sp->defs.hisauth.proto) { - printf("\thisauthproto=%s hisauthname=\"%.*s\"%s\n", - proto_name(sp->defs.hisauth.proto), - AUTHNAMELEN, sp->defs.hisauth.name, - authflags(sp->defs.hisauth.flags)); - } - printf("\tlcp-timeout=%d ms\n", sp->defs.lcp.timeout); - printf("\t%sable-vj\n", sp->defs.enable_vj? "en": "dis"); - printf("\t%sable-ipv6\n", sp->defs.enable_ipv6? "en": "dis"); -} - -const char * -phase_name(enum ppp_phase phase) -{ - switch (phase) { - case PHASE_DEAD: return "dead"; - case PHASE_ESTABLISH: return "establish"; - case PHASE_TERMINATE: return "terminate"; - case PHASE_AUTHENTICATE: return "authenticate"; - case PHASE_NETWORK: return "network"; - } - return "illegal"; -} - -const char * -proto_name(u_short proto) -{ - static char buf[12]; - switch (proto) { - case PPP_PAP: return "pap"; - case PPP_CHAP: return "chap"; - } - sprintf(buf, "0x%x", (unsigned)proto); - return buf; -} - -const char * -authflags(u_short flags) -{ - static char buf[30]; - buf[0] = '\0'; - if (flags & AUTHFLAG_NOCALLOUT) - strcat(buf, " callin"); - if (flags & AUTHFLAG_NORECHALLENGE) - strcat(buf, " norechallenge"); - return buf; -} diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index af3ad94c9e2e..e2f68f619f37 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -379,7 +379,6 @@ MAN= aac.4 \ ng_socket.4 \ ng_source.4 \ ng_split.4 \ - ng_sppp.4 \ ng_sscfu.4 \ ng_sscop.4 \ ng_tag.4 \ @@ -529,7 +528,6 @@ MAN= aac.4 \ spigen.4 \ ${_spkr.4} \ splash.4 \ - sppp.4 \ ste.4 \ stf.4 \ stge.4 \ diff --git a/share/man/man4/man4.i386/ce.4 b/share/man/man4/man4.i386/ce.4 index 531904fd539c..451f9fb22da0 100644 --- a/share/man/man4/man4.i386/ce.4 +++ b/share/man/man4/man4.i386/ce.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 30, 2006 +.Dd October 22, 2021 .Dt CE 4 i386 .Os .Sh NAME @@ -44,29 +44,19 @@ module at boot time, place the following line in .Bd -literal -offset indent if_ce_load="YES" .Ed -.Pp -Additional options: -.Cd "device sppp" -.Cd "options NETGRAPH" -.Cd "options NETGRAPH_CRONYX" .Sh DESCRIPTION The .Nm -driver needs either -.Xr sppp 4 -or -.Xr netgraph 4 . -Which one to use is determined by the -.Dv NETGRAPH_CRONYX -option. -If this option is present in your kernel configuration file, the -.Nm -driver will be compiled with +driver creates a .Xr netgraph 4 -support. -Otherwise, it will be compiled with -.Xr sppp 4 -support. +node for each device found. +The node is usually paired with +.Xr ng_async 4 , +.Xr ng_cisco 4 , +.Xr ng_frame_relay 4 +or with +.Xr ng_ppp 4 +under control of net/mpd5 port. .Pp Refer to .Xr sconfig 8 @@ -89,12 +79,8 @@ with 32 HDLC channels. .El .Sh SEE ALSO .Xr cp 4 , -.Xr ctau 4 , -.Xr cx 4 , -.Xr sppp 4 , -.Xr ifconfig 8 , -.Xr sconfig 8 , -.Xr spppcontrol 8 *** 8694 LINES SKIPPED *** From nobody Fri Oct 22 19:20:34 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3449E1804FBB; Fri, 22 Oct 2021 19:20:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HbZ1v0sFCz4WRw; Fri, 22 Oct 2021 19:20:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2E641453E; Fri, 22 Oct 2021 19:20: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 19MJKYgA080743; Fri, 22 Oct 2021 19:20:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19MJKY99080742; Fri, 22 Oct 2021 19:20:34 GMT (envelope-from git) Date: Fri, 22 Oct 2021 19:20:34 GMT Message-Id: <202110221920.19MJKY99080742@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: 70f51f0e474f - main - Revert "Handle partial reads in zfs_read" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 70f51f0e474ffe1fb74cb427423a2fba3637544d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=70f51f0e474ffe1fb74cb427423a2fba3637544d commit 70f51f0e474ffe1fb74cb427423a2fba3637544d Author: Mark Johnston AuthorDate: 2021-10-22 18:55:14 +0000 Commit: Mark Johnston CommitDate: 2021-10-22 19:16:42 +0000 Revert "Handle partial reads in zfs_read" This reverts commit 59eab1093a361ca76849ca76b2ec079c8736e8e3. The change suppressed EFAULT originating from uiomove(). The deadlock avoidance mechanism implemented by vn_io_fault1() in the VFS handles such errors by wiring the user pages and retrying, but this change caused read() to return early instead. This can result in short I/O, causing misbehaviour in some applications, and possibly other consequences. Until this is resolved somehow, revert the commit. Approved by: mm --- sys/contrib/openzfs/module/zfs/zfs_vnops.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sys/contrib/openzfs/module/zfs/zfs_vnops.c b/sys/contrib/openzfs/module/zfs/zfs_vnops.c index 9bd75c011ef9..8229bc9a93e5 100644 --- a/sys/contrib/openzfs/module/zfs/zfs_vnops.c +++ b/sys/contrib/openzfs/module/zfs/zfs_vnops.c @@ -254,7 +254,6 @@ zfs_read(struct znode *zp, zfs_uio_t *uio, int ioflag, cred_t *cr) } ASSERT(zfs_uio_offset(uio) < zp->z_size); - ssize_t start_offset = zfs_uio_offset(uio); ssize_t n = MIN(zfs_uio_resid(uio), zp->z_size - zfs_uio_offset(uio)); ssize_t start_resid = n; @@ -277,13 +276,6 @@ zfs_read(struct znode *zp, zfs_uio_t *uio, int ioflag, cred_t *cr) /* convert checksum errors into IO errors */ if (error == ECKSUM) error = SET_ERROR(EIO); - /* - * if we actually read some bytes, bubbling EFAULT - * up to become EAGAIN isn't what we want here. - */ - if (error == EFAULT && - (zfs_uio_offset(uio) - start_offset) != 0) - error = 0; break; } From nobody Fri Oct 22 20:19:54 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 77E7A181C6B2; Fri, 22 Oct 2021 20:20:05 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ua1-x929.google.com (mail-ua1-x929.google.com [IPv6:2607:f8b0:4864:20::929]) (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 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HbbLY2dCJz4lwk; Fri, 22 Oct 2021 20:20:05 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-ua1-x929.google.com with SMTP id e5so2851184uam.11; Fri, 22 Oct 2021 13:20:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0HHwmJWIPS/0GhwgKDTgvhxTVXsB/fCjhzJHKtSnbcc=; b=nzXYZq7jtV1ci+UuLi1M8CnaH1A7QmFMr/p4tJOX4qUHh++4bJs44IyGW+CXY9l+Fc Z66avDLe0MjkmEvA5WE1UndpefMTVuzD5sYielCB+z6B6geyTSN7b82aq0krRHlt4BKj ij6gYGNcnSE6NW6j10taMRYtU/GK//n3m2LqMtblhhFEya4+qSojIZ1k1pgDAH1oIA7+ CEQlR6vZNHajwg3+xcc7nmqfsI0kwPAHc2qCB8U+Y/3uNPgLq2KSJRfUfVsRXoP7BbY2 4Uij/0z8S7NXuWi2Z0xjKRcECvuCHFOyg34pAufc2Ves9y5NH0FMF3BcPKdE/b3XtBFJ tOHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0HHwmJWIPS/0GhwgKDTgvhxTVXsB/fCjhzJHKtSnbcc=; b=xcyRQoVdqiBMFg1Pk+T6rdP28Cj3JiQ8xGme6tjlQhGhtFHAhs6qe2+pH3NuyWrgLW JSUtChDQ0uueb/ckHGFonq+Q/GmT5OJhIn/E/3I9avsc6zQAuy6sJGM5dCkX6nn00R9q nnIIl/jLPpe4YIju+SQgJWj0AUNxTmPbcuSuFRq2y/X8WDI/Dua+gLpxnOpAZY+ZT4eU ncOWv4T19I0AE8ClpQmiWlSn3gSlOEPUz17uCUsYVxMMDySX0PC/I4D+61W91DNoS1X8 vvRSzXyc9oL0bUqQ9GfjcOL54nPmE/wmSQvLToKgG6p/pE5KouJgrchQrNojEAKuqluH HGUg== X-Gm-Message-State: AOAM533SrLxZ6cgp5yMoze7hATQovWah12u6DKAUVGiCW7rDEEfRBnrQ yB8US2FBf2jDCiRYVEsj6wnwJpB70wZN2GSHrQEePb+X8cE= X-Google-Smtp-Source: ABdhPJyJG1FE7VetXxWxvfdiiw9fB4G8yyPUhM34TCs41GDt8zmQ5Avo17r6YZw1mWO02JLtTHoPFIj+mVNJARDWqf8= X-Received: by 2002:a67:cb87:: with SMTP id h7mr2942199vsl.0.1634934005002; Fri, 22 Oct 2021 13:20:05 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <20211021192020.6dcb95c1@ernst.home> <202110221704.19MH4FDn075994@gndrsh.dnsmgr.net> <20211022194717.8c94d2fa302339b55882497f@bidouilliste.com> In-Reply-To: <20211022194717.8c94d2fa302339b55882497f@bidouilliste.com> From: Benjamin Kaduk Date: Fri, 22 Oct 2021 13:19:54 -0700 Message-ID: Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default To: Emmanuel Vadot Cc: "Rodney W. Grimes" , "Rodney W. Grimes" , gljennjohn@gmail.com, Gleb Smirnoff , Slawa Olhovchenkov , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000009977a905cef6bc5a" X-Rspamd-Queue-Id: 4HbbLY2dCJz4lwk X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N --0000000000009977a905cef6bc5a Content-Type: text/plain; charset="UTF-8" On Fri, Oct 22, 2021 at 10:47 AM Emmanuel Vadot wrote: > On Fri, 22 Oct 2021 10:04:15 -0700 (PDT) > "Rodney W. Grimes" wrote: > > > We need to STOP these "I dont like the 20 year old defaults, > > so I am going to change them to what I like and use" It is NOT > > forward progress on making a better system, it is tilting at > > defaults, very long established defaults, that should probably > > just be left alone. > > It's not "I don't like", it's "We don't like". If we can't change > FreeBSD default to what most of our users want I don't know why we're > still working on this OS. > **We** can change the defaults. But to know that we, as a community, have consensus to make the change, we need to have a conversation. Having that conversation before making the change seems like a much better [*] approach than presenting the change as a fait accompli and waiting for dissent. In other words, I am okay with changing the default (I personally do not feel a need for it), but am unhappy that there was no conversation about it other than a phabricator review that was apparently only open for about a day. -Ben * I have some other, more precise, adjectives I would like to use, but I think the risk of them being interpreted harmfully is too high to use them in this forum. I'm happy to talk more in some other forum if you want. --0000000000009977a905cef6bc5a-- From nobody Fri Oct 22 20:30:48 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E0CE617F0717; Fri, 22 Oct 2021 20:30: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 4HbbZw62Rjz4pZd; Fri, 22 Oct 2021 20:30: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 AEFAB154BB; Fri, 22 Oct 2021 20:30: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 19MKUmQN073914; Fri, 22 Oct 2021 20:30:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19MKUmSR073913; Fri, 22 Oct 2021 20:30:48 GMT (envelope-from git) Date: Fri, 22 Oct 2021 20:30:48 GMT Message-Id: <202110222030.19MKUmSR073913@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: c2426723394b - main - Fix sconfig(8) build. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c2426723394ba9ab8ffa0d69bd132af1aaa2ea12 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=c2426723394ba9ab8ffa0d69bd132af1aaa2ea12 commit c2426723394ba9ab8ffa0d69bd132af1aaa2ea12 Author: Gleb Smirnoff AuthorDate: 2021-10-22 20:28:44 +0000 Commit: Gleb Smirnoff CommitDate: 2021-10-22 20:28:44 +0000 Fix sconfig(8) build. Missed that since sconfig(8) was built on i386 only. Since I enabled cp(4) on amd64, enable sconfig(8) as well. Fixes: 6aae3517ed25 --- sbin/Makefile | 4 ---- sbin/Makefile.amd64 | 1 + sbin/sconfig/Makefile | 2 +- sbin/sconfig/sconfig.c | 5 +---- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/sbin/Makefile b/sbin/Makefile index ade73fc8b0ee..b4da58680458 100644 --- a/sbin/Makefile +++ b/sbin/Makefile @@ -93,10 +93,6 @@ SUBDIR.${MK_TESTS}+= tests SUBDIR_PARALLEL= -# Add architecture-specific manpages -# to be included anyway -MAN= sconfig/sconfig.8 - .include .include diff --git a/sbin/Makefile.amd64 b/sbin/Makefile.amd64 index 2d231b0cb2b0..4135c44082c9 100644 --- a/sbin/Makefile.amd64 +++ b/sbin/Makefile.amd64 @@ -2,3 +2,4 @@ SUBDIR += bsdlabel SUBDIR += fdisk +SUBDIR += sconfig diff --git a/sbin/sconfig/Makefile b/sbin/sconfig/Makefile index bce914f40868..96fb46434d7a 100644 --- a/sbin/sconfig/Makefile +++ b/sbin/sconfig/Makefile @@ -4,7 +4,7 @@ PACKAGE=runtime PROG= sconfig MAN= sconfig.8 -MANSUBDIR= /i386 WARNS?= 2 +CFLAGS+= -I${SRCTOP}/sys/dev/cp .include diff --git a/sbin/sconfig/sconfig.c b/sbin/sconfig/sconfig.c index eebf6013e167..48363036e412 100644 --- a/sbin/sconfig/sconfig.c +++ b/sbin/sconfig/sconfig.c @@ -29,10 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include -#include +#include "cserial.h" #define MAXCHAN 128 From nobody Fri Oct 22 20:55:40 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C50AE1805383; Fri, 22 Oct 2021 20:55:43 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mail.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hbc7g1Dm6z3DBv; Fri, 22 Oct 2021 20:55:42 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1634936141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Xi02XAFA+D8sBuQaJVZN1TA0dAQkl/Nk9KSicA35r0s=; b=e/4Mm3aYZHrZESsVUB7XHkN4iouQdSP7Pfki9cQFKeyvq3Iyz8MArYRm9viHAvnoTCb4xT aX/pthNwmM4JIxwHaptCxMSjAnxCR7K1lAWTnMv3aqqdVyFRAwOrc/3vze1RnbowuNss7W aJRiJ/52OrEqZCnRSOpXuwl50Px4Ukg= Received: from amy (lfbn-idf2-1-644-191.w86-247.abo.wanadoo.fr [86.247.100.191]) by mx.blih.net (OpenSMTPD) with ESMTPSA id c5365e59 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 22 Oct 2021 20:55:41 +0000 (UTC) Date: Fri, 22 Oct 2021 22:55:40 +0200 From: Emmanuel Vadot To: Benjamin Kaduk Cc: "Rodney W. Grimes" , "Rodney W. Grimes" , gljennjohn@gmail.com, Gleb Smirnoff , Slawa Olhovchenkov , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default Message-Id: <20211022225540.a4220cfddc96cc1e08cb5235@bidouilliste.com> In-Reply-To: References: <20211021192020.6dcb95c1@ernst.home> <202110221704.19MH4FDn075994@gndrsh.dnsmgr.net> <20211022194717.8c94d2fa302339b55882497f@bidouilliste.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Hbc7g1Dm6z3DBv X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Fri, 22 Oct 2021 13:19:54 -0700 Benjamin Kaduk wrote: > On Fri, Oct 22, 2021 at 10:47 AM Emmanuel Vadot > wrote: > > > On Fri, 22 Oct 2021 10:04:15 -0700 (PDT) > > "Rodney W. Grimes" wrote: > > > > > We need to STOP these "I dont like the 20 year old defaults, > > > so I am going to change them to what I like and use" It is NOT > > > forward progress on making a better system, it is tilting at > > > defaults, very long established defaults, that should probably > > > just be left alone. > > > > It's not "I don't like", it's "We don't like". If we can't change > > FreeBSD default to what most of our users want I don't know why we're > > still working on this OS. > > > > **We** can change the defaults. But to know that we, as a community, have > consensus to make the change, we need to have a conversation. Having that > conversation before making the change seems like a much better [*] approach > than presenting the change as a fait accompli and waiting for dissent. > > In other words, I am okay with changing the default (I personally do not > feel a need for it), but am unhappy that there was no conversation about it > other than a phabricator review that was apparently only open for about a > day. > > -Ben > > * I have some other, more precise, adjectives I would like to use, but I > think the risk of them being interpreted harmfully is too high to use them > in this forum. I'm happy to talk more in some other forum if you want. If I knew that this change would have caused that much mails I would have send a mail to current or whatever before and left the review opened for more time. I honestly thought that this setting was something that you setup once when you installed a new machine (which doesn't happens very often) and forget about it, you know another "ah crap yes I forgot about this, why do we have such insane default. Oh well now that I disabled it locally I don't have to think about it and won't change the default". Instead this time I didn't say to myself that I won't change it and I did. -- Emmanuel Vadot From nobody Fri Oct 22 21:55:25 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A2BD91801ACD; Fri, 22 Oct 2021 21:55: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 4HbdSY4F0Bz3ng0; Fri, 22 Oct 2021 21:55: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 704E71677E; Fri, 22 Oct 2021 21:55: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 19MLtP28083883; Fri, 22 Oct 2021 21:55:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19MLtPhI083882; Fri, 22 Oct 2021 21:55:25 GMT (envelope-from git) Date: Fri, 22 Oct 2021 21:55:25 GMT Message-Id: <202110222155.19MLtPhI083882@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: c8ee75f2315e - main - Use network epoch to protect local IPv4 addresses hash. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c8ee75f2315e8267ad814dc5b4645ef205f0e0e1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=c8ee75f2315e8267ad814dc5b4645ef205f0e0e1 commit c8ee75f2315e8267ad814dc5b4645ef205f0e0e1 Author: Gleb Smirnoff AuthorDate: 2021-10-10 17:02:26 +0000 Commit: Gleb Smirnoff CommitDate: 2021-10-22 21:40:53 +0000 Use network epoch to protect local IPv4 addresses hash. The modification to the hash are already naturally locked by in_control_sx. Convert the hash lists to CK lists. Remove the in_ifaddr_rmlock. Assert the network epoch where necessary. Most cases when the hash lookup is done the epoch is already entered. Cover a few cases, that need entering the epoch, which mostly is initial configuration of tunnel interfaces and multicast addresses. Reviewed by: melifaro Differential revision: https://reviews.freebsd.org/D32584 --- sys/net/if_ipsec.c | 3 +++ sys/net/if_me.c | 3 +++ sys/net/if_stf.c | 6 +----- sys/netinet/if_ether.c | 13 +++---------- sys/netinet/in.c | 46 ++++++++++++++++++++-------------------------- sys/netinet/in.h | 2 +- sys/netinet/in_debug.c | 6 +++--- sys/netinet/in_gif.c | 3 +++ sys/netinet/in_mcast.c | 28 +++++++++++++++------------- sys/netinet/in_var.h | 24 +++++++----------------- sys/netinet/ip_gre.c | 3 +++ sys/netinet/ip_icmp.c | 7 +------ sys/netinet/ip_input.c | 12 ++++-------- sys/netpfil/pf/pf.c | 17 +++-------------- 14 files changed, 70 insertions(+), 103 deletions(-) diff --git a/sys/net/if_ipsec.c b/sys/net/if_ipsec.c index b9931286a735..b170ac177a64 100644 --- a/sys/net/if_ipsec.c +++ b/sys/net/if_ipsec.c @@ -1014,6 +1014,7 @@ static int ipsec_set_tunnel(struct ipsec_softc *sc, struct sockaddr *src, struct sockaddr *dst, uint32_t reqid) { + struct epoch_tracker et; struct secpolicy *sp[IPSEC_SPCOUNT]; int i; @@ -1037,7 +1038,9 @@ ipsec_set_tunnel(struct ipsec_softc *sc, struct sockaddr *src, sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; return (ENOMEM); } + NET_EPOCH_ENTER(et); ipsec_set_running(sc); + NET_EPOCH_EXIT(et); return (0); } diff --git a/sys/net/if_me.c b/sys/net/if_me.c index 067ab22cd84d..e1b932bdb16c 100644 --- a/sys/net/if_me.c +++ b/sys/net/if_me.c @@ -403,6 +403,7 @@ me_srcaddr(void *arg __unused, const struct sockaddr *sa, static int me_set_tunnel(struct me_softc *sc, in_addr_t src, in_addr_t dst) { + struct epoch_tracker et; struct me_softc *tmp; sx_assert(&me_ioctl_sx, SA_XLOCKED); @@ -429,7 +430,9 @@ me_set_tunnel(struct me_softc *sc, in_addr_t src, in_addr_t dst) CK_LIST_INSERT_HEAD(&ME_HASH(src, dst), sc, chain); CK_LIST_INSERT_HEAD(&ME_SRCHASH(src), sc, srchash); + NET_EPOCH_ENTER(et); me_set_running(sc); + NET_EPOCH_EXIT(et); if_link_state_change(ME2IFP(sc), LINK_STATE_UP); return (0); } diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index f7d6758d052c..de442a133fc6 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -87,7 +87,6 @@ #include #include #include -#include #include #include @@ -369,7 +368,6 @@ stf_encapcheck(const struct mbuf *m, int off, int proto, void *arg) static int stf_getsrcifa6(struct ifnet *ifp, struct in6_addr *addr, struct in6_addr *mask) { - struct rm_priotracker in_ifa_tracker; struct ifaddr *ia; struct in_ifaddr *ia4; struct in6_ifaddr *ia6; @@ -386,11 +384,9 @@ stf_getsrcifa6(struct ifnet *ifp, struct in6_addr *addr, struct in6_addr *mask) continue; bcopy(GET_V4(&sin6->sin6_addr), &in, sizeof(in)); - IN_IFADDR_RLOCK(&in_ifa_tracker); - LIST_FOREACH(ia4, INADDR_HASH(in.s_addr), ia_hash) + CK_LIST_FOREACH(ia4, INADDR_HASH(in.s_addr), ia_hash) if (ia4->ia_addr.sin_addr.s_addr == in.s_addr) break; - IN_IFADDR_RUNLOCK(&in_ifa_tracker); if (ia4 == NULL) continue; diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 45ce04117948..f54df9937936 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -779,7 +778,6 @@ SYSCTL_INT(_net_link_ether_inet, OID_AUTO, allow_multicast, CTLFLAG_RW, static void in_arpinput(struct mbuf *m) { - struct rm_priotracker in_ifa_tracker; struct arphdr *ah; struct ifnet *ifp = m->m_pkthdr.rcvif; struct llentry *la = NULL, *la_tmp; @@ -846,24 +844,21 @@ in_arpinput(struct mbuf *m) * of the receive interface. (This will change slightly * when we have clusters of interfaces). */ - IN_IFADDR_RLOCK(&in_ifa_tracker); - LIST_FOREACH(ia, INADDR_HASH(itaddr.s_addr), ia_hash) { + CK_LIST_FOREACH(ia, INADDR_HASH(itaddr.s_addr), ia_hash) { if (((bridged && ia->ia_ifp->if_bridge == ifp->if_bridge) || ia->ia_ifp == ifp) && itaddr.s_addr == ia->ia_addr.sin_addr.s_addr && (ia->ia_ifa.ifa_carp == NULL || (*carp_iamatch_p)(&ia->ia_ifa, &enaddr))) { ifa_ref(&ia->ia_ifa); - IN_IFADDR_RUNLOCK(&in_ifa_tracker); goto match; } } - LIST_FOREACH(ia, INADDR_HASH(isaddr.s_addr), ia_hash) + CK_LIST_FOREACH(ia, INADDR_HASH(isaddr.s_addr), ia_hash) if (((bridged && ia->ia_ifp->if_bridge == ifp->if_bridge) || ia->ia_ifp == ifp) && isaddr.s_addr == ia->ia_addr.sin_addr.s_addr) { ifa_ref(&ia->ia_ifa); - IN_IFADDR_RUNLOCK(&in_ifa_tracker); goto match; } @@ -878,17 +873,15 @@ in_arpinput(struct mbuf *m) * meant to be destined to the bridge member. */ if (is_bridge) { - LIST_FOREACH(ia, INADDR_HASH(itaddr.s_addr), ia_hash) { + CK_LIST_FOREACH(ia, INADDR_HASH(itaddr.s_addr), ia_hash) { if (BDG_MEMBER_MATCHES_ARP(itaddr.s_addr, ifp, ia)) { ifa_ref(&ia->ia_ifa); ifp = ia->ia_ifp; - IN_IFADDR_RUNLOCK(&in_ifa_tracker); goto match; } } } #undef BDG_MEMBER_MATCHES_ARP - IN_IFADDR_RUNLOCK(&in_ifa_tracker); /* * No match, use the first inet address on the receive interface diff --git a/sys/netinet/in.c b/sys/netinet/in.c index aa87546be2d4..8eb20f0f2d27 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -124,21 +123,18 @@ in_localaddr(struct in_addr in) * Return 1 if an internet address is for the local host and configured * on one of its interfaces. */ -int +bool in_localip(struct in_addr in) { - struct rm_priotracker in_ifa_tracker; struct in_ifaddr *ia; - IN_IFADDR_RLOCK(&in_ifa_tracker); - LIST_FOREACH(ia, INADDR_HASH(in.s_addr), ia_hash) { - if (IA_SIN(ia)->sin_addr.s_addr == in.s_addr) { - IN_IFADDR_RUNLOCK(&in_ifa_tracker); - return (1); - } - } - IN_IFADDR_RUNLOCK(&in_ifa_tracker); - return (0); + NET_EPOCH_ASSERT(); + + CK_LIST_FOREACH(ia, INADDR_HASH(in.s_addr), ia_hash) + if (IA_SIN(ia)->sin_addr.s_addr == in.s_addr) + return (true); + + return (false); } /* @@ -170,24 +166,24 @@ in_ifhasaddr(struct ifnet *ifp, struct in_addr in) static struct in_ifaddr * in_localip_more(struct in_ifaddr *original_ia) { - struct rm_priotracker in_ifa_tracker; + struct epoch_tracker et; in_addr_t original_addr = IA_SIN(original_ia)->sin_addr.s_addr; uint32_t original_fib = original_ia->ia_ifa.ifa_ifp->if_fib; struct in_ifaddr *ia; - IN_IFADDR_RLOCK(&in_ifa_tracker); - LIST_FOREACH(ia, INADDR_HASH(original_addr), ia_hash) { + NET_EPOCH_ENTER(et); + CK_LIST_FOREACH(ia, INADDR_HASH(original_addr), ia_hash) { in_addr_t addr = IA_SIN(ia)->sin_addr.s_addr; uint32_t fib = ia->ia_ifa.ifa_ifp->if_fib; if (!V_rt_add_addr_allfibs && (original_fib != fib)) continue; if ((original_ia != ia) && (original_addr == addr)) { ifa_ref(&ia->ia_ifa); - IN_IFADDR_RUNLOCK(&in_ifa_tracker); + NET_EPOCH_EXIT(et); return (ia); } } - IN_IFADDR_RUNLOCK(&in_ifa_tracker); + NET_EPOCH_EXIT(et); return (NULL); } @@ -500,10 +496,10 @@ in_aifaddr_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, struct thread *td) IF_ADDR_WUNLOCK(ifp); ifa_ref(ifa); /* in_ifaddrhead */ - IN_IFADDR_WLOCK(); + sx_assert(&in_control_sx, SA_XLOCKED); CK_STAILQ_INSERT_TAIL(&V_in_ifaddrhead, ia, ia_link); - LIST_INSERT_HEAD(INADDR_HASH(ia->ia_addr.sin_addr.s_addr), ia, ia_hash); - IN_IFADDR_WUNLOCK(); + CK_LIST_INSERT_HEAD(INADDR_HASH(ia->ia_addr.sin_addr.s_addr), ia, + ia_hash); /* * Give the interface a chance to initialize @@ -575,10 +571,9 @@ fail1: IF_ADDR_WUNLOCK(ifp); ifa_free(&ia->ia_ifa); /* if_addrhead */ - IN_IFADDR_WLOCK(); + sx_assert(&in_control_sx, SA_XLOCKED); CK_STAILQ_REMOVE(&V_in_ifaddrhead, ia, in_ifaddr, ia_link); - LIST_REMOVE(ia, ia_hash); - IN_IFADDR_WUNLOCK(); + CK_LIST_REMOVE(ia, ia_hash); ifa_free(&ia->ia_ifa); /* in_ifaddrhead */ return (error); @@ -639,10 +634,9 @@ in_difaddr_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, struct thread *td) IF_ADDR_WUNLOCK(ifp); ifa_free(&ia->ia_ifa); /* if_addrhead */ - IN_IFADDR_WLOCK(); + sx_assert(&in_control_sx, SA_XLOCKED); CK_STAILQ_REMOVE(&V_in_ifaddrhead, ia, in_ifaddr, ia_link); - LIST_REMOVE(ia, ia_hash); - IN_IFADDR_WUNLOCK(); + CK_LIST_REMOVE(ia, ia_hash); /* * in_scrubprefix() kills the interface route. diff --git a/sys/netinet/in.h b/sys/netinet/in.h index 0206fd16d2fe..0506f1739e9b 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -649,7 +649,7 @@ int in_broadcast(struct in_addr, struct ifnet *); int in_ifaddr_broadcast(struct in_addr, struct in_ifaddr *); int in_canforward(struct in_addr); int in_localaddr(struct in_addr); -int in_localip(struct in_addr); +bool in_localip(struct in_addr); int in_ifhasaddr(struct ifnet *, struct in_addr); struct in_ifaddr *in_findlocal(uint32_t, bool); int inet_aton(const char *, struct in_addr *); /* in libkern */ diff --git a/sys/netinet/in_debug.c b/sys/netinet/in_debug.c index d39c528dd9cd..00bc2636b436 100644 --- a/sys/netinet/in_debug.c +++ b/sys/netinet/in_debug.c @@ -90,9 +90,9 @@ in_show_in_ifaddr(struct in_ifaddr *ia) IA_DB_RPINTF_PTR("%p", ia_ifa); IA_DB_RPINTF("0x%08lx", ia_subnet); IA_DB_RPINTF("0x%08lx", ia_subnetmask); - IA_DB_RPINTF("%p", ia_hash.le_next); - IA_DB_RPINTF("%p", ia_hash.le_prev); - IA_DB_RPINTF_DPTR("%p", ia_hash.le_prev); + IA_DB_RPINTF("%p", ia_hash.cle_next); + IA_DB_RPINTF("%p", ia_hash.cle_prev); + IA_DB_RPINTF_DPTR("%p", ia_hash.cle_prev); IA_DB_RPINTF("%p", ia_link.cstqe_next); IA_DB_RPINTF_PTR("%p", ia_addr); IA_DB_RPINTF_PTR("%p", ia_dstaddr); diff --git a/sys/netinet/in_gif.c b/sys/netinet/in_gif.c index a9f3d384fb5a..6290de6cb31e 100644 --- a/sys/netinet/in_gif.c +++ b/sys/netinet/in_gif.c @@ -196,6 +196,7 @@ int in_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_t data) { struct ifreq *ifr = (struct ifreq *)data; + struct epoch_tracker et; struct sockaddr_in *dst, *src; struct ip *ip; int error; @@ -245,7 +246,9 @@ in_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_t data) sc->gif_family = AF_INET; sc->gif_iphdr = ip; in_gif_attach(sc); + NET_EPOCH_ENTER(et); in_gif_set_running(sc); + NET_EPOCH_EXIT(et); break; case SIOCGIFPSRCADDR: case SIOCGIFPDSTADDR: diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c index f307be283e64..6ac81aa98e44 100644 --- a/sys/netinet/in_mcast.c +++ b/sys/netinet/in_mcast.c @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -1378,7 +1377,6 @@ static int inp_block_unblock_source(struct inpcb *inp, struct sockopt *sopt) { struct group_source_req gsr; - struct rm_priotracker in_ifa_tracker; sockunion_t *gsa, *ssa; struct ifnet *ifp; struct in_mfilter *imf; @@ -1416,9 +1414,12 @@ inp_block_unblock_source(struct inpcb *inp, struct sockopt *sopt) ssa->sin.sin_addr = mreqs.imr_sourceaddr; if (!in_nullhost(mreqs.imr_interface)) { - IN_IFADDR_RLOCK(&in_ifa_tracker); + struct epoch_tracker et; + + NET_EPOCH_ENTER(et); INADDR_TO_IFP(mreqs.imr_interface, ifp); - IN_IFADDR_RUNLOCK(&in_ifa_tracker); + /* XXXGL: ifref? */ + NET_EPOCH_EXIT(et); } if (sopt->sopt_name == IP_BLOCK_SOURCE) doblock = 1; @@ -1871,7 +1872,6 @@ static struct ifnet * inp_lookup_mcast_ifp(const struct inpcb *inp, const struct sockaddr_in *gsin, const struct in_addr ina) { - struct rm_priotracker in_ifa_tracker; struct ifnet *ifp; struct nhop_object *nh; @@ -1883,11 +1883,9 @@ inp_lookup_mcast_ifp(const struct inpcb *inp, ifp = NULL; if (!in_nullhost(ina)) { - IN_IFADDR_RLOCK(&in_ifa_tracker); INADDR_TO_IFP(ina, ifp); if (ifp != NULL) if_ref(ifp); - IN_IFADDR_RUNLOCK(&in_ifa_tracker); } else { nh = fib4_lookup(inp->inp_inc.inc_fibnum, gsin->sin_addr, 0, NHR_NONE, 0); if (nh != NULL) { @@ -2247,7 +2245,6 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sopt) { struct group_source_req gsr; struct ip_mreq_source mreqs; - struct rm_priotracker in_ifa_tracker; sockunion_t *gsa, *ssa; struct ifnet *ifp; struct in_mfilter *imf; @@ -2307,9 +2304,12 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sopt) * using an IPv4 address as a key is racy. */ if (!in_nullhost(mreqs.imr_interface)) { - IN_IFADDR_RLOCK(&in_ifa_tracker); + struct epoch_tracker et; + + NET_EPOCH_ENTER(et); INADDR_TO_IFP(mreqs.imr_interface, ifp); - IN_IFADDR_RUNLOCK(&in_ifa_tracker); + /* XXXGL ifref? */ + NET_EPOCH_EXIT(et); } CTR3(KTR_IGMPV3, "%s: imr_interface = 0x%08x, ifp = %p", __func__, ntohl(mreqs.imr_interface.s_addr), ifp); @@ -2465,7 +2465,6 @@ out_inp_locked: static int inp_set_multicast_if(struct inpcb *inp, struct sockopt *sopt) { - struct rm_priotracker in_ifa_tracker; struct in_addr addr; struct ip_mreqn mreqn; struct ifnet *ifp; @@ -2504,9 +2503,12 @@ inp_set_multicast_if(struct inpcb *inp, struct sockopt *sopt) if (in_nullhost(addr)) { ifp = NULL; } else { - IN_IFADDR_RLOCK(&in_ifa_tracker); + struct epoch_tracker et; + + NET_EPOCH_ENTER(et); INADDR_TO_IFP(addr, ifp); - IN_IFADDR_RUNLOCK(&in_ifa_tracker); + /* XXXGL ifref? */ + NET_EPOCH_EXIT(et); if (ifp == NULL) return (EADDRNOTAVAIL); } diff --git a/sys/netinet/in_var.h b/sys/netinet/in_var.h index c33098e2c79c..a6902159e739 100644 --- a/sys/netinet/in_var.h +++ b/sys/netinet/in_var.h @@ -79,7 +79,7 @@ struct in_ifaddr { /* ia_subnet{,mask} in host order */ u_long ia_subnet; /* subnet address */ u_long ia_subnetmask; /* mask of subnet */ - LIST_ENTRY(in_ifaddr) ia_hash; /* entry in bucket of inet addresses */ + CK_LIST_ENTRY(in_ifaddr) ia_hash; /* hash of internet addresses */ CK_STAILQ_ENTRY(in_ifaddr) ia_link; /* list of internet addresses */ struct sockaddr_in ia_addr; /* reserve space for interface name */ struct sockaddr_in ia_dstaddr; /* reserve space for broadcast addr */ @@ -108,7 +108,7 @@ extern u_char inetctlerrmap[]; * Hash table for IP addresses. */ CK_STAILQ_HEAD(in_ifaddrhead, in_ifaddr); -LIST_HEAD(in_ifaddrhashhead, in_ifaddr); +CK_LIST_HEAD(in_ifaddrhashhead, in_ifaddr); VNET_DECLARE(struct in_ifaddrhashhead *, in_ifaddrhashtbl); VNET_DECLARE(struct in_ifaddrhead, in_ifaddrhead); @@ -124,16 +124,6 @@ VNET_DECLARE(u_long, in_ifaddrhmask); /* mask for hash table */ #define INADDR_HASH(x) \ (&V_in_ifaddrhashtbl[INADDR_HASHVAL(x) & V_in_ifaddrhmask]) -extern struct rmlock in_ifaddr_lock; - -#define IN_IFADDR_LOCK_ASSERT() rm_assert(&in_ifaddr_lock, RA_LOCKED) -#define IN_IFADDR_RLOCK(t) rm_rlock(&in_ifaddr_lock, (t)) -#define IN_IFADDR_RLOCK_ASSERT() rm_assert(&in_ifaddr_lock, RA_RLOCKED) -#define IN_IFADDR_RUNLOCK(t) rm_runlock(&in_ifaddr_lock, (t)) -#define IN_IFADDR_WLOCK() rm_wlock(&in_ifaddr_lock) -#define IN_IFADDR_WLOCK_ASSERT() rm_assert(&in_ifaddr_lock, RA_WLOCKED) -#define IN_IFADDR_WUNLOCK() rm_wunlock(&in_ifaddr_lock) - /* * Macro for finding the internet address structure (in_ifaddr) * corresponding to one of our IP addresses (in_addr). @@ -141,11 +131,11 @@ extern struct rmlock in_ifaddr_lock; #define INADDR_TO_IFADDR(addr, ia) \ /* struct in_addr addr; */ \ /* struct in_ifaddr *ia; */ \ -do { \ -\ - LIST_FOREACH(ia, INADDR_HASH((addr).s_addr), ia_hash) \ - if (IA_SIN(ia)->sin_addr.s_addr == (addr).s_addr) \ - break; \ +do { \ + NET_EPOCH_ASSERT(); \ + CK_LIST_FOREACH(ia, INADDR_HASH((addr).s_addr), ia_hash) \ + if (IA_SIN(ia)->sin_addr.s_addr == (addr).s_addr) \ + break; \ } while (0) /* diff --git a/sys/netinet/ip_gre.c b/sys/netinet/ip_gre.c index 0afd490944a4..6a2135fa32cd 100644 --- a/sys/netinet/ip_gre.c +++ b/sys/netinet/ip_gre.c @@ -363,6 +363,7 @@ fail: static int in_gre_attach(struct gre_softc *sc) { + struct epoch_tracker et; struct grehdr *gh; int error; @@ -397,7 +398,9 @@ in_gre_attach(struct gre_softc *sc) sc, srchash); /* Set IFF_DRV_RUNNING if interface is ready */ + NET_EPOCH_ENTER(et); in_gre_set_running(sc); + NET_EPOCH_EXIT(et); return (0); } diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index f8dfc21df8f3..463ac8c8e04d 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -756,7 +755,6 @@ freeit: static void icmp_reflect(struct mbuf *m) { - struct rm_priotracker in_ifa_tracker; struct ip *ip = mtod(m, struct ip *); struct ifaddr *ifa; struct ifnet *ifp; @@ -785,15 +783,12 @@ icmp_reflect(struct mbuf *m) * If the incoming packet was addressed directly to one of our * own addresses, use dst as the src for the reply. */ - IN_IFADDR_RLOCK(&in_ifa_tracker); - LIST_FOREACH(ia, INADDR_HASH(t.s_addr), ia_hash) { + CK_LIST_FOREACH(ia, INADDR_HASH(t.s_addr), ia_hash) { if (t.s_addr == IA_SIN(ia)->sin_addr.s_addr) { t = IA_SIN(ia)->sin_addr; - IN_IFADDR_RUNLOCK(&in_ifa_tracker); goto match; } } - IN_IFADDR_RUNLOCK(&in_ifa_tracker); /* * If the incoming packet was addressed to one of our broadcast diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 465c00e4dac7..dc122dd62e99 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -102,9 +102,6 @@ extern void ipreass_slowtimo(void); extern void ipreass_destroy(void); #endif -struct rmlock in_ifaddr_lock; -RM_SYSINIT(in_ifaddr_lock, &in_ifaddr_lock, "in_ifaddr_lock"); - VNET_DEFINE(int, rsvp_on); VNET_DEFINE(int, ipforwarding); @@ -180,6 +177,9 @@ VNET_DEFINE(struct in_ifaddrhead, in_ifaddrhead); /* first inet address */ VNET_DEFINE(struct in_ifaddrhashhead *, in_ifaddrhashtbl); /* inet addr hash table */ VNET_DEFINE(u_long, in_ifaddrhmask); /* mask for hash table */ +/* Make sure it is safe to use hashinit(9) on CK_LIST. */ +CTASSERT(sizeof(struct in_ifaddrhashhead) == sizeof(LIST_HEAD(, in_addr))); + #ifdef IPCTL_DEFMTU SYSCTL_INT(_net_inet_ip, IPCTL_DEFMTU, mtu, CTLFLAG_RW, &ip_mtu, 0, "Default MTU"); @@ -453,7 +453,6 @@ void ip_input(struct mbuf *m) { MROUTER_RLOCK_TRACKER; - struct rm_priotracker in_ifa_tracker; struct ip *ip = NULL; struct in_ifaddr *ia = NULL; struct ifaddr *ifa; @@ -689,8 +688,7 @@ passin: /* * Check for exact addresses in the hash bucket. */ - IN_IFADDR_RLOCK(&in_ifa_tracker); - LIST_FOREACH(ia, INADDR_HASH(ip->ip_dst.s_addr), ia_hash) { + CK_LIST_FOREACH(ia, INADDR_HASH(ip->ip_dst.s_addr), ia_hash) { /* * If the address matches, verify that the packet * arrived via the correct interface if checking is @@ -701,11 +699,9 @@ passin: counter_u64_add(ia->ia_ifa.ifa_ipackets, 1); counter_u64_add(ia->ia_ifa.ifa_ibytes, m->m_pkthdr.len); - IN_IFADDR_RUNLOCK(&in_ifa_tracker); goto ours; } } - IN_IFADDR_RUNLOCK(&in_ifa_tracker); /* * Check for broadcast addresses. diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 17253373628c..bb7667a3e270 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1593,20 +1593,9 @@ pf_isforlocal(struct mbuf *m, int af) switch (af) { #ifdef INET case AF_INET: { - struct rm_priotracker in_ifa_tracker; - struct ip *ip; - struct in_ifaddr *ia = NULL; - - ip = mtod(m, struct ip *); - IN_IFADDR_RLOCK(&in_ifa_tracker); - LIST_FOREACH(ia, INADDR_HASH(ip->ip_dst.s_addr), ia_hash) { - if (IA_SIN(ia)->sin_addr.s_addr == ip->ip_dst.s_addr) { - IN_IFADDR_RUNLOCK(&in_ifa_tracker); - return (true); - } - } - IN_IFADDR_RUNLOCK(&in_ifa_tracker); - break; + struct ip *ip = mtod(m, struct ip *); + + return (in_localip(ip->ip_dst)); } #endif #ifdef INET6 From nobody Fri Oct 22 22:53:54 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B5857181AB9E; Fri, 22 Oct 2021 22:53: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 4Hbfm24kSPz4b17; Fri, 22 Oct 2021 22:53: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 83A5616B7D; Fri, 22 Oct 2021 22:53: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 19MMrsG6064687; Fri, 22 Oct 2021 22:53:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19MMrssX064686; Fri, 22 Oct 2021 22:53:54 GMT (envelope-from git) Date: Fri, 22 Oct 2021 22:53:54 GMT Message-Id: <202110222253.19MMrssX064686@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: 5fff2859ec5d - main - bsnmpd: Remove "All Rights Reserved" from FreeBSD Foundation copyrights List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 5fff2859ec5de6ed4bcf0c4df1ceabcf14ff72dd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5fff2859ec5de6ed4bcf0c4df1ceabcf14ff72dd commit 5fff2859ec5de6ed4bcf0c4df1ceabcf14ff72dd Author: Ed Maste AuthorDate: 2021-10-22 22:52:05 +0000 Commit: Ed Maste CommitDate: 2021-10-22 22:53:35 +0000 bsnmpd: Remove "All Rights Reserved" from FreeBSD Foundation copyrights Sponsored by: The FreeBSD Foundation --- usr.sbin/bsnmpd/modules/snmp_wlan/BEGEMOT-WIRELESS-MIB.txt | 1 - usr.sbin/bsnmpd/modules/snmp_wlan/snmp_wlan.3 | 1 - usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.c | 1 - usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.h | 1 - usr.sbin/bsnmpd/modules/snmp_wlan/wlan_sys.c | 3 +-- usr.sbin/bsnmpd/modules/snmp_wlan/wlan_tree.def | 1 - 6 files changed, 1 insertion(+), 7 deletions(-) diff --git a/usr.sbin/bsnmpd/modules/snmp_wlan/BEGEMOT-WIRELESS-MIB.txt b/usr.sbin/bsnmpd/modules/snmp_wlan/BEGEMOT-WIRELESS-MIB.txt index 27f5be7d68f5..69873eddf33d 100644 --- a/usr.sbin/bsnmpd/modules/snmp_wlan/BEGEMOT-WIRELESS-MIB.txt +++ b/usr.sbin/bsnmpd/modules/snmp_wlan/BEGEMOT-WIRELESS-MIB.txt @@ -1,6 +1,5 @@ -- -- Copyright (C) 2010 The FreeBSD Foundation --- All rights reserved. -- -- This documentation was written by Shteryana Sotirova Shopova under -- sponsorship from the FreeBSD Foundation. diff --git a/usr.sbin/bsnmpd/modules/snmp_wlan/snmp_wlan.3 b/usr.sbin/bsnmpd/modules/snmp_wlan/snmp_wlan.3 index d027fc8876cb..f1bf983f579b 100644 --- a/usr.sbin/bsnmpd/modules/snmp_wlan/snmp_wlan.3 +++ b/usr.sbin/bsnmpd/modules/snmp_wlan/snmp_wlan.3 @@ -1,6 +1,5 @@ .\"- .\" Copyright (C) 2010 The FreeBSD Foundation -.\" All rights reserved. .\" .\" This documentation was written by Shteryana Sotirova Shopova under .\" sponsorship from the FreeBSD Foundation. diff --git a/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.c b/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.c index aa156a2f2321..aaa2b3071352 100644 --- a/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.c +++ b/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Shteryana Sotirova Shopova under * sponsorship from the FreeBSD Foundation. diff --git a/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.h b/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.h index d72db2995c2f..f5fce0e3a01f 100644 --- a/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.h +++ b/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.h @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. * * This software was developed by Shteryana Sotirova Shopova under * sponsorship from the FreeBSD Foundation. diff --git a/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_sys.c b/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_sys.c index c714f1fa4211..3ac2d63d105d 100644 --- a/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_sys.c +++ b/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_sys.c @@ -2,8 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2010 The FreeBSD Foundation - * All rights reserved. - + * * This software was developed by Shteryana Sotirova Shopova under * sponsorship from the FreeBSD Foundation. * diff --git a/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_tree.def b/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_tree.def index e0ae2a0030a1..630e46392f77 100644 --- a/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_tree.def +++ b/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_tree.def @@ -1,6 +1,5 @@ #- # Copyright (C) 2010 The FreeBSD Foundation -# All rights reserved. # # This software was developed by Shteryana Sotirova Shopova under # sponsorship from the FreeBSD Foundation. From nobody Fri Oct 22 23:31:34 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9FEDA180CE26; Fri, 22 Oct 2021 23:31: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 4HbgbV4BQ2z4p57; Fri, 22 Oct 2021 23:31: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 70C5F17C9A; Fri, 22 Oct 2021 23:31: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 19MNVYV7018014; Fri, 22 Oct 2021 23:31:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19MNVYlE018013; Fri, 22 Oct 2021 23:31:34 GMT (envelope-from git) Date: Fri, 22 Oct 2021 23:31:34 GMT Message-Id: <202110222331.19MNVYlE018013@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: 362c6d8dec6d - main - nehemiah: manually assemble xstore(-rng) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 362c6d8dec6dfbedc5717e45769042279a1dd3df Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=362c6d8dec6dfbedc5717e45769042279a1dd3df commit 362c6d8dec6dfbedc5717e45769042279a1dd3df Author: Konstantin Belousov AuthorDate: 2021-10-20 22:42:05 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-22 23:31:16 +0000 nehemiah: manually assemble xstore(-rng) It seems that clang IAS erronously adds repz prefix which should not be there. Cpu would try to store around %ecx bytes of random, while we only expect a word. PR: 259218 Reported and tested by: Dennis Clarke Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/dev/random/nehemiah.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/random/nehemiah.c b/sys/dev/random/nehemiah.c index ba0dfb200ba0..3ad18005c935 100644 --- a/sys/dev/random/nehemiah.c +++ b/sys/dev/random/nehemiah.c @@ -68,7 +68,7 @@ VIA_RNG_store(void *buf) #ifdef __GNUCLIKE_ASM __asm __volatile( "movl $0,%%edx\n\t" - "xstore" + ".byte 0x0f, 0xa7, 0xc0" : "=a" (retval), "+d" (rate), "+D" (buf) : : "memory" From nobody Sat Oct 23 00:00:19 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9563A1818392; Sat, 23 Oct 2021 00:00: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 4HbhDg3Xfqz3CVf; Sat, 23 Oct 2021 00:00: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 5A2A71811C; Sat, 23 Oct 2021 00:00: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 19N00J3W052896; Sat, 23 Oct 2021 00:00:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19N00JIK052888; Sat, 23 Oct 2021 00:00:19 GMT (envelope-from git) Date: Sat, 23 Oct 2021 00:00:19 GMT Message-Id: <202110230000.19N00JIK052888@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: 7b1e19ad78c6 - main - Add libfido2 to the build List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 7b1e19ad78c6a3f84f81cb1a16a39500f0337062 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7b1e19ad78c6a3f84f81cb1a16a39500f0337062 commit 7b1e19ad78c6a3f84f81cb1a16a39500f0337062 Author: Ed Maste AuthorDate: 2021-10-07 01:52:05 +0000 Commit: Ed Maste CommitDate: 2021-10-22 23:57:57 +0000 Add libfido2 to the build From https://github.com/Yubico/libfido2: libfido2 provides library functionality and command-line tools to communicate with a FIDO device over USB, and to verify attestation and assertion signatures. libfido2 supports the FIDO U2F (CTAP 1) and FIDO 2.0 (CTAP 2) protocols. libfido2 will be used by ssh to support FIDO/U2F keys. It is currently intended only for use by ssh, and so is installed as a PRIVATELIB and is placed in the ssh pkgbase package. This is currently disabled for the 32-bit library build as libfido2 is not compatible with the COMPAT_32BIT hack in usb_ioctl.h. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32448 --- lib/Makefile | 2 +- lib/libfido2/Makefile | 73 ++++++++++++++++++++++++++++++++ share/mk/src.libnames.mk | 3 ++ tools/build/mk/OptionalObsoleteFiles.inc | 3 ++ 4 files changed, 80 insertions(+), 1 deletion(-) diff --git a/lib/Makefile b/lib/Makefile index d39bbd37c910..81ace36ba990 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -216,7 +216,7 @@ SUBDIR.${MK_BHYVE}+= libvmmapi SUBDIR.${MK_OPENMP}+= libomp .endif .if !defined(COMPAT_32BIT) -SUBDIR.${MK_OPENSSH}+= libcbor +SUBDIR.${MK_OPENSSH}+= libcbor libfido2 .endif SUBDIR.${MK_OPENSSL}+= libmp SUBDIR.${MK_PF}+= libpfctl diff --git a/lib/libfido2/Makefile b/lib/libfido2/Makefile new file mode 100644 index 000000000000..edf737b9dafc --- /dev/null +++ b/lib/libfido2/Makefile @@ -0,0 +1,73 @@ +PACKAGE=ssh +LIB= fido2 +PRIVATELIB= +DIST= ${SRCTOP}/contrib/libfido2 + +.PATH: ${DIST}/src ${DIST} + +SRCS+= aes256.c +SRCS+= assert.c +SRCS+= authkey.c +SRCS+= bio.c +SRCS+= blob.c +SRCS+= buf.c +SRCS+= cbor.c +SRCS+= compress.c +SRCS+= config.c +SRCS+= cred.c +SRCS+= credman.c +SRCS+= dev.c +SRCS+= ecdh.c +SRCS+= eddsa.c +SRCS+= err.c +SRCS+= es256.c +SRCS+= hid_freebsd.c +SRCS+= hid_unix.c +SRCS+= hid.c +SRCS+= info.c +SRCS+= io.c +SRCS+= iso7816.c +SRCS+= largeblob.c +SRCS+= log.c +SRCS+= pin.c +SRCS+= random.c +SRCS+= reset.c +SRCS+= rs256.c +SRCS+= u2f.c + +SRCS+= openbsd-compat/freezero.c +SRCS+= openbsd-compat/recallocarray.c + +CFLAGS+= -I ${DIST}/src -I${SRCTOP}/contrib/libcbor/src -I${.CURDIR}/../libcbor +CFLAGS+= -D_FIDO_INTERNAL +CFLAGS+= -DHAVE_ARC4RANDOM_BUF +CFLAGS+= -DHAVE_CLOCK_GETTIME +CFLAGS+= -DHAVE_DEV_URANDOM +CFLAGS+= -DHAVE_ERR_H +CFLAGS+= -DHAVE_EXPLICIT_BZERO +CFLAGS+= -DHAVE_GETLINE +CFLAGS+= -DHAVE_GETOPT +CFLAGS+= -DHAVE_GETPAGESIZE +CFLAGS+= -DHAVE_GETRANDOM +CFLAGS+= -DHAVE_OPENSSLV_H +CFLAGS+= -DHAVE_READPASSPHRASE +CFLAGS+= -DHAVE_SIGNAL_H +CFLAGS+= -DHAVE_STRLCAT +CFLAGS+= -DHAVE_STRLCPY +CFLAGS+= -DHAVE_STRSEP +CFLAGS+= -DHAVE_SYSCONF +CFLAGS+= -DHAVE_SYS_RANDOM_H +CFLAGS+= -DHAVE_TIMESPECSUB +CFLAGS+= -DHAVE_TIMINGSAFE_BCMP +CFLAGS+= -DHAVE_UNISTD_H +CFLAGS+= -DTLS=__thread +CFLAGS+= -D_FIDO_MAJOR=1 +CFLAGS+= -D_FIDO_MINOR=9 +CFLAGS+= -D_FIDO_PATCH=0 + +LIBADD= crypto z + +WARNS=2 +MAN= + +.include diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index a3cf355de372..227691804e2a 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -20,6 +20,7 @@ _PRIVATELIBS= \ cbor \ devdctl \ event1 \ + fido2 \ gmock \ gtest \ gmock_main \ @@ -339,6 +340,7 @@ _DP_pam= radius tacplus opie md util _DP_pam+= krb5 .endif .if ${MK_OPENSSH} != "no" +_DP_fido2+= crypto z _DP_pam+= ssh .endif .if ${MK_NIS} != "no" @@ -690,6 +692,7 @@ LIBCAP_SYSCTLDIR= ${OBJTOP}/lib/libcasper/services/cap_sysctl LIBCAP_SYSLOGDIR= ${OBJTOP}/lib/libcasper/services/cap_syslog LIBCBORDIR= ${OBJTOP}/lib/libcbor LIBBSDXMLDIR= ${OBJTOP}/lib/libexpat +LIBFIDO2DIR= ${OBJTOP}/lib/libfido2 LIBKVMDIR= ${OBJTOP}/lib/libkvm LIBPTHREADDIR= ${OBJTOP}/lib/libthr LIBMDIR= ${OBJTOP}/lib/msun diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 141f691ba83e..3fd4a00bfb02 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -7124,6 +7124,9 @@ OLD_FILES+=usr/bin/ssh-keyscan OLD_FILES+=usr/lib/libprivatecbor.a OLD_FILES+=usr/lib/libprivatecbor.so OLD_LIBS+=usr/lib/libprivatecbor.so.5 +OLD_FILES+=/usr/lib/libprivatefido2.a +OLD_FILES+=/usr/lib/libprivatefido2.so +OLD_LIBS+=/usr/lib/libprivatefido2.so.5 OLD_FILES+=usr/lib/pam_ssh.so OLD_LIBS+=usr/lib/pam_ssh.so.6 OLD_FILES+=usr/lib/libprivatessh.a From nobody Sat Oct 23 00:26:49 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6C7FA1822125 for ; Sat, 23 Oct 2021 00:26:51 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.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 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HbhqH2LcVz3Kbq for ; Sat, 23 Oct 2021 00:26:51 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f54.google.com with SMTP id 67-20020a1c1946000000b0030d4c90fa87so3749420wmz.2 for ; Fri, 22 Oct 2021 17:26:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tO3mfJdmdYe6Xp1Siz0LOXpOQoj/RdjdZqmTfYfjUmM=; b=AgtkY+2KRNEEIQy9pEyEVcZYH9mgcKJc+TJCrkTzUks8dgEm5j31EzdSpa2IqwPxdh cbnkq+O9nzKp1TOjLhOMCQorwY7MXevjvRaRR76ASg+sEOtnJ32iM3Q6jqQvSr8bW+XQ a/OabSxyJBuROv7aiJvFwGnMeKx72Gzx/lxmdyEU4vdfgF3D3DU3vMz2fBPW2sKBmoJE fS5AVbSc7ni1xZhFlCJJdcWNKXS9dD8ChGBOI9efFfF5sr80X96hqdNZHyTx1G/qd3Ex nJeEHBmT15hTwZ9FsATB3ZqllrM4VCGQlAdo7GBRB0uA47L+5Yl0NfCI77PeGBm6vsNp 7r3A== X-Gm-Message-State: AOAM533lRvQmZZkjdsiL7h7TuZ9XbZEwwzODSnog35yfs/QmPuAVD8Xz u6eYMfAi8d1BILcVPBHpCE9+JA== X-Google-Smtp-Source: ABdhPJyZi+L3wYubGa/KFYpGqiDJCsNRodfTemkkRxz9gwlyC6mcz7bv3q3goFoOyTcp+8sp3hq0Uw== X-Received: by 2002:a1c:4489:: with SMTP id r131mr2110349wma.1.1634948810278; Fri, 22 Oct 2021 17:26:50 -0700 (PDT) Received: from smtpclient.apple (global-5-141.nat-2.net.cam.ac.uk. [131.111.5.141]) by smtp.gmail.com with ESMTPSA id e18sm564361wrv.44.2021.10.22.17.26.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Oct 2021 17:26:50 -0700 (PDT) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: 362c6d8dec6d - main - nehemiah: manually assemble xstore(-rng) From: Jessica Clarke In-Reply-To: <202110222331.19MNVYlE018013@gitrepo.freebsd.org> Date: Sat, 23 Oct 2021 01:26:49 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202110222331.19MNVYlE018013@gitrepo.freebsd.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4HbhqH2LcVz3Kbq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 23 Oct 2021, at 00:31, Konstantin Belousov wrote: >=20 > The branch main has been updated by kib: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D362c6d8dec6dfbedc5717e4576904227= 9a1dd3df >=20 > commit 362c6d8dec6dfbedc5717e45769042279a1dd3df > Author: Konstantin Belousov > AuthorDate: 2021-10-20 22:42:05 +0000 > Commit: Konstantin Belousov > CommitDate: 2021-10-22 23:31:16 +0000 >=20 > nehemiah: manually assemble xstore(-rng) >=20 > It seems that clang IAS erronously adds repz prefix which should = not be > there. Cpu would try to store around %ecx bytes of random, while = we > only expect a word. FYI: https://reviews.llvm.org/D112355 Jess From nobody Sat Oct 23 01:10:17 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A83F3180E66F; Sat, 23 Oct 2021 01:10:25 +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 4HbjnY2LlMz3nYZ; Sat, 23 Oct 2021 01:10:25 +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 19N1AHTd071267 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 23 Oct 2021 04:10:20 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 19N1AHTd071267 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 19N1AHCK071265; Sat, 23 Oct 2021 04:10:17 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 23 Oct 2021 04:10:17 +0300 From: Konstantin Belousov To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 362c6d8dec6d - main - nehemiah: manually assemble xstore(-rng) Message-ID: References: <202110222331.19MNVYlE018013@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4HbjnY2LlMz3nYZ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Sat, Oct 23, 2021 at 01:26:49AM +0100, Jessica Clarke wrote: > On 23 Oct 2021, at 00:31, Konstantin Belousov wrote: > > > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=362c6d8dec6dfbedc5717e45769042279a1dd3df > > > > commit 362c6d8dec6dfbedc5717e45769042279a1dd3df > > Author: Konstantin Belousov > > AuthorDate: 2021-10-20 22:42:05 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2021-10-22 23:31:16 +0000 > > > > nehemiah: manually assemble xstore(-rng) > > > > It seems that clang IAS erronously adds repz prefix which should not be > > there. Cpu would try to store around %ecx bytes of random, while we > > only expect a word. > > FYI: https://reviews.llvm.org/D112355 Thanks. Feel free to revert this commit after llvm in tree is fixed. From nobody Sat Oct 23 04:04:17 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3EBC2180E8B0; Sat, 23 Oct 2021 04:04: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 4HbnfB1N0vz3MZg; Sat, 23 Oct 2021 04:04: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 0EDA41B6C6; Sat, 23 Oct 2021 04:04: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 19N44HaL078589; Sat, 23 Oct 2021 04:04:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19N44H5G078588; Sat, 23 Oct 2021 04:04:17 GMT (envelope-from git) Date: Sat, 23 Oct 2021 04:04:17 GMT Message-Id: <202110230404.19N44H5G078588@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: 3550a49f6814 - main - msun: Add copyright notices List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 3550a49f6814af38c21b0033ef8746953451dade Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3550a49f6814af38c21b0033ef8746953451dade commit 3550a49f6814af38c21b0033ef8746953451dade Author: Warner Losh AuthorDate: 2021-10-23 04:00:54 +0000 Commit: Warner Losh CommitDate: 2021-10-23 04:00:54 +0000 msun: Add copyright notices These files were copied from MUSL. Add the standard copyright notice and SPDX-License-Identifier: MIT consistent with our new draft license policy. It reads word for word the same as the MIT license on the SPDX web site. Add a pointer to the MUSL COPYIRGHT file which contains a list of all authors of MUSL. Sponsored by: Netflix Noticed by: Steve Kargl --- lib/msun/src/s_scalbn.c | 8 ++++++++ lib/msun/src/s_scalbnf.c | 8 ++++++++ lib/msun/src/s_scalbnl.c | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/lib/msun/src/s_scalbn.c b/lib/msun/src/s_scalbn.c index 3de663f8b670..2d4f7a3c6164 100644 --- a/lib/msun/src/s_scalbn.c +++ b/lib/msun/src/s_scalbn.c @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2005-2020 Rich Felker, et al. + * + * SPDX-License-Identifier: MIT + * + * Please see https://git.musl-libc.org/cgit/musl/tree/COPYRIGHT + * for all contributors to musl. + */ #include #include #include diff --git a/lib/msun/src/s_scalbnf.c b/lib/msun/src/s_scalbnf.c index 3a46470b5661..8cf1e01150da 100644 --- a/lib/msun/src/s_scalbnf.c +++ b/lib/msun/src/s_scalbnf.c @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2005-2020 Rich Felker, et al. + * + * SPDX-License-Identifier: MIT + * + * Please see https://git.musl-libc.org/cgit/musl/tree/COPYRIGHT + * for all contributors to musl. + */ #include #include diff --git a/lib/msun/src/s_scalbnl.c b/lib/msun/src/s_scalbnl.c index a79f79b33480..6044c1b1d4f7 100644 --- a/lib/msun/src/s_scalbnl.c +++ b/lib/msun/src/s_scalbnl.c @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2005-2020 Rich Felker, et al. + * + * SPDX-License-Identifier: MIT + * + * Please see https://git.musl-libc.org/cgit/musl/tree/COPYRIGHT + * for all contributors to musl. + */ #include #include #include "math_private.h" From nobody Sat Oct 23 06:40:10 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9A2C917F3912; Sat, 23 Oct 2021 06:40:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hbs623yJfz4lWC; Sat, 23 Oct 2021 06:40:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 67AE71DA96; Sat, 23 Oct 2021 06:40:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19N6eAT7080609; Sat, 23 Oct 2021 06:40:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19N6eA5T080606; Sat, 23 Oct 2021 06:40:10 GMT (envelope-from git) Date: Sat, 23 Oct 2021 06:40:10 GMT Message-Id: <202110230640.19N6eA5T080606@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: 50b8e3efaf9e - main - stress2: Fix typo List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 50b8e3efaf9e3ec554723c23acd1f0765190067a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=50b8e3efaf9e3ec554723c23acd1f0765190067a commit 50b8e3efaf9e3ec554723c23acd1f0765190067a Author: Peter Holm AuthorDate: 2021-10-23 06:39:36 +0000 Commit: Peter Holm CommitDate: 2021-10-23 06:39:36 +0000 stress2: Fix typo --- tools/test/stress2/misc/force9.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/stress2/misc/force9.sh b/tools/test/stress2/misc/force9.sh index 325b227888a6..a62e00242a67 100755 --- a/tools/test/stress2/misc/force9.sh +++ b/tools/test/stress2/misc/force9.sh @@ -31,7 +31,7 @@ # "panic: ffs_checkblk: cylinder group read failed" seen: # https://people.freebsd.org/~pho/stress/log/log0170.txt -" "panic: softdep_update_inodeblock inconsistent ip ..." seen: +# "panic: softdep_update_inodeblock inconsistent ip ..." seen: # https://people.freebsd.org/~pho/stress/log/log0184.txt [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 From nobody Sat Oct 23 08:15:03 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 843BC180D8A2; Sat, 23 Oct 2021 08:15: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 4HbvCX20qVz3QH4; Sat, 23 Oct 2021 08:15: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 0761E1EFA1; Sat, 23 Oct 2021 08:15: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 19N8F3Jm010181; Sat, 23 Oct 2021 08:15:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19N8F3DZ010180; Sat, 23 Oct 2021 08:15:03 GMT (envelope-from git) Date: Sat, 23 Oct 2021 08:15:03 GMT Message-Id: <202110230815.19N8F3DZ010180@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: 3417c29851b6 - main - linux: Constify bsd_to_linux_regset() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 3417c29851b6fce32b4c459b4c0a197b2e33018b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=3417c29851b6fce32b4c459b4c0a197b2e33018b commit 3417c29851b6fce32b4c459b4c0a197b2e33018b Author: Edward Tomasz Napierala AuthorDate: 2021-10-23 07:33:48 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-10-23 07:33:58 +0000 linux: Constify bsd_to_linux_regset() No functional changes. Reviewed By: emaste Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D32599 --- sys/amd64/linux/linux.h | 2 +- sys/amd64/linux/linux_machdep.c | 2 +- sys/amd64/linux32/linux.h | 2 +- sys/amd64/linux32/linux32_machdep.c | 3 ++- sys/arm64/linux/linux.h | 2 +- sys/arm64/linux/linux_machdep.c | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/amd64/linux/linux.h b/sys/amd64/linux/linux.h index 9080bcb36cbc..519b6bd200ac 100644 --- a/sys/amd64/linux/linux.h +++ b/sys/amd64/linux/linux.h @@ -459,7 +459,7 @@ struct linux_pt_regset { struct reg; -void bsd_to_linux_regset(struct reg *b_reg, +void bsd_to_linux_regset(const struct reg *b_reg, struct linux_pt_regset *l_regset); #endif /* !_AMD64_LINUX_H_ */ diff --git a/sys/amd64/linux/linux_machdep.c b/sys/amd64/linux/linux_machdep.c index dc6b6140f60c..c34d98e86d0b 100644 --- a/sys/amd64/linux/linux_machdep.c +++ b/sys/amd64/linux/linux_machdep.c @@ -299,7 +299,7 @@ DEFINE_IFUNC(, int, futex_xorl, (int, uint32_t *, int *)) } void -bsd_to_linux_regset(struct reg *b_reg, struct linux_pt_regset *l_regset) +bsd_to_linux_regset(const struct reg *b_reg, struct linux_pt_regset *l_regset) { l_regset->r15 = b_reg->r_r15; diff --git a/sys/amd64/linux32/linux.h b/sys/amd64/linux32/linux.h index 8d7a36eedee9..f1f877181e47 100644 --- a/sys/amd64/linux32/linux.h +++ b/sys/amd64/linux32/linux.h @@ -634,7 +634,7 @@ struct linux_pt_regset32 { struct reg32; -void bsd_to_linux_regset32(struct reg32 *b_reg, +void bsd_to_linux_regset32(const struct reg32 *b_reg, struct linux_pt_regset32 *l_regset); #endif /* !_AMD64_LINUX_H_ */ diff --git a/sys/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c index 5801fac7f126..86f7bdc918d8 100644 --- a/sys/amd64/linux32/linux32_machdep.c +++ b/sys/amd64/linux32/linux32_machdep.c @@ -678,7 +678,8 @@ linux_set_thread_area(struct thread *td, } void -bsd_to_linux_regset32(struct reg32 *b_reg, struct linux_pt_regset32 *l_regset) +bsd_to_linux_regset32(const struct reg32 *b_reg, + struct linux_pt_regset32 *l_regset) { l_regset->ebx = b_reg->r_ebx; diff --git a/sys/arm64/linux/linux.h b/sys/arm64/linux/linux.h index b5273498a5aa..5e4bf3ae0680 100644 --- a/sys/arm64/linux/linux.h +++ b/sys/arm64/linux/linux.h @@ -322,7 +322,7 @@ struct linux_pt_regset { struct reg; -void bsd_to_linux_regset(struct reg *b_reg, +void bsd_to_linux_regset(const struct reg *b_reg, struct linux_pt_regset *l_regset); #endif /* _ARM64_LINUX_H_ */ diff --git a/sys/arm64/linux/linux_machdep.c b/sys/arm64/linux/linux_machdep.c index fae5bd11653b..c874f86a5f0c 100644 --- a/sys/arm64/linux/linux_machdep.c +++ b/sys/arm64/linux/linux_machdep.c @@ -133,7 +133,7 @@ linux_set_cloned_tls(struct thread *td, void *desc) } void -bsd_to_linux_regset(struct reg *b_reg, struct linux_pt_regset *l_regset) +bsd_to_linux_regset(const struct reg *b_reg, struct linux_pt_regset *l_regset) { KASSERT(sizeof(l_regset->x) == sizeof(b_reg->x) + sizeof(l_ulong), From nobody Sat Oct 23 08:27:00 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E66D01810E6C; Sat, 23 Oct 2021 08:27: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 4HbvTJ5wDgz3j16; Sat, 23 Oct 2021 08:27: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 AB76A1EEEC; Sat, 23 Oct 2021 08:27: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 19N8R0qQ023388; Sat, 23 Oct 2021 08:27:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19N8R0iO023387; Sat, 23 Oct 2021 08:27:00 GMT (envelope-from git) Date: Sat, 23 Oct 2021 08:27:00 GMT Message-Id: <202110230827.19N8R0iO023387@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: 2c7f79828254 - main - linux: Fix ENOTSOCK handling in sendfile(2) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 2c7f7982825442c851e8bb17555a086a232ef4d9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=2c7f7982825442c851e8bb17555a086a232ef4d9 commit 2c7f7982825442c851e8bb17555a086a232ef4d9 Author: Edward Tomasz Napierala AuthorDate: 2021-10-23 08:15:37 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-10-23 08:15:58 +0000 linux: Fix ENOTSOCK handling in sendfile(2) The Linux way for sendfile(2) to tell the application to fallback to another way of copying data is by EINVAL, not ENOTSOCK. This fixes package installation scripts for Mono packages from Focal. Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D32604 --- sys/compat/linux/linux_socket.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 9ae44b909d80..a2b45edf7bdc 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -2101,6 +2101,8 @@ linux_sendfile_common(struct thread *td, l_int out, l_int in, td->td_retval[0] = (ssize_t)bytes_read; drop: fdrop(fp, td); + if (error == ENOTSOCK) + error = EINVAL; return (error); } From nobody Sat Oct 23 08:31:48 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4E9E51813EBD; Sat, 23 Oct 2021 08:31: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 4HbvZr1qVDz3kpL; Sat, 23 Oct 2021 08:31: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 1E5881EFDE; Sat, 23 Oct 2021 08:31: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 19N8VmO4032857; Sat, 23 Oct 2021 08:31:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19N8Vmbr032856; Sat, 23 Oct 2021 08:31:48 GMT (envelope-from git) Date: Sat, 23 Oct 2021 08:31:48 GMT Message-Id: <202110230831.19N8Vmbr032856@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: e3a83df1195c - main - linux: Improve debug for PTRACE_GETREGSET List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: e3a83df1195cc4f48f2908b423b5c80dd9c49a21 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=e3a83df1195cc4f48f2908b423b5c80dd9c49a21 commit e3a83df1195cc4f48f2908b423b5c80dd9c49a21 Author: Edward Tomasz Napierala AuthorDate: 2021-10-22 18:58:52 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-10-23 08:30:06 +0000 linux: Improve debug for PTRACE_GETREGSET No functional changes. Sponsored By: EPSRC --- sys/amd64/linux/linux_ptrace.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/amd64/linux/linux_ptrace.c b/sys/amd64/linux/linux_ptrace.c index 370b1c818b6f..b8123221f463 100644 --- a/sys/amd64/linux/linux_ptrace.c +++ b/sys/amd64/linux/linux_ptrace.c @@ -85,6 +85,7 @@ __FBSDID("$FreeBSD$"); #define LINUX_PTRACE_O_SUSPEND_SECCOMP 2097152 #define LINUX_NT_PRSTATUS 0x1 +#define LINUX_NT_PRFPREG 0x2 #define LINUX_NT_X86_XSTATE 0x202 #define LINUX_PTRACE_O_MASK (LINUX_PTRACE_O_TRACESYSGOOD | \ @@ -541,6 +542,10 @@ linux_ptrace_getregset(struct thread *td, pid_t pid, l_ulong addr, l_ulong data) switch (addr) { case LINUX_NT_PRSTATUS: return (linux_ptrace_getregset_prstatus(td, pid, data)); + case LINUX_NT_PRFPREG: + linux_msg(td, "PTRAGE_GETREGSET NT_PRFPREG not implemented; " + "returning EINVAL"); + return (EINVAL); case LINUX_NT_X86_XSTATE: linux_msg(td, "PTRAGE_GETREGSET NT_X86_XSTATE not implemented; " "returning EINVAL"); From nobody Sat Oct 23 12:45:36 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3F1DC1801CF2; Sat, 23 Oct 2021 12:45:52 +0000 (UTC) (envelope-from Alexander@leidinger.net) Received: from mailgate.Leidinger.net (bastille.leidinger.net [89.238.82.207]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (P-256) client-digest SHA256) (Client CN "mailgate.leidinger.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hc1Cz6zDsz3mwj; Sat, 23 Oct 2021 12:45:51 +0000 (UTC) (envelope-from Alexander@leidinger.net) Received: from outgoing.leidinger.net (p508d5160.dip0.t-ipconnect.de [80.141.81.96]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256 client-signature ECDSA (P-256) client-digest SHA256) (Client CN "outgoing.leidinger.net", Issuer "R3" (verified OK)) by mailgate.Leidinger.net (Postfix) with ESMTPSA id C541F296D8; Sat, 23 Oct 2021 14:45:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leidinger.net; s=outgoing-alex; t=1634993142; 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=jZngrhoBkyR1MUemWQCFcmPbCTrIjYapEGDo4e0Jg5k=; b=nZpvVktJelAh+dX5mgwHsdHXeJrw9zgyl+aWT7/nFQOIDOL9CzL928IYeEiiT/1rfy+L3r KQTxs7PFT2AZu/+2xhh0hAMrOhi4GI+BTWeNUBT+4vgx+hgRYE+Wp7nT7EtHqpVmHjQ5EB O0IJNUdp8QywnCCXQdrXp2w+Q6bHffoJh405q4wwuHROBaoIA/A9R4AOAF00suPAp/Oyyq QcrYXsCQmYPSeDbjaCMj7tfCDXs/JKq13OPiw2ThlS7B5lDxKuGizgY0wkKOJs2xodrwq4 90BgZ+rciJz+rvoRn1ueYUoEiuc2K37h3uy3/qErb96j0URKDL48cGfQAuyqaQ== Received: from webmail.leidinger.net (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (Client did not present a certificate) by outgoing.leidinger.net (Postfix) with ESMTPS id AF0CB62D5; Sat, 23 Oct 2021 14:45:38 +0200 (CEST) Date: Sat, 23 Oct 2021 14:45:36 +0200 Message-ID: <20211023144536.Horde.FrlbSo1SLHpgxnKlAIimdzS@webmail.leidinger.net> To: Emmanuel Vadot Cc: Benjamin Kaduk , "Rodney W. Grimes" , "Rodney W. Grimes" , gljennjohn@gmail.com, Gleb Smirnoff , Slawa Olhovchenkov , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default References: <20211021192020.6dcb95c1@ernst.home> <202110221704.19MH4FDn075994@gndrsh.dnsmgr.net> <20211022194717.8c94d2fa302339b55882497f@bidouilliste.com> <20211022225540.a4220cfddc96cc1e08cb5235@bidouilliste.com> In-Reply-To: <20211022225540.a4220cfddc96cc1e08cb5235@bidouilliste.com> Accept-Language: de,en Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Disposition: inline X-Rspamd-Queue-Id: 4Hc1Cz6zDsz3mwj X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Reply-To: Alexander@leidinger.net From: Alexander Leidinger via dev-commits-src-all X-Original-From: Alexander Leidinger X-ThisMailContainsUnwantedMimeParts: N Quoting Emmanuel Vadot (from Fri, 22 Oct 2021 22:55:40 +0200): > I honestly thought that this setting was something that you setup once > when you installed a new machine (which doesn't happens very often) and > forget about it, you know another "ah crap yes I forgot about this, why > do we have such insane default. Oh well now that I disabled it locally > I don't have to think about it and won't change the default". Instead > this time I didn't say to myself that I won't change it and I did. May I offer another perspective into this? Something outside of 0 and 1... I wonder if it is really the default of bell=on is what is crap, or if the bug Warner found is what makes it crap, or if the frequency of the current setting is what makes it crap (or the two last items together). Personally I dislike the bell, but not as much that I want to disable it. I don't mind to have it disabled (I simply enabled it directly in sysctl.conf even as I haven't updated to past the commit), as I think it gives usefull feedback. It may not give useful feedback in all cases where it goes off, but that's something we have influence on, don't we? What I don't like about the bell is the noise it makes. So what about changing the noise it makes to something more pleasant and asking if this is better and maybe acceptable to those which don't like the bell? I also think that disabling a feature you know it exists but you don't like is much more easy than to enable a feature you don't know exists. Basically I question in this email the problem you want to solve by disabling the bell. Does it really need to be disabled, or would a change of the sound and volume make it acceptable for you (you = all people which complain or agree to "the current one is crap -> disable it" .... which basically means we would need to make some kind of usability test what sounds better before deciding if it shall be disabled or not)? For me the issue with the bell would be solved if it sounds "better" and is less loud. I assume we could even make it configurable to some extend (override a hardcoded frequency and volume with a sysctl). Bye, Alexander. -- http://www.Leidinger.net Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF From nobody Sat Oct 23 18:10:15 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 914A21825EE5; Sat, 23 Oct 2021 18:10: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 4Hc8QJ1QYTz4tHP; Sat, 23 Oct 2021 18:10: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 E37A5267F7; Sat, 23 Oct 2021 18:10: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 19NIAFmX000437; Sat, 23 Oct 2021 18:10:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19NIAFhc000431; Sat, 23 Oct 2021 18:10:15 GMT (envelope-from git) Date: Sat, 23 Oct 2021 18:10:15 GMT Message-Id: <202110231810.19NIAFhc000431@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: 2558bb8e9166 - main - linux: Make PTRACE_GET_SYSCALL_INFO handle EJUSTRETURN List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 2558bb8e9166395dce26afcfac91fc692621de7b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=2558bb8e9166395dce26afcfac91fc692621de7b commit 2558bb8e9166395dce26afcfac91fc692621de7b Author: Edward Tomasz Napierala AuthorDate: 2021-10-23 17:56:29 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-10-23 17:56:39 +0000 linux: Make PTRACE_GET_SYSCALL_INFO handle EJUSTRETURN This fixes panic when trying to run strace(8) from Focal. Reviewed By: kib Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D32355 --- sys/amd64/linux/linux_ptrace.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/amd64/linux/linux_ptrace.c b/sys/amd64/linux/linux_ptrace.c index b8123221f463..37f136856ef0 100644 --- a/sys/amd64/linux/linux_ptrace.c +++ b/sys/amd64/linux/linux_ptrace.c @@ -616,6 +616,15 @@ linux_ptrace_get_syscall_info(struct thread *td, pid_t pid, if (sr.sr_error == 0) { si.exit.rval = sr.sr_retval[0]; si.exit.is_error = 0; + } else if (sr.sr_error == EJUSTRETURN) { + /* + * EJUSTRETURN means the actual value to return + * has already been put into td_frame; instead + * of extracting it and trying to determine whether + * it's an error or not just bail out and let + * the ptracing process fall back to another method. + */ + si.op = LINUX_PTRACE_SYSCALL_INFO_NONE; } else { si.exit.rval = bsd_to_linux_errno(sr.sr_error); si.exit.is_error = 1; From nobody Sat Oct 23 18:20:33 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 104A91802A7B; Sat, 23 Oct 2021 18:20: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 4Hc8fB00Htz4wk9; Sat, 23 Oct 2021 18:20: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 D3C0F26E08; Sat, 23 Oct 2021 18:20: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 19NIKX9H016583; Sat, 23 Oct 2021 18:20:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19NIKXSM016582; Sat, 23 Oct 2021 18:20:33 GMT (envelope-from git) Date: Sat, 23 Oct 2021 18:20:33 GMT Message-Id: <202110231820.19NIKXSM016582@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: 4b9725184e31 - main - Fix clang's internal assembler adding unwanted prefix to VIA xstore List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 4b9725184e315596aa401cecb230033c6d6d5f29 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=4b9725184e315596aa401cecb230033c6d6d5f29 commit 4b9725184e315596aa401cecb230033c6d6d5f29 Author: Dimitry Andric AuthorDate: 2021-10-23 18:19:26 +0000 Commit: Dimitry Andric CommitDate: 2021-10-23 18:20:00 +0000 Fix clang's internal assembler adding unwanted prefix to VIA xstore Merge commit 2d8c18fbbdd1 from llvm git (by Jessica Clarke): [X86] Don't add implicit REP prefix to VIA PadLock xstore Commit 8fa3e8fa1492 added an implicit REP prefix to all VIA PadLock instructions, but GNU as doesn't add one to xstore, only all the others. This resulted in a kernel panic regression in FreeBSD upon updating to LLVM 11 (https://bugs.freebsd.org/259218) which includes the commit in question. This partially reverts that commit. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D112355 MFC after: 3 days --- contrib/llvm-project/llvm/lib/Target/X86/X86InstrSystem.td | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/llvm-project/llvm/lib/Target/X86/X86InstrSystem.td b/contrib/llvm-project/llvm/lib/Target/X86/X86InstrSystem.td index eb8740896e5d..89b6dbdab5dc 100644 --- a/contrib/llvm-project/llvm/lib/Target/X86/X86InstrSystem.td +++ b/contrib/llvm-project/llvm/lib/Target/X86/X86InstrSystem.td @@ -585,7 +585,7 @@ def XRSTORS64 : RI<0xC7, MRM3m, (outs), (ins opaquemem:$dst), //===----------------------------------------------------------------------===// // VIA PadLock crypto instructions let Defs = [RAX, RDI], Uses = [RDX, RDI], SchedRW = [WriteSystem] in - def XSTORE : I<0xa7, MRM_C0, (outs), (ins), "xstore", []>, TB, REP; + def XSTORE : I<0xa7, MRM_C0, (outs), (ins), "xstore", []>, TB; def : InstAlias<"xstorerng", (XSTORE)>; From nobody Sat Oct 23 18:46:34 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D06A9180F076; Sat, 23 Oct 2021 18:46: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 4Hc9DB5db6z53v3; Sat, 23 Oct 2021 18:46: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 969CF26F7E; Sat, 23 Oct 2021 18:46: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 19NIkY2M047889; Sat, 23 Oct 2021 18:46:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19NIkYg9047888; Sat, 23 Oct 2021 18:46:34 GMT (envelope-from git) Date: Sat, 23 Oct 2021 18:46:34 GMT Message-Id: <202110231846.19NIkYg9047888@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: 6e66030c4c05 - main - linux: implement PTRACE_EVENT_EXEC List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 6e66030c4c05331f9b0adf87c31f2f233dd3ae1f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=6e66030c4c05331f9b0adf87c31f2f233dd3ae1f commit 6e66030c4c05331f9b0adf87c31f2f233dd3ae1f Author: Edward Tomasz Napierala AuthorDate: 2021-10-23 18:13:14 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-10-23 18:46:26 +0000 linux: implement PTRACE_EVENT_EXEC This fixes strace(1) from Ubuntu Focal. Reviewed By: jhb Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D32367 --- sys/amd64/linux/linux_ptrace.c | 9 +++++++-- sys/kern/subr_syscall.c | 12 ++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/sys/amd64/linux/linux_ptrace.c b/sys/amd64/linux/linux_ptrace.c index 37f136856ef0..d7dffc92dd11 100644 --- a/sys/amd64/linux/linux_ptrace.c +++ b/sys/amd64/linux/linux_ptrace.c @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #define LINUX_PTRACE_SEIZE 0x4206 #define LINUX_PTRACE_GET_SYSCALL_INFO 0x420e +#define LINUX_PTRACE_EVENT_EXEC 4 #define LINUX_PTRACE_EVENT_EXIT 6 #define LINUX_PTRACE_O_TRACESYSGOOD 1 @@ -151,8 +152,12 @@ linux_ptrace_status(struct thread *td, pid_t pid, int status) lwpinfo.pl_flags & PL_FLAG_SCE) status |= (LINUX_SIGTRAP | 0x80) << 8; if ((pem->ptrace_flags & LINUX_PTRACE_O_TRACESYSGOOD) && - lwpinfo.pl_flags & PL_FLAG_SCX) - status |= (LINUX_SIGTRAP | 0x80) << 8; + lwpinfo.pl_flags & PL_FLAG_SCX) { + if (lwpinfo.pl_flags & PL_FLAG_EXEC) + status |= (LINUX_SIGTRAP | LINUX_PTRACE_EVENT_EXEC << 8) << 8; + else + status |= (LINUX_SIGTRAP | 0x80) << 8; + } if ((pem->ptrace_flags & LINUX_PTRACE_O_TRACEEXIT) && lwpinfo.pl_flags & PL_FLAG_EXITED) status |= (LINUX_SIGTRAP | LINUX_PTRACE_EVENT_EXIT << 8) << 8; diff --git a/sys/kern/subr_syscall.c b/sys/kern/subr_syscall.c index ada2053bc87c..fab67a68b0a3 100644 --- a/sys/kern/subr_syscall.c +++ b/sys/kern/subr_syscall.c @@ -254,6 +254,18 @@ syscallret(struct thread *td) if (__predict_false(traced || (td->td_dbgflags & (TDB_EXEC | TDB_FORK)) != 0)) { PROC_LOCK(p); + /* + * Linux debuggers expect an additional stop for exec, + * between the usual syscall entry and exit. Raise + * the exec event now and then clear TDB_EXEC so that + * the next stop is reported as a syscall exit by + * linux_ptrace_status(). + */ + if ((td->td_dbgflags & TDB_EXEC) != 0 && + SV_PROC_ABI(td->td_proc) == SV_ABI_LINUX) { + ptracestop(td, SIGTRAP, NULL); + td->td_dbgflags &= ~TDB_EXEC; + } /* * If tracing the execed process, trap to the debugger * so that breakpoints can be set before the program From nobody Sat Oct 23 18:53:46 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id ED7BB18121E8; Sat, 23 Oct 2021 18:53:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hc9NV6NnTz55b4; Sat, 23 Oct 2021 18:53:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB761274AF; Sat, 23 Oct 2021 18:53:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19NIrkGV060783; Sat, 23 Oct 2021 18:53:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19NIrk3H060782; Sat, 23 Oct 2021 18:53:46 GMT (envelope-from git) Date: Sat, 23 Oct 2021 18:53:46 GMT Message-Id: <202110231853.19NIrk3H060782@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: 2ec26ae402fc - main - linux: Improve debug for PTRACE_GETEVENTMSG List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 2ec26ae402fc2589cb97bb5aa713b6d0ba080c17 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=2ec26ae402fc2589cb97bb5aa713b6d0ba080c17 commit 2ec26ae402fc2589cb97bb5aa713b6d0ba080c17 Author: Edward Tomasz Napierala AuthorDate: 2021-10-23 18:53:12 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-10-23 18:53:12 +0000 linux: Improve debug for PTRACE_GETEVENTMSG No functional changes. Sponsored By: EPSRC --- sys/amd64/linux/linux_ptrace.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/amd64/linux/linux_ptrace.c b/sys/amd64/linux/linux_ptrace.c index d7dffc92dd11..b7d0838fb054 100644 --- a/sys/amd64/linux/linux_ptrace.c +++ b/sys/amd64/linux/linux_ptrace.c @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #define LINUX_PTRACE_DETACH 17 #define LINUX_PTRACE_SYSCALL 24 #define LINUX_PTRACE_SETOPTIONS 0x4200 +#define LINUX_PTRACE_GETEVENTMSG 0x4201 #define LINUX_PTRACE_GETSIGINFO 0x4202 #define LINUX_PTRACE_GETREGSET 0x4204 #define LINUX_PTRACE_SEIZE 0x4206 @@ -393,6 +394,14 @@ linux_ptrace_setoptions(struct thread *td, pid_t pid, l_ulong data) return (kern_ptrace(td, PT_SET_EVENT_MASK, pid, &mask, sizeof(mask))); } +static int +linux_ptrace_geteventmsg(struct thread *td, pid_t pid, l_ulong data) +{ + + linux_msg(td, "PTRACE_GETEVENTMSG not implemented; returning EINVAL"); + return (EINVAL); +} + static int linux_ptrace_getsiginfo(struct thread *td, pid_t pid, l_ulong data) { @@ -735,6 +744,9 @@ linux_ptrace(struct thread *td, struct linux_ptrace_args *uap) case LINUX_PTRACE_SETOPTIONS: error = linux_ptrace_setoptions(td, pid, uap->data); break; + case LINUX_PTRACE_GETEVENTMSG: + error = linux_ptrace_geteventmsg(td, pid, uap->data); + break; case LINUX_PTRACE_GETSIGINFO: error = linux_ptrace_getsiginfo(td, pid, uap->data); break; From nobody Sat Oct 23 22:12:34 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D5760181DF08; Sat, 23 Oct 2021 22:12:48 +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 4HcFp84MKsz4l7D; Sat, 23 Oct 2021 22:12:48 +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 19NMCY1P084186 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 24 Oct 2021 01:12:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 19NMCY1P084186 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 19NMCYM1084185; Sun, 24 Oct 2021 01:12:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 24 Oct 2021 01:12:34 +0300 From: Konstantin Belousov To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 6e66030c4c05 - main - linux: implement PTRACE_EVENT_EXEC Message-ID: References: <202110231846.19NIkYg9047888@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202110231846.19NIkYg9047888@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.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4HcFp84MKsz4l7D X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Sat, Oct 23, 2021 at 06:46:34PM +0000, Edward Tomasz Napierala wrote: > The branch main has been updated by trasz: > > URL: https://cgit.FreeBSD.org/src/commit/?id=6e66030c4c05331f9b0adf87c31f2f233dd3ae1f > > commit 6e66030c4c05331f9b0adf87c31f2f233dd3ae1f > Author: Edward Tomasz Napierala > AuthorDate: 2021-10-23 18:13:14 +0000 > Commit: Edward Tomasz Napierala > CommitDate: 2021-10-23 18:46:26 +0000 > > linux: implement PTRACE_EVENT_EXEC > > This fixes strace(1) from Ubuntu Focal. > > Reviewed By: jhb > Sponsored By: EPSRC > Differential Revision: https://reviews.freebsd.org/D32367 > --- > sys/amd64/linux/linux_ptrace.c | 9 +++++++-- > sys/kern/subr_syscall.c | 12 ++++++++++++ > 2 files changed, 19 insertions(+), 2 deletions(-) > > diff --git a/sys/amd64/linux/linux_ptrace.c b/sys/amd64/linux/linux_ptrace.c > index 37f136856ef0..d7dffc92dd11 100644 > --- a/sys/amd64/linux/linux_ptrace.c > +++ b/sys/amd64/linux/linux_ptrace.c > @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); > #define LINUX_PTRACE_SEIZE 0x4206 > #define LINUX_PTRACE_GET_SYSCALL_INFO 0x420e > > +#define LINUX_PTRACE_EVENT_EXEC 4 > #define LINUX_PTRACE_EVENT_EXIT 6 > > #define LINUX_PTRACE_O_TRACESYSGOOD 1 > @@ -151,8 +152,12 @@ linux_ptrace_status(struct thread *td, pid_t pid, int status) > lwpinfo.pl_flags & PL_FLAG_SCE) > status |= (LINUX_SIGTRAP | 0x80) << 8; > if ((pem->ptrace_flags & LINUX_PTRACE_O_TRACESYSGOOD) && > - lwpinfo.pl_flags & PL_FLAG_SCX) > - status |= (LINUX_SIGTRAP | 0x80) << 8; > + lwpinfo.pl_flags & PL_FLAG_SCX) { > + if (lwpinfo.pl_flags & PL_FLAG_EXEC) > + status |= (LINUX_SIGTRAP | LINUX_PTRACE_EVENT_EXEC << 8) << 8; > + else > + status |= (LINUX_SIGTRAP | 0x80) << 8; > + } > if ((pem->ptrace_flags & LINUX_PTRACE_O_TRACEEXIT) && > lwpinfo.pl_flags & PL_FLAG_EXITED) > status |= (LINUX_SIGTRAP | LINUX_PTRACE_EVENT_EXIT << 8) << 8; > diff --git a/sys/kern/subr_syscall.c b/sys/kern/subr_syscall.c > index ada2053bc87c..fab67a68b0a3 100644 > --- a/sys/kern/subr_syscall.c > +++ b/sys/kern/subr_syscall.c > @@ -254,6 +254,18 @@ syscallret(struct thread *td) > if (__predict_false(traced || > (td->td_dbgflags & (TDB_EXEC | TDB_FORK)) != 0)) { > PROC_LOCK(p); > + /* > + * Linux debuggers expect an additional stop for exec, > + * between the usual syscall entry and exit. Raise > + * the exec event now and then clear TDB_EXEC so that > + * the next stop is reported as a syscall exit by > + * linux_ptrace_status(). > + */ > + if ((td->td_dbgflags & TDB_EXEC) != 0 && > + SV_PROC_ABI(td->td_proc) == SV_ABI_LINUX) { > + ptracestop(td, SIGTRAP, NULL); > + td->td_dbgflags &= ~TDB_EXEC; > + } > /* > * If tracing the execed process, trap to the debugger > * so that breakpoints can be set before the program You committed before we finished the discussion. In fact I do not think it is right. Now it generates spurious stop for FreeBSD native debugger, and probably de-synchronize SCX/SCE pairing for it as well. In other words, you need to generate this stop based on ABI of the debugger, not debuggeeeeee. From nobody Sun Oct 24 00:27:15 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D7F4C180DF61; Sun, 24 Oct 2021 00:27: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 4HcJnH5l2Lz3r5J; Sun, 24 Oct 2021 00:27: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 A17E7345A; Sun, 24 Oct 2021 00:27: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 19O0RFa5004652; Sun, 24 Oct 2021 00:27:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19O0RFbe004651; Sun, 24 Oct 2021 00:27:15 GMT (envelope-from git) Date: Sun, 24 Oct 2021 00:27:15 GMT Message-Id: <202110240027.19O0RFbe004651@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: 311b95bbcda7 - main - sys/mount.h: remove dead prototype List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 311b95bbcda7b8b3314e599b61ae538da3305517 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=311b95bbcda7b8b3314e599b61ae538da3305517 commit 311b95bbcda7b8b3314e599b61ae538da3305517 Author: Robert Wing AuthorDate: 2021-10-24 00:13:20 +0000 Commit: Robert Wing CommitDate: 2021-10-24 00:13:20 +0000 sys/mount.h: remove dead prototype vfs_getrootfsid() was removed in 245efbba4d6a3e60a0d6d16d18d9a5fad6260733 Reviewed by: mjg Differential Revision: https://reviews.freebsd.org/D32606 --- sys/sys/mount.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/sys/mount.h b/sys/sys/mount.h index 8368595b685b..68211785b7c5 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -1014,7 +1014,6 @@ void vfs_deallocate_syncvnode(struct mount *); int vfs_donmount(struct thread *td, uint64_t fsflags, struct uio *fsoptions); void vfs_getnewfsid(struct mount *); -struct cdev *vfs_getrootfsid(struct mount *); struct mount *vfs_getvfs(fsid_t *); /* return vfs given fsid */ struct mount *vfs_busyfs(fsid_t *); int vfs_modevent(module_t, int, void *); From nobody Sun Oct 24 04:11:34 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6E41D1822D65; Sun, 24 Oct 2021 04:11:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HcPm71DtTz3rmv; Sun, 24 Oct 2021 04:11:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B8646BDB; Sun, 24 Oct 2021 04:11: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 19O4BY81006896; Sun, 24 Oct 2021 04:11:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19O4BY8v006895; Sun, 24 Oct 2021 04:11:34 GMT (envelope-from git) Date: Sun, 24 Oct 2021 04:11:34 GMT Message-Id: <202110240411.19O4BY8v006895@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: dfd704b7fb2c - main - Allow biodone() to be used as a completion routine. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: dfd704b7fb2c81f290e1d62db081416bae0d83d3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=dfd704b7fb2c81f290e1d62db081416bae0d83d3 commit dfd704b7fb2c81f290e1d62db081416bae0d83d3 Author: Kirk McKusick AuthorDate: 2021-10-23 14:25:49 +0000 Commit: Kirk McKusick CommitDate: 2021-10-23 21:11:57 +0000 Allow biodone() to be used as a completion routine. An ordered series of BIO_READ and BIO_WRITE operations are typically done as: while (work to do) { setup bp for I/O g_io_request(bp, consumer); biowait(bp); } Here you need to have biodone() called at the completion of the I/O to set the BIO_DONE flag and awaken the biowait(). The obvious way to do this would be to set bio_done = biodone, but biodone() will only take the desired action if bio_done == NULL. The relevant code at the end of biodone() is: done = bp->bio_done; if (done == NULL) { mtxp = mtx_pool_find(mtxpool_sleep, bp); mtx_lock(mtxp); bp->bio_flags |= BIO_DONE; wakeup(bp); mtx_unlock(mtxp); } else done(bp); This code would infinitely recurse if biodone() is specified as the routine to use at completion. So before this change, a wrapper done function had to be written: static void g_io_done(struct bio *bp) { bp->bio_done = NULL; biodone(bp); bp->bio_done = g_io_done; } This commit changes if (done == NULL) to if (done == NULL || done == biodone) which eliminates the need for the wrapper function. Reviewed by: kib Sponsored by: Netflix --- sys/kern/vfs_bio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 352c341d05f7..034bbccc437d 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -4384,7 +4384,11 @@ biodone(struct bio *bp) atomic_add_int(&inflight_transient_maps, -1); } done = bp->bio_done; - if (done == NULL) { + /* + * The check for done == biodone is to allow biodone to be + * used as a bio_done routine. + */ + if (done == NULL || done == biodone) { mtxp = mtx_pool_find(mtxpool_sleep, bp); mtx_lock(mtxp); bp->bio_flags |= BIO_DONE; From nobody Sun Oct 24 06:05:06 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B7A03180B40B for ; Sun, 24 Oct 2021 06:05:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ua1-x934.google.com (mail-ua1-x934.google.com [IPv6:2607:f8b0:4864:20::934]) (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 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HcSHR4GsQz4rPK for ; Sun, 24 Oct 2021 06:05:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ua1-x934.google.com with SMTP id o26so1818896uab.5 for ; Sat, 23 Oct 2021 23:05:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6u3JcK7hwaZcxSnue6vl1bukfJ0HB9JAAD5AfbvF5eU=; b=DOBYE1gGpFFVIvOyQqGRw/NyQVBmIzjwLB1Ct4Uehw3JEz9bIGlJT79Ic84axD/uBE VC3YNmt22VVpdSJEgTSsURrYE36sjGUghMoTX8HXtba/mMGDGppcTf9Is4pCy2mtpOoz DZd+aCi8U/hBYbBsLlICKZIONDeBTmPCCsoBxTcRrwwxSWVFIMIwlAxBK4pqHbwZM5wG RpZMinAwsNyDdKeRO5DtYOT9LaFGPlnbl7j3GZY8fkoyZoEwedPYa2EjbjIU7ECv+QK9 hn8tQXtt3ZGxH2dxfbLGg7v4gotseqrQXs41x2FrRv7gCwwFBiRtSvryF2lJFBSp3wHG Ql6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6u3JcK7hwaZcxSnue6vl1bukfJ0HB9JAAD5AfbvF5eU=; b=0vfY9rW1CcMfataAW+CJGVU17MrdBRc6XNSK574T5NamfZSyp+8huGlesOgBgSM8/f 8YAB0dF6Xq/0JnIzufmiCvq1brbYJbpXdmvGY7JImFVAn+mG2gLCrP9bo9nsYTD68m23 0ravA42cuOVJL/7cg4+1lrcChv2eXdNhEr/Y6nasdeLMH3GD6zRJ2ggSD7Dh0sxaRmv8 XyXaNyYmQjtoxFxBuYCILoiaVPpwBQmv9gf10D9OWBsNB+CrHonQdOPBwWlHkA9YL+qS c2r/5O062F3gVwc4w/PeX9N4O0oplJFMkwDR/01kx8a9B11aVDPWVhAyI49dK+uaYNQy OgiA== X-Gm-Message-State: AOAM533wFMwaqu2f8ezSzHhPxa7UpOQjuyFW+Nafzflj3P/1+zuhCdiC Y3Wrtk3xkWJNuYHGkNKf6nbPj7Y9NpeuctHgRvwslg== X-Google-Smtp-Source: ABdhPJwVLLpY9dF7kjNpENFpRQ6XMR09ECqRg/h94MTYHNIWtcBUmz5gaD/S2y7nETD5IPjOZD/BnnGdtyAWbdZMdHA= X-Received: by 2002:a05:6102:31ab:: with SMTP id d11mr80693vsh.42.1635055517237; Sat, 23 Oct 2021 23:05:17 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <20211021192020.6dcb95c1@ernst.home> <202110221704.19MH4FDn075994@gndrsh.dnsmgr.net> <20211022194717.8c94d2fa302339b55882497f@bidouilliste.com> <20211022225540.a4220cfddc96cc1e08cb5235@bidouilliste.com> <20211023144536.Horde.FrlbSo1SLHpgxnKlAIimdzS@webmail.leidinger.net> In-Reply-To: <20211023144536.Horde.FrlbSo1SLHpgxnKlAIimdzS@webmail.leidinger.net> From: Warner Losh Date: Sun, 24 Oct 2021 00:05:06 -0600 Message-ID: Subject: Re: git: 225639e7db68 - main - vt: Disable bell by default To: Alexander Leidinger Cc: Emmanuel Vadot , Benjamin Kaduk , "Rodney W. Grimes" , "Rodney W. Grimes" , Gary Jennejohn , Gleb Smirnoff , Slawa Olhovchenkov , src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000004b163105cf1307bf" X-Rspamd-Queue-Id: 4HcSHR4GsQz4rPK X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N --0000000000004b163105cf1307bf Content-Type: text/plain; charset="UTF-8" On Sat, Oct 23, 2021 at 6:45 AM Alexander Leidinger wrote: > Quoting Emmanuel Vadot (from Fri, 22 Oct 2021 > 22:55:40 +0200): > > > I honestly thought that this setting was something that you setup once > > when you installed a new machine (which doesn't happens very often) and > > forget about it, you know another "ah crap yes I forgot about this, why > > do we have such insane default. Oh well now that I disabled it locally > > I don't have to think about it and won't change the default". Instead > > this time I didn't say to myself that I won't change it and I did. > > May I offer another perspective into this? Something outside of 0 and 1... > > I wonder if it is really the default of bell=on is what is crap, or if > the bug Warner found is what makes it crap, or if the frequency of the > current setting is what makes it crap (or the two last items together). > > Personally I dislike the bell, but not as much that I want to disable > it. I don't mind to have it disabled (I simply enabled it directly in > sysctl.conf even as I haven't updated to past the commit), as I think > it gives usefull feedback. It may not give useful feedback in all > cases where it goes off, but that's something we have influence on, > don't we? > > What I don't like about the bell is the noise it makes. So what about > changing the noise it makes to something more pleasant and asking if > this is better and maybe acceptable to those which don't like the bell? > https://reviews.freebsd.org/D32619 and https://reviews.freebsd.org/D32620 might be of interest. They are only lightly tested at this point and may be buggy. But they let you set the duration and pitch of the bell, like we used to be able to do with syscons(4). There's likely some bugs in this area still, but it's a start. Warner > I also think that disabling a feature you know it exists but you don't > like is much more easy than to enable a feature you don't know exists. > > Basically I question in this email the problem you want to solve by > disabling the bell. Does it really need to be disabled, or would a > change of the sound and volume make it acceptable for you (you = all > people which complain or agree to "the current one is crap -> disable > it" .... which basically means we would need to make some kind of > usability test what sounds better before deciding if it shall be > disabled or not)? > > For me the issue with the bell would be solved if it sounds "better" > and is less loud. I assume we could even make it configurable to some > extend (override a hardcoded frequency and volume with a sysctl). > > Bye, > Alexander. > > -- > http://www.Leidinger.net Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF > http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF > --0000000000004b163105cf1307bf-- From nobody Sun Oct 24 16:59:25 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C581018178B5; Sun, 24 Oct 2021 16:59: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 4Hckp55CpMz4c4J; Sun, 24 Oct 2021 16:59: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 8F84018ECD; Sun, 24 Oct 2021 16:59: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 19OGxPUL020995; Sun, 24 Oct 2021 16:59:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19OGxPkf020994; Sun, 24 Oct 2021 16:59:25 GMT (envelope-from git) Date: Sun, 24 Oct 2021 16:59:25 GMT Message-Id: <202110241659.19OGxPkf020994@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: fd8ad2128dcd - main - unionfs: implement vnode-based cache lookup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: fd8ad2128dcd4fe7b9e52e181bfe4e2a24b0ab3a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jah: URL: https://cgit.FreeBSD.org/src/commit/?id=fd8ad2128dcd4fe7b9e52e181bfe4e2a24b0ab3a commit fd8ad2128dcd4fe7b9e52e181bfe4e2a24b0ab3a Author: Jason A. Harmening AuthorDate: 2021-10-17 02:16:25 +0000 Commit: Jason A. Harmening CommitDate: 2021-10-24 17:05:50 +0000 unionfs: implement vnode-based cache lookup unionfs uses a per-directory hashtable to cache subdirectory nodes. Currently this hashtable is looked up using the directory name, but since unionfs nodes aren't removed from the cache until they're reclaimed, this poses some problems. For example, if a directory is created on a unionfs mount shortly after deleting a previous directory with the same path, the cache may end up reusing the node for the previous directory, including its upper/lower FS vnodes. Operations against those vnodes with then likely fail because the vnodes represent deleted files; for example UFS will reject VOP_MKDIR() against such a vnode because its effective link count is 0. This may then manifest as e.g. mkdir(2) or open(2) returning ENOENT for an attempt to create a file under the re-created directory. While it would be possible to fix this by explicitly managing the name-based cache during delete or rename operations, or by rejecting cache hits if the underlying FS vnodes don't match those passed to unionfs_nodeget(), it seems cleaner to instead hash the unionfs nodes based on their underlying FS vnodes. Since unionfs prefers to operate against the upper vnode if one is present, the lower vnode will only be used for hashing as long as the upper vnode is NULL. This should also make hashing faster by eliminating string traversal and using the already-computed hash index stored in each vnode. While here, fix a couple of other cache-related issues: --Remove 8 bytes of unnecessary baggage from each unionfs node by getting rid of the stored hash mask field. The mask is knowable at compile time. --When a matching node is found in the cache, reference its vnode using vrefl() while still holding the vnode interlock. Previously unionfs_nodeget() would vref() the vnode after the interlock was dropped, but the vnode may be reclaimed during that window. This caused intermittent panics from vn_lock(9) during unionfs stress testing. Reviewed by: kib, markj Tested by: pho Differential Revision: https://reviews.freebsd.org/D32533 --- sys/fs/unionfs/union.h | 1 - sys/fs/unionfs/union_subr.c | 148 +++++++++++++++++++++++--------------------- 2 files changed, 79 insertions(+), 70 deletions(-) diff --git a/sys/fs/unionfs/union.h b/sys/fs/unionfs/union.h index 79469a5957f4..fe611dea1461 100644 --- a/sys/fs/unionfs/union.h +++ b/sys/fs/unionfs/union.h @@ -96,7 +96,6 @@ struct unionfs_node { STAILQ_ENTRY(unionfs_node) un_rele; /* deferred release list */ }; - u_long un_hashmask; /* bit mask */ char *un_path; /* path */ int un_pathlen; /* strlen of path */ int un_flag; /* unionfs node flag */ diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c index 380a61819f1a..326483bcc400 100644 --- a/sys/fs/unionfs/union_subr.c +++ b/sys/fs/unionfs/union_subr.c @@ -64,6 +64,7 @@ #include #define NUNIONFSNODECACHE 16 +#define UNIONFSHASHMASK (NUNIONFSNODECACHE - 1) static MALLOC_DEFINE(M_UNIONFSHASH, "UNIONFS hash", "UNIONFS hash table"); MALLOC_DEFINE(M_UNIONFSNODE, "UNIONFS node", "UNIONFS vnode private part"); @@ -129,69 +130,83 @@ unionfs_deferred_rele(void *arg __unused, int pending __unused) } static struct unionfs_node_hashhead * -unionfs_get_hashhead(struct vnode *dvp, char *path) +unionfs_get_hashhead(struct vnode *dvp, struct vnode *lookup) { struct unionfs_node *unp; - int count; - char hash; - hash = 0; unp = VTOUNIONFS(dvp); - if (path != NULL) { - for (count = 0; path[count]; count++) - hash += path[count]; - } - return (&(unp->un_hashtbl[hash & (unp->un_hashmask)])); + return (&(unp->un_hashtbl[vfs_hash_index(lookup) & UNIONFSHASHMASK])); } /* - * Get the cached vnode. + * Attempt to lookup a cached unionfs vnode by upper/lower vp + * from dvp, with dvp's interlock held. */ static struct vnode * -unionfs_get_cached_vnode(struct vnode *uvp, struct vnode *lvp, - struct vnode *dvp, char *path) +unionfs_get_cached_vnode_locked(struct vnode *lookup, struct vnode *dvp) { - struct unionfs_node_hashhead *hd; struct unionfs_node *unp; + struct unionfs_node_hashhead *hd; struct vnode *vp; - KASSERT((uvp == NULLVP || uvp->v_type == VDIR), - ("unionfs_get_cached_vnode: v_type != VDIR")); - KASSERT((lvp == NULLVP || lvp->v_type == VDIR), - ("unionfs_get_cached_vnode: v_type != VDIR")); + hd = unionfs_get_hashhead(dvp, lookup); - VI_LOCK(dvp); - hd = unionfs_get_hashhead(dvp, path); LIST_FOREACH(unp, hd, un_hash) { - if (!strcmp(unp->un_path, path)) { + if ((unp->un_uppervp == lookup) || + (unp->un_lowervp == lookup)) { vp = UNIONFSTOV(unp); VI_LOCK_FLAGS(vp, MTX_DUPOK); - VI_UNLOCK(dvp); vp->v_iflag &= ~VI_OWEINACT; if (VN_IS_DOOMED(vp) || ((vp->v_iflag & VI_DOINGINACT) != 0)) { VI_UNLOCK(vp); vp = NULLVP; - } else + } else { + vrefl(vp); VI_UNLOCK(vp); + } return (vp); } } - VI_UNLOCK(dvp); return (NULLVP); } + +/* + * Get the cached vnode. + */ +static struct vnode * +unionfs_get_cached_vnode(struct vnode *uvp, struct vnode *lvp, + struct vnode *dvp) +{ + struct vnode *vp; + + KASSERT((uvp == NULLVP || uvp->v_type == VDIR), + ("unionfs_get_cached_vnode: v_type != VDIR")); + KASSERT((lvp == NULLVP || lvp->v_type == VDIR), + ("unionfs_get_cached_vnode: v_type != VDIR")); + + vp = NULLVP; + VI_LOCK(dvp); + if (uvp != NULLVP) + vp = unionfs_get_cached_vnode_locked(uvp, dvp); + else if (lvp != NULLVP) + vp = unionfs_get_cached_vnode_locked(lvp, dvp); + VI_UNLOCK(dvp); + + return (vp); +} + /* * Add the new vnode into cache. */ static struct vnode * unionfs_ins_cached_vnode(struct unionfs_node *uncp, - struct vnode *dvp, char *path) + struct vnode *dvp) { struct unionfs_node_hashhead *hd; - struct unionfs_node *unp; struct vnode *vp; KASSERT((uncp->un_uppervp==NULLVP || uncp->un_uppervp->v_type==VDIR), @@ -199,29 +214,20 @@ unionfs_ins_cached_vnode(struct unionfs_node *uncp, KASSERT((uncp->un_lowervp==NULLVP || uncp->un_lowervp->v_type==VDIR), ("unionfs_ins_cached_vnode: v_type != VDIR")); + vp = NULLVP; VI_LOCK(dvp); - hd = unionfs_get_hashhead(dvp, path); - LIST_FOREACH(unp, hd, un_hash) { - if (!strcmp(unp->un_path, path)) { - vp = UNIONFSTOV(unp); - VI_LOCK_FLAGS(vp, MTX_DUPOK); - vp->v_iflag &= ~VI_OWEINACT; - if (VN_IS_DOOMED(vp) || - ((vp->v_iflag & VI_DOINGINACT) != 0)) { - LIST_INSERT_HEAD(hd, uncp, un_hash); - VI_UNLOCK(vp); - vp = NULLVP; - } else - VI_UNLOCK(vp); - VI_UNLOCK(dvp); - return (vp); - } + if (uncp->un_uppervp != NULL) + vp = unionfs_get_cached_vnode_locked(uncp->un_uppervp, dvp); + else if (uncp->un_lowervp != NULL) + vp = unionfs_get_cached_vnode_locked(uncp->un_lowervp, dvp); + if (vp == NULLVP) { + hd = unionfs_get_hashhead(dvp, (uncp->un_uppervp != NULLVP ? + uncp->un_uppervp : uncp->un_lowervp)); + LIST_INSERT_HEAD(hd, uncp, un_hash); } - - LIST_INSERT_HEAD(hd, uncp, un_hash); VI_UNLOCK(dvp); - return (NULLVP); + return (vp); } /* @@ -233,13 +239,13 @@ unionfs_rem_cached_vnode(struct unionfs_node *unp, struct vnode *dvp) KASSERT((unp != NULL), ("unionfs_rem_cached_vnode: null node")); KASSERT((dvp != NULLVP), ("unionfs_rem_cached_vnode: null parent vnode")); - KASSERT((unp->un_hash.le_prev != NULL), - ("unionfs_rem_cached_vnode: null hash")); VI_LOCK(dvp); - LIST_REMOVE(unp, un_hash); - unp->un_hash.le_next = NULL; - unp->un_hash.le_prev = NULL; + if (unp->un_hash.le_prev != NULL) { + LIST_REMOVE(unp, un_hash); + unp->un_hash.le_next = NULL; + unp->un_hash.le_prev = NULL; + } VI_UNLOCK(dvp); } @@ -281,7 +287,7 @@ unionfs_nodeget_cleanup(struct vnode *vp, void *arg) if (unp->un_lowervp != NULLVP) vput(unp->un_lowervp); if (unp->un_hashtbl != NULL) - hashdestroy(unp->un_hashtbl, M_UNIONFSHASH, unp->un_hashmask); + hashdestroy(unp->un_hashtbl, M_UNIONFSHASH, UNIONFSHASHMASK); free(unp->un_path, M_UNIONFSPATH); free(unp, M_UNIONFSNODE); } @@ -302,6 +308,7 @@ unionfs_nodeget(struct mount *mp, struct vnode *uppervp, struct unionfs_mount *ump; struct unionfs_node *unp; struct vnode *vp; + u_long hashmask; int error; int lkflags; enum vtype vt; @@ -322,10 +329,9 @@ unionfs_nodeget(struct mount *mp, struct vnode *uppervp, path = NULL; /* check the cache */ - if (path != NULL && dvp != NULLVP && vt == VDIR) { - vp = unionfs_get_cached_vnode(uppervp, lowervp, dvp, path); + if (dvp != NULLVP && vt == VDIR) { + vp = unionfs_get_cached_vnode(uppervp, lowervp, dvp); if (vp != NULLVP) { - vref(vp); *vpp = vp; goto unionfs_nodeget_out; } @@ -352,9 +358,12 @@ unionfs_nodeget(struct mount *mp, struct vnode *uppervp, if (lowervp != NULLVP) vref(lowervp); - if (vt == VDIR) + if (vt == VDIR) { unp->un_hashtbl = hashinit(NUNIONFSNODECACHE, M_UNIONFSHASH, - &(unp->un_hashmask)); + &hashmask); + KASSERT(hashmask == UNIONFSHASHMASK, + ("unexpected unionfs hash mask 0x%lx", hashmask)); + } unp->un_vnode = vp; unp->un_uppervp = uppervp; @@ -395,12 +404,12 @@ unionfs_nodeget(struct mount *mp, struct vnode *uppervp, unionfs_nodeget_cleanup(vp, unp); return (ENOENT); } - if (path != NULL && dvp != NULLVP && vt == VDIR) - *vpp = unionfs_ins_cached_vnode(unp, dvp, path); + + if (dvp != NULLVP && vt == VDIR) + *vpp = unionfs_ins_cached_vnode(unp, dvp); if (*vpp != NULLVP) { unionfs_nodeget_cleanup(vp, unp); vp = *vpp; - vref(vp); } else { if (uppervp != NULL) VOP_UNLOCK(uppervp); @@ -457,7 +466,7 @@ unionfs_noderem(struct vnode *vp, struct thread *td) if (uvp != NULLVP) VOP_UNLOCK(uvp); - if (dvp != NULLVP && unp->un_hash.le_prev != NULL) + if (dvp != NULLVP) unionfs_rem_cached_vnode(unp, dvp); if (lockmgr(vp->v_vnlock, LK_EXCLUSIVE, VI_MTX(vp)) != 0) @@ -474,7 +483,7 @@ unionfs_noderem(struct vnode *vp, struct thread *td) } if (unp->un_hashtbl != NULL) { - for (count = 0; count <= unp->un_hashmask; count++) { + for (count = 0; count <= UNIONFSHASHMASK; count++) { hd = unp->un_hashtbl + count; LIST_FOREACH_SAFE(unp_t1, hd, un_hash, unp_t2) { LIST_REMOVE(unp_t1, un_hash); @@ -482,7 +491,7 @@ unionfs_noderem(struct vnode *vp, struct thread *td) unp_t1->un_hash.le_prev = NULL; } } - hashdestroy(unp->un_hashtbl, M_UNIONFSHASH, unp->un_hashmask); + hashdestroy(unp->un_hashtbl, M_UNIONFSHASH, UNIONFSHASHMASK); } LIST_FOREACH_SAFE(unsp, &(unp->un_unshead), uns_list, unsp_tmp) { @@ -777,6 +786,7 @@ static void unionfs_node_update(struct unionfs_node *unp, struct vnode *uvp, struct thread *td) { + struct unionfs_node_hashhead *hd; struct vnode *vp; struct vnode *lvp; struct vnode *dvp; @@ -799,16 +809,16 @@ unionfs_node_update(struct unionfs_node *unp, struct vnode *uvp, vn_lock(uvp, LK_EXCLUSIVE | LK_CANRECURSE | LK_RETRY); /* - * cache update + * Re-cache the unionfs vnode against the upper vnode */ - if (unp->un_path != NULL && dvp != NULLVP && vp->v_type == VDIR) { - static struct unionfs_node_hashhead *hd; - + if (dvp != NULLVP && vp->v_type == VDIR) { VI_LOCK(dvp); - hd = unionfs_get_hashhead(dvp, unp->un_path); - LIST_REMOVE(unp, un_hash); - LIST_INSERT_HEAD(hd, unp, un_hash); - VI_UNLOCK(dvp); + if (unp->un_hash.le_prev != NULL) { + LIST_REMOVE(unp, un_hash); + hd = unionfs_get_hashhead(dvp, uvp); + LIST_INSERT_HEAD(hd, unp, un_hash); + } + VI_UNLOCK(unp->un_dvp); } } From nobody Sun Oct 24 17:38:25 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D565C18276B4; Sun, 24 Oct 2021 17:38: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 4Hclg55PFzz4nXN; Sun, 24 Oct 2021 17:38: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 99261194FE; Sun, 24 Oct 2021 17:38: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 19OHcPAY074409; Sun, 24 Oct 2021 17:38:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19OHcPS5074408; Sun, 24 Oct 2021 17:38:25 GMT (envelope-from git) Date: Sun, 24 Oct 2021 17:38:25 GMT Message-Id: <202110241738.19OHcPS5074408@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: 790b5264886e - main - mixer(3): Fix spelling in comment. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: 790b5264886e581e995fc3b8fa45ca4ab4ffd31c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=790b5264886e581e995fc3b8fa45ca4ab4ffd31c commit 790b5264886e581e995fc3b8fa45ca4ab4ffd31c Author: Hans Petter Selasky AuthorDate: 2021-10-18 14:03:17 +0000 Commit: Hans Petter Selasky CommitDate: 2021-10-24 17:37:17 +0000 mixer(3): Fix spelling in comment. s/MIX_STATUS_XXX/MIX_MODE_XXX/g Differential Revision: https://reviews.freebsd.org/D32548 Submitted by: christos@ Sponsored by: NVIDIA Networking --- lib/libmixer/mixer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libmixer/mixer.c b/lib/libmixer/mixer.c index 4bae6980c1c4..1a448d222bb7 100644 --- a/lib/libmixer/mixer.c +++ b/lib/libmixer/mixer.c @@ -455,7 +455,7 @@ mixer_set_dunit(struct mixer *m, int unit) /* * Get sound device mode (none, play, rec, play+rec). Userland programs can - * use the MIX_STATUS_* flags to determine the mode of the device. + * use the MIX_MODE_* flags to determine the mode of the device. */ int mixer_get_mode(int unit) From nobody Sun Oct 24 17:38:26 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0054B182753F; Sun, 24 Oct 2021 17:38: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 4Hclg66Ng2z4nTx; Sun, 24 Oct 2021 17:38: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 BB979190F6; Sun, 24 Oct 2021 17:38: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 19OHcQD3074433; Sun, 24 Oct 2021 17:38:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19OHcQRT074432; Sun, 24 Oct 2021 17:38:26 GMT (envelope-from git) Date: Sun, 24 Oct 2021 17:38:26 GMT Message-Id: <202110241738.19OHcQRT074432@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: aad0c65d6b37 - main - usb(4): Fix for use after free in combination with EVDEV_SUPPORT. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org 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: aad0c65d6b37364d8ba92ecb8c85e004398a5194 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=aad0c65d6b37364d8ba92ecb8c85e004398a5194 commit aad0c65d6b37364d8ba92ecb8c85e004398a5194 Author: Hans Petter Selasky AuthorDate: 2021-10-24 11:38:04 +0000 Commit: Hans Petter Selasky CommitDate: 2021-10-24 17:37:17 +0000 usb(4): Fix for use after free in combination with EVDEV_SUPPORT. When EVDEV_SUPPORT was introduced, the USB transfers may be running after the main FIFO is closed. In connection to this a race may appear which can lead to use-after-free scenarios. Fix this for all FIFO consumers by initializing and resetting the FIFO queues under the lock used by the client. Then the client driver will see an empty queue in all cases a race may appear. Found by: pho@ MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/usb/usb_dev.c | 47 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/sys/dev/usb/usb_dev.c b/sys/dev/usb/usb_dev.c index 88b36e68976b..99b243464f6c 100644 --- a/sys/dev/usb/usb_dev.c +++ b/sys/dev/usb/usb_dev.c @@ -1938,18 +1938,30 @@ int usb_fifo_alloc_buffer(struct usb_fifo *f, usb_size_t bufsize, uint16_t nbuf) { + struct usb_ifqueue temp_q = {}; + void *queue_data; + usb_fifo_free_buffer(f); - /* allocate an endpoint */ - f->free_q.ifq_maxlen = nbuf; - f->used_q.ifq_maxlen = nbuf; + temp_q.ifq_maxlen = nbuf; - f->queue_data = usb_alloc_mbufs( - M_USBDEV, &f->free_q, bufsize, nbuf); + queue_data = usb_alloc_mbufs( + M_USBDEV, &temp_q, bufsize, nbuf); - if ((f->queue_data == NULL) && bufsize && nbuf) { + if (queue_data == NULL && bufsize != 0 && nbuf != 0) return (ENOMEM); - } + + mtx_lock(f->priv_mtx); + + /* + * Setup queues and sizes under lock to avoid early use by + * concurrent FIFO access: + */ + f->free_q = temp_q; + f->used_q.ifq_maxlen = nbuf; + f->queue_data = queue_data; + mtx_unlock(f->priv_mtx); + return (0); /* success */ } @@ -1962,15 +1974,24 @@ usb_fifo_alloc_buffer(struct usb_fifo *f, usb_size_t bufsize, void usb_fifo_free_buffer(struct usb_fifo *f) { - if (f->queue_data) { - /* free old buffer */ - free(f->queue_data, M_USBDEV); - f->queue_data = NULL; - } - /* reset queues */ + void *queue_data; + + mtx_lock(f->priv_mtx); + + /* Get and clear pointer to free, if any. */ + queue_data = f->queue_data; + f->queue_data = NULL; + /* + * Reset queues under lock to avoid use of freed buffers by + * concurrent FIFO activity: + */ memset(&f->free_q, 0, sizeof(f->free_q)); memset(&f->used_q, 0, sizeof(f->used_q)); + mtx_unlock(f->priv_mtx); + + /* Free old buffer, if any. */ + free(queue_data, M_USBDEV); } void From nobody Sun Oct 24 17:54:58 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B113B18060F4 for ; Sun, 24 Oct 2021 17:55:10 +0000 (UTC) (envelope-from hselasky@freebsd.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 4Hcm2Q49Vvz4sbb for ; Sun, 24 Oct 2021 17:55:10 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from [10.36.2.165] (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 A269226034E for ; Sun, 24 Oct 2021 19:55:09 +0200 (CEST) Message-ID: Date: Sun, 24 Oct 2021 19:54:58 +0200 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Content-Language: en-US To: "dev-commits-src-main@freebsd.org" From: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Hcm2Q49Vvz4sbb X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE] X-ThisMailContainsUnwantedMimeParts: N From nobody Sun Oct 24 19:08:06 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D6AC3182698B; Sun, 24 Oct 2021 19:08:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HcnfZ5kLPz3mNL; Sun, 24 Oct 2021 19:08: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 A3E6F1AC1A; Sun, 24 Oct 2021 19:08: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 19OJ86Jq095197; Sun, 24 Oct 2021 19:08:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19OJ86K9095196; Sun, 24 Oct 2021 19:08:06 GMT (envelope-from git) Date: Sun, 24 Oct 2021 19:08:06 GMT Message-Id: <202110241908.19OJ86K9095196@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: eab5358b9080 - main - Makefile.inc1: Remove mentions of removed target "update" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eab5358b90804669681b639f76ff7e5707e27138 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=eab5358b90804669681b639f76ff7e5707e27138 commit eab5358b90804669681b639f76ff7e5707e27138 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-10-24 19:03:22 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-10-24 19:07:45 +0000 Makefile.inc1: Remove mentions of removed target "update" This is follow-up to commits e290182bcf38 and 1f7d11e636ab. --- Makefile.inc1 | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 423bc00b3f29..c3b8c5257a18 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -43,7 +43,6 @@ # installworld- install everything built by "buildworld" # checkworld - run test suite on installed world # doxygen - build API documentation of the kernel -# update - convenient way to update your source tree (eg: svn/svnup) # # Standard targets (not defined here) are documented in the makefiles in # /usr/share/mk. These include: