From nobody Mon Jul 1 08:20:36 2024 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 4WCJrh5BP4z5PqxP; Mon, 01 Jul 2024 08: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WCJrh4jgTz4yKy; Mon, 1 Jul 2024 08:20:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719822036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=965o02XjVwQmiOyTyngCqT2koCd6IdCzxaELb+YezfE=; b=bG5xqUiVxCOoi+fjIfsjj7OScU1xYZedeC6KO8bDpUxH5dVTztGimYyb3JdozEu34sWpLS 49SCbgiv70ckQ1bJRQwGAOR2kaevLdJQSV5NKt953i/tGhHVFWEAc0ySwqbcks0Kv3wQzO f9zDfvVcxa+gry8IOKl1XFD8P4NYRfk8OlT4nuJ6c0K0O6djMzd2s49thBZ9kb2JmTKBOj KwmiNxVn2UgIfL9CRvF7Jco7398owt9A9Iz39DdpNOjHGpWJ7ObJAV3ir6El83bXSx8Utv wGWM/CveGSbq0SCjXqRqzKzf/hDE4F4XUz5X/WEEWOGAVsF+mY4H9H7utvjv+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719822036; a=rsa-sha256; cv=none; b=Go3RwkBptnQahuc8p+Nz4ZZNJtD/W6GirXKXBPmrHfcHXzZocsCg8QEymFX3HZMXaKSnq9 5gBFp2RiL7nhqjuqNFuPSQgxei44x8OAWqSCnOsV0TV4JmLGsi2KWgghn8TCBftRwTCmIS 5+CHXNujkGUrnQQY8uvnVmm2yOHWd+P7dblqUAg0Bvru5FZsnksg2pap1ZRyGZnLwNAKew J3RyKuYqmMfH8RdCHz11rZsy65hOIR60yURuhONi99yhQ9pKUaFQqDPEWqTAoJvhd9U7vQ NlTd4XmsNHGXi6WZw0DrzBEArL0TKQktXnSpGz5W4qJC8N9fWH1IooKOht3fFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719822036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=965o02XjVwQmiOyTyngCqT2koCd6IdCzxaELb+YezfE=; b=fdvE0+3Php2jGEiH0Tvw6gaJ5i5Ltd9T3MQ4/k1SpaggzqRxRpkes6syztvinMIWiOXIBX gxrHaR6Hap/EkTn2rDLrTxGOOyrJbs/zxG4+01MX7xuMi1SmD7n5R5TZT6n7wqRaAkDi6c jw0denO5ChPggbgXligkPmwmwdlRkjHC1s4YcuCHeMi72g5KmVyqTeXg/8bIisZkBkfAHE JzAbnqkVJqBnXeg3SA2WfYkyPQvfmFc1+0tebanKU5dBE5EirgkVVyZTNbUA+ZcdQU6R2h JxJMUN1E63h6R/ZxWxE0qjztL/D0rb1pefYOuhOMsSB+CDUfGgZQ3eAa+A7r4g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WCJrh4KBFzx0C; Mon, 1 Jul 2024 08:20:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4618KaEk078339; Mon, 1 Jul 2024 08:20:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4618KanM078336; Mon, 1 Jul 2024 08:20:36 GMT (envelope-from git) Date: Mon, 1 Jul 2024 08:20:36 GMT Message-Id: <202407010820.4618KanM078336@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: 2abea9df0165 - main - openssh: Fix pre-authentication remote code execution in sshd. 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 2abea9df01655633aabbb9bf3204c90722001202 Auto-Submitted: auto-generated The branch main has been updated by philip: URL: https://cgit.FreeBSD.org/src/commit/?id=2abea9df01655633aabbb9bf3204c90722001202 commit 2abea9df01655633aabbb9bf3204c90722001202 Author: Philip Paeps AuthorDate: 2024-07-01 08:20:01 +0000 Commit: Philip Paeps CommitDate: 2024-07-01 08:20:01 +0000 openssh: Fix pre-authentication remote code execution in sshd. Reported by: Qualys Threat Research Unit (TRU) Approved by: so Security: FreeBSD-SA-24:04.openssh Security: CVE-2024-6387 --- crypto/openssh/log.c | 2 ++ crypto/openssh/version.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crypto/openssh/log.c b/crypto/openssh/log.c index 9fc1a2e2eaf6..436c75630181 100644 --- a/crypto/openssh/log.c +++ b/crypto/openssh/log.c @@ -451,12 +451,14 @@ void sshsigdie(const char *file, const char *func, int line, int showfunc, LogLevel level, const char *suffix, const char *fmt, ...) { +#if 0 va_list args; va_start(args, fmt); sshlogv(file, func, line, showfunc, SYSLOG_LEVEL_FATAL, suffix, fmt, args); va_end(args); +#endif _exit(1); } diff --git a/crypto/openssh/version.h b/crypto/openssh/version.h index cfbb749c0d04..836b5650b247 100644 --- a/crypto/openssh/version.h +++ b/crypto/openssh/version.h @@ -5,4 +5,4 @@ #define SSH_PORTABLE "p1" #define SSH_RELEASE SSH_VERSION SSH_PORTABLE -#define SSH_VERSION_FREEBSD "FreeBSD-20240318" +#define SSH_VERSION_FREEBSD "FreeBSD-20240701" From nobody Mon Jul 1 15:24:59 2024 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 4WCVGM4G6tz5P85K; Mon, 01 Jul 2024 15:24: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WCVGM3hCWz46YV; Mon, 1 Jul 2024 15:24:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719847499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SguJh6odm78mKbLmNZWQ6uxurnZwCN0Ww7Xc/cDZK9A=; b=Iwkq4z2E8zNEz+eNg9ffZgjsSBD+/8PqEgMbgKttyN80oM1qgksPAt2k50/moeRYy+pvcF FZMyFIOSLiUbxzesEWHCxO6XrwA3OYxik9IDNyfV6OSxoV8xLpmWiItjNIgxvp/zxnn94y 6QvP3XZevYqRw26amlUZ+vh5AGlIAE3NSuNPI3WIKRZKAW2Bcwjo8V4Pywo47dCcJaWO/y mXpChiGT4wM/N2ni+XSEglB0m5LSBNLtCHacqt/3B86GFSh6CNA9geyjViBSoSxtKku/9b l6K0Lwcxw73nKDUBhMkQd0p6rrF/7demWahwoS3uBM5dZ92R6YENgMUF/WF3Sg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719847499; a=rsa-sha256; cv=none; b=GDlTaFZ3sdK1sGETllSX3/F6GZ59KpHDqhFZ+ToEp6j+tqusjmwFJxlGkWimilUPE+O2B4 gMC3BVgjCSAvV0A9xYDg4ZQqNvNgBUxN46sOypUsv5dNd97jY+eftoOddxgbJNfXOGTEJR oNOw40qbfxF/+JJYbvaX2sGdhWIalJ3j8qW6wzxPj/cgDaVNxJCdBhKvPzN+MZI+o2QLEL HNdRAp+2RjPXdXqv1/z50psIBmZ9KaAYQKlgNqt/0nRGGpI42kgZwcL9JR/RW6c49RUBFG 3zykjVOuFyDOZO7FNZj9ya8If0Xa1UJlzWB81XUwZ7V1kSlA39jKnumKpBatew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719847499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SguJh6odm78mKbLmNZWQ6uxurnZwCN0Ww7Xc/cDZK9A=; b=SFOt5YNfEZYOLu3B0uao8k/784miGU8XRKI0avvgOc8MeTNahbvdBTTOJeUxeS82QcEp00 LA91+fgC50SG0KTVIofvcLwLw8xOORo0OO29TfPkwyLTNOznyB8ksNKFmpjbywpImIeegj dfYT1PpnpORLeUQYSVgewJEPFvEkQMXHiST0Zv9EhHdrmVz0N6uIU7EkWCc4uIJelhL5L6 5ihEwKPWZYL0k+ZgszE1mRMTQn6mNJKANE0hypBLCLlP684IeHJ3Qr3vSVxDvEfbmLOfcj EP6kqDxN8QWP27cbdGffeg0NfyoHpJWHnubNTYVqw0WPyTRdX2/7o2Jfv7It9g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WCVGM3DqBz19Dc; Mon, 1 Jul 2024 15:24:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 461FOxxK096785; Mon, 1 Jul 2024 15:24:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 461FOxsL096782; Mon, 1 Jul 2024 15:24:59 GMT (envelope-from git) Date: Mon, 1 Jul 2024 15:24:59 GMT Message-Id: <202407011524.461FOxsL096782@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: f8a46de2dd48 - main - bluetooth socket sysinit: correct memset initialization 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f8a46de2dd481da2bf69747551db30ea453490d5 Auto-Submitted: auto-generated The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=f8a46de2dd481da2bf69747551db30ea453490d5 commit f8a46de2dd481da2bf69747551db30ea453490d5 Author: Ryan Libby AuthorDate: 2024-07-01 15:22:31 +0000 Commit: Ryan Libby CommitDate: 2024-07-01 15:22:31 +0000 bluetooth socket sysinit: correct memset initialization gcc -Wmemset-elt-size diagnosed this. The code was only initializing the first 1/sizeof(long) bytes. On 64-bit systems, this would mean only events up to 0x20 were initialized. This effectively reverses the security policy for some events with higher ids, now permitting them on unprivileged sockets. Two that are defined are NG_HCI_EVENT_LE (0x3e) and NG_HCI_EVENT_BT_LOGO (0xfe). PR: 280039 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D45707 --- sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c b/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c index b8caf0c515fd..b123322b33aa 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c @@ -808,8 +808,7 @@ ng_btsocket_hci_raw_init(void *arg __unused) /* Enable all events */ memset(&ng_btsocket_hci_raw_sec_filter->events, 0xff, - sizeof(ng_btsocket_hci_raw_sec_filter->events)/ - sizeof(ng_btsocket_hci_raw_sec_filter->events[0])); + sizeof(ng_btsocket_hci_raw_sec_filter->events)); /* Disable some critical events */ f = ng_btsocket_hci_raw_sec_filter->events; From nobody Mon Jul 1 21:08:53 2024 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 4WCdvB20Fmz5Q4SN; Mon, 01 Jul 2024 21:08:54 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WCdvB1Lq0z3ynw; Mon, 1 Jul 2024 21:08:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719868134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UYGxo8pShentPbfGWu9Ib60T/h38tjVNo85g5w44NQ0=; b=JaGH3kJpGKRM5kDG+5hFdm/IVU9VIz5hxNuHap3zI1NJSsulIpEY6n/jh/1133OEgHsJhG EAJ9SKnUuOEkYVQ8XJQ+m4kiH5jCBA6Y4WMDwdFebfeR225K3bkb/pF5FRns4wjQW1XZqR h91QI5RD0oxVlY1rK0IRNM8DGe+ZSECoSe+GtEu7jfLNljfdFbBNb62fEUzbWtdhGONoDq zNh4xeGHEErO8JL+rcbbUiMhZ2mjzWEsQRi9CprFznYVsF1aGXUb8bhdrJAklu4zwUDoMt NeWhYfG44G2VCIpuFrik1SgD6D9ulyf/SuHhRlzWZaRpBzkLSrm6aVodl4VKzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719868134; a=rsa-sha256; cv=none; b=xPhrWdfhAVk5OTIyEjtW5v6PbAi7GWHKmWVujCtr/eSuqsUcD8C8w9CEZ0aMd8MKDhyFO+ wXGeVbb4uRk4JIsTr4Ey5y/4hDUzkxRvPKAn6khmgAWiUtPiE3vh4W8f06cqhU9cQqCRM4 UuMCxp04+TzJsyRYZLryzH9X1zCTbjgcIydUJXGBaGzNICTO3N9gF/hXxgAFu+R5cri5W1 CKs7v3s0LIjZNSzmhUjP0fVBH7sP/HEfu38ronYSsP6dXDJfRq78nv8LbrnDY2RmwaOMA2 dUMRnCgIO/xtvaTpoVDaLUgzyzW1E78j9VNcaU05bD8+OMkIbtrTQGzI2thAJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719868134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UYGxo8pShentPbfGWu9Ib60T/h38tjVNo85g5w44NQ0=; b=hcTIjBaHGFmeKUmvKOjw07lgSiOKkDOgw4fTbNSdOSX9TnsbjAp/r23KhAkmQly9WRhvm8 L4hVWZkJFEzlkcUPanva/i41beIWh+rkbP3SJok6YDWnT2PEmUj4JlvKvArj/i2ZiTMG1Y xaxCePimGBiwS8hAqZkg+xeKrmtE7B0oMPub1x3uom2ilD+3r1In6lE8ZP2kleV7qmEBHc 5msOmDjf/8qrIrj9b0a9K2aGcfsUmLAmweeNXX7P9mb8kaZ1udaQCxYVBHJp1etDnqQZX2 fJnewau6lRaevt49CCXw39NOiDfwjFaHB5w2MUHhp9/iX7qLK2LqtOcysQU6Sw== Received: from [IPV6:2601:5c0:4200:b830:198e:c253:cce:4f0] (unknown [IPv6:2601:5c0:4200:b830:198e:c253:cce:4f0]) (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 did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WCdv96Zt0zWrR; Mon, 1 Jul 2024 21:08:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Mon, 1 Jul 2024 17:08:53 -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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: edbd489d09ba - main - ctladm: don't require the use of "-p" with "port -r" Content-Language: en-US To: Alan Somers , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202406101601.45AG1jSb001516@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202406101601.45AG1jSb001516@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/10/24 9:01 AM, Alan Somers wrote: > The branch main has been updated by asomers: > > URL: https://cgit.FreeBSD.org/src/commit/?id=edbd489d09babebdc6c03924a912013be584c409 > > commit edbd489d09babebdc6c03924a912013be584c409 > Author: Alan Somers > AuthorDate: 2024-06-06 19:14:43 +0000 > Commit: Alan Somers > CommitDate: 2024-06-10 16:01:25 +0000 > > ctladm: don't require the use of "-p" with "port -r" > > When removing a port, the ioctl frontend requires the "-p" argument. > But other frontends, like cfiscsi, do not. So don't require that > argument in the ctladm command. The frontend driver will report an > error if any required argument is missing. > > MFC after: 2 weeks > Sponsored by: Axcient > Reviewed by: mav > Pull Request: https://github.com/freebsd/freebsd-src/pull/1279 > --- > sys/cam/ctl/ctl_frontend_ioctl.c | 2 +- > usr.sbin/ctladm/ctladm.8 | 3 +-- > usr.sbin/ctladm/ctladm.c | 10 +++------- > usr.sbin/ctladm/tests/port.sh | 28 +++++++++++++++++++++++----- > 4 files changed, 28 insertions(+), 15 deletions(-) > > diff --git a/usr.sbin/ctladm/ctladm.c b/usr.sbin/ctladm/ctladm.c > index 14951797ddf1..46b7b88547dd 100644 > --- a/usr.sbin/ctladm/ctladm.c > +++ b/usr.sbin/ctladm/ctladm.c > @@ -580,11 +580,6 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) > break; > } > case CCTL_PORT_MODE_REMOVE: > - if (targ_port == -1) { > - warnx("%s: -r requires -p", __func__); > - retval = 1; > - goto bailout; > - } > /* FALLTHROUGH */ Should we just remove the FALLTHOUGH now? > case CCTL_PORT_MODE_CREATE: { > bzero(&req, sizeof(req)); > diff --git a/usr.sbin/ctladm/tests/port.sh b/usr.sbin/ctladm/tests/port.sh > index 1f2c9aaed5c1..139e1a7d29a0 100644 > --- a/usr.sbin/ctladm/tests/port.sh > +++ b/usr.sbin/ctladm/tests/port.sh > @@ -37,8 +37,6 @@ cleanup() { > ;; > "iscsi") > TARGET=`awk '/target:/ {print $2}' port-create.txt` > - # PORTNUM is ignored, but must be set > - PORTNUM=9999 > ctladm port -r -d $driver -p "$PORTNUM" -O cfiscsi_portal_group_tag=$PGTAG -O cfiscsi_target=$TARGET You still use PORTNUM here even though you don't define it? > ;; > esac -- John Baldwin From nobody Mon Jul 1 21:49:12 2024 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 4WCfnj3hWGz5QC1L; Mon, 01 Jul 2024 21:49:13 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WCfnj31zPz44Nx; Mon, 1 Jul 2024 21:49:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719870553; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Wf2TaSpVrvwuzbPk1y4gUuAcr/aR62B67Z9yO7DHfAc=; b=IhjvSzr7JmmrKYehdPnbl8ViveHHlhQkGcNk+7pB3yUWNlDEzbA58B9bf70Uy9BTRcz3cF wNAe80GiFdn6n+8oeki7F6TtFxkdHv/6rT1JJ/3eZVHgysLLKcEbApgJRXOHCckWAplAww V81kmHP/47KhoYGuicmMrXq83sga/VRKMttqVf3dNYsNpq0a3KpuoFZfjsKkYXkX7iiA/t +gFrREP2ckqriWv9HFT8g0kAuQnsthPtkwLDAD5O8EaXZUJmw1BnzhRYT/SNvgW0nXh3vZ q0OdTZoDbdBPcaZX7XS8eg/ZFDJkZlOyquk4J/IS7M9ZKwICANHMdPlg+OGCoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719870553; a=rsa-sha256; cv=none; b=hRpoieE29Ip7pDE4M46FWUrMBxkoAzCrW4SZxRK3MjejQeaaLRW5q7tWvjKlVkSPu5VZ/K i5Ve3/ydchszP8juXAcSolHiq2kS45b6lKbajcW30rmAO8le7CA46INIlxfTmuanBiAoSX N+Lca4dSdcobgmUwTHpa9ePdAdvc5WoTImaJAbthJHSzJYLbixyjWw5zywTsYrJBpPGnUK BzdI9HdemuSGTjfSnGtsFHO0WAd/qrnbDeQE7mapZGmbS2edDaFX8nhiYF524ZGTew26Q0 krO9n9Z68Yc4vzb0nAAkhKjYTJ5EBeJkv/YgSLmmarHtychDXsiyIccC8mItMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719870553; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Wf2TaSpVrvwuzbPk1y4gUuAcr/aR62B67Z9yO7DHfAc=; b=iS1jpNwF3V39V2G1Fx6WR/jARvHD2QkR+gBA3kdWsVGNpXU36j7UvRv2OQXh232j5Lky29 KT5Zkl0vo8mbv+q27UDjMV9FGFeoeDamvUFOiHQQFOukpFMVMiFfEvRez08IFyw6bqF+pl F9TXe6X9vCxSYYJtRHf3jMEk25BdLOeuecdGAfrptrZfvdQk2Dh6JqZmLY0X3qJVvFP5Lw gAdwGJ8wU74I+BRIgiN1cUQfzFW89rCYJ4SlAkC0+Z1U/7gbO0ftxgf4Nv2DLSPxfBkeGJ OWMkejRKrytK9LEKwm9vuTcw+EqrFWfgrcwKMkpzY24wJBT9KaBkFtVKghGlSA== Received: from [IPV6:2601:5c0:4200:b830:198e:c253:cce:4f0] (unknown [IPv6:2601:5c0:4200:b830:198e:c253:cce:4f0]) (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 did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WCfnj17W2zWHW; Mon, 1 Jul 2024 21:49:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <7ca0ab94-4d5e-405e-b178-84ef3d8ebc8d@FreeBSD.org> Date: Mon, 1 Jul 2024 17:49:12 -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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 2508372b7b46 - main - cdefs.h: Assume the compiler supports at least GNU C 3.0 extensions Content-Language: en-US To: Warner Losh , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202406210241.45L2fNU2056962@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202406210241.45L2fNU2056962@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/20/24 7:41 PM, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=2508372b7b46117a9fb801b50624265d30888442 > > commit 2508372b7b46117a9fb801b50624265d30888442 > Author: Warner Losh > AuthorDate: 2024-06-20 23:02:42 +0000 > Commit: Warner Losh > CommitDate: 2024-06-21 02:41:08 +0000 > > cdefs.h: Assume the compiler supports at least GNU C 3.0 extensions > > All compilers that can build FreeBSD binaries (as opposed to the entire > system) support at least gcc 9 (gcc, clang, tcc). Even pcc supports most > of the gcc 4.3 attributes. Make this file simpler by removing support > for pre-3.0 compilers. > > Reviewed by: brooks > Differential Revision: https://reviews.freebsd.org/D45653 > Sponsored by: Netflix > --- > sys/sys/cdefs.h | 79 +-------------------------------------------------------- > 1 file changed, 1 insertion(+), 78 deletions(-) > > diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h > index 476c89d1dddb..88019819eb35 100644 > --- a/sys/sys/cdefs.h > +++ b/sys/sys/cdefs.h > @@ -389,45 +367,10 @@ > */ > #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901 > #define __restrict restrict > -#elif !__GNUC_PREREQ__(2, 95) > -#define __restrict > #endif > > -/* > - * GNU C version 2.96 adds explicit branch prediction so that > - * the CPU back-end can hint the processor and also so that > - * code blocks can be reordered such that the predicted path > - * sees a more linear flow, thus improving cache behavior, etc. > - * > - * The following two macros provide us with a way to utilize this > - * compiler feature. Use __predict_true() if you expect the expression > - * to evaluate to true, and __predict_false() if you expect the > - * expression to evaluate to false. > - * > - * A few notes about usage: > - * > - * * Generally, __predict_false() error condition checks (unless > - * you have some _strong_ reason to do otherwise, in which case > - * document it), and/or __predict_true() `no-error' condition > - * checks, assuming you want to optimize for the no-error case. > - * > - * * Other than that, if you don't know the likelihood of a test > - * succeeding from empirical or other `hard' evidence, don't > - * make predictions. > - * > - * * These are meant to be used in places that are run `a lot'. > - * It is wasteful to make predictions in code that is run > - * seldomly (e.g. at subsystem initialization time) as the > - * basic block reordering that this affects can often generate > - * larger code. > - */ > -#if __GNUC_PREREQ__(2, 96) > #define __predict_true(exp) __builtin_expect((exp), 1) > #define __predict_false(exp) __builtin_expect((exp), 0) > -#else > -#define __predict_true(exp) (exp) > -#define __predict_false(exp) (exp) > -#endif I think the comment was worth keeping around. You just need to modify the start of it to "Modern compilers include explicit branch prediction..." In particular, I think our current practice is still to apply prediction hints rather conservatively. -- John Baldwin From nobody Mon Jul 1 21:53:09 2024 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 4WCftG1ds8z5QCXR; Mon, 01 Jul 2024 21:53:10 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WCftF6Xl1z45X7; Mon, 1 Jul 2024 21:53:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719870789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AtOkBmnVaU4pD2ESbEIigjZO+nEKEPOZpblcqeqlrv4=; b=jC5UQ/1EHmwfPbHbi3oT3ZuPGshzgGG3f1ZsLE7veFahMFc2c07/btb6UwBKQrkDol5zHi UPAMjsnhJ6so7Cy37qiWa9mblsUJh8HmTBln/CirNQuJEx90gcWLal6LnNa64ZsJVV3Kvz 9F9jRTBtB75E4/DMMxqjXXRm1KM5oSPkhUVQXQFCyFRRXGSgQ64n8YlHRZ4Zfr5YqeiF0g pv+o5eABF5IqgU2CeFZG2XCn/jH8YmWbtpCi4UqBuXB9yXb507SGqOMoxacVH7xIyO/Amx noyM3iovjqLr94LCv7NyuyGk2MMPxajCnAI6v6aX1V7tySFp4xBK7OWCrHMpSw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719870789; a=rsa-sha256; cv=none; b=SXjgj4PmkytMczZoDCaCz/NaKSHXRRmMxify+bam4gt+Hk4LtJfRkI7YT19/QwK0munLjw L70UjnoPlA269xtQIkKJ5NZ6mO3gglyeF7oLfdowPBWQBlIJ+Izc01clVRRBiZmOWwvTry UcpN7G1dmhDLJxcbvC6jq1+XTdoKwpXPcBuxtn9Klzs2C2CyYxRrO6dR6KHmNVr7v07V8A Tas+OQC0UCo8M6B7NNJx/nFrJw7mq8J6v1PDduJZWTk9LMZog/GDxz93rgW0ag54C39W0j 6h9Puaa0Uf73VdcGt+5zYOOWpvaAeCENurhaXhWOyxhpccCAnT5a73v2zw8GGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719870789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AtOkBmnVaU4pD2ESbEIigjZO+nEKEPOZpblcqeqlrv4=; b=uYTx2tKfENRdmV6oyNvU7V5zqJTnlDqUErXfhFB/oDvex25zAy5Blb3/YeEFWXZtAXEfqz tOx0N7d4ZTHUh/yOVREZxAKWbKHJ0NXf0dceT6QS5LpTmeYQYZW+0XuSBBAEyjwRWuxLuy jHGsI5rgxOAD7erIvIGWB1PlhN5tTkHmPf4YKrD+ihjrmKBhz7iVMQrZasl8XQzZX83f/f AVfy0uQ7VuHgwBtHLP/6yRf09hyJdShM+NwDehN0SBtiir1+gSBEwDHS5khbwXsA5KC2bC Sy70m13wpJVeEMUZd9rDA7A8j0W9eVnqER3/pZWC789g4g8L3wIxZzGEhVnjCw== Received: from [IPV6:2601:5c0:4200:b830:198e:c253:cce:4f0] (unknown [IPv6:2601:5c0:4200:b830:198e:c253:cce:4f0]) (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 did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WCftF4fRfzWHd; Mon, 1 Jul 2024 21:53:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <4ecc814d-5df1-4db8-b9e0-4919895c5e6a@FreeBSD.org> Date: Mon, 1 Jul 2024 17:53:09 -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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 67d1a1cd9e77 - main - cdefs.h: Remove support for pre gcc 4.0 Content-Language: en-US To: Warner Losh , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202406210241.45L2fOkP057010@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202406210241.45L2fOkP057010@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/20/24 7:41 PM, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=67d1a1cd9e772e2ef94003579f4fbc271d38be7d > > commit 67d1a1cd9e772e2ef94003579f4fbc271d38be7d > Author: Warner Losh > AuthorDate: 2024-06-20 23:02:56 +0000 > Commit: Warner Losh > CommitDate: 2024-06-21 02:41:08 +0000 > > cdefs.h: Remove support for pre gcc 4.0 > > All supported compilers support the gcc 3 attribute extensions. Remove > the #else clauses for this. Also, latter-day pcc compilers also define > __GNUC__, so there's not need to also test for __PCC__. > > Reviewed by: brooks > Differential Revision: https://reviews.freebsd.org/D45654 > Sponsored by: Netflix > --- > sys/sys/cdefs.h | 42 ++++-------------------------------------- > 1 file changed, 4 insertions(+), 38 deletions(-) > > diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h > index 88019819eb35..a6ecdca5d8b9 100644 > --- a/sys/sys/cdefs.h > +++ b/sys/sys/cdefs.h > @@ -408,15 +389,10 @@ > * assign pointer x to a local variable, to check that its type is > * compatible with member m. > */ > -#if __GNUC_PREREQ__(3, 1) > #define __containerof(x, s, m) ({ \ > const volatile __typeof(((s *)0)->m) *__x = (x); \ > __DEQUALIFY(s *, (const volatile char *)__x - __offsetof(s, m));\ > }) > -#else > -#define __containerof(x, s, m) \ > - __DEQUALIFY(s *, (const volatile char *)(x) - __offsetof(s, m)) > -#endif > > /* > * Compiler-dependent macros to declare that functions take printf-like > @@ -434,14 +410,8 @@ > #define __strftimelike(fmtarg, firstvararg) \ > __attribute__((__format__ (__strftime__, fmtarg, firstvararg))) > > -/* Compiler-dependent macros that rely on FreeBSD-specific extensions. */ > -#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 && \ > - defined(__GNUC__) > #define __printf0like(fmtarg, firstvararg) \ > __attribute__((__format__ (__printf0__, fmtarg, firstvararg))) > -#else > -#define __printf0like(fmtarg, firstvararg) > -#endif Does this still work with external GCC? I didn't think printf0 was supported by external GCC (or maybe I had to readd it in the port and that's what I remember). Ah, yes, printf0 is a local patch in the devel/freebsd-gccX ports, but is not available in stock GCC (e.g. lang/gcc does not support it). -- John Baldwin From nobody Mon Jul 1 22:28:55 2024 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 4WCggY1HW6z5QJjZ; Mon, 01 Jul 2024 22:28:57 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WCggY0gRsz4B7m; Mon, 1 Jul 2024 22:28:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719872937; 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=X2pCBzZqoE4u/Xc1LHXn/z/hYpP0+QtQFd02iDzhX9A=; b=j8OVs/BDYOHLClnxRqjIylW0l4+Q8Llri2yVj2KxyI/oztk3D9IJ3dFH0RWermCz91oVpC yRnHlAt73OppG8+mpE7rOiw2RKvwOdSfyrXrBLRYtYeRVOgT9VckMtaxZnOM31erzc2Am0 S2hEWTgJpkwR48ObtufTul/acJ2q2ZTq9GFjOH0wMCJEOkEUpJGJ/fUqWWjCKpPD8VKFlU OiXePynd+PtqxRmwasQXsLsqHD3L510EIT2aqKnGY6qVPBeTtrgD0z7LH89+n6iliUxVuE vv+9rEoH5MkYR477KVF+HLXTYDJYuTFC849U0JkMYsVO7y+2fw+BA8Ct/XGJVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719872937; a=rsa-sha256; cv=none; b=TQIkfS6kdx9q1u6e7t7LKnwBOvMP341bVoWi+44Kqxe7u8PtR10eXGr4LBZTWS0wPX76bP mFO4D3p1Fca5zEe9xaVRZhgnIhMGFMXFg8lT58kFB1bgCTHkWZ3cAg6T5T9kB9iYb600Dx krdJmnH87NmG7McrehJ76wX+P+CyeQjWGv57JlGniD6K6u7Kn4YAqdk8vnauC2NHd2CZV8 tLRe+0JdW7/kZQXoE5hEMpyuMj25L9gJqU6tStvEzCtBEv8tSbL7QX3T0tL7e2knYnsghQ BBGK43XIVgPHWeH5R/Y4MhG+bjkUeGrstu84BRK/+IN2KS2cetMJtbV74qClQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719872937; 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=X2pCBzZqoE4u/Xc1LHXn/z/hYpP0+QtQFd02iDzhX9A=; b=RCDsDzi1uVYJOtBU6GXhp66obwUkSsuD14pzAEqHvzfHqWhaeDYarKpp4qMbRFFotZ0Vwb LPwFouOzbLTFf5a+eRbgHrJxvCB0Z1N0xQ65dCS/pVMbzFJs+EVa8+8tFf/ZJJG8pGwrJ0 ZEBTyGGucLlKBBFWla/8ofPho65DvPPRfQ/NoUsAny3ElxzFBPsSD4+BHumovhsMbUkSJ0 sp6021XxzZul6aBR3CECRj9AxjoAiRHM98sxA77I1ZkkKYrSIwtOIHsKJydNBz0xtqudOV 1UQdM56GKmOtOepGTpe+PIh0cWNJakmXjT7XcgxktTxf1o1UZf9PSGGpKK8U2Q== Received: from [IPV6:2601:5c0:4200:b830:198e:c253:cce:4f0] (unknown [IPv6:2601:5c0:4200:b830:198e:c253:cce:4f0]) (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 did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WCggX5XMzzYNh; Mon, 1 Jul 2024 22:28:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Mon, 1 Jul 2024 18:28:55 -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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 7cae020b9c97 - main - Simplify signal handling code in libthr by removing use of SYS_sigreturn Content-Language: en-US To: Warner Losh , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202406062150.456LorpK058076@gitrepo.freebsd.org> From: John Baldwin Cc: Dapeng Gao In-Reply-To: <202406062150.456LorpK058076@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/6/24 2:50 PM, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=7cae020b9c977c11881363d726b13d1cd2feec5e > > commit 7cae020b9c977c11881363d726b13d1cd2feec5e > Author: Dapeng Gao > AuthorDate: 2024-06-03 18:18:13 +0000 > Commit: Warner Losh > CommitDate: 2024-06-06 21:48:39 +0000 > > Simplify signal handling code in libthr by removing use of SYS_sigreturn > > The use of SYS_sigreturn is unnecessary here. > > If handle_signal is called when a signal is delivered, it can just > return normally back to sigcode which will call sigreturn anyway. > > In case handle_signal is called by check_deferred_signal, using > setcontext is better than SYS_sigreturn because that is the correct > system call to pair with the earlier getcontext. > > Reviewed by: imp, kib > Differential Revision: https://reviews.freebsd.org/D44893 > --- > lib/libthr/thread/thr_sig.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/lib/libthr/thread/thr_sig.c b/lib/libthr/thread/thr_sig.c > index ad291d106001..b953c430158c 100644 > --- a/lib/libthr/thread/thr_sig.c > +++ b/lib/libthr/thread/thr_sig.c > @@ -247,7 +247,6 @@ static void > handle_signal(struct sigaction *actp, int sig, siginfo_t *info, ucontext_t *ucp) > { > struct pthread *curthread = _get_curthread(); > - ucontext_t uc2; > __siginfohandler_t *sigfunc; > int cancel_point; > int cancel_async; > @@ -307,13 +306,11 @@ handle_signal(struct sigaction *actp, int sig, siginfo_t *info, ucontext_t *ucp) > curthread->cancel_point = cancel_point; > curthread->cancel_enable = cancel_enable; > > - memcpy(&uc2, ucp, sizeof(uc2)); > - SIGDELSET(uc2.uc_sigmask, SIGCANCEL); > + SIGDELSET(ucp->uc_sigmask, SIGCANCEL); > > /* reschedule cancellation */ > - check_cancel(curthread, &uc2); > + check_cancel(curthread, ucp); > errno = err; > - syscall(SYS_sigreturn, &uc2); > } > > void > @@ -400,6 +397,7 @@ check_deferred_signal(struct pthread *curthread) > /* remove signal */ > curthread->deferred_siginfo.si_signo = 0; > handle_signal(&act, info.si_signo, &info, uc); > + syscall(SYS_sigreturn, uc); The commit log implies this should be calling setcontext() instead of syscall()? Was that a stale part of the commit log? I thought I remember discussing this at one point. Maybe the issue was that you couldn't pre-resolve the PLT for setcontext()? -- John Baldwin From nobody Mon Jul 1 23:09:24 2024 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 4WChZT4zkhz5QPWs for ; Mon, 01 Jul 2024 23:09:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WChZT3C8Jz4KkP for ; Mon, 1 Jul 2024 23:09:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-6eab07ae82bso2039785a12.3 for ; Mon, 01 Jul 2024 16:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1719875376; x=1720480176; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=vdfLXwZu3TCb/T5MvpXiBn8RTJSSyOEZquMos/fJ5Z8=; b=zZMVcIVbbo26dDmfJbpGzaiPW5V0yWaW6hd7XsO/VtQRfk28AbVsQdyUZAeG9Rx/YJ 2ycU5Vqb5EZLFT1Iu4z7x/FbvYAWlIZkk+9wk5JPraRK+JIcT3EwgBcDFxyzKmsS0aw2 VpE90dqiH36RbmJubH6JWcKaKmgzM17ngakjICzRaIm8zss/ZnzFvd/KjwoGMyBmcwnz 1QY517vMRV3Ho/deIxc6JhTypZ0YOq3N4Pu2RA65NS7CKn5dn8afI4GArgwx74Wnhlgs YcNVdE/uvkyhjKVo+vy3GsWfNrHH3hSrhmAFvnEOqf3951r9nf76Vv6TRm//doV2i82Y KNBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719875376; x=1720480176; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vdfLXwZu3TCb/T5MvpXiBn8RTJSSyOEZquMos/fJ5Z8=; b=JBa9c/bwKXbdRJOR3UFCWcYCyw929mwbvJukRNDhucjKmN2J+Nw6oMdy8oxwlhIf5b EAkL/lkKCP3O6or84s6aVLL+2dS3CgiIQN65a8m+8v+OzWUo4IyLhhYUYNsUjrLWW6LL ggAmJFJza+D6VGnnPvTtt2wYpNN9Go4TImlnze0lZP5CI0u0Fwd78JPfvzNvu9fsPIAX NJ/w4DL9N2FaYTicCcSwD3oBtqfGES64q8rFE5TJXwF3XLGzS/6cjhkhRg9kh9Wo+eoV VhRypMPIi94KAGt+TAT1G8oyQsKouumjRF9VRqwPfXLcbyoe4sdgT3TsVO+4T7mX7PnE j7Fw== X-Forwarded-Encrypted: i=1; AJvYcCVNpLGqdOAaUa/NuwM/Mgvw1my0ucHV43MgvnQvJHXagp2nR7BcaW1WNDSZd1QJqy3TUUwvLoUnmmv+qKO1UvMbKGe8+U0Q2yMQ5DN1BhjkRA== X-Gm-Message-State: AOJu0Yzi44uNUy0cdmJmSWaaCrwj+480Qo6w8+0Jy43DsHBPwJ1p4kAX MiO4u5+QLtlW+3mmJVKsqgd1OnJJy275/4f1Ya92HEcVNZZm4RUBVsyTLtArPKQsDiFnq96QwEL dWWy8c+OLY5Rxbr+9xb5svLUoZAcu4E5LsIMmONGy0QYg1BgWL7Y= X-Google-Smtp-Source: AGHT+IEsUzvr4lNcmEdrzaBo770pg4L7lXV0h0uw4a+d1MN//QFOoiv5Lf9/kexf35+r9snBoYg0o24VZt1ndXN0/7A= X-Received: by 2002:a05:6a20:2448:b0:1be:2e11:2aa2 with SMTP id adf61e73a8af0-1bef6109dc2mr6283681637.22.1719875376048; Mon, 01 Jul 2024 16:09:36 -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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202406210241.45L2fOkP057010@gitrepo.freebsd.org> <4ecc814d-5df1-4db8-b9e0-4919895c5e6a@FreeBSD.org> In-Reply-To: <4ecc814d-5df1-4db8-b9e0-4919895c5e6a@FreeBSD.org> From: Warner Losh Date: Mon, 1 Jul 2024 17:09:24 -0600 Message-ID: Subject: Re: git: 67d1a1cd9e77 - main - cdefs.h: Remove support for pre gcc 4.0 To: John Baldwin Cc: Warner Losh , src-committers , "" , "" Content-Type: multipart/alternative; boundary="000000000000d90221061c37b0ad" X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4WChZT3C8Jz4KkP --000000000000d90221061c37b0ad Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jul 1, 2024, 3:53=E2=80=AFPM John Baldwin wrote: > On 6/20/24 7:41 PM, Warner Losh wrote: > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D67d1a1cd9e772e2ef94003579f4fbc2= 71d38be7d > > > > commit 67d1a1cd9e772e2ef94003579f4fbc271d38be7d > > Author: Warner Losh > > AuthorDate: 2024-06-20 23:02:56 +0000 > > Commit: Warner Losh > > CommitDate: 2024-06-21 02:41:08 +0000 > > > > cdefs.h: Remove support for pre gcc 4.0 > > > > All supported compilers support the gcc 3 attribute extensions. > Remove > > the #else clauses for this. Also, latter-day pcc compilers also > define > > __GNUC__, so there's not need to also test for __PCC__. > > > > Reviewed by: brooks > > Differential Revision: https://reviews.freebsd.org/D45654 > > Sponsored by: Netflix > > --- > > sys/sys/cdefs.h | 42 ++++-------------------------------------- > > 1 file changed, 4 insertions(+), 38 deletions(-) > > > > diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h > > index 88019819eb35..a6ecdca5d8b9 100644 > > --- a/sys/sys/cdefs.h > > +++ b/sys/sys/cdefs.h > > @@ -408,15 +389,10 @@ > > * assign pointer x to a local variable, to check that its type is > > * compatible with member m. > > */ > > -#if __GNUC_PREREQ__(3, 1) > > #define __containerof(x, s, m) ({ > \ > > const volatile __typeof(((s *)0)->m) *__x =3D (x); = \ > > __DEQUALIFY(s *, (const volatile char *)__x - __offsetof(s, m));\ > > }) > > -#else > > -#define __containerof(x, s, m) > \ > > - __DEQUALIFY(s *, (const volatile char *)(x) - __offsetof(s, m)) > > -#endif > > > > /* > > * Compiler-dependent macros to declare that functions take printf-li= ke > > @@ -434,14 +410,8 @@ > > #define __strftimelike(fmtarg, firstvararg) \ > > __attribute__((__format__ (__strftime__, fmtarg, firstvararg)= )) > > > > -/* Compiler-dependent macros that rely on FreeBSD-specific extensions. > */ > > -#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >=3D 300001 = && \ > > - defined(__GNUC__) > > #define __printf0like(fmtarg, firstvararg) \ > > __attribute__((__format__ (__printf0__, fmtarg, firstvararg))= ) > > -#else > > -#define __printf0like(fmtarg, firstvararg) > > -#endif > > Does this still work with external GCC? I didn't think printf0 was > supported > by external GCC (or maybe I had to readd it in the port and that's what I > remember). Ah, yes, printf0 is a local patch in the devel/freebsd-gccX > ports, but is not available in stock GCC (e.g. lang/gcc does not support > it). > Ah. That would explain why it just worked for me. That's what I tested with. Clang also seemed happy with it. But that was the in tree clang. Is there a similar issue? Gnuc is defined for both. Warner --=20 > John Baldwin > > --000000000000d90221061c37b0ad Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Mon, Jul 1, 2024, 3:53=E2=80=AFPM John Baldwin <= jhb@freebsd.org> wrote:
=
On 6/20/24 7:41 PM, Warner Losh wrote:
> The branch main has been updated by imp:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=3D67d1a1cd9e772e2ef94003579f4fbc= 271d38be7d
>
> commit 67d1a1cd9e772e2ef94003579f4fbc271d38be7d
> Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> AuthorDate: 2024-06-20 23:02:56 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2024-06-21 02:41:08 +0000
>
>=C2=A0 =C2=A0 =C2=A0 cdefs.h: Remove support for pre gcc 4.0
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 All supported compilers support the gcc 3 attribut= e extensions. Remove
>=C2=A0 =C2=A0 =C2=A0 the #else clauses for this. Also, latter-day pcc c= ompilers also define
>=C2=A0 =C2=A0 =C2=A0 __GNUC__, so there's not need to also test for= __PCC__.
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 brooks
>=C2=A0 =C2=A0 =C2=A0 Differential Revision:=C2=A0 h= ttps://reviews.freebsd.org/D45654
>=C2=A0 =C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0Netflix
> ---
>=C2=A0 =C2=A0sys/sys/cdefs.h | 42 ++++---------------------------------= -----
>=C2=A0 =C2=A01 file changed, 4 insertions(+), 38 deletions(-)
>
> diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
> index 88019819eb35..a6ecdca5d8b9 100644
> --- a/sys/sys/cdefs.h
> +++ b/sys/sys/cdefs.h
> @@ -408,15 +389,10 @@
>=C2=A0 =C2=A0 * assign pointer x to a local variable, to check that its= type is
>=C2=A0 =C2=A0 * compatible with member m.
>=C2=A0 =C2=A0 */
> -#if __GNUC_PREREQ__(3, 1)
>=C2=A0 =C2=A0#define=C2=A0 =C2=A0 =C2=A0__containerof(x, s, m) ({=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\
>=C2=A0 =C2=A0 =C2=A0 =C2=A0const volatile __typeof(((s *)0)->m) *__x= =3D (x);=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0__DEQUALIFY(s *, (const volatile char *)__x = - __offsetof(s, m));\
>=C2=A0 =C2=A0})
> -#else
> -#define=C2=A0 =C2=A0 =C2=A0 __containerof(x, s, m)=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \
> -=C2=A0 =C2=A0 =C2=A0__DEQUALIFY(s *, (const volatile char *)(x) - __o= ffsetof(s, m))
> -#endif
>=C2=A0 =C2=A0
>=C2=A0 =C2=A0/*
>=C2=A0 =C2=A0 * Compiler-dependent macros to declare that functions tak= e printf-like
> @@ -434,14 +410,8 @@
>=C2=A0 =C2=A0#define=C2=A0 =C2=A0 =C2=A0__strftimelike(fmtarg, firstvar= arg) \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0__attribute__((__format__ (__s= trftime__, fmtarg, firstvararg)))
>=C2=A0 =C2=A0
> -/* Compiler-dependent macros that rely on FreeBSD-specific extensions= . */
> -#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= ;=3D 300001 && \
> -=C2=A0 =C2=A0 defined(__GNUC__)
>=C2=A0 =C2=A0#define=C2=A0 =C2=A0 =C2=A0__printf0like(fmtarg, firstvara= rg) \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0__attribute__((__format__ (__p= rintf0__, fmtarg, firstvararg)))
> -#else
> -#define=C2=A0 =C2=A0 =C2=A0 __printf0like(fmtarg, firstvararg)
> -#endif

Does this still work with external GCC?=C2=A0 I didn't think printf0 wa= s supported
by external GCC (or maybe I had to readd it in the port and that's what= I
remember).=C2=A0 Ah, yes, printf0 is a local patch in the devel/freebsd-gcc= X
ports, but is not available in stock GCC (e.g. lang/gcc does not support it= ).

Ah. That would explain why it just worked for me. That's what I teste= d with. Clang also seemed happy with it. But that was the in tree clang. Is= there a similar issue? Gnuc is defined for both.
Warner

--
John Baldwin

--000000000000d90221061c37b0ad-- From nobody Tue Jul 2 04:58:16 2024 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 4WCrJm59sHz5PDLQ; Tue, 02 Jul 2024 04:58: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WCrJm4gGXz3x59; Tue, 2 Jul 2024 04:58:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719896296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MlywIGpjV683OXwq7vkcDXy9qDUPYeG2MSekda5Y02o=; b=Oe8JANGRvd2JdSiGhDjlFGX2+Nw7uVuU+MJaZ0bXp51duQfJXn9zrpJwOBpyg1UexZky/g 7GZGSqw6TQhHfEwDCArHNb0keHMz2FP5WsxTZFxmGv4qxd6g6J6D4kq/UHYeZdQeapySGB Sp9+kPwq6uQ9Mq/0rT9lNPKDM9LqpCioW4PGj4CcXygV2To3itsFHlmG4uti/Eej5JEiJx dTzMVavbaPnc823phJgtZ5tA0Wqj460fIdf34MEZlmD8hC7yaXMshnRVtIQsCqq2ASxJGS 6G/pJ3kki7qfiilIxT/irXMGA1opf220Fth6i20duutmgz2L2GrgsJSzvxWJ4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719896296; a=rsa-sha256; cv=none; b=wjhP5aR72yv05kBYG7IhU+1VbQGQ9VyDbuPJdXN/buNZXsPDgDHsLSlUL5Lf32qvUjWwDC W3rxK2TeCVy6eHq/AyF3i2Zb8w7r3y8/srNqU/RAxgwih4KSRo43r800Ojr/HAocFYaNkB rNliY7hppn/L5ZXwt1wbo5r0SAaVurkUgMp5yxGsSRH866jrZ8YO7Pl7lQIp+Rulwkxc/R xqJFjrxSdnS3LOhumKA2ZKW8zr5Plf9orNBLtXXwPlG16wDH5itJX/iOZGpONio63D799H 16ISAmborH90X9/74wSav+XxYF+qNdWLDP4NELRRXZuV+9MF8YLiy973Dv5wQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719896296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MlywIGpjV683OXwq7vkcDXy9qDUPYeG2MSekda5Y02o=; b=GeXfofHPwUEdVsT2CgqvATY8D0yADwju0UVRj1U3Kd8KgfymHtccU8eLWTIBlUHU1OvQM6 8nS1G6ta14ExRN2C6sohmn11oZyueJRCgzV5qAmWIh3BAtlB0A2GQXL5pH4xKDHA1lynLB x3VWR+zXj6E3tP9Vwt70xFDMfUxvd8heH8kIo+THIvZtaVqXUQcE43fAKYYIQgTxPUaQrG IY1wAYmFSMMwA4F5M3K7KEvn03YlSeD/sX3btwjR4onsKdl/ps6oh/MpVMDy7i0nTLbtOB oABA7UhYLsBBuO+E3bDT6JzVSLWtt+nom/8V3BwV9VpF2wZQmSP2sAaY5Gf6kA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WCrJm4GkszbBF; Tue, 2 Jul 2024 04:58:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4624wGWe062892; Tue, 2 Jul 2024 04:58:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4624wGtR062889; Tue, 2 Jul 2024 04:58:16 GMT (envelope-from git) Date: Tue, 2 Jul 2024 04:58:16 GMT Message-Id: <202407020458.4624wGtR062889@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: d6963b9ed328 - main - if_vxlan(4): Exclude ETHER_CRC_LEN from macro VXLAN_MAX_MTU 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d6963b9ed3287e91db3d1df153861591faff0007 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=d6963b9ed3287e91db3d1df153861591faff0007 commit d6963b9ed3287e91db3d1df153861591faff0007 Author: Zhenlei Huang AuthorDate: 2024-07-02 04:57:01 +0000 Commit: Zhenlei Huang CommitDate: 2024-07-02 04:57:01 +0000 if_vxlan(4): Exclude ETHER_CRC_LEN from macro VXLAN_MAX_MTU The encapsulated (original) frame does not count in FCS as per Section 5 of RFC 7348. Reviewed by: afedorov, bryanv, #network Fixes: b7592822d5de Allow set MTU more than 1500 bytes MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45195 --- sys/net/if_vxlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c index 37f987981a0c..05430768cc73 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -97,7 +97,7 @@ struct vxlan_socket_mc_info { 60 /* Maximum IPv4 header len */ - \ sizeof(struct udphdr) - \ sizeof(struct vxlan_header) - \ - ETHER_HDR_LEN - ETHER_CRC_LEN - ETHER_VLAN_ENCAP_LEN) + ETHER_HDR_LEN - ETHER_VLAN_ENCAP_LEN) #define VXLAN_BASIC_IFCAPS (IFCAP_LINKSTATE | IFCAP_JUMBO_MTU) #define VXLAN_SO_MC_MAX_GROUPS 32 From nobody Tue Jul 2 04:58:17 2024 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 4WCrJn6Bx2z5PDWX; Tue, 02 Jul 2024 04:58: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WCrJn5clFz3x9m; Tue, 2 Jul 2024 04:58:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719896297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dYXeAok3IcEsZlf2I2sBKcLnEXnmC8udrLt7s5EX8Ak=; b=XKFCqKefNlVGprtKNgMNpLchu5s+AfBOqT5kt8zc7DpQe5BzHkVAmZNKT1ly51FhrOK7Sy gglIe6tj2eIr1VtY4XI38SqzBQB93OdutWZFXUgG96ePxMcQZKX7YugsQ4PBWobQhTchtV rMxFVmQapxVY6qMNTFvO80CreF88JylYBeC6P9tSXNkTNgI8DgPe+/7tcIY2b/vClfqpfF DPmeiwr/HdfUhlzVJ1os1V4YKXrhkw7OwvTtdx+YRFR/iywr60UD9V99CcnsHvl8Ca7TmW s2MgcZZPcAOErI6R1KIgyKcJhkDO8fuc2GLe1K3/ZJNO7BxAoQO5tUnQdWFV1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719896297; a=rsa-sha256; cv=none; b=TnR0iunNcPhES4zSn2qSv3zFxgDMdXUtFhyJPasaKP7zyOElrNVDemd4DYC+datBQtW8LX QZ3IOeDIR1kHR5bcHL0lxOWyzcOXlucIcDpFYiKbCkt5BeIusha40BR4gX+azqLQumeQMp 6zqrAlGysFnwHJEZPfKWgkoSEy9mb/4nvrjdkFIQJEg0hq/bWU07CG9zqC5XkBRxKa+sB9 zaec7oV9QFUGTUgKCAc/PjGwkUUgs0uFgNCA5EbXeAix/0wFxgGfj5bi0N4EsJ13ectIcf M0Eej7/Gx+fE565xzGevbloeLTjX2D2RLJ7AA8STVG4VRIrIaDGORD4MNkYeXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719896297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dYXeAok3IcEsZlf2I2sBKcLnEXnmC8udrLt7s5EX8Ak=; b=naoC1HNHybDYF6WuImNP8b8q4kwN3kw9BN1/vk6qo3H9NncGHbtRIQFGFLB1YlJBY38/tw JK1MH7mZn69feYHixXnivu/muK7yMHxSJL11Dm9v2PQ2SD1uGeTNCk/4kINFUkKa8+WmCe r2/c8jLfcSMCWvPzvZGJhgZ4CDVAlJ7AAFuE2WmaEjG0eK4zn3y7IPTtHYNlIVP5/b3R3h d25bYwgQisJs9nw8rLUaGYzP3T3kbuUB38E+eed7oKmsgr3fgEq2Nx534mEF/7QcWZY9z6 45nwOZc6kj2GBdZb7CzKKhYBjBdGgWn4BhjWUTKOVB/YBQS61gGyFVb9FuCx6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WCrJn5F0fzZlj; Tue, 2 Jul 2024 04:58:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4624wHeU062942; Tue, 2 Jul 2024 04:58:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4624wHij062939; Tue, 2 Jul 2024 04:58:17 GMT (envelope-from git) Date: Tue, 2 Jul 2024 04:58:17 GMT Message-Id: <202407020458.4624wHij062939@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 087f5e08ab5f - main - if_vxlan(4): Plug a memory leak 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 087f5e08ab5f0384163f76f73b9a91c98a3ba450 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=087f5e08ab5f0384163f76f73b9a91c98a3ba450 commit 087f5e08ab5f0384163f76f73b9a91c98a3ba450 Author: Zhenlei Huang AuthorDate: 2024-07-02 04:57:02 +0000 Commit: Zhenlei Huang CommitDate: 2024-07-02 04:57:02 +0000 if_vxlan(4): Plug a memory leak On clone creating, either failure from vxlan_set_user_config() or ifc_copyin() will result in leaking previous allocated counters. Since counter_u64_alloc(M_WAITOK) never fails, make vxlan_stats_alloc() void and move the allocation for counters below checking ifd->params to avoid memory leak. Reviewed by: kp, glebius Fixes: b092fd6c973d if_vxlan(4): add support for hardware assisted checksumming, TSO, and RSS MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45822 --- sys/net/if_vxlan.c | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c index 05430768cc73..bb2de793550f 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -367,7 +367,7 @@ static bool vxlan_rcv_udp_packet(struct mbuf *, int, struct inpcb *, static int vxlan_input(struct vxlan_socket *, uint32_t, struct mbuf **, const struct sockaddr *); -static int vxlan_stats_alloc(struct vxlan_softc *); +static void vxlan_stats_alloc(struct vxlan_softc *); static void vxlan_stats_free(struct vxlan_softc *); static void vxlan_set_default_config(struct vxlan_softc *); static int vxlan_set_user_config(struct vxlan_softc *, @@ -2923,27 +2923,14 @@ out: return (error); } -static int +static void vxlan_stats_alloc(struct vxlan_softc *sc) { struct vxlan_statistics *stats = &sc->vxl_stats; stats->txcsum = counter_u64_alloc(M_WAITOK); - if (stats->txcsum == NULL) - goto failed; - stats->tso = counter_u64_alloc(M_WAITOK); - if (stats->tso == NULL) - goto failed; - stats->rxcsum = counter_u64_alloc(M_WAITOK); - if (stats->rxcsum == NULL) - goto failed; - - return (0); -failed: - vxlan_stats_free(sc); - return (ENOMEM); } static void @@ -2951,18 +2938,9 @@ vxlan_stats_free(struct vxlan_softc *sc) { struct vxlan_statistics *stats = &sc->vxl_stats; - if (stats->txcsum != NULL) { - counter_u64_free(stats->txcsum); - stats->txcsum = NULL; - } - if (stats->tso != NULL) { - counter_u64_free(stats->tso); - stats->tso = NULL; - } - if (stats->rxcsum != NULL) { - counter_u64_free(stats->rxcsum); - stats->rxcsum = NULL; - } + counter_u64_free(stats->txcsum); + counter_u64_free(stats->tso); + counter_u64_free(stats->rxcsum); } static void @@ -3233,9 +3211,6 @@ vxlan_clone_create(struct if_clone *ifc, char *name, size_t len, sc->vxl_unit = ifd->unit; sc->vxl_fibnum = curthread->td_proc->p_fibnum; vxlan_set_default_config(sc); - error = vxlan_stats_alloc(sc); - if (error != 0) - goto fail; if (ifd->params != NULL) { error = ifc_copyin(ifd, &vxlp, sizeof(vxlp)); @@ -3247,6 +3222,7 @@ vxlan_clone_create(struct if_clone *ifc, char *name, size_t len, goto fail; } + vxlan_stats_alloc(sc); ifp = if_alloc(IFT_ETHER); sc->vxl_ifp = ifp; rm_init(&sc->vxl_lock, "vxlanrm"); From nobody Tue Jul 2 15:41:09 2024 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 4WD6ZY6dVdz5MpbY; Tue, 02 Jul 2024 15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WD6ZY556dz45jy; Tue, 2 Jul 2024 15:41:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719934869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1+qkNvBcigrS6bDElLMdN9Ft5NHxE65QR0VZKcCxP8k=; b=T+/U+Cg1v9FsgkP/h9Gmx5QyAH9xFxarmD8c49CoT74BbskwFSsAIZbcEKFSAEPzvl/KY9 +qXcvOReDyiWrxO7sN+/XyVyz/cxCVSo+0MG/VRyyjkZnAtDf0CNYhVI66EYucm4WuEoBL j59p1C9ghEZ6nqL3qvgq88j9U69jFdy35CF5SRljC4cXLadj5AjIT2PhPT48wRE37AkViD TBN3e9+u1tbfDjr2++b5AMKKSQ8Sycs3Yg8CdYRkFC1td5LrHwP+lJevpaq0D42D+gEted BWv4yvaTvIbxQjLxkM4C42+z4uFtCErhOBnjLxVNEQdKPpYwLj8CTyEXD7qUMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719934869; a=rsa-sha256; cv=none; b=S7vuUw9LxrSyXWSaPiGEs3oDcPeYv5/p0cyT6UqGllNWlnmj1rNG0mwbHfFwPq4BfyUYyD OOB2IQkwXwDTLtnRUN5ZUdzJrCz0kj+VVZDDAsdUmexT8CjzqTJRpsC3Qt5Tz3+8yqCV/i 3F7iEdPk+8/UUq/mmY7K/C3iDnTZQsGv/wD/6PyLHGcL1OENAE8gYa3+31DEXD9GVG633N fotTxYcN5/b+S/hzbic08cqTebbjH45NxsDIWP15i+CWqbAY+UNryHnoVIl3nkHEidPe21 CwJAjuKRWxNv05kN0VkuRRXMGFBCoNrKtEhTJ+q2ohsHlPRykUzyFLQUv6D8FA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719934869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1+qkNvBcigrS6bDElLMdN9Ft5NHxE65QR0VZKcCxP8k=; b=ixUUgQH720LMxJ93c2QB58GJYkYuhlOzV2334h7dmQmbutpSmlbyqvn4rWQBswUiTlYB2j GC43TJTVgIz5xSsBz7OrqPgFQ5LAaCD9C08eC+VYeXtEs26v6p4MsEdlCfxniH6Vg05GYk ERXMsSJRB9jkvI0k4p6j5ccfMmSagbPyBqeAGZuXPHnCbG3JHnss9wdUPxCdFURj8HDXXT Fwmai6ghqIwqmodbqVWuF5uYDyqaBjvZihyg/LO9aMxEk0dPEOg9YiIKCMil6GJY+CtS5+ EWBwoHmhEj0B5YrPAPb6AYIndqKictrQ9Hza5y3styBF+z95FNb+SYif0/yZHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WD6ZY4hTzzsnG; Tue, 2 Jul 2024 15:41:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 462Ff9GY052644; Tue, 2 Jul 2024 15:41:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 462Ff9LW052641; Tue, 2 Jul 2024 15:41:09 GMT (envelope-from git) Date: Tue, 2 Jul 2024 15:41:09 GMT Message-Id: <202407021541.462Ff9LW052641@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: 239e24eb0cf6 - main - pf: Handle (*m0)->m_len < sizeof(struct ip) case 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 239e24eb0cf694547f75d9b75d029895c9d540b1 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=239e24eb0cf694547f75d9b75d029895c9d540b1 commit 239e24eb0cf694547f75d9b75d029895c9d540b1 Author: Igor Ostapenko AuthorDate: 2024-07-02 12:41:54 +0000 Commit: Kristof Provost CommitDate: 2024-07-02 12:43:46 +0000 pf: Handle (*m0)->m_len < sizeof(struct ip) case if_enc(4) can pass IPsec payload to pfil(9) with the outer header or without it. In case of a small packet like ICMP, when mbuf cluster is not used, everything works fine. Otherwise, the first mbuf in a chain has m_len == 0 if it is asked to strip the outer header. pf was not handling such case, and erroneous reading of the outer IP header led to unexpected behavior. Reviewed by: kp, glebius Differential Revision: https://reviews.freebsd.org/D45780 --- sys/netpfil/pf/pf.c | 8 ++ tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/if_enc.sh | 220 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 229 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 1e3f09783e40..4ad0a9a1336a 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -8082,6 +8082,14 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, pd.af = AF_INET; pd.act.rtableid = -1; + if (m->m_len < sizeof(struct ip) && + (m = *m0 = m_pullup(*m0, sizeof(struct ip))) == NULL) { + DPFPRINTF(PF_DEBUG_URGENT, + ("pf_test: m_len=%d < sizeof(struct ip), pullup failed\n", + m->m_len)); + PF_RULES_RUNLOCK(); + return (PF_DROP); + } h = mtod(m, struct ip *); off = h->ip_hl << 2; diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index 2840dc92f2fa..71f26979415a 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -17,6 +17,7 @@ ATF_TESTS_SH+= altq \ fragmentation_no_reassembly \ get_state \ icmp \ + if_enc \ limits \ loginterface \ killstate \ diff --git a/tests/sys/netpfil/pf/if_enc.sh b/tests/sys/netpfil/pf/if_enc.sh new file mode 100644 index 000000000000..a6d258e40e33 --- /dev/null +++ b/tests/sys/netpfil/pf/if_enc.sh @@ -0,0 +1,220 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 Igor Ostapenko +# +# 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. + +. $(atf_get_srcdir)/utils.subr + +# +# The following network is used as a base for testing. +# +# +# ${awan}b |----------| ${bwan}b +# 2.0.0.1 | host wan | 3.0.0.1 +# .---->| Internet |<----. +# A WAN | |----------| | B WAN +# | | +# Office A side | | Office B side +# | ${awan}a ${bwan}a | +# v 2.0.0.22 3.0.0.33 v +# ${alan}b |----------| |----------| ${blan}b +# 1.0.0.1 | host agw | | host bgw | 4.0.0.1 +# .----------->| gateway | < IPsec > | gateway |<-----------. +# | A LAN |----------| tunnel |----------| B LAN | +# | | +# | | +# | ${alan}a ${blan}a | +# v 1.0.0.11 4.0.0.44 v +# |----------| |----------| +# | host a | | host b | +# | client | | client | +# |----------| |----------| +# +# +# There is routing between office A clients and office B ones. The traffic is +# encrypted, i.e. host wan should see IPsec flow (ESP packets). +# + +ipsec_init() +{ + if ! sysctl -q kern.features.ipsec >/dev/null ; then + atf_skip "This test requires ipsec" + fi +} + +if_enc_init() +{ + ipsec_init + if ! kldstat -q -m if_enc; then + atf_skip "This test requires if_enc" + fi +} + +ipfw_init() +{ + if ! kldstat -q -m ipfw; then + atf_skip "This test requires ipfw" + fi +} + +assert_ipfw_is_off() +{ + if kldstat -q -m ipfw; then + atf_skip "This test is for the case when ipfw is not loaded" + fi +} + +build_test_network() +{ + local ipfwon=$1 + + alan=$(vnet_mkepair) + awan=$(vnet_mkepair) + bwan=$(vnet_mkepair) + blan=$(vnet_mkepair) + + # host a + vnet_mkjail a ${alan}a + jexec a ifconfig ${alan}a 1.0.0.11/24 up + jexec a route add default 1.0.0.1 + test $ipfwon && jexec a ipfw add 65534 allow all from any to any + + # host agw + vnet_mkjail agw ${alan}b ${awan}a + jexec agw ifconfig ${alan}b 1.0.0.1/24 up + jexec agw ifconfig ${awan}a 2.0.0.22/24 up + jexec agw route add default 2.0.0.1 + jexec agw sysctl net.inet.ip.forwarding=1 + test $ipfwon && jexec agw ipfw add 65534 allow all from any to any + + # host wan + vnet_mkjail wan ${awan}b ${bwan}b + jexec wan ifconfig ${awan}b 2.0.0.1/24 up + jexec wan ifconfig ${bwan}b 3.0.0.1/24 up + jexec wan sysctl net.inet.ip.forwarding=1 + test $ipfwon && jexec wan ipfw add 65534 allow all from any to any + + # host bgw + vnet_mkjail bgw ${bwan}a ${blan}b + jexec bgw ifconfig ${bwan}a 3.0.0.33/24 up + jexec bgw ifconfig ${blan}b 4.0.0.1/24 up + jexec bgw route add default 3.0.0.1 + jexec bgw sysctl net.inet.ip.forwarding=1 + test $ipfwon && jexec bgw ipfw add 65534 allow all from any to any + + # host b + vnet_mkjail b ${blan}a + jexec b ifconfig ${blan}a 4.0.0.44/24 up + jexec b route add default 4.0.0.1 + test $ipfwon && jexec b ipfw add 65534 allow all from any to any + + # Office A VPN setup + echo ' + spdadd 1.0.0.0/24 4.0.0.0/24 any -P out ipsec esp/tunnel/2.0.0.22-3.0.0.33/require; + spdadd 4.0.0.0/24 1.0.0.0/24 any -P in ipsec esp/tunnel/3.0.0.33-2.0.0.22/require; + add 2.0.0.22 3.0.0.33 esp 0x203 -E aes-gcm-16 "123456789012345678901234567890123456"; + add 3.0.0.33 2.0.0.22 esp 0x302 -E aes-gcm-16 "123456789012345678901234567890123456"; + ' | jexec agw setkey -c + + # Office B VPN setup + echo ' + spdadd 4.0.0.0/24 1.0.0.0/24 any -P out ipsec esp/tunnel/3.0.0.33-2.0.0.22/require; + spdadd 1.0.0.0/24 4.0.0.0/24 any -P in ipsec esp/tunnel/2.0.0.22-3.0.0.33/require; + add 2.0.0.22 3.0.0.33 esp 0x203 -E aes-gcm-16 "123456789012345678901234567890123456"; + add 3.0.0.33 2.0.0.22 esp 0x302 -E aes-gcm-16 "123456789012345678901234567890123456"; + ' | jexec bgw setkey -c +} + +atf_test_case "ipfwoff_ip4_pfil_in_after_stripping" "cleanup" +ipfwoff_ip4_pfil_in_after_stripping_head() +{ + atf_set descr 'Test that pf pulls up mbuf if m_len==0 after stripping the outer header, with ipfw disabled' + atf_set require.user root + atf_set require.progs nc +} +ipfwoff_ip4_pfil_in_after_stripping_body() +{ + local ipfwon + + pft_init + if_enc_init + test "$1" == "ipfwon" && ipfwon="yes" + test $ipfwon && ipfw_init || assert_ipfw_is_off + + build_test_network $ipfwon + + # Sanity check + atf_check -s exit:0 -o ignore jexec a ping -c3 4.0.0.44 + + # Configure port forwarding on host bgw + jexec bgw ifconfig enc0 up + jexec bgw sysctl net.inet.ipsec.filtertunnel=0 + jexec bgw sysctl net.enc.in.ipsec_filter_mask=2 # after stripping + jexec bgw sysctl net.enc.out.ipsec_filter_mask=1 # before outer header + echo ' + rdr on enc0 proto tcp to 4.0.0.1 port 666 -> 4.0.0.44 + pass + ' | jexec bgw pfctl -ef- + + # Prepare the catcher on host b + echo "unexpected" > ./receiver + jexec b nc -n4l -N 666 > ./receiver & + nc_pid=$! + sleep 1 + + # Poke it from host a to host bgw + spell="Ak Ohum Oktay Weez Barsoom." + echo $spell | jexec a nc -w3 4.0.0.1 666 + + # Expect it to hit host b instead + sleep 1 # let the catcher finish + jexec b kill -KILL $nc_pid # in a fail case the catcher may listen forever + atf_check_equal "$spell" "$(cat ./receiver)" +} +ipfwoff_ip4_pfil_in_after_stripping_cleanup() +{ + pft_cleanup +} + +atf_test_case "ipfwon_ip4_pfil_in_after_stripping" "cleanup" +ipfwon_ip4_pfil_in_after_stripping_head() +{ + atf_set descr 'Test that pf pulls up mbuf if m_len==0 after stripping the outer header, with ipfw enabled' + atf_set require.user root + atf_set require.progs nc +} +ipfwon_ip4_pfil_in_after_stripping_body() +{ + ipfwoff_ip4_pfil_in_after_stripping_body "ipfwon" +} +ipfwon_ip4_pfil_in_after_stripping_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "ipfwoff_ip4_pfil_in_after_stripping" + atf_add_test_case "ipfwon_ip4_pfil_in_after_stripping" +} From nobody Tue Jul 2 15:44:03 2024 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 4WD6dw1pTKz5Mpvg; Tue, 02 Jul 2024 15:44:04 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WD6dw0jZhz467y; Tue, 2 Jul 2024 15:44:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719935044; 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=uL7FQ0+3neBxfvvH42RLULhnXOO3GkUdzEnWnfBfIh4=; b=jnZsiWS816ECMK8FMziKK27+D8C2oOmBMo0llPiEVz4P+pgeLyWUKVW42LR2UCCHyZNtji tj+pZ0cs3Jikpf/9m8CqeNQZRZXWHKAOOHU+uwBy9Oi6RhC7F0d1AkWr9P3NmSxxoKvvVk uFGlOar1O1pzhp3c3wUoms9r99vfKPBcPmRHG47duMGCwJaoCySLUkVVkbO/nlf2x9rsuD JqtA0E1ycnKQzXy5Z8Tp6CtT+bSd2TTi8WE/lw4GiqBr0c2Dlhz5uRZaPRfSVhu5Yvt/AJ 4GCNhqWIZNQGuQXZJMKlWUWbp0Iw3Mr9NAW3REzOBYuZ//TN0J0zOJ7ucGryIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719935044; a=rsa-sha256; cv=none; b=qFVlGhZsjjGXR1aKqkuF4txWlgAgIZcQLFeTYqp+gV4TvubRbdzNLbZ4eWc4/IzrIJQUhG R0Ljtfdw6aLQq2tuMYhnbNFC7PLjaQi6urLVe9h76fZ2vvLfjebUEWYc3gMSzemx3mZCbk V89vfDrUo4mOqRm948eE072+9c2OhqTDLElw3HDDCnNDdbFwwahtjWsYyHeMW/cxTj2+kB /XWXQUBPOpWQjiI61u3ku6G2qq2H/xMdVw+eZbKOrpU68obX1l82TNhWzTLBwHgoAWJn0s WTcscuoa3g0xL766YJuzptjdy46YmfjWb+Tg8L8JDwd0Ch3BK4tH47zoGuYONg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719935044; 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=uL7FQ0+3neBxfvvH42RLULhnXOO3GkUdzEnWnfBfIh4=; b=bxx/HIUNVV2S2KLZclLiNOkt+hOe2q9UdPVl2EiYEHqWxEF2za+m+/Ziel3q5BTXys3Txx kJh/9FlT+mbySGouzMQuNGVmm1ssrbM4fQ/hN2Av0LXvlgryLbV1nznXZk1L33vAUkrQbr G8jZ43wAuXjETMbc4BlM0I7GO4yDZzKof3maxp759IkE6jGC0X6PBhhD3V3ZHRadlXpoXd n6O0Dd6Bh7zyQoU1WoOR622Nc2wXJ2KkuEsZzTMdYNDjydVVc62/e7g3l5mLaN+0OsPxrg lC6ljxXWuMhCAYPQx+DnraV95ZrBUsZuHTT/A39aMG+koiZvRrQoGww4izk81w== Received: from [IPV6:2601:5c0:4200:b830:3517:62a3:b646:39a7] (unknown [IPv6:2601:5c0:4200:b830:3517:62a3:b646:39a7]) (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 did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WD6dv5VQwz17xh; Tue, 2 Jul 2024 15:44:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Tue, 2 Jul 2024 11:44:03 -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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 67d1a1cd9e77 - main - cdefs.h: Remove support for pre gcc 4.0 Content-Language: en-US To: Warner Losh Cc: Warner Losh , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202406210241.45L2fOkP057010@gitrepo.freebsd.org> <4ecc814d-5df1-4db8-b9e0-4919895c5e6a@FreeBSD.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 7/1/24 4:09 PM, Warner Losh wrote: > On Mon, Jul 1, 2024, 3:53 PM John Baldwin wrote: > >> On 6/20/24 7:41 PM, Warner Losh wrote: >>> The branch main has been updated by imp: >>> >>> URL: >> https://cgit.FreeBSD.org/src/commit/?id=67d1a1cd9e772e2ef94003579f4fbc271d38be7d >>> >>> commit 67d1a1cd9e772e2ef94003579f4fbc271d38be7d >>> Author: Warner Losh >>> AuthorDate: 2024-06-20 23:02:56 +0000 >>> Commit: Warner Losh >>> CommitDate: 2024-06-21 02:41:08 +0000 >>> >>> cdefs.h: Remove support for pre gcc 4.0 >>> >>> All supported compilers support the gcc 3 attribute extensions. >> Remove >>> the #else clauses for this. Also, latter-day pcc compilers also >> define >>> __GNUC__, so there's not need to also test for __PCC__. >>> >>> Reviewed by: brooks >>> Differential Revision: https://reviews.freebsd.org/D45654 >>> Sponsored by: Netflix >>> --- >>> sys/sys/cdefs.h | 42 ++++-------------------------------------- >>> 1 file changed, 4 insertions(+), 38 deletions(-) >>> >>> diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h >>> index 88019819eb35..a6ecdca5d8b9 100644 >>> --- a/sys/sys/cdefs.h >>> +++ b/sys/sys/cdefs.h >>> @@ -408,15 +389,10 @@ >>> * assign pointer x to a local variable, to check that its type is >>> * compatible with member m. >>> */ >>> -#if __GNUC_PREREQ__(3, 1) >>> #define __containerof(x, s, m) ({ >> \ >>> const volatile __typeof(((s *)0)->m) *__x = (x); \ >>> __DEQUALIFY(s *, (const volatile char *)__x - __offsetof(s, m));\ >>> }) >>> -#else >>> -#define __containerof(x, s, m) >> \ >>> - __DEQUALIFY(s *, (const volatile char *)(x) - __offsetof(s, m)) >>> -#endif >>> >>> /* >>> * Compiler-dependent macros to declare that functions take printf-like >>> @@ -434,14 +410,8 @@ >>> #define __strftimelike(fmtarg, firstvararg) \ >>> __attribute__((__format__ (__strftime__, fmtarg, firstvararg))) >>> >>> -/* Compiler-dependent macros that rely on FreeBSD-specific extensions. >> */ >>> -#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 && \ >>> - defined(__GNUC__) >>> #define __printf0like(fmtarg, firstvararg) \ >>> __attribute__((__format__ (__printf0__, fmtarg, firstvararg))) >>> -#else >>> -#define __printf0like(fmtarg, firstvararg) >>> -#endif >> >> Does this still work with external GCC? I didn't think printf0 was >> supported >> by external GCC (or maybe I had to readd it in the port and that's what I >> remember). Ah, yes, printf0 is a local patch in the devel/freebsd-gccX >> ports, but is not available in stock GCC (e.g. lang/gcc does not support >> it). >> > > Ah. That would explain why it just worked for me. That's what I tested > with. Clang also seemed happy with it. But that was the in tree clang. Is > there a similar issue? Gnuc is defined for both. So we don't support building the base system with lang/gcc, only devel/freebsd-gccX (which has a local patch to add printf0 support). The only question might be, do we support using __printf0like for things that aren't in the base system that could be built with lang/gcc. If so, we might need to guard this somehow. I'm not sure though that we care about random software not in base using a FreeBSD-specific keyword from . -- John Baldwin From nobody Tue Jul 2 16:30:03 2024 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 4WD7gF3dptz5Ngyh for ; Tue, 02 Jul 2024 16:30:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WD7gD6KJNz4D5T for ; Tue, 2 Jul 2024 16:30:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2c967e21888so419876a91.1 for ; Tue, 02 Jul 2024 09:30:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1719937815; x=1720542615; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=v3dB22oSaRx4YTp6pS6wENk7E//T+T7NNvOn6tc/RS8=; b=gXW4OmAew/GdA5PyDxfFIYvKy3dI1+eDTew2tjWsWC2r59v3NFrpLntPRyr9QbB+AO U1ohTtnPK0dWpC3ckHN6CoevlkkxiM2w4gNk2tbC/gA8JIYsaI1F3KoLeDo/bXpf4Bga vXI2zOzLPtoI+zoex4VVFyEUodXxnoq1o0YMBMuRicivGZPHFTbbK/Mj7/FkaQ0lB0DM CMMd6bprwerBV4D1ssxz5huZ2jUGXtVxbAv0pFG4Og/5xq8IaG8Q2fZh9Jdt46PLxQtM BwuCoGRpEAL4FnbrIjctyK/BMpCSjyBOvMZNl/jzVH22L8/zt5AqPrrui2dBLORDgFxC LnYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719937815; x=1720542615; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=v3dB22oSaRx4YTp6pS6wENk7E//T+T7NNvOn6tc/RS8=; b=LDyJ5dxIew0BwOe9CtOwxm604Bc56ssC6fhdwBuRIrKRu/M0ZGkrKYGrSrcfuLve1O 6GMHQBViLCRISb9iQfGRf3/WsFdHFHE2UQJetaf5DXvS1A1z6SUnniHSc1gd+ZKFRtQP D7E58+7DembFH2R4G6zdrOdMYUpiii+m4NYJ5CXjJhPr6/C6H/N2cLaH3oDraTY4L+Qm DYavSctrOl1uSTsZh2pnzZ93qPdV0MevEuAH0p/3Z40Wu2TgFbImJJPaBBigeom5ZNir F0zXkW44zJj3GZwTfAz4uvfzrD7xo31nYliFRoOTOQDRpw5Z4li90vP31hhgkGj5GraV Uq4Q== X-Forwarded-Encrypted: i=1; AJvYcCVISqa/rXae5RobOSiO7M7abwvemK8DBoOTi+rOwM48/E+SkWTC4pg9VADn6bJYB9pNprqyoJQ2WJXqjmY4zXhKa/4+KuIlRZBH9dhmC20HTg== X-Gm-Message-State: AOJu0YxZeuOhNTvwnIFlXOU1nfLtgdWDL7Ki8xI4bF/xsk8BeoLUWfBg 9R7mb74KRfxtkFCHgMhYttO7YW32+JyMO4ZFkXKsVw7jeg3biM83DDdsW8GPPiArulgcEtpaLb4 Y+Oav/Sxy7+BrAgLAyruta0CLB/m1q5+GSuD+E8Si/4IigBJOq8U= X-Google-Smtp-Source: AGHT+IGoU/zEg6KnsT+fzeU+tP5ha6HNp+u5J96hqizKO5/FSqnQrQNlEeUZ1ZHTd8gbyW549xh9hep1ZaJoDswlh6M= X-Received: by 2002:a17:90a:883:b0:2c9:2d00:44e with SMTP id 98e67ed59e1d1-2c93d710b9cmr7575037a91.14.1719937814852; Tue, 02 Jul 2024 09:30:14 -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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202406210241.45L2fOkP057010@gitrepo.freebsd.org> <4ecc814d-5df1-4db8-b9e0-4919895c5e6a@FreeBSD.org> In-Reply-To: From: Warner Losh Date: Tue, 2 Jul 2024 10:30:03 -0600 Message-ID: Subject: Re: git: 67d1a1cd9e77 - main - cdefs.h: Remove support for pre gcc 4.0 To: John Baldwin Cc: Warner Losh , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000007d9a9f061c463ae8" X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4WD7gD6KJNz4D5T --0000000000007d9a9f061c463ae8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hey John, On Tue, Jul 2, 2024 at 9:44=E2=80=AFAM John Baldwin wrote= : > On 7/1/24 4:09 PM, Warner Losh wrote: > > On Mon, Jul 1, 2024, 3:53=E2=80=AFPM John Baldwin wro= te: > > > >> On 6/20/24 7:41 PM, Warner Losh wrote: > >>> The branch main has been updated by imp: > >>> > >>> URL: > >> > https://cgit.FreeBSD.org/src/commit/?id=3D67d1a1cd9e772e2ef94003579f4fbc2= 71d38be7d > >>> > >>> commit 67d1a1cd9e772e2ef94003579f4fbc271d38be7d > >>> Author: Warner Losh > >>> AuthorDate: 2024-06-20 23:02:56 +0000 > >>> Commit: Warner Losh > >>> CommitDate: 2024-06-21 02:41:08 +0000 > >>> > >>> cdefs.h: Remove support for pre gcc 4.0 > >>> > >>> All supported compilers support the gcc 3 attribute extensions. > >> Remove > >>> the #else clauses for this. Also, latter-day pcc compilers also > >> define > >>> __GNUC__, so there's not need to also test for __PCC__. > >>> > >>> Reviewed by: brooks > >>> Differential Revision: https://reviews.freebsd.org/D45654 > >>> Sponsored by: Netflix > >>> --- > >>> sys/sys/cdefs.h | 42 ++++-------------------------------------- > >>> 1 file changed, 4 insertions(+), 38 deletions(-) > >>> > >>> diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h > >>> index 88019819eb35..a6ecdca5d8b9 100644 > >>> --- a/sys/sys/cdefs.h > >>> +++ b/sys/sys/cdefs.h > >>> @@ -408,15 +389,10 @@ > >>> * assign pointer x to a local variable, to check that its type is > >>> * compatible with member m. > >>> */ > >>> -#if __GNUC_PREREQ__(3, 1) > >>> #define __containerof(x, s, m) ({ > >> \ > >>> const volatile __typeof(((s *)0)->m) *__x =3D (x); > \ > >>> __DEQUALIFY(s *, (const volatile char *)__x - __offsetof(s, > m));\ > >>> }) > >>> -#else > >>> -#define __containerof(x, s, m) > >> \ > >>> - __DEQUALIFY(s *, (const volatile char *)(x) - __offsetof(s, m)) > >>> -#endif > >>> > >>> /* > >>> * Compiler-dependent macros to declare that functions take > printf-like > >>> @@ -434,14 +410,8 @@ > >>> #define __strftimelike(fmtarg, firstvararg) \ > >>> __attribute__((__format__ (__strftime__, fmtarg, > firstvararg))) > >>> > >>> -/* Compiler-dependent macros that rely on FreeBSD-specific extension= s. > >> */ > >>> -#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >=3D 30000= 1 > && \ > >>> - defined(__GNUC__) > >>> #define __printf0like(fmtarg, firstvararg) \ > >>> __attribute__((__format__ (__printf0__, fmtarg, > firstvararg))) > >>> -#else > >>> -#define __printf0like(fmtarg, firstvararg) > >>> -#endif > >> > >> Does this still work with external GCC? I didn't think printf0 was > >> supported > >> by external GCC (or maybe I had to readd it in the port and that's wha= t > I > >> remember). Ah, yes, printf0 is a local patch in the devel/freebsd-gcc= X > >> ports, but is not available in stock GCC (e.g. lang/gcc does not suppo= rt > >> it). > >> > > > > Ah. That would explain why it just worked for me. That's what I tested > > with. Clang also seemed happy with it. But that was the in tree clang. = Is > > there a similar issue? Gnuc is defined for both. > > So we don't support building the base system with lang/gcc, only > devel/freebsd-gccX (which has a local patch to add printf0 support). > The only question might be, do we support using __printf0like for things > that aren't in the base system that could be built with lang/gcc. If so, > we might need to guard this somehow. I'm not sure though that we care > about random software not in base using a FreeBSD-specific keyword from > . > Yes. The question is "do we use __printf0like in our headers" since we definitely can't build FreeBSD itself w/o at least some of the extensions for other things... and the answer is "yes". err.h uses it, for example, as does setproctitle in stdlib.h The interesting thing for me is that gcc13 will produce no warnings if I include errr.h because -Wsystem-header is off. With it on, warnings crop up too. This is why my testing didn't see it... It looks like clang has it as a builtin for all versions we care about, so I'll create a phab to add some of this back. Maybe we should upstream what we have, for this and freebsd_printf since that's also in clang and one of the small number of patches we have for the lang/gcc* family? Warner --0000000000007d9a9f061c463ae8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hey John,

On Tue, Jul 2, 2024 at 9:44= =E2=80=AFAM John Baldwin <jhb@freebsd= .org> wrote:
On 7/1/24 4:09 PM, Warner Losh wrote:
> On Mon, Jul 1, 2024, 3:53=E2=80=AFPM John Baldwin <jhb@freebsd.org> wrote:
>
>> On 6/20/24 7:41 PM, Warner Losh wrote:
>>> The branch main has been updated by imp:
>>>
>>> URL:
>> https://c= git.FreeBSD.org/src/commit/?id=3D67d1a1cd9e772e2ef94003579f4fbc271d38be7d
>>>
>>> commit 67d1a1cd9e772e2ef94003579f4fbc271d38be7d
>>> Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>=
>>> AuthorDate: 2024-06-20 23:02:56 +0000
>>> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>=
>>> CommitDate: 2024-06-21 02:41:08 +0000
>>>
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0cdefs.h: Remove support for pre gcc = 4.0
>>>
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0All supported compilers support the = gcc 3 attribute extensions.
>> Remove
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0the #else clauses for this. Also, la= tter-day pcc compilers also
>> define
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0__GNUC__, so there's not need to= also test for __PCC__.
>>>
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0Reviewed by:=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 brooks
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0Differential Revision:=C2=A0
https://reviews.freebsd.org/D45654
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0Sponsored by:=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0Netflix
>>> ---
>>>=C2=A0 =C2=A0 sys/sys/cdefs.h | 42 ++++------------------------= --------------
>>>=C2=A0 =C2=A0 1 file changed, 4 insertions(+), 38 deletions(-)<= br> >>>
>>> diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
>>> index 88019819eb35..a6ecdca5d8b9 100644
>>> --- a/sys/sys/cdefs.h
>>> +++ b/sys/sys/cdefs.h
>>> @@ -408,15 +389,10 @@
>>>=C2=A0 =C2=A0 =C2=A0* assign pointer x to a local variable, to = check that its type is
>>>=C2=A0 =C2=A0 =C2=A0* compatible with member m.
>>>=C2=A0 =C2=A0 =C2=A0*/
>>> -#if __GNUC_PREREQ__(3, 1)
>>>=C2=A0 =C2=A0 #define=C2=A0 =C2=A0 =C2=A0__containerof(x, s, m)= ({
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0\
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 const volatile __typeof(((s *)0)-&g= t;m) *__x =3D (x);=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \=
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 __DEQUALIFY(s *, (const volatile ch= ar *)__x - __offsetof(s, m));\
>>>=C2=A0 =C2=A0 })
>>> -#else
>>> -#define=C2=A0 =C2=A0 =C2=A0 __containerof(x, s, m)
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 \
>>> -=C2=A0 =C2=A0 =C2=A0__DEQUALIFY(s *, (const volatile char *)(= x) - __offsetof(s, m))
>>> -#endif
>>>
>>>=C2=A0 =C2=A0 /*
>>>=C2=A0 =C2=A0 =C2=A0* Compiler-dependent macros to declare that= functions take printf-like
>>> @@ -434,14 +410,8 @@
>>>=C2=A0 =C2=A0 #define=C2=A0 =C2=A0 =C2=A0__strftimelike(fmtarg,= firstvararg) \
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 __attribute__((__form= at__ (__strftime__, fmtarg, firstvararg)))
>>>
>>> -/* Compiler-dependent macros that rely on FreeBSD-specific ex= tensions.
>> */
>>> -#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_ver= sion >=3D 300001 && \
>>> -=C2=A0 =C2=A0 defined(__GNUC__)
>>>=C2=A0 =C2=A0 #define=C2=A0 =C2=A0 =C2=A0__printf0like(fmtarg, = firstvararg) \
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 __attribute__((__form= at__ (__printf0__, fmtarg, firstvararg)))
>>> -#else
>>> -#define=C2=A0 =C2=A0 =C2=A0 __printf0like(fmtarg, firstvararg= )
>>> -#endif
>>
>> Does this still work with external GCC?=C2=A0 I didn't think p= rintf0 was
>> supported
>> by external GCC (or maybe I had to readd it in the port and that&#= 39;s what I
>> remember).=C2=A0 Ah, yes, printf0 is a local patch in the devel/fr= eebsd-gccX
>> ports, but is not available in stock GCC (e.g. lang/gcc does not s= upport
>> it).
>>
>
> Ah. That would explain why it just worked for me. That's what I te= sted
> with. Clang also seemed happy with it. But that was the in tree clang.= Is
> there a similar issue? Gnuc is defined for both.

So we don't support building the base system with lang/gcc, only
devel/freebsd-gccX (which has a local patch to add printf0 support).
The only question might be, do we support using __printf0like for things that aren't in the base system that could be built with lang/gcc.=C2=A0= If so,
we might need to guard this somehow.=C2=A0 I'm not sure though that we = care
about random software not in base using a FreeBSD-specific keyword from
<sys/cdefs.h>.

Yes. The question = is "do we use __printf0like=C2=A0 in our headers" since we defini= tely
can't build FreeBSD itself w/o at least some of the exte= nsions for other things...
and the answer is "yes". err= .h uses it, for example, as does setproctitle in stdlib.h

The interesting thing for me is that gcc13 will produce no warnings= if I include errr.h=C2=A0
because -Wsystem-header=C2=A0is off. W= ith it on, warnings crop up too. This is why my testing
didn'= t see it...

It looks like clang has it as a builti= n for all versions we care about, so I'll create a phab to add some
of this back. Maybe we should upstream what we have, for this and fr= eebsd_printf since that's also
in clang and one of the small = number of patches we have for the lang/gcc* family?

Warner
--0000000000007d9a9f061c463ae8-- From nobody Tue Jul 2 17:29:01 2024 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 4WD8z14WFGz5NqsS; Tue, 02 Jul 2024 17:29:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WD8z141qgz4PGr; Tue, 2 Jul 2024 17:29:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719941341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ecUZ3exaVlGTPzNKiHIqCSEuZjw6z3ahexNcp/IOtFs=; b=xKQRN2THgEAC7n9OhNnJKmlcLMvK5DlOlsH8LblVccckMUrt7PiMRyvjZkkhJITnuMyOsg U4VRnnL5PYLJhS1AzTjgBTdfN71lEa4BeqGyNWmMy07Za8j7CGiuM6ZfEyik5gJfsQkx5D h/lSBZU3a8Zgoqg7uA+YlLMtphfNt8oSRkqVFGPeqc8Nav78AfjEm4Zko2+Zm4tbu/4kAn ATZC5G5V4ZH3HwBRRvjPRRcE8HL9fYOoeLfI08O3tYtpmDo+Fn0j2b8zCI5AR63wYbUqsG f0/vjV8NsAmDBQA1mwf/hAdu1ghSZNrVrox2W1JpB+sNtrmWNtAS0Q0tZRoOaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719941341; a=rsa-sha256; cv=none; b=GYxdUWbObzEbYW2gpV/SIqDx8FYpz3XppqVkBpCzW1ZbP//INzfhJW8PS7aCEw5MMyr3JR VsL753ASK7vqy26yCV3dt15RkfaaRABwMHZwpazvam0Ql+4WES67g8HDmSmY809AvWSaON UfQjqQWb5IxbPwN3p3Lt8GCjwg46pTyu0tS9MRagda6/hFuU7z/HPFmXwGA0KijIIBaXqb 1G+QNMQtaYs1BkSnt1fXgZsUCVqPYFZyeDUeMAKhHUfrLyp++eqNUpVeCqdFV031cZ6roB 83mW886jNZIUyTGJ/ODGQpWMwzbYmuit9kxTfRIVmy3by1C/HgWJsrTJibw27Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719941341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ecUZ3exaVlGTPzNKiHIqCSEuZjw6z3ahexNcp/IOtFs=; b=ZYpAbbduN44jJZyfyaTNXy2tlDai3w04dO2yOREZOnXxCHTTM71+asKiIDO8sn8mqU3ZWn EGHPx0xp7Q0hP2H2Mhjh4jhmfuEaw9ok28UTDkjTr02NnqqxbjzIeyL5jQuSJTy1LQqnp3 rEMOXqRDUsAwYaOTHFdMiTcsB5ovHwWpRjvMJnYT5Y7zOfCKa7sjHHrUEJDoRPcEd0u6S/ G0wOxP8qDId3sgYhbTl0ZVV7uGrNhKBQwL5r88luGu+z7EN2dsmm3lI/+rHgxf5UBsd/1f YeALhXgjpz+NaMtdPRdgtKuVoBKN8FmBDN06vgNpYr0Z0kgumkxp0jY8WPmN1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WD8z13dKQzxC5; Tue, 2 Jul 2024 17:29:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 462HT153029178; Tue, 2 Jul 2024 17:29:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 462HT1VD029175; Tue, 2 Jul 2024 17:29:01 GMT (envelope-from git) Date: Tue, 2 Jul 2024 17:29:01 GMT Message-Id: <202407021729.462HT1VD029175@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: 172328c477b1 - main - timerfd.2: Add documentation for CLOCK_UPTIME and CLOCK_BOOTTIME 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 172328c477b13458c5faa4cf81ad8669f6852aee Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=172328c477b13458c5faa4cf81ad8669f6852aee commit 172328c477b13458c5faa4cf81ad8669f6852aee Author: Cormac Stephenson AuthorDate: 2024-06-28 16:45:44 +0000 Commit: Warner Losh CommitDate: 2024-07-02 16:40:04 +0000 timerfd.2: Add documentation for CLOCK_UPTIME and CLOCK_BOOTTIME Add CLOCK_UPTIME and CLOCK_BOOTTIME options and a quick pointer to clock_gettime(2) for a better definition of these values. Reviewed-by: imp (small tweaks and added Xr) Pull-Request: https://github.com/freebsd/freebsd-src/pull/1302 --- lib/libsys/timerfd.2 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/libsys/timerfd.2 b/lib/libsys/timerfd.2 index 7a112ad0dfcb..ae6cc6f6f49a 100644 --- a/lib/libsys/timerfd.2 +++ b/lib/libsys/timerfd.2 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 21, 2023 +.Dd June 28, 2024 .Dt TIMERFD 2 .Os .Sh NAME @@ -95,9 +95,16 @@ argument specifies the clock used as a timing base and may be: .Bl -tag -width "Dv CLOCK_MONOTONIC" -compact .It Dv CLOCK_REALTIME Increments as a wall clock should. +.It Dv CLOCK_BOOTTIME .It Dv CLOCK_MONOTONIC Increments monotonically in SI seconds. +.It Dv CLOCK_UPTIME +Increments monotonically in SI seconds, but is paused while the system is +suspended. .El +See +.Xr clock_gettime 2 +for more precise definitions. .Pp The .Fa flags From nobody Tue Jul 2 17:29:02 2024 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 4WD8z25SnFz5Nqnb; Tue, 02 Jul 2024 17:29:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WD8z24yCjz4PX7; Tue, 2 Jul 2024 17:29:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719941342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=unNK9YirE7awLWpTW8pPwEapjOtdJMryeRj2oXg9XTg=; b=k1vQPZ2y6an26SqMpNCAynn4pZjCf6C/MSeEnHEW0yVw3bGxCoJQVW5okU1ZUKrPXYiaJY SimAgaUIvtsYydXFnnhyO0M1EEKFUJ4yFJnjDqna8dWi4tQtMn8wVUOWXCQg26UTZ1d9sc Ztq/RJIAQJtznrM2VpugBWwbqXf0MNxmCy/+V6+1yMxQlGuATos1H95gL7IqhbqQhxaulG Voh9A2gKTC1xQ8lhkvP9Ux414xHAoUnyUSBf0MD7AYwX8Urp6spMncF9uZ0F7/1kwO6qlj upOafMa9J+l9JnUy9Jj0hMvf2toz7XU/spY7v3h5uxu66iOmWSCadU1Q83UW6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719941342; a=rsa-sha256; cv=none; b=Cp98mTwKzqqJpyHRNYGf9CkvkvOpESGL95D1loqj4iuGgqq1XiaDKbJx1Y0c54vEeEpv7Y MQrCMqW8ulSyHqF4rXuKxXqkD8QAsmGec4xv9JW58CKcjAEaYyRgnM8wavEH2wfAXUitOx 3fqKGBd55U8MW7cXynkO5vy+Tt1XTXThw+R16AlB7EHrQPrpLqUYFQeL3gDv1ipz4KZDzS EOkwc/1xFotViLAbi8qIcFf2JYW1U8B7SdIdQ6fgUruEC0uc3VsUHWQN76aIxCq205AMH3 pjWhi6Vyn/z+OrXnC1T6GFZyV9noqpwuk/XohLiIV2MJJ8HTjrUssDVTMHo/fg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719941342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=unNK9YirE7awLWpTW8pPwEapjOtdJMryeRj2oXg9XTg=; b=yGuK6iZwz7b+J4NbY0hgIKzEwq+M7xyJD7nIdLScGuW031a9Dr/pAbzn3JUxLiUmXJl1Li SO5+ETvTcTIhgPZPO7Sv0RRKZW0VAqvvZcKsPJlsCtQ5lt9ta9TZLfFnL3OF2LDcKCvOlV MTSnl8hgo6W1QN8IV87Pgk3Z5QPF2AZAsbcC3sf7Q9D8yi27HSNlJXoQEEkUvIRO3lnn7a fOENo2x0MPWNthFQ4PiWaiB2Vvc8CCbw1nz2o9CKn8on7QiN4sYKrNVyJRngNzK9XBj9k6 LoYqeg6LDedbPszIDv4iBeNBxKJr/yMF5mIN3KbxuI0DwhwFirqdCohVlzV9kg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WD8z24ZDDzwtV; Tue, 2 Jul 2024 17:29:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 462HT258029226; Tue, 2 Jul 2024 17:29:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 462HT2Q4029223; Tue, 2 Jul 2024 17:29:02 GMT (envelope-from git) Date: Tue, 2 Jul 2024 17:29:02 GMT Message-Id: <202407021729.462HT2Q4029223@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: de1e91339b17 - main - clock_gettime: Catch up with the CLOCK_BOOTTIME 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: de1e91339b17171e020029e1d49f361aa66c5146 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=de1e91339b17171e020029e1d49f361aa66c5146 commit de1e91339b17171e020029e1d49f361aa66c5146 Author: Warner Losh AuthorDate: 2024-06-28 16:55:23 +0000 Commit: Warner Losh CommitDate: 2024-07-02 17:27:35 +0000 clock_gettime: Catch up with the CLOCK_BOOTTIME changes When CLOCK_BOOTTIME was made an alias for CLOCK_MONOTONIC, the man page wasn't updated. Update to include the changed semantics (it was to be better compatible with Linux). Clarify the details of these clocks. Provide a reference to the UTC standard, and a clarifying remark about leap second encoding (fun fact: POSIX provides no unique value for these, nor definitive values to use). Sponsored by: Netflix --- lib/libsys/clock_gettime.2 | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/lib/libsys/clock_gettime.2 b/lib/libsys/clock_gettime.2 index 82f6615e8b93..fcdc5be498f2 100644 --- a/lib/libsys/clock_gettime.2 +++ b/lib/libsys/clock_gettime.2 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 27, 2023 +.Dd June 28, 2024 .Dt CLOCK_GETTIME 2 .Os .Sh NAME @@ -67,18 +67,26 @@ as well as the following values: .It Dv CLOCK_REALTIME_PRECISE .It Dv CLOCK_REALTIME_FAST .It Dv CLOCK_REALTIME_COARSE -Increments as a wall clock should. +Increments in SI seconds like a wall clock. +It uses a 1970 epoch and implements the UTC timescale. +The count of physical SI seconds since 1970, adjusted by subtracting the number +of positive leap seconds and adding the number of negative leap seconds. +Behavior during a leap second is not defined by and POSIX standard. .It Dv CLOCK_MONOTONIC .It Dv CLOCK_MONOTONIC_PRECISE .It Dv CLOCK_MONOTONIC_FAST .It Dv CLOCK_MONOTONIC_COARSE -Increments in SI seconds. +.It Dv CLOCK_BOOTTIME +Increments in SI seconds, even while the system is suspended. +Its epoch is unspecified. +The count is not adjusted by leap seconds. +.Fx implements .It Dv CLOCK_UPTIME .It Dv CLOCK_UPTIME_PRECISE .It Dv CLOCK_UPTIME_FAST -.It Dv CLOCK_BOOTTIME -Starts at zero when the kernel boots and increments -monotonically in SI seconds while the machine is running. +Increments monotonically in SI seconds while the machine is running. +The count is not adjusted by leap seconds. +The epoch is unspecified. .It Dv CLOCK_VIRTUAL Increments only when the CPU is running in user mode on behalf of the calling process. @@ -94,6 +102,7 @@ Returns the execution time of the calling thread. .El .Pp The clock IDs +.Dv CLOCK_BOOTTIME , .Dv CLOCK_REALTIME , .Dv CLOCK_MONOTONIC , and @@ -122,7 +131,7 @@ systems. Finally, .Dv CLOCK_BOOTTIME is an alias for -.Dv CLOCK_UPTIME +.Dv CLOCK_MONOTONIC for compatibility with other systems and is unrelated to the .Fa kern.boottime .Xr sysctl 8 . @@ -186,19 +195,28 @@ The and .Fn clock_getres system calls conform to -.St -p1003.1b-93 . +.St -p1003.1-2008 . The clock IDs -.Dv CLOCK_REALTIME_FAST , -.Dv CLOCK_REALTIME_PRECISE , +.Dv CLOCK_BOOTTIME , .Dv CLOCK_MONOTONIC_FAST , .Dv CLOCK_MONOTONIC_PRECISE , +.Dv CLOCK_REALTIME_FAST , +.Dv CLOCK_REALTIME_PRECISE , +.Dv CLOCK_SECOND .Dv CLOCK_UPTIME , .Dv CLOCK_UPTIME_FAST , -.Dv CLOCK_UPTIME_PRECISE , -.Dv CLOCK_SECOND +and +.Dv CLOCK_UPTIME_PRECISE are .Fx extensions to the POSIX interface. +.Pp +UTC is defined by ITU-R TF.460-6, Standard-frequency and time-signal emissions. +However, the +.Vt time_t +type is a simple count that does not provide a unique encoding for leap seconds, +nor a specification for what values should be used to encode a leap second. +.Pp .Sh HISTORY The .Fn clock_gettime , From nobody Tue Jul 2 17:58:16 2024 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 4WD9d14sFvz5Nvhy for ; Tue, 02 Jul 2024 17:58:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WD9d10Bw2z4SXK for ; Tue, 2 Jul 2024 17:58:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20230601.gappssmtp.com header.s=20230601 header.b=gYqubMqi; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::435) smtp.mailfrom=wlosh@bsdimp.com Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-706738c209bso2729741b3a.3 for ; Tue, 02 Jul 2024 10:58:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1719943107; x=1720547907; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=kg8+wh+GyM079h6A9LD6SNRYl5PVcgITK3wsoj4NS3U=; b=gYqubMqivcuoZrrVhW1elshoTW0jM41BAc7HFGiBUQ+jmqphKzcnnfTiozZekIclJ+ Ig1V71DMvOQF1zJjsepZjWkRZa3V2flrr+QUHBvGSXMUQ0qaE9nz5NAYc1ANC1/1IQiv 12YPfVLPrSrEXKFeGUYHU5S6NkPxcTmhLBc4oq+KvqLKhc1ggcNCKsQI8wJ18HLl1/HI m9yosxEuoG13vf5m0CRac75EjNPp6rMwnAkNBtMmBxhgnoK6RYsXKwQ3xxBRILXL2Ej9 FmxKdUTViTU/0yf3yR53136HzyyI+7+6AEJgtL3gRAYJs9wdgaXXTL13ei8dw96pT6pP hUig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719943107; x=1720547907; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kg8+wh+GyM079h6A9LD6SNRYl5PVcgITK3wsoj4NS3U=; b=k4kQ6mGja9BybBJC393mXbpK4+j/KZj+Fwvm/eGSNMeKKhQaPvtY28i0x0s0Fz1Ocp pFgSTsQUyAEEqCi9AEW0Sh2O0VLMgv1xBImUte1yBWMEsegPi3a4CjX8TZ4/jmLEacME g0Cis2oTM3hW8kjN1Z61QSvYTEwR4HBubQKH0U+3U0v4X3hMfgZd68HTDVdgqaQ3fYOo p5AAHLCgvUIdkWdYmiw7l9cqU66KdUAg/OaHR1BYqHsloY2t7ukgx3eJnkd5wV8+i4Hb UIa66UspKQgK3eELQQFt+vE7kAqECVz0Zuqd5nwp0THBHoVGzWWm7M4foWo2L5BNn4NK zAqA== X-Forwarded-Encrypted: i=1; AJvYcCXc73EIa1HuEjCRjEHrpZPS7/XFJTkSj7TbiKiUeKHm88KRsRl9/vllqVDupiM9aQkSVfTFL4ZIVlykDaIUIGELiO9gc517qDI/IXPlUw2FHA== X-Gm-Message-State: AOJu0Yx7s4sz6PDMgEIC59JhPQjdmY5sHzTMTX8UTAudZ/m4scYoCFQs pdI9uy6sbZB7T+295pARAj5rnTqaJyeXqnhb2sCueL0HaUlZ7LYHAHvyRPqhuXpieaAookTiT0f TALXay38ysPvM6fE1fK1vJuNHoi/zV1MzQ0fvHXiqIhYIpmpWJDgyBQ== X-Google-Smtp-Source: AGHT+IEgjbtLqnmEHP6ytABTJYal8Rubu+jruhJIRssyR4M0YDVpfK37pQiVeMMppRizhOstvmm3JtGVA/O9VNcj7aU= X-Received: by 2002:a05:6a20:2d11:b0:1be:d032:efff with SMTP id adf61e73a8af0-1bef62283cbmr9574139637.57.1719943107191; Tue, 02 Jul 2024 10:58:27 -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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202406210241.45L2fOkP057010@gitrepo.freebsd.org> <4ecc814d-5df1-4db8-b9e0-4919895c5e6a@FreeBSD.org> In-Reply-To: From: Warner Losh Date: Tue, 2 Jul 2024 11:58:16 -0600 Message-ID: Subject: Re: git: 67d1a1cd9e77 - main - cdefs.h: Remove support for pre gcc 4.0 To: John Baldwin Cc: Warner Losh , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000f04164061c477510" X-Spamd-Bar: -- X-Spamd-Result: default: False [-3.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20230601.gappssmtp.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MISSING_XM_UA(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::435:from]; DMARC_NA(0.00)[bsdimp.com]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; R_SPF_NA(0.00)[no SPF record]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20230601.gappssmtp.com:+] X-Rspamd-Queue-Id: 4WD9d10Bw2z4SXK --000000000000f04164061c477510 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jul 2, 2024 at 10:30=E2=80=AFAM Warner Losh wrote: > Hey John, > > On Tue, Jul 2, 2024 at 9:44=E2=80=AFAM John Baldwin wro= te: > >> On 7/1/24 4:09 PM, Warner Losh wrote: >> > On Mon, Jul 1, 2024, 3:53=E2=80=AFPM John Baldwin wr= ote: >> > >> >> On 6/20/24 7:41 PM, Warner Losh wrote: >> >>> The branch main has been updated by imp: >> >>> >> >>> URL: >> >> >> https://cgit.FreeBSD.org/src/commit/?id=3D67d1a1cd9e772e2ef94003579f4fbc= 271d38be7d >> >>> >> >>> commit 67d1a1cd9e772e2ef94003579f4fbc271d38be7d >> >>> Author: Warner Losh >> >>> AuthorDate: 2024-06-20 23:02:56 +0000 >> >>> Commit: Warner Losh >> >>> CommitDate: 2024-06-21 02:41:08 +0000 >> >>> >> >>> cdefs.h: Remove support for pre gcc 4.0 >> >>> >> >>> All supported compilers support the gcc 3 attribute extensions= . >> >> Remove >> >>> the #else clauses for this. Also, latter-day pcc compilers als= o >> >> define >> >>> __GNUC__, so there's not need to also test for __PCC__. >> >>> >> >>> Reviewed by: brooks >> >>> Differential Revision: https://reviews.freebsd.org/D45654 >> >>> Sponsored by: Netflix >> >>> --- >> >>> sys/sys/cdefs.h | 42 ++++-------------------------------------- >> >>> 1 file changed, 4 insertions(+), 38 deletions(-) >> >>> >> >>> diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h >> >>> index 88019819eb35..a6ecdca5d8b9 100644 >> >>> --- a/sys/sys/cdefs.h >> >>> +++ b/sys/sys/cdefs.h >> >>> @@ -408,15 +389,10 @@ >> >>> * assign pointer x to a local variable, to check that its type i= s >> >>> * compatible with member m. >> >>> */ >> >>> -#if __GNUC_PREREQ__(3, 1) >> >>> #define __containerof(x, s, m) ({ >> >> \ >> >>> const volatile __typeof(((s *)0)->m) *__x =3D (x); >> \ >> >>> __DEQUALIFY(s *, (const volatile char *)__x - __offsetof(s, >> m));\ >> >>> }) >> >>> -#else >> >>> -#define __containerof(x, s, m) >> >> \ >> >>> - __DEQUALIFY(s *, (const volatile char *)(x) - __offsetof(s, m)= ) >> >>> -#endif >> >>> >> >>> /* >> >>> * Compiler-dependent macros to declare that functions take >> printf-like >> >>> @@ -434,14 +410,8 @@ >> >>> #define __strftimelike(fmtarg, firstvararg) \ >> >>> __attribute__((__format__ (__strftime__, fmtarg, >> firstvararg))) >> >>> >> >>> -/* Compiler-dependent macros that rely on FreeBSD-specific >> extensions. >> >> */ >> >>> -#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >=3D 3000= 01 >> && \ >> >>> - defined(__GNUC__) >> >>> #define __printf0like(fmtarg, firstvararg) \ >> >>> __attribute__((__format__ (__printf0__, fmtarg, >> firstvararg))) >> >>> -#else >> >>> -#define __printf0like(fmtarg, firstvararg) >> >>> -#endif >> >> >> >> Does this still work with external GCC? I didn't think printf0 was >> >> supported >> >> by external GCC (or maybe I had to readd it in the port and that's >> what I >> >> remember). Ah, yes, printf0 is a local patch in the devel/freebsd-gc= cX >> >> ports, but is not available in stock GCC (e.g. lang/gcc does not >> support >> >> it). >> >> >> > >> > Ah. That would explain why it just worked for me. That's what I tested >> > with. Clang also seemed happy with it. But that was the in tree clang. >> Is >> > there a similar issue? Gnuc is defined for both. >> >> So we don't support building the base system with lang/gcc, only >> devel/freebsd-gccX (which has a local patch to add printf0 support). >> The only question might be, do we support using __printf0like for things >> that aren't in the base system that could be built with lang/gcc. If so= , >> we might need to guard this somehow. I'm not sure though that we care >> about random software not in base using a FreeBSD-specific keyword from >> . >> > > Yes. The question is "do we use __printf0like in our headers" since we > definitely > can't build FreeBSD itself w/o at least some of the extensions for other > things... > and the answer is "yes". err.h uses it, for example, as does setproctitle > in stdlib.h > > The interesting thing for me is that gcc13 will produce no warnings if I > include errr.h > because -Wsystem-header is off. With it on, warnings crop up too. This is > why my testing > didn't see it... > > It looks like clang has it as a builtin for all versions we care about, s= o > I'll create a phab to add some > of this back. Maybe we should upstream what we have, for this and > freebsd_printf since that's also > in clang and one of the small number of patches we have for the lang/gcc* > family? > https://reviews.freebsd.org/D45836 Warner --000000000000f04164061c477510 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Tue, Jul 2, 2024 at 10:30=E2=80=AF= AM Warner Losh <imp@bsdimp.com>= wrote:
Hey John,

On Tue, Jul 2, 2024 at 9:44=E2=80=AF= AM John Baldwin <jh= b@freebsd.org> wrote:
On 7/1/24 4:09 PM, Warner Losh wrote:
> On Mon, Jul 1, 2024, 3:53=E2=80=AFPM John Baldwin <jhb@freebsd.org> wrote:
>
>> On 6/20/24 7:41 PM, Warner Losh wrote:
>>> The branch main has been updated by imp:
>>>
>>> URL:
>> https://c= git.FreeBSD.org/src/commit/?id=3D67d1a1cd9e772e2ef94003579f4fbc271d38be7d
>>>
>>> commit 67d1a1cd9e772e2ef94003579f4fbc271d38be7d
>>> Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>=
>>> AuthorDate: 2024-06-20 23:02:56 +0000
>>> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>=
>>> CommitDate: 2024-06-21 02:41:08 +0000
>>>
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0cdefs.h: Remove support for pre gcc = 4.0
>>>
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0All supported compilers support the = gcc 3 attribute extensions.
>> Remove
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0the #else clauses for this. Also, la= tter-day pcc compilers also
>> define
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0__GNUC__, so there's not need to= also test for __PCC__.
>>>
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0Reviewed by:=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 brooks
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0Differential Revision:=C2=A0
https://reviews.freebsd.org/D45654
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0Sponsored by:=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0Netflix
>>> ---
>>>=C2=A0 =C2=A0 sys/sys/cdefs.h | 42 ++++------------------------= --------------
>>>=C2=A0 =C2=A0 1 file changed, 4 insertions(+), 38 deletions(-)<= br> >>>
>>> diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
>>> index 88019819eb35..a6ecdca5d8b9 100644
>>> --- a/sys/sys/cdefs.h
>>> +++ b/sys/sys/cdefs.h
>>> @@ -408,15 +389,10 @@
>>>=C2=A0 =C2=A0 =C2=A0* assign pointer x to a local variable, to = check that its type is
>>>=C2=A0 =C2=A0 =C2=A0* compatible with member m.
>>>=C2=A0 =C2=A0 =C2=A0*/
>>> -#if __GNUC_PREREQ__(3, 1)
>>>=C2=A0 =C2=A0 #define=C2=A0 =C2=A0 =C2=A0__containerof(x, s, m)= ({
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0\
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 const volatile __typeof(((s *)0)-&g= t;m) *__x =3D (x);=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \=
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 __DEQUALIFY(s *, (const volatile ch= ar *)__x - __offsetof(s, m));\
>>>=C2=A0 =C2=A0 })
>>> -#else
>>> -#define=C2=A0 =C2=A0 =C2=A0 __containerof(x, s, m)
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 \
>>> -=C2=A0 =C2=A0 =C2=A0__DEQUALIFY(s *, (const volatile char *)(= x) - __offsetof(s, m))
>>> -#endif
>>>
>>>=C2=A0 =C2=A0 /*
>>>=C2=A0 =C2=A0 =C2=A0* Compiler-dependent macros to declare that= functions take printf-like
>>> @@ -434,14 +410,8 @@
>>>=C2=A0 =C2=A0 #define=C2=A0 =C2=A0 =C2=A0__strftimelike(fmtarg,= firstvararg) \
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 __attribute__((__form= at__ (__strftime__, fmtarg, firstvararg)))
>>>
>>> -/* Compiler-dependent macros that rely on FreeBSD-specific ex= tensions.
>> */
>>> -#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_ver= sion >=3D 300001 && \
>>> -=C2=A0 =C2=A0 defined(__GNUC__)
>>>=C2=A0 =C2=A0 #define=C2=A0 =C2=A0 =C2=A0__printf0like(fmtarg, = firstvararg) \
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 __attribute__((__form= at__ (__printf0__, fmtarg, firstvararg)))
>>> -#else
>>> -#define=C2=A0 =C2=A0 =C2=A0 __printf0like(fmtarg, firstvararg= )
>>> -#endif
>>
>> Does this still work with external GCC?=C2=A0 I didn't think p= rintf0 was
>> supported
>> by external GCC (or maybe I had to readd it in the port and that&#= 39;s what I
>> remember).=C2=A0 Ah, yes, printf0 is a local patch in the devel/fr= eebsd-gccX
>> ports, but is not available in stock GCC (e.g. lang/gcc does not s= upport
>> it).
>>
>
> Ah. That would explain why it just worked for me. That's what I te= sted
> with. Clang also seemed happy with it. But that was the in tree clang.= Is
> there a similar issue? Gnuc is defined for both.

So we don't support building the base system with lang/gcc, only
devel/freebsd-gccX (which has a local patch to add printf0 support).
The only question might be, do we support using __printf0like for things that aren't in the base system that could be built with lang/gcc.=C2=A0= If so,
we might need to guard this somehow.=C2=A0 I'm not sure though that we = care
about random software not in base using a FreeBSD-specific keyword from
<sys/cdefs.h>.

Yes. The question = is "do we use __printf0like=C2=A0 in our headers" since we defini= tely
can't build FreeBSD itself w/o at least some of the exte= nsions for other things...
and the answer is "yes". err= .h uses it, for example, as does setproctitle in stdlib.h

The interesting thing for me is that gcc13 will produce no warnings= if I include errr.h=C2=A0
because -Wsystem-header=C2=A0is off. W= ith it on, warnings crop up too. This is why my testing
didn'= t see it...

It looks like clang has it as a builti= n for all versions we care about, so I'll create a phab to add some
of this back. Maybe we should upstream what we have, for this and fr= eebsd_printf since that's also
in clang and one of the small = number of patches we have for the lang/gcc* family?


Warner=
--000000000000f04164061c477510-- From nobody Tue Jul 2 18:05:52 2024 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 4WD9nm54xkz5Nw81 for ; Tue, 02 Jul 2024 18:06:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WD9nm3Pj5z4Sxy for ; Tue, 2 Jul 2024 18:06:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-70671ecd334so3492066b3a.0 for ; Tue, 02 Jul 2024 11:06:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1719943563; x=1720548363; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=oajtjtEmHNvTiPKZcEZaIQbENcUHZxrI8pUFeei2CUM=; b=KvmPDXJBshozxs4A+HuIXjyU2MD7mn43DIHDk3Bd7eoxHeKRrzqlf4TB50xMQ/NAH6 me7A8rtVO1P3NurGoGhjFRbHyP/nd3ZprIOW0XuaDrldu1vxni0IVXOF46/eB9/ZAfV/ hlSk7W9rJKtG/MfKRNiMmslTyq+WDSU1lSxAlTQDSQwXi0R18BjR49HBvvqAFEIpM8/p tGcPcjySwNxaU0wEbyK6CJ7PdMFv3Fl3giTRl2WlnNhTex6HB54X2Pjsjv+zQCOdUkLB SiPg85S+UlQ5WfnPEbynRBal1Pnsyq1ENV+Ewiv9HRpdr65hA2d8M7so4j4kalW9YShc 6WKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719943563; x=1720548363; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oajtjtEmHNvTiPKZcEZaIQbENcUHZxrI8pUFeei2CUM=; b=AnsBfTjZzRjmYsxpbgXUJNmai4D/wj9Eh7SuQz1uShHhwlYA+NgSS8A4AgIRsWtQba 3nUyPyPXyxBVwk3DCY1ixbyAFPvL9b75oHbETTw/Y+RKwl49LScZcg/dEC7v5gPF7XqZ xIEhHnnYhPkV4ftXnZbC7yKz7T9vSMPXkMmeWIDs/MYarc0wCIjqLFl/qXyCC3iAtmi/ T9bht2PRWZWLvumyLLacXGN0gwTD37sBu/cA6ApTfDw3/2fSIOiWlEXxGdDzQLqHF2NX i80ljKTthRsuK4+TGDmLXqnRw1ZT45EdQbTrvgMCuKYQr45lmSDMfZPYBIDhJwkTuPnj ysOA== X-Forwarded-Encrypted: i=1; AJvYcCXY5mTzy2il3JjpKBPrNibNHyPQA7kYIe6tt8NUX8Na4cbU+Q7PBukkaJNneQCawaIb4L/NeVsA2jdCT7Xqpehxgs6rWJJPLKB1APhyIcrWcA== X-Gm-Message-State: AOJu0YyfaS/KaRD3QsKPGeW++bRd7ifJUiekvmH7dh3fRkxxiV/4hVUl mqQb3eE1kPSzdvk9cU0Hhs4+jMFfdUJDp9GJvpXMtpVTS8+8+qEHMszJrODhJ02gJ7lIgdbTVyD ox+YSmaVpVzMMdmdVoCjyozLBrrigQQ1Xa1Ih9w== X-Google-Smtp-Source: AGHT+IEE17sFRi9TzTYwMrNcw1TxaWG3zLh0axevm8fd2AUKFugSVjzs9lCwhpMxxeIi0rMCspVDJ3CoOXxLcVKPVyA= X-Received: by 2002:a05:6a20:1584:b0:1bd:fe8:fc9a with SMTP id adf61e73a8af0-1bef60fc0demr12775061637.17.1719943563077; Tue, 02 Jul 2024 11:06: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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202406210241.45L2fNU2056962@gitrepo.freebsd.org> <7ca0ab94-4d5e-405e-b178-84ef3d8ebc8d@FreeBSD.org> In-Reply-To: <7ca0ab94-4d5e-405e-b178-84ef3d8ebc8d@FreeBSD.org> From: Warner Losh Date: Tue, 2 Jul 2024 12:05:52 -0600 Message-ID: Subject: Re: git: 2508372b7b46 - main - cdefs.h: Assume the compiler supports at least GNU C 3.0 extensions To: John Baldwin Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000001c839a061c479154" X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4WD9nm3Pj5z4Sxy --0000000000001c839a061c479154 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hey John, On Mon, Jul 1, 2024 at 3:49=E2=80=AFPM John Baldwin wrote= : > On 6/20/24 7:41 PM, Warner Losh wrote: > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D2508372b7b46117a9fb801b50624265= d30888442 > > > > commit 2508372b7b46117a9fb801b50624265d30888442 > ... > > -/* > > - * GNU C version 2.96 adds explicit branch prediction so that > > - * the CPU back-end can hint the processor and also so that > > - * code blocks can be reordered such that the predicted path > > - * sees a more linear flow, thus improving cache behavior, etc. > > - * > > - * The following two macros provide us with a way to utilize this > > - * compiler feature. Use __predict_true() if you expect the expressio= n > > - * to evaluate to true, and __predict_false() if you expect the > > - * expression to evaluate to false. > > - * > > - * A few notes about usage: > > - * > > - * * Generally, __predict_false() error condition checks (unless > > - * you have some _strong_ reason to do otherwise, in which case > > - * document it), and/or __predict_true() `no-error' condition > > - * checks, assuming you want to optimize for the no-error case. > > - * > > - * * Other than that, if you don't know the likelihood of a test > > - * succeeding from empirical or other `hard' evidence, don't > > - * make predictions. > > - * > > - * * These are meant to be used in places that are run `a lot'. > > - * It is wasteful to make predictions in code that is run > > - * seldomly (e.g. at subsystem initialization time) as the > > - * basic block reordering that this affects can often generate > > - * larger code. > > - */ > > -#if __GNUC_PREREQ__(2, 96) > > #define __predict_true(exp) __builtin_expect((exp), 1) > > #define __predict_false(exp) __builtin_expect((exp), 0) > > -#else > > -#define __predict_true(exp) (exp) > > -#define __predict_false(exp) (exp) > > -#endif > > I think the comment was worth keeping around. You just need to modify > the start of it to "Modern compilers include explicit branch prediction..= ." > In particular, I think our current practice is still to apply prediction > hints rather conservatively. > That's a fair point I hadn't considered. https://reviews.freebsd.org/D45837 adds it back with some tiny tweaks to the language, justification, etc. Warner --0000000000001c839a061c479154 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hey John,

On Mon, Jul 1, 2024 at 3:49= =E2=80=AFPM John Baldwin <jhb@freebsd= .org> wrote:
On 6/20/24 7:41 PM, Warner Losh wrote:
> The branch main has been updated by imp:
>
> URL: https://= cgit.FreeBSD.org/src/commit/?id=3D2508372b7b46117a9fb801b50624265d30888442<= /a>
>
> commit 2508372b7b46117a9fb801b50624265d30888442
> -/* > - * GNU C version 2.96 adds explicit branch prediction so that
> - * the CPU back-end can hint the processor and also so that
> - * code blocks can be reordered such that the predicted path
> - * sees a more linear flow, thus improving cache behavior, etc.
> - *
> - * The following two macros provide us with a way to utilize this
> - * compiler feature.=C2=A0 Use __predict_true() if you expect the exp= ression
> - * to evaluate to true, and __predict_false() if you expect the
> - * expression to evaluate to false.
> - *
> - * A few notes about usage:
> - *
> - *=C2=A0 =C2=A0* Generally, __predict_false() error condition checks = (unless
> - *=C2=A0 =C2=A0 =C2=A0you have some _strong_ reason to do otherwise, = in which case
> - *=C2=A0 =C2=A0 =C2=A0document it), and/or __predict_true() `no-error= ' condition
> - *=C2=A0 =C2=A0 =C2=A0checks, assuming you want to optimize for the n= o-error case.
> - *
> - *=C2=A0 =C2=A0* Other than that, if you don't know the likelihoo= d of a test
> - *=C2=A0 =C2=A0 =C2=A0succeeding from empirical or other `hard' e= vidence, don't
> - *=C2=A0 =C2=A0 =C2=A0make predictions.
> - *
> - *=C2=A0 =C2=A0* These are meant to be used in places that are run `a= lot'.
> - *=C2=A0 =C2=A0 =C2=A0It is wasteful to make predictions in code that= is run
> - *=C2=A0 =C2=A0 =C2=A0seldomly (e.g. at subsystem initialization time= ) as the
> - *=C2=A0 =C2=A0 =C2=A0basic block reordering that this affects can of= ten generate
> - *=C2=A0 =C2=A0 =C2=A0larger code.
> - */
> -#if __GNUC_PREREQ__(2, 96)
>=C2=A0 =C2=A0#define=C2=A0 =C2=A0 =C2=A0__predict_true(exp)=C2=A0 =C2= =A0 =C2=A0__builtin_expect((exp), 1)
>=C2=A0 =C2=A0#define=C2=A0 =C2=A0 =C2=A0__predict_false(exp)=C2=A0 =C2= =A0 __builtin_expect((exp), 0)
> -#else
> -#define=C2=A0 =C2=A0 =C2=A0 __predict_true(exp)=C2=A0 =C2=A0 =C2=A0(e= xp)
> -#define=C2=A0 =C2=A0 =C2=A0 __predict_false(exp)=C2=A0 =C2=A0 (exp) > -#endif

I think the comment was worth keeping around.=C2=A0 You just need to modify=
the start of it to "Modern compilers include explicit branch predictio= n..."
In particular, I think our current practice is still to apply prediction hints rather conservatively.

adds it ba= ck with some tiny tweaks to the language, justification, etc.
Warner=C2=A0
--0000000000001c839a061c479154-- From nobody Tue Jul 2 18:27:48 2024 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 4WDBGt2NV9z5P02B; Tue, 02 Jul 2024 18:27:50 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WDBGt1RJxz4Wdw; Tue, 2 Jul 2024 18:27:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719944870; 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=GB/JDL0ijvdqWDw3X6ScZ6lDiUpZw96p2vXHDaCsSwU=; b=ebLIo2ruFFwqjbCzwIYZnonJTuwxcKxfiZ5P3B4HbPUZN45juKogh/qyG6m5GvuRqzNYLT LBHVd0DtxX2tNjOeTqwCmVLLFJA1k3Oq26NTGj4bBmBRcMkJaCOtCMqxKBun/LrJYOtjtD BlcazCXeCXTM1Db0evoeEElombsZV5701o5Y5xyqT3iTZ5awIfBFhCiWeAE8JPIkQDmKf7 wd3VPsu7toMWVFpqTNlg6Apw/F/1ks187e41pMrwHUWADgPy4BXkBqYZkc0LlwzoYeX99E AnVRCTMB+Bbg7opBOVh2q0i/ICHyfQScNe6KVPQwKIlCmihA/vJ9VL4CjkNIoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719944870; a=rsa-sha256; cv=none; b=jkPgpm1p3qklwHNsw/3ECJrevFoRgFb+oC/xPPP6xsIHvV5SRbo4WtvskrvveJCirvojRx 4gHOO3Ldo702T3cXfrBMUdZJkOUKG1aEgOw/dXklUYi4ATp0R0rKK12K3rFoetM6kUQkrE ejion5uUdtKu6Q/nEDcD7+JNamDzUvfD0Tpi7GF/7CQwowE9XI/j4+k9QIfuplTgagWesG i3JFe5zHx5X093hxOH0K1m82igGYSImoXv9gYUfU0Hc1cZZIqJoJ0KLOFhn10wtiEYGsMU yt+ZH2J4oS9pKPpyzEESOGdQZf2EYURcq+Cd9tP0aXxfkBamp/FQriOJ2/3KSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719944870; 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=GB/JDL0ijvdqWDw3X6ScZ6lDiUpZw96p2vXHDaCsSwU=; b=P3wAY04hdUPeykvbf0TUJXLtHYDL6izN+Z72Z3DWs6lfC6U+PT4UUTjiPYkeRxzONtAHY3 wJKj4ELauamsiqflUVgmjO4++7PAOOjwBOmEfKaojbzFNU0cOIRPTwC39xrdrud9hoPqQf Pa1X+5cpTW/YQUDQV+RPA0Yapgu5e+1Jmaj9xrWNTyN3Lr+f/dxBf0U//6ou9FILImyePV EkqLyVdNGRsStGDg90OdGBqSM8IS5InUqCrd1+7aonR+0hi7dtEgVZnpfEfqIrff57i8lo NlGjTlvZD7pZ0/WBFIEOB6gokmroxryfSgW2L7qiAwXwHA0YtQxRQe9iwS3aSQ== Received: from [IPV6:2601:5c0:4200:b830:3517:62a3:b646:39a7] (unknown [IPv6:2601:5c0:4200:b830:3517:62a3:b646:39a7]) (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 did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WDBGs5ltZz19hL; Tue, 2 Jul 2024 18:27:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <3e59b5b4-5807-49bd-a069-642f321c9662@FreeBSD.org> Date: Tue, 2 Jul 2024 14:27:48 -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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 67d1a1cd9e77 - main - cdefs.h: Remove support for pre gcc 4.0 Content-Language: en-US To: Warner Losh Cc: Warner Losh , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202406210241.45L2fOkP057010@gitrepo.freebsd.org> <4ecc814d-5df1-4db8-b9e0-4919895c5e6a@FreeBSD.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 7/2/24 12:30, Warner Losh wrote: > Hey John, > > On Tue, Jul 2, 2024 at 9:44 AM John Baldwin wrote: > >> On 7/1/24 4:09 PM, Warner Losh wrote: >>> On Mon, Jul 1, 2024, 3:53 PM John Baldwin wrote: >>> >>>> On 6/20/24 7:41 PM, Warner Losh wrote: >>>>> The branch main has been updated by imp: >>>>> >>>>> URL: >>>> >> https://cgit.FreeBSD.org/src/commit/?id=67d1a1cd9e772e2ef94003579f4fbc271d38be7d >>>>> >>>>> commit 67d1a1cd9e772e2ef94003579f4fbc271d38be7d >>>>> Author: Warner Losh >>>>> AuthorDate: 2024-06-20 23:02:56 +0000 >>>>> Commit: Warner Losh >>>>> CommitDate: 2024-06-21 02:41:08 +0000 >>>>> >>>>> cdefs.h: Remove support for pre gcc 4.0 >>>>> >>>>> All supported compilers support the gcc 3 attribute extensions. >>>> Remove >>>>> the #else clauses for this. Also, latter-day pcc compilers also >>>> define >>>>> __GNUC__, so there's not need to also test for __PCC__. >>>>> >>>>> Reviewed by: brooks >>>>> Differential Revision: https://reviews.freebsd.org/D45654 >>>>> Sponsored by: Netflix >>>>> --- >>>>> sys/sys/cdefs.h | 42 ++++-------------------------------------- >>>>> 1 file changed, 4 insertions(+), 38 deletions(-) >>>>> >>>>> diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h >>>>> index 88019819eb35..a6ecdca5d8b9 100644 >>>>> --- a/sys/sys/cdefs.h >>>>> +++ b/sys/sys/cdefs.h >>>>> @@ -408,15 +389,10 @@ >>>>> * assign pointer x to a local variable, to check that its type is >>>>> * compatible with member m. >>>>> */ >>>>> -#if __GNUC_PREREQ__(3, 1) >>>>> #define __containerof(x, s, m) ({ >>>> \ >>>>> const volatile __typeof(((s *)0)->m) *__x = (x); >> \ >>>>> __DEQUALIFY(s *, (const volatile char *)__x - __offsetof(s, >> m));\ >>>>> }) >>>>> -#else >>>>> -#define __containerof(x, s, m) >>>> \ >>>>> - __DEQUALIFY(s *, (const volatile char *)(x) - __offsetof(s, m)) >>>>> -#endif >>>>> >>>>> /* >>>>> * Compiler-dependent macros to declare that functions take >> printf-like >>>>> @@ -434,14 +410,8 @@ >>>>> #define __strftimelike(fmtarg, firstvararg) \ >>>>> __attribute__((__format__ (__strftime__, fmtarg, >> firstvararg))) >>>>> >>>>> -/* Compiler-dependent macros that rely on FreeBSD-specific extensions. >>>> */ >>>>> -#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 >> && \ >>>>> - defined(__GNUC__) >>>>> #define __printf0like(fmtarg, firstvararg) \ >>>>> __attribute__((__format__ (__printf0__, fmtarg, >> firstvararg))) >>>>> -#else >>>>> -#define __printf0like(fmtarg, firstvararg) >>>>> -#endif >>>> >>>> Does this still work with external GCC? I didn't think printf0 was >>>> supported >>>> by external GCC (or maybe I had to readd it in the port and that's what >> I >>>> remember). Ah, yes, printf0 is a local patch in the devel/freebsd-gccX >>>> ports, but is not available in stock GCC (e.g. lang/gcc does not support >>>> it). >>>> >>> >>> Ah. That would explain why it just worked for me. That's what I tested >>> with. Clang also seemed happy with it. But that was the in tree clang. Is >>> there a similar issue? Gnuc is defined for both. >> >> So we don't support building the base system with lang/gcc, only >> devel/freebsd-gccX (which has a local patch to add printf0 support). >> The only question might be, do we support using __printf0like for things >> that aren't in the base system that could be built with lang/gcc. If so, >> we might need to guard this somehow. I'm not sure though that we care >> about random software not in base using a FreeBSD-specific keyword from >> . >> > > Yes. The question is "do we use __printf0like in our headers" since we > definitely > can't build FreeBSD itself w/o at least some of the extensions for other > things... > and the answer is "yes". err.h uses it, for example, as does setproctitle > in stdlib.h > > The interesting thing for me is that gcc13 will produce no warnings if I > include errr.h > because -Wsystem-header is off. With it on, warnings crop up too. This is > why my testing > didn't see it... > > It looks like clang has it as a builtin for all versions we care about, so > I'll create a phab to add some > of this back. Maybe we should upstream what we have, for this and > freebsd_printf since that's also > in clang and one of the small number of patches we have for the lang/gcc* > family? Yeah, I should do my FSF paperwork for GCC sometime and try to upstream at least the printf changes and a few others (i386 defaulting to i686 on recent releases as well) -- John Baldwin From nobody Tue Jul 2 19:15:09 2024 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 4WDCKT4JKHz5P6j4; Tue, 02 Jul 2024 19:15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WDCKT3LTKz4c5k; Tue, 2 Jul 2024 19:15:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719947709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2/UIETrhqsXeN3OYZanS8l3S6SvOCB1xTxwWJDs3bVo=; b=XOOd6QaO0RVlkHqX8bZYYDmsQt+3HqpjbtAtzBh4/FQHcuzU4+iOM//4zEZHEjbto/hl+z g1wwuvnpT9paSGZWtqTqX66Ar3f5s0eacv6YV+PwVAdPSwSzy1NTvn8/K1M/j0qU6ezWcG 0KPNvhUxypx0wD6mGQBrXSbc74QJUSiAQSPOKUdEJ22xpAoPULn36U4n4k2KuRHuLnSjkT p3H9xk228dCYuO1AGiBahea8rFD33VuN2KB52PRRI8IPCwJ3hw6Ry0UROjseGZ7KNvbbU2 4cCG1TkFlN/ZNGh9ZRfWgCnrQ/fDdJ5aZsLaBHRsZeVI3Yix0jwasHPcaHXFlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719947709; a=rsa-sha256; cv=none; b=uu2lQ91wNCxNUNZCp3Urt7kCXdq7HHT6RPTa4cXW8/6f8M9zdqArPR2rjfrSS7XJD6Nv2E 1KLsG8bJgqKFkV87wioZAt2BPN5TaepPAfvoXys3UJc/cTY210Ymom8E56a6ZGoAiU7iMM SqprrXgF2QSvsSr/ZYQORRrPwQ3Dax0dRkZJlbSFcfcuu8o0o+V1y3rCHz19Ww6bgIm74J 2AnmULWpSLYUy8u4Ykw+Cw/hlG1SU/7CgRLWHWkRP693Xxoatz/ufjpwL+G2zbkBg8egc2 EAZRywf75DFCYSSOo6FE7WAF1ZIz4EuJHJDKXH0AyqVvKjFT0+mcx+trJ+1qww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719947709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2/UIETrhqsXeN3OYZanS8l3S6SvOCB1xTxwWJDs3bVo=; b=FndlUy94TecSZpgzfStbqqPAYpN9ZVx0Y4a+1ACnA82Voq83BA/ng+OLyECqeDnd8D2SZq wiE59+5rOa3+eNLDepOv8e87w7vY8z9M8o2qSJ5+xmRL9YGIz+Rnr6Jj23z2mX4ojSqkvx uUVMY8CRepBifpUiReoHSITFOcyLQM5WR8a2BZ9bbDYpJyxInQq8CnzC66/dWT1VUxgYYF FEzvLul00tFDL6M+P9RCNSmB7RLyXlejX8TUSIq63uaXaHtudHAJdORPvpQyEwoojZv/X6 nObZjMedjbJhUI+bMkKbX23klZhlFhu4JYokoVc8slAlMV6+N7NZnE6F15Mq1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WDCKT2xC5z11FS; Tue, 2 Jul 2024 19:15:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 462JF9oP014031; Tue, 2 Jul 2024 19:15:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 462JF98s014028; Tue, 2 Jul 2024 19:15:09 GMT (envelope-from git) Date: Tue, 2 Jul 2024 19:15:09 GMT Message-Id: <202407021915.462JF98s014028@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 19008cdf7bef - main - gsb_crc32.c: avoid gcc -Wunused-const-variable in user 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 19008cdf7befe5351b9118174432d107e0c39431 Auto-Submitted: auto-generated The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=19008cdf7befe5351b9118174432d107e0c39431 commit 19008cdf7befe5351b9118174432d107e0c39431 Author: Ryan Libby AuthorDate: 2024-07-02 19:12:22 +0000 Commit: Ryan Libby CommitDate: 2024-07-02 19:12:22 +0000 gsb_crc32.c: avoid gcc -Wunused-const-variable in user build Fixup after 56e9a0136f87 gsb_crc32: Fix a warning when compiled in userland. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D45824 --- sys/libkern/gsb_crc32.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/libkern/gsb_crc32.c b/sys/libkern/gsb_crc32.c index 58bd3e720278..8cfee97d8d55 100644 --- a/sys/libkern/gsb_crc32.c +++ b/sys/libkern/gsb_crc32.c @@ -59,11 +59,7 @@ #include #include #endif -#endif /* _KERNEL */ -#ifndef _KERNEL -static -#endif const uint32_t crc32_tab[] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, @@ -128,6 +124,7 @@ const uint32_t crc32_tab[] = { * return crc ^ ~0U; * } */ +#endif /* _KERNEL */ /* CRC32C routines, these use a different polynomial */ /*****************************************************************/ From nobody Tue Jul 2 19:15:10 2024 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 4WDCKV5Fnmz5P6WZ; Tue, 02 Jul 2024 19:15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WDCKV44DVz4c8H; Tue, 2 Jul 2024 19:15:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719947710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+tIaC52iwjpa7yUePOnoVnqU2abDmAESxkqbOjLNnMg=; b=meGXe8Kg1PnAFsNeX43z+GVYZ47E4GakoKnjIsB8B/7PqFbJawJWHCSxfdkavV6TSGKO9k QELmjDqq8oEeUt3yOxO71lIUzzN/1Z47awSGz02dX/r1or1GrfhOtdhjRP+hwNz601oeeg tw63O1T1qdt4e/kE7/xRvcGS34jFJW3949au1A1p0hgWCTbC9ttmqPeg8r6o4gtnbzGtlN aCQ3zxwnFtAJBP/oVVvOiQneQmdqNSXZ55FYwZvWRIDPSD9PG0WXdmIDTGMmMuESZbVLHA QfGOJzsa/ptEDKvhif1bYg5htolveR4zkFVsiIHWw/JW4T29YhPi19q2HYh8Aw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719947710; a=rsa-sha256; cv=none; b=I9dTLj4yD/JflcTCcAKleYTrYArI1bEhqJPR2M0Wvf2GMHGDEgDhJhXNbXuafitJ1qgjQz 038iM18fXMqjq7RhVevczglI23mfJyAElZSIcVQnFBCmpZVbrTjXvPtlukW1TFT3PwZF1D h4LHoiIEC9zuX9+MzkffYSWOxDp9svwap9wsSbDdv1hpktB5rj7nQm821NIhPDUP4UxPSr Hkkb9cLuNkqJGiuMryTnazXXAz24zZ80xuDm2gArehZ+38xnyST4sSdmN8Cu2BFzskZq6E p4/ogh1D5OeuO+l2agpMGiR2BJZfhhB4Tdl8Oz671V+UA2SuAnf/P7lsBQhjlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719947710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+tIaC52iwjpa7yUePOnoVnqU2abDmAESxkqbOjLNnMg=; b=fd3dtW7cAMBJFcDKLtYmaja2bV2pGlwSPR0jg3KQ/RyGy5et3bKcX4C+84WteBpLWVvPq1 fzuIcr1J/EOYbU10GCn/0R9ticFpqS/Y06P7/ImdiJNhytBkab5TtvASDOgZtEecAhatbW nTOuVTuu8uADruGPAiiJiuBLnlJ8WJTCZPD6v/RaqD2UEiJ1HPRr9zdg4vaAdygzO5z7c/ rN5mGBxWWhS/3lg8MP5X5v3jXYNehgGrDnBORRnU07CoACeKJmTQhtbgd/9yjkZU9rjCEa FQtH1oHtxYPiTxqOcLHFwxG3+XM546v8qMYJzmi5kyeteJb/MQon2gknwdQuYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WDCKV3gZQz119V; Tue, 2 Jul 2024 19:15:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 462JFAhS014073; Tue, 2 Jul 2024 19:15:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 462JFAhh014070; Tue, 2 Jul 2024 19:15:10 GMT (envelope-from git) Date: Tue, 2 Jul 2024 19:15:10 GMT Message-Id: <202407021915.462JFAhh014070@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 3cfcbbfaf83a - main - cdefs.h __generic: avoid gcc -Wunused-value 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3cfcbbfaf83aa0a61c1fd72cb1e82a011b08bc83 Auto-Submitted: auto-generated The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=3cfcbbfaf83aa0a61c1fd72cb1e82a011b08bc83 commit 3cfcbbfaf83aa0a61c1fd72cb1e82a011b08bc83 Author: Ryan Libby AuthorDate: 2024-07-02 19:12:59 +0000 Commit: Ryan Libby CommitDate: 2024-07-02 19:12:59 +0000 cdefs.h __generic: avoid gcc -Wunused-value Fixup after 9d2f97981755 : Decay expression passed to fallback version of __generic() Reviewed by: imp, jrtc27, kib Differential Revision: https://reviews.freebsd.org/D45825 --- sys/sys/cdefs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 53ac1b1c3f92..7c4890ece8d5 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -244,8 +244,8 @@ _Generic(expr, t: yes, default: no) #elif !defined(__cplusplus) #define __generic(expr, t, yes, no) \ - __builtin_choose_expr( \ - __builtin_types_compatible_p(__typeof((0, (expr))), t), yes, no) + __builtin_choose_expr(__builtin_types_compatible_p( \ + __typeof(((void)0, (expr))), t), yes, no) #endif /* From nobody Tue Jul 2 19:58:47 2024 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 4WDDHq2Tltz5PCwD; Tue, 02 Jul 2024 19: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WDDHq1vnpz4hK9; Tue, 2 Jul 2024 19:58:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719950327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nIlMDalocunDJ9WpaMi1DC2rKLTcwzBuh4HkfcsWlPc=; b=s3SLHU/n4gie2eR7ud0G1/eAceG+cMF11KYkPSsP8smhc1LLYfMZLcrcE9Vzemmm1S+4sH bbra4ptRHkMz4rFbdbR4eFYPpq5RwiOLf0XAaBXA/hjGAQPPAXmzEZ/B97HtUNMqRFCc1b 9op7nl/eu0ie6s7yFVmwUPws3c88TJYrQxTmxXnz0IL5wZSP+x4Sm2R96jZQp6wLi30jpl CQmk4+y+vjs/HYQa4ePZvU+d9HTip476aWSiq/iNZjWjWNMRzM3qN6Z0JBni0CAVXFKZtr EJdAlN8ucwFx8QzMGVdZc3CdogcNLtzHP1+RozLbRPixQr4IB8BJA/XGnfTP5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719950327; a=rsa-sha256; cv=none; b=LXcMMOO10jlu7t0UzxxlNYGKmhu4j8t2wTUVdrxSFVGXg5baftZj1GQkkeKp5UU4mwtJuy wNV2oom9x3kgYluCiLyk2h0wH+Z5tUpWgxv8F+eMOB5hTe+L8gEgwnIW4McfYntVkMuiNj 0rsKUXyQZdaRPfy5WBoio8R0a5XL5ssZVqtI+h48o0vZL/9BfuSGigehbQAtJMDsclEDzF 5cs5SJ4u6OzYJONLfLtm3qglHs1g/wt21fs3GjBBYIcvVe4/+zeuTVG2uSQb4alPSPptLd HiV+uJO2IjfoEz5P77IBLlU+JQWVj3pJLOh409CruX2Ff+uhpOM7tF0hJJJU2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719950327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nIlMDalocunDJ9WpaMi1DC2rKLTcwzBuh4HkfcsWlPc=; b=ZQWEHbFy0Veh6tCqDwtAcZ/YrZxoVRAxBx58R4dll6IGR8ys0BQIdfJaUoPOZGRoXUiHOz XkGUdCvsmB3Iy+rCamAy6LVc/ZkKHxkHKVpQO7qIwWSTHoQn2Mi3FoABW9/xgEaxPN6BY7 YLFcmVEjML5yE0jqzxVzVs1Q4E3M/Zo2xpfXi+mH1/8JeR86FyaBk0KDHmx6CYDLxmHrPw n8xUowggKIJha8vo9USxIOHHPAUGmrJnH6akzrxFoW3kQaQkPUbXuj4jTwh4sH79+iv5hx V7HxV3HEJTqIjoInVKr8dGTpZj9eZNvLTtHrXur5B/vPZUJVJQrYPSvx7yr8wg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WDDHq1PLWz11Z6; Tue, 2 Jul 2024 19:58:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 462Jwlpl081337; Tue, 2 Jul 2024 19:58:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 462JwlxL081334; Tue, 2 Jul 2024 19:58:47 GMT (envelope-from git) Date: Tue, 2 Jul 2024 19:58:47 GMT Message-Id: <202407021958.462JwlxL081334@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: 78918c9b271c - main - pf: Fix NULL deref in m_pullup failure case 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 78918c9b271cb71419111abb5780f8a5adb4f2f5 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=78918c9b271cb71419111abb5780f8a5adb4f2f5 commit 78918c9b271cb71419111abb5780f8a5adb4f2f5 Author: Igor Ostapenko AuthorDate: 2024-07-02 17:36:28 +0000 Commit: Kristof Provost CommitDate: 2024-07-02 19:58:32 +0000 pf: Fix NULL deref in m_pullup failure case Reviewed by: glebius, kp Differential Revision: https://reviews.freebsd.org/D45832 --- sys/netpfil/pf/pf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 4ad0a9a1336a..21647bd733f8 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -8085,8 +8085,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, if (m->m_len < sizeof(struct ip) && (m = *m0 = m_pullup(*m0, sizeof(struct ip))) == NULL) { DPFPRINTF(PF_DEBUG_URGENT, - ("pf_test: m_len=%d < sizeof(struct ip), pullup failed\n", - m->m_len)); + ("pf_test: m_len < sizeof(struct ip), pullup failed\n")); PF_RULES_RUNLOCK(); return (PF_DROP); } From nobody Tue Jul 2 23:17:50 2024 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 4WDJjV6qxjz5PfHZ; Tue, 02 Jul 2024 23:17: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WDJjV6HLSz4DYc; Tue, 2 Jul 2024 23:17:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719962270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+YHkL6lkLSBx64GyFrx17XZ2MFkrFi08MyN5vVWdEnw=; b=P3DH86y6rW4Gz84W+M5L122zxOouPhIng33Bem/LRK1JOv/issRw0n172o13/7+Q6V/QOu wsyrzD4AsniSccdDgHAi1pesFvHEtSptvAVR/FAPEih4vXYS7hFm3kGlBGdbJLEIQ8vVAs OsetwH0PsMLIHDjcbgPmSW2cClX8bIJ5tSkyOHeprvDzy0jj5UUcOmD39sGlFpFeZoN4YQ nAhQKiE2XutnkOS92acdmeKDwfmKnv7Z1E2wK7vQgVAigsgShtmKAd/rHMRM3BAU2T+CF1 4UCfImApV5LaPX3OgE0XbZtVqGAKhvyQN1U/pge3AQPZfgmeZXqe8mYqzP6cUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719962270; a=rsa-sha256; cv=none; b=iqkTAT3hi13OuC2H71wNLXCX8xnDiJA3UIOI6EcQEfnyzFf3GnM00EML36cQRbYDBv8aMn faZUeqKglzLdgNLRwqhc/PO+om/Pnwlf4GPuYxDwAa3Csz3iuG0yHJGS006duWSzMGypCD Qm/kzCqF7d+KfAE5UzMXg4LWi+n5YyZX1SFOxeLlFrluvrAdx0fe0CZKZmgU3Rxz/5MfBO EmUox2bcxFUTjSKWpTf8+4mgcrLk938VE57TVFtXngOfBPEvMm1K4RGqr2tn+Lo3Y5zIak 6eaC5ZvXHPpRwsqJQhT+O55FZs2Y9673tRqCO0383vSNGbSRVa7oMXOIRN34Lw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719962270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+YHkL6lkLSBx64GyFrx17XZ2MFkrFi08MyN5vVWdEnw=; b=SZvb/WvH/qz4o6GDBI9Yu9liylvY37YHdVZKSMOX10hB3m37x4HcEhv23nOcev2W8gFpK0 oVxpjswHqPEUZyH77pGDnviLPLbSdKqb0re5da1N9YvhcYMb0vX2xxyB++u85DGgzjd6+l 994krK6Ftju3hMAf0tl7C00phBNoAvwjqxb9vje30hAcQL/7GtWPc5yITS45TXqO4gua4y iai9uNqoEfWA2TuAPiFapx5CrWkgxYqYNsOhlPUD27jVz6YsSGXJcVeDiub/+NhpVP8XWe 5L7JWhg49noRLVZjVN3t+ebkUYfUnVR8cEf9rP0tmkPAOt8jwENVDREPSFeq/g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WDJjV5m1bz16ky; Tue, 2 Jul 2024 23:17:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 462NHoYm019554; Tue, 2 Jul 2024 23:17:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 462NHogY019551; Tue, 2 Jul 2024 23:17:50 GMT (envelope-from git) Date: Tue, 2 Jul 2024 23:17:50 GMT Message-Id: <202407022317.462NHogY019551@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: d6888e211b07 - main - ums(4): fix incorrect mouse button reporting via evdev 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d6888e211b07be79dd8de3145ac41b365f482ae8 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=d6888e211b07be79dd8de3145ac41b365f482ae8 commit d6888e211b07be79dd8de3145ac41b365f482ae8 Author: Niko Sonack AuthorDate: 2024-07-02 19:27:25 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-07-02 23:15:50 +0000 ums(4): fix incorrect mouse button reporting via evdev when ums driver receives non-mouse HID report. This results in unexpected button release event. Reuse existing sysmouse logic to keep button pressed. Reviewed by: imp, wulf MFC after: 1 week Differential revision: https://reviews.freebsd.org/D45838 --- sys/dev/usb/input/ums.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/input/ums.c b/sys/dev/usb/input/ums.c index 8416be656f81..067feed13e92 100644 --- a/sys/dev/usb/input/ums.c +++ b/sys/dev/usb/input/ums.c @@ -320,11 +320,12 @@ ums_intr_callback(struct usb_xfer *xfer, usb_error_t error) if (++info != &sc->sc_info[UMS_INFO_MAX]) goto repeat; + /* keep old button value(s) for non-detected buttons */ + buttons |= sc->sc_status.button & ~buttons_found; + #ifdef EVDEV_SUPPORT buttons_reported = buttons; #endif - /* keep old button value(s) for non-detected buttons */ - buttons |= sc->sc_status.button & ~buttons_found; if (dx || dy || dz || dt || dw || (buttons != sc->sc_status.button)) { From nobody Tue Jul 2 23:19:40 2024 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 4WDJld1N24z5Pfbd; Tue, 02 Jul 2024 23:19: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WDJld0l5Jz4F2v; Tue, 2 Jul 2024 23:19:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719962381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ImAlU2FnnK2/AdIh8XxM9+y/+qdcLOeB2gonWqIZG8M=; b=YrZVPU0ocuPLNODS257VDVB0kVei+rb7F07fwCCvo92xKv42xFZ/qiWZ5uUI5iIgXWZq0G JrxXbz30JPuPfmfo0PEnaAyKBiUQ6lnSXHRodupbLpvB0LiD7PYqiGR/ZUHevT7XjUN7vQ 8AvDOhrC8EP9slimYnnk+k4Gu8ocVU+xcMZ13E4/alDvdVEsyMQ2pVtwMHUSDkUrfUtWo4 IFzY4s758CDkhitvXP9amUljpPV+660z/zD67S6S2qV5qT5J6qqw3sWMB9xeX/VMQdgI3e V1zbwb5M6bMXdp5L8Mu8MD177HBkVvzFi2vFwH0LjodRWq7fhqJcik8kpnv8sQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719962381; a=rsa-sha256; cv=none; b=JaGXOdQpMww6U810yU5kwrgnP6FISOLmMiAVmG/j0eJNnENRo+QQ7TirI+l6DVNQt024we 3HjrAftJcKxz6144/g9IION3umr8wZCXV+MKnEkv/gJD1/EhrEijlbQO2B/EeWS7O8CNzt qxvPZqhnSpP+KtRMWRSPu7ZkVkw1cm78U5BKmjSK6mrMMxfe0cEXC0H4bg6ZrKJ6dvWo0c D0g1DEWTDzzuxAz0Tug07b1Nl9UV/9zAceSQEsY9vWy69MUuQ8piWIOk1zUtHMwiZ/iLzv fx63TC/Mku19PtreDJPRptv1q6EKDHFaeue76cdPE70QUzoqFnNjAV3RZG+wHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719962381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ImAlU2FnnK2/AdIh8XxM9+y/+qdcLOeB2gonWqIZG8M=; b=bdzvAiazzwlAio/slJaPk7sBISVDcPEVjv5fwV3eCpMlG1lEciP25yO0k72KxuOCKqYbHk 6NyHoVMA8ftFgURDLqAzjpfHJfI8cwpSOTbPCcqqs0XSXCA7GJl08T6MpIsqaKNbLphYWu 7pK7ZCvEbKOFVV+EQOiICl7iJtd3OvX8kTvnahqLGZdQq2C3aoNmCM4PdDOGk+ZnB4/8nL DJ+AtlUxULIoytmn/v19OG2stCgmZIWcAUa54dLANWWpoppGDkdH520FQpOF/pGKm4pEPj QpZ15OByX8Lujlf1zdYAv2EcTy+d/7MK04vmsua0ez9M5Lg9BJR5Hq1Rni8FZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WDJld0CZbz16bP; Tue, 2 Jul 2024 23:19:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 462NJepA019928; Tue, 2 Jul 2024 23:19:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 462NJehl019925; Tue, 2 Jul 2024 23:19:40 GMT (envelope-from git) Date: Tue, 2 Jul 2024 23:19:40 GMT Message-Id: <202407022319.462NJehl019925@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: a1cfe4c7646b - main - style(9): Delete __FBSDID straggler 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: a1cfe4c7646bcae56276ba89c1fe316f426c3d8c Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a1cfe4c7646bcae56276ba89c1fe316f426c3d8c commit a1cfe4c7646bcae56276ba89c1fe316f426c3d8c Author: Warner Losh AuthorDate: 2024-07-02 23:09:36 +0000 Commit: Warner Losh CommitDate: 2024-07-02 23:19:32 +0000 style(9): Delete __FBSDID straggler We no longer need advice on __FBSDID, so delete it. Sponsored by: Netflix --- share/man/man9/style.9 | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index 8eb82e3419ec..381f3aa3bfa3 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 26, 2024 +.Dd July 2, 2024 .Dt STYLE 9 .Os .Sh NAME @@ -137,11 +137,6 @@ Leave one blank line before the header files. Kernel include files .Pa ( sys/*.h ) come first. -If -.In sys/cdefs.h -is needed for -.Fn __FBSDID , -include it first. If either .In sys/types.h or From nobody Wed Jul 3 13:20:19 2024 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 4WDgPc0FpJz5PHH7; Wed, 03 Jul 2024 13:20: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WDgPb6562z4pHr; Wed, 3 Jul 2024 13:20:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720012819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PRhfPY1RFIpV30VE6KFzPUDAFemOiEoqdGoGqFg6+8g=; b=sOLOupCCVNBjPgErtXjRBXnYW7wIL3GtO0qkbnjFdRu+nkSifyj9/Eh7F/BIdH9zy8Y7xs ZJhRofxMAlEH9CGyMgy8dU7IXjXdtL8K/+BaBjGBGnYUa/SyIJF44FM/+NrBiY/vEmt7dd YfbVgkFyteK1/cAZnR3L0lHJRA5WklOE4lSviEE1Cske6UAJQI/WiBYGHssOGRVveAGDnB B+/c9rZanVeS6uIEwpIhc6ToUw0exQmesW+sVnEGpksw0tJBhM+evkClE7gfakT6Oebn7S zT4GAMK00rv8cpX2HpvR669XyyPeCtJtU147Jrsk4uglPEWrFx8OQmQf6EVuwQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720012819; a=rsa-sha256; cv=none; b=TVihAR6hvB8yd/zI9amBjBZCO0ldBvoQ2mCqVRhsfNw12aaKsv4ieN20HjAI7VUIJPKN2a vTVfnGP1JdIGu4/3JRGAOUxsfwIhPiK1LHO3U65umeDn/tqTQbayxA8ywMzbh/yhOEvoSk 65P7g2iRzUBMx0Jw48FlCAydoG+unteQAkJbP47NsZg636xtgavCfZnwuCwJwczeO7YwAn 12QCApgpa0oFIKVkatCNn835QNuS9/tVEbCsbcJQ1igePbgHeQHWfid2RniSFLzNpZKUJU p5lJR71p4J4ZdCYFMC5ahzKuydUjZtgQdLRhGWw5z822e01zb5usPu72Yl+jyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720012819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PRhfPY1RFIpV30VE6KFzPUDAFemOiEoqdGoGqFg6+8g=; b=RPHgFPU4zukDbICAzKQYFPqCnJ48Jj9RCduWwa2rzYwd3fuIM/xnMyfi106bkRHL0y2iR2 oDDiyKfNqOvlEAUaM4HD0YOHEONpo7iXnHa2DmGse0J4N31TfrTD/FFsVJEgbp8mpqYFbd 90z9Y/rPaj/YVCj6i7NM0N4P1P1m3i5PpeLEM1EY8uv/XzHYSa9A1LuY1B4lm6taRSBOHC TFcWKcOevVGnhhAHIszfdFRZEfJL5Ol9njP25jNPnnq7S6R0IXvxu2PV9QlQbIKdSJzR9x n9vOYAyIhJfz4W3eCIT4zYA7UhDcu6G8KFq9nGDTVRAE/lqOC8DFDKfyx1ZA9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WDgPb5ZBwzYXS; Wed, 3 Jul 2024 13:20:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 463DKJCH047373; Wed, 3 Jul 2024 13:20:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 463DKJLa047370; Wed, 3 Jul 2024 13:20:19 GMT (envelope-from git) Date: Wed, 3 Jul 2024 13:20:19 GMT Message-Id: <202407031320.463DKJLa047370@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: a2cac544a668 - main - if_clone: Allow maxunit to be 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a2cac544a668d2834ed41986aca32b44b9819c89 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=a2cac544a668d2834ed41986aca32b44b9819c89 commit a2cac544a668d2834ed41986aca32b44b9819c89 Author: Zhenlei Huang AuthorDate: 2024-07-03 13:14:08 +0000 Commit: Zhenlei Huang CommitDate: 2024-07-03 13:14:08 +0000 if_clone: Allow maxunit to be zero Some drivers, e.g. if_enc(4), only allow one instance to be created, but the KPI ifc_attach_cloner() treat zero value of maxunit as not limited, aka IF_MAXUNIT. Introduce a new flag IFC_F_LIMITUNIT to indicate that the requested maxunit is limited and should be respected. Consumers should use the new flag if there is an intended limit. Reviewed by: glebius MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45757 --- sys/net/if_clone.c | 13 +++++++++---- sys/net/if_clone.h | 5 +++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/sys/net/if_clone.c b/sys/net/if_clone.c index 8f1bad56d14e..13d89e4e2c59 100644 --- a/sys/net/if_clone.c +++ b/sys/net/if_clone.c @@ -483,12 +483,13 @@ if_clone_alloc(const char *name, int maxunit) struct if_clone *ifc; KASSERT(name != NULL, ("%s: no name\n", __func__)); + MPASS(maxunit >= 0); ifc = malloc(sizeof(struct if_clone), M_CLONE, M_WAITOK | M_ZERO); strncpy(ifc->ifc_name, name, IFCLOSIZ-1); IF_CLONE_LOCK_INIT(ifc); IF_CLONE_ADDREF(ifc); - ifc->ifc_maxunit = maxunit ? maxunit : IF_MAXUNIT; + ifc->ifc_maxunit = maxunit; ifc->ifc_unrhdr = new_unrhdr(0, ifc->ifc_maxunit, &ifc->ifc_mtx); LIST_INIT(&ifc->ifc_iflist); @@ -521,12 +522,16 @@ if_clone_attach(struct if_clone *ifc) struct if_clone * ifc_attach_cloner(const char *name, struct if_clone_addreq *req) { + int maxunit; + struct if_clone *ifc; + if (req->create_f == NULL || req->destroy_f == NULL) return (NULL); if (strnlen(name, IFCLOSIZ) >= (IFCLOSIZ - 1)) return (NULL); - struct if_clone *ifc = if_clone_alloc(name, req->maxunit); + maxunit = (req->flags & IFC_F_LIMITUNIT) ? req->maxunit : IF_MAXUNIT; + ifc = if_clone_alloc(name, maxunit); ifc->ifc_match = req->match_f != NULL ? req->match_f : ifc_simple_match; ifc->ifc_create = req->create_f; ifc->ifc_destroy = req->destroy_f; @@ -584,7 +589,7 @@ if_clone_advanced(const char *name, u_int maxunit, ifc_match_t match, { struct if_clone *ifc; - ifc = if_clone_alloc(name, maxunit); + ifc = if_clone_alloc(name, maxunit ? maxunit : IF_MAXUNIT); ifc->ifc_match = match; ifc->ifc_create = ifc_advanced_create_wrapper; ifc->ifc_destroy = ifc_advanced_destroy_wrapper; @@ -629,7 +634,7 @@ if_clone_simple(const char *name, ifcs_create_t create, ifcs_destroy_t destroy, struct if_clone *ifc; u_int unit; - ifc = if_clone_alloc(name, 0); + ifc = if_clone_alloc(name, IF_MAXUNIT); ifc->ifc_match = ifc_simple_match; ifc->ifc_create = ifc_simple_create_wrapper; ifc->ifc_destroy = ifc_simple_destroy_wrapper; diff --git a/sys/net/if_clone.h b/sys/net/if_clone.h index 45a6d4144230..e11fc5c8cdd7 100644 --- a/sys/net/if_clone.h +++ b/sys/net/if_clone.h @@ -101,6 +101,11 @@ struct if_clone_addreq_v2 { #define IFC_F_SYSSPACE 0x04 /* Cloner callback: params pointer is in kernel memory */ #define IFC_F_FORCE 0x08 /* Deletion flag: force interface deletion */ #define IFC_F_CREATE 0x10 /* Creation flag: indicate creation request */ +#define IFC_F_LIMITUNIT 0x20 /* Creation flag: the unit number is limited */ + +_Static_assert(offsetof(struct if_clone_addreq, destroy_f) == + offsetof(struct if_clone_addreq_v2, destroy_f), + "destroy_f in if_clone_addreq and if_clone_addreq_v2 are at different offset"); struct if_clone *ifc_attach_cloner(const char *name, struct if_clone_addreq *req); void ifc_detach_cloner(struct if_clone *ifc); From nobody Wed Jul 3 13:20:20 2024 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 4WDgPd0sDsz5PH8P; Wed, 03 Jul 2024 13:20: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WDgPc6V9Dz4pFj; Wed, 3 Jul 2024 13:20:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720012820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SYsaVz5D6plohFZbwbC5SAhzSVHvK3i/8K/s5/A468Y=; b=v/9pD+mTlfW2Db6YabFqsyLVau5oyrb2aLn3AbCCEh/qfYbZjV1DZwW+1QmMvoxVm6bod0 MbwiU1XnKdUb/pPcdq5CcxrjoVm8m/LkYG1T677EW6qAk3Ii0X7utg3uqzPrkyX0FV4KC4 BHUXUUAVVbwOrtYL0doTHzOmEKX59ZK4ZPHRtJp+NU0GFXTG3uNN1ZfOKh1/hd2ZWrSwK8 dxDRYI5GEWzJJMrHgRoncv3IMQvH1k4+Yt9Op0HEUnuENis7Ht70kQRkIzhKBPw4I6evjk oGuZFSuHo/TXJ/bVjDUMFmBOvTxT2LD+k9k5sT+k4hCZoqBU1SkB9nHxwSjXxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720012820; a=rsa-sha256; cv=none; b=Cz14TjziHoOcyvvAjlquxVWfqdfSLSdauSHdK4FMIYkZqY12yb9Bqcr/FFk0wRPdGFTBBc +0DOzYsdFgJsXb1nObMa5k/jzvN0XMxmDHvt/ISV4f78QonnCDONqLkW/ceLMlUEdDIsCD QYdgfoG3hOepHdGcCfALSloATEnf87kFA+ra7P/j1M09ybwAydlic7eRIkvfzzTbdv+VB+ dfAZhxPsjiv9ToDioW8LV3fFpybNYiQQppvM63pwofvotIYhE+Vq7ain87duNaNH/VHJVe ijNCXBYJJfW2tr+INR/uztaH5x9fwli2hTCMnpnmtXgfgzHplU1MCS19eSXjhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720012820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SYsaVz5D6plohFZbwbC5SAhzSVHvK3i/8K/s5/A468Y=; b=uUSB79vwJxdFjTtqtzYMi1j5l0O1kvMkV1emJnOjsDk2jMeYV3hl4RD2JgSTYAIZInwYI/ 2xH1e4XUbRX1nn+O5LOJBDhrcS0Dx2e3/icpPaf0B3t6jAq1cyJVSmym7NKx6RBj89NbhK 0cgT+x5ABQBe/rEHk0q3y81C9wwaEg66kH3EpkMxXMz6LzRXYmjaHh9nYxz8iTFLJuNBwJ dHYbcZ+BG+aQwq/lk07M4hhmnbMVTW91VWF1eai5DNM6QkDO9aROKhU4BN0d7mOGiD45rr GjoPRltDvXgHN9404/azd3VeCWW9iDBsctBdzJLXwum4utCbf3BqPD/SVZG/pA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WDgPc65cgzYJ5; Wed, 3 Jul 2024 13:20:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 463DKKce047427; Wed, 3 Jul 2024 13:20:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 463DKKrE047424; Wed, 3 Jul 2024 13:20:20 GMT (envelope-from git) Date: Wed, 3 Jul 2024 13:20:20 GMT Message-Id: <202407031320.463DKKrE047424@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 07d138afc7e5 - main - if_pflog: Limit the maximum unit via the new KPI 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 07d138afc7e5efee73368459dd047493713056cf Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=07d138afc7e5efee73368459dd047493713056cf commit 07d138afc7e5efee73368459dd047493713056cf Author: Zhenlei Huang AuthorDate: 2024-07-03 13:14:09 +0000 Commit: Zhenlei Huang CommitDate: 2024-07-03 13:14:09 +0000 if_pflog: Limit the maximum unit via the new KPI The cloner has the ability to limit the maximum unit. Employ it to do that rather than roll our own. No functional change intended. Reviewed by: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45767 --- sys/netpfil/pf/if_pflog.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/netpfil/pf/if_pflog.c b/sys/netpfil/pf/if_pflog.c index 8b849b0b9376..6035ba635116 100644 --- a/sys/netpfil/pf/if_pflog.c +++ b/sys/netpfil/pf/if_pflog.c @@ -105,14 +105,16 @@ VNET_DEFINE(struct ifnet *, pflogifs[PFLOGIFS_MAX]); /* for fast access */ static void pflogattach(int npflog __unused) { - int i; + int i; + for (i = 0; i < PFLOGIFS_MAX; i++) V_pflogifs[i] = NULL; struct if_clone_addreq req = { .create_f = pflog_clone_create, .destroy_f = pflog_clone_destroy, - .flags = IFC_F_AUTOUNIT, + .flags = IFC_F_AUTOUNIT | IFC_F_LIMITUNIT, + .maxunit = PFLOGIFS_MAX - 1, }; V_pflog_cloner = ifc_attach_cloner(pflogname, &req); struct ifc_data ifd = { .unit = 0 }; @@ -125,8 +127,7 @@ pflog_clone_create(struct if_clone *ifc, char *name, size_t maxlen, { struct ifnet *ifp; - if (ifd->unit >= PFLOGIFS_MAX) - return (EINVAL); + MPASS(ifd->unit < PFLOGIFS_MAX); ifp = if_alloc(IFT_PFLOG); if_initname(ifp, pflogname, ifd->unit); From nobody Wed Jul 3 15:05:28 2024 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 4WDjkw2QKPz5Pl1l; Wed, 03 Jul 2024 15:05: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WDjkw1kYSz41Bh; Wed, 3 Jul 2024 15:05:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720019128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8nkQobrZc2oPr8rt+5iCNUdDAL1oiFd3e2tg4MC92D4=; b=OXvrPBOBNuU3zmMIFTO8lgdRxGw3guq6IkCB3glGbBD2NG8aOMcSIiK5Ja4clCJv/lrzCI WkTTj0jKZj/GcZ4lBOqSZPKGLk8p494G1+swv+3YzqSgbPoaeNsDEOZPc+fDZYTDi77KgV gTaA3TiuSSernjgi2TMRLsNDf67SfQKerxYB1Kab6ZxrIM4l1XW6pudLZNC6G4kh1Vp17J MiqUzi4PYGb2JsFdtDMFoV6SjYICUVlIYD2RlQY9tE3UKXqc2ATy+L32XikJ3m+whzu/IC NzVOQtOAlfLCCbXpH7MUhkcnaEt8toPsj3GT7Ch+6tWyS4GcOJY7SGUvkx8lcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720019128; a=rsa-sha256; cv=none; b=OhiSL1682Zcdqusb1xID22q6ZlMmyOtBlIuDQItdDUZvJGiM05rW4kS4dr6dKDhvGPxMUB aZfwioVMDeYwk+lOpjI39eka2Duu4g+CNZIFBUaCF9GhbH3Rua8AO3fmJ2opS1KnoVOzNS EjWNdGiTStLkohAHBd7LOAqdm+j+XYulhSCkisb6J4F7sEkyJ1qQrBox2F4kizzonqRxk4 KonGdc1Rl2hs5o3vGeP6BSGAqLtO9ZvHvJX49buNtZH0YTSkHV5TgoTxnLTF3Bv6EtHnkb MrzEN1TtCHyYBi/oK3eXqPzXeaA6qR2xdtx+CtwZ9SWBhifZlTO/R7Esw4Lesw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720019128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8nkQobrZc2oPr8rt+5iCNUdDAL1oiFd3e2tg4MC92D4=; b=IJyi/cubPx/c5iF7Cd2tMcFpASAAdEO85o5hnQeouhKRDq/bQKsPUcD0+/+p5K/LW2GV2n S507NQIJpgSkjj1whcd4k26wt8bPXOPPfJL9xecUjgFTxfS8PhKbIigaAMDKWaNZIO4I30 9Kg7syXx+v09O5mJD8MAriGUSan0zyaAPPOkQSTMqPI6sjh2ieVGACjsmVmvehCdwfPRs/ luT2MtbNEllOWwiS/x0H2uuAU+tJeCB72MNDIwHDYTYH7tYOmk5/+YaHu4x/qu/54urVEQ KC5DGDjL5TjGdJ0W6CyBGECvwhVkq+9Xq5HpM76nK+DduzfcJiAPztKbUCBdVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WDjkw1KkfzcDZ; Wed, 3 Jul 2024 15:05:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 463F5SIL023496; Wed, 3 Jul 2024 15:05:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 463F5SNn023493; Wed, 3 Jul 2024 15:05:28 GMT (envelope-from git) Date: Wed, 3 Jul 2024 15:05:28 GMT Message-Id: <202407031505.463F5SNn023493@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: 61089df8147e - main - cxgbe: Remove most uses of sysctl_wire_old_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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 61089df8147eb7109696476c891514296d543bad Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=61089df8147eb7109696476c891514296d543bad commit 61089df8147eb7109696476c891514296d543bad Author: John Baldwin AuthorDate: 2024-07-03 15:04:52 +0000 Commit: John Baldwin CommitDate: 2024-07-03 15:04:52 +0000 cxgbe: Remove most uses of sysctl_wire_old_buffer Most of these sysctls don't call sbuf_* while holding any locks. Of the ones that do hold locks, all but one can be fixed to drop the lock before calling sbuf_*. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D45186 --- sys/dev/cxgbe/t4_main.c | 167 ++++++++---------------------------------------- 1 file changed, 27 insertions(+), 140 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index ab477595bdb9..14799b3eeb18 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -8140,10 +8140,6 @@ sysctl_bitfield_8b(SYSCTL_HANDLER_ARGS) int rc; struct sbuf *sb; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return(rc); - sb = sbuf_new_for_sysctl(NULL, NULL, 128, req); if (sb == NULL) return (ENOMEM); @@ -8161,10 +8157,6 @@ sysctl_bitfield_16b(SYSCTL_HANDLER_ARGS) int rc; struct sbuf *sb; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return(rc); - sb = sbuf_new_for_sysctl(NULL, NULL, 128, req); if (sb == NULL) return (ENOMEM); @@ -8422,10 +8414,6 @@ sysctl_pause_settings(SYSCTL_HANDLER_ARGS) struct sbuf *sb; static char *bits = "\20\1RX\2TX\3AUTO"; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return(rc); - sb = sbuf_new_for_sysctl(NULL, NULL, 128, req); if (sb == NULL) return (ENOMEM); @@ -8487,10 +8475,6 @@ sysctl_link_fec(SYSCTL_HANDLER_ARGS) struct sbuf *sb; static char *bits = "\20\1RS-FEC\2FC-FEC\3NO-FEC\4RSVD1\5RSVD2"; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return(rc); - sb = sbuf_new_for_sysctl(NULL, NULL, 128, req); if (sb == NULL) return (ENOMEM); @@ -8518,10 +8502,6 @@ sysctl_requested_fec(SYSCTL_HANDLER_ARGS) static char *bits = "\20\1RS-FEC\2FC-FEC\3NO-FEC\4RSVD2" "\5RSVD3\6auto\7module"; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return(rc); - sb = sbuf_new_for_sysctl(NULL, NULL, 128, req); if (sb == NULL) return (ENOMEM); @@ -8597,10 +8577,6 @@ sysctl_module_fec(SYSCTL_HANDLER_ARGS) struct sbuf *sb; static char *bits = "\20\1RS-FEC\2FC-FEC\3NO-FEC\4RSVD2\5RSVD3"; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - sb = sbuf_new_for_sysctl(NULL, NULL, 128, req); if (sb == NULL) return (ENOMEM); @@ -8627,14 +8603,15 @@ sysctl_module_fec(SYSCTL_HANDLER_ARGS) fec = lc->fec_hint; if (pi->mod_type == FW_PORT_MOD_TYPE_NONE || !fec_supported(lc->pcaps)) { + PORT_UNLOCK(pi); sbuf_printf(sb, "n/a"); } else { if (fec == 0) fec = FEC_NONE; + PORT_UNLOCK(pi); sbuf_printf(sb, "%b", fec & M_FW_PORT_CAP32_FEC, bits); } rc = sbuf_finish(sb); - PORT_UNLOCK(pi); done: sbuf_delete(sb); end_synchronized_op(sc, 0); @@ -8854,10 +8831,6 @@ sysctl_loadavg(SYSCTL_HANDLER_ARGS) if (rc) return (rc); - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); if (sb == NULL) return (ENOMEM); @@ -8887,14 +8860,11 @@ sysctl_cctrl(SYSCTL_HANDLER_ARGS) "0.9375" }; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); if (sb == NULL) return (ENOMEM); + rc = 0; mtx_lock(&sc->reg_lock); if (hw_off_limits(sc)) rc = ENXIO; @@ -8970,10 +8940,6 @@ sysctl_cim_ibq_obq(SYSCTL_HANDLER_ARGS) } n = rc * sizeof(uint32_t); /* rc has # of words actually read */ - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - goto done; - sb = sbuf_new_for_sysctl(NULL, NULL, PAGE_SIZE, req); if (sb == NULL) { rc = ENOMEM; @@ -9092,9 +9058,6 @@ sysctl_cim_la(SYSCTL_HANDLER_ARGS) struct sbuf *sb; int rc; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); if (sb == NULL) return (ENOMEM); @@ -9162,10 +9125,6 @@ sysctl_cim_ma_la(SYSCTL_HANDLER_ARGS) uint32_t *buf, *p; int rc; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); if (sb == NULL) return (ENOMEM); @@ -9173,6 +9132,7 @@ sysctl_cim_ma_la(SYSCTL_HANDLER_ARGS) buf = malloc(2 * CIM_MALA_SIZE * 5 * sizeof(uint32_t), M_CXGBE, M_ZERO | M_WAITOK); + rc = 0; mtx_lock(&sc->reg_lock); if (hw_off_limits(sc)) rc = ENXIO; @@ -9213,10 +9173,6 @@ sysctl_cim_pif_la(SYSCTL_HANDLER_ARGS) uint32_t *buf, *p; int rc; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); if (sb == NULL) return (ENOMEM); @@ -9224,6 +9180,7 @@ sysctl_cim_pif_la(SYSCTL_HANDLER_ARGS) buf = malloc(2 * CIM_PIFLA_SIZE * 6 * sizeof(uint32_t), M_CXGBE, M_ZERO | M_WAITOK); + rc = 0; mtx_lock(&sc->reg_lock); if (hw_off_limits(sc)) rc = ENXIO; @@ -9293,10 +9250,6 @@ sysctl_cim_qcfg(SYSCTL_HANDLER_ARGS) if (rc) return (rc); - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - sb = sbuf_new_for_sysctl(NULL, NULL, PAGE_SIZE, req); if (sb == NULL) return (ENOMEM); @@ -9329,14 +9282,11 @@ sysctl_cpl_stats(SYSCTL_HANDLER_ARGS) int rc; struct tp_cpl_stats stats; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - sb = sbuf_new_for_sysctl(NULL, NULL, 256, req); if (sb == NULL) return (ENOMEM); + rc = 0; mtx_lock(&sc->reg_lock); if (hw_off_limits(sc)) rc = ENXIO; @@ -9375,14 +9325,11 @@ sysctl_ddp_stats(SYSCTL_HANDLER_ARGS) int rc; struct tp_usm_stats stats; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return(rc); - sb = sbuf_new_for_sysctl(NULL, NULL, 256, req); if (sb == NULL) return (ENOMEM); + rc = 0; mtx_lock(&sc->reg_lock); if (hw_off_limits(sc)) rc = ENXIO; @@ -9408,14 +9355,11 @@ sysctl_tid_stats(SYSCTL_HANDLER_ARGS) int rc; struct tp_tid_stats stats; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return(rc); - sb = sbuf_new_for_sysctl(NULL, NULL, 256, req); if (sb == NULL) return (ENOMEM); + rc = 0; mtx_lock(&sc->reg_lock); if (hw_off_limits(sc)) rc = ENXIO; @@ -9552,9 +9496,6 @@ sysctl_devlog(SYSCTL_HANDLER_ARGS) int rc; struct sbuf *sb; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); if (sb == NULL) return (ENOMEM); @@ -9597,10 +9538,7 @@ sysctl_fcoe_stats(SYSCTL_HANDLER_ARGS) struct tp_fcoe_stats stats[MAX_NCHAN]; int i, nchan = sc->chip_params->nchan; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - + rc = 0; mtx_lock(&sc->reg_lock); if (hw_off_limits(sc)) rc = ENXIO; @@ -9653,16 +9591,13 @@ sysctl_hw_sched(SYSCTL_HANDLER_ARGS) unsigned int map, kbps, ipg, mode; unsigned int pace_tab[NTX_SCHED]; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - sb = sbuf_new_for_sysctl(NULL, NULL, 512, req); if (sb == NULL) return (ENOMEM); mtx_lock(&sc->reg_lock); if (hw_off_limits(sc)) { + mtx_unlock(&sc->reg_lock); rc = ENXIO; goto done; } @@ -9670,6 +9605,7 @@ sysctl_hw_sched(SYSCTL_HANDLER_ARGS) map = t4_read_reg(sc, A_TP_TX_MOD_QUEUE_REQ_MAP); mode = G_TIMERMODE(t4_read_reg(sc, A_TP_MOD_CONFIG)); t4_read_pace_tbl(sc, pace_tab); + mtx_unlock(&sc->reg_lock); sbuf_printf(sb, "Scheduler Mode Channel Rate (Kbps) " "Class IPG (0.1 ns) Flow IPG (us)"); @@ -9695,7 +9631,6 @@ sysctl_hw_sched(SYSCTL_HANDLER_ARGS) } rc = sbuf_finish(sb); done: - mtx_unlock(&sc->reg_lock); sbuf_delete(sb); return (rc); } @@ -9718,16 +9653,13 @@ sysctl_lb_stats(SYSCTL_HANDLER_ARGS) "BG2FramesTrunc:", "BG3FramesTrunc:" }; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); if (sb == NULL) return (ENOMEM); memset(s, 0, sizeof(s)); + rc = 0; for (i = 0; i < sc->chip_params->nchan; i += 2) { mtx_lock(&sc->reg_lock); if (hw_off_limits(sc)) @@ -9750,7 +9682,8 @@ sysctl_lb_stats(SYSCTL_HANDLER_ARGS) *p0++, *p1++); } - rc = sbuf_finish(sb); + if (rc == 0) + rc = sbuf_finish(sb); sbuf_delete(sb); return (rc); @@ -9764,9 +9697,6 @@ sysctl_linkdnrc(SYSCTL_HANDLER_ARGS) struct link_config *lc = &pi->link_cfg; struct sbuf *sb; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return(rc); sb = sbuf_new_for_sysctl(NULL, NULL, 64, req); if (sb == NULL) return (ENOMEM); @@ -10104,10 +10034,6 @@ sysctl_mps_tcam(SYSCTL_HANDLER_ARGS) MPASS(chip_id(sc) <= CHELSIO_T5); - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); if (sb == NULL) return (ENOMEM); @@ -10115,6 +10041,7 @@ sysctl_mps_tcam(SYSCTL_HANDLER_ARGS) sbuf_printf(sb, "Idx Ethernet address Mask Vld Ports PF" " VF Replication P0 P1 P2 P3 ML"); + rc = 0; for (i = 0; i < sc->chip_params->mps_tcam_size; i++) { uint64_t tcamx, tcamy, mask; uint32_t cls_lo, cls_hi; @@ -10208,10 +10135,6 @@ sysctl_mps_tcam_t6(SYSCTL_HANDLER_ARGS) MPASS(chip_id(sc) > CHELSIO_T5); - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); if (sb == NULL) return (ENOMEM); @@ -10221,6 +10144,7 @@ sysctl_mps_tcam_t6(SYSCTL_HANDLER_ARGS) " Replication" " P0 P1 P2 P3 ML\n"); + rc = 0; for (i = 0; i < sc->chip_params->mps_tcam_size; i++) { uint8_t dip_hit, vlan_vld, lookup_type, port_num; uint16_t ivlan; @@ -10390,10 +10314,7 @@ sysctl_path_mtus(SYSCTL_HANDLER_ARGS) int rc; uint16_t mtus[NMTUS]; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - + rc = 0; mtx_lock(&sc->reg_lock); if (hw_off_limits(sc)) rc = ENXIO; @@ -10435,10 +10356,7 @@ sysctl_pm_stats(SYSCTL_HANDLER_ARGS) "Rx FIFO wait", NULL, "Rx latency" }; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - + rc = 0; mtx_lock(&sc->reg_lock); if (hw_off_limits(sc)) rc = ENXIO; @@ -10499,10 +10417,7 @@ sysctl_rdma_stats(SYSCTL_HANDLER_ARGS) int rc; struct tp_rdma_stats stats; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - + rc = 0; mtx_lock(&sc->reg_lock); if (hw_off_limits(sc)) rc = ENXIO; @@ -10533,10 +10448,7 @@ sysctl_tcp_stats(SYSCTL_HANDLER_ARGS) int rc; struct tp_tcp_stats v4, v6; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - + rc = 0; mtx_lock(&sc->reg_lock); if (hw_off_limits(sc)) rc = ENXIO; @@ -10576,10 +10488,7 @@ sysctl_tids(SYSCTL_HANDLER_ARGS) uint32_t x, y; struct tid_info *t = &sc->tids; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - + rc = 0; sb = sbuf_new_for_sysctl(NULL, NULL, 256, req); if (sb == NULL) return (ENOMEM); @@ -10671,10 +10580,7 @@ sysctl_tp_err_stats(SYSCTL_HANDLER_ARGS) int rc; struct tp_err_stats stats; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - + rc = 0; mtx_lock(&sc->reg_lock); if (hw_off_limits(sc)) rc = ENXIO; @@ -10752,10 +10658,7 @@ sysctl_tnl_stats(SYSCTL_HANDLER_ARGS) int rc; struct tp_tnl_stats stats; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return(rc); - + rc = 0; mtx_lock(&sc->reg_lock); if (hw_off_limits(sc)) rc = ENXIO; @@ -11019,10 +10922,7 @@ sysctl_tp_la(SYSCTL_HANDLER_ARGS) u_int i, inc; void (*show_func)(struct sbuf *, uint64_t *, int); - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - + rc = 0; sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); if (sb == NULL) return (ENOMEM); @@ -11070,10 +10970,7 @@ sysctl_tx_rate(SYSCTL_HANDLER_ARGS) int rc; u64 nrate[MAX_NCHAN], orate[MAX_NCHAN]; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - + rc = 0; mtx_lock(&sc->reg_lock); if (hw_off_limits(sc)) rc = ENXIO; @@ -11116,10 +11013,7 @@ sysctl_ulprx_la(SYSCTL_HANDLER_ARGS) uint32_t *buf, *p; int rc, i; - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - + rc = 0; sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); if (sb == NULL) return (ENOMEM); @@ -11160,10 +11054,7 @@ sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS) MPASS(chip_id(sc) >= CHELSIO_T5); - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - + rc = 0; mtx_lock(&sc->reg_lock); if (hw_off_limits(sc)) rc = ENXIO; @@ -11213,10 +11104,6 @@ sysctl_cpus(SYSCTL_HANDLER_ARGS) if (rc != 0) return (rc); - rc = sysctl_wire_old_buffer(req, 0); - if (rc != 0) - return (rc); - sb = sbuf_new_for_sysctl(NULL, NULL, 4096, req); if (sb == NULL) return (ENOMEM); From nobody Wed Jul 3 15:05:29 2024 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 4WDjkx4PjQz5Pl6m; Wed, 03 Jul 2024 15:05: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WDjkx2cpkz41WD; Wed, 3 Jul 2024 15:05:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720019129; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=imS8MesO261pmg2scljLYg2Tt8E+q8h6pBCmetNDvqs=; b=ny1c96tOSa2le4jMQhoL0WAqv0uNsyeUvWUP4Fihmu24D2Bo7Jc6MTd7+FmFgfGM0LAziw oBTma4hbWPsZJ3Vqsm7TvjQlM14Exs2vXWyy9BcdTkgsjDcK4ULpGR03S3Uyj7A5o4KKWB 0FgQ3b6/OdzXSZiiaHTEokpyDJAsSpQHLEusqC7ALkiQgDYLY4wwIQIyf7DKxqYLHKJVUK HRATn4+gZx5T0YD8vR4CR9ASpHl+CiMWkw1okyMbeWkIrmeXtdjiUSs4AnuQa+1aWUYhsJ DL+nAO15G+tpt0MLVuHHya+1J0+rQu5usjelqQgpIBlmwua3RUjgv4D2ESmGnA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720019129; a=rsa-sha256; cv=none; b=wGPswMCNwbleclQciHGk2Y8/6XxjWRYAlRTz1+JnnTdLwt8o9S5s4NRM3f14XV3fMFE7NL 1GDk4N450dom9eW/MzMLgy1oFFHP7gaXEg4igOsWW51IP6MVohOMUkDlmGbad1nmNRwYJo TpTv0cti/8bV3x0zEt0RUaydzIIXLYGSZ4C+J8kxzVgFZgtDqDkZPsaJQUMtJUz80LqAiZ YUqOn81hZ4UbeJWfHPb5okQc7RxlMhMrqREzZLoSny5X78IIArBuldAEm/8ScGz7R8xbTb WNTuQ/zYIhbvHoRQyPbu72SfxKuOJVoms/qGgfQOqjNzMIpktqrQ/oFsSfgX2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720019129; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=imS8MesO261pmg2scljLYg2Tt8E+q8h6pBCmetNDvqs=; b=I9pGZEuROPOifhCqNCVtIeB/9w2S8iCJF3kdtOdmS2CUAOYdzi77Z4l/gcG1f0OaPxvPfK 7As8EeQN+JZNPoFnTSBDNUaTcXHwowXnAfNQ0ZX5UV9WUTBMSol9L4PFP4PC76v82AuKz6 S9U1KDIEPaNW5Fvo4Am7Ajm9EsQB3JjYRCA1bPFZWxyPw84My+AkxlOWu0TZDNjYNTf2gr WtiMr7l6L5jmYxuz7CFPH74sPn/700SgS/UQR6Qm//jRiO0fs7AP1xtRUbsG0zf1OR2kl7 qYjiGjOmrsYxdVZubcULvSp3iM3RI0SWY+CXI1f7X6zwYHevEo3hFbDA+4V5Rw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WDjkx2D9zzcQT; Wed, 3 Jul 2024 15:05:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 463F5Tp3023547; Wed, 3 Jul 2024 15:05:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 463F5TNC023544; Wed, 3 Jul 2024 15:05:29 GMT (envelope-from git) Date: Wed, 3 Jul 2024 15:05:29 GMT Message-Id: <202407031505.463F5TNC023544@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: 1edf61f395d9 - main - cxgbe: Add a 'show t4 memdump' DDB command 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 1edf61f395d98a5abb7d6f38e5e64722b4ddf351 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1edf61f395d98a5abb7d6f38e5e64722b4ddf351 commit 1edf61f395d98a5abb7d6f38e5e64722b4ddf351 Author: John Baldwin AuthorDate: 2024-07-03 15:05:11 +0000 Commit: John Baldwin CommitDate: 2024-07-03 15:05:11 +0000 cxgbe: Add a 'show t4 memdump' DDB command Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D45187 --- sys/dev/cxgbe/t4_main.c | 76 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 66 insertions(+), 10 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 14799b3eeb18..c142fa93166d 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -12737,30 +12737,26 @@ tweak_tunables(void) #ifdef DDB static void -t4_dump_tcb(struct adapter *sc, int tid) +t4_dump_mem(struct adapter *sc, u_int addr, u_int len) { - uint32_t base, i, j, off, pf, reg, save, tcb_addr, win_pos; + uint32_t base, j, off, pf, reg, save, win_pos; reg = PCIE_MEM_ACCESS_REG(A_PCIE_MEM_ACCESS_OFFSET, 2); save = t4_read_reg(sc, reg); base = sc->memwin[2].mw_base; - /* Dump TCB for the tid */ - tcb_addr = t4_read_reg(sc, A_TP_CMM_TCB_BASE); - tcb_addr += tid * TCB_SIZE; - if (is_t4(sc)) { pf = 0; - win_pos = tcb_addr & ~0xf; /* start must be 16B aligned */ + win_pos = addr & ~0xf; /* start must be 16B aligned */ } else { pf = V_PFNUM(sc->pf); - win_pos = tcb_addr & ~0x7f; /* start must be 128B aligned */ + win_pos = addr & ~0x7f; /* start must be 128B aligned */ } + off = addr - win_pos; t4_write_reg(sc, reg, win_pos | pf); t4_read_reg(sc, reg); - off = tcb_addr - win_pos; - for (i = 0; i < 4; i++) { + while (len > 0 && !db_pager_quit) { uint32_t buf[8]; for (j = 0; j < 8; j++, off += 4) buf[j] = htonl(t4_read_reg(sc, base + off)); @@ -12768,12 +12764,27 @@ t4_dump_tcb(struct adapter *sc, int tid) db_printf("%08x %08x %08x %08x %08x %08x %08x %08x\n", buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]); + if (len <= sizeof(buf)) + len = 0; + else + len -= sizeof(buf); } t4_write_reg(sc, reg, save); t4_read_reg(sc, reg); } +static void +t4_dump_tcb(struct adapter *sc, int tid) +{ + uint32_t tcb_addr; + + /* Dump TCB for the tid */ + tcb_addr = t4_read_reg(sc, A_TP_CMM_TCB_BASE); + tcb_addr += tid * TCB_SIZE; + t4_dump_mem(sc, tcb_addr, TCB_SIZE); +} + static void t4_dump_devlog(struct adapter *sc) { @@ -12905,6 +12916,51 @@ DB_TABLE_COMMAND_FLAGS(show_t4, tcb, db_show_t4tcb, CS_OWN) t4_dump_tcb(device_get_softc(dev), tid); } + +DB_TABLE_COMMAND_FLAGS(show_t4, memdump, db_show_memdump, CS_OWN) +{ + device_t dev; + int radix, t; + bool valid; + + valid = false; + radix = db_radix; + db_radix = 10; + t = db_read_token(); + if (t == tIDENT) { + dev = device_lookup_by_name(db_tok_string); + t = db_read_token(); + if (t == tNUMBER) { + addr = db_tok_number; + t = db_read_token(); + if (t == tNUMBER) { + count = db_tok_number; + valid = true; + } + } + } + db_radix = radix; + db_skip_to_eol(); + if (!valid) { + db_printf("usage: show t4 memdump \n"); + return; + } + + if (dev == NULL) { + db_printf("device not found\n"); + return; + } + if (addr < 0) { + db_printf("invalid address\n"); + return; + } + if (count <= 0) { + db_printf("invalid length\n"); + return; + } + + t4_dump_mem(device_get_softc(dev), addr, count); +} #endif static eventhandler_tag vxlan_start_evtag; From nobody Wed Jul 3 16:14:56 2024 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 4WDlH446vFz5Pf3R; Wed, 03 Jul 2024 16:14: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WDlH43b6zz49qT; Wed, 3 Jul 2024 16:14:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720023296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5wbwUOMAYQ9EK7r/yTb+rjSZxDRO2A2iWFp5URZWT50=; b=BEMqGP3bXMGfUAUehZI35RVjFdqIM2iLWSNOnk08gG5MD7XcalmMGV5DNSP9YGZmRKMJ7d 9FBbOPZ/LsVGpHpnLBg4HSAItwf68s9N6j66OhXOUV3UleMpObFACrUBsC7Jl6vwdOxs8+ yf4wAA7yOhQe7hTwi6v96RZ06hyQmuAhrETeUOxbCrw/alrbOhyJcLYq2TlQfTBo+zS3e1 GWqNupA/AQV7BeQLuhuEY//2/Y9UXzdD6y5AJlQ5USqgBxGWjsvRFkExboElAZI2kAl/Ly lxs5oNpIF2qL5QIpMqFycaL7XUn361KEuZ7MivfOT9s0saimvtHi7fIst7K0Ew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720023296; a=rsa-sha256; cv=none; b=hLb4TiBjEL4jfeG1/YAYxwcMncrAqbZtiD2cPPgZ+7YOtjJjeKAwzY9M6s8K+5qEOumj56 i5jAjFX+WfL+8HugpNUNDmGcz9fpPrupwyLL9QtNRRfdtUzc8OTUU16QIfvGg0egULFiYN PhfBxUkF0MHdTjUdfq0PKSHlygzfY5wdytS0Xj9XPm3zLDO5FljH6GwatHRqD2u3UzcDid 2PT7HgOWYRVAS/O1hZcj0JA4KJ2t9wZ3Cfb0ExL8ZsQufkd7iup9l/LLExHExbW8CCTGP7 HOA2j8uJk8517/duPCNWDMTWlIpqN4LtmNt4FUa5A8IiATUlVMqhDe79si1Y+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720023296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5wbwUOMAYQ9EK7r/yTb+rjSZxDRO2A2iWFp5URZWT50=; b=gEL6LK/6U6Xd72UHAvDLWl/0Fjnqrj4VieGsT1T7VkPiv749QOkjBo8Od8qOw2mKmYQ5lY 6I0Dd1YKJ2g+U9GQHKRYETDqeDsazMyySgjDZoOsgN8MixUEeo5rJPCXFSBUAtBcEnPuN3 SE3AoC9C25NItA16e5mglYCR8tecHIa+UlAgeAtDaz3Div+jMA42ruklSYsD7a/BeQBWv8 T3MeStihEn043fIsS8K+WdUsNRCrYbfS4BkLvXICF8M0zYM0kgHxUmbY5zKOAAa1Qq7U5H o3gd+C5KadC/X12TLBz2qUUr41X9QoSudTc+jaG8HJSNlaQG5R2BGE67sKU1PA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WDlH42tJ2zdgC; Wed, 3 Jul 2024 16:14:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 463GEum5041517; Wed, 3 Jul 2024 16:14:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 463GEu1w041514; Wed, 3 Jul 2024 16:14:56 GMT (envelope-from git) Date: Wed, 3 Jul 2024 16:14:56 GMT Message-Id: <202407031614.463GEu1w041514@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: ab92c99aa56f - main - i386 pcpu: fix clobbers, suppress warnings, and clean up 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab92c99aa56fdec4a06f9af5f30f87ef08fbeb0e Auto-Submitted: auto-generated The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=ab92c99aa56fdec4a06f9af5f30f87ef08fbeb0e commit ab92c99aa56fdec4a06f9af5f30f87ef08fbeb0e Author: Ryan Libby AuthorDate: 2024-07-03 15:35:31 +0000 Commit: Ryan Libby CommitDate: 2024-07-03 15:35:31 +0000 i386 pcpu: fix clobbers, suppress warnings, and clean up - Add missing cc clobber to __PCPU_ADD (which is currently unused). - Allow the compiler the opportunity to marginally improve code generation from __PCPU_PTR by letting it figure out how to do the add (also removing the addition fixes a missing cc clobber). - Quiet gcc -Warray-bounds by using constant operands instead of bogus memory references. - Remove the struct __s __s temporaries, just cast through the type. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D45826 --- sys/i386/include/pcpu.h | 47 +++++++++++++++++++-------------------------- sys/i386/include/pcpu_aux.h | 8 ++++---- 2 files changed, 24 insertions(+), 31 deletions(-) diff --git a/sys/i386/include/pcpu.h b/sys/i386/include/pcpu.h index ef3f5cc9dff7..d51763b20798 100644 --- a/sys/i386/include/pcpu.h +++ b/sys/i386/include/pcpu.h @@ -108,16 +108,8 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line"); /* * Evaluates to the address of the per-cpu variable name. */ -#define __PCPU_PTR(name) __extension__ ({ \ - __pcpu_type(name) *__p; \ - \ - __asm __volatile("movl %%fs:%1,%0; addl %2,%0" \ - : "=r" (__p) \ - : "m" (*(struct pcpu *)(__pcpu_offset(pc_prvspace))), \ - "i" (__pcpu_offset(name))); \ - \ - __p; \ -}) +#define __PCPU_PTR(name) \ + (&get_pcpu()->name) /* * Evaluates to the value of the per-cpu variable name. @@ -126,14 +118,13 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line"); __pcpu_type(name) __res; \ struct __s { \ u_char __b[MIN(sizeof(__res), 4)]; \ - } __s; \ + }; \ \ if (sizeof(__res) == 1 || sizeof(__res) == 2 || \ sizeof(__res) == 4) { \ - __asm __volatile("mov %%fs:%1,%0" \ - : "=r" (__s) \ - : "m" (*(struct __s *)(__pcpu_offset(name)))); \ - *(struct __s *)(void *)&__res = __s; \ + __asm __volatile("mov %%fs:%c1,%0" \ + : "=r" (*(struct __s *)(void *)&__res) \ + : "i" (__pcpu_offset(name))); \ } else { \ __res = *__PCPU_PTR(name); \ } \ @@ -148,15 +139,16 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line"); __pcpu_type(name) __val; \ struct __s { \ u_char __b[MIN(sizeof(__val), 4)]; \ - } __s; \ + }; \ \ __val = (val); \ if (sizeof(__val) == 1 || sizeof(__val) == 2 || \ sizeof(__val) == 4) { \ - __s = *(struct __s *)(void *)&__val; \ - __asm __volatile("add %1,%%fs:%0" \ - : "=m" (*(struct __s *)(__pcpu_offset(name))) \ - : "r" (__s)); \ + __asm __volatile("add %1,%%fs:%c0" \ + : \ + : "i" (__pcpu_offset(name)), \ + "r" (*(struct __s *)(void *)&__val) \ + : "cc", "memory"); \ } else \ *__PCPU_PTR(name) += __val; \ } while (0) @@ -168,15 +160,16 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line"); __pcpu_type(name) __val; \ struct __s { \ u_char __b[MIN(sizeof(__val), 4)]; \ - } __s; \ + }; \ \ __val = (val); \ if (sizeof(__val) == 1 || sizeof(__val) == 2 || \ sizeof(__val) == 4) { \ - __s = *(struct __s *)(void *)&__val; \ - __asm __volatile("mov %1,%%fs:%0" \ - : "=m" (*(struct __s *)(__pcpu_offset(name))) \ - : "r" (__s)); \ + __asm __volatile("mov %1,%%fs:%c0" \ + : \ + : "i" (__pcpu_offset(name)), \ + "r" (*(struct __s *)(void *)&__val) \ + : "memory"); \ } else { \ *__PCPU_PTR(name) = __val; \ } \ @@ -185,9 +178,9 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line"); #define get_pcpu() __extension__ ({ \ struct pcpu *__pc; \ \ - __asm __volatile("movl %%fs:%1,%0" \ + __asm __volatile("movl %%fs:%c1,%0" \ : "=r" (__pc) \ - : "m" (*(struct pcpu *)(__pcpu_offset(pc_prvspace)))); \ + : "i" (__pcpu_offset(pc_prvspace))); \ __pc; \ }) diff --git a/sys/i386/include/pcpu_aux.h b/sys/i386/include/pcpu_aux.h index 9d15ee1f3ee3..a38faf9af964 100644 --- a/sys/i386/include/pcpu_aux.h +++ b/sys/i386/include/pcpu_aux.h @@ -49,8 +49,8 @@ __curthread(void) { struct thread *td; - __asm("movl %%fs:%1,%0" : "=r" (td) - : "m" (*(char *)offsetof(struct pcpu, pc_curthread))); + __asm("movl %%fs:%c1,%0" : "=r" (td) + : "i" (offsetof(struct pcpu, pc_curthread))); return (td); } #define curthread (__curthread()) @@ -60,8 +60,8 @@ __curpcb(void) { struct pcb *pcb; - __asm("movl %%fs:%1,%0" : "=r" (pcb) - : "m" (*(char *)offsetof(struct pcpu, pc_curpcb))); + __asm("movl %%fs:%c1,%0" : "=r" (pcb) + : "i" (offsetof(struct pcpu, pc_curpcb))); return (pcb); } #define curpcb (__curpcb()) From nobody Wed Jul 3 16:14:57 2024 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 4WDlH55v8Pz5PfCY; Wed, 03 Jul 2024 16:14: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WDlH54FVWz49qW; Wed, 3 Jul 2024 16:14:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720023297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LZ72/iV7Em3FX948d/hO9kGQNbydRPnQTrRUsFFrS7w=; b=cm6JFml4WoNOHaROmV07Xtak8xy+0EPrRywmGbZfUFX5y9NP8b+7SbKQ3283WtAub3zQ6w GQdd3HVDJdPrdK6VdUmugUt0C98mS3tKoI4hv+6PSka8gFoJJH9Utum8YW3Hga1s41oxxD gwmmm4pS5xZmwbj60ST8+jOOeH7/8YP2L0Vo6eQhb08P+TVL3SZm5zoGQFlWmCVKyC1oiE wPsvBpFiaWPu9/i57VoCp3JF4pvRtWHXgmbrvuSSImnCp9mFVGsp7aqRL+PwwCVGIapUnl AiizSJiIMW3y7+oUestnAuOeeWqwWfw7c19StbExTlAwyoIG/49Xv9nRz6mkyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720023297; a=rsa-sha256; cv=none; b=rMXdQRjoXG2A+uv+Susy/ytWzOUF+rl399YhPr2BWzkFLte2ZNxD16mR78rX0Otdr/yfkN 4HOZFrfI8ZUxOITY5gZ9WoIorBWFhiEZdWCdsGjzPxMzqJERmM4Lat4lwoO7/mLTsT267U 8k5b2vTHvAg2ziZ03jqcdLNAwzxeEAYkEgcnMhkAa7FcTNTdWuEaH78gj2mfixg/XC/ysX TdyDi4l0t9E8Pk3Wojr3/2up+PGLZdV7obWG3nDoIvg1vpUOt0aqgpKL0ZCPoZ5B0Bur+s qiRMVv0bAeg6QJEq0nF7ijclnJHRaT50n67uoh3t/IXErxM2YVB1NMrlVCX+BQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720023297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LZ72/iV7Em3FX948d/hO9kGQNbydRPnQTrRUsFFrS7w=; b=Yhs2iGQ/LIc5SnF4IyfO0a6Fr5nXyzihoWbJDtu7gQ83uP/Njm3X7rMCKGiL1yYGQonMXP n1PwtWe0UnGMt7k835MdEQHjw4GjJ8YFds9Xm/ePNeucEcAJQZ8ccOTU+hJb6taDn36L+5 /VNOh+Zl0qNY+v6d1ClzjDe3lYchndKywkjZ/LzdDnOYhxoRvs/PJhrNFthO+MPtnXoWou 7U5rhT92jJPcycpWIo0fPBgoOzLmt/YDkufPQxYis87RYlhvfFJZjUNIUBXbC3eBLK0Vaq tb80thH7aICNFWGytyQKBXBt9WLzVpw2g++3qiQn365npkoLJAnmBdqSBb8WlA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WDlH53sG1zf13; Wed, 3 Jul 2024 16:14:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 463GEvj9041572; Wed, 3 Jul 2024 16:14:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 463GEvIc041569; Wed, 3 Jul 2024 16:14:57 GMT (envelope-from git) Date: Wed, 3 Jul 2024 16:14:57 GMT Message-Id: <202407031614.463GEvIc041569@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 2730f4291411 - main - amd64 pcpu: fix clobbers, suppress warnings, and clean up 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2730f4291411be0adc1c6ec421f72e146556579c Auto-Submitted: auto-generated The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=2730f4291411be0adc1c6ec421f72e146556579c commit 2730f4291411be0adc1c6ec421f72e146556579c Author: Ryan Libby AuthorDate: 2024-07-03 15:36:31 +0000 Commit: Ryan Libby CommitDate: 2024-07-03 15:36:31 +0000 amd64 pcpu: fix clobbers, suppress warnings, and clean up These changes mostly apply to the !__SEG_GS section, which is no longer the normal compilation path. They're made to be consistent with changes to i386. - Add missing cc clobber to __PCPU_ADD (which is currently unused). - Allow the compiler the opportunity to marginally improve code generation from __PCPU_PTR by letting it figure out how to do the add (also removing the addition fixes a missing cc clobber). - Quiet gcc -Warray-bounds by using constant operands instead of bogus memory references. - Remove the struct __s __s temporaries, just cast through the type. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D45827 --- sys/amd64/include/pcpu.h | 51 +++++++++++++++++++------------------------- sys/amd64/include/pcpu_aux.h | 4 ++-- 2 files changed, 24 insertions(+), 31 deletions(-) diff --git a/sys/amd64/include/pcpu.h b/sys/amd64/include/pcpu.h index fb49eb31ef8a..213790d245dc 100644 --- a/sys/amd64/include/pcpu.h +++ b/sys/amd64/include/pcpu.h @@ -182,16 +182,8 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line"); /* * Evaluates to the address of the per-cpu variable name. */ -#define __PCPU_PTR(name) __extension__ ({ \ - __pcpu_type(name) *__p; \ - \ - __asm __volatile("movq %%gs:%1,%0; addq %2,%0" \ - : "=r" (__p) \ - : "m" (*(struct pcpu *)(__pcpu_offset(pc_prvspace))), \ - "i" (__pcpu_offset(name))); \ - \ - __p; \ -}) +#define __PCPU_PTR(name) \ + (&get_pcpu()->name) /* * Evaluates to the value of the per-cpu variable name. @@ -200,14 +192,13 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line"); __pcpu_type(name) __res; \ struct __s { \ u_char __b[MIN(sizeof(__pcpu_type(name)), 8)]; \ - } __s; \ + }; \ \ if (sizeof(__res) == 1 || sizeof(__res) == 2 || \ sizeof(__res) == 4 || sizeof(__res) == 8) { \ - __asm __volatile("mov %%gs:%1,%0" \ - : "=r" (__s) \ - : "m" (*(struct __s *)(__pcpu_offset(name)))); \ - *(struct __s *)(void *)&__res = __s; \ + __asm __volatile("mov %%gs:%c1,%0" \ + : "=r" (*(struct __s *)(void *)&__res) \ + : "i" (__pcpu_offset(name))); \ } else { \ __res = *__PCPU_PTR(name); \ } \ @@ -222,15 +213,16 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line"); __pcpu_type(name) __val; \ struct __s { \ u_char __b[MIN(sizeof(__pcpu_type(name)), 8)]; \ - } __s; \ + }; \ \ __val = (val); \ if (sizeof(__val) == 1 || sizeof(__val) == 2 || \ sizeof(__val) == 4 || sizeof(__val) == 8) { \ - __s = *(struct __s *)(void *)&__val; \ - __asm __volatile("add %1,%%gs:%0" \ - : "=m" (*(struct __s *)(__pcpu_offset(name))) \ - : "r" (__s)); \ + __asm __volatile("add %1,%%gs:%c0" \ + : \ + : "i" (__pcpu_offset(name)), \ + "r" (*(struct __s *)(void *)&__val) \ + : "cc", "memory"); \ } else \ *__PCPU_PTR(name) += __val; \ } while (0) @@ -238,30 +230,31 @@ _Static_assert(sizeof(struct monitorbuf) == 128, "2x cache line"); /* * Sets the value of the per-cpu variable name to value val. */ -#define __PCPU_SET(name, val) { \ +#define __PCPU_SET(name, val) do { \ __pcpu_type(name) __val; \ struct __s { \ u_char __b[MIN(sizeof(__pcpu_type(name)), 8)]; \ - } __s; \ + }; \ \ __val = (val); \ if (sizeof(__val) == 1 || sizeof(__val) == 2 || \ sizeof(__val) == 4 || sizeof(__val) == 8) { \ - __s = *(struct __s *)(void *)&__val; \ - __asm __volatile("mov %1,%%gs:%0" \ - : "=m" (*(struct __s *)(__pcpu_offset(name))) \ - : "r" (__s)); \ + __asm __volatile("mov %1,%%gs:%c0" \ + : \ + : "i" (__pcpu_offset(name)), \ + "r" (*(struct __s *)(void *)&__val) \ + : "memory"); \ } else { \ *__PCPU_PTR(name) = __val; \ } \ -} +} while (0) #define get_pcpu() __extension__ ({ \ struct pcpu *__pc; \ \ - __asm __volatile("movq %%gs:%1,%0" \ + __asm __volatile("movq %%gs:%c1,%0" \ : "=r" (__pc) \ - : "m" (*(struct pcpu *)(__pcpu_offset(pc_prvspace)))); \ + : "i" (__pcpu_offset(pc_prvspace))); \ __pc; \ }) #endif /* !__SEG_GS */ diff --git a/sys/amd64/include/pcpu_aux.h b/sys/amd64/include/pcpu_aux.h index 9d776274a57d..6e27162e1fb4 100644 --- a/sys/amd64/include/pcpu_aux.h +++ b/sys/amd64/include/pcpu_aux.h @@ -54,8 +54,8 @@ __curthread(void) { struct thread *td; - __asm("movq %%gs:%P1,%0" : "=r" (td) : "n" (offsetof(struct pcpu, - pc_curthread))); + __asm("movq %%gs:%c1,%0" : "=r" (td) + : "i" (offsetof(struct pcpu, pc_curthread))); return (td); } #define curthread (__curthread()) From nobody Wed Jul 3 16:14:58 2024 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 4WDlH72MFMz5PfP5; Wed, 03 Jul 2024 16:14: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WDlH6535dz4BGS; Wed, 3 Jul 2024 16:14:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720023298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EzpotoaBDaXX/NiPgngm9aaVDcRt+XOz43zLNA33uVs=; b=mfSuyvZoQ3lRXby4Z589QTj3A0i2NqzTA3LcC/CL9XdD7IRokJ3vuHXjkBmYZqFhu9qCBO 2UsajROz9/Jq3BV8btZg3Q8BW0dJtzKvZr5QW1emYrHM5yh6uAEy1ScmKU6Daym3OiDvVt rSfS0+K6r3xePK6d0qY2x0Um11iSx6DSP3g4uh3/Lt3klkn+MrJhQSUgm5ev4hqwLoxkuZ Ruio5o6efaw+o17XNky1B+eDAfPbvlQbv/0DT5TntnJJVzFFAYsH9aK/2WDv+p6/uEYTmU pOIw9W74GxJqsQqz+rJ3KX5xbU4Y3snCSy2NNqw0wKIXlQpw7GA7RsUUgkS37w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720023298; a=rsa-sha256; cv=none; b=IA4tVdfA7g9i4TA4AM88FDCbJjCiRgxy9eiF27XDopuhn7zaHLmeGNrEBhOy7s7noFD7JT Rd4QVt8Q7n0eITJLELJenKl1KD/D+d9CzI2ZqE2/B9SoIKH36WtbqDgYSWMxY628yEQqGN tOTSrWSDTPrccMSwlD/SoYs909ISB6H7xWLdzKBbrmdXuINFvit0ncCTrE145TZNYNPgYA lR7VHuwe/9h/tSrEV30phORkcs6++pihxM/mjR/do5H5QAcfdAzkmNfW+D3TZtC1pl1yFh AsKB9TMO/4MRW8AMHCKz4u70DfPciNFl0CsHY3uEg7qapmxhejTc4jzj1mziCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720023298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EzpotoaBDaXX/NiPgngm9aaVDcRt+XOz43zLNA33uVs=; b=pdlYKIF7SsYA8mB43DPhZm07s2xEBhDR5pI2MrDJi2NmvO0Mok/MMNKkYbyCrkpirlJsXM VmcREKCN6Eps6kmmHCh6ABZWGx4m2ba54oSPcVUFTAVvDgGnhuIuT0alYhncCqgRiDLI27 RUteefTYXQiSyL7i2vYyR0m+x79sqw3X0n68sfARBQ9BfxwSO1BDPWa/e3PjQE92vF7a6H TgWDKww+MXkQNnW1pk8TA/nS3IcsE9/TI65sFhHJB4WQ5ILUuj3rnMDUxDcSKty7dyaOGb UZqrYn3wDpRDOcGumACsFprbqCl4dQYsaWGSr67e4UcWS1XV90nD/jO1a9O2aQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WDlH64Z6KzfCK; Wed, 3 Jul 2024 16:14:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 463GEwOT041622; Wed, 3 Jul 2024 16:14:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 463GEwuc041619; Wed, 3 Jul 2024 16:14:58 GMT (envelope-from git) Date: Wed, 3 Jul 2024 16:14:58 GMT Message-Id: <202407031614.463GEwuc041619@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 657b1276ad4c - main - libthr _get_curthread amd64: quiet gcc -Warray-bounds 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 657b1276ad4c2d2d92ce9d13b338349c0fa40dc3 Auto-Submitted: auto-generated The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=657b1276ad4c2d2d92ce9d13b338349c0fa40dc3 commit 657b1276ad4c2d2d92ce9d13b338349c0fa40dc3 Author: Ryan Libby AuthorDate: 2024-07-03 15:37:11 +0000 Commit: Ryan Libby CommitDate: 2024-07-03 15:37:11 +0000 libthr _get_curthread amd64: quiet gcc -Warray-bounds Use a constant input operand instead of a bogus memory reference to tell the compiler about offsetof(struct tcb, tcb_thread) in the fs segment. Otherwise gcc complains if we tell it we are reading memory offset 0x10. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D45828 --- lib/libthr/arch/amd64/include/pthread_md.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libthr/arch/amd64/include/pthread_md.h b/lib/libthr/arch/amd64/include/pthread_md.h index f43578a8241a..995f35cb569c 100644 --- a/lib/libthr/arch/amd64/include/pthread_md.h +++ b/lib/libthr/arch/amd64/include/pthread_md.h @@ -47,8 +47,8 @@ _get_curthread(void) { struct pthread *thr; - __asm __volatile("movq %%fs:%1, %0" : "=r" (thr) - : "m" (*(volatile u_long *)offsetof(struct tcb, tcb_thread))); + __asm __volatile("movq %%fs:%c1, %0" : "=r" (thr) + : "i" (offsetof(struct tcb, tcb_thread))); return (thr); } From nobody Wed Jul 3 16:14:59 2024 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 4WDlH81KdZz5PfCd; Wed, 03 Jul 2024 16:15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WDlH76Z7jz4Bfm; Wed, 3 Jul 2024 16:14:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720023299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/ac5Npg96yq5Ga+Qutirabfb1fgs6NuxSGSaSkYazl0=; b=Ryf5XnmwfswmHzN4GPUWDQ2ZmejuhfbF+BkVz9PX0X2pfdlnq1ZgReJOiMheRP5QrtzLBm ceYcATEMiuU09Quu5WhfEHmiGTQYUQoRxxr0rytgn3O0K7ObJ7ASjbaNJiRw/KZ0LI6+pf 5XQCBntu6AN9NGvM9B5GgbGMTUe8GsGBhcFFQp7p91oD5cksYqDES/xuBo2dAeYT+Uxhs/ y0kegXdTpxKKQIsZUNHJ5vaBOwwrjb+F9dziBuwerrhI6Za5fSiVKamK/hXqU1h4V5HeZW tALL9STN4WkuZvu6wPVc4b9AkNWFwFrYBskFbdMKBAdF39Pp7ybGMQyVE16+Cg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720023299; a=rsa-sha256; cv=none; b=RoCOLar3FGVf+gVlASfLvAiBwSTeILBQiAaNq93rLp6tV0RNZy+VozJRDGhUd2UTX8it28 UmkcjPk7ct1v/K27QWwizKfuLJBfrPKihf3oscKqBUBDITSNlWSFvnkJRcoDELh9mqMEd4 kDUJPp+Nqj2yymkrdyTCgijtKmVvohmY0QY5QJpwR56+wsajMdbk0gtxZDtDTP4YUiD9d0 OOmwCF87NSYFWwmef7N0Ns/uxw2aQ5iUFdH+Ycs9ArlkYhWlOVr5M6rUCJY3flZBOKvlZR xQ/D9xVbqQnz5TYDWtuHnvyeOX4eJ1cyZHhyqZS1uSbBH9CSnvoaSNvImLZ7vQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720023299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/ac5Npg96yq5Ga+Qutirabfb1fgs6NuxSGSaSkYazl0=; b=sEBALle8pqXPwKDh4UxErrPK2un2srq0xxWhQEvt7FBVuw5dZLpNCJNlAAdDlGSbsPGCY0 OeAqbXeehS3NfxX2V64qFi1lfPwwwYSwOeVSfJcc/ijHuYDKJcZyGgfg9mW0VHStJD9bt4 XmnA1owQ0OOVwy6OL13cRcngo45tLkOIgdyRy4fpDI8ou6uB1ZnwuZDtaF4ffJYnoaUt/m D81MZzIjXlbbb34nhTFzvsy6n5lJmuvoQQAkQeEsl8Xramk3jym38xmh5KzmJbsWWhlJZL kqHPXE0nkWQ3Nw3WgORmO+vIgz1w34/ouX5VQ+v9Q8vKgTZqHL0fBCYdbq/KtQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WDlH76BFMzf2v; Wed, 3 Jul 2024 16:14:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 463GExWd041669; Wed, 3 Jul 2024 16:14:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 463GExw5041666; Wed, 3 Jul 2024 16:14:59 GMT (envelope-from git) Date: Wed, 3 Jul 2024 16:14:59 GMT Message-Id: <202407031614.463GExw5041666@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 7b1c770341fe - main - libthr _get_curthread i386: quiet gcc -Warray-bounds 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b1c770341fe96236772ce3d475e14988833a988 Auto-Submitted: auto-generated The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=7b1c770341fe96236772ce3d475e14988833a988 commit 7b1c770341fe96236772ce3d475e14988833a988 Author: Ryan Libby AuthorDate: 2024-07-03 15:37:44 +0000 Commit: Ryan Libby CommitDate: 2024-07-03 15:37:44 +0000 libthr _get_curthread i386: quiet gcc -Warray-bounds Use a constant input operand instead of a bogus memory reference to tell the compiler about offsetof(struct tcb, tcb_thread) in the gs segment. Otherwise gcc complains if we tell it we are reading memory offset 0x8. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D45829 --- lib/libthr/arch/i386/include/pthread_md.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libthr/arch/i386/include/pthread_md.h b/lib/libthr/arch/i386/include/pthread_md.h index 021ce8126909..9008a4f11bdb 100644 --- a/lib/libthr/arch/i386/include/pthread_md.h +++ b/lib/libthr/arch/i386/include/pthread_md.h @@ -47,8 +47,8 @@ _get_curthread(void) { struct pthread *thr; - __asm __volatile("movl %%gs:%1, %0" : "=r" (thr) - : "m" (*(volatile u_int *)offsetof(struct tcb, tcb_thread))); + __asm __volatile("movl %%gs:%c1, %0" : "=r" (thr) + : "i" (offsetof(struct tcb, tcb_thread))); return (thr); } From nobody Wed Jul 3 16:15:00 2024 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 4WDlH92mXRz5PfFv; Wed, 03 Jul 2024 16:15:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WDlH90B8jz4BGw; Wed, 3 Jul 2024 16:15:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720023301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/Et3DHQjws9uPG1HuU0NqolB0kL3oNdhxJw6LGXR+co=; b=oJK1SD6hFUMB3XUs70WsNGhVr8YXLT/Z6yqMN5u96bdqvDJKog6KSDDSi4b0aAdTImgoI4 Z7BEWLR4fq9vLjW2fL12rLDh6lrXkZN7EePeoLY4NW6h9gczi69U97zPCrXqZ6ozQHBg/5 2N8Z97AB5IgZZSLXCoDLgXlukSAJ/Tir7Pqr/uVw6bdZJ0Xo5AKwiGzM3+fCfQCDnhY87D JhoGYtLFqM80iCzl70fwW3kr+gqjuxvJojsgN69SoBEfIZZbM7RJd464EYXDpuICFmEwMX PmTT04oBj7sAIEcBMs46cC3NNYpdNTBrLAyD7+Vhva/PEVe8lCFN+l9I55Dvsg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720023301; a=rsa-sha256; cv=none; b=KCcnxV4m71XOXQt5Jmjz2oKDw+d/VNMSMF+CuQzDc1z7aQ9tCRdqQgBxDVPRa5Y1CDHwC+ WdRe2VNelGBLbZgGKFhtX4fF+bKPCNyC7MNKtiDf79Rf5MMB7Z/g/7XurGYrJRXiz6K6G1 IpMP44RRVd0fPGMmf51PurCku9y0g+RK9LLaU19ISHGKqyBlTuAprnHYzKp56AmAt+giUv WTefB1SkcDH3g+gl6Oa2wLoFiikqcLH5qi+lOS7BZjKddOpm8ErQ3BQRuTdcGtq0WqAG1r taRQjotzOdJtbw3+aLqwRr7KupJ2IerndyxpYQZMjTrg6KXYnCxHBiCwGfqH4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720023301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/Et3DHQjws9uPG1HuU0NqolB0kL3oNdhxJw6LGXR+co=; b=yyjFkMZIlomvu2uXETWxdWnRzTN78t8Ewieh/oVYWOhhJWo/Ahi/jRrfTmG0gHOlrSZefj dRcFA2kpQpIjVrs/qncnx+8OcrTOmRcJJPyOcfF3oD6ctgcRhmr1uEiPQXmEI6g88B81d4 ADPBONxp2YD7YSUCRdc53XtcMjEn6rXdGXS398y0x0fkZ5GkXIyVRAul3JnTVv424WTGI/ aDUCF+yixX1Yvow9XNlu2DDl3uqLnlj/lBA2a2oyvNejDbsQ4ZEpOpUee6zUynmPQj+Foa IJotWYQ5tmbuDdreQgVGpvvuyxMv4nn9Fy7dxhZyV7dJH45PBFkPCL+YUHbYQg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WDlH86rpKzdvq; Wed, 3 Jul 2024 16:15:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 463GF0qN041724; Wed, 3 Jul 2024 16:15:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 463GF0hW041721; Wed, 3 Jul 2024 16:15:00 GMT (envelope-from git) Date: Wed, 3 Jul 2024 16:15:00 GMT Message-Id: <202407031615.463GF0hW041721@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 07d359787f0d - main - libthr: avoid gcc -Wcast-function-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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 07d359787f0d7f8e5682a3d1991ef68711fb94d1 Auto-Submitted: auto-generated The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=07d359787f0d7f8e5682a3d1991ef68711fb94d1 commit 07d359787f0d7f8e5682a3d1991ef68711fb94d1 Author: Ryan Libby AuthorDate: 2024-07-03 15:38:32 +0000 Commit: Ryan Libby CommitDate: 2024-07-03 15:38:32 +0000 libthr: avoid gcc -Wcast-function-type The actual types of pthread_func_t and interpos_func_t are not used. Declare them as the generic void (*)(void) which suppresses warnings. https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wcast-function-type Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D45830 --- lib/libc/include/libc_private.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index 2b16ce736e3a..4d4779647f50 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -190,7 +190,7 @@ typedef enum { PJT_MAX } pjt_index_t; -typedef int (*pthread_func_t)(void); +typedef void (*pthread_func_t)(void); typedef pthread_func_t pthread_func_entry_t[2]; extern pthread_func_entry_t __thr_jtable[]; @@ -199,7 +199,7 @@ void __set_error_selector(int *(*arg)(void)); int _pthread_mutex_init_calloc_cb_stub(pthread_mutex_t *mutex, void *(calloc_cb)(__size_t, __size_t)); -typedef int (*interpos_func_t)(void); +typedef void (*interpos_func_t)(void); interpos_func_t *__libc_interposing_slot(int interposno); extern interpos_func_t __libc_interposing[] __hidden; interpos_func_t *__libsys_interposing_slot(int interposno); From nobody Wed Jul 3 17:34:45 2024 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 4WDn395thLz5Ppyl; Wed, 03 Jul 2024 17:34: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WDn395BRbz4Mb2; Wed, 3 Jul 2024 17:34:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720028085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+fXZtf9f803BUWmVX9Bouv05loH8iD0bi66dwLDqx+o=; b=B/vL48w0Q5qa3L7UqgAsZXBqlsDrexwYbfcMjUtkTM9f1aIzgvmc9WDgSN+FqqQRi6mn6x 7NyBFu3Q9Hhm//yTzXoFaFeaow1Ji5tSbBtTttSYm+ZEOqL6vLRw/nqwlHJ0ZssAfcOhT+ QYm8BnSIDtTxdtcZm+woOMr04eJZv+daLMqSWXsWk+7uqJ2ZR0CMJ2Tp+DSNv4PxqDFqJw n0PsTIC7mbClhf+exqOPTb8uceZ4jduoAoiEji558SRE5eT2ahOuGTH8cvK1qJpg/iD11X 5eSYrlQczXrbcMsQe9k1tBUZRMbq28AAvx0vpjXpyx/Z4NC1RHAd7y+FfLfxsg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720028085; a=rsa-sha256; cv=none; b=t7801SKha47NLitB0zAxAOsC9ff2IcgaG+P17FBdQYyOaDRsBvUNyeMOGIqNRwkag4WOO1 zsZ08NPkPNfNIJ3qlbu9+RZ7zsaF62/IAqO8bmwTLgmnMRsOQL67UPIRBHVxMlGs5gh/1d tc9GeEUxFXnN+FD81qnzh5eK75NmgYE31/s/BfdvTF7NMD9i3kEj32DFQ5tPvP5MtLhhIg ahMiCuCNWdpv1+1Rk3iFnDIF26vRY6k5a7CxnOlXAZrvq4CsccifM66rnuNBd2IOzKQgWr V/Yd4tXP9wsAz7kKU1Itwoys82rM9h64S7pt8/9/Wz4brlmftHKhtDjzXDlrxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720028085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+fXZtf9f803BUWmVX9Bouv05loH8iD0bi66dwLDqx+o=; b=Eqb+x3OUYDJ97m0ySV8dibX12/TkZZigCGf3Gh60rbW+pEDVsHuK9ply6/Nj0PBBLINjs/ i33l27E8c2OQtjxh1efv/Awr5MtS6SXL4DtTgMig/TQNPIwYannundrGSnezaWPCA2qZSo bzrBSdWDopamDs3rJQ5TVnMyR2+lDy37wtm0TMcTaivIJkcYpr3QsZh98Fq+VDmqverfG4 n/zNy3m6BN1aIbVEZInXe6Ym++sK2zBviQEmGPvwk94QMCy5+KihwLuykCS+VDnyAWZczH n90qgbeIdNUQKQ1V8kbwJxG3vF88sOwTD7zBLgT73jUNCDS5hoAYrmPMTp+whg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WDn394gsnzh6X; Wed, 3 Jul 2024 17:34:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 463HYj4d076802; Wed, 3 Jul 2024 17:34:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 463HYjV8076799; Wed, 3 Jul 2024 17:34:45 GMT (envelope-from git) Date: Wed, 3 Jul 2024 17:34:45 GMT Message-Id: <202407031734.463HYjV8076799@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 25ef056f74e4 - main - ofed: fix rwq buffer allocation 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 25ef056f74e40429df6bcbc31d52888b57ff3e2c Auto-Submitted: auto-generated The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=25ef056f74e40429df6bcbc31d52888b57ff3e2c commit 25ef056f74e40429df6bcbc31d52888b57ff3e2c Author: Ka Ho Ng AuthorDate: 2024-07-03 17:32:06 +0000 Commit: Ka Ho Ng CommitDate: 2024-07-03 17:32:44 +0000 ofed: fix rwq buffer allocation Fixes a wrong rwq->buf_size assignment. The field was assigned 0 upon a successful call to ibv_init_wq. Fixes: a687910fc435 Sponsored by: Juniper Networks, Inc. MFC after: 1 week Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D45833 --- contrib/ofed/libmlx5/verbs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/ofed/libmlx5/verbs.c b/contrib/ofed/libmlx5/verbs.c index 766751041050..6c296bb69f6f 100644 --- a/contrib/ofed/libmlx5/verbs.c +++ b/contrib/ofed/libmlx5/verbs.c @@ -2077,6 +2077,10 @@ struct ibv_wq *mlx5_create_wq(struct ibv_context *context, if (!rwq) return NULL; + ret = ibv_init_wq(&rwq->wq); + if (ret < 0) + goto err; + rwq->wq_sig = rwq_sig_enabled(context); if (rwq->wq_sig) cmd.drv.flags = MLX5_RWQ_FLAG_SIGNATURE; @@ -2084,13 +2088,9 @@ struct ibv_wq *mlx5_create_wq(struct ibv_context *context, ret = mlx5_calc_rwq_size(ctx, rwq, attr); if (ret < 0) { errno = -ret; - goto err; + goto err_cleanup_wq; } - ret = ibv_init_wq(&rwq->wq); - if (ret < 0) - goto err; - rwq->buf_size = ret; if (mlx5_alloc_rwq_buf(context, rwq, ret)) goto err_cleanup_wq; From nobody Wed Jul 3 18:26:47 2024 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 4WDpCC1q28z5PwfC; Wed, 03 Jul 2024 18:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WDpCC1JW4z4SHS; Wed, 3 Jul 2024 18:26:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720031207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0HpyfAb/Z7cN9FEtT62rOQKfUMPnQq/EqXQoCViCBSo=; b=V7r1jgjjNwaQK3Ueyr4dVye6hGXCgOZWayBafnw18r1DQrGUFgnPwVde4MQytOUTwSbiIe hmL80ronRDSXowT4dhOxNijy5aEJGRfgvENkhSXl7I6Y0IGneRM5Qo4CAhutotgcQiFbs1 SSlDmqWBm4BpDWEQrjdUqY7HxwZpOSrdWxMX+SIM++PYsxG4CzQzhx2UUE+ccVuc+bZtOe xQLATnwuDENDqIwM5CGqOuSDcWk2hv5IOLNAgYXidQlydg6RyFgQE9GxIFwyjqyK+aaHB4 tJUum0IoX1uC9qn6/4dhSiGmkzdWBBQDPre8mO9PqabeDQiS9rdAYdB28lanBQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720031207; a=rsa-sha256; cv=none; b=JoXj/y2tPU807Y13Xcpwu1/LweC7+KIUMetV2FgAC6cEMYbHcdDc1KFybAiOVMqrf6Fk36 Fx+8ZWBC7L9x/pA6l5MgBPF+fGr3eDdOeRE+/wTXVaTzvD1GTfjletAcIOSaW9yufvRjy5 tvvnjlYFfBb+bwwtEGqF+QCfR4YF7vwT7l/Dhq0ejXXJbzHFobrncmkTfiItfud0bNlM7e 36lidlkbCM7iemPd5rI5gRQnWJfz7eQFoVJi5BOSbjOJVPICG8CiuHKDTGV07blytWn+oa 0KtYJlE39iJUyY+iIDHSDVPW7qfxLDZTwkrCknxgocIlG57IuctpBA93FT6CBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720031207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0HpyfAb/Z7cN9FEtT62rOQKfUMPnQq/EqXQoCViCBSo=; b=pcpkYyEMiOdskDxksiDDPlT8iH3T/GCcL5fnunQe4uQIXRbmrBE9yOTrUlv+57/2tN2h7O NaE/PSMdydng2ZZMuUWAvzuEJXaeLwOk8aRM/0b7Y0wtsyw2m6YoR+v4eaC+Uv1SInKRFd Rnyb3c830q88HuvpbJhzJScAqY93TKXUPUxO0RQdqs2dGN7gmnFcaToHAW5pL7iHkdaE5Z GfwelDwDf8dlBj8fx60D4DSBKKE+wzxqpVXm3pJyaOkkR3q46Th3E2BFT5FTpNOMBEfafn 2WKqHtA/Fy4JQc0LvlfjTujO75kno9zA3aLarT3CnzMX/U+vwIWOjnJowRpixA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WDpCC0v2gzj6R; Wed, 3 Jul 2024 18:26:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 463IQl5K061672; Wed, 3 Jul 2024 18:26:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 463IQl6g061669; Wed, 3 Jul 2024 18:26:47 GMT (envelope-from git) Date: Wed, 3 Jul 2024 18:26:47 GMT Message-Id: <202407031826.463IQl6g061669@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: 94416c6939f4 - main - openssh: use '' instead of `' in config.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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 94416c6939f431b29286a71bb2797e749df9645c Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=94416c6939f431b29286a71bb2797e749df9645c commit 94416c6939f431b29286a71bb2797e749df9645c Author: Ed Maste AuthorDate: 2024-07-01 14:45:43 +0000 Commit: Ed Maste CommitDate: 2024-07-03 18:22:50 +0000 openssh: use '' instead of `' in config.h Autoconf 2.72 uses '' rather tha `' in comments in config.h, from autoconf commit 64df9b4523fe ("Autoconf now quotes 'like this' instead of `like this'"). Switch quoting style now to minimize diffs on the next OpenSSH update and config.h regen. Reviewed by: gordon, philip Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45840 --- crypto/openssh/config.h | 614 ++++++++++++++++++++++++------------------------ 1 file changed, 307 insertions(+), 307 deletions(-) diff --git a/crypto/openssh/config.h b/crypto/openssh/config.h index 5e7e93992829..6462ff16d8d9 100644 --- a/crypto/openssh/config.h +++ b/crypto/openssh/config.h @@ -196,19 +196,19 @@ /* Define if you have ut_addr_v6 in utmpx.h */ /* #undef HAVE_ADDR_V6_IN_UTMPX */ -/* Define to 1 if you have the `arc4random' function. */ +/* Define to 1 if you have the 'arc4random' function. */ #define HAVE_ARC4RANDOM 1 -/* Define to 1 if you have the `arc4random_buf' function. */ +/* Define to 1 if you have the 'arc4random_buf' function. */ #define HAVE_ARC4RANDOM_BUF 1 -/* Define to 1 if you have the `arc4random_stir' function. */ +/* Define to 1 if you have the 'arc4random_stir' function. */ /* #undef HAVE_ARC4RANDOM_STIR */ -/* Define to 1 if you have the `arc4random_uniform' function. */ +/* Define to 1 if you have the 'arc4random_uniform' function. */ #define HAVE_ARC4RANDOM_UNIFORM 1 -/* Define to 1 if you have the `asprintf' function. */ +/* Define to 1 if you have the 'asprintf' function. */ #define HAVE_ASPRINTF 1 /* OpenBSD's gcc has bounded */ @@ -220,52 +220,52 @@ /* OpenBSD's gcc has sentinel */ /* #undef HAVE_ATTRIBUTE__SENTINEL__ */ -/* Define to 1 if you have the `aug_get_machine' function. */ +/* Define to 1 if you have the 'aug_get_machine' function. */ /* #undef HAVE_AUG_GET_MACHINE */ -/* Define to 1 if you have the `auth_hostok' function. */ +/* Define to 1 if you have the 'auth_hostok' function. */ #define HAVE_AUTH_HOSTOK 1 -/* Define to 1 if you have the `auth_timeok' function. */ +/* Define to 1 if you have the 'auth_timeok' function. */ #define HAVE_AUTH_TIMEOK 1 -/* Define to 1 if you have the `b64_ntop' function. */ +/* Define to 1 if you have the 'b64_ntop' function. */ /* #undef HAVE_B64_NTOP */ -/* Define to 1 if you have the `b64_pton' function. */ +/* Define to 1 if you have the 'b64_pton' function. */ /* #undef HAVE_B64_PTON */ /* Define if you have the basename function. */ #define HAVE_BASENAME 1 -/* Define to 1 if you have the `bcopy' function. */ +/* Define to 1 if you have the 'bcopy' function. */ #define HAVE_BCOPY 1 -/* Define to 1 if you have the `bcrypt_pbkdf' function. */ +/* Define to 1 if you have the 'bcrypt_pbkdf' function. */ /* #undef HAVE_BCRYPT_PBKDF */ -/* Define to 1 if you have the `bindresvport_sa' function. */ +/* Define to 1 if you have the 'bindresvport_sa' function. */ #define HAVE_BINDRESVPORT_SA 1 -/* Define to 1 if you have the `blf_enc' function. */ +/* Define to 1 if you have the 'blf_enc' function. */ /* #undef HAVE_BLF_ENC */ /* Define to 1 if you have the header file. */ /* #undef HAVE_BLF_H */ -/* Define to 1 if you have the `Blowfish_expand0state' function. */ +/* Define to 1 if you have the 'Blowfish_expand0state' function. */ /* #undef HAVE_BLOWFISH_EXPAND0STATE */ -/* Define to 1 if you have the `Blowfish_expandstate' function. */ +/* Define to 1 if you have the 'Blowfish_expandstate' function. */ /* #undef HAVE_BLOWFISH_EXPANDSTATE */ -/* Define to 1 if you have the `Blowfish_initstate' function. */ +/* Define to 1 if you have the 'Blowfish_initstate' function. */ /* #undef HAVE_BLOWFISH_INITSTATE */ -/* Define to 1 if you have the `Blowfish_stream2word' function. */ +/* Define to 1 if you have the 'Blowfish_stream2word' function. */ /* #undef HAVE_BLOWFISH_STREAM2WORD */ -/* Define to 1 if you have the `BN_is_prime_ex' function. */ +/* Define to 1 if you have the 'BN_is_prime_ex' function. */ #define HAVE_BN_IS_PRIME_EX 1 /* Define to 1 if you have the header file. */ @@ -277,7 +277,7 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_BSTRING_H */ -/* Define to 1 if you have the `bzero' function. */ +/* Define to 1 if you have the 'bzero' function. */ #define HAVE_BZERO 1 /* calloc(0, x) returns NULL */ @@ -289,10 +289,10 @@ /* Define to 1 if you have the header file. */ #define HAVE_CAPSICUM_HELPERS_H 1 -/* Define to 1 if you have the `cap_rights_limit' function. */ +/* Define to 1 if you have the 'cap_rights_limit' function. */ #define HAVE_CAP_RIGHTS_LIMIT 1 -/* Define to 1 if you have the `clock' function. */ +/* Define to 1 if you have the 'clock' function. */ #define HAVE_CLOCK 1 /* Have clock_gettime */ @@ -301,10 +301,10 @@ /* define if you have clock_t data type */ #define HAVE_CLOCK_T 1 -/* Define to 1 if you have the `closefrom' function. */ +/* Define to 1 if you have the 'closefrom' function. */ #define HAVE_CLOSEFROM 1 -/* Define to 1 if you have the `close_range' function. */ +/* Define to 1 if you have the 'close_range' function. */ #define HAVE_CLOSE_RANGE 1 /* Define if gai_strerror() returns const char * */ @@ -313,7 +313,7 @@ /* Define if your system uses ancillary data style file descriptor passing */ #define HAVE_CONTROL_IN_MSGHDR 1 -/* Define to 1 if you have the `crypt' function. */ +/* Define to 1 if you have the 'crypt' function. */ #define HAVE_CRYPT 1 /* Define to 1 if you have the header file. */ @@ -328,111 +328,111 @@ /* Define if your libraries define daemon() */ #define HAVE_DAEMON 1 -/* Define to 1 if you have the declaration of `AI_NUMERICSERV', and to 0 if +/* Define to 1 if you have the declaration of 'AI_NUMERICSERV', and to 0 if you don't. */ #define HAVE_DECL_AI_NUMERICSERV 1 -/* Define to 1 if you have the declaration of `authenticate', and to 0 if you +/* Define to 1 if you have the declaration of 'authenticate', and to 0 if you don't. */ /* #undef HAVE_DECL_AUTHENTICATE */ -/* Define to 1 if you have the declaration of `bzero', and to 0 if you don't. +/* Define to 1 if you have the declaration of 'bzero', and to 0 if you don't. */ #define HAVE_DECL_BZERO 1 -/* Define to 1 if you have the declaration of `ftruncate', and to 0 if you +/* Define to 1 if you have the declaration of 'ftruncate', and to 0 if you don't. */ #define HAVE_DECL_FTRUNCATE 1 -/* Define to 1 if you have the declaration of `getentropy', and to 0 if you +/* Define to 1 if you have the declaration of 'getentropy', and to 0 if you don't. */ #define HAVE_DECL_GETENTROPY 1 -/* Define to 1 if you have the declaration of `getpeereid', and to 0 if you +/* Define to 1 if you have the declaration of 'getpeereid', and to 0 if you don't. */ #define HAVE_DECL_GETPEEREID 1 -/* Define to 1 if you have the declaration of `GLOB_NOMATCH', and to 0 if you +/* Define to 1 if you have the declaration of 'GLOB_NOMATCH', and to 0 if you don't. */ #define HAVE_DECL_GLOB_NOMATCH 1 -/* Define to 1 if you have the declaration of `GSS_C_NT_HOSTBASED_SERVICE', +/* Define to 1 if you have the declaration of 'GSS_C_NT_HOSTBASED_SERVICE', and to 0 if you don't. */ /* #undef HAVE_DECL_GSS_C_NT_HOSTBASED_SERVICE */ -/* Define to 1 if you have the declaration of `howmany', and to 0 if you +/* Define to 1 if you have the declaration of 'howmany', and to 0 if you don't. */ #define HAVE_DECL_HOWMANY 1 -/* Define to 1 if you have the declaration of `h_errno', and to 0 if you +/* Define to 1 if you have the declaration of 'h_errno', and to 0 if you don't. */ #define HAVE_DECL_H_ERRNO 1 -/* Define to 1 if you have the declaration of `loginfailed', and to 0 if you +/* Define to 1 if you have the declaration of 'loginfailed', and to 0 if you don't. */ /* #undef HAVE_DECL_LOGINFAILED */ -/* Define to 1 if you have the declaration of `loginrestrictions', and to 0 if +/* Define to 1 if you have the declaration of 'loginrestrictions', and to 0 if you don't. */ /* #undef HAVE_DECL_LOGINRESTRICTIONS */ -/* Define to 1 if you have the declaration of `loginsuccess', and to 0 if you +/* Define to 1 if you have the declaration of 'loginsuccess', and to 0 if you don't. */ /* #undef HAVE_DECL_LOGINSUCCESS */ -/* Define to 1 if you have the declaration of `MAXSYMLINKS', and to 0 if you +/* Define to 1 if you have the declaration of 'MAXSYMLINKS', and to 0 if you don't. */ #define HAVE_DECL_MAXSYMLINKS 1 -/* Define to 1 if you have the declaration of `memmem', and to 0 if you don't. +/* Define to 1 if you have the declaration of 'memmem', and to 0 if you don't. */ #define HAVE_DECL_MEMMEM 1 -/* Define to 1 if you have the declaration of `NFDBITS', and to 0 if you +/* Define to 1 if you have the declaration of 'NFDBITS', and to 0 if you don't. */ #define HAVE_DECL_NFDBITS 1 -/* Define to 1 if you have the declaration of `offsetof', and to 0 if you +/* Define to 1 if you have the declaration of 'offsetof', and to 0 if you don't. */ #define HAVE_DECL_OFFSETOF 1 -/* Define to 1 if you have the declaration of `O_NONBLOCK', and to 0 if you +/* Define to 1 if you have the declaration of 'O_NONBLOCK', and to 0 if you don't. */ #define HAVE_DECL_O_NONBLOCK 1 -/* Define to 1 if you have the declaration of `passwdexpired', and to 0 if you +/* Define to 1 if you have the declaration of 'passwdexpired', and to 0 if you don't. */ /* #undef HAVE_DECL_PASSWDEXPIRED */ -/* Define to 1 if you have the declaration of `readv', and to 0 if you don't. +/* Define to 1 if you have the declaration of 'readv', and to 0 if you don't. */ #define HAVE_DECL_READV 1 -/* Define to 1 if you have the declaration of `setauthdb', and to 0 if you +/* Define to 1 if you have the declaration of 'setauthdb', and to 0 if you don't. */ /* #undef HAVE_DECL_SETAUTHDB */ -/* Define to 1 if you have the declaration of `SHUT_RD', and to 0 if you +/* Define to 1 if you have the declaration of 'SHUT_RD', and to 0 if you don't. */ #define HAVE_DECL_SHUT_RD 1 -/* Define to 1 if you have the declaration of `UINT32_MAX', and to 0 if you +/* Define to 1 if you have the declaration of 'UINT32_MAX', and to 0 if you don't. */ #define HAVE_DECL_UINT32_MAX 1 -/* Define to 1 if you have the declaration of `writev', and to 0 if you don't. +/* Define to 1 if you have the declaration of 'writev', and to 0 if you don't. */ #define HAVE_DECL_WRITEV 1 -/* Define to 1 if you have the declaration of `_getlong', and to 0 if you +/* Define to 1 if you have the declaration of '_getlong', and to 0 if you don't. */ #define HAVE_DECL__GETLONG 0 -/* Define to 1 if you have the declaration of `_getshort', and to 0 if you +/* Define to 1 if you have the declaration of '_getshort', and to 0 if you don't. */ #define HAVE_DECL__GETSHORT 0 -/* Define to 1 if you have the `DES_crypt' function. */ +/* Define to 1 if you have the 'DES_crypt' function. */ #define HAVE_DES_CRYPT 1 /* Define if you have /dev/ptmx */ @@ -444,40 +444,40 @@ /* Define to 1 if you have the header file. */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dirfd' function. */ +/* Define to 1 if you have the 'dirfd' function. */ #define HAVE_DIRFD 1 -/* Define to 1 if you have the `dirname' function. */ +/* Define to 1 if you have the 'dirname' function. */ #define HAVE_DIRNAME 1 -/* Define to 1 if you have the `dlopen' function. */ +/* Define to 1 if you have the 'dlopen' function. */ #define HAVE_DLOPEN 1 -/* Define to 1 if you have the `DSA_generate_parameters_ex' function. */ +/* Define to 1 if you have the 'DSA_generate_parameters_ex' function. */ #define HAVE_DSA_GENERATE_PARAMETERS_EX 1 -/* Define to 1 if you have the `EC_KEY_METHOD_new' function. */ +/* Define to 1 if you have the 'EC_KEY_METHOD_new' function. */ #define HAVE_EC_KEY_METHOD_NEW 1 /* Define to 1 if you have the header file. */ #define HAVE_ELF_H 1 -/* Define to 1 if you have the `endgrent' function. */ +/* Define to 1 if you have the 'endgrent' function. */ #define HAVE_ENDGRENT 1 /* Define to 1 if you have the header file. */ #define HAVE_ENDIAN_H 1 -/* Define to 1 if you have the `endutent' function. */ +/* Define to 1 if you have the 'endutent' function. */ /* #undef HAVE_ENDUTENT */ -/* Define to 1 if you have the `endutxent' function. */ +/* Define to 1 if you have the 'endutxent' function. */ #define HAVE_ENDUTXENT 1 -/* Define to 1 if you have the `err' function. */ +/* Define to 1 if you have the 'err' function. */ #define HAVE_ERR 1 -/* Define to 1 if you have the `errx' function. */ +/* Define to 1 if you have the 'errx' function. */ #define HAVE_ERRX 1 /* Define to 1 if you have the header file. */ @@ -486,73 +486,73 @@ /* Define if your system has /etc/default/login */ /* #undef HAVE_ETC_DEFAULT_LOGIN */ -/* Define to 1 if you have the `EVP_chacha20' function. */ +/* Define to 1 if you have the 'EVP_chacha20' function. */ #define HAVE_EVP_CHACHA20 1 -/* Define to 1 if you have the `EVP_CIPHER_CTX_get_iv' function. */ +/* Define to 1 if you have the 'EVP_CIPHER_CTX_get_iv' function. */ /* #undef HAVE_EVP_CIPHER_CTX_GET_IV */ -/* Define to 1 if you have the `EVP_CIPHER_CTX_get_updated_iv' function. */ +/* Define to 1 if you have the 'EVP_CIPHER_CTX_get_updated_iv' function. */ #define HAVE_EVP_CIPHER_CTX_GET_UPDATED_IV 1 -/* Define to 1 if you have the `EVP_CIPHER_CTX_iv' function. */ +/* Define to 1 if you have the 'EVP_CIPHER_CTX_iv' function. */ #define HAVE_EVP_CIPHER_CTX_IV 1 -/* Define to 1 if you have the `EVP_CIPHER_CTX_iv_noconst' function. */ +/* Define to 1 if you have the 'EVP_CIPHER_CTX_iv_noconst' function. */ #define HAVE_EVP_CIPHER_CTX_IV_NOCONST 1 -/* Define to 1 if you have the `EVP_CIPHER_CTX_set_iv' function. */ +/* Define to 1 if you have the 'EVP_CIPHER_CTX_set_iv' function. */ /* #undef HAVE_EVP_CIPHER_CTX_SET_IV */ -/* Define to 1 if you have the `EVP_DigestFinal_ex' function. */ +/* Define to 1 if you have the 'EVP_DigestFinal_ex' function. */ #define HAVE_EVP_DIGESTFINAL_EX 1 -/* Define to 1 if you have the `EVP_DigestInit_ex' function. */ +/* Define to 1 if you have the 'EVP_DigestInit_ex' function. */ #define HAVE_EVP_DIGESTINIT_EX 1 -/* Define to 1 if you have the `EVP_MD_CTX_cleanup' function. */ +/* Define to 1 if you have the 'EVP_MD_CTX_cleanup' function. */ /* #undef HAVE_EVP_MD_CTX_CLEANUP */ -/* Define to 1 if you have the `EVP_MD_CTX_copy_ex' function. */ +/* Define to 1 if you have the 'EVP_MD_CTX_copy_ex' function. */ #define HAVE_EVP_MD_CTX_COPY_EX 1 -/* Define to 1 if you have the `EVP_MD_CTX_init' function. */ +/* Define to 1 if you have the 'EVP_MD_CTX_init' function. */ /* #undef HAVE_EVP_MD_CTX_INIT */ -/* Define to 1 if you have the `EVP_PKEY_get_raw_private_key' function. */ +/* Define to 1 if you have the 'EVP_PKEY_get_raw_private_key' function. */ #define HAVE_EVP_PKEY_GET_RAW_PRIVATE_KEY 1 -/* Define to 1 if you have the `EVP_PKEY_get_raw_public_key' function. */ +/* Define to 1 if you have the 'EVP_PKEY_get_raw_public_key' function. */ #define HAVE_EVP_PKEY_GET_RAW_PUBLIC_KEY 1 -/* Define to 1 if you have the `EVP_sha256' function. */ +/* Define to 1 if you have the 'EVP_sha256' function. */ #define HAVE_EVP_SHA256 1 -/* Define to 1 if you have the `EVP_sha384' function. */ +/* Define to 1 if you have the 'EVP_sha384' function. */ #define HAVE_EVP_SHA384 1 -/* Define to 1 if you have the `EVP_sha512' function. */ +/* Define to 1 if you have the 'EVP_sha512' function. */ #define HAVE_EVP_SHA512 1 /* Define if you have ut_exit in utmp.h */ /* #undef HAVE_EXIT_IN_UTMP */ -/* Define to 1 if you have the `explicit_bzero' function. */ +/* Define to 1 if you have the 'explicit_bzero' function. */ #define HAVE_EXPLICIT_BZERO 1 -/* Define to 1 if you have the `explicit_memset' function. */ +/* Define to 1 if you have the 'explicit_memset' function. */ /* #undef HAVE_EXPLICIT_MEMSET */ -/* Define to 1 if you have the `fchmod' function. */ +/* Define to 1 if you have the 'fchmod' function. */ #define HAVE_FCHMOD 1 -/* Define to 1 if you have the `fchmodat' function. */ +/* Define to 1 if you have the 'fchmodat' function. */ #define HAVE_FCHMODAT 1 -/* Define to 1 if you have the `fchown' function. */ +/* Define to 1 if you have the 'fchown' function. */ #define HAVE_FCHOWN 1 -/* Define to 1 if you have the `fchownat' function. */ +/* Define to 1 if you have the 'fchownat' function. */ #define HAVE_FCHOWNAT 1 /* Use F_CLOSEM fcntl for closefrom */ @@ -561,109 +561,109 @@ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 -/* Define to 1 if the system has the type `fd_mask'. */ +/* Define to 1 if the system has the type 'fd_mask'. */ #define HAVE_FD_MASK 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_FEATURES_H */ -/* Define to 1 if you have the `fido_assert_set_clientdata' function. */ +/* Define to 1 if you have the 'fido_assert_set_clientdata' function. */ /* #undef HAVE_FIDO_ASSERT_SET_CLIENTDATA */ -/* Define to 1 if you have the `fido_cred_prot' function. */ +/* Define to 1 if you have the 'fido_cred_prot' function. */ /* #undef HAVE_FIDO_CRED_PROT */ -/* Define to 1 if you have the `fido_cred_set_clientdata' function. */ +/* Define to 1 if you have the 'fido_cred_set_clientdata' function. */ /* #undef HAVE_FIDO_CRED_SET_CLIENTDATA */ -/* Define to 1 if you have the `fido_cred_set_prot' function. */ +/* Define to 1 if you have the 'fido_cred_set_prot' function. */ /* #undef HAVE_FIDO_CRED_SET_PROT */ -/* Define to 1 if you have the `fido_dev_get_touch_begin' function. */ +/* Define to 1 if you have the 'fido_dev_get_touch_begin' function. */ /* #undef HAVE_FIDO_DEV_GET_TOUCH_BEGIN */ -/* Define to 1 if you have the `fido_dev_get_touch_status' function. */ +/* Define to 1 if you have the 'fido_dev_get_touch_status' function. */ /* #undef HAVE_FIDO_DEV_GET_TOUCH_STATUS */ -/* Define to 1 if you have the `fido_dev_is_winhello' function. */ +/* Define to 1 if you have the 'fido_dev_is_winhello' function. */ /* #undef HAVE_FIDO_DEV_IS_WINHELLO */ -/* Define to 1 if you have the `fido_dev_supports_cred_prot' function. */ +/* Define to 1 if you have the 'fido_dev_supports_cred_prot' function. */ /* #undef HAVE_FIDO_DEV_SUPPORTS_CRED_PROT */ /* Define to 1 if you have the header file. */ #define HAVE_FLOATINGPOINT_H 1 -/* Define to 1 if you have the `flock' function. */ +/* Define to 1 if you have the 'flock' function. */ #define HAVE_FLOCK 1 -/* Define to 1 if you have the `fmt_scaled' function. */ +/* Define to 1 if you have the 'fmt_scaled' function. */ /* #undef HAVE_FMT_SCALED */ -/* Define to 1 if you have the `fnmatch' function. */ +/* Define to 1 if you have the 'fnmatch' function. */ #define HAVE_FNMATCH 1 /* Define to 1 if you have the header file. */ #define HAVE_FNMATCH_H 1 -/* Define to 1 if you have the `freeaddrinfo' function. */ +/* Define to 1 if you have the 'freeaddrinfo' function. */ #define HAVE_FREEADDRINFO 1 -/* Define to 1 if you have the `freezero' function. */ +/* Define to 1 if you have the 'freezero' function. */ /* #undef HAVE_FREEZERO */ -/* Define to 1 if the system has the type `fsblkcnt_t'. */ +/* Define to 1 if the system has the type 'fsblkcnt_t'. */ #define HAVE_FSBLKCNT_T 1 -/* Define to 1 if the system has the type `fsfilcnt_t'. */ +/* Define to 1 if the system has the type 'fsfilcnt_t'. */ #define HAVE_FSFILCNT_T 1 -/* Define to 1 if you have the `fstatfs' function. */ +/* Define to 1 if you have the 'fstatfs' function. */ #define HAVE_FSTATFS 1 -/* Define to 1 if you have the `fstatvfs' function. */ +/* Define to 1 if you have the 'fstatvfs' function. */ #define HAVE_FSTATVFS 1 -/* Define to 1 if you have the `futimes' function. */ +/* Define to 1 if you have the 'futimes' function. */ #define HAVE_FUTIMES 1 -/* Define to 1 if you have the `gai_strerror' function. */ +/* Define to 1 if you have the 'gai_strerror' function. */ #define HAVE_GAI_STRERROR 1 -/* Define to 1 if you have the `getaddrinfo' function. */ +/* Define to 1 if you have the 'getaddrinfo' function. */ #define HAVE_GETADDRINFO 1 -/* Define to 1 if you have the `getaudit' function. */ +/* Define to 1 if you have the 'getaudit' function. */ /* #undef HAVE_GETAUDIT */ -/* Define to 1 if you have the `getaudit_addr' function. */ +/* Define to 1 if you have the 'getaudit_addr' function. */ /* #undef HAVE_GETAUDIT_ADDR */ -/* Define to 1 if you have the `getcwd' function. */ +/* Define to 1 if you have the 'getcwd' function. */ #define HAVE_GETCWD 1 -/* Define to 1 if you have the `getentropy' function. */ +/* Define to 1 if you have the 'getentropy' function. */ #define HAVE_GETENTROPY 1 -/* Define to 1 if you have the `getgrouplist' function. */ +/* Define to 1 if you have the 'getgrouplist' function. */ #define HAVE_GETGROUPLIST 1 -/* Define to 1 if you have the `getgrset' function. */ +/* Define to 1 if you have the 'getgrset' function. */ /* #undef HAVE_GETGRSET */ -/* Define to 1 if you have the `getlastlogxbyname' function. */ +/* Define to 1 if you have the 'getlastlogxbyname' function. */ /* #undef HAVE_GETLASTLOGXBYNAME */ -/* Define to 1 if you have the `getline' function. */ +/* Define to 1 if you have the 'getline' function. */ #define HAVE_GETLINE 1 -/* Define to 1 if you have the `getluid' function. */ +/* Define to 1 if you have the 'getluid' function. */ /* #undef HAVE_GETLUID */ -/* Define to 1 if you have the `getnameinfo' function. */ +/* Define to 1 if you have the 'getnameinfo' function. */ #define HAVE_GETNAMEINFO 1 -/* Define to 1 if you have the `getopt' function. */ +/* Define to 1 if you have the 'getopt' function. */ #define HAVE_GETOPT 1 /* Define to 1 if you have the header file. */ @@ -675,73 +675,73 @@ /* Define if your libraries define getpagesize() */ #define HAVE_GETPAGESIZE 1 -/* Define to 1 if you have the `getpeereid' function. */ +/* Define to 1 if you have the 'getpeereid' function. */ #define HAVE_GETPEEREID 1 -/* Define to 1 if you have the `getpeerucred' function. */ +/* Define to 1 if you have the 'getpeerucred' function. */ /* #undef HAVE_GETPEERUCRED */ -/* Define to 1 if you have the `getpgid' function. */ +/* Define to 1 if you have the 'getpgid' function. */ #define HAVE_GETPGID 1 -/* Define to 1 if you have the `getpgrp' function. */ +/* Define to 1 if you have the 'getpgrp' function. */ #define HAVE_GETPGRP 1 -/* Define to 1 if you have the `getpwanam' function. */ +/* Define to 1 if you have the 'getpwanam' function. */ /* #undef HAVE_GETPWANAM */ -/* Define to 1 if you have the `getrandom' function. */ +/* Define to 1 if you have the 'getrandom' function. */ #define HAVE_GETRANDOM 1 -/* Define to 1 if you have the `getrlimit' function. */ +/* Define to 1 if you have the 'getrlimit' function. */ #define HAVE_GETRLIMIT 1 /* Define if getrrsetbyname() exists */ /* #undef HAVE_GETRRSETBYNAME */ -/* Define to 1 if you have the `getseuserbyname' function. */ +/* Define to 1 if you have the 'getseuserbyname' function. */ /* #undef HAVE_GETSEUSERBYNAME */ -/* Define to 1 if you have the `getsid' function. */ +/* Define to 1 if you have the 'getsid' function. */ #define HAVE_GETSID 1 -/* Define to 1 if you have the `gettimeofday' function. */ +/* Define to 1 if you have the 'gettimeofday' function. */ #define HAVE_GETTIMEOFDAY 1 -/* Define to 1 if you have the `getttyent' function. */ +/* Define to 1 if you have the 'getttyent' function. */ #define HAVE_GETTTYENT 1 -/* Define to 1 if you have the `getutent' function. */ +/* Define to 1 if you have the 'getutent' function. */ /* #undef HAVE_GETUTENT */ -/* Define to 1 if you have the `getutid' function. */ +/* Define to 1 if you have the 'getutid' function. */ /* #undef HAVE_GETUTID */ -/* Define to 1 if you have the `getutline' function. */ +/* Define to 1 if you have the 'getutline' function. */ /* #undef HAVE_GETUTLINE */ -/* Define to 1 if you have the `getutxent' function. */ +/* Define to 1 if you have the 'getutxent' function. */ #define HAVE_GETUTXENT 1 -/* Define to 1 if you have the `getutxid' function. */ +/* Define to 1 if you have the 'getutxid' function. */ #define HAVE_GETUTXID 1 -/* Define to 1 if you have the `getutxline' function. */ +/* Define to 1 if you have the 'getutxline' function. */ #define HAVE_GETUTXLINE 1 -/* Define to 1 if you have the `getutxuser' function. */ +/* Define to 1 if you have the 'getutxuser' function. */ #define HAVE_GETUTXUSER 1 -/* Define to 1 if you have the `get_default_context_with_level' function. */ +/* Define to 1 if you have the 'get_default_context_with_level' function. */ /* #undef HAVE_GET_DEFAULT_CONTEXT_WITH_LEVEL */ -/* Define to 1 if you have the `glob' function. */ +/* Define to 1 if you have the 'glob' function. */ #define HAVE_GLOB 1 /* Define to 1 if you have the header file. */ #define HAVE_GLOB_H 1 -/* Define to 1 if you have the `group_from_gid' function. */ +/* Define to 1 if you have the 'group_from_gid' function. */ #define HAVE_GROUP_FROM_GID 1 /* Define to 1 if you have the header file. */ @@ -765,7 +765,7 @@ /* Define if HEADER.ad exists in arpa/nameser.h */ #define HAVE_HEADER_AD 1 -/* Define to 1 if you have the `HMAC_CTX_init' function. */ +/* Define to 1 if you have the 'HMAC_CTX_init' function. */ /* #undef HAVE_HMAC_CTX_INIT */ /* Define if you have ut_host in utmp.h */ @@ -789,22 +789,22 @@ /* Define to 1 if you have the header file. */ #define HAVE_IFADDRS_H 1 -/* Define to 1 if you have the `inet_aton' function. */ +/* Define to 1 if you have the 'inet_aton' function. */ #define HAVE_INET_ATON 1 -/* Define to 1 if you have the `inet_ntoa' function. */ +/* Define to 1 if you have the 'inet_ntoa' function. */ #define HAVE_INET_NTOA 1 -/* Define to 1 if you have the `inet_ntop' function. */ +/* Define to 1 if you have the 'inet_ntop' function. */ #define HAVE_INET_NTOP 1 -/* Define to 1 if you have the `innetgr' function. */ +/* Define to 1 if you have the 'innetgr' function. */ #define HAVE_INNETGR 1 /* define if you have int64_t data type */ #define HAVE_INT64_T 1 -/* Define to 1 if the system has the type `intmax_t'. */ +/* Define to 1 if the system has the type 'intmax_t'. */ #define HAVE_INTMAX_T 1 /* Define to 1 if you have the header file. */ @@ -813,25 +813,25 @@ /* define if you have intxx_t data type */ #define HAVE_INTXX_T 1 -/* Define to 1 if the system has the type `in_addr_t'. */ +/* Define to 1 if the system has the type 'in_addr_t'. */ #define HAVE_IN_ADDR_T 1 -/* Define to 1 if the system has the type `in_port_t'. */ +/* Define to 1 if the system has the type 'in_port_t'. */ #define HAVE_IN_PORT_T 1 /* Define if you have isblank(3C). */ #define HAVE_ISBLANK 1 -/* Define to 1 if you have the `killpg' function. */ +/* Define to 1 if you have the 'killpg' function. */ #define HAVE_KILLPG 1 -/* Define to 1 if you have the `krb5_cc_new_unique' function. */ +/* Define to 1 if you have the 'krb5_cc_new_unique' function. */ /* #undef HAVE_KRB5_CC_NEW_UNIQUE */ -/* Define to 1 if you have the `krb5_free_error_message' function. */ +/* Define to 1 if you have the 'krb5_free_error_message' function. */ /* #undef HAVE_KRB5_FREE_ERROR_MESSAGE */ -/* Define to 1 if you have the `krb5_get_error_message' function. */ +/* Define to 1 if you have the 'krb5_get_error_message' function. */ /* #undef HAVE_KRB5_GET_ERROR_MESSAGE */ /* Define to 1 if you have the header file. */ @@ -846,10 +846,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBAUDIT_H */ -/* Define to 1 if you have the `bsm' library (-lbsm). */ +/* Define to 1 if you have the 'bsm' library (-lbsm). */ /* #undef HAVE_LIBBSM */ -/* Define to 1 if you have the `dl' library (-ldl). */ +/* Define to 1 if you have the 'dl' library (-ldl). */ #define HAVE_LIBDL 1 /* Define to 1 if you have the header file. */ @@ -858,25 +858,25 @@ /* Define if system has libiaf that supports set_id */ /* #undef HAVE_LIBIAF */ -/* Define to 1 if you have the `network' library (-lnetwork). */ +/* Define to 1 if you have the 'network' library (-lnetwork). */ /* #undef HAVE_LIBNETWORK */ -/* Define to 1 if you have the `pam' library (-lpam). */ +/* Define to 1 if you have the 'pam' library (-lpam). */ #define HAVE_LIBPAM 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBPROC_H */ -/* Define to 1 if you have the `socket' library (-lsocket). */ +/* Define to 1 if you have the 'socket' library (-lsocket). */ /* #undef HAVE_LIBSOCKET */ /* Define to 1 if you have the header file. */ #define HAVE_LIBUTIL_H 1 -/* Define to 1 if you have the `xnet' library (-lxnet). */ +/* Define to 1 if you have the 'xnet' library (-lxnet). */ /* #undef HAVE_LIBXNET */ -/* Define to 1 if you have the `z' library (-lz). */ +/* Define to 1 if you have the 'z' library (-lz). */ #define HAVE_LIBZ 1 /* Define to 1 if you have the header file. */ @@ -894,65 +894,65 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_LINUX_SECCOMP_H */ -/* Define to 1 if you have the `llabs' function. */ +/* Define to 1 if you have the 'llabs' function. */ #define HAVE_LLABS 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 -/* Define to 1 if you have the `localtime_r' function. */ +/* Define to 1 if you have the 'localtime_r' function. */ #define HAVE_LOCALTIME_R 1 -/* Define to 1 if you have the `login' function. */ +/* Define to 1 if you have the 'login' function. */ /* #undef HAVE_LOGIN */ /* Define to 1 if you have the header file. */ #define HAVE_LOGIN_CAP_H 1 -/* Define to 1 if you have the `login_getcapbool' function. */ +/* Define to 1 if you have the 'login_getcapbool' function. */ #define HAVE_LOGIN_GETCAPBOOL 1 -/* Define to 1 if you have the `login_getpwclass' function. */ +/* Define to 1 if you have the 'login_getpwclass' function. */ #define HAVE_LOGIN_GETPWCLASS 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_LOGIN_H */ -/* Define to 1 if you have the `logout' function. */ +/* Define to 1 if you have the 'logout' function. */ /* #undef HAVE_LOGOUT */ -/* Define to 1 if you have the `logwtmp' function. */ +/* Define to 1 if you have the 'logwtmp' function. */ /* #undef HAVE_LOGWTMP */ -/* Define to 1 if the system has the type `long double'. */ +/* Define to 1 if the system has the type 'long double'. */ #define HAVE_LONG_DOUBLE 1 -/* Define to 1 if the system has the type `long long'. */ +/* Define to 1 if the system has the type 'long long'. */ #define HAVE_LONG_LONG 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_MAILLOCK_H */ -/* Define to 1 if your system has a GNU libc compatible `malloc' function, and +/* Define to 1 if your system has a GNU libc compatible 'malloc' function, and to 0 otherwise. */ #define HAVE_MALLOC 1 -/* Define to 1 if you have the `mblen' function. */ +/* Define to 1 if you have the 'mblen' function. */ #define HAVE_MBLEN 1 -/* Define to 1 if you have the `mbtowc' function. */ +/* Define to 1 if you have the 'mbtowc' function. */ #define HAVE_MBTOWC 1 -/* Define to 1 if you have the `memmem' function. */ +/* Define to 1 if you have the 'memmem' function. */ #define HAVE_MEMMEM 1 -/* Define to 1 if you have the `memmove' function. */ +/* Define to 1 if you have the 'memmove' function. */ #define HAVE_MEMMOVE 1 -/* Define to 1 if you have the `memset_s' function. */ +/* Define to 1 if you have the 'memset_s' function. */ #define HAVE_MEMSET_S 1 -/* Define to 1 if you have the `mkdtemp' function. */ +/* Define to 1 if you have the 'mkdtemp' function. */ #define HAVE_MKDTEMP 1 /* define if you have mode_t data type */ @@ -979,50 +979,50 @@ /* Define if you are on NeXT */ /* #undef HAVE_NEXT */ -/* Define to 1 if the system has the type `nfds_t'. */ +/* Define to 1 if the system has the type 'nfds_t'. */ #define HAVE_NFDS_T 1 -/* Define to 1 if you have the `ngetaddrinfo' function. */ +/* Define to 1 if you have the 'ngetaddrinfo' function. */ /* #undef HAVE_NGETADDRINFO */ -/* Define to 1 if you have the `nl_langinfo' function. */ +/* Define to 1 if you have the 'nl_langinfo' function. */ #define HAVE_NL_LANGINFO 1 -/* Define to 1 if you have the `nsleep' function. */ +/* Define to 1 if you have the 'nsleep' function. */ /* #undef HAVE_NSLEEP */ -/* Define to 1 if you have the `ogetaddrinfo' function. */ +/* Define to 1 if you have the 'ogetaddrinfo' function. */ /* #undef HAVE_OGETADDRINFO */ /* Define if you have an old version of PAM which takes only one argument to pam_strerror */ /* #undef HAVE_OLD_PAM */ -/* Define to 1 if you have the `openlog_r' function. */ +/* Define to 1 if you have the 'openlog_r' function. */ /* #undef HAVE_OPENLOG_R */ -/* Define to 1 if you have the `openpty' function. */ +/* Define to 1 if you have the 'openpty' function. */ #define HAVE_OPENPTY 1 /* as a macro */ #define HAVE_OPENSSL_ADD_ALL_ALGORITHMS 1 -/* Define to 1 if you have the `OpenSSL_version' function. */ +/* Define to 1 if you have the 'OpenSSL_version' function. */ #define HAVE_OPENSSL_VERSION 1 -/* Define to 1 if you have the `OpenSSL_version_num' function. */ +/* Define to 1 if you have the 'OpenSSL_version_num' function. */ #define HAVE_OPENSSL_VERSION_NUM 1 /* Define if you have Digital Unix Security Integration Architecture */ /* #undef HAVE_OSF_SIA */ -/* Define to 1 if you have the `pam_getenvlist' function. */ +/* Define to 1 if you have the 'pam_getenvlist' function. */ #define HAVE_PAM_GETENVLIST 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_PAM_PAM_APPL_H */ -/* Define to 1 if you have the `pam_putenv' function. */ +/* Define to 1 if you have the 'pam_putenv' function. */ #define HAVE_PAM_PUTENV 1 /* Define to 1 if you have the header file. */ @@ -1034,74 +1034,74 @@ /* define if you have pid_t data type */ #define HAVE_PID_T 1 -/* Define to 1 if you have the `pledge' function. */ +/* Define to 1 if you have the 'pledge' function. */ /* #undef HAVE_PLEDGE */ -/* Define to 1 if you have the `poll' function. */ +/* Define to 1 if you have the 'poll' function. */ #define HAVE_POLL 1 /* Define to 1 if you have the header file. */ #define HAVE_POLL_H 1 -/* Define to 1 if you have the `ppoll' function. */ +/* Define to 1 if you have the 'ppoll' function. */ #define HAVE_PPOLL 1 -/* Define to 1 if you have the `prctl' function. */ +/* Define to 1 if you have the 'prctl' function. */ /* #undef HAVE_PRCTL */ -/* Define to 1 if you have the `priv_basicset' function. */ +/* Define to 1 if you have the 'priv_basicset' function. */ /* #undef HAVE_PRIV_BASICSET */ /* Define to 1 if you have the header file. */ /* #undef HAVE_PRIV_H */ -/* Define to 1 if you have the `procctl' function. */ +/* Define to 1 if you have the 'procctl' function. */ #define HAVE_PROCCTL 1 /* Define if you have /proc/$pid/fd */ /* #undef HAVE_PROC_PID */ -/* Define to 1 if you have the `proc_pidinfo' function. */ +/* Define to 1 if you have the 'proc_pidinfo' function. */ /* #undef HAVE_PROC_PIDINFO */ *** 591 LINES SKIPPED *** From nobody Wed Jul 3 18:56:57 2024 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 4WDpt11n26z5Q0fZ; Wed, 03 Jul 2024 18:56: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WDpt11D1yz4Vhm; Wed, 3 Jul 2024 18:56:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720033017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7yHgcOeNjhKFB27cRH71M3UwDQUT6Q9gGk8mNco1rpo=; b=nCXo8gOl0KkLlzKMIyE0ClqeNuJkKcUejwD86ndKaRmRDn9bjttUcvr5otrtxzFd+7GbB3 7OazXody42KZUkkq/MJHfeyBmSzWfHbpOKyUX1TJ/XwdZB8W4+0xOYArFb9sXc05frR8vt fWpEWtFt9C3mkThT9t8Iv4xjs5HaDJ2+qG1yTpyIRwRz4CzJXzjxPz962oPOKfb5MT011d j8+o8SksuPKyI6zIH4doNv2EbSv7e2wu7w1dA6aJpdJrbsNCvUfyj+RfqQfv+OOuDi7Atn Lj4HB0P544UDhpJwSN1I0H1ZSkjK8N9+J0DbD5bcp5lyKqxLCnStpVFa/F4REw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720033017; a=rsa-sha256; cv=none; b=l2sHtfWpPIteH1DhsrlIwAp1oXh5Iwyd9pulOhrj0GSD2Hd1J8ioVz42uDrsmTmt85KyIQ zNwGvLGzGqHIWg4kXc0HW6HTQGJmsdzE88DQD8LZXRqOLfPOHkCSxy3ZFTQYCvw8piElct wH6CnNDqIAn0gpGXf4n4K6rye0FRljBqfiKSycJui7V2X8m0G10gUESK5eBEOWtCPc1sif cAKOLrJbt2lc8t6t8b1+ffP64iKoxmS9hiLWUz75qL91UicHtLwM+LzJP0/483ZcAedVx9 /hR+P8zS9fDHqxfMoyVJUznSFj1ZxwUSnTydAWoBuIs6f3VJKmFBA/WKKePn3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720033017; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7yHgcOeNjhKFB27cRH71M3UwDQUT6Q9gGk8mNco1rpo=; b=KDEvsvB+JbmmXC05H5OjHfolbN6K/c1Rw8++1eHaCGe2/XTqMQGLkBbr5Gf98HXhZd3Baq 18J9HnkNsJu1vdS4b3h5eQlQ0D74RrDAf+wBu07nRKUkaZkdiyVGkZmT8UmyVE+R3y/KR2 amEPwVX9KXr2vzQdE3TtoD0Axu44Os0o2uPPCqLetm43xrATXLM7a2KRlmp5ICMH/ztpbi d6J7p1KgQyWJtiMvH2X9zau/Nm3DxjNEmgFKV9YbdXaXKAQrBXiOAEx3hgdb3AP3/yE3gd TOZgISf9Dzx9bWSgFSI6AK5Q5c/X5aMAmnwAxCwo76BWSzb15SHHxH1YuRuhXw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WDpt10qQWzjc0; Wed, 3 Jul 2024 18:56:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 463Iuv0r011765; Wed, 3 Jul 2024 18:56:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 463IuvdS011762; Wed, 3 Jul 2024 18:56:57 GMT (envelope-from git) Date: Wed, 3 Jul 2024 18:56:57 GMT Message-Id: <202407031856.463IuvdS011762@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: fd31c0946ee2 - main - cdefs.h: Add back comment about branch prediction 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: fd31c0946ee2240491db1301c2d33eb846221a54 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=fd31c0946ee2240491db1301c2d33eb846221a54 commit fd31c0946ee2240491db1301c2d33eb846221a54 Author: Warner Losh AuthorDate: 2024-07-03 18:52:38 +0000 Commit: Warner Losh CommitDate: 2024-07-03 18:56:42 +0000 cdefs.h: Add back comment about branch prediction Add back, with editing, the comments about branch prediction, when to use it, etc. Offer stronger opinions about this in style(9). Add in the convention for FreeBSD that we do only the entire expression in the if expression. Advise use only when it makes things measurably faster. Requested by: jhb Sponsored by: Netflix Reviewed by: brooks, jhb Differential Revision: https://reviews.freebsd.org/D45837 --- share/man/man9/style.9 | 16 ++++++++++++++++ sys/sys/cdefs.h | 7 +++++++ 2 files changed, 23 insertions(+) diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index 381f3aa3bfa3..daddc57bfb1f 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -897,6 +897,22 @@ New code should use .Fn _Static_assert instead of the older .Fn CTASSERT . +.Pp +.Fn __predict_true +and +.Fn __predict_false +should only be used in frequently executed code when it makes the code +measurably faster. +It is wasteful to make predictions for infrequently run code, like subsystem +initialization. +When using branch prediction hints, atypical error conditions should use +.Fn __predict_false +(document the exceptions). +Operations that almost always succeed use +.Fn __predict_true . +Only use the annotation for the entire if statement, rather than individual clauses. +Do not add these annotations without empirical evidence of the likelihood of the +branch. .Sh FILES .Bl -tag -width indent .It Pa /usr/src/tools/build/checkstyle9.pl diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 7c4890ece8d5..b92992c1b5c3 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -321,6 +321,13 @@ #define __restrict restrict #endif +/* + * All modern compilers have explicit branch prediction so that the CPU back-end + * can hint to the processor and also so that code blocks can be reordered such + * that the predicted path sees a more linear flow, thus improving cache + * behavior, etc. Use sparingly, except in performance critical code where + * they make things measurably faster. + */ #define __predict_true(exp) __builtin_expect((exp), 1) #define __predict_false(exp) __builtin_expect((exp), 0) From nobody Wed Jul 3 19:43:00 2024 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 4WDqv84YYzz5Q5jl; Wed, 03 Jul 2024 19:43: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WDqv83yRpz4bsm; Wed, 3 Jul 2024 19:43:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720035780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ucic/sULChPO5GS8Lxc54/zStNE9rtc+hkXT4Ow+97g=; b=qa4bFb9wO0MAeCt1HytEnuVS3nj9JbxSAUTWM1WBdAgzy8iRVumYBQTI5kkT5CExeZHE38 UwD9zXa2swPZVN8DklNHS3Pnsk1kXBMmATC0TrLcQeU1L+SNVsksud2a5m7BapAt4DW2mw qgjbKFOXR3FPNI0At1Nthbb9RNq9446Zl6AjVgClcIE7ddNlMpU0ZUggqdVUHNYoyhEown /eT0i9ffIpEWLoGgC0Cv5ISWXh9xPD+aJKqiywfVrPvZd0UClLY9lNbke04ac6Lq8CVdTb WgC5u3dFJ/ao9CsILLioqtKy4PSyZKz7SPJQsna1Ec8++cYDG01XZ5LEWO/pww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720035780; a=rsa-sha256; cv=none; b=tvd850qyReL8d4WZVoTQ5b9Hyv89/G8Au/cKT6B9t1zmupFgdreK6ZCAfkJlyrIeqENWQQ nGHP+x4KtuSgaN+s1u58iaAzqSEYidqRowL5QYX6gDnC/BFbvWxtOFVJe7OmHsj/8MP1Fv DkWp0BAya3Y57b9GSwDzB18JV2NhYWrgxjyp4pFCF2ZLuLbiIZPyI+dyi59pf4SBtCOrFp YYs8r3oL6PWjfTySk+6LCclZt/rgtJN+6x7P3oQzavL34XvfM0FKvb6Ic0oav/+tYjXZr7 Yhq9whvkHbRWwsUTvNn61cAECmDLP8iwmDgAnqzkAnizptbZX/kprMZCeRusOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720035780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ucic/sULChPO5GS8Lxc54/zStNE9rtc+hkXT4Ow+97g=; b=uJ/eaUul3pCTqKZzy7hckd2QmBdEYkvBL5jWiVduJZa1tT+t+OmKAKR/2HG85Qna0R2k98 xvq7ZqcpDX2DrnQgXJF/uT7qS2eYuxQ5bervGu1oEv7T8JKfn/WllJ3gSCfUz1tlrs33g+ X/dGZ7cGpjOIwgT8lBL2NVp6NIHDrrJP47gchb3a+93xuo0j4cm5MOkKWx6bhBzPp39Y2l 1uR25EenaJnRLlHSO2Eh4F+1fJ8RCF7j3i5k0EktI69pq7Vh/XpVQQk7HpSmSWKdYLe0sx rvzsYlr4lEgonezO4FB/B70I0D0hEiiapmz8yA0NmkPqMR6JPvhmK5D0fZh9+g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WDqv83YrqzkfM; Wed, 3 Jul 2024 19:43:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 463Jh0ED096681; Wed, 3 Jul 2024 19:43:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 463Jh0ZW096678; Wed, 3 Jul 2024 19:43:00 GMT (envelope-from git) Date: Wed, 3 Jul 2024 19:43:00 GMT Message-Id: <202407031943.463Jh0ZW096678@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: cf2c79915a63 - main - organization.dot: Update core.13 members and secretary 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: cf2c79915a63463ce6f7323127ade110bbe67db6 Auto-Submitted: auto-generated The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=cf2c79915a63463ce6f7323127ade110bbe67db6 commit cf2c79915a63463ce6f7323127ade110bbe67db6 Author: Li-Wen Hsu AuthorDate: 2024-07-03 19:41:35 +0000 Commit: Li-Wen Hsu CommitDate: 2024-07-03 19:42:29 +0000 organization.dot: Update core.13 members and secretary Approved by: core --- share/misc/organization.dot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/misc/organization.dot b/share/misc/organization.dot index f33ea0f0dbd0..1a88bc71b14e 100644 --- a/share/misc/organization.dot +++ b/share/misc/organization.dot @@ -24,8 +24,8 @@ _misc [label="Miscellaneous Hats"] # Development teams go here alphabetically sorted by FreeBSD login name -core [label="Core Team\ncore@FreeBSD.org\nbapt, bcr, emaste,\ngrog, jhb, lwhsu,\nmanu, tcberner, 0mp"] -coresecretary [label="Core Team Secretary\ncore-secretary@FreeBSD.org\ncarlavilla"] +core [label="Core Team\ncore@FreeBSD.org\nallanjude, dch, glebius,\nhrs, lwhsu, mat,\nolivier, tcberner"] +coresecretary [label="Core Team Secretary\ncore-secretary@FreeBSD.org\nrene"] doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"] doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\nbcr, gabor, gjb, hrs,\nblackend, ryusuke, wblock"] pkgmgr [label="Package Management Team\npkgmgr@FreeBSD.org\nantoine, bdrewery"] From nobody Thu Jul 4 07:15:53 2024 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 4WF7Gf05Mzz5PGGr; Thu, 04 Jul 2024 07:15:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WF7Gd6hNXz4mkF; Thu, 4 Jul 2024 07:15:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720077353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L7sSWvkb+EkYEFzh+av/VQJTqjUXczhUeOIkDyOZPrw=; b=RSwp5rCXngGPttgXjgQUgBt3uyhqaZDFs0StkcZV6vqBN/3OD/oqco/2NC1EygRx6POjZ0 IP6USR9bFANkBlXq4t3lJOsDz57k2oqsTCS6Ac6wRygUwKwdyaLNLLb+d1q/kbhMXKeQ35 efDSiBgxSvQh2GG8uNSqvFw8kmjqyRY69bnRiWyx8dBma+HADo8wiPU4GPApsFCcBBWOsq vqb32F/3i+7zJLZqx+//w1Psz1Ym7IRJy+toF23JbaPRl5MNFo9Gz4r8X9sPTuX/7FAhNp tkLDtOVRDWJ0bFOW8zsKy3NIcSp4AsCKCaQOUEz1TRId12oNnHW3MOwSczmihA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720077353; a=rsa-sha256; cv=none; b=IC9MaRFiDqkjBE+Cs++MDg8qEc44rlEXECglYwgfdXKP0kFNhmh389gTm3Qc6LKLk4D9mf pYNtwMAHXOqr9Dco1Zvm7lj4xrk8BIql8RLBnhKLYmRwefnEaB/DHB964XYcR9Bl7M5tgv SfwmwJ1Ewqv5BiUjnj/x/IhQl7KHRnbp3uYA2twohITMCG5NTeFYkHGRT3QF5GiAYchVqf up/MjuqO8wqV2DaqDtqdh6eTHKNtTL8JDzk+jahfxmuWpYwtcwpLD5BpB9+s1EFo1Rcp5c VvBt8F/UTT4LSQHrKGz46/zkzjh6fmq0P2HKY/zyeTwMXEt4rmzBL2AQe/Syxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720077353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L7sSWvkb+EkYEFzh+av/VQJTqjUXczhUeOIkDyOZPrw=; b=cGiUyCWXP56PkMe1luZny5jFTxLa6Mk1LrZkFnJimQn/zmNIqEog7XswthgZtlxTMt7MHu 5fsU7icl5AgRYjaqKhCVC3XMUaS1oudLelRnCzvOTDtGVMWNPhkZ5ozDgbJm7ImzULAEv0 S4D4eC675DjyvcCwpEKU0De3JVFf5HUbmLML14kXWJMChyy4HNGYqWrwyOOTprb5AVAoSs R8j23OqfuqmajsH8jHq8KB2tURfm0DfePlqsBswcEgj8H+NPtYjHDvlbmHmkQ0dXl52abW 2a13egGvSqkjnYwG+hPQS4FaFrwpL8cGPDgz2z2QI/MAsHkiM1IvYn0SZwW4Xw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WF7Gd6HYVz14gN; Thu, 4 Jul 2024 07:15:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4647FrdK060102; Thu, 4 Jul 2024 07:15:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4647FrsM060099; Thu, 4 Jul 2024 07:15:53 GMT (envelope-from git) Date: Thu, 4 Jul 2024 07:15:53 GMT Message-Id: <202407040715.4647FrsM060099@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: ad99f0062b34 - main - stress2: Added a new unionfs 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: ad99f0062b34b7060381a48b89212fc3a3b3fa2e Auto-Submitted: auto-generated The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=ad99f0062b34b7060381a48b89212fc3a3b3fa2e commit ad99f0062b34b7060381a48b89212fc3a3b3fa2e Author: Peter Holm AuthorDate: 2024-07-04 07:13:39 +0000 Commit: Peter Holm CommitDate: 2024-07-04 07:13:39 +0000 stress2: Added a new unionfs test scenario --- tools/test/stress2/misc/unionfs19.sh | 74 ++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/tools/test/stress2/misc/unionfs19.sh b/tools/test/stress2/misc/unionfs19.sh new file mode 100755 index 000000000000..a4e31ad0857e --- /dev/null +++ b/tools/test/stress2/misc/unionfs19.sh @@ -0,0 +1,74 @@ +#!/bin/sh + +# +# Copyright (c) 2024 Peter Holm +# +# SPDX-License-Identifier: BSD-2-Clause +# + +# umount FS with memory mapped file +# "panic: general protection fault" seen: +# https://people.freebsd.org/~pho/stress/log/log0519.txt + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg + +prog=$(basename "$0" .sh) +here=`pwd` +log=/tmp/$prog.log +md1=$mdstart +md2=$((md1 + 1)) +mp1=/mnt$md1 +mp2=/mnt$md2 + +set -e +mdconfig -l | grep -q md$md && mdconfig -d -u $md1 +mdconfig -l | grep -q md$u2 && mdconfig -d -u $md2 + +mdconfig -s 2g -u $md1 +newfs $newfs_flags /dev/md$md1 > /dev/null +mdconfig -s 2g -u $md2 +newfs $newfs_flags /dev/md$md2 > /dev/null + +mkdir -p $mp1 $mp2 +mount /dev/md$md1 $mp1 +mount /dev/md$md2 $mp2 +mount -t unionfs -o noatime $mp1 $mp2 +mount | grep -E "$mp1|$mp2" +set +e + +export RUNDIR=$mp2/stressX +export runRUNTIME=2m +export LOAD=70 +export mmapLOAD=100 +export TESTPROGS="testcases/mmap/mmap testcases/swap/swap" + +(cd ..; ./testcases/run/run $TESTPROGS > /dev/null 2>&1) & rpid=$! +sleep 5 + +tail -F -n 0 /var/log/messages > $log & lpid=$! + +start=`date +%s` +while [ $((`date +%s` - start)) -lt 120 ]; do + umount -f $mp2 && + mount -t unionfs -o noatime $mp1 $mp2 + sleep 5 + mount | grep -q unionfs || break + pgrep -q mmap || break +done +pkill run swap mmap +while pgrep -q swap; do pkill swap; done +wait $rpid + +umount $mp2 # The unionfs mount +umount $mp2 +umount $mp1 + +mdconfig -d -u $md1 +mdconfig -d -u $md2 + +kill $lpid && wait $lpid +grep -m 1 "pager read error" $log && s=1 || s=0 +rm $log +exit $s From nobody Thu Jul 4 07:15:54 2024 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 4WF7Gg13Nvz5PG3M; Thu, 04 Jul 2024 07:15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WF7Gg0bBBz4mh5; Thu, 4 Jul 2024 07:15:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720077355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Odla4ObwQH3hdceTYhhOg8to464JMPZpeSXJU2V/EGY=; b=WqvPZVPQZsFZW2MydW7bdSckXi4ssbZ0KDhhcenXaMQeJsj85DfVGG6NFhAjofJGGRKtxv oU1bXXdiwZvvj/es3OVYIniGqdQSph/xkR1+BJfuTUZU7vF0exEQlwpGPYExu1M/PqdITL yYkyDc4cQWTRthq41MYgtVeYGMdfddtpq1Heews0kpEs3qH7Lmy7AVul50n4ygMoB5/t3i jUOk3n8OZ8tuOdlWOisAHHf5bL+aMYtkaM2ctf460vRSaTWe7SngjykmIyyOUUTHNIXP/r O9aAVpa9Xuyl9FG5BOWITcHT8gmpjJrz9HqiRWQBsksCHVxjFqGISuBiOAJn0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720077355; a=rsa-sha256; cv=none; b=hmj9wBiGMctPucP49r15s8QWVLOGDBA0vRCBa8beM/X86TIGLfVkS8VMJjfnrci+O1qKYM goE3brSVTgQYBC7ksAVvnXH768DVQK/pH/319vMN3SC5+dFAhXv9BdOOODmlwGUoXDCb/v x3Xv1LzIfLPeK1h1hNvD8xv5FIH7YQ9oAzKXsBforBH0A1Isype87t3QRPooTBMDi7yje+ eFgiyxpqABQbEyuhQAj4FEwkU8cRi6ieVarTruv+67uoCA3WoWL9evvU6X8F2UwZ6xA3p+ gNhGTHtFiOxUp0tppGU/l5V/hmSW1QMndjAZfVEQvsqc1XDrkY2KvDv7NI5Thg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720077355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Odla4ObwQH3hdceTYhhOg8to464JMPZpeSXJU2V/EGY=; b=cO4J3OdA78yWmWwUa1l9pnmgwA9e7mu/hOUQuQIVAAdb5F4vDK2vMHztpsu39yD5+3oQs6 hyO1YsteBPuaAJGG5/T6Nebu7TB2uQn1Y7Io/FKqhhLTcd/Pqw1h0EH7EqkwuaFivRLfXM LxlmuW8qnGNbD5IVajYMvA1t0TV56Z1zmpwvLcRIHivOhmR6n7YcO58X9t/DErznBN7leF TyDhuvolDegSRAaREpRSANMYlCj85FLr3w5G/CgZAGawzmuXsBCJpeBiZp6L0A4TR4L6Ck JIugEp8jb1/hOuwd5kL8UCimqy+6ro/5GQG+GLupnX6zdVaJQ5V4Zs6a2fbi6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WF7Gg0BXSz15BV; Thu, 4 Jul 2024 07:15:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4647Fsxh060156; Thu, 4 Jul 2024 07:15:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4647FsTJ060153; Thu, 4 Jul 2024 07:15:54 GMT (envelope-from git) Date: Thu, 4 Jul 2024 07:15:54 GMT Message-Id: <202407040715.4647FsTJ060153@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: 12be19572aea - main - stress2: Add two test. Fix a typo while here 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 12be19572aeac33409c34924ba8f7f051c2ee704 Auto-Submitted: auto-generated The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=12be19572aeac33409c34924ba8f7f051c2ee704 commit 12be19572aeac33409c34924ba8f7f051c2ee704 Author: Peter Holm AuthorDate: 2024-07-04 07:14:45 +0000 Commit: Peter Holm CommitDate: 2024-07-04 07:14:45 +0000 stress2: Add two test. Fix a typo while here --- tools/test/stress2/misc/all.exclude | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/test/stress2/misc/all.exclude b/tools/test/stress2/misc/all.exclude index f7b1a9613670..07cff21a1d9a 100644 --- a/tools/test/stress2/misc/all.exclude +++ b/tools/test/stress2/misc/all.exclude @@ -1,4 +1,4 @@ -# List of tests not to run, unless the '-a' option is used with run.sh +# List of tests not to run, unless the '-a' option is used with all.sh # Exclude names must start in column 1 backingstore.sh g_vfs_done():md6a[WRITE(offset=...)]error = 28 20111220 @@ -65,11 +65,13 @@ systrace2.sh WiP 20200227 syzkaller16.sh zonelimit issue 20210722 syzkaller28.sh panic: About to free ctl:0x... so:0x... and its in 1 20201120 syzkaller31.sh panic: Bad tailq NEXT(0xfffffe01a0899430->tqh_last) != NULL 20220420 +syzkaller55.sh https://people.freebsd.org/~pho/stress/log/log0533.txt 20240702 syzkaller59.sh Page fault 20220625 syzkaller65.sh panic: in_pcblookup_hash_locked: invalid local address 20230318 syzkaller66.sh panic: in_pcbconnect: inp is already connected 20230621 syzkaller67.sh panic: ASan: Invalid access, 8-byte read at ... 20230621 truss3.sh WiP 20200915 +unionfs19.sh https://people.freebsd.org/~pho/stress/log/log0519.txt 20240702 # Test not to run for other reasons: From nobody Thu Jul 4 11:32:32 2024 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 4WFDym4MRLz5Pt35; Thu, 04 Jul 2024 11:32: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WFDym3NNYz4GmD; Thu, 4 Jul 2024 11:32:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720092752; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dWDm8Jg/hwgJa9btgsT6hEY0gJL8EAfC4eKmypF2p9E=; b=qiXwJP2rDHeQlh6Nh2X3JfSxZrwh1KoaUCeZjt1gFtmFTnrtld4drqI9+XhldiTmP3twS6 YqrsTC14rBKU819rjoh6mM3r0M+QP4Rz4t5RBHQi3l8dMHVKuuVdz56NP29qcTTuYrj61h gw7BJEbg84B9JOlVAXa1FLfnY1dHAxMYXo1o3Jw4YAy/78+SKhhv5A+gPatrXVxod8VmkG znYV7HmALMEmd+7dGciqf9YFYROxGC0YHWnnDVKseRRW3l3+DFbxVY6r8bjXCAiC+ibhWe pqoI2sXJRS3m9hRgujILOax0vTOe0ps81wOkbRIIe2aY7Eg6NvWOy2X5Os8rng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720092752; a=rsa-sha256; cv=none; b=oYe5K9+K6MPzyh8GoUgiR24+UCQ9CxOyY+VJz/oZkLccsQDnxKa8xIHtRN5s71JpZGJ3d+ yF6qERcTZkIpRXkzwfhynZ2NpMoIpVFFJZRco0gUyz8xJhjmMJDnwbL4hbJQuur9Q5XO3N 81IaT4nOddD/d+RcLG2t3l4M+l32m91abxyUx6ehH0yggYWcOjZbmwk0VH5nUiEW0yK0Hu XVZfVzdXjHh7v4082bEQnP218DNIhFTthSMnaW+vPu12MJEtvAz2vI1hposzbhJ5sHvuVu 9Mm/ZpsJj2ywRThx0zHoXnDQUwuM+hTb0lAfKJUh+qJEgdqe0tbqEFlar8BjDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720092752; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dWDm8Jg/hwgJa9btgsT6hEY0gJL8EAfC4eKmypF2p9E=; b=wPd58cowci1Oqz5BevZ/E9bSHeP/MJ4T6MGDgMqiVr+Tu35mUCe0KEm+SUB8P7etOUIOrx lJDQpwEdvCZuzqdOG2/m+jkggv70JXx/BhnZoLK58aUEKZZjD28HUVNfxhIAlTb13/PYuf fKdIzLGKGtVjxnQ5LLP63fIEmq6bRzak/5CoaSlXY2pmSiEtieQH2YjlYTwkchhpRq75IL IrzpJZeAgcvuF+aB8/aNAQaFZ/9N+fr/X/p9TmUOiU8uDenidkLtN6VspDvhrh0twZyDU2 mgN1tT77vTfyQHg1P2Lv3Aey1Yf7l5cgCymaCxNO4hLKvA5GPSLF7CSbA/ANFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WFDym2xcHz1Bqv; Thu, 4 Jul 2024 11:32:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 464BWWhk088257; Thu, 4 Jul 2024 11:32:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 464BWW6t088254; Thu, 4 Jul 2024 11:32:32 GMT (envelope-from git) Date: Thu, 4 Jul 2024 11:32:32 GMT Message-Id: <202407041132.464BWW6t088254@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: a2e65d45a5c6 - main - dhclient: correct struct ifreq allocation 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a2e65d45a5c6def93e1bc8652a6fe686a63fbdb8 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=a2e65d45a5c6def93e1bc8652a6fe686a63fbdb8 commit a2e65d45a5c6def93e1bc8652a6fe686a63fbdb8 Author: Brooks Davis AuthorDate: 2024-07-04 11:27:10 +0000 Commit: Brooks Davis CommitDate: 2024-07-04 11:27:10 +0000 dhclient: correct struct ifreq allocation ioctl commands such as BIOCSETIF take a struct ifreq and due to FreeBSD's ioctl implementation copy exactly sizeof(struct ifreq) bytes in so allocate that much space. The over-allocaton was harmless, but useless. Reported by: def Fixes: e2dc8d789f68a dhclient: do not add 0.0.0.0 interface alias. Sponsored by: DARPA, AFRL Reviewed by: def Differential Revision: https://reviews.freebsd.org/D45769 --- sbin/dhclient/dispatch.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c index 310f477f8a4f..3108fe4365d1 100644 --- a/sbin/dhclient/dispatch.c +++ b/sbin/dhclient/dispatch.c @@ -76,7 +76,6 @@ discover_interfaces(struct interface_info *iface) { struct ifaddrs *ifap, *ifa; struct ifreq *tif; - int len = IFNAMSIZ + sizeof(struct sockaddr_storage); if (getifaddrs(&ifap) != 0) error("getifaddrs failed"); @@ -119,7 +118,7 @@ discover_interfaces(struct interface_info *iface) LLADDR(foo), foo->sdl_alen); } if (!iface->ifp) { - if ((tif = calloc(1, len)) == NULL) + if ((tif = calloc(1, sizeof(struct ifreq))) == NULL) error("no space to remember ifp"); strlcpy(tif->ifr_name, ifa->ifa_name, IFNAMSIZ); iface->ifp = tif; From nobody Thu Jul 4 14:27:42 2024 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 4WFJrt3wfBz5QGZT; Thu, 04 Jul 2024 14:27:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WFJrt3RP6z4bJt; Thu, 4 Jul 2024 14:27:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720103262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BrC7MEE+zOK/XofsS0tD6UP+3gzqe+PQj31rpiGtFco=; b=e9EJxMv7JjMirzOFkT0KjB9+lab7kE3JoX0NaUILjFjPzhasWJv1FyQ6zqzbwgI3VtQ8by QoZHoP3PyBkboxTnY0CNSChW2S86qmRvoiZ6+F1cqwTaLaDEwE7KF4yMlE1Q5F6a3lJS+w 9/6M1fwjLVN6Gj0MhBo8ZNhdg8mXQR06lBKyhX3SzdVLW/bgYei0hQmnqZkvD3P4Qat/0o gPlkwLxtuSl89xFKDN/xGthCRpg7BDAI5yFt8KmE1SOVGRIRFNd+7U/dOUKkA37d2sudUx SUCaqPiikmypDgOSrx58Psv+fTxawMNucwwxcxDga8ck9bW0cZ7cZO27aEvzVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720103262; a=rsa-sha256; cv=none; b=VmQdcuKSNTeVgC4JSvbLdLwuSikFPb+zzBMqQciE4bX88h1tw2sul1F21wXvbYPZthprPL XnMfNuKwpkbMs5aKMqeuG2ubUHUTY0PGLwiwcw8B9yorScpGoOPedsApDulV0SBelVbsjh dACwLeZ5ZWHePIIVtj5emk24lUu4Z4pf4ELwNiYihKlIAfjx67LAXjfet8DvprqiqPqhUO OMbBLHhaDrCb2monbvJIA+z1Tl90+s2vRyLX87YH89zbvt9a18o2VTzS/7hInw9gexpq7Q Nw8DK6UgM+EDEMSjonX1M4E1pu0RQB7Ws/JyeJVTZ7eSd1ap18tLyAR8JwBMgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720103262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BrC7MEE+zOK/XofsS0tD6UP+3gzqe+PQj31rpiGtFco=; b=rT/KZ9p/rU/+yXHdd0BWkGKgtQdyr0A30h2MqHtK881RUPRPR7N0ONDdNEm7kOffE8qFb8 QRFudWS/A/u1H7rGe7DoF0mHR3zJdrWjJuV8rq0b4htD4xa17W0dsG30JBRVQppQBS6Qea V7zniV941kZwYQ3grqBKtO06SPJN+PjmV34xGG8PKLMmDQNAGYdSCh/xxa8thZtP1csxZc HUsbBNotYraNbFCYi1zaEv5MarS6FG9v8Pn5BWVjV3q1mYxH/R2gbG9RY93Ik4BRe80OuS mWN3UmNWElf27fMFxgiKklxlD0uL2HcAncht0bEP6yt+H61SkNOZ90fDkkAp1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WFJrt2wy6zHPB; Thu, 4 Jul 2024 14:27:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 464ERghb078484; Thu, 4 Jul 2024 14:27:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 464ERgCZ078481; Thu, 4 Jul 2024 14:27:42 GMT (envelope-from git) Date: Thu, 4 Jul 2024 14:27:42 GMT Message-Id: <202407041427.464ERgCZ078481@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: b1dd06703274 - main - vtblk: Invoke busdma completion callbacks when polling 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: b1dd067032747c12ae237d2f7aeed6d81285c121 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b1dd067032747c12ae237d2f7aeed6d81285c121 commit b1dd067032747c12ae237d2f7aeed6d81285c121 Author: Mark Johnston AuthorDate: 2024-07-04 14:15:33 +0000 Commit: Mark Johnston CommitDate: 2024-07-04 14:15:33 +0000 vtblk: Invoke busdma completion callbacks when polling vtblk_poll_request() is used for kernel dumps and for fetching the block device's identifier string during device probing. In the latter case, it was not calling bus_dmamap_sync() after completing the I/O, but this is required in general. Thus: - Factor out per-request code from vtblk_queue_completed(). - Use it in vtblk_poll_request() once virtqueue_poll() finishes. - While here, assert that virtqueue_poll() returns the request that we expect. Reported by: KMSAN Fixes: 782105f7c898 ("vtblk: Use busdma") Reviewed by: cperciva, imp Sponsored by: Klara, Inc. Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D45665 --- sys/dev/virtio/block/virtio_blk.c | 66 +++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/sys/dev/virtio/block/virtio_blk.c b/sys/dev/virtio/block/virtio_blk.c index d7fa903936a1..d3eb3cf97831 100644 --- a/sys/dev/virtio/block/virtio_blk.c +++ b/sys/dev/virtio/block/virtio_blk.c @@ -1177,6 +1177,35 @@ vtblk_request_error(struct vtblk_request *req) return (error); } +static struct bio * +vtblk_queue_complete_one(struct vtblk_softc *sc, struct vtblk_request *req) +{ + struct bio *bp; + + if (sc->vtblk_req_ordered != NULL) { + MPASS(sc->vtblk_req_ordered == req); + sc->vtblk_req_ordered = NULL; + } + + bp = req->vbr_bp; + if (req->vbr_mapp != NULL) { + switch (bp->bio_cmd) { + case BIO_READ: + bus_dmamap_sync(sc->vtblk_dmat, req->vbr_mapp, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->vtblk_dmat, req->vbr_mapp); + break; + case BIO_WRITE: + bus_dmamap_sync(sc->vtblk_dmat, req->vbr_mapp, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->vtblk_dmat, req->vbr_mapp); + break; + } + } + bp->bio_error = vtblk_request_error(req); + return (bp); +} + static void vtblk_queue_completed(struct vtblk_softc *sc, struct bio_queue *queue) { @@ -1184,31 +1213,9 @@ vtblk_queue_completed(struct vtblk_softc *sc, struct bio_queue *queue) struct bio *bp; while ((req = virtqueue_dequeue(sc->vtblk_vq, NULL)) != NULL) { - if (sc->vtblk_req_ordered != NULL) { - MPASS(sc->vtblk_req_ordered == req); - sc->vtblk_req_ordered = NULL; - } + bp = vtblk_queue_complete_one(sc, req); - bp = req->vbr_bp; - if (req->vbr_mapp != NULL) { - switch (bp->bio_cmd) { - case BIO_READ: - bus_dmamap_sync(sc->vtblk_dmat, req->vbr_mapp, - BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->vtblk_dmat, - req->vbr_mapp); - break; - case BIO_WRITE: - bus_dmamap_sync(sc->vtblk_dmat, req->vbr_mapp, - BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(sc->vtblk_dmat, - req->vbr_mapp); - break; - } - } - bp->bio_error = vtblk_request_error(req); TAILQ_INSERT_TAIL(queue, bp, bio_queue); - vtblk_request_enqueue(sc, req); } } @@ -1412,8 +1419,6 @@ vtblk_ident(struct vtblk_softc *sc) error = vtblk_poll_request(sc, req); VTBLK_UNLOCK(sc); - vtblk_request_enqueue(sc, req); - if (error) { device_printf(sc->vtblk_dev, "error getting device identifier: %d\n", error); @@ -1423,7 +1428,9 @@ vtblk_ident(struct vtblk_softc *sc) static int vtblk_poll_request(struct vtblk_softc *sc, struct vtblk_request *req) { + struct vtblk_request *req1 __diagused; struct virtqueue *vq; + struct bio *bp; int error; vq = sc->vtblk_vq; @@ -1436,13 +1443,18 @@ vtblk_poll_request(struct vtblk_softc *sc, struct vtblk_request *req) return (error); virtqueue_notify(vq); - virtqueue_poll(vq, NULL); + req1 = virtqueue_poll(vq, NULL); + KASSERT(req == req1, + ("%s: polling completed %p not %p", __func__, req1, req)); - error = vtblk_request_error(req); + bp = vtblk_queue_complete_one(sc, req); + error = bp->bio_error; if (error && bootverbose) { device_printf(sc->vtblk_dev, "%s: IO error: %d\n", __func__, error); } + if (req != &sc->vtblk_dump_request) + vtblk_request_enqueue(sc, req); return (error); } From nobody Thu Jul 4 16:57:53 2024 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 4WFNBB1mzvz5NttS; Thu, 04 Jul 2024 16:57: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WFNBB16pHz4txd; Thu, 4 Jul 2024 16:57:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720112274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=smPzIcFIEOR/K0NI2zyiZsrMXSMERKq62DGsqFwWB3k=; b=Gez7uncRXTwm7ydShn3O2DuLlpDEdjWmSKFENlCQKR7e+FSUOG9A3cVVloX+IGRUclkwsK bIWhRzIcYweC/PHkNYIFxAYto4JTlNuSxBm7v3blSBPjS5PD6nDn0HT6hTGUZbP3rN4p+s n2vXkiZwcqpMtdKFZeD1JZKUwRbGXjChRYd3+kKptyxsaiHCg0gbgE33lZDDWprtB720kN TLF/Cg4OwmL8kBGYNdEckL33V3dT+bEFzia/13mdMceh+lTWDF+53MfVwng7FUDV2QjicA BYQkXxEwnhn+nPc8X0rIZNvvPeLEE7bcyeOzuv0qwqiUXhlKBXL+/9ZZ1sqL/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720112274; a=rsa-sha256; cv=none; b=VCm0RPd4Z/Y2pQGbLM2C9oW7EWaQ3MJBzLAAe+RYjDrpVEU7Y2lP+uo6X86dP5a0M5Wgli 9hbEk/SgCb7Sa7guXOWxPQSIWckd5eDEvouCsAg5yPi5V9zWXspZxsQ4Iy+NL5JQVW35Nl niSgVygTXXXJ0OnKjROMIEl7ltynV13oJLo/6uO5AwE616JEHdjQ3ot9b5G3VplEUk2Vd2 HlJiT/yjOK/6CKEnadtRIwsveAxTBo18KoS7eSHngq+oP7eZsalOFuw7p9SNcof2NE3lAU LzvQq2E3IKi0D/PI3GkVYX/hOz3wS4FWzZ27Bg+IfTE5v+J3XBsRGg0XBvzVTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720112274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=smPzIcFIEOR/K0NI2zyiZsrMXSMERKq62DGsqFwWB3k=; b=kBB1QuekGVAqwJ+P4rXhkKuQ3jG3zLfN5auyl4FTOp7nnj4AmMcu25qpgH9CJ8LCaUgOVj XV48ceQnVW2YsJ1TJOZTF58Gz6Jr8XsFIrpQ2ooyRIKI3gXPNQtcwSv7RBPI0N3wueVTMM nVNhYqGGf/+x4/Nr4RpE+u9WFgDv30yMOOp3MIVP7XrO3P9t+YuYH4RnYVXMpjLIlp7ULT HbP53JclbcIJp2aP+ByEC3dQqZ7yoaO5QLzjNe83SHMZv6uIPTUGwn/BcRWUwv1Jn3aijB 3W2ojHy0wauJtlB385+HFSMO1zKVIy/YTEr5BBoCWzeBTJHys9SEXiGkOnd5hQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WFNBB0k3HzMQP; Thu, 4 Jul 2024 16:57:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 464GvrGj034085; Thu, 4 Jul 2024 16:57:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 464Gvrr6034082; Thu, 4 Jul 2024 16:57:53 GMT (envelope-from git) Date: Thu, 4 Jul 2024 16:57:53 GMT Message-Id: <202407041657.464Gvrr6034082@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 09164454aa4c - main - ethernet: Retire M_HASFCS 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 09164454aa4c1868abf1ea724ec6160c4a556bdd Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=09164454aa4c1868abf1ea724ec6160c4a556bdd commit 09164454aa4c1868abf1ea724ec6160c4a556bdd Author: Zhenlei Huang AuthorDate: 2024-07-04 16:53:51 +0000 Commit: Zhenlei Huang CommitDate: 2024-07-04 16:53:51 +0000 ethernet: Retire M_HASFCS The mbuf flag M_HASFCS was introduced for drivers to indicate the net stack that packets include FCS (Frame Check Sequence). In principle, to be efficient, FCS should always be processed by hardware, firmware, or at last sort the driver. Well, Ethernet specifies that damaged frames should be discarded, thus only good ones will be passed up to the net stack, then it makes no senses for the net stack to see FCS just to trim it. The last consumer of the flag M_HASFCS has been removed since change [1]. It is time to retire it. 1. 105a4f7b3cb6 ng_atmllc: remove Reviewed by: kp MFC after: never Differential Revision: https://reviews.freebsd.org/D42391 --- sys/net/debugnet.c | 4 ---- sys/net/ethernet.h | 1 - sys/net/if_ethersubr.c | 10 ---------- 3 files changed, 15 deletions(-) diff --git a/sys/net/debugnet.c b/sys/net/debugnet.c index c6f57ec84618..8b1419bcaa28 100644 --- a/sys/net/debugnet.c +++ b/sys/net/debugnet.c @@ -570,10 +570,6 @@ debugnet_input_one(struct ifnet *ifp, struct mbuf *m) m->m_len, m->m_pkthdr.len); goto done; } - if ((m->m_flags & M_HASFCS) != 0) { - m_adj(m, -ETHER_CRC_LEN); - m->m_flags &= ~M_HASFCS; - } eh = mtod(m, struct ether_header *); etype = ntohs(eh->ether_type); if ((m->m_flags & M_VLANTAG) != 0 || etype == ETHERTYPE_VLAN) { diff --git a/sys/net/ethernet.h b/sys/net/ethernet.h index e7313e78c5bb..cf92145eea8f 100644 --- a/sys/net/ethernet.h +++ b/sys/net/ethernet.h @@ -40,7 +40,6 @@ /* * Ethernet-specific mbuf flags. */ -#define M_HASFCS M_PROTO5 /* FCS included at end of frame */ #define M_BRIDGE_INJECT M_PROTO6 /* if_bridge-injected frame */ /* diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index eeb2c1ea4ef3..6cd5cefa9609 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -588,16 +588,6 @@ ether_input_internal(struct ifnet *ifp, struct mbuf *m) */ ETHER_BPF_MTAP(ifp, m); - /* - * If the CRC is still on the packet, trim it off. We do this once - * and once only in case we are re-entered. Nothing else on the - * Ethernet receive path expects to see the FCS. - */ - if (m->m_flags & M_HASFCS) { - m_adj(m, -ETHER_CRC_LEN); - m->m_flags &= ~M_HASFCS; - } - if (!(ifp->if_capenable & IFCAP_HWSTATS)) if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); From nobody Thu Jul 4 20:34:06 2024 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 4WFSzf3sCwz5PhM7; Thu, 04 Jul 2024 20:34: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WFSzf3N9tz4K1B; Thu, 4 Jul 2024 20:34:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720125246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KNQj3jUi07N7lgi6dXrwYgZC0+9M7K3FzQXRirCvAsQ=; b=GC/CDfevPG8/ZhpqyABMkqNxzy8XzM8qX3Auqx3SQC3q1le2tlLrVvM0rj+SK9l7WVN2Vj 7R8WXBVv8F/T6UeGL5nlmaQVeevWnOGArUlClA5Ym+6DIIvqjGFDQoJ/U2qq8eUPVQymkI 4rgwGfgFdMkQFLnZ7LQn1wtnSUf9cejObaIFcTDlapFknpLeLIXpnYkkva/H+ve68eGAh0 6OHbccFRewPzDNBS1kkTfeCgwxNOuyVq4WpCV5TEMInCnJM7QMi+P5TiZfY3oge9i5O4KQ Hp35b7jMjf4AS/6ya7ithZUJkyW55DV4/VKET1DHj9fIc2snRv8nZOX5XFLM2g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720125246; a=rsa-sha256; cv=none; b=sQBbXkaEDYemnArUUwmpUyO8bxJNjjjg1S9DxobyCURzaIY6BlCjZKKpam1DE5xUC1qOW7 VuD5ZUy8PSFX4GGREqUy5SgK2gkvJ34CM4fpIMt/vmAM40Xao7KAt3IF+28gwS09wumZsW yi3B7REjh3WQucTCXhUg2yivPOlvsFxHyftr5dMvi4XxF/S2CbCBp9AA6+88SnShgKDCfh 2cDT3SoVV+vKH6h0l/Rma8shw9mS1kjBysomqrUGouoFegrFPMihmfx8b2gJ3J8lT2lTAw OvlgiLph+tmS+ol0go52yG+qUpCDlgLSVT/ZR1/UUX8Dqg3z9EHu8+L7Ye9sPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720125246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KNQj3jUi07N7lgi6dXrwYgZC0+9M7K3FzQXRirCvAsQ=; b=Fpi8dx+1hlw42zpx7tdHaw5vbwMpdhfhHz0itQnSLGinu7aMiSKQ9kW+Xr6sKf6tmOgCSx WZKSKBVSkhXkQo0SUH4jlumC3W+N+hJpjOnVuUov2vCC4ifBQRZBfYLOiznd20ZbHyATcJ SSVOXtlKq8ryL6PliiL8YZyIRorW0R9E3YUsbhMb5XURpwsuseMc8ho1YVvfrJH4OtJe/c ukZiyPVQTHI9cLdSuO6AG6yl6OZZoII5URJZaxJf5p29fZFalSfAVLY4RFAiQK1Pe6I5YD bX0VOd15SfzD+31EtVA489e2rUcUldjafGQIECC2vMiajRc+JhF0E+cxYQ5O8A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WFSzf2zZqzSQk; Thu, 4 Jul 2024 20:34:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 464KY6es007842; Thu, 4 Jul 2024 20:34:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 464KY6H3007839; Thu, 4 Jul 2024 20:34:06 GMT (envelope-from git) Date: Thu, 4 Jul 2024 20:34:06 GMT Message-Id: <202407042034.464KY6H3007839@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: 7f50027321db - main - ctladm: don't require the use of "-p" with "port -r", part 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 7f50027321db3b08477f6236abded0297e9e5ed8 Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=7f50027321db3b08477f6236abded0297e9e5ed8 commit 7f50027321db3b08477f6236abded0297e9e5ed8 Author: Alan Somers AuthorDate: 2024-07-04 20:32:24 +0000 Commit: Alan Somers CommitDate: 2024-07-04 20:32:24 +0000 ctladm: don't require the use of "-p" with "port -r", part 2 * Remove a now superfluous FALLTHROUGH hint * Don't specify "-p" with an empty argument in the tests Reported by: jhb MFC after: 1 week MFC with: edbd489d09babebdc6c03924a912013be584c409 --- usr.sbin/ctladm/ctladm.c | 1 - usr.sbin/ctladm/tests/port.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.sbin/ctladm/ctladm.c b/usr.sbin/ctladm/ctladm.c index 5abc95cddc34..bcbddf50d724 100644 --- a/usr.sbin/ctladm/ctladm.c +++ b/usr.sbin/ctladm/ctladm.c @@ -592,7 +592,6 @@ cctl_port(int fd, int argc, char **argv, char *combinedopt) } #endif case CCTL_PORT_MODE_REMOVE: - /* FALLTHROUGH */ case CCTL_PORT_MODE_CREATE: { bzero(&req, sizeof(req)); strlcpy(req.driver, driver, sizeof(req.driver)); diff --git a/usr.sbin/ctladm/tests/port.sh b/usr.sbin/ctladm/tests/port.sh index 633dec2fd273..a9ff609d3f4c 100644 --- a/usr.sbin/ctladm/tests/port.sh +++ b/usr.sbin/ctladm/tests/port.sh @@ -62,7 +62,7 @@ cleanup() { ;; "iscsi") TARGET=`awk '/target:/ {print $2}' port-create.txt` - ctladm port -r -d $driver -p "$PORTNUM" -O cfiscsi_portal_group_tag=$PGTAG -O cfiscsi_target=$TARGET + ctladm port -r -d $driver -O cfiscsi_portal_group_tag=$PGTAG -O cfiscsi_target=$TARGET ;; esac fi From nobody Fri Jul 5 05:45:10 2024 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 4WFjCW04mfz5QW3s; Fri, 05 Jul 2024 05:45:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WFjCV3xVqz4QcL; Fri, 5 Jul 2024 05:45:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720158310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rv/9c80kkbHS6Zx/TjPmmbdZJiJbM2gjsEPpMrxBDjE=; b=UzkKXnI+cFzAZ2R1LSjbHOi+utCUHyLIjrowQl9LFfOH8wqqWanKwAk7nLsOEUWuZ4KcKU IkWSGFW1jfKafzHtfDTFF7/ncze1ACGFFbttYiMhyXBj5SErAHAwgpuqatrqfxyoyTEyFv AzMRymqNfDlg4HfaDZf7KJEEo7Bs0oZgsWA1T5cdf3oAweRclsi2KGzeCT+/OLX6uVj9Q4 rYJbvOgbVHtQiGm5vH8uoDXRJRSayVoFGcgpoM8NbhjWJdtTppibHqneQQjjQjilbeIkPA CqabMj3Vtwa0zgtfI68Qy8ye2xtpXCthms3dup0n1J2fmFMbDZPll20m7O2rHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720158310; a=rsa-sha256; cv=none; b=hAszu0fqWY1FFR7/vQyIytD1PYSwHr8rwiwagW+9HZYZert5nEIPbRMichOQES5RwNj6RF oGlKHFdu2v/zHyq6a04Gvmouehjv4CrXQfP2Trwj2W4I5zwHdhn3j81Ze0ltnS/dauyGCO XBcQ+LDofEEccrJvn30EOmF6G0DtewVccqZHUa5+NffBqYFW2ukWbZOAeh5kY2Fd0+bGt7 2lgWfb/a/m/pCg9BJSpxWlGZf4VOdCnCunti5cJO/m97MkViK83knjwYrkVuniQWA5zqLp F61C28bPQmK43scaOiTW30cWh34DOc/r97iJbMN2/iHQLXqLl+23i1iI7AcO9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720158310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rv/9c80kkbHS6Zx/TjPmmbdZJiJbM2gjsEPpMrxBDjE=; b=LKtji60rMSWQZ9GctdV3qgDgC+0BxmiGZz/Chc4itJCrM8Y7/YmZQQWAEQKjoHfjsvNiXF 182Rtw2UTFprkSQ6QJJEpRIi55mhBIeyC8CF+/Kq7hnWbmOphMQMsaJ7Gu6eIK5ATcTkMo K2hPl0T+CuTjNloJdWmVUbj/tNRdPdGjMQaHhPOdguqA9eYUnOThHuLM5nnOmGwP0/i3TV 5AjfK9c5PjyTIyGjsYeFfMYhB63cg+pBszo/ahrnQOsGuQf07C/+eU7c1E//YbK7/7zRmA dzioQ5WXbKOY7hw20RzyfWYR2uzAHOoMpF+F7Z7ydxmPEGG3bYzaemqKGTCjCw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WFjCV3Y1ZzlNT; Fri, 5 Jul 2024 05:45:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4655jAJF037749; Fri, 5 Jul 2024 05:45:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4655jAM1037746; Fri, 5 Jul 2024 05:45:10 GMT (envelope-from git) Date: Fri, 5 Jul 2024 05:45:10 GMT Message-Id: <202407050545.4655jAM1037746@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: 383fd3ea0012 - main - arm64: Handle an unaligned start in pmap_mask_set_locked() 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 383fd3ea00128cf65fbea0e4cbdb9849945c854b Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=383fd3ea00128cf65fbea0e4cbdb9849945c854b commit 383fd3ea00128cf65fbea0e4cbdb9849945c854b Author: Alan Cox AuthorDate: 2024-07-03 05:15:35 +0000 Commit: Alan Cox CommitDate: 2024-07-05 05:42:52 +0000 arm64: Handle an unaligned start in pmap_mask_set_locked() In pmap_mask_set_locked(), correctly handle a starting address that is in the middle of an L3C page. The symptoms arising from this error included assertion failures in pmap_demote_l3c(). Reported by: andrew Reviewed by: markj Fixes: fd6cb031f577 "arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1]" Differential Revision: https://reviews.freebsd.org/D45851 --- sys/arm64/arm64/pmap.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index f4a46823428a..a9cb8c7fe468 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -4403,8 +4403,22 @@ pmap_mask_set_locked(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, pt_entry_t m va = va_next; } if ((l3 & ATTR_CONTIGUOUS) != 0) { - l3p += L3C_ENTRIES - 1; - sva += L3C_SIZE - L3_SIZE; + /* + * Does this L3C page extend beyond + * the requested range? Handle the + * possibility that "va_next" is zero. + */ + if ((sva | L3C_OFFSET) > va_next - 1) + break; + + /* + * Skip ahead to the last L3_PAGE + * within this L3C page. + */ + l3p = (pt_entry_t *)((uintptr_t)l3p | + ((L3C_ENTRIES - 1) * + sizeof(pt_entry_t))); + sva |= L3C_SIZE - L3_SIZE; } continue; } From nobody Fri Jul 5 13:16:50 2024 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 4WFvDf5Hjmz5PNYC; Fri, 05 Jul 2024 13:16: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WFvDf4hlQz42KG; Fri, 5 Jul 2024 13:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720185410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JU0TGMVQzJRhLhd9MgdhKZYO2rkGq5vDdKW+JtQoSOI=; b=Q2EnnNK+jY1ckVQPB9xSI1XT/6T9oTEH1lOzc0PMYJ2YcAu3A2Tn4RbO2lT5gBYooOnyCH z49scTn4WETcny6S9ndDQZlPp5m60KCTdFg3PzXlCUBmetBvY/Q9+FlG3M2CthPNaGIV0M fEttOo8wYaMoYj74CWmxJN18FpUbPMnPK3Ce74gghjdRgqZ5PT1znBStxv3YyqWuz0GuD5 Y4uEefCgHi5ynEd2MX2xMZHg/SZVvZ1CsqX80mbpuEt+ODDowk01fukhyzc3Kte2PQNWsH 3aHw5TI2uLp2xQLmRevojj5ASg4a3Dd+rbedXwG7UrpO07bQH+R67iT5gQDWrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720185410; a=rsa-sha256; cv=none; b=tF4rzep9nZq8E7F48NWDdv83YIAz+YiE71b1dRXFKYaGE/SKHdn1nVw04E4cejrMtlxouy shRN2CqVQxJbKfI1u5WQYUhOlTFBVdt+OVgzRKAd5MAKvv0fNthzK5bWCbXAEs4zoh1+AP jlVlZQPpOG4gS/435DG/jhEgwSSZM2fr1hOT4TIUG/qU/125L4WLAoR2LV8MWoq9R8yhiO bzacxjDj6zkuVyb4M20WAMmrdJTiXkgzbFI23Af8xVTTPPjY/5yHePgJy6+2m17FnmuF6W NxokXU0Pl9ECBtsrrO+kiAN0WYa3nvAtAm1o0hGVnrcZR4mG3hZQBHGNM4IE2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720185410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JU0TGMVQzJRhLhd9MgdhKZYO2rkGq5vDdKW+JtQoSOI=; b=ECuarq4W+dUclh8Lb0KlQk6yP3AD7krieYAG1ekf3uy56FHIw3akVVFy1J+mOE7NgW5DLn 7l571qpVXY0lxWBZPVx7rq4qC4TrV4RZSW8ljUSDPwm3krGPbeOc7tbEePjFv5DVLxvuaY N0DMxbWJVAfjKO9FlvElWgSyXB6Qdob8Fajb4e1rJlFV98QrPMIrIH6Ghf5xRNMVrcEq63 VgpnDWwqT+RW+wlKxO/oLqJe4Iafpf1KWN/OD/dd4cJoaCIjgpNSWvFMAfKt6Zkc3Wtezf kCmmOk3D+aYTCz7ZHw5GrncZyDJ0UZzGhF+RIzjGQ4irfTbt8Ows0Ls4YV8Jcg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WFvDf4J9wzyLg; Fri, 5 Jul 2024 13:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 465DGoCe097486; Fri, 5 Jul 2024 13:16:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 465DGoJm097483; Fri, 5 Jul 2024 13:16:50 GMT (envelope-from git) Date: Fri, 5 Jul 2024 13:16:50 GMT Message-Id: <202407051316.465DGoJm097483@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: b81424adf718 - main - OpenSSH: correct logic error in ObscureKeystrokeTiming 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: b81424adf7181d816c10b1345aaa3305ab0ec304 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b81424adf7181d816c10b1345aaa3305ab0ec304 commit b81424adf7181d816c10b1345aaa3305ab0ec304 Author: Ed Maste AuthorDate: 2024-07-01 13:14:15 +0000 Commit: Ed Maste CommitDate: 2024-07-05 13:16:40 +0000 OpenSSH: correct logic error in ObscureKeystrokeTiming Cherry-pick fix: upstream: when sending ObscureKeystrokeTiming chaff packets, we can't rely on channel_did_enqueue to tell that there is data to send. This flag indicates that the channels code enqueued a packet on _this_ ppoll() iteration, not that data was enqueued in _any_ ppoll() iteration in the timeslice. ok markus@ OpenBSD-Commit-ID: 009b74fd2769b36b5284a0188ade182f00564136 Obtained from: openssh-portable 146c420d29d0 Reviewed by: gordon Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45823 --- crypto/openssh/clientloop.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crypto/openssh/clientloop.c b/crypto/openssh/clientloop.c index 8ec36af94b3f..6dcd6c8535aa 100644 --- a/crypto/openssh/clientloop.c +++ b/crypto/openssh/clientloop.c @@ -608,8 +608,9 @@ obfuscate_keystroke_timing(struct ssh *ssh, struct timespec *timeout, if (timespeccmp(&now, &chaff_until, >=)) { /* Stop if there have been no keystrokes for a while */ stop_reason = "chaff time expired"; - } else if (timespeccmp(&now, &next_interval, >=)) { - /* Otherwise if we were due to send, then send chaff */ + } else if (timespeccmp(&now, &next_interval, >=) && + !ssh_packet_have_data_to_write(ssh)) { + /* If due to send but have no data, then send chaff */ if (send_chaff(ssh)) nchaff++; } From nobody Fri Jul 5 22:06:07 2024 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 4WG6zM59SHz5QdVC; Fri, 05 Jul 2024 22:06: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WG6zM4fMyz428p; Fri, 5 Jul 2024 22:06:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720217167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ewKGB+zcJrKKOoDd6yHcOZDNhRFX6jniLvOOun+3hBU=; b=x6SVvASCvRY9MAg4wcnHm+6MlSBHwL3JV18z0ACuRxwgTbUfxg+RHgx5UIH0MxScLYhxX5 EsbVNgFV8A4Dgb6TCUwaH/f46cFzM7kAePjSGgAjvfKojrvia25SboYVQsLpawEYneqNHL kJcimR+6hrJBQK2t46WyidtjdLl/OlonbCvdlCYnD+PfKWy2gRtZIfEFuDZUUoYeZrkdz8 rKcwnkF2Ub9AMjLXZCfc4+U3rimyqA7pXyQqESXuW6ZZ+C+T13mVgug/RNf2fUpZim6Ih1 ahNkx1WkKvHhsTaoVEetg1J9cqGGFJ08U1R3CxhMYkgrYIBe6HYqI47szt1W7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720217167; a=rsa-sha256; cv=none; b=ussantwqDpxPa4HkwJmHiDHAur3Ao8+ZUm7u0PfEt4eVR0KVIkyV596rQzJCXV2sQZQUU1 rtj1j7XjzE3N1DMD+oH+Uz6yjKZM1DcLLTaAVtwGgbBuKTERBxc7miTyKYaXA0boa+OuyT iKl9f8ErPIKXzUzpByKm5mcAxJg+bUy0+qVYHQgU0QwcnZIngM2+rSFgSKY15vmr1O1mCn 8ukCM7O3ATRni/RECtAs0lVuhXKavWSAiPz+j+LaRRTbgIzVGAPaBU3UwFGvetYwjWUqR/ 6Xalj98MNhb9uBRYpyJSDUPtLttSjxvOMQOyMBj1i+XjoAjctpUu0DOaqXma7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720217167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ewKGB+zcJrKKOoDd6yHcOZDNhRFX6jniLvOOun+3hBU=; b=PnHpyKBmxykcT/wgwWfEQeLNbzhgCehYWt+UiVoRsxwh6Ge+oHKLOhmiVHOTHvk0/ldM2y ga/q/0Ar2hFnVOZzr4tCd84L1htiTwEsFJQ5cNx+nFNMdjYKIOD0sbbfq0kOjmyaslyLRH JFBKpDdQLJ6YfVb/cwbWMHMT8dRzAJHWQJNQ5erimra3Z6OyTHFRY1zXYy6BxgW3ZPmwzN 11sbQJcPl/UL1Ol2s7xF1D8Gplep7qVsFOwqq7NhTPWvkk1EIjuV8C+fcz8WqTnlHs7i/D MAS64PwqMNVCgIBMpR9wV2C6JnQVlXzwZpNUh2wbAE7/u0XFzKPzTAWcFGvI5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WG6zM47LLzDsq; Fri, 5 Jul 2024 22:06:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 465M67Lx088602; Fri, 5 Jul 2024 22:06:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 465M673P088599; Fri, 5 Jul 2024 22:06:07 GMT (envelope-from git) Date: Fri, 5 Jul 2024 22:06:07 GMT Message-Id: <202407052206.465M673P088599@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: c15290fb9d8f - main - tftpd: Code cleanup. 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c15290fb9d8fdf4b11b9c6e7406b67c73a98402d Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=c15290fb9d8fdf4b11b9c6e7406b67c73a98402d commit c15290fb9d8fdf4b11b9c6e7406b67c73a98402d Author: Dag-Erling Smørgrav AuthorDate: 2024-07-05 22:05:49 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-07-05 22:05:49 +0000 tftpd: Code cleanup. MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D45871 --- libexec/tftpd/tftpd.c | 91 +++++++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 50 deletions(-) diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c index 3f67ad2920cf..a51fb4742985 100644 --- a/libexec/tftpd/tftpd.c +++ b/libexec/tftpd/tftpd.c @@ -680,28 +680,27 @@ find_next_name(char *filename, int *fd) int validate_access(int peer, char **filep, int mode) { - struct stat stbuf; - int fd; - int error; - struct dirlist *dirp; static char pathname[MAXPATHLEN]; + struct stat sb; + struct dirlist *dirp; char *filename = *filep; + int err, fd; /* * Prevent tricksters from getting around the directory restrictions */ - if (strstr(filename, "/../")) + if (strncmp(filename, "../", 3) == 0 || + strstr(filename, "/../") != NULL) return (EACCESS); if (*filename == '/') { /* - * Allow the request if it's in one of the approved locations. - * Special case: check the null prefix ("/") by looking - * for length = 1 and relying on the arg. processing that - * it's a /. + * Absolute file name: allow the request if it's in one of the + * approved locations. */ for (dirp = dirs; dirp->name != NULL; dirp++) { if (dirp->len == 1) + /* Only "/" can have len 1 */ break; if (strncmp(filename, dirp->name, dirp->len) == 0 && filename[dirp->len] == '/') @@ -710,30 +709,20 @@ validate_access(int peer, char **filep, int mode) /* If directory list is empty, allow access to any file */ if (dirp->name == NULL && dirp != dirs) return (EACCESS); - if (stat(filename, &stbuf) < 0) + if (stat(filename, &sb) != 0) return (errno == ENOENT ? ENOTFOUND : EACCESS); - if ((stbuf.st_mode & S_IFMT) != S_IFREG) + if (!S_ISREG(sb.st_mode)) return (ENOTFOUND); if (mode == RRQ) { - if ((stbuf.st_mode & S_IROTH) == 0) + if ((sb.st_mode & S_IROTH) == 0) return (EACCESS); } else { - if (check_woth && ((stbuf.st_mode & S_IWOTH) == 0)) + if (check_woth && (sb.st_mode & S_IWOTH) == 0) return (EACCESS); } } else { - int err; - /* * Relative file name: search the approved locations for it. - * Don't allow write requests that avoid directory - * restrictions. - */ - - if (!strncmp(filename, "../", 3)) - return (EACCESS); - - /* * If the file exists in one of the directories and isn't * readable, continue looking. However, change the error code * to give an indication that the file exists. @@ -741,18 +730,20 @@ validate_access(int peer, char **filep, int mode) err = ENOTFOUND; for (dirp = dirs; dirp->name != NULL; dirp++) { snprintf(pathname, sizeof(pathname), "%s/%s", - dirp->name, filename); - if (stat(pathname, &stbuf) == 0 && - (stbuf.st_mode & S_IFMT) == S_IFREG) { - if (mode == RRQ) { - if ((stbuf.st_mode & S_IROTH) != 0) - break; - } else { - if (!check_woth || ((stbuf.st_mode & S_IWOTH) != 0)) - break; - } - err = EACCESS; + dirp->name, filename); + if (stat(pathname, &sb) != 0) + continue; + if (!S_ISREG(sb.st_mode)) + continue; + err = EACCESS; + if (mode == RRQ) { + if ((sb.st_mode & S_IROTH) == 0) + continue; + } else { + if (check_woth && (sb.st_mode & S_IWOTH) == 0) + continue; } + break; } if (dirp->name != NULL) *filep = filename = pathname; @@ -766,27 +757,27 @@ validate_access(int peer, char **filep, int mode) * This option is handled here because it (might) require(s) the * size of the file. */ - option_tsize(peer, NULL, mode, &stbuf); + option_tsize(peer, NULL, mode, &sb); - if (mode == RRQ) + if (mode == RRQ) { fd = open(filename, O_RDONLY); - else { - if (create_new) { - if (increase_name) { - error = find_next_name(filename, &fd); - if (error > 0) - return (error + 100); - } else - fd = open(filename, - O_WRONLY | O_TRUNC | O_CREAT, - S_IRUSR | S_IWUSR | S_IRGRP | - S_IWGRP | S_IROTH | S_IWOTH ); - } else - fd = open(filename, O_WRONLY | O_TRUNC); + } else if (create_new) { + if (increase_name) { + err = find_next_name(filename, &fd); + if (err > 0) + return (err + 100); + } else { + fd = open(filename, + O_WRONLY | O_TRUNC | O_CREAT, + S_IRUSR | S_IWUSR | S_IRGRP | + S_IWGRP | S_IROTH | S_IWOTH ); + } + } else { + fd = open(filename, O_WRONLY | O_TRUNC); } if (fd < 0) return (errno + 100); - file = fdopen(fd, (mode == RRQ)? "r":"w"); + file = fdopen(fd, mode == RRQ ? "r" : "w"); if (file == NULL) { close(fd); return (errno + 100); From nobody Sat Jul 6 16:03:04 2024 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 4WGZt049r1z5Qsqb; Sat, 06 Jul 2024 16:03: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGZt01rPZz4l8c; Sat, 6 Jul 2024 16:03:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720281784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7sfAh2yFmEoglyr8YYB6ZYIWc3mA9JOXVBJLvSmu0Do=; b=atvH3ibRmgYScvbySf/BDoQjUeyTQtmfUDHR9yxH6ubwzL1nLbTQKhn7srcVan9VmsqfBk o/x582aAzkoSajqHr5ubb5bHSQw+DCZtrohstPXI2knx1dL4S0tIPxbqdN+khIjWoyGcSR KW1eBNc/NQ5XeY29ZQCbFAUj2sNhh9eMckS92wTUQhv6haeMn2C5Uf4EjvhO8/FLhR3WIw y1BGgtvKThpyyrWSe0+40z8yTcwiu22PkFKijh2sOeaWvyrNMIK6sWyzGI6K1Kgs9fj2/5 N3fjlBoMF9VbY3eFDeMA15zEHjGwD1j36B8adKXKtwtRZQSpVh20piaiebWuQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720281784; a=rsa-sha256; cv=none; b=aoz/O4E0wxqXV90SuC+/lDFhcWovs2aJvcc9viXRIfyO/Z2aVZc2ZaEQx+N42sHHZHliGo +Io+5rIAoWYDCwGy91XEsQlEgKTz59Fl4guYHGSYFdyClEgIQPgJLiFKyQox2pfmtFNwZ1 +vZggRdkDgIAo8suf00w86gfTx0vPWKlNvlmeQTOHa5srajw6GQ3H/NxDFd6kb0dJCTgPt txI2vaf+9DGEe0FlJY6EKMcD8yBsubl60e8w4UegEcebU4Id3oMit++h61aTpA5+J4yX02 7BjRDT3d2RRpygzkeElocVLw7dEruwnkA7Hc3ulTTa+MOaZgcE+DNG7cAu3Fwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720281784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7sfAh2yFmEoglyr8YYB6ZYIWc3mA9JOXVBJLvSmu0Do=; b=rnnHrFF2hPokd+Bpk85ZU+5sbN7rxf2ao5d7skQQ0AsVKrmXFeRpqvkP2wYy7eEMdMqejx AwVeSsY1xak6dZithp8a/EjO8s2x+XRxB5wzObaqgPnzqNyTmYjFUfsYjAw87rIa7URp86 JjKN62JPTrzTTr4EW6oBDufSZ2qA2ltyDZQurYC68epleHOLBMZr3rNj7MHvDUbLOZi+Pn zGpea1e0AsBzIWTu12RFbece5c9Z5NbgLGPxLDNxD4Y96r+ZewzcJIgQEaVNXRUKXCcgY+ f1FHJjuq+0AR9DUlj/on61RG26MgLNXwBXzmxejHYf1jabABiAJI5syn+vgukg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WGZt01S7nzmQ9; Sat, 6 Jul 2024 16:03:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 466G34LX020174; Sat, 6 Jul 2024 16:03:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466G34mC020171; Sat, 6 Jul 2024 16:03:04 GMT (envelope-from git) Date: Sat, 6 Jul 2024 16:03:04 GMT Message-Id: <202407061603.466G34mC020171@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: 6d59c062d824 - main - cdefs.h: Retire __const and __signed 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 6d59c062d8245a68e80b3a0bb2924ab49ab7dd49 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6d59c062d8245a68e80b3a0bb2924ab49ab7dd49 commit 6d59c062d8245a68e80b3a0bb2924ab49ab7dd49 Author: Warner Losh AuthorDate: 2024-07-06 16:02:25 +0000 Commit: Warner Losh CommitDate: 2024-07-06 16:02:25 +0000 cdefs.h: Retire __const and __signed These are no longer used in the base system. Once upon a time they were used to ease the transition from K&R to ANSI C. These days, we use both of these keywords in their bare form everywhere, even in our headers. Any uses of __const or __signed will be converted to their ANSI meaning in the compiler, but is beyond the scope of cdefs.h's charter. For pure K&R compilation, with an enforced only use K&R features and meanings, one needs to define NO_ANSI_KEYWORDS (though even that support is wobbly at best, being active only for !GCC or gcc-adjacent compilers which currently appears to be none). Sponsored by: Netflix Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D45860 --- sys/sys/cdefs.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index b92992c1b5c3..e08da15e1d91 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -124,8 +124,6 @@ #define __STRING(x) #x /* stringify without expanding x */ #define __XSTRING(x) __STRING(x) /* expand x, then stringify */ -#define __const const /* define reserved names to standard */ -#define __signed signed #define __volatile volatile #if defined(__cplusplus) #define __inline inline /* convert to C++ keyword */ @@ -141,9 +139,7 @@ #define __STRING(x) "x" #if !defined(__CC_SUPPORTS___INLINE) -#define __const /* delete pseudo-ANSI C keywords */ #define __inline -#define __signed #define __volatile /* * In non-ANSI C environments, new programs will want ANSI-only C keywords From nobody Sat Jul 6 16:03:05 2024 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 4WGZt15xy7z5Qsqf; Sat, 06 Jul 2024 16:03: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGZt13TZhz4kwc; Sat, 6 Jul 2024 16:03:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720281785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KbTAJm9qfZzyHUf8pqI2CQctfsra5kM2iWMV5YNbvP4=; b=pD7lDKBDjptkyauo4W55BorOq2OugTmHCa5YxQSx11Y1dluhpTE5QpmHNZPGrlAQOjPtCi vfVyRRfYjg5ArswgLrRbF67HKBuO8IlSoWeMI27ibpFNcMTFL9DiEmuDgVFE+/Xn220p/E z1hLZNC/6lWtWcC5qdZnbjQICMwyA0XHoh1zcdC936Zq1A8HlhoGCMdGArmOkhsT4jecrE 6vmODQVT/VjiA8HJLjGNDY8Bh3KejDMw15CBpG8fZ57e1zHic1v5rCSs7hAJazfzUvD6Zl L9jeRRtEcWNKTOcPgCSXrpTNbRddLZD7KXvIO2Odh8UmOVjNgFr+7Ktfq1TfBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720281785; a=rsa-sha256; cv=none; b=ihp8UveDaLSo8iQKWvrFoDxOAJp5qta87/FtVYyHXEEvseQvCy6jmr5u5LrX/xKVW0RFnA 4+uua4Ahaqde+ztKvJcdDxfve4z0/dMECytxUjOf8Tj/pyCZeT+563b5YCWpTGGh/VPIJ3 04vzj+IbszUpcowrfB1NOfDaVRbkHHhbljQNQgKFYiSuSgele7RIzB6KgcfFoQW2ipxHZY cbTs+XZ4wRlQp2X1PSS+o6FtKY2c2VwImxFgPPiyj6YVUYxJ4UcdeEQ8fPRtp25z/cempO bl7bj2RKu9Nqf4+D5mjzSwlaZs10cpdxTTZk5DaldogI43bEdMET91efMNfj3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720281785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KbTAJm9qfZzyHUf8pqI2CQctfsra5kM2iWMV5YNbvP4=; b=ShsiJtwyiXJ5ZrAg7LvZWkaqBqc5kcO6phFRE7xLtqN8dB3fpfmZQA6jCr8ASZJekff4iG elbAArIKgatfzojf4GLz50eyb3pk8a+VH2B89duCV0B+mJrVA9hgFHtQmwKaqSL3fzweRt N7LsEBMivRZ9ZHaTqKNSFDEnA5Exiojn7d+RIFiWfj71oTCkeMjL26Np2m3ywXGuu2ET73 5hskt7Odh4sb4hIDZgViqftY8W5K4EEEhJBW/jjFCOA4DKyq3OkoZ+nS7xqvL7dOg8isXg CSQa4dCLzV9sVdBominvIsO7WHfptbEEYYlMyxJv22m7/TcH7t+We5n9tdrNMw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WGZt12Q46zmn0; Sat, 6 Jul 2024 16:03:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 466G35BY020211; Sat, 6 Jul 2024 16:03:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466G359I020208; Sat, 6 Jul 2024 16:03:05 GMT (envelope-from git) Date: Sat, 6 Jul 2024 16:03:05 GMT Message-Id: <202407061603.466G359I020208@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: 9a04df0515c9 - main - cdefs.h: Remove NO_ANSI_KEYWORDS 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 9a04df0515c9bdc21cc26b31b0cdba14c0e12584 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9a04df0515c9bdc21cc26b31b0cdba14c0e12584 commit 9a04df0515c9bdc21cc26b31b0cdba14c0e12584 Author: Warner Losh AuthorDate: 2024-07-06 16:02:35 +0000 Commit: Warner Losh CommitDate: 2024-07-06 16:02:35 +0000 cdefs.h: Remove NO_ANSI_KEYWORDS Remove very old, deletion of ANSI keywords. Once upon a time, it was common to want to do this. Then we only did it for non gcc compilers, then all compilers claimed to be gcc, so we never did it. These days, it's about useless to keep around since there's no compilers we can test it with. It's an odd little artifact. Also, the advice in the comment is wrong: if you define NO_ANSI_KEYWORDS, you can't have progams that use const, etc as identifiers because they will be deleted. Further, our header files have the 'bare' ANSI forms of these, so it's a catch 22: You'd need them deleted for .h files, but not for the code. It's such a niche case these days that it's best to just remove it. Sponsored by: Netflix Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D45861 --- sys/sys/cdefs.h | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index e08da15e1d91..b8908138bd65 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -137,24 +137,10 @@ #define __P(protos) () /* traditional C preprocessor */ #define __CONCAT(x,y) x/**/y #define __STRING(x) "x" - #if !defined(__CC_SUPPORTS___INLINE) +/* Just delete these in a K&R environment */ #define __inline #define __volatile -/* - * In non-ANSI C environments, new programs will want ANSI-only C keywords - * deleted from the program and old programs will want them left alone. - * When using a compiler other than gcc, programs using the ANSI C keywords - * const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS. - * When using "gcc -traditional", we assume that this is the intent; if - * __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone. - */ -#ifndef NO_ANSI_KEYWORDS -#define const /* delete ANSI C keywords */ -#define inline -#define signed -#define volatile -#endif /* !NO_ANSI_KEYWORDS */ #endif /* !__CC_SUPPORTS___INLINE */ #endif /* !(__STDC__ || __cplusplus) */ From nobody Sat Jul 6 16:16:45 2024 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 4WGb9n72pYz5Nx9x; Sat, 06 Jul 2024 16:16: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGb9n6TF7z4nd9; Sat, 6 Jul 2024 16:16:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720282605; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7hHOaOca4eIE2lOzGWOa7x3Y0Y0Xi4uZUxybnYpgRCU=; b=hquWYCxu6JGOx1cRixe4zmQ7cOA4vzY7M+sIxzB6x4jCR3nk9G83qrylz00iytOyDTm/Yw bgTyTqYKctYwGu9SEPRMSsVZPkm09UR0jJZk5vhuGpJMUBMqzZQQ+MOMvTAh7VQnk037dz q0INVdEFoRopUxMcM7OAEgQLyXki3St/x6q2YIs+E1/E2kuy6XJWhwl12GVfkc4OUWxkp3 MvTluN3CnbpvGLILqybjsUE3WGvuPx75kur3iarn/RxSZKOi4600SaH3/7dUXPUCTgvMkB JaOiGSIc5wcwV32N4cTy9D296R9BkO9FCmJO01tVKJHVm2rLuyfNui8FybnGOw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720282605; a=rsa-sha256; cv=none; b=wK9qG9LngUPXgcFyhx9pyY0RoVvaa3DuxscqPuA6YGZ2oUOjE97u4Ac1yDsQZ8G3JFxDQr V2GeR/4Qm4rqraUkWLSzX+NpAp/ZBWIhtkqpyRDSgKMUyYq8U7IqTNTdgahDKpuD4ZgrvH +8RNl/KQigg+IElMCa9gaB1KTivzkKoNi1QnXy0x3WUEpeO3Zi/V7WltaNPcKI8wIv0OOS mER5LljsTK9uoKWttqYY1O6BzoKrBZTdcCMH0lk9REV+iPVWxsf7EQA9zhHymxTzMs3CPL TwMSFZKuEvH4UwhAlIMYW+I+0gJ3PumfpWtpYPyzNgNfBHqe+IY6erH4OdYunQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720282605; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7hHOaOca4eIE2lOzGWOa7x3Y0Y0Xi4uZUxybnYpgRCU=; b=Rihn5IJYbweHaldLmSNZF28A1UfsA10sTi8UGjnPwSVCdaWOALqBZlambrfR3inSPEXLOH tP6XcjsHMt637LZOHI95/HMYeUHSPfhM4Fcu1QY7ddfJcDdr9xGvQ+m/nkcjlKMVo3fHVF o/Np7IJDitaMVjNtRvRWYVZFw3hrsGX/NyH4wGaTxa1bCsgepue/ubAm+5dHQTg3eVi6l5 UoQLSIPYMuzmAsEvxdFeKNQ+6rZLBhZM9uRlk/2TNpigmmf9bEF278G/cakSeKm3lQL+Ne 6OY13eoqKIMoNduCwqtZCaKP5Yd1kGKuKPaCllG/xnpm5P8p32EfKiHoWMY+MA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WGb9n5jJjzmR0; Sat, 6 Jul 2024 16:16:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 466GGjXi038338; Sat, 6 Jul 2024 16:16:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466GGjTK038334; Sat, 6 Jul 2024 16:16:45 GMT (envelope-from git) Date: Sat, 6 Jul 2024 16:16:45 GMT Message-Id: <202407061616.466GGjTK038334@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: 0b82dac337e7 - main - cdefs.h: Add back fallback define for __printf0like 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 0b82dac337e7db79fa1a78bb29f2de6825a877ab Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0b82dac337e7db79fa1a78bb29f2de6825a877ab commit 0b82dac337e7db79fa1a78bb29f2de6825a877ab Author: Warner Losh AuthorDate: 2024-07-06 16:07:52 +0000 Commit: Warner Losh CommitDate: 2024-07-06 16:15:12 +0000 cdefs.h: Add back fallback define for __printf0like The format function printf0 is originally a FreeBSD extension. clang has adopted it as an alias for printf. Starting with gcc 11, gcc doesn't do a NULL pointer check for fmtarg. Instead, it has to be tagged with a nonnull attribute, so this gives us the behavior we want. For earlier gcc and other cmopilers, define it away so do not get false positives for NULL pointers for the err*/warn* family of functions. This also fixes -Wsystem-headers by avoiding print0 entirely. My testing for 67d1a1cd9e77 didn't test that case, so I introduced a regression. All these compilers need to be considered because __printf0like is used in err.h and stdlib.h. Since it's used in system headers, it has to work on all the compilers we support on FreeBSD, not just the ones that can build FreeBSD itself. __printf0like will likely be deleted in the future, since the proper way to do this is with _Nullable or _Nonnull, but the compiler support for those hasn't been completely evaluated. Noticed by: jhb Fixes: 67d1a1cd9e77 Sponsored by: Netflix Suggestions by: jhb Differential Revision: https://reviews.freebsd.org/D45836 --- sys/sys/cdefs.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index b8908138bd65..6b861b1903f6 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -338,9 +338,7 @@ /* * Compiler-dependent macros to declare that functions take printf-like - * or scanf-like arguments. They are null except for versions of gcc - * that are known to support the features properly (old versions of gcc-2 - * didn't permit keeping the keywords out of the application namespace). + * or scanf-like arguments. */ #define __printflike(fmtarg, firstvararg) \ __attribute__((__format__ (__printf__, fmtarg, firstvararg))) @@ -352,8 +350,18 @@ #define __strftimelike(fmtarg, firstvararg) \ __attribute__((__format__ (__strftime__, fmtarg, firstvararg))) -#define __printf0like(fmtarg, firstvararg) \ - __attribute__((__format__ (__printf0__, fmtarg, firstvararg))) +/* + * Like __printflike, but allows fmtarg to be NULL. FreeBSD invented 'printf0' + * for this because older versions of gcc issued warnings for NULL first args. + * Clang has always had printf and printf0 as aliases. gcc 11.0 now follows + * clang. So now this is an alias for __printflike, or nothing. In the future + * _Nullable or _Nonnull will replace this. + */ +#if defined(__clang__) || __GNUC_PREREQ__(11, 0) +#define __printf0like(fmtarg, firstvararg) __printflike(fmtarg, firstvararg) +#else +#define __printf0like(fmtarg, firstvararg) +#endif #define __strong_reference(sym,aliassym) \ extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym))) From nobody Sat Jul 6 17:18:12 2024 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 4WGcXh4rKFz5PBwH; Sat, 06 Jul 2024 17:18: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGcXh4GsYz4vWl; Sat, 6 Jul 2024 17:18:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720286292; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QDG73dA0B4ElcAdvxpf4Re6GE6ysvUXZFWzGLNHhXQw=; b=bFvNpCRo1Orj3qMTdvKTaI9sBcZUdVoGl2wwN23z5VzJJievBZSX7WSBVvKqKQCRp/9WCt b7PtftZXBjJanwPEiOQnt0WAY2h7G/IAuEGKkQ1oBuOGROjFmtRlinG4EiqZ+CZ6ahN6sv yT841v7SWu9GWpS2sRhm6DU6+lXRnnkBk+Rn7zFIUBk2mO6VWy5SVZcW5YrRfmnCOP9O/H 2ihn81aTm6ZLlO5Wm7pnZ46nG9leucN8qBITvMN2XkmC621/7NzQ04dViSbKyHmEGk1icu GwHIMoQ8uHhDHis1V/klhWpuCLhzWahmcebdbEpeNq/1iC1v7Davy4HJ7EtdOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720286292; a=rsa-sha256; cv=none; b=xe+ibjPeGSjGTUbO9MNx79aP9PQlgPaDj/i2iw7PyGHyk3VcQxEz9xRkG4TjQ6EszeCAm7 wqsBAdL8FlCAotF0Hy8vmBBS0z4Y0w4tyr3ZWd756BJe8qqywZdiJeEKgVdMnscpCD7NUO 6C0aTCntQ1GUFNPyHQzfeGIkus5JVSynEMUO8BMg9KEHeL5r4i/3vrABkVuAIN8/ZjvNxi ionsmwv/GXX8y7jPnyMrMF0yfGhaK1SDlcpo8UJGJ8yuJS2kIhwKJzuY0ZtFCTAeHOXCtc u3QeKOyh3upCql+401f5K1zMkFkhjRh/1bqMvA+gTWgH+OGVMkGpw0GEc6raeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720286292; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QDG73dA0B4ElcAdvxpf4Re6GE6ysvUXZFWzGLNHhXQw=; b=ck5pZhAkLiY8vY4i3Yt6vcbnToSsPSN0NSJCdKAvAWgxBLzvS9Z2gh06MiX8XyzhuKlYEy qs5oVTLlivBy54wC/0jtV80HXg2Ql/tdBKCOUh3sAXjkuNA8URdzrecn6NmL/epHLWbdV+ qlHXr/2y2KVStybkifetF/2RljjKZw1N9OAXJvu6rOfspkzInn5v4gg8X58zLUKVZeANN1 A2g+cTM9MpeoxfWf2WASxesQlyKHWsdz9aMb6spYUWcN9xba/eZjMYMakZ3XI+iey4wKoR RuDuoG5LpYKYmDwwwdtJKLgm8IVn0NLZpfqwbFluWFnjtIyndQIY/GRYFBhKIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WGcXh3t90zpNt; Sat, 6 Jul 2024 17:18:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 466HICjM071942; Sat, 6 Jul 2024 17:18:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466HICA9071939; Sat, 6 Jul 2024 17:18:12 GMT (envelope-from git) Date: Sat, 6 Jul 2024 17:18:12 GMT Message-Id: <202407061718.466HICA9071939@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: ed807f7bcaec - main - release.sh: Pass ARCH_FLAGS when setting VMSIZE 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: ed807f7bcaecbf32b0b81a7d18cee489a3666157 Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=ed807f7bcaecbf32b0b81a7d18cee489a3666157 commit ed807f7bcaecbf32b0b81a7d18cee489a3666157 Author: Colin Percival AuthorDate: 2024-07-06 17:15:22 +0000 Commit: Colin Percival CommitDate: 2024-07-06 17:18:03 +0000 release.sh: Pass ARCH_FLAGS when setting VMSIZE The default VM size may depend on the architecture. In particular, it is currently larged on riscv64 due to a toolchain issue which results in bloated binaries. MFC after: 3 days Fixes: 59c21ed6e811 "release: Bump default VM size for riscv64 to 6 GB" Sponsored by: Amazon --- release/release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/release.sh b/release/release.sh index 3c68f89c2cc3..cee0fbd5643d 100755 --- a/release/release.sh +++ b/release/release.sh @@ -337,7 +337,7 @@ chroot_build_release() { fi if [ -z "${VMSIZE}" ]; then VMSIZE="$(eval chroot ${CHROOTDIR} \ - make -C /usr/src/release -V VMSIZE)" + make -C /usr/src/release ${ARCH_FLAGS} -V VMSIZE)" fi RELEASE_RMAKEFLAGS="${RELEASE_RMAKEFLAGS} \ VMFORMATS=\"${VMFORMATS}\" VMSIZE=${VMSIZE}" From nobody Sat Jul 6 17:49:58 2024 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 4WGdFL3bTHz5PGYB; Sat, 06 Jul 2024 17:49: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGdFL2wgGz4yxM; Sat, 6 Jul 2024 17:49:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720288198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OqDcnP5d2f2rZd2kHKJZSt5Z4lri4zD1B6cNv9RWWTg=; b=JFlLr/4R2VXwBqOldGci64R90VEz7aKq8PeoetFq5YMFktn27pNoDOJaKhFlH6D81kbZbg o88FsgkFWPVlKQSORkjhkx5rEbzvQugvfLzIO3nG7tTkewslwRPRQ9yULBijg1omCXfr7b tr+SQnA4XUOD/Faa07vbvgFS0cq60pB/6oBQ5C26WPtiQJzEU0xmHsvd+TESSob8czC9fE YJvj2mF+yyg5a0HOshJYv6jpzMb5EWd/Jui58ZWhQsStBjnmfGjUJMLvxrf0gnhGcyWPHE Qxpfs8lXNk6oG5U86kxmqaJ3pHbcXQzqlSWtizx/Gc0omqQIR9hzySUbtukwQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720288198; a=rsa-sha256; cv=none; b=aP4CQJqaAfj9R+BZvCMIyGnDoT/A1XRiJqtESkHAvsaz5ZV7sCbJZDtINZIBicOF/eo+21 CsOnLlmBW2/YnuBhN1vrpf7nqdVhjIBNSLF1tSE2pY5m8g6BK56kfs4efXvdAAUYbxLUCP ZuUz4KMKissbGgHgzRlReiklwdOre1kLOX85HN7+oL9yuS1rSdw/gtpk0m8EJJk17AJ+/+ IxMJgceu/KP7T2oxwEtwHncKRkPm+PCar517H/tNlUqVsvfjuHifPzq9HxdzFOHoIlNk5u RluM6OPp1v7PtHSanhoGLG5HFySl1X3wF7nG2riitAWmC4LH/gLpVCU4YOvd+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720288198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OqDcnP5d2f2rZd2kHKJZSt5Z4lri4zD1B6cNv9RWWTg=; b=brwGAF7WZ2oopXwTV49j9ZK4PwxYEpxShMwIewRZDaUUB/vaRwVX0efIsBZ92F3hSv5rkt dTiV1lG9cgQ7Q4Ld23gQmhnIuCK94hZ7j7UWMn/eBJ3NAp/UIS6hZk5+t2MFc6HwO+vOMO TwT40bkxz2fk6yExwR+tOg+XXBC3Xq3tcJDBxHa78KA2MlOtpHIVuE/rs724lEMPBkHL5w gJbse4d8Ir+XhVHgVfq4kXqfJUp5VT4yWQ8OPkonjF+Cc2UOV0hHj7/Z2pNLQLV7zuRrln 3oJrBaEx6kJS++TzBtTYK5a0Odsx9sGKyUGpNHLF+iDuSX76q7/5fCMMUr0UPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WGdFL29Byzq54; Sat, 6 Jul 2024 17:49:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 466Hnwmo022703; Sat, 6 Jul 2024 17:49:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466HnwtV022700; Sat, 6 Jul 2024 17:49:58 GMT (envelope-from git) Date: Sat, 6 Jul 2024 17:49:58 GMT Message-Id: <202407061749.466HnwtV022700@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: a9d7f098b865 - main - mps(4): Correct a typo in a source code 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a9d7f098b86576006f5aeb312521bfde5ac77c77 Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=a9d7f098b86576006f5aeb312521bfde5ac77c77 commit a9d7f098b86576006f5aeb312521bfde5ac77c77 Author: Gordon Bergling AuthorDate: 2024-07-06 17:49:30 +0000 Commit: Gordon Bergling CommitDate: 2024-07-06 17:49:30 +0000 mps(4): Correct a typo in a source code comment - s/vender/vendor/ MFC after: 3 days --- sys/dev/mps/mps_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/mps/mps_pci.c b/sys/dev/mps/mps_pci.c index ece49435b39e..7a0c577eb72a 100644 --- a/sys/dev/mps/mps_pci.c +++ b/sys/dev/mps/mps_pci.c @@ -122,8 +122,8 @@ struct mps_ident { 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2208" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2308_1, 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2308" }, - // Add Customer specific vender/subdevice id before generic - // (0xffff) vender/subdevice id. + // Add Customer specific vendor/subdevice id before generic + // (0xffff) vendor/subdevice id. { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2308_2, 0x8086, 0x3516, 0, "Intel(R) Integrated RAID Module RMS25JB080" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2308_2, From nobody Sat Jul 6 18:24:04 2024 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 4WGf0h3HPJz5PMJk; Sat, 06 Jul 2024 18:24: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGf0h2ZdHz546d; Sat, 6 Jul 2024 18:24:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dtgr7IAPGw1nSIHAzb5zRcm9SYyScFEB2VmKLdyT+NI=; b=dI2P5bbqfXXUIs2G/2+AZkSgUbVrMa+GdGTq1eZpVOFB/LJtu/y81xCnOaqHkJ1Mthecfn wQgOjYG4wHQ4veX9lJLNmb3AwGNZYE3brCeToziBJB7C0r7RWXQiVozxnkb6obOWKJbLwu Rx02USAEz9pFSa6JfiUvzYTcJhTS3+ibAvD5lx+yw/b0TbJ0Xp6jihA8vlEQz5UzB+X31T YGWmH+bd+VkcAgsYioGg9M6SRERO6Vr9dcKTQc6ND0PczxU8S2nwiai1Pu1m75tRGjTdca ZLhq/Gd+IQiLSnBXFuy7PRkuxL0lpSv0xbHqsZRa94La1dNDW6meU201LqFPUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720290244; a=rsa-sha256; cv=none; b=wMfKtDR9KVQpIAxdy96wvLakpKyS+IyCIWUFD3wk/XKhRoDsCsrCn+mWeT1PI+/VAG7cZs dRzciK0wo4Z43N8OiDDTWQRSOR/KkyvO6CBaxI2arvKNHVzy/6P4oI5ZJT7fNuhW9UHCX1 DHbv8v0aX8jNfUvICKj97SdrBtOJR90iwdcIpP10RSe3mhaGjs4xcR/i+tdY3SQ7WCrHEP Zksbe8J3U4X7Nv6QyKync5dD+OHGmSM+YT3VjxLa2yTgxl+tdV/vEud1iaFL+G4aPlFJbS IonZJhp7Nm7/PiAOevciffBfgmxwFqDghrD9ZDmiJSXaKNIhXzVd63rkXDyrrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dtgr7IAPGw1nSIHAzb5zRcm9SYyScFEB2VmKLdyT+NI=; b=tREcKEF2LukbWYXDPpsvY9csVO7hMs6aYH1pxAM8O7XMN4rUIc7zcMNnz4D0aDO1VjQV4K Bl32OcxLbtGdwr6L/D6+nT+Xj6af684BRzH1gIrD7bs0/cwft1lwIPLrvpFJpHVAeZxYOp L8azYy+D6feDkcDjmVD/M06fn6fUp8Da6KWIyqzmR/SE16zqhjHQ63f7z7KbX6cdwx7Tx1 B0rhhQR+BmtYVdtDtTDCkGHYoJmlWXECS3n3e5x4sUbxvBkEqnvc0FF7L5sAuPa5wnS0sU NlZMdejJvuoz6zAtVlLWM+EYBwz/UyJfTVZREqpv6b+Sn1MyQ7cX9Dpii1TnMw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WGf0h26Xczqw8; Sat, 6 Jul 2024 18:24:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 466IO45d090487; Sat, 6 Jul 2024 18:24:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466IO4bp090484; Sat, 6 Jul 2024 18:24:04 GMT (envelope-from git) Date: Sat, 6 Jul 2024 18:24:04 GMT Message-Id: <202407061824.466IO4bp090484@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: f30af1f037a6 - main - sound: SNDCTL_AUDIOINFO: Do not skip physical channels if VCHANs are disabled 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f30af1f037a68947edbabebc7ab495cd1b7a4ec8 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=f30af1f037a68947edbabebc7ab495cd1b7a4ec8 commit f30af1f037a68947edbabebc7ab495cd1b7a4ec8 Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:08 +0000 Commit: Christos Margiolis CommitDate: 2024-07-06 18:22:08 +0000 sound: SNDCTL_AUDIOINFO: Do not skip physical channels if VCHANs are disabled Currently, we are skipping physical channels when servicing SNDCTL_AUDIOINFO, and VCHANs when servicing SNDCTL_AUDIOINFO_EX. However, if we call SNDCTL_AUDIOINFO with VCHANs disabled, we'll eventually skip all channels, resulting in some of oss_audioinfo's fields containing wrong information (e.g min/max_channels). Fix this by adding an exception to SNDCTL_AUDIOINFO not to skip physical channels when VCHANs are disabled. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, emaste Differential Revision: https://reviews.freebsd.org/D45722 --- sys/dev/sound/pcm/dsp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 0eb41faaae45..6ac85635b080 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -2159,9 +2159,13 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *ai, bool ex) /* * Skip physical channels if we are servicing SNDCTL_AUDIOINFO, * or VCHANs if we are servicing SNDCTL_AUDIOINFO_EX. + * + * For SNDCTL_AUDIOINFO do not skip the physical channels if + * there are no VCHANs. */ if ((ex && (ch->flags & CHN_F_VIRTUAL) != 0) || - (!ex && (ch->flags & CHN_F_VIRTUAL) == 0)) { + ((!ex && (ch->flags & CHN_F_VIRTUAL) == 0) && + (d->pvchancount > 0 || d->rvchancount > 0))) { CHN_UNLOCK(ch); continue; } From nobody Sat Jul 6 18:24:05 2024 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 4WGf0j5cTlz5PMGn; Sat, 06 Jul 2024 18:24:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGf0j3DPlz544Y; Sat, 6 Jul 2024 18:24:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u8GpEtRvW5z8moZeHm5wndQ5E/8qIsZAEZg849KGu1Q=; b=Bhpp5zZs6Dq37lSuipHXxU9RDFnkEnNARSAgE0ELbMlkfN6nGTIHfp2uvH9Xp/slwZfrye TaNCsvbbqoD/pJIN402awaZ3SNdImEwn75LeNIKJEUuV1gYUoZqD82Px1X400qgcw48GZ0 AzWQg0m9rXVi8YgX9vdqDakSpx76f51VtTCgt3+xD1Lj7F5f9IypwKBq6VD4vxF0ctZ42q H7WBFOHNysrFyUK20BSyIMq0MOqOTVQu4TxmTZ00zcfk8vb3d/AHnikqEJk9Kxjs3aPXFW lmfdYb/kiIHkyjO+3tDQXNEQgu3OGvPGUnwdaKKgERQ9SjVy7FylMLCgCGosFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720290245; a=rsa-sha256; cv=none; b=tKbtVrP1/W3BNYq06AcoYhU3n4ez+jhi539/bTq4Va4wvItpqG9PMtq6rA9dptWme/HeZ2 Ka9sNnVtl+a1OsO0/CL637y3es1EIOvnJxds6fOCosckLSxW6c4EipdBgzWjr8oKhcn1Zp 38OIknBFWkDM0pU+DfWu+7m9OwShbQIwldOg2POMvv1lAhOpewo7DruKxPPsnGc1EgT6lo G/I01X1TrP3YYOQ8xbgUUSvpnfrmFjIEXeBGjLDphPAhwF+rMInGZoAfqHooupZ8STO81H kpoUJOpoNpEof9F/GEu1e74j+2lOzDNJNFPR/c0W70V0Py3yi7exg8cE9S/m7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u8GpEtRvW5z8moZeHm5wndQ5E/8qIsZAEZg849KGu1Q=; b=LPhoTVaM9R/QQxHbGqhFsXKqMtBSJ3aafygH7u4/6uu9MwJwEqC8/2jNqmRPwtGw48lDrq Gu/usbkVXeQr5QD2Q3JDfknzwcssDfUUpgO4dOwg1ATQhAkchDD/KJrdlJQb5dZpFpUxEw y08EgpIn1ltt1DKjNR4mxx8zWxUl151UaP5ds0XZiHl6pLgF+iO6VrcFSsL3BGZYMbDI+T c6TK2Tr/cbs+weRBJnhogW8dz8pFUyiincNZ9gwtW9AKFEnavjoiFEx9IAafIdupwDth2G kw5RgHbjB8zaOTXO0hd87qjLRhefwQqiQCSjTSNvl7x1gnzqBZ6UKtCO2q6TOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WGf0j2qxqzrWZ; Sat, 6 Jul 2024 18:24:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 466IO5QM090540; Sat, 6 Jul 2024 18:24:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466IO5X9090537; Sat, 6 Jul 2024 18:24:05 GMT (envelope-from git) Date: Sat, 6 Jul 2024 18:24:05 GMT Message-Id: <202407061824.466IO5X9090537@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: d6d4586b0b7e - main - sound: Get rid of snd_sb16 workaround in vchan_create() 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d6d4586b0b7e3b01812e6c26818af78bf9b680a3 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=d6d4586b0b7e3b01812e6c26818af78bf9b680a3 commit d6d4586b0b7e3b01812e6c26818af78bf9b680a3 Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:16 +0000 Commit: Christos Margiolis CommitDate: 2024-07-06 18:22:16 +0000 sound: Get rid of snd_sb16 workaround in vchan_create() The snd_sb16 driver was removed in 716924cb4832 ("Retire snd_sbc ISA sound card driver"). While here, simplify sample rate assignment a bit. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj, emaste Differential Revision: https://reviews.freebsd.org/D45662 --- sys/dev/sound/pcm/vchan.c | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index 528c6fa62621..fa4fa2023b71 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -768,25 +768,10 @@ vchan_create(struct pcm_channel *parent) &vchanspd); CHN_LOCK(parent); if (r != 0) { - /* - * No saved value, no hint, NOTHING. - * - * Workaround for sb16 running - * poorly at 45k / 49k. - */ - switch (parent_caps->maxspeed) { - case 45000: - case 49000: - vchanspd = 44100; - break; - default: - vchanspd = VCHAN_DEFAULT_RATE; - if (vchanspd > parent_caps->maxspeed) - vchanspd = parent_caps->maxspeed; - break; - } - if (vchanspd < parent_caps->minspeed) - vchanspd = parent_caps->minspeed; + /* No saved value, no hint, NOTHING. */ + vchanspd = VCHAN_DEFAULT_RATE; + RANGE(vchanspd, parent_caps->minspeed, + parent_caps->maxspeed); } save = 1; } @@ -795,10 +780,7 @@ vchan_create(struct pcm_channel *parent) /* * Limit the speed between feeder_rate_min <-> feeder_rate_max. */ - if (vchanspd < feeder_rate_min) - vchanspd = feeder_rate_min; - if (vchanspd > feeder_rate_max) - vchanspd = feeder_rate_max; + RANGE(vchanspd, feeder_rate_min, feeder_rate_max); if (feeder_rate_round) { RANGE(vchanspd, parent_caps->minspeed, From nobody Sat Jul 6 18:24:06 2024 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 4WGf0k5dzsz5PMTp; Sat, 06 Jul 2024 18:24:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGf0k52Mtz53qM; Sat, 6 Jul 2024 18:24:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bE6bobQyOTZ4VkqfaovvcYgC1iEKou8QmVUbIcBGC6Y=; b=A7GZRepFbXYCPPaeZlzXPdzbMhOCv3m0971H/MYv8CPcDqrWNK0U7A35GS0HpGgCgKtUu4 5xxptHj8XLRxTdTIVyE0vDmyZJTGp764K5jy9C9RfpuTTal6RLaTSOjHYQQkfaNUPYzCJc wD8bVWXolatIM6KEn54aWjP9mAD5B8byHeG4ofa+j6hecngFqwDSrcTIVWxtuRRdFP3QMK RCJHcyc3L9yO6YvQDZ/y7NNTnTckIHy15KYX2+Qh4HeUnIvvBgAFlRw2DM8TaDiLfbbQ5w PQ+bvz685con8iGgNDaHq2gcXmMsgF44YAv4kA1OQ7/qLJKXQ45vG8VAwEm41Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720290246; a=rsa-sha256; cv=none; b=qtujmc9nm/jHNd2ntGV7GjqA8KpJfulw390niL6dCjrtZxzRWuL2xx3LG9frRGNa++Ot97 25iSCjUGlcMBEXz49z7SPjKhOP7ISDCmsCrUOjtumWD8GI6LbtOS8c2t1Llkgtc7rfE9yV r+R6A7oqFBR2eeiceuzQb0X9okiyxCY6Q1WsU7lMHCRRVg0ofgQwxE3TIrjEXymrkpHirc c1m/7fIQ7SHYsFDQGxoRERdE6XN9zKowTqwkJCyb7fglZLGvHvVwJp+YyGSIeqmOU2vYL3 Etzly6hZsTKY4erv3PtLACZnv+8zd2vEdqQHIH+xeOP53H6lwI+cnm8vw+WCag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bE6bobQyOTZ4VkqfaovvcYgC1iEKou8QmVUbIcBGC6Y=; b=L7DgYlDw2ODgCE9V0vrBgmT9xKPZVTERmm/KI291A9Hvqr2RsGIg93+gqkoZWHwt7pl1bD 10ec6NJUcKeIP8k3uHhyS7mE1VjfYfCd55jg1TnIvBcqfxNcttCyXPgSEHbQ8tePPi04Gc mynUXRKpm4cZHyKjxZeA3B/32t0GKgjGqGhwhdkata43A7FXYoLCOqq3K1DAoLw96Q140Y awztgR5eayuQm5RrBME4PQ2AByZ/nAVbZ/dMPIiS7oTvQ2dJBeV8fCfmykcpl9rBJXdWKL 9BpWnfWVdFB5uREjEsfp0ktyNNC2ynfw3nWDBsaqh5WqKirprZcdVTPsYMf2hg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WGf0k48pczrVt; Sat, 6 Jul 2024 18:24:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 466IO6gS090588; Sat, 6 Jul 2024 18:24:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466IO6uQ090585; Sat, 6 Jul 2024 18:24:06 GMT (envelope-from git) Date: Sat, 6 Jul 2024 18:24:06 GMT Message-Id: <202407061824.466IO6uQ090585@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: fc76e24e583d - main - sound: Fix lock order reversals in mseq_open() 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fc76e24e583d45a3a59fd7ad4e603c0679eaf572 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=fc76e24e583d45a3a59fd7ad4e603c0679eaf572 commit fc76e24e583d45a3a59fd7ad4e603c0679eaf572 Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:21 +0000 Commit: Christos Margiolis CommitDate: 2024-07-06 18:22:21 +0000 sound: Fix lock order reversals in mseq_open() Opening /dev/sequencer after a clean reboot yields: lock order reversal: (sleepable after non-sleepable) 1st 0xfffffe004a2c2c08 seqflq (seqflq, sleep mutex) @ /mnt/src/sys/dev/sound/midi/sequencer.c:754 2nd 0xffffffff84197ed8 midistat lock (midistat lock, sx) @ /mnt/src/sys/dev/sound/midi/midi.c:1478 lock order seqflq -> midistat lock attempted at: 0xffffffff811c9029 at witness_checkorder+0x12b9 0xffffffff810f18a7 at _sx_xlock+0xf7 0xffffffff8417f992 at midimapper_open+0x22 0xffffffff84182770 at mseq_open+0xf0 0xffffffff80e3380f at devfs_open+0x30f 0xffffffff81b8b4b7 at VOP_OPEN_APV+0x57 0xffffffff812da1e7 at vn_open_vnode+0x397 0xffffffff812d96b3 at vn_open_cred+0xb23 0xffffffff812c2c6b at openatfp+0x52b 0xffffffff812c2711 at sys_openat+0x81 0xffffffff84110579 at filemon_wrapper_openat+0x19 0xffffffff81a223ae at amd64_syscall+0x39e 0xffffffff819dd0eb at fast_syscall_common+0xf8 Expose midistat_lock to midi/midi.c so that we can acquire the lock from mseq_open() before we lock seq_lock, and introduce _locked variants of midimapper_open() and midimapper_fetch_synth(). Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, emaste Differential Revision: https://reviews.freebsd.org/D45770 --- sys/dev/sound/midi/midi.c | 41 ++++++++++++++++++++++++++++++++--------- sys/dev/sound/midi/midi.h | 4 ++++ sys/dev/sound/midi/sequencer.c | 8 ++++++-- 3 files changed, 42 insertions(+), 11 deletions(-) diff --git a/sys/dev/sound/midi/midi.c b/sys/dev/sound/midi/midi.c index 81c20580f7b8..d31d6ce0fa8e 100644 --- a/sys/dev/sound/midi/midi.c +++ b/sys/dev/sound/midi/midi.c @@ -181,7 +181,8 @@ TAILQ_HEAD(, snd_midi) midi_devs; * /dev/midistat variables and declarations, protected by midistat_lock */ -static struct sx midistat_lock; +struct sx midistat_lock; + static int midistat_isopen = 0; static struct sbuf midistat_sbuf; static struct cdev *midistat_dev; @@ -1470,16 +1471,28 @@ midimapper_addseq(void *arg1, int *unit, void **cookie) } int -midimapper_open(void *arg1, void **cookie) +midimapper_open_locked(void *arg1, void **cookie) { int retval = 0; struct snd_midi *m; - sx_xlock(&midistat_lock); + sx_assert(&midistat_lock, SX_XLOCKED); TAILQ_FOREACH(m, &midi_devs, link) { retval++; } + + return retval; +} + +int +midimapper_open(void *arg1, void **cookie) +{ + int retval; + + sx_xlock(&midistat_lock); + retval = midimapper_open_locked(arg1, cookie); sx_xunlock(&midistat_lock); + return retval; } @@ -1490,22 +1503,32 @@ midimapper_close(void *arg1, void *cookie) } kobj_t -midimapper_fetch_synth(void *arg, void *cookie, int unit) +midimapper_fetch_synth_locked(void *arg, void *cookie, int unit) { struct snd_midi *m; int retval = 0; - sx_xlock(&midistat_lock); + sx_assert(&midistat_lock, SX_XLOCKED); TAILQ_FOREACH(m, &midi_devs, link) { - if (unit == retval) { - sx_xunlock(&midistat_lock); + if (unit == retval) return (kobj_t)m->synth; - } retval++; } - sx_xunlock(&midistat_lock); + return NULL; } +kobj_t +midimapper_fetch_synth(void *arg, void *cookie, int unit) +{ + kobj_t synth; + + sx_xlock(&midistat_lock); + synth = midimapper_fetch_synth_locked(arg, cookie, unit); + sx_xunlock(&midistat_lock); + + return synth; +} + DEV_MODULE(midi, midi_modevent, NULL); MODULE_VERSION(midi, 1); diff --git a/sys/dev/sound/midi/midi.h b/sys/dev/sound/midi/midi.h index 567279d1e654..b200eed9bc74 100644 --- a/sys/dev/sound/midi/midi.h +++ b/sys/dev/sound/midi/midi.h @@ -41,6 +41,8 @@ MALLOC_DECLARE(M_MIDI); #define MIDI_TYPE unsigned char +extern struct sx midistat_lock; + struct snd_midi; struct snd_midi * @@ -50,8 +52,10 @@ int midi_out(struct snd_midi *_m, MIDI_TYPE *_buf, int _size); int midi_in(struct snd_midi *_m, MIDI_TYPE *_buf, int _size); kobj_t midimapper_addseq(void *arg1, int *unit, void **cookie); +int midimapper_open_locked(void *arg1, void **cookie); int midimapper_open(void *arg1, void **cookie); int midimapper_close(void *arg1, void *cookie); +kobj_t midimapper_fetch_synth_locked(void *arg, void *cookie, int unit); kobj_t midimapper_fetch_synth(void *arg, void *cookie, int unit); #endif diff --git a/sys/dev/sound/midi/sequencer.c b/sys/dev/sound/midi/sequencer.c index 817540f1545a..68b06a4f4ca4 100644 --- a/sys/dev/sound/midi/sequencer.c +++ b/sys/dev/sound/midi/sequencer.c @@ -64,6 +64,7 @@ #include #include #include +#include #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_snd.h" @@ -751,6 +752,7 @@ mseq_open(struct cdev *i_dev, int flags, int mode, struct thread *td) * Mark this device busy. */ + sx_xlock(&midistat_lock); mtx_lock(&scp->seq_lock); if (scp->busy) { mtx_unlock(&scp->seq_lock); @@ -768,14 +770,15 @@ mseq_open(struct cdev *i_dev, int flags, int mode, struct thread *td) * Enumerate the available midi devices */ scp->midi_number = 0; - scp->maxunits = midimapper_open(scp->mapper, &scp->mapper_cookie); + scp->maxunits = midimapper_open_locked(scp->mapper, &scp->mapper_cookie); if (scp->maxunits == 0) SEQ_DEBUG(2, printf("seq_open: no midi devices\n")); for (i = 0; i < scp->maxunits; i++) { scp->midis[scp->midi_number] = - midimapper_fetch_synth(scp->mapper, scp->mapper_cookie, i); + midimapper_fetch_synth_locked(scp->mapper, + scp->mapper_cookie, i); if (scp->midis[scp->midi_number]) { if (SYNTH_OPEN(scp->midis[scp->midi_number], scp, scp->fflags) != 0) @@ -787,6 +790,7 @@ mseq_open(struct cdev *i_dev, int flags, int mode, struct thread *td) } } } + sx_xunlock(&midistat_lock); timer_setvals(scp, 60, 100); From nobody Sat Jul 6 18:24:08 2024 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 4WGf0n19lGz5PMXC; Sat, 06 Jul 2024 18: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGf0m72fQz5490; Sat, 6 Jul 2024 18:24:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Ra+lgEcyio3QGCVaT8EAz1ObQESf+eJeqh4CL4KHrs=; b=MtbrsP9WhmquMLXxuLA4AXMJX/SEhM8aFFfSahOWlUNsWW8iNH/7VvhXEBx8YxbW6lDaHz LVJGHsEPQ8s/DHgu6IHh9eLxJ8hZh1RUxC/G/lDBB7Wlxwq04cA58ZnBbBEAdA9RmxAPwb hVwbs2iNOZt1GV4ji6djcObzlatZi4R9y1+V1Ukj4NVGZBhAS83YZPtKtTGABaLxucOLJi vLhPi6JRQVkIz8JSwqiBj3ebNA13KzaM10wY/aOLO7Oms+zuVFvjdxBix0yoT272ALLpDi 5vlbcxh+LPV/lqD7XeZmJ2Io4o8mQjaHaGgPVtIdxTpJflaxRaQZbGc5H5BP2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720290249; a=rsa-sha256; cv=none; b=M0FJPCFnjcNY9BmiN6Ss/GYzAR0LBZlytDLJ/n0M+NEjWsA16smuua64EKWkeHH51vfyL/ +WL7QqFy5gyMkbuaXij9c7pn3+v2PHh+oS9GQl0O9mrYsnAYm3Tsv0iia9XPcIr8cXg0fe tXf8iPGx7HwR5cPqaW40SsV3fDlL3C5byByZmLa8LIOhAg3de4gM/ZxVX46EwAMZUsQ/+5 6U2QOHn3lNXFpNEDneg3ha/gFsS0rWcqKflkY9o4EdPM27pfA+x9FWhRlQECfrCfONoWc6 2UV0GXCh2iWyw+j1t9sYKloyw8zaNucCKJirJKTyyqoNDTCNXFiN+IAq4xSoVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Ra+lgEcyio3QGCVaT8EAz1ObQESf+eJeqh4CL4KHrs=; b=D5C/AeJF+L/dhAsVBKE89fFEoPnxkXFIScD9thrxIC5CoMvwHtTWqE70nB4oaufCxAt/tu xQMWzCyXsn+6MCCyJjNyiVRFmq7/HCPhPQwhYPsF8o/anD0s9AtXHWleWcfdSwnkxPCipj a3UeedDEuh/589sC4OnkYnZc1hji74fn5b4sU6gSHu4a/y5q09w5rDIyEsomxc3ui5uFea nK5W0gzH85ue9VJgtiO1zDwdEVmMLC14HDJQgzLeNb5da7WZuxabCXi+HdydHbQ6vt/Mt4 VlmA/K9+fW/ollnOCOZARmPODkd5fYavOw2uEZys5hXivQQRapWI0tf5KlEsHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WGf0m69CRzqd0; Sat, 6 Jul 2024 18:24:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 466IO8M0090673; Sat, 6 Jul 2024 18:24:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466IO8OW090670; Sat, 6 Jul 2024 18:24:08 GMT (envelope-from git) Date: Sat, 6 Jul 2024 18:24:08 GMT Message-Id: <202407061824.466IO8OW090670@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 526bd1d87ec9 - main - sound: Remove MIDI_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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 526bd1d87ec997e1c090262da6f2d9b6da0e8f89 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=526bd1d87ec997e1c090262da6f2d9b6da0e8f89 commit 526bd1d87ec997e1c090262da6f2d9b6da0e8f89 Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:31 +0000 Commit: Christos Margiolis CommitDate: 2024-07-06 18:22:31 +0000 sound: Remove MIDI_TYPE No good reason to have this. It only makes things harder to read. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D45773 --- sys/dev/sound/midi/midi.c | 12 ++++++------ sys/dev/sound/midi/midi.h | 6 ++---- sys/dev/sound/midi/mpu401.c | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/sys/dev/sound/midi/midi.c b/sys/dev/sound/midi/midi.c index d31d6ce0fa8e..f31496df025b 100644 --- a/sys/dev/sound/midi/midi.c +++ b/sys/dev/sound/midi/midi.c @@ -281,7 +281,7 @@ midi_init(kobj_class_t cls, int unit, int channel, void *cookie) struct snd_midi *m; int i; int inqsize, outqsize; - MIDI_TYPE *buf; + uint8_t *buf; MIDI_DEBUG(1, printf("midiinit: unit %d/%d.\n", unit, channel)); sx_xlock(&midistat_lock); @@ -330,14 +330,14 @@ midi_init(kobj_class_t cls, int unit, int channel, void *cookie) mtx_lock(&m->qlock); if (inqsize) - buf = malloc(sizeof(MIDI_TYPE) * inqsize, M_MIDI, M_NOWAIT); + buf = malloc(sizeof(uint8_t) * inqsize, M_MIDI, M_NOWAIT); else buf = NULL; MIDIQ_INIT(m->inq, buf, inqsize); if (outqsize) - buf = malloc(sizeof(MIDI_TYPE) * outqsize, M_MIDI, M_NOWAIT); + buf = malloc(sizeof(uint8_t) * outqsize, M_MIDI, M_NOWAIT); else buf = NULL; m->hiwat = outqsize / 2; @@ -448,12 +448,12 @@ static int midi_lengths[] = {2, 2, 2, 2, 1, 1, 2, 0}; #define MIDI_SYSEX_END 0xF7 int -midi_in(struct snd_midi *m, MIDI_TYPE *buf, int size) +midi_in(struct snd_midi *m, uint8_t *buf, int size) { /* int i, sig, enq; */ int used; - /* MIDI_TYPE data; */ + /* uint8_t data; */ MIDI_DEBUG(5, printf("midi_in: m=%p size=%d\n", m, size)); /* @@ -578,7 +578,7 @@ midi_in(struct snd_midi *m, MIDI_TYPE *buf, int size) * midi_out: The only clearer of the M_TXEN flag. */ int -midi_out(struct snd_midi *m, MIDI_TYPE *buf, int size) +midi_out(struct snd_midi *m, uint8_t *buf, int size) { int used; diff --git a/sys/dev/sound/midi/midi.h b/sys/dev/sound/midi/midi.h index b200eed9bc74..afbfdfa6abbc 100644 --- a/sys/dev/sound/midi/midi.h +++ b/sys/dev/sound/midi/midi.h @@ -39,8 +39,6 @@ MALLOC_DECLARE(M_MIDI); #define M_RXEN 0x04 #define M_TXEN 0x08 -#define MIDI_TYPE unsigned char - extern struct sx midistat_lock; struct snd_midi; @@ -48,8 +46,8 @@ struct snd_midi; struct snd_midi * midi_init(kobj_class_t _mpu_cls, int _unit, int _channel, void *cookie); int midi_uninit(struct snd_midi *_m); -int midi_out(struct snd_midi *_m, MIDI_TYPE *_buf, int _size); -int midi_in(struct snd_midi *_m, MIDI_TYPE *_buf, int _size); +int midi_out(struct snd_midi *_m, uint8_t *_buf, int _size); +int midi_in(struct snd_midi *_m, uint8_t *_buf, int _size); kobj_t midimapper_addseq(void *arg1, int *unit, void **cookie); int midimapper_open_locked(void *arg1, void **cookie); diff --git a/sys/dev/sound/midi/mpu401.c b/sys/dev/sound/midi/mpu401.c index a344801d1982..2be285bc0040 100644 --- a/sys/dev/sound/midi/mpu401.c +++ b/sys/dev/sound/midi/mpu401.c @@ -118,7 +118,7 @@ static int mpu401_intr(struct mpu401 *m) { #define MPU_INTR_BUF 16 - MIDI_TYPE b[MPU_INTR_BUF]; + uint8_t b[MPU_INTR_BUF]; int i; int s; From nobody Sat Jul 6 18:24:07 2024 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 4WGf0m2pK5z5PMDn; Sat, 06 Jul 2024 18:24:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGf0l66tbz544r; Sat, 6 Jul 2024 18:24:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G3Xpbw9JWEtuwJFAqesCpDlS8HVrgyeM/zm9ZBudyiQ=; b=SaUPn5I30BXrUXXg7nrbmRkTEFPKEDdxkSqrtL6T07EltcmLkfnva/jm7JW1IeDFDBITeZ PzKsFujt1gdowih+M0E4fUxTFD08c4Q5fFDG5cpq2+GF9QB4Tdh1V++V3sHhnDJFeLBQTn TfOOP62CZEHRf1FjlGowUq8+yUEOAqB92BBFY/FyTvrNWwQ0dKxX5NKOa9+uijvrUc+5IQ E2IN4oxMb5LNPx+Q6fhc2wNBAMwTzVCoEpCmdbjjBluDNZblEvxvuF273OdxcvRfp55+BB XDb67+9kRP9HOSZj6983DnC709l9oLP+p5NB1owMu4Ja+WcRt7LsH0ikHrXeGg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720290247; a=rsa-sha256; cv=none; b=WjzMhSvU1a9/gUy5h3GNmqhl7bLwWlgyfSameId4wr2saQX0eYkgd5U1NfnDmWpA8WVtxF qGWSeNBxPUVReGI6o+5SYyn96FV21Y593p/Jy0L98uEOzTFAEs4q7Jbn7/cXrEGJkESYmD E2gcc3WF/bv1BazJyUPixf01cPV6Gkc/KTKS53HxMpx9LFU7k4HxKABaQDuTbrc71dc0cz DBCpKRoT3U4yWRsifl+6q1XvpmqZbBDBTknbPYKeIiChAVGMx5TKZfLJlKXDPg+J1G232l tt6YH3Ykv06IMHJKrQE1teR8E/U0QbRz6y0qlXZZp5g7rY5Qzk6IPWCiNNoCtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G3Xpbw9JWEtuwJFAqesCpDlS8HVrgyeM/zm9ZBudyiQ=; b=uDjWZsfg4f0yFhg7HQ4k67RD2LVHG9YqbNMVkpiMgdMjlW8ZF03kGxNFqIkujFTM8L07qr ZTUY0XlxMr/3gywCoxHx00jfMYL4mH5FWFgLEnujJoeCi6JE8vh/GNUft2l2snVCr/F33j tl+nS7pNSAVBPBGCZwZ83+UmvyaUQcx4QCTTq5utI8XKAjC2KiXOGyfijSV2Hgj99BUwS1 POnRU1WJ2xSsNULUruu/h3VRrP9ICQIsC9A4XDPuqXbq9UE9+aHexxkUzH5J1oi1z40poj Ilsk700OkprSCCZYjNbDc6EswKcDqk4VSJNTQ2dBbT+aVuD0FE4VzDj2a69kvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WGf0l4sGCzrLB; Sat, 6 Jul 2024 18:24:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 466IO78h090632; Sat, 6 Jul 2024 18:24:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466IO71F090629; Sat, 6 Jul 2024 18:24:07 GMT (envelope-from git) Date: Sat, 6 Jul 2024 18:24:07 GMT Message-Id: <202407061824.466IO71F090629@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 3402d474ceb8 - main - snd_uaudio: Remove unused sc_sndstat sbuf 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3402d474ceb8541d07689bad6960f90739129997 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=3402d474ceb8541d07689bad6960f90739129997 commit 3402d474ceb8541d07689bad6960f90739129997 Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:26 +0000 Commit: Christos Margiolis CommitDate: 2024-07-06 18:22:26 +0000 snd_uaudio: Remove unused sc_sndstat sbuf This information is also printed to dmesg(8) on attach. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D45771 --- sys/dev/sound/usb/uaudio.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index d47eb86ed271..c202ac581119 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -368,7 +368,6 @@ struct uaudio_softc_child { }; struct uaudio_softc { - struct sbuf sc_sndstat; struct sndcard_func sc_sndcard_func; struct uaudio_chan sc_rec_chan[UAUDIO_MAX_CHILD]; struct uaudio_chan sc_play_chan[UAUDIO_MAX_CHILD]; @@ -391,7 +390,6 @@ struct uaudio_softc { uint8_t sc_mixer_iface_index; uint8_t sc_mixer_iface_no; uint8_t sc_mixer_chan; - uint8_t sc_sndstat_valid:1; uint8_t sc_uq_audio_swap_lr:1; uint8_t sc_uq_au_inp_async:1; uint8_t sc_uq_au_no_xu:1; @@ -1293,8 +1291,6 @@ uaudio_detach(device_t dev) if (bus_generic_detach(dev) != 0) { DPRINTF("detach failed!\n"); } - sbuf_delete(&sc->sc_sndstat); - sc->sc_sndstat_valid = 0; umidi_detach(dev); @@ -2149,15 +2145,6 @@ uaudio_chan_fill_info_sub(struct uaudio_softc *sc, struct usb_device *udev, if (rate > chan->pcm_cap.maxspeed || chan->pcm_cap.maxspeed == 0) chan->pcm_cap.maxspeed = rate; - if (sc->sc_sndstat_valid != 0) { - sbuf_printf(&sc->sc_sndstat, "\n\t" - "mode %d.%d:(%s) %dch, %dbit, %s, %dHz", - curidx, alt_index, - (ep_dir == UE_DIR_IN) ? "input" : "output", - channels, p_fmt->bPrecision, - p_fmt->description, rate); - } - next_ep: sed.v1 = NULL; ed1 = NULL; @@ -2230,9 +2217,6 @@ uaudio_chan_fill_info(struct uaudio_softc *sc, struct usb_device *udev) if (channels == 0) channels = channels_max; - if (sbuf_new(&sc->sc_sndstat, NULL, 4096, SBUF_AUTOEXTEND)) - sc->sc_sndstat_valid = 1; - /* try to search for a valid config */ for (x = channels; x; x--) { @@ -2263,8 +2247,6 @@ uaudio_chan_fill_info(struct uaudio_softc *sc, struct usb_device *udev) if (x == (channels + 1)) x--; } - if (sc->sc_sndstat_valid) - sbuf_finish(&sc->sc_sndstat); } static void From nobody Sat Jul 6 18:24:09 2024 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 4WGf0p2xdwz5PMP4; Sat, 06 Jul 2024 18:24: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGf0p0NW4z54HT; Sat, 6 Jul 2024 18:24:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290250; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3CTqroJun3RhzxVc5wU4ksH5E4QYp60wAR4tFeqpsJ4=; b=RNdwpUkKdYsG4SP43aRwt3VSegTgykGqosGN48huqFh+M6blQSPsJFxcc2Y0G7pW86R9Qy Z24cuP+6LwzJyZ6fLE+/QGfBp04Ho1wHvAW/6CWoX+3GRg3sy9Db+UzljSYLkAvEqK+OQh tIosm0TKx15BxJsm3B9ekss4a15SmDojTSVppBSnwaTCz4pAImLDbMDqrpLafZ2QCjEkSk XfKd+Z3g4MUoljMT9waIDY3ay06eFYDnuwi67aoXQ2PEULj+Rg8eEscm8RRN9eO+kmKqaW 14slSkA4FV/fQ3fe2YaRM671+2vmaIxTbsvtKKdsXQDIAcE2lKerPuyJF/xIaw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720290250; a=rsa-sha256; cv=none; b=l30Z45T7/7hXp93RLwTnpTe3Uraje8yeitA10E4SoDTQvbOaeNVCwY/MLPH32a0SbRogkz QOJjA+9/wrXjC6TOqWw+508eu5zPIc5063V03Pu2g4ZjcawzRkOfJSXoD1pBMPWMRBC8BT s2lDtZJk1o3KFgqFrrqaLi/lPy+n4dHo5UHDp/+OErngM4fVzSwY89IEk3NvzefKU8tJ2X WZAKdmR6QzJNSBtdoxD8RmWKtss7DS+uvgOtexm/qweM4FSImbepXgAZDhEO4DRi4x1sFU sJoNnH+Sj2TJnheYDBAI0GWG9CCLJ2rRt3z9AVYT9ROsKkA/18aIKQA2Y22Psw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290250; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3CTqroJun3RhzxVc5wU4ksH5E4QYp60wAR4tFeqpsJ4=; b=MGLDbwwGIPE4JyDiocaRs/LMeYV9Q77DxZ1ikcY1e/QzWLXlj8v+AFYqqCF+WePzPlz1Rg iu2mwGAtKSD6Z8/YmFcagA3WMkDFhrb7n23iqK1proavh8Ped1R5yMQ2tIKyK+XD467S1g PvuksgXemTrCSfd59ogsDjlOZ8MCSQl9jvpBDy9IO1RzfyfkAi+BlRWgiWLBsXs3kJ4SRK BZkoeNc1I1hQvng9i0A5IIXFm4BsNoKzX9FIOTlBOXhq5xgLbW+Spw3HuZ7Czp14YnbyxM v/IUPrOjhg/soYiBhBkWQBO6l2Ci0eqsoFiUJTGhSc9VxBukLCdLdjyFWCel4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WGf0n75KTzrWb; Sat, 6 Jul 2024 18:24:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 466IO9cm090715; Sat, 6 Jul 2024 18:24:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466IO900090712; Sat, 6 Jul 2024 18:24:09 GMT (envelope-from git) Date: Sat, 6 Jul 2024 18:24:09 GMT Message-Id: <202407061824.466IO900090712@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 8b9e1b628064 - main - sound: Remove *MINOR from midi/ 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b9e1b628064daba3650d04fa83cf79808877981 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=8b9e1b628064daba3650d04fa83cf79808877981 commit 8b9e1b628064daba3650d04fa83cf79808877981 Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:36 +0000 Commit: Christos Margiolis CommitDate: 2024-07-06 18:22:36 +0000 sound: Remove *MINOR from midi/ Sponsored by: The FreeBSD Foundation MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D45772 --- sys/dev/sound/midi/midi.c | 14 ++++---------- sys/dev/sound/midi/sequencer.c | 12 +++--------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/sys/dev/sound/midi/midi.c b/sys/dev/sound/midi/midi.c index f31496df025b..66fb67b31e7a 100644 --- a/sys/dev/sound/midi/midi.c +++ b/sys/dev/sound/midi/midi.c @@ -73,10 +73,6 @@ MALLOC_DEFINE(M_MIDI, "midi buffers", "Midi data allocation area"); #define KOBJMETHOD_END { NULL, NULL } #endif -#define PCMMKMINOR(u, d, c) ((((c) & 0xff) << 16) | (((u) & 0x0f) << 4) | ((d) & 0x0f)) -#define MIDIMKMINOR(u, d, c) PCMMKMINOR(u, d, c) - -#define MIDI_DEV_RAW 2 #define MIDI_DEV_MIDICTL 12 enum midi_states { @@ -364,9 +360,8 @@ midi_init(kobj_class_t cls, int unit, int channel, void *cookie) sx_xunlock(&midistat_lock); - m->dev = make_dev(&midi_cdevsw, - MIDIMKMINOR(unit, MIDI_DEV_RAW, channel), - UID_ROOT, GID_WHEEL, 0666, "midi%d.%d", unit, channel); + m->dev = make_dev(&midi_cdevsw, unit, UID_ROOT, GID_WHEEL, 0666, + "midi%d.%d", unit, channel); m->dev->si_drv1 = m; return m; @@ -1387,9 +1382,8 @@ midi_load(void) sx_init(&midistat_lock, "midistat lock"); TAILQ_INIT(&midi_devs); - midistat_dev = make_dev(&midistat_cdevsw, - MIDIMKMINOR(0, MIDI_DEV_MIDICTL, 0), - UID_ROOT, GID_WHEEL, 0666, "midistat"); + midistat_dev = make_dev(&midistat_cdevsw, MIDI_DEV_MIDICTL, UID_ROOT, + GID_WHEEL, 0666, "midistat"); return 0; } diff --git a/sys/dev/sound/midi/sequencer.c b/sys/dev/sound/midi/sequencer.c index 68b06a4f4ca4..01f9d0b4809b 100644 --- a/sys/dev/sound/midi/sequencer.c +++ b/sys/dev/sound/midi/sequencer.c @@ -91,10 +91,6 @@ #define LOOKUP_OPEN (1) #define LOOKUP_CLOSE (2) -#define PCMMKMINOR(u, d, c) \ - ((((c) & 0xff) << 16) | (((u) & 0x0f) << 4) | ((d) & 0x0f)) -#define MIDIMKMINOR(u, d, c) PCMMKMINOR(u, d, c) -#define MIDIUNIT(y) ((dev2unit(y) >> 4) & 0x0f) #define MIDIDEV(y) (dev2unit(y) & 0x0f) /* These are the entries to the sequencer driver. */ @@ -567,12 +563,10 @@ seq_addunit(void) if (scp->mapper == NULL) goto err; - scp->seqdev = make_dev(&seq_cdevsw, - MIDIMKMINOR(scp->unit, SND_DEV_SEQ, 0), UID_ROOT, - GID_WHEEL, 0666, "sequencer%d", scp->unit); + scp->seqdev = make_dev(&seq_cdevsw, SND_DEV_SEQ, UID_ROOT, GID_WHEEL, + 0666, "sequencer%d", scp->unit); - scp->musicdev = make_dev(&seq_cdevsw, - MIDIMKMINOR(scp->unit, SND_DEV_MUSIC, 0), UID_ROOT, + scp->musicdev = make_dev(&seq_cdevsw, SND_DEV_MUSIC, UID_ROOT, GID_WHEEL, 0666, "music%d", scp->unit); if (scp->seqdev == NULL || scp->musicdev == NULL) From nobody Sat Jul 6 18:24:11 2024 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 4WGf0q2cR5z5PMRc; Sat, 06 Jul 2024 18:24: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGf0q1PNTz542N; Sat, 6 Jul 2024 18:24:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BYFt2LXLpTqyoxy2vPivAozE1eTNQKGSVJCnuTXd7/Q=; b=UqcGCKEACi7W1hreZpL7pW5ChtrAM9v2edoR0Uv2OodD42l44eZPV1UerOT84MPdsW8MK+ PjVaoFdd+mOaYAaOpJDWtw20pJNw5lpeqBojny2MJoigmw3lGxb2tpAusxn9cDwtdm75AP LizUGtvyKH5WnChfRqOURN1pAh15ZhVPvctHsIZOkmt8T8aiA4xpmnGkRQn2crLWESDThJ R6tzHwEQWUnWs5gHvptv3fdkdeJgwBsZUAcxBRyK7htcNgF+K6FWL0bujYHsD2iaD46cjE zAEPpcJa6T5FLrnmSc6Ds5ss0wWUXCLFq6IpP0NiWUppu/aceKZfegHCW3bU0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720290251; a=rsa-sha256; cv=none; b=s1npDRCM0BuXGIVtr35nSjmosORKGYgWSNEfQa4gjuhor9NfyHHX/H2yMzrvupwfW5Vdfk UcMJdl2tpUqa+TfnALj1VsEnfmT7RHpQgub/fNZzA9am2YHPgTP4kldWH4yCDzzUckWNeB KkdnjsJY3By+6TovagQHdJjyNnf6+O8Z74r+0agn0xgT4pAYkvzHuL4ZZATKG+7NG+TJxO FrK6cqZIfIxxOJafsg1ibf9JcKam0XJx+sYVrwAOWXH7EQTizVcaG7Dhz256XrEbkzYG7G Z3Vy03LpxoRApFBZoLgLIUjgeqY5Pc7qIPbAKRBgb4gMrLUTlAuF7Sb6lBWceg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BYFt2LXLpTqyoxy2vPivAozE1eTNQKGSVJCnuTXd7/Q=; b=npQlLkXYeBquLMkxkvZavMxtzFCyNNgiyKxmQh4duJGn8QmIx25sp6heYvz3xzi0+1E1WS h3G0bHHHkV18rvGd7wBrkxWEyRIdY5GnDeFll8A6aS8v+XCiarFiAjna6oURuKxLnTK3yR fRMRm2PkUC82QPEWorxKqeM+/t0/NvZZZb+wc0KjM/ADLzUmeqAUZ6uE245OU+mSNt5hDh icWpPv+Im1bI0G9VBvb8m3KLaaAH9itoHw4vzlTGsSRyaESbvGktfNvkoIYP8ntus2XXYl YZTzwmNXS8jIfcuHFDhUFrpuJMMA+pgv7h82dgiAFeiaoFq4k9oeowwQ5OcR2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WGf0q0fDvzqpx; Sat, 6 Jul 2024 18:24:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 466IOBdP090752; Sat, 6 Jul 2024 18:24:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466IOBsk090749; Sat, 6 Jul 2024 18:24:11 GMT (envelope-from git) Date: Sat, 6 Jul 2024 18:24:11 GMT Message-Id: <202407061824.466IOBsk090749@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 46e92a41cb53 - main - sound: Simplify getchns() 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 46e92a41cb539e327dd059d571fa381d0fbe779c Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=46e92a41cb539e327dd059d571fa381d0fbe779c commit 46e92a41cb539e327dd059d571fa381d0fbe779c Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:40 +0000 Commit: Christos Margiolis CommitDate: 2024-07-06 18:22:40 +0000 sound: Simplify getchns() Remove all special handling for SIMPLEX, since we can just fetch the channel directly. While here: - Get rid of a no-op getchns() call in dsp_ioctl(). - Rename getchns() to dsp_lock_chans(), and relchns() to dsp_unlock_chans(). - Simplify DSP_FIXUP_ERROR(), as we do not longer assign SD_F_PRIO* flags to the softc. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45775 --- sys/dev/sound/pcm/dsp.c | 74 ++++++++----------------------------------------- 1 file changed, 12 insertions(+), 62 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 6ac85635b080..f2cead08783c 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -142,52 +142,8 @@ dsp_destroy_dev(device_t dev) } static void -getchns(struct dsp_cdevpriv *priv, uint32_t prio) +dsp_lock_chans(struct dsp_cdevpriv *priv, uint32_t prio) { - struct snddev_info *d; - struct pcm_channel *ch; - uint32_t flags; - - if (priv->simplex) { - d = priv->sc; - if (!PCM_REGISTERED(d)) - return; - PCM_LOCK(d); - PCM_WAIT(d); - PCM_ACQUIRE(d); - /* - * Note: order is important - - * pcm flags -> prio query flags -> wild guess - */ - ch = NULL; - flags = pcm_getflags(d->dev); - if (flags & SD_F_PRIO_WR) { - ch = priv->rdch; - } else if (flags & SD_F_PRIO_RD) { - ch = priv->wrch; - } else if (prio & SD_F_PRIO_WR) { - ch = priv->rdch; - flags |= SD_F_PRIO_WR; - } else if (prio & SD_F_PRIO_RD) { - ch = priv->wrch; - flags |= SD_F_PRIO_RD; - } else if (priv->wrch != NULL) { - ch = priv->rdch; - flags |= SD_F_PRIO_WR; - } else if (priv->rdch != NULL) { - ch = priv->wrch; - flags |= SD_F_PRIO_RD; - } - pcm_setflags(d->dev, flags); - if (ch != NULL) { - CHN_LOCK(ch); - chn_ref(ch, -1); - chn_release(ch); - } - PCM_RELEASE(d); - PCM_UNLOCK(d); - } - if (priv->rdch != NULL && (prio & SD_F_PRIO_RD)) CHN_LOCK(priv->rdch); if (priv->wrch != NULL && (prio & SD_F_PRIO_WR)) @@ -195,7 +151,7 @@ getchns(struct dsp_cdevpriv *priv, uint32_t prio) } static void -relchns(struct dsp_cdevpriv *priv, uint32_t prio) +dsp_unlock_chans(struct dsp_cdevpriv *priv, uint32_t prio) { if (priv->rdch != NULL && (prio & SD_F_PRIO_RD)) CHN_UNLOCK(priv->rdch); @@ -333,17 +289,12 @@ skip: } #define DSP_FIXUP_ERROR() do { \ - prio = pcm_getflags(d->dev); \ if (!DSP_F_VALID(flags)) \ error = EINVAL; \ if (!DSP_F_DUPLEX(flags) && \ ((DSP_F_READ(flags) && d->reccount == 0) || \ (DSP_F_WRITE(flags) && d->playcount == 0))) \ error = ENOTSUP; \ - else if (!DSP_F_DUPLEX(flags) && (prio & SD_F_SIMPLEX) && \ - ((DSP_F_READ(flags) && (prio & SD_F_PRIO_WR)) || \ - (DSP_F_WRITE(flags) && (prio & SD_F_PRIO_RD)))) \ - error = EBUSY; \ } while (0) static int @@ -352,7 +303,7 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) struct dsp_cdevpriv *priv; struct pcm_channel *rdch, *wrch; struct snddev_info *d; - uint32_t fmt, spd, prio; + uint32_t fmt, spd; int error, rderror, wrerror; /* Kind of impossible.. */ @@ -533,18 +484,18 @@ dsp_io_ops(struct dsp_cdevpriv *priv, struct uio *buf) runpid = buf->uio_td->td_proc->p_pid; - getchns(priv, prio); + dsp_lock_chans(priv, prio); if (*ch == NULL || !((*ch)->flags & CHN_F_BUSY)) { if (priv->rdch != NULL || priv->wrch != NULL) - relchns(priv, prio); + dsp_unlock_chans(priv, prio); PCM_GIANT_EXIT(d); return (EBADF); } if (((*ch)->flags & (CHN_F_MMAP | CHN_F_DEAD)) || (((*ch)->flags & CHN_F_RUNNING) && (*ch)->pid != runpid)) { - relchns(priv, prio); + dsp_unlock_chans(priv, prio); PCM_GIANT_EXIT(d); return (EINVAL); } else if (!((*ch)->flags & CHN_F_RUNNING)) { @@ -563,7 +514,7 @@ dsp_io_ops(struct dsp_cdevpriv *priv, struct uio *buf) CHN_BROADCAST(&(*ch)->cv); - relchns(priv, prio); + dsp_unlock_chans(priv, prio); PCM_GIANT_LEAVE(d); @@ -799,7 +750,6 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, return (ret); } - getchns(priv, 0); rdch = priv->rdch; wrch = priv->wrch; @@ -1858,7 +1808,7 @@ dsp_poll(struct cdev *i_dev, int events, struct thread *td) ret = 0; - getchns(priv, SD_F_PRIO_RD | SD_F_PRIO_WR); + dsp_lock_chans(priv, SD_F_PRIO_RD | SD_F_PRIO_WR); wrch = priv->wrch; rdch = priv->rdch; @@ -1874,7 +1824,7 @@ dsp_poll(struct cdev *i_dev, int events, struct thread *td) ret |= chn_poll(rdch, e, td); } - relchns(priv, SD_F_PRIO_RD | SD_F_PRIO_WR); + dsp_unlock_chans(priv, SD_F_PRIO_RD | SD_F_PRIO_WR); PCM_GIANT_LEAVE(d); @@ -1936,7 +1886,7 @@ dsp_mmap_single(struct cdev *i_dev, vm_ooffset_t *offset, PCM_GIANT_ENTER(d); - getchns(priv, SD_F_PRIO_RD | SD_F_PRIO_WR); + dsp_lock_chans(priv, SD_F_PRIO_RD | SD_F_PRIO_WR); wrch = priv->wrch; rdch = priv->rdch; @@ -1945,7 +1895,7 @@ dsp_mmap_single(struct cdev *i_dev, vm_ooffset_t *offset, (*offset + size) > sndbuf_getallocsize(c->bufsoft) || (wrch != NULL && (wrch->flags & CHN_F_MMAP_INVALID)) || (rdch != NULL && (rdch->flags & CHN_F_MMAP_INVALID))) { - relchns(priv, SD_F_PRIO_RD | SD_F_PRIO_WR); + dsp_unlock_chans(priv, SD_F_PRIO_RD | SD_F_PRIO_WR); PCM_GIANT_EXIT(d); return (EINVAL); } @@ -1956,7 +1906,7 @@ dsp_mmap_single(struct cdev *i_dev, vm_ooffset_t *offset, rdch->flags |= CHN_F_MMAP; *offset = (uintptr_t)sndbuf_getbufofs(c->bufsoft, *offset); - relchns(priv, SD_F_PRIO_RD | SD_F_PRIO_WR); + dsp_unlock_chans(priv, SD_F_PRIO_RD | SD_F_PRIO_WR); *object = vm_pager_allocate(OBJT_DEVICE, i_dev, size, nprot, *offset, curthread->td_ucred); From nobody Sat Jul 6 18:24:12 2024 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 4WGf0r5kVHz5PMV4; Sat, 06 Jul 2024 18: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGf0r20hPz54CD; Sat, 6 Jul 2024 18:24:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jlu/3g4JXzF7I8m3hkxqwfe4WsgaVlWMEGSMqaDfT8k=; b=lCxe7flPZZme7bJ6+y4gqF93ramkldbKNQEcbuaFmP7HpTvlgrTih/kj0MeFoj+P1eShfL VhF6Qg5hwMTy2PpBeQGPEfew5vHZglZWdKLukgxfanKwhCmK+lN8iQ8ij++8W0M5xSpycG DZzqIdI4dJgP82zvRginVFeMqkyJXyQXQvFPk9vJY7vHSON/DoVJeq3XZCW6sjK7v6iIyJ 4bPuWkoOEFrbPPL5LJOQaghfNQPKBJEIAwGQ4T0/6Xet7EqVZaIUjc2a5DqQYx7ahONtVQ fIlEpW+BF/zNgLhzYgcd/XClxxjJWMR8Lae7pHHWO8X+pW2RUNITvBJV6ut/Kg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720290252; a=rsa-sha256; cv=none; b=xgHjC4K6VGOcPP2FJotpjrE+HqlA+PBRaRR1c8ZaLIbeyeuz8+0txyM3V+MNCKWhzoJzMb pjqAEtXpHuccSkT2u3YllhgX7qGfH4cJ3ii1ZK7dmuZW3V3soMYudfaoaR5EKD4FMmW4Em nnxmdCbc82epJXCTZevMn8CyEmZgQ5/zH7OZ2aSP2MfymFkME0eljkcfxIiZDznYHVGfe3 7Pw1NQh+kU/DXqxbS0TqOQrAuwrdpXa2IzohFnVUSPlZBMPOq2h7FGedag75bMQrnk4rXt EIYl+05dHRVfRr8BOt/gF3LnTZh5wu2/lLansMntxGUUpsO/dxvrMJ4SLeuZ7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jlu/3g4JXzF7I8m3hkxqwfe4WsgaVlWMEGSMqaDfT8k=; b=s8cTriWkvXvyRhusC4KKrvHSPQU7Hq0qdKswfSymjfmN33uogzZi9/4tLqNSysrbW693CO Jqjlco3n+02GKaBe2936njVglZTyvjgvJTAm52Dz0LKcztqe9mI3FRFLH5z2kkcsqhijWA z4mIuB2jWCjw/itO1NBPvohxk/Smqez+D1ew4vHG3EBciFUkgqyQAyjgBsdhafbIKTMTzK AhZHl2tB3gyIaeHD0bHAnk/vOsfBWy5d3LOWx3NhhGvM8FrAQD9x90YNpZ4JY7Njp5ASNC V7QWTX8RAYBBWYwSmW2FwvMifFH/2fPW038UEm99QV3zpOq5W2geT5DY/Ph3xQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WGf0r1cVPzrVv; Sat, 6 Jul 2024 18:24:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 466IOCWa090797; Sat, 6 Jul 2024 18:24:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466IOCWo090794; Sat, 6 Jul 2024 18:24:12 GMT (envelope-from git) Date: Sat, 6 Jul 2024 18:24:12 GMT Message-Id: <202407061824.466IOCWo090794@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: be04a9d9387f - main - sound: Improve simplex handling in dsp_open() 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: be04a9d9387f6b5d4e83fc4976d8d83bb03fe5af Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=be04a9d9387f6b5d4e83fc4976d8d83bb03fe5af commit be04a9d9387f6b5d4e83fc4976d8d83bb03fe5af Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:45 +0000 Commit: Christos Margiolis CommitDate: 2024-07-06 18:22:45 +0000 sound: Improve simplex handling in dsp_open() If we are in simplex mode, make sure we do not open in both directions (read/write) and also that we do not open in a direction opposite of what is already opened. For example, if the device is already doing playback, we cannot open the device for recording at the same time, and vice-versa. While here, remove dsp_cdevpriv->simplex as it's no longer needed. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45835 --- sys/dev/sound/pcm/dsp.c | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index f2cead08783c..26a2919ed1da 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -52,7 +52,6 @@ struct dsp_cdevpriv { struct pcm_channel *rdch; struct pcm_channel *wrch; struct pcm_channel *volch; - int simplex; }; static int dsp_mmap_allow_prot_exec = 0; @@ -301,10 +300,10 @@ static int dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) { struct dsp_cdevpriv *priv; - struct pcm_channel *rdch, *wrch; + struct pcm_channel *rdch, *wrch, *ch; struct snddev_info *d; uint32_t fmt, spd; - int error, rderror, wrerror; + int error, rderror, wrerror, dir; /* Kind of impossible.. */ if (i_dev == NULL || td == NULL) @@ -319,7 +318,6 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) priv->rdch = NULL; priv->wrch = NULL; priv->volch = NULL; - priv->simplex = (pcm_getflags(d->dev) & SD_F_SIMPLEX) ? 1 : 0; error = devfs_set_cdevpriv(priv, dsp_close); if (error != 0) @@ -333,6 +331,36 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) error = 0; DSP_FIXUP_ERROR(); + if (pcm_getflags(d->dev) & SD_F_SIMPLEX) { + if (DSP_F_DUPLEX(flags)) { + /* + * If no channels are opened yet, and we request + * DUPLEX, limit to playback only, otherwise open one + * channel in a direction that already exists. + */ + if (CHN_EMPTY(d, channels.pcm.opened)) { + if (d->playcount > 0) + flags &= ~FREAD; + else if (d->reccount > 0) + flags &= ~FWRITE; + } else { + ch = CHN_FIRST(d, channels.pcm.opened); + if (ch->direction == PCMDIR_PLAY) + flags &= ~FREAD; + else if (ch->direction == PCMDIR_REC) + flags &= ~FWRITE; + } + } else if (!CHN_EMPTY(d, channels.pcm.opened)) { + /* + * If we requested SIMPLEX, make sure we do not open a + * channel in the opposite direction. + */ + ch = CHN_FIRST(d, channels.pcm.opened); + dir = DSP_F_READ(flags) ? PCMDIR_REC : PCMDIR_PLAY; + if (ch->direction != dir) + error = ENOTSUP; + } + } if (error != 0) { PCM_UNLOCK(d); PCM_GIANT_EXIT(d); From nobody Sat Jul 6 18:24:13 2024 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 4WGf0s59hkz5PMZh; Sat, 06 Jul 2024 18:24: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGf0s3pcbz54Fj; Sat, 6 Jul 2024 18:24:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JVg5AnNs2EWTO3y1Hi4EZwFUVVTbAxFznd0/1FpZD5g=; b=dzhq56lNwyVQoXnUSm0+wbzt80MW408ptARhSxUJsIs3t9Vkq+bIXru0BM9HYdg1d03dqw 9m1DRU4gJImpBjA6d1WhoU+NIeTJ93nazhLK7lrMKIYc9MAE+EJMAj5SYkID2vH6NZeuoN QaWkkS/9hkjZXZMNOCxXSl2aZmiG5wGMgg01EWKnUaUZDGiUzoz8mpI3R7nc2tqOWDkONg rYPaplNAfeR/1Z71rjhwAyx9QzUMbM+EJiP0Vr1BPFEBTe5i5OcNEkzZHzXwZBSRGyd/iz E+TLKr1TZ31wR3bHOb5/XPXKNtHo1FDQWC8qXnUr9JSKI4ohFf0qXr36UmS60w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720290253; a=rsa-sha256; cv=none; b=rZEQbAC0CF5zbF2AeBWEI745uw1Lk+Xk9Ae/B44Wts85z/DsWel4uVrmmmTLPVHlR3dp5V kJE5Czg4JQrGzmsDU+T9A9AXnClsAXf9cLSW8XPTQlFZdZoJe684K1n0PdVixKRcbwYsBs iDuXBezrro/knGdin0341Dj1kz7EyylJWYRGmKyWyp0TChETDp7AQmBFEHWawOGQjUDz+3 GeD1cpIVv/4iCHcxtiE0SOP+9vG4bCrJN/EASdISYtNnAKGA9xvRVRGo8MMblfIqMZI42Y Tk+qf8eFMqGQj/09Z90/a55C3fRYaqCJXXiAVnifo6QpaQiO7z38dbHuNwh6ew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JVg5AnNs2EWTO3y1Hi4EZwFUVVTbAxFznd0/1FpZD5g=; b=ZfxTJ9aTQO12BG+6EbIdOTF0GeBir2jkBZsNzPKWpRRsNyeimi2X46JSSJv0xTOueL3cv5 FJMTip8ERBi9mVnjDr7JDh4o/QG/jCk8hymp91kcHgeYSYyl0zP28qEr597viDL+6dyK6p 5+Kh1yygdfP48Ru7yUZQXMkTxJsLJ/wHYkBUBSJiWZTiejE/TyFbc+9f9pxXsVLlIGAg8H BqrgjRYxfYl3fNVhBz+Tl76jcdao0g48ok7ni4nAtU20wz5pWyYipUyVANhGBvnTzJ4xTJ xQh0xwtqusvp0i07HeI2WjslNpSjSh7qghJ9ErGZ9VMWSmHaoT5CeSfpxkH3QQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WGf0s2hYpzqwB; Sat, 6 Jul 2024 18:24:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 466IODvI090840; Sat, 6 Jul 2024 18:24:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466IODAx090837; Sat, 6 Jul 2024 18:24:13 GMT (envelope-from git) Date: Sat, 6 Jul 2024 18:24:13 GMT Message-Id: <202407061824.466IODAx090837@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: adc1713fb13f - main - sound: Make DSP_FIXUP_ERROR() regular 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: adc1713fb13f89a6eb33f5de840c981d0e17e4b7 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=adc1713fb13f89a6eb33f5de840c981d0e17e4b7 commit adc1713fb13f89a6eb33f5de840c981d0e17e4b7 Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:50 +0000 Commit: Christos Margiolis CommitDate: 2024-07-06 18:22:50 +0000 sound: Make DSP_FIXUP_ERROR() regular code No reason to have this as a macro. While here, change the second case to an "else if" as there is no reason to check it if the open flags are invalid. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj, emaste Differential Revision: https://reviews.freebsd.org/D45776 --- sys/dev/sound/pcm/dsp.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 26a2919ed1da..27c89c3231b7 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -287,15 +287,6 @@ skip: priv = NULL; } -#define DSP_FIXUP_ERROR() do { \ - if (!DSP_F_VALID(flags)) \ - error = EINVAL; \ - if (!DSP_F_DUPLEX(flags) && \ - ((DSP_F_READ(flags) && d->reccount == 0) || \ - (DSP_F_WRITE(flags) && d->playcount == 0))) \ - error = ENOTSUP; \ -} while (0) - static int dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) { @@ -330,7 +321,12 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) PCM_WAIT(d); error = 0; - DSP_FIXUP_ERROR(); + if (!DSP_F_VALID(flags)) + error = EINVAL; + else if (!DSP_F_DUPLEX(flags) && + ((DSP_F_READ(flags) && d->reccount == 0) || + (DSP_F_WRITE(flags) && d->playcount == 0))) + error = ENOTSUP; if (pcm_getflags(d->dev) & SD_F_SIMPLEX) { if (DSP_F_DUPLEX(flags)) { /* From nobody Sat Jul 6 18:24:15 2024 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 4WGf0w0DsHz5PMRr; Sat, 06 Jul 2024 18:24: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGf0v5KgMz54G9; Sat, 6 Jul 2024 18:24:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s82fzPSiuoi06iSxPPbviBKrH0nAVeF26bJx30CMjao=; b=fpPaZHktvCfS+j82jugHksPtEXcc8Bndi5W6s/lurb6FG+GF+gfD9o1dLVYOZYCQP53uD0 nT9P1dlp771Jmgh+gHA1ut8ya7oSAYgv29gACUJtfjJAo4so9pMi1pWtoLFXx4inInkPmS djvpI30g6VSCuvkbk/ga3S+rAZpaBhlVspWhNN1fAiAl2SwimHo+dJRR1Kfh0U0R2Advr6 yFFw7nlaovCjsrSJbb0x+GvYoeC4SQ/EdtYVLXPbV3cU7NEkMTlnl8WMY9F1J/6r/l7QyC OhQ+ttxrKjSgoJ9jtMpdeV9Q6eRfzivAmO+fNZKHdOmOvZ4uhZTX0TsV7ibm2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720290255; a=rsa-sha256; cv=none; b=AzKGnZhGDqV8qc/trZd2+PBDqAJD85FBHyOTRn/URE/OQBLuHumhFY/8As8tfwohsC/oPR NCyF+IAJJ8p1ujEUAfeicNntdpa6XsYFfPZgBqyfXWdbnhPRHOlmgGS+iluWb+Hqxo9Tqu TGZIt/c1ikU+c++tRMvXhs/obvI1gxkr+nMoibCCmoys3fYlUldoe4otZ2WVuZjeambgNS gASPrOBYIk06ryQ2GEZSf7RGSJXjeZ16AEDOA1/Fkq7wg0YpfnaedA8YFx/qVKtZOWmCLS nzhdvykoz5Iz/ai+795wQ1ezYeUQDZd9GxQkADjUr8XUyopoa21LwsLx/MxeUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s82fzPSiuoi06iSxPPbviBKrH0nAVeF26bJx30CMjao=; b=iz/c4ZVzvLmsioT+4LpeO/WuWhFEsEJivofAwI8854OGZVoDXxdOgjIcw4V9/t0FdV3tEk n9woT0pmb/SKs/lc7/5L5dljakWWK+8FOkQPNNYVBIHOKuv5PN9V+xeFx3kSSvn0MJ8EtH mRCt0obYsMpW7CJRB90xWeXttN7v0qYEo4tikO1uYBwcT+rFXreWAW8xzpPkvVgTirqngl IKutKXcgv7+PJTXqnNH7jNExlf0k8objG7UuQzo7QCTKoz/4JdZssn22YIb+wCSFXiklsS FV15duO4rJvWuJS0eJ+Yl3Hj0+zaI4gMl43FvRM2jAxMN6XV/+72XOA8TlkJBw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WGf0v4xGQzqpy; Sat, 6 Jul 2024 18:24:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 466IOFtL090937; Sat, 6 Jul 2024 18:24:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466IOF5P090934; Sat, 6 Jul 2024 18:24:15 GMT (envelope-from git) Date: Sat, 6 Jul 2024 18:24:15 GMT Message-Id: <202407061824.466IOF5P090934@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 2d6fc24673cc - main - sound: Handle midistat_lock through function interface 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2d6fc24673ccc97020c94094f97ee015f1db9702 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=2d6fc24673ccc97020c94094f97ee015f1db9702 commit 2d6fc24673ccc97020c94094f97ee015f1db9702 Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:59 +0000 Commit: Christos Margiolis CommitDate: 2024-07-06 18:22:59 +0000 sound: Handle midistat_lock through function interface midistat_lock is used outside midi/midi.c as well, so implement lock, unlock and lockassert functions in order not to expose the lock in the header file. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D45857 --- sys/dev/sound/midi/midi.c | 76 ++++++++++++++++++++++++++---------------- sys/dev/sound/midi/midi.h | 6 ++-- sys/dev/sound/midi/sequencer.c | 4 +-- 3 files changed, 53 insertions(+), 33 deletions(-) diff --git a/sys/dev/sound/midi/midi.c b/sys/dev/sound/midi/midi.c index 66fb67b31e7a..c42cb1d7a90c 100644 --- a/sys/dev/sound/midi/midi.c +++ b/sys/dev/sound/midi/midi.c @@ -177,7 +177,7 @@ TAILQ_HEAD(, snd_midi) midi_devs; * /dev/midistat variables and declarations, protected by midistat_lock */ -struct sx midistat_lock; +struct sx mstat_lock; static int midistat_isopen = 0; static struct sbuf midistat_sbuf; @@ -258,6 +258,24 @@ SYSCTL_INT(_hw_midi_stat, OID_AUTO, verbose, CTLFLAG_RW, * CODE START */ +void +midistat_lock(void) +{ + sx_xlock(&mstat_lock); +} + +void +midistat_unlock(void) +{ + sx_xunlock(&mstat_lock); +} + +void +midistat_lockassert(void) +{ + sx_assert(&mstat_lock, SA_XLOCKED); +} + /* * Register a new rmidi device. cls midi_if interface unit == 0 means * auto-assign new unit number unit != 0 already assigned a unit number, eg. @@ -280,7 +298,7 @@ midi_init(kobj_class_t cls, int unit, int channel, void *cookie) uint8_t *buf; MIDI_DEBUG(1, printf("midiinit: unit %d/%d.\n", unit, channel)); - sx_xlock(&midistat_lock); + midistat_lock(); /* * Protect against call with existing unit/channel or auto-allocate a * new unit number. @@ -358,7 +376,7 @@ midi_init(kobj_class_t cls, int unit, int channel, void *cookie) TAILQ_INSERT_TAIL(&midi_devs, m, link); - sx_xunlock(&midistat_lock); + midistat_unlock(); m->dev = make_dev(&midi_cdevsw, unit, UID_ROOT, GID_WHEEL, 0666, "midi%d.%d", unit, channel); @@ -378,7 +396,7 @@ err1: free(m->synth, M_MIDI); free(m, M_MIDI); err0: - sx_xunlock(&midistat_lock); + midistat_unlock(); MIDI_DEBUG(1, printf("midi_init ended in error\n")); return NULL; } @@ -396,7 +414,7 @@ midi_uninit(struct snd_midi *m) int err; err = EBUSY; - sx_xlock(&midistat_lock); + midistat_lock(); mtx_lock(&m->lock); if (m->busy) { if (!(m->rchan || m->wchan)) @@ -418,7 +436,7 @@ midi_uninit(struct snd_midi *m) err: mtx_unlock(&m->lock); exit: - sx_xunlock(&midistat_lock); + midistat_unlock(); return err; } @@ -926,9 +944,9 @@ midistat_open(struct cdev *i_dev, int flags, int mode, struct thread *td) MIDI_DEBUG(1, printf("midistat_open\n")); - sx_xlock(&midistat_lock); + midistat_lock(); if (midistat_isopen) { - sx_xunlock(&midistat_lock); + midistat_unlock(); return EBUSY; } midistat_isopen = 1; @@ -940,7 +958,7 @@ midistat_open(struct cdev *i_dev, int flags, int mode, struct thread *td) out: if (error) midistat_isopen = 0; - sx_xunlock(&midistat_lock); + midistat_unlock(); return error; } @@ -948,14 +966,14 @@ static int midistat_close(struct cdev *i_dev, int flags, int mode, struct thread *td) { MIDI_DEBUG(1, printf("midistat_close\n")); - sx_xlock(&midistat_lock); + midistat_lock(); if (!midistat_isopen) { - sx_xunlock(&midistat_lock); + midistat_unlock(); return EBADF; } sbuf_delete(&midistat_sbuf); midistat_isopen = 0; - sx_xunlock(&midistat_lock); + midistat_unlock(); return 0; } @@ -966,13 +984,13 @@ midistat_read(struct cdev *i_dev, struct uio *uio, int flag) int err; MIDI_DEBUG(4, printf("midistat_read\n")); - sx_xlock(&midistat_lock); + midistat_lock(); if (!midistat_isopen) { - sx_xunlock(&midistat_lock); + midistat_unlock(); return EBADF; } if (uio->uio_offset < 0 || uio->uio_offset > sbuf_len(&midistat_sbuf)) { - sx_xunlock(&midistat_lock); + midistat_unlock(); return EINVAL; } err = 0; @@ -981,7 +999,7 @@ midistat_read(struct cdev *i_dev, struct uio *uio, int flag) err = uiomove(sbuf_data(&midistat_sbuf) + uio->uio_offset, l, uio); } - sx_xunlock(&midistat_lock); + midistat_unlock(); return err; } @@ -994,7 +1012,7 @@ midistat_prepare(struct sbuf *s) { struct snd_midi *m; - sx_assert(&midistat_lock, SA_XLOCKED); + midistat_lockassert(); sbuf_printf(s, "FreeBSD Midi Driver (midi2)\n"); if (TAILQ_EMPTY(&midi_devs)) { @@ -1353,7 +1371,7 @@ midisynth_bender(void *n, uint8_t chn, uint16_t val) static int midi_destroy(struct snd_midi *m, int midiuninit) { - sx_assert(&midistat_lock, SA_XLOCKED); + midistat_lockassert(); mtx_assert(&m->lock, MA_OWNED); MIDI_DEBUG(3, printf("midi_destroy\n")); @@ -1379,7 +1397,7 @@ midi_destroy(struct snd_midi *m, int midiuninit) static int midi_load(void) { - sx_init(&midistat_lock, "midistat lock"); + sx_init(&mstat_lock, "midistat lock"); TAILQ_INIT(&midi_devs); midistat_dev = make_dev(&midistat_cdevsw, MIDI_DEV_MIDICTL, UID_ROOT, @@ -1396,7 +1414,7 @@ midi_unload(void) MIDI_DEBUG(1, printf("midi_unload()\n")); retval = EBUSY; - sx_xlock(&midistat_lock); + midistat_lock(); if (midistat_isopen) goto exit0; @@ -1409,19 +1427,19 @@ midi_unload(void) if (retval) goto exit1; } - sx_xunlock(&midistat_lock); + midistat_unlock(); destroy_dev(midistat_dev); /* * Made it here then unload is complete */ - sx_destroy(&midistat_lock); + sx_destroy(&mstat_lock); return 0; exit1: mtx_unlock(&m->lock); exit0: - sx_xunlock(&midistat_lock); + midistat_unlock(); if (retval) MIDI_DEBUG(2, printf("midi_unload: failed\n")); return retval; @@ -1470,7 +1488,7 @@ midimapper_open_locked(void *arg1, void **cookie) int retval = 0; struct snd_midi *m; - sx_assert(&midistat_lock, SX_XLOCKED); + midistat_lockassert(); TAILQ_FOREACH(m, &midi_devs, link) { retval++; } @@ -1483,9 +1501,9 @@ midimapper_open(void *arg1, void **cookie) { int retval; - sx_xlock(&midistat_lock); + midistat_lock(); retval = midimapper_open_locked(arg1, cookie); - sx_xunlock(&midistat_lock); + midistat_unlock(); return retval; } @@ -1502,7 +1520,7 @@ midimapper_fetch_synth_locked(void *arg, void *cookie, int unit) struct snd_midi *m; int retval = 0; - sx_assert(&midistat_lock, SX_XLOCKED); + midistat_lockassert(); TAILQ_FOREACH(m, &midi_devs, link) { if (unit == retval) return (kobj_t)m->synth; @@ -1517,9 +1535,9 @@ midimapper_fetch_synth(void *arg, void *cookie, int unit) { kobj_t synth; - sx_xlock(&midistat_lock); + midistat_lock(); synth = midimapper_fetch_synth_locked(arg, cookie, unit); - sx_xunlock(&midistat_lock); + midistat_unlock(); return synth; } diff --git a/sys/dev/sound/midi/midi.h b/sys/dev/sound/midi/midi.h index afbfdfa6abbc..2254fab690e9 100644 --- a/sys/dev/sound/midi/midi.h +++ b/sys/dev/sound/midi/midi.h @@ -39,10 +39,12 @@ MALLOC_DECLARE(M_MIDI); #define M_RXEN 0x04 #define M_TXEN 0x08 -extern struct sx midistat_lock; - struct snd_midi; +void midistat_lock(void); +void midistat_unlock(void); +void midistat_lockassert(void); + struct snd_midi * midi_init(kobj_class_t _mpu_cls, int _unit, int _channel, void *cookie); int midi_uninit(struct snd_midi *_m); diff --git a/sys/dev/sound/midi/sequencer.c b/sys/dev/sound/midi/sequencer.c index 01f9d0b4809b..6b3a2711e951 100644 --- a/sys/dev/sound/midi/sequencer.c +++ b/sys/dev/sound/midi/sequencer.c @@ -746,7 +746,7 @@ mseq_open(struct cdev *i_dev, int flags, int mode, struct thread *td) * Mark this device busy. */ - sx_xlock(&midistat_lock); + midistat_lock(); mtx_lock(&scp->seq_lock); if (scp->busy) { mtx_unlock(&scp->seq_lock); @@ -784,7 +784,7 @@ mseq_open(struct cdev *i_dev, int flags, int mode, struct thread *td) } } } - sx_xunlock(&midistat_lock); + midistat_unlock(); timer_setvals(scp, 60, 100); From nobody Sat Jul 6 18:24:14 2024 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 4WGf0v1NBDz5PMKQ; Sat, 06 Jul 2024 18:24: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGf0t4Rh4z54CP; Sat, 6 Jul 2024 18:24:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UBl5QC25BDplYBP16w3Shd413sffDrORP8w7fZza0wo=; b=bZKi1mqKTCL0eARVYGqy00sjLXiplc9WzL5BJB4kRPSQImeT9sU4+Jqjg1qqA6j1anS38b iTjBUwk/410lt7mLXI2Jq70rrwhOnmWYRmbMlj33YTOdMwakXkFOojlSbHewiPVbPxt8aI Cr/HRuV0mmiMAH0s2o4odBkD6cnrepfouytKLZMQoazM+GCuJzcIuqSrd9bZAJM1pQl3kN z1892Gib/b/DLEYQUS4sNAtAk5VY27ySk/0/nqGFEqUNU2Vx/MQh7m8P7MboQGxXa596VJ EVwTlDoXqAqhBDRSiMSK3Nr3PChazui3aL6AW8TsfNx3ffHeRw1yKWFeGhfZew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720290254; a=rsa-sha256; cv=none; b=fX3vus15DXKHmC2CkgInz1IgK7gdZlPrIIIf1RbNxjW4thJRpg5blF4BsFXm6le+eOLvob 6m1CPeV4FOIMjt5W4maaF66P/FTPiFTwu7rKS0ib4q4klxRGxBT+r0XypuVW3MLmG/oJDo ttd2CFugV+J5H520c4nX+SDIiLWBszlGyUwLdWBhDSbjEg3JZqRnZ+KVhsRyLId/FpP0FR rjzOIf3kM6xXOK20+gMMWeeNKVrg3CVR48D+gfTm+CMd6gfROEvQGjOCZCgtSLHAnrgk6B R57XgV94gTC2QSPjkHKh/RoWk4ob9imJQvdHvp/FpbD0c/PJ87cQY2diZ3X/PA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UBl5QC25BDplYBP16w3Shd413sffDrORP8w7fZza0wo=; b=f3QA+JZsg3LjIZrpco1Rm91tZIC7s8mVpKw8chXZeqpob6Bbb5q9J60/6cDxKyrE9QGaBB oY8bnK25SOmewOpyclEnR4ckRv0jXMUA4HYrDSY9sYE+Wz5f4TGi4iHv9KLuCtDw2Pr16u 6jT/I3UDzVwVPiJUk59XA1jwgDgKmTcTxu0Zm8tkUM80xD4qd+CqPeWmpDFgfh69b+0gtU /i6CBYNjTMP/Ko2TNUfImZWq/h+pTl+ul8EDb7FnGMkRLlMqJLH2yN0oRiGfVNY95Lr01n 4TgslluUgby+fkNVMT/gwRTrTa2qIPBrF921O12A68n3EoxnMSNteNj/Gv46yA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WGf0t3p6Mzqd1; Sat, 6 Jul 2024 18:24:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 466IOExU090891; Sat, 6 Jul 2024 18:24:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466IOE41090888; Sat, 6 Jul 2024 18:24:14 GMT (envelope-from git) Date: Sat, 6 Jul 2024 18:24:14 GMT Message-Id: <202407061824.466IOE41090888@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: a9f08df3e900 - main - sound: Remove dead code in pcm_register() 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a9f08df3e9004f431e98f67afc1ac2b2f773ec14 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=a9f08df3e9004f431e98f67afc1ac2b2f773ec14 commit a9f08df3e9004f431e98f67afc1ac2b2f773ec14 Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:55 +0000 Commit: Christos Margiolis CommitDate: 2024-07-06 18:22:55 +0000 sound: Remove dead code in pcm_register() Sponsored by: The FreeBSD Foundation MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D45831 --- sys/dev/sound/pcm/sound.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 8d97dcd60231..b18b83468150 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -558,14 +558,7 @@ pcm_register(device_t dev, void *devinfo, int numplay, int numrec) d->lock = snd_mtxcreate(device_get_nameunit(dev), "sound cdev"); cv_init(&d->cv, device_get_nameunit(dev)); PCM_ACQUIRE_QUICK(d); -#if 0 - /* - * d->flags should be cleared by the allocator of the softc. - * We cannot clear this field here because several devices set - * this flag before calling pcm_register(). - */ - d->flags = 0; -#endif + i = 0; if (resource_int_value(device_get_name(dev), device_get_unit(dev), "vpc", &i) != 0 || i != 0) From nobody Sat Jul 6 18:24:16 2024 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 4WGf0x10tPz5PMHM; Sat, 06 Jul 2024 18:24:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGf0w6108z54SV; Sat, 6 Jul 2024 18:24:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W3aPSSvS20R5Cn264TO5cZ3Uwbt98IK1RohgBNutW58=; b=LFnaEQfGnjtX9J/P+0uPdXy+qwwee1NZzET3SkXedGV3awVefJxiL+c82eNi47I8j/ZNX8 jSiMlYX2mHrNhHZxlzr03jA0dvrjBO455OH1gpOyCk0mD/Iz4/7FwmOkpQym3BVzVrOtmd XLowveMP0u8SvGNyFml+jle7Uye3jzKKRscAmZ0BjHU92alAotjjmN6NXBSDna2/E0cfOl gZtNXNhBiGbEYp6+xNAvgFxMfMPz93cOZonbWuciuDzbVs6BlRqOE1SiVR06dPJ8Pk4hIX ZK9EhHGjYaTtP9MAey0Lt8BG/s5utDFhFq3UtnLNpizm1svvP1Rz1I75FjQKvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720290256; a=rsa-sha256; cv=none; b=UXydZFXGAU699UaBxv8Xuu90ZaCT2sU10UYzAuoAzqwUw6jIVRU027TqKXr49yFyR3hlAN gS0DFouZhuA0lYZ3AE1ykcLhRl//iJo+1QLr/wlssdX2wDF4+Yzxm5yAdwrjeMqBORzpzW Yeh9jzDxxWj+p07dgpn3wIxWjJNHpoYkmA1UPWnWlpT2FnsdwuEQrWOkpHMakLeKBHcTYV n1XuD+30WJo9+fNAhKUlH57/MJymZCI0Y68mfJdeCLLqSWpCRLFSw4hz7c3ashY/mZvd1e lGKjT2+2I1XPpiOniMXQDItferOdvL6b/bmN5zElSoCXyV+8A7uuTPTMTfwReg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W3aPSSvS20R5Cn264TO5cZ3Uwbt98IK1RohgBNutW58=; b=YlIPYlo2RHgDQ+wy6iLg4wLhcvQ5Uw6qEeiXu3lDcp1Kojl65FfEkzXRQ5jhjEjC3KJEOA dLRdSpbon//P3HBCDI/GRaZmg8bYDzBz2R4igmL5ySHahU5o5kQG1gQCCETEAG3oxgQQdO AT4MgTRDVeug6UMn2HeQyCGNIEc8VRmxVH9ux6RRwt6I7pr6oqjt5gG5KhYSRAnrryB/1T MvD2V+Lk7PS8T5HV1Uqd6OBi8Fk8ZL+Rf5klKVyQCkD8PsEDqr7p3w9hh4XW9BIc7XOJdo wN1R3dhphgehSm+LgTFP+Zw6bi0cimYeV4loKXPEijFL5BGPFefpLBxxptI36Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WGf0w5bXPzrWc; Sat, 6 Jul 2024 18:24:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 466IOGsu090988; Sat, 6 Jul 2024 18:24:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466IOGTK090985; Sat, 6 Jul 2024 18:24:16 GMT (envelope-from git) Date: Sat, 6 Jul 2024 18:24:16 GMT Message-Id: <202407061824.466IOGTK090985@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 86585210fd56 - main - sound: Fix min/max rate for SNDCTL_AUDIOINFO and SNDCTL_ENGINEINFO 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 86585210fd5657542884b22eb52b21e960b7be6c Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=86585210fd5657542884b22eb52b21e960b7be6c commit 86585210fd5657542884b22eb52b21e960b7be6c Author: Christos Margiolis AuthorDate: 2024-07-06 18:23:04 +0000 Commit: Christos Margiolis CommitDate: 2024-07-06 18:23:04 +0000 sound: Fix min/max rate for SNDCTL_AUDIOINFO and SNDCTL_ENGINEINFO Since we allow feeding of any rate within the [feeder_rate_min, feeder_rate_max] range, report this as the min/max rate as well. Only exceptions are when we the device is opened in exclusive or bitperfect mode. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45862 --- sys/dev/sound/pcm/dsp.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 27c89c3231b7..0689dfedb9c2 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -2170,8 +2170,13 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *ai, bool ex) else ai->iformats |= fmts; - ai->min_rate = min(ai->min_rate, caps->minspeed); - ai->max_rate = max(ai->max_rate, caps->maxspeed); + if (ex || (pcm_getflags(d->dev) & SD_F_BITPERFECT)) { + ai->min_rate = min(ai->min_rate, caps->minspeed); + ai->max_rate = max(ai->max_rate, caps->maxspeed); + } else { + ai->min_rate = min(ai->min_rate, feeder_rate_min); + ai->max_rate = max(ai->max_rate, feeder_rate_max); + } ai->min_channels = min(ai->min_channels, minch); ai->max_channels = max(ai->max_channels, maxch); @@ -2369,8 +2374,15 @@ dsp_oss_engineinfo(struct cdev *i_dev, oss_audioinfo *ai) * @todo @c handle - haven't decided how to generate * this yet; bus, vendor, device IDs? */ - ai->min_rate = caps->minspeed; - ai->max_rate = caps->maxspeed; + + if ((ch->flags & CHN_F_EXCLUSIVE) || + (pcm_getflags(d->dev) & SD_F_BITPERFECT)) { + ai->min_rate = caps->minspeed; + ai->max_rate = caps->maxspeed; + } else { + ai->min_rate = feeder_rate_min; + ai->max_rate = feeder_rate_max; + } ai->min_channels = minch; ai->max_channels = maxch; From nobody Sat Jul 6 18:24:17 2024 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 4WGf0y5gK7z5PMVN; Sat, 06 Jul 2024 18:24: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGf0y0JYpz54QK; Sat, 6 Jul 2024 18:24:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290258; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xy4XKOaz1l3HzHSWNVCYFQj1qkm5N4BaHuYxjfWX+8E=; b=Vbv6cbylt17uxapuuHii6SmYcy8ezVSFkZGWPc17YtGc2Cc4lBIIxSQ2WkyRJrfaVU8QI+ vL+B4gL0FYTjB48B9g7PkO0/Idzhbjd5RxFTRw6BFb93fKv3ePRIYJwoBqZTTLtWiQFJlC T2JP5ZvVhfAI/gPRBFcVzuGiDkvMnCiTyomBuIZu2ntwHc707FFewJjtf6cJkvZRHyF4RU Pio+JY+KBzkAaHmoyfdc5xW6rhzTnpbj0ypwvlUm4cXTuehd917HtjLETPMVL6FU7UfGlx OK37nXkOkgd0jH241nGN0DFdSRHcKUyg0CokTrJ+wGNvyf3SekZ5k14+ckW0uw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720290258; a=rsa-sha256; cv=none; b=EvLOokvXrT5wkzy0svT3R75N0+n1uO78DTOrT0M3nFcPR9UsyyMLN7Bs6iLbsZbPKs+WwU SZqWYRIbBoVSOW3UVC337+R4eDd3+srzyV3yvxc3OEM7+5g8R9E3Wlfh146QH4m9iubSHx z5KSkFBUVIuAEpKX98Ib3leI3xrcOK/vAfVhvri9tyKHbHzQ2StN5dmtOmU12M731kdm+Q V4tPysNPeNwfPxVV+v2hL37tES74OLd1LQ2gu+gZEmN7BV+mdOF0h2AYC9EyAIQKrpdubb LSJ2qtb537W1Lfzu4O0jq9awxeNPA8bHGPGNz/v7F/UTcxywJ/AFyb6t8vDR1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290258; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xy4XKOaz1l3HzHSWNVCYFQj1qkm5N4BaHuYxjfWX+8E=; b=iEEcg4guSdtA9zZ1S41u/NaiRqSzmMWFw0WYN6xoHxKW85txI2F/BkfSRS7F1Ua/sLBTfJ FiXd2l7a6md20Y8m8IMlsaZQw+pSTs5MzwmtvlZ3jvw8+bLPrB9WLkC82wgwsaDKvQQ5ey 4eFCdGHCNoLgNCLslvVtdDJUPcXQ56Bv8ItgXk8N27yS2/1BPxCT3eY1EwaJytVdKJMbn3 lX1kgzS8aZUZxfvzcBcl3OGDnC1NaZtdRXEIEX4PqYBj1701D2oObLeUAulEYdHsAMzk2R Qt9Nw5lIW33ifXlFyMf1ybb8yLIoHO+2GN7jHp3VVf3hSIx0vJxVWYFJNBMpvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WGf0x70wFzrVw; Sat, 6 Jul 2024 18:24:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 466IOHqJ091024; Sat, 6 Jul 2024 18:24:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466IOH54091021; Sat, 6 Jul 2024 18:24:17 GMT (envelope-from git) Date: Sat, 6 Jul 2024 18:24:17 GMT Message-Id: <202407061824.466IOH54091021@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 9d8b93bc9cce - main - sound: Refactor sndstat_get_caps() 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d8b93bc9ccea82b648ffa9354200c9e4d3f211b Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=9d8b93bc9ccea82b648ffa9354200c9e4d3f211b commit 9d8b93bc9ccea82b648ffa9354200c9e4d3f211b Author: Christos Margiolis AuthorDate: 2024-07-06 18:23:09 +0000 Commit: Christos Margiolis CommitDate: 2024-07-06 18:23:09 +0000 sound: Refactor sndstat_get_caps() The current implementation of sndstat_get_caps() does not work properly when VCHANs are enabled, as it skips all information about physical channels, and also assigns the min/max rates and channels to same values, which is usually not the case. A device either supports any sample rate within the [feeder_rate_min, feeder_rate_max] range, or [hw_rate_min, hw_rate_max] range when the device is opened in exclusive or bitperfect mode. The number of channels can also vary and is not always the same for both min and max. Refactor the whole function to resemble the way we handle fetching of these values in dsp_oss_audioinfo() and dsp_oss_engineinfo(). Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45872 --- sys/dev/sound/pcm/sndstat.c | 44 +++++++++++++++++--------------------------- 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index 3be376e1da01..5b770810d19b 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -323,47 +323,37 @@ sndstat_write(struct cdev *i_dev, struct uio *buf, int flag) } static void -sndstat_get_caps(struct snddev_info *d, bool play, uint32_t *min_rate, +sndstat_get_caps(struct snddev_info *d, int dir, uint32_t *min_rate, uint32_t *max_rate, uint32_t *fmts, uint32_t *minchn, uint32_t *maxchn) { struct pcm_channel *c; - int dir; - - dir = play ? PCMDIR_PLAY : PCMDIR_REC; - - if (play && d->pvchancount > 0) { - *min_rate = *max_rate = d->pvchanrate; - *fmts = AFMT_ENCODING(d->pvchanformat); - *minchn = *maxchn = AFMT_CHANNEL(d->pvchanformat); - return; - } else if (!play && d->rvchancount > 0) { - *min_rate = *max_rate = d->rvchanrate; - *fmts = AFMT_ENCODING(d->rvchanformat); - *minchn = *maxchn = AFMT_CHANNEL(d->rvchanformat); - return; - } + struct pcmchan_caps *caps; + int i; *fmts = 0; *min_rate = UINT32_MAX; *max_rate = 0; *minchn = UINT32_MAX; *maxchn = 0; - CHN_FOREACH(c, d, channels.pcm) { - struct pcmchan_caps *caps; - int i; - if (c->direction != dir || (c->flags & CHN_F_VIRTUAL) != 0) + CHN_FOREACH(c, d, channels.pcm) { + if (c->direction != dir) continue; - CHN_LOCK(c); caps = chn_getcaps(c); - *min_rate = min(caps->minspeed, *min_rate); - *max_rate = max(caps->maxspeed, *max_rate); for (i = 0; caps->fmtlist[i]; i++) { *fmts |= AFMT_ENCODING(caps->fmtlist[i]); *minchn = min(AFMT_CHANNEL(caps->fmtlist[i]), *minchn); *maxchn = max(AFMT_CHANNEL(caps->fmtlist[i]), *maxchn); } + if ((c->flags & CHN_F_EXCLUSIVE) || + (pcm_getflags(d->dev) & SD_F_BITPERFECT)) { + *min_rate = min(*min_rate, caps->minspeed); + *max_rate = max(*max_rate, caps->maxspeed); + } else { + *min_rate = min(*min_rate, feeder_rate_min); + *max_rate = max(*max_rate, feeder_rate_max); + } CHN_UNLOCK(c); } if (*min_rate == UINT32_MAX) @@ -422,8 +412,8 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) nvlist_add_number(di, SNDST_DSPS_PCHAN, d->playcount); nvlist_add_number(di, SNDST_DSPS_RCHAN, d->reccount); if (d->playcount > 0) { - sndstat_get_caps(d, true, &minrate, &maxrate, &fmts, &minchn, - &maxchn); + sndstat_get_caps(d, PCMDIR_PLAY, &minrate, &maxrate, &fmts, + &minchn, &maxchn); nvlist_add_number(di, "pminrate", minrate); nvlist_add_number(di, "pmaxrate", maxrate); nvlist_add_number(di, "pfmts", fmts); @@ -435,8 +425,8 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) nvlist_move_nvlist(di, SNDST_DSPS_INFO_PLAY, diinfo); } if (d->reccount > 0) { - sndstat_get_caps(d, false, &minrate, &maxrate, &fmts, &minchn, - &maxchn); + sndstat_get_caps(d, PCMDIR_REC, &minrate, &maxrate, &fmts, + &minchn, &maxchn); nvlist_add_number(di, "rminrate", minrate); nvlist_add_number(di, "rmaxrate", maxrate); nvlist_add_number(di, "rfmts", fmts); From nobody Sat Jul 6 18:24:20 2024 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 4WGf105WVhz5PMHT; Sat, 06 Jul 2024 18:24: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGf102kdfz54ZH; Sat, 6 Jul 2024 18:24:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yx5KRZ/lDSZR4klCEABzwzPNhsdyuSVjnm0Tw+cic6Q=; b=T6iz7NhQ+tSjohr8xYUWoqzf/6bjpY/vex0YS9QFmOVjmFf39dXZvCZWHH7HgPor10z3GR Fv5qGPAB0OlkkXFiNHEUIawwnkQCl7HkQ8zsb/RT7ovlkgBkevzBSYaIeW7vpo0F8sJjOL wqIE5Omq9Tai1xaFXUkuH5qf6N//FXHkDvQEI/93IPYibygeEst6zDceui/uJKcpp/Sf9A LDahLcXhj3u5PYfRW+BHLjy5E0EZNrHuqmjhqjW2e4l4gFPKRc35Zti50DwulUNQVMJlq+ YaphvPDT/aDAj97YOBZXcqY3e/8QR2oO2zj9s8/zlFgC4YibTDr4T1xp6JrqtA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720290260; a=rsa-sha256; cv=none; b=XdkMggbHYWVEqJrDdtAERRSohrw/QI+XcyVGTtpK5N8PVh63F3Xb+8sQ/yP7uRZMNMpH+G DAKwzGBDYUUAcrvt+QOSVA+pyxURImZW9azx3C6EK1VCRWM/9y0qgVoP9GICTiPstvEgNU OQ8xpfeafEw4Z7eR3vxNUFoo28UmeN5dcajUzxpAwVYXyw1RA8T0CMHMGlO6W6w5JUcJQa yx+VqlrSBpGo1FLod7osz3b1KTY16UU5+GCWm92MKYSZQ9snApnqJNhGYVEJDmMURaiyB8 q4Htk4jxbRvs66o4eilWZWgTQF2Wz6OSHoD6WQ0ts9q+yX6ga4/i8PD/Dm67Xg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Yx5KRZ/lDSZR4klCEABzwzPNhsdyuSVjnm0Tw+cic6Q=; b=ZRUbpymxSjr+4EMz/cg/k8JM90QJCXDwtbhNEDANwsuAWCFJaAnoAxX6AcAN6BTsQMzXej OrB24mfx6jYo9LpQjJyxn7ubjWQPqgnb2Xz89EWCDDYNaSLhKz6cDGHCdZiby56+ABqKSf xcFHFzwIIHQApXIb21VRlJ5SaNx495kTp1EeRiQ/Dpyl/TrOKoAQNMokLNZMX3OJ51R1TA u6L7KENgsFCT46NRWNcVw6fvcldG74IEjtTKqdHVlLbQ4A8SujOYP4BZ5iQ969SbjExidt up+EwEs+xDEcVtsW3cQQ0OaXo+m7V5FImK/zhSDE556zEXWCYxAI7dDy87jh/w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WGf102LlTzqwC; Sat, 6 Jul 2024 18:24:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 466IOKer091129; Sat, 6 Jul 2024 18:24:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466IOK3K091126; Sat, 6 Jul 2024 18:24:20 GMT (envelope-from git) Date: Sat, 6 Jul 2024 18:24:20 GMT Message-Id: <202407061824.466IOK3K091126@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: e850bd36dfda - main - sound: Add missing CHN_[UN]LOCKs in sndstat 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e850bd36dfda98608432d2459800627d16119fec Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=e850bd36dfda98608432d2459800627d16119fec commit e850bd36dfda98608432d2459800627d16119fec Author: Christos Margiolis AuthorDate: 2024-07-06 18:23:22 +0000 Commit: Christos Margiolis CommitDate: 2024-07-06 18:23:22 +0000 sound: Add missing CHN_[UN]LOCKs in sndstat In sndstat_build_sound4_nvlist(), if we have INVARIANTS or SND_DIAGNOSTIC enabled, we will hit a lock assertion panic when we call CHN_GETVOLUME(). Also lock the channel in the sndstat_prepare_pcm() loop for good measure. Fixes: bbca3a75bb41 ("sound: Include sound(4) channel information in sndstat nvlist") Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45898 --- sys/dev/sound/pcm/sndstat.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index 5b770810d19b..753531f3694e 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -456,6 +456,8 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) goto done; } + CHN_LOCK(c); + nvlist_add_string(cdi, SNDST_DSPS_SOUND4_CHAN_NAME, c->name); nvlist_add_string(cdi, SNDST_DSPS_SOUND4_CHAN_PARENTCHAN, c->parentchannel != NULL ? c->parentchannel->name : ""); @@ -537,6 +539,8 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) sbuf_printf(&sb, "%s]", (c->direction == PCMDIR_REC) ? "userland" : "hardware"); + CHN_UNLOCK(c); + sbuf_finish(&sb); nvlist_add_string(cdi, SNDST_DSPS_SOUND4_CHAN_FEEDERCHAIN, sbuf_data(&sb)); @@ -1230,6 +1234,8 @@ sndstat_prepare_pcm(struct sbuf *s, device_t dev, int verbose) KASSERT(c->bufhard != NULL && c->bufsoft != NULL, ("hosed pcm channel setup")); + CHN_LOCK(c); + sbuf_printf(s, "\n\t"); sbuf_printf(s, "%s[%s]: ", @@ -1321,6 +1327,8 @@ sndstat_prepare_pcm(struct sbuf *s, device_t dev, int verbose) } sbuf_printf(s, "{%s}", (c->direction == PCMDIR_REC) ? "userland" : "hardware"); + + CHN_UNLOCK(c); } return (0); From nobody Sat Jul 6 18:24:19 2024 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 4WGf0z2sQKz5PMPY; Sat, 06 Jul 2024 18:24: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGf0z1Y1Zz54Jf; Sat, 6 Jul 2024 18:24:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oWxvXHiLeeE/HJHN+HBsbW2RslG+en2ndnyHHscFqps=; b=RjvhUjpK6jqekTVjiT6cqOlLMz8V5BtJsmnlo5zbPmQWW9CEPv+8HRPdvkj+pm+88mpWGB zjUCi+P6VmBGSdSqRZX/0rwPb+Gyhi8/NXAmF13U0cEqEMO2y/v4hYyJYokN8wQv5aFXIO WRDJOn4KO/Hhge5uxS6qISXeaosCTh/MvDLSykeIFFOlBuiQDLWN0omfBLhz9adetz1SHN tD/nKyDIf47Vp0Z+h2IgnFVD4iciAK5gY8NObgCbcMDDLs8rUN9LrLsS1CmP4mrAneJhKC wWdK5e1GUVQFprFSMNQa9BhGG21LtgB5Nd4GDDc/kggToFHJPKNod6azPNVQBQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720290259; a=rsa-sha256; cv=none; b=pEgwcGfgN2O4wK+0JY3TStqO7f83FNjVuh+/o0ShLsQi+Ji4PyDLhFq3Mdsxw2VAG2+Gcr zWeAfMLEgwNQWO3aHUZtjcS07HDP08he/9TrClA+WgO1M58xlvfyI/tXKZ3svN97/4X+Tc hxGz1lHNyxRAWDQwjNVsoAtcinF7B/TguYZdXNiM1K9KbJFzDwxctd79YXmQNX62HzHurn 3rwavLcJaRaRJYnAFOIm7IMY3bhOzBWjX3PaoaSMDrKeAypOjaHThJNH0G4rJdorWf2SEA lXMGkEfjdnEc2oRUPnYSuPZ0RFprjKUhiiarj9wttSScvoSepiaTp7wIlyHUpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720290259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oWxvXHiLeeE/HJHN+HBsbW2RslG+en2ndnyHHscFqps=; b=YcjPfXh4kyKLhH6Hs+Kosi2OkpXPv0HHLY+Rvq+hw7B0uHda5THGf5qMLf27iIXo/IwjM5 oINq/LHk2js6FVIp2I/diDHHhgouP43MTPXIBa+DWPsgTLs/3xFUtQ9Hbl/d8on29TNUei phGr0Yw3gVbZSpybVzaCTSwA+QcGEzSeC7V1mXLxc96kYOFNvUo+iINtdo72b0+rIQ9Agg wsLYezSaBqTMNNv8FAAGz8xyVCtzC2LiyCsPmqjB/TljFauBC0q3iz0zR8def7t56w0o5e wP3Lylv+TEhkgCsCnCdQA4u+UzZthRdvTRz1BjuT3p959ma766ztEdw/qCW/+g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WGf0z16cbzqq0; Sat, 6 Jul 2024 18:24:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 466IOJpm091078; Sat, 6 Jul 2024 18:24:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466IOJwK091075; Sat, 6 Jul 2024 18:24:19 GMT (envelope-from git) Date: Sat, 6 Jul 2024 18:24:19 GMT Message-Id: <202407061824.466IOJwK091075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 1a768ea9db3d - main - sound: Add min_rate and min_channels safety check in SNDCTL_AUDIOINFO 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1a768ea9db3d66941b0dc5340ac028ef548808b8 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=1a768ea9db3d66941b0dc5340ac028ef548808b8 commit 1a768ea9db3d66941b0dc5340ac028ef548808b8 Author: Christos Margiolis AuthorDate: 2024-07-06 18:23:15 +0000 Commit: Christos Margiolis CommitDate: 2024-07-06 18:23:15 +0000 sound: Add min_rate and min_channels safety check in SNDCTL_AUDIOINFO If the channel list is empty, min_rate and min_channels will be INT_MAX. Instead, assign them to 0, like we do in sndstat_get_caps(). Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45876 --- sys/dev/sound/pcm/dsp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 0689dfedb9c2..2b765bc8b115 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -2182,6 +2182,10 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *ai, bool ex) CHN_UNLOCK(ch); } + if (ai->min_rate == INT_MAX) + ai->min_rate = 0; + if (ai->min_channels == INT_MAX) + ai->min_channels = 0; PCM_UNLOCK(d); From nobody Sat Jul 6 19:44:44 2024 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 4WGgnn0DMLz5PnNY; Sat, 06 Jul 2024 19:44: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGgnm6fvDz483k; Sat, 6 Jul 2024 19:44:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720295084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8rnaGh+cYFGKhRz5+GwsZRNGSubj8lOUn5wx4Zk+efU=; b=h/rKaE9c/KRPx64mq/gy9z1JqBvCntK8DMhgnKSl8XItd39K4g/CoQfDPiY1QST7IJUtx+ 5sCOqKDCdHS8E1rngxNH0lm9aYPl9XNIFKxQxjeXppAQ7VuVugaPCUtGTcKHNFKI1JS9TN 8QPbhneFkNB0DUuyGx+lsp30kbda7zR6x65xjSYLtvzqLCn5aALtNuk800TWjzedGDbLam iI4ZXVwULSjWwEVYE3klRg6s7ggqHTuEHLoqkbxaSeTCoPQ9qoQDB0nFmX7QB/cJIJplTH MrdzG0i728Aoj0v8oeSt7LwFANjGVUezho5kYv+EVQ5mA6lXpc3VMMYWQCunWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720295084; a=rsa-sha256; cv=none; b=vt4osGdtfHE1uidX2jcvW/TtrAQQfuD8SYHxp19Bz7bZHDqvYAONHPcHjomng+t3KlToSr 2nRKPOLMA8oQzOF4SZlp0ee5xc8OJrV9tdacnM6iExx8y7JKeycL4JDmJAIBEDHPXJf8MK gOudOyxv8v6FlvRmQG0qLLqmaqVaB10WfU6Md0nBmpGJH5UKVxfJECjBGbofU8vyf8EgPS 6IgLA/E7EtOmsIJQIzACoZVXomi9xshUGz/ERIaqXeH1zsJbFYA/8xFYoASZKer/LBIJmf bkh+I6idadEJ357Mx6cmrMTvZEOP9Ij6K/m9c26moCvSVPkSTEjZt5BgmrRWqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720295084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8rnaGh+cYFGKhRz5+GwsZRNGSubj8lOUn5wx4Zk+efU=; b=XjpdpzcVprrisPoPsXQ5lGUntuL+4nrVPzR68l8jXM8fp5OE+z/xWOAdBtQlLdo5oSh093 QH7BweCUAtVWXEiwLrz7UEt7xTkdbeXpREXCJel0HckFh+zAO7jxiMz2mATiPwBIgA2FC9 k+sQ60K1UfDJgmpT+kM10VPwfBnSygny7WPr3q3SiAS9Gf/UAkml8ALYg33ai2jAJ+cFTh +4+VboAkKWCBCzlmriFwg12LTCqjPYyHTTF93fe506LHkpb+LbdWs5E3ooQmGGfDMFpSPM 6lFwQc5bSylG/+matU8lglhSXbURw0aPS+uF//c98LwZNo2Qa0+0jJhfH2oawQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WGgnm687czsbG; Sat, 6 Jul 2024 19:44:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 466JiigI026413; Sat, 6 Jul 2024 19:44:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466JiiQ3026410; Sat, 6 Jul 2024 19:44:44 GMT (envelope-from git) Date: Sat, 6 Jul 2024 19:44:44 GMT Message-Id: <202407061944.466JiiQ3026410@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: 6677621bad00 - main - cdefs.h: Fallback to printf0 for __printf0like 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 6677621bad00191dfec1b0a20ae1618b92745d9b Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6677621bad00191dfec1b0a20ae1618b92745d9b commit 6677621bad00191dfec1b0a20ae1618b92745d9b Author: Warner Losh AuthorDate: 2024-07-06 19:42:37 +0000 Commit: Warner Losh CommitDate: 2024-07-06 19:45:03 +0000 cdefs.h: Fallback to printf0 for __printf0like For some reason, my tests were fine with this like it was, but CI for gcc12 and gcc13 is complaining. Revert to the old form until that can be worked out why the mismatch. Fixes: 0b82dac337e7 Sponsored by: Netflix --- sys/sys/cdefs.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 6b861b1903f6..a56839d57c7a 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -356,9 +356,12 @@ * Clang has always had printf and printf0 as aliases. gcc 11.0 now follows * clang. So now this is an alias for __printflike, or nothing. In the future * _Nullable or _Nonnull will replace this. + * XXX Except that doesn't work, so for now revert to printf0 for clang and + * the FreeBSD gcc until I can work this out. */ -#if defined(__clang__) || __GNUC_PREREQ__(11, 0) -#define __printf0like(fmtarg, firstvararg) __printflike(fmtarg, firstvararg) +#if defined(__clang__) || (defined(__GNUC__) && defined (__FreeBSD_cc_version)) +#define __printf0like(fmtarg, firstvararg) \ + __attribute__((__format__ (__printf0__, fmtarg, firstvararg))) #else #define __printf0like(fmtarg, firstvararg) #endif From nobody Sat Jul 6 20:42:20 2024 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 4WGj4D360Fz5Pvkb; Sat, 06 Jul 2024 20:42: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGj4D2M3Cz4FCD; Sat, 6 Jul 2024 20:42:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720298540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IRibl8fUmuj7bBE22A3seAbrTJlC7DggreH6s8IJuAI=; b=Mj9f0Xt/o03FpXBSXIW6ySCYeiO3wBDkZI1hV5UT7PwpxW2oCOEXTmMWR9Hsy3jAxl7LAy kcpyG7NbZ28gf8rbf8EcfddCx8+6hdUScz1z2D1xeoZCbRsLIJvnnEzpUp4QfkCrHYh2lL 9kIgugSU+cBhf3/uVXeKrrusWgsoQj69ZyQ6YnEOCLlOH0C/k7tpxpwhLp/AwHeQsDaN8i W4yu5ocd3kz4OCQlMHHzf5D/GJAg/OMttY42n0DtYGNFnIO3Ud3WcmNBEQZcWlqlz5/MY+ Ii+XbQT9Lx7Y2n11EYKa0SeTnqEmFfUy6+sD+Fx/K1hRQu3WpFCgwrfNRCT/pg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720298540; a=rsa-sha256; cv=none; b=OgVL/Asc1T+FBI3jCwWlY1GwDfCVpUaUi1dDNupkRbYSMNeck8pHRhwn5ZQ2kmXsLo8PlG XKRFgslAMTpffwGGCPbFUJdSTiJFJOOwRdhXOrzvPFaqsnKgPK7RfY329tnaPfxG66EhxN k72kopK8NOi0vJlBlHQEO/LqRqbkTXPUDudOqKqHA6RoUtqaT08MBQaM+JggcYvecnhDoc Py5873f4P8jZtrP2hmd4JFRAs6j9uZ6PVh9bwyrKt/47jMqDyqQ71JwkLqPt7I6xXLzW51 CzCQEYmmoe97LeUyPBfLgJs18UOjBvpIixSGgsIBXx7ke33F8AQmtXhzxwpjTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720298540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IRibl8fUmuj7bBE22A3seAbrTJlC7DggreH6s8IJuAI=; b=qW61lvQ4OcnZz+fkXG1KGxWJCFsv2ou5dX4Kf1+YSM1zYlNqkfeHxhSX6RBxEI3a7Y7tJ0 SiEGhNOkASvwlKXjH4Mum5jiFF1y7TlXmSQ5czHI0pfJTfM+JqJHzyRrb9XUS8shU7oxue FzA0u9KRDyrLi0L/BUcCaQNAHPp/iQGptaO8NY6StlORdJSYrBBrKPU7Nn4CHzYuq/EMWl N6Sw70WQz2hl+GPC2+MQYi+7sSOMgdk1A6QiMTmRCj4lRoWtSgtwMK30UQEh7VBf1eMoKb RvwtEDWqFovCIjVyi8PgQCZDUDlarNZ6pfQWyzxzmoNHK6I60sI2otxCdOq4Kg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WGj4D1fJLzvkc; Sat, 6 Jul 2024 20:42:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 466KgKkj027164; Sat, 6 Jul 2024 20:42:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466KgKlC027161; Sat, 6 Jul 2024 20:42:20 GMT (envelope-from git) Date: Sat, 6 Jul 2024 20:42:20 GMT Message-Id: <202407062042.466KgKlC027161@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: d8a99eaa1f06 - main - rpcbind: Add option to disable local host binding 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: d8a99eaa1f06bc3b3c017dce3e6ddf6b1fa37bcb Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=d8a99eaa1f06bc3b3c017dce3e6ddf6b1fa37bcb commit d8a99eaa1f06bc3b3c017dce3e6ddf6b1fa37bcb Author: Joyu Liao AuthorDate: 2024-07-06 20:39:07 +0000 Commit: Rick Macklem CommitDate: 2024-07-06 20:39:07 +0000 rpcbind: Add option to disable local host binding In our products, we need those options to support our features. Add daemon mode option for mountd, nfsd. Add skip local host binding option for rpcd. Add skip local host binding option for mountd. Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D45118 --- usr.sbin/rpcbind/rpcbind.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/usr.sbin/rpcbind/rpcbind.c b/usr.sbin/rpcbind/rpcbind.c index de05330d0ca5..44adae366bed 100644 --- a/usr.sbin/rpcbind/rpcbind.c +++ b/usr.sbin/rpcbind/rpcbind.c @@ -88,6 +88,7 @@ int libwrap = 0; #endif int nofork = 0; int verboselog = 0; +int nobind_localhost = 0; static char **hosts = NULL; static struct sockaddr **bound_sa; @@ -342,9 +343,9 @@ init_transport(struct netconfig *nconf) if (nhostsbak == 1) hosts[0] = "*"; else { - if (hints.ai_family == AF_INET) { + if (hints.ai_family == AF_INET && nobind_localhost == 0) { hosts[nhostsbak - 1] = "127.0.0.1"; - } else if (hints.ai_family == AF_INET6) { + } else if (hints.ai_family == AF_INET6 && nobind_localhost == 0) { hosts[nhostsbak - 1] = "::1"; } else return 1; @@ -802,7 +803,7 @@ parseargs(int argc, char *argv[]) #else #define WRAPOP "" #endif - while ((c = getopt(argc, argv, "6adh:iLlNs" WRAPOP WSOP)) != -1) { + while ((c = getopt(argc, argv, "6adh:IiLlNs" WRAPOP WSOP)) != -1) { switch (c) { case '6': ipv6_only = 1; @@ -823,6 +824,9 @@ parseargs(int argc, char *argv[]) if (hosts[nhosts - 1] == NULL) errx(1, "Out of memory"); break; + case 'I': + nobind_localhost = 1; + break; case 'i': insecure = 1; break; @@ -850,7 +854,7 @@ parseargs(int argc, char *argv[]) #endif default: /* error */ fprintf(stderr, - "usage: rpcbind [-6adiLls%s%s] [-h bindip]\n", + "usage: rpcbind [-6adIiLls%s%s] [-h bindip]\n", WRAPOP, WSOP); exit (1); } From nobody Sat Jul 6 20:49:34 2024 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 4WGjDb0SNKz5PwW0; Sat, 06 Jul 2024 20:49:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGjDZ6yw6z4G9v; Sat, 6 Jul 2024 20:49:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720298975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NrLuodkjIwdDvG5g00oWfeghvczJg7pgVTIxOyqoHDk=; b=tZvVDb+pWSqPKlNmhIrcsOl5duAyFfl6gggsrheFgnwxxgXl4bAakJE1VVFivTk+dQOWQ0 EUVRPYimSx/JksXqvCqKMJEV3jc6LiuiIR3Hvz3bXT2jrME23irnQFbvBc6feAfdP59yzg Qj4D3E8/GO2BRW5LbXnCyd3FYFs8HgyCrcncxgjhnQeY9qFUVaEuK8+ES/KfJtdK51Sp7W IOM7UuN+VWyu1cFzYwoK8IoACFQzYAIj9+8MOfYxtxQjSGoErAT3iJPFWvKzPkyTkWqib6 aqWoN00YV/u1pPcuRoUQpb+ZlS+mDyhdELOk5K0sT1rozn9fEl71drswY7ostg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720298975; a=rsa-sha256; cv=none; b=sxL3NhHZME5cFQ3qIGyq9+bqhb8oaPljouYhPn7BKXqxmsS8HmgumxsxaEFr/J0svCLrCr Kj5uTJlob/lztInHhSDsgokfRcErd4qv5TZ/sG+FNNC+rSWj6O8JCOH1SMRlLfa7QPPPBj yc1gFX3DQ16B7/xn40RhP1dkG7SVgLl8lCngp0IS/gWEWb26CpLkpa7D6KCV6NH6E129l6 8nVgSujRcGPyl6NkXOsRPPt5Erw9PRdbV3Y8+XGYMQ5wk/w+mNZbCl/AnvMnscv20jaYwE Vw2fznss/uYJ1B13r8/Zkk7x6ewIMdOFUOgRnuOHmqnTJmjZfYbZVdAmRSEMeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720298975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NrLuodkjIwdDvG5g00oWfeghvczJg7pgVTIxOyqoHDk=; b=uVJLMO9KVSXbg6am1+kGsCrN+KqHuUbuqRudKze7eFhW2188Nn4QoWOzIBDKZk9QVYjwSv 2IEyE717VEyCyisRlu0blRkJRfjfxfxYCaps4WRY3xgT5myWE4Bfyj2EWBoACXrt6BPNIK 6JdfqeeaTyrAdKOG2Wr9N1wi4utlhi0w8C68n6pTyVgEcDXtaub3hR7XW8IUvSd5eHDbrX QPHyqHShK4K8rZngnqdtTjADqRpXxM/8ZTEBVNVSl+rghxhU3tmQHloaWICuSH1wLdRGma IMs5yahTwx80ztatjaaPExAClZwTnZwLHBidgPpIqcFQCRO/MqJm/HakMdq26w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WGjDZ6XkWzvkl; Sat, 6 Jul 2024 20:49:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 466KnYtl029220; Sat, 6 Jul 2024 20:49:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 466KnYlQ029217; Sat, 6 Jul 2024 20:49:34 GMT (envelope-from git) Date: Sat, 6 Jul 2024 20:49:34 GMT Message-Id: <202407062049.466KnYlQ029217@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: fb32ba6aa44d - main - amd64/arm64: Eliminate unnecessary demotions in pmap_protect() 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fb32ba6aa44dc86e70ad06b44f93a9709e78f3d1 Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=fb32ba6aa44dc86e70ad06b44f93a9709e78f3d1 commit fb32ba6aa44dc86e70ad06b44f93a9709e78f3d1 Author: Alan Cox AuthorDate: 2024-07-05 18:20:01 +0000 Commit: Alan Cox CommitDate: 2024-07-06 20:48:10 +0000 amd64/arm64: Eliminate unnecessary demotions in pmap_protect() In pmap_protect(), when the mapping isn't changing, we don't need to perform a superpage demotion, even though the requested change doesn't cover the entire superpage. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45886 --- sys/amd64/amd64/pmap.c | 21 +++++++++++++++++---- sys/arm64/arm64/pmap.c | 3 ++- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 57943e815b5b..2bcf671be243 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -6796,8 +6796,7 @@ retry_pdpe: */ if ((ptpaddr & PG_PS) != 0) { /* - * Are we protecting the entire large page? If not, - * demote the mapping and fall through. + * Are we protecting the entire large page? */ if (sva + NBPDR == va_next && eva >= va_next) { /* @@ -6807,9 +6806,23 @@ retry_pdpe: if (pmap_protect_pde(pmap, pde, sva, prot)) anychanged = true; continue; - } else if (!pmap_demote_pde(pmap, pde, sva)) { + } + + /* + * Does the large page mapping need to change? If so, + * demote it and fall through. + */ + pbits = ptpaddr; + if ((prot & VM_PROT_WRITE) == 0) + pbits &= ~(PG_RW | PG_M); + if ((prot & VM_PROT_EXECUTE) == 0) + pbits |= pg_nx; + if (ptpaddr == pbits || !pmap_demote_pde(pmap, pde, + sva)) { /* - * The large page mapping was destroyed. + * Either the large page mapping doesn't need + * to change, or it was destroyed during + * demotion. */ continue; } diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index a9cb8c7fe468..29552f722aa4 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -4373,7 +4373,8 @@ pmap_mask_set_locked(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, pt_entry_t m if (sva + L2_SIZE == va_next && eva >= va_next) { pmap_protect_l2(pmap, l2, sva, mask, nbits); continue; - } else if (pmap_demote_l2(pmap, l2, sva) == NULL) + } else if ((pmap_load(l2) & mask) == nbits || + pmap_demote_l2(pmap, l2, sva) == NULL) continue; } KASSERT((pmap_load(l2) & ATTR_DESCR_MASK) == L2_TABLE, From nobody Sat Jul 6 21:56:15 2024 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 4WGkjY24x2z5Q3sx; Sat, 06 Jul 2024 21:56: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WGkjY1CDTz4MJZ; Sat, 6 Jul 2024 21:56:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720302977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0cNBNMkcNRZaZgY9aNFdPN5Ylh1GLaAAFC0k+cb8yao=; b=uURUKF8PJ4wK1m9H/jNwi1WY9DqB07KVZlZa7k+IHVttQjx3/4P2NxzJgAOeLlU8uuQecW k5coCk3P3/3J+Dt+RfWPCeYSMPescIrYJBMuIQnQ5B0KXw/SALmWeARmP2jGKZYNaZA9Gh QMYpW1x6kerF+vYxqqRRhUVh7AjWSCJFhXdTMFsO0BsL7CDpdTVQcy7CTHlI8HjAi/tl+3 Q6oPJzZg+y27/mz2282DU5D9BJDZFe6MFwOUM9LVBkWuwx4GHe2RHtjZZKEedRsOM/1CAn cQiEn5ASUnODMPdPtOpm+aZKvccRVwz1yXvc+5TRLD+duz8Jw5dykNuPGcPOcA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720302977; a=rsa-sha256; cv=none; b=j+FbEjWi60ehHwlmGhQsDL7xiUgsQKOOCi+WtxZcZr2GM/DRr/OXUzHrgfecSgUxSjQ068 UU8ZdL1nDpNKS3u0o+4tzk9P9cGXLJgmFbt+C5sehj0d48LA3y6coMlKIiuzr4leVDA/0i 09MewDBB9A/iG0gSY3VGdq5gDXRbNLlwF9oAN9tEQ3lCsLJDgX4Ifl9hQxkNWghGKNu72O lwnW7Xrb/mRcmy8w5h7LKXgfy/fCQmTsSJrSlzej1rCSWJDJATS3rfgoWIVhUfXwP+bzVd IGWaB2JtvEknC5d9+4mNMqfEknoAr343BiFx0LqxX7LUF5YucJEgsbjpNeLfCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720302977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0cNBNMkcNRZaZgY9aNFdPN5Ylh1GLaAAFC0k+cb8yao=; b=OPjwv/MmZsOOG2esA6HcsQWQdlgmrbla6FfJcWyzEz3a3W22rxLIik7zy7sXEUOuw/kAcv 7g1Z50Vfpjue2BKpyuTI3gSkCiZw9uNDfkH/KoPhQ1qH3j5cbe18X/7JZJhwZsnlT38t/B 6sd5yPjb0KTneMjpizIyt0UB5NM5lw833cXxGZgAtkTSwutSFyk+VF2JbIfzA0P5ECEzcE 8bc+YrrIXHb+vAXWyo0ZoGVxL5VN01mMq6s9h3MfbUH6xqEmKpIX1lsWVHOANYLnNH0zQU 3Xy8k9jdApiUPNhEKgK+Bl04a7x3AjNYzYeu71r1I21aoeue1nXQNqMgGDI54Q== Received: from [IPV6:2601:5c0:4200:b830:7973:4abc:b518:de1] (unknown [IPv6:2601:5c0:4200:b830:7973:4abc:b518:de1]) (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 did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WGkjX6PMzz11dT; Sat, 6 Jul 2024 21:56:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Sat, 6 Jul 2024 17:56:15 -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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 6677621bad00 - main - cdefs.h: Fallback to printf0 for __printf0like Content-Language: en-US To: Warner Losh , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202407061944.466JiiQ3026410@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202407061944.466JiiQ3026410@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/6/24 15:44, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=6677621bad00191dfec1b0a20ae1618b92745d9b > > commit 6677621bad00191dfec1b0a20ae1618b92745d9b > Author: Warner Losh > AuthorDate: 2024-07-06 19:42:37 +0000 > Commit: Warner Losh > CommitDate: 2024-07-06 19:45:03 +0000 > > cdefs.h: Fallback to printf0 for __printf0like > > For some reason, my tests were fine with this like it was, but CI for > gcc12 and gcc13 is complaining. Revert to the old form until that can be > worked out why the mismatch. > > Fixes: 0b82dac337e7 > Sponsored by: Netflix > --- > sys/sys/cdefs.h | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h > index 6b861b1903f6..a56839d57c7a 100644 > --- a/sys/sys/cdefs.h > +++ b/sys/sys/cdefs.h > @@ -356,9 +356,12 @@ > * Clang has always had printf and printf0 as aliases. gcc 11.0 now follows > * clang. So now this is an alias for __printflike, or nothing. In the future > * _Nullable or _Nonnull will replace this. > + * XXX Except that doesn't work, so for now revert to printf0 for clang and > + * the FreeBSD gcc until I can work this out. > */ > -#if defined(__clang__) || __GNUC_PREREQ__(11, 0) > -#define __printf0like(fmtarg, firstvararg) __printflike(fmtarg, firstvararg) > +#if defined(__clang__) || (defined(__GNUC__) && defined (__FreeBSD_cc_version)) > +#define __printf0like(fmtarg, firstvararg) \ > + __attribute__((__format__ (__printf0__, fmtarg, firstvararg))) > #else > #define __printf0like(fmtarg, firstvararg) > #endif It's because my patch for devel/freebsd-gcc{12,13} is kind of wrong. I had a mismerge when updating the printf0 patch from gcc9 to gcc12 that ended up re-adding the warn on NULL. I need to update the ports to remove that part of the patch. I will probably leave printf0 working for now in the ports just as an alias for regular printf to give us some transition time. -- John Baldwin From nobody Sun Jul 7 11:41:44 2024 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 4WH5202Tydz5PDpL; Sun, 07 Jul 2024 11:41: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WH52023VQz4Wmm; Sun, 7 Jul 2024 11:41:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720352504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MvcH2+FtdLtzB9SJ/w39BQhYYRNSZA3hK1rGOQmHLZI=; b=fW9DHy0IF298BYjaRy14ZGItPgz09EPCyvUQLT4VxdiReiCYBkb1XsZejPacc/LK8rYW1b oLBfkwdRfys3oNRgGQzBxVeBsxHm3XVlml512zwicXw9603+IMshNQBzVp4mC7NjCS7RfG zwHL9GLhBGLTLtb+9QhrPm2uwC8Pt1Icv9j1PFp4fzdYjnJkNkT6tbnfNxPm2Tyt2r2kwS OBTYKLaELGK+Fm/H24JOXYRWCPj5UH6HN6iSoihnWSdxqhRn/b+W04UU19cun9MyFmCpLK g1USm4jniLpo44lvZULhfP8wfAwM699A8gKEDYgjgfEtubEx0GdhNug+XZGebQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720352504; a=rsa-sha256; cv=none; b=pySIiRUd0Cs52KQ9TgDoastn8am5yCrW48eRC0wKuVjwZQbDpTvumcK581PzOCikb1GWKC XjcC38gcAuNVbsUcXaJUR4TQ/TD7yWLJ/lAd4texHjER851/a74wzUKrglVdillUKlI5W4 3BzvTgyojJ2v44UiNUEK4Q2/oJUbqgJJQ9bYP/PNam5z4RviSx++iVE/7Nd1YhzzUHrX7C UrYC/PJhT0Q7YqQvuoKIU/9oUbGHTsaj0CjJ3ruimFLBwQ4qAlKvq5fHnGooeaVAk+vulg fpVBYU+j51eNGhj8YC0J3uz4hmG0HS9SldKjsK9EhxSzo0TClRxSuRPmfqjdNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720352504; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MvcH2+FtdLtzB9SJ/w39BQhYYRNSZA3hK1rGOQmHLZI=; b=XlBkgIwg52fgubv0xfm8tdBpon1pH2HbO8+qAw2unjnMFMyiFFlRtACFOV20fpYcAB7Awf dzTqNq1AfX8r0Nfia6Q/HW9Ub9ISsKS7cxgh54edR1EwO5jiE8H+tLj6Kem67jE4oluwqa Owi2moK/GeTsUj9uFKPK6eaXVgnLydKKDF4CAgCgvsMmKf0fn/GdxkNWsUK8pjLs9yiV0Y VyetYFl06GByH0oTtqY4tlBYVPeCfaZd4r51yITPSp/2Vq1EVEDJiNHdeDUbtviii3n+GV kFjobsCKdyuAJxwQAunA5AXJfdIziPVakRLjjYLgjq855EaZ/Uod21vZ6L8FnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WH5201ggdz1Llx; Sun, 7 Jul 2024 11:41:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 467Bfio6052338; Sun, 7 Jul 2024 11:41:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 467BfiP5052335; Sun, 7 Jul 2024 11:41:44 GMT (envelope-from git) Date: Sun, 7 Jul 2024 11:41:44 GMT Message-Id: <202407071141.467BfiP5052335@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: 814bf1fddd27 - main - virtio_p9fs: fix panic on qemu/kvm 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 814bf1fddd27aea69740f9e7426302354285cad4 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=814bf1fddd27aea69740f9e7426302354285cad4 commit 814bf1fddd27aea69740f9e7426302354285cad4 Author: Danilo Egea Gondolfo AuthorDate: 2024-07-06 16:51:51 +0000 Commit: Warner Losh CommitDate: 2024-07-07 11:39:27 +0000 virtio_p9fs: fix panic on qemu/kvm When the module is loaded on a system running on qemu/kvm the "modern" virtio infrastructure is used and virtio_read_device_config() will end up calling vtpci_modern_read_dev_config(). This function cannot read values of arbitrary sizes and will panic if the p9fs mount tag size is not supported by it. Use virtio_read_device_config_array() instead. It was tested on both bhyve and qemu/kvm. PR: 280098 Co-authored-by: Mark Peek Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1320 --- sys/dev/virtio/p9fs/virtio_p9fs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/virtio/p9fs/virtio_p9fs.c b/sys/dev/virtio/p9fs/virtio_p9fs.c index aa174d3bd5ba..3600e0ea09c9 100644 --- a/sys/dev/virtio/p9fs/virtio_p9fs.c +++ b/sys/dev/virtio/p9fs/virtio_p9fs.c @@ -352,9 +352,9 @@ vt9p_attach(device_t dev) mount_tag = malloc(mount_tag_len + 1, M_P9FS_MNTTAG, M_WAITOK | M_ZERO); - virtio_read_device_config(dev, + virtio_read_device_config_array(dev, offsetof(struct virtio_9pnet_config, mount_tag), - mount_tag, mount_tag_len); + mount_tag, 1, mount_tag_len); device_printf(dev, "Mount tag: %s\n", mount_tag); From nobody Sun Jul 7 11:43:21 2024 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 4WH53s36FBz5PDq1; Sun, 07 Jul 2024 11:43: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WH53s2RZ3z4XfQ; Sun, 7 Jul 2024 11:43:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720352601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LqdCZ9fifM3zp+rSPfqaceg0ofm++nuwuhpt1emnH1M=; b=DsAM12GYfvS0e4uBIgx8X0X3s3U/PjgTSCxaZuLqGQ+hLRlICYviooL2GKi5kr36FMINcW Dz7BAGtWTwA1wfj/prEFBAV88qeK7M4XWrWbUqRXtCRw8ZdakrQrb9EgUxvMgwzGXXSzNw J9jFak9l8l3slVTFksKIu49OeEeAjQTzSG9O8SKc0e7GfwvIOAIUdysLP9fedZHUHXL+Ug mKZWoVPHSK8vc1xlnQLbrQ69bXz/p0ab6MHh/ng9a+yAGhcR66Vrx9bCfVcavWFWDTCAqo peb0HnSKIaNAN6k/elwh5eiKc5GNliorarsnV/CjA2qhkTLBZ+m3E8PS39GjQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720352601; a=rsa-sha256; cv=none; b=mFCKTi+CnIPYYROTVoJu2FdceaYTuIM0N/nj2NqQJd2d8Rsc0cJe+3V2CEqqkdZrwAWaNV J/1J5rZPa+rN9KUm6+hrSxZ5lr6038xG1KAv7Fe/rBiSJNB551ZL0MTXFl3tFDUer7M8+0 dfiL8hThToWsgpnKagmUGznram4q41x4QUPdDno6R8EcvOVR8U2VRcOPkRs6JNUtClGuih c1JbNry5vpRvAd+jJKg3sp5PHYKCw9AWY8Ml6jCXjUXtbx4fMomwahxnjLeOrIUEoSjZOS iz0EQEw0qHQatXBAr2lYZL+9veJQzE4YYEQMCQwLa33a+Fs0Ysj75kJB8JM8VA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720352601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LqdCZ9fifM3zp+rSPfqaceg0ofm++nuwuhpt1emnH1M=; b=Uagy7MYjtU5eZ0KG/zqsfxzc3Axw2qxvCYRylPQtViB67cPvACBEcn/O1wta1alK+lfEyT DQVC/S/abYlFxy7+x4Qgss3rYE/n0ZQfeAQI2KPvGsYZEglTPvHu4Pt2oGLnDnJS6dJzm4 yUoN42cuwcXCFjgmYkvAvYtIAh5fNeTZnip9Fk1i7qYwWn1G5ADrdBXhIUYJyORJSpFiwW L/RNGgt4V6Ip/Gcn+EHFALrku6eIE6Ev6GjINDimEiOkRZDiDgJleLGXo9H86RLjJgqyUZ cpg6X/zPmY0/mLt4d2fy/dmK27lGlQWi/+V5pefS6c+xlCHbMIXNXYxE3c0ESQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WH53s22xBz1LV5; Sun, 7 Jul 2024 11:43:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 467BhLlr055373; Sun, 7 Jul 2024 11:43:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 467BhL7r055370; Sun, 7 Jul 2024 11:43:21 GMT (envelope-from git) Date: Sun, 7 Jul 2024 11:43:21 GMT Message-Id: <202407071143.467BhL7r055370@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: 4c6cf054c959 - main - Stop forcing -g in mpi3mr module because it breaks non-debug install. 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 4c6cf054c9599a9a520edde8dc19956e5a4e826b Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4c6cf054c9599a9a520edde8dc19956e5a4e826b commit 4c6cf054c9599a9a520edde8dc19956e5a4e826b Author: Eric Melville AuthorDate: 2024-07-04 23:56:45 +0000 Commit: Warner Losh CommitDate: 2024-07-07 11:43:29 +0000 Stop forcing -g in mpi3mr module because it breaks non-debug install. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1314 --- sys/modules/mpi3mr/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/modules/mpi3mr/Makefile b/sys/modules/mpi3mr/Makefile index 39aa2e3f0ddd..1c44ed920d1b 100644 --- a/sys/modules/mpi3mr/Makefile +++ b/sys/modules/mpi3mr/Makefile @@ -7,7 +7,6 @@ SRCS+= opt_cam.h SRCS+= device_if.h bus_if.h pci_if.h CFLAGS+= -I${SRCTOP}/sys/compat/linuxkpi/common/include -DEBUG_FLAGS= -g .include From nobody Sun Jul 7 11:45:50 2024 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 4WH56l0wqqz5PFC0; Sun, 07 Jul 2024 11:45: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WH56l0Nspz4XsL; Sun, 7 Jul 2024 11:45:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720352751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1J/Mc6RtuaCvmUK5nXrEmEgHIveJMAX+fMXfeB0dsIk=; b=UMJVGxjhTl8ceaFk+VXlKWl6/KuUv8OCHlgCQlM5+3x8E4AuEeBzEzdejsR/qzwS+MhKNj sQtHR5ALrkPeS4cmY4Sw/OmCOV21VxJw3Krh7GVuN1QUxGbBXpiVyX20OIt9Xa0NgWf4fj rmnlie3JPLp1vGW77gxGG0Aqs19WWiauwRlI5EmPkOlBIAO17ydM86Z7aqZtIySEo+354r zB+g07GUMcLhPeoxCBtorBrV/edBF+eWDdViwsdmfktiI6neGX8Dde+LPXqc6+T70Nd5GP BfcB7sbbzjjSWg4ErYkxmiBO6DxXJHrfON3cMRdrptZeC0CCvwyU17dT9j4q0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720352751; a=rsa-sha256; cv=none; b=W9b8UO9JzzHF/FCeAUMUicK4FdPbanH4HSNZFwF6tgT56Gqx3J6WGQ4HOljm9SLo15ft7G LqZfooT3+aQeg5ZVfuMlfiTgt7Fq5uXfS7lnt5GHgpx4OXDL6jfovnR0pF3mCrudcj1sE9 dxWiJbTV82zgRswDsbctyB1QPQDnyw0Ahyovwxgc2yFmzzf7Gl3v+S2SnS+pseEn6cvUhB yX+jgL1gA9Pi/ef+c08iuG3ay3VLM7IRWh8eNg0KcwXXtsI75xSB1tQfM1wbMpyKMqJX37 C/XJy4YxtA76361Nwu91NKBtg7h2LAKUQSoOUZ6KfPZyA8T51SuNKFA0d135vw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720352751; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1J/Mc6RtuaCvmUK5nXrEmEgHIveJMAX+fMXfeB0dsIk=; b=RjcdE0AhplhkwrxRw/ZsP8lfUeAIoXa1hrLppj8JRZrl9pY0Ol5IX7qKz0jZBZwaM21Ua5 gPKJSzel/3eOc2FEmGYltJk3U0loAxOqRjnfVndpxvF8Rve914mkwjLhbSBHnX4Dcz7Luq g5TePeYXGqWJpfip63IWf58rsP6d+T2CbUDZcIsSErWwDfx08tFz+kzW6AzWx8Nrd6OPux fygeTg8KWXU7c7q52MbG0OMUWiay21Mf3rRLvXFpaDlDkfNDcjaDQ+32FjyQxsBvWnVghs l3TEC2ki5bwoiQfAGmxuvPqeS3JmmWib3wXuToIOMUGLxS4nf1DdE54iPyd2uQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WH56k704jz1Lpf; Sun, 7 Jul 2024 11:45:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 467BjoCM055829; Sun, 7 Jul 2024 11:45:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 467Bjolv055826; Sun, 7 Jul 2024 11:45:50 GMT (envelope-from git) Date: Sun, 7 Jul 2024 11:45:50 GMT Message-Id: <202407071145.467Bjolv055826@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: 12545b85834f - main - fwget: add needed firmware for AMD Raphael GPUs 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 12545b85834f32e0fdb831489503c3c4f6db715a Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=12545b85834f32e0fdb831489503c3c4f6db715a commit 12545b85834f32e0fdb831489503c3c4f6db715a Author: Danilo Egea Gondolfo AuthorDate: 2024-06-30 17:56:22 +0000 Commit: Warner Losh CommitDate: 2024-07-07 11:45:37 +0000 fwget: add needed firmware for AMD Raphael GPUs This GPU is found in Ryzen 7000 series CPUs. For future reference, the list of firmware versions for amdgpu drivers can be found in [1]. [1] - https://docs.kernel.org/gpu/amdgpu/driver-misc.html Reviewed by: imp, Christos Longros Pull Request: https://github.com/freebsd/freebsd-src/pull/1308 --- usr.sbin/fwget/pci/pci_video_amd | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/usr.sbin/fwget/pci/pci_video_amd b/usr.sbin/fwget/pci/pci_video_amd index 5f89b12dce7c..7ad41be12d57 100644 --- a/usr.sbin/fwget/pci/pci_video_amd +++ b/usr.sbin/fwget/pci/pci_video_amd @@ -26,6 +26,9 @@ pci_video_amd() { + # A table listing the required firmware versions for each GPU series + # is available at https://docs.kernel.org/gpu/amdgpu/driver-misc.html + case "$1" in 0x678*|0x679*) addpkg "gpu-firmware-amd-kmod-tahiti" @@ -150,5 +153,12 @@ pci_video_amd() addpkg "gpu-firmware-amd-kmod-sdma-6-0-1" addpkg "gpu-firmware-amd-kmod-vcn-4-0-2" ;; + 0x164e) + addpkg "gpu-firmware-amd-kmod-gc-10-3-6" + addpkg "gpu-firmware-amd-kmod-psp-13-0-5" + addpkg "gpu-firmware-amd-kmod-dcn-3-1-5" + addpkg "gpu-firmware-amd-kmod-sdma-5-2-6" + addpkg "gpu-firmware-amd-kmod-vcn-3-1-2" + ;; esac } From nobody Sun Jul 7 11:47:02 2024 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 4WH5865ZbJz5PF2g; Sun, 07 Jul 2024 11:47:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WH5863grLz4Y2y; Sun, 7 Jul 2024 11:47:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720352822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=29Rv6p9bL6zsB4TuC/P0YcRd1P0nw+9rSkePi8XZBkc=; b=v0dJXfO54H/FPQuuvW9iZhq69LNOBOuSEa0Ov0dHqRVtIgKZxiRO+JRjMT0PLSqREjhb0d QaEfYGQ8ThVfIbg70r4ZoOBdygba/aICsgaZhA2UaBdB8pnwuNR4gwGsTbcyueFG21XYjC HMkgkNE5Yh/aTLGgL4V2DNsq/keUuVzwzv2mD+LKp49NID+TBfZ4zk0lA8oHcGLcG/gZA1 q9f9YA4e9F0IbRhNB8zdGxZUu9IYDCpk130JvY+UBMssio1zZJw7IZ+hXo82yzvI2j3ogy F12+8iPvzX9fTpfwpG+/dGN3xkeAVYC8XWIyRLwoH1JjepeH3bS9khw0WXfNqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720352822; a=rsa-sha256; cv=none; b=I9mJYH6+2oJtE9zRuj1p5q8kllHJWV5eq/0w0oBHW1GJhwhLHMSF+NgEQjHusOjPB4LyC9 iDPzTZlq2tTcZafMb3oD/DneclEB3G9of1Se3MmdywmlJEqMTSu0B0+V8rEu/crJUWzEJV yikPW4l8AXC2alGjk1o8mAZBPqZitse76oaJz1up07IU1pSmqxLxCQZ6kJixNPa2y6km/V Y0RLvhcQj99GmpFROx5v+jngNHxgGO27Z3OZKP/Fv7g07Jtsrm5uDpInXjkVd0sTo/a9rc mQpSLzrEP1l4MpXOyD//qCy4Uh/wp3+jpk/o1y+dh9dv1kCvbTIUWDJyDQBmHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720352822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=29Rv6p9bL6zsB4TuC/P0YcRd1P0nw+9rSkePi8XZBkc=; b=OzWtBZsPa7UqPABF+q5nu14dtOOq5buAYIFmyzr6bkkORFW9aV7ipCerHkWkkI7070u3Se 071EDPmkXcdPaWxOqvPkKd8KzY1aLNt7HndUEl3nc7YnPekcGYn4e82w9d11EilI+MPwBQ pxyUXcGoeCJshq65H31tnS1ufLj35yfeeCPcSxxf5bbgDORYmw7qRmZ5EvLy7wB3k1W6lT gPfCLFbhTKnqa670U5p482NlOGx1wDVWbgMPl7thUWIDpw+wi52pBiUGw2FiOpfKfQ+uCI AWD0zK9UrGd815ueh4omVgTbHf4D5TxUerZvZTWREGVga6kg/OlFc4oOlNJqUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WH5863FtXz1M09; Sun, 7 Jul 2024 11:47:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 467Bl26i056180; Sun, 7 Jul 2024 11:47:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 467Bl2FE056177; Sun, 7 Jul 2024 11:47:02 GMT (envelope-from git) Date: Sun, 7 Jul 2024 11:47:02 GMT Message-Id: <202407071147.467Bl2FE056177@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: 7220a45bccbd - main - freebsd-update: rsautl is deprecated, use pkeyutl 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 7220a45bccbd0496b1cf304f236d3f9d2e15e7d3 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7220a45bccbd0496b1cf304f236d3f9d2e15e7d3 commit 7220a45bccbd0496b1cf304f236d3f9d2e15e7d3 Author: Jose Luis Duran AuthorDate: 2024-06-24 07:08:01 +0000 Commit: Warner Losh CommitDate: 2024-07-07 11:46:58 +0000 freebsd-update: rsautl is deprecated, use pkeyutl The command openssl-rsautl(1) has been deprecated in OpenSSL 3.0. The openssl-pkeyutl(1) command should be used instead. Signed-off-by: Jose Luis Duran Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1309 --- usr.sbin/freebsd-update/freebsd-update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index 1456601edf26..459d54db0c57 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -1307,7 +1307,7 @@ fetch_tag () { return 1 fi - openssl rsautl -pubin -inkey pub.ssl -verify \ + openssl pkeyutl -pubin -inkey pub.ssl -verifyrecover \ < latest.ssl > tag.new 2>${QUIETREDIR} || true rm latest.ssl From nobody Sun Jul 7 11:52:23 2024 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 4WH5GJ01tsz5PFVC; Sun, 07 Jul 2024 11:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WH5GH6cxbz4YpK; Sun, 7 Jul 2024 11:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720353143; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hVp5AoVY9Z1tKvkc2o5elvnlvah8e+JmqOfXajSBvxY=; b=aPoKS5LqykprzM54BVEaHZVDgWQbgeAgKpp6iOz0x64x+MLGfZOKHvCg0hMD4FsLL57sMa jsBzDZ9s8Z04hqosczwvarlBzhN6xySvAumjpTjNSPmricmoPrvhwDhg4LJ9E4aBVmzpNI zCs/Q0Ixa0+hpWCGKJgtwhIIB8vi4nvpOkxLSOyTYzfJ4zj6KmkI39dGQf4JKnOrhNbsHU tS3la+EN0Yn0G645gRGFAFUfez/pbBB4asg7JimlW3BXdGg9pDXNTwNtBKIqRirleOjZNb jDomS1I/KZrSmLh4XqqNElV7XopCmbP/AnBAKNtS7jDTCD+G/31uEVDfpwfW9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720353143; a=rsa-sha256; cv=none; b=gOrjWb/ET32XBLXcAFB6h7N5WLqk6QLw2xBHJmODkyj4WkhZEZJ07ej8+n//J7d4RMyiLc FWEUtaLZzfP/J5IRJKkDMiv/Xh8WliYPohF4ic5ZqmkfKzo962kph2BeADPfy4Ez57GNy7 aQu7fHg/CTq1I8Cnz3puYeMeiTc14FlXlrJ/uFUEBu5O/2QGzdY/xbWBn0esHO7itOPS5Y qLd3MUW9OS6UNYn8QkEYTbV0gTJa65nvH0mkWhH0IQecD94XQOlXMLuRwHvEygZwhqqp3a WK3n2R55xfved+KNNFRz1kVVMvNASDqlVFv3WvzMavmYEofgV/6gMtGWKmwlyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720353143; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hVp5AoVY9Z1tKvkc2o5elvnlvah8e+JmqOfXajSBvxY=; b=DVWdYeXvsG/NJA+fu1MfJJU6JLheH05i1QNlaLg+1zLEumkWroZKAV0XhAhhlxLBxxam07 ULMb09Zn/40BIFKCfahy/cy7c0GjZXk/ELFP+lgeLR+YBdDdZq+D2s2jMqiCKbtpa9USFN NUmTZPV1AqO6ymYHkPHE9cO2lT10diiifx5lhtNjfGp+wsajOjehIyEW3ufFqyuyuuwO3Q W5yPJbPA7UTj5Yk79s3/H66rNe9mKKQPtDtEcbRzGB6m+RaDco+st+g7mDlTfg5kvuZwUB Dp1FnoIswNLKb4AkkvE0wVPLijiJAwiehMjRP5iEdS/+giMsR2f2NRVTBbojFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WH5GH6Djvz1Ln0; Sun, 7 Jul 2024 11:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 467BqNps072147; Sun, 7 Jul 2024 11:52:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 467BqNZU072144; Sun, 7 Jul 2024 11:52:23 GMT (envelope-from git) Date: Sun, 7 Jul 2024 11:52:23 GMT Message-Id: <202407071152.467BqNZU072144@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: 0bff71667441 - main - /sys/dev/bnxt: Enable NPAR support on BCM57504 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 0bff716674418ec9f8c48131fb34cafc0af671e8 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0bff716674418ec9f8c48131fb34cafc0af671e8 commit 0bff716674418ec9f8c48131fb34cafc0af671e8 Author: Vinícius Ferrão AuthorDate: 2024-06-29 05:16:43 +0000 Commit: Warner Losh CommitDate: 2024-07-07 11:49:34 +0000 /sys/dev/bnxt: Enable NPAR support on BCM57504 This commit enables NPAR support for Broadcom 57504 10/25GbE NICs Signed-off-by: Vinícius Ferrão Reviewed by: imp,ssaxena,nightquick@proton.me Pull Request: https://github.com/freebsd/freebsd-src/pull/1306 --- sys/dev/bnxt/bnxt_en/bnxt.h | 1 + sys/dev/bnxt/bnxt_en/if_bnxt.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/sys/dev/bnxt/bnxt_en/bnxt.h b/sys/dev/bnxt/bnxt_en/bnxt.h index cf4f99077b58..c5fadeafa181 100644 --- a/sys/dev/bnxt/bnxt_en/bnxt.h +++ b/sys/dev/bnxt/bnxt_en/bnxt.h @@ -86,6 +86,7 @@ #define BCM58700 0x16cd #define BCM57508 0x1750 #define BCM57504 0x1751 +#define BCM57504_NPAR 0x1801 #define BCM57502 0x1752 #define NETXTREME_C_VF1 0x16cb #define NETXTREME_C_VF2 0x16e1 diff --git a/sys/dev/bnxt/bnxt_en/if_bnxt.c b/sys/dev/bnxt/bnxt_en/if_bnxt.c index 6c0ec892f2c6..00d37f5e0151 100644 --- a/sys/dev/bnxt/bnxt_en/if_bnxt.c +++ b/sys/dev/bnxt/bnxt_en/if_bnxt.c @@ -143,6 +143,8 @@ static const pci_vendor_info_t bnxt_vendor_info_array[] = "Broadcom BCM57508 NetXtreme-E 10Gb/25Gb/50Gb/100Gb/200Gb Ethernet"), PVID(BROADCOM_VENDOR_ID, BCM57504, "Broadcom BCM57504 NetXtreme-E 10Gb/25Gb/50Gb/100Gb/200Gb Ethernet"), + PVID(BROADCOM_VENDOR_ID, BCM57504_NPAR, + "Broadcom BCM57504 NetXtreme-E Ethernet Partition"), PVID(BROADCOM_VENDOR_ID, BCM57502, "Broadcom BCM57502 NetXtreme-E 10Gb/25Gb/50Gb/100Gb/200Gb Ethernet"), PVID(BROADCOM_VENDOR_ID, NETXTREME_C_VF1, @@ -2087,6 +2089,7 @@ bnxt_attach_pre(if_ctx_t ctx) case BCM57414_NPAR2: case BCM57416_NPAR1: case BCM57416_NPAR2: + case BCM57504_NPAR: softc->flags |= BNXT_FLAG_NPAR; break; case NETXTREME_C_VF1: @@ -2170,6 +2173,7 @@ bnxt_attach_pre(if_ctx_t ctx) if ((softc->ver_info->chip_num == BCM57508) || (softc->ver_info->chip_num == BCM57504) || + (softc->ver_info->chip_num == BCM57504_NPAR) || (softc->ver_info->chip_num == BCM57502)) softc->flags |= BNXT_FLAG_CHIP_P5; From nobody Sun Jul 7 11:56:40 2024 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 4WH5MD6TNMz5PGBJ; Sun, 07 Jul 2024 11:56: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WH5MD5Ykwz4ZQd; Sun, 7 Jul 2024 11:56:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720353400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B9cFzKQv8KEkx3i2Eia8hE57YxjrPXRmBWqrqZOdNbc=; b=P1Sinthk5v0TH2Zs8Z8Nk+THXJhsLrt/65jfoOrA9VDTdhGsZLTnYKsy2zTpS8CyyISHMc 32lMIWjusd4iwB9usl1Md5SU5t2bIw2QdY7VtzBqpuiQX/8QhwPWasLWGypx22Z93qQjsP Bk+Vr8qREzzYkNg48yW9lRL5EzfE1wZr5iARVaD4bmxfheci8s2wr2Pb4kScX6bNKyIGvm kdaLkQcNOJc25lkk1h1qbFOVqr8WE8L4ylC0HrJYlGFPZicebtLuZuXBlMxWfQkEKWx7u8 M9RtaBxQeosxRcUkCi1mxpNkiI2Hfs/139Yy7dM3ewrycAl/RQaIRD8fB8mtsg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720353400; a=rsa-sha256; cv=none; b=OJszMmJjXiXtyD6+i3rSDi+mTQ+CyD3CXcmUVz46piXhIKUosn6dvIp6kQfNwEC0bHD9vg STP7HemxH+ajq3FfF5CJHB5bw9KZjWy2Ewb8gZVZvZHCkhIlZrbjGBn4UrGEoMDt3m7sL9 taeMEjIJOjxD12T9OJoXa3Hri9hkbBP5uHB/H5+4TtkoskWJ4e2AEXAQURigFV7PEt6D9H jvMq3Eb2pUzD46Q7eHyfNu7mtq9cUid2budRzmFkAIWoMjlPa0TQkBK5hBogD3xr3LNXnC 2b89prCYmrDjbowQpgs8bQ/jxI80XAIYE360L//uPDI33jsJU0U2Li74jtZCEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720353400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B9cFzKQv8KEkx3i2Eia8hE57YxjrPXRmBWqrqZOdNbc=; b=AmaRt9baZqtyBFulkAgqr/SBccjOIdoaU1yPeVtUlupXBA0sMKlcoOWlUQg4dThlXi9su9 PZR58XvdhiJu7ubH1Tp/TBmAWzxNHKyBFII41MZUIJ+UD+ahFE4nBTJOjNhQ3Qh8lmm0mQ ACJ2Hng2ZI9OcIDRqicLd2mXHhGiSgfbuziS6A8tQCC5dJ7jNrRGCs/7dFZbVSlmss5p+l eQAgDKm8hMgjOtq/WWInva0yrfjb+AqJq14dmAXVJgec+FWf1IsIcK5zcXtuopfpFexhaI V6mn2yzy0F8HT4pYJXWWXSdvjPdpo0NKExV9O2NLHCId1v9g9j9HbspcPYxfKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WH5MD4myyz1Lq7; Sun, 7 Jul 2024 11:56:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 467BuehC074116; Sun, 7 Jul 2024 11:56:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 467BueQh074113; Sun, 7 Jul 2024 11:56:40 GMT (envelope-from git) Date: Sun, 7 Jul 2024 11:56:40 GMT Message-Id: <202407071156.467BueQh074113@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: 8c108b341cd8 - main - ncal: add -M to start week on Monday in cal mode 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 8c108b341cd82d0ed9fcd573764bc94682e84125 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8c108b341cd82d0ed9fcd573764bc94682e84125 commit 8c108b341cd82d0ed9fcd573764bc94682e84125 Author: Valentine Astakhov AuthorDate: 2024-06-17 17:58:02 +0000 Commit: Warner Losh CommitDate: 2024-07-07 11:55:36 +0000 ncal: add -M to start week on Monday in cal mode MFC after: 2 weeks Reviewed by: imp, Alexander Ziaee, Pull Request: https://github.com/freebsd/freebsd-src/pull/1294 --- usr.bin/ncal/ncal.1 | 16 ++++++++++------ usr.bin/ncal/ncal.c | 34 +++++++++++++++++++++++----------- 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/usr.bin/ncal/ncal.1 b/usr.bin/ncal/ncal.1 index a0b6889dca31..8ece31b79cc1 100644 --- a/usr.bin/ncal/ncal.1 +++ b/usr.bin/ncal/ncal.1 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 1997 Wolfgang Helbig .\" All rights reserved. .\" @@ -31,7 +34,7 @@ .Nd displays a calendar and the date of Easter .Sh SYNOPSIS .Nm -.Op Fl 3hjy +.Op Fl 3hjMy .Op Fl A Ar number .Op Fl B Ar number .Oo @@ -39,7 +42,7 @@ .Ar year .Oc .Nm -.Op Fl 3hj +.Op Fl 3hjM .Op Fl A Ar number .Op Fl B Ar number .Fl m Ar month @@ -85,6 +88,10 @@ option, display date of Easter according to the Julian Calendar. Display date of Easter (for western churches). .It Fl j Display Julian days (days one-based, numbered from January 1). +.It Fl M +Display Monday as the first day of the week in +.Nm cal +mode. .It Fl m Ar month Display the specified .Ar month . @@ -186,7 +193,7 @@ X/Open System Interfaces option of the specification. .Pp The flags -.Op Fl 3hyJeopw , +.Op Fl 3ehJMopwy , as well as the ability to specify a month name as a single argument, are extensions to that specification. .Pp @@ -215,6 +222,3 @@ codes is historically naive for many countries. .Pp Not all options are compatible and using them in different orders will give varying results. -.Pp -It is not possible to display Monday as the first day of the week with -.Nm cal . diff --git a/usr.bin/ncal/ncal.c b/usr.bin/ncal/ncal.c index 6f5e1e89bf93..2829caf8a6a0 100644 --- a/usr.bin/ncal/ncal.c +++ b/usr.bin/ncal/ncal.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -162,6 +163,7 @@ static int flag_weeks; /* user wants number of week */ static int nswitch; /* user defined switch date */ static int nswitchb; /* switch date for backward compatibility */ static int highlightdate; +static bool flag_monday; /* user wants week starts on Monday */ static char *center(char *s, char *t, int w); static wchar_t *wcenter(wchar_t *s, wchar_t *t, int w); @@ -216,6 +218,7 @@ main(int argc, char *argv[]) flag_nohighlight = 0; flag_weeks = 0; + flag_monday = false; /* * Use locale to determine the country code, @@ -256,7 +259,7 @@ main(int argc, char *argv[]) before = after = -1; - while ((ch = getopt(argc, argv, "3A:B:Cd:eH:hjJm:Nops:wy")) != -1) + while ((ch = getopt(argc, argv, "3A:B:Cd:eH:hjJm:Nops:wyM")) != -1) switch (ch) { case '3': flag_3months = 1; @@ -306,6 +309,9 @@ main(int argc, char *argv[]) case 'j': flag_julian_day = 1; break; + case 'M': + flag_monday = true; + break; case 'm': if (flag_specifiedmonth) errx(EX_USAGE, "Double -m specified"); @@ -509,7 +515,7 @@ usage(void) " cal [general options] [-hj] [-m month] [year]\n" " ncal [general options] [-hJjpwy] [-s country_code] [[month] year]\n" " ncal [general options] [-hJeo] [year]\n" -"General options: [-NC3] [-A months] [-B months]\n" +"General options: [-NCM3] [-A months] [-B months]\n" "For debug the highlighting: [-H yyyy-mm-dd] [-d yyyy-mm]\n", stderr); exit(EX_USAGE); @@ -652,10 +658,13 @@ monthrangeb(int y, int m, int jd_flag, int before, int after) /* Day of the week names. */ for (i = 0; i < count; i++) { wprintf(L"%s%ls%s%ls%s%ls%s%ls%s%ls%s%ls%s%ls ", - wdss, wds.names[6], wdss, wds.names[0], - wdss, wds.names[1], wdss, wds.names[2], - wdss, wds.names[3], wdss, wds.names[4], - wdss, wds.names[5]); + wdss, wds.names[flag_monday ? 0 : 6], + wdss, wds.names[flag_monday ? 1 : 0], + wdss, wds.names[flag_monday ? 2 : 1], + wdss, wds.names[flag_monday ? 3 : 2], + wdss, wds.names[flag_monday ? 4 : 3], + wdss, wds.names[flag_monday ? 5 : 4], + wdss, wds.names[flag_monday ? 6 : 5]); } printf("\n"); @@ -860,7 +869,7 @@ mkmonthb(int y, int m, int jd_flag, struct monthlines *mlines) date dt; /* handy date */ int dw; /* width of numbers */ int first; /* first day of month */ - int firsts; /* sunday of first week of month */ + int firstsm; /* sunday or monday of first week of month */ int i, j, k, l; /* just indices */ int jan1 = 0; /* the first day of this year */ int last; /* the first day of next month */ @@ -911,10 +920,13 @@ mkmonthb(int y, int m, int jd_flag, struct monthlines *mlines) } /* - * Set firsts to the day number of sunday of the first week of - * this month. (This might be in the last month) + * Set firstsm to the day number of sunday or monday of the first week + * of this month. (This might be in the last month) */ - firsts = first - (weekday(first)+1) % 7; + if (flag_monday) + firstsm = first - weekday(first); + else + firstsm = first - (weekday(first) + 1) % 7; /* * Fill the lines with day of month or day of year (Julian day) @@ -923,7 +935,7 @@ mkmonthb(int y, int m, int jd_flag, struct monthlines *mlines) */ for (i = 0; i != 6; i++) { l = 0; - for (j = firsts + 7 * i, k = 0; j < last && k != dw * 7; + for (j = firstsm + 7 * i, k = 0; j < last && k != dw * 7; j++, k += dw) { if (j >= first) { if (jd_flag) From nobody Sun Jul 7 13:11:35 2024 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 4WH71g6yLvz5Pf10; Sun, 07 Jul 2024 13: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WH71g5KWlz4hJd; Sun, 7 Jul 2024 13:11:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720357895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9MxoMiArZyIEU7XIheqvMnp16yGNOftjObWqO3ei1Jw=; b=DZ6lixIOogyodU1O5lRfV54FwQof0gITmDH40hRORmVHcbGkIWMizeUF58NXgFFKNelZb3 i3hhnTMbrwN90t6lEqyX1py3gvdu1Cx2Hw+mTScS17odJxO8fasdD7DllTZzv08SU4DKIw I5jc9BMx5VaYxAirIffO6nKXpey1ehI6fs56YSTkpt3PyfFyuVDslPHWTUBIOpsqz6D+iZ Ia8JVN7kyB4aZGvvRlkIBcdbGzZI/+HcYjVZ5EAllQLTzrK8OjTn0P0DXZLgFXCRAIc4MT YCjNkcPlljMQs62Niij6YfkfNW7wuFMaKBJw98DardWqXpRfBlpISW6hWRQQVQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720357895; a=rsa-sha256; cv=none; b=Vdu46MRSNQVTTWS7XReW5gE3u43SikpMkl9+ZsvgrTHOlVTkGZQMeTDScpfBCcSqmlUWf0 Ybn3K+tzHAt/hS0VlPtmZPos2YPUx/0NzJF1LI9cHIRC6A441/QXfDlO4iSdeuOp56wYEk v0rbFyjJfL3iakFVuuYQyZJOTwHFiZwhRiNSNCtBLQINaeSFS35oVVnOvldvMvBtXcRwWl OGougCq8r/V9DSUqEwZdz9p51n2qDn3qqZTe12gJz4MEbubj502iRWJm6+Iv+I/Rd1RnDx Px1h6AEqNXF5QkONd5cfvpfsYDh9S4cQsmdfBtP0EJLkT4oBq1veL8Y5hhazNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720357895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9MxoMiArZyIEU7XIheqvMnp16yGNOftjObWqO3ei1Jw=; b=l8Qyrt5jDOovvkgSNmPnTKvgqDvsGVy+cP/8w6d1fl8TFsXhIHlhboCWFqHZLbiEhSyJqy KaRdQyf0LQAf4ojpGT5WJiSPsJ1JR/QWAKb7I48TjqEE1nVnefcx463m/uvLEyMN1edaRW awAx+hPXTlCqUk1sjV1cb5fnxaLfvDAVrWiMdvZ3oOsDWYnm0s49JnWAz1EU/0sjwJNNmE hB50qlyhOSTr9ci0h4BVyWbm06rbbbtKoMTrNxcs58NGW5m2wdN72WhZGyStGnAdtkLK7P 5gMDFB+pnEOjlOiSaLzBnx9Pn7ZcD+b+rhyx1rbpBhkbtiPx0zDuvAYCV5UkhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WH71g4y2Xz1NwP; Sun, 7 Jul 2024 13:11:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 467DBZDD005920; Sun, 7 Jul 2024 13:11:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 467DBZZ9005917; Sun, 7 Jul 2024 13:11:35 GMT (envelope-from git) Date: Sun, 7 Jul 2024 13:11:35 GMT Message-Id: <202407071311.467DBZZ9005917@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wolfram Schneider Subject: git: e880dd644f63 - main - stale-symlink-buildworld.sh: a script to check for stale symlinks on a FreeBSD system 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e880dd644f63fbe068c38b73b44aa7e7c5f176f3 Auto-Submitted: auto-generated The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=e880dd644f63fbe068c38b73b44aa7e7c5f176f3 commit e880dd644f63fbe068c38b73b44aa7e7c5f176f3 Author: Wolfram Schneider AuthorDate: 2024-07-07 12:59:20 +0000 Commit: Wolfram Schneider CommitDate: 2024-07-07 12:59:20 +0000 stale-symlink-buildworld.sh: a script to check for stale symlinks on a FreeBSD system You can run the script before or after `make installworld' You may also check your local ports with: env STALE_SYMLINK_BUILDWORLD_DIRS=/usr/local ./stale-symlink-buildworld.sh PR: 276235 --- tools/build/stale-symlink-buildworld.sh | 53 +++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/tools/build/stale-symlink-buildworld.sh b/tools/build/stale-symlink-buildworld.sh new file mode 100755 index 000000000000..a4515db3fccb --- /dev/null +++ b/tools/build/stale-symlink-buildworld.sh @@ -0,0 +1,53 @@ +#!/bin/sh +# Copyright (c) Feb 2024 Wolfram Schneider +# SPDX-License-Identifier: BSD-2-Clause +# +# stale-symlink-buildworld.sh - check for stale symlinks on a FreeBSD system +# +# You can run the script before or after `make installworld' +# + +PATH="/bin:/usr/bin"; export PATH + +: ${ncpu=$(nproc)} + +# check other directories as well +: ${STALE_SYMLINK_BUILDWORLD_DIRS="/usr/obj"} + +trap 'rm -f $script' 0 +script=$(mktemp -t stale-symlink) +chmod u+x $script + +# create a temporary shell script to check for stale symbolic links +cat << 'EOF' > $script +file="$1" + +if [ ! -e "$file" ]; then + echo "stale symlink detected: $(ls -ld $file)" >&2 + exit 1 +else + exit 0 +fi +EOF + +find -s -H \ + /bin \ + /boot \ + /etc \ + /lib \ + /libexec \ + /sbin \ + /usr/bin \ + /usr/include \ + /usr/lib \ + /usr/lib32 \ + /usr/libdata \ + /usr/libexec \ + /usr/sbin \ + /usr/src \ + /usr/share \ + $STALE_SYMLINK_BUILDWORLD_DIRS \ + -type l \ + -print0 | xargs -n1 -0 -P${ncpu} $script + +#EOF From nobody Sun Jul 7 14:17:45 2024 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 4WH8V21zlqz5Plpj; Sun, 07 Jul 2024 14:17: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WH8V219h2z4pGq; Sun, 7 Jul 2024 14:17:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720361866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R5IPAE7SJQg55BQpvtoQzt2HTMcwahEPMs2IkHlgE4E=; b=lZbCEts7UamPPBX0FRygjGLBQ+oov2FQ6ttnkMketmSVNltyDMqjUUX/DuWIrMuBxXJvF0 vCiTnJiOrXSiFP5UMshphVWuOf+dMJeZ9lmzI/TzcZuu8MR5rK9QlgjZcpiXQSPBCTfriZ JSc2Y+57G4rGbYrZW/SJk1AKieQmuQujc9QFLcg75fU0ktZa8dwtMYeFGtJ130+5MjTlQJ 2MQANzGT5zJjXdGduuqZfX3Q1t4UVoBD2PKmezLRYTMep/CJaS+yXPHZLSHsfHUIl/luH4 PUXG9qLvHtoIW+oGuy1K10+jgw3tDqygHe8egyyclJhLjeonOWmn3Yjv4rHzZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720361866; a=rsa-sha256; cv=none; b=fBlWAtqcQD2Yr6K6mlS18kwkUlf0Vnx7I/FSOSppWsoOdzrgM0JpaiHnc8o0wD+xmqDhM0 OnOQH2uY2xE8BQgDE1ODj0ZGr57e8ZlBHV1s8Z/2H44KaScLsHTQ/tx90+gv3mAYZ6+1i8 3a32y7Rpw5x4IAWUIJuPmOE3fbF8+lOLBXSCdSPA9y4h5ZstQXKORi1FS5/uifNOazR8U2 FtA/Li+VtMRTLUZFJKnePu6cljKKF4McGH10QPG4SDT5aNfQ5LRYC0Uo3JfKXpq8UzN/jh suJ7hvZqZPIlKsO0bCOOJ1WOnOyiIuRM1KlU5N9uxo8XiQf545aIyXPQaav0yA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720361866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R5IPAE7SJQg55BQpvtoQzt2HTMcwahEPMs2IkHlgE4E=; b=RIcw7R2/jWewPfVHMAd0a1lAC2UZspgSkfx5rk8Lw14VQdCILdxz2/AjDAeJBea9qsXyJi 5V0WM9uabBSDTEJuVUR4PSncHoS5uKaEyFc5qn95GiO5xz8Y2bGJjmgQIbCNp9jJnz+ki1 5i4uCfjuj6CbVTQFXI6Yn7/Bfs2tjM/NgSbiqWxc8XScANejEj0TllYvZtaKzNBSkJoktX 7GR+3RbRga5VeOhdO2MNxuePAF7CS2R+Zq06DV020aehEnS/rJhmgyozXpXCMQ6LvzkobE o6KmVaUbPkBp6bG1SFY3azmcrNxr9KfN1mGOdzQEpbnHeOSuR+psD/U8tw5kFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WH8V20fWlz1QSH; Sun, 7 Jul 2024 14:17:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 467EHj8n012228; Sun, 7 Jul 2024 14:17:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 467EHjlK012225; Sun, 7 Jul 2024 14:17:45 GMT (envelope-from git) Date: Sun, 7 Jul 2024 14:17:45 GMT Message-Id: <202407071417.467EHjlK012225@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 6ea81bcaf8ad - main - ocs_fc(4): Fix a typo in a kernel message 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6ea81bcaf8adcf6a8546407e93e97f3d920396d2 Auto-Submitted: auto-generated The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=6ea81bcaf8adcf6a8546407e93e97f3d920396d2 commit 6ea81bcaf8adcf6a8546407e93e97f3d920396d2 Author: Gordon Bergling AuthorDate: 2024-07-07 14:17:23 +0000 Commit: Gordon Bergling CommitDate: 2024-07-07 14:17:23 +0000 ocs_fc(4): Fix a typo in a kernel message - s/elasped/elapsed/ MFC after: 5 days --- sys/dev/ocs_fc/ocs_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ocs_fc/ocs_hw.c b/sys/dev/ocs_fc/ocs_hw.c index cfb9d4f8f536..c368e09aef8c 100644 --- a/sys/dev/ocs_fc/ocs_hw.c +++ b/sys/dev/ocs_fc/ocs_hw.c @@ -11214,7 +11214,7 @@ target_wqe_timer_nop_cb(ocs_hw_t *hw, int32_t status, uint8_t *mqe, void *arg) getmicrouptime(&cur_time); timevalsub(&cur_time, &io->submit_time); if (cur_time.tv_sec > io->wqe_timeout) { - ocs_log_info(hw->os, "IO timeout xri=0x%x tag=0x%x type=%d elasped time:%u\n", + ocs_log_info(hw->os, "IO timeout xri=0x%x tag=0x%x type=%d elapsed time:%u\n", io->indicator, io->reqtag, io->type, cur_time.tv_sec); /* remove from active_wqe list so won't try to abort again */ From nobody Sun Jul 7 14:55:18 2024 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 4WH9KL5hHxz5Pqgj; Sun, 07 Jul 2024 14:55:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WH9KL3t2Jz3xLG; Sun, 7 Jul 2024 14:55:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720364118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r1EjE3rRpMkn8wEhd7Nd0QJMncak7Suee2NWAT4neGo=; b=KBRfH5AvzWtGVKI+MNSbUgzb5t/zHIvFPMBODDoubx9lNegPF+jpO2BA8XTHxD+rycqWry VTrEu2LRYEbje0EhXRptRiUFWUDWLvNa5WfdNvg9EUvH0AJF0+UGpMdK+g6zSz0s9Nx18n sdVzVPlG95qNfC6E/OSmkFN0OV9IhqPg6vJOE73LFLPgB3P0Eh+Jaiw9asmPUZAMZngAAy y0LamsftmwD9HTlQUERLNEjvelSUvzA6XQ0F0j9sAAZLG3tklBva/8QjyfkGmpVKYBigZA az2fcL1nx53Pohdm70UIWtJZwwzghh8W5eKiKLcRTCu1wdG9PJwndxOrihkgDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720364118; a=rsa-sha256; cv=none; b=q3b5Zm8TzfgAr0Slm6csdw2DcNCUiTUTnjv9J1Mk5SAjVDiJGzeQJAYk7mhw1Hw/SxZw+7 37WLtJT6P7wbbV8alm55jDSV89FX5vYOR5i2Rag0fQMR7+DQtWKYMxRWohDRryIVmzeP52 cw1JJYR8s+yenq7lXAMgh3mb50spaoxw+EgT7Glbd4Da4M8FV/cQHFyKS1zo973CeS5+Dx KR59GigcZ1yYA3J3cktD/kZNFEs9UjB6e3qjBUGOFqxWzhCRIrRvkvG/tEuBLfkijDxMWA U2RbodYq0AaO69pKdd+sXCgFkJvqyu/9hW8o3Vr8yFrOwSqYUtyIxUukCIYGIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720364118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r1EjE3rRpMkn8wEhd7Nd0QJMncak7Suee2NWAT4neGo=; b=Anl2IoV4zWv5G6XxRlYWH10XHpUJIH1qWVOhn4c4r5C7DaHAYT/AAqyj2SpaVWLBs7WOKq Efc0dMYrQAyjODtSeTHCO6fjDnfpigWrNEtUPqCeoRiOqdns05BoNOF8vExMVh8Emy4kkC rKoZ98VV5fWx4eTVDHiV7KGudG18sf9iJvuIp4n2EKd+hDX9H/pSAk4QQFkTgQ6hEj2i/G X/O5cfiThbpnLHu1wqxcG0ycvglv2VVIkuNYs/24Esbim8xL29MlOq42lBVn/9fjV5Fe28 KtxwXuHA1uOmVyIXKHSmh5eFFOxsl2f9EsExQsiZHp53ryV5CAEBQNc9ajvdPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WH9KL3R5vz1RPP; Sun, 7 Jul 2024 14:55:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 467EtIeN085155; Sun, 7 Jul 2024 14:55:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 467EtIpk085152; Sun, 7 Jul 2024 14:55:18 GMT (envelope-from git) Date: Sun, 7 Jul 2024 14:55:18 GMT Message-Id: <202407071455.467EtIpk085152@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: de2ab11ff955 - main - manuals/description: system video console utilitys 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: de2ab11ff955faa32bfffe5b2401b444a7c138f2 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=de2ab11ff955faa32bfffe5b2401b444a7c138f2 commit de2ab11ff955faa32bfffe5b2401b444a7c138f2 Author: Alexander Ziaee AuthorDate: 2024-06-04 09:03:41 +0000 Commit: Warner Losh CommitDate: 2024-07-07 14:54:22 +0000 manuals/description: system video console utilitys Update the man page descriptions so that apropos are more consistent for console related man pages. Motive: apropos results: clarify consistently MFC after: 3 days Reviewed by: emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1275 --- sbin/conscontrol/conscontrol.8 | 6 ++++-- share/man/man4/vt.4 | 7 +++++-- usr.sbin/moused/moused.8 | 7 +++++-- usr.sbin/vidcontrol/vidcontrol.1 | 6 ++++-- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/sbin/conscontrol/conscontrol.8 b/sbin/conscontrol/conscontrol.8 index 54c89d5e5c1b..c11a1f7db5d9 100644 --- a/sbin/conscontrol/conscontrol.8 +++ b/sbin/conscontrol/conscontrol.8 @@ -1,3 +1,5 @@ +.\"- +.\" SPDX-License-Identifer: BSD-2-Clause .\" .\" Copyright (c) 2001 Jonathan Lemon .\" All rights reserved. @@ -23,12 +25,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 14, 2011 +.Dd July 7, 2024 .Dt CONSCONTROL 8 .Os .Sh NAME .Nm conscontrol -.Nd control physical console devices +.Nd control physical system video console devices .Sh SYNOPSIS .Nm .Op Cm list diff --git a/share/man/man4/vt.4 b/share/man/man4/vt.4 index 45e6c0ceb979..6f223d67eb09 100644 --- a/share/man/man4/vt.4 +++ b/share/man/man4/vt.4 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2014 Warren Block .\" All rights reserved. .\" @@ -22,12 +25,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 24, 2024 +.Dd July 7, 2024 .Dt "VT" 4 .Os .Sh NAME .Nm vt -.Nd virtual terminal console driver +.Nd virtual terminal system video console driver .Sh SYNOPSIS .Cd "options TERMINAL_KERN_ATTR=_attribute_" .Cd "options TERMINAL_NORM_ATTR=_attribute_" diff --git a/usr.sbin/moused/moused.8 b/usr.sbin/moused/moused.8 index 9eeb48547866..cd5d8ddde339 100644 --- a/usr.sbin/moused/moused.8 +++ b/usr.sbin/moused/moused.8 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-4-Clause +.\" .\" Copyright (c) 1996 .\" Mike Pritchard . All rights reserved. .\" @@ -28,12 +31,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 15, 2008 +.Dd July 7, 2024 .Dt MOUSED 8 .Os .Sh NAME .Nm moused -.Nd pass mouse data to the console driver +.Nd pass mouse data to the system video console driver .Sh SYNOPSIS .Nm .Op Fl DPRacdfs diff --git a/usr.sbin/vidcontrol/vidcontrol.1 b/usr.sbin/vidcontrol/vidcontrol.1 index 44e0950294cb..09855df6b60f 100644 --- a/usr.sbin/vidcontrol/vidcontrol.1 +++ b/usr.sbin/vidcontrol/vidcontrol.1 @@ -1,3 +1,5 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause .\" .\" vidcontrol - a utility for manipulating the syscons or vt video driver .\" @@ -10,12 +12,12 @@ .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" -.Dd April 6, 2022 +.Dd July 7, 2024 .Dt VIDCONTROL 1 .Os .Sh NAME .Nm vidcontrol -.Nd system console control and configuration utility +.Nd system video console control and configuration utility .Sh SYNOPSIS .Nm .Op Fl CdHLPpx From nobody Sun Jul 7 14:55:17 2024 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 4WH9KK5f83z5PqlW; Sun, 07 Jul 2024 14:55: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WH9KK37xTz3xdR; Sun, 7 Jul 2024 14:55:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720364117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jFRWXlu1EabJfDRTB9T8gCbogN5vlu4my4+xVkouCZ0=; b=OAc10GABkZopIQZMNqpshar7gJwN1SAc+LmCiZiJIJYBpYtcoUm0XY/Fwvmf/qcLnZWNKq b1xvbeWEsOrzsir0sb7acXzd/ozoC7t5zYDPS/F3Xq+22MQvq26INlZ5wCdhEtrxPECDxn iD2VyxpCgRogcWOx6rUGCbwlgS4ZoFTm41DU8osIKewj/b1+EcHAlE6sbXFe97A/vVSNGj AUfa8Y0n0qmudvJAsOvL+bQtbTDGunqve9SxV8dkeffUv4x97hEdVj/Jg+/6glXTNqR2RI S1hZ8DCtM9EPjtOpoBjeBOIJqfo1ByUVBZWMFbpXzEnmQj4zgeHfEw7AdB2aNQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720364117; a=rsa-sha256; cv=none; b=ok4enn99ROehPkNIavCCkkbDVdKGS9Iv7e2dpfoDvFaDH5iadUf9LBaZF3+nSYUTS8F7AM g4cIw1sM/51ujH5sSItVL6eo326cifE0ZXp7LbjgRvVyUza7WGBEVUa0RG6eSopRuNNgWl IutzcT0Jj2mO5L069F3ncsrbHFEbkhLO8T8qoBARfRDlXJRR9TZsWea7g0JDjppwYGAREU KU0Gc/kFHwb8gVl3ERrct1DI0/VkQ3WasevOcyZp1R1CBTl0U6pKxc6TYYdp4BRpDhun7n DrdxW32Xp7TIFvGD7CQQfKwZcM2ZOSHdWFyj+o+61/Wy4Pox1viMlOBmn9Xokg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720364117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jFRWXlu1EabJfDRTB9T8gCbogN5vlu4my4+xVkouCZ0=; b=FeAZcv5JWZhX/YpyQxRxTUeIEcErNvREgTsCDJrGTQBKQp038zYRRDo4/JBki/nSID08Yx KiVLts21Doox+pyVdftkvhb1qf3YRUxIfuowj6/pDJ/cDncY1O745WupTQo1e9Q2ohL7ur SvqGTAD3dJNr/w7J+zkqK8Fi0qM3vpIHUKdowpwKNKSaX/nUWR6l1OCP7GX9M3+ayNW1Y9 kksdwTEs4Q/iYehOewtejLWdZorAJi8LRh8a4lxLGWO+ukHEkkp5Hrzse/gdLonNJdFyd9 5kNQVXO5LpSOjnSneRoNsculaEmzZvgZ2D5jfvgDZcoZ1cM+MqAUE4gPwf8C6Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WH9KK2l0mz1RH2; Sun, 7 Jul 2024 14:55:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 467EtHCX085066; Sun, 7 Jul 2024 14:55:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 467EtHGQ085063; Sun, 7 Jul 2024 14:55:17 GMT (envelope-from git) Date: Sun, 7 Jul 2024 14:55:17 GMT Message-Id: <202407071455.467EtHGQ085063@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: 580dc180c7eb - main - kbcontrol.1+kbdmap.1: improve manual descriptions 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: 580dc180c7ebd84a4aee27938a5f4a62520ac5d9 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=580dc180c7ebd84a4aee27938a5f4a62520ac5d9 commit 580dc180c7ebd84a4aee27938a5f4a62520ac5d9 Author: Alexander Ziaee AuthorDate: 2024-06-04 07:49:43 +0000 Commit: Warner Losh CommitDate: 2024-07-07 14:54:17 +0000 kbcontrol.1+kbdmap.1: improve manual descriptions Update the man page descriptions so that apropos {console,keyboard} finds more relevant man pages. MFC after: 3 days Reviewed by: imp, emase Pull Request: https://github.com/freebsd/freebsd-src/pull/1275 --- usr.sbin/kbdcontrol/kbdcontrol.1 | 8 +++++--- usr.sbin/kbdmap/kbdmap.1 | 7 +++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/usr.sbin/kbdcontrol/kbdcontrol.1 b/usr.sbin/kbdcontrol/kbdcontrol.1 index dcadf1b7414d..34126c718ed9 100644 --- a/usr.sbin/kbdcontrol/kbdcontrol.1 +++ b/usr.sbin/kbdcontrol/kbdcontrol.1 @@ -1,5 +1,7 @@ +.\"- +.\" SPDX-License-Identifer: BSD-2-Clause .\" -.\" kbdcontrol - a utility for manipulating the syscons or vt keyboard driver section +.\" kbdcontrol - syscons or vt keyboard driver configuration utility .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -10,12 +12,12 @@ .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" -.Dd March 16, 2016 +.Dd July 7, 2024 .Dt KBDCONTROL 1 .Os .Sh NAME .Nm kbdcontrol -.Nd keyboard control and configuration utility +.Nd system video console keyboard control/configuration utility .Sh SYNOPSIS .Nm .Op Fl dFKix diff --git a/usr.sbin/kbdmap/kbdmap.1 b/usr.sbin/kbdmap/kbdmap.1 index 4c7f01d84745..002d8b2b9773 100644 --- a/usr.sbin/kbdmap/kbdmap.1 +++ b/usr.sbin/kbdmap/kbdmap.1 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) March 1995 Wolfram Schneider . Berlin. .\" All rights reserved. .\" @@ -21,13 +24,13 @@ .\" 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. -.Dd July 3, 2002 +.Dd July 7, 2024 .Dt KBDMAP 1 .Os .Sh NAME .Nm kbdmap , .Nm vidfont -.Nd front end for syscons and vt +.Nd system video console keyboard map/font dialog utilities .Sh SYNOPSIS .Nm .Op Fl K From nobody Sun Jul 7 14:58:39 2024 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 4WH9PD2X4bz5Ps50; Sun, 07 Jul 2024 14:58: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WH9PC0zZXz464K; Sun, 7 Jul 2024 14:58:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720364319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8Bu4dWpOjqmeIt20t2c5T3bU1RFkj4fmDf3+WQfOqd0=; b=pJmBhpCj5MTD8EUdcVcLgk0oM0Hlr8FImfBF5mU9sgcx1z0JlX0hygM5Ju6x9d51juMMP3 D7CwDfSIEHgHngQPn6q88toofLaIecJ+p8wReV++7VjMsA145+zl5O3pE+8dXZj+aT04LS l7oQ4LDTp09U1sXf0VwDesmc01CTYuB7IWA/mIyr5jdSrHuatP3QrgNBaTCp7jA3rI2axO 7yDmY8BkLd+iGtnFndg5QvsqmfnCx4spU+KkUsVR498+6isz53CQMNMdQFTS4eaC6kaehX tNTAYo+Z89zPz9/fEyuNnIJb1L4M2rnwIKJtkJ7fDeQDv4x6+zEhiuyW1qHu0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720364319; a=rsa-sha256; cv=none; b=dvA1HpnNHkTFsfeRUIZOFxOCMLDd16ovC1LeEml6zEZ6BtfIsJ9Q+hEKJe249mWE7kS78u i4pncKq2uvg+WFs4aKEsMnVkYtFWpJ2xkND0U1ZweML9xWrMZWLXixDVYRhJrhEd0hyT4a KXO4U5gQMWAvqiElsuGBaaQnPWyEF49Yr5hFrNZoDs5HLNltYTkx0EonAS948yhDp8OmOW Ciq//4uwksVMMw+DF2nZBZ2eF/9wZdsMOLgYpQ5b5VmmPZHPzSXMSaqa7t5sznq6DHQsKK VVcoY3ocT/bg0YXqfa3L3U7oCzCt14y9CdUKEBAkN9i8Eyso5+D6zkWysZCGDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720364319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8Bu4dWpOjqmeIt20t2c5T3bU1RFkj4fmDf3+WQfOqd0=; b=IT4Vz6yAZnf60IU4sff1y1vXwO8CY/uV5CVhNX2j7CwYtvJMSeyNcdd/9OKtOlAYC/r9xO oZj5It9G84REJ3GPcOOqb7Nqr6xEdfDQATbya+E2FYSx6s94ZaNGm3S8W2o0TSAfdsK/Fu jHtj4yuynb1eOMlCYhNSlfGkY7+hJ5H1/5EIsJN6i18cf6emwlKhj2yKMSh6fQ2EuR47gc k52Lc8Goi/DlutWz0++QZXeSUIXWk+ZjJdiCZrDn7EYU275ZoLnIv7IevIiY7JryfJkPuV c2fkER8zD7demi5v2d6+wvjIROl/bMUR67E/DqYTBzkev8tC6lDjCUG5GxnO3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WH9PC0ZThz1RKm; Sun, 7 Jul 2024 14:58:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 467EwdlH092634; Sun, 7 Jul 2024 14:58:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 467Ewdr6092631; Sun, 7 Jul 2024 14:58:39 GMT (envelope-from git) Date: Sun, 7 Jul 2024 14:58:39 GMT Message-Id: <202407071458.467Ewdr6092631@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: c2c6f08c8b47 - main - development.7/FILES: add CONTRIBUTING + git-arc.sh 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: c2c6f08c8b47cfda79529e0a1016b8f7803c0ec8 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c2c6f08c8b47cfda79529e0a1016b8f7803c0ec8 commit c2c6f08c8b47cfda79529e0a1016b8f7803c0ec8 Author: Alexander Ziaee AuthorDate: 2024-06-18 11:02:42 +0000 Commit: Warner Losh CommitDate: 2024-07-07 14:58:37 +0000 development.7/FILES: add CONTRIBUTING + git-arc.sh MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1300 --- share/man/man7/development.7 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/share/man/man7/development.7 b/share/man/man7/development.7 index 9af9bfb66fa8..eb5a57a464fc 100644 --- a/share/man/man7/development.7 +++ b/share/man/man7/development.7 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 1, 2022 +.Dd July 7, 2024 .Dt DEVELOPMENT 7 .Os .Sh NAME @@ -119,6 +119,14 @@ build and test status of CURRENT and STABLE branches, the continuous integration system is at: .Pp .Lk https://ci.FreeBSD.org +.Sh FILES +.Bl -compact -tag -width "/usr/src/tools/tools/git/git-arc.sh" +.It Pa /usr/src/CONTRIBUTING.md +.Fx +contribution guidelines +.It Pa /usr/src/tools/tools/git/git-arc.sh +Phabricator review tooling +.El .Sh EXAMPLES Check out the CURRENT branch, build it, and install, overwriting the current system: From nobody Sun Jul 7 19:19:58 2024 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 4WHHBk3ylcz5QKk7; Sun, 07 Jul 2024 19:19: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WHHBk3SFPz4659; Sun, 7 Jul 2024 19:19:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720379998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gZ1RC69wlyRlwRb1jcRZQCKEUMp3tc8ijDR7XiiJ+IU=; b=wqlmBHGHSIWF0i28yFLqAuV3yMur1p4eq8QOt8iymwhsUwge53uGCl74B6EUxpiXr1pZZw SF7BEHOUiyPH70JlCRu98zx8QuecDFlTEEKIIHGOQQhxG0Ddx7mcrvX1jtRuN1lYkbkyZX TPJb6mcKrJr8rtTwRewchq2jQYv0bjNzbvD2x0G1MmTk5PaPQ1Ihbh4AC28FiHHo9Jq0dI DKqQWsB2WIR7ZrIIoXiHZ2kDWQeOj8ZlIeIDQXjfJ9KzqNWRFFV1ctoclUd5NVzh1YD+PI 5oG5Qp7y+X1gX8sODxl52O0viNiVTRNcxEgcNulN4u1iy5qfe+4GwJtkjvZSfg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720379998; a=rsa-sha256; cv=none; b=KxZ4Ys7OONxq3NcCZOvEAKE4wt25jnGZ9aC6M6mE5xIilGx0QyyoXd1k+n65PV672twXTd gegk19mAyjPOJnayQumCL66pXUtxllg5xfm3YwVaN3k2DTJhCuo3I9RrBFD1JlrhIdmqIy CiVZb8k+LqJ6T2QX+JKe14iuURjcZZFzRduX9i7T7nPIetFuDgx/GWfeHKXwYRc8zfjDSX TqVkAEFrgDj/nLLi6FR+L70bdTX7yGQuXvUsIFH/kfAuX+V2UcYfSFhepdQ4bGNjpSPykU TLNSZTaFbmPTz3qW7s3JX6H3JPo8o8zZJL31cFwT46fmhpNqv0ssR92YXgEiQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720379998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gZ1RC69wlyRlwRb1jcRZQCKEUMp3tc8ijDR7XiiJ+IU=; b=ATZ+T1B+JQ/YrTZWb9pGfB4PfHgGThhMP/yYBIkIWRxINbTkTiw7t17mCmTc/mtUc5X7fN D1PuISBR2YbeCkhCLQvnM7XwSjUJdjkLbRfb5TPXNql95nxogYKZezFjBeQcqOXfWca9kg iHpSfd3xXTX8qi6VxfpVtl+h/0MjqbpbHbaxuEv4XsVQbxCZt59l/ws4I5Q+htJTjofWQW DAqTXpEJOKm/oS+Hq5u91X2HLABwaNLgtPsHA86cWK3mjWpzrowM8wRoSwzsjjBYi9aoM2 fq2sYfYn6CRT84BbqH4s46yI6e/dELSBajCeHwpj+2ZOKS0BSj5h/v+xlkQdkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WHHBk2xxHzKhH; Sun, 7 Jul 2024 19:19:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 467JJwOf044953; Sun, 7 Jul 2024 19:19:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 467JJwf6044950; Sun, 7 Jul 2024 19:19:58 GMT (envelope-from git) Date: Sun, 7 Jul 2024 19:19:58 GMT Message-Id: <202407071919.467JJwf6044950@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: df3f247e4696 - main - rpcbind.8: Update the man page for -I 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: df3f247e46969a71f3db1bfa5714603c99717579 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=df3f247e46969a71f3db1bfa5714603c99717579 commit df3f247e46969a71f3db1bfa5714603c99717579 Author: Joyu Liao AuthorDate: 2024-07-07 19:17:57 +0000 Commit: Rick Macklem CommitDate: 2024-07-07 19:17:57 +0000 rpcbind.8: Update the man page for -I Commit d8a99eaa1f06 added a new command line option "-I". This patch updates the man page for this. This is a content change. Reviewed by: Alexander Ziaee (manpages) Differential Revision: https://reviews.freebsd.org/D45118 --- usr.sbin/rpcbind/rpcbind.8 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/usr.sbin/rpcbind/rpcbind.8 b/usr.sbin/rpcbind/rpcbind.8 index 814e95c46722..1dd145f945f4 100644 --- a/usr.sbin/rpcbind/rpcbind.8 +++ b/usr.sbin/rpcbind/rpcbind.8 @@ -1,6 +1,6 @@ .\" Copyright 1989 AT&T .\" Copyright 1991 Sun Microsystems, Inc. -.Dd August 31, 2023 +.Dd July 5, 2024 .Dt RPCBIND 8 .Os .Sh NAME @@ -99,12 +99,21 @@ returning a UDP packet from a different IP address than it was sent to. Note that when specifying IP addresses with .Fl h , +and no +.Fl I +option is specified, .Nm will automatically add .Li 127.0.0.1 and if IPv6 is enabled, .Li ::1 to the list. +.It Fl I +Cause +.Nm +not to bind to the localhost when +.Fl h +has been specified. .It Fl i .Dq Insecure mode. From nobody Sun Jul 7 23:21:45 2024 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 4WHNYj4NsNz5QKRD; Sun, 07 Jul 2024 23:21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WHNYj3yLZz4dL2; Sun, 7 Jul 2024 23:21:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720394505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KeSEKXO6UUBRW/QFAt2RtxBlwzBymoaazlf70h7TecQ=; b=ArNHnuTn3MfBcdsnYTjTvHVQrmGXKnekeCoTmHtaDx6c3ZsBb+a+JnZBr2VAdMSzkkOr1a v7mQ2UTip0/+vOYi1fOZj/86gDXspt2L+yhF8yGS/RMvYj5y6V5BYsobc1O/Pn814LPp/t tG1/PcEu2rbsmnxEfVGOAF68hG2O9H1gvKQuxS3R7CraoEUdP0WZkiSqw6YRRz9Wgtl9+a w69UhtIq3n5jOCF9Hqu+iUjY+m12STWS5Ie40epzKDprqpNiHETYlWDE2+3bIT0ufneG2H t9iHtfNP1iNcwpUnwqqwYZfWrJlpRiQIEJU1R/D3SoagYqb3beFQNWVIeDNFcA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720394505; a=rsa-sha256; cv=none; b=lXSlSOK4UpZhY/mDhZBcMHvWfCzvJV2Scf6ofjZvfYti6FsPonuVSnQW80mXhBZ2IllyXD ngIxISEEFwtb5cUtYmhhuYO14oCpc9mbDK3zUefLySeqfASTT07BjYjKuPvuXaZz9C9FX3 3REB0RS3sXizbpThEZsB5MyJGQLz7o1fq+nC97zIN3NFHrcxqw/c3aQzM3aIrFsruzCPWL bPakkmywFmTmfzYKwtiiACAWe8CR9DSIaezH1sh3ZIb+yRU26PgH8N5z9iuRl3ANeAxV3L B6S3dlqJm5olna+7C3JpRlt7neemEE8us0u0ZMDwaUVNULwANoqT8k7D+mcqZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720394505; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KeSEKXO6UUBRW/QFAt2RtxBlwzBymoaazlf70h7TecQ=; b=YgU9ssAAtTV8jbIkixGN64d+LcerHu5I06U8iCO7Jy2e+NpDJ6yZ0soCt1lpirBqqeuExO HoUZQUoUK/YM5h987XCa0Vv5WG21BNwOkswYHworn1Me3VMO+MVG9H74Fwn8xFpE9LteFQ xxhO7tMo9NpzJUFDUdSlTkwRotQngtORfnyO0zLRfNHa5LilLZwfacAbV3dFhza41JDHnd DOTQun8EnUSLO5B3v4DD1duZEuofYikPYYHgWoFjL/UQ/Z93KrJzyICKDViowQCiMuGHvD 2A09jdhqg+qdH+QYfPIP2B3trID96YDJE24G1YoFHRZBvCGE/54CPknLdeWtWQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WHNYj3Z4vzSP8; Sun, 7 Jul 2024 23:21:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 467NLjK4063157; Sun, 7 Jul 2024 23:21:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 467NLj9S063154; Sun, 7 Jul 2024 23:21:45 GMT (envelope-from git) Date: Sun, 7 Jul 2024 23:21:45 GMT Message-Id: <202407072321.467NLj9S063154@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 75694e650ed9 - main - swap_pager: speedup meta_transfer 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 75694e650ed99e43cf8418629ae7a3a596ef4f5d Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=75694e650ed99e43cf8418629ae7a3a596ef4f5d commit 75694e650ed99e43cf8418629ae7a3a596ef4f5d Author: Doug Moore AuthorDate: 2024-07-07 23:19:22 +0000 Commit: Doug Moore CommitDate: 2024-07-07 23:19:22 +0000 swap_pager: speedup meta_transfer Add a parameter to swp_pager_meta_build, for the benefit of swp_pager_meta_transfer. swp_pager_meta_transfer calls swp_pager_xfer_source, which may look up the same trie entry twice - first, by calling sw_pager_meta_lookup, and then as the first step in swp_pager_meta_build. A boolean parameter to swp_pager_meta_build tells that function not to replace a previously assigned swapblk with a new one, and setting it in this call makes the first meta_lookup call unnecessary. swp_pager_meta_transfer calls swp_pager_xfer_source, which may release and reacquire the source object write lock, because the call to swp_pager_meta_build may acquire and then release the destination object write block. But it probably doesn't, so fiddling with the source object write block was probably unnecessary. This boolean parameter to swp_pager_meta_build tells it to return immediately if memory allocation problems are about to require a lock release/reacquisitiion, so that the caller can release/reacquire the source object write lock only if truly necessary, around a second call the swp_pager_meta_build with that boolean parameter not set. This should make manipulation of the source object write lock rarer. Reviewed by: alc, kib (previous version) Tested by: pho Differential Revision: https://reviews.freebsd.org/D45781 --- sys/vm/swap_pager.c | 94 ++++++++++++++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 79986842d814..9df1521858c1 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -486,7 +486,8 @@ static daddr_t swp_pager_getswapspace(int *npages); /* * Metadata functions */ -static daddr_t swp_pager_meta_build(vm_object_t, vm_pindex_t, daddr_t); +static daddr_t swp_pager_meta_build(vm_object_t, vm_pindex_t, daddr_t, + bool); static void swp_pager_meta_free(vm_object_t, vm_pindex_t, vm_pindex_t, vm_size_t *); static void swp_pager_meta_transfer(vm_object_t src, vm_object_t dst, @@ -1031,7 +1032,7 @@ swap_pager_reserve(vm_object_t object, vm_pindex_t start, vm_pindex_t size) } for (j = 0; j < n; ++j) { addr = swp_pager_meta_build(object, - start + i + j, blk + j); + start + i + j, blk + j, false); if (addr != SWAPBLK_NONE) swp_pager_update_freerange(&range, addr); } @@ -1041,35 +1042,6 @@ swap_pager_reserve(vm_object_t object, vm_pindex_t start, vm_pindex_t size) return (0); } -static bool -swp_pager_xfer_source(vm_object_t srcobject, vm_object_t dstobject, - vm_pindex_t pindex, daddr_t addr) -{ - daddr_t dstaddr __diagused; - - KASSERT((srcobject->flags & OBJ_SWAP) != 0, - ("%s: srcobject not swappable", __func__)); - KASSERT((dstobject->flags & OBJ_SWAP) != 0, - ("%s: dstobject not swappable", __func__)); - - if (swp_pager_meta_lookup(dstobject, pindex) != SWAPBLK_NONE) { - /* Caller should destroy the source block. */ - return (false); - } - - /* - * Destination has no swapblk and is not resident, transfer source. - * swp_pager_meta_build() can sleep. - */ - VM_OBJECT_WUNLOCK(srcobject); - dstaddr = swp_pager_meta_build(dstobject, pindex, addr); - KASSERT(dstaddr == SWAPBLK_NONE, - ("Unexpected destination swapblk")); - VM_OBJECT_WLOCK(srcobject); - - return (true); -} - /* * SWAP_PAGER_COPY() - copy blocks from source pager to destination pager * and destroy the source. @@ -1548,7 +1520,7 @@ swap_pager_putpages(vm_object_t object, vm_page_t *ma, int count, mreq = ma[i + j]; vm_page_aflag_clear(mreq, PGA_SWAP_FREE); addr = swp_pager_meta_build(mreq->object, mreq->pindex, - blk + j); + blk + j, false); if (addr != SWAPBLK_NONE) swp_pager_update_freerange(&range, addr); MPASS(mreq->dirty == VM_PAGE_BITS_ALL); @@ -2052,16 +2024,22 @@ swp_pager_free_empty_swblk(vm_object_t object, struct swblk *sb) uma_zfree(swblk_zone, sb); } } - + /* * SWP_PAGER_META_BUILD() - add swap block to swap meta data for object * - * The specified swapblk is added to the object's swap metadata. If - * the swapblk is not valid, it is freed instead. Any previously - * assigned swapblk is returned. + * Try to add the specified swapblk to the object's swap metadata. If + * nowait_noreplace is set, add the specified swapblk only if there is no + * previously assigned swapblk at pindex. If the swapblk is invalid, and + * replaces a valid swapblk, empty swap metadata is freed. If memory + * allocation fails, and nowait_noreplace is set, return the specified + * swapblk immediately to indicate failure; otherwise, wait and retry until + * memory allocation succeeds. Return the previously assigned swapblk, if + * any. */ static daddr_t -swp_pager_meta_build(vm_object_t object, vm_pindex_t pindex, daddr_t swapblk) +swp_pager_meta_build(vm_object_t object, vm_pindex_t pindex, daddr_t swapblk, + bool nowait_noreplace) { static volatile int swblk_zone_exhausted, swpctrie_zone_exhausted; struct swblk *sb, *sb1; @@ -2088,6 +2066,8 @@ swp_pager_meta_build(vm_object_t object, vm_pindex_t pindex, daddr_t swapblk) printf("swblk zone ok\n"); break; } + if (nowait_noreplace) + return (swapblk); VM_OBJECT_WUNLOCK(object); if (uma_zone_exhausted(swblk_zone)) { if (atomic_cmpset_int(&swblk_zone_exhausted, @@ -2118,6 +2098,10 @@ swp_pager_meta_build(vm_object_t object, vm_pindex_t pindex, daddr_t swapblk) printf("swpctrie zone ok\n"); break; } + if (nowait_noreplace) { + uma_zfree(swblk_zone, sb); + return (swapblk); + } VM_OBJECT_WUNLOCK(object); if (uma_zone_exhausted(swpctrie_zone)) { if (atomic_cmpset_int(&swpctrie_zone_exhausted, @@ -2144,14 +2128,16 @@ allocated: modpi = pindex % SWAP_META_PAGES; /* Return prior contents of metadata. */ prev_swapblk = sb->d[modpi]; - /* Enter block into metadata. */ - sb->d[modpi] = swapblk; + if (!nowait_noreplace || prev_swapblk == SWAPBLK_NONE) { + /* Enter block into metadata. */ + sb->d[modpi] = swapblk; - /* - * Free the swblk if we end up with the empty page run. - */ - if (swapblk == SWAPBLK_NONE) - swp_pager_free_empty_swblk(object, sb); + /* + * Free the swblk if we end up with the empty page run. + */ + if (swapblk == SWAPBLK_NONE) + swp_pager_free_empty_swblk(object, sb); + } return (prev_swapblk); } @@ -2168,6 +2154,7 @@ swp_pager_meta_transfer(vm_object_t srcobject, vm_object_t dstobject, { struct page_range range; struct swblk *sb; + daddr_t blk; vm_page_t m; vm_pindex_t offset, last; vm_size_t mc; @@ -2193,12 +2180,25 @@ swp_pager_meta_transfer(vm_object_t srcobject, vm_object_t dstobject, limit = last - sb->p < SWAP_META_PAGES ? last - sb->p : SWAP_META_PAGES; for (i = start; i < limit; i++) { - if (sb->d[i] == SWAPBLK_NONE) + blk = sb->d[i]; + if (blk == SWAPBLK_NONE) continue; if (dstobject == NULL || - !swp_pager_xfer_source(srcobject, dstobject, - sb->p + i - offset, sb->d[i])) { + (blk = swp_pager_meta_build(dstobject, + sb->p + i - offset, blk, true), + blk != sb->d[i] && blk != SWAPBLK_NONE)) swp_pager_update_freerange(&range, sb->d[i]); + else if (blk == sb->d[i]) { + /* + * Destination has no swapblk and is not + * resident, so transfer source. + * swp_pager_meta_build() failed memory + * allocation already, likely to sleep in retry. + */ + VM_OBJECT_WUNLOCK(srcobject); + swp_pager_meta_build(dstobject, + sb->p + i - offset, blk, false); + VM_OBJECT_WLOCK(srcobject); } if (moved != NULL) { if (m != NULL && m->pindex != pindex + i - 1) From nobody Sun Jul 7 23:47:23 2024 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 4WHP7H73Nzz5QNDk; Sun, 07 Jul 2024 23:47: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WHP7H6H9Rz4gc3; Sun, 7 Jul 2024 23:47:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720396043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k9X78hr07sZgKwAOWzweNgppgBXSPZU3MBslctjE6tg=; b=aTREN9lPxr9Dvc6KU6dlZakIsymSXXwQagJ9y5DqRH5Rc3fuy2s2CMcxS3wuGRwcV7bn+2 2BNmxqQQtAPqigNWAwWD2E59IzyBdInl754QllFqNJQNE8HXBUkZ+T0lF3qmVgVE0+rDa2 qZYfb2sKVqG7kg8b5o36hWxMvjKykHjbryER3JiUDoy57EH59N9aZPDcZvCMyDKA7N29rP PX8d/UZ8NjMuEWXbkc3VNHZiUpXtY/fCtlOxw9cVKC03+0twSL8gc8vDpA9asy9r5eVPcB 25rwTkk5CAszeup5RExmJwU3UsqPyLLUSR2jV2g+WrntmyfClMrts/Wwte6drg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720396043; a=rsa-sha256; cv=none; b=Dfh5ONTNX9a+Zw3IXd60SrbFljbnz1H2QKvYRke19G6wmWlcaH9tRFyRdAZ9FkbU4z56ko q15zzssLbHWK6afszLjbgADIhDCfrsjMUFvl+/ADCCGdfc8rrXGbxHysRdUHh65iLtKVtG ip6cYKCbbnRBaID3iQEKSDHhvnjMY6VntzjlmBEJ3pL6P/6cX8M1osDphkZFze7Sf4H9pz 5CKksbm50NZpT8bs+4ze0YiaYodI9j9PZPXieGU9saWBn74mwcoL3YWqGLfbtGdIQZDEW8 sn1YOOY6Xkt7pV7v17Yr/k90cbl4k6JwM/Q+ot0JfE2UhwpvJ/U8Dhb+wBNsMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720396043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=k9X78hr07sZgKwAOWzweNgppgBXSPZU3MBslctjE6tg=; b=cUks1gRFKhu2Hk+NEBAAwQ+wHANp6EPTieckDWNdsyLfaeq2BGOEMeFQHmou3bppbb/u2/ LyDhurZuDwPRsaUUAnrrdUTF8ve+GYlKkiT9xZ4Hn3AigoZ1y4a9lE9TgUl5jPURtqEyt4 PUyCDYwPgqpKvtT+rPyas7llow2/uTlFN8ozldFvc2kdDmfIXohIEo9xg4GrTj1lAe24yI tFk/vWXfa/3ZWodLrLfeEAF94vliRIVfpVfcFuaIRaNZrAd1bKvNCpTBR37GXzYkYACF7C pJgjwH06R3kFj21etmlpvj9CTbUPF963LKfp/9IeB/8aj6Ljp0Wup3C+YRHGNA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WHP7H5mkjzSZD; Sun, 7 Jul 2024 23:47:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 467NlNiA002103; Sun, 7 Jul 2024 23:47:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 467NlNHW002100; Sun, 7 Jul 2024 23:47:23 GMT (envelope-from git) Date: Sun, 7 Jul 2024 23:47:23 GMT Message-Id: <202407072347.467NlNHW002100@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 39733922edc4 - main - rtld: actually resolve memcpy plt 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 39733922edc43001e8750307704daa835a14b5ac Auto-Submitted: auto-generated The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=39733922edc43001e8750307704daa835a14b5ac commit 39733922edc43001e8750307704daa835a14b5ac Author: Ryan Libby AuthorDate: 2024-07-07 23:46:49 +0000 Commit: Ryan Libby CommitDate: 2024-07-07 23:46:49 +0000 rtld: actually resolve memcpy plt The call to memcpy() meant to cause plt resolution in _thr_rtld_init() was getting optimized by the compiler. Tell the compiler not to use its builtins in thr_rtld.c. We could avoid just the memcpy builtin but disabling all will be more robust against future changes. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D45891 --- lib/libthr/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libthr/Makefile b/lib/libthr/Makefile index 85c028f521a1..d3c69a7dc8b7 100644 --- a/lib/libthr/Makefile +++ b/lib/libthr/Makefile @@ -32,6 +32,10 @@ CFLAGS+=-I${SRCTOP}/lib/libthread_db CFLAGS.thr_stack.c+= -Wno-cast-align CFLAGS.rtld_malloc.c+= -Wno-cast-align +# Disable compiler builtins so that the compiler does not optimize away rtld's +# attempts to force early PLT resolution for certain functions that may be +# replaced by builtins. +CFLAGS.thr_rtld.c+= -fno-builtin CFLAGS.thr_symbols.c+= -Wno-missing-variable-declarations .if ${MK_ASAN} != "no" # False-positive ASAN error claiming the local "struct sigaction act;" is From nobody Sun Jul 7 23:47:24 2024 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 4WHP7K0cVKz5QN6F; Sun, 07 Jul 2024 23:47: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WHP7J6T61z4gYn; Sun, 7 Jul 2024 23:47:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720396044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lTLfyklUpDPpvAPLcIyFb/ypqOow4D3u8Qe3Q8PcMLw=; b=CYuEnuMyUPlcyQoMVPhmzFxeFxp19Lki8BWItSBJBOTXvh+67YXuEi0x6w2qCdgWD2kIw/ tdCFzMd3ZNRRJGT9+JxZNYdyztpGziOnHQ+oFdZCvFKnwwv/dM21h+7mmlMpk+LYp/ICnc pwh+xLNn45kZCh2PExYD0z+aq88iIeT+A5Q1Da9PHpU9mMl8soeuTKOQl1RN5HtO7h7tPk IEGzljLBY+z+tnCQ1N9ghlKdQE/M87PSUnlp2z1+wsi2prxuvcFxPCyF95FnNwHBflGNU7 mS+QTVvwIrNokE/sFqDd7tmlUcGTploZzGi85bQpXUoKJB/vwF6sSH090u0tXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720396044; a=rsa-sha256; cv=none; b=tYLzLO7HsrDnHgvAefMCnb1EKQ0lK3Dw/rrVBLgw0kFbvzkyXr+ICr84LX7x3YHAXRHwKT J8PJNl1cyLWp1y9sldYLEke2wARJFtJyet9vAAEfjkhUGmOASaAjsJesNErFRhdCJtnTor U8jXQMo69cyhRQ1clZoD/pT/1A/wK1pp2hLEKdWH4u4E71Smy7N+RcCCMc1TsWeLMIsrGL 9Ez8ZUyEqK3+L1rOEwcUXSD3cPXoDjXGJ7+a4rRTxEE5uPYmNMueobdkWfYLImW1GXfVIR ClUYFgNRUAn6k2IEpOv688af+O5n95tGZDef7PdjjcsA2mDqCitobFwODUxP1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720396044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lTLfyklUpDPpvAPLcIyFb/ypqOow4D3u8Qe3Q8PcMLw=; b=BQfe+9r7epZapoxIGWUJkhrajr/jo4iN8LBnG7iHWpct6J9JRExfkBgfF/7/J7UvrhgV7a r0HprZ4WdiS6IW3pjZ+/nP2lPlXFTHW2jF0sGLVkUAcA+D/rb54RvHMaUtohTDgdAJbMlS +plL6ce41WRSyjW+v1OQ6YlKyWnBl+8/l24UOyaLUe/VUMUi7K+fu+bch3w91jxy/BvgpF f3rFeCJx80SRTEAiSa9n2yJpBUEydk2HXBSvYULb4UHtAmLLP1gyP4QRctllD4iP43qNrv Aaufrrb1V30yECgOH2+n40biUoO9G7v1OQE90CGTAdTt4xyczEkTMrxUa9CHDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WHP7J65b4zSjN; Sun, 7 Jul 2024 23:47:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 467NlOm5002143; Sun, 7 Jul 2024 23:47:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 467NlOj6002140; Sun, 7 Jul 2024 23:47:24 GMT (envelope-from git) Date: Sun, 7 Jul 2024 23:47:24 GMT Message-Id: <202407072347.467NlOj6002140@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: f7f9a033f3ec - main - rtld: quiet gcc -Wrestrict 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f7f9a033f3ec755c8f1657103ba083294eb155d4 Auto-Submitted: auto-generated The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=f7f9a033f3ec755c8f1657103ba083294eb155d4 commit f7f9a033f3ec755c8f1657103ba083294eb155d4 Author: Ryan Libby AuthorDate: 2024-07-07 23:46:49 +0000 Commit: Ryan Libby CommitDate: 2024-07-07 23:46:49 +0000 rtld: quiet gcc -Wrestrict Reported by: GCC -Wrestrict Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D45892 --- lib/libthr/thread/thr_rtld.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libthr/thread/thr_rtld.c b/lib/libthr/thread/thr_rtld.c index 54560a2f7df2..25ecb83a11a3 100644 --- a/lib/libthr/thread/thr_rtld.c +++ b/lib/libthr/thread/thr_rtld.c @@ -220,19 +220,19 @@ _thr_rtld_init(void) struct RtldLockInfo li; struct pthread *curthread; ucontext_t *uc; - long dummy = -1; int uc_len; + char dummy[2] = {}; curthread = _get_curthread(); /* force to resolve _umtx_op PLT */ - _umtx_op_err((struct umtx *)&dummy, UMTX_OP_WAKE, 1, 0, 0); + _umtx_op_err(&dummy, UMTX_OP_WAKE, 1, 0, 0); /* force to resolve errno() PLT */ __error(); /* force to resolve memcpy PLT */ - memcpy(&dummy, &dummy, sizeof(dummy)); + memcpy(&dummy[0], &dummy[1], 1); mprotect(NULL, 0, 0); _rtld_get_stack_prot(); From nobody Sun Jul 7 23:47:25 2024 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 4WHP7L3Dzvz5QN8D; Sun, 07 Jul 2024 23:47:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WHP7L0K0dz4gWb; Sun, 7 Jul 2024 23:47:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720396046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mVKKmhjHX66I70+LMg3XOkzzmRAivPwgottr4ZI89Do=; b=EiBZzU5m/skMdMUEsVZcvkcwV06cUtUDLfcYUblAAHvN7saxbYWtKC2MVI08OKTszGh5yx D5GXm7p8AMYUIzBcPONBWl0tkMSWmhco7FSq33wcGxZ9HJG4X6rpHlycmdOjMWBgd6Zs7F v74GhzSI0Dvi63gf7oErH29qPqOwRp3Kdy6PQguOR7ltmInCEnTK17oisxTnD6Ksv7H7WB g6Uudd2fd1TNoA7uXmUVNkHHacvyP7L4pmWyRvltwsxKUAHiLqdl3BRCk1a8ewCxzjieS8 Cxzt0yNG8+jhMa5tL3uo2Lxb308MxDDboRknV1dSGe0ZhxXNgJO7Mh0oilGCvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720396046; a=rsa-sha256; cv=none; b=dAKN3fVnycUHUUbuxkyOhmzSv5A4fj6QV4GXohQ1Hdw0dnpHv6kUCymjRI1GVo8eqIdVKM 8/h5/5WxEGs1AaHvtZUhHMwt2ojFn83sKzFzXXhae5LlRrVsIg2nW92s84ikkXMsw6QNRP wtKEjB1hdW8PIskkfKXkI4igS2eockOKS1Kw907OaodYrmREnDP4MOI7wM7BlDwIfr22B0 RKodmavRv5OFHETF7RPwIitBPpH5MAJ3syxddS/bpwXI5t9CZ9NXbRGS1iDN321WyMhsmS CEPzvH6gf+Veez1IpHxV/qdRU/QgmeTVMbxb4GiGmD4wMAAuKyvBGQQ1UmQCXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720396046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mVKKmhjHX66I70+LMg3XOkzzmRAivPwgottr4ZI89Do=; b=YCBGhPPwmT0/xRaMmj+hKut6KoKqlzwr74GjkwP8z+AC6SqGQL52+d8ZtAHfuxgK1ZFEb+ fjk1P0x4IwF9piMIx6SsNEiudevTfoFd44NcgZyOrbQOxOq2PPJapciztA3PN8eFATF2sn T1VjPKAeXk1RAMRuPgTqUCZK5/FN2nMuQLwTtUbxC+DJM66rzAZeoD3HIGyw384Ivb23Nu 46KShau3UnCnhxFdasxMOAZZySvk/QVHlpbD3Lf03zYWr8OH2oWHje4UIT2IjmTCa+xu20 ZWu33pGX7s27JHMZ/XK8+N+yhe9+0p8KJqoBxRaHPhnkmQl1X6MVszd/oGg9Uw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WHP7K6n82zSR0; Sun, 7 Jul 2024 23:47:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 467NlPhg002192; Sun, 7 Jul 2024 23:47:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 467NlP0r002189; Sun, 7 Jul 2024 23:47:25 GMT (envelope-from git) Date: Sun, 7 Jul 2024 23:47:25 GMT Message-Id: <202407072347.467NlP0r002189@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 39bda097c037 - main - pci: propagate vpd read error 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 39bda097c03780e26e6a25ff59a3e8e77c77563f Auto-Submitted: auto-generated The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=39bda097c03780e26e6a25ff59a3e8e77c77563f commit 39bda097c03780e26e6a25ff59a3e8e77c77563f Author: Ryan Libby AuthorDate: 2024-07-07 23:46:58 +0000 Commit: Ryan Libby CommitDate: 2024-07-07 23:46:58 +0000 pci: propagate vpd read error On read error, we would return -1, but not handle it, causing a zero size malloc of value, and then we wouldd unconditionally write value[-1 + 1] = '\0'. This should be harmless in terms of buffer overflow because we should get a minimum non-zero size allocation from malloc, but it also effectively swallowed the error. Reported by: GCC -Wstringop-overflow Reviewed by: kib, se Differential Revision: https://reviews.freebsd.org/D45895 --- sys/dev/pci/pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 9661cfd19db7..171c6b710a32 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1190,7 +1190,7 @@ vpd_read_elem_data(struct vpd_readstate *vrs, char keyword[2], char **value, int int len; len = vpd_read_elem_head(vrs, keyword); - if (len > maxlen) + if (len < 0 || len > maxlen) return (-1); *value = vpd_read_value(vrs, len); @@ -1211,7 +1211,7 @@ vpd_fixup_cksum(struct vpd_readstate *vrs, char *rvstring, int len) } /* fetch one read-only element and return size of heading + data */ -static size_t +static int next_vpd_ro_elem(struct vpd_readstate *vrs, int maxsize) { struct pcicfg_vpd *vpd; @@ -1245,7 +1245,7 @@ next_vpd_ro_elem(struct vpd_readstate *vrs, int maxsize) } /* fetch one writable element and return size of heading + data */ -static size_t +static int next_vpd_rw_elem(struct vpd_readstate *vrs, int maxsize) { struct pcicfg_vpd *vpd;