From nobody Mon Nov 8 06:17:35 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5800F183DB0F; Mon, 8 Nov 2021 06:17:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hngrb1z0tz4nnG; Mon, 8 Nov 2021 06:17:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 238074B96; Mon, 8 Nov 2021 06:17:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A86HZTf033034; Mon, 8 Nov 2021 06:17:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A86HZ5E033033; Mon, 8 Nov 2021 06:17:35 GMT (envelope-from git) Date: Mon, 8 Nov 2021 06:17:35 GMT Message-Id: <202111080617.1A86HZ5E033033@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Guangyuan Yang Subject: git: 52dbe1a0f419 - main - find(1): Update date format reference and remove cvs(1) references List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ygy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 52dbe1a0f419b8d45b4beed56b90ff48bc12e14c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ygy (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=52dbe1a0f419b8d45b4beed56b90ff48bc12e14c commit 52dbe1a0f419b8d45b4beed56b90ff48bc12e14c Author: Felix Johnson AuthorDate: 2021-11-08 06:14:58 +0000 Commit: Guangyuan Yang CommitDate: 2021-11-08 06:14:58 +0000 find(1): Update date format reference and remove cvs(1) references cvs(1) is not installed by default. Change the date format reference to note that find(1) understands ISO8601 and RFC822 date formats. Also remove references to cvs(1). PR: 254894 MFC after: 3 days Reported by: danielsh@apache.org --- usr.bin/find/find.1 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1 index 8bc9f9d69604..72fe3c0bea06 100644 --- a/usr.bin/find/find.1 +++ b/usr.bin/find/find.1 @@ -31,7 +31,7 @@ .\" @(#)find.1 8.7 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd May 13, 2021 +.Dd November 8, 2021 .Dt FIND 1 .Os .Sh NAME @@ -659,8 +659,7 @@ In addition, if then .Ar file is instead interpreted as a direct date specification of the form -understood by -.Xr cvs 1 . +understood by ISO8601 or RFC822. Note that .Ic -newermm is equivalent to @@ -1001,7 +1000,6 @@ section below for details. .Sh SEE ALSO .Xr chflags 1 , .Xr chmod 1 , -.Xr cvs 1 , .Xr locate 1 , .Xr lsvfs 1 , .Xr whereis 1 , From nobody Mon Nov 8 09:53:47 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 09C471843969; Mon, 8 Nov 2021 09:53:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hnmf36rF9z3LFr; Mon, 8 Nov 2021 09:53:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAC79783F; Mon, 8 Nov 2021 09:53:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A89rlfU026172; Mon, 8 Nov 2021 09:53:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A89rlBW026171; Mon, 8 Nov 2021 09:53:47 GMT (envelope-from git) Date: Mon, 8 Nov 2021 09:53:47 GMT Message-Id: <202111080953.1A89rlBW026171@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wojciech Macek Subject: git: 197ff4c35bf0 - main - ossl: Add support for AES-CBC cipher List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 197ff4c35bf00fb61603592476d5213a16027987 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by wma: URL: https://cgit.FreeBSD.org/src/commit/?id=197ff4c35bf00fb61603592476d5213a16027987 commit 197ff4c35bf00fb61603592476d5213a16027987 Author: Kornel Duleba AuthorDate: 2021-11-02 11:53:22 +0000 Commit: Wojciech Macek CommitDate: 2021-11-08 09:53:31 +0000 ossl: Add support for AES-CBC cipher AES-CBC OpenSSL assembly is used underneath. The glue layer(ossl_aes.c) is based on CHACHA20 implementation. Contrary to the SHA and CHACHA20, AES OpenSSL assembly logic does not have a fallback implementation in case CPU doesn't support required instructions. Because of that CPU caps are checked during initialization and AES support is advertised only if available. The feature is available on all architectures that ossl supports: i386, amd64, arm64. The biggest advantage of this patch over existing solutions (aesni(4) and armv8crypto(4)) is that it supports SHA, allowing for ETA operations. Sponsored by: Stormshield Obtained from: Semihalf Reviewed by: jhb (previous version) Differential revision: https://reviews.freebsd.org/D32099 --- share/man/man4/ossl.4 | 4 +- sys/conf/files | 1 + sys/conf/files.amd64 | 1 + sys/conf/files.arm64 | 6 +- sys/conf/files.i386 | 1 + sys/crypto/openssl/ossl.c | 94 +++++++++++++++++------ sys/crypto/openssl/ossl.h | 36 ++++++++- sys/crypto/openssl/ossl_aarch64.c | 23 +++++- sys/crypto/openssl/ossl_aarch64.h | 31 ++++++++ sys/crypto/openssl/ossl_aes.c | 153 +++++++++++++++++++++++++++++++++++++ sys/crypto/openssl/ossl_chacha20.c | 18 ++++- sys/crypto/openssl/ossl_cipher.h | 53 +++++++++++++ sys/crypto/openssl/ossl_x86.c | 15 +++- sys/crypto/openssl/ossl_x86.h | 20 +++++ sys/modules/ossl/Makefile | 14 ++++ tests/sys/opencrypto/cryptotest.py | 2 +- 16 files changed, 436 insertions(+), 36 deletions(-) diff --git a/share/man/man4/ossl.4 b/share/man/man4/ossl.4 index 5929e46e9fe3..039ce301ac29 100644 --- a/share/man/man4/ossl.4 +++ b/share/man/man4/ossl.4 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 3, 2021 +.Dd September 24, 2021 .Dt OSSL 4 .Os .Sh NAME @@ -74,6 +74,8 @@ driver includes support for the following algorithms: .Pp .Bl -bullet -compact .It +AES-CBC +.It ChaCha20 .It ChaCha20-Poly1305 (RFC 8439) diff --git a/sys/conf/files b/sys/conf/files index 5fa918b59f62..e1ee0e9fc9ef 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -716,6 +716,7 @@ crypto/chacha20/chacha-sw.c optional crypto | ipsec | ipsec_support crypto/des/des_ecb.c optional netsmb crypto/des/des_setkey.c optional netsmb crypto/openssl/ossl.c optional ossl +crypto/openssl/ossl_aes.c optional ossl crypto/openssl/ossl_chacha20.c optional ossl crypto/openssl/ossl_poly1305.c optional ossl crypto/openssl/ossl_sha1.c optional ossl diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index 37ff6404cdba..6b51c1a5a55d 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -88,6 +88,7 @@ cddl/dev/dtrace/amd64/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/amd64/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" crypto/aesni/aeskeys_amd64.S optional aesni crypto/des/des_enc.c optional netsmb +crypto/openssl/amd64/aesni-x86_64.S optional ossl crypto/openssl/amd64/chacha-x86_64.S optional ossl crypto/openssl/amd64/poly1305-x86_64.S optional ossl crypto/openssl/amd64/sha1-x86_64.S optional ossl diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index bb356c1babc1..a2cf15de1ac0 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -115,8 +115,8 @@ armv8_crypto_wrap.o optional armv8crypto \ compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc:N-mgeneral-regs-only} -I$S/crypto/armv8/ ${WERROR} ${NO_WCAST_QUAL} -march=armv8-a+crypto ${.IMPSRC}" \ no-implicit-rule \ clean "armv8_crypto_wrap.o" -aesv8-armx.o optional armv8crypto \ - dependency "$S/crypto/openssl/aarch64/aesv8-armx.S" \ +aesv8-armx.o optional armv8crypto | ossl \ + dependency "$S/crypto/openssl/aarch64/aesv8-armx.S" \ compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc:N-mgeneral-regs-only} -I$S/crypto/armv8/ ${WERROR} ${NO_WCAST_QUAL} -march=armv8-a+crypto ${.IMPSRC}" \ no-implicit-rule \ clean "aesv8-armx.o" @@ -138,6 +138,8 @@ crypto/openssl/aarch64/sha256-armv8.S optional ossl \ compile-with "${CC} -c ${CFLAGS:N-mgeneral-regs-only} ${WERROR} ${.IMPSRC}" crypto/openssl/aarch64/sha512-armv8.S optional ossl \ compile-with "${CC} -c ${CFLAGS:N-mgeneral-regs-only} ${WERROR} ${.IMPSRC}" +crypto/openssl/aarch64/vpaes-armv8.S optional ossl \ + compile-with "${CC} -c ${CFLAGS:N-mgeneral-regs-only} ${WERROR} ${.IMPSRC}" dev/acpica/acpi_bus_if.m optional acpi dev/acpica/acpi_if.m optional acpi diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index e83bcd5a3492..0c681d6a84a0 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -15,6 +15,7 @@ cddl/dev/dtrace/i386/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/i386/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" crypto/aesni/aeskeys_i386.S optional aesni crypto/des/arch/i386/des_enc.S optional netsmb +crypto/openssl/i386/aesni-x86.S optional ossl crypto/openssl/i386/chacha-x86.S optional ossl crypto/openssl/i386/poly1305-x86.S optional ossl crypto/openssl/i386/sha1-586.S optional ossl diff --git a/sys/crypto/openssl/ossl.c b/sys/crypto/openssl/ossl.c index ad9b93dd960d..f46b5a966bb1 100644 --- a/sys/crypto/openssl/ossl.c +++ b/sys/crypto/openssl/ossl.c @@ -49,24 +49,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "cryptodev_if.h" -struct ossl_softc { - int32_t sc_cid; -}; - -struct ossl_session_hash { - struct ossl_hash_context ictx; - struct ossl_hash_context octx; - struct auth_hash *axf; - u_int mlen; -}; - -struct ossl_session { - struct ossl_session_hash hash; -}; - static MALLOC_DEFINE(M_OSSL, "ossl", "OpenSSL crypto"); static void @@ -92,7 +78,7 @@ ossl_attach(device_t dev) sc = device_get_softc(dev); - ossl_cpuid(); + ossl_cpuid(sc); sc->sc_cid = crypto_get_driverid(dev, sizeof(struct ossl_session), CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_SYNC | CRYPTOCAP_F_ACCEL_SOFTWARE); @@ -143,9 +129,34 @@ ossl_lookup_hash(const struct crypto_session_params *csp) } } +static struct ossl_cipher* +ossl_lookup_cipher(const struct crypto_session_params *csp) +{ + + switch (csp->csp_cipher_alg) { + case CRYPTO_AES_CBC: + switch (csp->csp_cipher_klen * 8) { + case 128: + case 192: + case 256: + break; + default: + return (NULL); + } + return (&ossl_cipher_aes_cbc); + case CRYPTO_CHACHA20: + if (csp->csp_cipher_klen != CHACHA_KEY_SIZE) + return (NULL); + return (&ossl_cipher_chacha20); + default: + return (NULL); + } +} + static int ossl_probesession(device_t dev, const struct crypto_session_params *csp) { + struct ossl_softc *sc = device_get_softc(dev); if ((csp->csp_flags & ~(CSP_F_SEPARATE_OUTPUT | CSP_F_SEPARATE_AAD)) != 0) @@ -156,14 +167,10 @@ ossl_probesession(device_t dev, const struct crypto_session_params *csp) return (EINVAL); break; case CSP_MODE_CIPHER: - switch (csp->csp_cipher_alg) { - case CRYPTO_CHACHA20: - if (csp->csp_cipher_klen != CHACHA_KEY_SIZE) - return (EINVAL); - break; - default: + if (csp->csp_cipher_alg != CRYPTO_CHACHA20 && !sc->has_aes) + return (EINVAL); + if (ossl_lookup_cipher(csp) == NULL) return (EINVAL); - } break; case CSP_MODE_AEAD: switch (csp->csp_cipher_alg) { @@ -213,20 +220,57 @@ ossl_newsession_hash(struct ossl_session *s, } } +static int +ossl_newsession_cipher(struct ossl_session *s, + const struct crypto_session_params *csp) +{ + struct ossl_cipher *cipher; + int error = 0; + + cipher = ossl_lookup_cipher(csp); + if (cipher == NULL) + return (EINVAL); + + s->cipher.cipher = cipher; + + if (csp->csp_cipher_key == NULL) + return (0); + + fpu_kern_enter(curthread, NULL, FPU_KERN_NOCTX); + if (cipher->set_encrypt_key != NULL) { + error = cipher->set_encrypt_key(csp->csp_cipher_key, + 8 * csp->csp_cipher_klen, &s->cipher.enc_ctx); + if (error != 0) { + fpu_kern_leave(curthread, NULL); + return (error); + } + } + if (cipher->set_decrypt_key != NULL) + error = cipher->set_decrypt_key(csp->csp_cipher_key, + 8 * csp->csp_cipher_klen, &s->cipher.dec_ctx); + fpu_kern_leave(curthread, NULL); + + return (error); +} + static int ossl_newsession(device_t dev, crypto_session_t cses, const struct crypto_session_params *csp) { struct ossl_session *s; + int error = 0; s = crypto_get_driver_session(cses); switch (csp->csp_mode) { case CSP_MODE_DIGEST: ossl_newsession_hash(s, csp); break; + case CSP_MODE_CIPHER: + error = ossl_newsession_cipher(s, csp); + break; } - return (0); + return (error); } static int @@ -320,7 +364,7 @@ ossl_process(device_t dev, struct cryptop *crp, int hint) error = ossl_process_hash(s, crp, csp); break; case CSP_MODE_CIPHER: - error = ossl_chacha20(crp, csp); + error = s->cipher.cipher->process(&s->cipher, crp, csp); break; case CSP_MODE_AEAD: if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) diff --git a/sys/crypto/openssl/ossl.h b/sys/crypto/openssl/ossl.h index 11793dca037a..4f5353818add 100644 --- a/sys/crypto/openssl/ossl.h +++ b/sys/crypto/openssl/ossl.h @@ -36,20 +36,47 @@ struct cryptop; struct crypto_session_params; +struct ossl_softc; +struct ossl_session; -int ossl_chacha20(struct cryptop *crp, - const struct crypto_session_params *csp); int ossl_chacha20_poly1305_decrypt(struct cryptop *crp, const struct crypto_session_params *csp); int ossl_chacha20_poly1305_encrypt(struct cryptop *crp, const struct crypto_session_params *csp); -void ossl_cpuid(void); +void ossl_cpuid(struct ossl_softc *sc); + +struct ossl_softc { + int32_t sc_cid; + bool has_aes; +}; /* Needs to be big enough to hold any hash context. */ struct ossl_hash_context { uint32_t dummy[61]; } __aligned(32); +struct ossl_cipher_context { + uint32_t dummy[61]; +} __aligned(32); + +struct ossl_session_hash { + struct ossl_hash_context ictx; + struct ossl_hash_context octx; + struct auth_hash *axf; + u_int mlen; +}; + +struct ossl_session_cipher { + struct ossl_cipher_context dec_ctx; + struct ossl_cipher_context enc_ctx; + struct ossl_cipher *cipher; +}; + +struct ossl_session { + struct ossl_session_cipher cipher; + struct ossl_session_hash hash; +}; + extern struct auth_hash ossl_hash_poly1305; extern struct auth_hash ossl_hash_sha1; extern struct auth_hash ossl_hash_sha224; @@ -57,4 +84,7 @@ extern struct auth_hash ossl_hash_sha256; extern struct auth_hash ossl_hash_sha384; extern struct auth_hash ossl_hash_sha512; +extern struct ossl_cipher ossl_cipher_aes_cbc; +extern struct ossl_cipher ossl_cipher_chacha20; + #endif /* !__OSSL_H__ */ diff --git a/sys/crypto/openssl/ossl_aarch64.c b/sys/crypto/openssl/ossl_aarch64.c index 2a45a848808a..e4b87a75a403 100644 --- a/sys/crypto/openssl/ossl_aarch64.c +++ b/sys/crypto/openssl/ossl_aarch64.c @@ -36,6 +36,7 @@ #include #include +#include #include /* @@ -43,8 +44,14 @@ */ unsigned int OPENSSL_armcap_P; +ossl_cipher_setkey_t aes_v8_set_encrypt_key; +ossl_cipher_setkey_t aes_v8_set_decrypt_key; + +ossl_cipher_setkey_t vpaes_set_encrypt_key; +ossl_cipher_setkey_t vpaes_set_decrypt_key; + void -ossl_cpuid(void) +ossl_cpuid(struct ossl_softc *sc) { /* SHA features */ if ((elf_hwcap & HWCAP_SHA1) != 0) @@ -59,4 +66,18 @@ ossl_cpuid(void) OPENSSL_armcap_P |= ARMV8_AES; if ((elf_hwcap & HWCAP_PMULL) != 0) OPENSSL_armcap_P |= ARMV8_PMULL; + + if ((OPENSSL_armcap_P & ARMV8_AES) == 0 && + (OPENSSL_armcap_P & ARMV7_NEON) == 0) { + sc->has_aes = false; + return; + } + sc->has_aes = true; + if (OPENSSL_armcap_P & ARMV8_AES) { + ossl_cipher_aes_cbc.set_encrypt_key = aes_v8_set_encrypt_key; + ossl_cipher_aes_cbc.set_decrypt_key = aes_v8_set_decrypt_key; + } else { + ossl_cipher_aes_cbc.set_encrypt_key = vpaes_set_encrypt_key; + ossl_cipher_aes_cbc.set_decrypt_key = vpaes_set_decrypt_key; + } } diff --git a/sys/crypto/openssl/ossl_aarch64.h b/sys/crypto/openssl/ossl_aarch64.h new file mode 100644 index 000000000000..f933f862d009 --- /dev/null +++ b/sys/crypto/openssl/ossl_aarch64.h @@ -0,0 +1,31 @@ +/* + * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef __OSSL_AARCH64__ +#define __OSSL_AARCH64__ + +#include +#include +#include + +/* aesv8-armx.S */ +ossl_cipher_encrypt_t aes_v8_cbc_encrypt; +/* vpaes-armv8.S */ +ossl_cipher_encrypt_t vpaes_cbc_encrypt; + +static void +AES_CBC_ENCRYPT(const unsigned char *in, unsigned char *out, + size_t length, const void *key, unsigned char *iv, int encrypt) +{ + if (OPENSSL_armcap_P & ARMV8_AES) + aes_v8_cbc_encrypt(in, out, length, key, iv, encrypt); + else + vpaes_cbc_encrypt(in, out, length, key, iv, encrypt); +} +#endif diff --git a/sys/crypto/openssl/ossl_aes.c b/sys/crypto/openssl/ossl_aes.c new file mode 100644 index 000000000000..93f16e7dce55 --- /dev/null +++ b/sys/crypto/openssl/ossl_aes.c @@ -0,0 +1,153 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Stormshield. + * Copyright (c) 2021 Semihalf. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include + +#include +#include + +#if defined(__amd64__) || defined(__i386__) +#include +#elif defined (__aarch64__) +#include +#endif + +static ossl_cipher_process_t ossl_aes_cbc; + +struct ossl_cipher ossl_cipher_aes_cbc = { + .type = CRYPTO_AES_CBC, + .blocksize = AES_BLOCK_LEN, + .ivsize = AES_BLOCK_LEN, + + /* Filled during initialization based on CPU caps. */ + .set_encrypt_key = NULL, + .set_decrypt_key = NULL, + .process = ossl_aes_cbc +}; + +static int +ossl_aes_cbc(struct ossl_session_cipher *s, struct cryptop *crp, + const struct crypto_session_params *csp) +{ + struct crypto_buffer_cursor cc_in, cc_out; + unsigned char block[EALG_MAX_BLOCK_LEN]; + unsigned char iv[EALG_MAX_BLOCK_LEN]; + const unsigned char *in, *inseg; + unsigned char *out, *outseg; + size_t plen, seglen, inlen, outlen; + struct ossl_cipher_context key; + struct ossl_cipher *cipher; + int blocklen, error; + bool encrypt; + + cipher = s->cipher; + encrypt = CRYPTO_OP_IS_ENCRYPT(crp->crp_op); + plen = crp->crp_payload_length; + blocklen = cipher->blocksize; + + if (plen % blocklen) + return (EINVAL); + + if (crp->crp_cipher_key != NULL) { + if (encrypt) + error = cipher->set_encrypt_key(crp->crp_cipher_key, + 8 * csp->csp_cipher_klen, &key); + else + error = cipher->set_decrypt_key(crp->crp_cipher_key, + 8 * csp->csp_cipher_klen, &key); + if (error) + return (error); + } else { + if (encrypt) + key = s->enc_ctx; + else + key = s->dec_ctx; + } + + crypto_read_iv(crp, iv); + + /* Derived from ossl_chacha20.c */ + crypto_cursor_init(&cc_in, &crp->crp_buf); + crypto_cursor_advance(&cc_in, crp->crp_payload_start); + inseg = crypto_cursor_segment(&cc_in, &inlen); + if (CRYPTO_HAS_OUTPUT_BUFFER(crp)) { + crypto_cursor_init(&cc_out, &crp->crp_obuf); + crypto_cursor_advance(&cc_out, crp->crp_payload_output_start); + } else { + cc_out = cc_in; + } + outseg = crypto_cursor_segment(&cc_out, &outlen); + + while (plen >= blocklen) { + if (inlen < blocklen) { + crypto_cursor_copydata(&cc_in, blocklen, block); + in = block; + inlen = blocklen; + } else { + in = inseg; + } + if (outlen < blocklen) { + out = block; + outlen = blocklen; + } else { + out = outseg; + } + + /* Figure out how many blocks we can encrypt/decrypt at once. */ + seglen = rounddown(MIN(plen, MIN(inlen, outlen)), blocklen); + + AES_CBC_ENCRYPT(in, out, seglen, &key, iv, encrypt); + + if (out == block) { + crypto_cursor_copyback(&cc_out, blocklen, block); + outseg = crypto_cursor_segment(&cc_out, &outlen); + } else { + crypto_cursor_advance(&cc_out, seglen); + outseg += seglen; + outlen -= seglen; + } + if (in == block) { + inseg = crypto_cursor_segment(&cc_in, &inlen); + } else { + crypto_cursor_advance(&cc_in, seglen); + inseg += seglen; + inlen -= seglen; + } + plen -= seglen; + } + + explicit_bzero(block, sizeof(block)); + explicit_bzero(iv, sizeof(iv)); + explicit_bzero(&key, sizeof(key)); + return (0); +} diff --git a/sys/crypto/openssl/ossl_chacha20.c b/sys/crypto/openssl/ossl_chacha20.c index aa125121e8b4..c21a28470a26 100644 --- a/sys/crypto/openssl/ossl_chacha20.c +++ b/sys/crypto/openssl/ossl_chacha20.c @@ -37,10 +37,24 @@ #include #include +#include #include -int -ossl_chacha20(struct cryptop *crp, const struct crypto_session_params *csp) +static ossl_cipher_process_t ossl_chacha20; + +struct ossl_cipher ossl_cipher_chacha20 = { + .type = CRYPTO_CHACHA20, + .blocksize = CHACHA_BLK_SIZE, + .ivsize = CHACHA_CTR_SIZE, + + .set_encrypt_key = NULL, + .set_decrypt_key = NULL, + .process = ossl_chacha20 +}; + +static int +ossl_chacha20(struct ossl_session_cipher *s, struct cryptop *crp, + const struct crypto_session_params *csp) { _Alignas(8) unsigned int key[CHACHA_KEY_SIZE / 4]; unsigned int counter[CHACHA_CTR_SIZE / 4]; diff --git a/sys/crypto/openssl/ossl_cipher.h b/sys/crypto/openssl/ossl_cipher.h new file mode 100644 index 000000000000..d9e6ec29aafc --- /dev/null +++ b/sys/crypto/openssl/ossl_cipher.h @@ -0,0 +1,53 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Stormshield. + * Copyright (c) 2021 Semihalf. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __OSSL_CIPHER_H__ +#define __OSSL_CIPHER_H__ + +struct ossl_session_cipher; +struct cryptop; +struct crypto_session_params; + +typedef int (ossl_cipher_setkey_t)(const unsigned char*, int, void*); +typedef int (ossl_cipher_process_t)(struct ossl_session_cipher*, struct cryptop*, + const struct crypto_session_params*); +typedef void (ossl_cipher_encrypt_t)(const unsigned char*, unsigned char*, size_t, + const void*, unsigned char*, int); + +ossl_cipher_encrypt_t ossl_aes_cbc_encrypt; + +struct ossl_cipher { + int type; + uint16_t blocksize; + uint16_t ivsize; + + ossl_cipher_setkey_t *set_encrypt_key; + ossl_cipher_setkey_t *set_decrypt_key; + ossl_cipher_process_t *process; +}; + +#endif diff --git a/sys/crypto/openssl/ossl_x86.c b/sys/crypto/openssl/ossl_x86.c index 60ff6fa0c759..a1e9a995948b 100644 --- a/sys/crypto/openssl/ossl_x86.c +++ b/sys/crypto/openssl/ossl_x86.c @@ -39,6 +39,7 @@ #include #include +#include /* * See OPENSSL_ia32cap(3). @@ -49,9 +50,13 @@ * [3] = 0 */ unsigned int OPENSSL_ia32cap_P[4]; +#define AESNI_CAPABLE (OPENSSL_ia32cap_P[1]&(1<<(57-32))) + +ossl_cipher_setkey_t aesni_set_encrypt_key; +ossl_cipher_setkey_t aesni_set_decrypt_key; void -ossl_cpuid(void) +ossl_cpuid(struct ossl_softc *sc) { uint64_t xcr0; u_int regs[4]; @@ -112,4 +117,12 @@ ossl_cpuid(void) OPENSSL_ia32cap_P[1] &= ~(CPUID2_AVX | AMDID2_XOP | CPUID2_FMA); OPENSSL_ia32cap_P[2] &= ~CPUID_STDEXT_AVX2; } + + if (!AESNI_CAPABLE) { + sc->has_aes = false; + return; + } + sc->has_aes = true; + ossl_cipher_aes_cbc.set_encrypt_key = aesni_set_encrypt_key; + ossl_cipher_aes_cbc.set_decrypt_key = aesni_set_decrypt_key; } diff --git a/sys/crypto/openssl/ossl_x86.h b/sys/crypto/openssl/ossl_x86.h new file mode 100644 index 000000000000..12bd5a4eaddb --- /dev/null +++ b/sys/crypto/openssl/ossl_x86.h @@ -0,0 +1,20 @@ +/* + * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef __OSSL_X86__ +#define __OSSL_X86__ + +#include +#include + +/* aesni-x86_64.S, aesni-x86.S */ +ossl_cipher_encrypt_t aesni_cbc_encrypt; + +#define AES_CBC_ENCRYPT aesni_cbc_encrypt +#endif diff --git a/sys/modules/ossl/Makefile b/sys/modules/ossl/Makefile index dfd82dcf6e1f..765e70a03edd 100644 --- a/sys/modules/ossl/Makefile +++ b/sys/modules/ossl/Makefile @@ -4,10 +4,12 @@ .PATH: ${SRCTOP}/sys/crypto/openssl/${MACHINE_CPUARCH} KMOD= ossl +OBJS+= ${OBJS.${MACHINE_CPUARCH}} SRCS= bus_if.h \ cryptodev_if.h \ device_if.h \ ossl.c \ + ossl_aes.c \ ossl_chacha20.c \ ossl_poly1305.c \ ossl_sha1.c \ @@ -21,9 +23,11 @@ SRCS.aarch64= \ sha1-armv8.S \ sha256-armv8.S \ sha512-armv8.S \ + vpaes-armv8.S \ ossl_aarch64.c SRCS.amd64= \ + aesni-x86_64.S \ chacha-x86_64.S \ poly1305-x86_64.S \ sha1-x86_64.S \ @@ -32,6 +36,7 @@ SRCS.amd64= \ ossl_x86.c SRCS.i386= \ + aesni-x86.S \ chacha-x86.S \ poly1305-x86.S \ sha1-586.S \ @@ -45,4 +50,13 @@ ${SRCS.aarch64:M*.S:S/S/o/}: ${.TARGET:R}.S ${CC} -c ${CFLAGS:N-mgeneral-regs-only} ${WERROR} ${PROF} ${.IMPSRC} ${CTFCONVERT_CMD} +# Based on modules/armv8crypto/Makefile. +# Clang doesn't recognize "aes*" instructions without -march set. +aesv8-armx.o: aesv8-armx.S + ${CC} -c ${CFLAGS:N-mgeneral-regs-only} ${WERROR} ${PROF} \ + -march=armv8-a+crypto ${.IMPSRC} + ${CTFCONVERT_CMD} + +OBJS.aarch64= aesv8-armx.o + .include diff --git a/tests/sys/opencrypto/cryptotest.py b/tests/sys/opencrypto/cryptotest.py index 74ce62cee33d..447a7854b246 100644 --- a/tests/sys/opencrypto/cryptotest.py +++ b/tests/sys/opencrypto/cryptotest.py @@ -50,7 +50,7 @@ def katg(base, glob): raise unittest.SkipTest("Missing %s test vectors" % (base)) return iglob(os.path.join(katdir, base, glob)) -aesmodules = [ 'cryptosoft0', 'aesni0', 'armv8crypto0', 'ccr0', 'ccp0', 'safexcel0', 'qat0' ] +aesmodules = [ 'cryptosoft0', 'aesni0', 'armv8crypto0', 'ccr0', 'ccp0', 'ossl0', 'safexcel0', 'qat0' ] shamodules = [ 'cryptosoft0', 'aesni0', 'armv8crypto0', 'ccr0', 'ccp0', 'ossl0', 'safexcel0', 'qat0' ] def GenTestCase(cname): From nobody Mon Nov 8 09:53:48 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3EA861843ABB; Mon, 8 Nov 2021 09:53:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hnmf50jFJz3L9w; Mon, 8 Nov 2021 09:53:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED844767F; Mon, 8 Nov 2021 09:53:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A89rmGl026196; Mon, 8 Nov 2021 09:53:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A89rmOq026195; Mon, 8 Nov 2021 09:53:48 GMT (envelope-from git) Date: Mon, 8 Nov 2021 09:53:48 GMT Message-Id: <202111080953.1A89rmOq026195@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wojciech Macek Subject: git: c4026909bdfe - main - ossl: Add support for ETA 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c4026909bdfef0394bd4db41d2d102f609ae92b8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by wma: URL: https://cgit.FreeBSD.org/src/commit/?id=c4026909bdfef0394bd4db41d2d102f609ae92b8 commit c4026909bdfef0394bd4db41d2d102f609ae92b8 Author: Kornel Duleba AuthorDate: 2021-11-02 11:57:20 +0000 Commit: Wojciech Macek CommitDate: 2021-11-08 09:53:36 +0000 ossl: Add support for ETA mode Now that the AES-CBC is supported we can handle ETA requests. Sponsored by: Stormshield Obtained from: Semihalf Reviewed by: jhb Differential revision: https://reviews.freebsd.org/D32100 --- sys/crypto/openssl/ossl.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/sys/crypto/openssl/ossl.c b/sys/crypto/openssl/ossl.c index f46b5a966bb1..f41ff09c371d 100644 --- a/sys/crypto/openssl/ossl.c +++ b/sys/crypto/openssl/ossl.c @@ -172,6 +172,13 @@ ossl_probesession(device_t dev, const struct crypto_session_params *csp) if (ossl_lookup_cipher(csp) == NULL) return (EINVAL); break; + case CSP_MODE_ETA: + if (!sc->has_aes || + csp->csp_cipher_alg == CRYPTO_CHACHA20 || + ossl_lookup_hash(csp) == NULL || + ossl_lookup_cipher(csp) == NULL) + return (EINVAL); + break; case CSP_MODE_AEAD: switch (csp->csp_cipher_alg) { case CRYPTO_CHACHA20_POLY1305: @@ -268,6 +275,10 @@ ossl_newsession(device_t dev, crypto_session_t cses, case CSP_MODE_CIPHER: error = ossl_newsession_cipher(s, csp); break; + case CSP_MODE_ETA: + ossl_newsession_hash(s, csp); + error = ossl_newsession_cipher(s, csp); + break; } return (error); @@ -341,6 +352,25 @@ out: return (error); } +static int +ossl_process_eta(struct ossl_session *s, struct cryptop *crp, + const struct crypto_session_params *csp) +{ + int error; + + if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) { + error = s->cipher.cipher->process(&s->cipher, crp, csp); + if (error == 0) + error = ossl_process_hash(s, crp, csp); + } else { + error = ossl_process_hash(s, crp, csp); + if (error == 0) + error = s->cipher.cipher->process(&s->cipher, crp, csp); + } + + return (error); +} + static int ossl_process(device_t dev, struct cryptop *crp, int hint) { @@ -366,6 +396,9 @@ ossl_process(device_t dev, struct cryptop *crp, int hint) case CSP_MODE_CIPHER: error = s->cipher.cipher->process(&s->cipher, crp, csp); break; + case CSP_MODE_ETA: + error = ossl_process_eta(s, crp, csp); + break; case CSP_MODE_AEAD: if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) error = ossl_chacha20_poly1305_encrypt(crp, csp); From nobody Mon Nov 8 10:20:03 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 30BB218525A3; Mon, 8 Nov 2021 10:20:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HnnDN0Xm9z3lLC; Mon, 8 Nov 2021 10:20:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E268F79BE; Mon, 8 Nov 2021 10:20:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A8AK3hD056319; Mon, 8 Nov 2021 10:20:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A8AK3gD056316; Mon, 8 Nov 2021 10:20:03 GMT (envelope-from git) Date: Mon, 8 Nov 2021 10:20:03 GMT Message-Id: <202111081020.1A8AK3gD056316@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: 55b0acc0928a - main - ifconfig.8: Add the missing option -vlanhwcsum List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 55b0acc0928ad9a4dc375802d3eb28ea1e7ebf80 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=55b0acc0928ad9a4dc375802d3eb28ea1e7ebf80 commit 55b0acc0928ad9a4dc375802d3eb28ea1e7ebf80 Author: Zhenlei Huang AuthorDate: 2021-11-08 10:10:11 +0000 Commit: Kristof Provost CommitDate: 2021-11-08 10:12:43 +0000 ifconfig.8: Add the missing option -vlanhwcsum Commit 9b776960c3276c47528435f343b3b6d0143113a8 documented a new option vlanhwcsum but missed the opposite one -vlanhwcsum. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D32887 --- sbin/ifconfig/ifconfig.8 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index f183bc3dd66f..621e22452c59 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd April 29, 2021 +.Dd November 8, 2021 .Dt IFCONFIG 8 .Os .Sh NAME @@ -587,10 +587,10 @@ Note that this must be configured on a physical interface associated with not on a .Xr vlan 4 interface itself. -.It Fl vlanmtu , vlanhwtag , vlanhwfilter , vlanhwtso +.It Fl vlanmtu , vlanhwtag , vlanhwfilter , vlanhwcsum , vlanhwtso If the driver offers user-configurable VLAN support, disable reception of extended frames, tag processing in hardware, -frame filtering in hardware, or TSO on VLAN, +frame filtering in hardware, checksum offloading, or TSO on VLAN, respectively. .It Cm vxlanhwcsum , vxlanhwtso If the driver offers user-configurable VXLAN support, enable inner checksum From nobody Mon Nov 8 11:00:48 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DD73518410A6; Mon, 8 Nov 2021 11:00:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hnp7N5zf3z4TLX; Mon, 8 Nov 2021 11:00:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADCA9105D2; Mon, 8 Nov 2021 11:00:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A8B0mfH016168; Mon, 8 Nov 2021 11:00:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A8B0mdS016167; Mon, 8 Nov 2021 11:00:48 GMT (envelope-from git) Date: Mon, 8 Nov 2021 11:00:48 GMT Message-Id: <202111081100.1A8B0mdS016167@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: 8ca6c11a7cf8 - main - if_gif: fix vnet shutdown panic List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8ca6c11a7cf834721c03cbe1a1aab0a17bae4d4d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8ca6c11a7cf834721c03cbe1a1aab0a17bae4d4d commit 8ca6c11a7cf834721c03cbe1a1aab0a17bae4d4d Author: Kristof Provost AuthorDate: 2021-11-04 17:05:58 +0000 Commit: Kristof Provost CommitDate: 2021-11-08 11:00:00 +0000 if_gif: fix vnet shutdown panic If an if_gif exists and has an address assigned inside a vnet when the vnet is shut down we failed to clean up the address, leading to a panic when we ip_destroy() and the V_in_ifaddrhashtbl is not empty. This happens because of the VNET_SYS(UN)INIT order, which means we destroy the if_gif interface before the addresses can be purged (and if_detach() does not remove addresses, it assumes this will be done by the stack teardown code). Set subsystem SI_SUB_PSEUDO just like if_bridge so the cleanup operations happen in the correct order. MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32835 --- sys/net/if_gif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index 796f427e356b..ea4b80690e50 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -214,7 +214,7 @@ vnet_gif_init(const void *unused __unused) in6_gif_init(); #endif } -VNET_SYSINIT(vnet_gif_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +VNET_SYSINIT(vnet_gif_init, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_gif_init, NULL); static void @@ -229,7 +229,7 @@ vnet_gif_uninit(const void *unused __unused) in6_gif_uninit(); #endif } -VNET_SYSUNINIT(vnet_gif_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +VNET_SYSUNINIT(vnet_gif_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_gif_uninit, NULL); static int From nobody Mon Nov 8 11:00:49 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0D3541840E44; Mon, 8 Nov 2021 11:00:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hnp7P6m6Pz4TJ6; Mon, 8 Nov 2021 11:00:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C860D106FD; Mon, 8 Nov 2021 11:00:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A8B0nW4016192; Mon, 8 Nov 2021 11:00:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A8B0nX2016191; Mon, 8 Nov 2021 11:00:49 GMT (envelope-from git) Date: Mon, 8 Nov 2021 11:00:49 GMT Message-Id: <202111081100.1A8B0nX2016191@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: 6e0755b37b20 - main - net tests: basic if_gif(4) test 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6e0755b37b20f776c7a9ac7a720db1af13966717 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6e0755b37b20f776c7a9ac7a720db1af13966717 commit 6e0755b37b20f776c7a9ac7a720db1af13966717 Author: Kristof Provost AuthorDate: 2021-11-04 16:15:19 +0000 Commit: Kristof Provost CommitDate: 2021-11-08 11:00:00 +0000 net tests: basic if_gif(4) test case MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32836 --- tests/sys/net/Makefile | 1 + tests/sys/net/if_gif.sh | 77 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) diff --git a/tests/sys/net/Makefile b/tests/sys/net/Makefile index 4771040816b7..9ff2b8c775b5 100644 --- a/tests/sys/net/Makefile +++ b/tests/sys/net/Makefile @@ -9,6 +9,7 @@ ATF_TESTS_C+= if_epair ATF_TESTS_SH+= if_bridge_test TEST_METADATA.if_bridge_test+= required_programs="python" ATF_TESTS_SH+= if_clone_test +ATF_TESTS_SH+= if_gif ATF_TESTS_SH+= if_lagg_test ATF_TESTS_SH+= if_tun_test ATF_TESTS_SH+= if_vlan diff --git a/tests/sys/net/if_gif.sh b/tests/sys/net/if_gif.sh new file mode 100644 index 000000000000..e4cf3722565a --- /dev/null +++ b/tests/sys/net/if_gif.sh @@ -0,0 +1,77 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Rubicon Communications, LLC (Netgate) +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +. $(atf_get_srcdir)/../common/vnet.subr + +atf_test_case "basic" "cleanup" +basic_head() +{ + atf_set descr 'Basic gif(4) test' + atf_set require.user root +} + +basic_body() +{ + vnet_init + if ! kldstat -q -m if_gif; then + atf_skip "This test requires if_gif" + fi + + epair=$(vnet_mkepair) + + vnet_mkjail one ${epair}a + jexec one ifconfig ${epair}a 192.0.2.1/24 up + gone=$(jexec one ifconfig gif create) + jexec one ifconfig $gone tunnel 192.0.2.1 192.0.2.2 + jexec one ifconfig $gone inet 198.51.100.1/24 198.51.100.2 up + + vnet_mkjail two ${epair}b + jexec two ifconfig ${epair}b 192.0.2.2/24 up + gtwo=$(jexec two ifconfig gif create) + jexec two ifconfig $gtwo tunnel 192.0.2.2 192.0.2.1 + jexec two ifconfig $gtwo inet 198.51.100.2/24 198.51.100.1 up + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec one ping -c 1 192.0.2.2 + + # Tunnel test + atf_check -s exit:0 -o ignore \ + jexec one ping -c 1 198.51.100.2 + atf_check -s exit:0 -o ignore \ + jexec two ping -c 1 198.51.100.1 +} + +basic_cleanup() +{ + vnet_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "basic" +} From nobody Mon Nov 8 11:06:58 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 113C61845479; Mon, 8 Nov 2021 11:06:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HnpGV6j7hz4XQN; Mon, 8 Nov 2021 11:06:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5ADF10AA3; Mon, 8 Nov 2021 11:06:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A8B6wpu020761; Mon, 8 Nov 2021 11:06:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A8B6wFb020760; Mon, 8 Nov 2021 11:06:58 GMT (envelope-from git) Date: Mon, 8 Nov 2021 11:06:58 GMT Message-Id: <202111081106.1A8B6wFb020760@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Grehan Subject: git: 561cd74b1704 - main - igc: Use hardware routine for PHY reset List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: grehan X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 561cd74b1704ab76a3286733fb43da53b6892ea4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by grehan: URL: https://cgit.FreeBSD.org/src/commit/?id=561cd74b1704ab76a3286733fb43da53b6892ea4 commit 561cd74b1704ab76a3286733fb43da53b6892ea4 Author: Peter Grehan AuthorDate: 2021-11-01 13:35:43 +0000 Commit: Peter Grehan CommitDate: 2021-11-08 13:33:10 +0000 igc: Use hardware routine for PHY reset Summary: The previously used software reset routine wasn't sufficient to reset the PHY if the bootloader hadn't left the device in an initialized state. This was seen with the onboard igc port on an 11th-gen Intel NUC. The software reset isn't used in the Linux driver so all related code has been removed. Tested on: Netgate 6100 onboard ports, a discrete PCIe I225-LM card, and an 11th-gen Intel NUC. Reported by: woodsb02 Tested by: woodsb02 (NUC) MFC after: 3 days Sponsored by: Rubicon Communications, LLC ("Netgate") Reviewed by: kbowling Differential Revision: https://reviews.freebsd.org/D32772 --- sys/dev/igc/igc_api.c | 15 --------------- sys/dev/igc/igc_api.h | 1 - sys/dev/igc/igc_hw.h | 1 - sys/dev/igc/igc_i225.c | 11 +++-------- sys/dev/igc/igc_phy.c | 37 ++----------------------------------- sys/dev/igc/igc_phy.h | 1 - 6 files changed, 5 insertions(+), 61 deletions(-) diff --git a/sys/dev/igc/igc_api.c b/sys/dev/igc/igc_api.c index cad116c2395d..6aafc9898df8 100644 --- a/sys/dev/igc/igc_api.c +++ b/sys/dev/igc/igc_api.c @@ -535,21 +535,6 @@ s32 igc_phy_hw_reset(struct igc_hw *hw) return IGC_SUCCESS; } -/** - * igc_phy_commit - Soft PHY reset - * @hw: pointer to the HW structure - * - * Performs a soft PHY reset on those that apply. This is a function pointer - * entry point called by drivers. - **/ -s32 igc_phy_commit(struct igc_hw *hw) -{ - if (hw->phy.ops.commit) - return hw->phy.ops.commit(hw); - - return IGC_SUCCESS; -} - /** * igc_set_d0_lplu_state - Sets low power link up state for D0 * @hw: pointer to the HW structure diff --git a/sys/dev/igc/igc_api.h b/sys/dev/igc/igc_api.h index a0fc9ff21166..f9064b540c7c 100644 --- a/sys/dev/igc/igc_api.h +++ b/sys/dev/igc/igc_api.h @@ -42,7 +42,6 @@ s32 igc_get_phy_info(struct igc_hw *hw); void igc_release_phy(struct igc_hw *hw); s32 igc_acquire_phy(struct igc_hw *hw); s32 igc_phy_hw_reset(struct igc_hw *hw); -s32 igc_phy_commit(struct igc_hw *hw); void igc_power_up_phy(struct igc_hw *hw); void igc_power_down_phy(struct igc_hw *hw); s32 igc_read_mac_addr(struct igc_hw *hw); diff --git a/sys/dev/igc/igc_hw.h b/sys/dev/igc/igc_hw.h index a07d2894f97a..a8323a8578a9 100644 --- a/sys/dev/igc/igc_hw.h +++ b/sys/dev/igc/igc_hw.h @@ -382,7 +382,6 @@ struct igc_phy_operations { s32 (*init_params)(struct igc_hw *); s32 (*acquire)(struct igc_hw *); s32 (*check_reset_block)(struct igc_hw *); - s32 (*commit)(struct igc_hw *); s32 (*force_speed_duplex)(struct igc_hw *); s32 (*get_info)(struct igc_hw *); s32 (*set_page)(struct igc_hw *, u16); diff --git a/sys/dev/igc/igc_i225.c b/sys/dev/igc/igc_i225.c index 75c4b5125a97..4c50daa16b79 100644 --- a/sys/dev/igc/igc_i225.c +++ b/sys/dev/igc/igc_i225.c @@ -136,7 +136,6 @@ static s32 igc_init_phy_params_i225(struct igc_hw *hw) { struct igc_phy_info *phy = &hw->phy; s32 ret_val = IGC_SUCCESS; - u32 ctrl_ext; DEBUGFUNC("igc_init_phy_params_i225"); @@ -155,10 +154,10 @@ static s32 igc_init_phy_params_i225(struct igc_hw *hw) phy->ops.acquire = igc_acquire_phy_base; phy->ops.check_reset_block = igc_check_reset_block_generic; - phy->ops.commit = igc_phy_sw_reset_generic; phy->ops.release = igc_release_phy_base; - - ctrl_ext = IGC_READ_REG(hw, IGC_CTRL_EXT); + phy->ops.reset = igc_phy_hw_reset_generic; + phy->ops.read_reg = igc_read_phy_reg_gpy; + phy->ops.write_reg = igc_write_phy_reg_gpy; /* Make sure the PHY is in a good state. Several people have reported * firmware leaving the PHY's page select register set to something @@ -169,10 +168,6 @@ static s32 igc_init_phy_params_i225(struct igc_hw *hw) if (ret_val) goto out; - IGC_WRITE_REG(hw, IGC_CTRL_EXT, ctrl_ext); - phy->ops.read_reg = igc_read_phy_reg_gpy; - phy->ops.write_reg = igc_write_phy_reg_gpy; - ret_val = igc_get_phy_id(hw); /* Verify phy id and set remaining function pointers */ switch (phy->id) { diff --git a/sys/dev/igc/igc_phy.c b/sys/dev/igc/igc_phy.c index a1d71ab15829..a6823ddf7bac 100644 --- a/sys/dev/igc/igc_phy.c +++ b/sys/dev/igc/igc_phy.c @@ -26,7 +26,6 @@ void igc_init_phy_ops_generic(struct igc_hw *hw) phy->ops.init_params = igc_null_ops_generic; phy->ops.acquire = igc_null_ops_generic; phy->ops.check_reset_block = igc_null_ops_generic; - phy->ops.commit = igc_null_ops_generic; phy->ops.force_speed_duplex = igc_null_ops_generic; phy->ops.get_info = igc_null_ops_generic; phy->ops.set_page = igc_null_set_page; @@ -147,7 +146,7 @@ s32 igc_get_phy_id(struct igc_hw *hw) return ret_val; phy->id = (u32)(phy_id << 16); - usec_delay(20); + usec_delay(200); ret_val = phy->ops.read_reg(hw, PHY_ID2, &phy_id); if (ret_val) return ret_val; @@ -155,7 +154,6 @@ s32 igc_get_phy_id(struct igc_hw *hw) phy->id |= (u32)(phy_id & PHY_REVISION_MASK); phy->revision = (u32)(phy_id & ~PHY_REVISION_MASK); - return IGC_SUCCESS; } @@ -314,7 +312,7 @@ static s32 igc_phy_setup_autoneg(struct igc_hw *hw) if ((phy->autoneg_mask & ADVERTISE_2500_FULL) && hw->phy.id == I225_I_PHY_ID) { - /* Read the MULTI GBT AN Control Register - reg 7.32 */ + /* Read the MULTI GBT AN Control Register - reg 7.32 */ ret_val = phy->ops.read_reg(hw, (STANDARD_AN_REG_MASK << MMD_DEVADDR_SHIFT) | ANEG_MULTIGBT_AN_CTRL, @@ -847,37 +845,6 @@ s32 igc_phy_has_link_generic(struct igc_hw *hw, u32 iterations, return ret_val; } -/** - * igc_phy_sw_reset_generic - PHY software reset - * @hw: pointer to the HW structure - * - * Does a software reset of the PHY by reading the PHY control register and - * setting/write the control register reset bit to the PHY. - **/ -s32 igc_phy_sw_reset_generic(struct igc_hw *hw) -{ - s32 ret_val; - u16 phy_ctrl; - - DEBUGFUNC("igc_phy_sw_reset_generic"); - - if (!hw->phy.ops.read_reg) - return IGC_SUCCESS; - - ret_val = hw->phy.ops.read_reg(hw, PHY_CONTROL, &phy_ctrl); - if (ret_val) - return ret_val; - - phy_ctrl |= MII_CR_RESET; - ret_val = hw->phy.ops.write_reg(hw, PHY_CONTROL, phy_ctrl); - if (ret_val) - return ret_val; - - usec_delay(1); - - return ret_val; -} - /** * igc_phy_hw_reset_generic - PHY hardware reset * @hw: pointer to the HW structure diff --git a/sys/dev/igc/igc_phy.h b/sys/dev/igc/igc_phy.h index 61cc46cdc583..36fa0677c3e6 100644 --- a/sys/dev/igc/igc_phy.h +++ b/sys/dev/igc/igc_phy.h @@ -18,7 +18,6 @@ s32 igc_null_set_page(struct igc_hw *hw, u16 data); s32 igc_check_downshift_generic(struct igc_hw *hw); s32 igc_check_reset_block_generic(struct igc_hw *hw); s32 igc_get_phy_id(struct igc_hw *hw); -s32 igc_phy_sw_reset_generic(struct igc_hw *hw); void igc_phy_force_speed_duplex_setup(struct igc_hw *hw, u16 *phy_ctrl); s32 igc_phy_hw_reset_generic(struct igc_hw *hw); s32 igc_phy_reset_dsp_generic(struct igc_hw *hw); From nobody Mon Nov 8 11:33:51 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3565818340D5; Mon, 8 Nov 2021 11:33:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HnpsX0Z56z4h84; Mon, 8 Nov 2021 11:33:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E78D810FAC; Mon, 8 Nov 2021 11:33:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A8BXphm060129; Mon, 8 Nov 2021 11:33:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A8BXpe8060128; Mon, 8 Nov 2021 11:33:51 GMT (envelope-from git) Date: Mon, 8 Nov 2021 11:33:51 GMT Message-Id: <202111081133.1A8BXpe8060128@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: 748a707fe609 - main - libc: fix the test List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 748a707fe6096874bb0ffbc37a59be9cbbfef1aa Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=748a707fe6096874bb0ffbc37a59be9cbbfef1aa commit 748a707fe6096874bb0ffbc37a59be9cbbfef1aa Author: Mariusz Zaborski AuthorDate: 2021-11-08 11:30:51 +0000 Commit: Mariusz Zaborski CommitDate: 2021-11-08 11:35:03 +0000 libc: fix the test Currently after cleaning the variables the environment will be always set to the intEnviron as documented in __rebuild_environ. Reported by: lwhsu@, jenkins --- lib/libc/tests/stdlib/clearenv_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/tests/stdlib/clearenv_test.c b/lib/libc/tests/stdlib/clearenv_test.c index 0c705bfece1e..40bd7f2ba0f5 100644 --- a/lib/libc/tests/stdlib/clearenv_test.c +++ b/lib/libc/tests/stdlib/clearenv_test.c @@ -136,7 +136,7 @@ ATF_TC_BODY(clearenv__environ_null, tc) { ATF_CHECK(clearenv() == 0); - ATF_CHECK(environ == NULL); + ATF_CHECK(environ != NULL); } ATF_TC_WITHOUT_HEAD(clearenv__putenv_vars); From nobody Mon Nov 8 16:22:04 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 07EC9182FC62; Mon, 8 Nov 2021 16:22:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HnxG46tzVz3sDS; Mon, 8 Nov 2021 16:22:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C293E14DDB; Mon, 8 Nov 2021 16:22:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A8GM4mB048293; Mon, 8 Nov 2021 16:22:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A8GM4HT048292; Mon, 8 Nov 2021 16:22:04 GMT (envelope-from git) Date: Mon, 8 Nov 2021 16:22:04 GMT Message-Id: <202111081622.1A8GM4HT048292@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dries Michiels Subject: git: ecf58c066cb7 - main - Complete steps 5 and 9 for new committers (driesm) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: driesm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ecf58c066cb7adde1baf227dcc7b254dbe06ebbe Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by driesm (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ecf58c066cb7adde1baf227dcc7b254dbe06ebbe commit ecf58c066cb7adde1baf227dcc7b254dbe06ebbe Author: Dries Michiels AuthorDate: 2021-11-08 13:18:29 +0000 Commit: Dries Michiels CommitDate: 2021-11-08 16:19:57 +0000 Complete steps 5 and 9 for new committers (driesm) Reviewed by: 0mp (mentor) Approved by: 0mp (mentor) Differential Revision: https://reviews.freebsd.org/D32890 --- share/misc/committers-ports.dot | 3 +++ usr.bin/calendar/calendars/calendar.freebsd | 1 + 2 files changed, 4 insertions(+) diff --git a/share/misc/committers-ports.dot b/share/misc/committers-ports.dot index b8b74f5c25a0..f8f5d47fc87e 100644 --- a/share/misc/committers-ports.dot +++ b/share/misc/committers-ports.dot @@ -98,6 +98,7 @@ demon [label="Dmitry Sivachenko\ndemon@FreeBSD.org\n2000/11/13"] dhn [label="Dennis Herrmann\ndhn@FreeBSD.org\n2009/03/03"] diizzy [label="Daniel Engberg\ndiizzy@FreeBSD.org\n2021/07/06"] dmgk [label="Dmitri Goutnik\ndmgk@FreeBSD.org\n2019/09/15"] +driesm [label="Dries Michiels\ndriesm@FreeBSD.org\n2021/11/06"] dryice [label="Dryice Dong Liu\ndryice@FreeBSD.org\n2006/12/25"] dteske [label="Devin Teske\ndteske@FreeBSD.org\n2018/03/01"] dumbbell [label="Jean-Sebastien Pedron\ndumbbell@FreeBSD.org\n2017/01/10"] @@ -304,6 +305,7 @@ znerd [label="Ernst de Haan\nznerd@FreeBSD.org\n2001/11/15"] # Group together all the mentees for a particular mentor. # Keep the list sorted by mentor login. +"0mp" -> driesm "0mp" -> nc adamw -> ahze @@ -680,6 +682,7 @@ pgollucci -> junovitch pgollucci -> sunpoet pgollucci -> swills +philip -> driesm philip -> fox philip -> koitsu diff --git a/usr.bin/calendar/calendars/calendar.freebsd b/usr.bin/calendar/calendars/calendar.freebsd index 82a167621105..1a6f9fc093f3 100644 --- a/usr.bin/calendar/calendars/calendar.freebsd +++ b/usr.bin/calendar/calendars/calendar.freebsd @@ -217,6 +217,7 @@ 05/22 Rui Paulo born in Evora, Portugal, 1986 05/22 David Naylor born in Johannesburg, South Africa, 1988 05/22 Juraj Lutter born in Trnava, Slovakia, 1979 +05/23 Dries Michiels born in Asse, Belgium, 1993 05/23 Munechika Sumikawa born in Osaka, Osaka, Japan, 1972 05/24 Duncan McLennan Barclay born in London, Middlesex, United Kingdom, 1970 05/24 Oliver Lehmann born in Karlsburg, Germany, 1981 From nobody Mon Nov 8 16:51:41 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D2B1E1841C39; Mon, 8 Nov 2021 16:51:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HnxwF5cRBz4X5l; Mon, 8 Nov 2021 16:51:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A277C151D3; Mon, 8 Nov 2021 16:51:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A8GpfdK083931; Mon, 8 Nov 2021 16:51:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A8Gpfht083930; Mon, 8 Nov 2021 16:51:41 GMT (envelope-from git) Date: Mon, 8 Nov 2021 16:51:41 GMT Message-Id: <202111081651.1A8Gpfht083930@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Randall Stewart Subject: git: 477aeb3dd479 - main - tcp: Printf should be removed. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 477aeb3dd47944fee14a2ffd8573f99e2a7af696 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rrs: URL: https://cgit.FreeBSD.org/src/commit/?id=477aeb3dd47944fee14a2ffd8573f99e2a7af696 commit 477aeb3dd47944fee14a2ffd8573f99e2a7af696 Author: Randall Stewart AuthorDate: 2021-11-08 16:49:34 +0000 Commit: Randall Stewart CommitDate: 2021-11-08 16:49:34 +0000 tcp: Printf should be removed. There is a printf when a socket option down to the CC module fails, this really should not be a printf. In fact this whole option needs to be re-thought in coordination with some other changes in the CC modules (its just not right but its ok what it does here if it fails since it will just use the ECN beta). Reviewed by: Michael Tuexen Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D32894 --- sys/netinet/tcp_stacks/rack.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 3d065ef14c86..b1927f0a17e4 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -599,7 +599,6 @@ rack_set_cc_pacing(struct tcp_rack *rack) ptr = ((struct newreno *)tp->ccv->cc_data); if (CC_ALGO(tp)->ctl_output == NULL) { /* Huh, why does new_reno no longer have a set function? */ - printf("no ctl_output for algo:%s\n", tp->cc_algo->name); goto out; } if (ptr == NULL) { @@ -618,7 +617,6 @@ rack_set_cc_pacing(struct tcp_rack *rack) opt.val = rack->r_ctl.rc_saved_beta.beta; error = CC_ALGO(tp)->ctl_output(tp->ccv, &sopt, &opt); if (error) { - printf("Error returned by ctl_output %d\n", error); goto out; } /* @@ -630,7 +628,6 @@ rack_set_cc_pacing(struct tcp_rack *rack) opt.val = rack->r_ctl.rc_saved_beta.beta_ecn; error = CC_ALGO(tp)->ctl_output(tp->ccv, &sopt, &opt); if (error) { - printf("Error returned by ctl_output %d\n", error); goto out; } /* Save off the original values for restoral */ From nobody Mon Nov 8 19:34:57 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5E8B91833B3C; Mon, 8 Nov 2021 19:34:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hp1Xd2GZjz4XVn; Mon, 8 Nov 2021 19:34:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D827176CF; Mon, 8 Nov 2021 19:34:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A8JYvcf002876; Mon, 8 Nov 2021 19:34:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A8JYvHF002875; Mon, 8 Nov 2021 19:34:57 GMT (envelope-from git) Date: Mon, 8 Nov 2021 19:34:57 GMT Message-Id: <202111081934.1A8JYvHF002875@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: b826cc3caf6a - main - hwpmc: initialize arm64 counter/interrupt state List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b826cc3caf6abc6a5d1926bd478b464938d45697 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=b826cc3caf6abc6a5d1926bd478b464938d45697 commit b826cc3caf6abc6a5d1926bd478b464938d45697 Author: Mitchell Horne AuthorDate: 2021-11-08 19:33:25 +0000 Commit: Mitchell Horne CommitDate: 2021-11-08 19:33:25 +0000 hwpmc: initialize arm64 counter/interrupt state Performance counters and overflow interrupts are assumed to be disabled by default, but this is not guaranteed. Ensure we disable both during per-cpu initialization, before enabling the PMU. Otherwise, some systems (such as the Ampere eMAG) would experience an interrupt storm upon loading the hwpmc module. Reviewed by: br MFC after: 5 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32854 --- sys/dev/hwpmc/hwpmc_arm64.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/dev/hwpmc/hwpmc_arm64.c b/sys/dev/hwpmc/hwpmc_arm64.c index 14283b22644d..14c176894c6a 100644 --- a/sys/dev/hwpmc/hwpmc_arm64.c +++ b/sys/dev/hwpmc/hwpmc_arm64.c @@ -483,6 +483,16 @@ arm64_pcpu_init(struct pmc_mdep *md, int cpu) pc->pc_hwpmcs[i + first_ri] = phw; } + /* + * Disable all counters and overflow interrupts. Upon reset they are in + * an undefined state. + * + * Don't issue an isb here, just wait for the one in arm64_pmcr_write() + * to make the writes visible. + */ + WRITE_SPECIALREG(pmcntenclr_el0, 0xffffffff); + WRITE_SPECIALREG(pmintenclr_el1, 0xffffffff); + /* Enable unit */ pmcr = arm64_pmcr_read(); pmcr |= PMCR_E; From nobody Mon Nov 8 21:02:38 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E028C184E16F; Mon, 8 Nov 2021 21:02:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hp3Tp5wNHz54qB; Mon, 8 Nov 2021 21:02:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABCF618A54; Mon, 8 Nov 2021 21:02:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A8L2c5Y022767; Mon, 8 Nov 2021 21:02:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A8L2cnw022766; Mon, 8 Nov 2021 21:02:38 GMT (envelope-from git) Date: Mon, 8 Nov 2021 21:02:38 GMT Message-Id: <202111082102.1A8L2cnw022766@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: d70ca5b00eed - main - nfsd: Fix f_bavail and f_ffree for NFSv4 when negative List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d70ca5b00eede3367ce659a03b2f9cc9729cd0dd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=d70ca5b00eede3367ce659a03b2f9cc9729cd0dd commit d70ca5b00eede3367ce659a03b2f9cc9729cd0dd Author: Rick Macklem AuthorDate: 2021-11-08 20:59:31 +0000 Commit: Rick Macklem CommitDate: 2021-11-08 20:59:31 +0000 nfsd: Fix f_bavail and f_ffree for NFSv4 when negative Since the NFS Space_available and Files_available are unsigned, the NFSv3 server sets them to 0 when negative, so that they do not appear to be large positive values for non-FreeBSD clients. This patch fixes the NFSv4 server to do the same. Found during a recent IEFT NFSv4 working group testing event. MFC after: 2 weeks --- sys/fs/nfs/nfs_commonsubs.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 98f1f3d642b3..073da425c20c 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -2514,6 +2514,17 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, } NFSCLRSTATFS_ATTRBIT(retbitp); } + /* + * Since NFS handles these values as unsigned on the + * wire, there is no way to represent negative values, + * so set them to 0. Without this, they will appear + * to be very large positive values for clients like + * Solaris10. + */ + if (fs->f_bavail < 0) + fs->f_bavail = 0; + if (fs->f_ffree < 0) + fs->f_ffree = 0; } #endif From nobody Mon Nov 8 21:21:37 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4EFB91857619; Mon, 8 Nov 2021 21:21:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hp3vk0VG5z3D6Y; Mon, 8 Nov 2021 21:21:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCD0E18E90; Mon, 8 Nov 2021 21:21:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A8LLb9I046744; Mon, 8 Nov 2021 21:21:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A8LLb2f046743; Mon, 8 Nov 2021 21:21:37 GMT (envelope-from git) Date: Mon, 8 Nov 2021 21:21:37 GMT Message-Id: <202111082121.1A8LLb2f046743@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: c048ac620f97 - main - cam_iosched: Fix a comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c048ac620f97f9cf49582437fdc541ed34e86fd8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=c048ac620f97f9cf49582437fdc541ed34e86fd8 commit c048ac620f97f9cf49582437fdc541ed34e86fd8 Author: Warner Losh AuthorDate: 2021-11-08 21:20:41 +0000 Commit: Warner Losh CommitDate: 2021-11-08 21:21:08 +0000 cam_iosched: Fix a comment Array elements were added, but this comment wasn't updated. Sponsored by: Netflix --- sys/cam/cam_iosched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/cam_iosched.c b/sys/cam/cam_iosched.c index 98ae98bc1d80..928e8095ef01 100644 --- a/sys/cam/cam_iosched.c +++ b/sys/cam/cam_iosched.c @@ -1823,7 +1823,7 @@ cam_iosched_update(struct iop_stats *iop, sbintime_t sim_latency) } } if (i == LAT_BUCKETS - 1) - iop->latencies[i]++; /* Put all > 1024ms values into the last bucket. */ + iop->latencies[i]++; /* Put all > 8192ms values into the last bucket. */ /* * Classic exponentially decaying average with a tiny alpha From nobody Tue Nov 9 00:01:47 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 381D5183C68A; Tue, 9 Nov 2021 00:01:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hp7SW6K9wz4rZL; Tue, 9 Nov 2021 00:01:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF62B1AA50; Tue, 9 Nov 2021 00:01:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A901l7h059908; Tue, 9 Nov 2021 00:01:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A901lAT059907; Tue, 9 Nov 2021 00:01:47 GMT (envelope-from git) Date: Tue, 9 Nov 2021 00:01:47 GMT Message-Id: <202111090001.1A901lAT059907@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: f8dc06303bac - main - nfsd: Fix the NFSv4.2 pNFS MDS server for NFSERR_NOSPC via LayoutError List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f8dc06303bac39be53872de7429aa54694b3f86a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=f8dc06303bac39be53872de7429aa54694b3f86a commit f8dc06303bac39be53872de7429aa54694b3f86a Author: Rick Macklem AuthorDate: 2021-11-08 23:58:00 +0000 Commit: Rick Macklem CommitDate: 2021-11-08 23:58:00 +0000 nfsd: Fix the NFSv4.2 pNFS MDS server for NFSERR_NOSPC via LayoutError If a pNFS server's DS runs out of disk space, it replies NFSERR_NOSPC to the client doing writing. For the Linux client, it then sends a LayoutError RPC to the MDS server to tell it about the error and keeps retrying, doing repeated LayoutGets to the MDS and Write RPCs to the DS. The Linux client is "stuck" until disk space on the DS is free'd up unless a subsequent LayoutGet request is sent a NFSERR_NOSPC reply. The looping problem still occurs for NFSv4.1 mounts, but no fix for this is known at this time. This patch changes the pNFS MDS server to reply to LayoutGet operations with NFSERR_NOSPC once a LayoutError reports the problem, until the DS has available space. This keeps the Linux NFSv4.2 from looping. Found during recent testing because of issues w.r.t. a DS being out of space found during a recent IEFT NFSv4 working group testing event. MFC after: 2 weeks --- sys/fs/nfs/nfs_var.h | 2 ++ sys/fs/nfs/nfsrvstate.h | 3 +++ sys/fs/nfsserver/nfs_nfsdport.c | 53 +++++++++++++++++++++++++++++++++++++++ sys/fs/nfsserver/nfs_nfsdserv.c | 4 +++ sys/fs/nfsserver/nfs_nfsdsocket.c | 3 +++ sys/fs/nfsserver/nfs_nfsdstate.c | 53 +++++++++++++++++++++++++++++++++++++-- 6 files changed, 116 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index 7e4136a6ff67..8fbf72345167 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -170,6 +170,7 @@ int nfsrv_copymr(vnode_t, vnode_t, vnode_t, struct nfsdevice *, int nfsrv_mdscopymr(char *, char *, char *, char *, int *, char *, NFSPROC_T *, struct vnode **, struct vnode **, struct pnfsdsfile **, struct nfsdevice **, struct nfsdevice **); +void nfsrv_marknospc(char *, bool); /* nfs_nfsdserv.c */ int nfsrvd_access(struct nfsrv_descript *, int, @@ -770,6 +771,7 @@ int nfsvno_listxattr(struct vnode *, uint64_t, struct ucred *, struct thread *, void nfsm_trimtrailing(struct nfsrv_descript *, struct mbuf *, char *, int, int); bool nfsrv_checkwrongsec(struct nfsrv_descript *, int, enum vtype); +void nfsrv_checknospc(void); /* nfs_commonkrpc.c */ int newnfs_nmcancelreqs(struct nfsmount *); diff --git a/sys/fs/nfs/nfsrvstate.h b/sys/fs/nfs/nfsrvstate.h index 427d5b132281..9eebeece9727 100644 --- a/sys/fs/nfs/nfsrvstate.h +++ b/sys/fs/nfs/nfsrvstate.h @@ -132,6 +132,7 @@ struct nfslayout { nfsv4stateid_t lay_stateid; nfsquad_t lay_clientid; fhandle_t lay_fh; + char lay_deviceid[NFSX_V4DEVICEID]; fsid_t lay_fsid; uint32_t lay_layoutlen; uint16_t lay_mirrorcnt; @@ -147,6 +148,7 @@ struct nfslayout { #define NFSLAY_RECALL 0x0004 #define NFSLAY_RETURNED 0x0008 #define NFSLAY_CALLB 0x0010 +#define NFSLAY_NOSPC 0x0020 /* * Structure for an NFSv4.1 session. @@ -353,6 +355,7 @@ struct nfsdevice { char *nfsdev_host; fsid_t nfsdev_mdsfsid; uint32_t nfsdev_nextdir; + bool nfsdev_nospc; vnode_t nfsdev_dsdir[0]; }; diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 806f4a8545b8..add13aca1d90 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -6949,6 +6949,59 @@ nfsrv_checkwrongsec(struct nfsrv_descript *nd, int nextop, enum vtype vtyp) return (true); } +/* + * Check DSs marked no space. + */ +void +nfsrv_checknospc(void) +{ + struct statfs *tsf; + struct nfsdevice *ds; + struct vnode **dvpp, **tdvpp, *dvp; + char *devid, *tdevid; + int cnt, error = 0, i; + + if (nfsrv_devidcnt <= 0) + return; + dvpp = mallocarray(nfsrv_devidcnt, sizeof(*dvpp), M_TEMP, M_WAITOK); + devid = malloc(nfsrv_devidcnt * NFSX_V4DEVICEID, M_TEMP, M_WAITOK); + tsf = malloc(sizeof(*tsf), M_TEMP, M_WAITOK); + + /* Get an array of the dvps for the DSs. */ + tdvpp = dvpp; + tdevid = devid; + i = 0; + NFSDDSLOCK(); + /* First, search for matches for same file system. */ + TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) { + if (ds->nfsdev_nmp != NULL && ds->nfsdev_nospc) { + if (++i > nfsrv_devidcnt) + break; + *tdvpp++ = ds->nfsdev_dvp; + NFSBCOPY(ds->nfsdev_deviceid, tdevid, NFSX_V4DEVICEID); + tdevid += NFSX_V4DEVICEID; + } + } + NFSDDSUNLOCK(); + + /* Do a VFS_STATFS() for each of the DSs and clear no space. */ + cnt = i; + tdvpp = dvpp; + tdevid = devid; + for (i = 0; i < cnt && error == 0; i++) { + dvp = *tdvpp++; + error = VFS_STATFS(dvp->v_mount, tsf); + if (error == 0 && tsf->f_bavail > 0) { + NFSD_DEBUG(1, "nfsrv_checknospc: reset nospc\n"); + nfsrv_marknospc(tdevid, false); + } + tdevid += NFSX_V4DEVICEID; + } + free(tsf, M_TEMP); + free(dvpp, M_TEMP); + free(devid, M_TEMP); +} + extern int (*nfsd_call_nfsd)(struct thread *, struct nfssvc_args *); /* diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 4d92cb61614d..a590c599518f 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -5052,6 +5052,10 @@ nfsrvd_layouterror(struct nfsrv_descript *nd, __unused int isdgram, if (stat != NFSERR_ACCES && stat != NFSERR_STALE && stat != NFSERR_NOSPC) nfsrv_delds(devid, curthread); + + /* For NFSERR_NOSPC, mark all deviceids and layouts. */ + if (stat == NFSERR_NOSPC) + nfsrv_marknospc(devid, true); } nfsmout: vput(vp); diff --git a/sys/fs/nfsserver/nfs_nfsdsocket.c b/sys/fs/nfsserver/nfs_nfsdsocket.c index fdd46b6290e9..997b7f5b88e2 100644 --- a/sys/fs/nfsserver/nfs_nfsdsocket.c +++ b/sys/fs/nfsserver/nfs_nfsdsocket.c @@ -722,6 +722,9 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag, p = curthread; + /* Check for and optionally clear the no space flags for DSs. */ + nfsrv_checknospc(); + NFSVNO_EXINIT(&vpnes); NFSVNO_EXINIT(&savevpnes); /* diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 797b9b0a466e..e6a919093738 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -6817,9 +6817,14 @@ nfsrv_layoutget(struct nfsrv_descript *nd, vnode_t vp, struct nfsexstuff *exp, NFSD_DEBUG(1, "ret layout too small\n"); return (NFSERR_TOOSMALL); } - if (*iomode == NFSLAYOUTIOMODE_RW) + if (*iomode == NFSLAYOUTIOMODE_RW) { + if ((lyp->lay_flags & NFSLAY_NOSPC) != 0) { + NFSUNLOCKLAYOUT(lhyp); + NFSD_DEBUG(1, "ret layout nospace\n"); + return (NFSERR_NOSPC); + } lyp->lay_flags |= NFSLAY_RW; - else + } else lyp->lay_flags |= NFSLAY_READ; NFSBCOPY(lyp->lay_xdr, layp, lyp->lay_layoutlen); *layoutlenp = lyp->lay_layoutlen; @@ -6892,6 +6897,7 @@ nfsrv_filelayout(struct nfsrv_descript *nd, int iomode, fhandle_t *fhp, NFSBCOPY(fhp, &lyp->lay_fh, sizeof(*fhp)); lyp->lay_clientid.qval = nd->nd_clientid.qval; lyp->lay_fsid = fs; + NFSBCOPY(devid, lyp->lay_deviceid, NFSX_V4DEVICEID); /* Fill in the xdr for the files layout. */ tl = (uint32_t *)lyp->lay_xdr; @@ -6941,6 +6947,7 @@ nfsrv_flexlayout(struct nfsrv_descript *nd, int iomode, int mirrorcnt, lyp->lay_clientid.qval = nd->nd_clientid.qval; lyp->lay_fsid = fs; lyp->lay_mirrorcnt = mirrorcnt; + NFSBCOPY(devid, lyp->lay_deviceid, NFSX_V4DEVICEID); /* Fill in the xdr for the files layout. */ tl = (uint32_t *)lyp->lay_xdr; @@ -7015,6 +7022,10 @@ nfsrv_flexlayouterr(struct nfsrv_descript *nd, uint32_t *layp, int maxcnt, if (stat != NFSERR_ACCES && stat != NFSERR_STALE && stat != NFSERR_NOSPC) nfsrv_delds(devid, p); + + /* For NFSERR_NOSPC, mark all devids and layouts. */ + if (stat == NFSERR_NOSPC) + nfsrv_marknospc(devid, true); } } } @@ -8773,3 +8784,41 @@ nfsrv_findmirroredds(struct nfsmount *nmp) } return (fndds); } + +/* + * Mark the appropriate devid and all associated layout as "out of space". + */ +void +nfsrv_marknospc(char *devid, bool setit) +{ + struct nfsdevice *ds; + struct nfslayout *lyp; + struct nfslayouthash *lhyp; + int i; + + NFSDDSLOCK(); + TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) { + if (NFSBCMP(ds->nfsdev_deviceid, devid, NFSX_V4DEVICEID) == 0) { + NFSD_DEBUG(1, "nfsrv_marknospc: devid %d\n", setit); + ds->nfsdev_nospc = setit; + } + } + NFSDDSUNLOCK(); + + for (i = 0; i < nfsrv_layouthashsize; i++) { + lhyp = &nfslayouthash[i]; + NFSLOCKLAYOUT(lhyp); + TAILQ_FOREACH(lyp, &lhyp->list, lay_list) { + if (NFSBCMP(lyp->lay_deviceid, devid, + NFSX_V4DEVICEID) == 0) { + NFSD_DEBUG(1, "nfsrv_marknospc: layout %d\n", + setit); + if (setit) + lyp->lay_flags |= NFSLAY_NOSPC; + else + lyp->lay_flags &= ~NFSLAY_NOSPC; + } + } + NFSUNLOCKLAYOUT(lhyp); + } +} From nobody Tue Nov 9 08:30:11 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B27EC1842D5E; Tue, 9 Nov 2021 08:30:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpLl73XfDz4XSb; Tue, 9 Nov 2021 08:30:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 479FA21AB1; Tue, 9 Nov 2021 08:30:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A98UB2c031506; Tue, 9 Nov 2021 08:30:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A98UBpk031503; Tue, 9 Nov 2021 08:30:11 GMT (envelope-from git) Date: Tue, 9 Nov 2021 08:30:11 GMT Message-Id: <202111090830.1A98UBpk031503@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: 7b83aad3ffab - main - stress2: Exclude the files in .git. Simplify test by using timeout(1) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b83aad3ffabe00ca68e4b2ae76294d39b853d00 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=7b83aad3ffabe00ca68e4b2ae76294d39b853d00 commit 7b83aad3ffabe00ca68e4b2ae76294d39b853d00 Author: Peter Holm AuthorDate: 2021-11-09 08:28:12 +0000 Commit: Peter Holm CommitDate: 2021-11-09 08:28:12 +0000 stress2: Exclude the files in .git. Simplify test by using timeout(1) --- tools/test/stress2/misc/gnop4.sh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tools/test/stress2/misc/gnop4.sh b/tools/test/stress2/misc/gnop4.sh index 2e4cc1a5df35..f938dd3b790b 100755 --- a/tools/test/stress2/misc/gnop4.sh +++ b/tools/test/stress2/misc/gnop4.sh @@ -55,19 +55,16 @@ mount /dev/md$mdstart.nop $mntpoint chmod 777 $mntpoint set +e -start=`date '+%s'` -(cd /usr; tar --exclude compile -cf - src) | (cd $mntpoint; tar xf -) +(cd /usr; tar --exclude compile --exclude-vcs -cf - src) | \ + (cd $mntpoint; tar xf -) cd $mntpoint/src export MAKEOBJDIRPREFIX=$mntpoint/obj p=$((`sysctl -n hw.ncpu`+ 1)) -make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 TARGET_ARCH=amd64 \ - > /dev/null & -e=$((`date '+%s'` - start)) -sleep $((15 * 60 - e)) -kill $! -wait +timeout 10m \ + make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 \ + TARGET_ARCH=amd64 > /dev/null cd / while mount | grep $mntpoint | grep -q /dev/md; do From nobody Tue Nov 9 08:41:48 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 58C6E184855E; Tue, 9 Nov 2021 08:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpM0X26HZz4bWd; Tue, 9 Nov 2021 08:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 291A521475; Tue, 9 Nov 2021 08:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A98fmrp054359; Tue, 9 Nov 2021 08:41:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A98fmR2054358; Tue, 9 Nov 2021 08:41:48 GMT (envelope-from git) Date: Tue, 9 Nov 2021 08:41:48 GMT Message-Id: <202111090841.1A98fmR2054358@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: 3576121c8b1f - main - if_stf: style(9) pass List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3576121c8b1fcaa31b3a45ea52ff83f7c5855266 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3576121c8b1fcaa31b3a45ea52ff83f7c5855266 commit 3576121c8b1fcaa31b3a45ea52ff83f7c5855266 Author: Kristof Provost AuthorDate: 2021-11-05 10:20:16 +0000 Commit: Kristof Provost CommitDate: 2021-11-09 08:39:53 +0000 if_stf: style(9) pass As stated in style(9): "Values in return statements should be enclosed in parentheses." MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32848 --- sys/net/if_stf.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index de442a133fc6..a18cf058a6e2 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -318,22 +318,22 @@ stf_encapcheck(const struct mbuf *m, int off, int proto, void *arg) sc = (struct stf_softc *)arg; if (sc == NULL) - return 0; + return (0); if ((STF2IFP(sc)->if_flags & IFF_UP) == 0) - return 0; + return (0); /* IFF_LINK0 means "no decapsulation" */ if ((STF2IFP(sc)->if_flags & IFF_LINK0) != 0) - return 0; + return (0); if (proto != IPPROTO_IPV6) - return 0; + return (0); m_copydata(m, 0, sizeof(ip), (caddr_t)&ip); if (ip.ip_v != 4) - return 0; + return (0); if (stf_getsrcifa6(STF2IFP(sc), &addr6, &mask6) != 0) return (0); @@ -344,7 +344,7 @@ stf_encapcheck(const struct mbuf *m, int off, int proto, void *arg) * success on: dst = 10.1.1.1, ia6->ia_addr = 2002:0a01:0101:... */ if (bcmp(GET_V4(&addr6), &ip.ip_dst, sizeof(ip.ip_dst)) != 0) - return 0; + return (0); /* * check if IPv4 src matches the IPv4 address derived from the @@ -359,10 +359,10 @@ stf_encapcheck(const struct mbuf *m, int off, int proto, void *arg) b = ip.ip_src; b.s_addr &= mask.s_addr; if (a.s_addr != b.s_addr) - return 0; + return (0); /* stf interface makes single side match only */ - return 32; + return (32); } static int @@ -429,7 +429,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, if ((ifp->if_flags & IFF_UP) == 0) { m_freem(m); if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return ENETDOWN; + return (ENETDOWN); } /* @@ -440,14 +440,14 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, if (stf_getsrcifa6(ifp, &addr6, &mask6) != 0) { m_freem(m); if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return ENETDOWN; + return (ENETDOWN); } if (m->m_len < sizeof(*ip6)) { m = m_pullup(m, sizeof(*ip6)); if (!m) { if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return ENOBUFS; + return (ENOBUFS); } } ip6 = mtod(m, struct ip6_hdr *); @@ -465,7 +465,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, else { m_freem(m); if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return ENETUNREACH; + return (ENETUNREACH); } bcopy(ptr, &in4, sizeof(in4)); @@ -484,7 +484,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, M_PREPEND(m, sizeof(struct ip), M_NOWAIT); if (m == NULL) { if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); - return ENOBUFS; + return (ENOBUFS); } ip = mtod(m, struct ip *); @@ -504,7 +504,7 @@ stf_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); error = ip_output(m, NULL, NULL, 0, NULL, NULL); - return error; + return (error); } static int @@ -518,9 +518,9 @@ isrfc1918addr(struct in_addr *in) (ntohl(in->s_addr) & 0xff000000) >> 24 == 10 || (ntohl(in->s_addr) & 0xfff00000) >> 16 == 172 * 256 + 16 || (ntohl(in->s_addr) & 0xffff0000) >> 16 == 192 * 256 + 168)) - return 1; + return (1); - return 0; + return (0); } static int @@ -533,10 +533,10 @@ stf_checkaddr4(struct stf_softc *sc, struct in_addr *in, struct ifnet *inifp) * 224.0.0.0/4 0.0.0.0/8 127.0.0.0/8 255.0.0.0/8 */ if (IN_MULTICAST(ntohl(in->s_addr))) - return -1; + return (-1); switch ((ntohl(in->s_addr) & 0xff000000) >> 24) { case 0: case 127: case 255: - return -1; + return (-1); } /* @@ -544,7 +544,7 @@ stf_checkaddr4(struct stf_softc *sc, struct in_addr *in, struct ifnet *inifp) * (requirement from RFC3056 section 2 1st paragraph) */ if (isrfc1918addr(in)) - return -1; + return (-1); /* * reject packets with broadcast @@ -553,7 +553,7 @@ stf_checkaddr4(struct stf_softc *sc, struct in_addr *in, struct ifnet *inifp) if ((ia4->ia_ifa.ifa_ifp->if_flags & IFF_BROADCAST) == 0) continue; if (in->s_addr == ia4->ia_broadaddr.sin_addr.s_addr) { - return -1; + return (-1); } } @@ -572,7 +572,7 @@ stf_checkaddr4(struct stf_softc *sc, struct in_addr *in, struct ifnet *inifp) return (-1); } - return 0; + return (0); } static int @@ -584,7 +584,7 @@ stf_checkaddr6(struct stf_softc *sc, struct in6_addr *in6, struct ifnet *inifp) if (IN6_IS_ADDR_6TO4(in6)) { struct in_addr in4; bcopy(GET_V4(in6), &in4, sizeof(in4)); - return stf_checkaddr4(sc, &in4, inifp); + return (stf_checkaddr4(sc, &in4, inifp)); } /* @@ -594,9 +594,9 @@ stf_checkaddr6(struct stf_softc *sc, struct in6_addr *in6, struct ifnet *inifp) * (2) to be safe against future ip6_input change. */ if (IN6_IS_ADDR_V4COMPAT(in6) || IN6_IS_ADDR_V4MAPPED(in6)) - return -1; + return (-1); - return 0; + return (0); } static int @@ -750,5 +750,5 @@ stf_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; } - return error; + return (error); } From nobody Tue Nov 9 08:41:49 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1B64518485B7; Tue, 9 Nov 2021 08:41:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpM0Y3JQ9z4bWj; Tue, 9 Nov 2021 08:41:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C1B121476; Tue, 9 Nov 2021 08:41:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A98fn6g054383; Tue, 9 Nov 2021 08:41:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A98fn9L054382; Tue, 9 Nov 2021 08:41:49 GMT (envelope-from git) Date: Tue, 9 Nov 2021 08:41:49 GMT Message-Id: <202111090841.1A98fn9L054382@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: 8e45fed3aefd - main - if_stf: enable use in vnet jails List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8e45fed3aefd00ff544efce8fedeba5e099d3d01 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8e45fed3aefd00ff544efce8fedeba5e099d3d01 commit 8e45fed3aefd00ff544efce8fedeba5e099d3d01 Author: Kristof Provost AuthorDate: 2021-11-05 11:01:37 +0000 Commit: Kristof Provost CommitDate: 2021-11-09 08:39:53 +0000 if_stf: enable use in vnet jails The cloner must be per-vnet so that cloned interfaces get destroyed when the vnet goes away. Otherwise we fail assertions in vnet_if_uninit(): panic: vnet_if_uninit:475 tailq &V_ifnet=0xfffffe01665fe070 not empty cpuid = 19 time = 1636107064 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe015d0cac60 vpanic() at vpanic+0x187/frame 0xfffffe015d0cacc0 panic() at panic+0x43/frame 0xfffffe015d0cad20 vnet_if_uninit() at vnet_if_uninit+0x7b/frame 0xfffffe015d0cad30 vnet_destroy() at vnet_destroy+0x170/frame 0xfffffe015d0cad60 prison_deref() at prison_deref+0x9b0/frame 0xfffffe015d0cadd0 sys_jail_remove() at sys_jail_remove+0x119/frame 0xfffffe015d0cae00 amd64_syscall() at amd64_syscall+0x12e/frame 0xfffffe015d0caf30 fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe015d0caf30 --- syscall (508, FreeBSD ELF64, sys_jail_remove), rip = 0x8011e920a, rsp = 0x7fffffffe788, rbp = 0x7fffffffe810 --- KDB: enter: panic MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32849 --- sys/net/if_stf.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index a18cf058a6e2..f80ba96e2f59 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -169,7 +169,8 @@ static int stf_ioctl(struct ifnet *, u_long, caddr_t); static int stf_clone_match(struct if_clone *, const char *); static int stf_clone_create(struct if_clone *, char *, size_t, caddr_t); static int stf_clone_destroy(struct if_clone *, struct ifnet *); -static struct if_clone *stf_cloner; +VNET_DEFINE_STATIC(struct if_clone *, stf_cloner); +#define V_stf_cloner VNET(stf_cloner) static const struct encap_config ipv4_encap_cfg = { .proto = IPPROTO_IPV6, @@ -281,17 +282,33 @@ stf_clone_destroy(struct if_clone *ifc, struct ifnet *ifp) return (0); } +static void +vnet_stf_init(const void *unused __unused) +{ + V_stf_cloner = if_clone_advanced(stfname, 0, stf_clone_match, + stf_clone_create, stf_clone_destroy); +} +VNET_SYSINIT(vnet_stf_init, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_stf_init, NULL); + +static void +vnet_stf_uninit(const void *unused __unused) +{ + if_clone_detach(V_stf_cloner); + V_stf_cloner = NULL; +} +VNET_SYSUNINIT(vnet_stf_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_stf_uninit, + NULL); + static int stfmodevent(module_t mod, int type, void *data) { switch (type) { case MOD_LOAD: - stf_cloner = if_clone_advanced(stfname, 0, stf_clone_match, - stf_clone_create, stf_clone_destroy); + /* Done in vnet_stf_init() */ break; case MOD_UNLOAD: - if_clone_detach(stf_cloner); + /* Done in vnet_stf_uninit() */ break; default: return (EOPNOTSUPP); From nobody Tue Nov 9 08:41:50 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C98FE1848463; Tue, 9 Nov 2021 08:41:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpM0Z4v9Bz4bM2; Tue, 9 Nov 2021 08:41:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D44421AEC; Tue, 9 Nov 2021 08:41:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A98fovI054407; Tue, 9 Nov 2021 08:41:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A98fosX054406; Tue, 9 Nov 2021 08:41:50 GMT (envelope-from git) Date: Tue, 9 Nov 2021 08:41:50 GMT Message-Id: <202111090841.1A98fosX054406@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: eb5e0755f749 - main - net tests: basic if_stf test List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eb5e0755f7496d1328d572b4d181c70b39152f08 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=eb5e0755f7496d1328d572b4d181c70b39152f08 commit eb5e0755f7496d1328d572b4d181c70b39152f08 Author: Kristof Provost AuthorDate: 2021-11-05 14:20:19 +0000 Commit: Kristof Provost CommitDate: 2021-11-09 08:39:54 +0000 net tests: basic if_stf test Test the 6to4 code. MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32850 --- tests/sys/net/Makefile | 1 + tests/sys/net/if_stf.sh | 84 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) diff --git a/tests/sys/net/Makefile b/tests/sys/net/Makefile index 9ff2b8c775b5..0eed6cf734fa 100644 --- a/tests/sys/net/Makefile +++ b/tests/sys/net/Makefile @@ -11,6 +11,7 @@ TEST_METADATA.if_bridge_test+= required_programs="python" ATF_TESTS_SH+= if_clone_test ATF_TESTS_SH+= if_gif ATF_TESTS_SH+= if_lagg_test +ATF_TESTS_SH+= if_stf ATF_TESTS_SH+= if_tun_test ATF_TESTS_SH+= if_vlan diff --git a/tests/sys/net/if_stf.sh b/tests/sys/net/if_stf.sh new file mode 100644 index 000000000000..f3ed2d744c7c --- /dev/null +++ b/tests/sys/net/if_stf.sh @@ -0,0 +1,84 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Rubicon Communications, LLC (Netgate) +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +. $(atf_get_srcdir)/../common/vnet.subr + +atf_test_case "6to4" "cleanup" +6to4_head() +{ + atf_set descr 'Test 6to4' + atf_set require.user root +} + +6to4_body() +{ + vnet_init + if ! kldstat -q -m if_stf; then + atf_skip "This test requires if_stf" + fi + if ! kldstat -q -m if_gif; then + atf_skip "This test requires if_stf" + fi + + epair=$(vnet_mkepair) + + vnet_mkjail relay ${epair}a + jexec relay ifconfig lo0 inet6 2001:db8::1/64 up + jexec relay ifconfig ${epair}a 192.0.2.1/24 up + # Simple gif to terminate 6to4 + gif=$(jexec relay ifconfig gif create) + jexec relay ifconfig $gif inet6 2002:c000:0201::1/64 up + jexec relay ifconfig $gif tunnel 192.0.2.1 192.0.2.2 + jexec relay route -6 add default -interface $gif + + vnet_mkjail client ${epair}b + jexec client ifconfig ${epair}b 192.0.2.2/24 up + stf=$(jexec client ifconfig stf create) + jexec client ifconfig $stf inet6 2002:c000:0202::1/32 up + jexec client route -6 add default 2002:c000:0201::1 + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec client ping -c 1 192.0.2.1 + # 6to4 direct + atf_check -s exit:0 -o ignore \ + jexec client ping6 -c 1 2002:c000:0201::1 + + # "Wider internet" + atf_check -s exit:0 -o ignore \ + jexec client ping6 -c 1 2001:db8::1 +} + +6to4_cleanup() +{ + vnet_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "6to4" +} From nobody Tue Nov 9 12:00:37 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 960DF1848F27; Tue, 9 Nov 2021 12:00:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpRPx3tCLz4jJR; Tue, 9 Nov 2021 12:00:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 659D82453C; Tue, 9 Nov 2021 12:00:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9C0bZ0016173; Tue, 9 Nov 2021 12:00:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9C0bpv016172; Tue, 9 Nov 2021 12:00:37 GMT (envelope-from git) Date: Tue, 9 Nov 2021 12:00:37 GMT Message-Id: <202111091200.1A9C0bpv016172@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 0bf8d5d5f434 - main - linux: Replace ifdefs in ptrace with per-architecture callbacks List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0bf8d5d5f43426321940e351939b0b712f28b08f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=0bf8d5d5f43426321940e351939b0b712f28b08f commit 0bf8d5d5f43426321940e351939b0b712f28b08f Author: Edward Tomasz Napierala AuthorDate: 2021-11-09 11:54:06 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-11-09 11:59:17 +0000 linux: Replace ifdefs in ptrace with per-architecture callbacks It's a cleanup; no (intended) functional changes. Sponsored By: EPSRC Reviewed By: kib Differential Revision: https://reviews.freebsd.org/D32888 --- sys/amd64/linux/linux.h | 6 ++- sys/amd64/linux/linux_machdep.c | 51 +++++++++++++++++++ sys/arm64/linux/linux.h | 5 ++ sys/arm64/linux/linux_machdep.c | 22 +++++++++ sys/compat/linux/linux_misc.h | 22 +++++++++ sys/compat/linux/linux_ptrace.c | 106 ++-------------------------------------- 6 files changed, 110 insertions(+), 102 deletions(-) diff --git a/sys/amd64/linux/linux.h b/sys/amd64/linux/linux.h index 16fe3793eae7..920ca98ce01b 100644 --- a/sys/amd64/linux/linux.h +++ b/sys/amd64/linux/linux.h @@ -458,11 +458,15 @@ struct linux_pt_regset { }; struct reg; +struct syscall_info; void bsd_to_linux_regset(const struct reg *b_reg, struct linux_pt_regset *l_regset); void linux_to_bsd_regset(struct reg *b_reg, const struct linux_pt_regset *l_regset); - +void linux_ptrace_get_syscall_info_machdep(const struct reg *reg, + struct syscall_info *si); +int linux_ptrace_getregs_machdep(struct thread *td, pid_t pid, + struct linux_pt_regset *l_regset); #endif /* !_AMD64_LINUX_H_ */ diff --git a/sys/amd64/linux/linux_machdep.c b/sys/amd64/linux/linux_machdep.c index e2346f68da3a..67429a1c049f 100644 --- a/sys/amd64/linux/linux_machdep.c +++ b/sys/amd64/linux/linux_machdep.c @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -95,6 +96,8 @@ __FBSDID("$FreeBSD$"); #include #include +#define LINUX_ARCH_AMD64 0xc000003e + int linux_execve(struct thread *td, struct linux_execve_args *args) { @@ -361,3 +364,51 @@ linux_to_bsd_regset(struct reg *b_reg, const struct linux_pt_regset *l_regset) b_reg->r_fs = l_regset->fs; b_reg->r_gs = l_regset->gs; } + +void +linux_ptrace_get_syscall_info_machdep(const struct reg *reg, + struct syscall_info *si) +{ + + si->arch = LINUX_ARCH_AMD64; + si->instruction_pointer = reg->r_rip; + si->stack_pointer = reg->r_rsp; +} + +int +linux_ptrace_getregs_machdep(struct thread *td, pid_t pid, + struct linux_pt_regset *l_regset) +{ + struct ptrace_lwpinfo lwpinfo; + struct pcb *pcb; + int error; + + pcb = td->td_pcb; + if (td == curthread) + update_pcb_bases(pcb); + + l_regset->fs_base = pcb->pcb_fsbase; + l_regset->gs_base = pcb->pcb_gsbase; + + error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); + if (error != 0) { + linux_msg(td, "PT_LWPINFO failed with error %d", error); + return (error); + } + if ((lwpinfo.pl_flags & PL_FLAG_SCE) != 0) { + /* + * Undo the mangling done in exception.S:fast_syscall_common(). + */ + l_regset->r10 = l_regset->rcx; + } + if ((lwpinfo.pl_flags & (PL_FLAG_SCE | PL_FLAG_SCX)) != 0) { + /* + * In Linux, the syscall number - passed to the syscall + * as rax - is preserved in orig_rax; rax gets overwritten + * with syscall return value. + */ + l_regset->orig_rax = lwpinfo.pl_syscall_code; + } + + return (0); +} diff --git a/sys/arm64/linux/linux.h b/sys/arm64/linux/linux.h index 05e5bd189b36..d43795a71a83 100644 --- a/sys/arm64/linux/linux.h +++ b/sys/arm64/linux/linux.h @@ -321,10 +321,15 @@ struct linux_pt_regset { }; struct reg; +struct syscall_info; void bsd_to_linux_regset(const struct reg *b_reg, struct linux_pt_regset *l_regset); void linux_to_bsd_regset(struct reg *b_reg, const struct linux_pt_regset *l_regset); +void linux_ptrace_get_syscall_info_machdep(const struct reg *reg, + struct syscall_info *si); +int linux_ptrace_getregs_machdep(struct thread *td, pid_t pid, + struct linux_pt_regset *l_regset); #endif /* _ARM64_LINUX_H_ */ diff --git a/sys/arm64/linux/linux_machdep.c b/sys/arm64/linux/linux_machdep.c index 0bcc05ff06de..89b7099dc752 100644 --- a/sys/arm64/linux/linux_machdep.c +++ b/sys/arm64/linux/linux_machdep.c @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -50,6 +51,8 @@ __FBSDID("$FreeBSD$"); #include #include +#define LINUX_ARCH_AARCH64 0xc00000b7 + /* DTrace init */ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); @@ -158,3 +161,22 @@ linux_to_bsd_regset(struct reg *b_reg, const struct linux_pt_regset *l_regset) b_reg->elr = l_regset->pc; b_reg->spsr = l_regset->cpsr; } + +void +linux_ptrace_get_syscall_info_machdep(const struct reg *reg, + struct syscall_info *si) +{ + + si->arch = LINUX_ARCH_AARCH64; + si->instruction_pointer = reg->lr; + si->stack_pointer = reg->sp; +} + +int +linux_ptrace_getregs_machdep(struct thread *td __unused, pid_t pid __unused, + struct linux_pt_regset *l_regset __unused) +{ + + return (0); +} + diff --git a/sys/compat/linux/linux_misc.h b/sys/compat/linux/linux_misc.h index bf8f3dd2f0cd..3bfc9843cda2 100644 --- a/sys/compat/linux/linux_misc.h +++ b/sys/compat/linux/linux_misc.h @@ -159,4 +159,26 @@ int linux_ptrace_status(struct thread *td, int pid, int status); void linux_to_bsd_waitopts(int options, int *bsdopts); struct thread *linux_tdfind(struct thread *, lwpid_t, pid_t); +struct syscall_info { + uint8_t op; + uint32_t arch; + uint64_t instruction_pointer; + uint64_t stack_pointer; + union { + struct { + uint64_t nr; + uint64_t args[6]; + } entry; + struct { + int64_t rval; + uint8_t is_error; + } exit; + struct { + uint64_t nr; + uint64_t args[6]; + uint32_t ret_data; + } seccomp; + }; +}; + #endif /* _LINUX_MISC_H_ */ diff --git a/sys/compat/linux/linux_ptrace.c b/sys/compat/linux/linux_ptrace.c index 5910e4ec3d4f..4e171c77e8ab 100644 --- a/sys/compat/linux/linux_ptrace.c +++ b/sys/compat/linux/linux_ptrace.c @@ -107,9 +107,6 @@ __FBSDID("$FreeBSD$"); #define LINUX_PTRACE_PEEKUSER_CS 136 #define LINUX_PTRACE_PEEKUSER_DS 184 -#define LINUX_ARCH_AMD64 0xc000003e -#define LINUX_ARCH_AARCH64 0xc00000b7 - static int map_signum(int lsig, int *bsigp) { @@ -169,28 +166,6 @@ linux_ptrace_status(struct thread *td, pid_t pid, int status) return (status); } -struct syscall_info { - uint8_t op; - uint32_t arch; - uint64_t instruction_pointer; - uint64_t stack_pointer; - union { - struct { - uint64_t nr; - uint64_t args[6]; - } entry; - struct { - int64_t rval; - uint8_t is_error; - } exit; - struct { - uint64_t nr; - uint64_t args[6]; - uint32_t ret_data; - } seccomp; - }; -}; - static int linux_ptrace_peek(struct thread *td, pid_t pid, void *addr, void *data) { @@ -345,10 +320,6 @@ linux_ptrace_getregs(struct thread *td, pid_t pid, void *data) { struct reg b_reg; struct linux_pt_regset l_regset; -#ifdef __amd64__ - struct ptrace_lwpinfo lwpinfo; - struct pcb *pcb; -#endif int error; error = kern_ptrace(td, PT_GETREGS, pid, &b_reg, 0); @@ -356,35 +327,9 @@ linux_ptrace_getregs(struct thread *td, pid_t pid, void *data) return (error); bsd_to_linux_regset(&b_reg, &l_regset); - -#ifdef __amd64__ - pcb = td->td_pcb; - if (td == curthread) - update_pcb_bases(pcb); - - l_regset.fs_base = pcb->pcb_fsbase; - l_regset.gs_base = pcb->pcb_gsbase; - - error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); - if (error != 0) { - linux_msg(td, "PT_LWPINFO failed with error %d", error); + error = linux_ptrace_getregs_machdep(td, pid, &l_regset); + if (error != 0) return (error); - } - if (lwpinfo.pl_flags & PL_FLAG_SCE) { - /* - * Undo the mangling done in exception.S:fast_syscall_common(). - */ - l_regset.r10 = l_regset.rcx; - } - if (lwpinfo.pl_flags & (PL_FLAG_SCE | PL_FLAG_SCX)) { - /* - * In Linux, the syscall number - passed to the syscall - * as rax - is preserved in orig_rax; rax gets overwritten - * with syscall return value. - */ - l_regset.orig_rax = lwpinfo.pl_syscall_code; - } -#endif error = copyout(&l_regset, (void *)data, sizeof(l_regset)); return (error); @@ -411,10 +356,6 @@ linux_ptrace_getregset_prstatus(struct thread *td, pid_t pid, l_ulong data) struct reg b_reg; struct linux_pt_regset l_regset; struct iovec iov; -#ifdef __amd64__ - struct ptrace_lwpinfo lwpinfo; - struct pcb *pcb; -#endif size_t len; int error; @@ -429,36 +370,9 @@ linux_ptrace_getregset_prstatus(struct thread *td, pid_t pid, l_ulong data) return (error); bsd_to_linux_regset(&b_reg, &l_regset); - -#ifdef __amd64__ - pcb = td->td_pcb; - if (td == curthread) - update_pcb_bases(pcb); - - l_regset.fs_base = pcb->pcb_fsbase; - l_regset.gs_base = pcb->pcb_gsbase; - - error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); - if (error != 0) { - linux_msg(td, "PT_LWPINFO failed with error %d", error); + error = linux_ptrace_getregs_machdep(td, pid, &l_regset); + if (error != 0) return (error); - } - if (lwpinfo.pl_flags & PL_FLAG_SCE) { - /* - * Undo the mangling done in exception.S:fast_syscall_common(). - */ - l_regset.r10 = l_regset.rcx; - } - - if (lwpinfo.pl_flags & (PL_FLAG_SCE | PL_FLAG_SCX)) { - /* - * In Linux, the syscall number - passed to the syscall - * as rax - is preserved in orig_rax; rax gets overwritten - * with syscall return value. - */ - l_regset.orig_rax = lwpinfo.pl_syscall_code; - } -#endif len = MIN(iov.iov_len, sizeof(l_regset)); error = copyout(&l_regset, (void *)iov.iov_base, len); @@ -582,17 +496,7 @@ linux_ptrace_get_syscall_info(struct thread *td, pid_t pid, if (error != 0) return (error); -#if defined(__amd64__) - si.arch = LINUX_ARCH_AMD64; - si.instruction_pointer = b_reg.r_rip; - si.stack_pointer = b_reg.r_rsp; -#elif defined(__aarch64__) - si.arch = LINUX_ARCH_AARCH64; - si.instruction_pointer = b_reg.lr; - si.stack_pointer = b_reg.sp; -#else -#error "unknown architecture" -#endif + linux_ptrace_get_syscall_info_machdep(&b_reg, &si); len = MIN(len, sizeof(si)); error = copyout(&si, (void *)data, len); From nobody Tue Nov 9 15:14:51 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C2F64183BDFB; Tue, 9 Nov 2021 15:14:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpWk3590zz4lr8; Tue, 9 Nov 2021 15:14:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90F3127296; Tue, 9 Nov 2021 15:14:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9FEpoT073554; Tue, 9 Nov 2021 15:14:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9FEpH6073553; Tue, 9 Nov 2021 15:14:51 GMT (envelope-from git) Date: Tue, 9 Nov 2021 15:14:51 GMT Message-Id: <202111091514.1A9FEpH6073553@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 782cd815e1ab - main - etherswitch/felix: remove unused function List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 782cd815e1ab594d87e01f0a3d47a75b1b735aff Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=782cd815e1ab594d87e01f0a3d47a75b1b735aff commit 782cd815e1ab594d87e01f0a3d47a75b1b735aff Author: Bjoern A. Zeeb AuthorDate: 2021-11-09 15:01:46 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-09 15:08:53 +0000 etherswitch/felix: remove unused function Remove unused file-local static function felix_phyforport() which was missed in 29cf6a79acb7 to avoid compile time warning. Reviewed by: Kornel Duleba (mindal semihalf.com) Differential Revision: https://reviews.freebsd.org/D32906 --- sys/dev/etherswitch/felix/felix.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/sys/dev/etherswitch/felix/felix.c b/sys/dev/etherswitch/felix/felix.c index a80f4f8d15ae..3ccc4b766877 100644 --- a/sys/dev/etherswitch/felix/felix.c +++ b/sys/dev/etherswitch/felix/felix.c @@ -96,7 +96,6 @@ static void felix_set_port_cfg(felix_softc_t, etherswitch_port_t *); static bool felix_is_phyport(felix_softc_t, int); static struct mii_data *felix_miiforport(felix_softc_t, unsigned int); -static int felix_phyforport(felix_softc_t, int); static struct felix_pci_id felix_pci_ids[] = { {PCI_VENDOR_FREESCALE, FELIX_DEV_ID, FELIX_DEV_NAME}, @@ -999,18 +998,6 @@ felix_is_phyport(felix_softc_t sc, int port) return (!sc->ports[port].fixed_port); } -static int -felix_phyforport(felix_softc_t sc, int phy) -{ - int port; - - for (port = 0; port < sc->info.es_nports; port++) { - if (sc->ports[port].phyaddr == phy) - return (port); - } - return (-1); -} - static struct mii_data* felix_miiforport(felix_softc_t sc, unsigned int port) { From nobody Tue Nov 9 15:36:01 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9D3CC18486B9; Tue, 9 Nov 2021 15:36:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpXBT3v5Pz4tYd; Tue, 9 Nov 2021 15:36:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 669582752A; Tue, 9 Nov 2021 15:36:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9Fa1Ud099850; Tue, 9 Nov 2021 15:36:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9Fa1NS099849; Tue, 9 Nov 2021 15:36:01 GMT (envelope-from git) Date: Tue, 9 Nov 2021 15:36:01 GMT Message-Id: <202111091536.1A9Fa1NS099849@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: 20d59403961d - main - kernel: deprecate Internet Class A/B/C List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 20d59403961d531467cfab22163f49c131cc8b55 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=20d59403961d531467cfab22163f49c131cc8b55 commit 20d59403961d531467cfab22163f49c131cc8b55 Author: Mike Karels AuthorDate: 2021-10-27 03:01:09 +0000 Commit: Mike Karels CommitDate: 2021-11-09 15:32:38 +0000 kernel: deprecate Internet Class A/B/C Hide historical Class A/B/C macros unless IN_HISTORICAL_NETS is defined; define it for user level. Define IN_MULTICAST separately from IN_CLASSD, and use it in pf instead of IN_CLASSD. Stop using class for setting default masks when not specified; instead, define new default mask (24 bits). Warn when an Internet address is set without a mask. MFC after: 1 month Reviewed by: cy Differential Revision: https://reviews.freebsd.org/D32708 --- sys/contrib/ipfilter/netinet/fil.c | 2 +- sys/netinet/in.c | 19 +++++++++---------- sys/netinet/in.h | 22 +++++++++++++++++----- sys/nfs/bootp_subr.c | 16 ++++++++-------- 4 files changed, 35 insertions(+), 24 deletions(-) diff --git a/sys/contrib/ipfilter/netinet/fil.c b/sys/contrib/ipfilter/netinet/fil.c index c04015c2b41e..89f50c261474 100644 --- a/sys/contrib/ipfilter/netinet/fil.c +++ b/sys/contrib/ipfilter/netinet/fil.c @@ -1715,7 +1715,7 @@ ipf_pr_ipv4hdr(fin) fin->fin_crc += fi->fi_saddr; fi->fi_daddr = ip->ip_dst.s_addr; fin->fin_crc += fi->fi_daddr; - if (IN_CLASSD(ntohl(fi->fi_daddr))) + if (IN_MULTICAST(ntohl(fi->fi_daddr))) fin->fin_flx |= FI_MULTICAST|FI_MBCAST; /* diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 8eb20f0f2d27..6bc4f638a98a 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -449,18 +449,17 @@ in_aifaddr_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, struct thread *td) ia->ia_sockmask = *mask; ia->ia_subnetmask = ntohl(ia->ia_sockmask.sin_addr.s_addr); } else { - in_addr_t i = ntohl(addr->sin_addr.s_addr); - /* - * Be compatible with network classes, if netmask isn't - * supplied, guess it based on classes. + * If netmask isn't supplied, use default for now. + * This is deprecated for interfaces other than loopback + * or point-to-point; warn in other cases. In the future + * we should return an error rather than warning. */ - if (IN_CLASSA(i)) - ia->ia_subnetmask = IN_CLASSA_NET; - else if (IN_CLASSB(i)) - ia->ia_subnetmask = IN_CLASSB_NET; - else - ia->ia_subnetmask = IN_CLASSC_NET; + if ((ifp->if_flags & (IFF_POINTOPOINT | IFF_LOOPBACK)) == 0) + printf("%s: set address: WARNING: network mask" + " should be specified; using default mask\n", + ifp->if_xname); + ia->ia_subnetmask = IN_NETMASK_DEFAULT; ia->ia_sockmask.sin_addr.s_addr = htonl(ia->ia_subnetmask); } ia->ia_subnet = ntohl(addr->sin_addr.s_addr) & ia->ia_subnetmask; diff --git a/sys/netinet/in.h b/sys/netinet/in.h index 0506f1739e9b..92d150701422 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -342,10 +342,15 @@ __END_DECLS #define IPPORT_MAX 65535 /* - * Definitions of bits in internet address integers. - * On subnets, the decomposition of addresses to host and net parts - * is done according to subnet mask, not the masks here. + * Historical definitions of bits in internet address integers + * (pre-CIDR). Class A/B/C are long obsolete, and now deprecated. + * Hide these definitions from the kernel unless IN_HISTORICAL_NETS + * is defined. Provide the historical definitions to user level for now. */ +#ifndef _KERNEL +#define IN_HISTORICAL_NETS +#endif +#ifdef IN_HISTORICAL_NETS #define IN_CLASSA(i) (((in_addr_t)(i) & 0x80000000) == 0) #define IN_CLASSA_NET 0xff000000 #define IN_CLASSA_NSHIFT 24 @@ -362,12 +367,17 @@ __END_DECLS #define IN_CLASSC_NET 0xffffff00 #define IN_CLASSC_NSHIFT 8 #define IN_CLASSC_HOST 0x000000ff +#endif /* IN_HISTORICAL_NETS */ + +#define IN_NETMASK_DEFAULT 0xffffff00 /* mask when forced to guess */ -#define IN_CLASSD(i) (((in_addr_t)(i) & 0xf0000000) == 0xe0000000) +#define IN_MULTICAST(i) (((in_addr_t)(i) & 0xf0000000) == 0xe0000000) +#ifdef IN_HISTORICAL_NETS +#define IN_CLASSD(i) IN_MULTICAST(i) #define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */ #define IN_CLASSD_NSHIFT 28 /* net and host fields, but */ #define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */ -#define IN_MULTICAST(i) IN_CLASSD(i) +#endif /* IN_HISTORICAL_NETS */ #define IN_EXPERIMENTAL(i) (((in_addr_t)(i) & 0xf0000000) == 0xf0000000) #define IN_BADCLASS(i) (((in_addr_t)(i) & 0xf0000000) == 0xf0000000) @@ -398,7 +408,9 @@ __END_DECLS #define INADDR_ALLMDNS_GROUP ((in_addr_t)0xe00000fb) /* 224.0.0.251 */ #define INADDR_MAX_LOCAL_GROUP ((in_addr_t)0xe00000ff) /* 224.0.0.255 */ +#ifdef IN_HISTORICAL_NETS #define IN_LOOPBACKNET 127 /* official! */ +#endif /* IN_HISTORICAL_NETS */ #define IN_RFC3021_MASK ((in_addr_t)0xfffffffe) diff --git a/sys/nfs/bootp_subr.c b/sys/nfs/bootp_subr.c index 2386a23084da..a6dfbe0334f8 100644 --- a/sys/nfs/bootp_subr.c +++ b/sys/nfs/bootp_subr.c @@ -654,7 +654,7 @@ bootpc_call(struct bootpc_globalcontext *gctx, struct thread *td) error, (int )bootp_so->so_state); /* Set netmask to 255.0.0.0 */ - sin->sin_addr.s_addr = htonl(IN_CLASSA_NET); + sin->sin_addr.s_addr = htonl(0xff000000); error = ifioctl(bootp_so, SIOCAIFADDR, (caddr_t)ifra, td); if (error != 0) @@ -882,7 +882,7 @@ bootpc_fakeup_interface(struct bootpc_ifcontext *ifctx, struct thread *td) clear_sinaddr(sin); sin = (struct sockaddr_in *)&ifra->ifra_mask; clear_sinaddr(sin); - sin->sin_addr.s_addr = htonl(IN_CLASSA_NET); + sin->sin_addr.s_addr = htonl(0xff000000); sin = (struct sockaddr_in *)&ifra->ifra_broadaddr; clear_sinaddr(sin); sin->sin_addr.s_addr = htonl(INADDR_BROADCAST); @@ -1485,12 +1485,12 @@ bootpc_decode_reply(struct nfsv3_diskless *nd, struct bootpc_ifcontext *ifctx, printf("\n"); if (ifctx->gotnetmask == 0) { - if (IN_CLASSA(ntohl(ifctx->myaddr.sin_addr.s_addr))) - ifctx->netmask.sin_addr.s_addr = htonl(IN_CLASSA_NET); - else if (IN_CLASSB(ntohl(ifctx->myaddr.sin_addr.s_addr))) - ifctx->netmask.sin_addr.s_addr = htonl(IN_CLASSB_NET); - else - ifctx->netmask.sin_addr.s_addr = htonl(IN_CLASSC_NET); + /* + * If there is no netmask, use a default, but we really + * need the right mask from the server. + */ + printf("%s: no netmask received!\n", ifctx->ireq.ifr_name); + ifctx->netmask.sin_addr.s_addr = htonl(IN_NETMASK_DEFAULT); } } From nobody Tue Nov 9 15:36:02 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 041DB184885E; Tue, 9 Nov 2021 15:36:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpXBV6Qcfz4tYk; Tue, 9 Nov 2021 15:36:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9BBC02778C; Tue, 9 Nov 2021 15:36:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9Fa2GL099874; Tue, 9 Nov 2021 15:36:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9Fa29Q099873; Tue, 9 Nov 2021 15:36:02 GMT (envelope-from git) Date: Tue, 9 Nov 2021 15:36:02 GMT Message-Id: <202111091536.1A9Fa29Q099873@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: d8237b955528 - main - ifconfig: warn if setting an Internet address without mask List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d8237b95552807e937fc389c7e2237679ef0c984 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=d8237b95552807e937fc389c7e2237679ef0c984 commit d8237b95552807e937fc389c7e2237679ef0c984 Author: Mike Karels AuthorDate: 2021-10-28 14:32:31 +0000 Commit: Mike Karels CommitDate: 2021-11-09 15:33:01 +0000 ifconfig: warn if setting an Internet address without mask Add a postproc function for af_inet, and add interface flags as a parameter. Check there if setting an address without a mask unless the interface is loopback or point-to-point, where mask is not really meaningful; warn if so. This will hopefully be an error in the future. MFC after: 1 month Reviewd by: bz Differential Revision: https://reviews.freebsd.org/D32709 --- sbin/ifconfig/af_inet.c | 11 +++++++++++ sbin/ifconfig/af_inet6.c | 3 ++- sbin/ifconfig/ifconfig.c | 16 +++++++++------- sbin/ifconfig/ifconfig.h | 3 ++- 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/sbin/ifconfig/af_inet.c b/sbin/ifconfig/af_inet.c index 3d44a4c0b992..c5c40de155d6 100644 --- a/sbin/ifconfig/af_inet.c +++ b/sbin/ifconfig/af_inet.c @@ -175,6 +175,16 @@ in_getaddr(const char *s, int which) errx(1, "%s: bad value", s); } +static void +in_postproc(int s, const struct afswtch *afp, int newaddr, int ifflags) +{ + if (sintab[ADDR]->sin_len != 0 && sintab[MASK]->sin_len == 0 && + newaddr && (ifflags & (IFF_POINTOPOINT | IFF_LOOPBACK)) == 0) { + warnx("WARNING: setting interface address without mask " + "is deprecated,\ndefault mask may not be correct."); + } +} + static void in_status_tunnel(int s) { @@ -222,6 +232,7 @@ static struct afswtch af_inet = { .af_af = AF_INET, .af_status = in_status, .af_getaddr = in_getaddr, + .af_postproc = in_postproc, .af_status_tunnel = in_status_tunnel, .af_settunnel = in_set_tunnel, .af_difaddr = SIOCDIFADDR, diff --git a/sbin/ifconfig/af_inet6.c b/sbin/ifconfig/af_inet6.c index 50568de4f148..08902b934ad8 100644 --- a/sbin/ifconfig/af_inet6.c +++ b/sbin/ifconfig/af_inet6.c @@ -419,7 +419,8 @@ sec2str(time_t total) } static void -in6_postproc(int s, const struct afswtch *afp) +in6_postproc(int s, const struct afswtch *afp, int newaddr __unused, + int ifflags __unused) { if (explicit_prefix == 0) { /* Aggregatable address architecture defines all prefixes diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 5e114b43c126..0423b3593504 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -116,7 +116,7 @@ static void status(const struct afswtch *afp, const struct sockaddr_dl *sdl, static void tunnel_status(int s); static _Noreturn void usage(void); -static int getifflags(const char *ifname, int us); +static int getifflags(const char *ifname, int us, bool err_ok); static struct afswtch *af_getbyname(const char *name); static struct afswtch *af_getbyfamily(int af); @@ -603,7 +603,7 @@ main(int argc, char *argv[]) if (iflen >= sizeof(name)) { warnx("%s: interface name too long, skipping", ifname); } else { - flags = getifflags(name, -1); + flags = getifflags(name, -1, false); if (!(((flags & IFF_CANTCONFIG) != 0) || (downonly && (flags & IFF_UP) != 0) || (uponly && (flags & IFF_UP) == 0))) @@ -1000,7 +1000,7 @@ top: * Do any post argument processing required by the address family. */ if (afp->af_postproc != NULL) - afp->af_postproc(s, afp); + afp->af_postproc(s, afp, newaddr, getifflags(name, s, true)); /* * Do deferred callbacks registered while processing * command-line arguments. @@ -1179,7 +1179,7 @@ setifdstaddr(const char *addr, int param __unused, int s, } static int -getifflags(const char *ifname, int us) +getifflags(const char *ifname, int us, bool err_ok) { struct ifreq my_ifr; int s; @@ -1192,8 +1192,10 @@ getifflags(const char *ifname, int us) } else s = us; if (ioctl(s, SIOCGIFFLAGS, (caddr_t)&my_ifr) < 0) { - Perror("ioctl (SIOCGIFFLAGS)"); - exit(1); + if (!err_ok) { + Perror("ioctl (SIOCGIFFLAGS)"); + exit(1); + } } if (us < 0) close(s); @@ -1211,7 +1213,7 @@ setifflags(const char *vname, int value, int s, const struct afswtch *afp) struct ifreq my_ifr; int flags; - flags = getifflags(name, s); + flags = getifflags(name, s, false); if (value < 0) { value = -value; flags &= ~value; diff --git a/sbin/ifconfig/ifconfig.h b/sbin/ifconfig/ifconfig.h index ea541c5e9257..2c0b8a100b0d 100644 --- a/sbin/ifconfig/ifconfig.h +++ b/sbin/ifconfig/ifconfig.h @@ -110,7 +110,8 @@ struct afswtch { void (*af_getaddr)(const char *, int); /* parse prefix method (IPv6) */ void (*af_getprefix)(const char *, int); - void (*af_postproc)(int s, const struct afswtch *); + void (*af_postproc)(int s, const struct afswtch *, + int newaddr, int ifflags); u_long af_difaddr; /* set dst if address ioctl */ u_long af_aifaddr; /* set if address ioctl */ void *af_ridreq; /* */ From nobody Tue Nov 9 15:36:03 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 27F841848863; Tue, 9 Nov 2021 15:36:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpXBW6RFDz4tbd; Tue, 9 Nov 2021 15:36:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE9102780D; Tue, 9 Nov 2021 15:36:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9Fa37M099898; Tue, 9 Nov 2021 15:36:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9Fa3Id099897; Tue, 9 Nov 2021 15:36:03 GMT (envelope-from git) Date: Tue, 9 Nov 2021 15:36:03 GMT Message-Id: <202111091536.1A9Fa3Id099897@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: 12bd931d8c64 - main - man pages: deprecate Internet Class A/B/C List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 12bd931d8c64ad2d5e78c7ab917efbff326152ca Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=12bd931d8c64ad2d5e78c7ab917efbff326152ca commit 12bd931d8c64ad2d5e78c7ab917efbff326152ca Author: Mike Karels AuthorDate: 2021-10-27 03:25:09 +0000 Commit: Mike Karels CommitDate: 2021-11-09 15:33:23 +0000 man pages: deprecate Internet Class A/B/C Mark functions inet_netof(), inet_lnaof(), and inet_makeaddr() as deprecated, as they assume Class A/B/C. inet_makeaddr() mostly works when networks are a multiple of 8 bits, but warn for anything other than historical classes. Reduce other mentions of network classes. MFC after: 1 month Reviewed by: bcr, #manpages Differential Revision: https://reviews.freebsd.org/D32711 --- lib/libc/net/inet.3 | 24 ++++++++++-------------- lib/libc/net/inet_net.3 | 12 +++--------- share/man/man5/resolver.5 | 11 ++++++----- 3 files changed, 19 insertions(+), 28 deletions(-) diff --git a/lib/libc/net/inet.3 b/lib/libc/net/inet.3 index a36cb313f7d3..cb44394d0a0c 100644 --- a/lib/libc/net/inet.3 +++ b/lib/libc/net/inet.3 @@ -28,7 +28,7 @@ .\" From: @(#)inet.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 14, 2007 +.Dd November 9, 2021 .Dt INET 3 .Os .Sh NAME @@ -157,18 +157,20 @@ The routine .Fn inet_ntoa_r is the reentrant version of .Fn inet_ntoa . -The routine +The deprecated routine .Fn inet_makeaddr takes an Internet network number and a local -network address and constructs an Internet address +host address on that network, and constructs an Internet address from it. -The routines +It should only be assumed to work for historical class A/B/C networks. +The deprecated routines .Fn inet_netof and .Fn inet_lnaof break apart Internet host addresses, returning -the network number and local network address part, -respectively. +the network number and local host address part, +respectively, +assuming the historical class A/B/C network masks. .Pp All Internet addresses are returned in network order (bytes ordered from left to right). @@ -203,17 +205,11 @@ ordered from right to left. .Pp When a three part address is specified, the last part is interpreted as a 16-bit quantity and placed -in the right-most two bytes of the network address. -This makes the three part address format convenient -for specifying Class B network addresses as -.Dq Li 128.net.host . +in the least significant two bytes of the network address. .Pp When a two part address is supplied, the last part is interpreted as a 24-bit quantity and placed in -the right most three bytes of the network address. -This makes the two part address format convenient -for specifying Class A network addresses as -.Dq Li net.host . +the least significant three bytes of the network address. .Pp When only one part is given, the value is stored directly in the network address without any byte diff --git a/lib/libc/net/inet_net.3 b/lib/libc/net/inet_net.3 index f0721729ff05..4028984bd09b 100644 --- a/lib/libc/net/inet_net.3 +++ b/lib/libc/net/inet_net.3 @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 18, 2016 +.Dd November 9, 2021 .Dt INET_NET 3 .Os .Sh NAME @@ -120,17 +120,11 @@ That is, little-endian bytes are ordered from right to left. .Pp When a three part number is specified, the last part is interpreted as a 16-bit quantity and placed -in the rightmost two bytes of the Internet network number. -This makes the three part number format convenient -for specifying Class B network numbers as -.Dq Li 128.net.host . +in the least significant two bytes of the Internet network number. .Pp When a two part number is supplied, the last part is interpreted as a 24-bit quantity and placed in -the rightmost three bytes of the Internet network number. -This makes the two part number format convenient -for specifying Class A network numbers as -.Dq Li net.host . +the least significant three bytes of the Internet network number. .Pp When only one part is given, the value is stored directly in the Internet network number without any byte diff --git a/share/man/man5/resolver.5 b/share/man/man5/resolver.5 index d5c02599bafb..468c635839c6 100644 --- a/share/man/man5/resolver.5 +++ b/share/man/man5/resolver.5 @@ -28,7 +28,7 @@ .\" @(#)resolver.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd May 25, 2021 +.Dd November 9, 2021 .Dt RESOLVER 5 .Os .Sh NAME @@ -104,15 +104,16 @@ with a total of 256 characters. .It Sy sortlist Sortlist allows addresses returned by gethostbyname to be sorted. A sortlist is specified by IP address netmask pairs. -The netmask is -optional and defaults to the natural netmask of the net. +If the netmask is not specified, +it defaults to the historical Class A/B/C netmask of the net; +this usage is deprecated. The IP address -and optional network pairs are separated by slashes. +and network pairs are separated by slashes. Up to 10 pairs may be specified. E.g., .Pp -.Dl "sortlist 130.155.160.0/255.255.240.0 130.155.0.0" +.Dl "sortlist 10.9.1.0/255.255.240.0 10.9.0.0/255.255.0.0" .It Sy options Options allows certain internal resolver variables to be modified. The syntax is From nobody Tue Nov 9 15:36:04 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A9AFC18489CC; Tue, 9 Nov 2021 15:36:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpXBY0tSpz4tkG; Tue, 9 Nov 2021 15:36:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1A55275B0; Tue, 9 Nov 2021 15:36:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9Fa4Uv099928; Tue, 9 Nov 2021 15:36:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9Fa4fY099927; Tue, 9 Nov 2021 15:36:04 GMT (envelope-from git) Date: Tue, 9 Nov 2021 15:36:04 GMT Message-Id: <202111091536.1A9Fa4fY099927@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: 0bf7f99b2a1f - main - res_init: remove unused inet_makeaddr with IN_LOOPBACKNET List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0bf7f99b2a1f50fa68e167269a633b4b5451fa35 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=0bf7f99b2a1f50fa68e167269a633b4b5451fa35 commit 0bf7f99b2a1f50fa68e167269a633b4b5451fa35 Author: Mike Karels AuthorDate: 2021-10-27 03:33:36 +0000 Commit: Mike Karels CommitDate: 2021-11-09 15:33:48 +0000 res_init: remove unused inet_makeaddr with IN_LOOPBACKNET Remove code that is ifdefed out on USELOOPBACK, which uses historical class. No functional change intended. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D32712 --- lib/libc/resolv/res_init.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/libc/resolv/res_init.c b/lib/libc/resolv/res_init.c index 515c86c2378d..274ffbf999d6 100644 --- a/lib/libc/resolv/res_init.c +++ b/lib/libc/resolv/res_init.c @@ -202,11 +202,7 @@ __res_vinit(res_state statp, int preinit) { statp->id = res_nrandomid(statp); memset(u, 0, sizeof(u)); -#ifdef USELOOPBACK - u[nserv].sin.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1); -#else u[nserv].sin.sin_addr.s_addr = INADDR_ANY; -#endif u[nserv].sin.sin_family = AF_INET; u[nserv].sin.sin_port = htons(NAMESERVER_PORT); #ifdef HAVE_SA_LEN @@ -214,11 +210,7 @@ __res_vinit(res_state statp, int preinit) { #endif nserv++; #ifdef HAS_INET6_STRUCTS -#ifdef USELOOPBACK - u[nserv].sin6.sin6_addr = in6addr_loopback; -#else u[nserv].sin6.sin6_addr = in6addr_any; -#endif u[nserv].sin6.sin6_family = AF_INET6; u[nserv].sin6.sin6_port = htons(NAMESERVER_PORT); #ifdef HAVE_SA_LEN From nobody Tue Nov 9 15:36:05 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 46DE01848AA2; Tue, 9 Nov 2021 15:36:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpXBZ1kvPz4tvj; Tue, 9 Nov 2021 15:36:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 021EF2780E; Tue, 9 Nov 2021 15:36:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9Fa5MV099953; Tue, 9 Nov 2021 15:36:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9Fa5p7099952; Tue, 9 Nov 2021 15:36:05 GMT (envelope-from git) Date: Tue, 9 Nov 2021 15:36:05 GMT Message-Id: <202111091536.1A9Fa5p7099952@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: 92aebdeaff57 - main - mountd: deprecate exports to a network without mask List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 92aebdeaff57091c77398912accb4c758c6a0fcb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=92aebdeaff57091c77398912accb4c758c6a0fcb commit 92aebdeaff57091c77398912accb4c758c6a0fcb Author: Mike Karels AuthorDate: 2021-10-27 03:48:23 +0000 Commit: Mike Karels CommitDate: 2021-11-09 15:34:06 +0000 mountd: deprecate exports to a network without mask The exports file format allows export to a network using an explicit mask or prefix length (CIDR). It also allows a network with just a dotted address, in which case the historical mask was used. Deprecate this usage, and warn when it is used. Document that this is deprecated. MFC after: 1 month Reviewed by: rmacklem, bcr, #manpages Differential Revision: https://reviews.freebsd.org/D32713 --- usr.sbin/mountd/exports.5 | 7 ++++--- usr.sbin/mountd/mountd.c | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/usr.sbin/mountd/exports.5 b/usr.sbin/mountd/exports.5 index bba10ddc7be1..d5aa49a1f428 100644 --- a/usr.sbin/mountd/exports.5 +++ b/usr.sbin/mountd/exports.5 @@ -28,7 +28,7 @@ .\" @(#)exports.5 8.3 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd November 20, 2020 +.Dd November 9, 2021 .Dt EXPORTS 5 .Os .Sh NAME @@ -338,9 +338,10 @@ to the option, or by using a separate .Fl mask option. -If the mask is not specified, it will default to the mask for that network -class (A, B or C; see +If the mask is not specified, it will default to the historical mask +for that network class (A, B, or C; see .Xr inet 4 ) . +This usage is deprecated, and will elicit a warning log message. See the .Sx EXAMPLES section below. diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index c66ac13b3016..4c42fce92723 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -3418,6 +3418,9 @@ get_net(char *cp, struct netmsk *net, int maskflg) (opt_flags & OP_MASK) == 0) { in_addr_t addr; + syslog(LOG_WARNING, + "WARNING: No mask specified for %s, " + "using out-of-date default", name); addr = ((struct sockaddr_in *)sa)->sin_addr.s_addr; if (IN_CLASSA(addr)) preflen = 8; @@ -3425,7 +3428,7 @@ get_net(char *cp, struct netmsk *net, int maskflg) preflen = 16; else if (IN_CLASSC(addr)) preflen = 24; - else if (IN_CLASSD(addr)) + else if (IN_CLASSD(addr)) /* XXX Multicast??? */ preflen = 28; else preflen = 32; /* XXX */ From nobody Tue Nov 9 15:36:07 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2D03218489FF; Tue, 9 Nov 2021 15:36:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpXBb4wzgz4tkV; Tue, 9 Nov 2021 15:36:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D2E92752B; Tue, 9 Nov 2021 15:36:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9Fa7LC099977; Tue, 9 Nov 2021 15:36:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9Fa7kJ099976; Tue, 9 Nov 2021 15:36:07 GMT (envelope-from git) Date: Tue, 9 Nov 2021 15:36:07 GMT Message-Id: <202111091536.1A9Fa7kJ099976@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: bd27c71c4573 - main - netstat: reduce use of historical Internet classes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd27c71c4573e14916ccd27e545a69606f0a8192 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=bd27c71c4573e14916ccd27e545a69606f0a8192 commit bd27c71c4573e14916ccd27e545a69606f0a8192 Author: Mike Karels AuthorDate: 2021-10-27 03:39:10 +0000 Commit: Mike Karels CommitDate: 2021-11-09 15:34:22 +0000 netstat: reduce use of historical Internet classes When attempting to characterize bound addresses, netstat was checking for host 0 on a (historical) net using inet_lnaof(). Such addresses are not normally bound, as they would not work, with the exception of the unspecified address, INADDR_ANY. Check for that explicitly. Similarly, don't check bound addresses for a match to a network name. MFC after: 1 month Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D32714 --- usr.bin/netstat/inet.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c index 2d3a4bb10d52..dc777b0be990 100644 --- a/usr.bin/netstat/inet.c +++ b/usr.bin/netstat/inet.c @@ -296,14 +296,14 @@ protopr(u_long off, const char *name, int af1, int proto) ( (istcp && tp->t_state == TCPS_LISTEN) || (af1 == AF_INET && - inet_lnaof(inp->inp_laddr) == INADDR_ANY) + inp->inp_laddr.s_addr == INADDR_ANY) #ifdef INET6 || (af1 == AF_INET6 && IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) #endif /* INET6 */ || (af1 == AF_UNSPEC && (((inp->inp_vflag & INP_IPV4) != 0 && - inet_lnaof(inp->inp_laddr) == INADDR_ANY) + inp->inp_laddr.s_addr == INADDR_ANY) #ifdef INET6 || ((inp->inp_vflag & INP_IPV6) != 0 && IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) @@ -1479,24 +1479,13 @@ inetname(struct in_addr *inp) char *cp; static char line[MAXHOSTNAMELEN]; struct hostent *hp; - struct netent *np; cp = 0; if (!numeric_addr && inp->s_addr != INADDR_ANY) { - int net = inet_netof(*inp); - int lna = inet_lnaof(*inp); - - if (lna == INADDR_ANY) { - np = getnetbyaddr(net, AF_INET); - if (np) - cp = np->n_name; - } - if (cp == NULL) { - hp = gethostbyaddr((char *)inp, sizeof (*inp), AF_INET); - if (hp) { - cp = hp->h_name; - trimdomain(cp, strlen(cp)); - } + hp = gethostbyaddr((char *)inp, sizeof (*inp), AF_INET); + if (hp) { + cp = hp->h_name; + trimdomain(cp, strlen(cp)); } } if (inp->s_addr == INADDR_ANY) From nobody Tue Nov 9 15:36:08 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 49FFA18489B9; Tue, 9 Nov 2021 15:36:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpXBc6Gz9z4thy; Tue, 9 Nov 2021 15:36:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C45026EF9; Tue, 9 Nov 2021 15:36:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9Fa8uU000102; Tue, 9 Nov 2021 15:36:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9Fa8FW000101; Tue, 9 Nov 2021 15:36:08 GMT (envelope-from git) Date: Tue, 9 Nov 2021 15:36:08 GMT Message-Id: <202111091536.1A9Fa8FW000101@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: 64acb29b7d96 - main - sockstat: change check for wildcard sockets to avoid historical classes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 64acb29b7d9699c301a55a5431d94374391e4f30 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=64acb29b7d9699c301a55a5431d94374391e4f30 commit 64acb29b7d9699c301a55a5431d94374391e4f30 Author: Mike Karels AuthorDate: 2021-10-27 03:12:24 +0000 Commit: Mike Karels CommitDate: 2021-11-09 15:34:44 +0000 sockstat: change check for wildcard sockets to avoid historical classes sockstat was checking whether a bound address was "host 0", the lowest host on a network, using inet_lnaof(). This only works for class A/B/C. However, it isn't useful to bind such an address unless it is really the unspecified address INADDR_ANY. Change the check to to use that. MFC after: 1 month Reviewd by: tuexen Differential Revision: https://reviews.freebsd.org/D32715 --- usr.bin/sockstat/sockstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c index d7fdb87b7490..1a4413116a79 100644 --- a/usr.bin/sockstat/sockstat.c +++ b/usr.bin/sockstat/sockstat.c @@ -874,7 +874,7 @@ printaddr(struct sockaddr_storage *ss) switch (ss->ss_family) { case AF_INET: - if (inet_lnaof(sstosin(ss)->sin_addr) == INADDR_ANY) + if (sstosin(ss)->sin_addr.s_addr == INADDR_ANY) addrstr[0] = '*'; port = ntohs(sstosin(ss)->sin_port); break; From nobody Tue Nov 9 15:36:09 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 158301848ADA; Tue, 9 Nov 2021 15:36:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpXBd5V4Gz4tms; Tue, 9 Nov 2021 15:36:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 623D52736D; Tue, 9 Nov 2021 15:36:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9Fa9x3000126; Tue, 9 Nov 2021 15:36:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9Fa91p000125; Tue, 9 Nov 2021 15:36:09 GMT (envelope-from git) Date: Tue, 9 Nov 2021 15:36:09 GMT Message-Id: <202111091536.1A9Fa91p000125@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: a2e7dfca8649 - main - systat: clean up code assuming network classes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a2e7dfca86497e535039a42cfc44cfc48209abf5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=a2e7dfca86497e535039a42cfc44cfc48209abf5 commit a2e7dfca86497e535039a42cfc44cfc48209abf5 Author: Mike Karels AuthorDate: 2021-10-28 23:39:43 +0000 Commit: Mike Karels CommitDate: 2021-11-09 15:35:16 +0000 systat: clean up code assuming network classes Similar to netstat, clean up code that uses inet_lnaof() to check for binding to "host 0" (lowest host on network) as a "network" bind. Such things don't happen, and current networks are seldom if ever found in /etc/networks. MFC after: 1 month Reviewers: tuexen Differential Revision: https://reviews.freebsd.org/D32720 --- usr.bin/systat/netstat.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/usr.bin/systat/netstat.c b/usr.bin/systat/netstat.c index 8199d0c81586..96d4194db72d 100644 --- a/usr.bin/systat/netstat.c +++ b/usr.bin/systat/netstat.c @@ -206,7 +206,7 @@ again: next = &inpcb; if (!aflag) { if (inpcb.inp_vflag & INP_IPV4) { - if (inet_lnaof(inpcb.inp_laddr) == INADDR_ANY) + if (inpcb.inp_laddr.s_addr == INADDR_ANY) continue; } #ifdef INET6 @@ -303,8 +303,7 @@ fetchnetstat_sysctl(void) if (!aflag) { if (xip->inp_vflag & INP_IPV4) { - if (inet_lnaof(xip->inp_laddr) == - INADDR_ANY) + if (xip->inp_laddr.s_addr == INADDR_ANY) continue; } #ifdef INET6 @@ -584,7 +583,6 @@ inetname(struct sockaddr *sa) char *cp = 0; static char line[NI_MAXHOST]; struct hostent *hp; - struct netent *np; struct in_addr in; #ifdef INET6 @@ -601,19 +599,9 @@ inetname(struct sockaddr *sa) in = ((struct sockaddr_in *)sa)->sin_addr; if (!nflag && in.s_addr != INADDR_ANY) { - int net = inet_netof(in); - int lna = inet_lnaof(in); - - if (lna == INADDR_ANY) { - np = getnetbyaddr(net, AF_INET); - if (np) - cp = np->n_name; - } - if (cp == NULL) { - hp = gethostbyaddr((char *)&in, sizeof (in), AF_INET); - if (hp) - cp = hp->h_name; - } + hp = gethostbyaddr((char *)&in, sizeof (in), AF_INET); + if (hp) + cp = hp->h_name; } if (in.s_addr == INADDR_ANY) strcpy(line, "*"); From nobody Tue Nov 9 18:02:12 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9A869184D060; Tue, 9 Nov 2021 18:02:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpbR84236z4kt7; Tue, 9 Nov 2021 18:02:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6ADE2190A; Tue, 9 Nov 2021 18:02:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9I2COK099024; Tue, 9 Nov 2021 18:02:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9I2CDu099023; Tue, 9 Nov 2021 18:02:12 GMT (envelope-from git) Date: Tue, 9 Nov 2021 18:02:12 GMT Message-Id: <202111091802.1A9I2CDu099023@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: 3225fd22b219 - main - kern_utimensat: Update name of last arg in prototype. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3225fd22b2191c7a7a655cb5dacea9148f29c926 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3225fd22b2191c7a7a655cb5dacea9148f29c926 commit 3225fd22b2191c7a7a655cb5dacea9148f29c926 Author: John Baldwin AuthorDate: 2021-11-04 18:02:55 +0000 Commit: John Baldwin CommitDate: 2021-11-09 17:41:17 +0000 kern_utimensat: Update name of last arg in prototype. The last argument is a mask of AT_* flags, not a namei cnp flag as 'int follow' implies in other kern_* functions. Obtained from: CheriBSD Sponsored by: The University of Cambridge, Google Inc. --- sys/sys/syscallsubr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h index dc1b3d6a83de..4b57ae5cf938 100644 --- a/sys/sys/syscallsubr.h +++ b/sys/sys/syscallsubr.h @@ -334,7 +334,7 @@ int kern_utimesat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, struct timeval *tptr, enum uio_seg tptrseg); int kern_utimensat(struct thread *td, int fd, const char *path, enum uio_seg pathseg, struct timespec *tptr, enum uio_seg tptrseg, - int follow); + int flag); int kern_wait(struct thread *td, pid_t pid, int *status, int options, struct rusage *rup); int kern_wait6(struct thread *td, enum idtype idtype, id_t id, int *status, From nobody Tue Nov 9 18:02:13 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DFEFF184D13E; Tue, 9 Nov 2021 18:02:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpbR952F6z4lDS; Tue, 9 Nov 2021 18:02:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D91D1814; Tue, 9 Nov 2021 18:02:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9I2DNL099055; Tue, 9 Nov 2021 18:02:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9I2D7r099054; Tue, 9 Nov 2021 18:02:13 GMT (envelope-from git) Date: Tue, 9 Nov 2021 18:02:13 GMT Message-Id: <202111091802.1A9I2D7r099054@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: 57093f9366b7 - main - vfs: Consistently validate AT_* flags in kern_* functions. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 57093f9366b7eeb48054ff2fa77b9d01d2b3cfc2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=57093f9366b7eeb48054ff2fa77b9d01d2b3cfc2 commit 57093f9366b7eeb48054ff2fa77b9d01d2b3cfc2 Author: John Baldwin AuthorDate: 2021-11-09 17:42:12 +0000 Commit: John Baldwin CommitDate: 2021-11-09 17:42:12 +0000 vfs: Consistently validate AT_* flags in kern_* functions. Some syscalls checked for invalid AT_* flags in sys_* and others in kern_*. Reviewed by: kib Obtained from: CheriBSD Sponsored by: The University of Cambridge, Google Inc. Differential Revision: https://reviews.freebsd.org/D32864 --- sys/kern/vfs_syscalls.c | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 29a6b34d083a..cedadc55b87f 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1524,15 +1524,9 @@ struct linkat_args { int sys_linkat(struct thread *td, struct linkat_args *uap) { - int flag; - - flag = uap->flag; - if ((flag & ~(AT_SYMLINK_FOLLOW | AT_RESOLVE_BENEATH | - AT_EMPTY_PATH)) != 0) - return (EINVAL); return (kern_linkat(td, uap->fd1, uap->fd2, uap->path1, uap->path2, - UIO_USERSPACE, flag)); + UIO_USERSPACE, uap->flag)); } int hardlink_check_uid = 0; @@ -1581,6 +1575,10 @@ kern_linkat(struct thread *td, int fd1, int fd2, const char *path1, struct nameidata nd; int error; + if ((flag & ~(AT_SYMLINK_FOLLOW | AT_RESOLVE_BENEATH | + AT_EMPTY_PATH)) != 0) + return (EINVAL); + NDPREINIT(&nd); do { bwillwrite(); @@ -2758,10 +2756,6 @@ int sys_chflagsat(struct thread *td, struct chflagsat_args *uap) { - if ((uap->atflag & ~(AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH | - AT_EMPTY_PATH)) != 0) - return (EINVAL); - return (kern_chflagsat(td, uap->fd, uap->path, UIO_USERSPACE, uap->flags, uap->atflag)); } @@ -2790,6 +2784,10 @@ kern_chflagsat(struct thread *td, int fd, const char *path, struct nameidata nd; int error; + if ((atflag & ~(AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH | + AT_EMPTY_PATH)) != 0) + return (EINVAL); + AUDIT_ARG_FFLAGS(flags); NDINIT_ATRIGHTS(&nd, LOOKUP, at2cnpflags(atflag, AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH | AT_EMPTY_PATH) | AUDITVNODE1, pathseg, path, @@ -2889,10 +2887,6 @@ int sys_fchmodat(struct thread *td, struct fchmodat_args *uap) { - if ((uap->flag & ~(AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH | - AT_EMPTY_PATH)) != 0) - return (EINVAL); - return (kern_fchmodat(td, uap->fd, uap->path, UIO_USERSPACE, uap->mode, uap->flag)); } @@ -2921,6 +2915,10 @@ kern_fchmodat(struct thread *td, int fd, const char *path, struct nameidata nd; int error; + if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH | + AT_EMPTY_PATH)) != 0) + return (EINVAL); + AUDIT_ARG_MODE(mode); NDINIT_ATRIGHTS(&nd, LOOKUP, at2cnpflags(flag, AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH | AT_EMPTY_PATH) | AUDITVNODE1, pathseg, path, @@ -3018,10 +3016,6 @@ int sys_fchownat(struct thread *td, struct fchownat_args *uap) { - if ((uap->flag & ~(AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH | - AT_EMPTY_PATH)) != 0) - return (EINVAL); - return (kern_fchownat(td, uap->fd, uap->path, UIO_USERSPACE, uap->uid, uap->gid, uap->flag)); } @@ -3033,6 +3027,10 @@ kern_fchownat(struct thread *td, int fd, const char *path, struct nameidata nd; int error; + if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH | + AT_EMPTY_PATH)) != 0) + return (EINVAL); + AUDIT_ARG_OWNER(uid, gid); NDINIT_ATRIGHTS(&nd, LOOKUP, at2cnpflags(flag, AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH | AT_EMPTY_PATH) | AUDITVNODE1, pathseg, path, @@ -4401,8 +4399,6 @@ int sys_getfhat(struct thread *td, struct getfhat_args *uap) { - if ((uap->flags & ~(AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH)) != 0) - return (EINVAL); return (kern_getfhat(td, uap->flags, uap->fd, uap->path, UIO_USERSPACE, uap->fhp, UIO_USERSPACE)); } @@ -4416,6 +4412,8 @@ kern_getfhat(struct thread *td, int flags, int fd, const char *path, struct vnode *vp; int error; + if ((flags & ~(AT_SYMLINK_NOFOLLOW | AT_RESOLVE_BENEATH)) != 0) + return (EINVAL); error = priv_check(td, PRIV_VFS_GETFH); if (error != 0) return (error); From nobody Tue Nov 9 18:20:26 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 740C11857C9B; Tue, 9 Nov 2021 18:20:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpbrB2TH2z4s3Z; Tue, 9 Nov 2021 18:20:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34FB01558; Tue, 9 Nov 2021 18:20:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9IKQnZ022036; Tue, 9 Nov 2021 18:20:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9IKQDJ022035; Tue, 9 Nov 2021 18:20:26 GMT (envelope-from git) Date: Tue, 9 Nov 2021 18:20:26 GMT Message-Id: <202111091820.1A9IKQDJ022035@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: 1f960e646b72 - main - pci: Implement pci_bar_enabled() for SR-IOV VFs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1f960e646b7280795766fdaa183e3b9bd4cea345 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1f960e646b7280795766fdaa183e3b9bd4cea345 commit 1f960e646b7280795766fdaa183e3b9bd4cea345 Author: Mark Johnston AuthorDate: 2021-11-09 18:07:57 +0000 Commit: Mark Johnston CommitDate: 2021-11-09 18:13:36 +0000 pci: Implement pci_bar_enabled() for SR-IOV VFs In a VF's configuration space, "memory space enable" is hard-wired to 0, so the existing implementation always returns false. We need to read the SR-IOV control register from the PF device to get the value of the MSE bit. Fix pci_bar_enabled() to read this register instead for VFs. I don't see any way to access the PF's config space without a backpointer in the pci device ivars, so I added one. This fixes a regression where bhyve(8) fails to map the MSI-X table after commit 7fa233534736 ("bhyve: Map the MSI-X table unconditionally for passthrough") when a VF is passed through, since with that commit we use PCIOCBARMMAP to map the table and that ioctl always fails for VFs without this change. As a bonus, pciconf(8) now correctly reports the enablement of BARs for VFs. Reported and tested by: Raúl Muñoz Reviewed by: rstone, jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32839 --- sys/dev/pci/pci.c | 10 ++++++++++ sys/dev/pci/pci_iov.c | 1 + sys/dev/pci/pci_iov_private.h | 1 + 3 files changed, 12 insertions(+) diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 702f9fc3aa05..7493ae1727fb 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -3151,6 +3151,16 @@ pci_bar_enabled(device_t dev, struct pci_map *pm) if (PCIR_IS_BIOS(&dinfo->cfg, pm->pm_reg) && !(pm->pm_value & PCIM_BIOS_ENABLE)) return (0); +#ifdef PCI_IOV + if ((dinfo->cfg.flags & PCICFG_VF) != 0) { + struct pcicfg_iov *iov; + + iov = dinfo->cfg.iov; + cmd = pci_read_config(iov->iov_pf, + iov->iov_pos + PCIR_SRIOV_CTL, 2); + return ((cmd & PCIM_SRIOV_VF_MSE) != 0); + } +#endif cmd = pci_read_config(dev, PCIR_COMMAND, 2); if (PCIR_IS_BIOS(&dinfo->cfg, pm->pm_reg) || PCI_BAR_MEM(pm->pm_value)) return ((cmd & PCIM_CMD_MEMEN) != 0); diff --git a/sys/dev/pci/pci_iov.c b/sys/dev/pci/pci_iov.c index 6db2cf445843..f577640595a9 100644 --- a/sys/dev/pci/pci_iov.c +++ b/sys/dev/pci/pci_iov.c @@ -151,6 +151,7 @@ pci_iov_attach_method(device_t bus, device_t dev, nvlist_t *pf_schema, error = EBUSY; goto cleanup; } + iov->iov_pf = dev; iov->iov_pos = iov_pos; schema = pci_iov_build_schema(&pf_schema, &vf_schema); diff --git a/sys/dev/pci/pci_iov_private.h b/sys/dev/pci/pci_iov_private.h index 0d1dda871b44..be3456d4781f 100644 --- a/sys/dev/pci/pci_iov_private.h +++ b/sys/dev/pci/pci_iov_private.h @@ -37,6 +37,7 @@ struct pci_iov_bar { }; struct pcicfg_iov { + device_t iov_pf; struct cdev *iov_cdev; nvlist_t *iov_schema; From nobody Tue Nov 9 18:48:52 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8A491184861A; Tue, 9 Nov 2021 18:48:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpcT03RGqz52ql; Tue, 9 Nov 2021 18:48:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 516431E34; Tue, 9 Nov 2021 18:48:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9ImqSe053670; Tue, 9 Nov 2021 18:48:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9ImqZX053669; Tue, 9 Nov 2021 18:48:52 GMT (envelope-from git) Date: Tue, 9 Nov 2021 18:48:52 GMT Message-Id: <202111091848.1A9ImqZX053669@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: e818178e3a59 - main - tests: do not build ktls_test if WITHOUT_OPENSSL List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e818178e3a597922ce77bee874e441a1b7df0099 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e818178e3a597922ce77bee874e441a1b7df0099 commit e818178e3a597922ce77bee874e441a1b7df0099 Author: Ed Maste AuthorDate: 2021-11-08 17:08:34 +0000 Commit: Ed Maste CommitDate: 2021-11-09 18:47:20 +0000 tests: do not build ktls_test if WITHOUT_OPENSSL ktls_test requires libcrypto to build, and fails if it is not available (which is the case when building WITHOUT_OPENSSL). Reported by: Michael Dexter, Build Option Survey Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32895 --- tests/sys/kern/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index ee9decac518c..b0f83b97db41 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PACKAGE= tests TESTSRC= ${SRCTOP}/contrib/netbsd-tests/kernel @@ -12,7 +14,9 @@ ATF_TESTS_C+= kern_copyin ATF_TESTS_C+= kern_descrip_test ATF_TESTS_C+= fdgrowtable_test ATF_TESTS_C+= kill_zombie +.if ${MK_OPENSSL} != "no" ATF_TESTS_C+= ktls_test +.endif ATF_TESTS_C+= ptrace_test TEST_METADATA.ptrace_test+= timeout="15" ATF_TESTS_C+= reaper From nobody Tue Nov 9 18:50:29 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8E38D1848B18; Tue, 9 Nov 2021 18:50:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpcVs3bQCz53Wc; Tue, 9 Nov 2021 18:50:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B5281FB1; Tue, 9 Nov 2021 18:50:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9IoTWl062113; Tue, 9 Nov 2021 18:50:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9IoTgJ062112; Tue, 9 Nov 2021 18:50:29 GMT (envelope-from git) Date: Tue, 9 Nov 2021 18:50:29 GMT Message-Id: <202111091850.1A9IoTgJ062112@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: e3ba94d4f34e - main - Don't require the socket lock for sorele(). List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e3ba94d4f34e9f3a1d25396afffe2f5cbf4f5286 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e3ba94d4f34e9f3a1d25396afffe2f5cbf4f5286 commit e3ba94d4f34e9f3a1d25396afffe2f5cbf4f5286 Author: John Baldwin AuthorDate: 2021-11-09 18:50:12 +0000 Commit: John Baldwin CommitDate: 2021-11-09 18:50:12 +0000 Don't require the socket lock for sorele(). Previously, sorele() always required the socket lock and dropped the lock if the released reference was not the last reference. Many callers locked the socket lock just before calling sorele() resulting in a wasted lock/unlock when not dropping the last reference. Move the previous implementation of sorele() into a new sorele_locked() function and use it instead of sorele() for various places in uipc_socket.c that called sorele() while already holding the socket lock. The sorele() macro now uses refcount_release_if_not_last() try to drop the socket reference without locking the socket. If that shortcut fails, it locks the socket and calls sorele_locked(). Reviewed by: kib, markj Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D32741 --- sys/dev/cxgbe/tom/t4_cpl_io.c | 1 - sys/kern/kern_sendfile.c | 1 - sys/kern/sys_socket.c | 1 - sys/kern/uipc_ktls.c | 6 ------ sys/kern/uipc_socket.c | 24 +++++++++++++++++++----- sys/netinet/tcp_subr.c | 1 - sys/rpc/clnt_vc.c | 1 - sys/rpc/svc_vc.c | 1 - sys/sys/socketvar.h | 11 ++++++----- 9 files changed, 25 insertions(+), 22 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index 686819065863..8635dc3d8922 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -2372,7 +2372,6 @@ t4_aiotx_task(void *context, int pending) NET_EPOCH_EXIT(et); free_toepcb(toep); - SOCK_LOCK(so); sorele(so); CURVNET_RESTORE(); } diff --git a/sys/kern/kern_sendfile.c b/sys/kern/kern_sendfile.c index ba1fc201c2de..fb5258e31f35 100644 --- a/sys/kern/kern_sendfile.c +++ b/sys/kern/kern_sendfile.c @@ -399,7 +399,6 @@ sendfile_iodone(void *arg, vm_page_t *pa, int count, int error) (void)(so->so_proto->pr_usrreqs->pru_ready)(so, sfio->m, sfio->npages); - SOCK_LOCK(so); sorele(so); #ifdef KERN_TLS out_with_ref: diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index 910da911b189..8f24017381df 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -727,7 +727,6 @@ soaio_process_sb(struct socket *so, struct sockbuf *sb) sb->sb_flags &= ~SB_AIO_RUNNING; SOCKBUF_UNLOCK(sb); - SOCK_LOCK(so); sorele(so); CURVNET_RESTORE(); } diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index f97bf9d1117f..4e14cee18c8a 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -2077,7 +2077,6 @@ deref: SOCKBUF_UNLOCK_ASSERT(sb); CURVNET_SET(so->so_vnet); - SOCK_LOCK(so); sorele(so); CURVNET_RESTORE(); } @@ -2427,7 +2426,6 @@ ktls_encrypt(struct ktls_wq *wq, struct mbuf *top) mb_free_notready(top, total_pages); } - SOCK_LOCK(so); sorele(so); CURVNET_RESTORE(); } @@ -2472,7 +2470,6 @@ ktls_encrypt_cb(struct ktls_ocf_encrypt_state *state, int error) mb_free_notready(m, npages); } - SOCK_LOCK(so); sorele(so); CURVNET_RESTORE(); } @@ -2523,7 +2520,6 @@ ktls_encrypt_async(struct ktls_wq *wq, struct mbuf *top) counter_u64_add(ktls_offload_failed_crypto, 1); free(state, M_KTLS); CURVNET_SET(so->so_vnet); - SOCK_LOCK(so); sorele(so); CURVNET_RESTORE(); break; @@ -2539,7 +2535,6 @@ ktls_encrypt_async(struct ktls_wq *wq, struct mbuf *top) mb_free_notready(m, total_pages - npages); } - SOCK_LOCK(so); sorele(so); CURVNET_RESTORE(); } @@ -2732,7 +2727,6 @@ ktls_disable_ifnet_help(void *context, int pending __unused) } out: - SOCK_LOCK(so); sorele(so); if (!in_pcbrele_wlocked(inp)) INP_WUNLOCK(inp); diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index e033b2d77f1d..b64db8f410f3 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -785,7 +785,7 @@ sonewconn(struct socket *head, int connstatus) sp->so_qstate = SQ_NONE; sp->so_listen = NULL; SOCK_UNLOCK(sp); - sorele(head); /* does SOLISTEN_UNLOCK, head stays */ + sorele_locked(head); /* does SOLISTEN_UNLOCK, head stays */ soabort(sp); SOLISTEN_LOCK(head); } @@ -1090,7 +1090,7 @@ solisten_dequeue(struct socket *head, struct socket **ret, int flags) else so->so_state |= (flags & SOCK_NONBLOCK) ? SS_NBIO : 0; SOCK_UNLOCK(so); - sorele(head); + sorele_locked(head); *ret = so; return (0); @@ -1170,7 +1170,7 @@ sofree(struct socket *so) KASSERT(so->so_listen == NULL, ("%s: so %p not on (in)comp with so_listen", __func__, so)); - sorele(sol); + sorele_locked(sol); KASSERT(refcount_load(&so->so_count) == 1, ("%s: so %p count %u", __func__, so, so->so_count)); so->so_count = 0; @@ -1213,6 +1213,20 @@ sofree(struct socket *so) sodealloc(so); } +/* + * Release a reference on a socket while holding the socket lock. + * Unlocks the socket lock before returning. + */ +void +sorele_locked(struct socket *so) +{ + SOCK_LOCK_ASSERT(so); + if (refcount_release(&so->so_count)) + sofree(so); + else + SOCK_UNLOCK(so); +} + /* * Close a socket on last file table reference removal. Initiate disconnect * if connected. Free socket when disconnect complete. @@ -1282,7 +1296,7 @@ drop: } KASSERT((so->so_state & SS_NOFDREF) == 0, ("soclose: NOFDREF")); so->so_state |= SS_NOFDREF; - sorele(so); + sorele_locked(so); if (listening) { struct socket *sp, *tsp; @@ -4060,7 +4074,7 @@ soisconnected(struct socket *so) * The socket is about to soabort(). */ SOCK_UNLOCK(so); - sorele(head); + sorele_locked(head); return; } last = refcount_release(&head->so_count); diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 2075c1d853c3..a9f39c2c7f3d 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -3911,7 +3911,6 @@ sysctl_switch_tls(SYSCTL_HANDLER_ARGS) error = ktls_set_tx_mode(so, arg2 == 0 ? TCP_TLS_MODE_SW : TCP_TLS_MODE_IFNET); INP_WUNLOCK(inp); - SOCK_LOCK(so); sorele(so); } } else diff --git a/sys/rpc/clnt_vc.c b/sys/rpc/clnt_vc.c index 7d22c670b017..659bb4598dcb 100644 --- a/sys/rpc/clnt_vc.c +++ b/sys/rpc/clnt_vc.c @@ -912,7 +912,6 @@ clnt_vc_destroy(CLIENT *cl) } /* Must sorele() to get rid of reference. */ CURVNET_SET(so->so_vnet); - SOCK_LOCK(so); sorele(so); CURVNET_RESTORE(); } else { diff --git a/sys/rpc/svc_vc.c b/sys/rpc/svc_vc.c index 77452d906594..b94137ef1087 100644 --- a/sys/rpc/svc_vc.c +++ b/sys/rpc/svc_vc.c @@ -468,7 +468,6 @@ svc_vc_destroy_common(SVCXPRT *xprt) } /* Must sorele() to get rid of reference. */ CURVNET_SET(xprt->xp_socket->so_vnet); - SOCK_LOCK(xprt->xp_socket); sorele(xprt->xp_socket); CURVNET_RESTORE(); } else diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 18db5e34d3b5..019fdfc372ac 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -337,11 +337,11 @@ struct socket { */ #define soref(so) refcount_acquire(&(so)->so_count) #define sorele(so) do { \ - SOCK_LOCK_ASSERT(so); \ - if (refcount_release(&(so)->so_count)) \ - sofree(so); \ - else \ - SOCK_UNLOCK(so); \ + SOCK_UNLOCK_ASSERT(so); \ + if (!refcount_release_if_not_last(&(so)->so_count)) { \ + SOCK_LOCK(so); \ + sorele_locked(so); \ + } \ } while (0) /* @@ -503,6 +503,7 @@ int soreceive_dgram(struct socket *so, struct sockaddr **paddr, int soreceive_generic(struct socket *so, struct sockaddr **paddr, struct uio *uio, struct mbuf **mp0, struct mbuf **controlp, int *flagsp); +void sorele_locked(struct socket *so); int soreserve(struct socket *so, u_long sndcc, u_long rcvcc); void sorflush(struct socket *so); int sosend(struct socket *so, struct sockaddr *addr, struct uio *uio, From nobody Tue Nov 9 18:53:30 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 602951849D5D; Tue, 9 Nov 2021 18:53:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpcZL27msz54S0; Tue, 9 Nov 2021 18:53:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2AC0A240C; Tue, 9 Nov 2021 18:53:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9IrUkg066528; Tue, 9 Nov 2021 18:53:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9IrUWK066527; Tue, 9 Nov 2021 18:53:30 GMT (envelope-from git) Date: Tue, 9 Nov 2021 18:53:30 GMT Message-Id: <202111091853.1A9IrUWK066527@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: 442ad83e38e8 - main - crypto: Don't assert on valid IV length for Chacha20-Poly1305. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 442ad83e38e8fda46d9facbd1ddd92bc23e3773e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=442ad83e38e8fda46d9facbd1ddd92bc23e3773e commit 442ad83e38e8fda46d9facbd1ddd92bc23e3773e Author: John Baldwin AuthorDate: 2021-11-09 18:52:30 +0000 Commit: John Baldwin CommitDate: 2021-11-09 18:52:30 +0000 crypto: Don't assert on valid IV length for Chacha20-Poly1305. The assertion checking for valid IV lengths added in 1833d6042c9a was not properly updated to permit an IV length of 8 in commit 42dcd39528c6. Reported by: syzbot+f0c0559b8be1d6eb28c7@syzkaller.appspotmail.com Reviewed by: markj Fixes: 42dcd39528c6 crypto: Support Chacha20-Poly1305 with a nonce size of 8 bytes. MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32860 --- sys/opencrypto/xform_chacha20_poly1305.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/opencrypto/xform_chacha20_poly1305.c b/sys/opencrypto/xform_chacha20_poly1305.c index 47d26dbd1d21..a88a04b28dad 100644 --- a/sys/opencrypto/xform_chacha20_poly1305.c +++ b/sys/opencrypto/xform_chacha20_poly1305.c @@ -55,7 +55,7 @@ chacha20_poly1305_reinit(void *vctx, const uint8_t *iv, size_t ivlen) { struct chacha20_poly1305_cipher_ctx *ctx = vctx; - KASSERT(ivlen == sizeof(ctx->nonce), + KASSERT(ivlen == 8 || ivlen == sizeof(ctx->nonce), ("%s: invalid nonce length", __func__)); /* Block 0 is used for the poly1305 key. */ From nobody Tue Nov 9 20:27:21 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8890918534D9; Tue, 9 Nov 2021 20:27:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hpffd3T9sz3sD3; Tue, 9 Nov 2021 20:27:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57F6037A8; Tue, 9 Nov 2021 20:27:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9KRLUm087812; Tue, 9 Nov 2021 20:27:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9KRLEK087811; Tue, 9 Nov 2021 20:27:21 GMT (envelope-from git) Date: Tue, 9 Nov 2021 20:27:21 GMT Message-Id: <202111092027.1A9KRLEK087811@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rene Ladan Subject: git: 0752d078df77 - main - share/misc: update portmgr membership List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rene X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0752d078df7742d4716353f1f9414558917e4b00 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rene (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=0752d078df7742d4716353f1f9414558917e4b00 commit 0752d078df7742d4716353f1f9414558917e4b00 Author: Rene Ladan AuthorDate: 2021-11-09 20:25:14 +0000 Commit: Rene Ladan CommitDate: 2021-11-09 20:25:14 +0000 share/misc: update portmgr membership After five years of service, adamw steps down from portmgr. Also please welcome tcberner to portmgr. --- share/misc/organization.dot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/misc/organization.dot b/share/misc/organization.dot index b730b86be5b4..2b0e2b7d65e9 100644 --- a/share/misc/organization.dot +++ b/share/misc/organization.dot @@ -30,7 +30,7 @@ coresecretary [label="Core Team Secretary\ncore-secretary@FreeBSD.org\nbofh"] doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"] doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\nbcr, gabor, gjb, hrs,\nblackend, ryusuke, wblock"] portscommitters [label="Ports Committers\nports-committers@FreeBSD.org"] -portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nadamw, antoine, bapt, bdrewery\nmat, rene, swills"] +portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nantoine, bapt, bdrewery\nmat, rene, swills, tcberner"] portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nrene"] re [label="Primary Release Engineering Team\nre@FreeBSD.org\ngjb, kib,\nbdrewery, blackend,\nrgrimes, delphij,\nhrs, glebius,\nmarius"] secteam [label="Security Team\nsecteam@FreeBSD.org\nbenno, delphij,\ndes, emaste,\ngjb, gordon,\nremko"] From nobody Tue Nov 9 21:13:00 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2A3BF184CAC0; Tue, 9 Nov 2021 21:13:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpggJ5clfz4d2y; Tue, 9 Nov 2021 21:13:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FAD940D4; Tue, 9 Nov 2021 21:13:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9LD0jJ054237; Tue, 9 Nov 2021 21:13:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9LD0jF054236; Tue, 9 Nov 2021 21:13:00 GMT (envelope-from git) Date: Tue, 9 Nov 2021 21:13:00 GMT Message-Id: <202111092113.1A9LD0jF054236@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 11f09b17fe2c - main - snd_uaudio(4): Fix string index computations for iFeature. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 11f09b17fe2cf0b5489601aee548a06486f0b749 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=11f09b17fe2cf0b5489601aee548a06486f0b749 commit 11f09b17fe2cf0b5489601aee548a06486f0b749 Author: Hans Petter Selasky AuthorDate: 2021-11-09 21:07:36 +0000 Commit: Hans Petter Selasky CommitDate: 2021-11-09 21:11:25 +0000 snd_uaudio(4): Fix string index computations for iFeature. This allows the iFeature strings to be properly read by the snd_uaudio(4) driver, when parsing the audio feature unit descriptors. Submitted by: Zhichao1.Li@dell.com MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/sound/usb/uaudio.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index 3a7d4189b9ef..bc5b0d04c020 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -3648,18 +3648,18 @@ uaudio_mixer_add_feature(struct uaudio_softc *sc, cmask |= uaudio_mixer_feature_get_bmaControls(d, chan); } - if (nchan > MIX_MAX_CHAN) - nchan = MIX_MAX_CHAN; - MIX(sc).wIndex = MAKE_WORD(d->bUnitId, sc->sc_mixer_iface_no); - i = d->bmaControls[d->bControlSize]; + i = d->bmaControls[nchan * d->bControlSize]; if (i == 0 || usbd_req_get_string_any(sc->sc_udev, NULL, MIX(sc).desc, sizeof(MIX(sc).desc), i) != 0) { MIX(sc).desc[0] = 0; } + if (nchan > MIX_MAX_CHAN) + nchan = MIX_MAX_CHAN; + for (ctl = 1; ctl <= LOUDNESS_CONTROL; ctl++) { fumask = FU_MASK(ctl); @@ -3782,9 +3782,6 @@ uaudio20_mixer_add_feature(struct uaudio_softc *sc, for (chan = 1; chan < nchan; chan++) cmask |= UGETDW(d->bmaControls[chan]); - if (nchan > MIX_MAX_CHAN) - nchan = MIX_MAX_CHAN; - MIX(sc).wIndex = MAKE_WORD(d->bUnitId, sc->sc_mixer_iface_no); i = d->bmaControls[nchan][0]; @@ -3794,6 +3791,9 @@ uaudio20_mixer_add_feature(struct uaudio_softc *sc, MIX(sc).desc[0] = 0; } + if (nchan > MIX_MAX_CHAN) + nchan = MIX_MAX_CHAN; + for (ctl = 3; ctl != 0; ctl <<= 2) { mixernumber = uaudio20_mixer_determine_class(&iot[id]); From nobody Tue Nov 9 21:13:01 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 229B4184CA72; Tue, 9 Nov 2021 21:13:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpggK6fMNz4d0y; Tue, 9 Nov 2021 21:13:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A37CB44EE; Tue, 9 Nov 2021 21:13:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9LD1Oq054266; Tue, 9 Nov 2021 21:13:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9LD1NH054265; Tue, 9 Nov 2021 21:13:01 GMT (envelope-from git) Date: Tue, 9 Nov 2021 21:13:01 GMT Message-Id: <202111092113.1A9LD1NH054265@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 4c537df51a16 - main - echo(1): Replace errexit() with err(3) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4c537df51a16ce004b184010d306e550716f49ea Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=4c537df51a16ce004b184010d306e550716f49ea commit 4c537df51a16ce004b184010d306e550716f49ea Author: Hans Petter Selasky AuthorDate: 2021-11-09 21:09:46 +0000 Commit: Hans Petter Selasky CommitDate: 2021-11-09 21:12:19 +0000 echo(1): Replace errexit() with err(3) Differential revision: https://reviews.freebsd.org/D32501 Submitted by: christos@ MFC after: 1 week Sponsored by: NVIDIA Networking --- bin/echo/echo.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/bin/echo/echo.c b/bin/echo/echo.c index f56bd5b976d8..46796ad1a27d 100644 --- a/bin/echo/echo.c +++ b/bin/echo/echo.c @@ -55,23 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include -/* - * Report an error and exit. - * Use it instead of err(3) to avoid linking-in stdio. - */ -static __dead2 void -errexit(const char *prog, const char *reason) -{ - char *errstr = strerror(errno); - write(STDERR_FILENO, prog, strlen(prog)); - write(STDERR_FILENO, ": ", 2); - write(STDERR_FILENO, reason, strlen(reason)); - write(STDERR_FILENO, ": ", 2); - write(STDERR_FILENO, errstr, strlen(errstr)); - write(STDERR_FILENO, "\n", 1); - exit(1); -} - int main(int argc, char *argv[]) { @@ -80,7 +63,6 @@ main(int argc, char *argv[]) struct iovec *iov, *vp; /* Elements to write, current element. */ char space[] = " "; char newline[] = "\n"; - char *progname = argv[0]; if (caph_limit_stdio() < 0 || caph_enter() < 0) err(1, "capsicum"); @@ -96,7 +78,7 @@ main(int argc, char *argv[]) veclen = (argc >= 2) ? (argc - 2) * 2 + 1 : 0; if ((vp = iov = malloc((veclen + 1) * sizeof(struct iovec))) == NULL) - errexit(progname, "malloc"); + err(1, "malloc"); while (argv[0] != NULL) { size_t len; @@ -135,7 +117,7 @@ main(int argc, char *argv[]) nwrite = (veclen > IOV_MAX) ? IOV_MAX : veclen; if (writev(STDOUT_FILENO, iov, nwrite) == -1) - errexit(progname, "write"); + err(1, "write"); iov += nwrite; veclen -= nwrite; } From nobody Tue Nov 9 21:13:02 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7484B184CC34; Tue, 9 Nov 2021 21:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpggM1QmJz4cpQ; Tue, 9 Nov 2021 21:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9EDF44F5; Tue, 9 Nov 2021 21:13:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9LD2SP054290; Tue, 9 Nov 2021 21:13:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9LD2JA054289; Tue, 9 Nov 2021 21:13:02 GMT (envelope-from git) Date: Tue, 9 Nov 2021 21:13:02 GMT Message-Id: <202111092113.1A9LD2JA054289@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 337c814316ef - main - kldstat(8): Fix indentation, whitespace to tabs. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 337c814316ef11437649cb43027468693555a5dd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=337c814316ef11437649cb43027468693555a5dd commit 337c814316ef11437649cb43027468693555a5dd Author: Hans Petter Selasky AuthorDate: 2021-11-09 21:09:54 +0000 Commit: Hans Petter Selasky CommitDate: 2021-11-09 21:12:19 +0000 kldstat(8): Fix indentation, whitespace to tabs. No functional change intended. Differential revision: https://reviews.freebsd.org/D32502 Submitted by: christos@ MFC after: 1 week Sponsored by: NVIDIA Networking --- sbin/kldstat/kldstat.c | 261 +++++++++++++++++++++++++------------------------ 1 file changed, 133 insertions(+), 128 deletions(-) diff --git a/sbin/kldstat/kldstat.c b/sbin/kldstat/kldstat.c index 38918890b879..0925223da23a 100644 --- a/sbin/kldstat/kldstat.c +++ b/sbin/kldstat/kldstat.c @@ -40,166 +40,171 @@ __FBSDID("$FreeBSD$"); #include #include -#define POINTER_WIDTH ((int)(sizeof(void *) * 2 + 2)) +#define POINTER_WIDTH ((int)(sizeof(void *) * 2 + 2)) static int showdata = 0; static void printmod(int modid) { - struct module_stat stat; - - bzero(&stat, sizeof(stat)); - stat.version = sizeof(struct module_stat); - if (modstat(modid, &stat) < 0) - warn("can't stat module id %d", modid); - else - if (showdata) { - printf("\t\t%3d %s (%d, %u, 0x%lx)\n", stat.id, stat.name, - stat.data.intval, stat.data.uintval, stat.data.ulongval); - } else { - printf("\t\t%3d %s\n", stat.id, stat.name); + struct module_stat stat; + + bzero(&stat, sizeof(stat)); + stat.version = sizeof(struct module_stat); + if (modstat(modid, &stat) < 0) + warn("can't stat module id %d", modid); + else { + if (showdata) + printf("\t\t%3d %s (%d, %u, 0x%lx)\n", stat.id, + stat.name, stat.data.intval, stat.data.uintval, + stat.data.ulongval); + else + printf("\t\t%3d %s\n", stat.id, stat.name); } } static void printfile(int fileid, int verbose, int humanized) { - struct kld_file_stat stat; - int modid; - char buf[5]; - - stat.version = sizeof(struct kld_file_stat); - if (kldstat(fileid, &stat) < 0) { - err(1, "can't stat file id %d", fileid); - } else { - if (humanized) { - humanize_number(buf, sizeof(buf), stat.size, - "", HN_AUTOSCALE, HN_DECIMAL | HN_NOSPACE); - - printf("%2d %4d %*p %5s %s", - stat.id, stat.refs, POINTER_WIDTH, stat.address, buf, - stat.name); + struct kld_file_stat stat; + int modid; + char buf[5]; + + stat.version = sizeof(struct kld_file_stat); + if (kldstat(fileid, &stat) < 0) { + err(1, "can't stat file id %d", fileid); } else { - printf("%2d %4d %*p %8zx %s", - stat.id, stat.refs, POINTER_WIDTH, stat.address, stat.size, - stat.name); + if (humanized) { + humanize_number(buf, sizeof(buf), stat.size, + "", HN_AUTOSCALE, HN_DECIMAL | HN_NOSPACE); + + printf("%2d %4d %*p %5s %s", + stat.id, stat.refs, POINTER_WIDTH, stat.address, + buf, stat.name); + } else { + printf("%2d %4d %*p %8zx %s", + stat.id, stat.refs, POINTER_WIDTH, stat.address, + stat.size, stat.name); + } } - } - - if (verbose) { - printf(" (%s)\n", stat.pathname); - printf("\tContains modules:\n"); - printf("\t\t Id Name\n"); - for (modid = kldfirstmod(fileid); modid > 0; - modid = modfnext(modid)) - printmod(modid); - } else - printf("\n"); + + if (verbose) { + printf(" (%s)\n", stat.pathname); + printf("\tContains modules:\n"); + printf("\t\t Id Name\n"); + for (modid = kldfirstmod(fileid); modid > 0; modid = modfnext(modid)) + printmod(modid); + } else + printf("\n"); } static void usage(void) { - fprintf(stderr, "usage: kldstat [-d] [-h] [-q] [-v] [-i id] [-n filename]\n"); - fprintf(stderr, " kldstat [-d] [-q] [-m modname]\n"); - exit(1); + fprintf(stderr, "usage: kldstat [-d] [-h] [-q] [-v] [-i id] [-n filename]\n"); + fprintf(stderr, " kldstat [-d] [-q] [-m modname]\n"); + exit(1); } int main(int argc, char** argv) { - int c; - int humanized = 0; - int verbose = 0; - int fileid = 0; - int quiet = 0; - char* filename = NULL; - char* modname = NULL; - char* p; - - while ((c = getopt(argc, argv, "dhi:m:n:qv")) != -1) - switch (c) { - case 'd': - showdata = 1; - break; - case 'h': - humanized = 1; - break; - case 'i': - fileid = (int)strtoul(optarg, &p, 10); - if (*p != '\0') + int c; + int humanized = 0; + int verbose = 0; + int fileid = 0; + int quiet = 0; + char* filename = NULL; + char* modname = NULL; + char* p; + + while ((c = getopt(argc, argv, "dhi:m:n:qv")) != -1) + switch (c) { + case 'd': + showdata = 1; + break; + case 'h': + humanized = 1; + break; + case 'i': + fileid = (int)strtoul(optarg, &p, 10); + if (*p != '\0') + usage(); + break; + case 'm': + modname = optarg; + break; + case 'n': + filename = optarg; + break; + case 'q': + quiet = 1; + break; + case 'v': + verbose = 1; + break; + default: + usage(); + } + argc -= optind; + argv += optind; + + if (argc != 0) usage(); - break; - case 'm': - modname = optarg; - break; - case 'n': - filename = optarg; - break; - case 'q': - quiet = 1; - break; - case 'v': - verbose = 1; - break; - default: - usage(); - } - argc -= optind; - argv += optind; - if (argc != 0) - usage(); + if (modname != NULL) { + int modid; + struct module_stat stat; - if (modname != NULL) { - int modid; - struct module_stat stat; + if ((modid = modfind(modname)) < 0) { + if (!quiet) + warn("can't find module %s", modname); + return 1; + } else if (quiet) { + return 0; + } + + stat.version = sizeof(struct module_stat); + if (modstat(modid, &stat) < 0) + warn("can't stat module id %d", modid); + else { + if (showdata) { + printf("Id Refs Name data..(int, uint, ulong)\n"); + printf("%3d %4d %s (%d, %u, 0x%lx)\n", + stat.id, stat.refs, stat.name, + stat.data.intval, stat.data.uintval, + stat.data.ulongval); + } else { + printf("Id Refs Name\n"); + printf("%3d %4d %s\n", stat.id, stat.refs, + stat.name); + } + } - if ((modid = modfind(modname)) < 0) { - if (!quiet) - warn("can't find module %s", modname); - return 1; - } else if (quiet) { - return 0; + return 0; } - stat.version = sizeof(struct module_stat); - if (modstat(modid, &stat) < 0) - warn("can't stat module id %d", modid); - else { - if (showdata) { - printf("Id Refs Name data..(int, uint, ulong)\n"); - printf("%3d %4d %s (%d, %u, 0x%lx)\n", stat.id, stat.refs, stat.name, - stat.data.intval, stat.data.uintval, stat.data.ulongval); - } else { - printf("Id Refs Name\n"); - printf("%3d %4d %s\n", stat.id, stat.refs, stat.name); + if (filename != NULL) { + if ((fileid = kldfind(filename)) < 0) { + if (!quiet) + warn("can't find file %s", filename); + return 1; + } else if (quiet) { + return 0; } } + if (humanized) + printf("Id Refs Address%*c %5s Name\n", POINTER_WIDTH - 7, + ' ', "Size"); + else + printf("Id Refs Address%*c %8s Name\n", POINTER_WIDTH - 7, + ' ', "Size"); + if (fileid != 0) + printfile(fileid, verbose, humanized); + else + for (fileid = kldnext(0); fileid > 0; fileid = kldnext(fileid)) + printfile(fileid, verbose, humanized); + return 0; - } - - if (filename != NULL) { - if ((fileid = kldfind(filename)) < 0) { - if (!quiet) - warn("can't find file %s", filename); - return 1; - } else if (quiet) { - return 0; - } - } - - if (humanized) - printf("Id Refs Address%*c %5s Name\n", POINTER_WIDTH - 7, ' ', "Size"); - else - printf("Id Refs Address%*c %8s Name\n", POINTER_WIDTH - 7, ' ', "Size"); - if (fileid != 0) - printfile(fileid, verbose, humanized); - else - for (fileid = kldnext(0); fileid > 0; fileid = kldnext(fileid)) - printfile(fileid, verbose, humanized); - - return 0; } From nobody Tue Nov 9 21:13:03 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D52ED184CAEA; Tue, 9 Nov 2021 21:13:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpggN2s2wz4cv3; Tue, 9 Nov 2021 21:13:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE72544F6; Tue, 9 Nov 2021 21:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9LD3OB054314; Tue, 9 Nov 2021 21:13:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9LD3GO054313; Tue, 9 Nov 2021 21:13:03 GMT (envelope-from git) Date: Tue, 9 Nov 2021 21:13:03 GMT Message-Id: <202111092113.1A9LD3GO054313@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 66d795ec191b - main - service(8): Fix typo in man page. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66d795ec191b994f317b0ad812bb6e7943347c1f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=66d795ec191b994f317b0ad812bb6e7943347c1f commit 66d795ec191b994f317b0ad812bb6e7943347c1f Author: Hans Petter Selasky AuthorDate: 2021-11-09 21:09:57 +0000 Commit: Hans Petter Selasky CommitDate: 2021-11-09 21:12:19 +0000 service(8): Fix typo in man page. Differential revision: https://reviews.freebsd.org/D32582 Submitted by: christos@ MFC after: 1 week Sponsored by: NVIDIA Networking --- usr.sbin/service/service.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/service/service.8 b/usr.sbin/service/service.8 index 329bcb823f1d..c8e7f84c69de 100644 --- a/usr.sbin/service/service.8 +++ b/usr.sbin/service/service.8 @@ -138,7 +138,7 @@ complete service 'c/-/(e l r v)/' 'p/1/`service -l`/' \e status rcvar onestart onestop)/' .Ed .Pp -The following programmable completion entry can be use in +The following programmable completion entry can be used in .Xr bash 1 for the names of the rc.d scripts: .Bd -literal -offset -ident From nobody Tue Nov 9 21:33:37 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1356B18575BD; Tue, 9 Nov 2021 21:33:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hph760252z4lJn; Tue, 9 Nov 2021 21:33:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D683645ED; Tue, 9 Nov 2021 21:33:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9LXbOF080999; Tue, 9 Nov 2021 21:33:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9LXbuX080998; Tue, 9 Nov 2021 21:33:37 GMT (envelope-from git) Date: Tue, 9 Nov 2021 21:33:37 GMT Message-Id: <202111092133.1A9LXbuX080998@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 808108da324e - main - service(8): Bump date after commit 66d795ec191b994f317b0ad812bb6e7943347c1f . List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 808108da324eee5d777134317c3492058d0fe964 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=808108da324eee5d777134317c3492058d0fe964 commit 808108da324eee5d777134317c3492058d0fe964 Author: Hans Petter Selasky AuthorDate: 2021-11-09 21:32:16 +0000 Commit: Hans Petter Selasky CommitDate: 2021-11-09 21:33:04 +0000 service(8): Bump date after commit 66d795ec191b994f317b0ad812bb6e7943347c1f . Differential revision: https://reviews.freebsd.org/D32582 MFC after: 1 week Sponsored by: NVIDIA Networking --- usr.sbin/service/service.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/service/service.8 b/usr.sbin/service/service.8 index c8e7f84c69de..9902ae3c8574 100644 --- a/usr.sbin/service/service.8 +++ b/usr.sbin/service/service.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2021 +.Dd November 9, 2021 .Dt SERVICE 8 .Os .Sh NAME From nobody Tue Nov 9 21:51:34 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DDF15185EB81; Tue, 9 Nov 2021 21:51:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HphWp60C8z4qbM; Tue, 9 Nov 2021 21:51:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE12749DC; Tue, 9 Nov 2021 21:51:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9LpYJO004594; Tue, 9 Nov 2021 21:51:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9LpYT8004593; Tue, 9 Nov 2021 21:51:34 GMT (envelope-from git) Date: Tue, 9 Nov 2021 21:51:34 GMT Message-Id: <202111092151.1A9LpYT8004593@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 8e902c1d21a7 - main - mii: update URL for OUIs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8e902c1d21a74c82ffef9f104eb31b213f79f1db Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8e902c1d21a74c82ffef9f104eb31b213f79f1db commit 8e902c1d21a74c82ffef9f104eb31b213f79f1db Author: Bjoern A. Zeeb AuthorDate: 2021-11-09 21:35:45 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-09 21:48:02 +0000 mii: update URL for OUIs Update the URL for OUIs as the old one is 404 not even 301 anymore. --- sys/dev/mii/miidevs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/mii/miidevs b/sys/dev/mii/miidevs index 87035e1b7392..259718303ee5 100644 --- a/sys/dev/mii/miidevs +++ b/sys/dev/mii/miidevs @@ -33,7 +33,7 @@ $FreeBSD$ /* * List of known MII OUIs. - * For a complete list see http://standards.ieee.org/regauth/oui/ + * For a complete list see http://standards-oui.ieee.org/ * * XXX Vendors do obviously not agree how OUIs (24 bit) are mapped * to the 22 bits available in the id registers. From nobody Tue Nov 9 23:16:48 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 932B61847586; Tue, 9 Nov 2021 23:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpkQ838x6z3sB5; Tue, 9 Nov 2021 23:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 467515CAA; Tue, 9 Nov 2021 23:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1A9NGmud014623; Tue, 9 Nov 2021 23:16:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A9NGmHU014622; Tue, 9 Nov 2021 23:16:48 GMT (envelope-from git) Date: Tue, 9 Nov 2021 23:16:48 GMT Message-Id: <202111092316.1A9NGmHU014622@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: b2bf1a57873b - main - VOP_ALLOCATE: Update man page for Commit f0c9847a6c47 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b2bf1a57873b8d0c1c673d7b2f0ba5233e5d9890 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=b2bf1a57873b8d0c1c673d7b2f0ba5233e5d9890 commit b2bf1a57873b8d0c1c673d7b2f0ba5233e5d9890 Author: Rick Macklem AuthorDate: 2021-11-09 23:13:15 +0000 Commit: Rick Macklem CommitDate: 2021-11-09 23:13:15 +0000 VOP_ALLOCATE: Update man page for Commit f0c9847a6c47 Commit f0c9847a6c47 added the ioflag and cred arguments to VOP_ALLOCATE() for NFSv4.2 server support. This patch updates the man page for these arguments. Reviewed by: khng, gbe Differential Revision: https://reviews.freebsd.org/D32898 --- share/man/man9/VOP_ALLOCATE.9 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/share/man/man9/VOP_ALLOCATE.9 b/share/man/man9/VOP_ALLOCATE.9 index 6f1f54cc01fd..27ba348d5438 100644 --- a/share/man/man9/VOP_ALLOCATE.9 +++ b/share/man/man9/VOP_ALLOCATE.9 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 3, 2013 +.Dd November 8, 2021 .Dt VOP_ALLOCATE 9 .Os .Sh NAME @@ -37,7 +37,13 @@ .In sys/param.h .In sys/vnode.h .Ft int -.Fn VOP_ALLOCATE "struct vnode *vp" "off_t *offset" "off_t *len" +.Fo VOP_ALLOCATE +.Fa "struct vnode *vp" +.Fa "off_t *offset" +.Fa "off_t *len" +.Fa "int ioflag" +.Fa "struct ucred *cred" +.Fc .Sh DESCRIPTION This call allocates storage for a range of offsets in a file. It is used to implement the @@ -52,6 +58,10 @@ The vnode of the file. The start of the range to allocate storage for in the file. .It Fa len The length of the range to allocate storage for in the file. +.It Fa ioflag +Directives and hints to be given to the file system. +.It Fa cred +The credentials of the caller. .El .Pp The From nobody Wed Nov 10 01:16:27 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 68C80183CFFA; Wed, 10 Nov 2021 01:16:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hpn4C4f90z3G62; Wed, 10 Nov 2021 01:16:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58F83790B; Wed, 10 Nov 2021 01:16:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AA1GRkF074043; Wed, 10 Nov 2021 01:16:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AA1GR4L074042; Wed, 10 Nov 2021 01:16:27 GMT (envelope-from git) Date: Wed, 10 Nov 2021 01:16:27 GMT Message-Id: <202111100116.1AA1GR4L074042@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: d99b1d83b9e9 - main - cxgbe(4): sysctl to track the last L1_CFG32 requested by the driver. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d99b1d83b9e9ae2c47ffbd71a7c2a261d9eae2dd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=d99b1d83b9e9ae2c47ffbd71a7c2a261d9eae2dd commit d99b1d83b9e9ae2c47ffbd71a7c2a261d9eae2dd Author: Navdeep Parhar AuthorDate: 2021-11-03 18:00:44 +0000 Commit: Navdeep Parhar CommitDate: 2021-11-09 23:41:20 +0000 cxgbe(4): sysctl to track the last L1_CFG32 requested by the driver. dev...rcaps # sysctl dev.cc | grep rcaps dev.cc.1.rcaps: 581107776 dev.cc.0.rcaps: 582156414 MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/common/common.h | 1 + sys/dev/cxgbe/common/t4_hw.c | 1 + sys/dev/cxgbe/t4_main.c | 3 +++ 3 files changed, 5 insertions(+) diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h index 07d8ab2b40f0..50859e868b9d 100644 --- a/sys/dev/cxgbe/common/common.h +++ b/sys/dev/cxgbe/common/common.h @@ -444,6 +444,7 @@ struct link_config { int8_t requested_fc; /* flow control */ int8_t requested_fec; /* FEC */ u_int requested_speed; /* speed (Mbps) */ + uint32_t requested_caps;/* rcap in last l1cfg issued by the driver. */ uint32_t pcaps; /* link capabilities */ uint32_t acaps; /* advertised capabilities */ diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index f06b21120061..b9bf5df5ccc6 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -3975,6 +3975,7 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int mbox, unsigned int port, c.u.l1cfg.rcap = cpu_to_be32(fwcaps32_to_caps16(rcap)); } + lc->requested_caps = rcap; return t4_wr_mbox_ns(adap, mbox, &c, sizeof(c), NULL); } diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 66f48f2bf922..1c51e4847959 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -5703,6 +5703,7 @@ init_link_config(struct port_info *pi) PORT_LOCK_ASSERT_OWNED(pi); + lc->requested_caps = 0; lc->requested_speed = 0; if (t4_autoneg == 0) @@ -7770,6 +7771,8 @@ cxgbe_sysctls(struct port_info *pi) sysctl_autoneg, "I", "autonegotiation (-1 = not supported)"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rcaps", CTLFLAG_RD, + &pi->link_cfg.requested_caps, 0, "L1 config requested by driver"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "pcaps", CTLFLAG_RD, &pi->link_cfg.pcaps, 0, "port capabilities"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "acaps", CTLFLAG_RD, From nobody Wed Nov 10 06:40:05 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C5A16184BD8B; Wed, 10 Nov 2021 06:40:12 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpwFm3F8Yz4hTc; Wed, 10 Nov 2021 06:40:12 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 1AA6e5vU086921 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 9 Nov 2021 22:40:05 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 1AA6e504086920; Tue, 9 Nov 2021 22:40:05 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Tue, 9 Nov 2021 22:40:05 -0800 From: Gleb Smirnoff To: Mike Karels Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 20d59403961d - main - kernel: deprecate Internet Class A/B/C Message-ID: References: <202111091536.1A9Fa1NS099849@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202111091536.1A9Fa1NS099849@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4HpwFm3F8Yz4hTc X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N Mike, On Tue, Nov 09, 2021 at 03:36:01PM +0000, Mike Karels wrote: M> commit 20d59403961d531467cfab22163f49c131cc8b55 M> Author: Mike Karels M> AuthorDate: 2021-10-27 03:01:09 +0000 M> Commit: Mike Karels M> CommitDate: 2021-11-09 15:32:38 +0000 M> M> kernel: deprecate Internet Class A/B/C M> M> Hide historical Class A/B/C macros unless IN_HISTORICAL_NETS is defined; M> define it for user level. Define IN_MULTICAST separately from IN_CLASSD, M> and use it in pf instead of IN_CLASSD. Stop using class for setting M> default masks when not specified; instead, define new default mask M> (24 bits). Warn when an Internet address is set without a mask. M> M> MFC after: 1 month M> Reviewed by: cy M> Differential Revision: https://reviews.freebsd.org/D32708 Just my 2 cents. I wasn't added as reviewer of D32708 and that's why totally missed it. IMHO, such reviews should have #network as reviewer. I'm convinced that the status of classful addressing that was left exactly 10 years go in b365d954cc9c39e9854eeb726a60ae812e0fb2fe was good enough. After that change the only place where classes exist is the mask autoguessing. It was absolutely backward compatible and not breaking any POLA. And had zero code maintainance burden! Nobody have ever had problems with classes since. Did existence of the small piece of code in in_aifaddr_ioctl() or class definitions in in.h created any conflicts with development of any new code? The new /24 default is no better than classes. The only difference that classes maintained POLA and new default doesn't. For example, in my home network I have default router 10.0.0.1 and since it is class A network on my VMs and test boxes I can type # ifconfig vtnet0 10.6.6.6 and that is going to work. With this change no longer. -- Gleb Smirnoff From nobody Wed Nov 10 06:45:17 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F1FCD184CB63; Wed, 10 Nov 2021 06:45:19 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpwMg1LqNz4jBx; Wed, 10 Nov 2021 06:45:19 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 1AA6jH0q086957 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 9 Nov 2021 22:45:17 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 1AA6jHU2086956; Tue, 9 Nov 2021 22:45:17 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Tue, 9 Nov 2021 22:45:17 -0800 From: Gleb Smirnoff To: Mike Karels Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 20d59403961d - main - kernel: deprecate Internet Class A/B/C Message-ID: References: <202111091536.1A9Fa1NS099849@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4HpwMg1LqNz4jBx X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US]; local_wl_from(0.00)[freebsd.org] X-ThisMailContainsUnwantedMimeParts: N On Tue, Nov 09, 2021 at 10:40:05PM -0800, Gleb Smirnoff wrote: T> M> Differential Revision: https://reviews.freebsd.org/D32708 T> T> Just my 2 cents. I wasn't added as reviewer of D32708 and that's T> why totally missed it. IMHO, such reviews should have #network as T> reviewer. P.S. Thanks a lot for the libc, nestat/sockstat/systat cleanup wrt the classful APIs! That needed to be taken care of. Thanks! -- Gleb Smirnoff From nobody Wed Nov 10 06:46:44 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5CF51184F2D9; Wed, 10 Nov 2021 06:46:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpwPJ27Vpz4kh6; Wed, 10 Nov 2021 06:46:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29A4013FBA; Wed, 10 Nov 2021 06:46:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AA6kic5012263; Wed, 10 Nov 2021 06:46:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AA6kikD012262; Wed, 10 Nov 2021 06:46:44 GMT (envelope-from git) Date: Wed, 10 Nov 2021 06:46:44 GMT Message-Id: <202111100646.1AA6kikD012262@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 4c14980baab5 - main - grep: fix/remove references to -P List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4c14980baab5aa678fa8a1ca046892cf30e92d71 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=4c14980baab5aa678fa8a1ca046892cf30e92d71 commit 4c14980baab5aa678fa8a1ca046892cf30e92d71 Author: Kyle Evans AuthorDate: 2021-11-10 06:42:42 +0000 Commit: Kyle Evans CommitDate: 2021-11-10 06:42:42 +0000 grep: fix/remove references to -P -P in gnugrepland means PCRE, which we do not support. We may eventually support it if onigmo ends up getting imported as a more performant regex implementation, and we can re-add it properly in these places (and more) when that time comes. The optstr change is a functional nop; the case was not explicitly handled, thus ending in usage() anyways. Reported by: Vladimir Misev (via twitter) --- usr.bin/grep/grep.1 | 4 ++-- usr.bin/grep/grep.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.bin/grep/grep.1 b/usr.bin/grep/grep.1 index 5f314d0dff7c..3312f2510d30 100644 --- a/usr.bin/grep/grep.1 +++ b/usr.bin/grep/grep.1 @@ -30,7 +30,7 @@ .\" .\" @(#)grep.1 8.3 (Berkeley) 4/18/94 .\" -.Dd April 17, 2021 +.Dd November 10, 2021 .Dt GREP 1 .Os .Sh NAME @@ -558,7 +558,7 @@ utility is compliant with the specification. .Pp The flags -.Op Fl AaBbCDdGHhILmoPRSUVw +.Op Fl AaBbCDdGHhILmopRSUVw are extensions to that specification, and the behaviour of the .Fl f flag when used with an empty pattern file is left undefined. diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c index 6fbd6bee8ace..6306cbff5932 100644 --- a/usr.bin/grep/grep.c +++ b/usr.bin/grep/grep.c @@ -57,7 +57,7 @@ const char *errstr[] = { "", /* 1*/ "(standard input)", /* 2*/ "unknown %s option", -/* 3*/ "usage: %s [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A num] [-B num] [-C num]\n", +/* 3*/ "usage: %s [-abcDEFGHhIiLlmnOopqRSsUVvwxz] [-A num] [-B num] [-C num]\n", /* 4*/ "\t[-e pattern] [-f file] [--binary-files=value] [--color=when]\n", /* 5*/ "\t[--context=num] [--directories=action] [--label] [--line-buffered]\n", /* 6*/ "\t[--null] [pattern] [file ...]\n", @@ -110,7 +110,7 @@ bool lbflag; /* --line-buffered */ bool nullflag; /* --null */ char *label; /* --label */ const char *color; /* --color */ -int grepbehave = GREP_BASIC; /* -EFGP: type of the regex */ +int grepbehave = GREP_BASIC; /* -EFG: type of the regex */ int binbehave = BINFILE_BIN; /* -aIU: handling of binary files */ int filebehave = FILE_STDIO; int devbehave = DEV_READ; /* -D: handling of devices */ @@ -152,7 +152,7 @@ usage(void) exit(2); } -static const char *optstr = "0123456789A:B:C:D:EFGHILOPSRUVabcd:e:f:hilm:nopqrsuvwxyz"; +static const char *optstr = "0123456789A:B:C:D:EFGHILOSRUVabcd:e:f:hilm:nopqrsuvwxyz"; static const struct option long_options[] = { From nobody Wed Nov 10 08:28:08 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 681AF183A994; Wed, 10 Nov 2021 08:28:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpyfJ2SK3z3p0L; Wed, 10 Nov 2021 08:28:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35E5D15801; Wed, 10 Nov 2021 08:28:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AA8S8TE046206; Wed, 10 Nov 2021 08:28:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AA8S8QH046205; Wed, 10 Nov 2021 08:28:08 GMT (envelope-from git) Date: Wed, 10 Nov 2021 08:28:08 GMT Message-Id: <202111100828.1AA8S8QH046205@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dries Michiels Subject: git: e641c29a006a - main - UPDATING: Change update procedure to use etcupdate(8) over mergemaster(8) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: driesm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e641c29a006ae9f528f196386052355b42a53d75 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by driesm (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=e641c29a006ae9f528f196386052355b42a53d75 commit e641c29a006ae9f528f196386052355b42a53d75 Author: Dries Michiels AuthorDate: 2021-02-07 19:25:31 +0000 Commit: Dries Michiels CommitDate: 2021-11-10 08:18:42 +0000 UPDATING: Change update procedure to use etcupdate(8) over mergemaster(8) This commit aligns the steps in UPDATING with the steps from the handbook which already prefers etcupdate(8). While here also remove a dubious comment. PR: 252417 Reviewed by: ceri Approved by: philip (mentor), imp Differential Revision: https://reviews.freebsd.org/D28062 --- UPDATING | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/UPDATING b/UPDATING index bd79cda17aa3..f013826393fb 100644 --- a/UPDATING +++ b/UPDATING @@ -2463,9 +2463,9 @@ COMMON ITEMS: make installkernel KERNCONF=YOUR_KERNEL_HERE [1] [3] - mergemaster -Fp [5] + etcupdate -p [5] make installworld - mergemaster -Fi [4] + etcupdate -B [4] make delete-old [6] @@ -2501,9 +2501,9 @@ COMMON ITEMS: make installkernel KERNCONF=YOUR_KERNEL_HERE [1] [3] - mergemaster -Fp [5] + etcupdate -p [5] make installworld - mergemaster -Fi [4] + etcupdate -B [4] make delete-old [6] @@ -2545,15 +2545,11 @@ COMMON ITEMS: system. Attempting to do it by hand is not recommended and those that pursue this avenue should read this file carefully, as well as the archives of freebsd-current and freebsd-hackers mailing lists - for potential gotchas. The -U option is also useful to consider. - See mergemaster(8) for more information. + for potential gotchas. See etcupdate(8) for more information. [5] Usually this step is a no-op. However, from time to time you may need to do this if you get unknown user in the following - step. It never hurts to do it all the time. You may need to - install a new mergemaster (cd src/usr.sbin/mergemaster && make - install) after the buildworld before this step if you last updated - from current before 20130425 or from -stable before 20130430. + step. [6] This only deletes old files and directories. Old libraries can be deleted by "make delete-old-libs", but you have to make From nobody Wed Nov 10 09:05:14 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9EFE01850935; Wed, 10 Nov 2021 09:05:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HpzT641nLz4WV5; Wed, 10 Nov 2021 09:05:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6644215EF3; Wed, 10 Nov 2021 09:05:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AA95ENo099706; Wed, 10 Nov 2021 09:05:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AA95Elc099705; Wed, 10 Nov 2021 09:05:14 GMT (envelope-from git) Date: Wed, 10 Nov 2021 09:05:14 GMT Message-Id: <202111100905.1AA95Elc099705@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 65e485014b0d - main - Remove unfinished ARM Linuxulator support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 65e485014b0dcf53e0badf635d37930cf5b94708 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=65e485014b0dcf53e0badf635d37930cf5b94708 commit 65e485014b0dcf53e0badf635d37930cf5b94708 Author: Edward Tomasz Napierala AuthorDate: 2021-11-09 14:39:35 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-11-09 14:40:44 +0000 Remove unfinished ARM Linuxulator support This was never made to work, and given that 32-bit ARM support is quickly becoming irrelevant, there is no point in keeping it in the tree. Sponsored By: EPSRC Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D32918 --- sys/arm/linux/Makefile | 7 - sys/arm/linux/linux_proto.h | 1849 --------- sys/arm/linux/linux_syscall.h | 326 -- sys/arm/linux/linux_syscalls.c | 417 -- sys/arm/linux/linux_sysent.c | 427 -- sys/arm/linux/linux_systrace_args.c | 7741 ----------------------------------- sys/arm/linux/syscalls.conf | 11 - sys/arm/linux/syscalls.master | 1929 --------- 8 files changed, 12707 deletions(-) diff --git a/sys/arm/linux/Makefile b/sys/arm/linux/Makefile deleted file mode 100644 index 662c7f8fc42f..000000000000 --- a/sys/arm/linux/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# Makefile for syscall tables -# -# $FreeBSD$ - -GENERATED_PREFIX= linux_ - -.include "../../conf/sysent.mk" diff --git a/sys/arm/linux/linux_proto.h b/sys/arm/linux/linux_proto.h deleted file mode 100644 index 07245d6db4f3..000000000000 --- a/sys/arm/linux/linux_proto.h +++ /dev/null @@ -1,1849 +0,0 @@ -/* - * System call prototypes. - * - * DO NOT EDIT-- this file is automatically @generated. - * $FreeBSD$ - */ - -#ifndef _LINUX_SYSPROTO_H_ -#define _LINUX_SYSPROTO_H_ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -struct proc; - -struct thread; - -#define PAD_(t) (sizeof(register_t) <= sizeof(t) ? \ - 0 : sizeof(register_t) - sizeof(t)) - -#if BYTE_ORDER == LITTLE_ENDIAN -#define PADL_(t) 0 -#define PADR_(t) PAD_(t) -#else -#define PADL_(t) PAD_(t) -#define PADR_(t) 0 -#endif - -#define nosys linux_nosys -struct linux_exit_args { - char rval_l_[PADL_(int)]; int rval; char rval_r_[PADR_(int)]; -}; -struct linux_fork_args { - register_t dummy; -}; -struct linux_open_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; - char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; -}; -struct linux_creat_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; -}; -struct linux_link_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char to_l_[PADL_(char *)]; char * to; char to_r_[PADR_(char *)]; -}; -struct linux_unlink_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; -}; -struct linux_execve_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char argp_l_[PADL_(char **)]; char ** argp; char argp_r_[PADR_(char **)]; - char envp_l_[PADL_(char **)]; char ** envp; char envp_r_[PADR_(char **)]; -}; -struct linux_chdir_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; -}; -struct linux_mknod_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; - char dev_l_[PADL_(l_dev_t)]; l_dev_t dev; char dev_r_[PADR_(l_dev_t)]; -}; -struct linux_chmod_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char mode_l_[PADL_(l_mode_t)]; l_mode_t mode; char mode_r_[PADR_(l_mode_t)]; -}; -struct linux_lchown16_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char uid_l_[PADL_(l_uid16_t)]; l_uid16_t uid; char uid_r_[PADR_(l_uid16_t)]; - char gid_l_[PADL_(l_gid16_t)]; l_gid16_t gid; char gid_r_[PADR_(l_gid16_t)]; -}; -struct linux_lseek_args { - char fdes_l_[PADL_(l_uint)]; l_uint fdes; char fdes_r_[PADR_(l_uint)]; - char off_l_[PADL_(l_off_t)]; l_off_t off; char off_r_[PADR_(l_off_t)]; - char whence_l_[PADL_(l_int)]; l_int whence; char whence_r_[PADR_(l_int)]; -}; -struct linux_getpid_args { - register_t dummy; -}; -struct linux_mount_args { - char specialfile_l_[PADL_(char *)]; char * specialfile; char specialfile_r_[PADR_(char *)]; - char dir_l_[PADL_(char *)]; char * dir; char dir_r_[PADR_(char *)]; - char filesystemtype_l_[PADL_(char *)]; char * filesystemtype; char filesystemtype_r_[PADR_(char *)]; - char rwflag_l_[PADL_(l_ulong)]; l_ulong rwflag; char rwflag_r_[PADR_(l_ulong)]; - char data_l_[PADL_(void *)]; void * data; char data_r_[PADR_(void *)]; -}; -struct linux_setuid16_args { - char uid_l_[PADL_(l_uid16_t)]; l_uid16_t uid; char uid_r_[PADR_(l_uid16_t)]; -}; -struct linux_getuid16_args { - register_t dummy; -}; -struct linux_pause_args { - register_t dummy; -}; -struct linux_access_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char amode_l_[PADL_(l_int)]; l_int amode; char amode_r_[PADR_(l_int)]; -}; -struct linux_nice_args { - char inc_l_[PADL_(l_int)]; l_int inc; char inc_r_[PADR_(l_int)]; -}; -struct linux_kill_args { - char pid_l_[PADL_(l_int)]; l_int pid; char pid_r_[PADR_(l_int)]; - char signum_l_[PADL_(l_int)]; l_int signum; char signum_r_[PADR_(l_int)]; -}; -struct linux_rename_args { - char from_l_[PADL_(char *)]; char * from; char from_r_[PADR_(char *)]; - char to_l_[PADL_(char *)]; char * to; char to_r_[PADR_(char *)]; -}; -struct linux_mkdir_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char mode_l_[PADL_(l_int)]; l_int mode; char mode_r_[PADR_(l_int)]; -}; -struct linux_rmdir_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; -}; -struct linux_pipe_args { - char pipefds_l_[PADL_(l_int *)]; l_int * pipefds; char pipefds_r_[PADR_(l_int *)]; -}; -struct linux_times_args { - char buf_l_[PADL_(struct l_times_argv *)]; struct l_times_argv * buf; char buf_r_[PADR_(struct l_times_argv *)]; -}; -struct linux_brk_args { - char dsend_l_[PADL_(l_ulong)]; l_ulong dsend; char dsend_r_[PADR_(l_ulong)]; -}; -struct linux_setgid16_args { - char gid_l_[PADL_(l_gid16_t)]; l_gid16_t gid; char gid_r_[PADR_(l_gid16_t)]; -}; -struct linux_getgid16_args { - register_t dummy; -}; -struct linux_geteuid16_args { - register_t dummy; -}; -struct linux_getegid16_args { - register_t dummy; -}; -struct linux_umount_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; -}; -struct linux_ioctl_args { - char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; - char cmd_l_[PADL_(l_uint)]; l_uint cmd; char cmd_r_[PADR_(l_uint)]; - char arg_l_[PADL_(l_ulong)]; l_ulong arg; char arg_r_[PADR_(l_ulong)]; -}; -struct linux_fcntl_args { - char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; - char cmd_l_[PADL_(l_uint)]; l_uint cmd; char cmd_r_[PADR_(l_uint)]; - char arg_l_[PADL_(l_ulong)]; l_ulong arg; char arg_r_[PADR_(l_ulong)]; -}; -struct linux_ustat_args { - char dev_l_[PADL_(l_dev_t)]; l_dev_t dev; char dev_r_[PADR_(l_dev_t)]; - char ubuf_l_[PADL_(struct l_ustat *)]; struct l_ustat * ubuf; char ubuf_r_[PADR_(struct l_ustat *)]; -}; -struct linux_getppid_args { - register_t dummy; -}; -struct linux_sigaction_args { - char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; - char nsa_l_[PADL_(l_osigaction_t *)]; l_osigaction_t * nsa; char nsa_r_[PADR_(l_osigaction_t *)]; - char osa_l_[PADL_(l_osigaction_t *)]; l_osigaction_t * osa; char osa_r_[PADR_(l_osigaction_t *)]; -}; -struct linux_setreuid16_args { - char ruid_l_[PADL_(l_uid16_t)]; l_uid16_t ruid; char ruid_r_[PADR_(l_uid16_t)]; - char euid_l_[PADL_(l_uid16_t)]; l_uid16_t euid; char euid_r_[PADR_(l_uid16_t)]; -}; -struct linux_setregid16_args { - char rgid_l_[PADL_(l_gid16_t)]; l_gid16_t rgid; char rgid_r_[PADR_(l_gid16_t)]; - char egid_l_[PADL_(l_gid16_t)]; l_gid16_t egid; char egid_r_[PADR_(l_gid16_t)]; -}; -struct linux_sigsuspend_args { - char hist0_l_[PADL_(l_int)]; l_int hist0; char hist0_r_[PADR_(l_int)]; - char hist1_l_[PADL_(l_int)]; l_int hist1; char hist1_r_[PADR_(l_int)]; - char mask_l_[PADL_(l_osigset_t)]; l_osigset_t mask; char mask_r_[PADR_(l_osigset_t)]; -}; -struct linux_sigpending_args { - char mask_l_[PADL_(l_osigset_t *)]; l_osigset_t * mask; char mask_r_[PADR_(l_osigset_t *)]; -}; -struct linux_sethostname_args { - char hostname_l_[PADL_(char *)]; char * hostname; char hostname_r_[PADR_(char *)]; - char len_l_[PADL_(u_int)]; u_int len; char len_r_[PADR_(u_int)]; -}; -struct linux_setrlimit_args { - char resource_l_[PADL_(l_uint)]; l_uint resource; char resource_r_[PADR_(l_uint)]; - char rlim_l_[PADL_(struct l_rlimit *)]; struct l_rlimit * rlim; char rlim_r_[PADR_(struct l_rlimit *)]; -}; -struct linux_gettimeofday_args { - char tp_l_[PADL_(struct timeval32 *)]; struct timeval32 * tp; char tp_r_[PADR_(struct timeval32 *)]; - char tzp_l_[PADL_(struct timezone *)]; struct timezone * tzp; char tzp_r_[PADR_(struct timezone *)]; -}; -struct linux_settimeofday_args { - char tp_l_[PADL_(struct timeval32 *)]; struct timeval32 * tp; char tp_r_[PADR_(struct timeval32 *)]; - char tzp_l_[PADL_(struct timezone *)]; struct timezone * tzp; char tzp_r_[PADR_(struct timezone *)]; -}; -struct linux_getgroups16_args { - char gidsetsize_l_[PADL_(l_uint)]; l_uint gidsetsize; char gidsetsize_r_[PADR_(l_uint)]; - char gidset_l_[PADL_(l_gid16_t *)]; l_gid16_t * gidset; char gidset_r_[PADR_(l_gid16_t *)]; -}; -struct linux_setgroups16_args { - char gidsetsize_l_[PADL_(l_uint)]; l_uint gidsetsize; char gidsetsize_r_[PADR_(l_uint)]; - char gidset_l_[PADL_(l_gid16_t *)]; l_gid16_t * gidset; char gidset_r_[PADR_(l_gid16_t *)]; -}; -struct linux_symlink_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char to_l_[PADL_(char *)]; char * to; char to_r_[PADR_(char *)]; -}; -struct linux_readlink_args { - char name_l_[PADL_(char *)]; char * name; char name_r_[PADR_(char *)]; - char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; - char count_l_[PADL_(l_int)]; l_int count; char count_r_[PADR_(l_int)]; -}; -struct linux_reboot_args { - char magic1_l_[PADL_(l_int)]; l_int magic1; char magic1_r_[PADR_(l_int)]; - char magic2_l_[PADL_(l_int)]; l_int magic2; char magic2_r_[PADR_(l_int)]; - char cmd_l_[PADL_(l_uint)]; l_uint cmd; char cmd_r_[PADR_(l_uint)]; - char arg_l_[PADL_(void *)]; void * arg; char arg_r_[PADR_(void *)]; -}; -struct linux_truncate_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char length_l_[PADL_(l_ulong)]; l_ulong length; char length_r_[PADR_(l_ulong)]; -}; -struct linux_ftruncate_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char length_l_[PADL_(long)]; long length; char length_r_[PADR_(long)]; -}; -struct linux_getpriority_args { - char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)]; - char who_l_[PADL_(int)]; int who; char who_r_[PADR_(int)]; -}; -struct linux_statfs_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char buf_l_[PADL_(struct l_statfs_buf *)]; struct l_statfs_buf * buf; char buf_r_[PADR_(struct l_statfs_buf *)]; -}; -struct linux_fstatfs_args { - char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; - char buf_l_[PADL_(struct l_statfs_buf *)]; struct l_statfs_buf * buf; char buf_r_[PADR_(struct l_statfs_buf *)]; -}; -struct linux_syslog_args { - char type_l_[PADL_(l_int)]; l_int type; char type_r_[PADR_(l_int)]; - char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; - char len_l_[PADL_(l_int)]; l_int len; char len_r_[PADR_(l_int)]; -}; -struct linux_setitimer_args { - char which_l_[PADL_(l_int)]; l_int which; char which_r_[PADR_(l_int)]; - char itv_l_[PADL_(struct l_itimerval *)]; struct l_itimerval * itv; char itv_r_[PADR_(struct l_itimerval *)]; - char oitv_l_[PADL_(struct l_itimerval *)]; struct l_itimerval * oitv; char oitv_r_[PADR_(struct l_itimerval *)]; -}; -struct linux_getitimer_args { - char which_l_[PADL_(l_int)]; l_int which; char which_r_[PADR_(l_int)]; - char itv_l_[PADL_(struct l_itimerval *)]; struct l_itimerval * itv; char itv_r_[PADR_(struct l_itimerval *)]; -}; -struct linux_newstat_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char buf_l_[PADL_(struct l_newstat *)]; struct l_newstat * buf; char buf_r_[PADR_(struct l_newstat *)]; -}; -struct linux_newlstat_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char buf_l_[PADL_(struct l_newstat *)]; struct l_newstat * buf; char buf_r_[PADR_(struct l_newstat *)]; -}; -struct linux_newfstat_args { - char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; - char buf_l_[PADL_(struct l_newstat *)]; struct l_newstat * buf; char buf_r_[PADR_(struct l_newstat *)]; -}; -struct linux_vhangup_args { - register_t dummy; -}; -struct linux_wait4_args { - char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char status_l_[PADL_(l_int *)]; l_int * status; char status_r_[PADR_(l_int *)]; - char options_l_[PADL_(l_int)]; l_int options; char options_r_[PADR_(l_int)]; - char rusage_l_[PADL_(void *)]; void * rusage; char rusage_r_[PADR_(void *)]; -}; -struct linux_swapoff_args { - register_t dummy; -}; -struct linux_sysinfo_args { - char info_l_[PADL_(struct l_sysinfo *)]; struct l_sysinfo * info; char info_r_[PADR_(struct l_sysinfo *)]; -}; -struct linux_sigreturn_args { - char sfp_l_[PADL_(struct l_sigframe *)]; struct l_sigframe * sfp; char sfp_r_[PADR_(struct l_sigframe *)]; -}; -struct linux_clone_args { - char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)]; - char stack_l_[PADL_(l_ulong)]; l_ulong stack; char stack_r_[PADR_(l_ulong)]; - char parent_tidptr_l_[PADL_(l_int *)]; l_int * parent_tidptr; char parent_tidptr_r_[PADR_(l_int *)]; - char tls_l_[PADL_(l_ulong)]; l_ulong tls; char tls_r_[PADR_(l_ulong)]; - char child_tidptr_l_[PADL_(l_int *)]; l_int * child_tidptr; char child_tidptr_r_[PADR_(l_int *)]; -}; -struct linux_setdomainname_args { - char name_l_[PADL_(char *)]; char * name; char name_r_[PADR_(char *)]; - char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; -}; -struct linux_newuname_args { - char buf_l_[PADL_(struct l_new_utsname *)]; struct l_new_utsname * buf; char buf_r_[PADR_(struct l_new_utsname *)]; -}; -struct linux_adjtimex_args { - register_t dummy; -}; -struct linux_mprotect_args { - char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)]; - char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; - char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)]; -}; -struct linux_sigprocmask_args { - char how_l_[PADL_(l_int)]; l_int how; char how_r_[PADR_(l_int)]; - char mask_l_[PADL_(l_osigset_t *)]; l_osigset_t * mask; char mask_r_[PADR_(l_osigset_t *)]; - char omask_l_[PADL_(l_osigset_t *)]; l_osigset_t * omask; char omask_r_[PADR_(l_osigset_t *)]; -}; -struct linux_init_module_args { - register_t dummy; -}; -struct linux_delete_module_args { - register_t dummy; -}; -struct linux_quotactl_args { - register_t dummy; -}; -struct linux_bdflush_args { - register_t dummy; -}; -struct linux_sysfs_args { - char option_l_[PADL_(l_int)]; l_int option; char option_r_[PADR_(l_int)]; - char arg1_l_[PADL_(l_ulong)]; l_ulong arg1; char arg1_r_[PADR_(l_ulong)]; - char arg2_l_[PADL_(l_ulong)]; l_ulong arg2; char arg2_r_[PADR_(l_ulong)]; -}; -struct linux_personality_args { - char per_l_[PADL_(l_ulong)]; l_ulong per; char per_r_[PADR_(l_ulong)]; -}; -struct linux_setfsuid16_args { - char uid_l_[PADL_(l_uid16_t)]; l_uid16_t uid; char uid_r_[PADR_(l_uid16_t)]; -}; -struct linux_setfsgid16_args { - char gid_l_[PADL_(l_gid16_t)]; l_gid16_t gid; char gid_r_[PADR_(l_gid16_t)]; -}; -struct linux_llseek_args { - char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; - char ohigh_l_[PADL_(l_ulong)]; l_ulong ohigh; char ohigh_r_[PADR_(l_ulong)]; - char olow_l_[PADL_(l_ulong)]; l_ulong olow; char olow_r_[PADR_(l_ulong)]; - char res_l_[PADL_(l_loff_t *)]; l_loff_t * res; char res_r_[PADR_(l_loff_t *)]; - char whence_l_[PADL_(l_uint)]; l_uint whence; char whence_r_[PADR_(l_uint)]; -}; -struct linux_getdents_args { - char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; - char dent_l_[PADL_(void *)]; void * dent; char dent_r_[PADR_(void *)]; - char count_l_[PADL_(l_uint)]; l_uint count; char count_r_[PADR_(l_uint)]; -}; -struct linux_select_args { - char nfds_l_[PADL_(l_int)]; l_int nfds; char nfds_r_[PADR_(l_int)]; - char readfds_l_[PADL_(l_fd_set *)]; l_fd_set * readfds; char readfds_r_[PADR_(l_fd_set *)]; - char writefds_l_[PADL_(l_fd_set *)]; l_fd_set * writefds; char writefds_r_[PADR_(l_fd_set *)]; - char exceptfds_l_[PADL_(l_fd_set *)]; l_fd_set * exceptfds; char exceptfds_r_[PADR_(l_fd_set *)]; - char timeout_l_[PADL_(struct l_timeval *)]; struct l_timeval * timeout; char timeout_r_[PADR_(struct l_timeval *)]; -}; -struct linux_msync_args { - char addr_l_[PADL_(l_ulong)]; l_ulong addr; char addr_r_[PADR_(l_ulong)]; - char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; - char fl_l_[PADL_(l_int)]; l_int fl; char fl_r_[PADR_(l_int)]; -}; -struct linux_getsid_args { - char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; -}; -struct linux_fdatasync_args { - char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; -}; -struct linux_sysctl_args { - char args_l_[PADL_(struct l___sysctl_args *)]; struct l___sysctl_args * args; char args_r_[PADR_(struct l___sysctl_args *)]; -}; -struct linux_sched_setparam_args { - char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; -}; -struct linux_sched_getparam_args { - char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; -}; -struct linux_sched_setscheduler_args { - char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; - char param_l_[PADL_(struct sched_param *)]; struct sched_param * param; char param_r_[PADR_(struct sched_param *)]; -}; -struct linux_sched_getscheduler_args { - char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; -}; -struct linux_sched_get_priority_max_args { - char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; -}; -struct linux_sched_get_priority_min_args { - char policy_l_[PADL_(l_int)]; l_int policy; char policy_r_[PADR_(l_int)]; -}; -struct linux_sched_rr_get_interval_args { - char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char interval_l_[PADL_(struct l_timespec *)]; struct l_timespec * interval; char interval_r_[PADR_(struct l_timespec *)]; -}; -struct linux_nanosleep_args { - char rqtp_l_[PADL_(const struct l_timespec *)]; const struct l_timespec * rqtp; char rqtp_r_[PADR_(const struct l_timespec *)]; - char rmtp_l_[PADL_(struct l_timespec *)]; struct l_timespec * rmtp; char rmtp_r_[PADR_(struct l_timespec *)]; -}; -struct linux_mremap_args { - char addr_l_[PADL_(l_ulong)]; l_ulong addr; char addr_r_[PADR_(l_ulong)]; - char old_len_l_[PADL_(l_ulong)]; l_ulong old_len; char old_len_r_[PADR_(l_ulong)]; - char new_len_l_[PADL_(l_ulong)]; l_ulong new_len; char new_len_r_[PADR_(l_ulong)]; - char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)]; - char new_addr_l_[PADL_(l_ulong)]; l_ulong new_addr; char new_addr_r_[PADR_(l_ulong)]; -}; -struct linux_setresuid16_args { - char ruid_l_[PADL_(l_uid16_t)]; l_uid16_t ruid; char ruid_r_[PADR_(l_uid16_t)]; - char euid_l_[PADL_(l_uid16_t)]; l_uid16_t euid; char euid_r_[PADR_(l_uid16_t)]; - char suid_l_[PADL_(l_uid16_t)]; l_uid16_t suid; char suid_r_[PADR_(l_uid16_t)]; -}; -struct linux_getresuid16_args { - char ruid_l_[PADL_(l_uid16_t *)]; l_uid16_t * ruid; char ruid_r_[PADR_(l_uid16_t *)]; - char euid_l_[PADL_(l_uid16_t *)]; l_uid16_t * euid; char euid_r_[PADR_(l_uid16_t *)]; - char suid_l_[PADL_(l_uid16_t *)]; l_uid16_t * suid; char suid_r_[PADR_(l_uid16_t *)]; -}; -struct linux_poll_args { - char fds_l_[PADL_(struct pollfd*)]; struct pollfd* fds; char fds_r_[PADR_(struct pollfd*)]; - char nfds_l_[PADL_(unsigned int)]; unsigned int nfds; char nfds_r_[PADR_(unsigned int)]; - char timeout_l_[PADL_(long)]; long timeout; char timeout_r_[PADR_(long)]; -}; -struct linux_setresgid16_args { - char rgid_l_[PADL_(l_gid16_t)]; l_gid16_t rgid; char rgid_r_[PADR_(l_gid16_t)]; - char egid_l_[PADL_(l_gid16_t)]; l_gid16_t egid; char egid_r_[PADR_(l_gid16_t)]; - char sgid_l_[PADL_(l_gid16_t)]; l_gid16_t sgid; char sgid_r_[PADR_(l_gid16_t)]; -}; -struct linux_getresgid16_args { - char rgid_l_[PADL_(l_gid16_t *)]; l_gid16_t * rgid; char rgid_r_[PADR_(l_gid16_t *)]; - char egid_l_[PADL_(l_gid16_t *)]; l_gid16_t * egid; char egid_r_[PADR_(l_gid16_t *)]; - char sgid_l_[PADL_(l_gid16_t *)]; l_gid16_t * sgid; char sgid_r_[PADR_(l_gid16_t *)]; -}; -struct linux_prctl_args { - char option_l_[PADL_(l_int)]; l_int option; char option_r_[PADR_(l_int)]; - char arg2_l_[PADL_(l_int)]; l_int arg2; char arg2_r_[PADR_(l_int)]; - char arg3_l_[PADL_(l_int)]; l_int arg3; char arg3_r_[PADR_(l_int)]; - char arg4_l_[PADL_(l_int)]; l_int arg4; char arg4_r_[PADR_(l_int)]; - char arg5_l_[PADL_(l_int)]; l_int arg5; char arg5_r_[PADR_(l_int)]; -}; -struct linux_rt_sigreturn_args { - char ucp_l_[PADL_(struct l_ucontext *)]; struct l_ucontext * ucp; char ucp_r_[PADR_(struct l_ucontext *)]; -}; -struct linux_rt_sigaction_args { - char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; - char act_l_[PADL_(l_sigaction_t *)]; l_sigaction_t * act; char act_r_[PADR_(l_sigaction_t *)]; - char oact_l_[PADL_(l_sigaction_t *)]; l_sigaction_t * oact; char oact_r_[PADR_(l_sigaction_t *)]; - char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; -}; -struct linux_rt_sigprocmask_args { - char how_l_[PADL_(l_int)]; l_int how; char how_r_[PADR_(l_int)]; - char mask_l_[PADL_(l_sigset_t *)]; l_sigset_t * mask; char mask_r_[PADR_(l_sigset_t *)]; - char omask_l_[PADL_(l_sigset_t *)]; l_sigset_t * omask; char omask_r_[PADR_(l_sigset_t *)]; - char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; -}; -struct linux_rt_sigpending_args { - char set_l_[PADL_(l_sigset_t *)]; l_sigset_t * set; char set_r_[PADR_(l_sigset_t *)]; - char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; -}; -struct linux_rt_sigtimedwait_args { - char mask_l_[PADL_(l_sigset_t *)]; l_sigset_t * mask; char mask_r_[PADR_(l_sigset_t *)]; - char ptr_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * ptr; char ptr_r_[PADR_(l_siginfo_t *)]; - char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)]; - char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; -}; -struct linux_rt_sigqueueinfo_args { - char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)]; - char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)]; -}; -struct linux_rt_sigsuspend_args { - char newset_l_[PADL_(l_sigset_t *)]; l_sigset_t * newset; char newset_r_[PADR_(l_sigset_t *)]; - char sigsetsize_l_[PADL_(l_size_t)]; l_size_t sigsetsize; char sigsetsize_r_[PADR_(l_size_t)]; -}; -struct linux_pread_args { - char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; - char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; - char nbyte_l_[PADL_(l_size_t)]; l_size_t nbyte; char nbyte_r_[PADR_(l_size_t)]; - char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; -}; -struct linux_pwrite_args { - char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; - char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; - char nbyte_l_[PADL_(l_size_t)]; l_size_t nbyte; char nbyte_r_[PADR_(l_size_t)]; - char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; -}; -struct linux_chown16_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char uid_l_[PADL_(l_uid16_t)]; l_uid16_t uid; char uid_r_[PADR_(l_uid16_t)]; - char gid_l_[PADL_(l_gid16_t)]; l_gid16_t gid; char gid_r_[PADR_(l_gid16_t)]; -}; -struct linux_getcwd_args { - char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; - char bufsize_l_[PADL_(l_ulong)]; l_ulong bufsize; char bufsize_r_[PADR_(l_ulong)]; -}; -struct linux_capget_args { - char hdrp_l_[PADL_(struct l_user_cap_header *)]; struct l_user_cap_header * hdrp; char hdrp_r_[PADR_(struct l_user_cap_header *)]; - char datap_l_[PADL_(struct l_user_cap_data *)]; struct l_user_cap_data * datap; char datap_r_[PADR_(struct l_user_cap_data *)]; -}; -struct linux_capset_args { - char hdrp_l_[PADL_(struct l_user_cap_header *)]; struct l_user_cap_header * hdrp; char hdrp_r_[PADR_(struct l_user_cap_header *)]; - char datap_l_[PADL_(struct l_user_cap_data *)]; struct l_user_cap_data * datap; char datap_r_[PADR_(struct l_user_cap_data *)]; -}; -struct linux_sigaltstack_args { - char uss_l_[PADL_(l_stack_t *)]; l_stack_t * uss; char uss_r_[PADR_(l_stack_t *)]; - char uoss_l_[PADL_(l_stack_t *)]; l_stack_t * uoss; char uoss_r_[PADR_(l_stack_t *)]; -}; -struct linux_sendfile_args { - char out_l_[PADL_(l_int)]; l_int out; char out_r_[PADR_(l_int)]; - char in_l_[PADL_(l_int)]; l_int in; char in_r_[PADR_(l_int)]; - char offset_l_[PADL_(l_long *)]; l_long * offset; char offset_r_[PADR_(l_long *)]; - char count_l_[PADL_(l_size_t)]; l_size_t count; char count_r_[PADR_(l_size_t)]; -}; -struct linux_vfork_args { - register_t dummy; -}; -struct linux_getrlimit_args { - char resource_l_[PADL_(l_uint)]; l_uint resource; char resource_r_[PADR_(l_uint)]; - char rlim_l_[PADL_(struct l_rlimit *)]; struct l_rlimit * rlim; char rlim_r_[PADR_(struct l_rlimit *)]; -}; -struct linux_mmap2_args { - char addr_l_[PADL_(l_ulong)]; l_ulong addr; char addr_r_[PADR_(l_ulong)]; - char len_l_[PADL_(l_ulong)]; l_ulong len; char len_r_[PADR_(l_ulong)]; - char prot_l_[PADL_(l_ulong)]; l_ulong prot; char prot_r_[PADR_(l_ulong)]; - char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)]; - char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)]; - char pgoff_l_[PADL_(l_ulong)]; l_ulong pgoff; char pgoff_r_[PADR_(l_ulong)]; -}; -struct linux_truncate64_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char length_l_[PADL_(l_loff_t)]; l_loff_t length; char length_r_[PADR_(l_loff_t)]; -}; -struct linux_ftruncate64_args { - char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; - char length_l_[PADL_(l_loff_t)]; l_loff_t length; char length_r_[PADR_(l_loff_t)]; -}; -struct linux_stat64_args { - char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; - char statbuf_l_[PADL_(struct l_stat64 *)]; struct l_stat64 * statbuf; char statbuf_r_[PADR_(struct l_stat64 *)]; -}; -struct linux_lstat64_args { - char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)]; - char statbuf_l_[PADL_(struct l_stat64 *)]; struct l_stat64 * statbuf; char statbuf_r_[PADR_(struct l_stat64 *)]; -}; -struct linux_fstat64_args { - char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; - char statbuf_l_[PADL_(struct l_stat64 *)]; struct l_stat64 * statbuf; char statbuf_r_[PADR_(struct l_stat64 *)]; -}; -struct linux_lchown_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char uid_l_[PADL_(l_uid_t)]; l_uid_t uid; char uid_r_[PADR_(l_uid_t)]; - char gid_l_[PADL_(l_gid_t)]; l_gid_t gid; char gid_r_[PADR_(l_gid_t)]; -}; -struct linux_getuid_args { - register_t dummy; -}; -struct linux_getgid_args { - register_t dummy; -}; -struct linux_getgroups_args { - char gidsetsize_l_[PADL_(l_int)]; l_int gidsetsize; char gidsetsize_r_[PADR_(l_int)]; - char grouplist_l_[PADL_(l_gid_t *)]; l_gid_t * grouplist; char grouplist_r_[PADR_(l_gid_t *)]; -}; -struct linux_setgroups_args { - char gidsetsize_l_[PADL_(l_int)]; l_int gidsetsize; char gidsetsize_r_[PADR_(l_int)]; - char grouplist_l_[PADL_(l_gid_t *)]; l_gid_t * grouplist; char grouplist_r_[PADR_(l_gid_t *)]; -}; -struct linux_chown_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char uid_l_[PADL_(l_uid_t)]; l_uid_t uid; char uid_r_[PADR_(l_uid_t)]; - char gid_l_[PADL_(l_gid_t)]; l_gid_t gid; char gid_r_[PADR_(l_gid_t)]; -}; -struct linux_setfsuid_args { - char uid_l_[PADL_(l_uid_t)]; l_uid_t uid; char uid_r_[PADR_(l_uid_t)]; -}; -struct linux_setfsgid_args { - char gid_l_[PADL_(l_gid_t)]; l_gid_t gid; char gid_r_[PADR_(l_gid_t)]; -}; -struct linux_getdents64_args { - char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; - char dirent_l_[PADL_(void *)]; void * dirent; char dirent_r_[PADR_(void *)]; - char count_l_[PADL_(l_uint)]; l_uint count; char count_r_[PADR_(l_uint)]; -}; -struct linux_pivot_root_args { - char new_root_l_[PADL_(char *)]; char * new_root; char new_root_r_[PADR_(char *)]; - char put_old_l_[PADL_(char *)]; char * put_old; char put_old_r_[PADR_(char *)]; -}; -struct linux_mincore_args { - char start_l_[PADL_(l_ulong)]; l_ulong start; char start_r_[PADR_(l_ulong)]; - char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; - char vec_l_[PADL_(u_char *)]; u_char * vec; char vec_r_[PADR_(u_char *)]; -}; -struct linux_fcntl64_args { - char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; - char cmd_l_[PADL_(l_uint)]; l_uint cmd; char cmd_r_[PADR_(l_uint)]; - char arg_l_[PADL_(l_ulong)]; l_ulong arg; char arg_r_[PADR_(l_ulong)]; -}; -struct linux_gettid_args { - register_t dummy; -}; -struct linux_setxattr_args { - register_t dummy; -}; -struct linux_lsetxattr_args { - register_t dummy; -}; -struct linux_fsetxattr_args { - register_t dummy; -}; -struct linux_getxattr_args { - register_t dummy; -}; -struct linux_lgetxattr_args { - register_t dummy; -}; -struct linux_fgetxattr_args { - register_t dummy; -}; -struct linux_listxattr_args { - register_t dummy; -}; -struct linux_llistxattr_args { - register_t dummy; -}; -struct linux_flistxattr_args { - register_t dummy; -}; -struct linux_removexattr_args { - register_t dummy; -}; -struct linux_lremovexattr_args { - register_t dummy; -}; -struct linux_fremovexattr_args { - register_t dummy; -}; -struct linux_tkill_args { - char tid_l_[PADL_(int)]; int tid; char tid_r_[PADR_(int)]; - char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)]; -}; -struct linux_sendfile64_args { - char out_l_[PADL_(l_int)]; l_int out; char out_r_[PADR_(l_int)]; - char in_l_[PADL_(l_int)]; l_int in; char in_r_[PADR_(l_int)]; - char offset_l_[PADL_(l_loff_t *)]; l_loff_t * offset; char offset_r_[PADR_(l_loff_t *)]; - char count_l_[PADL_(l_size_t)]; l_size_t count; char count_r_[PADR_(l_size_t)]; -}; -struct linux_sys_futex_args { - char uaddr_l_[PADL_(uint32_t *)]; uint32_t * uaddr; char uaddr_r_[PADR_(uint32_t *)]; - char op_l_[PADL_(l_int)]; l_int op; char op_r_[PADR_(l_int)]; - char val_l_[PADL_(uint32_t)]; uint32_t val; char val_r_[PADR_(uint32_t)]; - char timeout_l_[PADL_(struct l_timespec *)]; struct l_timespec * timeout; char timeout_r_[PADR_(struct l_timespec *)]; - char uaddr2_l_[PADL_(uint32_t *)]; uint32_t * uaddr2; char uaddr2_r_[PADR_(uint32_t *)]; - char val3_l_[PADL_(uint32_t)]; uint32_t val3; char val3_r_[PADR_(uint32_t)]; -}; -struct linux_sched_setaffinity_args { - char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char len_l_[PADL_(l_uint)]; l_uint len; char len_r_[PADR_(l_uint)]; - char user_mask_ptr_l_[PADL_(l_ulong *)]; l_ulong * user_mask_ptr; char user_mask_ptr_r_[PADR_(l_ulong *)]; -}; -struct linux_sched_getaffinity_args { - char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)]; - char len_l_[PADL_(l_uint)]; l_uint len; char len_r_[PADR_(l_uint)]; - char user_mask_ptr_l_[PADL_(l_ulong *)]; l_ulong * user_mask_ptr; char user_mask_ptr_r_[PADR_(l_ulong *)]; -}; -struct linux_exit_group_args { - char error_code_l_[PADL_(int)]; int error_code; char error_code_r_[PADR_(int)]; -}; -struct linux_lookup_dcookie_args { - register_t dummy; -}; -struct linux_epoll_create_args { - char size_l_[PADL_(l_int)]; l_int size; char size_r_[PADR_(l_int)]; -}; -struct linux_epoll_ctl_args { - char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)]; - char op_l_[PADL_(l_int)]; l_int op; char op_r_[PADR_(l_int)]; - char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; - char event_l_[PADL_(struct epoll_event *)]; struct epoll_event * event; char event_r_[PADR_(struct epoll_event *)]; -}; -struct linux_epoll_wait_args { - char epfd_l_[PADL_(l_int)]; l_int epfd; char epfd_r_[PADR_(l_int)]; - char events_l_[PADL_(struct epoll_event *)]; struct epoll_event * events; char events_r_[PADR_(struct epoll_event *)]; - char maxevents_l_[PADL_(l_int)]; l_int maxevents; char maxevents_r_[PADR_(l_int)]; - char timeout_l_[PADL_(l_int)]; l_int timeout; char timeout_r_[PADR_(l_int)]; -}; -struct linux_remap_file_pages_args { - register_t dummy; -}; -struct linux_set_tid_address_args { - char tidptr_l_[PADL_(int *)]; int * tidptr; char tidptr_r_[PADR_(int *)]; -}; -struct linux_timer_create_args { - char clock_id_l_[PADL_(clockid_t)]; clockid_t clock_id; char clock_id_r_[PADR_(clockid_t)]; - char evp_l_[PADL_(struct sigevent *)]; struct sigevent * evp; char evp_r_[PADR_(struct sigevent *)]; - char timerid_l_[PADL_(l_timer_t *)]; l_timer_t * timerid; char timerid_r_[PADR_(l_timer_t *)]; -}; -struct linux_timer_settime_args { - char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; - char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; - char new_l_[PADL_(const struct itimerspec *)]; const struct itimerspec * new; char new_r_[PADR_(const struct itimerspec *)]; - char old_l_[PADL_(struct itimerspec *)]; struct itimerspec * old; char old_r_[PADR_(struct itimerspec *)]; -}; -struct linux_timer_gettime_args { - char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; - char setting_l_[PADL_(struct itimerspec *)]; struct itimerspec * setting; char setting_r_[PADR_(struct itimerspec *)]; -}; -struct linux_timer_getoverrun_args { - char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; -}; -struct linux_timer_delete_args { - char timerid_l_[PADL_(l_timer_t)]; l_timer_t timerid; char timerid_r_[PADR_(l_timer_t)]; -}; -struct linux_clock_settime_args { - char which_l_[PADL_(clockid_t)]; clockid_t which; char which_r_[PADR_(clockid_t)]; - char tp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tp; char tp_r_[PADR_(struct l_timespec *)]; -}; -struct linux_clock_gettime_args { - char which_l_[PADL_(clockid_t)]; clockid_t which; char which_r_[PADR_(clockid_t)]; - char tp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tp; char tp_r_[PADR_(struct l_timespec *)]; -}; -struct linux_clock_getres_args { - char which_l_[PADL_(clockid_t)]; clockid_t which; char which_r_[PADR_(clockid_t)]; - char tp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tp; char tp_r_[PADR_(struct l_timespec *)]; -}; -struct linux_clock_nanosleep_args { - char which_l_[PADL_(clockid_t)]; clockid_t which; char which_r_[PADR_(clockid_t)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; - char rqtp_l_[PADL_(struct l_timespec *)]; struct l_timespec * rqtp; char rqtp_r_[PADR_(struct l_timespec *)]; - char rmtp_l_[PADL_(struct l_timespec *)]; struct l_timespec * rmtp; char rmtp_r_[PADR_(struct l_timespec *)]; -}; -struct linux_statfs64_args { - char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; - char bufsize_l_[PADL_(size_t)]; size_t bufsize; char bufsize_r_[PADR_(size_t)]; - char buf_l_[PADL_(struct l_statfs64_buf *)]; struct l_statfs64_buf * buf; char buf_r_[PADR_(struct l_statfs64_buf *)]; -}; -struct linux_fstatfs64_args { - char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; - char bufsize_l_[PADL_(size_t)]; size_t bufsize; char bufsize_r_[PADR_(size_t)]; - char buf_l_[PADL_(struct l_statfs64_buf *)]; struct l_statfs64_buf * buf; char buf_r_[PADR_(struct l_statfs64_buf *)]; -}; -struct linux_tgkill_args { - char tgid_l_[PADL_(int)]; int tgid; char tgid_r_[PADR_(int)]; - char pid_l_[PADL_(int)]; int pid; char pid_r_[PADR_(int)]; - char sig_l_[PADL_(int)]; int sig; char sig_r_[PADR_(int)]; -}; -struct linux_utimes_args { - char fname_l_[PADL_(char *)]; char * fname; char fname_r_[PADR_(char *)]; - char tptr_l_[PADL_(struct l_timeval *)]; struct l_timeval * tptr; char tptr_r_[PADR_(struct l_timeval *)]; -}; -struct linux_fadvise64_64_args { - char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; - char offset_l_[PADL_(l_loff_t)]; l_loff_t offset; char offset_r_[PADR_(l_loff_t)]; - char len_l_[PADL_(l_loff_t)]; l_loff_t len; char len_r_[PADR_(l_loff_t)]; - char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; -}; -struct linux_mq_open_args { - char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char oflag_l_[PADL_(int)]; int oflag; char oflag_r_[PADR_(int)]; - char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)]; - char attr_l_[PADL_(struct mq_attr *)]; struct mq_attr * attr; char attr_r_[PADR_(struct mq_attr *)]; -}; -struct linux_mq_unlink_args { - char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; -}; -struct linux_mq_timedsend_args { - char mqd_l_[PADL_(l_mqd_t)]; l_mqd_t mqd; char mqd_r_[PADR_(l_mqd_t)]; - char msg_ptr_l_[PADL_(const char *)]; const char * msg_ptr; char msg_ptr_r_[PADR_(const char *)]; - char msg_len_l_[PADL_(size_t)]; size_t msg_len; char msg_len_r_[PADR_(size_t)]; - char msg_prio_l_[PADL_(unsigned int)]; unsigned int msg_prio; char msg_prio_r_[PADR_(unsigned int)]; - char abs_timeout_l_[PADL_(const struct l_timespec *)]; const struct l_timespec * abs_timeout; char abs_timeout_r_[PADR_(const struct l_timespec *)]; -}; -struct linux_mq_timedreceive_args { - char mqd_l_[PADL_(l_mqd_t)]; l_mqd_t mqd; char mqd_r_[PADR_(l_mqd_t)]; - char msg_ptr_l_[PADL_(char *)]; char * msg_ptr; char msg_ptr_r_[PADR_(char *)]; - char msg_len_l_[PADL_(size_t)]; size_t msg_len; char msg_len_r_[PADR_(size_t)]; - char msg_prio_l_[PADL_(unsigned int)]; unsigned int msg_prio; char msg_prio_r_[PADR_(unsigned int)]; - char abs_timeout_l_[PADL_(const struct l_timespec *)]; const struct l_timespec * abs_timeout; char abs_timeout_r_[PADR_(const struct l_timespec *)]; -}; -struct linux_mq_notify_args { - char mqd_l_[PADL_(l_mqd_t)]; l_mqd_t mqd; char mqd_r_[PADR_(l_mqd_t)]; - char abs_timeout_l_[PADL_(const struct l_timespec *)]; const struct l_timespec * abs_timeout; char abs_timeout_r_[PADR_(const struct l_timespec *)]; -}; -struct linux_mq_getsetattr_args { - char mqd_l_[PADL_(l_mqd_t)]; l_mqd_t mqd; char mqd_r_[PADR_(l_mqd_t)]; - char attr_l_[PADL_(const struct mq_attr *)]; const struct mq_attr * attr; char attr_r_[PADR_(const struct mq_attr *)]; - char oattr_l_[PADL_(struct mq_attr *)]; struct mq_attr * oattr; char oattr_r_[PADR_(struct mq_attr *)]; -}; -struct linux_waitid_args { - char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)]; - char id_l_[PADL_(l_pid_t)]; l_pid_t id; char id_r_[PADR_(l_pid_t)]; - char info_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * info; char info_r_[PADR_(l_siginfo_t *)]; - char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)]; - char rusage_l_[PADL_(void *)]; void * rusage; char rusage_r_[PADR_(void *)]; -}; -struct linux_socket_args { - char domain_l_[PADL_(l_int)]; l_int domain; char domain_r_[PADR_(l_int)]; - char type_l_[PADL_(l_int)]; l_int type; char type_r_[PADR_(l_int)]; - char protocol_l_[PADL_(l_int)]; l_int protocol; char protocol_r_[PADR_(l_int)]; -}; -struct linux_bind_args { - char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; - char name_l_[PADL_(l_uintptr_t)]; l_uintptr_t name; char name_r_[PADR_(l_uintptr_t)]; - char namelen_l_[PADL_(l_int)]; l_int namelen; char namelen_r_[PADR_(l_int)]; -}; -struct linux_connect_args { - char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; - char name_l_[PADL_(l_uintptr_t)]; l_uintptr_t name; char name_r_[PADR_(l_uintptr_t)]; - char namelen_l_[PADL_(l_int)]; l_int namelen; char namelen_r_[PADR_(l_int)]; -}; -struct linux_listen_args { - char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; - char backlog_l_[PADL_(l_int)]; l_int backlog; char backlog_r_[PADR_(l_int)]; -}; -struct linux_accept_args { - char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; - char addr_l_[PADL_(l_uintptr_t)]; l_uintptr_t addr; char addr_r_[PADR_(l_uintptr_t)]; - char namelen_l_[PADL_(l_uintptr_t)]; l_uintptr_t namelen; char namelen_r_[PADR_(l_uintptr_t)]; -}; -struct linux_getsockname_args { - char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; - char addr_l_[PADL_(l_uintptr_t)]; l_uintptr_t addr; char addr_r_[PADR_(l_uintptr_t)]; - char namelen_l_[PADL_(l_uintptr_t)]; l_uintptr_t namelen; char namelen_r_[PADR_(l_uintptr_t)]; -}; -struct linux_getpeername_args { - char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; - char addr_l_[PADL_(l_uintptr_t)]; l_uintptr_t addr; char addr_r_[PADR_(l_uintptr_t)]; - char namelen_l_[PADL_(l_uintptr_t)]; l_uintptr_t namelen; char namelen_r_[PADR_(l_uintptr_t)]; -}; -struct linux_socketpair_args { - char domain_l_[PADL_(l_int)]; l_int domain; char domain_r_[PADR_(l_int)]; - char type_l_[PADL_(l_int)]; l_int type; char type_r_[PADR_(l_int)]; - char protocol_l_[PADL_(l_int)]; l_int protocol; char protocol_r_[PADR_(l_int)]; - char rsv_l_[PADL_(l_uintptr_t)]; l_uintptr_t rsv; char rsv_r_[PADR_(l_uintptr_t)]; -}; -struct linux_send_args { - char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; - char msg_l_[PADL_(l_uintptr_t)]; l_uintptr_t msg; char msg_r_[PADR_(l_uintptr_t)]; - char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; -}; -struct linux_sendto_args { - char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; - char msg_l_[PADL_(l_uintptr_t)]; l_uintptr_t msg; char msg_r_[PADR_(l_uintptr_t)]; - char len_l_[PADL_(l_int)]; l_int len; char len_r_[PADR_(l_int)]; - char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; - char to_l_[PADL_(l_uintptr_t)]; l_uintptr_t to; char to_r_[PADR_(l_uintptr_t)]; - char tolen_l_[PADL_(l_int)]; l_int tolen; char tolen_r_[PADR_(l_int)]; -}; -struct linux_recv_args { - char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)]; - char msg_l_[PADL_(l_uintptr_t)]; l_uintptr_t msg; char msg_r_[PADR_(l_uintptr_t)]; - char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)]; - char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; -}; -struct linux_recvfrom_args { - char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; - char buf_l_[PADL_(l_uintptr_t)]; l_uintptr_t buf; char buf_r_[PADR_(l_uintptr_t)]; - char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; - char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; - char from_l_[PADL_(l_uintptr_t)]; l_uintptr_t from; char from_r_[PADR_(l_uintptr_t)]; - char fromlen_l_[PADL_(l_uintptr_t)]; l_uintptr_t fromlen; char fromlen_r_[PADR_(l_uintptr_t)]; -}; -struct linux_shutdown_args { - char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; - char how_l_[PADL_(l_int)]; l_int how; char how_r_[PADR_(l_int)]; -}; -struct linux_setsockopt_args { - char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; - char level_l_[PADL_(l_int)]; l_int level; char level_r_[PADR_(l_int)]; - char optname_l_[PADL_(l_int)]; l_int optname; char optname_r_[PADR_(l_int)]; - char optval_l_[PADL_(l_uintptr_t)]; l_uintptr_t optval; char optval_r_[PADR_(l_uintptr_t)]; - char optlen_l_[PADL_(l_int)]; l_int optlen; char optlen_r_[PADR_(l_int)]; -}; -struct linux_getsockopt_args { - char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; - char level_l_[PADL_(l_int)]; l_int level; char level_r_[PADR_(l_int)]; - char optname_l_[PADL_(l_int)]; l_int optname; char optname_r_[PADR_(l_int)]; - char optval_l_[PADL_(l_uintptr_t)]; l_uintptr_t optval; char optval_r_[PADR_(l_uintptr_t)]; - char optlen_l_[PADL_(l_uintptr_t)]; l_uintptr_t optlen; char optlen_r_[PADR_(l_uintptr_t)]; -}; -struct linux_sendmsg_args { - char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; - char msg_l_[PADL_(l_uintptr_t)]; l_uintptr_t msg; char msg_r_[PADR_(l_uintptr_t)]; - char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; -}; -struct linux_recvmsg_args { - char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)]; - char msg_l_[PADL_(l_uintptr_t)]; l_uintptr_t msg; char msg_r_[PADR_(l_uintptr_t)]; - char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; -}; -struct linux_semop_args { - char semid_l_[PADL_(l_int)]; l_int semid; char semid_r_[PADR_(l_int)]; - char tsops_l_[PADL_(struct l_sembuf *)]; struct l_sembuf * tsops; char tsops_r_[PADR_(struct l_sembuf *)]; - char nsops_l_[PADL_(l_uint)]; l_uint nsops; char nsops_r_[PADR_(l_uint)]; -}; -struct linux_semget_args { - char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)]; - char nsems_l_[PADL_(l_int)]; l_int nsems; char nsems_r_[PADR_(l_int)]; - char semflg_l_[PADL_(l_int)]; l_int semflg; char semflg_r_[PADR_(l_int)]; -}; -struct linux_semctl_args { - char semid_l_[PADL_(l_int)]; l_int semid; char semid_r_[PADR_(l_int)]; - char semnum_l_[PADL_(l_int)]; l_int semnum; char semnum_r_[PADR_(l_int)]; - char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)]; - char arg_l_[PADL_(union l_semun)]; union l_semun arg; char arg_r_[PADR_(union l_semun)]; -}; -struct linux_msgsnd_args { - char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)]; - char msgp_l_[PADL_(struct l_msgbuf *)]; struct l_msgbuf * msgp; char msgp_r_[PADR_(struct l_msgbuf *)]; - char msgsz_l_[PADL_(l_size_t)]; l_size_t msgsz; char msgsz_r_[PADR_(l_size_t)]; - char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)]; -}; -struct linux_msgrcv_args { - char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)]; - char msgp_l_[PADL_(struct l_msgbuf *)]; struct l_msgbuf * msgp; char msgp_r_[PADR_(struct l_msgbuf *)]; - char msgsz_l_[PADL_(l_size_t)]; l_size_t msgsz; char msgsz_r_[PADR_(l_size_t)]; - char msgtyp_l_[PADL_(l_long)]; l_long msgtyp; char msgtyp_r_[PADR_(l_long)]; - char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)]; -}; -struct linux_msgget_args { - char key_l_[PADL_(l_key_t)]; l_key_t key; char key_r_[PADR_(l_key_t)]; - char msgflg_l_[PADL_(l_int)]; l_int msgflg; char msgflg_r_[PADR_(l_int)]; -}; -struct linux_msgctl_args { - char msqid_l_[PADL_(l_int)]; l_int msqid; char msqid_r_[PADR_(l_int)]; - char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)]; - char buf_l_[PADL_(struct l_msqid_ds *)]; struct l_msqid_ds * buf; char buf_r_[PADR_(struct l_msqid_ds *)]; -}; -struct linux_shmat_args { - char shmid_l_[PADL_(l_int)]; l_int shmid; char shmid_r_[PADR_(l_int)]; *** 11798 LINES SKIPPED *** From nobody Wed Nov 10 09:28:11 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 28BE7183B03E; Wed, 10 Nov 2021 09:28:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hpzzc0Zykz4d6n; Wed, 10 Nov 2021 09:28:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E85BF162A0; Wed, 10 Nov 2021 09:28:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AA9SB3n026491; Wed, 10 Nov 2021 09:28:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AA9SBrL026490; Wed, 10 Nov 2021 09:28:11 GMT (envelope-from git) Date: Wed, 10 Nov 2021 09:28:11 GMT Message-Id: <202111100928.1AA9SBrL026490@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: 6ffad483ff66 - main - stress2: Added a new zfs test scenario List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6ffad483ff66eaaa80c06407c6a6ac11206b3301 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=6ffad483ff66eaaa80c06407c6a6ac11206b3301 commit 6ffad483ff66eaaa80c06407c6a6ac11206b3301 Author: Peter Holm AuthorDate: 2021-11-10 09:27:44 +0000 Commit: Peter Holm CommitDate: 2021-11-10 09:27:44 +0000 stress2: Added a new zfs test scenario --- tools/test/stress2/misc/all.exclude | 1 + tools/test/stress2/misc/zfs14.sh | 90 +++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) diff --git a/tools/test/stress2/misc/all.exclude b/tools/test/stress2/misc/all.exclude index dfd936abde70..220fb119dcc3 100644 --- a/tools/test/stress2/misc/all.exclude +++ b/tools/test/stress2/misc/all.exclude @@ -78,6 +78,7 @@ unionfs2.sh insmntque: mp-safe fs and non-locked vp is not ... 20111219 unionfs3.sh insmntque: mp-safe fs and non-locked vp is not ... 20111216 unionfs4.sh WiP 20210916 unionfs5.sh WiP 20210916 +zfs14.sh WiP 20211110 # Test not to run for other reasons: diff --git a/tools/test/stress2/misc/zfs14.sh b/tools/test/stress2/misc/zfs14.sh new file mode 100755 index 000000000000..750119aff941 --- /dev/null +++ b/tools/test/stress2/misc/zfs14.sh @@ -0,0 +1,90 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Peter Holm +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +# "userret: returning with the following locks held:" seen: +# https://people.freebsd.org/~pho/stress/log/log0188.txt + +# Test scenario suggestion by: markj@ + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +kldstat -v | grep -q zfs.ko || { kldload zfs.ko; loaded=1; } || + exit 0 + +. ../default.cfg + +here=`pwd` +mp1=/stress2_tank/test +u1=$mdstart +u2=$((u1 + 1)) + +set -e +mdconfig -l | grep -q md$u1 && mdconfig -d -u $u1 +mdconfig -l | grep -q md$u2 && mdconfig -d -u $u2 + +mdconfig -s 2g -u $u1 +mdconfig -s 2g -u $u2 + +zpool list | egrep -q "^stress2_tank" && zpool destroy stress2_tank +[ -d /stress2_tank ] && rm -rf /stress2_tank +zpool create stress2_tank md$u1 md$u2 +zfs create stress2_tank/test +set +e + +export RUNDIR=/stress2_tank/test/stressX +export runRUNTIME=5m +export LOAD=70 +export TESTPROGS=`cd ..; find testcases/ -perm -1 -type f | \ + egrep -Ev "/run/|/tcp/|/udp/"` + +(cd ..; ./testcases/run/run $TESTPROGS > /dev/null 2>&1) & + +sleep 5 +zfs snapshot stress2_tank/test@1 + +start=`date +%s` +while [ $((`date +%s` - start)) -lt 300 ]; do + if [ `jot -r 1 1 2` -eq 1 ]; then + zfs umount -f stress2_tank/test && + zfs mount stress2_tank/test + else + zfs rollback stress2_tank/test@1 + fi + sleep 5 + zfs list | grep -q /stress2_tank/test || break +done +wait + +zfs umount stress2_tank/test +zfs destroy -r stress2_tank +zpool destroy stress2_tank + +mdconfig -d -u $u1 +mdconfig -d -u $u2 +[ -n "$loaded" ] && kldunload zfs.ko +exit 0 From nobody Wed Nov 10 09:46:13 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7D38E18477E4; Wed, 10 Nov 2021 09:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hq0NP2h9hz4m2q; Wed, 10 Nov 2021 09:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 388BE1665D; Wed, 10 Nov 2021 09:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AA9kD5h052534; Wed, 10 Nov 2021 09:46:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AA9kDOn052533; Wed, 10 Nov 2021 09:46:13 GMT (envelope-from git) Date: Wed, 10 Nov 2021 09:46:13 GMT Message-Id: <202111100946.1AA9kDOn052533@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: fad51d34f213 - main - arm64/gicv3: improve a panic 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fad51d34f21359c5b94ca94842381c3e000f475e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=fad51d34f21359c5b94ca94842381c3e000f475e commit fad51d34f21359c5b94ca94842381c3e000f475e Author: Bjoern A. Zeeb AuthorDate: 2021-11-09 22:11:15 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-10 09:41:57 +0000 arm64/gicv3: improve a panic message Print the device/unit in the panic message for which we cannot get the MSI device ID to have a clue where to start looking. While here use __func__ instead of hardcoding the function name. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D32917 --- sys/arm64/arm64/gicv3_its.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/gicv3_its.c b/sys/arm64/arm64/gicv3_its.c index 1a0e7a79e76b..0f30ca746e9e 100644 --- a/sys/arm64/arm64/gicv3_its.c +++ b/sys/arm64/arm64/gicv3_its.c @@ -1124,7 +1124,8 @@ its_get_devid(device_t pci_dev) uintptr_t id; if (pci_get_id(pci_dev, PCI_ID_MSI, &id) != 0) - panic("its_get_devid: Unable to get the MSI DeviceID"); + panic("%s: %s: Unable to get the MSI DeviceID", __func__, + device_get_nameunit(pci_dev)); return (id); } From nobody Wed Nov 10 09:49:35 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BADFC1847E8B; Wed, 10 Nov 2021 09:49:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hq0SH50GDz4mWX; Wed, 10 Nov 2021 09:49:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BD5A16564; Wed, 10 Nov 2021 09:49:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AA9nZjZ052865; Wed, 10 Nov 2021 09:49:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AA9nZ7f052864; Wed, 10 Nov 2021 09:49:35 GMT (envelope-from git) Date: Wed, 10 Nov 2021 09:49:35 GMT Message-Id: <202111100949.1AA9nZ7f052864@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 3987e506112a - main - USB dwc3 controller: add quirk snps,dis_rxdet_inp3_quirk List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3987e506112a7e8af6f09966792fb8656d630496 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3987e506112a7e8af6f09966792fb8656d630496 commit 3987e506112a7e8af6f09966792fb8656d630496 Author: Bjoern A. Zeeb AuthorDate: 2021-11-10 00:22:20 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-10 09:44:44 +0000 USB dwc3 controller: add quirk snps,dis_rxdet_inp3_quirk Add support for the "snps,dis_rxdet_inp3_quirk" quirk needed at least on SolidRun's HoneyComb. Reviewed by: manu, mw MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D32921 --- sys/dev/usb/controller/dwc3.c | 10 ++++++---- sys/dev/usb/controller/dwc3.h | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/dev/usb/controller/dwc3.c b/sys/dev/usb/controller/dwc3.c index 54c42503f2d4..d4422caf0fcd 100644 --- a/sys/dev/usb/controller/dwc3.c +++ b/sys/dev/usb/controller/dwc3.c @@ -264,11 +264,13 @@ snps_dwc3_do_quirks(struct snps_dwc3_softc *sc) reg |= DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS; DWC3_WRITE(sc, DWC3_GUCTL1, reg); - if (OF_hasprop(sc->node, "snps,dis-del-phy-power-chg-quirk")) { - reg = DWC3_READ(sc, DWC3_GUSB3PIPECTL0); + reg = DWC3_READ(sc, DWC3_GUSB3PIPECTL0); + if (OF_hasprop(sc->node, "snps,dis-del-phy-power-chg-quirk")) reg |= DWC3_GUSB3PIPECTL0_DELAYP1TRANS; - DWC3_WRITE(sc, DWC3_GUSB3PIPECTL0, reg); - } + if (OF_hasprop(sc->node, "snps,dis_rxdet_inp3_quirk")) + reg |= DWC3_GUSB3PIPECTL0_DISRXDETINP3; + DWC3_WRITE(sc, DWC3_GUSB3PIPECTL0, reg); + } static int diff --git a/sys/dev/usb/controller/dwc3.h b/sys/dev/usb/controller/dwc3.h index 7153f9abf0df..a8b127cda9a8 100644 --- a/sys/dev/usb/controller/dwc3.h +++ b/sys/dev/usb/controller/dwc3.h @@ -90,6 +90,7 @@ #define DWC3_GUSB3PIPECTL0 0xc2c0 #define DWC3_GUSB3PIPECTL0_PHYSOFTRST (1 << 31) +#define DWC3_GUSB3PIPECTL0_DISRXDETINP3 (1 << 28) #define DWC3_GUSB3PIPECTL0_DELAYP1TRANS (1 << 18) #define DWC3_GTXFIFOSIZ(x) (0xc300 + 0x4 * (x)) From nobody Wed Nov 10 11:28:17 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3DEE11855528; Wed, 10 Nov 2021 11:28:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hq2fB16tsz3s4R; Wed, 10 Nov 2021 11:28:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F423F17D13; Wed, 10 Nov 2021 11:28:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AABSHAK087062; Wed, 10 Nov 2021 11:28:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AABSHkh087061; Wed, 10 Nov 2021 11:28:17 GMT (envelope-from git) Date: Wed, 10 Nov 2021 11:28:17 GMT Message-Id: <202111101128.1AABSHkh087061@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: 218a8a491c49 - main - pf: ensure we populate dyncnt/tblcnt in struct pf_addr_wrap List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 218a8a491c4980dcc941908f9505d37e7f052868 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=218a8a491c4980dcc941908f9505d37e7f052868 commit 218a8a491c4980dcc941908f9505d37e7f052868 Author: Kristof Provost AuthorDate: 2021-11-08 12:25:20 +0000 Commit: Kristof Provost CommitDate: 2021-11-10 10:27:22 +0000 pf: ensure we populate dyncnt/tblcnt in struct pf_addr_wrap PR: 259689 MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32892 --- lib/libpfctl/libpfctl.c | 10 ++++++++-- sys/netpfil/pf/pf_nv.c | 21 +++++++++++++++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index da7c27522fd2..e298d69775b8 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -287,14 +287,20 @@ pfctl_nv_add_addr_wrap(nvlist_t *nvparent, const char *name, static void pf_nvaddr_wrap_to_addr_wrap(const nvlist_t *nvl, struct pf_addr_wrap *addr) { + bzero(addr, sizeof(*addr)); + addr->type = nvlist_get_number(nvl, "type"); addr->iflags = nvlist_get_number(nvl, "iflags"); - if (addr->type == PF_ADDR_DYNIFTL) + if (addr->type == PF_ADDR_DYNIFTL) { strlcpy(addr->v.ifname, nvlist_get_string(nvl, "ifname"), IFNAMSIZ); - if (addr->type == PF_ADDR_TABLE) + addr->p.dyncnt = nvlist_get_number(nvl, "dynctl"); + } + if (addr->type == PF_ADDR_TABLE) { strlcpy(addr->v.tblname, nvlist_get_string(nvl, "tblname"), PF_TABLE_NAME_SIZE); + addr->p.tblcnt = nvlist_get_number(nvl, "tblcnt"); + } pf_nvaddr_to_addr(nvlist_get_nvlist(nvl, "addr"), &addr->v.a.addr); pf_nvaddr_to_addr(nvlist_get_nvlist(nvl, "mask"), &addr->v.a.mask); diff --git a/sys/netpfil/pf/pf_nv.c b/sys/netpfil/pf/pf_nv.c index 143d84416542..69ef09c704c7 100644 --- a/sys/netpfil/pf/pf_nv.c +++ b/sys/netpfil/pf/pf_nv.c @@ -327,6 +327,8 @@ pf_addr_wrap_to_nvaddr_wrap(const struct pf_addr_wrap *addr) { nvlist_t *nvl; nvlist_t *tmp; + uint64_t num; + struct pfr_ktable *kt; nvl = nvlist_create(0); if (nvl == NULL) @@ -334,10 +336,25 @@ pf_addr_wrap_to_nvaddr_wrap(const struct pf_addr_wrap *addr) nvlist_add_number(nvl, "type", addr->type); nvlist_add_number(nvl, "iflags", addr->iflags); - if (addr->type == PF_ADDR_DYNIFTL) + if (addr->type == PF_ADDR_DYNIFTL) { nvlist_add_string(nvl, "ifname", addr->v.ifname); - if (addr->type == PF_ADDR_TABLE) + num = 0; + if (addr->p.dyn != NULL) + num = addr->p.dyn->pfid_acnt4 + + addr->p.dyn->pfid_acnt6; + nvlist_add_number(nvl, "dyncnt", num); + } + if (addr->type == PF_ADDR_TABLE) { nvlist_add_string(nvl, "tblname", addr->v.tblname); + num = -1; + kt = addr->p.tbl; + if ((kt->pfrkt_flags & PFR_TFLAG_ACTIVE) && + kt->pfrkt_root != NULL) + kt = kt->pfrkt_root; + if (kt->pfrkt_flags & PFR_TFLAG_ACTIVE) + num = kt->pfrkt_cnt; + nvlist_add_number(nvl, "tblcnt", num); + } tmp = pf_addr_to_nvaddr(&addr->v.a.addr); if (tmp == NULL) From nobody Wed Nov 10 11:28:18 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A772318553E2; Wed, 10 Nov 2021 11:28:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hq2fC3PdCz3s75; Wed, 10 Nov 2021 11:28:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22E7717D14; Wed, 10 Nov 2021 11:28:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AABSI87087086; Wed, 10 Nov 2021 11:28:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AABSI9H087085; Wed, 10 Nov 2021 11:28:18 GMT (envelope-from git) Date: Wed, 10 Nov 2021 11:28:18 GMT Message-Id: <202111101128.1AABSI9H087085@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: 2de49deeca0b - main - pf tests: Test PR259689 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2de49deeca0b1377664dee2cd0a43ee7cf6b4bc4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2de49deeca0b1377664dee2cd0a43ee7cf6b4bc4 commit 2de49deeca0b1377664dee2cd0a43ee7cf6b4bc4 Author: Kristof Provost AuthorDate: 2021-11-08 12:28:43 +0000 Commit: Kristof Provost CommitDate: 2021-11-10 10:27:22 +0000 pf tests: Test PR259689 We didn't populate dyncnt/tblcnt, so `pfctl -sr -vv` might not have the table element count. PR: 259689 MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32893 --- lib/libpfctl/libpfctl.c | 2 +- tests/sys/netpfil/pf/table.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index e298d69775b8..7d19e5bfb48f 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -294,7 +294,7 @@ pf_nvaddr_wrap_to_addr_wrap(const nvlist_t *nvl, struct pf_addr_wrap *addr) if (addr->type == PF_ADDR_DYNIFTL) { strlcpy(addr->v.ifname, nvlist_get_string(nvl, "ifname"), IFNAMSIZ); - addr->p.dyncnt = nvlist_get_number(nvl, "dynctl"); + addr->p.dyncnt = nvlist_get_number(nvl, "dyncnt"); } if (addr->type == PF_ADDR_TABLE) { strlcpy(addr->v.tblname, nvlist_get_string(nvl, "tblname"), diff --git a/tests/sys/netpfil/pf/table.sh b/tests/sys/netpfil/pf/table.sh index 2441a3ff84c2..49772706bdd3 100644 --- a/tests/sys/netpfil/pf/table.sh +++ b/tests/sys/netpfil/pf/table.sh @@ -214,6 +214,34 @@ network_cleanup() pft_cleanup } +atf_test_case "pr259689" "cleanup" +pr259689_head() +{ + atf_set descr 'Test PR 259689' + atf_set require.user root +} + +pr259689_body() +{ + pft_init + + vnet_mkjail alcatraz + jexec alcatraz pfctl -e + + pft_set_rules alcatraz \ + "pass in" \ + "block in inet from { 1.1.1.1, 1.1.1.2, 2.2.2.2, 2.2.2.3, 4.4.4.4, 4.4.4.5 }" + + atf_check -o match:'block drop in inet from <__automatic_.*:6> to any' \ + -e ignore \ + jexec alcatraz pfctl -sr -vv +} + +pr259689_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "v4_counters" @@ -221,4 +249,5 @@ atf_init_test_cases() atf_add_test_case "pr251414" atf_add_test_case "automatic" atf_add_test_case "network" + atf_add_test_case "pr259689" } From nobody Wed Nov 10 13:40:37 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C1E8C18522D9; Wed, 10 Nov 2021 13:40:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hq5Zs53b8z3L08; Wed, 10 Nov 2021 13:40:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D32B19A98; Wed, 10 Nov 2021 13:40:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AADebib068355; Wed, 10 Nov 2021 13:40:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AADebap068353; Wed, 10 Nov 2021 13:40:37 GMT (envelope-from git) Date: Wed, 10 Nov 2021 13:40:37 GMT Message-Id: <202111101340.1AADebap068353@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 81b22a9892b1 - main - zfs: merge openzfs/zfs@6c8f03232 (master) into main List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 81b22a9892b1047e551fc3f1d6d58031bc59a4c3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=81b22a9892b1047e551fc3f1d6d58031bc59a4c3 commit 81b22a9892b1047e551fc3f1d6d58031bc59a4c3 Merge: 2de49deeca0b 6c8f03232aa9 Author: Martin Matuska AuthorDate: 2021-11-10 12:41:17 +0000 Commit: Martin Matuska CommitDate: 2021-11-10 13:22:37 +0000 zfs: merge openzfs/zfs@6c8f03232 (master) into main Notable upstream pull request merges: #12333: Creating gang ABDs for Raidz optional IOs #12668: FreeBSD: Catch up with recent VFS changes #12687: Skip spacemaps reading in case of pool readonly import #12704: Fix some FreeBSD VOPs to synchronize properly with teardown #12724: Fix lseek(SEEK_DATA/SEEK_HOLE) mmap consistency Obtained from: OpenZFS OpenZFS commit: 6c8f03232aa98e950bfe187f9ff53d3541687b50 .../openzfs/.github/workflows/checkstyle.yaml | 2 +- .../.github/workflows/zfs-tests-functional.yml | 11 + .../openzfs/.github/workflows/zfs-tests-sanity.yml | 11 + sys/contrib/openzfs/Makefile.am | 7 +- sys/contrib/openzfs/cmd/vdev_id/vdev_id | 2 +- sys/contrib/openzfs/cmd/zdb/zdb.c | 8 +- .../openzfs/cmd/zed/zed.d/statechange-led.sh | 73 +- sys/contrib/openzfs/cmd/zed/zed.d/zed.rc | 4 +- sys/contrib/openzfs/cmd/zpool/zpool.d/ses | 8 +- sys/contrib/openzfs/config/ax_python_devel.m4 | 2 +- sys/contrib/openzfs/config/kernel-bio.m4 | 3 +- sys/contrib/openzfs/config/zfs-build.m4 | 14 +- sys/contrib/openzfs/configure.ac | 1 + .../contrib/initramfs/README.initramfs.markdown | 4 +- .../openzfs/contrib/pam_zfs_key/pam_zfs_key.c | 72 +- .../openzfs/include/os/freebsd/spl/sys/vnode.h | 20 + .../include/os/freebsd/zfs/sys/zfs_znode_impl.h | 3 +- .../include/os/linux/kernel/linux/blkdev_compat.h | 2 +- .../include/os/linux/zfs/sys/zfs_znode_impl.h | 1 + sys/contrib/openzfs/include/sys/dnode.h | 1 + sys/contrib/openzfs/include/sys/spa_impl.h | 1 + sys/contrib/openzfs/include/sys/zstd/zstd.h | 2 + sys/contrib/openzfs/include/sys/zvol.h | 1 - sys/contrib/openzfs/lib/libnvpair/libnvpair.abi | 2292 +++++---- sys/contrib/openzfs/lib/libuutil/libuutil.abi | 1436 +++--- sys/contrib/openzfs/lib/libzfs/libzfs.abi | 4861 +++++++++----------- sys/contrib/openzfs/lib/libzfs/libzfs_dataset.c | 22 +- sys/contrib/openzfs/lib/libzfs/libzfs_pool.c | 17 +- sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c | 48 +- .../openzfs/lib/libzfs_core/libzfs_core.abi | 1678 ++++--- .../openzfs/lib/libzfsbootenv/libzfsbootenv.abi | 81 +- .../lib/libzutil/os/linux/zutil_device_path_os.c | 146 +- sys/contrib/openzfs/lib/libzutil/zutil_nicenum.c | 9 + sys/contrib/openzfs/man/man4/zfs.4 | 2 +- sys/contrib/openzfs/man/man7/zfsprops.7 | 5 + sys/contrib/openzfs/module/Makefile.in | 4 +- sys/contrib/openzfs/module/nvpair/nvpair.c | 6 +- .../openzfs/module/os/freebsd/zfs/vdev_geom.c | 1 - .../openzfs/module/os/freebsd/zfs/zfs_file_os.c | 4 + .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 18 +- .../openzfs/module/os/linux/spl/spl-generic.c | 1 + .../openzfs/module/os/linux/spl/spl-taskq.c | 11 +- .../openzfs/module/os/linux/zfs/vdev_disk.c | 4 +- .../openzfs/module/os/linux/zfs/zfs_ctldir.c | 23 +- sys/contrib/openzfs/module/unicode/u8_textprep.c | 4 + sys/contrib/openzfs/module/zfs/dmu.c | 53 +- sys/contrib/openzfs/module/zfs/dnode.c | 20 + sys/contrib/openzfs/module/zfs/dsl_scan.c | 101 +- sys/contrib/openzfs/module/zfs/metaslab.c | 6 +- sys/contrib/openzfs/module/zfs/spa.c | 292 +- sys/contrib/openzfs/module/zfs/vdev.c | 6 + sys/contrib/openzfs/module/zfs/vdev_raidz.c | 172 +- sys/contrib/openzfs/module/zfs/zfs_vnops.c | 24 +- sys/contrib/openzfs/module/zfs/zvol.c | 45 - sys/contrib/openzfs/scripts/mancheck.sh | 20 +- sys/contrib/openzfs/tests/runfiles/common.run | 3 +- .../openzfs/tests/test-runner/bin/zts-report.py.in | 1 + .../openzfs/tests/zfs-tests/cmd/Makefile.am | 1 + .../tests/zfs-tests/cmd/mmap_seek/.gitignore | 1 + .../tests/zfs-tests/cmd/mmap_seek/Makefile.am | 6 + .../tests/zfs-tests/cmd/mmap_seek/mmap_seek.c | 147 + .../openzfs/tests/zfs-tests/include/commands.cfg | 1 + .../openzfs/tests/zfs-tests/include/tunables.cfg | 1 + .../tests/functional/bootfs/bootfs_002_neg.ksh | 11 +- .../tests/functional/casenorm/casenorm.kshlib | 2 +- .../tests/functional/casenorm/norm_all_values.ksh | 11 + .../channel_program/lua_core/tst.exists.ksh | 2 +- .../channel_program/lua_core/tst.return_large.ksh | 2 +- .../synctask_core/tst.get_string_props.ksh | 4 +- .../synctask_core/tst.terminate_by_signal.ksh | 2 +- .../tests/functional/cli_root/zfs/zfs_002_pos.ksh | 4 +- .../cli_root/zfs_bookmark/zfs_bookmark_cliargs.ksh | 17 +- .../cli_root/zfs_change-key/zfs_change-key.ksh | 2 +- .../zfs_change-key/zfs_change-key_child.ksh | 2 +- .../zfs_change-key/zfs_change-key_clones.ksh | 2 +- .../zfs_change-key/zfs_change-key_format.ksh | 2 +- .../zfs_change-key/zfs_change-key_inherit.ksh | 2 +- .../zfs_change-key/zfs_change-key_load.ksh | 2 +- .../zfs_change-key/zfs_change-key_location.ksh | 2 +- .../zfs_change-key/zfs_change-key_pbkdf2iters.ksh | 2 +- .../cli_root/zfs_clone/zfs_clone_001_neg.ksh | 4 +- .../cli_root/zfs_clone/zfs_clone_002_pos.ksh | 8 +- .../cli_root/zfs_clone/zfs_clone_003_pos.ksh | 4 +- .../cli_root/zfs_clone/zfs_clone_004_pos.ksh | 4 +- .../cli_root/zfs_clone/zfs_clone_005_pos.ksh | 4 +- .../cli_root/zfs_clone/zfs_clone_006_pos.ksh | 4 +- .../cli_root/zfs_clone/zfs_clone_007_pos.ksh | 4 +- .../cli_root/zfs_clone/zfs_clone_008_neg.ksh | 4 +- .../cli_root/zfs_clone/zfs_clone_009_neg.ksh | 4 +- .../cli_root/zfs_clone/zfs_clone_010_pos.ksh | 4 +- .../cli_root/zfs_clone/zfs_clone_encrypted.ksh | 4 +- .../cli_root/zfs_copies/zfs_copies_001_pos.ksh | 8 +- .../cli_root/zfs_copies/zfs_copies_002_pos.ksh | 5 +- .../cli_root/zfs_copies/zfs_copies_003_pos.ksh | 4 +- .../cli_root/zfs_copies/zfs_copies_006_pos.ksh | 4 +- .../cli_root/zfs_create/zfs_create_001_pos.ksh | 2 +- .../cli_root/zfs_create/zfs_create_003_pos.ksh | 3 +- .../cli_root/zfs_create/zfs_create_004_pos.ksh | 5 +- .../cli_root/zfs_create/zfs_create_005_pos.ksh | 2 +- .../cli_root/zfs_create/zfs_create_006_pos.ksh | 2 +- .../cli_root/zfs_create/zfs_create_008_neg.ksh | 5 +- .../cli_root/zfs_create/zfs_create_011_pos.ksh | 5 +- .../cli_root/zfs_create/zfs_create_012_pos.ksh | 5 +- .../cli_root/zfs_create/zfs_create_014_pos.ksh | 3 +- .../zfs_create/zfs_create_crypt_combos.ksh | 4 +- .../cli_root/zfs_create/zfs_create_dryrun.ksh | 5 +- .../cli_root/zfs_create/zfs_create_encrypted.ksh | 4 +- .../cli_root/zfs_create/zfs_create_verbose.ksh | 5 +- .../cli_root/zfs_destroy/zfs_destroy_001_pos.ksh | 4 +- .../cli_root/zfs_destroy/zfs_destroy_003_pos.ksh | 7 +- .../cli_root/zfs_destroy/zfs_destroy_004_pos.ksh | 10 +- .../cli_root/zfs_destroy/zfs_destroy_007_neg.ksh | 4 +- .../cli_root/zfs_destroy/zfs_destroy_014_pos.ksh | 2 +- .../cli_root/zfs_destroy/zfs_destroy_015_pos.ksh | 4 +- .../cli_root/zfs_destroy/zfs_destroy_016_pos.ksh | 8 +- .../zfs_destroy/zfs_destroy_clone_livelist.ksh | 2 +- .../cli_root/zfs_destroy/zfs_destroy_common.kshlib | 4 +- .../cli_root/zfs_diff/zfs_diff_cliargs.ksh | 4 +- .../cli_root/zfs_diff/zfs_diff_timestamp.ksh | 4 +- .../cli_root/zfs_get/zfs_get_001_pos.ksh | 17 +- .../cli_root/zfs_get/zfs_get_004_pos.ksh | 9 +- .../cli_root/zfs_get/zfs_get_list_d.kshlib | 4 +- .../cli_root/zfs_inherit/zfs_inherit_002_neg.ksh | 5 +- .../cli_root/zfs_inherit/zfs_inherit_003_pos.ksh | 4 +- .../cli_root/zfs_load-key/zfs_load-key.ksh | 2 +- .../cli_root/zfs_load-key/zfs_load-key_all.ksh | 16 +- .../cli_root/zfs_load-key/zfs_load-key_file.ksh | 2 +- .../cli_root/zfs_load-key/zfs_load-key_https.ksh | 2 +- .../zfs_load-key/zfs_load-key_location.ksh | 2 +- .../cli_root/zfs_load-key/zfs_load-key_noop.ksh | 2 +- .../zfs_load-key/zfs_load-key_recursive.ksh | 2 +- .../cli_root/zfs_mount/zfs_mount_008_pos.ksh | 4 +- .../cli_root/zfs_mount/zfs_mount_011_neg.ksh | 7 +- .../cli_root/zfs_mount/zfs_mount_encrypted.ksh | 2 +- .../cli_root/zfs_mount/zfs_mount_remount.ksh | 2 +- .../cli_root/zfs_promote/zfs_promote_001_pos.ksh | 3 +- .../cli_root/zfs_promote/zfs_promote_003_pos.ksh | 3 +- .../cli_root/zfs_promote/zfs_promote_004_pos.ksh | 3 +- .../cli_root/zfs_promote/zfs_promote_005_pos.ksh | 4 +- .../cli_root/zfs_promote/zfs_promote_006_neg.ksh | 8 +- .../cli_root/zfs_promote/zfs_promote_007_neg.ksh | 3 +- .../zfs_promote/zfs_promote_encryptionroot.ksh | 6 +- .../zfs_property/zfs_written_property_001_pos.ksh | 2 +- .../functional/cli_root/zfs_receive/Makefile.am | 1 + .../zfs_receive/receive-o-x_props_aliases.ksh | 213 + .../cli_root/zfs_receive/zfs_receive_001_pos.ksh | 9 +- .../cli_root/zfs_receive/zfs_receive_002_pos.ksh | 9 +- .../cli_root/zfs_receive/zfs_receive_003_pos.ksh | 2 +- .../cli_root/zfs_receive/zfs_receive_004_neg.ksh | 3 +- .../cli_root/zfs_receive/zfs_receive_005_neg.ksh | 6 +- .../cli_root/zfs_receive/zfs_receive_006_pos.ksh | 6 +- .../cli_root/zfs_receive/zfs_receive_007_neg.ksh | 2 +- .../cli_root/zfs_receive/zfs_receive_008_pos.ksh | 10 +- .../cli_root/zfs_receive/zfs_receive_009_neg.ksh | 9 +- .../cli_root/zfs_receive/zfs_receive_013_pos.ksh | 2 +- .../zfs_receive/zfs_receive_from_encrypted.ksh | 4 +- .../cli_root/zfs_receive/zfs_receive_from_zstd.ksh | 4 +- .../cli_root/zfs_receive/zfs_receive_raw.ksh | 4 +- .../cli_root/zfs_receive/zfs_receive_raw_-d.ksh | 2 +- .../zfs_receive/zfs_receive_raw_incremental.ksh | 4 +- .../zfs_receive/zfs_receive_to_encrypted.ksh | 4 +- .../cli_root/zfs_rename/zfs_rename.kshlib | 10 +- .../cli_root/zfs_rename/zfs_rename_003_pos.ksh | 2 +- .../cli_root/zfs_rename/zfs_rename_007_pos.ksh | 5 +- .../cli_root/zfs_rename/zfs_rename_008_pos.ksh | 11 +- .../cli_root/zfs_rename/zfs_rename_011_pos.ksh | 17 +- .../cli_root/zfs_rename/zfs_rename_013_pos.ksh | 20 +- .../zfs_rename/zfs_rename_encrypted_child.ksh | 4 +- .../zfs_rename/zfs_rename_to_encrypted.ksh | 2 +- .../cli_root/zfs_rollback/zfs_rollback_001_pos.ksh | 4 +- .../cli_root/zfs_rollback/zfs_rollback_003_neg.ksh | 4 +- .../cli_root/zfs_rollback/zfs_rollback_004_neg.ksh | 5 +- .../zfs_rollback/zfs_rollback_common.kshlib | 4 +- .../functional/cli_root/zfs_send/zfs_send-b.ksh | 2 +- .../cli_root/zfs_send/zfs_send_001_pos.ksh | 6 +- .../cli_root/zfs_send/zfs_send_002_pos.ksh | 7 +- .../cli_root/zfs_send/zfs_send_003_pos.ksh | 4 +- .../cli_root/zfs_send/zfs_send_004_neg.ksh | 3 +- .../cli_root/zfs_send/zfs_send_005_pos.ksh | 2 +- .../cli_root/zfs_send/zfs_send_encrypted.ksh | 2 +- .../zfs_send/zfs_send_encrypted_unloaded.ksh | 2 +- .../functional/cli_root/zfs_send/zfs_send_raw.ksh | 6 +- .../cli_root/zfs_send/zfs_send_skip_missing.ksh | 4 +- .../cli_root/zfs_send/zfs_send_sparse.ksh | 8 +- .../cli_root/zfs_set/canmount_001_pos.ksh | 11 +- .../cli_root/zfs_set/canmount_002_pos.ksh | 13 +- .../cli_root/zfs_set/canmount_003_pos.ksh | 7 +- .../cli_root/zfs_set/readonly_001_pos.ksh | 2 +- .../cli_root/zfs_set/snapdir_001_pos.ksh | 3 +- .../cli_root/zfs_set/user_property_004_pos.ksh | 4 +- .../cli_root/zfs_set/zfs_set_003_neg.ksh | 5 +- .../cli_root/zfs_set/zfs_set_keylocation.ksh | 2 +- .../cli_root/zfs_share/zfs_share_001_pos.ksh | 7 +- .../cli_root/zfs_share/zfs_share_004_pos.ksh | 5 +- .../cli_root/zfs_share/zfs_share_006_pos.ksh | 2 +- .../cli_root/zfs_share/zfs_share_011_pos.ksh | 10 +- .../zfs_share/zfs_share_concurrent_shares.ksh | 6 +- .../cli_root/zfs_snapshot/zfs_snapshot_001_neg.ksh | 2 +- .../cli_root/zfs_snapshot/zfs_snapshot_002_neg.ksh | 5 +- .../cli_root/zfs_snapshot/zfs_snapshot_004_neg.ksh | 8 +- .../cli_root/zfs_snapshot/zfs_snapshot_005_neg.ksh | 8 +- .../cli_root/zfs_snapshot/zfs_snapshot_006_pos.ksh | 4 +- .../cli_root/zfs_snapshot/zfs_snapshot_007_neg.ksh | 4 +- .../cli_root/zfs_snapshot/zfs_snapshot_009_pos.ksh | 9 +- .../cli_root/zfs_unload-key/zfs_unload-key.ksh | 2 +- .../cli_root/zfs_unload-key/zfs_unload-key_all.ksh | 7 +- .../zfs_unload-key/zfs_unload-key_recursive.ksh | 2 +- .../cli_root/zfs_unmount/zfs_unmount_001_pos.ksh | 2 +- .../cli_root/zfs_unmount/zfs_unmount_008_neg.ksh | 8 +- .../cli_root/zfs_unmount/zfs_unmount_009_pos.ksh | 4 +- .../zfs_unmount/zfs_unmount_unload_keys.ksh | 6 +- .../cli_root/zfs_unshare/zfs_unshare_001_pos.ksh | 15 +- .../cli_root/zfs_unshare/zfs_unshare_002_pos.ksh | 15 +- .../cli_root/zfs_unshare/zfs_unshare_003_pos.ksh | 5 +- .../cli_root/zfs_unshare/zfs_unshare_007_pos.ksh | 5 +- .../cli_root/zfs_upgrade/zfs_upgrade_001_pos.ksh | 8 +- .../cli_root/zfs_upgrade/zfs_upgrade_003_pos.ksh | 4 +- .../cli_root/zfs_upgrade/zfs_upgrade_004_pos.ksh | 4 +- .../cli_root/zfs_upgrade/zfs_upgrade_005_pos.ksh | 4 +- .../zpool_destroy/zpool_destroy_001_pos.ksh | 3 +- .../zpool_destroy/zpool_destroy_002_pos.ksh | 2 +- .../zpool_history/zpool_history_001_neg.ksh | 4 +- .../functional/cli_root/zpool_import/cleanup.ksh | 3 +- .../cli_root/zpool_import/zpool_import_012_pos.ksh | 6 +- .../zpool_scrub/zpool_scrub_encrypted_unloaded.ksh | 2 +- .../async_destroy/async_destroy_001_pos.ksh | 2 +- .../features/large_dnode/large_dnode_001_pos.ksh | 2 +- .../features/large_dnode/large_dnode_002_pos.ksh | 2 +- .../features/large_dnode/large_dnode_004_neg.ksh | 4 +- .../features/large_dnode/large_dnode_005_pos.ksh | 9 +- .../features/large_dnode/large_dnode_006_pos.ksh | 2 +- .../features/large_dnode/large_dnode_009_pos.ksh | 4 +- .../tests/functional/history/history_002_pos.ksh | 2 +- .../tests/functional/history/history_006_neg.ksh | 4 +- .../tests/functional/history/history_007_pos.ksh | 2 +- .../tests/functional/history/history_008_pos.ksh | 4 +- .../tests/functional/history/history_010_pos.ksh | 2 +- .../tests/functional/history/history_common.kshlib | 4 +- .../largest_pool/largest_pool_001_pos.ksh | 6 +- .../zfs-tests/tests/functional/mmap/Makefile.am | 3 +- .../tests/functional/mmap/mmap_seek_001_pos.ksh | 67 + .../tests/functional/nopwrite/nopwrite_copies.ksh | 2 +- .../tests/functional/nopwrite/nopwrite_mtime.ksh | 2 +- .../functional/nopwrite/nopwrite_negative.ksh | 2 +- .../nopwrite/nopwrite_promoted_clone.ksh | 2 +- .../tests/functional/nopwrite/nopwrite_recsize.ksh | 2 +- .../tests/functional/nopwrite/nopwrite_sync.ksh | 2 +- .../nopwrite/nopwrite_varying_compression.ksh | 2 +- .../tests/functional/nopwrite/nopwrite_volume.ksh | 2 +- .../tests/functional/pam/utilities.kshlib | 2 +- .../tests/functional/procfs/procfs_list_basic.ksh | 2 +- .../procfs/procfs_list_concurrent_readers.ksh | 2 +- .../projectquota/projectquota_004_neg.ksh | 4 +- .../projectquota/projectquota_005_pos.ksh | 4 +- .../projectquota/projectquota_008_pos.ksh | 4 +- .../projectquota/projectquota_009_pos.ksh | 4 +- .../projectquota/projectspace_001_pos.ksh | 4 +- .../projectquota/projectspace_002_pos.ksh | 4 +- .../projectquota/projectspace_003_pos.ksh | 4 +- .../projectquota/projectspace_004_pos.ksh | 4 +- .../tests/functional/quota/quota_005_pos.ksh | 3 +- .../functional/refreserv/refreserv_002_pos.ksh | 6 +- .../functional/reservation/reservation_002_pos.ksh | 2 +- .../functional/reservation/reservation_003_pos.ksh | 2 +- .../functional/reservation/reservation_004_pos.ksh | 2 +- .../functional/reservation/reservation_005_pos.ksh | 2 +- .../functional/reservation/reservation_007_pos.ksh | 8 +- .../functional/reservation/reservation_008_pos.ksh | 2 +- .../functional/reservation/reservation_009_pos.ksh | 4 +- .../functional/reservation/reservation_010_pos.ksh | 2 +- .../functional/reservation/reservation_013_pos.ksh | 4 +- .../functional/reservation/reservation_014_pos.ksh | 2 +- .../functional/reservation/reservation_015_pos.ksh | 3 +- .../functional/reservation/reservation_016_pos.ksh | 3 +- .../functional/reservation/reservation_018_pos.ksh | 2 +- .../tests/functional/rsend/send-c_lz4_disabled.ksh | 4 +- .../functional/rsend/send-c_recv_lz4_disabled.ksh | 4 +- .../rsend/send-c_stream_size_estimate.ksh | 4 +- .../functional/rsend/send-cpL_varied_recsize.ksh | 4 +- .../functional/rsend/send_encrypted_files.ksh | 4 +- .../rsend/send_encrypted_truncated_files.ksh | 4 +- .../tests/functional/rsend/send_mixed_raw.ksh | 6 +- .../functional/rsend/send_realloc_dnode_size.ksh | 9 +- .../tests/functional/snapshot/clone_001_pos.ksh | 4 +- .../tests/functional/snapshot/snapshot_011_pos.ksh | 3 +- .../tests/functional/snapshot/snapshot_012_pos.ksh | 7 +- .../tests/functional/snapshot/snapshot_013_pos.ksh | 7 +- .../tests/functional/snapshot/snapshot_014_pos.ksh | 3 +- .../tests/functional/snapshot/snapshot_015_pos.ksh | 2 +- .../tests/functional/snapshot/snapshot_016_pos.ksh | 19 +- .../tests/functional/snapshot/snapshot_017_pos.ksh | 5 +- .../tests/functional/snapused/snapused_001_pos.ksh | 2 +- .../tests/functional/snapused/snapused_002_pos.ksh | 2 +- .../tests/functional/snapused/snapused_003_pos.ksh | 2 +- .../tests/functional/snapused/snapused_004_pos.ksh | 2 +- .../tests/functional/snapused/snapused_005_pos.ksh | 2 +- .../functional/userquota/groupspace_001_pos.ksh | 4 +- .../functional/userquota/groupspace_002_pos.ksh | 4 +- .../functional/userquota/groupspace_003_pos.ksh | 4 +- .../functional/userquota/userquota_005_neg.ksh | 4 +- .../functional/userquota/userquota_006_pos.ksh | 4 +- .../functional/userquota/userquota_009_pos.ksh | 4 +- .../functional/userquota/userquota_011_pos.ksh | 4 +- .../functional/userquota/userquota_012_neg.ksh | 4 +- .../functional/userquota/userspace_001_pos.ksh | 4 +- .../functional/userquota/userspace_002_pos.ksh | 4 +- .../functional/userquota/userspace_003_pos.ksh | 4 +- .../functional/zvol/zvol_cli/zvol_cli_002_pos.ksh | 2 +- .../tests/functional/zvol/zvol_common.shlib | 5 +- .../zvol/zvol_misc/zvol_misc_002_pos.ksh | 2 +- .../zvol/zvol_misc/zvol_misc_004_pos.ksh | 5 +- .../zvol/zvol_misc/zvol_misc_snapdev.ksh | 4 +- .../zvol/zvol_swap/zvol_swap_004_pos.ksh | 2 +- sys/modules/zfs/zfs_config.h | 4 +- sys/modules/zfs/zfs_gitrev.h | 2 +- 315 files changed, 6701 insertions(+), 6527 deletions(-) diff --cc sys/contrib/openzfs/include/os/freebsd/spl/sys/vnode.h index 3670712a0456,000000000000..1ac595aa15dd mode 100644,000000..100644 --- a/sys/contrib/openzfs/include/os/freebsd/spl/sys/vnode.h +++ b/sys/contrib/openzfs/include/os/freebsd/spl/sys/vnode.h @@@ -1,208 -1,0 +1,228 @@@ +/* + * Copyright (c) 2007 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _OPENSOLARIS_SYS_VNODE_H_ +#define _OPENSOLARIS_SYS_VNODE_H_ + +struct vnode; +struct vattr; +struct xucred; + +typedef struct flock flock64_t; +typedef struct vnode vnode_t; +typedef struct vattr vattr_t; +typedef enum vtype vtype_t; + +#include +#include +#include_next +#include +enum symfollow { NO_FOLLOW = NOFOLLOW }; + +#define NOCRED ((struct ucred *)0) /* no credential available */ +#define F_FREESP 11 /* Free file space */ + +#include +#include +#ifndef IN_BASE +#include_next +#endif +#include +#include +#include +#include +#include +#include +#include ++#include ++#include + +typedef struct vop_vector vnodeops_t; +#define VOP_FID VOP_VPTOFH +#define vop_fid vop_vptofh +#define vop_fid_args vop_vptofh_args +#define a_fid a_fhp + +#define rootvfs (rootvnode == NULL ? NULL : rootvnode->v_mount) + +#ifndef IN_BASE +static __inline int +vn_is_readonly(vnode_t *vp) +{ + return (vp->v_mount->mnt_flag & MNT_RDONLY); +} +#endif +#define vn_vfswlock(vp) (0) +#define vn_vfsunlock(vp) do { } while (0) +#define vn_ismntpt(vp) \ + ((vp)->v_type == VDIR && (vp)->v_mountedhere != NULL) +#define vn_mountedvfs(vp) ((vp)->v_mountedhere) +#define vn_has_cached_data(vp) \ + ((vp)->v_object != NULL && \ + (vp)->v_object->resident_page_count > 0) ++ ++#ifndef IN_BASE ++static __inline void ++vn_flush_cached_data(vnode_t *vp, boolean_t sync) ++{ ++#if __FreeBSD_version > 1300054 ++ if (vm_object_mightbedirty(vp->v_object)) { ++#else ++ if (vp->v_object->flags & OBJ_MIGHTBEDIRTY) { ++#endif ++ int flags = sync ? OBJPC_SYNC : 0; ++ zfs_vmobject_wlock(vp->v_object); ++ vm_object_page_clean(vp->v_object, 0, 0, flags); ++ zfs_vmobject_wunlock(vp->v_object); ++ } ++} ++#endif ++ +#define vn_exists(vp) do { } while (0) +#define vn_invalid(vp) do { } while (0) +#define vn_renamepath(tdvp, svp, tnm, lentnm) do { } while (0) +#define vn_free(vp) do { } while (0) +#define vn_matchops(vp, vops) ((vp)->v_op == &(vops)) + +#define VN_HOLD(v) vref(v) +#define VN_RELE(v) vrele(v) +#define VN_URELE(v) vput(v) + +#define vnevent_create(vp, ct) do { } while (0) +#define vnevent_link(vp, ct) do { } while (0) +#define vnevent_remove(vp, dvp, name, ct) do { } while (0) +#define vnevent_rmdir(vp, dvp, name, ct) do { } while (0) +#define vnevent_rename_src(vp, dvp, name, ct) do { } while (0) +#define vnevent_rename_dest(vp, dvp, name, ct) do { } while (0) +#define vnevent_rename_dest_dir(vp, ct) do { } while (0) + +#define specvp(vp, rdev, type, cr) (VN_HOLD(vp), (vp)) +#define MANDLOCK(vp, mode) (0) + +/* + * We will use va_spare is place of Solaris' va_mask. + * This field is initialized in zfs_setattr(). + */ +#define va_mask va_spare +/* TODO: va_fileid is shorter than va_nodeid !!! */ +#define va_nodeid va_fileid +/* TODO: This field needs conversion! */ +#define va_nblocks va_bytes +#define va_blksize va_blocksize +#define va_seq va_gen + +#define MAXOFFSET_T OFF_MAX +#define EXCL 0 + +#define FCREAT O_CREAT +#define FTRUNC O_TRUNC +#define FEXCL O_EXCL +#ifndef FDSYNC +#define FDSYNC FFSYNC +#endif +#define FRSYNC FFSYNC +#define FSYNC FFSYNC +#define FOFFMAX 0x00 +#define FIGNORECASE 0x00 + +/* + * Attributes of interest to the caller of setattr or getattr. + */ +#define AT_MODE 0x00002 +#define AT_UID 0x00004 +#define AT_GID 0x00008 +#define AT_FSID 0x00010 +#define AT_NODEID 0x00020 +#define AT_NLINK 0x00040 +#define AT_SIZE 0x00080 +#define AT_ATIME 0x00100 +#define AT_MTIME 0x00200 +#define AT_CTIME 0x00400 +#define AT_RDEV 0x00800 +#define AT_BLKSIZE 0x01000 +#define AT_NBLOCKS 0x02000 +/* 0x04000 */ /* unused */ +#define AT_SEQ 0x08000 +/* + * If AT_XVATTR is set then there are additional bits to process in + * the xvattr_t's attribute bitmap. If this is not set then the bitmap + * MUST be ignored. Note that this bit must be set/cleared explicitly. + * That is, setting AT_ALL will NOT set AT_XVATTR. + */ +#define AT_XVATTR 0x10000 + +#define AT_ALL (AT_MODE|AT_UID|AT_GID|AT_FSID|AT_NODEID|\ + AT_NLINK|AT_SIZE|AT_ATIME|AT_MTIME|AT_CTIME|\ + AT_RDEV|AT_BLKSIZE|AT_NBLOCKS|AT_SEQ) + +#define AT_STAT (AT_MODE|AT_UID|AT_GID|AT_FSID|AT_NODEID|AT_NLINK|\ + AT_SIZE|AT_ATIME|AT_MTIME|AT_CTIME|AT_RDEV) + +#define AT_TIMES (AT_ATIME|AT_MTIME|AT_CTIME) + +#define AT_NOSET (AT_NLINK|AT_RDEV|AT_FSID|AT_NODEID|\ + AT_BLKSIZE|AT_NBLOCKS|AT_SEQ) + +#ifndef IN_BASE +static __inline void +vattr_init_mask(vattr_t *vap) +{ + + vap->va_mask = 0; + + if (vap->va_uid != (uid_t)VNOVAL) + vap->va_mask |= AT_UID; + if (vap->va_gid != (gid_t)VNOVAL) + vap->va_mask |= AT_GID; + if (vap->va_size != (u_quad_t)VNOVAL) + vap->va_mask |= AT_SIZE; + if (vap->va_atime.tv_sec != VNOVAL) + vap->va_mask |= AT_ATIME; + if (vap->va_mtime.tv_sec != VNOVAL) + vap->va_mask |= AT_MTIME; + if (vap->va_mode != (uint16_t)VNOVAL) + vap->va_mask |= AT_MODE; + if (vap->va_flags != VNOVAL) + vap->va_mask |= AT_XVATTR; +} +#endif + +#define RLIM64_INFINITY 0 + +static __inline int +vn_rename(char *from, char *to, enum uio_seg seg) +{ + + ASSERT(seg == UIO_SYSSPACE); + + return (kern_renameat(curthread, AT_FDCWD, from, AT_FDCWD, to, seg)); +} + +#include + +#endif /* _OPENSOLARIS_SYS_VNODE_H_ */ diff --cc sys/contrib/openzfs/tests/zfs-tests/cmd/mmap_seek/.gitignore index 000000000000,6b05a7917500..6b05a7917500 mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/cmd/mmap_seek/.gitignore +++ b/sys/contrib/openzfs/tests/zfs-tests/cmd/mmap_seek/.gitignore diff --cc sys/contrib/openzfs/tests/zfs-tests/cmd/mmap_seek/Makefile.am index 000000000000,b938931125f5..b938931125f5 mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/cmd/mmap_seek/Makefile.am +++ b/sys/contrib/openzfs/tests/zfs-tests/cmd/mmap_seek/Makefile.am diff --cc sys/contrib/openzfs/tests/zfs-tests/cmd/mmap_seek/mmap_seek.c index 000000000000,f476e1dba9a4..f476e1dba9a4 mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/cmd/mmap_seek/mmap_seek.c +++ b/sys/contrib/openzfs/tests/zfs-tests/cmd/mmap_seek/mmap_seek.c diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_receive/receive-o-x_props_aliases.ksh index 000000000000,d4b0aa2341fc..d4b0aa2341fc mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_receive/receive-o-x_props_aliases.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_receive/receive-o-x_props_aliases.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/mmap/mmap_seek_001_pos.ksh index 000000000000,6188549ad8d2..6188549ad8d2 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/mmap/mmap_seek_001_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/mmap/mmap_seek_001_pos.ksh diff --cc sys/modules/zfs/zfs_config.h index 8bbe141827db,000000000000..a893f3431c85 mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,864 -1,0 +1,864 @@@ +/* + * $FreeBSD$ + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* bio_end_io_t wants 1 arg */ +/* #undef HAVE_1ARG_BIO_END_IO_T */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* submit_bio() wants 1 arg */ +/* #undef HAVE_1ARG_SUBMIT_BIO */ + +/* bdi_setup_and_register() wants 2 args */ +/* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 2 args */ +/* #undef HAVE_2ARGS_VFS_GETATTR */ + +/* zlib_deflate_workspacesize() wants 2 args */ +/* #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */ + +/* bdi_setup_and_register() wants 3 args */ +/* #undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 3 args */ +/* #undef HAVE_3ARGS_VFS_GETATTR */ + +/* vfs_getattr wants 4 args */ +/* #undef HAVE_4ARGS_VFS_GETATTR */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* posix_acl has refcount_t */ +/* #undef HAVE_ACL_REFCOUNT */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio->bi_bdev->bd_disk exists */ +/* #undef HAVE_BIO_BDEV_DISK */ + +/* bio->bi_opf is defined */ +/* #undef HAVE_BIO_BI_OPF */ + +/* bio->bi_status exists */ +/* #undef HAVE_BIO_BI_STATUS */ + +/* bio has bi_iter */ +/* #undef HAVE_BIO_BVEC_ITER */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_max_segs() is implemented */ +/* #undef HAVE_BIO_MAX_SEGS */ + +/* bio_set_dev() is available */ +/* #undef HAVE_BIO_SET_DEV */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + +/* blk_alloc_disk() exists */ +/* #undef HAVE_BLK_ALLOC_DISK */ + +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_flag_clear() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_CLEAR */ + +/* blk_queue_flag_set() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_SET */ + +/* blk_queue_flush() is available */ +/* #undef HAVE_BLK_QUEUE_FLUSH */ + +/* blk_queue_flush() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY */ + +/* blk_queue_secdiscard() is available */ +/* #undef HAVE_BLK_QUEUE_SECDISCARD */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + +/* blk_queue_update_readahead() exists */ +/* #undef HAVE_BLK_QUEUE_UPDATE_READAHEAD */ + +/* blk_queue_write_cache() exists */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE */ + +/* blk_queue_write_cache() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY */ + +/* Define if revalidate_disk() in block_device_operations */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK */ + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + +/* clear_inode() is available */ +/* #undef HAVE_CLEAR_INODE */ + +/* dentry uses const struct dentry_operations */ +/* #undef HAVE_CONST_DENTRY_OPERATIONS */ + +/* copy_from_iter() is available */ +/* #undef HAVE_COPY_FROM_ITER */ + +/* copy_to_iter() is available */ +/* #undef HAVE_COPY_TO_ITER */ + +/* yes */ +/* #undef HAVE_CPU_HOTPLUG */ + +/* current_time() exists */ +/* #undef HAVE_CURRENT_TIME */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* DECLARE_EVENT_CLASS() is available */ +/* #undef HAVE_DECLARE_EVENT_CLASS */ + +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + +/* sops->dirty_inode() wants flags */ +/* #undef HAVE_DIRTY_INODE_WITH_FLAGS */ + +/* disk_*_io_acct() available */ +/* #undef HAVE_DISK_IO_ACCT */ + +/* disk_update_readahead() exists */ +/* #undef HAVE_DISK_UPDATE_READAHEAD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* d_make_root() is available */ +/* #undef HAVE_D_MAKE_ROOT */ + +/* d_prune_aliases() is available */ +/* #undef HAVE_D_PRUNE_ALIASES */ + +/* dops->d_revalidate() operation takes nameidata */ +/* #undef HAVE_D_REVALIDATE_NAMEIDATA */ + +/* eops->encode_fh() wants child and parent inodes */ +/* #undef HAVE_ENCODE_FH_WITH_INODE */ + +/* sops->evict_inode() exists */ +/* #undef HAVE_EVICT_INODE */ + +/* fops->aio_fsync() exists */ +/* #undef HAVE_FILE_AIO_FSYNC */ + +/* file_dentry() is available */ +/* #undef HAVE_FILE_DENTRY */ + +/* file_inode() is available */ +/* #undef HAVE_FILE_INODE */ + +/* iops->follow_link() cookie */ +/* #undef HAVE_FOLLOW_LINK_COOKIE */ + +/* iops->follow_link() nameidata */ +/* #undef HAVE_FOLLOW_LINK_NAMEIDATA */ + +/* fops->fsync() with range */ +/* #undef HAVE_FSYNC_RANGE */ + +/* fops->fsync() without dentry */ +/* #undef HAVE_FSYNC_WITHOUT_DENTRY */ + +/* generic_fillattr requires struct user_namespace* */ +/* #undef HAVE_GENERIC_FILLATTR_USERNS */ + +/* generic_*_io_acct() 3 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_3ARG */ + +/* generic_*_io_acct() 4 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_4ARG */ + +/* generic_readlink is global */ +/* #undef HAVE_GENERIC_READLINK */ + +/* generic_setxattr() exists */ +/* #undef HAVE_GENERIC_SETXATTR */ + +/* generic_write_checks() takes kiocb */ +/* #undef HAVE_GENERIC_WRITE_CHECKS_KIOCB */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* iops->get_acl() exists */ +/* #undef HAVE_GET_ACL */ + +/* iops->get_acl() takes rcu */ +/* #undef HAVE_GET_ACL_RCU */ + +/* iops->get_link() cookie */ +/* #undef HAVE_GET_LINK_COOKIE */ + +/* iops->get_link() delayed */ +/* #undef HAVE_GET_LINK_DELAYED */ + +/* group_info->gid exists */ +/* #undef HAVE_GROUP_INFO_GID */ + +/* has_capability() is available */ +/* #undef HAVE_HAS_CAPABILITY */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* yes */ +/* #undef HAVE_INODE_LOCK_SHARED */ + +/* inode_owner_or_capable() exists */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE */ + +/* inode_owner_or_capable() takes user_ns */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_IDMAPPED */ + +/* inode_set_flags() exists */ +/* #undef HAVE_INODE_SET_FLAGS */ + +/* inode_set_iversion() exists */ +/* #undef HAVE_INODE_SET_IVERSION */ + +/* inode->i_*time's are timespec64 */ +/* #undef HAVE_INODE_TIMESPEC64_TIMES */ + +/* timestamp_truncate() exists */ +/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* in_compat_syscall() is available */ +/* #undef HAVE_IN_COMPAT_SYSCALL */ + +/* iops->create() takes struct user_namespace* */ +/* #undef HAVE_IOPS_CREATE_USERNS */ + +/* iops->mkdir() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKDIR_USERNS */ + +/* iops->mknod() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKNOD_USERNS */ + +/* iops->rename() takes struct user_namespace* */ +/* #undef HAVE_IOPS_RENAME_USERNS */ + +/* iops->symlink() takes struct user_namespace* */ +/* #undef HAVE_IOPS_SYMLINK_USERNS */ + +/* iov_iter_advance() is available */ +/* #undef HAVE_IOV_ITER_ADVANCE */ + +/* iov_iter_count() is available */ +/* #undef HAVE_IOV_ITER_COUNT */ + +/* iov_iter_fault_in_readable() is available */ +/* #undef HAVE_IOV_ITER_FAULT_IN_READABLE */ + +/* iov_iter_revert() is available */ +/* #undef HAVE_IOV_ITER_REVERT */ + +/* iov_iter types are available */ +/* #undef HAVE_IOV_ITER_TYPES */ + +/* yes */ +/* #undef HAVE_IO_SCHEDULE_TIMEOUT */ + +/* Define to 1 if you have the `issetugid' function. */ +#define HAVE_ISSETUGID 1 + +/* kernel has kernel_fpu_* functions */ +/* #undef HAVE_KERNEL_FPU */ + +/* kernel has asm/fpu/api.h */ +/* #undef HAVE_KERNEL_FPU_API_HEADER */ + +/* kernel fpu internal */ +/* #undef HAVE_KERNEL_FPU_INTERNAL */ + +/* uncached_acl_sentinel() exists */ +/* #undef HAVE_KERNEL_GET_ACL_HANDLE_CACHE */ + +/* kernel does stack verification */ +/* #undef HAVE_KERNEL_OBJTOOL */ + +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + *** 496 LINES SKIPPED *** From nobody Wed Nov 10 14:52:04 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CB1811857B60; Wed, 10 Nov 2021 14:52:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hq79J5RRmz4V6h; Wed, 10 Nov 2021 14:52:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A7431A3ED; Wed, 10 Nov 2021 14:52:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AAEq4g7065815; Wed, 10 Nov 2021 14:52:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AAEq4le065814; Wed, 10 Nov 2021 14:52:04 GMT (envelope-from git) Date: Wed, 10 Nov 2021 14:52:04 GMT Message-Id: <202111101452.1AAEq4le065814@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: ad8f078f66e5 - main - ifconfig(8): Don't set network interface capabilities when there is no change. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ad8f078f66e51212cdccd91fe8b22fb81235018e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=ad8f078f66e51212cdccd91fe8b22fb81235018e commit ad8f078f66e51212cdccd91fe8b22fb81235018e Author: Hans Petter Selasky AuthorDate: 2021-11-09 21:07:43 +0000 Commit: Hans Petter Selasky CommitDate: 2021-11-10 14:50:52 +0000 ifconfig(8): Don't set network interface capabilities when there is no change. A quick grep through the kernel code shows network drivers compute the changed bits of network capabilities after a SIOCSIFCAP IOCTL(2) by using the bitwise exclusive or operation. When the set capabilities are equal to the already read capabilities, no action will be taken. Let ifconfig(8) predict this case and skip the SIOCSIFCAP IOCTL(2) system call. Discussed with: kib@ (revert change in case of issues) MFC after: 1 week Sponsored by: NVIDIA Networking --- sbin/ifconfig/ifconfig.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 0423b3593504..9e7d38d4c2a4 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1243,6 +1243,9 @@ setifcap(const char *vname, int value, int s, const struct afswtch *afp) } else flags |= value; flags &= ifr.ifr_reqcap; + /* Check for no change in capabilities. */ + if (ifr.ifr_curcap == flags) + return; ifr.ifr_reqcap = flags; if (ioctl(s, SIOCSIFCAP, (caddr_t)&ifr) < 0) Perror(vname); From nobody Wed Nov 10 15:36:03 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 72DC2184920D; Wed, 10 Nov 2021 15:36:12 +0000 (UTC) (envelope-from mike@mail.karels.net) Received: from mail.karels.net (mail.karels.net [216.160.39.52]) by mx1.freebsd.org (Postfix) with ESMTP id 4Hq88C0h9yz4lZx; Wed, 10 Nov 2021 15:36:10 +0000 (UTC) (envelope-from mike@mail.karels.net) Received: from mail.karels.net (localhost [127.0.0.1]) by mail.karels.net (8.16.1/8.16.1) with ESMTPS id 1AAFa3wS018768 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 10 Nov 2021 09:36:04 -0600 (CST) (envelope-from mike@mail.karels.net) Received: (from mike@localhost) by mail.karels.net (8.16.1/8.16.1/Submit) id 1AAFa311018767; Wed, 10 Nov 2021 09:36:03 -0600 (CST) (envelope-from mike) Message-Id: <202111101536.1AAFa311018767@mail.karels.net> To: Gleb Smirnoff cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org From: Mike Karels Reply-to: mike@karels.net Subject: Re: git: 20d59403961d - main - kernel: deprecate Internet Class A/B/C In-reply-to: Your message of Tue, 09 Nov 2021 22:40:05 -0800. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18765.1636558563.1@mail.karels.net> Content-Transfer-Encoding: quoted-printable Date: Wed, 10 Nov 2021 09:36:03 -0600 X-Rspamd-Queue-Id: 4Hq88C0h9yz4lZx X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of mike@mail.karels.net has no SPF policy when checking 216.160.39.52) smtp.mailfrom=mike@mail.karels.net X-Spamd-Result: default: False [2.30 / 15.00]; HAS_REPLYTO(0.00)[mike@karels.net]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[mike]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_ADDR_EQ_FROM(0.00)[]; DMARC_NA(0.00)[karels.net]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; MID_RHS_MATCH_FROMTLD(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.996]; NEURAL_SPAM_LONG(1.00)[1.000]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[mike@karels.net,mike@mail.karels.net]; RCVD_NO_TLS_LAST(0.10)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:209, ipnet:216.160.36.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[mike@karels.net,mike@mail.karels.net]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N Gleb Smirnoff wrote: > Mike, > On Tue, Nov 09, 2021 at 03:36:01PM +0000, Mike Karels wrote: > M> commit 20d59403961d531467cfab22163f49c131cc8b55 > M> Author: Mike Karels > M> AuthorDate: 2021-10-27 03:01:09 +0000 > M> Commit: Mike Karels > M> CommitDate: 2021-11-09 15:32:38 +0000 > M> = > M> kernel: deprecate Internet Class A/B/C > M> = > M> Hide historical Class A/B/C macros unless IN_HISTORICAL_NETS is d= efined; > M> define it for user level. Define IN_MULTICAST separately from IN= _CLASSD, > M> and use it in pf instead of IN_CLASSD. Stop using class for sett= ing > M> default masks when not specified; instead, define new default mas= k > M> (24 bits). Warn when an Internet address is set without a mask. > M> = > M> MFC after: 1 month > M> Reviewed by: cy > M> Differential Revision: https://reviews.freebsd.org/D32708 > Just my 2 cents. I wasn't added as reviewer of D32708 and that's > why totally missed it. IMHO, such reviews should have #network as > reviewer. I wasn't aware of #network, or I would have added it. I publicized the reviews on freebsd-net, and asked people to add themselves. There was also discussion of some parts of this, including default mask. > I'm convinced that the status of classful addressing that was left > exactly 10 years go in b365d954cc9c39e9854eeb726a60ae812e0fb2fe was > good enough. After that change the only place where classes exist > is the mask autoguessing. It was absolutely backward compatible and > not breaking any POLA. And had zero code maintainance burden! Nobody > have ever had problems with classes since. Did existence of the small > piece of code in in_aifaddr_ioctl() or class definitions in in.h > created any conflicts with development of any new code? I'm not aware of conflicts, but we are even farther from classful addressing than 10 years ago. There were still a *lot* of references in the base system, and I'm working to reduce them. Some of them are in obsolete code that isn't worth updating, some (like the *stat programs) are in mainline code. > The new /24 default is no better than classes. The only difference > that classes maintained POLA and new default doesn't. For example, > in my home network I have default router 10.0.0.1 and since it is > class A network on my VMs and test boxes I can type > # ifconfig vtnet0 10.6.6.6 > and that is going to work. With this change no longer. I suspect that /8 is by far the minority these days, even with a "Class A" net. I also use net 10 at home, and at the last several jobs, but it is subnetted in each case. I would peridically add an address, forgetting a mask, only to find that a route for 10/8 isolated the machine= . That said, my main objective was to deprecate usage without a mask, and to warn in that case. Both the kernel and ifconfig now warn when a defaul= t mask is used. In the discussion on freebsd-net and in the review, the main thought was that masks should be required. But it isn't practical to fail and return an error with no mask, at least not without a significant period with warnings, or some systems would stop coming up on the network. One reviewer was going to comment on the /24 default, but thought it was better than the previous. I'm open to hearing more opinions. Mike From nobody Wed Nov 10 16:38:56 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B535A184B845; Wed, 10 Nov 2021 16:39:00 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hq9Xh34dsz3P5D; Wed, 10 Nov 2021 16:39:00 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 1AAGcwQG089091 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 10 Nov 2021 08:38:58 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 1AAGcv1i089090; Wed, 10 Nov 2021 08:38:57 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Wed, 10 Nov 2021 08:38:56 -0800 From: Gleb Smirnoff To: Mike Karels Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 20d59403961d - main - kernel: deprecate Internet Class A/B/C Message-ID: References: <202111101536.1AAFa311018767@mail.karels.net> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202111101536.1AAFa311018767@mail.karels.net> X-Rspamd-Queue-Id: 4Hq9Xh34dsz3P5D X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Wed, Nov 10, 2021 at 09:36:03AM -0600, Mike Karels wrote: M> > The new /24 default is no better than classes. The only difference M> > that classes maintained POLA and new default doesn't. For example, M> > in my home network I have default router 10.0.0.1 and since it is M> > class A network on my VMs and test boxes I can type M> M> > # ifconfig vtnet0 10.6.6.6 M> M> > and that is going to work. With this change no longer. M> M> I suspect that /8 is by far the minority these days, even with a M> "Class A" net. I also use net 10 at home, and at the last several jobs, M> but it is subnetted in each case. I would peridically add an address, M> forgetting a mask, only to find that a route for 10/8 isolated the machine. The 10/8 can be used at home as a huge personal address space, just like a /64 IPv6 prefix. All addresses added without masks and everything works. M> That said, my main objective was to deprecate usage without a mask, and M> to warn in that case. Both the kernel and ifconfig now warn when a default M> mask is used. In the discussion on freebsd-net and in the review, the M> main thought was that masks should be required. But it isn't practical to M> fail and return an error with no mask, at least not without a significant M> period with warnings, or some systems would stop coming up on the network. M> M> One reviewer was going to comment on the /24 default, but thought it was M> better than the previous. I'm open to hearing more opinions. Although I don't internally agree that we really need to police people to always specify masks, I would make step forward and agree with that. So, let's do print loud warning on every attempt to set IP address without a mask. But I can not agree that change from class based guess to /24 is a right thing to do. A proper deprecation process goes like this: Step 1: Print warning, don't change legacy behavior. <... people adopt ...> Step 2: Return error. Remove deprecated behavior. What we did is that we changed behavior together with warning. The new behavior is neither the legacy one nor the desired one, where mask is a must. Look from a user perspective: for class C nothing changed, but changed for A and B. -- Gleb Smirnoff From nobody Wed Nov 10 19:34:18 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 15F9817EA006; Wed, 10 Nov 2021 19:34:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqFQz05m3z3F4y; Wed, 10 Nov 2021 19:34:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D75A51E3A6; Wed, 10 Nov 2021 19:34:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AAJYIaG041522; Wed, 10 Nov 2021 19:34:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AAJYIvT041521; Wed, 10 Nov 2021 19:34:18 GMT (envelope-from git) Date: Wed, 10 Nov 2021 19:34:18 GMT Message-Id: <202111101934.1AAJYIvT041521@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e5adb145f06e - main - Remove arm/linux from sysent toplevel target List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e5adb145f06e744e0205358d9a2657442dd623b1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e5adb145f06e744e0205358d9a2657442dd623b1 commit e5adb145f06e744e0205358d9a2657442dd623b1 Author: Konstantin Belousov AuthorDate: 2021-11-10 17:54:06 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-10 19:18:53 +0000 Remove arm/linux from sysent toplevel target Sponsored by: The FreeBSD Foundation Fixes: 65e485014b0dcf53e0 --- Makefile.inc1 | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index c3b8c5257a18..ba1c74adabe1 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1520,7 +1520,6 @@ _sysent_dirs= sys/kern _sysent_dirs+= sys/compat/freebsd32 _sysent_dirs+= sys/amd64/linux \ sys/amd64/linux32 \ - sys/arm/linux \ sys/arm64/linux \ sys/i386/linux From nobody Wed Nov 10 19:34:19 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5C25817EA00A; Wed, 10 Nov 2021 19:34:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqFR01Jj9z3FD6; Wed, 10 Nov 2021 19:34:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0680F1E262; Wed, 10 Nov 2021 19:34:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AAJYJ2v041546; Wed, 10 Nov 2021 19:34:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AAJYJFQ041545; Wed, 10 Nov 2021 19:34:19 GMT (envelope-from git) Date: Wed, 10 Nov 2021 19:34:19 GMT Message-Id: <202111101934.1AAJYJFQ041545@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 160b4b922b60 - main - Add real sched.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 160b4b922b6021848b6b48afc894d16b879b7af2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=160b4b922b6021848b6b48afc894d16b879b7af2 commit 160b4b922b6021848b6b48afc894d16b879b7af2 Author: Konstantin Belousov AuthorDate: 2021-10-22 15:17:21 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-10 19:18:53 +0000 Add real sched.h It is required by IEEE Std 1003.1-2008 AKA POSIX. Put some Linux compatibility stuff under BSD_VISIBLE namespace, in particular, sys/cpuset.h definitions. Also, if user really want Linux compatibility, she can request cpu_set_t typedef with _WITH_CPU_SET_T define. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32901 --- include/Makefile | 5 +++-- include/sched.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/include/Makefile b/include/Makefile index f5c0fc598b0c..1d6557cdad1e 100644 --- a/include/Makefile +++ b/include/Makefile @@ -20,7 +20,8 @@ INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \ netdb.h nl_types.h nlist.h nss.h nsswitch.h paths.h \ printf.h proc_service.h pthread.h \ pthread_np.h pwd.h ranlib.h readpassphrase.h regex.h \ - res_update.h resolv.h runetype.h search.h semaphore.h setjmp.h \ + res_update.h resolv.h runetype.h sched.h \ + search.h semaphore.h setjmp.h \ signal.h spawn.h stab.h stdalign.h stdbool.h stddef.h \ stdnoreturn.h stdio.h stdlib.h string.h stringlist.h \ strings.h sysexits.h tar.h termios.h tgmath.h \ @@ -33,7 +34,7 @@ INCS+= vis.h MHDRS= float.h floatingpoint.h stdarg.h -PHDRS= sched.h _semaphore.h +PHDRS= _semaphore.h LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdatomic.h stdint.h \ syslog.h ucontext.h diff --git a/include/sched.h b/include/sched.h new file mode 100644 index 000000000000..1a8eac18109c --- /dev/null +++ b/include/sched.h @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 2021 The FreeBSD Foundation + * + * This software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef __SCHED_H__ +#define __SCHED_H__ + +#include +#include +#include +#if __BSD_VISIBLE +#include +#endif /* __BSD_VISIBLE */ + +#if __BSD_VISIBLE +#ifdef _WITH_CPU_SET_T +struct _cpuset; +typedef struct _cpuset cpu_set_t; +#endif /* _WITH_CPU_SET_T */ +#endif /* __BSD_VISIBLE */ + +#endif /* __SCHED_H__ */ From nobody Wed Nov 10 19:34:21 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C51CF17E9F5A; Wed, 10 Nov 2021 19:34:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqFR13dhqz3FD9; Wed, 10 Nov 2021 19:34:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EB9A1E263; Wed, 10 Nov 2021 19:34:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AAJYLaK041570; Wed, 10 Nov 2021 19:34:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AAJYL0d041569; Wed, 10 Nov 2021 19:34:21 GMT (envelope-from git) Date: Wed, 10 Nov 2021 19:34:21 GMT Message-Id: <202111101934.1AAJYL0d041569@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 43736b71dd05 - main - Add sched_get/setaffinity(3) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43736b71dd051212d5c55be9fa21c45993017fbb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=43736b71dd051212d5c55be9fa21c45993017fbb commit 43736b71dd051212d5c55be9fa21c45993017fbb Author: Konstantin Belousov AuthorDate: 2021-10-22 15:21:33 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-10 19:18:54 +0000 Add sched_get/setaffinity(3) for compatibility with Linux. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32901 --- include/sched.h | 7 +++++++ lib/libc/gen/Makefile.inc | 2 ++ lib/libc/gen/Symbol.map | 5 +++++ lib/libc/gen/sched_getaffinity.c | 36 ++++++++++++++++++++++++++++++++++++ lib/libc/gen/sched_setaffinity.c | 36 ++++++++++++++++++++++++++++++++++++ 5 files changed, 86 insertions(+) diff --git a/include/sched.h b/include/sched.h index 1a8eac18109c..531ecb1bb9a3 100644 --- a/include/sched.h +++ b/include/sched.h @@ -43,4 +43,11 @@ typedef struct _cpuset cpu_set_t; #endif /* _WITH_CPU_SET_T */ #endif /* __BSD_VISIBLE */ +__BEGIN_DECLS +#if __BSD_VISIBLE +int sched_getaffinity(pid_t pid, size_t cpusetsz, cpuset_t *cpuset); +int sched_setaffinity(int pid, size_t cpusetsz, const cpuset_t *cpuset); +#endif /* __BSD_VISIBLE */ +__END_DECLS + #endif /* __SCHED_H__ */ diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index aa9a4c0cbf67..75bc30d70976 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -123,6 +123,8 @@ SRCS+= __getosreldate.c \ scandir.c \ scandir_b.c \ scandir-compat11.c \ + sched_getaffinity.c \ + sched_setaffinity.c \ seed48.c \ seekdir.c \ semctl.c \ diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index c89eb63caada..a4630749ae7e 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -435,6 +435,11 @@ FBSD_1.6 { tcsetwinsize; }; +FBSD_1.7 { + sched_getaffinity; + sched_setaffinity; +}; + FBSDprivate_1.0 { /* needed by thread libraries */ __thr_jtable; diff --git a/lib/libc/gen/sched_getaffinity.c b/lib/libc/gen/sched_getaffinity.c new file mode 100644 index 000000000000..191374a3c5e3 --- /dev/null +++ b/lib/libc/gen/sched_getaffinity.c @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2021 The FreeBSD Foundation + * + * This software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +int +sched_getaffinity(pid_t pid, size_t cpusetsz, cpuset_t *cpuset) +{ + return (cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, pid, + cpusetsz, cpuset)); +} diff --git a/lib/libc/gen/sched_setaffinity.c b/lib/libc/gen/sched_setaffinity.c new file mode 100644 index 000000000000..9368b1752b74 --- /dev/null +++ b/lib/libc/gen/sched_setaffinity.c @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2021 The FreeBSD Foundation + * + * This software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +int +sched_setaffinity(pid_t pid, size_t cpusetsz, const cpuset_t *cpuset) +{ + return (cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, pid, + cpusetsz, cpuset)); +} From nobody Wed Nov 10 19:34:22 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 567D917E9FD5; Wed, 10 Nov 2021 19:34:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqFR23yl4z3F5L; Wed, 10 Nov 2021 19:34:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 523771E264; Wed, 10 Nov 2021 19:34:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AAJYMnr041601; Wed, 10 Nov 2021 19:34:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AAJYMBs041600; Wed, 10 Nov 2021 19:34:22 GMT (envelope-from git) Date: Wed, 10 Nov 2021 19:34:22 GMT Message-Id: <202111101934.1AAJYMBs041600@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 77b2c2f81451 - main - Add sched_getcpu() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 77b2c2f81451db8119e4ea6398fe76813db790de Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=77b2c2f81451db8119e4ea6398fe76813db790de commit 77b2c2f81451db8119e4ea6398fe76813db790de Author: Konstantin Belousov AuthorDate: 2021-10-22 15:35:53 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-10 19:18:54 +0000 Add sched_getcpu() for compatibility with Linux. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32901 --- include/sched.h | 1 + lib/libc/aarch64/sys/Makefile.inc | 3 ++- lib/libc/arm/sys/Makefile.inc | 3 ++- lib/libc/gen/Symbol.map | 1 + lib/libc/gen/sched_getcpu_gen.c | 36 ++++++++++++++++++++++++++++++++++ lib/libc/include/libc_private.h | 1 + lib/libc/mips/sys/Makefile.inc | 3 ++- lib/libc/powerpc/sys/Makefile.inc | 4 +++- lib/libc/powerpc64/sys/Makefile.inc | 4 +++- lib/libc/riscv/sys/Makefile.inc | 3 ++- lib/libc/sys/Makefile.inc | 3 +++ lib/libc/x86/sys/Makefile.inc | 3 ++- sys/compat/freebsd32/capabilities.conf | 1 + sys/compat/freebsd32/syscalls.master | 2 +- sys/kern/kern_synch.c | 7 +++++++ sys/kern/syscalls.master | 3 +++ 16 files changed, 70 insertions(+), 8 deletions(-) diff --git a/include/sched.h b/include/sched.h index 531ecb1bb9a3..1c41cda79046 100644 --- a/include/sched.h +++ b/include/sched.h @@ -47,6 +47,7 @@ __BEGIN_DECLS #if __BSD_VISIBLE int sched_getaffinity(pid_t pid, size_t cpusetsz, cpuset_t *cpuset); int sched_setaffinity(int pid, size_t cpusetsz, const cpuset_t *cpuset); +int sched_getcpu(void); #endif /* __BSD_VISIBLE */ __END_DECLS diff --git a/lib/libc/aarch64/sys/Makefile.inc b/lib/libc/aarch64/sys/Makefile.inc index 623a06b7faf8..97aff8ba92fe 100644 --- a/lib/libc/aarch64/sys/Makefile.inc +++ b/lib/libc/aarch64/sys/Makefile.inc @@ -2,7 +2,8 @@ MIASM:= ${MIASM:Nfreebsd[467]_*} -SRCS+= __vdso_gettc.c +SRCS+= __vdso_gettc.c \ + sched_getcpu_gen.c MDASM= cerror.S \ syscall.S \ diff --git a/lib/libc/arm/sys/Makefile.inc b/lib/libc/arm/sys/Makefile.inc index be6a58f8aaf5..c6e854e7954a 100644 --- a/lib/libc/arm/sys/Makefile.inc +++ b/lib/libc/arm/sys/Makefile.inc @@ -1,6 +1,7 @@ # $FreeBSD$ -SRCS+= __vdso_gettc.c +SRCS+= __vdso_gettc.c \ + sched_getcpu_gen.c MDASM= Ovfork.S cerror.S syscall.S diff --git a/lib/libc/gen/Symbol.map b/lib/libc/gen/Symbol.map index a4630749ae7e..b6c3c252be7c 100644 --- a/lib/libc/gen/Symbol.map +++ b/lib/libc/gen/Symbol.map @@ -438,6 +438,7 @@ FBSD_1.6 { FBSD_1.7 { sched_getaffinity; sched_setaffinity; + sched_getcpu; }; FBSDprivate_1.0 { diff --git a/lib/libc/gen/sched_getcpu_gen.c b/lib/libc/gen/sched_getcpu_gen.c new file mode 100644 index 000000000000..ef1bebc2915a --- /dev/null +++ b/lib/libc/gen/sched_getcpu_gen.c @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2021 The FreeBSD Foundation + * + * This software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include "libc_private.h" + +int +sched_getcpu(void) +{ + return (__sys_sched_getcpu()); +} diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index 5a524c0211d1..61c1eb438142 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -371,6 +371,7 @@ __ssize_t __sys_recv(int, void *, __size_t, int); __ssize_t __sys_recvfrom(int, void *, __size_t, int, struct sockaddr *, __socklen_t *); __ssize_t __sys_recvmsg(int, struct msghdr *, int); +int __sys_sched_getcpu(void); int __sys_select(int, struct fd_set *, struct fd_set *, struct fd_set *, struct timeval *); __ssize_t __sys_sendmsg(int, const struct msghdr *, int); diff --git a/lib/libc/mips/sys/Makefile.inc b/lib/libc/mips/sys/Makefile.inc index d7cc70d01b07..fa6d9b32739d 100644 --- a/lib/libc/mips/sys/Makefile.inc +++ b/lib/libc/mips/sys/Makefile.inc @@ -1,6 +1,7 @@ # $FreeBSD$ -SRCS+= trivial-vdso_tc.c +SRCS+= trivial-vdso_tc.c \ + sched_getcpu_gen.c MDASM= Ovfork.S cerror.S syscall.S diff --git a/lib/libc/powerpc/sys/Makefile.inc b/lib/libc/powerpc/sys/Makefile.inc index 99a141b5cb1e..6f07795b8870 100644 --- a/lib/libc/powerpc/sys/Makefile.inc +++ b/lib/libc/powerpc/sys/Makefile.inc @@ -1,4 +1,6 @@ # $FreeBSD$ -SRCS+= __vdso_gettc.c +SRCS+= __vdso_gettc.c \ + sched_getcpu_gen.c + MDASM+= cerror.S diff --git a/lib/libc/powerpc64/sys/Makefile.inc b/lib/libc/powerpc64/sys/Makefile.inc index 99a141b5cb1e..6f07795b8870 100644 --- a/lib/libc/powerpc64/sys/Makefile.inc +++ b/lib/libc/powerpc64/sys/Makefile.inc @@ -1,4 +1,6 @@ # $FreeBSD$ -SRCS+= __vdso_gettc.c +SRCS+= __vdso_gettc.c \ + sched_getcpu_gen.c + MDASM+= cerror.S diff --git a/lib/libc/riscv/sys/Makefile.inc b/lib/libc/riscv/sys/Makefile.inc index b322cece382c..2eb12bf11cad 100644 --- a/lib/libc/riscv/sys/Makefile.inc +++ b/lib/libc/riscv/sys/Makefile.inc @@ -1,6 +1,7 @@ # $FreeBSD$ -SRCS+= __vdso_gettc.c +SRCS+= __vdso_gettc.c \ + sched_getcpu_gen.c MDASM= cerror.S \ syscall.S \ diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index 58ba333080b7..5c472f835029 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -36,6 +36,9 @@ SRCS+= \ SRCS+= getdents.c lstat.c mknod.c stat.c +NOASM+= sched_getcpu.o +PSEUDO+= _sched_getcpu.o + SRCS+= fstat.c fstatat.c fstatfs.c getfsstat.c statfs.c NOASM+= fstat.o fstatat.o fstatfs.o getfsstat.o statfs.o PSEUDO+= _fstat.o _fstatat.o _fstatfs.o _getfsstat.o _statfs.o diff --git a/lib/libc/x86/sys/Makefile.inc b/lib/libc/x86/sys/Makefile.inc index eff3a1085ec6..2945a6871e0d 100644 --- a/lib/libc/x86/sys/Makefile.inc +++ b/lib/libc/x86/sys/Makefile.inc @@ -4,7 +4,8 @@ SRCS+= \ __vdso_gettc.c \ - pkru.c + pkru.c \ + sched_getcpu_gen.c MAN+= \ pkru.3 diff --git a/sys/compat/freebsd32/capabilities.conf b/sys/compat/freebsd32/capabilities.conf index f53530eb7fa7..3ec922d54920 100644 --- a/sys/compat/freebsd32/capabilities.conf +++ b/sys/compat/freebsd32/capabilities.conf @@ -567,6 +567,7 @@ sbrk ## sched_get_priority_max sched_get_priority_min +sched_getcpu ## ## Allow various thread/process scheduler operations. diff --git a/sys/compat/freebsd32/syscalls.master b/sys/compat/freebsd32/syscalls.master index 3e53de2dc966..5cb7c059a670 100644 --- a/sys/compat/freebsd32/syscalls.master +++ b/sys/compat/freebsd32/syscalls.master @@ -1181,5 +1181,5 @@ const struct spacectl_range32 *rqsr, \ int flags, \ struct spacectl_range32 *rmsr); } - +581 AUE_NULL NOPROTO { int sched_getcpu(void); } ; vim: syntax=off diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 930bd940d2ab..e78878987b57 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -686,3 +686,10 @@ sys_yield(struct thread *td, struct yield_args *uap) td->td_retval[0] = 0; return (0); } + +int +sys_sched_getcpu(struct thread *td, struct sched_getcpu_args *uap) +{ + td->td_retval[0] = td->td_oncpu; + return (0); +} diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index 0176916b850a..0965d5771c5a 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -3261,6 +3261,9 @@ _Out_opt_ struct spacectl_range *rmsr, ); } +581 AUE_NULL STD|CAPENABLED { + int sched_getcpu(void); + } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master From nobody Wed Nov 10 19:34:23 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 82A8E17E9DF5; Wed, 10 Nov 2021 19:34:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqFR35yKSz3FB5; Wed, 10 Nov 2021 19:34:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 741AF1E3A7; Wed, 10 Nov 2021 19:34:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AAJYN1R041625; Wed, 10 Nov 2021 19:34:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AAJYNNL041624; Wed, 10 Nov 2021 19:34:23 GMT (envelope-from git) Date: Wed, 10 Nov 2021 19:34:23 GMT Message-Id: <202111101934.1AAJYNNL041624@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: f239545591a8 - main - x86: provide userspace implementation of sched_getcpu() where possible List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f239545591a821386f9bdb84c02044884ad415b5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f239545591a821386f9bdb84c02044884ad415b5 commit f239545591a821386f9bdb84c02044884ad415b5 Author: Konstantin Belousov AuthorDate: 2021-10-31 01:39:31 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-10 19:18:54 +0000 x86: provide userspace implementation of sched_getcpu() where possible Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32901 --- lib/libc/x86/sys/Makefile.inc | 2 +- lib/libc/x86/sys/sched_getcpu_x86.c | 81 +++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/lib/libc/x86/sys/Makefile.inc b/lib/libc/x86/sys/Makefile.inc index 2945a6871e0d..382b52dd9065 100644 --- a/lib/libc/x86/sys/Makefile.inc +++ b/lib/libc/x86/sys/Makefile.inc @@ -5,7 +5,7 @@ SRCS+= \ __vdso_gettc.c \ pkru.c \ - sched_getcpu_gen.c + sched_getcpu_x86.c MAN+= \ pkru.3 diff --git a/lib/libc/x86/sys/sched_getcpu_x86.c b/lib/libc/x86/sys/sched_getcpu_x86.c new file mode 100644 index 000000000000..13ba18ef5e36 --- /dev/null +++ b/lib/libc/x86/sys/sched_getcpu_x86.c @@ -0,0 +1,81 @@ +/*- + * Copyright (c) 2021 The FreeBSD Foundation + * + * This software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include +#include "libc_private.h" + +static int +sched_getcpu_sys(void) +{ + return (__sys_sched_getcpu()); +} + +static int +sched_getcpu_rdpid(void) +{ + register_t res; + + __asm("rdpid %0" : "=r" (res)); + return ((int)res); +} + +static int +sched_getcpu_rdtscp(void) +{ + int res; + + __asm("rdtscp" : "=c" (res) : : "eax", "edx"); + return (res); +} + +DEFINE_UIFUNC(, int, sched_getcpu, (void)) +{ + u_int amd_feature, cpu_exthigh, p[4]; + + if ((cpu_stdext_feature2 & CPUID_STDEXT2_RDPID) != 0) + return (sched_getcpu_rdpid); + + amd_feature = 0; + if (cpu_feature != 0) { + do_cpuid(0x80000000, p); + cpu_exthigh = p[0]; + if (cpu_exthigh >= 0x80000001) { + do_cpuid(0x80000001, p); + amd_feature = p[3]; + } + } + + return ((amd_feature & AMDID_RDTSCP) == 0 ? + sched_getcpu_sys : sched_getcpu_rdtscp); +} From nobody Wed Nov 10 19:34:24 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 048A217E9B98; Wed, 10 Nov 2021 19:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqFR45Zyqz3DxF; Wed, 10 Nov 2021 19:34:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EADA1E265; Wed, 10 Nov 2021 19:34:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AAJYOgi041649; Wed, 10 Nov 2021 19:34:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AAJYOWx041648; Wed, 10 Nov 2021 19:34:24 GMT (envelope-from git) Date: Wed, 10 Nov 2021 19:34:24 GMT Message-Id: <202111101934.1AAJYOWx041648@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 43e6f07b06e0 - main - sched.h: add CPU_EQUAL() for better compatibility with Linux List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43e6f07b06e05cd36c22b204be5be94c2807aec8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=43e6f07b06e05cd36c22b204be5be94c2807aec8 commit 43e6f07b06e05cd36c22b204be5be94c2807aec8 Author: Konstantin Belousov AuthorDate: 2021-10-30 07:36:24 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-10 19:18:54 +0000 sched.h: add CPU_EQUAL() for better compatibility with Linux Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32901 --- sys/sys/cpuset.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/sys/cpuset.h b/sys/sys/cpuset.h index 9ef1a65f4506..602f73fbe5e4 100644 --- a/sys/sys/cpuset.h +++ b/sys/sys/cpuset.h @@ -50,6 +50,7 @@ #define CPU_ZERO(p) BIT_ZERO(CPU_SETSIZE, p) #define CPU_FILL(p) BIT_FILL(CPU_SETSIZE, p) #define CPU_SETOF(n, p) BIT_SETOF(CPU_SETSIZE, n, p) +#define CPU_EQUAL(p, c) (BIT_CMP(CPU_SETSIZE, p, c) == 0) #define CPU_EMPTY(p) BIT_EMPTY(CPU_SETSIZE, p) #define CPU_ISFULLSET(p) BIT_ISFULLSET(CPU_SETSIZE, p) #define CPU_SUBSET(p, c) BIT_SUBSET(CPU_SETSIZE, p, c) From nobody Wed Nov 10 19:34:25 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 59D3A17EA0DB; Wed, 10 Nov 2021 19:34:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqFR62255z3F7b; Wed, 10 Nov 2021 19:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2B5C1E36F; Wed, 10 Nov 2021 19:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AAJYPo6041673; Wed, 10 Nov 2021 19:34:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AAJYPFS041672; Wed, 10 Nov 2021 19:34:25 GMT (envelope-from git) Date: Wed, 10 Nov 2021 19:34:25 GMT Message-Id: <202111101934.1AAJYPFS041672@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 439c3d95638a - main - Regen List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 439c3d95638ae1e11ae3184634e07292b139115e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=439c3d95638ae1e11ae3184634e07292b139115e commit 439c3d95638ae1e11ae3184634e07292b139115e Author: Konstantin Belousov AuthorDate: 2021-11-10 17:56:51 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-10 19:18:54 +0000 Regen --- sys/compat/freebsd32/freebsd32_syscall.h | 3 ++- sys/compat/freebsd32/freebsd32_syscalls.c | 1 + sys/compat/freebsd32/freebsd32_sysent.c | 1 + sys/compat/freebsd32/freebsd32_systrace_args.c | 10 ++++++++++ sys/kern/init_sysent.c | 1 + sys/kern/syscalls.c | 1 + sys/kern/systrace_args.c | 10 ++++++++++ sys/sys/syscall.h | 3 ++- sys/sys/syscall.mk | 3 ++- sys/sys/sysproto.h | 5 +++++ 10 files changed, 35 insertions(+), 3 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_syscall.h b/sys/compat/freebsd32/freebsd32_syscall.h index 7898b3a25c2e..9f2f439c4c7f 100644 --- a/sys/compat/freebsd32/freebsd32_syscall.h +++ b/sys/compat/freebsd32/freebsd32_syscall.h @@ -509,4 +509,5 @@ #define FREEBSD32_SYS_freebsd32_aio_writev 578 #define FREEBSD32_SYS_freebsd32_aio_readv 579 #define FREEBSD32_SYS_freebsd32_fspacectl 580 -#define FREEBSD32_SYS_MAXSYSCALL 581 +#define FREEBSD32_SYS_sched_getcpu 581 +#define FREEBSD32_SYS_MAXSYSCALL 582 diff --git a/sys/compat/freebsd32/freebsd32_syscalls.c b/sys/compat/freebsd32/freebsd32_syscalls.c index 51b7dbc249d0..4d20af028834 100644 --- a/sys/compat/freebsd32/freebsd32_syscalls.c +++ b/sys/compat/freebsd32/freebsd32_syscalls.c @@ -617,4 +617,5 @@ const char *freebsd32_syscallnames[] = { "freebsd32_aio_writev", /* 578 = freebsd32_aio_writev */ "freebsd32_aio_readv", /* 579 = freebsd32_aio_readv */ "freebsd32_fspacectl", /* 580 = freebsd32_fspacectl */ + "sched_getcpu", /* 581 = sched_getcpu */ }; diff --git a/sys/compat/freebsd32/freebsd32_sysent.c b/sys/compat/freebsd32/freebsd32_sysent.c index 6e1ae033b765..f8769b8de446 100644 --- a/sys/compat/freebsd32/freebsd32_sysent.c +++ b/sys/compat/freebsd32/freebsd32_sysent.c @@ -670,4 +670,5 @@ struct sysent freebsd32_sysent[] = { { .sy_narg = AS(freebsd32_aio_writev_args), .sy_call = (sy_call_t *)freebsd32_aio_writev, .sy_auevent = AUE_AIO_WRITEV, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 578 = freebsd32_aio_writev */ { .sy_narg = AS(freebsd32_aio_readv_args), .sy_call = (sy_call_t *)freebsd32_aio_readv, .sy_auevent = AUE_AIO_READV, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 579 = freebsd32_aio_readv */ { .sy_narg = AS(freebsd32_fspacectl_args), .sy_call = (sy_call_t *)freebsd32_fspacectl, .sy_auevent = AUE_FSPACECTL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 580 = freebsd32_fspacectl */ + { .sy_narg = 0, .sy_call = (sy_call_t *)sys_sched_getcpu, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 581 = sched_getcpu */ }; diff --git a/sys/compat/freebsd32/freebsd32_systrace_args.c b/sys/compat/freebsd32/freebsd32_systrace_args.c index 7c970c358296..96a67aef6255 100644 --- a/sys/compat/freebsd32/freebsd32_systrace_args.c +++ b/sys/compat/freebsd32/freebsd32_systrace_args.c @@ -3418,6 +3418,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) *n_args = 5; break; } + /* sched_getcpu */ + case 581: { + *n_args = 0; + break; + } default: *n_args = 0; break; @@ -9216,6 +9221,9 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; }; break; + /* sched_getcpu */ + case 581: + break; default: break; }; @@ -11140,6 +11148,8 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) if (ndx == 0 || ndx == 1) p = "int"; break; + /* sched_getcpu */ + case 581: default: break; }; diff --git a/sys/kern/init_sysent.c b/sys/kern/init_sysent.c index 414b998420aa..b58ee2859108 100644 --- a/sys/kern/init_sysent.c +++ b/sys/kern/init_sysent.c @@ -636,4 +636,5 @@ struct sysent sysent[] = { { .sy_narg = AS(aio_writev_args), .sy_call = (sy_call_t *)sys_aio_writev, .sy_auevent = AUE_AIO_WRITEV, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 578 = aio_writev */ { .sy_narg = AS(aio_readv_args), .sy_call = (sy_call_t *)sys_aio_readv, .sy_auevent = AUE_AIO_READV, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 579 = aio_readv */ { .sy_narg = AS(fspacectl_args), .sy_call = (sy_call_t *)sys_fspacectl, .sy_auevent = AUE_FSPACECTL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 580 = fspacectl */ + { .sy_narg = 0, .sy_call = (sy_call_t *)sys_sched_getcpu, .sy_auevent = AUE_NULL, .sy_flags = SYF_CAPENABLED, .sy_thrcnt = SY_THR_STATIC }, /* 581 = sched_getcpu */ }; diff --git a/sys/kern/syscalls.c b/sys/kern/syscalls.c index 4d5423a28bb8..efbac3185746 100644 --- a/sys/kern/syscalls.c +++ b/sys/kern/syscalls.c @@ -587,4 +587,5 @@ const char *syscallnames[] = { "aio_writev", /* 578 = aio_writev */ "aio_readv", /* 579 = aio_readv */ "fspacectl", /* 580 = fspacectl */ + "sched_getcpu", /* 581 = sched_getcpu */ }; diff --git a/sys/kern/systrace_args.c b/sys/kern/systrace_args.c index d924e49be355..a3e28aed31f9 100644 --- a/sys/kern/systrace_args.c +++ b/sys/kern/systrace_args.c @@ -3410,6 +3410,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) *n_args = 5; break; } + /* sched_getcpu */ + case 581: { + *n_args = 0; + break; + } default: *n_args = 0; break; @@ -9121,6 +9126,9 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) break; }; break; + /* sched_getcpu */ + case 581: + break; default: break; }; @@ -11072,6 +11080,8 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) if (ndx == 0 || ndx == 1) p = "int"; break; + /* sched_getcpu */ + case 581: default: break; }; diff --git a/sys/sys/syscall.h b/sys/sys/syscall.h index 34c836f22ccc..051a0f64390e 100644 --- a/sys/sys/syscall.h +++ b/sys/sys/syscall.h @@ -518,4 +518,5 @@ #define SYS_aio_writev 578 #define SYS_aio_readv 579 #define SYS_fspacectl 580 -#define SYS_MAXSYSCALL 581 +#define SYS_sched_getcpu 581 +#define SYS_MAXSYSCALL 582 diff --git a/sys/sys/syscall.mk b/sys/sys/syscall.mk index 52cc8c9a7563..5760a2574a84 100644 --- a/sys/sys/syscall.mk +++ b/sys/sys/syscall.mk @@ -423,4 +423,5 @@ MIASM = \ __specialfd.o \ aio_writev.o \ aio_readv.o \ - fspacectl.o + fspacectl.o \ + sched_getcpu.o diff --git a/sys/sys/sysproto.h b/sys/sys/sysproto.h index cec3c1925e5d..2a89ee0770f3 100644 --- a/sys/sys/sysproto.h +++ b/sys/sys/sysproto.h @@ -1854,6 +1854,9 @@ struct fspacectl_args { char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; char rmsr_l_[PADL_(struct spacectl_range *)]; struct spacectl_range * rmsr; char rmsr_r_[PADR_(struct spacectl_range *)]; }; +struct sched_getcpu_args { + register_t dummy; +}; int nosys(struct thread *, struct nosys_args *); void sys_sys_exit(struct thread *, struct sys_exit_args *); int sys_fork(struct thread *, struct fork_args *); @@ -2249,6 +2252,7 @@ int sys___specialfd(struct thread *, struct __specialfd_args *); int sys_aio_writev(struct thread *, struct aio_writev_args *); int sys_aio_readv(struct thread *, struct aio_readv_args *); int sys_fspacectl(struct thread *, struct fspacectl_args *); +int sys_sched_getcpu(struct thread *, struct sched_getcpu_args *); #ifdef COMPAT_43 @@ -3194,6 +3198,7 @@ int freebsd12_closefrom(struct thread *, struct freebsd12_closefrom_args *); #define SYS_AUE_aio_writev AUE_AIO_WRITEV #define SYS_AUE_aio_readv AUE_AIO_READV #define SYS_AUE_fspacectl AUE_FSPACECTL +#define SYS_AUE_sched_getcpu AUE_NULL #undef PAD_ #undef PADL_ From nobody Wed Nov 10 20:26:35 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D7A56184FE16; Wed, 10 Nov 2021 20:26:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqGbH5mcrz3pnt; Wed, 10 Nov 2021 20:26:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A18721EFAD; Wed, 10 Nov 2021 20:26:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AAKQZmS009408; Wed, 10 Nov 2021 20:26:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AAKQZcm009407; Wed, 10 Nov 2021 20:26:35 GMT (envelope-from git) Date: Wed, 10 Nov 2021 20:26:35 GMT Message-Id: <202111102026.1AAKQZcm009407@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Guangyuan Yang Subject: git: 5504d8394289 - main - sockstat(1): Update Synopsis section List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ygy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5504d8394289853e8c065e88a83fb464cb50d934 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ygy (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5504d8394289853e8c065e88a83fb464cb50d934 commit 5504d8394289853e8c065e88a83fb464cb50d934 Author: Felix Johnson AuthorDate: 2021-11-10 20:22:06 +0000 Commit: Guangyuan Yang CommitDate: 2021-11-10 20:22:06 +0000 sockstat(1): Update Synopsis section Update sockstat(1) manpage so the Synopsis section includes q (silent mode) and the -j argument name is consistent. PR: 256795 MFC after: 3 days Reported by: Nick Reilly --- usr.bin/sockstat/sockstat.1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/sockstat/sockstat.1 b/usr.bin/sockstat/sockstat.1 index f602ad467f9f..bf04028ce9d4 100644 --- a/usr.bin/sockstat/sockstat.1 +++ b/usr.bin/sockstat/sockstat.1 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 28, 2021 +.Dd November 11, 2021 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -35,8 +35,8 @@ .Nd list open sockets .Sh SYNOPSIS .Nm -.Op Fl 46CcLlnSsUuvw -.Op Fl j Ar jid +.Op Fl 46CcLlnqSsUuvw +.Op Fl j Ar jail .Op Fl p Ar ports .Op Fl P Ar protocols .Sh DESCRIPTION From nobody Wed Nov 10 21:58:35 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 26A5517E8462; Wed, 10 Nov 2021 21:58:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqJdS0XgVz4pvc; Wed, 10 Nov 2021 21:58:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8BD120601; Wed, 10 Nov 2021 21:58:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AALwZik029014; Wed, 10 Nov 2021 21:58:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AALwZb3029013; Wed, 10 Nov 2021 21:58:35 GMT (envelope-from git) Date: Wed, 10 Nov 2021 21:58:35 GMT Message-Id: <202111102158.1AALwZb3029013@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: ac2b54441742 - main - mbuf: Fix an offset calculation in m_apply_extpg_one() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ac2b54441742b3148de72e3b29aa0f00d29bb825 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ac2b54441742b3148de72e3b29aa0f00d29bb825 commit ac2b54441742b3148de72e3b29aa0f00d29bb825 Author: Mark Johnston AuthorDate: 2021-11-10 21:57:12 +0000 Commit: Mark Johnston CommitDate: 2021-11-10 21:57:12 +0000 mbuf: Fix an offset calculation in m_apply_extpg_one() We were not including the requested starting offset in the page offset. Reviewed by: jhb Fixes: 3c7a01d773ac ("Extend m_apply() to support unmapped mbufs.") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32922 --- sys/kern/uipc_mbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 0196023bc601..e0cb45a8d384 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1301,7 +1301,7 @@ m_apply_extpg_one(struct mbuf *m, int off, int len, pglen = m_epg_pagelen(m, i, pgoff); if (off < pglen) { count = min(pglen - off, len); - p = (void *)PHYS_TO_DMAP(m->m_epg_pa[i] + pgoff); + p = (void *)PHYS_TO_DMAP(m->m_epg_pa[i] + pgoff + off); rval = f(arg, p, count); if (rval) return (rval); From nobody Wed Nov 10 22:26:29 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 064B41841098; Wed, 10 Nov 2021 22:26:31 +0000 (UTC) (envelope-from mike@karels.net) Received: from mail.karels.net (mail.karels.net [216.160.39.52]) by mx1.freebsd.org (Postfix) with ESMTP id 4HqKFf4QNMz3FZK; Wed, 10 Nov 2021 22:26:30 +0000 (UTC) (envelope-from mike@karels.net) Received: from mail.karels.net (localhost [127.0.0.1]) by mail.karels.net (8.16.1/8.16.1) with ESMTP id 1AAMQTAo020110; Wed, 10 Nov 2021 16:26:29 -0600 (CST) (envelope-from mike@karels.net) Received: from [10.0.2.130] ([10.0.1.1]) by mail.karels.net with ESMTPSA id oEQJORVHjGGMTgAA4+wvSQ (envelope-from ); Wed, 10 Nov 2021 16:26:29 -0600 From: Mike Karels To: Gleb Smirnoff Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 20d59403961d - main - kernel: deprecate Internet Class A/B/C Date: Wed, 10 Nov 2021 16:26:29 -0600 X-Mailer: MailMate (1.14r5818) Message-ID: <90C05BCC-D4B6-43F9-95B1-D072EBA3703A@karels.net> In-Reply-To: References: <202111101536.1AAFa311018767@mail.karels.net> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mail.karels.net id 1AAMQTAo020110 X-Rspamd-Queue-Id: 4HqKFf4QNMz3FZK X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N I=E2=80=99m going to top-post my reply to highlight this question: It is proposed to revert the change to the default mask when setting an Internet interface address without a mask, returning to the use of the Class A/B/C mask as the default. We would still warn if there was no mask supplied, except on loopback and point-to-point interfaces. Does anyone object, or otherwise have comments? Mike On 10 Nov 2021, at 10:38, Gleb Smirnoff wrote: > On Wed, Nov 10, 2021 at 09:36:03AM -0600, Mike Karels wrote: > M> > The new /24 default is no better than classes. The only difference > M> > that classes maintained POLA and new default doesn't. For example, > M> > in my home network I have default router 10.0.0.1 and since it is > M> > class A network on my VMs and test boxes I can type > M> > M> > # ifconfig vtnet0 10.6.6.6 > M> > M> > and that is going to work. With this change no longer. > M> > M> I suspect that /8 is by far the minority these days, even with a > M> "Class A" net. I also use net 10 at home, and at the last several j= obs, > M> but it is subnetted in each case. I would peridically add an addres= s, > M> forgetting a mask, only to find that a route for 10/8 isolated the m= achine. > > The 10/8 can be used at home as a huge personal address space, just lik= e > a /64 IPv6 prefix. All addresses added without masks and everything wor= ks. > > M> That said, my main objective was to deprecate usage without a mask, = and > M> to warn in that case. Both the kernel and ifconfig now warn when a = default > M> mask is used. In the discussion on freebsd-net and in the review, t= he > M> main thought was that masks should be required. But it isn't practi= cal to > M> fail and return an error with no mask, at least not without a signif= icant > M> period with warnings, or some systems would stop coming up on the ne= twork. > M> > M> One reviewer was going to comment on the /24 default, but thought it= was > M> better than the previous. I'm open to hearing more opinions. > > Although I don't internally agree that we really need to police people = to > always specify masks, I would make step forward and agree with that. So= , > let's do print loud warning on every attempt to set IP address without = a > mask. But I can not agree that change from class based guess to /24 is = a > right thing to do. A proper deprecation process goes like this: > > Step 1: Print warning, don't change legacy behavior. > <... people adopt ...> > Step 2: Return error. Remove deprecated behavior. > > What we did is that we changed behavior together with warning. The new > behavior is neither the legacy one nor the desired one, where mask is > a must. Look from a user perspective: for class C nothing changed, but > changed for A and B. > > --=20 > Gleb Smirnoff From nobody Wed Nov 10 23:07:40 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2E806185475E; Wed, 10 Nov 2021 23:07:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqL990qQYz3hYl; Wed, 10 Nov 2021 23:07:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED1FF21172; Wed, 10 Nov 2021 23:07:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AAN7eWo023128; Wed, 10 Nov 2021 23:07:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AAN7eHa023127; Wed, 10 Nov 2021 23:07:40 GMT (envelope-from git) Date: Wed, 10 Nov 2021 23:07:40 GMT Message-Id: <202111102307.1AAN7eHa023127@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: f6a2e1100fa0 - main - cxgbe(4): separate sysctls for user-requested and in-use FEC. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f6a2e1100fa09742aa29d8e51fd6181fb5c171bb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=f6a2e1100fa09742aa29d8e51fd6181fb5c171bb commit f6a2e1100fa09742aa29d8e51fd6181fb5c171bb Author: Navdeep Parhar AuthorDate: 2021-11-10 18:54:53 +0000 Commit: Navdeep Parhar CommitDate: 2021-11-10 23:04:37 +0000 cxgbe(4): separate sysctls for user-requested and in-use FEC. Recent firmwares have more leeway in FEC selection and there is a need to track the FECs requested by the driver separately from the FEC in use on the link. The existing dev...fec sysctl can read both but its behavior depends on the link state and it is sometimes hard to find out what was requested when the link is up. Split the fec sysctl into two (requested_fec and link_fec) to get access to both pieces of information regardless of the link state. MFC after: 1 week Sponsored by: Chelsio Communications --- share/man/man4/cxgbe.4 | 8 +++++--- sys/dev/cxgbe/t4_main.c | 52 ++++++++++++++++++++++++++++++++++--------------- 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/share/man/man4/cxgbe.4 b/share/man/man4/cxgbe.4 index f4484b644802..5f959299d2ad 100644 --- a/share/man/man4/cxgbe.4 +++ b/share/man/man4/cxgbe.4 @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 19, 2020 +.Dd November 10, 2021 .Dt CXGBE 4 .Os .Sh NAME @@ -300,8 +300,10 @@ Bit 0 enables RS FEC, bit 1 enables BASE-R FEC (aka Firecode FEC), bit transceiver/cable that is plugged in. These bits can be set together in any combination. This tunable establishes the default FEC settings for all ports. -Settings can be displayed and controlled on a per-port basis via the -dev..X.fec sysctl. +Settings can be controlled on a per-port basis via the +dev..X.requested_fec sysctl. +The FEC in use on the link is available in dev..X.link_fec when +the link is up. .It Va hw.cxgbe.autoneg Link autonegotiation settings. This tunable establishes the default autonegotiation settings for all ports. diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 1c51e4847959..b8e4ff7e9c0f 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -771,7 +771,8 @@ static int sysctl_holdoff_pktc_idx(SYSCTL_HANDLER_ARGS); static int sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS); static int sysctl_qsize_txq(SYSCTL_HANDLER_ARGS); static int sysctl_pause_settings(SYSCTL_HANDLER_ARGS); -static int sysctl_fec(SYSCTL_HANDLER_ARGS); +static int sysctl_link_fec(SYSCTL_HANDLER_ARGS); +static int sysctl_requested_fec(SYSCTL_HANDLER_ARGS); static int sysctl_module_fec(SYSCTL_HANDLER_ARGS); static int sysctl_autoneg(SYSCTL_HANDLER_ARGS); static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS); @@ -7759,9 +7760,12 @@ cxgbe_sysctls(struct port_info *pi) CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, pi, 0, sysctl_pause_settings, "A", "PAUSE settings (bit 0 = rx_pause, 1 = tx_pause, 2 = pause_autoneg)"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "fec", + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "link_fec", + CTLTYPE_STRING | CTLFLAG_MPSAFE, pi, 0, sysctl_link_fec, "A", + "FEC in use on the link"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "requested_fec", CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, pi, 0, - sysctl_fec, "A", + sysctl_requested_fec, "A", "FECs to use (bit 0 = RS, 1 = FC, 2 = none, 5 = auto, 6 = module)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "module_fec", CTLTYPE_STRING | CTLFLAG_MPSAFE, pi, 0, sysctl_module_fec, "A", @@ -8281,7 +8285,33 @@ sysctl_pause_settings(SYSCTL_HANDLER_ARGS) } static int -sysctl_fec(SYSCTL_HANDLER_ARGS) +sysctl_link_fec(SYSCTL_HANDLER_ARGS) +{ + struct port_info *pi = arg1; + struct link_config *lc = &pi->link_cfg; + int rc; + 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); + if (lc->link_ok) + sbuf_printf(sb, "%b", lc->fec, bits); + else + sbuf_printf(sb, "no link"); + rc = sbuf_finish(sb); + sbuf_delete(sb); + + return (rc); +} + +static int +sysctl_requested_fec(SYSCTL_HANDLER_ARGS) { struct port_info *pi = arg1; struct adapter *sc = pi->adapter; @@ -8302,17 +8332,7 @@ sysctl_fec(SYSCTL_HANDLER_ARGS) if (sb == NULL) return (ENOMEM); - /* - * Display the requested_fec when the link is down -- the actual - * FEC makes sense only when the link is up. - */ - if (lc->link_ok) { - sbuf_printf(sb, "%b", (lc->fec & M_FW_PORT_CAP32_FEC) | - (lc->requested_fec & (FEC_AUTO | FEC_MODULE)), - bits); - } else { - sbuf_printf(sb, "%b", lc->requested_fec, bits); - } + sbuf_printf(sb, "%b", lc->requested_fec, bits); rc = sbuf_finish(sb); sbuf_delete(sb); } else { @@ -8334,7 +8354,7 @@ sysctl_fec(SYSCTL_HANDLER_ARGS) return (EINVAL);/* some other bit is set too */ rc = begin_synchronized_op(sc, &pi->vi[0], SLEEP_OK | INTR_OK, - "t4fec"); + "t4reqf"); if (rc) return (rc); PORT_LOCK(pi); From nobody Wed Nov 10 23:23:04 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 372E0183AF7D; Wed, 10 Nov 2021 23:23:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqLVx14P4z3mJB; Wed, 10 Nov 2021 23:23:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04D9B213CF; Wed, 10 Nov 2021 23:23:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AANN4xX049499; Wed, 10 Nov 2021 23:23:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AANN4L2049498; Wed, 10 Nov 2021 23:23:04 GMT (envelope-from git) Date: Wed, 10 Nov 2021 23:23:04 GMT Message-Id: <202111102323.1AANN4L2049498@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 448bcd01dc5e - main - cxgbe(4): internal knob for flexible control over FEC selection. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 448bcd01dc5edcbbf23975588f131e13cd09778f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=448bcd01dc5edcbbf23975588f131e13cd09778f commit 448bcd01dc5edcbbf23975588f131e13cd09778f Author: Navdeep Parhar AuthorDate: 2021-11-10 19:38:54 +0000 Commit: Navdeep Parhar CommitDate: 2021-11-10 23:16:53 +0000 cxgbe(4): internal knob for flexible control over FEC selection. Recent firmwares have support for autonomous FEC selection and a "force" knob to let the driver control this behavior (or not) in a fine grained manner. This change adds a driver knob so that all the different ways of configuring the link FEC can be exercised. Note that this controls the internal driver/firmware interaction for link configuration and is not meant for general use. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/common/common.h | 2 ++ sys/dev/cxgbe/common/t4_hw.c | 30 +++++++++++++++++----- sys/dev/cxgbe/t4_main.c | 60 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 7 deletions(-) diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h index 50859e868b9d..bee4f58f693c 100644 --- a/sys/dev/cxgbe/common/common.h +++ b/sys/dev/cxgbe/common/common.h @@ -443,9 +443,11 @@ struct link_config { int8_t requested_aneg; /* link autonegotiation */ int8_t requested_fc; /* flow control */ int8_t requested_fec; /* FEC */ + int8_t force_fec; /* FORCE_FEC in L1_CFG32 command. */ u_int requested_speed; /* speed (Mbps) */ uint32_t requested_caps;/* rcap in last l1cfg issued by the driver. */ + /* These are populated with information from the firmware. */ uint32_t pcaps; /* link capabilities */ uint32_t acaps; /* advertised capabilities */ uint32_t lpacaps; /* peer advertised capabilities */ diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index b9bf5df5ccc6..d6f85a1fcd34 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -3917,9 +3917,19 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int mbox, unsigned int port, speed = fwcap_top_speed(lc->pcaps); fec = 0; +#ifdef INVARIANTS + if (lc->force_fec != 0) + MPASS(lc->pcaps & FW_PORT_CAP32_FORCE_FEC); +#endif if (fec_supported(speed)) { if (lc->requested_fec == FEC_AUTO) { - if (lc->pcaps & FW_PORT_CAP32_FORCE_FEC) { + if (lc->force_fec > 0) { + /* + * Must use FORCE_FEC even though requested FEC + * is AUTO. Set all the FEC bits valid for the + * speed and let the firmware pick one. + */ + fec |= FW_PORT_CAP32_FORCE_FEC; if (speed & FW_PORT_CAP32_SPEED_100G) { fec |= FW_PORT_CAP32_FEC_RS; fec |= FW_PORT_CAP32_FEC_NO_FEC; @@ -3929,20 +3939,26 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int mbox, unsigned int port, fec |= FW_PORT_CAP32_FEC_NO_FEC; } } else { - /* Set only 1b with old firmwares. */ + /* + * Set only 1b. Old firmwares can't deal with + * multiple bits and new firmwares are free to + * ignore this and try whatever FECs they want + * because we aren't setting FORCE_FEC here. + */ fec |= fec_to_fwcap(lc->fec_hint); } } else { + /* + * User has explicitly requested some FEC(s). Set + * FORCE_FEC unless prohibited from using it. + */ + if (lc->force_fec != 0) + fec |= FW_PORT_CAP32_FORCE_FEC; fec |= fec_to_fwcap(lc->requested_fec & M_FW_PORT_CAP32_FEC); if (lc->requested_fec & FEC_MODULE) fec |= fec_to_fwcap(lc->fec_hint); } - - if (lc->pcaps & FW_PORT_CAP32_FORCE_FEC) - fec |= FW_PORT_CAP32_FORCE_FEC; - else if (fec == FW_PORT_CAP32_FEC_NO_FEC) - fec = 0; } /* Force AN on for BT cards. */ diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index b8e4ff7e9c0f..44a9a1343016 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -517,6 +517,21 @@ static int t4_fec = -1; SYSCTL_INT(_hw_cxgbe, OID_AUTO, fec, CTLFLAG_RDTUN, &t4_fec, 0, "Forward Error Correction (bit 0 = RS, bit 1 = BASER_RS)"); +/* + * Controls when the driver sets the FORCE_FEC bit in the L1_CFG32 that it + * issues to the firmware. If the firmware doesn't support FORCE_FEC then the + * driver runs as if this is set to 0. + * -1 to set FORCE_FEC iff requested_fec != AUTO. Multiple FEC bits are okay. + * 0 to never set FORCE_FEC. requested_fec = AUTO means use the hint from the + * transceiver. Multiple FEC bits may not be okay but will be passed on to + * the firmware anyway (may result in l1cfg errors with old firmwares). + * 1 to always set FORCE_FEC. Multiple FEC bits are okay. requested_fec = AUTO + * means set all FEC bits that are valid for the speed. + */ +static int t4_force_fec = -1; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, force_fec, CTLFLAG_RDTUN, &t4_force_fec, 0, + "Controls the use of FORCE_FEC bit in L1 configuration."); + /* * Link autonegotiation. * -1 to run with the firmware default. @@ -775,6 +790,7 @@ static int sysctl_link_fec(SYSCTL_HANDLER_ARGS); static int sysctl_requested_fec(SYSCTL_HANDLER_ARGS); static int sysctl_module_fec(SYSCTL_HANDLER_ARGS); static int sysctl_autoneg(SYSCTL_HANDLER_ARGS); +static int sysctl_force_fec(SYSCTL_HANDLER_ARGS); static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS); static int sysctl_temperature(SYSCTL_HANDLER_ARGS); static int sysctl_vdd(SYSCTL_HANDLER_ARGS); @@ -5703,6 +5719,7 @@ init_link_config(struct port_info *pi) struct link_config *lc = &pi->link_cfg; PORT_LOCK_ASSERT_OWNED(pi); + MPASS(lc->pcaps != 0); lc->requested_caps = 0; lc->requested_speed = 0; @@ -5728,6 +5745,13 @@ init_link_config(struct port_info *pi) if (lc->requested_fec == 0) lc->requested_fec = FEC_AUTO; } + lc->force_fec = 0; + if (lc->pcaps & FW_PORT_CAP32_FORCE_FEC) { + if (t4_force_fec < 0) + lc->force_fec = -1; + else if (t4_force_fec > 0) + lc->force_fec = 1; + } } /* @@ -7774,6 +7798,9 @@ cxgbe_sysctls(struct port_info *pi) CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, pi, 0, sysctl_autoneg, "I", "autonegotiation (-1 = not supported)"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "force_fec", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, pi, 0, + sysctl_force_fec, "I", "when to use FORCE_FEC bit for link config"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rcaps", CTLFLAG_RD, &pi->link_cfg.requested_caps, 0, "L1 config requested by driver"); @@ -8492,6 +8519,39 @@ done: return (rc); } +static int +sysctl_force_fec(SYSCTL_HANDLER_ARGS) +{ + struct port_info *pi = arg1; + struct adapter *sc = pi->adapter; + struct link_config *lc = &pi->link_cfg; + int rc, val; + + val = lc->force_fec; + MPASS(val >= -1 && val <= 1); + rc = sysctl_handle_int(oidp, &val, 0, req); + if (rc != 0 || req->newptr == NULL) + return (rc); + if (!(lc->pcaps & FW_PORT_CAP32_FORCE_FEC)) + return (ENOTSUP); + if (val < -1 || val > 1) + return (EINVAL); + + rc = begin_synchronized_op(sc, &pi->vi[0], SLEEP_OK | INTR_OK, "t4ff"); + if (rc) + return (rc); + PORT_LOCK(pi); + lc->force_fec = val; + if (!hw_off_limits(sc)) { + fixup_link_config(pi); + if (pi->up_vis > 0) + rc = apply_link_config(pi); + } + PORT_UNLOCK(pi); + end_synchronized_op(sc, 0); + return (rc); +} + static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS) { From nobody Thu Nov 11 01:13:40 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5F13E1854C93; Thu, 11 Nov 2021 01:14:05 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqNz04wwRz4qPr; Thu, 11 Nov 2021 01:14:04 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f50.google.com with SMTP id v23so4989814iom.12; Wed, 10 Nov 2021 17:14:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=MEKRTKOBcNLyu9jcktvRW+fdL0IxSSz06Nd+x1Rg0uU=; b=WDZu9ZExOigAPVGxEQybRQM9SRRjN/7D/VIihH4HpDjQE7Lwxw9Jj4yFsl0kKBqd7c WlBFWlHmCmVz3Da8vNPPvXip+kA1pUnqsIwmrZe/t9i3iZmgOCQJBTz03QO3WzT6sasp OngMgu0qfp6Pf+zMrXpI8SocLTjYLmTzDbLL/8TeDZAHxxqzNZ3l3pWYbiuyuQBdmJSQ J4hy9ebne4XwTvtsAW/zzKEaqAxkATM836iZUoK2CfZEAUd9NzXDO/4b/mrNCEn1kcZe vrwBj+t8Kz9Wi5II2surzQbA4enQAoqUriEdB8PcPP5HfXCH0vUviwdNcLFhX6BX0bEi BlHw== X-Gm-Message-State: AOAM530sFrQKybcyclql+3JAvHMS/gHJuFpPKhnDx4S/eT342jihbg5x 3WFHCx3TnPhTPXmZ9tAC2rX+rlluwB7eYElxztXbQvzgrKk= X-Google-Smtp-Source: ABdhPJz/xOWKsY/P4P/36O2C8Chtd/OzAzxZv15knw0tuen3cF1zG3bFMlWy2W4v7NdAcdJZV5CfjPrBvWhNlrTso7s= X-Received: by 2002:a05:6602:2d81:: with SMTP id k1mr2364294iow.112.1636593237978; Wed, 10 Nov 2021 17:13:57 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202106300806.15U86pGq037942@gitrepo.freebsd.org> In-Reply-To: <202106300806.15U86pGq037942@gitrepo.freebsd.org> From: Ed Maste Date: Wed, 10 Nov 2021 20:13:40 -0500 Message-ID: Subject: Re: git: 0a0f7486413c - main - man: Build manpages for all architectures To: =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4HqNz04wwRz4qPr X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.50 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-0.39 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.39)[-0.394]; FREEFALL_USER(0.00)[carpeddiem]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_SPAM_LONG(1.00)[1.000]; RCVD_IN_DNSWL_NONE(0.00)[209.85.166.50:from]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.166.50:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N On Wed, 30 Jun 2021 at 04:06, Fernando Apestegu=C3=ADa wrote: > > The branch main has been updated by fernape (doc, ports committer): > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D0a0f7486413c147d56808b3805= 5c40c64cff61f5 > > commit 0a0f7486413c147d56808b38055c40c64cff61f5 > Author: Fernando Apestegu=C3=ADa > AuthorDate: 2021-06-09 10:58:04 +0000 > Commit: Fernando Apestegu=C3=ADa > CommitDate: 2021-06-30 07:57:51 +0000 > > man: Build manpages for all architectures ... > +# Link files to the parent directory > +.for _manpage in ${MAN} > +MLINKS+=3D${_manpage} ../${_manpage} > +.endfor It looks like this breaks -DNO_ROOT image building, because the METALOG ends up with ".." entries and makefs(8) cannot tolerate those: $ make $make_args -DNO_ROOT DESTDIR=3D$stagedir installworld installkernel distribution $ cd $stagedir $ makefs -D -B little -o label=3DFreeBSD_root -o version=3D2 ufs.part METAL= OG ... METALOG:22728: error: absolute path cannot contain .. component ... and the line in question is: ./usr/share/man/man4/aarch64/../armv8crypto.4.gz type=3Dfile uname=3Droot gname=3Dwheel mode=3D0444 size=3D1377 tags=3Dpackage=3Dutilities I haven't yet thought about how this could be addressed. From nobody Thu Nov 11 01:24:48 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 746351859534; Thu, 11 Nov 2021 01:25:13 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqPCr3qY9z4tgQ; Thu, 11 Nov 2021 01:25:12 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f52.google.com with SMTP id v23so5017387iom.12; Wed, 10 Nov 2021 17:25:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=GokSvdH80xCrMm6LaPj47dGCrNeLMZEAJOrDSejL09g=; b=XQSj0hpLfDw98WArnpgXriu2zaD2pHWs5EHSujTBnCogWbbY7FWtQVHiiJ0ixYJ2ey LpQ5yrGMovBB69N6bK+2xcu5oDzvA5CpiNq0RSUV+LofT6rOq/SB4USPagN9DmXdpwqI XPJaqqTvnG/4VOrqwwI4tA5PrXwvwmMhT16szRQ6eIlPJ/pbyx6wT+0jFWfvHP10H/Ax FAya5z6um3Lx3MHKiK2JlU3p8qWuwUGLOgMNdxctUDVMrv4bnUHBpoGB90diHukCugKI /1wpV4X9amuUI/ldaoBYckgFwa0MUT+Ef5vX6PqhPBeFbMbECp9pYHF37FFJc8+t8msy Dzaw== X-Gm-Message-State: AOAM531WhxDTSy7H10eST1P5JgUhEv9kVaxHO4XJ3Zym2LS/muZcOUdT Bf5iPFVruS9EbRIivSq0rlwGFTG0J7h38e3j+XtpW7v/SGA= X-Google-Smtp-Source: ABdhPJxIRvSJZZ89S4wa0fFWS4Bg352meXYjcbzBVPmmQnP6Gj1cpsM2bqdxIOPZ1AhuzGpuWvdwhlC+WoiIlTtUaZ8= X-Received: by 2002:a6b:6815:: with SMTP id d21mr1647108ioc.206.1636593906132; Wed, 10 Nov 2021 17:25:06 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202106300806.15U86pGq037942@gitrepo.freebsd.org> In-Reply-To: From: Ed Maste Date: Wed, 10 Nov 2021 20:24:48 -0500 Message-ID: Subject: Re: git: 0a0f7486413c - main - man: Build manpages for all architectures To: =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4HqPCr3qY9z4tgQ X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.52 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [1.38 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.62)[-0.623]; FREEFALL_USER(0.00)[carpeddiem]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; NEURAL_SPAM_SHORT(1.00)[1.000]; NEURAL_SPAM_LONG(1.00)[1.000]; RCVD_IN_DNSWL_NONE(0.00)[209.85.166.52:from]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.166.52:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N On Wed, 10 Nov 2021 at 20:13, Ed Maste wrote: > > On Wed, 30 Jun 2021 at 04:06, Fernando Apestegu=C3=ADa wrote: > > > > The branch main has been updated by fernape (doc, ports committer): > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D0a0f7486413c147d56808b38= 055c40c64cff61f5 > > > > commit 0a0f7486413c147d56808b38055c40c64cff61f5 > > Author: Fernando Apestegu=C3=ADa > > AuthorDate: 2021-06-09 10:58:04 +0000 > > Commit: Fernando Apestegu=C3=ADa > > CommitDate: 2021-06-30 07:57:51 +0000 > > > > man: Build manpages for all architectures > ... > > +# Link files to the parent directory > > +.for _manpage in ${MAN} > > +MLINKS+=3D${_manpage} ../${_manpage} > > +.endfor > > It looks like this breaks -DNO_ROOT image building, because the > METALOG ends up with ".." entries and makefs(8) cannot tolerate those: > > $ make $make_args -DNO_ROOT DESTDIR=3D$stagedir installworld > installkernel distribution > $ cd $stagedir > $ makefs -D -B little -o label=3DFreeBSD_root -o version=3D2 ufs.part MET= ALOG > ... > METALOG:22728: error: absolute path cannot contain .. component > ... > > and the line in question is: > ./usr/share/man/man4/aarch64/../armv8crypto.4.gz type=3Dfile uname=3Droot > gname=3Dwheel mode=3D0444 size=3D1377 tags=3Dpackage=3Dutilities > > I haven't yet thought about how this could be addressed. It seems Baptiste reported this in another reply, but somehow I don't have that message. https://lists.freebsd.org/pipermail/dev-commits-src-main/2021-July/005523.h= tml From nobody Thu Nov 11 06:34:02 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 211AB1857FD6; Thu, 11 Nov 2021 06:34:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqX4B6cSqz4ShJ; Thu, 11 Nov 2021 06:34:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDAD127160; Thu, 11 Nov 2021 06:34:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AB6Y2Ui021495; Thu, 11 Nov 2021 06:34:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AB6Y23v021494; Thu, 11 Nov 2021 06:34:02 GMT (envelope-from git) Date: Thu, 11 Nov 2021 06:34:02 GMT Message-Id: <202111110634.1AB6Y23v021494@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Guangyuan Yang Subject: git: c5e0492ae81e - main - module(9): Document that evhand can be NULL List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ygy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c5e0492ae81e4b0d7946ccfbedb434a9c4071256 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ygy (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=c5e0492ae81e4b0d7946ccfbedb434a9c4071256 commit c5e0492ae81e4b0d7946ccfbedb434a9c4071256 Author: Felix Johnson AuthorDate: 2021-11-11 06:28:45 +0000 Commit: Guangyuan Yang CommitDate: 2021-11-11 06:32:54 +0000 module(9): Document that evhand can be NULL PR: 192250 MFC after: 3 days Reported by: ngie --- share/man/man9/module.9 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/share/man/man9/module.9 b/share/man/man9/module.9 index 2ba7b3d6c621..5bd9a13c6925 100644 --- a/share/man/man9/module.9 +++ b/share/man/man9/module.9 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 12, 2018 +.Dd November 11, 2021 .Dt MODULE 9 .Os .Sh NAME @@ -42,6 +42,9 @@ The structure contains the name of the device, a unique ID number, a pointer to an event handler function and to an argument, which is given to the event handler, as well as some kernel internal data. +If the event handler function is +.Dv NULL , +the module will use a no-operation function handler instead. .Pp The .Xr DECLARE_MODULE 9 From nobody Thu Nov 11 06:47:30 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E67B21841105; Thu, 11 Nov 2021 06:48:46 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqXPB560Mz4Yrc; Thu, 11 Nov 2021 06:48:46 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: by mail-qv1-f46.google.com with SMTP id m17so3468782qvx.8; Wed, 10 Nov 2021 22:48:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=YGpblC3SjXu7rkDaMCorgxnRWYms/xLwcW93KhM0VoY=; b=V6OzzoV9o1oo2aWxsftDRUNlZaNnBNBBq2POGNtUuSLtTY7iUZ9ry6HOSWd7XAy1OL nIYrhPNjD2PCCQK+I4wzhieDhiEECmNbzQLP5DS/hcUI5rdROcgEwTbZbiw7etuhiChq tS18Snd7yNcieB8FxCyxTRl3HUOPZ4p8HJ5RT//e4L5ovf8Cf/k5uSVjKmgThVT6OTal 4uJfNhJBmqkxHrzdzLG2lpytlDbPv7Yfs3UUu8h5C0PWf6Konq0Jm56Au65lWfPWPMl0 g1+tFBc+OYrFnLUfqCqi1gZq1QOZdEMtp8H6cdgMiQG74THRbB9eC9UsZ4zwd0+uYNWr uATA== X-Gm-Message-State: AOAM533HecfFEUBud/6vwp4deIwfGniYeRUNBxS9AC9/Mzn9FKrOrhwY NEMDmuCIGl+DDNxxoIjMTP/tOGZhiKI= X-Google-Smtp-Source: ABdhPJxmlxSBN9/n6VLoJLOrAANpMZerPmQ0KS4kLlz7jHAacbHGx79uZCiVTFgQHzkHzSJNJNhYHg== X-Received: by 2002:a05:6214:c42:: with SMTP id r2mr4631604qvj.53.1636613320092; Wed, 10 Nov 2021 22:48:40 -0800 (PST) Received: from mail-yb1-f170.google.com (mail-yb1-f170.google.com. [209.85.219.170]) by smtp.gmail.com with ESMTPSA id l21sm932176qkk.1.2021.11.10.22.48.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Nov 2021 22:48:39 -0800 (PST) Received: by mail-yb1-f170.google.com with SMTP id j75so12662216ybj.6; Wed, 10 Nov 2021 22:48:39 -0800 (PST) X-Received: by 2002:a25:ae07:: with SMTP id a7mr5841265ybj.364.1636613319441; Wed, 10 Nov 2021 22:48:39 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202106300806.15U86pGq037942@gitrepo.freebsd.org> In-Reply-To: From: =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= Date: Thu, 11 Nov 2021 07:47:30 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 0a0f7486413c - main - man: Build manpages for all architectures To: Ed Maste Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4HqXPB560Mz4Yrc X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_FROM(0.00)[]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Thu, Nov 11, 2021 at 2:25 AM Ed Maste wrote: > > On Wed, 10 Nov 2021 at 20:13, Ed Maste wrote: > > > > On Wed, 30 Jun 2021 at 04:06, Fernando Apestegu=C3=ADa wrote: > > > > > > The branch main has been updated by fernape (doc, ports committer): > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D0a0f7486413c147d56808b= 38055c40c64cff61f5 > > > > > > commit 0a0f7486413c147d56808b38055c40c64cff61f5 > > > Author: Fernando Apestegu=C3=ADa > > > AuthorDate: 2021-06-09 10:58:04 +0000 > > > Commit: Fernando Apestegu=C3=ADa > > > CommitDate: 2021-06-30 07:57:51 +0000 > > > > > > man: Build manpages for all architectures > > ... > > > +# Link files to the parent directory > > > +.for _manpage in ${MAN} > > > +MLINKS+=3D${_manpage} ../${_manpage} > > > +.endfor > > > > It looks like this breaks -DNO_ROOT image building, because the > > METALOG ends up with ".." entries and makefs(8) cannot tolerate those: > > > > $ make $make_args -DNO_ROOT DESTDIR=3D$stagedir installworld > > installkernel distribution > > $ cd $stagedir > > $ makefs -D -B little -o label=3DFreeBSD_root -o version=3D2 ufs.part M= ETALOG > > ... > > METALOG:22728: error: absolute path cannot contain .. component > > ... > > > > and the line in question is: > > ./usr/share/man/man4/aarch64/../armv8crypto.4.gz type=3Dfile uname=3Dro= ot > > gname=3Dwheel mode=3D0444 size=3D1377 tags=3Dpackage=3Dutilities > > > > I haven't yet thought about how this could be addressed. > > It seems Baptiste reported this in another reply, but somehow I don't > have that message. > https://lists.freebsd.org/pipermail/dev-commits-src-main/2021-July/005523= .html Hi Ed, Yes, Bapt reported this and I briefly talked to him in July. He said the problem was more isolated than he thought initially. I've been looking at this on and off but to no luck. I'll try to have a look again. Unfortunately this will not happen before next monday. Cheers. From nobody Thu Nov 11 07:29:19 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B1B511854D17; Thu, 11 Nov 2021 07:29:28 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqYJ84VBzz4l9f; Thu, 11 Nov 2021 07:29:28 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-lj1-f176.google.com with SMTP id z8so10167862ljz.9; Wed, 10 Nov 2021 23:29:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0506vDKZLr/AEVPhWFeAA8c9/J1Xl58QB2Lu+Q1h7mI=; b=xkv+f5VPpkFxp/oj9CabkAwy6Zn6MxkbkMfOv1pQT5XyJV+lA1zEZKJ54lfhlauM8D noxqfW09Lm1YiUttg3ctO3u8qaxgSfqU+NVeK8+lzsGFhVryTDxO2+QUjCWPIT0z61EI U3UTUd5sNjVeFA+VRolS5IYi0fYaZ6gbe/OF/2DIj5q3f7QGmiGUoW8lu8D+sDvKdnUj NEQXtTZBJiicszHG4qqzZI23G3Rkf613c1pvHF6b0tvKWzKhA97KCP7TkC6nCOJGXB0L A5fIjuDRJV8HEPoANm7XJJxS4sd1+KsOoTIyrxOXx0cfRPhELtpsiVB3VPTkNs2i5B20 B/wA== X-Gm-Message-State: AOAM5312uKWRuEqtBx8F1P9WmD6C3Z0aPfQJidxi/RqUtMOSc3noxsgx SxOMy43Ih9XkebQmd3PPHItiJNe/O2G0oYaFcJuvxLdCZuk= X-Google-Smtp-Source: ABdhPJzmseeXVNQD/Q4fDhwByKpIQFpfOY9iE9oXssfRtIL/TX7hb+z6fG8g+U+YJo9IO4+QJsD2YDzqJm/Q1w0dd7A= X-Received: by 2002:a2e:8807:: with SMTP id x7mr4981912ljh.490.1636615767116; Wed, 10 Nov 2021 23:29:27 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202111101934.1AAJYJFQ041545@gitrepo.freebsd.org> In-Reply-To: <202111101934.1AAJYJFQ041545@gitrepo.freebsd.org> From: Antoine Brodin Date: Thu, 11 Nov 2021 07:29:19 +0000 Message-ID: Subject: Re: git: 160b4b922b60 - main - Add real sched.h To: Konstantin Belousov Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4HqYJ84VBzz4l9f X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On Wed, Nov 10, 2021 at 7:34 PM Konstantin Belousov wrote: > > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=160b4b922b6021848b6b48afc894d16b879b7af2 > > commit 160b4b922b6021848b6b48afc894d16b879b7af2 > Author: Konstantin Belousov > AuthorDate: 2021-10-22 15:17:21 +0000 > Commit: Konstantin Belousov > CommitDate: 2021-11-10 19:18:53 +0000 > > Add real sched.h > > It is required by IEEE Std 1003.1-2008 AKA POSIX. > > Put some Linux compatibility stuff under BSD_VISIBLE namespace, in > particular, sys/cpuset.h definitions. Also, if user really want > Linux compatibility, she can request cpu_set_t typedef with > _WITH_CPU_SET_T define. > > Reviewed by: jhb > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D32901 > --- > include/Makefile | 5 +++-- > include/sched.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 49 insertions(+), 2 deletions(-) Hi, It seems that this broke some ports: http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/ninja-1.10.2,2.log http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/ghc-8.10.7.log http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/openpgm-5.2.122_6.log http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/guile2-2.2.7_1.log http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/liburcu-0.12.1.log http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/guile-3.0.7.log http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/squid-4.15.log ... Antoine From nobody Thu Nov 11 08:06:34 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9E41D183DEEF; Thu, 11 Nov 2021 08:06:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqZ762t4Dz3CFr; Thu, 11 Nov 2021 08:06:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 1AB86Y7v096170 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 11 Nov 2021 10:06:37 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 1AB86Y7v096170 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 1AB86YlE096169; Thu, 11 Nov 2021 10:06:34 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 11 Nov 2021 10:06:34 +0200 From: Konstantin Belousov To: Antoine Brodin Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 160b4b922b60 - main - Add real sched.h Message-ID: References: <202111101934.1AAJYJFQ041545@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4HqZ762t4Dz3CFr X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Thu, Nov 11, 2021 at 07:29:19AM +0000, Antoine Brodin wrote: > On Wed, Nov 10, 2021 at 7:34 PM Konstantin Belousov wrote: > > > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=160b4b922b6021848b6b48afc894d16b879b7af2 > > > > commit 160b4b922b6021848b6b48afc894d16b879b7af2 > > Author: Konstantin Belousov > > AuthorDate: 2021-10-22 15:17:21 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2021-11-10 19:18:53 +0000 > > > > Add real sched.h > > > > It is required by IEEE Std 1003.1-2008 AKA POSIX. > > > > Put some Linux compatibility stuff under BSD_VISIBLE namespace, in > > particular, sys/cpuset.h definitions. Also, if user really want > > Linux compatibility, she can request cpu_set_t typedef with > > _WITH_CPU_SET_T define. > > > > Reviewed by: jhb > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > > Differential revision: https://reviews.freebsd.org/D32901 > > --- > > include/Makefile | 5 +++-- > > include/sched.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ > > 2 files changed, 49 insertions(+), 2 deletions(-) > > Hi, > > It seems that this broke some ports: > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/ninja-1.10.2,2.log > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/ghc-8.10.7.log > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/openpgm-5.2.122_6.log > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/guile2-2.2.7_1.log > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/liburcu-0.12.1.log > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/guile-3.0.7.log > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/squid-4.15.log > ... Could you please try this? My intent was that cpu_set_t would be requested as needed by consumers with _WITH_CPU_SET_T. commit b6bb08f09dc7cf2796c35015f5aee93dedf33018 Author: Konstantin Belousov Date: Thu Nov 11 10:01:54 2021 +0200 sched.h: Make cpu_set_t compat typedef visible unconditionally or rather, visible if BSD namespace is enabled, instead of requiring _WITH_CPU_SET_T define to expose it. It seems a lot of code assumes that presence of sched_getaffinity() implies existence of cpu_set_t. Reported by: portmgr (antoine) Sponsored by: The FreeBSD Foundation MFC after: 1 week diff --git a/include/sched.h b/include/sched.h index 1c41cda79046..2d4f301c9718 100644 --- a/include/sched.h +++ b/include/sched.h @@ -34,13 +34,8 @@ #include #if __BSD_VISIBLE #include -#endif /* __BSD_VISIBLE */ - -#if __BSD_VISIBLE -#ifdef _WITH_CPU_SET_T struct _cpuset; typedef struct _cpuset cpu_set_t; -#endif /* _WITH_CPU_SET_T */ #endif /* __BSD_VISIBLE */ __BEGIN_DECLS From nobody Thu Nov 11 09:12:57 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CBE7B183F99D; Thu, 11 Nov 2021 09:12:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqbbY5Rfcz3mJk; Thu, 11 Nov 2021 09:12:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B4261059; Thu, 11 Nov 2021 09:12:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AB9CveB033730; Thu, 11 Nov 2021 09:12:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AB9CvjG033729; Thu, 11 Nov 2021 09:12:57 GMT (envelope-from git) Date: Thu, 11 Nov 2021 09:12:57 GMT Message-Id: <202111110912.1AB9CvjG033729@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: 7e3c4b09a09e - main - stress2: Added two test scenarios for future gunion(8) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 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: 7e3c4b09a09ee7317d215f81c2a95eb0acbf8fde Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=7e3c4b09a09ee7317d215f81c2a95eb0acbf8fde commit 7e3c4b09a09ee7317d215f81c2a95eb0acbf8fde Author: Peter Holm AuthorDate: 2021-11-11 09:11:49 +0000 Commit: Peter Holm CommitDate: 2021-11-11 09:11:49 +0000 stress2: Added two test scenarios for future gunion(8) --- tools/test/stress2/misc/gunion.sh | 83 +++++++++++++++++++++++++++++ tools/test/stress2/misc/gunion2.sh | 106 +++++++++++++++++++++++++++++++++++++ 2 files changed, 189 insertions(+) diff --git a/tools/test/stress2/misc/gunion.sh b/tools/test/stress2/misc/gunion.sh new file mode 100755 index 000000000000..6ba60de3f988 --- /dev/null +++ b/tools/test/stress2/misc/gunion.sh @@ -0,0 +1,83 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Peter Holm +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +# geom union test + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +. ../default.cfg + +kldstat -v | grep -q geom_union.ko || + { kldload geom_union.ko 2>/dev/null || exit 0; loaded=1; } +log=/tmp/gunion.sh.log +md1=$mdstart +md2=$((mdstart + 1)) +mp1=$mntpoint$md1 +mp2=$mntpoint$md2 +s=0 + +set -e +mdconfig -a -t swap -s 5g -u $md1 +newfs $newfs_flags -n /dev/md$md1 +mkdir -p $mp1 $mp2 +mount /dev/md$md1 $mp1 +cp -r ../../stress2 $mp1 +umount $mp1 + +mdconfig -a -t swap -s 5g -u $md2 +gunion create -v /dev/md$md2 /dev/md$md1 +mount /dev/md$md2-md$md1.union $mntpoint + +export RUNDIR=$mntpoint/stressX +export runRUNTIME=5m +export RUNTIME=2m +export CTRLDIR=$mntpoint/stressX.control + +set +e +chmod 777 $mntpoint +su $testuser -c \ + "(cd $mntpoint/stress2; ./run.sh marcus.cfg)" + +for i in `jot 6`; do + mount | grep -q "on $mntpoint " || break + umount $mntpoint && break || sleep 10 + [ $i -eq 6 ] && + { echo FATAL; fstat -mf $mntpoint; exit 1; } +done +fsck_ffs -fyR /dev/md$md2-md$md1.union > $log 2>&1 +grep -Eq "IS CLEAN|MARKED CLEAN" $log || { s=2; cat $log; } +set +e +gunion commit /dev/md$md2-md$md1.union +gunion destroy /dev/md$md2-md$md1.union +fsck_ffs -fyR /dev/md$md1 > $log 2>&1 +grep -Eq "IS CLEAN|MARKED CLEAN" $log || { s=3; cat $log; } +mdconfig -d -u $md2 +mdconfig -d -u $md1 +rm -f $log +[ loaded ] && gunion unload +exit $s diff --git a/tools/test/stress2/misc/gunion2.sh b/tools/test/stress2/misc/gunion2.sh new file mode 100755 index 000000000000..e6a7ab6331cb --- /dev/null +++ b/tools/test/stress2/misc/gunion2.sh @@ -0,0 +1,106 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Peter Holm +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +# geom union test + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +. ../default.cfg + +kldstat -v | grep -q geom_union.ko || + { kldload geom_union.ko 2>/dev/null || exit 0; loaded=1; } +log=/tmp/gunion2.sh.log +md1=$mdstart +md2=$((mdstart + 1)) +mp1=$mntpoint$md1 +mp2=$mntpoint$md2 +s=0 + +set -e +mdconfig -a -t swap -s 5g -u $md1 +newfs $newfs_flags -n /dev/md$md1 > /dev/null +mkdir -p $mp1 $mp2 +mount /dev/md$md1 $mp1 +cp -r ../../stress2 $mp1 +umount $mp1 + +mdconfig -a -t swap -s 5g -u $md2 +gunion create -v /dev/md$md2 /dev/md$md1 +mount /dev/md$md2-md$md1.union $mntpoint + +export CTRLDIR=$mntpoint/stressX.control +export INCARNATIONS=10 +export LOAD=80 +export RUNDIR=$mntpoint/stressX +export runRUNTIME=5m +export rwLOAD=80 +export symlinkLOAD=80 + +export TESTPROGS=" +testcases/lockf2/lockf2 +testcases/symlink/symlink +testcases/openat/openat +testcases/rw/rw +testcases/fts/fts +testcases/link/link +testcases/lockf/lockf +testcases/creat/creat +testcases/mkdir/mkdir +testcases/rename/rename +testcases/mkfifo/mkfifo +testcases/dirnprename/dirnprename +testcases/dirrename/dirrename +testcases/swap/swap +" +export TESTPROGS=`echo $TESTPROGS | sed 's/\n/ /g'` + +set +e +chmod 777 $mntpoint +su $testuser -c \ + "(cd $mntpoint/stress2; ./testcases/run/run $TESTPROGS)" + +n=`find $mntpoint/stressX | wc -l` +[ $n -eq 1 ] && s=0 || s=1 +for i in `jot 6`; do + mount | grep -q "on $mntpoint " || break + umount $mntpoint && break || sleep 10 + [ $i -eq 6 ] && + { echo FATAL; fstat -mf $mntpoint; exit 1; } +done +fsck_ffs -fyR /dev/md$md2-md$md1.union > $log 2>&1 +grep -Eq "IS CLEAN|MARKED CLEAN" $log || { s=2; cat $log; } +set +e +gunion commit /dev/md$md2-md$md1.union +gunion destroy /dev/md$md2-md$md1.union +fsck_ffs -fyR /dev/md$md1 > $log 2>&1 +grep -Eq "IS CLEAN|MARKED CLEAN" $log || { s=3; cat $log; } +mdconfig -d -u $md2 +mdconfig -d -u $md1 +rm -f $log +[ loaded ] && gunion unload +exit $s From nobody Thu Nov 11 09:21:26 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 61BB91843A62; Thu, 11 Nov 2021 09:21:44 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hqbnh29r7z3pKw; Thu, 11 Nov 2021 09:21:44 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-lj1-f175.google.com with SMTP id v15so10803826ljc.0; Thu, 11 Nov 2021 01:21:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Pfkg93p815ziZBG6X7DG+ZIbXWu/no40SevthLYOnKM=; b=65gMYrbAuhCQMK4P1MtZGdbZ6mT90E1Qolwuy/bP2k+chjW07QfJPoyO2OuDgAdTLg WqfrMzvJe18tkpN5y1bipL4Zr0GsBz7ZLYF3id8k0N/Ryov3zWAu8NNJ7Gbh1t6M+SN2 HoToJUF/kOa2CONZVLB9yb0TWM/IL7TgmxRaE3SwEkDZIZMJkNPv+iYRXQOy4q8XsmgG 8XWscm7Y8nVaaPLqFeiTnIPIX4low1Ps1fmZ+gVlPLFz0M96/gAzI120/ylISk7dTLMQ qbuTZpYG0B6X1UcSeqmTKoFB+iewLP/fXl3JHeeLo6Uw4jkaPBuVaymxySVv8DSRKOpK pc7Q== X-Gm-Message-State: AOAM533mEtybWOYnh+/kka2+VdEwrFUoKss4IJlheIHO32BSZBMy9aZ6 BTmbO2K4KRiCvtx/rvEF3gFKySU2UEAnzqKOeJGvQ69KAgA= X-Google-Smtp-Source: ABdhPJx+reJuYkPV5j1izSD3wT/yAPbzsMw59KB/GZ0ljBVXamzXkPLe3qj0DvU9SJgrl3bxaOwbXyzUPow/+0BPPTU= X-Received: by 2002:a2e:9d59:: with SMTP id y25mr5710593ljj.205.1636622496909; Thu, 11 Nov 2021 01:21:36 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202111101934.1AAJYJFQ041545@gitrepo.freebsd.org> In-Reply-To: From: Antoine Brodin Date: Thu, 11 Nov 2021 09:21:26 +0000 Message-ID: Subject: Re: git: 160b4b922b60 - main - Add real sched.h To: Konstantin Belousov Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4Hqbnh29r7z3pKw X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_FROM(0.00)[]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Thu, Nov 11, 2021 at 8:06 AM Konstantin Belousov wrote: > > On Thu, Nov 11, 2021 at 07:29:19AM +0000, Antoine Brodin wrote: > > On Wed, Nov 10, 2021 at 7:34 PM Konstantin Belousov wrote: > > > > > > The branch main has been updated by kib: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=160b4b922b6021848b6b48afc894d16b879b7af2 > > > > > > commit 160b4b922b6021848b6b48afc894d16b879b7af2 > > > Author: Konstantin Belousov > > > AuthorDate: 2021-10-22 15:17:21 +0000 > > > Commit: Konstantin Belousov > > > CommitDate: 2021-11-10 19:18:53 +0000 > > > > > > Add real sched.h > > > > > > It is required by IEEE Std 1003.1-2008 AKA POSIX. > > > > > > Put some Linux compatibility stuff under BSD_VISIBLE namespace, in > > > particular, sys/cpuset.h definitions. Also, if user really want > > > Linux compatibility, she can request cpu_set_t typedef with > > > _WITH_CPU_SET_T define. > > > > > > Reviewed by: jhb > > > Sponsored by: The FreeBSD Foundation > > > MFC after: 1 week > > > Differential revision: https://reviews.freebsd.org/D32901 > > > --- > > > include/Makefile | 5 +++-- > > > include/sched.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ > > > 2 files changed, 49 insertions(+), 2 deletions(-) > > > > Hi, > > > > It seems that this broke some ports: > > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/ninja-1.10.2,2.log > > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/ghc-8.10.7.log > > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/openpgm-5.2.122_6.log > > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/guile2-2.2.7_1.log > > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/liburcu-0.12.1.log > > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/guile-3.0.7.log > > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/squid-4.15.log > > ... > > Could you please try this? My intent was that cpu_set_t would be requested > as needed by consumers with _WITH_CPU_SET_T. Hi, I started bulk at http://gohan04.nyi.freebsd.org/build.html?mastername=main-amd64-sched-default&build=2021-11-11_09h04m08s This fixes at least ninja. Antoine From nobody Thu Nov 11 11:31:17 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A13E81859A60; Thu, 11 Nov 2021 11:31:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hqfg94BHYz3CyB; Thu, 11 Nov 2021 11:31:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F553305F; Thu, 11 Nov 2021 11:31:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ABBVHNi017373; Thu, 11 Nov 2021 11:31:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ABBVH6s017371; Thu, 11 Nov 2021 11:31:17 GMT (envelope-from git) Date: Thu, 11 Nov 2021 11:31:17 GMT Message-Id: <202111111131.1ABBVH6s017371@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Randall Stewart Subject: git: b8d60729deef - main - tcp: Congestion control 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b8d60729deefa0bd13e6a395fcab4928e6e10445 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rrs: URL: https://cgit.FreeBSD.org/src/commit/?id=b8d60729deefa0bd13e6a395fcab4928e6e10445 commit b8d60729deefa0bd13e6a395fcab4928e6e10445 Author: Randall Stewart AuthorDate: 2021-11-11 11:28:18 +0000 Commit: Randall Stewart CommitDate: 2021-11-11 11:28:18 +0000 tcp: Congestion control cleanup. NOTE: HEADS UP read the note below if your kernel config is not including GENERIC!! This patch does a bit of cleanup on TCP congestion control modules. There were some rather interesting surprises that one could get i.e. where you use a socket option to change from one CC (say cc_cubic) to another CC (say cc_vegas) and you could in theory get a memory failure and end up on cc_newreno. This is not what one would expect. The new code fixes this by requiring a cc_data_sz() function so we can malloc with M_WAITOK and pass in to the init function preallocated memory. The CC init is expected in this case *not* to fail but if it does and a module does break the "no fail with memory given" contract we do fall back to the CC that was in place at the time. This also fixes up a set of common newreno utilities that can be shared amongst other CC modules instead of the other CC modules reaching into newreno and executing what they think is a "common and understood" function. Lets put these functions in cc.c and that way we have a common place that is easily findable by future developers or bug fixers. This also allows newreno to evolve and grow support for its features i.e. ABE and HYSTART++ without having to dance through hoops for other CC modules, instead both newreno and the other modules just call into the common functions if they desire that behavior or roll there own if that makes more sense. Note: This commit changes the kernel configuration!! If you are not using GENERIC in some form you must add a CC module option (one of CC_NEWRENO, CC_VEGAS, CC_CUBIC, CC_CDG, CC_CHD, CC_DCTCP, CC_HTCP, CC_HD). You can have more than one defined as well if you desire. Note that if you create a kernel configuration that does not define a congestion control module and includes INET or INET6 the kernel compile will break. Also you need to define a default, generic adds 'options CC_DEFAULT=\"newreno\" but you can specify any string that represents the name of the CC module (same names that show up in the CC module list under net.inet.tcp.cc). If you fail to add the options CC_DEFAULT in your kernel configuration the kernel build will also break. Reviewed by: Michael Tuexen Sponsored by: Netflix Inc. RELNOTES:YES Differential Revision: https://reviews.freebsd.org/D32693 --- UPDATING | 13 ++ share/man/man4/cc_newreno.4 | 52 +++++++ share/man/man4/mod_cc.4 | 50 +++++++ share/man/man9/mod_cc.9 | 75 +++++++++- sys/amd64/conf/GENERIC | 2 + sys/arm/conf/std.armv6 | 2 + sys/arm/conf/std.armv7 | 2 + sys/arm64/conf/std.arm64 | 2 + sys/conf/NOTES | 21 ++- sys/conf/files | 16 +- sys/conf/options | 9 ++ sys/i386/conf/GENERIC | 2 + sys/modules/cc/Makefile | 3 +- sys/modules/cc/cc_newreno/Makefile | 7 + sys/netinet/cc/cc.c | 299 ++++++++++++++++++++++++++++++++----- sys/netinet/cc/cc.h | 34 ++++- sys/netinet/cc/cc_cdg.c | 46 +++--- sys/netinet/cc/cc_chd.c | 41 +++-- sys/netinet/cc/cc_cubic.c | 38 +++-- sys/netinet/cc/cc_dctcp.c | 47 +++--- sys/netinet/cc/cc_hd.c | 24 +-- sys/netinet/cc/cc_htcp.c | 41 +++-- sys/netinet/cc/cc_newreno.c | 141 +++++------------ sys/netinet/cc/cc_vegas.c | 47 +++--- sys/netinet/tcp_subr.c | 79 ++++++---- sys/netinet/tcp_usrreq.c | 151 ++++++++++++++----- sys/powerpc/conf/GENERIC | 2 + sys/riscv/conf/GENERIC | 2 + 28 files changed, 922 insertions(+), 326 deletions(-) diff --git a/UPDATING b/UPDATING index f013826393fb..cde26f7ea030 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,19 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20211110: + Commit xxxxxx changed the TCP congestion control framework so + that any of the included congestion control modules could be + the single module built into the kernel. Previously newreno + was automatically built in through direct reference. Has of + this commit you are required to declare at least one congestion + control module (e.g. 'options CC_NEWRENO') and to also delcare a + default using the CC_DEFAULT option (e.g. options CC_DEFAULT="newreno\"). + The GENERIC configuation includes CC_NEWRENO and defines newreno + as the default. If no congestion control option is built into the + kernel and you are including networking, the kernel compile will + fail. Also if no default is declared the kernel compile will fail. + 20211106: Commit f0c9847a6c47 changed the arguments for VOP_ALLOCATE. The NFS modules must be rebuilt from sources and any out diff --git a/share/man/man4/cc_newreno.4 b/share/man/man4/cc_newreno.4 index 0ac59beeec48..1c4f4a39cb36 100644 --- a/share/man/man4/cc_newreno.4 +++ b/share/man/man4/cc_newreno.4 @@ -75,7 +75,33 @@ the congestion window in response to an ECN congestion signal when .Va net.inet.tcp.cc.abe=1 per: cwnd = (cwnd * CC_NEWRENO_BETA_ECN) / 100. Default is 80. +.It Va CC_NEWRENO_ENABLE_HYSTART +will enable or disable the application of Hystart++. +The current implementation allows the values 0, 1, 2 and 3. +A value of 0 (the default) disables the use of Hystart++. +Setting the value to 1 enables Hystart++. +Setting the value to 2 enables Hystart++ but also will cause, on exit from Hystart++'s CSS, to +set the cwnd to the value of where the increase in RTT first began as +well as setting ssthresh to the flight at send when we exit CSS. +Setting a value of 3 will keep the setting of the cwnd the same as 2, but will cause ssthresh +to be set to the average value between the lowest fas rtt (the value cwnd is +set to) and the fas value at exit of CSS. +.PP +Note that currently the only way to enable +hystart++ is to enable it via socket option. +When enabling it a value of 1 will enable precise internet-draft behavior +(subject to any MIB variable settings), other setting (2 and 3) are experimental. .El +.PP +Note that hystart++ requires the TCP stack be able to call to the congestion +controller with both the +.Va newround +function as well as the +.Va rttsample +function. +Currently the only TCP stacks that provide this feedback to the +congestion controller is rack. +.Pp .Sh MIB Variables The algorithm exposes these variables in the .Va net.inet.tcp.cc.newreno @@ -94,6 +120,32 @@ the congestion window in response to an ECN congestion signal when .Va net.inet.tcp.cc.abe=1 per: cwnd = (cwnd * beta_ecn) / 100. Default is 80. +.It Va hystartplusplus.bblogs +This boolean controls if black box logging will be done for hystart++ events. If set +to zero (the default) no logging is performed. +If set to one then black box logs will be generated on all hystart++ events. +.It Va hystartplusplus.css_rounds +This value controls the number of rounds that CSS runs for. +The default value matches the current internet-draft of 5. +.It Va hystartplusplus.css_growth_div +This value controls the divisor applied to slowstart during CSS. +The default value matches the current internet-draft of 4. +.It Va hystartplusplus.n_rttsamples +This value controls how many rtt samples must be collected in each round for +hystart++ to be active. +The default value matches the current internet-draft of 8. +.It Va hystartplusplus.maxrtt_thresh +This value controls the maximum rtt variance clamp when considering if CSS is needed. +The default value matches the current internet-draft of 16000 (in microseconds). +For further explanation please see the internet-draft. +.It Va hystartplusplus.minrtt_thresh +This value controls the minimum rtt variance clamp when considering if CSS is needed. +The default value matches the current internet-draft of 4000 (in microseconds). +For further explanation please see the internet-draft. +.It Va hystartplusplus.lowcwnd +This value controls what is the lowest congestion window that the tcp +stack must be at before hystart++ engages. +The default value matches the current internet-draft of 16. .El .Sh SEE ALSO .Xr cc_cdg 4 , diff --git a/share/man/man4/mod_cc.4 b/share/man/man4/mod_cc.4 index 273d898cf5e2..84edf0b2a8ed 100644 --- a/share/man/man4/mod_cc.4 +++ b/share/man/man4/mod_cc.4 @@ -67,6 +67,16 @@ socket option (see for details). Callers must pass a pointer to an algorithm specific data, and specify its size. +.Pp +Unloading a congestion control module will fail if it is used as a +default by any Vnet. +When unloading a module, the Vnet default is +used to switch a connection to an alternate congestion control. +Note that the new congestion control module may fail to initialize its +internal memory, if so it will fail the module unload. +If this occurs often times retrying the unload will succeed since the temporary +memory shortage as the new CC module malloc's memory, that prevented the +switch is often transient. .Sh MIB Variables The framework exposes the following variables in the .Va net.inet.tcp.cc @@ -93,6 +103,44 @@ support for ABE and for configuration details. If non-zero, apply standard beta instead of ABE-beta during ECN-signalled congestion recovery episodes if loss also needs to be repaired. .El +.Pp +Each congestion control module may also expose other MIB variables +to control their behaviour. +.Sh Kernel Configuration +.Pp +All of the available congestion control modules may also be loaded +via kernel configutation options. +A kernel configuration is required to have at least one congestion control +algorithm built into it via kernel option and a system default specified. +Compilation of the kernel will fail if these two conditions are not met. +.Sh Kernel Configuration Options +The framework exposes the following kernel configuration options. +.Bl -tag -width ".Va CC_NEWRENO" +.It Va CC_NEWRENO +This directive loads the newreno congestion control algorithm and is included +in GENERIC by default. +.It Va CC_CUBIC +This directive loads the cubic congestion control algorithm. +.It Va CC_VEGAS +This directive loads the vegas congestion control algorithm, note that +this algorithm also requires the TCP_HHOOK option as well. +.It Va CC_CDG +This directive loads the cdg congestion control algorithm, note that +this algorithm also requires the TCP_HHOOK option as well. +.It Va CC_DCTCP +This directive loads the dctcp congestion control algorithm. +.It Va CC_HD +This directive loads the hd congestion control algorithm, note that +this algorithm also requires the TCP_HHOOK option as well. +.It Va CC_CHD +This directive loads the chd congestion control algorithm, note that +this algorithm also requires the TCP_HHOOK option as well. +.It Va CC_HTCP +This directive loads the htcp congestion control algorithm. +.It Va CC_DEFAULT +This directive specifies the string that represents the name of the system default algorithm, the GENERIC kernel +defaults this to newreno. +.El .Sh SEE ALSO .Xr cc_cdg 4 , .Xr cc_chd 4 , @@ -103,6 +151,8 @@ congestion recovery episodes if loss also needs to be repaired. .Xr cc_newreno 4 , .Xr cc_vegas 4 , .Xr tcp 4 , +.Xr config 5 , +.Xr config 8 , .Xr mod_cc 9 .Sh ACKNOWLEDGEMENTS Development and testing of this software were made possible in part by grants diff --git a/share/man/man9/mod_cc.9 b/share/man/man9/mod_cc.9 index 8be6fb2381bd..6bfb1eceed56 100644 --- a/share/man/man9/mod_cc.9 +++ b/share/man/man9/mod_cc.9 @@ -68,7 +68,8 @@ struct cc_algo { char name[TCP_CA_NAME_MAX]; int (*mod_init) (void); int (*mod_destroy) (void); - int (*cb_init) (struct cc_var *ccv); + size_t (*cc_data_sz)(void); + int (*cb_init) (struct cc_var *ccv, void *ptr); void (*cb_destroy) (struct cc_var *ccv); void (*conn_init) (struct cc_var *ccv); void (*ack_received) (struct cc_var *ccv, uint16_t type); @@ -76,6 +77,8 @@ struct cc_algo { void (*post_recovery) (struct cc_var *ccv); void (*after_idle) (struct cc_var *ccv); int (*ctl_output)(struct cc_var *, struct sockopt *, void *); + void (*rttsample)(struct cc_var *, uint32_t, uint32_t, uint32_t); + void (*newround)(struct cc_var *, uint32_t); }; .Ed .Pp @@ -104,6 +107,17 @@ being removed from the kernel. The return value is currently ignored. .Pp The +.Va cc_data_sz +function is called by the socket option code to get the size of +data that the +.Va cb_init +function needs. +The socket option code then preallocates the modules memory so that the +.Va cb_init +function will not fail (the socket option code uses M_WAITOK with +no locks held to do this). +.Pp +The .Va cb_init function is called when a TCP control block .Vt struct tcpcb @@ -114,6 +128,9 @@ Returning a non-zero value from .Va cb_init will cause the connection set up to be aborted, terminating the connection as a result. +Note that the ptr argument passed to the function should be checked to +see if it is non-NULL, if so it is preallocated memory that the cb_init function +must use instead of calling malloc itself. .Pp The .Va cb_destroy @@ -182,6 +199,30 @@ pointer forwarded unmodified from the TCP control, and a pointer to algorithm specific argument. .Pp The +.Va rttsample +function is called to pass round trip time information to the +congestion controller. +The additional arguments to the function include the microsecond RTT +that is being noted, the number of times that the data being +acknowledged was retransmitted as well as the flightsize at send. +For transports that do not track flightsize at send, this variable +will be the current cwnd at the time of the call. +.Pp +The +.Va newround +function is called each time a new round trip time begins. +The montonically increasing round number is also passed to the +congestion controller as well. +This can be used for various purposes by the congestion controller (e.g Hystart++). +.Pp +Note that currently not all TCP stacks call the +.Va rttsample +and +.Va newround +function so dependancy on these functions is also +dependant upon which TCP stack is in use. +.Pp +The .Fn DECLARE_CC_MODULE macro provides a convenient wrapper around the .Xr DECLARE_MODULE 9 @@ -203,8 +244,23 @@ modules must instantiate a .Vt struct cc_algo , but are only required to set the name field, and optionally any of the function pointers. +Note that if a module defines the +.Va cb_init +function it also must define a +.Va cc_data_sz +function. +This is because when switching from one congestion control +module to another the socket option code will preallocate memory for the +.Va cb_init +function. If no memory is allocated by the modules +.Va cb_init +then the +.Va cc_data_sz +function should return 0. +.Pp The stack will skip calling any function pointer which is NULL, so there is no -requirement to implement any of the function pointers. +requirement to implement any of the function pointers (with the exception of +the cb_init <-> cc_data_sz dependancy noted above). Using the C99 designated initialiser feature to set fields is encouraged. .Pp Each function pointer which deals with congestion control state is passed a @@ -222,6 +278,8 @@ struct cc_var { struct tcpcb *tcp; struct sctp_nets *sctp; } ccvc; + uint16_t nsegs; + uint8_t labc; }; .Ed .Pp @@ -305,6 +363,19 @@ and is set when the connection's ability to send data is currently constrained by the value of the congestion window. Algorithms should use the absence of this flag being set to avoid accumulating a large difference between the congestion window and send window. +.Pp +The +.Va nsegs +variable is used to pass in how much compression was done by the local +LRO system. +So for example if LRO pushed three in-order acknowledgements into +one acknowledgement the variable would be set to three. +.Pp +The +.Va labc +variable is used in conjunction with the CCF_USE_LOCAL_ABC flag +to override what labc variable the congestion controller will use +for this particular acknowledgement. .Sh SEE ALSO .Xr cc_cdg 4 , .Xr cc_chd 4 , diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index f47b995beb2c..eb2b0cbd12e9 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -30,6 +30,8 @@ options PREEMPTION # Enable kernel thread preemption options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols +options CC_NEWRENO # include newreno congestion control +options CC_DEFAULT=\"newreno\" # define our default CC module it should be compiled in. options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options ROUTE_MPATH # Multipath routing support options FIB_ALGO # Modular fib lookups diff --git a/sys/arm/conf/std.armv6 b/sys/arm/conf/std.armv6 index 5f7fb1ebb221..cdfb755eb9c2 100644 --- a/sys/arm/conf/std.armv6 +++ b/sys/arm/conf/std.armv6 @@ -8,6 +8,8 @@ options PREEMPTION # Enable kernel thread preemption options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols +options CC_NEWRENO # include newreno congestion control +options CC_DEFAULT=\"newreno\" # define our default CC module it should be compiled in. options TCP_HHOOK # hhook(9) framework for TCP device crypto # core crypto support options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 diff --git a/sys/arm/conf/std.armv7 b/sys/arm/conf/std.armv7 index fda291df289a..7512bbaa2939 100644 --- a/sys/arm/conf/std.armv7 +++ b/sys/arm/conf/std.armv7 @@ -8,6 +8,8 @@ options PREEMPTION # Enable kernel thread preemption options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols +options CC_NEWRENO # include newreno congestion control +options CC_DEFAULT=\"newreno\" # define our default CC module it should be compiled in. options TCP_HHOOK # hhook(9) framework for TCP device crypto # core crypto support options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 diff --git a/sys/arm64/conf/std.arm64 b/sys/arm64/conf/std.arm64 index 5c26f19b4299..599fd2aebeff 100644 --- a/sys/arm64/conf/std.arm64 +++ b/sys/arm64/conf/std.arm64 @@ -11,6 +11,8 @@ options PREEMPTION # Enable kernel thread preemption options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols +options CC_NEWRENO # include newreno congestion control +options CC_DEFAULT=\"newreno\" # define our default CC module it should be compiled in. options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options ROUTE_MPATH # Multipath routing support options FIB_ALGO # Modular fib lookups diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 35662db3ef27..a1f466a7a8b5 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -646,7 +646,26 @@ options HWPMC_HOOKS # Other necessary kernel hooks # options INET #Internet communications protocols options INET6 #IPv6 communications protocols - +# +# Note if you include INET/INET6 or both options +# You *must* define at least one of the congestion control +# options or the compile will fail. Generic defines +# options CC_NEWRENO. You also will need to specify +# a default or the compile of your kernel will fail +# as well. The string in default is the name of the +# cc module as it would appear in the sysctl for +# setting the default. Generic defines newreno +# as shown below. +# +options CC_CDG +options CC_CHD +options CC_CUBIC +options CC_DCTCP +options CC_HD +options CC_HTCP +options CC_NEWRENO +options CC_VEGAS +options CC_DEFAULT=\"newreno\" options RATELIMIT # TX rate limiting support options ROUTETABLES=2 # allocated fibs up to 65536. default is 1. diff --git a/sys/conf/files b/sys/conf/files index e1ee0e9fc9ef..30f98817e290 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4351,8 +4351,20 @@ netinet/ip_options.c optional inet netinet/ip_output.c optional inet netinet/ip_reass.c optional inet netinet/raw_ip.c optional inet | inet6 -netinet/cc/cc.c optional inet | inet6 -netinet/cc/cc_newreno.c optional inet | inet6 +netinet/cc/cc.c optional cc_newreno inet | cc_vegas inet | \ + cc_htcp inet | cc_hd inet | cc_dctcp inet | cc_cubic inet | \ + cc_chd inet | cc_cdg inet | cc_newreno inet6 | cc_vegas inet6 | \ + cc_htcp inet6 | cc_hd inet6 |cc_dctcp inet6 | cc_cubic inet6 | \ + cc_chd inet6 | cc_cdg inet6 +netinet/cc/cc_cdg.c optional inet cc_cdg tcp_hhook +netinet/cc/cc_chd.c optional inet cc_chd tcp_hhook +netinet/cc/cc_cubic.c optional inet cc_cubic | inet6 cc_cubic +netinet/cc/cc_dctcp.c optional inet cc_dctcp | inet6 cc_dctcp +netinet/cc/cc_hd.c optional inet cc_hd tcp_hhook +netinet/cc/cc_htcp.c optional inet cc_htcp | inet6 cc_htcp +netinet/cc/cc_newreno.c optional inet cc_newreno | inet6 cc_newreno +netinet/cc/cc_vegas.c optional inet cc_vegas tcp_hhook +netinet/khelp/h_ertt.c optional inet tcp_hhook netinet/sctp_asconf.c optional inet sctp | inet6 sctp netinet/sctp_auth.c optional inet sctp | inet6 sctp netinet/sctp_bsd_addr.c optional inet sctp | inet6 sctp diff --git a/sys/conf/options b/sys/conf/options index 2d99dc8c67db..a103ab85c1b9 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -81,6 +81,15 @@ BOOTVERBOSE opt_global.h CALLOUT_PROFILING CAPABILITIES opt_capsicum.h CAPABILITY_MODE opt_capsicum.h +CC_CDG opt_global.h +CC_CHD opt_global.h +CC_CUBIC opt_global.h +CC_DEFAULT opt_cc.h +CC_DCTCP opt_global.h +CC_HD opt_global.h +CC_HTCP opt_global.h +CC_NEWRENO opt_global.h +CC_VEGAS opt_global.h COMPAT_43 opt_global.h COMPAT_43TTY opt_global.h COMPAT_FREEBSD4 opt_global.h diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC index 5447c452c4f7..3b5556675555 100644 --- a/sys/i386/conf/GENERIC +++ b/sys/i386/conf/GENERIC @@ -31,6 +31,8 @@ options PREEMPTION # Enable kernel thread preemption options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols +options CC_NEWRENO # include newreno congestion control +options CC_DEFAULT=\"newreno\" # define our default CC module it should be compiled in. options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options ROUTE_MPATH # Multipath routing support options TCP_HHOOK # hhook(9) framework for TCP diff --git a/sys/modules/cc/Makefile b/sys/modules/cc/Makefile index ec89d89e8c80..3f7110024722 100644 --- a/sys/modules/cc/Makefile +++ b/sys/modules/cc/Makefile @@ -1,6 +1,7 @@ # $FreeBSD$ -SUBDIR= cc_cubic \ +SUBDIR= cc_newreno \ + cc_cubic \ cc_dctcp \ cc_htcp diff --git a/sys/modules/cc/cc_newreno/Makefile b/sys/modules/cc/cc_newreno/Makefile new file mode 100644 index 000000000000..8d9b82ad2a9e --- /dev/null +++ b/sys/modules/cc/cc_newreno/Makefile @@ -0,0 +1,7 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/netinet/cc +KMOD= cc_newreno +SRCS= cc_newreno.c + +.include diff --git a/sys/netinet/cc/cc.c b/sys/netinet/cc/cc.c index 0d60b64dbe32..0a61aff37c96 100644 --- a/sys/netinet/cc/cc.c +++ b/sys/netinet/cc/cc.c @@ -50,7 +50,7 @@ #include __FBSDID("$FreeBSD$"); - +#include #include #include #include @@ -70,11 +70,15 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include +#include #include - #include +MALLOC_DEFINE(M_CC_MEM, "CC Mem", "Congestion Control State memory"); + /* * List of available cc algorithms on the current system. First element * is used as the system default CC algorithm. @@ -84,7 +88,10 @@ struct cc_head cc_list = STAILQ_HEAD_INITIALIZER(cc_list); /* Protects the cc_list TAILQ. */ struct rwlock cc_list_lock; -VNET_DEFINE(struct cc_algo *, default_cc_ptr) = &newreno_cc_algo; +VNET_DEFINE(struct cc_algo *, default_cc_ptr) = NULL; + +VNET_DEFINE(uint32_t, newreno_beta) = 50; +#define V_newreno_beta VNET(newreno_beta) /* * Sysctl handler to show and change the default CC algorithm. @@ -98,7 +105,10 @@ cc_default_algo(SYSCTL_HANDLER_ARGS) /* Get the current default: */ CC_LIST_RLOCK(); - strlcpy(default_cc, CC_DEFAULT()->name, sizeof(default_cc)); + if (CC_DEFAULT_ALGO() != NULL) + strlcpy(default_cc, CC_DEFAULT_ALGO()->name, sizeof(default_cc)); + else + memset(default_cc, 0, TCP_CA_NAME_MAX); CC_LIST_RUNLOCK(); error = sysctl_handle_string(oidp, default_cc, sizeof(default_cc), req); @@ -108,7 +118,6 @@ cc_default_algo(SYSCTL_HANDLER_ARGS) goto done; error = ESRCH; - /* Find algo with specified name and set it to default. */ CC_LIST_RLOCK(); STAILQ_FOREACH(funcs, &cc_list, entries) { @@ -141,7 +150,9 @@ cc_list_available(SYSCTL_HANDLER_ARGS) nalgos++; } CC_LIST_RUNLOCK(); - + if (nalgos == 0) { + return (ENOENT); + } s = sbuf_new(NULL, NULL, nalgos * TCP_CA_NAME_MAX, SBUF_FIXEDLEN); if (s == NULL) @@ -176,12 +187,13 @@ cc_list_available(SYSCTL_HANDLER_ARGS) } /* - * Reset the default CC algo to NewReno for any netstack which is using the algo - * that is about to go away as its default. + * Return the number of times a proposed removal_cc is + * being used as the default. */ -static void -cc_checkreset_default(struct cc_algo *remove_cc) +static int +cc_check_default(struct cc_algo *remove_cc) { + int cnt = 0; VNET_ITERATOR_DECL(vnet_iter); CC_LIST_LOCK_ASSERT(); @@ -189,12 +201,16 @@ cc_checkreset_default(struct cc_algo *remove_cc) VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - if (strncmp(CC_DEFAULT()->name, remove_cc->name, - TCP_CA_NAME_MAX) == 0) - V_default_cc_ptr = &newreno_cc_algo; + if ((CC_DEFAULT_ALGO() != NULL) && + strncmp(CC_DEFAULT_ALGO()->name, + remove_cc->name, + TCP_CA_NAME_MAX) == 0) { + cnt++; + } CURVNET_RESTORE(); } VNET_LIST_RUNLOCK_NOSLEEP(); + return (cnt); } /* @@ -218,31 +234,36 @@ cc_deregister_algo(struct cc_algo *remove_cc) err = ENOENT; - /* Never allow newreno to be deregistered. */ - if (&newreno_cc_algo == remove_cc) - return (EPERM); - /* Remove algo from cc_list so that new connections can't use it. */ CC_LIST_WLOCK(); STAILQ_FOREACH_SAFE(funcs, &cc_list, entries, tmpfuncs) { if (funcs == remove_cc) { - cc_checkreset_default(remove_cc); - STAILQ_REMOVE(&cc_list, funcs, cc_algo, entries); - err = 0; + if (cc_check_default(remove_cc)) { + err = EBUSY; + break; + } + /* Add a temp flag to stop new adds to it */ + funcs->flags |= CC_MODULE_BEING_REMOVED; + break; + } + } + CC_LIST_WUNLOCK(); + err = tcp_ccalgounload(remove_cc); + /* + * Now back through and we either remove the temp flag + * or pull the registration. + */ + CC_LIST_WLOCK(); + STAILQ_FOREACH_SAFE(funcs, &cc_list, entries, tmpfuncs) { + if (funcs == remove_cc) { + if (err == 0) + STAILQ_REMOVE(&cc_list, funcs, cc_algo, entries); + else + funcs->flags &= ~CC_MODULE_BEING_REMOVED; break; } } CC_LIST_WUNLOCK(); - - if (!err) - /* - * XXXLAS: - * - We may need to handle non-zero return values in future. - * - If we add CC framework support for protocols other than - * TCP, we may want a more generic way to handle this step. - */ - tcp_ccalgounload(remove_cc); - return (err); } @@ -263,19 +284,218 @@ cc_register_algo(struct cc_algo *add_cc) */ CC_LIST_WLOCK(); STAILQ_FOREACH(funcs, &cc_list, entries) { - if (funcs == add_cc || strncmp(funcs->name, add_cc->name, - TCP_CA_NAME_MAX) == 0) + if (funcs == add_cc || + strncmp(funcs->name, add_cc->name, + TCP_CA_NAME_MAX) == 0) { err = EEXIST; + break; + } } - - if (!err) + /* + * The first loaded congestion control module will become + * the default until we find the "CC_DEFAULT" defined in + * the config (if we do). + */ + if (!err) { STAILQ_INSERT_TAIL(&cc_list, add_cc, entries); - + if (strcmp(add_cc->name, CC_DEFAULT) == 0) { + V_default_cc_ptr = add_cc; + } else if (V_default_cc_ptr == NULL) { + V_default_cc_ptr = add_cc; + } + } CC_LIST_WUNLOCK(); return (err); } +/* + * Perform any necessary tasks before we exit congestion recovery. + */ +void +newreno_cc_post_recovery(struct cc_var *ccv) +{ + int pipe; + + if (IN_FASTRECOVERY(CCV(ccv, t_flags))) { + /* + * Fast recovery will conclude after returning from this + * function. Window inflation should have left us with + * approximately snd_ssthresh outstanding data. But in case we + * would be inclined to send a burst, better to do it via the + * slow start mechanism. + * + * XXXLAS: Find a way to do this without needing curack + */ + if (V_tcp_do_newsack) + pipe = tcp_compute_pipe(ccv->ccvc.tcp); + else + pipe = CCV(ccv, snd_max) - ccv->curack; + if (pipe < CCV(ccv, snd_ssthresh)) + /* + * Ensure that cwnd does not collapse to 1 MSS under + * adverse conditons. Implements RFC6582 + */ + CCV(ccv, snd_cwnd) = max(pipe, CCV(ccv, t_maxseg)) + + CCV(ccv, t_maxseg); + else + CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); + } +} + +void +newreno_cc_after_idle(struct cc_var *ccv) +{ + uint32_t rw; + /* + * If we've been idle for more than one retransmit timeout the old + * congestion window is no longer current and we have to reduce it to + * the restart window before we can transmit again. + * + * The restart window is the initial window or the last CWND, whichever + * is smaller. + * + * This is done to prevent us from flooding the path with a full CWND at + * wirespeed, overloading router and switch buffers along the way. + * + * See RFC5681 Section 4.1. "Restarting Idle Connections". + * + * In addition, per RFC2861 Section 2, the ssthresh is set to the + * maximum of the former ssthresh or 3/4 of the old cwnd, to + * not exit slow-start prematurely. + */ + rw = tcp_compute_initwnd(tcp_maxseg(ccv->ccvc.tcp)); + + CCV(ccv, snd_ssthresh) = max(CCV(ccv, snd_ssthresh), + CCV(ccv, snd_cwnd)-(CCV(ccv, snd_cwnd)>>2)); + + CCV(ccv, snd_cwnd) = min(rw, CCV(ccv, snd_cwnd)); +} + +/* + * Perform any necessary tasks before we enter congestion recovery. + */ +void +newreno_cc_cong_signal(struct cc_var *ccv, uint32_t type) +{ + uint32_t cwin, factor; + u_int mss; + + cwin = CCV(ccv, snd_cwnd); + mss = tcp_fixed_maxseg(ccv->ccvc.tcp); + /* + * Other TCP congestion controls use newreno_cong_signal(), but + * with their own private cc_data. Make sure the cc_data is used + * correctly. + */ + factor = V_newreno_beta; + + /* Catch algos which mistakenly leak private signal types. */ + KASSERT((type & CC_SIGPRIVMASK) == 0, + ("%s: congestion signal type 0x%08x is private\n", __func__, type)); + + cwin = max(((uint64_t)cwin * (uint64_t)factor) / (100ULL * (uint64_t)mss), + 2) * mss; + + switch (type) { + case CC_NDUPACK: + if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) { + if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) + CCV(ccv, snd_ssthresh) = cwin; + ENTER_RECOVERY(CCV(ccv, t_flags)); + } + break; + case CC_ECN: + if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { + CCV(ccv, snd_ssthresh) = cwin; + CCV(ccv, snd_cwnd) = cwin; + ENTER_CONGRECOVERY(CCV(ccv, t_flags)); + } + break; + case CC_RTO: + CCV(ccv, snd_ssthresh) = max(min(CCV(ccv, snd_wnd), + CCV(ccv, snd_cwnd)) / 2 / mss, + 2) * mss; + CCV(ccv, snd_cwnd) = mss; + break; + } +} + +void +newreno_cc_ack_received(struct cc_var *ccv, uint16_t type) +{ + if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) && + (ccv->flags & CCF_CWND_LIMITED)) { + u_int cw = CCV(ccv, snd_cwnd); + u_int incr = CCV(ccv, t_maxseg); + + /* + * Regular in-order ACK, open the congestion window. + * Method depends on which congestion control state we're + * in (slow start or cong avoid) and if ABC (RFC 3465) is + * enabled. + * + * slow start: cwnd <= ssthresh + * cong avoid: cwnd > ssthresh + * + * slow start and ABC (RFC 3465): + * Grow cwnd exponentially by the amount of data + * ACKed capping the max increment per ACK to + * (abc_l_var * maxseg) bytes. + * + * slow start without ABC (RFC 5681): + * Grow cwnd exponentially by maxseg per ACK. + * + * cong avoid and ABC (RFC 3465): + * Grow cwnd linearly by maxseg per RTT for each + * cwnd worth of ACKed data. + * + * cong avoid without ABC (RFC 5681): + * Grow cwnd linearly by approximately maxseg per RTT using + * maxseg^2 / cwnd per ACK as the increment. + * If cwnd > maxseg^2, fix the cwnd increment at 1 byte to + * avoid capping cwnd. + */ + if (cw > CCV(ccv, snd_ssthresh)) { + if (V_tcp_do_rfc3465) { + if (ccv->flags & CCF_ABC_SENTAWND) + ccv->flags &= ~CCF_ABC_SENTAWND; + else + incr = 0; + } else + incr = max((incr * incr / cw), 1); + } else if (V_tcp_do_rfc3465) { + /* + * In slow-start with ABC enabled and no RTO in sight? + * (Must not use abc_l_var > 1 if slow starting after + * an RTO. On RTO, snd_nxt = snd_una, so the + * snd_nxt == snd_max check is sufficient to + * handle this). + * + * XXXLAS: Find a way to signal SS after RTO that + * doesn't rely on tcpcb vars. + */ + uint16_t abc_val; + + if (ccv->flags & CCF_USE_LOCAL_ABC) + abc_val = ccv->labc; + else + abc_val = V_tcp_abc_l_var; + if (CCV(ccv, snd_nxt) == CCV(ccv, snd_max)) + incr = min(ccv->bytes_this_ack, + ccv->nsegs * abc_val * + CCV(ccv, t_maxseg)); + else + incr = min(ccv->bytes_this_ack, CCV(ccv, t_maxseg)); + + } + /* ABC is on by default, so incr equals 0 frequently. */ + if (incr > 0) + CCV(ccv, snd_cwnd) = min(cw + incr, + TCP_MAXWIN << CCV(ccv, snd_scale)); + } +} + /* * Handles kld related events. Returns 0 on success, non-zero on failure. */ @@ -290,6 +510,15 @@ cc_modevent(module_t mod, int event_type, void *data) switch(event_type) { case MOD_LOAD: + if ((algo->cc_data_sz == NULL) && (algo->cb_init != NULL)) { + /* + * A module must have a cc_data_sz function + * even if it has no data it should return 0. + */ + printf("Module Load Fails, it lacks a cc_data_sz() function but has a cb_init()!\n"); + err = EINVAL; + break; + } if (algo->mod_init != NULL) err = algo->mod_init(); if (!err) diff --git a/sys/netinet/cc/cc.h b/sys/netinet/cc/cc.h index e5fc328cc0c2..4282f0585bbd 100644 --- a/sys/netinet/cc/cc.h +++ b/sys/netinet/cc/cc.h @@ -53,10 +53,11 @@ #ifdef _KERNEL +MALLOC_DECLARE(M_CC_MEM); + /* Global CC vars. */ extern STAILQ_HEAD(cc_head, cc_algo) cc_list; extern const int tcprexmtthresh; -extern struct cc_algo newreno_cc_algo; /* Per-netstack bits. */ VNET_DECLARE(struct cc_algo *, default_cc_ptr); @@ -139,8 +140,19 @@ struct cc_algo { /* Cleanup global module state on kldunload. */ int (*mod_destroy)(void); - /* Init CC state for a new control block. */ - int (*cb_init)(struct cc_var *ccv); + /* Return the size of the void pointer the CC needs for state */ + size_t (*cc_data_sz)(void); + + /* + * Init CC state for a new control block. The CC + * module may be passed a NULL ptr indicating that *** 1429 LINES SKIPPED *** From nobody Thu Nov 11 11:37:19 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C7BBE185CDE7; Thu, 11 Nov 2021 11:37:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hqfp75K4Mz3Fhn; Thu, 11 Nov 2021 11:37:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96C913764; Thu, 11 Nov 2021 11:37:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ABBbJs1020936; Thu, 11 Nov 2021 11:37:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ABBbJWX020935; Thu, 11 Nov 2021 11:37:19 GMT (envelope-from git) Date: Thu, 11 Nov 2021 11:37:19 GMT Message-Id: <202111111137.1ABBbJWX020935@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Randall Stewart Subject: git: 26cbd0028c50 - main - tcp: Rack may still calculate long RTT on persists probes. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 26cbd0028c508787e1d88361f345ac707acabce5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rrs: URL: https://cgit.FreeBSD.org/src/commit/?id=26cbd0028c508787e1d88361f345ac707acabce5 commit 26cbd0028c508787e1d88361f345ac707acabce5 Author: Randall Stewart AuthorDate: 2021-11-11 11:35:51 +0000 Commit: Randall Stewart CommitDate: 2021-11-11 11:35:51 +0000 tcp: Rack may still calculate long RTT on persists probes. When a persists probe is lost, we will end up calculating a long RTT based on the initial probe and when the response comes from the second probe (or third etc). This means we have a minimum of a confidence level of 3 on a incorrect probe. This commit will change it so that we have one of two options a) Just not count RTT of probes where we had a loss b) Count them still but degrade the confidence to 0. I have set in this the default being to just not measure them, but I am open to having the default be otherwise. Reviewed by: Michael Tuexen Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D32897 --- sys/netinet/tcp_stacks/rack.c | 163 ++++++++++++++++++++++++++++++++------ sys/netinet/tcp_stacks/tcp_rack.h | 4 +- sys/netinet/tcp_subr.c | 25 +++++- 3 files changed, 163 insertions(+), 29 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index b1927f0a17e4..7769aa1272c0 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -205,6 +205,7 @@ static int32_t rack_hw_up_only = 1; static int32_t rack_stats_gets_ms_rtt = 1; static int32_t rack_prr_addbackmax = 2; static int32_t rack_do_hystart = 0; +static int32_t rack_apply_rtt_with_reduced_conf = 0; static int32_t rack_pkt_delay = 1000; static int32_t rack_send_a_lot_in_prr = 1; @@ -343,6 +344,10 @@ counter_u64_t rack_saw_enetunreach; counter_u64_t rack_per_timer_hole; counter_u64_t rack_large_ackcmp; counter_u64_t rack_small_ackcmp; +counter_u64_t rack_persists_sends; +counter_u64_t rack_persists_acks; +counter_u64_t rack_persists_loss; +counter_u64_t rack_persists_lost_ends; #ifdef INVARIANTS counter_u64_t rack_adjust_map_bw; #endif @@ -772,6 +777,10 @@ sysctl_rack_clear(SYSCTL_HANDLER_ARGS) counter_u64_zero(rack_per_timer_hole); counter_u64_zero(rack_large_ackcmp); counter_u64_zero(rack_small_ackcmp); + counter_u64_zero(rack_persists_sends); + counter_u64_zero(rack_persists_acks); + counter_u64_zero(rack_persists_loss); + counter_u64_zero(rack_persists_lost_ends); #ifdef INVARIANTS counter_u64_zero(rack_adjust_map_bw); #endif @@ -1412,6 +1421,11 @@ rack_init_sysctls(void) &rack_tcp_accounting, 0, "Should we turn on TCP accounting for all rack sessions?"); #endif + SYSCTL_ADD_S32(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_misc), + OID_AUTO, "apply_rtt_with_low_conf", CTLFLAG_RW, + &rack_apply_rtt_with_reduced_conf, 0, + "When a persist or keep-alive probe is not answered do we calculate rtt on subsequent answers?"); SYSCTL_ADD_S32(&rack_sysctl_ctx, SYSCTL_CHILDREN(rack_misc), OID_AUTO, "rack_dsack_ctl", CTLFLAG_RW, @@ -1774,6 +1788,30 @@ rack_init_sysctls(void) OID_AUTO, "cmp_large_mbufs", CTLFLAG_RD, &rack_large_ackcmp, "Number of TCP connections with large mbuf's for compressed acks"); + rack_persists_sends = counter_u64_alloc(M_WAITOK); + SYSCTL_ADD_COUNTER_U64(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_counters), + OID_AUTO, "persist_sends", CTLFLAG_RD, + &rack_persists_sends, + "Number of times we sent a persist probe"); + rack_persists_acks = counter_u64_alloc(M_WAITOK); + SYSCTL_ADD_COUNTER_U64(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_counters), + OID_AUTO, "persist_acks", CTLFLAG_RD, + &rack_persists_acks, + "Number of times a persist probe was acked"); + rack_persists_loss = counter_u64_alloc(M_WAITOK); + SYSCTL_ADD_COUNTER_U64(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_counters), + OID_AUTO, "persist_loss", CTLFLAG_RD, + &rack_persists_loss, + "Number of times we detected a lost persist probe (no ack)"); + rack_persists_lost_ends = counter_u64_alloc(M_WAITOK); + SYSCTL_ADD_COUNTER_U64(&rack_sysctl_ctx, + SYSCTL_CHILDREN(rack_counters), + OID_AUTO, "persist_loss_ends", CTLFLAG_RD, + &rack_persists_lost_ends, + "Number of lost persist probe (no ack) that the run ended with a PERSIST abort"); rack_small_ackcmp = counter_u64_alloc(M_WAITOK); SYSCTL_ADD_COUNTER_U64(&rack_sysctl_ctx, SYSCTL_CHILDREN(rack_counters), @@ -2938,6 +2976,10 @@ rack_counter_destroy(void) counter_u64_free(rack_per_timer_hole); counter_u64_free(rack_large_ackcmp); counter_u64_free(rack_small_ackcmp); + counter_u64_free(rack_persists_sends); + counter_u64_free(rack_persists_acks); + counter_u64_free(rack_persists_loss); + counter_u64_free(rack_persists_lost_ends); #ifdef INVARIANTS counter_u64_free(rack_adjust_map_bw); #endif @@ -5623,6 +5665,9 @@ rack_enter_persist(struct tcpcb *tp, struct tcp_rack *rack, uint32_t cts) if (rack->r_ctl.rc_went_idle_time == 0) rack->r_ctl.rc_went_idle_time = 1; rack_timer_cancel(tp, rack, cts, __LINE__); + rack->r_ctl.persist_lost_ends = 0; + rack->probe_not_answered = 0; + rack->forced_ack = 0; tp->t_rxtshift = 0; RACK_TCPT_RANGESET(tp->t_rxtcur, RACK_REXMTVAL(tp), rack_rto_min, rack_rto_max, rack->r_ctl.timer_slop); @@ -6494,6 +6539,7 @@ rack_timeout_persist(struct tcpcb *tp, struct tcp_rack *rack, uint32_t cts) tcp_log_end_status(tp, TCP_EI_STATUS_PERSIST_MAX); rack_log_progress_event(rack, tp, tick, PROGRESS_DROP, __LINE__); tcp_set_inp_to_drop(inp, ETIMEDOUT); + counter_u64_add(rack_persists_lost_ends, rack->r_ctl.persist_lost_ends); return (1); } KASSERT(inp != NULL, ("%s: tp %p tp->t_inpcb == NULL", __func__, tp)); @@ -6515,6 +6561,7 @@ rack_timeout_persist(struct tcpcb *tp, struct tcp_rack *rack, uint32_t cts) retval = 1; tcp_log_end_status(tp, TCP_EI_STATUS_PERSIST_MAX); tcp_set_inp_to_drop(rack->rc_inp, ETIMEDOUT); + counter_u64_add(rack_persists_lost_ends, rack->r_ctl.persist_lost_ends); goto out; } if ((sbavail(&rack->rc_inp->inp_socket->so_snd) == 0) && @@ -6531,6 +6578,7 @@ rack_timeout_persist(struct tcpcb *tp, struct tcp_rack *rack, uint32_t cts) KMOD_TCPSTAT_INC(tcps_persistdrop); tcp_log_end_status(tp, TCP_EI_STATUS_PERSIST_MAX); tcp_set_inp_to_drop(rack->rc_inp, ETIMEDOUT); + counter_u64_add(rack_persists_lost_ends, rack->r_ctl.persist_lost_ends); goto out; } t_template = tcpip_maketemplate(rack->rc_inp); @@ -6539,7 +6587,12 @@ rack_timeout_persist(struct tcpcb *tp, struct tcp_rack *rack, uint32_t cts) if (rack->forced_ack == 0) { rack->forced_ack = 1; rack->r_ctl.forced_ack_ts = tcp_get_usecs(NULL); + } else { + rack->probe_not_answered = 1; + counter_u64_add(rack_persists_loss, 1); + rack->r_ctl.persist_lost_ends++; } + counter_u64_add(rack_persists_sends, 1); tcp_respond(tp, t_template->tt_ipgen, &t_template->tt_t, (struct mbuf *)NULL, tp->rcv_nxt, tp->snd_una - 1, 0); @@ -6602,6 +6655,8 @@ rack_timeout_keepalive(struct tcpcb *tp, struct tcp_rack *rack, uint32_t cts) if (rack->forced_ack == 0) { rack->forced_ack = 1; rack->r_ctl.forced_ack_ts = tcp_get_usecs(NULL); + } else { + rack->probe_not_answered = 1; } tcp_respond(tp, t_template->tt_ipgen, &t_template->tt_t, (struct mbuf *)NULL, @@ -10301,6 +10356,14 @@ rack_process_ack(struct mbuf *m, struct tcphdr *th, struct socket *so, INP_WLOCK_ASSERT(tp->t_inpcb); acked = BYTES_THIS_ACK(tp, th); + if (acked) { + /* + * Any time we move the cum-ack forward clear + * keep-alive tied probe-not-answered. The + * persists clears its own on entry. + */ + rack->probe_not_answered = 0; + } KMOD_TCPSTAT_ADD(tcps_rcvackpack, nsegs); KMOD_TCPSTAT_ADD(tcps_rcvackbyte, acked); /* @@ -13374,6 +13437,61 @@ rack_log_input_packet(struct tcpcb *tp, struct tcp_rack *rack, struct tcp_ackent } +static void +rack_handle_probe_response(struct tcp_rack *rack, uint32_t tiwin, uint32_t us_cts) +{ + uint32_t us_rtt; + /* + * A persist or keep-alive was forced out, update our + * min rtt time. Note now worry about lost responses. + * When a subsequent keep-alive or persist times out + * and forced_ack is still on, then the last probe + * was not responded to. In such cases we have a + * sysctl that controls the behavior. Either we apply + * the rtt but with reduced confidence (0). Or we just + * plain don't apply the rtt estimate. Having data flow + * will clear the probe_not_answered flag i.e. cum-ack + * move forward exiting and reentering persists. + */ + + rack->forced_ack = 0; + rack->rc_tp->t_rxtshift = 0; + if ((rack->rc_in_persist && + (tiwin == rack->rc_tp->snd_wnd)) || + (rack->rc_in_persist == 0)) { + /* + * In persists only apply the RTT update if this is + * a response to our window probe. And that + * means the rwnd sent must match the current + * snd_wnd. If it does not, then we got a + * window update ack instead. For keepalive + * we allow the answer no matter what the window. + * + * Note that if the probe_not_answered is set then + * the forced_ack_ts is the oldest one i.e. the first + * probe sent that might have been lost. This assures + * us that if we do calculate an RTT it is longer not + * some short thing. + */ + if (rack->rc_in_persist) + counter_u64_add(rack_persists_acks, 1); + us_rtt = us_cts - rack->r_ctl.forced_ack_ts; + if (us_rtt == 0) + us_rtt = 1; + if (rack->probe_not_answered == 0) { + rack_apply_updated_usrtt(rack, us_rtt, us_cts); + tcp_rack_xmit_timer(rack, us_rtt, 0, us_rtt, 3, NULL, 1); + } else { + /* We have a retransmitted probe here too */ + if (rack_apply_rtt_with_reduced_conf) { + rack_apply_updated_usrtt(rack, us_rtt, us_cts); + tcp_rack_xmit_timer(rack, us_rtt, 0, us_rtt, 0, NULL, 1); + } + } + } +} + + static int rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mbuf *m, int nxt_pkt, struct timeval *tv) { @@ -13483,7 +13601,7 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mb } else if (SEQ_GT(ae->ack, high_seq)) { /* Case A */ ae->ack_val_set = ACK_CUMACK; - } else if (tiwin == the_win) { + } else if ((tiwin == the_win) && (rack->rc_in_persist == 0)){ /* Case D */ ae->ack_val_set = ACK_DUPACK; } else { @@ -13596,6 +13714,18 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mb rack_strike_dupack(rack); } else if (ae->ack_val_set == ACK_RWND) { /* Case C */ + if ((ae->flags & TSTMP_LRO) || (ae->flags & TSTMP_HDWR)) { + ts.tv_sec = ae->timestamp / 1000000000; + ts.tv_nsec = ae->timestamp % 1000000000; + rack->r_ctl.act_rcv_time.tv_sec = ts.tv_sec; + rack->r_ctl.act_rcv_time.tv_usec = ts.tv_nsec/1000; + } else { + rack->r_ctl.act_rcv_time = *tv; + } + if (rack->forced_ack) { + rack_handle_probe_response(rack, tiwin, + tcp_tv_to_usectick(&rack->r_ctl.act_rcv_time)); + } win_up_req = 1; win_upd_ack = ae->ack; win_seq = ae->seq; @@ -13677,6 +13807,11 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mb #endif acked_amount = acked = (high_seq - tp->snd_una); if (acked) { + /* + * Clear the probe not answered flag + * since cum-ack moved forward. + */ + rack->probe_not_answered = 0; if (rack->sack_attack_disable == 0) rack_do_decay(rack); if (acked >= segsiz) { @@ -14432,31 +14567,7 @@ rack_do_segment_nounlock(struct mbuf *m, struct tcphdr *th, struct socket *so, } rack_clear_rate_sample(rack); if (rack->forced_ack) { - uint32_t us_rtt; - - /* - * A persist or keep-alive was forced out, update our - * min rtt time. Note we do not worry about lost - * retransmissions since KEEP-ALIVES and persists - * are usually way long on times of sending (though - * if we were really paranoid or worried we could - * at least use timestamps if available to validate). - */ - rack->forced_ack = 0; - if (tiwin == tp->snd_wnd) { - /* - * Only apply the RTT update if this is - * a response to our window probe. And that - * means the rwnd sent must match the current - * snd_wnd. If it does not, then we got a - * window update ack instead. - */ - us_rtt = us_cts - rack->r_ctl.forced_ack_ts; - if (us_rtt == 0) - us_rtt = 1; - rack_apply_updated_usrtt(rack, us_rtt, us_cts); - tcp_rack_xmit_timer(rack, us_rtt, 0, us_rtt, 3, NULL, 1); - } + rack_handle_probe_response(rack, tiwin, us_cts); } /* * This is the one exception case where we set the rack state diff --git a/sys/netinet/tcp_stacks/tcp_rack.h b/sys/netinet/tcp_stacks/tcp_rack.h index 0893237e92f9..4b1f8513055d 100644 --- a/sys/netinet/tcp_stacks/tcp_rack.h +++ b/sys/netinet/tcp_stacks/tcp_rack.h @@ -496,6 +496,7 @@ struct rack_control { uint32_t challenge_ack_cnt; uint32_t rc_min_to; /* Socket option value Lock(a) */ uint32_t rc_pkt_delay; /* Socket option value Lock(a) */ + uint32_t persist_lost_ends; struct newreno rc_saved_beta; /* * For newreno cc: * rc_saved_cc are the values we have had @@ -567,7 +568,8 @@ struct tcp_rack { rc_last_tlp_past_cumack: 1, rc_last_sent_tlp_seq_valid: 1, rc_last_sent_tlp_past_cumack: 1, - avail_bytes : 3; + probe_not_answered: 1, + avail_bytes : 2; uint32_t rc_rack_rtt; /* RACK-RTT Lock(a) */ uint16_t r_mbuf_queue : 1, /* Do we do mbuf queue for non-paced */ rtt_limit_mul : 4, /* muliply this by low rtt */ diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index fab225fbc804..4805d6c80327 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1748,6 +1748,7 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, struct mbuf *optm; struct udphdr *uh = NULL; struct tcphdr *nth; + struct tcp_log_buffer *lgb; u_char *optp; #ifdef INET6 struct ip6_hdr *ip6; @@ -1756,6 +1757,7 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, int optlen, tlen, win, ulen; bool incl_opts; uint16_t port; + int output_ret; KASSERT(tp != NULL || m != NULL, ("tcp_respond: tp and m both NULL")); NET_EPOCH_ASSERT(); @@ -2086,11 +2088,26 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, TCP_PROBE3(debug__output, tp, th, m); if (flags & TH_RST) TCP_PROBE5(accept__refused, NULL, NULL, m, tp, nth); + if ((tp != NULL) && (tp->t_logstate != TCP_LOG_STATE_OFF)) { + union tcp_log_stackspecific log; + struct timeval tv; + + memset(&log.u_bbr, 0, sizeof(log.u_bbr)); + log.u_bbr.inhpts = tp->t_inpcb->inp_in_hpts; + log.u_bbr.ininput = tp->t_inpcb->inp_in_input; + log.u_bbr.flex8 = 4; + log.u_bbr.pkts_out = tp->t_maxseg; + log.u_bbr.timeStamp = tcp_get_usecs(&tv); + log.u_bbr.delivered = 0; + lgb = tcp_log_event_(tp, nth, NULL, NULL, TCP_LOG_OUT, ERRNO_UNK, + 0, &log, false, NULL, NULL, 0, &tv); + } else + lgb = NULL; #ifdef INET6 if (isipv6) { TCP_PROBE5(send, NULL, tp, ip6, tp, nth); - (void)ip6_output(m, NULL, NULL, 0, NULL, NULL, inp); + output_ret = ip6_output(m, NULL, NULL, 0, NULL, NULL, inp); } #endif /* INET6 */ #if defined(INET) && defined(INET6) @@ -2099,9 +2116,13 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, #ifdef INET { TCP_PROBE5(send, NULL, tp, ip, tp, nth); - (void)ip_output(m, NULL, NULL, 0, NULL, inp); + output_ret = ip_output(m, NULL, NULL, 0, NULL, inp); } #endif + if (lgb) { + lgb->tlb_errno = output_ret; + lgb = NULL; + } } /* From nobody Thu Nov 11 11:40:01 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B640D185FE28; Thu, 11 Nov 2021 11:40:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqfsF3kqsz3HPP; Thu, 11 Nov 2021 11:40:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 457143445; Thu, 11 Nov 2021 11:40:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ABBe1aV022476; Thu, 11 Nov 2021 11:40:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ABBe1i0022465; Thu, 11 Nov 2021 11:40:01 GMT (envelope-from git) Date: Thu, 11 Nov 2021 11:40:01 GMT Message-Id: <202111111140.1ABBe1i0022465@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Randall Stewart Subject: git: d69538633815 - main - Add in the commit revision to the UPDATING file for the CC changes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d69538633815127b84fe7472cdc44f4b9e6e7780 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rrs: URL: https://cgit.FreeBSD.org/src/commit/?id=d69538633815127b84fe7472cdc44f4b9e6e7780 commit d69538633815127b84fe7472cdc44f4b9e6e7780 Author: Randall Stewart AuthorDate: 2021-11-11 11:39:20 +0000 Commit: Randall Stewart CommitDate: 2021-11-11 11:39:20 +0000 Add in the commit revision to the UPDATING file for the CC changes The UPDATING file had a xxx for the CC changes commit, now that its committed fix that. --- UPDATING | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index cde26f7ea030..f1039c7e6d52 100644 --- a/UPDATING +++ b/UPDATING @@ -28,7 +28,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW: at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) 20211110: - Commit xxxxxx changed the TCP congestion control framework so + Commit b8d60729deef changed the TCP congestion control framework so that any of the included congestion control modules could be the single module built into the kernel. Previously newreno was automatically built in through direct reference. Has of From nobody Thu Nov 11 14:12:53 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9FF6817ED02D; Thu, 11 Nov 2021 14:13:02 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [217.70.178.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqkFp1Hw5z4pxB; Thu, 11 Nov 2021 14:13:02 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: (Authenticated sender: gnn@neville-neil.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id ABC71200004; Thu, 11 Nov 2021 14:12:56 +0000 (UTC) From: George Neville-Neil To: Mike Karels Cc: Gleb Smirnoff , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 20d59403961d - main - kernel: deprecate Internet Class A/B/C Date: Thu, 11 Nov 2021 09:12:53 -0500 X-Mailer: MailMate (1.14r5831) Message-ID: In-Reply-To: <90C05BCC-D4B6-43F9-95B1-D072EBA3703A@karels.net> References: <202111101536.1AAFa311018767@mail.karels.net> <90C05BCC-D4B6-43F9-95B1-D072EBA3703A@karels.net> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4HqkFp1Hw5z4pxB X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N I actually think that this is a reasonable solution. Best, George On 10 Nov 2021, at 17:26, Mike Karels wrote: > I’m going to top-post my reply to highlight this question: > It is proposed to revert the change to the default mask when setting > an Internet interface address without a mask, returning to the use of > the Class A/B/C mask as the default. We would still warn if there > was no mask supplied, except on loopback and point-to-point interfaces. > > Does anyone object, or otherwise have comments? > > Mike > > On 10 Nov 2021, at 10:38, Gleb Smirnoff wrote: > >> On Wed, Nov 10, 2021 at 09:36:03AM -0600, Mike Karels wrote: >> M> > The new /24 default is no better than classes. The only difference >> M> > that classes maintained POLA and new default doesn't. For example, >> M> > in my home network I have default router 10.0.0.1 and since it is >> M> > class A network on my VMs and test boxes I can type >> M> >> M> > # ifconfig vtnet0 10.6.6.6 >> M> >> M> > and that is going to work. With this change no longer. >> M> >> M> I suspect that /8 is by far the minority these days, even with a >> M> "Class A" net. I also use net 10 at home, and at the last several jobs, >> M> but it is subnetted in each case. I would peridically add an address, >> M> forgetting a mask, only to find that a route for 10/8 isolated the machine. >> >> The 10/8 can be used at home as a huge personal address space, just like >> a /64 IPv6 prefix. All addresses added without masks and everything works. >> >> M> That said, my main objective was to deprecate usage without a mask, and >> M> to warn in that case. Both the kernel and ifconfig now warn when a default >> M> mask is used. In the discussion on freebsd-net and in the review, the >> M> main thought was that masks should be required. But it isn't practical to >> M> fail and return an error with no mask, at least not without a significant >> M> period with warnings, or some systems would stop coming up on the network. >> M> >> M> One reviewer was going to comment on the /24 default, but thought it was >> M> better than the previous. I'm open to hearing more opinions. >> >> Although I don't internally agree that we really need to police people to >> always specify masks, I would make step forward and agree with that. So, >> let's do print loud warning on every attempt to set IP address without a >> mask. But I can not agree that change from class based guess to /24 is a >> right thing to do. A proper deprecation process goes like this: >> >> Step 1: Print warning, don't change legacy behavior. >> <... people adopt ...> >> Step 2: Return error. Remove deprecated behavior. >> >> What we did is that we changed behavior together with warning. The new >> behavior is neither the legacy one nor the desired one, where mask is >> a must. Look from a user perspective: for class C nothing changed, but >> changed for A and B. >> >> -- >> Gleb Smirnoff From nobody Thu Nov 11 14:26:14 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2A082183C2BC; Thu, 11 Nov 2021 14:26:19 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqkY70Rf1z3Bmv; Thu, 11 Nov 2021 14:26:19 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x72e.google.com with SMTP id g28so1479492qkk.9; Thu, 11 Nov 2021 06:26:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=E6VzZIHynOA72wpzuFk9GTRctj5qW7yLW1ZNYTncHnQ=; b=FlUCwY45vca8OmfYbCIpH28TC1v4N5xlKjcr8pDG61Ey5xZlYrVc1VCcjgdHjuZcCs epZbWoVjNHi0IRHIKyoKDgTDZC76kMiuxlVNi89xf9pgmApbkjnpFljZ8rVCJ8lp2+iU t3sA8hFiY9XwO+V0LaGVePNTTr1xfB4C1BQGbhpEK0Uje1iTnpdjWX5gzo4wSzIr/d49 1GQ9ekobQMI0pzO/aXnu9v6nfB0lQbc/id2SKQAgP+LbfkC6AMCGCIbc0sPkC4ncqxwI mngJY6PRz3SpPf1Ui2ttF57jNhKIJY/PWtfJlNpSxp5K0+WeTbb5BDGGbYgaRqNFMDsD tF9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=E6VzZIHynOA72wpzuFk9GTRctj5qW7yLW1ZNYTncHnQ=; b=ZFbyZZqeMbVj7G1/4Ng7V8oF72AL05MsEry5QxPJf9IMWWRaXh6FMEy2S7TL05yyi3 l8QAdnV6qFANO2TbXVAmBU7r5hTLuva0Ib+9nq0njAsvFAbfEAxvs0EL3O0LRaiSfsMI BR7DLP/iPjEMsToe908FffbA6j8MVRxVNUn4wuEuip9bUyDwiezdB3R47pUOxCwTbZkC WDj5bkQan1pgqZWW2iSREej3aj3SX2Dzi/oXfW2M5M7WmEhE2LpBO90hpFQ5bgqcZ7P4 0Y/EbHz9ItuLktbhTNNq1MrJtz4UQPzZVJl/TjxE3JZ0oVvUVWzz6RR7iYq+aNrONugB fqaw== X-Gm-Message-State: AOAM531WAylOjoQXl7+B+l1263cJku5E/3mjDkw4jLkN1sCdG1+O0sHh 5eTYCIf32LAft028SeQK41AOPLwslZE= X-Google-Smtp-Source: ABdhPJz5HuJPk6YbXyh2/U2Ud1/SEgNBazKWSMqJDJIhgmxxa8d+07VjOOaKOpJVFG7rWTzQHMZoFw== X-Received: by 2002:a05:620a:45aa:: with SMTP id bp42mr6288784qkb.3.1636640777941; Thu, 11 Nov 2021 06:26:17 -0800 (PST) Received: from nuc ([142.126.186.191]) by smtp.gmail.com with ESMTPSA id c24sm1520587qkp.43.2021.11.11.06.26.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Nov 2021 06:26:17 -0800 (PST) Sender: Mark Johnston Date: Thu, 11 Nov 2021 09:26:14 -0500 From: Mark Johnston To: Randall Stewart Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: b8d60729deef - main - tcp: Congestion control cleanup. Message-ID: References: <202111111131.1ABBVH6s017371@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202111111131.1ABBVH6s017371@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4HqkY70Rf1z3Bmv X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Thu, Nov 11, 2021 at 11:31:17AM +0000, Randall Stewart wrote: > The branch main has been updated by rrs: > > URL: https://cgit.FreeBSD.org/src/commit/?id=b8d60729deefa0bd13e6a395fcab4928e6e10445 > > commit b8d60729deefa0bd13e6a395fcab4928e6e10445 > Author: Randall Stewart > AuthorDate: 2021-11-11 11:28:18 +0000 > Commit: Randall Stewart > CommitDate: 2021-11-11 11:28:18 +0000 > > tcp: Congestion control cleanup. > > NOTE: HEADS UP read the note below if your kernel config is not including GENERIC!! > > This patch does a bit of cleanup on TCP congestion control modules. There were some rather > interesting surprises that one could get i.e. where you use a socket option to change > from one CC (say cc_cubic) to another CC (say cc_vegas) and you could in theory get > a memory failure and end up on cc_newreno. This is not what one would expect. The > new code fixes this by requiring a cc_data_sz() function so we can malloc with M_WAITOK > and pass in to the init function preallocated memory. The CC init is expected in this > case *not* to fail but if it does and a module does break the > "no fail with memory given" contract we do fall back to the CC that was in place at the time. > > This also fixes up a set of common newreno utilities that can be shared amongst other > CC modules instead of the other CC modules reaching into newreno and executing > what they think is a "common and understood" function. Lets put these functions in > cc.c and that way we have a common place that is easily findable by future developers or > bug fixers. This also allows newreno to evolve and grow support for its features i.e. ABE > and HYSTART++ without having to dance through hoops for other CC modules, instead > both newreno and the other modules just call into the common functions if they desire > that behavior or roll there own if that makes more sense. > > Note: This commit changes the kernel configuration!! If you are not using GENERIC in > some form you must add a CC module option (one of CC_NEWRENO, CC_VEGAS, CC_CUBIC, > CC_CDG, CC_CHD, CC_DCTCP, CC_HTCP, CC_HD). You can have more than one defined > as well if you desire. Note that if you create a kernel configuration that does not > define a congestion control module and includes INET or INET6 the kernel compile will > break. Also you need to define a default, generic adds 'options CC_DEFAULT=\"newreno\" > but you can specify any string that represents the name of the CC module (same names > that show up in the CC module list under net.inet.tcp.cc). If you fail to add the > options CC_DEFAULT in your kernel configuration the kernel build will also break. > > Reviewed by: Michael Tuexen > Sponsored by: Netflix Inc. > RELNOTES:YES > Differential Revision: https://reviews.freebsd.org/D32693 Hi Randall, This change causes a panic when starting up a vnet jail. V_default_cc_ptr is NULL in the new vnet, it doesn't automatically get copied from the parent vnet. I wrote the patch below and it allows my system to boot, but it's just a hack and I'm not sure what the right policy is. diff --git a/sys/netinet/cc/cc.c b/sys/netinet/cc/cc.c index 0a61aff37c96..f5ec10e487cf 100644 --- a/sys/netinet/cc/cc.c +++ b/sys/netinet/cc/cc.c @@ -309,6 +309,23 @@ cc_register_algo(struct cc_algo *add_cc) return (err); } +static void +vnet_cc_sysinit(void *arg) +{ + struct cc_algo *cc; + + if (IS_DEFAULT_VNET(curvnet)) + return; + + CURVNET_SET(vnet0); + cc = V_default_cc_ptr; + CURVNET_RESTORE(); + + V_default_cc_ptr = cc; +} +VNET_SYSINIT(vnet_cc_sysinit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, + vnet_cc_sysinit, NULL); + /* * Perform any necessary tasks before we exit congestion recovery. */ From nobody Thu Nov 11 15:19:58 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0C2931841061; Thu, 11 Nov 2021 15:19:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hqll26vJnz3kHr; Thu, 11 Nov 2021 15:19:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C849E61E1; Thu, 11 Nov 2021 15:19:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ABFJwm4014394; Thu, 11 Nov 2021 15:19:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ABFJwMM014393; Thu, 11 Nov 2021 15:19:58 GMT (envelope-from git) Date: Thu, 11 Nov 2021 15:19:58 GMT Message-Id: <202111111519.1ABFJwMM014393@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 4042b356a00e - main - bsdinstall: Fix mirror selection List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4042b356a00e12d6888a4e15e2373453804c5121 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=4042b356a00e12d6888a4e15e2373453804c5121 commit 4042b356a00e12d6888a4e15e2373453804c5121 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-11-10 15:39:09 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-11-11 15:18:36 +0000 bsdinstall: Fix mirror selection This is a follow-up to 2697622687708bffd4c3dcfc44f0c977a78e506d, which fixed 2 out of 3 broken uses of the mirrorselect script. Reviewed by: emaste Approved by: emaste (src) MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D32927 --- usr.sbin/bsdinstall/scripts/jail | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsdinstall/scripts/jail b/usr.sbin/bsdinstall/scripts/jail index 3110f744207c..d3a84f872fb6 100755 --- a/usr.sbin/bsdinstall/scripts/jail +++ b/usr.sbin/bsdinstall/scripts/jail @@ -103,7 +103,7 @@ FETCH_DISTRIBUTIONS=`echo $FETCH_DISTRIBUTIONS` # Trim white space if [ -n "$FETCH_DISTRIBUTIONS" -a -z "$BSDINSTALL_DISTSITE" ]; then exec 3>&1 - BSDINSTALL_DISTSITE=`bsdinstall mirrorselect 2>&1 1>&3` + BSDINSTALL_DISTSITE=$(`dirname $0`/mirrorselect 2>&1 1>&3) MIRROR_BUTTON=$? exec 3>&- test $MIRROR_BUTTON -eq 0 || error "No mirror selected" From nobody Thu Nov 11 19:52:28 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 07A13185B703; Thu, 11 Nov 2021 19:52:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqsnS6ndPz4gX2; Thu, 11 Nov 2021 19:52:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8D25123A9; Thu, 11 Nov 2021 19:52:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ABJqSZi089932; Thu, 11 Nov 2021 19:52:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ABJqSMu089931; Thu, 11 Nov 2021 19:52:28 GMT (envelope-from git) Date: Thu, 11 Nov 2021 19:52:28 GMT Message-Id: <202111111952.1ABJqSMu089931@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: e4bdb6857aea - main - vm_page: Handle VM_ALLOC_NORECLAIM in the contiguous page allocator List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e4bdb6857aea466ce4af48c0bd05a214460fe313 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e4bdb6857aea466ce4af48c0bd05a214460fe313 commit e4bdb6857aea466ce4af48c0bd05a214460fe313 Author: Mark Johnston AuthorDate: 2021-11-11 19:26:41 +0000 Commit: Mark Johnston CommitDate: 2021-11-11 19:26:41 +0000 vm_page: Handle VM_ALLOC_NORECLAIM in the contiguous page allocator We added _NORECLAIM to request that kmem_alloc_contig_pages() not spend time scanning physical memory for candidates to reclaim. In some situations the scanning can induce large amounts of undesirable latency, and it's less important that the request be satisfied than it is that we not spend many milliseconds scanning. The problem extends to vm_reserv_reclaim_contig(), which unlike vm_reserv_reclaim() may have to scan the entire list of partially populated reservations. Use VM_ALLOC_NORECLAIM to request that this scan not be executed.[1] As a side effect, this fixes a regression in 02fb0585e7b3 ("vm_page: Drop handling of VM_ALLOC_NOOBJ in vm_page_alloc_contig_domain()") where VM_ALLOC_CONTIG was not included in VPAC_FLAGS or VPANC_FLAGS even though it is not masked by kmem_alloc_contig_pages().[2] Reported by: gallatin [1], glebius [2] Reviewed by: alc, glebius, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32899 --- sys/vm/vm_kern.c | 4 ---- sys/vm/vm_page.c | 16 ++++++++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index 4ddeb3208260..669dc194759b 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -182,10 +182,6 @@ kmem_alloc_contig_pages(vm_object_t object, vm_pindex_t pindex, int domain, VM_OBJECT_ASSERT_WLOCKED(object); - /* Disallow an invalid combination of flags. */ - MPASS((pflags & (VM_ALLOC_WAITOK | VM_ALLOC_NORECLAIM)) != - (VM_ALLOC_WAITOK | VM_ALLOC_NORECLAIM)); - wait = (pflags & VM_ALLOC_WAITOK) != 0; reclaim = (pflags & VM_ALLOC_NORECLAIM) == 0; pflags &= ~(VM_ALLOC_NOWAIT | VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL); diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 76e9ba4db403..ac710bf43d08 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -2250,12 +2250,15 @@ vm_page_alloc_contig_domain(vm_object_t object, vm_pindex_t pindex, int domain, vm_page_t m, m_ret, mpred; u_int busy_lock, flags, oflags; -#define VPAC_FLAGS VPA_FLAGS +#define VPAC_FLAGS (VPA_FLAGS | VM_ALLOC_NORECLAIM) KASSERT((req & ~VPAC_FLAGS) == 0, ("invalid request %#x", req)); KASSERT(((req & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) != (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)), ("invalid request %#x", req)); + KASSERT((req & (VM_ALLOC_WAITOK | VM_ALLOC_NORECLAIM)) != + (VM_ALLOC_WAITOK | VM_ALLOC_NORECLAIM), + ("invalid request %#x", req)); VM_OBJECT_ASSERT_WLOCKED(object); KASSERT((object->flags & OBJ_FICTITIOUS) == 0, ("vm_page_alloc_contig: object %p has fictitious pages", @@ -2294,7 +2297,8 @@ again: if (m_ret == NULL) { vm_domain_freecnt_inc(vmd, npages); #if VM_NRESERVLEVEL > 0 - if (vm_reserv_reclaim_contig(domain, npages, low, + if ((req & VM_ALLOC_NORECLAIM) == 0 && + vm_reserv_reclaim_contig(domain, npages, low, high, alignment, boundary)) goto again; #endif @@ -2525,9 +2529,12 @@ vm_page_alloc_noobj_contig_domain(int domain, int req, u_long npages, vm_page_t m, m_ret; u_int flags; -#define VPANC_FLAGS VPAN_FLAGS +#define VPANC_FLAGS (VPAN_FLAGS | VM_ALLOC_NORECLAIM) KASSERT((req & ~VPANC_FLAGS) == 0, ("invalid request %#x", req)); + KASSERT((req & (VM_ALLOC_WAITOK | VM_ALLOC_NORECLAIM)) != + (VM_ALLOC_WAITOK | VM_ALLOC_NORECLAIM), + ("invalid request %#x", req)); KASSERT(((req & (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)) != (VM_ALLOC_NOBUSY | VM_ALLOC_SBUSY)), ("invalid request %#x", req)); @@ -2547,7 +2554,8 @@ again: if (m_ret == NULL) { vm_domain_freecnt_inc(vmd, npages); #if VM_NRESERVLEVEL > 0 - if (vm_reserv_reclaim_contig(domain, npages, low, + if ((req & VM_ALLOC_NORECLAIM) == 0 && + vm_reserv_reclaim_contig(domain, npages, low, high, alignment, boundary)) goto again; #endif From nobody Thu Nov 11 19:52:29 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 276E9185B52C; Thu, 11 Nov 2021 19:52:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqsnV0VH8z4gkv; Thu, 11 Nov 2021 19:52:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5F40123AA; Thu, 11 Nov 2021 19:52:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ABJqTRt089956; Thu, 11 Nov 2021 19:52:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ABJqTBG089955; Thu, 11 Nov 2021 19:52:29 GMT (envelope-from git) Date: Thu, 11 Nov 2021 19:52:29 GMT Message-Id: <202111111952.1ABJqTBG089955@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: 811d05449bea - main - vm_page_alloc.9: Document VM_ALLOC_NORECLAIM List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 811d05449bea1b3a6f0206afb4866623569071c7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=811d05449bea1b3a6f0206afb4866623569071c7 commit 811d05449bea1b3a6f0206afb4866623569071c7 Author: Mark Johnston AuthorDate: 2021-11-11 19:36:30 +0000 Commit: Mark Johnston CommitDate: 2021-11-11 19:52:00 +0000 vm_page_alloc.9: Document VM_ALLOC_NORECLAIM MFC after: 2 weeks Sponsored by: The FreeBSD Foundation --- share/man/man9/vm_page_alloc.9 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/share/man/man9/vm_page_alloc.9 b/share/man/man9/vm_page_alloc.9 index 1b587339b0cd..95463483c25c 100644 --- a/share/man/man9/vm_page_alloc.9 +++ b/share/man/man9/vm_page_alloc.9 @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 17, 2021 +.Dd November 11, 2021 .Dt VM_PAGE_ALLOC 9 .Os .Sh NAME @@ -315,6 +315,16 @@ If this flag is specified, the .Dq noobj variants will return zeroed pages. The other allocator interfaces ignore this flag. +.It Dv VM_ALLOC_NORECLAIM +If this flag is specified and the request can not be immediately satisfied, +the allocator will not attempt to break superpage reservations to satisfy the +allocation. +This may be useful when the overhead of scanning the reservation queue +outweighs the cost of a failed allocation. +This flag may be used only with the +.Dq contig +variants, and must not be specified in combination with +.Dv VM_ALLOC_WAITOK . .It Dv VM_ALLOC_COUNT(n) Hint that at least .Fa n From nobody Thu Nov 11 20:11:50 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 61CC0183DE81; Thu, 11 Nov 2021 20:11:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HqtCp2LWlz4nYJ; Thu, 11 Nov 2021 20:11:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3154B12900; Thu, 11 Nov 2021 20:11:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ABKBo4E014019; Thu, 11 Nov 2021 20:11:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ABKBonm014018; Thu, 11 Nov 2021 20:11:50 GMT (envelope-from git) Date: Thu, 11 Nov 2021 20:11:50 GMT Message-Id: <202111112011.1ABKBonm014018@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: e38717c1282f - main - Fix regression to verbose behavior introduced in 68bff4a07e. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e38717c1282f8bc8b16389839bea015359413df8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=e38717c1282f8bc8b16389839bea015359413df8 commit e38717c1282f8bc8b16389839bea015359413df8 Author: Kirk McKusick AuthorDate: 2021-11-11 20:10:28 +0000 Commit: Kirk McKusick CommitDate: 2021-11-11 20:11:25 +0000 Fix regression to verbose behavior introduced in 68bff4a07e. Reported by: Brad Davis (brd) Reviewed by: Kristof Provost (kp) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D32736 Sponsored by: Netflix --- sbin/geom/core/geom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/geom/core/geom.c b/sbin/geom/core/geom.c index 2e0d8683df49..0202be9a063e 100644 --- a/sbin/geom/core/geom.c +++ b/sbin/geom/core/geom.c @@ -445,7 +445,7 @@ set_flags(struct g_command *cmd) { unsigned flags = 0; - if ((cmd->gc_flags & G_FLAG_VERBOSE) != 0) + if ((cmd->gc_flags & G_FLAG_VERBOSE) != 0 && verbose) flags |= G_FLAG_VERBOSE; return (flags); From nobody Thu Nov 11 22:45:23 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 12C78184533D; Thu, 11 Nov 2021 22:45:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hqxd004FVz3shK; Thu, 11 Nov 2021 22:45:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D71A714829; Thu, 11 Nov 2021 22:45:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ABMjNUN016901; Thu, 11 Nov 2021 22:45:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ABMjNoB016900; Thu, 11 Nov 2021 22:45:23 GMT (envelope-from git) Date: Thu, 11 Nov 2021 22:45:23 GMT Message-Id: <202111112245.1ABMjNoB016900@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: 522a2aa7613a - main - Drop "All rights reserved" from a Netflix copyright. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 522a2aa7613aa43f4d3bb5bdd1d87f966304be34 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=522a2aa7613aa43f4d3bb5bdd1d87f966304be34 commit 522a2aa7613aa43f4d3bb5bdd1d87f966304be34 Author: John Baldwin AuthorDate: 2021-11-11 22:41:16 +0000 Commit: John Baldwin CommitDate: 2021-11-11 22:41:16 +0000 Drop "All rights reserved" from a Netflix copyright. Reviewed by: imp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D32778 --- sys/opencrypto/ktls_ocf.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/opencrypto/ktls_ocf.c b/sys/opencrypto/ktls_ocf.c index 3b944e302a8d..0fdec6f6d139 100644 --- a/sys/opencrypto/ktls_ocf.c +++ b/sys/opencrypto/ktls_ocf.c @@ -2,7 +2,6 @@ * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2019 Netflix Inc. - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From nobody Thu Nov 11 23:48:01 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3FF8A183A559; Thu, 11 Nov 2021 23:48:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hqz1G19ZWz4h1p; Thu, 11 Nov 2021 23:48:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 080B615494; Thu, 11 Nov 2021 23:48:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ABNm1v8096625; Thu, 11 Nov 2021 23:48:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ABNm1xf096624; Thu, 11 Nov 2021 23:48:01 GMT (envelope-from git) Date: Thu, 11 Nov 2021 23:48:01 GMT Message-Id: <202111112348.1ABNm1xf096624@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: 44744f75386e - main - nfscl: Add a LayoutError RPC for NFSv4.2 pNFS mounts List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 44744f75386e2102584acbca24fbe67de16051ca Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=44744f75386e2102584acbca24fbe67de16051ca commit 44744f75386e2102584acbca24fbe67de16051ca Author: Rick Macklem AuthorDate: 2021-11-11 23:43:58 +0000 Commit: Rick Macklem CommitDate: 2021-11-11 23:43:58 +0000 nfscl: Add a LayoutError RPC for NFSv4.2 pNFS mounts If a pNFS server's DS runs out of disk space, it replies NFSERR_NOSPC to the client doing writing. For the Linux client, it then sends a LayoutError RPC to the MDS server to tell it about the error. This patch adds the same to the FreeBSD NFSv4.2 pNFS client, to maintain Linux compatible behaviour, particlularily for non-FreeBSD pNFS servers. MFC after: 2 weeks --- sys/fs/nfs/nfs_commonsubs.c | 6 +++-- sys/fs/nfs/nfsport.h | 9 ++++--- sys/fs/nfs/nfsproto.h | 5 +++- sys/fs/nfsclient/nfs_clrpcops.c | 56 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 70 insertions(+), 6 deletions(-) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 073da425c20c..d3d572fe5a90 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -215,7 +215,7 @@ static struct nfsrv_lughash *nfsgroupnamehash; static int nfs_bigreply[NFSV42_NPROCS] = { 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 1, 0, 0, 0 }; + 1, 0, 0, 1, 0, 0, 0, 0 }; /* local functions */ static int nfsrv_skipace(struct nfsrv_descript *nd, int *acesizep); @@ -301,6 +301,7 @@ static struct { { NFSV4OP_BINDCONNTOSESS, 1, "BindConSess", 11, }, { NFSV4OP_LOOKUP, 5, "LookupOpen", 10, }, { NFSV4OP_DEALLOCATE, 2, "Deallocate", 10, }, + { NFSV4OP_LAYOUTERROR, 1, "LayoutError", 11, }, }; /* @@ -309,7 +310,8 @@ static struct { static int nfs_bigrequest[NFSV42_NPROCS] = { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 + 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0 }; /* diff --git a/sys/fs/nfs/nfsport.h b/sys/fs/nfs/nfsport.h index 64ba4d48b3f1..5dcce15f7f64 100644 --- a/sys/fs/nfs/nfsport.h +++ b/sys/fs/nfs/nfsport.h @@ -421,10 +421,13 @@ /* Do an NFSv4.2 Deallocate. */ #define NFSPROC_DEALLOCATE 67 +/* Do an NFSv4.2 LayoutError. */ +#define NFSPROC_LAYOUTERROR 68 + /* * Must be defined as one higher than the last NFSv4.2 Proc# above. */ -#define NFSV42_NPROCS 68 +#define NFSV42_NPROCS 69 #endif /* NFS_V3NPROCS */ @@ -453,7 +456,7 @@ struct nfsstatsv1 { uint64_t readlink_bios; uint64_t biocache_readdirs; uint64_t readdir_bios; - uint64_t rpccnt[NFSV42_NPROCS + 12]; + uint64_t rpccnt[NFSV42_NPROCS + 11]; uint64_t rpcretries; uint64_t srvrpccnt[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; uint64_t reserved_0; @@ -518,7 +521,7 @@ struct nfsstatsov1 { uint64_t readlink_bios; uint64_t biocache_readdirs; uint64_t readdir_bios; - uint64_t rpccnt[NFSV42_NPROCS + 1]; + uint64_t rpccnt[NFSV42_NPROCS]; uint64_t rpcretries; uint64_t srvrpccnt[NFSV42_PURENOPS + NFSV4OP_FAKENOPS]; uint64_t reserved_0; diff --git a/sys/fs/nfs/nfsproto.h b/sys/fs/nfs/nfsproto.h index 7ac7cdc3bacf..968cc6a41cc3 100644 --- a/sys/fs/nfs/nfsproto.h +++ b/sys/fs/nfs/nfsproto.h @@ -402,10 +402,13 @@ /* Do an NFSv4.2 Deallocate. */ #define NFSPROC_DEALLOCATE 67 +/* Do an NFSv4.2 LayoutError. */ +#define NFSPROC_LAYOUTERROR 68 + /* * Must be defined as one higher than the last NFSv4.2 Proc# above. */ -#define NFSV42_NPROCS 68 +#define NFSV42_NPROCS 69 #endif /* NFS_V3NPROCS */ diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index f74493debd7c..f520743e8c32 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -149,6 +149,9 @@ static int nfsrpc_locku(struct nfsrv_descript *, struct nfsmount *, u_int32_t, struct ucred *, NFSPROC_T *, int); static int nfsrpc_setaclrpc(vnode_t, struct ucred *, NFSPROC_T *, struct acl *, nfsv4stateid_t *, void *); +static int nfsrpc_layouterror(struct nfsmount *, uint8_t *, int, uint64_t, + uint64_t, nfsv4stateid_t *, struct ucred *, NFSPROC_T *, uint32_t, + uint32_t, char *); static int nfsrpc_getlayout(struct nfsmount *, vnode_t, struct nfsfh *, int, uint32_t, uint32_t *, nfsv4stateid_t *, uint64_t, struct nfscllayout **, struct ucred *, NFSPROC_T *); @@ -5705,6 +5708,44 @@ nfsmout: return (error); } +/* + * Do the NFSv4.2 LayoutError. + */ +static int +nfsrpc_layouterror(struct nfsmount *nmp, uint8_t *fh, int fhlen, uint64_t offset, + uint64_t len, nfsv4stateid_t *stateidp, struct ucred *cred, NFSPROC_T *p, + uint32_t stat, uint32_t op, char *devid) +{ + uint32_t *tl; + struct nfsrv_descript nfsd, *nd = &nfsd; + int error; + + nfscl_reqstart(nd, NFSPROC_LAYOUTERROR, nmp, fh, fhlen, NULL, NULL, + 0, 0); + NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER + NFSX_STATEID + + NFSX_V4DEVICEID + 3 * NFSX_UNSIGNED); + txdr_hyper(offset, tl); tl += 2; + txdr_hyper(len, tl); tl += 2; + *tl++ = txdr_unsigned(stateidp->seqid); + *tl++ = stateidp->other[0]; + *tl++ = stateidp->other[1]; + *tl++ = stateidp->other[2]; + *tl++ = txdr_unsigned(1); + NFSBCOPY(devid, tl, NFSX_V4DEVICEID); + tl += (NFSX_V4DEVICEID / NFSX_UNSIGNED); + *tl++ = txdr_unsigned(stat); + *tl = txdr_unsigned(op); + nd->nd_flag |= ND_USEGSSNAME; + error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, NULL, p, cred, + NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL); + if (error != 0) + return (error); + if (nd->nd_repstat != 0) + error = nd->nd_repstat; + m_freem(nd->nd_mrep); + return (error); +} + /* * Acquire a layout and devinfo, if possible. The caller must have acquired * a reference count on the nfsclclient structure before calling this. @@ -6044,6 +6085,7 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, size_t iovlen = 0; off_t offs = 0; ssize_t resid = 0; + uint32_t op; if (!NFSHASPNFS(nmp) || nfscl_enablecallb == 0 || nfs_numnfscbd == 0 || (np->n_flag & NNOLAYOUT) != 0) @@ -6223,6 +6265,20 @@ nfscl_doiods(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, NFSLOCKMNT(nmp); nmp->nm_state |= NFSSTA_OPENMODE; NFSUNLOCKMNT(nmp); + } else if ((error == NFSERR_NOSPC || + error == NFSERR_IO || error == NFSERR_NXIO) && + nmp->nm_minorvers == NFSV42_MINORVERSION) { + if (docommit != 0) + op = NFSV4OP_COMMIT; + else if (rwaccess == NFSV4OPEN_ACCESSREAD) + op = NFSV4OP_READ; + else + op = NFSV4OP_WRITE; + nfsrpc_layouterror(nmp, np->n_fhp->nfh_fh, + np->n_fhp->nfh_len, off, xfer, + &layp->nfsly_stateid, newcred, p, error, op, + dip->nfsdi_deviceid); + error = EIO; } else error = EIO; if (error == 0) From nobody Fri Nov 12 03:25:06 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C7617183A4B9; Fri, 12 Nov 2021 03:25:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hr3qk59J6z4ph0; Fri, 12 Nov 2021 03:25:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 92B22180F5; Fri, 12 Nov 2021 03:25:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AC3P6Pp089928; Fri, 12 Nov 2021 03:25:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AC3P6Tc089927; Fri, 12 Nov 2021 03:25:06 GMT (envelope-from git) Date: Fri, 12 Nov 2021 03:25:06 GMT Message-Id: <202111120325.1AC3P6Tc089927@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 3332f1b444d4 - main - wpa: Remove duplicate options definitions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3332f1b444d4a73238e9f59cca27bfc95fe936bd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=3332f1b444d4a73238e9f59cca27bfc95fe936bd commit 3332f1b444d4a73238e9f59cca27bfc95fe936bd Author: Cy Schubert AuthorDate: 2021-11-09 00:16:46 +0000 Commit: Cy Schubert CommitDate: 2021-11-12 03:03:05 +0000 wpa: Remove duplicate options definitions Global options are defined in usr.sbin/wpa/Makefile.inc. Those in usr.sbin/wpa/src/crypto/Makefile are duplicates of those found above. Remove them. MFC after: 1 week --- usr.sbin/wpa/src/crypto/Makefile | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/usr.sbin/wpa/src/crypto/Makefile b/usr.sbin/wpa/src/crypto/Makefile index c95834279c21..eede671aa7db 100644 --- a/usr.sbin/wpa/src/crypto/Makefile +++ b/usr.sbin/wpa/src/crypto/Makefile @@ -139,20 +139,6 @@ SRCS+= dh_groups.c .endif .if ${MK_WPA_SUPPLICANT_EAPOL} != "no" -CFLAGS+=-DCONFIG_WPS \ - -DCONFIG_HS20 \ - -DCONFIG_INTERWORKING \ - -DEAP_GTC \ - -DEAP_LEAP \ - -DEAP_MD5 \ - -DEAP_MSCHAPv2 \ - -DEAP_OTP \ - -DEAP_PEAP \ - -DEAP_PSK \ - -DEAP_TLS \ - -DEAP_TTLS \ - -DEAP_WSC \ - -DIEEE8021X_EAPOL SRCS+= ms_funcs.c .endif From nobody Fri Nov 12 03:25:07 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 18148183A3BD; Fri, 12 Nov 2021 03:25:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hr3ql6YBkz4pdn; Fri, 12 Nov 2021 03:25:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5DF0180F6; Fri, 12 Nov 2021 03:25:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AC3P7EE089959; Fri, 12 Nov 2021 03:25:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AC3P7Xf089958; Fri, 12 Nov 2021 03:25:07 GMT (envelope-from git) Date: Fri, 12 Nov 2021 03:25:07 GMT Message-Id: <202111120325.1AC3P7Xf089958@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 96e2ac9c48ba - main - Revert "wpa: Fix WITHOUT_CRYPT build" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 96e2ac9c48baae6a352eb5574af87f81e01ff021 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=96e2ac9c48baae6a352eb5574af87f81e01ff021 commit 96e2ac9c48baae6a352eb5574af87f81e01ff021 Author: Cy Schubert AuthorDate: 2021-11-09 22:17:01 +0000 Commit: Cy Schubert CommitDate: 2021-11-12 03:03:05 +0000 Revert "wpa: Fix WITHOUT_CRYPT build" This reverts commit a30e8044aa4753858c189f3384dae2b2f25a150b. WITHOUT_OPENSSL build is a subset of WITHOUT_CRYPT build. It was incorrect to label this patch as fixing WITHOUT_CRYPT when in fact it fixes WITHOUT_OPENSSL. The build failure will be addressed in a fix for WITHOUT_OPENSSL build. MFC after: 1 week --- usr.sbin/wpa/Makefile.inc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/usr.sbin/wpa/Makefile.inc b/usr.sbin/wpa/Makefile.inc index e43a6f539d92..915b5312f02f 100644 --- a/usr.sbin/wpa/Makefile.inc +++ b/usr.sbin/wpa/Makefile.inc @@ -56,6 +56,7 @@ CFLAGS+=-DCONFIG_TDLS CFLAGS+=-DCONFIG_TERMINATE_ONLASTIF CFLAGS+=-DCONFIG_TLS=openssl CFLAGS+=-DCONFIG_MATCH_IFACE +CFLAGS+=-DCONFIG_PASN CFLAGS+=-DCONFIG_PTKSA_CACHE CFLAGS+=-DEAP_SERVER CFLAGS+=-DEAP_SERVER_GTC @@ -90,10 +91,6 @@ NEED_AES_ENCBLOCK=y NEED_AES_OMAC1=y .endif -.if ${MK_CRYPT} != "no" -CFLAGS+=-DCONFIG_PASN -.endif - .if !empty(CFLAGS:M*-DEAP_AKA) NEED_SIM_COMMON=y NEED_AES_CBC=y From nobody Fri Nov 12 03:25:08 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2F4D8183A521; Fri, 12 Nov 2021 03:25:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hr3qn0HSzz4pdr; Fri, 12 Nov 2021 03:25:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CFA8118428; Fri, 12 Nov 2021 03:25:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AC3P8Er089983; Fri, 12 Nov 2021 03:25:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AC3P8PR089982; Fri, 12 Nov 2021 03:25:08 GMT (envelope-from git) Date: Fri, 12 Nov 2021 03:25:08 GMT Message-Id: <202111120325.1AC3P8PR089982@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: ba5de3c2b3b8 - main - wpa: Fix WITHOUT_OPENSSL build List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ba5de3c2b3b84fd547ddcc0e678a013e5df87db1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=ba5de3c2b3b84fd547ddcc0e678a013e5df87db1 commit ba5de3c2b3b84fd547ddcc0e678a013e5df87db1 Author: Cy Schubert AuthorDate: 2021-11-09 22:52:44 +0000 Commit: Cy Schubert CommitDate: 2021-11-12 03:03:05 +0000 wpa: Fix WITHOUT_OPENSSL build PR: 259517 Reported by: emaste, FreeBSD Build Option Survey https://callfortesting.org/results/bos-2021-11-04/ Fixes: c1d255d3ffdbe447de3ab875bf4e7d7accc5bfc5 MFC after: 1 week --- usr.sbin/wpa/Makefile.inc | 5 ++++- usr.sbin/wpa/src/tls/Makefile | 9 +++++---- usr.sbin/wpa/wpa_supplicant/Makefile | 5 ++++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/usr.sbin/wpa/Makefile.inc b/usr.sbin/wpa/Makefile.inc index 915b5312f02f..5c5a6b403225 100644 --- a/usr.sbin/wpa/Makefile.inc +++ b/usr.sbin/wpa/Makefile.inc @@ -56,7 +56,6 @@ CFLAGS+=-DCONFIG_TDLS CFLAGS+=-DCONFIG_TERMINATE_ONLASTIF CFLAGS+=-DCONFIG_TLS=openssl CFLAGS+=-DCONFIG_MATCH_IFACE -CFLAGS+=-DCONFIG_PASN CFLAGS+=-DCONFIG_PTKSA_CACHE CFLAGS+=-DEAP_SERVER CFLAGS+=-DEAP_SERVER_GTC @@ -91,6 +90,10 @@ NEED_AES_ENCBLOCK=y NEED_AES_OMAC1=y .endif +.if ${MK_OPENSSL} != "no" +CFLAGS+=-DCONFIG_PASN +.endif + .if !empty(CFLAGS:M*-DEAP_AKA) NEED_SIM_COMMON=y NEED_AES_CBC=y diff --git a/usr.sbin/wpa/src/tls/Makefile b/usr.sbin/wpa/src/tls/Makefile index e5fdf96444d6..fbb57b9c4c10 100644 --- a/usr.sbin/wpa/src/tls/Makefile +++ b/usr.sbin/wpa/src/tls/Makefile @@ -29,13 +29,14 @@ SRCS+= asn1.c \ tlsv1_server_read.c \ tlsv1_server_write.c \ x509v3.c -.endif -.endif CFLAGS+=-DCONFIG_INTERNAL_LIBTOMMATH \ - -DCONFIG_CRYPTO_INTERNAL \ - -DCONFIG_TLSV11 \ + -DCONFIG_CRYPTO_INTERNAL +.else +CFLAGS+=-DCONFIG_TLSV11 \ -DCONFIG_TLSV12 +.endif +.endif # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/wpa_supplicant/Makefile b/usr.sbin/wpa/wpa_supplicant/Makefile index 8e7edfcf7720..fb045f804977 100644 --- a/usr.sbin/wpa/wpa_supplicant/Makefile +++ b/usr.sbin/wpa/wpa_supplicant/Makefile @@ -27,7 +27,6 @@ SRCS= bss.c \ notify.c \ op_classes.c \ offchannel.c \ - pasn_supplicant.c \ robust_av.c \ rrm.c \ scan.c \ @@ -37,6 +36,10 @@ SRCS= bss.c \ wpa_supplicant.c \ wpas_glue.c +.if ${MK_OPENSSL} != "no" +SRCS+= pasn_supplicant.c +.endif + MAN= wpa_supplicant.8 wpa_supplicant.conf.5 .if ${MK_EXAMPLES} != "no" From nobody Fri Nov 12 03:25:09 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 21449183A3D3; Fri, 12 Nov 2021 03:25:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hr3qp2l4dz4pnD; Fri, 12 Nov 2021 03:25:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CA3E18139; Fri, 12 Nov 2021 03:25:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AC3P9sr090007; Fri, 12 Nov 2021 03:25:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AC3P9jP090006; Fri, 12 Nov 2021 03:25:09 GMT (envelope-from git) Date: Fri, 12 Nov 2021 03:25:09 GMT Message-Id: <202111120325.1AC3P9jP090006@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: c9516b83c14f - main - wpa: Fix WITHOUT_WPA_SUPPLICANT_EAPOL build List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c9516b83c14f2dcec57bd175e418c152a0cec947 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=c9516b83c14f2dcec57bd175e418c152a0cec947 commit c9516b83c14f2dcec57bd175e418c152a0cec947 Author: Cy Schubert AuthorDate: 2021-11-10 03:05:03 +0000 Commit: Cy Schubert CommitDate: 2021-11-12 03:03:05 +0000 wpa: Fix WITHOUT_WPA_SUPPLICANT_EAPOL build Reported by: FreeBSD Build Option Survey https://callfortesting.org/results/bos-2021-11-04/ Fixes: c1d255d3ffdbe447de3ab875bf4e7d7accc5bfc5 MFC after: 1 week --- usr.sbin/wpa/Makefile.inc | 12 ++++++------ usr.sbin/wpa/src/ap/Makefile | 9 ++++++--- usr.sbin/wpa/src/crypto/Makefile | 2 -- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/usr.sbin/wpa/Makefile.inc b/usr.sbin/wpa/Makefile.inc index 5c5a6b403225..5ce7dee4d2c5 100644 --- a/usr.sbin/wpa/Makefile.inc +++ b/usr.sbin/wpa/Makefile.inc @@ -42,11 +42,6 @@ CFLAGS+=-DCONFIG_IEEE80211R CFLAGS+=-DCONFIG_IEEE80211W CFLAGS+=-DTLS_DEFAULT_CIPHERS=\"DEFAULT:!EXP:!LOW\" CFLAGS+=-DCONFIG_DEBUG_SYSLOG -CFLAGS+=-DCONFIG_WPS -CFLAGS+=-DCONFIG_WPS2 -CFLAGS+=-DCONFIG_WPS_UPNP -CFLAGS+=-DCONFIG_WPS_OOB -CFLAGS+=-DCONFIG_INTERWORKING CFLAGS+=-DPKCS12_FUNCS CFLAGS+=-DCONFIG_GAS CFLAGS+=-DCONFIG_PEERKEY @@ -84,7 +79,12 @@ CFLAGS+=-DCONFIG_HS20 \ -DEAP_TLS \ -DEAP_TTLS \ -DEAP_WSC \ - -DIEEE8021X_EAPOL + -DIEEE8021X_EAPOL \ + -DCONFIG_INTERWORKING \ + -DCONFIG_WPS \ + -DCONFIG_WPS2 \ + -DCONFIG_WPS_UPNP \ + -DCONFIG_WPS_OOB NEED_AES_EAX=y NEED_AES_ENCBLOCK=y NEED_AES_OMAC1=y diff --git a/usr.sbin/wpa/src/ap/Makefile b/usr.sbin/wpa/src/ap/Makefile index 162b8b5444aa..801f45fca8a6 100644 --- a/usr.sbin/wpa/src/ap/Makefile +++ b/usr.sbin/wpa/src/ap/Makefile @@ -20,9 +20,7 @@ SRCS= accounting.c \ dfs.c \ drv_callbacks.c \ eap_user_db.c \ - gas_serv.c \ hostapd.c \ - hs20.c \ ieee802_11_auth.c \ ieee802_11_ht.c \ ieee802_11_shared.c \ @@ -43,8 +41,13 @@ SRCS= accounting.c \ wnm_ap.c \ wpa_auth.c \ wpa_auth_glue.c \ - wpa_auth_ie.c \ + wpa_auth_ie.c + +.if ${MK_WPA_SUPPLICANT_EAPOL} != "no" +SRCS+= gas_serv.c \ + hs20.c \ wps_hostapd.c +.endif CFLAGS+=-DHOSTAPD diff --git a/usr.sbin/wpa/src/crypto/Makefile b/usr.sbin/wpa/src/crypto/Makefile index eede671aa7db..d71b740bb816 100644 --- a/usr.sbin/wpa/src/crypto/Makefile +++ b/usr.sbin/wpa/src/crypto/Makefile @@ -138,9 +138,7 @@ SRCS+= dh_group5.c SRCS+= dh_groups.c .endif -.if ${MK_WPA_SUPPLICANT_EAPOL} != "no" SRCS+= ms_funcs.c -.endif CFLAGS+=-DCONFIG_CRYPTO_INTERNAL \ -DCONFIG_TLS_INTERNAL_CLIENT \ From nobody Fri Nov 12 12:55:18 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5442A185B6CC; Fri, 12 Nov 2021 12:55:26 +0000 (UTC) (envelope-from mike@karels.net) Received: from mail.karels.net (mail.karels.net [216.160.39.52]) by mx1.freebsd.org (Postfix) with ESMTP id 4HrJTn2XrVz4n5V; Fri, 12 Nov 2021 12:55:25 +0000 (UTC) (envelope-from mike@karels.net) Received: from mail.karels.net (localhost [127.0.0.1]) by mail.karels.net (8.16.1/8.16.1) with ESMTP id 1ACCtIFY027646; Fri, 12 Nov 2021 06:55:18 -0600 (CST) (envelope-from mike@karels.net) Received: from [10.0.2.130] ([10.0.1.1]) by mail.karels.net with ESMTPSA id 96M8OTZkjmH8awAA4+wvSQ (envelope-from ); Fri, 12 Nov 2021 06:55:18 -0600 From: Mike Karels To: rgrimes@freebsd.org Cc: Gleb Smirnoff , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 20d59403961d - main - kernel: deprecate Internet Class A/B/C Date: Fri, 12 Nov 2021 06:55:18 -0600 X-Mailer: MailMate (1.14r5818) Message-ID: <572EFCEA-C881-4442-9EAF-A06FF9B8CD6E@karels.net> In-Reply-To: <202111120112.1AC1CBTj061103@gndrsh.dnsmgr.net> References: <202111120112.1AC1CBTj061103@gndrsh.dnsmgr.net> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mail.karels.net id 1ACCtIFY027646 X-Rspamd-Queue-Id: 4HrJTn2XrVz4n5V X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of mike@karels.net designates 216.160.39.52 as permitted sender) smtp.mailfrom=mike@karels.net X-Spamd-Result: default: False [-1.11 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[mike]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:216.160.39.52]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[karels.net]; NEURAL_HAM_LONG(-0.97)[-0.973]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.16)[-0.159]; NEURAL_SPAM_SHORT(0.23)[0.226]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:209, ipnet:216.160.36.0/22, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N The review for this is now https://reviews.freebsd.org/D32951. On 11 Nov 2021, at 19:12, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> I?m going to top-post my reply to highlight this question: >> It is proposed to revert the change to the default mask when setting >> an Internet interface address without a mask, returning to the use of >> the Class A/B/C mask as the default. We would still warn if there >> was no mask supplied, except on loopback and point-to-point interfaces. > > I would not have the exception on loopback or P2P. I still don=E2=80=99t know of any use or significance of the mask on loop= back or P2P interfaces, so I don=E2=80=99t know of any reason to require a mas= k. >> Does anyone object, or otherwise have comments? > > Mostly. I=E2=80=99m not sure how to interpret this. Mike >> >> On 10 Nov 2021, at 10:38, Gleb Smirnoff wrote: >> >>> On Wed, Nov 10, 2021 at 09:36:03AM -0600, Mike Karels wrote: >>> M> > The new /24 default is no better than classes. The only differen= ce >>> M> > that classes maintained POLA and new default doesn't. For exampl= e, >>> M> > in my home network I have default router 10.0.0.1 and since it i= s >>> M> > class A network on my VMs and test boxes I can type >>> M> >>> M> > # ifconfig vtnet0 10.6.6.6 >>> M> >>> M> > and that is going to work. With this change no longer. >>> M> >>> M> I suspect that /8 is by far the minority these days, even with a >>> M> "Class A" net. I also use net 10 at home, and at the last several= jobs, >>> M> but it is subnetted in each case. I would peridically add an addr= ess, >>> M> forgetting a mask, only to find that a route for 10/8 isolated the= machine. >>> >>> The 10/8 can be used at home as a huge personal address space, just l= ike >>> a /64 IPv6 prefix. All addresses added without masks and everything w= orks. >>> >>> M> That said, my main objective was to deprecate usage without a mask= , and >>> M> to warn in that case. Both the kernel and ifconfig now warn when = a default >>> M> mask is used. In the discussion on freebsd-net and in the review,= the >>> M> main thought was that masks should be required. But it isn't prac= tical to >>> M> fail and return an error with no mask, at least not without a sign= ificant >>> M> period with warnings, or some systems would stop coming up on the = network. >>> M> >>> M> One reviewer was going to comment on the /24 default, but thought = it was >>> M> better than the previous. I'm open to hearing more opinions. >>> >>> Although I don't internally agree that we really need to police peopl= e to >>> always specify masks, I would make step forward and agree with that. = So, >>> let's do print loud warning on every attempt to set IP address withou= t a >>> mask. But I can not agree that change from class based guess to /24 i= s a >>> right thing to do. A proper deprecation process goes like this: >>> >>> Step 1: Print warning, don't change legacy behavior. >>> <... people adopt ...> >>> Step 2: Return error. Remove deprecated behavior. >>> >>> What we did is that we changed behavior together with warning. The ne= w >>> behavior is neither the legacy one nor the desired one, where mask is >>> a must. Look from a user perspective: for class C nothing changed, bu= t >>> changed for A and B. >>> >>> --=20 >>> Gleb Smirnoff >> >> > > --=20 > Rod Grimes rgrimes@free= bsd.org From nobody Fri Nov 12 14:33:14 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 36C0B1841995; Fri, 12 Nov 2021 14:33:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrLfg0g4Hz3vTV; Fri, 12 Nov 2021 14:33:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA8A520CF3; Fri, 12 Nov 2021 14:33:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ACEXEeq080631; Fri, 12 Nov 2021 14:33:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ACEXECH080630; Fri, 12 Nov 2021 14:33:14 GMT (envelope-from git) Date: Fri, 12 Nov 2021 14:33:14 GMT Message-Id: <202111121433.1ACEXECH080630@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Sergey A. Osokin" Subject: git: b39a93b18ef1 - main - ktls.4: fix openssl-devel port name List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osa X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b39a93b18ef17dcb1897186b1f01999337b9f8b9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by osa (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b39a93b18ef17dcb1897186b1f01999337b9f8b9 commit b39a93b18ef17dcb1897186b1f01999337b9f8b9 Author: Sergey A. Osokin AuthorDate: 2021-11-12 14:31:48 +0000 Commit: Sergey A. Osokin CommitDate: 2021-11-12 14:31:48 +0000 ktls.4: fix openssl-devel port name PR: 259630 --- share/man/man4/ktls.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/ktls.4 b/share/man/man4/ktls.4 index e1e219a12603..876e9fa57ac0 100644 --- a/share/man/man4/ktls.4 +++ b/share/man/man4/ktls.4 @@ -231,7 +231,7 @@ mode. OpenSSL 3.0 and later include support for .Nm . The -.Fa devel/openssl +.Fa security/openssl-devel port may also be built with support for .Nm by enabling the From nobody Fri Nov 12 15:51:31 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 10C07184BB71; Fri, 12 Nov 2021 15:51:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrNNz728pz4stq; Fri, 12 Nov 2021 15:51:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C770822239; Fri, 12 Nov 2021 15:51:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ACFpVSM086505; Fri, 12 Nov 2021 15:51:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ACFpVxE086504; Fri, 12 Nov 2021 15:51:31 GMT (envelope-from git) Date: Fri, 12 Nov 2021 15:51:31 GMT Message-Id: <202111121551.1ACFpVxE086504@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 0359e7a5e49f - main - net: sprinkle __predict_false in ip_input on error conditions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0359e7a5e49f3fa8f9e87923a0830239d3372132 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=0359e7a5e49f3fa8f9e87923a0830239d3372132 commit 0359e7a5e49f3fa8f9e87923a0830239d3372132 Author: Mateusz Guzik AuthorDate: 2021-11-10 17:15:51 +0000 Commit: Mateusz Guzik CommitDate: 2021-11-12 15:40:28 +0000 net: sprinkle __predict_false in ip_input on error conditions While here rearrange the RVSP check to inspect proto first and avoid evaluating V_rsvp in the common case to begin with (most notably avoid the expensive read). Reviewed by: glebius Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32929 --- sys/netinet/ip_input.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index dc122dd62e99..be04e27b8224 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -476,28 +476,31 @@ ip_input(struct mbuf *m) IPSTAT_INC(ips_total); - if (m->m_pkthdr.len < sizeof(struct ip)) + if (__predict_false(m->m_pkthdr.len < sizeof(struct ip))) goto tooshort; - if (m->m_len < sizeof (struct ip) && - (m = m_pullup(m, sizeof (struct ip))) == NULL) { - IPSTAT_INC(ips_toosmall); - return; + if (m->m_len < sizeof(struct ip)) { + m = m_pullup(m, sizeof(struct ip)); + if (__predict_false(m == NULL)) { + IPSTAT_INC(ips_toosmall); + return; + } } ip = mtod(m, struct ip *); - if (ip->ip_v != IPVERSION) { + if (__predict_false(ip->ip_v != IPVERSION)) { IPSTAT_INC(ips_badvers); goto bad; } hlen = ip->ip_hl << 2; - if (hlen < sizeof(struct ip)) { /* minimum header length */ + if (__predict_false(hlen < sizeof(struct ip))) { /* minimum header length */ IPSTAT_INC(ips_badhlen); goto bad; } if (hlen > m->m_len) { - if ((m = m_pullup(m, hlen)) == NULL) { + m = m_pullup(m, hlen); + if (__predict_false(m == NULL)) { IPSTAT_INC(ips_badhlen); return; } @@ -525,7 +528,7 @@ ip_input(struct mbuf *m) sum = in_cksum(m, hlen); } } - if (sum) { + if (__predict_false(sum)) { IPSTAT_INC(ips_badsum); goto bad; } @@ -537,7 +540,7 @@ ip_input(struct mbuf *m) #endif ip_len = ntohs(ip->ip_len); - if (ip_len < hlen) { + if (__predict_false(ip_len < hlen)) { IPSTAT_INC(ips_badlen); goto bad; } @@ -548,7 +551,7 @@ ip_input(struct mbuf *m) * Trim mbufs if longer than we expect. * Drop packet if shorter than we expect. */ - if (m->m_pkthdr.len < ip_len) { + if (__predict_false(m->m_pkthdr.len < ip_len)) { tooshort: IPSTAT_INC(ips_tooshort); goto bad; @@ -650,7 +653,7 @@ passin: * anywhere else. Also checks if the rsvp daemon is running before * grabbing the packet. */ - if (V_rsvp_on && ip->ip_p==IPPROTO_RSVP) + if (ip->ip_p == IPPROTO_RSVP && V_rsvp_on) goto ours; /* From nobody Fri Nov 12 16:19:04 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 70558185A46B for ; Fri, 12 Nov 2021 16:19:13 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrP0w2hW7z3K9t for ; Fri, 12 Nov 2021 16:19:12 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f42.google.com with SMTP id r8so16358504wra.7 for ; Fri, 12 Nov 2021 08:19:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Ng4Ue0STk10t74mE5LP3ydSuBg6nouxJSGt0TgAw/p0=; b=XdVV9N0rHjK0HcnU0BPOwPlcxfrXLzw95j/Y80NlB1UBVn3PY+5+6P78GWfggXBgqL ZLTK3rXxFa5tm0E6F1NmUbc7KhxQPPeJEk9zUqoAed24Yf1otnBu5aJSztEaOvZyeKot qGeUvc9vqHOAZpMlstlrgaUduAu0FvhbKAJrt/zSIBeQ0OWA3Y0tYkObx9nycsDzpM9M v154esNcZPfd0SroX5Bi6VTK5R5OCxbUY/sH+KWqXnX/1FD6LUjn38JPj1PWQT8vAsRJ NT3FNi0yZ1XAKhgT/V+oGTfwTBlzGaIyBF4tCjq9OpqoU86zhs5gPLp3ivSWH1BzcJxF oZQw== X-Gm-Message-State: AOAM531Uy3qZoByrVbwCckMARIXi9vO2A5SWQCBGiQOFIASwr1AoXiMZ WMghHL5CDQ43wsQCbqMh6ysM5ch0tex3UQ== X-Google-Smtp-Source: ABdhPJyrs2wArWM9GxlpZDKUy0HqoSWHjugLTzCVVTwuw0tp6lfvlWgjQFLxfFtcAnhdc4JWlH0atg== X-Received: by 2002:a5d:6488:: with SMTP id o8mr19202205wri.348.1636733945603; Fri, 12 Nov 2021 08:19:05 -0800 (PST) Received: from smtpclient.apple (global-5-141.nat-2.net.cam.ac.uk. [131.111.5.141]) by smtp.gmail.com with ESMTPSA id y7sm6001387wrw.55.2021.11.12.08.19.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Nov 2021 08:19:05 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: b8d60729deef - main - tcp: Congestion control cleanup. From: Jessica Clarke In-Reply-To: <202111111131.1ABBVH6s017371@gitrepo.freebsd.org> Date: Fri, 12 Nov 2021 16:19:04 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202111111131.1ABBVH6s017371@gitrepo.freebsd.org> To: Randall Stewart X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4HrP0w2hW7z3K9t X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.221.42 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-2.41 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.91)[-0.912]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-0.999]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.42:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.42:from]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On 11 Nov 2021, at 11:31, Randall Stewart wrote: >=20 > The branch main has been updated by rrs: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Db8d60729deefa0bd13e6a395fcab4928= e6e10445 >=20 > commit b8d60729deefa0bd13e6a395fcab4928e6e10445 > Author: Randall Stewart > AuthorDate: 2021-11-11 11:28:18 +0000 > Commit: Randall Stewart > CommitDate: 2021-11-11 11:28:18 +0000 >=20 > tcp: Congestion control cleanup. >=20 > NOTE: HEADS UP read the note below if your kernel config is not = including GENERIC!! >=20 > This patch does a bit of cleanup on TCP congestion control modules. = There were some rather > interesting surprises that one could get i.e. where you use a = socket option to change > from one CC (say cc_cubic) to another CC (say cc_vegas) and you = could in theory get > a memory failure and end up on cc_newreno. This is not what one = would expect. The > new code fixes this by requiring a cc_data_sz() function so we can = malloc with M_WAITOK > and pass in to the init function preallocated memory. The CC init = is expected in this > case *not* to fail but if it does and a module does break the > "no fail with memory given" contract we do fall back to the CC that = was in place at the time. >=20 > This also fixes up a set of common newreno utilities that can be = shared amongst other > CC modules instead of the other CC modules reaching into newreno = and executing > what they think is a "common and understood" function. Lets put = these functions in > cc.c and that way we have a common place that is easily findable by = future developers or > bug fixers. This also allows newreno to evolve and grow support for = its features i.e. ABE > and HYSTART++ without having to dance through hoops for other CC = modules, instead > both newreno and the other modules just call into the common = functions if they desire > that behavior or roll there own if that makes more sense. >=20 > Note: This commit changes the kernel configuration!! If you are not = using GENERIC in > some form you must add a CC module option (one of CC_NEWRENO, = CC_VEGAS, CC_CUBIC, > CC_CDG, CC_CHD, CC_DCTCP, CC_HTCP, CC_HD). You can have more than = one defined > as well if you desire. Note that if you create a kernel = configuration that does not > define a congestion control module and includes INET or INET6 the = kernel compile will > break. Also you need to define a default, generic adds 'options = CC_DEFAULT=3D\"newreno\" > but you can specify any string that represents the name of the CC = module (same names > that show up in the CC module list under net.inet.tcp.cc). If you = fail to add the > options CC_DEFAULT in your kernel configuration the kernel build = will also break. Not doing so breaks tinderbox, as well as configs not hooks up to tinderbox. I don=E2=80=99t think this is acceptable. Jess From nobody Fri Nov 12 16:34:37 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AED29183AD62; Fri, 12 Nov 2021 16:34:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrPLj4F0Hz3PsK; Fri, 12 Nov 2021 16:34:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D44022749; Fri, 12 Nov 2021 16:34:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ACGYbm9040968; Fri, 12 Nov 2021 16:34:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ACGYbQl040967; Fri, 12 Nov 2021 16:34:37 GMT (envelope-from git) Date: Fri, 12 Nov 2021 16:34:37 GMT Message-Id: <202111121634.1ACGYbQl040967@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: eb6b6622fe85 - main - Update MINIMAL to have CC options List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eb6b6622fe858fef7896bb25a8a79dbd08b01335 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=eb6b6622fe858fef7896bb25a8a79dbd08b01335 commit eb6b6622fe858fef7896bb25a8a79dbd08b01335 Author: Warner Losh AuthorDate: 2021-11-12 16:33:18 +0000 Commit: Warner Losh CommitDate: 2021-11-12 16:33:18 +0000 Update MINIMAL to have CC options The MINIMAL configs were overlooked. They are compiled as part of universe, so this broke universe builds. Add the same defafults as for GENERIC. Sponsored by: Netflix --- sys/amd64/conf/MINIMAL | 2 ++ sys/i386/conf/MINIMAL | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sys/amd64/conf/MINIMAL b/sys/amd64/conf/MINIMAL index f724cbd2e3f1..ad1e61ececd8 100644 --- a/sys/amd64/conf/MINIMAL +++ b/sys/amd64/conf/MINIMAL @@ -43,6 +43,8 @@ options NUMA # Non-Uniform Memory Architecture support options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols +options CC_NEWRENO # include newreno congestion control +options CC_DEFAULT=\"newreno\" # define our default CC module it should be compiled in. options TCP_OFFLOAD # TCP offload options SCTP_SUPPORT # Allow kldload of SCTP options FFS # Berkeley Fast Filesystem diff --git a/sys/i386/conf/MINIMAL b/sys/i386/conf/MINIMAL index 9d735dbb0580..26c081c89799 100644 --- a/sys/i386/conf/MINIMAL +++ b/sys/i386/conf/MINIMAL @@ -44,6 +44,8 @@ options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols +options CC_NEWRENO # include newreno congestion control +options CC_DEFAULT=\"newreno\" # define our default CC module it should be compiled in. options TCP_OFFLOAD # TCP offload options SCTP_SUPPORT # Allow kldload of SCTP options FFS # Berkeley Fast Filesystem From nobody Fri Nov 12 16:42:46 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 60175183F08A; Fri, 12 Nov 2021 16:42:59 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrPXL3CY0z3hpq; Fri, 12 Nov 2021 16:42:58 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from disco.vangyzen.net (unknown [70.99.78.110]) by smtp.vangyzen.net (Postfix) with ESMTPSA id C85A856476; Fri, 12 Nov 2021 10:42:50 -0600 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=vangyzen.net; s=default; t=1636735370; bh=1C/loxQk7HYuWIXlCDIzNbdSp8ZJ2CtpBwdAvPzxAaE=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=tcs5/qjDsd2EFIRJJtlWrAZYHR3HB6/lcszDTiJh8qDN9YUVKUZYWXjvs2uN7Un4x ezvIOqFFZ+7/RdrhKYn/igas7aKlNC+HS0oRnfpe5XSdL8FA2eeKZCQPN6//va7j1j +MwrTXduZySmVXsrI69A8xylkcONmXu7/I8pv4CiMG40EgS8+pc+N3bpbjYvNU2u2s cqwR2CFFE3ZukBo3HIvwnxP/0Ta3MGK42SKkGWNW79qS4Em1umKbqKK8D25DxNbVZc 68XLnVn21gl9OTdhLb91/YDHwvNZZQfjvjiRo4DtbuijvtK1zO3S0DdY2Kk1T9DIyl ypwBEmqvFlZcQ== Subject: Re: git: 20d59403961d - main - kernel: deprecate Internet Class A/B/C To: mike@karels.net Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202111101536.1AAFa311018767@mail.karels.net> From: Eric van Gyzen Message-ID: Date: Fri, 12 Nov 2021 10:42:46 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 In-Reply-To: <202111101536.1AAFa311018767@mail.karels.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HrPXL3CY0z3hpq X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=vangyzen.net header.s=default header.b="tcs5/qjD"; dmarc=pass (policy=none) header.from=vangyzen.net; spf=pass (mx1.freebsd.org: domain of eric@vangyzen.net designates 199.48.133.146 as permitted sender) smtp.mailfrom=eric@vangyzen.net X-Spamd-Result: default: False [-2.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[vangyzen.net:s=default]; FREEFALL_USER(0.00)[eric]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+a]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_SPAM_SHORT(1.00)[1.000]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[vangyzen.net:+]; DMARC_POLICY_ALLOW(-0.50)[vangyzen.net,none]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:36236, ipnet:199.48.132.0/22, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On 11/10/21 9:36 AM, Mike Karels wrote: > masks should be required Indeed, this idea has been popular since early 2020... Eric From nobody Fri Nov 12 16:53:35 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A867718444D7; Fri, 12 Nov 2021 16:53:45 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrPmn3ThHz3lfQ; Fri, 12 Nov 2021 16:53:45 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTP id lVPBm9Wjqps7PlZo3mkmbn; Fri, 12 Nov 2021 16:53:39 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id lZo0m9LtC49dplZo1mf6cU; Fri, 12 Nov 2021 16:53:39 +0000 X-Authority-Analysis: v=2.4 cv=RqTWkQqK c=1 sm=1 tr=0 ts=618e9c13 a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=vIxV3rELxO4A:10 a=D3aUqHbKAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=BWPj58HXhyE7z3sTvDcA:9 a=CjuIK1q_8ugA:10 a=cMCrhCMO5xpCME3_Hjt_:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id EA647761; Fri, 12 Nov 2021 08:53:35 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 1ACGrZrb008972; Fri, 12 Nov 2021 08:53:35 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202111121653.1ACGrZrb008972@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Eric van Gyzen cc: mike@karels.net, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 20d59403961d - main - kernel: deprecate Internet Class A/B/C In-reply-to: References: <202111101536.1AAFa311018767@mail.karels.net> Comments: In-reply-to Eric van Gyzen message dated "Fri, 12 Nov 2021 10:42:46 -0600." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 12 Nov 2021 08:53:35 -0800 X-CMAE-Envelope: MS4xfNXKuMFPWKaFh5uwc1LYcp4khk5U2+WKozTprIOYWEa8f8IhpAwX9TCFaycyGX6OX0ptFkk0QRUtc2zs3vWL6sjdyrRR74MDznkbAIR3KgJXbXGsckW2 c5XuiE9VgLBgm6Jw/wAGGpm+6T/L13BSZX6IFjtdq0TqnrZUCjEIQyc/LuOW4F2yqO4gxd/GqrBALOHed+Bm/jVBjBH7GQbCu8MWyp4/2/LSH/zkUIrqsUoz lJas/PnUClijQOBYj3EJPPHtOZ5jnsn7aWVQAtq2rnfBJc9l20gekz2MBOj6qLsx+nNe/O/cPe41a6gXo1UTlhRk3swjlpEIoFquqiXGSWCDcXRdh8L0y2qs UZ8/w06+ X-Rspamd-Queue-Id: 4HrPmn3ThHz3lfQ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N In message , Eric van Gyzen writes: > On 11/10/21 9:36 AM, Mike Karels wrote: > > masks should be required > > Indeed, this idea has been popular since early 2020... :D -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From nobody Fri Nov 12 17:01:42 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F400E184AD8E; Fri, 12 Nov 2021 17:01:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrPy06f94z3pwq; Fri, 12 Nov 2021 17:01:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id EC1C822E40; Fri, 12 Nov 2021 17:01:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: b8d60729deef - main - tcp: Congestion control cleanup. To: Jessica Clarke , Randall Stewart Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202111111131.1ABBVH6s017371@gitrepo.freebsd.org> From: John Baldwin Message-ID: <2a564b11-b1f4-a4fe-745b-27f45fb134eb@FreeBSD.org> Date: Fri, 12 Nov 2021 09:01:42 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-ThisMailContainsUnwantedMimeParts: N On 11/12/21 8:19 AM, Jessica Clarke wrote: > On 11 Nov 2021, at 11:31, Randall Stewart wrote: >> >> The branch main has been updated by rrs: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=b8d60729deefa0bd13e6a395fcab4928e6e10445 >> >> commit b8d60729deefa0bd13e6a395fcab4928e6e10445 >> Author: Randall Stewart >> AuthorDate: 2021-11-11 11:28:18 +0000 >> Commit: Randall Stewart >> CommitDate: 2021-11-11 11:28:18 +0000 >> >> tcp: Congestion control cleanup. >> >> NOTE: HEADS UP read the note below if your kernel config is not including GENERIC!! >> >> This patch does a bit of cleanup on TCP congestion control modules. There were some rather >> interesting surprises that one could get i.e. where you use a socket option to change >> from one CC (say cc_cubic) to another CC (say cc_vegas) and you could in theory get >> a memory failure and end up on cc_newreno. This is not what one would expect. The >> new code fixes this by requiring a cc_data_sz() function so we can malloc with M_WAITOK >> and pass in to the init function preallocated memory. The CC init is expected in this >> case *not* to fail but if it does and a module does break the >> "no fail with memory given" contract we do fall back to the CC that was in place at the time. >> >> This also fixes up a set of common newreno utilities that can be shared amongst other >> CC modules instead of the other CC modules reaching into newreno and executing >> what they think is a "common and understood" function. Lets put these functions in >> cc.c and that way we have a common place that is easily findable by future developers or >> bug fixers. This also allows newreno to evolve and grow support for its features i.e. ABE >> and HYSTART++ without having to dance through hoops for other CC modules, instead >> both newreno and the other modules just call into the common functions if they desire >> that behavior or roll there own if that makes more sense. >> >> Note: This commit changes the kernel configuration!! If you are not using GENERIC in >> some form you must add a CC module option (one of CC_NEWRENO, CC_VEGAS, CC_CUBIC, >> CC_CDG, CC_CHD, CC_DCTCP, CC_HTCP, CC_HD). You can have more than one defined >> as well if you desire. Note that if you create a kernel configuration that does not >> define a congestion control module and includes INET or INET6 the kernel compile will >> break. Also you need to define a default, generic adds 'options CC_DEFAULT=\"newreno\" >> but you can specify any string that represents the name of the CC module (same names >> that show up in the CC module list under net.inet.tcp.cc). If you fail to add the >> options CC_DEFAULT in your kernel configuration the kernel build will also break. > > Not doing so breaks tinderbox, as well as configs not hooks up to > tinderbox. I don’t think this is acceptable. We discussed this a bit on IRC, but I think in this case the default CC_* options belong in DEFAULTS like the default GEOM_PART_* options rather than in GENERIC. (Though we mostly avoid changing DEFAULTS, this is one of the rare cases when I think it makes sense.) Handling the default for CC_DEFAULT does not work in DEFAULTS since you can't later override it, but that could be handled by simply having the default for CC_DEFAULT live in the code itself under an #ifndef instead. I think Warner is already testing a patchset to make this change. -- John Baldwin From nobody Fri Nov 12 17:07:21 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EB834184BDB8; Fri, 12 Nov 2021 17:07:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrQ4T5Bgrz3rBw; Fri, 12 Nov 2021 17:07:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87E6F23408; Fri, 12 Nov 2021 17:07:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ACH7L0j082518; Fri, 12 Nov 2021 17:07:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ACH7LSp082517; Fri, 12 Nov 2021 17:07:21 GMT (envelope-from git) Date: Fri, 12 Nov 2021 17:07:21 GMT Message-Id: <202111121707.1ACH7LSp082517@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 94df3271d6b2 - main - Rename net.inet.ip.check_interface to rfc1122_strong_es and document it. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 94df3271d6b2e3511f1ff234bcc16e8b031ce6df Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=94df3271d6b2e3511f1ff234bcc16e8b031ce6df commit 94df3271d6b2e3511f1ff234bcc16e8b031ce6df Author: Gleb Smirnoff AuthorDate: 2021-11-12 16:56:46 +0000 Commit: Gleb Smirnoff CommitDate: 2021-11-12 16:57:06 +0000 Rename net.inet.ip.check_interface to rfc1122_strong_es and document it. This very questionable feature was enabled in FreeBSD for a very short time. It was disabled very soon upon merging to RELENG_4 - 23d7f14119bf. And in HEAD was also disabled pretty soon - 4bc37f9836fb1. The tunable has very vague name. Check interface for what? Given that it was never documented and almost never enabled, I think it is fine to rename it together with documenting it. Also, count packets dropped by this tunable as ips_badaddr, otherwise they fall down to ips_cantforward counter, which is misleading, as packet was not supposed to be forwarded, it was destined locally. Reviewed by: donner, kp Differential revision: https://reviews.freebsd.org/D32912 --- share/man/man4/inet.4 | 17 ++++++++++++- sys/netinet/ip_input.c | 69 +++++++++++++++++++------------------------------- 2 files changed, 42 insertions(+), 44 deletions(-) diff --git a/share/man/man4/inet.4 b/share/man/man4/inet.4 index b0ccb2565ecf..7a8a653dff25 100644 --- a/share/man/man4/inet.4 +++ b/share/man/man4/inet.4 @@ -28,7 +28,7 @@ .\" From: @(#)inet.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd August 14, 2018 +.Dd November 12, 2021 .Dt INET 4 .Os .Sh NAME @@ -204,6 +204,21 @@ This .Xr sysctl 8 variable affects packets destined for a local host as well as packets forwarded to some other host. +.It Va ip.rfc1122_strong_es +Boolean: in non-forwarding mode +.Pq ip.forwarding is disabled +partially implement the Strong End System model per RFC1122. +If a packet with destination address that is local arrives on a different +interface than the interface the address belongs to, the packet would be +silently dropped. +Enabling this option may break certain setups, e.g. having an alias address(es) +on loopback that are expected to be reachable by outside traffic. +Enabling some other network features, e.g. +.Xr carp 4 +or destination address rewriting +.Xr pfil 4 +filters may override and bypass this check. +Disabled by default. .It Va ip.rfc6864 Boolean: control IP IDs generation behaviour. True value enables RFC6864 support, which specifies that IP ID field of diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index be04e27b8224..91fc7a3a63f7 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -118,24 +118,11 @@ SYSCTL_INT(_net_inet_ip, IPCTL_SENDREDIRECTS, redirect, CTLFLAG_VNET | CTLFLAG_R &VNET_NAME(ipsendredirects), 0, "Enable sending IP redirects"); -/* - * XXX - Setting ip_checkinterface mostly implements the receive side of - * the Strong ES model described in RFC 1122, but since the routing table - * and transmit implementation do not implement the Strong ES model, - * setting this to 1 results in an odd hybrid. - * - * XXX - ip_checkinterface currently must be disabled if you use ipnat - * to translate the destination address to another local interface. - * - * XXX - ip_checkinterface must be disabled if you add IP aliases - * to the loopback interface instead of the interface where the - * packets for those addresses are received. - */ -VNET_DEFINE_STATIC(int, ip_checkinterface); -#define V_ip_checkinterface VNET(ip_checkinterface) -SYSCTL_INT(_net_inet_ip, OID_AUTO, check_interface, CTLFLAG_VNET | CTLFLAG_RW, - &VNET_NAME(ip_checkinterface), 0, - "Verify packet arrives on correct interface"); +VNET_DEFINE_STATIC(bool, ip_strong_es) = false; +#define V_ip_strong_es VNET(ip_strong_es) +SYSCTL_BOOL(_net_inet_ip, OID_AUTO, rfc1122_strong_es, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_strong_es), false, + "Packet's IP destination address must match address on arrival interface"); VNET_DEFINE(pfil_head_t, inet_pfil_head); /* Packet filter hooks */ @@ -457,10 +444,11 @@ ip_input(struct mbuf *m) struct in_ifaddr *ia = NULL; struct ifaddr *ifa; struct ifnet *ifp; - int checkif, hlen = 0; + int hlen = 0; uint16_t sum, ip_len; int dchg = 0; /* dest changed after fw */ struct in_addr odst; /* original dst address */ + bool strong_es; M_ASSERTPKTHDR(m); NET_EPOCH_ASSERT(); @@ -669,22 +657,14 @@ passin: /* * Enable a consistency check between the destination address * and the arrival interface for a unicast packet (the RFC 1122 - * strong ES model) if IP forwarding is disabled and the packet - * is not locally generated and the packet is not subject to - * 'ipfw fwd'. - * - * XXX - Checking also should be disabled if the destination - * address is ipnat'ed to a different interface. - * - * XXX - Checking is incompatible with IP aliases added - * to the loopback interface instead of the interface where - * the packets are received. - * - * XXX - This is the case for carp vhost IPs as well so we - * insert a workaround. If the packet got here, we already - * checked with carp_iamatch() and carp_forus(). + * strong ES model) with a list of additional predicates: + * - if IP forwarding is disabled + * - the packet is not locally generated + * - the packet is not subject to 'ipfw fwd' + * - Interface is not running CARP. If the packet got here, we already + * checked it with carp_iamatch() and carp_forus(). */ - checkif = V_ip_checkinterface && (V_ipforwarding == 0) && + strong_es = V_ip_strong_es && (V_ipforwarding == 0) && ifp != NULL && ((ifp->if_flags & IFF_LOOPBACK) == 0) && ifp->if_carp == NULL && (dchg == 0); @@ -692,18 +672,21 @@ passin: * Check for exact addresses in the hash bucket. */ CK_LIST_FOREACH(ia, INADDR_HASH(ip->ip_dst.s_addr), ia_hash) { + if (IA_SIN(ia)->sin_addr.s_addr != ip->ip_dst.s_addr) + continue; + /* - * If the address matches, verify that the packet - * arrived via the correct interface if checking is - * enabled. + * net.inet.ip.rfc1122_strong_es: the address matches, verify + * that the packet arrived via the correct interface. */ - if (IA_SIN(ia)->sin_addr.s_addr == ip->ip_dst.s_addr && - (!checkif || ia->ia_ifp == ifp)) { - counter_u64_add(ia->ia_ifa.ifa_ipackets, 1); - counter_u64_add(ia->ia_ifa.ifa_ibytes, - m->m_pkthdr.len); - goto ours; + if (__predict_false(strong_es && ia->ia_ifp != ifp)) { + IPSTAT_INC(ips_badaddr); + goto bad; } + + counter_u64_add(ia->ia_ifa.ifa_ipackets, 1); + counter_u64_add(ia->ia_ifa.ifa_ibytes, m->m_pkthdr.len); + goto ours; } /* From nobody Fri Nov 12 17:07:22 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A54EF184C155; Fri, 12 Nov 2021 17:07:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrQ4W0BtDz3rC3; Fri, 12 Nov 2021 17:07:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1D5D22F52; Fri, 12 Nov 2021 17:07:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ACH7Maa082542; Fri, 12 Nov 2021 17:07:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ACH7MRC082541; Fri, 12 Nov 2021 17:07:22 GMT (envelope-from git) Date: Fri, 12 Nov 2021 17:07:22 GMT Message-Id: <202111121707.1ACH7MRC082541@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 81674f121eeb - main - ip_input: packet filters shall not modify m_pkthdr.rcvif List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 81674f121eeb741625a21ea5acf29d7580153817 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=81674f121eeb741625a21ea5acf29d7580153817 commit 81674f121eeb741625a21ea5acf29d7580153817 Author: Gleb Smirnoff AuthorDate: 2021-11-12 16:58:27 +0000 Commit: Gleb Smirnoff CommitDate: 2021-11-12 16:58:27 +0000 ip_input: packet filters shall not modify m_pkthdr.rcvif Quick review confirms that they do not, also IPv6 doesn't expect such a change in mbuf. In IPv4 this appeared in 0aade26e6d061, which doesn't seem to have a valid explanation why. Reviewed by: donner, kp, melifaro Differential revision: https://reviews.freebsd.org/D32913 --- sys/netinet/ip_input.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 91fc7a3a63f7..a678c15caad5 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -607,7 +607,6 @@ tooshort: ip = mtod(m, struct ip *); dchg = (odst.s_addr != ip->ip_dst.s_addr); - ifp = m->m_pkthdr.rcvif; if (m->m_flags & M_FASTFWD_OURS) { m->m_flags &= ~M_FASTFWD_OURS; @@ -665,7 +664,7 @@ passin: * checked it with carp_iamatch() and carp_forus(). */ strong_es = V_ip_strong_es && (V_ipforwarding == 0) && - ifp != NULL && ((ifp->if_flags & IFF_LOOPBACK) == 0) && + ((ifp->if_flags & IFF_LOOPBACK) == 0) && ifp->if_carp == NULL && (dchg == 0); /* @@ -697,7 +696,7 @@ passin: * be handled via ip_forward() and ether_output() with the loopback * into the stack for SIMPLEX interfaces handled by ether_output(). */ - if (ifp != NULL && ifp->if_flags & IFF_BROADCAST) { + if (ifp->if_flags & IFF_BROADCAST) { CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != AF_INET) continue; From nobody Fri Nov 12 17:07:23 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4CF7B184C2BC; Fri, 12 Nov 2021 17:07:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrQ4Y6clYz3rC6; Fri, 12 Nov 2021 17:07:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7E712338B; Fri, 12 Nov 2021 17:07:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ACH7Nmj082572; Fri, 12 Nov 2021 17:07:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ACH7NiQ082571; Fri, 12 Nov 2021 17:07:23 GMT (envelope-from git) Date: Fri, 12 Nov 2021 17:07:23 GMT Message-Id: <202111121707.1ACH7NiQ082571@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 9c89392f12d7 - main - Add in_localip_fib(), in6_localip_fib(). List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9c89392f12d707db8992ff8017d397bd8b0cd69b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=9c89392f12d707db8992ff8017d397bd8b0cd69b commit 9c89392f12d707db8992ff8017d397bd8b0cd69b Author: Gleb Smirnoff AuthorDate: 2021-11-12 16:59:42 +0000 Commit: Gleb Smirnoff CommitDate: 2021-11-12 16:59:42 +0000 Add in_localip_fib(), in6_localip_fib(). Check if given address/FIB exists locally. Reviewed by: melifaro Differential revision: https://reviews.freebsd.org/D32913 --- sys/netinet/in.c | 18 ++++++++++++++++++ sys/netinet/in.h | 1 + sys/netinet6/in6.c | 21 +++++++++++++++++++++ sys/netinet6/in6.h | 1 + 4 files changed, 41 insertions(+) diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 6bc4f638a98a..fccad3d9ede2 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -137,6 +137,24 @@ in_localip(struct in_addr in) return (false); } +/* + * Like in_localip(), but FIB-aware. + */ +bool +in_localip_fib(struct in_addr in, uint16_t fib) +{ + struct in_ifaddr *ia; + + NET_EPOCH_ASSERT(); + + CK_LIST_FOREACH(ia, INADDR_HASH(in.s_addr), ia_hash) + if (IA_SIN(ia)->sin_addr.s_addr == in.s_addr && + ia->ia_ifa.ifa_ifp->if_fib == fib) + return (true); + + return (false); +} + /* * Return 1 if an internet address is configured on an interface. */ diff --git a/sys/netinet/in.h b/sys/netinet/in.h index 92d150701422..1fc5c173b33c 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -662,6 +662,7 @@ int in_ifaddr_broadcast(struct in_addr, struct in_ifaddr *); int in_canforward(struct in_addr); int in_localaddr(struct in_addr); bool in_localip(struct in_addr); +bool in_localip_fib(struct in_addr, uint16_t); int in_ifhasaddr(struct ifnet *, struct in_addr); struct in_ifaddr *in_findlocal(uint32_t, bool); int inet_aton(const char *, struct in_addr *); /* in libkern */ diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index d54aba58edb6..feee4f3f64a5 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1753,6 +1753,27 @@ in6_localip(struct in6_addr *in6) return (0); } +/* + * Like in6_localip(), but FIB-aware. + */ +bool +in6_localip_fib(struct in6_addr *in6, uint16_t fib) +{ + struct rm_priotracker in6_ifa_tracker; + struct in6_ifaddr *ia; + + IN6_IFADDR_RLOCK(&in6_ifa_tracker); + CK_LIST_FOREACH(ia, IN6ADDR_HASH(in6), ia6_hash) { + if (IN6_ARE_ADDR_EQUAL(in6, &ia->ia_addr.sin6_addr) && + ia->ia_ifa.ifa_ifp->if_fib == fib) { + IN6_IFADDR_RUNLOCK(&in6_ifa_tracker); + return (true); + } + } + IN6_IFADDR_RUNLOCK(&in6_ifa_tracker); + return (false); +} + /* * Return 1 if an internet address is configured on an interface. */ diff --git a/sys/netinet6/in6.h b/sys/netinet6/in6.h index 10bc1f91c554..34682da04898 100644 --- a/sys/netinet6/in6.h +++ b/sys/netinet6/in6.h @@ -674,6 +674,7 @@ int in6_cksum_partial(struct mbuf *, u_int8_t, u_int32_t, u_int32_t, u_int32_t); int in6_localaddr(struct in6_addr *); int in6_localip(struct in6_addr *); +bool in6_localip_fib(struct in6_addr *, uint16_t); int in6_ifhasaddr(struct ifnet *, struct in6_addr *); int in6_addrscope(const struct in6_addr *); char *ip6_sprintf(char *, const struct in6_addr *); From nobody Fri Nov 12 17:07:24 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1A360184BDDF; Fri, 12 Nov 2021 17:07:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrQ4Z324Qz3rQq; Fri, 12 Nov 2021 17:07:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 01D3723409; Fri, 12 Nov 2021 17:07:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ACH7OPk082597; Fri, 12 Nov 2021 17:07:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ACH7ORv082596; Fri, 12 Nov 2021 17:07:24 GMT (envelope-from git) Date: Fri, 12 Nov 2021 17:07:24 GMT Message-Id: <202111121707.1ACH7ORv082596@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 2ce85919bbba - main - Add net.inet.ip.source_address_validation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ce85919bbba9e29ee85508abb4ba0c662c2b080 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=2ce85919bbba9e29ee85508abb4ba0c662c2b080 commit 2ce85919bbba9e29ee85508abb4ba0c662c2b080 Author: Gleb Smirnoff AuthorDate: 2021-11-12 17:00:33 +0000 Commit: Gleb Smirnoff CommitDate: 2021-11-12 17:00:33 +0000 Add net.inet.ip.source_address_validation Drop packets arriving from the network that have our source IP address. If maliciously crafted they can create evil effects like an RST exchange between two of our listening TCP ports. Such packets just can't be legitimate. Enable the tunable by default. Long time due for a modern Internet host. Reviewed by: donner, melifaro Differential revision: https://reviews.freebsd.org/D32914 --- share/man/man4/inet.4 | 8 ++++++++ sys/netinet/ip_input.c | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/share/man/man4/inet.4 b/share/man/man4/inet.4 index 7a8a653dff25..dbab301302b1 100644 --- a/share/man/man4/inet.4 +++ b/share/man/man4/inet.4 @@ -219,6 +219,14 @@ or destination address rewriting .Xr pfil 4 filters may override and bypass this check. Disabled by default. +.It Va ip.source_address_validation +Boolean: perform source address validation for packets destined for the local +host. +Consider this as following Section 3.2 of RFC3704/BCP84, where we treat local +host as our own infrastructure. +This has no effect on packets to be forwarded, so don't consider it as +anti-spoof feature for a router. +Enabled by default. .It Va ip.rfc6864 Boolean: control IP IDs generation behaviour. True value enables RFC6864 support, which specifies that IP ID field of diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index a678c15caad5..9db1f8c6f2e7 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -124,6 +124,12 @@ SYSCTL_BOOL(_net_inet_ip, OID_AUTO, rfc1122_strong_es, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_strong_es), false, "Packet's IP destination address must match address on arrival interface"); +VNET_DEFINE_STATIC(bool, ip_sav) = true; +#define V_ip_sav VNET(ip_sav) +SYSCTL_BOOL(_net_inet_ip, OID_AUTO, source_address_validation, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_sav), true, + "Drop incoming packets with source address that is a local address"); + VNET_DEFINE(pfil_head_t, inet_pfil_head); /* Packet filter hooks */ static struct netisr_handler ip_nh = { @@ -683,6 +689,16 @@ passin: goto bad; } + /* + * net.inet.ip.source_address_validation: drop incoming + * packets that pretend to be ours. + */ + if (V_ip_sav && !(ifp->if_flags & IFF_LOOPBACK) && + __predict_false(in_localip_fib(ip->ip_src, ifp->if_fib))) { + IPSTAT_INC(ips_badaddr); + goto bad; + } + counter_u64_add(ia->ia_ifa.ifa_ipackets, 1); counter_u64_add(ia->ia_ifa.ifa_ibytes, m->m_pkthdr.len); goto ours; From nobody Fri Nov 12 17:07:25 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BAB80184C1F6; Fri, 12 Nov 2021 17:07:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrQ4d4Mstz3rHb; Fri, 12 Nov 2021 17:07:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D0DF22FF3; Fri, 12 Nov 2021 17:07:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ACH7Pcl082621; Fri, 12 Nov 2021 17:07:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ACH7PPs082620; Fri, 12 Nov 2021 17:07:25 GMT (envelope-from git) Date: Fri, 12 Nov 2021 17:07:25 GMT Message-Id: <202111121707.1ACH7PPs082620@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 1817be481b87 - main - Add net.inet6.ip6.source_address_validation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1817be481b8703ae86730b151a6f49cc3022930f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=1817be481b8703ae86730b151a6f49cc3022930f commit 1817be481b8703ae86730b151a6f49cc3022930f Author: Gleb Smirnoff AuthorDate: 2021-11-12 17:01:13 +0000 Commit: Gleb Smirnoff CommitDate: 2021-11-12 17:01:40 +0000 Add net.inet6.ip6.source_address_validation Drop packets arriving from the network that have our source IPv6 address. If maliciously crafted they can create evil effects like an RST exchange between two of our listening TCP ports. Such packets just can't be legitimate. Enable the tunable by default. Long time due for a modern Internet host. Reviewed by: melifaro, donner, kp Differential revision: https://reviews.freebsd.org/D32915 --- share/man/man4/inet6.4 | 10 +++++++++- sys/netinet6/ip6_input.c | 12 ++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/share/man/man4/inet6.4 b/share/man/man4/inet6.4 index 300f98abb196..87c57ea2c3d2 100644 --- a/share/man/man4/inet6.4 +++ b/share/man/man4/inet6.4 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 25, 2020 +.Dd November 12, 2021 .Dt INET6 4 .Os .Sh NAME @@ -341,6 +341,14 @@ mapped address on .Dv AF_INET6 sockets. Defaults to on. +.It Va ip6.source_address_validation +Boolean: perform source address validation for packets destined for the local +host. +Consider this as following Section 3.2 of RFC3704/BCP84, where we treat local +host as our own infrastructure. +This has no effect on packets to be forwarded, so don't consider it as +anti-spoof feature for a router. +Enabled by default. .El .Ss Interaction between IPv4/v6 sockets By default, diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index 30ad9a53006a..2d4e63ca83b6 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -163,6 +163,12 @@ SYSCTL_PROC(_net_inet6_ip6, IPV6CTL_INTRQMAXLEN, intr_queue_maxlen, 0, 0, sysctl_netinet6_intr_queue_maxlen, "I", "Maximum size of the IPv6 input queue"); +VNET_DEFINE_STATIC(bool, ip6_sav) = true; +#define V_ip6_sav VNET(ip6_sav) +SYSCTL_BOOL(_net_inet6_ip6, OID_AUTO, source_address_validation, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_sav), true, + "Drop incoming packets with source address that is a local address"); + #ifdef RSS static struct netisr_handler ip6_direct_nh = { .nh_name = "ip6_direct", @@ -816,6 +822,12 @@ passin: ip6_sprintf(ip6bufd, &ip6->ip6_dst))); goto bad; } + if (V_ip6_sav && !(rcvif->if_flags & IFF_LOOPBACK) && + __predict_false(in6_localip_fib(&ip6->ip6_src, + rcvif->if_fib))) { + IP6STAT_INC(ip6s_badscope); /* XXX */ + goto bad; + } /* Count the packet in the ip address stats */ counter_u64_add(ia->ia_ifa.ifa_ipackets, 1); counter_u64_add(ia->ia_ifa.ifa_ibytes, m->m_pkthdr.len); From nobody Fri Nov 12 17:09:07 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2B344184D9AF for ; Fri, 12 Nov 2021 17:09:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ua1-x930.google.com (mail-ua1-x930.google.com [IPv6:2607:f8b0:4864:20::930]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrQ6t529Gz3shw for ; Fri, 12 Nov 2021 17:09:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ua1-x930.google.com with SMTP id ay21so20176837uab.12 for ; Fri, 12 Nov 2021 09:09:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HiR62pvvxuzMROJHZcq0Yz5uJW6Msn8Bl8nVNFKU8M8=; b=xA/eufuQzW5LhMBA3N234xb0Vh/dhh3zTn3rRjN+AcGkkEl9dTj5qevhjNH3R5jKoE wQUNapHc3ZEREkApwPhQPFLRv3NB1WwxBLlx3SEc6buGlzYfeXjanaSlwffUdwZLF+AZ +r5iO45vrOUgwYliM76741OIEUBRnSa09iZYP9fOmGAE+P44FMfQSU4kdb5JfinvnXSm +XR8fcXCOh3gk18nlH1P2JqUagzUjujZemxKUkDWbH54cqMYXSRqAwf583EibEAWYBrz cVJHUH2JQGIoA0PGcvP4IOAt81hvpU1fnBfH2wxWn2NjSVEdME8DKXoSM4GlRh9JAvyQ 4TSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HiR62pvvxuzMROJHZcq0Yz5uJW6Msn8Bl8nVNFKU8M8=; b=2/M0iOcHu05FXkIHevLZc5bqfdfWnE2u3L2TS5wu8NA38ksXstv9x5ptPfz06fP3Ov zzISQwYt868WRXc6C/f0MXVIEenQnof71loRctQDqA+5U83KN+WyoDB7A+BYCnbHG91Y kspRnUkBnKYvldgbryU6hHhfQA2amHuhhlQ9KpucOOEJeXY8ondolBAAE9gQky2CwpX/ a4GYfWxx5VTD3HD6cgwZzQtumm7Uo0ytv3AEtjuYMesBgb9XJb87n+sq6k0SujfT/t/B acqCuU+PPHTJB+e1KWNwUaQXWoQTGpfumFqdG48mMPS7Z/GS+cxVqA3/1DZJaTiwl42D yHyA== X-Gm-Message-State: AOAM532IM4/Gub5LijR4rkbk10CjlaVejVxLOYoZaJ8sZFwS0I1dDBLz YmD7ShnUVyqM5wp37uQI+MkxW0LTxEAso3GD8g4daw== X-Google-Smtp-Source: ABdhPJxYQaDqnsdpUgArAN2TaTHhNVaFqa/2999+9B7SftG33tryzSS4hF6qk2XgY7CkP8znxJgGtEBnF0rSexudza8= X-Received: by 2002:ab0:6f47:: with SMTP id r7mr24349907uat.85.1636736959053; Fri, 12 Nov 2021 09:09:19 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202111111131.1ABBVH6s017371@gitrepo.freebsd.org> <2a564b11-b1f4-a4fe-745b-27f45fb134eb@FreeBSD.org> In-Reply-To: <2a564b11-b1f4-a4fe-745b-27f45fb134eb@FreeBSD.org> From: Warner Losh Date: Fri, 12 Nov 2021 10:09:07 -0700 Message-ID: Subject: Re: git: b8d60729deef - main - tcp: Congestion control cleanup. To: John Baldwin Cc: Jessica Clarke , Randall Stewart , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: multipart/alternative; boundary="00000000000009130f05d09a85ea" X-Rspamd-Queue-Id: 4HrQ6t529Gz3shw X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N --00000000000009130f05d09a85ea Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Nov 12, 2021 at 10:01 AM John Baldwin wrote: > On 11/12/21 8:19 AM, Jessica Clarke wrote: > > On 11 Nov 2021, at 11:31, Randall Stewart wrote: > >> > >> The branch main has been updated by rrs: > >> > >> URL: > https://cgit.FreeBSD.org/src/commit/?id=3Db8d60729deefa0bd13e6a395fcab492= 8e6e10445 > >> > >> commit b8d60729deefa0bd13e6a395fcab4928e6e10445 > >> Author: Randall Stewart > >> AuthorDate: 2021-11-11 11:28:18 +0000 > >> Commit: Randall Stewart > >> CommitDate: 2021-11-11 11:28:18 +0000 > >> > >> tcp: Congestion control cleanup. > >> > >> NOTE: HEADS UP read the note below if your kernel config is not > including GENERIC!! > >> > >> This patch does a bit of cleanup on TCP congestion control modules= . > There were some rather > >> interesting surprises that one could get i.e. where you use a > socket option to change > >> from one CC (say cc_cubic) to another CC (say cc_vegas) and you > could in theory get > >> a memory failure and end up on cc_newreno. This is not what one > would expect. The > >> new code fixes this by requiring a cc_data_sz() function so we can > malloc with M_WAITOK > >> and pass in to the init function preallocated memory. The CC init > is expected in this > >> case *not* to fail but if it does and a module does break the > >> "no fail with memory given" contract we do fall back to the CC tha= t > was in place at the time. > >> > >> This also fixes up a set of common newreno utilities that can be > shared amongst other > >> CC modules instead of the other CC modules reaching into newreno > and executing > >> what they think is a "common and understood" function. Lets put > these functions in > >> cc.c and that way we have a common place that is easily findable b= y > future developers or > >> bug fixers. This also allows newreno to evolve and grow support fo= r > its features i.e. ABE > >> and HYSTART++ without having to dance through hoops for other CC > modules, instead > >> both newreno and the other modules just call into the common > functions if they desire > >> that behavior or roll there own if that makes more sense. > >> > >> Note: This commit changes the kernel configuration!! If you are no= t > using GENERIC in > >> some form you must add a CC module option (one of CC_NEWRENO, > CC_VEGAS, CC_CUBIC, > >> CC_CDG, CC_CHD, CC_DCTCP, CC_HTCP, CC_HD). You can have more than > one defined > >> as well if you desire. Note that if you create a kernel > configuration that does not > >> define a congestion control module and includes INET or INET6 the > kernel compile will > >> break. Also you need to define a default, generic adds 'options > CC_DEFAULT=3D\"newreno\" > >> but you can specify any string that represents the name of the CC > module (same names > >> that show up in the CC module list under net.inet.tcp.cc). If you > fail to add the > >> options CC_DEFAULT in your kernel configuration the kernel build > will also break. > > > > Not doing so breaks tinderbox, as well as configs not hooks up to > > tinderbox. I don=E2=80=99t think this is acceptable. > > We discussed this a bit on IRC, but I think in this case the default CC_* > options belong in DEFAULTS like the default GEOM_PART_* options rather > than in GENERIC. (Though we mostly avoid changing DEFAULTS, this is one > of the rare cases when I think it makes sense.) Handling the default for > CC_DEFAULT does not work in DEFAULTS since you can't later override it, > but that could be handled by simply having the default for CC_DEFAULT liv= e > in the code itself under an #ifndef instead. > > I think Warner is already testing a patchset to make this change. > Yes. my universe is running now. https://reviews.freebsd.org/D32964 is what I'm testing, if people want to follow along at home or help refine it while the first universe is run... Warner --00000000000009130f05d09a85ea-- From nobody Fri Nov 12 17:22:53 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B671418533AB; Fri, 12 Nov 2021 17:23:00 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrQQX1YZ3z4Rq7; Fri, 12 Nov 2021 17:23:00 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 1ACHMrg1099255 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 12 Nov 2021 09:22:53 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 1ACHMrHL099254; Fri, 12 Nov 2021 09:22:53 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Fri, 12 Nov 2021 09:22:53 -0800 From: Gleb Smirnoff To: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 9c89392f12d7 - main - Add in_localip_fib(), in6_localip_fib(). Message-ID: References: <202111121707.1ACH7NiQ082571@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202111121707.1ACH7NiQ082571@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4HrQQX1YZ3z4Rq7 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US]; local_wl_from(0.00)[freebsd.org] X-ThisMailContainsUnwantedMimeParts: N On Fri, Nov 12, 2021 at 05:07:23PM +0000, Gleb Smirnoff wrote: T> commit 9c89392f12d707db8992ff8017d397bd8b0cd69b T> Author: Gleb Smirnoff T> AuthorDate: 2021-11-12 16:59:42 +0000 T> Commit: Gleb Smirnoff T> CommitDate: 2021-11-12 16:59:42 +0000 T> T> Add in_localip_fib(), in6_localip_fib(). T> T> Check if given address/FIB exists locally. T> T> Reviewed by: melifaro T> Differential revision: https://reviews.freebsd.org/D32913 Should have been https://reviews.freebsd.org/D32933 Sorry -- Gleb Smirnoff From nobody Fri Nov 12 19:03:20 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 942211840573; Fri, 12 Nov 2021 19:03:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrSfJ3dwrz3HNC; Fri, 12 Nov 2021 19:03:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CB3724B7D; Fri, 12 Nov 2021 19:03:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ACJ3KmW042576; Fri, 12 Nov 2021 19:03:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ACJ3Kc0042575; Fri, 12 Nov 2021 19:03:20 GMT (envelope-from git) Date: Fri, 12 Nov 2021 19:03:20 GMT Message-Id: <202111121903.1ACJ3Kc0042575@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: ae062ff2695f - main - Move KHELP_DECLARE_MOD_UMA later in the boot List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ae062ff2695f61e43e23e144db62cb251b2cf599 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=ae062ff2695f61e43e23e144db62cb251b2cf599 commit ae062ff2695f61e43e23e144db62cb251b2cf599 Author: Andrew Turner AuthorDate: 2021-11-12 18:28:18 +0000 Commit: Andrew Turner CommitDate: 2021-11-12 18:56:58 +0000 Move KHELP_DECLARE_MOD_UMA later in the boot Both KHELP_DECLARE_MOD_UMA and the kernel linker SYSINIT to find in-kernel modules run at SI_SUB_KLD, SI_ORDER_ANY. As the former depends on the latter running first move it later in the boot, to the new SI_SUB_KHELP. This ensures KHELP_DECLARE_MOD_UMA module SYSINIT functions will be after the kernel linker. Previously we may have received a panic similar to the following if the order was incorrect: panic: module_register_init: module named ertt not found Reported by: bob prohaska Discussed with: imp, jhb Sponsored by: The FreeBSD Foundation --- sys/sys/kernel.h | 1 + sys/sys/module_khelp.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h index e96eb52b52fd..765484df351c 100644 --- a/sys/sys/kernel.h +++ b/sys/sys/kernel.h @@ -105,6 +105,7 @@ enum sysinit_sub_id { SI_SUB_EVENTHANDLER = 0x1C00000, /* eventhandler init */ SI_SUB_VNET_PRELINK = 0x1E00000, /* vnet init before modules */ SI_SUB_KLD = 0x2000000, /* KLD and module setup */ + SI_SUB_KHELP = 0x2080000, /* khelp modules */ SI_SUB_CPU = 0x2100000, /* CPU resource(s)*/ SI_SUB_RACCT = 0x2110000, /* resource accounting */ SI_SUB_KDTRACE = 0x2140000, /* Kernel dtrace hooks */ diff --git a/sys/sys/module_khelp.h b/sys/sys/module_khelp.h index a66440277a41..bab33e487497 100644 --- a/sys/sys/module_khelp.h +++ b/sys/sys/module_khelp.h @@ -87,7 +87,7 @@ struct khelp_modevent_data { .evhand = khelp_modevent, \ .priv = &kmd_##hname \ }; \ - DECLARE_MODULE(hname, h_##hname, SI_SUB_KLD, SI_ORDER_ANY); \ + DECLARE_MODULE(hname, h_##hname, SI_SUB_KHELP, SI_ORDER_ANY); \ MODULE_VERSION(hname, version) #define KHELP_DECLARE_MOD(hname, hdata, hhooks, version) \ From nobody Fri Nov 12 19:19:11 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7DACD1849DF0; Fri, 12 Nov 2021 19:19:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrT0b34bxz3NDL; Fri, 12 Nov 2021 19:19:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AEC6252DA; Fri, 12 Nov 2021 19:19:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ACJJB1L056560; Fri, 12 Nov 2021 19:19:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ACJJB00056559; Fri, 12 Nov 2021 19:19:11 GMT (envelope-from git) Date: Fri, 12 Nov 2021 19:19:11 GMT Message-Id: <202111121919.1ACJJB00056559@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: 7e3c9ec906c0 - main - tcp: better congestion control defaults List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7e3c9ec906c0710e34fa5b11104ee1c12f68a09f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7e3c9ec906c0710e34fa5b11104ee1c12f68a09f commit 7e3c9ec906c0710e34fa5b11104ee1c12f68a09f Author: Warner Losh AuthorDate: 2021-11-12 17:05:03 +0000 Commit: Warner Losh CommitDate: 2021-11-12 19:16:11 +0000 tcp: better congestion control defaults Define CC_NEWRENO in all the appropriate DEFAULTS and std.* config files. It's the default congestion control algorithm. Add code to cc.c so that CC_DEFAULT is "newreno" if it's not overriden in the config file. Sponsored by: Netflix Fixes: b8d60729deef ("tcp: Congestion control cleanup.") Revired by: manu, hselasky, jhb, glebius, tuexen Differential Revision: https://reviews.freebsd.org/D32964 --- sys/amd64/conf/DEFAULTS | 3 +++ sys/amd64/conf/GENERIC | 2 -- sys/amd64/conf/MINIMAL | 2 -- sys/arm/conf/DEFAULTS | 3 +++ sys/arm64/conf/DEFAULTS | 3 +++ sys/i386/conf/DEFAULTS | 3 +++ sys/i386/conf/GENERIC | 2 -- sys/i386/conf/MINIMAL | 2 -- sys/mips/conf/DEFAULTS | 3 +++ sys/netinet/cc/cc.c | 7 +++++++ sys/powerpc/conf/DEFAULTS | 3 +++ sys/powerpc/conf/GENERIC | 2 -- sys/riscv/conf/DEFAULTS | 3 +++ sys/riscv/conf/GENERIC | 2 -- 14 files changed, 28 insertions(+), 12 deletions(-) diff --git a/sys/amd64/conf/DEFAULTS b/sys/amd64/conf/DEFAULTS index f8334bd9af20..5ea20c19f791 100644 --- a/sys/amd64/conf/DEFAULTS +++ b/sys/amd64/conf/DEFAULTS @@ -21,4 +21,7 @@ options GEOM_PART_EBR options GEOM_PART_MBR options GEOM_PART_GPT +# Default congestion control algorithm +options CC_NEWRENO # include newreno congestion control + options NEW_PCIB diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index eb2b0cbd12e9..f47b995beb2c 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -30,8 +30,6 @@ options PREEMPTION # Enable kernel thread preemption options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols -options CC_NEWRENO # include newreno congestion control -options CC_DEFAULT=\"newreno\" # define our default CC module it should be compiled in. options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options ROUTE_MPATH # Multipath routing support options FIB_ALGO # Modular fib lookups diff --git a/sys/amd64/conf/MINIMAL b/sys/amd64/conf/MINIMAL index ad1e61ececd8..f724cbd2e3f1 100644 --- a/sys/amd64/conf/MINIMAL +++ b/sys/amd64/conf/MINIMAL @@ -43,8 +43,6 @@ options NUMA # Non-Uniform Memory Architecture support options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols -options CC_NEWRENO # include newreno congestion control -options CC_DEFAULT=\"newreno\" # define our default CC module it should be compiled in. options TCP_OFFLOAD # TCP offload options SCTP_SUPPORT # Allow kldload of SCTP options FFS # Berkeley Fast Filesystem diff --git a/sys/arm/conf/DEFAULTS b/sys/arm/conf/DEFAULTS index 6755185f54d5..2e145585c7e8 100644 --- a/sys/arm/conf/DEFAULTS +++ b/sys/arm/conf/DEFAULTS @@ -5,3 +5,6 @@ device mem +# Default congestion control algorithm +options CC_NEWRENO # include newreno congestion control + diff --git a/sys/arm64/conf/DEFAULTS b/sys/arm64/conf/DEFAULTS index ffc08435380f..e2b034e94967 100644 --- a/sys/arm64/conf/DEFAULTS +++ b/sys/arm64/conf/DEFAULTS @@ -13,4 +13,7 @@ options GEOM_PART_BSD options GEOM_PART_MBR options GEOM_PART_GPT +# Default congestion control algorithm +options CC_NEWRENO # include newreno congestion control + options NEW_PCIB diff --git a/sys/i386/conf/DEFAULTS b/sys/i386/conf/DEFAULTS index f0aee10c9c3c..67328043a537 100644 --- a/sys/i386/conf/DEFAULTS +++ b/sys/i386/conf/DEFAULTS @@ -22,6 +22,9 @@ options GEOM_PART_EBR options GEOM_PART_MBR options GEOM_PART_GPT +# Default congestion control algorithm +options CC_NEWRENO # include newreno congestion control + # enable support for native hardware device atpic diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC index 3b5556675555..5447c452c4f7 100644 --- a/sys/i386/conf/GENERIC +++ b/sys/i386/conf/GENERIC @@ -31,8 +31,6 @@ options PREEMPTION # Enable kernel thread preemption options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols -options CC_NEWRENO # include newreno congestion control -options CC_DEFAULT=\"newreno\" # define our default CC module it should be compiled in. options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options ROUTE_MPATH # Multipath routing support options TCP_HHOOK # hhook(9) framework for TCP diff --git a/sys/i386/conf/MINIMAL b/sys/i386/conf/MINIMAL index 26c081c89799..9d735dbb0580 100644 --- a/sys/i386/conf/MINIMAL +++ b/sys/i386/conf/MINIMAL @@ -44,8 +44,6 @@ options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols -options CC_NEWRENO # include newreno congestion control -options CC_DEFAULT=\"newreno\" # define our default CC module it should be compiled in. options TCP_OFFLOAD # TCP offload options SCTP_SUPPORT # Allow kldload of SCTP options FFS # Berkeley Fast Filesystem diff --git a/sys/mips/conf/DEFAULTS b/sys/mips/conf/DEFAULTS index f09ef5440ce9..a64b332ffa43 100644 --- a/sys/mips/conf/DEFAULTS +++ b/sys/mips/conf/DEFAULTS @@ -9,3 +9,6 @@ device uart_ns8250 options GEOM_PART_BSD options GEOM_PART_MBR + +# Default congestion control algorithm +options CC_NEWRENO # include newreno congestion control diff --git a/sys/netinet/cc/cc.c b/sys/netinet/cc/cc.c index 0a61aff37c96..df0efcac24be 100644 --- a/sys/netinet/cc/cc.c +++ b/sys/netinet/cc/cc.c @@ -77,6 +77,13 @@ __FBSDID("$FreeBSD$"); #include #include +/* + * Have a sane default if no CC_DEFAULT is specified in the kernel config file. + */ +#ifndef CC_DEFAULT +#define CC_DEFAULT "newreno" +#endif + MALLOC_DEFINE(M_CC_MEM, "CC Mem", "Congestion Control State memory"); /* diff --git a/sys/powerpc/conf/DEFAULTS b/sys/powerpc/conf/DEFAULTS index da8e7fb6d197..9bf5e706b04a 100644 --- a/sys/powerpc/conf/DEFAULTS +++ b/sys/powerpc/conf/DEFAULTS @@ -12,4 +12,7 @@ device uart_ns8250 options GEOM_PART_BSD options GEOM_PART_MBR +# Default congestion control algorithm +options CC_NEWRENO # include newreno congestion control + options NEW_PCIB diff --git a/sys/powerpc/conf/GENERIC b/sys/powerpc/conf/GENERIC index 5e3796c98e1f..cdf1266ec5a6 100644 --- a/sys/powerpc/conf/GENERIC +++ b/sys/powerpc/conf/GENERIC @@ -38,8 +38,6 @@ options PREEMPTION #Enable kernel thread preemption options VIMAGE # Subsystem virtualization, e.g. VNET options INET #InterNETworking options INET6 #IPv6 communications protocols -options CC_NEWRENO # include newreno congestion control -options CC_DEFAULT=\"newreno\" # define our default CC module it should be compiled in. options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options TCP_HHOOK # hhook(9) framework for TCP options TCP_RFC7413 # TCP Fast Open diff --git a/sys/riscv/conf/DEFAULTS b/sys/riscv/conf/DEFAULTS index 94c6bf283c45..f18fdca0c001 100644 --- a/sys/riscv/conf/DEFAULTS +++ b/sys/riscv/conf/DEFAULTS @@ -12,4 +12,7 @@ device mem # Memory and kernel memory devices options GEOM_PART_BSD options GEOM_PART_MBR +# Default congestion control algorithm +options CC_NEWRENO # include newreno congestion control + options NEW_PCIB diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index 65a5197429f5..4ce1cb6a3cda 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -29,8 +29,6 @@ options PREEMPTION # Enable kernel thread preemption options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols -options CC_NEWRENO # include newreno congestion control -options CC_DEFAULT=\"newreno\" # define our default CC module it should be compiled in. options TCP_HHOOK # hhook(9) framework for TCP options IPSEC_SUPPORT # Allow kldload of ipsec and tcpmd5 options ROUTE_MPATH # Multipath routing support From nobody Fri Nov 12 19:19:12 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E88C31849E48; Fri, 12 Nov 2021 19:19:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrT0c4zY0z3NJx; Fri, 12 Nov 2021 19:19:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E3F2251CE; Fri, 12 Nov 2021 19:19:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ACJJCAF056584; Fri, 12 Nov 2021 19:19:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ACJJCbF056583; Fri, 12 Nov 2021 19:19:12 GMT (envelope-from git) Date: Fri, 12 Nov 2021 19:19:12 GMT Message-Id: <202111121919.1ACJJCbF056583@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: 034a924009bc - main - tcp: Ensure that vnets have an initialized V_default_cc_ptr List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 034a924009bc9cab371f6aa1623bc2aa2ea80cc7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=034a924009bc9cab371f6aa1623bc2aa2ea80cc7 commit 034a924009bc9cab371f6aa1623bc2aa2ea80cc7 Author: Mark Johnston AuthorDate: 2021-11-12 18:44:12 +0000 Commit: Warner Losh CommitDate: 2021-11-12 19:18:12 +0000 tcp: Ensure that vnets have an initialized V_default_cc_ptr This causes new vnets to inherit the cc algorithm from vnet0. This is a temporary patch to fix vnet jail creation. With encouragement from: glebius Fixes: b8d60729deef ("tcp: Congestion control cleanup.") Differential Revision: https://reviews.freebsd.org/D32970 --- sys/netinet/cc/cc.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sys/netinet/cc/cc.c b/sys/netinet/cc/cc.c index df0efcac24be..457f5a6e55e1 100644 --- a/sys/netinet/cc/cc.c +++ b/sys/netinet/cc/cc.c @@ -316,6 +316,23 @@ cc_register_algo(struct cc_algo *add_cc) return (err); } +static void +vnet_cc_sysinit(void *arg) +{ + struct cc_algo *cc; + + if (IS_DEFAULT_VNET(curvnet)) + return; + + CURVNET_SET(vnet0); + cc = V_default_cc_ptr; + CURVNET_RESTORE(); + + V_default_cc_ptr = cc; +} +VNET_SYSINIT(vnet_cc_sysinit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, + vnet_cc_sysinit, NULL); + /* * Perform any necessary tasks before we exit congestion recovery. */ From nobody Fri Nov 12 19:21:12 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CD994184C1A3; Fri, 12 Nov 2021 19:21:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrT2w5T2Xz3Q0d; Fri, 12 Nov 2021 19:21:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B895250C7; Fri, 12 Nov 2021 19:21:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ACJLCOR065783; Fri, 12 Nov 2021 19:21:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ACJLC8b065782; Fri, 12 Nov 2021 19:21:12 GMT (envelope-from git) Date: Fri, 12 Nov 2021 19:21:12 GMT Message-Id: <202111121921.1ACJLC8b065782@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 6913bf4c3d34 - main - tests/divert: fix after 2ce85919bbba (IP source address validation) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6913bf4c3d34c8caf2d3e72f9c44b345486b8ceb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=6913bf4c3d34c8caf2d3e72f9c44b345486b8ceb commit 6913bf4c3d34c8caf2d3e72f9c44b345486b8ceb Author: Gleb Smirnoff AuthorDate: 2021-11-12 19:17:56 +0000 Commit: Gleb Smirnoff CommitDate: 2021-11-12 19:20:06 +0000 tests/divert: fix after 2ce85919bbba (IP source address validation) Just make the test packet more legitimate. Reviewed by: melifaro --- tests/sys/common/divert.py | 3 ++- tests/sys/netinet/divert.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/sys/common/divert.py b/tests/sys/common/divert.py index f23fbe857cbb..94e20a03571f 100755 --- a/tests/sys/common/divert.py +++ b/tests/sys/common/divert.py @@ -42,6 +42,7 @@ IPPROTO_DIVERT = 258 def parse_args(): parser = argparse.ArgumentParser(description='divert socket tester') parser.add_argument('--dip', type=str, help='destination packet IP') + parser.add_argument('--sip', type=str, help='source packet IP') parser.add_argument('--divert_port', type=int, default=6668, help='divert port to use') parser.add_argument('--test_name', type=str, required=True, @@ -65,7 +66,7 @@ def ipdivert_ip6_output_remote_success(args): def ipdivert_ip_input_local_success(args): """Sends IPv4 packet to OS stack as inbound local packet.""" - packet = sc.IP(dst=args.dip) / sc.ICMP(type='echo-request') + packet = sc.IP(dst=args.dip,src=args.sip) / sc.ICMP(type='echo-request') with socket.socket(socket.AF_INET, socket.SOCK_RAW, IPPROTO_DIVERT) as s: s.bind(('0.0.0.0', args.divert_port)) s.sendto(bytes(packet), (args.dip, 0)) diff --git a/tests/sys/netinet/divert.sh b/tests/sys/netinet/divert.sh index acd33742b791..3d064b9155b7 100755 --- a/tests/sys/netinet/divert.sh +++ b/tests/sys/netinet/divert.sh @@ -135,7 +135,8 @@ ipdivert_ip_input_local_success_body() { jexec ${jname} ifconfig ${epair}b inet ${ip4b}/30 atf_check -s exit:0 jexec ${jname} $(atf_get_srcdir)/${script_name} \ - --dip ${ip4b} --test_name ipdivert_ip_input_local_success + --sip ${ip4a} --dip ${ip4b} \ + --test_name ipdivert_ip_input_local_success count=`jexec ${jname} netstat -s -p icmp | grep 'Input histogram:' -A8 | grep -c 'echo: '` # Verify redirect got installed From nobody Fri Nov 12 21:14:01 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 62840183D9E3; Fri, 12 Nov 2021 21:14:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrWY52P0tz4pRF; Fri, 12 Nov 2021 21:14:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31FFA26A5F; Fri, 12 Nov 2021 21:14:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ACLE1ew015891; Fri, 12 Nov 2021 21:14:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ACLE13J015890; Fri, 12 Nov 2021 21:14:01 GMT (envelope-from git) Date: Fri, 12 Nov 2021 21:14:01 GMT Message-Id: <202111122114.1ACLE13J015890@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: df07bfda67ad - main - tcp: Fix a locking issue List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: df07bfda67adc889b900126e31babb37e9ecae90 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=df07bfda67adc889b900126e31babb37e9ecae90 commit df07bfda67adc889b900126e31babb37e9ecae90 Author: Michael Tuexen AuthorDate: 2021-11-12 21:08:18 +0000 Commit: Michael Tuexen CommitDate: 2021-11-12 21:13:50 +0000 tcp: Fix a locking issue INP_WLOCK_RECHECK_CLEANUP() and INP_WLOCK_RECHECK() might return from the function, so any locks held must be released. Reported by: syzbot+b1a888df08efaa7b4bf1@syzkaller.appspotmail.com Reviewed by: markj Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D32975 --- sys/netinet/tcp_usrreq.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 4e03ad8ba095..968e102248d7 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -2073,11 +2073,16 @@ no_mem_needed: free(ptr, M_CC_MEM); goto do_over; } - if (ptr) { + INP_WLOCK(inp); + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { + INP_WUNLOCK(inp); + CC_LIST_RUNLOCK(); + free(ptr, M_CC_MEM); + return (ECONNRESET); + } + tp = intotcpcb(inp); + if (ptr != NULL) memset(ptr, 0, mem_sz); - INP_WLOCK_RECHECK_CLEANUP(inp, free(ptr, M_CC_MEM)); - } else - INP_WLOCK_RECHECK(inp); CC_LIST_RUNLOCK(); cc_mem.ccvc.tcp = tp; /* From nobody Fri Nov 12 23:04:13 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B8541184F92C; Fri, 12 Nov 2021 23:04:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrZ0F4j3Rz4RPn; Fri, 12 Nov 2021 23:04:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81BF039B; Fri, 12 Nov 2021 23:04:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ACN4Ded062530; Fri, 12 Nov 2021 23:04:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ACN4DSB062529; Fri, 12 Nov 2021 23:04:13 GMT (envelope-from git) Date: Fri, 12 Nov 2021 23:04:13 GMT Message-Id: <202111122304.1ACN4DSB062529@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 8db7d16526de - main - geom_vfs: lock devvp in g_vfs_close() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8db7d16526debbca6bc7a32a57fd0378e48e37de Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8db7d16526debbca6bc7a32a57fd0378e48e37de commit 8db7d16526debbca6bc7a32a57fd0378e48e37de Author: Konstantin Belousov AuthorDate: 2021-11-01 05:46:52 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-12 23:00:13 +0000 geom_vfs: lock devvp in g_vfs_close() It is needed for g_vfs_close() invalidating the buffers. We rely on the vnode lock for correctness. Reported and tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32761 --- sys/geom/geom_vfs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/geom/geom_vfs.c b/sys/geom/geom_vfs.c index 592062b8b12a..9590fee11000 100644 --- a/sys/geom/geom_vfs.c +++ b/sys/geom/geom_vfs.c @@ -302,12 +302,16 @@ g_vfs_close(struct g_consumer *cp) { struct g_geom *gp; struct g_vfs_softc *sc; + struct vnode *vp; g_topology_assert(); gp = cp->geom; sc = gp->softc; + vp = cp->private; + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); bufobj_invalbuf(sc->sc_bo, V_SAVE, 0, 0); + VOP_UNLOCK(vp); sc->sc_bo->bo_private = cp->private; gp->softc = NULL; mtx_destroy(&sc->sc_mtx); From nobody Fri Nov 12 23:04:14 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DEBA7184F89C; Fri, 12 Nov 2021 23:04:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrZ0G5jnfz4RGr; Fri, 12 Nov 2021 23:04:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A52971FE; Fri, 12 Nov 2021 23:04:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ACN4EQk062554; Fri, 12 Nov 2021 23:04:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ACN4ERg062553; Fri, 12 Nov 2021 23:04:14 GMT (envelope-from git) Date: Fri, 12 Nov 2021 23:04:14 GMT Message-Id: <202111122304.1ACN4ERg062553@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: a7b4a54d2c02 - main - getblk(): do not require devvp vnodes to be 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a7b4a54d2c02822d36bb51b1e4450e1bc14ba73a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a7b4a54d2c02822d36bb51b1e4450e1bc14ba73a commit a7b4a54d2c02822d36bb51b1e4450e1bc14ba73a Author: Konstantin Belousov AuthorDate: 2021-11-01 07:14:01 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-12 23:00:24 +0000 getblk(): do not require devvp vnodes to be locked Reported and tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32761 --- sys/kern/vfs_bio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 034bbccc437d..2b89490ce618 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -3911,7 +3911,8 @@ getblkx(struct vnode *vp, daddr_t blkno, daddr_t dblkno, int size, int slpflag, CTR3(KTR_BUF, "getblk(%p, %ld, %d)", vp, (long)blkno, size); KASSERT((flags & (GB_UNMAPPED | GB_KVAALLOC)) != GB_KVAALLOC, ("GB_KVAALLOC only makes sense with GB_UNMAPPED")); - ASSERT_VOP_LOCKED(vp, "getblk"); + if (vp->v_type != VCHR) + ASSERT_VOP_LOCKED(vp, "getblk"); if (size > maxbcachebuf) panic("getblk: size(%d) > maxbcachebuf(%d)\n", size, maxbcachebuf); From nobody Fri Nov 12 23:04:15 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E04AF184FB93; Fri, 12 Nov 2021 23:04:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrZ0J2VlTz4RQ7; Fri, 12 Nov 2021 23:04:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEEB61FF; Fri, 12 Nov 2021 23:04:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ACN4FaX062578; Fri, 12 Nov 2021 23:04:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ACN4F7X062577; Fri, 12 Nov 2021 23:04:15 GMT (envelope-from git) Date: Fri, 12 Nov 2021 23:04:15 GMT Message-Id: <202111122304.1ACN4F7X062577@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 76b05e3e3991 - main - ffs: Remove assertions about locked um_devvp in several places List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 76b05e3e399133b59fc3e740cab9ae362358c9d6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=76b05e3e399133b59fc3e740cab9ae362358c9d6 commit 76b05e3e399133b59fc3e740cab9ae362358c9d6 Author: Konstantin Belousov AuthorDate: 2021-11-01 08:04:27 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-12 23:00:33 +0000 ffs: Remove assertions about locked um_devvp in several places Namely, ffs_blkfree_cg(), and ffs_flushfiles(). Reported and tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32761 --- sys/ufs/ffs/ffs_alloc.c | 7 +++++-- sys/ufs/ffs/ffs_vfsops.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 6a262a798d1b..42708e3dce71 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -2251,9 +2251,12 @@ ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd) MPASS(devvp->v_mount->mnt_data == ump); dev = ump->um_devvp->v_rdev; } else if (devvp->v_type == VCHR) { - /* devvp is a normal disk device */ + /* + * devvp is a normal disk device + * XXXKIB: devvp is not locked there, v_rdev access depends on + * busy mount, which prevents mntfs devvp from reclamation. + */ dev = devvp->v_rdev; - ASSERT_VOP_LOCKED(devvp, "ffs_blkfree_cg"); } else return; #ifdef INVARIANTS diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index d1773402002e..d9fb02c2bd58 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1511,7 +1511,7 @@ ffs_flushfiles(mp, flags, td) */ } #endif - ASSERT_VOP_LOCKED(ump->um_devvp, "ffs_flushfiles"); + /* devvp is not locked there */ if (ump->um_devvp->v_vflag & VV_COPYONWRITE) { if ((error = vflush(mp, 0, SKIPSYSTEM | flags, td)) != 0) return (error); From nobody Fri Nov 12 23:04:16 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CB11C184FC2F; Fri, 12 Nov 2021 23:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrZ0K3FTzz4RHB; Fri, 12 Nov 2021 23:04:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED717432; Fri, 12 Nov 2021 23:04:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ACN4GvO062609; Fri, 12 Nov 2021 23:04:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ACN4G8C062608; Fri, 12 Nov 2021 23:04:16 GMT (envelope-from git) Date: Fri, 12 Nov 2021 23:04:16 GMT Message-Id: <202111122304.1ACN4G8C062608@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 25809a018db3 - main - mntfs: lock mntfs pseudo devfs vnode properly List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 25809a018db3c9f3be838c10576d2bb070cc055a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=25809a018db3c9f3be838c10576d2bb070cc055a commit 25809a018db3c9f3be838c10576d2bb070cc055a Author: Konstantin Belousov AuthorDate: 2021-11-01 12:28:32 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-12 23:00:41 +0000 mntfs: lock mntfs pseudo devfs vnode properly Require devvp locked for mntfs_freevp(), to have it locked around vgone(). Make that true for ffs, which is the only consumer of the interface. Reported and tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32761 --- sys/fs/mntfs/mntfs_vnops.c | 4 ++-- sys/ufs/ffs/ffs_vfsops.c | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/fs/mntfs/mntfs_vnops.c b/sys/fs/mntfs/mntfs_vnops.c index 2708bc5d319f..4eb12a679590 100644 --- a/sys/fs/mntfs/mntfs_vnops.c +++ b/sys/fs/mntfs/mntfs_vnops.c @@ -89,7 +89,7 @@ mntfs_allocvp(struct mount *mp, struct vnode *ovp) void mntfs_freevp(struct vnode *vp) { - + ASSERT_VOP_ELOCKED(vp, "mntfs_freevp"); vgone(vp); - vrele(vp); + vput(vp); } diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index d9fb02c2bd58..bdaf4c98b090 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -928,6 +928,7 @@ ffs_mountfs(odevvp, mp, td) devvp = mntfs_allocvp(mp, odevvp); VOP_UNLOCK(odevvp); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); KASSERT(devvp->v_type == VCHR, ("reclaimed devvp")); dev = devvp->v_rdev; KASSERT(dev->si_snapdata == NULL, ("non-NULL snapshot data")); @@ -949,6 +950,7 @@ ffs_mountfs(odevvp, mp, td) BO_LOCK(&odevvp->v_bufobj); odevvp->v_bufobj.bo_flag |= BO_NOBUFS; BO_UNLOCK(&odevvp->v_bufobj); + VOP_UNLOCK(devvp); if (dev->si_iosize_max != 0) mp->mnt_iosize_max = dev->si_iosize_max; if (mp->mnt_iosize_max > maxphys) @@ -1233,6 +1235,7 @@ out: odevvp->v_bufobj.bo_flag &= ~BO_NOBUFS; BO_UNLOCK(&odevvp->v_bufobj); atomic_store_rel_ptr((uintptr_t *)&dev->si_mountpt, 0); + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); mntfs_freevp(devvp); dev_rel(dev); return (error); @@ -1435,6 +1438,7 @@ ffs_unmount(mp, mntflags) ump->um_odevvp->v_bufobj.bo_flag &= ~BO_NOBUFS; BO_UNLOCK(&ump->um_odevvp->v_bufobj); atomic_store_rel_ptr((uintptr_t *)&ump->um_dev->si_mountpt, 0); + vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY); mntfs_freevp(ump->um_devvp); vrele(ump->um_odevvp); dev_rel(ump->um_dev); From nobody Fri Nov 12 23:04:17 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7882A184FCAC; Fri, 12 Nov 2021 23:04:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrZ0L1vn5z4RYF; Fri, 12 Nov 2021 23:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B833667; Fri, 12 Nov 2021 23:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ACN4Hnw062633; Fri, 12 Nov 2021 23:04:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ACN4Hm4062632; Fri, 12 Nov 2021 23:04:17 GMT (envelope-from git) Date: Fri, 12 Nov 2021 23:04:17 GMT Message-Id: <202111122304.1ACN4Hm4062632@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: eede22d66d00 - main - ffs_snapshot: do not assert that um_devvp is 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eede22d66d0043bf46e0aeac9496bec0a52f87a1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=eede22d66d0043bf46e0aeac9496bec0a52f87a1 commit eede22d66d0043bf46e0aeac9496bec0a52f87a1 Author: Konstantin Belousov AuthorDate: 2021-11-01 23:47:43 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-12 23:00:54 +0000 ffs_snapshot: do not assert that um_devvp is locked It is not, and the lock is not needed there Reported and tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32761 --- sys/ufs/ffs/ffs_snapshot.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index 5855a679ab84..a0d16d9eccef 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -2124,7 +2124,6 @@ ffs_snapshot_mount(mp) } VOP_UNLOCK(vp); VI_LOCK(devvp); - ASSERT_VOP_LOCKED(devvp, "ffs_snapshot_mount"); sn->sn_listsize = snaplistsize; sn->sn_blklist = (daddr_t *)snapblklist; devvp->v_vflag |= VV_COPYONWRITE; @@ -2172,7 +2171,6 @@ ffs_snapshot_unmount(mp) sn = devvp->v_rdev->si_snapdata; } try_free_snapdata(devvp); - ASSERT_VOP_LOCKED(devvp, "ffs_snapshot_unmount"); } /* From nobody Fri Nov 12 23:04:19 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F1A0D184FCB3; Fri, 12 Nov 2021 23:04:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrZ0M36zmz4RVd; Fri, 12 Nov 2021 23:04:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BB55433; Fri, 12 Nov 2021 23:04:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ACN4JTE062657; Fri, 12 Nov 2021 23:04:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ACN4JsK062656; Fri, 12 Nov 2021 23:04:19 GMT (envelope-from git) Date: Fri, 12 Nov 2021 23:04:19 GMT Message-Id: <202111122304.1ACN4JsK062656@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: d1d675cb304c - main - freevnode(): lock the freeing vnode around destroy_vpollinfo() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d1d675cb304c3cca824fbc9f932dc9d655b1ad24 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d1d675cb304c3cca824fbc9f932dc9d655b1ad24 commit d1d675cb304c3cca824fbc9f932dc9d655b1ad24 Author: Konstantin Belousov AuthorDate: 2021-11-02 02:49:13 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-12 23:01:02 +0000 freevnode(): lock the freeing vnode around destroy_vpollinfo() to satisfy locking requirements of knlist manipulations. Reported and tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32761 --- sys/kern/vfs_subr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 181d0004e940..c0214e570628 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1896,7 +1896,9 @@ freevnode(struct vnode *vp) mac_vnode_destroy(vp); #endif if (vp->v_pollinfo != NULL) { + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); destroy_vpollinfo(vp->v_pollinfo); + VOP_UNLOCK(vp); vp->v_pollinfo = NULL; } vp->v_mountedhere = NULL; From nobody Fri Nov 12 23:04:20 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 048C5184F9E0; Fri, 12 Nov 2021 23:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrZ0N41scz4Rh5; Fri, 12 Nov 2021 23:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EDEC22E; Fri, 12 Nov 2021 23:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ACN4K2b062681; Fri, 12 Nov 2021 23:04:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ACN4K8n062680; Fri, 12 Nov 2021 23:04:20 GMT (envelope-from git) Date: Fri, 12 Nov 2021 23:04:20 GMT Message-Id: <202111122304.1ACN4K8n062680@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 47b248ac6516 - main - Make locking assertions for VOP_FSYNC() and VOP_FDATASYNC() more correct List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47b248ac651683650f7852485c594e76ca375573 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=47b248ac651683650f7852485c594e76ca375573 commit 47b248ac651683650f7852485c594e76ca375573 Author: Konstantin Belousov AuthorDate: 2021-11-03 22:28:32 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-12 23:02:13 +0000 Make locking assertions for VOP_FSYNC() and VOP_FDATASYNC() more correct For devfs vnodes, it is fine to not lock vnodes for VOP_FSYNC(). Otherwise vnode must be locked exclusively, except for MNT_SHARED_WRITES() where the shared lock is enough. Reported and tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32761 --- sys/kern/vfs_subr.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ sys/kern/vnode_if.src | 8 ++++++-- sys/sys/vnode.h | 8 ++++++++ 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index c0214e570628..046b74218b80 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -5538,6 +5538,54 @@ vop_fplookup_symlink_debugpost(void *ap __unused, int rc __unused) VFS_SMR_ASSERT_ENTERED(); } + +static void +vop_fsync_debugprepost(struct vnode *vp, const char *name) +{ + if (vp->v_type == VCHR) + ; + else if (MNT_EXTENDED_SHARED(vp->v_mount)) + ASSERT_VOP_LOCKED(vp, name); + else + ASSERT_VOP_ELOCKED(vp, name); +} + +void +vop_fsync_debugpre(void *a) +{ + struct vop_fsync_args *ap; + + ap = a; + vop_fsync_debugprepost(ap->a_vp, "fsync"); +} + +void +vop_fsync_debugpost(void *a, int rc __unused) +{ + struct vop_fsync_args *ap; + + ap = a; + vop_fsync_debugprepost(ap->a_vp, "fsync"); +} + +void +vop_fdatasync_debugpre(void *a) +{ + struct vop_fdatasync_args *ap; + + ap = a; + vop_fsync_debugprepost(ap->a_vp, "fsync"); +} + +void +vop_fdatasync_debugpost(void *a, int rc __unused) +{ + struct vop_fdatasync_args *ap; + + ap = a; + vop_fsync_debugprepost(ap->a_vp, "fsync"); +} + void vop_strategy_debugpre(void *ap) { diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src index 276382738504..8ec2d3ef90fd 100644 --- a/sys/kern/vnode_if.src +++ b/sys/kern/vnode_if.src @@ -295,7 +295,9 @@ vop_revoke { }; -%% fsync vp L L L +%% fsync vp - - - +%! fsync pre vop_fsync_debugpre +%! fsync post vop_fsync_debugpost vop_fsync { IN struct vnode *vp; @@ -769,7 +771,9 @@ vop_add_writecount { }; -%% fdatasync vp L L L +%% fdatasync vp - - - +%! fdatasync pre vop_fdatasync_debugpre +%! fdatasync post vop_fdatasync_debugpost vop_fdatasync { IN struct vnode *vp; diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 18bba17011e8..6bffd7656c62 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -927,10 +927,14 @@ void vop_symlink_post(void *a, int rc); int vop_sigdefer(struct vop_vector *vop, struct vop_generic_args *a); #ifdef DEBUG_VFS_LOCKS +void vop_fdatasync_debugpre(void *a); +void vop_fdatasync_debugpost(void *a, int rc); void vop_fplookup_vexec_debugpre(void *a); void vop_fplookup_vexec_debugpost(void *a, int rc); void vop_fplookup_symlink_debugpre(void *a); void vop_fplookup_symlink_debugpost(void *a, int rc); +void vop_fsync_debugpre(void *a); +void vop_fsync_debugpost(void *a, int rc); void vop_strategy_debugpre(void *a); void vop_lock_debugpre(void *a); void vop_lock_debugpost(void *a, int rc); @@ -939,10 +943,14 @@ void vop_need_inactive_debugpre(void *a); void vop_need_inactive_debugpost(void *a, int rc); void vop_mkdir_debugpost(void *a, int rc); #else +#define vop_fdatasync_debugpre(x) do { } while (0) +#define vop_fdatasync_debugpost(x, y) do { } while (0) #define vop_fplookup_vexec_debugpre(x) do { } while (0) #define vop_fplookup_vexec_debugpost(x, y) do { } while (0) #define vop_fplookup_symlink_debugpre(x) do { } while (0) #define vop_fplookup_symlink_debugpost(x, y) do { } while (0) +#define vop_fsync_debugpre(x) do { } while (0) +#define vop_fsync_debugpost(x, y) do { } while (0) #define vop_strategy_debugpre(x) do { } while (0) #define vop_lock_debugpre(x) do { } while (0) #define vop_lock_debugpost(x, y) do { } while (0) From nobody Fri Nov 12 23:04:21 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 81990184FDA7; Fri, 12 Nov 2021 23:04:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrZ0Q3jzmz4RQm; Fri, 12 Nov 2021 23:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75080668; Fri, 12 Nov 2021 23:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ACN4LTH062705; Fri, 12 Nov 2021 23:04:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ACN4L7N062704; Fri, 12 Nov 2021 23:04:21 GMT (envelope-from git) Date: Fri, 12 Nov 2021 23:04:21 GMT Message-Id: <202111122304.1ACN4L7N062704@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: d032cda0d047 - main - DEBUG_VFS_LOCKS: stop excluding devfs and doomed vnode from asserts List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d032cda0d047869139f03cb6d34a18216a166735 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d032cda0d047869139f03cb6d34a18216a166735 commit d032cda0d047869139f03cb6d34a18216a166735 Author: Konstantin Belousov AuthorDate: 2021-10-31 21:34:57 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-12 23:02:42 +0000 DEBUG_VFS_LOCKS: stop excluding devfs and doomed vnode from asserts We do not require devvp vnode locked for metadata io. It is typically not needed indeed, since correctness of the file system using corresponding block device ensures that there is no incorrect or racy manipulations. But right now DEBUG_VFS_LOCKS option excludes both character device vnodes and completely destroyed (VBAD) vnodes from asserts. This is not too bad since WITNESS still ensures that we do not leak locks. On the other hand, asserts do not mean what they should, to the reader, and reliance on them being enforced might result in wrong code. Note that ASSERT_VOP_LOCKED() still silently accepts NULLVP, I think it is worth fixing as well, in the next round. In collaboration with: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D32761 --- sys/kern/vfs_subr.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 046b74218b80..cd784cd67961 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -5365,13 +5365,6 @@ extattr_check_cred(struct vnode *vp, int attrnamespace, struct ucred *cred, } #ifdef DEBUG_VFS_LOCKS -/* - * This only exists to suppress warnings from unlocked specfs accesses. It is - * no longer ok to have an unlocked VFS. - */ -#define IGNORE_LOCK(vp) (KERNEL_PANICKED() || (vp) == NULL || \ - (vp)->v_type == VCHR || (vp)->v_type == VBAD) - int vfs_badlock_ddb = 1; /* Drop into debugger on violation. */ SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_ddb, CTLFLAG_RW, &vfs_badlock_ddb, 0, "Drop into debugger on lock violation"); @@ -5431,26 +5424,31 @@ assert_vop_locked(struct vnode *vp, const char *str) { int locked; - if (!IGNORE_LOCK(vp)) { - locked = VOP_ISLOCKED(vp); - if (locked == 0 || locked == LK_EXCLOTHER) - vfs_badlock("is not locked but should be", str, vp); - } + if (KERNEL_PANICKED() || vp == NULL) + return; + + locked = VOP_ISLOCKED(vp); + if (locked == 0 || locked == LK_EXCLOTHER) + vfs_badlock("is not locked but should be", str, vp); } void assert_vop_unlocked(struct vnode *vp, const char *str) { + if (KERNEL_PANICKED() || vp == NULL) + return; - if (!IGNORE_LOCK(vp) && VOP_ISLOCKED(vp) == LK_EXCLUSIVE) + if (VOP_ISLOCKED(vp) == LK_EXCLUSIVE) vfs_badlock("is locked but should not be", str, vp); } void assert_vop_elocked(struct vnode *vp, const char *str) { + if (KERNEL_PANICKED() || vp == NULL) + return; - if (!IGNORE_LOCK(vp) && VOP_ISLOCKED(vp) != LK_EXCLUSIVE) + if (VOP_ISLOCKED(vp) != LK_EXCLUSIVE) vfs_badlock("is not exclusive locked but should be", str, vp); } #endif /* DEBUG_VFS_LOCKS */ From nobody Sat Nov 13 01:36:37 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A8EAB1850979; Sat, 13 Nov 2021 01:36:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrdN549mhz3JNf; Sat, 13 Nov 2021 01:36:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7086A2174; Sat, 13 Nov 2021 01:36:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AD1abSq063685; Sat, 13 Nov 2021 01:36:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AD1abYJ063684; Sat, 13 Nov 2021 01:36:37 GMT (envelope-from git) Date: Sat, 13 Nov 2021 01:36:37 GMT Message-Id: <202111130136.1AD1abYJ063684@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: ce9676de86f2 - main - pNFS: Add nfsstats counters for number of Layouts List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ce9676de86f267986f61979151101e3d8a6d61bc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=ce9676de86f267986f61979151101e3d8a6d61bc commit ce9676de86f267986f61979151101e3d8a6d61bc Author: Rick Macklem AuthorDate: 2021-11-13 01:32:55 +0000 Commit: Rick Macklem CommitDate: 2021-11-13 01:32:55 +0000 pNFS: Add nfsstats counters for number of Layouts For pNFS, Layouts are issued by the server to indicate where a file's data resides on the DS(s). This patch adds counters for how many layouts are allocated to the nfsstatsv1 structure, using two reserved fields. MFC after: 2 weeks --- sys/fs/nfs/nfsport.h | 4 ++-- sys/fs/nfsclient/nfs_clstate.c | 2 ++ sys/fs/nfsserver/nfs_nfsdstate.c | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfs/nfsport.h b/sys/fs/nfs/nfsport.h index 5dcce15f7f64..e099cf6e46f0 100644 --- a/sys/fs/nfs/nfsport.h +++ b/sys/fs/nfs/nfsport.h @@ -459,8 +459,8 @@ struct nfsstatsv1 { uint64_t rpccnt[NFSV42_NPROCS + 11]; uint64_t rpcretries; uint64_t srvrpccnt[NFSV42_NOPS + NFSV4OP_FAKENOPS + 15]; - uint64_t reserved_0; - uint64_t reserved_1; + uint64_t srvlayouts; + uint64_t cllayouts; uint64_t rpcrequests; uint64_t rpctimeouts; uint64_t rpcunexpected; diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 1df8530d0e39..082469aef1bc 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -5212,6 +5212,7 @@ nfscl_layout(struct nfsmount *nmp, vnode_t vp, u_int8_t *fhp, int fhlen, nfsly_hash); lyp->nfsly_timestamp = NFSD_MONOSEC + 120; nfscl_layoutcnt++; + nfsstatsv1.cllayouts++; } else { if (retonclose != 0) lyp->nfsly_flags |= NFSLY_RETONCLOSE; @@ -5586,6 +5587,7 @@ nfscl_freelayout(struct nfscllayout *layp) free(rp, M_NFSLAYRECALL); } nfscl_layoutcnt--; + nfsstatsv1.cllayouts--; free(layp, M_NFSLAYOUT); } diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index e6a919093738..e9acacb27cbd 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -7400,6 +7400,7 @@ nfsrv_addlayout(struct nfsrv_descript *nd, struct nfslayout **lypp, /* Insert the new layout in the lists. */ *lypp = NULL; atomic_add_int(&nfsrv_layoutcnt, 1); + nfsstatsv1.srvlayouts++; NFSBCOPY(lyp->lay_xdr, layp, lyp->lay_layoutlen); *layoutlenp = lyp->lay_layoutlen; TAILQ_INSERT_HEAD(&lhyp->list, lyp, lay_list); @@ -7492,6 +7493,7 @@ nfsrv_freelayout(struct nfslayouthead *lhp, struct nfslayout *lyp) NFSD_DEBUG(4, "Freelayout=%p\n", lyp); atomic_add_int(&nfsrv_layoutcnt, -1); + nfsstatsv1.srvlayouts--; TAILQ_REMOVE(lhp, lyp, lay_list); free(lyp, M_NFSDSTATE); } From nobody Sat Nov 13 08:48:36 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 232DB184CC1D; Sat, 13 Nov 2021 08:48:54 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hrpys2mr8z3lkX; Sat, 13 Nov 2021 08:48:53 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-lj1-f177.google.com with SMTP id k2so15785552lji.4; Sat, 13 Nov 2021 00:48:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nzHnYG0rY2pQkHF54vSeWeWmjh1scHdTpFD1Iuy9wRE=; b=MpftRxRJOBFh0yUJ0cJ6ABDSA6zrZifFZ1RANmhIZCcQ/v7y2ZLwAiCJb7aKzWltkd 2eyK/jltmm9EC2eaWwjfHD/inmXv0Tumg2qzLFR6is9sBa6k+CXBOgiy0WmpevHsScml MgICsGDHU4J4tfZc/nYn4k1hhxR87U3vB3dTfLsMAo9f//OmctOKmd4RCcdEHkG5X0QG 9rPtaVd+Wi0YIlJsc2XmMZT+Zx0mA+NIysIbUXp6m5I3FHo6W8XQ/tSsc3MRZ6B/8jF8 Wck8UpSHIGVc+gMNNHktjO2uxtnfysnc8ijq1ILvdpsODtx8rszWZsD1Lj8Z04ipU7QC SNdw== X-Gm-Message-State: AOAM533iBI8EvwtaOP4EzP00bGaETG7/ii1DaTZpES3WZIEfDh6pZ6zt wq3Q4ixrTuz/gdFcSc8DbOwVH7FBhrDFj7v2SwxHGZ6oJQg= X-Google-Smtp-Source: ABdhPJzjSfMC/byIMfsYsKyMP2ipI3olWBXC78yoDBdX8qEQlHM2F0Qv7Tzna3aX5FgJ4Hw9gGEVu7EE6QkLV4sZmkA= X-Received: by 2002:a2e:7310:: with SMTP id o16mr17719670ljc.394.1636793325909; Sat, 13 Nov 2021 00:48:45 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202111101934.1AAJYJFQ041545@gitrepo.freebsd.org> In-Reply-To: From: Antoine Brodin Date: Sat, 13 Nov 2021 08:48:36 +0000 Message-ID: Subject: Re: git: 160b4b922b60 - main - Add real sched.h To: Konstantin Belousov Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4Hrpys2mr8z3lkX X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of antoinebrodinfreebsd@gmail.com designates 209.85.208.177 as permitted sender) smtp.mailfrom=antoinebrodinfreebsd@gmail.com X-Spamd-Result: default: False [-1.00 / 15.00]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(1.00)[1.000]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.177:from]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[antoine@freebsd.org,antoinebrodinfreebsd@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.177:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[antoine@freebsd.org,antoinebrodinfreebsd@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N On Thu, Nov 11, 2021 at 8:06 AM Konstantin Belousov wrote: > > On Thu, Nov 11, 2021 at 07:29:19AM +0000, Antoine Brodin wrote: > > On Wed, Nov 10, 2021 at 7:34 PM Konstantin Belousov wrote: > > > > > > The branch main has been updated by kib: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=160b4b922b6021848b6b48afc894d16b879b7af2 > > > > > > commit 160b4b922b6021848b6b48afc894d16b879b7af2 > > > Author: Konstantin Belousov > > > AuthorDate: 2021-10-22 15:17:21 +0000 > > > Commit: Konstantin Belousov > > > CommitDate: 2021-11-10 19:18:53 +0000 > > > > > > Add real sched.h > > > > > > It is required by IEEE Std 1003.1-2008 AKA POSIX. > > > > > > Put some Linux compatibility stuff under BSD_VISIBLE namespace, in > > > particular, sys/cpuset.h definitions. Also, if user really want > > > Linux compatibility, she can request cpu_set_t typedef with > > > _WITH_CPU_SET_T define. > > > > > > Reviewed by: jhb > > > Sponsored by: The FreeBSD Foundation > > > MFC after: 1 week > > > Differential revision: https://reviews.freebsd.org/D32901 > > > --- > > > include/Makefile | 5 +++-- > > > include/sched.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ > > > 2 files changed, 49 insertions(+), 2 deletions(-) > > > > Hi, > > > > It seems that this broke some ports: > > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/ninja-1.10.2,2.log > > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/ghc-8.10.7.log > > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/openpgm-5.2.122_6.log > > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/guile2-2.2.7_1.log > > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/liburcu-0.12.1.log > > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/guile-3.0.7.log > > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/squid-4.15.log > > ... > > Could you please try this? My intent was that cpu_set_t would be requested > as needed by consumers with _WITH_CPU_SET_T. > > commit b6bb08f09dc7cf2796c35015f5aee93dedf33018 > Author: Konstantin Belousov > Date: Thu Nov 11 10:01:54 2021 +0200 > > sched.h: Make cpu_set_t compat typedef visible unconditionally > > or rather, visible if BSD namespace is enabled, instead of requiring > _WITH_CPU_SET_T define to expose it. It seems a lot of code assumes > that presence of sched_getaffinity() implies existence of cpu_set_t. > > Reported by: portmgr (antoine) > Sponsored by: The FreeBSD Foundation > MFC after: 1 week Hello, With this patch, this is better (less broken ports). But this seems to expose problems with other headers ( sys/bitset.h for instance) http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/xplanet-1.3.1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/mixxx22-2.2.4_7.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/Sorcer-lv2-1.1.3_8.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/polygraph-4.13.0_2.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/stress-ng-0.13.06.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/abyss-2.3.1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/gcta-1.26.0_3.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/gemma-0.98.3_1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/iqtree-2.0.6_2.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/ncbi-blast+-2.12.0_1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/ncbi-cxx-toolkit-25.2.0.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/rna-STAR-2.7.3.a_1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/mysql57-server-5.7.36.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/mysql80-server-8.0.26_1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/mysqlwsrep57-server-5.7.34.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/percona57-pam-for-mysql-5.7.34.37.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/percona57-server-5.7.34.37.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/maliit-framework-2.1.1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/electron12-12.2.2.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/kdevelop-pg-qt-2.2.1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/libvirt-7.9.0.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/util-linux-2.36_2.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/tea-60.5.1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/jzintv-1.0.20200712,1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/libc6-shim-20210627.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/mame-0.226_1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/mess-0.226_1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/keeperrl-0.0.23_5.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/RetroArch-1.9.7.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/stonesoup-sdl-0.27.1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/stonesoup-0.27.1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/mypaint-2.0.0_3.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/gcc11-11.2.0.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/gcc11-devel-11.2.1.s20211009.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/gcc12-devel-12.0.0.s20211010.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/mono-5.10.1.57_3.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/mono5.10-5.10.1.57_3.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/mono5.20-5.20.1.34.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/mono6.8-6.8.0.123.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/exim-4.94.2_1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/exim-ldap2-4.94.2_1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/exim-monitor-4.94.2_1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/exim-mysql-4.94.2_1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/exim-postgresql-4.94.2_1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/exim-sa-exim-4.94.2+4.2.1_1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/exim-sqlite-4.94.2_1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/giacxcas-1.6.0.7_3.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/libnormaliz-3.9.0_1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/libmediainfo-21.09.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/pipewire-0.3.36_1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/aircrack-ng-1.5.2_2.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/ettercap-0.8.3.1,1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/glusterfs-8.4.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/nepenthes-0.2.2_16.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/relayd-5.5.20140810_8.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/yate-6.4.0_1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/miktex-21.8.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/bagel-1.2.2_6.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/qbox-1.73.3.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/openssh-portable-hpn-8.8.p1_1,1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/openssh-portable-8.8.p1_1,1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/flock-2.30.1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/intel-pcm-202109.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/intel-pcm-devel-g20211013,1.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/zbackup-1.4.4_19.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/apt-cacher-ng-3.2_2.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/node10-10.24.1_2.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/proxygen-2021.11.01.00.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/squid-4.15.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/squid-devel-5.0.6.log http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/vdr-plugin-live-0.3.0_5.log Antoine From nobody Sat Nov 13 09:09:51 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9C94518575BD; Sat, 13 Nov 2021 09:09:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrqR3451qz3st0; Sat, 13 Nov 2021 09:09:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6833110ABC; Sat, 13 Nov 2021 09:09:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AD99peQ065139; Sat, 13 Nov 2021 09:09:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AD99pir065138; Sat, 13 Nov 2021 09:09:51 GMT (envelope-from git) Date: Sat, 13 Nov 2021 09:09:51 GMT Message-Id: <202111130909.1AD99pir065138@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andriy Gapon Subject: git: 00c06804a87c - main - add rk3328 overlay for enabling analog sound List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 00c06804a87c5ddbd91f188280331e3076c1b81c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=00c06804a87c5ddbd91f188280331e3076c1b81c commit 00c06804a87c5ddbd91f188280331e3076c1b81c Author: Andriy Gapon AuthorDate: 2021-06-09 07:43:39 +0000 Commit: Andriy Gapon CommitDate: 2021-11-13 09:09:23 +0000 add rk3328 overlay for enabling analog sound MFC after: 1 week --- sys/dts/arm64/overlays/rk3328-analog-sound.dtso | 12 ++++++++++++ sys/modules/dtb/rockchip/Makefile | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sys/dts/arm64/overlays/rk3328-analog-sound.dtso b/sys/dts/arm64/overlays/rk3328-analog-sound.dtso new file mode 100644 index 000000000000..c73635ce3b4e --- /dev/null +++ b/sys/dts/arm64/overlays/rk3328-analog-sound.dtso @@ -0,0 +1,12 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "rockchip,rk3328"; +}; + +&{/analog-sound} { + status = "okay"; +}; + +/* vim: set ft=dts: */ diff --git a/sys/modules/dtb/rockchip/Makefile b/sys/modules/dtb/rockchip/Makefile index 93ad5c6676ab..3daf38fb8238 100644 --- a/sys/modules/dtb/rockchip/Makefile +++ b/sys/modules/dtb/rockchip/Makefile @@ -19,7 +19,8 @@ DTS= \ rockchip/rk3399-firefly.dts \ rockchip/rk3399-rockpro64.dts -DTSO= rk3328-dwc3.dtso \ +DTSO= rk3328-analog-sound.dtso \ + rk3328-dwc3.dtso \ rk3399-mmc0-disable.dtso \ rk3399-mmc1-disable.dtso \ rk3399-sdhci-disable.dtso From nobody Sat Nov 13 09:20:34 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 096DD185E8AA; Sat, 13 Nov 2021 09:20:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrqgQ6w2xz4T4W; Sat, 13 Nov 2021 09:20:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9BA210C2D; Sat, 13 Nov 2021 09:20:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AD9KYgP088181; Sat, 13 Nov 2021 09:20:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AD9KYKO088170; Sat, 13 Nov 2021 09:20:34 GMT (envelope-from git) Date: Sat, 13 Nov 2021 09:20:34 GMT Message-Id: <202111130920.1AD9KYKO088170@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andriy Gapon Subject: git: e17b58ecbcb6 - main - sddadone: 'error' gets assigned only errno codes, never MMC_ERR codes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e17b58ecbcb644f76cceda4ca7ff08f7677b5dfd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=e17b58ecbcb644f76cceda4ca7ff08f7677b5dfd commit e17b58ecbcb644f76cceda4ca7ff08f7677b5dfd Author: Andriy Gapon AuthorDate: 2021-07-09 14:28:40 +0000 Commit: Andriy Gapon CommitDate: 2021-11-13 09:20:14 +0000 sddadone: 'error' gets assigned only errno codes, never MMC_ERR codes MFC after: 2 weeks --- sys/cam/mmc/mmc_da.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cam/mmc/mmc_da.c b/sys/cam/mmc/mmc_da.c index 4212e2aa805d..0dfa43f4679b 100644 --- a/sys/cam/mmc/mmc_da.c +++ b/sys/cam/mmc/mmc_da.c @@ -1938,7 +1938,7 @@ sddadone(struct cam_periph *periph, union ccb *done_ccb) /*reduction*/0, /*timeout*/0, /*getcount_only*/0); - error = 5; /* EIO */ + error = EIO; } else { if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) panic("REQ_CMP with QFRZN"); @@ -1959,7 +1959,7 @@ sddadone(struct cam_periph *periph, union ccb *done_ccb) softc->outstanding_cmds--; /* Complete partition switch */ softc->state = SDDA_STATE_NORMAL; - if (error != MMC_ERR_NONE) { + if (error != 0) { /* TODO: Unpause retune if accessing RPMB */ xpt_release_ccb(done_ccb); xpt_schedule(periph, CAM_PRIORITY_NORMAL); From nobody Sat Nov 13 09:21:28 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A6EBA185EAEE; Sat, 13 Nov 2021 09:21:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrqhS3jJzz4Tg9; Sat, 13 Nov 2021 09:21:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F160110B0; Sat, 13 Nov 2021 09:21:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AD9LSEw091774; Sat, 13 Nov 2021 09:21:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AD9LStw091773; Sat, 13 Nov 2021 09:21:28 GMT (envelope-from git) Date: Sat, 13 Nov 2021 09:21:28 GMT Message-Id: <202111130921.1AD9LStw091773@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andriy Gapon Subject: git: 53b356f17ab8 - main - audio_soc: remove useless call to pcm_getbuffersize List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 53b356f17ab81cfff14863dc429ee9b38a1fc1d4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=53b356f17ab81cfff14863dc429ee9b38a1fc1d4 commit 53b356f17ab81cfff14863dc429ee9b38a1fc1d4 Author: Andriy Gapon AuthorDate: 2021-09-24 16:22:53 +0000 Commit: Andriy Gapon CommitDate: 2021-11-13 09:20:59 +0000 audio_soc: remove useless call to pcm_getbuffersize Its result was not used and it does not have any side-effects. MFC after: 2 weeks --- sys/dev/sound/fdt/audio_soc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/dev/sound/fdt/audio_soc.c b/sys/dev/sound/fdt/audio_soc.c index eeb55d85420e..6ce64cc9eeed 100644 --- a/sys/dev/sound/fdt/audio_soc.c +++ b/sys/dev/sound/fdt/audio_soc.c @@ -408,8 +408,6 @@ audio_soc_init(void *arg) return; } - pcm_getbuffersize(sc->dev, AUDIO_BUFFER_SIZE, AUDIO_BUFFER_SIZE, - AUDIO_BUFFER_SIZE); sc->play_channel.sc = sc; sc->rec_channel.sc = sc; From nobody Sat Nov 13 09:23:41 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B9DC2185FF22; Sat, 13 Nov 2021 09:23:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hrql14xFxz4WgX; Sat, 13 Nov 2021 09:23:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B23A10F9B; Sat, 13 Nov 2021 09:23:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AD9NfTp092052; Sat, 13 Nov 2021 09:23:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AD9NfQK092051; Sat, 13 Nov 2021 09:23:41 GMT (envelope-from git) Date: Sat, 13 Nov 2021 09:23:41 GMT Message-Id: <202111130923.1AD9NfQK092051@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andriy Gapon Subject: git: 27645265c4e4 - main - ds1307: allow configuration via hints on FDT-based systems List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 27645265c4e49ad7eaa25847a280307acb138da8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=27645265c4e49ad7eaa25847a280307acb138da8 commit 27645265c4e49ad7eaa25847a280307acb138da8 Author: Andriy Gapon AuthorDate: 2021-11-04 11:55:35 +0000 Commit: Andriy Gapon CommitDate: 2021-11-13 09:23:10 +0000 ds1307: allow configuration via hints on FDT-based systems On-board devices should be configured via the FDT and overlays. Hints are primarily useful for external and temporarily attached devices. Adding hints is much easier and faster than writing and compiling an overlay. MFC after: 2 weeks --- sys/dev/iicbus/ds1307.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/sys/dev/iicbus/ds1307.c b/sys/dev/iicbus/ds1307.c index 7bab7e78c0d8..47f47bb07f5e 100644 --- a/sys/dev/iicbus/ds1307.c +++ b/sys/dev/iicbus/ds1307.c @@ -216,18 +216,13 @@ ds1307_probe(device_t dev) return (ENXIO); compat = ofw_bus_search_compatible(dev, ds1307_compat_data); - - if (compat->ocd_str == NULL) - return (ENXIO); - - device_set_desc(dev, (const char *)compat->ocd_data); - - return (BUS_PROBE_DEFAULT); -#else + if (compat->ocd_str != NULL) { + device_set_desc(dev, (const char *)compat->ocd_data); + return (BUS_PROBE_DEFAULT); + } +#endif device_set_desc(dev, "Maxim DS1307 RTC"); - return (BUS_PROBE_NOWILDCARD); -#endif } static int From nobody Sat Nov 13 09:25:21 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 41B5818385B6; Sat, 13 Nov 2021 09:25:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hrqmy07Vpz4X80; Sat, 13 Nov 2021 09:25:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B13B010F9C; Sat, 13 Nov 2021 09:25:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AD9PL6L092289; Sat, 13 Nov 2021 09:25:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AD9PL9D092288; Sat, 13 Nov 2021 09:25:21 GMT (envelope-from git) Date: Sat, 13 Nov 2021 09:25:21 GMT Message-Id: <202111130925.1AD9PL9D092288@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andriy Gapon Subject: git: 01e3492337cb - main - icee: allow configuration via hints on FDT-based systems List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 01e3492337cb48484e03be38340cc67ac5e30a5b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=01e3492337cb48484e03be38340cc67ac5e30a5b commit 01e3492337cb48484e03be38340cc67ac5e30a5b Author: Andriy Gapon AuthorDate: 2021-11-04 11:56:22 +0000 Commit: Andriy Gapon CommitDate: 2021-11-13 09:24:57 +0000 icee: allow configuration via hints on FDT-based systems On-board devices should be configured via the FDT and overlays. Hints are primarily useful for external and temporarily attached devices. Adding hints is much easier and faster than writing and compiling an overlay. MFC after: 2 weeks --- sys/dev/iicbus/icee.c | 64 +++++++++++++++++++++------------------------------ 1 file changed, 26 insertions(+), 38 deletions(-) diff --git a/sys/dev/iicbus/icee.c b/sys/dev/iicbus/icee.c index 19aff78bf45a..a658d73cb875 100644 --- a/sys/dev/iicbus/icee.c +++ b/sys/dev/iicbus/icee.c @@ -123,10 +123,10 @@ static struct cdevsw icee_cdevsw = .d_write = icee_write }; -#ifdef FDT static int icee_probe(device_t dev) { +#ifdef FDT struct eeprom_desc *d; if (!ofw_bus_status_okay(dev)) @@ -134,49 +134,42 @@ icee_probe(device_t dev) d = (struct eeprom_desc *) ofw_bus_search_compatible(dev, compat_data)->ocd_data; - if (d == NULL) - return (ENXIO); - - device_set_desc(dev, d->name); - return (BUS_PROBE_DEFAULT); -} - -static void -icee_init(struct icee_softc *sc) -{ - struct eeprom_desc *d; - - d = (struct eeprom_desc *) - ofw_bus_search_compatible(sc->dev, compat_data)->ocd_data; - if (d == NULL) - return; /* attach will see sc->size == 0 and return error */ - - sc->size = d->size; - sc->type = d->type; - sc->wr_sz = d->wr_sz; -} -#else /* !FDT */ -static int -icee_probe(device_t dev) -{ - + if (d != NULL) { + device_set_desc(dev, d->name); + return (BUS_PROBE_DEFAULT); + } +#endif device_set_desc(dev, "I2C EEPROM"); return (BUS_PROBE_NOWILDCARD); } -static void +static int icee_init(struct icee_softc *sc) { const char *dname; int dunit; +#ifdef FDT + struct eeprom_desc *d; + d = (struct eeprom_desc *) + ofw_bus_search_compatible(sc->dev, compat_data)->ocd_data; + if (d != NULL) { + sc->size = d->size; + sc->type = d->type; + sc->wr_sz = d->wr_sz; + return (0); + } +#endif dname = device_get_name(sc->dev); dunit = device_get_unit(sc->dev); - resource_int_value(dname, dunit, "size", &sc->size); - resource_int_value(dname, dunit, "type", &sc->type); - resource_int_value(dname, dunit, "wr_sz", &sc->wr_sz); + if (resource_int_value(dname, dunit, "type", &sc->type) != 0) + return (ENOENT); + if (resource_int_value(dname, dunit, "size", &sc->size) != 0) + return (ENOENT); + if (resource_int_value(dname, dunit, "wr_sz", &sc->wr_sz) != 0) + return (ENOENT); + return (0); } -#endif /* FDT */ static int icee_attach(device_t dev) @@ -187,13 +180,8 @@ icee_attach(device_t dev) sc->dev = dev; sc->addr = iicbus_get_addr(dev); - icee_init(sc); - if (sc->size == 0 || sc->type == 0 || sc->wr_sz == 0) { - device_printf(sc->dev, "Missing config data, " - "these cannot be zero: size %d type %d wr_sz %d\n", - sc->size, sc->type, sc->wr_sz); + if (icee_init(sc) != 0) return (EINVAL); - } if (bootverbose) device_printf(dev, "size: %d bytes, addressing: %d-bits\n", sc->size, sc->type); From nobody Sat Nov 13 09:28:19 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B9CFA183970C; Sat, 13 Nov 2021 09:28:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrqrM4Wt8z4Xfv; Sat, 13 Nov 2021 09:28:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C19910E7C; Sat, 13 Nov 2021 09:28:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AD9SJ9l092608; Sat, 13 Nov 2021 09:28:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AD9SJYx092607; Sat, 13 Nov 2021 09:28:19 GMT (envelope-from git) Date: Sat, 13 Nov 2021 09:28:19 GMT Message-Id: <202111130928.1AD9SJYx092607@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andriy Gapon Subject: git: c0525ab1d1ce - main - pca954x: driver for PCA954x / TCA954x I2C switches List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: avg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c0525ab1d1ce69ab3d589e95733caedb04e0dcbd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=c0525ab1d1ce69ab3d589e95733caedb04e0dcbd commit c0525ab1d1ce69ab3d589e95733caedb04e0dcbd Author: Andriy Gapon AuthorDate: 2020-08-18 09:16:28 +0000 Commit: Andriy Gapon CommitDate: 2021-11-13 09:27:41 +0000 pca954x: driver for PCA954x / TCA954x I2C switches At the moment only PCA9548A is supported and has been tested. MFC after: 2 weeks --- share/man/man4/Makefile | 1 + share/man/man4/pca954x.4 | 119 +++++++++++++++++++ sys/conf/files | 1 + sys/dev/iicbus/mux/pca954x.c | 214 +++++++++++++++++++++++++++++++++++ sys/modules/i2c/mux/Makefile | 1 + sys/modules/i2c/mux/pca954x/Makefile | 20 ++++ 6 files changed, 356 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index d3cd58b495f4..dfef254bff56 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -418,6 +418,7 @@ MAN= aac.4 \ owc.4 \ ${_padlock.4} \ pass.4 \ + pca954x.4 \ pccard.4 \ pccbb.4 \ pcf.4 \ diff --git a/share/man/man4/pca954x.4 b/share/man/man4/pca954x.4 new file mode 100644 index 000000000000..d845740f9b6c --- /dev/null +++ b/share/man/man4/pca954x.4 @@ -0,0 +1,119 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2020 Andriy Gapon +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 13, 2021 +.Dt PCA954X 4 +.Os +.Sh NAME +.Nm pca954x +.Nd driver for PCA9548A I2C switch +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device pca954x" +.Cd "device iicmux" +.Cd "device iicbus" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +pca954x_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver supports the PCA9548A I2C bus switch and compatible chips such as +TCA9548A. +It automatically connects an upstream I2C bus to one of several downstream +buses as needed when slave devices on the downstream buses initiate I/O. +More information on the automatic switching behavior is available in +.Xr iicmux 4 . +.Sh FDT CONFIGURATION +On an +.Xr FDT 4 +based system, an +.Nm +device node is defined as a child node of its upstream I2C bus. +The children of the +.Nm +node are additional I2C buses, which will have their own I2C slave +devices described in their child nodes. +.Pp +The +.Nm +driver attaches to nodes where the +.Va compatible +property is set to one of +.Bl -bullet +.It +.Qq nxp,pca9548 +.El +.Pp +The +.Nm +driver supports the following optional properties in addition to the standard +I2C mux properties: +.Bl -tag -width i2c-mux-idle-disconnect +.It Va i2c-mux-idle-disconnect +if defined, forces the switch to disconnect all children in idle state. +.El +.Sh HINTS CONFIGURATION +On a +.Xr device.hints 5 +based system, these values are configurable for +.Nm : +.Bl -tag -width hint.pca954x..chip_type +.It Va hint.pca954x..at +The upstream +.Xr iicbus 4 +the +.Nm +instance is attached to. +.It Va hint.pca954x..chip_type +The type of the chip. +At present, only +.Qq pca9548 +is supported. +.El +.Pp +When configured via hints, the driver automatically adds an +.Xr iicbus 4 +instance for every downstream bus supported by the chip. +There is currently no way to indicate used versus unused channels. +.Sh SEE ALSO +.Xr iicbus 4 , +.Xr iicmux 4 +.Sh HISTORY +The +.Nm +driver and this manual page was written by +.An Andriy Gapon Aq Mt avg@FreeBSD.org . diff --git a/sys/conf/files b/sys/conf/files index 30f98817e290..4cc6e3dcde8c 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1855,6 +1855,7 @@ dev/iicbus/mux/iicmux.c optional iicmux dev/iicbus/mux/iicmux_if.m optional iicmux dev/iicbus/mux/iic_gpiomux.c optional iic_gpiomux fdt dev/iicbus/mux/ltc430x.c optional ltc430x +dev/iicbus/mux/pca954x.c optional pca954x dev/iicbus/nxprtc.c optional nxprtc | pcf8563 dev/iicbus/ofw_iicbus.c optional fdt iicbus dev/iicbus/pcf8574.c optional pcf8574 diff --git a/sys/dev/iicbus/mux/pca954x.c b/sys/dev/iicbus/mux/pca954x.c new file mode 100644 index 000000000000..44c81539691e --- /dev/null +++ b/sys/dev/iicbus/mux/pca954x.c @@ -0,0 +1,214 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) Andriy Gapon + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" + +#include +#include +#include +#include +#include + +#ifdef FDT +#include +#include +#include +#endif + +#include +#include +#include "iicbus_if.h" +#include "iicmux_if.h" +#include + +struct pca954x_descr { + const char *partname; + const char *description; + int numchannels; +}; + +static struct pca954x_descr pca9548_descr = { + .partname = "pca9548", + .description = "PCA9548A I2C Mux", + .numchannels = 8, +}; + +#ifdef FDT +static struct ofw_compat_data compat_data[] = { + { "nxp,pca9548", (uintptr_t)&pca9548_descr }, + { NULL, 0 }, +}; +#else +static struct pca954x_descr *part_descrs[] = { + &pca9548_descr, +}; +#endif + +struct pca954x_softc { + struct iicmux_softc mux; + uint8_t addr; + bool idle_disconnect; +}; + +static int +pca954x_bus_select(device_t dev, int busidx, struct iic_reqbus_data *rd) +{ + struct iic_msg msg; + struct pca954x_softc *sc = device_get_softc(dev); + uint8_t busbits; + int error; + + /* + * The iicmux caller ensures busidx is between 0 and the number of buses + * we passed to iicmux_init_softc(), no need for validation here. If + * the fdt data has the idle_disconnect property we idle the bus by + * selecting no downstream buses, otherwise we just leave the current + * bus active. + */ + if (busidx == IICMUX_SELECT_IDLE) { + if (sc->idle_disconnect) + busbits = 0; + else + return (0); + } else { + busbits = 1u << busidx; + } + + msg.slave = sc->addr; + msg.flags = IIC_M_WR; + msg.len = 1; + msg.buf = &busbits; + error = iicbus_transfer(dev, &msg, 1); + return (error); +} + +static const struct pca954x_descr * +pca954x_find_chip(device_t dev) +{ +#ifdef FDT + const struct ofw_compat_data *compat; + + compat = ofw_bus_search_compatible(dev, compat_data); + if (compat == NULL) + return (NULL); + return ((const struct pca954x_descr *)compat->ocd_data); +#else + const char *type; + int i; + + if (resource_string_value(device_get_name(dev), device_get_unit(dev), + "chip_type", &type) == 0) { + for (i = 0; i < nitems(part_descrs) - 1; ++i) { + if (strcasecmp(type, part_descrs[i]->partname) == 0) + return (part_descrs[i]); + } + } + return (NULL); +#endif +} + +static int +pca954x_probe(device_t dev) +{ + const struct pca954x_descr *descr; + + descr = pca954x_find_chip(dev); + if (descr == NULL) + return (ENXIO); + + device_set_desc(dev, descr->description); + return (BUS_PROBE_DEFAULT); +} + +static int +pca954x_attach(device_t dev) +{ +#ifdef FDT + phandle_t node; +#endif + struct pca954x_softc *sc; + const struct pca954x_descr *descr; + int err; + + sc = device_get_softc(dev); + sc->addr = iicbus_get_addr(dev); +#ifdef FDT + node = ofw_bus_get_node(dev); + sc->idle_disconnect = OF_hasprop(node, "i2c-mux-idle-disconnect"); +#endif + + descr = pca954x_find_chip(dev); + err = iicmux_attach(dev, device_get_parent(dev), descr->numchannels); + if (err == 0) + bus_generic_attach(dev); + return (err); +} + +static int +pca954x_detach(device_t dev) +{ + int err; + + err = iicmux_detach(dev); + return (err); +} + +static device_method_t pca954x_methods[] = { + /* device methods */ + DEVMETHOD(device_probe, pca954x_probe), + DEVMETHOD(device_attach, pca954x_attach), + DEVMETHOD(device_detach, pca954x_detach), + + /* iicmux methods */ + DEVMETHOD(iicmux_bus_select, pca954x_bus_select), + + DEVMETHOD_END +}; + +static devclass_t pca954x_devclass; + +DEFINE_CLASS_1(pca9548, pca954x_driver, pca954x_methods, + sizeof(struct pca954x_softc), iicmux_driver); +DRIVER_MODULE(pca9548, iicbus, pca954x_driver, pca954x_devclass, 0, 0); + +#ifdef FDT +DRIVER_MODULE(ofw_iicbus, pca9548, ofw_iicbus_driver, ofw_iicbus_devclass, 0, 0); +#else +DRIVER_MODULE(iicbus, pca9548, iicbus_driver, iicbus_devclass, 0, 0); +#endif + +MODULE_DEPEND(pca9548, iicmux, 1, 1, 1); +MODULE_DEPEND(pca9548, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); +MODULE_VERSION(pca9548, 1); + +#ifdef FDT +IICBUS_FDT_PNP_INFO(compat_data); +#endif diff --git a/sys/modules/i2c/mux/Makefile b/sys/modules/i2c/mux/Makefile index 8e228a7a7fef..a972a00a3b3a 100644 --- a/sys/modules/i2c/mux/Makefile +++ b/sys/modules/i2c/mux/Makefile @@ -3,6 +3,7 @@ SUBDIR = \ iicmux \ ltc430x \ + pca954x \ .if !empty(OPT_FDT) SUBDIR+= iic_gpiomux diff --git a/sys/modules/i2c/mux/pca954x/Makefile b/sys/modules/i2c/mux/pca954x/Makefile new file mode 100644 index 000000000000..622b327204c5 --- /dev/null +++ b/sys/modules/i2c/mux/pca954x/Makefile @@ -0,0 +1,20 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/iicbus/mux + +KMOD= pca954x +SRCS= pca954x.c + +SRCS+= \ + bus_if.h \ + device_if.h \ + iicbus_if.h \ + iicmux_if.h \ + opt_platform.h \ + +.if !empty(OPT_FDT) +SRCS+= ofw_bus_if.h +.endif + + +.include From nobody Sat Nov 13 12:21:01 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 173AE1847931; Sat, 13 Nov 2021 12:21:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hrvgr50qzz4Vm8; Sat, 13 Nov 2021 12:21:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 1ADCL10N072632 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 13 Nov 2021 14:21:04 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 1ADCL10N072632 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 1ADCL1Pg072631; Sat, 13 Nov 2021 14:21:01 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 13 Nov 2021 14:21:01 +0200 From: Konstantin Belousov To: Antoine Brodin Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 160b4b922b60 - main - Add real sched.h Message-ID: References: <202111101934.1AAJYJFQ041545@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4Hrvgr50qzz4Vm8 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Sat, Nov 13, 2021 at 08:48:36AM +0000, Antoine Brodin wrote: > On Thu, Nov 11, 2021 at 8:06 AM Konstantin Belousov wrote: > > > > On Thu, Nov 11, 2021 at 07:29:19AM +0000, Antoine Brodin wrote: > > > On Wed, Nov 10, 2021 at 7:34 PM Konstantin Belousov wrote: > > > > > > > > The branch main has been updated by kib: > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=160b4b922b6021848b6b48afc894d16b879b7af2 > > > > > > > > commit 160b4b922b6021848b6b48afc894d16b879b7af2 > > > > Author: Konstantin Belousov > > > > AuthorDate: 2021-10-22 15:17:21 +0000 > > > > Commit: Konstantin Belousov > > > > CommitDate: 2021-11-10 19:18:53 +0000 > > > > > > > > Add real sched.h > > > > > > > > It is required by IEEE Std 1003.1-2008 AKA POSIX. > > > > > > > > Put some Linux compatibility stuff under BSD_VISIBLE namespace, in > > > > particular, sys/cpuset.h definitions. Also, if user really want > > > > Linux compatibility, she can request cpu_set_t typedef with > > > > _WITH_CPU_SET_T define. > > > > > > > > Reviewed by: jhb > > > > Sponsored by: The FreeBSD Foundation > > > > MFC after: 1 week > > > > Differential revision: https://reviews.freebsd.org/D32901 > > > > --- > > > > include/Makefile | 5 +++-- > > > > include/sched.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ > > > > 2 files changed, 49 insertions(+), 2 deletions(-) > > > > > > Hi, > > > > > > It seems that this broke some ports: > > > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/ninja-1.10.2,2.log > > > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/ghc-8.10.7.log > > > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/openpgm-5.2.122_6.log > > > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/guile2-2.2.7_1.log > > > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/liburcu-0.12.1.log > > > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/guile-3.0.7.log > > > http://gohan03.nyi.freebsd.org/data/main-amd64-default-baseline/p913ccecf2a92_s448bcd01dc/logs/errors/squid-4.15.log > > > ... > > > > Could you please try this? My intent was that cpu_set_t would be requested > > as needed by consumers with _WITH_CPU_SET_T. > > > > commit b6bb08f09dc7cf2796c35015f5aee93dedf33018 > > Author: Konstantin Belousov > > Date: Thu Nov 11 10:01:54 2021 +0200 > > > > sched.h: Make cpu_set_t compat typedef visible unconditionally > > > > or rather, visible if BSD namespace is enabled, instead of requiring > > _WITH_CPU_SET_T define to expose it. It seems a lot of code assumes > > that presence of sched_getaffinity() implies existence of cpu_set_t. > > > > Reported by: portmgr (antoine) > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > > Hello, > > With this patch, this is better (less broken ports). > But this seems to expose problems with other headers ( sys/bitset.h > for instance) > > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/xplanet-1.3.1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/mixxx22-2.2.4_7.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/Sorcer-lv2-1.1.3_8.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/polygraph-4.13.0_2.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/stress-ng-0.13.06.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/abyss-2.3.1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/gcta-1.26.0_3.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/gemma-0.98.3_1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/iqtree-2.0.6_2.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/ncbi-blast+-2.12.0_1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/ncbi-cxx-toolkit-25.2.0.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/rna-STAR-2.7.3.a_1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/mysql57-server-5.7.36.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/mysql80-server-8.0.26_1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/mysqlwsrep57-server-5.7.34.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/percona57-pam-for-mysql-5.7.34.37.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/percona57-server-5.7.34.37.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/maliit-framework-2.1.1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/electron12-12.2.2.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/kdevelop-pg-qt-2.2.1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/libvirt-7.9.0.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/util-linux-2.36_2.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/tea-60.5.1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/jzintv-1.0.20200712,1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/libc6-shim-20210627.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/mame-0.226_1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/mess-0.226_1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/keeperrl-0.0.23_5.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/RetroArch-1.9.7.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/stonesoup-sdl-0.27.1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/stonesoup-0.27.1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/mypaint-2.0.0_3.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/gcc11-11.2.0.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/gcc11-devel-11.2.1.s20211009.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/gcc12-devel-12.0.0.s20211010.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/mono-5.10.1.57_3.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/mono5.10-5.10.1.57_3.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/mono5.20-5.20.1.34.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/mono6.8-6.8.0.123.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/exim-4.94.2_1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/exim-ldap2-4.94.2_1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/exim-monitor-4.94.2_1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/exim-mysql-4.94.2_1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/exim-postgresql-4.94.2_1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/exim-sa-exim-4.94.2+4.2.1_1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/exim-sqlite-4.94.2_1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/giacxcas-1.6.0.7_3.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/libnormaliz-3.9.0_1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/libmediainfo-21.09.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/pipewire-0.3.36_1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/aircrack-ng-1.5.2_2.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/ettercap-0.8.3.1,1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/glusterfs-8.4.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/nepenthes-0.2.2_16.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/relayd-5.5.20140810_8.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/yate-6.4.0_1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/miktex-21.8.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/bagel-1.2.2_6.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/qbox-1.73.3.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/openssh-portable-hpn-8.8.p1_1,1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/openssh-portable-8.8.p1_1,1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/flock-2.30.1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/intel-pcm-202109.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/intel-pcm-devel-g20211013,1.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/zbackup-1.4.4_19.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/apt-cacher-ng-3.2_2.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/node10-10.24.1_2.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/proxygen-2021.11.01.00.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/squid-4.15.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/squid-devel-5.0.6.log > http://gohan04.nyi.freebsd.org/data/main-amd64-sched-default/2021-11-11_09h04m08s/logs/errors/vdr-plugin-live-0.3.0_5.log Sigh. So ut cannot work this way. Of course I can (and probably should) implement missing Linux CPU_* macros, but BIT_* macros have incompatible API. There is no other way than requiring each program to opt-in by defining _WITH_CPU_SET_T, instead of trying to be fully Linux-compatible there. I will commit the following patch after buildworld finishes. I am not sure if it makes sense to do dedicated exp-run to see if I missed something, or just wait for regular run to finish with updated world. In any case, please ping me. commit 49c92416389668ab1b4c7cb37d4bdf4545369a58 Author: Konstantin Belousov Date: Thu Nov 11 10:01:54 2021 +0200 sched.h: Hide all Linux compat sched_* functions under _WITH_CPU_SET_T Instead of only hiding cpu_set_t compat typedef. Too many software packages assumes that sched_getaffinity() presence implies full source compatibility with glibc. We can (and should) handle missing CPU_* macros, but there are incompatible BIT_* uses which cannot be fixed in src/. So hide everything under _WITH_CPU_SET_T, in particular, do not expose sched_get/setaffinity(), as well as CPU_* and BIT_* macros. Consumers that want sched* functions must opt-in. Reported by: portmgr (antoine) Sponsored by: The FreeBSD Foundation MFC after: 1 week diff --git a/include/sched.h b/include/sched.h index 1c41cda79046..460d3bfed154 100644 --- a/include/sched.h +++ b/include/sched.h @@ -32,12 +32,9 @@ #include #include #include -#if __BSD_VISIBLE -#include -#endif /* __BSD_VISIBLE */ - #if __BSD_VISIBLE #ifdef _WITH_CPU_SET_T +#include struct _cpuset; typedef struct _cpuset cpu_set_t; #endif /* _WITH_CPU_SET_T */ @@ -45,9 +42,11 @@ typedef struct _cpuset cpu_set_t; __BEGIN_DECLS #if __BSD_VISIBLE +#ifdef _WITH_CPU_SET_T int sched_getaffinity(pid_t pid, size_t cpusetsz, cpuset_t *cpuset); int sched_setaffinity(int pid, size_t cpusetsz, const cpuset_t *cpuset); int sched_getcpu(void); +#endif /* _WITH_CPU_SET_T */ #endif /* __BSD_VISIBLE */ __END_DECLS diff --git a/lib/libc/gen/sched_getaffinity.c b/lib/libc/gen/sched_getaffinity.c index 191374a3c5e3..5557d3d93b47 100644 --- a/lib/libc/gen/sched_getaffinity.c +++ b/lib/libc/gen/sched_getaffinity.c @@ -26,6 +26,7 @@ * SUCH DAMAGE. */ +#define _WITH_CPU_SET_T #include int diff --git a/lib/libc/gen/sched_getcpu_gen.c b/lib/libc/gen/sched_getcpu_gen.c index ef1bebc2915a..704075c0ae53 100644 --- a/lib/libc/gen/sched_getcpu_gen.c +++ b/lib/libc/gen/sched_getcpu_gen.c @@ -26,6 +26,7 @@ * SUCH DAMAGE. */ +#define _WITH_CPU_SET_T #include #include "libc_private.h" diff --git a/lib/libc/gen/sched_setaffinity.c b/lib/libc/gen/sched_setaffinity.c index 9368b1752b74..ad775b5dbce5 100644 --- a/lib/libc/gen/sched_setaffinity.c +++ b/lib/libc/gen/sched_setaffinity.c @@ -26,6 +26,7 @@ * SUCH DAMAGE. */ +#define _WITH_CPU_SET_T #include int diff --git a/lib/libc/x86/sys/sched_getcpu_x86.c b/lib/libc/x86/sys/sched_getcpu_x86.c index 13ba18ef5e36..5e3bd5311734 100644 --- a/lib/libc/x86/sys/sched_getcpu_x86.c +++ b/lib/libc/x86/sys/sched_getcpu_x86.c @@ -32,6 +32,7 @@ #include #include #include +#define _WITH_CPU_SET_T #include #include "libc_private.h" From nobody Sat Nov 13 14:02:28 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 82008185B9D4; Sat, 13 Nov 2021 14:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hrxwh3L0Dz3Jt6; Sat, 13 Nov 2021 14:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5276514668; Sat, 13 Nov 2021 14:02:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ADE2S7l068432; Sat, 13 Nov 2021 14:02:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ADE2Svf068431; Sat, 13 Nov 2021 14:02:28 GMT (envelope-from git) Date: Sat, 13 Nov 2021 14:02:28 GMT Message-Id: <202111131402.1ADE2Svf068431@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 06d5ef0aad20 - main - linux: Drop some unnecessary includes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 06d5ef0aad20f703c15350663ce2600bae2fe189 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=06d5ef0aad20f703c15350663ce2600bae2fe189 commit 06d5ef0aad20f703c15350663ce2600bae2fe189 Author: Edward Tomasz Napierala AuthorDate: 2021-11-13 03:26:27 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-11-13 03:26:32 +0000 linux: Drop some unnecessary includes Drop some unnecessary includes from Linuxulator ptrace and coredump code. No functional changes. Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D32925 --- sys/compat/linux/linux_elf.c | 10 +++------- sys/compat/linux/linux_ptrace.c | 2 -- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/sys/compat/linux/linux_elf.c b/sys/compat/linux/linux_elf.c index 9192388b347a..bcbd4d1cad51 100644 --- a/sys/compat/linux/linux_elf.c +++ b/sys/compat/linux/linux_elf.c @@ -41,19 +41,15 @@ __FBSDID("$FreeBSD$"); #include -#include -#include #include #include -#include +#include +#include +#include #include #include -#include #include #include -#include -#include -#include #include diff --git a/sys/compat/linux/linux_ptrace.c b/sys/compat/linux/linux_ptrace.c index 4e171c77e8ab..590a3474a006 100644 --- a/sys/compat/linux/linux_ptrace.c +++ b/sys/compat/linux/linux_ptrace.c @@ -39,8 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include #include From nobody Sat Nov 13 15:16:39 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1E931185A620; Sat, 13 Nov 2021 15:16:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrzZJ0DsHz4SGc; Sat, 13 Nov 2021 15:16:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DBED3159A3; Sat, 13 Nov 2021 15:16:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ADFGdVx063363; Sat, 13 Nov 2021 15:16:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ADFGdTi063362; Sat, 13 Nov 2021 15:16:39 GMT (envelope-from git) Date: Sat, 13 Nov 2021 15:16:39 GMT Message-Id: <202111131516.1ADFGdTi063362@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 5690261858b6 - main - rc.d/linux: Attempt to mount only if necessary List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5690261858b6bd8f7d09eda2ae74f3def2d69a01 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5690261858b6bd8f7d09eda2ae74f3def2d69a01 commit 5690261858b6bd8f7d09eda2ae74f3def2d69a01 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-10-12 08:40:36 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-11-13 15:15:14 +0000 rc.d/linux: Attempt to mount only if necessary Currently, if the linux service is run twice, mount(8) fails with: mount: linprocfs: Device busy mount: linsysfs: Device busy mount: devfs: Device busy mount: fdescfs: Device busy mount: tmpfs: Device busy It is a bit more user-friendly if before running mount(8) the service checks if there are any file systems left to be mounted. This patch implements this behavior. Also, while here, create mount points directories (as suggested by otis). Reviewed by: trasz Approved by: trasz (src) Differential Revision: https://reviews.freebsd.org/D32463 --- libexec/rc/rc.d/linux | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/libexec/rc/rc.d/linux b/libexec/rc/rc.d/linux index fd3e3d902709..caf9c2b39737 100755 --- a/libexec/rc/rc.d/linux +++ b/libexec/rc/rc.d/linux @@ -15,6 +15,17 @@ rcvar="linux_enable" start_cmd="${name}_start" stop_cmd=":" +linux_mount() { + local _fs _mount_point + _fs="$1" + _mount_point="$2" + shift 2 + if ! mount | grep -q "^$_fs on $_mount_point ("; then + mkdir -p "$_mount_point" + mount "$@" -t "$_fs" "$_fs" "$_mount_point" + fi +} + linux_start() { local _emul_path _tmpdir @@ -61,12 +72,12 @@ linux_start() sysctl kern.elf32.fallback_brand=3 > /dev/null fi - if checkyesno linux_mounts_enable; then - mount -o nocover -t linprocfs linprocfs "${_emul_path}/proc" - mount -o nocover -t linsysfs linsysfs "${_emul_path}/sys" - mount -o nocover -t devfs devfs "${_emul_path}/dev" - mount -o nocover,linrdlnk -t fdescfs fdescfs "${_emul_path}/dev/fd" - mount -o nocover,mode=1777 -t tmpfs tmpfs "${_emul_path}/dev/shm" + if checkyesno linux_mounts_enable; then + linux_mount linprocfs "${_emul_path}/proc" -o nocover + linux_mount linsysfs "${_emul_path}/sys" -o nocover + linux_mount devfs "${_emul_path}/dev" -o nocover + linux_mount fdescfs "${_emul_path}/dev/fd" -o nocover,linrdlnk + linux_mount tmpfs "${_emul_path}/dev/shm" -o nocover,mode=1777 fi } From nobody Sat Nov 13 16:34:27 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 23112183B287; Sat, 13 Nov 2021 16:34:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs1J40Vtmz4rWl; Sat, 13 Nov 2021 16:34:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6BA716C24; Sat, 13 Nov 2021 16:34:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ADGYRdY069573; Sat, 13 Nov 2021 16:34:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ADGYRZU069572; Sat, 13 Nov 2021 16:34:27 GMT (envelope-from git) Date: Sat, 13 Nov 2021 16:34:27 GMT Message-Id: <202111131634.1ADGYRZU069572@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 9a06a8245548 - main - tcp_timers: check for (INP_TIMEWAIT | INP_DROPPED) only once List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9a06a82455487991e6a71e5ce8e96c5bf3b8df3c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=9a06a82455487991e6a71e5ce8e96c5bf3b8df3c commit 9a06a82455487991e6a71e5ce8e96c5bf3b8df3c Author: Gleb Smirnoff AuthorDate: 2021-11-10 05:22:54 +0000 Commit: Gleb Smirnoff CommitDate: 2021-11-13 16:32:06 +0000 tcp_timers: check for (INP_TIMEWAIT | INP_DROPPED) only once All timers keep inpcb locked through their execution. We need to check these flags only once. Checking for INP_TIMEWAIT earlier is is also safer, since such inpcbs point into tcptw rather than tcpcb, and any dereferences of inp_ppcb as tcpcb are erroneous. Reviewed by: rrs, hselasky Differential revision: https://reviews.freebsd.org/D32967 --- sys/netinet/tcp_timer.c | 41 ++++------------------------------------- 1 file changed, 4 insertions(+), 37 deletions(-) diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index 139e32172531..feea3765821c 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -328,7 +328,7 @@ tcp_timer_2msl(void *xtp) return; } callout_deactivate(&tp->t_timers->tt_2msl); - if ((inp->inp_flags & INP_DROPPED) != 0) { + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { INP_WUNLOCK(inp); CURVNET_RESTORE(); return; @@ -341,26 +341,14 @@ tcp_timer_2msl(void *xtp) * too long delete connection control block. Otherwise, check * again in a bit. * - * If in TIME_WAIT state just ignore as this timeout is handled in - * tcp_tw_2msl_scan(). - * * If fastrecycle of FIN_WAIT_2, in FIN_WAIT_2 and receiver has closed, * there's no point in hanging onto FIN_WAIT_2 socket. Just close it. * Ignore fact that there were recent incoming segments. */ - if ((inp->inp_flags & INP_TIMEWAIT) != 0) { - INP_WUNLOCK(inp); - CURVNET_RESTORE(); - return; - } if (tcp_fast_finwait2_recycle && tp->t_state == TCPS_FIN_WAIT_2 && tp->t_inpcb && tp->t_inpcb->inp_socket && (tp->t_inpcb->inp_socket->so_rcv.sb_state & SBS_CANTRCVMORE)) { TCPSTAT_INC(tcps_finwait2_drops); - if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { - tcp_inpinfo_lock_del(inp, tp); - goto out; - } NET_EPOCH_ENTER(et); tp = tcp_close(tp); NET_EPOCH_EXIT(et); @@ -371,10 +359,6 @@ tcp_timer_2msl(void *xtp) callout_reset(&tp->t_timers->tt_2msl, TP_KEEPINTVL(tp), tcp_timer_2msl, tp); } else { - if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { - tcp_inpinfo_lock_del(inp, tp); - goto out; - } NET_EPOCH_ENTER(et); tp = tcp_close(tp); NET_EPOCH_EXIT(et); @@ -419,7 +403,7 @@ tcp_timer_keep(void *xtp) return; } callout_deactivate(&tp->t_timers->tt_keep); - if ((inp->inp_flags & INP_DROPPED) != 0) { + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { INP_WUNLOCK(inp); CURVNET_RESTORE(); return; @@ -498,10 +482,6 @@ tcp_timer_keep(void *xtp) dropit: TCPSTAT_INC(tcps_keepdrops); - if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { - tcp_inpinfo_lock_del(inp, tp); - goto out; - } NET_EPOCH_ENTER(et); tp = tcp_drop(tp, ETIMEDOUT); @@ -513,7 +493,6 @@ dropit: TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); NET_EPOCH_EXIT(et); tcp_inpinfo_lock_del(inp, tp); - out: CURVNET_RESTORE(); } @@ -539,7 +518,7 @@ tcp_timer_persist(void *xtp) return; } callout_deactivate(&tp->t_timers->tt_persist); - if ((inp->inp_flags & INP_DROPPED) != 0) { + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { INP_WUNLOCK(inp); CURVNET_RESTORE(); return; @@ -562,10 +541,6 @@ tcp_timer_persist(void *xtp) (ticks - tp->t_rcvtime >= tcp_maxpersistidle || ticks - tp->t_rcvtime >= TCP_REXMTVAL(tp) * tcp_totbackoff)) { TCPSTAT_INC(tcps_persistdrop); - if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { - tcp_inpinfo_lock_del(inp, tp); - goto out; - } NET_EPOCH_ENTER(et); tp = tcp_drop(tp, ETIMEDOUT); NET_EPOCH_EXIT(et); @@ -579,10 +554,6 @@ tcp_timer_persist(void *xtp) if (tp->t_state > TCPS_CLOSE_WAIT && (ticks - tp->t_rcvtime) >= TCPTV_PERSMAX) { TCPSTAT_INC(tcps_persistdrop); - if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { - tcp_inpinfo_lock_del(inp, tp); - goto out; - } NET_EPOCH_ENTER(et); tp = tcp_drop(tp, ETIMEDOUT); NET_EPOCH_EXIT(et); @@ -630,7 +601,7 @@ tcp_timer_rexmt(void * xtp) return; } callout_deactivate(&tp->t_timers->tt_rexmt); - if ((inp->inp_flags & INP_DROPPED) != 0) { + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { INP_WUNLOCK(inp); CURVNET_RESTORE(); return; @@ -651,10 +622,6 @@ tcp_timer_rexmt(void * xtp) if (++tp->t_rxtshift > TCP_MAXRXTSHIFT) { tp->t_rxtshift = TCP_MAXRXTSHIFT; TCPSTAT_INC(tcps_timeoutdrop); - if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { - tcp_inpinfo_lock_del(inp, tp); - goto out; - } NET_EPOCH_ENTER(et); tp = tcp_drop(tp, ETIMEDOUT); NET_EPOCH_EXIT(et); From nobody Sat Nov 13 16:34:29 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 71646183B16C; Sat, 13 Nov 2021 16:34:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs1J52FlLz4rZQ; Sat, 13 Nov 2021 16:34:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F05C168F1; Sat, 13 Nov 2021 16:34:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ADGYTxZ069604; Sat, 13 Nov 2021 16:34:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ADGYThL069603; Sat, 13 Nov 2021 16:34:29 GMT (envelope-from git) Date: Sat, 13 Nov 2021 16:34:29 GMT Message-Id: <202111131634.1ADGYThL069603@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: ef396441ceb8 - main - tcp_usr_detach: revert debugging piece from f5cf1e5f5a500. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ef396441ceb8bce4e5d7382ff7c76928721297a3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=ef396441ceb8bce4e5d7382ff7c76928721297a3 commit ef396441ceb8bce4e5d7382ff7c76928721297a3 Author: Gleb Smirnoff AuthorDate: 2021-11-10 19:35:50 +0000 Commit: Gleb Smirnoff CommitDate: 2021-11-13 16:33:32 +0000 tcp_usr_detach: revert debugging piece from f5cf1e5f5a500. The code was probably useful during the problem being chased down, but for brevity makes sense just to return to the original KASSERT. Reviewed by: rrs Differential revision: https://reviews.freebsd.org/D32968 --- sys/netinet/tcp_usrreq.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 968e102248d7..198852cc8fac 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #ifdef DDB @@ -262,26 +261,10 @@ tcp_usr_detach(struct socket *so) * In all three cases the tcptw should not be freed here. */ if (inp->inp_flags & INP_DROPPED) { + KASSERT(tp == NULL, ("tcp_detach: INP_TIMEWAIT && " + "INP_DROPPED && tp != NULL")); in_pcbdetach(inp); - if (__predict_true(tp == NULL)) { - in_pcbfree(inp); - } else { - /* - * This case should not happen as in TIMEWAIT - * state the inp should not be destroyed before - * its tcptw. If INVARIANTS is defined, panic. - */ -#ifdef INVARIANTS - panic("%s: Panic before an inp double-free: " - "INP_TIMEWAIT && INP_DROPPED && tp != NULL" - , __func__); -#else - log(LOG_ERR, "%s: Avoid an inp double-free: " - "INP_TIMEWAIT && INP_DROPPED && tp != NULL" - , __func__); -#endif - INP_WUNLOCK(inp); - } + in_pcbfree(inp); } else { in_pcbdetach(inp); INP_WUNLOCK(inp); From nobody Sat Nov 13 17:29:10 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4E531185E036; Sat, 13 Nov 2021 17:29:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs2WC1klxz3PF4; Sat, 13 Nov 2021 17:29:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 177981753B; Sat, 13 Nov 2021 17:29:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ADHTAnn036391; Sat, 13 Nov 2021 17:29:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ADHTAa2036390; Sat, 13 Nov 2021 17:29:10 GMT (envelope-from git) Date: Sat, 13 Nov 2021 17:29:10 GMT Message-Id: <202111131729.1ADHTAa2036390@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 90fa9705d5cd - main - sched.h: Hide all Linux compat sched_* functions under _WITH_CPU_SET_T List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 90fa9705d5cd29cf11c5dc7319299788dec2546a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=90fa9705d5cd29cf11c5dc7319299788dec2546a commit 90fa9705d5cd29cf11c5dc7319299788dec2546a Author: Konstantin Belousov AuthorDate: 2021-11-11 08:01:54 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-13 17:27:54 +0000 sched.h: Hide all Linux compat sched_* functions under _WITH_CPU_SET_T Instead of only hiding cpu_set_t compat typedef itself. Too many software packages assume that sched_getaffinity() presence implies full source compatibility with glibc. We can (and should) handle missing CPU_* macros, but then there are incompatible BIT_* uses which cannot be fixed in src/. So hide everything under _WITH_CPU_SET_T, in particular, do not expose sched_getcpu(), sched_get/setaffinity(), as well as CPU_* and BIT_* macros. Consumers that want sched* functions must opt-in. Reported by: portmgr (antoine) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- include/sched.h | 7 +++---- lib/libc/gen/sched_getaffinity.c | 1 + lib/libc/gen/sched_getcpu_gen.c | 1 + lib/libc/gen/sched_setaffinity.c | 1 + lib/libc/x86/sys/sched_getcpu_x86.c | 1 + 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/sched.h b/include/sched.h index 1c41cda79046..460d3bfed154 100644 --- a/include/sched.h +++ b/include/sched.h @@ -32,12 +32,9 @@ #include #include #include -#if __BSD_VISIBLE -#include -#endif /* __BSD_VISIBLE */ - #if __BSD_VISIBLE #ifdef _WITH_CPU_SET_T +#include struct _cpuset; typedef struct _cpuset cpu_set_t; #endif /* _WITH_CPU_SET_T */ @@ -45,9 +42,11 @@ typedef struct _cpuset cpu_set_t; __BEGIN_DECLS #if __BSD_VISIBLE +#ifdef _WITH_CPU_SET_T int sched_getaffinity(pid_t pid, size_t cpusetsz, cpuset_t *cpuset); int sched_setaffinity(int pid, size_t cpusetsz, const cpuset_t *cpuset); int sched_getcpu(void); +#endif /* _WITH_CPU_SET_T */ #endif /* __BSD_VISIBLE */ __END_DECLS diff --git a/lib/libc/gen/sched_getaffinity.c b/lib/libc/gen/sched_getaffinity.c index 191374a3c5e3..5557d3d93b47 100644 --- a/lib/libc/gen/sched_getaffinity.c +++ b/lib/libc/gen/sched_getaffinity.c @@ -26,6 +26,7 @@ * SUCH DAMAGE. */ +#define _WITH_CPU_SET_T #include int diff --git a/lib/libc/gen/sched_getcpu_gen.c b/lib/libc/gen/sched_getcpu_gen.c index ef1bebc2915a..704075c0ae53 100644 --- a/lib/libc/gen/sched_getcpu_gen.c +++ b/lib/libc/gen/sched_getcpu_gen.c @@ -26,6 +26,7 @@ * SUCH DAMAGE. */ +#define _WITH_CPU_SET_T #include #include "libc_private.h" diff --git a/lib/libc/gen/sched_setaffinity.c b/lib/libc/gen/sched_setaffinity.c index 9368b1752b74..ad775b5dbce5 100644 --- a/lib/libc/gen/sched_setaffinity.c +++ b/lib/libc/gen/sched_setaffinity.c @@ -26,6 +26,7 @@ * SUCH DAMAGE. */ +#define _WITH_CPU_SET_T #include int diff --git a/lib/libc/x86/sys/sched_getcpu_x86.c b/lib/libc/x86/sys/sched_getcpu_x86.c index 13ba18ef5e36..5e3bd5311734 100644 --- a/lib/libc/x86/sys/sched_getcpu_x86.c +++ b/lib/libc/x86/sys/sched_getcpu_x86.c @@ -32,6 +32,7 @@ #include #include #include +#define _WITH_CPU_SET_T #include #include "libc_private.h" From nobody Sat Nov 13 17:32:20 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 71B66186107B; Sat, 13 Nov 2021 17:32:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs2Zr2k8fz3h0T; Sat, 13 Nov 2021 17:32:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3EF3C17989; Sat, 13 Nov 2021 17:32:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ADHWKc4048941; Sat, 13 Nov 2021 17:32:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ADHWKKW048940; Sat, 13 Nov 2021 17:32:20 GMT (envelope-from git) Date: Sat, 13 Nov 2021 17:32:20 GMT Message-Id: <202111131732.1ADHWKKW048940@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: c5658876b416 - main - amd64/ia32/ia32_signal.c: Use ANSI C functions definitions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c5658876b416c1f8206bd8d269af85239e8467aa Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c5658876b416c1f8206bd8d269af85239e8467aa commit c5658876b416c1f8206bd8d269af85239e8467aa Author: Konstantin Belousov AuthorDate: 2021-11-12 17:11:22 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-13 17:31:53 +0000 amd64/ia32/ia32_signal.c: Use ANSI C functions definitions Remove MPSAFE annotations. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/amd64/ia32/ia32_signal.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/sys/amd64/ia32/ia32_signal.c b/sys/amd64/ia32/ia32_signal.c index 6c879eccfc77..52a9af0f64d2 100644 --- a/sys/amd64/ia32/ia32_signal.c +++ b/sys/amd64/ia32/ia32_signal.c @@ -742,15 +742,9 @@ ofreebsd32_sigreturn(struct thread *td, struct ofreebsd32_sigreturn_args *uap) #endif #ifdef COMPAT_FREEBSD4 -/* - * MPSAFE - */ int -freebsd4_freebsd32_sigreturn(td, uap) - struct thread *td; - struct freebsd4_freebsd32_sigreturn_args /* { - const struct freebsd4_freebsd32_ucontext *sigcntxp; - } */ *uap; +freebsd4_freebsd32_sigreturn(struct thread *td, + struct freebsd4_freebsd32_sigreturn_args *uap) { struct ia32_ucontext4 uc; struct trapframe *regs; @@ -816,15 +810,8 @@ freebsd4_freebsd32_sigreturn(td, uap) } #endif /* COMPAT_FREEBSD4 */ -/* - * MPSAFE - */ int -freebsd32_sigreturn(td, uap) - struct thread *td; - struct freebsd32_sigreturn_args /* { - const struct freebsd32_ucontext *sigcntxp; - } */ *uap; +freebsd32_sigreturn(struct thread *td, struct freebsd32_sigreturn_args *uap) { struct ia32_ucontext uc; struct trapframe *regs; From nobody Sat Nov 13 17:33:39 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2F6DF1861642; Sat, 13 Nov 2021 17:33:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs2cN0YkTz3hQn; Sat, 13 Nov 2021 17:33:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7944173EE; Sat, 13 Nov 2021 17:33:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ADHXdnQ049225; Sat, 13 Nov 2021 17:33:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ADHXdGP049224; Sat, 13 Nov 2021 17:33:39 GMT (envelope-from git) Date: Sat, 13 Nov 2021 17:33:39 GMT Message-Id: <202111131733.1ADHXdGP049224@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 77c088ab2109 - main - rtld: add rtld_fdprintfx() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 77c088ab2109a376b71decce80e89d4f20ef8223 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=77c088ab2109a376b71decce80e89d4f20ef8223 commit 77c088ab2109a376b71decce80e89d4f20ef8223 Author: Konstantin Belousov AuthorDate: 2021-11-13 01:49:22 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-13 17:33:13 +0000 rtld: add rtld_fdprintfx() It is same as rtld_fdprintf() without enforcement of the format string to be a literal. Sponsored by: The FreeBSD Foundation MFC after: 1 week --- libexec/rtld-elf/rtld_printf.c | 12 ++++++++++++ libexec/rtld-elf/rtld_printf.h | 1 + 2 files changed, 13 insertions(+) diff --git a/libexec/rtld-elf/rtld_printf.c b/libexec/rtld-elf/rtld_printf.c index aedaf5104e31..48a148f72dff 100644 --- a/libexec/rtld-elf/rtld_printf.c +++ b/libexec/rtld-elf/rtld_printf.c @@ -489,6 +489,18 @@ rtld_fdprintf(int fd, const char *fmt, ...) return (retval); } +int +rtld_fdprintfx(int fd, const char *fmt, ...) +{ + va_list ap; + int retval; + + va_start(ap, fmt); + retval = rtld_vfdprintf(fd, fmt, ap); + va_end(ap); + return (retval); +} + void rtld_fdputstr(int fd, const char *str) { diff --git a/libexec/rtld-elf/rtld_printf.h b/libexec/rtld-elf/rtld_printf.h index 3d3a0480ecce..e2fac948dc53 100644 --- a/libexec/rtld-elf/rtld_printf.h +++ b/libexec/rtld-elf/rtld_printf.h @@ -39,6 +39,7 @@ int rtld_snprintf(char *buf, size_t bufsize, const char *fmt, ...) int rtld_vsnprintf(char *buf, size_t bufsize, const char *fmt, va_list ap); int rtld_vfdprintf(int fd, const char *fmt, va_list ap); int rtld_fdprintf(int fd, const char *fmt, ...) __printflike(2, 3); +int rtld_fdprintfx(int fd, const char *fmt, ...); void rtld_fdputstr(int fd, const char *str); void rtld_fdputchar(int fd, int c); From nobody Sat Nov 13 17:33:40 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 77392186147F; Sat, 13 Nov 2021 17:33:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs2cP2QyJz3hYr; Sat, 13 Nov 2021 17:33:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29AB317578; Sat, 13 Nov 2021 17:33:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ADHXeHV049249; Sat, 13 Nov 2021 17:33:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ADHXekX049248; Sat, 13 Nov 2021 17:33:40 GMT (envelope-from git) Date: Sat, 13 Nov 2021 17:33:40 GMT Message-Id: <202111131733.1ADHXekX049248@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 64ba1f4cf3a6 - main - rtld: Implement LD_SHOW_AUXV List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 64ba1f4cf3a6847a1dacf4bab0409d94898fa168 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=64ba1f4cf3a6847a1dacf4bab0409d94898fa168 commit 64ba1f4cf3a6847a1dacf4bab0409d94898fa168 Author: Konstantin Belousov AuthorDate: 2021-11-13 01:18:13 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-13 17:33:13 +0000 rtld: Implement LD_SHOW_AUXV It dumps auxv as seen by interpreter, right before starting any user code. Copied from: glibc Sponsored by: The FreeBSD Foundation MFC after: 1 week --- libexec/rtld-elf/rtld.1 | 7 +++++- libexec/rtld-elf/rtld.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 index 187dc105667a..66aa2bdabd17 100644 --- a/libexec/rtld-elf/rtld.1 +++ b/libexec/rtld-elf/rtld.1 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 15, 2021 +.Dd November 13, 2021 .Dt RTLD 1 .Os .Sh NAME @@ -309,6 +309,11 @@ will process the filtee dependencies of the loaded objects immediately, instead of postponing it until required. Normally, the filtees are opened at the time of the first symbol resolution from the filter object. +.It Ev LD_SHOW_AUXV +If set, causes +.Nm +to dump content of the aux vector to standard output, before passing +control to any user code. .El .Sh DIRECT EXECUTION MODE .Nm diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index c173c5a6e22e..0475134b0d96 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -104,6 +104,7 @@ static Obj_Entry *dlopen_object(const char *name, int fd, Obj_Entry *refobj, static Obj_Entry *do_load_object(int, const char *, char *, struct stat *, int); static int do_search_info(const Obj_Entry *obj, int, struct dl_serinfo *); static bool donelist_check(DoneList *, const Obj_Entry *); +static void dump_auxv(Elf_Auxinfo **aux_info); static void errmsg_restore(struct dlerror_save *); static struct dlerror_save *errmsg_save(void); static void *fill_search_info(const char *, size_t, void *); @@ -364,6 +365,7 @@ enum { LD_TRACE_LOADED_OBJECTS_FMT1, LD_TRACE_LOADED_OBJECTS_FMT2, LD_TRACE_LOADED_OBJECTS_ALL, + LD_SHOW_AUXV, }; struct ld_env_var_desc { @@ -396,6 +398,7 @@ static struct ld_env_var_desc ld_env_vars[] = { LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT1, false), LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT2, false), LD_ENV_DESC(TRACE_LOADED_OBJECTS_ALL, false), + LD_ENV_DESC(SHOW_AUXV, false), }; static const char * @@ -857,6 +860,9 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) if (rtld_verify_versions(&list_main) == -1 && !ld_tracing) rtld_die(); + if (ld_get_env_var(LD_SHOW_AUXV) != NULL) + dump_auxv(aux_info); + if (ld_tracing) { /* We're done */ trace_loaded_objects(obj_main); exit(0); @@ -6058,6 +6064,67 @@ print_usage(const char *argv0) " Arguments to the executed process\n", argv0); } +#define AUXFMT(at, xfmt) [at] = { .name = #at, .fmt = xfmt } +static const struct auxfmt { + const char *name; + const char *fmt; +} auxfmts[] = { + AUXFMT(AT_NULL, NULL), + AUXFMT(AT_IGNORE, NULL), + AUXFMT(AT_EXECFD, "%d"), + AUXFMT(AT_PHDR, "%p"), + AUXFMT(AT_PHENT, "%u"), + AUXFMT(AT_PHNUM, "%u"), + AUXFMT(AT_PAGESZ, "%u"), + AUXFMT(AT_BASE, "%#lx"), + AUXFMT(AT_FLAGS, "%#lx"), + AUXFMT(AT_ENTRY, "%p"), + AUXFMT(AT_NOTELF, NULL), + AUXFMT(AT_UID, "%d"), + AUXFMT(AT_EUID, "%d"), + AUXFMT(AT_GID, "%d"), + AUXFMT(AT_EGID, "%d"), + AUXFMT(AT_EXECPATH, "%s"), + AUXFMT(AT_CANARY, "%p"), + AUXFMT(AT_CANARYLEN, "%u"), + AUXFMT(AT_OSRELDATE, "%u"), + AUXFMT(AT_NCPUS, "%u"), + AUXFMT(AT_PAGESIZES, "%p"), + AUXFMT(AT_PAGESIZESLEN, "%u"), + AUXFMT(AT_TIMEKEEP, "%p"), + AUXFMT(AT_STACKPROT, "%#x"), + AUXFMT(AT_EHDRFLAGS, "%#lx"), + AUXFMT(AT_HWCAP, "%#lx"), + AUXFMT(AT_HWCAP2, "%#lx"), + AUXFMT(AT_BSDFLAGS, "%#lx"), + AUXFMT(AT_ARGC, "%u"), + AUXFMT(AT_ARGV, "%p"), + AUXFMT(AT_ENVC, "%p"), + AUXFMT(AT_ENVV, "%p"), + AUXFMT(AT_PS_STRINGS, "%p"), + AUXFMT(AT_FXRNG, "%p"), +}; + +static void +dump_auxv(Elf_Auxinfo **aux_info) +{ + Elf_Auxinfo *auxp; + const struct auxfmt *fmt; + int i; + + for (i = 0; i < AT_COUNT; i++) { + auxp = aux_info[i]; + if (auxp == NULL) + continue; + fmt = &auxfmts[i]; + if (fmt->fmt == NULL) + continue; + rtld_fdprintf(STDOUT_FILENO, "%s:\t", fmt->name); + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, auxp->a_un.a_ptr); + rtld_fdprintf(STDOUT_FILENO, "\n"); + } +} + /* * Overrides for libc_pic-provided functions. */ From nobody Sat Nov 13 17:54:12 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EA13C183B729 for ; Sat, 13 Nov 2021 17:54:19 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs34C6813z3pcM for ; Sat, 13 Nov 2021 17:54:19 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f44.google.com with SMTP id g191-20020a1c9dc8000000b0032fbf912885so9141485wme.4 for ; Sat, 13 Nov 2021 09:54:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=UWZlghNcIT5pJZBIF2HyZppiBCsQ8/H5AByfbV4aXKk=; b=eee766YU/b5MvSqCPlgu+ACyVe5Wb3OfyFBCalmZkO+nNDlhRVOCVqlUAlQ5MyBtY9 hR5aRCHU7osiQuwWxinFI9FEYQ6Btatw02sq9oWQj/G1MXCt4FpCSbET0s+gMKKMh01Y qOhVkovaYBFqIH653PNTWmeP8qTNBduUiU1Uzs04itD7sg83T3VRFOqr+vZFzsA+7PBV Qf8q/h5esKckdPgUCTMlhI/sxA/SgHMaDmshgEZnMLsU1rhgIJZUkubs4dQ4E5SurDbw pKzpOBVd2E1Tnu1qXRP4KkaVFseR8N4ERpg4wAMA2H4HKNl/MM414MX5SeHV3riN6QEX sS+Q== X-Gm-Message-State: AOAM53033NVVyygKJALs6T9Ov0mp8t+dwVqcCpZJoiZIo7HCILwiRivu JiTSaehHi1J75WvLrzXIx+Noog== X-Google-Smtp-Source: ABdhPJzz9oqcGAlN16Gd7sZrBd3nBKmifQBdve3Daf/Bq+scU0trqO4kZkVU2P2uAkn/7KmBINO3yQ== X-Received: by 2002:a1c:9d48:: with SMTP id g69mr47370814wme.188.1636826053448; Sat, 13 Nov 2021 09:54:13 -0800 (PST) Received: from smtpclient.apple (global-5-141.nat-2.net.cam.ac.uk. [131.111.5.141]) by smtp.gmail.com with ESMTPSA id j17sm10707239wmq.41.2021.11.13.09.54.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Nov 2021 09:54:13 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: 64ba1f4cf3a6 - main - rtld: Implement LD_SHOW_AUXV From: Jessica Clarke In-Reply-To: <202111131733.1ADHXekX049248@gitrepo.freebsd.org> Date: Sat, 13 Nov 2021 17:54:12 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <37FC39AA-925D-4D75-8E0A-EA14E846E3A6@freebsd.org> References: <202111131733.1ADHXekX049248@gitrepo.freebsd.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4Hs34C6813z3pcM X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 13 Nov 2021, at 17:33, Konstantin Belousov wrote: >=20 > The branch main has been updated by kib: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D64ba1f4cf3a6847a1dacf4bab0409d94= 898fa168 >=20 > commit 64ba1f4cf3a6847a1dacf4bab0409d94898fa168 > Author: Konstantin Belousov > AuthorDate: 2021-11-13 01:18:13 +0000 > Commit: Konstantin Belousov > CommitDate: 2021-11-13 17:33:13 +0000 >=20 > rtld: Implement LD_SHOW_AUXV >=20 > It dumps auxv as seen by interpreter, right before starting any = user > code. >=20 > Copied from: glibc > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > --- > libexec/rtld-elf/rtld.1 | 7 +++++- > libexec/rtld-elf/rtld.c | 67 = +++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 73 insertions(+), 1 deletion(-) >=20 > diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 > index 187dc105667a..66aa2bdabd17 100644 > --- a/libexec/rtld-elf/rtld.1 > +++ b/libexec/rtld-elf/rtld.1 > @@ -28,7 +28,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd August 15, 2021 > +.Dd November 13, 2021 > .Dt RTLD 1 > .Os > .Sh NAME > @@ -309,6 +309,11 @@ will process the filtee dependencies of the = loaded objects immediately, > instead of postponing it until required. > Normally, the filtees are opened at the time of the first symbol = resolution > from the filter object. > +.It Ev LD_SHOW_AUXV > +If set, causes > +.Nm > +to dump content of the aux vector to standard output, before passing > +control to any user code. > .El > .Sh DIRECT EXECUTION MODE > .Nm > diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c > index c173c5a6e22e..0475134b0d96 100644 > --- a/libexec/rtld-elf/rtld.c > +++ b/libexec/rtld-elf/rtld.c > @@ -104,6 +104,7 @@ static Obj_Entry *dlopen_object(const char *name, = int fd, Obj_Entry *refobj, > static Obj_Entry *do_load_object(int, const char *, char *, struct = stat *, int); > static int do_search_info(const Obj_Entry *obj, int, struct dl_serinfo = *); > static bool donelist_check(DoneList *, const Obj_Entry *); > +static void dump_auxv(Elf_Auxinfo **aux_info); > static void errmsg_restore(struct dlerror_save *); > static struct dlerror_save *errmsg_save(void); > static void *fill_search_info(const char *, size_t, void *); > @@ -364,6 +365,7 @@ enum { > LD_TRACE_LOADED_OBJECTS_FMT1, > LD_TRACE_LOADED_OBJECTS_FMT2, > LD_TRACE_LOADED_OBJECTS_ALL, > + LD_SHOW_AUXV, > }; >=20 > struct ld_env_var_desc { > @@ -396,6 +398,7 @@ static struct ld_env_var_desc ld_env_vars[] =3D { > LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT1, false), > LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT2, false), > LD_ENV_DESC(TRACE_LOADED_OBJECTS_ALL, false), > + LD_ENV_DESC(SHOW_AUXV, false), > }; >=20 > static const char * > @@ -857,6 +860,9 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, = Obj_Entry **objp) > if (rtld_verify_versions(&list_main) =3D=3D -1 && !ld_tracing) > rtld_die(); >=20 > + if (ld_get_env_var(LD_SHOW_AUXV) !=3D NULL) > + dump_auxv(aux_info); > + > if (ld_tracing) { /* We're done */ > trace_loaded_objects(obj_main); > exit(0); > @@ -6058,6 +6064,67 @@ print_usage(const char *argv0) > " Arguments to the executed process\n", argv0); > } >=20 > +#define AUXFMT(at, xfmt) [at] =3D { .name =3D #at, .fmt =3D xfmt = } > +static const struct auxfmt { > + const char *name; > + const char *fmt; > +} auxfmts[] =3D { > + AUXFMT(AT_NULL, NULL), > + AUXFMT(AT_IGNORE, NULL), > + AUXFMT(AT_EXECFD, "%d"), > + AUXFMT(AT_PHDR, "%p"), > + AUXFMT(AT_PHENT, "%u"), > + AUXFMT(AT_PHNUM, "%u"), > + AUXFMT(AT_PAGESZ, "%u"), > + AUXFMT(AT_BASE, "%#lx"), > + AUXFMT(AT_FLAGS, "%#lx"), > + AUXFMT(AT_ENTRY, "%p"), > + AUXFMT(AT_NOTELF, NULL), > + AUXFMT(AT_UID, "%d"), > + AUXFMT(AT_EUID, "%d"), > + AUXFMT(AT_GID, "%d"), > + AUXFMT(AT_EGID, "%d"), > + AUXFMT(AT_EXECPATH, "%s"), > + AUXFMT(AT_CANARY, "%p"), > + AUXFMT(AT_CANARYLEN, "%u"), > + AUXFMT(AT_OSRELDATE, "%u"), > + AUXFMT(AT_NCPUS, "%u"), > + AUXFMT(AT_PAGESIZES, "%p"), > + AUXFMT(AT_PAGESIZESLEN, "%u"), > + AUXFMT(AT_TIMEKEEP, "%p"), > + AUXFMT(AT_STACKPROT, "%#x"), > + AUXFMT(AT_EHDRFLAGS, "%#lx"), > + AUXFMT(AT_HWCAP, "%#lx"), > + AUXFMT(AT_HWCAP2, "%#lx"), > + AUXFMT(AT_BSDFLAGS, "%#lx"), > + AUXFMT(AT_ARGC, "%u"), > + AUXFMT(AT_ARGV, "%p"), > + AUXFMT(AT_ENVC, "%p"), > + AUXFMT(AT_ENVV, "%p"), > + AUXFMT(AT_PS_STRINGS, "%p"), > + AUXFMT(AT_FXRNG, "%p"), > +}; > + > +static void > +dump_auxv(Elf_Auxinfo **aux_info) > +{ > + Elf_Auxinfo *auxp; > + const struct auxfmt *fmt; > + int i; > + > + for (i =3D 0; i < AT_COUNT; i++) { > + auxp =3D aux_info[i]; > + if (auxp =3D=3D NULL) > + continue; > + fmt =3D &auxfmts[i]; > + if (fmt->fmt =3D=3D NULL) > + continue; > + rtld_fdprintf(STDOUT_FILENO, "%s:\t", fmt->name); > + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, = auxp->a_un.a_ptr); > + rtld_fdprintf(STDOUT_FILENO, "\n"); This is undefined behaviour, breaks CHERI, and totally unnecessary. You have a handful of cases here, just make an enum and have separate rtld_fdprintf calls. Also the table itself is brittle, there=E2=80=99s nothing checking that = the order perfectly matches up with the defines in the header. Why not use designated initialisers to ensure that the right values are in the right entries (and handle the possibility that name might be NULL)? Jess From nobody Sat Nov 13 17:57:56 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CDAB3183DC39 for ; Sat, 13 Nov 2021 17:58:04 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs38W6bw4z3qQw for ; Sat, 13 Nov 2021 17:58:03 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f47.google.com with SMTP id d3so21562215wrh.8 for ; Sat, 13 Nov 2021 09:58:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ViBWgMWmt8IVKc/yP0Of7cCSkV1eq9vgyYUZJ5VlTns=; b=M5aa1uh4iKLTqMRPrnV6NTBKJgL58RoKTGBx164vzsxq9oq/FflqW1x15lIsIvnTRz UnUWQf1sFzETuW3S3MWbmLo8T7OJcuyZBzEt1T+PzeJ/j11m7hWnr+errc4msLTzoYim MAv0r9BqWjc2gbQ2DBuYBGmlYQ8sdFZKNRTRTanev1qWm0RjlrEYmq7K4RHG/S78yIq7 ZC8fB30FPCVbNb78uMAyIX0Os20rPm7e1duPhCFM0SfFq4DZnWwfDt4Xz4HmYuDLW/Ud r5KE9X1Vma47xBcR0bt1srSvOiUvvEpxvL4UmX6Z79xXWZnTosmuj3hH4KJHuoVsCY8Q rkaw== X-Gm-Message-State: AOAM5335/4INfHQGZmEjj3yqjWO6Rbx80Sf7g3AFwBTgxaJEbhdOE6s1 5ZVVFdj15jtYYxxWR7vBgNX+BQ== X-Google-Smtp-Source: ABdhPJywXN0F8lv8rZjdeFc1ul6RKgp/PK5ErVlCZaQuE2OwBBy9SiXS3UnNRrFBds+QHDMi0H8BOQ== X-Received: by 2002:a5d:648e:: with SMTP id o14mr31105155wri.69.1636826277017; Sat, 13 Nov 2021 09:57:57 -0800 (PST) Received: from smtpclient.apple (global-5-141.nat-2.net.cam.ac.uk. [131.111.5.141]) by smtp.gmail.com with ESMTPSA id h13sm9127338wrx.82.2021.11.13.09.57.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Nov 2021 09:57:56 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: 64ba1f4cf3a6 - main - rtld: Implement LD_SHOW_AUXV From: Jessica Clarke In-Reply-To: <37FC39AA-925D-4D75-8E0A-EA14E846E3A6@freebsd.org> Date: Sat, 13 Nov 2021 17:57:56 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <110784F6-3A7A-4F27-AAEB-E9B5A8F7CF0E@freebsd.org> References: <202111131733.1ADHXekX049248@gitrepo.freebsd.org> <37FC39AA-925D-4D75-8E0A-EA14E846E3A6@freebsd.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4Hs38W6bw4z3qQw X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.221.47 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-0.50 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[3]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_SPAM_SHORT(1.00)[1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.47:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.47:from]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Jess > On 13 Nov 2021, at 17:54, Jessica Clarke wrote: >=20 > On 13 Nov 2021, at 17:33, Konstantin Belousov wrote: >>=20 >> The branch main has been updated by kib: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D64ba1f4cf3a6847a1dacf4bab0409d94= 898fa168 >>=20 >> commit 64ba1f4cf3a6847a1dacf4bab0409d94898fa168 >> Author: Konstantin Belousov >> AuthorDate: 2021-11-13 01:18:13 +0000 >> Commit: Konstantin Belousov >> CommitDate: 2021-11-13 17:33:13 +0000 >>=20 >> rtld: Implement LD_SHOW_AUXV >>=20 >> It dumps auxv as seen by interpreter, right before starting any = user >> code. >>=20 >> Copied from: glibc >> Sponsored by: The FreeBSD Foundation >> MFC after: 1 week >> --- >> libexec/rtld-elf/rtld.1 | 7 +++++- >> libexec/rtld-elf/rtld.c | 67 = +++++++++++++++++++++++++++++++++++++++++++++++++ >> 2 files changed, 73 insertions(+), 1 deletion(-) >>=20 >> diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 >> index 187dc105667a..66aa2bdabd17 100644 >> --- a/libexec/rtld-elf/rtld.1 >> +++ b/libexec/rtld-elf/rtld.1 >> @@ -28,7 +28,7 @@ >> .\" >> .\" $FreeBSD$ >> .\" >> -.Dd August 15, 2021 >> +.Dd November 13, 2021 >> .Dt RTLD 1 >> .Os >> .Sh NAME >> @@ -309,6 +309,11 @@ will process the filtee dependencies of the = loaded objects immediately, >> instead of postponing it until required. >> Normally, the filtees are opened at the time of the first symbol = resolution >> from the filter object. >> +.It Ev LD_SHOW_AUXV >> +If set, causes >> +.Nm >> +to dump content of the aux vector to standard output, before passing >> +control to any user code. >> .El >> .Sh DIRECT EXECUTION MODE >> .Nm >> diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c >> index c173c5a6e22e..0475134b0d96 100644 >> --- a/libexec/rtld-elf/rtld.c >> +++ b/libexec/rtld-elf/rtld.c >> @@ -104,6 +104,7 @@ static Obj_Entry *dlopen_object(const char *name, = int fd, Obj_Entry *refobj, >> static Obj_Entry *do_load_object(int, const char *, char *, struct = stat *, int); >> static int do_search_info(const Obj_Entry *obj, int, struct = dl_serinfo *); >> static bool donelist_check(DoneList *, const Obj_Entry *); >> +static void dump_auxv(Elf_Auxinfo **aux_info); >> static void errmsg_restore(struct dlerror_save *); >> static struct dlerror_save *errmsg_save(void); >> static void *fill_search_info(const char *, size_t, void *); >> @@ -364,6 +365,7 @@ enum { >> LD_TRACE_LOADED_OBJECTS_FMT1, >> LD_TRACE_LOADED_OBJECTS_FMT2, >> LD_TRACE_LOADED_OBJECTS_ALL, >> + LD_SHOW_AUXV, >> }; >>=20 >> struct ld_env_var_desc { >> @@ -396,6 +398,7 @@ static struct ld_env_var_desc ld_env_vars[] =3D { >> LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT1, false), >> LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT2, false), >> LD_ENV_DESC(TRACE_LOADED_OBJECTS_ALL, false), >> + LD_ENV_DESC(SHOW_AUXV, false), >> }; >>=20 >> static const char * >> @@ -857,6 +860,9 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, = Obj_Entry **objp) >> if (rtld_verify_versions(&list_main) =3D=3D -1 && !ld_tracing) >> rtld_die(); >>=20 >> + if (ld_get_env_var(LD_SHOW_AUXV) !=3D NULL) >> + dump_auxv(aux_info); >> + >> if (ld_tracing) { /* We're done */ >> trace_loaded_objects(obj_main); >> exit(0); >> @@ -6058,6 +6064,67 @@ print_usage(const char *argv0) >> " Arguments to the executed process\n", argv0); >> } >>=20 >> +#define AUXFMT(at, xfmt) [at] =3D { .name =3D #at, .fmt =3D xfmt = } >> +static const struct auxfmt { >> + const char *name; >> + const char *fmt; >> +} auxfmts[] =3D { >> + AUXFMT(AT_NULL, NULL), >> + AUXFMT(AT_IGNORE, NULL), >> + AUXFMT(AT_EXECFD, "%d"), >> + AUXFMT(AT_PHDR, "%p"), >> + AUXFMT(AT_PHENT, "%u"), >> + AUXFMT(AT_PHNUM, "%u"), >> + AUXFMT(AT_PAGESZ, "%u"), >> + AUXFMT(AT_BASE, "%#lx"), >> + AUXFMT(AT_FLAGS, "%#lx"), >> + AUXFMT(AT_ENTRY, "%p"), >> + AUXFMT(AT_NOTELF, NULL), >> + AUXFMT(AT_UID, "%d"), >> + AUXFMT(AT_EUID, "%d"), >> + AUXFMT(AT_GID, "%d"), >> + AUXFMT(AT_EGID, "%d"), >> + AUXFMT(AT_EXECPATH, "%s"), >> + AUXFMT(AT_CANARY, "%p"), >> + AUXFMT(AT_CANARYLEN, "%u"), >> + AUXFMT(AT_OSRELDATE, "%u"), >> + AUXFMT(AT_NCPUS, "%u"), >> + AUXFMT(AT_PAGESIZES, "%p"), >> + AUXFMT(AT_PAGESIZESLEN, "%u"), >> + AUXFMT(AT_TIMEKEEP, "%p"), >> + AUXFMT(AT_STACKPROT, "%#x"), >> + AUXFMT(AT_EHDRFLAGS, "%#lx"), >> + AUXFMT(AT_HWCAP, "%#lx"), >> + AUXFMT(AT_HWCAP2, "%#lx"), >> + AUXFMT(AT_BSDFLAGS, "%#lx"), >> + AUXFMT(AT_ARGC, "%u"), >> + AUXFMT(AT_ARGV, "%p"), >> + AUXFMT(AT_ENVC, "%p"), >> + AUXFMT(AT_ENVV, "%p"), >> + AUXFMT(AT_PS_STRINGS, "%p"), >> + AUXFMT(AT_FXRNG, "%p"), >> +}; >> + >> +static void >> +dump_auxv(Elf_Auxinfo **aux_info) >> +{ >> + Elf_Auxinfo *auxp; >> + const struct auxfmt *fmt; >> + int i; >> + >> + for (i =3D 0; i < AT_COUNT; i++) { >> + auxp =3D aux_info[i]; >> + if (auxp =3D=3D NULL) >> + continue; >> + fmt =3D &auxfmts[i]; >> + if (fmt->fmt =3D=3D NULL) >> + continue; >> + rtld_fdprintf(STDOUT_FILENO, "%s:\t", fmt->name); >> + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, = auxp->a_un.a_ptr); >> + rtld_fdprintf(STDOUT_FILENO, "\n"); >=20 > This is undefined behaviour, breaks CHERI, and totally unnecessary. = You > have a handful of cases here, just make an enum and have separate > rtld_fdprintf calls. >=20 > Also the table itself is brittle, there=E2=80=99s nothing checking = that the > order perfectly matches up with the defines in the header. Why not use > designated initialisers to ensure that the right values are in the > right entries (and handle the possibility that name might be NULL)? Scratch that second part, I missed the [at] =3D in the macro. Jess From nobody Sat Nov 13 18:29:24 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B98491854C2D for ; Sat, 13 Nov 2021 18:29:28 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs3rl4F9Kz4TDr for ; Sat, 13 Nov 2021 18:29:27 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f50.google.com with SMTP id f7-20020a1c1f07000000b0032ee11917ceso9222181wmf.0 for ; Sat, 13 Nov 2021 10:29:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=FPm95zPdubv2MRP5hxEjuzmaxf8rAK+WDUEuBC+A2JU=; b=zeOIfdaRrGtL1BSdWesHvjQarTNLa3M/7GzcbhyPLT4UtO7MEa7KTZZklvEzrdvwD3 tN36J1QYvzeL93ueGRew4Mq1jcv95a+GzFxZV/O2m96gJIQEdpfPkMXD20RR/WdQ3Uc1 7EmTENMzQSA6k8+amOYjuncmtup0ylCStoPH9ouTKFLvGQ/m4xIIjZny0aFlNKyMVf/z L8v19Enp3mRS3LBwAcSNjuoqg3+iiViho1emoNdL0Mv+jEtWdJckIiK2MUQnyk7hUoqE RpBSN4CLO0CS0ihTX/v2jEayRutF4UZCPG5EED/gsvAEReX9GbpUSdzBUPCRMzWdQ88A qlQA== X-Gm-Message-State: AOAM53287vK1uZHmryHA/UC5iqasLyC8sOO2X7jVRs6j0aXnMsMQOtXK cS4XLBSG4zx674OMK6j6ahLKqw== X-Google-Smtp-Source: ABdhPJzPXN9vNKPVJaV0K8nt34kGwXs5so0wCv9T1bK8f17OO+pDaNwDkEIqyL6K5QsepY9guXqkFw== X-Received: by 2002:a05:600c:1914:: with SMTP id j20mr45297690wmq.26.1636828166514; Sat, 13 Nov 2021 10:29:26 -0800 (PST) Received: from smtpclient.apple (global-5-141.nat-2.net.cam.ac.uk. [131.111.5.141]) by smtp.gmail.com with ESMTPSA id c17sm9680634wmk.23.2021.11.13.10.29.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Nov 2021 10:29:26 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: 64ba1f4cf3a6 - main - rtld: Implement LD_SHOW_AUXV From: Jessica Clarke In-Reply-To: <110784F6-3A7A-4F27-AAEB-E9B5A8F7CF0E@freebsd.org> Date: Sat, 13 Nov 2021 18:29:24 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <2450270B-CB98-43D0-B3BE-3C6D02F9B6FD@freebsd.org> References: <202111131733.1ADHXekX049248@gitrepo.freebsd.org> <37FC39AA-925D-4D75-8E0A-EA14E846E3A6@freebsd.org> <110784F6-3A7A-4F27-AAEB-E9B5A8F7CF0E@freebsd.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4Hs3rl4F9Kz4TDr X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.128.50 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-2.33 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.83)[-0.828]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.50:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.50:from]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On 13 Nov 2021, at 17:57, Jessica Clarke wrote: >=20 > On 13 Nov 2021, at 17:54, Jessica Clarke wrote: >>=20 >> On 13 Nov 2021, at 17:33, Konstantin Belousov = wrote: >>>=20 >>> The branch main has been updated by kib: >>>=20 >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D64ba1f4cf3a6847a1dacf4bab0409d94= 898fa168 >>>=20 >>> commit 64ba1f4cf3a6847a1dacf4bab0409d94898fa168 >>> Author: Konstantin Belousov >>> AuthorDate: 2021-11-13 01:18:13 +0000 >>> Commit: Konstantin Belousov >>> CommitDate: 2021-11-13 17:33:13 +0000 >>>=20 >>> rtld: Implement LD_SHOW_AUXV >>>=20 >>> It dumps auxv as seen by interpreter, right before starting any = user >>> code. >>>=20 >>> Copied from: glibc >>> Sponsored by: The FreeBSD Foundation >>> MFC after: 1 week >>> --- >>> libexec/rtld-elf/rtld.1 | 7 +++++- >>> libexec/rtld-elf/rtld.c | 67 = +++++++++++++++++++++++++++++++++++++++++++++++++ >>> 2 files changed, 73 insertions(+), 1 deletion(-) >>>=20 >>> diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 >>> index 187dc105667a..66aa2bdabd17 100644 >>> --- a/libexec/rtld-elf/rtld.1 >>> +++ b/libexec/rtld-elf/rtld.1 >>> @@ -28,7 +28,7 @@ >>> .\" >>> .\" $FreeBSD$ >>> .\" >>> -.Dd August 15, 2021 >>> +.Dd November 13, 2021 >>> .Dt RTLD 1 >>> .Os >>> .Sh NAME >>> @@ -309,6 +309,11 @@ will process the filtee dependencies of the = loaded objects immediately, >>> instead of postponing it until required. >>> Normally, the filtees are opened at the time of the first symbol = resolution >>> from the filter object. >>> +.It Ev LD_SHOW_AUXV >>> +If set, causes >>> +.Nm >>> +to dump content of the aux vector to standard output, before = passing >>> +control to any user code. >>> .El >>> .Sh DIRECT EXECUTION MODE >>> .Nm >>> diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c >>> index c173c5a6e22e..0475134b0d96 100644 >>> --- a/libexec/rtld-elf/rtld.c >>> +++ b/libexec/rtld-elf/rtld.c >>> @@ -104,6 +104,7 @@ static Obj_Entry *dlopen_object(const char = *name, int fd, Obj_Entry *refobj, >>> static Obj_Entry *do_load_object(int, const char *, char *, struct = stat *, int); >>> static int do_search_info(const Obj_Entry *obj, int, struct = dl_serinfo *); >>> static bool donelist_check(DoneList *, const Obj_Entry *); >>> +static void dump_auxv(Elf_Auxinfo **aux_info); >>> static void errmsg_restore(struct dlerror_save *); >>> static struct dlerror_save *errmsg_save(void); >>> static void *fill_search_info(const char *, size_t, void *); >>> @@ -364,6 +365,7 @@ enum { >>> LD_TRACE_LOADED_OBJECTS_FMT1, >>> LD_TRACE_LOADED_OBJECTS_FMT2, >>> LD_TRACE_LOADED_OBJECTS_ALL, >>> + LD_SHOW_AUXV, >>> }; >>>=20 >>> struct ld_env_var_desc { >>> @@ -396,6 +398,7 @@ static struct ld_env_var_desc ld_env_vars[] =3D = { >>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT1, false), >>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT2, false), >>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_ALL, false), >>> + LD_ENV_DESC(SHOW_AUXV, false), >>> }; >>>=20 >>> static const char * >>> @@ -857,6 +860,9 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, = Obj_Entry **objp) >>> if (rtld_verify_versions(&list_main) =3D=3D -1 && !ld_tracing) >>> rtld_die(); >>>=20 >>> + if (ld_get_env_var(LD_SHOW_AUXV) !=3D NULL) >>> + dump_auxv(aux_info); >>> + >>> if (ld_tracing) { /* We're done */ >>> trace_loaded_objects(obj_main); >>> exit(0); >>> @@ -6058,6 +6064,67 @@ print_usage(const char *argv0) >>> " Arguments to the executed process\n", argv0); >>> } >>>=20 >>> +#define AUXFMT(at, xfmt) [at] =3D { .name =3D #at, .fmt =3D xfmt = } >>> +static const struct auxfmt { >>> + const char *name; >>> + const char *fmt; >>> +} auxfmts[] =3D { >>> + AUXFMT(AT_NULL, NULL), >>> + AUXFMT(AT_IGNORE, NULL), >>> + AUXFMT(AT_EXECFD, "%d"), >>> + AUXFMT(AT_PHDR, "%p"), >>> + AUXFMT(AT_PHENT, "%u"), >>> + AUXFMT(AT_PHNUM, "%u"), >>> + AUXFMT(AT_PAGESZ, "%u"), >>> + AUXFMT(AT_BASE, "%#lx"), >>> + AUXFMT(AT_FLAGS, "%#lx"), >>> + AUXFMT(AT_ENTRY, "%p"), >>> + AUXFMT(AT_NOTELF, NULL), >>> + AUXFMT(AT_UID, "%d"), >>> + AUXFMT(AT_EUID, "%d"), >>> + AUXFMT(AT_GID, "%d"), >>> + AUXFMT(AT_EGID, "%d"), >>> + AUXFMT(AT_EXECPATH, "%s"), >>> + AUXFMT(AT_CANARY, "%p"), >>> + AUXFMT(AT_CANARYLEN, "%u"), >>> + AUXFMT(AT_OSRELDATE, "%u"), >>> + AUXFMT(AT_NCPUS, "%u"), >>> + AUXFMT(AT_PAGESIZES, "%p"), >>> + AUXFMT(AT_PAGESIZESLEN, "%u"), >>> + AUXFMT(AT_TIMEKEEP, "%p"), >>> + AUXFMT(AT_STACKPROT, "%#x"), >>> + AUXFMT(AT_EHDRFLAGS, "%#lx"), >>> + AUXFMT(AT_HWCAP, "%#lx"), >>> + AUXFMT(AT_HWCAP2, "%#lx"), >>> + AUXFMT(AT_BSDFLAGS, "%#lx"), >>> + AUXFMT(AT_ARGC, "%u"), >>> + AUXFMT(AT_ARGV, "%p"), >>> + AUXFMT(AT_ENVC, "%p"), >>> + AUXFMT(AT_ENVV, "%p"), >>> + AUXFMT(AT_PS_STRINGS, "%p"), >>> + AUXFMT(AT_FXRNG, "%p"), >>> +}; >>> + >>> +static void >>> +dump_auxv(Elf_Auxinfo **aux_info) >>> +{ >>> + Elf_Auxinfo *auxp; >>> + const struct auxfmt *fmt; >>> + int i; >>> + >>> + for (i =3D 0; i < AT_COUNT; i++) { >>> + auxp =3D aux_info[i]; >>> + if (auxp =3D=3D NULL) >>> + continue; >>> + fmt =3D &auxfmts[i]; >>> + if (fmt->fmt =3D=3D NULL) >>> + continue; >>> + rtld_fdprintf(STDOUT_FILENO, "%s:\t", fmt->name); >>> + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, = auxp->a_un.a_ptr); >>> + rtld_fdprintf(STDOUT_FILENO, "\n"); >>=20 >> This is undefined behaviour, breaks CHERI, and totally unnecessary. = You >> have a handful of cases here, just make an enum and have separate >> rtld_fdprintf calls. In particular, ignoring CHERI, unsigned ints are sign-extended to 64 bits on MIPS and RISC-V. Thus by passing a 64-bit value but using a %u, you are violating the calling convention. I can=E2=80=99t currently get = GCC or Clang to exploit the fact that varargs arguments are sign-extended, but on MIPS, and RISC-V GCC (Clang is currently stupid and round-trips via memory even when the va_arg calls have no branching surrounding them, rather than just grabbing from the register) there is a redundant sext.w that can legally be optimised out, but would be broken by this calling convention violation. Then CHERI makes it worse because a_ptr and a_val do not have the same representation, although in practice I think passing a_ptr and nothing further does end up working on CHERI-RISC-V and Morello, just not CHERI-MIPS due to being big-endian. Jess >> Also the table itself is brittle, there=E2=80=99s nothing checking = that the >> order perfectly matches up with the defines in the header. Why not = use >> designated initialisers to ensure that the right values are in the >> right entries (and handle the possibility that name might be NULL)? >=20 > Scratch that second part, I missed the [at] =3D in the macro. >=20 > Jess From nobody Sat Nov 13 18:58:53 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C9907183C255; Sat, 13 Nov 2021 18:59:09 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs4W13WYGz4dB5; Sat, 13 Nov 2021 18:59:09 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 1ADIwrLr070070 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 13 Nov 2021 20:58:56 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 1ADIwrLr070070 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 1ADIwrVq070069; Sat, 13 Nov 2021 20:58:53 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 13 Nov 2021 20:58:53 +0200 From: Konstantin Belousov To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 64ba1f4cf3a6 - main - rtld: Implement LD_SHOW_AUXV Message-ID: References: <202111131733.1ADHXekX049248@gitrepo.freebsd.org> <37FC39AA-925D-4D75-8E0A-EA14E846E3A6@freebsd.org> <110784F6-3A7A-4F27-AAEB-E9B5A8F7CF0E@freebsd.org> <2450270B-CB98-43D0-B3BE-3C6D02F9B6FD@freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2450270B-CB98-43D0-B3BE-3C6D02F9B6FD@freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4Hs4W13WYGz4dB5 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Sat, Nov 13, 2021 at 06:29:24PM +0000, Jessica Clarke wrote: > On 13 Nov 2021, at 17:57, Jessica Clarke wrote: > > > > On 13 Nov 2021, at 17:54, Jessica Clarke wrote: > >> > >> On 13 Nov 2021, at 17:33, Konstantin Belousov wrote: > >>> > >>> The branch main has been updated by kib: > >>> > >>> URL: https://cgit.FreeBSD.org/src/commit/?id=64ba1f4cf3a6847a1dacf4bab0409d94898fa168 > >>> > >>> commit 64ba1f4cf3a6847a1dacf4bab0409d94898fa168 > >>> Author: Konstantin Belousov > >>> AuthorDate: 2021-11-13 01:18:13 +0000 > >>> Commit: Konstantin Belousov > >>> CommitDate: 2021-11-13 17:33:13 +0000 > >>> > >>> rtld: Implement LD_SHOW_AUXV > >>> > >>> It dumps auxv as seen by interpreter, right before starting any user > >>> code. > >>> > >>> Copied from: glibc > >>> Sponsored by: The FreeBSD Foundation > >>> MFC after: 1 week > >>> --- > >>> libexec/rtld-elf/rtld.1 | 7 +++++- > >>> libexec/rtld-elf/rtld.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++++ > >>> 2 files changed, 73 insertions(+), 1 deletion(-) > >>> > >>> diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 > >>> index 187dc105667a..66aa2bdabd17 100644 > >>> --- a/libexec/rtld-elf/rtld.1 > >>> +++ b/libexec/rtld-elf/rtld.1 > >>> @@ -28,7 +28,7 @@ > >>> .\" > >>> .\" $FreeBSD$ > >>> .\" > >>> -.Dd August 15, 2021 > >>> +.Dd November 13, 2021 > >>> .Dt RTLD 1 > >>> .Os > >>> .Sh NAME > >>> @@ -309,6 +309,11 @@ will process the filtee dependencies of the loaded objects immediately, > >>> instead of postponing it until required. > >>> Normally, the filtees are opened at the time of the first symbol resolution > >>> from the filter object. > >>> +.It Ev LD_SHOW_AUXV > >>> +If set, causes > >>> +.Nm > >>> +to dump content of the aux vector to standard output, before passing > >>> +control to any user code. > >>> .El > >>> .Sh DIRECT EXECUTION MODE > >>> .Nm > >>> diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c > >>> index c173c5a6e22e..0475134b0d96 100644 > >>> --- a/libexec/rtld-elf/rtld.c > >>> +++ b/libexec/rtld-elf/rtld.c > >>> @@ -104,6 +104,7 @@ static Obj_Entry *dlopen_object(const char *name, int fd, Obj_Entry *refobj, > >>> static Obj_Entry *do_load_object(int, const char *, char *, struct stat *, int); > >>> static int do_search_info(const Obj_Entry *obj, int, struct dl_serinfo *); > >>> static bool donelist_check(DoneList *, const Obj_Entry *); > >>> +static void dump_auxv(Elf_Auxinfo **aux_info); > >>> static void errmsg_restore(struct dlerror_save *); > >>> static struct dlerror_save *errmsg_save(void); > >>> static void *fill_search_info(const char *, size_t, void *); > >>> @@ -364,6 +365,7 @@ enum { > >>> LD_TRACE_LOADED_OBJECTS_FMT1, > >>> LD_TRACE_LOADED_OBJECTS_FMT2, > >>> LD_TRACE_LOADED_OBJECTS_ALL, > >>> + LD_SHOW_AUXV, > >>> }; > >>> > >>> struct ld_env_var_desc { > >>> @@ -396,6 +398,7 @@ static struct ld_env_var_desc ld_env_vars[] = { > >>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT1, false), > >>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT2, false), > >>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_ALL, false), > >>> + LD_ENV_DESC(SHOW_AUXV, false), > >>> }; > >>> > >>> static const char * > >>> @@ -857,6 +860,9 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) > >>> if (rtld_verify_versions(&list_main) == -1 && !ld_tracing) > >>> rtld_die(); > >>> > >>> + if (ld_get_env_var(LD_SHOW_AUXV) != NULL) > >>> + dump_auxv(aux_info); > >>> + > >>> if (ld_tracing) { /* We're done */ > >>> trace_loaded_objects(obj_main); > >>> exit(0); > >>> @@ -6058,6 +6064,67 @@ print_usage(const char *argv0) > >>> " Arguments to the executed process\n", argv0); > >>> } > >>> > >>> +#define AUXFMT(at, xfmt) [at] = { .name = #at, .fmt = xfmt } > >>> +static const struct auxfmt { > >>> + const char *name; > >>> + const char *fmt; > >>> +} auxfmts[] = { > >>> + AUXFMT(AT_NULL, NULL), > >>> + AUXFMT(AT_IGNORE, NULL), > >>> + AUXFMT(AT_EXECFD, "%d"), > >>> + AUXFMT(AT_PHDR, "%p"), > >>> + AUXFMT(AT_PHENT, "%u"), > >>> + AUXFMT(AT_PHNUM, "%u"), > >>> + AUXFMT(AT_PAGESZ, "%u"), > >>> + AUXFMT(AT_BASE, "%#lx"), > >>> + AUXFMT(AT_FLAGS, "%#lx"), > >>> + AUXFMT(AT_ENTRY, "%p"), > >>> + AUXFMT(AT_NOTELF, NULL), > >>> + AUXFMT(AT_UID, "%d"), > >>> + AUXFMT(AT_EUID, "%d"), > >>> + AUXFMT(AT_GID, "%d"), > >>> + AUXFMT(AT_EGID, "%d"), > >>> + AUXFMT(AT_EXECPATH, "%s"), > >>> + AUXFMT(AT_CANARY, "%p"), > >>> + AUXFMT(AT_CANARYLEN, "%u"), > >>> + AUXFMT(AT_OSRELDATE, "%u"), > >>> + AUXFMT(AT_NCPUS, "%u"), > >>> + AUXFMT(AT_PAGESIZES, "%p"), > >>> + AUXFMT(AT_PAGESIZESLEN, "%u"), > >>> + AUXFMT(AT_TIMEKEEP, "%p"), > >>> + AUXFMT(AT_STACKPROT, "%#x"), > >>> + AUXFMT(AT_EHDRFLAGS, "%#lx"), > >>> + AUXFMT(AT_HWCAP, "%#lx"), > >>> + AUXFMT(AT_HWCAP2, "%#lx"), > >>> + AUXFMT(AT_BSDFLAGS, "%#lx"), > >>> + AUXFMT(AT_ARGC, "%u"), > >>> + AUXFMT(AT_ARGV, "%p"), > >>> + AUXFMT(AT_ENVC, "%p"), > >>> + AUXFMT(AT_ENVV, "%p"), > >>> + AUXFMT(AT_PS_STRINGS, "%p"), > >>> + AUXFMT(AT_FXRNG, "%p"), > >>> +}; > >>> + > >>> +static void > >>> +dump_auxv(Elf_Auxinfo **aux_info) > >>> +{ > >>> + Elf_Auxinfo *auxp; > >>> + const struct auxfmt *fmt; > >>> + int i; > >>> + > >>> + for (i = 0; i < AT_COUNT; i++) { > >>> + auxp = aux_info[i]; > >>> + if (auxp == NULL) > >>> + continue; > >>> + fmt = &auxfmts[i]; > >>> + if (fmt->fmt == NULL) > >>> + continue; > >>> + rtld_fdprintf(STDOUT_FILENO, "%s:\t", fmt->name); > >>> + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, auxp->a_un.a_ptr); > >>> + rtld_fdprintf(STDOUT_FILENO, "\n"); > >> > >> This is undefined behaviour, breaks CHERI, and totally unnecessary. You > >> have a handful of cases here, just make an enum and have separate > >> rtld_fdprintf calls. > > In particular, ignoring CHERI, unsigned ints are sign-extended to 64 > bits on MIPS and RISC-V. Thus by passing a 64-bit value but using a %u, > you are violating the calling convention. I can’t currently get GCC or > Clang to exploit the fact that varargs arguments are sign-extended, but > on MIPS, and RISC-V GCC (Clang is currently stupid and round-trips via > memory even when the va_arg calls have no branching surrounding them, > rather than just grabbing from the register) there is a redundant > sext.w that can legally be optimised out, but would be broken by this > calling convention violation. I might understand the argument that all non-pointer formats for auxv should be longs, i.e. %lu/%ld/%lx, but this is the only problem I see there. We do rely on having specific representations for addresses and longs, and a low-level component as rtld has full rights to exercise this fact, same as VM subsystem or memory allocators. In fact ELF spec exercises this as well. Our arches are either ILP32 or LP64. > > Then CHERI makes it worse because a_ptr and a_val do not have the same > representation, although in practice I think passing a_ptr and nothing > further does end up working on CHERI-RISC-V and Morello, just not > CHERI-MIPS due to being big-endian. > > Jess > > >> Also the table itself is brittle, there’s nothing checking that the > >> order perfectly matches up with the defines in the header. Why not use > >> designated initialisers to ensure that the right values are in the > >> right entries (and handle the possibility that name might be NULL)? > > > > Scratch that second part, I missed the [at] = in the macro. > > > > Jess > From nobody Sat Nov 13 19:06:37 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9BCC9184817C; Sat, 13 Nov 2021 19:06:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs4gq5jsDz4gPl; Sat, 13 Nov 2021 19:06:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 1ADJ6brS072471 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 13 Nov 2021 21:06:40 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 1ADJ6brS072471 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 1ADJ6b6g072470; Sat, 13 Nov 2021 21:06:37 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 13 Nov 2021 21:06:37 +0200 From: Konstantin Belousov To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 64ba1f4cf3a6 - main - rtld: Implement LD_SHOW_AUXV Message-ID: References: <202111131733.1ADHXekX049248@gitrepo.freebsd.org> <37FC39AA-925D-4D75-8E0A-EA14E846E3A6@freebsd.org> <110784F6-3A7A-4F27-AAEB-E9B5A8F7CF0E@freebsd.org> <2450270B-CB98-43D0-B3BE-3C6D02F9B6FD@freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4Hs4gq5jsDz4gPl X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [1.00 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_SPF_SOFTFAIL(0.00)[~all:c]; NEURAL_SPAM_MEDIUM(1.00)[1.000]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(1.00)[0.997]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-ThisMailContainsUnwantedMimeParts: N On Sat, Nov 13, 2021 at 08:59:00PM +0200, Konstantin Belousov wrote: > On Sat, Nov 13, 2021 at 06:29:24PM +0000, Jessica Clarke wrote: > > On 13 Nov 2021, at 17:57, Jessica Clarke wrote: > > > > > > On 13 Nov 2021, at 17:54, Jessica Clarke wrote: > > >> > > >> On 13 Nov 2021, at 17:33, Konstantin Belousov wrote: > > >>> > > >>> The branch main has been updated by kib: > > >>> > > >>> URL: https://cgit.FreeBSD.org/src/commit/?id=64ba1f4cf3a6847a1dacf4bab0409d94898fa168 > > >>> > > >>> commit 64ba1f4cf3a6847a1dacf4bab0409d94898fa168 > > >>> Author: Konstantin Belousov > > >>> AuthorDate: 2021-11-13 01:18:13 +0000 > > >>> Commit: Konstantin Belousov > > >>> CommitDate: 2021-11-13 17:33:13 +0000 > > >>> > > >>> rtld: Implement LD_SHOW_AUXV > > >>> > > >>> It dumps auxv as seen by interpreter, right before starting any user > > >>> code. > > >>> > > >>> Copied from: glibc > > >>> Sponsored by: The FreeBSD Foundation > > >>> MFC after: 1 week > > >>> --- > > >>> libexec/rtld-elf/rtld.1 | 7 +++++- > > >>> libexec/rtld-elf/rtld.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++++ > > >>> 2 files changed, 73 insertions(+), 1 deletion(-) > > >>> > > >>> diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 > > >>> index 187dc105667a..66aa2bdabd17 100644 > > >>> --- a/libexec/rtld-elf/rtld.1 > > >>> +++ b/libexec/rtld-elf/rtld.1 > > >>> @@ -28,7 +28,7 @@ > > >>> .\" > > >>> .\" $FreeBSD$ > > >>> .\" > > >>> -.Dd August 15, 2021 > > >>> +.Dd November 13, 2021 > > >>> .Dt RTLD 1 > > >>> .Os > > >>> .Sh NAME > > >>> @@ -309,6 +309,11 @@ will process the filtee dependencies of the loaded objects immediately, > > >>> instead of postponing it until required. > > >>> Normally, the filtees are opened at the time of the first symbol resolution > > >>> from the filter object. > > >>> +.It Ev LD_SHOW_AUXV > > >>> +If set, causes > > >>> +.Nm > > >>> +to dump content of the aux vector to standard output, before passing > > >>> +control to any user code. > > >>> .El > > >>> .Sh DIRECT EXECUTION MODE > > >>> .Nm > > >>> diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c > > >>> index c173c5a6e22e..0475134b0d96 100644 > > >>> --- a/libexec/rtld-elf/rtld.c > > >>> +++ b/libexec/rtld-elf/rtld.c > > >>> @@ -104,6 +104,7 @@ static Obj_Entry *dlopen_object(const char *name, int fd, Obj_Entry *refobj, > > >>> static Obj_Entry *do_load_object(int, const char *, char *, struct stat *, int); > > >>> static int do_search_info(const Obj_Entry *obj, int, struct dl_serinfo *); > > >>> static bool donelist_check(DoneList *, const Obj_Entry *); > > >>> +static void dump_auxv(Elf_Auxinfo **aux_info); > > >>> static void errmsg_restore(struct dlerror_save *); > > >>> static struct dlerror_save *errmsg_save(void); > > >>> static void *fill_search_info(const char *, size_t, void *); > > >>> @@ -364,6 +365,7 @@ enum { > > >>> LD_TRACE_LOADED_OBJECTS_FMT1, > > >>> LD_TRACE_LOADED_OBJECTS_FMT2, > > >>> LD_TRACE_LOADED_OBJECTS_ALL, > > >>> + LD_SHOW_AUXV, > > >>> }; > > >>> > > >>> struct ld_env_var_desc { > > >>> @@ -396,6 +398,7 @@ static struct ld_env_var_desc ld_env_vars[] = { > > >>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT1, false), > > >>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT2, false), > > >>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_ALL, false), > > >>> + LD_ENV_DESC(SHOW_AUXV, false), > > >>> }; > > >>> > > >>> static const char * > > >>> @@ -857,6 +860,9 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) > > >>> if (rtld_verify_versions(&list_main) == -1 && !ld_tracing) > > >>> rtld_die(); > > >>> > > >>> + if (ld_get_env_var(LD_SHOW_AUXV) != NULL) > > >>> + dump_auxv(aux_info); > > >>> + > > >>> if (ld_tracing) { /* We're done */ > > >>> trace_loaded_objects(obj_main); > > >>> exit(0); > > >>> @@ -6058,6 +6064,67 @@ print_usage(const char *argv0) > > >>> " Arguments to the executed process\n", argv0); > > >>> } > > >>> > > >>> +#define AUXFMT(at, xfmt) [at] = { .name = #at, .fmt = xfmt } > > >>> +static const struct auxfmt { > > >>> + const char *name; > > >>> + const char *fmt; > > >>> +} auxfmts[] = { > > >>> + AUXFMT(AT_NULL, NULL), > > >>> + AUXFMT(AT_IGNORE, NULL), > > >>> + AUXFMT(AT_EXECFD, "%d"), > > >>> + AUXFMT(AT_PHDR, "%p"), > > >>> + AUXFMT(AT_PHENT, "%u"), > > >>> + AUXFMT(AT_PHNUM, "%u"), > > >>> + AUXFMT(AT_PAGESZ, "%u"), > > >>> + AUXFMT(AT_BASE, "%#lx"), > > >>> + AUXFMT(AT_FLAGS, "%#lx"), > > >>> + AUXFMT(AT_ENTRY, "%p"), > > >>> + AUXFMT(AT_NOTELF, NULL), > > >>> + AUXFMT(AT_UID, "%d"), > > >>> + AUXFMT(AT_EUID, "%d"), > > >>> + AUXFMT(AT_GID, "%d"), > > >>> + AUXFMT(AT_EGID, "%d"), > > >>> + AUXFMT(AT_EXECPATH, "%s"), > > >>> + AUXFMT(AT_CANARY, "%p"), > > >>> + AUXFMT(AT_CANARYLEN, "%u"), > > >>> + AUXFMT(AT_OSRELDATE, "%u"), > > >>> + AUXFMT(AT_NCPUS, "%u"), > > >>> + AUXFMT(AT_PAGESIZES, "%p"), > > >>> + AUXFMT(AT_PAGESIZESLEN, "%u"), > > >>> + AUXFMT(AT_TIMEKEEP, "%p"), > > >>> + AUXFMT(AT_STACKPROT, "%#x"), > > >>> + AUXFMT(AT_EHDRFLAGS, "%#lx"), > > >>> + AUXFMT(AT_HWCAP, "%#lx"), > > >>> + AUXFMT(AT_HWCAP2, "%#lx"), > > >>> + AUXFMT(AT_BSDFLAGS, "%#lx"), > > >>> + AUXFMT(AT_ARGC, "%u"), > > >>> + AUXFMT(AT_ARGV, "%p"), > > >>> + AUXFMT(AT_ENVC, "%p"), > > >>> + AUXFMT(AT_ENVV, "%p"), > > >>> + AUXFMT(AT_PS_STRINGS, "%p"), > > >>> + AUXFMT(AT_FXRNG, "%p"), > > >>> +}; > > >>> + > > >>> +static void > > >>> +dump_auxv(Elf_Auxinfo **aux_info) > > >>> +{ > > >>> + Elf_Auxinfo *auxp; > > >>> + const struct auxfmt *fmt; > > >>> + int i; > > >>> + > > >>> + for (i = 0; i < AT_COUNT; i++) { > > >>> + auxp = aux_info[i]; > > >>> + if (auxp == NULL) > > >>> + continue; > > >>> + fmt = &auxfmts[i]; > > >>> + if (fmt->fmt == NULL) > > >>> + continue; > > >>> + rtld_fdprintf(STDOUT_FILENO, "%s:\t", fmt->name); > > >>> + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, auxp->a_un.a_ptr); > > >>> + rtld_fdprintf(STDOUT_FILENO, "\n"); > > >> > > >> This is undefined behaviour, breaks CHERI, and totally unnecessary. You > > >> have a handful of cases here, just make an enum and have separate > > >> rtld_fdprintf calls. > > > > In particular, ignoring CHERI, unsigned ints are sign-extended to 64 > > bits on MIPS and RISC-V. Thus by passing a 64-bit value but using a %u, > > you are violating the calling convention. I can’t currently get GCC or > > Clang to exploit the fact that varargs arguments are sign-extended, but > > on MIPS, and RISC-V GCC (Clang is currently stupid and round-trips via > > memory even when the va_arg calls have no branching surrounding them, > > rather than just grabbing from the register) there is a redundant > > sext.w that can legally be optimised out, but would be broken by this > > calling convention violation. > I might understand the argument that all non-pointer formats for auxv > should be longs, i.e. %lu/%ld/%lx, but this is the only problem I see > there. We do rely on having specific representations for addresses and > longs, and a low-level component as rtld has full rights to exercise > this fact, same as VM subsystem or memory allocators. > > In fact ELF spec exercises this as well. > Our arches are either ILP32 or LP64. > > > > > Then CHERI makes it worse because a_ptr and a_val do not have the same > > representation, although in practice I think passing a_ptr and nothing > > further does end up working on CHERI-RISC-V and Morello, just not > > CHERI-MIPS due to being big-endian. Ok, the following should be enough for CHERI, right? diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 0475134b0d96..cf467ae7aacd 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -6071,33 +6071,33 @@ static const struct auxfmt { } auxfmts[] = { AUXFMT(AT_NULL, NULL), AUXFMT(AT_IGNORE, NULL), - AUXFMT(AT_EXECFD, "%d"), + AUXFMT(AT_EXECFD, "%ld"), AUXFMT(AT_PHDR, "%p"), - AUXFMT(AT_PHENT, "%u"), - AUXFMT(AT_PHNUM, "%u"), - AUXFMT(AT_PAGESZ, "%u"), + AUXFMT(AT_PHENT, "%lu"), + AUXFMT(AT_PHNUM, "%lu"), + AUXFMT(AT_PAGESZ, "%lu"), AUXFMT(AT_BASE, "%#lx"), AUXFMT(AT_FLAGS, "%#lx"), AUXFMT(AT_ENTRY, "%p"), AUXFMT(AT_NOTELF, NULL), - AUXFMT(AT_UID, "%d"), - AUXFMT(AT_EUID, "%d"), - AUXFMT(AT_GID, "%d"), - AUXFMT(AT_EGID, "%d"), + AUXFMT(AT_UID, "%ld"), + AUXFMT(AT_EUID, "%ld"), + AUXFMT(AT_GID, "%ld"), + AUXFMT(AT_EGID, "%ld"), AUXFMT(AT_EXECPATH, "%s"), AUXFMT(AT_CANARY, "%p"), - AUXFMT(AT_CANARYLEN, "%u"), - AUXFMT(AT_OSRELDATE, "%u"), - AUXFMT(AT_NCPUS, "%u"), + AUXFMT(AT_CANARYLEN, "%lu"), + AUXFMT(AT_OSRELDATE, "%lu"), + AUXFMT(AT_NCPUS, "%lu"), AUXFMT(AT_PAGESIZES, "%p"), - AUXFMT(AT_PAGESIZESLEN, "%u"), + AUXFMT(AT_PAGESIZESLEN, "%lu"), AUXFMT(AT_TIMEKEEP, "%p"), - AUXFMT(AT_STACKPROT, "%#x"), + AUXFMT(AT_STACKPROT, "%#lx"), AUXFMT(AT_EHDRFLAGS, "%#lx"), AUXFMT(AT_HWCAP, "%#lx"), AUXFMT(AT_HWCAP2, "%#lx"), AUXFMT(AT_BSDFLAGS, "%#lx"), - AUXFMT(AT_ARGC, "%u"), + AUXFMT(AT_ARGC, "%lu"), AUXFMT(AT_ARGV, "%p"), AUXFMT(AT_ENVC, "%p"), AUXFMT(AT_ENVV, "%p"), @@ -6105,6 +6105,15 @@ static const struct auxfmt { AUXFMT(AT_FXRNG, "%p"), }; +static bool +is_ptr_fmt(const char *fmt) +{ + char last; + + last = fmt[strlen(fmt) - 1]; + return (last == 'p' || last == 's'); +} + static void dump_auxv(Elf_Auxinfo **aux_info) { @@ -6120,7 +6129,8 @@ dump_auxv(Elf_Auxinfo **aux_info) if (fmt->fmt == NULL) continue; rtld_fdprintf(STDOUT_FILENO, "%s:\t", fmt->name); - rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, auxp->a_un.a_ptr); + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, is_ptr_fmt(fmt->fmt) ? + auxp->a_un.a_ptr : auxp->a_un.a_val); rtld_fdprintf(STDOUT_FILENO, "\n"); } } From nobody Sat Nov 13 19:07:53 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EC89118485A2 for ; Sat, 13 Nov 2021 19:08:02 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs4jG5VQLz4ggQ for ; Sat, 13 Nov 2021 19:08:02 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f46.google.com with SMTP id f7-20020a1c1f07000000b0032ee11917ceso9263886wmf.0 for ; Sat, 13 Nov 2021 11:08:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tseSdlOaf7jHqhuYivigm1iwPSwiw4qduHIi51qliv8=; b=1qHoiFBQQEo/iUwdachzn4RrgHJGwNIlxxEtLXYecWdK60f1DDLa0uxLTyiVuj4yWW eUGu7mzcNLJbtx8FcKLKSeiYc2Pmu2QH1r4Mf+zI3cJB1YQfJ8OlPqAWGNikEOjN4krW fxsA8kuxEqy0IlQa1ZD7Q8brlW5suetGHi80eYQ36dkCOhPcsLjErHG2bbwLxFYfKk9R a2FQorw/TJRFBUXMfpoc/9PDtqXtaxpaY6aHYSMktLUdGORosAkqf70yCq7tUUZo8O2A /eIhVjnocbco1ZaweqmA8m167Ez+Q264fAqsLMoGOm8PaCRZH5n439Qa1XF4OUnt4qJS zsKw== X-Gm-Message-State: AOAM5311YTfpMejBLz4XG33YU3HJttSMHFl+xwfSgNVOyR7VclPNtp3a UgPU1lmdbgE1rY6AevRu6Vvp+A== X-Google-Smtp-Source: ABdhPJzHUg9auFXYetJAWGcFzmwxLHYdKEBPXZdrs58/l7Ckj6yYXR+QR6umOnx0eebabO3oCjuEOA== X-Received: by 2002:a05:600c:1548:: with SMTP id f8mr45345645wmg.67.1636830475033; Sat, 13 Nov 2021 11:07:55 -0800 (PST) Received: from smtpclient.apple (global-5-141.nat-2.net.cam.ac.uk. [131.111.5.141]) by smtp.gmail.com with ESMTPSA id b14sm11731360wrd.24.2021.11.13.11.07.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Nov 2021 11:07:54 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: 64ba1f4cf3a6 - main - rtld: Implement LD_SHOW_AUXV From: Jessica Clarke In-Reply-To: Date: Sat, 13 Nov 2021 19:07:53 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202111131733.1ADHXekX049248@gitrepo.freebsd.org> <37FC39AA-925D-4D75-8E0A-EA14E846E3A6@freebsd.org> <110784F6-3A7A-4F27-AAEB-E9B5A8F7CF0E@freebsd.org> <2450270B-CB98-43D0-B3BE-3C6D02F9B6FD@freebsd.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4Hs4jG5VQLz4ggQ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 13 Nov 2021, at 18:58, Konstantin Belousov = wrote: >=20 > On Sat, Nov 13, 2021 at 06:29:24PM +0000, Jessica Clarke wrote: >> On 13 Nov 2021, at 17:57, Jessica Clarke wrote: >>>=20 >>> On 13 Nov 2021, at 17:54, Jessica Clarke wrote: >>>>=20 >>>> On 13 Nov 2021, at 17:33, Konstantin Belousov = wrote: >>>>>=20 >>>>> The branch main has been updated by kib: >>>>>=20 >>>>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D64ba1f4cf3a6847a1dacf4bab0409d94= 898fa168 >>>>>=20 >>>>> commit 64ba1f4cf3a6847a1dacf4bab0409d94898fa168 >>>>> Author: Konstantin Belousov >>>>> AuthorDate: 2021-11-13 01:18:13 +0000 >>>>> Commit: Konstantin Belousov >>>>> CommitDate: 2021-11-13 17:33:13 +0000 >>>>>=20 >>>>> rtld: Implement LD_SHOW_AUXV >>>>>=20 >>>>> It dumps auxv as seen by interpreter, right before starting any = user >>>>> code. >>>>>=20 >>>>> Copied from: glibc >>>>> Sponsored by: The FreeBSD Foundation >>>>> MFC after: 1 week >>>>> --- >>>>> libexec/rtld-elf/rtld.1 | 7 +++++- >>>>> libexec/rtld-elf/rtld.c | 67 = +++++++++++++++++++++++++++++++++++++++++++++++++ >>>>> 2 files changed, 73 insertions(+), 1 deletion(-) >>>>>=20 >>>>> diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 >>>>> index 187dc105667a..66aa2bdabd17 100644 >>>>> --- a/libexec/rtld-elf/rtld.1 >>>>> +++ b/libexec/rtld-elf/rtld.1 >>>>> @@ -28,7 +28,7 @@ >>>>> .\" >>>>> .\" $FreeBSD$ >>>>> .\" >>>>> -.Dd August 15, 2021 >>>>> +.Dd November 13, 2021 >>>>> .Dt RTLD 1 >>>>> .Os >>>>> .Sh NAME >>>>> @@ -309,6 +309,11 @@ will process the filtee dependencies of the = loaded objects immediately, >>>>> instead of postponing it until required. >>>>> Normally, the filtees are opened at the time of the first symbol = resolution >>>>> from the filter object. >>>>> +.It Ev LD_SHOW_AUXV >>>>> +If set, causes >>>>> +.Nm >>>>> +to dump content of the aux vector to standard output, before = passing >>>>> +control to any user code. >>>>> .El >>>>> .Sh DIRECT EXECUTION MODE >>>>> .Nm >>>>> diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c >>>>> index c173c5a6e22e..0475134b0d96 100644 >>>>> --- a/libexec/rtld-elf/rtld.c >>>>> +++ b/libexec/rtld-elf/rtld.c >>>>> @@ -104,6 +104,7 @@ static Obj_Entry *dlopen_object(const char = *name, int fd, Obj_Entry *refobj, >>>>> static Obj_Entry *do_load_object(int, const char *, char *, struct = stat *, int); >>>>> static int do_search_info(const Obj_Entry *obj, int, struct = dl_serinfo *); >>>>> static bool donelist_check(DoneList *, const Obj_Entry *); >>>>> +static void dump_auxv(Elf_Auxinfo **aux_info); >>>>> static void errmsg_restore(struct dlerror_save *); >>>>> static struct dlerror_save *errmsg_save(void); >>>>> static void *fill_search_info(const char *, size_t, void *); >>>>> @@ -364,6 +365,7 @@ enum { >>>>> LD_TRACE_LOADED_OBJECTS_FMT1, >>>>> LD_TRACE_LOADED_OBJECTS_FMT2, >>>>> LD_TRACE_LOADED_OBJECTS_ALL, >>>>> + LD_SHOW_AUXV, >>>>> }; >>>>>=20 >>>>> struct ld_env_var_desc { >>>>> @@ -396,6 +398,7 @@ static struct ld_env_var_desc ld_env_vars[] =3D = { >>>>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT1, false), >>>>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT2, false), >>>>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_ALL, false), >>>>> + LD_ENV_DESC(SHOW_AUXV, false), >>>>> }; >>>>>=20 >>>>> static const char * >>>>> @@ -857,6 +860,9 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, = Obj_Entry **objp) >>>>> if (rtld_verify_versions(&list_main) =3D=3D -1 && !ld_tracing) >>>>> rtld_die(); >>>>>=20 >>>>> + if (ld_get_env_var(LD_SHOW_AUXV) !=3D NULL) >>>>> + dump_auxv(aux_info); >>>>> + >>>>> if (ld_tracing) { /* We're done */ >>>>> trace_loaded_objects(obj_main); >>>>> exit(0); >>>>> @@ -6058,6 +6064,67 @@ print_usage(const char *argv0) >>>>> " Arguments to the executed process\n", argv0); >>>>> } >>>>>=20 >>>>> +#define AUXFMT(at, xfmt) [at] =3D { .name =3D #at, .fmt =3D xfmt = } >>>>> +static const struct auxfmt { >>>>> + const char *name; >>>>> + const char *fmt; >>>>> +} auxfmts[] =3D { >>>>> + AUXFMT(AT_NULL, NULL), >>>>> + AUXFMT(AT_IGNORE, NULL), >>>>> + AUXFMT(AT_EXECFD, "%d"), >>>>> + AUXFMT(AT_PHDR, "%p"), >>>>> + AUXFMT(AT_PHENT, "%u"), >>>>> + AUXFMT(AT_PHNUM, "%u"), >>>>> + AUXFMT(AT_PAGESZ, "%u"), >>>>> + AUXFMT(AT_BASE, "%#lx"), >>>>> + AUXFMT(AT_FLAGS, "%#lx"), >>>>> + AUXFMT(AT_ENTRY, "%p"), >>>>> + AUXFMT(AT_NOTELF, NULL), >>>>> + AUXFMT(AT_UID, "%d"), >>>>> + AUXFMT(AT_EUID, "%d"), >>>>> + AUXFMT(AT_GID, "%d"), >>>>> + AUXFMT(AT_EGID, "%d"), >>>>> + AUXFMT(AT_EXECPATH, "%s"), >>>>> + AUXFMT(AT_CANARY, "%p"), >>>>> + AUXFMT(AT_CANARYLEN, "%u"), >>>>> + AUXFMT(AT_OSRELDATE, "%u"), >>>>> + AUXFMT(AT_NCPUS, "%u"), >>>>> + AUXFMT(AT_PAGESIZES, "%p"), >>>>> + AUXFMT(AT_PAGESIZESLEN, "%u"), >>>>> + AUXFMT(AT_TIMEKEEP, "%p"), >>>>> + AUXFMT(AT_STACKPROT, "%#x"), >>>>> + AUXFMT(AT_EHDRFLAGS, "%#lx"), >>>>> + AUXFMT(AT_HWCAP, "%#lx"), >>>>> + AUXFMT(AT_HWCAP2, "%#lx"), >>>>> + AUXFMT(AT_BSDFLAGS, "%#lx"), >>>>> + AUXFMT(AT_ARGC, "%u"), >>>>> + AUXFMT(AT_ARGV, "%p"), >>>>> + AUXFMT(AT_ENVC, "%p"), >>>>> + AUXFMT(AT_ENVV, "%p"), >>>>> + AUXFMT(AT_PS_STRINGS, "%p"), >>>>> + AUXFMT(AT_FXRNG, "%p"), >>>>> +}; >>>>> + >>>>> +static void >>>>> +dump_auxv(Elf_Auxinfo **aux_info) >>>>> +{ >>>>> + Elf_Auxinfo *auxp; >>>>> + const struct auxfmt *fmt; >>>>> + int i; >>>>> + >>>>> + for (i =3D 0; i < AT_COUNT; i++) { >>>>> + auxp =3D aux_info[i]; >>>>> + if (auxp =3D=3D NULL) >>>>> + continue; >>>>> + fmt =3D &auxfmts[i]; >>>>> + if (fmt->fmt =3D=3D NULL) >>>>> + continue; >>>>> + rtld_fdprintf(STDOUT_FILENO, "%s:\t", fmt->name); >>>>> + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, = auxp->a_un.a_ptr); >>>>> + rtld_fdprintf(STDOUT_FILENO, "\n"); >>>>=20 >>>> This is undefined behaviour, breaks CHERI, and totally unnecessary. = You >>>> have a handful of cases here, just make an enum and have separate >>>> rtld_fdprintf calls. >>=20 >> In particular, ignoring CHERI, unsigned ints are sign-extended to 64 >> bits on MIPS and RISC-V. Thus by passing a 64-bit value but using a = %u, >> you are violating the calling convention. I can=E2=80=99t currently = get GCC or >> Clang to exploit the fact that varargs arguments are sign-extended, = but >> on MIPS, and RISC-V GCC (Clang is currently stupid and round-trips = via >> memory even when the va_arg calls have no branching surrounding them, >> rather than just grabbing from the register) there is a redundant >> sext.w that can legally be optimised out, but would be broken by this >> calling convention violation. > I might understand the argument that all non-pointer formats for auxv > should be longs, i.e. %lu/%ld/%lx, but this is the only problem I see > there. We do rely on having specific representations for addresses and > longs, and a low-level component as rtld has full rights to exercise > this fact, same as VM subsystem or memory allocators. Integer addresses are not the same thing as pointers. They happen to be for FreeBSD, but they are not for CHERI. > In fact ELF spec exercises this as well. > Our arches are either ILP32 or LP64. And ours downstream are not. My point is that your approach here is unnecessarily exploiting that, it could easily have been written to read the active member of the union rather than adding rtld_fdprintfx as a kludge that relies on pointers being plain integers. The portable code is just as easy to write. We upstream various pointer/integer conflation improvements and this commit makes that worse. Jess From nobody Sat Nov 13 19:09:35 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7CB5918487EF for ; Sat, 13 Nov 2021 19:09:37 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs4l52scPz4h6j for ; Sat, 13 Nov 2021 19:09:37 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f45.google.com with SMTP id y84-20020a1c7d57000000b00330cb84834fso12493272wmc.2 for ; Sat, 13 Nov 2021 11:09:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tJit0HGNBxxBQiavC9gryjS2WsDg+TFPi/Q6Tvxz6vY=; b=tFpA0ITWIQhS0lTrRYjX70HVzKiflqRW+a3YmemJWl+2O54oq2SwLkjPVz8qQkxuKl SmTc8nQl/VRBUqTf9QSGC/sgRfwJwr9qVv9RtBXWGCTCMR1CI3/jEDUMHvdaw5guWTKo dlb/t8ladXhueF53wHEk5R1sQILZh+ZC1N5yIpKboaoaBUxgmjW0n5/2Cri2BOTe98qv Pq38KfS9Xf9C4mnYOZH2pu2ayPaGCJnOb7ca+Cj2V/Z2OKxbxyBU9dgInY5BjusNoFcr 1Lj0VYjfYa8UBmjmByjKoPoqHraHdl47mZ96Y+0W9ArrjJCmJazbjC5bXY/9DSb7nL6t QFZQ== X-Gm-Message-State: AOAM533LzPLwkDB9rnL3VO28wHl9r4ucPO/7tkYN7pQhUilZkIfQ3Suj 43Nc8mUfW7WHlaYgYdgYYNvYBw== X-Google-Smtp-Source: ABdhPJysb//gV16ljfA61sre00HnsOOCpsKp5Ta/FKmOMctdtsr5Hmu7n16ZXGbqIjkFyEZiHNukgw== X-Received: by 2002:a05:600c:1914:: with SMTP id j20mr45544992wmq.26.1636830576411; Sat, 13 Nov 2021 11:09:36 -0800 (PST) Received: from smtpclient.apple (global-5-141.nat-2.net.cam.ac.uk. [131.111.5.141]) by smtp.gmail.com with ESMTPSA id n32sm17873670wms.1.2021.11.13.11.09.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Nov 2021 11:09:36 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: 64ba1f4cf3a6 - main - rtld: Implement LD_SHOW_AUXV From: Jessica Clarke In-Reply-To: Date: Sat, 13 Nov 2021 19:09:35 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202111131733.1ADHXekX049248@gitrepo.freebsd.org> <37FC39AA-925D-4D75-8E0A-EA14E846E3A6@freebsd.org> <110784F6-3A7A-4F27-AAEB-E9B5A8F7CF0E@freebsd.org> <2450270B-CB98-43D0-B3BE-3C6D02F9B6FD@freebsd.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4Hs4l52scPz4h6j X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 13 Nov 2021, at 19:06, Konstantin Belousov = wrote: > On Sat, Nov 13, 2021 at 08:59:00PM +0200, Konstantin Belousov wrote: >> On Sat, Nov 13, 2021 at 06:29:24PM +0000, Jessica Clarke wrote: >>> On 13 Nov 2021, at 17:57, Jessica Clarke wrote: >>>>=20 >>>> On 13 Nov 2021, at 17:54, Jessica Clarke = wrote: >>>>>=20 >>>>> On 13 Nov 2021, at 17:33, Konstantin Belousov = wrote: >>>>>>=20 >>>>>> The branch main has been updated by kib: >>>>>>=20 >>>>>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D64ba1f4cf3a6847a1dacf4bab0409d94= 898fa168 >>>>>>=20 >>>>>> commit 64ba1f4cf3a6847a1dacf4bab0409d94898fa168 >>>>>> Author: Konstantin Belousov >>>>>> AuthorDate: 2021-11-13 01:18:13 +0000 >>>>>> Commit: Konstantin Belousov >>>>>> CommitDate: 2021-11-13 17:33:13 +0000 >>>>>>=20 >>>>>> rtld: Implement LD_SHOW_AUXV >>>>>>=20 >>>>>> It dumps auxv as seen by interpreter, right before starting any = user >>>>>> code. >>>>>>=20 >>>>>> Copied from: glibc >>>>>> Sponsored by: The FreeBSD Foundation >>>>>> MFC after: 1 week >>>>>> --- >>>>>> libexec/rtld-elf/rtld.1 | 7 +++++- >>>>>> libexec/rtld-elf/rtld.c | 67 = +++++++++++++++++++++++++++++++++++++++++++++++++ >>>>>> 2 files changed, 73 insertions(+), 1 deletion(-) >>>>>>=20 >>>>>> diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 >>>>>> index 187dc105667a..66aa2bdabd17 100644 >>>>>> --- a/libexec/rtld-elf/rtld.1 >>>>>> +++ b/libexec/rtld-elf/rtld.1 >>>>>> @@ -28,7 +28,7 @@ >>>>>> .\" >>>>>> .\" $FreeBSD$ >>>>>> .\" >>>>>> -.Dd August 15, 2021 >>>>>> +.Dd November 13, 2021 >>>>>> .Dt RTLD 1 >>>>>> .Os >>>>>> .Sh NAME >>>>>> @@ -309,6 +309,11 @@ will process the filtee dependencies of the = loaded objects immediately, >>>>>> instead of postponing it until required. >>>>>> Normally, the filtees are opened at the time of the first symbol = resolution >>>>>> from the filter object. >>>>>> +.It Ev LD_SHOW_AUXV >>>>>> +If set, causes >>>>>> +.Nm >>>>>> +to dump content of the aux vector to standard output, before = passing >>>>>> +control to any user code. >>>>>> .El >>>>>> .Sh DIRECT EXECUTION MODE >>>>>> .Nm >>>>>> diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c >>>>>> index c173c5a6e22e..0475134b0d96 100644 >>>>>> --- a/libexec/rtld-elf/rtld.c >>>>>> +++ b/libexec/rtld-elf/rtld.c >>>>>> @@ -104,6 +104,7 @@ static Obj_Entry *dlopen_object(const char = *name, int fd, Obj_Entry *refobj, >>>>>> static Obj_Entry *do_load_object(int, const char *, char *, = struct stat *, int); >>>>>> static int do_search_info(const Obj_Entry *obj, int, struct = dl_serinfo *); >>>>>> static bool donelist_check(DoneList *, const Obj_Entry *); >>>>>> +static void dump_auxv(Elf_Auxinfo **aux_info); >>>>>> static void errmsg_restore(struct dlerror_save *); >>>>>> static struct dlerror_save *errmsg_save(void); >>>>>> static void *fill_search_info(const char *, size_t, void *); >>>>>> @@ -364,6 +365,7 @@ enum { >>>>>> LD_TRACE_LOADED_OBJECTS_FMT1, >>>>>> LD_TRACE_LOADED_OBJECTS_FMT2, >>>>>> LD_TRACE_LOADED_OBJECTS_ALL, >>>>>> + LD_SHOW_AUXV, >>>>>> }; >>>>>>=20 >>>>>> struct ld_env_var_desc { >>>>>> @@ -396,6 +398,7 @@ static struct ld_env_var_desc ld_env_vars[] =3D= { >>>>>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT1, false), >>>>>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT2, false), >>>>>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_ALL, false), >>>>>> + LD_ENV_DESC(SHOW_AUXV, false), >>>>>> }; >>>>>>=20 >>>>>> static const char * >>>>>> @@ -857,6 +860,9 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, = Obj_Entry **objp) >>>>>> if (rtld_verify_versions(&list_main) =3D=3D -1 && !ld_tracing) >>>>>> rtld_die(); >>>>>>=20 >>>>>> + if (ld_get_env_var(LD_SHOW_AUXV) !=3D NULL) >>>>>> + dump_auxv(aux_info); >>>>>> + >>>>>> if (ld_tracing) { /* We're done */ >>>>>> trace_loaded_objects(obj_main); >>>>>> exit(0); >>>>>> @@ -6058,6 +6064,67 @@ print_usage(const char *argv0) >>>>>> " Arguments to the executed process\n", argv0); >>>>>> } >>>>>>=20 >>>>>> +#define AUXFMT(at, xfmt) [at] =3D { .name =3D #at, .fmt =3D xfmt = } >>>>>> +static const struct auxfmt { >>>>>> + const char *name; >>>>>> + const char *fmt; >>>>>> +} auxfmts[] =3D { >>>>>> + AUXFMT(AT_NULL, NULL), >>>>>> + AUXFMT(AT_IGNORE, NULL), >>>>>> + AUXFMT(AT_EXECFD, "%d"), >>>>>> + AUXFMT(AT_PHDR, "%p"), >>>>>> + AUXFMT(AT_PHENT, "%u"), >>>>>> + AUXFMT(AT_PHNUM, "%u"), >>>>>> + AUXFMT(AT_PAGESZ, "%u"), >>>>>> + AUXFMT(AT_BASE, "%#lx"), >>>>>> + AUXFMT(AT_FLAGS, "%#lx"), >>>>>> + AUXFMT(AT_ENTRY, "%p"), >>>>>> + AUXFMT(AT_NOTELF, NULL), >>>>>> + AUXFMT(AT_UID, "%d"), >>>>>> + AUXFMT(AT_EUID, "%d"), >>>>>> + AUXFMT(AT_GID, "%d"), >>>>>> + AUXFMT(AT_EGID, "%d"), >>>>>> + AUXFMT(AT_EXECPATH, "%s"), >>>>>> + AUXFMT(AT_CANARY, "%p"), >>>>>> + AUXFMT(AT_CANARYLEN, "%u"), >>>>>> + AUXFMT(AT_OSRELDATE, "%u"), >>>>>> + AUXFMT(AT_NCPUS, "%u"), >>>>>> + AUXFMT(AT_PAGESIZES, "%p"), >>>>>> + AUXFMT(AT_PAGESIZESLEN, "%u"), >>>>>> + AUXFMT(AT_TIMEKEEP, "%p"), >>>>>> + AUXFMT(AT_STACKPROT, "%#x"), >>>>>> + AUXFMT(AT_EHDRFLAGS, "%#lx"), >>>>>> + AUXFMT(AT_HWCAP, "%#lx"), >>>>>> + AUXFMT(AT_HWCAP2, "%#lx"), >>>>>> + AUXFMT(AT_BSDFLAGS, "%#lx"), >>>>>> + AUXFMT(AT_ARGC, "%u"), >>>>>> + AUXFMT(AT_ARGV, "%p"), >>>>>> + AUXFMT(AT_ENVC, "%p"), >>>>>> + AUXFMT(AT_ENVV, "%p"), >>>>>> + AUXFMT(AT_PS_STRINGS, "%p"), >>>>>> + AUXFMT(AT_FXRNG, "%p"), >>>>>> +}; >>>>>> + >>>>>> +static void >>>>>> +dump_auxv(Elf_Auxinfo **aux_info) >>>>>> +{ >>>>>> + Elf_Auxinfo *auxp; >>>>>> + const struct auxfmt *fmt; >>>>>> + int i; >>>>>> + >>>>>> + for (i =3D 0; i < AT_COUNT; i++) { >>>>>> + auxp =3D aux_info[i]; >>>>>> + if (auxp =3D=3D NULL) >>>>>> + continue; >>>>>> + fmt =3D &auxfmts[i]; >>>>>> + if (fmt->fmt =3D=3D NULL) >>>>>> + continue; >>>>>> + rtld_fdprintf(STDOUT_FILENO, "%s:\t", = fmt->name); >>>>>> + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, = auxp->a_un.a_ptr); >>>>>> + rtld_fdprintf(STDOUT_FILENO, "\n"); >>>>>=20 >>>>> This is undefined behaviour, breaks CHERI, and totally = unnecessary. You >>>>> have a handful of cases here, just make an enum and have separate >>>>> rtld_fdprintf calls. >>>=20 >>> In particular, ignoring CHERI, unsigned ints are sign-extended to 64 >>> bits on MIPS and RISC-V. Thus by passing a 64-bit value but using a = %u, >>> you are violating the calling convention. I can=E2=80=99t currently = get GCC or >>> Clang to exploit the fact that varargs arguments are sign-extended, = but >>> on MIPS, and RISC-V GCC (Clang is currently stupid and round-trips = via >>> memory even when the va_arg calls have no branching surrounding = them, >>> rather than just grabbing from the register) there is a redundant >>> sext.w that can legally be optimised out, but would be broken by = this >>> calling convention violation. >> I might understand the argument that all non-pointer formats for auxv >> should be longs, i.e. %lu/%ld/%lx, but this is the only problem I see >> there. We do rely on having specific representations for addresses = and >> longs, and a low-level component as rtld has full rights to exercise >> this fact, same as VM subsystem or memory allocators. >>=20 >> In fact ELF spec exercises this as well. >> Our arches are either ILP32 or LP64. >>=20 >>>=20 >>> Then CHERI makes it worse because a_ptr and a_val do not have the = same >>> representation, although in practice I think passing a_ptr and = nothing >>> further does end up working on CHERI-RISC-V and Morello, just not >>> CHERI-MIPS due to being big-endian. >=20 > Ok, the following should be enough for CHERI, right? >=20 > diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c > index 0475134b0d96..cf467ae7aacd 100644 > --- a/libexec/rtld-elf/rtld.c > +++ b/libexec/rtld-elf/rtld.c > @@ -6071,33 +6071,33 @@ static const struct auxfmt { > } auxfmts[] =3D { > AUXFMT(AT_NULL, NULL), > AUXFMT(AT_IGNORE, NULL), > - AUXFMT(AT_EXECFD, "%d"), > + AUXFMT(AT_EXECFD, "%ld"), > AUXFMT(AT_PHDR, "%p"), > - AUXFMT(AT_PHENT, "%u"), > - AUXFMT(AT_PHNUM, "%u"), > - AUXFMT(AT_PAGESZ, "%u"), > + AUXFMT(AT_PHENT, "%lu"), > + AUXFMT(AT_PHNUM, "%lu"), > + AUXFMT(AT_PAGESZ, "%lu"), > AUXFMT(AT_BASE, "%#lx"), > AUXFMT(AT_FLAGS, "%#lx"), > AUXFMT(AT_ENTRY, "%p"), > AUXFMT(AT_NOTELF, NULL), > - AUXFMT(AT_UID, "%d"), > - AUXFMT(AT_EUID, "%d"), > - AUXFMT(AT_GID, "%d"), > - AUXFMT(AT_EGID, "%d"), > + AUXFMT(AT_UID, "%ld"), > + AUXFMT(AT_EUID, "%ld"), > + AUXFMT(AT_GID, "%ld"), > + AUXFMT(AT_EGID, "%ld"), > AUXFMT(AT_EXECPATH, "%s"), > AUXFMT(AT_CANARY, "%p"), > - AUXFMT(AT_CANARYLEN, "%u"), > - AUXFMT(AT_OSRELDATE, "%u"), > - AUXFMT(AT_NCPUS, "%u"), > + AUXFMT(AT_CANARYLEN, "%lu"), > + AUXFMT(AT_OSRELDATE, "%lu"), > + AUXFMT(AT_NCPUS, "%lu"), > AUXFMT(AT_PAGESIZES, "%p"), > - AUXFMT(AT_PAGESIZESLEN, "%u"), > + AUXFMT(AT_PAGESIZESLEN, "%lu"), > AUXFMT(AT_TIMEKEEP, "%p"), > - AUXFMT(AT_STACKPROT, "%#x"), > + AUXFMT(AT_STACKPROT, "%#lx"), > AUXFMT(AT_EHDRFLAGS, "%#lx"), > AUXFMT(AT_HWCAP, "%#lx"), > AUXFMT(AT_HWCAP2, "%#lx"), > AUXFMT(AT_BSDFLAGS, "%#lx"), > - AUXFMT(AT_ARGC, "%u"), > + AUXFMT(AT_ARGC, "%lu"), > AUXFMT(AT_ARGV, "%p"), > AUXFMT(AT_ENVC, "%p"), > AUXFMT(AT_ENVV, "%p"), > @@ -6105,6 +6105,15 @@ static const struct auxfmt { > AUXFMT(AT_FXRNG, "%p"), > }; >=20 > +static bool > +is_ptr_fmt(const char *fmt) > +{ > + char last; > + > + last =3D fmt[strlen(fmt) - 1]; > + return (last =3D=3D 'p' || last =3D=3D 's'); > +} > + > static void > dump_auxv(Elf_Auxinfo **aux_info) > { > @@ -6120,7 +6129,8 @@ dump_auxv(Elf_Auxinfo **aux_info) > if (fmt->fmt =3D=3D NULL) > continue; > rtld_fdprintf(STDOUT_FILENO, "%s:\t", fmt->name); > - rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, = auxp->a_un.a_ptr); > + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, = is_ptr_fmt(fmt->fmt) ? > + auxp->a_un.a_ptr : auxp->a_un.a_val); > rtld_fdprintf(STDOUT_FILENO, "\n"); > } > } That should indeed work, though I=E2=80=99d argue it=E2=80=99s still not = as nice as avoiding rtld_fdprintfx entirely. Jess From nobody Sat Nov 13 19:10:54 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E4FC11849E93 for ; Sat, 13 Nov 2021 19:11:03 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs4mk64FYz4j9Z for ; Sat, 13 Nov 2021 19:11:02 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f42.google.com with SMTP id d5so21826837wrc.1 for ; Sat, 13 Nov 2021 11:11:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ZLLyXLAFXNG2eqT30pQd/5EYmwQpHZ0NeeZBmxldANc=; b=iQg0AMClLp19SgfwouKWS7i2p71w1hv7Xzn+Fgc36lm68fmFFOEtI+BcvaxIlpPXM/ MrG5p75C7VpkUL/63HBjZnv8GxnoitmRq7PewfcZoHPbGZRsmPgglYlO+92UVZwmtBa3 dTz+bA1Mz4NrAh1zmhGylOF7+QvCrDIy8HXe3yCAYRV8LikoLl8mpBAmVFQVo4zkC53K 4QkMGQQ8ZnteXrI3pj4AEKAbnn0bkAjJVbIfnZPUwQM3QDfch0cZtUk8wxKHkOYbP8l/ KtbgGHFVmqM9JrpyD9XalAVIqOqt9khlRA9L8oPI0JeU0fEcTiHmbe068GZAHOeDn79G p1Kw== X-Gm-Message-State: AOAM5310L5iROolorICe5VQp023I4xbTW1+pN99XyOL9i7WMZm2saPaH Sbp6fJZ3/6qcEtYich5MnUHreQ== X-Google-Smtp-Source: ABdhPJzkjjWM56wyJsGNsC3DNsrq5/jp6NXctG04xTEcDeDVn4Jzv3x7yZKjbbK6tFmV/Bw85mrlMQ== X-Received: by 2002:adf:fe8b:: with SMTP id l11mr29982080wrr.228.1636830655671; Sat, 13 Nov 2021 11:10:55 -0800 (PST) Received: from smtpclient.apple (global-5-141.nat-2.net.cam.ac.uk. [131.111.5.141]) by smtp.gmail.com with ESMTPSA id o1sm9359346wrn.63.2021.11.13.11.10.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Nov 2021 11:10:55 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: 64ba1f4cf3a6 - main - rtld: Implement LD_SHOW_AUXV From: Jessica Clarke In-Reply-To: Date: Sat, 13 Nov 2021 19:10:54 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202111131733.1ADHXekX049248@gitrepo.freebsd.org> <37FC39AA-925D-4D75-8E0A-EA14E846E3A6@freebsd.org> <110784F6-3A7A-4F27-AAEB-E9B5A8F7CF0E@freebsd.org> <2450270B-CB98-43D0-B3BE-3C6D02F9B6FD@freebsd.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4Hs4mk64FYz4j9Z X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.221.42 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-2.50 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.42:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.42:from]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On 13 Nov 2021, at 19:09, Jessica Clarke wrote: >=20 > On 13 Nov 2021, at 19:06, Konstantin Belousov = wrote: >> On Sat, Nov 13, 2021 at 08:59:00PM +0200, Konstantin Belousov wrote: >>> On Sat, Nov 13, 2021 at 06:29:24PM +0000, Jessica Clarke wrote: >>>> On 13 Nov 2021, at 17:57, Jessica Clarke = wrote: >>>>>=20 >>>>> On 13 Nov 2021, at 17:54, Jessica Clarke = wrote: >>>>>>=20 >>>>>> On 13 Nov 2021, at 17:33, Konstantin Belousov = wrote: >>>>>>>=20 >>>>>>> The branch main has been updated by kib: >>>>>>>=20 >>>>>>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D64ba1f4cf3a6847a1dacf4bab0409d94= 898fa168 >>>>>>>=20 >>>>>>> commit 64ba1f4cf3a6847a1dacf4bab0409d94898fa168 >>>>>>> Author: Konstantin Belousov >>>>>>> AuthorDate: 2021-11-13 01:18:13 +0000 >>>>>>> Commit: Konstantin Belousov >>>>>>> CommitDate: 2021-11-13 17:33:13 +0000 >>>>>>>=20 >>>>>>> rtld: Implement LD_SHOW_AUXV >>>>>>>=20 >>>>>>> It dumps auxv as seen by interpreter, right before starting any = user >>>>>>> code. >>>>>>>=20 >>>>>>> Copied from: glibc >>>>>>> Sponsored by: The FreeBSD Foundation >>>>>>> MFC after: 1 week >>>>>>> --- >>>>>>> libexec/rtld-elf/rtld.1 | 7 +++++- >>>>>>> libexec/rtld-elf/rtld.c | 67 = +++++++++++++++++++++++++++++++++++++++++++++++++ >>>>>>> 2 files changed, 73 insertions(+), 1 deletion(-) >>>>>>>=20 >>>>>>> diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 >>>>>>> index 187dc105667a..66aa2bdabd17 100644 >>>>>>> --- a/libexec/rtld-elf/rtld.1 >>>>>>> +++ b/libexec/rtld-elf/rtld.1 >>>>>>> @@ -28,7 +28,7 @@ >>>>>>> .\" >>>>>>> .\" $FreeBSD$ >>>>>>> .\" >>>>>>> -.Dd August 15, 2021 >>>>>>> +.Dd November 13, 2021 >>>>>>> .Dt RTLD 1 >>>>>>> .Os >>>>>>> .Sh NAME >>>>>>> @@ -309,6 +309,11 @@ will process the filtee dependencies of the = loaded objects immediately, >>>>>>> instead of postponing it until required. >>>>>>> Normally, the filtees are opened at the time of the first symbol = resolution >>>>>>> from the filter object. >>>>>>> +.It Ev LD_SHOW_AUXV >>>>>>> +If set, causes >>>>>>> +.Nm >>>>>>> +to dump content of the aux vector to standard output, before = passing >>>>>>> +control to any user code. >>>>>>> .El >>>>>>> .Sh DIRECT EXECUTION MODE >>>>>>> .Nm >>>>>>> diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c >>>>>>> index c173c5a6e22e..0475134b0d96 100644 >>>>>>> --- a/libexec/rtld-elf/rtld.c >>>>>>> +++ b/libexec/rtld-elf/rtld.c >>>>>>> @@ -104,6 +104,7 @@ static Obj_Entry *dlopen_object(const char = *name, int fd, Obj_Entry *refobj, >>>>>>> static Obj_Entry *do_load_object(int, const char *, char *, = struct stat *, int); >>>>>>> static int do_search_info(const Obj_Entry *obj, int, struct = dl_serinfo *); >>>>>>> static bool donelist_check(DoneList *, const Obj_Entry *); >>>>>>> +static void dump_auxv(Elf_Auxinfo **aux_info); >>>>>>> static void errmsg_restore(struct dlerror_save *); >>>>>>> static struct dlerror_save *errmsg_save(void); >>>>>>> static void *fill_search_info(const char *, size_t, void *); >>>>>>> @@ -364,6 +365,7 @@ enum { >>>>>>> LD_TRACE_LOADED_OBJECTS_FMT1, >>>>>>> LD_TRACE_LOADED_OBJECTS_FMT2, >>>>>>> LD_TRACE_LOADED_OBJECTS_ALL, >>>>>>> + LD_SHOW_AUXV, >>>>>>> }; >>>>>>>=20 >>>>>>> struct ld_env_var_desc { >>>>>>> @@ -396,6 +398,7 @@ static struct ld_env_var_desc ld_env_vars[] = =3D { >>>>>>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT1, false), >>>>>>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT2, false), >>>>>>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_ALL, false), >>>>>>> + LD_ENV_DESC(SHOW_AUXV, false), >>>>>>> }; >>>>>>>=20 >>>>>>> static const char * >>>>>>> @@ -857,6 +860,9 @@ _rtld(Elf_Addr *sp, func_ptr_type = *exit_proc, Obj_Entry **objp) >>>>>>> if (rtld_verify_versions(&list_main) =3D=3D -1 && !ld_tracing) >>>>>>> rtld_die(); >>>>>>>=20 >>>>>>> + if (ld_get_env_var(LD_SHOW_AUXV) !=3D NULL) >>>>>>> + dump_auxv(aux_info); >>>>>>> + >>>>>>> if (ld_tracing) { /* We're done */ >>>>>>> trace_loaded_objects(obj_main); >>>>>>> exit(0); >>>>>>> @@ -6058,6 +6064,67 @@ print_usage(const char *argv0) >>>>>>> " Arguments to the executed process\n", = argv0); >>>>>>> } >>>>>>>=20 >>>>>>> +#define AUXFMT(at, xfmt) [at] =3D { .name =3D #at, .fmt = =3D xfmt } >>>>>>> +static const struct auxfmt { >>>>>>> + const char *name; >>>>>>> + const char *fmt; >>>>>>> +} auxfmts[] =3D { >>>>>>> + AUXFMT(AT_NULL, NULL), >>>>>>> + AUXFMT(AT_IGNORE, NULL), >>>>>>> + AUXFMT(AT_EXECFD, "%d"), >>>>>>> + AUXFMT(AT_PHDR, "%p"), >>>>>>> + AUXFMT(AT_PHENT, "%u"), >>>>>>> + AUXFMT(AT_PHNUM, "%u"), >>>>>>> + AUXFMT(AT_PAGESZ, "%u"), >>>>>>> + AUXFMT(AT_BASE, "%#lx"), >>>>>>> + AUXFMT(AT_FLAGS, "%#lx"), >>>>>>> + AUXFMT(AT_ENTRY, "%p"), >>>>>>> + AUXFMT(AT_NOTELF, NULL), >>>>>>> + AUXFMT(AT_UID, "%d"), >>>>>>> + AUXFMT(AT_EUID, "%d"), >>>>>>> + AUXFMT(AT_GID, "%d"), >>>>>>> + AUXFMT(AT_EGID, "%d"), >>>>>>> + AUXFMT(AT_EXECPATH, "%s"), >>>>>>> + AUXFMT(AT_CANARY, "%p"), >>>>>>> + AUXFMT(AT_CANARYLEN, "%u"), >>>>>>> + AUXFMT(AT_OSRELDATE, "%u"), >>>>>>> + AUXFMT(AT_NCPUS, "%u"), >>>>>>> + AUXFMT(AT_PAGESIZES, "%p"), >>>>>>> + AUXFMT(AT_PAGESIZESLEN, "%u"), >>>>>>> + AUXFMT(AT_TIMEKEEP, "%p"), >>>>>>> + AUXFMT(AT_STACKPROT, "%#x"), >>>>>>> + AUXFMT(AT_EHDRFLAGS, "%#lx"), >>>>>>> + AUXFMT(AT_HWCAP, "%#lx"), >>>>>>> + AUXFMT(AT_HWCAP2, "%#lx"), >>>>>>> + AUXFMT(AT_BSDFLAGS, "%#lx"), >>>>>>> + AUXFMT(AT_ARGC, "%u"), >>>>>>> + AUXFMT(AT_ARGV, "%p"), >>>>>>> + AUXFMT(AT_ENVC, "%p"), >>>>>>> + AUXFMT(AT_ENVV, "%p"), >>>>>>> + AUXFMT(AT_PS_STRINGS, "%p"), >>>>>>> + AUXFMT(AT_FXRNG, "%p"), >>>>>>> +}; >>>>>>> + >>>>>>> +static void >>>>>>> +dump_auxv(Elf_Auxinfo **aux_info) >>>>>>> +{ >>>>>>> + Elf_Auxinfo *auxp; >>>>>>> + const struct auxfmt *fmt; >>>>>>> + int i; >>>>>>> + >>>>>>> + for (i =3D 0; i < AT_COUNT; i++) { >>>>>>> + auxp =3D aux_info[i]; >>>>>>> + if (auxp =3D=3D NULL) >>>>>>> + continue; >>>>>>> + fmt =3D &auxfmts[i]; >>>>>>> + if (fmt->fmt =3D=3D NULL) >>>>>>> + continue; >>>>>>> + rtld_fdprintf(STDOUT_FILENO, "%s:\t", = fmt->name); >>>>>>> + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, = auxp->a_un.a_ptr); >>>>>>> + rtld_fdprintf(STDOUT_FILENO, "\n"); >>>>>>=20 >>>>>> This is undefined behaviour, breaks CHERI, and totally = unnecessary. You >>>>>> have a handful of cases here, just make an enum and have separate >>>>>> rtld_fdprintf calls. >>>>=20 >>>> In particular, ignoring CHERI, unsigned ints are sign-extended to = 64 >>>> bits on MIPS and RISC-V. Thus by passing a 64-bit value but using a = %u, >>>> you are violating the calling convention. I can=E2=80=99t currently = get GCC or >>>> Clang to exploit the fact that varargs arguments are sign-extended, = but >>>> on MIPS, and RISC-V GCC (Clang is currently stupid and round-trips = via >>>> memory even when the va_arg calls have no branching surrounding = them, >>>> rather than just grabbing from the register) there is a redundant >>>> sext.w that can legally be optimised out, but would be broken by = this >>>> calling convention violation. >>> I might understand the argument that all non-pointer formats for = auxv >>> should be longs, i.e. %lu/%ld/%lx, but this is the only problem I = see >>> there. We do rely on having specific representations for addresses = and >>> longs, and a low-level component as rtld has full rights to exercise >>> this fact, same as VM subsystem or memory allocators. >>>=20 >>> In fact ELF spec exercises this as well. >>> Our arches are either ILP32 or LP64. >>>=20 >>>>=20 >>>> Then CHERI makes it worse because a_ptr and a_val do not have the = same >>>> representation, although in practice I think passing a_ptr and = nothing >>>> further does end up working on CHERI-RISC-V and Morello, just not >>>> CHERI-MIPS due to being big-endian. >>=20 >> Ok, the following should be enough for CHERI, right? >>=20 >> diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c >> index 0475134b0d96..cf467ae7aacd 100644 >> --- a/libexec/rtld-elf/rtld.c >> +++ b/libexec/rtld-elf/rtld.c >> @@ -6071,33 +6071,33 @@ static const struct auxfmt { >> } auxfmts[] =3D { >> AUXFMT(AT_NULL, NULL), >> AUXFMT(AT_IGNORE, NULL), >> - AUXFMT(AT_EXECFD, "%d"), >> + AUXFMT(AT_EXECFD, "%ld"), >> AUXFMT(AT_PHDR, "%p"), >> - AUXFMT(AT_PHENT, "%u"), >> - AUXFMT(AT_PHNUM, "%u"), >> - AUXFMT(AT_PAGESZ, "%u"), >> + AUXFMT(AT_PHENT, "%lu"), >> + AUXFMT(AT_PHNUM, "%lu"), >> + AUXFMT(AT_PAGESZ, "%lu"), >> AUXFMT(AT_BASE, "%#lx"), >> AUXFMT(AT_FLAGS, "%#lx"), >> AUXFMT(AT_ENTRY, "%p"), >> AUXFMT(AT_NOTELF, NULL), >> - AUXFMT(AT_UID, "%d"), >> - AUXFMT(AT_EUID, "%d"), >> - AUXFMT(AT_GID, "%d"), >> - AUXFMT(AT_EGID, "%d"), >> + AUXFMT(AT_UID, "%ld"), >> + AUXFMT(AT_EUID, "%ld"), >> + AUXFMT(AT_GID, "%ld"), >> + AUXFMT(AT_EGID, "%ld"), >> AUXFMT(AT_EXECPATH, "%s"), >> AUXFMT(AT_CANARY, "%p"), >> - AUXFMT(AT_CANARYLEN, "%u"), >> - AUXFMT(AT_OSRELDATE, "%u"), >> - AUXFMT(AT_NCPUS, "%u"), >> + AUXFMT(AT_CANARYLEN, "%lu"), >> + AUXFMT(AT_OSRELDATE, "%lu"), >> + AUXFMT(AT_NCPUS, "%lu"), >> AUXFMT(AT_PAGESIZES, "%p"), >> - AUXFMT(AT_PAGESIZESLEN, "%u"), >> + AUXFMT(AT_PAGESIZESLEN, "%lu"), >> AUXFMT(AT_TIMEKEEP, "%p"), >> - AUXFMT(AT_STACKPROT, "%#x"), >> + AUXFMT(AT_STACKPROT, "%#lx"), >> AUXFMT(AT_EHDRFLAGS, "%#lx"), >> AUXFMT(AT_HWCAP, "%#lx"), >> AUXFMT(AT_HWCAP2, "%#lx"), >> AUXFMT(AT_BSDFLAGS, "%#lx"), >> - AUXFMT(AT_ARGC, "%u"), >> + AUXFMT(AT_ARGC, "%lu"), >> AUXFMT(AT_ARGV, "%p"), >> AUXFMT(AT_ENVC, "%p"), >> AUXFMT(AT_ENVV, "%p"), >> @@ -6105,6 +6105,15 @@ static const struct auxfmt { >> AUXFMT(AT_FXRNG, "%p"), >> }; >>=20 >> +static bool >> +is_ptr_fmt(const char *fmt) >> +{ >> + char last; >> + >> + last =3D fmt[strlen(fmt) - 1]; >> + return (last =3D=3D 'p' || last =3D=3D 's'); >> +} >> + >> static void >> dump_auxv(Elf_Auxinfo **aux_info) >> { >> @@ -6120,7 +6129,8 @@ dump_auxv(Elf_Auxinfo **aux_info) >> if (fmt->fmt =3D=3D NULL) >> continue; >> rtld_fdprintf(STDOUT_FILENO, "%s:\t", fmt->name); >> - rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, = auxp->a_un.a_ptr); >> + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, = is_ptr_fmt(fmt->fmt) ? >> + auxp->a_un.a_ptr : auxp->a_un.a_val); >> rtld_fdprintf(STDOUT_FILENO, "\n"); >> } >> } >=20 > That should indeed work, though I=E2=80=99d argue it=E2=80=99s still = not as nice as > avoiding rtld_fdprintfx entirely. Wait, no, it doesn=E2=80=99t, the ternary means both operands need to = have the same type, so you end up implicitly casting the long to a pointer. You need a real if and two different rtld_fdprintfx calls (or just do it as I=E2=80=99ve suggested). Jess From nobody Sat Nov 13 19:39:35 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0EEDC1859B1B; Sat, 13 Nov 2021 19:39:45 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs5Pr3jrFz4tHX; Sat, 13 Nov 2021 19:39:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 1ADJdZCw079958 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 13 Nov 2021 21:39:38 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 1ADJdZCw079958 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 1ADJdZu9079957; Sat, 13 Nov 2021 21:39:35 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 13 Nov 2021 21:39:35 +0200 From: Konstantin Belousov To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 64ba1f4cf3a6 - main - rtld: Implement LD_SHOW_AUXV Message-ID: References: <202111131733.1ADHXekX049248@gitrepo.freebsd.org> <37FC39AA-925D-4D75-8E0A-EA14E846E3A6@freebsd.org> <110784F6-3A7A-4F27-AAEB-E9B5A8F7CF0E@freebsd.org> <2450270B-CB98-43D0-B3BE-3C6D02F9B6FD@freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4Hs5Pr3jrFz4tHX X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Sat, Nov 13, 2021 at 07:10:54PM +0000, Jessica Clarke wrote: > On 13 Nov 2021, at 19:09, Jessica Clarke wrote: > > > > On 13 Nov 2021, at 19:06, Konstantin Belousov wrote: > >> On Sat, Nov 13, 2021 at 08:59:00PM +0200, Konstantin Belousov wrote: > >>> On Sat, Nov 13, 2021 at 06:29:24PM +0000, Jessica Clarke wrote: > >>>> On 13 Nov 2021, at 17:57, Jessica Clarke wrote: > >>>>> > >>>>> On 13 Nov 2021, at 17:54, Jessica Clarke wrote: > >>>>>> > >>>>>> On 13 Nov 2021, at 17:33, Konstantin Belousov wrote: > >>>>>>> > >>>>>>> The branch main has been updated by kib: > >>>>>>> > >>>>>>> URL: https://cgit.FreeBSD.org/src/commit/?id=64ba1f4cf3a6847a1dacf4bab0409d94898fa168 > >>>>>>> > >>>>>>> commit 64ba1f4cf3a6847a1dacf4bab0409d94898fa168 > >>>>>>> Author: Konstantin Belousov > >>>>>>> AuthorDate: 2021-11-13 01:18:13 +0000 > >>>>>>> Commit: Konstantin Belousov > >>>>>>> CommitDate: 2021-11-13 17:33:13 +0000 > >>>>>>> > >>>>>>> rtld: Implement LD_SHOW_AUXV > >>>>>>> > >>>>>>> It dumps auxv as seen by interpreter, right before starting any user > >>>>>>> code. > >>>>>>> > >>>>>>> Copied from: glibc > >>>>>>> Sponsored by: The FreeBSD Foundation > >>>>>>> MFC after: 1 week > >>>>>>> --- > >>>>>>> libexec/rtld-elf/rtld.1 | 7 +++++- > >>>>>>> libexec/rtld-elf/rtld.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++++ > >>>>>>> 2 files changed, 73 insertions(+), 1 deletion(-) > >>>>>>> > >>>>>>> diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 > >>>>>>> index 187dc105667a..66aa2bdabd17 100644 > >>>>>>> --- a/libexec/rtld-elf/rtld.1 > >>>>>>> +++ b/libexec/rtld-elf/rtld.1 > >>>>>>> @@ -28,7 +28,7 @@ > >>>>>>> .\" > >>>>>>> .\" $FreeBSD$ > >>>>>>> .\" > >>>>>>> -.Dd August 15, 2021 > >>>>>>> +.Dd November 13, 2021 > >>>>>>> .Dt RTLD 1 > >>>>>>> .Os > >>>>>>> .Sh NAME > >>>>>>> @@ -309,6 +309,11 @@ will process the filtee dependencies of the loaded objects immediately, > >>>>>>> instead of postponing it until required. > >>>>>>> Normally, the filtees are opened at the time of the first symbol resolution > >>>>>>> from the filter object. > >>>>>>> +.It Ev LD_SHOW_AUXV > >>>>>>> +If set, causes > >>>>>>> +.Nm > >>>>>>> +to dump content of the aux vector to standard output, before passing > >>>>>>> +control to any user code. > >>>>>>> .El > >>>>>>> .Sh DIRECT EXECUTION MODE > >>>>>>> .Nm > >>>>>>> diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c > >>>>>>> index c173c5a6e22e..0475134b0d96 100644 > >>>>>>> --- a/libexec/rtld-elf/rtld.c > >>>>>>> +++ b/libexec/rtld-elf/rtld.c > >>>>>>> @@ -104,6 +104,7 @@ static Obj_Entry *dlopen_object(const char *name, int fd, Obj_Entry *refobj, > >>>>>>> static Obj_Entry *do_load_object(int, const char *, char *, struct stat *, int); > >>>>>>> static int do_search_info(const Obj_Entry *obj, int, struct dl_serinfo *); > >>>>>>> static bool donelist_check(DoneList *, const Obj_Entry *); > >>>>>>> +static void dump_auxv(Elf_Auxinfo **aux_info); > >>>>>>> static void errmsg_restore(struct dlerror_save *); > >>>>>>> static struct dlerror_save *errmsg_save(void); > >>>>>>> static void *fill_search_info(const char *, size_t, void *); > >>>>>>> @@ -364,6 +365,7 @@ enum { > >>>>>>> LD_TRACE_LOADED_OBJECTS_FMT1, > >>>>>>> LD_TRACE_LOADED_OBJECTS_FMT2, > >>>>>>> LD_TRACE_LOADED_OBJECTS_ALL, > >>>>>>> + LD_SHOW_AUXV, > >>>>>>> }; > >>>>>>> > >>>>>>> struct ld_env_var_desc { > >>>>>>> @@ -396,6 +398,7 @@ static struct ld_env_var_desc ld_env_vars[] = { > >>>>>>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT1, false), > >>>>>>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT2, false), > >>>>>>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_ALL, false), > >>>>>>> + LD_ENV_DESC(SHOW_AUXV, false), > >>>>>>> }; > >>>>>>> > >>>>>>> static const char * > >>>>>>> @@ -857,6 +860,9 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp) > >>>>>>> if (rtld_verify_versions(&list_main) == -1 && !ld_tracing) > >>>>>>> rtld_die(); > >>>>>>> > >>>>>>> + if (ld_get_env_var(LD_SHOW_AUXV) != NULL) > >>>>>>> + dump_auxv(aux_info); > >>>>>>> + > >>>>>>> if (ld_tracing) { /* We're done */ > >>>>>>> trace_loaded_objects(obj_main); > >>>>>>> exit(0); > >>>>>>> @@ -6058,6 +6064,67 @@ print_usage(const char *argv0) > >>>>>>> " Arguments to the executed process\n", argv0); > >>>>>>> } > >>>>>>> > >>>>>>> +#define AUXFMT(at, xfmt) [at] = { .name = #at, .fmt = xfmt } > >>>>>>> +static const struct auxfmt { > >>>>>>> + const char *name; > >>>>>>> + const char *fmt; > >>>>>>> +} auxfmts[] = { > >>>>>>> + AUXFMT(AT_NULL, NULL), > >>>>>>> + AUXFMT(AT_IGNORE, NULL), > >>>>>>> + AUXFMT(AT_EXECFD, "%d"), > >>>>>>> + AUXFMT(AT_PHDR, "%p"), > >>>>>>> + AUXFMT(AT_PHENT, "%u"), > >>>>>>> + AUXFMT(AT_PHNUM, "%u"), > >>>>>>> + AUXFMT(AT_PAGESZ, "%u"), > >>>>>>> + AUXFMT(AT_BASE, "%#lx"), > >>>>>>> + AUXFMT(AT_FLAGS, "%#lx"), > >>>>>>> + AUXFMT(AT_ENTRY, "%p"), > >>>>>>> + AUXFMT(AT_NOTELF, NULL), > >>>>>>> + AUXFMT(AT_UID, "%d"), > >>>>>>> + AUXFMT(AT_EUID, "%d"), > >>>>>>> + AUXFMT(AT_GID, "%d"), > >>>>>>> + AUXFMT(AT_EGID, "%d"), > >>>>>>> + AUXFMT(AT_EXECPATH, "%s"), > >>>>>>> + AUXFMT(AT_CANARY, "%p"), > >>>>>>> + AUXFMT(AT_CANARYLEN, "%u"), > >>>>>>> + AUXFMT(AT_OSRELDATE, "%u"), > >>>>>>> + AUXFMT(AT_NCPUS, "%u"), > >>>>>>> + AUXFMT(AT_PAGESIZES, "%p"), > >>>>>>> + AUXFMT(AT_PAGESIZESLEN, "%u"), > >>>>>>> + AUXFMT(AT_TIMEKEEP, "%p"), > >>>>>>> + AUXFMT(AT_STACKPROT, "%#x"), > >>>>>>> + AUXFMT(AT_EHDRFLAGS, "%#lx"), > >>>>>>> + AUXFMT(AT_HWCAP, "%#lx"), > >>>>>>> + AUXFMT(AT_HWCAP2, "%#lx"), > >>>>>>> + AUXFMT(AT_BSDFLAGS, "%#lx"), > >>>>>>> + AUXFMT(AT_ARGC, "%u"), > >>>>>>> + AUXFMT(AT_ARGV, "%p"), > >>>>>>> + AUXFMT(AT_ENVC, "%p"), > >>>>>>> + AUXFMT(AT_ENVV, "%p"), > >>>>>>> + AUXFMT(AT_PS_STRINGS, "%p"), > >>>>>>> + AUXFMT(AT_FXRNG, "%p"), > >>>>>>> +}; > >>>>>>> + > >>>>>>> +static void > >>>>>>> +dump_auxv(Elf_Auxinfo **aux_info) > >>>>>>> +{ > >>>>>>> + Elf_Auxinfo *auxp; > >>>>>>> + const struct auxfmt *fmt; > >>>>>>> + int i; > >>>>>>> + > >>>>>>> + for (i = 0; i < AT_COUNT; i++) { > >>>>>>> + auxp = aux_info[i]; > >>>>>>> + if (auxp == NULL) > >>>>>>> + continue; > >>>>>>> + fmt = &auxfmts[i]; > >>>>>>> + if (fmt->fmt == NULL) > >>>>>>> + continue; > >>>>>>> + rtld_fdprintf(STDOUT_FILENO, "%s:\t", fmt->name); > >>>>>>> + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, auxp->a_un.a_ptr); > >>>>>>> + rtld_fdprintf(STDOUT_FILENO, "\n"); > >>>>>> > >>>>>> This is undefined behaviour, breaks CHERI, and totally unnecessary. You > >>>>>> have a handful of cases here, just make an enum and have separate > >>>>>> rtld_fdprintf calls. > >>>> > >>>> In particular, ignoring CHERI, unsigned ints are sign-extended to 64 > >>>> bits on MIPS and RISC-V. Thus by passing a 64-bit value but using a %u, > >>>> you are violating the calling convention. I can’t currently get GCC or > >>>> Clang to exploit the fact that varargs arguments are sign-extended, but > >>>> on MIPS, and RISC-V GCC (Clang is currently stupid and round-trips via > >>>> memory even when the va_arg calls have no branching surrounding them, > >>>> rather than just grabbing from the register) there is a redundant > >>>> sext.w that can legally be optimised out, but would be broken by this > >>>> calling convention violation. > >>> I might understand the argument that all non-pointer formats for auxv > >>> should be longs, i.e. %lu/%ld/%lx, but this is the only problem I see > >>> there. We do rely on having specific representations for addresses and > >>> longs, and a low-level component as rtld has full rights to exercise > >>> this fact, same as VM subsystem or memory allocators. > >>> > >>> In fact ELF spec exercises this as well. > >>> Our arches are either ILP32 or LP64. > >>> > >>>> > >>>> Then CHERI makes it worse because a_ptr and a_val do not have the same > >>>> representation, although in practice I think passing a_ptr and nothing > >>>> further does end up working on CHERI-RISC-V and Morello, just not > >>>> CHERI-MIPS due to being big-endian. > >> > >> Ok, the following should be enough for CHERI, right? > >> > >> diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c > >> index 0475134b0d96..cf467ae7aacd 100644 > >> --- a/libexec/rtld-elf/rtld.c > >> +++ b/libexec/rtld-elf/rtld.c > >> @@ -6071,33 +6071,33 @@ static const struct auxfmt { > >> } auxfmts[] = { > >> AUXFMT(AT_NULL, NULL), > >> AUXFMT(AT_IGNORE, NULL), > >> - AUXFMT(AT_EXECFD, "%d"), > >> + AUXFMT(AT_EXECFD, "%ld"), > >> AUXFMT(AT_PHDR, "%p"), > >> - AUXFMT(AT_PHENT, "%u"), > >> - AUXFMT(AT_PHNUM, "%u"), > >> - AUXFMT(AT_PAGESZ, "%u"), > >> + AUXFMT(AT_PHENT, "%lu"), > >> + AUXFMT(AT_PHNUM, "%lu"), > >> + AUXFMT(AT_PAGESZ, "%lu"), > >> AUXFMT(AT_BASE, "%#lx"), > >> AUXFMT(AT_FLAGS, "%#lx"), > >> AUXFMT(AT_ENTRY, "%p"), > >> AUXFMT(AT_NOTELF, NULL), > >> - AUXFMT(AT_UID, "%d"), > >> - AUXFMT(AT_EUID, "%d"), > >> - AUXFMT(AT_GID, "%d"), > >> - AUXFMT(AT_EGID, "%d"), > >> + AUXFMT(AT_UID, "%ld"), > >> + AUXFMT(AT_EUID, "%ld"), > >> + AUXFMT(AT_GID, "%ld"), > >> + AUXFMT(AT_EGID, "%ld"), > >> AUXFMT(AT_EXECPATH, "%s"), > >> AUXFMT(AT_CANARY, "%p"), > >> - AUXFMT(AT_CANARYLEN, "%u"), > >> - AUXFMT(AT_OSRELDATE, "%u"), > >> - AUXFMT(AT_NCPUS, "%u"), > >> + AUXFMT(AT_CANARYLEN, "%lu"), > >> + AUXFMT(AT_OSRELDATE, "%lu"), > >> + AUXFMT(AT_NCPUS, "%lu"), > >> AUXFMT(AT_PAGESIZES, "%p"), > >> - AUXFMT(AT_PAGESIZESLEN, "%u"), > >> + AUXFMT(AT_PAGESIZESLEN, "%lu"), > >> AUXFMT(AT_TIMEKEEP, "%p"), > >> - AUXFMT(AT_STACKPROT, "%#x"), > >> + AUXFMT(AT_STACKPROT, "%#lx"), > >> AUXFMT(AT_EHDRFLAGS, "%#lx"), > >> AUXFMT(AT_HWCAP, "%#lx"), > >> AUXFMT(AT_HWCAP2, "%#lx"), > >> AUXFMT(AT_BSDFLAGS, "%#lx"), > >> - AUXFMT(AT_ARGC, "%u"), > >> + AUXFMT(AT_ARGC, "%lu"), > >> AUXFMT(AT_ARGV, "%p"), > >> AUXFMT(AT_ENVC, "%p"), > >> AUXFMT(AT_ENVV, "%p"), > >> @@ -6105,6 +6105,15 @@ static const struct auxfmt { > >> AUXFMT(AT_FXRNG, "%p"), > >> }; > >> > >> +static bool > >> +is_ptr_fmt(const char *fmt) > >> +{ > >> + char last; > >> + > >> + last = fmt[strlen(fmt) - 1]; > >> + return (last == 'p' || last == 's'); > >> +} > >> + > >> static void > >> dump_auxv(Elf_Auxinfo **aux_info) > >> { > >> @@ -6120,7 +6129,8 @@ dump_auxv(Elf_Auxinfo **aux_info) > >> if (fmt->fmt == NULL) > >> continue; > >> rtld_fdprintf(STDOUT_FILENO, "%s:\t", fmt->name); > >> - rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, auxp->a_un.a_ptr); > >> + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, is_ptr_fmt(fmt->fmt) ? > >> + auxp->a_un.a_ptr : auxp->a_un.a_val); > >> rtld_fdprintf(STDOUT_FILENO, "\n"); > >> } > >> } > > > > That should indeed work, though I’d argue it’s still not as nice as > > avoiding rtld_fdprintfx entirely. > > Wait, no, it doesn’t, the ternary means both operands need to have the > same type, so you end up implicitly casting the long to a pointer. You > need a real if and two different rtld_fdprintfx calls (or just do it as > I’ve suggested). Ok, real if() then. diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 0475134b0d96..d5c3d2893582 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -6071,33 +6071,33 @@ static const struct auxfmt { } auxfmts[] = { AUXFMT(AT_NULL, NULL), AUXFMT(AT_IGNORE, NULL), - AUXFMT(AT_EXECFD, "%d"), + AUXFMT(AT_EXECFD, "%ld"), AUXFMT(AT_PHDR, "%p"), - AUXFMT(AT_PHENT, "%u"), - AUXFMT(AT_PHNUM, "%u"), - AUXFMT(AT_PAGESZ, "%u"), + AUXFMT(AT_PHENT, "%lu"), + AUXFMT(AT_PHNUM, "%lu"), + AUXFMT(AT_PAGESZ, "%lu"), AUXFMT(AT_BASE, "%#lx"), AUXFMT(AT_FLAGS, "%#lx"), AUXFMT(AT_ENTRY, "%p"), AUXFMT(AT_NOTELF, NULL), - AUXFMT(AT_UID, "%d"), - AUXFMT(AT_EUID, "%d"), - AUXFMT(AT_GID, "%d"), - AUXFMT(AT_EGID, "%d"), + AUXFMT(AT_UID, "%ld"), + AUXFMT(AT_EUID, "%ld"), + AUXFMT(AT_GID, "%ld"), + AUXFMT(AT_EGID, "%ld"), AUXFMT(AT_EXECPATH, "%s"), AUXFMT(AT_CANARY, "%p"), - AUXFMT(AT_CANARYLEN, "%u"), - AUXFMT(AT_OSRELDATE, "%u"), - AUXFMT(AT_NCPUS, "%u"), + AUXFMT(AT_CANARYLEN, "%lu"), + AUXFMT(AT_OSRELDATE, "%lu"), + AUXFMT(AT_NCPUS, "%lu"), AUXFMT(AT_PAGESIZES, "%p"), - AUXFMT(AT_PAGESIZESLEN, "%u"), + AUXFMT(AT_PAGESIZESLEN, "%lu"), AUXFMT(AT_TIMEKEEP, "%p"), - AUXFMT(AT_STACKPROT, "%#x"), + AUXFMT(AT_STACKPROT, "%#lx"), AUXFMT(AT_EHDRFLAGS, "%#lx"), AUXFMT(AT_HWCAP, "%#lx"), AUXFMT(AT_HWCAP2, "%#lx"), AUXFMT(AT_BSDFLAGS, "%#lx"), - AUXFMT(AT_ARGC, "%u"), + AUXFMT(AT_ARGC, "%lu"), AUXFMT(AT_ARGV, "%p"), AUXFMT(AT_ENVC, "%p"), AUXFMT(AT_ENVV, "%p"), @@ -6105,6 +6105,15 @@ static const struct auxfmt { AUXFMT(AT_FXRNG, "%p"), }; +static bool +is_ptr_fmt(const char *fmt) +{ + char last; + + last = fmt[strlen(fmt) - 1]; + return (last == 'p' || last == 's'); +} + static void dump_auxv(Elf_Auxinfo **aux_info) { @@ -6120,7 +6129,13 @@ dump_auxv(Elf_Auxinfo **aux_info) if (fmt->fmt == NULL) continue; rtld_fdprintf(STDOUT_FILENO, "%s:\t", fmt->name); - rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, auxp->a_un.a_ptr); + if (is_ptr_fmt(fmt->fmt)) { + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, + auxp->a_un.a_ptr); + } else { + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, + auxp->a_un.a_val); + } rtld_fdprintf(STDOUT_FILENO, "\n"); } } From nobody Sat Nov 13 19:56:10 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 161E9186019A for ; Sat, 13 Nov 2021 19:56:19 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs5my6mMGz3F2F for ; Sat, 13 Nov 2021 19:56:18 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f52.google.com with SMTP id 133so10543071wme.0 for ; Sat, 13 Nov 2021 11:56:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=nQsiuNW0fWNvNt41saZm7IfjqY0D25KP6LA6ujVct1o=; b=mZdkkJazAT8/gHAjXIqBXBuam/O0atFxq5Qdmh+jW8bdIY6Gln+L5QffHSmbLzZRjr N2Hy6rtWnNJ7kjgeAnTJX2krC0A42MeBjdVPMNCXgwBX9up+Bu+xZfR9h4uHHERFE64X ZP7ANYNIAmOBR0/dGrU3NyEn8bCdYD5J0WyuYcKaFVOouBqMVxpr+VqRjLULxGfrt14S wxk//rXACc+wlRlkyhgJMaTHI0c9PryfvuaZ6Rq64UP81lWPtM1d6gBiWCM6OwTW+7NU 6E1SQUHkublTo84zTVXkiILdTLvGP0uR2b8GkQPyxY3Hn+vwwZDxVCw5HPhABIKRIHCj HhTg== X-Gm-Message-State: AOAM530oxNUHdFVggfiGumZYeEvF7yGYaVfaZplrO4Nds9tLkHAWcFJ8 89GlG7I/FIGeg89boLjnuyeXOogA3kmpzA== X-Google-Smtp-Source: ABdhPJx2xJI4O1G2A4ZVRqCnyUB0FUGsh/ARbh4AMlSm4Mu9JBmstr1ioL85CoHHA2iXjXyhUbHzig== X-Received: by 2002:a05:600c:354f:: with SMTP id i15mr28147938wmq.59.1636833371641; Sat, 13 Nov 2021 11:56:11 -0800 (PST) Received: from smtpclient.apple (global-5-141.nat-2.net.cam.ac.uk. [131.111.5.141]) by smtp.gmail.com with ESMTPSA id t8sm9164651wrv.30.2021.11.13.11.56.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Nov 2021 11:56:11 -0800 (PST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: 64ba1f4cf3a6 - main - rtld: Implement LD_SHOW_AUXV From: Jessica Clarke In-Reply-To: Date: Sat, 13 Nov 2021 19:56:10 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <4F551701-6DFD-471F-8F35-D29B2E80BACE@freebsd.org> References: <202111131733.1ADHXekX049248@gitrepo.freebsd.org> <37FC39AA-925D-4D75-8E0A-EA14E846E3A6@freebsd.org> <110784F6-3A7A-4F27-AAEB-E9B5A8F7CF0E@freebsd.org> <2450270B-CB98-43D0-B3BE-3C6D02F9B6FD@freebsd.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4Hs5my6mMGz3F2F X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 13 Nov 2021, at 19:39, Konstantin Belousov = wrote: > On Sat, Nov 13, 2021 at 07:10:54PM +0000, Jessica Clarke wrote: >> On 13 Nov 2021, at 19:09, Jessica Clarke wrote: >>>=20 >>> On 13 Nov 2021, at 19:06, Konstantin Belousov = wrote: >>>> On Sat, Nov 13, 2021 at 08:59:00PM +0200, Konstantin Belousov = wrote: >>>>> On Sat, Nov 13, 2021 at 06:29:24PM +0000, Jessica Clarke wrote: >>>>>> On 13 Nov 2021, at 17:57, Jessica Clarke = wrote: >>>>>>>=20 >>>>>>> On 13 Nov 2021, at 17:54, Jessica Clarke = wrote: >>>>>>>>=20 >>>>>>>> On 13 Nov 2021, at 17:33, Konstantin Belousov = wrote: >>>>>>>>>=20 >>>>>>>>> The branch main has been updated by kib: >>>>>>>>>=20 >>>>>>>>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D64ba1f4cf3a6847a1dacf4bab0409d94= 898fa168 >>>>>>>>>=20 >>>>>>>>> commit 64ba1f4cf3a6847a1dacf4bab0409d94898fa168 >>>>>>>>> Author: Konstantin Belousov >>>>>>>>> AuthorDate: 2021-11-13 01:18:13 +0000 >>>>>>>>> Commit: Konstantin Belousov >>>>>>>>> CommitDate: 2021-11-13 17:33:13 +0000 >>>>>>>>>=20 >>>>>>>>> rtld: Implement LD_SHOW_AUXV >>>>>>>>>=20 >>>>>>>>> It dumps auxv as seen by interpreter, right before starting = any user >>>>>>>>> code. >>>>>>>>>=20 >>>>>>>>> Copied from: glibc >>>>>>>>> Sponsored by: The FreeBSD Foundation >>>>>>>>> MFC after: 1 week >>>>>>>>> --- >>>>>>>>> libexec/rtld-elf/rtld.1 | 7 +++++- >>>>>>>>> libexec/rtld-elf/rtld.c | 67 = +++++++++++++++++++++++++++++++++++++++++++++++++ >>>>>>>>> 2 files changed, 73 insertions(+), 1 deletion(-) >>>>>>>>>=20 >>>>>>>>> diff --git a/libexec/rtld-elf/rtld.1 b/libexec/rtld-elf/rtld.1 >>>>>>>>> index 187dc105667a..66aa2bdabd17 100644 >>>>>>>>> --- a/libexec/rtld-elf/rtld.1 >>>>>>>>> +++ b/libexec/rtld-elf/rtld.1 >>>>>>>>> @@ -28,7 +28,7 @@ >>>>>>>>> .\" >>>>>>>>> .\" $FreeBSD$ >>>>>>>>> .\" >>>>>>>>> -.Dd August 15, 2021 >>>>>>>>> +.Dd November 13, 2021 >>>>>>>>> .Dt RTLD 1 >>>>>>>>> .Os >>>>>>>>> .Sh NAME >>>>>>>>> @@ -309,6 +309,11 @@ will process the filtee dependencies of = the loaded objects immediately, >>>>>>>>> instead of postponing it until required. >>>>>>>>> Normally, the filtees are opened at the time of the first = symbol resolution >>>>>>>>> from the filter object. >>>>>>>>> +.It Ev LD_SHOW_AUXV >>>>>>>>> +If set, causes >>>>>>>>> +.Nm >>>>>>>>> +to dump content of the aux vector to standard output, before = passing >>>>>>>>> +control to any user code. >>>>>>>>> .El >>>>>>>>> .Sh DIRECT EXECUTION MODE >>>>>>>>> .Nm >>>>>>>>> diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c >>>>>>>>> index c173c5a6e22e..0475134b0d96 100644 >>>>>>>>> --- a/libexec/rtld-elf/rtld.c >>>>>>>>> +++ b/libexec/rtld-elf/rtld.c >>>>>>>>> @@ -104,6 +104,7 @@ static Obj_Entry *dlopen_object(const char = *name, int fd, Obj_Entry *refobj, >>>>>>>>> static Obj_Entry *do_load_object(int, const char *, char *, = struct stat *, int); >>>>>>>>> static int do_search_info(const Obj_Entry *obj, int, struct = dl_serinfo *); >>>>>>>>> static bool donelist_check(DoneList *, const Obj_Entry *); >>>>>>>>> +static void dump_auxv(Elf_Auxinfo **aux_info); >>>>>>>>> static void errmsg_restore(struct dlerror_save *); >>>>>>>>> static struct dlerror_save *errmsg_save(void); >>>>>>>>> static void *fill_search_info(const char *, size_t, void *); >>>>>>>>> @@ -364,6 +365,7 @@ enum { >>>>>>>>> LD_TRACE_LOADED_OBJECTS_FMT1, >>>>>>>>> LD_TRACE_LOADED_OBJECTS_FMT2, >>>>>>>>> LD_TRACE_LOADED_OBJECTS_ALL, >>>>>>>>> + LD_SHOW_AUXV, >>>>>>>>> }; >>>>>>>>>=20 >>>>>>>>> struct ld_env_var_desc { >>>>>>>>> @@ -396,6 +398,7 @@ static struct ld_env_var_desc = ld_env_vars[] =3D { >>>>>>>>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT1, false), >>>>>>>>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_FMT2, false), >>>>>>>>> LD_ENV_DESC(TRACE_LOADED_OBJECTS_ALL, false), >>>>>>>>> + LD_ENV_DESC(SHOW_AUXV, false), >>>>>>>>> }; >>>>>>>>>=20 >>>>>>>>> static const char * >>>>>>>>> @@ -857,6 +860,9 @@ _rtld(Elf_Addr *sp, func_ptr_type = *exit_proc, Obj_Entry **objp) >>>>>>>>> if (rtld_verify_versions(&list_main) =3D=3D -1 && !ld_tracing) >>>>>>>>> rtld_die(); >>>>>>>>>=20 >>>>>>>>> + if (ld_get_env_var(LD_SHOW_AUXV) !=3D NULL) >>>>>>>>> + dump_auxv(aux_info); >>>>>>>>> + >>>>>>>>> if (ld_tracing) { /* We're done */ >>>>>>>>> trace_loaded_objects(obj_main); >>>>>>>>> exit(0); >>>>>>>>> @@ -6058,6 +6064,67 @@ print_usage(const char *argv0) >>>>>>>>> " Arguments to the executed process\n", = argv0); >>>>>>>>> } >>>>>>>>>=20 >>>>>>>>> +#define AUXFMT(at, xfmt) [at] =3D { .name =3D #at, .fmt = =3D xfmt } >>>>>>>>> +static const struct auxfmt { >>>>>>>>> + const char *name; >>>>>>>>> + const char *fmt; >>>>>>>>> +} auxfmts[] =3D { >>>>>>>>> + AUXFMT(AT_NULL, NULL), >>>>>>>>> + AUXFMT(AT_IGNORE, NULL), >>>>>>>>> + AUXFMT(AT_EXECFD, "%d"), >>>>>>>>> + AUXFMT(AT_PHDR, "%p"), >>>>>>>>> + AUXFMT(AT_PHENT, "%u"), >>>>>>>>> + AUXFMT(AT_PHNUM, "%u"), >>>>>>>>> + AUXFMT(AT_PAGESZ, "%u"), >>>>>>>>> + AUXFMT(AT_BASE, "%#lx"), >>>>>>>>> + AUXFMT(AT_FLAGS, "%#lx"), >>>>>>>>> + AUXFMT(AT_ENTRY, "%p"), >>>>>>>>> + AUXFMT(AT_NOTELF, NULL), >>>>>>>>> + AUXFMT(AT_UID, "%d"), >>>>>>>>> + AUXFMT(AT_EUID, "%d"), >>>>>>>>> + AUXFMT(AT_GID, "%d"), >>>>>>>>> + AUXFMT(AT_EGID, "%d"), >>>>>>>>> + AUXFMT(AT_EXECPATH, "%s"), >>>>>>>>> + AUXFMT(AT_CANARY, "%p"), >>>>>>>>> + AUXFMT(AT_CANARYLEN, "%u"), >>>>>>>>> + AUXFMT(AT_OSRELDATE, "%u"), >>>>>>>>> + AUXFMT(AT_NCPUS, "%u"), >>>>>>>>> + AUXFMT(AT_PAGESIZES, "%p"), >>>>>>>>> + AUXFMT(AT_PAGESIZESLEN, "%u"), >>>>>>>>> + AUXFMT(AT_TIMEKEEP, "%p"), >>>>>>>>> + AUXFMT(AT_STACKPROT, "%#x"), >>>>>>>>> + AUXFMT(AT_EHDRFLAGS, "%#lx"), >>>>>>>>> + AUXFMT(AT_HWCAP, "%#lx"), >>>>>>>>> + AUXFMT(AT_HWCAP2, "%#lx"), >>>>>>>>> + AUXFMT(AT_BSDFLAGS, "%#lx"), >>>>>>>>> + AUXFMT(AT_ARGC, "%u"), >>>>>>>>> + AUXFMT(AT_ARGV, "%p"), >>>>>>>>> + AUXFMT(AT_ENVC, "%p"), >>>>>>>>> + AUXFMT(AT_ENVV, "%p"), >>>>>>>>> + AUXFMT(AT_PS_STRINGS, "%p"), >>>>>>>>> + AUXFMT(AT_FXRNG, "%p"), >>>>>>>>> +}; >>>>>>>>> + >>>>>>>>> +static void >>>>>>>>> +dump_auxv(Elf_Auxinfo **aux_info) >>>>>>>>> +{ >>>>>>>>> + Elf_Auxinfo *auxp; >>>>>>>>> + const struct auxfmt *fmt; >>>>>>>>> + int i; >>>>>>>>> + >>>>>>>>> + for (i =3D 0; i < AT_COUNT; i++) { >>>>>>>>> + auxp =3D aux_info[i]; >>>>>>>>> + if (auxp =3D=3D NULL) >>>>>>>>> + continue; >>>>>>>>> + fmt =3D &auxfmts[i]; >>>>>>>>> + if (fmt->fmt =3D=3D NULL) >>>>>>>>> + continue; >>>>>>>>> + rtld_fdprintf(STDOUT_FILENO, "%s:\t", = fmt->name); >>>>>>>>> + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, = auxp->a_un.a_ptr); >>>>>>>>> + rtld_fdprintf(STDOUT_FILENO, "\n"); >>>>>>>>=20 >>>>>>>> This is undefined behaviour, breaks CHERI, and totally = unnecessary. You >>>>>>>> have a handful of cases here, just make an enum and have = separate >>>>>>>> rtld_fdprintf calls. >>>>>>=20 >>>>>> In particular, ignoring CHERI, unsigned ints are sign-extended to = 64 >>>>>> bits on MIPS and RISC-V. Thus by passing a 64-bit value but using = a %u, >>>>>> you are violating the calling convention. I can=E2=80=99t = currently get GCC or >>>>>> Clang to exploit the fact that varargs arguments are = sign-extended, but >>>>>> on MIPS, and RISC-V GCC (Clang is currently stupid and = round-trips via >>>>>> memory even when the va_arg calls have no branching surrounding = them, >>>>>> rather than just grabbing from the register) there is a redundant >>>>>> sext.w that can legally be optimised out, but would be broken by = this >>>>>> calling convention violation. >>>>> I might understand the argument that all non-pointer formats for = auxv >>>>> should be longs, i.e. %lu/%ld/%lx, but this is the only problem I = see >>>>> there. We do rely on having specific representations for addresses = and >>>>> longs, and a low-level component as rtld has full rights to = exercise >>>>> this fact, same as VM subsystem or memory allocators. >>>>>=20 >>>>> In fact ELF spec exercises this as well. >>>>> Our arches are either ILP32 or LP64. >>>>>=20 >>>>>>=20 >>>>>> Then CHERI makes it worse because a_ptr and a_val do not have the = same >>>>>> representation, although in practice I think passing a_ptr and = nothing >>>>>> further does end up working on CHERI-RISC-V and Morello, just not >>>>>> CHERI-MIPS due to being big-endian. >>>>=20 >>>> Ok, the following should be enough for CHERI, right? >>>>=20 >>>> diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c >>>> index 0475134b0d96..cf467ae7aacd 100644 >>>> --- a/libexec/rtld-elf/rtld.c >>>> +++ b/libexec/rtld-elf/rtld.c >>>> @@ -6071,33 +6071,33 @@ static const struct auxfmt { >>>> } auxfmts[] =3D { >>>> AUXFMT(AT_NULL, NULL), >>>> AUXFMT(AT_IGNORE, NULL), >>>> - AUXFMT(AT_EXECFD, "%d"), >>>> + AUXFMT(AT_EXECFD, "%ld"), >>>> AUXFMT(AT_PHDR, "%p"), >>>> - AUXFMT(AT_PHENT, "%u"), >>>> - AUXFMT(AT_PHNUM, "%u"), >>>> - AUXFMT(AT_PAGESZ, "%u"), >>>> + AUXFMT(AT_PHENT, "%lu"), >>>> + AUXFMT(AT_PHNUM, "%lu"), >>>> + AUXFMT(AT_PAGESZ, "%lu"), >>>> AUXFMT(AT_BASE, "%#lx"), >>>> AUXFMT(AT_FLAGS, "%#lx"), >>>> AUXFMT(AT_ENTRY, "%p"), >>>> AUXFMT(AT_NOTELF, NULL), >>>> - AUXFMT(AT_UID, "%d"), >>>> - AUXFMT(AT_EUID, "%d"), >>>> - AUXFMT(AT_GID, "%d"), >>>> - AUXFMT(AT_EGID, "%d"), >>>> + AUXFMT(AT_UID, "%ld"), >>>> + AUXFMT(AT_EUID, "%ld"), >>>> + AUXFMT(AT_GID, "%ld"), >>>> + AUXFMT(AT_EGID, "%ld"), >>>> AUXFMT(AT_EXECPATH, "%s"), >>>> AUXFMT(AT_CANARY, "%p"), >>>> - AUXFMT(AT_CANARYLEN, "%u"), >>>> - AUXFMT(AT_OSRELDATE, "%u"), >>>> - AUXFMT(AT_NCPUS, "%u"), >>>> + AUXFMT(AT_CANARYLEN, "%lu"), >>>> + AUXFMT(AT_OSRELDATE, "%lu"), >>>> + AUXFMT(AT_NCPUS, "%lu"), >>>> AUXFMT(AT_PAGESIZES, "%p"), >>>> - AUXFMT(AT_PAGESIZESLEN, "%u"), >>>> + AUXFMT(AT_PAGESIZESLEN, "%lu"), >>>> AUXFMT(AT_TIMEKEEP, "%p"), >>>> - AUXFMT(AT_STACKPROT, "%#x"), >>>> + AUXFMT(AT_STACKPROT, "%#lx"), >>>> AUXFMT(AT_EHDRFLAGS, "%#lx"), >>>> AUXFMT(AT_HWCAP, "%#lx"), >>>> AUXFMT(AT_HWCAP2, "%#lx"), >>>> AUXFMT(AT_BSDFLAGS, "%#lx"), >>>> - AUXFMT(AT_ARGC, "%u"), >>>> + AUXFMT(AT_ARGC, "%lu"), >>>> AUXFMT(AT_ARGV, "%p"), >>>> AUXFMT(AT_ENVC, "%p"), >>>> AUXFMT(AT_ENVV, "%p"), >>>> @@ -6105,6 +6105,15 @@ static const struct auxfmt { >>>> AUXFMT(AT_FXRNG, "%p"), >>>> }; >>>>=20 >>>> +static bool >>>> +is_ptr_fmt(const char *fmt) >>>> +{ >>>> + char last; >>>> + >>>> + last =3D fmt[strlen(fmt) - 1]; >>>> + return (last =3D=3D 'p' || last =3D=3D 's'); >>>> +} >>>> + >>>> static void >>>> dump_auxv(Elf_Auxinfo **aux_info) >>>> { >>>> @@ -6120,7 +6129,8 @@ dump_auxv(Elf_Auxinfo **aux_info) >>>> if (fmt->fmt =3D=3D NULL) >>>> continue; >>>> rtld_fdprintf(STDOUT_FILENO, "%s:\t", fmt->name); >>>> - rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, = auxp->a_un.a_ptr); >>>> + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, = is_ptr_fmt(fmt->fmt) ? >>>> + auxp->a_un.a_ptr : auxp->a_un.a_val); >>>> rtld_fdprintf(STDOUT_FILENO, "\n"); >>>> } >>>> } >>>=20 >>> That should indeed work, though I=E2=80=99d argue it=E2=80=99s still = not as nice as >>> avoiding rtld_fdprintfx entirely. >>=20 >> Wait, no, it doesn=E2=80=99t, the ternary means both operands need to = have the >> same type, so you end up implicitly casting the long to a pointer. = You >> need a real if and two different rtld_fdprintfx calls (or just do it = as >> I=E2=80=99ve suggested). > Ok, real if() then. >=20 > diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c > index 0475134b0d96..d5c3d2893582 100644 > --- a/libexec/rtld-elf/rtld.c > +++ b/libexec/rtld-elf/rtld.c > @@ -6071,33 +6071,33 @@ static const struct auxfmt { > } auxfmts[] =3D { > AUXFMT(AT_NULL, NULL), > AUXFMT(AT_IGNORE, NULL), > - AUXFMT(AT_EXECFD, "%d"), > + AUXFMT(AT_EXECFD, "%ld"), > AUXFMT(AT_PHDR, "%p"), > - AUXFMT(AT_PHENT, "%u"), > - AUXFMT(AT_PHNUM, "%u"), > - AUXFMT(AT_PAGESZ, "%u"), > + AUXFMT(AT_PHENT, "%lu"), > + AUXFMT(AT_PHNUM, "%lu"), > + AUXFMT(AT_PAGESZ, "%lu"), > AUXFMT(AT_BASE, "%#lx"), > AUXFMT(AT_FLAGS, "%#lx"), > AUXFMT(AT_ENTRY, "%p"), > AUXFMT(AT_NOTELF, NULL), > - AUXFMT(AT_UID, "%d"), > - AUXFMT(AT_EUID, "%d"), > - AUXFMT(AT_GID, "%d"), > - AUXFMT(AT_EGID, "%d"), > + AUXFMT(AT_UID, "%ld"), > + AUXFMT(AT_EUID, "%ld"), > + AUXFMT(AT_GID, "%ld"), > + AUXFMT(AT_EGID, "%ld"), > AUXFMT(AT_EXECPATH, "%s"), > AUXFMT(AT_CANARY, "%p"), > - AUXFMT(AT_CANARYLEN, "%u"), > - AUXFMT(AT_OSRELDATE, "%u"), > - AUXFMT(AT_NCPUS, "%u"), > + AUXFMT(AT_CANARYLEN, "%lu"), > + AUXFMT(AT_OSRELDATE, "%lu"), > + AUXFMT(AT_NCPUS, "%lu"), > AUXFMT(AT_PAGESIZES, "%p"), > - AUXFMT(AT_PAGESIZESLEN, "%u"), > + AUXFMT(AT_PAGESIZESLEN, "%lu"), > AUXFMT(AT_TIMEKEEP, "%p"), > - AUXFMT(AT_STACKPROT, "%#x"), > + AUXFMT(AT_STACKPROT, "%#lx"), > AUXFMT(AT_EHDRFLAGS, "%#lx"), > AUXFMT(AT_HWCAP, "%#lx"), > AUXFMT(AT_HWCAP2, "%#lx"), > AUXFMT(AT_BSDFLAGS, "%#lx"), > - AUXFMT(AT_ARGC, "%u"), > + AUXFMT(AT_ARGC, "%lu"), > AUXFMT(AT_ARGV, "%p"), > AUXFMT(AT_ENVC, "%p"), > AUXFMT(AT_ENVV, "%p"), > @@ -6105,6 +6105,15 @@ static const struct auxfmt { > AUXFMT(AT_FXRNG, "%p"), > }; >=20 > +static bool > +is_ptr_fmt(const char *fmt) > +{ > + char last; > + > + last =3D fmt[strlen(fmt) - 1]; > + return (last =3D=3D 'p' || last =3D=3D 's'); > +} > + > static void > dump_auxv(Elf_Auxinfo **aux_info) > { > @@ -6120,7 +6129,13 @@ dump_auxv(Elf_Auxinfo **aux_info) > if (fmt->fmt =3D=3D NULL) > continue; > rtld_fdprintf(STDOUT_FILENO, "%s:\t", fmt->name); > - rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, = auxp->a_un.a_ptr); > + if (is_ptr_fmt(fmt->fmt)) { > + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, > + auxp->a_un.a_ptr); > + } else { > + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, > + auxp->a_un.a_val); > + } > rtld_fdprintf(STDOUT_FILENO, "\n"); > } > } I can=E2=80=99t think of a reason why that wouldn=E2=80=99t work, so = consider this reviewed by me. Thanks, Jess From nobody Sat Nov 13 20:13:30 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 240D11838E59; Sat, 13 Nov 2021 20:13:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs68q04JTz3L9b; Sat, 13 Nov 2021 20:13:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D630719B1D; Sat, 13 Nov 2021 20:13:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ADKDUWj063462; Sat, 13 Nov 2021 20:13:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ADKDUBa063460; Sat, 13 Nov 2021 20:13:30 GMT (envelope-from git) Date: Sat, 13 Nov 2021 20:13:30 GMT Message-Id: <202111132013.1ADKDUBa063460@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 3a902ef25385 - main - rtld dump_auxv: consistently use long modifier for non-pointer auxv vals List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3a902ef253853e367bd755222ed8fe4f101fbf2c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3a902ef253853e367bd755222ed8fe4f101fbf2c commit 3a902ef253853e367bd755222ed8fe4f101fbf2c Author: Konstantin Belousov AuthorDate: 2021-11-13 19:03:48 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-13 20:12:33 +0000 rtld dump_auxv: consistently use long modifier for non-pointer auxv vals Reviewed by: jrtc27 Sponsored by: The FreeBSD Foundation MFC after: 1 week --- libexec/rtld-elf/rtld.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 0475134b0d96..4c3762ee1ab9 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -6071,33 +6071,33 @@ static const struct auxfmt { } auxfmts[] = { AUXFMT(AT_NULL, NULL), AUXFMT(AT_IGNORE, NULL), - AUXFMT(AT_EXECFD, "%d"), + AUXFMT(AT_EXECFD, "%ld"), AUXFMT(AT_PHDR, "%p"), - AUXFMT(AT_PHENT, "%u"), - AUXFMT(AT_PHNUM, "%u"), - AUXFMT(AT_PAGESZ, "%u"), + AUXFMT(AT_PHENT, "%lu"), + AUXFMT(AT_PHNUM, "%lu"), + AUXFMT(AT_PAGESZ, "%lu"), AUXFMT(AT_BASE, "%#lx"), AUXFMT(AT_FLAGS, "%#lx"), AUXFMT(AT_ENTRY, "%p"), AUXFMT(AT_NOTELF, NULL), - AUXFMT(AT_UID, "%d"), - AUXFMT(AT_EUID, "%d"), - AUXFMT(AT_GID, "%d"), - AUXFMT(AT_EGID, "%d"), + AUXFMT(AT_UID, "%ld"), + AUXFMT(AT_EUID, "%ld"), + AUXFMT(AT_GID, "%ld"), + AUXFMT(AT_EGID, "%ld"), AUXFMT(AT_EXECPATH, "%s"), AUXFMT(AT_CANARY, "%p"), - AUXFMT(AT_CANARYLEN, "%u"), - AUXFMT(AT_OSRELDATE, "%u"), - AUXFMT(AT_NCPUS, "%u"), + AUXFMT(AT_CANARYLEN, "%lu"), + AUXFMT(AT_OSRELDATE, "%lu"), + AUXFMT(AT_NCPUS, "%lu"), AUXFMT(AT_PAGESIZES, "%p"), - AUXFMT(AT_PAGESIZESLEN, "%u"), + AUXFMT(AT_PAGESIZESLEN, "%lu"), AUXFMT(AT_TIMEKEEP, "%p"), - AUXFMT(AT_STACKPROT, "%#x"), + AUXFMT(AT_STACKPROT, "%#lx"), AUXFMT(AT_EHDRFLAGS, "%#lx"), AUXFMT(AT_HWCAP, "%#lx"), AUXFMT(AT_HWCAP2, "%#lx"), AUXFMT(AT_BSDFLAGS, "%#lx"), - AUXFMT(AT_ARGC, "%u"), + AUXFMT(AT_ARGC, "%lu"), AUXFMT(AT_ARGV, "%p"), AUXFMT(AT_ENVC, "%p"), AUXFMT(AT_ENVV, "%p"), From nobody Sat Nov 13 20:13:31 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5691E1838D77; Sat, 13 Nov 2021 20:13:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs68r1fqhz3L2s; Sat, 13 Nov 2021 20:13:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 008C519B8A; Sat, 13 Nov 2021 20:13:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ADKDV2W063490; Sat, 13 Nov 2021 20:13:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ADKDVVK063489; Sat, 13 Nov 2021 20:13:31 GMT (envelope-from git) Date: Sat, 13 Nov 2021 20:13:31 GMT Message-Id: <202111132013.1ADKDVVK063489@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: b61bce17f346 - main - rtld dump_auxv: be pedantic and distiguish between auxv union members based on format List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b61bce17f346d79cecfd8f195a64b10f77be43b1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b61bce17f346d79cecfd8f195a64b10f77be43b1 commit b61bce17f346d79cecfd8f195a64b10f77be43b1 Author: Konstantin Belousov AuthorDate: 2021-11-13 19:04:51 +0000 Commit: Konstantin Belousov CommitDate: 2021-11-13 20:13:10 +0000 rtld dump_auxv: be pedantic and distiguish between auxv union members based on format Reviewed by: jrtc27 Sponsored by: The FreeBSD Foundation MFC after: 1 week --- libexec/rtld-elf/rtld.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 4c3762ee1ab9..d5c3d2893582 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -6105,6 +6105,15 @@ static const struct auxfmt { AUXFMT(AT_FXRNG, "%p"), }; +static bool +is_ptr_fmt(const char *fmt) +{ + char last; + + last = fmt[strlen(fmt) - 1]; + return (last == 'p' || last == 's'); +} + static void dump_auxv(Elf_Auxinfo **aux_info) { @@ -6120,7 +6129,13 @@ dump_auxv(Elf_Auxinfo **aux_info) if (fmt->fmt == NULL) continue; rtld_fdprintf(STDOUT_FILENO, "%s:\t", fmt->name); - rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, auxp->a_un.a_ptr); + if (is_ptr_fmt(fmt->fmt)) { + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, + auxp->a_un.a_ptr); + } else { + rtld_fdprintfx(STDOUT_FILENO, fmt->fmt, + auxp->a_un.a_val); + } rtld_fdprintf(STDOUT_FILENO, "\n"); } } From nobody Sat Nov 13 20:56:07 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A2EC3184F3AA; Sat, 13 Nov 2021 20:56:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs76940qkz3nVS; Sat, 13 Nov 2021 20:56:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6983819FE8; Sat, 13 Nov 2021 20:56:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ADKuH3M017326; Sat, 13 Nov 2021 20:56:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ADKu7H7017319; Sat, 13 Nov 2021 20:56:07 GMT (envelope-from git) Date: Sat, 13 Nov 2021 20:56:07 GMT Message-Id: <202111132056.1ADKu7H7017319@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: fe6060f10f63 - main - Merge llvm-project main llvmorg-13-init-16847-g88e66fa60ae5 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fe6060f10f634930ff71b7c50291ddc610da2475 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=fe6060f10f634930ff71b7c50291ddc610da2475 commit fe6060f10f634930ff71b7c50291ddc610da2475 Merge: b61bce17f346 344a3780b2e3 Author: Dimitry Andric AuthorDate: 2021-08-22 19:00:43 +0000 Commit: Dimitry Andric CommitDate: 2021-11-13 20:39:49 +0000 Merge llvm-project main llvmorg-13-init-16847-g88e66fa60ae5 This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-13-init-16847-g88e66fa60ae5, the last commit before the upstream release/13.x branch was created. PR: 258209 MFC after: 2 weeks ObsoleteFiles.inc | 291 + contrib/llvm-project/clang/include/clang-c/Index.h | 29 +- .../clang/include/clang/AST/ASTConcept.h | 3 +- .../clang/include/clang/AST/ASTContext.h | 158 +- .../clang/include/clang/AST/ASTImporter.h | 18 +- .../include/clang/AST/ASTImporterLookupTable.h | 16 + .../clang/include/clang/AST/ASTNodeTraverser.h | 35 +- .../llvm-project/clang/include/clang/AST/Attr.h | 2 + .../clang/include/clang/AST/CXXInheritance.h | 5 +- .../clang/AST/CXXRecordDeclDefinitionBits.def | 4 + .../clang/include/clang/AST/ComparisonCategories.h | 1 + .../clang/include/clang/AST/ComputeDependence.h | 4 + .../llvm-project/clang/include/clang/AST/Decl.h | 45 +- .../clang/include/clang/AST/DeclBase.h | 135 +- .../llvm-project/clang/include/clang/AST/DeclCXX.h | 418 +- .../clang/include/clang/AST/DeclContextInternals.h | 355 +- .../clang/include/clang/AST/DeclObjC.h | 4 +- .../clang/include/clang/AST/DeclTemplate.h | 7 +- .../clang/include/clang/AST/DeclarationName.h | 96 +- .../clang/include/clang/AST/DependenceFlags.h | 14 + .../clang/include/clang/AST/EvaluatedExprVisitor.h | 19 +- .../llvm-project/clang/include/clang/AST/Expr.h | 110 +- .../llvm-project/clang/include/clang/AST/ExprCXX.h | 40 +- .../clang/include/clang/AST/ExprObjC.h | 16 +- .../clang/include/clang/AST/ExternalASTSource.h | 6 +- .../clang/include/clang/AST/IgnoreExpr.h | 14 +- .../clang/include/clang/AST/JSONNodeDumper.h | 5 + .../llvm-project/clang/include/clang/AST/Mangle.h | 26 +- .../clang/include/clang/AST/OpenMPClause.h | 663 +- .../clang/include/clang/AST/OperationKinds.def | 3 + .../clang/include/clang/AST/ParentMapContext.h | 3 +- .../clang/include/clang/AST/RecursiveASTVisitor.h | 156 +- .../clang/include/clang/AST/Redeclarable.h | 1 + .../llvm-project/clang/include/clang/AST/Stmt.h | 8 +- .../clang/include/clang/AST/StmtDataCollectors.td | 2 +- .../clang/include/clang/AST/StmtIterator.h | 11 +- .../clang/include/clang/AST/StmtOpenMP.h | 1224 +- .../clang/include/clang/AST/TemplateBase.h | 6 +- .../clang/include/clang/AST/TextNodeDumper.h | 16 +- .../llvm-project/clang/include/clang/AST/Type.h | 19 +- .../clang/include/clang/AST/TypeProperties.td | 4 + .../clang/include/clang/AST/VTableBuilder.h | 1 + .../include/clang/ASTMatchers/ASTMatchFinder.h | 11 + .../clang/include/clang/ASTMatchers/ASTMatchers.h | 406 +- .../clang/ASTMatchers/ASTMatchersInternal.h | 293 +- .../include/clang/ASTMatchers/ASTMatchersMacros.h | 93 +- .../clang/ASTMatchers/Dynamic/Diagnostics.h | 6 +- .../include/clang/ASTMatchers/Dynamic/Parser.h | 21 + .../include/clang/ASTMatchers/Dynamic/Registry.h | 25 + .../clang/ASTMatchers/Dynamic/VariantValue.h | 23 +- .../include/clang/ASTMatchers/GtestMatchers.h | 46 +- .../clang/Analysis/Analyses/CalledOnceCheck.h | 17 +- .../include/clang/Analysis/AnalysisDeclContext.h | 2 + .../clang/include/clang/Analysis/AnyCall.h | 10 +- .../clang/include/clang/Analysis/CFG.h | 18 +- .../clang/Analysis/FlowSensitive/DataflowValues.h | 3 +- .../include/clang/Analysis/MacroExpansionContext.h | 127 + .../include/clang/Analysis/RetainSummaryManager.h | 8 +- .../llvm-project/clang/include/clang/Basic/ABI.h | 168 - .../clang/include/clang/Basic/AddressSpaces.h | 7 + .../llvm-project/clang/include/clang/Basic/Attr.td | 167 +- .../clang/include/clang/Basic/AttrDocs.td | 366 +- .../include/clang/Basic/AttributeCommonInfo.h | 6 + .../clang/include/clang/Basic/Builtins.def | 53 +- .../clang/include/clang/Basic/Builtins.h | 6 +- .../clang/include/clang/Basic/BuiltinsAArch64.def | 14 + .../clang/include/clang/Basic/BuiltinsAMDGPU.def | 59 +- .../clang/include/clang/Basic/BuiltinsHexagon.def | 10 +- .../include/clang/Basic/BuiltinsHexagonDep.def | 2778 +- .../clang/Basic/BuiltinsHexagonMapCustomDep.def | 240 +- .../clang/include/clang/Basic/BuiltinsNVPTX.def | 85 +- .../clang/include/clang/Basic/BuiltinsPPC.def | 317 +- .../clang/include/clang/Basic/BuiltinsRISCV.def | 63 + .../clang/include/clang/Basic/BuiltinsSystemZ.def | 7 + .../include/clang/Basic/BuiltinsWebAssembly.def | 115 +- .../clang/include/clang/Basic/BuiltinsX86.def | 4 + .../clang/include/clang/Basic/BuiltinsX86_64.def | 6 + .../clang/include/clang/Basic/CodeGenOptions.def | 28 +- .../clang/include/clang/Basic/CodeGenOptions.h | 128 +- .../llvm-project/clang/include/clang/Basic/Cuda.h | 9 +- .../clang/include/clang/Basic/DarwinSDKInfo.h | 157 + .../clang/include/clang/Basic/DebugInfoOptions.h | 1 + .../clang/include/clang/Basic/DeclNodes.td | 5 +- .../clang/include/clang/Basic/Diagnostic.h | 39 + .../include/clang/Basic/DiagnosticASTKinds.td | 2 + .../include/clang/Basic/DiagnosticCategories.td | 1 + .../include/clang/Basic/DiagnosticCommonKinds.td | 24 + .../include/clang/Basic/DiagnosticDriverKinds.td | 49 +- .../include/clang/Basic/DiagnosticFrontendKinds.td | 13 +- .../clang/include/clang/Basic/DiagnosticGroups.td | 118 +- .../clang/include/clang/Basic/DiagnosticIDs.h | 2 +- .../include/clang/Basic/DiagnosticLexKinds.td | 9 +- .../include/clang/Basic/DiagnosticOptions.def | 1 - .../include/clang/Basic/DiagnosticParseKinds.td | 81 +- .../include/clang/Basic/DiagnosticSemaKinds.td | 337 +- .../clang/Basic/DiagnosticSerializationKinds.td | 3 + .../clang/include/clang/Basic/DirectoryEntry.h | 3 +- .../clang/include/clang/Basic/Features.def | 7 + .../clang/include/clang/Basic/IdentifierTable.h | 19 +- .../llvm-project/clang/include/clang/Basic/LLVM.h | 3 + .../clang/include/clang/Basic/LangOptions.def | 27 +- .../clang/include/clang/Basic/LangOptions.h | 67 +- .../clang/include/clang/Basic/LangStandard.h | 1 + .../clang/include/clang/Basic/LangStandards.def | 4 +- .../clang/include/clang/Basic/Module.h | 26 +- .../clang/include/clang/Basic/NoSanitizeList.h | 50 + .../clang/include/clang/Basic/OpenCLExtensions.def | 84 +- .../clang/include/clang/Basic/OpenCLImageTypes.def | 2 +- .../clang/include/clang/Basic/OpenCLOptions.h | 87 +- .../clang/include/clang/Basic/OpenMPKinds.h | 5 + .../clang/include/clang/Basic/RISCVVTypes.def | 147 + .../clang/include/clang/Basic/SanitizerBlacklist.h | 49 - .../include/clang/Basic/SanitizerSpecialCaseList.h | 2 +- .../clang/include/clang/Basic/Sanitizers.h | 23 +- .../clang/include/clang/Basic/SourceLocation.h | 48 +- .../clang/include/clang/Basic/SourceManager.h | 102 +- .../clang/include/clang/Basic/Specifiers.h | 13 +- .../clang/include/clang/Basic/StmtNodes.td | 10 +- .../clang/include/clang/Basic/TargetBuiltins.h | 29 +- .../clang/include/clang/Basic/TargetCXXABI.def | 129 + .../clang/include/clang/Basic/TargetCXXABI.h | 200 +- .../clang/include/clang/Basic/TargetInfo.h | 115 +- .../llvm-project/clang/include/clang/Basic/Thunk.h | 188 + .../clang/include/clang/Basic/TokenKinds.def | 20 +- .../clang/include/clang/Basic/XRayInstr.h | 5 + .../clang/include/clang/Basic/arm_mve.td | 19 +- .../clang/include/clang/Basic/arm_neon.td | 57 +- .../clang/include/clang/Basic/arm_neon_incl.td | 1 + .../clang/include/clang/Basic/arm_sve.td | 18 +- .../clang/include/clang/Basic/riscv_vector.td | 2112 ++ .../clang/include/clang/CodeGen/BackendUtil.h | 3 +- .../clang/include/clang/CodeGen/CGFunctionInfo.h | 43 +- .../clang/include/clang/CodeGen/CodeGenAction.h | 3 + .../clang/include/clang/CodeGen/SwiftCallingConv.h | 3 +- .../include/clang/CrossTU/CrossTranslationUnit.h | 32 +- .../clang/include/clang/Driver/Action.h | 8 +- .../clang/include/clang/Driver/ClangOptionDocs.td | 2 +- .../clang/include/clang/Driver/DarwinSDKInfo.h | 41 - .../clang/include/clang/Driver/Distro.h | 3 +- .../clang/include/clang/Driver/Driver.h | 46 +- .../{lib => include/clang}/Driver/InputInfo.h | 4 +- .../llvm-project/clang/include/clang/Driver/Job.h | 29 +- .../clang/include/clang/Driver/Options.h | 2 - .../clang/include/clang/Driver/Options.td | 1255 +- .../clang/include/clang/Driver/SanitizerArgs.h | 15 +- .../clang/include/clang/Driver/ToolChain.h | 45 +- .../clang/include/clang/Driver/Types.def | 1 + .../clang/include/clang/Driver/Types.h | 11 + .../clang/include/clang/Format/Format.h | 442 +- .../include/clang/Frontend/CommandLineSourceLoc.h | 7 + .../include/clang/Frontend/CompilerInstance.h | 25 +- .../include/clang/Frontend/CompilerInvocation.h | 148 +- .../clang/Frontend/DependencyOutputOptions.h | 20 +- .../clang/include/clang/Frontend/FrontendAction.h | 5 +- .../clang/include/clang/Frontend/FrontendActions.h | 11 + .../clang/include/clang/Frontend/FrontendOptions.h | 9 +- .../clang/Frontend/PreprocessorOutputOptions.h | 2 + .../clang/include/clang/Frontend/TextDiagnostic.h | 3 +- .../clang/include/clang/Index/CommentToXML.h | 1 - .../clang/include/clang/Index/DeclOccurrence.h | 13 +- .../clang/include/clang/Index/IndexSymbol.h | 1 + .../clang/include/clang/Index/IndexingOptions.h | 1 + .../clang/include/clang/Interpreter/Interpreter.h | 71 + .../clang/Interpreter/PartialTranslationUnit.h | 37 + .../Lex/DependencyDirectivesSourceMinimizer.h | 2 + .../clang/include/clang/Lex/HeaderMap.h | 10 +- .../clang/include/clang/Lex/LiteralSupport.h | 1 + .../clang/include/clang/Lex/MacroInfo.h | 2 +- .../clang/include/clang/Lex/ModuleLoader.h | 3 - .../clang/include/clang/Lex/ModuleMap.h | 15 +- .../clang/include/clang/Lex/PPCallbacks.h | 62 + .../clang/Lex/PPConditionalDirectiveRecord.h | 8 + .../clang/include/clang/Lex/PreprocessingRecord.h | 7 + .../clang/include/clang/Lex/Preprocessor.h | 19 +- .../clang/include/clang/Lex/PreprocessorOptions.h | 4 + .../llvm-project/clang/include/clang/Lex/Token.h | 4 +- .../clang/include/clang/Parse/Parser.h | 228 +- .../clang/include/clang/Rewrite/Core/RewriteRope.h | 9 +- .../include/clang/Sema/AnalysisBasedWarnings.h | 8 +- .../clang/include/clang/Sema/DeclSpec.h | 6 +- .../clang/include/clang/Sema/ExternalSemaSource.h | 4 +- .../clang/include/clang/Sema/Initialization.h | 32 +- .../clang/Sema/MultiplexExternalSemaSource.h | 2 +- .../clang/include/clang/Sema/Overload.h | 9 +- .../clang/include/clang/Sema/ParsedAttr.h | 75 +- .../llvm-project/clang/include/clang/Sema/Scope.h | 19 +- .../clang/include/clang/Sema/ScopeInfo.h | 22 +- .../llvm-project/clang/include/clang/Sema/Sema.h | 512 +- .../clang/include/clang/Sema/Template.h | 2 + .../include/clang/Serialization/ASTBitCodes.h | 3269 +- .../clang/include/clang/Serialization/ASTReader.h | 56 +- .../clang/include/clang/Serialization/ASTWriter.h | 14 +- .../clang/include/clang/Serialization/ModuleFile.h | 7 +- .../clang/Serialization/ModuleFileExtension.h | 9 +- .../clang/StaticAnalyzer/Checkers/SValExplainer.h | 4 +- .../include/clang/StaticAnalyzer/Core/Analyses.def | 7 +- .../StaticAnalyzer/Core/BugReporter/BugReporter.h | 69 +- .../Core/BugReporter/BugReporterVisitors.h | 306 +- .../Core/BugReporter/CommonBugCategories.h | 2 + .../StaticAnalyzer/Core/PathDiagnosticConsumers.h | 5 +- .../Core/PathSensitive/BasicValueFactory.h | 14 +- .../Core/PathSensitive/CheckerContext.h | 2 +- .../Core/PathSensitive/CheckerHelpers.h | 41 + .../StaticAnalyzer/Core/PathSensitive/CoreEngine.h | 9 +- .../Core/PathSensitive/DynamicExtent.h | 59 + .../Core/PathSensitive/DynamicSize.h | 53 - .../Core/PathSensitive/DynamicType.h | 1 - .../StaticAnalyzer/Core/PathSensitive/ExprEngine.h | 3 +- .../Core/PathSensitive/LoopUnrolling.h | 3 +- .../Core/PathSensitive/LoopWidening.h | 2 +- .../Core/PathSensitive/RangedConstraintManager.h | 325 +- .../Core/PathSensitive/SMTConstraintManager.h | 2 +- .../Core/PathSensitive/SValBuilder.h | 42 +- .../StaticAnalyzer/Core/PathSensitive/SVals.h | 22 +- .../StaticAnalyzer/Core/PathSensitive/Store.h | 9 +- .../include/clang/Tooling/ArgumentsAdjusters.h | 4 - .../include/clang/Tooling/CommonOptionsParser.h | 26 +- .../include/clang/Tooling/CompilationDatabase.h | 6 + .../clang/include/clang/Tooling/Core/Diagnostic.h | 33 +- .../DependencyScanningFilesystem.h | 82 +- .../DependencyScanning/DependencyScanningTool.h | 67 +- .../DependencyScanning/DependencyScanningWorker.h | 8 +- .../DependencyScanning/ModuleDepCollector.h | 145 +- .../clang/include/clang/Tooling/DiagnosticsYaml.h | 9 +- .../include/clang/Tooling/NodeIntrospection.h | 101 + .../Tooling/Refactoring/RecursiveSymbolVisitor.h | 11 + .../Tooling/Refactoring/RefactoringActionRule.h | 1 - .../clang/include/clang/Tooling/Syntax/Tokens.h | 8 + .../clang/include/clang/Tooling/Tooling.h | 8 + .../include/clang/Tooling/Transformer/Parsing.h | 1 - .../clang/Tooling/Transformer/RangeSelector.h | 6 +- .../clang/include/clang/module.modulemap | 4 +- .../clang/lib/APINotes/APINotesYAMLCompiler.cpp | 6 +- .../clang/lib/ARCMigrate/FileRemapper.cpp | 11 +- .../llvm-project/clang/lib/ARCMigrate/ObjCMT.cpp | 22 +- .../clang/lib/ARCMigrate/PlistReporter.cpp | 2 +- .../ARCMigrate/TransEmptyStatementsAndDealloc.cpp | 2 +- contrib/llvm-project/clang/lib/AST/ASTContext.cpp | 458 +- .../llvm-project/clang/lib/AST/ASTDiagnostic.cpp | 5 +- contrib/llvm-project/clang/lib/AST/ASTImporter.cpp | 275 +- .../clang/lib/AST/ASTImporterLookupTable.cpp | 17 + .../clang/lib/AST/ASTStructuralEquivalence.cpp | 9 +- .../llvm-project/clang/lib/AST/ASTTypeTraits.cpp | 4 +- contrib/llvm-project/clang/lib/AST/AttrImpl.cpp | 51 +- .../llvm-project/clang/lib/AST/CXXInheritance.cpp | 13 +- .../clang/lib/AST/ComputeDependence.cpp | 8 + contrib/llvm-project/clang/lib/AST/Decl.cpp | 69 +- contrib/llvm-project/clang/lib/AST/DeclBase.cpp | 92 +- contrib/llvm-project/clang/lib/AST/DeclCXX.cpp | 133 +- contrib/llvm-project/clang/lib/AST/DeclObjC.cpp | 8 +- contrib/llvm-project/clang/lib/AST/DeclPrinter.cpp | 103 +- .../llvm-project/clang/lib/AST/DeclTemplate.cpp | 55 +- .../llvm-project/clang/lib/AST/DeclarationName.cpp | 27 +- contrib/llvm-project/clang/lib/AST/Expr.cpp | 205 +- contrib/llvm-project/clang/lib/AST/ExprCXX.cpp | 27 +- .../clang/lib/AST/ExprClassification.cpp | 19 +- .../llvm-project/clang/lib/AST/ExprConcepts.cpp | 6 +- .../llvm-project/clang/lib/AST/ExprConstant.cpp | 188 +- contrib/llvm-project/clang/lib/AST/ExprObjC.cpp | 6 +- .../clang/lib/AST/ExternalASTMerger.cpp | 28 +- .../llvm-project/clang/lib/AST/Interp/Context.h | 1 - contrib/llvm-project/clang/lib/AST/Interp/Interp.h | 3 +- .../llvm-project/clang/lib/AST/ItaniumMangle.cpp | 278 +- .../llvm-project/clang/lib/AST/JSONNodeDumper.cpp | 71 +- contrib/llvm-project/clang/lib/AST/Mangle.cpp | 24 +- .../llvm-project/clang/lib/AST/MicrosoftMangle.cpp | 49 +- contrib/llvm-project/clang/lib/AST/NSAPI.cpp | 2 + .../clang/lib/AST/NestedNameSpecifier.cpp | 24 +- .../llvm-project/clang/lib/AST/OpenMPClause.cpp | 178 +- .../clang/lib/AST/ParentMapContext.cpp | 134 +- .../clang/lib/AST/PrintfFormatString.cpp | 2 + .../llvm-project/clang/lib/AST/QualTypeNames.cpp | 16 +- .../clang/lib/AST/RecordLayoutBuilder.cpp | 64 +- contrib/llvm-project/clang/lib/AST/Stmt.cpp | 25 +- contrib/llvm-project/clang/lib/AST/StmtOpenMP.cpp | 212 +- contrib/llvm-project/clang/lib/AST/StmtPrinter.cpp | 134 +- contrib/llvm-project/clang/lib/AST/StmtProfile.cpp | 81 +- .../llvm-project/clang/lib/AST/TemplateBase.cpp | 116 +- .../llvm-project/clang/lib/AST/TextNodeDumper.cpp | 63 +- contrib/llvm-project/clang/lib/AST/Type.cpp | 27 +- contrib/llvm-project/clang/lib/AST/TypeLoc.cpp | 2 + contrib/llvm-project/clang/lib/AST/TypePrinter.cpp | 58 +- .../llvm-project/clang/lib/AST/VTableBuilder.cpp | 2 +- .../clang/lib/ASTMatchers/ASTMatchFinder.cpp | 24 +- .../clang/lib/ASTMatchers/ASTMatchersInternal.cpp | 11 + .../clang/lib/ASTMatchers/Dynamic/Diagnostics.cpp | 8 + .../clang/lib/ASTMatchers/Dynamic/Marshallers.cpp | 4 +- .../clang/lib/ASTMatchers/Dynamic/Marshallers.h | 108 +- .../clang/lib/ASTMatchers/Dynamic/Parser.cpp | 262 +- .../clang/lib/ASTMatchers/Dynamic/Registry.cpp | 154 +- .../clang/lib/ASTMatchers/Dynamic/VariantValue.cpp | 22 +- .../clang/lib/ASTMatchers/GtestMatchers.cpp | 236 +- .../clang/lib/Analysis/AnalysisDeclContext.cpp | 55 +- .../llvm-project/clang/lib/Analysis/BodyFarm.cpp | 101 +- contrib/llvm-project/clang/lib/Analysis/CFG.cpp | 13 + .../clang/lib/Analysis/CalledOnceCheck.cpp | 242 +- .../clang/lib/Analysis/LiveVariables.cpp | 30 +- .../clang/lib/Analysis/MacroExpansionContext.cpp | 231 + .../clang/lib/Analysis/PathDiagnostic.cpp | 2 +- .../clang/lib/Analysis/RetainSummaryManager.cpp | 34 +- .../clang/lib/Analysis/ThreadSafety.cpp | 235 +- .../clang/lib/Analysis/ThreadSafetyCommon.cpp | 3 +- .../llvm-project/clang/lib/Basic/Attributes.cpp | 8 + contrib/llvm-project/clang/lib/Basic/Builtins.cpp | 16 +- .../clang/lib/Basic/CodeGenOptions.cpp | 8 - contrib/llvm-project/clang/lib/Basic/Cuda.cpp | 22 +- .../llvm-project/clang/lib/Basic/DarwinSDKInfo.cpp | 131 + .../llvm-project/clang/lib/Basic/DiagnosticIDs.cpp | 26 +- .../llvm-project/clang/lib/Basic/FileManager.cpp | 15 +- .../clang/lib/Basic/IdentifierTable.cpp | 43 +- .../llvm-project/clang/lib/Basic/LangOptions.cpp | 2 +- contrib/llvm-project/clang/lib/Basic/Module.cpp | 21 +- .../clang/lib/Basic/NoSanitizeList.cpp | 54 + .../llvm-project/clang/lib/Basic/OpenCLOptions.cpp | 108 +- .../llvm-project/clang/lib/Basic/OpenMPKinds.cpp | 18 +- .../clang/lib/Basic/SanitizerBlacklist.cpp | 59 - .../llvm-project/clang/lib/Basic/Sanitizers.cpp | 61 + .../clang/lib/Basic/SourceLocation.cpp | 2 +- .../llvm-project/clang/lib/Basic/SourceManager.cpp | 115 +- .../llvm-project/clang/lib/Basic/TargetInfo.cpp | 40 +- contrib/llvm-project/clang/lib/Basic/Targets.cpp | 62 +- .../clang/lib/Basic/Targets/AArch64.cpp | 52 +- .../llvm-project/clang/lib/Basic/Targets/AArch64.h | 5 + .../clang/lib/Basic/Targets/AMDGPU.cpp | 31 +- .../llvm-project/clang/lib/Basic/Targets/AMDGPU.h | 5 +- .../llvm-project/clang/lib/Basic/Targets/ARM.cpp | 30 +- contrib/llvm-project/clang/lib/Basic/Targets/ARM.h | 2 + .../llvm-project/clang/lib/Basic/Targets/AVR.cpp | 1 + contrib/llvm-project/clang/lib/Basic/Targets/AVR.h | 1 + .../llvm-project/clang/lib/Basic/Targets/BPF.cpp | 11 + contrib/llvm-project/clang/lib/Basic/Targets/BPF.h | 20 +- .../clang/lib/Basic/Targets/Hexagon.cpp | 39 +- .../llvm-project/clang/lib/Basic/Targets/Le64.cpp | 9 +- .../llvm-project/clang/lib/Basic/Targets/Le64.h | 1 - .../llvm-project/clang/lib/Basic/Targets/M68k.cpp | 236 + .../llvm-project/clang/lib/Basic/Targets/M68k.h | 59 + .../llvm-project/clang/lib/Basic/Targets/NVPTX.cpp | 8 + .../llvm-project/clang/lib/Basic/Targets/NVPTX.h | 8 + .../clang/lib/Basic/Targets/OSTargets.cpp | 2 + .../clang/lib/Basic/Targets/OSTargets.h | 40 +- .../llvm-project/clang/lib/Basic/Targets/PPC.cpp | 243 +- contrib/llvm-project/clang/lib/Basic/Targets/PPC.h | 16 +- .../llvm-project/clang/lib/Basic/Targets/RISCV.cpp | 58 +- .../llvm-project/clang/lib/Basic/Targets/RISCV.h | 14 +- .../llvm-project/clang/lib/Basic/Targets/SPIR.h | 55 +- .../clang/lib/Basic/Targets/SystemZ.cpp | 6 +- .../llvm-project/clang/lib/Basic/Targets/SystemZ.h | 4 + contrib/llvm-project/clang/lib/Basic/Targets/TCE.h | 5 + .../clang/lib/Basic/Targets/WebAssembly.cpp | 29 +- .../clang/lib/Basic/Targets/WebAssembly.h | 15 +- .../llvm-project/clang/lib/Basic/Targets/X86.cpp | 34 +- contrib/llvm-project/clang/lib/Basic/Targets/X86.h | 39 +- .../llvm-project/clang/lib/Basic/Targets/XCore.cpp | 1 + contrib/llvm-project/clang/lib/Basic/XRayInstr.cpp | 27 + .../llvm-project/clang/lib/CodeGen/BackendUtil.cpp | 324 +- .../llvm-project/clang/lib/CodeGen/CGAtomic.cpp | 117 +- .../llvm-project/clang/lib/CodeGen/CGBlocks.cpp | 72 +- contrib/llvm-project/clang/lib/CodeGen/CGBuilder.h | 49 +- .../llvm-project/clang/lib/CodeGen/CGBuiltin.cpp | 1824 +- .../llvm-project/clang/lib/CodeGen/CGCUDANV.cpp | 291 +- .../llvm-project/clang/lib/CodeGen/CGCUDARuntime.h | 32 +- contrib/llvm-project/clang/lib/CodeGen/CGCXX.cpp | 8 +- contrib/llvm-project/clang/lib/CodeGen/CGCall.cpp | 280 +- contrib/llvm-project/clang/lib/CodeGen/CGClass.cpp | 46 +- .../llvm-project/clang/lib/CodeGen/CGCleanup.cpp | 106 +- .../llvm-project/clang/lib/CodeGen/CGCoroutine.cpp | 13 + .../llvm-project/clang/lib/CodeGen/CGDebugInfo.cpp | 307 +- .../llvm-project/clang/lib/CodeGen/CGDebugInfo.h | 28 +- contrib/llvm-project/clang/lib/CodeGen/CGDecl.cpp | 115 +- .../llvm-project/clang/lib/CodeGen/CGDeclCXX.cpp | 151 +- .../llvm-project/clang/lib/CodeGen/CGException.cpp | 153 +- contrib/llvm-project/clang/lib/CodeGen/CGExpr.cpp | 121 +- .../llvm-project/clang/lib/CodeGen/CGExprAgg.cpp | 42 +- .../llvm-project/clang/lib/CodeGen/CGExprCXX.cpp | 22 +- .../clang/lib/CodeGen/CGExprComplex.cpp | 1 + .../clang/lib/CodeGen/CGExprConstant.cpp | 1 + .../clang/lib/CodeGen/CGExprScalar.cpp | 188 +- .../llvm-project/clang/lib/CodeGen/CGLoopInfo.cpp | 11 +- .../clang/lib/CodeGen/CGNonTrivialStruct.cpp | 14 +- contrib/llvm-project/clang/lib/CodeGen/CGObjC.cpp | 167 +- .../llvm-project/clang/lib/CodeGen/CGObjCGNU.cpp | 48 +- .../llvm-project/clang/lib/CodeGen/CGObjCMac.cpp | 27 +- .../clang/lib/CodeGen/CGObjCRuntime.cpp | 2 +- .../clang/lib/CodeGen/CGOpenMPRuntime.cpp | 1441 +- .../clang/lib/CodeGen/CGOpenMPRuntime.h | 69 +- .../clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp | 1273 +- .../clang/lib/CodeGen/CGOpenMPRuntimeGPU.h | 70 +- contrib/llvm-project/clang/lib/CodeGen/CGStmt.cpp | 246 +- .../clang/lib/CodeGen/CGStmtOpenMP.cpp | 925 +- .../llvm-project/clang/lib/CodeGen/CGVTables.cpp | 22 +- .../clang/lib/CodeGen/CodeGenAction.cpp | 215 +- .../clang/lib/CodeGen/CodeGenFunction.cpp | 258 +- .../clang/lib/CodeGen/CodeGenFunction.h | 138 +- .../clang/lib/CodeGen/CodeGenModule.cpp | 646 +- .../llvm-project/clang/lib/CodeGen/CodeGenModule.h | 100 +- .../llvm-project/clang/lib/CodeGen/CodeGenPGO.cpp | 8 +- .../llvm-project/clang/lib/CodeGen/CodeGenPGO.h | 4 + .../clang/lib/CodeGen/CodeGenTypes.cpp | 11 +- .../clang/lib/CodeGen/CoverageMappingGen.cpp | 312 +- .../clang/lib/CodeGen/CoverageMappingGen.h | 3 +- .../llvm-project/clang/lib/CodeGen/EHScopeStack.h | 14 +- .../clang/lib/CodeGen/ItaniumCXXABI.cpp | 337 +- .../clang/lib/CodeGen/MicrosoftCXXABI.cpp | 81 +- .../clang/lib/CodeGen/ModuleBuilder.cpp | 2 +- .../CodeGen/ObjectFilePCHContainerOperations.cpp | 12 +- .../clang/lib/CodeGen/SanitizerMetadata.cpp | 10 +- .../llvm-project/clang/lib/CodeGen/TargetInfo.cpp | 293 +- .../llvm-project/clang/lib/CodeGen/TargetInfo.h | 11 + .../clang/lib/CodeGen/VarBypassDetector.cpp | 2 +- .../clang/lib/CodeGen/VarBypassDetector.h | 2 +- .../clang/lib/CrossTU/CrossTranslationUnit.cpp | 48 +- .../linux/DirectoryWatcher-linux.cpp | 1 + .../windows/DirectoryWatcher-windows.cpp | 279 +- contrib/llvm-project/clang/lib/Driver/Action.cpp | 4 +- .../llvm-project/clang/lib/Driver/Compilation.cpp | 7 +- .../clang/lib/Driver/DarwinSDKInfo.cpp | 43 - contrib/llvm-project/clang/lib/Driver/Distro.cpp | 11 +- contrib/llvm-project/clang/lib/Driver/Driver.cpp | 431 +- contrib/llvm-project/clang/lib/Driver/Job.cpp | 59 +- .../clang/lib/Driver/SanitizerArgs.cpp | 151 +- contrib/llvm-project/clang/lib/Driver/Tool.cpp | 2 +- .../llvm-project/clang/lib/Driver/ToolChain.cpp | 301 +- .../clang/lib/Driver/ToolChains/AIX.cpp | 5 +- .../llvm-project/clang/lib/Driver/ToolChains/AIX.h | 11 + .../clang/lib/Driver/ToolChains/AMDGPU.cpp | 383 +- .../clang/lib/Driver/ToolChains/AMDGPU.h | 29 +- .../clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp | 304 + .../clang/lib/Driver/ToolChains/AMDGPUOpenMP.h | 106 + .../clang/lib/Driver/ToolChains/AVR.cpp | 519 +- .../llvm-project/clang/lib/Driver/ToolChains/AVR.h | 5 +- .../clang/lib/Driver/ToolChains/Ananas.cpp | 2 +- .../clang/lib/Driver/ToolChains/Arch/AArch64.cpp | 51 +- .../clang/lib/Driver/ToolChains/Arch/AArch64.h | 3 +- .../clang/lib/Driver/ToolChains/Arch/ARM.cpp | 304 +- .../clang/lib/Driver/ToolChains/Arch/ARM.h | 4 + .../clang/lib/Driver/ToolChains/Arch/M68k.cpp | 125 + .../clang/lib/Driver/ToolChains/Arch/M68k.h | 42 + .../clang/lib/Driver/ToolChains/Arch/RISCV.cpp | 26 +- .../clang/lib/Driver/ToolChains/Arch/X86.cpp | 21 +- .../clang/lib/Driver/ToolChains/BareMetal.cpp | 14 +- .../clang/lib/Driver/ToolChains/BareMetal.h | 9 +- .../clang/lib/Driver/ToolChains/Clang.cpp | 859 +- .../clang/lib/Driver/ToolChains/Clang.h | 4 - .../clang/lib/Driver/ToolChains/CloudABI.cpp | 2 +- .../clang/lib/Driver/ToolChains/CommonArgs.cpp | 230 +- .../clang/lib/Driver/ToolChains/CommonArgs.h | 17 +- .../clang/lib/Driver/ToolChains/Cuda.cpp | 102 +- .../clang/lib/Driver/ToolChains/Darwin.cpp | 263 +- .../clang/lib/Driver/ToolChains/Darwin.h | 45 +- .../clang/lib/Driver/ToolChains/Flang.cpp | 37 +- .../clang/lib/Driver/ToolChains/Flang.h | 15 + .../clang/lib/Driver/ToolChains/FreeBSD.cpp | 4 +- .../clang/lib/Driver/ToolChains/Fuchsia.cpp | 75 +- .../clang/lib/Driver/ToolChains/Gnu.cpp | 307 +- .../llvm-project/clang/lib/Driver/ToolChains/Gnu.h | 18 +- .../clang/lib/Driver/ToolChains/HIP.cpp | 240 +- .../llvm-project/clang/lib/Driver/ToolChains/HIP.h | 12 +- .../clang/lib/Driver/ToolChains/Haiku.cpp | 4 +- .../clang/lib/Driver/ToolChains/Hexagon.cpp | 22 +- .../clang/lib/Driver/ToolChains/Hurd.cpp | 27 +- .../clang/lib/Driver/ToolChains/Hurd.h | 3 + .../clang/lib/Driver/ToolChains/InterfaceStubs.cpp | 5 +- .../clang/lib/Driver/ToolChains/Linux.cpp | 348 +- .../clang/lib/Driver/ToolChains/Linux.h | 11 +- .../clang/lib/Driver/ToolChains/MSP430.cpp | 2 +- .../clang/lib/Driver/ToolChains/MSP430.h | 2 +- .../clang/lib/Driver/ToolChains/MSVC.cpp | 470 +- .../clang/lib/Driver/ToolChains/MSVC.h | 33 +- .../clang/lib/Driver/ToolChains/MinGW.cpp | 5 +- .../clang/lib/Driver/ToolChains/Minix.cpp | 2 +- .../clang/lib/Driver/ToolChains/Myriad.cpp | 2 +- .../clang/lib/Driver/ToolChains/NaCl.cpp | 2 +- .../clang/lib/Driver/ToolChains/NetBSD.cpp | 4 +- .../clang/lib/Driver/ToolChains/RISCVToolchain.cpp | 10 +- .../clang/lib/Driver/ToolChains/ROCm.h | 48 +- .../clang/lib/Driver/ToolChains/Solaris.cpp | 8 +- .../clang/lib/Driver/ToolChains/WebAssembly.cpp | 56 +- .../clang/lib/Driver/ToolChains/WebAssembly.h | 4 + contrib/llvm-project/clang/lib/Driver/Types.cpp | 49 +- .../clang/lib/Edit/RewriteObjCFoundationAPI.cpp | 1 + .../clang/lib/Format/BreakableToken.cpp | 114 +- .../llvm-project/clang/lib/Format/BreakableToken.h | 26 +- .../clang/lib/Format/ContinuationIndenter.cpp | 13 +- contrib/llvm-project/clang/lib/Format/Format.cpp | 298 +- .../llvm-project/clang/lib/Format/FormatToken.h | 24 +- .../clang/lib/Format/FormatTokenLexer.cpp | 117 +- .../clang/lib/Format/FormatTokenLexer.h | 3 +- .../clang/lib/Format/NamespaceEndCommentsFixer.cpp | 15 +- .../clang/lib/Format/SortJavaScriptImports.cpp | 190 +- .../clang/lib/Format/TokenAnnotator.cpp | 441 +- .../llvm-project/clang/lib/Format/TokenAnnotator.h | 14 +- .../clang/lib/Format/UnwrappedLineFormatter.cpp | 90 +- .../clang/lib/Format/UnwrappedLineFormatter.h | 1 + .../clang/lib/Format/UnwrappedLineParser.cpp | 133 +- .../clang/lib/Format/UnwrappedLineParser.h | 3 +- .../clang/lib/Format/UsingDeclarationsSorter.cpp | 4 +- .../clang/lib/Format/WhitespaceManager.cpp | 399 +- .../clang/lib/Format/WhitespaceManager.h | 107 + .../llvm-project/clang/lib/Frontend/ASTUnit.cpp | 35 +- .../clang/lib/Frontend/CompilerInstance.cpp | 247 +- .../clang/lib/Frontend/CompilerInvocation.cpp | 2520 +- .../Frontend/CreateInvocationFromCommandLine.cpp | 11 +- .../clang/lib/Frontend/DependencyFile.cpp | 17 +- .../clang/lib/Frontend/DependencyGraph.cpp | 2 +- .../clang/lib/Frontend/DiagnosticRenderer.cpp | 7 + .../clang/lib/Frontend/FrontendAction.cpp | 17 +- .../clang/lib/Frontend/FrontendActions.cpp | 85 +- .../clang/lib/Frontend/FrontendOptions.cpp | 1 + .../clang/lib/Frontend/HeaderIncludeGen.cpp | 20 +- .../clang/lib/Frontend/InitHeaderSearch.cpp | 44 +- .../clang/lib/Frontend/InitPreprocessor.cpp | 61 +- .../Frontend/InterfaceStubFunctionsConsumer.cpp | 12 +- .../lib/Frontend/ModuleDependencyCollector.cpp | 2 +- .../clang/lib/Frontend/PrecompiledPreamble.cpp | 10 +- .../clang/lib/Frontend/PrintPreprocessedOutput.cpp | 349 +- .../clang/lib/Frontend/Rewrite/FrontendActions.cpp | 6 +- .../lib/Frontend/Rewrite/RewriteModernObjC.cpp | 99 +- .../clang/lib/Frontend/Rewrite/RewriteObjC.cpp | 96 +- .../clang/lib/Frontend/TestModuleFileExtension.cpp | 10 + .../clang/lib/Frontend/TestModuleFileExtension.h | 18 +- .../clang/lib/Frontend/TextDiagnostic.cpp | 25 +- .../clang/lib/Frontend/TextDiagnosticPrinter.cpp | 3 +- .../lib/FrontendTool/ExecuteCompilerInvocation.cpp | 2 +- .../clang/lib/Headers/__clang_cuda_math.h | 4 +- .../lib/Headers/__clang_cuda_runtime_wrapper.h | 7 +- .../clang/lib/Headers/__clang_hip_cmath.h | 238 +- .../lib/Headers/__clang_hip_libdevice_declares.h | 36 +- .../clang/lib/Headers/__clang_hip_math.h | 6 +- .../lib/Headers/__clang_hip_runtime_wrapper.h | 87 +- contrib/llvm-project/clang/lib/Headers/altivec.h | 1588 +- contrib/llvm-project/clang/lib/Headers/amxintrin.h | 253 +- contrib/llvm-project/clang/lib/Headers/arm_acle.h | 55 + .../llvm-project/clang/lib/Headers/avx512fintrin.h | 214 +- contrib/llvm-project/clang/lib/Headers/builtins.h | 16 + .../clang/lib/Headers/cuda_wrappers/complex | 8 + .../lib/Headers/hexagon_circ_brev_intrinsics.h | 298 + .../clang/lib/Headers/hexagon_protos.h | 8450 +++++ .../llvm-project/clang/lib/Headers/hexagon_types.h | 2653 ++ .../clang/lib/Headers/hvx_hexagon_protos.h | 4392 +++ contrib/llvm-project/clang/lib/Headers/immintrin.h | 10 +- contrib/llvm-project/clang/lib/Headers/intrin.h | 49 +- .../clang/lib/Headers/keylockerintrin.h | 30 + .../llvm-project/clang/lib/Headers/opencl-c-base.h | 147 +- contrib/llvm-project/clang/lib/Headers/opencl-c.h | 860 +- .../__clang_openmp_device_functions.h | 42 + .../clang/lib/Headers/openmp_wrappers/complex | 6 - .../clang/lib/Headers/openmp_wrappers/complex.h | 1 - .../clang/lib/Headers/openmp_wrappers/new | 26 +- .../llvm-project/clang/lib/Headers/uintrintrin.h | 7 + .../llvm-project/clang/lib/Headers/vaesintrin.h | 41 +- contrib/llvm-project/clang/lib/Headers/vecintrin.h | 283 +- .../clang/lib/Headers/vpclmulqdqintrin.h | 2 + .../llvm-project/clang/lib/Headers/wasm_simd128.h | 1045 +- .../clang/lib/Index/FileIndexRecord.cpp | 71 +- .../llvm-project/clang/lib/Index/FileIndexRecord.h | 23 +- contrib/llvm-project/clang/lib/Index/IndexBody.cpp | 12 +- contrib/llvm-project/clang/lib/Index/IndexDecl.cpp | 2 +- .../llvm-project/clang/lib/Index/IndexSymbol.cpp | 7 + .../clang/lib/Index/IndexingAction.cpp | 111 +- .../clang/lib/Index/IndexingContext.cpp | 35 + .../llvm-project/clang/lib/Index/IndexingContext.h | 2 + .../llvm-project/clang/lib/Index/USRGeneration.cpp | 7 +- .../clang/lib/Interpreter/IncrementalExecutor.cpp | 63 + .../clang/lib/Interpreter/IncrementalExecutor.h | 48 + .../clang/lib/Interpreter/IncrementalParser.cpp | 292 + .../clang/lib/Interpreter/IncrementalParser.h | 77 + .../clang/lib/Interpreter/Interpreter.cpp | 225 + .../Lex/DependencyDirectivesSourceMinimizer.cpp | 6 +- contrib/llvm-project/clang/lib/Lex/HeaderMap.cpp | 31 +- .../llvm-project/clang/lib/Lex/HeaderSearch.cpp | 19 +- contrib/llvm-project/clang/lib/Lex/Lexer.cpp | 118 +- .../llvm-project/clang/lib/Lex/LiteralSupport.cpp | 113 +- contrib/llvm-project/clang/lib/Lex/ModuleMap.cpp | 58 +- contrib/llvm-project/clang/lib/Lex/PPCaching.cpp | 2 +- .../clang/lib/Lex/PPConditionalDirectiveRecord.cpp | 22 + .../llvm-project/clang/lib/Lex/PPDirectives.cpp | 215 +- .../llvm-project/clang/lib/Lex/PPExpressions.cpp | 16 +- .../clang/lib/Lex/PPMacroExpansion.cpp | 15 +- contrib/llvm-project/clang/lib/Lex/Pragma.cpp | 62 +- .../clang/lib/Lex/PreprocessingRecord.cpp | 17 + .../llvm-project/clang/lib/Lex/Preprocessor.cpp | 12 +- contrib/llvm-project/clang/lib/Lex/TokenLexer.cpp | 11 +- .../clang/lib/Parse/ParseCXXInlineMethods.cpp | 1 + contrib/llvm-project/clang/lib/Parse/ParseDecl.cpp | 177 +- .../llvm-project/clang/lib/Parse/ParseDeclCXX.cpp | 428 +- contrib/llvm-project/clang/lib/Parse/ParseExpr.cpp | 51 +- .../llvm-project/clang/lib/Parse/ParseExprCXX.cpp | 328 +- contrib/llvm-project/clang/lib/Parse/ParseInit.cpp | 28 +- contrib/llvm-project/clang/lib/Parse/ParseObjc.cpp | 94 +- .../llvm-project/clang/lib/Parse/ParseOpenMP.cpp | 425 +- .../llvm-project/clang/lib/Parse/ParsePragma.cpp | 30 +- contrib/llvm-project/clang/lib/Parse/ParseStmt.cpp | 80 +- .../llvm-project/clang/lib/Parse/ParseStmtAsm.cpp | 17 +- .../clang/lib/Parse/ParseTentative.cpp | 2 +- contrib/llvm-project/clang/lib/Parse/Parser.cpp | 37 +- .../llvm-project/clang/lib/Rewrite/DeltaTree.cpp | 5 +- .../clang/lib/Sema/AnalysisBasedWarnings.cpp | 158 +- .../clang/lib/Sema/CodeCompleteConsumer.cpp | 2 +- contrib/llvm-project/clang/lib/Sema/DeclSpec.cpp | 5 +- .../clang/lib/Sema/JumpDiagnostics.cpp | 41 +- .../clang/lib/Sema/MultiplexExternalSemaSource.cpp | 3 +- .../llvm-project/clang/lib/Sema/OpenCLBuiltins.td | 560 +- contrib/llvm-project/clang/lib/Sema/ParsedAttr.cpp | 40 + contrib/llvm-project/clang/lib/Sema/Sema.cpp | 324 +- contrib/llvm-project/clang/lib/Sema/SemaAccess.cpp | 35 +- contrib/llvm-project/clang/lib/Sema/SemaAttr.cpp | 94 +- .../clang/lib/Sema/SemaAvailability.cpp | 33 +- contrib/llvm-project/clang/lib/Sema/SemaCUDA.cpp | 156 +- .../clang/lib/Sema/SemaCXXScopeSpec.cpp | 40 +- contrib/llvm-project/clang/lib/Sema/SemaCast.cpp | 191 +- .../llvm-project/clang/lib/Sema/SemaChecking.cpp | 834 +- .../clang/lib/Sema/SemaCodeComplete.cpp | 195 +- .../llvm-project/clang/lib/Sema/SemaConcept.cpp | 62 +- .../llvm-project/clang/lib/Sema/SemaCoroutine.cpp | 59 +- contrib/llvm-project/clang/lib/Sema/SemaDecl.cpp | 656 +- .../llvm-project/clang/lib/Sema/SemaDeclAttr.cpp | 842 +- .../llvm-project/clang/lib/Sema/SemaDeclCXX.cpp | 774 +- .../llvm-project/clang/lib/Sema/SemaDeclObjC.cpp | 15 +- .../clang/lib/Sema/SemaExceptionSpec.cpp | 18 +- contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp | 871 +- .../llvm-project/clang/lib/Sema/SemaExprCXX.cpp | 403 +- .../llvm-project/clang/lib/Sema/SemaExprMember.cpp | 28 +- .../llvm-project/clang/lib/Sema/SemaExprObjC.cpp | 30 +- .../llvm-project/clang/lib/Sema/SemaFixItUtils.cpp | 4 +- contrib/llvm-project/clang/lib/Sema/SemaInit.cpp | 246 +- contrib/llvm-project/clang/lib/Sema/SemaLambda.cpp | 23 +- contrib/llvm-project/clang/lib/Sema/SemaLookup.cpp | 194 +- .../clang/lib/Sema/SemaObjCProperty.cpp | 44 +- contrib/llvm-project/clang/lib/Sema/SemaOpenMP.cpp | 2332 +- .../llvm-project/clang/lib/Sema/SemaOverload.cpp | 168 +- .../clang/lib/Sema/SemaPseudoObject.cpp | 6 +- contrib/llvm-project/clang/lib/Sema/SemaSYCL.cpp | 33 + contrib/llvm-project/clang/lib/Sema/SemaStmt.cpp | 797 +- .../llvm-project/clang/lib/Sema/SemaStmtAsm.cpp | 21 +- .../llvm-project/clang/lib/Sema/SemaStmtAttr.cpp | 135 +- .../llvm-project/clang/lib/Sema/SemaTemplate.cpp | 82 +- .../clang/lib/Sema/SemaTemplateDeduction.cpp | 34 +- .../clang/lib/Sema/SemaTemplateInstantiate.cpp | 17 +- .../clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 339 +- contrib/llvm-project/clang/lib/Sema/SemaType.cpp | 295 +- .../llvm-project/clang/lib/Sema/TreeTransform.h | 521 +- .../clang/lib/Serialization/ASTCommon.cpp | 7 + .../clang/lib/Serialization/ASTReader.cpp | 340 +- .../clang/lib/Serialization/ASTReaderDecl.cpp | 38 +- .../clang/lib/Serialization/ASTReaderStmt.cpp | 88 +- .../clang/lib/Serialization/ASTWriter.cpp | 216 +- .../clang/lib/Serialization/ASTWriterDecl.cpp | 22 +- .../clang/lib/Serialization/ASTWriterStmt.cpp | 56 +- .../lib/Serialization/ModuleFileExtension.cpp | 2 + .../StaticAnalyzer/Checkers/ArrayBoundChecker.cpp | 2 +- .../Checkers/ArrayBoundCheckerV2.cpp | 4 +- .../Checkers/BuiltinFunctionChecker.cpp | 10 +- .../lib/StaticAnalyzer/Checkers/CStringChecker.cpp | 10 +- .../StaticAnalyzer/Checkers/CastSizeChecker.cpp | 4 +- .../StaticAnalyzer/Checkers/CheckPlacementNew.cpp | 4 +- .../StaticAnalyzer/Checkers/ContainerModeling.cpp | 4 +- .../StaticAnalyzer/Checkers/DeadStoresChecker.cpp | 38 +- .../StaticAnalyzer/Checkers/DereferenceChecker.cpp | 2 +- .../Checkers/ExprInspectionChecker.cpp | 136 +- .../Checkers/GCDAntipatternChecker.cpp | 2 +- .../Checkers/InnerPointerChecker.cpp | 80 +- .../clang/lib/StaticAnalyzer/Checkers/Iterator.cpp | 4 +- .../Checkers/IteratorRangeChecker.cpp | 2 +- .../lib/StaticAnalyzer/Checkers/MIGChecker.cpp | 5 +- .../Checkers/MPI-Checker/MPIChecker.cpp | 2 +- .../lib/StaticAnalyzer/Checkers/MallocChecker.cpp | 90 +- .../Checkers/MallocSizeofChecker.cpp | 4 + .../lib/StaticAnalyzer/Checkers/MoveChecker.cpp | 11 +- .../Checkers/NonnullGlobalConstantsChecker.cpp | 4 +- .../StaticAnalyzer/Checkers/NullabilityChecker.cpp | 2 +- .../StaticAnalyzer/Checkers/OSObjectCStyleCast.cpp | 53 +- .../Checkers/ObjCAutoreleaseWriteChecker.cpp | 2 +- .../Checkers/ObjCContainersChecker.cpp | 5 +- .../lib/StaticAnalyzer/Checkers/PaddingChecker.cpp | 7 +- .../StaticAnalyzer/Checkers/PthreadLockChecker.cpp | 15 +- .../RetainCountChecker/RetainCountDiagnostics.cpp | 172 +- .../RetainCountChecker/RetainCountDiagnostics.h | 13 +- .../Checkers/ReturnPointerRangeChecker.cpp | 2 +- .../Checkers/RunLoopAutoreleaseLeakChecker.cpp | 4 +- .../clang/lib/StaticAnalyzer/Checkers/SmartPtr.h | 4 + .../StaticAnalyzer/Checkers/SmartPtrModeling.cpp | 376 +- .../Checkers/StdLibraryFunctionsChecker.cpp | 202 +- .../lib/StaticAnalyzer/Checkers/StreamChecker.cpp | 111 +- .../Checkers/UndefCapturedBlockVarChecker.cpp | 6 +- .../StaticAnalyzer/Checkers/UndefResultChecker.cpp | 2 +- .../Checkers/UnreachableCodeChecker.cpp | 2 +- .../lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp | 20 +- .../lib/StaticAnalyzer/Core/BasicValueFactory.cpp | 62 +- .../clang/lib/StaticAnalyzer/Core/BugReporter.cpp | 57 +- .../StaticAnalyzer/Core/BugReporterVisitors.cpp | 1130 +- .../clang/lib/StaticAnalyzer/Core/CallEvent.cpp | 43 +- .../lib/StaticAnalyzer/Core/CheckerContext.cpp | 4 + .../lib/StaticAnalyzer/Core/CheckerHelpers.cpp | 34 + .../lib/StaticAnalyzer/Core/CheckerManager.cpp | 29 +- .../StaticAnalyzer/Core/CommonBugCategories.cpp | 2 + .../clang/lib/StaticAnalyzer/Core/CoreEngine.cpp | 6 +- .../Core/{DynamicSize.cpp => DynamicExtent.cpp} | 51 +- .../clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | 13 +- .../clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp | 41 +- .../Core/ExprEngineCallAndReturn.cpp | 31 +- .../lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp | 53 +- .../lib/StaticAnalyzer/Core/LoopUnrolling.cpp | 77 +- .../clang/lib/StaticAnalyzer/Core/MemRegion.cpp | 12 +- .../lib/StaticAnalyzer/Core/PlistDiagnostics.cpp | 644 +- .../StaticAnalyzer/Core/RangeConstraintManager.cpp | 1377 +- .../Core/RangedConstraintManager.cpp | 22 +- .../clang/lib/StaticAnalyzer/Core/RegionStore.cpp | 9 +- .../clang/lib/StaticAnalyzer/Core/SValBuilder.cpp | 532 +- .../clang/lib/StaticAnalyzer/Core/SVals.cpp | 59 + .../lib/StaticAnalyzer/Core/SarifDiagnostics.cpp | 8 +- .../lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp | 159 +- .../clang/lib/StaticAnalyzer/Core/Store.cpp | 49 +- .../lib/StaticAnalyzer/Core/TextDiagnostics.cpp | 11 +- .../StaticAnalyzer/Frontend/AnalysisConsumer.cpp | 109 +- .../clang/lib/Tooling/ArgumentsAdjusters.cpp | 21 +- .../clang/lib/Tooling/CommonOptionsParser.cpp | 3 +- .../clang/lib/Tooling/Core/Diagnostic.cpp | 5 +- .../DependencyScanningFilesystem.cpp | 43 +- .../DependencyScanningService.cpp | 9 +- .../DependencyScanning/DependencyScanningTool.cpp | 71 +- .../DependencyScanningWorker.cpp | 155 +- .../DependencyScanning/ModuleDepCollector.cpp | 209 +- .../clang/lib/Tooling/DumpTool/APIData.h | 31 + .../lib/Tooling/DumpTool/ASTSrcLocProcessor.cpp | 271 + .../lib/Tooling/DumpTool/ASTSrcLocProcessor.h | 53 + .../clang/lib/Tooling/DumpTool/ClangSrcLocDump.cpp | 159 + .../lib/Tooling/EmptyNodeIntrospection.inc.in | 48 + .../ExpandResponseFilesCompilationDatabase.cpp | 7 +- .../lib/Tooling/Inclusions/HeaderIncludes.cpp | 4 +- .../Tooling/InterpolatingCompilationDatabase.cpp | 41 +- .../clang/lib/Tooling/JSONCompilationDatabase.cpp | 2 +- .../clang/lib/Tooling/NodeIntrospection.cpp | 88 + .../Tooling/Refactoring/Rename/USRLocFinder.cpp | 18 + .../clang/lib/Tooling/Syntax/BuildTree.cpp | 38 +- .../clang/lib/Tooling/Syntax/Tokens.cpp | 32 + contrib/llvm-project/clang/lib/Tooling/Tooling.cpp | 68 +- .../lib/Tooling/Transformer/RangeSelector.cpp | 11 +- .../lib/Tooling/Transformer/SourceCodeBuilders.cpp | 2 + .../clang/lib/Tooling/Transformer/Stencil.cpp | 627 +- .../clang/tools/amdgpu-arch/AMDGPUArch.cpp | 78 + .../clang/tools/clang-format/ClangFormat.cpp | 22 +- .../clang/tools/clang-repl/ClangRepl.cpp | 108 + .../llvm-project/clang/tools/driver/cc1_main.cpp | 6 + .../llvm-project/clang/tools/driver/cc1as_main.cpp | 61 +- .../clang/tools/driver/cc1gen_reproducer_main.cpp | 2 +- contrib/llvm-project/clang/tools/driver/driver.cpp | 97 +- .../clang/utils/TableGen/ClangAttrEmitter.cpp | 417 +- .../utils/TableGen/ClangDiagnosticsEmitter.cpp | 219 +- .../clang/utils/TableGen/ClangOpcodesEmitter.cpp | 51 +- .../utils/TableGen/ClangOpenCLBuiltinEmitter.cpp | 464 +- .../clang/utils/TableGen/MveEmitter.cpp | 13 +- .../clang/utils/TableGen/NeonEmitter.cpp | 6 +- .../clang/utils/TableGen/RISCVVEmitter.cpp | 1269 + .../clang/utils/TableGen/SveEmitter.cpp | 37 +- .../llvm-project/clang/utils/TableGen/TableGen.cpp | 24 + .../clang/utils/TableGen/TableGenBackends.h | 6 + contrib/llvm-project/compiler-rt/.clang-tidy | 4 +- .../include/fuzzer/FuzzedDataProvider.h | 3 +- .../compiler-rt/include/profile/InstrProfData.inc | 15 +- .../include/sanitizer/dfsan_interface.h | 111 +- .../compiler-rt/include/sanitizer/tsan_interface.h | 17 +- .../include/sanitizer/tsan_interface_atomic.h | 2 +- .../compiler-rt/lib/asan/asan_allocator.cpp | 14 +- .../compiler-rt/lib/asan/asan_descriptions.cpp | 19 +- .../compiler-rt/lib/asan/asan_descriptions.h | 13 +- .../compiler-rt/lib/asan/asan_errors.cpp | 8 +- .../compiler-rt/lib/asan/asan_fake_stack.cpp | 52 +- .../compiler-rt/lib/asan/asan_flags.cpp | 4 - .../compiler-rt/lib/asan/asan_flags.inc | 3 +- .../compiler-rt/lib/asan/asan_fuchsia.cpp | 2 +- .../{asan_blacklist.txt => asan_ignorelist.txt} | 6 +- .../compiler-rt/lib/asan/asan_interceptors.cpp | 33 +- .../compiler-rt/lib/asan/asan_interceptors.h | 11 +- .../lib/asan/asan_interceptors_memintrinsics.cpp | 6 +- .../compiler-rt/lib/asan/asan_interface.inc | 11 + .../compiler-rt/lib/asan/asan_internal.h | 15 +- .../compiler-rt/lib/asan/asan_malloc_linux.cpp | 36 +- .../compiler-rt/lib/asan/asan_malloc_local.h | 52 - .../compiler-rt/lib/asan/asan_mapping.h | 52 +- .../compiler-rt/lib/asan/asan_mapping_myriad.h | 85 - .../compiler-rt/lib/asan/asan_new_delete.cpp | 22 +- .../compiler-rt/lib/asan/asan_poisoning.cpp | 21 +- .../compiler-rt/lib/asan/asan_poisoning.h | 3 - .../compiler-rt/lib/asan/asan_posix.cpp | 2 +- .../compiler-rt/lib/asan/asan_rtems.cpp | 266 - .../llvm-project/compiler-rt/lib/asan/asan_rtl.cpp | 75 +- .../compiler-rt/lib/asan/asan_shadow_setup.cpp | 11 +- .../compiler-rt/lib/asan/asan_stack.cpp | 3 +- .../llvm-project/compiler-rt/lib/asan/asan_stack.h | 9 - .../compiler-rt/lib/asan/asan_thread.cpp | 88 +- .../compiler-rt/lib/asan/asan_thread.h | 18 +- .../compiler-rt/lib/builtins/aarch64/fp_mode.c | 13 +- .../compiler-rt/lib/builtins/arm/fp_mode.c | 15 +- .../compiler-rt/lib/builtins/assembly.h | 9 +- .../llvm-project/compiler-rt/lib/builtins/atomic.c | 8 +- .../compiler-rt/lib/builtins/clear_cache.c | 3 + .../compiler-rt/lib/builtins/comparedf2.c | 84 +- .../compiler-rt/lib/builtins/comparesf2.c | 84 +- .../compiler-rt/lib/builtins/comparetf2.c | 81 +- .../compiler-rt/lib/builtins/cpu_model.c | 8 + .../llvm-project/compiler-rt/lib/builtins/divdc3.c | 12 +- .../llvm-project/compiler-rt/lib/builtins/divsc3.c | 11 +- .../llvm-project/compiler-rt/lib/builtins/divtc3.c | 11 +- .../compiler-rt/lib/builtins/fixdfdi.c | 2 +- .../compiler-rt/lib/builtins/fixsfdi.c | 2 +- .../compiler-rt/lib/builtins/fixunsdfdi.c | 2 +- .../compiler-rt/lib/builtins/fixunssfdi.c | 2 +- .../compiler-rt/lib/builtins/floatdidf.c | 2 +- .../compiler-rt/lib/builtins/floatundidf.c | 2 +- .../compiler-rt/lib/builtins/fp_add_impl.inc | 8 +- .../compiler-rt/lib/builtins/fp_compare_impl.inc | 116 + .../llvm-project/compiler-rt/lib/builtins/fp_lib.h | 95 +- .../compiler-rt/lib/builtins/fp_mode.c | 4 +- .../compiler-rt/lib/builtins/fp_mode.h | 12 +- .../compiler-rt/lib/builtins/gcc_personality_v0.c | 33 +- .../compiler-rt/lib/builtins/i386/fp_mode.c | 12 +- .../compiler-rt/lib/builtins/int_lib.h | 22 +- .../compiler-rt/lib/builtins/int_math.h | 8 - .../compiler-rt/lib/builtins/int_types.h | 12 +- .../compiler-rt/lib/builtins/int_util.c | 22 +- .../compiler-rt/lib/builtins/ppc/atomic.exp | 41 + .../compiler-rt/lib/builtins/ppc/divtc3.c | 19 +- .../compiler-rt/lib/builtins/riscv/restore.S | 166 + .../compiler-rt/lib/builtins/riscv/save.S | 184 + contrib/llvm-project/compiler-rt/lib/cfi/cfi.cpp | 4 +- .../cfi/{cfi_blacklist.txt => cfi_ignorelist.txt} | 0 .../llvm-project/compiler-rt/lib/dfsan/dfsan.cpp | 1130 +- contrib/llvm-project/compiler-rt/lib/dfsan/dfsan.h | 70 +- .../compiler-rt/lib/dfsan/dfsan.syms.extra | 1 + .../compiler-rt/lib/dfsan/dfsan_allocator.cpp | 287 + .../compiler-rt/lib/dfsan/dfsan_allocator.h | 30 + .../lib/dfsan/dfsan_chained_origin_depot.cpp | 22 + .../lib/dfsan/dfsan_chained_origin_depot.h | 26 + .../compiler-rt/lib/dfsan/dfsan_custom.cpp | 1551 +- .../compiler-rt/lib/dfsan/dfsan_flags.h | 32 + .../compiler-rt/lib/dfsan/dfsan_flags.inc | 20 +- .../compiler-rt/lib/dfsan/dfsan_interceptors.cpp | 199 +- .../compiler-rt/lib/dfsan/dfsan_new_delete.cpp | 124 + .../compiler-rt/lib/dfsan/dfsan_origin.h | 127 + .../compiler-rt/lib/dfsan/dfsan_platform.h | 133 +- .../compiler-rt/lib/dfsan/dfsan_thread.cpp | 146 + .../compiler-rt/lib/dfsan/dfsan_thread.h | 83 + .../compiler-rt/lib/dfsan/done_abilist.txt | 68 +- .../compiler-rt/lib/fuzzer/FuzzerBuiltins.h | 1 - .../compiler-rt/lib/fuzzer/FuzzerBuiltinsMsvc.h | 6 - .../compiler-rt/lib/fuzzer/FuzzerCorpus.h | 38 +- .../compiler-rt/lib/fuzzer/FuzzerDataFlowTrace.cpp | 4 +- .../compiler-rt/lib/fuzzer/FuzzerDataFlowTrace.h | 14 +- .../compiler-rt/lib/fuzzer/FuzzerDictionary.h | 8 +- .../compiler-rt/lib/fuzzer/FuzzerDriver.cpp | 12 +- .../compiler-rt/lib/fuzzer/FuzzerFork.cpp | 11 +- .../compiler-rt/lib/fuzzer/FuzzerIO.cpp | 11 +- .../llvm-project/compiler-rt/lib/fuzzer/FuzzerIO.h | 5 +- .../compiler-rt/lib/fuzzer/FuzzerInterceptors.cpp | 1 + .../compiler-rt/lib/fuzzer/FuzzerLoop.cpp | 30 +- .../compiler-rt/lib/fuzzer/FuzzerMerge.cpp | 8 +- .../compiler-rt/lib/fuzzer/FuzzerMutate.cpp | 48 +- .../compiler-rt/lib/fuzzer/FuzzerRandom.h | 23 +- .../compiler-rt/lib/fuzzer/FuzzerSHA1.cpp | 9 +- .../compiler-rt/lib/fuzzer/FuzzerTracePC.cpp | 11 +- .../compiler-rt/lib/fuzzer/FuzzerTracePC.h | 39 +- .../compiler-rt/lib/fuzzer/FuzzerUtil.cpp | 9 +- .../compiler-rt/lib/fuzzer/FuzzerUtil.h | 6 +- .../compiler-rt/lib/fuzzer/FuzzerUtilFuchsia.cpp | 2 +- .../compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp | 11 +- .../compiler-rt/lib/gwp_asan/common.cpp | 2 +- .../llvm-project/compiler-rt/lib/gwp_asan/common.h | 6 +- .../compiler-rt/lib/gwp_asan/crash_handler.cpp | 2 +- .../lib/gwp_asan/guarded_pool_allocator.cpp | 118 +- .../lib/gwp_asan/guarded_pool_allocator.h | 28 +- .../lib/gwp_asan/optional/backtrace_fuchsia.cpp | 10 +- .../compiler-rt/lib/gwp_asan/options.inc | 10 - .../guarded_pool_allocator_fuchsia.cpp | 5 +- .../gwp_asan/platform_specific/utilities_posix.cpp | 3 + .../compiler-rt/lib/gwp_asan/utilities.cpp | 63 - .../compiler-rt/lib/gwp_asan/utilities.h | 13 - .../llvm-project/compiler-rt/lib/hwasan/hwasan.cpp | 96 +- .../llvm-project/compiler-rt/lib/hwasan/hwasan.h | 79 +- .../lib/hwasan/hwasan_allocation_functions.cpp | 172 + .../compiler-rt/lib/hwasan/hwasan_allocator.cpp | 59 +- .../compiler-rt/lib/hwasan/hwasan_allocator.h | 20 +- .../compiler-rt/lib/hwasan/hwasan_blacklist.txt | 7 - .../compiler-rt/lib/hwasan/hwasan_checks.h | 5 +- .../lib/hwasan/hwasan_dynamic_shadow.cpp | 25 +- .../compiler-rt/lib/hwasan/hwasan_flags.h | 2 + .../compiler-rt/lib/hwasan/hwasan_flags.inc | 9 + .../compiler-rt/lib/hwasan/hwasan_fuchsia.cpp | 213 + .../compiler-rt/lib/hwasan/hwasan_ignorelist.txt | 7 + .../compiler-rt/lib/hwasan/hwasan_interceptors.cpp | 185 +- .../lib/hwasan/hwasan_interceptors_vfork.S | 3 + .../compiler-rt/lib/hwasan/hwasan_linux.cpp | 169 +- .../compiler-rt/lib/hwasan/hwasan_mapping.h | 15 +- .../lib/hwasan/hwasan_memintrinsics.cpp | 4 +- .../compiler-rt/lib/hwasan/hwasan_new_delete.cpp | 72 +- .../compiler-rt/lib/hwasan/hwasan_poisoning.cpp | 24 - .../compiler-rt/lib/hwasan/hwasan_report.cpp | 212 +- .../compiler-rt/lib/hwasan/hwasan_setjmp.S | 6 + .../lib/hwasan/hwasan_tag_mismatch_aarch64.S | 6 + .../compiler-rt/lib/hwasan/hwasan_thread.cpp | 36 +- .../compiler-rt/lib/hwasan/hwasan_thread.h | 13 +- .../compiler-rt/lib/hwasan/hwasan_thread_list.cpp | 2 +- .../compiler-rt/lib/hwasan/hwasan_thread_list.h | 37 +- .../compiler-rt/lib/interception/interception.h | 33 +- contrib/llvm-project/compiler-rt/lib/lsan/lsan.cpp | 14 +- .../compiler-rt/lib/lsan/lsan_allocator.cpp | 16 +- .../compiler-rt/lib/lsan/lsan_allocator.h | 2 +- .../compiler-rt/lib/lsan/lsan_common.cpp | 2 +- .../compiler-rt/lib/lsan/lsan_common.h | 8 +- .../compiler-rt/lib/lsan/lsan_interceptors.cpp | 2 +- .../compiler-rt/lib/lsan/lsan_posix.cpp | 6 +- .../compiler-rt/lib/lsan/lsan_thread.cpp | 9 +- .../compiler-rt/lib/memprof/memprof_allocator.cpp | 4 +- .../compiler-rt/lib/memprof/memprof_allocator.h | 1 - .../lib/memprof/memprof_descriptions.cpp | 4 +- .../lib/memprof/memprof_interceptors.cpp | 2 + .../compiler-rt/lib/memprof/memprof_interceptors.h | 6 + .../compiler-rt/lib/memprof/memprof_rtl.cpp | 18 +- .../compiler-rt/lib/memprof/memprof_stack.h | 9 - .../compiler-rt/lib/memprof/memprof_thread.cpp | 12 +- .../compiler-rt/lib/memprof/memprof_thread.h | 3 - contrib/llvm-project/compiler-rt/lib/msan/msan.cpp | 14 +- contrib/llvm-project/compiler-rt/lib/msan/msan.h | 10 - .../compiler-rt/lib/msan/msan_allocator.cpp | 6 +- .../compiler-rt/lib/msan/msan_allocator.h | 1 - .../compiler-rt/lib/msan/msan_blacklist.txt | 10 - .../lib/msan/msan_chained_origin_depot.cpp | 103 +- .../lib/msan/msan_chained_origin_depot.h | 14 +- .../compiler-rt/lib/msan/msan_ignorelist.txt | 10 + .../compiler-rt/lib/msan/msan_interceptors.cpp | 21 +- .../compiler-rt/lib/msan/msan_poisoning.cpp | 2 +- contrib/llvm-project/compiler-rt/lib/orc/adt.h | 113 + contrib/llvm-project/compiler-rt/lib/orc/c_api.h | 208 + contrib/llvm-project/compiler-rt/lib/orc/common.h | 48 + .../llvm-project/compiler-rt/lib/orc/compiler.h | 65 + .../llvm-project/compiler-rt/lib/orc/endianness.h | 143 + contrib/llvm-project/compiler-rt/lib/orc/error.h | 428 + .../compiler-rt/lib/orc/executor_address.h | 208 + .../compiler-rt/lib/orc/extensible_rtti.cpp | 24 + .../compiler-rt/lib/orc/extensible_rtti.h | 145 + .../lib/orc/log_error_to_stderr.cpp} | 13 +- .../compiler-rt/lib/orc/macho_platform.cpp | 731 + .../compiler-rt/lib/orc/macho_platform.h | 135 + .../compiler-rt/lib/orc/macho_tlv.x86-64.S | 68 + .../compiler-rt/lib/orc/run_program_wrapper.cpp | 51 + .../lib/orc/simple_packed_serialization.h | 579 + .../llvm-project/compiler-rt/lib/orc/stl_extras.h | 46 + .../compiler-rt/lib/orc/wrapper_function_utils.h | 367 + .../compiler-rt/lib/profile/GCDAProfiling.c | 29 +- .../compiler-rt/lib/profile/InstrProfiling.h | 19 +- .../lib/profile/InstrProfilingBiasVar.c | 15 - .../compiler-rt/lib/profile/InstrProfilingBuffer.c | 11 +- .../compiler-rt/lib/profile/InstrProfilingFile.c | 339 +- .../lib/profile/InstrProfilingInternal.c | 10 - .../lib/profile/InstrProfilingInternal.h | 10 +- .../compiler-rt/lib/profile/InstrProfilingMerge.c | 46 +- .../lib/profile/InstrProfilingPlatformDarwin.c | 6 + .../lib/profile/InstrProfilingPlatformFuchsia.c | 33 +- .../lib/profile/InstrProfilingPlatformLinux.c | 138 +- .../lib/profile/InstrProfilingPlatformOther.c | 5 + .../lib/profile/InstrProfilingPlatformWindows.c | 5 + .../compiler-rt/lib/profile/InstrProfilingPort.h | 2 + .../compiler-rt/lib/profile/InstrProfilingUtil.c | 27 +- .../compiler-rt/lib/profile/InstrProfilingUtil.h | 11 + .../compiler-rt/lib/profile/InstrProfilingWriter.c | 16 +- .../compiler-rt/lib/profile/WindowsMMap.c | 12 + .../compiler-rt/lib/profile/WindowsMMap.h | 10 + .../lib/sanitizer_common/sanitizer_addrhashmap.h | 106 +- *** 114012 LINES SKIPPED *** From nobody Sat Nov 13 20:56:26 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 08815184F4DD; Sat, 13 Nov 2021 20:56:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs76R3bqpz3nqt; Sat, 13 Nov 2021 20:56:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E93401A2F3; Sat, 13 Nov 2021 20:56:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ADKuU73017362; Sat, 13 Nov 2021 20:56:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ADKuQJN017355; Sat, 13 Nov 2021 20:56:26 GMT (envelope-from git) Date: Sat, 13 Nov 2021 20:56:26 GMT Message-Id: <202111132056.1ADKuQJN017355@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 6e75b2fbf9a0 - main - Merge llvm-project release/13.x llvmorg-13.0.0-rc1-97-g23ba3732246a List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6e75b2fbf9a03e6876e0a3c089e0b3ad71876125 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=6e75b2fbf9a03e6876e0a3c089e0b3ad71876125 commit 6e75b2fbf9a03e6876e0a3c089e0b3ad71876125 Merge: fe6060f10f63 d545c2ce5ad1 Author: Dimitry Andric AuthorDate: 2021-08-25 18:31:14 +0000 Commit: Dimitry Andric CommitDate: 2021-11-13 20:42:03 +0000 Merge llvm-project release/13.x llvmorg-13.0.0-rc1-97-g23ba3732246a This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-13.0.0-rc1-97-g23ba3732246a. PR: 258209 MFC after: 2 weeks ObsoleteFiles.inc | 146 +++ .../clang/include/clang/Basic/BuiltinsAArch64.def | 3 + .../include/clang/Basic/DiagnosticDriverKinds.td | 2 - .../include/clang/Basic/DiagnosticLexKinds.td | 7 + .../include/clang/Basic/DiagnosticSemaKinds.td | 2 - .../clang/include/clang/Basic/LangOptions.def | 2 +- .../clang/include/clang/Basic/LangOptions.h | 6 + .../clang/include/clang/Driver/Options.td | 9 +- .../clang/include/clang/Driver/Types.h | 8 - .../clang/Frontend/PreprocessorOutputOptions.h | 2 - .../clang/include/clang/Lex/HeaderSearch.h | 17 +- .../clang/include/clang/Lex/Preprocessor.h | 5 +- .../clang/include/clang/Lex/PreprocessorLexer.h | 20 +- .../clang/include/clang/Lex/PreprocessorOptions.h | 3 - .../llvm-project/clang/include/clang/Sema/Sema.h | 3 +- contrib/llvm-project/clang/lib/AST/ASTContext.cpp | 20 +- contrib/llvm-project/clang/lib/AST/Expr.cpp | 7 +- .../llvm-project/clang/lib/Basic/LangOptions.cpp | 8 + .../llvm-project/clang/lib/Basic/OpenCLOptions.cpp | 7 +- .../llvm-project/clang/lib/Basic/TargetInfo.cpp | 10 +- .../clang/lib/Basic/Targets/AArch64.cpp | 6 +- .../llvm-project/clang/lib/Basic/Targets/AMDGPU.h | 5 +- .../llvm-project/clang/lib/CodeGen/CGBuiltin.cpp | 23 + .../llvm-project/clang/lib/CodeGen/CGDeclCXX.cpp | 18 +- contrib/llvm-project/clang/lib/CodeGen/CGStmt.cpp | 43 +- .../clang/lib/CodeGen/CodeGenModule.cpp | 2 +- .../llvm-project/clang/lib/CodeGen/TargetInfo.cpp | 14 + .../llvm-project/clang/lib/CodeGen/TargetInfo.h | 7 + .../clang/lib/Driver/ToolChains/Clang.cpp | 53 +- .../clang/lib/Driver/ToolChains/Hexagon.cpp | 32 +- .../clang/lib/Driver/ToolChains/MinGW.cpp | 7 +- contrib/llvm-project/clang/lib/Driver/Types.cpp | 39 - .../clang/lib/Format/WhitespaceManager.cpp | 2 +- .../clang/lib/Frontend/CompilerInvocation.cpp | 20 +- .../clang/lib/Frontend/PrintPreprocessedOutput.cpp | 349 +++---- contrib/llvm-project/clang/lib/Headers/intrin.h | 3 + contrib/llvm-project/clang/lib/Lex/Lexer.cpp | 4 +- .../llvm-project/clang/lib/Lex/PPDirectives.cpp | 4 + .../llvm-project/clang/lib/Lex/PPLexerChange.cpp | 45 +- .../clang/lib/Lex/PPMacroExpansion.cpp | 11 +- contrib/llvm-project/clang/lib/Lex/Pragma.cpp | 92 +- .../llvm-project/clang/lib/Lex/Preprocessor.cpp | 6 - contrib/llvm-project/clang/lib/Parse/ParseDecl.cpp | 16 +- contrib/llvm-project/clang/lib/Sema/Sema.cpp | 3 +- .../llvm-project/clang/lib/Sema/SemaConcept.cpp | 17 +- .../llvm-project/clang/lib/Sema/SemaDeclCXX.cpp | 5 +- .../llvm-project/clang/lib/Sema/SemaTemplate.cpp | 9 +- .../clang/lib/Sema/SemaTemplateInstantiate.cpp | 19 +- contrib/llvm-project/clang/lib/Sema/SemaType.cpp | 47 +- .../compiler-rt/include/profile/InstrProfData.inc | 4 +- .../compiler-rt/lib/profile/InstrProfilingBuffer.c | 2 +- .../compiler-rt/lib/profile/InstrProfilingMerge.c | 11 +- .../lib/profile/InstrProfilingPlatformLinux.c | 19 + contrib/llvm-project/libcxx/include/__config | 11 + contrib/llvm-project/libcxx/include/ctime | 2 +- contrib/llvm-project/libcxx/include/format | 12 +- contrib/llvm-project/libcxx/include/ios | 7 + contrib/llvm-project/libcxx/include/ranges | 12 +- contrib/llvm-project/lld/ELF/Config.h | 10 +- contrib/llvm-project/lld/ELF/Driver.cpp | 71 +- contrib/llvm-project/lld/ELF/LinkerScript.cpp | 36 +- contrib/llvm-project/lld/ELF/LinkerScript.h | 2 +- contrib/llvm-project/lld/ELF/Options.td | 3 + contrib/llvm-project/lld/ELF/Relocations.cpp | 7 + contrib/llvm-project/lld/ELF/ScriptParser.cpp | 9 +- contrib/llvm-project/lld/ELF/SymbolTable.cpp | 118 ++- contrib/llvm-project/lld/ELF/SymbolTable.h | 10 +- contrib/llvm-project/lld/ELF/Symbols.cpp | 11 +- contrib/llvm-project/lld/ELF/SyntheticSections.cpp | 2 +- contrib/llvm-project/lld/docs/ReleaseNotes.rst | 150 ++- contrib/llvm-project/lld/docs/ld.lld.1 | 3 + .../source/Commands/CommandObjectMemoryTag.cpp | 182 +++- .../llvm-project/lldb/source/Commands/Options.td | 8 + .../GDBRemoteCommunicationServerLLGS.cpp | 28 +- .../llvm/include/llvm/Analysis/ValueTracking.h | 4 + .../llvm/include/llvm/CodeGen/TargetLowering.h | 5 + .../llvm/include/llvm/CodeGen/ValueTypes.td | 1 + contrib/llvm-project/llvm/include/llvm/IR/Module.h | 3 + .../llvm/include/llvm/ProfileData/InstrProf.h | 1 + .../include/llvm/ProfileData/InstrProfData.inc | 4 +- .../llvm/include/llvm/Support/MachineValueType.h | 4 +- .../llvm/include/llvm/Transforms/IPO/Attributor.h | 20 + .../include/llvm/Transforms/Utils/PredicateInfo.h | 6 +- .../llvm/lib/Analysis/InstructionSimplify.cpp | 16 + .../llvm/lib/Analysis/TargetLibraryInfo.cpp | 7 +- .../llvm/lib/Analysis/ValueTracking.cpp | 10 + .../lib/CodeGen/GlobalISel/InlineAsmLowering.cpp | 9 +- .../llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 10 +- .../CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 6 +- .../lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 2 +- .../lib/CodeGen/SelectionDAG/TargetLowering.cpp | 3 +- .../lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 11 +- .../llvm-project/llvm/lib/CodeGen/ValueTypes.cpp | 2 + contrib/llvm-project/llvm/lib/IR/ConstantFold.cpp | 241 ----- contrib/llvm-project/llvm/lib/IR/Module.cpp | 4 + .../llvm/lib/ProfileData/InstrProfReader.cpp | 2 +- .../llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp | 7 + .../lib/Target/AArch64/AArch64ISelLowering.cpp | 79 +- .../llvm/lib/Target/AArch64/AArch64ISelLowering.h | 7 + .../llvm/lib/Target/AArch64/AArch64InstrInfo.cpp | 34 +- .../llvm/lib/Target/AArch64/AArch64InstrInfo.td | 14 + .../llvm/lib/Target/AArch64/AArch64RegisterInfo.td | 4 +- .../lib/Target/AArch64/Utils/AArch64BaseInfo.h | 19 + .../llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp | 2 +- .../llvm/lib/Target/BPF/BPFTargetTransformInfo.h | 18 + .../lib/Target/PowerPC/PPCTargetTransformInfo.cpp | 3 + .../llvm/lib/Target/RISCV/RISCVISelLowering.cpp | 7 + .../llvm/lib/Target/RISCV/RISCVInstrInfoV.td | 1003 ++++++++++++++------ .../llvm/lib/Target/RISCV/RISCVSchedRocket.td | 3 + .../llvm/lib/Target/RISCV/RISCVSchedSiFive7.td | 3 + .../llvm/lib/Target/RISCV/RISCVSchedule.td | 1 + .../llvm/lib/Target/RISCV/RISCVScheduleV.td | 820 ++++++++++++++++ .../llvm/lib/Target/X86/X86ISelLowering.cpp | 14 +- .../llvm/lib/Target/X86/X86InstrArithmetic.td | 28 +- .../llvm/lib/Transforms/IPO/Attributor.cpp | 117 ++- .../lib/Transforms/IPO/AttributorAttributes.cpp | 54 +- .../llvm/lib/Transforms/IPO/OpenMPOpt.cpp | 16 +- .../Transforms/InstCombine/InstCombineCompares.cpp | 123 ++- .../InstCombine/InstCombineLoadStoreAlloca.cpp | 8 +- .../Transforms/InstCombine/InstCombineSelect.cpp | 3 +- .../llvm/lib/Transforms/Scalar/DivRemPairs.cpp | 7 +- .../lib/Transforms/Scalar/LoopStrengthReduce.cpp | 24 +- .../llvm/lib/Transforms/Scalar/SROA.cpp | 5 +- .../llvm/lib/Transforms/Utils/PredicateInfo.cpp | 46 + .../lib/Transforms/Vectorize/LoopVectorize.cpp | 46 + .../llvm/tools/llvm-mca/Views/TimelineView.cpp | 15 +- .../llvm/utils/TableGen/CodeGenTarget.cpp | 1 + .../openmp/runtime/src/kmp_taskdeps.cpp | 27 +- .../llvm-project/openmp/runtime/src/kmp_taskdeps.h | 3 +- .../openmp/runtime/src/kmp_tasking.cpp | 1 + etc/mtree/BSD.include.dist | 18 +- lib/clang/include/VCSVersion.inc | 8 +- lib/clang/include/clang/Config/config.h | 2 +- lib/clang/include/llvm/Config/config.h | 7 +- lib/clang/include/llvm/Config/llvm-config.h | 2 +- lib/clang/include/llvm/Support/VCSRevision.h | 2 +- lib/libc++/Makefile | 293 +++++- lib/libc++/__config_site | 2 + lib/libc++experimental/Makefile | 1 + lib/libclang_rt/asan/Makefile | 2 + lib/libclang_rt/asan_dynamic/Makefile | 2 + lib/libclang_rt/cfi/Makefile | 1 + lib/libclang_rt/cfi_diag/Makefile | 2 + lib/libclang_rt/dd/Makefile | 1 + lib/libclang_rt/msan/Makefile | 2 + lib/libclang_rt/profile/Makefile | 2 +- lib/libclang_rt/stats/Makefile | 2 + lib/libclang_rt/tsan/Makefile | 4 +- lib/libclang_rt/ubsan_standalone/Makefile | 2 + lib/libclang_rt/xray/Makefile | 1 + lib/libcompiler_rt/Makefile.inc | 3 + lib/libomp/kmp_config.h | 6 +- lib/libomp/kmp_i18n_default.inc | 47 +- lib/libomp/kmp_i18n_id.inc | 59 +- lib/libomp/omp-tools.h | 201 ++++ lib/libomp/omp.h | 55 +- tools/build/mk/OptionalObsoleteFiles.inc | 357 ++++--- 157 files changed, 4432 insertions(+), 1503 deletions(-) diff --cc ObsoleteFiles.inc index 30104e6deedd,000000000000..aec721b740b9 mode 100644,000000..100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@@ -1,16044 -1,0 +1,16190 @@@ +# +# $FreeBSD$ +# +# This file lists old files (OLD_FILES), libraries (OLD_LIBS) and +# directories (OLD_DIRS) which should get removed at an update. Recently +# removed entries first (with the date as a comment). Dynamic libraries are +# special cased (OLD_LIBS). Static libraries or the generic links to +# the dynamic libraries (lib*.so) should (if you don't know why to make an +# exception, make this a "must") be viewed as normal files (OLD_FILES). +# +# In case of a complete directory hierarchy the sorting is in depth first +# order. +# +# Files that are installed or removed depending on some build option +# are to be listed in /usr/src/tools/build/mk/OptionalObsoleteFiles.inc +# instead of in this file. +# +# Before you commit changes to this file please check if any entries in +# tools/build/mk/OptionalObsoleteFiles.inc can be removed. The following +# command tells which files are listed more than once regardless of some +# architecture specific conditionals, so you can not blindly trust the +# output: +# ( grep '+=' /usr/src/ObsoleteFiles.inc | sort -u ; \ +# grep '+=' /usr/src/tools/build/mk/OptionalObsoleteFiles.inc | sort -u) | \ +# sort | uniq -d +# +# To find regular duplicates not dependent on optional components, you can +# also use something that will not give you false positives, e.g.: +# for t in `make -V TARGETS universe`; do +# __MAKE_CONF=/dev/null make -f Makefile.inc1 TARGET=$t \ +# -V OLD_FILES -V OLD_LIBS -V OLD_DIRS check-old | \ +# xargs -n1 | sort | uniq -d; +# done +# +# For optional components, you can use the following to see if some entries +# in OptionalObsoleteFiles.inc have been obsoleted by ObsoleteFiles.inc +# for o in tools/build/options/WITH*; do +# __MAKE_CONF=/dev/null make -f Makefile.inc1 -D${o##*/} \ +# -V OLD_FILES -V OLD_LIBS -V OLD_DIRS check-old | \ +# xargs -n1 | sort | uniq -d; +# done + +# 20211113: new clang import which bumps version from 12.0.1 to 13.0.0. +OLD_FILES+=usr/lib/clang/12.0.1/include/cuda_wrappers/algorithm +OLD_FILES+=usr/lib/clang/12.0.1/include/cuda_wrappers/complex +OLD_FILES+=usr/lib/clang/12.0.1/include/cuda_wrappers/new +OLD_DIRS+=usr/lib/clang/12.0.1/include/cuda_wrappers +OLD_FILES+=usr/lib/clang/12.0.1/include/fuzzer/FuzzedDataProvider.h +OLD_DIRS+=usr/lib/clang/12.0.1/include/fuzzer +OLD_FILES+=usr/lib/clang/12.0.1/include/openmp_wrappers/__clang_openmp_device_functions.h +OLD_FILES+=usr/lib/clang/12.0.1/include/openmp_wrappers/cmath +OLD_FILES+=usr/lib/clang/12.0.1/include/openmp_wrappers/complex +OLD_FILES+=usr/lib/clang/12.0.1/include/openmp_wrappers/complex.h +OLD_FILES+=usr/lib/clang/12.0.1/include/openmp_wrappers/complex_cmath.h +OLD_FILES+=usr/lib/clang/12.0.1/include/openmp_wrappers/math.h +OLD_FILES+=usr/lib/clang/12.0.1/include/openmp_wrappers/new +OLD_DIRS+=usr/lib/clang/12.0.1/include/openmp_wrappers +OLD_FILES+=usr/lib/clang/12.0.1/include/ppc_wrappers/emmintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/ppc_wrappers/mm_malloc.h +OLD_FILES+=usr/lib/clang/12.0.1/include/ppc_wrappers/mmintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/ppc_wrappers/pmmintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/ppc_wrappers/smmintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/ppc_wrappers/tmmintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/ppc_wrappers/xmmintrin.h +OLD_DIRS+=usr/lib/clang/12.0.1/include/ppc_wrappers +OLD_FILES+=usr/lib/clang/12.0.1/include/profile/InstrProfData.inc +OLD_DIRS+=usr/lib/clang/12.0.1/include/profile +OLD_FILES+=usr/lib/clang/12.0.1/include/sanitizer/allocator_interface.h +OLD_FILES+=usr/lib/clang/12.0.1/include/sanitizer/asan_interface.h +OLD_FILES+=usr/lib/clang/12.0.1/include/sanitizer/common_interface_defs.h +OLD_FILES+=usr/lib/clang/12.0.1/include/sanitizer/coverage_interface.h +OLD_FILES+=usr/lib/clang/12.0.1/include/sanitizer/dfsan_interface.h +OLD_FILES+=usr/lib/clang/12.0.1/include/sanitizer/hwasan_interface.h +OLD_FILES+=usr/lib/clang/12.0.1/include/sanitizer/linux_syscall_hooks.h +OLD_FILES+=usr/lib/clang/12.0.1/include/sanitizer/lsan_interface.h +OLD_FILES+=usr/lib/clang/12.0.1/include/sanitizer/msan_interface.h +OLD_FILES+=usr/lib/clang/12.0.1/include/sanitizer/netbsd_syscall_hooks.h +OLD_FILES+=usr/lib/clang/12.0.1/include/sanitizer/scudo_interface.h +OLD_FILES+=usr/lib/clang/12.0.1/include/sanitizer/tsan_interface.h +OLD_FILES+=usr/lib/clang/12.0.1/include/sanitizer/tsan_interface_atomic.h +OLD_FILES+=usr/lib/clang/12.0.1/include/sanitizer/ubsan_interface.h +OLD_DIRS+=usr/lib/clang/12.0.1/include/sanitizer +OLD_FILES+=usr/lib/clang/12.0.1/include/xray/xray_interface.h +OLD_FILES+=usr/lib/clang/12.0.1/include/xray/xray_log_interface.h +OLD_FILES+=usr/lib/clang/12.0.1/include/xray/xray_records.h +OLD_DIRS+=usr/lib/clang/12.0.1/include/xray +OLD_FILES+=usr/lib/clang/12.0.1/include/__clang_cuda_builtin_vars.h +OLD_FILES+=usr/lib/clang/12.0.1/include/__clang_cuda_cmath.h +OLD_FILES+=usr/lib/clang/12.0.1/include/__clang_cuda_complex_builtins.h +OLD_FILES+=usr/lib/clang/12.0.1/include/__clang_cuda_device_functions.h +OLD_FILES+=usr/lib/clang/12.0.1/include/__clang_cuda_intrinsics.h +OLD_FILES+=usr/lib/clang/12.0.1/include/__clang_cuda_libdevice_declares.h +OLD_FILES+=usr/lib/clang/12.0.1/include/__clang_cuda_math.h +OLD_FILES+=usr/lib/clang/12.0.1/include/__clang_cuda_math_forward_declares.h +OLD_FILES+=usr/lib/clang/12.0.1/include/__clang_cuda_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/12.0.1/include/__clang_hip_cmath.h +OLD_FILES+=usr/lib/clang/12.0.1/include/__clang_hip_libdevice_declares.h +OLD_FILES+=usr/lib/clang/12.0.1/include/__clang_hip_math.h +OLD_FILES+=usr/lib/clang/12.0.1/include/__clang_hip_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/12.0.1/include/__stddef_max_align_t.h +OLD_FILES+=usr/lib/clang/12.0.1/include/__wmmintrin_aes.h +OLD_FILES+=usr/lib/clang/12.0.1/include/__wmmintrin_pclmul.h +OLD_FILES+=usr/lib/clang/12.0.1/include/adxintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/altivec.h +OLD_FILES+=usr/lib/clang/12.0.1/include/ammintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/amxintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/arm64intr.h +OLD_FILES+=usr/lib/clang/12.0.1/include/arm_acle.h +OLD_FILES+=usr/lib/clang/12.0.1/include/arm_bf16.h +OLD_FILES+=usr/lib/clang/12.0.1/include/arm_cde.h +OLD_FILES+=usr/lib/clang/12.0.1/include/arm_cmse.h +OLD_FILES+=usr/lib/clang/12.0.1/include/arm_fp16.h +OLD_FILES+=usr/lib/clang/12.0.1/include/arm_mve.h +OLD_FILES+=usr/lib/clang/12.0.1/include/arm_neon.h +OLD_FILES+=usr/lib/clang/12.0.1/include/arm_sve.h +OLD_FILES+=usr/lib/clang/12.0.1/include/armintr.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx2intrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512bf16intrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512bitalgintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512bwintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512cdintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512dqintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512erintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512fintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512ifmaintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512ifmavlintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512pfintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512vbmi2intrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512vbmiintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512vbmivlintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512vlbf16intrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512vlbitalgintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512vlbwintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512vlcdintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512vldqintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512vlintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512vlvbmi2intrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512vlvnniintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512vlvp2intersectintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512vnniintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512vp2intersectintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512vpopcntdqintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avx512vpopcntdqvlintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avxintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/avxvnniintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/bmi2intrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/bmiintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/cet.h +OLD_FILES+=usr/lib/clang/12.0.1/include/cetintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/cldemoteintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/clflushoptintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/clwbintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/clzerointrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/cpuid.h +OLD_FILES+=usr/lib/clang/12.0.1/include/emmintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/enqcmdintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/f16cintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/float.h +OLD_FILES+=usr/lib/clang/12.0.1/include/fma4intrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/fmaintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/fxsrintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/gfniintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/hresetintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/htmintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/htmxlintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/ia32intrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/immintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/intrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/inttypes.h +OLD_FILES+=usr/lib/clang/12.0.1/include/invpcidintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/iso646.h +OLD_FILES+=usr/lib/clang/12.0.1/include/keylockerintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/limits.h +OLD_FILES+=usr/lib/clang/12.0.1/include/lwpintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/lzcntintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/mm3dnow.h +OLD_FILES+=usr/lib/clang/12.0.1/include/mm_malloc.h +OLD_FILES+=usr/lib/clang/12.0.1/include/mmintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/module.modulemap +OLD_FILES+=usr/lib/clang/12.0.1/include/movdirintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/msa.h +OLD_FILES+=usr/lib/clang/12.0.1/include/mwaitxintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/nmmintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/omp-tools.h +OLD_FILES+=usr/lib/clang/12.0.1/include/omp.h +OLD_FILES+=usr/lib/clang/12.0.1/include/ompt.h +OLD_FILES+=usr/lib/clang/12.0.1/include/opencl-c-base.h +OLD_FILES+=usr/lib/clang/12.0.1/include/opencl-c.h +OLD_FILES+=usr/lib/clang/12.0.1/include/pconfigintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/pkuintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/pmmintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/popcntintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/prfchwintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/ptwriteintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/rdseedintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/rtmintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/s390intrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/serializeintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/sgxintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/shaintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/smmintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/stdalign.h +OLD_FILES+=usr/lib/clang/12.0.1/include/stdarg.h +OLD_FILES+=usr/lib/clang/12.0.1/include/stdatomic.h +OLD_FILES+=usr/lib/clang/12.0.1/include/stdbool.h +OLD_FILES+=usr/lib/clang/12.0.1/include/stddef.h +OLD_FILES+=usr/lib/clang/12.0.1/include/stdint.h +OLD_FILES+=usr/lib/clang/12.0.1/include/stdnoreturn.h +OLD_FILES+=usr/lib/clang/12.0.1/include/tbmintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/tgmath.h +OLD_FILES+=usr/lib/clang/12.0.1/include/tmmintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/tsxldtrkintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/uintrintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/unwind.h +OLD_FILES+=usr/lib/clang/12.0.1/include/vadefs.h +OLD_FILES+=usr/lib/clang/12.0.1/include/vaesintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/varargs.h +OLD_FILES+=usr/lib/clang/12.0.1/include/vecintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/vpclmulqdqintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/waitpkgintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/wasm_simd128.h +OLD_FILES+=usr/lib/clang/12.0.1/include/wbnoinvdintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/wmmintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/x86gprintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/x86intrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/xmmintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/xopintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/xsavecintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/xsaveintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/xsaveoptintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/xsavesintrin.h +OLD_FILES+=usr/lib/clang/12.0.1/include/xtestintrin.h +OLD_DIRS+=usr/lib/clang/12.0.1/include +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.asan-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.asan-aarch64.so +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.asan-arm.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.asan-arm.so +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.asan-armhf.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.asan-armhf.so +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.asan-i386.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.asan-i386.so +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.asan-preinit-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.asan-preinit-arm.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.asan-preinit-armhf.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.asan-preinit-i386.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.asan-preinit-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.asan-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.asan-x86_64.so +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.asan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.asan_cxx-arm.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.asan_cxx-armhf.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.asan_cxx-i386.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.asan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.cfi-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.cfi-arm.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.cfi-armhf.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.cfi-i386.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.cfi-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.cfi_diag-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.cfi_diag-arm.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.cfi_diag-armhf.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.cfi_diag-i386.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.cfi_diag-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.dd-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.dd-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.fuzzer-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.fuzzer-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.fuzzer_no_main-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.fuzzer_no_main-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.msan-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.msan-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.msan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.msan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.profile-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.profile-armhf.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.profile-powerpc.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.profile-powerpc64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.profile-powerpc64le.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.profile-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.safestack-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.safestack-i386.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.safestack-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.stats-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.stats-arm.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.stats-armhf.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.stats-i386.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.stats-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.stats_client-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.stats_client-arm.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.stats_client-armhf.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.stats_client-i386.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.stats_client-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.tsan-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.tsan-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.tsan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.tsan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.ubsan_minimal-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.ubsan_minimal-arm.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.ubsan_minimal-armhf.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.ubsan_minimal-i386.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.ubsan_minimal-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.ubsan_standalone-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.ubsan_standalone-arm.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.ubsan_standalone-armhf.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.ubsan_standalone-i386.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.ubsan_standalone-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.ubsan_standalone_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.ubsan_standalone_cxx-arm.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.ubsan_standalone_cxx-armhf.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.ubsan_standalone_cxx-i386.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.ubsan_standalone_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.xray-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.xray-arm.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.xray-armhf.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.xray-basic-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.xray-basic-arm.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.xray-basic-armhf.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.xray-basic-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.xray-fdr-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.xray-fdr-arm.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.xray-fdr-armhf.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.xray-fdr-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.xray-profiling-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.xray-profiling-arm.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.xray-profiling-armhf.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.xray-profiling-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.1/lib/freebsd/libclang_rt.xray-x86_64.a +OLD_DIRS+=usr/lib/clang/12.0.1/lib/freebsd +OLD_DIRS+=usr/lib/clang/12.0.1/lib +OLD_DIRS+=usr/lib/clang/12.0.1 + ++# 20211113: new libc++ import which bumps version from 12.0.1 to 13.0.0. ++OLD_FILES+=usr/include/c++/v1/__functional_03 ++OLD_FILES+=usr/include/c++/v1/__functional_base_03 ++OLD_FILES+=usr/include/c++/v1/__memory/base.h ++OLD_FILES+=usr/include/c++/v1/__memory/utilities.h ++OLD_FILES+=usr/include/c++/v1/__sso_allocator ++OLD_FILES+=usr/include/c++/v1/tr1/__availability ++OLD_FILES+=usr/include/c++/v1/tr1/__bit_reference ++OLD_FILES+=usr/include/c++/v1/tr1/__bits ++OLD_FILES+=usr/include/c++/v1/tr1/__bsd_locale_defaults.h ++OLD_FILES+=usr/include/c++/v1/tr1/__bsd_locale_fallbacks.h ++OLD_FILES+=usr/include/c++/v1/tr1/__config ++OLD_FILES+=usr/include/c++/v1/tr1/__debug ++OLD_FILES+=usr/include/c++/v1/tr1/__errc ++OLD_FILES+=usr/include/c++/v1/tr1/__functional_03 ++OLD_FILES+=usr/include/c++/v1/tr1/__functional_base ++OLD_FILES+=usr/include/c++/v1/tr1/__functional_base_03 ++OLD_FILES+=usr/include/c++/v1/tr1/__hash_table ++OLD_FILES+=usr/include/c++/v1/tr1/__libcpp_version ++OLD_FILES+=usr/include/c++/v1/tr1/__locale ++OLD_FILES+=usr/include/c++/v1/tr1/__mutex_base ++OLD_FILES+=usr/include/c++/v1/tr1/__node_handle ++OLD_FILES+=usr/include/c++/v1/tr1/__nullptr ++OLD_FILES+=usr/include/c++/v1/tr1/__split_buffer ++OLD_FILES+=usr/include/c++/v1/tr1/__sso_allocator ++OLD_FILES+=usr/include/c++/v1/tr1/__std_stream ++OLD_FILES+=usr/include/c++/v1/tr1/__string ++OLD_FILES+=usr/include/c++/v1/tr1/__threading_support ++OLD_FILES+=usr/include/c++/v1/tr1/__tree ++OLD_FILES+=usr/include/c++/v1/tr1/__tuple ++OLD_FILES+=usr/include/c++/v1/tr1/__undef_macros ++OLD_FILES+=usr/include/c++/v1/tr1/algorithm ++OLD_FILES+=usr/include/c++/v1/tr1/any ++OLD_FILES+=usr/include/c++/v1/tr1/array ++OLD_FILES+=usr/include/c++/v1/tr1/atomic ++OLD_FILES+=usr/include/c++/v1/tr1/barrier ++OLD_FILES+=usr/include/c++/v1/tr1/bit ++OLD_FILES+=usr/include/c++/v1/tr1/bitset ++OLD_FILES+=usr/include/c++/v1/tr1/cassert ++OLD_FILES+=usr/include/c++/v1/tr1/ccomplex ++OLD_FILES+=usr/include/c++/v1/tr1/cctype ++OLD_FILES+=usr/include/c++/v1/tr1/cerrno ++OLD_FILES+=usr/include/c++/v1/tr1/cfenv ++OLD_FILES+=usr/include/c++/v1/tr1/cfloat ++OLD_FILES+=usr/include/c++/v1/tr1/charconv ++OLD_FILES+=usr/include/c++/v1/tr1/chrono ++OLD_FILES+=usr/include/c++/v1/tr1/cinttypes ++OLD_FILES+=usr/include/c++/v1/tr1/ciso646 ++OLD_FILES+=usr/include/c++/v1/tr1/climits ++OLD_FILES+=usr/include/c++/v1/tr1/clocale ++OLD_FILES+=usr/include/c++/v1/tr1/cmath ++OLD_FILES+=usr/include/c++/v1/tr1/codecvt ++OLD_FILES+=usr/include/c++/v1/tr1/compare ++OLD_FILES+=usr/include/c++/v1/tr1/complex ++OLD_FILES+=usr/include/c++/v1/tr1/complex.h ++OLD_FILES+=usr/include/c++/v1/tr1/concepts ++OLD_FILES+=usr/include/c++/v1/tr1/condition_variable ++OLD_FILES+=usr/include/c++/v1/tr1/csetjmp ++OLD_FILES+=usr/include/c++/v1/tr1/csignal ++OLD_FILES+=usr/include/c++/v1/tr1/cstdarg ++OLD_FILES+=usr/include/c++/v1/tr1/cstdbool ++OLD_FILES+=usr/include/c++/v1/tr1/cstddef ++OLD_FILES+=usr/include/c++/v1/tr1/cstdint ++OLD_FILES+=usr/include/c++/v1/tr1/cstdio ++OLD_FILES+=usr/include/c++/v1/tr1/cstdlib ++OLD_FILES+=usr/include/c++/v1/tr1/cstring ++OLD_FILES+=usr/include/c++/v1/tr1/ctgmath ++OLD_FILES+=usr/include/c++/v1/tr1/ctime ++OLD_FILES+=usr/include/c++/v1/tr1/ctype.h ++OLD_FILES+=usr/include/c++/v1/tr1/cwchar ++OLD_FILES+=usr/include/c++/v1/tr1/cwctype ++OLD_FILES+=usr/include/c++/v1/tr1/deque ++OLD_FILES+=usr/include/c++/v1/tr1/errno.h ++OLD_FILES+=usr/include/c++/v1/tr1/exception ++OLD_FILES+=usr/include/c++/v1/tr1/execution ++OLD_FILES+=usr/include/c++/v1/tr1/fenv.h ++OLD_FILES+=usr/include/c++/v1/tr1/filesystem ++OLD_FILES+=usr/include/c++/v1/tr1/float.h ++OLD_FILES+=usr/include/c++/v1/tr1/forward_list ++OLD_FILES+=usr/include/c++/v1/tr1/fstream ++OLD_FILES+=usr/include/c++/v1/tr1/functional ++OLD_FILES+=usr/include/c++/v1/tr1/future ++OLD_FILES+=usr/include/c++/v1/tr1/initializer_list ++OLD_FILES+=usr/include/c++/v1/tr1/inttypes.h ++OLD_FILES+=usr/include/c++/v1/tr1/iomanip ++OLD_FILES+=usr/include/c++/v1/tr1/ios ++OLD_FILES+=usr/include/c++/v1/tr1/iosfwd ++OLD_FILES+=usr/include/c++/v1/tr1/iostream ++OLD_FILES+=usr/include/c++/v1/tr1/istream ++OLD_FILES+=usr/include/c++/v1/tr1/iterator ++OLD_FILES+=usr/include/c++/v1/tr1/latch ++OLD_FILES+=usr/include/c++/v1/tr1/limits ++OLD_FILES+=usr/include/c++/v1/tr1/limits.h ++OLD_FILES+=usr/include/c++/v1/tr1/list ++OLD_FILES+=usr/include/c++/v1/tr1/locale ++OLD_FILES+=usr/include/c++/v1/tr1/locale.h ++OLD_FILES+=usr/include/c++/v1/tr1/map ++OLD_FILES+=usr/include/c++/v1/tr1/math.h ++OLD_FILES+=usr/include/c++/v1/tr1/memory ++OLD_FILES+=usr/include/c++/v1/tr1/mutex ++OLD_FILES+=usr/include/c++/v1/tr1/new ++OLD_FILES+=usr/include/c++/v1/tr1/numbers ++OLD_FILES+=usr/include/c++/v1/tr1/numeric ++OLD_FILES+=usr/include/c++/v1/tr1/optional ++OLD_FILES+=usr/include/c++/v1/tr1/ostream ++OLD_FILES+=usr/include/c++/v1/tr1/queue ++OLD_FILES+=usr/include/c++/v1/tr1/random ++OLD_FILES+=usr/include/c++/v1/tr1/ratio ++OLD_FILES+=usr/include/c++/v1/tr1/regex ++OLD_FILES+=usr/include/c++/v1/tr1/scoped_allocator ++OLD_FILES+=usr/include/c++/v1/tr1/semaphore ++OLD_FILES+=usr/include/c++/v1/tr1/set ++OLD_FILES+=usr/include/c++/v1/tr1/setjmp.h ++OLD_FILES+=usr/include/c++/v1/tr1/shared_mutex ++OLD_FILES+=usr/include/c++/v1/tr1/span ++OLD_FILES+=usr/include/c++/v1/tr1/sstream ++OLD_FILES+=usr/include/c++/v1/tr1/stack ++OLD_FILES+=usr/include/c++/v1/tr1/stdbool.h ++OLD_FILES+=usr/include/c++/v1/tr1/stddef.h ++OLD_FILES+=usr/include/c++/v1/tr1/stdexcept ++OLD_FILES+=usr/include/c++/v1/tr1/stdint.h ++OLD_FILES+=usr/include/c++/v1/tr1/stdio.h ++OLD_FILES+=usr/include/c++/v1/tr1/stdlib.h ++OLD_FILES+=usr/include/c++/v1/tr1/streambuf ++OLD_FILES+=usr/include/c++/v1/tr1/string ++OLD_FILES+=usr/include/c++/v1/tr1/string.h ++OLD_FILES+=usr/include/c++/v1/tr1/string_view ++OLD_FILES+=usr/include/c++/v1/tr1/strstream ++OLD_FILES+=usr/include/c++/v1/tr1/system_error ++OLD_FILES+=usr/include/c++/v1/tr1/tgmath.h ++OLD_FILES+=usr/include/c++/v1/tr1/thread ++OLD_FILES+=usr/include/c++/v1/tr1/tuple ++OLD_FILES+=usr/include/c++/v1/tr1/type_traits ++OLD_FILES+=usr/include/c++/v1/tr1/typeindex ++OLD_FILES+=usr/include/c++/v1/tr1/typeinfo ++OLD_FILES+=usr/include/c++/v1/tr1/unordered_map ++OLD_FILES+=usr/include/c++/v1/tr1/unordered_set ++OLD_FILES+=usr/include/c++/v1/tr1/utility ++OLD_FILES+=usr/include/c++/v1/tr1/valarray ++OLD_FILES+=usr/include/c++/v1/tr1/variant ++OLD_FILES+=usr/include/c++/v1/tr1/vector ++OLD_FILES+=usr/include/c++/v1/tr1/version ++OLD_FILES+=usr/include/c++/v1/tr1/wchar.h ++OLD_FILES+=usr/include/c++/v1/tr1/wctype.h ++OLD_DIRS+=usr/include/c++/v1/tr1 ++ +# 20211027: libdialog shlib bumped to version 10 for dialog 1.3 +OLD_LIBS+=usr/lib/libdialog.so.9 +OLD_LIBS+=usr/lib/libdpv.so.2 +OLD_LIBS+=usr/lib32/libdialog.so.9 +OLD_LIBS+=usr/lib32/libdpv.so.2 + +# 20211026: retire obsolete iscsi initiator +OLD_FILES+=sbin/iscontrol +OLD_FILES+=usr/share/man/man4/iscsi_initiator.4.gz +OLD_FILES+=usr/share/man/man8/iscontrol.8.gz + +# 20211022 +OLD_FILES+=sbin/spppcontrol +.if ${TARGET_ARCH} == "i386" +OLD_FILES+=usr/include/machine/cserial.h +.endif +OLD_FILES+=usr/include/net/if_sppp.h +OLD_FILES+=usr/include/netgraph/ng_sppp.h +OLD_FILES+=usr/share/man/man4/ng_sppp.4.gz +OLD_FILES+=usr/share/man/man4/sppp.4.gz +OLD_FILES+=usr/share/man/man8/spppcontrol.8.gz + +# 20210929: +OLD_FILES+=usr/sbin/hcseriald +OLD_FILES+=usr/share/man/man8/hcseriald.8.gz + +# 20210929: Remove ng_h4 +OLD_FILES+=usr/share/man/man4/ng_h4.4.gz + +# 20210923: rename boot(9) to kern_reboot(9) +OLD_FILES+=usr/share/man/man9/boot.9.gz + +# 20210921: remove cloudabi +OLD_FILES+=usr/share/man/man4/cloudabi.4.gz + +# 20210906: stop installing {llvm,clang,lldb}-tblgen +OLD_FILES+=usr/bin/llvm-tblgen +OLD_FILES+=usr/bin/clang-tblgen +OLD_FILES+=usr/bin/lldb-tblgen +OLD_FILES+=usr/share/man/man1/llvm-tblgen.1.gz + +# 20210810: remove Pentium-related man pages and references +OLD_FILES+=usr/share/man/man3/pmc.p4.3.gz +OLD_FILES+=usr/share/man/man3/pmc.p5.3.gz +OLD_FILES+=usr/share/man/man3/pmc.p6.3.gz + +# 20210805: C.UTF-8 installed to the wrong location +OLD_FILES+=usr/share/C.UTF-8.LC_CTYPE + +# 20210619: new clang import which bumps version from 12.0.0 to 12.0.1. +OLD_FILES+=usr/lib/clang/12.0.0/include/cuda_wrappers/algorithm +OLD_FILES+=usr/lib/clang/12.0.0/include/cuda_wrappers/complex +OLD_FILES+=usr/lib/clang/12.0.0/include/cuda_wrappers/new +OLD_DIRS+=usr/lib/clang/12.0.0/include/cuda_wrappers +OLD_FILES+=usr/lib/clang/12.0.0/include/fuzzer/FuzzedDataProvider.h +OLD_DIRS+=usr/lib/clang/12.0.0/include/fuzzer +OLD_FILES+=usr/lib/clang/12.0.0/include/openmp_wrappers/__clang_openmp_device_functions.h +OLD_FILES+=usr/lib/clang/12.0.0/include/openmp_wrappers/cmath +OLD_FILES+=usr/lib/clang/12.0.0/include/openmp_wrappers/complex +OLD_FILES+=usr/lib/clang/12.0.0/include/openmp_wrappers/complex.h +OLD_FILES+=usr/lib/clang/12.0.0/include/openmp_wrappers/complex_cmath.h +OLD_FILES+=usr/lib/clang/12.0.0/include/openmp_wrappers/math.h +OLD_FILES+=usr/lib/clang/12.0.0/include/openmp_wrappers/new +OLD_DIRS+=usr/lib/clang/12.0.0/include/openmp_wrappers +OLD_FILES+=usr/lib/clang/12.0.0/include/ppc_wrappers/emmintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/ppc_wrappers/mm_malloc.h +OLD_FILES+=usr/lib/clang/12.0.0/include/ppc_wrappers/mmintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/ppc_wrappers/pmmintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/ppc_wrappers/smmintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/ppc_wrappers/tmmintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/ppc_wrappers/xmmintrin.h +OLD_DIRS+=usr/lib/clang/12.0.0/include/ppc_wrappers +OLD_FILES+=usr/lib/clang/12.0.0/include/profile/InstrProfData.inc +OLD_DIRS+=usr/lib/clang/12.0.0/include/profile +OLD_FILES+=usr/lib/clang/12.0.0/include/sanitizer/allocator_interface.h +OLD_FILES+=usr/lib/clang/12.0.0/include/sanitizer/asan_interface.h +OLD_FILES+=usr/lib/clang/12.0.0/include/sanitizer/common_interface_defs.h +OLD_FILES+=usr/lib/clang/12.0.0/include/sanitizer/coverage_interface.h +OLD_FILES+=usr/lib/clang/12.0.0/include/sanitizer/dfsan_interface.h +OLD_FILES+=usr/lib/clang/12.0.0/include/sanitizer/hwasan_interface.h +OLD_FILES+=usr/lib/clang/12.0.0/include/sanitizer/linux_syscall_hooks.h +OLD_FILES+=usr/lib/clang/12.0.0/include/sanitizer/lsan_interface.h +OLD_FILES+=usr/lib/clang/12.0.0/include/sanitizer/msan_interface.h +OLD_FILES+=usr/lib/clang/12.0.0/include/sanitizer/netbsd_syscall_hooks.h +OLD_FILES+=usr/lib/clang/12.0.0/include/sanitizer/scudo_interface.h +OLD_FILES+=usr/lib/clang/12.0.0/include/sanitizer/tsan_interface.h +OLD_FILES+=usr/lib/clang/12.0.0/include/sanitizer/tsan_interface_atomic.h +OLD_FILES+=usr/lib/clang/12.0.0/include/sanitizer/ubsan_interface.h +OLD_DIRS+=usr/lib/clang/12.0.0/include/sanitizer +OLD_FILES+=usr/lib/clang/12.0.0/include/xray/xray_interface.h +OLD_FILES+=usr/lib/clang/12.0.0/include/xray/xray_log_interface.h +OLD_FILES+=usr/lib/clang/12.0.0/include/xray/xray_records.h +OLD_DIRS+=usr/lib/clang/12.0.0/include/xray +OLD_FILES+=usr/lib/clang/12.0.0/include/__clang_cuda_builtin_vars.h +OLD_FILES+=usr/lib/clang/12.0.0/include/__clang_cuda_cmath.h +OLD_FILES+=usr/lib/clang/12.0.0/include/__clang_cuda_complex_builtins.h +OLD_FILES+=usr/lib/clang/12.0.0/include/__clang_cuda_device_functions.h +OLD_FILES+=usr/lib/clang/12.0.0/include/__clang_cuda_intrinsics.h +OLD_FILES+=usr/lib/clang/12.0.0/include/__clang_cuda_libdevice_declares.h +OLD_FILES+=usr/lib/clang/12.0.0/include/__clang_cuda_math.h +OLD_FILES+=usr/lib/clang/12.0.0/include/__clang_cuda_math_forward_declares.h +OLD_FILES+=usr/lib/clang/12.0.0/include/__clang_cuda_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/12.0.0/include/__clang_hip_cmath.h +OLD_FILES+=usr/lib/clang/12.0.0/include/__clang_hip_libdevice_declares.h +OLD_FILES+=usr/lib/clang/12.0.0/include/__clang_hip_math.h +OLD_FILES+=usr/lib/clang/12.0.0/include/__clang_hip_runtime_wrapper.h +OLD_FILES+=usr/lib/clang/12.0.0/include/__stddef_max_align_t.h +OLD_FILES+=usr/lib/clang/12.0.0/include/__wmmintrin_aes.h +OLD_FILES+=usr/lib/clang/12.0.0/include/__wmmintrin_pclmul.h +OLD_FILES+=usr/lib/clang/12.0.0/include/adxintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/altivec.h +OLD_FILES+=usr/lib/clang/12.0.0/include/ammintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/amxintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/arm64intr.h +OLD_FILES+=usr/lib/clang/12.0.0/include/arm_acle.h +OLD_FILES+=usr/lib/clang/12.0.0/include/arm_bf16.h +OLD_FILES+=usr/lib/clang/12.0.0/include/arm_cde.h +OLD_FILES+=usr/lib/clang/12.0.0/include/arm_cmse.h +OLD_FILES+=usr/lib/clang/12.0.0/include/arm_fp16.h +OLD_FILES+=usr/lib/clang/12.0.0/include/arm_mve.h +OLD_FILES+=usr/lib/clang/12.0.0/include/arm_neon.h +OLD_FILES+=usr/lib/clang/12.0.0/include/arm_sve.h +OLD_FILES+=usr/lib/clang/12.0.0/include/armintr.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx2intrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512bf16intrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512bitalgintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512bwintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512cdintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512dqintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512erintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512fintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512ifmaintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512ifmavlintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512pfintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512vbmi2intrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512vbmiintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512vbmivlintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512vlbf16intrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512vlbitalgintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512vlbwintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512vlcdintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512vldqintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512vlintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512vlvbmi2intrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512vlvnniintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512vlvp2intersectintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512vnniintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512vp2intersectintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512vpopcntdqintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avx512vpopcntdqvlintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avxintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/avxvnniintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/bmi2intrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/bmiintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/cet.h +OLD_FILES+=usr/lib/clang/12.0.0/include/cetintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/cldemoteintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/clflushoptintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/clwbintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/clzerointrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/cpuid.h +OLD_FILES+=usr/lib/clang/12.0.0/include/emmintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/enqcmdintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/f16cintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/float.h +OLD_FILES+=usr/lib/clang/12.0.0/include/fma4intrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/fmaintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/fxsrintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/gfniintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/hresetintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/htmintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/htmxlintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/ia32intrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/immintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/intrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/inttypes.h +OLD_FILES+=usr/lib/clang/12.0.0/include/invpcidintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/iso646.h +OLD_FILES+=usr/lib/clang/12.0.0/include/keylockerintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/limits.h +OLD_FILES+=usr/lib/clang/12.0.0/include/lwpintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/lzcntintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/mm3dnow.h +OLD_FILES+=usr/lib/clang/12.0.0/include/mm_malloc.h +OLD_FILES+=usr/lib/clang/12.0.0/include/mmintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/module.modulemap +OLD_FILES+=usr/lib/clang/12.0.0/include/movdirintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/msa.h +OLD_FILES+=usr/lib/clang/12.0.0/include/mwaitxintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/nmmintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/omp-tools.h +OLD_FILES+=usr/lib/clang/12.0.0/include/omp.h +OLD_FILES+=usr/lib/clang/12.0.0/include/ompt.h +OLD_FILES+=usr/lib/clang/12.0.0/include/opencl-c-base.h +OLD_FILES+=usr/lib/clang/12.0.0/include/opencl-c.h +OLD_FILES+=usr/lib/clang/12.0.0/include/pconfigintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/pkuintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/pmmintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/popcntintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/prfchwintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/ptwriteintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/rdseedintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/rtmintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/s390intrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/serializeintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/sgxintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/shaintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/smmintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/stdalign.h +OLD_FILES+=usr/lib/clang/12.0.0/include/stdarg.h +OLD_FILES+=usr/lib/clang/12.0.0/include/stdatomic.h +OLD_FILES+=usr/lib/clang/12.0.0/include/stdbool.h +OLD_FILES+=usr/lib/clang/12.0.0/include/stddef.h +OLD_FILES+=usr/lib/clang/12.0.0/include/stdint.h +OLD_FILES+=usr/lib/clang/12.0.0/include/stdnoreturn.h +OLD_FILES+=usr/lib/clang/12.0.0/include/tbmintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/tgmath.h +OLD_FILES+=usr/lib/clang/12.0.0/include/tmmintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/tsxldtrkintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/uintrintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/unwind.h +OLD_FILES+=usr/lib/clang/12.0.0/include/vadefs.h +OLD_FILES+=usr/lib/clang/12.0.0/include/vaesintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/varargs.h +OLD_FILES+=usr/lib/clang/12.0.0/include/vecintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/vpclmulqdqintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/waitpkgintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/wasm_simd128.h +OLD_FILES+=usr/lib/clang/12.0.0/include/wbnoinvdintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/wmmintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/x86gprintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/x86intrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/xmmintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/xopintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/xsavecintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/xsaveintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/xsaveoptintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/xsavesintrin.h +OLD_FILES+=usr/lib/clang/12.0.0/include/xtestintrin.h +OLD_DIRS+=usr/lib/clang/12.0.0/include +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.asan-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.asan-aarch64.so +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.asan-arm.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.asan-arm.so +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.asan-armhf.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.asan-armhf.so +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.asan-i386.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.asan-i386.so +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.asan-preinit-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.asan-preinit-arm.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.asan-preinit-armhf.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.asan-preinit-i386.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.asan-preinit-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.asan-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.asan-x86_64.so +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.asan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.asan_cxx-arm.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.asan_cxx-armhf.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.asan_cxx-i386.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.asan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.cfi-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.cfi-arm.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.cfi-armhf.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.cfi-i386.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.cfi-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.cfi_diag-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.cfi_diag-arm.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.cfi_diag-armhf.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.cfi_diag-i386.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.cfi_diag-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.dd-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.dd-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.fuzzer-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.fuzzer-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.fuzzer_no_main-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.fuzzer_no_main-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.msan-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.msan-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.msan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.msan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.profile-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.profile-arm.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.profile-armhf.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.profile-i386.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.profile-powerpc.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.profile-powerpc64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.profile-powerpc64le.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.profile-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.safestack-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.safestack-i386.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.safestack-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.stats-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.stats-arm.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.stats-armhf.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.stats-i386.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.stats-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.stats_client-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.stats_client-arm.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.stats_client-armhf.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.stats_client-i386.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.stats_client-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.tsan-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.tsan-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.tsan_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.tsan_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.ubsan_minimal-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.ubsan_minimal-arm.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.ubsan_minimal-armhf.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.ubsan_minimal-i386.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.ubsan_minimal-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.ubsan_standalone-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.ubsan_standalone-arm.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.ubsan_standalone-armhf.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.ubsan_standalone-i386.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.ubsan_standalone-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-arm.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-armhf.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-i386.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-x86_64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.xray-aarch64.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.xray-arm.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.xray-armhf.a +OLD_FILES+=usr/lib/clang/12.0.0/lib/freebsd/libclang_rt.xray-basic-aarch64.a *** 31421 LINES SKIPPED *** From nobody Sat Nov 13 20:56:39 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1DE07184FA0D; Sat, 13 Nov 2021 20:56:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs76h4JYHz3p0m; Sat, 13 Nov 2021 20:56:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16D231A3A1; Sat, 13 Nov 2021 20:56:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ADKuhDq017399; Sat, 13 Nov 2021 20:56:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ADKudw7017398; Sat, 13 Nov 2021 20:56:39 GMT (envelope-from git) Date: Sat, 13 Nov 2021 20:56:39 GMT Message-Id: <202111132056.1ADKudw7017398@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 69ade1e033e4 - main - Merge llvm-project release/13.x llvmorg-13.0.0-rc2-43-gf56129fe78d5 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 69ade1e033e478ec426cafc0ec2104d672de294a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=69ade1e033e478ec426cafc0ec2104d672de294a commit 69ade1e033e478ec426cafc0ec2104d672de294a Merge: 6e75b2fbf9a0 f9ef3ff6e2ee Author: Dimitry Andric AuthorDate: 2021-09-09 20:15:13 +0000 Commit: Dimitry Andric CommitDate: 2021-11-13 20:45:49 +0000 Merge llvm-project release/13.x llvmorg-13.0.0-rc2-43-gf56129fe78d5 This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-13.0.0-rc2-43-gf56129fe78d5. PR: 258209 MFC after: 2 weeks contrib/llvm-project/clang/lib/AST/ASTContext.cpp | 8 + .../llvm-project/clang/lib/Basic/Targets/M68k.cpp | 4 +- .../clang/lib/Basic/Targets/OSTargets.h | 5 + contrib/llvm-project/clang/lib/Driver/Driver.cpp | 1 - .../clang/lib/Driver/ToolChains/AMDGPU.cpp | 35 +++ .../clang/lib/Driver/ToolChains/AMDGPU.h | 5 + .../clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp | 32 ++- .../clang/lib/Driver/ToolChains/AMDGPUOpenMP.h | 14 +- .../clang/lib/Driver/ToolChains/Clang.cpp | 3 +- .../clang/lib/Driver/ToolChains/CommonArgs.cpp | 3 +- .../clang/lib/Driver/ToolChains/HIP.cpp | 33 +-- .../clang/lib/Driver/ToolChains/OpenBSD.cpp | 7 + .../lib/Headers/__clang_cuda_device_functions.h | 276 +++++++++++++-------- .../clang/lib/Headers/__clang_hip_cmath.h | 188 ++++++++------ .../clang/lib/Headers/__clang_hip_math.h | 50 +++- .../__clang_openmp_device_functions.h | 32 ++- .../clang/lib/Headers/openmp_wrappers/cmath | 54 ++++ .../clang/lib/Headers/openmp_wrappers/math.h | 10 + .../clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 2 +- .../llvm-project/clang/lib/Sema/TreeTransform.h | 2 +- .../clang/lib/Serialization/ASTReader.cpp | 2 + .../compiler-rt/lib/profile/InstrProfilingFile.c | 19 +- .../lib/profile/InstrProfilingPlatformFuchsia.c | 5 +- .../lib/profile/InstrProfilingPlatformLinux.c | 11 +- contrib/llvm-project/libcxx/include/cwctype | 2 + contrib/llvm-project/libcxx/include/string | 19 ++ contrib/llvm-project/libcxx/include/vector | 20 ++ contrib/llvm-project/libcxx/include/wctype.h | 10 + .../llvm-project/libunwind/src/Unwind-EHABI.cpp | 2 + .../llvm/include/llvm/Analysis/LazyCallGraph.h | 2 +- .../llvm/include/llvm/Analysis/LoopInfo.h | 2 +- .../llvm/include/llvm/Analysis/LoopNestAnalysis.h | 2 +- .../include/llvm/Analysis/TargetTransformInfo.h | 1 - .../llvm/include/llvm/CodeGen/MachineFunction.h | 2 +- .../llvm-project/llvm/include/llvm/IR/Function.h | 3 +- contrib/llvm-project/llvm/include/llvm/IR/Module.h | 6 +- .../llvm/lib/Analysis/ScalarEvolution.cpp | 2 +- .../llvm/lib/Analysis/TargetTransformInfo.cpp | 1 - .../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 5 +- .../llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h | 8 +- .../llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 31 +-- .../llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | 3 - .../llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 9 +- .../llvm/lib/CodeGen/HardwareLoops.cpp | 5 +- .../llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 3 +- .../CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp | 7 +- .../CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 6 +- .../lib/CodeGen/SelectionDAG/TargetLowering.cpp | 7 +- .../llvm-project/llvm/lib/Linker/LinkModules.cpp | 22 +- .../llvm-project/llvm/lib/Passes/PassBuilder.cpp | 5 +- .../lib/Target/AArch64/AArch64ISelLowering.cpp | 2 + .../llvm/lib/Target/AArch64/SMEInstrFormats.td | 2 +- .../lib/Target/M68k/AsmParser/M68kAsmParser.cpp | 28 +-- .../llvm/lib/Target/M68k/M68kTargetMachine.cpp | 12 +- .../llvm/lib/Target/RISCV/RISCVInstrInfo.cpp | 2 +- .../lib/Target/WebAssembly/WebAssemblyFastISel.cpp | 20 +- .../lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp | 21 ++ .../Transforms/Scalar/AlignmentFromAssumptions.cpp | 4 + .../lib/Transforms/Scalar/LoopIdiomRecognize.cpp | 5 + .../llvm/tools/llvm-cov/CoverageExporterLcov.cpp | 2 +- .../llvm/tools/llvm-objdump/llvm-objdump.cpp | 9 +- lib/clang/include/VCSVersion.inc | 8 +- lib/clang/include/llvm/Support/VCSRevision.h | 2 +- 63 files changed, 752 insertions(+), 351 deletions(-) diff --cc lib/clang/include/VCSVersion.inc index fe349d30ca5d,000000000000..0371e33a2a2f mode 100644,000000..100644 --- a/lib/clang/include/VCSVersion.inc +++ b/lib/clang/include/VCSVersion.inc @@@ -1,14 -1,0 +1,14 @@@ +// $FreeBSD$ + - #define LLVM_REVISION "llvmorg-13.0.0-rc1-97-g23ba3732246a" ++#define LLVM_REVISION "llvmorg-13.0.0-rc2-43-gf56129fe78d5" +#define LLVM_REPOSITORY "git@github.com:llvm/llvm-project.git" + - #define CLANG_REVISION "llvmorg-13.0.0-rc1-97-g23ba3732246a" ++#define CLANG_REVISION "llvmorg-13.0.0-rc2-43-gf56129fe78d5" +#define CLANG_REPOSITORY "git@github.com:llvm/llvm-project.git" + +// - - #define LLD_REVISION "llvmorg-13.0.0-rc1-97-g23ba3732246a-1400002" ++#define LLD_REVISION "llvmorg-13.0.0-rc2-43-gf56129fe78d5-1400002" +#define LLD_REPOSITORY "FreeBSD" + - #define LLDB_REVISION "llvmorg-13.0.0-rc1-97-g23ba3732246a" ++#define LLDB_REVISION "llvmorg-13.0.0-rc2-43-gf56129fe78d5" +#define LLDB_REPOSITORY "git@github.com:llvm/llvm-project.git" diff --cc lib/clang/include/llvm/Support/VCSRevision.h index 1257fe7db9e9,000000000000..ef7b3966a338 mode 100644,000000..100644 --- a/lib/clang/include/llvm/Support/VCSRevision.h +++ b/lib/clang/include/llvm/Support/VCSRevision.h @@@ -1,3 -1,0 +1,3 @@@ +/* $FreeBSD$ */ - #define LLVM_REVISION "llvmorg-13.0.0-rc1-97-g23ba3732246a" ++#define LLVM_REVISION "llvmorg-13.0.0-rc2-43-gf56129fe78d5" +#define LLVM_REPOSITORY "git@github.com:llvm/llvm-project.git" From nobody Sat Nov 13 20:56:52 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C511D184FB63; Sat, 13 Nov 2021 20: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs76x1fSyz3p3j; Sat, 13 Nov 2021 20:56:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ECED61A3A2; Sat, 13 Nov 2021 20:56:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ADKuuxO017441; Sat, 13 Nov 2021 20:56:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ADKuq2S017434; Sat, 13 Nov 2021 20:56:52 GMT (envelope-from git) Date: Sat, 13 Nov 2021 20:56:52 GMT Message-Id: <202111132056.1ADKuq2S017434@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 8c6f6c0c80f8 - main - Merge llvm-project release/13.x llvmorg-13.0.0-rc3-8-g08642a395f23 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8c6f6c0c80f896f9c90b7833def615dcb0ce9244 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=8c6f6c0c80f896f9c90b7833def615dcb0ce9244 commit 8c6f6c0c80f896f9c90b7833def615dcb0ce9244 Merge: 69ade1e033e4 392ac508a058 Author: Dimitry Andric AuthorDate: 2021-09-19 08:42:48 +0000 Commit: Dimitry Andric CommitDate: 2021-11-13 20:46:08 +0000 Merge llvm-project release/13.x llvmorg-13.0.0-rc3-8-g08642a395f23 This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-13.0.0-rc3-8-g08642a395f23. PR: 258209 MFC after: 2 weeks .../clang/lib/CodeGen/CGOpenMPRuntime.cpp | 3 +- .../clang/lib/Format/TokenAnnotator.cpp | 17 +++++--- .../clang/lib/Format/UnwrappedLineParser.cpp | 41 ++++++++++++++------ .../clang/lib/Headers/openmp_wrappers/complex | 2 +- contrib/llvm-project/clang/lib/Sema/SemaStmt.cpp | 3 +- .../compiler-rt/lib/builtins/clear_cache.c | 9 ++++- .../Process/Utility/RegisterInfoPOSIX_arm64.h | 1 + .../llvm-project/llvm/include/llvm/MC/MCContext.h | 16 ++++---- .../llvm/Transforms/Scalar/MemCpyOptimizer.h | 2 +- contrib/llvm-project/llvm/lib/IR/Constants.cpp | 8 ++-- contrib/llvm-project/llvm/lib/MC/MCContext.cpp | 2 +- .../lib/Target/AArch64/AArch64ISelLowering.cpp | 3 +- .../Target/AArch64/GISel/AArch64LegalizerInfo.cpp | 45 +--------------------- .../Target/AArch64/GISel/AArch64LegalizerInfo.h | 2 - .../llvm/lib/Target/X86/X86FrameLowering.cpp | 8 +++- .../llvm/lib/Transforms/IPO/OpenMPOpt.cpp | 23 +++++++++-- .../llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp | 40 +++++++++++++------ .../lib/Transforms/Scalar/SimpleLoopUnswitch.cpp | 43 +++++++++++++++------ .../llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 36 ++++++++++++----- .../lib/Transforms/Vectorize/VPlanTransforms.cpp | 7 +++- lib/clang/include/VCSVersion.inc | 8 ++-- lib/clang/include/llvm/Support/VCSRevision.h | 2 +- 22 files changed, 193 insertions(+), 128 deletions(-) diff --cc lib/clang/include/VCSVersion.inc index 0371e33a2a2f,000000000000..5e7f6f0abad0 mode 100644,000000..100644 --- a/lib/clang/include/VCSVersion.inc +++ b/lib/clang/include/VCSVersion.inc @@@ -1,14 -1,0 +1,14 @@@ +// $FreeBSD$ + - #define LLVM_REVISION "llvmorg-13.0.0-rc2-43-gf56129fe78d5" ++#define LLVM_REVISION "llvmorg-13.0.0-rc3-8-g08642a395f23" +#define LLVM_REPOSITORY "git@github.com:llvm/llvm-project.git" + - #define CLANG_REVISION "llvmorg-13.0.0-rc2-43-gf56129fe78d5" ++#define CLANG_REVISION "llvmorg-13.0.0-rc3-8-g08642a395f23" +#define CLANG_REPOSITORY "git@github.com:llvm/llvm-project.git" + +// - - #define LLD_REVISION "llvmorg-13.0.0-rc2-43-gf56129fe78d5-1400002" ++#define LLD_REVISION "llvmorg-13.0.0-rc3-8-g08642a395f23-1400002" +#define LLD_REPOSITORY "FreeBSD" + - #define LLDB_REVISION "llvmorg-13.0.0-rc2-43-gf56129fe78d5" ++#define LLDB_REVISION "llvmorg-13.0.0-rc3-8-g08642a395f23" +#define LLDB_REPOSITORY "git@github.com:llvm/llvm-project.git" diff --cc lib/clang/include/llvm/Support/VCSRevision.h index ef7b3966a338,000000000000..ac6277e98d43 mode 100644,000000..100644 --- a/lib/clang/include/llvm/Support/VCSRevision.h +++ b/lib/clang/include/llvm/Support/VCSRevision.h @@@ -1,3 -1,0 +1,3 @@@ +/* $FreeBSD$ */ - #define LLVM_REVISION "llvmorg-13.0.0-rc2-43-gf56129fe78d5" ++#define LLVM_REVISION "llvmorg-13.0.0-rc3-8-g08642a395f23" +#define LLVM_REPOSITORY "git@github.com:llvm/llvm-project.git" From nobody Sat Nov 13 20:57:05 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E635A185001A; Sat, 13 Nov 2021 20:57:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs77B3DzLz3pMs; Sat, 13 Nov 2021 20:57:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E42251A3A3; Sat, 13 Nov 2021 20:57:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ADKv9dP017481; Sat, 13 Nov 2021 20:57:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ADKv5N5017470; Sat, 13 Nov 2021 20:57:05 GMT (envelope-from git) Date: Sat, 13 Nov 2021 20:57:05 GMT Message-Id: <202111132057.1ADKv5N5017470@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 28a41182c08e - main - Merge llvm-project 13.0.0 release List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 28a41182c08e79534be77131840bcfdf73d31343 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=28a41182c08e79534be77131840bcfdf73d31343 commit 28a41182c08e79534be77131840bcfdf73d31343 Merge: 8c6f6c0c80f8 3f25e997d96a Author: Dimitry Andric AuthorDate: 2021-09-26 11:33:13 +0000 Commit: Dimitry Andric CommitDate: 2021-11-13 20:49:29 +0000 Merge llvm-project 13.0.0 release This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-13.0.0-0-gd7b669b3a303, aka 13.0.0 release. PR: 258209 MFC after: 2 weeks .../clang/include/clang/AST/DeclBase.h | 46 ++++++++--------- .../llvm-project/clang/include/clang/AST/Type.h | 34 ------------- .../clang/include/clang/Sema/Initialization.h | 16 +++--- .../llvm-project/clang/lib/AST/ExprConstant.cpp | 15 ++++-- .../clang/lib/Analysis/ThreadSafety.cpp | 31 +++++++----- .../llvm-project/clang/lib/CodeGen/CGExprCXX.cpp | 19 ++++--- .../clang/lib/Format/UnwrappedLineParser.cpp | 1 - contrib/llvm-project/clang/lib/Sema/Sema.cpp | 2 +- .../llvm-project/clang/lib/Sema/SemaCoroutine.cpp | 2 +- .../llvm-project/clang/lib/Sema/SemaDeclCXX.cpp | 9 ++++ contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp | 2 +- .../llvm-project/clang/lib/Sema/SemaExprCXX.cpp | 5 +- contrib/llvm-project/clang/lib/Sema/SemaLambda.cpp | 3 +- .../clang/lib/Sema/SemaObjCProperty.cpp | 3 +- contrib/llvm-project/clang/lib/Sema/SemaStmt.cpp | 8 +-- contrib/llvm-project/lld/COFF/Writer.cpp | 3 -- .../llvm/lib/Analysis/DemandedBits.cpp | 2 +- contrib/llvm-project/llvm/lib/IR/ConstantFold.cpp | 59 +++++++++++----------- .../llvm-project/llvm/lib/Passes/PassBuilder.cpp | 3 -- .../AArch64/GISel/AArch64InstructionSelector.cpp | 12 ++++- .../llvm/lib/Target/X86/X86ISelLowering.cpp | 2 +- .../llvm/lib/Transforms/Scalar/ADCE.cpp | 2 +- lib/clang/include/VCSVersion.inc | 8 +-- lib/clang/include/llvm/Support/VCSRevision.h | 2 +- usr.bin/clang/llvm-readobj/Makefile | 16 ++++++ 25 files changed, 154 insertions(+), 151 deletions(-) diff --cc lib/clang/include/VCSVersion.inc index 5e7f6f0abad0,000000000000..98c0198a4aaf mode 100644,000000..100644 --- a/lib/clang/include/VCSVersion.inc +++ b/lib/clang/include/VCSVersion.inc @@@ -1,14 -1,0 +1,14 @@@ +// $FreeBSD$ + - #define LLVM_REVISION "llvmorg-13.0.0-rc3-8-g08642a395f23" ++#define LLVM_REVISION "llvmorg-13.0.0-0-gd7b669b3a303" +#define LLVM_REPOSITORY "git@github.com:llvm/llvm-project.git" + - #define CLANG_REVISION "llvmorg-13.0.0-rc3-8-g08642a395f23" ++#define CLANG_REVISION "llvmorg-13.0.0-0-gd7b669b3a303" +#define CLANG_REPOSITORY "git@github.com:llvm/llvm-project.git" + +// - - #define LLD_REVISION "llvmorg-13.0.0-rc3-8-g08642a395f23-1400002" ++#define LLD_REVISION "llvmorg-13.0.0-0-gd7b669b3a303-1400002" +#define LLD_REPOSITORY "FreeBSD" + - #define LLDB_REVISION "llvmorg-13.0.0-rc3-8-g08642a395f23" ++#define LLDB_REVISION "llvmorg-13.0.0-0-gd7b669b3a303" +#define LLDB_REPOSITORY "git@github.com:llvm/llvm-project.git" diff --cc lib/clang/include/llvm/Support/VCSRevision.h index ac6277e98d43,000000000000..76c4f00a938c mode 100644,000000..100644 --- a/lib/clang/include/llvm/Support/VCSRevision.h +++ b/lib/clang/include/llvm/Support/VCSRevision.h @@@ -1,3 -1,0 +1,3 @@@ +/* $FreeBSD$ */ - #define LLVM_REVISION "llvmorg-13.0.0-rc3-8-g08642a395f23" ++#define LLVM_REVISION "llvmorg-13.0.0-0-gd7b669b3a303" +#define LLVM_REPOSITORY "git@github.com:llvm/llvm-project.git" diff --cc usr.bin/clang/llvm-readobj/Makefile index f9294d45491f,000000000000..4b547d81c583 mode 100644,000000..100644 --- a/usr.bin/clang/llvm-readobj/Makefile +++ b/usr.bin/clang/llvm-readobj/Makefile @@@ -1,30 -1,0 +1,46 @@@ +# $FreeBSD$ + +.include + +PROG_CXX= llvm-readobj +MAN= llvm-readobj.1 llvm-readelf.1 + +SRCDIR= llvm/tools/llvm-readobj +SRCS+= ARMWinEHPrinter.cpp +SRCS+= COFFDumper.cpp +SRCS+= COFFImportDumper.cpp +SRCS+= ELFDumper.cpp +SRCS+= llvm-readobj.cpp +SRCS+= MachODumper.cpp +SRCS+= ObjDumper.cpp +SRCS+= WasmDumper.cpp +SRCS+= Win64EHDumper.cpp +SRCS+= WindowsResourceDumper.cpp +SRCS+= XCOFFDumper.cpp + ++.include "${SRCTOP}/lib/clang/llvm.pre.mk" ++ ++CFLAGS+= -I${.OBJDIR} ++ ++INCFILE= Opts.inc ++TDFILE= ${LLVM_BASE}/${SRCDIR}/Opts.td ++GENOPT= -gen-opt-parser-defs ++${INCFILE}: ${TDFILE} ++ ${LLVM_TBLGEN} ${GENOPT} -I ${LLVM_SRCS}/include -d ${.TARGET:C/$/.d/} \ ++ -o ${.TARGET} ${TDFILE} ++TGHDRS+= ${INCFILE} ++ ++DEPENDFILES+= ${TGHDRS:C/$/.d/} ++DPSRCS+= ${TGHDRS} ++CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} ++ +LIBADD+= z + +LINKS+= ${BINDIR}/llvm-readobj ${BINDIR}/llvm-readelf + +.if ${MK_LLVM_BINUTILS} != "no" +LINKS+= ${BINDIR}/llvm-readelf ${BINDIR}/readelf +MLINKS+= llvm-readelf.1 readelf.1 +.endif + +.include "../llvm.prog.mk" From nobody Sat Nov 13 20:57:10 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E57C21850113; Sat, 13 Nov 2021 20:57:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs77C3qNSz3pYN; Sat, 13 Nov 2021 20:57:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15D2F1A3A4; Sat, 13 Nov 2021 20:57:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ADKvAe5017505; Sat, 13 Nov 2021 20:57:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ADKvAto017504; Sat, 13 Nov 2021 20:57:10 GMT (envelope-from git) Date: Sat, 13 Nov 2021 20:57:10 GMT Message-Id: <202111132057.1ADKvAto017504@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 39dadd0628cd - main - Stop clang 13 from defining conflicting macros on PowerPC List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 39dadd0628cd1f28be39a3ab35969545b7401623 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=39dadd0628cd1f28be39a3ab35969545b7401623 commit 39dadd0628cd1f28be39a3ab35969545b7401623 Author: Dimitry Andric AuthorDate: 2021-10-01 19:43:21 +0000 Commit: Dimitry Andric CommitDate: 2021-11-13 20:52:23 +0000 Stop clang 13 from defining conflicting macros on PowerPC Merge commit c9539f957f57 from llvm git (by Nemanja Ivanovic): [PowerPC] Define XL-compatible macros only for AIX and Linux Since XLC only ever shipped on PowerPC AIX and Linux, it is not reasonable to provide the compatibility macros on any target other than those two. This patch restricts those macros to AIX/Linux. Differential revision: https://reviews.llvm.org/D110213 PR: 258209 --- contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp b/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp index 59656888e25f..ecfbe284fb2e 100644 --- a/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp +++ b/contrib/llvm-project/clang/lib/Basic/Targets/PPC.cpp @@ -243,7 +243,10 @@ static void defineXLCompatMacros(MacroBuilder &Builder) { void PPCTargetInfo::getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const { - defineXLCompatMacros(Builder); + // We define the XLC compatibility macros only on AIX and Linux since XLC + // was never available on any other platforms. + if (getTriple().isOSAIX() || getTriple().isOSLinux()) + defineXLCompatMacros(Builder); // Target identification. Builder.defineMacro("__ppc__"); From nobody Sat Nov 13 20:57:12 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 57E6018500AD; Sat, 13 Nov 2021 20:57:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs77D54w0z3pHy; Sat, 13 Nov 2021 20:57:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2FE471A3A5; Sat, 13 Nov 2021 20:57:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ADKvCh8017529; Sat, 13 Nov 2021 20:57:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ADKvCDQ017528; Sat, 13 Nov 2021 20:57:12 GMT (envelope-from git) Date: Sat, 13 Nov 2021 20:57:12 GMT Message-Id: <202111132057.1ADKvCDQ017528@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 4e117af10caf - main - Fix "Bad machine code" when building world for mips or mips64 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4e117af10caf2b6f95c7ef44b08aa7a812a37286 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=4e117af10caf2b6f95c7ef44b08aa7a812a37286 commit 4e117af10caf2b6f95c7ef44b08aa7a812a37286 Author: Dimitry Andric AuthorDate: 2021-10-18 14:50:24 +0000 Commit: Dimitry Andric CommitDate: 2021-11-13 20:52:24 +0000 Fix "Bad machine code" when building world for mips or mips64 Merge commit f5755c0849a5 from llvm git (by Jessica Clarke): [Mips] Add glue between CopyFromReg, CopyToReg and RDHWR nodes for TLS The MIPS ABI requires the thread pointer be accessed via rdhwr $3, $r29. This is currently represented by (CopyToReg $3, (RDHWR $29)) followed by a (CopyFromReg $3). However, there is no glue between these, meaning scheduling can break those apart. In particular, PR51691 is a report where PseudoSELECT_I was moved to between the CopyToReg and CopyFromReg, and since its expansion uses branches, it split the def and use of the physical register between two basic blocks, resulting in the def being eliminated and the use having no def. It also seems possible that a similar situation could arise splitting up the CopyToReg from the RDHWR, causing the RDHWR to use a destination register other than $3, violating the ABI requirement. Thus, add glue between all three nodes to ensure they aren't split up during instruction selection. No regression test is added since any test would be implictly relying on specific scheduling behaviour, so whilst it might be testing that glue is preventing reordering today, changes to scheduling behaviour could result in the test no longer being able to catch a regression here, as the reordering might no longer happen for other unrelated reasons. Fixes PR51691. Reviewed By: atanasyan, dim Differential Revision: https://reviews.llvm.org/D111967 --- contrib/llvm-project/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/contrib/llvm-project/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp b/contrib/llvm-project/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp index 7be5fc33a0af..04a835f08855 100644 --- a/contrib/llvm-project/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp +++ b/contrib/llvm-project/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp @@ -1027,12 +1027,13 @@ bool MipsSEDAGToDAGISel::trySelect(SDNode *Node) { } SDNode *Rdhwr = - CurDAG->getMachineNode(RdhwrOpc, DL, Node->getValueType(0), + CurDAG->getMachineNode(RdhwrOpc, DL, Node->getValueType(0), MVT::Glue, CurDAG->getRegister(Mips::HWR29, MVT::i32), CurDAG->getTargetConstant(0, DL, MVT::i32)); SDValue Chain = CurDAG->getCopyToReg(CurDAG->getEntryNode(), DL, DestReg, - SDValue(Rdhwr, 0)); - SDValue ResNode = CurDAG->getCopyFromReg(Chain, DL, DestReg, PtrVT); + SDValue(Rdhwr, 0), SDValue(Rdhwr, 1)); + SDValue ResNode = CurDAG->getCopyFromReg(Chain, DL, DestReg, PtrVT, + Chain.getValue(1)); ReplaceNode(Node, ResNode.getNode()); return true; } From nobody Sat Nov 13 20:57:13 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AE31C185021C; Sat, 13 Nov 2021 20:57:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs77G4ghGz3pNK; Sat, 13 Nov 2021 20:57:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5499E19DFB; Sat, 13 Nov 2021 20:57:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ADKvDru017553; Sat, 13 Nov 2021 20:57:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ADKvDOG017552; Sat, 13 Nov 2021 20:57:13 GMT (envelope-from git) Date: Sat, 13 Nov 2021 20:57:13 GMT Message-Id: <202111132057.1ADKvDOG017552@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: a18c6161efc9 - main - Fix assertion when building devel/glog with new pass manager List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a18c6161efc903f636c41b8e521e917a5b315ce8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=a18c6161efc903f636c41b8e521e917a5b315ce8 commit a18c6161efc903f636c41b8e521e917a5b315ce8 Author: Dimitry Andric AuthorDate: 2021-11-02 10:17:37 +0000 Commit: Dimitry Andric CommitDate: 2021-11-13 20:52:24 +0000 Fix assertion when building devel/glog with new pass manager Merge commit 029f1a534489 from llvm git (by Arthur Eubanks): [LazyCallGraph] Skip blockaddresses blockaddresses do not participate in the call graph since the only instructions that use them must all return to someplace within the current function. And passes cannot retrieve a function address from a blockaddress. This was suggested by efriedma in D58260. Fixes PR50881. Reviewed By: nickdesaulniers Differential Revision: https://reviews.llvm.org/D112178 --- .../llvm/include/llvm/Analysis/LazyCallGraph.h | 24 +++------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/contrib/llvm-project/llvm/include/llvm/Analysis/LazyCallGraph.h b/contrib/llvm-project/llvm/include/llvm/Analysis/LazyCallGraph.h index 81500905c0f5..148be34aa73b 100644 --- a/contrib/llvm-project/llvm/include/llvm/Analysis/LazyCallGraph.h +++ b/contrib/llvm-project/llvm/include/llvm/Analysis/LazyCallGraph.h @@ -1098,28 +1098,10 @@ public: continue; } - // The blockaddress constant expression is a weird special case, we can't - // generically walk its operands the way we do for all other constants. - if (BlockAddress *BA = dyn_cast(C)) { - // If we've already visited the function referred to by the block - // address, we don't need to revisit it. - if (Visited.count(BA->getFunction())) - continue; - - // If all of the blockaddress' users are instructions within the - // referred to function, we don't need to insert a cycle. - if (llvm::all_of(BA->users(), [&](User *U) { - if (Instruction *I = dyn_cast(U)) - return I->getFunction() == BA->getFunction(); - return false; - })) - continue; - - // Otherwise we should go visit the referred to function. - Visited.insert(BA->getFunction()); - Worklist.push_back(BA->getFunction()); + // blockaddresses are weird and don't participate in the call graph anyway, + // skip them. + if (isa(C)) continue; - } for (Value *Op : C->operand_values()) if (Visited.insert(cast(Op)).second) From nobody Sat Nov 13 20:57:14 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7AD5F185028C; Sat, 13 Nov 2021 20:57:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs77H39z1z3pbc; Sat, 13 Nov 2021 20:57:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 712E819FE9; Sat, 13 Nov 2021 20:57:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ADKvEJZ017583; Sat, 13 Nov 2021 20:57:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ADKvEGw017582; Sat, 13 Nov 2021 20:57:14 GMT (envelope-from git) Date: Sat, 13 Nov 2021 20:57:14 GMT Message-Id: <202111132057.1ADKvEGw017582@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 397a8ba05313 - main - Apply fix for LLVM PR51957 (Miscompilation in Botan's SHA3) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 397a8ba05313cc3815d219c9d1b2de1372fcb561 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=397a8ba05313cc3815d219c9d1b2de1372fcb561 commit 397a8ba05313cc3815d219c9d1b2de1372fcb561 Author: Dimitry Andric AuthorDate: 2021-11-10 18:38:23 +0000 Commit: Dimitry Andric CommitDate: 2021-11-13 20:52:25 +0000 Apply fix for LLVM PR51957 (Miscompilation in Botan's SHA3) Merge commit e27a6db5298f from llvm git (by Jameson Nash): Bad SLPVectorization shufflevector replacement, resulting in write to wrong memory location We see that it might otherwise do: %10 = getelementptr {}**, <2 x {}***> %9, <2 x i32> %11 = bitcast <2 x {}***> %10 to <2 x i64*> ... %27 = extractelement <2 x i64*> %11, i32 0 %28 = bitcast i64* %27 to <2 x i64>* store <2 x i64> %22, <2 x i64>* %28, align 4, !tbaa !2 Which is an out-of-bounds store (the extractelement got offset 10 instead of offset 4 as intended). With the fix, we correctly generate extractelement for i32 1 and generate correct code. Differential Revision: https://reviews.llvm.org/D106613 --- .../lib/Transforms/Vectorize/SLPVectorizer.cpp | 25 ++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/contrib/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/contrib/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index cc3f5c7d4b48..1d06bc7d79a7 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -5430,8 +5430,11 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) { // The pointer operand uses an in-tree scalar so we add the new BitCast // to ExternalUses list to make sure that an extract will be generated // in the future. - if (getTreeEntry(PO)) - ExternalUses.emplace_back(PO, cast(VecPtr), 0); + if (TreeEntry *Entry = getTreeEntry(PO)) { + // Find which lane we need to extract. + unsigned FoundLane = Entry->findLaneForValue(PO); + ExternalUses.emplace_back(PO, cast(VecPtr), FoundLane); + } NewLI = Builder.CreateAlignedLoad(VecTy, VecPtr, LI->getAlign()); } else { @@ -5474,8 +5477,12 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) { // The pointer operand uses an in-tree scalar, so add the new BitCast to // ExternalUses to make sure that an extract will be generated in the // future. - if (getTreeEntry(ScalarPtr)) - ExternalUses.push_back(ExternalUser(ScalarPtr, cast(VecPtr), 0)); + if (TreeEntry *Entry = getTreeEntry(ScalarPtr)) { + // Find which lane we need to extract. + unsigned FoundLane = Entry->findLaneForValue(ScalarPtr); + ExternalUses.push_back( + ExternalUser(ScalarPtr, cast(VecPtr), FoundLane)); + } Value *V = propagateMetadata(ST, E->Scalars); @@ -5577,8 +5584,14 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) { // The scalar argument uses an in-tree scalar so we add the new vectorized // call to ExternalUses list to make sure that an extract will be // generated in the future. - if (ScalarArg && getTreeEntry(ScalarArg)) - ExternalUses.push_back(ExternalUser(ScalarArg, cast(V), 0)); + if (ScalarArg) { + if (TreeEntry *Entry = getTreeEntry(ScalarArg)) { + // Find which lane we need to extract. + unsigned FoundLane = Entry->findLaneForValue(ScalarArg); + ExternalUses.push_back( + ExternalUser(ScalarArg, cast(V), FoundLane)); + } + } propagateIRFlags(V, E->Scalars, VL0); ShuffleBuilder.addMask(E->ReuseShuffleIndices); From nobody Sat Nov 13 20:57:15 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6998D1850235; Sat, 13 Nov 2021 20:57:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs77J4BL2z3pYq; Sat, 13 Nov 2021 20:57:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3D361A3A6; Sat, 13 Nov 2021 20:57:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ADKvFMG017607; Sat, 13 Nov 2021 20:57:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ADKvFRi017606; Sat, 13 Nov 2021 20:57:15 GMT (envelope-from git) Date: Sat, 13 Nov 2021 20:57:15 GMT Message-Id: <202111132057.1ADKvFRi017606@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: a2fa290024e7 - main - mips: Fix build of kernel.tramp.bin after upstream merge List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a2fa290024e73107a214e37c257ce93a3f131a41 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=a2fa290024e73107a214e37c257ce93a3f131a41 commit a2fa290024e73107a214e37c257ce93a3f131a41 Author: Jessica Clarke AuthorDate: 2021-11-11 18:28:24 +0000 Commit: Dimitry Andric CommitDate: 2021-11-13 20:52:26 +0000 mips: Fix build of kernel.tramp.bin after upstream merge Since the upstream merge we end up with the compiler generating calls to memcpy (and it appears upstream LLVM does too, so this will probably also be a problem upstream when the LLVM 13 import is finished). Like the kernel we should just compile this file with -ffreestanding to avoid such surprises. Note that elf_trampoline.c does actually provide a memcpy, but it's static. That's a bit weird, and means by the time the memcpy calls are generated by the compiler the explicit ones have already been inlined and the function itself GC'ed, but since using -ffreestanding is the right thing to do for this kind of code anyway, that doesn't actually matter. Obtained from: https://github.com/CTSRD-CHERI/cheribsd/commit/219ddb6293c --- sys/conf/Makefile.mips | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/conf/Makefile.mips b/sys/conf/Makefile.mips index add27c1752a1..e8dd61d10a1d 100644 --- a/sys/conf/Makefile.mips +++ b/sys/conf/Makefile.mips @@ -57,6 +57,8 @@ TRAMP_ARCH_FLAGS?=$(ARCH_FLAGS) TRAMP_EXTRA_FLAGS=${EXTRA_FLAGS} ${TRAMP_ARCH_FLAGS} # Kernel code is always compiled with soft-float on MIPS TRAMP_EXTRA_FLAGS+=-msoft-float +# No standard library available +TRAMP_EXTRA_FLAGS+=-ffreestanding .if ${MACHINE_ARCH:Mmips64*} != "" TRAMP_ELFSIZE=64 .else From nobody Sat Nov 13 20:57:16 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9FBE01850241; Sat, 13 Nov 2021 20:57:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs77K3cz7z3pTQ; Sat, 13 Nov 2021 20:57:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC2F21A2F4; Sat, 13 Nov 2021 20:57:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ADKvGU0017631; Sat, 13 Nov 2021 20:57:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ADKvGH4017630; Sat, 13 Nov 2021 20:57:16 GMT (envelope-from git) Date: Sat, 13 Nov 2021 20:57:16 GMT Message-Id: <202111132057.1ADKvGH4017630@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 20aa359773be - main - Bump __FreeBSD_version for llvm-project 13.0.0 merge List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 20aa359773befc8182f6b5dcb5aad7390cab6c26 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=20aa359773befc8182f6b5dcb5aad7390cab6c26 commit 20aa359773befc8182f6b5dcb5aad7390cab6c26 Author: Dimitry Andric AuthorDate: 2021-11-13 20:02:29 +0000 Commit: Dimitry Andric CommitDate: 2021-11-13 20:52:35 +0000 Bump __FreeBSD_version for llvm-project 13.0.0 merge PR: 258209 MFC after: 2 weeks --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index 61774a80e2f9..74c1beea4968 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -76,7 +76,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400041 +#define __FreeBSD_version 1400042 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Sun Nov 14 12:34:20 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AE01A183C2A9; Sun, 14 Nov 2021 12:34:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HsWwX4WJZz4cJl; Sun, 14 Nov 2021 12:34:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FF282688D; Sun, 14 Nov 2021 12:34:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AECYKku068397; Sun, 14 Nov 2021 12:34:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AECYKvV068396; Sun, 14 Nov 2021 12:34:20 GMT (envelope-from git) Date: Sun, 14 Nov 2021 12:34:20 GMT Message-Id: <202111141234.1AECYKvV068396@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 51919325ffd3 - main - arm64: rockchip: Move rk805 pmic driver to dev/iicbus/pmic/rockchip List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 51919325ffd32c3881542bce54ce4482875598fd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=51919325ffd32c3881542bce54ce4482875598fd commit 51919325ffd32c3881542bce54ce4482875598fd Author: Emmanuel Vadot AuthorDate: 2021-11-11 17:44:03 +0000 Commit: Emmanuel Vadot CommitDate: 2021-11-14 11:31:07 +0000 arm64: rockchip: Move rk805 pmic driver to dev/iicbus/pmic/rockchip Having all PMIC driver at the same place makes it easier. --- sys/conf/files.arm64 | 2 +- sys/{arm64 => dev/iicbus/pmic}/rockchip/rk805.c | 2 +- sys/{arm64 => dev/iicbus/pmic}/rockchip/rk805reg.h | 0 sys/modules/rockchip/rk805/Makefile | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index a2cf15de1ac0..1f344d0273b8 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -540,7 +540,7 @@ arm64/rockchip/rk3399_emmcphy.c optional fdt rk_emmcphy soc_rockchip_rk3399 arm64/rockchip/rk_dwc3.c optional fdt rk_dwc3 soc_rockchip_rk3399 arm64/rockchip/rk_i2c.c optional fdt rk_i2c soc_rockchip_rk3328 | fdt rk_i2c soc_rockchip_rk3399 arm64/rockchip/rk_i2s.c optional fdt sound soc_rockchip_rk3328 | fdt sound soc_rockchip_rk3399 -arm64/rockchip/rk805.c optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399 +dev/iicbus/pmic/rockchip/rk805.c optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399 arm64/rockchip/rk_grf.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 arm64/rockchip/rk_pinctrl.c optional fdt rk_pinctrl soc_rockchip_rk3328 | fdt rk_pinctrl soc_rockchip_rk3399 arm64/rockchip/rk_gpio.c optional fdt rk_gpio soc_rockchip_rk3328 | fdt rk_gpio soc_rockchip_rk3399 diff --git a/sys/arm64/rockchip/rk805.c b/sys/dev/iicbus/pmic/rockchip/rk805.c similarity index 99% rename from sys/arm64/rockchip/rk805.c rename to sys/dev/iicbus/pmic/rockchip/rk805.c index d3bda29ae362..27e9e3a5287e 100644 --- a/sys/arm64/rockchip/rk805.c +++ b/sys/dev/iicbus/pmic/rockchip/rk805.c @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "clock_if.h" #include "regdev_if.h" diff --git a/sys/arm64/rockchip/rk805reg.h b/sys/dev/iicbus/pmic/rockchip/rk805reg.h similarity index 100% rename from sys/arm64/rockchip/rk805reg.h rename to sys/dev/iicbus/pmic/rockchip/rk805reg.h diff --git a/sys/modules/rockchip/rk805/Makefile b/sys/modules/rockchip/rk805/Makefile index 395b9fc49c72..386e41c05bad 100644 --- a/sys/modules/rockchip/rk805/Makefile +++ b/sys/modules/rockchip/rk805/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${SRCTOP}/sys/arm64/rockchip +.PATH: ${SRCTOP}/sys/dev/iicbus/pmic/rockchip KMOD= rk805 SRCS= rk805.c From nobody Sun Nov 14 12:34:21 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C922B183C033; Sun, 14 Nov 2021 12:34:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HsWwY5KmMz4cLs; Sun, 14 Nov 2021 12:34:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 976A226983; Sun, 14 Nov 2021 12:34:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AECYLgS068424; Sun, 14 Nov 2021 12:34:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AECYLd7068423; Sun, 14 Nov 2021 12:34:21 GMT (envelope-from git) Date: Sun, 14 Nov 2021 12:34:21 GMT Message-Id: <202111141234.1AECYLd7068423@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 43301ad2b63c - main - pmic: rockchip: Add dedicated file for rk808 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43301ad2b63c19532b13f3a85c9c46f9a8b11516 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=43301ad2b63c19532b13f3a85c9c46f9a8b11516 commit 43301ad2b63c19532b13f3a85c9c46f9a8b11516 Author: Emmanuel Vadot AuthorDate: 2021-11-11 18:18:57 +0000 Commit: Emmanuel Vadot CommitDate: 2021-11-14 11:31:12 +0000 pmic: rockchip: Add dedicated file for rk808 While here rename registers for rk805 and rk808 based on the names on the datasheet. No functional changes intended. --- sys/dev/iicbus/pmic/rockchip/rk805.c | 47 ++++++------ sys/dev/iicbus/pmic/rockchip/rk805reg.h | 90 +++++++++------------- sys/dev/iicbus/pmic/rockchip/rk808reg.h | 127 ++++++++++++++++++++++++++++++++ 3 files changed, 185 insertions(+), 79 deletions(-) diff --git a/sys/dev/iicbus/pmic/rockchip/rk805.c b/sys/dev/iicbus/pmic/rockchip/rk805.c index 27e9e3a5287e..14996a792739 100644 --- a/sys/dev/iicbus/pmic/rockchip/rk805.c +++ b/sys/dev/iicbus/pmic/rockchip/rk805.c @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "clock_if.h" #include "regdev_if.h" @@ -114,11 +115,11 @@ static int rk805_regnode_get_voltage(struct regnode *regnode, int *uvolt); static struct rk805_regdef rk805_regdefs[] = { { - .id = RK805_DCDC1, + .id = RK805_BUCK1, .name = "DCDC_REG1", .enable_reg = RK805_DCDC_EN, .enable_mask = 0x11, - .voltage_reg = RK805_DCDC1_ON_VSEL, + .voltage_reg = RK805_BUCK1_ON_VSEL, .voltage_mask = 0x3F, .voltage_min = 712500, .voltage_max = 1450000, @@ -126,11 +127,11 @@ static struct rk805_regdef rk805_regdefs[] = { .voltage_nstep = 64, }, { - .id = RK805_DCDC2, + .id = RK805_BUCK2, .name = "DCDC_REG2", .enable_reg = RK805_DCDC_EN, .enable_mask = 0x22, - .voltage_reg = RK805_DCDC2_ON_VSEL, + .voltage_reg = RK805_BUCK2_ON_VSEL, .voltage_mask = 0x3F, .voltage_min = 712500, .voltage_max = 1450000, @@ -138,17 +139,17 @@ static struct rk805_regdef rk805_regdefs[] = { .voltage_nstep = 64, }, { - .id = RK805_DCDC3, + .id = RK805_BUCK3, .name = "DCDC_REG3", .enable_reg = RK805_DCDC_EN, .enable_mask = 0x44, }, { - .id = RK805_DCDC4, + .id = RK805_BUCK4, .name = "DCDC_REG4", .enable_reg = RK805_DCDC_EN, .enable_mask = 0x88, - .voltage_reg = RK805_DCDC4_ON_VSEL, + .voltage_reg = RK805_BUCK4_ON_VSEL, .voltage_mask = 0x3F, .voltage_min = 800000, .voltage_max = 3500000, @@ -195,11 +196,11 @@ static struct rk805_regdef rk805_regdefs[] = { static struct rk805_regdef rk808_regdefs[] = { { - .id = RK805_DCDC1, + .id = RK808_BUCK1, .name = "DCDC_REG1", - .enable_reg = RK805_DCDC_EN, + .enable_reg = RK808_DCDC_EN, .enable_mask = 0x1, - .voltage_reg = RK805_DCDC1_ON_VSEL, + .voltage_reg = RK808_BUCK1_ON_VSEL, .voltage_mask = 0x3F, .voltage_min = 712500, .voltage_max = 1500000, @@ -207,11 +208,11 @@ static struct rk805_regdef rk808_regdefs[] = { .voltage_nstep = 64, }, { - .id = RK805_DCDC2, + .id = RK808_BUCK2, .name = "DCDC_REG2", - .enable_reg = RK805_DCDC_EN, + .enable_reg = RK808_DCDC_EN, .enable_mask = 0x2, - .voltage_reg = RK805_DCDC2_ON_VSEL, + .voltage_reg = RK808_BUCK2_ON_VSEL, .voltage_mask = 0x3F, .voltage_min = 712500, .voltage_max = 1500000, @@ -220,17 +221,17 @@ static struct rk805_regdef rk808_regdefs[] = { }, { /* BUCK3 voltage is calculated based on external resistor */ - .id = RK805_DCDC3, + .id = RK808_BUCK3, .name = "DCDC_REG3", - .enable_reg = RK805_DCDC_EN, + .enable_reg = RK808_DCDC_EN, .enable_mask = 0x4, }, { - .id = RK805_DCDC4, + .id = RK808_BUCK4, .name = "DCDC_REG4", - .enable_reg = RK805_DCDC_EN, + .enable_reg = RK808_DCDC_EN, .enable_mask = 0x8, - .voltage_reg = RK805_DCDC4_ON_VSEL, + .voltage_reg = RK808_BUCK4_ON_VSEL, .voltage_mask = 0xF, .voltage_min = 1800000, .voltage_max = 3300000, @@ -242,7 +243,7 @@ static struct rk805_regdef rk808_regdefs[] = { .name = "LDO_REG1", .enable_reg = RK808_LDO_EN, .enable_mask = 0x1, - .voltage_reg = RK805_LDO1_ON_VSEL, + .voltage_reg = RK808_LDO1_ON_VSEL, .voltage_mask = 0x1F, .voltage_min = 1800000, .voltage_max = 3400000, @@ -254,7 +255,7 @@ static struct rk805_regdef rk808_regdefs[] = { .name = "LDO_REG2", .enable_reg = RK808_LDO_EN, .enable_mask = 0x2, - .voltage_reg = RK805_LDO2_ON_VSEL, + .voltage_reg = RK808_LDO2_ON_VSEL, .voltage_mask = 0x1F, .voltage_min = 1800000, .voltage_max = 3400000, @@ -266,7 +267,7 @@ static struct rk805_regdef rk808_regdefs[] = { .name = "LDO_REG3", .enable_reg = RK808_LDO_EN, .enable_mask = 0x4, - .voltage_reg = RK805_LDO3_ON_VSEL, + .voltage_reg = RK808_LDO3_ON_VSEL, .voltage_mask = 0xF, .voltage_min = 800000, .voltage_max = 2500000, @@ -336,7 +337,7 @@ static struct rk805_regdef rk808_regdefs[] = { { .id = RK808_SWITCH1, .name = "SWITCH_REG1", - .enable_reg = RK805_DCDC_EN, + .enable_reg = RK808_DCDC_EN, .enable_mask = 0x20, .voltage_min = 3000000, .voltage_max = 3000000, @@ -344,7 +345,7 @@ static struct rk805_regdef rk808_regdefs[] = { { .id = RK808_SWITCH2, .name = "SWITCH_REG2", - .enable_reg = RK805_DCDC_EN, + .enable_reg = RK808_DCDC_EN, .enable_mask = 0x40, .voltage_min = 3000000, .voltage_max = 3000000, diff --git a/sys/dev/iicbus/pmic/rockchip/rk805reg.h b/sys/dev/iicbus/pmic/rockchip/rk805reg.h index 61c6f49abd2c..449ac9bdab7a 100644 --- a/sys/dev/iicbus/pmic/rockchip/rk805reg.h +++ b/sys/dev/iicbus/pmic/rockchip/rk805reg.h @@ -30,98 +30,76 @@ #ifndef _RK805REG_H_ #define _RK805REG_H_ -/* - * The RTC registers are the same in both RK805 and RK808. - * Note that the code assumes that RK805_RTC_SECS is 0 - */ +/* RTC registers */ #define RK805_RTC_SECS 0x00 -#define RK805_RTC_SECS_MASK 0x7f +#define RK805_RTC_SECS_MASK 0x7f #define RK805_RTC_MINUTES 0x01 -#define RK805_RTC_MINUTES_MASK 0x7f +#define RK805_RTC_MINUTES_MASK 0x7f #define RK805_RTC_HOURS 0x02 -#define RK805_RTC_HOURS_MASK 0x3f +#define RK805_RTC_HOURS_MASK 0x3f #define RK805_RTC_HOURS_PM 0x80 #define RK805_RTC_DAYS 0x03 -#define RK805_RTC_DAYS_MASK 0x3f +#define RK805_RTC_DAYS_MASK 0x3f #define RK805_RTC_MONTHS 0x04 -#define RK805_RTC_MONTHS_MASK 0x1f +#define RK805_RTC_MONTHS_MASK 0x1f #define RK805_RTC_YEARS 0x05 #define RK805_RTC_WEEKS 0x06 /* day of week */ -#define RK805_RTC_WEEKS_MASK 0x07 - +#define RK805_RTC_WEEKS_MASK 0x07 +#define RK805_ALARM_SECONDS 0x8 +#define RK805_ALARM_MINUTES 0x9 +#define RK805_ALARM_HOURS 0xA +#define RK805_ALARM_DAYS 0xB +#define RK805_ALARM_MONTHS 0xC +#define RK805_ALARM_YEARS 0xD #define RK805_RTC_CTRL 0x10 #define RK805_RTC_CTRL_STOP (1 << 0) #define RK805_RTC_AMPM_MODE (1 << 3) #define RK805_RTC_GET_TIME (1 << 6) #define RK805_RTC_READSEL (1 << 7) +#define RK805_CLK32KOUT 0x20 +/* Version registers */ #define RK805_CHIP_NAME 0x17 #define RK805_CHIP_VER 0x18 #define RK805_OTP_VER 0x19 +/* Power channel enable registers */ #define RK805_DCDC_EN 0x23 -#define RK808_LDO_EN 0x24 -#define RK805_SLEEP_DCDC_EN 0x25 -#define RK805_SLEEP_LDO_EN 0x26 +#define RK805_SLP_DCDC_EN 0x25 +#define RK805_SLP_LDO_EN 0x26 #define RK805_LDO_EN 0x27 -#define RK805_SLEEP_LDO_LP_EN 0x2A +#define RK805_BUCK_LDO_SLP_LP 0x2A -#define RK805_DCDC1_CONFIG 0x2E -#define RK805_DCDC1_ON_VSEL 0x2F -#define RK805_DCDC1_SLEEP_VSEL 0x30 -#define RK805_DCDC2_CONFIG 0x32 -#define RK805_DCDC2_ON_VSEL 0x33 -#define RK805_DCDC2_SLEEP_VSEL 0x34 -#define RK805_DCDC3_CONFIG 0x36 -#define RK805_DCDC4_CONFIG 0x37 -#define RK805_DCDC4_ON_VSEL 0x38 -#define RK805_DCDC4_SLEEP_VSEL 0x39 +/* Buck and LDO configuration registers */ +#define RK805_BUCK1_CONFIG 0x2E +#define RK805_BUCK1_ON_VSEL 0x2F +#define RK805_BUCK1_SLEEP_VSEL 0x30 +#define RK805_BUCK2_CONFIG 0x32 +#define RK805_BUCK2_ON_VSEL 0x33 +#define RK805_BUCK2_SLEEP_VSEL 0x34 +#define RK805_BUCK3_CONFIG 0x36 +#define RK805_BUCK4_CONFIG 0x37 +#define RK805_BUCK4_ON_VSEL 0x38 +#define RK805_BUCK4_SLEEP_VSEL 0x39 #define RK805_LDO1_ON_VSEL 0x3B #define RK805_LDO1_SLEEP_VSEL 0x3C #define RK805_LDO2_ON_VSEL 0x3D #define RK805_LDO2_SLEEP_VSEL 0x3E #define RK805_LDO3_ON_VSEL 0x3F #define RK805_LDO3_SLEEP_VSEL 0x40 -#define RK808_LDO4_ON_VSEL 0x41 -#define RK808_LDO4_SLEEP_VSEL 0x42 -#define RK808_LDO5_ON_VSEL 0x43 -#define RK808_LDO5_SLEEP_VSEL 0x44 -#define RK808_LDO6_ON_VSEL 0x45 -#define RK808_LDO6_SLEEP_VSEL 0x46 -#define RK808_LDO7_ON_VSEL 0x47 -#define RK808_LDO7_SLEEP_VSEL 0x48 -#define RK808_LDO8_ON_VSEL 0x49 -#define RK808_LDO8_SLEEP_VSEL 0x4A #define RK805_DEV_CTRL 0x4B #define RK805_DEV_CTRL_OFF (1 << 0) #define RK805_DEV_CTRL_SLP (1 << 1) enum rk805_regulator { - RK805_DCDC1 = 0, - RK805_DCDC2, - RK805_DCDC3, - RK805_DCDC4, + RK805_BUCK1 = 0, + RK805_BUCK2, + RK805_BUCK3, + RK805_BUCK4, RK805_LDO1, RK805_LDO2, RK805_LDO3, }; -enum rk808_regulator { - RK808_DCDC1 = 0, - RK808_DCDC2, - RK808_DCDC3, - RK808_DCDC4, - RK808_LDO1, - RK808_LDO2, - RK808_LDO3, - RK808_LDO4, - RK808_LDO5, - RK808_LDO6, - RK808_LDO7, - RK808_LDO8, - RK808_SWITCH1, - RK808_SWITCH2, -}; - #endif /* _RK805REG_H_ */ diff --git a/sys/dev/iicbus/pmic/rockchip/rk808reg.h b/sys/dev/iicbus/pmic/rockchip/rk808reg.h new file mode 100644 index 000000000000..054cac45f1d6 --- /dev/null +++ b/sys/dev/iicbus/pmic/rockchip/rk808reg.h @@ -0,0 +1,127 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018-2021 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _RK808REG_H_ +#define _RK808REG_H_ + +/* RTC registers */ +#define RK808_RTC_SECS 0x00 +#define RK808_RTC_SECS_MASK 0x7f +#define RK808_RTC_MINUTES 0x01 +#define RK808_RTC_MINUTES_MASK 0x7f +#define RK808_RTC_HOURS 0x02 +#define RK808_RTC_HOURS_MASK 0x3f +#define RK808_RTC_DAYS 0x03 +#define RK808_RTC_DAYS_MASK 0x3f +#define RK808_RTC_MONTHS 0x04 +#define RK808_RTC_MONTHS_MASK 0x1f +#define RK808_RTC_YEARS 0x05 +#define RK808_RTC_WEEKS 0x06 /* day of week */ +#define RK808_RTC_WEEKS_MASK 0x07 +#define RK808_ALARM_SECONDS 0x8 +#define RK808_ALARM_MINUTES 0x9 +#define RK808_ALARM_HOURS 0xA +#define RK808_ALARM_DAYS 0xB +#define RK808_ALARM_MONTHS 0xC +#define RK808_ALARM_YEARS 0xD +#define RK808_RTC_CTRL 0x10 +#define RK808_RTC_CTRL_STOP (1 << 0) +#define RK808_RTC_AMPM_MODE (1 << 3) +#define RK808_RTC_GET_TIME (1 << 6) +#define RK808_RTC_READSEL (1 << 7) +#define RK808_RTC_STATUS 0x11 +#define RK808_RTC_INT 0x12 +#define RK808_RTC_COMP_LSB 0x13 +#define RK808_RTC_COMP_MSB 0x14 + +/* Misc registers*/ +#define RK808_CLK32KOUT 0x20 +#define RK808_VB_MON 0x21 +#define RK808_THERMAL 0x22 + +/* Power channel control and monitoring registers */ +#define RK808_DCDC_EN 0x23 +#define RK808_LDO_EN 0x24 +#define RK808_SLEEP_SET_OFF_1 0x25 +#define RK808_SLEEP_SET_OFF_2 0x26 +#define RK808_DCDC_UV_STS 0x27 +#define RK808_DCDC_UV_ACT 0x28 +#define RK808_LDO_UV_STS 0x29 +#define RK808_LDO_UV_ACT 0x2A +#define RK808_DCDC_PG 0x2B +#define RK808_LDO_PG 0x2C +#define RK808_VOUT_MON_TDB 0x2D + +/* Power channel configuration registers */ +#define RK808_BUCK1_CONFIG 0x2E +#define RK808_BUCK1_ON_VSEL 0x2F +#define RK808_BUCK1_SLP_VSEL 0x30 +#define RK808_BUCK2_CONFIG 0x32 +#define RK808_BUCK2_ON_VSEL 0x33 +#define RK808_BUCK2_SLEEP_VSEL 0x34 +#define RK808_BUCK3_CONFIG 0x36 +#define RK808_BUCK4_CONFIG 0x37 +#define RK808_BUCK4_ON_VSEL 0x38 +#define RK808_BUCK4_SLEEP_VSEL 0x39 +#define RK808_DCDC_ILMAX_REG 0x90 +#define RK808_LDO1_ON_VSEL 0x3B +#define RK808_LDO1_SLEEP_VSEL 0x3C +#define RK808_LDO2_ON_VSEL 0x3D +#define RK808_LDO2_SLEEP_VSEL 0x3E +#define RK808_LDO3_ON_VSEL 0x3F +#define RK808_LDO3_SLEEP_VSEL 0x40 +#define RK808_LDO4_ON_VSEL 0x41 +#define RK808_LDO4_SLEEP_VSEL 0x42 +#define RK808_LDO5_ON_VSEL 0x43 +#define RK808_LDO5_SLEEP_VSEL 0x44 +#define RK808_LDO6_ON_VSEL 0x45 +#define RK808_LDO6_SLEEP_VSEL 0x46 +#define RK808_LDO7_ON_VSEL 0x47 +#define RK808_LDO7_SLEEP_VSEL 0x48 +#define RK808_LDO8_ON_VSEL 0x49 +#define RK808_LDO8_SLEEP_VSEL 0x4A + +enum rk808_regulator { + RK808_BUCK1 = 0, + RK808_BUCK2, + RK808_BUCK3, + RK808_BUCK4, + RK808_LDO1, + RK808_LDO2, + RK808_LDO3, + RK808_LDO4, + RK808_LDO5, + RK808_LDO6, + RK808_LDO7, + RK808_LDO8, + RK808_SWITCH1, + RK808_SWITCH2, +}; + +#endif /* _RK808REG_H_ */ From nobody Sun Nov 14 12:34:22 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6A145183BEDF; Sun, 14 Nov 2021 12:34:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HsWwb07H2z4cJw; Sun, 14 Nov 2021 12:34:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB34726907; Sun, 14 Nov 2021 12:34:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AECYMN5068448; Sun, 14 Nov 2021 12:34:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AECYMoa068447; Sun, 14 Nov 2021 12:34:22 GMT (envelope-from git) Date: Sun, 14 Nov 2021 12:34:22 GMT Message-Id: <202111141234.1AECYMoa068447@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: c9b101d2412f - main - pmic: rockchip: Rename most of rk805 driver to rk8xx List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c9b101d2412f058bb0612dae8dbf0b7f01ba1814 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=c9b101d2412f058bb0612dae8dbf0b7f01ba1814 commit c9b101d2412f058bb0612dae8dbf0b7f01ba1814 Author: Emmanuel Vadot AuthorDate: 2021-11-11 18:43:13 +0000 Commit: Emmanuel Vadot CommitDate: 2021-11-14 11:31:15 +0000 pmic: rockchip: Rename most of rk805 driver to rk8xx This is in preparation of correctly splitting the driver. No functional changes intended. --- sys/dev/iicbus/pmic/rockchip/rk805.c | 222 +++++++++++++++++------------------ 1 file changed, 111 insertions(+), 111 deletions(-) diff --git a/sys/dev/iicbus/pmic/rockchip/rk805.c b/sys/dev/iicbus/pmic/rockchip/rk805.c index 14996a792739..76c8462e694e 100644 --- a/sys/dev/iicbus/pmic/rockchip/rk805.c +++ b/sys/dev/iicbus/pmic/rockchip/rk805.c @@ -70,7 +70,7 @@ static struct ofw_compat_data compat_data[] = { {NULL, 0} }; -struct rk805_regdef { +struct rk8xx_regdef { intptr_t id; char *name; uint8_t enable_reg; @@ -83,20 +83,20 @@ struct rk805_regdef { int voltage_nstep; }; -struct rk805_reg_sc { +struct rk8xx_reg_sc { struct regnode *regnode; device_t base_dev; - struct rk805_regdef *def; + struct rk8xx_regdef *def; phandle_t xref; struct regnode_std_param *param; }; struct reg_list { TAILQ_ENTRY(reg_list) next; - struct rk805_reg_sc *reg; + struct rk8xx_reg_sc *reg; }; -struct rk805_softc { +struct rk8xx_softc { device_t dev; struct mtx mtx; struct resource * res[1]; @@ -108,12 +108,12 @@ struct rk805_softc { int nregs; }; -static int rk805_regnode_status(struct regnode *regnode, int *status); -static int rk805_regnode_set_voltage(struct regnode *regnode, int min_uvolt, +static int rk8xx_regnode_status(struct regnode *regnode, int *status); +static int rk8xx_regnode_set_voltage(struct regnode *regnode, int min_uvolt, int max_uvolt, int *udelay); -static int rk805_regnode_get_voltage(struct regnode *regnode, int *uvolt); +static int rk8xx_regnode_get_voltage(struct regnode *regnode, int *uvolt); -static struct rk805_regdef rk805_regdefs[] = { +static struct rk8xx_regdef rk805_regdefs[] = { { .id = RK805_BUCK1, .name = "DCDC_REG1", @@ -194,7 +194,7 @@ static struct rk805_regdef rk805_regdefs[] = { }, }; -static struct rk805_regdef rk808_regdefs[] = { +static struct rk8xx_regdef rk808_regdefs[] = { { .id = RK808_BUCK1, .name = "DCDC_REG1", @@ -353,7 +353,7 @@ static struct rk805_regdef rk808_regdefs[] = { }; static int -rk805_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) +rk8xx_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) { int err; @@ -362,16 +362,16 @@ rk805_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) } static int -rk805_write(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) +rk8xx_write(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) { return (iicdev_writeto(dev, reg, data, size, IIC_INTRWAIT)); } static int -rk805_regnode_init(struct regnode *regnode) +rk8xx_regnode_init(struct regnode *regnode) { - struct rk805_reg_sc *sc; + struct rk8xx_reg_sc *sc; struct regnode_std_param *param; int rv, udelay, uvolt, status; @@ -382,7 +382,7 @@ rk805_regnode_init(struct regnode *regnode) return (0); /* Check that the regulator is preset to the correct voltage */ - rv = rk805_regnode_get_voltage(regnode, &uvolt); + rv = rk8xx_regnode_get_voltage(regnode, &uvolt); if (rv != 0) return(rv); @@ -393,11 +393,11 @@ rk805_regnode_init(struct regnode *regnode) * Do not enable it, this is will be done either by a * consumer or by regnode_set_constraint if boot_on is true */ - rv = rk805_regnode_status(regnode, &status); + rv = rk8xx_regnode_status(regnode, &status); if (rv != 0 || status == REGULATOR_STATUS_ENABLED) return (rv); - rv = rk805_regnode_set_voltage(regnode, param->min_uvolt, + rv = rk8xx_regnode_set_voltage(regnode, param->min_uvolt, param->max_uvolt, &udelay); if (udelay != 0) DELAY(udelay); @@ -406,9 +406,9 @@ rk805_regnode_init(struct regnode *regnode) } static int -rk805_regnode_enable(struct regnode *regnode, bool enable, int *udelay) +rk8xx_regnode_enable(struct regnode *regnode, bool enable, int *udelay) { - struct rk805_reg_sc *sc; + struct rk8xx_reg_sc *sc; uint8_t val; sc = regnode_get_softc(regnode); @@ -416,12 +416,12 @@ rk805_regnode_enable(struct regnode *regnode, bool enable, int *udelay) dprintf(sc, "%sabling regulator %s\n", enable ? "En" : "Dis", sc->def->name); - rk805_read(sc->base_dev, sc->def->enable_reg, &val, 1); + rk8xx_read(sc->base_dev, sc->def->enable_reg, &val, 1); if (enable) val |= sc->def->enable_mask; else val &= ~sc->def->enable_mask; - rk805_write(sc->base_dev, sc->def->enable_reg, &val, 1); + rk8xx_write(sc->base_dev, sc->def->enable_reg, &val, 1); *udelay = 0; @@ -429,7 +429,7 @@ rk805_regnode_enable(struct regnode *regnode, bool enable, int *udelay) } static void -rk805_regnode_reg_to_voltage(struct rk805_reg_sc *sc, uint8_t val, int *uv) +rk8xx_regnode_reg_to_voltage(struct rk8xx_reg_sc *sc, uint8_t val, int *uv) { if (val < sc->def->voltage_nstep) *uv = sc->def->voltage_min + val * sc->def->voltage_step; @@ -439,7 +439,7 @@ rk805_regnode_reg_to_voltage(struct rk805_reg_sc *sc, uint8_t val, int *uv) } static int -rk805_regnode_voltage_to_reg(struct rk805_reg_sc *sc, int min_uvolt, +rk8xx_regnode_voltage_to_reg(struct rk8xx_reg_sc *sc, int min_uvolt, int max_uvolt, uint8_t *val) { uint8_t nval; @@ -461,15 +461,15 @@ rk805_regnode_voltage_to_reg(struct rk805_reg_sc *sc, int min_uvolt, } static int -rk805_regnode_status(struct regnode *regnode, int *status) +rk8xx_regnode_status(struct regnode *regnode, int *status) { - struct rk805_reg_sc *sc; + struct rk8xx_reg_sc *sc; uint8_t val; sc = regnode_get_softc(regnode); *status = 0; - rk805_read(sc->base_dev, sc->def->enable_reg, &val, 1); + rk8xx_read(sc->base_dev, sc->def->enable_reg, &val, 1); if (val & sc->def->enable_mask) *status = REGULATOR_STATUS_ENABLED; @@ -477,10 +477,10 @@ rk805_regnode_status(struct regnode *regnode, int *status) } static int -rk805_regnode_set_voltage(struct regnode *regnode, int min_uvolt, +rk8xx_regnode_set_voltage(struct regnode *regnode, int min_uvolt, int max_uvolt, int *udelay) { - struct rk805_reg_sc *sc; + struct rk8xx_reg_sc *sc; uint8_t val; int uvolt; @@ -493,17 +493,17 @@ rk805_regnode_set_voltage(struct regnode *regnode, int min_uvolt, sc->def->name, min_uvolt, max_uvolt); - rk805_read(sc->base_dev, sc->def->voltage_reg, &val, 1); - if (rk805_regnode_voltage_to_reg(sc, min_uvolt, max_uvolt, &val) != 0) + rk8xx_read(sc->base_dev, sc->def->voltage_reg, &val, 1); + if (rk8xx_regnode_voltage_to_reg(sc, min_uvolt, max_uvolt, &val) != 0) return (ERANGE); - rk805_write(sc->base_dev, sc->def->voltage_reg, &val, 1); + rk8xx_write(sc->base_dev, sc->def->voltage_reg, &val, 1); - rk805_read(sc->base_dev, sc->def->voltage_reg, &val, 1); + rk8xx_read(sc->base_dev, sc->def->voltage_reg, &val, 1); *udelay = 0; - rk805_regnode_reg_to_voltage(sc, val, &uvolt); + rk8xx_regnode_reg_to_voltage(sc, val, &uvolt); dprintf(sc, "Regulator %s set to %d uvolt\n", sc->def->name, uvolt); @@ -512,9 +512,9 @@ rk805_regnode_set_voltage(struct regnode *regnode, int min_uvolt, } static int -rk805_regnode_get_voltage(struct regnode *regnode, int *uvolt) +rk8xx_regnode_get_voltage(struct regnode *regnode, int *uvolt) { - struct rk805_reg_sc *sc; + struct rk8xx_reg_sc *sc; uint8_t val; sc = regnode_get_softc(regnode); @@ -527,8 +527,8 @@ rk805_regnode_get_voltage(struct regnode *regnode, int *uvolt) if (!sc->def->voltage_step) return (ENXIO); - rk805_read(sc->base_dev, sc->def->voltage_reg, &val, 1); - rk805_regnode_reg_to_voltage(sc, val & sc->def->voltage_mask, uvolt); + rk8xx_read(sc->base_dev, sc->def->voltage_reg, &val, 1); + rk8xx_regnode_reg_to_voltage(sc, val & sc->def->voltage_mask, uvolt); dprintf(sc, "Regulator %s is at %d uvolt\n", sc->def->name, @@ -537,24 +537,24 @@ rk805_regnode_get_voltage(struct regnode *regnode, int *uvolt) return (0); } -static regnode_method_t rk805_regnode_methods[] = { +static regnode_method_t rk8xx_regnode_methods[] = { /* Regulator interface */ - REGNODEMETHOD(regnode_init, rk805_regnode_init), - REGNODEMETHOD(regnode_enable, rk805_regnode_enable), - REGNODEMETHOD(regnode_status, rk805_regnode_status), - REGNODEMETHOD(regnode_set_voltage, rk805_regnode_set_voltage), - REGNODEMETHOD(regnode_get_voltage, rk805_regnode_get_voltage), + REGNODEMETHOD(regnode_init, rk8xx_regnode_init), + REGNODEMETHOD(regnode_enable, rk8xx_regnode_enable), + REGNODEMETHOD(regnode_status, rk8xx_regnode_status), + REGNODEMETHOD(regnode_set_voltage, rk8xx_regnode_set_voltage), + REGNODEMETHOD(regnode_get_voltage, rk8xx_regnode_get_voltage), REGNODEMETHOD(regnode_check_voltage, regnode_method_check_voltage), REGNODEMETHOD_END }; -DEFINE_CLASS_1(rk805_regnode, rk805_regnode_class, rk805_regnode_methods, - sizeof(struct rk805_reg_sc), regnode_class); +DEFINE_CLASS_1(rk8xx_regnode, rk8xx_regnode_class, rk8xx_regnode_methods, + sizeof(struct rk8xx_reg_sc), regnode_class); -static struct rk805_reg_sc * -rk805_reg_attach(device_t dev, phandle_t node, - struct rk805_regdef *def) +static struct rk8xx_reg_sc * +rk8xx_reg_attach(device_t dev, phandle_t node, + struct rk8xx_regdef *def) { - struct rk805_reg_sc *reg_sc; + struct rk8xx_reg_sc *reg_sc; struct regnode_init_def initdef; struct regnode *regnode; @@ -570,7 +570,7 @@ rk805_reg_attach(device_t dev, phandle_t node, initdef.id = def->id; initdef.ofw_node = node; - regnode = regnode_create(dev, &rk805_regnode_class, &initdef); + regnode = regnode_create(dev, &rk8xx_regnode_class, &initdef); if (regnode == NULL) { device_printf(dev, "cannot create regulator\n"); return (NULL); @@ -591,7 +591,7 @@ rk805_reg_attach(device_t dev, phandle_t node, /* -------------------------------------------------------------------------- */ /* Clock class and method */ -struct rk805_clk_sc { +struct rk8xx_clk_sc { device_t base_dev; }; @@ -599,56 +599,56 @@ struct rk805_clk_sc { #define CLK32OUT_CLKOUT2_EN 1 static int -rk805_clk_set_gate_1(struct clknode *clk, bool enable) +rk8xx_clk_set_gate_1(struct clknode *clk, bool enable) { - struct rk805_clk_sc *sc; + struct rk8xx_clk_sc *sc; uint8_t val; sc = clknode_get_softc(clk); - rk805_read(sc->base_dev, CLK32OUT_REG, &val, sizeof(val)); + rk8xx_read(sc->base_dev, CLK32OUT_REG, &val, sizeof(val)); if (enable) val |= CLK32OUT_CLKOUT2_EN; else val &= ~CLK32OUT_CLKOUT2_EN; - rk805_write(sc->base_dev, CLK32OUT_REG, &val, 1); + rk8xx_write(sc->base_dev, CLK32OUT_REG, &val, 1); return (0); } static int -rk805_clk_recalc(struct clknode *clk, uint64_t *freq) +rk8xx_clk_recalc(struct clknode *clk, uint64_t *freq) { *freq = 32768; return (0); } -static clknode_method_t rk805_clk_clknode_methods_0[] = { - CLKNODEMETHOD(clknode_recalc_freq, rk805_clk_recalc), +static clknode_method_t rk8xx_clk_clknode_methods_0[] = { + CLKNODEMETHOD(clknode_recalc_freq, rk8xx_clk_recalc), CLKNODEMETHOD_END }; -DEFINE_CLASS_1(rk805_clk_clknode_0, rk805_clk_clknode_class_0, - rk805_clk_clknode_methods_0, sizeof(struct rk805_clk_sc), +DEFINE_CLASS_1(rk8xx_clk_clknode_0, rk8xx_clk_clknode_class_0, + rk8xx_clk_clknode_methods_0, sizeof(struct rk8xx_clk_sc), clknode_class); -static clknode_method_t rk805_clk_clknode_methods_1[] = { - CLKNODEMETHOD(clknode_set_gate, rk805_clk_set_gate_1), +static clknode_method_t rk8xx_clk_clknode_methods_1[] = { + CLKNODEMETHOD(clknode_set_gate, rk8xx_clk_set_gate_1), CLKNODEMETHOD_END }; -DEFINE_CLASS_1(rk805_clk_clknode_1, rk805_clk_clknode_class_1, - rk805_clk_clknode_methods_1, sizeof(struct rk805_clk_sc), - rk805_clk_clknode_class_0); +DEFINE_CLASS_1(rk8xx_clk_clknode_1, rk8xx_clk_clknode_class_1, + rk8xx_clk_clknode_methods_1, sizeof(struct rk8xx_clk_sc), + rk8xx_clk_clknode_class_0); static int -rk805_export_clocks(device_t dev) +rk8xx_export_clocks(device_t dev) { struct clkdom *clkdom; struct clknode_init_def clkidef; struct clknode *clk; - struct rk805_clk_sc *clksc; + struct rk8xx_clk_sc *clksc; const char **clknames; phandle_t node; int nclks, rv; @@ -664,7 +664,7 @@ rk805_export_clocks(device_t dev) memset(&clkidef, 0, sizeof(clkidef)); clkidef.id = 0; clkidef.name = (nclks = 2) ? clknames[0] : "clk32kout1"; - clk = clknode_create(clkdom, &rk805_clk_clknode_class_0, &clkidef); + clk = clknode_create(clkdom, &rk8xx_clk_clknode_class_0, &clkidef); if (clk == NULL) { device_printf(dev, "Cannot create '%s'.\n", clkidef.name); return (ENXIO); @@ -676,7 +676,7 @@ rk805_export_clocks(device_t dev) memset(&clkidef, 0, sizeof(clkidef)); clkidef.id = 1; clkidef.name = (nclks = 2) ? clknames[1] : "clk32kout2"; - clk = clknode_create(clkdom, &rk805_clk_clknode_class_1, &clkidef); + clk = clknode_create(clkdom, &rk8xx_clk_clknode_class_1, &clkidef); if (clk == NULL) { device_printf(dev, "Cannot create '%s'.\n", clkidef.name); return (ENXIO); @@ -701,7 +701,7 @@ rk805_export_clocks(device_t dev) /* -------------------------------------------------------------------------- */ static int -rk805_probe(device_t dev) +rk8xx_probe(device_t dev) { if (!ofw_bus_status_okay(dev)) return (ENXIO); @@ -709,14 +709,14 @@ rk805_probe(device_t dev) if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); - device_set_desc(dev, "RockChip RK805 PMIC"); + device_set_desc(dev, "RockChip RK8XX PMIC"); return (BUS_PROBE_DEFAULT); } static void -rk805_start(void *pdev) +rk8xx_start(void *pdev) { - struct rk805_softc *sc; + struct rk8xx_softc *sc; device_t dev; uint8_t data[2]; int err; @@ -727,12 +727,12 @@ rk805_start(void *pdev) /* No version register in RK808 */ if (bootverbose && sc->type == RK805) { - err = rk805_read(dev, RK805_CHIP_NAME, data, 1); + err = rk8xx_read(dev, RK805_CHIP_NAME, data, 1); if (err != 0) { device_printf(dev, "Cannot read chip name reg\n"); return; } - err = rk805_read(dev, RK805_CHIP_VER, data + 1, 1); + err = rk8xx_read(dev, RK805_CHIP_VER, data + 1, 1); if (err != 0) { device_printf(dev, "Cannot read chip version reg\n"); return; @@ -749,7 +749,7 @@ rk805_start(void *pdev) } static int -rk805_gettime(device_t dev, struct timespec *ts) +rk8xx_gettime(device_t dev, struct timespec *ts) { struct bcd_clocktime bct; uint8_t data[7]; @@ -757,26 +757,26 @@ rk805_gettime(device_t dev, struct timespec *ts) int error; /* Latch the RTC value into the shadow registers and set 24hr mode */ - error = rk805_read(dev, RK805_RTC_CTRL, &ctrl, 1); + error = rk8xx_read(dev, RK805_RTC_CTRL, &ctrl, 1); if (error != 0) return (error); ctrl |= RK805_RTC_READSEL; ctrl &= ~(RK805_RTC_AMPM_MODE | RK805_RTC_GET_TIME); - error = rk805_write(dev, RK805_RTC_CTRL, &ctrl, 1); + error = rk8xx_write(dev, RK805_RTC_CTRL, &ctrl, 1); if (error != 0) return (error); ctrl |= RK805_RTC_GET_TIME; - error = rk805_write(dev, RK805_RTC_CTRL, &ctrl, 1); + error = rk8xx_write(dev, RK805_RTC_CTRL, &ctrl, 1); if (error != 0) return (error); ctrl &= ~RK805_RTC_GET_TIME; - error = rk805_write(dev, RK805_RTC_CTRL, &ctrl, 1); + error = rk8xx_write(dev, RK805_RTC_CTRL, &ctrl, 1); if (error != 0) return (error); /* This works as long as RK805_RTC_SECS = 0 */ - error = rk805_read(dev, RK805_RTC_SECS, data, 7); + error = rk8xx_read(dev, RK805_RTC_SECS, data, 7); if (error != 0) return (error); @@ -809,7 +809,7 @@ rk805_gettime(device_t dev, struct timespec *ts) } static int -rk805_settime(device_t dev, struct timespec *ts) +rk8xx_settime(device_t dev, struct timespec *ts) { struct bcd_clocktime bct; uint8_t data[7]; @@ -830,19 +830,19 @@ rk805_settime(device_t dev, struct timespec *ts) if (data[RK805_RTC_WEEKS] == 0) data[RK805_RTC_WEEKS] = 7; - error = rk805_read(dev, RK805_RTC_CTRL, &ctrl, 1); + error = rk8xx_read(dev, RK805_RTC_CTRL, &ctrl, 1); if (error != 0) return (error); ctrl |= RK805_RTC_CTRL_STOP; ctrl &= ~RK805_RTC_AMPM_MODE; - error = rk805_write(dev, RK805_RTC_CTRL, &ctrl, 1); + error = rk8xx_write(dev, RK805_RTC_CTRL, &ctrl, 1); if (error != 0) return (error); - error = rk805_write(dev, RK805_RTC_SECS, data, 7); + error = rk8xx_write(dev, RK805_RTC_SECS, data, 7); ctrl &= ~RK805_RTC_CTRL_STOP; - rk805_write(dev, RK805_RTC_CTRL, &ctrl, 1); + rk8xx_write(dev, RK805_RTC_CTRL, &ctrl, 1); return (error); } @@ -871,11 +871,11 @@ rk805_poweroff(void *arg, int howto) } static int -rk805_attach(device_t dev) +rk8xx_attach(device_t dev) { - struct rk805_softc *sc; - struct rk805_reg_sc *reg; - struct rk805_regdef *regdefs; + struct rk8xx_softc *sc; + struct rk8xx_reg_sc *reg; + struct rk8xx_regdef *regdefs; struct reg_list *regp; phandle_t rnode, child; int error, i; @@ -883,11 +883,11 @@ rk805_attach(device_t dev) sc = device_get_softc(dev); sc->type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; - error = rk805_export_clocks(dev); + error = rk8xx_export_clocks(dev); if (error != 0) return (error); - sc->intr_hook.ich_func = rk805_start; + sc->intr_hook.ich_func = rk8xx_start; sc->intr_hook.ich_arg = dev; if (config_intrhook_establish(&sc->intr_hook) != 0) return (ENOMEM); @@ -917,7 +917,7 @@ rk805_attach(device_t dev) continue; if (OF_hasprop(child, "regulator-name") != 1) continue; - reg = rk805_reg_attach(dev, child, ®defs[i]); + reg = rk8xx_reg_attach(dev, child, ®defs[i]); if (reg == NULL) { device_printf(dev, "cannot attach regulator %s\n", @@ -948,7 +948,7 @@ rk805_attach(device_t dev) } static int -rk805_detach(device_t dev) +rk8xx_detach(device_t dev) { /* We cannot detach regulators */ @@ -956,10 +956,10 @@ rk805_detach(device_t dev) } static int -rk805_map(device_t dev, phandle_t xref, int ncells, +rk8xx_map(device_t dev, phandle_t xref, int ncells, pcell_t *cells, intptr_t *id) { - struct rk805_softc *sc; + struct rk8xx_softc *sc; struct reg_list *regp; sc = device_get_softc(dev); @@ -974,30 +974,30 @@ rk805_map(device_t dev, phandle_t xref, int ncells, return (ERANGE); } -static device_method_t rk805_methods[] = { - DEVMETHOD(device_probe, rk805_probe), - DEVMETHOD(device_attach, rk805_attach), - DEVMETHOD(device_detach, rk805_detach), +static device_method_t rk8xx_methods[] = { + DEVMETHOD(device_probe, rk8xx_probe), + DEVMETHOD(device_attach, rk8xx_attach), + DEVMETHOD(device_detach, rk8xx_detach), /* regdev interface */ - DEVMETHOD(regdev_map, rk805_map), + DEVMETHOD(regdev_map, rk8xx_map), /* Clock interface */ - DEVMETHOD(clock_gettime, rk805_gettime), - DEVMETHOD(clock_settime, rk805_settime), + DEVMETHOD(clock_gettime, rk8xx_gettime), + DEVMETHOD(clock_settime, rk8xx_settime), DEVMETHOD_END }; -static driver_t rk805_driver = { - "rk805_pmu", - rk805_methods, - sizeof(struct rk805_softc), +static driver_t rk8xx_driver = { + "rk8xx_pmu", + rk8xx_methods, + sizeof(struct rk8xx_softc), }; -static devclass_t rk805_devclass; +static devclass_t rk8xx_devclass; -EARLY_DRIVER_MODULE(rk805, iicbus, rk805_driver, rk805_devclass, 0, 0, +EARLY_DRIVER_MODULE(rk8xx, iicbus, rk8xx_driver, rk8xx_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); -MODULE_DEPEND(rk805, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); -MODULE_VERSION(rk805, 1); +MODULE_DEPEND(rk8xx, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); +MODULE_VERSION(rk8xx, 1); From nobody Sun Nov 14 12:34:23 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4BD79183C147; Sun, 14 Nov 2021 12:34:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HsWwc0wkMz4c5s; Sun, 14 Nov 2021 12:34:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0A7B2688E; Sun, 14 Nov 2021 12:34:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AECYNv1068472; Sun, 14 Nov 2021 12:34:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AECYNSO068471; Sun, 14 Nov 2021 12:34:23 GMT (envelope-from git) Date: Sun, 14 Nov 2021 12:34:23 GMT Message-Id: <202111141234.1AECYNSO068471@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 328077bb8ff1 - main - pmic: rockchip: Split the rtc part in its own file List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 328077bb8ff1a55d20ca7f8fdbb898e8c07bb057 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=328077bb8ff1a55d20ca7f8fdbb898e8c07bb057 commit 328077bb8ff1a55d20ca7f8fdbb898e8c07bb057 Author: Emmanuel Vadot AuthorDate: 2021-11-11 19:41:52 +0000 Commit: Emmanuel Vadot CommitDate: 2021-11-14 11:31:18 +0000 pmic: rockchip: Split the rtc part in its own file Even if for now all the RTC-related register are at the same offset don't use some hardcoded values for them but set them based on the PMIC type. No functional changes intended. --- sys/conf/files.arm64 | 1 + sys/dev/iicbus/pmic/rockchip/rk805.c | 204 ++++++------------------------- sys/dev/iicbus/pmic/rockchip/rk8xx.h | 109 +++++++++++++++++ sys/dev/iicbus/pmic/rockchip/rk8xx_rtc.c | 142 +++++++++++++++++++++ 4 files changed, 289 insertions(+), 167 deletions(-) diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 1f344d0273b8..a3c325070469 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -541,6 +541,7 @@ arm64/rockchip/rk_dwc3.c optional fdt rk_dwc3 soc_rockchip_rk3399 arm64/rockchip/rk_i2c.c optional fdt rk_i2c soc_rockchip_rk3328 | fdt rk_i2c soc_rockchip_rk3399 arm64/rockchip/rk_i2s.c optional fdt sound soc_rockchip_rk3328 | fdt sound soc_rockchip_rk3399 dev/iicbus/pmic/rockchip/rk805.c optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399 +dev/iicbus/pmic/rockchip/rk8xx_rtc.c optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399 arm64/rockchip/rk_grf.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 arm64/rockchip/rk_pinctrl.c optional fdt rk_pinctrl soc_rockchip_rk3328 | fdt rk_pinctrl soc_rockchip_rk3399 arm64/rockchip/rk_gpio.c optional fdt rk_gpio soc_rockchip_rk3328 | fdt rk_gpio soc_rockchip_rk3399 diff --git a/sys/dev/iicbus/pmic/rockchip/rk805.c b/sys/dev/iicbus/pmic/rockchip/rk805.c index 76c8462e694e..ab4006ad63f9 100644 --- a/sys/dev/iicbus/pmic/rockchip/rk805.c +++ b/sys/dev/iicbus/pmic/rockchip/rk805.c @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "clock_if.h" #include "regdev_if.h" @@ -59,55 +60,12 @@ MALLOC_DEFINE(M_RK805_REG, "RK805 regulator", "RK805 power regulator"); /* #define dprintf(sc, format, arg...) device_printf(sc->base_dev, "%s: " format, __func__, arg) */ #define dprintf(sc, format, arg...) -enum rk_pmic_type { - RK805 = 1, - RK808, -}; - static struct ofw_compat_data compat_data[] = { {"rockchip,rk805", RK805}, {"rockchip,rk808", RK808}, {NULL, 0} }; -struct rk8xx_regdef { - intptr_t id; - char *name; - uint8_t enable_reg; - uint8_t enable_mask; - uint8_t voltage_reg; - uint8_t voltage_mask; - int voltage_min; - int voltage_max; - int voltage_step; - int voltage_nstep; -}; - -struct rk8xx_reg_sc { - struct regnode *regnode; - device_t base_dev; - struct rk8xx_regdef *def; - phandle_t xref; - struct regnode_std_param *param; -}; - -struct reg_list { - TAILQ_ENTRY(reg_list) next; - struct rk8xx_reg_sc *reg; -}; - -struct rk8xx_softc { - device_t dev; - struct mtx mtx; - struct resource * res[1]; - void * intrcookie; - struct intr_config_hook intr_hook; - enum rk_pmic_type type; - - TAILQ_HEAD(, reg_list) regs; - int nregs; -}; - static int rk8xx_regnode_status(struct regnode *regnode, int *status); static int rk8xx_regnode_set_voltage(struct regnode *regnode, int min_uvolt, int max_uvolt, int *udelay); @@ -352,7 +310,7 @@ static struct rk8xx_regdef rk808_regdefs[] = { }, }; -static int +int rk8xx_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) { int err; @@ -361,7 +319,7 @@ rk8xx_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) return (err); } -static int +int rk8xx_write(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) { @@ -748,128 +706,6 @@ rk8xx_start(void *pdev) config_intrhook_disestablish(&sc->intr_hook); } -static int -rk8xx_gettime(device_t dev, struct timespec *ts) -{ - struct bcd_clocktime bct; - uint8_t data[7]; - uint8_t ctrl; - int error; - - /* Latch the RTC value into the shadow registers and set 24hr mode */ - error = rk8xx_read(dev, RK805_RTC_CTRL, &ctrl, 1); - if (error != 0) - return (error); - - ctrl |= RK805_RTC_READSEL; - ctrl &= ~(RK805_RTC_AMPM_MODE | RK805_RTC_GET_TIME); - error = rk8xx_write(dev, RK805_RTC_CTRL, &ctrl, 1); - if (error != 0) - return (error); - ctrl |= RK805_RTC_GET_TIME; - error = rk8xx_write(dev, RK805_RTC_CTRL, &ctrl, 1); - if (error != 0) - return (error); - ctrl &= ~RK805_RTC_GET_TIME; - error = rk8xx_write(dev, RK805_RTC_CTRL, &ctrl, 1); - if (error != 0) - return (error); - - /* This works as long as RK805_RTC_SECS = 0 */ - error = rk8xx_read(dev, RK805_RTC_SECS, data, 7); - if (error != 0) - return (error); - - /* - * If the reported year is earlier than 2019, assume the clock is unset. - * This is both later than the reset value for the RK805 and RK808 as - * well as being prior to the current time. - */ - if (data[RK805_RTC_YEARS] < 0x19) - return (EINVAL); - - memset(&bct, 0, sizeof(bct)); - bct.year = data[RK805_RTC_YEARS]; - bct.mon = data[RK805_RTC_MONTHS] & RK805_RTC_MONTHS_MASK; - bct.day = data[RK805_RTC_DAYS] & RK805_RTC_DAYS_MASK; - bct.hour = data[RK805_RTC_HOURS] & RK805_RTC_HOURS_MASK; - bct.min = data[RK805_RTC_MINUTES] & RK805_RTC_MINUTES_MASK; - bct.sec = data[RK805_RTC_SECS] & RK805_RTC_SECS_MASK; - bct.dow = data[RK805_RTC_WEEKS] & RK805_RTC_WEEKS_MASK; - /* The day of week is reported as 1-7 with 1 = Monday */ - if (bct.dow == 7) - bct.dow = 0; - bct.ispm = 0; - - if (bootverbose) - device_printf(dev, "Read RTC: %02x-%02x-%02x %02x:%02x:%02x\n", - bct.year, bct.mon, bct.day, bct.hour, bct.min, bct.sec); - - return (clock_bcd_to_ts(&bct, ts, false)); -} - -static int -rk8xx_settime(device_t dev, struct timespec *ts) -{ - struct bcd_clocktime bct; - uint8_t data[7]; - int error; - uint8_t ctrl; - - clock_ts_to_bcd(ts, &bct, false); - - /* This works as long as RK805_RTC_SECS = 0 */ - data[RK805_RTC_YEARS] = bct.year; - data[RK805_RTC_MONTHS] = bct.mon; - data[RK805_RTC_DAYS] = bct.day; - data[RK805_RTC_HOURS] = bct.hour; - data[RK805_RTC_MINUTES] = bct.min; - data[RK805_RTC_SECS] = bct.sec; - data[RK805_RTC_WEEKS] = bct.dow; - /* The day of week is reported as 1-7 with 1 = Monday */ - if (data[RK805_RTC_WEEKS] == 0) - data[RK805_RTC_WEEKS] = 7; - - error = rk8xx_read(dev, RK805_RTC_CTRL, &ctrl, 1); - if (error != 0) - return (error); - - ctrl |= RK805_RTC_CTRL_STOP; - ctrl &= ~RK805_RTC_AMPM_MODE; - error = rk8xx_write(dev, RK805_RTC_CTRL, &ctrl, 1); - if (error != 0) - return (error); - - error = rk8xx_write(dev, RK805_RTC_SECS, data, 7); - ctrl &= ~RK805_RTC_CTRL_STOP; - rk8xx_write(dev, RK805_RTC_CTRL, &ctrl, 1); - - return (error); -} - -static void -rk805_poweroff(void *arg, int howto) -{ - device_t dev = arg; - int error; - uint8_t val; - - if ((howto & RB_POWEROFF) == 0) - return; - - device_printf(dev, "Powering off...\n"); - error = rk805_read(dev, RK805_DEV_CTRL, &val, 1); - if (error == 0) { - val |= RK805_DEV_CTRL_OFF; - error = rk805_write(dev, RK805_DEV_CTRL, &val, 1); - - /* Wait a bit for the command to take effect. */ - if (error == 0) - DELAY(100); - } - device_printf(dev, "Power off failed\n"); -} - static int rk8xx_attach(device_t dev) { @@ -896,10 +732,44 @@ rk8xx_attach(device_t dev) case RK805: regdefs = rk805_regdefs; sc->nregs = nitems(rk805_regdefs); + sc->rtc_regs.secs = RK805_RTC_SECS; + sc->rtc_regs.secs_mask = RK805_RTC_SECS_MASK; + sc->rtc_regs.minutes = RK805_RTC_MINUTES; + sc->rtc_regs.minutes_mask = RK805_RTC_MINUTES_MASK; + sc->rtc_regs.hours = RK805_RTC_HOURS; + sc->rtc_regs.hours_mask = RK805_RTC_HOURS_MASK; + sc->rtc_regs.days = RK805_RTC_DAYS; + sc->rtc_regs.days_mask = RK805_RTC_DAYS_MASK; + sc->rtc_regs.months = RK805_RTC_MONTHS; + sc->rtc_regs.months_mask = RK805_RTC_MONTHS_MASK; + sc->rtc_regs.years = RK805_RTC_YEARS; + sc->rtc_regs.weeks = RK805_RTC_WEEKS_MASK; + sc->rtc_regs.ctrl = RK805_RTC_CTRL; + sc->rtc_regs.ctrl_stop_mask = RK805_RTC_CTRL_STOP; + sc->rtc_regs.ctrl_ampm_mask = RK805_RTC_AMPM_MODE; + sc->rtc_regs.ctrl_gettime_mask = RK805_RTC_GET_TIME; + sc->rtc_regs.ctrl_readsel_mask = RK805_RTC_READSEL; break; case RK808: regdefs = rk808_regdefs; sc->nregs = nitems(rk808_regdefs); + sc->rtc_regs.secs = RK808_RTC_SECS; + sc->rtc_regs.secs_mask = RK808_RTC_SECS_MASK; + sc->rtc_regs.minutes = RK808_RTC_MINUTES; + sc->rtc_regs.minutes_mask = RK808_RTC_MINUTES_MASK; + sc->rtc_regs.hours = RK808_RTC_HOURS; + sc->rtc_regs.hours_mask = RK808_RTC_HOURS_MASK; + sc->rtc_regs.days = RK808_RTC_DAYS; + sc->rtc_regs.days_mask = RK808_RTC_DAYS_MASK; + sc->rtc_regs.months = RK808_RTC_MONTHS; + sc->rtc_regs.months_mask = RK808_RTC_MONTHS_MASK; + sc->rtc_regs.years = RK808_RTC_YEARS; + sc->rtc_regs.weeks = RK808_RTC_WEEKS_MASK; + sc->rtc_regs.ctrl = RK808_RTC_CTRL; + sc->rtc_regs.ctrl_stop_mask = RK808_RTC_CTRL_STOP; + sc->rtc_regs.ctrl_ampm_mask = RK808_RTC_AMPM_MODE; + sc->rtc_regs.ctrl_gettime_mask = RK808_RTC_GET_TIME; + sc->rtc_regs.ctrl_readsel_mask = RK808_RTC_READSEL; break; default: device_printf(dev, "Unknown type %d\n", sc->type); diff --git a/sys/dev/iicbus/pmic/rockchip/rk8xx.h b/sys/dev/iicbus/pmic/rockchip/rk8xx.h new file mode 100644 index 000000000000..4351f8fe254c --- /dev/null +++ b/sys/dev/iicbus/pmic/rockchip/rk8xx.h @@ -0,0 +1,109 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _RK8XX_H_ +#define _RK8XX_H_ + +#include + +#include +#include + +enum rk_pmic_type { + RK805 = 1, + RK808, +}; + +struct rk8xx_regdef { + intptr_t id; + char *name; + uint8_t enable_reg; + uint8_t enable_mask; + uint8_t voltage_reg; + uint8_t voltage_mask; + int voltage_min; + int voltage_max; + int voltage_step; + int voltage_nstep; +}; + +struct rk8xx_reg_sc { + struct regnode *regnode; + device_t base_dev; + struct rk8xx_regdef *def; + phandle_t xref; + struct regnode_std_param *param; +}; + +struct reg_list { + TAILQ_ENTRY(reg_list) next; + struct rk8xx_reg_sc *reg; +}; + +struct rk8xx_rtc_reg { + uint8_t secs; + uint8_t secs_mask; + uint8_t minutes; + uint8_t minutes_mask; + uint8_t hours; + uint8_t hours_mask; + uint8_t days; + uint8_t days_mask; + uint8_t months; + uint8_t months_mask; + uint8_t years; + uint8_t weeks; + uint8_t weeks_mask; + uint8_t ctrl; + uint8_t ctrl_stop_mask; + uint8_t ctrl_ampm_mask; + uint8_t ctrl_gettime_mask; + uint8_t ctrl_readsel_mask; +}; + +struct rk8xx_softc { + device_t dev; + struct mtx mtx; + struct resource * res[1]; + void * intrcookie; + struct intr_config_hook intr_hook; + enum rk_pmic_type type; + + TAILQ_HEAD(, reg_list) regs; + int nregs; + + struct rk8xx_rtc_reg rtc_regs; +}; + +int rk8xx_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size); +int rk8xx_write(device_t dev, uint8_t reg, uint8_t *data, uint8_t size); + +/* rk8xx_rtc.c */ +int rk8xx_gettime(device_t dev, struct timespec *ts); +int rk8xx_settime(device_t dev, struct timespec *ts); + +#endif /* _RK8XX_H_ */ diff --git a/sys/dev/iicbus/pmic/rockchip/rk8xx_rtc.c b/sys/dev/iicbus/pmic/rockchip/rk8xx_rtc.c new file mode 100644 index 000000000000..2f755d16b164 --- /dev/null +++ b/sys/dev/iicbus/pmic/rockchip/rk8xx_rtc.c @@ -0,0 +1,142 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Emmanuel Vadot + * Copyright (c) 2021 Peter Jeremy + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include + +int +rk8xx_gettime(device_t dev, struct timespec *ts) +{ + struct rk8xx_softc *sc; + struct bcd_clocktime bct; + uint8_t data[7]; + uint8_t ctrl; + int error; + + sc = device_get_softc(dev); + + /* Latch the RTC value into the shadow registers and set 24hr mode */ + error = rk8xx_read(dev, sc->rtc_regs.ctrl, &ctrl, 1); + if (error != 0) + return (error); + + ctrl |= sc->rtc_regs.ctrl_readsel_mask; + ctrl &= ~(sc->rtc_regs.ctrl_ampm_mask | sc->rtc_regs.ctrl_gettime_mask); + error = rk8xx_write(dev, sc->rtc_regs.ctrl, &ctrl, 1); + if (error != 0) + return (error); + ctrl |= sc->rtc_regs.ctrl_gettime_mask; + error = rk8xx_write(dev, sc->rtc_regs.ctrl, &ctrl, 1); + if (error != 0) + return (error); + ctrl &= ~sc->rtc_regs.ctrl_gettime_mask; + error = rk8xx_write(dev, sc->rtc_regs.ctrl, &ctrl, 1); + if (error != 0) + return (error); + + /* This works as long as sc->rtc_regs.secs = 0 */ + error = rk8xx_read(dev, sc->rtc_regs.secs, data, 7); + if (error != 0) + return (error); + + /* + * If the reported year is earlier than 2019, assume the clock is unset. + * This is both later than the reset value for the RK805 and RK808 as + * well as being prior to the current time. + */ + if (data[sc->rtc_regs.years] < 0x19) + return (EINVAL); + + memset(&bct, 0, sizeof(bct)); + bct.year = data[sc->rtc_regs.years]; + bct.mon = data[sc->rtc_regs.months] & sc->rtc_regs.months_mask; + bct.day = data[sc->rtc_regs.days] & sc->rtc_regs.days_mask; + bct.hour = data[sc->rtc_regs.hours] & sc->rtc_regs.hours_mask; + bct.min = data[sc->rtc_regs.minutes] & sc->rtc_regs.minutes_mask; + bct.sec = data[sc->rtc_regs.secs] & sc->rtc_regs.secs_mask; + bct.dow = data[sc->rtc_regs.weeks] & sc->rtc_regs.weeks_mask; + /* The day of week is reported as 1-7 with 1 = Monday */ + if (bct.dow == 7) + bct.dow = 0; + bct.ispm = 0; + + if (bootverbose) + device_printf(dev, "Read RTC: %02x-%02x-%02x %02x:%02x:%02x\n", + bct.year, bct.mon, bct.day, bct.hour, bct.min, bct.sec); + + return (clock_bcd_to_ts(&bct, ts, false)); +} + +int +rk8xx_settime(device_t dev, struct timespec *ts) +{ + struct rk8xx_softc *sc; + struct bcd_clocktime bct; + uint8_t data[7]; + int error; + uint8_t ctrl; + + sc = device_get_softc(dev); + + clock_ts_to_bcd(ts, &bct, false); + + /* This works as long as RK805_RTC_SECS = 0 */ + data[sc->rtc_regs.years] = bct.year; + data[sc->rtc_regs.months] = bct.mon; + data[sc->rtc_regs.days] = bct.day; + data[sc->rtc_regs.hours] = bct.hour; + data[sc->rtc_regs.minutes] = bct.min; + data[sc->rtc_regs.secs] = bct.sec; + data[sc->rtc_regs.weeks] = bct.dow; + /* The day of week is reported as 1-7 with 1 = Monday */ + if (data[sc->rtc_regs.weeks] == 0) + data[sc->rtc_regs.weeks] = 7; + + error = rk8xx_read(dev, sc->rtc_regs.ctrl, &ctrl, 1); + if (error != 0) + return (error); + + ctrl |= sc->rtc_regs.ctrl_stop_mask; + ctrl &= ~sc->rtc_regs.ctrl_ampm_mask; + error = rk8xx_write(dev, sc->rtc_regs.ctrl, &ctrl, 1); + if (error != 0) + return (error); + + error = rk8xx_write(dev, sc->rtc_regs.secs, data, 7); + ctrl &= ~sc->rtc_regs.ctrl_stop_mask; + rk8xx_write(dev, sc->rtc_regs.ctrl, &ctrl, 1); + + return (error); +} From nobody Sun Nov 14 12:34:24 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F1FEA183C2CE; Sun, 14 Nov 2021 12:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HsWwd1cRXz4cK8; Sun, 14 Nov 2021 12:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD27C266AF; Sun, 14 Nov 2021 12:34:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AECYOCS068496; Sun, 14 Nov 2021 12:34:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AECYOsP068495; Sun, 14 Nov 2021 12:34:24 GMT (envelope-from git) Date: Sun, 14 Nov 2021 12:34:24 GMT Message-Id: <202111141234.1AECYOsP068495@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: ad651f176b57 - main - pmic: rockchip: Split the regulators part in its own file List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ad651f176b579fdc11faf16a199a7b92fa767126 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=ad651f176b579fdc11faf16a199a7b92fa767126 commit ad651f176b579fdc11faf16a199a7b92fa767126 Author: Emmanuel Vadot AuthorDate: 2021-11-14 10:13:12 +0000 Commit: Emmanuel Vadot CommitDate: 2021-11-14 11:31:21 +0000 pmic: rockchip: Split the regulators part in its own file No functional changes intended. --- sys/conf/files.arm64 | 1 + sys/dev/iicbus/pmic/rockchip/rk805.c | 247 -------------------- sys/dev/iicbus/pmic/rockchip/rk8xx.h | 6 + sys/dev/iicbus/pmic/rockchip/rk8xx_regulators.c | 290 ++++++++++++++++++++++++ 4 files changed, 297 insertions(+), 247 deletions(-) diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index a3c325070469..8ad88488fffe 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -541,6 +541,7 @@ arm64/rockchip/rk_dwc3.c optional fdt rk_dwc3 soc_rockchip_rk3399 arm64/rockchip/rk_i2c.c optional fdt rk_i2c soc_rockchip_rk3328 | fdt rk_i2c soc_rockchip_rk3399 arm64/rockchip/rk_i2s.c optional fdt sound soc_rockchip_rk3328 | fdt sound soc_rockchip_rk3399 dev/iicbus/pmic/rockchip/rk805.c optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399 +dev/iicbus/pmic/rockchip/rk8xx_regulators.c optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399 dev/iicbus/pmic/rockchip/rk8xx_rtc.c optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399 arm64/rockchip/rk_grf.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 arm64/rockchip/rk_pinctrl.c optional fdt rk_pinctrl soc_rockchip_rk3328 | fdt rk_pinctrl soc_rockchip_rk3399 diff --git a/sys/dev/iicbus/pmic/rockchip/rk805.c b/sys/dev/iicbus/pmic/rockchip/rk805.c index ab4006ad63f9..ba5da4e95279 100644 --- a/sys/dev/iicbus/pmic/rockchip/rk805.c +++ b/sys/dev/iicbus/pmic/rockchip/rk805.c @@ -57,20 +57,12 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_RK805_REG, "RK805 regulator", "RK805 power regulator"); -/* #define dprintf(sc, format, arg...) device_printf(sc->base_dev, "%s: " format, __func__, arg) */ -#define dprintf(sc, format, arg...) - static struct ofw_compat_data compat_data[] = { {"rockchip,rk805", RK805}, {"rockchip,rk808", RK808}, {NULL, 0} }; -static int rk8xx_regnode_status(struct regnode *regnode, int *status); -static int rk8xx_regnode_set_voltage(struct regnode *regnode, int min_uvolt, - int max_uvolt, int *udelay); -static int rk8xx_regnode_get_voltage(struct regnode *regnode, int *uvolt); - static struct rk8xx_regdef rk805_regdefs[] = { { .id = RK805_BUCK1, @@ -326,226 +318,6 @@ rk8xx_write(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) return (iicdev_writeto(dev, reg, data, size, IIC_INTRWAIT)); } -static int -rk8xx_regnode_init(struct regnode *regnode) -{ - struct rk8xx_reg_sc *sc; - struct regnode_std_param *param; - int rv, udelay, uvolt, status; - - sc = regnode_get_softc(regnode); - dprintf(sc, "Regulator %s init called\n", sc->def->name); - param = regnode_get_stdparam(regnode); - if (param->min_uvolt == 0) - return (0); - - /* Check that the regulator is preset to the correct voltage */ - rv = rk8xx_regnode_get_voltage(regnode, &uvolt); - if (rv != 0) - return(rv); - - if (uvolt >= param->min_uvolt && uvolt <= param->max_uvolt) - return(0); - /* - * Set the regulator at the correct voltage if it is not enabled. - * Do not enable it, this is will be done either by a - * consumer or by regnode_set_constraint if boot_on is true - */ - rv = rk8xx_regnode_status(regnode, &status); - if (rv != 0 || status == REGULATOR_STATUS_ENABLED) - return (rv); - - rv = rk8xx_regnode_set_voltage(regnode, param->min_uvolt, - param->max_uvolt, &udelay); - if (udelay != 0) - DELAY(udelay); - - return (rv); -} - -static int -rk8xx_regnode_enable(struct regnode *regnode, bool enable, int *udelay) -{ - struct rk8xx_reg_sc *sc; - uint8_t val; - - sc = regnode_get_softc(regnode); - - dprintf(sc, "%sabling regulator %s\n", - enable ? "En" : "Dis", - sc->def->name); - rk8xx_read(sc->base_dev, sc->def->enable_reg, &val, 1); - if (enable) - val |= sc->def->enable_mask; - else - val &= ~sc->def->enable_mask; - rk8xx_write(sc->base_dev, sc->def->enable_reg, &val, 1); - - *udelay = 0; - - return (0); -} - -static void -rk8xx_regnode_reg_to_voltage(struct rk8xx_reg_sc *sc, uint8_t val, int *uv) -{ - if (val < sc->def->voltage_nstep) - *uv = sc->def->voltage_min + val * sc->def->voltage_step; - else - *uv = sc->def->voltage_min + - (sc->def->voltage_nstep * sc->def->voltage_step); -} - -static int -rk8xx_regnode_voltage_to_reg(struct rk8xx_reg_sc *sc, int min_uvolt, - int max_uvolt, uint8_t *val) -{ - uint8_t nval; - int nstep, uvolt; - - nval = 0; - uvolt = sc->def->voltage_min; - - for (nstep = 0; nstep < sc->def->voltage_nstep && uvolt < min_uvolt; - nstep++) { - ++nval; - uvolt += sc->def->voltage_step; - } - if (uvolt > max_uvolt) - return (EINVAL); - - *val = nval; - return (0); -} - -static int -rk8xx_regnode_status(struct regnode *regnode, int *status) -{ - struct rk8xx_reg_sc *sc; - uint8_t val; - - sc = regnode_get_softc(regnode); - - *status = 0; - rk8xx_read(sc->base_dev, sc->def->enable_reg, &val, 1); - if (val & sc->def->enable_mask) - *status = REGULATOR_STATUS_ENABLED; - - return (0); -} - -static int -rk8xx_regnode_set_voltage(struct regnode *regnode, int min_uvolt, - int max_uvolt, int *udelay) -{ - struct rk8xx_reg_sc *sc; - uint8_t val; - int uvolt; - - sc = regnode_get_softc(regnode); - - if (!sc->def->voltage_step) - return (ENXIO); - - dprintf(sc, "Setting %s to %d<->%d uvolts\n", - sc->def->name, - min_uvolt, - max_uvolt); - rk8xx_read(sc->base_dev, sc->def->voltage_reg, &val, 1); - if (rk8xx_regnode_voltage_to_reg(sc, min_uvolt, max_uvolt, &val) != 0) - return (ERANGE); - - rk8xx_write(sc->base_dev, sc->def->voltage_reg, &val, 1); - - rk8xx_read(sc->base_dev, sc->def->voltage_reg, &val, 1); - - *udelay = 0; - - rk8xx_regnode_reg_to_voltage(sc, val, &uvolt); - dprintf(sc, "Regulator %s set to %d uvolt\n", - sc->def->name, - uvolt); - - return (0); -} - -static int -rk8xx_regnode_get_voltage(struct regnode *regnode, int *uvolt) -{ - struct rk8xx_reg_sc *sc; - uint8_t val; - - sc = regnode_get_softc(regnode); - - if (sc->def->voltage_min == sc->def->voltage_max) { - *uvolt = sc->def->voltage_min; - return (0); - } - - if (!sc->def->voltage_step) - return (ENXIO); - - rk8xx_read(sc->base_dev, sc->def->voltage_reg, &val, 1); - rk8xx_regnode_reg_to_voltage(sc, val & sc->def->voltage_mask, uvolt); - - dprintf(sc, "Regulator %s is at %d uvolt\n", - sc->def->name, - *uvolt); - - return (0); -} - -static regnode_method_t rk8xx_regnode_methods[] = { - /* Regulator interface */ - REGNODEMETHOD(regnode_init, rk8xx_regnode_init), - REGNODEMETHOD(regnode_enable, rk8xx_regnode_enable), - REGNODEMETHOD(regnode_status, rk8xx_regnode_status), - REGNODEMETHOD(regnode_set_voltage, rk8xx_regnode_set_voltage), - REGNODEMETHOD(regnode_get_voltage, rk8xx_regnode_get_voltage), - REGNODEMETHOD(regnode_check_voltage, regnode_method_check_voltage), - REGNODEMETHOD_END -}; -DEFINE_CLASS_1(rk8xx_regnode, rk8xx_regnode_class, rk8xx_regnode_methods, - sizeof(struct rk8xx_reg_sc), regnode_class); - -static struct rk8xx_reg_sc * -rk8xx_reg_attach(device_t dev, phandle_t node, - struct rk8xx_regdef *def) -{ - struct rk8xx_reg_sc *reg_sc; - struct regnode_init_def initdef; - struct regnode *regnode; - - memset(&initdef, 0, sizeof(initdef)); - if (regulator_parse_ofw_stdparam(dev, node, &initdef) != 0) { - device_printf(dev, "cannot create regulator\n"); - return (NULL); - } - if (initdef.std_param.min_uvolt == 0) - initdef.std_param.min_uvolt = def->voltage_min; - if (initdef.std_param.max_uvolt == 0) - initdef.std_param.max_uvolt = def->voltage_max; - initdef.id = def->id; - initdef.ofw_node = node; - - regnode = regnode_create(dev, &rk8xx_regnode_class, &initdef); - if (regnode == NULL) { - device_printf(dev, "cannot create regulator\n"); - return (NULL); - } - - reg_sc = regnode_get_softc(regnode); - reg_sc->regnode = regnode; - reg_sc->base_dev = dev; - reg_sc->def = def; - reg_sc->xref = OF_xref_from_node(node); - reg_sc->param = regnode_get_stdparam(regnode); - - regnode_register(regnode); - - return (reg_sc); -} - /* -------------------------------------------------------------------------- */ /* Clock class and method */ @@ -825,25 +597,6 @@ rk8xx_detach(device_t dev) return (EBUSY); } -static int -rk8xx_map(device_t dev, phandle_t xref, int ncells, - pcell_t *cells, intptr_t *id) -{ - struct rk8xx_softc *sc; - struct reg_list *regp; - - sc = device_get_softc(dev); - - TAILQ_FOREACH(regp, &sc->regs, next) { - if (regp->reg->xref == xref) { - *id = regp->reg->def->id; - return (0); - } - } - - return (ERANGE); -} - static device_method_t rk8xx_methods[] = { DEVMETHOD(device_probe, rk8xx_probe), DEVMETHOD(device_attach, rk8xx_attach), diff --git a/sys/dev/iicbus/pmic/rockchip/rk8xx.h b/sys/dev/iicbus/pmic/rockchip/rk8xx.h index 4351f8fe254c..8dc186beb5da 100644 --- a/sys/dev/iicbus/pmic/rockchip/rk8xx.h +++ b/sys/dev/iicbus/pmic/rockchip/rk8xx.h @@ -102,6 +102,12 @@ struct rk8xx_softc { int rk8xx_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size); int rk8xx_write(device_t dev, uint8_t reg, uint8_t *data, uint8_t size); +/* rk8xx_regulators.c */ +struct rk8xx_reg_sc *rk8xx_reg_attach(device_t dev, phandle_t node, + struct rk8xx_regdef *def); +int rk8xx_map(device_t dev, phandle_t xref, int ncells, + pcell_t *cells, intptr_t *id); + /* rk8xx_rtc.c */ int rk8xx_gettime(device_t dev, struct timespec *ts); int rk8xx_settime(device_t dev, struct timespec *ts); diff --git a/sys/dev/iicbus/pmic/rockchip/rk8xx_regulators.c b/sys/dev/iicbus/pmic/rockchip/rk8xx_regulators.c new file mode 100644 index 000000000000..015fbb1b26b3 --- /dev/null +++ b/sys/dev/iicbus/pmic/rockchip/rk8xx_regulators.c @@ -0,0 +1,290 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018-2021 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#include "regdev_if.h" + +static int rk8xx_regnode_status(struct regnode *regnode, int *status); +static int rk8xx_regnode_set_voltage(struct regnode *regnode, int min_uvolt, + int max_uvolt, int *udelay); +static int rk8xx_regnode_get_voltage(struct regnode *regnode, int *uvolt); + +/* #define dprintf(sc, format, arg...) device_printf(sc->base_dev, "%s: " format, __func__, arg) */ +#define dprintf(sc, format, arg...) + +static int +rk8xx_regnode_init(struct regnode *regnode) +{ + struct rk8xx_reg_sc *sc; + struct regnode_std_param *param; + int rv, udelay, uvolt, status; + + sc = regnode_get_softc(regnode); + dprintf(sc, "Regulator %s init called\n", sc->def->name); + param = regnode_get_stdparam(regnode); + if (param->min_uvolt == 0) + return (0); + + /* Check that the regulator is preset to the correct voltage */ + rv = rk8xx_regnode_get_voltage(regnode, &uvolt); + if (rv != 0) + return(rv); + + if (uvolt >= param->min_uvolt && uvolt <= param->max_uvolt) + return(0); + /* + * Set the regulator at the correct voltage if it is not enabled. + * Do not enable it, this is will be done either by a + * consumer or by regnode_set_constraint if boot_on is true + */ + rv = rk8xx_regnode_status(regnode, &status); + if (rv != 0 || status == REGULATOR_STATUS_ENABLED) + return (rv); + + rv = rk8xx_regnode_set_voltage(regnode, param->min_uvolt, + param->max_uvolt, &udelay); + if (udelay != 0) + DELAY(udelay); + + return (rv); +} + +static int +rk8xx_regnode_enable(struct regnode *regnode, bool enable, int *udelay) +{ + struct rk8xx_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + dprintf(sc, "%sabling regulator %s\n", + enable ? "En" : "Dis", + sc->def->name); + rk8xx_read(sc->base_dev, sc->def->enable_reg, &val, 1); + if (enable) + val |= sc->def->enable_mask; + else + val &= ~sc->def->enable_mask; + rk8xx_write(sc->base_dev, sc->def->enable_reg, &val, 1); + + *udelay = 0; + + return (0); +} + +static void +rk8xx_regnode_reg_to_voltage(struct rk8xx_reg_sc *sc, uint8_t val, int *uv) +{ + if (val < sc->def->voltage_nstep) + *uv = sc->def->voltage_min + val * sc->def->voltage_step; + else + *uv = sc->def->voltage_min + + (sc->def->voltage_nstep * sc->def->voltage_step); +} + +static int +rk8xx_regnode_voltage_to_reg(struct rk8xx_reg_sc *sc, int min_uvolt, + int max_uvolt, uint8_t *val) +{ + uint8_t nval; + int nstep, uvolt; + + nval = 0; + uvolt = sc->def->voltage_min; + + for (nstep = 0; nstep < sc->def->voltage_nstep && uvolt < min_uvolt; + nstep++) { + ++nval; + uvolt += sc->def->voltage_step; + } + if (uvolt > max_uvolt) + return (EINVAL); + + *val = nval; + return (0); +} + +static int +rk8xx_regnode_status(struct regnode *regnode, int *status) +{ + struct rk8xx_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + *status = 0; + rk8xx_read(sc->base_dev, sc->def->enable_reg, &val, 1); + if (val & sc->def->enable_mask) + *status = REGULATOR_STATUS_ENABLED; + + return (0); +} + +static int +rk8xx_regnode_set_voltage(struct regnode *regnode, int min_uvolt, + int max_uvolt, int *udelay) +{ + struct rk8xx_reg_sc *sc; + uint8_t val; + int uvolt; + + sc = regnode_get_softc(regnode); + + if (!sc->def->voltage_step) + return (ENXIO); + + dprintf(sc, "Setting %s to %d<->%d uvolts\n", + sc->def->name, + min_uvolt, + max_uvolt); + rk8xx_read(sc->base_dev, sc->def->voltage_reg, &val, 1); + if (rk8xx_regnode_voltage_to_reg(sc, min_uvolt, max_uvolt, &val) != 0) + return (ERANGE); + + rk8xx_write(sc->base_dev, sc->def->voltage_reg, &val, 1); + + rk8xx_read(sc->base_dev, sc->def->voltage_reg, &val, 1); + + *udelay = 0; + + rk8xx_regnode_reg_to_voltage(sc, val, &uvolt); + dprintf(sc, "Regulator %s set to %d uvolt\n", + sc->def->name, + uvolt); + + return (0); +} + +static int +rk8xx_regnode_get_voltage(struct regnode *regnode, int *uvolt) +{ + struct rk8xx_reg_sc *sc; + uint8_t val; + + sc = regnode_get_softc(regnode); + + if (sc->def->voltage_min == sc->def->voltage_max) { + *uvolt = sc->def->voltage_min; + return (0); + } + + if (!sc->def->voltage_step) + return (ENXIO); + + rk8xx_read(sc->base_dev, sc->def->voltage_reg, &val, 1); + rk8xx_regnode_reg_to_voltage(sc, val & sc->def->voltage_mask, uvolt); + + dprintf(sc, "Regulator %s is at %d uvolt\n", + sc->def->name, + *uvolt); + + return (0); +} + +static regnode_method_t rk8xx_regnode_methods[] = { + /* Regulator interface */ + REGNODEMETHOD(regnode_init, rk8xx_regnode_init), + REGNODEMETHOD(regnode_enable, rk8xx_regnode_enable), + REGNODEMETHOD(regnode_status, rk8xx_regnode_status), + REGNODEMETHOD(regnode_set_voltage, rk8xx_regnode_set_voltage), + REGNODEMETHOD(regnode_get_voltage, rk8xx_regnode_get_voltage), + REGNODEMETHOD(regnode_check_voltage, regnode_method_check_voltage), + REGNODEMETHOD_END +}; +DEFINE_CLASS_1(rk8xx_regnode, rk8xx_regnode_class, rk8xx_regnode_methods, + sizeof(struct rk8xx_reg_sc), regnode_class); + +struct rk8xx_reg_sc * +rk8xx_reg_attach(device_t dev, phandle_t node, + struct rk8xx_regdef *def) +{ + struct rk8xx_reg_sc *reg_sc; + struct regnode_init_def initdef; + struct regnode *regnode; + + memset(&initdef, 0, sizeof(initdef)); + if (regulator_parse_ofw_stdparam(dev, node, &initdef) != 0) { + device_printf(dev, "cannot create regulator\n"); + return (NULL); + } + if (initdef.std_param.min_uvolt == 0) + initdef.std_param.min_uvolt = def->voltage_min; + if (initdef.std_param.max_uvolt == 0) + initdef.std_param.max_uvolt = def->voltage_max; + initdef.id = def->id; + initdef.ofw_node = node; + + regnode = regnode_create(dev, &rk8xx_regnode_class, &initdef); + if (regnode == NULL) { + device_printf(dev, "cannot create regulator\n"); + return (NULL); + } + + reg_sc = regnode_get_softc(regnode); + reg_sc->regnode = regnode; + reg_sc->base_dev = dev; + reg_sc->def = def; + reg_sc->xref = OF_xref_from_node(node); + reg_sc->param = regnode_get_stdparam(regnode); + + regnode_register(regnode); + + return (reg_sc); +} + +int +rk8xx_map(device_t dev, phandle_t xref, int ncells, + pcell_t *cells, intptr_t *id) +{ + struct rk8xx_softc *sc; + struct reg_list *regp; + + sc = device_get_softc(dev); + + TAILQ_FOREACH(regp, &sc->regs, next) { + if (regp->reg->xref == xref) { + *id = regp->reg->def->id; + return (0); + } + } + + return (ERANGE); +} From nobody Sun Nov 14 12:34:25 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4F354183C0EF; Sun, 14 Nov 2021 12:34:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HsWwf1VqVz4cML; Sun, 14 Nov 2021 12:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04DF4267A7; Sun, 14 Nov 2021 12:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AECYPwc068520; Sun, 14 Nov 2021 12:34:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AECYPmx068519; Sun, 14 Nov 2021 12:34:25 GMT (envelope-from git) Date: Sun, 14 Nov 2021 12:34:25 GMT Message-Id: <202111141234.1AECYPmx068519@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: cb3c3e0a4267 - main - pmic: rockchip: Split the clocks part in its own file List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cb3c3e0a4267b9a9d913739044255a21b093c9a0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=cb3c3e0a4267b9a9d913739044255a21b093c9a0 commit cb3c3e0a4267b9a9d913739044255a21b093c9a0 Author: Emmanuel Vadot AuthorDate: 2021-11-14 10:18:41 +0000 Commit: Emmanuel Vadot CommitDate: 2021-11-14 11:31:23 +0000 pmic: rockchip: Split the clocks part in its own file No functional changes intended. --- sys/conf/files.arm64 | 1 + sys/dev/iicbus/pmic/rockchip/rk805.c | 115 --------------------- sys/dev/iicbus/pmic/rockchip/rk8xx.h | 3 + sys/dev/iicbus/pmic/rockchip/rk8xx_clocks.c | 150 ++++++++++++++++++++++++++++ 4 files changed, 154 insertions(+), 115 deletions(-) diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 8ad88488fffe..6d73790801e1 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -541,6 +541,7 @@ arm64/rockchip/rk_dwc3.c optional fdt rk_dwc3 soc_rockchip_rk3399 arm64/rockchip/rk_i2c.c optional fdt rk_i2c soc_rockchip_rk3328 | fdt rk_i2c soc_rockchip_rk3399 arm64/rockchip/rk_i2s.c optional fdt sound soc_rockchip_rk3328 | fdt sound soc_rockchip_rk3399 dev/iicbus/pmic/rockchip/rk805.c optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399 +dev/iicbus/pmic/rockchip/rk8xx_clocks.c optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399 dev/iicbus/pmic/rockchip/rk8xx_regulators.c optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399 dev/iicbus/pmic/rockchip/rk8xx_rtc.c optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399 arm64/rockchip/rk_grf.c optional fdt soc_rockchip_rk3328 | fdt soc_rockchip_rk3399 diff --git a/sys/dev/iicbus/pmic/rockchip/rk805.c b/sys/dev/iicbus/pmic/rockchip/rk805.c index ba5da4e95279..3f842ac8d3e4 100644 --- a/sys/dev/iicbus/pmic/rockchip/rk805.c +++ b/sys/dev/iicbus/pmic/rockchip/rk805.c @@ -45,9 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include - #include #include #include @@ -318,118 +315,6 @@ rk8xx_write(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) return (iicdev_writeto(dev, reg, data, size, IIC_INTRWAIT)); } -/* -------------------------------------------------------------------------- */ - -/* Clock class and method */ -struct rk8xx_clk_sc { - device_t base_dev; -}; - -#define CLK32OUT_REG 0x20 -#define CLK32OUT_CLKOUT2_EN 1 - -static int -rk8xx_clk_set_gate_1(struct clknode *clk, bool enable) -{ - struct rk8xx_clk_sc *sc; - uint8_t val; - - sc = clknode_get_softc(clk); - - rk8xx_read(sc->base_dev, CLK32OUT_REG, &val, sizeof(val)); - if (enable) - val |= CLK32OUT_CLKOUT2_EN; - else - val &= ~CLK32OUT_CLKOUT2_EN; - rk8xx_write(sc->base_dev, CLK32OUT_REG, &val, 1); - - return (0); -} - -static int -rk8xx_clk_recalc(struct clknode *clk, uint64_t *freq) -{ - - *freq = 32768; - return (0); -} - -static clknode_method_t rk8xx_clk_clknode_methods_0[] = { - CLKNODEMETHOD(clknode_recalc_freq, rk8xx_clk_recalc), - CLKNODEMETHOD_END -}; - -DEFINE_CLASS_1(rk8xx_clk_clknode_0, rk8xx_clk_clknode_class_0, - rk8xx_clk_clknode_methods_0, sizeof(struct rk8xx_clk_sc), - clknode_class); - -static clknode_method_t rk8xx_clk_clknode_methods_1[] = { - CLKNODEMETHOD(clknode_set_gate, rk8xx_clk_set_gate_1), - CLKNODEMETHOD_END -}; - -DEFINE_CLASS_1(rk8xx_clk_clknode_1, rk8xx_clk_clknode_class_1, - rk8xx_clk_clknode_methods_1, sizeof(struct rk8xx_clk_sc), - rk8xx_clk_clknode_class_0); - -static int -rk8xx_export_clocks(device_t dev) -{ - struct clkdom *clkdom; - struct clknode_init_def clkidef; - struct clknode *clk; - struct rk8xx_clk_sc *clksc; - const char **clknames; - phandle_t node; - int nclks, rv; - - node = ofw_bus_get_node(dev); - - /* clock-output-names are optional. Could use them for clkidef.name. */ - nclks = ofw_bus_string_list_to_array(node, "clock-output-names", - &clknames); - - clkdom = clkdom_create(dev); - - memset(&clkidef, 0, sizeof(clkidef)); - clkidef.id = 0; - clkidef.name = (nclks = 2) ? clknames[0] : "clk32kout1"; - clk = clknode_create(clkdom, &rk8xx_clk_clknode_class_0, &clkidef); - if (clk == NULL) { - device_printf(dev, "Cannot create '%s'.\n", clkidef.name); - return (ENXIO); - } - clksc = clknode_get_softc(clk); - clksc->base_dev = dev; - clknode_register(clkdom, clk); - - memset(&clkidef, 0, sizeof(clkidef)); - clkidef.id = 1; - clkidef.name = (nclks = 2) ? clknames[1] : "clk32kout2"; - clk = clknode_create(clkdom, &rk8xx_clk_clknode_class_1, &clkidef); - if (clk == NULL) { - device_printf(dev, "Cannot create '%s'.\n", clkidef.name); - return (ENXIO); - } - clksc = clknode_get_softc(clk); - clksc->base_dev = dev; - clknode_register(clkdom, clk); - - rv = clkdom_finit(clkdom); - if (rv != 0) { - device_printf(dev, "Cannot finalize clkdom initialization: " - "%d\n", rv); - return (ENXIO); - } - - if (bootverbose) - clkdom_dump(clkdom); - - return (0); -} - -/* -------------------------------------------------------------------------- */ - static int rk8xx_probe(device_t dev) { diff --git a/sys/dev/iicbus/pmic/rockchip/rk8xx.h b/sys/dev/iicbus/pmic/rockchip/rk8xx.h index 8dc186beb5da..83e39b06b075 100644 --- a/sys/dev/iicbus/pmic/rockchip/rk8xx.h +++ b/sys/dev/iicbus/pmic/rockchip/rk8xx.h @@ -102,6 +102,9 @@ struct rk8xx_softc { int rk8xx_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size); int rk8xx_write(device_t dev, uint8_t reg, uint8_t *data, uint8_t size); +/* rk8xx_clocks.c */ +int rk8xx_export_clocks(device_t dev); + /* rk8xx_regulators.c */ struct rk8xx_reg_sc *rk8xx_reg_attach(device_t dev, phandle_t node, struct rk8xx_regdef *def); diff --git a/sys/dev/iicbus/pmic/rockchip/rk8xx_clocks.c b/sys/dev/iicbus/pmic/rockchip/rk8xx_clocks.c new file mode 100644 index 000000000000..7f28e18a5d7d --- /dev/null +++ b/sys/dev/iicbus/pmic/rockchip/rk8xx_clocks.c @@ -0,0 +1,150 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018-2021 Emmanuel Vadot + * Copyright (c) 2021 Bjoern A. Zeeb + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +#include + +#include + +/* Clock class and method */ +struct rk8xx_clk_sc { + device_t base_dev; +}; + +#define CLK32OUT_REG 0x20 +#define CLK32OUT_CLKOUT2_EN 1 + +static int +rk8xx_clk_set_gate_1(struct clknode *clk, bool enable) +{ + struct rk8xx_clk_sc *sc; + uint8_t val; + + sc = clknode_get_softc(clk); + + rk8xx_read(sc->base_dev, CLK32OUT_REG, &val, sizeof(val)); + if (enable) + val |= CLK32OUT_CLKOUT2_EN; + else + val &= ~CLK32OUT_CLKOUT2_EN; + rk8xx_write(sc->base_dev, CLK32OUT_REG, &val, 1); + + return (0); +} + +static int +rk8xx_clk_recalc(struct clknode *clk, uint64_t *freq) +{ + + *freq = 32768; + return (0); +} + +static clknode_method_t rk8xx_clk_clknode_methods_0[] = { + CLKNODEMETHOD(clknode_recalc_freq, rk8xx_clk_recalc), + CLKNODEMETHOD_END +}; + +DEFINE_CLASS_1(rk8xx_clk_clknode_0, rk8xx_clk_clknode_class_0, + rk8xx_clk_clknode_methods_0, sizeof(struct rk8xx_clk_sc), + clknode_class); + +static clknode_method_t rk8xx_clk_clknode_methods_1[] = { + CLKNODEMETHOD(clknode_set_gate, rk8xx_clk_set_gate_1), + CLKNODEMETHOD_END +}; + +DEFINE_CLASS_1(rk8xx_clk_clknode_1, rk8xx_clk_clknode_class_1, + rk8xx_clk_clknode_methods_1, sizeof(struct rk8xx_clk_sc), + rk8xx_clk_clknode_class_0); + +int +rk8xx_export_clocks(device_t dev) +{ + struct clkdom *clkdom; + struct clknode_init_def clkidef; + struct clknode *clk; + struct rk8xx_clk_sc *clksc; + const char **clknames; + phandle_t node; + int nclks, rv; + + node = ofw_bus_get_node(dev); + + /* clock-output-names are optional. Could use them for clkidef.name. */ + nclks = ofw_bus_string_list_to_array(node, "clock-output-names", + &clknames); + + clkdom = clkdom_create(dev); + + memset(&clkidef, 0, sizeof(clkidef)); + clkidef.id = 0; + clkidef.name = (nclks = 2) ? clknames[0] : "clk32kout1"; + clk = clknode_create(clkdom, &rk8xx_clk_clknode_class_0, &clkidef); + if (clk == NULL) { + device_printf(dev, "Cannot create '%s'.\n", clkidef.name); + return (ENXIO); + } + clksc = clknode_get_softc(clk); + clksc->base_dev = dev; + clknode_register(clkdom, clk); + + memset(&clkidef, 0, sizeof(clkidef)); + clkidef.id = 1; + clkidef.name = (nclks = 2) ? clknames[1] : "clk32kout2"; + clk = clknode_create(clkdom, &rk8xx_clk_clknode_class_1, &clkidef); + if (clk == NULL) { + device_printf(dev, "Cannot create '%s'.\n", clkidef.name); + return (ENXIO); + } + clksc = clknode_get_softc(clk); + clksc->base_dev = dev; + clknode_register(clkdom, clk); + + rv = clkdom_finit(clkdom); + if (rv != 0) { + device_printf(dev, "Cannot finalize clkdom initialization: " + "%d\n", rv); + return (ENXIO); + } + + if (bootverbose) + clkdom_dump(clkdom); + + return (0); +} From nobody Sun Nov 14 12:34:27 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C2E3D183C2E0; Sun, 14 Nov 2021 12:34:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HsWwg34P0z4cXd; Sun, 14 Nov 2021 12:34:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F86926984; Sun, 14 Nov 2021 12:34:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AECYRbZ068550; Sun, 14 Nov 2021 12:34:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AECYR4b068549; Sun, 14 Nov 2021 12:34:27 GMT (envelope-from git) Date: Sun, 14 Nov 2021 12:34:27 GMT Message-Id: <202111141234.1AECYR4b068549@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 98c60dc31f2f - main - pmic: rockchip: Split the driver in rk805 and rk808 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 98c60dc31f2fe91227a2c9927336c16c29d6b887 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=98c60dc31f2fe91227a2c9927336c16c29d6b887 commit 98c60dc31f2fe91227a2c9927336c16c29d6b887 Author: Emmanuel Vadot AuthorDate: 2021-11-14 10:59:55 +0000 Commit: Emmanuel Vadot CommitDate: 2021-11-14 11:31:26 +0000 pmic: rockchip: Split the driver in rk805 and rk808 This make the base driver cleaner and the subclassed driver only have related code. Kernel config wise this is still only handled by rk805. No functional changes intended. --- sys/conf/files.arm64 | 4 +- sys/dev/iicbus/pmic/rockchip/rk805.c | 383 +++--------------------- sys/dev/iicbus/pmic/rockchip/rk808.c | 273 +++++++++++++++++ sys/dev/iicbus/pmic/rockchip/rk8xx.c | 145 +++++++++ sys/dev/iicbus/pmic/rockchip/rk8xx.h | 12 +- sys/dev/iicbus/pmic/rockchip/rk8xx_clocks.c | 16 +- sys/dev/iicbus/pmic/rockchip/rk8xx_regulators.c | 38 ++- 7 files changed, 509 insertions(+), 362 deletions(-) diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 6d73790801e1..2b7c8bc569c7 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -540,7 +540,9 @@ arm64/rockchip/rk3399_emmcphy.c optional fdt rk_emmcphy soc_rockchip_rk3399 arm64/rockchip/rk_dwc3.c optional fdt rk_dwc3 soc_rockchip_rk3399 arm64/rockchip/rk_i2c.c optional fdt rk_i2c soc_rockchip_rk3328 | fdt rk_i2c soc_rockchip_rk3399 arm64/rockchip/rk_i2s.c optional fdt sound soc_rockchip_rk3328 | fdt sound soc_rockchip_rk3399 -dev/iicbus/pmic/rockchip/rk805.c optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399 +dev/iicbus/pmic/rockchip/rk8xx.c optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399 +dev/iicbus/pmic/rockchip/rk805.c optional fdt rk805 soc_rockchip_rk3328 +dev/iicbus/pmic/rockchip/rk808.c optional fdt rk805 soc_rockchip_rk3399 dev/iicbus/pmic/rockchip/rk8xx_clocks.c optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399 dev/iicbus/pmic/rockchip/rk8xx_regulators.c optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399 dev/iicbus/pmic/rockchip/rk8xx_rtc.c optional fdt rk805 soc_rockchip_rk3328 | fdt rk805 soc_rockchip_rk3399 diff --git a/sys/dev/iicbus/pmic/rockchip/rk805.c b/sys/dev/iicbus/pmic/rockchip/rk805.c index 3f842ac8d3e4..9c072293d0f7 100644 --- a/sys/dev/iicbus/pmic/rockchip/rk805.c +++ b/sys/dev/iicbus/pmic/rockchip/rk805.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2018 Emmanuel Vadot + * Copyright (c) 2018-2021 Emmanuel Vadot * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -46,17 +46,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include -#include "clock_if.h" -#include "regdev_if.h" - -MALLOC_DEFINE(M_RK805_REG, "RK805 regulator", "RK805 power regulator"); - static struct ofw_compat_data compat_data[] = { {"rockchip,rk805", RK805}, - {"rockchip,rk808", RK808}, {NULL, 0} }; @@ -141,182 +134,8 @@ static struct rk8xx_regdef rk805_regdefs[] = { }, }; -static struct rk8xx_regdef rk808_regdefs[] = { - { - .id = RK808_BUCK1, - .name = "DCDC_REG1", - .enable_reg = RK808_DCDC_EN, - .enable_mask = 0x1, - .voltage_reg = RK808_BUCK1_ON_VSEL, - .voltage_mask = 0x3F, - .voltage_min = 712500, - .voltage_max = 1500000, - .voltage_step = 12500, - .voltage_nstep = 64, - }, - { - .id = RK808_BUCK2, - .name = "DCDC_REG2", - .enable_reg = RK808_DCDC_EN, - .enable_mask = 0x2, - .voltage_reg = RK808_BUCK2_ON_VSEL, - .voltage_mask = 0x3F, - .voltage_min = 712500, - .voltage_max = 1500000, - .voltage_step = 12500, - .voltage_nstep = 64, - }, - { - /* BUCK3 voltage is calculated based on external resistor */ - .id = RK808_BUCK3, - .name = "DCDC_REG3", - .enable_reg = RK808_DCDC_EN, - .enable_mask = 0x4, - }, - { - .id = RK808_BUCK4, - .name = "DCDC_REG4", - .enable_reg = RK808_DCDC_EN, - .enable_mask = 0x8, - .voltage_reg = RK808_BUCK4_ON_VSEL, - .voltage_mask = 0xF, - .voltage_min = 1800000, - .voltage_max = 3300000, - .voltage_step = 100000, - .voltage_nstep = 16, - }, - { - .id = RK808_LDO1, - .name = "LDO_REG1", - .enable_reg = RK808_LDO_EN, - .enable_mask = 0x1, - .voltage_reg = RK808_LDO1_ON_VSEL, - .voltage_mask = 0x1F, - .voltage_min = 1800000, - .voltage_max = 3400000, - .voltage_step = 100000, - .voltage_nstep = 17, - }, - { - .id = RK808_LDO2, - .name = "LDO_REG2", - .enable_reg = RK808_LDO_EN, - .enable_mask = 0x2, - .voltage_reg = RK808_LDO2_ON_VSEL, - .voltage_mask = 0x1F, - .voltage_min = 1800000, - .voltage_max = 3400000, - .voltage_step = 100000, - .voltage_nstep = 17, - }, - { - .id = RK808_LDO3, - .name = "LDO_REG3", - .enable_reg = RK808_LDO_EN, - .enable_mask = 0x4, - .voltage_reg = RK808_LDO3_ON_VSEL, - .voltage_mask = 0xF, - .voltage_min = 800000, - .voltage_max = 2500000, - .voltage_step = 100000, - .voltage_nstep = 18, - }, - { - .id = RK808_LDO4, - .name = "LDO_REG4", - .enable_reg = RK808_LDO_EN, - .enable_mask = 0x8, - .voltage_reg = RK808_LDO4_ON_VSEL, - .voltage_mask = 0x1F, - .voltage_min = 1800000, - .voltage_max = 3400000, - .voltage_step = 100000, - .voltage_nstep = 17, - }, - { - .id = RK808_LDO5, - .name = "LDO_REG5", - .enable_reg = RK808_LDO_EN, - .enable_mask = 0x10, - .voltage_reg = RK808_LDO5_ON_VSEL, - .voltage_mask = 0x1F, - .voltage_min = 1800000, - .voltage_max = 3400000, - .voltage_step = 100000, - .voltage_nstep = 17, - }, - { - .id = RK808_LDO6, - .name = "LDO_REG6", - .enable_reg = RK808_LDO_EN, - .enable_mask = 0x20, - .voltage_reg = RK808_LDO6_ON_VSEL, - .voltage_mask = 0x1F, - .voltage_min = 800000, - .voltage_max = 2500000, - .voltage_step = 100000, - .voltage_nstep = 18, - }, - { - .id = RK808_LDO7, - .name = "LDO_REG7", - .enable_reg = RK808_LDO_EN, - .enable_mask = 0x40, - .voltage_reg = RK808_LDO7_ON_VSEL, - .voltage_mask = 0x1F, - .voltage_min = 800000, - .voltage_max = 2500000, - .voltage_step = 100000, - .voltage_nstep = 18, - }, - { - .id = RK808_LDO8, - .name = "LDO_REG8", - .enable_reg = RK808_LDO_EN, - .enable_mask = 0x80, - .voltage_reg = RK808_LDO8_ON_VSEL, - .voltage_mask = 0x1F, - .voltage_min = 1800000, - .voltage_max = 3400000, - .voltage_step = 100000, - .voltage_nstep = 17, - }, - { - .id = RK808_SWITCH1, - .name = "SWITCH_REG1", - .enable_reg = RK808_DCDC_EN, - .enable_mask = 0x20, - .voltage_min = 3000000, - .voltage_max = 3000000, - }, - { - .id = RK808_SWITCH2, - .name = "SWITCH_REG2", - .enable_reg = RK808_DCDC_EN, - .enable_mask = 0x40, - .voltage_min = 3000000, - .voltage_max = 3000000, - }, -}; - -int -rk8xx_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) -{ - int err; - - err = iicdev_readfrom(dev, reg, data, size, IIC_INTRWAIT); - return (err); -} - -int -rk8xx_write(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) -{ - - return (iicdev_writeto(dev, reg, data, size, IIC_INTRWAIT)); -} - static int -rk8xx_probe(device_t dev) +rk805_probe(device_t dev) { if (!ofw_bus_status_okay(dev)) return (ENXIO); @@ -324,188 +143,56 @@ rk8xx_probe(device_t dev) if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); - device_set_desc(dev, "RockChip RK8XX PMIC"); + device_set_desc(dev, "RockChip RK805 PMIC"); return (BUS_PROBE_DEFAULT); } -static void -rk8xx_start(void *pdev) -{ - struct rk8xx_softc *sc; - device_t dev; - uint8_t data[2]; - int err; - - dev = pdev; - sc = device_get_softc(dev); - sc->dev = dev; - - /* No version register in RK808 */ - if (bootverbose && sc->type == RK805) { - err = rk8xx_read(dev, RK805_CHIP_NAME, data, 1); - if (err != 0) { - device_printf(dev, "Cannot read chip name reg\n"); - return; - } - err = rk8xx_read(dev, RK805_CHIP_VER, data + 1, 1); - if (err != 0) { - device_printf(dev, "Cannot read chip version reg\n"); - return; - } - device_printf(dev, "Chip Name: %x\n", - data[0] << 4 | ((data[1] >> 4) & 0xf)); - device_printf(dev, "Chip Version: %x\n", data[1] & 0xf); - } - - /* Register this as a 1Hz clock */ - clock_register(dev, 1000000); - - config_intrhook_disestablish(&sc->intr_hook); -} - static int -rk8xx_attach(device_t dev) +rk805_attach(device_t dev) { struct rk8xx_softc *sc; - struct rk8xx_reg_sc *reg; - struct rk8xx_regdef *regdefs; - struct reg_list *regp; - phandle_t rnode, child; - int error, i; sc = device_get_softc(dev); + sc->dev = dev; sc->type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; - error = rk8xx_export_clocks(dev); - if (error != 0) - return (error); - - sc->intr_hook.ich_func = rk8xx_start; - sc->intr_hook.ich_arg = dev; - if (config_intrhook_establish(&sc->intr_hook) != 0) - return (ENOMEM); - switch (sc->type) { - case RK805: - regdefs = rk805_regdefs; - sc->nregs = nitems(rk805_regdefs); - sc->rtc_regs.secs = RK805_RTC_SECS; - sc->rtc_regs.secs_mask = RK805_RTC_SECS_MASK; - sc->rtc_regs.minutes = RK805_RTC_MINUTES; - sc->rtc_regs.minutes_mask = RK805_RTC_MINUTES_MASK; - sc->rtc_regs.hours = RK805_RTC_HOURS; - sc->rtc_regs.hours_mask = RK805_RTC_HOURS_MASK; - sc->rtc_regs.days = RK805_RTC_DAYS; - sc->rtc_regs.days_mask = RK805_RTC_DAYS_MASK; - sc->rtc_regs.months = RK805_RTC_MONTHS; - sc->rtc_regs.months_mask = RK805_RTC_MONTHS_MASK; - sc->rtc_regs.years = RK805_RTC_YEARS; - sc->rtc_regs.weeks = RK805_RTC_WEEKS_MASK; - sc->rtc_regs.ctrl = RK805_RTC_CTRL; - sc->rtc_regs.ctrl_stop_mask = RK805_RTC_CTRL_STOP; - sc->rtc_regs.ctrl_ampm_mask = RK805_RTC_AMPM_MODE; - sc->rtc_regs.ctrl_gettime_mask = RK805_RTC_GET_TIME; - sc->rtc_regs.ctrl_readsel_mask = RK805_RTC_READSEL; - break; - case RK808: - regdefs = rk808_regdefs; - sc->nregs = nitems(rk808_regdefs); - sc->rtc_regs.secs = RK808_RTC_SECS; - sc->rtc_regs.secs_mask = RK808_RTC_SECS_MASK; - sc->rtc_regs.minutes = RK808_RTC_MINUTES; - sc->rtc_regs.minutes_mask = RK808_RTC_MINUTES_MASK; - sc->rtc_regs.hours = RK808_RTC_HOURS; - sc->rtc_regs.hours_mask = RK808_RTC_HOURS_MASK; - sc->rtc_regs.days = RK808_RTC_DAYS; - sc->rtc_regs.days_mask = RK808_RTC_DAYS_MASK; - sc->rtc_regs.months = RK808_RTC_MONTHS; - sc->rtc_regs.months_mask = RK808_RTC_MONTHS_MASK; - sc->rtc_regs.years = RK808_RTC_YEARS; - sc->rtc_regs.weeks = RK808_RTC_WEEKS_MASK; - sc->rtc_regs.ctrl = RK808_RTC_CTRL; - sc->rtc_regs.ctrl_stop_mask = RK808_RTC_CTRL_STOP; - sc->rtc_regs.ctrl_ampm_mask = RK808_RTC_AMPM_MODE; - sc->rtc_regs.ctrl_gettime_mask = RK808_RTC_GET_TIME; - sc->rtc_regs.ctrl_readsel_mask = RK808_RTC_READSEL; - break; - default: - device_printf(dev, "Unknown type %d\n", sc->type); - return (ENXIO); - } - - TAILQ_INIT(&sc->regs); - - rnode = ofw_bus_find_child(ofw_bus_get_node(dev), "regulators"); - if (rnode > 0) { - for (i = 0; i < sc->nregs; i++) { - child = ofw_bus_find_child(rnode, - regdefs[i].name); - if (child == 0) - continue; - if (OF_hasprop(child, "regulator-name") != 1) - continue; - reg = rk8xx_reg_attach(dev, child, ®defs[i]); - if (reg == NULL) { - device_printf(dev, - "cannot attach regulator %s\n", - regdefs[i].name); - continue; - } - regp = malloc(sizeof(*regp), M_DEVBUF, M_WAITOK | M_ZERO); - regp->reg = reg; - TAILQ_INSERT_TAIL(&sc->regs, regp, next); - if (bootverbose) - device_printf(dev, "Regulator %s attached\n", - regdefs[i].name); - } - } - - if (OF_hasprop(ofw_bus_get_node(dev), - "rockchip,system-power-controller")) { - /* - * The priority is chosen to override PSCI and EFI shutdown - * methods as those two just hang without powering off on Rock64 - * at least. - */ - EVENTHANDLER_REGISTER(shutdown_final, rk805_poweroff, dev, - SHUTDOWN_PRI_LAST - 2); - } - - return (0); + sc->regdefs = rk805_regdefs; + sc->nregs = nitems(rk805_regdefs); + sc->rtc_regs.secs = RK805_RTC_SECS; + sc->rtc_regs.secs_mask = RK805_RTC_SECS_MASK; + sc->rtc_regs.minutes = RK805_RTC_MINUTES; + sc->rtc_regs.minutes_mask = RK805_RTC_MINUTES_MASK; + sc->rtc_regs.hours = RK805_RTC_HOURS; + sc->rtc_regs.hours_mask = RK805_RTC_HOURS_MASK; + sc->rtc_regs.days = RK805_RTC_DAYS; + sc->rtc_regs.days_mask = RK805_RTC_DAYS_MASK; + sc->rtc_regs.months = RK805_RTC_MONTHS; + sc->rtc_regs.months_mask = RK805_RTC_MONTHS_MASK; + sc->rtc_regs.years = RK805_RTC_YEARS; + sc->rtc_regs.weeks = RK805_RTC_WEEKS_MASK; + sc->rtc_regs.ctrl = RK805_RTC_CTRL; + sc->rtc_regs.ctrl_stop_mask = RK805_RTC_CTRL_STOP; + sc->rtc_regs.ctrl_ampm_mask = RK805_RTC_AMPM_MODE; + sc->rtc_regs.ctrl_gettime_mask = RK805_RTC_GET_TIME; + sc->rtc_regs.ctrl_readsel_mask = RK805_RTC_READSEL; + + return (rk8xx_attach(sc)); } -static int -rk8xx_detach(device_t dev) -{ - - /* We cannot detach regulators */ - return (EBUSY); -} - -static device_method_t rk8xx_methods[] = { - DEVMETHOD(device_probe, rk8xx_probe), - DEVMETHOD(device_attach, rk8xx_attach), - DEVMETHOD(device_detach, rk8xx_detach), - - /* regdev interface */ - DEVMETHOD(regdev_map, rk8xx_map), - - /* Clock interface */ - DEVMETHOD(clock_gettime, rk8xx_gettime), - DEVMETHOD(clock_settime, rk8xx_settime), +static device_method_t rk805_methods[] = { + DEVMETHOD(device_probe, rk805_probe), + DEVMETHOD(device_attach, rk805_attach), DEVMETHOD_END }; -static driver_t rk8xx_driver = { - "rk8xx_pmu", - rk8xx_methods, - sizeof(struct rk8xx_softc), -}; +DEFINE_CLASS_1(iichb, rk805_driver, rk805_methods, + sizeof(struct rk8xx_softc), rk8xx_driver); -static devclass_t rk8xx_devclass; +static devclass_t rk805_devclass; -EARLY_DRIVER_MODULE(rk8xx, iicbus, rk8xx_driver, rk8xx_devclass, 0, 0, +EARLY_DRIVER_MODULE(rk805, iicbus, rk805_driver, rk805_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); -MODULE_DEPEND(rk8xx, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); -MODULE_VERSION(rk8xx, 1); +MODULE_DEPEND(rk805, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); +MODULE_VERSION(rk805, 1); diff --git a/sys/dev/iicbus/pmic/rockchip/rk808.c b/sys/dev/iicbus/pmic/rockchip/rk808.c new file mode 100644 index 000000000000..d82da20fa672 --- /dev/null +++ b/sys/dev/iicbus/pmic/rockchip/rk808.c @@ -0,0 +1,273 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018-2021 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +static struct ofw_compat_data compat_data[] = { + {"rockchip,rk808", RK808}, + {NULL, 0} +}; + +static struct rk8xx_regdef rk808_regdefs[] = { + { + .id = RK808_BUCK1, + .name = "DCDC_REG1", + .enable_reg = RK808_DCDC_EN, + .enable_mask = 0x1, + .voltage_reg = RK808_BUCK1_ON_VSEL, + .voltage_mask = 0x3F, + .voltage_min = 712500, + .voltage_max = 1500000, + .voltage_step = 12500, + .voltage_nstep = 64, + }, + { + .id = RK808_BUCK2, + .name = "DCDC_REG2", + .enable_reg = RK808_DCDC_EN, + .enable_mask = 0x2, + .voltage_reg = RK808_BUCK2_ON_VSEL, + .voltage_mask = 0x3F, + .voltage_min = 712500, + .voltage_max = 1500000, + .voltage_step = 12500, + .voltage_nstep = 64, + }, + { + /* BUCK3 voltage is calculated based on external resistor */ + .id = RK808_BUCK3, + .name = "DCDC_REG3", + .enable_reg = RK808_DCDC_EN, + .enable_mask = 0x4, + }, + { + .id = RK808_BUCK4, + .name = "DCDC_REG4", + .enable_reg = RK808_DCDC_EN, + .enable_mask = 0x8, + .voltage_reg = RK808_BUCK4_ON_VSEL, + .voltage_mask = 0xF, + .voltage_min = 1800000, + .voltage_max = 3300000, + .voltage_step = 100000, + .voltage_nstep = 16, + }, + { + .id = RK808_LDO1, + .name = "LDO_REG1", + .enable_reg = RK808_LDO_EN, + .enable_mask = 0x1, + .voltage_reg = RK808_LDO1_ON_VSEL, + .voltage_mask = 0x1F, + .voltage_min = 1800000, + .voltage_max = 3400000, + .voltage_step = 100000, + .voltage_nstep = 17, + }, + { + .id = RK808_LDO2, + .name = "LDO_REG2", + .enable_reg = RK808_LDO_EN, + .enable_mask = 0x2, + .voltage_reg = RK808_LDO2_ON_VSEL, + .voltage_mask = 0x1F, + .voltage_min = 1800000, + .voltage_max = 3400000, + .voltage_step = 100000, + .voltage_nstep = 17, + }, + { + .id = RK808_LDO3, + .name = "LDO_REG3", + .enable_reg = RK808_LDO_EN, + .enable_mask = 0x4, + .voltage_reg = RK808_LDO3_ON_VSEL, + .voltage_mask = 0xF, + .voltage_min = 800000, + .voltage_max = 2500000, + .voltage_step = 100000, + .voltage_nstep = 18, + }, + { + .id = RK808_LDO4, + .name = "LDO_REG4", + .enable_reg = RK808_LDO_EN, + .enable_mask = 0x8, + .voltage_reg = RK808_LDO4_ON_VSEL, + .voltage_mask = 0x1F, + .voltage_min = 1800000, + .voltage_max = 3400000, + .voltage_step = 100000, + .voltage_nstep = 17, + }, + { + .id = RK808_LDO5, + .name = "LDO_REG5", + .enable_reg = RK808_LDO_EN, + .enable_mask = 0x10, + .voltage_reg = RK808_LDO5_ON_VSEL, + .voltage_mask = 0x1F, + .voltage_min = 1800000, + .voltage_max = 3400000, + .voltage_step = 100000, + .voltage_nstep = 17, + }, + { + .id = RK808_LDO6, + .name = "LDO_REG6", + .enable_reg = RK808_LDO_EN, + .enable_mask = 0x20, + .voltage_reg = RK808_LDO6_ON_VSEL, + .voltage_mask = 0x1F, + .voltage_min = 800000, + .voltage_max = 2500000, + .voltage_step = 100000, + .voltage_nstep = 18, + }, + { + .id = RK808_LDO7, + .name = "LDO_REG7", + .enable_reg = RK808_LDO_EN, + .enable_mask = 0x40, + .voltage_reg = RK808_LDO7_ON_VSEL, + .voltage_mask = 0x1F, + .voltage_min = 800000, + .voltage_max = 2500000, + .voltage_step = 100000, + .voltage_nstep = 18, + }, + { + .id = RK808_LDO8, + .name = "LDO_REG8", + .enable_reg = RK808_LDO_EN, + .enable_mask = 0x80, + .voltage_reg = RK808_LDO8_ON_VSEL, + .voltage_mask = 0x1F, + .voltage_min = 1800000, + .voltage_max = 3400000, + .voltage_step = 100000, + .voltage_nstep = 17, + }, + { + .id = RK808_SWITCH1, + .name = "SWITCH_REG1", + .enable_reg = RK808_DCDC_EN, + .enable_mask = 0x20, + .voltage_min = 3000000, + .voltage_max = 3000000, + }, + { + .id = RK808_SWITCH2, + .name = "SWITCH_REG2", + .enable_reg = RK808_DCDC_EN, + .enable_mask = 0x40, + .voltage_min = 3000000, + .voltage_max = 3000000, + }, +}; + +static int +rk808_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "RockChip RK808 PMIC"); + return (BUS_PROBE_DEFAULT); +} + +static int +rk808_attach(device_t dev) +{ + struct rk8xx_softc *sc; + + sc = device_get_softc(dev); + sc->dev = dev; + + sc->type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + + sc->regdefs = rk808_regdefs; + sc->nregs = nitems(rk808_regdefs); + sc->rtc_regs.secs = RK808_RTC_SECS; + sc->rtc_regs.secs_mask = RK808_RTC_SECS_MASK; + sc->rtc_regs.minutes = RK808_RTC_MINUTES; + sc->rtc_regs.minutes_mask = RK808_RTC_MINUTES_MASK; + sc->rtc_regs.hours = RK808_RTC_HOURS; + sc->rtc_regs.hours_mask = RK808_RTC_HOURS_MASK; + sc->rtc_regs.days = RK808_RTC_DAYS; + sc->rtc_regs.days_mask = RK808_RTC_DAYS_MASK; + sc->rtc_regs.months = RK808_RTC_MONTHS; + sc->rtc_regs.months_mask = RK808_RTC_MONTHS_MASK; + sc->rtc_regs.years = RK808_RTC_YEARS; + sc->rtc_regs.weeks = RK808_RTC_WEEKS_MASK; + sc->rtc_regs.ctrl = RK808_RTC_CTRL; + sc->rtc_regs.ctrl_stop_mask = RK808_RTC_CTRL_STOP; + sc->rtc_regs.ctrl_ampm_mask = RK808_RTC_AMPM_MODE; + sc->rtc_regs.ctrl_gettime_mask = RK808_RTC_GET_TIME; + sc->rtc_regs.ctrl_readsel_mask = RK808_RTC_READSEL; + + return (rk8xx_attach(sc)); +} + +static device_method_t rk808_methods[] = { + DEVMETHOD(device_probe, rk808_probe), + DEVMETHOD(device_attach, rk808_attach), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(iichb, rk808_driver, rk808_methods, + sizeof(struct rk8xx_softc), rk8xx_driver); + +static devclass_t rk808_devclass; + +EARLY_DRIVER_MODULE(rk808, iicbus, rk808_driver, rk808_devclass, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); +MODULE_DEPEND(rk808, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); +MODULE_VERSION(rk808, 1); diff --git a/sys/dev/iicbus/pmic/rockchip/rk8xx.c b/sys/dev/iicbus/pmic/rockchip/rk8xx.c new file mode 100644 index 000000000000..46f9ed24ca39 --- /dev/null +++ b/sys/dev/iicbus/pmic/rockchip/rk8xx.c @@ -0,0 +1,145 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018-2021 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include + +#include "clock_if.h" +#include "regdev_if.h" + +int +rk8xx_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) +{ + int err; + + err = iicdev_readfrom(dev, reg, data, size, IIC_INTRWAIT); + return (err); +} + +int +rk8xx_write(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) +{ + + return (iicdev_writeto(dev, reg, data, size, IIC_INTRWAIT)); +} + +static void +rk8xx_start(void *pdev) +{ + struct rk8xx_softc *sc; + device_t dev; + uint8_t data[2]; + int err; + + dev = pdev; + sc = device_get_softc(dev); + sc->dev = dev; + + /* No version register in RK808 */ + if (bootverbose && sc->type == RK805) { + err = rk8xx_read(dev, RK805_CHIP_NAME, data, 1); + if (err != 0) { + device_printf(dev, "Cannot read chip name reg\n"); + return; + } + err = rk8xx_read(dev, RK805_CHIP_VER, data + 1, 1); + if (err != 0) { + device_printf(dev, "Cannot read chip version reg\n"); + return; + } + device_printf(dev, "Chip Name: %x\n", + data[0] << 4 | ((data[1] >> 4) & 0xf)); + device_printf(dev, "Chip Version: %x\n", data[1] & 0xf); + } + + /* Register this as a 1Hz clock */ + clock_register(dev, 1000000); + + config_intrhook_disestablish(&sc->intr_hook); +} + +int +rk8xx_attach(struct rk8xx_softc *sc) +{ + int error; + + error = rk8xx_attach_clocks(sc); + if (error != 0) + return (error); + + sc->intr_hook.ich_func = rk8xx_start; + sc->intr_hook.ich_arg = sc->dev; + if (config_intrhook_establish(&sc->intr_hook) != 0) + return (ENOMEM); + + rk8xx_attach_regulators(sc); + + return (0); +} + +static int +rk8xx_detach(device_t dev) +{ + + /* We cannot detach regulators */ + return (EBUSY); +} + +static device_method_t rk8xx_methods[] = { + DEVMETHOD(device_detach, rk8xx_detach), + + /* regdev interface */ + DEVMETHOD(regdev_map, rk8xx_map), + + /* Clock interface */ + DEVMETHOD(clock_gettime, rk8xx_gettime), + DEVMETHOD(clock_settime, rk8xx_settime), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(rk8xx, rk8xx_driver, rk8xx_methods, + sizeof(struct rk8xx_softc)); diff --git a/sys/dev/iicbus/pmic/rockchip/rk8xx.h b/sys/dev/iicbus/pmic/rockchip/rk8xx.h index 83e39b06b075..738209f5871e 100644 --- a/sys/dev/iicbus/pmic/rockchip/rk8xx.h +++ b/sys/dev/iicbus/pmic/rockchip/rk8xx.h @@ -93,7 +93,8 @@ struct rk8xx_softc { struct intr_config_hook intr_hook; enum rk_pmic_type type; - TAILQ_HEAD(, reg_list) regs; + struct rk8xx_regdef *regdefs; + TAILQ_HEAD(, reg_list) regs; int nregs; struct rk8xx_rtc_reg rtc_regs; @@ -102,12 +103,15 @@ struct rk8xx_softc { int rk8xx_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size); int rk8xx_write(device_t dev, uint8_t reg, uint8_t *data, uint8_t size); +DECLARE_CLASS(rk8xx_driver); + +int rk8xx_attach(struct rk8xx_softc *sc); + /* rk8xx_clocks.c */ -int rk8xx_export_clocks(device_t dev); +int rk8xx_attach_clocks(struct rk8xx_softc *sc); /* rk8xx_regulators.c */ -struct rk8xx_reg_sc *rk8xx_reg_attach(device_t dev, phandle_t node, - struct rk8xx_regdef *def); +void rk8xx_attach_regulators(struct rk8xx_softc *sc); int rk8xx_map(device_t dev, phandle_t xref, int ncells, pcell_t *cells, intptr_t *id); diff --git a/sys/dev/iicbus/pmic/rockchip/rk8xx_clocks.c b/sys/dev/iicbus/pmic/rockchip/rk8xx_clocks.c index 7f28e18a5d7d..4b86d28e5f8f 100644 --- a/sys/dev/iicbus/pmic/rockchip/rk8xx_clocks.c +++ b/sys/dev/iicbus/pmic/rockchip/rk8xx_clocks.c @@ -94,7 +94,7 @@ DEFINE_CLASS_1(rk8xx_clk_clknode_1, rk8xx_clk_clknode_class_1, rk8xx_clk_clknode_class_0); int -rk8xx_export_clocks(device_t dev) +rk8xx_attach_clocks(struct rk8xx_softc *sc) { struct clkdom *clkdom; struct clknode_init_def clkidef; @@ -104,24 +104,24 @@ rk8xx_export_clocks(device_t dev) phandle_t node; int nclks, rv; - node = ofw_bus_get_node(dev); + node = ofw_bus_get_node(sc->dev); /* clock-output-names are optional. Could use them for clkidef.name. */ nclks = ofw_bus_string_list_to_array(node, "clock-output-names", &clknames); - clkdom = clkdom_create(dev); + clkdom = clkdom_create(sc->dev); memset(&clkidef, 0, sizeof(clkidef)); clkidef.id = 0; clkidef.name = (nclks = 2) ? clknames[0] : "clk32kout1"; clk = clknode_create(clkdom, &rk8xx_clk_clknode_class_0, &clkidef); if (clk == NULL) { - device_printf(dev, "Cannot create '%s'.\n", clkidef.name); + device_printf(sc->dev, "Cannot create '%s'.\n", clkidef.name); return (ENXIO); } clksc = clknode_get_softc(clk); - clksc->base_dev = dev; + clksc->base_dev = sc->dev; clknode_register(clkdom, clk); memset(&clkidef, 0, sizeof(clkidef)); @@ -129,16 +129,16 @@ rk8xx_export_clocks(device_t dev) clkidef.name = (nclks = 2) ? clknames[1] : "clk32kout2"; *** 74 LINES SKIPPED *** From nobody Sun Nov 14 12:39:21 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CA21A18416AA; Sun, 14 Nov 2021 12:39:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HsX2K5JlNz4h1K; Sun, 14 Nov 2021 12:39:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91E4F26986; Sun, 14 Nov 2021 12:39:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AECdLTa069027; Sun, 14 Nov 2021 12:39:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AECdLrA069026; Sun, 14 Nov 2021 12:39:21 GMT (envelope-from git) Date: Sun, 14 Nov 2021 12:39:21 GMT Message-Id: <202111141239.1AECdLrA069026@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 44aae623ab85 - main - Add ETHER_ALIGN support to ng_device(4). List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 44aae623ab858387301358b9b054cd229ce41068 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=44aae623ab858387301358b9b054cd229ce41068 commit 44aae623ab858387301358b9b054cd229ce41068 Author: Ian Lepore AuthorDate: 2021-11-09 14:34:06 +0000 Commit: Emmanuel Vadot CommitDate: 2021-11-14 12:37:41 +0000 Add ETHER_ALIGN support to ng_device(4). This adds a new ng_device command, NGM_DEVICE_ETHERALIGN, which has no associated args. After the command arrives, the device begins adjusting all packets sent out its hook to have ETHER_ALIGN bytes of padding at the beginning of the packet. The ETHER_ALIGN padding is added only when running on an architecture that requires strict alignment of IP headers (based on the __NO_STRICT_ALIGNMENT macro, which is only #define'd on x86 as of this writing). This also adds ascii <-> binary command translation to ng_device, both for the existing NGM_DEVICE_GET_DEVNAME and the new ETHERALIGN command. This also gives a name to every ng_device node when it is constructed, using the cdev device name (ngd0, ngd1, etc). This makes it easier to address command msgs to the device using ngctl(8). Reviewed by: donner, ray, adrian Differential Revision: https://reviews.freebsd.org/D32905 MFC after: 1 week --- share/man/man4/ng_device.4 | 16 ++++++++++++---- sys/netgraph/ng_device.c | 39 ++++++++++++++++++++++++++++++++++++++- sys/netgraph/ng_device.h | 1 + 3 files changed, 51 insertions(+), 5 deletions(-) diff --git a/share/man/man4/ng_device.4 b/share/man/man4/ng_device.4 index 5374e646dbef..8b1ee32b8536 100644 --- a/share/man/man4/ng_device.4 +++ b/share/man/man4/ng_device.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 19, 2004 +.Dd November 8, 2021 .Dt NG_DEVICE 4 .Os .Sh NAME @@ -48,7 +48,7 @@ etc. .Pp The first node is created as .Pa /dev/ngd0 , -all subsequent nodes +subsequent nodes are .Pa /dev/ngd1 , /dev/ngd2 , etc. .Sh HOOKS @@ -64,10 +64,18 @@ will be forwarded to the hook. .Sh CONTROL MESSAGES The .Nm device -node supports one non-generic control message: +node supports the generic control messages, plus the following: .Bl -tag -width 3n .It Dv NGM_DEVICE_GET_DEVNAME -Returns device name corresponding to a node. +Returns the device name corresponding to the node. +.It Dv NGM_DEVICE_ETHERALIGN +Apply the system ETHER_ALIGN offset to mbufs sent out the node's hook, +if running on an architecture that requires strict alignment. +Use this option when the data being injected via the device node ultimately +ends up being fed into the protocol stack as ethernet packets (e.g., via +an +.Xr ng_eiface 4 +node). .El .\" Additionally, the node accepts .\" .Xr ioctl 2 Ns s diff --git a/sys/netgraph/ng_device.c b/sys/netgraph/ng_device.c index ff62f7f44a35..032867ee4bf6 100644 --- a/sys/netgraph/ng_device.c +++ b/sys/netgraph/ng_device.c @@ -50,10 +50,12 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -63,6 +65,7 @@ #include #include #include +#include #define ERROUT(x) do { error = (x); goto done; } while (0) @@ -75,6 +78,25 @@ static ng_newhook_t ng_device_newhook; static ng_rcvdata_t ng_device_rcvdata; static ng_disconnect_t ng_device_disconnect; +/* List of commands and how to convert arguments to/from ASCII. */ +static const struct ng_cmdlist ng_device_cmds[] = { + { + NGM_DEVICE_COOKIE, + NGM_DEVICE_GET_DEVNAME, + "getdevname", + NULL, + &ng_parse_string_type + }, + { + NGM_DEVICE_COOKIE, + NGM_DEVICE_ETHERALIGN, + "etheralign", + NULL, + NULL + }, + { 0 } +}; + /* Netgraph type */ static struct ng_type ngd_typestruct = { .version = NG_ABI_VERSION, @@ -86,6 +108,7 @@ static struct ng_type ngd_typestruct = { .newhook = ng_device_newhook, .rcvdata = ng_device_rcvdata, .disconnect = ng_device_disconnect, + .cmdlist = ng_device_cmds, }; NETGRAPH_INIT(device, &ngd_typestruct); @@ -97,6 +120,7 @@ struct ngd_private { struct cdev *ngddev; struct mtx ngd_mtx; int unit; + int ether_align; uint16_t flags; #define NGDF_OPEN 0x0001 #define NGDF_RWAIT 0x0002 @@ -194,6 +218,11 @@ ng_device_constructor(node_p node) /* XXX: race here? */ priv->ngddev->si_drv1 = priv; + /* Give this node the same name as the device (if possible). */ + if (ng_name_node(node, devtoname(priv->ngddev)) != 0) + log(LOG_WARNING, "%s: can't acquire netgraph name\n", + devtoname(priv->ngddev)); + return(0); } @@ -226,6 +255,13 @@ ng_device_rcvmsg(node_p node, item_p item, hook_p lasthook) strlcpy((char *)resp->data, dn, strlen(dn) + 1); break; + case NGM_DEVICE_ETHERALIGN: + /* Use ETHER_ALIGN on arches that require it. */ +#ifndef __NO_STRICT_ALIGNMENT + priv->ether_align = ETHER_ALIGN; +#endif + break; + default: error = EINVAL; break; @@ -468,7 +504,8 @@ ngdwrite(struct cdev *dev, struct uio *uio, int flag) if (uio->uio_resid < 0 || uio->uio_resid > IP_MAXPACKET) return (EIO); - if ((m = m_uiotombuf(uio, M_NOWAIT, 0, 0, M_PKTHDR)) == NULL) + m = m_uiotombuf(uio, M_NOWAIT, 0, priv->ether_align, M_PKTHDR); + if (m == NULL) return (ENOBUFS); NET_EPOCH_ENTER(et); diff --git a/sys/netgraph/ng_device.h b/sys/netgraph/ng_device.h index 00877b7452b3..e8f8bfd62687 100644 --- a/sys/netgraph/ng_device.h +++ b/sys/netgraph/ng_device.h @@ -39,6 +39,7 @@ /* Netgraph control messages */ enum { NGM_DEVICE_GET_DEVNAME, + NGM_DEVICE_ETHERALIGN, }; #if 0 From nobody Sun Nov 14 12:48:40 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E516D1845756; Sun, 14 Nov 2021 12:48:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HsXF45mWjz4jtt; Sun, 14 Nov 2021 12:48:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E41A26AAC; Sun, 14 Nov 2021 12:48:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AECmeEs081951; Sun, 14 Nov 2021 12:48:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AECmefp081950; Sun, 14 Nov 2021 12:48:40 GMT (envelope-from git) Date: Sun, 14 Nov 2021 12:48:40 GMT Message-Id: <202111141248.1AECmefp081950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: c200441872e7 - main - pmic: rockchip: Name the driver rk80{5,8} List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c200441872e7e85e21d5d953bbfac87108edba88 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=c200441872e7e85e21d5d953bbfac87108edba88 commit c200441872e7e85e21d5d953bbfac87108edba88 Author: Emmanuel Vadot AuthorDate: 2021-11-14 12:48:10 +0000 Commit: Emmanuel Vadot CommitDate: 2021-11-14 12:48:10 +0000 pmic: rockchip: Name the driver rk80{5,8} And add the needed relationship with iicbus. --- sys/dev/iicbus/pmic/rockchip/rk805.c | 4 +++- sys/dev/iicbus/pmic/rockchip/rk808.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/iicbus/pmic/rockchip/rk805.c b/sys/dev/iicbus/pmic/rockchip/rk805.c index 9c072293d0f7..97559e2029c6 100644 --- a/sys/dev/iicbus/pmic/rockchip/rk805.c +++ b/sys/dev/iicbus/pmic/rockchip/rk805.c @@ -187,12 +187,14 @@ static device_method_t rk805_methods[] = { DEVMETHOD_END }; -DEFINE_CLASS_1(iichb, rk805_driver, rk805_methods, +DEFINE_CLASS_1(rk805, rk805_driver, rk805_methods, sizeof(struct rk8xx_softc), rk8xx_driver); static devclass_t rk805_devclass; EARLY_DRIVER_MODULE(rk805, iicbus, rk805_driver, rk805_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); +EARLY_DRIVER_MODULE(iicbus, rk805, iicbus_driver, iicbus_devclass, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); MODULE_DEPEND(rk805, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); MODULE_VERSION(rk805, 1); diff --git a/sys/dev/iicbus/pmic/rockchip/rk808.c b/sys/dev/iicbus/pmic/rockchip/rk808.c index d82da20fa672..76aebd33b300 100644 --- a/sys/dev/iicbus/pmic/rockchip/rk808.c +++ b/sys/dev/iicbus/pmic/rockchip/rk808.c @@ -262,12 +262,14 @@ static device_method_t rk808_methods[] = { DEVMETHOD_END }; -DEFINE_CLASS_1(iichb, rk808_driver, rk808_methods, +DEFINE_CLASS_1(rk808, rk808_driver, rk808_methods, sizeof(struct rk8xx_softc), rk8xx_driver); static devclass_t rk808_devclass; EARLY_DRIVER_MODULE(rk808, iicbus, rk808_driver, rk808_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); +EARLY_DRIVER_MODULE(iicbus, rk808, iicbus_driver, iicbus_devclass, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); MODULE_DEPEND(rk808, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); MODULE_VERSION(rk808, 1); From nobody Sun Nov 14 14:04:35 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id D7525184C72A; Sun, 14 Nov 2021 14:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HsYwg5g5cz3MZ3; Sun, 14 Nov 2021 14:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2697277C9; Sun, 14 Nov 2021 14:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AEE4ZPL089142; Sun, 14 Nov 2021 14:04:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AEE4Zr8089141; Sun, 14 Nov 2021 14:04:35 GMT (envelope-from git) Date: Sun, 14 Nov 2021 14:04:35 GMT Message-Id: <202111141404.1AEE4Zr8089141@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 2f62f92e3745 - main - tcp: Fix a locking issue related to logging List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2f62f92e3745095b64433ed9369b70ccf126328b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=2f62f92e3745095b64433ed9369b70ccf126328b commit 2f62f92e3745095b64433ed9369b70ccf126328b Author: Michael Tuexen AuthorDate: 2021-11-14 13:56:43 +0000 Commit: Michael Tuexen CommitDate: 2021-11-14 14:04:27 +0000 tcp: Fix a locking issue related to logging tcp_respond() is sometimes called with only a read lock. The logging however, requires a write lock. So either try to upgrade the lock if needed, or don't log the packet. Reported by: syzbot+8151ef969c170f76706b@syzkaller.appspotmail.com Reported by: syzbot+eb679adb3304c511c1e4@syzkaller.appspotmail.com Reviewed by: markj, rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D32983 --- sys/netinet/tcp_subr.c | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 4805d6c80327..5563148a52ad 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1755,7 +1755,7 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, int isipv6; #endif /* INET6 */ int optlen, tlen, win, ulen; - bool incl_opts; + bool incl_opts, lock_upgraded; uint16_t port; int output_ret; @@ -2088,21 +2088,29 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, TCP_PROBE3(debug__output, tp, th, m); if (flags & TH_RST) TCP_PROBE5(accept__refused, NULL, NULL, m, tp, nth); + lock_upgraded = false; + lgb = NULL; if ((tp != NULL) && (tp->t_logstate != TCP_LOG_STATE_OFF)) { union tcp_log_stackspecific log; struct timeval tv; - memset(&log.u_bbr, 0, sizeof(log.u_bbr)); - log.u_bbr.inhpts = tp->t_inpcb->inp_in_hpts; - log.u_bbr.ininput = tp->t_inpcb->inp_in_input; - log.u_bbr.flex8 = 4; - log.u_bbr.pkts_out = tp->t_maxseg; - log.u_bbr.timeStamp = tcp_get_usecs(&tv); - log.u_bbr.delivered = 0; - lgb = tcp_log_event_(tp, nth, NULL, NULL, TCP_LOG_OUT, ERRNO_UNK, - 0, &log, false, NULL, NULL, 0, &tv); - } else - lgb = NULL; + lock_upgraded = !INP_WLOCKED(inp) && INP_TRY_UPGRADE(inp); + /* + *`If we don't already own the write lock and can't upgrade, + * just don't log the event, but still send the response. + */ + if (INP_WLOCKED(inp)) { + memset(&log.u_bbr, 0, sizeof(log.u_bbr)); + log.u_bbr.inhpts = tp->t_inpcb->inp_in_hpts; + log.u_bbr.ininput = tp->t_inpcb->inp_in_input; + log.u_bbr.flex8 = 4; + log.u_bbr.pkts_out = tp->t_maxseg; + log.u_bbr.timeStamp = tcp_get_usecs(&tv); + log.u_bbr.delivered = 0; + lgb = tcp_log_event_(tp, nth, NULL, NULL, TCP_LOG_OUT, ERRNO_UNK, + 0, &log, false, NULL, NULL, 0, &tv); + } + } #ifdef INET6 if (isipv6) { @@ -2119,10 +2127,10 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, output_ret = ip_output(m, NULL, NULL, 0, NULL, inp); } #endif - if (lgb) { + if (lgb != NULL) lgb->tlb_errno = output_ret; - lgb = NULL; - } + if (lock_upgraded) + INP_DOWNGRADE(inp); } /* From nobody Sun Nov 14 14:41:48 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 006AE185C65E; Sun, 14 Nov 2021 14:41:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HsZlc6cd8z3mhP; Sun, 14 Nov 2021 14:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C37AF27FB3; Sun, 14 Nov 2021 14:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AEEfmHr037906; Sun, 14 Nov 2021 14:41:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AEEfmZ4037905; Sun, 14 Nov 2021 14:41:48 GMT (envelope-from git) Date: Sun, 14 Nov 2021 14:41:48 GMT Message-Id: <202111141441.1AEEfmZ4037905@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 544af629a490 - main - loader: Fix pnpmatch and add some usage List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 544af629a4906be1873983dfa129e65bc5d0c3df Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=544af629a4906be1873983dfa129e65bc5d0c3df commit 544af629a4906be1873983dfa129e65bc5d0c3df Author: Emmanuel Vadot AuthorDate: 2021-11-14 14:11:24 +0000 Commit: Emmanuel Vadot CommitDate: 2021-11-14 14:41:30 +0000 loader: Fix pnpmatch and add some usage pnpmatch needs a busname and a compat data. --- stand/common/module.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/stand/common/module.c b/stand/common/module.c index 8bddd9f56f52..9b001089149d 100644 --- a/stand/common/module.c +++ b/stand/common/module.c @@ -381,14 +381,19 @@ command_pnpmatch(int argc, char *argv[]) return(CMD_OK); } } - argv += (optind - 1); - argc -= (optind - 1); + argv += optind; + argc -= optind; - module = mod_searchmodule_pnpinfo(argv[1], argv[2]); + if (argc != 2) { + command_errmsg = "Usage: pnpmatch compat="; + return (CMD_CRIT); + } + + module = mod_searchmodule_pnpinfo(argv[0], argv[1]); if (module) printf("Matched module: %s\n", module); - else if(argv[1]) - printf("No module matches %s\n", argv[1]); + else + printf("No module matches %s on bus %s\n", argv[1], argv[0]); return (CMD_OK); } From nobody Sun Nov 14 14:41:49 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2D433185C6EB; Sun, 14 Nov 2021 14:41:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HsZlf0PHlz3mhZ; Sun, 14 Nov 2021 14:41:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E0C526B; Sun, 14 Nov 2021 14:41:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AEEfnFO037930; Sun, 14 Nov 2021 14:41:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AEEfn7W037929; Sun, 14 Nov 2021 14:41:49 GMT (envelope-from git) Date: Sun, 14 Nov 2021 14:41:49 GMT Message-Id: <202111141441.1AEEfn7W037929@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: d4874307fd5d - main - loader: Fix pnpload and add some usage List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d4874307fd5dc825e8a80adf7a531ed4bc43f235 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=d4874307fd5dc825e8a80adf7a531ed4bc43f235 commit d4874307fd5dc825e8a80adf7a531ed4bc43f235 Author: Emmanuel Vadot AuthorDate: 2021-11-14 14:22:14 +0000 Commit: Emmanuel Vadot CommitDate: 2021-11-14 14:41:30 +0000 loader: Fix pnpload and add some usage pnpload needs a busname and a compat data. --- stand/common/module.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/stand/common/module.c b/stand/common/module.c index 9b001089149d..e6567c735f36 100644 --- a/stand/common/module.c +++ b/stand/common/module.c @@ -424,13 +424,15 @@ command_pnpload(int argc, char *argv[]) return(CMD_OK); } } - argv += (optind - 1); - argc -= (optind - 1); + argv += optind; + argc -= optind; - if (argc != 2) + if (argc != 2) { + command_errmsg = "Usage: pnpload compat="; return (CMD_ERROR); + } - module = mod_searchmodule_pnpinfo(argv[1], argv[2]); + module = mod_searchmodule_pnpinfo(argv[0], argv[1]); error = mod_load(module, NULL, 0, NULL); if (error == EEXIST) { From nobody Sun Nov 14 14:41:50 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 0D948185CB8D; Sun, 14 Nov 2021 14:41:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HsZlg20nSz3myy; Sun, 14 Nov 2021 14:41:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06968328; Sun, 14 Nov 2021 14:41:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AEEfo1B037954; Sun, 14 Nov 2021 14:41:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AEEfoTO037953; Sun, 14 Nov 2021 14:41:50 GMT (envelope-from git) Date: Sun, 14 Nov 2021 14:41:50 GMT Message-Id: <202111141441.1AEEfoTO037953@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 4c0c353d0e48 - main - loader: Add more bus name to pnpautoload List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4c0c353d0e48d06f82cae16aba02e5923794ba98 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=4c0c353d0e48d06f82cae16aba02e5923794ba98 commit 4c0c353d0e48d06f82cae16aba02e5923794ba98 Author: Emmanuel Vadot AuthorDate: 2021-11-14 14:32:00 +0000 Commit: Emmanuel Vadot CommitDate: 2021-11-14 14:41:30 +0000 loader: Add more bus name to pnpautoload Add ofwbus, iicbus and spibus to pnpautoload so modules under those buses will be loaded. On my rockpro64 now : OK pnpautoload -v Autoloading modules for simplebus Using DTB provided by EFI at 0x8100000. Autoloading modules for ofwbus /boot/kernel/rk_spi.ko text=0x14b2 text=0xd4c data=0x4d0+0x8 syms=[0x8+0xa98+0x8+0x807] /boot/kernel/dwwdt.ko text=0x12e2 text=0x78c data=0x4c8+0x10 syms=[0x8+0x990+0x8+0x6e1] Autoloading modules for iicbus Autoloading modules for spibus /boot/kernel/mx25l.ko text=0x1613 text=0x114c data=0x6e8+0x8 syms=[0x8+0xa08+0x8+0x665] loading required module 'fdt_slicer' /boot/kernel/fdt_slicer.ko text=0x95e text=0x340 data=0x290 syms=[0x8+0x6c0+0x8+0x4a0] --- stand/common/module.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/stand/common/module.c b/stand/common/module.c index e6567c735f36..f28771396af0 100644 --- a/stand/common/module.c +++ b/stand/common/module.c @@ -446,7 +446,7 @@ command_pnpload(int argc, char *argv[]) #if defined(LOADER_FDT_SUPPORT) static void -pnpautoload_simplebus(void) { +pnpautoload_fdt_bus(const char *busname) { const char *pnpstring; const char *compatstr; char *pnpinfo = NULL; @@ -464,7 +464,7 @@ pnpautoload_simplebus(void) { pnplen += strlen(compatstr) + 1; asprintf(&pnpinfo, "compat=%s", compatstr); - module = mod_searchmodule_pnpinfo("simplebus", pnpinfo); + module = mod_searchmodule_pnpinfo(busname, pnpinfo); if (module) { error = mod_loadkld(module, 0, NULL); if (error) @@ -480,12 +480,15 @@ pnpautoload_simplebus(void) { struct pnp_bus { const char *name; - void (*load)(void); + void (*load)(const char *busname); }; struct pnp_bus pnp_buses[] = { #if defined(LOADER_FDT_SUPPORT) - {"simplebus", pnpautoload_simplebus}, + {"simplebus", pnpautoload_fdt_bus}, + {"ofwbus", pnpautoload_fdt_bus}, + {"iicbus", pnpautoload_fdt_bus}, + {"spibus", pnpautoload_fdt_bus}, #endif }; @@ -528,8 +531,8 @@ command_pnpautoload(int argc, char *argv[]) continue; } if (verbose) - printf("Autoloading modules for simplebus\n"); - pnp_buses[i].load(); + printf("Autoloading modules for %s\n", pnp_buses[i].name); + pnp_buses[i].load(pnp_buses[i].name); match = 1; } if (match == 0) From nobody Sun Nov 14 15:03:06 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CEE1118679AE for ; Sun, 14 Nov 2021 15:03:17 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HsbDN5SMcz3vN4 for ; Sun, 14 Nov 2021 15:03:16 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by mail-pl1-x62b.google.com with SMTP id p18so12261069plf.13 for ; Sun, 14 Nov 2021 07:03:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=6O56mZmNSqBQGE1weEwbgPKdA74GXYoQVkuDwulKaA4=; b=j2BrmaJCMnl2wZnDHaIzF8VUtqfEWKE9GE2z+gM9h5hv3y9PfClQu9w+GbXQISeClM CuxeWjB6u1bM/lfzo3FJ3PVhBgubHM9JNOmZgpPB9B0gyOrhmJ99hIKE+wBigqqbuy/i WFhuZGu5TLTL/V6CGVsYQsQ/Evoh9GQf/UvGg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=6O56mZmNSqBQGE1weEwbgPKdA74GXYoQVkuDwulKaA4=; b=UspniFGykCbwJJ9v499J+ZVOxYTbodkFV9o3KPFlo+D+784FGDXSbmwx/Un5F1rZAM Zi+KEtAk9a6vQWrHtwefuw5HlHBxSGUwMXnuwxwSyYy79zirLWkOl1sTlO2ekz9poCU7 ve1C5ynpCmfUFnDed6Ik5aAYHJyl4pSgyxwz595XyIaxy5QyFc/Jn3LqmQkWhFgtf1sQ zuRUn5Zd4bpv+91Ea45lNxX61IuBv4ueDs+6OSU2cnqEmWbl0/8nHHnFuTNsR6o7eMMg 2l0vj2ala3b8ApMfsopqbw6BD4MrRJc0ikCh12+w3JSoM/55KjjiBMsvpKYgmXVmBHY1 LhPw== X-Gm-Message-State: AOAM533CZ3y9DFebLTicvpPd9vJqQkXQ7HVitXwtDcEvZbXrKXKZvO1O 5h4Cxw1FLnlMrRogIeYX6/0how== X-Google-Smtp-Source: ABdhPJwgxdg2L5sycEeihXVf01r/r2Q81z2rJjy0y+e8eXi+C41HQQj5o57GT256tuXR/En1DShDLw== X-Received: by 2002:a17:90a:1b45:: with SMTP id q63mr55443957pjq.135.1636902190185; Sun, 14 Nov 2021 07:03:10 -0800 (PST) Received: from smtpclient.apple (072-239-139-197.res.spectrum.com. [72.239.139.197]) by smtp.gmail.com with ESMTPSA id f2sm13084508pfe.132.2021.11.14.07.03.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Nov 2021 07:03:08 -0800 (PST) Message-Id: <5A60AA15-F560-44D9-89A0-BD0A197E5E58@netflix.com> Content-Type: multipart/signed; boundary="Apple-Mail=_3E97E46A-D01D-461F-9B18-231FA993F6C0"; protocol="application/pkcs7-signature"; micalg=sha-256 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: b8d60729deef - main - tcp: Congestion control cleanup. Date: Sun, 14 Nov 2021 10:03:06 -0500 In-Reply-To: <2a564b11-b1f4-a4fe-745b-27f45fb134eb@FreeBSD.org> Cc: Jessica Clarke , Randall Ray Stewart , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" To: John Baldwin References: <202111111131.1ABBVH6s017371@gitrepo.freebsd.org> <2a564b11-b1f4-a4fe-745b-27f45fb134eb@FreeBSD.org> X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4HsbDN5SMcz3vN4 X-Spamd-Bar: ------------- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=netflix.com header.s=google header.b=j2BrmaJC; dmarc=pass (policy=reject) header.from=netflix.com; spf=pass (mx1.freebsd.org: domain of rrs@netflix.com designates 2607:f8b0:4864:20::62b as permitted sender) smtp.mailfrom=rrs@netflix.com X-Spamd-Result: default: False [-13.59 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; MV_CASE(0.50)[]; HAS_ATTACHMENT(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[netflix.com:+]; DMARC_POLICY_ALLOW(-0.50)[netflix.com,reject]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[72.239.139.197:received]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[netflix.com:s=google]; FREEFALL_USER(0.00)[rrs]; FROM_HAS_DN(0.00)[]; SIGNED_SMIME(-2.00)[]; NEURAL_SPAM_SHORT(1.00)[1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; WHITELIST_DMARC(-7.00)[netflix.com:D:+]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::62b:from]; WHITELIST_SPF_DKIM(-3.00)[netflix.com:d:+,netflix.com:s:+]; HAS_GOOGLE_REDIR(0.01)[]; RCVD_TLS_ALL(0.00)[] Reply-To: rrs@netflix.com From: Randall Stewart via dev-commits-src-all X-Original-From: Randall Stewart X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_3E97E46A-D01D-461F-9B18-231FA993F6C0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 John: This is fine to do, but I want to make sure everyone understands that I was specifically asked to make compile fail on the transport call if CC_XXXX or CC_DEFAULT was not defined. Its not how I had the code originally but it was requested specifically. I am fine with all the changes aka it showing up in DEFAULT that=E2=80=99s= a good solution.=20 And I think Warner=E2=80=99s patch with an ifndef in cc.c works = perfectly that way if you are say netapp and don=E2=80=99t use newreno you can do a nooptions CC_NEWRENO options CC_CUBIC options CC_DEFAULT=3D\=E2=80=9Dcubic\=E2=80=9D And it all just works for you ;) R > On Nov 12, 2021, at 12:01 PM, John Baldwin wrote: >=20 > On 11/12/21 8:19 AM, Jessica Clarke wrote: >> On 11 Nov 2021, at 11:31, Randall Stewart wrote: >>>=20 >>> The branch main has been updated by rrs: >>>=20 >>> URL: = https://www.google.com/url?q=3Dhttps://cgit.FreeBSD.org/src/commit/?id%3Db= 8d60729deefa0bd13e6a395fcab4928e6e10445&source=3Dgmail-imap&ust=3D16373413= 08000000&usg=3DAOvVaw0ox_w6BYoj1_WxabaN9-lG >>>=20 >>> commit b8d60729deefa0bd13e6a395fcab4928e6e10445 >>> Author: Randall Stewart >>> AuthorDate: 2021-11-11 11:28:18 +0000 >>> Commit: Randall Stewart >>> CommitDate: 2021-11-11 11:28:18 +0000 >>>=20 >>> tcp: Congestion control cleanup. >>>=20 >>> NOTE: HEADS UP read the note below if your kernel config is not = including GENERIC!! >>>=20 >>> This patch does a bit of cleanup on TCP congestion control = modules. There were some rather >>> interesting surprises that one could get i.e. where you use a = socket option to change >>> from one CC (say cc_cubic) to another CC (say cc_vegas) and you = could in theory get >>> a memory failure and end up on cc_newreno. This is not what one = would expect. The >>> new code fixes this by requiring a cc_data_sz() function so we = can malloc with M_WAITOK >>> and pass in to the init function preallocated memory. The CC init = is expected in this >>> case *not* to fail but if it does and a module does break the >>> "no fail with memory given" contract we do fall back to the CC = that was in place at the time. >>>=20 >>> This also fixes up a set of common newreno utilities that can be = shared amongst other >>> CC modules instead of the other CC modules reaching into newreno = and executing >>> what they think is a "common and understood" function. Lets put = these functions in >>> cc.c and that way we have a common place that is easily findable = by future developers or >>> bug fixers. This also allows newreno to evolve and grow support = for its features i.e. ABE >>> and HYSTART++ without having to dance through hoops for other CC = modules, instead >>> both newreno and the other modules just call into the common = functions if they desire >>> that behavior or roll there own if that makes more sense. >>>=20 >>> Note: This commit changes the kernel configuration!! If you are = not using GENERIC in >>> some form you must add a CC module option (one of CC_NEWRENO, = CC_VEGAS, CC_CUBIC, >>> CC_CDG, CC_CHD, CC_DCTCP, CC_HTCP, CC_HD). You can have more than = one defined >>> as well if you desire. Note that if you create a kernel = configuration that does not >>> define a congestion control module and includes INET or INET6 the = kernel compile will >>> break. Also you need to define a default, generic adds 'options = CC_DEFAULT=3D\"newreno\" >>> but you can specify any string that represents the name of the CC = module (same names >>> that show up in the CC module list under net.inet.tcp.cc). If you = fail to add the >>> options CC_DEFAULT in your kernel configuration the kernel build = will also break. >> Not doing so breaks tinderbox, as well as configs not hooks up to >> tinderbox. I don=E2=80=99t think this is acceptable. >=20 > We discussed this a bit on IRC, but I think in this case the default = CC_* > options belong in DEFAULTS like the default GEOM_PART_* options rather > than in GENERIC. (Though we mostly avoid changing DEFAULTS, this is = one > of the rare cases when I think it makes sense.) Handling the default = for > CC_DEFAULT does not work in DEFAULTS since you can't later override = it, > but that could be handled by simply having the default for CC_DEFAULT = live > in the code itself under an #ifndef instead. >=20 > I think Warner is already testing a patchset to make this change. >=20 > --=20 > John Baldwin ------ Randall Stewart rrs@netflix.com --Apple-Mail=_3E97E46A-D01D-461F-9B18-231FA993F6C0 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCAzYw ggMyMIICGqADAgECAgqxywKqrHPB2ybTMA0GCSqGSIb3DQEBCwUAMEcxGDAWBgNVBAMTD1JhbmRh bGwgU3Rld2FydDEeMBwGCSqGSIb3DQEJARYPcnJzQG5ldGZsaXguY29tMQswCQYDVQQGEwJVUzAe Fw0yMTAxMjQxMjIwMTRaFw0yNjAxMjQxMjIwMTRaMEcxGDAWBgNVBAMTD1JhbmRhbGwgU3Rld2Fy dDEeMBwGCSqGSIb3DQEJARYPcnJzQG5ldGZsaXguY29tMQswCQYDVQQGEwJVUzCCASIwDQYJKoZI hvcNAQEBBQADggEPADCCAQoCggEBAMUAht2nr/NFlK+tmmN9PdO3DBPfeYh9fLcbVihR+/dipO41 AsFy9y+2uDVaFhTEvp406P0o9PQQTuYXqrCr76eWQIj3V787e1WKjTup1mIyQeWHGf1gvb/7vmI2 zHg6QZEIC4W8xeO8SLKyHiwlFHZn8Rn1HxtB7Ge+NulygkgUgJYhXD5E29jVGXAc6Qn9Vr9AexPf KaOhHCaNB/Twcinayz6D8CO/Ym1LOs3+ceSOa4cB07fepmbqDSXDkOeA3U7KLaluHrRTlj6DO+JU nqKXX7jJ68KTYSZ0qH4fZsk8cxFkwYI/3HDJi+oF+FDkf7SRo1Q2w+e3M/5MReLIQ7sCAwEAAaMg MB4wDwYJKoZIhvcvAQEKBAIFADALBgNVHQ8EBAMCB4AwDQYJKoZIhvcNAQELBQADggEBAHJfum1j 1WIVFjOJT/hqMIN751aXkablmwesW94lNJKjslPULbbcP5nZGg2lGpHcZ+0I5F/1TTiEsT2H2rhA uAnSsUxTpxRA+aoe+xtJOa5vle3CprhFkHAvB7EIoLiNaPd0DNK6kKYsbvr5Z5Eq7TF3SIO77Qh9 /8VgUfOb0ARDgix59Q6MM0NmIabEwh0cDWQYlGgDDtN9DNk5PGM4pjs48suwEdLmFTMOmGTkCp7I Vq6iHDNinBiB6+BB4VYMAO1o9qS+0pnfdmPJybt0zVGrhm/c1Fmm3Jec7NEuiKeXmhPIwdwMkKyp AsX0sHuFCYwioBTHHZpvnir+H2rRakgxggHrMIIB5wIBATBVMEcxGDAWBgNVBAMTD1JhbmRhbGwg U3Rld2FydDEeMBwGCSqGSIb3DQEJARYPcnJzQG5ldGZsaXguY29tMQswCQYDVQQGEwJVUwIKscsC qqxzwdsm0zANBglghkgBZQMEAgEFAKBpMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZI hvcNAQkFMQ8XDTIxMTExNDE1MDMwNlowLwYJKoZIhvcNAQkEMSIEIJlRgPgZmE4Z4oF3GOM8jT1T a48Wr3V3P8qI6+oMIuy2MA0GCSqGSIb3DQEBCwUABIIBAFFMHMOwajPGior49lS47vi3koSb2WMz NTHAFbCuJwKZGNGc/LrbWIKbE+pSq2k1+Fw2OFbglvX+PYmaQAxTvigLHip9aYuo4kLaZDhXplfE 0htFWkaP1yJwa7L+dq1gXpPQour+qoNDX26KtKNZNaxJ/uVxJ5ky1NitXeq2A3ca1Ez68/LhnTd2 cHm6ge+Tunu26hZggJuaWwPobEUxLhb9M3EAwU+EUwIHUcC+jcLYjjo6qeVprBwswFFSzQ/WXvS3 s+0bcu/9+2P0qL/LYDOey4+xqhVX+OlB4jPJf9Jrx6e72BT2usGMCpoToJco/mbTSpy9vnBRfsYm Xr/WyEEAAAAAAAA= --Apple-Mail=_3E97E46A-D01D-461F-9B18-231FA993F6C0-- From nobody Sun Nov 14 15:37:14 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4777F184ACBA; Sun, 14 Nov 2021 15:37:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hsbzb1DR8z4bKD; Sun, 14 Nov 2021 15:37:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B5DDDCD; Sun, 14 Nov 2021 15:37:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AEFbEx1008813; Sun, 14 Nov 2021 15:37:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AEFbEkA008812; Sun, 14 Nov 2021 15:37:14 GMT (envelope-from git) Date: Sun, 14 Nov 2021 15:37:14 GMT Message-Id: <202111141537.1AEFbEkA008812@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: 047c4e365d15 - main - pf: renumber DIOCKEEPCOUNTERS List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 047c4e365d15c4561fdffd9be650ac1245ce422c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=047c4e365d15c4561fdffd9be650ac1245ce422c commit 047c4e365d15c4561fdffd9be650ac1245ce422c Author: Kristof Provost AuthorDate: 2021-11-14 03:57:17 +0000 Commit: Kristof Provost CommitDate: 2021-11-14 14:36:59 +0000 pf: renumber DIOCKEEPCOUNTERS We accidentally had two ioctls use the same base number (DIOCKEEPCOUNTERS and DIOCGIFSPEEDV{0,1}). We get away with that on most platforms because the size of the argument structures is different. This does break CHERI, and is generally a bad idea anyway. Renumber to avoid this collision. Reported by: jhb --- sys/net/pfvar.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index a6994e8b1846..ab22b9c5f3a4 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1747,10 +1747,12 @@ struct pfioc_iface { #define DIOCSETIFFLAG _IOWR('D', 89, struct pfioc_iface) #define DIOCCLRIFFLAG _IOWR('D', 90, struct pfioc_iface) #define DIOCKILLSRCNODES _IOWR('D', 91, struct pfioc_src_node_kill) -#define DIOCKEEPCOUNTERS _IOWR('D', 92, struct pfioc_nv) +#define DIOCGIFSPEEDV0 _IOWR('D', 92, struct pf_ifspeed_v0) +#define DIOCGIFSPEEDV1 _IOWR('D', 92, struct pf_ifspeed_v1) #define DIOCGETSTATESV2 _IOWR('D', 93, struct pfioc_states_v2) #define DIOCGETSYNCOOKIES _IOWR('D', 94, struct pfioc_nv) #define DIOCSETSYNCOOKIES _IOWR('D', 95, struct pfioc_nv) +#define DIOCKEEPCOUNTERS _IOWR('D', 96, struct pfioc_nv) struct pf_ifspeed_v0 { char ifname[IFNAMSIZ]; @@ -1767,9 +1769,6 @@ struct pf_ifspeed_v1 { /* Latest version of struct pf_ifspeed_vX */ #define PF_IFSPEED_VERSION 1 -#define DIOCGIFSPEEDV0 _IOWR('D', 92, struct pf_ifspeed_v0) -#define DIOCGIFSPEEDV1 _IOWR('D', 92, struct pf_ifspeed_v1) - /* * Compatibility and convenience macros */ From nobody Sun Nov 14 16:58:22 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8EBCA185DD16; Sun, 14 Nov 2021 16:58:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HsdnB3dP8z3KLl; Sun, 14 Nov 2021 16:58:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C61C1AE0; Sun, 14 Nov 2021 16:58:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AEGwMlP015051; Sun, 14 Nov 2021 16:58:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AEGwMJR015050; Sun, 14 Nov 2021 16:58:22 GMT (envelope-from git) Date: Sun, 14 Nov 2021 16:58:22 GMT Message-Id: <202111141658.1AEGwMJR015050@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 7e9680d3be48 - main - cache: whack "set but not used" warnings List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7e9680d3be484baac7fe78cef2be4e7ce4b4946f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=7e9680d3be484baac7fe78cef2be4e7ce4b4946f commit 7e9680d3be484baac7fe78cef2be4e7ce4b4946f Author: Mateusz Guzik AuthorDate: 2021-11-14 16:57:11 +0000 Commit: Mateusz Guzik CommitDate: 2021-11-14 16:57:43 +0000 cache: whack "set but not used" warnings --- sys/kern/vfs_cache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 006f16587021..4c76244901bb 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -4782,7 +4782,6 @@ cache_fplookup_emptypath(struct cache_fpl *fpl) struct componentname *cnp; enum vgetstate tvs; struct vnode *tvp; - seqc_t tvp_seqc; int error, lkflags; fpl->tvp = fpl->dvp; @@ -4791,7 +4790,6 @@ cache_fplookup_emptypath(struct cache_fpl *fpl) ndp = fpl->ndp; cnp = fpl->cnp; tvp = fpl->tvp; - tvp_seqc = fpl->tvp_seqc; MPASS(*cnp->cn_pnbuf == '\0'); @@ -5086,11 +5084,13 @@ cache_fplookup_dotdot(struct cache_fpl *fpl) static int __noinline cache_fplookup_neg(struct cache_fpl *fpl, struct namecache *ncp, uint32_t hash) { - u_char nc_flag; + u_char nc_flag __diagused; bool neg_promote; +#ifdef INVARIANTS nc_flag = atomic_load_char(&ncp->nc_flag); MPASS((nc_flag & NCF_NEGATIVE) != 0); +#endif /* * If they want to create an entry we need to replace this one. */ From nobody Sun Nov 14 17:00:09 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 71F12185E067; Sun, 14 Nov 2021 17:00:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HsdqF2rxJz3L8X; Sun, 14 Nov 2021 17:00:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 421631AE3; Sun, 14 Nov 2021 17:00:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AEH09t6019213; Sun, 14 Nov 2021 17:00:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AEH09Nb019210; Sun, 14 Nov 2021 17:00:09 GMT (envelope-from git) Date: Sun, 14 Nov 2021 17:00:09 GMT Message-Id: <202111141700.1AEH09Nb019210@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: e9c7ec22877f - main - aio: whack "set but not used" warnings List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e9c7ec22877f461f530dfe1cb8e17086300c0ee8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=e9c7ec22877f461f530dfe1cb8e17086300c0ee8 commit e9c7ec22877f461f530dfe1cb8e17086300c0ee8 Author: Mateusz Guzik AuthorDate: 2021-11-14 16:59:53 +0000 Commit: Mateusz Guzik CommitDate: 2021-11-14 16:59:53 +0000 aio: whack "set but not used" warnings --- sys/kern/vfs_aio.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index d06b18140e71..5f469f56f677 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -764,7 +764,6 @@ aio_process_rw(struct kaiocb *job) { struct ucred *td_savedcred; struct thread *td; - struct aiocb *cb; struct file *fp; ssize_t cnt; long msgsnd_st, msgsnd_end; @@ -784,7 +783,6 @@ aio_process_rw(struct kaiocb *job) td_savedcred = td->td_ucred; td->td_ucred = job->cred; job->uiop->uio_td = td; - cb = &job->uaiocb; fp = job->fd_file; opcode = job->uaiocb.aio_lio_opcode; @@ -2478,7 +2476,7 @@ aio_biowakeup(struct bio *bp) size_t nbytes; long bcount = bp->bio_bcount; long resid = bp->bio_resid; - int error, opcode, nblks; + int opcode, nblks; int bio_error = bp->bio_error; uint16_t flags = bp->bio_flags; @@ -2489,7 +2487,6 @@ aio_biowakeup(struct bio *bp) nbytes =bcount - resid; atomic_add_acq_long(&job->nbytes, nbytes); nblks = btodb(nbytes); - error = 0; /* * If multiple bios experienced an error, the job will reflect the * error of whichever failed bio completed last. From nobody Sun Nov 14 17:16:08 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DFA6918651F1; Sun, 14 Nov 2021 17:16:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hsf9h61X8z3Q67; Sun, 14 Nov 2021 17:16:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA0701FC7; Sun, 14 Nov 2021 17:16:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AEHG8Zj042340; Sun, 14 Nov 2021 17:16:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AEHG8KC042339; Sun, 14 Nov 2021 17:16:08 GMT (envelope-from git) Date: Sun, 14 Nov 2021 17:16:08 GMT Message-Id: <202111141716.1AEHG8KC042339@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 5a4e46f6ec47 - main - net: whack "set but not used" warnings in net/if.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5a4e46f6ec470593be5a3d2d41591e714759e1c0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=5a4e46f6ec470593be5a3d2d41591e714759e1c0 commit 5a4e46f6ec470593be5a3d2d41591e714759e1c0 Author: Mateusz Guzik AuthorDate: 2021-11-14 17:15:08 +0000 Commit: Mateusz Guzik CommitDate: 2021-11-14 17:15:08 +0000 net: whack "set but not used" warnings in net/if.c Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/if.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 83a0b07805ee..c7a6706f41df 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -746,7 +746,7 @@ if_free(struct ifnet *ifp) void if_ref(struct ifnet *ifp) { - u_int old; + u_int old __diagused; /* We don't assert the ifnet list lock here, but arguably should. */ old = refcount_acquire(&ifp->if_refcount); @@ -1847,7 +1847,7 @@ fail: void ifa_ref(struct ifaddr *ifa) { - u_int old; + u_int old __diagused; old = refcount_acquire(&ifa->ifa_refcnt); KASSERT(old > 0, ("%s: ifa %p has 0 refs", __func__, ifa)); From nobody Sun Nov 14 17:21:34 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E53761867765; Sun, 14 Nov 2021 17:21:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HsfHy6D5Jz3hX5; Sun, 14 Nov 2021 17:21:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B573421CD; Sun, 14 Nov 2021 17:21:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AEHLYvT053001; Sun, 14 Nov 2021 17:21:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AEHLYRR053000; Sun, 14 Nov 2021 17:21:34 GMT (envelope-from git) Date: Sun, 14 Nov 2021 17:21:34 GMT Message-Id: <202111141721.1AEHLYRR053000@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: c681cce925dd - main - net: whack "set but not used" warnings in net/pfil.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c681cce925dd193359f9d25f782e313f1e296ca8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=c681cce925dd193359f9d25f782e313f1e296ca8 commit c681cce925dd193359f9d25f782e313f1e296ca8 Author: Mateusz Guzik AuthorDate: 2021-11-14 17:19:58 +0000 Commit: Mateusz Guzik CommitDate: 2021-11-14 17:19:58 +0000 net: whack "set but not used" warnings in net/pfil.c Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/pfil.c b/sys/net/pfil.c index 4968bb8cc4de..85a0f031006b 100644 --- a/sys/net/pfil.c +++ b/sys/net/pfil.c @@ -479,7 +479,7 @@ static void pfil_init(const void *unused __unused) { struct make_dev_args args; - int error; + int error __diagused; make_dev_args_init(&args); args.mda_flags = MAKEDEV_WAITOK | MAKEDEV_CHECKNAME; From nobody Sun Nov 14 17:21:35 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1FB1818678C7; Sun, 14 Nov 2021 17:21:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HsfJ007WVz3hYx; Sun, 14 Nov 2021 17:21:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8F7B2488; Sun, 14 Nov 2021 17:21:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AEHLZhv053025; Sun, 14 Nov 2021 17:21:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AEHLZW9053024; Sun, 14 Nov 2021 17:21:35 GMT (envelope-from git) Date: Sun, 14 Nov 2021 17:21:35 GMT Message-Id: <202111141721.1AEHLZW9053024@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 79554f2b6ca6 - main - net: whack "set but not used" warnings in net/rtsock.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 79554f2b6ca635f95cda63cbe18613d89675cb1f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=79554f2b6ca635f95cda63cbe18613d89675cb1f commit 79554f2b6ca635f95cda63cbe18613d89675cb1f Author: Mateusz Guzik AuthorDate: 2021-11-14 17:20:46 +0000 Commit: Mateusz Guzik CommitDate: 2021-11-14 17:20:46 +0000 net: whack "set but not used" warnings in net/rtsock.c ... except for one where the error is ignored. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/rtsock.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 9c91672e0247..6495a4102570 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -632,7 +632,6 @@ fill_addrinfo(struct rt_msghdr *rtm, int len, struct linear_buffer *lb, u_int fi struct rt_addrinfo *info) { int error; - sa_family_t saf; rtm->rtm_pid = curproc->p_pid; info->rti_addrs = rtm->rtm_addrs; @@ -652,7 +651,6 @@ fill_addrinfo(struct rt_msghdr *rtm, int len, struct linear_buffer *lb, u_int fi error = cleanup_xaddrs(info, lb); if (error != 0) return (error); - saf = info->rti_info[RTAX_DST]->sa_family; /* * Verify that the caller has the appropriate privilege; RTM_GET * is the only operation the non-superuser is allowed. @@ -1025,7 +1023,6 @@ static int route_output(struct mbuf *m, struct socket *so, ...) { struct rt_msghdr *rtm = NULL; - struct rtentry *rt = NULL; struct rt_addrinfo info; struct epoch_tracker et; #ifdef INET6 @@ -1187,7 +1184,6 @@ route_output(struct mbuf *m, struct socket *so, ...) flush: NET_EPOCH_EXIT(et); - rt = NULL; #ifdef INET6 if (rtm != NULL) { From nobody Sun Nov 14 19:26:50 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 771591857623; Sun, 14 Nov 2021 19:26:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hsj4V2xq3z4ryr; Sun, 14 Nov 2021 19:26:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 426C23E5F; Sun, 14 Nov 2021 19:26:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AEJQoEx015141; Sun, 14 Nov 2021 19:26:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AEJQoWK015140; Sun, 14 Nov 2021 19:26:50 GMT (envelope-from git) Date: Sun, 14 Nov 2021 19:26:50 GMT Message-Id: <202111141926.1AEJQoWK015140@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 91a908e051bb - main - pmic: rockchip: Rename the driver with _pmu as it was before List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 91a908e051bb44a41d045e7452b7736d340f341e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=91a908e051bb44a41d045e7452b7736d340f341e commit 91a908e051bb44a41d045e7452b7736d340f341e Author: Emmanuel Vadot AuthorDate: 2021-11-14 19:20:13 +0000 Commit: Emmanuel Vadot CommitDate: 2021-11-14 19:26:33 +0000 pmic: rockchip: Rename the driver with _pmu as it was before --- sys/dev/iicbus/pmic/rockchip/rk805.c | 10 +++++----- sys/dev/iicbus/pmic/rockchip/rk808.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/dev/iicbus/pmic/rockchip/rk805.c b/sys/dev/iicbus/pmic/rockchip/rk805.c index 97559e2029c6..e8752a3a7bef 100644 --- a/sys/dev/iicbus/pmic/rockchip/rk805.c +++ b/sys/dev/iicbus/pmic/rockchip/rk805.c @@ -187,14 +187,14 @@ static device_method_t rk805_methods[] = { DEVMETHOD_END }; -DEFINE_CLASS_1(rk805, rk805_driver, rk805_methods, +DEFINE_CLASS_1(rk805_pmu, rk805_driver, rk805_methods, sizeof(struct rk8xx_softc), rk8xx_driver); static devclass_t rk805_devclass; -EARLY_DRIVER_MODULE(rk805, iicbus, rk805_driver, rk805_devclass, 0, 0, +EARLY_DRIVER_MODULE(rk805_pmu, iicbus, rk805_driver, rk805_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); -EARLY_DRIVER_MODULE(iicbus, rk805, iicbus_driver, iicbus_devclass, 0, 0, +EARLY_DRIVER_MODULE(iicbus, rk805_pmu, iicbus_driver, iicbus_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); -MODULE_DEPEND(rk805, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); -MODULE_VERSION(rk805, 1); +MODULE_DEPEND(rk805_pmu, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); +MODULE_VERSION(rk805_pmu, 1); diff --git a/sys/dev/iicbus/pmic/rockchip/rk808.c b/sys/dev/iicbus/pmic/rockchip/rk808.c index 76aebd33b300..34d1884db088 100644 --- a/sys/dev/iicbus/pmic/rockchip/rk808.c +++ b/sys/dev/iicbus/pmic/rockchip/rk808.c @@ -262,14 +262,14 @@ static device_method_t rk808_methods[] = { DEVMETHOD_END }; -DEFINE_CLASS_1(rk808, rk808_driver, rk808_methods, +DEFINE_CLASS_1(rk808_pmu, rk808_driver, rk808_methods, sizeof(struct rk8xx_softc), rk8xx_driver); static devclass_t rk808_devclass; -EARLY_DRIVER_MODULE(rk808, iicbus, rk808_driver, rk808_devclass, 0, 0, +EARLY_DRIVER_MODULE(rk808_pmu, iicbus, rk808_driver, rk808_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); -EARLY_DRIVER_MODULE(iicbus, rk808, iicbus_driver, iicbus_devclass, 0, 0, +EARLY_DRIVER_MODULE(iicbus, rk808_pmu, iicbus_driver, iicbus_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); -MODULE_DEPEND(rk808, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); -MODULE_VERSION(rk808, 1); +MODULE_DEPEND(rk808_pmu, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); +MODULE_VERSION(rk808_pmu, 1); From nobody Sun Nov 14 19:26:51 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9E4F11857598; Sun, 14 Nov 2021 19:26:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hsj4W3b71z4s43; Sun, 14 Nov 2021 19:26:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56B353E87; Sun, 14 Nov 2021 19:26:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AEJQpxG015166; Sun, 14 Nov 2021 19:26:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AEJQpYa015165; Sun, 14 Nov 2021 19:26:51 GMT (envelope-from git) Date: Sun, 14 Nov 2021 19:26:51 GMT Message-Id: <202111141926.1AEJQpYa015165@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 090cbc39a5a1 - main - modules: rockchip: Fix rk805 modules after recent changes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 090cbc39a5a16ba168dfdcd728e36503aad52e56 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=090cbc39a5a16ba168dfdcd728e36503aad52e56 commit 090cbc39a5a16ba168dfdcd728e36503aad52e56 Author: Emmanuel Vadot AuthorDate: 2021-11-14 19:23:35 +0000 Commit: Emmanuel Vadot CommitDate: 2021-11-14 19:26:33 +0000 modules: rockchip: Fix rk805 modules after recent changes We need more files now. --- sys/modules/rockchip/rk805/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/modules/rockchip/rk805/Makefile b/sys/modules/rockchip/rk805/Makefile index 386e41c05bad..d1acab423113 100644 --- a/sys/modules/rockchip/rk805/Makefile +++ b/sys/modules/rockchip/rk805/Makefile @@ -3,7 +3,11 @@ .PATH: ${SRCTOP}/sys/dev/iicbus/pmic/rockchip KMOD= rk805 -SRCS= rk805.c +SRCS= rk8xx.c \ + rk805.c \ + rk8xx_clocks.c \ + rk8xx_rtc.c \ + rk8xx_regulators.c SRCS+= \ bus_if.h \ From nobody Sun Nov 14 19:26:52 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E6DF31857627; Sun, 14 Nov 2021 19:26:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hsj4X4lDNz4rn4; Sun, 14 Nov 2021 19:26:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75F1B404E; Sun, 14 Nov 2021 19:26:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AEJQqGM015190; Sun, 14 Nov 2021 19:26:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AEJQqrd015189; Sun, 14 Nov 2021 19:26:52 GMT (envelope-from git) Date: Sun, 14 Nov 2021 19:26:52 GMT Message-Id: <202111141926.1AEJQqrd015189@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 6b96bb739548 - main - modules: rockchip: Add a module for rk808 PMIC List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6b96bb739548a8b8c2b13bd46234f70a29be12fb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=6b96bb739548a8b8c2b13bd46234f70a29be12fb commit 6b96bb739548a8b8c2b13bd46234f70a29be12fb Author: Emmanuel Vadot AuthorDate: 2021-11-14 19:25:44 +0000 Commit: Emmanuel Vadot CommitDate: 2021-11-14 19:26:33 +0000 modules: rockchip: Add a module for rk808 PMIC Now that the drivers are split we need one for RK3399-based board. --- sys/modules/rockchip/Makefile | 1 + sys/modules/rockchip/rk808/Makefile | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/sys/modules/rockchip/Makefile b/sys/modules/rockchip/Makefile index a07bff00ecf0..fbacb32c1fc6 100644 --- a/sys/modules/rockchip/Makefile +++ b/sys/modules/rockchip/Makefile @@ -4,6 +4,7 @@ SUBDIR = \ rk_i2c \ rk805 \ + rk808 \ rk_dwmmc \ rk_spi diff --git a/sys/modules/rockchip/rk808/Makefile b/sys/modules/rockchip/rk808/Makefile new file mode 100644 index 000000000000..690be056c7c2 --- /dev/null +++ b/sys/modules/rockchip/rk808/Makefile @@ -0,0 +1,21 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/iicbus/pmic/rockchip + +KMOD= rk808 +SRCS= rk8xx.c \ + rk808.c \ + rk8xx_clocks.c \ + rk8xx_rtc.c \ + rk8xx_regulators.c + +SRCS+= \ + bus_if.h \ + device_if.h \ + iicbus_if.h \ + regnode_if.h \ + regdev_if.h \ + ofw_bus_if.h \ + opt_platform.h \ + +.include From nobody Sun Nov 14 20:13:35 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A61701849E93; Sun, 14 Nov 2021 20:13:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hsk6R4Dchz3QmL; Sun, 14 Nov 2021 20:13:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70E4949B9; Sun, 14 Nov 2021 20:13:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AEKDZgV081820; Sun, 14 Nov 2021 20:13:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AEKDZvB081819; Sun, 14 Nov 2021 20:13:35 GMT (envelope-from git) Date: Sun, 14 Nov 2021 20:13:35 GMT Message-Id: <202111142013.1AEKDZvB081819@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: 2f35e7d9fa03 - main - kernel: partially revert e9efb1125a15, default inet mask List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2f35e7d9fa03f27543f347cd6277af5bfc6a7e95 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=2f35e7d9fa03f27543f347cd6277af5bfc6a7e95 commit 2f35e7d9fa03f27543f347cd6277af5bfc6a7e95 Author: Mike Karels AuthorDate: 2021-11-10 21:35:33 +0000 Commit: Mike Karels CommitDate: 2021-11-14 20:12:25 +0000 kernel: partially revert e9efb1125a15, default inet mask When no mask is supplied to the ioctl adding an Internet interface address, revert to using the historical class mask rather than a single default. Similarly for the NFS bootp code. MFC after: 3 weeks Reviewed by: melifaro glebius Differential Revision: https://reviews.freebsd.org/D32951 --- sys/netinet/in.c | 17 +++++++++++++---- sys/nfs/bootp_subr.c | 13 ++++++++++--- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/sys/netinet/in.c b/sys/netinet/in.c index fccad3d9ede2..70fbe32c05ac 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -35,6 +35,8 @@ #include __FBSDID("$FreeBSD$"); +#define IN_HISTORICAL_NETS /* include class masks */ + #include #include #include @@ -467,17 +469,24 @@ in_aifaddr_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, struct thread *td) ia->ia_sockmask = *mask; ia->ia_subnetmask = ntohl(ia->ia_sockmask.sin_addr.s_addr); } else { + in_addr_t i = ntohl(addr->sin_addr.s_addr); + /* - * If netmask isn't supplied, use default for now. + * If netmask isn't supplied, use historical default. * This is deprecated for interfaces other than loopback * or point-to-point; warn in other cases. In the future * we should return an error rather than warning. */ if ((ifp->if_flags & (IFF_POINTOPOINT | IFF_LOOPBACK)) == 0) - printf("%s: set address: WARNING: network mask" - " should be specified; using default mask\n", + printf("%s: set address: WARNING: network mask " + "should be specified; using historical default\n", ifp->if_xname); - ia->ia_subnetmask = IN_NETMASK_DEFAULT; + if (IN_CLASSA(i)) + ia->ia_subnetmask = IN_CLASSA_NET; + else if (IN_CLASSB(i)) + ia->ia_subnetmask = IN_CLASSB_NET; + else + ia->ia_subnetmask = IN_CLASSC_NET; ia->ia_sockmask.sin_addr.s_addr = htonl(ia->ia_subnetmask); } ia->ia_subnet = ntohl(addr->sin_addr.s_addr) & ia->ia_subnetmask; diff --git a/sys/nfs/bootp_subr.c b/sys/nfs/bootp_subr.c index a6dfbe0334f8..eedda7baa377 100644 --- a/sys/nfs/bootp_subr.c +++ b/sys/nfs/bootp_subr.c @@ -42,6 +42,8 @@ * $NetBSD: krpc_subr.c,v 1.10 1995/08/08 20:43:43 gwr Exp $ */ +#define IN_HISTORICAL_NETS /* include class masks */ + #include __FBSDID("$FreeBSD$"); @@ -1486,11 +1488,16 @@ bootpc_decode_reply(struct nfsv3_diskless *nd, struct bootpc_ifcontext *ifctx, if (ifctx->gotnetmask == 0) { /* - * If there is no netmask, use a default, but we really - * need the right mask from the server. + * If there is no netmask, use historical default, + * but we really need the right mask from the server. */ printf("%s: no netmask received!\n", ifctx->ireq.ifr_name); - ifctx->netmask.sin_addr.s_addr = htonl(IN_NETMASK_DEFAULT); + if (IN_CLASSA(ntohl(ifctx->myaddr.sin_addr.s_addr))) + ifctx->netmask.sin_addr.s_addr = htonl(IN_CLASSA_NET); + else if (IN_CLASSB(ntohl(ifctx->myaddr.sin_addr.s_addr))) + ifctx->netmask.sin_addr.s_addr = htonl(IN_CLASSB_NET); + else + ifctx->netmask.sin_addr.s_addr = htonl(IN_CLASSC_NET); } } From nobody Sun Nov 14 20:17:46 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 20E82184D8C6; Sun, 14 Nov 2021 20:17:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HskCH0LC6z3jY9; Sun, 14 Nov 2021 20:17:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DBEE84BB8; Sun, 14 Nov 2021 20:17:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AEKHkPH082348; Sun, 14 Nov 2021 20:17:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AEKHkTx082347; Sun, 14 Nov 2021 20:17:46 GMT (envelope-from git) Date: Sun, 14 Nov 2021 20:17:46 GMT Message-Id: <202111142017.1AEKHkTx082347@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: e469b16d0b91 - main - ipsec: fix edge case detection in key_getnewspid List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e469b16d0b91c0c37427a19d574c112c9eaba6e5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=e469b16d0b91c0c37427a19d574c112c9eaba6e5 commit e469b16d0b91c0c37427a19d574c112c9eaba6e5 Author: Mateusz Guzik AuthorDate: 2021-11-03 18:50:41 +0000 Commit: Mateusz Guzik CommitDate: 2021-11-14 20:17:34 +0000 ipsec: fix edge case detection in key_getnewspid Same comparison problem as in key_do_getnewspi. Reviewed by: ae Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32827 --- sys/netipsec/key.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index 9a810fa49931..e2e1d76911ec 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -2147,10 +2147,12 @@ key_getnewspid(void) { struct secpolicy *sp; uint32_t newid = 0; - int count = V_key_spi_trycnt; /* XXX */ + int tries, limit; SPTREE_WLOCK_ASSERT(); - while (count--) { + + limit = atomic_load_int(&V_key_spi_trycnt); + for (tries = 0; tries < limit; tries++) { if (V_policy_id == ~0) /* overflowed */ newid = V_policy_id = 1; else @@ -2162,7 +2164,7 @@ key_getnewspid(void) if (sp == NULL) break; } - if (count == 0 || newid == 0) { + if (tries == limit || newid == 0) { ipseclog((LOG_DEBUG, "%s: failed to allocate policy id.\n", __func__)); return (0); From nobody Sun Nov 14 20:17:47 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4A060184D8C7; Sun, 14 Nov 2021 20:17:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HskCJ19Jqz3jS3; Sun, 14 Nov 2021 20:17:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00BB94C8B; Sun, 14 Nov 2021 20:17:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AEKHlnU082372; Sun, 14 Nov 2021 20:17:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AEKHl8Z082371; Sun, 14 Nov 2021 20:17:47 GMT (envelope-from git) Date: Sun, 14 Nov 2021 20:17:47 GMT Message-Id: <202111142017.1AEKHl8Z082371@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 84c048822ed9 - main - ipsec: make sure the lock allocated in key_newsav does not false-share List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 84c048822ed9c897f92b1f052c6b89f1ed9f18f1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=84c048822ed9c897f92b1f052c6b89f1ed9f18f1 commit 84c048822ed9c897f92b1f052c6b89f1ed9f18f1 Author: Mateusz Guzik AuthorDate: 2021-11-03 20:11:59 +0000 Commit: Mateusz Guzik CommitDate: 2021-11-14 20:17:35 +0000 ipsec: make sure the lock allocated in key_newsav does not false-share Reviewed by: ae Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32828 --- sys/netipsec/key.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index e2e1d76911ec..cd2f8a4ccafa 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -2961,8 +2961,8 @@ key_newsav(const struct sadb_msghdr *mhp, struct secasindex *saidx, *errp = ENOBUFS; goto done; } - sav->lock = malloc(sizeof(struct mtx), M_IPSEC_MISC, - M_NOWAIT | M_ZERO); + sav->lock = malloc_aligned(max(sizeof(struct mtx), CACHE_LINE_SIZE), + CACHE_LINE_SIZE, M_IPSEC_MISC, M_NOWAIT | M_ZERO); if (sav->lock == NULL) { *errp = ENOBUFS; goto done; From nobody Sun Nov 14 21:39:26 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A493C185AE68; Sun, 14 Nov 2021 21:39:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hsm1V4C3Pz4lxx; Sun, 14 Nov 2021 21:39:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BFB95B66; Sun, 14 Nov 2021 21:39:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AELdQZj088745; Sun, 14 Nov 2021 21:39:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AELdQOg088744; Sun, 14 Nov 2021 21:39:26 GMT (envelope-from git) Date: Sun, 14 Nov 2021 21:39:26 GMT Message-Id: <202111142139.1AELdQOg088744@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: 75c666197cc7 - main - nfsstat: Add output for counts of new RPCs to the "-E" option List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 75c666197cc7574f6f0d48344f8725f72072fc84 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=75c666197cc7574f6f0d48344f8725f72072fc84 commit 75c666197cc7574f6f0d48344f8725f72072fc84 Author: Rick Macklem AuthorDate: 2021-11-14 21:36:14 +0000 Commit: Rick Macklem CommitDate: 2021-11-14 21:36:14 +0000 nfsstat: Add output for counts of new RPCs to the "-E" option Add output to the "-E" option for new RPCs related to NFSv4.1/4.2. Also, add output of the counts for allocated layouts and the title for the "Client" section (which was lost during a previous commit). MFC after: 2 weeks --- usr.bin/nfsstat/nfsstat.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/usr.bin/nfsstat/nfsstat.c b/usr.bin/nfsstat/nfsstat.c index e2d747634bcc..da075d57c52e 100644 --- a/usr.bin/nfsstat/nfsstat.c +++ b/usr.bin/nfsstat/nfsstat.c @@ -749,10 +749,14 @@ exp_intpr(int clientOnly, int serverOnly, int nfs41) (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_WRITEDS], (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_COMMITDS]); - xo_emit("{T:OpenLayout/%13.13s}{T:CreateLayout/%13.13s}\n"); - xo_emit("{:openlayout/%13ju}{:createlayout/%13ju}\n", + xo_emit("{T:OpenLayout/%13.13s}{T:CreateLayout/%13.13s}" + "{T:BindConnSess/%13.13s}{T:LookupOpen/%13.13s}\n"); + xo_emit("{:openlayout/%13ju}{:createlayout/%13ju}" + "{:bindconnsess/%13ju}{:lookupopen/%13ju}\n", (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_OPENLAYGET], - (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_CREATELAYGET]); + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_CREATELAYGET], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_BINDCONNTOSESS], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_LOOKUPOPEN]); xo_close_container("nfsv41"); @@ -772,17 +776,23 @@ exp_intpr(int clientOnly, int serverOnly, int nfs41) (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_GETEXTATTR]); xo_emit("{T:SetExtattr/%13.13s}{T:RmExtattr/%13.13s}" - "{T:ListExtattr/%13.13s}\n"); + "{T:ListExtattr/%13.13s}{T:Deallocate/%13.13s}" + "{T:LayoutError/%13.13s}\n"); xo_emit("{:setextattr/%13ju}{:rmextattr/%13ju}" - "{:listextattr/%13ju}\n", + "{:listextattr/%13ju}{:deallocate/%13ju}" + "{:layouterror/%13ju}\n", (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_SETEXTATTR], (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_RMEXTATTR], - (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_LISTEXTATTR]); + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_LISTEXTATTR], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_DEALLOCATE], + (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_LAYOUTERROR]); xo_close_container("nfsv42"); } xo_close_container("operations"); + if (printtitle) + xo_emit("{T:Client:}\n"); xo_open_container("client"); xo_emit("{T:OpenOwner/%13.13s}{T:Opens/%13.13s}" "{T:LockOwner/%13.13s}{T:Locks/%13.13s}" @@ -798,12 +808,13 @@ exp_intpr(int clientOnly, int serverOnly, int nfs41) (uintmax_t)ext_nfsstats.cllocalopenowners); xo_emit("{T:LocalOpen/%13.13s}{T:LocalLown/%13.13s}" - "{T:LocalLock/%13.13s}\n"); + "{T:LocalLock/%13.13s}{T:Layouts/%13.13s}\n"); xo_emit("{:localopen/%13ju}{:locallown/%13ju}" - "{:locallock/%13ju}\n", + "{:locallock/%13ju}{:layouts/%13ju}\n", (uintmax_t)ext_nfsstats.cllocalopens, (uintmax_t)ext_nfsstats.cllocallockowners, - (uintmax_t)ext_nfsstats.cllocallocks); + (uintmax_t)ext_nfsstats.cllocallocks, + (uintmax_t)ext_nfsstats.cllayouts); xo_close_container("client"); xo_open_container("rpc"); @@ -1061,6 +1072,9 @@ exp_intpr(int clientOnly, int serverOnly, int nfs41) (uintmax_t)ext_nfsstats.srvlockowners, (uintmax_t)ext_nfsstats.srvlocks, (uintmax_t)ext_nfsstats.srvdelegates); + xo_emit("{T:Layouts/%13.13s}\n"); + xo_emit("{:layouts/%13ju}\n", + (uintmax_t)ext_nfsstats.srvlayouts); xo_close_container("server"); if (printtitle)