From nobody Sun Apr 30 05:09:16 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8Dsk51TVz48lyG; Sun, 30 Apr 2023 05:09:30 +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 4Q8Dsj6Mjqz3F82; Sun, 30 Apr 2023 05:09:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.17.1/8.17.1) with ESMTPS id 33U59Gs0053410 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 30 Apr 2023 08:09:19 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 33U59Gs0053410 Received: (from kostik@localhost) by tom.home (8.17.1/8.17.1/Submit) id 33U59GSK053409; Sun, 30 Apr 2023 08:09:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 30 Apr 2023 08:09:16 +0300 From: Konstantin Belousov To: "Jason A. Harmening" Cc: Dimitry Andric , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Subject: Re: git: 060699e91369 - stable/13 - Merge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6 Message-ID: References: <202304092135.339LZMeJ081640@gitrepo.freebsd.org> <76DD2CB9-986B-4349-8F46-3B7BF63EB315@FreeBSD.org> List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Rspamd-Queue-Id: 4Q8Dsj6Mjqz3F82 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Sat, Apr 29, 2023 at 02:27:50PM -0500, Jason A. Harmening wrote: > On Sat, Apr 29, 2023 at 08:49:28PM +0200, Dimitry Andric wrote: > > On 29 Apr 2023, at 20:33, Jason A. Harmening wrote: > > > > > > On Sun, Apr 09, 2023 at 09:35:22PM +0000, Dimitry Andric wrote: > > >> The branch stable/13 has been updated by dim: > > >> > > >> URL: https://cgit.FreeBSD.org/src/commit/?id=060699e9136975d51d3f726b9785bdbac9a62ba6 > > >> > > >> commit 060699e9136975d51d3f726b9785bdbac9a62ba6 > > >> Author: Dimitry Andric > > >> AuthorDate: 2023-01-14 16:33:24 +0000 > > >> Commit: Dimitry Andric > > >> CommitDate: 2023-04-09 14:54:52 +0000 > > >> > > >> Merge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6 > > >> > > >> This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and > > >> openmp to llvmorg-15.0.7-0-g8dfdcc7b7bf6. > > >> > > >> PR: 265425 > > >> MFC after: 2 weeks > > > > > > This MFC of llvm15 appears to have completely broken the Intel IOMMU > > > driver on my stable/13 machine. After this series of commits, any > > > downstream DMA seems to produce an IOMMU translation fault, which > > > renders the machine completely unusable: no nvme boot disk, no usb > > > keyboard, etc. > > > > > > The faults I see look something like this: > > > > > > DMAR4: ahci0: pci0:17:5 sid 8d fault acc 0 adt 0x0 reason 0x3 addr 26000 > > > > > > It's a bit surprising to see a toolchain upgrade produce breakage like > > > this, but that's what git bisect clearly tells me. I wonder if some of > > > the IOMMU control structures might be defined as C bitfields and the new > > > compiler is emitting them differently? Also, was any breakage like this > > > observed when -current was upgraded to llvm15 several months ago? > > > > I haven't heard anything about such breakage, no. > > > > > > > More generally, this is the second time in as many months I've had to > > > deal with IOMMU breakage on -stable. I can't imagine I'm the only > > > person who sees value in running with DMA remapping enabled; do we need > > > a dedicated DMAR-enabled machine in the cluster to smoke-test changes > > > like this? More generally, should we avoid MFCing high-risk changes > > > like this? > > > > Since there were very few bug reports, it was not deemed high risk. > > > > In any case, it would be good to get the bottom of what is causing the > > problem, so is there any way you can isolate which code seems to be > > going "bad"? > > > > For example, if this problem affects code in sys/dev/iommu, is there > > some way you can compile that part with -O1, or with an older version > > of clang (from ports), to see if the problem goes away? > > I did try removing all custom make.conf settings (previously I just had > CPUTYPE?=icelake-server), but that didn't change the behavior. > > Before I try further build tweaks, I'd like to ask if the IOMMU fault > report can provide guidance here? AFAICT all the faults I'm getting > show "reason 0x3". If I'm reading the VT-d spec correctly, FR=0x3 > indicates an invalid context entry, in other words there's something the > hardware doesn't like in the way the address width or pagetable base is > configured for the PCIe requestor. I would start looking at the other direction: might be, there are still some left shifts for int32 values with the shift count > 30, or uint32 with the count > 31. Also might be useful to dump each context entry on creation, it is kept constant after. From nobody Sun Apr 30 06:57:40 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HGY38Zfz48s8w; Sun, 30 Apr 2023 06:57: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 4Q8HGY1B4Zz3MBj; Sun, 30 Apr 2023 06:57:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837861; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s/R7bSmBG47ymeyhlJCcEmhSFyXsBH3cXPcbX4U/XEg=; b=siuf2S9VS9TEJwEogkDHJiLi6iV0m7tuVUJvmX/ExiDYh7ehm1Bdv8TwnPUVUGPZ5Wwjs0 vtdz2h1PR2LnC4hw8XZEyFA6sYo4U9yAGvFpHDkTeqG9fAQ3bu5PjJAkvrFZUWKHNekaOm oattUe1EQH6KwVwb7gcv/Ku3MPrK7UrRTivb/kpB+wS917hyxrMoDc8u2ozpI8fj9ADXM6 o2yDhvOwrIz6b0FqmoOlQrODEnK4Yma43U6bt2cZ2pX7kl4CLZ3ZTwto3hnheO/H0p61VU Og4pRK8U0ITGwIiySiNwQkgjci7pPsbuvH6R7A07SXIYgzikAQ7puLvhLGjqmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837861; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s/R7bSmBG47ymeyhlJCcEmhSFyXsBH3cXPcbX4U/XEg=; b=CKm0OKmB2kHYChHoNEvEQN785hl4M1K+VImUF+rkOgd2BoW1hXiwMLtL6VUXbrWg5MrmP+ YCCuRIFEs/hyEQyYUXNUb+AnQ4p3ENazMWi4SCpuDhASLfyI/BeS2K4bxHB40eMiCjR0wb nW+EwOVV6DCTsgJHZ6YVKomAugjg6VyVzDgkc+LxXNDhKG8bdt8iWvT6+18fX5RfSLlJR3 6Khvpu5wPtGfVR8lSz5J2kEz3LXqNl1GrZMD8EHN2k3IsIwL2tJ12k8rhZL0kpl5Fe2ZOZ j/ADJSO+csBqn7nM4W9uViP6AOmhx83E0Re1agBtaybMAIs/yUyojcTeuAmxMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837861; a=rsa-sha256; cv=none; b=hvWqQaHp97s9hNg1ej3V10be7+saL/RQ7K312rbOrCk/EN+f8WOcyhyF+QMRmYYqDie6JM J6LyqLEULkuNNzOCVg6tCO0QGmjcUyMq+f7FaMC10LunG5G/3LZZHfgiyVHPXayOK1Jilh BtwSOtIEe/sJG4qRfJ+SW01N96He8Mg68HJRSd8SS8RfGn5rrwKL4TONKchycOJ4FDIRvz mxDKRkdAoxyOFnl5JJCFk34wRNVgPlr/5+5gvik0T12pksPIqNyRCvQPQOOJoBNNHPllIv yjgykDEW+ZxTTgmyhXsANjUq11cOf0J/1IqNLDY4pgsS2bFqRZkK5kqKXc7DDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HGY0FrPz1Cg9; Sun, 30 Apr 2023 06:57: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 33U6ve7c071289; Sun, 30 Apr 2023 06:57:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6veuo071288; Sun, 30 Apr 2023 06:57:40 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:57:40 GMT Message-Id: <202304300657.33U6veuo071288@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 8ff5099a7932 - stable/13 - libusb(3): Implement libusb_init_context() and the needed structures and definitions. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 8ff5099a793207af0d6080b01df40392c3c5b51f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=8ff5099a793207af0d6080b01df40392c3c5b51f commit 8ff5099a793207af0d6080b01df40392c3c5b51f Author: Hans Petter Selasky AuthorDate: 2023-01-26 12:56:51 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:15 +0000 libusb(3): Implement libusb_init_context() and the needed structures and definitions. Differential Revision: https://reviews.freebsd.org/D38212 Sponsored by: NVIDIA Networking (cherry picked from commit 4c6bcffd04f9d0b6cb57af0ffcc9be3098fe950c) --- lib/libusb/Makefile | 1 + lib/libusb/libusb.3 | 27 +++++++++++++++++++++------ lib/libusb/libusb.h | 16 ++++++++++++++++ lib/libusb/libusb10.c | 34 +++++++++++++++++++++++++++++++--- 4 files changed, 69 insertions(+), 9 deletions(-) diff --git a/lib/libusb/Makefile b/lib/libusb/Makefile index 3982fda478fb..1648664b8815 100644 --- a/lib/libusb/Makefile +++ b/lib/libusb/Makefile @@ -66,6 +66,7 @@ CFLAGS+= -I ../../sys # LibUSB v1.0 MLINKS += libusb.3 libusb_get_version.3 MLINKS += libusb.3 libusb_init.3 +MLINKS += libusb.3 libusb_init_context.3 MLINKS += libusb.3 libusb_exit.3 MLINKS += libusb.3 libusb_has_capability.3 MLINKS += libusb.3 libusb_strerror.3 diff --git a/lib/libusb/libusb.3 b/lib/libusb/libusb.3 index d4c638d986e4..fe56639fa59f 100644 --- a/lib/libusb/libusb.3 +++ b/lib/libusb/libusb.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October, 2, 2022 +.Dd January, 26, 2023 .Dt LIBUSB 3 .Os .Sh NAME @@ -47,11 +47,26 @@ This function returns version information about LibUSB. .Pp .Ft int .Fn libusb_init "libusb_context **ctx" -This function initialises libusb. -It must be called at the beginning -of the program, before other libusb routines are used. -This function returns 0 on success or LIBUSB_ERROR on -failure. +Call this function before any other libusb v1.0 API function, to +initialise a valid libusb v1.0 context. +If the +.Fa ctx +argument is non-NULL, a pointer to the libusb context is stored at +the given location. +This function returns 0 upon success or LIBUSB_ERROR on failure. +.Pp +.Ft int +.Fn libusb_init_context "libusb_context **ctx" "const struct libusb_init_option []" "int num_options" +Call this function before any other libusb v1.0 API function, to +initialise a valid libusb v1.0 context. +If the +.Fa ctx +argument is non-NULL, a pointer to the libusb context is stored at +the given location. +Additional options, like the USB debug level, may be given using the +second and third argument. +If no options are needed, simply use libusb_init(). +This function returns 0 upon success or a LIBUSB_ERROR value on failure. .Pp .Ft void .Fn libusb_exit "libusb_context *ctx" diff --git a/lib/libusb/libusb.h b/lib/libusb/libusb.h index 9eaee671b8b3..28fbece4955a 100644 --- a/lib/libusb/libusb.h +++ b/lib/libusb/libusb.h @@ -266,6 +266,14 @@ typedef enum { LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT = 2, } libusb_hotplug_event; +enum libusb_option { + LIBUSB_OPTION_LOG_LEVEL = 0, + LIBUSB_OPTION_USE_USBDK = 1, + LIBUSB_OPTION_NO_DEVICE_DISCOVERY = 2, + LIBUSB_OPTION_WEAK_AUTHORITY = 2, + LIBUSB_OPTION_MAX = 3, +}; + /* libusb structures */ struct libusb_context; @@ -288,6 +296,13 @@ struct libusb_version { const char *describe; }; +struct libusb_init_option { + enum libusb_option option; + union { + int64_t ival; + } value; +}; + typedef struct libusb_context libusb_context; typedef struct libusb_device libusb_device; typedef struct libusb_device_handle libusb_device_handle; @@ -465,6 +480,7 @@ const struct libusb_version *libusb_get_version(void); const char *libusb_strerror(int code); const char *libusb_error_name(int code); int libusb_init(libusb_context ** context); +int libusb_init_context(libusb_context **, const struct libusb_init_option [], int num_options); void libusb_exit(struct libusb_context *ctx); int libusb_has_capability(uint32_t capability); diff --git a/lib/libusb/libusb10.c b/lib/libusb/libusb10.c index 1fc89fc409f0..793152a30910 100644 --- a/lib/libusb/libusb10.c +++ b/lib/libusb/libusb10.c @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2009 Sylvestre Gallon. All rights reserved. - * Copyright (c) 2009 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2009-2023 Hans Petter Selasky * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -135,12 +135,22 @@ libusb_interrupt_event_handler(libusb_context *ctx) int libusb_init(libusb_context **context) +{ + return (libusb_init_context(context, NULL, 0)); +} + +int +libusb_init_context(libusb_context **context, + const struct libusb_init_option option[], int num_options) { struct libusb_context *ctx; pthread_condattr_t attr; char *debug, *ep; int ret; + if (num_options < 0) + return (LIBUSB_ERROR_INVALID_PARAM); + ctx = malloc(sizeof(*ctx)); if (!ctx) return (LIBUSB_ERROR_INVALID_PARAM); @@ -150,8 +160,9 @@ libusb_init(libusb_context **context) debug = getenv("LIBUSB_DEBUG"); if (debug != NULL) { /* - * If LIBUSB_DEBUG is set, we'll honor that and use it to - * override libusb_set_debug calls. + * If LIBUSB_DEBUG is set, we'll honor that first and + * use it to override any future libusb_set_debug() + * calls or init options. */ errno = 0; ctx->debug = strtol(debug, &ep, 10); @@ -166,7 +177,24 @@ libusb_init(libusb_context **context) */ ctx->debug = 0; } + } else { + /* + * If the LIBUSB_OPTION_LOG_LEVEL is set, honor that. + */ + for (int i = 0; i != num_options; i++) { + if (option[i].option != LIBUSB_OPTION_LOG_LEVEL) + continue; + + ctx->debug = (int)option[i].value.ival; + if ((int64_t)ctx->debug == option[i].value.ival) { + ctx->debug_fixed = 1; + } else { + free(ctx); + return (LIBUSB_ERROR_INVALID_PARAM); + } + } } + TAILQ_INIT(&ctx->pollfds); TAILQ_INIT(&ctx->tr_done); TAILQ_INIT(&ctx->hotplug_cbh); From nobody Sun Apr 30 06:57:42 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HGZ3B5Jz48rw4; Sun, 30 Apr 2023 06:57:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q8HGZ25mTz3MQP; Sun, 30 Apr 2023 06:57:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837862; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VbqDZijzkBcHDyKLQkBpKuQstytuxuBSFngl/YDohKs=; b=WVgpn0nVhZoen0OtBnuU+KqmvL688VmMIsV4/qCaHn45aj0PVBoSWFJMK7b8Iq/eKbNrsS c/+4m5RjQuSd752d5wZUhTA/N4Ow4sBrrFwM0F9sK+pLdQ70shm7106whel5um85u9vYcT UT2GRIiivR8XzLQjwgioS825wdZ8snDncOHNd7Mw/ZEj9zadx8umy0W33Bne+uQ6OCaDGy UcncBqQoqQ6ckyP5b/q1JLwZr3MDaToEBpeVBzewG8TvJwlVpYSSbZnuiKTh5KQCWN4KlE Tm2FzvlPPqekq3jYy9Ad15zwBOB5BJ5dndO5s1eNGXO/sJgwtarnIes5Fg7QYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837862; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VbqDZijzkBcHDyKLQkBpKuQstytuxuBSFngl/YDohKs=; b=oLDTeXXDFYu7nn/aXDNSRP4tth788CXeZbN/gms+GYBbVeEBW1nGH8Hgm0BOw19OXRethm ntmwk3DoMQhIpsWsYdUylm6ojLOiOG4zSZlhLLiuJYTu+3ckXB1++w+YOYOmHUR88ZogRR vme9JS846wLqyoWhy8bFjPhO8obJVD9CVQE+/bO6H0Akv+r013a3FvcKdgzXVsL9fSH33s Jw8kq/fmHVf5pEXYM98Ys+TyGtVzNzjG/+Lxmr18yXNUjow4/kkmetc9wgBe2dbhpvxTWx JP2BrX9vloRFCIgXOf1+E+NQB1TKo81Xhf/jehMezoVNz1kFp7KKQ3Yd9vWRXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837862; a=rsa-sha256; cv=none; b=SYrYmeHDT0gyg0FKIsQw4mo36tUpcAW58zoK9gpfogh8X/aPkMwv6eZVw9Gx7fv79Bv7PX w9BOMMt2IKxCXuhCTp/SihPk4Fe/pfxdurIChJ5WyCkgMJrGLp+xTAh+ZjuR1QThd92bfK wueZrsS4+EKL8ILXA6O5Wer7x+UEThuhHkwACyBE1LRmtagOzzQWHFqJnRew9nMQ2DoyP4 wDMrEvrN7gZog71pv6ciC69xVWxZAE09opV1XyArfjLgnLQuHnc/LK3WF3f29Yz4VBojqI F8WUuKAg++6a3Yp5TRUKqa5Y9cNkazFHDurp+JPVYmcss9gCE0zFSmMc0Nr+OQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HGZ19BPz1Crc; Sun, 30 Apr 2023 06:57:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33U6vgwv071317; Sun, 30 Apr 2023 06:57:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6vgRH071316; Sun, 30 Apr 2023 06:57:42 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:57:42 GMT Message-Id: <202304300657.33U6vgRH071316@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 82acd06d9ce5 - stable/13 - usb: add 32-bit compat for FIFOs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 82acd06d9ce5e4133927b178d3b00d7f2c47f102 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=82acd06d9ce5e4133927b178d3b00d7f2c47f102 commit 82acd06d9ce5e4133927b178d3b00d7f2c47f102 Author: Brooks Davis AuthorDate: 2021-12-17 21:28:14 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:15 +0000 usb: add 32-bit compat for FIFOs Unlike most 32-bit compatability code, this isn't just a simple thunk in the ioctl code. An ioctl (USB_FS_INIT) is used to install a pointer to an array of usb_fs_endpoint structs which are then used by the ugen fifo code. These struct contains an array of pointers which requires translation. We change the interfaces around struct usb_fs_endpoint as follows: - We store the size of struct usb_fs_endpoint in struct usb_fifo in the USB_FS_INIT handler so we know the ABI of the userspace array. - APIs to manipulate userspace struct usb_fs_endpoint objects now take a struct usb_fifo and an index rather than a pointer to the object. This allows most code to remain oblivious to the different struct usb_fs_endpoint sizes. - Add ugen_fs_copyin() which copies the struct usb_fs_endpoint from userspace, thunking it to the native size if required. - Uses of struct usb_fs_endpoint's ppBuffer member are now via ugen_fs_getbuffer() which produces a native pointer. - Updates to userspace are now handled by ugen_fs_update(). For clarity, single, fixed-sized members now are accessed with fueword/suword rather than copyin/copyout. Reviewed by: hselasky, jrtc27 (prior version) (cherry picked from commit 0ec590d24e415dd36e38648630a0b963412ad87e) (cherry picked from commit 8b60419b798ae9049988c529e6af3f313a5cce55) --- sys/dev/usb/usb_dev.h | 1 + sys/dev/usb/usb_generic.c | 235 +++++++++++++++++++++++++++++++++------------- sys/dev/usb/usb_ioctl.h | 18 ++++ 3 files changed, 188 insertions(+), 66 deletions(-) diff --git a/sys/dev/usb/usb_dev.h b/sys/dev/usb/usb_dev.h index ae851153efb1..1bdfa46d064f 100644 --- a/sys/dev/usb/usb_dev.h +++ b/sys/dev/usb/usb_dev.h @@ -123,6 +123,7 @@ struct usb_fifo { void *priv_sc0; /* client data */ void *priv_sc1; /* client data */ void *queue_data; + usb_size_t fs_ep_sz; usb_timeout_t timeout; /* timeout in milliseconds */ usb_frlength_t bufsize; /* BULK and INTERRUPT buffer size */ usb_frcount_t nframes; /* for isochronous mode */ diff --git a/sys/dev/usb/usb_generic.c b/sys/dev/usb/usb_generic.c index b11168b6c81c..fdbc35d47169 100644 --- a/sys/dev/usb/usb_generic.c +++ b/sys/dev/usb/usb_generic.c @@ -119,6 +119,7 @@ static int ugen_re_enumerate(struct usb_fifo *); static int ugen_iface_ioctl(struct usb_fifo *, u_long, void *, int); static uint8_t ugen_fs_get_complete(struct usb_fifo *, uint8_t *); static int ugen_fs_uninit(struct usb_fifo *f); +static int ugen_fs_copyin(struct usb_fifo *, uint8_t, struct usb_fs_endpoint*); /* structures */ @@ -1018,6 +1019,38 @@ ugen_fs_set_complete(struct usb_fifo *f, uint8_t index) usb_fifo_wakeup(f); } +static int +ugen_fs_getbuffer(void **uptrp, struct usb_fifo *f, void *buffer, + usb_frcount_t n) +{ + union { + void **ppBuffer; +#ifdef COMPAT_FREEBSD32 + uint32_t *ppBuffer32; +#endif + } u; +#ifdef COMPAT_FREEBSD32 + uint32_t uptr32; +#endif + + u.ppBuffer = buffer; + switch (f->fs_ep_sz) { + case sizeof(struct usb_fs_endpoint): + if (fueword(u.ppBuffer + n, (long *)uptrp) != 0) + return (EFAULT); + return (0); +#ifdef COMPAT_FREEBSD32 + case sizeof(struct usb_fs_endpoint32): + if (fueword32(u.ppBuffer32 + n, &uptr32) != 0) + return (EFAULT); + *uptrp = PTRIN(uptr32); + return (0); +#endif + default: + panic("%s: unhandled fs_ep_sz %#x", __func__, f->fs_ep_sz); + } +} + static int ugen_fs_copy_in(struct usb_fifo *f, uint8_t ep_index) { @@ -1047,8 +1080,7 @@ ugen_fs_copy_in(struct usb_fifo *f, uint8_t ep_index) } mtx_unlock(f->priv_mtx); - error = copyin(f->fs_ep_ptr + - ep_index, &fs_ep, sizeof(fs_ep)); + error = ugen_fs_copyin(f, ep_index, &fs_ep); if (error) { return (error); } @@ -1062,8 +1094,7 @@ ugen_fs_copy_in(struct usb_fifo *f, uint8_t ep_index) xfer->error = USB_ERR_INVAL; goto complete; } - error = copyin(fs_ep.ppBuffer, - &uaddr, sizeof(uaddr)); + error = ugen_fs_getbuffer(&uaddr, f, fs_ep.ppBuffer, 0); if (error) { return (error); } @@ -1073,10 +1104,8 @@ ugen_fs_copy_in(struct usb_fifo *f, uint8_t ep_index) if (xfer->flags_int.control_xfr) { req = xfer->frbuffers[0].buffer; - error = copyin(fs_ep.pLength, - &length, sizeof(length)); - if (error) { - return (error); + if (fueword32(fs_ep.pLength, &length) != 0) { + return (EFAULT); } if (length != sizeof(*req)) { xfer->error = USB_ERR_INVAL; @@ -1142,9 +1171,7 @@ ugen_fs_copy_in(struct usb_fifo *f, uint8_t ep_index) xfer->flags.stall_pipe = 0; for (; n != xfer->nframes; n++) { - error = copyin(fs_ep.pLength + n, - &length, sizeof(length)); - if (error) { + if (fueword32(fs_ep.pLength + n, &length) != 0) { break; } usbd_xfer_set_frame_len(xfer, n, length); @@ -1157,8 +1184,7 @@ ugen_fs_copy_in(struct usb_fifo *f, uint8_t ep_index) if (!isread) { /* we need to know the source buffer */ - error = copyin(fs_ep.ppBuffer + n, - &uaddr, sizeof(uaddr)); + error = ugen_fs_getbuffer(&uaddr, f, fs_ep.ppBuffer, n); if (error) { break; } @@ -1191,13 +1217,109 @@ complete: return (0); } +static struct usb_fs_endpoint * +ugen_fs_ep_uptr(struct usb_fifo *f, uint8_t ep_index) +{ + return ((struct usb_fs_endpoint *) + ((char *)f->fs_ep_ptr + (ep_index * f->fs_ep_sz))); +} + +static int +ugen_fs_copyin(struct usb_fifo *f, uint8_t ep_index, + struct usb_fs_endpoint* fs_ep) +{ +#ifdef COMPAT_FREEBSD32 + struct usb_fs_endpoint32 fs_ep32; +#endif + int error; + + switch (f->fs_ep_sz) { + case sizeof(struct usb_fs_endpoint): + error = copyin(ugen_fs_ep_uptr(f, ep_index), fs_ep, + f->fs_ep_sz); + if (error != 0) + return (error); + break; + +#ifdef COMPAT_FREEBSD32 + case sizeof(struct usb_fs_endpoint32): + error = copyin(ugen_fs_ep_uptr(f, ep_index), &fs_ep32, + f->fs_ep_sz); + if (error != 0) + return (error); + PTRIN_CP(fs_ep32, *fs_ep, ppBuffer); + PTRIN_CP(fs_ep32, *fs_ep, pLength); + CP(fs_ep32, *fs_ep, nFrames); + CP(fs_ep32, *fs_ep, aFrames); + CP(fs_ep32, *fs_ep, flags); + CP(fs_ep32, *fs_ep, timeout); + CP(fs_ep32, *fs_ep, isoc_time_complete); + CP(fs_ep32, *fs_ep, status); + break; +#endif + default: + panic("%s: unhandled fs_ep_sz %#x", __func__, f->fs_ep_sz); + } + + return (0); +} + static int -ugen_fs_copy_out_cancelled(struct usb_fs_endpoint *fs_ep_uptr) +ugen_fs_update(const struct usb_fs_endpoint *fs_ep, + struct usb_fifo *f, uint8_t ep_index) +{ + union { + struct usb_fs_endpoint *fs_ep_uptr; +#ifdef COMPAT_FREEBSD32 + struct usb_fs_endpoint32 *fs_ep_uptr32; +#endif + } u; + uint32_t *aFrames_uptr; + uint16_t *isoc_time_complete_uptr; + int *status_uptr; + + switch (f->fs_ep_sz) { + case sizeof(struct usb_fs_endpoint): + u.fs_ep_uptr = ugen_fs_ep_uptr(f, ep_index); + aFrames_uptr = &u.fs_ep_uptr->aFrames; + isoc_time_complete_uptr = &u.fs_ep_uptr->isoc_time_complete; + status_uptr = &u.fs_ep_uptr->status; + break; +#ifdef COMPAT_FREEBSD32 + case sizeof(struct usb_fs_endpoint32): + u.fs_ep_uptr32 = (struct usb_fs_endpoint32 *) + ugen_fs_ep_uptr(f, ep_index); + aFrames_uptr = &u.fs_ep_uptr32->aFrames; + isoc_time_complete_uptr = &u.fs_ep_uptr32->isoc_time_complete; + status_uptr = &u.fs_ep_uptr32->status; + break; +#endif + default: + panic("%s: unhandled fs_ep_sz %#x", __func__, f->fs_ep_sz); + } + + /* update "aFrames" */ + if (suword32(aFrames_uptr, fs_ep->aFrames) != 0) + return (EFAULT); + + /* update "isoc_time_complete" */ + if (suword16(isoc_time_complete_uptr, fs_ep->isoc_time_complete) != 0) + return (EFAULT); + + /* update "status" */ + if (suword32(status_uptr, fs_ep->status) != 0) + return (EFAULT); + + return (0); +} + +static int +ugen_fs_copy_out_cancelled(struct usb_fifo *f, uint8_t ep_index) { struct usb_fs_endpoint fs_ep; int error; - error = copyin(fs_ep_uptr, &fs_ep, sizeof(fs_ep)); + error = ugen_fs_copyin(f, ep_index, &fs_ep); if (error) return (error); @@ -1205,24 +1327,7 @@ ugen_fs_copy_out_cancelled(struct usb_fs_endpoint *fs_ep_uptr) fs_ep.aFrames = 0; fs_ep.isoc_time_complete = 0; - /* update "aFrames" */ - error = copyout(&fs_ep.aFrames, &fs_ep_uptr->aFrames, - sizeof(fs_ep.aFrames)); - if (error) - goto done; - - /* update "isoc_time_complete" */ - error = copyout(&fs_ep.isoc_time_complete, - &fs_ep_uptr->isoc_time_complete, - sizeof(fs_ep.isoc_time_complete)); - if (error) - goto done; - - /* update "status" */ - error = copyout(&fs_ep.status, &fs_ep_uptr->status, - sizeof(fs_ep.status)); -done: - return (error); + return (ugen_fs_update(&fs_ep, f, ep_index)); } static int @@ -1231,7 +1336,6 @@ ugen_fs_copy_out(struct usb_fifo *f, uint8_t ep_index) struct usb_device_request *req; struct usb_xfer *xfer; struct usb_fs_endpoint fs_ep; - struct usb_fs_endpoint *fs_ep_uptr; /* userland ptr */ void *uaddr; /* userland ptr */ void *kaddr; usb_frlength_t offset; @@ -1254,18 +1358,18 @@ ugen_fs_copy_out(struct usb_fifo *f, uint8_t ep_index) !xfer->flags_int.started) { mtx_unlock(f->priv_mtx); DPRINTF("Returning fake cancel event\n"); - return (ugen_fs_copy_out_cancelled(f->fs_ep_ptr + ep_index)); + return (ugen_fs_copy_out_cancelled(f, ep_index)); } else if (usbd_transfer_pending(xfer)) { mtx_unlock(f->priv_mtx); return (EBUSY); /* should not happen */ } mtx_unlock(f->priv_mtx); - fs_ep_uptr = f->fs_ep_ptr + ep_index; - error = copyin(fs_ep_uptr, &fs_ep, sizeof(fs_ep)); + error = ugen_fs_copyin(f, ep_index, &fs_ep); if (error) { return (error); } + fs_ep.status = xfer->error; fs_ep.aFrames = xfer->aframes; fs_ep.isoc_time_complete = xfer->isoc_time_complete; @@ -1302,10 +1406,8 @@ ugen_fs_copy_out(struct usb_fifo *f, uint8_t ep_index) for (; n != xfer->nframes; n++) { /* get initial length into "temp" */ - error = copyin(fs_ep.pLength + n, - &temp, sizeof(temp)); - if (error) { - return (error); + if (fueword32(fs_ep.pLength + n, &temp) != 0) { + return (EFAULT); } if (temp > rem) { /* the userland length has been corrupted */ @@ -1327,8 +1429,7 @@ ugen_fs_copy_out(struct usb_fifo *f, uint8_t ep_index) } if (isread) { /* we need to know the destination buffer */ - error = copyin(fs_ep.ppBuffer + n, - &uaddr, sizeof(uaddr)); + error = ugen_fs_getbuffer(&uaddr, f, fs_ep.ppBuffer, n); if (error) { return (error); } @@ -1344,7 +1445,7 @@ ugen_fs_copy_out(struct usb_fifo *f, uint8_t ep_index) /* move data */ error = copyout(kaddr, uaddr, length); if (error) { - return (error); + goto complete; } } /* @@ -1354,31 +1455,13 @@ ugen_fs_copy_out(struct usb_fifo *f, uint8_t ep_index) offset += temp; /* update length */ - error = copyout(&length, - fs_ep.pLength + n, sizeof(length)); - if (error) { - return (error); - } + if (suword32(fs_ep.pLength + n, length) != 0) + goto complete; } complete: - /* update "aFrames" */ - error = copyout(&fs_ep.aFrames, &fs_ep_uptr->aFrames, - sizeof(fs_ep.aFrames)); - if (error) - goto done; - - /* update "isoc_time_complete" */ - error = copyout(&fs_ep.isoc_time_complete, - &fs_ep_uptr->isoc_time_complete, - sizeof(fs_ep.isoc_time_complete)); - if (error) - goto done; - - /* update "status" */ - error = copyout(&fs_ep.status, &fs_ep_uptr->status, - sizeof(fs_ep.status)); -done: + if (error == 0) + error = ugen_fs_update(&fs_ep, f, ep_index); return (error); } @@ -2078,6 +2161,9 @@ ugen_iface_ioctl(struct usb_fifo *f, u_long cmd, void *addr, int fflags) static int ugen_ioctl_post(struct usb_fifo *f, u_long cmd, void *addr, int fflags) { +#ifdef COMPAT_FREEBSD32 + struct usb_fs_init local_pinit; +#endif union { struct usb_interface_descriptor *idesc; struct usb_alt_interface *ai; @@ -2085,6 +2171,9 @@ ugen_ioctl_post(struct usb_fifo *f, u_long cmd, void *addr, int fflags) struct usb_config_descriptor *cdesc; struct usb_device_stats *stat; struct usb_fs_init *pinit; +#ifdef COMPAT_FREEBSD32 + struct usb_fs_init32 *pinit32; +#endif struct usb_fs_uninit *puninit; struct usb_device_port_path *dpp; uint32_t *ptime; @@ -2094,6 +2183,7 @@ ugen_ioctl_post(struct usb_fifo *f, u_long cmd, void *addr, int fflags) struct usb_device_descriptor *dtemp; struct usb_config_descriptor *ctemp; struct usb_interface *iface; + size_t usb_fs_endpoint_sz = sizeof(struct usb_fs_endpoint); int error = 0; uint8_t n; @@ -2101,6 +2191,18 @@ ugen_ioctl_post(struct usb_fifo *f, u_long cmd, void *addr, int fflags) DPRINTFN(6, "cmd=0x%08lx\n", cmd); +#ifdef COMPAT_FREEBSD32 + switch (cmd) { + case USB_FS_INIT32: + PTRIN_CP(*u.pinit32, local_pinit, pEndpoints); + CP(*u.pinit32, local_pinit, ep_index_max); + u.addr = &local_pinit; + cmd = _IOC_NEWTYPE(USB_FS_INIT, struct usb_fs_init); + usb_fs_endpoint_sz = sizeof(struct usb_fs_endpoint32); + break; + } +#endif + switch (cmd) { case USB_DISCOVER: usb_needs_explore_all(); @@ -2328,6 +2430,7 @@ ugen_ioctl_post(struct usb_fifo *f, u_long cmd, void *addr, int fflags) u.pinit->ep_index_max, M_USB, M_WAITOK | M_ZERO); f->fs_ep_max = u.pinit->ep_index_max; f->fs_ep_ptr = u.pinit->pEndpoints; + f->fs_ep_sz = usb_fs_endpoint_sz; break; case USB_FS_UNINIT: diff --git a/sys/dev/usb/usb_ioctl.h b/sys/dev/usb/usb_ioctl.h index 9d35588f1138..5a139d0653c5 100644 --- a/sys/dev/usb/usb_ioctl.h +++ b/sys/dev/usb/usb_ioctl.h @@ -400,6 +400,24 @@ void usb_gen_descriptor_from32(struct usb_gen_descriptor *ugd, void update_usb_gen_descriptor32(struct usb_gen_descriptor32 *ugd32, struct usb_gen_descriptor *ugd); +struct usb_fs_endpoint32 { + uint32_t ppBuffer; /* void ** */ + uint32_t pLength; /* uint32_t * */ + uint32_t nFrames; + uint32_t aFrames; + uint16_t flags; + uint16_t timeout; + uint16_t isoc_time_complete; + int status; +}; + +struct usb_fs_init32 { + uint32_t pEndpoints; /* struct usb_fs_endpoint32 * */ + uint8_t ep_index_max; +}; + +#define USB_FS_INIT32 _IOC_NEWTYPE(USB_FS_INIT, struct usb_fs_init32) + #endif /* COMPAT_FREEBSD32 */ #endif /* _KERNEL */ From nobody Sun Apr 30 06:57:43 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HGb3ZSXz48rhc; Sun, 30 Apr 2023 06:57:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q8HGb33Rsz3MQt; Sun, 30 Apr 2023 06:57:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YPI1bD7Tx5v8ZPVqt7D13ffCb9mOaWAP3pJNWSFv9j4=; b=kICmOwLi1a/gIvCHt9w9OKoVx13j4oxocZEJiE3AJKcovLJv9xMW/SQ0jkvsQIe0oZN3G/ nNSyYP4RpE2GB1Z+fLwpRZsD+dzmRE+weKOsiCYyz8KfwUQxGqr83du478wxHBjHQfdLLv OIBH3R//EuPtz0wEk73qzc54AONx3r0GSBeYkrDfbWSt3u3gDdCk0GobQQKq+wRdc0s/mr EDVtHiicptADLNeL3SZUs9p3858wbIxXHYH01d0LbrbXbE6oQK8VlZhlfoK/cxqZ1qKFDO fIgYy0XIGte8JCuehAOJLSKvNtBRQ0RZtgWpJEdYoPsvSqOHRBayvLg/dReehA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YPI1bD7Tx5v8ZPVqt7D13ffCb9mOaWAP3pJNWSFv9j4=; b=in1dilip+eTxJfIBH2Go2vYZHBQPO7L3n6SvBWYwpgDVdq2FxPAOwVlsHcP2zNlfm5sQom csNgnqOh5LHwFV9lDB2fDLNH603YsFFfK57TE9idQY0HMWsYs9UBQnLu+Ux6RMtO6thGHd siVtj6DovD1gVkxO5m3O+BGim8lUuq+bYYO5WHNX+qghCm/eiVDphtoabi9fzBw5w+kFW8 RwcJ/C4uJwP1zBcr+iCoAla17ZtCncd+/fVsICHiBR7ZCfFb/tKOReIwWQrvLZuANUUk1o 6Yu25r1SE8klVI7iSpGx+y+wx27hFvZWVTzkvF4PXyy+voeh/KB+awis9R6kmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837863; a=rsa-sha256; cv=none; b=nLUc9qg4Bgz22Q0MxqEjmJPBEaaAg1KEl7BgcF5VwFeXsDwLuu6r0fC81B2hiUzovMfsSr C9UXG2rDWXw3e4abxwFcCK6LcLpKFaB97bxqKTcgcrVzs8oy6z+8hX65oiNH/80NLwDgoL 4wJTlUhkNood48flWN0c3GdB9WRTxcwtVJ5yxxz42fJxaOXEn3PHUggnwMc1UNBYFVb4UD nH9LZDQx4iY8jTc6AeEho9rLf823LZJuVZLrrYABXlqB2v/npIUwWz6PcBWQSsLaaHK5S6 5wfhV5WqhTx4qpAQQ80hbAMLQX/uiRtxNQpQhbRSz8QtVuKx3lPucib+x/jTsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HGb1sGKz1Ccb; Sun, 30 Apr 2023 06:57:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33U6vh6O071343; Sun, 30 Apr 2023 06:57:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6vh2k071342; Sun, 30 Apr 2023 06:57:43 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:57:43 GMT Message-Id: <202304300657.33U6vh2k071342@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 60603f6a5302 - stable/13 - usb: remove COMPAT_32BIT ifdefs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 60603f6a530250b4e71ac658cfddf5d9e0a418b0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=60603f6a530250b4e71ac658cfddf5d9e0a418b0 commit 60603f6a530250b4e71ac658cfddf5d9e0a418b0 Author: Brooks Davis AuthorDate: 2021-12-17 21:28:14 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:15 +0000 usb: remove COMPAT_32BIT ifdefs Now that we have proper 32-bit compat support, remove COMPAT_32BIT ifdefs to allow 32-bit code to use the 64-bit layout of USB ioctl structs and struct usb_fs_endpoint. This includes the removal of redundant alignment directives that had no effect in practice. Reviewed by: hselasky, jrtc27 (prior version) (cherry picked from commit ea972feea2d2589ee1317a19eeada0598332defa) --- sys/dev/hid/hidraw.h | 20 +++------------ sys/dev/usb/usb_ioctl.h | 67 +++++++++++++------------------------------------ 2 files changed, 21 insertions(+), 66 deletions(-) diff --git a/sys/dev/hid/hidraw.h b/sys/dev/hid/hidraw.h index 4eaf8650a332..b1b037ab8c1b 100644 --- a/sys/dev/hid/hidraw.h +++ b/sys/dev/hid/hidraw.h @@ -35,23 +35,9 @@ #define HIDRAW_BUFFER_SIZE 64 /* number of input reports buffered */ #define HID_MAX_DESCRIPTOR_SIZE 4096 /* artificial limit taken from Linux */ -/* - * Align IOCTL structures to hide differences when running 32-bit - * programs under 64-bit kernels: - */ -#ifdef COMPAT_32BIT -#define HIDRAW_IOCTL_STRUCT_ALIGN(n) __aligned(n) -#else -#define HIDRAW_IOCTL_STRUCT_ALIGN(n) -#endif - /* Compatible with usb_gen_descriptor structure */ struct hidraw_gen_descriptor { -#ifdef COMPAT_32BIT - uint64_t hgd_data; -#else void *hgd_data; -#endif uint16_t hgd_lang_id; uint16_t hgd_maxlen; uint16_t hgd_actlen; @@ -63,18 +49,18 @@ struct hidraw_gen_descriptor { uint8_t hgd_endpt_index; uint8_t hgd_report_type; uint8_t reserved[8]; -} HIDRAW_IOCTL_STRUCT_ALIGN(8); +}; struct hidraw_report_descriptor { uint32_t size; uint8_t value[HID_MAX_DESCRIPTOR_SIZE]; -} HIDRAW_IOCTL_STRUCT_ALIGN(4); +}; struct hidraw_devinfo { uint32_t bustype; int16_t vendor; int16_t product; -} HIDRAW_IOCTL_STRUCT_ALIGN(4); +}; /* FreeBSD uhid(4)-compatible ioctl interface */ #define HIDRAW_GET_REPORT_DESC _IOWR('U', 21, struct hidraw_gen_descriptor) diff --git a/sys/dev/usb/usb_ioctl.h b/sys/dev/usb/usb_ioctl.h index 5a139d0653c5..a57228a5fac2 100644 --- a/sys/dev/usb/usb_ioctl.h +++ b/sys/dev/usb/usb_ioctl.h @@ -46,16 +46,6 @@ #define USB_GENERIC_NAME "ugen" #define USB_TEMPLATE_SYSCTL "hw.usb.template" /* integer type */ -/* - * Align IOCTL structures to hide differences when running 32-bit - * programs under 64-bit kernels: - */ -#ifdef COMPAT_32BIT -#define USB_IOCTL_STRUCT_ALIGN(n) __aligned(n) -#else -#define USB_IOCTL_STRUCT_ALIGN(n) -#endif - /* Definition of valid template sysctl values */ enum { @@ -75,38 +65,26 @@ enum { }; struct usb_read_dir { -#ifdef COMPAT_32BIT - uint64_t urd_data; -#else void *urd_data; -#endif uint32_t urd_startentry; uint32_t urd_maxlen; -} USB_IOCTL_STRUCT_ALIGN(8); +}; struct usb_ctl_request { -#ifdef COMPAT_32BIT - uint64_t ucr_data; -#else void *ucr_data; -#endif uint16_t ucr_flags; uint16_t ucr_actlen; /* actual length transferred */ uint8_t ucr_addr; /* zero - currently not used */ struct usb_device_request ucr_request; -} USB_IOCTL_STRUCT_ALIGN(8); +}; struct usb_alt_interface { uint8_t uai_interface_index; uint8_t uai_alt_index; -} USB_IOCTL_STRUCT_ALIGN(1); +}; struct usb_gen_descriptor { -#ifdef COMPAT_32BIT - uint64_t ugd_data; -#else void *ugd_data; -#endif uint16_t ugd_lang_id; uint16_t ugd_maxlen; uint16_t ugd_actlen; @@ -118,7 +96,7 @@ struct usb_gen_descriptor { uint8_t ugd_endpt_index; uint8_t ugd_report_type; uint8_t reserved[8]; -} USB_IOCTL_STRUCT_ALIGN(8); +}; struct usb_device_info { uint16_t udi_productNo; @@ -147,7 +125,7 @@ struct usb_device_info { char udi_vendor[128]; char udi_serial[64]; char udi_release[8]; -} USB_IOCTL_STRUCT_ALIGN(2); +}; #define USB_DEVICE_PORT_PATH_MAX 32 @@ -156,24 +134,24 @@ struct usb_device_port_path { uint8_t udp_index; /* which device index */ uint8_t udp_port_level; /* how many levels: 0, 1, 2 ... */ uint8_t udp_port_no[USB_DEVICE_PORT_PATH_MAX]; -} USB_IOCTL_STRUCT_ALIGN(1); +}; struct usb_device_stats { uint32_t uds_requests_ok[4]; /* Indexed by transfer type UE_XXX */ uint32_t uds_requests_fail[4]; /* Indexed by transfer type UE_XXX */ -} USB_IOCTL_STRUCT_ALIGN(4); +}; struct usb_fs_start { uint8_t ep_index; -} USB_IOCTL_STRUCT_ALIGN(1); +}; struct usb_fs_stop { uint8_t ep_index; -} USB_IOCTL_STRUCT_ALIGN(1); +}; struct usb_fs_complete { uint8_t ep_index; -} USB_IOCTL_STRUCT_ALIGN(1); +}; /* This structure is used for all endpoint types */ struct usb_fs_endpoint { @@ -181,14 +159,9 @@ struct usb_fs_endpoint { * NOTE: isochronous USB transfer only use one buffer, but can have * multiple frame lengths ! */ -#ifdef COMPAT_32BIT - uint64_t ppBuffer; - uint64_t pLength; -#else void **ppBuffer; /* pointer to userland buffers */ uint32_t *pLength; /* pointer to frame lengths, updated * to actual length */ -#endif uint32_t nFrames; /* number of frames */ uint32_t aFrames; /* actual number of frames */ uint16_t flags; @@ -206,22 +179,18 @@ struct usb_fs_endpoint { /* timeout value for no timeout */ #define USB_FS_TIMEOUT_NONE 0 int status; /* see USB_ERR_XXX */ -} USB_IOCTL_STRUCT_ALIGN(8); +}; struct usb_fs_init { /* userland pointer to endpoints structure */ -#ifdef COMPAT_32BIT - uint64_t pEndpoints; -#else struct usb_fs_endpoint *pEndpoints; -#endif /* maximum number of endpoints */ uint8_t ep_index_max; -} USB_IOCTL_STRUCT_ALIGN(8); +}; struct usb_fs_uninit { uint8_t dummy; /* zero */ -} USB_IOCTL_STRUCT_ALIGN(1); +}; struct usb_fs_open { #define USB_FS_MAX_BUFSIZE (1 << 25) /* 32 MBytes */ @@ -233,20 +202,20 @@ struct usb_fs_open { uint8_t dev_index; /* currently unused */ uint8_t ep_index; uint8_t ep_no; /* bEndpointNumber */ -} USB_IOCTL_STRUCT_ALIGN(4); +}; struct usb_fs_open_stream { struct usb_fs_open fs_open; uint16_t stream_id; /* stream ID */ -} USB_IOCTL_STRUCT_ALIGN(4); +}; struct usb_fs_close { uint8_t ep_index; -} USB_IOCTL_STRUCT_ALIGN(1); +}; struct usb_fs_clear_stall_sync { uint8_t ep_index; -} USB_IOCTL_STRUCT_ALIGN(1); +}; struct usb_gen_quirk { uint16_t index; /* Quirk Index */ @@ -260,7 +229,7 @@ struct usb_gen_quirk { * UQ_XXX in "usb_quirk.h". */ char quirkname[64 - 14]; -} USB_IOCTL_STRUCT_ALIGN(2); +}; /* USB controller */ #define USB_REQUEST _IOWR('U', 1, struct usb_ctl_request) From nobody Sun Apr 30 06:57:44 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HGc4Kljz48s6n; Sun, 30 Apr 2023 06:57:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q8HGc3rQHz3Ly6; Sun, 30 Apr 2023 06:57:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0YVX7+6H7b/4wYfmqnHaDcdW+M795emZ5ryvFP7j8FQ=; b=srFNR+it07BwrBe7cnB/VOW3UldgkCvFfStD/EJr3inP8N38JpxVlMCri8h9KqBrhn5VvA 3bxng04kQKT7aHYRc5YL8DlkhRKWNobwIzeM8FKsBhwx8lXwWwSUOn4YGQyu81saNuPtZ5 nEQqCZJrpugv4O+V7Glbo+rBjUAtojMnOdcMwACxZ6UWtTOEtQCWW0w234pv1S2a/GNTFn BnHYNDdecq2bqXfbveHlvP2VKHCmptT40a1a5q24EAsYvrwTmIctc2O2lsMRWcpEtzmyv0 A6yyYvRTUI85ppttCiNKaQtlmMhX15HYOmRYlOCLIjkBShjfU147d8/fk7LZ4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0YVX7+6H7b/4wYfmqnHaDcdW+M795emZ5ryvFP7j8FQ=; b=sKZd2/bVHcf9YYJkMpstJxsagrRUZLQ3UeXaZgSfGxd/r4rBGqFb13tOn6t78zKwktATL9 qmtde8CgCiN4B+CJefNw8f3vak5w9B9nceNDEzSfoHuTLMLWhy70R148nn2XgPrrFEQ0hn 2wJEUSIXbT1itDB9HFBY4Im/IcQ7EMBPTBxzx8l1JPkzMIjDk0Ir7YcWLTHyekK/mgH9S0 Ebxi5W/Zm2cqe+r6sdmQXouJXP0Gk/g3eCcAjKLbd2oVr6U4i+St76BUtEJ79qfdQhCC5x y4Bkggpd++Uo6iP2f4nEQXuxwnNl5JH1BsGwXoRbWSjia0jNvPWxnKSwPmFcuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837864; a=rsa-sha256; cv=none; b=NoSn7txdCWdxsFgC5hZYX4koe+FcI7jVlaronnNO/At7qGZj5aVEa71XyNwgyipgY0alJO SxJT+NJkdX2VhnoCs5mIon6kJT593fVfsB5yOmRFS9Og4i/7fYn8Uifhnu7PFeCyUVf0Qp A3b1Uas104xnwD9+yA1YD+w197NU/gaxo4yq3G06ifBgn0sbRn6zzwnNOM9BgF9Tc/1BlW UZbtvgvFB0HjPNz+HQW9fcOY3quOA2vPRFaQM3EHvdP/HkyRJTjx2JHzEpopSN1U8TRwF7 ILU3ai/7UWeTddwM/rW/qdrw+pCuRpJWBD+GgpRIus6hGLCiy3Xf+9cNK4iNrQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HGc2mrDz1Ccc; Sun, 30 Apr 2023 06:57:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33U6viPT071362; Sun, 30 Apr 2023 06:57:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6viOe071361; Sun, 30 Apr 2023 06:57:44 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:57:44 GMT Message-Id: <202304300657.33U6viOe071361@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: a03d9f263466 - stable/13 - libusb: remove use of COMPAT_32BIT List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: a03d9f2634664361fd7554a7e32f36e0a2131da3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=a03d9f2634664361fd7554a7e32f36e0a2131da3 commit a03d9f2634664361fd7554a7e32f36e0a2131da3 Author: Brooks Davis AuthorDate: 2021-12-17 21:28:14 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:15 +0000 libusb: remove use of COMPAT_32BIT This codepath used uint64_t's in place of pointers in structs and arrays to allow 32-bit code to use 64-bit version of ioctls. Now that we support 32-bit compat natively this is no longer needed. Reviewed by: hselasky, jrtc27 (prior version) (cherry picked from commit 8010f4ad21b6120e929bda4eed27696e63514677) --- lib/libusb/Makefile | 8 ++------ lib/libusb/libusb20.c | 12 ++++++------ lib/libusb/libusb20_int.h | 10 ---------- lib/libusb/libusb20_ugen20.c | 16 ++++++++-------- lib/libusbhid/Makefile | 4 ---- lib/libusbhid/data.c | 4 ++-- lib/libusbhid/descr.c | 4 ++-- lib/libusbhid/usbvar.h | 6 ------ 8 files changed, 20 insertions(+), 44 deletions(-) diff --git a/lib/libusb/Makefile b/lib/libusb/Makefile index 1648664b8815..e33ca30ef22d 100644 --- a/lib/libusb/Makefile +++ b/lib/libusb/Makefile @@ -34,10 +34,6 @@ SRCS+= libusb10_desc.c SRCS+= libusb10_hotplug.c SRCS+= libusb10_io.c -.if defined(COMPAT_32BIT) -CFLAGS+= -DCOMPAT_32BIT -.endif - PCFILES= libusb-0.1.pc libusb-1.0.pc libusb-2.0.pc # @@ -45,14 +41,14 @@ PCFILES= libusb-0.1.pc libusb-1.0.pc libusb-2.0.pc # # Examples: # make LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h -# make COMPAT_32BIT=YES \ +# make \ # LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h \ # DEBUG_FLAGS="-g" # # From Ubuntu 10.04: # freebsd-make LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h \ # PTHREAD_LIBS="-lpthread -lrt" -# freebsd-make COMPAT32_BIT=YES \ +# freebsd-make \ # LIBUSB_GLOBAL_INCLUDE_FILE=libusb_global_linux.h \ # PTHREAD_LIBS="-lpthread -lrt" # diff --git a/lib/libusb/libusb20.c b/lib/libusb/libusb20.c index 4323552b83ad..60a5f8448888 100644 --- a/lib/libusb/libusb20.c +++ b/lib/libusb/libusb20.c @@ -352,7 +352,7 @@ libusb20_tr_clear_stall_sync(struct libusb20_transfer *xfer) void libusb20_tr_set_buffer(struct libusb20_transfer *xfer, void *buffer, uint16_t frIndex) { - xfer->ppBuffer[frIndex] = libusb20_pass_ptr(buffer); + xfer->ppBuffer[frIndex] = buffer; return; } @@ -418,7 +418,7 @@ libusb20_tr_set_total_frames(struct libusb20_transfer *xfer, uint32_t nFrames) void libusb20_tr_setup_bulk(struct libusb20_transfer *xfer, void *pBuf, uint32_t length, uint32_t timeout) { - xfer->ppBuffer[0] = libusb20_pass_ptr(pBuf); + xfer->ppBuffer[0] = pBuf; xfer->pLength[0] = length; xfer->timeout = timeout; xfer->nFrames = 1; @@ -430,7 +430,7 @@ libusb20_tr_setup_control(struct libusb20_transfer *xfer, void *psetup, void *pB { uint16_t len; - xfer->ppBuffer[0] = libusb20_pass_ptr(psetup); + xfer->ppBuffer[0] = psetup; xfer->pLength[0] = 8; /* fixed */ xfer->timeout = timeout; @@ -438,7 +438,7 @@ libusb20_tr_setup_control(struct libusb20_transfer *xfer, void *psetup, void *pB if (len != 0) { xfer->nFrames = 2; - xfer->ppBuffer[1] = libusb20_pass_ptr(pBuf); + xfer->ppBuffer[1] = pBuf; xfer->pLength[1] = len; } else { xfer->nFrames = 1; @@ -449,7 +449,7 @@ libusb20_tr_setup_control(struct libusb20_transfer *xfer, void *psetup, void *pB void libusb20_tr_setup_intr(struct libusb20_transfer *xfer, void *pBuf, uint32_t length, uint32_t timeout) { - xfer->ppBuffer[0] = libusb20_pass_ptr(pBuf); + xfer->ppBuffer[0] = pBuf; xfer->pLength[0] = length; xfer->timeout = timeout; xfer->nFrames = 1; @@ -463,7 +463,7 @@ libusb20_tr_setup_isoc(struct libusb20_transfer *xfer, void *pBuf, uint32_t leng /* should not happen */ return; } - xfer->ppBuffer[frIndex] = libusb20_pass_ptr(pBuf); + xfer->ppBuffer[frIndex] = pBuf; xfer->pLength[frIndex] = length; return; } diff --git a/lib/libusb/libusb20_int.h b/lib/libusb/libusb20_int.h index 5f54ee3717fc..16796dc1233d 100644 --- a/lib/libusb/libusb20_int.h +++ b/lib/libusb/libusb20_int.h @@ -33,12 +33,6 @@ #ifndef _LIBUSB20_INT_H_ #define _LIBUSB20_INT_H_ -#ifdef COMPAT_32BIT -#define libusb20_pass_ptr(ptr) ((uint64_t)(uintptr_t)(ptr)) -#else -#define libusb20_pass_ptr(ptr) (ptr) -#endif - struct libusb20_device; struct libusb20_backend; struct libusb20_transfer; @@ -159,11 +153,7 @@ struct libusb20_transfer { /* * Pointer to a list of buffer pointers: */ -#ifdef COMPAT_32BIT - uint64_t *ppBuffer; -#else void **ppBuffer; -#endif /* * Pointer to frame lengths, which are updated to actual length * after the USB transfer completes: diff --git a/lib/libusb/libusb20_ugen20.c b/lib/libusb/libusb20_ugen20.c index 5687caf97e4f..efffff2b5ef0 100644 --- a/lib/libusb/libusb20_ugen20.c +++ b/lib/libusb/libusb20_ugen20.c @@ -251,7 +251,7 @@ ugen20_readdir(struct ugen20_urd_state *st) repeat: if (st->ptr == NULL) { st->urd.urd_startentry += st->nparsed; - st->urd.urd_data = libusb20_pass_ptr(st->buf); + st->urd.urd_data = st->buf; st->urd.urd_maxlen = sizeof(st->buf); st->nparsed = 0; @@ -364,7 +364,7 @@ ugen20_tr_renew(struct libusb20_device *pdev) memset(&fs_init, 0, sizeof(fs_init)); - fs_init.pEndpoints = libusb20_pass_ptr(pdev->privBeData); + fs_init.pEndpoints = pdev->privBeData; fs_init.ep_index_max = nMaxTransfer; if (ioctl(pdev->file, IOUSB(USB_FS_INIT), &fs_init)) { @@ -478,7 +478,7 @@ ugen20_get_config_desc_full(struct libusb20_device *pdev, memset(&cdesc, 0, sizeof(cdesc)); memset(&gen_desc, 0, sizeof(gen_desc)); - gen_desc.ugd_data = libusb20_pass_ptr(&cdesc); + gen_desc.ugd_data = &cdesc; gen_desc.ugd_maxlen = sizeof(cdesc); gen_desc.ugd_config_index = cfg_index; @@ -499,7 +499,7 @@ ugen20_get_config_desc_full(struct libusb20_device *pdev, /* make sure memory is initialised */ memset(ptr, 0, len); - gen_desc.ugd_data = libusb20_pass_ptr(ptr); + gen_desc.ugd_data = ptr; gen_desc.ugd_maxlen = len; error = ioctl(pdev->file_ctrl, IOUSB(USB_GET_FULL_DESC), &gen_desc); @@ -726,7 +726,7 @@ ugen20_do_request_sync(struct libusb20_device *pdev, memset(&req, 0, sizeof(req)); - req.ucr_data = libusb20_pass_ptr(data); + req.ucr_data = data; if (!(flags & LIBUSB20_TRANSFER_SINGLE_SHORT_NOT_OK)) { req.ucr_flags |= USB_SHORT_XFER_OK; } @@ -835,8 +835,8 @@ ugen20_tr_open(struct libusb20_transfer *xfer, uint32_t MaxBufSize, xfer->maxPacketLen = temp.fs_open.max_packet_length; /* setup buffer and length lists using zero copy */ - fsep->ppBuffer = libusb20_pass_ptr(xfer->ppBuffer); - fsep->pLength = libusb20_pass_ptr(xfer->pLength); + fsep->ppBuffer = xfer->ppBuffer; + fsep->pLength = xfer->pLength; return (0); /* success */ } @@ -956,7 +956,7 @@ ugen20_dev_get_iface_desc(struct libusb20_device *pdev, memset(&ugd, 0, sizeof(ugd)); - ugd.ugd_data = libusb20_pass_ptr(buf); + ugd.ugd_data = buf; ugd.ugd_maxlen = len; ugd.ugd_iface_index = iface_index; diff --git a/lib/libusbhid/Makefile b/lib/libusbhid/Makefile index 7dba7ffc9113..2a58a4b1eb48 100644 --- a/lib/libusbhid/Makefile +++ b/lib/libusbhid/Makefile @@ -19,8 +19,4 @@ SRCS= descr.c descr_compat.c parse.c usage.c data.c INCS= usbhid.h -.if defined(COMPAT_32BIT) -CFLAGS+= -DCOMPAT_32BIT -.endif - .include diff --git a/lib/libusbhid/data.c b/lib/libusbhid/data.c index ae81bb321095..cad320562eee 100644 --- a/lib/libusbhid/data.c +++ b/lib/libusbhid/data.c @@ -126,7 +126,7 @@ hid_get_report(int fd, enum hid_kind k, unsigned char *data, unsigned int size) struct usb_gen_descriptor ugd; memset(&ugd, 0, sizeof(ugd)); - ugd.ugd_data = hid_pass_ptr(data); + ugd.ugd_data = data; ugd.ugd_maxlen = size; ugd.ugd_report_type = k + 1; return (ioctl(fd, USB_GET_REPORT, &ugd)); @@ -138,7 +138,7 @@ hid_set_report(int fd, enum hid_kind k, unsigned char *data, unsigned int size) struct usb_gen_descriptor ugd; memset(&ugd, 0, sizeof(ugd)); - ugd.ugd_data = hid_pass_ptr(data); + ugd.ugd_data = data; ugd.ugd_maxlen = size; ugd.ugd_report_type = k + 1; return (ioctl(fd, USB_SET_REPORT, &ugd)); diff --git a/lib/libusbhid/descr.c b/lib/libusbhid/descr.c index 329bbe9261b7..7cd6750ad322 100644 --- a/lib/libusbhid/descr.c +++ b/lib/libusbhid/descr.c @@ -105,7 +105,7 @@ hid_get_report_desc(int fd) memset(&ugd, 0, sizeof(ugd)); /* get actual length first */ - ugd.ugd_data = hid_pass_ptr(NULL); + ugd.ugd_data = NULL; ugd.ugd_maxlen = 65535; if (ioctl(fd, USB_GET_REPORT_DESC, &ugd) < 0) { #ifdef HID_COMPAT7 @@ -126,7 +126,7 @@ hid_get_report_desc(int fd) return (NULL); /* fetch actual descriptor */ - ugd.ugd_data = hid_pass_ptr(data); + ugd.ugd_data = data; ugd.ugd_maxlen = ugd.ugd_actlen; if (ioctl(fd, USB_GET_REPORT_DESC, &ugd) < 0) { /* could not read descriptor */ diff --git a/lib/libusbhid/usbvar.h b/lib/libusbhid/usbvar.h index 5072f4787e42..0dfd596e8bb0 100644 --- a/lib/libusbhid/usbvar.h +++ b/lib/libusbhid/usbvar.h @@ -47,10 +47,4 @@ int hid_get_report_id_compat7(int fd); report_desc_t hid_get_report_desc_compat7(int fd); #endif -#ifdef COMPAT_32BIT -#define hid_pass_ptr(ptr) ((uint64_t)(uintptr_t)(ptr)) -#else -#define hid_pass_ptr(ptr) (ptr) -#endif - #endif /* _USBVAR_H_ */ From nobody Sun Apr 30 06:57:45 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HGd5QP9z48rhh; Sun, 30 Apr 2023 06:57: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 4Q8HGd4wHSz3MX5; Sun, 30 Apr 2023 06:57:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TpTKiggGktfavv8QJE/rWZed+kw6kOlJIxWzLi68wMo=; b=yxYebNbfpw6Ze+ibAM9/ETbdD21OnCSnGWATZbsTjiQeZ+qCE1SjB1PRgVE581Sz0aq+T4 j2NcijS7Tn+mPnO9A5+b3ucVaUCFFJC0/ydr5P01Bgh+P87i13n/XRKD/s5IIe4UyTRtm7 MzAA8tklnlkNzrnTq1+1FTaxfvkTLv0d/Z5Lfyto8QuWF37lz+bHm3h8cezlQgOToId7xw sUy8Ck7GvnwKw0YbPQj4YUxaRTZGXr6iK0vwPhco/12hbTnWaJvbl/uPVKhEB703qCtcTV JdLj9WS9zGL0LXliiUIEMASbsHCNoMlQyiiI1/IGioohzTLxUvu0EMAeQc2RNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TpTKiggGktfavv8QJE/rWZed+kw6kOlJIxWzLi68wMo=; b=GjYkflzr90woHf5buGudgV/+/1zr6nbZBeP4Ocv6vb+rgr0RXQfmrMd82vc0mXsWQH35KH yTtgbLfQLpq/PQ5cIvga0WuVQGGreqI1SrSch09SVKoJ5vBpQoAGFX9AD1D4XdSoHKHl+R XArZvmKEhQWPiceSgq86Gt0OKWzpoHhxrSO3JHXftLUlvNjiilXThPce7xwzwb6tBHVIq0 OPycENNrx2soK9/6qZgBCVIh5W8sfRqgXGcpUN1RDqjm4j4OFyeAqeApzNprcYQ8/RU6c0 ZNez5jFcYewI2Ud9QTpz+gKI3ToQXX/obfTt/N91WPjgSFNP3lbDpd/banUP4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837865; a=rsa-sha256; cv=none; b=QzcsfYlxo5/Gi+Ct9Xr7oXDBjWYCrpswVlAzBN5U11mQ+Ho6PMkDJm1TRMpVjx1U80u0Uh iJk+lOTltuqdsiVZMDFTP2mDE8yShYJk3lL7gCK7WnVLTenEHeFdvKGLATe3RABjU34rQA hyQQjHOP7JgC+zbNwjU2Yat95YfZyCdSVO6D4josJtq6BxUhY9LW1oxT40RXkbkBF/7Hiq EnYi2dwLonOxxr1G77zr69tAZ5tPDyRkknAaehAWie6J6/sqe+aURYqG+LhtuqeXRWDlYD JdaTSjW9HrFR1X+csWZboXr3tWDAxRF+zx4UKq/h3/k59QHbJMYh8KDmIUpmgw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HGd3kM3z1Crd; Sun, 30 Apr 2023 06:57:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33U6vjE5071381; Sun, 30 Apr 2023 06:57:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6vjqk071380; Sun, 30 Apr 2023 06:57:45 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:57:45 GMT Message-Id: <202304300657.33U6vjqk071380@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: d9a8025f4849 - stable/13 - uhid_snes: Remove USB_ST_TRANSFERRED handling for the status request. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: d9a8025f484984a2165767762648f668b869f49f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=d9a8025f484984a2165767762648f668b869f49f commit d9a8025f484984a2165767762648f668b869f49f Author: John Baldwin AuthorDate: 2022-04-18 19:27:48 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:15 +0000 uhid_snes: Remove USB_ST_TRANSFERRED handling for the status request. The result of the request computed in new_status was never returned to the caller leaving new_status as a set-but-unused variable. Removing new_status leaves sc->previous_status as a write-only variable. Removing sc->previous_status leaves current_status as a write-only variable, so it collapses down to removing the entire USB_ST_TRANSFERRED case. Arguably, all of the support for UHID_SNES_STATUS_DT_RD should be removed as it doesn't return anything to the caller. If the request should be fixed instead then this commit should be reverted and new_status should be returned to whoever submitted the request. Differential Revision: https://reviews.freebsd.org/D34840 (cherry picked from commit 540ac338d5575131d134d2c033f31b5d6d576c68) --- sys/dev/usb/input/uhid_snes.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/sys/dev/usb/input/uhid_snes.c b/sys/dev/usb/input/uhid_snes.c index 9bce3d10941f..d786b0e1f257 100644 --- a/sys/dev/usb/input/uhid_snes.c +++ b/sys/dev/usb/input/uhid_snes.c @@ -94,7 +94,6 @@ struct uhid_snes_softc { int sc_fflags; struct usb_fifo *sc_fifo_open[2]; uint8_t sc_zero_length_packets; - uint8_t sc_previous_status; uint8_t sc_iid; uint8_t sc_oid; uint8_t sc_fid; @@ -498,7 +497,6 @@ uhid_snes_status_callback(struct usb_xfer *transfer, usb_error_t error) struct uhid_snes_softc *sc = usbd_xfer_softc(transfer); struct usb_device_request req; struct usb_page_cache *pc; - uint8_t current_status, new_status; switch (USB_GET_STATE(transfer)) { case USB_ST_SETUP: @@ -517,13 +515,6 @@ uhid_snes_status_callback(struct usb_xfer *transfer, usb_error_t error) usbd_transfer_submit(transfer); break; - case USB_ST_TRANSFERRED: - pc = usbd_xfer_get_frame(transfer, 1); - usbd_copy_out(pc, 0, ¤t_status, 1); - new_status = current_status & ~sc->sc_previous_status; - sc->sc_previous_status = current_status; - break; - default: break; } From nobody Sun Apr 30 06:57:46 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HGg19Nnz48rsh; Sun, 30 Apr 2023 06:57: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 4Q8HGf5hZcz3MRl; Sun, 30 Apr 2023 06:57:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8VhrkGqIyE7teG8jbJibes47XxHacqsaWgxd0uC4pSY=; b=aPEuYDnHGag7aMr8nrlTJIFY1zKMaItEPjizbdnmA8KEAU5rxdXRgoaV0B+eKNQoNekPUw XD/ZO2czjVrHrRSAi0u5Nd3Hgt9ryE5lNQMQJ1qZrPcYQ8DNyOqcXRxgUViDwWIDxc1fOJ d4ODAKWpHZXm6AscwxJUTMy3Vcn9MmP4rDz5sOz0EHTY136SMsLbptDKp1JSOcSOecmWPY Z0zRThYaUoyZBELx2BzCbTEkcIRwEA148mJMGJu1j9ZSDEL/XweW8me3U7auOAKe1C14mN 7Bnwh2Ua3Smxhr17uiYc27fTARXOSw4TO4qUEtdNSt5CXAIvun9jxrfeqZL3dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8VhrkGqIyE7teG8jbJibes47XxHacqsaWgxd0uC4pSY=; b=cKqZpKY4domzJrvW2aAIfbEsgdbaBBZDwBOaOVuyqCMeLGz6VH/D/Xk+pnFjpdgHt2Mmgc UcESax6bSGGL8sLBMHys8PIhEw1wc6Kae56LiOzI3u6HSnpctIWGcLN+8IqQnJoA87U/f7 QW50W372WyiZAxc9W/W9q9b9tJQMsx2f+P6KiyMuAue+Nr+lkmy0CZAQ38SGhvvCNSv7je MjcmrLhHsVr6VEjlrEqM+a1i7aMVdVvV8Qn0yjl9/3h3Ww1eyDNZ84xk0u/Gf4bcWsnpUd BYFYpz1N++teOaRerq14zAh78rrXsSmvEa/MNHdXFwquGiFXCau1H1A1E3PK7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837866; a=rsa-sha256; cv=none; b=BdxFeAxBtPboNyIs0mQtsAcAzCiFbTt5FB/0KWGcVBn5e4Q0f9VAzy5t1GR8dQ4eJoSYk9 c4kPntgUrOzGBND3bOmTmiGgX976woRpOdELhhzotm6qsdIOqFRueBF4ol9A1NL82jPvJr kb0dIcMOW3Zzm1ZGw8tdCVpNBkydQcsmaLMjzYi3eL35R3cd3F4w9wQ4vzmrbOgurUJGDb yUX51sUPrwvHi8x3hDo4QGv0EqDu3Svj2Vn/B+T3RxfIlzJYkpyoLFpe3INM4xtkYHA/V8 KeQXScuFya36SosLOniHo2pEqsMdxKxcE7c+5FuhUQdnVvO82Li0ObtY+8JaZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HGf4fpxzDr7; Sun, 30 Apr 2023 06:57: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 33U6vkAS071404; Sun, 30 Apr 2023 06:57:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6vkrL071403; Sun, 30 Apr 2023 06:57:46 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:57:46 GMT Message-Id: <202304300657.33U6vkrL071403@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: cb68867ec7bb - stable/13 - usb: Respect NO_INQUIRY quirk during device enumeration List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: cb68867ec7bba4d296cedb73c09f4256086cff32 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=cb68867ec7bba4d296cedb73c09f4256086cff32 commit cb68867ec7bba4d296cedb73c09f4256086cff32 Author: Kornel Duleba AuthorDate: 2022-04-26 12:07:21 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:16 +0000 usb: Respect NO_INQUIRY quirk during device enumeration Both usb_iface_is_cdrom and usb_msc_auto_quirk functions use SCSI INQUIRY command to probe various properties of usb mass storage devices. The problem here is that some very broken devices don't like this command. Check if UQ_MSC_NO_INQUIRY quirk is set and skip cdrom and quirk autodetection in that case. Sponsored by: Stormshield Obtained from: Semihalf Reviewed by: hps, wma Differential Revision: https://reviews.freebsd.org/D35075 (cherry picked from commit 3ee943868c74ce917820fe9ddbcfeab338704d90) --- sys/dev/usb/usb_device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/usb_device.c b/sys/dev/usb/usb_device.c index 6564182a97b0..b5e51cbdc7a7 100644 --- a/sys/dev/usb/usb_device.c +++ b/sys/dev/usb/usb_device.c @@ -2031,7 +2031,8 @@ repeat_set_config: goto repeat_set_config; } #if USB_HAVE_MSCTEST - if (config_index == 0) { + if (config_index == 0 && + usb_test_quirk(&uaa, UQ_MSC_NO_INQUIRY) == 0) { /* * Try to figure out if we have an * auto-install disk there: @@ -2051,7 +2052,8 @@ repeat_set_config: usb_test_quirk(&uaa, UQ_MSC_NO_PREVENT_ALLOW) == 0 && usb_test_quirk(&uaa, UQ_MSC_NO_SYNC_CACHE) == 0 && usb_test_quirk(&uaa, UQ_MSC_NO_TEST_UNIT_READY) == 0 && - usb_test_quirk(&uaa, UQ_MSC_NO_GETMAXLUN) == 0) { + usb_test_quirk(&uaa, UQ_MSC_NO_GETMAXLUN) == 0 && + usb_test_quirk(&uaa, UQ_MSC_NO_INQUIRY) == 0) { /* * Try to figure out if there are any MSC quirks we * should apply automatically: From nobody Sun Apr 30 06:57:47 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HGh0wYqz48rlB; Sun, 30 Apr 2023 06:57: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 4Q8HGg6dP0z3MZX; Sun, 30 Apr 2023 06:57:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837868; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=33rvQvzQHjE9BVKlTHQ4Qeubpw0DtvIvvWYfgQx8MKY=; b=UqAffrQc3mipCZt0SCbRtxobWvsrxiEbF61OUVlXWwv+cVVe4omRyulu+VyM0jgbm0Nhf8 3B65LAj+mCQZD28BEQ8ICC5Cg5pMdZ3G/IMMQgQIt1mEzvB1NFxVlypq7LVQU8o+q02awj eMcYc/jQP33flEtnOXhZqDHMBqRIRYbhIpoEjt38c0iTgSC4lqV4uMU+Cvh/y4kxVHCrK3 lDByhw2SRf7pJqLk913dyeMaSDvIBTRy1N3dTB1DZmEGZmZBJ3El6G0hVbKQJYRMnNFmZp pXez25DgZeYYMC7Ej2+07Qdvjj0v7ovXa8ays8utULgb67LicnMp4q7Ip1g4rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837868; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=33rvQvzQHjE9BVKlTHQ4Qeubpw0DtvIvvWYfgQx8MKY=; b=fjBQHLFsK9YDvcN1QxmJy0zblCqtQBn7GPPAvMRh/hLcp5KDDnUIVUBw6ItayBHEO8Hea1 SFm4sZDj3KhqwG5/ZyibEV/zi4uWT63vUW2eNt/D2F1/eACb/Sob2wCxrwnnBrVi3Z36YB 7bP0aa/quf2u1Jq5jygxEQtjlKXd6J5MO8n/B91MDSmF3LetBvZq/9tTR4JpF6vz8bFRtw +rdrs//si6bn/yP3nFTkWS4xRRbOCnLReX/nT75KcGEXbby1nLAzVLmnyGFPSzHl59Fwe1 hwY4gpcbNkmFx7sMe2drqUBQ0DBMZq0s6Z9cXzNIO/df7TQRljKnt6ieE1veww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837868; a=rsa-sha256; cv=none; b=Br6G9yczAdDZ/wCV2yguCpkSD/hX+BLK0DWq5cYTZJTX7BSxlUqevd+uTPAXt1lg332hMj eFSveW8VMG5Y4MkmmT8Rk/MiFmlhOhgAHU7A4ergjMZ467oazasIJetP1SXWIANYATtaHG ZAIwTBVwZo3WxU+x9Q+MFGwtzTiDmFZnmeQX/xtPsQn9ZJh+/a5tbIQbt/1kj6UdFzYprJ +eoGaoBfY7CM1dmAvfe9ZnBOziVErUPaSY+SNIEP5WOa7hMPQlVorC8s3+pHR35oEuUEjr lsmJOdOqF0br2GYNCjAGfUqb/Lkoqwv/x57ZkAhNum09OFJWqs+STyBKZ7TRdA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HGg5dTvzDhS; Sun, 30 Apr 2023 06:57: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 33U6vl7E071425; Sun, 30 Apr 2023 06:57:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6vlFS071424; Sun, 30 Apr 2023 06:57:47 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:57:47 GMT Message-Id: <202304300657.33U6vlFS071424@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: e7f8a67e1f88 - stable/13 - uath(4): Fix incorrect byte-swapping and a buffer length check. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: e7f8a67e1f88442d8d66a0a1c3de03ba8fc13078 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=e7f8a67e1f88442d8d66a0a1c3de03ba8fc13078 commit e7f8a67e1f88442d8d66a0a1c3de03ba8fc13078 Author: Hans Petter Selasky AuthorDate: 2022-04-30 09:21:54 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:16 +0000 uath(4): Fix incorrect byte-swapping and a buffer length check. PR: 263638 Reported by: Jeff Gibbons Sponsored by: NVIDIA Networking (cherry picked from commit 6eb6aeef7e670bddc9cd52aaf32765a9ea85eee3) --- sys/dev/usb/wlan/if_uath.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/dev/usb/wlan/if_uath.c b/sys/dev/usb/wlan/if_uath.c index df7e1d7c396f..4ffdc9a72fad 100644 --- a/sys/dev/usb/wlan/if_uath.c +++ b/sys/dev/usb/wlan/if_uath.c @@ -2244,7 +2244,7 @@ uath_cmdeof(struct uath_softc *sc, struct uath_cmd *cmd) u_int olen; if (sizeof(*hdr) > hdr->len || - hdr->len >= UATH_MAX_CMDSZ) { + hdr->len > UATH_MAX_CMDSZ) { device_printf(sc->sc_dev, "%s: invalid WDC msg length %u; " "msg ignored\n", __func__, hdr->len); @@ -2360,11 +2360,10 @@ uath_intr_rx_callback(struct usb_xfer *xfer, usb_error_t error) usbd_copy_out(pc, 0, cmd->buf, actlen); hdr = (struct uath_cmd_hdr *)cmd->buf; - hdr->len = be32toh(hdr->len); - if (hdr->len > (uint32_t)actlen) { + if (be32toh(hdr->len) > (uint32_t)actlen) { device_printf(sc->sc_dev, "%s: truncated xfer (len %u, actlen %d)\n", - __func__, hdr->len, actlen); + __func__, be32toh(hdr->len), actlen); goto setup; } From nobody Sun Apr 30 06:57:48 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HGj17X7z48sC2; Sun, 30 Apr 2023 06:57: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 4Q8HGj0RhFz3M1m; Sun, 30 Apr 2023 06:57:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yd2pTLxJqsluGiAVn8mceX9v++9dVMw/BA+kC7NKK9k=; b=WBJs1Q2Ot5jiWTSeENp4R79IHZtGoJ4KrQU5KyS4ZF72uIp+qdODA0d2UtCueVo/Tl4C40 3/b94lHVOrlCfb1+uuqhgH4dOnDtkXhdTc2VpuA7VrAufjPgyPoD9HWcV5hXOpSJDvU3pm LoYSWZAXs0MltV5+HpmYqFm4+PtIt9sJE7oTRDIrlM56yO6klZzjYogH5DfQ86ayXDFYgr dT1eOYwliHRzETjeYn8bi6ubjD90jnwdzixqfStmgZ/AoC3kfgGBCqTQAleOqPx6rjbah5 EDW+gsc5n/TEb9FVQcC6xABA0/jB5IN4jo0wc+B9rprUz0NfJv9iy20XiJpDkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yd2pTLxJqsluGiAVn8mceX9v++9dVMw/BA+kC7NKK9k=; b=WASZ2ScNmtY5cuotKXIg1+8KKfvMxPXTFJyguL/BwIjgJGM4k9KuXh99/yotq78x6o3jzY bv4cqTmyC0jyTd9v6NkIcKR9DYaRc9ABMW+eSStqEJnsWr+wdvrHM9s7uWp9vXaGuCGKlj C78MqEcSthr3j/+KusEwAfm9s9/BtwYFbkqSEV53mvqryvD+7zCUv+DQ2uF+0lL1E2g593 FtMeYCdfto70u4WbwciXQFLaho01RnU62qJFrJ2w0Q7V55C8X5S0PETtar5dObrp98V2ye /RxjIze0BzNEQYWlZeVxBWMMZ01RuNy1vepX4hKJY0tHHo7zQm8btMCln4bWPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837869; a=rsa-sha256; cv=none; b=YvBK9QkIGPLA1JqrNGLc5wnj0S9Kxm9c0COz5kHaTvclq4nTkEgyBY9WWHKYQf1Qk9DHq7 h+FPQviXeDCJEi5H9kzW2MoSbAY/Dsfaobl7ChBwmgrSmxI8ie+uOMBnpCHF4r0hPbsTNc TVl1dovh1Mub6av56JJ5EXd1mBBnWzk+ZSrIhNkopZ/Cte3ROHw230iukfikq6ci3lOoik 39YfPe1cTu5ubuXluQgThr4acQTtQUGDrGKKPnBRgipQ3jW6EFe6sWUDKuYHHPtyPAxL8n XIBrXwuRh9Z06u71R7ttCeax9WgNEMcwkUhfn8vV43umZeeAhJQ5CZpNnsNuLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HGh6g20zDsq; Sun, 30 Apr 2023 06:57: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 33U6vmV2071450; Sun, 30 Apr 2023 06:57:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6vmBR071449; Sun, 30 Apr 2023 06:57:48 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:57:48 GMT Message-Id: <202304300657.33U6vmBR071449@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: d5d2838785ff - stable/13 - USB id of yet another Lenovo USB-C ethernet dongle. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: d5d2838785ffaf453abf316243ee9ffcceb9d83c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=d5d2838785ffaf453abf316243ee9ffcceb9d83c commit d5d2838785ffaf453abf316243ee9ffcceb9d83c Author: Poul-Henning Kamp AuthorDate: 2022-08-28 17:21:38 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:16 +0000 USB id of yet another Lenovo USB-C ethernet dongle. (cherry picked from commit 31937f7e843da8be685557d513fc1af58079eda3) --- sys/dev/usb/net/if_ure.c | 1 + sys/dev/usb/usbdevs | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/dev/usb/net/if_ure.c b/sys/dev/usb/net/if_ure.c index 5cfb763c113a..9a421f02732e 100644 --- a/sys/dev/usb/net/if_ure.c +++ b/sys/dev/usb/net/if_ure.c @@ -103,6 +103,7 @@ static const STRUCT_USB_HOST_ID ure_devs[] = { URE_DEV(LENOVO, TBT3LAN, 0), URE_DEV(LENOVO, TBT3LANGEN2, 0), URE_DEV(LENOVO, ONELINK, 0), + URE_DEV(LENOVO, RTL8153_04, URE_FLAG_8153), URE_DEV(LENOVO, USBCLAN, 0), URE_DEV(LENOVO, USBCLANGEN2, 0), URE_DEV(MICROSOFT, WINDEVETH, 0), diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 15cca3f8c6db..0368ec25e6e1 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -2824,6 +2824,7 @@ product LENOVO GIGALAN 0x304b USB 3.0 Ethernet product LENOVO ETHERNET 0x7203 USB 2.0 Ethernet product LENOVO RTL8153 0x7205 USB 3.0 Ethernet product LENOVO ONELINK 0x720a USB 3.0 Ethernet +product LENOVO RTL8153_04 0x720c USB 3.0 Ethernet product LENOVO TBT3LAN 0x3069 LAN port in Thinkpad TB3 dock product LENOVO USBCLAN 0x3062 LAN port in Thinkpad USB-C dock product LENOVO TBT3LANGEN2 0x3082 LAN port in Thinkpad TB3 dock gen2 From nobody Sun Apr 30 06:57:49 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HGk2X74z48sC5; Sun, 30 Apr 2023 06:57: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 4Q8HGk1tmDz3Mm5; Sun, 30 Apr 2023 06:57:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ovUHHAw0QziET2kttiil1yotqpe4ekBTbmEeacikbSg=; b=i8CnpPodDOEXZQa8vlDtxm6+ZBzGgPakRJ8XSOsgYyGIg3shIb4ITRHw89GsdyhmH2qFrc OgAUdDcPCwdj+0WiOiAtjDd2OUz6cCAO0qBFr9JW5VVRm8//B8pjvc1A4APNbomezRqcu7 m99uhA+s/nELL8BMubzK1diPX3JNcGXbBH1x9rVtaAVHB7en9ug+VZXT//TWcH+ybF8rjO hRtFT8Rp2wwJmFg0ZiYI086W0FKHbVSfYiBJYCnvRRZcQd5L2Q5jkPOoall4EXqLLWv+Nw X1jU09DtHT8SfC3WBr+xLyoOalH53BVRbkqvRn1g0yHbn6PTYF1CFU+zTkdy8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ovUHHAw0QziET2kttiil1yotqpe4ekBTbmEeacikbSg=; b=S6M9C4+MC8/0RLpwmW1TJ9pu5gtcvHql38LHrexeBah/iOfJrPoZjjm5WAYO0PDqsO5Ptn CCHwjB7Q/ybar6Xac0IhW+LDIwOHuAwk/+Z/N2rxv4Vkan7cunRQYOWDxrfXhwQcqOGzgp mTL0oK1YqR11IbN/g4noEXF8/tToUk98vxrAC7LzBhtWIRNxGuSmEv7jevdaHI0qi4oLRT 9XRZCozEweVwLF1yircVsxdvMDVJLn339bkXmdiH/KlhQRcooXgmVKHsCwHB3/u9Rt8Ro/ WT0b7EhBEylzsfY62FlbC/XiqhzCaiOAgkGZgCEdMbBdFgusE0mlOZnt42csfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837870; a=rsa-sha256; cv=none; b=k8A/2EhdFYJKtncpUrI8yEFgkKmT+IiU0sfb8dNfj3LRSybA0VNxFKy1u4x+GECm1yMTdS OtKhjswqSKTNGp/ijFzckX/lwdbEzpz9XWDiGFmpZ4PsjKr7l3J1YZ9aNcm9ucMp1xn8+Z 3kiS4CJ0UV8D+t7+WVvd9Nnh9Ds//R1bLUc++wqclw5RhJ+232ZvYsds0PzoII8dN/rPk+ 32F7uaQOq7IaLBoZGq5KHiCV6RlIXyy4GMI0NGyovYfI3M3bm1GhF7LarFkZ7MRTqfPfaD 9UKxcM9QwKP80pshjGPmBoLv82fkPUFwvVWOxfBMZrYC3BpxR5bP53nrIOM1jg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HGk0ZKDz1CgB; Sun, 30 Apr 2023 06:57: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 33U6vnIr071470; Sun, 30 Apr 2023 06:57:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6vnPk071469; Sun, 30 Apr 2023 06:57:49 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:57:49 GMT Message-Id: <202304300657.33U6vnPk071469@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: c6203b6c00ca - stable/13 - usb(4): Call optional endpoint_uninit() when changing configuration or alternate setting. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: c6203b6c00ca87a182a8a81d372ade0dc3e1f5f5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=c6203b6c00ca87a182a8a81d372ade0dc3e1f5f5 commit c6203b6c00ca87a182a8a81d372ade0dc3e1f5f5 Author: Hans Petter Selasky AuthorDate: 2022-12-15 22:32:47 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:16 +0000 usb(4): Call optional endpoint_uninit() when changing configuration or alternate setting. Sponsored by: NVIDIA Networking (cherry picked from commit e4611d26265fb9e3bd2a345cf4776863f49a2587) --- sys/dev/usb/usb_device.c | 55 ++++++++++++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/sys/dev/usb/usb_device.c b/sys/dev/usb/usb_device.c index b5e51cbdc7a7..392d969587c0 100644 --- a/sys/dev/usb/usb_device.c +++ b/sys/dev/usb/usb_device.c @@ -841,38 +841,53 @@ usb_config_parse(struct usb_device *udev, uint8_t iface_index, uint8_t cmd) DPRINTFN(5, "iface_index=%d cmd=%d\n", iface_index, cmd); - if (cmd == USB_CFG_FREE) - goto cleanup; - - if (cmd == USB_CFG_INIT) { + if (cmd == USB_CFG_INIT || cmd == USB_CFG_FREE) { sx_assert(&udev->enum_sx, SA_LOCKED); /* check for in-use endpoints */ + if (cmd == USB_CFG_INIT) { + ep = udev->endpoints; + ep_max = udev->endpoints_max; + while (ep_max--) { + /* look for matching endpoints */ + if (iface_index == USB_IFACE_INDEX_ANY || + iface_index == ep->iface_index) { + if (ep->refcount_alloc != 0) + return (USB_ERR_IN_USE); + } + } + } + ep = udev->endpoints; ep_max = udev->endpoints_max; while (ep_max--) { /* look for matching endpoints */ - if ((iface_index == USB_IFACE_INDEX_ANY) || - (iface_index == ep->iface_index)) { - if (ep->refcount_alloc != 0) { - /* - * This typically indicates a - * more serious error. - */ - err = USB_ERR_IN_USE; - } else { - /* reset endpoint */ - memset(ep, 0, sizeof(*ep)); - /* make sure we don't zero the endpoint again */ - ep->iface_index = USB_IFACE_INDEX_ANY; - } + if (iface_index == USB_IFACE_INDEX_ANY || + iface_index == ep->iface_index) { + /* + * Check if hardware needs a callback + * to unconfigure the endpoint. This + * may happen multiple times, + * because the requested alternate + * setting may fail. The callback + * implementation should be aware of + * and handle that. + */ + if (ep->edesc != NULL && + udev->bus->methods->endpoint_uninit != NULL) + udev->bus->methods->endpoint_uninit(udev, ep); + + /* reset endpoint */ + memset(ep, 0, sizeof(*ep)); + /* make sure we don't zero the endpoint again */ + ep->iface_index = USB_IFACE_INDEX_ANY; } ep++; } - if (err) - return (err); + if (cmd == USB_CFG_FREE) + goto cleanup; } memset(&ips, 0, sizeof(ips)); From nobody Sun Apr 30 06:57:51 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HGl5S2Yz48s72; Sun, 30 Apr 2023 06:57: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 4Q8HGl2S5nz3MfN; Sun, 30 Apr 2023 06:57:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UJCrCsVyy0Zr4wovKx5GH++Rhwabb+M3ounq2m0FqgM=; b=qNEhoW0fLw3V41oWyASDIC8ywModj5fQwamNNDET8/BbaeR7ozwb4N8+KtLEVUFXWX3nGd P3UdXHv939F5LjsCoTF2Z2tliDiukoXnDiTbeLMv/6ffa4I37yXFZwEqkqgnl6mwEEl9eY 5kAFuA1mleQQDDIKhGFgKB5zXOyPOnv87W8BqIkFuWsjN/8gXnwi6nvpagxAMCVVQDhWNM OcOx7ZkE32CYVEHYQQ86QyIvkMkAelIuae5nFXpsDTAMv/Km5hzUzOzK1UjzSzx78chskx b/KDyYhOKnPopOga9kb8sd4VCVaQFjpQOeLmEh/CaLXlX+R0FbGvrpn3aP4klQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UJCrCsVyy0Zr4wovKx5GH++Rhwabb+M3ounq2m0FqgM=; b=TC30t//BK4R2AGxcqZi0isyURp6/klSDRzNEHDcqf87Rdsdl86lGJQB5El5BH618nnh9Bw IcqDpi8SOY1AFqSjxJKkJlGF47mMD4yv0MBIRRILeTDnUDaM33bZo3NBtV7kgASrm9zXMV ukq9XeMy9KgjeV6e3MDps1+Mt+lzIjjicYQljuhKxVx0Zpn86lJZPo2s3gUq2Au1vjQLt0 r2RUZV28/j/NC/buTBu2/bqEs8Y+k/PibD73O29ybVr3833SS3U/mor052E9y0udAzPuuR msNAIvUn1GwO5DgAF23LsWndicWdYXZ2LcaqAiox+JHXl+5pGL/HTYTGl8XQSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837871; a=rsa-sha256; cv=none; b=oGZlxmrEFQ4qP9ziv02+K+aaaHiKN93xIcTwufqxaOmhH28t0sO6edLJfa200daqBLP3nb tjxY3aUjl4Z0BvFAA4+1EYT4/IAcykN806LcleXVTtPq50AgpFe05sOn5yL/oys2rveVdV WOVrIG4nko5Zsz2sbAZLh5o1VaJcsZx85RkkADxQLQD4qocF05wfpBD80zkXMQloyThMaW dom29iAX2shQF3jgC0d2OhIqyk39PX3j8MwOaJBxPe9YyQK8oSjWEsm/OWSdb9JiNN5i3B wRld53txDCKYoC5xwfYomvrF3VC56JppZol0Shw+6VdfO1mwqQYm35XYrC/o+A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HGl1KdKz1Crf; Sun, 30 Apr 2023 06:57: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 33U6vpW6071493; Sun, 30 Apr 2023 06:57:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6vpiO071491; Sun, 30 Apr 2023 06:57:51 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:57:51 GMT Message-Id: <202304300657.33U6vpiO071491@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 3b7149c7c32a - stable/13 - xhci(4): Make sure allocated bandwidth is freed in hardware by unconfiguring endpoint. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3b7149c7c32aa5f7c2a6c6b539fe40c2b4d95cf0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=3b7149c7c32aa5f7c2a6c6b539fe40c2b4d95cf0 commit 3b7149c7c32aa5f7c2a6c6b539fe40c2b4d95cf0 Author: Cheng, Huiming AuthorDate: 2022-12-15 22:30:11 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:16 +0000 xhci(4): Make sure allocated bandwidth is freed in hardware by unconfiguring endpoint. Sponsored by: NVIDIA Networking (cherry picked from commit 8685d7b5cb759b4f688dea93dbe1c38f9e833e4e) --- sys/dev/usb/controller/xhci.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index 17458e7d47dc..02a9a37fbd2d 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -4080,7 +4080,47 @@ xhci_ep_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc, static void xhci_ep_uninit(struct usb_device *udev, struct usb_endpoint *ep) { + struct xhci_softc *sc = XHCI_BUS2SC(udev->bus); + const struct usb_endpoint_descriptor *edesc = ep->edesc; + struct usb_page_search buf_inp; + struct usb_page_cache *pcinp; + uint32_t mask; + uint8_t index; + uint8_t epno; + usb_error_t err; + + if (udev->parent_hub == NULL) { + /* root HUB has special endpoint handling */ + return; + } + + if ((edesc->bEndpointAddress & UE_ADDR) == 0) { + /* control endpoint is never unconfigured */ + return; + } + XHCI_CMD_LOCK(sc); + index = udev->controller_slot_id; + epno = XHCI_EPNO2EPID(edesc->bEndpointAddress); + mask = 1U << epno; + + if (sc->sc_hw.devs[index].ep_configured & mask) { + USB_BUS_LOCK(udev->bus); + xhci_configure_mask(udev, mask, 1); + USB_BUS_UNLOCK(udev->bus); + + pcinp = &sc->sc_hw.devs[index].input_pc; + usbd_get_page(pcinp, 0, &buf_inp); + err = xhci_cmd_configure_ep(sc, buf_inp.physaddr, 0, index); + if (err) { + DPRINTF("Unconfiguring endpoint failed: %d\n", err); + } else { + USB_BUS_LOCK(udev->bus); + sc->sc_hw.devs[index].ep_configured &= ~mask; + USB_BUS_UNLOCK(udev->bus); + } + } + XHCI_CMD_UNLOCK(sc); } static void From nobody Sun Apr 30 06:57:52 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HGm4sfdz48s73; Sun, 30 Apr 2023 06:57: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 4Q8HGm2yYgz3Mml; Sun, 30 Apr 2023 06:57:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837872; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4FdCwYxypsW3WmSJkTe5eLLSJhdQFmYzHU7K0ajnHQA=; b=PUUaxVhuUzvuTVQPIio2sRLBH8IWrFl7fGlrAMhWDd+bV6A/PYgC/1CjAB/kp1xA4sl7Cw e1fVSMe7nyaXhJuL9SJDT+AAwV7p/KbQ83F2r5WUimu+ObdbMMzYH2zA8/I7nV0PX1MfUY wEPctK+3Xw5X5YVouzjWMUGUmqB4reQ6Ud5NMA4usSNQclnSuPUdTy+T+8IFGHaOy8+TD8 9aySeA/bBwGpxZFSxSfQrwAOM56uEvJFdB1g3h/Ah5uQnpO6ZSqDxJkLLVxXP51ODE4NWZ OHu9wjR3eJ52sW1xVHqY9KFroeaLbjy+2tNv5g20FlZdslCybnNZYs6r12dGIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837872; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4FdCwYxypsW3WmSJkTe5eLLSJhdQFmYzHU7K0ajnHQA=; b=YRMAFQgzEIwHlWlaC3wCLeJwklCfSGVMSC7sMg0IpV0lJwd40jwM7yodEyykRKae9kEh/n wahhLTTH4JY/jsW3+O41ZAmL5difuGhjZvVqZX5JPonRqqa6D+cGYJu86h4L2wg9RUVGVM 8xUYyOmERSWS1+SKMJzTq8IfGhx3dixGz+quUAuxShSkcePwrxzqROsxVU7GU947y60fzG oO30dIsp88U5gpQZZnpf/3Qg/hgzlEsEyueD01zRgp13+uuL15rIFZ2zr1FUjKPO5MPjnV XZFThvGO+J34KTME9YSZRuUedkjAR6Th2NR9Z7K2xcQ4953sedm1KYDo8xtaVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837872; a=rsa-sha256; cv=none; b=SEs+2Bf4gpQ/TKYkFIe9JZntSsctmpNCPQYTnsnuRBWXjijEe0cef4MpeLnZ7qkJcONn7a 2V01fADEbRx+qChY+HrA15iX2ZXxH/67+75KI2XyFI3pAlQCVWu1vjogeib04DlL8AGJIV 0O+Ff+6VGf1oPNPQBwAqTB4ZSlpT4FatbxLhCPkmwTiw5k025fFYr3dUvnZ+bG9u8ysyrW 3ode48SMDV0SnEdKFEVKFEf0VjbwUlKwh5TC9sYChIgmGfYpkc2hPD2DLfXnT9XQHSfJLe ioiKjm8mGN082Jv2xNC9hfZW+D82+H+qQmvjTqxloeDLfhAd05i9oxRSACixmA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HGm24dRzDsr; Sun, 30 Apr 2023 06:57: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 33U6vqiP071518; Sun, 30 Apr 2023 06:57:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6vqd3071517; Sun, 30 Apr 2023 06:57:52 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:57:52 GMT Message-Id: <202304300657.33U6vqd3071517@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: d4a8b3f7cf10 - stable/13 - usb: purge EOL release compatibility List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: d4a8b3f7cf101fa54385e0d3613a2fcd1be47090 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=d4a8b3f7cf101fa54385e0d3613a2fcd1be47090 commit d4a8b3f7cf101fa54385e0d3613a2fcd1be47090 Author: Elliott Mitchell AuthorDate: 2022-06-23 00:53:47 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:16 +0000 usb: purge EOL release compatibility Remove conditionsals for FreeBSD 6, 7, 8 and 9 compatibility. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/603 Differential Revision: https://reviews.freebsd.org/D35560 (cherry picked from commit 336fbb23def7a6b3dc44ce5c76bbc07a701c0a69) --- sys/dev/usb/controller/ehci_pci.c | 5 ----- sys/dev/usb/controller/ohci_pci.c | 5 ----- sys/dev/usb/controller/uhci_pci.c | 5 ----- sys/dev/usb/usb_busdma.h | 4 ---- sys/dev/usb/usb_dev.c | 5 ----- sys/dev/usb/usb_process.c | 21 --------------------- sys/dev/usb/usb_process.h | 4 ---- 7 files changed, 49 deletions(-) diff --git a/sys/dev/usb/controller/ehci_pci.c b/sys/dev/usb/controller/ehci_pci.c index 9018b2e4db40..98e2172e5e95 100644 --- a/sys/dev/usb/controller/ehci_pci.c +++ b/sys/dev/usb/controller/ehci_pci.c @@ -424,13 +424,8 @@ ehci_pci_attach(device_t self) sprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self)); } -#if (__FreeBSD_version >= 700031) err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, NULL, (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl); -#else - err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl); -#endif if (err) { device_printf(self, "Could not setup irq, %d\n", err); sc->sc_intr_hdl = NULL; diff --git a/sys/dev/usb/controller/ohci_pci.c b/sys/dev/usb/controller/ohci_pci.c index 8c3ee521b5b1..5a84f9bb529c 100644 --- a/sys/dev/usb/controller/ohci_pci.c +++ b/sys/dev/usb/controller/ohci_pci.c @@ -296,13 +296,8 @@ ohci_pci_attach(device_t self) /* sc->sc_bus.usbrev; set by ohci_init() */ -#if (__FreeBSD_version >= 700031) err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, NULL, (driver_intr_t *)ohci_interrupt, sc, &sc->sc_intr_hdl); -#else - err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - (driver_intr_t *)ohci_interrupt, sc, &sc->sc_intr_hdl); -#endif if (err) { device_printf(self, "Could not setup irq, %d\n", err); sc->sc_intr_hdl = NULL; diff --git a/sys/dev/usb/controller/uhci_pci.c b/sys/dev/usb/controller/uhci_pci.c index 07bc25b644e3..7cfd2c18d0d6 100644 --- a/sys/dev/usb/controller/uhci_pci.c +++ b/sys/dev/usb/controller/uhci_pci.c @@ -363,13 +363,8 @@ uhci_pci_attach(device_t self) break; } -#if (__FreeBSD_version >= 700031) err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, NULL, (driver_intr_t *)uhci_interrupt, sc, &sc->sc_intr_hdl); -#else - err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - (driver_intr_t *)uhci_interrupt, sc, &sc->sc_intr_hdl); -#endif if (err) { device_printf(self, "Could not setup irq, %d\n", err); diff --git a/sys/dev/usb/usb_busdma.h b/sys/dev/usb/usb_busdma.h index 2f60b30963d2..254694e1b21f 100644 --- a/sys/dev/usb/usb_busdma.h +++ b/sys/dev/usb/usb_busdma.h @@ -40,11 +40,7 @@ #define USB_PAGE_SIZE PAGE_SIZE /* use system PAGE_SIZE */ -#if (__FreeBSD_version >= 700020) #define USB_GET_DMA_TAG(dev) bus_get_dma_tag(dev) -#else -#define USB_GET_DMA_TAG(dev) NULL /* XXX */ -#endif /* structure prototypes */ diff --git a/sys/dev/usb/usb_dev.c b/sys/dev/usb/usb_dev.c index 4811d280562c..84446edc3ecd 100644 --- a/sys/dev/usb/usb_dev.c +++ b/sys/dev/usb/usb_dev.c @@ -96,12 +96,7 @@ SYSCTL_INT(_hw_usb_dev, OID_AUTO, debug, CTLFLAG_RWTUN, &usb_fifo_debug, 0, "Debug Level"); #endif -#if ((__FreeBSD_version >= 700001) || (__FreeBSD_version == 0) || \ - ((__FreeBSD_version >= 600034) && (__FreeBSD_version < 700000))) #define USB_UCRED struct ucred *ucred, -#else -#define USB_UCRED -#endif /* prototypes */ diff --git a/sys/dev/usb/usb_process.c b/sys/dev/usb/usb_process.c index 37495608a30d..33dbad1bf998 100644 --- a/sys/dev/usb/usb_process.c +++ b/sys/dev/usb/usb_process.c @@ -62,31 +62,14 @@ #include #endif /* USB_GLOBAL_INCLUDE_FILE */ -#if (__FreeBSD_version < 700000) -#define thread_lock(td) mtx_lock_spin(&sched_lock) -#define thread_unlock(td) mtx_unlock_spin(&sched_lock) -#endif - -#if (__FreeBSD_version >= 800000) static struct proc *usbproc; static int usb_pcount; #define USB_THREAD_CREATE(f, s, p, ...) \ kproc_kthread_add((f), (s), &usbproc, (p), RFHIGHPID, \ 0, "usb", __VA_ARGS__) -#if (__FreeBSD_version >= 900000) #define USB_THREAD_SUSPEND_CHECK() kthread_suspend_check() -#else -#define USB_THREAD_SUSPEND_CHECK() kthread_suspend_check(curthread) -#endif #define USB_THREAD_SUSPEND(p) kthread_suspend(p,0) #define USB_THREAD_EXIT(err) kthread_exit() -#else -#define USB_THREAD_CREATE(f, s, p, ...) \ - kthread_create((f), (s), (p), RFHIGHPID, 0, __VA_ARGS__) -#define USB_THREAD_SUSPEND_CHECK() kthread_suspend_check(curproc) -#define USB_THREAD_SUSPEND(p) kthread_suspend(p,0) -#define USB_THREAD_EXIT(err) kthread_exit(err) -#endif #ifdef USB_DEBUG static int usb_proc_debug; @@ -198,11 +181,9 @@ usb_process(void *arg) up->up_ptr = NULL; cv_signal(&up->up_cv); USB_MTX_UNLOCK(up->up_mtx); -#if (__FreeBSD_version >= 800000) /* Clear the proc pointer if this is the last thread. */ if (--usb_pcount == 0) usbproc = NULL; -#endif USB_THREAD_EXIT(0); } @@ -238,9 +219,7 @@ usb_proc_create(struct usb_process *up, struct mtx *p_mtx, up->up_ptr = NULL; goto error; } -#if (__FreeBSD_version >= 800000) usb_pcount++; -#endif return (0); error: diff --git a/sys/dev/usb/usb_process.h b/sys/dev/usb/usb_process.h index 7be78917b8f0..8a416a308856 100644 --- a/sys/dev/usb/usb_process.h +++ b/sys/dev/usb/usb_process.h @@ -57,11 +57,7 @@ struct usb_process { struct cv up_cv; struct cv up_drain; -#if (__FreeBSD_version >= 800000) struct thread *up_ptr; -#else - struct proc *up_ptr; -#endif struct thread *up_curtd; struct mtx *up_mtx; From nobody Sun Apr 30 06:57:53 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HGn4Kk8z48s7M; Sun, 30 Apr 2023 06:57:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q8HGn3kBpz3McC; Sun, 30 Apr 2023 06:57:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Tw4LJ1upylB6skDTNI84XPrWiL4++lKmnWpYCIl8d3s=; b=K50MMBl8IULIw6FTWL7gIAFfAo3rbx5DBfhv7uSzB5ktYXheZ++Wu1egvFfAQRR2qSF3qG 3LeYCSfDh6Ym+R3q1nVZhQH6lh6OCW4L5qMrU6veRPgmP7izxspJcdbHyQtalmjDF2REf8 wae7EFjY+XaRsmpIAtY0Cfx2d04ti9YY1QENSA6AI+Zo75ujTnGSUPei8ur47ZUiekqgn2 PID4nc0DXtD++/hXKMXcG7eK4MujkJLsfvWGx652XY3i7QMHh2ySzZvxhCyw6fj0WAXBuf NBwsGAJISsiymMuPxtk97Pl2T0c8Sy5LE5FIQNiKJugYt1HFFWrAOpHueVATLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Tw4LJ1upylB6skDTNI84XPrWiL4++lKmnWpYCIl8d3s=; b=Ig3YkWcKHUFpUe936qWwcK3zmskngPbH0r2NxuK6RKbuQRT+sHBFKi4MbsaFbhlkiZYMg2 LhRl4Vnf9mQ7J5G4SRcTWu592IUpgGcBao7v+aV0sIg9TaMnGsBvll/dRDv6DolesUrvKy gHlQwDQ0ynyc1VUj6gexn9asKlY+Ip7ePm1jfPZU3l5dPsiGnjbR4g8B/6U21TUvQp/fdQ 1CDBu/AX55RlZIBcxLa9JomixWacRG2pt1NdwGEU0vOz6Wonbzfb62grpGVyip6Z86638H Kh0I8F28E4qpOaEKzhYPkltK6suxME4mFfj+EcSVnkTETtZOBpQaO3E4zXqSkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837873; a=rsa-sha256; cv=none; b=r7uBCIpISx1b+dngXVGwdamc0oaSXvsXbyuHM3UIFZePNwwvQ7QXuBy/7+X3noQqIlH3AT 82P+sOC9hKJgZ2ryiHvB71K9NP6Nfnn08lOpk2/EKmfBIldc/3C/kVmKvF7NIFiP73ksDT x3LkCvNrzP1CHLXB11pq/+KQsx0om90Z751/QIowfVsV9I5+a6vaQkQJ6UYW0sWnY4RjAP 5nSQFis05D4yo6lwRK7bwOoifuqZ6LaFfyLCXWWag5eXJkyVxlX3TAoCUGNd2PNfyk84uW Uj9KxUaJzFW2lmij22IS3eo9/kDuxUGYFIOZPsYe7eiqCVlMNrk23/8ZDNf9eQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HGn2qrtzDg0; Sun, 30 Apr 2023 06:57:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33U6vrol071537; Sun, 30 Apr 2023 06:57:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6vr7r071536; Sun, 30 Apr 2023 06:57:53 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:57:53 GMT Message-Id: <202304300657.33U6vr7r071536@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 417b350048f5 - stable/13 - wmt: purge EOL release compatibility List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 417b350048f5934870e5b7405873887bf9af7741 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=417b350048f5934870e5b7405873887bf9af7741 commit 417b350048f5934870e5b7405873887bf9af7741 Author: Elliott Mitchell AuthorDate: 2022-06-23 00:53:47 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:16 +0000 wmt: purge EOL release compatibility Remove FreeBSD 11 support Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/603 Differential Revision: https://reviews.freebsd.org/D35560 (cherry picked from commit 5fa183351459996cfb86f8621de1a0e1bf985d67) --- sys/dev/usb/input/wmt.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/sys/dev/usb/input/wmt.c b/sys/dev/usb/input/wmt.c index 661fa622433f..c7ca2e46599e 100644 --- a/sys/dev/usb/input/wmt.c +++ b/sys/dev/usb/input/wmt.c @@ -261,22 +261,12 @@ static device_probe_t wmt_probe; static device_attach_t wmt_attach; static device_detach_t wmt_detach; -#if __FreeBSD_version >= 1200077 static evdev_open_t wmt_ev_open; static evdev_close_t wmt_ev_close; -#else -static evdev_open_t wmt_ev_open_11; -static evdev_close_t wmt_ev_close_11; -#endif static const struct evdev_methods wmt_evdev_methods = { -#if __FreeBSD_version >= 1200077 .ev_open = &wmt_ev_open, .ev_close = &wmt_ev_close, -#else - .ev_open = &wmt_ev_open_11, - .ev_close = &wmt_ev_close_11, -#endif }; static const struct usb_config wmt_config[WMT_N_TRANSFER] = { @@ -719,7 +709,6 @@ wmt_ev_open_11(struct evdev_dev *evdev, void *ev_softc) return (0); } -#if __FreeBSD_version >= 1200077 static int wmt_ev_close(struct evdev_dev *evdev) { @@ -738,7 +727,6 @@ wmt_ev_open(struct evdev_dev *evdev) return (wmt_ev_open_11(evdev, sc)); } -#endif static enum wmt_type wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr, uint16_t d_len) From nobody Sun Apr 30 06:57:54 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HGp5FKgz48sLl; Sun, 30 Apr 2023 06:57:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q8HGp4SWkz3MqM; Sun, 30 Apr 2023 06:57:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6QoMzT1rQuAR6PrLFqMqMiizP9XnbfxPXfKhDvaHqGA=; b=htkvv+86AUKjwkmLeqeFv8QWgrSuMhYXGmJgzjdYX931mys4SDU6PBFNkb4PzOJ0fXKNO1 wzMA9neyFlFEtS/38kGMXy4KMbpfbnvje+Lf59n/TZFR3H+/Rok6CiE65YwyLoGeAtFSDd Ddbwi1u5O8EtMZ4Jl1i4w98dgAhdJ8HRUe+MD4+gvW2WCBdhFmlnIRT9LtrXGqzJ77gVEK VS15wbV36u7G2ruYsiy/8oXRqN9jevmYXAdQSJN4A4wB1U6taZAmaFRSljlINrTQai8K+S vqx6qMzmFWq7ov8biGVCfM8yTXrnYPA2XgCJNKjITJKtvwooVT55v5eLGJ1xvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6QoMzT1rQuAR6PrLFqMqMiizP9XnbfxPXfKhDvaHqGA=; b=tl5ryp195kpJaGVDS/KhNR0HAImpY+84zo7kL6UagUMQyqvDCEKzwPGIyTGb8PAxNdR9yb iJstNdmMImGuLuS4AkEddjs3rZIeA0oizfiPM9H3ctg3PeEA+BpJQX3MGXTOYPOlBLMKx5 hAob8Z2eQbxplgegqbjPVhmh+rzAs8MpHLEA+h/QayFKMJ4KYjsmHLPS2bS3qb9Xb9y6c1 o89SrH5AqtPAZgRYPBPEDdoqbsNzZfN4DvPOe/9CpQJbdfdvlUSOjNZAJrrLfoPt4W+9ys 7CAygWJUqG3gGRltVKiVqLWxWrnPCxircoYI/OgXZ6iFRJJBwWl2Nw5wJs4RIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837874; a=rsa-sha256; cv=none; b=OH0ms/+DxQv9FmAQdubl2z2WE1bagvf2wGaU5kz63vZ2qhbcBuNvXSPBo9OMNBkyIoT/48 r9hCNdzrpLjpInkGwYfXudVDyYS0XaJmo329pxbN6PXo7gylP+a+sprKMSJ7/7i/0GU2m4 4CayVA4cTV/kJS9HTgqNuILNgYVy3ahiL3OTH24a6gB/doUdBFcIZ+Ug1gut2kCsrI9i9I h46Cy+rz41B+AkeB+Zgjs4cXN6RTzchIqyvXzmPMb/3y0/Kyf4BmsXlMKx3KlRSJkfD8sQ lyJjUu7JaJW0uijrf7+RL42EQ/isafwkkkEJWqGNtsSXPwo/M2qUcc3haNvxtw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HGp3P4pzDg1; Sun, 30 Apr 2023 06:57:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33U6vspC071561; Sun, 30 Apr 2023 06:57:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6vsKU071560; Sun, 30 Apr 2023 06:57:54 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:57:54 GMT Message-Id: <202304300657.33U6vsKU071560@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 4c57e83e7b6b - stable/13 - usb: dwc3: implement hw.usb.xhci.use_polling List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 4c57e83e7b6b4027546844daa3d81484f2b603a6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=4c57e83e7b6b4027546844daa3d81484f2b603a6 commit 4c57e83e7b6b4027546844daa3d81484f2b603a6 Author: Kyle Evans AuthorDate: 2023-02-28 01:59:43 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:17 +0000 usb: dwc3: implement hw.usb.xhci.use_polling Polling is currently only implemented in the xhci pci attachment. Adding it to dwc3 doesn't make it much uglier, and supporting it can be useful for confirming that hardware's otherwise functional when interrupts are apparently not firing. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D38816 (cherry picked from commit 5e54bb1ea9e904075225dc96641c2ede3fc3273c) --- sys/dev/usb/controller/dwc3.c | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/sys/dev/usb/controller/dwc3.c b/sys/dev/usb/controller/dwc3.c index d5e3b3f50a9d..b99d74625022 100644 --- a/sys/dev/usb/controller/dwc3.c +++ b/sys/dev/usb/controller/dwc3.c @@ -103,6 +103,17 @@ struct snps_dwc3_softc { #define IS_DMA_32B 1 +static void +xhci_interrupt_poll(void *_sc) +{ + struct xhci_softc *sc = _sc; + + USB_BUS_UNLOCK(&sc->sc_bus); + xhci_interrupt(sc); + USB_BUS_LOCK(&sc->sc_bus); + usb_callout_reset(&sc->sc_callout, 1, (void *)&xhci_interrupt_poll, sc); +} + static int snps_dwc3_attach_xhci(device_t dev) { @@ -133,12 +144,14 @@ snps_dwc3_attach_xhci(device_t dev) sprintf(sc->sc_vendor, "Synopsys"); device_set_desc(sc->sc_bus.bdev, "Synopsys"); - err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (driver_intr_t *)xhci_interrupt, sc, &sc->sc_intr_hdl); - if (err != 0) { - device_printf(dev, "Failed to setup IRQ, %d\n", err); - sc->sc_intr_hdl = NULL; - return (err); + if (xhci_use_polling() == 0) { + err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (driver_intr_t *)xhci_interrupt, sc, &sc->sc_intr_hdl); + if (err != 0) { + device_printf(dev, "Failed to setup IRQ, %d\n", err); + sc->sc_intr_hdl = NULL; + return (err); + } } err = xhci_init(sc, dev, IS_DMA_32B); @@ -147,6 +160,15 @@ snps_dwc3_attach_xhci(device_t dev) return (ENXIO); } + usb_callout_init_mtx(&sc->sc_callout, &sc->sc_bus.bus_mtx, 0); + + if (xhci_use_polling() != 0) { + device_printf(dev, "Interrupt polling at %dHz\n", hz); + USB_BUS_LOCK(&sc->sc_bus); + xhci_interrupt_poll(sc); + USB_BUS_UNLOCK(&sc->sc_bus); + } + err = xhci_start_controller(sc); if (err != 0) { device_printf(dev, "Failed to start XHCI controller, with error %d\n", err); From nobody Sun Apr 30 06:57:55 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HGr0p8Vz48sCh; Sun, 30 Apr 2023 06:57:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q8HGq4zhjz3Mls; Sun, 30 Apr 2023 06:57:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QKnPgZzvD/USMmkUj5JNo4yVcADaMK6C18A5UcePllc=; b=XBi3YJgUgwKzgqTdwg5kkrDaQVRjZ2WmNCAD6OdI/yJsdoQYi5v03HqxLpZdKZeBeixj6r /9jdf40Y4mOYA6kScO6YrOVl5nMlGKR9H+khkUBrDrsS7+0R0T1gvOg8LqPhRuQSYdtzNq ScKqsGzpjwMWqNheHXqVz2kXhBLHfIUj9QgEfYJBV+HcwOmUB6HMqaTp3By+9SyXULyI23 h5zNzfHMuGM8lRmr8fjEvQXJK9BAwMtORLC8yKi/HKShKHkULi0Zpgf8oiHF6bOBx3ZaGO wXC9uDHpR+3IlrUb0hWNnEvVqh0TpwMBujVeYsaWX/dVvhH5TyXmya+eGYJ7vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QKnPgZzvD/USMmkUj5JNo4yVcADaMK6C18A5UcePllc=; b=kov8gT5xGpQ+kKCViapovsAU7zJT8jaFy34fxObQ/RmnJSVUMLpCE/P7PB95jRymEqQV+8 rW1rp8sezYvjp8Gu/huwMjUwMK5LOvoKaMzN/+zAKvCTm3UkqTHnRw9RGT6aNVQCWgnAH2 rimmK+7XzWKzXaJmIx4ZMMX99nsKLzcET3M/7lGrsF9YhT/xVkrwIqY5zLKAjH+TxQ/0zX MrDxY/Bu9pSWh/yAlJOKBOcVGeq5QmN7ywIQ3b6N+z5Ib0kCmBmlyO/aE0Kof7CdGeFS25 JqnPTqVtEvbWz3+3AyzDeb/Ert87OZt8W0TlOkqwNVgdLNftAYQs3DC2ghxANQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837875; a=rsa-sha256; cv=none; b=Q6l7TKjxBo2cbrcqxP94+187buuDkUbqWnia/BhxSphPCIKeYRus8S7D8p3J0iSN6pIk5r y8hbALL0sMKP8/rbzBKVXSmDhVTnf0jUs9tzks8AByLUicJWYU0Ou6cnMGxYyADw4fOAVx jIdEHLlCiVdxNkYwqFDo1dU32NsN/qQr6q6zjoZnRFru5LcvXz7XDjCsxhmSn7Vgb7AjNl lmzM3xNUu5azmko1Q4HyrUEI9mTMbHeM5JXEytpxAJJ10pbQjQYBKIp9im4hM1S1nHs9kx WP+CDvhOo2EgcrYs5ItT7nj6iXXjTlXTVpTmxGuD/6cb0ENRb5bYFyWF1ZY9mg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HGq44Wnz1CgC; Sun, 30 Apr 2023 06:57:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33U6vtuY071581; Sun, 30 Apr 2023 06:57:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6vt6M071580; Sun, 30 Apr 2023 06:57:55 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:57:55 GMT Message-Id: <202304300657.33U6vt6M071580@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 633040b8e4df - stable/13 - usb: dwc3: add List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 633040b8e4df0ac8608620242c78134bbda8cf29 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=633040b8e4df0ac8608620242c78134bbda8cf29 commit 633040b8e4df0ac8608620242c78134bbda8cf29 Author: Joerg Wunsch AuthorDate: 2023-03-08 19:59:29 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:17 +0000 usb: dwc3: add Commit 5e54bb1ea9e90 added USB_BUS_LOCK/USB_BUS_UNLOCK. They, in consequence, require mutexes so is needed. (cherry picked from commit 175a584e501e19c90fd2241c505d1797de603a5c) --- sys/dev/usb/controller/dwc3.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/usb/controller/dwc3.c b/sys/dev/usb/controller/dwc3.c index b99d74625022..d9f576a3dbb7 100644 --- a/sys/dev/usb/controller/dwc3.c +++ b/sys/dev/usb/controller/dwc3.c @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef FDT #include #endif From nobody Sun Apr 30 06:57:56 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HGs1ZLwz48sGH; Sun, 30 Apr 2023 06:57: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 4Q8HGr673wz3Mhl; Sun, 30 Apr 2023 06:57:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qIfUeTJMpePat6BEJQ5ds6lMgR+fUVgs+03ntUnouNE=; b=gO0z/6pySYh2e3ZFOT227FWShG650M1BFBU7PzHAzr/B+7V0fBoU29Ls65oHTJVj3Numen v/Ji4iA2ho8ChTO1xJI1Y2J4jgmvOqMpYQm2P5xwP2ONRyNERmNUOuUL/SrEXXfA4ecUvP bSBumvvTyBnP1TCK1W6qFF3N9k1pTaJDlc1UgOhfL8UwflnEptPw6cwhY9lSGIlsHi2KtF whJCzZgapFJctLTqhkAnD3NbH2vK4e5TtpAMNgaSto5+/YqiX/ZLcGRklelw/nPRjRSGFN IWYbh9/Q620SLfOyRfop6K2XKRKcdApGjgrCO3M7SK8EAxm8ktBTCgIJXDMsMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837876; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qIfUeTJMpePat6BEJQ5ds6lMgR+fUVgs+03ntUnouNE=; b=NZmdRCiNlhywVb2ns5X9otQxhQk5fGdGQybSYa0VqYpvGBx970A2kAkSFMk0tg8EHkn4V5 9IGb0wR/SHLXXgkfVk1QTWO1MAN8IdBrbINyApDkJ3BuIFHrRFTPSCM4ApjdhecWr+coxb Av8lBnVePMVkAaj91ULTXxiGaenHg45rDWzXmBy6lt20jGHhiTsmsoqvNmx3VXA5p8EcWL +un7mJ5CC4A6t5Lua3ZOb1DOLIKQIjl8xiRlr87U0AWqCt87nVBcOj4zdxNngm0lioCZh5 4lRYztO3CDHdcVOLvOJrHWWTCtvkffSgePvYB1ku/z/H3UXctK/A4rJXCyqsWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837876; a=rsa-sha256; cv=none; b=RbD9miis/3bvSog2VRsDH+67h5L7HuwrRSJmzf1Qua1gnUP8/d3SkDSGSPRck+foJBp5Xk 1G2vGE6Mb2Ws3vtc5aYYYnc3VoIqsPyHr9YSWXWxkLMCeO5L/zedyIgMWCJcwillg2p7CF MB2KY7YPP0GgCPDI6hPSiAq7fdcDouJxuD3W2y20cq/SecfoEj7O1FCfjqKS5xaFJuX2J5 L3RmhuaLK0npXlaKNcbc6CdfYjeKJ8SUtD+HJjU6TtnUlsDBgkN5+0hn/Cwpn1jTJ7q7rk vfxZCTuvQ9SFCpyE2EL/2w1mZvhSCNWrDfXwyFzTKITMbypCKMhpHgvkqbaIUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HGr4jnwzDss; Sun, 30 Apr 2023 06:57: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 33U6vuKT071600; Sun, 30 Apr 2023 06:57:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6vuMS071599; Sun, 30 Apr 2023 06:57:56 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:57:56 GMT Message-Id: <202304300657.33U6vuMS071599@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: fd7c07771f82 - stable/13 - usb(4): Code refactoring as a pre-step for adding missing synchronization mechanism. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: fd7c07771f8292bf5151e53cce1c8d76298b6d56 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=fd7c07771f8292bf5151e53cce1c8d76298b6d56 commit fd7c07771f8292bf5151e53cce1c8d76298b6d56 Author: Hans Petter Selasky AuthorDate: 2023-04-04 15:15:38 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:17 +0000 usb(4): Code refactoring as a pre-step for adding missing synchronization mechanism. Move code in switch cases into own functions to make later changes easier to track. No functional change, except for removing a superfluous break statement when range checking USB_FS_MAX_FRAMES, in the USB_FS_OPEN case. It should not have been there at all. Suggested by: emaste@ Sponsored by: NVIDIA Networking (cherry picked from commit 03a2e432d5cc2eedb9304faea2b19051c84caecf) --- sys/dev/usb/usb_generic.c | 453 +++++++++++++++++++++++----------------------- 1 file changed, 226 insertions(+), 227 deletions(-) diff --git a/sys/dev/usb/usb_generic.c b/sys/dev/usb/usb_generic.c index fdbc35d47169..ad2f23eb9bfc 100644 --- a/sys/dev/usb/usb_generic.c +++ b/sys/dev/usb/usb_generic.c @@ -120,6 +120,7 @@ static int ugen_iface_ioctl(struct usb_fifo *, u_long, void *, int); static uint8_t ugen_fs_get_complete(struct usb_fifo *, uint8_t *); static int ugen_fs_uninit(struct usb_fifo *f); static int ugen_fs_copyin(struct usb_fifo *, uint8_t, struct usb_fs_endpoint*); +static uint8_t ugen_fifo_in_use(struct usb_fifo *, int fflags); /* structures */ @@ -959,6 +960,37 @@ ugen_re_enumerate(struct usb_fifo *f) return (0); } +static int +ugen_fs_init(struct usb_fifo *f, + struct usb_fs_endpoint *fs_ep_ptr, usb_size_t fs_ep_sz, + int fflags, uint8_t ep_index_max) +{ + int error; + + /* verify input parameters */ + if (fs_ep_ptr == NULL || ep_index_max > 127) + return (EINVAL); + + if (f->fs_xfer != NULL) + return (EBUSY); + + if (f->dev_ep_index != 0 || ep_index_max == 0) + return (EINVAL); + + if (ugen_fifo_in_use(f, fflags)) + return (EBUSY); + + error = usb_fifo_alloc_buffer(f, 1, ep_index_max); + if (error == 0) { + f->fs_xfer = malloc(sizeof(f->fs_xfer[0]) * + ep_index_max, M_USB, M_WAITOK | M_ZERO); + f->fs_ep_max = ep_index_max; + f->fs_ep_ptr = fs_ep_ptr; + f->fs_ep_sz = fs_ep_sz; + } + return (error); +} + int ugen_fs_uninit(struct usb_fifo *f) { @@ -975,6 +1007,157 @@ ugen_fs_uninit(struct usb_fifo *f) return (0); } +static int +usb_fs_open(struct usb_fifo *f, struct usb_fs_open *popen, + int fflags, usb_stream_t stream_id) +{ + struct usb_config usb_config[1] = {}; + struct usb_endpoint *ep; + struct usb_endpoint_descriptor *ed; + uint8_t iface_index; + uint8_t pre_scale; + uint8_t isread; + int error; + + if (popen->ep_index >= f->fs_ep_max) + return (EINVAL); + + if (f->fs_xfer[popen->ep_index] != NULL) + return (EBUSY); + + if (popen->max_bufsize > USB_FS_MAX_BUFSIZE) + popen->max_bufsize = USB_FS_MAX_BUFSIZE; + + if (popen->max_frames & USB_FS_MAX_FRAMES_PRE_SCALE) { + pre_scale = 1; + popen->max_frames &= ~USB_FS_MAX_FRAMES_PRE_SCALE; + } else { + pre_scale = 0; + } + + if (popen->max_frames > USB_FS_MAX_FRAMES) + popen->max_frames = USB_FS_MAX_FRAMES; + + if (popen->max_frames == 0) + return (EINVAL); + + ep = usbd_get_ep_by_addr(f->udev, popen->ep_no); + if (ep == NULL) + return (EINVAL); + + ed = ep->edesc; + if (ed == NULL) + return (ENXIO); + + iface_index = ep->iface_index; + + usb_config[0].type = ed->bmAttributes & UE_XFERTYPE; + usb_config[0].endpoint = ed->bEndpointAddress & UE_ADDR; + usb_config[0].direction = ed->bEndpointAddress & (UE_DIR_OUT | UE_DIR_IN); + usb_config[0].interval = USB_DEFAULT_INTERVAL; + usb_config[0].flags.proxy_buffer = 1; + if (pre_scale != 0) + usb_config[0].flags.pre_scale_frames = 1; + + usb_config[0].callback = &ugen_ctrl_fs_callback; + usb_config[0].timeout = 0; /* no timeout */ + usb_config[0].frames = popen->max_frames; + usb_config[0].bufsize = popen->max_bufsize; + usb_config[0].usb_mode = USB_MODE_DUAL; /* both modes */ + usb_config[0].stream_id = stream_id; + + if (usb_config[0].type == UE_CONTROL) { + if (f->udev->flags.usb_mode != USB_MODE_HOST) + return (EINVAL); + } else { + isread = ((usb_config[0].endpoint & + (UE_DIR_IN | UE_DIR_OUT)) == UE_DIR_IN); + + if (f->udev->flags.usb_mode != USB_MODE_HOST) + isread = !isread; + + /* check permissions */ + if (isread) { + if (!(fflags & FREAD)) + return (EPERM); + } else { + if (!(fflags & FWRITE)) + return (EPERM); + } + } + error = usbd_transfer_setup(f->udev, &iface_index, + f->fs_xfer + popen->ep_index, usb_config, 1, + f, f->priv_mtx); + if (error == 0) { + /* update maximums */ + popen->max_packet_length = + f->fs_xfer[popen->ep_index]->max_frame_size; + popen->max_bufsize = + f->fs_xfer[popen->ep_index]->max_data_length; + /* update number of frames */ + popen->max_frames = + f->fs_xfer[popen->ep_index]->nframes; + /* store index of endpoint */ + f->fs_xfer[popen->ep_index]->priv_fifo = + ((uint8_t *)0) + popen->ep_index; + } else { + error = ENOMEM; + } + return (error); +} + +static int +usb_fs_close(struct usb_fifo *f, struct usb_fs_close *pclose) +{ + if (pclose->ep_index >= f->fs_ep_max) + return (EINVAL); + + usbd_transfer_unsetup(f->fs_xfer + pclose->ep_index, 1); + return (0); +} + +static int +usb_fs_clear_stall_sync(struct usb_fifo *f, struct usb_fs_clear_stall_sync *pstall) +{ + struct usb_device_request req; + struct usb_endpoint *ep; + int error; + + if (pstall->ep_index >= f->fs_ep_max) + return (EINVAL); + + if (f->fs_xfer[pstall->ep_index] == NULL) + return (EINVAL); + + if (f->udev->flags.usb_mode != USB_MODE_HOST) + return (EINVAL); + + mtx_lock(f->priv_mtx); + error = usbd_transfer_pending(f->fs_xfer[pstall->ep_index]); + mtx_unlock(f->priv_mtx); + + if (error) + return (EBUSY); + + ep = f->fs_xfer[pstall->ep_index]->endpoint; + + /* setup a clear-stall packet */ + req.bmRequestType = UT_WRITE_ENDPOINT; + req.bRequest = UR_CLEAR_FEATURE; + USETW(req.wValue, UF_ENDPOINT_HALT); + req.wIndex[0] = ep->edesc->bEndpointAddress; + req.wIndex[1] = 0; + USETW(req.wLength, 0); + + error = usbd_do_request(f->udev, NULL, &req, NULL); + if (error == 0) { + usbd_clear_data_toggle(f->udev, ep); + } else { + error = ENXIO; + } + return (error); +} + static uint8_t ugen_fs_get_complete(struct usb_fifo *f, uint8_t *pindex) { @@ -1488,8 +1671,6 @@ ugen_fifo_in_use(struct usb_fifo *f, int fflags) static int ugen_ioctl(struct usb_fifo *f, u_long cmd, void *addr, int fflags) { - struct usb_config usb_config[1]; - struct usb_device_request req; union { struct usb_fs_complete *pcomp; struct usb_fs_start *pstart; @@ -1500,14 +1681,9 @@ ugen_ioctl(struct usb_fifo *f, u_long cmd, void *addr, int fflags) struct usb_fs_clear_stall_sync *pstall; void *addr; } u; - struct usb_endpoint *ep; - struct usb_endpoint_descriptor *ed; struct usb_xfer *xfer; - int error = 0; - uint8_t iface_index; - uint8_t isread; + int error; uint8_t ep_index; - uint8_t pre_scale; u.addr = addr; @@ -1519,44 +1695,45 @@ ugen_ioctl(struct usb_fifo *f, u_long cmd, void *addr, int fflags) error = ugen_fs_get_complete(f, &ep_index); mtx_unlock(f->priv_mtx); - if (error) { + if (error != 0) { error = EBUSY; - break; + } else { + u.pcomp->ep_index = ep_index; + error = ugen_fs_copy_out(f, u.pcomp->ep_index); } - u.pcomp->ep_index = ep_index; - error = ugen_fs_copy_out(f, u.pcomp->ep_index); break; case USB_FS_START: error = ugen_fs_copy_in(f, u.pstart->ep_index); - if (error) - break; - mtx_lock(f->priv_mtx); - xfer = f->fs_xfer[u.pstart->ep_index]; - usbd_transfer_start(xfer); - mtx_unlock(f->priv_mtx); + if (error == 0) { + mtx_lock(f->priv_mtx); + xfer = f->fs_xfer[u.pstart->ep_index]; + usbd_transfer_start(xfer); + mtx_unlock(f->priv_mtx); + } break; case USB_FS_STOP: + mtx_lock(f->priv_mtx); if (u.pstop->ep_index >= f->fs_ep_max) { error = EINVAL; - break; - } - mtx_lock(f->priv_mtx); - xfer = f->fs_xfer[u.pstart->ep_index]; - if (usbd_transfer_pending(xfer)) { - usbd_transfer_stop(xfer); - - /* - * Check if the USB transfer was stopped - * before it was even started and fake a - * cancel event. - */ - if (!xfer->flags_int.transferring && - !xfer->flags_int.started) { - DPRINTF("Issuing fake completion event\n"); - ugen_fs_set_complete(xfer->priv_sc, - USB_P2U(xfer->priv_fifo)); + } else { + error = 0; + xfer = f->fs_xfer[u.pstart->ep_index]; + if (usbd_transfer_pending(xfer)) { + usbd_transfer_stop(xfer); + + /* + * Check if the USB transfer was + * stopped before it was even started + * and fake a cancel event. + */ + if (!xfer->flags_int.transferring && + !xfer->flags_int.started) { + DPRINTF("Issuing fake completion event\n"); + ugen_fs_set_complete(xfer->priv_sc, + USB_P2U(xfer->priv_fifo)); + } } } mtx_unlock(f->priv_mtx); @@ -1564,153 +1741,16 @@ ugen_ioctl(struct usb_fifo *f, u_long cmd, void *addr, int fflags) case USB_FS_OPEN: case USB_FS_OPEN_STREAM: - if (u.popen->ep_index >= f->fs_ep_max) { - error = EINVAL; - break; - } - if (f->fs_xfer[u.popen->ep_index] != NULL) { - error = EBUSY; - break; - } - if (u.popen->max_bufsize > USB_FS_MAX_BUFSIZE) { - u.popen->max_bufsize = USB_FS_MAX_BUFSIZE; - } - if (u.popen->max_frames & USB_FS_MAX_FRAMES_PRE_SCALE) { - pre_scale = 1; - u.popen->max_frames &= ~USB_FS_MAX_FRAMES_PRE_SCALE; - } else { - pre_scale = 0; - } - if (u.popen->max_frames > USB_FS_MAX_FRAMES) { - u.popen->max_frames = USB_FS_MAX_FRAMES; - break; - } - if (u.popen->max_frames == 0) { - error = EINVAL; - break; - } - ep = usbd_get_ep_by_addr(f->udev, u.popen->ep_no); - if (ep == NULL) { - error = EINVAL; - break; - } - ed = ep->edesc; - if (ed == NULL) { - error = ENXIO; - break; - } - iface_index = ep->iface_index; - - memset(usb_config, 0, sizeof(usb_config)); - - usb_config[0].type = ed->bmAttributes & UE_XFERTYPE; - usb_config[0].endpoint = ed->bEndpointAddress & UE_ADDR; - usb_config[0].direction = ed->bEndpointAddress & (UE_DIR_OUT | UE_DIR_IN); - usb_config[0].interval = USB_DEFAULT_INTERVAL; - usb_config[0].flags.proxy_buffer = 1; - if (pre_scale != 0) - usb_config[0].flags.pre_scale_frames = 1; - usb_config[0].callback = &ugen_ctrl_fs_callback; - usb_config[0].timeout = 0; /* no timeout */ - usb_config[0].frames = u.popen->max_frames; - usb_config[0].bufsize = u.popen->max_bufsize; - usb_config[0].usb_mode = USB_MODE_DUAL; /* both modes */ - if (cmd == USB_FS_OPEN_STREAM) - usb_config[0].stream_id = u.popen_stream->stream_id; - - if (usb_config[0].type == UE_CONTROL) { - if (f->udev->flags.usb_mode != USB_MODE_HOST) { - error = EINVAL; - break; - } - } else { - isread = ((usb_config[0].endpoint & - (UE_DIR_IN | UE_DIR_OUT)) == UE_DIR_IN); - - if (f->udev->flags.usb_mode != USB_MODE_HOST) { - isread = !isread; - } - /* check permissions */ - if (isread) { - if (!(fflags & FREAD)) { - error = EPERM; - break; - } - } else { - if (!(fflags & FWRITE)) { - error = EPERM; - break; - } - } - } - error = usbd_transfer_setup(f->udev, &iface_index, - f->fs_xfer + u.popen->ep_index, usb_config, 1, - f, f->priv_mtx); - if (error == 0) { - /* update maximums */ - u.popen->max_packet_length = - f->fs_xfer[u.popen->ep_index]->max_frame_size; - u.popen->max_bufsize = - f->fs_xfer[u.popen->ep_index]->max_data_length; - /* update number of frames */ - u.popen->max_frames = - f->fs_xfer[u.popen->ep_index]->nframes; - /* store index of endpoint */ - f->fs_xfer[u.popen->ep_index]->priv_fifo = - ((uint8_t *)0) + u.popen->ep_index; - } else { - error = ENOMEM; - } + error = usb_fs_open(f, u.popen, fflags, + (cmd == USB_FS_OPEN_STREAM) ? u.popen_stream->stream_id : 0); break; case USB_FS_CLOSE: - if (u.pclose->ep_index >= f->fs_ep_max) { - error = EINVAL; - break; - } - if (f->fs_xfer[u.pclose->ep_index] == NULL) { - error = EINVAL; - break; - } - usbd_transfer_unsetup(f->fs_xfer + u.pclose->ep_index, 1); + error = usb_fs_close(f, u.pclose); break; case USB_FS_CLEAR_STALL_SYNC: - if (u.pstall->ep_index >= f->fs_ep_max) { - error = EINVAL; - break; - } - if (f->fs_xfer[u.pstall->ep_index] == NULL) { - error = EINVAL; - break; - } - if (f->udev->flags.usb_mode != USB_MODE_HOST) { - error = EINVAL; - break; - } - mtx_lock(f->priv_mtx); - error = usbd_transfer_pending(f->fs_xfer[u.pstall->ep_index]); - mtx_unlock(f->priv_mtx); - - if (error) { - return (EBUSY); - } - ep = f->fs_xfer[u.pstall->ep_index]->endpoint; - - /* setup a clear-stall packet */ - req.bmRequestType = UT_WRITE_ENDPOINT; - req.bRequest = UR_CLEAR_FEATURE; - USETW(req.wValue, UF_ENDPOINT_HALT); - req.wIndex[0] = ep->edesc->bEndpointAddress; - req.wIndex[1] = 0; - USETW(req.wLength, 0); - - error = usbd_do_request(f->udev, NULL, &req, NULL); - if (error == 0) { - usbd_clear_data_toggle(f->udev, ep); - } else { - error = ENXIO; - } + error = usb_fs_clear_stall_sync(f, u.pstall); break; default: @@ -2161,9 +2201,6 @@ ugen_iface_ioctl(struct usb_fifo *f, u_long cmd, void *addr, int fflags) static int ugen_ioctl_post(struct usb_fifo *f, u_long cmd, void *addr, int fflags) { -#ifdef COMPAT_FREEBSD32 - struct usb_fs_init local_pinit; -#endif union { struct usb_interface_descriptor *idesc; struct usb_alt_interface *ai; @@ -2183,7 +2220,6 @@ ugen_ioctl_post(struct usb_fifo *f, u_long cmd, void *addr, int fflags) struct usb_device_descriptor *dtemp; struct usb_config_descriptor *ctemp; struct usb_interface *iface; - size_t usb_fs_endpoint_sz = sizeof(struct usb_fs_endpoint); int error = 0; uint8_t n; @@ -2191,18 +2227,6 @@ ugen_ioctl_post(struct usb_fifo *f, u_long cmd, void *addr, int fflags) DPRINTFN(6, "cmd=0x%08lx\n", cmd); -#ifdef COMPAT_FREEBSD32 - switch (cmd) { - case USB_FS_INIT32: - PTRIN_CP(*u.pinit32, local_pinit, pEndpoints); - CP(*u.pinit32, local_pinit, ep_index_max); - u.addr = &local_pinit; - cmd = _IOC_NEWTYPE(USB_FS_INIT, struct usb_fs_init); - usb_fs_endpoint_sz = sizeof(struct usb_fs_endpoint32); - break; - } -#endif - switch (cmd) { case USB_DISCOVER: usb_needs_explore_all(); @@ -2397,42 +2421,17 @@ ugen_ioctl_post(struct usb_fifo *f, u_long cmd, void *addr, int fflags) break; case USB_FS_INIT: - /* verify input parameters */ - if (u.pinit->pEndpoints == NULL) { - error = EINVAL; - break; - } - if (u.pinit->ep_index_max > 127) { - error = EINVAL; - break; - } - if (u.pinit->ep_index_max == 0) { - error = EINVAL; - break; - } - if (f->fs_xfer != NULL) { - error = EBUSY; - break; - } - if (f->dev_ep_index != 0) { - error = EINVAL; - break; - } - if (ugen_fifo_in_use(f, fflags)) { - error = EBUSY; - break; - } - error = usb_fifo_alloc_buffer(f, 1, u.pinit->ep_index_max); - if (error) { - break; - } - f->fs_xfer = malloc(sizeof(f->fs_xfer[0]) * - u.pinit->ep_index_max, M_USB, M_WAITOK | M_ZERO); - f->fs_ep_max = u.pinit->ep_index_max; - f->fs_ep_ptr = u.pinit->pEndpoints; - f->fs_ep_sz = usb_fs_endpoint_sz; + error = ugen_fs_init(f, u.pinit->pEndpoints, + sizeof(struct usb_fs_endpoint), fflags, + u.pinit->ep_index_max); break; - +#ifdef COMPAT_FREEBSD32 + case USB_FS_INIT32: + error = ugen_fs_init(f, PTRIN(u.pinit32->pEndpoints), + sizeof(struct usb_fs_endpoint32), fflags, + u.pinit32->ep_index_max); + break; +#endif case USB_FS_UNINIT: if (u.puninit->dummy != 0) { error = EINVAL; From nobody Sun Apr 30 06:57:57 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HGt33Rmz48sPH; Sun, 30 Apr 2023 06:57:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q8HGt2BXKz3N0F; Sun, 30 Apr 2023 06:57:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dgMx89R7KsbczKy1oXDScLUmJWDT0JoVEDBgBpQNZPg=; b=N5dfzPlaBRi4tRacuwH2ilBlLb7ZfujhoQWtUPy8eE/lf9HipwdPHyqybq7ojA9URbigEH 2qu7CjU83O9OPv1aEDU7HXMwwLI7I6eZLcXCoChNvhq8NcGQwFqgUBVcFZ+nMov38w5KAD rh4X8M0Ycpc+LKdAh01kEI4w8ib3niVkLJzWhVqVAO1+yHu8MFn0XFfot7iFGNsCqVT+GR 4s0u65m6ItvDGh077Md0/2vfR48U04sUw42zSceRkthyjZr27jeI3h5QaoY6hofPwaTHSi cT5hodtvE6cUqPBJSUVvggxDPo3fSRAqLjqcU8AfN4vbMnRPIVmdk6uOxxKI/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837878; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dgMx89R7KsbczKy1oXDScLUmJWDT0JoVEDBgBpQNZPg=; b=LN1gYJKm1187TyxJ5fiVXxi4coEdyqu47EYEw+IP0RryEVIch3lsvzGUWHmA1bArjrlfeg Xxh1ywRyWmqZ83e/1vFZkw7kg+ibfpj1t3uoHTDYzvOHwnkn0UbBTwE5bvjoYGVAEvUV6t 3VwQ0mjYLVSrSTffdcb+NuDwntPnvZzu1sJ1D5aNyzhoofD5BZYpnRax9P/yi/4XcA3LZM HmeQi0v6IxBmZm0fw7mhEPgX7q/J09Oj1V+c370js+JSwE3ExIUmgJg2lg3vyE3F6cJjjM u1/5TRS2/vafJ7fyG01aA4SEa3m7nvhh+hEjVZSgIunHYsKu97T9t875VygBXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837878; a=rsa-sha256; cv=none; b=iFjSvTR3c6tWNyH7eI1iOCQMI2GzHP3ZisRhb1u50MZZwx7IKlKF36ajbAHmDCP9XWecup 7m643p2FQsebZqC+/kN0sh/A6sl/Xt/4Ihe4UKqm7aXLdRwBusoDYyZp8yGwc2+tFgX2RP +GHvY60I/PgsVk++o8E14ZOrn2rmzNG+dw1gsJ/2VVYzYSFNSM0LgOxiCVa+12nNKBMFSg NGIyO64oXfESuGAmUnWPg7xOJlh39HYbuhpZwspk21TGhD6rg1rNWW3VQwxClCHw7egBij AWhmPAu+vbvKD+WStavHlDXlsJ8UYYMNESKPmDDDqRiT4q/pPobk/4c2torWwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HGs5g2Hz1Crg; Sun, 30 Apr 2023 06:57: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 33U6vvL2071619; Sun, 30 Apr 2023 06:57:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6vval071618; Sun, 30 Apr 2023 06:57:57 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:57:57 GMT Message-Id: <202304300657.33U6vval071618@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 53e253c7e57f - stable/13 - usb(4): Separate the fast path and the slow path to avoid races and use-after-free for the USB FS interface. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 53e253c7e57f4a0a0632fca933277e509e04543c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=53e253c7e57f4a0a0632fca933277e509e04543c commit 53e253c7e57f4a0a0632fca933277e509e04543c Author: Hans Petter Selasky AuthorDate: 2023-03-31 17:14:18 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:17 +0000 usb(4): Separate the fast path and the slow path to avoid races and use-after-free for the USB FS interface. Bad behaving user-space USB applicatoins may crash the kernel by issuing USB FS related ioctl(2)'s out of their expected order. By default the USB FS ioctl(2) interface is only available to the administrator, root, and driver applications like webcamd(8) needs to be hijacked in order for this to happen. The issue is the fast-path code does not always see updates made by the slow-path code, and may then work on freed memory. This is easily fixed by using an EPOCH(9) type of synchronization mechanism. A SX(9) lock will be used as a substitute for EPOCH(9), due to the need for sleepability. In addition most calls going into the fast-path originate from a single user-space process and the need for multi-thread performance is not present. Differential Revision: https://reviews.freebsd.org/D39373 Reviewed by: markj@ Reported by: C Turt admbugs: 994 Sponsored by: NVIDIA Networking (cherry picked from commit 9b077d72bcc313baea2b9283afc7f568739eaadc) --- sys/dev/usb/usb_dev.c | 4 +- sys/dev/usb/usb_dev.h | 6 ++- sys/dev/usb/usb_device.c | 6 +-- sys/dev/usb/usb_generic.c | 105 ++++++++++++++++++++++++++++++---------------- 4 files changed, 80 insertions(+), 41 deletions(-) diff --git a/sys/dev/usb/usb_dev.c b/sys/dev/usb/usb_dev.c index 84446edc3ecd..5f06b1b9690e 100644 --- a/sys/dev/usb/usb_dev.c +++ b/sys/dev/usb/usb_dev.c @@ -2,7 +2,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2006-2008 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2006-2023 Hans Petter Selasky * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -386,6 +386,7 @@ usb_fifo_alloc(struct mtx *mtx) f = malloc(sizeof(*f), M_USBDEV, M_WAITOK | M_ZERO); cv_init(&f->cv_io, "FIFO-IO"); cv_init(&f->cv_drain, "FIFO-DRAIN"); + sx_init(&f->fs_fastpath_lock, "FIFO-FP"); f->priv_mtx = mtx; f->refcount = 1; knlist_init_mtx(&f->selinfo.si_note, mtx); @@ -626,6 +627,7 @@ usb_fifo_free(struct usb_fifo *f) cv_destroy(&f->cv_io); cv_destroy(&f->cv_drain); + sx_destroy(&f->fs_fastpath_lock); knlist_clear(&f->selinfo.si_note, 0); seldrain(&f->selinfo); diff --git a/sys/dev/usb/usb_dev.h b/sys/dev/usb/usb_dev.h index 1bdfa46d064f..8df3af9990cf 100644 --- a/sys/dev/usb/usb_dev.h +++ b/sys/dev/usb/usb_dev.h @@ -2,7 +2,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2008-2023 Hans Petter Selasky * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -110,13 +110,15 @@ struct usb_fifo { struct selinfo selinfo; struct cv cv_io; struct cv cv_drain; + struct sx fs_fastpath_lock; struct usb_fifo_methods *methods; struct usb_symlink *symlink[2];/* our symlinks */ struct proc *async_p; /* process that wants SIGIO */ struct usb_fs_endpoint *fs_ep_ptr; struct usb_device *udev; +#define USB_FS_XFER_MAX 126 struct usb_xfer *xfer[2]; - struct usb_xfer **fs_xfer; + struct usb_xfer *fs_xfer[USB_FS_XFER_MAX]; struct mtx *priv_mtx; /* client data */ /* set if FIFO is opened by a FILE: */ struct usb_cdev_privdata *curr_cpd; diff --git a/sys/dev/usb/usb_device.c b/sys/dev/usb/usb_device.c index 392d969587c0..820cb21c704d 100644 --- a/sys/dev/usb/usb_device.c +++ b/sys/dev/usb/usb_device.c @@ -2,7 +2,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2008-2020 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2008-2023 Hans Petter Selasky * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -2829,7 +2829,7 @@ usb_fifo_free_wrap(struct usb_device *udev, continue; } if ((f->dev_ep_index == 0) && - (f->fs_xfer == NULL)) { + (f->fs_ep_max == 0)) { /* no need to free this FIFO */ continue; } @@ -2837,7 +2837,7 @@ usb_fifo_free_wrap(struct usb_device *udev, if ((f->methods == &usb_ugen_methods) && (f->dev_ep_index == 0) && (!(flag & USB_UNCFG_FLAG_FREE_EP0)) && - (f->fs_xfer == NULL)) { + (f->fs_ep_max == 0)) { /* no need to free this FIFO */ continue; } diff --git a/sys/dev/usb/usb_generic.c b/sys/dev/usb/usb_generic.c index ad2f23eb9bfc..640f9fdb7ad6 100644 --- a/sys/dev/usb/usb_generic.c +++ b/sys/dev/usb/usb_generic.c @@ -2,7 +2,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2008-2022 Hans Petter Selasky + * Copyright (c) 2008-2023 Hans Petter Selasky * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -968,10 +968,10 @@ ugen_fs_init(struct usb_fifo *f, int error; /* verify input parameters */ - if (fs_ep_ptr == NULL || ep_index_max > 127) + if (fs_ep_ptr == NULL || ep_index_max > USB_FS_XFER_MAX) return (EINVAL); - if (f->fs_xfer != NULL) + if (f->fs_ep_max != 0) return (EBUSY); if (f->dev_ep_index != 0 || ep_index_max == 0) @@ -982,11 +982,11 @@ ugen_fs_init(struct usb_fifo *f, error = usb_fifo_alloc_buffer(f, 1, ep_index_max); if (error == 0) { - f->fs_xfer = malloc(sizeof(f->fs_xfer[0]) * - ep_index_max, M_USB, M_WAITOK | M_ZERO); + mtx_lock(f->priv_mtx); f->fs_ep_max = ep_index_max; f->fs_ep_ptr = fs_ep_ptr; f->fs_ep_sz = fs_ep_sz; + mtx_unlock(f->priv_mtx); } return (error); } @@ -994,15 +994,26 @@ ugen_fs_init(struct usb_fifo *f, int ugen_fs_uninit(struct usb_fifo *f) { - if (f->fs_xfer == NULL) { + if (f->fs_ep_max == 0) return (EINVAL); - } - usbd_transfer_unsetup(f->fs_xfer, f->fs_ep_max); - free(f->fs_xfer, M_USB); - f->fs_xfer = NULL; + + /* + * Prevent calls into the fast-path code, by setting fs_ep_max + * to zero: + */ + sx_xlock(&f->fs_fastpath_lock); + mtx_lock(f->priv_mtx); f->fs_ep_max = 0; + mtx_unlock(f->priv_mtx); + sx_xunlock(&f->fs_fastpath_lock); + + usbd_transfer_unsetup(f->fs_xfer, USB_FS_XFER_MAX); + + mtx_lock(f->priv_mtx); f->fs_ep_ptr = NULL; f->flag_iscomplete = 0; + mtx_unlock(f->priv_mtx); + usb_fifo_free_buffer(f); return (0); } @@ -1109,10 +1120,26 @@ usb_fs_open(struct usb_fifo *f, struct usb_fs_open *popen, static int usb_fs_close(struct usb_fifo *f, struct usb_fs_close *pclose) { + struct usb_xfer *xfer; + if (pclose->ep_index >= f->fs_ep_max) return (EINVAL); - usbd_transfer_unsetup(f->fs_xfer + pclose->ep_index, 1); + /* + * Prevent calls into the fast-path code, by setting the + * fs_xfer[] in question to NULL: + */ + sx_xlock(&f->fs_fastpath_lock); + mtx_lock(f->priv_mtx); + xfer = f->fs_xfer[pclose->ep_index]; + f->fs_xfer[pclose->ep_index] = NULL; + mtx_unlock(f->priv_mtx); + sx_xunlock(&f->fs_fastpath_lock); + + if (xfer == NULL) + return (EINVAL); + + usbd_transfer_unsetup(&xfer, 1); return (0); } @@ -1249,14 +1276,16 @@ ugen_fs_copy_in(struct usb_fifo *f, uint8_t ep_index) int error; uint8_t isread; + mtx_lock(f->priv_mtx); if (ep_index >= f->fs_ep_max) { + mtx_unlock(f->priv_mtx); return (EINVAL); } xfer = f->fs_xfer[ep_index]; if (xfer == NULL) { + mtx_unlock(f->priv_mtx); return (EINVAL); } - mtx_lock(f->priv_mtx); if (usbd_transfer_pending(xfer)) { mtx_unlock(f->priv_mtx); return (EBUSY); /* should not happen */ @@ -1529,14 +1558,16 @@ ugen_fs_copy_out(struct usb_fifo *f, uint8_t ep_index) int error; uint8_t isread; - if (ep_index >= f->fs_ep_max) + mtx_lock(f->priv_mtx); + if (ep_index >= f->fs_ep_max) { + mtx_unlock(f->priv_mtx); return (EINVAL); - + } xfer = f->fs_xfer[ep_index]; - if (xfer == NULL) + if (xfer == NULL) { + mtx_unlock(f->priv_mtx); return (EINVAL); - - mtx_lock(f->priv_mtx); + } if (!xfer->flags_int.transferring && !xfer->flags_int.started) { mtx_unlock(f->priv_mtx); @@ -1675,10 +1706,6 @@ ugen_ioctl(struct usb_fifo *f, u_long cmd, void *addr, int fflags) struct usb_fs_complete *pcomp; struct usb_fs_start *pstart; struct usb_fs_stop *pstop; - struct usb_fs_open *popen; - struct usb_fs_open_stream *popen_stream; - struct usb_fs_close *pclose; - struct usb_fs_clear_stall_sync *pstall; void *addr; } u; struct usb_xfer *xfer; @@ -1691,6 +1718,7 @@ ugen_ioctl(struct usb_fifo *f, u_long cmd, void *addr, int fflags) switch (cmd) { case USB_FS_COMPLETE: + sx_slock(&f->fs_fastpath_lock); mtx_lock(f->priv_mtx); error = ugen_fs_get_complete(f, &ep_index); mtx_unlock(f->priv_mtx); @@ -1701,9 +1729,11 @@ ugen_ioctl(struct usb_fifo *f, u_long cmd, void *addr, int fflags) u.pcomp->ep_index = ep_index; error = ugen_fs_copy_out(f, u.pcomp->ep_index); } + sx_sunlock(&f->fs_fastpath_lock); break; case USB_FS_START: + sx_slock(&f->fs_fastpath_lock); error = ugen_fs_copy_in(f, u.pstart->ep_index); if (error == 0) { mtx_lock(f->priv_mtx); @@ -1711,6 +1741,7 @@ ugen_ioctl(struct usb_fifo *f, u_long cmd, void *addr, int fflags) usbd_transfer_start(xfer); mtx_unlock(f->priv_mtx); } + sx_sunlock(&f->fs_fastpath_lock); break; case USB_FS_STOP: @@ -1739,20 +1770,6 @@ ugen_ioctl(struct usb_fifo *f, u_long cmd, void *addr, int fflags) mtx_unlock(f->priv_mtx); break; - case USB_FS_OPEN: - case USB_FS_OPEN_STREAM: - error = usb_fs_open(f, u.popen, fflags, - (cmd == USB_FS_OPEN_STREAM) ? u.popen_stream->stream_id : 0); - break; - - case USB_FS_CLOSE: - error = usb_fs_close(f, u.pclose); - break; - - case USB_FS_CLEAR_STALL_SYNC: - error = usb_fs_clear_stall_sync(f, u.pstall); - break; - default: error = ENOIOCTL; break; @@ -2212,6 +2229,10 @@ ugen_ioctl_post(struct usb_fifo *f, u_long cmd, void *addr, int fflags) struct usb_fs_init32 *pinit32; #endif struct usb_fs_uninit *puninit; + struct usb_fs_open *popen; + struct usb_fs_open_stream *popen_stream; + struct usb_fs_close *pclose; + struct usb_fs_clear_stall_sync *pstall; struct usb_device_port_path *dpp; uint32_t *ptime; void *addr; @@ -2440,6 +2461,20 @@ ugen_ioctl_post(struct usb_fifo *f, u_long cmd, void *addr, int fflags) error = ugen_fs_uninit(f); break; + case USB_FS_OPEN: + case USB_FS_OPEN_STREAM: + error = usb_fs_open(f, u.popen, fflags, + (cmd == USB_FS_OPEN_STREAM) ? u.popen_stream->stream_id : 0); + break; + + case USB_FS_CLOSE: + error = usb_fs_close(f, u.pclose); + break; + + case USB_FS_CLEAR_STALL_SYNC: + error = usb_fs_clear_stall_sync(f, u.pstall); + break; + default: mtx_lock(f->priv_mtx); error = ugen_iface_ioctl(f, cmd, addr, fflags); From nobody Sun Apr 30 06:57:58 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HGv2147z48s80; Sun, 30 Apr 2023 06:57: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 4Q8HGv0krfz3N0h; Sun, 30 Apr 2023 06:57:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kCdrNrLOBpTGMXIDEsxhBq1MZ1edAcflDoQ9cz3c1Qc=; b=OdsrrbO4gX8WPRRFsBfUqmOs+9umChd0aHtWFL1hYsPHNJyfF0l7DI3r5PXwWK2wPsVuR/ U4+9GdxFW7NaP2gEM3PAJR+aQkIHf0WLXf0l35F/MUW66FJv6X/EiiENoI9tA0k6n44rB8 dMoe7Y0I7v+jVgj8NxqOxUveksafb2rYs1HPhJU2qsPMLtGeGa5c/NjGYculoXNr5Xmmzp DNoPTqQRpnLgTUilcPLNafoQFeHFsrJpGsqpFu93sr4TcSmF/zvn8g1+2FXZl6GPjyZ/XH AQlbh7Y70a0nf3E9Lf1JnnJPRA8Qjqnjjqmg6x34N2bTik/TEwk//LOuf5KH4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kCdrNrLOBpTGMXIDEsxhBq1MZ1edAcflDoQ9cz3c1Qc=; b=oSdmP+hn4NQ4bq9vsXKBQywMtYtPjlmHj6u+ctxVkCQT28OaHqD0ItnI3lz07+2SrhOhR5 i8qX0d0HjzGc0AIO3Kwkcu7tXSg5fv3hL0RA0KFEyGIYONdgC3+z6QDVngMC02l7ma+kIr zKwVtIP2CUJA6OPxlr0Hl4q9hlTMeARw5iFX9YEoEZJZS4v/mpXWbAGynTx2MDopag6pIp 6KIQnLRReI0zWG18d8z7G5ZcUuIjJd/B1+0YDg0+FKro0P0EpRji0/L6jRbcVrOEA2Tx1C CFdqUJSf695L8Gt+RpxeDVUgKroqfoPByd5Qecpn2wocSreIZDkDLECBVTYsEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837879; a=rsa-sha256; cv=none; b=xj75LnIrQy3AiT39IcrFwuJMgys+tqpDZJIoqT3mdrlAsxkrh6E0/ix4/b2Y1EXEpnS1Yp Wd5UHmbTAjJyFkZmOe/weLZWh0i9JO/vgFdQQ3821QXJyx995QvRDoQ36BwEFBibbm3Rg/ M1LhJqBApF+wZkPRCZYHmjNB6M8Ocrj5lVtCRfAV2qcE8wViFOKglSfanCtRoSuU8eEuP8 fHtqxKTwoJZP6hkxJVjaQfavP6bjaIJtGEbUQx0D3QQ8VpCRlCwTrIvioY1iShhCHUZc19 Cft11lywtDvZOyx1zoi8fyq67obq6xUz5pcrKnjxAGTJQ8vbjd8I3y56543XnQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HGt6f77z1Crh; Sun, 30 Apr 2023 06:57: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 33U6vw9d071638; Sun, 30 Apr 2023 06:57:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6vwEK071637; Sun, 30 Apr 2023 06:57:58 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:57:58 GMT Message-Id: <202304300657.33U6vwEK071637@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 631723ed9788 - stable/13 - if_mos: Remove set but unused variable. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 631723ed978867814e20715914f46e76040bd0e6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=631723ed978867814e20715914f46e76040bd0e6 commit 631723ed978867814e20715914f46e76040bd0e6 Author: John Baldwin AuthorDate: 2023-04-10 17:35:48 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:17 +0000 if_mos: Remove set but unused variable. Reviewed by: hselasky Reported by: GCC Differential Revision: https://reviews.freebsd.org/D39356 (cherry picked from commit 5328efb3d0a54df20779d82319c3eebd49aa2993) --- sys/dev/usb/net/if_mos.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/dev/usb/net/if_mos.c b/sys/dev/usb/net/if_mos.c index d8f9cefedee9..3448e13bc254 100644 --- a/sys/dev/usb/net/if_mos.c +++ b/sys/dev/usb/net/if_mos.c @@ -426,11 +426,8 @@ static int mos_miibus_readreg(device_t dev, int phy, int reg) { struct mos_softc *sc = device_get_softc(dev); - uWord val; int i, res, locked; - USETW(val, 0); - locked = mtx_owned(&sc->sc_mtx); if (!locked) MOS_LOCK(sc); From nobody Sun Apr 30 06:57:59 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HGw1wgFz48sM4; Sun, 30 Apr 2023 06:58:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q8HGw1Pzjz3MxL; Sun, 30 Apr 2023 06:58:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZBbCeGu0fiPmLBBpE38X8NDtH4FIUAv9iPJfIXQCpyw=; b=N5jz+/cFKlnq09+K07oYomtEcdaOqji/vd1ZgEwwcK2b3LEwDUIiuhJhKT/7QPuI/ji1H2 tTeuYoJwdh10VMzcWYz3JHBvMGDEKvllPWLL6awZZh7c5pF3w7ls9mKtE3G5fEo9f1xGvP jdVNLkFhX5Wx6iR9lQVsCVlSGqw4vkfOAEcAZJXYFwmo1xN8VBgHf+qw+tUKL2/+PSaGjJ hg9XL+y7fO1ykRq17UYCiBXrKLMQvp+Pck46Prj91XSxXgKXRIAjjACv50QtoAljja6LmM Tj15WfsCHCdBvRFefBTRPyRlwlLF3b63hkY3t+68q68bcQQP6G+uPDDPnfI55Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZBbCeGu0fiPmLBBpE38X8NDtH4FIUAv9iPJfIXQCpyw=; b=TWbnVoV/sEN0gpaKQHIOInW2ckhJa3TA/T+P0tJfHjR8ONhwIb+vbexgcChAZUO8yG+WTZ o8jETWvfhk2PuyOUMFb991qDJvjdCstjvftwmDiE2vBgxWkpRsswAcoXRW7AuYdwASLquq a5tbD8wJWId/BFPQ8xO+fhAyi34c8JYPcD5DE7H4IWf5wJYsaVu1ZI/LgoHxqzf0DWKXUu 9BwT/VdWPfTOASUUqnvpHcLdXlSTT2xB1jN6zw+uFpjvZucy9UFAj6mKiyS/L65r3KZokc z7mdPcrT6Zn2xqnXj1AlfuySevjNBbJclNS9QLSXdoXZA2Gl/oeE0Dn2ejBXvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837880; a=rsa-sha256; cv=none; b=Tr+enZZmoPyIg4uF851fKUWufclJcSAxuEjSWqsO9PHA+Vo8se2lFGVYs9r81F2wVVadlx OpBTrL+vHZlbxKKK8qe/p6Ry7e/oWZ05waWokdp+GrWJt5eIO+xMyLiZI2ZSVT3Y6LSRNK z2/aB5AQ0crYgMpMTUiiwg8hr/fpCdlY9M0bCSlvcbyKfcvAYLGiZg8q/Ya3wsn9qr21c4 XnWb6DFXjD9Ba1YOzxb856YWZMu265qmpoMHpSYdb8PniSdcNLp5fojHvQVXaoundiDAv1 kMjHdO+Rlmkd6aZXHcd7dkHIBY3o9Awy4jPTytJePgWOf5C9mPRVIapo7ZIXsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HGw0LQgzDst; Sun, 30 Apr 2023 06:58:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33U6vxeE071660; Sun, 30 Apr 2023 06:57:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6vxi4071659; Sun, 30 Apr 2023 06:57:59 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:57:59 GMT Message-Id: <202304300657.33U6vxi4071659@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: f560d0ead126 - stable/13 - bcm5974(4): add Magic Trackpad 2 (USB only) support List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: f560d0ead1266dd33bdfa4ce803e70b87c285cfe Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=f560d0ead1266dd33bdfa4ce803e70b87c285cfe commit f560d0ead1266dd33bdfa4ce803e70b87c285cfe Author: Val Packett AuthorDate: 2023-04-25 09:20:53 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:17 +0000 bcm5974(4): add Magic Trackpad 2 (USB only) support The MT2 uses a compact report format, but otherwise is similar in many ways to the internal trackpads, it even uses the same mode switching commands. Reviewed by: wulf Differential revision: https://reviews.freebsd.org/D34437 (cherry picked from commit ef8397c28e981e0115d435aabcf57cee7ea5f5ee) --- sys/dev/hid/bcm5974.c | 86 +++++++++++++++++++++++++++++++++++++++++++++++++-- sys/dev/usb/usbdevs | 1 + 2 files changed, 84 insertions(+), 3 deletions(-) diff --git a/sys/dev/hid/bcm5974.c b/sys/dev/hid/bcm5974.c index d92c1c5c43b5..223ed01e8312 100644 --- a/sys/dev/hid/bcm5974.c +++ b/sys/dev/hid/bcm5974.c @@ -114,11 +114,13 @@ enum tp_type { TYPE2, /* button integrated in trackpad */ TYPE3, /* additional header fields since June 2013 */ TYPE4, /* additional header field for pressure data */ + TYPE_MT2U, /* Magic Trackpad 2 USB */ TYPE_CNT }; /* list of device capability bits */ #define HAS_INTEGRATED_BUTTON 1 +#define USES_COMPACT_REPORT 2 struct tp_type_params { uint8_t caps; /* device capability bitmask */ @@ -150,6 +152,36 @@ struct tp_type_params { .offset = 23 * 2, .delta = 2, }, + [TYPE_MT2U] = { + .caps = HAS_INTEGRATED_BUTTON | USES_COMPACT_REPORT, + .button = 1, + .offset = 12, + .delta = 0, + }, +}; + +/* trackpad finger structure - compact version for external "Magic" devices */ +struct tp_finger_compact { + uint32_t coords; /* not struct directly due to endian conversion */ + uint8_t touch_major; + uint8_t touch_minor; + uint8_t size; + uint8_t pressure; + unsigned int orientation: 3; + unsigned int _unknown1: 1; + unsigned int id: 4; +} __packed; + +_Static_assert((sizeof(struct tp_finger_compact) == 9), "tp_finger struct size must be 9"); + +union tp_finger_compact_coords { + uint32_t num; + struct { + signed int x: 13; + signed int y: 13; + signed int _unknown: 4; + signed int state: 2; + } __packed; }; /* trackpad finger structure - little endian */ @@ -189,6 +221,7 @@ enum { BCM5974_FLAG_WELLSPRING7A, BCM5974_FLAG_WELLSPRING8, BCM5974_FLAG_WELLSPRING9, + BCM5974_FLAG_MAGIC_TRACKPAD2_USB, BCM5974_FLAG_MAX, }; @@ -334,6 +367,15 @@ static const struct bcm5974_dev_params bcm5974_dev_params[BCM5974_FLAG_MAX] = { .o = { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION, 0 }, }, + [BCM5974_FLAG_MAGIC_TRACKPAD2_USB] = { + .tp = tp + TYPE_MT2U, + .p = { SN_PRESSURE, 0, 256, 256 }, + .w = { SN_WIDTH, 0, 2048, 0 }, + .x = { SN_COORD, -3678, 3934, 48 }, + .y = { SN_COORD, -2478, 2587, 44 }, + .o = { SN_ORIENT, + -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION, 0 }, + }, }; #define BCM5974_DEV(v,p,i) { \ @@ -407,6 +449,9 @@ static const struct hid_device_id bcm5974_devs[] = { BCM5974_DEV(APPLE, WELLSPRING9_ANSI, BCM5974_FLAG_WELLSPRING9), BCM5974_DEV(APPLE, WELLSPRING9_ISO, BCM5974_FLAG_WELLSPRING9), BCM5974_DEV(APPLE, WELLSPRING9_JIS, BCM5974_FLAG_WELLSPRING9), + + /* External "Magic" devices */ + BCM5974_DEV(APPLE, MAGIC_TRACKPAD2, BCM5974_FLAG_MAGIC_TRACKPAD2_USB), }; struct bcm5974_softc { @@ -541,6 +586,7 @@ bcm5974_set_device_mode(struct bcm5974_softc *sc, bool on) case TYPE3: /* Type 3 does not require a mode switch */ break; case TYPE4: + case TYPE_MT2U: err = bcm5974_set_device_mode_hid(sc, on); break; default: @@ -624,8 +670,10 @@ bcm5974_attach(device_t dev) BCM5974_ABS(sc->sc_evdev, ABS_MT_TOUCH_MAJOR, sc->sc_params->w); BCM5974_ABS(sc->sc_evdev, ABS_MT_TOUCH_MINOR, sc->sc_params->w); /* finger approach area */ - BCM5974_ABS(sc->sc_evdev, ABS_MT_WIDTH_MAJOR, sc->sc_params->w); - BCM5974_ABS(sc->sc_evdev, ABS_MT_WIDTH_MINOR, sc->sc_params->w); + if ((sc->sc_params->tp->caps & USES_COMPACT_REPORT) == 0) { + BCM5974_ABS(sc->sc_evdev, ABS_MT_WIDTH_MAJOR, sc->sc_params->w); + BCM5974_ABS(sc->sc_evdev, ABS_MT_WIDTH_MINOR, sc->sc_params->w); + } /* finger orientation */ BCM5974_ABS(sc->sc_evdev, ABS_MT_ORIENTATION, sc->sc_params->o); /* button properties */ @@ -637,7 +685,8 @@ bcm5974_attach(device_t dev) 0, MAX_FINGERS - 1, 0, 0, 0); evdev_support_abs(sc->sc_evdev, ABS_MT_TRACKING_ID, -1, MAX_FINGERS - 1, 0, 0, 0); - evdev_set_flag(sc->sc_evdev, EVDEV_FLAG_MT_TRACK); + if ((sc->sc_params->tp->caps & USES_COMPACT_REPORT) == 0) + evdev_set_flag(sc->sc_evdev, EVDEV_FLAG_MT_TRACK); evdev_set_flag(sc->sc_evdev, EVDEV_FLAG_MT_AUTOREL); /* Synaptics compatibility events */ evdev_set_flag(sc->sc_evdev, EVDEV_FLAG_MT_STCOMPAT); @@ -672,12 +721,17 @@ bcm5974_intr(void *context, void *data, hid_size_t len) const struct bcm5974_dev_params *params = sc->sc_params; union evdev_mt_slot slot_data; struct tp_finger *f; + struct tp_finger_compact *fc; + union tp_finger_compact_coords coords; int ntouch; /* the finger number in touch */ int ibt; /* button status */ int i; int slot; uint8_t fsize = sizeof(struct tp_finger) + params->tp->delta; + if ((params->tp->caps & USES_COMPACT_REPORT) != 0) + fsize = sizeof(struct tp_finger_compact) + params->tp->delta; + if ((len < params->tp->offset + fsize) || ((len - params->tp->offset) % fsize) != 0) { DPRINTFN(BCM5974_LLEVEL_INFO, "Invalid length: %d, %x, %x\n", @@ -689,6 +743,32 @@ bcm5974_intr(void *context, void *data, hid_size_t len) ntouch = (len - params->tp->offset) / fsize; for (i = 0, slot = 0; i != ntouch; i++) { + if ((params->tp->caps & USES_COMPACT_REPORT) != 0) { + fc = (struct tp_finger_compact *)(((uint8_t *)data) + + params->tp->offset + params->tp->delta + i * fsize); + coords.num = le32toh(fc->coords); + DPRINTFN(BCM5974_LLEVEL_INFO, + "[%d]ibt=%d, taps=%d, x=%5d, y=%5d, state=%4d, " + "tchmaj=%4d, tchmin=%4d, size=%4d, pressure=%4d, " + "ot=%4x, id=%4x\n", + i, ibt, ntouch, coords.x, coords.y, + fc->state, fc->touch_major, fc->touch_minor, fc->size, + fc->pressure, fc->orientation, fc->id); + if (fc->touch_major == 0) + continue; + slot_data = (union evdev_mt_slot) { + .id = fc->id, + .x = coords.x, + .y = params->y.min + params->y.max - coords.y, + .p = fc->pressure, + .maj = fc->touch_major << 2, + .min = fc->touch_minor << 2, + .ori = -fc->orientation, + }; + evdev_mt_push_slot(sc->sc_evdev, slot, &slot_data); + slot++; + continue; + } f = (struct tp_finger *)(((uint8_t *)data) + params->tp->offset + params->tp->delta + i * fsize); DPRINTFN(BCM5974_LLEVEL_INFO, diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 0368ec25e6e1..fb282568935f 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -1193,6 +1193,7 @@ product APPLE WELLSPRING8_JIS 0x0292 Apple Internal Keyboard/Trackpad product APPLE WELLSPRING9_ANSI 0x0272 Apple Internal Keyboard/Trackpad product APPLE WELLSPRING9_ISO 0x0273 Apple Internal Keyboard/Trackpad product APPLE WELLSPRING9_JIS 0x0274 Apple Internal Keyboard/Trackpad +product APPLE MAGIC_TRACKPAD2 0x0265 Apple Magic Trackpad 2 product APPLE MOUSE 0x0301 Mouse M4848 product APPLE OPTMOUSE 0x0302 Optical mouse product APPLE MIGHTYMOUSE 0x0304 Mighty Mouse From nobody Sun Apr 30 06:58:01 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HGx3mMWz48sDB; Sun, 30 Apr 2023 06:58: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 4Q8HGx24lvz3NCY; Sun, 30 Apr 2023 06:58:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wsRj2+2Ve8Hiw1ZvpCBOSxnoL8g9rMZBTO2v/JGtycE=; b=LKvS8KSsLunJSmvEjZXG/YSX0KPZ5hTmjtjRSOOCIKrtWqrbCyLJA4TNuldP0d8tFZkC8O HMr8rrQIqdTVmcPXeuGza/Uf6Te14/8WoFItOvvppYj1Exp06hFy8S9ylxBn4F+JJICB91 4P73GVTBUFHwyZH/E9zh1hVkg4EXtyAqsW3/vS4PDB6BegVIZWU/tN3rNaPbAdd8ojuPpd xUKoc5z60/8GvPnSTcCycwlvX+sqoQc9pf5x++itY4PRgsbpoh/CPq2yGV4Ui00/x43wIY wp5cXAuHo4DEsYL1FhfsvRUte4BV7yX767mPzqWknqmAIN5q/0t4y5E+uKqrAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wsRj2+2Ve8Hiw1ZvpCBOSxnoL8g9rMZBTO2v/JGtycE=; b=rRO6OeMkM7TXBmMgOhWW4uTEvwhVUoZ1g22ubhIu/OU/121edOxn7mJUJMom+Px9wsVbB7 FkYh1Yf92OXCG7nCQ/T18+XGSFqlNWc36c+1OC9LcapNIGHMlFTFTod533l99Av1k9i9D4 100/ObLbXK+OITaIUT63tZuzx7K9aSRGoZlmnS0UPUwjztm2GBif15uvfgTBJGd5dlQ4z3 tNB0CVqK7hPEuWgUE2JG1pVccOm1YCaJb46Q0Nx+Xq+/joEZTr/n1xFN59MeAJuiK85xsx vVaxSZJ9/TrtZtU3Ur4bzpt3KaxFPxaK0VYUbDzSd9nPzhoWVX10QE7wrE8gPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837881; a=rsa-sha256; cv=none; b=aGrvtQwyPFiskwReR7BE79sdnnGBYtYDehmVTTs+35ilrXtRd43r680dYFvdRohXoaT8l0 +1q5kHJleJiYBb8q2OBcKOJCapW+vNmgfYmZ9QZB027c5Px+fOwakWuvQWySicwA/j+ogp aJW7ec0hn+1oJ9pcLKEIm74eIxkdxwgdrzF1lnh0RnzNGD5PuXv4bhtjZQhd1/LBN2g242 wyp7KeUN0fp8XJ0PWBtzyf+4icjzxGUtFLGrtKDFCGwRzd4welfoojfQMW5dD3OIJZjukn 4SbDj9EFqKOqyAhkBlHHur1ftpDdlc9ATsyGJDAh9RHlW1PQ69of6i5Ym51Rxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HGx1B1pz1Ccd; Sun, 30 Apr 2023 06:58: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 33U6w1Ua071682; Sun, 30 Apr 2023 06:58:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6w1vm071681; Sun, 30 Apr 2023 06:58:01 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:58:01 GMT Message-Id: <202304300658.33U6w1vm071681@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 6e21ac722620 - stable/13 - Get clocks for Rockchip RK3568. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6e21ac7226209fc44b880440d090e3918e830c71 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=6e21ac7226209fc44b880440d090e3918e830c71 commit 6e21ac7226209fc44b880440d090e3918e830c71 Author: Søren Schmidt AuthorDate: 2022-12-20 08:53:58 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:17 +0000 Get clocks for Rockchip RK3568. (cherry picked from commit 1d8c07b7ab7bc123ec62e97176beffef4052eba8) --- sys/dev/usb/controller/dwc3.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/controller/dwc3.c b/sys/dev/usb/controller/dwc3.c index d9f576a3dbb7..2f607e19248d 100644 --- a/sys/dev/usb/controller/dwc3.c +++ b/sys/dev/usb/controller/dwc3.c @@ -451,7 +451,8 @@ snps_dwc3_common_attach(device_t dev, bool is_fdt) node = ofw_bus_get_node(dev); /* Get the clocks if any */ - if (ofw_bus_is_compatible(dev, "rockchip,rk3328-dwc3") == 1) { + if (ofw_bus_is_compatible(dev, "rockchip,rk3328-dwc3") == 1 || + ofw_bus_is_compatible(dev, "rockchip,rk3568-dwc3") == 1) { if (clk_get_by_ofw_name(dev, node, "ref_clk", &sc->clk_ref) != 0) device_printf(dev, "Cannot get ref_clk\n"); if (clk_get_by_ofw_name(dev, node, "suspend_clk", &sc->clk_suspend) != 0) From nobody Sun Apr 30 06:58:02 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HGy47VWz48sDL; Sun, 30 Apr 2023 06:58: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 4Q8HGy2sVZz3N3m; Sun, 30 Apr 2023 06:58:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HVprLkdEcw7w1zyvMJLrzqbEErn7SGSY3b7+du38nbc=; b=tTCdiSJ0Q8gRt3kIqVwwSSXUUgSijvpRdYEJL+Hi+ug2GYo62Sn2aCCse6miP2SZUTV36C 048lISieiI80f3310JEQ5p9I2d7dkp7lsGvDxQ1vqyoTtzBLzE/IJqu5G3v0SHSvfHmkyp l+pkNlsfN1V1yAlFFHPpe+pIv847q7W7jVwpY6OqZCruKRRdmi51K6uC0CwvCrxLD5uyPN nYSMiZbhmqUGffod7V8RaCfznCM/ThxZe8EAl/qwIjscGvFOI8MrQV9tTL7BPb/IsU/gpl dj8EbFegQk0B2+qKVKFS4wyQHVFsMAfdaiKZ+EEObAL9t/AHcjO4pY3G4c5aHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HVprLkdEcw7w1zyvMJLrzqbEErn7SGSY3b7+du38nbc=; b=AZcFZ0+86/9eKKRzVSl5aeT5Q2qYwXel1tHuwwwO/klp94c87I7z7yfo4zp1NqM3J7dyGN jJCO7bav4PvFWoB2jV1R1nqCIJTaeNzuQD8qN8BJXqUX8CIsFTx1IkVPK11reCdUAwbgHo xvGc/W/nJKdxba6WWOHvSNXx/OUdtB5AJFMc9SNOC3/k+NNFMoraQV08lS0hJ1MtlCEuxK YydumIKloZnVgskWShkdxX6OAj/nl7WVqRoi6NF46UT8vDrZaZx9k5CE9Z4NvHjm+Id1Q5 nEZFo2+Sjbtj/smsMUxSDui0TDPByrYxDOVB+4ts7I/GzKh0ZXQadl2nyI0WSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837882; a=rsa-sha256; cv=none; b=DSneL06pnTbEmaeqVmMvFenf7sZQRvegzwbd4WasGGvNnW4b0NjQd0AJqM2s6KHKnNAM7A 28HQEzkxM67dQ9b3BLMTfCLLOoZhXDCYUyPrCw3hH5TKHPgGvOFToYI8eACGUIjEUJQs4/ daaxOMJ37jDEPbX+xo3S/0ReOYtt/QNPeugnozjdjzruB22LFXuFtJ8kRad4ELGiVcn9e+ Lu/4+eORhVe2vfdMwug+s+7bbiPoQJoilkSXBVpQkiNkWTZJVoUlwP8HbYOIC6mU8WuDx1 JHHfdysJ+fRLXiU2Xor4huEeG8hV2fhJzpv5KGwr96L/Wa9P+1l8P0ZlnTYMcw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HGy1ySlzDg2; Sun, 30 Apr 2023 06:58: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 33U6w2MG071701; Sun, 30 Apr 2023 06:58:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6w2G1071700; Sun, 30 Apr 2023 06:58:02 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:58:02 GMT Message-Id: <202304300658.33U6w2G1071700@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 0e81f07f3653 - stable/13 - USB: adjust the Generic XHCI ACPI probe return value List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 0e81f07f36533b47da917a98e3c4d7c2308adf08 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=0e81f07f36533b47da917a98e3c4d7c2308adf08 commit 0e81f07f36533b47da917a98e3c4d7c2308adf08 Author: Bjoern A. Zeeb AuthorDate: 2021-10-01 13:37:01 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:17 +0000 USB: adjust the Generic XHCI ACPI probe return value Change the probe return value from BUS_PROBE_DEFAULT to BUS_PROBE_GENERIC given this is the "generic" attach method. This allows individual drivers using XHCI generic but needing their own intialisation to gain priority for attaching over the generic implementation. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D32257 (cherry picked from commit 76f3b8cb640536de2c370cc2bd60382bbc35cf5d) --- sys/dev/usb/controller/generic_xhci_acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/usb/controller/generic_xhci_acpi.c b/sys/dev/usb/controller/generic_xhci_acpi.c index aa96c3f40fee..09add23de5af 100644 --- a/sys/dev/usb/controller/generic_xhci_acpi.c +++ b/sys/dev/usb/controller/generic_xhci_acpi.c @@ -67,7 +67,7 @@ generic_xhci_acpi_probe(device_t dev) device_set_desc(dev, XHCI_HC_DEVSTR); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_GENERIC); } static device_method_t xhci_acpi_methods[] = { From nobody Sun Apr 30 06:58:03 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HGz4bmJz48sJl; Sun, 30 Apr 2023 06:58: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 4Q8HGz44Hdz3NGZ; Sun, 30 Apr 2023 06:58:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QgtLJzkCoWfews1PoNW6+xMAgU9Y/bS+8+yiTARrrnU=; b=iwiFlWc+OtVjHDyQ5E5wTGPuXbjVlnm1RI5k2RDpVPthQWRdnoKA5Ak3tVoGwsrg+Wb0JZ 1GZLrJIsZu61r4OY1WEXyYxT0Y5yKysaIdWqOgRW+PByvTj5GVTL3k8iPBetC2gMNV8WpU jwXnlO+8++x4eC1yNUjo0wUvtgWg2SpKPH3mWdfDFUcR6IBrEzu2tdN5g9eDC3OVpzO59+ 8SuWO4mb62ND2cT320wy4YwcEKh/albldPp3UN6EbtKTLVL2t+FJ/p/zdXBRlqx1fkJKIs zp4xCh1SxC7XgfHrSIrkOOPJ1qAOs830uSXDttO+cuv2B6SpVS8smMZ8wH2f6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QgtLJzkCoWfews1PoNW6+xMAgU9Y/bS+8+yiTARrrnU=; b=pePJfTGCZIRl4Ycd9FsTDNjkb7N0TAWV5mXHxtNt2nZffRKQtpSoHmUobWWF0cAkkiHWd8 mLRhmZvdUhiuvm3Utl8OQmXB6gl70BLHjpo49Xj9fu7udTg8xJnRJkS5fwkoxLFXLcm7O/ aRwDfhz0VNJ+72G2e/Z3fMKNIBhdEvkkAYLKcjP5GWIU4h+jOKffarNMSJIRlPnWc5mWTN UF+m3/43PfC22f8/3XeJQ9cjh2SWaugJqadQibp2/d836WgCxYK/meeM1AMs09hmoNsNOM eNL+Y2cf8ObHbAh3guczjCW8gzJ1IvfBwXdW0qyx6M99uWZoloxuKE8RewpFDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837883; a=rsa-sha256; cv=none; b=bNFiKORvR3O27pC9VZsOrB4rHI3kEYqVaRbjAbwlp8JdFI3ZuOIcdjinRD+UQyoO6zj6ng 0YNH0SSAC7a6NU/rkxuzcPNBhBq2HaleyqG3QDOrjgyZGVofvcPX331eA/ctCHYNNiwZpZ 3alL+/0Vehb/BKtn3pHn0PcBEkBW7CxH725MO4lgJF4N8q/DwX43qtPZhzanonxExXBZUN mw8lTzyK9rildMTAict8pTqIp3G0NWQKjp4m2ReVjgZyML33zO/i4B2DJEB7QUBF5O/FDg wgcWcAyvldvoveCYUYKhSNr80qL2SiAA5PRzuyFQkkaE9HQUkkK5Oq9S43Bm9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HGz2lwHzDsv; Sun, 30 Apr 2023 06:58: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 33U6w3sr071720; Sun, 30 Apr 2023 06:58:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6w3Jx071719; Sun, 30 Apr 2023 06:58:03 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:58:03 GMT Message-Id: <202304300658.33U6w3Jx071719@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: decbf52b0b52 - stable/13 - xhci: Rework 64-byte context support to avoid pointer abuse List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: decbf52b0b52bf84415a5960561db834c87740bf Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=decbf52b0b52bf84415a5960561db834c87740bf commit decbf52b0b52bf84415a5960561db834c87740bf Author: Jessica Clarke AuthorDate: 2021-10-24 18:48:46 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:18 +0000 xhci: Rework 64-byte context support to avoid pointer abuse Currently, to support 64-byte contexts, xhci_ctx_[gs]et_le(32|64) take a pointer to the field within a 32-byte context and, if 64-byte contexts are in use, compute where the 64-byte context field is and use that instead by deriving a pointer from the 32-byte field pointer. This is done by exploiting a combination of 64-byte contexts being the same layout as their 32-byte counterparts, just with 32 bytes of padding at the end, and that all individual contexts are either in a device context or an input context which itself is page-aligned. By masking out the low 4 bits (which is the offset of the field within the 32-byte contxt) of the offset within the page, the offset of the invididual context within the containing device/input context can be determined, which is itself 32 times the number of preceding contexts. Thus, adding this value to the pointer again gets 64 times the number of preceding contexts plus the field offset, which gives the offset of the 64-byte context plus the field offset, which is the address of the field in the 64-byte context. However, this involves a fair amount of lying to the compiler when constructing these intermediate pointers, and is rather difficult to reason about. In particular, this is problematic for CHERI, where we compile the kernel with subobject bounds enabled; that is, unless annotated to opt out (e.g. for C struct inheritance reasons where you need to be able to downcast, or containerof idioms), a pointer to a member of a struct is a capability whose bounds only cover that field, and any attempt to dereference outside those bounds will fault, protecting against intra-object buffer overflows. Thus the pointer given to xhci_ctx_[gs]et_le(32|64) is a capability whose bounds only cover the field in the 32-byte context, and computing the pointer to the 64-byte context field takes the address out of bounds, resulting in a fault when later dereferenced. This can be cleaned up by using a different abstraction. Instead of doing the 32-byte to 64-byte conversion on access to the field, we can do the conversion when getting a pointer to the context itself, and define proper 64-byte versions of contexts in order to let the compiler do all the necessary arithmetic rather than do it manually ourselves. This provides a cleaner implementation, works for CHERI and may even be slightly more performant as it avoids the need to mess with masking pointers (which cannot in the general case be optimised by compilers to be reused across accesses to different fields within the same context, since it does not know that the contexts are over-aligned compared with the C ABI requirements). Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D32554 (cherry picked from commit 29863d1effe20da3cc75ae10bd52d96edafe9e59) --- sys/dev/usb/controller/xhci.c | 160 +++++++++++++++--------------------------- sys/dev/usb/controller/xhci.h | 26 +++++++ 2 files changed, 81 insertions(+), 105 deletions(-) diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index 02a9a37fbd2d..e28529ca003d 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -88,6 +88,11 @@ #define XHCI_BUS2SC(bus) \ __containerof(bus, struct xhci_softc, sc_bus) +#define XHCI_GET_CTX(sc, which, field, ptr) \ + ((sc)->sc_ctx_is_64_byte ? \ + &((struct which##64 *)(ptr))->field.ctx : \ + &((struct which *)(ptr))->field) + static SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "USB XHCI"); @@ -167,12 +172,6 @@ static usb_error_t xhci_configure_mask(struct usb_device *, static usb_error_t xhci_cmd_evaluate_ctx(struct xhci_softc *, uint64_t, uint8_t); static void xhci_endpoint_doorbell(struct usb_xfer *); -static void xhci_ctx_set_le32(struct xhci_softc *sc, volatile uint32_t *ptr, uint32_t val); -static uint32_t xhci_ctx_get_le32(struct xhci_softc *sc, volatile uint32_t *ptr); -static void xhci_ctx_set_le64(struct xhci_softc *sc, volatile uint64_t *ptr, uint64_t val); -#ifdef USB_DEBUG -static uint64_t xhci_ctx_get_le64(struct xhci_softc *sc, volatile uint64_t *ptr); -#endif static const struct usb_bus_methods xhci_bus_methods; @@ -187,26 +186,26 @@ xhci_dump_trb(struct xhci_trb *trb) } static void -xhci_dump_endpoint(struct xhci_softc *sc, struct xhci_endp_ctx *pep) +xhci_dump_endpoint(struct xhci_endp_ctx *pep) { DPRINTFN(5, "pep = %p\n", pep); - DPRINTFN(5, "dwEpCtx0=0x%08x\n", xhci_ctx_get_le32(sc, &pep->dwEpCtx0)); - DPRINTFN(5, "dwEpCtx1=0x%08x\n", xhci_ctx_get_le32(sc, &pep->dwEpCtx1)); - DPRINTFN(5, "qwEpCtx2=0x%016llx\n", (long long)xhci_ctx_get_le64(sc, &pep->qwEpCtx2)); - DPRINTFN(5, "dwEpCtx4=0x%08x\n", xhci_ctx_get_le32(sc, &pep->dwEpCtx4)); - DPRINTFN(5, "dwEpCtx5=0x%08x\n", xhci_ctx_get_le32(sc, &pep->dwEpCtx5)); - DPRINTFN(5, "dwEpCtx6=0x%08x\n", xhci_ctx_get_le32(sc, &pep->dwEpCtx6)); - DPRINTFN(5, "dwEpCtx7=0x%08x\n", xhci_ctx_get_le32(sc, &pep->dwEpCtx7)); + DPRINTFN(5, "dwEpCtx0=0x%08x\n", le32toh(pep->dwEpCtx0)); + DPRINTFN(5, "dwEpCtx1=0x%08x\n", le32toh(pep->dwEpCtx1)); + DPRINTFN(5, "qwEpCtx2=0x%016llx\n", (long long)le64toh(pep->qwEpCtx2)); + DPRINTFN(5, "dwEpCtx4=0x%08x\n", le32toh(pep->dwEpCtx4)); + DPRINTFN(5, "dwEpCtx5=0x%08x\n", le32toh(pep->dwEpCtx5)); + DPRINTFN(5, "dwEpCtx6=0x%08x\n", le32toh(pep->dwEpCtx6)); + DPRINTFN(5, "dwEpCtx7=0x%08x\n", le32toh(pep->dwEpCtx7)); } static void -xhci_dump_device(struct xhci_softc *sc, struct xhci_slot_ctx *psl) +xhci_dump_device(struct xhci_slot_ctx *psl) { DPRINTFN(5, "psl = %p\n", psl); - DPRINTFN(5, "dwSctx0=0x%08x\n", xhci_ctx_get_le32(sc, &psl->dwSctx0)); - DPRINTFN(5, "dwSctx1=0x%08x\n", xhci_ctx_get_le32(sc, &psl->dwSctx1)); - DPRINTFN(5, "dwSctx2=0x%08x\n", xhci_ctx_get_le32(sc, &psl->dwSctx2)); - DPRINTFN(5, "dwSctx3=0x%08x\n", xhci_ctx_get_le32(sc, &psl->dwSctx3)); + DPRINTFN(5, "dwSctx0=0x%08x\n", le32toh(psl->dwSctx0)); + DPRINTFN(5, "dwSctx1=0x%08x\n", le32toh(psl->dwSctx1)); + DPRINTFN(5, "dwSctx2=0x%08x\n", le32toh(psl->dwSctx2)); + DPRINTFN(5, "dwSctx3=0x%08x\n", le32toh(psl->dwSctx3)); } #endif @@ -238,60 +237,6 @@ xhci_iterate_hw_softc(struct usb_bus *bus, usb_bus_mem_sub_cb_t *cb) } } -static void -xhci_ctx_set_le32(struct xhci_softc *sc, volatile uint32_t *ptr, uint32_t val) -{ - if (sc->sc_ctx_is_64_byte) { - uint32_t offset; - /* exploit the fact that our structures are XHCI_PAGE_SIZE aligned */ - /* all contexts are initially 32-bytes */ - offset = ((uintptr_t)ptr) & ((XHCI_PAGE_SIZE - 1) & ~(31U)); - ptr = (volatile uint32_t *)(((volatile uint8_t *)ptr) + offset); - } - *ptr = htole32(val); -} - -static uint32_t -xhci_ctx_get_le32(struct xhci_softc *sc, volatile uint32_t *ptr) -{ - if (sc->sc_ctx_is_64_byte) { - uint32_t offset; - /* exploit the fact that our structures are XHCI_PAGE_SIZE aligned */ - /* all contexts are initially 32-bytes */ - offset = ((uintptr_t)ptr) & ((XHCI_PAGE_SIZE - 1) & ~(31U)); - ptr = (volatile uint32_t *)(((volatile uint8_t *)ptr) + offset); - } - return (le32toh(*ptr)); -} - -static void -xhci_ctx_set_le64(struct xhci_softc *sc, volatile uint64_t *ptr, uint64_t val) -{ - if (sc->sc_ctx_is_64_byte) { - uint32_t offset; - /* exploit the fact that our structures are XHCI_PAGE_SIZE aligned */ - /* all contexts are initially 32-bytes */ - offset = ((uintptr_t)ptr) & ((XHCI_PAGE_SIZE - 1) & ~(31U)); - ptr = (volatile uint64_t *)(((volatile uint8_t *)ptr) + offset); - } - *ptr = htole64(val); -} - -#ifdef USB_DEBUG -static uint64_t -xhci_ctx_get_le64(struct xhci_softc *sc, volatile uint64_t *ptr) -{ - if (sc->sc_ctx_is_64_byte) { - uint32_t offset; - /* exploit the fact that our structures are XHCI_PAGE_SIZE aligned */ - /* all contexts are initially 32-bytes */ - offset = ((uintptr_t)ptr) & ((XHCI_PAGE_SIZE - 1) & ~(31U)); - ptr = (volatile uint64_t *)(((volatile uint8_t *)ptr) + offset); - } - return (le64toh(*ptr)); -} -#endif - static int xhci_reset_command_queue_locked(struct xhci_softc *sc) { @@ -1400,7 +1345,7 @@ xhci_set_address(struct usb_device *udev, struct mtx *mtx, uint16_t address) struct usb_page_search buf_dev; struct xhci_softc *sc = XHCI_BUS2SC(udev->bus); struct xhci_hw_dev *hdev; - struct xhci_dev_ctx *pdev; + struct xhci_slot_ctx *slot; struct xhci_endpoint_ext *pepext; uint32_t temp; uint16_t mps; @@ -1493,10 +1438,11 @@ xhci_set_address(struct usb_device *udev, struct mtx *mtx, uint16_t address) /* update device address to new value */ usbd_get_page(&hdev->device_pc, 0, &buf_dev); - pdev = buf_dev.buffer; + slot = XHCI_GET_CTX(sc, xhci_dev_ctx, ctx_slot, + buf_dev.buffer); usb_pc_cpu_invalidate(&hdev->device_pc); - temp = xhci_ctx_get_le32(sc, &pdev->ctx_slot.dwSctx3); + temp = le32toh(slot->dwSctx3); udev->address = XHCI_SCTX_3_DEV_ADDR_GET(temp); /* update device state to new value */ @@ -2304,7 +2250,8 @@ xhci_configure_mask(struct usb_device *udev, uint32_t mask, uint8_t drop) { struct xhci_softc *sc = XHCI_BUS2SC(udev->bus); struct usb_page_search buf_inp; - struct xhci_input_dev_ctx *pinp; + struct xhci_input_ctx *input; + struct xhci_slot_ctx *slot; uint32_t temp; uint8_t index; uint8_t x; @@ -2313,22 +2260,23 @@ xhci_configure_mask(struct usb_device *udev, uint32_t mask, uint8_t drop) usbd_get_page(&sc->sc_hw.devs[index].input_pc, 0, &buf_inp); - pinp = buf_inp.buffer; + input = XHCI_GET_CTX(sc, xhci_input_dev_ctx, ctx_input, + buf_inp.buffer); + slot = XHCI_GET_CTX(sc, xhci_input_dev_ctx, ctx_slot, buf_inp.buffer); if (drop) { mask &= XHCI_INCTX_NON_CTRL_MASK; - xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx0, mask); - xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx1, 0); + input->dwInCtx0 = htole32(mask); + input->dwInCtx1 = htole32(0); } else { /* * Some hardware requires that we drop the endpoint * context before adding it again: */ - xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx0, - mask & XHCI_INCTX_NON_CTRL_MASK); + input->dwInCtx0 = htole32(mask & XHCI_INCTX_NON_CTRL_MASK); /* Add new endpoint context */ - xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx1, mask); + input->dwInCtx1 = htole32(mask); /* find most significant set bit */ for (x = 31; x != 1; x--) { @@ -2346,10 +2294,10 @@ xhci_configure_mask(struct usb_device *udev, uint32_t mask, uint8_t drop) x = sc->sc_hw.devs[index].context_num; /* update number of contexts */ - temp = xhci_ctx_get_le32(sc, &pinp->ctx_slot.dwSctx0); + temp = le32toh(slot->dwSctx0); temp &= ~XHCI_SCTX_0_CTX_NUM_SET(31); temp |= XHCI_SCTX_0_CTX_NUM_SET(x + 1); - xhci_ctx_set_le32(sc, &pinp->ctx_slot.dwSctx0, temp); + slot->dwSctx0 = htole32(temp); } usb_pc_cpu_flush(&sc->sc_hw.devs[index].input_pc); return (0); @@ -2364,7 +2312,7 @@ xhci_configure_endpoint(struct usb_device *udev, { struct usb_page_search buf_inp; struct xhci_softc *sc = XHCI_BUS2SC(udev->bus); - struct xhci_input_dev_ctx *pinp; + struct xhci_endp_ctx *endp; uint64_t ring_addr = pepext->physaddr; uint32_t temp; uint8_t index; @@ -2375,8 +2323,6 @@ xhci_configure_endpoint(struct usb_device *udev, usbd_get_page(&sc->sc_hw.devs[index].input_pc, 0, &buf_inp); - pinp = buf_inp.buffer; - epno = edesc->bEndpointAddress; type = edesc->bmAttributes & UE_XFERTYPE; @@ -2396,6 +2342,9 @@ xhci_configure_endpoint(struct usb_device *udev, if (mult == 0) return (USB_ERR_BAD_BUFSIZE); + endp = XHCI_GET_CTX(sc, xhci_input_dev_ctx, ctx_ep[epno - 1], + buf_inp.buffer); + /* store endpoint mode */ pepext->trb_ep_mode = ep_mode; /* store bMaxPacketSize for control endpoints */ @@ -2451,7 +2400,7 @@ xhci_configure_endpoint(struct usb_device *udev, break; } - xhci_ctx_set_le32(sc, &pinp->ctx_ep[epno - 1].dwEpCtx0, temp); + endp->dwEpCtx0 = htole32(temp); temp = XHCI_EPCTX_1_HID_SET(0) | @@ -2486,8 +2435,8 @@ xhci_configure_endpoint(struct usb_device *udev, if (epno & 1) temp |= XHCI_EPCTX_1_EPTYPE_SET(4); - xhci_ctx_set_le32(sc, &pinp->ctx_ep[epno - 1].dwEpCtx1, temp); - xhci_ctx_set_le64(sc, &pinp->ctx_ep[epno - 1].qwEpCtx2, ring_addr); + endp->dwEpCtx1 = htole32(temp); + endp->qwEpCtx2 = htole64(ring_addr); switch (edesc->bmAttributes & UE_XFERTYPE) { case UE_INTERRUPT: @@ -2504,10 +2453,10 @@ xhci_configure_endpoint(struct usb_device *udev, break; } - xhci_ctx_set_le32(sc, &pinp->ctx_ep[epno - 1].dwEpCtx4, temp); + endp->dwEpCtx4 = htole32(temp); #ifdef USB_DEBUG - xhci_dump_endpoint(sc, &pinp->ctx_ep[epno - 1]); + xhci_dump_endpoint(endp); #endif usb_pc_cpu_flush(&sc->sc_hw.devs[index].input_pc); @@ -2563,7 +2512,7 @@ xhci_configure_device(struct usb_device *udev) struct xhci_softc *sc = XHCI_BUS2SC(udev->bus); struct usb_page_search buf_inp; struct usb_page_cache *pcinp; - struct xhci_input_dev_ctx *pinp; + struct xhci_slot_ctx *slot; struct usb_device *hubdev; uint32_t temp; uint32_t route; @@ -2580,7 +2529,7 @@ xhci_configure_device(struct usb_device *udev) usbd_get_page(pcinp, 0, &buf_inp); - pinp = buf_inp.buffer; + slot = XHCI_GET_CTX(sc, xhci_input_dev_ctx, ctx_slot, buf_inp.buffer); rh_port = 0; route = 0; @@ -2655,7 +2604,7 @@ xhci_configure_device(struct usb_device *udev) if (is_hub) temp |= XHCI_SCTX_0_HUB_SET(1); - xhci_ctx_set_le32(sc, &pinp->ctx_slot.dwSctx0, temp); + slot->dwSctx0 = htole32(temp); temp = XHCI_SCTX_1_RH_PORT_SET(rh_port); @@ -2664,7 +2613,7 @@ xhci_configure_device(struct usb_device *udev) sc->sc_hw.devs[index].nports); } - xhci_ctx_set_le32(sc, &pinp->ctx_slot.dwSctx1, temp); + slot->dwSctx1 = htole32(temp); temp = XHCI_SCTX_2_IRQ_TARGET_SET(0); @@ -2690,7 +2639,7 @@ xhci_configure_device(struct usb_device *udev) break; } - xhci_ctx_set_le32(sc, &pinp->ctx_slot.dwSctx2, temp); + slot->dwSctx2 = htole32(temp); /* * These fields should be initialized to zero, according to @@ -2699,10 +2648,10 @@ xhci_configure_device(struct usb_device *udev) temp = XHCI_SCTX_3_DEV_ADDR_SET(0) | XHCI_SCTX_3_SLOT_STATE_SET(0); - xhci_ctx_set_le32(sc, &pinp->ctx_slot.dwSctx3, temp); + slot->dwSctx3 = htole32(temp); #ifdef USB_DEBUG - xhci_dump_device(sc, &pinp->ctx_slot); + xhci_dump_device(slot); #endif usb_pc_cpu_flush(pcinp); @@ -2731,7 +2680,7 @@ xhci_alloc_device_ext(struct usb_device *udev) pc->tag_parent = sc->sc_bus.dma_parent_tag; if (usb_pc_alloc_mem(pc, pg, sc->sc_ctx_is_64_byte ? - (2 * sizeof(struct xhci_dev_ctx)) : + sizeof(struct xhci_dev_ctx64) : sizeof(struct xhci_dev_ctx), XHCI_PAGE_SIZE)) goto error; @@ -2744,7 +2693,7 @@ xhci_alloc_device_ext(struct usb_device *udev) pc->tag_parent = sc->sc_bus.dma_parent_tag; if (usb_pc_alloc_mem(pc, pg, sc->sc_ctx_is_64_byte ? - (2 * sizeof(struct xhci_input_dev_ctx)) : + sizeof(struct xhci_input_dev_ctx64) : sizeof(struct xhci_input_dev_ctx), XHCI_PAGE_SIZE)) { goto error; } @@ -3792,7 +3741,7 @@ xhci_get_endpoint_state(struct usb_device *udev, uint8_t epno) struct xhci_softc *sc = XHCI_BUS2SC(udev->bus); struct usb_page_search buf_dev; struct xhci_hw_dev *hdev; - struct xhci_dev_ctx *pdev; + struct xhci_endp_ctx *endp; uint32_t temp; MPASS(epno != 0); @@ -3800,10 +3749,11 @@ xhci_get_endpoint_state(struct usb_device *udev, uint8_t epno) hdev = &sc->sc_hw.devs[udev->controller_slot_id]; usbd_get_page(&hdev->device_pc, 0, &buf_dev); - pdev = buf_dev.buffer; + endp = XHCI_GET_CTX(sc, xhci_dev_ctx, ctx_ep[epno - 1], + buf_dev.buffer); usb_pc_cpu_invalidate(&hdev->device_pc); - temp = xhci_ctx_get_le32(sc, &pdev->ctx_ep[epno - 1].dwEpCtx0); + temp = le32toh(endp->dwEpCtx0); return (XHCI_EPCTX_0_EPSTATE_GET(temp)); } diff --git a/sys/dev/usb/controller/xhci.h b/sys/dev/usb/controller/xhci.h index d98df2bdf512..4701e62ba3e5 100644 --- a/sys/dev/usb/controller/xhci.h +++ b/sys/dev/usb/controller/xhci.h @@ -111,6 +111,11 @@ struct xhci_slot_ctx { volatile uint32_t dwSctx7; }; +struct xhci_slot_ctx64 { + struct xhci_slot_ctx ctx; + volatile uint8_t padding[32]; +}; + struct xhci_endp_ctx { volatile uint32_t dwEpCtx0; #define XHCI_EPCTX_0_EPSTATE_SET(x) ((x) & 0x7) @@ -156,6 +161,11 @@ struct xhci_endp_ctx { volatile uint32_t dwEpCtx7; }; +struct xhci_endp_ctx64 { + struct xhci_endp_ctx ctx; + volatile uint8_t padding[32]; +}; + struct xhci_input_ctx { #define XHCI_INCTX_NON_CTRL_MASK 0xFFFFFFFCU volatile uint32_t dwInCtx0; @@ -170,17 +180,33 @@ struct xhci_input_ctx { volatile uint32_t dwInCtx7; }; +struct xhci_input_ctx64 { + struct xhci_input_ctx ctx; + volatile uint8_t padding[32]; +}; + struct xhci_input_dev_ctx { struct xhci_input_ctx ctx_input; struct xhci_slot_ctx ctx_slot; struct xhci_endp_ctx ctx_ep[XHCI_MAX_ENDPOINTS - 1]; }; +struct xhci_input_dev_ctx64 { + struct xhci_input_ctx64 ctx_input; + struct xhci_slot_ctx64 ctx_slot; + struct xhci_endp_ctx64 ctx_ep[XHCI_MAX_ENDPOINTS - 1]; +}; + struct xhci_dev_ctx { struct xhci_slot_ctx ctx_slot; struct xhci_endp_ctx ctx_ep[XHCI_MAX_ENDPOINTS - 1]; } __aligned(XHCI_DEV_CTX_ALIGN); +struct xhci_dev_ctx64 { + struct xhci_slot_ctx64 ctx_slot; + struct xhci_endp_ctx64 ctx_ep[XHCI_MAX_ENDPOINTS - 1]; +} __aligned(XHCI_DEV_CTX_ALIGN); + struct xhci_stream_ctx { volatile uint64_t qwSctx0; #define XHCI_SCTX_0_DCS_GET(x) ((x) & 0x1) From nobody Sun Apr 30 06:58:04 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HH118jyz48sJp; Sun, 30 Apr 2023 06:58: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 4Q8HH0511Hz3NDq; Sun, 30 Apr 2023 06:58:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q9PqZPblq84cRhuydX+/EMMzyrpJEzr81Sf+yb6CH84=; b=OJesznYqEK7uSl5bWgXkRynmxJC9GDUOkva5nWQd1YCACDL5fkYDqDmpLsr59c+vn4ny2p 6rbRSA405DM/8Zh9HdKNeM7a3f3RrlEDcbkzV31VSEI9JhJ8as4h6WnKjSgFRbcSYmw+Pd PiUPdw/hlz4Fihy/8C8UMaFPT2SqhFKpgcS/Y2x5tWxKOGg270D5DEztivhPPH18+7lvrv I61meZHLNVc7RsssMTQa7FyQOY/K9Jj7DN1wM+AZeOTNcWaASepajZ2NAGcKegpHK8IEb4 34PLrwBYJX1sOZ+PdGvkiZfl3+WKL3WwOKypg+B9rprIbHfJrGSMJ5yKkCqXbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q9PqZPblq84cRhuydX+/EMMzyrpJEzr81Sf+yb6CH84=; b=eHriEpWejZMTtac/mVphUMU3DJ4xY5/xIrwD/mszG4o20l1qejK9luKjke9CyHg3nWusu9 Ii3PTBYd+LLqD8L+w2KYMWgggtXfiirhK2mFzitmB42/Pj5VcGmkxsDBmVC449TJujPxYc y8us04NhEhGVtNhygvY61Y3s5QIJknrfgUEQTvyLoN1jNV2lUe0WhP6bgZcoQy72liUDLj StV2kpQBTpzvtnEwIzNNX58ARpJTfUu/aqMxgiExp+1x69K6dlR5uEgCKwVRU7NV5GZj0x 5Q1m9N+R2Fp1IsE2CTzo/g5rJMMbv46AeYfiAxVlt2lgcntS5wVlY2lVo11g0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837884; a=rsa-sha256; cv=none; b=cOiAZ+5N+OWO+QcHf3H5cclgYVMmvSGrj8yvJCm/hOszURT9dZ1tvIwTK9UEHPQkP/pQFu tGylyMNntcVBkMYGE9IgzKP0dKKp4L7bmhxrk87LW7l8sp3PpdOPg4l7wZ9IdFKC4zHBMT 9ra/7XcbuENpLdJ/5bKWv2u5/o9WplpCOuoqnq1f2By1ppxbr0PVGalt9IjcwqrA34RR3d kIdMQZVFhg42hyvJXfNJcPDsv0lK1jgeWxzSbtX9hY8p965G5xAtZwylWphOiPC0vzLYSP ZxxY515Xih7JietM1FwBtKFuLsC86CHSHqf77tbfBkuzb/0sRHCl1GyJHmuRvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HH03l3HzDsw; Sun, 30 Apr 2023 06:58: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 33U6w49O071744; Sun, 30 Apr 2023 06:58:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6w4gG071743; Sun, 30 Apr 2023 06:58:04 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:58:04 GMT Message-Id: <202304300658.33U6w4gG071743@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 00e2c99eb73a - stable/13 - wsp: Add sysctl tunable for Z-Axis inversion List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 00e2c99eb73aca5e46940c7993631314d485713a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=00e2c99eb73aca5e46940c7993631314d485713a commit 00e2c99eb73aca5e46940c7993631314d485713a Author: Vladimir Kondratyev AuthorDate: 2021-02-08 21:26:42 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:18 +0000 wsp: Add sysctl tunable for Z-Axis inversion This adds a new sysctl to Wellspring Touchpad driver for controlling Z-Axis (2-finger vertical scroll) direction "hw.usb.wsp.z_invert". Submitted by: James Wright Reviewed by: wulf PR: 253321 Differential revision: https://reviews.freebsd.org/D28521 (cherry picked from commit d8c6d4c7321d4c969216bda8f792b45ed00afd64) --- share/man/man4/wsp.4 | 7 ++++++- sys/dev/usb/input/wsp.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/share/man/man4/wsp.4 b/share/man/man4/wsp.4 index 70a1219533dc..847c79c71f29 100644 --- a/share/man/man4/wsp.4 +++ b/share/man/man4/wsp.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2018 +.Dd February 9, 2021 .Dt WSP 4 .Os .Sh NAME @@ -67,6 +67,11 @@ Pointer sensitivity can be controlled using the sysctl tunable Tap to left-click can be controlled using the sysctl tunable .Nm hw.usb.wsp.enable_single_tap_clicks , set to 0 to disable single tap clicks or 1 to enable them (default). +Z-Axis sensitivity can be controlled using the sysctl tunable +.Nm hw.usb.wsp.z_factor . +Z-Axis inversion can be controlled using the sysctl tunable +.Nm hw.usb.wsp.z_invert , +set to 0 to disable (default) or 1 to enable inversion. .Sh FILES .Nm creates a blocking pseudo-device file, diff --git a/sys/dev/usb/input/wsp.c b/sys/dev/usb/input/wsp.c index b1492f1f4c0c..c2da3df598c5 100644 --- a/sys/dev/usb/input/wsp.c +++ b/sys/dev/usb/input/wsp.c @@ -95,6 +95,7 @@ SYSCTL_INT(_hw_usb_wsp, OID_AUTO, debug, CTLFLAG_RWTUN, static struct wsp_tuning { int scale_factor; int z_factor; + int z_invert; int pressure_touch_threshold; int pressure_untouch_threshold; int pressure_tap_threshold; @@ -105,6 +106,7 @@ static struct wsp_tuning { { .scale_factor = 12, .z_factor = 5, + .z_invert = 0, .pressure_touch_threshold = 50, .pressure_untouch_threshold = 10, .pressure_tap_threshold = 120, @@ -117,6 +119,7 @@ wsp_runing_rangecheck(struct wsp_tuning *ptun) { WSP_CLAMP(ptun->scale_factor, 1, 63); WSP_CLAMP(ptun->z_factor, 1, 63); + WSP_CLAMP(ptun->z_invert, 0, 1); WSP_CLAMP(ptun->pressure_touch_threshold, 1, 255); WSP_CLAMP(ptun->pressure_untouch_threshold, 1, 255); WSP_CLAMP(ptun->pressure_tap_threshold, 1, 255); @@ -128,6 +131,8 @@ SYSCTL_INT(_hw_usb_wsp, OID_AUTO, scale_factor, CTLFLAG_RWTUN, &wsp_tuning.scale_factor, 0, "movement scale factor"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, z_factor, CTLFLAG_RWTUN, &wsp_tuning.z_factor, 0, "Z-axis scale factor"); +SYSCTL_INT(_hw_usb_wsp, OID_AUTO, z_invert, CTLFLAG_RWTUN, + &wsp_tuning.z_invert, 0, "enable Z-axis inversion"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, pressure_touch_threshold, CTLFLAG_RWTUN, &wsp_tuning.pressure_touch_threshold, 0, "touch pressure threshold"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, pressure_untouch_threshold, CTLFLAG_RWTUN, @@ -1226,7 +1231,7 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) dx = dy = 0; if (sc->dz_count == 0) - dz = sc->dz_sum / tun.z_factor; + dz = (sc->dz_sum / tun.z_factor) * (tun.z_invert ? -1 : 1); if (sc->scr_mode == WSP_SCR_HOR || abs(sc->pos_x[0] - sc->pos_x[1]) > MAX_DISTANCE || abs(sc->pos_y[0] - sc->pos_y[1]) > MAX_DISTANCE) From nobody Sun Apr 30 06:58:05 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HH21vyrz48sJq; Sun, 30 Apr 2023 06:58: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 4Q8HH15m7Jz3NN5; Sun, 30 Apr 2023 06:58:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4E6vmzzkE7k7nxpouVdBhmTC2VmaUUrBD40NNilZD/g=; b=OPPobscAXwQmEXcpXZqRvWYzVs/xIIIKP5/+UpOnqQVDoKS05TzLeROALtZI/kQU5Tj+9I AbZpEg0GnxBAmKMjnk7dbW9eKZS36tn5V1+pgqMRRdM/nkO+Nwlq7Y5LowlJXcs6jsDT0j WxSrQlAyIU+V16VqKGR7RH2c9JQk8KSCcPOYVa+ukW4QstBsZr++rFoVLdoFlvX1+pQJZs +pKDDFQH8EsalVW4hV68xHde9OUSOzWpeF5lj6LISYRmfiNjdKe2Ons5G1dAWIscunV3Fy XDR4opz3d5k7sCGsbmcPZ8aszSjMEMGFfG/RW+K1rS3xvl77xhfh6Gm2pP4F6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4E6vmzzkE7k7nxpouVdBhmTC2VmaUUrBD40NNilZD/g=; b=Y7m1zDZtjlKyV5nfWyHq7WOOicFtpeFt2GAAloGS05jAPMfFbwjwERIlFYV5/WmUAhSRnp Rf4ocI/Xmv7/3gcobQ96xpZEX3OB1vLoyc37frtc1EgD9tG1RMlYEReOqR6z5i+7RzAAp+ qwBAbL6VeLKXi9LAb4wuPX7QWH0e9KLIaZANGFyByzngbAP2DUiM+5HFpYeeTDv/zcZWAI 0vrbAfK19tav7SiHM3SVhjHgylU4c5EnGEIGlgEUNRkcy5fb4f3XkCjwWItZ954tfW9YzM rrbJgi7LH8hfbYal5OzVwb1ddafqsmRctdndYRmfiz3xKArV8XZP9paktX2OYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837885; a=rsa-sha256; cv=none; b=GhhCSSSKMDmCkSMOpj4PBrbBAbfk4bYNXMaH+1fs0ARS475JWDLhMXHC/ze0rMlRpLTxDU 59cVM0/Z4TX0g8kapJqbNOto841vvBSMRBP7y+33OgghNfij/fUaBlhoWyvGHBzJd6/ZuW ZWRnaGFAdhuDeeHvyuNroR3oTZwJ6GOOTqzQ5mJQznOLOs65CxbvBzk4iDqg3dPKjdPVZF JsK32D1Xn9MyNrRHpTh2dYIWiSDr3URf1yeaWrbQZ5HjQpvdRZAlVbaWdilDVErBiHWthP zsh+elAIwYiJCTkmdXpNgBcXNKN/poVN8FhMskc+qxSAyyHhcY35vf9+SlMzZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HH14qF6z1Crj; Sun, 30 Apr 2023 06:58: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 33U6w5Or071766; Sun, 30 Apr 2023 06:58:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6w5Fh071764; Sun, 30 Apr 2023 06:58:05 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:58:05 GMT Message-Id: <202304300658.33U6w5Fh071764@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: fa65f958847d - stable/13 - Make sure the uftdi(4) driver doesn't start a USB transfer when being cancelled. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: fa65f958847ddb89639b6502286607c774015dea Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=fa65f958847ddb89639b6502286607c774015dea commit fa65f958847ddb89639b6502286607c774015dea Author: Hans Petter Selasky AuthorDate: 2021-08-18 09:41:49 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:18 +0000 Make sure the uftdi(4) driver doesn't start a USB transfer when being cancelled. Sponsored by: NVIDIA Networking (cherry picked from commit 8a46f021c2408c82375a1f5127efb7ac6b78596e) --- sys/dev/usb/serial/uftdi.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/dev/usb/serial/uftdi.c b/sys/dev/usb/serial/uftdi.c index d57a2c5dbc45..5118a3affb84 100644 --- a/sys/dev/usb/serial/uftdi.c +++ b/sys/dev/usb/serial/uftdi.c @@ -1213,14 +1213,9 @@ uftdi_write_callback(struct usb_xfer *xfer, usb_error_t error) DPRINTFN(3, "\n"); switch (USB_GET_STATE(xfer)) { - default: /* Error */ - if (error != USB_ERR_CANCELLED) { - /* try to clear stall first */ - usbd_xfer_set_stall(xfer); - } - /* FALLTHROUGH */ case USB_ST_SETUP: case USB_ST_TRANSFERRED: +tr_setup: /* * If output packets don't require headers (the common case) we * can just load the buffer up with payload bytes all at once. @@ -1255,6 +1250,13 @@ uftdi_write_callback(struct usb_xfer *xfer, usb_error_t error) usbd_transfer_submit(xfer); } break; + default: /* Error */ + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + break; } } From nobody Sun Apr 30 06:58:06 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HH30bGYz48s8J; Sun, 30 Apr 2023 06:58: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 4Q8HH26qWCz3NQc; Sun, 30 Apr 2023 06:58:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CxdF1aLH3lsilAHT+7ZqOd6/7fTN5XIEzBTK9WIFXok=; b=D+YAusG7rjCaqHYQbyja5gGP3D+pHje8nW9dF2Fp+NmrU02FC0Io1wCtFkTcGgp+Z2W2u6 rtUfHScd7a0XpZpuhpvQKMJ9OwTZjZHz9BUS0LZUCoMkYTJFXVB581WDx6eha5lt4fVWFt IYXjyOu9kV5mWxLG6B9lic0Mib5eV9znJXhk4FTtfrs90SgdyE/hYFbFniWWtGnlDoJeff EBNj+ms19xSjQ1LKjkdHmR4edYr7Uz0k9/jjuDIGe+IXqYUMPd3GIZ+CC3JEydv+x3/2YY 4tv9R+ITkluSqrk5nrLTnIYKerSDwQBHedljMxRTCNQEZl/wiDtAjgr0M9Ke4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CxdF1aLH3lsilAHT+7ZqOd6/7fTN5XIEzBTK9WIFXok=; b=lIXmGu1T4PGaMWgeNIfrQvH7JeiqrEyKyBdnA/gc7DcasV9444wj7h5+v7QJZKRGe5WT+C MFMghcFIuIbVYlI+D9Ro/hZZm817hgXI0P+flyFTkOx0G8oIL4NBTl/TSFLzjfNzZsu92v i1n0G22V/K3O18VPwKvYlEbmgZnzjGIUajb5a5O1JZoPFqSCjiuFO3GbqHAmi5gnkx+QP1 rGPFgZhCmNO7rdUbQyp/3rGpohEy7etgprcEKSiPnpIdDAWu/qbCTY7wBpTU50hniaIGkv w/F/47z/mNs3zMhnKbbXefJWl+xU6PuqPW2k5ylzr4dB9aTsOC67MQCA7XN9hw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837887; a=rsa-sha256; cv=none; b=W6ItyinETBMJu6OrzSecYc6vcrvBDQNhnVm3gxoFQ3v1oTviHTaz9wbKEFi19xaiBEiVWU 6iOnb/2nHzC03xUPtcO1sQonurSTAQeHxVcFxkCFoSur82g63Hu8D4wse6tU5SKMNoNVZ5 2/lVeLAD2GyYiNkvVBL1i0QDbPOrXKlD0/7+gfH7dxKW6aGXU9hsvYuyJnzptIOYeBNrBe 9CEsVxJEnixtICFVKi0ndwrJajBKVkVh/+7y243y/IFnatT4r33rtD2sfhJNEc5Eu/uV0q myrhq3AA648cERFo3xB9TjXGMzqc2CbrHcgM1j4X4FS8aVZxRrHBHKrxLbs4LA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HH25wQnz1CvH; Sun, 30 Apr 2023 06:58: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 33U6w6Yw071788; Sun, 30 Apr 2023 06:58:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6w6Vk071787; Sun, 30 Apr 2023 06:58:06 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:58:06 GMT Message-Id: <202304300658.33U6w6Vk071787@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 3890a6eb01c1 - stable/13 - ulpt(4): Add support for Epson TM-U220B. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3890a6eb01c159b8199cee296078863a468a3f22 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=3890a6eb01c159b8199cee296078863a468a3f22 commit 3890a6eb01c159b8199cee296078863a468a3f22 Author: Hans Petter Selasky AuthorDate: 2022-04-02 00:27:48 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:18 +0000 ulpt(4): Add support for Epson TM-U220B. Submitted by: Archimedes Gaviola Sponsored by: NVIDIA Networking (cherry picked from commit 88162f7abd61206c98432f2c0de869a59be13854) --- sys/dev/usb/serial/ulpt.c | 13 +++++++++++-- sys/dev/usb/usbdevs | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/serial/ulpt.c b/sys/dev/usb/serial/ulpt.c index c566da924374..935dc992c6c2 100644 --- a/sys/dev/usb/serial/ulpt.c +++ b/sys/dev/usb/serial/ulpt.c @@ -499,6 +499,13 @@ static const STRUCT_USB_HOST_ID ulpt_devs[] = { {USB_IFACE_CLASS(UICLASS_PRINTER), USB_IFACE_SUBCLASS(UISUBCLASS_PRINTER), USB_IFACE_PROTOCOL(UIPROTO_PRINTER_1284)}, + + /* Epson printer */ + {USB_VENDOR(USB_VENDOR_EPSON), + USB_PRODUCT(USB_PRODUCT_EPSON_TMU220B), + USB_IFACE_CLASS(UICLASS_VENDOR), + USB_IFACE_SUBCLASS(UISUBCLASS_VENDOR), + USB_IFACE_PROTOCOL(UIPROTO_PRINTER_BI)}, }; static int @@ -555,8 +562,10 @@ ulpt_attach(device_t dev) break; } else { alt_index++; - if ((id->bInterfaceClass == UICLASS_PRINTER) && - (id->bInterfaceSubClass == UISUBCLASS_PRINTER) && + if ((id->bInterfaceClass == UICLASS_PRINTER || + id->bInterfaceClass == UICLASS_VENDOR) && + (id->bInterfaceSubClass == UISUBCLASS_PRINTER || + id->bInterfaceSubClass == UISUBCLASS_VENDOR) && (id->bInterfaceProtocol == UIPROTO_PRINTER_BI)) { goto found; } diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index fb282568935f..bab6d835d417 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -1949,6 +1949,7 @@ product EPSON 1270 0x0120 Perfection 1270 scanner product EPSON 2480 0x0121 Perfection 2480 scanner product EPSON 3590 0x0122 Perfection 3590 scanner product EPSON 4990 0x012a Perfection 4990 Photo scanner +product EPSON TMU220B 0x0202 TM-U220B product EPSON CRESSI_EDY 0x0521 Cressi Edy diving computer product EPSON N2ITION3 0x0522 Zeagle N2iTion3 diving computer product EPSON STYLUS_875DC 0x0601 Stylus Photo 875DC Card Reader From nobody Sun Apr 30 06:58:07 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HH41CRmz48sRh; Sun, 30 Apr 2023 06:58:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q8HH40njqz3NG0; Sun, 30 Apr 2023 06:58:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mmEqbQ6IcXtzazV75d7klQtqmLgyBra9Gs4qOnAwapA=; b=eVmxk3VJpdKXhOiyn12efPfqEmdA8u/ULDYZa9lbQIrqp2Uex015k7FZHWU3GaNC37emuB zTPv8OE2rRMvaYeK5xZRdumzoJxj3vTBqfvNSHm9orKGLJM4Kj546yEEw69R1RLPSY84A0 xjnV7FBlVGqqYiASlcdbZkvOVUwI19k3woNiILRie1FY3DXV4YF84UG7nbGqAy9eyegnVV 0aqcfU/EDcXoTT8yfMFgCWtdaGTGaJIDyETnE/5KejYrA4H88+9sM5JKMHz8o+VezCKvBB 6M+249RYj1YfSc+ttiGD6+O3WdLsW68zBP+eb7YQnIewTr9SWV6vixkugRqhxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mmEqbQ6IcXtzazV75d7klQtqmLgyBra9Gs4qOnAwapA=; b=CVLAGVKlqqJ38J+LHGxLTaYGN5ZMP34YiwewK8WyCiDWBGALBy2dBmZ2WEeesXDTNzkGl3 uj21TCJa91P/bnhxHseHbm9EsZBFLvOKe0vYglgGQxUylQB3NQZ9smmZwIV1pmEj3mfkB7 lC4rBh31iJnxQPxt2fykbaJidOF07TbHcNP+Wl+cRZ6okZySOjteSKxPo1+LLHbgrG7srG QP+LbrVbH0ZrgyZdQ6eZUG59WMrqEoa+kx/XH9TGk+n/9Hv+tSYkWD+uAi7/MM02EeB9xz SlZoKSbVB09lp1Z3ACYa5tKzypa78Aj6WPqXjXC8q4JYo+Ogd6CWf1Nm1qZQIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837888; a=rsa-sha256; cv=none; b=qa4WItYFFgOX9NO8Gee4BHR20nK2WIY6BBbevcbYRT1Jm2I8RZdOYKE99N9fPMdS6G7dRs uD8Yu7xaFIlaoB1iIciuJqmr36vAeljw2/+uYQOOiiVSYLhHxSxaBmOEH/0iUuhr4vnJSX MAIvI8WbsVDmUVTQmlM5LD6826xEjqbl0hdvH5HbFVmKtc8YLLJAGtLyGKysRD+5QyzO1o dgu/TGmFAGwQ8UrY8swOrMPacP1NpWACJNVPSE/8qexTeWf97AqtWsIVDbJR/huzLygDU0 0njXa9WL8568STFpNCDVKLurCRc/sBR9nsCtOU5KGj3paX+9Cs8HH5vDtwnupg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HH36wHQzDr8; Sun, 30 Apr 2023 06:58: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 33U6w7JF071807; Sun, 30 Apr 2023 06:58:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6w7dK071806; Sun, 30 Apr 2023 06:58:07 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:58:07 GMT Message-Id: <202304300658.33U6w7dK071806@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 9529b980ed39 - stable/13 - usb: tiny formatting nit List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 9529b980ed39a7d3a86e8b4af96fb8c8c57288ec Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=9529b980ed39a7d3a86e8b4af96fb8c8c57288ec commit 9529b980ed39a7d3a86e8b4af96fb8c8c57288ec Author: Warner Losh AuthorDate: 2021-03-11 15:23:32 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:18 +0000 usb: tiny formatting nit Format 300 baud like all the others here. No functional change. (cherry picked from commit 1645a4ae645fa9b9e3571b7512caa92e73b20635) --- sys/dev/usb/serial/umct.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/serial/umct.c b/sys/dev/usb/serial/umct.c index 43f28c307f6d..dd452d38a67b 100644 --- a/sys/dev/usb/serial/umct.c +++ b/sys/dev/usb/serial/umct.c @@ -478,7 +478,8 @@ static uint8_t umct_calc_baud(uint32_t baud) { switch (baud) { - case B300:return (0x1); + case B300: + return (0x1); case B600: return (0x2); case B1200: From nobody Sun Apr 30 06:58:09 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HH54fk7z48sMQ; Sun, 30 Apr 2023 06:58:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q8HH51h1Lz3NTR; Sun, 30 Apr 2023 06:58:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rOz8NHIOk6xK5jo5zF9WOUNZ7pucYq0ay2z6hXO5bAE=; b=lW4ZOui1MTT7wa7TLQlUGswkhJPS3C4sTJoJ3GCvDVUK6ubA6bD86OaGWRPZvsykwuYnP8 zLxY30aqTzUG/jLAyiuroz+KWe7HF68BW5tPM/Hd+r7RLD6gylER95G9TxSnNzRuqwChZz ysQdwKzIxTgvM+i3pHnsDBxRQTXAUtK6iqSmmXmWLpMMmHDfTOG6LT+sYLZJ4Jbmo9MEhP l2dRc80D8hrUYjs0NRYBQHyaKFTnTk5XNDrFMyTSVakndHwkGynOt8YTVN8n97ICk9UOFP NXFhvy42Q13STySW0kAnz7BPuDzT1d9U3oaM7civsY4ZrrSUBjo2CiOkluyMSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rOz8NHIOk6xK5jo5zF9WOUNZ7pucYq0ay2z6hXO5bAE=; b=pzbZHudiGy1AdwJXuxBjO7FgQ65OzVa4gu8wqBsu85uJ4vzm4qOcheCmQzxvTG3GRYTj0b 6yv4ivRog2tvpEgDxe5f2MD+fbqAuponAkeJ0hCOQnoOvaeYbEl2t61c5iYJklUDknv37+ rLdPkEzb5yadLJcWVxUeNhamjZZDiS8TF3JzMpsCwOKnG/54uil8JFczJq+3ziak6W0gVV FfWO3Rj0ZYYMcFcXOWaOzQytgmqqvsbf5VPAyKgBCOba6r33iV1O0ibU/pKDE/edD6qPXS DbnLorq9tRZImVjCiJksP6IlHXMeoequUSUj3Mn1dOaPGg2iU8ugy9TrLob0wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837889; a=rsa-sha256; cv=none; b=mBvI1QLXg1EopD1K/KcgqmmzzKYC16zK6B5SgabCmuD3B6M1SDttmVDLJv1U8yq4I0FFZZ uomH8/ZsvdyG9uArXWB2r+2vZH8+P/IPNd8dP5W8LvYy992fDLOJHYflLZtAPxnKkZbjVV ughUAoYnKLJb06MFuqh7XvK5o5lr9gtuKKDvLuRQNUm9IzfJWwbcDs+ZV7uvTZ75rf+kMm KP+UpN737MhuzQDihhmyvnwjY/w4Oqc4iqBqfsZYD6omJ/WNu051Ha7p9Hn4uA3GEJovfD w1TKydPG/T9KqBUooAwavRMOynnjYzboqOMupeVBw2F1XUE3hoyL+pPNaS44AA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HH50mkqzDhT; Sun, 30 Apr 2023 06:58:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33U6w9b6071828; Sun, 30 Apr 2023 06:58:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6w9Qn071827; Sun, 30 Apr 2023 06:58:09 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:58:09 GMT Message-Id: <202304300658.33U6w9Qn071827@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: fbedcad985b5 - stable/13 - Implement an API for sending a zero-length-packet. The purpose of such a USB packet is to toggle the binary packet counter for USB 1.0/2.0 protocols, without sending any data, so that the first packet sent after opening a USB BULK endpoint doesn't get lost. This is for devices not supporting the USB standard defined clear-stall handling. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: fbedcad985b52481991636a26409d6f55660a3f0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=fbedcad985b52481991636a26409d6f55660a3f0 commit fbedcad985b52481991636a26409d6f55660a3f0 Author: Hans Petter Selasky AuthorDate: 2021-07-06 10:29:57 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:18 +0000 Implement an API for sending a zero-length-packet. The purpose of such a USB packet is to toggle the binary packet counter for USB 1.0/2.0 protocols, without sending any data, so that the first packet sent after opening a USB BULK endpoint doesn't get lost. This is for devices not supporting the USB standard defined clear-stall handling. Tested by: jmg Sponsored by: NVIDIA Networking (cherry picked from commit f83f5d58394db57576bbed6dc7531997cabeb102) (cherry picked from commit ec97e9ca1fa543a4a803e84706564d41cd492065) --- sys/dev/usb/usb_transfer.c | 59 +++++++++++++++++++++++++++++++++++++++++++--- sys/dev/usb/usbdi.h | 3 +++ 2 files changed, 59 insertions(+), 3 deletions(-) diff --git a/sys/dev/usb/usb_transfer.c b/sys/dev/usb/usb_transfer.c index 455b23e2c306..20ed2c897aac 100644 --- a/sys/dev/usb/usb_transfer.c +++ b/sys/dev/usb/usb_transfer.c @@ -2,7 +2,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2008-2021 Hans Petter Selasky. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -2689,6 +2689,61 @@ usbd_transfer_start_cb(void *arg) } } +/*------------------------------------------------------------------------* + * usbd_xfer_set_zlp + * + * This function sets the USB transfers ZLP flag. + *------------------------------------------------------------------------*/ +void +usbd_xfer_set_zlp(struct usb_xfer *xfer) +{ + if (xfer == NULL) { + /* tearing down */ + return; + } + USB_XFER_LOCK_ASSERT(xfer, MA_OWNED); + + /* avoid any races by locking the USB mutex */ + USB_BUS_LOCK(xfer->xroot->bus); + xfer->flags.send_zlp = 1; + USB_BUS_UNLOCK(xfer->xroot->bus); +} + +/*------------------------------------------------------------------------* + * usbd_xfer_get_and_clr_zlp + * + * This function gets and clears the USB transfers ZLP flag and + * queues a zero-length USB transfer if the flag was set. + *------------------------------------------------------------------------*/ +uint8_t +usbd_xfer_get_and_clr_zlp(struct usb_xfer *xfer) +{ + uint8_t retval; + + if (xfer == NULL) { + /* tearing down */ + return (0); + } + USB_XFER_LOCK_ASSERT(xfer, MA_OWNED); + + retval = xfer->flags.send_zlp; + + if (retval != 0) { + DPRINTFN(1, "Sending zero-length packet.\n"); + + /* avoid any races by locking the USB mutex */ + USB_BUS_LOCK(xfer->xroot->bus); + xfer->flags.send_zlp = 0; + USB_BUS_UNLOCK(xfer->xroot->bus); + + /* queue up a zero-length packet */ + usbd_xfer_set_frame_len(xfer, 0, 0); + usbd_xfer_set_frames(xfer, 1); + usbd_transfer_submit(xfer); + } + return (retval); +} + /*------------------------------------------------------------------------* * usbd_xfer_set_stall * @@ -2733,9 +2788,7 @@ usbd_transfer_clear_stall(struct usb_xfer *xfer) /* avoid any races by locking the USB mutex */ USB_BUS_LOCK(xfer->xroot->bus); - xfer->flags.stall_pipe = 0; - USB_BUS_UNLOCK(xfer->xroot->bus); } diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h index 1b3b4af5f717..287e40d59364 100644 --- a/sys/dev/usb/usbdi.h +++ b/sys/dev/usb/usbdi.h @@ -218,6 +218,7 @@ struct usb_xfer_flags { * option only has effect for * ISOCHRONOUS transfers. */ + uint8_t send_zlp:1; /* send a zero length packet first */ }; /* @@ -655,6 +656,8 @@ void usbd_xfer_set_frame_len(struct usb_xfer *xfer, usb_frcount_t frindex, usb_frlength_t len); void usbd_xfer_set_timeout(struct usb_xfer *xfer, int timeout); void usbd_xfer_set_frames(struct usb_xfer *xfer, usb_frcount_t n); +void usbd_xfer_set_zlp(struct usb_xfer *xfer); +uint8_t usbd_xfer_get_and_clr_zlp(struct usb_xfer *xfer); void usbd_xfer_set_stall(struct usb_xfer *xfer); int usbd_xfer_is_stalled(struct usb_xfer *xfer); void usbd_xfer_set_flag(struct usb_xfer *xfer, int flag); From nobody Sun Apr 30 06:58:10 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HH63Y54z48sMW; Sun, 30 Apr 2023 06:58: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 4Q8HH629H2z3NTf; Sun, 30 Apr 2023 06:58:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iozWvq3i5I4UB/+RQM8vTqyNTD3NHEd4uteijFE7TsI=; b=to4qou1pYEx3p0JWMRwJrh0tPf8qKVuS0L2WurgzfUHyenJMMewU/RwuHaWaxDovV5hsqD HQeX8kMb72HDmitrZbGqMXwPlNcdV2nal6767PYIpnBam03N67B5GR/9wbd6ideI/0N66l hRjPWRAL4IY6/0n2n2SpB9eWewFVx3xIlixU6SfhbnhM90p0H0yLa3s9Z0BwU4sHwJSNUe xJNBY2oALSrmbfytT+RpJJZjP5apOeCR/z8eHJjlrubp7VdPRG5c29Mi98VWjaY0KO0c3a Z4qUlPoJyxbMZ6vD9ErADBoZSxYCCw+a9L1YjosaD6mkKQpPsCpCEiZh8w2xOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iozWvq3i5I4UB/+RQM8vTqyNTD3NHEd4uteijFE7TsI=; b=hIBvcs14mxlrXyKmLfuuIHojxFSGhUEoVZj8ZNZ6/67Vc46bq5KKlwKhq7LmUlB6CtLtCb 6FBemghUztpP5muaLE+BnrX3zLDeXnzcyc3GMPn2IZiX1LO8hR0YTGJKjCamUw+wsdsSwn DvH8KkXekVfadkE+5QENr5bpS08jrAITpqrnKeqmeLBtA/Ybl+dMppwNIXj4v6hZkZN3by wXB+dZsTaeCOTJ0q4yGvkof9wAfKSu5MSAJR6nrb25L2FJRKgK5o6cGWfA9tZBHKo/Fedx scEW1hlj6rEZMPO6S3WAog91g4kWySGp7ilubkst1yzJNg6RSKMW3TDJRO7RaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837890; a=rsa-sha256; cv=none; b=TuE77cOnO2QprcrXDB55BalCcqr67IZ/GCBjyB7H+LcbBQgpgSAbbWtWo0j/g2uDKRbGZ2 cdZ0Yx1GBubow+/aaXGeeR7363VjdmVJxLm0U6W5xQSwgcrL74gzGNr1RyeO0rA9HWBs11 vHYMIh3R/8iM5Tgdt6BCOnpB7u5xXhwljiPEDPBeMkmEEAR8rbPuzePzuLVG3atFn6hVFx 2h+SC/lUluQlfHvLddn5mH8qgBzQhifvhUEw+jtfxDJWtNAB6i25TY71usaaQdTsVI3FE+ kS5jp4tFqsgCt4evH6Co7nNEH2vfAk7q+x23kNeG1JjeGLOqrx9JqF3OxQBAbQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HH619HBzDr9; Sun, 30 Apr 2023 06:58: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 33U6wAh0071848; Sun, 30 Apr 2023 06:58:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6wAMt071847; Sun, 30 Apr 2023 06:58:10 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:58:10 GMT Message-Id: <202304300658.33U6wAMt071847@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 61dd6a2ea1aa - stable/13 - mlx5: Implement diagostic counters as sysctl(8) nodes. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 61dd6a2ea1aa6349598bb1cc09976a4c76109ce7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=61dd6a2ea1aa6349598bb1cc09976a4c76109ce7 commit 61dd6a2ea1aa6349598bb1cc09976a4c76109ce7 Author: Hans Petter Selasky AuthorDate: 2023-04-18 11:38:59 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:18 +0000 mlx5: Implement diagostic counters as sysctl(8) nodes. Sponsored by: NVIDIA Networking (cherry picked from commit aa7bbdabde890676d54a22eeec3af9b7681d19b7) --- sys/conf/files | 2 + sys/dev/mlx5/driver.h | 22 ++ sys/dev/mlx5/mlx5_core/diag_cnt.h | 43 +++ sys/dev/mlx5/mlx5_core/mlx5_diag_cnt.c | 579 +++++++++++++++++++++++++++++++++ sys/dev/mlx5/mlx5_core/mlx5_main.c | 14 +- sys/dev/mlx5/mlx5_ifc.h | 36 ++ sys/modules/mlx5/Makefile | 1 + 7 files changed, 696 insertions(+), 1 deletion(-) diff --git a/sys/conf/files b/sys/conf/files index 2258acd4c9e7..5546925bccd8 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4952,6 +4952,8 @@ dev/mlx5/mlx5_core/mlx5_cmd.c optional mlx5 pci \ compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_cq.c optional mlx5 pci \ compile-with "${OFED_C}" +dev/mlx5/mlx5_core/mlx5_diag_cnt.c optional mlx5 pci \ + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_diagnostics.c optional mlx5 pci \ compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_eq.c optional mlx5 pci \ diff --git a/sys/dev/mlx5/driver.h b/sys/dev/mlx5/driver.h index 6d3a3be6562e..e1766ae8a742 100644 --- a/sys/dev/mlx5/driver.h +++ b/sys/dev/mlx5/driver.h @@ -1,5 +1,6 @@ /*- * Copyright (c) 2013-2019, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2022 NVIDIA corporation & affiliates. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -656,6 +657,26 @@ struct mlx5_special_contexts { int resd_lkey; }; +struct mlx5_diag_cnt_id { + u16 id; + bool enabled; +}; + +struct mlx5_diag_cnt { +#define DIAG_LOCK(dc) mutex_lock(&(dc)->lock) +#define DIAG_UNLOCK(dc) mutex_unlock(&(dc)->lock) + struct mutex lock; + struct sysctl_ctx_list sysctl_ctx; + struct mlx5_diag_cnt_id *cnt_id; + u16 num_of_samples; + u16 sample_index; + u8 num_cnt_id; + u8 log_num_of_samples; + u8 log_sample_period; + u8 flag; + u8 ready; +}; + struct mlx5_flow_root_namespace; struct mlx5_core_dev { struct pci_dev *pdev; @@ -685,6 +706,7 @@ struct mlx5_core_dev { struct mlx5_priv priv; struct mlx5_profile *profile; atomic_t num_qps; + struct mlx5_diag_cnt diag_cnt; u32 vsc_addr; u32 issi; struct mlx5_special_contexts special_contexts; diff --git a/sys/dev/mlx5/mlx5_core/diag_cnt.h b/sys/dev/mlx5/mlx5_core/diag_cnt.h new file mode 100644 index 000000000000..25c460b19382 --- /dev/null +++ b/sys/dev/mlx5/mlx5_core/diag_cnt.h @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2018, Mellanox Technologies, Ltd. + * + * 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 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 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 __MLX5_DIAG_CNT_H__ +#define __MLX5_DIAG_CNT_H__ + +#include +#include + +#define MLX5_DIAG_CNT_SUPPORTED(mdev) \ + (MLX5_CAP_GEN(mdev, debug) && \ + MLX5_CAP_GEN(mdev, num_of_diagnostic_counters)) + +int mlx5_diag_cnt_init(struct mlx5_core_dev *); +void mlx5_diag_cnt_cleanup(struct mlx5_core_dev *); + +int mlx5_diag_query_params(struct mlx5_core_dev *); +int mlx5_diag_set_params(struct mlx5_core_dev *); +int mlx5_diag_query_counters(struct mlx5_core_dev *, u8 * *out_buffer); + +#endif /* __MLX5_DIAG_CNT_H__ */ diff --git a/sys/dev/mlx5/mlx5_core/mlx5_diag_cnt.c b/sys/dev/mlx5/mlx5_core/mlx5_diag_cnt.c new file mode 100644 index 000000000000..83f8bf2b148f --- /dev/null +++ b/sys/dev/mlx5/mlx5_core/mlx5_diag_cnt.c @@ -0,0 +1,579 @@ +/*- + * Copyright (c) 2018, Mellanox Technologies, Ltd. + * + * 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 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 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 + +static int get_supported_cnt_ids(struct mlx5_core_dev *dev); +static int enable_cnt_id(struct mlx5_core_dev *dev, u16 id); +static void reset_cnt_id(struct mlx5_core_dev *dev); +static void reset_params(struct mlx5_diag_cnt *diag_cnt); + +static int +mlx5_sysctl_counter_id(SYSCTL_HANDLER_ARGS) +{ + struct mlx5_diag_cnt *diag_cnt; + struct mlx5_core_dev *dev; + uint16_t *ptr; + size_t max; + size_t num; + size_t x; + int err; + + dev = arg1; + diag_cnt = &dev->diag_cnt; + + max = MLX5_CAP_GEN(dev, num_of_diagnostic_counters); + + ptr = kmalloc(sizeof(ptr[0]) * max, GFP_KERNEL); + + DIAG_LOCK(diag_cnt); + + for (x = num = 0; x != max; x++) { + if (diag_cnt->cnt_id[x].enabled) + ptr[num++] = diag_cnt->cnt_id[x].id; + } + + err = SYSCTL_OUT(req, ptr, sizeof(ptr[0]) * num); + if (err || !req->newptr) + goto done; + + num = req->newlen / sizeof(ptr[0]); + if (num > max) { + err = ENOMEM; + goto done; + } + + err = SYSCTL_IN(req, ptr, sizeof(ptr[0]) * num); + + reset_cnt_id(dev); + + for (x = 0; x != num; x++) { + err = enable_cnt_id(dev, ptr[x]); + if (err) + goto done; + } + + diag_cnt->num_cnt_id = num; +done: + kfree(ptr); + + if (err != 0 && req->newptr != NULL) + reset_cnt_id(dev); + + DIAG_UNLOCK(diag_cnt); + + return (err); +} + +#define NUM_OF_DIAG_PARAMS 5 + +static int +mlx5_sysctl_params(SYSCTL_HANDLER_ARGS) +{ + struct mlx5_diag_cnt *diag_cnt; + struct mlx5_core_dev *dev; + uint32_t temp[NUM_OF_DIAG_PARAMS]; + int err; + + dev = arg1; + diag_cnt = &dev->diag_cnt; + + DIAG_LOCK(diag_cnt); + + temp[0] = diag_cnt->log_num_of_samples; + temp[1] = diag_cnt->log_sample_period; + temp[2] = diag_cnt->flag; + temp[3] = diag_cnt->num_of_samples; + temp[4] = diag_cnt->sample_index; + + err = SYSCTL_OUT(req, temp, sizeof(temp)); + if (err || !req->newptr) + goto done; + + err = SYSCTL_IN(req, temp, sizeof(temp)); + if (err) + goto done; + + reset_params(&dev->diag_cnt); + + if (temp[0] > MLX5_CAP_DEBUG(dev, log_max_samples) || + (1U << (MLX5_CAP_DEBUG(dev, log_max_samples) - temp[0])) < + diag_cnt->num_cnt_id) { + err = ERANGE; + goto done; + } else if (temp[1] < MLX5_CAP_DEBUG(dev, log_min_sample_period)) { + err = ERANGE; + goto done; + } else if (temp[2] >= 0x100) { + err = ERANGE; + goto done; + } else if (temp[3] > (1U << diag_cnt->log_num_of_samples)) { + err = ERANGE; + goto done; + } else if (temp[4] > (1U << diag_cnt->log_num_of_samples)) { + err = ERANGE; + goto done; + } + + diag_cnt->log_num_of_samples = temp[0]; + diag_cnt->log_sample_period = temp[1]; + diag_cnt->flag = temp[2]; + diag_cnt->num_of_samples = temp[3]; + diag_cnt->sample_index = temp[4]; +done: + DIAG_UNLOCK(diag_cnt); + + return (err); +} + +static void +decode_cnt_buffer(u32 num_of_samples, u8 *out, struct sbuf *sbuf) +{ + void *cnt; + u64 temp; + u32 i; + + for (i = 0; i != num_of_samples; i++) { + cnt = MLX5_ADDR_OF(query_diagnostic_counters_out, + out, diag_counter[i]); + temp = MLX5_GET(diagnostic_cntr_struct, cnt, counter_value_h); + temp = (temp << 32) | + MLX5_GET(diagnostic_cntr_struct, cnt, counter_value_l); + sbuf_printf(sbuf, + "0x%04x,0x%04x,0x%08x,0x%016llx\n", + MLX5_GET(diagnostic_cntr_struct, cnt, counter_id), + MLX5_GET(diagnostic_cntr_struct, cnt, sample_id), + MLX5_GET(diagnostic_cntr_struct, cnt, time_stamp_31_0), + (unsigned long long)temp); + } +} + +static int +mlx5_sysctl_dump_set(SYSCTL_HANDLER_ARGS) +{ + struct mlx5_diag_cnt *diag_cnt; + struct mlx5_core_dev *dev; + uint8_t temp; + int err; + + dev = arg1; + diag_cnt = &dev->diag_cnt; + + DIAG_LOCK(diag_cnt); + + err = SYSCTL_OUT(req, &diag_cnt->ready, sizeof(diag_cnt->ready)); + if (err || !req->newptr) + goto done; + + err = SYSCTL_IN(req, &temp, sizeof(temp)); + if (err) + goto done; + + diag_cnt->ready = (temp != 0); + if (diag_cnt->ready != 0) + err = -mlx5_diag_set_params(dev); +done: + DIAG_UNLOCK(diag_cnt); + + return (err); +} + +static int +mlx5_sysctl_dump_get(SYSCTL_HANDLER_ARGS) +{ + struct mlx5_diag_cnt *diag_cnt; + struct mlx5_core_dev *dev; + struct sbuf sbuf; + u8 *out; + int err; + + dev = arg1; + diag_cnt = &dev->diag_cnt; + + err = sysctl_wire_old_buffer(req, 0); + if (err != 0) + return (err); + + DIAG_LOCK(diag_cnt); + + sbuf_new_for_sysctl(&sbuf, NULL, 65536, req); + + if (diag_cnt->ready != 0) { + err = -mlx5_diag_query_counters(dev, &out); + if (err) { + sbuf_printf(&sbuf, "\nCould not query counters: %d\n", err); + } else { + sbuf_printf(&sbuf, "\n"); + decode_cnt_buffer(diag_cnt->num_of_samples * + diag_cnt->num_cnt_id, out, &sbuf); + kfree(out); + } + } else { + sbuf_printf(&sbuf, "\nDump was not set.\n"); + } + + err = sbuf_finish(&sbuf); + + sbuf_delete(&sbuf); + + DIAG_UNLOCK(diag_cnt); + + return (err); +} + +static int +mlx5_sysctl_cap_read(SYSCTL_HANDLER_ARGS) +{ + struct mlx5_diag_cnt *diag_cnt; + struct mlx5_core_dev *dev; + struct sbuf sbuf; + int err; + u32 i; + + dev = arg1; + diag_cnt = &dev->diag_cnt; + + err = sysctl_wire_old_buffer(req, 0); + if (err != 0) + return (err); + + DIAG_LOCK(diag_cnt); + + sbuf_new_for_sysctl(&sbuf, NULL, 8192, req); + + sbuf_printf(&sbuf, "\n"); + + /* print cap */ + sbuf_printf(&sbuf, "log_max_samples=%d\n", + MLX5_CAP_DEBUG(dev, log_max_samples)); + sbuf_printf(&sbuf, "log_min_sample_period=%d\n", + MLX5_CAP_DEBUG(dev, log_min_sample_period)); + sbuf_printf(&sbuf, "repetitive=%d\n", + MLX5_CAP_DEBUG(dev, repetitive)); + sbuf_printf(&sbuf, "single=%d\n", + MLX5_CAP_DEBUG(dev, single)); + sbuf_printf(&sbuf, "num_of_diagnostic_counters=%d\n", + MLX5_CAP_GEN(dev, num_of_diagnostic_counters)); + + /* print list of supported counter */ + sbuf_printf(&sbuf, "supported counter id:\n"); + for (i = 0; i != MLX5_CAP_GEN(dev, num_of_diagnostic_counters); i++) + sbuf_printf(&sbuf, "0x%04x,", diag_cnt->cnt_id[i].id); + sbuf_printf(&sbuf, "\n"); + + err = sbuf_finish(&sbuf); + sbuf_delete(&sbuf); + + DIAG_UNLOCK(diag_cnt); + + return (err); +} + +static int +get_supported_cnt_ids(struct mlx5_core_dev *dev) +{ + u32 num_counters = MLX5_CAP_GEN(dev, num_of_diagnostic_counters); + struct mlx5_diag_cnt *diag_cnt = &dev->diag_cnt; + u32 i; + + diag_cnt->cnt_id = kzalloc(sizeof(*diag_cnt->cnt_id) * num_counters, + GFP_KERNEL); + if (!diag_cnt->cnt_id) + return (-ENOMEM); + + for (i = 0; i != num_counters; i++) { + diag_cnt->cnt_id[i].id = + MLX5_CAP_DEBUG(dev, diagnostic_counter[i].counter_id); + } + return (0); +} + +static void +reset_cnt_id(struct mlx5_core_dev *dev) +{ + struct mlx5_diag_cnt *diag_cnt = &dev->diag_cnt; + u32 i; + + diag_cnt->num_cnt_id = 0; + for (i = 0; i != MLX5_CAP_GEN(dev, num_of_diagnostic_counters); i++) + diag_cnt->cnt_id[i].enabled = false; +} + +static int +enable_cnt_id(struct mlx5_core_dev *dev, u16 id) +{ + struct mlx5_diag_cnt *diag_cnt = &dev->diag_cnt; + u32 i; + + for (i = 0; i != MLX5_CAP_GEN(dev, num_of_diagnostic_counters); i++) { + if (diag_cnt->cnt_id[i].id == id) { + if (diag_cnt->cnt_id[i].enabled) + return (EINVAL); + + diag_cnt->cnt_id[i].enabled = true; + break; + } + } + + if (i == MLX5_CAP_GEN(dev, num_of_diagnostic_counters)) + return (ENOENT); + else + return (0); +} + +static void +reset_params(struct mlx5_diag_cnt *diag_cnt) +{ + diag_cnt->log_num_of_samples = 0; + diag_cnt->log_sample_period = 0; + diag_cnt->flag = 0; + diag_cnt->num_of_samples = 0; + diag_cnt->sample_index = 0; +} + +int +mlx5_diag_set_params(struct mlx5_core_dev *dev) +{ + u8 out[MLX5_ST_SZ_BYTES(set_diagnostic_params_out)] = {0}; + struct mlx5_diag_cnt *diag_cnt = &dev->diag_cnt; + void *cnt_id; + void *ctx; + u16 in_sz; + int err; + u8 *in; + u32 i; + u32 j; + + if (!diag_cnt->num_cnt_id) + return (-EINVAL); + + in_sz = MLX5_ST_SZ_BYTES(set_diagnostic_params_in) + + diag_cnt->num_cnt_id * MLX5_ST_SZ_BYTES(counter_id); + in = kzalloc(in_sz, GFP_KERNEL); + if (!in) + return (-ENOMEM); + + MLX5_SET(set_diagnostic_params_in, in, opcode, + MLX5_CMD_OP_SET_DIAGNOSTICS); + + ctx = MLX5_ADDR_OF(set_diagnostic_params_in, in, + diagnostic_params_ctx); + MLX5_SET(diagnostic_params_context, ctx, num_of_counters, + diag_cnt->num_cnt_id); + MLX5_SET(diagnostic_params_context, ctx, log_num_of_samples, + diag_cnt->log_num_of_samples); + + MLX5_SET(diagnostic_params_context, ctx, single, + (diag_cnt->flag >> 7) & 1); + MLX5_SET(diagnostic_params_context, ctx, repetitive, + (diag_cnt->flag >> 6) & 1); + MLX5_SET(diagnostic_params_context, ctx, sync, + (diag_cnt->flag >> 5) & 1); + MLX5_SET(diagnostic_params_context, ctx, clear, + (diag_cnt->flag >> 4) & 1); + MLX5_SET(diagnostic_params_context, ctx, on_demand, + (diag_cnt->flag >> 3) & 1); + MLX5_SET(diagnostic_params_context, ctx, enable, + (diag_cnt->flag >> 2) & 1); + MLX5_SET(diagnostic_params_context, ctx, log_sample_period, + diag_cnt->log_sample_period); + + for (i = j = 0; i != MLX5_CAP_GEN(dev, num_of_diagnostic_counters); i++) { + if (diag_cnt->cnt_id[i].enabled) { + cnt_id = MLX5_ADDR_OF(diagnostic_params_context, + ctx, counter_id[j]); + MLX5_SET(counter_id, cnt_id, counter_id, + diag_cnt->cnt_id[i].id); + j++; + } + } + + err = mlx5_cmd_exec(dev, in, in_sz, out, sizeof(out)); + + kfree(in); + return (err); +} + +/* This function is for debug purpose */ +int +mlx5_diag_query_params(struct mlx5_core_dev *dev) +{ + u8 in[MLX5_ST_SZ_BYTES(query_diagnostic_params_in)] = {0}; + struct mlx5_diag_cnt *diag_cnt = &dev->diag_cnt; + void *cnt_id; + u16 out_sz; + void *ctx; + int err; + u8 *out; + u32 i; + + out_sz = MLX5_ST_SZ_BYTES(query_diagnostic_params_out) + + diag_cnt->num_cnt_id * MLX5_ST_SZ_BYTES(counter_id); + + out = kzalloc(out_sz, GFP_KERNEL); + if (!out) + return (-ENOMEM); + + MLX5_SET(query_diagnostic_params_in, in, opcode, + MLX5_CMD_OP_QUERY_DIAGNOSTIC_PARAMS); + err = mlx5_cmd_exec(dev, in, sizeof(in), out, out_sz); + if (err) + goto out; + + ctx = MLX5_ADDR_OF(query_diagnostic_params_out, out, + diagnostic_params_ctx); + mlx5_core_dbg(dev, "single=%x\n", + MLX5_GET(diagnostic_params_context, ctx, single)); + mlx5_core_dbg(dev, "repetitive=%x\n", + MLX5_GET(diagnostic_params_context, ctx, repetitive)); + mlx5_core_dbg(dev, "sync=%x\n", + MLX5_GET(diagnostic_params_context, ctx, sync)); + mlx5_core_dbg(dev, "clear=%x\n", + MLX5_GET(diagnostic_params_context, ctx, clear)); + mlx5_core_dbg(dev, "on_demand=%x\n", + MLX5_GET(diagnostic_params_context, ctx, on_demand)); + mlx5_core_dbg(dev, "enable=%x\n", + MLX5_GET(diagnostic_params_context, ctx, enable)); + mlx5_core_dbg(dev, "log_sample_period=%x\n", + MLX5_GET(diagnostic_params_context, ctx, + log_sample_period)); + + for (i = 0; i != diag_cnt->num_cnt_id; i++) { + cnt_id = MLX5_ADDR_OF(diagnostic_params_context, + ctx, counter_id[i]); + mlx5_core_dbg(dev, "counter_id[%d]=%x\n", i, + MLX5_GET(counter_id, cnt_id, counter_id)); + } +out: + kfree(out); + return (err); +} + +int +mlx5_diag_query_counters(struct mlx5_core_dev *dev, u8 **out_buffer) +{ + u8 in[MLX5_ST_SZ_BYTES(query_diagnostic_counters_in)] = {0}; + struct mlx5_diag_cnt *diag_cnt = &dev->diag_cnt; + u16 out_sz; + u8 *out; + int err; + + out_sz = MLX5_ST_SZ_BYTES(query_diagnostic_counters_out) + + diag_cnt->num_of_samples * diag_cnt->num_cnt_id * + MLX5_ST_SZ_BYTES(diagnostic_cntr_struct); + + out = kzalloc(out_sz, GFP_KERNEL); + if (!out) + return (-ENOMEM); + + MLX5_SET(query_diagnostic_counters_in, in, opcode, + MLX5_CMD_OP_QUERY_DIAGNOSTICS); + MLX5_SET(query_diagnostic_counters_in, in, num_of_samples, + diag_cnt->num_of_samples); + MLX5_SET(query_diagnostic_counters_in, in, sample_index, + diag_cnt->sample_index); + + err = mlx5_cmd_exec(dev, in, sizeof(in), out, out_sz); + + if (!err) + *out_buffer = out; + else + kfree(out); + + return (err); +} + +int +mlx5_diag_cnt_init(struct mlx5_core_dev *dev) +{ + struct mlx5_diag_cnt *diag_cnt = &dev->diag_cnt; + struct sysctl_oid *diag_cnt_sysctl_node; + int err; + + if (!MLX5_DIAG_CNT_SUPPORTED(dev)) + return (0); + + mutex_init(&diag_cnt->lock); + + /* Build private data */ + err = get_supported_cnt_ids(dev); + if (err) + return (err); + + sysctl_ctx_init(&diag_cnt->sysctl_ctx); + + diag_cnt_sysctl_node = SYSCTL_ADD_NODE(&diag_cnt->sysctl_ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev->pdev->dev.bsddev)), + OID_AUTO, "diag_cnt", CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, + "Diagnostics counters"); + + if (diag_cnt_sysctl_node == NULL) + return (-ENOMEM); + + SYSCTL_ADD_PROC(&diag_cnt->sysctl_ctx, SYSCTL_CHILDREN(diag_cnt_sysctl_node), + OID_AUTO, "counter_id", CTLTYPE_U16 | CTLFLAG_RW | CTLFLAG_MPSAFE, + dev, 0, mlx5_sysctl_counter_id, "SU", "Selected counter IDs"); + + SYSCTL_ADD_PROC(&diag_cnt->sysctl_ctx, SYSCTL_CHILDREN(diag_cnt_sysctl_node), + OID_AUTO, "params", CTLTYPE_U32 | CTLFLAG_RW | CTLFLAG_MPSAFE, + dev, 0, mlx5_sysctl_params, "IU", + "Counter parameters: log_num_of_samples, log_sample_perios, flag, num_of_samples, sample_index"); + + SYSCTL_ADD_PROC(&diag_cnt->sysctl_ctx, SYSCTL_CHILDREN(diag_cnt_sysctl_node), + OID_AUTO, "dump_set", CTLTYPE_U8 | CTLFLAG_RW | CTLFLAG_MPSAFE, + dev, 0, mlx5_sysctl_dump_set, "CU", + "Set dump parameters by writing 1 and enable dump_get. Write 0 to disable dump."); + + SYSCTL_ADD_PROC(&diag_cnt->sysctl_ctx, SYSCTL_CHILDREN(diag_cnt_sysctl_node), + OID_AUTO, "dump_get", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + dev, 0, mlx5_sysctl_dump_get, "A", + "Get dump parameters."); + + SYSCTL_ADD_PROC(&diag_cnt->sysctl_ctx, SYSCTL_CHILDREN(diag_cnt_sysctl_node), + OID_AUTO, "cap", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + dev, 0, mlx5_sysctl_cap_read, "A", + "Read capabilities."); + + return (0); +} + +void +mlx5_diag_cnt_cleanup(struct mlx5_core_dev *dev) +{ + struct mlx5_diag_cnt *diag_cnt = &dev->diag_cnt; + void *ptr; + + if (!MLX5_DIAG_CNT_SUPPORTED(dev)) + return; + + sysctl_ctx_free(&diag_cnt->sysctl_ctx); + + ptr = diag_cnt->cnt_id; + diag_cnt->cnt_id = NULL; + + kfree(ptr); + + reset_params(diag_cnt); +} diff --git a/sys/dev/mlx5/mlx5_core/mlx5_main.c b/sys/dev/mlx5/mlx5_core/mlx5_main.c index 6fcd7cf281f2..431a277119cf 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_main.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_main.c @@ -1,5 +1,6 @@ /*- * Copyright (c) 2013-2021, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2022 NVIDIA corporation & affiliates. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -50,6 +51,7 @@ #include #include #include +#include #ifdef PCI_IOV #include #include @@ -1190,10 +1192,16 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv, goto err_mpfs; } + err = mlx5_diag_cnt_init(dev); + if (err) { + mlx5_core_err(dev, "diag cnt init failed %d\n", err); + goto err_fpga; + } + err = mlx5_register_device(dev); if (err) { mlx5_core_err(dev, "mlx5_register_device failed %d\n", err); - goto err_fpga; + goto err_diag_cnt; } set_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state); @@ -1202,6 +1210,9 @@ out: mutex_unlock(&dev->intf_state_mutex); return 0; +err_diag_cnt: + mlx5_diag_cnt_cleanup(dev); + err_fpga: mlx5_fpga_device_stop(dev); @@ -1272,6 +1283,7 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv, mlx5_unregister_device(dev); mlx5_eswitch_cleanup(dev->priv.eswitch); + mlx5_diag_cnt_cleanup(dev); mlx5_fpga_device_stop(dev); mlx5_mpfs_destroy(dev); mlx5_cleanup_fs(dev); diff --git a/sys/dev/mlx5/mlx5_ifc.h b/sys/dev/mlx5/mlx5_ifc.h index 627c367eace5..b931bf9b3a0b 100644 --- a/sys/dev/mlx5/mlx5_ifc.h +++ b/sys/dev/mlx5/mlx5_ifc.h @@ -186,6 +186,7 @@ enum { MLX5_CMD_OP_DEACTIVATE_TRACER = 0x815, MLX5_CMD_OP_ALLOC_TRANSPORT_DOMAIN = 0x816, MLX5_CMD_OP_DEALLOC_TRANSPORT_DOMAIN = 0x817, + MLX5_CMD_OP_QUERY_DIAGNOSTIC_PARAMS = 0x819, MLX5_CMD_OP_SET_DIAGNOSTICS = 0x820, MLX5_CMD_OP_QUERY_DIAGNOSTICS = 0x821, MLX5_CMD_OP_QUERY_CONG_STATUS = 0x822, @@ -5118,6 +5119,22 @@ struct mlx5_ifc_query_dc_cnak_trace_in_bits { u8 reserved_2[0x40]; }; +struct mlx5_ifc_diagnostic_cntr_struct_bits { + u8 counter_id[0x10]; + u8 sample_id[0x10]; + + u8 time_stamp_31_0[0x20]; + + u8 counter_value_h[0x20]; + + u8 counter_value_l[0x20]; +}; + +enum { + MLX5_DIAGNOSTIC_PARAMS_CONTEXT_ENABLE_ENABLE = 0x1, + MLX5_DIAGNOSTIC_PARAMS_CONTEXT_ENABLE_DISABLE = 0x0, +}; + struct mlx5_ifc_query_cq_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; @@ -6856,6 +6873,25 @@ struct mlx5_ifc_diagnostic_params_context_bits { struct mlx5_ifc_counter_id_bits counter_id[0]; }; +struct mlx5_ifc_query_diagnostic_params_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 reserved_at_40[0x40]; +}; + +struct mlx5_ifc_query_diagnostic_params_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + struct mlx5_ifc_diagnostic_params_context_bits diagnostic_params_ctx; +}; + struct mlx5_ifc_set_diagnostic_params_in_bits { u8 opcode[0x10]; u8 reserved_0[0x10]; diff --git a/sys/modules/mlx5/Makefile b/sys/modules/mlx5/Makefile index 2742a5f1ba90..d418375bdf69 100644 --- a/sys/modules/mlx5/Makefile +++ b/sys/modules/mlx5/Makefile @@ -8,6 +8,7 @@ SRCS= \ mlx5_alloc.c \ mlx5_cmd.c \ mlx5_cq.c \ +mlx5_diag_cnt.c \ mlx5_diagnostics.c \ mlx5_eq.c \ mlx5_eswitch.c \ From nobody Sun Apr 30 06:58:11 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HH73rrpz48sRq; Sun, 30 Apr 2023 06:58: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 4Q8HH739JCz3NgC; Sun, 30 Apr 2023 06:58:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L8rF+OibIgmfxuGZB2T+RWdNkYq6Q7NaQ3CnLoZ7PhY=; b=NJo0lV+DQQOJ0k2Q8UfuDobuhF6fNwZGZFCZz0/oitc94nhyhyHgAhxM7cKhX9G8l5sove BAxpcTTTkZNyuG3nSWC5IyhYLClLNvRxyhneEZJCFqpaYiHaSGLIqYazY99teMX59QXZl0 hQl7xcoOGbyAwxn/Ov69rfQhrgt47WTHeIbQ86MUOzghiakddMGKTL35sOrELaqU1oWR6N IFW0vefDOqWhuw+LzovopEvKYEsJpIdkltOq7oiWlWrZnD3kjanHxEmf9kVRmANyVIbzeq aGIuYCaOONXk+34ED2zLp7j+YtSCW6WhHF5cHy3KDEM2RfviOFbX9TDIYFf0YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L8rF+OibIgmfxuGZB2T+RWdNkYq6Q7NaQ3CnLoZ7PhY=; b=A6c/bMOMolypk4t564PQqPrem3lZSFrXjMINC9o3hP/uPDQxmkXDq8Zd8nanqFQfqt230q W668YF8XA3qe0s+WeIvh5aofIfazmK0aKXKdNrIq0eGki20FJHBeqgzyAeHyjRcREVFW8J hxoUSRZm6wiFDfR88skHlknc6ckbgTHmDw1lFlOPq0dGGT6GnWbf9c9++XlH22jb5md+bx FXZXO5cMRiDl5crTyAGei9oRYAm2ykfoC2x/CnnytEPMCWRRAPH1SxOexJ0++xA61IEL6p jJJ4F0icvf/gFhlxoS8li4voSVY1XVcMiKSASjmQ0spZ7tHwd/sxplMik6CTUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837891; a=rsa-sha256; cv=none; b=pW2IKEpWNTHFqe9YOESmRJPWlC2CGOBJ7v0JJaLBrWynmruLAt0XI+36kwc2NhIsOIq2S+ XzAzQNZDK9eqi+p1TPuyxGf952zV7tdukRfMV8XizCVBWRERntJqDYVjpUZE2/ajPnoevb ddVhrQubBVVdcHPhOpjAAFutihhBg/qhudZluJGLaU7ipD5j+Wx2VzRv3VebQ87PSiTfRX DrJkh09//RcIkafMaqphDaKyXENAwWLjvYR3UB7IyCvty5tqhndBnSJWE5zfye+WUmfSG6 gh3rJqDDJOvTLNAm3HbdmTuEMZXh3XrBDrpaWOeYVayg2/PBsK/mgSEmK3NRTQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HH72CYyzDsx; Sun, 30 Apr 2023 06:58: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 33U6wBT0071870; Sun, 30 Apr 2023 06:58:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6wBru071869; Sun, 30 Apr 2023 06:58:11 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:58:11 GMT Message-Id: <202304300658.33U6wBru071869@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 6148777d8692 - stable/13 - mlx5en(4): Explain why CQE zipping is off. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6148777d8692c4f31df011babe4deb16f308292b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=6148777d8692c4f31df011babe4deb16f308292b commit 6148777d8692c4f31df011babe4deb16f308292b Author: Hans Petter Selasky AuthorDate: 2023-04-18 11:12:32 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:19 +0000 mlx5en(4): Explain why CQE zipping is off. Sponsored by: NVIDIA Networking (cherry picked from commit 6bd4bb9bdbadb76c5502c7972df9f525b909e2f5) --- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index 7b754d901beb..97dcc04d7ae8 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -3841,9 +3841,10 @@ mlx5e_build_ifp_priv(struct mlx5_core_dev *mdev, priv->params.lro_wqe_sz = MLX5E_PARAMS_DEFAULT_LRO_WQE_SZ; /* - * CQE zipping is currently defaulted to off. when it won't - * anymore we will consider the HW capability: - * "!!MLX5_CAP_GEN(mdev, cqe_compression)" + * CQE zipping is off, because the per-packet 32-bit Toeplitz hash + * is then not supported. The 32-bit Toeplitz hash is needed to + * correctly demultiplex incoming traffic into the expected + * network queues. */ priv->params.cqe_zipping_en = false; From nobody Sun Apr 30 06:58:12 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HH84WnSz48sRv; Sun, 30 Apr 2023 06:58: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 4Q8HH841gJz3Nth; Sun, 30 Apr 2023 06:58:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xxn0RKvX7HldXlTzsOvgo8jL0xHRP+pRipmLroWJL+w=; b=xVd8VeBFUONux6DYiHu7Hl6g8Ii6dUAkr24ewPtd0vOzQJXBQMAvG7yfNQJZROeJivzrNT ZhDuQ0OUWFcgLR1ljHekpv3gEwiI8TvT99t9kKkxhQ0Xbk7RRwo4e2q392UdZlrZIbtOsb CT4gEnj2V9dB2SOPYd+0UZJorODtIuW7x1TRNlNFLlPYjWuIQIGUdHYZ9JuCPHv0p0R3dh W/5nAS62NULKJ2e0jC1xuhc5gk5zyDT4u8xfwE51KeKDrqkLA+NWoaHdwn3Legejt0tk77 tBAHeA5oDZvv0XHHhUdZ36JCi2IlF6dvAjunyhODRJ4I3J4kxTNn4Ieaa4Z/CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xxn0RKvX7HldXlTzsOvgo8jL0xHRP+pRipmLroWJL+w=; b=yWG4C17hNFuDeuHuDapn8jv0/ktWi5xphV8txc5AG4WR6KoL1MhY7JvWcbNAmcwmYF6hNS GAlOHNSBLZKWbH/uCUDS4iUFvWa801HRXFQakBivmMW/Vio6ItLGoEcGyoLZbYXTdNIrTp 5mXNJCPEQFFrecMrBALGWVpqPQgIVeER7LjyWXc2Gve0y1/wA/As3QARVaGmKTSPcLgrAf W6m6cuYf9Z/NKvkDN+9GfKtGz96yj07ldSvirZXOESlfUkAoZAhSYMLY/GP2E4V4QipwDq dCw62Q65j0rghdrnrNDhw26u327cxb6UnzD9gzotIkxTTMK+TcMCi7Q6Q9CR7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837892; a=rsa-sha256; cv=none; b=I2rQols0vxiI4blTjeDhtM5tfgO1Sura147/NRW4KzIRjhwe1AVgHFaw6aWA/Zd3hG3txj YZp9vuNY+n47gtdSfqzrDUR0Evd+CnoOKuK9VBSs+61HBck91CDo983ttIHAZqsuKLv5V8 VnSbif9cKKV8Bj2Hb8Q+ONC1excMrCbAaD9x9S6cWwJKDQpKZuAPW24xtZlntgIojFPbAk zGY9HGR+iWJgyHkTP7z5pNmr2UkcPJ9tg/0g+oFxAF9sXrnhHjDF63wBGVapAhjduidj+T Nk/DCVBmxh0/Mml7++Zifrvl43fu3Dq87fPa5ZowZEzfOwDKuZTRmbxM1H/8zg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HH837d6zDhV; Sun, 30 Apr 2023 06:58: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 33U6wCVd071892; Sun, 30 Apr 2023 06:58:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6wCCD071891; Sun, 30 Apr 2023 06:58:12 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:58:12 GMT Message-Id: <202304300658.33U6wCCD071891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: e8ad47b65447 - stable/13 - mlx5en(4): Don't wait for receive queue to fill up with mbufs during open channels. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: e8ad47b65447c98050f4888aa0c3298663bb6ddb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=e8ad47b65447c98050f4888aa0c3298663bb6ddb commit e8ad47b65447c98050f4888aa0c3298663bb6ddb Author: Hans Petter Selasky AuthorDate: 2023-04-18 11:42:17 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:19 +0000 mlx5en(4): Don't wait for receive queue to fill up with mbufs during open channels. Failure to get mbufs may be transient. Don't permanently fail to open the channels due to lack of mbufs. This also makes modifying channel parameters faster. Sponsored by: NVIDIA Networking (cherry picked from commit 1943c40cd655b7259b9b21849f328362c97a2657) --- sys/dev/mlx5/mlx5_en/en.h | 2 -- sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c | 5 ----- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 26 -------------------------- 3 files changed, 33 deletions(-) diff --git a/sys/dev/mlx5/mlx5_en/en.h b/sys/dev/mlx5/mlx5_en/en.h index f552b1b653a6..41ea5c493d46 100644 --- a/sys/dev/mlx5/mlx5_en/en.h +++ b/sys/dev/mlx5/mlx5_en/en.h @@ -107,7 +107,6 @@ #define MLX5E_PARAMS_DEFAULT_RX_CQ_MODERATION_PKTS 0x20 #define MLX5E_PARAMS_DEFAULT_TX_CQ_MODERATION_USEC 0x10 #define MLX5E_PARAMS_DEFAULT_TX_CQ_MODERATION_PKTS 0x20 -#define MLX5E_PARAMS_DEFAULT_MIN_RX_WQES 0x80 #define MLX5E_PARAMS_DEFAULT_RX_HASH_LOG_TBL_SZ 0x7 #define MLX5E_CACHELINE_SIZE CACHE_LINE_SIZE #define MLX5E_HW2SW_MTU(hwmtu) \ @@ -672,7 +671,6 @@ struct mlx5e_params { u16 rx_cq_moderation_pkts; u16 tx_cq_moderation_usec; u16 tx_cq_moderation_pkts; - u16 min_rx_wqes; bool hw_lro_en; bool cqe_zipping_en; u32 lro_wqe_sz; diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c b/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c index f57d70080a46..ec861a4b260c 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c @@ -1035,11 +1035,6 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) priv->params_ethtool.rx_queue_size = 1 << priv->params.log_rq_size; - /* update least number of RX WQEs */ - priv->params.min_rx_wqes = min( - priv->params_ethtool.rx_queue_size - 1, - MLX5E_PARAMS_DEFAULT_MIN_RX_WQES); - /* restart network interface, if any */ if (was_opened) mlx5e_open_locked(priv->ifp); diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index 97dcc04d7ae8..8bedf0ab7729 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -1402,23 +1402,6 @@ mlx5e_disable_rq(struct mlx5e_rq *rq) mlx5_core_destroy_rq(mdev, rq->rqn); } -static int -mlx5e_wait_for_min_rx_wqes(struct mlx5e_rq *rq) -{ - struct mlx5e_channel *c = rq->channel; - struct mlx5e_priv *priv = c->priv; - struct mlx5_wq_ll *wq = &rq->wq; - int i; - - for (i = 0; i < 1000; i++) { - if (wq->cur_sz >= priv->params.min_rx_wqes) - return (0); - - msleep(4); - } - return (-ETIMEDOUT); -} - static int mlx5e_open_rq(struct mlx5e_channel *c, struct mlx5e_rq_param *param, @@ -2504,7 +2487,6 @@ mlx5e_open_channels(struct mlx5e_priv *priv) struct mlx5e_channel_param *cparam; int err; int i; - int j; cparam = malloc(sizeof(*cparam), M_MLX5EN, M_WAITOK); @@ -2538,12 +2520,6 @@ mlx5e_open_channels(struct mlx5e_priv *priv) intr_setaffinity(irq, CPU_WHICH_INTRHANDLER, &cpuset); } } - - for (j = 0; j < priv->params.num_channels; j++) { - err = mlx5e_wait_for_min_rx_wqes(&priv->channel[j].rq); - if (err) - goto err_close_channels; - } free(cparam, M_MLX5EN); return (0); @@ -3817,8 +3793,6 @@ mlx5e_build_ifp_priv(struct mlx5_core_dev *mdev, MLX5E_PARAMS_DEFAULT_TX_CQ_MODERATION_USEC; priv->params.tx_cq_moderation_pkts = MLX5E_PARAMS_DEFAULT_TX_CQ_MODERATION_PKTS; - priv->params.min_rx_wqes = - MLX5E_PARAMS_DEFAULT_MIN_RX_WQES; priv->params.rx_hash_log_tbl_sz = (order_base_2(num_comp_vectors) > MLX5E_PARAMS_DEFAULT_RX_HASH_LOG_TBL_SZ) ? From nobody Sun Apr 30 06:58:13 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HH96bRQz48sDs; Sun, 30 Apr 2023 06:58: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 4Q8HH94Wwpz3Nh6; Sun, 30 Apr 2023 06:58:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DaMCCzYYbvv2HxlE+YgcxAffmKoVoYj8dxvX0hucd1k=; b=ipWxKupIkcggTFDlrGvXRGmvvQMNPCFUa5Tex94QFa8WjCuwoM9Ggarp+XqRWpSpSY8qhd 6y0Que+SCwvIUqFXOzVNKUX5R29m7rkD2ID3Wi7iZj+ZyuCLJ7uVa442bsiJiusmqhnJ94 JV5yLw0ClqW5Jr7dGgUPZ5YM4zqCXXVrn45xgjzSJhgrAFBLdwpV6SOf77oZjtA3Gou7dQ v23ewx59WyiWNiKQTzVnBVBGPLqyzjmeOLUjY8PKFrlv7dS625i9EAGyd5ZQ3SW4X4jqUJ 8NxrH1hiGWvlolimDuDrCKhRuYgUkN9fF63uNGxGCXhaSsodXzRwg0+XgY9SWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DaMCCzYYbvv2HxlE+YgcxAffmKoVoYj8dxvX0hucd1k=; b=skookalqOG0+iwMoUMntGbSgYbx2rUnikMN9q7ul7XCYF+AwzM5/RJqzhN+HiEPIlGqzUC vnILhBnrzyCoXTUVhwlXNbti2sxPURANHxZaYFhvjRG00iBiQ8AgwDIxYPgpL3FK+eKbeF 5sIXEMMYLOsAe5XYZv2kSh7Lar2OLkxUgEo6q//R9VdXQaS3zqmAILIWPBrRb11oHjmP8V SwB0kjYXwjl68kM/TO3zkoaYJVY2J9NKjgoQRSATZt3MX5ckxUumQPHRWdoOB1rk7WD83x eviAorN36Fyujz2s83AN/ff/57qFW+AHoYT23jcFgogJ/mkD0j6g35PwDbefzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837893; a=rsa-sha256; cv=none; b=QmuSK/jWJ0fGRAUpBp1FRxbVpxI+wHs6ssJaWk+MWlGwUoh84V0RQo6SgXADTkGs082ZWf hHSmMzGYPbNsVSJoLk7oVSzS1SmdL67fXbA+Ew65j0S/S3lOT7hCUA5Bi9MV2Q23u9XueX C+Xm2L4OrFN3SYJugn2UTTrbx91JnKaacD+l62EUHWflHD/7ScD6729IvjlsfKQeJ9eHYs 9GK42chx0IRS+R9ehaHMDkbm5I3EuEQ8B9Eww/JcVjp4Zu3wm+Vx+ksnLVM+PdLtHC6p/C 9ELFtW6ozThpV0vavXyhpMK/OLcOdTvIQ0Zn6N+7yvxyQGoWJEUGV4FqF/IMYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HH93dgSz1CvJ; Sun, 30 Apr 2023 06:58: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 33U6wDAV071920; Sun, 30 Apr 2023 06:58:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6wDnw071919; Sun, 30 Apr 2023 06:58:13 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:58:13 GMT Message-Id: <202304300658.33U6wDnw071919@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 090e6cbc4d56 - stable/13 - mlx5: Make mlx5_del_flow_rule() NULL safe. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 090e6cbc4d56546e9ed9c462c8b063e95122361e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=090e6cbc4d56546e9ed9c462c8b063e95122361e commit 090e6cbc4d56546e9ed9c462c8b063e95122361e Author: Hans Petter Selasky AuthorDate: 2023-04-18 11:16:16 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:19 +0000 mlx5: Make mlx5_del_flow_rule() NULL safe. This change factors out repeated NULL checks. No functional change intended. Sponsored by: NVIDIA Networking (cherry picked from commit b0b87d9151456e71fd6a14736e132d67114db4aa) --- sys/dev/mlx5/fs.h | 2 +- sys/dev/mlx5/mlx5_core/mlx5_eswitch.c | 25 ++--- sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c | 6 +- sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c | 8 +- sys/dev/mlx5/mlx5_en/en.h | 1 - sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c | 162 ++++++------------------------ sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c | 10 +- 7 files changed, 51 insertions(+), 163 deletions(-) diff --git a/sys/dev/mlx5/fs.h b/sys/dev/mlx5/fs.h index e5ec897fd9f1..7246d8ddbd80 100644 --- a/sys/dev/mlx5/fs.h +++ b/sys/dev/mlx5/fs.h @@ -158,7 +158,7 @@ mlx5_add_flow_rule(struct mlx5_flow_table *ft, u32 action, u32 flow_tag, struct mlx5_flow_destination *dest); -void mlx5_del_flow_rule(struct mlx5_flow_rule *fr); +void mlx5_del_flow_rule(struct mlx5_flow_rule **); /*The following API is for sniffer*/ typedef int (*rule_event_fn)(struct mlx5_flow_rule *rule, diff --git a/sys/dev/mlx5/mlx5_core/mlx5_eswitch.c b/sys/dev/mlx5/mlx5_core/mlx5_eswitch.c index 6d3be72427c9..4e0da94483e8 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_eswitch.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_eswitch.c @@ -398,9 +398,7 @@ static int esw_del_uc_addr(struct mlx5_eswitch *esw, struct vport_addr *vaddr) mlx5_mpfs_del_mac(esw->dev, esw_uc->table_index); - if (vaddr->flow_rule) - mlx5_del_flow_rule(vaddr->flow_rule); - vaddr->flow_rule = NULL; + mlx5_del_flow_rule(&vaddr->flow_rule); l2addr_hash_del(esw_uc); return 0; @@ -459,15 +457,12 @@ static int esw_del_mc_addr(struct mlx5_eswitch *esw, struct vport_addr *vaddr) vport, mac, vaddr->flow_rule, esw_mc->refcnt, esw_mc->uplink_rule); - if (vaddr->flow_rule) - mlx5_del_flow_rule(vaddr->flow_rule); - vaddr->flow_rule = NULL; + mlx5_del_flow_rule(&vaddr->flow_rule); if (--esw_mc->refcnt) return 0; - if (esw_mc->uplink_rule) - mlx5_del_flow_rule(esw_mc->uplink_rule); + mlx5_del_flow_rule(&esw_mc->uplink_rule); l2addr_hash_del(esw_mc); return 0; @@ -684,14 +679,8 @@ out: static void esw_vport_cleanup_egress_rules(struct mlx5_eswitch *esw, struct mlx5_vport *vport) { - if (!IS_ERR_OR_NULL(vport->egress.allowed_vlan)) - mlx5_del_flow_rule(vport->egress.allowed_vlan); - - if (!IS_ERR_OR_NULL(vport->egress.drop_rule)) - mlx5_del_flow_rule(vport->egress.drop_rule); - - vport->egress.allowed_vlan = NULL; - vport->egress.drop_rule = NULL; + mlx5_del_flow_rule(&vport->egress.allowed_vlan); + mlx5_del_flow_rule(&vport->egress.drop_rule); } static void esw_vport_disable_egress_acl(struct mlx5_eswitch *esw, @@ -775,9 +764,7 @@ out: static void esw_vport_cleanup_ingress_rules(struct mlx5_eswitch *esw, struct mlx5_vport *vport) { - if (!IS_ERR_OR_NULL(vport->ingress.drop_rule)) - mlx5_del_flow_rule(vport->ingress.drop_rule); - vport->ingress.drop_rule = NULL; + mlx5_del_flow_rule(&vport->ingress.drop_rule); } static void esw_vport_disable_ingress_acl(struct mlx5_eswitch *esw, diff --git a/sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c b/sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c index 543c7a4ef502..4dceaea7ea72 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c @@ -83,7 +83,7 @@ accel_fs_tcp_set_ipv6_flow(struct mlx5_flow_spec *spec, struct inpcb *inp) void mlx5e_accel_fs_del_inpcb(struct mlx5_flow_rule *rule) { - mlx5_del_flow_rule(rule); + mlx5_del_flow_rule(&rule); } struct mlx5_flow_rule * @@ -341,7 +341,7 @@ accel_fs_tcp_destroy_table(struct mlx5e_priv *priv, int i) fs_tcp = &priv->fts.accel_tcp; ft = fs_tcp->tables + i; - mlx5_del_flow_rule(fs_tcp->default_rules[i]); + mlx5_del_flow_rule(&fs_tcp->default_rules[i]); accel_fs_tcp_destroy_groups(ft); kfree(ft->g); @@ -394,7 +394,7 @@ mlx5e_accel_fs_tcp_create(struct mlx5e_priv *priv) err_destroy_rules: while (i--) - mlx5_del_flow_rule(priv->fts.accel_tcp.default_rules[i]); + mlx5_del_flow_rule(&priv->fts.accel_tcp.default_rules[i]); i = MLX5E_ACCEL_FS_TCP_NUM_TYPES; err_destroy_tables: diff --git a/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c b/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c index 86cffe67583d..8d8b4f59e95e 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c @@ -1878,10 +1878,16 @@ mlx5_add_flow_rule(struct mlx5_flow_table *ft, } EXPORT_SYMBOL(mlx5_add_flow_rule); -void mlx5_del_flow_rule(struct mlx5_flow_rule *dst) +void mlx5_del_flow_rule(struct mlx5_flow_rule **pp) { struct mlx5_flow_namespace *ns; + struct mlx5_flow_rule *dst; + + dst = *pp; + *pp = NULL; + if (IS_ERR_OR_NULL(dst)) + return; ns = get_ns_with_notifiers(&dst->base); if (ns) down_read(&ns->dests_rw_sem); diff --git a/sys/dev/mlx5/mlx5_en/en.h b/sys/dev/mlx5/mlx5_en/en.h index 41ea5c493d46..0dc2e334cced 100644 --- a/sys/dev/mlx5/mlx5_en/en.h +++ b/sys/dev/mlx5/mlx5_en/en.h @@ -953,7 +953,6 @@ struct mlx5_flow_rule; struct mlx5e_eth_addr_info { u8 addr [ETH_ALEN + 2]; - u32 tt_vec; /* flow table rule per traffic type */ struct mlx5_flow_rule *ft_rule[MLX5E_NUM_TT]; }; diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c b/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c index 5607aad50da5..4e07f5424353 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c @@ -145,41 +145,17 @@ static void mlx5e_del_eth_addr_from_flow_table(struct mlx5e_priv *priv, struct mlx5e_eth_addr_info *ai) { - if (ai->tt_vec & (1 << MLX5E_TT_IPV6_IPSEC_ESP)) - mlx5_del_flow_rule(ai->ft_rule[MLX5E_TT_IPV6_IPSEC_ESP]); - - if (ai->tt_vec & (1 << MLX5E_TT_IPV4_IPSEC_ESP)) - mlx5_del_flow_rule(ai->ft_rule[MLX5E_TT_IPV4_IPSEC_ESP]); - - if (ai->tt_vec & (1 << MLX5E_TT_IPV6_IPSEC_AH)) - mlx5_del_flow_rule(ai->ft_rule[MLX5E_TT_IPV6_IPSEC_AH]); - - if (ai->tt_vec & (1 << MLX5E_TT_IPV4_IPSEC_AH)) - mlx5_del_flow_rule(ai->ft_rule[MLX5E_TT_IPV4_IPSEC_AH]); - - if (ai->tt_vec & (1 << MLX5E_TT_IPV6_TCP)) - mlx5_del_flow_rule(ai->ft_rule[MLX5E_TT_IPV6_TCP]); - - if (ai->tt_vec & (1 << MLX5E_TT_IPV4_TCP)) - mlx5_del_flow_rule(ai->ft_rule[MLX5E_TT_IPV4_TCP]); - - if (ai->tt_vec & (1 << MLX5E_TT_IPV6_UDP)) - mlx5_del_flow_rule(ai->ft_rule[MLX5E_TT_IPV6_UDP]); - - if (ai->tt_vec & (1 << MLX5E_TT_IPV4_UDP)) - mlx5_del_flow_rule(ai->ft_rule[MLX5E_TT_IPV4_UDP]); - - if (ai->tt_vec & (1 << MLX5E_TT_IPV6)) - mlx5_del_flow_rule(ai->ft_rule[MLX5E_TT_IPV6]); - - if (ai->tt_vec & (1 << MLX5E_TT_IPV4)) - mlx5_del_flow_rule(ai->ft_rule[MLX5E_TT_IPV4]); - - if (ai->tt_vec & (1 << MLX5E_TT_ANY)) - mlx5_del_flow_rule(ai->ft_rule[MLX5E_TT_ANY]); - - /* ensure the rules are not freed again */ - ai->tt_vec = 0; + mlx5_del_flow_rule(&ai->ft_rule[MLX5E_TT_IPV6_IPSEC_ESP]); + mlx5_del_flow_rule(&ai->ft_rule[MLX5E_TT_IPV4_IPSEC_ESP]); + mlx5_del_flow_rule(&ai->ft_rule[MLX5E_TT_IPV6_IPSEC_AH]); + mlx5_del_flow_rule(&ai->ft_rule[MLX5E_TT_IPV4_IPSEC_AH]); + mlx5_del_flow_rule(&ai->ft_rule[MLX5E_TT_IPV6_TCP]); + mlx5_del_flow_rule(&ai->ft_rule[MLX5E_TT_IPV4_TCP]); + mlx5_del_flow_rule(&ai->ft_rule[MLX5E_TT_IPV6_UDP]); + mlx5_del_flow_rule(&ai->ft_rule[MLX5E_TT_IPV4_UDP]); + mlx5_del_flow_rule(&ai->ft_rule[MLX5E_TT_IPV6]); + mlx5_del_flow_rule(&ai->ft_rule[MLX5E_TT_IPV4]); + mlx5_del_flow_rule(&ai->ft_rule[MLX5E_TT_ANY]); } static int @@ -319,7 +295,6 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, MLX5_FS_ETH_FLOW_TAG, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; - ai->tt_vec |= BIT(MLX5E_TT_ANY); } mc_enable = MLX5_MATCH_OUTER_HEADERS; @@ -335,7 +310,6 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, MLX5_FS_ETH_FLOW_TAG, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; - ai->tt_vec |= BIT(MLX5E_TT_IPV4); } if (tt_vec & BIT(MLX5E_TT_IPV6)) { @@ -348,7 +322,6 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, MLX5_FS_ETH_FLOW_TAG, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; - ai->tt_vec |= BIT(MLX5E_TT_IPV6); } MLX5_SET_TO_ONES(fte_match_param, mc, outer_headers.ip_protocol); @@ -364,7 +337,6 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, MLX5_FS_ETH_FLOW_TAG, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; - ai->tt_vec |= BIT(MLX5E_TT_IPV4_UDP); } if (tt_vec & BIT(MLX5E_TT_IPV6_UDP)) { @@ -377,7 +349,6 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, MLX5_FS_ETH_FLOW_TAG, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; - ai->tt_vec |= BIT(MLX5E_TT_IPV6_UDP); } MLX5_SET(fte_match_param, mv, outer_headers.ip_protocol, IPPROTO_TCP); @@ -392,7 +363,6 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, MLX5_FS_ETH_FLOW_TAG, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; - ai->tt_vec |= BIT(MLX5E_TT_IPV4_TCP); } if (tt_vec & BIT(MLX5E_TT_IPV6_TCP)) { @@ -405,8 +375,6 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, MLX5_FS_ETH_FLOW_TAG, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; - - ai->tt_vec |= BIT(MLX5E_TT_IPV6_TCP); } MLX5_SET(fte_match_param, mv, outer_headers.ip_protocol, IPPROTO_AH); @@ -421,7 +389,6 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, MLX5_FS_ETH_FLOW_TAG, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; - ai->tt_vec |= BIT(MLX5E_TT_IPV4_IPSEC_AH); } if (tt_vec & BIT(MLX5E_TT_IPV6_IPSEC_AH)) { @@ -434,7 +401,6 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, MLX5_FS_ETH_FLOW_TAG, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; - ai->tt_vec |= BIT(MLX5E_TT_IPV6_IPSEC_AH); } MLX5_SET(fte_match_param, mv, outer_headers.ip_protocol, IPPROTO_ESP); @@ -449,7 +415,6 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, MLX5_FS_ETH_FLOW_TAG, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; - ai->tt_vec |= BIT(MLX5E_TT_IPV4_IPSEC_ESP); } if (tt_vec & BIT(MLX5E_TT_IPV6_IPSEC_ESP)) { @@ -462,7 +427,6 @@ mlx5e_add_eth_addr_rule_sub(struct mlx5e_priv *priv, MLX5_FS_ETH_FLOW_TAG, &dest); if (IS_ERR_OR_NULL(*rule_p)) goto err_del_ai; - ai->tt_vec |= BIT(MLX5E_TT_IPV6_IPSEC_ESP); } return 0; @@ -503,73 +467,17 @@ add_eth_addr_rule_out: static void mlx5e_del_main_vxlan_rules(struct mlx5e_priv *priv) { - struct mlx5_flow_rule **ra = priv->fts.main_vxlan_rule, **r; - - r = &ra[MLX5E_TT_IPV6_IPSEC_ESP]; - if (*r != NULL) { - mlx5_del_flow_rule(*r); - *r = NULL; - } - - r = &ra[MLX5E_TT_IPV4_IPSEC_ESP]; - if (*r != NULL) { - mlx5_del_flow_rule(*r); - *r = NULL; - } - - r = &ra[MLX5E_TT_IPV6_IPSEC_AH]; - if (*r != NULL) { - mlx5_del_flow_rule(*r); - *r = NULL; - } - - r = &ra[MLX5E_TT_IPV4_IPSEC_AH]; - if (*r != NULL) { - mlx5_del_flow_rule(*r); - *r = NULL; - } - - r = &ra[MLX5E_TT_IPV6_TCP]; - if (*r != NULL) { - mlx5_del_flow_rule(*r); - *r = NULL; - } - - r = &ra[MLX5E_TT_IPV4_TCP]; - if (*r != NULL) { - mlx5_del_flow_rule(*r); - *r = NULL; - } - - r = &ra[MLX5E_TT_IPV6_UDP]; - if (*r != NULL) { - mlx5_del_flow_rule(*r); - *r = NULL; - } - - r = &ra[MLX5E_TT_IPV4_UDP]; - if (*r != NULL) { - mlx5_del_flow_rule(*r); - *r = NULL; - } - - r = &ra[MLX5E_TT_IPV6]; - if (*r != NULL) { - mlx5_del_flow_rule(*r); - *r = NULL; - } - - r = &ra[MLX5E_TT_IPV4]; - if (*r != NULL) { - mlx5_del_flow_rule(*r); - *r = NULL; - } - - r = &ra[MLX5E_TT_ANY]; - if (*r != NULL) { - mlx5_del_flow_rule(*r); - *r = NULL; - } + mlx5_del_flow_rule(&priv->fts.main_vxlan_rule[MLX5E_TT_IPV6_IPSEC_ESP]); + mlx5_del_flow_rule(&priv->fts.main_vxlan_rule[MLX5E_TT_IPV4_IPSEC_ESP]); + mlx5_del_flow_rule(&priv->fts.main_vxlan_rule[MLX5E_TT_IPV6_IPSEC_AH]); + mlx5_del_flow_rule(&priv->fts.main_vxlan_rule[MLX5E_TT_IPV4_IPSEC_AH]); + mlx5_del_flow_rule(&priv->fts.main_vxlan_rule[MLX5E_TT_IPV6_TCP]); + mlx5_del_flow_rule(&priv->fts.main_vxlan_rule[MLX5E_TT_IPV4_TCP]); + mlx5_del_flow_rule(&priv->fts.main_vxlan_rule[MLX5E_TT_IPV6_UDP]); + mlx5_del_flow_rule(&priv->fts.main_vxlan_rule[MLX5E_TT_IPV4_UDP]); + mlx5_del_flow_rule(&priv->fts.main_vxlan_rule[MLX5E_TT_IPV6]); + mlx5_del_flow_rule(&priv->fts.main_vxlan_rule[MLX5E_TT_IPV4]); + mlx5_del_flow_rule(&priv->fts.main_vxlan_rule[MLX5E_TT_ANY]); } static int @@ -857,28 +765,16 @@ mlx5e_del_vlan_rule(struct mlx5e_priv *priv, { switch (rule_type) { case MLX5E_VLAN_RULE_TYPE_UNTAGGED: - if (priv->vlan.untagged_ft_rule) { - mlx5_del_flow_rule(priv->vlan.untagged_ft_rule); - priv->vlan.untagged_ft_rule = NULL; - } + mlx5_del_flow_rule(&priv->vlan.untagged_ft_rule); break; case MLX5E_VLAN_RULE_TYPE_ANY_CTAG_VID: - if (priv->vlan.any_cvlan_ft_rule) { - mlx5_del_flow_rule(priv->vlan.any_cvlan_ft_rule); - priv->vlan.any_cvlan_ft_rule = NULL; - } + mlx5_del_flow_rule(&priv->vlan.any_cvlan_ft_rule); break; case MLX5E_VLAN_RULE_TYPE_ANY_STAG_VID: - if (priv->vlan.any_svlan_ft_rule) { - mlx5_del_flow_rule(priv->vlan.any_svlan_ft_rule); - priv->vlan.any_svlan_ft_rule = NULL; - } + mlx5_del_flow_rule(&priv->vlan.any_svlan_ft_rule); break; case MLX5E_VLAN_RULE_TYPE_MATCH_VID: - if (priv->vlan.active_vlans_ft_rule[vid]) { - mlx5_del_flow_rule(priv->vlan.active_vlans_ft_rule[vid]); - priv->vlan.active_vlans_ft_rule[vid] = NULL; - } + mlx5_del_flow_rule(&priv->vlan.active_vlans_ft_rule[vid]); mlx5e_vport_context_update_vlans(priv); break; default: @@ -1997,7 +1893,7 @@ mlx5e_del_vxlan_rule(struct mlx5e_priv *priv, sa_family_t family, u_int port) } if (el->installed) - mlx5_del_flow_rule(el->vxlan_ft_rule); + mlx5_del_flow_rule(&el->vxlan_ft_rule); TAILQ_REMOVE(&priv->vxlan.head, el, link); kvfree(el); return (0); @@ -2011,7 +1907,7 @@ mlx5e_del_all_vxlan_rules(struct mlx5e_priv *priv) TAILQ_FOREACH(el, &priv->vxlan.head, link) { if (!el->installed) continue; - mlx5_del_flow_rule(el->vxlan_ft_rule); + mlx5_del_flow_rule(&el->vxlan_ft_rule); el->installed = false; } } @@ -2019,7 +1915,7 @@ mlx5e_del_all_vxlan_rules(struct mlx5e_priv *priv) static void mlx5e_del_vxlan_catchall_rule(struct mlx5e_priv *priv) { - mlx5_del_flow_rule(priv->fts.vxlan_catchall_ft_rule); + mlx5_del_flow_rule(&priv->fts.vxlan_catchall_ft_rule); } void diff --git a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c index b509bc9982fc..019fbff7b940 100644 --- a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c +++ b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c @@ -2124,13 +2124,13 @@ static int mlx5_ib_destroy_flow(struct ib_flow *flow_id) mutex_lock(&dev->flow_db.lock); list_for_each_entry_safe(iter, tmp, &handler->list, list) { - mlx5_del_flow_rule(iter->rule); + mlx5_del_flow_rule(&iter->rule); put_flow_table(dev, iter->prio, true); list_del(&iter->list); kfree(iter); } - mlx5_del_flow_rule(handler->rule); + mlx5_del_flow_rule(&handler->rule); put_flow_table(dev, handler->prio, true); mutex_unlock(&dev->flow_db.lock); @@ -2295,7 +2295,7 @@ static struct mlx5_ib_flow_handler *create_dont_trap_rule(struct mlx5_ib_dev *de handler_dst = create_flow_rule(dev, ft_prio, flow_attr, dst); if (IS_ERR(handler_dst)) { - mlx5_del_flow_rule(handler->rule); + mlx5_del_flow_rule(&handler->rule); ft_prio->refcount--; kfree(handler); handler = handler_dst; @@ -2358,7 +2358,7 @@ static struct mlx5_ib_flow_handler *create_leftovers_rule(struct mlx5_ib_dev *de &leftovers_specs[LEFTOVERS_UC].flow_attr, dst); if (IS_ERR(handler_ucast)) { - mlx5_del_flow_rule(handler->rule); + mlx5_del_flow_rule(&handler->rule); ft_prio->refcount--; kfree(handler); handler = handler_ucast; @@ -2400,7 +2400,7 @@ static struct mlx5_ib_flow_handler *create_sniffer_rule(struct mlx5_ib_dev *dev, return handler_rx; err_tx: - mlx5_del_flow_rule(handler_rx->rule); + mlx5_del_flow_rule(&handler_rx->rule); ft_rx->refcount--; kfree(handler_rx); err: From nobody Sun Apr 30 06:58:14 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HHC0VG4z48sV6; Sun, 30 Apr 2023 06:58: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 4Q8HHB5fKHz3Nkk; Sun, 30 Apr 2023 06:58:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=662WUmzoeoGtEkpdv6avgWkNjlPctwHjqw/2JTyRZ5w=; b=yhAb3V4xCB8Ew7j5IeO6xHK5Z+AxceY/yXyeTUJe9412VdqxamRfSPE/kWzFn/ODwY8hfW +V78n6kVdn58TEZNCVyxFnjqyx8dHwYkqrotq4Gier0/MJrubGffiUabc7dYkAw6RxyTL8 nd0DjmJZS996SMKiTlQ2nK6GJ72/Bbv/UEfSSRo1iBJ0vUkShDiecnER6Du6z/C0MgLLqb ltq7Qx/4QUz4mhx27XQm5VNNhKDplfjwkF2TSQsIw6rPM7DuRG86wfMpxkeZ+U7vcJ/TjZ 8uJjz5aTjYuh3XGmYXaarfatnm/Vi8xbj0P5R7tpP1mpFaeGZ/HhKHVvAeTp9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=662WUmzoeoGtEkpdv6avgWkNjlPctwHjqw/2JTyRZ5w=; b=V58AWLi5SbWoUTlDHR1mnYag48bwQXPBi2MEXewyjLm2wXr/9IS9EYEwv6D7vVigyNGLhd f8LlsoEShBamxPP8uYqSl9+FDQfdiEITVfyNjK9ntlPy1LemMB/jTcWbuu76hjo5xlDJsm nVOF4+fwPZBUbgh/mvGC+UnhyRjKepU7o3Dw0mXMKgpUP0KVz5gPij426PYaajTqJU9X6d k/ExR1jMb6B/aXyyp3+mulrfng9EHP36BgYlWrXaNUXQwmyqRDKuqkaZAmqNCTMVFQtr2X QEGyEOJEeOlPt3al0FieyIQDpolmjmLMESrK/TK9LO6KNp+WirFhxAFo+sw0TA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837894; a=rsa-sha256; cv=none; b=IIFMh5FWkiUpQTtY9N6omZd4+x3cLq3rT/3VXRoYeYpHZcUsS8Q9nddwSGxY0ek6ZRtVMT UdhoeeooELMRJvUtF26dqGMexBuqjveiWOdBtIoNgDa1P4V1413KIfyDGENyYtX/wJ02i0 s4UFNX+DXQSkj24J7noA9Yw0vJl2Ecm8hBa7J1QjMA4ASO1nuJys+/bV82LMgewPwajmF+ YpmhOw3zhoXqGyhpCpG9SfyfPKtc/AjgrMt6mlOcggECDz/GB4ViIzgi0akWFp/MB2Qf3B y2Z5CsGXP9OfD9CDMIII7B8ojki5vwnFcDNw+0tZNoAp5Qc0ROxX89qIInqeIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HHB4kzMz1CvK; Sun, 30 Apr 2023 06:58: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 33U6wElT071940; Sun, 30 Apr 2023 06:58:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6wEc8071939; Sun, 30 Apr 2023 06:58:14 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:58:14 GMT Message-Id: <202304300658.33U6wEc8071939@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: e6f76b5b4d36 - stable/13 - mlx5: Fix duplicate free of default flow rule in error case. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: e6f76b5b4d3675841b8ea4ffedfdd5a5469ae051 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=e6f76b5b4d3675841b8ea4ffedfdd5a5469ae051 commit e6f76b5b4d3675841b8ea4ffedfdd5a5469ae051 Author: Hans Petter Selasky AuthorDate: 2023-04-18 11:17:38 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:19 +0000 mlx5: Fix duplicate free of default flow rule in error case. Sponsored by: NVIDIA Networking (cherry picked from commit 2f7e9a8a21367393b613f0f150d49009fa74dd5c) --- sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c b/sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c index 4dceaea7ea72..54693e01ae1a 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_fs_tcp.c @@ -341,8 +341,6 @@ accel_fs_tcp_destroy_table(struct mlx5e_priv *priv, int i) fs_tcp = &priv->fts.accel_tcp; ft = fs_tcp->tables + i; - mlx5_del_flow_rule(&fs_tcp->default_rules[i]); - accel_fs_tcp_destroy_groups(ft); kfree(ft->g); ft->g = NULL; @@ -358,8 +356,10 @@ mlx5e_accel_fs_tcp_destroy(struct mlx5e_priv *priv) if (!MLX5_CAP_FLOWTABLE_NIC_RX(priv->mdev, ft_field_support.outer_ip_version)) return; - for (i = 0; i < MLX5E_ACCEL_FS_TCP_NUM_TYPES; i++) + for (i = 0; i < MLX5E_ACCEL_FS_TCP_NUM_TYPES; i++) { + mlx5_del_flow_rule(&priv->fts.accel_tcp.default_rules[i]); accel_fs_tcp_destroy_table(priv, i); + } } int From nobody Sun Apr 30 06:58:15 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HHD0BdGz48sBg; Sun, 30 Apr 2023 06:58:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q8HHC6Wnbz3P18; Sun, 30 Apr 2023 06:58:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6ugO0Nju/m9CmbxYsywlnr95Has3nD2Kl6h2z1aHCdQ=; b=ilIJFIU6Jw+T4SLnPwUJ4Hbrwyny3SopciuFr+Xib/0Xg01vMh+b1CvtTndd72ScEd8cz8 U9OdsE02CDtUhvKl5HAc/orR40wVnyWsL9BurNo9tNqpTIViu+56M5jSGFyXQMvRWwqUDO P8ZhfDSz9WLrZCQN4G9zeDDF2nxgKp5bSNSgeLpedqTBnGtjXqrG9QACfO4DYOMMXgBt3q 8mC5IE/1D1popKJe1F5sWNX0luumaGWUppese3fuYrgDKK0ZhhrHZP5Ll56Sw3inKdjNA1 ThuqTvue99bJHVoKb/hR4yk284kRuDkMZppqh5tudIHsr+Uipp5W15fresXGzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6ugO0Nju/m9CmbxYsywlnr95Has3nD2Kl6h2z1aHCdQ=; b=vaDRfwC9hD/Py38vAeLtFpFQQyA9kXO44cIFFT+kVxz2H2FmFpMQZs4eZozS7RyMqjFc4f UE8Cu5Lyfekq8LWDyW5QBf1as25H/FPQAQeFtxWFt1RTTMAqkK9/v97WbeaIkKAfnDSzZc Sg1LAx3A6HYCadjU6IhdMnsVCx1xRbAhJ/g1VR61Gk7721UtkiqOXwWl7HUU9vTV2ZPWMA np72Zw62eo43G82O/NN8HraDfh10ppoE/wSDjGEtIVuEjiqY9UxeXnGpWtcxUgum9OKfWk L8UUta1h9111LZtVatYWVLL73YpF+P/Su2sgMWBsFXVQN60I3u+jz0IPAGM/qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837895; a=rsa-sha256; cv=none; b=puIKSqa0S9g0UQ6Wunpu0GIpDHxSGpoI3xjvBlmBY/QFQlJEB65PUPYS/q+HDPndj5n9mT /yo9HrVWmCeQioSFK98xaL66S0+sKhWekl4j/R+eGCZGIPCofPmxeFH9UZAkI4HK8BEWmM 3Mq5dqkBz028TPN4DOgk5RXEqddzSjL9kbLitcqSR99D0LtfRvXaC7071Hea4/N2fl/4D5 V11n4dNNGHvtl0hgJjNtecHInWMoufgI4kXKS8EyUni/UfcrIyYnT6t17b/YoSRv/sqPHi sMfqciAMq1U7rfpTlM6YRFiJwnWs8XzYdA0HvoDrK7WNtW246KiWrXQVdCjZHg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HHC5cslzDrB; Sun, 30 Apr 2023 06:58: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 33U6wFPA071959; Sun, 30 Apr 2023 06:58:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6wFSn071958; Sun, 30 Apr 2023 06:58:15 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:58:15 GMT Message-Id: <202304300658.33U6wFSn071958@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 3d052f97cef5 - stable/13 - mlx5: Make MLX5_COMP_EQ_SIZE tunable. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3d052f97cef570f0b65b8c93936e690af6d37acb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=3d052f97cef570f0b65b8c93936e690af6d37acb commit 3d052f97cef570f0b65b8c93936e690af6d37acb Author: Hans Petter Selasky AuthorDate: 2023-04-18 11:11:02 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:19 +0000 mlx5: Make MLX5_COMP_EQ_SIZE tunable. When using hardware pacing, this value can be increased, because more SQ's means more EQ events aswell. Make it tunable, hw.mlx5.comp_eq_size . Sponsored by: NVIDIA Networking (cherry picked from commit 3bb3e4768ff854b88ba0a7d129edad49f15d7ce3) --- sys/dev/mlx5/driver.h | 4 ---- sys/dev/mlx5/mlx5_core/mlx5_main.c | 23 ++++++++++++++++++++++- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/sys/dev/mlx5/driver.h b/sys/dev/mlx5/driver.h index e1766ae8a742..cdf8deb34a6c 100644 --- a/sys/dev/mlx5/driver.h +++ b/sys/dev/mlx5/driver.h @@ -831,10 +831,6 @@ struct mlx5_core_dct { u16 uid; }; -enum { - MLX5_COMP_EQ_SIZE = 1024, -}; - enum { MLX5_PTYS_IB = 1 << 0, MLX5_PTYS_EN = 1 << 2, diff --git a/sys/dev/mlx5/mlx5_core/mlx5_main.c b/sys/dev/mlx5/mlx5_core/mlx5_main.c index 431a277119cf..9862b9ecec56 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_main.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_main.c @@ -86,6 +86,11 @@ SYSCTL_INT(_hw_mlx5, OID_AUTO, fast_unload_enabled, CTLFLAG_RWTUN, &mlx5_fast_unload_enabled, 0, "Set to enable fast unload. Clear to disable."); +static int mlx5_core_comp_eq_size = 1024; +SYSCTL_INT(_hw_mlx5, OID_AUTO, comp_eq_size, CTLFLAG_RDTUN | CTLFLAG_MPSAFE, + &mlx5_core_comp_eq_size, 0, + "Set default completion EQ size between 1024 and 16384 inclusivly. Value should be power of two."); + static LIST_HEAD(intf_list); static LIST_HEAD(dev_list); static DEFINE_MUTEX(intf_mutex); @@ -180,6 +185,22 @@ static struct mlx5_profile profiles[] = { }, }; +static int +mlx5_core_get_comp_eq_size(void) +{ + int value = mlx5_core_comp_eq_size; + + if (value < 1024) + value = 1024; + else if (value > 16384) + value = 16384; + + /* make value power of two, rounded down */ + while (value & (value - 1)) + value &= (value - 1); + return (value); +} + static void mlx5_set_driver_version(struct mlx5_core_dev *dev) { const size_t driver_ver_sz = @@ -688,7 +709,7 @@ static int alloc_comp_eqs(struct mlx5_core_dev *dev) INIT_LIST_HEAD(&table->comp_eqs_list); ncomp_vec = table->num_comp_vectors; - nent = MLX5_COMP_EQ_SIZE; + nent = mlx5_core_get_comp_eq_size(); for (i = 0; i < ncomp_vec; i++) { eq = kzalloc_node(sizeof(*eq), GFP_KERNEL, dev->priv.numa_node); From nobody Sun Apr 30 06:58:16 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HHF3RRfz48sF1; Sun, 30 Apr 2023 06:58:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q8HHF0f0Tz3NyW; Sun, 30 Apr 2023 06:58:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WuW/Iy1nr01Dig6ZIV/rWk5li1IR4AHByofrcNXc1l8=; b=iLOOxYxIsPn/22EJUoij+i6QSN0b5EoEVdSzbeGuipp7vx+26hk1PyAjA6geWzonRLrMds ClabK4HUYlS9iYCh/hoynLC3HQ0ynRlz7A45AyKqJ+9PWPYDD4VSWXspm5Dxv23m43UtYb 9PeAzWRQseDqgSL0mtpAcrFm658c89WsfAgos75sgwF2U3HbvDqX/HTe/Oi0++qNLkE+Pl YtN3OsUUDp8C82vZBsRg4sI4JCa/WeOA//wFqNCxMxYrZbqKt/JMN55BPCRdjO/GW0UT9c p2OVkOAGCpp3DQytrzQvyRIRXQzl7MNqJ22RMCF5VmtLQs2Oyz6T7q4KJA5CGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WuW/Iy1nr01Dig6ZIV/rWk5li1IR4AHByofrcNXc1l8=; b=vXPa8wosA1JIgjea4P/57xK/3zQmxi66hx9SUqcm26/tEGjaGtw0U8131qwu/mwyFrTaHG q+03v+8I9nGHF2VvihrfAcSUX2Pw+tFfT8ktBcUSw42yFFWiWOvmt5veLaeQMlcr94gd+X siEa9i9svhBecU5D9U0Z0hhkMD2JBcecDMkPmCk2sxTdMxxs34QACQMOwvf75XXCYzaZ77 UtGpAziW7V+s9HXuXQRMQIi02ZFjpEcAmmYCz18I4Ap3PaSr8KPncnYYFbtuyrjJoy3efA gx1CPeGRzLOUekTgNhtKxPzv0BEcfOgE8D8n3zAFpJsVA/JGgRXUJpqLIXVc9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837897; a=rsa-sha256; cv=none; b=gMWAG166QwJ+HeiH/mX7DymGgSSbKrf4fFLHrUj9UyWYvac/lMLRZHtBrj3V18WrrYW8N3 5CGAyLTliz3+EUtsAGah3UbgLtRadUCzjm2Kjv7CNWvVVtbXWqTCOLU1v8fwjtXw8HCCrt xOIt3I2v8bPKSCqjXLV9HX4VeLadOxTjfHbwBXGQz+rnJFzLu5/fDe3B5LqC+MyxLikZiz Tnlz3j8w5578hwkwCSF/864ZPGJVrF26S2jrj3YNhE0RBGGIq/Vw8Dk1K62lu6AnRO7Abv IXxAFnhXt2zh6t2+Q6soAvK5c9n6N846B8anYlFNEbxTur6NXTHsdHh+ayLGeA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HHD6ZpFzDhW; Sun, 30 Apr 2023 06:58: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 33U6wGtK071980; Sun, 30 Apr 2023 06:58:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6wGom071979; Sun, 30 Apr 2023 06:58:16 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:58:16 GMT Message-Id: <202304300658.33U6wGom071979@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 4c002f0842e5 - stable/13 - mlx5: Implement mlx5_core_modify_cq_by_mask(). List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 4c002f0842e58bb00ed00e680f637e4aa7fb1bcc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=4c002f0842e58bb00ed00e680f637e4aa7fb1bcc commit 4c002f0842e58bb00ed00e680f637e4aa7fb1bcc Author: Hans Petter Selasky AuthorDate: 2023-04-18 11:21:28 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:19 +0000 mlx5: Implement mlx5_core_modify_cq_by_mask(). Implement one CQ modify function supporting all firmware versions, instead of having more variants of CQ modify. Sponsored by: NVIDIA Networking (cherry picked from commit 273bfac08ff838786c8b48bc7d3d7180b5f6a3be) --- sys/dev/mlx5/cq.h | 5 +++++ sys/dev/mlx5/mlx5_core/mlx5_cq.c | 44 +++++++++++++++++++++++----------------- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/sys/dev/mlx5/cq.h b/sys/dev/mlx5/cq.h index d5e167498fd2..ffa98c38bee9 100644 --- a/sys/dev/mlx5/cq.h +++ b/sys/dev/mlx5/cq.h @@ -86,6 +86,7 @@ enum { MLX5_CQ_MODIFY_PERIOD = 1 << 0, MLX5_CQ_MODIFY_COUNT = 1 << 1, MLX5_CQ_MODIFY_OVERRUN = 1 << 2, + MLX5_CQ_MODIFY_EQN = 1 << 3, MLX5_CQ_MODIFY_PERIOD_MODE = 1 << 4, }; @@ -169,6 +170,10 @@ int mlx5_core_modify_cq_moderation_mode(struct mlx5_core_dev *dev, u16 cq_period, u16 cq_max_count, u8 cq_mode); +int mlx5_core_modify_cq_by_mask(struct mlx5_core_dev *, + struct mlx5_core_cq *, u32 mask, + u16 cq_period, u16 cq_max_count, + u8 cq_mode, u8 cq_eqn); int mlx5_debug_cq_add(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); void mlx5_debug_cq_remove(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); diff --git a/sys/dev/mlx5/mlx5_core/mlx5_cq.c b/sys/dev/mlx5/mlx5_core/mlx5_cq.c index 8f873bde6073..e849663528b2 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_cq.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_cq.c @@ -219,18 +219,9 @@ int mlx5_core_modify_cq_moderation(struct mlx5_core_dev *dev, u16 cq_period, u16 cq_max_count) { - u32 in[MLX5_ST_SZ_DW(modify_cq_in)] = {0}; - void *cqc; - - MLX5_SET(modify_cq_in, in, cqn, cq->cqn); - cqc = MLX5_ADDR_OF(modify_cq_in, in, cq_context); - MLX5_SET(cqc, cqc, cq_period, cq_period); - MLX5_SET(cqc, cqc, cq_max_count, cq_max_count); - MLX5_SET(modify_cq_in, in, - modify_field_select_resize_field_select.modify_field_select.modify_field_select, - MLX5_CQ_MODIFY_PERIOD | MLX5_CQ_MODIFY_COUNT); - - return mlx5_core_modify_cq(dev, cq, in, sizeof(in)); + return (mlx5_core_modify_cq_by_mask(dev, cq, + MLX5_CQ_MODIFY_PERIOD | MLX5_CQ_MODIFY_COUNT, + cq_period, cq_max_count, 0, 0)); } int mlx5_core_modify_cq_moderation_mode(struct mlx5_core_dev *dev, @@ -239,19 +230,34 @@ int mlx5_core_modify_cq_moderation_mode(struct mlx5_core_dev *dev, u16 cq_max_count, u8 cq_mode) { - u32 in[MLX5_ST_SZ_DW(modify_cq_in)] = {0}; + return (mlx5_core_modify_cq_by_mask(dev, cq, + MLX5_CQ_MODIFY_PERIOD | MLX5_CQ_MODIFY_COUNT | MLX5_CQ_MODIFY_PERIOD_MODE, + cq_period, cq_max_count, cq_mode, 0)); +} + +int +mlx5_core_modify_cq_by_mask(struct mlx5_core_dev *dev, + struct mlx5_core_cq *cq, u32 mask, + u16 cq_period, u16 cq_max_count, u8 cq_mode, u8 cq_eqn) +{ + u32 in[MLX5_ST_SZ_DW(modify_cq_in)] = {}; void *cqc; MLX5_SET(modify_cq_in, in, cqn, cq->cqn); cqc = MLX5_ADDR_OF(modify_cq_in, in, cq_context); - MLX5_SET(cqc, cqc, cq_period, cq_period); - MLX5_SET(cqc, cqc, cq_max_count, cq_max_count); - MLX5_SET(cqc, cqc, cq_period_mode, cq_mode); + if (mask & MLX5_CQ_MODIFY_PERIOD) + MLX5_SET(cqc, cqc, cq_period, cq_period); + if (mask & MLX5_CQ_MODIFY_COUNT) + MLX5_SET(cqc, cqc, cq_max_count, cq_max_count); + if (mask & MLX5_CQ_MODIFY_PERIOD_MODE) + MLX5_SET(cqc, cqc, cq_period_mode, cq_mode); + if (mask & MLX5_CQ_MODIFY_EQN) + MLX5_SET(cqc, cqc, c_eqn, cq_eqn); + MLX5_SET(modify_cq_in, in, - modify_field_select_resize_field_select.modify_field_select.modify_field_select, - MLX5_CQ_MODIFY_PERIOD | MLX5_CQ_MODIFY_COUNT | MLX5_CQ_MODIFY_PERIOD_MODE); + modify_field_select_resize_field_select.modify_field_select.modify_field_select, mask); - return mlx5_core_modify_cq(dev, cq, in, sizeof(in)); + return (mlx5_core_modify_cq(dev, cq, in, sizeof(in))); } int mlx5_init_cq_table(struct mlx5_core_dev *dev) From nobody Sun Apr 30 06:58:17 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HHG6YPPz48sSD; Sun, 30 Apr 2023 06:58: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 4Q8HHG16sqz3Nyd; Sun, 30 Apr 2023 06:58:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N4OgmsG0GUacdTUTM+mS2qO6odQKaQA59WnaXtEF5yk=; b=r29vOzlL0M3tAyZKXf7Zq7vsqidFa+SIq01OsA1F+2LxJL32LWLfM7YEe/Wxn45x8pdHJo BWxTACD/hH0PauIcHHLHuAzmaPQh7huiPCn5kXh9tp/Sk/75uLqW/BsHtkX41hLYf9pOEL XVLOezvM28yQFnw67cnxoXfUPTk8eCJc96FRukSR6wMT1cUz7gvav+bej+fkzwT7C9rtSc k3tpL3YtXg6Vvr6ILz9YwPMJ5U+dkYgP/IQSgEHL11lwj54ez1cnkNALAerotYBlLvZSv1 T7qdbO6dexAEUte+Pg4XF7r3Ip02xMudon4AUZvDS/L5lH75AEl3SGQTlSWhfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N4OgmsG0GUacdTUTM+mS2qO6odQKaQA59WnaXtEF5yk=; b=kg7YhDQuZyEWIsyU0KcpysehOFh3wZ2MIrrNIKnN30nYdSdpTgpqPJbd4AeC1nLubBzjbz 33brSLGcHuLbRy/CZ1NivVhFAEiSdqqVwum5dfed1dqzsEgqq0KAva94cnz6tezgrUL8z4 YyF5fmYQp+ar/hBDCUXcs0rLtuHHQCSB9viLpQl2MGshwADioWRmmLd/6DB2GmAVehe98W RAGzESHgNzBjCo7FcjrncXHDweLnQhxgtN+Beq+aRiPm+iKdIGuXzvPa9Q7a1UcpC5FQzl 9uUyrUFtst0UUatr8WlU4tNlPyrLm6cug1y78KQrq5jtcSg29fwMOeCU61tUpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837898; a=rsa-sha256; cv=none; b=Eg5eVn7aAGPouPMz/NBuBos7v2JoXxxhxIcTUhhhgFY34tmlGeYCMKTQP3t1Uh+eW9E7Tg PQEM6OqA4KudOkbpQ6upLfZsJIRLoBpjNNKcEIg7Lnnh24TXEI/HQKsI/WW+gzrF43rD4W QKdD5/jPt9QrpK6Gy4bNYIWXey8hN0YIcXusFJlptpnqi2s+sgvzEbcsuELjfiHl2dSDvK y2NM2x9hsGdBCS4l1emshCbf91LRYh33U8+U1FvyS69aLTJh6zAe7ESJjpAS/wjGe9LoyP 4uaY4hM1Rz/wU2rhQ10bCdYIpMq1Y8cSxvE0tXss8y47+QAP+rxGQ/79RWFejg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HHG0CFCzDhX; Sun, 30 Apr 2023 06:58: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 33U6wHdj072004; Sun, 30 Apr 2023 06:58:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6wHTt072003; Sun, 30 Apr 2023 06:58:17 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:58:17 GMT Message-Id: <202304300658.33U6wHTt072003@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 699eed180783 - stable/13 - mlx5: Don't give zero number of pages to the firmware. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 699eed1807838c743f8ce804b23c61e4ca51f3e8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=699eed1807838c743f8ce804b23c61e4ca51f3e8 commit 699eed1807838c743f8ce804b23c61e4ca51f3e8 Author: Hans Petter Selasky AuthorDate: 2023-04-18 11:22:41 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:19 +0000 mlx5: Don't give zero number of pages to the firmware. Can happen when using virtual mlx5_core functions, VFs. Sponsored by: NVIDIA Networking (cherry picked from commit 95bf70a4bf7982091bb59200bc2db2cb5cd840d7) --- sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c b/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c index d298da67057a..730c7ee8bee9 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c @@ -509,7 +509,10 @@ int mlx5_satisfy_startup_pages(struct mlx5_core_dev *dev, int boot) mlx5_core_dbg(dev, "requested %d %s pages for func_id 0x%x\n", npages, boot ? "boot" : "init", func_id); - return give_pages(dev, func_id, npages, 0); + if (npages > 0) + return give_pages(dev, func_id, npages, 0); + else + return 0; } enum { From nobody Sun Apr 30 06:58:19 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HHH3Hf9z48sK9; Sun, 30 Apr 2023 06:58: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 4Q8HHH2Pfxz3P5K; Sun, 30 Apr 2023 06:58:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jc+aisS45ZlIsO9gpFEURqYehX2hxlSbgs6Z4DIfoDA=; b=ccXCZ5s9FRLBB8xhPOFvg3nIcLGK+XrcmlydC6H4ykT6rEKjOIBzsN2JCMVKJQRNn+p3KH rCSxiYWLwdH9Zk9K6Bqkyapos8pFW4Na1OxWtCkf0TawbjVB3v+2GfXtQWVCPjsq+OA/QF ULGyKqm/RCJsNoFlaVnMMoT2O4A0LfwqZc5HCM54y+LnRgYcKujJlv6kFHUQiOMjJYodsf m7VowbYkwFou1ILJtvDOVYUWMhQSrh0GCWSAliglGiakzWWPss9CzQPh9pZB/Mxp1OR34k RfvqryO6TSxyu2l5i0BkMV64iTMKVoL8vwQYfxmP+jHIzzuSOsSsfBJRuajnxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Jc+aisS45ZlIsO9gpFEURqYehX2hxlSbgs6Z4DIfoDA=; b=TxE2V44QD081TG3EmZ2/o5MJC4FVqrU/yMLUcb7Ncam5Jc57UbDzaNPbUdWWAezay+0Qci dOEdkzM5S/k5EypG6oPY10jF25ofH/zyE2M6JmTToGhFQn3D5tOy2fvIij0do20pYXQE68 eu189jS4qohQD+Xk31Qny7KDTdS9RRIQDv5G5T31ikYs2I8/xKw4saT5RYSG2mSVQrlW/E Cq/2BXzKqCy1ryDtZvHQhM3AbjkaOyTNkdNzZ571RYTPp6vsgHEJ+SQACPSfAEKycA0fVt EYCRIL0itMKkFp775E9F8Gz8mA2CvSY1s4L/Wg62ZGqXrTbiKJ9MzVz9vP+Wjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837899; a=rsa-sha256; cv=none; b=FYn+HGGQwkS7+h3JKlrZtDQSHJLXwUk3dBuN20x6a7p5rdG6xlLA+/z2tFpzB2Wfn3+t8s jhNt38lPi5pWLH6ghYr7s47rukCcUXfwyMXmptOOQCadgS5wKycoYDJkrfTIAzDrUOjdxP Lje+zAVWZiBt3Pfsr+WzIwVdSOkEhJJMjP9v1zdW6RfxLollZ4rQoMBjDCqB167yXzOm5b lb3AfnybKGZAyQ42TBjpXyHa5YFtqrsTNjw2S0fuphk9uAoL6wDSy5ei8CC9EP1+hprIHs A7Kcdj+KZLWoSeVmQYBRhvcsEHxwaDTYjdBvB490vSBfXKMFb45M7fQB44Pfhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HHH1V4mzDrC; Sun, 30 Apr 2023 06:58: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 33U6wJaV072026; Sun, 30 Apr 2023 06:58:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6wJ0p072025; Sun, 30 Apr 2023 06:58:19 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:58:19 GMT Message-Id: <202304300658.33U6wJ0p072025@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 9162793e44f0 - stable/13 - mlx5: Remove unused debugfs node pointers. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 9162793e44f0d219750647fbbe90d50628b9cca5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=9162793e44f0d219750647fbbe90d50628b9cca5 commit 9162793e44f0d219750647fbbe90d50628b9cca5 Author: Hans Petter Selasky AuthorDate: 2023-04-18 11:40:22 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:20 +0000 mlx5: Remove unused debugfs node pointers. No functional change intended. Sponsored by: NVIDIA Networking (cherry picked from commit 80b4ef6d10544d30b6cfeddca12ae28d81816201) --- sys/dev/mlx5/driver.h | 19 +------------------ sys/dev/mlx5/mlx5_ib/mlx5_ib.h | 7 ------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/sys/dev/mlx5/driver.h b/sys/dev/mlx5/driver.h index cdf8deb34a6c..f5fc7b09167d 100644 --- a/sys/dev/mlx5/driver.h +++ b/sys/dev/mlx5/driver.h @@ -177,7 +177,6 @@ enum { }; struct mlx5_field_desc { - struct dentry *dent; int i; }; @@ -185,7 +184,6 @@ struct mlx5_rsc_debug { struct mlx5_core_dev *dev; void *object; enum dbg_rsc_type type; - struct dentry *root; struct mlx5_field_desc fields[0]; }; @@ -248,12 +246,6 @@ struct mlx5_fw_page { #define mlx5_cmd_msg mlx5_fw_page struct mlx5_cmd_debug { - struct dentry *dbg_root; - struct dentry *dbg_in; - struct dentry *dbg_out; - struct dentry *dbg_outlen; - struct dentry *dbg_status; - struct dentry *dbg_run; void *in_msg; void *out_msg; u8 status; @@ -287,9 +279,6 @@ enum mlx5_cmd_mode { struct mlx5_cmd_stats { u64 sum; u64 n; - struct dentry *root; - struct dentry *avg; - struct dentry *count; /* protect command average calculations */ spinlock_t lock; }; @@ -589,10 +578,7 @@ struct mlx5_priv { /* start: qp staff */ struct mlx5_qp_table qp_table; - struct dentry *qp_debugfs; - struct dentry *eq_debugfs; - struct dentry *cq_debugfs; - struct dentry *cmdif_debugfs; + /* end: qp staff */ /* start: cq staff */ @@ -609,7 +595,6 @@ struct mlx5_priv { struct mutex pgdir_mutex; struct list_head pgdir_list; /* end: alloc staff */ - struct dentry *dbg_root; /* protect mkey key part */ spinlock_t mkey_lock; @@ -901,8 +886,6 @@ static inline struct mlx5_core_dev *pci2mlx5_core_dev(struct pci_dev *pdev) return pci_get_drvdata(pdev); } -extern struct dentry *mlx5_debugfs_root; - static inline u16 fw_rev_maj(struct mlx5_core_dev *dev) { return ioread32be(&dev->iseg->fw_rev) & 0xffff; diff --git a/sys/dev/mlx5/mlx5_ib/mlx5_ib.h b/sys/dev/mlx5/mlx5_ib/mlx5_ib.h index 47f9cc12d51a..2a8a6e4d0a50 100644 --- a/sys/dev/mlx5/mlx5_ib/mlx5_ib.h +++ b/sys/dev/mlx5/mlx5_ib/mlx5_ib.h @@ -576,7 +576,6 @@ struct mlx5_cache_ent { spinlock_t lock; - struct dentry *dir; char name[4]; u32 order; u32 size; @@ -584,11 +583,6 @@ struct mlx5_cache_ent { u32 miss; u32 limit; - struct dentry *fsize; - struct dentry *fcur; - struct dentry *fmiss; - struct dentry *flimit; - struct mlx5_ib_dev *dev; struct work_struct work; struct delayed_work dwork; @@ -599,7 +593,6 @@ struct mlx5_mr_cache { struct workqueue_struct *wq; struct mlx5_cache_ent ent[MAX_MR_CACHE_ENTRIES]; int stopped; - struct dentry *root; unsigned long last_add; }; From nobody Sun Apr 30 06:58:20 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HHJ4JPrz48sBq; Sun, 30 Apr 2023 06:58: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 4Q8HHJ3RnTz3PHQ; Sun, 30 Apr 2023 06:58:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837900; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x+rYSulscsbK+XnkbVRd7x11dd2GIqH1Lyc/Xrfouvs=; b=MwdvJklLopOqBJ5ybUUpOfWYuQcWZ0vIQZBjdVZDojL0yK9n0suPj1s9gK0UjstpCGtRPB q9Trnf6hb851DX6EQ8mUkkb++UeK3Yk++HubBw+gVTfo/rPp0eDPJUc8B4GU0VriZiKrhW 1AwlKsel8ECsFE8vHatR9xcq6k3dj31VqrCcMLGT8gLUl4dXdUxaR6Xix32G3hXsprl+zp 270o8R08kNudEJCWzr7bH1bkGPpCqF47TRehLSuHw0uso13a0tf5W58ZVPaEy2XxOkSZyV vD/0okWcwaBxAEuyE6moTBoUG1h5EjE2JsomUQUDwnw6Yk4719quxY0mp7hRRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837900; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x+rYSulscsbK+XnkbVRd7x11dd2GIqH1Lyc/Xrfouvs=; b=AMf2FBZmEZy4aXsLLTdjuqrsdUSDRywEcEgvpS1mI3Zk0QZ5BJE9qwk+GqXQJg8ltbcwwv pyi3xr0ECxxr6UldSlW3Nr9fXxKdfVLAmNXU3zU5kU11lpHosXiNkRR9XO/8bPdwCL9X9s eebr4yXf601sccaoZnbD4lC0HpLFAUuB6SP28f8PYNFc7uJ4ZlgOZijyQwe5aONoZ54+3V /ftUNZhl7YMOeORcoXgDdPjpQmPFb6Ox7uIIzLKI4WxqMcsf8NFc1NqHAPnm+TTU9iQLBz egUfhTQXHPtpQQ4sHdVZJ06DIx/GaPVmkQHWuBn+pZI0Y/0/9WxWqxkmFmN1Qw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837900; a=rsa-sha256; cv=none; b=dSgSiqOhxTgwRSuIY7xGnrVK1wKOckP31ni549AIEhh+G2DJhobGeGOZ0ln3CPbV9gvAR+ 84cEuIIRfVgqd61IhrQ3aUuRedBW3v84wgXBhMD8CGelmZPvfsLH0UkIunXkmf/aUDZ8U4 Z2i4QortWOVS+F6NbmKqSaOmaXZYQJjqWXB54bY3Ijav9O7JuCgXoR8kaUkOlhl4qdaikt dgSZcdGx2+HUNBHMY8m+TAmYJ68Lu/Dsf78dVEXuzoWbgiKoxWXHuoUFIHGe1enwVlyetE EZyVgfDEOl6B73bCcaz6/uB6uiRyZWcVPbXMBE40qLVKKL6MPcW5reEn862fJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HHJ2Wzjz1Ccf; Sun, 30 Apr 2023 06:58: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 33U6wKtH072045; Sun, 30 Apr 2023 06:58:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6wKgN072044; Sun, 30 Apr 2023 06:58:20 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:58:20 GMT Message-Id: <202304300658.33U6wKgN072044@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 49012db42f3d - stable/13 - libc: Sorting is not needed when there are less than two elements List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 49012db42f3d0bf29958e1248d1c45312815be05 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=49012db42f3d0bf29958e1248d1c45312815be05 commit 49012db42f3d0bf29958e1248d1c45312815be05 Author: Hans Petter Selasky AuthorDate: 2023-04-19 10:18:56 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:20 +0000 libc: Sorting is not needed when there are less than two elements If there are less than two elements avoid executing the first sorting loop. No functional change intended. Reviewed by: kib@ Sponsored by: NVIDIA Networking Differential Revision: https://reviews.freebsd.org/D39691 (cherry picked from commit ecb2ce3a51e9b09a57cd42262fc798ae089c0758) --- lib/libc/stdlib/qsort.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libc/stdlib/qsort.c b/lib/libc/stdlib/qsort.c index 015c648d633a..410118c5cd70 100644 --- a/lib/libc/stdlib/qsort.c +++ b/lib/libc/stdlib/qsort.c @@ -108,7 +108,8 @@ local_qsort(void *a, size_t n, size_t es, cmp_t *cmp, void *thunk) int cmp_result; int swap_cnt; - if (__predict_false(n == 0)) + /* if there are less than 2 elements, then sorting is not needed */ + if (__predict_false(n < 2)) return; loop: swap_cnt = 0; From nobody Sun Apr 30 06:58:21 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HHK6Pczz48sMx; Sun, 30 Apr 2023 06:58: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 4Q8HHK47x1z3PS2; Sun, 30 Apr 2023 06:58:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837901; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pHIz+tl8gXRdHh/w8S+IcFFIvTN1bJ2DyWU3kR/zD9Y=; b=VahJKRQwgj1CitdfShO6vbRMV0b3ep0odjnyiWSh3psCbJX6E/rVQrd9ftpP/hqXTFYleW R2A2LnNm1JoQ2qxn2Q+vMnrM8ZmTlY2BxQ3xvqv2T8hYXaW2dC0dAXWIiltd2XMdkYm4Qp 88GayZ6HLLr0cmtpzV4D02bk0VH3QIbGNij/ub6VyJtiVrCQDthF3A6oA/IaLc0L8m1fdu X+I1dvA5td2DlEyern4cZM8sgbZLR9j+Qn4Zs3pDnWRtfbVqwEo4r2DOZ2Ts04lv0byEqE IdktqTX/MMu7HN8f46FmJgACtlre0aCF8OYM8GbgZf2jXAtJ3ci6HUqoSGGfBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837901; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pHIz+tl8gXRdHh/w8S+IcFFIvTN1bJ2DyWU3kR/zD9Y=; b=MQV0ozHBe1cXQqCnEZ7V3pxQTGHOvr98o0vPJTXiwxZDAVxnwiDTjnpGSqd38kF5c2CzI8 o3NFaGPdveHk/qc59UoRcZ+SqoDXo11LGt9yf5BvGKl7fKzEn53xJxQUYF7dJZRpj79Ve2 QohUC8m8NpRVcBvQDihOPTYgjOsFvyJWp0Rzpz4AI5dn6V8cdc3VSkw5cnVe4maZOXZ3ec C2BTWvPYPqpEGk3BJZdG5Pm+saImp3qFsCFcnLRcu8jiD/yRruXh4xiL44qMfKtRiNS+A8 gKmNjviIRJIKNglV4I09KTYoElCveFpgpiemH4+PpwRHY4bDqkp8C+C47D5aYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837901; a=rsa-sha256; cv=none; b=u63D9j5F9lZLllkHdxrwUemuufwxSsU8gRVflLvVWfH3edoW3D6NyKQxi19lpTIgFBUpzz 4zR3Gbqj4huedFTEfiYnF6nKa9q6yjQyHNN4i6Cm948bqtpJmTz3gF0Zg2OkW2YM+orbYY IHs8nLWhSbyz5bZ166MQSGXm/TGhXKEzqzwp5I0QndrtK0nPbah33kqxdnpou3Mu7PeSWt gax4SpyIlTr158JCJ5z9j3yDAHGoMvQZT4Du2/1HdR4ZJgmKHJgdJdWJSfv1UJWeMVyak5 A1JcjTlpswmHlIM2a5f5dp1PlIm9BnnUka7/zkwDX7rqY0tVD7hAkZt6ANktoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HHK3FqPz1Crk; Sun, 30 Apr 2023 06:58: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 33U6wLoE072065; Sun, 30 Apr 2023 06:58:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33U6wLa4072064; Sun, 30 Apr 2023 06:58:21 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:58:21 GMT Message-Id: <202304300658.33U6wLa4072064@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: ee5121192a77 - stable/13 - libc: Add missing object size check to qsort_s(3) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: ee5121192a77cb5a713915890d6a6a2cfeeaf1a9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=ee5121192a77cb5a713915890d6a6a2cfeeaf1a9 commit ee5121192a77cb5a713915890d6a6a2cfeeaf1a9 Author: Hans Petter Selasky AuthorDate: 2023-04-19 10:22:11 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:20 +0000 libc: Add missing object size check to qsort_s(3) When sorting, both the C11 standard (ISO/IEC 9899:2011, K.3.6.3.2) and the ISO/IEC JTC1 SC22 WG14 N1172 standard, does not define objects of zero size as undefined behaviour. However Microsoft's cpp-docs does. Add proper checks for this. Found while working on bsort(3). Reviewed by: kib@ and emaste@ Sponsored by: NVIDIA Networking Differential Revision: https://reviews.freebsd.org/D39687 (cherry picked from commit 27bb0d337c0d82a1a4f310315840236eb239963c) --- lib/libc/stdlib/qsort.3 | 10 +++++++--- lib/libc/stdlib/qsort.c | 4 ++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/libc/stdlib/qsort.3 b/lib/libc/stdlib/qsort.3 index 606185f9baee..dc14a4981fb7 100644 --- a/lib/libc/stdlib/qsort.3 +++ b/lib/libc/stdlib/qsort.3 @@ -32,7 +32,7 @@ .\" @(#)qsort.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd January 20, 2020 +.Dd April 19, 2023 .Dt QSORT 3 .Os .Sh NAME @@ -260,7 +260,7 @@ The order of arguments to .Fa compar is different .It -if +If .Fa nmemb or .Fa size @@ -270,7 +270,11 @@ or .Fa nmemb is not zero and .Fa compar -is NULL, then the runtime-constraint handler is called, and +is +.Dv NULL +or +.Fa size +is zero, then the runtime-constraint handler is called, and .Fn qsort_s returns an error. Note that the handler is called before diff --git a/lib/libc/stdlib/qsort.c b/lib/libc/stdlib/qsort.c index 410118c5cd70..98f7d02eb099 100644 --- a/lib/libc/stdlib/qsort.c +++ b/lib/libc/stdlib/qsort.c @@ -231,6 +231,10 @@ qsort_s(void *a, rsize_t n, rsize_t es, cmp_t *cmp, void *thunk) __throw_constraint_handler_s("qsort_s : cmp == NULL", EINVAL); return (EINVAL); + } else if (es <= 0) { + __throw_constraint_handler_s("qsort_s : es <= 0", + EINVAL); + return (EINVAL); } } From nobody Sun Apr 30 06:58:22 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8HHL5T3Vz48sSP; Sun, 30 Apr 2023 06: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 4Q8HHL4zxJz3PPk; Sun, 30 Apr 2023 06:58:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bWgwcoW5veGMW40OYlwojRo/E5u8L31c79lZnsYAIHo=; b=wCnmQohdZPUWMn6p+5LQG4e4ruM6xvUYp9jtV/Ed/8ydEu0PCTStVLBkNOvcOu6aj0cD7I gex1LVewuL+ENc2DTu4oFCEdtcsEEZKZtkPXv31Fevhdl+ThbV/4c5PqMR+d5QTnSK6Cq3 dOX4tk6dry2sJgblCgbAmIsiP5gPecQGBET+FG0fzthCMdVbtY5QkQGdW73nYXXxiAhchX rOPAREg/v2RaqPm5dX4Mkln7Dba0AjVM8kr337/lHflPX8PzquZp23OOFdQUTSgkmC8jxq Qy07TDGjNGTebzv5uB7lfxAnmIyzjpKrWyebdrZEGaq5cLWipLQ9Z5coIAGunw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682837902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bWgwcoW5veGMW40OYlwojRo/E5u8L31c79lZnsYAIHo=; b=GvI7ba7CvLkCZBoUyZt8TM1iVaF/Oa7eU9+WNI8AdEc2BUZfgHUWxYsq8NQthMMusKi2Va NlNtuPrdaPFnvAR+Lc4kPLOoB7PbPndpkk2N7Tn3A3oS1rrYHxx9ssChMPcrKFQ2ZOz2CQ cnV4g8/sy3n9XHAR1rinbR7ZQjCjfVziYhMHKw/rZCYoGHe6GXI0ua5nQQQuytCkqqNLzD BpkWo9h7mLhHc0LD1eloBx/09aF+6uEOf7XEYABApdej2N1K73eAORA7Q4DflTgmgnAE5o sOXXFnNU4k0x03sz31rq86nSB0ZGkijCCG0mrIGJCwUsb8Sf/NUvRrXOGqXoqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682837902; a=rsa-sha256; cv=none; b=JShX5EUfAgJdONBIkr79Beftaa8cmkesTJgi48ZfzMSYxeCuNCqTxKuBF2NfiFqCy+DDX8 yDmE5OW2Di5yMBJSURdHtRJheP0ndOss6VM4Sic+aoUvRHeMnZ4zDbhcZZT545jZD/HwbL 9E+7w1AfBuptzs+vBOf3iYr29wIocd/8zPbFYtGavvgmO1yURSq+lctXtourBLEutOzy7k zJUHLuwV+L8O1jS5L8SzrvmOkSEslQeDWncqjbjeGtoW3yT99LQnSFXDe7VpqPthJ5hn8d a892EcL+PrOMNNIXps7MsJLEmWA8giJ3mRahHag3K+82O+3CvWNmttbkq7batg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8HHL45ZPz1Crl; Sun, 30 Apr 2023 06: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 33U6wMhj072092; Sun, 30 Apr 2023 06: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 33U6wMPA072091; Sun, 30 Apr 2023 06:58:22 GMT (envelope-from git) Date: Sun, 30 Apr 2023 06:58:22 GMT Message-Id: <202304300658.33U6wMPA072091@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 517ccb7c8061 - stable/13 - mlx4: purge EOL release compatibility List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 517ccb7c8061ace6565fb27f8f0de7bb9305e853 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=517ccb7c8061ace6565fb27f8f0de7bb9305e853 commit 517ccb7c8061ace6565fb27f8f0de7bb9305e853 Author: Elliott Mitchell AuthorDate: 2022-06-23 00:53:47 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-30 06:56:20 +0000 mlx4: purge EOL release compatibility Remove FreeBSD 10 support code. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/603 Differential Revision: https://reviews.freebsd.org/D35560 (cherry picked from commit 026babd427e6511e53478814ce0aa1cc3f7a9988) --- sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c | 4 ---- sys/dev/mlx4/mlx4_en/mlx4_en_port.c | 12 ------------ sys/dev/mlx4/mlx4_en/mlx4_en_tx.c | 3 +-- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c b/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c index 14289cb20e13..bae22317574b 100644 --- a/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c @@ -2067,7 +2067,6 @@ out: mutex_unlock(&mdev->state_lock); VLAN_CAPABILITIES(dev); break; -#if __FreeBSD_version >= 1100036 case SIOCGI2C: { struct ifi2creq i2c; @@ -2091,7 +2090,6 @@ out: error = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c)); break; } -#endif case SIOCGIFRSSKEY: ifrk = (struct ifrsskey *)data; ifrk->ifrk_func = RSS_FUNC_TOEPLITZ; @@ -2263,12 +2261,10 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, if (mdev->LSO_support) dev->if_capabilities |= IFCAP_TSO4 | IFCAP_TSO6 | IFCAP_VLAN_HWTSO; -#if __FreeBSD_version >= 1100000 /* set TSO limits so that we don't have to drop TX packets */ dev->if_hw_tsomax = MLX4_EN_TX_MAX_PAYLOAD_SIZE - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN) /* hdr */; dev->if_hw_tsomaxsegcount = MLX4_EN_TX_MAX_MBUF_FRAGS - 1 /* hdr */; dev->if_hw_tsomaxsegsize = MLX4_EN_TX_MAX_MBUF_SIZE; -#endif dev->if_capenable = dev->if_capabilities; diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_port.c b/sys/dev/mlx4/mlx4_en/mlx4_en_port.c index 2e19130b9e96..89193c68a055 100644 --- a/sys/dev/mlx4/mlx4_en/mlx4_en_port.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_port.c @@ -346,7 +346,6 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset) vport_stats->tx_frames = be64_to_cpu(tmp_vport_stats.tx_frames); } -#if __FreeBSD_version >= 1100000 if (reset == 0) { if_inc_counter(dev, IFCOUNTER_IPACKETS, priv->pkstats.rx_packets - priv->pkstats_last.rx_packets); @@ -366,17 +365,6 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset) priv->pkstats.tx_multicast_packets - priv->pkstats_last.tx_multicast_packets); } priv->pkstats_last = priv->pkstats; -#else - dev->if_ipackets = priv->pkstats.rx_packets; - dev->if_opackets = priv->pkstats.tx_packets; - dev->if_ibytes = priv->pkstats.rx_bytes; - dev->if_obytes = priv->pkstats.tx_bytes; - dev->if_ierrors = priv->pkstats.rx_errors; - dev->if_iqdrops = priv->pkstats.rx_dropped; - dev->if_imcasts = priv->pkstats.rx_multicast_packets; - dev->if_omcasts = priv->pkstats.tx_multicast_packets; - dev->if_collisions = 0; -#endif spin_unlock(&priv->stats_lock); diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c b/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c index 34af99ae0340..7cff1a224e9a 100644 --- a/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c @@ -981,10 +981,9 @@ mlx4_en_transmit(struct ifnet *dev, struct mbuf *m) /* Poll CQ here */ mlx4_en_xmit_poll(priv, i); -#if __FreeBSD_version >= 1100000 if (unlikely(err != 0)) if_inc_counter(dev, IFCOUNTER_IQDROPS, 1); -#endif + return (err); } From nobody Sun Apr 30 23:47:13 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8jgR6Yh7z48SrY; Sun, 30 Apr 2023 23:47:15 +0000 (UTC) (envelope-from jah@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 4Q8jgR60vsz4RvC; Sun, 30 Apr 2023 23:47:15 +0000 (UTC) (envelope-from jah@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682898435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OukEzG48efWFkuOKgYZSFA4uDoevjeXSH4U0g2NKxT4=; b=hJ/gk9A3O3d9vMj9RvyixOJ2PAU/xpb3K+/E/B0ySzISEfbTYbm7RYRfkEJycFH7EOc/uY 2Yp02s0VmX/+JtE90yrEtnjc//ZjEfHlq34iSiwfGmOvMAxRqfXkUCcdtpYaUhqDfO/pBL 4AxR+JsUm4A4DnudCCLK8lu7OE3ckcxEzt2nWZ5A1+DduQX0G4W1q+658lQe3Ztoq/KHYs BHUWszqC31X0irFQW8hnFStTGJvLhsUrMM0FiCDwzCsf5+glIlZT/0a7Dfe91IPGVT7gYX u55r+aVAlLUrXDkAIiX1PU0dDyJoovVLAyfbQVYN4r/Db3BcxfW6hdzmXhDD6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682898435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OukEzG48efWFkuOKgYZSFA4uDoevjeXSH4U0g2NKxT4=; b=Okcca9laYvruzKVorEn5ejSKQi4/lqFtYUeUEhkiXcfBkf7SBLdwIIawXuHsXubJD1PjiN fxTPB5NHASDHb2kLQoHKLuGmANpb1man8S9gv5JpespOwT+lQOrZGZriYPBVq9UG4i8flV Y9Cj72mKZQ64KiVFoTNJaMdKpQK788WcUQE7JoOHTqaSR1f2V11RdJRxnvAXNb5k3VHvfC xW7NcZcA6zWVUcBkKCLA4W72HxTwGRsXZsGsQrKTOFi7FcS9ubezCo8louD1yoD9DUg01B 7AHzrdcgy35J0cbk3J0O4jkxHauzNTX0/mhiycW8xQgt2M//MF8c3w4Dvi1W5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682898435; a=rsa-sha256; cv=none; b=DKHwon7FhEOOLZIqd+l9skiTInL+Vf57mEGibQugViZQtz15jbM2tt/fNzovrjwxuYDTCT NxF6jKCSGehs1ImbVTl74ciBORN8vcdAO+O4l7MTSAlWclUHHc9iKrNLVdAMuXutTsNQbn aPbAGrsEsyp+D4TZViLwGZsHRCoec/OKYS3QR4Qp2ah9WAqGnKXikNoXUcLrN4/nujRjGs DmT+VdRshytYWHQidoGov5C/r7Po+hPSgh1WhYsZlyw9h+sKEjUL6g+/wDgh59jsIFhdNH hFOk03HyUoJbvBxRE2EeRIU1YNKFdybG2YfMpJv2A7TAvnEz/6Bx5+9FfuwcMA== Received: from corona (047-232-115-243.res.spectrum.com [47.232.115.243]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jah) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Q8jgR2PdNzTDr; Sun, 30 Apr 2023 23:47:15 +0000 (UTC) (envelope-from jah@freebsd.org) Date: Sun, 30 Apr 2023 18:47:13 -0500 From: "Jason A. Harmening" To: Konstantin Belousov Cc: Dimitry Andric , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Subject: Re: git: 060699e91369 - stable/13 - Merge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6 Message-ID: References: <202304092135.339LZMeJ081640@gitrepo.freebsd.org> <76DD2CB9-986B-4349-8F46-3B7BF63EB315@FreeBSD.org> List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ThisMailContainsUnwantedMimeParts: N On Sun, Apr 30, 2023 at 08:09:16AM +0300, Konstantin Belousov wrote: > On Sat, Apr 29, 2023 at 02:27:50PM -0500, Jason A. Harmening wrote: > > On Sat, Apr 29, 2023 at 08:49:28PM +0200, Dimitry Andric wrote: > > > On 29 Apr 2023, at 20:33, Jason A. Harmening wrote: > > > > > > > > On Sun, Apr 09, 2023 at 09:35:22PM +0000, Dimitry Andric wrote: > > > >> The branch stable/13 has been updated by dim: > > > >> > > > >> URL: https://cgit.FreeBSD.org/src/commit/?id=060699e9136975d51d3f726b9785bdbac9a62ba6 > > > >> > > > >> commit 060699e9136975d51d3f726b9785bdbac9a62ba6 > > > >> Author: Dimitry Andric > > > >> AuthorDate: 2023-01-14 16:33:24 +0000 > > > >> Commit: Dimitry Andric > > > >> CommitDate: 2023-04-09 14:54:52 +0000 > > > >> > > > >> Merge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6 > > > >> > > > >> This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and > > > >> openmp to llvmorg-15.0.7-0-g8dfdcc7b7bf6. > > > >> > > > >> PR: 265425 > > > >> MFC after: 2 weeks > > > > > > > > This MFC of llvm15 appears to have completely broken the Intel IOMMU > > > > driver on my stable/13 machine. After this series of commits, any > > > > downstream DMA seems to produce an IOMMU translation fault, which > > > > renders the machine completely unusable: no nvme boot disk, no usb > > > > keyboard, etc. > > > > > > > > The faults I see look something like this: > > > > > > > > DMAR4: ahci0: pci0:17:5 sid 8d fault acc 0 adt 0x0 reason 0x3 addr 26000 > > > > > > > > It's a bit surprising to see a toolchain upgrade produce breakage like > > > > this, but that's what git bisect clearly tells me. I wonder if some of > > > > the IOMMU control structures might be defined as C bitfields and the new > > > > compiler is emitting them differently? Also, was any breakage like this > > > > observed when -current was upgraded to llvm15 several months ago? > > > > > > I haven't heard anything about such breakage, no. > > > > > > > > > > More generally, this is the second time in as many months I've had to > > > > deal with IOMMU breakage on -stable. I can't imagine I'm the only > > > > person who sees value in running with DMA remapping enabled; do we need > > > > a dedicated DMAR-enabled machine in the cluster to smoke-test changes > > > > like this? More generally, should we avoid MFCing high-risk changes > > > > like this? > > > > > > Since there were very few bug reports, it was not deemed high risk. > > > > > > In any case, it would be good to get the bottom of what is causing the > > > problem, so is there any way you can isolate which code seems to be > > > going "bad"? > > > > > > For example, if this problem affects code in sys/dev/iommu, is there > > > some way you can compile that part with -O1, or with an older version > > > of clang (from ports), to see if the problem goes away? > > > > I did try removing all custom make.conf settings (previously I just had > > CPUTYPE?=icelake-server), but that didn't change the behavior. > > > > Before I try further build tweaks, I'd like to ask if the IOMMU fault > > report can provide guidance here? AFAICT all the faults I'm getting > > show "reason 0x3". If I'm reading the VT-d spec correctly, FR=0x3 > > indicates an invalid context entry, in other words there's something the > > hardware doesn't like in the way the address width or pagetable base is > > configured for the PCIe requestor. > > I would start looking at the other direction: might be, there are still some > left shifts for int32 values with the shift count > 30, or uint32 with the > count > 31. > > Also might be useful to dump each context entry on creation, it is kept > constant after. I did look over the constants in intel_reg.h, and didn't see anything that looked as though it would be susceptible to sign-extension or truncation bugs. In the failing case it's much easier for me to catch the fault messages than any initialization message, so I instrumented the fault handler to get the context entry from the dmar_ctx object using the same logic as dmar_map_ctx_entry(), and then dump out the ctx1 and ctx2 fields. What I see are messages like: ... ctx1 0x10013b001 ctx2 0x103 At first glance these "look right": the P bit is set in ctx1, and the rest of the field looks like a valid physical address. ctx2 also doesn't have any of the reserved bits set, but in all cases it does have AW=3, which would indicate 57-bit AGAW. But when I boot the last working kernel, from the revision prior to the llvm15 MFC, I see this in dmesg: ahci0: dmar4 pci0:0:17:5 rid 8d domain 1 mgaw 48 agaw 48 re-mapped ...all reported devices show 48-bit MGAW/AGAW, so I would expect ctx2 to have AW=2. I suspect this may be the source of the fault, but I'm not sure how it's getting configured that way, whether it's an issue with reading the capability register or something else. From nobody Mon May 1 00:34:45 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8kkJ2Dr8z48WGD; Mon, 1 May 2023 00:34:48 +0000 (UTC) (envelope-from jah@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 4Q8kkJ1TJJz4YFZ; Mon, 1 May 2023 00:34:48 +0000 (UTC) (envelope-from jah@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682901288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GgMCcZk5NtZQ2CmLkzaUejgO3Q+ZNczDvWWo6x0o++4=; b=jwidpCzPOh7nHQytADhpTSGxqqFsQz5I+dDsExAUIiVeizrH9WQJV40xEtcgBpzu6uRmxl NjkgY0wu6qgsMlYP5QGtUlta7ohMMprYZAS2oyZfS1U+VJgOEFV2Uhbx5jRjw8X4dEvc1Z 6zodjDgEITlyZwO6lsNKhg4C+5yH+/x5XxKWD5BL3FEcRJYuTV3r2HAjH9dN4NomCSbX57 n5IG4zf3lzf1uxgeKEqO62hQIVQB1BF4BSs0EtLHuPk4sgwi6QZ5AjJrC+h557CNVVV6JW sVQU+yj3EyK2v1DuOrnvrUGJMLGD5npNLhbgwTAp9W/tRN1SIoZLe0Mj1qOnBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682901288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GgMCcZk5NtZQ2CmLkzaUejgO3Q+ZNczDvWWo6x0o++4=; b=ZkBs/npCsc/pXT1qUwaYutZXrdLJ19BYDrjkDpoW9RouuudDKb5lf4z6oSdqwnAUIhKOfh WKVHMcDk14tIeZgYJAa9Rljrogfv54S8ZxPBGa9memZs9UopzB+7O63Wy4SQaoNU8dqSLh Er+O4WX1iA08BAq/iW/Y58RjSpqhsPUQq7ctCU06RvNSwWWJxvx/3OJIA9G92IFSSQ/u5X OAFxcPq6JPm3yQmmMFU+uI6YsygxJPJLhVjO+FaNmQHUDUeIaCB5iWm3/MTaFXuflF3GD7 mQGBj3Qg6jH5A52wMvvfDx5aQVbkpTyiPG0TyGSPd80BKjGKPUm+EvBhMS/fjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682901288; a=rsa-sha256; cv=none; b=uIM9S/PVkEzrBjs0XYnP2vijpiY69+0aR/Deo/6jWGbaBIVqGb9wrJ5rw56wfFSyuRcG3h 9WkORaUUs7Pw74hr+ZWhAmjNA3ITh7ZfCLdxCikmpvq74D2IkofnkuDbni6ErkIygPgzVc uXShPTDh04qUniCyoAk/Tq/Ss+U4AJk8VtkQ5IQA2VzPkowpN2vFDY6SFjiXCShAx3/uDJ x6/UlwV9FDlwa5FgUJhmtwcB0qAwyQHXQrp5ZUkO6a9pHvz9+3CunpSWctw3wowyANFvbm X1p25ypNrIiZsLU89+VlvzB81Pza6uVlILjXOmlTOqrQUyu0fAoASW+oObGMRA== Received: from corona (047-232-115-243.res.spectrum.com [47.232.115.243]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jah) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Q8kkH4zppzVVN; Mon, 1 May 2023 00:34:47 +0000 (UTC) (envelope-from jah@freebsd.org) Date: Sun, 30 Apr 2023 19:34:45 -0500 From: "Jason A. Harmening" To: Konstantin Belousov Cc: Dimitry Andric , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Subject: Re: git: 060699e91369 - stable/13 - Merge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6 Message-ID: References: <202304092135.339LZMeJ081640@gitrepo.freebsd.org> <76DD2CB9-986B-4349-8F46-3B7BF63EB315@FreeBSD.org> List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ThisMailContainsUnwantedMimeParts: N On Sun, Apr 30, 2023 at 06:47:13PM -0500, Jason A. Harmening wrote: > On Sun, Apr 30, 2023 at 08:09:16AM +0300, Konstantin Belousov wrote: > > On Sat, Apr 29, 2023 at 02:27:50PM -0500, Jason A. Harmening wrote: > > > On Sat, Apr 29, 2023 at 08:49:28PM +0200, Dimitry Andric wrote: > > > > On 29 Apr 2023, at 20:33, Jason A. Harmening wrote: > > > > > > > > > > On Sun, Apr 09, 2023 at 09:35:22PM +0000, Dimitry Andric wrote: > > > > >> The branch stable/13 has been updated by dim: > > > > >> > > > > >> URL: https://cgit.FreeBSD.org/src/commit/?id=060699e9136975d51d3f726b9785bdbac9a62ba6 > > > > >> > > > > >> commit 060699e9136975d51d3f726b9785bdbac9a62ba6 > > > > >> Author: Dimitry Andric > > > > >> AuthorDate: 2023-01-14 16:33:24 +0000 > > > > >> Commit: Dimitry Andric > > > > >> CommitDate: 2023-04-09 14:54:52 +0000 > > > > >> > > > > >> Merge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6 > > > > >> > > > > >> This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and > > > > >> openmp to llvmorg-15.0.7-0-g8dfdcc7b7bf6. > > > > >> > > > > >> PR: 265425 > > > > >> MFC after: 2 weeks > > > > > > > > > > This MFC of llvm15 appears to have completely broken the Intel IOMMU > > > > > driver on my stable/13 machine. After this series of commits, any > > > > > downstream DMA seems to produce an IOMMU translation fault, which > > > > > renders the machine completely unusable: no nvme boot disk, no usb > > > > > keyboard, etc. > > > > > > > > > > The faults I see look something like this: > > > > > > > > > > DMAR4: ahci0: pci0:17:5 sid 8d fault acc 0 adt 0x0 reason 0x3 addr 26000 > > > > > > > > > > It's a bit surprising to see a toolchain upgrade produce breakage like > > > > > this, but that's what git bisect clearly tells me. I wonder if some of > > > > > the IOMMU control structures might be defined as C bitfields and the new > > > > > compiler is emitting them differently? Also, was any breakage like this > > > > > observed when -current was upgraded to llvm15 several months ago? > > > > > > > > I haven't heard anything about such breakage, no. > > > > > > > > > > > > > More generally, this is the second time in as many months I've had to > > > > > deal with IOMMU breakage on -stable. I can't imagine I'm the only > > > > > person who sees value in running with DMA remapping enabled; do we need > > > > > a dedicated DMAR-enabled machine in the cluster to smoke-test changes > > > > > like this? More generally, should we avoid MFCing high-risk changes > > > > > like this? > > > > > > > > Since there were very few bug reports, it was not deemed high risk. > > > > > > > > In any case, it would be good to get the bottom of what is causing the > > > > problem, so is there any way you can isolate which code seems to be > > > > going "bad"? > > > > > > > > For example, if this problem affects code in sys/dev/iommu, is there > > > > some way you can compile that part with -O1, or with an older version > > > > of clang (from ports), to see if the problem goes away? > > > > > > I did try removing all custom make.conf settings (previously I just had > > > CPUTYPE?=icelake-server), but that didn't change the behavior. > > > > > > Before I try further build tweaks, I'd like to ask if the IOMMU fault > > > report can provide guidance here? AFAICT all the faults I'm getting > > > show "reason 0x3". If I'm reading the VT-d spec correctly, FR=0x3 > > > indicates an invalid context entry, in other words there's something the > > > hardware doesn't like in the way the address width or pagetable base is > > > configured for the PCIe requestor. > > > > I would start looking at the other direction: might be, there are still some > > left shifts for int32 values with the shift count > 30, or uint32 with the > > count > 31. > > > > Also might be useful to dump each context entry on creation, it is kept > > constant after. > > I did look over the constants in intel_reg.h, and didn't see anything > that looked as though it would be susceptible to sign-extension or > truncation bugs. In the failing case it's much easier for me to catch > the fault messages than any initialization message, so I instrumented > the fault handler to get the context entry from the dmar_ctx object > using the same logic as dmar_map_ctx_entry(), and then dump out the ctx1 > and ctx2 fields. What I see are messages like: > > ... ctx1 0x10013b001 ctx2 0x103 > > At first glance these "look right": the P bit is set in ctx1, and the > rest of the field looks like a valid physical address. ctx2 also > doesn't have any of the reserved bits set, but in all cases it does have > AW=3, which would indicate 57-bit AGAW. But when I boot the last > working kernel, from the revision prior to the llvm15 MFC, I see this in > dmesg: > > ahci0: dmar4 pci0:0:17:5 rid 8d domain 1 mgaw 48 agaw 48 re-mapped > > ...all reported devices show 48-bit MGAW/AGAW, so I would expect ctx2 to > have AW=2. I suspect this may be the source of the fault, but I'm not > sure how it's getting configured that way, whether it's an issue with > reading the capability register or something else. > I can confirm that hacking domain_set_agaw() to always use the settings from sagaw_bits[2] eliminates the faults and at least allows the machine to boot to single-user mode. From nobody Mon May 1 03:31:53 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8pfg4X9Xz47hb3; Mon, 1 May 2023 03:31:55 +0000 (UTC) (envelope-from jah@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q8pfg44fdz3PlK; Mon, 1 May 2023 03:31:55 +0000 (UTC) (envelope-from jah@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682911915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vqcud5tgq7JLQZQeAzsNw4sqhMhRqHFxrRSEAnZcv3k=; b=wACWuRQXealEbrCyy4KX+57cWN464Cbv6HrgTOZAEg7C12+pMHNLyqxqkMfMlV7gXu/8Ry sVz1Oa5UUrC3BP/4MaRux+5D5G6eFsamG9R+0TJxWS43w18kN4Ors2lWBlmdeBmfz/hOGR 7q1axJuy3OVEUKKq9MGbXN1H+KT9KzZy7gxGp0mGmlN1bfyQTtuKSdOYjLOBiRl7ss/3IM iCAl9Qcdk6I9oda6+PFaFS/kG0HobaEGNXjLHUnYCS6eD+zQO30QzjS2XdzcFT0FCFkJUc G5FSvo93OfeM4LbXK8c2WfSANCZaNIg/SSB4Oj7DdE80f8kSgUp/WDyighAgyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682911915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vqcud5tgq7JLQZQeAzsNw4sqhMhRqHFxrRSEAnZcv3k=; b=EYtUNUnhqvEHiTblMdtMnPszutXOLDk/DrKgN9oaHhWo+OLyNpNUitLWE51X/Pwiua6n4d xpzL2P00fOFJvHfEImZGt15eqeq06L/dsy6lMpmwTBwEo0va+8XTPlIUXUT+ZKDU58TKgY pKJ4QdkcfCjco/n/X4z6wP33GKzC1KRZckD+FTxp63pU9Of1LzHPGlAw6ul3kctjNtJEIP huDqJkzE7UNx0MAHVl5l8TzFbUzjVE9bM/7fh46UKIsRJGnzzHt/9EHKj6wWdfsZtFUqgt vDrFn5PXTEZz5f+01XZGKrhEYn8lc+rvU4bT4p+fJ0wtSeFGDppdL47r3UjAuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682911915; a=rsa-sha256; cv=none; b=j43BDIrA6hnM6IqDzLtkUcEcBDK24zG9je3veLRZebzyUfbzogYxLkGyT/mj2TFSy91GOp dEW2urQ7GFEAywQQ73Nitc+z6D1Qyuuk66GO0Jbx5PTOdCv27wtu6OlA0LMj0x3igFLwv0 ///+uj9g0ZIkkKL5mpOI+7AvReRHhrlPZUmfu+tEP7UZf3x7pL4Z+UISEx9sL5dQwfNdoW PgH50yo8230H2lUcpVZ2rF7dhpwLbr290GjhXetkp+tEoGbH6t2bfOgt1qXLPON9cit5fS ZFt36SALTgL8qAxkZL9ZWpiEBpI9nHa3sP4XpP6IcxwpmQlzxvkMnpxW8ABa+Q== Received: from corona (047-232-115-243.res.spectrum.com [47.232.115.243]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jah) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Q8pff62lbzYKt; Mon, 1 May 2023 03:31:54 +0000 (UTC) (envelope-from jah@freebsd.org) Date: Sun, 30 Apr 2023 22:31:53 -0500 From: "Jason A. Harmening" To: Konstantin Belousov Cc: Dimitry Andric , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Subject: Re: git: 060699e91369 - stable/13 - Merge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6 Message-ID: References: <202304092135.339LZMeJ081640@gitrepo.freebsd.org> <76DD2CB9-986B-4349-8F46-3B7BF63EB315@FreeBSD.org> List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ThisMailContainsUnwantedMimeParts: N On Sun, Apr 30, 2023 at 07:34:45PM -0500, Jason A. Harmening wrote: > On Sun, Apr 30, 2023 at 06:47:13PM -0500, Jason A. Harmening wrote: > > On Sun, Apr 30, 2023 at 08:09:16AM +0300, Konstantin Belousov wrote: > > > On Sat, Apr 29, 2023 at 02:27:50PM -0500, Jason A. Harmening wrote: > > > > On Sat, Apr 29, 2023 at 08:49:28PM +0200, Dimitry Andric wrote: > > > > > On 29 Apr 2023, at 20:33, Jason A. Harmening wrote: > > > > > > > > > > > > On Sun, Apr 09, 2023 at 09:35:22PM +0000, Dimitry Andric wrote: > > > > > >> The branch stable/13 has been updated by dim: > > > > > >> > > > > > >> URL: https://cgit.FreeBSD.org/src/commit/?id=060699e9136975d51d3f726b9785bdbac9a62ba6 > > > > > >> > > > > > >> commit 060699e9136975d51d3f726b9785bdbac9a62ba6 > > > > > >> Author: Dimitry Andric > > > > > >> AuthorDate: 2023-01-14 16:33:24 +0000 > > > > > >> Commit: Dimitry Andric > > > > > >> CommitDate: 2023-04-09 14:54:52 +0000 > > > > > >> > > > > > >> Merge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6 > > > > > >> > > > > > >> This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and > > > > > >> openmp to llvmorg-15.0.7-0-g8dfdcc7b7bf6. > > > > > >> > > > > > >> PR: 265425 > > > > > >> MFC after: 2 weeks > > > > > > > > > > > > This MFC of llvm15 appears to have completely broken the Intel IOMMU > > > > > > driver on my stable/13 machine. After this series of commits, any > > > > > > downstream DMA seems to produce an IOMMU translation fault, which > > > > > > renders the machine completely unusable: no nvme boot disk, no usb > > > > > > keyboard, etc. > > > > > > > > > > > > The faults I see look something like this: > > > > > > > > > > > > DMAR4: ahci0: pci0:17:5 sid 8d fault acc 0 adt 0x0 reason 0x3 addr 26000 > > > > > > > > > > > > It's a bit surprising to see a toolchain upgrade produce breakage like > > > > > > this, but that's what git bisect clearly tells me. I wonder if some of > > > > > > the IOMMU control structures might be defined as C bitfields and the new > > > > > > compiler is emitting them differently? Also, was any breakage like this > > > > > > observed when -current was upgraded to llvm15 several months ago? > > > > > > > > > > I haven't heard anything about such breakage, no. > > > > > > > > > > > > > > > > More generally, this is the second time in as many months I've had to > > > > > > deal with IOMMU breakage on -stable. I can't imagine I'm the only > > > > > > person who sees value in running with DMA remapping enabled; do we need > > > > > > a dedicated DMAR-enabled machine in the cluster to smoke-test changes > > > > > > like this? More generally, should we avoid MFCing high-risk changes > > > > > > like this? > > > > > > > > > > Since there were very few bug reports, it was not deemed high risk. > > > > > > > > > > In any case, it would be good to get the bottom of what is causing the > > > > > problem, so is there any way you can isolate which code seems to be > > > > > going "bad"? > > > > > > > > > > For example, if this problem affects code in sys/dev/iommu, is there > > > > > some way you can compile that part with -O1, or with an older version > > > > > of clang (from ports), to see if the problem goes away? > > > > > > > > I did try removing all custom make.conf settings (previously I just had > > > > CPUTYPE?=icelake-server), but that didn't change the behavior. > > > > > > > > Before I try further build tweaks, I'd like to ask if the IOMMU fault > > > > report can provide guidance here? AFAICT all the faults I'm getting > > > > show "reason 0x3". If I'm reading the VT-d spec correctly, FR=0x3 > > > > indicates an invalid context entry, in other words there's something the > > > > hardware doesn't like in the way the address width or pagetable base is > > > > configured for the PCIe requestor. > > > > > > I would start looking at the other direction: might be, there are still some > > > left shifts for int32 values with the shift count > 30, or uint32 with the > > > count > 31. > > > > > > Also might be useful to dump each context entry on creation, it is kept > > > constant after. > > > > I did look over the constants in intel_reg.h, and didn't see anything > > that looked as though it would be susceptible to sign-extension or > > truncation bugs. In the failing case it's much easier for me to catch > > the fault messages than any initialization message, so I instrumented > > the fault handler to get the context entry from the dmar_ctx object > > using the same logic as dmar_map_ctx_entry(), and then dump out the ctx1 > > and ctx2 fields. What I see are messages like: > > > > ... ctx1 0x10013b001 ctx2 0x103 > > > > At first glance these "look right": the P bit is set in ctx1, and the > > rest of the field looks like a valid physical address. ctx2 also > > doesn't have any of the reserved bits set, but in all cases it does have > > AW=3, which would indicate 57-bit AGAW. But when I boot the last > > working kernel, from the revision prior to the llvm15 MFC, I see this in > > dmesg: > > > > ahci0: dmar4 pci0:0:17:5 rid 8d domain 1 mgaw 48 agaw 48 re-mapped > > > > ...all reported devices show 48-bit MGAW/AGAW, so I would expect ctx2 to > > have AW=2. I suspect this may be the source of the fault, but I'm not > > sure how it's getting configured that way, whether it's an issue with > > reading the capability register or something else. > > > > I can confirm that hacking domain_set_agaw() to always use the settings > from sagaw_bits[2] eliminates the faults and at least allows the machine > to boot to single-user mode. I see what's happening now. When I added the hack to always set sagaw_bits[2], I noted that the passed-in MGAW was still 57, while unit->hw_cap had the correct value of 0x4 (=> 4-level paging, 48-bit AW) in bits 12:8. The problem is that sagaw_bits has agaw=64 in its last entry. This results in dmar_maxaddr2mgaw() attempting a comparison against 1ULL << 64 in the final iteration of its first loop. I suspect the new compiler probably determines that last iteration is meaningless and simply omits it from the (probably unrolled) loop. Since the "loop" terminates with i < nitems(sagaw_bits), the subsequent "allow_less ..." case doesn't execute and we end up erroneously selecting a 57-bit address width. Just commenting out that last entry in sagaw_bits fixes the problem. So, two questions: 1) Does any VT-d hardware actually support 6-level paging? The ca. 2021 VT-d spec I'm looking at indicates 5-level is the greatest depth supported, with everything above that being reserved. 2) I'd expect clang to try very hard to error out in a situation like this, but I see that sys/conf/kern.mk sets -Wno-shift-count-overflow among other things, and more of them were added for clang 15. This seems like a really bad idea, regardless of how much of a PITA it may be to fix these warnings. From nobody Mon May 1 04:13:39 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8qZq4m70z47kq1; Mon, 1 May 2023 04:13:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q8qZq4XPjz3j0t; Mon, 1 May 2023 04:13:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682914419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lwcUnG4slPzAVDC2XgFI47/D58fC6E9JJo3t6Ol8/Z4=; b=b/xaOJiIdiMLgU7K0w3T/qTKvqJNcSTUA8TF/fXrMCO/JgWUiirpBI7T25Sns0sQ8WJWc2 6/9gneJLwmnP0FDqwltEoc4CQta2pkd7Bt4n0YHLG3TOcdcIceEuX70vDt+ny9FSNT1l+f u5EsvguC/S8kj2bNbk+EhF2JarcXP0R1p/ipPWrWV0BJ//I6WbuigLvnriqbXfeNKyUqwe N5xuofWrSar0tepS1iQ+lVwA7o2UniaeKKeSGet1ihw64Ot52NYaFtA/1khSIIYGviHGD3 XGc+OPIVo2RYeN4WBiFbD6WxxCfLInPg7UASLN5+JpcdVPZC28rU3aa27VSg2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682914419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lwcUnG4slPzAVDC2XgFI47/D58fC6E9JJo3t6Ol8/Z4=; b=TU3sbY0pAQC/68TGjNf77I7hfCAczX5jJxzQXwDWKRCPvL9KU1AVVdor1h5rW39ib4TdSF 52nZa0/VIN5ZsSTXAtl0FXhlUXmwOB1rZXOyVxIyfja2zhdINrSx93VBR0DG4NuyX/Z6QI GQHtDijVtZSXR4Kp0qYzvk/GXgprSyBAc6iBXr56YjcQf/UwVeRcQMPWkt0Wjxv1PjRo1i p8zhk6QTKwKtT5zdjysSHInDKqVsLF/JAX+yK8HKPBmjdeRYCUozaUhYX7eA350o6/EgfJ FUnNK+SvjiqJExLqImF4WeloYgv4o+tIIuOndLh4P5JRzmLyJOV47qhQtuKUxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682914419; a=rsa-sha256; cv=none; b=JD216dysKORgbq6Lkjq9tx56g67I/12E469rvLCqJWsSOrEkTObIzeqwHg7sI2SM/mo2X/ eM2WvBfQLhQFapeoyqdfgdR4qniMP6HNDh5u0B3sVmAXVKQ7Z36I8ugtOgJJV4SErhRqa8 do+PxSQJmSiZlmOAzd+H3IcqULbHUoovNq5x1LUi0FIpNB0qPilLuG20Xf2j83I5+HeOfE r4o1XL7cLL/OCSTUD9/7JdeFAj4gx8npkFXo2eeDEr4RSdnzfSVj7HPc37vJgJ6RhrzYnk 3T2DNBHkviPsFHQTVFlNGfznATNP1FjeP70H7ToiO78wJjGyuJW4xwNnMTlqeg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8qZq3cPlzqwD; Mon, 1 May 2023 04:13: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 3414Dd7f082349; Mon, 1 May 2023 04:13:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3414DdCg082348; Mon, 1 May 2023 04:13:39 GMT (envelope-from git) Date: Mon, 1 May 2023 04:13:39 GMT Message-Id: <202305010413.3414DdCg082348@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 058a2846a24f - stable/13 - sqlite3: Vendor import of sqlite3 3.41.2 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 058a2846a24f8b2e42cd9afe7fc94a3fc005b044 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=058a2846a24f8b2e42cd9afe7fc94a3fc005b044 commit 058a2846a24f8b2e42cd9afe7fc94a3fc005b044 Author: Cy Schubert AuthorDate: 2023-04-17 16:02:41 +0000 Commit: Cy Schubert CommitDate: 2023-05-01 04:13:00 +0000 sqlite3: Vendor import of sqlite3 3.41.2 Release notes at https://www.sqlite.org/releaselog/3_41_2.html. Obtained from: https://www.sqlite.org/2023/sqlite-autoconf-3410200.tar.gz Merge commit '853a43f7c79218855a6e45a25a00b942972e3fa1' (cherry picked from commit e7e621f94d9073d620a4d15f13952f1d40685ece) --- contrib/sqlite3/configure | 20 ++-- contrib/sqlite3/configure.ac | 2 +- contrib/sqlite3/shell.c | 10 +- contrib/sqlite3/sqlite3.c | 209 ++++++++++++++++++++++++++++----------- contrib/sqlite3/sqlite3.h | 6 +- contrib/sqlite3/sqlite3rc.h | 2 +- contrib/sqlite3/tea/configure | 18 ++-- contrib/sqlite3/tea/configure.ac | 2 +- 8 files changed, 182 insertions(+), 87 deletions(-) diff --git a/contrib/sqlite3/configure b/contrib/sqlite3/configure index e5cbf778e689..dea9860d00ee 100755 --- a/contrib/sqlite3/configure +++ b/contrib/sqlite3/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for sqlite 3.41.0. +# Generated by GNU Autoconf 2.71 for sqlite 3.41.2. # # Report bugs to . # @@ -621,8 +621,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.41.0' -PACKAGE_STRING='sqlite 3.41.0' +PACKAGE_VERSION='3.41.2' +PACKAGE_STRING='sqlite 3.41.2' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1367,7 +1367,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.41.0 to adapt to many kinds of systems. +\`configure' configures sqlite 3.41.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1438,7 +1438,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.41.0:";; + short | recursive ) echo "Configuration of sqlite 3.41.2:";; esac cat <<\_ACEOF @@ -1563,7 +1563,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.41.0 +sqlite configure 3.41.2 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1833,7 +1833,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.41.0, which was +It was created by sqlite $as_me 3.41.2, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3106,7 +3106,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.41.0' + VERSION='3.41.2' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -15314,7 +15314,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.41.0, which was +This file was extended by sqlite $as_me 3.41.2, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15373,7 +15373,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -sqlite config.status 3.41.0 +sqlite config.status 3.41.2 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/contrib/sqlite3/configure.ac b/contrib/sqlite3/configure.ac index f7f6558c2db5..290f160afc56 100644 --- a/contrib/sqlite3/configure.ac +++ b/contrib/sqlite3/configure.ac @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.41.0, http://www.sqlite.org) +AC_INIT(sqlite, 3.41.2, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) diff --git a/contrib/sqlite3/shell.c b/contrib/sqlite3/shell.c index d6a673fe2cfe..e6495d75128e 100644 --- a/contrib/sqlite3/shell.c +++ b/contrib/sqlite3/shell.c @@ -13023,10 +13023,14 @@ static int dbdataNext(sqlite3_vtab_cursor *pCursor){ if( pCsr->bOnePage==0 && pCsr->iPgno>pCsr->szDb ) return SQLITE_OK; rc = dbdataLoadPage(pCsr, pCsr->iPgno, &pCsr->aPage, &pCsr->nPage); if( rc!=SQLITE_OK ) return rc; - if( pCsr->aPage ) break; + if( pCsr->aPage && pCsr->nPage>=256 ) break; + sqlite3_free(pCsr->aPage); + pCsr->aPage = 0; if( pCsr->bOnePage ) return SQLITE_OK; pCsr->iPgno++; } + + assert( iOff+3+2<=pCsr->nPage ); pCsr->iCell = pTab->bPtr ? -2 : 0; pCsr->nCell = get_uint16(&pCsr->aPage[iOff+3]); } @@ -13261,8 +13265,7 @@ static int dbdataGetEncoding(DbdataCursor *pCsr){ int nPg1 = 0; u8 *aPg1 = 0; rc = dbdataLoadPage(pCsr, 1, &aPg1, &nPg1); - assert( rc!=SQLITE_OK || nPg1==0 || nPg1>=512 ); - if( rc==SQLITE_OK && nPg1>0 ){ + if( rc==SQLITE_OK && nPg1>=(56+4) ){ pCsr->enc = get_uint32(&aPg1[56]); } sqlite3_free(aPg1); @@ -17921,6 +17924,7 @@ static char *shell_error_context(const char *zSql, sqlite3 *db){ if( db==0 || zSql==0 || (iOffset = sqlite3_error_offset(db))<0 + || iOffset>=strlen(zSql) ){ return sqlite3_mprintf(""); } diff --git a/contrib/sqlite3/sqlite3.c b/contrib/sqlite3/sqlite3.c index b47891c3817b..947a15455173 100644 --- a/contrib/sqlite3/sqlite3.c +++ b/contrib/sqlite3/sqlite3.c @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.41.0. By combining all the individual C code files into this +** version 3.41.2. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -452,9 +452,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.41.0" -#define SQLITE_VERSION_NUMBER 3041000 -#define SQLITE_SOURCE_ID "2023-02-21 18:09:37 05941c2a04037fc3ed2ffae11f5d2260706f89431f463518740f72ada350866d" +#define SQLITE_VERSION "3.41.2" +#define SQLITE_VERSION_NUMBER 3041002 +#define SQLITE_SOURCE_ID "2023-03-22 11:56:21 0d1fc92f94cb6b76bffe3ec34d69cffde2924203304e8ffc4155597af0c191da" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -16592,7 +16592,7 @@ struct PgHdr { ** private to pcache.c and should not be accessed by other modules. ** pCache is grouped with the public elements for efficiency. */ - i16 nRef; /* Number of users of this page */ + i64 nRef; /* Number of users of this page */ PgHdr *pDirtyNext; /* Next element in list of dirty pages */ PgHdr *pDirtyPrev; /* Previous element in list of dirty pages */ /* NB: pDirtyNext and pDirtyPrev are undefined if the @@ -16673,12 +16673,12 @@ SQLITE_PRIVATE void sqlite3PcacheClearSyncFlags(PCache *); SQLITE_PRIVATE void sqlite3PcacheClear(PCache*); /* Return the total number of outstanding page references */ -SQLITE_PRIVATE int sqlite3PcacheRefCount(PCache*); +SQLITE_PRIVATE i64 sqlite3PcacheRefCount(PCache*); /* Increment the reference count of an existing page */ SQLITE_PRIVATE void sqlite3PcacheRef(PgHdr*); -SQLITE_PRIVATE int sqlite3PcachePageRefcount(PgHdr*); +SQLITE_PRIVATE i64 sqlite3PcachePageRefcount(PgHdr*); /* Return the total number of pages stored in the cache */ SQLITE_PRIVATE int sqlite3PcachePagecount(PCache*); @@ -18837,7 +18837,7 @@ struct NameContext { #define NC_HasAgg 0x000010 /* One or more aggregate functions seen */ #define NC_IdxExpr 0x000020 /* True if resolving columns of CREATE INDEX */ #define NC_SelfRef 0x00002e /* Combo: PartIdx, isCheck, GenCol, and IdxExpr */ -#define NC_VarSelect 0x000040 /* A correlated subquery has been seen */ +#define NC_Subquery 0x000040 /* A subquery has been seen */ #define NC_UEList 0x000080 /* True if uNC.pEList is used */ #define NC_UAggInfo 0x000100 /* True if uNC.pAggInfo is used */ #define NC_UUpsert 0x000200 /* True if uNC.pUpsert is used */ @@ -19156,6 +19156,7 @@ struct IndexedExpr { int iIdxCur; /* The index cursor */ int iIdxCol; /* The index column that contains value of pExpr */ u8 bMaybeNullRow; /* True if we need an OP_IfNullRow check */ + u8 aff; /* Affinity of the pExpr expression */ IndexedExpr *pIENext; /* Next in a list of all indexed expressions */ #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS const char *zIdxName; /* Name of index, used only for bytecode comments */ @@ -19207,6 +19208,9 @@ struct Parse { u8 withinRJSubrtn; /* Nesting level for RIGHT JOIN body subroutines */ #if defined(SQLITE_DEBUG) || defined(SQLITE_COVERAGE_TEST) u8 earlyCleanup; /* OOM inside sqlite3ParserAddCleanup() */ +#endif +#ifdef SQLITE_DEBUG + u8 ifNotExists; /* Might be true if IF NOT EXISTS. Assert()s only */ #endif int nRangeReg; /* Size of the temporary register block */ int iRangeReg; /* First register in temporary register block */ @@ -52653,7 +52657,7 @@ bitvec_end: struct PCache { PgHdr *pDirty, *pDirtyTail; /* List of dirty pages in LRU order */ PgHdr *pSynced; /* Last synced page in dirty page list */ - int nRefSum; /* Sum of ref counts over all pages */ + i64 nRefSum; /* Sum of ref counts over all pages */ int szCache; /* Configured cache size */ int szSpill; /* Size before spilling occurs */ int szPage; /* Size of every page in this cache */ @@ -52683,7 +52687,7 @@ struct PCache { unsigned char *a; int j; pPg = (PgHdr*)pLower->pExtra; - printf("%3d: nRef %2d flgs %02x data ", i, pPg->nRef, pPg->flags); + printf("%3lld: nRef %2d flgs %02x data ", i, pPg->nRef, pPg->flags); a = (unsigned char *)pLower->pBuf; for(j=0; j<12; j++) printf("%02x", a[j]); printf(" ptr %p\n", pPg); @@ -53427,14 +53431,14 @@ SQLITE_PRIVATE PgHdr *sqlite3PcacheDirtyList(PCache *pCache){ ** This is not the total number of pages referenced, but the sum of the ** reference count for all pages. */ -SQLITE_PRIVATE int sqlite3PcacheRefCount(PCache *pCache){ +SQLITE_PRIVATE i64 sqlite3PcacheRefCount(PCache *pCache){ return pCache->nRefSum; } /* ** Return the number of references to the page supplied as an argument. */ -SQLITE_PRIVATE int sqlite3PcachePageRefcount(PgHdr *p){ +SQLITE_PRIVATE i64 sqlite3PcachePageRefcount(PgHdr *p){ return p->nRef; } @@ -74504,7 +74508,7 @@ static SQLITE_NOINLINE int btreeNext(BtCursor *pCur){ pPage = pCur->pPage; idx = ++pCur->ix; - if( NEVER(!pPage->isInit) || sqlite3FaultSim(412) ){ + if( !pPage->isInit || sqlite3FaultSim(412) ){ return SQLITE_CORRUPT_BKPT; } @@ -77633,6 +77637,7 @@ SQLITE_PRIVATE int sqlite3BtreeInsert( assert( szNew==pPage->xCellSize(pPage, newCell) ); assert( szNew <= MX_CELL_SIZE(p->pBt) ); idx = pCur->ix; + pCur->info.nSize = 0; if( loc==0 ){ CellInfo info; assert( idx>=0 ); @@ -77705,7 +77710,6 @@ SQLITE_PRIVATE int sqlite3BtreeInsert( ** larger than the largest existing key, it is possible to insert the ** row without seeking the cursor. This can be a big performance boost. */ - pCur->info.nSize = 0; if( pPage->nOverflow ){ assert( rc==SQLITE_OK ); pCur->curFlags &= ~(BTCF_ValidNKey); @@ -90915,8 +90919,7 @@ static u64 filterHash(const Mem *aMem, const Op *pOp){ }else if( p->flags & MEM_Real ){ h += sqlite3VdbeIntValue(p); }else if( p->flags & (MEM_Str|MEM_Blob) ){ - h += p->n; - if( p->flags & MEM_Zero ) h += p->u.nZero; + /* no-op */ } } return h; @@ -104495,14 +104498,10 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){ if( 0==sqlite3ExprCanBeNull(pExpr->pLeft) && !IN_RENAME_OBJECT ){ testcase( ExprHasProperty(pExpr, EP_OuterON) ); assert( !ExprHasProperty(pExpr, EP_IntValue) ); - if( pExpr->op==TK_NOTNULL ){ - pExpr->u.zToken = "true"; - ExprSetProperty(pExpr, EP_IsTrue); - }else{ - pExpr->u.zToken = "false"; - ExprSetProperty(pExpr, EP_IsFalse); - } - pExpr->op = TK_TRUEFALSE; + pExpr->u.iValue = (pExpr->op==TK_NOTNULL); + pExpr->flags |= EP_IntValue; + pExpr->op = TK_INTEGER; + for(i=0, p=pNC; p && ipNext, i++){ p->nRef = anRef[i]; } @@ -104804,8 +104803,8 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){ assert( pNC->nRef>=nRef ); if( nRef!=pNC->nRef ){ ExprSetProperty(pExpr, EP_VarSelect); - pNC->ncFlags |= NC_VarSelect; } + pNC->ncFlags |= NC_Subquery; } break; } @@ -109554,6 +109553,7 @@ SQLITE_PRIVATE void sqlite3ExprCodeGeneratedColumn( ){ int iAddr; Vdbe *v = pParse->pVdbe; + int nErr = pParse->nErr; assert( v!=0 ); assert( pParse->iSelfTab!=0 ); if( pParse->iSelfTab>0 ){ @@ -109566,6 +109566,7 @@ SQLITE_PRIVATE void sqlite3ExprCodeGeneratedColumn( sqlite3VdbeAddOp4(v, OP_Affinity, regOut, 1, 0, &pCol->affinity, 1); } if( iAddr ) sqlite3VdbeJumpHere(v, iAddr); + if( pParse->nErr>nErr ) pParse->db->errByteOffset = -1; } #endif /* SQLITE_OMIT_GENERATED_COLUMNS */ @@ -109582,6 +109583,7 @@ SQLITE_PRIVATE void sqlite3ExprCodeGetColumnOfTable( Column *pCol; assert( v!=0 ); assert( pTab!=0 ); + assert( iCol!=XN_EXPR ); if( iCol<0 || iCol==pTab->iPKey ){ sqlite3VdbeAddOp2(v, OP_Rowid, iTabCur, regOut); VdbeComment((v, "%s.rowid", pTab->zName)); @@ -109848,6 +109850,7 @@ static SQLITE_NOINLINE int sqlite3IndexedExprLookup( IndexedExpr *p; Vdbe *v; for(p=pParse->pIdxEpr; p; p=p->pIENext){ + u8 exprAff; int iDataCur = p->iDataCur; if( iDataCur<0 ) continue; if( pParse->iSelfTab ){ @@ -109855,6 +109858,16 @@ static SQLITE_NOINLINE int sqlite3IndexedExprLookup( iDataCur = -1; } if( sqlite3ExprCompare(0, pExpr, p->pExpr, iDataCur)!=0 ) continue; + assert( p->aff>=SQLITE_AFF_BLOB && p->aff<=SQLITE_AFF_NUMERIC ); + exprAff = sqlite3ExprAffinity(pExpr); + if( (exprAff<=SQLITE_AFF_BLOB && p->aff!=SQLITE_AFF_BLOB) + || (exprAff==SQLITE_AFF_TEXT && p->aff!=SQLITE_AFF_TEXT) + || (exprAff>=SQLITE_AFF_NUMERIC && p->aff!=SQLITE_AFF_NUMERIC) + ){ + /* Affinity mismatch on a generated column */ + continue; + } + v = pParse->pVdbe; assert( v!=0 ); if( p->bMaybeNullRow ){ @@ -110434,10 +110447,13 @@ expr_code_doover: return target; } case TK_COLLATE: { - if( !ExprHasProperty(pExpr, EP_Collate) - && ALWAYS(pExpr->pLeft) - && pExpr->pLeft->op==TK_FUNCTION - ){ + if( !ExprHasProperty(pExpr, EP_Collate) ){ + /* A TK_COLLATE Expr node without the EP_Collate tag is a so-called + ** "SOFT-COLLATE" that is added to constraints that are pushed down + ** from outer queries into sub-queries by the push-down optimization. + ** Clear subtypes as subtypes may not cross a subquery boundary. + */ + assert( pExpr->pLeft ); inReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target); if( inReg!=target ){ sqlite3VdbeAddOp2(v, OP_SCopy, inReg, target); @@ -110545,16 +110561,22 @@ expr_code_doover: break; } } - addrINR = sqlite3VdbeAddOp1(v, OP_IfNullRow, pExpr->iTable); - /* Temporarily disable factoring of constant expressions, since - ** even though expressions may appear to be constant, they are not - ** really constant because they originate from the right-hand side - ** of a LEFT JOIN. */ - pParse->okConstFactor = 0; + addrINR = sqlite3VdbeAddOp3(v, OP_IfNullRow, pExpr->iTable, 0, target); + /* The OP_IfNullRow opcode above can overwrite the result register with + ** NULL. So we have to ensure that the result register is not a value + ** that is suppose to be a constant. Two defenses are needed: + ** (1) Temporarily disable factoring of constant expressions + ** (2) Make sure the computed value really is stored in register + ** "target" and not someplace else. + */ + pParse->okConstFactor = 0; /* note (1) above */ inReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target); pParse->okConstFactor = okConstFactor; + if( inReg!=target ){ /* note (2) above */ + sqlite3VdbeAddOp2(v, OP_SCopy, inReg, target); + inReg = target; + } sqlite3VdbeJumpHere(v, addrINR); - sqlite3VdbeChangeP3(v, addrINR, inReg); break; } @@ -118917,7 +118939,7 @@ SQLITE_PRIVATE void sqlite3AddReturning(Parse *pParse, ExprList *pList){ if( pParse->pNewTrigger ){ sqlite3ErrorMsg(pParse, "cannot use RETURNING in a trigger"); }else{ - assert( pParse->bReturning==0 ); + assert( pParse->bReturning==0 || pParse->ifNotExists ); } pParse->bReturning = 1; pRet = sqlite3DbMallocZero(db, sizeof(*pRet)); @@ -118943,7 +118965,8 @@ SQLITE_PRIVATE void sqlite3AddReturning(Parse *pParse, ExprList *pList){ pRet->retTStep.pTrig = &pRet->retTrig; pRet->retTStep.pExprList = pList; pHash = &(db->aDb[1].pSchema->trigHash); - assert( sqlite3HashFind(pHash, RETURNING_TRIGGER_NAME)==0 || pParse->nErr ); + assert( sqlite3HashFind(pHash, RETURNING_TRIGGER_NAME)==0 + || pParse->nErr || pParse->ifNotExists ); if( sqlite3HashInsert(pHash, RETURNING_TRIGGER_NAME, &pRet->retTrig) ==&pRet->retTrig ){ sqlite3OomFault(db); @@ -119478,6 +119501,7 @@ SQLITE_PRIVATE void sqlite3AddGenerated(Parse *pParse, Expr *pExpr, Token *pType ** turn it into one by adding a unary "+" operator. */ pExpr = sqlite3PExpr(pParse, TK_UPLUS, pExpr, 0); } + if( pExpr && pExpr->op!=TK_RAISE ) pExpr->affExpr = pCol->affinity; sqlite3ColumnSetExpr(pParse, pTab, pCol, pExpr); pExpr = 0; goto generated_done; @@ -124184,7 +124208,7 @@ SQLITE_PRIVATE void sqlite3DeleteFrom( #endif /* SQLITE_OMIT_TRUNCATE_OPTIMIZATION */ { u16 wcf = WHERE_ONEPASS_DESIRED|WHERE_DUPLICATES_OK; - if( sNC.ncFlags & NC_VarSelect ) bComplex = 1; + if( sNC.ncFlags & NC_Subquery ) bComplex = 1; wcf |= (bComplex ? 0 : WHERE_ONEPASS_MULTIROW); if( HasRowid(pTab) ){ /* For a rowid table, initialize the RowSet to an empty set */ @@ -126881,6 +126905,18 @@ static void ceilingFunc( static double xCeil(double x){ return ceil(x); } static double xFloor(double x){ return floor(x); } +/* +** Some systems do not have log2() and log10() in their standard math +** libraries. +*/ +#if defined(HAVE_LOG10) && HAVE_LOG10==0 +# define log10(X) (0.4342944819032517867*log(X)) +#endif +#if defined(HAVE_LOG2) && HAVE_LOG2==0 +# define log2(X) (1.442695040888963456*log(X)) +#endif + + /* ** Implementation of SQL functions: ** @@ -136260,6 +136296,23 @@ SQLITE_PRIVATE void sqlite3Pragma( jmp4 = integrityCheckResultRow(v); sqlite3VdbeJumpHere(v, jmp2); + /* The OP_IdxRowid opcode is an optimized version of OP_Column + ** that extracts the rowid off the end of the index record. + ** But it only works correctly if index record does not have + ** any extra bytes at the end. Verify that this is the case. */ + if( HasRowid(pTab) ){ + int jmp7; + sqlite3VdbeAddOp2(v, OP_IdxRowid, iIdxCur+j, 3); + jmp7 = sqlite3VdbeAddOp3(v, OP_Eq, 3, 0, r1+pIdx->nColumn-1); + VdbeCoverage(v); + sqlite3VdbeLoadString(v, 3, + "rowid not at end-of-record for row "); + sqlite3VdbeAddOp3(v, OP_Concat, 7, 3, 3); + sqlite3VdbeLoadString(v, 4, " of index "); + sqlite3VdbeGoto(v, jmp5-1); + sqlite3VdbeJumpHere(v, jmp7); + } + /* Any indexed columns with non-BINARY collations must still hold ** the exact same text value as the table. */ label6 = 0; @@ -140555,8 +140608,6 @@ SQLITE_PRIVATE void sqlite3SubqueryColumnTypes( pCol->affinity = sqlite3ExprAffinity(p); if( pCol->affinity<=SQLITE_AFF_NONE ){ pCol->affinity = aff; - }else if( pCol->affinity>=SQLITE_AFF_NUMERIC && p->op==TK_CAST ){ - pCol->affinity = SQLITE_AFF_FLEXNUM; } if( pCol->affinity>=SQLITE_AFF_TEXT && pSelect->pNext ){ int m = 0; @@ -140570,6 +140621,9 @@ SQLITE_PRIVATE void sqlite3SubqueryColumnTypes( if( pCol->affinity>=SQLITE_AFF_NUMERIC && (m&0x02)!=0 ){ pCol->affinity = SQLITE_AFF_BLOB; } + if( pCol->affinity>=SQLITE_AFF_NUMERIC && p->op==TK_CAST ){ + pCol->affinity = SQLITE_AFF_FLEXNUM; + } } zType = columnType(&sNC, p, 0, 0, 0); if( zType==0 || pCol->affinity!=sqlite3AffinityType(zType, 0) ){ @@ -142084,7 +142138,9 @@ static Expr *substExpr( sqlite3VectorErrorMsg(pSubst->pParse, pCopy); }else{ sqlite3 *db = pSubst->pParse->db; - if( pSubst->isOuterJoin && pCopy->op!=TK_COLUMN ){ + if( pSubst->isOuterJoin + && (pCopy->op!=TK_COLUMN || pCopy->iTable!=pSubst->iNewTable) + ){ memset(&ifNullRow, 0, sizeof(ifNullRow)); ifNullRow.op = TK_IF_NULL_ROW; ifNullRow.pLeft = pCopy; @@ -144600,10 +144656,12 @@ static void optimizeAggregateUseOfIndexedExpr( NameContext *pNC /* Name context used to resolve agg-func args */ ){ assert( pAggInfo->iFirstReg==0 ); + assert( pSelect!=0 ); + assert( pSelect->pGroupBy!=0 ); pAggInfo->nColumn = pAggInfo->nAccumulator; if( ALWAYS(pAggInfo->nSortingColumn>0) ){ if( pAggInfo->nColumn==0 ){ - pAggInfo->nSortingColumn = 0; + pAggInfo->nSortingColumn = pSelect->pGroupBy->nExpr; }else{ pAggInfo->nSortingColumn = pAggInfo->aCol[pAggInfo->nColumn-1].iSorterColumn+1; @@ -145028,6 +145086,7 @@ static int countOfViewOptimization(Parse *pParse, Select *p){ if( p->pEList->nExpr!=1 ) return 0; /* Single result column */ if( p->pWhere ) return 0; if( p->pGroupBy ) return 0; + if( p->pOrderBy ) return 0; pExpr = p->pEList->a[0].pExpr; if( pExpr->op!=TK_AGG_FUNCTION ) return 0; /* Result is an aggregate */ assert( ExprUseUToken(pExpr) ); @@ -145038,7 +145097,8 @@ static int countOfViewOptimization(Parse *pParse, Select *p){ if( ExprHasProperty(pExpr, EP_WinFunc) ) return 0;/* Not a window function */ pSub = p->pSrc->a[0].pSelect; if( pSub==0 ) return 0; /* The FROM is a subquery */ - if( pSub->pPrior==0 ) return 0; /* Must be a compound ry */ + if( pSub->pPrior==0 ) return 0; /* Must be a compound */ + if( pSub->selFlags & SF_CopyCte ) return 0; /* Not a CTE */ do{ if( pSub->op!=TK_ALL && pSub->pPrior ) return 0; /* Must be UNION ALL */ if( pSub->pWhere ) return 0; /* No WHERE clause */ @@ -145481,7 +145541,6 @@ SQLITE_PRIVATE int sqlite3Select( && countOfViewOptimization(pParse, p) ){ if( db->mallocFailed ) goto select_end; - pEList = p->pEList; pTabList = p->pSrc; } #endif @@ -146843,6 +146902,7 @@ SQLITE_PRIVATE void sqlite3BeginTrigger( }else{ assert( !db->init.busy ); sqlite3CodeVerifySchema(pParse, iDb); + VVA_ONLY( pParse->ifNotExists = 1; ) } goto trigger_cleanup; } @@ -147624,7 +147684,7 @@ static void codeReturningTrigger( } sqlite3ExprListDelete(db, sSelect.pEList); pNew = sqlite3ExpandReturning(pParse, pReturning->pReturnEL, pTab); - if( !db->mallocFailed ){ + if( pParse->nErr==0 ){ NameContext sNC; memset(&sNC, 0, sizeof(sNC)); if( pReturning->nRetCol==0 ){ @@ -148846,12 +148906,22 @@ SQLITE_PRIVATE void sqlite3Update( /* Begin the database scan. ** ** Do not consider a single-pass strategy for a multi-row update if - ** there are any triggers or foreign keys to process, or rows may - ** be deleted as a result of REPLACE conflict handling. Any of these - ** things might disturb a cursor being used to scan through the table - ** or index, causing a single-pass approach to malfunction. */ + ** there is anything that might disrupt the cursor being used to do + ** the UPDATE: + ** (1) This is a nested UPDATE + ** (2) There are triggers + ** (3) There are FOREIGN KEY constraints + ** (4) There are REPLACE conflict handlers + ** (5) There are subqueries in the WHERE clause + */ flags = WHERE_ONEPASS_DESIRED; - if( !pParse->nested && !pTrigger && !hasFK && !chngKey && !bReplace ){ + if( !pParse->nested + && !pTrigger + && !hasFK + && !chngKey + && !bReplace + && (sNC.ncFlags & NC_Subquery)==0 + ){ flags |= WHERE_ONEPASS_MULTIROW; } pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere,0,0,0,flags,iIdxCur); @@ -150816,7 +150886,9 @@ static int vtabCallConstructor( sCtx.pPrior = db->pVtabCtx; sCtx.bDeclared = 0; db->pVtabCtx = &sCtx; + pTab->nTabRef++; rc = xConstruct(db, pMod->pAux, nArg, azArg, &pVTable->pVtab, &zErr); + sqlite3DeleteTable(db, pTab); db->pVtabCtx = sCtx.pPrior; if( rc==SQLITE_NOMEM ) sqlite3OomFault(db); assert( sCtx.pTab==pTab ); @@ -156848,7 +156920,7 @@ SQLITE_PRIVATE void sqlite3WhereTabFuncArgs( pRhs = sqlite3PExpr(pParse, TK_UPLUS, sqlite3ExprDup(pParse->db, pArgs->a[j].pExpr, 0), 0); pTerm = sqlite3PExpr(pParse, TK_EQ, pColRef, pRhs); - if( pItem->fg.jointype & (JT_LEFT|JT_LTORJ) ){ + if( pItem->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT) ){ joinType = EP_OuterON; }else{ joinType = EP_InnerON; @@ -157985,6 +158057,10 @@ static SQLITE_NOINLINE void sqlite3ConstructBloomFilter( Vdbe *v = pParse->pVdbe; /* VDBE under construction */ WhereLoop *pLoop = pLevel->pWLoop; /* The loop being coded */ int iCur; /* Cursor for table getting the filter */ + IndexedExpr *saved_pIdxEpr; /* saved copy of Parse.pIdxEpr */ + + saved_pIdxEpr = pParse->pIdxEpr; + pParse->pIdxEpr = 0; assert( pLoop!=0 ); assert( v!=0 ); @@ -158041,9 +158117,8 @@ static SQLITE_NOINLINE void sqlite3ConstructBloomFilter( int r1 = sqlite3GetTempRange(pParse, n); int jj; for(jj=0; jjaiColumn[jj]; assert( pIdx->pTable==pItem->pTab ); - sqlite3ExprCodeGetColumnOfTable(v, pIdx->pTable, iCur, iCol,r1+jj); + sqlite3ExprCodeLoadIndexColumn(pParse, pIdx, iCur, jj, r1+jj); } sqlite3VdbeAddOp4Int(v, OP_FilterAdd, pLevel->regFilter, 0, r1, n); sqlite3ReleaseTempRange(pParse, r1, n); @@ -158074,6 +158149,7 @@ static SQLITE_NOINLINE void sqlite3ConstructBloomFilter( } }while( iLevel < pWInfo->nLevel ); sqlite3VdbeJumpHere(v, addrOnce); + pParse->pIdxEpr = saved_pIdxEpr; } @@ -158373,6 +158449,7 @@ static int whereKeyStats( assert( pIdx->nSample>0 ); assert( pRec->nField>0 ); + /* Do a binary search to find the first sample greater than or equal ** to pRec. If pRec contains a single field, the set of samples to search ** is simply the aSample[] array. If the samples in aSample[] contain more @@ -158417,7 +158494,12 @@ static int whereKeyStats( ** it is extended to two fields. The duplicates that this creates do not ** cause any problems. */ - nField = MIN(pRec->nField, pIdx->nSample); + if( !HasRowid(pIdx->pTable) && IsPrimaryKeyIndex(pIdx) ){ + nField = pIdx->nKeyCol; + }else{ + nField = pIdx->nColumn; + } + nField = MIN(pRec->nField, nField); iCol = 0; iSample = pIdx->nSample * nField; do{ @@ -162145,6 +162227,10 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){ if( pFrom->isOrdered==pWInfo->pOrderBy->nExpr ){ pWInfo->eDistinct = WHERE_DISTINCT_ORDERED; } + if( pWInfo->pSelect->pOrderBy + && pWInfo->nOBSat > pWInfo->pSelect->pOrderBy->nExpr ){ + pWInfo->nOBSat = pWInfo->pSelect->pOrderBy->nExpr; + } }else{ pWInfo->revMask = pFrom->revLoop; if( pWInfo->nOBSat<=0 ){ @@ -162556,6 +162642,9 @@ static SQLITE_NOINLINE void whereAddIndexedExpr( p->iIdxCur = iIdxCur; p->iIdxCol = i; p->bMaybeNullRow = bMaybeNullRow; + if( sqlite3IndexAffinityStr(pParse->db, pIdx) ){ + p->aff = pIdx->zColAff[i]; + } #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS p->zIdxName = pIdx->zName; #endif @@ -193018,16 +193107,18 @@ static int fts3MsrBufferData( char *pList, i64 nList ){ - if( nList>pMsr->nBuffer ){ + if( (nList+FTS3_NODE_PADDING)>pMsr->nBuffer ){ char *pNew; - pMsr->nBuffer = nList*2; - pNew = (char *)sqlite3_realloc64(pMsr->aBuffer, pMsr->nBuffer); + int nNew = nList*2 + FTS3_NODE_PADDING; + pNew = (char *)sqlite3_realloc64(pMsr->aBuffer, nNew); if( !pNew ) return SQLITE_NOMEM; pMsr->aBuffer = pNew; + pMsr->nBuffer = nNew; } assert( nList>0 ); memcpy(pMsr->aBuffer, pList, nList); + memset(&pMsr->aBuffer[nList], 0, FTS3_NODE_PADDING); return SQLITE_OK; } @@ -240171,7 +240262,7 @@ static void fts5SourceIdFunc( ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); - sqlite3_result_text(pCtx, "fts5: 2023-02-21 18:09:37 05941c2a04037fc3ed2ffae11f5d2260706f89431f463518740f72ada350866d", -1, SQLITE_TRANSIENT); + sqlite3_result_text(pCtx, "fts5: 2023-03-22 11:56:21 0d1fc92f94cb6b76bffe3ec34d69cffde2924203304e8ffc4155597af0c191da", -1, SQLITE_TRANSIENT); } /* diff --git a/contrib/sqlite3/sqlite3.h b/contrib/sqlite3/sqlite3.h index 4c6addac26c3..7e43e1f1b4dc 100644 --- a/contrib/sqlite3/sqlite3.h +++ b/contrib/sqlite3/sqlite3.h @@ -146,9 +146,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.41.0" -#define SQLITE_VERSION_NUMBER 3041000 -#define SQLITE_SOURCE_ID "2023-02-21 18:09:37 05941c2a04037fc3ed2ffae11f5d2260706f89431f463518740f72ada350866d" +#define SQLITE_VERSION "3.41.2" +#define SQLITE_VERSION_NUMBER 3041002 +#define SQLITE_SOURCE_ID "2023-03-22 11:56:21 0d1fc92f94cb6b76bffe3ec34d69cffde2924203304e8ffc4155597af0c191da" /* ** CAPI3REF: Run-Time Library Version Numbers diff --git a/contrib/sqlite3/sqlite3rc.h b/contrib/sqlite3/sqlite3rc.h index 6b8378ed1271..1dd5484c2c96 100644 --- a/contrib/sqlite3/sqlite3rc.h +++ b/contrib/sqlite3/sqlite3rc.h @@ -1,3 +1,3 @@ #ifndef SQLITE_RESOURCE_VERSION -#define SQLITE_RESOURCE_VERSION 3,41,0 +#define SQLITE_RESOURCE_VERSION 3,41,2 #endif diff --git a/contrib/sqlite3/tea/configure b/contrib/sqlite3/tea/configure index d4a42170b424..750545f3961c 100755 --- a/contrib/sqlite3/tea/configure +++ b/contrib/sqlite3/tea/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for sqlite 3.41.0. +# Generated by GNU Autoconf 2.71 for sqlite 3.41.2. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -608,8 +608,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.41.0' -PACKAGE_STRING='sqlite 3.41.0' +PACKAGE_VERSION='3.41.2' +PACKAGE_STRING='sqlite 3.41.2' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1331,7 +1331,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.41.0 to adapt to many kinds of systems. +\`configure' configures sqlite 3.41.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1393,7 +1393,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.41.0:";; + short | recursive ) echo "Configuration of sqlite 3.41.2:";; esac cat <<\_ACEOF @@ -1496,7 +1496,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.41.0 +sqlite configure 3.41.2 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1795,7 +1795,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.41.0, which was +It was created by sqlite $as_me 3.41.2, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -9560,7 +9560,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.41.0, which was +This file was extended by sqlite $as_me 3.41.2, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -9615,7 +9615,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -sqlite config.status 3.41.0 +sqlite config.status 3.41.2 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/contrib/sqlite3/tea/configure.ac b/contrib/sqlite3/tea/configure.ac index f6291d2557d4..8c06474a1af3 100644 --- a/contrib/sqlite3/tea/configure.ac +++ b/contrib/sqlite3/tea/configure.ac @@ -19,7 +19,7 @@ dnl to configure the system for the local environment. # so that we create the export library with the dll. #----------------------------------------------------------------------- -AC_INIT([sqlite],[3.41.0]) +AC_INIT([sqlite],[3.41.2]) #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. From nobody Mon May 1 04:15:13 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8qcf11sLz47kqB; Mon, 1 May 2023 04:15: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 4Q8qcf0n4jz3j9C; Mon, 1 May 2023 04:15:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682914514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3UtwKzP8c3JRbihRlS+2aAKVi55seBMTfHirP+wb720=; b=pSjRO6OEfsACQZ5O3bR3X12HmsRz9ZdM0u9xC9Ojj01BAGz4JZpf4vxt82+labyCLNTNtV tbqS6QX4HqgM7xl6I4M49YfDME42tdpuxBzusfYwkDtuYinDexB8FnnXvnDzQCII+EI4Fk Wni6aA6hDlk1d1HgOBBfNxA7dVP+FDg951Pr9ES3r1ZcpX/NuuGXj98vLFdhwLotWUNVC7 cJQmvm3TIIYsoqOlwNmqUTAQbiB8P9MNtWuAA1FKBa8UUhq/x/P5NIyf7XUJ4upp7AKDIM s/DSijPu8axrLqKqZ1JheHYGmg0Qs5oO0OMzSH+2ASQa9IOgwoZvt0pS9ef4hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682914514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3UtwKzP8c3JRbihRlS+2aAKVi55seBMTfHirP+wb720=; b=Jm7paVhgctAAtL5o73soJtGcIMLliqpH95sISuEfXdxhV7gvY9JwDYbH0gw/aKpu3SiMtS XwfrvdeDnwq1Y1pWoh+69eOUEJajYuD9JrY2ObPW1ymBSORF3cJUMK9OChVs0zBQ/sFNOE yQb3nKH8TD62cpsqHTycOl1akwY6iL02FT7mKgOuzBOLYgMzwsfOz9gGwOewRCFf+jDZdn XEdkKSb3ovx8iZO41fUbuR+a8FkeFwfTYbzMZHS076yDAIVneu9+ykHaso6mTyNO+gEKCt pVOGhtnOs890OoxJcUtszGFcodpqUw1tyndDFLwd7JXyMPaQg08JvPpyAywlaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682914514; a=rsa-sha256; cv=none; b=fpjppXgwQbAobAqd7n2dOAG014yHa8ITWaKsN4AnAIh55UCt5KXm9e58VDLg4MRPE9tgt5 EOLDnHhZLKrfSJ3xXT4NxKqWBD2PAdxW/1z+0dVy0BDLG2RjSVkN9UFCY8MDC5vQUXDMe1 AQj7JZ+hFEUpEmb7ZbfiRVr1ih1VKqhadDfhxWn1noJDuDYqG8ODReorjSvCeJFFeZXfcZ UXQUs5Dg0P6Mio9rd1MoPzTl3HqfK6IfAtz4218LhYjs626qjdy/DAcfqLd7ourPJGBfKd P9RPntv2R6V5JNlvudhXWCgpki6GCBnLNDPzxHU04CvEeC5OmrWFiulgIqIXUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8qcd6yDvzqgX; Mon, 1 May 2023 04:15: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 3414FDeH082691; Mon, 1 May 2023 04:15:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3414FDkj082688; Mon, 1 May 2023 04:15:13 GMT (envelope-from git) Date: Mon, 1 May 2023 04:15:13 GMT Message-Id: <202305010415.3414FDkj082688@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: c3bbba00e452 - stable/12 - sqlite3: Vendor import of sqlite3 3.41.2 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/12 X-Git-Reftype: branch X-Git-Commit: c3bbba00e4527d423803b3f0a5d473570e40570c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=c3bbba00e4527d423803b3f0a5d473570e40570c commit c3bbba00e4527d423803b3f0a5d473570e40570c Author: Cy Schubert AuthorDate: 2023-04-17 16:02:41 +0000 Commit: Cy Schubert CommitDate: 2023-05-01 04:14:45 +0000 sqlite3: Vendor import of sqlite3 3.41.2 Release notes at https://www.sqlite.org/releaselog/3_41_2.html. Obtained from: https://www.sqlite.org/2023/sqlite-autoconf-3410200.tar.gz Merge commit '853a43f7c79218855a6e45a25a00b942972e3fa1' (cherry picked from commit e7e621f94d9073d620a4d15f13952f1d40685ece) --- contrib/sqlite3/configure | 20 ++-- contrib/sqlite3/configure.ac | 2 +- contrib/sqlite3/shell.c | 10 +- contrib/sqlite3/sqlite3.c | 209 ++++++++++++++++++++++++++++----------- contrib/sqlite3/sqlite3.h | 6 +- contrib/sqlite3/sqlite3rc.h | 2 +- contrib/sqlite3/tea/configure | 18 ++-- contrib/sqlite3/tea/configure.ac | 2 +- 8 files changed, 182 insertions(+), 87 deletions(-) diff --git a/contrib/sqlite3/configure b/contrib/sqlite3/configure index e5cbf778e689..dea9860d00ee 100755 --- a/contrib/sqlite3/configure +++ b/contrib/sqlite3/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for sqlite 3.41.0. +# Generated by GNU Autoconf 2.71 for sqlite 3.41.2. # # Report bugs to . # @@ -621,8 +621,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.41.0' -PACKAGE_STRING='sqlite 3.41.0' +PACKAGE_VERSION='3.41.2' +PACKAGE_STRING='sqlite 3.41.2' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1367,7 +1367,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.41.0 to adapt to many kinds of systems. +\`configure' configures sqlite 3.41.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1438,7 +1438,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.41.0:";; + short | recursive ) echo "Configuration of sqlite 3.41.2:";; esac cat <<\_ACEOF @@ -1563,7 +1563,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.41.0 +sqlite configure 3.41.2 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1833,7 +1833,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.41.0, which was +It was created by sqlite $as_me 3.41.2, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3106,7 +3106,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.41.0' + VERSION='3.41.2' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -15314,7 +15314,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.41.0, which was +This file was extended by sqlite $as_me 3.41.2, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15373,7 +15373,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -sqlite config.status 3.41.0 +sqlite config.status 3.41.2 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/contrib/sqlite3/configure.ac b/contrib/sqlite3/configure.ac index f7f6558c2db5..290f160afc56 100644 --- a/contrib/sqlite3/configure.ac +++ b/contrib/sqlite3/configure.ac @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.41.0, http://www.sqlite.org) +AC_INIT(sqlite, 3.41.2, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) diff --git a/contrib/sqlite3/shell.c b/contrib/sqlite3/shell.c index d6a673fe2cfe..e6495d75128e 100644 --- a/contrib/sqlite3/shell.c +++ b/contrib/sqlite3/shell.c @@ -13023,10 +13023,14 @@ static int dbdataNext(sqlite3_vtab_cursor *pCursor){ if( pCsr->bOnePage==0 && pCsr->iPgno>pCsr->szDb ) return SQLITE_OK; rc = dbdataLoadPage(pCsr, pCsr->iPgno, &pCsr->aPage, &pCsr->nPage); if( rc!=SQLITE_OK ) return rc; - if( pCsr->aPage ) break; + if( pCsr->aPage && pCsr->nPage>=256 ) break; + sqlite3_free(pCsr->aPage); + pCsr->aPage = 0; if( pCsr->bOnePage ) return SQLITE_OK; pCsr->iPgno++; } + + assert( iOff+3+2<=pCsr->nPage ); pCsr->iCell = pTab->bPtr ? -2 : 0; pCsr->nCell = get_uint16(&pCsr->aPage[iOff+3]); } @@ -13261,8 +13265,7 @@ static int dbdataGetEncoding(DbdataCursor *pCsr){ int nPg1 = 0; u8 *aPg1 = 0; rc = dbdataLoadPage(pCsr, 1, &aPg1, &nPg1); - assert( rc!=SQLITE_OK || nPg1==0 || nPg1>=512 ); - if( rc==SQLITE_OK && nPg1>0 ){ + if( rc==SQLITE_OK && nPg1>=(56+4) ){ pCsr->enc = get_uint32(&aPg1[56]); } sqlite3_free(aPg1); @@ -17921,6 +17924,7 @@ static char *shell_error_context(const char *zSql, sqlite3 *db){ if( db==0 || zSql==0 || (iOffset = sqlite3_error_offset(db))<0 + || iOffset>=strlen(zSql) ){ return sqlite3_mprintf(""); } diff --git a/contrib/sqlite3/sqlite3.c b/contrib/sqlite3/sqlite3.c index b47891c3817b..947a15455173 100644 --- a/contrib/sqlite3/sqlite3.c +++ b/contrib/sqlite3/sqlite3.c @@ -1,6 +1,6 @@ /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.41.0. By combining all the individual C code files into this +** version 3.41.2. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -452,9 +452,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.41.0" -#define SQLITE_VERSION_NUMBER 3041000 -#define SQLITE_SOURCE_ID "2023-02-21 18:09:37 05941c2a04037fc3ed2ffae11f5d2260706f89431f463518740f72ada350866d" +#define SQLITE_VERSION "3.41.2" +#define SQLITE_VERSION_NUMBER 3041002 +#define SQLITE_SOURCE_ID "2023-03-22 11:56:21 0d1fc92f94cb6b76bffe3ec34d69cffde2924203304e8ffc4155597af0c191da" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -16592,7 +16592,7 @@ struct PgHdr { ** private to pcache.c and should not be accessed by other modules. ** pCache is grouped with the public elements for efficiency. */ - i16 nRef; /* Number of users of this page */ + i64 nRef; /* Number of users of this page */ PgHdr *pDirtyNext; /* Next element in list of dirty pages */ PgHdr *pDirtyPrev; /* Previous element in list of dirty pages */ /* NB: pDirtyNext and pDirtyPrev are undefined if the @@ -16673,12 +16673,12 @@ SQLITE_PRIVATE void sqlite3PcacheClearSyncFlags(PCache *); SQLITE_PRIVATE void sqlite3PcacheClear(PCache*); /* Return the total number of outstanding page references */ -SQLITE_PRIVATE int sqlite3PcacheRefCount(PCache*); +SQLITE_PRIVATE i64 sqlite3PcacheRefCount(PCache*); /* Increment the reference count of an existing page */ SQLITE_PRIVATE void sqlite3PcacheRef(PgHdr*); -SQLITE_PRIVATE int sqlite3PcachePageRefcount(PgHdr*); +SQLITE_PRIVATE i64 sqlite3PcachePageRefcount(PgHdr*); /* Return the total number of pages stored in the cache */ SQLITE_PRIVATE int sqlite3PcachePagecount(PCache*); @@ -18837,7 +18837,7 @@ struct NameContext { #define NC_HasAgg 0x000010 /* One or more aggregate functions seen */ #define NC_IdxExpr 0x000020 /* True if resolving columns of CREATE INDEX */ #define NC_SelfRef 0x00002e /* Combo: PartIdx, isCheck, GenCol, and IdxExpr */ -#define NC_VarSelect 0x000040 /* A correlated subquery has been seen */ +#define NC_Subquery 0x000040 /* A subquery has been seen */ #define NC_UEList 0x000080 /* True if uNC.pEList is used */ #define NC_UAggInfo 0x000100 /* True if uNC.pAggInfo is used */ #define NC_UUpsert 0x000200 /* True if uNC.pUpsert is used */ @@ -19156,6 +19156,7 @@ struct IndexedExpr { int iIdxCur; /* The index cursor */ int iIdxCol; /* The index column that contains value of pExpr */ u8 bMaybeNullRow; /* True if we need an OP_IfNullRow check */ + u8 aff; /* Affinity of the pExpr expression */ IndexedExpr *pIENext; /* Next in a list of all indexed expressions */ #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS const char *zIdxName; /* Name of index, used only for bytecode comments */ @@ -19207,6 +19208,9 @@ struct Parse { u8 withinRJSubrtn; /* Nesting level for RIGHT JOIN body subroutines */ #if defined(SQLITE_DEBUG) || defined(SQLITE_COVERAGE_TEST) u8 earlyCleanup; /* OOM inside sqlite3ParserAddCleanup() */ +#endif +#ifdef SQLITE_DEBUG + u8 ifNotExists; /* Might be true if IF NOT EXISTS. Assert()s only */ #endif int nRangeReg; /* Size of the temporary register block */ int iRangeReg; /* First register in temporary register block */ @@ -52653,7 +52657,7 @@ bitvec_end: struct PCache { PgHdr *pDirty, *pDirtyTail; /* List of dirty pages in LRU order */ PgHdr *pSynced; /* Last synced page in dirty page list */ - int nRefSum; /* Sum of ref counts over all pages */ + i64 nRefSum; /* Sum of ref counts over all pages */ int szCache; /* Configured cache size */ int szSpill; /* Size before spilling occurs */ int szPage; /* Size of every page in this cache */ @@ -52683,7 +52687,7 @@ struct PCache { unsigned char *a; int j; pPg = (PgHdr*)pLower->pExtra; - printf("%3d: nRef %2d flgs %02x data ", i, pPg->nRef, pPg->flags); + printf("%3lld: nRef %2d flgs %02x data ", i, pPg->nRef, pPg->flags); a = (unsigned char *)pLower->pBuf; for(j=0; j<12; j++) printf("%02x", a[j]); printf(" ptr %p\n", pPg); @@ -53427,14 +53431,14 @@ SQLITE_PRIVATE PgHdr *sqlite3PcacheDirtyList(PCache *pCache){ ** This is not the total number of pages referenced, but the sum of the ** reference count for all pages. */ -SQLITE_PRIVATE int sqlite3PcacheRefCount(PCache *pCache){ +SQLITE_PRIVATE i64 sqlite3PcacheRefCount(PCache *pCache){ return pCache->nRefSum; } /* ** Return the number of references to the page supplied as an argument. */ -SQLITE_PRIVATE int sqlite3PcachePageRefcount(PgHdr *p){ +SQLITE_PRIVATE i64 sqlite3PcachePageRefcount(PgHdr *p){ return p->nRef; } @@ -74504,7 +74508,7 @@ static SQLITE_NOINLINE int btreeNext(BtCursor *pCur){ pPage = pCur->pPage; idx = ++pCur->ix; - if( NEVER(!pPage->isInit) || sqlite3FaultSim(412) ){ + if( !pPage->isInit || sqlite3FaultSim(412) ){ return SQLITE_CORRUPT_BKPT; } @@ -77633,6 +77637,7 @@ SQLITE_PRIVATE int sqlite3BtreeInsert( assert( szNew==pPage->xCellSize(pPage, newCell) ); assert( szNew <= MX_CELL_SIZE(p->pBt) ); idx = pCur->ix; + pCur->info.nSize = 0; if( loc==0 ){ CellInfo info; assert( idx>=0 ); @@ -77705,7 +77710,6 @@ SQLITE_PRIVATE int sqlite3BtreeInsert( ** larger than the largest existing key, it is possible to insert the ** row without seeking the cursor. This can be a big performance boost. */ - pCur->info.nSize = 0; if( pPage->nOverflow ){ assert( rc==SQLITE_OK ); pCur->curFlags &= ~(BTCF_ValidNKey); @@ -90915,8 +90919,7 @@ static u64 filterHash(const Mem *aMem, const Op *pOp){ }else if( p->flags & MEM_Real ){ h += sqlite3VdbeIntValue(p); }else if( p->flags & (MEM_Str|MEM_Blob) ){ - h += p->n; - if( p->flags & MEM_Zero ) h += p->u.nZero; + /* no-op */ } } return h; @@ -104495,14 +104498,10 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){ if( 0==sqlite3ExprCanBeNull(pExpr->pLeft) && !IN_RENAME_OBJECT ){ testcase( ExprHasProperty(pExpr, EP_OuterON) ); assert( !ExprHasProperty(pExpr, EP_IntValue) ); - if( pExpr->op==TK_NOTNULL ){ - pExpr->u.zToken = "true"; - ExprSetProperty(pExpr, EP_IsTrue); - }else{ - pExpr->u.zToken = "false"; - ExprSetProperty(pExpr, EP_IsFalse); - } - pExpr->op = TK_TRUEFALSE; + pExpr->u.iValue = (pExpr->op==TK_NOTNULL); + pExpr->flags |= EP_IntValue; + pExpr->op = TK_INTEGER; + for(i=0, p=pNC; p && ipNext, i++){ p->nRef = anRef[i]; } @@ -104804,8 +104803,8 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){ assert( pNC->nRef>=nRef ); if( nRef!=pNC->nRef ){ ExprSetProperty(pExpr, EP_VarSelect); - pNC->ncFlags |= NC_VarSelect; } + pNC->ncFlags |= NC_Subquery; } break; } @@ -109554,6 +109553,7 @@ SQLITE_PRIVATE void sqlite3ExprCodeGeneratedColumn( ){ int iAddr; Vdbe *v = pParse->pVdbe; + int nErr = pParse->nErr; assert( v!=0 ); assert( pParse->iSelfTab!=0 ); if( pParse->iSelfTab>0 ){ @@ -109566,6 +109566,7 @@ SQLITE_PRIVATE void sqlite3ExprCodeGeneratedColumn( sqlite3VdbeAddOp4(v, OP_Affinity, regOut, 1, 0, &pCol->affinity, 1); } if( iAddr ) sqlite3VdbeJumpHere(v, iAddr); + if( pParse->nErr>nErr ) pParse->db->errByteOffset = -1; } #endif /* SQLITE_OMIT_GENERATED_COLUMNS */ @@ -109582,6 +109583,7 @@ SQLITE_PRIVATE void sqlite3ExprCodeGetColumnOfTable( Column *pCol; assert( v!=0 ); assert( pTab!=0 ); + assert( iCol!=XN_EXPR ); if( iCol<0 || iCol==pTab->iPKey ){ sqlite3VdbeAddOp2(v, OP_Rowid, iTabCur, regOut); VdbeComment((v, "%s.rowid", pTab->zName)); @@ -109848,6 +109850,7 @@ static SQLITE_NOINLINE int sqlite3IndexedExprLookup( IndexedExpr *p; Vdbe *v; for(p=pParse->pIdxEpr; p; p=p->pIENext){ + u8 exprAff; int iDataCur = p->iDataCur; if( iDataCur<0 ) continue; if( pParse->iSelfTab ){ @@ -109855,6 +109858,16 @@ static SQLITE_NOINLINE int sqlite3IndexedExprLookup( iDataCur = -1; } if( sqlite3ExprCompare(0, pExpr, p->pExpr, iDataCur)!=0 ) continue; + assert( p->aff>=SQLITE_AFF_BLOB && p->aff<=SQLITE_AFF_NUMERIC ); + exprAff = sqlite3ExprAffinity(pExpr); + if( (exprAff<=SQLITE_AFF_BLOB && p->aff!=SQLITE_AFF_BLOB) + || (exprAff==SQLITE_AFF_TEXT && p->aff!=SQLITE_AFF_TEXT) + || (exprAff>=SQLITE_AFF_NUMERIC && p->aff!=SQLITE_AFF_NUMERIC) + ){ + /* Affinity mismatch on a generated column */ + continue; + } + v = pParse->pVdbe; assert( v!=0 ); if( p->bMaybeNullRow ){ @@ -110434,10 +110447,13 @@ expr_code_doover: return target; } case TK_COLLATE: { - if( !ExprHasProperty(pExpr, EP_Collate) - && ALWAYS(pExpr->pLeft) - && pExpr->pLeft->op==TK_FUNCTION - ){ + if( !ExprHasProperty(pExpr, EP_Collate) ){ + /* A TK_COLLATE Expr node without the EP_Collate tag is a so-called + ** "SOFT-COLLATE" that is added to constraints that are pushed down + ** from outer queries into sub-queries by the push-down optimization. + ** Clear subtypes as subtypes may not cross a subquery boundary. + */ + assert( pExpr->pLeft ); inReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target); if( inReg!=target ){ sqlite3VdbeAddOp2(v, OP_SCopy, inReg, target); @@ -110545,16 +110561,22 @@ expr_code_doover: break; } } - addrINR = sqlite3VdbeAddOp1(v, OP_IfNullRow, pExpr->iTable); - /* Temporarily disable factoring of constant expressions, since - ** even though expressions may appear to be constant, they are not - ** really constant because they originate from the right-hand side - ** of a LEFT JOIN. */ - pParse->okConstFactor = 0; + addrINR = sqlite3VdbeAddOp3(v, OP_IfNullRow, pExpr->iTable, 0, target); + /* The OP_IfNullRow opcode above can overwrite the result register with + ** NULL. So we have to ensure that the result register is not a value + ** that is suppose to be a constant. Two defenses are needed: + ** (1) Temporarily disable factoring of constant expressions + ** (2) Make sure the computed value really is stored in register + ** "target" and not someplace else. + */ + pParse->okConstFactor = 0; /* note (1) above */ inReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target); pParse->okConstFactor = okConstFactor; + if( inReg!=target ){ /* note (2) above */ + sqlite3VdbeAddOp2(v, OP_SCopy, inReg, target); + inReg = target; + } sqlite3VdbeJumpHere(v, addrINR); - sqlite3VdbeChangeP3(v, addrINR, inReg); break; } @@ -118917,7 +118939,7 @@ SQLITE_PRIVATE void sqlite3AddReturning(Parse *pParse, ExprList *pList){ if( pParse->pNewTrigger ){ sqlite3ErrorMsg(pParse, "cannot use RETURNING in a trigger"); }else{ - assert( pParse->bReturning==0 ); + assert( pParse->bReturning==0 || pParse->ifNotExists ); } pParse->bReturning = 1; pRet = sqlite3DbMallocZero(db, sizeof(*pRet)); @@ -118943,7 +118965,8 @@ SQLITE_PRIVATE void sqlite3AddReturning(Parse *pParse, ExprList *pList){ pRet->retTStep.pTrig = &pRet->retTrig; pRet->retTStep.pExprList = pList; pHash = &(db->aDb[1].pSchema->trigHash); - assert( sqlite3HashFind(pHash, RETURNING_TRIGGER_NAME)==0 || pParse->nErr ); + assert( sqlite3HashFind(pHash, RETURNING_TRIGGER_NAME)==0 + || pParse->nErr || pParse->ifNotExists ); if( sqlite3HashInsert(pHash, RETURNING_TRIGGER_NAME, &pRet->retTrig) ==&pRet->retTrig ){ sqlite3OomFault(db); @@ -119478,6 +119501,7 @@ SQLITE_PRIVATE void sqlite3AddGenerated(Parse *pParse, Expr *pExpr, Token *pType ** turn it into one by adding a unary "+" operator. */ pExpr = sqlite3PExpr(pParse, TK_UPLUS, pExpr, 0); } + if( pExpr && pExpr->op!=TK_RAISE ) pExpr->affExpr = pCol->affinity; sqlite3ColumnSetExpr(pParse, pTab, pCol, pExpr); pExpr = 0; goto generated_done; @@ -124184,7 +124208,7 @@ SQLITE_PRIVATE void sqlite3DeleteFrom( #endif /* SQLITE_OMIT_TRUNCATE_OPTIMIZATION */ { u16 wcf = WHERE_ONEPASS_DESIRED|WHERE_DUPLICATES_OK; - if( sNC.ncFlags & NC_VarSelect ) bComplex = 1; + if( sNC.ncFlags & NC_Subquery ) bComplex = 1; wcf |= (bComplex ? 0 : WHERE_ONEPASS_MULTIROW); if( HasRowid(pTab) ){ /* For a rowid table, initialize the RowSet to an empty set */ @@ -126881,6 +126905,18 @@ static void ceilingFunc( static double xCeil(double x){ return ceil(x); } static double xFloor(double x){ return floor(x); } +/* +** Some systems do not have log2() and log10() in their standard math +** libraries. +*/ +#if defined(HAVE_LOG10) && HAVE_LOG10==0 +# define log10(X) (0.4342944819032517867*log(X)) +#endif +#if defined(HAVE_LOG2) && HAVE_LOG2==0 +# define log2(X) (1.442695040888963456*log(X)) +#endif + + /* ** Implementation of SQL functions: ** @@ -136260,6 +136296,23 @@ SQLITE_PRIVATE void sqlite3Pragma( jmp4 = integrityCheckResultRow(v); sqlite3VdbeJumpHere(v, jmp2); + /* The OP_IdxRowid opcode is an optimized version of OP_Column + ** that extracts the rowid off the end of the index record. + ** But it only works correctly if index record does not have + ** any extra bytes at the end. Verify that this is the case. */ + if( HasRowid(pTab) ){ + int jmp7; + sqlite3VdbeAddOp2(v, OP_IdxRowid, iIdxCur+j, 3); + jmp7 = sqlite3VdbeAddOp3(v, OP_Eq, 3, 0, r1+pIdx->nColumn-1); + VdbeCoverage(v); + sqlite3VdbeLoadString(v, 3, + "rowid not at end-of-record for row "); + sqlite3VdbeAddOp3(v, OP_Concat, 7, 3, 3); + sqlite3VdbeLoadString(v, 4, " of index "); + sqlite3VdbeGoto(v, jmp5-1); + sqlite3VdbeJumpHere(v, jmp7); + } + /* Any indexed columns with non-BINARY collations must still hold ** the exact same text value as the table. */ label6 = 0; @@ -140555,8 +140608,6 @@ SQLITE_PRIVATE void sqlite3SubqueryColumnTypes( pCol->affinity = sqlite3ExprAffinity(p); if( pCol->affinity<=SQLITE_AFF_NONE ){ pCol->affinity = aff; - }else if( pCol->affinity>=SQLITE_AFF_NUMERIC && p->op==TK_CAST ){ - pCol->affinity = SQLITE_AFF_FLEXNUM; } if( pCol->affinity>=SQLITE_AFF_TEXT && pSelect->pNext ){ int m = 0; @@ -140570,6 +140621,9 @@ SQLITE_PRIVATE void sqlite3SubqueryColumnTypes( if( pCol->affinity>=SQLITE_AFF_NUMERIC && (m&0x02)!=0 ){ pCol->affinity = SQLITE_AFF_BLOB; } + if( pCol->affinity>=SQLITE_AFF_NUMERIC && p->op==TK_CAST ){ + pCol->affinity = SQLITE_AFF_FLEXNUM; + } } zType = columnType(&sNC, p, 0, 0, 0); if( zType==0 || pCol->affinity!=sqlite3AffinityType(zType, 0) ){ @@ -142084,7 +142138,9 @@ static Expr *substExpr( sqlite3VectorErrorMsg(pSubst->pParse, pCopy); }else{ sqlite3 *db = pSubst->pParse->db; - if( pSubst->isOuterJoin && pCopy->op!=TK_COLUMN ){ + if( pSubst->isOuterJoin + && (pCopy->op!=TK_COLUMN || pCopy->iTable!=pSubst->iNewTable) + ){ memset(&ifNullRow, 0, sizeof(ifNullRow)); ifNullRow.op = TK_IF_NULL_ROW; ifNullRow.pLeft = pCopy; @@ -144600,10 +144656,12 @@ static void optimizeAggregateUseOfIndexedExpr( NameContext *pNC /* Name context used to resolve agg-func args */ ){ assert( pAggInfo->iFirstReg==0 ); + assert( pSelect!=0 ); + assert( pSelect->pGroupBy!=0 ); pAggInfo->nColumn = pAggInfo->nAccumulator; if( ALWAYS(pAggInfo->nSortingColumn>0) ){ if( pAggInfo->nColumn==0 ){ - pAggInfo->nSortingColumn = 0; + pAggInfo->nSortingColumn = pSelect->pGroupBy->nExpr; }else{ pAggInfo->nSortingColumn = pAggInfo->aCol[pAggInfo->nColumn-1].iSorterColumn+1; @@ -145028,6 +145086,7 @@ static int countOfViewOptimization(Parse *pParse, Select *p){ if( p->pEList->nExpr!=1 ) return 0; /* Single result column */ if( p->pWhere ) return 0; if( p->pGroupBy ) return 0; + if( p->pOrderBy ) return 0; pExpr = p->pEList->a[0].pExpr; if( pExpr->op!=TK_AGG_FUNCTION ) return 0; /* Result is an aggregate */ assert( ExprUseUToken(pExpr) ); @@ -145038,7 +145097,8 @@ static int countOfViewOptimization(Parse *pParse, Select *p){ if( ExprHasProperty(pExpr, EP_WinFunc) ) return 0;/* Not a window function */ pSub = p->pSrc->a[0].pSelect; if( pSub==0 ) return 0; /* The FROM is a subquery */ - if( pSub->pPrior==0 ) return 0; /* Must be a compound ry */ + if( pSub->pPrior==0 ) return 0; /* Must be a compound */ + if( pSub->selFlags & SF_CopyCte ) return 0; /* Not a CTE */ do{ if( pSub->op!=TK_ALL && pSub->pPrior ) return 0; /* Must be UNION ALL */ if( pSub->pWhere ) return 0; /* No WHERE clause */ @@ -145481,7 +145541,6 @@ SQLITE_PRIVATE int sqlite3Select( && countOfViewOptimization(pParse, p) ){ if( db->mallocFailed ) goto select_end; - pEList = p->pEList; pTabList = p->pSrc; } #endif @@ -146843,6 +146902,7 @@ SQLITE_PRIVATE void sqlite3BeginTrigger( }else{ assert( !db->init.busy ); sqlite3CodeVerifySchema(pParse, iDb); + VVA_ONLY( pParse->ifNotExists = 1; ) } goto trigger_cleanup; } @@ -147624,7 +147684,7 @@ static void codeReturningTrigger( } sqlite3ExprListDelete(db, sSelect.pEList); pNew = sqlite3ExpandReturning(pParse, pReturning->pReturnEL, pTab); - if( !db->mallocFailed ){ + if( pParse->nErr==0 ){ NameContext sNC; memset(&sNC, 0, sizeof(sNC)); if( pReturning->nRetCol==0 ){ @@ -148846,12 +148906,22 @@ SQLITE_PRIVATE void sqlite3Update( /* Begin the database scan. ** ** Do not consider a single-pass strategy for a multi-row update if - ** there are any triggers or foreign keys to process, or rows may - ** be deleted as a result of REPLACE conflict handling. Any of these - ** things might disturb a cursor being used to scan through the table - ** or index, causing a single-pass approach to malfunction. */ + ** there is anything that might disrupt the cursor being used to do + ** the UPDATE: + ** (1) This is a nested UPDATE + ** (2) There are triggers + ** (3) There are FOREIGN KEY constraints + ** (4) There are REPLACE conflict handlers + ** (5) There are subqueries in the WHERE clause + */ flags = WHERE_ONEPASS_DESIRED; - if( !pParse->nested && !pTrigger && !hasFK && !chngKey && !bReplace ){ + if( !pParse->nested + && !pTrigger + && !hasFK + && !chngKey + && !bReplace + && (sNC.ncFlags & NC_Subquery)==0 + ){ flags |= WHERE_ONEPASS_MULTIROW; } pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere,0,0,0,flags,iIdxCur); @@ -150816,7 +150886,9 @@ static int vtabCallConstructor( sCtx.pPrior = db->pVtabCtx; sCtx.bDeclared = 0; db->pVtabCtx = &sCtx; + pTab->nTabRef++; rc = xConstruct(db, pMod->pAux, nArg, azArg, &pVTable->pVtab, &zErr); + sqlite3DeleteTable(db, pTab); db->pVtabCtx = sCtx.pPrior; if( rc==SQLITE_NOMEM ) sqlite3OomFault(db); assert( sCtx.pTab==pTab ); @@ -156848,7 +156920,7 @@ SQLITE_PRIVATE void sqlite3WhereTabFuncArgs( pRhs = sqlite3PExpr(pParse, TK_UPLUS, sqlite3ExprDup(pParse->db, pArgs->a[j].pExpr, 0), 0); pTerm = sqlite3PExpr(pParse, TK_EQ, pColRef, pRhs); - if( pItem->fg.jointype & (JT_LEFT|JT_LTORJ) ){ + if( pItem->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT) ){ joinType = EP_OuterON; }else{ joinType = EP_InnerON; @@ -157985,6 +158057,10 @@ static SQLITE_NOINLINE void sqlite3ConstructBloomFilter( Vdbe *v = pParse->pVdbe; /* VDBE under construction */ WhereLoop *pLoop = pLevel->pWLoop; /* The loop being coded */ int iCur; /* Cursor for table getting the filter */ + IndexedExpr *saved_pIdxEpr; /* saved copy of Parse.pIdxEpr */ + + saved_pIdxEpr = pParse->pIdxEpr; + pParse->pIdxEpr = 0; assert( pLoop!=0 ); assert( v!=0 ); @@ -158041,9 +158117,8 @@ static SQLITE_NOINLINE void sqlite3ConstructBloomFilter( int r1 = sqlite3GetTempRange(pParse, n); int jj; for(jj=0; jjaiColumn[jj]; assert( pIdx->pTable==pItem->pTab ); - sqlite3ExprCodeGetColumnOfTable(v, pIdx->pTable, iCur, iCol,r1+jj); + sqlite3ExprCodeLoadIndexColumn(pParse, pIdx, iCur, jj, r1+jj); } sqlite3VdbeAddOp4Int(v, OP_FilterAdd, pLevel->regFilter, 0, r1, n); sqlite3ReleaseTempRange(pParse, r1, n); @@ -158074,6 +158149,7 @@ static SQLITE_NOINLINE void sqlite3ConstructBloomFilter( } }while( iLevel < pWInfo->nLevel ); sqlite3VdbeJumpHere(v, addrOnce); + pParse->pIdxEpr = saved_pIdxEpr; } @@ -158373,6 +158449,7 @@ static int whereKeyStats( assert( pIdx->nSample>0 ); assert( pRec->nField>0 ); + /* Do a binary search to find the first sample greater than or equal ** to pRec. If pRec contains a single field, the set of samples to search ** is simply the aSample[] array. If the samples in aSample[] contain more @@ -158417,7 +158494,12 @@ static int whereKeyStats( ** it is extended to two fields. The duplicates that this creates do not ** cause any problems. */ - nField = MIN(pRec->nField, pIdx->nSample); + if( !HasRowid(pIdx->pTable) && IsPrimaryKeyIndex(pIdx) ){ + nField = pIdx->nKeyCol; + }else{ + nField = pIdx->nColumn; + } + nField = MIN(pRec->nField, nField); iCol = 0; iSample = pIdx->nSample * nField; do{ @@ -162145,6 +162227,10 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){ if( pFrom->isOrdered==pWInfo->pOrderBy->nExpr ){ pWInfo->eDistinct = WHERE_DISTINCT_ORDERED; } + if( pWInfo->pSelect->pOrderBy + && pWInfo->nOBSat > pWInfo->pSelect->pOrderBy->nExpr ){ + pWInfo->nOBSat = pWInfo->pSelect->pOrderBy->nExpr; + } }else{ pWInfo->revMask = pFrom->revLoop; if( pWInfo->nOBSat<=0 ){ @@ -162556,6 +162642,9 @@ static SQLITE_NOINLINE void whereAddIndexedExpr( p->iIdxCur = iIdxCur; p->iIdxCol = i; p->bMaybeNullRow = bMaybeNullRow; + if( sqlite3IndexAffinityStr(pParse->db, pIdx) ){ + p->aff = pIdx->zColAff[i]; + } #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS p->zIdxName = pIdx->zName; #endif @@ -193018,16 +193107,18 @@ static int fts3MsrBufferData( char *pList, i64 nList ){ - if( nList>pMsr->nBuffer ){ + if( (nList+FTS3_NODE_PADDING)>pMsr->nBuffer ){ char *pNew; - pMsr->nBuffer = nList*2; - pNew = (char *)sqlite3_realloc64(pMsr->aBuffer, pMsr->nBuffer); + int nNew = nList*2 + FTS3_NODE_PADDING; + pNew = (char *)sqlite3_realloc64(pMsr->aBuffer, nNew); if( !pNew ) return SQLITE_NOMEM; pMsr->aBuffer = pNew; + pMsr->nBuffer = nNew; } assert( nList>0 ); memcpy(pMsr->aBuffer, pList, nList); + memset(&pMsr->aBuffer[nList], 0, FTS3_NODE_PADDING); return SQLITE_OK; } @@ -240171,7 +240262,7 @@ static void fts5SourceIdFunc( ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); - sqlite3_result_text(pCtx, "fts5: 2023-02-21 18:09:37 05941c2a04037fc3ed2ffae11f5d2260706f89431f463518740f72ada350866d", -1, SQLITE_TRANSIENT); + sqlite3_result_text(pCtx, "fts5: 2023-03-22 11:56:21 0d1fc92f94cb6b76bffe3ec34d69cffde2924203304e8ffc4155597af0c191da", -1, SQLITE_TRANSIENT); } /* diff --git a/contrib/sqlite3/sqlite3.h b/contrib/sqlite3/sqlite3.h index 4c6addac26c3..7e43e1f1b4dc 100644 --- a/contrib/sqlite3/sqlite3.h +++ b/contrib/sqlite3/sqlite3.h @@ -146,9 +146,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.41.0" -#define SQLITE_VERSION_NUMBER 3041000 -#define SQLITE_SOURCE_ID "2023-02-21 18:09:37 05941c2a04037fc3ed2ffae11f5d2260706f89431f463518740f72ada350866d" +#define SQLITE_VERSION "3.41.2" +#define SQLITE_VERSION_NUMBER 3041002 +#define SQLITE_SOURCE_ID "2023-03-22 11:56:21 0d1fc92f94cb6b76bffe3ec34d69cffde2924203304e8ffc4155597af0c191da" /* ** CAPI3REF: Run-Time Library Version Numbers diff --git a/contrib/sqlite3/sqlite3rc.h b/contrib/sqlite3/sqlite3rc.h index 6b8378ed1271..1dd5484c2c96 100644 --- a/contrib/sqlite3/sqlite3rc.h +++ b/contrib/sqlite3/sqlite3rc.h @@ -1,3 +1,3 @@ #ifndef SQLITE_RESOURCE_VERSION -#define SQLITE_RESOURCE_VERSION 3,41,0 +#define SQLITE_RESOURCE_VERSION 3,41,2 #endif diff --git a/contrib/sqlite3/tea/configure b/contrib/sqlite3/tea/configure index d4a42170b424..750545f3961c 100755 --- a/contrib/sqlite3/tea/configure +++ b/contrib/sqlite3/tea/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for sqlite 3.41.0. +# Generated by GNU Autoconf 2.71 for sqlite 3.41.2. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -608,8 +608,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.41.0' -PACKAGE_STRING='sqlite 3.41.0' +PACKAGE_VERSION='3.41.2' +PACKAGE_STRING='sqlite 3.41.2' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1331,7 +1331,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.41.0 to adapt to many kinds of systems. +\`configure' configures sqlite 3.41.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1393,7 +1393,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.41.0:";; + short | recursive ) echo "Configuration of sqlite 3.41.2:";; esac cat <<\_ACEOF @@ -1496,7 +1496,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.41.0 +sqlite configure 3.41.2 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1795,7 +1795,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.41.0, which was +It was created by sqlite $as_me 3.41.2, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -9560,7 +9560,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.41.0, which was +This file was extended by sqlite $as_me 3.41.2, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -9615,7 +9615,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -sqlite config.status 3.41.0 +sqlite config.status 3.41.2 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/contrib/sqlite3/tea/configure.ac b/contrib/sqlite3/tea/configure.ac index f6291d2557d4..8c06474a1af3 100644 --- a/contrib/sqlite3/tea/configure.ac +++ b/contrib/sqlite3/tea/configure.ac @@ -19,7 +19,7 @@ dnl to configure the system for the local environment. # so that we create the export library with the dll. #----------------------------------------------------------------------- -AC_INIT([sqlite],[3.41.0]) +AC_INIT([sqlite],[3.41.2]) #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. From nobody Mon May 1 06:46:09 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8typ0wrbz47tYy; Mon, 1 May 2023 06:46: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 4Q8typ0RcCz3vdX; Mon, 1 May 2023 06:46:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682923570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SWhI47WsPtrT0zYWaHdFvncOuC+PmrhS6Jp/QSxt8es=; b=RplPHTWVCNxmjE3dag1mJgIotJZ0nbVjQ1D7sFauTmRFMenpkyrC1yo3flltZhbogXKXtV z/LemnENbXJ3sngVkAHVeX9bYkOWZJtr6MvTPzYCJHfaTii4OIt9N256d7uP8wXakTtBJw HGja9EZvTKXbAURKbIBZBNqiTTxMJrRjJQMu4uns1WXaIuD4NX9kxJpGdBcgstrkMZC6Eb ziVbIphqveKbvtCezTG97kCCgPM1cKxCOh6+q/I2cKpXia5jKwxIo5/tbAakyoqjI9u2dz SvdPpeXJJxUaSOK8hmmEOxn8Q7dccoxX/FIAXFCCT7pASStA2Di8oNEMiUPyjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682923570; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SWhI47WsPtrT0zYWaHdFvncOuC+PmrhS6Jp/QSxt8es=; b=GgxO7sCoeXVjQGgEXHfWLxjXhKBCyeEOVUKIpjXVYHvTGJClLGEBVfNhBfnhLYGAxCXDpO PJ8d4yN2lNX0CTDyOglcTi2yjuWQejrUGq3CqOc5sS4MWyj3CNTmJn3sYMOkuXbfwORy80 Aday14gLRbZ72w8LQZBRtbVnjr2tQMfpXEjaUPd5bIOlOlejedQfd/z1Wx7Nzq9vxxIggI GMlguthfmQDl5pTcckEZMgVZ6zHoyIc2Woq8kpjwpKPIRdUEl8A9KmJdItCOX4jwv+Owbg 7F0qABz7GM3MqsD1XYdG0CzfjktGJwEvX/mBPW3FgbZcSYYUILrw6psopcArCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682923570; a=rsa-sha256; cv=none; b=wUAaXLpwRZS9wvO+S2SMaNajrJnLEFBX3Y5blQUqlK95kz6FUV35i0qndeQncQR1yMYdHD YvK48m8PwmscoA3jms/ynbvQEPZsuKp4SiwTGZRVsrybvAhtPoLky3M7wBS50DV5nskFIO g0stnhjAh8SgLlS9fBrUoCnpS0NhPrnB/qWfkJz8q5bX5AQLfJvUy8x2HnJp32Atg5lIPV rY+qQW7LCNiY/ZCcJ7/IweNXwZS96oFWafQKwew/RSOTqSbVWH5Yb8P/9Z9aWlw2uq6NvY SbYXfLjz88HCKrwSw/ekvnWzkFf5TjlCE/f1tzvzjXerbQ+lV/ILsdZQB4mcdg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8tyn6W9hzvMq; Mon, 1 May 2023 06:46: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 3416k94l030215; Mon, 1 May 2023 06:46:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3416k9Lu030214; Mon, 1 May 2023 06:46:09 GMT (envelope-from git) Date: Mon, 1 May 2023 06:46:09 GMT Message-Id: <202305010646.3416k9Lu030214@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 16004e477d38 - stable/13 - lookup(): ensure that openat("/", "..", O_RESOLVE_BENEATH) fails List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 16004e477d387d6a075597ec76f0dc82d02b60db Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=16004e477d387d6a075597ec76f0dc82d02b60db commit 16004e477d387d6a075597ec76f0dc82d02b60db Author: Konstantin Belousov AuthorDate: 2023-04-23 23:21:42 +0000 Commit: Konstantin Belousov CommitDate: 2023-05-01 06:45:28 +0000 lookup(): ensure that openat("/", "..", O_RESOLVE_BENEATH) fails PR: 269780 (cherry picked from commit a718431c30a57226bc7c1a9181fc84bab00641a1) --- sys/kern/vfs_lookup.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index b7ce93f3702d..7eca6eddd484 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -1014,12 +1014,16 @@ dirloop: pr = pr->pr_parent) if (dp == pr->pr_root) break; - if (dp == ndp->ni_rootdir || - dp == ndp->ni_topdir || - dp == rootvnode || - pr != NULL || - ((dp->v_vflag & VV_ROOT) != 0 && - (cnp->cn_flags & NOCROSSMOUNT) != 0)) { + bool isroot = dp == ndp->ni_rootdir || + dp == ndp->ni_topdir || dp == rootvnode || + pr != NULL; + if (isroot && (ndp->ni_lcf & + NI_LCF_STRICTRELATIVE) != 0) { + error = ENOTCAPABLE; + goto capdotdot; + } + if (isroot || ((dp->v_vflag & VV_ROOT) != 0 && + (cnp->cn_flags & NOCROSSMOUNT) != 0)) { ndp->ni_dvp = dp; ndp->ni_vp = dp; VREF(dp); @@ -1040,6 +1044,7 @@ dirloop: LK_RETRY, ISDOTDOT)); error = nameicap_check_dotdot(ndp, dp); if (error != 0) { +capdotdot: #ifdef KTRACE if (KTRPOINT(curthread, KTR_CAPFAIL)) ktrcapfail(CAPFAIL_LOOKUP, NULL, NULL); From nobody Mon May 1 06:46:10 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8tyq1gfvz47tqp; Mon, 1 May 2023 06:46: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 4Q8tyq182Vz3vp2; Mon, 1 May 2023 06:46:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682923571; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LlHJ92wtrIgbNk8Vw5pNuSe2iJZ83+3x+gyaMm1WezM=; b=DZi3GHULsPjezON1JAKhqRfnv3q3bZ5qk8cljSfibPhl7pKBPdhIijPtQn343qyGDclUOe i/vx06VrEHBoF9F3WDDeJ4+TOZ4LtXpfFwnpLLdJC7Z59FKIo8kKzPO7amzx2k8WarJwHm iidHeY7z5g3/j+t6mEO4rzXe85FM1HA5eynSrr1kewaxWGhyrLLK5brpWNSaNi7/WGxhQl 0V69wAGsVh2Z8n8EPxfXFr5BnVu/Q9HGaeKsK8j+jhn1d4VBtdpbszaHnstC3qsyQQ81I+ XXj8FHk0yxQatqfsJv/5pm7Vimxduq5TGP4AOhLPnVluyBzdu9MdZbBwyVyOnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682923571; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LlHJ92wtrIgbNk8Vw5pNuSe2iJZ83+3x+gyaMm1WezM=; b=tttcXZzEcAMLM+JsSDvTrVzQkSMmobQ+b8u8ww3uCDNiZ5+7bD5BgnWRCG7xkG0WcUbRTJ ZiFAmBQMtHpMN3wE2W8mtdAoqBksz6X+ouTupNTKSax+9Gllm8PyRzqzXQxv3Fo0kARAWF sYi/DBN/qPZ80/irIQGhuYNEBOc4xWABU6UgBPm4EVMmmFzj8bVXuSRaABi0c/z5nmccxK JvnTKGzLJ+b7flzF/qEaldWON09gzBrN/QCYHzUnR7B0XsmRVZM0gf74IXF97Jj3VtVTdn HT+DrXVN/FNu98/aY7B2u1npgVILG8l0/rLAWSHgP+6yj+bEMFBxw94s0slajg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682923571; a=rsa-sha256; cv=none; b=DMZOe7wzhpKIS5eIqauBxVwHRBXa655foAr8kANcf2nUk/VXNkwG5zUrO70ETLn6qoER9j AiETZLOy2YbSsECj0UQogo5quMjaxyGkYYs2ga1tx9WaM4ZRhzfRROm8/U+j8e92jVb87I Yfc3tuO9P0oOrTQoHCTv72a6A+fiRxrqj2qwC5GmK2xtMQQOn9f+fcWzRyXaAm9h2d6eD9 M/h1X7eSPpCfHeQ8tU3y7+hD1AFJjUDjReZls4ROh3orOPIi0cxz6RfQRw1FAmsbrLjdd7 S2ekYS7Oe2q0gJgLvu0Zouanr89aLBskZPd1n0WGE/KDfH0c290IXwDgBEvWgw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8tyq01mmzvqs; Mon, 1 May 2023 06:46: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 3416kAT1030240; Mon, 1 May 2023 06:46:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3416kAY2030239; Mon, 1 May 2023 06:46:10 GMT (envelope-from git) Date: Mon, 1 May 2023 06:46:10 GMT Message-Id: <202305010646.3416kAY2030239@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 3f5894cec67c - stable/13 - vn_open_vnode(): fix locking around VOP_CLOSE() on advisory lock error List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3f5894cec67cd437bce5b8941ebfb4095d98e01c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3f5894cec67cd437bce5b8941ebfb4095d98e01c commit 3f5894cec67cd437bce5b8941ebfb4095d98e01c Author: Olivier Certner AuthorDate: 2023-04-24 09:36:09 +0000 Commit: Konstantin Belousov CommitDate: 2023-05-01 06:45:29 +0000 vn_open_vnode(): fix locking around VOP_CLOSE() on advisory lock error (cherry picked from commit 6a5e61401502288ec10629beb28be048c1cce34a) --- sys/kern/vfs_vnops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 566b781098ad..215c9d1cc0cc 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -478,8 +478,8 @@ vn_open_vnode(struct vnode *vp, int fmode, struct ucred *cred, * If there is no fp, due to kernel-mode open, * we can call VOP_CLOSE() now. */ - if (vp->v_type != VFIFO && (fmode & FWRITE) != 0 && - !MNT_EXTENDED_SHARED(vp->v_mount) && + if ((vp->v_type == VFIFO || (fmode & FWRITE) != 0 || + !MNT_EXTENDED_SHARED(vp->v_mount)) && VOP_ISLOCKED(vp) != LK_EXCLUSIVE) vn_lock(vp, LK_UPGRADE | LK_RETRY); (void)VOP_CLOSE(vp, fmode & (FREAD | FWRITE | FEXEC), From nobody Mon May 1 08:10:27 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8wr32Tfwz48DPW; Mon, 1 May 2023 08:10: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 4Q8wr32Bknz455p; Mon, 1 May 2023 08:10:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682928627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QjAg+FwGgRxALzJ9eDpNLvHgF+uAWB0A119a10DXzBo=; b=ePKLd+EObcm4dPIVEyO8O8ztiDNvpksf21hSIon+QojTo2P+t6moLXqgkQBX0be8UhrcuG hlEGnJQ+K6RfHgZjdQ9ruDqHFYqxxYCmmDq5vHZ+vfOZWbORviAvdbKDMp85UfiH0K28Md b8eCGv/GxiGuxBfb2lZiAxBsg6ReRmt+bu6MINNtfx4bRbtOLuAq4X0OGpIIqL+Tf2xd3J 7otZ3rFd+pVKXwrp97cfooYuD0auCE7fQZRyuhG2ibfn+L+Dqb9x4KtsyPteBLrgtQRe/w fCXr+nIQE9pgeY/Fz0+TThG+JLJi7EwpwJ3k4QBcxXvmwPOY3SyZ88Fncbag2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682928627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QjAg+FwGgRxALzJ9eDpNLvHgF+uAWB0A119a10DXzBo=; b=wV0UUHi07nsqgGpsgX08vv69kti+MK9JYq2VOkbMzimSrBZLLGlahSD41sn+Il90/EcQXB 5/XqpLmdX1KQMh/tANrqbiNvnmHOxHXwtBLADfhj4uGuFhYUKyxYgahDC3MXyr4G+lvhyH aj0DRWOZNyV5vzlPhS1yikU9em2phqR30Oz8/yrlTMXMsHPc0VyJCdjv43X4yusZ+NwXXB p3jh9+6zGMsU7PpjjfnrPMwiPQtzqVQ0Gop7PZF12BaOkxqrx3bBIO1wJ8i0v5d2hOxN1c OdCwDXAtgwxhiFU4blkZIoKUXw+0x9R/0b7hVogHOvew7vA1N9xQyaNX9ENh9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682928627; a=rsa-sha256; cv=none; b=WUI+y3Cl3/LPZs9N4Dtdq+0RxT1+oEMbEnv6ET1G6qqcNE2NYINIZFtr++k9DZwleUWj8/ gBmPee9lxZr2HKTENhN2Mgtw6W7OQikylUI0CSAhu7Rhc5AcBDDEFPQE8h4L+h5euM3Bzg b7zucoQRXp3H6rZ7pM0UPkuRzNgj9TA53ePV0+ixGJycL2pU+UdrzjDokxBvXgFR4UHdRh 254O5MZ3X7wg+SfOdgcaadXS9V8NOftle0KqnNafc6MlS1brhYjuaifBgRCFJI8JPBN4Gr OMy4tsd3D2hDTg5cUYFK2hZKHByWfQyVcCArLwvZZstLs20vAIDcjpLGo+QJ2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8wr31J6vzxj1; Mon, 1 May 2023 08:10: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 3418ARvq071778; Mon, 1 May 2023 08:10:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3418ARVa071777; Mon, 1 May 2023 08:10:27 GMT (envelope-from git) Date: Mon, 1 May 2023 08:10:27 GMT Message-Id: <202305010810.3418ARVa071777@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Stefan=20E=C3=9Fer?= Subject: git: d767bf361b3e - stable/13 - msdosfs: fix debug print format and parameter List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d767bf361b3ebdb3955473cd378f8a8dcf9c85f0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=d767bf361b3ebdb3955473cd378f8a8dcf9c85f0 commit d767bf361b3ebdb3955473cd378f8a8dcf9c85f0 Author: Stefan Eßer AuthorDate: 2023-03-08 16:58:00 +0000 Commit: Stefan Eßer CommitDate: 2023-05-01 08:09:33 +0000 msdosfs: fix debug print format and parameter Building with -DMSDOSFS_DEBUG failed due to a format mismatch and a variable that has been renamed but not updated in the printf() parameter list. (cherry picked from commit 2d8cf575d5778781928699f9b7cfb448bd2f1f8e) fs/msdosfs: add tracking of free root directory entries This update implements tallying of free directory entries during create, delete, or rename operations on FAT12 and FAT16 file systems. Prior to this change, the total number of root directory entries was reported as number of inodes, but 0 as the number of free inodes, causing system health monitoring software to warn about a suspected disk full issue. The FAT12 and FAT16 file systems provide a limited number of root directory entries, e.g. 512 on typical hard disk formats. The valid range of values is 1 to 65535, but the msdosfs code will effectively round up "odd" values to the next multiple of 16 (e.g. 513 would allow for 528 root directory entries). This update implements tracking of directory entries during create, delete, or rename operations, with initial values determined by scanning the directory when the file system is mounted. Total and free directory entries are reported in the f_files and f_ffree elements of struct statfs, despite differences in semantics of these values: - There is no limit on the number of files and directories that can be created on a FAT file system. Only the root directory of FAT12 and FAT16 file systems is limited, any number of files can still be created in sub-directories, even when 0 free "inodes" are reported. - A single file can require 1 to 21 directory entries, depending on the character set, structure, and length of the name. The DOS 8.3 style file name takes up 1 entry, and if the name does not comply with the syntax of a DOS 8.3 file name, 1 additional entry is used for each 13 characters of the file name. Since all these entries have to be contiguous, it is possible that a file or directory with a long name can not be created, despite a sufficient total number of free directory entries. - Renaming a file can require more directory entries than currently allocated to store its long name, which may prevent an in-place update of the name if more entries are needed. This may cause a rename operation to fail if no contiguous range of free entries for the new name can be found. - The volume label is stored in a directory entry. An empty FAT file system with a volume label will therefore show 1 used "inode" in df. - The perceentage of free inodes shown in df or monitoring tools does only represent the state of the root directory of a FAT12 or FAT16 file system. Neither does a reported value of 0% free inodes does prevent files from being created in sub-directories, nor does a value of 50% free inodes guarantee that even a single file with a "long" name can be created in the root directory (if every other directory entry is occupied and there are no 2 contiguous entries). The statfs(2) and df(1) man pages have been updated with a notice regarding the possibly different semantics of values reported as total and free inodes for non-Unix file systems. PR: 270053 Reported by: Ben Woods Approved by: mckusick Differential Revision: https://reviews.freebsd.org/D38987 (cherry picked from commit c33db74b5323480fba7adef58e8aa88f6091d134) fs/msdosfs: Fix potential panic and size calculations Some combinations of FAT12 file system parameters could cause a kernel panic due to an unmapped access if the size of the FAT was larger than the CPU page size. The reason is that FAT12 uses 3 bytes to store 2 FAT pointers, leading to partial FAT pointers at the end of buffers of a size that is not a multiple of 3. With a typical page size of 4 KB, this caused the FAT entry at byte offsets 4095 and 4096 to cross the page boundary, with only the first page mapped. This was fixed by adjusting the mapping to always cover both bytes of each FAT entry. Testing revealed 2 other inconsistencies that are fixed by this commit: 1) The calculation of the size of the data area did not take into account the fact that the first two data block numbers are reserved and that the data area starts with block 2. This could cause a FAT12 file system created with the maximum supported number of blocks to be incorrectly identified as FAT16. 2) The root directory does not take up space in the data area of a FAT12 or FAT16 file system, since it is placed into a reserved area outside of that data area. This commits makes stat() report the logical size of the root directory, but with 0 blocks allocated from the data area. PR: 270587 Reviewed by: mckusick Differential Revision: https://reviews.freebsd.org/D39386 (cherry picked from commit 0728695c63efda298feccefb3615c23cb6682929) --- bin/df/df.1 | 13 ++++- lib/libc/sys/statfs.2 | 18 +++++- sys/fs/msdosfs/msdosfs_denode.c | 2 +- sys/fs/msdosfs/msdosfs_fat.c | 12 +++- sys/fs/msdosfs/msdosfs_lookup.c | 5 +- sys/fs/msdosfs/msdosfs_vfsops.c | 120 +++++++++++++++++++++++++++++++++++++--- sys/fs/msdosfs/msdosfs_vnops.c | 7 ++- sys/fs/msdosfs/msdosfsmount.h | 17 ++++++ 8 files changed, 177 insertions(+), 17 deletions(-) diff --git a/bin/df/df.1 b/bin/df/df.1 index 64e471fedc42..aa35318c2c65 100644 --- a/bin/df/df.1 +++ b/bin/df/df.1 @@ -29,7 +29,7 @@ .\" @(#)df.1 8.3 (Berkeley) 5/8/95 .\" $FreeBSD$ .\" -.Dd March 11, 2022 +.Dd March 29, 2023 .Dt DF 1 .Os .Sh NAME @@ -246,6 +246,17 @@ $ df -h /dev/ada1p2 Filesystem Size Used Avail Capacity Mounted on /dev/ada1p2 213G 152G 44G 78% / .Ed +.Sh NOTES +For non-Unix file systems, the reported values of used and free inodes +may have a different meaning than that of used and available files and +directories. +An example is msdosfs, which in the case of FAT12 or FAT16 file systems +reports the number of available and free root directory entries instead +of inodes +.Po +where 1 to 21 such directory entries are required to store +each file or directory name or disk label +.Pc . .Sh SEE ALSO .Xr lsvfs 1 , .Xr quota 1 , diff --git a/lib/libc/sys/statfs.2 b/lib/libc/sys/statfs.2 index a865652022bd..4df0e801e418 100644 --- a/lib/libc/sys/statfs.2 +++ b/lib/libc/sys/statfs.2 @@ -28,7 +28,7 @@ .\" @(#)statfs.2 8.5 (Berkeley) 5/24/95 .\" $FreeBSD$ .\" -.Dd March 30, 2020 +.Dd March 29, 2023 .Dt STATFS 2 .Os .Sh NAME @@ -230,6 +230,22 @@ error occurred while reading from or writing to the file system. .It Bq Er EINTEGRITY Corrupted data was detected while reading from the file system. .El +.Sh NOTES +The fields in the +.Vt statfs +structure have been defined to provide the parameters relevant for +traditional +.Tm UNIX +file systems. +For some other file systems, values that have similar, but not +identical, semantics to those described above may be returned. +An example is msdosfs, which in case of FAT12 or FAT13 file systems +reports the number of available and of free root directory entries +instead of inodes +.Po +where 1 to 21 such directory entries are required to store +each file or directory name or disk label +.Pc . .Sh SEE ALSO .Xr fhstatfs 2 , .Xr getfsstat 2 diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c index 51c2e3beaf39..59107a6ca2ea 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -110,7 +110,7 @@ deget(struct msdosfsmount *pmp, u_long dirclust, u_long diroffset, #ifdef MSDOSFS_DEBUG printf("deget(pmp %p, dirclust %lu, diroffset %lx, flags %#x, " "depp %p)\n", - pmp, dirclust, diroffset, flags, depp); + pmp, dirclust, diroffset, lkflags, depp); #endif MPASS((lkflags & LK_TYPE_MASK) == LK_EXCLUSIVE); diff --git a/sys/fs/msdosfs/msdosfs_fat.c b/sys/fs/msdosfs/msdosfs_fat.c index e6d9b671e7d7..2d50d30f33b3 100644 --- a/sys/fs/msdosfs/msdosfs_fat.c +++ b/sys/fs/msdosfs/msdosfs_fat.c @@ -89,11 +89,17 @@ static void fatblock(struct msdosfsmount *pmp, u_long ofs, u_long *bnp, u_long *sizep, u_long *bop) { - u_long bn, size; + u_long bn, size, fatblocksec; + fatblocksec = pmp->pm_fatblocksec; + if (FAT12(pmp) && fatblocksec % 3 != 0) { + fatblocksec *= 3; + if (fatblocksec % 6 == 0) + fatblocksec /= 2; + } bn = ofs / pmp->pm_fatblocksize * pmp->pm_fatblocksec; - size = min(pmp->pm_fatblocksec, pmp->pm_FATsecs - bn) - * DEV_BSIZE; + size = roundup(min(fatblocksec, pmp->pm_FATsecs - bn) * DEV_BSIZE, + pmp->pm_BlkPerSec * DEV_BSIZE); bn += pmp->pm_fatblk + pmp->pm_curfat * pmp->pm_FATsecs; if (bnp) diff --git a/sys/fs/msdosfs/msdosfs_lookup.c b/sys/fs/msdosfs/msdosfs_lookup.c index 291f923d79fe..9d98bae86596 100644 --- a/sys/fs/msdosfs/msdosfs_lookup.c +++ b/sys/fs/msdosfs/msdosfs_lookup.c @@ -335,7 +335,7 @@ msdosfs_lookup_ino(struct vnode *vdp, struct vnode **vpp, struct componentname continue; } #ifdef MSDOSFS_DEBUG - printf("msdosfs_lookup(): match blkoff %d, diroff %d\n", + printf("msdosfs_lookup(): match blkoff %lu, diroff %d\n", blkoff, diroff); #endif /* @@ -688,6 +688,7 @@ createde(struct denode *dep, struct denode *ddep, struct denode **depp, return error; } ndep = bptoep(pmp, bp, ddep->de_fndoffset); + rootde_alloced(ddep); DE_EXTERNALIZE(ndep, dep); @@ -725,6 +726,7 @@ createde(struct denode *dep, struct denode *ddep, struct denode **depp, ndep--; ddep->de_fndoffset -= sizeof(struct direntry); } + rootde_alloced(ddep); if (!unix2winfn(un, unlen, (struct winentry *)ndep, cnt++, chksum, pmp)) break; @@ -1019,6 +1021,7 @@ removede(struct denode *pdep, struct denode *dep) */ offset -= sizeof(struct direntry); ep--->deName[0] = SLOT_DELETED; + rootde_freed(pdep); if ((pmp->pm_flags & MSDOSFSMNT_NOWIN95) || !(offset & pmp->pm_crbomask) || ep->deAttributes != ATTR_WIN95) diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index d7efa103581b..480d278a5a45 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -409,6 +409,97 @@ msdosfs_mount(struct mount *mp) return (0); } +/* + * The FAT12 and FAT16 file systems use a limited size root directory that + * can be created with 1 to 65535 entries for files, directories, or a disk + * label (but DOS or Windows creates at most 512 root directory entries). + * This function calculates the number of free root directory entries by + * counting the non-deleted entries (not starting with 0xE5) and by adding + * the amount of never used entries (with the position indicated by an + * entry that starts with 0x00). + */ +static int +rootdir_free(struct msdosfsmount* pmp) +{ + struct buf *bp; + struct direntry *dep; + u_long readsize; + int dirclu; + int diridx; + int dirmax; + int dirleft; + int ffree; + + dirclu = pmp->pm_rootdirblk; + + /* + * The msdosfs code ignores pm_RootDirEnts and uses pm_rootdirsize + * (measured in DEV_BSIZE) to prevent excess root dir allocations. + */ + dirleft = howmany(pmp->pm_rootdirsize * DEV_BSIZE, + sizeof(struct direntry)); + + /* Read in chunks of default maximum root directory size */ + readsize = 512 * sizeof(struct direntry); + +#ifdef MSDOSFS_DEBUG + printf("rootdir_free: blkpersec=%lu fatblksize=%lu dirsize=%lu " + "firstclu=%lu dirclu=%d entries=%d rootdirsize=%lu " + "bytespersector=%hu bytepercluster=%lu\n", + pmp->pm_BlkPerSec, pmp->pm_fatblocksize, readsize, + pmp->pm_firstcluster, dirclu, dirleft, pmp->pm_rootdirsize, + pmp->pm_BytesPerSec, pmp->pm_bpcluster); +#endif + ffree = dirleft; + while (dirleft > 0 && ffree > 0) { + if (readsize > dirleft * sizeof(struct direntry)) + readsize = dirleft * sizeof(struct direntry); +#ifdef MSDOSFS_DEBUG + printf("rootdir_free: dirclu=%d dirleft=%d readsize=%lu\n", + dirclu, dirleft, readsize); +#endif + if (bread(pmp->pm_devvp, dirclu, readsize, NOCRED, &bp) != 0) { + printf("rootdir_free: read error\n"); + if (bp != NULL) + brelse(bp); + return (-1); + } + dirmax = readsize / sizeof(struct direntry); + for (diridx = 0; diridx < dirmax && dirleft > 0; + diridx++, dirleft--) { + dep = (struct direntry*)bp->b_data + diridx; +#ifdef MSDOSFS_DEBUG + if (dep->deName[0] == SLOT_DELETED) + printf("rootdir_free: idx=%d \n", + diridx); + else if (dep->deName[0] == SLOT_EMPTY) + printf("rootdir_free: idx=%d \n", + diridx); + else if (dep->deAttributes == ATTR_WIN95) + printf("rootdir_free: idx=%d \n", + diridx, (dep->deName[0] & 0x1f) + 1); + else if (dep->deAttributes & ATTR_VOLUME) + printf("rootdir_free: idx=%d label='%11.11s'\n", + diridx, dep->deName); + else if (dep->deAttributes & ATTR_DIRECTORY) + printf("rootdir_free: idx=%d dir='%11.11s'\n", + diridx, dep->deName); + else + printf("rootdir_free: idx=%d file='%11.11s'\n", + diridx, dep->deName); +#endif + if (dep->deName[0] == SLOT_EMPTY) + dirleft = 0; + else if (dep->deName[0] != SLOT_DELETED) + ffree--; + } + brelse(bp); + bp = NULL; + dirclu += readsize / DEV_BSIZE; + } + return (ffree); +} + static int mountmsdosfs(struct vnode *odevvp, struct mount *mp) { @@ -611,11 +702,14 @@ mountmsdosfs(struct vnode *odevvp, struct mount *mp) } pmp->pm_maxcluster = (pmp->pm_HugeSectors - pmp->pm_firstcluster) / SecPerClust + 1; - pmp->pm_fatsize = pmp->pm_FATsecs * DEV_BSIZE; /* XXX not used? */ + pmp->pm_fatsize = pmp->pm_FATsecs * DEV_BSIZE; if (pmp->pm_fatmask == 0) { - if (pmp->pm_maxcluster <= ((CLUST_RSRVD - CLUST_FIRST) & - FAT12_MASK)) { + /* + * The last 10 (or 16?) clusters are reserved and must not + * be allocated for data. + */ + if (pmp->pm_maxcluster < (CLUST_RSRVD & FAT12_MASK)) { /* * This will usually be a floppy disk. This size makes * sure that one FAT entry will not be split across @@ -631,11 +725,11 @@ mountmsdosfs(struct vnode *odevvp, struct mount *mp) } } - clusters = (pmp->pm_fatsize / pmp->pm_fatmult) * pmp->pm_fatdiv; + clusters = (pmp->pm_fatsize / pmp->pm_fatmult) * pmp->pm_fatdiv ; if (pmp->pm_maxcluster >= clusters) { #ifdef MSDOSFS_DEBUG printf("Warning: number of clusters (%ld) exceeds FAT " - "capacity (%ld)\n", pmp->pm_maxcluster + 1, clusters); + "capacity (%ld)\n", pmp->pm_maxcluster - 1, clusters); #endif pmp->pm_maxcluster = clusters - 1; } @@ -749,6 +843,15 @@ mountmsdosfs(struct vnode *odevvp, struct mount *mp) goto error_exit; pmp->pm_fmod = 1; } + + if (FAT32(pmp)) { + pmp->pm_rootdirfree = 0; + } else { + pmp->pm_rootdirfree = rootdir_free(pmp); + if (pmp->pm_rootdirfree < 0) + goto error_exit; + } + mp->mnt_data = pmp; mp->mnt_stat.f_fsid.val[0] = dev2udev(dev); mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum; @@ -947,11 +1050,12 @@ msdosfs_statfs(struct mount *mp, struct statfs *sbp) pmp = VFSTOMSDOSFS(mp); sbp->f_bsize = pmp->pm_bpcluster; sbp->f_iosize = pmp->pm_bpcluster; - sbp->f_blocks = pmp->pm_maxcluster + 1; + sbp->f_blocks = pmp->pm_maxcluster - CLUST_FIRST + 1; sbp->f_bfree = pmp->pm_freeclustercount; sbp->f_bavail = pmp->pm_freeclustercount; - sbp->f_files = pmp->pm_RootDirEnts; /* XXX */ - sbp->f_ffree = 0; /* what to put in here? */ + sbp->f_files = howmany(pmp->pm_rootdirsize * DEV_BSIZE, + sizeof(struct direntry)); + sbp->f_ffree = pmp->pm_rootdirfree; return (0); } diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 94af83b5a0a6..c9263fe977d4 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -318,8 +318,11 @@ msdosfs_getattr(struct vop_getattr_args *ap) vap->va_flags |= UF_SYSTEM; vap->va_gen = 0; vap->va_blocksize = pmp->pm_bpcluster; - vap->va_bytes = - (dep->de_FileSize + pmp->pm_crbomask) & ~pmp->pm_crbomask; + if (dep->de_StartCluster != MSDOSFSROOT) + vap->va_bytes = + (dep->de_FileSize + pmp->pm_crbomask) & ~pmp->pm_crbomask; + else + vap->va_bytes = 0; /* FAT12/FAT16 root dir in reserved area */ vap->va_type = ap->a_vp->v_type; vap->va_filerev = dep->de_modrev; return (0); diff --git a/sys/fs/msdosfs/msdosfsmount.h b/sys/fs/msdosfs/msdosfsmount.h index 5caa40f2b648..5afbfc44dc0a 100644 --- a/sys/fs/msdosfs/msdosfsmount.h +++ b/sys/fs/msdosfs/msdosfsmount.h @@ -108,6 +108,7 @@ struct msdosfsmount { u_int pm_fatmult; /* these 2 values are used in FAT */ u_int pm_fatdiv; /* offset computation */ u_int pm_curfat; /* current FAT for FAT32 (0 otherwise) */ + int pm_rootdirfree; /* number of free slots in FAT12/16 root directory */ u_int *pm_inusemap; /* ptr to bitmap of in-use clusters */ uint64_t pm_flags; /* see below */ void *pm_u2w; /* Local->Unicode iconv handle */ @@ -222,6 +223,22 @@ struct msdosfs_fileno { ? roottobn((pmp), (dirofs)) \ : cntobn((pmp), (dirclu))) +/* + * Increment the number of used entries in a fixed size FAT12/16 root + * directory + */ +#define rootde_alloced(dep) \ + if ((dep)->de_StartCluster == MSDOSFSROOT) \ + (dep)->de_pmp->pm_rootdirfree--; + +/* + * Decrement the number of used entries in a fixed size FAT12/16 root + * directory + */ +#define rootde_freed(dep) \ + if ((dep)->de_StartCluster == MSDOSFSROOT) \ + (dep)->de_pmp->pm_rootdirfree++; + #define MSDOSFS_LOCK_MP(pmp) \ lockmgr(&(pmp)->pm_fatlock, LK_EXCLUSIVE, NULL) #define MSDOSFS_UNLOCK_MP(pmp) \ From nobody Mon May 1 08:12:10 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q8wt30284z48DhV; Mon, 1 May 2023 08:12: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 4Q8wt26jjcz45MF; Mon, 1 May 2023 08:12:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682928730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TkJPZglKCcFC8vJj4H2y4vFCNnSrIOILJOdhrgxHTlA=; b=QfyQ9x5yneMghKPH9OkNNSFhghBsqSvTRPLR5rwrfjvugMHQtI/nM0irpeeo5vyvEGnzwL IKPWJMdQNcmbaokBwprJnE6j+DS8MJ7vCWzEAjV71+R8mOZ190vdERMe5rmy+iuUo7DU+o tegg1cjeZbibBarn9j9ElKEy/S2erSF7z28j2L+0Z9onoxw4LLWSjSfKqE9U1KNPx983lM SZTHKizH0Iw8vj7YAI6cp4RaZGo+Fh1+hVF3K1hdBtB3faeefMp3CCZ5cPAJLPTJtYLrIh 7U8E3cv1IQVx4ngkf79+UjYXhmTU/3G/VzB75EFmntR0mmsZdciQvxITujLeMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682928730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TkJPZglKCcFC8vJj4H2y4vFCNnSrIOILJOdhrgxHTlA=; b=Ij4wKImjpsL2eai55b9hdh89+ImcZPNnqQCD9Nd4W6T7ElV86rlGjVz+zoKBzZ6j4o7KSv DATPjBgAPb4P8E1U5CCTt4Qu1hGq6n4XN2/6Z84wWKYDG/hd5dh8+rY+WFtbXVad0KEFVF NAYvWn/PXW3Jt/0XEbWfCWdeadb0jgf6fDzU/PPo3kOyjYD0uI4lqbBX3nqv7UuAW1AhiA BhvLHI2Zw4ka6b2KosaWp+sF1jDA9GmOtkiQY+uWYLgRWMx6XOUXvTzOa9LwF4eyrq5OyA Du+2JNZHJaLToRsnyUclvCXB6rJNxhHQz1YAyK/vieh9LBzfcZpJAirEjD4gCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682928730; a=rsa-sha256; cv=none; b=tpapIuy7DdTQeLuNzP9N+21q3hJvRuXQxAHUZHZruBDz2rorA4GtQkLdtJ5z0AAymBo/H4 jpkYgEbjBGnB546fcOBF+EYm1VeChzc7fTBXbI30RAB/VPyZ+6bGjY8KQUXvUwt4q39iNM QI/FqC5Vg1MTi4eXjHoT/43rdGQV8yAIZSTP8pvME72NDrR84w0L0eUmXv1H8ThlFKY1yc zTN66f0uPgrznO47O+QOjyOCZF7fgk/RT55XJwwGfRVsQf/x9udbia+DmdI8Ume71eJi4o FVc/xwUoBHSB2ufptTaX3GUEmtcyS5gLCTiDiqEC7mxIjeUYKAUI1AhUHjyhDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q8wt25pckzyNK; Mon, 1 May 2023 08:12: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 3418CAFC078521; Mon, 1 May 2023 08:12:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3418CAVt078520; Mon, 1 May 2023 08:12:10 GMT (envelope-from git) Date: Mon, 1 May 2023 08:12:10 GMT Message-Id: <202305010812.3418CAVt078520@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Stefan=20E=C3=9Fer?= Subject: git: 3270f21597fb - stable/13 - sys/fs: do not report blocks allocated for synthetic file systems List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3270f21597fb35f7cdbc39f0f09eaf4f84e79fe6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=3270f21597fb35f7cdbc39f0f09eaf4f84e79fe6 commit 3270f21597fb35f7cdbc39f0f09eaf4f84e79fe6 Author: Stefan Eßer AuthorDate: 2023-04-25 07:40:05 +0000 Commit: Stefan Eßer CommitDate: 2023-05-01 08:11:44 +0000 sys/fs: do not report blocks allocated for synthetic file systems The pseudo file systems (devfs, fdescfs, procfs, etc.) report total and available blocks and inodes despite being synthetic with no underlying storage device to which those values could be applied. The current code of these file systems tends to report a fixed number of total blocks but no free blocks, and in the case of procfs, libprocfs, linsysfs also no free inodes. This can be irritating in e.g. the "df" output, since 100% of the resources seem to be in use, but it can also create warnings in monitoring tools used for capacity management. This patch makes these file systems return the same value for the total and free parameters, leading to 0% in use being displayed by "df". Since there is no resource that can be exhausted, this appears to be a sensible result. Reviewed by: mckusick Differential Revision: https://reviews.freebsd.org/D39442 (cherry picked from commit 88a795e80c03ff1d960d830ee273589664ab06cc) --- sys/fs/devfs/devfs_vfsops.c | 4 ++-- sys/fs/fdescfs/fdesc_vfsops.c | 4 ++-- sys/fs/pseudofs/pseudofs.c | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/fs/devfs/devfs_vfsops.c b/sys/fs/devfs/devfs_vfsops.c index 56297578ec2a..0fac2b68e2e1 100644 --- a/sys/fs/devfs/devfs_vfsops.c +++ b/sys/fs/devfs/devfs_vfsops.c @@ -230,8 +230,8 @@ devfs_statfs(struct mount *mp, struct statfs *sbp) sbp->f_bsize = DEV_BSIZE; sbp->f_iosize = DEV_BSIZE; sbp->f_blocks = 2; /* 1K to keep df happy */ - sbp->f_bfree = 0; - sbp->f_bavail = 0; + sbp->f_bfree = 2; + sbp->f_bavail = 2; sbp->f_files = 0; sbp->f_ffree = 0; return (0); diff --git a/sys/fs/fdescfs/fdesc_vfsops.c b/sys/fs/fdescfs/fdesc_vfsops.c index edc2cdd61847..2961c3bf6224 100644 --- a/sys/fs/fdescfs/fdesc_vfsops.c +++ b/sys/fs/fdescfs/fdesc_vfsops.c @@ -223,8 +223,8 @@ fdesc_statfs(struct mount *mp, struct statfs *sbp) sbp->f_bsize = DEV_BSIZE; sbp->f_iosize = DEV_BSIZE; sbp->f_blocks = 2; /* 1K to keep df happy */ - sbp->f_bfree = 0; - sbp->f_bavail = 0; + sbp->f_bfree = 2; + sbp->f_bavail = 2; sbp->f_files = lim + 1; /* Allow for "." */ sbp->f_ffree = freefd; /* See comments above */ return (0); diff --git a/sys/fs/pseudofs/pseudofs.c b/sys/fs/pseudofs/pseudofs.c index 44473a926182..3c82021a8148 100644 --- a/sys/fs/pseudofs/pseudofs.c +++ b/sys/fs/pseudofs/pseudofs.c @@ -377,10 +377,10 @@ pfs_mount(struct pfs_info *pi, struct mount *mp) vfs_mountedfrom(mp, pi->pi_name); sbp->f_bsize = PAGE_SIZE; sbp->f_iosize = PAGE_SIZE; - sbp->f_blocks = 1; - sbp->f_bfree = 0; - sbp->f_bavail = 0; - sbp->f_files = 1; + sbp->f_blocks = 2; + sbp->f_bfree = 2; + sbp->f_bavail = 2; + sbp->f_files = 0; sbp->f_ffree = 0; return (0); From nobody Mon May 1 10:48:09 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q90LC0W45z48Mbc; Mon, 1 May 2023 10:48:19 +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 4Q90LB1vJbz4H71; Mon, 1 May 2023 10:48:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.17.1/8.17.1) with ESMTPS id 341Am9R2092212 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 1 May 2023 13:48:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 341Am9R2092212 Received: (from kostik@localhost) by tom.home (8.17.1/8.17.1/Submit) id 341Am96c092211; Mon, 1 May 2023 13:48:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 1 May 2023 13:48:09 +0300 From: Konstantin Belousov To: "Jason A. Harmening" Cc: Dimitry Andric , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Subject: Re: git: 060699e91369 - stable/13 - Merge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6 Message-ID: References: <202304092135.339LZMeJ081640@gitrepo.freebsd.org> <76DD2CB9-986B-4349-8F46-3B7BF63EB315@FreeBSD.org> List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Rspamd-Queue-Id: 4Q90LB1vJbz4H71 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Sun, Apr 30, 2023 at 10:31:53PM -0500, Jason A. Harmening wrote: > On Sun, Apr 30, 2023 at 07:34:45PM -0500, Jason A. Harmening wrote: > > On Sun, Apr 30, 2023 at 06:47:13PM -0500, Jason A. Harmening wrote: > > > On Sun, Apr 30, 2023 at 08:09:16AM +0300, Konstantin Belousov wrote: > > > > On Sat, Apr 29, 2023 at 02:27:50PM -0500, Jason A. Harmening wrote: > > > > > On Sat, Apr 29, 2023 at 08:49:28PM +0200, Dimitry Andric wrote: > > > > > > On 29 Apr 2023, at 20:33, Jason A. Harmening wrote: > > > > > > > > > > > > > > On Sun, Apr 09, 2023 at 09:35:22PM +0000, Dimitry Andric wrote: > > > > > > >> The branch stable/13 has been updated by dim: > > > > > > >> > > > > > > >> URL: https://cgit.FreeBSD.org/src/commit/?id=060699e9136975d51d3f726b9785bdbac9a62ba6 > > > > > > >> > > > > > > >> commit 060699e9136975d51d3f726b9785bdbac9a62ba6 > > > > > > >> Author: Dimitry Andric > > > > > > >> AuthorDate: 2023-01-14 16:33:24 +0000 > > > > > > >> Commit: Dimitry Andric > > > > > > >> CommitDate: 2023-04-09 14:54:52 +0000 > > > > > > >> > > > > > > >> Merge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6 > > > > > > >> > > > > > > >> This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and > > > > > > >> openmp to llvmorg-15.0.7-0-g8dfdcc7b7bf6. > > > > > > >> > > > > > > >> PR: 265425 > > > > > > >> MFC after: 2 weeks > > > > > > > > > > > > > > This MFC of llvm15 appears to have completely broken the Intel IOMMU > > > > > > > driver on my stable/13 machine. After this series of commits, any > > > > > > > downstream DMA seems to produce an IOMMU translation fault, which > > > > > > > renders the machine completely unusable: no nvme boot disk, no usb > > > > > > > keyboard, etc. > > > > > > > > > > > > > > The faults I see look something like this: > > > > > > > > > > > > > > DMAR4: ahci0: pci0:17:5 sid 8d fault acc 0 adt 0x0 reason 0x3 addr 26000 > > > > > > > > > > > > > > It's a bit surprising to see a toolchain upgrade produce breakage like > > > > > > > this, but that's what git bisect clearly tells me. I wonder if some of > > > > > > > the IOMMU control structures might be defined as C bitfields and the new > > > > > > > compiler is emitting them differently? Also, was any breakage like this > > > > > > > observed when -current was upgraded to llvm15 several months ago? > > > > > > > > > > > > I haven't heard anything about such breakage, no. > > > > > > > > > > > > > > > > > > > More generally, this is the second time in as many months I've had to > > > > > > > deal with IOMMU breakage on -stable. I can't imagine I'm the only > > > > > > > person who sees value in running with DMA remapping enabled; do we need > > > > > > > a dedicated DMAR-enabled machine in the cluster to smoke-test changes > > > > > > > like this? More generally, should we avoid MFCing high-risk changes > > > > > > > like this? > > > > > > > > > > > > Since there were very few bug reports, it was not deemed high risk. > > > > > > > > > > > > In any case, it would be good to get the bottom of what is causing the > > > > > > problem, so is there any way you can isolate which code seems to be > > > > > > going "bad"? > > > > > > > > > > > > For example, if this problem affects code in sys/dev/iommu, is there > > > > > > some way you can compile that part with -O1, or with an older version > > > > > > of clang (from ports), to see if the problem goes away? > > > > > > > > > > I did try removing all custom make.conf settings (previously I just had > > > > > CPUTYPE?=icelake-server), but that didn't change the behavior. > > > > > > > > > > Before I try further build tweaks, I'd like to ask if the IOMMU fault > > > > > report can provide guidance here? AFAICT all the faults I'm getting > > > > > show "reason 0x3". If I'm reading the VT-d spec correctly, FR=0x3 > > > > > indicates an invalid context entry, in other words there's something the > > > > > hardware doesn't like in the way the address width or pagetable base is > > > > > configured for the PCIe requestor. > > > > > > > > I would start looking at the other direction: might be, there are still some > > > > left shifts for int32 values with the shift count > 30, or uint32 with the > > > > count > 31. > > > > > > > > Also might be useful to dump each context entry on creation, it is kept > > > > constant after. > > > > > > I did look over the constants in intel_reg.h, and didn't see anything > > > that looked as though it would be susceptible to sign-extension or > > > truncation bugs. In the failing case it's much easier for me to catch > > > the fault messages than any initialization message, so I instrumented > > > the fault handler to get the context entry from the dmar_ctx object > > > using the same logic as dmar_map_ctx_entry(), and then dump out the ctx1 > > > and ctx2 fields. What I see are messages like: > > > > > > ... ctx1 0x10013b001 ctx2 0x103 > > > > > > At first glance these "look right": the P bit is set in ctx1, and the > > > rest of the field looks like a valid physical address. ctx2 also > > > doesn't have any of the reserved bits set, but in all cases it does have > > > AW=3, which would indicate 57-bit AGAW. But when I boot the last > > > working kernel, from the revision prior to the llvm15 MFC, I see this in > > > dmesg: > > > > > > ahci0: dmar4 pci0:0:17:5 rid 8d domain 1 mgaw 48 agaw 48 re-mapped > > > > > > ...all reported devices show 48-bit MGAW/AGAW, so I would expect ctx2 to > > > have AW=2. I suspect this may be the source of the fault, but I'm not > > > sure how it's getting configured that way, whether it's an issue with > > > reading the capability register or something else. > > > > > > > I can confirm that hacking domain_set_agaw() to always use the settings > > from sagaw_bits[2] eliminates the faults and at least allows the machine > > to boot to single-user mode. > > I see what's happening now. When I added the hack to always set > sagaw_bits[2], I noted that the passed-in MGAW was still 57, while > unit->hw_cap had the correct value of 0x4 (=> 4-level paging, 48-bit AW) > in bits 12:8. The problem is that sagaw_bits has agaw=64 in its last > entry. This results in dmar_maxaddr2mgaw() attempting a comparison > against 1ULL << 64 in the final iteration of its first loop. I suspect > the new compiler probably determines that last iteration is meaningless > and simply omits it from the (probably unrolled) loop. Since the "loop" > terminates with i < nitems(sagaw_bits), the subsequent "allow_less ..." > case doesn't execute and we end up erroneously selecting a 57-bit > address width. Just commenting out that last entry in sagaw_bits fixes > the problem. > > So, two questions: > 1) Does any VT-d hardware actually support 6-level paging? The ca. 2021 > VT-d spec I'm looking at indicates 5-level is the greatest depth > supported, with everything above that being reserved. I do not think that there is any hw supporting 6-level. Looking at the spec history, D51397-005 Rev 1.3 February 2011 declared that SAGAW 4 is 6-level, then D51397-006 Rev. 2.2 September 2013 designated SAGAW values 3 and 4 as reserved, then D51397-009 Rev. 2.5 November 2017 returned SAGAW 3 for 5-level mode. > > 2) I'd expect clang to try very hard to error out in a situation like > this, but I see that sys/conf/kern.mk sets -Wno-shift-count-overflow > among other things, and more of them were added for clang 15. This > seems like a really bad idea, regardless of how much of a PITA it may be > to fix these warnings. I think that removing the '64' bit sagaw_bit entry is fine, please proceed. From nobody Mon May 1 12:15:23 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q92Gg73ncz48Ssx; Mon, 1 May 2023 12:15: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 4Q92Gg6Y1Cz4Q3v; Mon, 1 May 2023 12:15:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682943323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i13AkLTLVElTk/cm3Cu1aCBOs1z1Bd2DPw7Q5S8eQqs=; b=Fa8jgZeWndCPhuUql4zM3ZAXf4R+OvLFget2Lq6atLIZgBQUzXKReA2gJ3UKOwl4s/DJq3 EoxVZR2tygYEChpJEFpsaCp4iWRy4tkiBmy/mr9mcACOQ/abo0i4YMGLgesOwXl2UpOOQ4 vfjByNDzDyOhhN6U7EOBGOJFj4uL4jsIn7m5FuKymoEsWBAZm2LPWZZnQWfDcVQhhKGQdb vPnvkmoMeM1CrsMaeoIuOkgNA+uZsDfet5jj2Ge5PwGxIp8ezToNOgOSGALVvYbQQX3yRm D0GKZ1/SvvhtE0qW/oRzXJKWmO5sfg1fRnOlus4iOx2u2MR7casb3O0aJt8jrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682943323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i13AkLTLVElTk/cm3Cu1aCBOs1z1Bd2DPw7Q5S8eQqs=; b=RUCyEx+4Ne27GiUZYpy5srX93GYSraZ04ZXyrk2KyPARV6nBP0FklK4D8hrO/2bpZgVu7Z 1SaXyOvv4PSsPYASPKYKrEICrD+jau9s6kO+nSub3KDGXD6FvWQru3fpjKUwMCT3rmWOad qwrIerofDDseixls3hrt4ljCNxr13Jc+3bDpWKFuBoR0g1uXJF0RqyIjCRojgEeYijUE3B gNqrsS6MDECYUhyXjwQit6BEtXHq8sPbXr+AXLiyPz+XIaTtrOYPIghyEOS6YDM5gR0kZt XuFLa4K+Z/BS6sIabCAlmKZ0ZCtcJFP1gTyA19CN2nQ8dCle8eg6uTuJ/Y+vZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682943323; a=rsa-sha256; cv=none; b=Ncck/YXpFYxMiTgewJGR8okD3R0pDxDhxiq5cPE0rkQ4lHkXmR2dFVYOPa30EvuZEyoqYU u/XElxmrRdTkYreuIH1zfhyZ5oQd+n2e3UFAJODnN1VNdstsffu1KF7NZ2zKO48m2iDQWs RBy8/zpHAf41PJCCw7O1LImgePWVuD6em8n94D+h0pQgv1XRYrhpDPyE7zuyJByh1Vja/P LDcsVW1y/MjiSdX6pix1UQazxRv4z+RjEJIOLVL0tHv9G3LQziFcidKVxUeiXQoMf0LlUq pjkCmmlQizbumuVxHTyhk/1y4czEWk7wvPEpghCvhkZMIpL+mBgQPTTttbE9ug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q92Gg5ckWz14cC; Mon, 1 May 2023 12:15: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 341CFNAY074996; Mon, 1 May 2023 12:15:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 341CFNAg074995; Mon, 1 May 2023 12:15:23 GMT (envelope-from git) Date: Mon, 1 May 2023 12:15:23 GMT Message-Id: <202305011215.341CFNAg074995@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 878716d2ccbf - stable/13 - geom: use bool for one-bit wide bit-field List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 878716d2ccbf68946152728119f5320a46009d44 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=878716d2ccbf68946152728119f5320a46009d44 commit 878716d2ccbf68946152728119f5320a46009d44 Author: Ed Maste AuthorDate: 2023-04-17 18:56:51 +0000 Commit: Ed Maste CommitDate: 2023-05-01 12:15:08 +0000 geom: use bool for one-bit wide bit-field A one-bit wide bit-field can take only the values 0 and -1. Clang 16 introduced a warning that "implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1". Fix by using c99 bool. Reported by: Clang, via dim Reviewed by: dim Sponsored by: The FreeBSD Foundation (cherry picked from commit 00172f341666f2d5535ae6f4630c93593e86a4cb) --- sys/geom/part/g_part.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/geom/part/g_part.h b/sys/geom/part/g_part.h index c96cec264b87..4987b7c54c0e 100644 --- a/sys/geom/part/g_part.h +++ b/sys/geom/part/g_part.h @@ -132,10 +132,10 @@ struct g_part_entry { quad_t gpe_start; /* First LBA of partition. */ quad_t gpe_end; /* Last LBA of partition. */ int gpe_index; - int gpe_created:1; /* Entry is newly created. */ - int gpe_deleted:1; /* Entry has been deleted. */ - int gpe_modified:1; /* Entry has been modified. */ - int gpe_internal:1; /* Entry is not a used entry. */ + bool gpe_created:1; /* Entry is newly created. */ + bool gpe_deleted:1; /* Entry has been deleted. */ + bool gpe_modified:1; /* Entry has been modified. */ + bool gpe_internal:1; /* Entry is not a used entry. */ }; /* G_PART table (KOBJ instance). */ @@ -170,12 +170,12 @@ struct g_part_table { uint32_t gpt_heads; int gpt_depth; /* Sub-partitioning level. */ - int gpt_isleaf:1; /* Cannot be sub-partitioned. */ - int gpt_created:1; /* Newly created. */ - int gpt_modified:1; /* Table changes have been made. */ - int gpt_opened:1; /* Permissions obtained. */ - int gpt_fixgeom:1; /* Geometry is fixed. */ - int gpt_corrupt:1; /* Table is corrupt. */ + bool gpt_isleaf:1; /* Cannot be sub-partitioned. */ + bool gpt_created:1; /* Newly created. */ + bool gpt_modified:1; /* Table changes have been made. */ + bool gpt_opened:1; /* Permissions obtained. */ + bool gpt_fixgeom:1; /* Geometry is fixed. */ + bool gpt_corrupt:1; /* Table is corrupt. */ }; struct g_part_entry *g_part_new_entry(struct g_part_table *, int, quad_t, From nobody Mon May 1 12:15:24 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q92Gj17MHz48St0; Mon, 1 May 2023 12:15: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 4Q92Gj0JFlz4QNn; Mon, 1 May 2023 12:15:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682943325; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A3us2kBAcyk/Go0z7zR+7ck4NwS4fVj32qxIj/M4eR0=; b=m985p5Wfg77sL/jBzbbdWT9UGWGbjupu5hDLN1/e9eHbOa3gAxTd5LSGkwqHzRn2Rs1OYq nL+JNZ3984y7W+tXPIySGeP+/TdOq+LDHbPdcVEIbSnkuqGdwrNTD0xYrZ2Jfy9Wf3Gyzd f+WBzzBp6KRCzHghV/Uhwlz/AbxBjIOors4MWiIOTY7WOuiFkA9J87YMYnzW5EEuqkDOR2 Vx5lP1ZYlcQl7O1qoH1MjUvEnqCKk+1jTXNQ4uzCACGshLjFp0PWS1BRWTY8sv2IAtT1/G lIL0m50zL8L8ry4SAEjxp5zppDhGX1lSd6mnxHWibfs71SEjjfYtICBg4v7Xaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682943325; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A3us2kBAcyk/Go0z7zR+7ck4NwS4fVj32qxIj/M4eR0=; b=rLsYGvchUNCSw3U+kqddHw5o1SA6OLFANYfaUkj4zJc/VgrAi5CX7O0trKCITzWLvgz/de 2/76wtLtnvQy+eWdQtcqmGhX/DU6sxiBYnKoh8uR4w+xdvvT6eN9RHHL6d99QysWRPWupj eOqAvlksuy3Qcju2O8e/1m7UE7/j8nHCMSsBpG8+i2w/uPvKiRJOpXJktRLC2l9QvWxQtF hjM2XsXi10wwOlvJbuVfXKUDFU1Knua2AUd3uXp6cx6vHiE/wZ1vFbx/d8Q02f89e5eSwU k5EbUevhhaYg73YmqRsv2jCaXLR9ZuRYyu89gvj9KfBwpMjTxeSFdW5Nagl8Kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682943325; a=rsa-sha256; cv=none; b=MjYhYXxMgyKQLp6amG5KL9T1aUDLW8LCZNgf8Os1/eUYBJSy5kYo5BXRWu4VP5qlmU+fya hvmkWAq5buTqyD0lWLkpZb3fWvO6BepdKEiekYSWlY2d9sWVnryKcdmW3DOp2QaiFMr7En YfyO2kMObaR+n65IAvzJN2RjtLlP8rlmrPqsEfom9I3sg+SJ3SmX91jQS3Yp3NrMf+qQbj pYnr8ujuHoSgBSWkCckPCzcefn+zuFGkoFoEXQsv/eWHZJA3nJl38b1dQmra+WcuF0HOfW tD6f+A/zotzG6cCL+rlUHf9gepw6kFKTx7FHBE10cAByq96elYq1435QOpPNYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q92Gh6V7rz14b0; Mon, 1 May 2023 12:15: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 341CFOMV075015; Mon, 1 May 2023 12:15:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 341CFOb7075014; Mon, 1 May 2023 12:15:24 GMT (envelope-from git) Date: Mon, 1 May 2023 12:15:24 GMT Message-Id: <202305011215.341CFOb7075014@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 5c4e8a631097 - stable/13 - ipv6: disable RFC 4620 nodeinfo by default List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 5c4e8a6310973f22eb76835f1b0d5ba5dd9df2f7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5c4e8a6310973f22eb76835f1b0d5ba5dd9df2f7 commit 5c4e8a6310973f22eb76835f1b0d5ba5dd9df2f7 Author: Ed Maste AuthorDate: 2023-04-24 19:41:45 +0000 Commit: Ed Maste CommitDate: 2023-05-01 12:15:08 +0000 ipv6: disable RFC 4620 nodeinfo by default RFC 4620 is an experimental RFC that can be used to request information about a host, including: - the fully-qualified or single-component name - some set of the Responder's IPv6 unicast addresses - some set of the Responder's IPv4 unicast addresses This is not something that should be made available by default. PR: 257709 Submitted by: ruben@verweg.com Reviewed by: melifaro Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39778 (cherry picked from commit b73183d1a243d486e3889bd71800e94812f5fa17) --- sys/netinet6/in6_proto.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c index fb4f76dd698c..07ce80b6ea68 100644 --- a/sys/netinet6/in6_proto.c +++ b/sys/netinet6/in6_proto.c @@ -413,8 +413,7 @@ VNET_DEFINE(int, icmp6_rediraccept) = 1;/* accept and process redirects */ VNET_DEFINE(int, icmp6_redirtimeout) = 10 * 60; /* 10 minutes */ VNET_DEFINE(int, icmp6errppslim) = 100; /* 100pps */ /* control how to respond to NI queries */ -VNET_DEFINE(int, icmp6_nodeinfo) = - (ICMP6_NODEINFO_FQDNOK|ICMP6_NODEINFO_NODEADDROK); +VNET_DEFINE(int, icmp6_nodeinfo) = 0; VNET_DEFINE(int, icmp6_nodeinfo_oldmcprefix) = 1; /* From nobody Mon May 1 16:14:11 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q97ZF1NCMz48jdg; Mon, 1 May 2023 16:14:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q97ZF0rp3z3wpx; Mon, 1 May 2023 16:14:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682957653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PBOFWMV1w/fWQWiSF94c8oq0Ah+YawO89Bqj0IApLqs=; b=v85H0S4BisiWpgsNix3F4y25Ov4UoUfMNDlVQCyHe3rgF6yTwIb3uPMTq8oEgbnM50ECAM 0036laUgEfv0RYnYTyO4RP2bpMIqFheDl11HPQmybLX/Jxw8xcPIhDfnczZl9LmVve+zPg /vmHF7yNsqfMecR2YatXt5xvAbIsck8TMASYU67yFbaKd2n9GdrV04yDtL8rTEcN47CFxK WUdxgrrGpai4kzBQNSs7sDj3Z7TWsdUt+fbozSV46x8vwKa4V+wFsK7yPwxZLDPtWJVZNc kmuceydk3lGpayMhizrnPmIhl4QXOHVp0iGERvx7amu7zE8ZE7b4cuTrlbtrLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682957653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PBOFWMV1w/fWQWiSF94c8oq0Ah+YawO89Bqj0IApLqs=; b=bK5KvpRcU+DpklfUOfCldKuTVBdGmGskiZeyUAwFimGbQDjbbkkJgvxNojuQ4G9LFw2ji2 qC6mlzjzFdIDNpA9P0eiAqJjoDv4RAhlKdOhIbK84Ihnj3PEpka5LynIJM+7fzDthTQhq2 TdJvfovwgVsjglgKUF12IKzoNRcRZnIAoZxt4jVewTx0EGw8WrWBinqIhA0KHuH05Orbor cBp9P7n0WEJftZYS3bsNXa/1zrvFqf5dLjyb+5Xhc3GLP7jZtUl1udzakJSJSXmaVV6sgQ AkbzmcrjwnHY+mpKWfXc94KsiMxcR150SOlU2449WBoMBlR4zQohg5CWE0MgMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682957653; a=rsa-sha256; cv=none; b=Zl6B8AYMRMEbIcrsTg4ZOGBeKI9xuL3dUL0MKK6/SCPN7XjxDVPHn/WXX7y1r1XsWva3/B UyivnJwGLFOrA49CRFS0IE+9bc92v1D41u1mTA/T4Ogq4dVkOykdFG7cEdNUSg5Fb4KHYC PwYHeWVAqjuaf+PHGx2+mjRIRL7f6PkkHeLYw7IR0hsGnIQhe9tyU5qikXpaAptnJXcXSa hVdTGVXp2K10I325yWhOBeqTcz2nRI8wxWoTqd3M4xdEqsXPt8mFdvrIIgS8bK6vxBBSLY oofL+WdDxxn0TQhjp8h2R8AZTlQHXODdA4AgLrVeryLnNdFPV8mizXyC3RPnOg== Received: from [IPV6:2601:648:8680:16b0:6863:4e51:eaeb:9500] (unknown [IPv6:2601:648:8680:16b0:6863:4e51:eaeb:9500]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Q97ZD2mCPznpP; Mon, 1 May 2023 16:14:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Mon, 1 May 2023 09:14:11 -0700 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: git: 060699e91369 - stable/13 - Merge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6 Content-Language: en-US To: "Jason A. Harmening" , Konstantin Belousov Cc: Dimitry Andric , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org References: <202304092135.339LZMeJ081640@gitrepo.freebsd.org> <76DD2CB9-986B-4349-8F46-3B7BF63EB315@FreeBSD.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 4/30/23 8:31 PM, Jason A. Harmening wrote: > On Sun, Apr 30, 2023 at 07:34:45PM -0500, Jason A. Harmening wrote: >> On Sun, Apr 30, 2023 at 06:47:13PM -0500, Jason A. Harmening wrote: >>> On Sun, Apr 30, 2023 at 08:09:16AM +0300, Konstantin Belousov wrote: >>>> On Sat, Apr 29, 2023 at 02:27:50PM -0500, Jason A. Harmening wrote: >>>>> On Sat, Apr 29, 2023 at 08:49:28PM +0200, Dimitry Andric wrote: >>>>>> On 29 Apr 2023, at 20:33, Jason A. Harmening wrote: >>>>>>> >>>>>>> On Sun, Apr 09, 2023 at 09:35:22PM +0000, Dimitry Andric wrote: >>>>>>>> The branch stable/13 has been updated by dim: >>>>>>>> >>>>>>>> URL: https://cgit.FreeBSD.org/src/commit/?id=060699e9136975d51d3f726b9785bdbac9a62ba6 >>>>>>>> >>>>>>>> commit 060699e9136975d51d3f726b9785bdbac9a62ba6 >>>>>>>> Author: Dimitry Andric >>>>>>>> AuthorDate: 2023-01-14 16:33:24 +0000 >>>>>>>> Commit: Dimitry Andric >>>>>>>> CommitDate: 2023-04-09 14:54:52 +0000 >>>>>>>> >>>>>>>> Merge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6 >>>>>>>> >>>>>>>> This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and >>>>>>>> openmp to llvmorg-15.0.7-0-g8dfdcc7b7bf6. >>>>>>>> >>>>>>>> PR: 265425 >>>>>>>> MFC after: 2 weeks >>>>>>> >>>>>>> This MFC of llvm15 appears to have completely broken the Intel IOMMU >>>>>>> driver on my stable/13 machine. After this series of commits, any >>>>>>> downstream DMA seems to produce an IOMMU translation fault, which >>>>>>> renders the machine completely unusable: no nvme boot disk, no usb >>>>>>> keyboard, etc. >>>>>>> >>>>>>> The faults I see look something like this: >>>>>>> >>>>>>> DMAR4: ahci0: pci0:17:5 sid 8d fault acc 0 adt 0x0 reason 0x3 addr 26000 >>>>>>> >>>>>>> It's a bit surprising to see a toolchain upgrade produce breakage like >>>>>>> this, but that's what git bisect clearly tells me. I wonder if some of >>>>>>> the IOMMU control structures might be defined as C bitfields and the new >>>>>>> compiler is emitting them differently? Also, was any breakage like this >>>>>>> observed when -current was upgraded to llvm15 several months ago? >>>>>> >>>>>> I haven't heard anything about such breakage, no. >>>>>> >>>>>> >>>>>>> More generally, this is the second time in as many months I've had to >>>>>>> deal with IOMMU breakage on -stable. I can't imagine I'm the only >>>>>>> person who sees value in running with DMA remapping enabled; do we need >>>>>>> a dedicated DMAR-enabled machine in the cluster to smoke-test changes >>>>>>> like this? More generally, should we avoid MFCing high-risk changes >>>>>>> like this? >>>>>> >>>>>> Since there were very few bug reports, it was not deemed high risk. >>>>>> >>>>>> In any case, it would be good to get the bottom of what is causing the >>>>>> problem, so is there any way you can isolate which code seems to be >>>>>> going "bad"? >>>>>> >>>>>> For example, if this problem affects code in sys/dev/iommu, is there >>>>>> some way you can compile that part with -O1, or with an older version >>>>>> of clang (from ports), to see if the problem goes away? >>>>> >>>>> I did try removing all custom make.conf settings (previously I just had >>>>> CPUTYPE?=icelake-server), but that didn't change the behavior. >>>>> >>>>> Before I try further build tweaks, I'd like to ask if the IOMMU fault >>>>> report can provide guidance here? AFAICT all the faults I'm getting >>>>> show "reason 0x3". If I'm reading the VT-d spec correctly, FR=0x3 >>>>> indicates an invalid context entry, in other words there's something the >>>>> hardware doesn't like in the way the address width or pagetable base is >>>>> configured for the PCIe requestor. >>>> >>>> I would start looking at the other direction: might be, there are still some >>>> left shifts for int32 values with the shift count > 30, or uint32 with the >>>> count > 31. >>>> >>>> Also might be useful to dump each context entry on creation, it is kept >>>> constant after. >>> >>> I did look over the constants in intel_reg.h, and didn't see anything >>> that looked as though it would be susceptible to sign-extension or >>> truncation bugs. In the failing case it's much easier for me to catch >>> the fault messages than any initialization message, so I instrumented >>> the fault handler to get the context entry from the dmar_ctx object >>> using the same logic as dmar_map_ctx_entry(), and then dump out the ctx1 >>> and ctx2 fields. What I see are messages like: >>> >>> ... ctx1 0x10013b001 ctx2 0x103 >>> >>> At first glance these "look right": the P bit is set in ctx1, and the >>> rest of the field looks like a valid physical address. ctx2 also >>> doesn't have any of the reserved bits set, but in all cases it does have >>> AW=3, which would indicate 57-bit AGAW. But when I boot the last >>> working kernel, from the revision prior to the llvm15 MFC, I see this in >>> dmesg: >>> >>> ahci0: dmar4 pci0:0:17:5 rid 8d domain 1 mgaw 48 agaw 48 re-mapped >>> >>> ...all reported devices show 48-bit MGAW/AGAW, so I would expect ctx2 to >>> have AW=2. I suspect this may be the source of the fault, but I'm not >>> sure how it's getting configured that way, whether it's an issue with >>> reading the capability register or something else. >>> >> >> I can confirm that hacking domain_set_agaw() to always use the settings >> from sagaw_bits[2] eliminates the faults and at least allows the machine >> to boot to single-user mode. > > I see what's happening now. When I added the hack to always set > sagaw_bits[2], I noted that the passed-in MGAW was still 57, while > unit->hw_cap had the correct value of 0x4 (=> 4-level paging, 48-bit AW) > in bits 12:8. The problem is that sagaw_bits has agaw=64 in its last > entry. This results in dmar_maxaddr2mgaw() attempting a comparison > against 1ULL << 64 in the final iteration of its first loop. I suspect > the new compiler probably determines that last iteration is meaningless > and simply omits it from the (probably unrolled) loop. Since the "loop" > terminates with i < nitems(sagaw_bits), the subsequent "allow_less ..." > case doesn't execute and we end up erroneously selecting a 57-bit > address width. Just commenting out that last entry in sagaw_bits fixes > the problem. > > So, two questions: > 1) Does any VT-d hardware actually support 6-level paging? The ca. 2021 > VT-d spec I'm looking at indicates 5-level is the greatest depth > supported, with everything above that being reserved. > > 2) I'd expect clang to try very hard to error out in a situation like > this, but I see that sys/conf/kern.mk sets -Wno-shift-count-overflow > among other things, and more of them were added for clang 15. This > seems like a really bad idea, regardless of how much of a PITA it may be > to fix these warnings. FWIW, I've been working on trying to re-enable some of the warnings that were disabled for clang 15 in main. I'll move that one higher up on my todo list. -- John Baldwin From nobody Mon May 1 17:03:37 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q98gJ2w2sz48m53; Mon, 1 May 2023 17:03:40 +0000 (UTC) (envelope-from jah@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q98gJ0Jjrz42qW; Mon, 1 May 2023 17:03:40 +0000 (UTC) (envelope-from jah@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682960620; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4MFH2o6+V/AFYcwXnnrZ1zBcr5kDTGhNyMzmdF/JUrA=; b=bhtndloaDRHLViM1C7tXA9vgy+jhlK16DqEcc4SCaR6j/P7g8t4One1TwKmubH4gcBs+Mc R1aUc0f6Pi9NSZcu3sdnm9XtkdQSvLbGX3MhJmvNjE3DXi3VU5WDsjN7tHJd4+OkRHEvWU w0989Igo7uFgBlipy6mGh2g/q9O4DiKwcOY/gmdYZ5/XSetg8AAGK5qI+kn+9Auj9UBcWc 3jYVYhJ7sEWtqNur+sRppXqoQ/igZ3C2KG3OyNwn7cV2lsoy58izm0iiVoZA2gtUJGuqWF AWjk0EaTYFvko+oe6eXBrjI8mY4EQqdZbrjbZyaVNhKYXO60y7vOp3oCiFCtHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682960620; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4MFH2o6+V/AFYcwXnnrZ1zBcr5kDTGhNyMzmdF/JUrA=; b=IkSPhonlLlnmrq+ej2QudRSMioWtinhWUFf4ACGoL6FgLNkEhe/vjrM2XSy/9JdhvBAppu 280HrHQlsk8enS0uJsqql7vZ35caEWz+ayiZvnneXuaAldCZcL5u/I65+KlUvvHA4pSfKX 6mS0OIYdj3jRL36ec7k2ydlft2Bdk3B8N2GQEZ3qNw/SXzVuz2xzjKiOyVHnqqzsALlJxx 2T22hSGSbJDByMz69SGUwgQAdccLis6EqyVUy5gRypAbLWdsxG2hdQKvik4P0OO+b6CQMH gPl/HVV76rCYJlNLNJdDIew711+aL93rFkacBZ6a/F5m3Bju7ezRQJ8tr4p8Kw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682960620; a=rsa-sha256; cv=none; b=P37b1Zs6GzvM5P9ffUO7rjJCNN5fKe1ISxPuNqACZpa1e9rpIaTL8VwPpE72/OQXjPVb9D t9szFrHGiDAbhPu27Po3OHC4Mxx3B0qRhJoRYhZ9bp/VLatWo81zvEYGoKkYmV7NfFWOGa LvbjyC5WdaS7nBNuZFF8MYgF8i6/HiUgm+q82OlWOOn+NiqJapjEahA3AeNyGpOTfKyis9 BLWbhtOGshk+X5ADTh/ZHOQBJBhg+X6Rdb9EXWem53chttpSSq2H0GBOLq1AUzDPHPR/xe 6fS3TVHFyQ1DaDT0WxXCqi8vGZZHYi9dEyegAHfHbRgC61Qix7M2UhXfdHY2Pw== Received: from corona (047-232-115-243.res.spectrum.com [47.232.115.243]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jah) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Q98gH3NtBzpV7; Mon, 1 May 2023 17:03:39 +0000 (UTC) (envelope-from jah@freebsd.org) Date: Mon, 1 May 2023 12:03:37 -0500 From: "Jason A. Harmening" To: John Baldwin Cc: Konstantin Belousov , Dimitry Andric , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Subject: Re: git: 060699e91369 - stable/13 - Merge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6 Message-ID: References: <202304092135.339LZMeJ081640@gitrepo.freebsd.org> <76DD2CB9-986B-4349-8F46-3B7BF63EB315@FreeBSD.org> List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ThisMailContainsUnwantedMimeParts: N On Mon, May 01, 2023 at 09:14:11AM -0700, John Baldwin wrote: > On 4/30/23 8:31 PM, Jason A. Harmening wrote: > > On Sun, Apr 30, 2023 at 07:34:45PM -0500, Jason A. Harmening wrote: > >> On Sun, Apr 30, 2023 at 06:47:13PM -0500, Jason A. Harmening wrote: > >>> On Sun, Apr 30, 2023 at 08:09:16AM +0300, Konstantin Belousov wrote: > >>>> On Sat, Apr 29, 2023 at 02:27:50PM -0500, Jason A. Harmening wrote: > >>>>> On Sat, Apr 29, 2023 at 08:49:28PM +0200, Dimitry Andric wrote: > >>>>>> On 29 Apr 2023, at 20:33, Jason A. Harmening wrote: > >>>>>>> > >>>>>>> On Sun, Apr 09, 2023 at 09:35:22PM +0000, Dimitry Andric wrote: > >>>>>>>> The branch stable/13 has been updated by dim: > >>>>>>>> > >>>>>>>> URL: https://cgit.FreeBSD.org/src/commit/?id=060699e9136975d51d3f726b9785bdbac9a62ba6 > >>>>>>>> > >>>>>>>> commit 060699e9136975d51d3f726b9785bdbac9a62ba6 > >>>>>>>> Author: Dimitry Andric > >>>>>>>> AuthorDate: 2023-01-14 16:33:24 +0000 > >>>>>>>> Commit: Dimitry Andric > >>>>>>>> CommitDate: 2023-04-09 14:54:52 +0000 > >>>>>>>> > >>>>>>>> Merge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6 > >>>>>>>> > >>>>>>>> This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and > >>>>>>>> openmp to llvmorg-15.0.7-0-g8dfdcc7b7bf6. > >>>>>>>> > >>>>>>>> PR: 265425 > >>>>>>>> MFC after: 2 weeks > >>>>>>> > >>>>>>> This MFC of llvm15 appears to have completely broken the Intel IOMMU > >>>>>>> driver on my stable/13 machine. After this series of commits, any > >>>>>>> downstream DMA seems to produce an IOMMU translation fault, which > >>>>>>> renders the machine completely unusable: no nvme boot disk, no usb > >>>>>>> keyboard, etc. > >>>>>>> > >>>>>>> The faults I see look something like this: > >>>>>>> > >>>>>>> DMAR4: ahci0: pci0:17:5 sid 8d fault acc 0 adt 0x0 reason 0x3 addr 26000 > >>>>>>> > >>>>>>> It's a bit surprising to see a toolchain upgrade produce breakage like > >>>>>>> this, but that's what git bisect clearly tells me. I wonder if some of > >>>>>>> the IOMMU control structures might be defined as C bitfields and the new > >>>>>>> compiler is emitting them differently? Also, was any breakage like this > >>>>>>> observed when -current was upgraded to llvm15 several months ago? > >>>>>> > >>>>>> I haven't heard anything about such breakage, no. > >>>>>> > >>>>>> > >>>>>>> More generally, this is the second time in as many months I've had to > >>>>>>> deal with IOMMU breakage on -stable. I can't imagine I'm the only > >>>>>>> person who sees value in running with DMA remapping enabled; do we need > >>>>>>> a dedicated DMAR-enabled machine in the cluster to smoke-test changes > >>>>>>> like this? More generally, should we avoid MFCing high-risk changes > >>>>>>> like this? > >>>>>> > >>>>>> Since there were very few bug reports, it was not deemed high risk. > >>>>>> > >>>>>> In any case, it would be good to get the bottom of what is causing the > >>>>>> problem, so is there any way you can isolate which code seems to be > >>>>>> going "bad"? > >>>>>> > >>>>>> For example, if this problem affects code in sys/dev/iommu, is there > >>>>>> some way you can compile that part with -O1, or with an older version > >>>>>> of clang (from ports), to see if the problem goes away? > >>>>> > >>>>> I did try removing all custom make.conf settings (previously I just had > >>>>> CPUTYPE?=icelake-server), but that didn't change the behavior. > >>>>> > >>>>> Before I try further build tweaks, I'd like to ask if the IOMMU fault > >>>>> report can provide guidance here? AFAICT all the faults I'm getting > >>>>> show "reason 0x3". If I'm reading the VT-d spec correctly, FR=0x3 > >>>>> indicates an invalid context entry, in other words there's something the > >>>>> hardware doesn't like in the way the address width or pagetable base is > >>>>> configured for the PCIe requestor. > >>>> > >>>> I would start looking at the other direction: might be, there are still some > >>>> left shifts for int32 values with the shift count > 30, or uint32 with the > >>>> count > 31. > >>>> > >>>> Also might be useful to dump each context entry on creation, it is kept > >>>> constant after. > >>> > >>> I did look over the constants in intel_reg.h, and didn't see anything > >>> that looked as though it would be susceptible to sign-extension or > >>> truncation bugs. In the failing case it's much easier for me to catch > >>> the fault messages than any initialization message, so I instrumented > >>> the fault handler to get the context entry from the dmar_ctx object > >>> using the same logic as dmar_map_ctx_entry(), and then dump out the ctx1 > >>> and ctx2 fields. What I see are messages like: > >>> > >>> ... ctx1 0x10013b001 ctx2 0x103 > >>> > >>> At first glance these "look right": the P bit is set in ctx1, and the > >>> rest of the field looks like a valid physical address. ctx2 also > >>> doesn't have any of the reserved bits set, but in all cases it does have > >>> AW=3, which would indicate 57-bit AGAW. But when I boot the last > >>> working kernel, from the revision prior to the llvm15 MFC, I see this in > >>> dmesg: > >>> > >>> ahci0: dmar4 pci0:0:17:5 rid 8d domain 1 mgaw 48 agaw 48 re-mapped > >>> > >>> ...all reported devices show 48-bit MGAW/AGAW, so I would expect ctx2 to > >>> have AW=2. I suspect this may be the source of the fault, but I'm not > >>> sure how it's getting configured that way, whether it's an issue with > >>> reading the capability register or something else. > >>> > >> > >> I can confirm that hacking domain_set_agaw() to always use the settings > >> from sagaw_bits[2] eliminates the faults and at least allows the machine > >> to boot to single-user mode. > > > > I see what's happening now. When I added the hack to always set > > sagaw_bits[2], I noted that the passed-in MGAW was still 57, while > > unit->hw_cap had the correct value of 0x4 (=> 4-level paging, 48-bit AW) > > in bits 12:8. The problem is that sagaw_bits has agaw=64 in its last > > entry. This results in dmar_maxaddr2mgaw() attempting a comparison > > against 1ULL << 64 in the final iteration of its first loop. I suspect > > the new compiler probably determines that last iteration is meaningless > > and simply omits it from the (probably unrolled) loop. Since the "loop" > > terminates with i < nitems(sagaw_bits), the subsequent "allow_less ..." > > case doesn't execute and we end up erroneously selecting a 57-bit > > address width. Just commenting out that last entry in sagaw_bits fixes > > the problem. > > > > So, two questions: > > 1) Does any VT-d hardware actually support 6-level paging? The ca. 2021 > > VT-d spec I'm looking at indicates 5-level is the greatest depth > > supported, with everything above that being reserved. > > > > 2) I'd expect clang to try very hard to error out in a situation like > > this, but I see that sys/conf/kern.mk sets -Wno-shift-count-overflow > > among other things, and more of them were added for clang 15. This > > seems like a really bad idea, regardless of how much of a PITA it may be > > to fix these warnings. > > FWIW, I've been working on trying to re-enable some of the warnings that > were disabled for clang 15 in main. I'll move that one higher up on my > todo list. Can we also have a DMAR-enabled machine in something like the Jenkins cluster to smoke-test IOMMU support before breakage like this makes it into -current let alone -stable? I'd be willing to donate money for such a thing. > > -- > John Baldwin > From nobody Mon May 1 18:41:32 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9Brc52c4z48sLc; Mon, 1 May 2023 18:41:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q9Brc4W4mz4Jdn; Mon, 1 May 2023 18:41:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682966512; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WQJSoBUPDxqD7SODKYPTU7VQN3SnaoXEl9/nRJRuMyQ=; b=TWqANdDgeEecgngXZJvuolXFN/5RMTAsCXqXrEW59fGec9+fG2Fxf05YydoSa6wIqw0YSH vs50FwX5uaBfV3Fc6zwPRc+Yy5QxUvev8BkcWeVjpM3juUnPJoYt/aoFZJ+9jmI07SKwIK Xiz2OfNoNtizwBWk1wrgEQe1ywlQ0XPO6PITCvdMyJ5CYqg2WJD23wNGXlXZZ4XESBIxeI BTa9j0VvY3Gqzhx/p17mcKqcsXFStI1kpgmzz6nvHf719B6ZSeDF24ViB1klKq0w0oyk/9 30UWLDg+KBZWqM0nhVSXHP0lmTHhjfHFeVbsl1leIBHRojBpoXPiV1vVbCjBRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682966512; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WQJSoBUPDxqD7SODKYPTU7VQN3SnaoXEl9/nRJRuMyQ=; b=PZwkcykz3CdXQM60BdTo/38r86IGkHRMGWqBQhoXofX13chI5Wb+aqKwrNtz9vph1USudM C5fFzlyhlNrzyvjMaHIfsTiq0ja1EsQ9n/c3qGWz6MCtV2KAxXehk5PZf/U3tta8zjEqp5 O4JicQDo0KyTA8Drc/nFUYBxUhSZwnh2swTyL5scwQTP8B4XM2ckZCE6hPm+dnakC4wSPu bRglotCIa6onHZ6euemFkKVaFThHZEGLkR90y30KC4LgARKARcKf6eU+afSPGaBm24Iswu DkTZ3Q1uCfb5XDXsuehmmILNONjdTwpqCAVbvoM1gyVeq2JqGIpIF5MwKYk4Qw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682966512; a=rsa-sha256; cv=none; b=Sfl4M4CE6JU2h5U8w4sNGf72VElVtL628KRg9e7iLqlRkP12Fvob1KkoCq4dnAdkivb8/p hnzS0Ps35Tv9SSOdv+HV2Bhe/XRAKs7A1BB2RkyCjLZFdfCd/EfIOmrk5eFA9P137WjkMO rqAmtyL6V90kpNVsWRnGIpPUuRz5VMvcNX5tQFE00rJqDcYDchzhv7qJRiRleklwc3txuq IXfGkEcD2bn9ugRiNosXgFbE4Rj1bYJuPM36zVaEpaKqG2OF66AsoEGOuJtCG0i4a+3Sdn mFrOX0iW/0MiDBfQzi9tI2NVcMhxa4Wbj8HFETIFhpRZ7A4UHyYauapNzkt30g== Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.3 with cipher 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 "tensor.andric.com", Issuer "R3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Q9Brc2rHdzssr; Mon, 1 May 2023 18:41:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtpclient.apple (longrow.home.andric.com [192.168.0.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 3FC596EBE8; Mon, 1 May 2023 20:41:51 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_4E63B4C0-59F7-4609-A297-F6686495A611"; protocol="application/pgp-signature"; micalg=pgp-sha1 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: git: 060699e91369 - stable/13 - Merge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6 From: Dimitry Andric In-Reply-To: Date: Mon, 1 May 2023 20:41:32 +0200 Cc: "Jason A. Harmening" , Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Message-Id: References: <202304092135.339LZMeJ081640@gitrepo.freebsd.org> <76DD2CB9-986B-4349-8F46-3B7BF63EB315@FreeBSD.org> To: John Baldwin X-Mailer: Apple Mail (2.3731.500.231) X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_4E63B4C0-59F7-4609-A297-F6686495A611 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 1 May 2023, at 18:14, John Baldwin wrote: >=20 > On 4/30/23 8:31 PM, Jason A. Harmening wrote: >> On Sun, Apr 30, 2023 at 07:34:45PM -0500, Jason A. Harmening wrote: >>> On Sun, Apr 30, 2023 at 06:47:13PM -0500, Jason A. Harmening wrote: >>>> On Sun, Apr 30, 2023 at 08:09:16AM +0300, Konstantin Belousov = wrote: >>>>> On Sat, Apr 29, 2023 at 02:27:50PM -0500, Jason A. Harmening = wrote: >>>>>> On Sat, Apr 29, 2023 at 08:49:28PM +0200, Dimitry Andric wrote: >>>>>>> On 29 Apr 2023, at 20:33, Jason A. Harmening = wrote: >>>>>>>>=20 >>>>>>>> On Sun, Apr 09, 2023 at 09:35:22PM +0000, Dimitry Andric wrote: >>>>>>>>> The branch stable/13 has been updated by dim: >>>>>>>>>=20 >>>>>>>>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D060699e9136975d51d3f726b9785bdba= c9a62ba6 >>>>>>>>>=20 >>>>>>>>> commit 060699e9136975d51d3f726b9785bdbac9a62ba6 >>>>>>>>> Author: Dimitry Andric >>>>>>>>> AuthorDate: 2023-01-14 16:33:24 +0000 >>>>>>>>> Commit: Dimitry Andric >>>>>>>>> CommitDate: 2023-04-09 14:54:52 +0000 >>>>>>>>>=20 >>>>>>>>> Merge llvm-project release/15.x = llvmorg-15.0.7-0-g8dfdcc7b7bf6 >>>>>>>>>=20 >>>>>>>>> This updates llvm, clang, compiler-rt, libc++, libunwind, = lld, lldb and >>>>>>>>> openmp to llvmorg-15.0.7-0-g8dfdcc7b7bf6. >>>>>>>>>=20 >>>>>>>>> PR: 265425 >>>>>>>>> MFC after: 2 weeks >>>>>>>>=20 >>>>>>>> This MFC of llvm15 appears to have completely broken the Intel = IOMMU >>>>>>>> driver on my stable/13 machine. After this series of commits, = any >>>>>>>> downstream DMA seems to produce an IOMMU translation fault, = which >>>>>>>> renders the machine completely unusable: no nvme boot disk, no = usb >>>>>>>> keyboard, etc. >>>>>>>>=20 >>>>>>>> The faults I see look something like this: >>>>>>>>=20 >>>>>>>> DMAR4: ahci0: pci0:17:5 sid 8d fault acc 0 adt 0x0 reason 0x3 = addr 26000 >>>>>>>>=20 >>>>>>>> It's a bit surprising to see a toolchain upgrade produce = breakage like >>>>>>>> this, but that's what git bisect clearly tells me. I wonder if = some of >>>>>>>> the IOMMU control structures might be defined as C bitfields = and the new >>>>>>>> compiler is emitting them differently? Also, was any breakage = like this >>>>>>>> observed when -current was upgraded to llvm15 several months = ago? >>>>>>>=20 >>>>>>> I haven't heard anything about such breakage, no. >>>>>>>=20 >>>>>>>=20 >>>>>>>> More generally, this is the second time in as many months I've = had to >>>>>>>> deal with IOMMU breakage on -stable. I can't imagine I'm the = only >>>>>>>> person who sees value in running with DMA remapping enabled; do = we need >>>>>>>> a dedicated DMAR-enabled machine in the cluster to smoke-test = changes >>>>>>>> like this? More generally, should we avoid MFCing high-risk = changes >>>>>>>> like this? >>>>>>>=20 >>>>>>> Since there were very few bug reports, it was not deemed high = risk. >>>>>>>=20 >>>>>>> In any case, it would be good to get the bottom of what is = causing the >>>>>>> problem, so is there any way you can isolate which code seems to = be >>>>>>> going "bad"? >>>>>>>=20 >>>>>>> For example, if this problem affects code in sys/dev/iommu, is = there >>>>>>> some way you can compile that part with -O1, or with an older = version >>>>>>> of clang (from ports), to see if the problem goes away? >>>>>>=20 >>>>>> I did try removing all custom make.conf settings (previously I = just had >>>>>> CPUTYPE?=3Dicelake-server), but that didn't change the behavior. >>>>>>=20 >>>>>> Before I try further build tweaks, I'd like to ask if the IOMMU = fault >>>>>> report can provide guidance here? AFAICT all the faults I'm = getting >>>>>> show "reason 0x3". If I'm reading the VT-d spec correctly, = FR=3D0x3 >>>>>> indicates an invalid context entry, in other words there's = something the >>>>>> hardware doesn't like in the way the address width or pagetable = base is >>>>>> configured for the PCIe requestor. >>>>>=20 >>>>> I would start looking at the other direction: might be, there are = still some >>>>> left shifts for int32 values with the shift count > 30, or uint32 = with the >>>>> count > 31. >>>>>=20 >>>>> Also might be useful to dump each context entry on creation, it is = kept >>>>> constant after. >>>>=20 >>>> I did look over the constants in intel_reg.h, and didn't see = anything >>>> that looked as though it would be susceptible to sign-extension or >>>> truncation bugs. In the failing case it's much easier for me to = catch >>>> the fault messages than any initialization message, so I = instrumented >>>> the fault handler to get the context entry from the dmar_ctx object >>>> using the same logic as dmar_map_ctx_entry(), and then dump out the = ctx1 >>>> and ctx2 fields. What I see are messages like: >>>>=20 >>>> ... ctx1 0x10013b001 ctx2 0x103 >>>>=20 >>>> At first glance these "look right": the P bit is set in ctx1, and = the >>>> rest of the field looks like a valid physical address. ctx2 also >>>> doesn't have any of the reserved bits set, but in all cases it does = have >>>> AW=3D3, which would indicate 57-bit AGAW. But when I boot the last >>>> working kernel, from the revision prior to the llvm15 MFC, I see = this in >>>> dmesg: >>>>=20 >>>> ahci0: dmar4 pci0:0:17:5 rid 8d domain 1 mgaw 48 agaw 48 re-mapped >>>>=20 >>>> ...all reported devices show 48-bit MGAW/AGAW, so I would expect = ctx2 to >>>> have AW=3D2. I suspect this may be the source of the fault, but = I'm not >>>> sure how it's getting configured that way, whether it's an issue = with >>>> reading the capability register or something else. >>>>=20 >>>=20 >>> I can confirm that hacking domain_set_agaw() to always use the = settings >>> from sagaw_bits[2] eliminates the faults and at least allows the = machine >>> to boot to single-user mode. >> I see what's happening now. When I added the hack to always set >> sagaw_bits[2], I noted that the passed-in MGAW was still 57, while >> unit->hw_cap had the correct value of 0x4 (=3D> 4-level paging, = 48-bit AW) >> in bits 12:8. The problem is that sagaw_bits has agaw=3D64 in its = last >> entry. This results in dmar_maxaddr2mgaw() attempting a comparison >> against 1ULL << 64 in the final iteration of its first loop. I = suspect >> the new compiler probably determines that last iteration is = meaningless >> and simply omits it from the (probably unrolled) loop. Since the = "loop" >> terminates with i < nitems(sagaw_bits), the subsequent "allow_less = ..." >> case doesn't execute and we end up erroneously selecting a 57-bit >> address width. Just commenting out that last entry in sagaw_bits = fixes >> the problem. >> So, two questions: >> 1) Does any VT-d hardware actually support 6-level paging? The ca. = 2021 >> VT-d spec I'm looking at indicates 5-level is the greatest depth >> supported, with everything above that being reserved. >> 2) I'd expect clang to try very hard to error out in a situation like >> this, but I see that sys/conf/kern.mk sets -Wno-shift-count-overflow >> among other things, and more of them were added for clang 15. This >> seems like a really bad idea, regardless of how much of a PITA it may = be >> to fix these warnings. >=20 > FWIW, I've been working on trying to re-enable some of the warnings = that > were disabled for clang 15 in main. I'll move that one higher up on = my > todo list. In this particular case, it doesn't warn about it though. I think KASAN might be a better 'catcher' for this kind of error, or a KUBSAN, if we had one... -Dimitry --Apple-Mail=_4E63B4C0-59F7-4609-A297-F6686495A611 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCZFAH3AAKCRCwXqMKLiCW o8k3AJ9DkrMB167K+sSNel6qHWAMhRILBwCfYE5kwUADLOtEslYT8QQ1pzM2sYI= =/I7V -----END PGP SIGNATURE----- --Apple-Mail=_4E63B4C0-59F7-4609-A297-F6686495A611-- From nobody Mon May 1 19:33:56 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9D0k5tSmz48w8p; Mon, 1 May 2023 19:33:58 +0000 (UTC) (envelope-from jah@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q9D0k5L9yz4NQ1; Mon, 1 May 2023 19:33:58 +0000 (UTC) (envelope-from jah@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682969638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DzInxjNQtfRHVEkkiG1V4W/0Aq6ZooQr32FG+ULdV2E=; b=ZuqicZ/iJyEBWoE+bf3Ero7zzjveeGef/UtYuvCNgH9OXs0kFZkqzJoUjqg8emI4IMrMOi 0NAC1hIWXSmE7NSi/8YgoRAgw+0QRctDIRSG2DwumNkFaTkogJ2nqcglyRYa6Zk9S9vwi+ 2kTZk0wm8uySwNxfE2QC2K3xG0U9uicdzxxLgGS8s9wyepx4nosh5tRyDBfr7e2m+z5/PQ RvGPYuEbH+CTGvdJHqWSXZhVrZPBBsxrlvsrX1CBP3yKPpIugwkVnlsggYvX5HaCWK+ZZ2 3UFaq4mkm4JmERbcHt65Kv2537rhbCAe3+lzZAwJgpt7tbpc4gNY5ZETNxJIsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682969638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DzInxjNQtfRHVEkkiG1V4W/0Aq6ZooQr32FG+ULdV2E=; b=d7wLt4f8k8Gi+tX+a26zyEaXDXMXf0JzBW3Q37hPuZtxsZv4hwt2QHSx6kMPMqBvgKWEBj L5S47Jo63zQq13inp34unRLJql+almEHW+mF1jsivehajOPnlgPny+Nf4To+FbDbCo2dQz dkk/Rpddc6XVpKap2aDg4eEm8wleJH+nQvQ08Fh4YvJw1MQ08dceVNmLrpO0ozlEM2A4L6 4clwLO4lGxD/enxx0E9fk2DFue8gKj+gJGY9QhmHDANmNfXrc7Tk4t/ZlHF9zolvLH1lyU +Bmkxyx7o4LhsIxQ3AoGG/S28aIGzLLvGS6FUZ38WEGeKzSQgJ9v6ByFPQJ3NA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682969638; a=rsa-sha256; cv=none; b=CyRetMIjwE7G7XyP6hwoZj+K+TE5V7451XRbs541wfH202XPE7jEHI5+dxZQfIBPNKtF7n BPg4OFnWN4zb05V4hYv2RDUm24NzCBkx1uCV6RrVOxx4JzilDFg72k7rwh0luRJ5QKvALo kOWycWD9wQb58d9sVyIitty/srB+Zvb9ughJi3gJsgIDOvUXy5oW9wa9PKkomv8DfM/Bmo 4/bLE5/jVXuwc9uLbbc4gagCH1qmPbzV5KMqMSfy6yLMANnhUKYImrM0Yp6yrBAXMAqODl z4HsNeEtsv5pABXvzDrXaT0KrRO2prrcOpZke8dZIJP9DS3LDwwualyPmcca9Q== Received: from corona (047-232-115-243.res.spectrum.com [47.232.115.243]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jah) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Q9D0k1S4SztrW; Mon, 1 May 2023 19:33:58 +0000 (UTC) (envelope-from jah@freebsd.org) Date: Mon, 1 May 2023 14:33:56 -0500 From: "Jason A. Harmening" To: Dimitry Andric Cc: John Baldwin , Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Subject: Re: git: 060699e91369 - stable/13 - Merge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6 Message-ID: References: <202304092135.339LZMeJ081640@gitrepo.freebsd.org> <76DD2CB9-986B-4349-8F46-3B7BF63EB315@FreeBSD.org> List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ThisMailContainsUnwantedMimeParts: N On Mon, May 01, 2023 at 08:41:32PM +0200, Dimitry Andric wrote: > On 1 May 2023, at 18:14, John Baldwin wrote: > > > > On 4/30/23 8:31 PM, Jason A. Harmening wrote: > >> On Sun, Apr 30, 2023 at 07:34:45PM -0500, Jason A. Harmening wrote: > >>> On Sun, Apr 30, 2023 at 06:47:13PM -0500, Jason A. Harmening wrote: > >>>> On Sun, Apr 30, 2023 at 08:09:16AM +0300, Konstantin Belousov wrote: > >>>>> On Sat, Apr 29, 2023 at 02:27:50PM -0500, Jason A. Harmening wrote: > >>>>>> On Sat, Apr 29, 2023 at 08:49:28PM +0200, Dimitry Andric wrote: > >>>>>>> On 29 Apr 2023, at 20:33, Jason A. Harmening wrote: > >>>>>>>> > >>>>>>>> On Sun, Apr 09, 2023 at 09:35:22PM +0000, Dimitry Andric wrote: > >>>>>>>>> The branch stable/13 has been updated by dim: > >>>>>>>>> > >>>>>>>>> URL: https://cgit.FreeBSD.org/src/commit/?id=060699e9136975d51d3f726b9785bdbac9a62ba6 > >>>>>>>>> > >>>>>>>>> commit 060699e9136975d51d3f726b9785bdbac9a62ba6 > >>>>>>>>> Author: Dimitry Andric > >>>>>>>>> AuthorDate: 2023-01-14 16:33:24 +0000 > >>>>>>>>> Commit: Dimitry Andric > >>>>>>>>> CommitDate: 2023-04-09 14:54:52 +0000 > >>>>>>>>> > >>>>>>>>> Merge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6 > >>>>>>>>> > >>>>>>>>> This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and > >>>>>>>>> openmp to llvmorg-15.0.7-0-g8dfdcc7b7bf6. > >>>>>>>>> > >>>>>>>>> PR: 265425 > >>>>>>>>> MFC after: 2 weeks > >>>>>>>> > >>>>>>>> This MFC of llvm15 appears to have completely broken the Intel IOMMU > >>>>>>>> driver on my stable/13 machine. After this series of commits, any > >>>>>>>> downstream DMA seems to produce an IOMMU translation fault, which > >>>>>>>> renders the machine completely unusable: no nvme boot disk, no usb > >>>>>>>> keyboard, etc. > >>>>>>>> > >>>>>>>> The faults I see look something like this: > >>>>>>>> > >>>>>>>> DMAR4: ahci0: pci0:17:5 sid 8d fault acc 0 adt 0x0 reason 0x3 addr 26000 > >>>>>>>> > >>>>>>>> It's a bit surprising to see a toolchain upgrade produce breakage like > >>>>>>>> this, but that's what git bisect clearly tells me. I wonder if some of > >>>>>>>> the IOMMU control structures might be defined as C bitfields and the new > >>>>>>>> compiler is emitting them differently? Also, was any breakage like this > >>>>>>>> observed when -current was upgraded to llvm15 several months ago? > >>>>>>> > >>>>>>> I haven't heard anything about such breakage, no. > >>>>>>> > >>>>>>> > >>>>>>>> More generally, this is the second time in as many months I've had to > >>>>>>>> deal with IOMMU breakage on -stable. I can't imagine I'm the only > >>>>>>>> person who sees value in running with DMA remapping enabled; do we need > >>>>>>>> a dedicated DMAR-enabled machine in the cluster to smoke-test changes > >>>>>>>> like this? More generally, should we avoid MFCing high-risk changes > >>>>>>>> like this? > >>>>>>> > >>>>>>> Since there were very few bug reports, it was not deemed high risk. > >>>>>>> > >>>>>>> In any case, it would be good to get the bottom of what is causing the > >>>>>>> problem, so is there any way you can isolate which code seems to be > >>>>>>> going "bad"? > >>>>>>> > >>>>>>> For example, if this problem affects code in sys/dev/iommu, is there > >>>>>>> some way you can compile that part with -O1, or with an older version > >>>>>>> of clang (from ports), to see if the problem goes away? > >>>>>> > >>>>>> I did try removing all custom make.conf settings (previously I just had > >>>>>> CPUTYPE?=icelake-server), but that didn't change the behavior. > >>>>>> > >>>>>> Before I try further build tweaks, I'd like to ask if the IOMMU fault > >>>>>> report can provide guidance here? AFAICT all the faults I'm getting > >>>>>> show "reason 0x3". If I'm reading the VT-d spec correctly, FR=0x3 > >>>>>> indicates an invalid context entry, in other words there's something the > >>>>>> hardware doesn't like in the way the address width or pagetable base is > >>>>>> configured for the PCIe requestor. > >>>>> > >>>>> I would start looking at the other direction: might be, there are still some > >>>>> left shifts for int32 values with the shift count > 30, or uint32 with the > >>>>> count > 31. > >>>>> > >>>>> Also might be useful to dump each context entry on creation, it is kept > >>>>> constant after. > >>>> > >>>> I did look over the constants in intel_reg.h, and didn't see anything > >>>> that looked as though it would be susceptible to sign-extension or > >>>> truncation bugs. In the failing case it's much easier for me to catch > >>>> the fault messages than any initialization message, so I instrumented > >>>> the fault handler to get the context entry from the dmar_ctx object > >>>> using the same logic as dmar_map_ctx_entry(), and then dump out the ctx1 > >>>> and ctx2 fields. What I see are messages like: > >>>> > >>>> ... ctx1 0x10013b001 ctx2 0x103 > >>>> > >>>> At first glance these "look right": the P bit is set in ctx1, and the > >>>> rest of the field looks like a valid physical address. ctx2 also > >>>> doesn't have any of the reserved bits set, but in all cases it does have > >>>> AW=3, which would indicate 57-bit AGAW. But when I boot the last > >>>> working kernel, from the revision prior to the llvm15 MFC, I see this in > >>>> dmesg: > >>>> > >>>> ahci0: dmar4 pci0:0:17:5 rid 8d domain 1 mgaw 48 agaw 48 re-mapped > >>>> > >>>> ...all reported devices show 48-bit MGAW/AGAW, so I would expect ctx2 to > >>>> have AW=2. I suspect this may be the source of the fault, but I'm not > >>>> sure how it's getting configured that way, whether it's an issue with > >>>> reading the capability register or something else. > >>>> > >>> > >>> I can confirm that hacking domain_set_agaw() to always use the settings > >>> from sagaw_bits[2] eliminates the faults and at least allows the machine > >>> to boot to single-user mode. > >> I see what's happening now. When I added the hack to always set > >> sagaw_bits[2], I noted that the passed-in MGAW was still 57, while > >> unit->hw_cap had the correct value of 0x4 (=> 4-level paging, 48-bit AW) > >> in bits 12:8. The problem is that sagaw_bits has agaw=64 in its last > >> entry. This results in dmar_maxaddr2mgaw() attempting a comparison > >> against 1ULL << 64 in the final iteration of its first loop. I suspect > >> the new compiler probably determines that last iteration is meaningless > >> and simply omits it from the (probably unrolled) loop. Since the "loop" > >> terminates with i < nitems(sagaw_bits), the subsequent "allow_less ..." > >> case doesn't execute and we end up erroneously selecting a 57-bit > >> address width. Just commenting out that last entry in sagaw_bits fixes > >> the problem. > >> So, two questions: > >> 1) Does any VT-d hardware actually support 6-level paging? The ca. 2021 > >> VT-d spec I'm looking at indicates 5-level is the greatest depth > >> supported, with everything above that being reserved. > >> 2) I'd expect clang to try very hard to error out in a situation like > >> this, but I see that sys/conf/kern.mk sets -Wno-shift-count-overflow > >> among other things, and more of them were added for clang 15. This > >> seems like a really bad idea, regardless of how much of a PITA it may be > >> to fix these warnings. > > > > FWIW, I've been working on trying to re-enable some of the warnings that > > were disabled for clang 15 in main. I'll move that one higher up on my > > todo list. > > In this particular case, it doesn't warn about it though. I think KASAN > might be a better 'catcher' for this kind of error, or a KUBSAN, if we > had one... If you've tried turning all the relevant warnings/errors back on for this code, and clang truly doesn't warn about it, then wouldn't this warrant a bug against upstream clang? This is a situation in which the compiler detects a left-shift overflow, by itself at least a warning condition, and uses it to materially alter program flow. > > -Dimitry > From nobody Mon May 1 22:11:40 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9HW26HG4z494by; Mon, 1 May 2023 22:11:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q9HW25rvNz3nsq; Mon, 1 May 2023 22:11:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682979118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iirxyIiCrm77DSD3YVatS+WXkJbuWLhKEXDibH6i5yc=; b=SBGqehFg5WDM4DqoQBvCHUmGJOJP+9EyynNSv9eB/GLR/b1VRdM2GtL4SLc19lB/o9ICPN M7Dfhhp0oqTV7jp0AiTYG69/g5tDe9i7hkiIq/C/76rDqn2v3ohZMs1ZwY8WpOxoa6nydB mN6ABgEOFIkFRrVBycSexQfEQw1Rv0F/vftgnK7IJWg7s9Famr2yeAp4zZxW0UXHaSZ5tH 4Dg2zAa3kQqTiWREcN7r9yvDOBylu6h1Ipo4OTmxb/7v3W+E0FZ1eUadV0CI1jfJ9zAjPV QiwmgCQpKMT/OmDFONGJT1AnkYD9d7YoFCvGFD0eXlIU2nuIbqWoTO+GLwCUyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682979118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iirxyIiCrm77DSD3YVatS+WXkJbuWLhKEXDibH6i5yc=; b=WmSr2F5Zt/odct1Y4e6QGTY7ZMNoEeYyW6BZsOY7JCfyxX9vqO9KMO5Ak9Ekb1duVnJx3b 5nr0/XEL4BOgRfatPsYtCGOCKkMF3friBoqowk8RU93BWT9ot/0tREM/6j004GxzJEPANk CBK1KJCWGlY79afIe8tbqyS6kMSYoPM60VKIRbW/Nr+jGXfRgL5OVY4jaEQ2ivJNLNSniu 6QzBcLJ7Ar06MsLvXP9IGRlTHUMICYHQ20mWUhPhAcctHiobZzi/X2EJb0hmtc4KedULnC 2HWuzz6lZS5vtMgDAZDfqs83Hm+4ribFe9PrD6Zoq+Z50fdpKmXAytaKxjlaKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682979118; a=rsa-sha256; cv=none; b=aAZ9QtHHN0pgsAnHAJS6q5LtBOIXfpnNojb9IVAr0R2vT5cHbRn1DwUQPvhYklorEGappa YTu1CQUGDhPNgs+EyZAGQtxz1kbsrsavSehj3rnhEBUwSRN6VfFKCz9jHJ2+paZY9BaA7+ kL12LYE1cUjNO12F7FqpbmejJjnUd34AjYags3vS1AXLFfqLde+g/Zy54iI86d6hMDFpdR f4L8VVyv8Jq4tRhmPq9AO2jho+VSDcUv5Ctu0xXFsQtvXTsp7RHIpmiLw7MhRschZjWeji RV7+XiXBoTBykgNwDqYhsjoL4mEwKu/ZXsqauoWIcp37e9/OH6Uvf9xRoYbxlA== Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.3 with cipher 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 "tensor.andric.com", Issuer "R3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Q9HW24Ctszwkm; Mon, 1 May 2023 22:11:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtpclient.apple (longrow.home.andric.com [192.168.0.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 6E9356EE6F; Tue, 2 May 2023 00:11:57 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_8AAB2DF7-0578-4C2A-A09B-84677789D39C"; protocol="application/pgp-signature"; micalg=pgp-sha1 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: git: 060699e91369 - stable/13 - Merge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6 From: Dimitry Andric In-Reply-To: Date: Tue, 2 May 2023 00:11:40 +0200 Cc: John Baldwin , Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Message-Id: <331B50E9-A7F9-4BCF-90BD-EA1E69A8F1ED@FreeBSD.org> References: <202304092135.339LZMeJ081640@gitrepo.freebsd.org> <76DD2CB9-986B-4349-8F46-3B7BF63EB315@FreeBSD.org> To: "Jason A. Harmening" X-Mailer: Apple Mail (2.3731.500.231) X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_8AAB2DF7-0578-4C2A-A09B-84677789D39C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 1 May 2023, at 21:33, Jason A. Harmening wrote: >=20 > On Mon, May 01, 2023 at 08:41:32PM +0200, Dimitry Andric wrote: >> On 1 May 2023, at 18:14, John Baldwin wrote: >>>=20 >>> On 4/30/23 8:31 PM, Jason A. Harmening wrote: >>>> On Sun, Apr 30, 2023 at 07:34:45PM -0500, Jason A. Harmening wrote: >>>>> On Sun, Apr 30, 2023 at 06:47:13PM -0500, Jason A. Harmening = wrote: >>>>>> On Sun, Apr 30, 2023 at 08:09:16AM +0300, Konstantin Belousov = wrote: >>>>>>> On Sat, Apr 29, 2023 at 02:27:50PM -0500, Jason A. Harmening = wrote: >>>>>>>> On Sat, Apr 29, 2023 at 08:49:28PM +0200, Dimitry Andric wrote: >>>>>>>>> On 29 Apr 2023, at 20:33, Jason A. Harmening = wrote: >>>>>>>>>>=20 >>>>>>>>>> On Sun, Apr 09, 2023 at 09:35:22PM +0000, Dimitry Andric = wrote: >>>>>>>>>>> The branch stable/13 has been updated by dim: >>>>>>>>>>>=20 >>>>>>>>>>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D060699e9136975d51d3f726b9785bdba= c9a62ba6 >>>>>>>>>>>=20 >>>>>>>>>>> commit 060699e9136975d51d3f726b9785bdbac9a62ba6 >>>>>>>>>>> Author: Dimitry Andric >>>>>>>>>>> AuthorDate: 2023-01-14 16:33:24 +0000 >>>>>>>>>>> Commit: Dimitry Andric >>>>>>>>>>> CommitDate: 2023-04-09 14:54:52 +0000 >>>>>>>>>>>=20 >>>>>>>>>>> Merge llvm-project release/15.x = llvmorg-15.0.7-0-g8dfdcc7b7bf6 >>>>>>>>>>>=20 >>>>>>>>>>> This updates llvm, clang, compiler-rt, libc++, libunwind, = lld, lldb and >>>>>>>>>>> openmp to llvmorg-15.0.7-0-g8dfdcc7b7bf6. >>>>>>>>>>>=20 >>>>>>>>>>> PR: 265425 >>>>>>>>>>> MFC after: 2 weeks >>>>>>>>>>=20 >>>>>>>>>> This MFC of llvm15 appears to have completely broken the = Intel IOMMU >>>>>>>>>> driver on my stable/13 machine. After this series of = commits, any >>>>>>>>>> downstream DMA seems to produce an IOMMU translation fault, = which >>>>>>>>>> renders the machine completely unusable: no nvme boot disk, = no usb >>>>>>>>>> keyboard, etc. >>>>>>>>>>=20 >>>>>>>>>> The faults I see look something like this: >>>>>>>>>>=20 >>>>>>>>>> DMAR4: ahci0: pci0:17:5 sid 8d fault acc 0 adt 0x0 reason 0x3 = addr 26000 >>>>>>>>>>=20 >>>>>>>>>> It's a bit surprising to see a toolchain upgrade produce = breakage like >>>>>>>>>> this, but that's what git bisect clearly tells me. I wonder = if some of >>>>>>>>>> the IOMMU control structures might be defined as C bitfields = and the new >>>>>>>>>> compiler is emitting them differently? Also, was any = breakage like this >>>>>>>>>> observed when -current was upgraded to llvm15 several months = ago? >>>>>>>>>=20 >>>>>>>>> I haven't heard anything about such breakage, no. >>>>>>>>>=20 >>>>>>>>>=20 >>>>>>>>>> More generally, this is the second time in as many months = I've had to >>>>>>>>>> deal with IOMMU breakage on -stable. I can't imagine I'm the = only >>>>>>>>>> person who sees value in running with DMA remapping enabled; = do we need >>>>>>>>>> a dedicated DMAR-enabled machine in the cluster to smoke-test = changes >>>>>>>>>> like this? More generally, should we avoid MFCing high-risk = changes >>>>>>>>>> like this? >>>>>>>>>=20 >>>>>>>>> Since there were very few bug reports, it was not deemed high = risk. >>>>>>>>>=20 >>>>>>>>> In any case, it would be good to get the bottom of what is = causing the >>>>>>>>> problem, so is there any way you can isolate which code seems = to be >>>>>>>>> going "bad"? >>>>>>>>>=20 >>>>>>>>> For example, if this problem affects code in sys/dev/iommu, is = there >>>>>>>>> some way you can compile that part with -O1, or with an older = version >>>>>>>>> of clang (from ports), to see if the problem goes away? >>>>>>>>=20 >>>>>>>> I did try removing all custom make.conf settings (previously I = just had >>>>>>>> CPUTYPE?=3Dicelake-server), but that didn't change the = behavior. >>>>>>>>=20 >>>>>>>> Before I try further build tweaks, I'd like to ask if the IOMMU = fault >>>>>>>> report can provide guidance here? AFAICT all the faults I'm = getting >>>>>>>> show "reason 0x3". If I'm reading the VT-d spec correctly, = FR=3D0x3 >>>>>>>> indicates an invalid context entry, in other words there's = something the >>>>>>>> hardware doesn't like in the way the address width or pagetable = base is >>>>>>>> configured for the PCIe requestor. >>>>>>>=20 >>>>>>> I would start looking at the other direction: might be, there = are still some >>>>>>> left shifts for int32 values with the shift count > 30, or = uint32 with the >>>>>>> count > 31. >>>>>>>=20 >>>>>>> Also might be useful to dump each context entry on creation, it = is kept >>>>>>> constant after. >>>>>>=20 >>>>>> I did look over the constants in intel_reg.h, and didn't see = anything >>>>>> that looked as though it would be susceptible to sign-extension = or >>>>>> truncation bugs. In the failing case it's much easier for me to = catch >>>>>> the fault messages than any initialization message, so I = instrumented >>>>>> the fault handler to get the context entry from the dmar_ctx = object >>>>>> using the same logic as dmar_map_ctx_entry(), and then dump out = the ctx1 >>>>>> and ctx2 fields. What I see are messages like: >>>>>>=20 >>>>>> ... ctx1 0x10013b001 ctx2 0x103 >>>>>>=20 >>>>>> At first glance these "look right": the P bit is set in ctx1, and = the >>>>>> rest of the field looks like a valid physical address. ctx2 also >>>>>> doesn't have any of the reserved bits set, but in all cases it = does have >>>>>> AW=3D3, which would indicate 57-bit AGAW. But when I boot the = last >>>>>> working kernel, from the revision prior to the llvm15 MFC, I see = this in >>>>>> dmesg: >>>>>>=20 >>>>>> ahci0: dmar4 pci0:0:17:5 rid 8d domain 1 mgaw 48 agaw 48 = re-mapped >>>>>>=20 >>>>>> ...all reported devices show 48-bit MGAW/AGAW, so I would expect = ctx2 to >>>>>> have AW=3D2. I suspect this may be the source of the fault, but = I'm not >>>>>> sure how it's getting configured that way, whether it's an issue = with >>>>>> reading the capability register or something else. >>>>>>=20 >>>>>=20 >>>>> I can confirm that hacking domain_set_agaw() to always use the = settings >>>>> from sagaw_bits[2] eliminates the faults and at least allows the = machine >>>>> to boot to single-user mode. >>>> I see what's happening now. When I added the hack to always set >>>> sagaw_bits[2], I noted that the passed-in MGAW was still 57, while >>>> unit->hw_cap had the correct value of 0x4 (=3D> 4-level paging, = 48-bit AW) >>>> in bits 12:8. The problem is that sagaw_bits has agaw=3D64 in its = last >>>> entry. This results in dmar_maxaddr2mgaw() attempting a comparison >>>> against 1ULL << 64 in the final iteration of its first loop. I = suspect >>>> the new compiler probably determines that last iteration is = meaningless >>>> and simply omits it from the (probably unrolled) loop. Since the = "loop" >>>> terminates with i < nitems(sagaw_bits), the subsequent "allow_less = ..." >>>> case doesn't execute and we end up erroneously selecting a 57-bit >>>> address width. Just commenting out that last entry in sagaw_bits = fixes >>>> the problem. >>>> So, two questions: >>>> 1) Does any VT-d hardware actually support 6-level paging? The ca. = 2021 >>>> VT-d spec I'm looking at indicates 5-level is the greatest depth >>>> supported, with everything above that being reserved. >>>> 2) I'd expect clang to try very hard to error out in a situation = like >>>> this, but I see that sys/conf/kern.mk sets = -Wno-shift-count-overflow >>>> among other things, and more of them were added for clang 15. This >>>> seems like a really bad idea, regardless of how much of a PITA it = may be >>>> to fix these warnings. >>>=20 >>> FWIW, I've been working on trying to re-enable some of the warnings = that >>> were disabled for clang 15 in main. I'll move that one higher up on = my >>> todo list. >>=20 >> In this particular case, it doesn't warn about it though. I think = KASAN >> might be a better 'catcher' for this kind of error, or a KUBSAN, if = we >> had one... >=20 > If you've tried turning all the relevant warnings/errors back on for > this code, and clang truly doesn't warn about it, then wouldn't this > warrant a bug against upstream clang? This is a situation in which = the > compiler detects a left-shift overflow, by itself at least a warning > condition, and uses it to materially alter program flow. You could try, but it will probably be classified as undefined behavior. I guess the warning will only show up in a more full-blown analyzer. I haven't tried that. -Dimitry --Apple-Mail=_8AAB2DF7-0578-4C2A-A09B-84677789D39C Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCZFA5HAAKCRCwXqMKLiCW o+hGAJ9WQT+6SV3pPcdi8c/OZWlFdkQDmQCgiybouLUiZxuGlvEul8mPjb6TzgI= =DLM8 -----END PGP SIGNATURE----- --Apple-Mail=_8AAB2DF7-0578-4C2A-A09B-84677789D39C-- From nobody Tue May 2 12:20:41 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9fLK5fYmz48wDq; Tue, 2 May 2023 12:20: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 4Q9fLK5CWxz3thl; Tue, 2 May 2023 12:20:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683030041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uXOT0xGaHYqivs0iNlWLQumvjmypZ2FRGuOWLXnps2k=; b=NEYlfAQmtz/9QUrYA/YFf362kAldq8mHJaPo7tWg9297vob4GHH7/oDF+OqfHEVr2PUj2z 0mmtHLB+KljWJcxjjc7vnINnWCzNynTjkKoE8zkce9z8Pp3A4pOP0CHmIJVlgSt4b8BIdE duwSWrWV9r/LKLrb8IPhliZDo0oG6vkJgTrgOxCJqFShF0I+haNeGN0i+HdS1C1WLwWtv5 UqPEpzZBOSz2WpIyS/lh3PkmANlWauKalDF6Wq0n1ncGv1YK/IJBhOnY0WDk7D8INsyNh7 UpQwPOuJ9Zn9dOLd6jOmA+4d6TpJ2hnF+Gdw1R3XHkhFaBMTRNvNbD9HT5Rvbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683030041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uXOT0xGaHYqivs0iNlWLQumvjmypZ2FRGuOWLXnps2k=; b=ijsiHlnDL6DWEhB03lQXkhOLI6vKnNLYvGI/SZRjf0avr86hw/QPKE5mZxhjC5L4p2wpKU Aih3qaR9VLI0+Lda40GqrEwas2rnKxnlsUMRKT351vj8ZalzpKQL16gXkEyNUx4FZmemlW PFfZAqdiqq9o+Sl/GoQej23eRahd/yslLreXLDsArEbUiRBKzzFXZpOKLLKwlP4H5sFdQk yxGevVb4ffG6mI3ZFpy7+YyTEU+MLkdyrlZepSEAbXxkGByZXZnDwMK/Ay8r8UUku29Wxj 9ccrXToXFUWq1nc5VvBKh/862pw1mER60Udw35YxvBHUMvlnwg3lFRQBeJXGYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683030041; a=rsa-sha256; cv=none; b=pLCqCAH3/3ShF5J5vSIKnFjiCToDNKo0wgZ7nMnKqe8V9XDMK2tZf+zBtS5sdh0hVxeRgN Bk6BTAn+5/0S63crs+zqLUFSl1MBJIDSXdkd0IWVMtfDsFNC53VKPtsUdmuSP1IrTm39Ou YxVBEYOzrGkBb5R7Ip6TFpHzTuGCdI6pcV5sIMt5uw9FqvB6COthx950Qlp5CZ61mzEIez rJ446M8ItH1/0ZuQ+idGiecBJ9eIYM0PpQ3TV5U/NJf7lQZK0DCU5zwVdts7Bj8W2WhS03 BrxJz2JSeY/sD7bhqG2COIVacTParpnbCespFRYPSdIccNC2HYLp4MJCvZhQrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9fLK4JGSznGG; Tue, 2 May 2023 12:20: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 342CKfaJ067607; Tue, 2 May 2023 12:20:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 342CKflN067606; Tue, 2 May 2023 12:20:41 GMT (envelope-from git) Date: Tue, 2 May 2023 12:20:41 GMT Message-Id: <202305021220.342CKflN067606@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mariusz Zaborski Subject: git: 2de69df6f398 - stable/12 - mpr: fix copying of event_mask List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/12 X-Git-Reftype: branch X-Git-Commit: 2de69df6f398987cecbc5ac02b2183c561e0f220 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=2de69df6f398987cecbc5ac02b2183c561e0f220 commit 2de69df6f398987cecbc5ac02b2183c561e0f220 Author: Mariusz Zaborski AuthorDate: 2023-04-21 07:50:16 +0000 Commit: Mariusz Zaborski CommitDate: 2023-05-02 12:19:26 +0000 mpr: fix copying of event_mask Before the commit 6cc44223cb6717795afdac4348bbe7e2a968a07d the field event_mask was fully copied to the EventMasks field. After this commit the event_mask (uint8_t) is 4 times casted to EventMask (uint32_t). Because of that 24 bits of each event_mask array is lost. This commits brings back simple copying of field, and after words converting 32 bits field to the requested endian. I don't think we need more sophisticated method, as the array is of size 4 (for 32 bits version). Reviewed by: imp MFC after: 1 week Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D39562 (cherry picked from commit ea6597c38c77c7bfaae71259d8636cbb89add6a3) --- sys/dev/mpr/mpr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/dev/mpr/mpr.c b/sys/dev/mpr/mpr.c index 308c88112168..33afb7adf852 100644 --- a/sys/dev/mpr/mpr.c +++ b/sys/dev/mpr/mpr.c @@ -2795,8 +2795,9 @@ mpr_update_events(struct mpr_softc *sc, struct mpr_event_handle *handle, bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16); } #else + bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, sizeof(sc->event_mask)); for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) - evtreq->EventMasks[i] = htole32(sc->event_mask[i]); + evtreq->EventMasks[i] = htole32(evtreq->EventMasks[i]); #endif cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; @@ -2850,8 +2851,9 @@ mpr_reregister_events(struct mpr_softc *sc) bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16); } #else + bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, sizeof(sc->event_mask)); for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) - evtreq->EventMasks[i] = htole32(sc->event_mask[i]); + evtreq->EventMasks[i] = htole32(evtreq->EventMasks[i]); #endif cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; From nobody Tue May 2 12:20:42 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9fLM1CMbz48wDr; Tue, 2 May 2023 12:20:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q9fLL67s6z3tgS; Tue, 2 May 2023 12:20:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683030042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dqVMgIoRUiWnGQETenOZsfGar4NP+8/8XpiupNqJkWg=; b=LLfotNiLnZpuxy/InUNHDW45gVwXSKUVXTZw/F+SxOUyaMisK6EILrbPCbvNKtrokRk8HA ZqRqwjlZpo7Au+bh5H4rXuLJ0oujr5Yu171lLZxM7/O/aV6QUrfkdibeeejd33O7W8C/7d ouE7DbA0XxhN5pSxg0Ws41xTG/KnfJ6/l7TAKjqKRZ3xT6FZimUXx1xW4BdwY7OeGa+Jx2 c587GnJD2mbGx96BSoeOIFAP9GZVPe39UgnahfJmrTMzR0ZTWPXnnc+9NE7IE/nb9YRhWZ CXWvAJiO2WLdkajLw62Y4dDNRL78U+BzNgsClzPbSpyhokOL0sGS+IsXYtjjhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683030042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dqVMgIoRUiWnGQETenOZsfGar4NP+8/8XpiupNqJkWg=; b=mItCIar7KeQbzJ/4+B3lv02awxUylnuU598+trdfGMD93K5Mo+5w7kF8oL/bXz9w7oRv18 KjoZMr3RCQJLq6QsZfOWWiImZ9AKFCO5gDkI2Q7A9HXyD8OhCAEdgdtAlUO+fKZfQbKONz 9eVlAX8DPy3DMUnp6x3I5SR+MFTichljZRB5k3Z1tCdhSOj7rhD9gOH5dSa94gKO33HKWx ZOUug4fftM6PmrE8w9jJzGtYVn2h+syeo4AIzXEmVrsT+alKFBsK1xIFWoGKxD1cHv/SsM ikJp+UMWZPT4lGTKcqYAT6FL7FTAIEuoNTbEYgNmQR5nW+9n4Afr1lWZGDJGXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683030042; a=rsa-sha256; cv=none; b=YFkMwRNGyMjXWufZQI5dyRCe8lEMDBwvE2HQl8y0g0IGNEgvhSyZwJJPg/5hlmVEDTNsbd 1lJn61Y8c6YCx8quO0ZyOYyR91n0sKWXrSEqVB0SwB9QDFfkgfW4DhDnpDrzebC5n14so7 gvMnb4hqDWHq5dybY3pLVC7Er9PhFf9Ztr4la8L6m4baiuwJHWS+V0L+LoBpdfE5eMtovx WtGh/SpKaorq3HrmToIqy4zdP3elICVowAU3Qa68RDt1079rxPx8To+tE/ChgPBhqOMKlp cmQvSo4q79MUbQMKjqHyPv+/BhhFPm3NwZ3sp8vJsx750yGcFseRCXOg2v8pxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9fLL58jfznR7; Tue, 2 May 2023 12:20:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 342CKg7P067632; Tue, 2 May 2023 12:20:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 342CKgHs067631; Tue, 2 May 2023 12:20:42 GMT (envelope-from git) Date: Tue, 2 May 2023 12:20:42 GMT Message-Id: <202305021220.342CKgHs067631@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mariusz Zaborski Subject: git: 485005801104 - stable/12 - mpr: don't use hardcoded value in debug branch List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/12 X-Git-Reftype: branch X-Git-Commit: 4850058011041b5e3b1956cd76016f6cc50dc979 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=4850058011041b5e3b1956cd76016f6cc50dc979 commit 4850058011041b5e3b1956cd76016f6cc50dc979 Author: Mariusz Zaborski AuthorDate: 2023-04-21 07:57:38 +0000 Commit: Mariusz Zaborski CommitDate: 2023-05-02 12:19:35 +0000 mpr: don't use hardcoded value in debug branch Pointed out by: imp Sponsored by: Klara Inc. (cherry picked from commit 444c6615459efe2b015deb1cffc54fcaa3ea1fca) --- sys/dev/mpr/mpr.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/dev/mpr/mpr.c b/sys/dev/mpr/mpr.c index 33afb7adf852..562d629c7afa 100644 --- a/sys/dev/mpr/mpr.c +++ b/sys/dev/mpr/mpr.c @@ -2790,9 +2790,9 @@ mpr_update_events(struct mpr_softc *sc, struct mpr_event_handle *handle, evtreq->SASBroadcastPrimitiveMasks = 0; #ifdef MPR_DEBUG_ALL_EVENTS { - u_char fullmask[16]; - memset(fullmask, 0x00, 16); - bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16); + u_char fullmask[sizeof(evtreq->EventMasks)]; + memset(fullmask, 0x00, sizeof(fullmask)); + bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, sizeof(fullmask)); } #else bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, sizeof(sc->event_mask)); @@ -2846,9 +2846,9 @@ mpr_reregister_events(struct mpr_softc *sc) evtreq->SASBroadcastPrimitiveMasks = 0; #ifdef MPR_DEBUG_ALL_EVENTS { - u_char fullmask[16]; - memset(fullmask, 0x00, 16); - bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16); + u_char fullmask[sizeof(evtreq->EventMasks)]; + memset(fullmask, 0x00, sizeof(fullmask)); + bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, sizeof(fullmask)); } #else bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, sizeof(sc->event_mask)); From nobody Tue May 2 12:22:06 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9fMy3gCtz48wkh; Tue, 2 May 2023 12:22: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 4Q9fMy3Fs9z3vZD; Tue, 2 May 2023 12:22:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683030126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oJpv64Xrstpr5hBfu4kP5YuRnzEU8+78QMI5L2tUiVo=; b=Wh2Te2NGHZX/cHrtrzrZQHf+kldyVK8TGUszp9Fir8FgdVQIpChFG04+aTBtAp/IIavGfY K7Nchs1O2d+mXfsTr2kCtzU8Xs9elwa0XsGebmRWwnxBszgKUF1yiNbPDZRodtZ687OSSq qij00OBPr+yKE1aALNB+84PoplwMAVW14gZTAMoQCzi40Fcc68lQUN6nBZ2mEevGWtL2NR 1iF+rBDngT2ZjTyOIgKyqyhwGx3G80b472n89TDLX5cfqHqxwQYdhjjeFvz+5jRHy3A8HD IGj+/RNWslGo6Vi/VfHnK/TYicpJRcHyd8FV7PhN2WnVW8jczLfTi3DBndyauQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683030126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oJpv64Xrstpr5hBfu4kP5YuRnzEU8+78QMI5L2tUiVo=; b=Rbg2AE3joJ2FPsi32hRSSpT6GNwQ2fXYOhDlQjZ1ww3M6CDv5RVkAly6y6nckFa9gn8Wtw zBrKsgYDhe0Swfe9LSxO5T+HxMha3RiCF3ffb/XJNreY1I9djm4x9hMME93KJ0zisDBA0A Txr0gDAotmhGwxmq4QXbi95jR+fG7UEAI4L+hjkcChzrQ1XNm5gRNbo83PSFs1IBjEOBn5 RS2RBn4urAvDGvjYeafrle1zp5YFIwZUPouYhDRHw/KJL3nzTkBwPP/hs2THLONQ6O/7OH UBZcACNsrqTK4xK5Wl9cC9x1VwVxDw8z074wKvkKwFjB/anbuRlU2x4YAOPl+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683030126; a=rsa-sha256; cv=none; b=cee95fEaGZZ7n9rtB0jsxn5yqH5VOGvrbOAoLDpmx5rub4A9xl6uGaeK8TGl+Nqocltwfv rio2sS8JA/hP7atSxHRF4tHCCu48PHT8kHFmB9nMHesAJvBeCQIK6hKJ9MBhG3/Sjucc52 Hjll6KRQ9z98cwjavNVEulhmbdewCM0kIdA43aQd8mgRco0NhRd1R7hB4/c5zjRMJOTJEf fdPAI9r3w/k04NXTb+X0hmj4kDom9HtWzSqDiMZ1epU+K8dXuj1V5s7bts4vOWR7K9Mxnn XJoNnSeYyQUKA2MI44ELW4q8uuLLj+Fiz+5OIZF4Tjd+CtvtXqdqZsX3vsH59w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9fMy2JxyznJH; Tue, 2 May 2023 12:22: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 342CM6jb073118; Tue, 2 May 2023 12:22:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 342CM68D073117; Tue, 2 May 2023 12:22:06 GMT (envelope-from git) Date: Tue, 2 May 2023 12:22:06 GMT Message-Id: <202305021222.342CM68D073117@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mariusz Zaborski Subject: git: e7a3a08febd0 - stable/13 - mpr: fix copying of event_mask List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: e7a3a08febd01c95b74185bb971ec29cca64b8e1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=e7a3a08febd01c95b74185bb971ec29cca64b8e1 commit e7a3a08febd01c95b74185bb971ec29cca64b8e1 Author: Mariusz Zaborski AuthorDate: 2023-04-21 07:50:16 +0000 Commit: Mariusz Zaborski CommitDate: 2023-05-02 12:21:35 +0000 mpr: fix copying of event_mask Before the commit 6cc44223cb6717795afdac4348bbe7e2a968a07d the field event_mask was fully copied to the EventMasks field. After this commit the event_mask (uint8_t) is 4 times casted to EventMask (uint32_t). Because of that 24 bits of each event_mask array is lost. This commits brings back simple copying of field, and after words converting 32 bits field to the requested endian. I don't think we need more sophisticated method, as the array is of size 4 (for 32 bits version). Reviewed by: imp MFC after: 1 week Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D39562 (cherry picked from commit ea6597c38c77c7bfaae71259d8636cbb89add6a3) --- sys/dev/mpr/mpr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/dev/mpr/mpr.c b/sys/dev/mpr/mpr.c index 6f54b1f57950..c105174b0e21 100644 --- a/sys/dev/mpr/mpr.c +++ b/sys/dev/mpr/mpr.c @@ -2764,8 +2764,9 @@ mpr_update_events(struct mpr_softc *sc, struct mpr_event_handle *handle, bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16); } #else + bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, sizeof(sc->event_mask)); for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) - evtreq->EventMasks[i] = htole32(sc->event_mask[i]); + evtreq->EventMasks[i] = htole32(evtreq->EventMasks[i]); #endif cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; @@ -2819,8 +2820,9 @@ mpr_reregister_events(struct mpr_softc *sc) bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16); } #else + bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, sizeof(sc->event_mask)); for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) - evtreq->EventMasks[i] = htole32(sc->event_mask[i]); + evtreq->EventMasks[i] = htole32(evtreq->EventMasks[i]); #endif cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; From nobody Tue May 2 12:22:07 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9fMz4RRnz48wj8; Tue, 2 May 2023 12:22: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 4Q9fMz3mJ0z3vML; Tue, 2 May 2023 12:22:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683030127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7p0xH60o2FgIxavuNVRqmRDMdOh9qtrBBiNYgBFhyLU=; b=QQWfP/bYmFpN+Ckgs2hkx915/iDMi8JwU+M9JsadniO+KIQ46VgXYN+7Ihkk5nqu5x+qdC 3h8qNwsqb2o8hbj0d0ujZZDyTF2oTBWI5vdU3FaxpjZImyLqF2c/8JtTmDpSon895F51I9 j5Tv/Rnzad/DXe1aDv89/iRXW2W1/Sf2mXIMbdzNcon5iBm6OMRKtue2raa5R/YOb+64Of co00TxHslG9I0Hl2p9z/hwmRuCMBSAD35hKgesy/cbYANnh4y+L1Bp6QzMSYxYeR/wbd2T BtLouSa6qhKKw3wYCmIaleupz4LWTpCPCDs+qM/1wUSGK0zHxAQdQsDDl5hMcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683030127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7p0xH60o2FgIxavuNVRqmRDMdOh9qtrBBiNYgBFhyLU=; b=OvS3XzUeqCq0mNGQNtaE4Ejck9dmSy99AcH/wbfjgdnMvvWmB1xp5/2wYXh+wEDaJn6qIV BjnUDOQK/2sTwTVApc+T99ATAzKN02HfNeyc0ytI06skA1pSoD62YJoSjlnI97h4X3ocXR w+i6XK8X42iRSJZRTjszw9Fei3L1rgWRRwCw5+Ie96i48W3fmoTW6Z671lRxyJGUsTjB7D 2YYjCEEXwYSQiefGW6TAavZNy8fTgZJsof6S35DWHtV3C15w3AnXMaxSJjg3Kamz5inhpN NQax0hEzsDPe3n2awoqXs6S3kYsnH5D9N9S5oYb+wOw0W/Pw3Lix+BTf+cxf5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683030127; a=rsa-sha256; cv=none; b=L+gLs/TbQKQsWz/FqNCABQARZav8OvIrMi806HuS/YwVnkEmbPumJ8rCMgMnWBIt4bwIbM CI89qnwcrFzuaso4S89fXTbBkep3WauzbBjHSXraljaw6Nw5Son1JvmXfvZvneLLmtIbdx DsF7GcQRKnRLF515M7kBIpL9jlB5iWmfpg1NSQ/gm5kXwr1KycS/WiK0Q7HCm6rRSDsySs ZES61LStNqCziHIM6pohkcgfJtqRIKOsE/dlG1NIWGXDjxGU0X69GJpBW1plA8JycmQLLl C0nKW42P00UgO7i3PJO428lu3AD5vHXbb5xgmPy4SwF0288qw2+i4ftgrG9I5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9fMz2kBwzn6y; Tue, 2 May 2023 12:22: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 342CM7XP073147; Tue, 2 May 2023 12:22:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 342CM7DA073146; Tue, 2 May 2023 12:22:07 GMT (envelope-from git) Date: Tue, 2 May 2023 12:22:07 GMT Message-Id: <202305021222.342CM7DA073146@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mariusz Zaborski Subject: git: 834fdebb56fb - stable/13 - mpr: don't use hardcoded value in debug branch List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 834fdebb56fbf9ae111f5da91683fea5ddcebe08 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=834fdebb56fbf9ae111f5da91683fea5ddcebe08 commit 834fdebb56fbf9ae111f5da91683fea5ddcebe08 Author: Mariusz Zaborski AuthorDate: 2023-04-21 07:57:38 +0000 Commit: Mariusz Zaborski CommitDate: 2023-05-02 12:21:48 +0000 mpr: don't use hardcoded value in debug branch Pointed out by: imp Sponsored by: Klara Inc. (cherry picked from commit 444c6615459efe2b015deb1cffc54fcaa3ea1fca) --- sys/dev/mpr/mpr.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/dev/mpr/mpr.c b/sys/dev/mpr/mpr.c index c105174b0e21..35d59b43a011 100644 --- a/sys/dev/mpr/mpr.c +++ b/sys/dev/mpr/mpr.c @@ -2759,9 +2759,9 @@ mpr_update_events(struct mpr_softc *sc, struct mpr_event_handle *handle, evtreq->SASBroadcastPrimitiveMasks = 0; #ifdef MPR_DEBUG_ALL_EVENTS { - u_char fullmask[16]; - memset(fullmask, 0x00, 16); - bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16); + u_char fullmask[sizeof(evtreq->EventMasks)]; + memset(fullmask, 0x00, sizeof(fullmask)); + bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, sizeof(fullmask)); } #else bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, sizeof(sc->event_mask)); @@ -2815,9 +2815,9 @@ mpr_reregister_events(struct mpr_softc *sc) evtreq->SASBroadcastPrimitiveMasks = 0; #ifdef MPR_DEBUG_ALL_EVENTS { - u_char fullmask[16]; - memset(fullmask, 0x00, 16); - bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16); + u_char fullmask[sizeof(evtreq->EventMasks)]; + memset(fullmask, 0x00, sizeof(fullmask)); + bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, sizeof(fullmask)); } #else bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, sizeof(sc->event_mask)); From nobody Tue May 2 17:14:44 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9msd2rXSz49CCt; Tue, 2 May 2023 17:14: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 4Q9msd0QCYz3lkg; Tue, 2 May 2023 17:14:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683047685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AQ+qPgtmJl02weQUt5tImpKbNf+TBfxRLMFmpxE/S7Q=; b=V+Ht2RJTuuxVlTpmpmrKQb0DrCabftxwhN2UPV8w0k2RRNLiRk+DFNr8CvBZAfUO4+uAoU kWDdxYMcJwVGRpa2q1IxUuph+sqj3e5pLpJ/Z1+mVVl7uZEzQJQ1soOWrZS7At2iBbYQd9 NnHS61a4JYSsGYX/RSE0DEAEt+EuwUd2+nGkGTvKN1Y8zOMCXymhOM8z7j+zBBmoKnAHrH 0wF6wBFWWQVx1iwKOdzeKpWJep6UanJHWxkptrh+0OhTyaBsO/NC8y9o5McGTvEcYrHgpi Wk0EGRtt05C2yeDsiasBByQlMT9IhV9Sr0tvCIsCFKGpoGBi+b0kJhXnfkK+Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683047685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AQ+qPgtmJl02weQUt5tImpKbNf+TBfxRLMFmpxE/S7Q=; b=Av6t9iqiQ/qdo3LMxuzkU5OXEuJ8B/aWqmPlsm1Hx6qJ7PtofkbEphicoQmk3eyOR0P5wp tPOqAZ0iT/AbnnFe6ItTUh+FyDnFvn+JH2CF3rydMqMwoDM1qRuR8MQghY0SHX0ITPeaHW DR3eUQSFb0ksx5/JNEuKU66AVXkLJs45oOuIzKQAlYLJ74HkxSBhUWIy+7QwrmaObbt5XB SYai4L307QZX71difQdpjR5LOy6I+5lvhASYk0lj/rOJBDGGUvadj2Xk55lbOsasVyUp7j 6FEFQIbFvyx1bWrtYdqpsGGmlXQ86QBaLCxjFCycbZHOUBuhXnuSwDlND2hq4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683047685; a=rsa-sha256; cv=none; b=S6npEA2ZpuMLzkZFiVyC53hI10euZRjmLiIDvUtYhxpaWNFYpiBqBYLhkNawmm2Ca/EsCR 3L79RKgGMjve8XAMYUL2YdCdY8onn/6R0xxNdv2Q0aJJqaRWoRHiM7F0S2+RDaLjQqV2jI /jb5nX14COylVbd/vl0+SGPfjmT5WJl0cnxBEFkoeWqQ4vFIWfsJXyxafbqGuP09GJb7B5 AU3bFxB1UE4PrAS0VhSFRInv6ZGB/WndoIoeJvCWSKBtoQkW1vUgDYA/Uiqqweaj8wo+7A OUbfZNpfNnr4Adcw0v0Tw7QUrSAzHEJ5KNkqA1+ghmED/TiclV3076E1BPnbYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9msc6c5szwVN; Tue, 2 May 2023 17:14: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 342HEiPV060992; Tue, 2 May 2023 17:14:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 342HEiUY060991; Tue, 2 May 2023 17:14:44 GMT (envelope-from git) Date: Tue, 2 May 2023 17:14:44 GMT Message-Id: <202305021714.342HEiUY060991@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: f5db29b8ceb5 - stable/13 - libpmc: Use LIB_CXX instead of explicit LDADD to link a C++ library. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: f5db29b8ceb59f2ebb6fb836534f5f4a770f2c65 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f5db29b8ceb59f2ebb6fb836534f5f4a770f2c65 commit f5db29b8ceb59f2ebb6fb836534f5f4a770f2c65 Author: John Baldwin AuthorDate: 2023-03-23 16:31:29 +0000 Commit: John Baldwin CommitDate: 2023-05-02 16:49:38 +0000 libpmc: Use LIB_CXX instead of explicit LDADD to link a C++ library. This uses the C++ compiler as the linker instead of the C compiler letting the compiler driver pick the right libraries. This is a no-op on main and stable/13 but matters for stable/12 where the current logic breaks for external GCC since it tries to use a non-existent libstdc++. Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D39197 (cherry picked from commit c6b3f47fedd3f94f74cc4f7c40761b1d0e777f17) --- lib/libpmc/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/libpmc/Makefile b/lib/libpmc/Makefile index 2ef0d288064c..65ddb7f48b59 100644 --- a/lib/libpmc/Makefile +++ b/lib/libpmc/Makefile @@ -1,12 +1,11 @@ # $FreeBSD$ -LIB= pmc +LIB_CXX= pmc SRCS= libpmc.c pmclog.c libpmc_pmu_util.c libpmc_json.cc INCS= pmc.h pmclog.h pmcformat.h CFLAGS+= -I${SRCTOP}/${RELDIR:H}/libpmcstat -LDADD+= -lc++ .if ${MACHINE_CPUARCH} == "aarch64" EVENT_ARCH="arm64" From nobody Tue May 2 17:14:50 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9msl5B81z49CXS; Tue, 2 May 2023 17: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 4Q9msl1VM4z3lwM; Tue, 2 May 2023 17:14:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683047691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FiDt0BlQW4lNbqd5trpJ66R7cQUFOiAG01GtooSpzAk=; b=Fjn2spV43bFYArHP3IBfT0LJvvhsaayfaXSrCHslklRypEnzy1phcJ2bb9PVrhlfQgHDe2 sRYmUHn5qMxMjnKc9vlnUUOyp5SMrhjnpFRFF7rh3v3tRRh0uO4tvIwIas3vjX0zBKicYV KiZvmisvpQrO+tndbkX6DRTXPJU7WY6IhIDR3QajSiPf9YX55/sjNXqG5NVeWhZQcsGabv jeSbNmttvYcPqM+tSAwjjZsXHLknTJlWxM9gTxIQgrDMUb7THSZG7qVsZeauuFG+WQpnsb wLD5dDZ5UF0oRNAeEQiuxp68kyVeTrs2e+7gH6rppf/YtC6+l3JX1Lwrc6H4hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683047691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FiDt0BlQW4lNbqd5trpJ66R7cQUFOiAG01GtooSpzAk=; b=f/aW9WHeXQHiTcnDl72Eg/di7wNf+0Yax7xoXL9ybV9XxzbTmMDAvA0Ua8d3V/pAZdN7KH mIK/UUzez15oZcq2uw7MJiNuAxjQuUZS/DJdGSzUad2ILouReFVBrA+KRsRDrsWmVqef1o 4HyJ7pllTwTijBZ+7zDwp5vSaBnesYn3wZbx/rroiMvecCD0khz39v0/jLXmAE2u/KfLmA rkPrhfYR8Yd1js4M8uqtL2abVDsywJqYKe7rflVDLbVwcHqRdc8pBninu3Lv5APrlXY6kl QpE6zTCAgS4CSntrIEJDJaBqE1DBBnllnhv/f8dtsr+Pm40bodnwmDwMPnngXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683047691; a=rsa-sha256; cv=none; b=t7Gd0OJnsfRA0cI7iHTOwnMtzDcYUP3Upcuxiusma91XOEKdRKaeZEyKgR08FUm6psdFTA wLxDGKRRaImSVIsl030R6Z6kTF92uZrGn6bj4xvWgWQzEQCylnhljdY44jcs8FIEjRaiGx SjSAiZtnKnKBOzyGHthmrrA+D5I+4nG6W4+/iAlZ4jDtnLxOAuoTBVwKAH16WhKyzHTeXJ EbqQ8WH0kPJlck9hGI6IuWMnPvBC3IevVEF4eoHogN2J2cW/4BTTyUC8TaeFqnK3v1sCpU ezo12t5Cu2H2ylj2nudwmglrzT6HmWhP95A12UFt7c79hT6HKOyx7vF8vsZ6PQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9msl0XYKzwxr; Tue, 2 May 2023 17: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 342HEoSF061121; Tue, 2 May 2023 17:14:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 342HEoEJ061120; Tue, 2 May 2023 17:14:50 GMT (envelope-from git) Date: Tue, 2 May 2023 17:14:50 GMT Message-Id: <202305021714.342HEoEJ061120@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 076116b88474 - stable/12 - libpmc: Use LIB_CXX instead of explicit LDADD to link a C++ library. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/12 X-Git-Reftype: branch X-Git-Commit: 076116b884744947ca33e6a8ff1007bf260614af Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=076116b884744947ca33e6a8ff1007bf260614af commit 076116b884744947ca33e6a8ff1007bf260614af Author: John Baldwin AuthorDate: 2023-03-23 16:31:29 +0000 Commit: John Baldwin CommitDate: 2023-05-02 16:52:38 +0000 libpmc: Use LIB_CXX instead of explicit LDADD to link a C++ library. This uses the C++ compiler as the linker instead of the C compiler letting the compiler driver pick the right libraries. This is a no-op on main and stable/13 but matters for stable/12 where the current logic breaks for external GCC since it tries to use a non-existent libstdc++. Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D39197 (cherry picked from commit c6b3f47fedd3f94f74cc4f7c40761b1d0e777f17) --- lib/libpmc/Makefile | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/libpmc/Makefile b/lib/libpmc/Makefile index 1e204e13fdb2..973ce5a28687 100644 --- a/lib/libpmc/Makefile +++ b/lib/libpmc/Makefile @@ -1,19 +1,12 @@ # $FreeBSD$ -PACKAGE=lib${LIB} -LIB= pmc +LIB_CXX= pmc SRCS= libpmc.c pmclog.c libpmc_pmu_util.c libpmc_json.cc INCS= pmc.h pmclog.h pmcformat.h CFLAGS+= -I${.CURDIR} CWARNFLAGS.gcc+= -Wno-shadow -Wno-cast-align -.include -.if ${COMPILER_TYPE} == "gcc" -LDADD+= -lstdc++ -.else -LDADD+= -lc++ -.endif .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" From nobody Wed May 3 00:29:23 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yW81z8Zz48NVZ; Wed, 3 May 2023 00:29: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 4Q9yW81RpPz3lKq; Wed, 3 May 2023 00:29:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gmbn/7BYd6mu8BG8C3WrIc7Fo9A0qn9/lxeNQxZt0FM=; b=mslaGhzm4gq0vkcI4Gi3Lgt1ttNyOjAySE0pj2oB5EmAW44IquKgwMat+uLytIvVbF9xw5 Ly4NAe0We743gjfhTwclSkQYMXnKLroykVfxBZwCzynVy7s1xiwweBnWSwvaPB1WvF/DJI X3oKoqKQ8kY1XagdRkoZXOZkAKPTZgLYB0a1Dsm1dskZp1ImIhzDQJRxDdkDcUxt/wxowR Y11nso/WK8YuAo2iQsBebuOWVVtWpZClGuWMWovkLKxFTYSsqgVx2RwuB4C6Oc7HvJF/Cu ZGDSkd8jCGNrd9894RMEvjTOsc2DNZiW6CxxUd/QZVmMd8WB0QrMYmjoeWpdMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gmbn/7BYd6mu8BG8C3WrIc7Fo9A0qn9/lxeNQxZt0FM=; b=k9wNIS2NcqRoY5+y//PlVRQB5Og4u9qUEVqVe3gtcWhnNZ/gCfNnGF14CUAzTUbt2eaVVy m+TAb8TppS58+dG1alzgOTcA21Z1cJC4S+xvb4MGrgNn/PfzQktcriCr84OhCDceWiriF8 6oXA7BTtDSQZKSHbEY+j3kOxQit7pKygsV3hh/R1aOxwQFQZjrKmUBRMzzZe0cjmOzqY8t BxYqMVVhP9Tw1qFBlJINmdbI14O/lKRo00oUt6rVUibtdwSbcVzVCnsE+NXkreUPoyM+zM f1ORMH16HHuD2LZYg72zZHul5J3G2icEuR18vaR+fqQA41E4UK8aM8PdVNr3jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073764; a=rsa-sha256; cv=none; b=TuWDs4YLVgn/mxFTzepo7btqyzq9VttOP51AFvB23HYPd/uwK6tkVzpgEYm1+jKSAplBVa Z2V5eOnfEvlnKYzibczR7VXqgW5ULz1+pkm8PYvNtfY3wH319UG/9AwUT5kfEt9Krz483N psfwyTDPOSm2mu2I52S8PRA+hy1W56uPN60G89CSSfCpMxnXeHuGooQD4sNrPW2CSz5xCv xQY/56L06qv0bOiBYVsNArum6oCcEgdQOjUe5IA3Yszum2XFwLDTZc/Ymk2WW740iqMKgW u/f3W+f5gHH7vQS3KCOGXiRgkoNMAky56/sFTgdyFyz8fXTaNw/JZtEfP7wGEA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yW80WNBz189C; Wed, 3 May 2023 00:29: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 3430TOjn071688; Wed, 3 May 2023 00:29:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430TNZt071687; Wed, 3 May 2023 00:29:23 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:23 GMT Message-Id: <202305030029.3430TNZt071687@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: d854d8122288 - stable/13 - ncurses: Backport a few fixes for GCC warnings from version 6.2-20210220. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: d854d8122288dfa6b0245774ee37b02541c9b989 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d854d8122288dfa6b0245774ee37b02541c9b989 commit d854d8122288dfa6b0245774ee37b02541c9b989 Author: John Baldwin AuthorDate: 2023-05-02 23:38:54 +0000 Commit: John Baldwin CommitDate: 2023-05-02 23:38:54 +0000 ncurses: Backport a few fixes for GCC warnings from version 6.2-20210220. This is a direct commit to stable/13. --- contrib/ncurses/ncurses/base/lib_screen.c | 2 +- contrib/ncurses/ncurses/tinfo/lib_tparm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/ncurses/ncurses/base/lib_screen.c b/contrib/ncurses/ncurses/base/lib_screen.c index 164356dc41de..f46e17447127 100644 --- a/contrib/ncurses/ncurses/base/lib_screen.c +++ b/contrib/ncurses/ncurses/base/lib_screen.c @@ -67,7 +67,7 @@ MODULE_ID("$Id: lib_screen.c,v 1.97 2020/02/02 23:34:34 tom Exp $") * format. It happens to be unused in the file 5.22 database (2015/03/07). */ static const char my_magic[] = -{'\210', '\210', '\210', '\210'}; +{'\210', '\210', '\210', '\210', 0}; #if NCURSES_EXT_PUTWIN typedef enum { diff --git a/contrib/ncurses/ncurses/tinfo/lib_tparm.c b/contrib/ncurses/ncurses/tinfo/lib_tparm.c index 400cd31996f8..7a53dff3addd 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_tparm.c +++ b/contrib/ncurses/ncurses/tinfo/lib_tparm.c @@ -341,7 +341,7 @@ parse_format(const char *s, char *format, int *len) * may be cases that we cannot see the explicit parameter numbers. */ NCURSES_EXPORT(int) -_nc_tparm_analyze(const char *string, char *p_is_s[NUM_PARM], int *popcount) +_nc_tparm_analyze(const char *string, char **p_is_s, int *popcount) { size_t len2; int i; From nobody Wed May 3 00:29:25 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yW93Vrfz48NVb; Wed, 3 May 2023 00:29: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 4Q9yW92r6lz3lXw; Wed, 3 May 2023 00:29:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jW7rRZbDKipxUwNV92zzefObIqD+Yul024lvRsl9sOY=; b=aMKDVDFOSd0ov57c5B8dJPSnRDme05rrhNWYBqf7/Mmc3hcybaLqz/3KReLBy62x08ohIS 905hBqa5GTvTO4AU0dhSXvJkbMzVgFLylFvHuZwi7p+h1Y/Qa0vLla7RROBNHpZh82HntU B6dgi3KoX+8/bOYerr0uOVvbEvBw6MnltmZdhPI7U77eaaiza3uT0GnS78d3/N41sf/dHX hF50BBJoW/A+mfkHoUwMTIgCVfoopvk46jdquTNWkKcLlrlbgWUyD0aQ1l0mzADtOy5VLV 6BviPjrFG6FDG3I23ZX596jdh6Jj5alz2ivfBJPtMKlTv4uqIdEPh9cQZDt0uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jW7rRZbDKipxUwNV92zzefObIqD+Yul024lvRsl9sOY=; b=evjUSSq/X4GOCBLOnWC911lygUDFiv2qqOfK6YkQf2h43pq3EM49/Ai7OG02Yy2kLtwQ9L ILF3qnM2nHBa106koY+/2Z9oUjw4jg9QGXTYgWLZO08MfqBfqqXd+jQ1dfg9Jmvuc4s7OB KSorG+u2ttnnuPz6uInQtdPVsFpSthoeE+1z5rcU25RULibHmbeJ4J1mn8DK7V/3dEI3Bp iT8ZgYYlaWwRMpvpFpjptjVyzogp14XFRMoq/OqiAwFFCd0dMbmQFhg7pfoHumm4ogsvXs gyWgcLnvOMD/xWvjaisG8nP/UA1r374o60K4jnpKE4jaEH68vmx3aold6e7TvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073765; a=rsa-sha256; cv=none; b=eFfuGOMdYjKOZlZZ/7DVIjmdznJZVa5vmsr+dHqKGlkXhrsUXQKKAXEb7yJmsjSwJQf5sI UiOzx2Z7CzUCszqfSzkbI0aHjqBPQKXkoqgvG9bpzG6itfNe8nPwBGh7zREG1xuT/zP0OG oXClHfB3ExMlOWNXuQUOHL29BtyPsceuvrZs199rUTJcD8YQksEN+pMJSP5rTi59MHo4cc sibYENH3VTHGn4J3y73w7m+18Kr/QwFiuB3xvDp1oMjvTAg1ua1/RFDIBW0JMlUc/V1V55 1wLut/9BOxVBejt/34nxMM3JcNjOr9+j9pXJnc7DLPWFOFwgsrqvC4xLQBe0Kg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yW91q1Tz182c; Wed, 3 May 2023 00:29: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 3430TPwQ071723; Wed, 3 May 2023 00:29:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430TP8C071722; Wed, 3 May 2023 00:29:25 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:25 GMT Message-Id: <202305030029.3430TP8C071722@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 3c8aec53a93f - stable/13 - libirdma: Drop clang-specific -ferror-limit. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3c8aec53a93f9d5d21a47ae8be5c52a37059fe4d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3c8aec53a93f9d5d21a47ae8be5c52a37059fe4d commit 3c8aec53a93f9d5d21a47ae8be5c52a37059fe4d Author: John Baldwin AuthorDate: 2022-10-03 23:10:42 +0000 Commit: John Baldwin CommitDate: 2023-05-02 23:39:52 +0000 libirdma: Drop clang-specific -ferror-limit. This could use -fmax-errors on GCC, but tweaking the error limit is unusual in the tree anyway. Just remove it. Reviewed by: erj, imp, emaste Differential Revision: https://reviews.freebsd.org/D36808 (cherry picked from commit c3a3d1fd6c7007e7088936e14fd9b4944b3a3054) --- lib/ofed/libirdma/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/ofed/libirdma/Makefile b/lib/ofed/libirdma/Makefile index 1280b8a6d7bc..368bd536c587 100644 --- a/lib/ofed/libirdma/Makefile +++ b/lib/ofed/libirdma/Makefile @@ -18,6 +18,5 @@ irdma_uk.c \ LIBADD= ibverbs pthread CFLAGS+= -I${_spath} -I${SRCTOP}/contrib/ofed/libibverbs VERSION_MAP= ${_spath}/libirdma.map -CFLAGS+= -ferror-limit=1000 .include From nobody Wed May 3 00:29:26 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWB3wmgz48N7F; Wed, 3 May 2023 00:29: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 4Q9yWB3P57z3lNZ; Wed, 3 May 2023 00:29:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073766; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ih4twoVq2tpR60SiDlDVdHedC7pDZKJdsxoJyovuVUM=; b=xoIg/LmHv3Mnca4GS7kMmLfu2evBwEmJ1XPopPaYAZr8KCGdIAb6EJFzoOaTHTnWtGGkMo OMBofgWEpMQiXLPUdMcTqL4vtBOhw9GVwSHKgRZ5vOeA4oaGGFg3WA2VoWmBiGWMReJULE gV6OjyxC4JNOE1IdOMhiLQ87EC0L3Eo5RKEwMiG+6sgyQCIBEpfN3ZBtxTPQoEX2mcwD3D P/5c47r2XagSxorcmpSZk91fJh3H7oYTGbGThb+aa7kRF9BmbeNspgBAYD+6OJJSkcnwOO HmHU4ELU4jybMn29tYjtRlYky4CXfiLP2BHsKFOlOUm3KmmkloUJfp7zoZR6Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073766; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ih4twoVq2tpR60SiDlDVdHedC7pDZKJdsxoJyovuVUM=; b=utELGyAXeIwCVvlWiG1P2swZs69SD3lk22G276q1p5Tc8Rdk4H5pVtMLQqMSAl3hbQZqtd jeo0KPQnZf5yTfBYbWazWYULbv8lED0YAzRzMa7wvHzpfz0K3SEoY3RJlsZsDiSrl05uu8 xz5WBw9xb0S/HIpHhoY7OcW9U8HQIiKskKI7i1H0R4E8+KULzIRwsldwHoONP30P4sIQbD qftcmd0mQH6xqy+5LEzFpsG6o+THu3ob6Pea/bFA0fbGBqpg4FMDuPhE8IjS0kBAy8Ovt2 Y4eaRxdYmR0K4SUGNPeEoQY7ZxSJb99/TMzPGuRT4V2QmXlTU+yyEQOk6fUQqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073766; a=rsa-sha256; cv=none; b=sRTKKij24hsVvF5kkzz3wovc5/E/y19Czn8fdTEwmDjiw2VhqTtLRUvHOPoL+MPtQ29JO4 yr5FkDNzbDLGhmjGk2wJCYXNIbTK1n/SIVPIQzbLmEZmMsCoy/87kBo3LANmGdKinA+Aaq 9UUrah94+z1YDmVTXsjaKZm5H2iXEgs1Y6Jo61pIfCe2jKOMtpKKb4BskN8kCTgZ7vYYtt RyOn44ZqPorgpNJxVYyfafeoNJwDSgVqjVknlCTl0Z52aX88IexdzAc8sGa7pWTvorxY/X 59nB4tNu6DYAxg4ICvqnzMipanrOqqaVoQ/lzAzi19FhjBRzUEz/mmvLt6FFMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWB2SQ7z189D; Wed, 3 May 2023 00:29: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 3430TQkr071742; Wed, 3 May 2023 00:29:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430TQYi071741; Wed, 3 May 2023 00:29:26 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:26 GMT Message-Id: <202305030029.3430TQYi071741@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 773bb4c45cac - stable/13 - Use __freebsd_kprintf__ with GCC 12+ similar to clang. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 773bb4c45cacfb2bd654cf3896f7875c5ee3f62c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=773bb4c45cacfb2bd654cf3896f7875c5ee3f62c commit 773bb4c45cacfb2bd654cf3896f7875c5ee3f62c Author: John Baldwin AuthorDate: 2022-11-22 16:36:12 +0000 Commit: John Baldwin CommitDate: 2023-05-02 23:41:50 +0000 Use __freebsd_kprintf__ with GCC 12+ similar to clang. (cherry picked from commit 5115511ed4941684bc82b8a3c4b95e9a8931b940) --- share/mk/bsd.sys.mk | 3 ++- sys/conf/kern.mk | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index cb4399610d0e..ad359727c32f 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -238,7 +238,8 @@ CWARNFLAGS+= -Wno-system-headers .endif # gcc # How to handle FreeBSD custom printf format specifiers. -.if ${COMPILER_TYPE} == "clang" +.if ${COMPILER_TYPE} == "clang" || \ + (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 120100) FORMAT_EXTENSIONS= -D__printf__=__freebsd_kprintf__ .else FORMAT_EXTENSIONS= -fformat-extensions diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 87e788666efb..53eb49c95c4b 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -101,7 +101,8 @@ CWARNFLAGS+= -Wno-format-zero-length # to be disabled. WARNING: format checking is disabled in this case. .if ${MK_FORMAT_EXTENSIONS} == "no" FORMAT_EXTENSIONS= -Wno-format -.elif ${COMPILER_TYPE} == "clang" +.elif ${COMPILER_TYPE} == "clang" || \ + (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 120100) FORMAT_EXTENSIONS= -D__printf__=__freebsd_kprintf__ .else FORMAT_EXTENSIONS= -fformat-extensions From nobody Wed May 3 00:29:27 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWD02bKz48N7K; Wed, 3 May 2023 00:29: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 4Q9yWC4SCYz3lZ2; Wed, 3 May 2023 00:29:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J6JEf9hzIQ4EFXWXg3VY6MQvdA+BQIo6J9IP4+JAmzw=; b=j7xAsoYNyMY18uikj9ekymgpqn0E7ag86m0VW9Re3WE7tWRjFOEpoNQ5g8e6sUPVtJlns9 orCLhgnHUOwZPHwmwbJa2kufjNSBiCmGuZaQCy9ttS6xToDICYs9EMURpWG7nxcOG4ga2V 5x0KCBWy3fFzeWMM1bUk+v/G1mPK9f1edBQCbdDM/gwjm+8ECIgJVLn39hfCxqewaU/zng LqMvTkBjC+3SCF5Z+f7I4qUjtgbe6+akRtTv84wQzM2tNRZ+LDrtT6dtcJJuwAc45s0mcS yDR1YYKaaAiuJevc2eViJXb/KA81pWfwPA7yPLvtU1taHMBysM3X6E14AGN7NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J6JEf9hzIQ4EFXWXg3VY6MQvdA+BQIo6J9IP4+JAmzw=; b=LYiYu7SdkY9xYijr6v9A3oSeL5wzGGkJKII1z3g/8k9rlRfx4jZ3RZ3z+Y34T6W2QsgSIx RYfF3MabTeHYgHzGqV/ZG2asjGVbRXSHVja6BdP4VkbJ20rQRI2ELJG12g5nVrdAw+682/ ite04dXUu3Eps1YmNlG1XxPswFWFjhnI2oPReGeQwEse2B/Tu5yiK7rzuk9626FyMbqaTl Nc8sJnuhxQeuYwV/kmh7+j7IfNjZeSGAwVcYlYbte0Tkz+FKGsnsGQWGxWjyHtcW+2Qj5K PfeycFHcy64S3B5GsmNNOhqgkjzEQ/otOfzJvnOFWFHXlv7bromRdTi5DKk6IA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073767; a=rsa-sha256; cv=none; b=NFY8IFwKtohIBsbuVUd0vXa2d8O/KO8pPcQSRU1zVGDGEn4+9/ErIdvEYnnBdZL8CU5FhD tawJMQvpL3EdBA3IENUfQQmsZ2R6rzN8hsushYLin5RyxlakO8666WHdfJ2D1kCkfWvegP jpnckl12psYO3Cm1afZltygzgy3I50bM9zkiEhB83g6Bq1cdy/PXPeBP4Xk3nuBsUVQ7KA /segjcmq6jVmo/HpY+hGXWpsdx1MWuplN/qeLZnPe22RzmY06XTVkUr8DUUIFfPXxwoaD0 EtEXPlX+SK7PzhWA8Qqec18uBd6DHvoFX0+JKcUHpDwZ7w9uusVegWgQskLp4Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWC3NYyz189F; Wed, 3 May 2023 00:29: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 3430TRXU071764; Wed, 3 May 2023 00:29:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430TRee071763; Wed, 3 May 2023 00:29:27 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:27 GMT Message-Id: <202305030029.3430TRee071763@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 80a1e92e4f54 - stable/13 - Silence GCC warnings when using libc++ headers. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 80a1e92e4f5408b08e441dcbe811a83f9584241b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=80a1e92e4f5408b08e441dcbe811a83f9584241b commit 80a1e92e4f5408b08e441dcbe811a83f9584241b Author: John Baldwin AuthorDate: 2022-11-30 22:50:35 +0000 Commit: John Baldwin CommitDate: 2023-05-02 23:42:17 +0000 Silence GCC warnings when using libc++ headers. GCC 12 raises warnings about literal operator suffixes not preceded by '_' in libc++ headers such as as it doesn't recognize libc++ headers being an implementation of the standard. GCC 12 also warns about clang-specific pragmas in . Disabling these warnings globally for all C++ code is not ideal, but is a better option than patching libc++ headers to ignore these warnings. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D37530 (cherry picked from commit 442295c1fe84b4dc3e4834acdbf4ede75affe3c4) --- share/mk/bsd.sys.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index ad359727c32f..4a75e17ed2b6 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -227,6 +227,14 @@ CWARNFLAGS+= -Wno-error=overflow .endif .endif +# GCC 12.1.0 +.if ${COMPILER_VERSION} >= 120100 +# These warnings are raised by headers in libc++ so are disabled +# globally for all C++ +CXXWARNFLAGS+= -Wno-literal-suffix \ + -Wno-error=unknown-pragmas +.endif + # GCC produces false positives for functions that switch on an # enum (GCC bug 87950) CWARNFLAGS+= -Wno-return-type From nobody Wed May 3 00:29:28 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWD56XQz48NSG; Wed, 3 May 2023 00:29: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 4Q9yWD4bwqz3lTw; Wed, 3 May 2023 00:29:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kHiAFwyqRw/puvcNMgyyG5i8uSoRWokJLwNZf9hflAM=; b=Z6Sm7rrhjx7P13oKkqNrqLYGxPTxYLYDA2cl+GOwRwDSFPD7dG2xMdgCBbog7dLwxC6Q2h 1OcqueRsngXaJZxpZ49EMU/ikmoIBdhpoXdl3xRWcPJyO1VdjyiiVhNjrM2Vc8q9YQFPuu xZ03W7cfK3Bnr8k4y5teQIr+KxTH/Vxn4Hr2BUHHWJRtdniVuKjSRTVZjxB24buOYlEuVW EO1FMjCstG+ngWOYUOGT6tpZzQpzS63u4acth+XbtZJJ3GXGc+Wuui5cZR0AE44GOclatY MQJXaJpQACIAPB5Ydy7kvxuw7n99E1EvvR+3lBdQkULyBAyhZImLd79qSWtNDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kHiAFwyqRw/puvcNMgyyG5i8uSoRWokJLwNZf9hflAM=; b=NBW6ppZRyQ3IhEW8DCOBBHC0xupFgzlm10ZQGvB0N9ACklJRT73fU55M2DcGQtjOVP+5Zo aupewbfKzz/0RRh4rJhhdY+BTvoWLOIDOJXRbPxMSUuibcpVEt3A3+6G60fv4tHOZqe3if fTBboUGCKorrW+cbyp1kN1RtJ2KEffXiSOt9NgvBDJIh/L0TsPxrKukw+zy2qcxef922pH MAvDwkPRxllc1KQq0A5CzEG9Z6hNjpPU4XmTqSeOZGAkuYYuzxfZV5/q5wmkiyn40trbWx 2t3XCxi7gBxXZXIxvEZBxiRQpy7MU0FJkqpcCbSwOTHUSnEQ5i2TE2OPrKJDYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073768; a=rsa-sha256; cv=none; b=jLd88PRc7zfXkSRxX7nVPJBmw9zkGeoB9XVtvMwSxaQSsSgs06Bt885curnV2LBdcHVQVq 1z1ibLHhEcfQc6piKHSYsUSz225AmZY1eXSQd0cQva6LTgoSIeutx4dPfuyvfKap4X2N72 nJaNsM7uCihWgpQyPA9nCCXIsxxzoRPtof7vKSPiYvCZlqLafSRgu9Gipaew1o5C2QLjZa l5wHxJs8uhg/OcZXhm1JImvk4aoioTaPYRvCqsBaa9EOUqN07jBSw7jnkN5y/kQ43vjWiV Oc1RnA7ob5vJl6vgJKPAkNdeg17KuTnsKR69qsViy37RpEOe6Oisn+Sec9M6Uw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWD3jQfz18LG; Wed, 3 May 2023 00:29: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 3430TSAe071790; Wed, 3 May 2023 00:29:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430TSGx071789; Wed, 3 May 2023 00:29:28 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:28 GMT Message-Id: <202305030029.3430TSGx071789@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 42ed407622aa - stable/13 - libefivar: Fix a buffer overread. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 42ed407622aa53f9794b9d3d378c725945d27623 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=42ed407622aa53f9794b9d3d378c725945d27623 commit 42ed407622aa53f9794b9d3d378c725945d27623 Author: John Baldwin AuthorDate: 2022-10-03 23:10:44 +0000 Commit: John Baldwin CommitDate: 2023-05-02 23:46:37 +0000 libefivar: Fix a buffer overread. DevPathToTextUsbWWID allocates a separate copy of the SerialNumber string to append a null terminator if the original string is not null terminated. However, by using AllocateCopyPool, it tries to copy 'Length + 1' words from the existing string containing 'Length' characters into the target string. Split the copy out to only copy 'Length' characters instead. Reviewed by: imp, emaste Reported by: GCC 12 -Wstringop-overread Differential Revision: https://reviews.freebsd.org/D36826 (cherry picked from commit d30a1689f5b37e78ea189232a8b94a7011dc0dc8) --- lib/libefivar/efivar-dp-format.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libefivar/efivar-dp-format.c b/lib/libefivar/efivar-dp-format.c index 14f6adc2fd98..c6bb0f9dba7d 100644 --- a/lib/libefivar/efivar-dp-format.c +++ b/lib/libefivar/efivar-dp-format.c @@ -1008,9 +1008,10 @@ DevPathToTextUsbWWID ( // // In case no NULL terminator in SerialNumber, create a new one with NULL terminator // - NewStr = AllocateCopyPool ((Length + 1) * sizeof (CHAR16), SerialNumberStr); + NewStr = AllocatePool ((Length + 1) * sizeof (CHAR16)); ASSERT (NewStr != NULL); - NewStr [Length] = 0; + CopyMem (NewStr, SerialNumberStr, Length * sizeof (CHAR16)); + NewStr[Length] = 0; SerialNumberStr = NewStr; } From nobody Wed May 3 00:29:29 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWF6c6bz48N7w; Wed, 3 May 2023 00:29: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 4Q9yWF5vr5z3ltS; Wed, 3 May 2023 00:29:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5T4F+MvNPSrCSMh0saTtqFR+pgs84TNTjy8h8r1zdAw=; b=ASL4200d8jStZq8MUIL+5GJWRPyIJFRnFSrgAu2HhflJAQpDjp0phzM4N/gldmxTzwisCA UVp4ScTTud6OyF095h8ZBNtoaSZYRf4lGYEq3dj62L6a8FaRIFohYV7wGBAsN+34P9ZPLY 29ggf6HWbVm9vDDyykANvI+vU2PIoJ91Ie6AcJBJKF3W3Svb3YMyhiRAjWBCbcZ8F9kE7y 71AADH5/0UdwqS9cBIDJFWPPtJ8ryDG7201FNKtBY8Y0faFJ5qrXe79utFaxr5TTJxY2Pa s1aMTHgh4FqWIFuzeo99yNFI1IvcmpBVE7eP0UNz28NBw0kfhuTPCBxMcFU3HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5T4F+MvNPSrCSMh0saTtqFR+pgs84TNTjy8h8r1zdAw=; b=kF0hRpSgi7KDQcaaXL6xPOAibB4OZ/CZzEoXjNatwjAMlc2mzo2EpST9pyc7XBxg48ruM+ Fk30zBBh8Dgu84c0GRZf4oQ17PwX+hc4ZZtLJDGi2qxmzPMNJEy2ekHWW80VzGCzk+sVSH 4SHp0vDbqVlP5O6nNBiEQDrDiC6CQPMt4fRnUSQWxRDAdvoih9wxhFYL38Qh5M1HMJymEU hDlXdPcRGrKQ/zp6IjGTim8ySjTNioJ/a9ReCw2szclPSHcLUnfRndrUS40yqsWJoWo4Vv fZb9mQ7nbganfuriXjSZnG5LrdwwVX5PWOReAcTKPFqQSXUd5katvj0pn53BUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073769; a=rsa-sha256; cv=none; b=jkb2gT29cUPAOiCeV7yGZLrB9ckCHGT/h6W3kB2RvxMwqLh4foxyOOh3PwKc4yOcYeAFG5 zWG4zHdfx0sA+JhQtkOd9SiZEoMA7I0yx2sCsIL+PNVmbQ9Fe42gakYShdcxvy0yQcYcyA 3H6reirvw5Eo1UEyY+uvcrsZNl7PHpX5nH9Cxoi3nMjSYBaOl5cXLEmG4ZBrVWcPhBllD9 uGeW1xvqO+RMc8jfJ1Vyc+I4pniAkln+M5+MdVXtLL2pF9bP1F/3WhzhBGxipq8f7TABpc fTUSdnrFLJLQ7QkuKg3mTG2WbIZbx3ZZ168BCMQwS9G1fB538QzJfJqFmOtSQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWF4t3rz189G; Wed, 3 May 2023 00:29: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 3430TTTn071809; Wed, 3 May 2023 00:29:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430TTpu071808; Wed, 3 May 2023 00:29:29 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:29 GMT Message-Id: <202305030029.3430TTpu071808@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 11a98ef22a4f - stable/13 - Explicitly set CXXSTD to c++11 for old C++ code using std::auto_ptr<>. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 11a98ef22a4f212747507cd0014e7dfb2d8db11f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=11a98ef22a4f212747507cd0014e7dfb2d8db11f commit 11a98ef22a4f212747507cd0014e7dfb2d8db11f Author: John Baldwin AuthorDate: 2022-11-30 22:56:19 +0000 Commit: John Baldwin CommitDate: 2023-05-02 23:47:59 +0000 Explicitly set CXXSTD to c++11 for old C++ code using std::auto_ptr<>. GCC 12 defaults to C++17 which removes (not just deprecates) std::auto_ptr<>. Trying to use CXXSTD of c++03 doesn't work with libc++ headers, but c++11 does. Reviewed by: brooks, imp, emaste Differential Revision: https://reviews.freebsd.org/D37531 (cherry picked from commit 42fb28cef42e883d808c9efadd44016563248817) --- lib/atf/Makefile.inc | 3 +++ lib/liblutok/Makefile | 1 + libexec/atf/atf-check/Makefile | 1 + usr.bin/kyua/Makefile | 1 + 4 files changed, 6 insertions(+) diff --git a/lib/atf/Makefile.inc b/lib/atf/Makefile.inc index 392bbb23b236..5904a859a15c 100644 --- a/lib/atf/Makefile.inc +++ b/lib/atf/Makefile.inc @@ -28,3 +28,6 @@ CFLAGS+= -DHAVE_CONFIG_H WARNS?= 3 + +# Permit use of auto_ptr for compilers defaulting to C++17 or later +CXXSTD= c++11 diff --git a/lib/liblutok/Makefile b/lib/liblutok/Makefile index dccbcaf773e4..0071d7b55070 100644 --- a/lib/liblutok/Makefile +++ b/lib/liblutok/Makefile @@ -22,5 +22,6 @@ SHLIB_MAJOR= 0 # lutok uses auto_ptr CFLAGS+= -Wno-deprecated-declarations +CXXSTD= c++11 .include diff --git a/libexec/atf/atf-check/Makefile b/libexec/atf/atf-check/Makefile index 6711d1744430..1a87a14f354d 100644 --- a/libexec/atf/atf-check/Makefile +++ b/libexec/atf/atf-check/Makefile @@ -41,6 +41,7 @@ CFLAGS+= -DATF_SHELL='"/bin/sh"' # Silence warnings about usage of deprecated std::auto_ptr CXXWARNFLAGS+= -Wno-deprecated-declarations +CXXSTD= c++11 LIBADD= atf_cxx diff --git a/usr.bin/kyua/Makefile b/usr.bin/kyua/Makefile index 966927709a06..e23899afd1e5 100644 --- a/usr.bin/kyua/Makefile +++ b/usr.bin/kyua/Makefile @@ -37,6 +37,7 @@ CFLAGS+= -I${SRCTOP}/contrib/lutok/include CFLAGS+= -I${SRCTOP}/contrib/sqlite3 # kyua uses auto_ptr CFLAGS+= -Wno-deprecated-declarations +CXXSTD= c++11 CFLAGS+= -DHAVE_CONFIG_H # We compile the kyua libraries as part of the main executable as this saves From nobody Wed May 3 00:29:30 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWH0BpHz48NSJ; Wed, 3 May 2023 00:29: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 4Q9yWG6hdQz3ls4; Wed, 3 May 2023 00:29:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JTj1voRKJkyKeEFLb1lxJDxn/dXQX2rBulykRTwlkKE=; b=t6WXvnCyalrTd4i/paLkp/F935iiiJyGTb+TFo9zK+6BGMurpmPgbMmrZJQRKbUYq6If4T OipA+LzSZXSsO3Sn415cvEkSycfSCPmt/dWZ9oMqjhiqo+iSgvn7Hk9vg+qVRh4UpgXsjv 1mCAsO2ZL3E216IYhKyb6SLWUAxEoRgbo0yqo+WtIpW9d04MheQS53drlQ6dho9UEdybhC ei1wlHIDJMRNios24U4zxn70OE7t9mB2xejmvMDg0WhLu+vhvHDyQJmrWaByqi3BmhB8iR mvcPB9XVzTUl22hgT0X8tR5/gquChRMg8lL+DP1JqOP9G8GcPlWdhQXsNReGYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JTj1voRKJkyKeEFLb1lxJDxn/dXQX2rBulykRTwlkKE=; b=t1XniuFv/ayr54PkPF4EpVgi3PDUWnR1GFQOQVCp7LUm1dKUoTjkYVh4I/XCU7SQnU8PCB gAfCHKj/5QAdHV0zky9KHyvfs3X5PK/fVJOhPMGIFivLZ6z1K4s8zmmvXwpV1tSphvCTDQ 258SLdcKKhnN/w8GFrKYvMlwJdwsFo0PAPXG8SnnDXdj/T22JsdqEmyxgB8PiY45yCCdXI c9S/OOjCzaOn3y6dEoP3DI2AgD9qZkY+TOjEOf3Oyy6iO4SVTr528YyT2+ywv1nriUnC1u 4dmYYPrbMhg2/+YQfhziPuVeSdmQX4zpl24AnwILVWlUo2UUf/ljawTqsbjwNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073770; a=rsa-sha256; cv=none; b=TMQACsDMIO9y5nfLwVLJ4sqsatYetLNAKoiZJa5WzPA/853ky4VI1GsqNvaXr2WBDpXEz2 N+rJm0pJWvNUP8oRrvQUtUTlY4xDz80wOzxEMf6bSSxOKr5EDcTw+Rjr6BaA0io7aMcpEn 9+cEcCPdYPqSI9pWuuaAXRkza4KKlF0IDpXZUiCVlYPEQBwP3RZbKm/QRWNlOsMZG8j9dh bbof0jSOilGsaI/PZxFWLODZgsUKnAWFz6b/bln15k8AWXX5x3HD9VGVdWbn/3X3jcyFHi 4AvWEdeE7tfqIrZCtryWRaC+CjnOnCw8D02SArN/SEP+c2kpuM4GzjGWVr3hnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWG5pLXz18J7; Wed, 3 May 2023 00:29: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 3430TU04071829; Wed, 3 May 2023 00:29:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430TUnh071828; Wed, 3 May 2023 00:29:30 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:30 GMT Message-Id: <202305030029.3430TUnh071828@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 83a2c663b979 - stable/13 - bsd.sys.mk: Add NO_WDANGLING_POINTER helper variable. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 83a2c663b97947047f10537f76bc30f35af2c0c8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=83a2c663b97947047f10537f76bc30f35af2c0c8 commit 83a2c663b97947047f10537f76bc30f35af2c0c8 Author: John Baldwin AuthorDate: 2022-12-05 00:26:48 +0000 Commit: John Baldwin CommitDate: 2023-05-02 23:58:18 +0000 bsd.sys.mk: Add NO_WDANGLING_POINTER helper variable. This variable expands to -Wno-dangling-pointer on GCC 12+. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D37532 (cherry picked from commit ad96424e31a8c8c87fac8077fd4304c6fb133e25) --- share/mk/bsd.sys.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 4a75e17ed2b6..21aba9f010e0 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -135,6 +135,7 @@ NO_WARRAY_PARAMETER= -Wno-array-parameter .endif .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 120100 NO_WUSE_AFTER_FREE= -Wno-use-after-free +NO_WDANGLING_POINTER= -Wno-dangling-pointer .endif .endif # WARNS From nobody Wed May 3 00:29:31 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWJ2q5sz48NDy; Wed, 3 May 2023 00:29: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 4Q9yWJ1NLjz3lsl; Wed, 3 May 2023 00:29:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KGCnPvphISDwuYkwSdSe2Qj8CJnUQ56ZuRZyZPJOoeU=; b=CY9/lyPDi/Scwxe9zW5eBG6CFZfWn1DuDuLGOSAJent9A31G+iKAQMHZMWZ2lLb47jylg4 k+T6CiEzu2+IuIyLM6fllv0MwfRkUr4+KzXOsrVwu5C0ztZjzsbkNsX4ggDqIZZK4ldKWs ChMflVhA6kO52NELgfvedx5n2OFe8Ge80Cu/AvqjGbcQlB+zILOPqr1bV30lFlCRKgb/Eg lCnQC/C1UqieDvw5RayuaKIFSaNepEPb/CPLc3fJnQctfOUkYOLguiR8IU/XlnYHfMq6QU OegGlCvSTcCwTnnOqEoxDihJZWRUF+BHV7RlqF1mW+5rBCILZO5rD85mN8C8Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KGCnPvphISDwuYkwSdSe2Qj8CJnUQ56ZuRZyZPJOoeU=; b=oAYX9ehqE9j1iLUTXcivcawiefW/bCTqFuXi3D1Of++Yam/fpt0w2KNsq4DxgDPqUNxuq3 K/3i+jgtHXkapEADQQ56eLEGmp8kbJ334YIXWp/B59TdPm4xr9chOOshBNrx+lAKg6beSU 0NInHLSI4o79p9U4v/uYPB+CZD4ufaa/rM+Df6wtRqIF2B+JvonqR4Rj3iPNza1L2QfN0t 0D4fJ/wu8/AygXAOcHBfLdi6jrfInGFWxpyUstntZfLmXHQfqCPHfQx4ZNh7FIzi3poSpi wlsFkXTeXOkeeCiRwojDZGKvE4VrceTpXxHIvptmpsRESOh9x7dpI1lOCYtLSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073772; a=rsa-sha256; cv=none; b=Vm4Q2QAJWRd4op6Ly777Htf3t2mKOes7JppfVrSe07gkE8/Yt81LFxV2DhjZ+0DaavaNeY zCyTcDJ2JpdT4I1QO9UPsocZ9Y4H1ygL+F3rYKiep7YLK5TjmwyEMmH85U2PP4dhYDkS/L xczij7KXV4t/h7FY1tloc3mXWk4qUmvPo+AoKdn5eXykojVKzIh7B0vIODqQFE6FZh38e7 ibhP1X/FcBMu1eR1gDvOpXKezpV892254S7yuC9sU6WcCdL9CeP15STnAL9K9/2K4zXLkG MUbrD9GkBIjTN516m+BLNA37jV4+vN0GyLO5cz+1/RGwtZYALySoXoQlCe03Kg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWH6kV5z18Fg; Wed, 3 May 2023 00:29: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 3430TVxK071848; Wed, 3 May 2023 00:29:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430TVKC071847; Wed, 3 May 2023 00:29:31 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:31 GMT Message-Id: <202305030029.3430TVKC071847@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 7b9e74754674 - stable/13 - libsa: Disable -Wdangling-pointer for zfs.c. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 7b9e74754674be7afa1059f4ca66d6c6723efdc9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7b9e74754674be7afa1059f4ca66d6c6723efdc9 commit 7b9e74754674be7afa1059f4ca66d6c6723efdc9 Author: John Baldwin AuthorDate: 2022-12-05 00:27:22 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:03:01 +0000 libsa: Disable -Wdangling-pointer for zfs.c. GCC 12 warns about a dangling pointer to 'objid' in zfs_bootenv_initial(). However, this appears to be a false positive as the pointer to 'objid' is only passed to zfs_lookup_dataset() but not saved anywhere that outlives the lifetime of the zfs_bootenv_initial() function. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D37533 (cherry picked from commit 0163de282e3195a1845f75b486adb3e1e7580199) --- stand/libsa/zfs/Makefile.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stand/libsa/zfs/Makefile.inc b/stand/libsa/zfs/Makefile.inc index f0d8129be9e1..4eb89fb80b2c 100644 --- a/stand/libsa/zfs/Makefile.inc +++ b/stand/libsa/zfs/Makefile.inc @@ -42,3 +42,5 @@ CFLAGS+= -I${SYSDIR}/contrib/openzfs/include/os/freebsd/zfs CFLAGS.zfs.c+= -I${SYSDIR}/cddl/contrib/opensolaris/common/lz4 CFLAGS+= -Wformat -Wall + +CWARNFLAGS.zfs.c+= ${NO_WDANGLING_POINTER} From nobody Wed May 3 00:29:32 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWK1xr1z48N7S; Wed, 3 May 2023 00:29:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q9yWK1C6mz3lt8; Wed, 3 May 2023 00:29:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o9lOq/nejJIRsPzB/NzJ/LyCGf2D+pUBSfe/szsfTiU=; b=RM1HwJ/cCkfBWQox5mNCnI5ZXnInAe0zIF+Pg6dJDI5HWLfItvXCzpL3kVVkILMqRambGw wXn0wFb2AksBAFCOBjw4diS6RBAQYkgRdEYTzCuU0JST0K2XfnizbQTi2fNe+JQMVBB3s+ vfiRMREh50k4PQjom+jSbi2rjw4a20DQ3I8Xwc3AMR7/PH3sBb0aQaqNXOzxCOiMB8Vx6T tyFrkiCoCOyFukC0EaX/R/Nz1TDi5b3c6m27gxIv9aQ4ydo+u3nTxnObXJBjsBwhvy+Ciq pBMJtRWF6AMufVjErRNqJpAmVnqq9tP1OhvsTpNJZd2bzMnFNqZ8jOiB8orioQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o9lOq/nejJIRsPzB/NzJ/LyCGf2D+pUBSfe/szsfTiU=; b=LJVTZh6+cGBuN9FhpcTzVOJkai5SxhwIxLpqmVWuYgR0KFCVk8LhZaHvIBA+e89MunkW4Y yEAfFMxyBnWthDth5vXK/D/6ZOfZse9eawFbUDDVWxlHSKGhCFGnjiMWYk3xWAwr8JEx2v mUO05XFycKdullFqLGuAqQ3BG21rNQ09T9AuWibxhhPdX5fkTVr4yerlLcQNf3APBRf+He +Se99SfvjtOqwH+UNXm9IgrxjNXF3nuUyHTzQZwTo8snYJ2urLXTrixzFwQuxs81nyWmas AujPzZRww4eHuAskSo6eI4zHaYqW6ijY5zKNs0xDH46QYoxYaUS5pHRPVLqnHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073773; a=rsa-sha256; cv=none; b=bUrwIpZ1ovwvND8Vex5gUV9gkY/0VBmDhBsD3NX4Zg31VM9AEuUBkCdVCD/mkUgj+e1SNA xkOgdGmXLfaSG1/3BH1vzL7nGEPUd1P8V4WUpAkTKUDAV997wET2YIPI6gy66hoDxSJbm5 vThYVNMN1e7U3qjYT8PCyLC9JfY9FM+apoMe1gWywFu7b5a+TZFDI90ORPjfRAt5YjiduW 1sG/k+Qbni+n8NfUhhEwqPrkyHnOkRpHx7btMShhR7xOSwI0bDFBBNhGDhTZE+/6TIv5VT MZDyJaOCllCcom5b0KyIQGl6MfjzNmIDQ3xDeQLQIA2mHvhllOHZV2WnEDGN/A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWK0JQLz189H; Wed, 3 May 2023 00:29:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3430TWPG071869; Wed, 3 May 2023 00:29:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430TWp9071868; Wed, 3 May 2023 00:29:32 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:32 GMT Message-Id: <202305030029.3430TWp9071868@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a7b1263ef066 - stable/13 - rpcgen: Don't free() a pointer after realloc(). List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: a7b1263ef066bf149fa9bef9e4fdac5cc1446964 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a7b1263ef066bf149fa9bef9e4fdac5cc1446964 commit a7b1263ef066bf149fa9bef9e4fdac5cc1446964 Author: John Baldwin AuthorDate: 2022-12-05 00:31:35 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:03:11 +0000 rpcgen: Don't free() a pointer after realloc(). A successful realloc() already frees the old pointer. Reported by: GCC -Wuse-after-free Reviewed by: brooks, imp, emaste Differential Revision: https://reviews.freebsd.org/D37540 (cherry picked from commit f0b58b190107416e813c5db875034c6cfcede523) --- usr.bin/rpcgen/rpc_main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/usr.bin/rpcgen/rpc_main.c b/usr.bin/rpcgen/rpc_main.c index 698017c969f2..1a2cae928472 100644 --- a/usr.bin/rpcgen/rpc_main.c +++ b/usr.bin/rpcgen/rpc_main.c @@ -925,7 +925,6 @@ moreargs(void) warnx("unable to allocate arglist"); crash(); } - free(arglist); arglist = newarglist; } From nobody Wed May 3 00:29:34 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWL2fsvz48Nb3; Wed, 3 May 2023 00:29: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 4Q9yWL28fFz3m2F; Wed, 3 May 2023 00:29:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6iLftERr7CUwieWxMB0AZ3wusDMtKmlqRaJwg0jqaUQ=; b=ShoCovvthUhcv1VpO1hZVmCFNHzwDGF8E9LmKyIOEYBg3TQxh0vGX7eV5HtXgc9XiRc/Kk QmtyujPJqIBRDVrpuLcXw4O9ip82KPPGdX1os3O4VUqlRB35PthLTw23iUI0H4h9YILATc Ey02/t6en5sAM5fWuW2f3Agi6lBbsjpy+LKdKjfBSLmgdXjIP+/tAnBDZaiJoizCWivJDj F99hrO42IqyLZZTWL2TdAgTVOgshKNFIb47D/xMOmzmtG3MUChniOlZAD6t6Q7oaQwTgSi UnCTKHAA94r3LwGN4IhRGYEmmpH2sbha3A0ktEVLbcuGr5QA6xR6cFfVY2y30Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6iLftERr7CUwieWxMB0AZ3wusDMtKmlqRaJwg0jqaUQ=; b=W6dco3qEO800PEwnCJyAfx9KjojESifJFVf91igrHQY7zLrhktg99A3pfgPUIZfIC5Krip spYBG8JvMOQXFsw3Ib5S5wggeRfJj7t1AAOAttXuHvz+fmeyZA4dg9u1rcDmWiwWpc3f9E 7QYINjC+srMj6LNRlk57bgeVRPbBt9XNAOHsSmVx27WRgIOG+YFNqdwMEwgySEg/4kNiav yZPRK7VidAp+Mr/nz53oLaUkr58XpeD9lwlLFRV/9EqaeX7vS1Ij/7HT/B4FQKtzzWXoer p5gTMlRThKcm+5y7qMHNMZMw/FlYnZ6tQ5X0n4ugcw7WdqNf6qeX/GNIqoBjFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073774; a=rsa-sha256; cv=none; b=L1UtMEQ8eG7Ca24Eldc/xBJmKBSOvXssNP8vD/4rSbsjxivwHMcggP1+fYgmzETiRnQPPo me6uYM4fwSJtsyOlczHd03Z0yh222oI31jMZ/RZ2kWUmoGIe69CNgAHif45RTmK3MEGx+9 a01urRdxuVXpaJmGPxseaMc4rWR3++Re1+Uaed5GQtDRzi4EoMcYNejDSDY+zlzBYGdOHb zAIH02hUKIWpHSZCO1hQtIrN9sgWeQ7wCVmzMfgvP5UVU42IzrgF9TIHXZ5/yw5f0dHy7z 2jWW1P+yPyu+hxXyCJOGExMNopa7xTJvhNBPDqq5dcsq54sX1ejTiujN+y6Kbg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWL1Dr9z18J8; Wed, 3 May 2023 00:29: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 3430TYCZ071894; Wed, 3 May 2023 00:29:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430TYJb071893; Wed, 3 May 2023 00:29:34 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:34 GMT Message-Id: <202305030029.3430TYJb071893@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: c2c7a43fb5cf - stable/13 - rpcgen: Unindent a line not guarded by if (mtflag). List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: c2c7a43fb5cf6f1711a94ef9e928defe6075503a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c2c7a43fb5cf6f1711a94ef9e928defe6075503a commit c2c7a43fb5cf6f1711a94ef9e928defe6075503a Author: John Baldwin AuthorDate: 2022-12-05 00:32:03 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:03:19 +0000 rpcgen: Unindent a line not guarded by if (mtflag). mtflag is used to add pthread mutex locking around operations to make them thread-safe. Setting the state to _SERVED is not conditional on locking. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D37541 (cherry picked from commit 4fa1e855be60f2c95005edb295fdc36cc163ff6b) --- usr.bin/rpcgen/rpc_svcout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/rpcgen/rpc_svcout.c b/usr.bin/rpcgen/rpc_svcout.c index 3c6d0824f11a..06951940ff4e 100644 --- a/usr.bin/rpcgen/rpc_svcout.c +++ b/usr.bin/rpcgen/rpc_svcout.c @@ -619,7 +619,7 @@ print_return(const char *space) if (timerflag) { if (mtflag) f_print(fout, "%spthread_mutex_lock(&_svcstate_lock);\n", space); - f_print(fout, "%s_rpcsvcstate = _SERVED;\n", space); + f_print(fout, "%s_rpcsvcstate = _SERVED;\n", space); if (mtflag) f_print(fout, "%spthread_mutex_unlock(&_svcstate_lock);\n", space); } From nobody Wed May 3 00:29:35 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWM5MYfz48NWY; Wed, 3 May 2023 00:29: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 4Q9yWM36z7z3mC6; Wed, 3 May 2023 00:29:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UIirj+e1NQgiID2cw6Izoujtt+obmd0i81LaH2IGuSU=; b=hwwfiMb0YleFeYcSzzwn9jkXMP/9X7eI/mgb/ab2InK0RhycwEO9K3+m9GESf7LAa3lwtE ioQGBnrc1k6ZMphaQylGXYTounUECqHA3yEwlKuPgmwxO+W0y+7i9CMQDJ7CA5cOmLVaHb waHPrH/e/hDDy35W8vLa6VV+o4DbfMYPKixByr5JyTm0NOhj6qiBbP1fKKatjkh8cA43NS AQTqw848/00hNa5Mvaj4eWWOQvhvytrMTlPMHRFuzNq3KEhfAM+FtitUDB2yjOQP1WfxyS cZ8WmTaNkBod3whBexTsJ1wTeTwKbeaDzzck7XksgRE9Z/5SHYXM+8OWCfVlRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UIirj+e1NQgiID2cw6Izoujtt+obmd0i81LaH2IGuSU=; b=k7l9IDM07YIfGEXqo+XuLXN3hO/+S+UcNVrouQ9eTBBvNF06ZGoO4vB6RcJBbrxfGix2f3 oNYFpvDxfa7fvUur665y6gVVmO0nKJByFyg/Oh+R9KEdFLHJkfjyHAjMC08PrOspOCbOVU GOIhSnZVUStIL7pFrGG08UBFRCDpSyzWM3LRt1eHOh9uc6ttTnIVV3yZKsnAfu9eCoR+rK SJAev79K5qPgIMhMrMYGMU+PSG1bXqifjQVqcADzhrJXqFEzHiCUAqrxjgpEjA4Hdbdky7 c+WAbtoYg8gw0R6lF6YrxzLvmYg1fCCZuCEz+zFIIGglpZf1PZybkOjLflqWgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073775; a=rsa-sha256; cv=none; b=JG+SBtsavstGF+jkL9BXOhgP94yDWCUlC/knAoM4TpTWQ34x5lBrv0P5FcpmFCR4qmNbWQ LBd98w+kAHtNIPSEC2WD2Oa6EKzGSVZjxPtaM4Qk+NrgUITuruwzdDhqnNg9E5nPWz9E6f h/S/UhldBqsb0/BzsopOB448Zr1uLOtKqXVuJeK0RHJ1rVDtUyGsIpcgCko475hcbgoFRq 8zh+gETIKtNmT6BvRnamra7Xmj1rNMNaXeuCDnMrgEliIQ41dckwB7FTU8KTNwaEv4Fcb4 MsStdWlYi98awS0mOWzZWR8zNdhSFqL6j5cu6U3MG4g6deGL2BD4MnsZCL+yPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWM2BMCz18TQ; Wed, 3 May 2023 00:29: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 3430TZ5D071917; Wed, 3 May 2023 00:29:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430TZF5071916; Wed, 3 May 2023 00:29:35 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:35 GMT Message-Id: <202305030029.3430TZF5071916@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: cb4303995e98 - stable/13 - bsd.sys.mk: Add NO_WZERO_LENGTH_BOUNDS helper variable. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: cb4303995e987597b95a8af30931236a38e88aab Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=cb4303995e987597b95a8af30931236a38e88aab commit cb4303995e987597b95a8af30931236a38e88aab Author: John Baldwin AuthorDate: 2022-12-05 00:29:55 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:04:41 +0000 bsd.sys.mk: Add NO_WZERO_LENGTH_BOUNDS helper variable. This variable expands to -Wno-zero-length-bounds on GCC 10+. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D37537 (cherry picked from commit 9134d9265c54a02257292c32b2144c401a86678f) --- share/mk/bsd.sys.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 21aba9f010e0..b2851cbb8fbc 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -130,6 +130,9 @@ NO_WBITWISE_INSTEAD_OF_LOGICAL= -Wno-bitwise-instead-of-logical .if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 150000 NO_WDEPRECATED_NON_PROTOTYPE=-Wno-deprecated-non-prototype .endif +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 100100 +NO_WZERO_LENGTH_BOUNDS= -Wno-zero-length-bounds +.endif .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 110100 NO_WARRAY_PARAMETER= -Wno-array-parameter .endif From nobody Wed May 3 00:29:36 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWN4hdsz48NFQ; Wed, 3 May 2023 00:29: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 4Q9yWN45Zqz3m96; Wed, 3 May 2023 00:29:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d3hfhld2ld/EDoE5djMOOznbcmtYuXla2Ete8PQxnmg=; b=ImibpGF3MUEjOobFkcj/N7IDwmWcPX3EwSZBwaUZrWQqauuY/XCewtYLCSGmcfZd8DoQqr y80fzElzsGibsuQGk6aEb7d9EC7WpUd5twzNwi8ETN0T5Aaz9Syabg6wuRXjH5W3hVppZc CHGIylH1To/CWTQNFNhuGjGQxCClNsViBaNHtca6zHHP/bLuL8nR49+kxK4GSxOcx9iNik bkp3L2hkYT3vq1Y37Xz5+r1QTD/l0hVxhk40sHAQipyC0GEolJ7mOS5C36x/2GCPteCway 7uWchrNDEhd9NAPwssZVBVQQ0/gSYc7I8EGpjiGjON5dJ0lfAN1quBv4BgnQfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d3hfhld2ld/EDoE5djMOOznbcmtYuXla2Ete8PQxnmg=; b=Qo5GZZAHqfMb20/zjnuPwfglQlbXhHV+ecGVVqE8qiS3BaADhoTj8eFhB7BIOn092lWkBE 5sS1wRjQkF62Y2juVCzXxi97XbKXPZdRCntAhCXog6ZWth+XP6N9dUB5+OTnPxZZ4X4CB9 3jkdgsFxYUmDHM2m0cHixtTvWoSkLUlGiIk1SB9i2t7FVpt0Jhgzq8JpE0CQVh2qJhCxZq DRzOHy4bUPq6ygJ5ZVJNoLnTjgJA8S/kCINoDT7zX87dmGrHv7Y53eOty5UHi2Ut4eNP31 SNv7ugVWNCvEkWYA87zsJIphU4WC/z5TJlZeLyuhKj1fIbRyakTa2NwWhyCo3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073776; a=rsa-sha256; cv=none; b=ace/E3xcAP/1Vbm7u2UkuYkJ77rv+X8vS4NPCM/XOWqcBS50kfY5nEYLIzJKx/y3GS+lEG y9pEYGpz8MLZmJuUfqNZv0UuhN8NkGg2s3a989Oogj3QfiyvfEMPppAVeq6H96fP4/3Jm5 1GwvwsW4b5v50fJbC1qmt6BOcGJNzQOq2FCoknt1i66Gdg4HpqdTBXJc26BvYXA2l4R1Gd eNlgt7HG4vEoUmlvohfuJF7tobA3mX6BcJgtEpQ35dWq42pyuDPzKBAh7Tk/z/Nt0863Wf 3PApitnxleMvmhMcNJMd5NhRY86Xur8g2pHjUTro+F+0M/NCCmcBlItuNDfmRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWN39S4z18LH; Wed, 3 May 2023 00:29:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3430Ta8o071939; Wed, 3 May 2023 00:29:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430TaqQ071938; Wed, 3 May 2023 00:29:36 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:36 GMT Message-Id: <202305030029.3430TaqQ071938@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 0345952b9e44 - stable/13 - fwcontrol: Disable -Wzero-length-bounds warnings. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 0345952b9e4410ff1aec898c1a1f09c2b0fef7c6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0345952b9e4410ff1aec898c1a1f09c2b0fef7c6 commit 0345952b9e4410ff1aec898c1a1f09c2b0fef7c6 Author: John Baldwin AuthorDate: 2022-12-05 00:30:20 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:04:46 +0000 fwcontrol: Disable -Wzero-length-bounds warnings. firewire.h includes zero length arrays in unions that trigger this warning. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D37538 (cherry picked from commit aa9ce62be54fd9a022b770d36fb1e4f24bfcd223) --- usr.sbin/fwcontrol/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/fwcontrol/Makefile b/usr.sbin/fwcontrol/Makefile index ec0e67f67d20..4eb8611e8026 100644 --- a/usr.sbin/fwcontrol/Makefile +++ b/usr.sbin/fwcontrol/Makefile @@ -9,5 +9,6 @@ WARNS?= 3 SDIR= ${SRCTOP}/sys CFLAGS+=-I${.CURDIR} -I${SDIR} +CWARNFLAGS+= ${NO_WZERO_LENGTH_BOUNDS} .include From nobody Wed May 3 00:29:37 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWP5KXkz48N33; Wed, 3 May 2023 00:29: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 4Q9yWP4qPjz3mD2; Wed, 3 May 2023 00:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0oBrBDBRfuc0Siu6Z3uCeM7q9WHANXc/jnUc/C+Ixh0=; b=fbg6fm9iljQ6ychDVNYYTExvfmo0n4iHOwkDiU5+kO0wBHmBnTF+mvUHqC6FpYKwgABeXb Vo4FVIJHax96RtIcbs3tQvgNAgUMnA3C7v9tMFK75wfGDczOoqe6g1OWxGR4qx+z5QSW9e Kh7abnvoifsGoqomWMbaS6ZJWV2cnWvFgp9cTOG1yI1qCTbF/f0zqUaxbKomgje8OeUP59 Nb1jfurHw8uxKfBwvU4l1I2dJujSyOja4+0i2okT7tTas2c1lqWhoNmk7BZTuQ9JCrB5yu sh/79AQbhp+Sfe8dDfQcf31YQqMHoumU7Cm1h+E9ocIgUd44IFKLYZx6WZ2J1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0oBrBDBRfuc0Siu6Z3uCeM7q9WHANXc/jnUc/C+Ixh0=; b=vioKFhi6dRwxfHUPDneTdxV8R/KYlmZzlZ6rM6B64XrBSvVi0XgXdHNnH4u1J9FA+G66Yz AGlFmd43KzqoHnDfVEhFyqjviD8kadidnltNMzpM7fAWLbfLXZUHrwIraQsS85G495pcDb 4stcpF9hc+D6k7Vt1oOFeOQ4Suz+IeQkJhWQGdgjuN1sixJ6EXU7TudcEmsaQRmoRFs+Pt JHtPVnysRbDbsJb0Ff4cxdtCZ0rauH8Nvlu0h3HFkYQe4ZonTtPWtVQkKoXksR9gfcdABM sGEALLlqmjL+SwxI3rONlEH/6RYyO1UEXtzXE4KadaPyt6yvb4/p5tN7cdU1vw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073777; a=rsa-sha256; cv=none; b=hLeOe9k8b2w2R5hzEJu5Sjz41LSbLEN97hyAxkHnSu275uhPRnLfw3zdPf4MTcs/y+rHb6 kfUY+FNMtjKv7cmP+14vLZa1GN6Lg51KTXUya5LIG1VGYMUKhsLmOZrcSNvHn0oGwahVAl ziMvTFZgzTFEPojCTEWJ/rd1i4zHHiskXBCM+u8yi7IY6kpcxikAb+mRSFtknawIaoUj7M 5pZDTzaDEtLHdi0Dqj5v7ekbzwGlICm0SVkgiJRnuZeU0VpLaVjWe5RdZd8ew4xY1pLOHi qcuaRVaJ//SRvV9xYS0nyR3CYtN0SAZOhqTe4EvKi/YeHIy4DbrdnaQuHc8yMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWP3wzyz182d; Wed, 3 May 2023 00:29: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 3430TbKC071958; Wed, 3 May 2023 00:29:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430TbNe071957; Wed, 3 May 2023 00:29:37 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:37 GMT Message-Id: <202305030029.3430TbNe071957@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 50367e285d40 - stable/13 - pw: Don't return a pointer to an on-stack buffer from grp_set_passwd. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 50367e285d40a8d94192f1e799de21f32c8136a6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=50367e285d40a8d94192f1e799de21f32c8136a6 commit 50367e285d40a8d94192f1e799de21f32c8136a6 Author: John Baldwin AuthorDate: 2022-12-05 00:28:22 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:05:05 +0000 pw: Don't return a pointer to an on-stack buffer from grp_set_passwd. Make 'line' static to move it to .bss instead as that pattern is used elsewhere in pw(8) (e.g. the static buffer in pw_pwcrypt). Reported by: GCC -Wdangling-pointer Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D37534 (cherry picked from commit 1055bedbed42dc176468b45b4f167a752ed8868f) --- usr.sbin/pw/pw_group.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pw/pw_group.c b/usr.sbin/pw/pw_group.c index 1f5979a5dd03..838bafa3e8ba 100644 --- a/usr.sbin/pw/pw_group.c +++ b/usr.sbin/pw/pw_group.c @@ -55,7 +55,8 @@ grp_set_passwd(struct group *grp, bool update, int fd, bool precrypted) int b; int istty; struct termios t, n; - char *p, line[256]; + static char line[256]; + char *p; if (fd == -1) return; From nobody Wed May 3 00:29:38 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWR1Z5Fz48N34; Wed, 3 May 2023 00:29:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q9yWQ685Vz3mDS; Wed, 3 May 2023 00:29:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i6TZATO//Hy76SNIO26kIvOXoRxgqYDuK9c9XixY5gc=; b=bXmTEE/VGobXAWRc+GGCIuj/dbJyz1TGzFLDz1VM9BReOuZhTkhcMWTn1ngIzjaReF79xQ P4IYnwR41m/hN7PEnqcgn1H7X6h3IrVYHI10hRIbSf2rUezFW7FWUpgsXYKr0SK1B8co1J lRdP0SthsHAjNAjllJGrwrMKL3xCFvbS82qji+7ObR0y8jDpqb5R5gTZIcB110VFkzGCt6 F0KmeL4uPF09flm57/PM0xGwCdk1CGPD8vjWeaTVg9vN5WPMMmpEFT8WyqjjwqAaeMTVUg YfmhObI4rdVy2EYrrbRO3DTnlP87PPK/NohQvK5Q02WlM3CkKeXUU9q9d7rm4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i6TZATO//Hy76SNIO26kIvOXoRxgqYDuK9c9XixY5gc=; b=ZhZ6afkD5Cz7q5bXZlm4Sj8dyscb49JwlxvAprQK6JnJP/vz1m8Mz+zPGv4NnCvGdDz53Z vFLJ1/cHlZONQ/ZzA2aBWKFgTsiblNHXDkHv+gy8BnlDsJHX0mBXfXpIGjo8+wTHEBsYVH 0KvfeNa1elmJEBDvH2qX3KLSPMI+h3JOwRbtVhueUa4lmXukTxfhWz3wQjN7jZmOsfiddr sVFB2IwOhandbCNGPdiiZd88AJvppdyLxilGU9a+DWRHFeQGS88E3HIsm+WeOE1pzxTNKz vquLahC8ttlvE3SYkAQ3R2D9Gom3RrbU8q57VABen4eM942O2/HYGEXv3wuWtw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073778; a=rsa-sha256; cv=none; b=i3hQ9f5RqOOvQv/Z9vs43gIoKYgp5Zg4cNLD6CDx2g7Vq0mNptSV33w9Rli0AYhUTP6J5W SsfeJDhOu/MqiN5he0LIhhonLXkn6zhKwZ2hcaeXWkNkaQx8ZMda3eVsRuIjmSLm0DDP68 eZ5tTJYyLZ5S7piIfAAGds4lOQkFe13heSHPEwfV308L3Oc3RbalhtpsWBTSFay6WPzxev lwkg6RgV9UJJwpwhFB0QJgtKvGK2RouMmDCTmfpp7VeMWmzBBPcA4ceGNaNmm4wYhVcPc5 oJeFDBJzydwJ58yh+OiCsMlyzsDFewV8YarrXjM1DsR3gs0w/WDQaubX/X+7PA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWQ5FLGz18LJ; Wed, 3 May 2023 00:29: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 3430TcuK071978; Wed, 3 May 2023 00:29:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430TcF0071977; Wed, 3 May 2023 00:29:38 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:38 GMT Message-Id: <202305030029.3430TcF0071977@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 0218596e9220 - stable/13 - acpica: Quiet a -Wdangling-pointer warning in AcpiUtInitStackPtrTrace. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 0218596e92204dd3890cd9d1f3fc8fdffb1e770a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0218596e92204dd3890cd9d1f3fc8fdffb1e770a commit 0218596e92204dd3890cd9d1f3fc8fdffb1e770a Author: John Baldwin AuthorDate: 2022-12-05 00:28:59 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:05:54 +0000 acpica: Quiet a -Wdangling-pointer warning in AcpiUtInitStackPtrTrace. This function intentionally saves a pointer to an on-stack variable in a global as a dubious way of reading the stack pointer. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D37535 (cherry picked from commit f4432625edd64df94ce7c2a085f256dbc4d2b215) --- usr.sbin/acpi/acpidb/Makefile | 4 ++++ usr.sbin/acpi/iasl/Makefile | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/usr.sbin/acpi/acpidb/Makefile b/usr.sbin/acpi/acpidb/Makefile index 5a6fceb2a4cb..ed28a26a67a7 100644 --- a/usr.sbin/acpi/acpidb/Makefile +++ b/usr.sbin/acpi/acpidb/Makefile @@ -90,3 +90,7 @@ LIBADD= pthread .if ${COMPILER_TYPE} == "clang" CWARNFLAGS+= -Wno-null-pointer-arithmetic .endif + +# AcpiUtInitStackPtrTrace intentionally leaks a pointer to an +# on-stack variable. +CWARNFLAGS.utdebug.c+= ${NO_WDANGLING_POINTER} diff --git a/usr.sbin/acpi/iasl/Makefile b/usr.sbin/acpi/iasl/Makefile index 1807156475b1..6b0e77d08de8 100644 --- a/usr.sbin/acpi/iasl/Makefile +++ b/usr.sbin/acpi/iasl/Makefile @@ -147,4 +147,8 @@ prparserparse.c prparserparse.h: prparser.y prparser.y.h: prparserparse.h .NOMETA ln -f ${.ALLSRC} ${.TARGET} +# AcpiUtInitStackPtrTrace intentionally leaks a pointer to an +# on-stack variable. +CWARNFLAGS.utdebug.c+= ${NO_WDANGLING_POINTER} + .include From nobody Wed May 3 00:29:39 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWS0ZG2z48Nh5; Wed, 3 May 2023 00:29:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q9yWR74ZRz3mGn; Wed, 3 May 2023 00:29:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=78ERe93ui4A/H3aEZzZwgH7+//3A9NZn9mlfG8gdImo=; b=VO0FGSC4UU3phDplvBEBlODB8E6HaOaD6QugXYWqrZD6boxaPYQy2D9W4WNxpziGTm7foO BEJYK8GvTWxvCgs67JAVs+gBxi5M12NNc7+/Gt9xQOYwqhjclc2DG2Yk2wHi/LnG6S8jH7 zAuaHqcPwvbNWl2q3JivtJjTCgrcl3pgfbCbsweaEXuJTJrZWso3vtS2tNnjVGRHz6lLao hgaUxuva7qI/WXMeXm7xXsCcdh47XF/f4ZCnJelETtiTV0i/6S6m3NZdR+88LfivIF95YL 8ZOJRlbbJnmUKk8IPXWSGltnYb7cw7wwmyC0IrZBtL3CEW3VG94wJvwvoDzJeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=78ERe93ui4A/H3aEZzZwgH7+//3A9NZn9mlfG8gdImo=; b=g8rr+Li0oHVoak4i5/ZDo7bd0KYsXgD+XIFgBHkZqS9P+M5ioElPIA9Rm48J89lqbHTfW4 hrsQ7EtcVsgIZIGoyEqBqekz0/4EQPsKHuwydoLydLywI1aXiO9FpI+jQ0iRU1/Rk9ojFW yfAuK7HQQLwur3lIJcbtdCY47Fxjv85M9TD3FRqcRvYnwyMDpHoswgNI/vg8PD9aHR1X8l 77Bmy3xD74orOtWmBQxOU2UyqurGFewfH8i/3yOhyI8JnQB+UVysKwL1cha9ua09gnEYd3 4eAQeir5yIhXy+Nof1e7TbVQpxxIpnAv4YTkMXkbtnfRfUbtY3sA6yfQhvs9ng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073780; a=rsa-sha256; cv=none; b=VDIC0RzLtaETVTbvXL1E1kR0dF+DQk03M8aVgjcuC6QOJZxNXU/iOgW+kW7rrUoI4+D3Vc LYG4cflhTbDJSIOZSK3JVRPzAq95zzzM5nVN761x+Ivo87QXOnRzy37TYaT/gddqAl0JC8 e6/BSLdGOj1IvaQ4I2LH/FqJjvUoR/NElZbVYQlQ5gcibhtsEiCgQJ90kibuBPBzMiuQLM ysFhKkyOoDcY5L7a2fgNbShmS2ws3ZAkf5wrV13wtTX651RFk0fYQ36P4p7YHzDkCS/2mY Lvzx+tttaHyLSMbPY5ob4cg+2hfLLIC9teRkJHUbY0qapPZIWj8f2MtbFtR7NQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWR67bCz18Fh; Wed, 3 May 2023 00:29: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 3430TdE4072004; Wed, 3 May 2023 00:29:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430TdhM072003; Wed, 3 May 2023 00:29:39 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:39 GMT Message-Id: <202305030029.3430TdhM072003@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 2c63333240f2 - stable/13 - bhyve: Accept a variable-length string name for qemu_fwcfg_add_file. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 2c63333240f259ec57d748e9b4b3520b35b15f24 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2c63333240f259ec57d748e9b4b3520b35b15f24 commit 2c63333240f259ec57d748e9b4b3520b35b15f24 Author: John Baldwin AuthorDate: 2023-03-22 19:34:34 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:06:52 +0000 bhyve: Accept a variable-length string name for qemu_fwcfg_add_file. It is illegal (UB?) to pass a shorter array to a function argument that takes a fixed-length array. Do a runtime check for names that are too long via strlen() instead. Reviewed by: markj Reported by: GCC -Wstringop-overread Differential Revision: https://reviews.freebsd.org/D39211 (cherry picked from commit 61482760a0ca198a9310d450133e9ac792b67955) --- usr.sbin/bhyve/qemu_fwcfg.c | 6 ++++-- usr.sbin/bhyve/qemu_fwcfg.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bhyve/qemu_fwcfg.c b/usr.sbin/bhyve/qemu_fwcfg.c index 2c5324dffdaa..95e713f9df4e 100644 --- a/usr.sbin/bhyve/qemu_fwcfg.c +++ b/usr.sbin/bhyve/qemu_fwcfg.c @@ -296,9 +296,11 @@ qemu_fwcfg_register_port(const char *const name, const int port, const int size, } int -qemu_fwcfg_add_file(const uint8_t name[QEMU_FWCFG_MAX_NAME], - const uint32_t size, void *const data) +qemu_fwcfg_add_file(const char *name, const uint32_t size, void *const data) { + if (strlen(name) >= QEMU_FWCFG_MAX_NAME) + return (EINVAL); + /* * QEMU specifies count as big endian. * Convert it to host endian to work with it. diff --git a/usr.sbin/bhyve/qemu_fwcfg.h b/usr.sbin/bhyve/qemu_fwcfg.h index f59087250816..f3846d64085a 100644 --- a/usr.sbin/bhyve/qemu_fwcfg.h +++ b/usr.sbin/bhyve/qemu_fwcfg.h @@ -18,6 +18,6 @@ struct qemu_fwcfg_item { uint8_t *data; }; -int qemu_fwcfg_add_file(const uint8_t name[QEMU_FWCFG_MAX_NAME], +int qemu_fwcfg_add_file(const char *name, const uint32_t size, void *const data); int qemu_fwcfg_init(struct vmctx *const ctx); From nobody Wed May 3 00:29:40 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWT1VYmz48NWk; Wed, 3 May 2023 00:29: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 4Q9yWT0sgpz3mSf; Wed, 3 May 2023 00:29:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c6rNaDsVhRM30KJtThIORhW3S0cBYb4TU+1msIXwd4Y=; b=sc1t9pbMFfWail2I1VP3Nfe6uWoHUMf7v6Lf/tsdn7uV7MQz27DpMyO9XWvW9vY6dGOgcS mhcp+MdGpbJQfMex+ikrQ3+q/eDzdHQ/BELSoW5aodq+cPiuMe6p8Ckwjyt0pTCIj7dL8A ryg0d605VtSRv+0hXlKAIuu74f5+B/cvJ0sTx8B0FumH4BSiEfBw1bSD4v1Qq25Em+OP0t xig/jb3YZ2hKy+xNAZp5jM36jkO9tgSz64rKjEGy3kX0fVIWkFWES/eSD5xff4TO81z2xz qp+WUQ8Mk+XG2kZpDYjtwlP1+AKNKPkOBqzL1BRbs5ZWzR5BeSpOmHlhQdfGOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c6rNaDsVhRM30KJtThIORhW3S0cBYb4TU+1msIXwd4Y=; b=njRHjx1uYamdX/IXwyl/2LegqeIY5c7oBwJxImrN6Nu2FESKOIZhRFj767VqtBBALbTdHx YyYtD1Z+yZMI8WQ5M+5+jrn48f6LKfAmy/0BQmvImsOEzsoKPtFHUuCOOWIMR5yJzyGld1 rriDijnKHYoCWRPbhEppAIddi652dX119RBCc6StDtejC2dPNfxHSi5+izRKfdI0PX2cKf jVFiQIETgx8JAO24MsXalKYYITqEZXJpVsqpWkm5hRxJJoM2wRiwBWr9wJ2MnwhnXMsPf/ lGV7K66KSG7t77oytGbmEgldRkpxSIq4XTp14c9ZnMMl8KjWAe87O+8lRquXuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073781; a=rsa-sha256; cv=none; b=MDss7Onji9fgxsvdMIUl7K8+02CazaLfmiF445M1Hf/UH68DVT2HcySrUHicCARCC1J0te gLvjnOsbZs509ZixWp5mngJRoBQvxyweEeLXDnQMH4GSQrq5+mKgIKZnojAZAB7DGuo28V 7D40QNeKzeCR9GpikfG87hjh77Gc9m2GvPYhqvkoufTYQK5QIgZmLfSiM4GWwaBbaxDzZ2 uqCPrW9kE8pPKrdBC1sHAxmwf06evl4fWRNAKrL3gi8xhr/4lBgdqrpvQpsPB27EfLdJOV LXuz63FMNV8AZBlb0paqY38886lu8ADwiGjDb3HeZpVi2YtJPoPjfp2fD8j3rQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWS73Cjz18TG; Wed, 3 May 2023 00:29:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3430Te0a072023; Wed, 3 May 2023 00:29:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430TeNY072022; Wed, 3 May 2023 00:29:40 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:40 GMT Message-Id: <202305030029.3430TeNY072022@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: f89431787317 - stable/13 - bhyve: Don't return -ENOMEM from qemu_fwcfg_add_file. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: f89431787317fc75a1a7b3b7ea48ad78e9e0e33f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f89431787317fc75a1a7b3b7ea48ad78e9e0e33f commit f89431787317fc75a1a7b3b7ea48ad78e9e0e33f Author: John Baldwin AuthorDate: 2023-03-22 19:34:56 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:07:05 +0000 bhyve: Don't return -ENOMEM from qemu_fwcfg_add_file. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D39212 (cherry picked from commit 7bf44831ca05c67169fd90408b514573ddbbcf9d) --- usr.sbin/bhyve/qemu_fwcfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/qemu_fwcfg.c b/usr.sbin/bhyve/qemu_fwcfg.c index 95e713f9df4e..af819dc4a952 100644 --- a/usr.sbin/bhyve/qemu_fwcfg.c +++ b/usr.sbin/bhyve/qemu_fwcfg.c @@ -335,7 +335,7 @@ qemu_fwcfg_add_file(const char *name, const uint32_t size, void *const data) warnx( "%s: Unable to allocate a new qemu fwcfg files directory (count %d)", __func__, count); - return (-ENOMEM); + return (ENOMEM); } /* copy files below file_index to new directory */ From nobody Wed May 3 00:29:42 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWV3Xx9z48N39; Wed, 3 May 2023 00:29:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q9yWV1cCzz3mbR; Wed, 3 May 2023 00:29:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=onx0WRj+/JabNNwQHqaCs7Wu+YaPJHzk7XaBGirKmI8=; b=oY9aUbW4oES2kUjeoAOWthrJjSaVPUEw1ArVYOG8EXEE9OCLDpVCFPIIz3Ro0LPDtbHoNN 8PnzkH5GClCYC4FbcMXJoy6E6YfPtNs2uUpdedHndThilCNiPALTCzLyM1gPVO5ny7LdQB huP/h3q7R+ZH53X6qzGVGnRXjF8azqlJWlnpHKdPFiO8OzoQmfwPZskTkO2M5SFi9GlezD uhpP5J6ubJ8VLhq20AmDC4wOOPLiyiWUcm7l0maboFt1fdOJxfebkO4PO+jhW0cmVioZCk 6ZsNKgha+UARY7655N/BV21+duH+LzlND+h9ShuxsBDoATKVl74y1CwEEtuOqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=onx0WRj+/JabNNwQHqaCs7Wu+YaPJHzk7XaBGirKmI8=; b=Axx9NIGggTR4USLRkJSUIXm+RDvh+ECrnVNHxq2Scn9/m8b9I4wLplq6ySaM24+K2MAMPf UQKwEr9AyxkLeiAhB1IrSyF67wAHIX1F2R2BXikDMWIBo5ZNOw2T6MJDuuoQWD65++n9lN Cit3MhbRFn3nhVJt/uSmQWW9OMqSd/JaUTql+p5Cxm5VuP/KN4c6aisaYnz/7WBm/Cxx8o +wAD6CzRiMyB0hGNcR3pmCLGYqpCsTucpJA+34PzvXCPAt112A11cOIWrSc2+xeMaM2VSQ ntDnqs7L6AAppRuxmKNFs3OKbWu0vMi8qllUWgy5bFxWle+QPNfwQoMOYZQ8XQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073782; a=rsa-sha256; cv=none; b=hXQ/T5jD+okza6Ne/XyMQWPFq+oFy26mPeUDB47BjXp8brMqNyxGtTKUzk8Gh0vqqKAyjb 2DII1z3AK2fv6OthvWlGobiaxkaWiVthIQuxXFdxvEuX1en6LCM88OfD650DRPv7WE7ze5 5/6ZQBNtWvSrGqUgbm2tqevLH5A103q5KsXbD8EHOdntD0585a7R2hY1w4p9tZYTPuJXdR b/pwt9qbA77ioZ4Ad5koHRCQr8A+sNNmnoxbI7NOSHVzv2N7LijOJaNpxI5kHoAK9PkG+g +/4WOm338NvReFTq/qNN7t46IQ6WxiYo3inmJM00ElzNJT50VvA6hZEFTKXCIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWV0k73z18TH; Wed, 3 May 2023 00:29:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3430TgC4072042; Wed, 3 May 2023 00:29:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430Tg54072041; Wed, 3 May 2023 00:29:42 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:42 GMT Message-Id: <202305030029.3430Tg54072041@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 063ba7151b3e - stable/13 - Move NO_WUNUSED_BUT_SET_VARIABLE clang helper to the right place. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 063ba7151b3ea4073e2f0d9033b4c485e43754df Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=063ba7151b3ea4073e2f0d9033b4c485e43754df commit 063ba7151b3ea4073e2f0d9033b4c485e43754df Author: John Baldwin AuthorDate: 2022-03-14 21:05:25 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:11:26 +0000 Move NO_WUNUSED_BUT_SET_VARIABLE clang helper to the right place. Reviewed by: imp, dim, emaste Sponsored by: University of Cambridge, Google, Inc. Differential Revision: https://reviews.freebsd.org/D34537 (cherry picked from commit 2814ba8ef17aa647fa52092106731bcf76a2392d) --- sys/conf/kern.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 53eb49c95c4b..bed235cf1afe 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -28,6 +28,9 @@ NO_WTAUTOLOGICAL_POINTER_COMPARE= -Wno-tautological-pointer-compare .if ${COMPILER_VERSION} >= 100000 NO_WMISLEADING_INDENTATION= -Wno-misleading-indentation .endif +.if ${COMPILER_VERSION} >= 130000 +NO_WUNUSED_BUT_SET_VARIABLE= -Wno-unused-but-set-variable +.endif .if ${COMPILER_VERSION} >= 140000 NO_WBITWISE_INSTEAD_OF_LOGICAL= -Wno-bitwise-instead-of-logical .endif From nobody Wed May 3 00:29:43 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWW3wRDz48NSY; Wed, 3 May 2023 00:29:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q9yWW2z3Mz3mbk; Wed, 3 May 2023 00:29:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EwX/TjT+uKf8r4mlwq6eNsZXUXY7idB0Km8Ya9KSgtQ=; b=pvBZ0VdHXhtY/xhsLv8ah4GOoDsd0SXZtE2oK0+zHCG9ExXDRLF8/COwr8+DeMuK1GHYAs 87Hg8nkUPxJqWDMu4uvH+wlWMLF24rgnU3l5iSkERlHAwIxVxaga6mtt0NzgPISoI4bT9Q 7JXQvoJSqJv7Xe/eoiGsgyw+/BBw4XBnq+4f7J/2sVtn0QlYYMRYXUiOyd03Qe5+t8iuGP BmVb9+5ZUX+Rj6mGf9KEBmgXqX75qNa1BCENYb3Wmnx1aE6lSgWKlqdk0OLMbxd5Wd42lg CHb/OCJQby0HeREz2meRP21oZcwz6Z6Pq2hFdnghWI29iZYSwDPWQKRE5iwyGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EwX/TjT+uKf8r4mlwq6eNsZXUXY7idB0Km8Ya9KSgtQ=; b=TT0uP4NqhFYurGr6rWhdkfyKKTWZSJ1Bg+DO7Q16TJdYNNua/YtNiPfaY07TsLeQltZtSD eT5kvA4ZM4tAjhyRrJovpQ0Mf6wty/cEoo0KVINCi66EZ0zjQ22JMgu8sWUL2PiOjdNpTN IbDpIDZ2qSBWZPm+Yo9rwe0YpNydfgbkyEG3BhV32aSwgMsATCdFBbNV6leb1euGFKcL5T dYPfW0/el7ETdJczCFsodbBo3W7itEALvLtF+TcCwYcq9pqXtn3pGtOHQK8GEpcUs9YFoN 6HBmBIRLvi48GLGRrfOD8bSyJ8r199DG+PbxAB7pIb4QTfCvCnTx2zJVu7OuGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073783; a=rsa-sha256; cv=none; b=KslJhHhjLhTMjNppucYs2pOpVn/flj8hGpyODyiGiHd+NhQs4KNT2zEzq7WjLwie5kLJCC yZgCYzpSMATLUCW9h7clu2QHxVyS3inqRKafk2sjsxDTiEzrSgoNNnGoMr2fwUxRv5NHEm uZMukHpPkkh0VzDULp+/SheAObsIX/K3ETEdLFGJ3APtydtX/7SVwsmzsbjIDV056uqJHX L0E5WdW/IwB+tSCc8HOD6g0DME2ry4OuRJWz0KA1N4hb0eMB8p9OTRVKWJM3zv+HqoaDd6 VJ5m26PfQ7Uvbvo8VzI/b8Ty+VvQbxhpV8PXimOt+/9rGMXnvMcyKgjJBvtYmA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWW246Hz18TJ; Wed, 3 May 2023 00:29:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3430Th0Q072061; Wed, 3 May 2023 00:29:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430Thgr072060; Wed, 3 May 2023 00:29:43 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:43 GMT Message-Id: <202305030029.3430Thgr072060@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: ff01fd164655 - stable/13 - Disable errors for -Wnonnull for the kernel for GCC 12. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: ff01fd164655b1ec9d0455c6a42ec5218a30b368 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ff01fd164655b1ec9d0455c6a42ec5218a30b368 commit ff01fd164655b1ec9d0455c6a42ec5218a30b368 Author: John Baldwin AuthorDate: 2022-12-21 18:46:06 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:11:57 +0000 Disable errors for -Wnonnull for the kernel for GCC 12. The USB code and some other places raise false positives when a NULL pointer is passed to an inlined function along with a separate length and the compiler can't determine that the separate length of 0 prevents the use of the NULL pointer. Differential Revision: https://reviews.freebsd.org/D37627 (cherry picked from commit 488c498b099e3f48db4048833d2b0d03d7bed3e1) --- sys/conf/kern.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index bed235cf1afe..5d902b340c2b 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -90,6 +90,9 @@ CWARNEXTRA+= -Wno-error=packed-not-aligned .if ${COMPILER_VERSION} >= 90100 CWARNEXTRA+= -Wno-address-of-packed-member \ -Wno-error=alloca-larger-than= +.if ${COMPILER_VERSION} >= 120100 +CWARNEXTRA+= -Wno-error=nonnull +.endif .endif # GCC produces false positives for functions that switch on an From nobody Wed May 3 00:29:44 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWX4RQcz48NSZ; Wed, 3 May 2023 00:29: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 4Q9yWX41YDz3mYf; Wed, 3 May 2023 00:29:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QanEIgiWnMCpwZFxFFmgd05PMnp/JCF5WrWiyQsJ8dA=; b=Dpa7B35CcNiWGfCKdSS3rYST/26Sn7JLlaHQtfDb0IZtYMvLwAjQjcsYGFKq4FVfkdkhwt LNbB+s8twKhOdCyWatxjceoX5lhMiIdUGHAzmaIGJKeqEmjL4Y1/JGx2Bgs7rWIH0cj/0D 0km3iqGyqmoFcHyEPw0Actm4U8A7SNflUHQGf4mfWkL0NeC4ZMC84aGKUgfHi+A1KerBCx bu4L2zzK94i6yq+R77NjlnHIYbjrRPOqMZRggdkNqUmf4CkHpBJXMuCdx8aFeO/LBGtY/e UCiAiJfI+HoorJ49r1IfP7FQknxqefSt63B+m08PVCqX3gTsZjhlDhnwV9K+XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073784; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QanEIgiWnMCpwZFxFFmgd05PMnp/JCF5WrWiyQsJ8dA=; b=TS2SObuYVk9aqJaiuVcoKzHceEXfx+2zIr3vjXLPBU0SXeEqlQLCWjAvPHCHsOhivBLsVK aVKAl0fy08d8zxAnfpdDf3l64ExbqiG2014oAYot6ZzPTJuyBSGbe5Iw3EpcNwE09o4nI3 vOhUV4RDOFettw5FYvXpiEWPPvXOuUhgd6G6IgvfoHDD3hWJh6/U2lSED0BXurwWYhxJA5 MWBYVuskjl9UiVFyxSELfQuY9SjKOm4qe8vIR0EKRluaKy78lGxE6HV9mSQX33FSgCFvYg XShwfnuOgmhhkhp9USuInfS+F16Fj5qErLeZlMMTp7VnWwTkQX2QySQw17CrWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073784; a=rsa-sha256; cv=none; b=BDhDj4TycjYCBwFtE33HyoJxKMIF9gvm8jyZ6Z9wJIXbZlQnFXFRboVe6bPbSmyIonL48S IswTgBpx+2nmr36ejnWz1rYCvG1TLCWzKPTa5X25vbu2HyviU21VMGqdVSG47Yy/ycG/ek jsYpu5RADFblqR8tNN1Ds31HiSPXcWT5JEw5BXrDYJvLTVH+sTQoIOltAisjVZ+op/VC6N +ZX+iMLC1upjqAFqhdrVNkNzRxVSrqpUSv5yG1ImA+d6LkvFXB3YuwZ5j6HLsrGsh4haBH zsE9OgCYVEPkDUqjsmZ78K+WUoypHa9NRQpml+7Y4t7DD2ghfccK9h7S3Jvyow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWX2zV5z17Zn; Wed, 3 May 2023 00:29: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 3430TiRt072087; Wed, 3 May 2023 00:29:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430Ti2e072086; Wed, 3 May 2023 00:29:44 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:44 GMT Message-Id: <202305030029.3430Ti2e072086@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 256b5d40e550 - stable/13 - mrsas: Don't leak a stack pointer value in the softc. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 256b5d40e5502323dddffd5a8db2ab431e9eea61 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=256b5d40e5502323dddffd5a8db2ab431e9eea61 commit 256b5d40e5502323dddffd5a8db2ab431e9eea61 Author: John Baldwin AuthorDate: 2022-12-21 18:45:26 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:12:37 +0000 mrsas: Don't leak a stack pointer value in the softc. mrsas_issue_blocked_cmd stores a pointer to an on-stack variable in its softc so that the driver can call wakeup() on the correct pointer. Once the loop around tsleep() has finished however, the pointer is no longer needed and any further use would be invalid. Clear sc->chan to NULL after the loop. Reported by: GCC -Wdangling-pointer Differential Revision: https://reviews.freebsd.org/D37628 (cherry picked from commit 9f0c0e6eede6aedb60e12888fc9751c40b364dc9) --- sys/dev/mrsas/mrsas.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/mrsas/mrsas.c b/sys/dev/mrsas/mrsas.c index 73c2ae2b0e2b..669147a89bcb 100644 --- a/sys/dev/mrsas/mrsas.c +++ b/sys/dev/mrsas/mrsas.c @@ -4012,6 +4012,7 @@ mrsas_issue_blocked_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd) } } } + sc->chan = NULL; if (cmd->cmd_status == 0xFF) { device_printf(sc->mrsas_dev, "DCMD timed out after %d " From nobody Wed May 3 00:29:45 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWY4yQGz48N8M; Wed, 3 May 2023 00:29: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 4Q9yWY4M1wz3mZB; Wed, 3 May 2023 00:29:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lfIHvyeBqNEa3gkRNVzHDy7QO8FqKC8/iBRkhhvPhRc=; b=lKkbYZFumTjjZIsqGgK+e7zxJXOYAL8r6IxgzKpRTnyoYQfGpAc+hNnrsb11y0Y4elisP/ Au9hjLa4Q9I8wj9XhvAfiWdiwfrRl0QEKZziUsAziQsyo4+njUx12lMQYlJgpt5Q7MgjJT W2zA+3dtqBiouzzyHOWNFN4sIXDKK3XhplFaBiBl3Lm6Z8GJhtbDhXpc+JBKgSL7ziiEGk 3duDQ0tJZ2o5OfqeLJpN6PfLMOfJxmpIXTu7aWu9XLGWwD11RSkWKYNjE7dGhHMjEBs4lx f6Cjym7mwlUBF4Ie/24ZLO31+B+qvghi2ErvuNYcZMraXUE2tcZFphuVBdpVog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lfIHvyeBqNEa3gkRNVzHDy7QO8FqKC8/iBRkhhvPhRc=; b=XZWD2kRmnAoG9A37sw4TgqBMQ9RlXiYEbtgO9cHV+9Zo/zZyV0VyuYx+3BB170ZRsazJcJ 8OwGp48um6XelluUYXbzSGvQlQEYrNdq4TpX1IWjh+nVzuDyMmhZ3lXFiV0L9UwUNa/0Su X7vd5pubVrBjVBadx7tIlYgIoZ4hwR9JJ4caa/IP4qX7LnwvIxsUwBwKlXPlWtlAJrUxZ/ XTXjdG/EXogoUOjvOq6CHxc6mZWlDn/j4qXKJPTsCASF6jcMQbXiMmPKcDFOH4AoL1DSBO e0kU0Fi4M2WuYkZYklPXQ9wFysGlPWquuLRZ8/2YcBYCahj44JdsMsGAztaxhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073785; a=rsa-sha256; cv=none; b=QL29YbS3mzc6vEO1bQJbz7zwCbVsgg9kv4hGtndMPTQbJtQIrau4tn4jt82KWGoC31+VeA 9mMIzbs2aiA0ZrH6nEywkZzuZyB7rTcFLzCIGgT4JGjlYWCnt3hvKck+/GTCHJZvYs48Cf 2N/EjzdD4Ea4YF/AKMMlCwo8NRzxtWJTDNxdy8b4wCZXRFP1Or/5txMGeIyUJ0+dR25idI cde2N7S4emUC2QUNxTYKcAIrkASSmdWkAk1XzkGjemeACRF8A8HWNzKXOkuRNBtS+R0Hx8 oGjxgJmYK4omxf4RlZ8hcsR5BZiNwN3HqD8/k7v5NXsCi7bVva/q/iZ2g82isg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWY3SWnz18TK; Wed, 3 May 2023 00:29:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3430Tjoj072115; Wed, 3 May 2023 00:29:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430TjEL072114; Wed, 3 May 2023 00:29:45 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:45 GMT Message-Id: <202305030029.3430TjEL072114@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 64313140e531 - stable/13 - iee80211_hwmp: Don't dereference NULL ni in debug printf. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 64313140e531622eaa5e858e8d22c663efb83d19 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=64313140e531622eaa5e858e8d22c663efb83d19 commit 64313140e531622eaa5e858e8d22c663efb83d19 Author: John Baldwin AuthorDate: 2022-12-21 18:45:45 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:12:50 +0000 iee80211_hwmp: Don't dereference NULL ni in debug printf. In this call to IEEE80211_NOTE, ni is always NULL due to the assignment a few lines earlier at the start of the function. If debug traces are enabled, then this will pass an invalid pointer as the 'mac' pointer to ieee80211_note_mac. Use IEEE80211_DPRINTF which doesn't take a 'ni' argument instead. Reported by: GCC -Wstringop-overread Reviewed by: bz, emaste Differential Revision: https://reviews.freebsd.org/D37626 (cherry picked from commit 95d146592f5ee3fa998496713f28475e65996ff9) --- sys/net80211/ieee80211_hwmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net80211/ieee80211_hwmp.c b/sys/net80211/ieee80211_hwmp.c index 77ba218ccd50..ad3de543664f 100644 --- a/sys/net80211/ieee80211_hwmp.c +++ b/sys/net80211/ieee80211_hwmp.c @@ -1928,8 +1928,8 @@ hwmp_discover(struct ieee80211vap *vap, if (rt == NULL) { rt = ieee80211_mesh_rt_add(vap, dest); if (rt == NULL) { - IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, - ni, "unable to add discovery path to %6D", + IEEE80211_DPRINTF(vap, IEEE80211_MSG_HWMP, + "unable to add discovery path to %6D", dest, ":"); vap->iv_stats.is_mesh_rtaddfailed++; goto done; From nobody Wed May 3 00:29:46 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWb2Y6Xz48NhK; Wed, 3 May 2023 00:29: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 4Q9yWZ5MrPz3n2C; Wed, 3 May 2023 00:29:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=brzcot2mjI4vSxCgtFBR0DPTwCP38GGubo2uGBX9fo4=; b=F9j9u/C++koTfJpQ7pLh1UFL08TGj6FSmI20fdoP9ANGI4jjkZCz43VjXZ9nAnmUGEJb1t Y7uCSiv4gt06O5fIwdo0ZIX0WqSUInAvP3NGo3JzemDOU3uBoQWyw2y0IuXT6BtsexYVQn r2kUzhgUdStxqTxaw2MHYhaGssW1MaONQbRdYgA0a5mJ7XYR4E56SSYo8f7dCO7HpGPm9x k21zB8K0UZSAtXx/p5IpaE855yKtyasZqoaQIejZI9u2xbSlCNX7bOyY7XGTlAKfn/IDc2 31fiPsOvNlLkhTXp/5LR2GJs+vbRY6+Ws+sKoJNazHRRPNpJUDUMdD+0y6haRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=brzcot2mjI4vSxCgtFBR0DPTwCP38GGubo2uGBX9fo4=; b=b4RAKKR9zuys4RXSK74CYfTXa2DIy1GHdRXHX49MHVjnY2SoT85P1paSqXEMsnrgMpIMEp F3zFdta3KiISCFfebaacaUWsRUlfjHt907fSs9Ic4ki5hCD1fhZ8dR6tRIF5cqDZxcH4+t /uAu1g4cltJ3H6V39ITUIkClW/MPrPPzixrlU6dcwYvCoEMbiq4+wWrX5dONBQ5IhTN+Gq IWk6Kb4eENWFuaChAbUkPsq8NyVte3s0c/OU284jwCzh0F/XaQF6BS7f51BsP7I4A0B4TD yWp817svdhrSDBi9Kc2lw36tiFDYiHpl2BXJDr3sQdKJ2HI9DRBidJQTtMwLFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073786; a=rsa-sha256; cv=none; b=k73/FSciO5aOie3+XOzxpzXt0P+joj/RnX/NBi67NbBJTozFqWt3Gc8CJ7NDtpSIaC0Tkm DPky3ROwOjpCSmhTLSkpQLPvw5b3i7p81EkHYHTvowXmO5FT+TREp9RbKsWBux8uUjIORc 0nqzV1jIUxlcgVTrVvLjbvBPCT7Fyd0JD0Zk/EwtluKupde950amSvij2711Vd/x+Els3s SxGIS0D/LEvW32tpW5INFeAbOCnGHw88DDHfOr3mYnmrKwa+NQv0udEvMVusAv270Sny/L SJqWXZQFUNMtTWUFNlsExw5kfMhqY2IdAYgDpctM/SjD7JUh3wTlMjaeuKfORQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWZ4Nb6z18Wr; Wed, 3 May 2023 00:29: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 3430Tko6072134; Wed, 3 May 2023 00:29:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430Tklh072133; Wed, 3 May 2023 00:29:46 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:46 GMT Message-Id: <202305030029.3430Tklh072133@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: ea3bb92cc3e1 - stable/13 - Disable -Wdangling-pointer for the kernel for GCC 12. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: ea3bb92cc3e196f45bd4612250494587a44a63fd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ea3bb92cc3e196f45bd4612250494587a44a63fd commit ea3bb92cc3e196f45bd4612250494587a44a63fd Author: John Baldwin AuthorDate: 2022-12-21 18:46:26 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:13:09 +0000 Disable -Wdangling-pointer for the kernel for GCC 12. Some of the warnings raised in the kernel seem to be outright bugs in the compiler (e.g. the cases in ata_xpt.c and scsi_xpt.c). Other cases are not fatal and it didn't seem to find any legitimate bugs in the kernel. Differential Revision: https://reviews.freebsd.org/D37629 (cherry picked from commit 2637ed558baacdab7a8cf789dca713bde5843e43) --- sys/conf/kern.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 5d902b340c2b..b50c82b7d913 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -91,7 +91,8 @@ CWARNEXTRA+= -Wno-error=packed-not-aligned CWARNEXTRA+= -Wno-address-of-packed-member \ -Wno-error=alloca-larger-than= .if ${COMPILER_VERSION} >= 120100 -CWARNEXTRA+= -Wno-error=nonnull +CWARNEXTRA+= -Wno-error=nonnull \ + -Wno-dangling-pointer .endif .endif From nobody Wed May 3 00:29:47 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWc1hyNz48NkZ; Wed, 3 May 2023 00:29: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 4Q9yWb62Yfz3mls; Wed, 3 May 2023 00:29:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ES0fILC/cBYyXXXjPQkWxJr8SOJdZEOSj0lHm7jiEkI=; b=j3hDqCOar4/UoZllOAHgwTvBrxVYEwxd6QEaR8lGmpNjsYBjV4/5f1Shg8wtCMs1XRjVlf WPtZKldP0bISbwb24/1HkMS+AjQ4u3cOub56RuDtWLu0pBkZw0vwNENHqdC5agKOly59tn xa/3FhaqXaTejzW03f3e0s1E2TamoUJnTYZlT8OObeQvNp0Khu4FgmnLHd1hzTM4Deb40H iCvoivttzebWImWKycAJ88FK48CsUSAyGyr2PYoEm1mzxzXPlU4+RdMwFiIRzAtHmX9BG5 6HtFySvhfUQwkLs7sOw+ChZIc27x1FePBA2uOu86/i8K5HyrAMyZfNK5bSXPqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ES0fILC/cBYyXXXjPQkWxJr8SOJdZEOSj0lHm7jiEkI=; b=iw8jCsw5vThS52rDQYgFxZyH5rcuhEjA9BiXOTNDXt30q9dYjnPQDJ8uEa6ziQMDzlSC4s 9hcAtbCkf/ei2lPYF2VU88AKIx1L5weXCE0CJ6RiIStIuWeU5LH1ebT9qpm2QB5WFCAhc9 mKEXhDwh3/hSuj2g4+K+cK5PodDuuyjnWkSfxG9oMGs522NLspZDzTv4OwOeiASSyS3mr2 WhTsBKEULrWcq+EpH2JqE3jDwRicaNp9Qhy3sNFlmHTpey9ZrGrBOXa7W7MmZDJikaINkZ T+VatTs0feTR+Ad1SnE7wUuj8C4TBcjjto3lyGGeHh9sre4+tPgrwiE8c6fL3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073787; a=rsa-sha256; cv=none; b=Vwzwl6adMuZj1n5Yuz+m6poZLK2HkEKhWh6n/j/gOhCPs4eA4aNyZcEf/aWc/3jZjr2Had JUtzxtI+n7/Feb5nM3n8TzR0iuOwpvPmr5zcbBhVRx3lnoWyZlMPxYZGbI/Ffn1EoqXNq+ SNGpzmkJQCN1Z9ff8XEyT4Hz9X9kw9LvzBpWgIeVPNshADquTR63qrjzKnwZ3LrOnulQmy XY0ZhK8Yj7z2Y/cWgqktFQWEq37tDTJW+DDmeKrAS5VojCUB02+v1uU989jRqdAMuSDlHI yHB+U0wnq8ugS6/QxXr9fSTzbz/6yFjouEcc9QMrbbAtUZARFxsYk0oiN2+wxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWb5425z189K; Wed, 3 May 2023 00:29: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 3430Tle4072157; Wed, 3 May 2023 00:29:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430Tl49072156; Wed, 3 May 2023 00:29:47 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:47 GMT Message-Id: <202305030029.3430Tl49072156@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 0f8e9a76f304 - stable/13 - Disable -Wzero-length-bounds for the kernel for GCC 12. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 0f8e9a76f3045855d099bb9fa89684016822f242 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0f8e9a76f3045855d099bb9fa89684016822f242 commit 0f8e9a76f3045855d099bb9fa89684016822f242 Author: John Baldwin AuthorDate: 2022-12-21 18:47:08 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:13:25 +0000 Disable -Wzero-length-bounds for the kernel for GCC 12. The mlx5 driver and some other OFED bits use a somewhat dubious pattern of: struct foo { uint64_t arg[0]; /* Real members of a struct */ }; The code then treats 'arg' as if it were really a kind of union such that foo.arg[N] functions similarly to (uint64_t *)foo[N]. This uses of foo.arg[N] then trigger this warning. No real bugs were found by this warning though, so just turn it off globally. Reviewed by: hselasky, kib Differential Revision: https://reviews.freebsd.org/D37630 (cherry picked from commit 1aa6d44decb33ce3eab0efe5336b75fa2dfa3733) --- sys/conf/kern.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index b50c82b7d913..281c49c7c850 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -92,7 +92,8 @@ CWARNEXTRA+= -Wno-address-of-packed-member \ -Wno-error=alloca-larger-than= .if ${COMPILER_VERSION} >= 120100 CWARNEXTRA+= -Wno-error=nonnull \ - -Wno-dangling-pointer + -Wno-dangling-pointer \ + -Wno-zero-length-bounds .endif .endif From nobody Wed May 3 00:29:48 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWd1097z48N3L; Wed, 3 May 2023 00:29: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 4Q9yWd06ZHz3n4p; Wed, 3 May 2023 00:29:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ClTU+qtubo8tIPY2aUOGEvGgJQ1SM30/nzzHIIPJpU8=; b=IBXoek1GSfBHCZJDOVBvz7QG6sngi4Q04zcLYERTSVfabZ66Gqp3+8dt6ip4SXwZ/xnOpe xvxxh2yVXBmwEy50Nw5WbnlRCbOH+dLBZn2q/dBEbpw1O1V7XiHSLtyckXrfVCI6hrLpyT pjVIoyYgd3/9DdLyDEoLI/2hrdsJ0rEIQ8XOYg4u4t73720O0ef+vNBGocJjHzAgr5lGJo puK5aD5bQp46BEDjtCwpIZ5e0u7FyKGg3hxq7TDiooT2SiqZXhXQ7YCLdhRzllaO1Q6geZ E4ScYGgRihg0NXm0S97+hGlMuLzRWIKdsPMq+iAk6wsUJqkZofzy4iiJpg+2rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ClTU+qtubo8tIPY2aUOGEvGgJQ1SM30/nzzHIIPJpU8=; b=iwu2GZYrvYAIrbUOspPFb4xcotBLiGhCrsK7ZB9R6YCmL3GQ74L0M9MqmwG+f2cKKLLSgA SQ9ea8NIreS7/298MQasBr3AgSFYCige6KW9RK42pTEfLl/Za27x97VYZjkBIxmpzTD58e maExHLbhc+ks2ZHE4Joklmsa34zC682XNSL7nb/0e9ftnJeyfpmc86RVnLtOK2Nmyr5M2Q jjM6y5k5CsrE0P9H1sAk7xFNDjA4bNERKwBlT3u9H66UlSDxG0DRiqQ0E51UMByjGKO/Hc uqxTacmxcjpH3EVMagxIAiMQoYT8cKTBGCfL5rVTsyk4GgFPuiiQBV4IwW3eAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073789; a=rsa-sha256; cv=none; b=NJyYNNlvnIaokzGozWNuLt8kkyjpFmYe8kvxKePeJE12i/b+MRiHDfQZUwLP9DiyNTVaMg YcILUZFepJU5DJBqpN4FdvzfNRrP2EiX/M2+FA0QqiG898HiwduhYrTZvrzZmkqxvyA3k8 otoc56zVAMsB1wUPX2ALZ0LxHRnsfRFHV2blUs8yaLxsIWg4xzKlJ1aD2gsdVYl+hv7XH+ yWB6vmLpwb3S4KUj9Ro0sYe1/yK83Ix98oHVs4vgvbV0kEBrZbVfBLAl3srZChzaY64EmL 4x0LZoTEMMNzgkcjl0gaq/L1wb0ErYEP+/ARe+oyPstlxkaic6yImrgKTzUXdA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWc6FZ1z18TR; Wed, 3 May 2023 00:29: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 3430TmQL072178; Wed, 3 May 2023 00:29:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430Tmon072177; Wed, 3 May 2023 00:29:48 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:48 GMT Message-Id: <202305030029.3430Tmon072177@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: ca1b2ea863bd - stable/13 - ath: Fix mismatches in array bounds. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: ca1b2ea863bd1242dcddd149b9a752c81cb4c480 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ca1b2ea863bd1242dcddd149b9a752c81cb4c480 commit ca1b2ea863bd1242dcddd149b9a752c81cb4c480 Author: John Baldwin AuthorDate: 2022-12-07 20:30:42 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:17:32 +0000 ath: Fix mismatches in array bounds. Reported by: GCC -Warray-parameter Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D37542 (cherry picked from commit c1ebd4c98fb8feab6931a536390739fc115e1805) --- sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h | 2 +- sys/dev/ath/ath_hal/ar5212/ar5212.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h index 49e887353e52..da74b4031860 100644 --- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h +++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h @@ -1411,7 +1411,7 @@ extern void ar9300_iq_calibration(struct ath_hal *ah, u_int8_t num_chains); extern void ar9300_temp_comp_cal_collect(struct ath_hal *ah); extern void ar9300_temp_comp_calibration(struct ath_hal *ah, u_int8_t num_chains); extern int16_t ar9300_get_min_cca_pwr(struct ath_hal *ah); -extern void ar9300_upload_noise_floor(struct ath_hal *ah, int is2G, int16_t nfarray[]); +extern void ar9300_upload_noise_floor(struct ath_hal *ah, int is2G, int16_t nfarray[HAL_NUM_NF_READINGS]); extern HAL_BOOL ar9300_set_tx_power_limit(struct ath_hal *ah, u_int32_t limit, u_int16_t extra_txpow, u_int16_t tpc_in_db); diff --git a/sys/dev/ath/ath_hal/ar5212/ar5212.h b/sys/dev/ath/ath_hal/ar5212/ar5212.h index f80f88c5df85..b90cba09b384 100644 --- a/sys/dev/ath/ath_hal/ar5212/ar5212.h +++ b/sys/dev/ath/ath_hal/ar5212/ar5212.h @@ -572,7 +572,7 @@ extern HAL_BOOL ar5212ResetCalValid(struct ath_hal *ah, const struct ieee80211_channel *); extern int16_t ar5212GetNoiseFloor(struct ath_hal *ah); extern void ar5212InitNfCalHistBuffer(struct ath_hal *); -extern int16_t ar5212GetNfHistMid(const int16_t calData[]); +extern int16_t ar5212GetNfHistMid(const int16_t calData[AR512_NF_CAL_HIST_MAX]); extern void ar5212SetSpurMitigation(struct ath_hal *, const struct ieee80211_channel *); extern HAL_BOOL ar5212SetAntennaSwitchInternal(struct ath_hal *ah, From nobody Wed May 3 00:29:49 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWf1zckz48NSs; Wed, 3 May 2023 00:29: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 4Q9yWf101zz3n7Y; Wed, 3 May 2023 00:29:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=djVKPK97w65+BnG/v8gdcsy65mOaDyBzZs1wfmYUkbQ=; b=BUHka6MHKdXYSGa2O7jqYDZ4y4TUHp3J4h9y/tB4HIh59M0Um1cMjXTVH3xF6b7rXkfA6L UMPBree9ptmN422jegZiFiT+fxkCTJ9YOQJp2rcauBAmulpaXEgOCpoio9RFtB9SGexFiM Vwcw7jxzE6uRYSL8y7OR87NAkthHf3YqxadVCyjORw/qtN1F/Xolrmd8a8hP9U1+0+Mmvk 2qvRGNfP6qp0CUvc4Qetsj/ZwcBC5asXChkp2EMiC6KSEXvmlypDMvx62OkDPRwWnr0PQ9 Z8WjN6/NFkh773GZZMQYq6ChbdrblAZp2oa4ESbZq6taSVftuXupMwzua2QWiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=djVKPK97w65+BnG/v8gdcsy65mOaDyBzZs1wfmYUkbQ=; b=sDf1xDkRI/8LIdcZA6OjK/W79Pta79dXRk0e2J6+1E4hznHx0BRzViG53O3XfADiGbySBu FuuXdeyLZSCVTEnx9f9mv9nvO/WNcLHHwrxghLGt6KgaAZzVPcZxcIPkC0xTMeYapO7qcz s+6cHuM6KYt9+pLvE+0lvi3sF4LX35jo0CTMMWXLIYx8ZcuhST8dF2fkuOunX+UmQnyyfE YL6K6weE50zCWCiadg0IWWCZifZXEgNi7DzFCRPl5ymO2XeBa73otUNTsYTKHt74jb5UwJ dzI2yuKxNnVY9WQe1uWLfY8IO0pCNfz6QMvFkb3rWJeJjWTxFBIi7JOuxxJ1og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073790; a=rsa-sha256; cv=none; b=CgkUv9NgSC9CtQT+2Y7bqdJLR8PqdfKAWORz1dhcKk1Mibo+OGRHG2BjaQkkW4Hzg4XINZ STGPLbYR/4kF4z8WhwdU8dl42ER8LVGQ4ggt1bPf+7X1ftaliUqcoVal8wM/AttnrH4ZHa 1ld/FBcjjfCp1skGVvGMq9V1xEykmWM7iaGVbwdBd4S512eNEVM5dDKqijKheS+mWyi3qz FvOiz2xCv9+Ys+wEeTHXieWS3wWSd0I3fQv7kY0Ou/HXUDDfj4+FYsy+sNbzxFS87Qpbk3 gK/qCpxYBrqWJv51mF3WKAFl/IsuVVA5dX1dpwguTBG4N4lfy5HT1a29rdvJKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWf05Tnz18TS; Wed, 3 May 2023 00:29: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 3430Tnkv072197; Wed, 3 May 2023 00:29:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430TnW8072196; Wed, 3 May 2023 00:29:49 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:49 GMT Message-Id: <202305030029.3430TnW8072196@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: c79901ba3d52 - stable/13 - iwi: Remove write-only status variable. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: c79901ba3d52f0cebfd5b89d619587e5ebbff201 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c79901ba3d52f0cebfd5b89d619587e5ebbff201 commit c79901ba3d52f0cebfd5b89d619587e5ebbff201 Author: John Baldwin AuthorDate: 2022-04-06 23:45:27 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:18:05 +0000 iwi: Remove write-only status variable. Skip over unused field from asresp frame header. (cherry picked from commit 99f65e9198c89e96f935986300b8ee3605d1349f) --- sys/dev/iwi/if_iwi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c index 360020e01b19..0a65d4d635c2 100644 --- a/sys/dev/iwi/if_iwi.c +++ b/sys/dev/iwi/if_iwi.c @@ -1310,7 +1310,7 @@ iwi_checkforqos(struct ieee80211vap *vap, #define SUBTYPE(wh) ((wh)->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) const uint8_t *frm, *efrm, *wme; struct ieee80211_node *ni; - uint16_t capinfo, status, associd; + uint16_t capinfo, associd; /* NB: +8 for capinfo, status, associd, and first ie */ if (!(sizeof(*wh)+8 < len && len < IEEE80211_MAX_LEN) || @@ -1330,7 +1330,7 @@ iwi_checkforqos(struct ieee80211vap *vap, capinfo = le16toh(*(const uint16_t *)frm); frm += 2; - status = le16toh(*(const uint16_t *)frm); + /* status */ frm += 2; associd = le16toh(*(const uint16_t *)frm); frm += 2; From nobody Wed May 3 00:29:51 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWg4lDNz48NSx; Wed, 3 May 2023 00:29: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 4Q9yWg1z59z3n84; Wed, 3 May 2023 00:29:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cMfSCVVwQ1Zt/KzvY0840McRLv9cfLiNJACK+N1IkT0=; b=vIVwQ4DawJBPR6IEp7nNIJznW1zM8SjvNveRSo8o9iLeJAzE2db/6GxZ4+nMzh6n7oZAq6 6+wDtYuXHDPwcft+LvctySDK4WNGcL7U9QxOphlL9VKcQKDmfPk8sE3vJU4JpFtVytv8Th /dok4OaiHjY2RTH08dcfmeLzMgv4YFiSvD+XlPjVaxiRv0wFr11Ag7lndXaniZ1bxWB8eq oXjyrcSFOlXK85FAEHhHKlpQETuEUVRoiQ4QF+vQnzBSFmIyuA103cGr2nA8H7QBGSzAtm zfQaPjdRuk2/5cFh4gLlxS87M5Plmu8qwniAZZj1f1R0wHnC833eHgGafbQPiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cMfSCVVwQ1Zt/KzvY0840McRLv9cfLiNJACK+N1IkT0=; b=PpHb0k4AEtqmaNeBI35hgWUeJb1DvcdEQnD1N5vyuKAHyYE9eKBgZ3/v6x3VLRiTlLTy7w 3QW6xeUdlLIsoVlr15ay14OwCzVmJCZaAUDiS4u+MAJUCAdbp0qIIh+/sM/joWhMzIt2Df vercCGHJhz2h1pL7tPYD6zz5s1w8Cdb5TE+u2Q0QhxWB83/NdCB5wVy30OGO3mYHm8Q7Mq EeVnOdCXHFpgmxNhZS3B84zmHo9OS1RWjdHaCJ7QNEYFKaMITrPlgjgtZhE33ujIQq7fWX Ql2Beq43wRnp9jCkaSK8novPUM84Qq6JsLW7dYGwvSKZG7u1xNTyyY1wOCUuOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073791; a=rsa-sha256; cv=none; b=cqpZ8lr40k8Zkd+hOY2F857CkKdO3Nkf1M+NttKa4fwldO88t6BecrPxcsrbjUgWkKvt0J DfPi/NRCyGonyJUt7Ly4fqHJ9jIpOt2m9iCaqn+pCLr1znQtiUorUzCLbBwaLanEsCauRO 6Ze4rpDBx/ojoVXzPgJv+wrE7qrmgnWM0shdScLd3E3kSKjnkaFpJKvipt63xlB+u116fq OnLA+0Tsu8nLjmZ38ELwNqUrLDr0lTWN6ly6I4cWjDSrnY83nGTIyjVwEIAYbyNv/yUguE Xc/euGJH8/cfFseeSObvnsclb/GbN0fNMYrIunQt6398X51QnkmPeWxMngMxoA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWg0mWkz18Ws; Wed, 3 May 2023 00:29: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 3430TpEp072225; Wed, 3 May 2023 00:29:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430TpxH072224; Wed, 3 May 2023 00:29:51 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:51 GMT Message-Id: <202305030029.3430TpxH072224@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 861585daa86a - stable/13 - iwi: Fix mismatch in array bounds. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 861585daa86ae17538728bee612ce3582f8775a6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=861585daa86ae17538728bee612ce3582f8775a6 commit 861585daa86ae17538728bee612ce3582f8775a6 Author: John Baldwin AuthorDate: 2022-12-07 20:31:01 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:18:22 +0000 iwi: Fix mismatch in array bounds. Reported by: GCC -Warray-parameter Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D37543 (cherry picked from commit f322a6cef0b142bd65c3750139ea1801513b864a) --- sys/dev/iwi/if_iwi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c index 0a65d4d635c2..c270550d1bba 100644 --- a/sys/dev/iwi/if_iwi.c +++ b/sys/dev/iwi/if_iwi.c @@ -173,7 +173,7 @@ static void iwi_rx_intr(struct iwi_softc *); static void iwi_tx_intr(struct iwi_softc *, struct iwi_tx_ring *); static void iwi_intr(void *); static int iwi_cmd(struct iwi_softc *, uint8_t, void *, uint8_t); -static void iwi_write_ibssnode(struct iwi_softc *, const u_int8_t [], int); +static void iwi_write_ibssnode(struct iwi_softc *, const u_int8_t [IEEE80211_ADDR_LEN], int); static int iwi_tx_start(struct iwi_softc *, struct mbuf *, struct ieee80211_node *, int); static int iwi_raw_xmit(struct ieee80211_node *, struct mbuf *, From nobody Wed May 3 00:29:52 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWh5Jt9z48NX4; Wed, 3 May 2023 00:29: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 4Q9yWh36J7z3nHG; Wed, 3 May 2023 00:29:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=goTNZr7H099EO4DOOMmJHpIoW1zEFGyHJNIwBhuKyjY=; b=l7+XVhXjIegZSG17y9NNt4SQxavv/lRk2wmP7H7q3O3auvo3ehxP6oib4fegapn2ecDvig 5nFBZrlo/jtDJhQbNCdLjJsno5lSFTr8LBKTwAzMWyqu1/k1b7xoNF1goHLdbrrRpftb+X 5prlM0gFhDaCHoOomJtlt76EwtodRvMRrmOy2ccCWa8MDn4WWieIFN13lJRpASLjbMrQpU oSZgZsnDem9u8XT6VNfB5Z1JLdLM8nNh4KX/a3VH0+Gu8VKgDgY0rpjcetEp0LCrMLWCcM Csz1l56QAPXFVoRac3df8vOBeigdFW7bgsnIkRnRDBjTKi6kCzzS8zmEgtc1RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=goTNZr7H099EO4DOOMmJHpIoW1zEFGyHJNIwBhuKyjY=; b=QaQ5AarHuqXj9JeJCQbV6DAKlWSOWn/4yEICNETbNDetXxnKtygi/xrY1xlLNOMevJm0RV 4c1HFVpQX6QerSJO+7IU899LPpWkstYujHNG4znOFK1jd8LszX3VbCuadcC+RgzikYGaod jXUFrLOsSzvp+ayDGP6DcbPf1iA4PlGJC6nGmBCXB0os6JvDOr4NaARRHlpoBtewzJC7p1 eTdQ3Y5tvxVwY9EefOffHOefTqfGSWsVfXYw4YxXyuK8RYhK8o8lCq3ShVFJSJMxAQB4ig bBc1MXklX5S6EHnbRMP9X1iJJIkcsnGPG27Mh1rStr8Ncw8k9d953ss0BXRp6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073792; a=rsa-sha256; cv=none; b=hyhxyGhGHOR6d2vIwDQHSOQU7MajxyssYRixwkFIrkWN8WnSrTZAjUjqkmEI2G1TxxJF2y Ua2wN2lrlIF/iZTT/Ocm1qnsxWuBVQAiCxNYlLNOQrvbiqEypKE/Al0CDoQI7iJIytOJX5 zgGqxeIYHT1hD+tmahOO+ZMYBN9ldxbN2XHqSOSKGaJLWQSgCG8SmmENWwqZ5RIQ32Cl1l Wx/cseSaFeYwr+gp7KcDaBDjehHtBPCedoyh/bLG3ufoBAidBys2/9dXIuKT7iFWfLi+bw gVDMnn+N7axZBqp4nK/sjVQsuUjL9T4Skn8TJKPCVrgSKJ4qV7dYe41WJ8yf8A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWh1yKsz18Wt; Wed, 3 May 2023 00:29: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 3430TqjZ072247; Wed, 3 May 2023 00:29:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430TqYo072246; Wed, 3 May 2023 00:29:52 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:52 GMT Message-Id: <202305030029.3430TqYo072246@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 4f58d7654381 - stable/13 - malo: Fix mismatch in array bounds. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 4f58d7654381a6e9b8b71b8ac154de20e19f9b10 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4f58d7654381a6e9b8b71b8ac154de20e19f9b10 commit 4f58d7654381a6e9b8b71b8ac154de20e19f9b10 Author: John Baldwin AuthorDate: 2022-12-07 20:31:16 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:18:37 +0000 malo: Fix mismatch in array bounds. Reported by: GCC -Warray-parameter Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D37544 (cherry picked from commit 8b45e0c180114e1059767d0920ad6e6bfdeb37ce) --- sys/dev/malo/if_malohal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/malo/if_malohal.h b/sys/dev/malo/if_malohal.h index 8322f18ef739..6a68a41afea9 100644 --- a/sys/dev/malo/if_malohal.h +++ b/sys/dev/malo/if_malohal.h @@ -223,7 +223,7 @@ int malo_hal_setmaxtxpwr(struct malo_hal *, uint16_t); int malo_hal_settxpower(struct malo_hal *, const struct malo_hal_channel *); int malo_hal_setpromisc(struct malo_hal *, int); int malo_hal_setassocid(struct malo_hal *, - const uint8_t[], uint16_t); + const uint8_t[IEEE80211_ADDR_LEN], uint16_t); void malo_hal_txstart(struct malo_hal *, int); void malo_hal_getisr(struct malo_hal *, uint32_t *); void malo_hal_cmddone(struct malo_hal *); From nobody Wed May 3 00:29:53 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWj4v8Jz48NXB; Wed, 3 May 2023 00:29:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q9yWj3llFz3nCN; Wed, 3 May 2023 00:29:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WFUF2BnIK7ZCOPbG1WjsPBNKwi0Kw4GPYfZdjk6Wrc0=; b=Rnw3KSSJqlU0+3kI5eIKRrbi1YjRwL4/Cz9hWhtWyCyoxtjFYvbTBBGsJuDi/09mEKbwUF lIYpdjcPGMMFYifcVt+wxQsQpBLeL1R6wVzywEBPPS0H2lTngJgxaMnuyjX93Ecsgq0RDP WxZT42njm3g9spvJtOIA51u2T19IQQytSVHb3yoPjaNs33dIMmdOnCDuSLrVvpnsqVWlB7 LImwk+Naoh4vxl1P42XGH90fEZWMP1Ew7EFeOGkuJfz0yLmXNHE/o/JEw3nvvhTnLN6Uef 5DR3N1uIJpKq+I13rNvdrfAvojdyI0Oljj/Umh08DCdxzY7b4cWF8DHLJLeJGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WFUF2BnIK7ZCOPbG1WjsPBNKwi0Kw4GPYfZdjk6Wrc0=; b=bkBl2W/vDXIxWBiCuyUrJMqivrbyH3ALvRAXJUuH7Fb/TNZb87W648vGwdOgWlSR7Bbj3X I0z/T/zF81SMG/+MOKgN0dNfwY6Jv7DsDa0oMZwKynYsKghPqX/UbEPEXE99GM8U9ugeDw qnmoXc3cP8T8qLCrWlOrdJXKC/ld2EAooJ+kEZ+Peu/6QUYNPG+fJ1xs3Gugy7Mj9Knof7 1PmKYbI4DgLBb+8zJ9vvfqzuI3vM2cgdMyGjP+7/m7qYsh5fIlKM23bI8y9tH/rUdqNZgn 3+7O0HFx2E2fDVmD/A62bxtpQ2PqCnsjUepvovH31MCkkW3ww/hgicloa/YFDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073793; a=rsa-sha256; cv=none; b=f/Ovp1z4xznbRcDzohtWlFEaa5O3trylU6TyALV/PyrzWKHsI0hrnT1onN+UdfCkcslJli 8F+q3Fd0Nex5/P0CWEPslVNr2VUvhoQvKt08GRd8P1D7aLj6UyxXjcERqyUTWR88r25GoV xLVnNEMk0ScJjTwg7JIWg0X1WePY7a47+S74AwFkht0oD+KiWVjh+MH6nbUVd3G9c88Ox6 1IiF2uiUkZIyyFUzQhNzzHmG+4+7ouPffRZmAwG9Eu25IlaxhjQaYeSFc9bvD51tVAwDOy Rjm+wu8lyaU+O2R8EYplvnR35MQ72KG0ZvNoLiyVn1N7XJ3c37rxsG8R7W6s1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWj2jcWz18TT; Wed, 3 May 2023 00:29:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3430Tr4A072271; Wed, 3 May 2023 00:29:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430TrD0072270; Wed, 3 May 2023 00:29:53 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:53 GMT Message-Id: <202305030029.3430TrD0072270@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: b7c11b67cbc5 - stable/13 - ocs: Remove unused variable. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: b7c11b67cbc53972dcb1ad492af2de738242ff37 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b7c11b67cbc53972dcb1ad492af2de738242ff37 commit b7c11b67cbc53972dcb1ad492af2de738242ff37 Author: John Baldwin AuthorDate: 2022-04-08 00:01:27 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:18:53 +0000 ocs: Remove unused variable. (cherry picked from commit afda855350685d994f3fa5702079ce782563ee8f) --- sys/dev/ocs_fc/ocs_xport.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/dev/ocs_fc/ocs_xport.c b/sys/dev/ocs_fc/ocs_xport.c index 6170413a3d89..810c508d3010 100644 --- a/sys/dev/ocs_fc/ocs_xport.c +++ b/sys/dev/ocs_fc/ocs_xport.c @@ -197,7 +197,6 @@ ocs_xport_attach(ocs_xport_t *xport) /* booleans used for cleanup if initialization fails */ uint8_t io_pool_created = FALSE; uint8_t node_pool_created = FALSE; - uint8_t rq_threads_created = FALSE; ocs_list_init(&ocs->domain_list, ocs_domain_t, link); @@ -279,7 +278,6 @@ ocs_xport_attach(ocs_xport_t *xport) ocs_log_err(ocs, "failure creating RQ threads\n"); goto ocs_xport_attach_cleanup; } - rq_threads_created = TRUE; return 0; From nobody Wed May 3 00:29:54 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWk5Kz6z48NYb; Wed, 3 May 2023 00:29:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q9yWk4P88z3n4S; Wed, 3 May 2023 00:29:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=euwNBibl5bSZ/CnRljWqizlKjjlqaZzkTIzkWKXlkT0=; b=twB5KMpC2IrpRoDJ01gCCssM1ISrigFfFBYs6HCKYx9aXQEwmNwPckB2wotPKTGUIRI1wL Fibc1448epubMG1HikbJ+RfouHnUkPXPA8aAyScXWwLi8D7qcMSVisA8z1mhqRI63gNntH P7iNdgQ6slX1t9uU+1xmtQLk0XxZabCVDZD7Kj+heIQiPywEkO7sg+dORM45biIEdiBbtE 4DfK/0MeqbUXWLL5d7z3wYdnAp0t+gurjlaNOS2VFTBbme4llruWN3Ey2R+IY9STPtRptW T/MCfq+P2RMod5g3eS8C8qvG5FFNGOubF/WL9CHhKjZtdSSoW9Zxz1tV9ONxDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=euwNBibl5bSZ/CnRljWqizlKjjlqaZzkTIzkWKXlkT0=; b=vo51thooUCZTEjfSKt69ufgN/PIVqXB9zbm/FCUUx45D473DIEueQ7pgLbO/b0l06fvmgZ h/WWyxD1ugn1zbW1i4YPx6QKIynjgxx/GrfUT6CwGA6HklTYFBr3NPD2T/ilPphPvLUZcB deXTNnuTmYZDUmEHjPbI8KotgLFy8W0O0aXF+6T+NaHK8qFXb9bTaGepEaMSMl6Xa7t0+C K8OOXkd7E+B7Zlm5l60aX/mXFu2cHJbAu9LgQGcbH0ahXWNTtX6U6VriFSNXsZvYLRDtpX u480gVSzjSk8LVV/mR4AOFvwU1iWX+PcPWpPCkERQ79F/+1Gm6/5TWVhs3UYYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073794; a=rsa-sha256; cv=none; b=W9t0DXEK+ZADC27zryRLp1wPXYgbyhSBHhgJ9iqPffkTCUocD38AgwIzXMPuAiOK+GNtsH EqZrYye+dsV2UmeDz7zRXTeQEhEvhu9s//VPaGkvQ3H08LO1nvgl2FzERD6p9oZmNHfL4N j7bxfWah5TyOptAcpEwh39Wnth1IDwpN3qQekvCEhznxjPWgVoF9Ek9t9Kgf1hqhcR9QdJ KsmBW9D6fzq58krojplZaKKHJKYd5OlWIRNMHshJdzG5Ge+woFCRDhr78tYbKOFpL1hOMm t2bwe3rvds4uBSFOyqD6BJLoPlv3uCunty1RpgqA0QX4Gi2UiWD7yz8nZ+eQ2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWk3M3Dz18Wv; Wed, 3 May 2023 00:29:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3430Tse3072291; Wed, 3 May 2023 00:29:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430Tsbu072290; Wed, 3 May 2023 00:29:54 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:54 GMT Message-Id: <202305030029.3430Tsbu072290@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 5c64fbe7651c - stable/13 - ocs: Fix mismatch in array bounds. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 5c64fbe7651ceb3a3f20c1bd76fb22cf635b8605 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5c64fbe7651ceb3a3f20c1bd76fb22cf635b8605 commit 5c64fbe7651ceb3a3f20c1bd76fb22cf635b8605 Author: John Baldwin AuthorDate: 2022-12-07 20:31:33 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:19:01 +0000 ocs: Fix mismatch in array bounds. Reported by: GCC -Warray-parameter Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D37545 (cherry picked from commit fb4a86164dc5ded5b42b7511d3bf48ae11ec891e) --- sys/dev/ocs_fc/sli4.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ocs_fc/sli4.h b/sys/dev/ocs_fc/sli4.h index c8bb9ab5c015..902235c410f7 100644 --- a/sys/dev/ocs_fc/sli4.h +++ b/sys/dev/ocs_fc/sli4.h @@ -3675,7 +3675,7 @@ typedef struct { } sli4_cmd_rq_cfg_t; extern int32_t sli_cmd_reg_fcfi(sli4_t *, void *, size_t, uint16_t, sli4_cmd_rq_cfg_t rq_cfg[SLI4_CMD_REG_FCFI_NUM_RQ_CFG], uint16_t); -extern int32_t sli_cmd_reg_fcfi_mrq(sli4_t *, void *, size_t, uint8_t, uint16_t, uint16_t, uint8_t, uint8_t , uint16_t, sli4_cmd_rq_cfg_t *); +extern int32_t sli_cmd_reg_fcfi_mrq(sli4_t *, void *, size_t, uint8_t, uint16_t, uint16_t, uint8_t, uint8_t , uint16_t, sli4_cmd_rq_cfg_t rq_cfg[SLI4_CMD_REG_FCFI_NUM_RQ_CFG]); extern int32_t sli_cmd_reg_rpi(sli4_t *, void *, size_t, uint32_t, uint16_t, uint16_t, ocs_dma_t *, uint8_t, uint8_t); extern int32_t sli_cmd_reg_vfi(sli4_t *, void *, size_t, ocs_domain_t *); From nobody Wed May 3 00:29:55 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWl69pDz48Nf2; Wed, 3 May 2023 00:29:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q9yWl5ZvHz3nJq; Wed, 3 May 2023 00:29:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WFXBG049ncBSfLwgHkmMwWyjC5sOQnhZPtZHh08UBrE=; b=btGv3RIyxhhh1OlmsUa5wxAbUiVPohKmIpXFgxkeJCnQFRgxRtppY1lIayIDtZClaKTl+4 kkhHg0lJHRw3DVtvR2kedYULVm+Cqn3eoPGpbDEzsmFg/p3A/oTz/6sCKbXZ174thLdThp qk/Go7/2tsr4TH4U6zfZqPdkvD3xBCnTqST0cESgS8Vl5iEmc0FaIb7RXNiOQmtk0S5FLW 0dSe+szKw6o0wh28ddpscpcPxjoNzjm2ilG5otdXPIFdU5N9ea6UC2ZNMljyElDA97iLNq BZWVV/sHhWERc2F8AZ9famgj8bxuGbt0D3uHOicdyOg3lfnteJbNVGdFOQVcBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WFXBG049ncBSfLwgHkmMwWyjC5sOQnhZPtZHh08UBrE=; b=egyTTWEfLDvSBd8dS5ZRIw7nIxEIRqARPvObiDIYfF8QDZNtHEVHIJ8Dqng/+5sJvtrXY3 yCgv2/+rMBv7+I4C4CORY9EHdsLoa8VodBWUchd6iNslFUdXDi9EoeW0wV7eAqTLuUd4FN LZT8osbu3pybMysz9gcAL86bCCCVsGE8iCDSkRmY3UrM6mbBKgBYhpJ3qljEoAsC8UT0cA bvKP9H65L1owR1O5XefqySitFqNgHd03NGXjhp6KMByw5N1ijIFPxoEwxwf93LmW37UT6u Hi89j03+vyY5+ehSIotdsyy0dj5fhQZ9LI3Vhw9XvURUEYyi9NZdfHSHIaGwXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073795; a=rsa-sha256; cv=none; b=IktfXdTAgn11b5zKfL5y7cuqiqw0OSxEnB5nhhkcaU24MMFDeGOWY15e+TrhngZxmWA8EQ c4insNsQ4swBbRDPqqoDg7EK4yOMnVf2sLYIet/O5irW0txJK8YJKcjnjGh957BOOzn7/i fXMq+AI0rQa8/tUkR3p2uuKTtrQqV54E12xChXOmfW4QUOpyaTX4Zd2XHero7whpn73cj+ aj48+8etK/ncPXXmMHy678GKNnYHc8tjq021xDGpF3Pdxd0uYYHFTp/3EAVdo4pIze6/VL uaxbbixXIGmV+Z6XIZnv30rlo7fiY+U5KHw5vVXpRr+nOEHXYNMASlyY3mR+xQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWl4Q0Lz18Ww; Wed, 3 May 2023 00:29:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3430TtNI072310; Wed, 3 May 2023 00:29:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430TtqZ072309; Wed, 3 May 2023 00:29:55 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:55 GMT Message-Id: <202305030029.3430TtqZ072309@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: a5cc1f650ca3 - stable/13 - sys: Stop enabling -Wnested-externs. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: a5cc1f650ca30144badf10fbd5c37f0fe7d7c36b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=a5cc1f650ca30144badf10fbd5c37f0fe7d7c36b commit a5cc1f650ca30144badf10fbd5c37f0fe7d7c36b Author: John Baldwin AuthorDate: 2023-03-22 19:35:09 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:19:51 +0000 sys: Stop enabling -Wnested-externs. clang doesn't implement this warning, so violations are only caught by GCC. It is also no longer a common practice to use this as it was in the original BSD code, so the need for the warning is not as important as when it was used to do cleanups 20 years ago. A recent commit (c3179891f897d840f578a5139839fcacb587c96d) triggers this warning on GCC, but that commit uses nested externs purposefully. Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D39214 (cherry picked from commit 4ffeb3b88ed228e72e13abe1be888c77c6ede95d) --- sys/conf/kern.mk | 2 +- sys/conf/kern.pre.mk | 1 - sys/conf/kmod.mk | 3 +-- sys/modules/pms/Makefile | 1 - 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 281c49c7c850..d37d80793929 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -3,7 +3,7 @@ # # Warning flags for compiling the kernel and components of the kernel: # -CWARNFLAGS?= -Wall -Wnested-externs -Wstrict-prototypes \ +CWARNFLAGS?= -Wall -Wstrict-prototypes \ -Wmissing-prototypes -Wpointer-arith -Wcast-qual \ -Wundef -Wno-pointer-sign ${FORMAT_EXTENSIONS} \ -Wmissing-include-dirs -fdiagnostics-show-option \ diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index a12aff2c2816..3105d2c32c8f 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -246,7 +246,6 @@ CDDL_CFLAGS= \ -Wno-duplicate-decl-specifier \ -Wno-missing-braces \ -Wno-missing-prototypes \ - -Wno-nested-externs \ -Wno-parentheses \ -Wno-pointer-arith \ -Wno-strict-prototypes \ diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index 134b150af1d9..a952e3190dec 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -550,8 +550,7 @@ OPENZFS_CFLAGS= \ -I${SYSDIR}/cddl/compat/opensolaris \ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h -OPENZFS_CWARNFLAGS= \ - -Wno-nested-externs +OPENZFS_CWARNFLAGS= .include .include diff --git a/sys/modules/pms/Makefile b/sys/modules/pms/Makefile index 4dc00b75ff6f..3219b3e0e4a3 100644 --- a/sys/modules/pms/Makefile +++ b/sys/modules/pms/Makefile @@ -22,7 +22,6 @@ CFLAGS+=-fms-extensions CFLAGS+=-Wredundant-decls CFLAGS+=-Wunused-variable -CFLAGS+=-Wnested-externs CFLAGS+=-Woverflow CFLAGS+=-Wmissing-prototypes CFLAGS+=-Wparentheses From nobody Wed May 3 00:29:56 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWn1schz48NXF; Wed, 3 May 2023 00:29: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 4Q9yWm6RDlz3nWp; Wed, 3 May 2023 00:29:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073796; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C/TSHjB2I6mqy/JUubElbBSa8+797ZCyywPhzeIKnVI=; b=yhecbUEOtClNSagV/76UNqxcmx8UUo7TJG6NnjPNqi3E0y4QMq1AAED7hquQmc6l+jbNLN w8Yq2LG2SDhMYR3XqfWStAyhbKX6NnFKgMVNUS6vacJjFKwa62idRS5ShjzLBqD46L25Ct 9r9xTbZyO3cHecmttmGhJfCGHM/FpkGZkCeY2KuIG5qWdHUQZtZFYqSo5Qo/GJVrPubLIk kcB9KQvT4iam6UsydQ3l32B5UeSh5yjQZAqBMpTLcP9zvBS6NJOm4XzVqmA7wgXtXRTCQf 0ejJhT3XcTH8ShgOSAX213JjahYpYBYGgq++fqGrqhydD9Cn25Fb9FMGGqjKfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073796; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C/TSHjB2I6mqy/JUubElbBSa8+797ZCyywPhzeIKnVI=; b=JrUdkgp+/c3kdtm3iCm7Sk6mhKZjDy2OP8RW5WXv4YZFnnV2BSN8QDFiqV+geC6OEFHFyx hyLX2L34KEuP+C/ADEXNTBl89G0X1EHOTY2oXoYmyDlpHBc2WZq2UKzDipfsUK021B0MZo VHaUJ5kUxSTR5kaSF0z5mXfMlAeisXxtBJ9Y8UP5CqXwPsgDiAuWk7s8gj6rDbls1JRfyg E2VhfK6uvbSX1EztaHtkPn1VDIs2hUNb2JGnQMb1cVlD0OBeSSOrfbEQce90sc5jD6hzrs XKsdKi67dUV/U6EILJ/6lE9zMtFmMyU4N3XL80spHvrpc1DJiu14X0pXVkqW9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073796; a=rsa-sha256; cv=none; b=hB6snqABQtvZUjC+hu4H+A7rX+fzjDgDRuzgUTGR5fMq04D1hlfol8eBCtdXQzbhKL+3IF Tyiv4yye7n4gf+n+JekbnpWr/xVgukJGPd/Z21yCzGx2BF/rdmdES4lE+gHf/4psT/cF8+ JlthW/S8az4uPgodezn2Y9GVwi7C7CB3jTBZVHh4EC62EyV/t/YLX+fW76EiwK6oVIFsKK 4/XC7R1RvOdvRLfa1B8mxGsoyHlJ3jMB9Go/6fTAeL0iJI7jj0Ua6Lw53GmF51NJoCsHR6 QBWzmjLFqOY1luM1haINzqN0NxNvmN5qf9u6gyOv79Nxye29xQ4pyPyprIlYIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWm5SMyz18J9; Wed, 3 May 2023 00:29: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 3430Tun4072335; Wed, 3 May 2023 00:29:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430TuCH072334; Wed, 3 May 2023 00:29:56 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:56 GMT Message-Id: <202305030029.3430TuCH072334@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 65413a38270f - stable/13 - net80211: Fix mismatches in array bounds. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 65413a38270f074d1d3e4562718e95050dfd8452 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=65413a38270f074d1d3e4562718e95050dfd8452 commit 65413a38270f074d1d3e4562718e95050dfd8452 Author: John Baldwin AuthorDate: 2022-12-07 20:31:53 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:21:13 +0000 net80211: Fix mismatches in array bounds. Reported by: GCC -Warray-parameter Reviewed by: imp, emaste (earlier version) Differential Revision: https://reviews.freebsd.org/D37546 (cherry picked from commit 1f078120955947c85c54a8c088782ea5e4451eb5) --- sys/net80211/ieee80211_node.h | 2 +- sys/net80211/ieee80211_proto.h | 4 ++-- sys/net80211/ieee80211_scan.c | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h index 0e885440687c..5782d513de08 100644 --- a/sys/net80211/ieee80211_node.h +++ b/sys/net80211/ieee80211_node.h @@ -435,7 +435,7 @@ struct ieee80211_node * ieee80211_find_rxnode_withkey_debug( const struct ieee80211_frame_min *, uint16_t keyix, const char *func, int line); struct ieee80211_node *ieee80211_find_txnode_debug(struct ieee80211vap *, - const uint8_t *, + const uint8_t macaddr[IEEE80211_ADDR_LEN], const char *func, int line); #define ieee80211_free_node(ni) \ ieee80211_free_node_debug(ni, __func__, __LINE__) diff --git a/sys/net80211/ieee80211_proto.h b/sys/net80211/ieee80211_proto.h index 4b324caa694b..e9b5157716d4 100644 --- a/sys/net80211/ieee80211_proto.h +++ b/sys/net80211/ieee80211_proto.h @@ -459,8 +459,8 @@ void ieee80211_notify_cac(struct ieee80211com *, enum ieee80211_notify_cac_event); void ieee80211_notify_node_deauth(struct ieee80211_node *); void ieee80211_notify_node_auth(struct ieee80211_node *); -void ieee80211_notify_country(struct ieee80211vap *, const uint8_t [], - const uint8_t cc[2]); +void ieee80211_notify_country(struct ieee80211vap *, + const uint8_t [IEEE80211_ADDR_LEN], const uint8_t cc[2]); void ieee80211_notify_radio(struct ieee80211com *, int); void ieee80211_notify_ifnet_change(struct ieee80211vap *); #endif /* _NET80211_IEEE80211_PROTO_H_ */ diff --git a/sys/net80211/ieee80211_scan.c b/sys/net80211/ieee80211_scan.c index 1e07aacfc201..50b3151063fa 100644 --- a/sys/net80211/ieee80211_scan.c +++ b/sys/net80211/ieee80211_scan.c @@ -607,7 +607,8 @@ ieee80211_scan_timeout(struct ieee80211com *ic) * Mark a scan cache entry after a successful associate. */ void -ieee80211_scan_assoc_success(struct ieee80211vap *vap, const uint8_t mac[]) +ieee80211_scan_assoc_success(struct ieee80211vap *vap, + const uint8_t mac[IEEE80211_ADDR_LEN]) { struct ieee80211_scan_state *ss = vap->iv_ic->ic_scan; @@ -623,7 +624,7 @@ ieee80211_scan_assoc_success(struct ieee80211vap *vap, const uint8_t mac[]) */ void ieee80211_scan_assoc_fail(struct ieee80211vap *vap, - const uint8_t mac[], int reason) + const uint8_t mac[IEEE80211_ADDR_LEN], int reason) { struct ieee80211_scan_state *ss = vap->iv_ic->ic_scan; From nobody Wed May 3 00:29:57 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWp17TRz48NT6; Wed, 3 May 2023 00:29:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q9yWp09rsz3nX7; Wed, 3 May 2023 00:29:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1DVhakeYBqzUbKYD4ziig62VqqSJi8JglmPO2lrwukY=; b=Y42wWhtQjhRErWPVKQUoyFt1NkbwHgQNHBnWaWnuH8XTTSZTCorloH9Tgmtyt6oNwBu84U eQdz4RQoIKGeLQE+oKw/nLF4i0s+cZ7G9D2kozMH+Wi7qBANdFMrjbhJBNbJuqmyYkgASm QhbbiJEO++5Xkp+N7ZlZZn/F4OO7dkZDNd9mkHHnr32AQFTug8kImO9Oa3Q8VR18HP/lFZ 9YWkW3dNWpY8Q82nYTKSjQDLdrpu+9pwTECJOnY1+zzsrsHpx0ddTMYJ2fV4Ad2QebnED+ wLYOc8A7RHRIrEjzpUmmQwHDNZ8uFqJq+aMXG6MAXo6M7m5I+6QvMTa/ZgodGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1DVhakeYBqzUbKYD4ziig62VqqSJi8JglmPO2lrwukY=; b=N/pE8/O2/A2OMfVVVEQYP19VgZjMnh2YLj2IsnUDehKnCZM8jrcT5ewfNua/eFv7gjoZQD Y83QxSD+0c1UWnaOoINzgJvT1fkVHXFYYB26tGWjkg4nMsndFZBeWVS5TXVCz/WaOxOX8t gQ9GkG8RbGjYRG2/Q1jL87RvCr6Ohh8Z3HJLguNdbF9KMFEVyU11U5WCjDq42tSyLM26DX gtK3Ve7SaQ+6jpJVeI+DYWXhVwhrE+4MfiSyBd5Ms6nULwMB1J5z+e35vOeeeLiRZ88oYg Gm3AIcNRzPiXWr6MEqxyrdw/nCv1fvyypmgx0TLU/Yq6ex+Un+71L5+YEKkhuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073798; a=rsa-sha256; cv=none; b=cZhKnx7BD7jaNDDCGzPClmGbf+4icuhDx0W7U8OFOA5eJwFUGOLfyjx7DFmAAG6/wlDldN J63sZJB6hhkSzkUoqbnqSrj3O72s1MWNKtINrtsONgMiiEtxWnvAvAQvmDBmrjP1avkJDB r3zWpK/3DJbbrbcZHOHiq95Z6Yl2R9hdNh8819MZXDOedOKgtyevADZHUni5paROEky3Zp t3/WhYRQRcccAkXm9sD9zUTkcNV8S4px1JMi4NTM6NPPkCxzJpA5PSweilzindynsT1cwD QlXaKc7+DUbGdb+uVMX7SHfKB1OI/3IMDnnIfScnc3qP8k+ePr202fq3S9NnsA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWn6K3gz182f; Wed, 3 May 2023 00:29: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 3430TviH072355; Wed, 3 May 2023 00:29:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430Tv68072354; Wed, 3 May 2023 00:29:57 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:57 GMT Message-Id: <202305030029.3430Tv68072354@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: da0afdcc61e2 - stable/13 - mlx5: Fix mismatch in array bounds. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: da0afdcc61e2e020db40fcfc103c3f633fe7d393 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=da0afdcc61e2e020db40fcfc103c3f633fe7d393 commit da0afdcc61e2e020db40fcfc103c3f633fe7d393 Author: John Baldwin AuthorDate: 2022-12-07 20:32:54 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:22:29 +0000 mlx5: Fix mismatch in array bounds. Reported by: GCC -Warray-parameter Reviewed by: hselasky, imp, emaste (earlier version) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D37549 (cherry picked from commit 47cc457bd6c16352b47d3fb1288f745482a082af) --- sys/dev/mlx5/vport.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/mlx5/vport.h b/sys/dev/mlx5/vport.h index c8eabd1051d4..844ae92602cd 100644 --- a/sys/dev/mlx5/vport.h +++ b/sys/dev/mlx5/vport.h @@ -84,7 +84,7 @@ int mlx5_modify_nic_vport_promisc(struct mlx5_core_dev *mdev, int mlx5_query_nic_vport_mac_address(struct mlx5_core_dev *mdev, u16 vport, u8 *addr); int mlx5_modify_nic_vport_mac_address(struct mlx5_core_dev *dev, - u16 vport, u8 mac[ETH_ALEN]); + u16 vport, u8 *addr); int mlx5_set_nic_vport_current_mac(struct mlx5_core_dev *mdev, int vport, bool other_vport, u8 *addr); int mlx5_query_nic_vport_min_inline(struct mlx5_core_dev *mdev, From nobody Wed May 3 00:29:58 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWq2Jg8z48NXL; Wed, 3 May 2023 00:29: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 4Q9yWq1PxNz3ngZ; Wed, 3 May 2023 00:29:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QpAkV+Zf2fF/CCyw18V/acjBlhjxJzyZkEWhyx+2hWk=; b=jncBUe1+C17Fphd4LHNftI3hQRHBwn/91IskCG07UwLxZUQhCHQ3beCVIE6I6croO7wf29 dYlI9VD/YVUUEHD0P5erVkgXlJFYeqrAKR3nZYroczdjVjU1lynSsMKCJIaFMZ6maqXRp8 dDkVZlMCCPGwfoaUColWatLaLXraJF2qKmFStFec24v/KOsSGtEKs804yR8/POk47y/dNz Gz+59BJeBxg35zQv+y9WsdkiOKYhiDFV7sNpaHarcPU5kA8jHIJtdNQxGyjc5RpB7HrS1f q9/bAPhoj38hwtWZsw8NJcC6oUufQszIKFzGaZ7pms7pKj+e3WZ0E7w7CIU4pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QpAkV+Zf2fF/CCyw18V/acjBlhjxJzyZkEWhyx+2hWk=; b=uktvvsFdmI7yRwwz52fGYAOBzvYiWk46N53gUU9BeXaCUBJFnxmcnZZoE5MP83jFFc1ol0 3Bu9wjCszyiAxe9tOHP2TGz0hf1JPFocoyfRROdCjiFh2tjvkdXnEGhduRlOxCcLRSG11s ZdJRVDLONVhWkjZldyNsdH3Hex24b8hXY5FBQ/8O6JWw86N/yiHoKajUe9fjKhZTWI6KSB sGcUpuauFgVP4CaLVMNY65+WvxCOkfW9zMXprM2GUlnXpADnr1E4AdUh5Y1xCR/ouGdIIA aOlcqB8u60Xwx9123Nvg1uqss0whX7PqQdzo9u9ObEbBfCPZDPu8WGy9UBaMmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073799; a=rsa-sha256; cv=none; b=shVhiWw/iXnfIS6aWWFBm4YM2bI1186TMNp039+XsCpVSN5Ke4fCueddtABfn8FYODqo1R PUAyurxc1eTd1UZSu3C3S+TBg6nv2Yydns0Go8MbhoOlZ81dOV8FcgTCA3EWQQd/UhTEL7 mltH/+x/2enQyFqzHjM7BD3YjIzPCR1UsPUR2d8BQXi2Ajl4sXp7zgPalO4bxntHdVUlEz LHajqAX2hWOLo8r6C1LT9GXvv5lRI8/NJe5mkL5FZv+6uaiT3QShavImrDyITGnW57Hsgx qmO9J/Djbez/USCyvBgI73nePHyi4Q3+mGmxEx+1Vhl6Zl+LlzNGMz34EmctMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWq0SCBz189L; Wed, 3 May 2023 00:29:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3430Tw98072374; Wed, 3 May 2023 00:29:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430Twv4072373; Wed, 3 May 2023 00:29:58 GMT (envelope-from git) Date: Wed, 3 May 2023 00:29:58 GMT Message-Id: <202305030029.3430Twv4072373@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 22cb9d3f17c4 - stable/13 - aesni: Remove misleading array bounds for aesni_decryt_ecb. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 22cb9d3f17c4706573ba847599faaa66b2a5f247 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=22cb9d3f17c4706573ba847599faaa66b2a5f247 commit 22cb9d3f17c4706573ba847599faaa66b2a5f247 Author: John Baldwin AuthorDate: 2022-12-07 20:32:19 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:22:55 +0000 aesni: Remove misleading array bounds for aesni_decryt_ecb. All the other functions used pointers for from/to instead of fixed-size array parameters. More importantly, this function can accept pointers to buffers of multiple blocks, not just a single block. Reported by: GCC -Warray-parameter Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D37547 (cherry picked from commit d256a06fe8bda8120a3e22434c53fdef076001d3) --- sys/crypto/aesni/aesni_wrap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/crypto/aesni/aesni_wrap.c b/sys/crypto/aesni/aesni_wrap.c index 4d2a45b7e4c4..cca69d3d5c96 100644 --- a/sys/crypto/aesni/aesni_wrap.c +++ b/sys/crypto/aesni/aesni_wrap.c @@ -147,7 +147,7 @@ aesni_encrypt_ecb(int rounds, const void *key_schedule, size_t len, void aesni_decrypt_ecb(int rounds, const void *key_schedule, size_t len, - const uint8_t from[AES_BLOCK_LEN], uint8_t to[AES_BLOCK_LEN]) + const uint8_t *from, uint8_t *to) { __m128i tot; __m128i tout[8]; From nobody Wed May 3 00:30:00 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWr2trXz48Nhm; Wed, 3 May 2023 00:30:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q9yWr2N6Zz3nPw; Wed, 3 May 2023 00:30:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xa1TnHUWs2vZLhCgtrZd0kMqLAxgktnVo9UmOaNo7t8=; b=u1aSGHUbdVON3HrPZvhvJj0UYSRcoN0NM5a5Pjl87MMWKEEtAKW3TcpukYnZiYzh8fWr9i VDKvupQ3nxakhDB+8hvumE1KHaj+fjW4IuRmh5wYsY9UjeQgYqiWfF3rUS96/dYrEnFCnR B1bdI21h+ZI7SDrKbzgo/NTBKkv8LuxtWtnFWa34P+IqQZAI0G3AenWTlfz4fIqDTOTCEl 5DTJEE9Y1xl4HU1b1xdxio0fJzusI7lRZsrqMBTsR9X1tq4kGKjySEK07I9ZyWlziZO6QK sQiAjrc11ce4DLWcL9knrNZRXCAqfId7b3GFoq3aZi63EJFyRkOL+taquTy0CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xa1TnHUWs2vZLhCgtrZd0kMqLAxgktnVo9UmOaNo7t8=; b=Di/jQuJTPVVE54iqXx0DVeGoB79T7OVwrQvyAncXQIeaI3nUBh5+RRnHeF4wtdTE6LzscQ A6E2fq+Yym6yaSCUuHwJvzCGYBQilAQRNiaZj3l19g2GCGsNH3mgr3TbRdLlhUub5NjMOI 702VBruk0TS5MXxRhNtY6F/pYgCYx4Jsf/RQtHrybnxAkZu0ObNbeJU41LV1u0oWuf/dAg Symnk3IlLM7zvabq34uCiEKn2OG+9vz/45F6IUVpauXu5MuINLcLIWajpjlySPNsybs9y0 mrjNISu+bdfv56dGum3f8ZonKNSSmNBaAVT5MsV5UTr9C/ZK1KdQoDSnh0Q6Sg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073800; a=rsa-sha256; cv=none; b=txwOB51CG6s+VEYof69HFYo/0UJmHychnFs9ntk9A2qKHsE7Xquaeq9uv9+h9UNMrBumNl 2GxwCIm4ENr6Vx5yIxi9TDD9aXCzlz9masIWpJd3JVylTU8FhEITMcRijStWfPQL5aMrkG cwW3ddRqxzG4LV090ochaTBZj63mpQ8fV65U/S/QYv1lN91UEs3HHgQ3/hWv6WXHzV8Yjt r/5OMpX+BB9lhFICYWkK0aMuTQFYRoVXfU0kCrgArCWKQqysAGE2xYP1+os9JcUx5nFwj/ ds0zMlippleOCUkIWkfvifSPGi4B4872Xa7g8lwKOECseKDp26wE6W0k9WZjNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWr1RLKz18LK; Wed, 3 May 2023 00:30: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 3430U0lU072403; Wed, 3 May 2023 00:30:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430U0pY072402; Wed, 3 May 2023 00:30:00 GMT (envelope-from git) Date: Wed, 3 May 2023 00:30:00 GMT Message-Id: <202305030030.3430U0pY072402@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: afc2b44c748d - stable/13 - ipfilter: Fix mismatch in array bounds. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: afc2b44c748df289b1f030a85cea0ec54f13be76 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=afc2b44c748df289b1f030a85cea0ec54f13be76 commit afc2b44c748df289b1f030a85cea0ec54f13be76 Author: John Baldwin AuthorDate: 2022-12-07 20:32:38 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:23:27 +0000 ipfilter: Fix mismatch in array bounds. Reported by: GCC -Warray-parameter Reviewed by: imp, cy, emaste Differential Revision: https://reviews.freebsd.org/D37548 (cherry picked from commit 415ccf51122eab7b55978a1db00b484a06ffc84b) --- sys/netpfil/ipfilter/netinet/radix_ipf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/ipfilter/netinet/radix_ipf.c b/sys/netpfil/ipfilter/netinet/radix_ipf.c index 0ab4431c21ca..5db7f761ac06 100644 --- a/sys/netpfil/ipfilter/netinet/radix_ipf.c +++ b/sys/netpfil/ipfilter/netinet/radix_ipf.c @@ -318,7 +318,7 @@ ipf_rx_attach_mask(ipf_rdx_node_t *node, ipf_rdx_mask_t *mask) /* by the netmask. */ /* ------------------------------------------------------------------------ */ static ipf_rdx_node_t * -ipf_rx_insert(ipf_rdx_head_t *head, ipf_rdx_node_t *nodes, int *dup) +ipf_rx_insert(ipf_rdx_head_t *head, ipf_rdx_node_t nodes[2], int *dup) { ipf_rdx_mask_t **pmask; ipf_rdx_node_t *node; From nobody Wed May 3 00:30:01 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWs649Bz48NYx; Wed, 3 May 2023 00:30: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 4Q9yWs38Qtz3nlr; Wed, 3 May 2023 00:30:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j580rw/oJMzyneQhO28EvEwdYRyRxJgXkEAbh5w35A8=; b=Mi/vEdnHJSMFE9rudrWC46qmEt3I3l5n4Cclt1CXu06ijhUNzhfsunABqFxdCbcOIKE4FX vzhBLWjroXwoVRKszaqq7nmUZCKWsj4f8v+jLk31V68Y1UOswhirHSjwmbl+0gcYgUFuXJ OGC9jly6TYHsOCyZqFSPVywYlGTFSefqj+8gQsh/efkjUaB7leZhM07hLA9PuEaHR8lKTM VN0v8NjWrRJSrwdUIQStOpIlJHoRN/MBAFGCUelLPvtxEDqWjUpTzxLotHb3N1HwwKDYdH +gLftmINTTS6/KUazE0nsRjQdxMCB0MlnX+e2aDR73QSmJNw6wiJWYnUYXvStQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j580rw/oJMzyneQhO28EvEwdYRyRxJgXkEAbh5w35A8=; b=t5/Kv2Ve7S0z3VgozlTXUsMx0QveftRctoulmHK48TjuCztQmP1R6syAHuK/oeQq1QAxsc mYhCxt37YiMy5O+kmIGn6j5R2mA+PctRmHupu6GykLXkIRj7lhDvnR/nnzw+2l3G2oWwIV wzW+YA6U13ojXPpcdxUZo2nkiVpzRyZPfK7RM4D+DsIKOFMRY0I0S/RQ60K5z+lQ0MNb6b XUGNrBUXOC4ES9DBJrQHwpMQWPEOQLHUb8cL/KfpwhE1h2sZkNt8nhFOzMA2Ve6eW6EJJ2 oah/gFylLpuD0Oh0ig26GSCDw1Tuh1su/eUq22C3qmu7RaBxN9Crchk2R6QF7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073801; a=rsa-sha256; cv=none; b=xDyKecinhDBwoGKeiigyfUUFJ63uIyTh/ojqCmIe8Q+NBO/oAAL9a3F+YXXrmHZFSVFQlV sZzkiTryYQmq7bO0UxiRyehl49e7QEbSHEPGcaAA1oxC/vW2sjsYsUmUheOUGFdxVqa8G4 /esVxGN7hCtl2KDzkKnV7NGZOIFv5Qi29m1uxeQ0/i97I8JH9jc7Z6l18wtEaZ00Mk8KCz 2mVbG1UhGaFjlaU4F2OWZA1K3sg+GR9hno2Vqdz/VBFSZr2m+kH5tVIsERIexXSNRR30p4 uWVbqQah3aTtk1Xp2y8d4eGRs1XfmhiD7yv7kQUoRHstD+YQMRsPa3wVZlNxVA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWs1y6Bz182h; Wed, 3 May 2023 00:30: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 3430U1VA074163; Wed, 3 May 2023 00:30:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430U1QW074161; Wed, 3 May 2023 00:30:01 GMT (envelope-from git) Date: Wed, 3 May 2023 00:30:01 GMT Message-Id: <202305030030.3430U1QW074161@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 1ef1b088c8c8 - stable/13 - rtwn: Fix mismatches in array bounds. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 1ef1b088c8c8b3809e8ba808781f77c7258e6936 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1ef1b088c8c8b3809e8ba808781f77c7258e6936 commit 1ef1b088c8c8b3809e8ba808781f77c7258e6936 Author: John Baldwin AuthorDate: 2022-12-07 20:33:21 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:24:05 +0000 rtwn: Fix mismatches in array bounds. Reported by: GCC -Warray-parameter Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D37550 (cherry picked from commit 8bc615f5919f027cdf09825764276ab41a38375e) --- sys/dev/rtwn/rtl8188e/r88e.h | 4 +++- sys/dev/rtwn/rtl8192c/r92c.h | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/dev/rtwn/rtl8188e/r88e.h b/sys/dev/rtwn/rtl8188e/r88e.h index b6cd6053d015..cbf1161f7078 100644 --- a/sys/dev/rtwn/rtl8188e/r88e.h +++ b/sys/dev/rtwn/rtl8188e/r88e.h @@ -21,6 +21,8 @@ #ifndef RTL8188E_H #define RTL8188E_H +#include + /* * Global definitions. */ @@ -46,7 +48,7 @@ uint8_t r88e_temp_read(struct rtwn_softc *); /* r88e_chan.c */ void r88e_get_txpower(struct rtwn_softc *, int, - struct ieee80211_channel *, uint8_t[]); + struct ieee80211_channel *, uint8_t[RTWN_RIDX_COUNT]); void r88e_set_bw20(struct rtwn_softc *, uint8_t); void r88e_set_gain(struct rtwn_softc *, uint8_t); diff --git a/sys/dev/rtwn/rtl8192c/r92c.h b/sys/dev/rtwn/rtl8192c/r92c.h index 4d4307c786a4..925ce7a0adb4 100644 --- a/sys/dev/rtwn/rtl8192c/r92c.h +++ b/sys/dev/rtwn/rtl8192c/r92c.h @@ -21,6 +21,8 @@ #ifndef RTL8192C_H #define RTL8192C_H +#include + /* * Global definitions. */ @@ -54,9 +56,9 @@ uint8_t r92c_temp_read(struct rtwn_softc *); /* r92c_chan.c */ void r92c_get_txpower(struct rtwn_softc *, int, - struct ieee80211_channel *, uint8_t[]); + struct ieee80211_channel *, uint8_t[RTWN_RIDX_COUNT]); void r92c_write_txpower(struct rtwn_softc *, int, - uint8_t power[]); + uint8_t power[RTWN_RIDX_COUNT]); void r92c_set_bw20(struct rtwn_softc *, uint8_t); void r92c_set_chan(struct rtwn_softc *, struct ieee80211_channel *); void r92c_set_gain(struct rtwn_softc *, uint8_t); From nobody Wed May 3 00:30:02 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWt4X5nz48NZ0; Wed, 3 May 2023 00:30: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 4Q9yWt3C8Tz3nfJ; Wed, 3 May 2023 00:30:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QIfwUL3NX6SNDJX9lLzffiyl1m6QCExVyQd1ojBcLnU=; b=ZtmIo3tUJuvzxuNtBuCA41qm27gJ/1jVJ4EdeRBlrw6WsItNqFnSBkzq41nPac+LdcJrVQ h5omAzIkA7LWY5Zy3f/04yBM4EI2miifpZWY0s9YhchtpXcdVqyjEzBPFRWYV0W6KAIIbd jHN9ghHP1MfKqZzHAA97ovXUU2aKOiOYv+vN9emF9xjuZB0nQQXG4YaMX7fibo3KeAQinE fGLkuuHBmjUcF5GMzs/eiTAALdjZPaBKzSIydrHmtOTF2EtPDEaKzusIGWSeo5M7Sdk52T VUWEzZSrt+U6VN0r3hCI+Do/OvNo2eN+CQ+grced/0UHk0uDQlLWeU10bQyg9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QIfwUL3NX6SNDJX9lLzffiyl1m6QCExVyQd1ojBcLnU=; b=jAE3wyEbLu6f+iZayMFsNQop9UHm5z5KL6alfGR7VhJNxzVk3LcFQueS/WU+ZP58AZZfvI 7YtMdPWmYL78pTaWDYNyS+0m6AMAQqjxwlobRJ193eu/fEL7Fm8s0jWbyMBNBhxyUGJN1j 6wDDTdapADiFGzWAx50shscELGWGolzLck0YUbHo+KsvuOpPXsD2hw+QXSRxguQRLFX6Cn yzB8vRx20Y2I/JrODHoB9drIrSgWwd5n8ixFoA2ijZbe4XAkE9U3W4e1f07J3pV7HZJgp9 ZC5nzxwR6gGXVR29g3oJ5o/gNHF7jcI4FuE1iZVc7Vcg+fUS6pqO0iG2WFxFlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073802; a=rsa-sha256; cv=none; b=WxFLI1KIeaWMskzjQW1g12wUuF2q73zxIF34YGyr2lPpS/eMEb+kqavhmvOoGCCrTbtKP6 H0JyBAsT6ObO/8lT32l2y5gndJAtpU+3b9qzbhfCNK8R10qLQIzfRX3tNRjY7UbrF2od6b 8DQaOHYYox89vs6lEZUz2Vk1OK3jiDvPYZsFKVv5qifZebdPqRbEbaP7a8QBbn34Y0hmYm tzB4vu1pUgCOxqpGCWEogZ9sIWVP4SWmwgICgznrZYztohukIxe8X8LveykK2yx3odXJt0 RJPyN0Q9BQes5JcIhaNrMj0O6VPcznaCqov1VmRS/j/PWo03lyTupQ5S73n+iQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWt2HPyz18X0; Wed, 3 May 2023 00:30: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 3430U2gc074426; Wed, 3 May 2023 00:30:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430U2lJ074424; Wed, 3 May 2023 00:30:02 GMT (envelope-from git) Date: Wed, 3 May 2023 00:30:02 GMT Message-Id: <202305030030.3430U2lJ074424@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: e2b66bdb6874 - stable/13 - if_rsu: Fix mismatches in array bounds. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: e2b66bdb6874604b8045e31817bb9a4009a25a89 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e2b66bdb6874604b8045e31817bb9a4009a25a89 commit e2b66bdb6874604b8045e31817bb9a4009a25a89 Author: John Baldwin AuthorDate: 2022-12-07 20:33:41 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:24:47 +0000 if_rsu: Fix mismatches in array bounds. Reported by: GCC -Warray-parameter Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D37551 (cherry picked from commit 183783d34a6b453137f39eac8a7b42b338c9af60) --- sys/dev/usb/wlan/if_rsu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/usb/wlan/if_rsu.c b/sys/dev/usb/wlan/if_rsu.c index 747e3532cde4..a3a28b0c4cde 100644 --- a/sys/dev/usb/wlan/if_rsu.c +++ b/sys/dev/usb/wlan/if_rsu.c @@ -163,9 +163,10 @@ static usb_callback_t rsu_bulk_rx_callback; static usb_error_t rsu_do_request(struct rsu_softc *, struct usb_device_request *, void *); static struct ieee80211vap * - rsu_vap_create(struct ieee80211com *, const char name[], - int, enum ieee80211_opmode, int, const uint8_t bssid[], - const uint8_t mac[]); + rsu_vap_create(struct ieee80211com *, const char name[IFNAMSIZ], + int, enum ieee80211_opmode, int, + const uint8_t bssid[IEEE80211_ADDR_LEN], + const uint8_t mac[IEEE80211_ADDR_LEN]); static void rsu_vap_delete(struct ieee80211vap *); static void rsu_scan_start(struct ieee80211com *); static void rsu_scan_end(struct ieee80211com *); From nobody Wed May 3 00:30:03 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWv4k79z48NcJ; Wed, 3 May 2023 00:30: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 4Q9yWv3vcQz3nqJ; Wed, 3 May 2023 00:30:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4GBSMAvPBMHdy/APSNYRuOPuyWuxGlvkrKGzhpiRCsE=; b=w/h+3FZyXHe9+4vnqaiaphB4JtksM3oeE7WnpvvJtnSswA7P/oMNCJ5q6HFOFE33j7PqQm blLLRH8aqWqz9fjFHIl5NKl1WZuSv0/We8yxSjiBOuGWWB2Ncze80IDCKcDNyGRPTuf2eZ UQwK21vVOmof4f0I4OFlKz05Nwwb50D3KxDkUA4TlKNQWGyUdXjO8SG8j4mYCDpW8amkb/ t9zPALesu4/P/8jEVi+VNMNkONUYmx1q8AiiaYVzN5OZbtLBpcHxNK0KcZl/Ou2j4hB6fB OrM/hprHVd01e5D0qrTbZiczFW8SeONQWY/qDRl+1o5evpShTaMWF05rp5Yfww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4GBSMAvPBMHdy/APSNYRuOPuyWuxGlvkrKGzhpiRCsE=; b=U8WveOX640yS4ikoRCP+wcZw8bEYIAzQn+cBZz8uUYXaTPfrQlOpLiDMN04iLM+v/V2kMi Qp9CoFfew9r3OjXH2JrRK05QYPAJQSmLYRkH1BjmPJ1sdHK8XvwlUhgWj12vNKiqa1EsNW g6LrM+NNMgLbs1uTpjuiZ3kFEMQaIudr/fCQb0Sivoi/5XHlJ0s2wpHkzBzedrdOC7iPuX Iztce4GL/pSGbtlo29CLJrCIEe1pM8WjQmbQeQoQ/6mAzMNUxX1DD71uPBg7KvhoUHxg2s XUP64Aec6UC06aVZO7GG01Z36i2gPk490rI/PteG12RsCf04pa+3WQZFPS6iTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073803; a=rsa-sha256; cv=none; b=k6MuQ4wbL3Gm+kQLX6qAuRyf0Xjb3L7968BnuUiW/dSByODZc49UHYbKt0Doz8Z0ABNRFD NZ42XmdTd83xImsZl0n6EVgoqllkeGFO4pa32qNDkyE6zaq1glDqsMN1mf2VIrCm2anVRR 84d3BAeIASvKiaxaE3ERkK4z210CpArVd9uC6F0zXKH1aHqI5aXACR8vO9bQGDSlEGr6Db kQHElJCKT+7UfjERvlkfJyTgKOZHr/8VBdV9XuVPLKLQI2draKiS1fBAW0ieTWge3EDiHj KM5HEMhgpopY1jD86KO/mBU5M5KR73VkHs2GC83DMXAeJGIfySXU9KIU/oYI2w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWv2yR0z18JB; Wed, 3 May 2023 00:30: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 3430U3wB074679; Wed, 3 May 2023 00:30:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430U3sc074677; Wed, 3 May 2023 00:30:03 GMT (envelope-from git) Date: Wed, 3 May 2023 00:30:03 GMT Message-Id: <202305030030.3430U3sc074677@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 6ddbd237cc80 - stable/13 - atp: Fix mismatch in array bounds. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6ddbd237cc8055037162ed4a0ef47779ad553b0c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6ddbd237cc8055037162ed4a0ef47779ad553b0c commit 6ddbd237cc8055037162ed4a0ef47779ad553b0c Author: John Baldwin AuthorDate: 2022-12-07 20:33:56 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:25:11 +0000 atp: Fix mismatch in array bounds. Reported by: GCC -Warray-parameter Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D37552 (cherry picked from commit 4eda35b6360762b4a256c33321a917d4b3a5d625) --- sys/dev/usb/input/atp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/input/atp.c b/sys/dev/usb/input/atp.c index 8f0c6c36626a..d16e1aae5a23 100644 --- a/sys/dev/usb/input/atp.c +++ b/sys/dev/usb/input/atp.c @@ -1635,7 +1635,8 @@ fg_update_strokes(struct atp_softc *sc, fg_pspan *pspans_x, * Return true if any movement is detected. */ static boolean_t -wsp_update_strokes(struct atp_softc *sc, wsp_finger_t *fingers, u_int n_fingers) +wsp_update_strokes(struct atp_softc *sc, wsp_finger_t fingers[WSP_MAX_FINGERS], + u_int n_fingers) { boolean_t movement = false; atp_stroke_t *strokep_next; From nobody Wed May 3 00:30:04 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWw5V3lz48NcM; Wed, 3 May 2023 00:30: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 4Q9yWw4mvTz3p47; Wed, 3 May 2023 00:30:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J4SN+9VwQIBDqbWLlYQB+ab2r1lgN6QBj3x2EXcbuFk=; b=GstPrKTqvnnGp+ziLz9MzQ5VtojTtN9zjNrwiWmLLBPjNabEw6lIyWCjjWmNoUz7+R4IS5 X+ETOSLH0X7eUiTOyi+WRID7ZEBRfb253BL+MgOf7gbHRsIz6vT3xlWM9v3EXA+LdTyshl QxFhRC+fpt/5ZETziXUaG/bEG8yvvyy806fT63sXxwc48T9/nZjbIoO0I0xBcz6QHViZxE vBYvxSfB6KkL+wFWreZC/BtdJyko7FzjWIx/XhghxAiVUBC1l2atC8kvB2C7A2aOc9XoxZ q4SBayiY7WSrWeRJJ8Zu3wn+sokmSfhEFF3bv05Z5w77tTnU4C9QyCSXAo08jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J4SN+9VwQIBDqbWLlYQB+ab2r1lgN6QBj3x2EXcbuFk=; b=b9G5xaxK6sgbf8X+N/4kl+lMcNp0EfrKGYtDGtUvbJsBiIaW65JpovBUutTtzNTUpneDze TXZIO2iUUtbLyNM0ueAGNMvQANqtJ134PT8mSuRgft6fXkl2twiE9TmkhBomtCOvr6lLan BD6PB14BXgeLagMJrxmCHgk+uB2gbIVw/+t6j9V038OU3JY0qoH316uz/Xm4k4OFZHaiHa fySY/E0efvgshX7z+4MRHc0iES2CCACfA98MdNU6ZOjhLcY0lObZ4IBL+iyV0lLJJwIxti yz3iex+QgIa+SEMSAcUHIFvCjq37l5MXe6pxhBmG9W5J310hCPPuSqiVVhXUxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073804; a=rsa-sha256; cv=none; b=EXvOjii5+6M4qii9d5wMqGjXql0JKtOlRU1ll3XmWv5Gaw39rIj1mtZa7oP2+0PJZ5uwBp Yu000ijMb1vl6i7LY0hOkk3xTzPdylH4v1l/UoCjNkNLTl/h/tMo4oW9I1zfR+Vcdg5jZL IRotiImFQPupxYao0tdI5DWyFPiJNlBYyiQnt0FPOnFs4ErAKiRVSdgTWWktrK02YRzbny GWnCFH+4etVQDu1lDgrN0x2ZV14/humGPQqpGnX65bGTShrST+b8ek3+gGPUKKGdx1bL1d QkmowlAP40MndD2fQT2yfAQa5seC+Kt/VdP+r7Y7FVPVquwwnPipN5JBxwJVBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWw3WyHz18X1; Wed, 3 May 2023 00:30: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 3430U4kp074933; Wed, 3 May 2023 00:30:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430U4Mf074930; Wed, 3 May 2023 00:30:04 GMT (envelope-from git) Date: Wed, 3 May 2023 00:30:04 GMT Message-Id: <202305030030.3430U4Mf074930@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 58b9432c405b - stable/13 - zfs: Fix build with GCC 12. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 58b9432c405b6542cf33e1b57ff87365180b4da7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=58b9432c405b6542cf33e1b57ff87365180b4da7 commit 58b9432c405b6542cf33e1b57ff87365180b4da7 Author: John Baldwin AuthorDate: 2022-12-21 18:49:23 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:25:48 +0000 zfs: Fix build with GCC 12. Silence -Winfinite-recursion for ldo.c in lua and -Wstringop-overread for nvpair.c. Reviewed by: mm Differential Revision: https://reviews.freebsd.org/D37631 (cherry picked from commit 2e08e4b75ea1080c224a33baf62199d893dc322d) --- sys/conf/files | 4 ++-- sys/conf/kern.mk | 2 ++ sys/modules/zfs/Makefile | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 5546925bccd8..7c90279a261f 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -177,7 +177,7 @@ contrib/openzfs/module/lua/lcompat.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/lua/lcorolib.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/lua/lctype.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/lua/ldebug.c optional zfs compile-with "${ZFS_C}" -contrib/openzfs/module/lua/ldo.c optional zfs compile-with "${ZFS_C}" +contrib/openzfs/module/lua/ldo.c optional zfs compile-with "${ZFS_C} ${NO_WINFINTE_RECURSION}" contrib/openzfs/module/lua/lfunc.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/lua/lgc.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/lua/llex.c optional zfs compile-with "${ZFS_C}" @@ -196,7 +196,7 @@ contrib/openzfs/module/lua/lzio.c optional zfs compile-with "${ZFS_C}" # zfs nvpair support contrib/openzfs/module/nvpair/fnvpair.c optional zfs compile-with "${ZFS_C}" -contrib/openzfs/module/nvpair/nvpair.c optional zfs compile-with "${ZFS_RPC_C}" +contrib/openzfs/module/nvpair/nvpair.c optional zfs compile-with "${ZFS_RPC_C} ${NO_WSTRINGOP_OVERREAD}" contrib/openzfs/module/nvpair/nvpair_alloc_fixed.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/nvpair/nvpair_alloc_spl.c optional zfs compile-with "${ZFS_C}" diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index d37d80793929..47f4b5c48243 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -94,6 +94,8 @@ CWARNEXTRA+= -Wno-address-of-packed-member \ CWARNEXTRA+= -Wno-error=nonnull \ -Wno-dangling-pointer \ -Wno-zero-length-bounds +NO_WINFINTE_RECURSION= -Wno-infinite-recursion +NO_WSTRINGOP_OVERREAD= -Wno-stringop-overread .endif .endif diff --git a/sys/modules/zfs/Makefile b/sys/modules/zfs/Makefile index 6321db2381d8..9259a5f7e182 100644 --- a/sys/modules/zfs/Makefile +++ b/sys/modules/zfs/Makefile @@ -292,10 +292,11 @@ CFLAGS.gcc+= -Wno-pointer-to-int-cast CFLAGS.lapi.c= -Wno-cast-qual CFLAGS.lcompat.c= -Wno-cast-qual +CFLAGS.ldo.c= ${NO_WINFINTE_RECURSION} CFLAGS.lobject.c= -Wno-cast-qual CFLAGS.ltable.c= -Wno-cast-qual CFLAGS.lvm.c= -Wno-cast-qual -CFLAGS.nvpair.c= -Wno-cast-qual -DHAVE_RPC_TYPES +CFLAGS.nvpair.c= -Wno-cast-qual -DHAVE_RPC_TYPES ${NO_WSTRINGOP_OVERREAD} CFLAGS.spl_string.c= -Wno-cast-qual CFLAGS.spl_vm.c= -Wno-cast-qual CFLAGS.spl_zlib.c= -Wno-cast-qual From nobody Wed May 3 00:30:05 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWx6VcSz48NTT; Wed, 3 May 2023 00:30: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 4Q9yWx4pDJz3p01; Wed, 3 May 2023 00:30:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5DhhBiW9/4gWFtnegYY9hj5jZG4PFyMCoRwz/BXLM4c=; b=V4aMehMaVGdpkOHWWcOY1E/Ghgjp+TPI63jo12XN5yf61fKZhP4+B0O6OVv9+TWYR1MF1B JPGZxxUhITtz6LgPz2kFpUxAtyqmnTZX5xz28zBPvBunUjo5Xyf5JxkURl3Bq8dE6jzYxR yp1lF+WWn2jC0Ttqr5tkZZGseWs64jQLwlULLHyeIN7tOJtD7jttxHUtWUa5CUgPMwAkd1 zshx3dLoiInY9erQx98OaKz2aST5tANR0Ozwcc+195dY3upEAJpetc7OqVnIZsI92DOlMO eh0E+1SR8EgTn61swp7M9btHnXJUitcPQP7RNtjrz95aohT8VM9D8DBfhOnMIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5DhhBiW9/4gWFtnegYY9hj5jZG4PFyMCoRwz/BXLM4c=; b=idy2bxHRzJRqY0p9Mw7wGU4tHo93CQAeCdJVvCAGhHD1gJuQHLIg7AWFe9bBTjyncWAxi6 1/XfdYHc1Hg7zoPQxM6O8slR8U8QUNx7hVk3m+BtnjbwI2dYCxkulsXiZ/Aj6wAz+1rYDW pqp50BMLDPQCTd+hFu8VJCytTurP+OjM4tJl9QnPL9uUKYS6q2pSydvB/kzDNsGRe5ApGk A59pyj9GVIjDJgpnq2T34FEAwuO5ugrd6MgqC/2oJiXP8cPjLHFjZjgptqeRLTYUMn/1k1 1LifW6OrPfLusjJVO9+K9maZ50q8x7jMkuDJYPtWgb7CxZhvfVg2cZYK/VgGOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073805; a=rsa-sha256; cv=none; b=Nn+Z8DzPbS5UCNYTUYKahFG4DX8ZuxLSXz/mG6FklWlVi1jfwXVH/nFWJ5l0shE9JnPGZz 8U7hgIJhTdsta339/MVfocVBXvvg+3N+FpP0Bp9qcgW/mv8osF+XGShb88CHpknxdf2KUg +24u9CPFmCcYy2O5g/49WCnpBCcrL3M6oRPhqzL68weMQ48GtQJkQNti0RwLOZcBotqMSo yjgw87bH49b4kXWgX1olpBWuo8t4DkYD187ymccVCkz3c3sOkM0h6C4/HUVhGYkAH+L1tS Qb8KHRWqgvMvAEpRexCAdTx4A0r9MOI5JPMFRkc+6TpfNSjfkQSqqRT9uo5W3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWx3wC6z182j; Wed, 3 May 2023 00:30: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 3430U5gh075188; Wed, 3 May 2023 00:30:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430U5qd075186; Wed, 3 May 2023 00:30:05 GMT (envelope-from git) Date: Wed, 3 May 2023 00:30:05 GMT Message-Id: <202305030030.3430U5qd075186@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: ed3d14a5b0d0 - stable/13 - Fix spelling of NO_WINFINITE_RECURSION. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: ed3d14a5b0d06ef856ad66627e8c8ebce4b73830 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ed3d14a5b0d06ef856ad66627e8c8ebce4b73830 commit ed3d14a5b0d06ef856ad66627e8c8ebce4b73830 Author: John Baldwin AuthorDate: 2022-12-21 22:45:29 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:25:58 +0000 Fix spelling of NO_WINFINITE_RECURSION. Reported by: dim Fixes: 2e08e4b75ea1 zfs: Fix build with GCC 12. (cherry picked from commit 3266131908914b3a359571dae75194fe6d330c1d) --- sys/conf/files | 2 +- sys/conf/kern.mk | 2 +- sys/modules/zfs/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 7c90279a261f..928289668166 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -177,7 +177,7 @@ contrib/openzfs/module/lua/lcompat.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/lua/lcorolib.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/lua/lctype.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/lua/ldebug.c optional zfs compile-with "${ZFS_C}" -contrib/openzfs/module/lua/ldo.c optional zfs compile-with "${ZFS_C} ${NO_WINFINTE_RECURSION}" +contrib/openzfs/module/lua/ldo.c optional zfs compile-with "${ZFS_C} ${NO_WINFINITE_RECURSION}" contrib/openzfs/module/lua/lfunc.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/lua/lgc.c optional zfs compile-with "${ZFS_C}" contrib/openzfs/module/lua/llex.c optional zfs compile-with "${ZFS_C}" diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 47f4b5c48243..25c6ad8d87ac 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -94,7 +94,7 @@ CWARNEXTRA+= -Wno-address-of-packed-member \ CWARNEXTRA+= -Wno-error=nonnull \ -Wno-dangling-pointer \ -Wno-zero-length-bounds -NO_WINFINTE_RECURSION= -Wno-infinite-recursion +NO_WINFINITE_RECURSION= -Wno-infinite-recursion NO_WSTRINGOP_OVERREAD= -Wno-stringop-overread .endif .endif diff --git a/sys/modules/zfs/Makefile b/sys/modules/zfs/Makefile index 9259a5f7e182..0cfc336aacb1 100644 --- a/sys/modules/zfs/Makefile +++ b/sys/modules/zfs/Makefile @@ -292,7 +292,7 @@ CFLAGS.gcc+= -Wno-pointer-to-int-cast CFLAGS.lapi.c= -Wno-cast-qual CFLAGS.lcompat.c= -Wno-cast-qual -CFLAGS.ldo.c= ${NO_WINFINTE_RECURSION} +CFLAGS.ldo.c= ${NO_WINFINITE_RECURSION} CFLAGS.lobject.c= -Wno-cast-qual CFLAGS.ltable.c= -Wno-cast-qual CFLAGS.lvm.c= -Wno-cast-qual From nobody Wed May 3 00:30:06 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yWy6lTNz48NZ3; Wed, 3 May 2023 00:30: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 4Q9yWy5WCwz3p22; Wed, 3 May 2023 00:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vSWyOMz3MKm/04eWzEmdLeLXOpzDu8aFfFifN72aeGc=; b=GD0SCXYk8vmytYn7YSNFWQIBrCTbNmfesDwMWMkwXmZ97aGKUmkGVSSeX1NvbMR2V7EF9o yGo1Z4kwdpNAW07h9uPGFZR8W5O21vSSP33BYH32k3FjQBfmLIdx/Sjik+ytfNfPbuW/dm YgiDk040XxlOKwGH845Zo0wyeA+NppvCtOUEgdSoco7kha32brFypGtwmrg1EC6FTHwDfC R91sNmDGb+njXVfNkPqLRQMdTt5ovreR7ST9WCK95vaPnCXeQGCCWvMK/NSgts07mCUVUt qjGxkgSrJD60kcI59Mui9Y8iJK0qY3B+bdi0FGWsMUztOyK/oCYMZ+v/MelERQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vSWyOMz3MKm/04eWzEmdLeLXOpzDu8aFfFifN72aeGc=; b=blVRyChqFfpJLtH3yh/jY73waMUBgESFokCCCRQvMCtXkSIdNegYQr6hQEe6TPvyXyDeOx aR1ivKWMfXv0D6suB6JsdWSO4DSENuVHzvfyp8dg/zNL04JS4OMFQazkvUAu+HeTgACwaN K45a8lUJJr/QVDIWly668MMGvOP7ViOVq+JP0K5mxaJP43i6vQs9LfB0ZtvFMN+pXHAsS4 WhDz11Ufwcy8jGm6JXkUahTsDetZCe0pi4ENs6Dj5S4z9p4iIT39Y/RnOac1OXBbTW0iwz 9GwKLfuIIiopDfrH9xoApU38VB4PXG5L8fMaO7A2Y7DCJnihAH4DdYZAGm/c0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073806; a=rsa-sha256; cv=none; b=II2UBEMiVQsRnQErPoiePb/2L+v/tE3WGpT3QcfE2LkJ2Kj5bEwqpZNR8rhzmXf7FInkzc J3NxCT5eTVfmD87ixf81iAG5Z4h+2OMET9SurIwY2dgBaK39PK9zoXI+4B0QetRZ2/Mnjn 7ekU+7MH/sHA2pK6v98ehaP2QkdV+wQ6slQXyh4hibb0EMUFv6fBvwsjYRBsMTw3MQ8+DR UCt6WUUCzSSx03dy8n2rSYOeswhv4l3/f4K+5dBugVvAX/PT9CWWC85b706AhptzzFhNgS PGO3MpTunp+lmEQTrxAAPkc2ArC6rTrYLMoUfaqC42E5L7ykjLAQZ9vHQilwZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9yWy4Qlcz18Fk; Wed, 3 May 2023 00:30: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 3430U6hN075443; Wed, 3 May 2023 00:30:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3430U61Y075441; Wed, 3 May 2023 00:30:06 GMT (envelope-from git) Date: Wed, 3 May 2023 00:30:06 GMT Message-Id: <202305030030.3430U61Y075441@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 677407f69c39 - stable/13 - sys: Retire OPENZFS_CWARNFLAGS now that it is empty. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 677407f69c39092c1113d5c3e401ad3e2446357f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=677407f69c39092c1113d5c3e401ad3e2446357f commit 677407f69c39092c1113d5c3e401ad3e2446357f Author: John Baldwin AuthorDate: 2023-03-22 19:35:30 +0000 Commit: John Baldwin CommitDate: 2023-05-03 00:28:46 +0000 sys: Retire OPENZFS_CWARNFLAGS now that it is empty. Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D39217 (cherry picked from commit dddb1aec4d54ba949201f4a2e3146cfab4a5870f) --- sys/conf/kmod.mk | 1 - sys/modules/dtrace/dtaudit/Makefile | 1 - sys/modules/dtrace/dtmalloc/Makefile | 1 - sys/modules/dtrace/dtnfscl/Makefile | 1 - sys/modules/dtrace/dtrace/Makefile | 1 - sys/modules/dtrace/fasttrap/Makefile | 1 - sys/modules/dtrace/fbt/Makefile | 1 - sys/modules/dtrace/profile/Makefile | 1 - sys/modules/dtrace/prototype/Makefile | 1 - sys/modules/dtrace/sdt/Makefile | 2 +- sys/modules/dtrace/systrace/Makefile | 1 - sys/modules/dtrace/systrace_freebsd32/Makefile | 1 - sys/modules/dtrace/systrace_linux/Makefile | 1 - sys/modules/dtrace/systrace_linux32/Makefile | 1 - sys/modules/opensolaris/Makefile | 1 - sys/modules/zfs/Makefile | 2 -- 16 files changed, 1 insertion(+), 17 deletions(-) diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index a952e3190dec..a06f6a2555d9 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -550,7 +550,6 @@ OPENZFS_CFLAGS= \ -I${SYSDIR}/cddl/compat/opensolaris \ -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h -OPENZFS_CWARNFLAGS= .include .include diff --git a/sys/modules/dtrace/dtaudit/Makefile b/sys/modules/dtrace/dtaudit/Makefile index 3571bcbb7ea2..72cdf03f4bc3 100644 --- a/sys/modules/dtrace/dtaudit/Makefile +++ b/sys/modules/dtrace/dtaudit/Makefile @@ -13,4 +13,3 @@ CFLAGS+= ${OPENZFS_CFLAGS} .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h -CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/dtrace/dtmalloc/Makefile b/sys/modules/dtrace/dtmalloc/Makefile index ffde4f811ee8..910f8f360e80 100644 --- a/sys/modules/dtrace/dtmalloc/Makefile +++ b/sys/modules/dtrace/dtmalloc/Makefile @@ -13,4 +13,3 @@ CFLAGS+= ${OPENZFS_CFLAGS} .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h -CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/dtrace/dtnfscl/Makefile b/sys/modules/dtrace/dtnfscl/Makefile index d28641e51ec8..6184ad183fc6 100644 --- a/sys/modules/dtrace/dtnfscl/Makefile +++ b/sys/modules/dtrace/dtnfscl/Makefile @@ -13,4 +13,3 @@ CFLAGS+= ${OPENZFS_CFLAGS} .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h -CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/dtrace/dtrace/Makefile b/sys/modules/dtrace/dtrace/Makefile index 712e10331a38..0bd81bb39db0 100644 --- a/sys/modules/dtrace/dtrace/Makefile +++ b/sys/modules/dtrace/dtrace/Makefile @@ -57,7 +57,6 @@ dtrace_asm.o: assym.inc CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h CFLAGS.dtrace_asm.S+= -D_SYS_ERRNO_H_ -D_SYS_PARAM_H_ -DLOCORE -CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} CWARNFLAGS+= -Wno-parentheses CWARNFLAGS+= -Wno-cast-qual CWARNFLAGS+= -Wno-unused diff --git a/sys/modules/dtrace/fasttrap/Makefile b/sys/modules/dtrace/fasttrap/Makefile index 0eecfcb11aab..1be1b97736ea 100644 --- a/sys/modules/dtrace/fasttrap/Makefile +++ b/sys/modules/dtrace/fasttrap/Makefile @@ -26,6 +26,5 @@ SRCS+= u8_textprep.c CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h -CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} CWARNFLAGS+= -Wno-cast-qual CWARNFLAGS+= -Wno-unused diff --git a/sys/modules/dtrace/fbt/Makefile b/sys/modules/dtrace/fbt/Makefile index 360d92000776..288c8cafa817 100644 --- a/sys/modules/dtrace/fbt/Makefile +++ b/sys/modules/dtrace/fbt/Makefile @@ -23,4 +23,3 @@ CFLAGS+= -I${SYSDIR}/cddl/dev/fbt .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h -CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/dtrace/profile/Makefile b/sys/modules/dtrace/profile/Makefile index b3eec9a19f23..aa36f9a2dfba 100644 --- a/sys/modules/dtrace/profile/Makefile +++ b/sys/modules/dtrace/profile/Makefile @@ -13,4 +13,3 @@ CFLAGS+= ${OPENZFS_CFLAGS} .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h -CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/dtrace/prototype/Makefile b/sys/modules/dtrace/prototype/Makefile index 189d6c2df2a2..476c567a4dc0 100644 --- a/sys/modules/dtrace/prototype/Makefile +++ b/sys/modules/dtrace/prototype/Makefile @@ -13,4 +13,3 @@ CFLAGS+= ${OPENZFS_CFLAGS} .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h -CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/dtrace/sdt/Makefile b/sys/modules/dtrace/sdt/Makefile index a025848e3a60..d672b3c9aab9 100644 --- a/sys/modules/dtrace/sdt/Makefile +++ b/sys/modules/dtrace/sdt/Makefile @@ -11,5 +11,5 @@ SRCS+= vnode_if.h CFLAGS+= ${OPENZFS_CFLAGS} .include + CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h -CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/dtrace/systrace/Makefile b/sys/modules/dtrace/systrace/Makefile index 2250a7418193..3e122f70da25 100644 --- a/sys/modules/dtrace/systrace/Makefile +++ b/sys/modules/dtrace/systrace/Makefile @@ -13,4 +13,3 @@ CFLAGS+= ${OPENZFS_CFLAGS} .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h -CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/dtrace/systrace_freebsd32/Makefile b/sys/modules/dtrace/systrace_freebsd32/Makefile index 3b77bc4c6d0e..4661633f9a62 100644 --- a/sys/modules/dtrace/systrace_freebsd32/Makefile +++ b/sys/modules/dtrace/systrace_freebsd32/Makefile @@ -14,4 +14,3 @@ CFLAGS+= -DFREEBSD32_SYSTRACE .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h -CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/dtrace/systrace_linux/Makefile b/sys/modules/dtrace/systrace_linux/Makefile index 56f422dfb9e5..7dbd88ffb5f0 100644 --- a/sys/modules/dtrace/systrace_linux/Makefile +++ b/sys/modules/dtrace/systrace_linux/Makefile @@ -15,4 +15,3 @@ CFLAGS+= -DLINUX_SYSTRACE .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h -CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/dtrace/systrace_linux32/Makefile b/sys/modules/dtrace/systrace_linux32/Makefile index febd4a0c1bab..81aa1b7de9df 100644 --- a/sys/modules/dtrace/systrace_linux32/Makefile +++ b/sys/modules/dtrace/systrace_linux32/Makefile @@ -15,4 +15,3 @@ CFLAGS+= -DLINUX32_SYSTRACE .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h -CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/opensolaris/Makefile b/sys/modules/opensolaris/Makefile index 7010485b0ee7..f5d6f7f4639c 100644 --- a/sys/modules/opensolaris/Makefile +++ b/sys/modules/opensolaris/Makefile @@ -34,4 +34,3 @@ IGNORE_PRAGMA= 1 .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h -CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} diff --git a/sys/modules/zfs/Makefile b/sys/modules/zfs/Makefile index 0cfc336aacb1..a75c1986bb13 100644 --- a/sys/modules/zfs/Makefile +++ b/sys/modules/zfs/Makefile @@ -286,8 +286,6 @@ CFLAGS+= -include ${SRCTOP}/sys/cddl/compat/opensolaris/sys/debug_compat.h CFLAGS+= -include ${INCDIR}/os/freebsd/spl/sys/ccompile.h CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/static_ccompile.h -CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} - CFLAGS.gcc+= -Wno-pointer-to-int-cast CFLAGS.lapi.c= -Wno-cast-qual From nobody Wed May 3 00:31:49 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9yZ10hb8z48P8K; Wed, 3 May 2023 00:31:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q9yZ049Spz3s5C; Wed, 3 May 2023 00:31:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zPQ8sJj8bgrEhF47UDbU5l/hqqfl8ceTLN+rUAHF074=; b=bbj7MSwVlo/RmvQGnXg2zHu5jG6PlGoC1Zn7p9A1fGoTmpEXc720SQFv4sKlPRjG2ClzHA ZyhRqpEWglfzjkrDKNSo2vtuz3EsZpBbtU6uxD3kKwlTR2XEopc3s6Rd1CVLlza0G5y5hH IpSrwAkOXKbFbTMGpqI3V7S/IYB6m/NUUttSfbVX83UDkVqjblmv0mQLP+G9RHp3wz+czE AGCdVtUntP1pxovYnZf3QY7BUqC4SNHLxPk7xevhbYbvWU7C0ZXniX9siAumpPdenco8Xo xs3zjdw00JlL8oG1WlfZGT7Jr9RFDW2l7E8sW2yYL0tN28d6j/HHbadYxddJow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zPQ8sJj8bgrEhF47UDbU5l/hqqfl8ceTLN+rUAHF074=; b=C4NqD0F7iSKgOXbq4XYJJFihMWIjRlhnKOGqwbGuzhsVSu5LlGeilfxmnggY612b6TfLvf Z3hYdB6qrgEI1o9F+F6riEHGH31YN6Nk3/2kqtTwasrSWm7tPRB5aUTnHshTzrxfdDXV6f vlelSSc0th/kpSYJ133n32bCPnWoftQzyxDoYOsVylzF26ppVLKQIrkJoGOaC/5MCpoGvH JPheN6oLQThUSGXfDxlmmB+ALAEndZ+Dgi5FfX7V40840GMu73g2aHgskWrbCntl2dQS+1 OJkQ8fs6WX5/SfH07fMucccvnMJ8m7qR/cExD/ayEEs21bjyeKY82nrVOp+Osw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073912; a=rsa-sha256; cv=none; b=Ig7FwaRkLp7nOkxLPLJNCGf+WE+J5W0z2Kwvh4yxZSODE7Wo28DQ5JfUs4pBo3KBS7zxAa r+zhwMeusgvQ9NVjOtTLZuv0e82I91BfooTt/dGVrnUV+L5E+IPZWJeQEv0TVb9o4KDid5 a/Qkaj1x/JuA6eHRAEkyxE7zKvSeE+gvUZf9IN4qL5boLagnRoeurKM3BsBfQxhgqB+TIu BEMGCorbRrmb7wb9AOjyfkGhnQ0fOW3Jypt+OZwJK4NZe7E+VZNkY3PZiUcxChlUzrLZUg kLDR8mF4gx+fHvJSKUTwlLWF+MrRc3g5oPvk1LBvMgYvC1tpCSv2+1VUcq+Vww== Received: from [IPV6:2601:648:8680:16b0:983b:b6c4:574a:73ff] (unknown [IPv6:2601:648:8680:16b0:983b:b6c4:574a:73ff]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Q9yZ004cKzSqW; Wed, 3 May 2023 00:31:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <2696e636-4a6c-ab92-55e6-e65904477b1d@FreeBSD.org> Date: Tue, 2 May 2023 17:31:49 -0700 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: git: d854d8122288 - stable/13 - ncurses: Backport a few fixes for GCC warnings from version 6.2-20210220. Content-Language: en-US From: John Baldwin To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org References: <202305030029.3430TNZt071687@gitrepo.freebsd.org> In-Reply-To: <202305030029.3430TNZt071687@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 5/2/23 5:29 PM, John Baldwin wrote: > The branch stable/13 has been updated by jhb: > > URL: https://cgit.FreeBSD.org/src/commit/?id=d854d8122288dfa6b0245774ee37b02541c9b989 > > commit d854d8122288dfa6b0245774ee37b02541c9b989 > Author: John Baldwin > AuthorDate: 2023-05-02 23:38:54 +0000 > Commit: John Baldwin > CommitDate: 2023-05-02 23:38:54 +0000 > > ncurses: Backport a few fixes for GCC warnings from version 6.2-20210220. > > This is a direct commit to stable/13. I didn't backport 6.2-20210220 as I wasn't sure what all would be required to do that in lib/ncurses. It was also done after splitting out tinfo in main. -- John Baldwin From nobody Wed May 3 00:33:07 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9ybV498mz48NtX; Wed, 3 May 2023 00:33:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q9ybV3G1Pz3tdH; Wed, 3 May 2023 00:33:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7zoPep3GI9sdM/enIGaliJ/AdqWd6cxcm0kWwiuX87o=; b=FkDvTmFos5iC/deLW9YB4phxewYrxx8z8OCzTQtWTeJeCPUy2NCMP/hn0YgKDeYNNJISjz eEtABOATBkvVbh6M3BhzyCErrEt7cKiL0vJPOJFUKJ396A/geolceiruDmZbRHhqmC0jcj vjGSrrcorG01X+o5T1PzkHloVbN+ahFMe72isewL4/yMGPNiXcoSzhE7o3v6EfoD80IBim RWwjNG4MbyMCtym2zC9Vx/3r1wkf7aU3vPfe6CZUzD0k3v3amdSvIKEUdZO2R6NRJHDQWD r2szEm2MqEvZGjpgw9CsokDGH/Cqze+6a0+nm1+NthamzNt2T+35V506feB33Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683073990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7zoPep3GI9sdM/enIGaliJ/AdqWd6cxcm0kWwiuX87o=; b=t1Ct88hPZURORMFSC8DkaYQhLFC77qWsd7i6iM2rUG57X5M4viPMHOA4fd+Mr3cEcv9LmK ueb3aeZaUrIqg+7SeI7UTXq0pHwP21hy9qUz4vjq4njDdJ7sKJGbQrOhKbNbEwkgfuILVo dk2+0e7I5tWg+F0vuAKuOJIR/dEhIHKjkGJ2/nORstIO8569JBV9voGoBsPj47QDEKnRvi VtmSC5bXNesskfLL6KfTSYMktk6Ablms7RKm7ErgcCbC5AbKTEedcxPm/cSpCmZD//G8+k kilN4vTDLIIUN6s2KY5wV1GH0GDzJQTn/aLEMEL1bnPOZyXOW2MdLba+yhiMFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683073990; a=rsa-sha256; cv=none; b=iZDvQxBiigyQh6pYz6wqbxSx1W7AMaAhAHQIiGYp8M664Ih2BEev/bmPZywaO6bWglraqZ ryS7VQIwdn+AJBzSL8PlehEWpZMXbfJabvQg9Qf1IrHUgr0lgi3jD4gWlX2Ksd6CjFMNsR XRYICtawMTJLZtL9cI8dVvJSAnC2amdunV4LK9BPXWIY6YFpTJoF0Kq28gs5FoUhvrgRck LQQVeNoBzNMZCR/PjvOLn5K21nnCgkVajC7ev8Vl3/tujLRAf90SzMBS65HnjMuPMXyDDn FwwDhG9bSW/u4gCQ10hyR62c6Unpv18i7qFKDIb/2WRRp2HNr2nWEdF5nwKcyw== Received: from [IPV6:2601:648:8680:16b0:983b:b6c4:574a:73ff] (unknown [IPv6:2601:648:8680:16b0:983b:b6c4:574a:73ff]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Q9ybS2B0HzSpG; Wed, 3 May 2023 00:33:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <46542d67-5355-5507-e9a6-6dc8a945e71f@FreeBSD.org> Date: Tue, 2 May 2023 17:33:07 -0700 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: git: 58b9432c405b - stable/13 - zfs: Fix build with GCC 12. Content-Language: en-US From: John Baldwin To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org References: <202305030030.3430U4Mf074930@gitrepo.freebsd.org> In-Reply-To: <202305030030.3430U4Mf074930@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 5/2/23 5:30 PM, John Baldwin wrote: > The branch stable/13 has been updated by jhb: > > URL: https://cgit.FreeBSD.org/src/commit/?id=58b9432c405b6542cf33e1b57ff87365180b4da7 > > commit 58b9432c405b6542cf33e1b57ff87365180b4da7 > Author: John Baldwin > AuthorDate: 2022-12-21 18:49:23 +0000 > Commit: John Baldwin > CommitDate: 2023-05-03 00:25:48 +0000 > > zfs: Fix build with GCC 12. > > Silence -Winfinite-recursion for ldo.c in lua and -Wstringop-overread > for nvpair.c. > > Reviewed by: mm > Differential Revision: https://reviews.freebsd.org/D37631 > > (cherry picked from commit 2e08e4b75ea1080c224a33baf62199d893dc322d) After this commit I can build world + GENERIC with amd64-gcc12. -- John Baldwin From nobody Wed May 3 10:41:10 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QBD525Wt7z49C9r; Wed, 3 May 2023 10:41: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 4QBD524zMVz3PZ0; Wed, 3 May 2023 10:41:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683110470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1VMl2IL7xJhzduYtkenpFXS936VO0qBFijss3868g8M=; b=c4Veo9D7+xGrxp6IWyx0vuAq2N0HbFVli1sFYrPiIM1Q8ZNjbScd31KYc2smbkmEyyIlG2 HmOLT9ayzUPP0KtTgarvD5f94FeKy84lCldbl9+y/15dSW9o/GP0sF6ZIgCQjFM1TZGdk5 6tVf8lR4KSUIZORGnFr3pejvsjRW1DCJJbkJg4dBik3qDDnRaae5NafLOdsw/jWOhmCYer SopzytJOVaOtu8xlgG9P3BwkBlFBjEgMD2GYlXqlwSZ14H2cWEZL+FKQccjJS5rQwC/rv+ CF3GEEBc+KBUer48GyyllQ5LuJPxHtpUICC1/hHgdrz7vxv1pdAEMwN9eqtOKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683110470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1VMl2IL7xJhzduYtkenpFXS936VO0qBFijss3868g8M=; b=uY01ffaLT4wvvKM07G06g8LheHh6muljFpvlBKp/9B8DTU79iAxTAPqO7Zablt5JssGgc1 u9KTUAIcGjn7nHCxqFr5OP4JQmgssmXv0O0bc+dqvcqQ3GghGTiEZEXo7rv/M1FIyoSHgr 638v1S5O5gxZqG0C7OhuuXiKVcV5rbNlee3DspF+7Jt1t99Blw6hqcjck0r+rUgy3djBRk z7BVmG5Z8TUf+yWr973dvECpQRK0GvPc1zxP9KM3gatv5ABKddAvMLKpzhTLEVpY4pe0sH egxv2E/VclbU7FX2UF8LGA9XsNLZ6imDVApP11F0aiL0K50Gxh7H4Ps0yLHOAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683110470; a=rsa-sha256; cv=none; b=Xu3ERPgrYBfr0fd0wn8gsEHkU8sdO5Hb2VyJtRvZgB362EC2DHlagLyCFKtDs81eqPjLdE bC3dUl5JVLoNOgWlLCsFtZBkVVuaTb9DnLoY6QIF5cFzVMTbaPs02+oza6uS2omE7byMOl 511a/VdyZSPtyDjIj37p0iZkrDK0wO86E9DF0U/+X6edC0i7NzhmqxvESdndqq7DxLhhsN L/8hAaYUjRwI/miQ82rja13B4nJPkPUcl3+uuF1lEJhmdjmEp+My6I8gr+aujrg5iEB++/ fETeBmSIArC8SYEC2d74fBGGqw3OIt9yhQ5m8txDpW+JxvRp3JvzRjFYuZ/IzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QBD5241xXzRXJ; Wed, 3 May 2023 10:41: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 343AfAPX092454; Wed, 3 May 2023 10:41:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 343AfAIk092453; Wed, 3 May 2023 10:41:10 GMT (envelope-from git) Date: Wed, 3 May 2023 10:41:10 GMT Message-Id: <202305031041.343AfAIk092453@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: a7e6ae2dc64b - stable/13 - Apply clang fix for assertion building emulators/rpcs3 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: a7e6ae2dc64b313520adc6141e4cffb1fa962b66 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=a7e6ae2dc64b313520adc6141e4cffb1fa962b66 commit a7e6ae2dc64b313520adc6141e4cffb1fa962b66 Author: Dimitry Andric AuthorDate: 2023-04-28 14:08:42 +0000 Commit: Dimitry Andric CommitDate: 2023-05-03 08:18:46 +0000 Apply clang fix for assertion building emulators/rpcs3 Merge commit a5e1a93ea10f from llvm-project (by Mariya Podchishchaeva): [clang] Fix crash when handling nested immediate invocations Before this patch it was expected that if there was several immediate invocations they all belong to the same expression evaluation context. During parsing of non local variable initializer a new evaluation context is pushed, so code like this ``` namespace scope { struct channel { consteval channel(const char* name) noexcept { } }; consteval const char* make_channel_name(const char* name) { return name;} channel rsx_log(make_channel_name("rsx_log")); } ``` produced a nested immediate invocation whose subexpressions are attached to different expression evaluation contexts. The constructor call belongs to TU context and `make_channel_name` call to context of variable initializer. This patch removes this assumption and adds tracking of previously failed immediate invocations, so it is possible when handling an immediate invocation th check that its subexpressions from possibly another evaluation context contains errors and not produce duplicate diagnostics. Fixes https://github.com/llvm/llvm-project/issues/58207 Reviewed By: aaron.ballman, shafik Differential Revision: https://reviews.llvm.org/D146234 PR: 269489 MFC after: 3 days (cherry picked from commit 56f2446575c78d962b6dda5e3310bec078622f3d) --- .../llvm-project/clang/include/clang/Sema/Sema.h | 3 +++ contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp | 26 +++++++++++++++------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/contrib/llvm-project/clang/include/clang/Sema/Sema.h b/contrib/llvm-project/clang/include/clang/Sema/Sema.h index 681a76dfa56a..53257a1bb028 100644 --- a/contrib/llvm-project/clang/include/clang/Sema/Sema.h +++ b/contrib/llvm-project/clang/include/clang/Sema/Sema.h @@ -1365,6 +1365,9 @@ public: /// A stack of expression evaluation contexts. SmallVector ExprEvalContexts; + // Set of failed immediate invocations to avoid double diagnosing. + llvm::SmallPtrSet FailedImmediateInvocations; + /// Emit a warning for all pending noderef expressions that we recorded. void WarnOnPendingNoDerefs(ExpressionEvaluationContextRecord &Rec); diff --git a/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp b/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp index 83081bbf0aa0..a8fe9a68c8cb 100644 --- a/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp +++ b/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp @@ -17529,6 +17529,7 @@ static void EvaluateAndDiagnoseImmediateInvocation( bool Result = CE->EvaluateAsConstantExpr( Eval, SemaRef.getASTContext(), ConstantExprKind::ImmediateInvocation); if (!Result || !Notes.empty()) { + SemaRef.FailedImmediateInvocations.insert(CE); Expr *InnerExpr = CE->getSubExpr()->IgnoreImplicit(); if (auto *FunctionalCast = dyn_cast(InnerExpr)) InnerExpr = FunctionalCast->getSubExpr(); @@ -17567,10 +17568,16 @@ static void RemoveNestedImmediateInvocation( [E](Sema::ImmediateInvocationCandidate Elem) { return Elem.getPointer() == E; }); - assert(It != IISet.rend() && - "ConstantExpr marked IsImmediateInvocation should " - "be present"); - It->setInt(1); // Mark as deleted + // It is possible that some subexpression of the current immediate + // invocation was handled from another expression evaluation context. Do + // not handle the current immediate invocation if some of its + // subexpressions failed before. + if (It == IISet.rend()) { + if (SemaRef.FailedImmediateInvocations.contains(E)) + CurrentII->setInt(1); + } else { + It->setInt(1); // Mark as deleted + } } ExprResult TransformConstantExpr(ConstantExpr *E) { if (!E->isImmediateInvocation()) @@ -17639,10 +17646,13 @@ HandleImmediateInvocations(Sema &SemaRef, SemaRef.RebuildingImmediateInvocation) return; - /// When we have more then 1 ImmediateInvocationCandidates we need to check - /// for nested ImmediateInvocationCandidates. when we have only 1 we only - /// need to remove ReferenceToConsteval in the immediate invocation. - if (Rec.ImmediateInvocationCandidates.size() > 1) { + /// When we have more than 1 ImmediateInvocationCandidates or previously + /// failed immediate invocations, we need to check for nested + /// ImmediateInvocationCandidates in order to avoid duplicate diagnostics. + /// Otherwise we only need to remove ReferenceToConsteval in the immediate + /// invocation. + if (Rec.ImmediateInvocationCandidates.size() > 1 || + !SemaRef.FailedImmediateInvocations.empty()) { /// Prevent sema calls during the tree transform from adding pointers that /// are already in the sets. From nobody Wed May 3 10:41:11 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QBD5400tCz49C9t; Wed, 3 May 2023 10:41:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QBD536BZPz3PZG; Wed, 3 May 2023 10:41:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683110471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I1YRtQu3/teRW4eVVCyyfdY48wtEJdnBf4kykWiELHw=; b=EurN1iElF4gxiYYI7F/TjbmXiH0uuv51uWHTWb85oWW6MSvBkrMhJ4At9BXAfYxSztRKmS 3Kc4O/MkM/6wnEyHZGpq1QDesfvrjBk7zVC3/UsMcaRGU7UBjcWz4rzauBG/eSr7jL0Yao GbIhSKB/oYP6P6SSRyAAvaTq3jIqixeekQcWAkb5pXZlpSt0atkWRVYhWqVioKb8hoHb9S 3sCdmPJzJ/lc19aSr7L87HdUU54aRV6qxPyqzwuizk/cbYjmXwIjynNj4lLkvtfoSbVgCx M/wmvUyKZa4owitBUJRlXYIc6jVyYlsjBzWTePiEk/FZNRwwgrNZJfA7c54PzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683110471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=I1YRtQu3/teRW4eVVCyyfdY48wtEJdnBf4kykWiELHw=; b=lRtKaHUHNcicAQdEC5rqSEri1ZK69nW2Be9N7imwbhrcKEkZoz3hcWMOgSawS/2OUgCEQe EUmqpBdZLmXrS4r0MCt8HcWxLvxEvqozZSJRH4K2AjTLaSdCMSVrcgCbuqSS8Cx3x3ag3E /TK32BxOy25xgI9ZOJu1saEXOF8tJbOzudI/1epjjNDi/wKw04aRBF1QzYKMTp9EPYGe27 63FY7HUTFaKdoxiIMBTuEocR1o6+lYoaRWuQ1aPMyr+BFcdn2SDPKgSgFdP/OJxgD8JDnK ddtgvUG0yJzy0DIRtC82BTPEVOBleDrp2VCkWQrm/U15yYf1+NyBhRmvoGW1Wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683110471; a=rsa-sha256; cv=none; b=teX0SLGsbMlaqkWih7nbBQXqbLI7UySvaRcc03ZSVNqLNlGfZgZjX9vHt66+QQ0f3sRXKg zymelANfPcGvdbVY5h/JM6VCvCaM7fZqqO6GLwnJgJEiC28ZW6K46UTn91h6FPGJ19wEn/ OP8gbX32wr9HmhHLEi3neOjrTRkbq7+nFs1NsKmM1ijoIjkr9UlHn3Kii5o1i4DDYchhAY 9xCBmCOur0feZPvqI1I/ammQNSBHEvrPSQGaLW3mxh7Bgmmbgl/O1xJ4qx82JgUzmv6nbx aYED37mm/gVMeHTIUwGcYrCQJN09PDG9rHdu/rKp8wP4A5nMvOKV16MhGOOA9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QBD5350LlzRh1; Wed, 3 May 2023 10:41:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 343AfBvV092475; Wed, 3 May 2023 10:41:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 343AfBb9092474; Wed, 3 May 2023 10:41:11 GMT (envelope-from git) Date: Wed, 3 May 2023 10:41:11 GMT Message-Id: <202305031041.343AfBb9092474@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 387546f14b63 - stable/13 - zfs: make zfs_vfs_held() definition consistent with declaration List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 387546f14b638e07df72ef35589fb43d4309d294 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=387546f14b638e07df72ef35589fb43d4309d294 commit 387546f14b638e07df72ef35589fb43d4309d294 Author: Dimitry Andric AuthorDate: 2023-04-25 17:43:48 +0000 Commit: Dimitry Andric CommitDate: 2023-05-03 08:18:52 +0000 zfs: make zfs_vfs_held() definition consistent with declaration Noticed while attempting to change boolean_t into an actual bool: in include/sys/zfs_ioctl_impl.h, zfs_vfs_held() is declared to return a boolean_t, but in module/os/freebsd/zfs/zfs_ioctl_os.c it is defined to return an int. Make the definition match the declaration. Obtained from: https://github.com/openzfs/zfs/commit/62cc9d4f6 Reviewed by: jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D39753 (cherry picked from commit 64b5d74fffc8882d915e6e8de7e5fc893c606213) --- sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ioctl_os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ioctl_os.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ioctl_os.c index 7f7e2b72c51a..effc11518c57 100644 --- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ioctl_os.c +++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_ioctl_os.c @@ -59,7 +59,7 @@ zfs_vfs_ref(zfsvfs_t **zfvp) return (error); } -int +boolean_t zfs_vfs_held(zfsvfs_t *zfsvfs) { return (zfsvfs->z_vfs != NULL); From nobody Wed May 3 10:41:12 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QBD553hYFz49CKD; Wed, 3 May 2023 10:41: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 4QBD550DHsz3Pyy; Wed, 3 May 2023 10:41:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683110473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hRr/JT9yK4rbkic1zJbSeGzR/8djXlatW3LF+BisZOE=; b=wjBps/YTrxvzsFmg2kYdk5Hamv/gqMmGFtwZcrbJtImZrSlB013HPO4kXs1qZKJCymMX0d CJsqgrgUUysLwlC6hk5vn4MDxruOtBxQNy6MrAZbo2tKph4sLw4fltOJQUjzJThlDWk/SB 9O4Icz6BVcpbQdODt2Gsi0vWj9QhIU7sSp21BAnqZHpyp1gIVTxuqlTcHlPs1R4Dpbj1Ke 9Xi6fh0qmHmJMu6Zwx/DTBvDEKEyILMp9D1JvP4i0mSQVwWsnuZY/QdbwjR6OtamC38MmZ jePqMQhcldaaxUBJlkPcLBXuKEkpkeOSU4vkciLeK9E55b8+aNtfDKcAkbbJaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683110473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hRr/JT9yK4rbkic1zJbSeGzR/8djXlatW3LF+BisZOE=; b=vrmrIGn7kePYDZSuadi5uc2y+sXSjY1JZoTQoaThv56RQkK8ZkXDMKH3a2PPAzHveJQALG KxnHMzRWJr9TGf8Juif68JzzZIslxbOVwTLQit4wS8Fdi5EWQRKV3pVqegcsmdyBB2jDlx y888zlPtbQOQE4mCuYutW7NfvwINOss9HIb/pSUGdf6rhp4tYSj6zH7JCHrcpa55saTTCa oJoVXwgngvdiI1E3tVHZzM1MCzAKgTczmJ3yr2rJqPHw/V2yUQ1RkgLVbP1F6qlfhSvaO1 iIbDswAoDC2QRyxhFhxOGQ3/DLunWBKsF993AHcOY8qTRW0Bbl8WZTXMaFfTeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683110473; a=rsa-sha256; cv=none; b=Ktv1dGk9erUwASmT5RlKmp+piCv9Ai4NATCJ7k+1bLhvz2SgRQXg4sbWh6FpZua/F8xc8F +GjXfImOZfHKKTkV3uT4mB9M1knHGyZP5udYQ2KE8zP4xQLuoatzywCRiDBr7xv0QKA7Cz mZBCkHtsy004b/0jyFgD5lqSBdm/4lKRE2oP31xs/46ARg+UkUb5CMgp9l6V49xAInaBaS duXonB0Q2r5a/T9EGGcMIBaGGY5m95bWdQ/y68oelcYdiC5RrnNwwD4mpqj/FTP29U6mbr hqeZIPRKqLNzTHY3jJNcZNe6hCiYXl1Od7ESfU7mQbS1a0SmgOtfXDEZtcOMCQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QBD546QjRzRXK; Wed, 3 May 2023 10:41:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 343AfCW4092494; Wed, 3 May 2023 10:41:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 343AfCFN092493; Wed, 3 May 2023 10:41:12 GMT (envelope-from git) Date: Wed, 3 May 2023 10:41:12 GMT Message-Id: <202305031041.343AfCFN092493@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 35d8e035e22f - stable/13 - vm: fix a number of functions to match the expected prototypes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 35d8e035e22f4f79c28cdf713f7da94012a50b1b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=35d8e035e22f4f79c28cdf713f7da94012a50b1b commit 35d8e035e22f4f79c28cdf713f7da94012a50b1b Author: Dimitry Andric AuthorDate: 2023-04-25 17:52:26 +0000 Commit: Dimitry Andric CommitDate: 2023-05-03 09:32:57 +0000 vm: fix a number of functions to match the expected prototypes Noticed while attempting to make boolean_t unsigned: some vm-related function declarations and defintions were using boolean_t where they should have used int, and vice versa. MFC after: 1 week Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D39753 (cherry picked from commit f74be55e3045793a507d98127faf9aabd918e1ce) --- sys/vm/default_pager.c | 2 +- sys/vm/phys_pager.c | 2 +- sys/vm/sg_pager.c | 4 ++-- sys/vm/swap_pager.c | 2 +- sys/vm/vm_pager.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/vm/default_pager.c b/sys/vm/default_pager.c index d07a84f8c98e..b5b756741c73 100644 --- a/sys/vm/default_pager.c +++ b/sys/vm/default_pager.c @@ -54,7 +54,7 @@ static void default_pager_dealloc(vm_object_t); static int default_pager_getpages(vm_object_t, vm_page_t *, int, int *, int *); static void default_pager_putpages(vm_object_t, vm_page_t *, int, - boolean_t, int *); + int, int *); static boolean_t default_pager_haspage(vm_object_t, vm_pindex_t, int *, int *); diff --git a/sys/vm/phys_pager.c b/sys/vm/phys_pager.c index 6d7c5a4a7291..07ca6f0fc3de 100644 --- a/sys/vm/phys_pager.c +++ b/sys/vm/phys_pager.c @@ -269,7 +269,7 @@ phys_pager_populate(vm_object_t object, vm_pindex_t pidx, int fault_type, } static void -phys_pager_putpages(vm_object_t object, vm_page_t *m, int count, boolean_t sync, +phys_pager_putpages(vm_object_t object, vm_page_t *m, int count, int flags, int *rtvals) { diff --git a/sys/vm/sg_pager.c b/sys/vm/sg_pager.c index d7af2aed935a..bb2e8f39e219 100644 --- a/sys/vm/sg_pager.c +++ b/sys/vm/sg_pager.c @@ -56,7 +56,7 @@ static vm_object_t sg_pager_alloc(void *, vm_ooffset_t, vm_prot_t, static void sg_pager_dealloc(vm_object_t); static int sg_pager_getpages(vm_object_t, vm_page_t *, int, int *, int *); static void sg_pager_putpages(vm_object_t, vm_page_t *, int, - boolean_t, int *); + int, int *); static boolean_t sg_pager_haspage(vm_object_t, vm_pindex_t, int *, int *); @@ -211,7 +211,7 @@ sg_pager_getpages(vm_object_t object, vm_page_t *m, int count, int *rbehind, static void sg_pager_putpages(vm_object_t object, vm_page_t *m, int count, - boolean_t sync, int *rtvals) + int flags, int *rtvals) { panic("sg_pager_putpage called"); diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 372019affa46..1143fe935e72 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -426,7 +426,7 @@ static int swap_pager_getpages(vm_object_t, vm_page_t *, int, int *, int *); static int swap_pager_getpages_async(vm_object_t, vm_page_t *, int, int *, int *, pgo_getpages_iodone_t, void *); -static void swap_pager_putpages(vm_object_t, vm_page_t *, int, boolean_t, int *); +static void swap_pager_putpages(vm_object_t, vm_page_t *, int, int, int *); static boolean_t swap_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, int *after); static void swap_pager_init(void); diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c index cff8f5f9bdc3..ce7271f0dd57 100644 --- a/sys/vm/vm_pager.c +++ b/sys/vm/vm_pager.c @@ -129,7 +129,7 @@ dead_pager_putpages(vm_object_t object, vm_page_t *m, int count, rtvals[i] = VM_PAGER_AGAIN; } -static int +static boolean_t dead_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *prev, int *next) { From nobody Wed May 3 10:41:13 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QBD561X7tz49CPR; Wed, 3 May 2023 10:41: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 4QBD560gDfz3PvT; Wed, 3 May 2023 10:41:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683110474; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AGnzuiN2auT8KI/uRva7BQiVLxSrMRUazGJ1luOHJQE=; b=tqPZ8UN8wz/ElGNHU4WHhd6JnW/c2Daeo9IULe0q0RwNootFz3DRBENssA6noPtxCMv039 xrAtAbnp1g2lTcBRNEwzuDQLo7KIJW2mIXxTd8yhSbLIt7t/EewlghP8g63AzwJTadzblN mG3VQcxVz1WPOfYJQEWMJ9c7qLxQcGy9oAK4UyiCq0GRrsISQBF29wWaYA+NL6psu8iMv4 J7kaWWNUW3pTTL38plEQIT//Nun135IHW2eX3q6iEHV8R/SbYPvRwSgBqUb14XVLhVs8sJ vjJTSOoiTSTkjZMqYJlPQrspyMkRCF7zqDHau8VJwFj3GN1MWbr3Sm0RE2kmYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683110474; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AGnzuiN2auT8KI/uRva7BQiVLxSrMRUazGJ1luOHJQE=; b=r+D0Wwx8FnkAos04wurVjP2yIfB2lVaqF1RpSfAykgIi50k9TkYeD2mBHra0qyE9bADZbW MFkbTpb6gIzjSmE83orx+pYP32UvSbqeerEWpyVNeotg3yBGEuEVaER1J89US0WZWL3eJh 6OLCpjLucOwizo9JCTE+uiZ2NsjzXbT8eOD2cCN86rKSmu5vfZNVqp3BJSIqeEEr33Njgk kchYaZNbTo0Qpb43kJOVM/Al2DPYo1axaF/pbrdZ8ihNGIw7Heb4XxuLafDj1669tNKsux Rs3NHuwubzC/WvpLrAYXa6iuRoL/qdqsA2tCGYPmDDhYXmmb+JM1JkGrs3bMCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683110474; a=rsa-sha256; cv=none; b=hZ818powKIpJDBXw6CxHwG5UEt1o+wgkM/0qfs04mWwImNu6tChw1GK0N9mSVR3VtOPWWI cWwpQ2fjt0VFiAbzAYVevp7FT4PLVpZGODxrLzsEG5jczxTnGnhL7qX98Cpu00mYVAAaRR KTaciMkY9/2xTG2YVnCLRxob5JGCHgrxvVxfpO8Hw46GRPa8rH6pYlTfTv43XGMlg6uPtO 3QKMm0GtfE2V7sdLztRvGS3saoTJS/vb8jUgg/X9ymtNmb/UHXHBqXmH6VmQ/X1qlX7CNN REC6ryvJKM4DcQD01qn09UgkPz8JuIKqCDlyH6D1b8q1EVZIKyALAuNAfdRZjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QBD556srlzS0F; Wed, 3 May 2023 10:41: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 343AfDvH092514; Wed, 3 May 2023 10:41:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 343AfDQw092513; Wed, 3 May 2023 10:41:13 GMT (envelope-from git) Date: Wed, 3 May 2023 10:41:13 GMT Message-Id: <202305031041.343AfDQw092513@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: f6d7ceb2baa3 - stable/13 - boolean_t: change to unsigned int to avoid signed bitfield warnings List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: f6d7ceb2baa3dba1503165e7482d370cb0e32d9a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=f6d7ceb2baa3dba1503165e7482d370cb0e32d9a commit f6d7ceb2baa3dba1503165e7482d370cb0e32d9a Author: Dimitry Andric AuthorDate: 2023-04-25 17:52:40 +0000 Commit: Dimitry Andric CommitDate: 2023-05-03 09:33:01 +0000 boolean_t: change to unsigned int to avoid signed bitfield warnings This is the final part, which actually makes boolean_t unsigned. Note that we do not change its size, nor do we try to change it directly to bool, since that results in a lot of regressions. Converting the remaining instances of boolean_t to plain C99 bool can now be done in a piecemeal fashion, after which boolean_t may hopefully be retired. MFC after: 1 week Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D39753 (cherry picked from commit 3029b0b0e9d68eb54e3bdd9e3e49e0f0d2d57835) --- sys/sys/types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/types.h b/sys/sys/types.h index 58abcf00cebb..4117ed60660d 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -271,7 +271,7 @@ typedef __vm_size_t vm_size_t; typedef __rman_res_t rman_res_t; #ifdef _KERNEL -typedef int boolean_t; +typedef unsigned int boolean_t; typedef struct _device *device_t; typedef __intfptr_t intfptr_t; From nobody Wed May 3 10:41:32 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QBD5T2T2Kz49CWQ; Wed, 3 May 2023 10:41:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QBD5T1RVtz3R6c; Wed, 3 May 2023 10:41:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683110493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+oqnNuD2IUOqYlYYhqa2Y1IVl5XMeRsiyoPTMfLo7uI=; b=yq77suBcT0vCtLnO4qonUo6xztFHeOE6EZm2ef/I6YGk/pAnFm0n8gfqHVR8uuCiZOel4y eIezHcZqbLOllb6g7PU5VuPR/fusWvt8co3iNdQ9IVN9oe3N9JuuvL0OvOxIxvUxY6yPNx j+4VDORqx5w6iLgqxr9MRBiqhARghumaE9tajbbngeXWgenqSUbIu6ShKCjVzLs+NXIdYs oVVoigZ6bFFyoDFP3gx7L8XAIcXlQJWA95GWl6vxp+lBPL/zCiUAs5kEIGoKlTT/0pUzfh QYmYLqVoO2rH+Pk9eUGZr65QeB+548kHbnxMgYfMNIzEZYpZUDj8leokFXYmGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683110493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+oqnNuD2IUOqYlYYhqa2Y1IVl5XMeRsiyoPTMfLo7uI=; b=BxzYFTTfyjqzOCuI1YknjLYQM85DB9G5FuTcGNS/ul5lF/eeHB15/Oh1/jnVfZYLv4KZCg vCWwjWWB3N0/+0P+MUUKsEAmQidO/EWt+BSIt8mS/BvF25E2ZzbYRrfuJtZR5YCtq2iv3T xOmX8tmhNsVimtZL7LCahRtIBTFMr9rqhwlAQRtoQqX89zmm3FIDjK45F9RwXVQB5ebuqP araUBFROwEwPh1bQo0czPGbMGuzaBPvu5aJtBYUNpJB+5cVDS/0KyKy/KbT6p2sjCxppU8 dAZVjcsFhIcfbz+sspOifqfWSj9s1lZzU5R1VQY4UbfUHhlVMEpQu1D/2M9KsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683110493; a=rsa-sha256; cv=none; b=E2O+v54ylYgfQp1W8oOzJKwlWzo//fwia2AKrM02swooI3PCeM9FRr5J/9jTPzpTMyO7/5 G+TKfNWg3xKbP19OKTWG9foL9Ud+fokVF5ffaWEm7Gfv7NTRTXl71OQsUN7TNd5hmUWs2G Ihg1w2OgZxD4QxcK4stc/uPHB/R9NDDneR/muz3r2nEeVbzvmA4opPYmmN77c08oyzw1gO ADYNmfDRf4rd0ajsoZiUq10ULfx564Z1C7EHuFQYAY6BgnN+MQx5pPnNxFLIiNim+L1K9l JFc6DShtRmwFiQPIJASCSPlIIiZKaxVssLoUD34aTTiHJZbmK7AAh2OqUfeTNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QBD5T0XS5zRFd; Wed, 3 May 2023 10:41:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 343AfWDP092698; Wed, 3 May 2023 10:41:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 343AfWki092697; Wed, 3 May 2023 10:41:32 GMT (envelope-from git) Date: Wed, 3 May 2023 10:41:32 GMT Message-Id: <202305031041.343AfWki092697@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 44f4aaee6be3 - stable/12 - Apply clang fix for assertion building emulators/rpcs3 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/12 X-Git-Reftype: branch X-Git-Commit: 44f4aaee6be33d7e2afe3ce0f0fb856e83da01d7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=44f4aaee6be33d7e2afe3ce0f0fb856e83da01d7 commit 44f4aaee6be33d7e2afe3ce0f0fb856e83da01d7 Author: Dimitry Andric AuthorDate: 2023-04-28 14:08:42 +0000 Commit: Dimitry Andric CommitDate: 2023-05-03 08:25:29 +0000 Apply clang fix for assertion building emulators/rpcs3 Merge commit a5e1a93ea10f from llvm-project (by Mariya Podchishchaeva): [clang] Fix crash when handling nested immediate invocations Before this patch it was expected that if there was several immediate invocations they all belong to the same expression evaluation context. During parsing of non local variable initializer a new evaluation context is pushed, so code like this ``` namespace scope { struct channel { consteval channel(const char* name) noexcept { } }; consteval const char* make_channel_name(const char* name) { return name;} channel rsx_log(make_channel_name("rsx_log")); } ``` produced a nested immediate invocation whose subexpressions are attached to different expression evaluation contexts. The constructor call belongs to TU context and `make_channel_name` call to context of variable initializer. This patch removes this assumption and adds tracking of previously failed immediate invocations, so it is possible when handling an immediate invocation th check that its subexpressions from possibly another evaluation context contains errors and not produce duplicate diagnostics. Fixes https://github.com/llvm/llvm-project/issues/58207 Reviewed By: aaron.ballman, shafik Differential Revision: https://reviews.llvm.org/D146234 PR: 269489 MFC after: 3 days (cherry picked from commit 56f2446575c78d962b6dda5e3310bec078622f3d) --- .../llvm-project/clang/include/clang/Sema/Sema.h | 3 +++ contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp | 26 +++++++++++++++------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/contrib/llvm-project/clang/include/clang/Sema/Sema.h b/contrib/llvm-project/clang/include/clang/Sema/Sema.h index d8b2546b81a3..aaec49abfd5b 100644 --- a/contrib/llvm-project/clang/include/clang/Sema/Sema.h +++ b/contrib/llvm-project/clang/include/clang/Sema/Sema.h @@ -1314,6 +1314,9 @@ public: /// A stack of expression evaluation contexts. SmallVector ExprEvalContexts; + // Set of failed immediate invocations to avoid double diagnosing. + llvm::SmallPtrSet FailedImmediateInvocations; + /// Emit a warning for all pending noderef expressions that we recorded. void WarnOnPendingNoDerefs(ExpressionEvaluationContextRecord &Rec); diff --git a/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp b/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp index f04eb9199024..f84b3d9c468d 100644 --- a/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp +++ b/contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp @@ -16642,6 +16642,7 @@ static void EvaluateAndDiagnoseImmediateInvocation( bool Result = CE->EvaluateAsConstantExpr( Eval, SemaRef.getASTContext(), ConstantExprKind::ImmediateInvocation); if (!Result || !Notes.empty()) { + SemaRef.FailedImmediateInvocations.insert(CE); Expr *InnerExpr = CE->getSubExpr()->IgnoreImplicit(); if (auto *FunctionalCast = dyn_cast(InnerExpr)) InnerExpr = FunctionalCast->getSubExpr(); @@ -16680,10 +16681,16 @@ static void RemoveNestedImmediateInvocation( [E](Sema::ImmediateInvocationCandidate Elem) { return Elem.getPointer() == E; }); - assert(It != IISet.rend() && - "ConstantExpr marked IsImmediateInvocation should " - "be present"); - It->setInt(1); // Mark as deleted + // It is possible that some subexpression of the current immediate + // invocation was handled from another expression evaluation context. Do + // not handle the current immediate invocation if some of its + // subexpressions failed before. + if (It == IISet.rend()) { + if (SemaRef.FailedImmediateInvocations.contains(E)) + CurrentII->setInt(1); + } else { + It->setInt(1); // Mark as deleted + } } ExprResult TransformConstantExpr(ConstantExpr *E) { if (!E->isImmediateInvocation()) @@ -16747,10 +16754,13 @@ HandleImmediateInvocations(Sema &SemaRef, SemaRef.RebuildingImmediateInvocation) return; - /// When we have more then 1 ImmediateInvocationCandidates we need to check - /// for nested ImmediateInvocationCandidates. when we have only 1 we only - /// need to remove ReferenceToConsteval in the immediate invocation. - if (Rec.ImmediateInvocationCandidates.size() > 1) { + /// When we have more than 1 ImmediateInvocationCandidates or previously + /// failed immediate invocations, we need to check for nested + /// ImmediateInvocationCandidates in order to avoid duplicate diagnostics. + /// Otherwise we only need to remove ReferenceToConsteval in the immediate + /// invocation. + if (Rec.ImmediateInvocationCandidates.size() > 1 || + !SemaRef.FailedImmediateInvocations.empty()) { /// Prevent sema calls during the tree transform from adding pointers that /// are already in the sets. From nobody Wed May 3 10:41:34 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QBD5V49NBz49CTM; Wed, 3 May 2023 10:41:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QBD5V2Qqmz3R04; Wed, 3 May 2023 10:41:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683110494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OO7MgqiOXrC36Ulcmw+YWYRkCANRlFY8FnSTegc/Rjo=; b=l3yuHSc7SUatK5Dq+oqrh8QDXSaB5GG37TDC2vm4QSWGVrh2Fph8JiLXyE5zT5zfZUIUZV 3EX/gyg0kG8LoQC5rjEZuM9zbcr4YyDOFxg3wFWErnMN52exLOA4ck/0faSvvHZOc3ilYT HCMgBqIN8mMexAHLJ1W4KzkCuq0t5BiggTF/I9jVy20XCBFMgfFBpUqDHTJ4UMEu23YeAE AoJjcXjOI6pI/d6TBE7BFx636drQwmsiU/lBKsruhxj7yu85Nl8tcDin99Y8JC+WwUFdGJ i1GrKEmLe5o2l/N1JKCdbxtID7Yh/hOP3eFCOMHNwIh3G72WOpwVWX6tmvpU1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683110494; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OO7MgqiOXrC36Ulcmw+YWYRkCANRlFY8FnSTegc/Rjo=; b=la7fNTeSIQdJnyjkOyDetA1Fhd0/7F0hUjaSnXIHWdx1pSTMk0SvhqZSGsNnTxfkTOPxBn yAQ0jsNjJ4EgTxHhIXP3vrMzvHyX9I4VgCF9UeX6Rn8Q7oSTE4a4Lb4ipYzlmS0BwWFXfq wvlqeRCHKPOYv5OPqYP/P5wHVQBNdvGYGpDNPTcDt4GjNefrMb7sOhPl0PtRm+I12AyEmq l+UTtRVPZKbKQkFA2ZVA0xedFTc56lBA100x8KbZKzfwCa+qWLPbbU4MK2IMBmvRdg0z8W wf4atyKKZBmZhzDLlPnUfy19lqrcbASF4XYSQSm2RaJbBNYykKYxHFo65hbvgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683110494; a=rsa-sha256; cv=none; b=Di/JvH1HZzU4m7uDps1ogvFpDQmgAruq2PMLL0BheuddC+VogHgTQ2ZGC1bjBqktDLwFAD iL/ZnWh3nG6dp6r1YyAknNwBwxRA/xHGvDDO3NEmMkqWXphZ+pznj3DR30WuQ6JeBJJ/Vv 81I6/HTiy0KFP8C8zARdofYQZif0k6nWFLLoNUyYIWWIk+7Z+vt6hX+uHn+4KFJpJLwAEV i0MBZlz9guiusxHlgEVvtH70ttvJFiAM6mbwFNTAyGNRf5eq3u0HJbvrm1gXIv0EY4UDnP 4HcR5oAyuX0qIOX9KBJVU8QwCVH9epVGdx0YUFKtga40fQBIdRlle0+uI1cJFQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QBD5V1VzGzRjl; Wed, 3 May 2023 10:41:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 343AfYGK092717; Wed, 3 May 2023 10:41:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 343AfY98092716; Wed, 3 May 2023 10:41:34 GMT (envelope-from git) Date: Wed, 3 May 2023 10:41:34 GMT Message-Id: <202305031041.343AfY98092716@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 3f527b4b8fd5 - stable/12 - vm: fix a number of functions to match the expected prototypes List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/12 X-Git-Reftype: branch X-Git-Commit: 3f527b4b8fd5555e72d8cd3e388a28f0f7496e30 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=3f527b4b8fd5555e72d8cd3e388a28f0f7496e30 commit 3f527b4b8fd5555e72d8cd3e388a28f0f7496e30 Author: Dimitry Andric AuthorDate: 2023-04-25 17:52:26 +0000 Commit: Dimitry Andric CommitDate: 2023-05-03 09:36:32 +0000 vm: fix a number of functions to match the expected prototypes Noticed while attempting to make boolean_t unsigned: some vm-related function declarations and defintions were using boolean_t where they should have used int, and vice versa. MFC after: 1 week Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D39753 (cherry picked from commit f74be55e3045793a507d98127faf9aabd918e1ce) --- sys/vm/default_pager.c | 2 +- sys/vm/phys_pager.c | 2 +- sys/vm/sg_pager.c | 4 ++-- sys/vm/swap_pager.c | 2 +- sys/vm/vm_pager.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/vm/default_pager.c b/sys/vm/default_pager.c index 877e6441d596..b94279f0198b 100644 --- a/sys/vm/default_pager.c +++ b/sys/vm/default_pager.c @@ -53,7 +53,7 @@ static void default_pager_dealloc(vm_object_t); static int default_pager_getpages(vm_object_t, vm_page_t *, int, int *, int *); static void default_pager_putpages(vm_object_t, vm_page_t *, int, - boolean_t, int *); + int, int *); static boolean_t default_pager_haspage(vm_object_t, vm_pindex_t, int *, int *); diff --git a/sys/vm/phys_pager.c b/sys/vm/phys_pager.c index dfddbd81061b..5054a7d8e3f6 100644 --- a/sys/vm/phys_pager.c +++ b/sys/vm/phys_pager.c @@ -290,7 +290,7 @@ phys_pager_populate(vm_object_t object, vm_pindex_t pidx, int fault_type, } static void -phys_pager_putpages(vm_object_t object, vm_page_t *m, int count, boolean_t sync, +phys_pager_putpages(vm_object_t object, vm_page_t *m, int count, int flags, int *rtvals) { diff --git a/sys/vm/sg_pager.c b/sys/vm/sg_pager.c index a31c2bb8fd27..09e90dbf1f19 100644 --- a/sys/vm/sg_pager.c +++ b/sys/vm/sg_pager.c @@ -55,7 +55,7 @@ static vm_object_t sg_pager_alloc(void *, vm_ooffset_t, vm_prot_t, static void sg_pager_dealloc(vm_object_t); static int sg_pager_getpages(vm_object_t, vm_page_t *, int, int *, int *); static void sg_pager_putpages(vm_object_t, vm_page_t *, int, - boolean_t, int *); + int, int *); static boolean_t sg_pager_haspage(vm_object_t, vm_pindex_t, int *, int *); @@ -210,7 +210,7 @@ sg_pager_getpages(vm_object_t object, vm_page_t *m, int count, int *rbehind, static void sg_pager_putpages(vm_object_t object, vm_page_t *m, int count, - boolean_t sync, int *rtvals) + int flags, int *rtvals) { panic("sg_pager_putpage called"); diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 516be82c474f..d30c5a69ead1 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -369,7 +369,7 @@ static int swap_pager_getpages(vm_object_t, vm_page_t *, int, int *, int *); static int swap_pager_getpages_async(vm_object_t, vm_page_t *, int, int *, int *, pgo_getpages_iodone_t, void *); -static void swap_pager_putpages(vm_object_t, vm_page_t *, int, boolean_t, int *); +static void swap_pager_putpages(vm_object_t, vm_page_t *, int, int, int *); static boolean_t swap_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, int *after); static void swap_pager_init(void); diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c index 3864c9dfc1c4..fd39ddbcd728 100644 --- a/sys/vm/vm_pager.c +++ b/sys/vm/vm_pager.c @@ -123,7 +123,7 @@ dead_pager_putpages(vm_object_t object, vm_page_t *m, int count, rtvals[i] = VM_PAGER_AGAIN; } -static int +static boolean_t dead_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *prev, int *next) { From nobody Wed May 3 10:41:35 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QBD5W4GBQz49C6J; Wed, 3 May 2023 10:41: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 4QBD5W3MC5z3R7J; Wed, 3 May 2023 10:41:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683110495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zDH7tm1TQW/1zr5Ehv5qHKFO3iF2KMTkydT7cVAKwrU=; b=vYuqhyvGXIdcNzyaSZtR2zIJb15tL6/LqdWTAEIGpOzmABpr0xk8TdrS4mye3nC0mvzYon XDntBtTqdpTHwZL6E0APSfW/cmZog7yqM6DJOcxQJTY1WqkZtW71euo3MlaLGWA8B2AwRl E9v61ycKaxOZPr7ci5E+jzJdznGC04DZzR3jtZEkiBgBBg56gieJefoPVcBsolvaeKnSSQ 3Uj/JNPK5aRYHg4mNNvO78/ULt4tTJwXGX6C5nlzFFxQdmSS6Gxjor6GNNdOlsehrGfES7 EVyT+EHBxMZe49wwWDDdvg2+A+/YDwshskwBeHOhi9YxazhSw4yUiTdHxv+wow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683110495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zDH7tm1TQW/1zr5Ehv5qHKFO3iF2KMTkydT7cVAKwrU=; b=LaFLzlhRrUxysNZpY7bcJl9pmL60NDrEisxHd9BQVRQQ9M/gRFS8+xqwOvARG/IbgW1OMa l/CStq73Q8/sgxp3x/IDimLnuhCe1+nJhK+PP/wdJZo2yG6T31TFzSo281y5flsn/Z3m6A qPF6h9yrTQzSOvOT2zVGUkFzGeor0QwUhyA1hxSz+Sn0lJJuuYHw9PbR9EFQ2nXT6jjHZO lwV7khn86MRAOAwAfNLGS4/B6Cl71npcJDvIJw7kSkoahBpkyO1eoV5h/k3Gk7lllkNOGI lb6UAqVf3O/swLwN5yj7cAjOrTm7bvDfbf/t4n8+ZtB1h7C4Na9+XPMr5DpQzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683110495; a=rsa-sha256; cv=none; b=naC3WdLmU7TMhihPRNKSOM3+pV7y6yHICY9Cz0fBOe2a1xVVYIZ+dGFWPA+0GIk4T1IAn1 4JtBNnoh9FOopOHBwSDYnjJv1jMk0pE2mTxfZXi1wlw3GItjUb4bI7KFnfLDTMc/S6J+ce AtgZX22O+zFvNId3Emg94rcSzWuLKD5PlQvxi+3qiSZ30HaYAR6sfyXUAv3nkWMZMpTd+K iq5L71Ewf/J/oImOTidHZM1U5LSPwMtmTPDOY405FcfdFlqvhcnJQnH8nGBPuLPyNobqzH X4PHR7Cqtzs4w9FUdxq77iMJ7t2ZsAPXiKMbgyhPI1jGGHTTEpnKfszXTOO3PQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QBD5W2R58zRXP; Wed, 3 May 2023 10:41:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 343AfZ7Y092738; Wed, 3 May 2023 10:41:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 343AfZSW092737; Wed, 3 May 2023 10:41:35 GMT (envelope-from git) Date: Wed, 3 May 2023 10:41:35 GMT Message-Id: <202305031041.343AfZSW092737@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: c3da468befd3 - stable/12 - boolean_t: change to unsigned int to avoid signed bitfield warnings List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/12 X-Git-Reftype: branch X-Git-Commit: c3da468befd3c3c4dd5d24cca9c9b2b98998d74c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=c3da468befd3c3c4dd5d24cca9c9b2b98998d74c commit c3da468befd3c3c4dd5d24cca9c9b2b98998d74c Author: Dimitry Andric AuthorDate: 2023-04-25 17:52:40 +0000 Commit: Dimitry Andric CommitDate: 2023-05-03 09:36:36 +0000 boolean_t: change to unsigned int to avoid signed bitfield warnings This is the final part, which actually makes boolean_t unsigned. Note that we do not change its size, nor do we try to change it directly to bool, since that results in a lot of regressions. Converting the remaining instances of boolean_t to plain C99 bool can now be done in a piecemeal fashion, after which boolean_t may hopefully be retired. MFC after: 1 week Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D39753 (cherry picked from commit 3029b0b0e9d68eb54e3bdd9e3e49e0f0d2d57835) --- sys/sys/types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/types.h b/sys/sys/types.h index 0b8887912509..72889f3d5a93 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -269,7 +269,7 @@ typedef __vm_size_t vm_size_t; typedef __rman_res_t rman_res_t; #ifdef _KERNEL -typedef int boolean_t; +typedef unsigned int boolean_t; typedef struct device *device_t; typedef __intfptr_t intfptr_t; From nobody Wed May 3 14:33:03 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QBKDb6QYBz49PN6; Wed, 3 May 2023 14:33: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 4QBKDb5fBlz40wW; Wed, 3 May 2023 14:33:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683124383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KKN77LXdtWtHLVkx4imlRAZQdznEPsb+PKe4k/ler/Q=; b=KEm+cqAFXmyRIdYjKM5rJ/LLYxXMtKePTOziyqSC9mlUHm5D+/OTGusk4pz8/jixCVJVyW nUP0mB5K93+BwPebXxKb6eRs0TV/W6o0dbmdl6BOd7hxLItpMm/p0rKsUJ+SMh3V9AF3nV HfZ/ti+UUfrNB8E8+XncTTRiOBeTVdUV+1sCP89WWELu/74nFYySegqvAlb5RUdrOCJMYp B94iy+TEUm+C4/sGIxIM3WNeGkNk192PYNkBN/TsqAmz+JOrf9tXkhITkV/7ZX6yRwZ/Ud hhWUV900G7GQkZDfIlUsSIxnFI8f7kjYsZlfmgbPtsh0rjy+yMVpDpYce/BjPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683124383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KKN77LXdtWtHLVkx4imlRAZQdznEPsb+PKe4k/ler/Q=; b=Ywl/FDp+nvuYpJi2skosnTDlTNwt7SgB/3xGbYOf/xpHv2wQTrAx0b8zRIfJLGIUSB/c/U RqctF23l11V6r5C/5nek4g80wtkE/7iHCK+Ns/WxVetkZIJVlv6og55fjpW4lE3rMqS2Lg vx0OJ/fs+NGs070X/B/Vxrzk3ZDQtjVoMj5PHlUXidXcfEOJacgS5prqMOOyUkNOUI+XBT +EtIPLIA0ZQ6n8kDOPkNMbYndHvqq9C0YnEjJZ+OgA20y+qG/X6lIDeiaAdx73q0z6YaZn Ya+IAzVafz5XWkmzI/QWv18urns5oDowTDML/Ro90SoJoAhDbsHxyUj802xcnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683124383; a=rsa-sha256; cv=none; b=FzJvq6lRTokifd+0HucLPiS3QTV/9xhAhRCaDEzdkS0YFqIzl3aVXNIWfAtFyMeOrlIihG O1PKDDOCNewjKGQmiHuRdl9SyDAQUp3curXWW5uMs+pPFzn1svBg+zFakBHVvTX7Jl/3h9 5wusn1JEXj1TaBAyPbJYQx7WFzjs80YaacCj4P5YtyHjtzqz2l0RFPvjT3efPyt/jGVCD3 Hh3sdPK0yIvPcM0MGHymUxtZi0x5mHv+Dq0Gp5AYFDRabLXHhrM+ndncgEcMHHwbZFiQN/ wAs3/2DyAY+a6YuC6NJRd3GSONLabU5UWVbtr1IhQZoZWfW1fABTRdA2Xv/xWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QBKDb4jDlzYqC; Wed, 3 May 2023 14:33: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 343EX3d3075273; Wed, 3 May 2023 14:33:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 343EX3j9075272; Wed, 3 May 2023 14:33:03 GMT (envelope-from git) Date: Wed, 3 May 2023 14:33:03 GMT Message-Id: <202305031433.343EX3j9075272@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 22028f12f1ed - stable/12 - powerpc: fix another pmap related function to return the correct type List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/12 X-Git-Reftype: branch X-Git-Commit: 22028f12f1ed39cf556dc477f6b34989dc5e176d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=22028f12f1ed39cf556dc477f6b34989dc5e176d commit 22028f12f1ed39cf556dc477f6b34989dc5e176d Author: Dimitry Andric AuthorDate: 2023-05-03 14:31:11 +0000 Commit: Dimitry Andric CommitDate: 2023-05-03 14:31:11 +0000 powerpc: fix another pmap related function to return the correct type Missed one prototype while cherry-picking commit d14260188752. Fixes: e9e1f2a88e4b --- sys/powerpc/powerpc/pmap_dispatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/powerpc/powerpc/pmap_dispatch.c b/sys/powerpc/powerpc/pmap_dispatch.c index 424162a50444..5b6b166e656b 100644 --- a/sys/powerpc/powerpc/pmap_dispatch.c +++ b/sys/powerpc/powerpc/pmap_dispatch.c @@ -224,7 +224,7 @@ pmap_is_referenced(vm_page_t m) return (MMU_IS_REFERENCED(mmu_obj, m)); } -boolean_t +int pmap_ts_referenced(vm_page_t m) { From nobody Wed May 3 22:42:12 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QBX510NPyz49LgM; Wed, 3 May 2023 22:42: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 4QBX506wM5z45qh; Wed, 3 May 2023 22:42:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683153733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PGp0UYuE0ERGOaAKBp0czhWE8j1qZOmbQuc4fq983u0=; b=pR5mRhUIxdsTvgqrlacGYVY+hFGoid/8mUa/nhng5OOK5NQbC16Y00sQ9UhVccCQq05KMR iaBY7t9Z6WW+2IZKEQcXDb1+XQvNlYoMjzk502wXZ9LXq6hJRU1nXkhK5wgp8ev1w/lumF beypjCKnXE4KB4CKMGmD5kg392dyAwqu0+QbySQnVVbEuWCfeQvx83RyAyzyEWXmCb2/Np ijdjop7z/L7/Lo8SwEmp9Tkn3ibsonv1UN/+0X3LevNdgO1GjLUhgXnjFrDsFYSB6q0Bud dMVv7esLvFhev5WQtAADrpnWYXWseD167LtG6hgNiIrDdtQSvko8c6TSKp6hJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683153733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PGp0UYuE0ERGOaAKBp0czhWE8j1qZOmbQuc4fq983u0=; b=UdF/H1GbxjsMyUxsJk29vh69LO0CtjgrKhG7XUx2qo7kWRFfEuOE/teXol313xA26/BIxa hJJ1JikGSGS7CDeS/YwGigEWCT9O9M92WwBsoyJbxsnS+BzhBuJvc6C3gblsGba6rtVfJj /0Y02bIC5yjUbcmBC+OPFDb/xcbNZNXMhAPy/Z9WUE80iAv/ImgZsDEBjkYX2m81SyAbDB bwF2pKWNcxtvWulncBqJ4TtM5CZ/YgqbLpyFy8c4Uk/OKu+YJ8jIXo6k0nRPQ9m1wiq3nB 3ZNg8mUiPIwOf5epNTkOHybyd0WeaCRtL0g4ivyBFETbqEmC68nCS+mNfnH/3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683153733; a=rsa-sha256; cv=none; b=w14m0gBEc2i55oKlDVBfy4uNCqJq2SQDEqECVVDCKVv/teskGgI8adh1BPrL+/mSAWBIBZ JJE+nbs6zwXbkrGmDK97iZPo/+XbJtIN52mDOiQFyFX3CAAx0IRNigUqfkuz+q3lFVGHRA hj4vb5TevrGxe8nnYn2Tk6mxCrnLmEH2sfC/0X3WL6A2eewJNJPFfdsDxsBEyWJmCujxR6 HOXuQ7iwSqX7OoFPCuWSk0cBDaoRe28f/0bUQWAyKAux4wE6jRRNzPVXyhPE13cHM2gDGj PMOO+Tt9VsqK8hgd6kuEJ86FahSWhlyW9B5xSBExtgiSNbc3gDWQ8mWFSECSzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QBX50602rznjk; Wed, 3 May 2023 22:42: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 343MgCi1081953; Wed, 3 May 2023 22:42:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 343MgC2h081952; Wed, 3 May 2023 22:42:12 GMT (envelope-from git) Date: Wed, 3 May 2023 22:42:12 GMT Message-Id: <202305032242.343MgC2h081952@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 7dea7445ba44 - stable/13 - Cirrus-CI: update stable/13 CI image to 13.1 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 7dea7445ba4443190edca781bd6a293ea6e2c2ff Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7dea7445ba4443190edca781bd6a293ea6e2c2ff commit 7dea7445ba4443190edca781bd6a293ea6e2c2ff Author: Ed Maste AuthorDate: 2023-05-03 20:31:22 +0000 Commit: Ed Maste CommitDate: 2023-05-03 20:33:52 +0000 Cirrus-CI: update stable/13 CI image to 13.1 We want to ensure that stable/13 still builds on the oldest supported 13.x release, so not updating directly to 13.2. Sponsored by: The FreeBSD Foundation --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 824ffcda20ca..88d232403ed1 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -5,7 +5,7 @@ compute_engine_instance: # gcloud compute images list --project freebsd-org-cloud-dev --no-standard-images platform: freebsd image_project: freebsd-org-cloud-dev - image: freebsd-13-0-release-amd64 + image: freebsd-13-1-release-amd64 cpu: 8 memory: 8G disk: 40 From nobody Thu May 4 05:42:39 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QBjQ75nWxz49htP; Thu, 4 May 2023 05:42:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QBjQ74z3yz3pp6; Thu, 4 May 2023 05:42:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683178959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UnvXM8pIwWfcbLCSigw/TzlYtLLeSFJh+ozbMAB0Uk4=; b=YCA+ugn+BoHNxFl+l6DWfDrcKZRpXYFMaMPYOGOsm+/uOhUluuB/MZVu5jQHLhpUuY8B9J sV9ZcR9SmGrbt4Y8zwByeoPFicxhSPja2HKMdiydcMC69SScdoIoo76Np7OjARCb1v1ZB+ HswZIohQnAb8PcrwsewbkoLrBK/xW8n7OkK4fSup+E+Ibu1NEoy4XWJcSObBLBTU0lMo91 n1DvaTmYHg2mwjpT2xvC9p6jJXKEv7HBbpUCqncd6m6c1wU0R56Anjne0E5jcEktRm1owH 46sUNKXpKsszV5e5X5x5tGqeun8nYr8BVBUpM9uBc8y5GIeLE/U9lPWGzg1nfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683178959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UnvXM8pIwWfcbLCSigw/TzlYtLLeSFJh+ozbMAB0Uk4=; b=CiwjNUZZ7F0OIoHFk39D2Sb+JyDB98omX4Qr7i/dAiZocztGD2WVxtn8+7yJNWF2VPoc3r 0cc9rEdSxgyb7GpS/p+ZLLBbU2ZRGLH8gxBjIihN+UpjNiJTU/ZB86wMblGxmeBzErAFAo y8VzhzovUVtzKH1R3OqdVpcQXt6NJjrzvHfUCcwtgaFuwhOGha1TpofWpVgkr/5QOiSb5q geLqkOVwdqVBmGKt1NB3fEP0A/KkcoM6C0oOM3yRb9i/OfRNBMwo6rZHWUWoVADw5H3zUE YAxSQmhnEaqD1mQBxXd316fDUCt/dWzkpGOdZrCNhZyVymKdecHinJcLVMJT6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683178959; a=rsa-sha256; cv=none; b=rOv0PkLJBZ4BespeYJ2BEQYqzpqKYeBuIZ9ktiPz4MdErNpQiSL687GA5Qi/C+0paXDNbJ Eze6AnUOzWxS0j5HAd73VSX68oUMRwL69zRTJRMq7N1+DnUVUOLOVRIK6v5agRAc9BlRSE bbUUd0RsYoTnJ8KSyt0mM5BwduR3yDoPfjpPEuah6RnoRQZw2ZNJ18OcmcBqeUQBVV/Ekj LYSnHr2xng9+5dnKvysVXGpV8N9cYJlSLK5D08qm8OScarNo/Bt0zZSVgUjYVsQruZNucv GObD6/yAJ3bcCUj2xcIYVxNYBxYHqjxLQFSJtf7h2Vxf1TApqJMDyjFN+WYvOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QBjQ742Mxz10md; Thu, 4 May 2023 05:42: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 3445gdA9080191; Thu, 4 May 2023 05:42:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3445gdGU080190; Thu, 4 May 2023 05:42:39 GMT (envelope-from git) Date: Thu, 4 May 2023 05:42:39 GMT Message-Id: <202305040542.3445gdGU080190@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: f7398d2d0ab6 - stable/13 - logger(1): MFC: fix timestamps in case of long run List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f7398d2d0ab6b22d88296f7daff48ed3fe74aa56 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=f7398d2d0ab6b22d88296f7daff48ed3fe74aa56 commit f7398d2d0ab6b22d88296f7daff48ed3fe74aa56 Author: Eugene Grosbein AuthorDate: 2023-04-27 16:43:16 +0000 Commit: Eugene Grosbein CommitDate: 2023-05-04 05:41:55 +0000 logger(1): MFC: fix timestamps in case of long run An example: ( echo test; sleep 2; echo test2 ) | logger -h /var/run/log Before fix, logger assigned same timestamp to both records. Fixes: 65547fb33db901a9f352aacb0ed45ce68b0bd275 Reported by: Vadim Goncharov (cherry picked from commit 83fd35b3f3fa580d2b99874abd1f67ee61dcb659) --- usr.bin/logger/logger.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/usr.bin/logger/logger.c b/usr.bin/logger/logger.c index 1ce8d81db6f6..32fda60717d6 100644 --- a/usr.bin/logger/logger.c +++ b/usr.bin/logger/logger.c @@ -198,22 +198,23 @@ main(int argc, char *argv[]) if (host == NULL) cap_openlog(capsyslog, tag, logflags, 0); - (void )time(&now); - (void )ctime_r(&now, tbuf); - tbuf[19] = '\0'; - timestamp = tbuf + 4; - if (hostname == NULL) { hostname = hbuf; (void )gethostname(hbuf, MAXHOSTNAMELEN); *strchrnul(hostname, '.') = '\0'; } + timestamp = tbuf + 4; + /* log input line if appropriate */ if (argc > 0) { char *p, *endp; size_t len; + (void )time(&now); + (void )ctime_r(&now, tbuf); + tbuf[19] = '\0'; + for (p = buf, endp = buf + sizeof(buf) - 2; *argv;) { len = strlen(*argv); if (p + len > endp && p > buf) { @@ -235,9 +236,14 @@ main(int argc, char *argv[]) logmessage(pri, timestamp, hostname, tag, socks, nsock, buf); } else - while (fgets(buf, sizeof(buf), stdin) != NULL) + while (fgets(buf, sizeof(buf), stdin) != NULL) { + (void )time(&now); + (void )ctime_r(&now, tbuf); + tbuf[19] = '\0'; + logmessage(pri, timestamp, hostname, tag, socks, nsock, buf); + } exit(0); } From nobody Thu May 4 16:45:03 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QC06R6JQWz49HqX; Thu, 4 May 2023 16:45:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QC06R5bkjz401M; Thu, 4 May 2023 16:45:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683218703; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PI13f4jpq3HveFkhIXkNJtTuOUwQd2vXgxsOrNvPgZg=; b=ZFtLQKj7V6MT9Qpvie+CQL6SXEo7xYmhqPTrZjjK3sLbAsQrmN0avaQQTmQllDrHhEMj4S M251V+qeiUB+g9hIE2NC3CkOwQ28WFMRDBNberYXNdU1oMMLL4rscyss0o9kPTqaNJlx6j K9dh6C7QOjKgtN/e5ybbPs/CWfaLhZi6iSSJo1o8DpjcDtOewJ/vj2Oa8RByvs16KBPVGM QIhmR/GxZaRDIFzjuTjctzqphP5oBtLRZ2bqu2R+JsSOFjsj93lrjqn0hjcf1Njk9TIixO A3IDLnuzPxsnK3EKHoeHwBIQN3ZXgMuxXRog+laM+Uh2G7SRALiwq3Fj2STpgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683218703; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PI13f4jpq3HveFkhIXkNJtTuOUwQd2vXgxsOrNvPgZg=; b=r5j/VDRb3SaEeL+YgGsSbv8JF1bBxU4AOkQesEQ+fkpwJQ3PoJ/FB68cEmy84W0wx7rJ2X 9MBI2VeHMvLg9coRzZrC4AaODZ7ua1xVRdTEi/gQQKuocIv7xNICY7fsUEhDHmJqBTwl1d tzJCzJ5/ZyvltNneVKvaqS1cSkdAnCosUm+eLJie+g03EZrq5WWuMG153UXMwDXwk6BhAr kKzEzmTYM1Q44l2OHSzAugACJn5wCZd2KG0jKAZVvBQ47ZuYzLwZUT8L1J1Rag9vpYRmUv u82yfOKjv0XGwsSPvNDtUZB+onZLce1J0Ihs4KaH4OrNzAxwNSQ0a3/lz32SQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683218703; a=rsa-sha256; cv=none; b=CS9oCeNwam0onRQA6EV7j66s+ZPCArfAknFGOGBYuRjcCHEJoRWTw4P9AaZ9EuYCtwSgCx lsRNWBaq316Ifrf0RZ4Yo5ZLk2iULAKEEcLyep9fzFKDtBrCvLqepT10D/cqTQUJLbirAa Vm9yi3BnMLv8wFWeb5jaPQdta4J9ms7xFHyXnbyn3C0UbrdLvBu9PuPnnScUpKQ0ldfe4m uOeCNTmBXD/c/IppCQXtmODdIB6YoNPoxlMtQzXCOc46ziFwvA0SlFMDCDexlcLN6AG7rA /D9HRsupIt0j1dkvtkEEq/1U/bbm6epchQ5Sd1VXSPzivZf+6iBU5HU9PNiixg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QC06R4gLXzKR4; Thu, 4 May 2023 16:45:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 344Gj32l067955; Thu, 4 May 2023 16:45:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 344Gj3sT067954; Thu, 4 May 2023 16:45:03 GMT (envelope-from git) Date: Thu, 4 May 2023 16:45:03 GMT Message-Id: <202305041645.344Gj3sT067954@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 63c903e874da - stable/13 - Cirrus-CI: set PKG_FORMAT via top level `env:` List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 63c903e874da4d8d4a81cba9d7bdfecfe0169598 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=63c903e874da4d8d4a81cba9d7bdfecfe0169598 commit 63c903e874da4d8d4a81cba9d7bdfecfe0169598 Author: Ed Maste AuthorDate: 2023-05-01 16:45:36 +0000 Commit: Ed Maste CommitDate: 2023-05-04 13:16:24 +0000 Cirrus-CI: set PKG_FORMAT via top level `env:` This ensures consistency among different CI scripts, including future ones for pkgbase work. Sponsored by: The FreeBSD Foundation (cherry picked from commit 75baf3765c686547e8e4a5510858f45c23ccdec3) --- .cirrus.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 88d232403ed1..81f049d7db46 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -12,6 +12,7 @@ compute_engine_instance: env: CIRRUS_CLONE_DEPTH: 1 + PKG_FORMAT: tar task: matrix: @@ -46,7 +47,7 @@ task: script: - su user -c "make -j$(sysctl -n hw.ncpu) CROSS_TOOLCHAIN=${TOOLCHAIN_PKG} WITHOUT_TOOLCHAIN=yes buildworld buildkernel" package_script: - - su user -c "make CROSS_TOOLCHAIN=${TOOLCHAIN_PKG} WITHOUT_TOOLCHAIN=yes PKG_FORMAT=tar packages" + - su user -c "make CROSS_TOOLCHAIN=${TOOLCHAIN_PKG} WITHOUT_TOOLCHAIN=yes packages" package_check_script: - su user -c "/usr/libexec/flua tools/pkgbase/metalog_reader.lua -c /usr/obj/$(pwd -P)/${TARGET}.${TARGET_ARCH}/worldstage/METALOG" test_script: From nobody Thu May 4 16:45:59 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QC07W6SPPz49J7d; Thu, 4 May 2023 16:45: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 4QC07W5yMmz40bx; Thu, 4 May 2023 16:45:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683218759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P8cpJRK877nYthR9T7MLx84l3/jFWtQbTTWBr+R8Vx0=; b=u7mINTVd9qI0R9QKq4gVoFK5aXgDwIa5suxjIbOQPSXtUpeaVdXX/84llR+L5SP4klTNEh 98BIqvyckuxCbxiimKyobxtIlcMuayE6rVrNyEPbIzfkLIEi9FHbfvYc1y6VGn29gO5Fio sP9unMh8VFW5Kxcxqkvdazf0SPijrz/kYqRjv1VV4IYVaaXAKqnSLFUxt76SXp+Y41qrJY +4AZlQYr8XZ0cA9I3BDA2TLGpk1vDvppY0ww5DQj0MCVAIRJO/jVlH8UZ0LRKLpUilBW05 KoN5I6nu3J91N6V1dBZ/LAlbz5gdgldq2uixHQ99JVyL7Ei2F+tLrAVn4yIT6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683218759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P8cpJRK877nYthR9T7MLx84l3/jFWtQbTTWBr+R8Vx0=; b=YKvvRtTa7GoZrhZp6PGO47KmD67Xl+dOPvbKCEE0WZ1NBQElEpYW7gukgvOSbSTyx1PR+j 1gv2ybAb39KhEYn1L11A0yUlY0V/prmJumj8uBIvP835lHzKhEa2mDARgl7L9WRTAb15RC 1tF/kpF9X/Xob1PPzoOOdvVycgroKgH1W+5fdzObKzMaKO41Kq6g3vhSPbzNhF3Ukm1FcK cOzK825BzsR5YfdjAmsDP6vQJ5nEvmb7mV9P33DCYaXPtJWnceQpiEj1lHdTsxCHjQqNhY wkiFPUN2o1OT+W0kix6wHLequKKuW4DUKHs1ImUvPXCWZ5FU1rHuc0j2HrNZPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683218759; a=rsa-sha256; cv=none; b=MqjbIwMT0bw/apkJJMDcqNgZSKQ5jZAT01yu/afV9aH/3x1+IldohwpKCkATlPF16xkjw3 yLUGy/uam6ipj1yC8ukh04rrjPfWQI31qnwABwv77fMIKsPbzePYqOZC+55Nkh91KGVzgO FI5Xav3Fj5C5ykH8MJqb+N+4RySqHK8hdCLfe8RatiiqpY8i5HgqCgKnz3cRnxffmvFwvk 7HS4a4Xt/R19XTrs/YR6KBsPSwYwFLpdNRaZLZlPjSvcLU9jIr+yOsD5jzyxCh9RT+sT2k 6LAHPT2VMRgwqbbul6OTXcD9VsMbSGTlZ4TAD3pahWyXQAKf4UXq/cpFBDAqQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QC07W51ZCzJrH; Thu, 4 May 2023 16:45:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 344GjxOF068192; Thu, 4 May 2023 16:45:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 344GjxNW068191; Thu, 4 May 2023 16:45:59 GMT (envelope-from git) Date: Thu, 4 May 2023 16:45:59 GMT Message-Id: <202305041645.344GjxNW068191@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: f6488428308e - stable/13 - pkgbase: hide duplicate METALOG directory warnings under verbose List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: f6488428308edeb1fb8fc8aa0eb4e2744db78748 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f6488428308edeb1fb8fc8aa0eb4e2744db78748 commit f6488428308edeb1fb8fc8aa0eb4e2744db78748 Author: Ed Maste AuthorDate: 2023-05-01 17:25:18 +0000 Commit: Ed Maste CommitDate: 2023-05-04 16:45:50 +0000 pkgbase: hide duplicate METALOG directory warnings under verbose Creating directories multiple times is an inherent side effect of the way installation is done. Hide warnings from duplicate directory entries (with identical metadata) under metalog_reader's verbose mode. Duplicate file entries are always reported. They currently generate warnings but will be switched to errors once the few instances currently in the tree are fixed. PR: 244596, 271178 Reviewed by: kevans Sponsored By: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39898 (cherry picked from commit 2a3bd0870869819354b5ea65761d13e5e2987697) --- tools/pkgbase/metalog_reader.lua | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tools/pkgbase/metalog_reader.lua b/tools/pkgbase/metalog_reader.lua index 3e8cf8461914..9cc5fd727923 100644 --- a/tools/pkgbase/metalog_reader.lua +++ b/tools/pkgbase/metalog_reader.lua @@ -392,12 +392,18 @@ function Analysis_session(metalog, verbose, w_notagdirs) if #rows == 1 then goto continue end local iseq, offby = metalogrows_all_equal(rows) if iseq then -- repeated line, just a warning - warn[#warn+1] = 'warning: '..filename - .. ' ' .. rows[1].attrs.type - ..' repeated with same meta: line ' - ..table.concat( - table_map(rows, function(e) return e.linenum end), ',') - warn[#warn+1] = '\n' + local dupmsg = filename .. ' ' .. + rows[1].attrs.type .. + ' repeated with same meta: line ' .. + table.concat(table_map(rows, function(e) return e.linenum end), ',') + if rows[1].attrs.type == "dir" then + if verbose then + warn[#warn+1] = 'warning: ' .. dupmsg .. '\n' + end + else + -- XXX downgrade to warning until instances in the tree are fixed (PR271178) + warn[#warn+1] = 'error: ' .. dupmsg .. '\n' + end elseif not metalogrows_all_equal(rows, false, true) then -- same filename (possibly different tags), different metadata, an error errs[#errs+1] = 'error: '..filename From nobody Fri May 5 00:30:01 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QCBQx2vvLz4B1Bx; Fri, 5 May 2023 00:30: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 4QCBQx2QrKz4CHp; Fri, 5 May 2023 00:30:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683246601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AWDhRwAvzbLOH5/G7sKwE9TsbBKxDAULhwEkojiSD0w=; b=HFSR2S3OZi0eEGblISizuV/URx2MYiQPOREkM4UuLwUQ19MJ2zZRRYNQXTZjP/DYzV1ozv edgPa/7IMdk4gObyRy4K7XCPXYxdzDHpXCb7b+zsDuFRa3WqsQhy09PtfXuLGCf5Y26UrY hmFEpkOkwVz/YC/h2IxnBB6a9fC4ZvUKutjYuk7+DfVOADen4PT2cGlN7+WpNVWZoK/qx0 Zx8/Sz9oxSvWamyqU+8fcXDCpcl3s/UkAAK85vt1FHiNirY0nxEyUw8eXKEXDp4uD8DM6/ V9FUV1mKYwRZvxsTIz0bq9uesb9iQuPfCKYLdd2qarFU+xxop0KzhsnNWFIkuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683246601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AWDhRwAvzbLOH5/G7sKwE9TsbBKxDAULhwEkojiSD0w=; b=rKYyNFIOhJhRAzcVQhkBszc1LS3WSYOWkJ7fJoNAO5Z2Ov4Byo3oTJFW2pVFUPPZSCQGAU fEv/ycRvDIkOD7OK2nogqk/mQ9jqFRwzPhGoQZhHJ9CBg38e5lTsk7wPPV0886W9FWUgZX C9438LWwnKr8Omp8vE92yf2oV8JrS0XriexTg5LzQSMrVEZZcqjtr29tPoVXa3+EriA8o/ 7MO44nvJvIau9CfP35Lehcyml5gPpM/Kk8L4OnNMxWIsOL6vogRkPNQk/qci0WU7sIVodl xh2dMlpE44GJCfWxQsf7XAjPryLtaQp+PTfaU1hMMVukrB7KYhkhd4BQUC9T2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683246601; a=rsa-sha256; cv=none; b=f+EBfq8wceDlYrz/37+0BBmgqKt+YyHRS2T5lmTaolZXyD+9UjERHTE5WkUPTTWAZTIKwk TYp+a/gIdjRQlSIWQzL2cZ1w1sqBPhy6D2KxY8aKFtIo9j1qnH10bfToyBu52MWTeLfcZx bOIjtI4t8ku/BecJu90q6jn6HlfQipwTZBGOOwInRVkNaQg7D6TVqDlkkqq2Ucc+/R8/Id 0EQs7XREEobYNW0dvaxcan1OXBnGnjOx0yVi9y0Z06cAseR8sUGkymAeSLeuHzUnQCVox9 BrmaYkVIz/bhWsBdtWF3mt0TPJyoblxlJ+InfcWP5wXLHtNlKSEAbcw+kGFXHw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QCBQx1X7PzYT9; Fri, 5 May 2023 00:30: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 3450U14k030246; Fri, 5 May 2023 00:30:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3450U12R030243; Fri, 5 May 2023 00:30:01 GMT (envelope-from git) Date: Fri, 5 May 2023 00:30:01 GMT Message-Id: <202305050030.3450U12R030243@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ravi Pokala Subject: git: 861fdb46300b - stable/13 - jedec_dimm(4): Add manufacturing year and week. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rpokala X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 861fdb46300bd16808ca443ecc222f10db02d53d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rpokala: URL: https://cgit.FreeBSD.org/src/commit/?id=861fdb46300bd16808ca443ecc222f10db02d53d commit 861fdb46300bd16808ca443ecc222f10db02d53d Author: Ravi Pokala AuthorDate: 2023-04-25 06:07:39 +0000 Commit: Ravi Pokala CommitDate: 2023-05-05 00:27:55 +0000 jedec_dimm(4): Add manufacturing year and week. DDR3 and DDR4 encode the week and year that the DIMM was manufactured, as a pair of two-digit binary-coded decimal values. Read the values, and report them as (uint8_t)s. Reviewed by: imp, jhb MFC after: 1 week Sponsored by: Panasas Differential Revision: https://reviews.freebsd.org/D39795 (cherry picked from commit de57e0ef5a15c75231191e643d4d1949ddbca92d) --- share/man/man4/jedec_dimm.4 | 10 ++- sys/dev/jedec_dimm/jedec_dimm.c | 131 +++++++++++++++++++++++++++++++++++++++- sys/dev/jedec_dimm/jedec_dimm.h | 6 +- 3 files changed, 144 insertions(+), 3 deletions(-) diff --git a/share/man/man4/jedec_dimm.4 b/share/man/man4/jedec_dimm.4 index ea4183fafc1a..6c13da1a450e 100644 --- a/share/man/man4/jedec_dimm.4 +++ b/share/man/man4/jedec_dimm.4 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 31, 2018 +.Dd April 25, 2023 .Dt JEDEC_DIMM 4 .Os .Sh NAME @@ -76,6 +76,10 @@ interface; all values are read-only: a string description of the DIMM, including TSOD and slotid info if present. .It Va dev.jedec_dimm.X.capacity the DIMM's memory capacity, in megabytes +.It Va dev.jedec_dimm.X.mfg_week +the week within the year in which the DIMM was manufactured +.It Va dev.jedec_dimm.X.mfg_year +the year in which the DIMM was manufactured .It Va dev.jedec_dimm.X.part the manufacturer's part number of the DIMM .It Va dev.jedec_dimm.X.serial @@ -144,6 +148,8 @@ dev.jedec_dimm.0.%location: addr=0xa0 dev.jedec_dimm.0.%parent: smbus0 dev.jedec_dimm.0.%pnpinfo: dev.jedec_dimm.0.capacity: 16384 +dev.jedec_dimm.0.mfg_week: 30 +dev.jedec_dimm.0.mfg_year: 17 dev.jedec_dimm.0.part: 36ASF2G72PZ-2G1A2 dev.jedec_dimm.0.serial: 0ea815de dev.jedec_dimm.0.slotid: A1 @@ -156,6 +162,8 @@ dev.jedec_dimm.6.%location: addr=0xa8 dev.jedec_dimm.6.%parent: smbus1 dev.jedec_dimm.6.%pnpinfo: dev.jedec_dimm.6.capacity: 8192 +dev.jedec_dimm.6.mfg_week: 13 +dev.jedec_dimm.6.mfg_year: 19 dev.jedec_dimm.6.part: VRA9MR8B2H1603 dev.jedec_dimm.6.serial: 0c4c46ad dev.jedec_dimm.6.temp: 43.1C diff --git a/sys/dev/jedec_dimm/jedec_dimm.c b/sys/dev/jedec_dimm/jedec_dimm.c index 884da8b51061..73ea10c5c5e1 100644 --- a/sys/dev/jedec_dimm/jedec_dimm.c +++ b/sys/dev/jedec_dimm/jedec_dimm.c @@ -4,7 +4,7 @@ * Authors: Ravi Pokala (rpokala@freebsd.org), Andriy Gapon (avg@FreeBSD.org) * * Copyright (c) 2016 Andriy Gapon - * Copyright (c) 2018 Panasas + * Copyright (c) 2018-2023 Panasas * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -56,6 +56,8 @@ struct jedec_dimm_softc { device_t smbus; uint8_t spd_addr; /* SMBus address of the SPD EEPROM. */ uint8_t tsod_addr; /* Address of the Thermal Sensor On DIMM */ + uint8_t mfg_year; + uint8_t mfg_week; uint32_t capacity_mb; char type_str[5]; char part_str[21]; /* 18 (DDR3) or 20 (DDR4) chars, plus terminator */ @@ -154,6 +156,9 @@ static int jedec_dimm_dump(struct jedec_dimm_softc *sc, enum dram_type type); static int jedec_dimm_field_to_str(struct jedec_dimm_softc *sc, char *dst, size_t dstsz, uint16_t offset, uint16_t len, bool ascii); +static int jedec_dimm_mfg_date(struct jedec_dimm_softc *sc, enum dram_type type, + uint8_t *year, uint8_t *week); + static int jedec_dimm_probe(device_t dev); static int jedec_dimm_readw_be(struct jedec_dimm_softc *sc, uint8_t reg, @@ -257,6 +262,11 @@ jedec_dimm_attach(device_t dev) goto out; } + rc = jedec_dimm_mfg_date(sc, type, &sc->mfg_year, &sc->mfg_week); + if (rc != 0) { + goto out; + } + rc = jedec_dimm_field_to_str(sc, sc->part_str, sizeof(sc->part_str), partnum_offset, partnum_len, true); if (rc != 0) { @@ -336,6 +346,14 @@ no_tsod: CTLFLAG_RD | CTLFLAG_MPSAFE, sc->serial_str, 0, "DIMM Serial Number"); + SYSCTL_ADD_U8(ctx, children, OID_AUTO, "mfg_year", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, sc->mfg_year, + "DIMM manufacturing year (20xx)"); + + SYSCTL_ADD_U8(ctx, children, OID_AUTO, "mfg_week", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, sc->mfg_week, + "DIMM manufacturing week"); + /* Create the temperature sysctl IFF the TSOD is present and valid */ if (tsod_present && (tsod_match != NULL)) { SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "temp", @@ -822,6 +840,117 @@ out: return (rc); } +/** + * Both DDR3 and DDR4 encode manufacturing date as a one-byte BCD-encoded + * year (offset from 2000) and a one-byte BCD-encoded week within that year. + * The SPD offsets are different between the two types. + * + * @author rpokala + * + * @param[in] sc + * Instance-specific context data + * + * @param[in] dram_type + * The locations of the manufacturing date depends on the type of the DIMM. + * + * @param[out] year + * The manufacturing year, offset from 2000 + * + * @param[out] week + * The manufacturing week within the year + */ +static int +jedec_dimm_mfg_date(struct jedec_dimm_softc *sc, enum dram_type type, + uint8_t *year, uint8_t *week) +{ + uint8_t year_bcd; + uint8_t week_bcd; + uint16_t year_offset; + uint16_t week_offset; + bool page_changed; + int rc; + + switch (type) { + case DRAM_TYPE_DDR3_SDRAM: + year_offset = SPD_OFFSET_DDR3_MOD_MFG_YEAR; + week_offset = SPD_OFFSET_DDR3_MOD_MFG_WEEK; + break; + case DRAM_TYPE_DDR4_SDRAM: + year_offset = SPD_OFFSET_DDR4_MOD_MFG_YEAR; + week_offset = SPD_OFFSET_DDR4_MOD_MFG_WEEK; + break; + default: + device_printf(sc->dev, "unsupported dram_type 0x%02x\n", type); + rc = EINVAL; + page_changed = false; + goto out; + } + + /* Change to the proper page. Offsets [0, 255] are in page0; offsets + * [256, 512] are in page1. + * + * *The page must be reset to page0 before returning.* + * + * For the page-change operation, only the DTI and LSA matter; the + * offset and write-value are ignored, so use just 0. + * + * Mercifully, JEDEC defined the fields such that all of the + * manufacturing-related ones are on the same page, so we don't need to + * worry about that complication. + */ + if (year_offset < JEDEC_SPD_PAGE_SIZE) { + page_changed = false; + } else if (year_offset < (2 * JEDEC_SPD_PAGE_SIZE)) { + page_changed = true; + rc = smbus_writeb(sc->smbus, + (JEDEC_DTI_PAGE | JEDEC_LSA_PAGE_SET1), 0, 0); + if (rc != 0) { + device_printf(sc->dev, + "unable to change page for offset 0x%04x: %d\n", + year_offset, rc); + } + /* Adjust the offset to account for the page change. */ + year_offset -= JEDEC_SPD_PAGE_SIZE; + week_offset -= JEDEC_SPD_PAGE_SIZE; + } else { + device_printf(sc->dev, "invalid offset 0x%04x\n", year_offset); + rc = EINVAL; + page_changed = false; + goto out; + } + + rc = smbus_readb(sc->smbus, sc->spd_addr, year_offset, &year_bcd); + if (rc != 0) { + device_printf(sc->dev, "failed to read mfg year: %d\n", rc); + goto out; + } + + rc = smbus_readb(sc->smbus, sc->spd_addr, week_offset, &week_bcd); + if (rc != 0) { + device_printf(sc->dev, "failed to read mfg week: %d\n", rc); + goto out; + } + + /* Convert from one-byte BCD to one-byte integer. */ + *year = (((year_bcd & 0xf0) >> 4) * 10) + (year_bcd & 0x0f); + *week = (((week_bcd & 0xf0) >> 4) * 10) + (week_bcd & 0x0f); + +out: + if (page_changed) { + int rc2; + /* Switch back to page0 before returning. */ + rc2 = smbus_writeb(sc->smbus, + (JEDEC_DTI_PAGE | JEDEC_LSA_PAGE_SET0), 0, 0); + if (rc2 != 0) { + device_printf(sc->dev, + "unable to restore page for offset 0x%04x: %d\n", + year_offset, rc2); + } + } + + return (rc); +} + /** * device_probe() method. Validate the address that was given as a hint, and * display an error if it's bogus. Make sure that we're dealing with one of the diff --git a/sys/dev/jedec_dimm/jedec_dimm.h b/sys/dev/jedec_dimm/jedec_dimm.h index 3b330251efc5..00a9b3d521b6 100644 --- a/sys/dev/jedec_dimm/jedec_dimm.h +++ b/sys/dev/jedec_dimm/jedec_dimm.h @@ -3,7 +3,7 @@ * * Authors: Ravi Pokala (rpokala@freebsd.org) * - * Copyright (c) 2018 Panasas + * Copyright (c) 2018-2023 Panasas * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -90,6 +90,8 @@ #define SPD_OFFSET_DDR3_SDRAM_WIDTH 7 #define SPD_OFFSET_DDR3_BUS_WIDTH 8 #define SPD_OFFSET_DDR3_TSOD_PRESENT 32 +#define SPD_OFFSET_DDR3_MOD_MFG_YEAR 120 +#define SPD_OFFSET_DDR3_MOD_MFG_WEEK 121 #define SPD_OFFSET_DDR3_SERIAL 122 #define SPD_LEN_DDR3_SERIAL 4 #define SPD_OFFSET_DDR3_PARTNUM 128 @@ -100,6 +102,8 @@ #define SPD_OFFSET_DDR4_SDRAM_WIDTH 12 #define SPD_OFFSET_DDR4_BUS_WIDTH 13 #define SPD_OFFSET_DDR4_TSOD_PRESENT 14 +#define SPD_OFFSET_DDR4_MOD_MFG_YEAR 323 +#define SPD_OFFSET_DDR4_MOD_MFG_WEEK 324 #define SPD_OFFSET_DDR4_SERIAL 325 #define SPD_LEN_DDR4_SERIAL 4 #define SPD_OFFSET_DDR4_PARTNUM 329 From nobody Fri May 5 00:30:02 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QCBQy3XjYz4B1Mv; Fri, 5 May 2023 00:30: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 4QCBQy2xS3z4BsT; Fri, 5 May 2023 00:30:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683246602; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LUWeaDKLoYewqPMhuI4IWCuraONZtaY8nzSu6V9/57k=; b=do7ZpI/TGU2g7cSp3ipUSeMSTyqVFKNEwYbPgVlvq1y7leVwuxm5bQ6mRATXFr2MfJiM7F V1VPwmU9nfX1Fvdu70HSvVlLT72z5XuLgekJQUCd1SYxgHGCGnvBiRDEpyHY03PdP3Y79B /ycsAGGaXUE+FqxfQKjz6Jj5QnvWOAVourj0/fa/PS4J13g2Dp+YX0CMfp+Pr96jT893L4 jF73NrmHhFum3wd1yBu6Y3Y4+Oo+/vlG1e19IWQkQsgGFtDWbUMZ75fG0tjYsClOukwy5B ciozloimTXl5L/KJ+ono/eduEIRjgdhQ7QK1hTrSlsDAaU/rT1m83txqdGH7Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683246602; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LUWeaDKLoYewqPMhuI4IWCuraONZtaY8nzSu6V9/57k=; b=hVFQZtlw4W+OUGYW0++NxxyJZwdDTjuHCcMw/Oz+mZ3Np6JEl1N2YB3B9HdDb/sUfTV50I Eo1g7x82xdG25NRtVnWi7yyASQB2PCwHk3HrMrnazPHBtF9ep4tw90liP1TG5ujhPNqlE/ qI3A4qrXbQN+Hne0niPPzYF1ptk6/lAQzNCvshVF5knQdwbpCx6xbZs/x+ikQgpG5eLFwD smUrl2Lhv5IUHY0f0o4fKYTpJI/zfXucTumW6JFvMfCluRQ5gxGhe53QL+plJYbmr3MTUA IreqyQdaMxE7gFyHG5481qr/MInpJ0XzRwwXI/754jaAx2bNoj1X0wwpb/5kqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683246602; a=rsa-sha256; cv=none; b=Ek1gOmhh8bWjJg2yopaMutEu7VDQHg/yZamYdDeehlqlZbfbhq0Bq0TtYpfLPH9fvTxjSY Dk54Y+zxEdJGF9TL/Fv2UJ/SPCxsTtoOQDvIX7+MCGmFhWfWLKVRm2pyHdzDi1CPPBN5cx GJLaZ2W+Km4nCBFOtj4Ychk/qXB4RnjsHWMovCdO29sFnCACQsNvEtqxggEaunDpBs3sxU doskkHMJryUhyf3/EkpBM0VTtXnOhf55UB3U3qyZLmIetgate1ieBHYgRYOByltvqrYlRS NpxiyTU7f3T4yCyZ7M9BasZLDZoVAu1hpLAhtdZbmCRoL7b6QGEPgU0GUujlmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QCBQy21KgzYTB; Fri, 5 May 2023 00:30: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 3450U2lk030501; Fri, 5 May 2023 00:30:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3450U2XO030498; Fri, 5 May 2023 00:30:02 GMT (envelope-from git) Date: Fri, 5 May 2023 00:30:02 GMT Message-Id: <202305050030.3450U2XO030498@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ravi Pokala Subject: git: fa63175685bf - stable/13 - jedec_dimm(4): Refactor offset adjustment and page0 reset List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rpokala X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fa63175685bf81e6b6ec2b1a6db95f8c57449939 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rpokala: URL: https://cgit.FreeBSD.org/src/commit/?id=fa63175685bf81e6b6ec2b1a6db95f8c57449939 commit fa63175685bf81e6b6ec2b1a6db95f8c57449939 Author: Ravi Pokala AuthorDate: 2023-04-27 05:03:48 +0000 Commit: Ravi Pokala CommitDate: 2023-05-05 00:28:18 +0000 jedec_dimm(4): Refactor offset adjustment and page0 reset Offsets greater than 255 bytes reside on page1 of the SPD device. Accessing them requires switching to page1, and adjusting the absolute offset to be relative to the start of page1. After the access, the page must be set back to page0. These operations are performed in several places, so break them out into their own functions. Also, replace a pair of default cases, which should be impossible due to earlier checks, with __assert_unreachable(). Reviewed by: imp MFC after: 1 week Sponsored by: Panasas Differential Revision: https://reviews.freebsd.org/D39842 (cherry picked from commit 15d69c840d860a8c0decb063f768ad695427a0d4) --- sys/dev/jedec_dimm/jedec_dimm.c | 176 +++++++++++++++++++++++++++------------- 1 file changed, 121 insertions(+), 55 deletions(-) diff --git a/sys/dev/jedec_dimm/jedec_dimm.c b/sys/dev/jedec_dimm/jedec_dimm.c index 73ea10c5c5e1..240fbe230d9f 100644 --- a/sys/dev/jedec_dimm/jedec_dimm.c +++ b/sys/dev/jedec_dimm/jedec_dimm.c @@ -144,6 +144,9 @@ const struct jedec_dimm_tsod_dev { { 0x104a, 0x03, "ST Microelectronics TSOD" }, }; +static int jedec_dimm_adjust_offset(struct jedec_dimm_softc *sc, + uint16_t orig_offset, uint16_t *new_offset, bool *page_changed); + static int jedec_dimm_attach(device_t dev); static int jedec_dimm_capacity(struct jedec_dimm_softc *sc, enum dram_type type, @@ -164,11 +167,81 @@ static int jedec_dimm_probe(device_t dev); static int jedec_dimm_readw_be(struct jedec_dimm_softc *sc, uint8_t reg, uint16_t *val); +static int jedec_dimm_reset_page0(struct jedec_dimm_softc *sc); + static int jedec_dimm_temp_sysctl(SYSCTL_HANDLER_ARGS); static const char *jedec_dimm_tsod_match(uint16_t vid, uint16_t did); +/** + * The DDR4 SPD information is spread across two 256-byte pages, but the + * offsets in the spec are absolute, not per-page. If a given offset is on the + * second page, we need to change to that page and adjust the offset to be + * relative to that page. + * + * @author rpokala + * + * @param[in] sc + * Instance-specific context data + * + * @param[in] orig_offset + * The original value of the offset, before any adjustment is made. + * + * @param[out] new_offset + * The offset to actually read from, adjusted if needed. + * + * @param[out] page_changed + * Whether or not the page was actually changed, and the offset adjusted. + * *If 'true', caller must call reset_page0() before itself returning.* + */ +static int +jedec_dimm_adjust_offset(struct jedec_dimm_softc *sc, uint16_t orig_offset, + uint16_t *new_offset, bool *page_changed) +{ + int rc; + + /* Don't change the offset, or indicate that the page has been changed, + * until the page has actually been changed. + */ + *new_offset = orig_offset; + *page_changed = false; + + /* Change to the proper page. Offsets [0, 255] are in page0; offsets + * [256, 511] are in page1. + */ + if (orig_offset < JEDEC_SPD_PAGE_SIZE) { + /* Within page0; no adjustment or page-change required. */ + rc = 0; + goto out; + } else if (orig_offset >= (2 * JEDEC_SPD_PAGE_SIZE)) { + /* Outside of expected range. */ + rc = EINVAL; + device_printf(sc->dev, "invalid offset 0x%04x\n", orig_offset); + goto out; + } + + /* 'orig_offset' is in page1. Switch to that page, and adjust + * 'new_offset' accordingly if successful. + * + * For the page-change operation, only the DTI and LSA matter; the + * offset and write-value are ignored, so just use 0. + */ + rc = smbus_writeb(sc->smbus, (JEDEC_DTI_PAGE | JEDEC_LSA_PAGE_SET1), + 0, 0); + if (rc != 0) { + device_printf(sc->dev, + "unable to change page for offset 0x%04x: %d\n", + orig_offset, rc); + goto out; + } + *page_changed = true; + *new_offset = orig_offset - JEDEC_SPD_PAGE_SIZE; + +out: + return (rc); +} + /** * device_attach() method. Read the DRAM type, use that to determine the offsets * and lengths of the asset string fields. Calculate the capacity. If a TSOD is @@ -458,9 +531,7 @@ jedec_dimm_capacity(struct jedec_dimm_softc *sc, enum dram_type type, sdram_width_offset = SPD_OFFSET_DDR4_SDRAM_WIDTH; break; default: - device_printf(sc->dev, "unsupported dram_type 0x%02x\n", type); - rc = EINVAL; - goto out; + __assert_unreachable(); } rc = smbus_readb(sc->smbus, sc->spd_addr, bus_width_offset, @@ -673,14 +744,13 @@ jedec_dimm_dump(struct jedec_dimm_softc *sc, enum dram_type type) out: if (page_changed) { int rc2; - /* Switch back to page0 before returning. */ - rc2 = smbus_writeb(sc->smbus, - (JEDEC_DTI_PAGE | JEDEC_LSA_PAGE_SET0), 0, 0); - if (rc2 != 0) { - device_printf(sc->dev, "unable to restore page: %d\n", - rc2); + + rc2 = jedec_dimm_reset_page0(sc); + if ((rc2 != 0) && (rc == 0)) { + rc = rc2; } } + return (rc); } @@ -715,54 +785,29 @@ jedec_dimm_field_to_str(struct jedec_dimm_softc *sc, char *dst, size_t dstsz, uint16_t offset, uint16_t len, bool ascii) { uint8_t byte; + uint16_t new_offset; int i; int rc; bool page_changed; - /* Change to the proper page. Offsets [0, 255] are in page0; offsets - * [256, 512] are in page1. - * - * *The page must be reset to page0 before returning.* - * - * For the page-change operation, only the DTI and LSA matter; the - * offset and write-value are ignored, so use just 0. - * - * Mercifully, JEDEC defined the fields such that none of them cross - * pages, so we don't need to worry about that complication. - */ - if (offset < JEDEC_SPD_PAGE_SIZE) { - page_changed = false; - } else if (offset < (2 * JEDEC_SPD_PAGE_SIZE)) { - page_changed = true; - rc = smbus_writeb(sc->smbus, - (JEDEC_DTI_PAGE | JEDEC_LSA_PAGE_SET1), 0, 0); - if (rc != 0) { - device_printf(sc->dev, - "unable to change page for offset 0x%04x: %d\n", - offset, rc); - } - /* Adjust the offset to account for the page change. */ - offset -= JEDEC_SPD_PAGE_SIZE; - } else { - page_changed = false; - rc = EINVAL; - device_printf(sc->dev, "invalid offset 0x%04x\n", offset); + rc = jedec_dimm_adjust_offset(sc, offset, &new_offset, &page_changed); + if (rc != 0) { goto out; } /* Sanity-check (adjusted) offset and length; everything must be within * the same page. */ - if (offset >= JEDEC_SPD_PAGE_SIZE) { + if (new_offset >= JEDEC_SPD_PAGE_SIZE) { rc = EINVAL; - device_printf(sc->dev, "invalid offset 0x%04x\n", offset); + device_printf(sc->dev, "invalid offset 0x%04x\n", new_offset); goto out; } - if ((offset + len) >= JEDEC_SPD_PAGE_SIZE) { + if ((new_offset + len) >= JEDEC_SPD_PAGE_SIZE) { rc = EINVAL; device_printf(sc->dev, - "(offset + len) would cross page (0x%04x + 0x%04x)\n", - offset, len); + "(new_offset + len) would cross page (0x%04x + 0x%04x)\n", + new_offset, len); goto out; } @@ -793,11 +838,12 @@ jedec_dimm_field_to_str(struct jedec_dimm_softc *sc, char *dst, size_t dstsz, /* Read a byte at a time. */ for (i = 0; i < len; i++) { - rc = smbus_readb(sc->smbus, sc->spd_addr, (offset + i), &byte); + rc = smbus_readb(sc->smbus, sc->spd_addr, (new_offset + i), + &byte); if (rc != 0) { device_printf(sc->dev, "failed to read byte at 0x%02x: %d\n", - (offset + i), rc); + (new_offset + i), rc); goto out; } if (ascii) { @@ -827,13 +873,10 @@ jedec_dimm_field_to_str(struct jedec_dimm_softc *sc, char *dst, size_t dstsz, out: if (page_changed) { int rc2; - /* Switch back to page0 before returning. */ - rc2 = smbus_writeb(sc->smbus, - (JEDEC_DTI_PAGE | JEDEC_LSA_PAGE_SET0), 0, 0); - if (rc2 != 0) { - device_printf(sc->dev, - "unable to restore page for offset 0x%04x: %d\n", - offset, rc2); + + rc2 = jedec_dimm_reset_page0(sc); + if ((rc2 != 0) && (rc == 0)) { + rc = rc2; } } @@ -880,10 +923,7 @@ jedec_dimm_mfg_date(struct jedec_dimm_softc *sc, enum dram_type type, week_offset = SPD_OFFSET_DDR4_MOD_MFG_WEEK; break; default: - device_printf(sc->dev, "unsupported dram_type 0x%02x\n", type); - rc = EINVAL; - page_changed = false; - goto out; + __assert_unreachable(); } /* Change to the proper page. Offsets [0, 255] are in page0; offsets @@ -1041,6 +1081,32 @@ out: return (rc); } +/** + * Reset to the default condition of operating on page0. This must be called + * after a previous operation changed to page1. + * + * @author rpokala + * + * @param[in] sc + * Instance-specific context data + */ +static int +jedec_dimm_reset_page0(struct jedec_dimm_softc *sc) +{ + int rc; + + /* For the page-change operation, only the DTI and LSA matter; the + * offset and write-value are ignored, so just use 0. + */ + rc = smbus_writeb(sc->smbus, (JEDEC_DTI_PAGE | JEDEC_LSA_PAGE_SET0), + 0, 0); + if (rc != 0) { + device_printf(sc->dev, "unable to restore page: %d\n", rc); + } + + return (rc); +} + /** * Read the temperature data from the TSOD and convert it to the deciKelvin * value that the sysctl expects. From nobody Fri May 5 00:30:48 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QCBRr29kMz4B19R; Fri, 5 May 2023 00:30:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QCBRr1grSz4CWg; Fri, 5 May 2023 00:30:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683246648; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H+mdj6JACQVYK6UhVK11DZ+5M7XmriASaN3HbnGLeJc=; b=mQdSOLRaOtslvyVG7/2lluS/ecvzecTABm9aK9VaxR+BRLXNgK+h7oamof+Wxmjq4c8vOZ As7YhZ7VNIzybXdZBGasHdgrFSTEYjMbw9cS7N5JYYGYCxA4MxsGihiiaY7IJX3sMRmvde PwE+tBW54HPmrIXUJn2qBx52LXImamiw/CYxbLReYEHGZ0VTqSpJ5pbLDqAd+tnNXmnsup vuDR2/4ojXDBrReKxPQDYfX77YyI77fqWU4KEY35n3S0MW1DSETl98H19q9hxDshRS6Jyo INc+cPO46sGf1OJ+FaF6vSVpOiO3Q8Z3UXSbgBVK0ip5m55JNNiVw2nYn8c4Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683246648; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H+mdj6JACQVYK6UhVK11DZ+5M7XmriASaN3HbnGLeJc=; b=cHaCnVq72pOJjw3kTbu9wlBR7mQlrR4F+7HZB3iEk0I5HrgKgTwbfZfrPcCbsxur6W+tdh ZBTZM6ZmIRwd3LTSqrbncPxq+Ga9eC3UEl4woAPmK3SQa+tnPmYyZvITd7AuswHQtNEVap +M19q2yHnT5Td//5109QmFMnfdiUuiQB4amKfwS8POZrd7q9m7Nn06V8ubzKBsLoo7ONSf OYWZQh2Z5OEe6TzjkT3IFpKofIjrtsaQF+DxUr8Ix+y4ed5C2vYtx0qfoeG82K9DPP+BTG ig0JnRWzuG9zFkfCRHcNhH5tr3YLW3xE/VkOZf1xOX7hdx36vzkTFbr5hkEN5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683246648; a=rsa-sha256; cv=none; b=SPVfySJikex9TZz7K2GZuj4tQ7KvZBb4K023nQlSvWecAGuRR+TZ/6tla5iMl6dwaGmtT6 DTRJlF3siWlP/e1tmTGWoOBj/BPhBGkfQKDbRDaOzaneUSntH0q3IU7AElHBjKiWLAbLim EKqITluSAELt5C+mtVIlEpw5KhGxr6ugkTX2OnVFiGLSrkKlWj4YIxuEsTD+Lzng318Rf/ DnVyXOC0O4a3ZOFmbldZ9ANrVufIdl05K54MJipM48r77vveh/erFGBmUowPmjjadn7DgO LPsOio4nCTR/wa40N92p7e96Dt0Q/tui8ZAYAv2XEaYVf4WBb9iJ1dD4liM90g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QCBRr0n2SzYPm; Fri, 5 May 2023 00:30:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3450Um8Z038037; Fri, 5 May 2023 00:30:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3450UmK0038036; Fri, 5 May 2023 00:30:48 GMT (envelope-from git) Date: Fri, 5 May 2023 00:30:48 GMT Message-Id: <202305050030.3450UmK0038036@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ravi Pokala Subject: git: a9ee57e46ff0 - stable/12 - jedec_dimm(4): Add manufacturing year and week. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rpokala X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a9ee57e46ff09dbe2bd8b1c8258fb70b71a3d477 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rpokala: URL: https://cgit.FreeBSD.org/src/commit/?id=a9ee57e46ff09dbe2bd8b1c8258fb70b71a3d477 commit a9ee57e46ff09dbe2bd8b1c8258fb70b71a3d477 Author: Ravi Pokala AuthorDate: 2023-04-25 06:07:39 +0000 Commit: Ravi Pokala CommitDate: 2023-05-05 00:30:19 +0000 jedec_dimm(4): Add manufacturing year and week. DDR3 and DDR4 encode the week and year that the DIMM was manufactured, as a pair of two-digit binary-coded decimal values. Read the values, and report them as (uint8_t)s. Reviewed by: imp, jhb MFC after: 1 week Sponsored by: Panasas Differential Revision: https://reviews.freebsd.org/D39795 (cherry picked from commit de57e0ef5a15c75231191e643d4d1949ddbca92d) --- share/man/man4/jedec_dimm.4 | 10 ++- sys/dev/jedec_dimm/jedec_dimm.c | 131 +++++++++++++++++++++++++++++++++++++++- sys/dev/jedec_dimm/jedec_dimm.h | 6 +- 3 files changed, 144 insertions(+), 3 deletions(-) diff --git a/share/man/man4/jedec_dimm.4 b/share/man/man4/jedec_dimm.4 index ea4183fafc1a..6c13da1a450e 100644 --- a/share/man/man4/jedec_dimm.4 +++ b/share/man/man4/jedec_dimm.4 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 31, 2018 +.Dd April 25, 2023 .Dt JEDEC_DIMM 4 .Os .Sh NAME @@ -76,6 +76,10 @@ interface; all values are read-only: a string description of the DIMM, including TSOD and slotid info if present. .It Va dev.jedec_dimm.X.capacity the DIMM's memory capacity, in megabytes +.It Va dev.jedec_dimm.X.mfg_week +the week within the year in which the DIMM was manufactured +.It Va dev.jedec_dimm.X.mfg_year +the year in which the DIMM was manufactured .It Va dev.jedec_dimm.X.part the manufacturer's part number of the DIMM .It Va dev.jedec_dimm.X.serial @@ -144,6 +148,8 @@ dev.jedec_dimm.0.%location: addr=0xa0 dev.jedec_dimm.0.%parent: smbus0 dev.jedec_dimm.0.%pnpinfo: dev.jedec_dimm.0.capacity: 16384 +dev.jedec_dimm.0.mfg_week: 30 +dev.jedec_dimm.0.mfg_year: 17 dev.jedec_dimm.0.part: 36ASF2G72PZ-2G1A2 dev.jedec_dimm.0.serial: 0ea815de dev.jedec_dimm.0.slotid: A1 @@ -156,6 +162,8 @@ dev.jedec_dimm.6.%location: addr=0xa8 dev.jedec_dimm.6.%parent: smbus1 dev.jedec_dimm.6.%pnpinfo: dev.jedec_dimm.6.capacity: 8192 +dev.jedec_dimm.6.mfg_week: 13 +dev.jedec_dimm.6.mfg_year: 19 dev.jedec_dimm.6.part: VRA9MR8B2H1603 dev.jedec_dimm.6.serial: 0c4c46ad dev.jedec_dimm.6.temp: 43.1C diff --git a/sys/dev/jedec_dimm/jedec_dimm.c b/sys/dev/jedec_dimm/jedec_dimm.c index e6d421e32ec7..b10b2a7bc8f5 100644 --- a/sys/dev/jedec_dimm/jedec_dimm.c +++ b/sys/dev/jedec_dimm/jedec_dimm.c @@ -4,7 +4,7 @@ * Authors: Ravi Pokala (rpokala@freebsd.org), Andriy Gapon (avg@FreeBSD.org) * * Copyright (c) 2016 Andriy Gapon - * Copyright (c) 2018 Panasas + * Copyright (c) 2018-2023 Panasas * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -56,6 +56,8 @@ struct jedec_dimm_softc { device_t smbus; uint8_t spd_addr; /* SMBus address of the SPD EEPROM. */ uint8_t tsod_addr; /* Address of the Thermal Sensor On DIMM */ + uint8_t mfg_year; + uint8_t mfg_week; uint32_t capacity_mb; char type_str[5]; char part_str[21]; /* 18 (DDR3) or 20 (DDR4) chars, plus terminator */ @@ -154,6 +156,9 @@ static int jedec_dimm_dump(struct jedec_dimm_softc *sc, enum dram_type type); static int jedec_dimm_field_to_str(struct jedec_dimm_softc *sc, char *dst, size_t dstsz, uint16_t offset, uint16_t len, bool ascii); +static int jedec_dimm_mfg_date(struct jedec_dimm_softc *sc, enum dram_type type, + uint8_t *year, uint8_t *week); + static int jedec_dimm_probe(device_t dev); static int jedec_dimm_readw_be(struct jedec_dimm_softc *sc, uint8_t reg, @@ -257,6 +262,11 @@ jedec_dimm_attach(device_t dev) goto out; } + rc = jedec_dimm_mfg_date(sc, type, &sc->mfg_year, &sc->mfg_week); + if (rc != 0) { + goto out; + } + rc = jedec_dimm_field_to_str(sc, sc->part_str, sizeof(sc->part_str), partnum_offset, partnum_len, true); if (rc != 0) { @@ -336,6 +346,14 @@ no_tsod: CTLFLAG_RD | CTLFLAG_MPSAFE, sc->serial_str, 0, "DIMM Serial Number"); + SYSCTL_ADD_U8(ctx, children, OID_AUTO, "mfg_year", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, sc->mfg_year, + "DIMM manufacturing year (20xx)"); + + SYSCTL_ADD_U8(ctx, children, OID_AUTO, "mfg_week", + CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, sc->mfg_week, + "DIMM manufacturing week"); + /* Create the temperature sysctl IFF the TSOD is present and valid */ if (tsod_present && (tsod_match != NULL)) { SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "temp", @@ -822,6 +840,117 @@ out: return (rc); } +/** + * Both DDR3 and DDR4 encode manufacturing date as a one-byte BCD-encoded + * year (offset from 2000) and a one-byte BCD-encoded week within that year. + * The SPD offsets are different between the two types. + * + * @author rpokala + * + * @param[in] sc + * Instance-specific context data + * + * @param[in] dram_type + * The locations of the manufacturing date depends on the type of the DIMM. + * + * @param[out] year + * The manufacturing year, offset from 2000 + * + * @param[out] week + * The manufacturing week within the year + */ +static int +jedec_dimm_mfg_date(struct jedec_dimm_softc *sc, enum dram_type type, + uint8_t *year, uint8_t *week) +{ + uint8_t year_bcd; + uint8_t week_bcd; + uint16_t year_offset; + uint16_t week_offset; + bool page_changed; + int rc; + + switch (type) { + case DRAM_TYPE_DDR3_SDRAM: + year_offset = SPD_OFFSET_DDR3_MOD_MFG_YEAR; + week_offset = SPD_OFFSET_DDR3_MOD_MFG_WEEK; + break; + case DRAM_TYPE_DDR4_SDRAM: + year_offset = SPD_OFFSET_DDR4_MOD_MFG_YEAR; + week_offset = SPD_OFFSET_DDR4_MOD_MFG_WEEK; + break; + default: + device_printf(sc->dev, "unsupported dram_type 0x%02x\n", type); + rc = EINVAL; + page_changed = false; + goto out; + } + + /* Change to the proper page. Offsets [0, 255] are in page0; offsets + * [256, 512] are in page1. + * + * *The page must be reset to page0 before returning.* + * + * For the page-change operation, only the DTI and LSA matter; the + * offset and write-value are ignored, so use just 0. + * + * Mercifully, JEDEC defined the fields such that all of the + * manufacturing-related ones are on the same page, so we don't need to + * worry about that complication. + */ + if (year_offset < JEDEC_SPD_PAGE_SIZE) { + page_changed = false; + } else if (year_offset < (2 * JEDEC_SPD_PAGE_SIZE)) { + page_changed = true; + rc = smbus_writeb(sc->smbus, + (JEDEC_DTI_PAGE | JEDEC_LSA_PAGE_SET1), 0, 0); + if (rc != 0) { + device_printf(sc->dev, + "unable to change page for offset 0x%04x: %d\n", + year_offset, rc); + } + /* Adjust the offset to account for the page change. */ + year_offset -= JEDEC_SPD_PAGE_SIZE; + week_offset -= JEDEC_SPD_PAGE_SIZE; + } else { + device_printf(sc->dev, "invalid offset 0x%04x\n", year_offset); + rc = EINVAL; + page_changed = false; + goto out; + } + + rc = smbus_readb(sc->smbus, sc->spd_addr, year_offset, &year_bcd); + if (rc != 0) { + device_printf(sc->dev, "failed to read mfg year: %d\n", rc); + goto out; + } + + rc = smbus_readb(sc->smbus, sc->spd_addr, week_offset, &week_bcd); + if (rc != 0) { + device_printf(sc->dev, "failed to read mfg week: %d\n", rc); + goto out; + } + + /* Convert from one-byte BCD to one-byte integer. */ + *year = (((year_bcd & 0xf0) >> 4) * 10) + (year_bcd & 0x0f); + *week = (((week_bcd & 0xf0) >> 4) * 10) + (week_bcd & 0x0f); + +out: + if (page_changed) { + int rc2; + /* Switch back to page0 before returning. */ + rc2 = smbus_writeb(sc->smbus, + (JEDEC_DTI_PAGE | JEDEC_LSA_PAGE_SET0), 0, 0); + if (rc2 != 0) { + device_printf(sc->dev, + "unable to restore page for offset 0x%04x: %d\n", + year_offset, rc2); + } + } + + return (rc); +} + /** * device_probe() method. Validate the address that was given as a hint, and * display an error if it's bogus. Make sure that we're dealing with one of the diff --git a/sys/dev/jedec_dimm/jedec_dimm.h b/sys/dev/jedec_dimm/jedec_dimm.h index 3b330251efc5..00a9b3d521b6 100644 --- a/sys/dev/jedec_dimm/jedec_dimm.h +++ b/sys/dev/jedec_dimm/jedec_dimm.h @@ -3,7 +3,7 @@ * * Authors: Ravi Pokala (rpokala@freebsd.org) * - * Copyright (c) 2018 Panasas + * Copyright (c) 2018-2023 Panasas * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -90,6 +90,8 @@ #define SPD_OFFSET_DDR3_SDRAM_WIDTH 7 #define SPD_OFFSET_DDR3_BUS_WIDTH 8 #define SPD_OFFSET_DDR3_TSOD_PRESENT 32 +#define SPD_OFFSET_DDR3_MOD_MFG_YEAR 120 +#define SPD_OFFSET_DDR3_MOD_MFG_WEEK 121 #define SPD_OFFSET_DDR3_SERIAL 122 #define SPD_LEN_DDR3_SERIAL 4 #define SPD_OFFSET_DDR3_PARTNUM 128 @@ -100,6 +102,8 @@ #define SPD_OFFSET_DDR4_SDRAM_WIDTH 12 #define SPD_OFFSET_DDR4_BUS_WIDTH 13 #define SPD_OFFSET_DDR4_TSOD_PRESENT 14 +#define SPD_OFFSET_DDR4_MOD_MFG_YEAR 323 +#define SPD_OFFSET_DDR4_MOD_MFG_WEEK 324 #define SPD_OFFSET_DDR4_SERIAL 325 #define SPD_LEN_DDR4_SERIAL 4 #define SPD_OFFSET_DDR4_PARTNUM 329 From nobody Fri May 5 00:30:49 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QCBRs41ZTz4B1gn; Fri, 5 May 2023 00:30: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 4QCBRs3BWyz4Cqt; Fri, 5 May 2023 00:30:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683246649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x3iMWtfjIxfTo5SGcVoMC8wChnk8Ea04t1m7jP4qkrM=; b=NGJWJ8fIy6fjATK/25dEwsN1SpazOqCm2bKGmbdsZyKCuXb+Z1XreRe14CkBA1T94FhQsV zX4hOjg0DQYGVb6hva+od0IS2yXdxmSB59Q+4EQXyOXXGz0/SxINIlXv4hwl9FQPFyr8Hn R1mvLs15/0h/dlc3ThUwsVAYm/IAMvbZpUeF06Xvn8m0La/PeeN4+vZDowce8WVEOFfWo7 a3Y9jTIV7ZySe5HkTp3x1WWhlwuPqC68zY/P0WxkAgZdeaaMTTr5zBTUZr7J/Qs4WBOL+x IBGUZ1n/y2WHRfr3qgpiIUBtlCEsrRMPP0KugLR9VQY7IGyQcYpDKnZGStyJkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683246649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x3iMWtfjIxfTo5SGcVoMC8wChnk8Ea04t1m7jP4qkrM=; b=s/xkuHb6vJE0ZunCCVfW917TXeRW1JnqV62ZZLzLADyDN+QhFlTjYYPLvEJvMT5i1qNe2w PjUwby+13wd1AAoNvgfPJn0bDbgVSwZLYNhu9Zg9dQqbr/pdNskQ5vfbwQcch1NQFlkOrm tQghQOLcQGqv6JfrKjzv6dhRZsCX3BrnW8s3PTeutSybJoBwDB/Z5b+t0RHWFglV1IEKLO qmhqIAsynQG1rXlQdQ9HDKOx+Lf35mTHJPmDRCxj/KHDgv2kwte3l7VFEN7BD3RfWeUYSi ulCJkJPiaHoQcpg/ljXqmy0lm2u6T5H5/N1VKhugMaYuSLprBBJ761HM/QqSQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683246649; a=rsa-sha256; cv=none; b=KLILRr2Yg6raZ2qrNUkblkODePAwH+H7HlGavYcIBNoUw6AuJjAbiJ9spzDB/uluGK361O FXQW3qskdNbTgUNNqLJNXqgJtzZLaMRKWqsaVBqplxKVGaILlSKkcVwOWi6+2wXNCUshw5 F2PyjANk8hla+wyEMceswfjSyAH0KKa38Os4zDeAsKZfsgEbx7mgAgYxTE3MfHj77PUvc3 JHAPy4gXLWMS6jtYKhmDB5G+BSMmWm80lRMe3cJDeDN8x5wOX2P1pNMw+yMHMiB1N0BO9Z lZ8nBJLt2NdMDDg6tyS9ANA060LRY1nQ8WlZSgUvIYzM9giM+V+WZK1ejYD5hA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QCBRs1lzpzXtq; Fri, 5 May 2023 00:30: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 3450Unc0038061; Fri, 5 May 2023 00:30:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3450UnDW038060; Fri, 5 May 2023 00:30:49 GMT (envelope-from git) Date: Fri, 5 May 2023 00:30:49 GMT Message-Id: <202305050030.3450UnDW038060@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ravi Pokala Subject: git: d0049a46bd35 - stable/12 - jedec_dimm(4): Refactor offset adjustment and page0 reset List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rpokala X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: d0049a46bd35f63a6ac520ad6630fd2608aa3015 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rpokala: URL: https://cgit.FreeBSD.org/src/commit/?id=d0049a46bd35f63a6ac520ad6630fd2608aa3015 commit d0049a46bd35f63a6ac520ad6630fd2608aa3015 Author: Ravi Pokala AuthorDate: 2023-04-27 05:03:48 +0000 Commit: Ravi Pokala CommitDate: 2023-05-05 00:30:29 +0000 jedec_dimm(4): Refactor offset adjustment and page0 reset Offsets greater than 255 bytes reside on page1 of the SPD device. Accessing them requires switching to page1, and adjusting the absolute offset to be relative to the start of page1. After the access, the page must be set back to page0. These operations are performed in several places, so break them out into their own functions. Also, replace a pair of default cases, which should be impossible due to earlier checks, with __assert_unreachable(). Reviewed by: imp MFC after: 1 week Sponsored by: Panasas Differential Revision: https://reviews.freebsd.org/D39842 (cherry picked from commit 15d69c840d860a8c0decb063f768ad695427a0d4) --- sys/dev/jedec_dimm/jedec_dimm.c | 176 +++++++++++++++++++++++++++------------- 1 file changed, 121 insertions(+), 55 deletions(-) diff --git a/sys/dev/jedec_dimm/jedec_dimm.c b/sys/dev/jedec_dimm/jedec_dimm.c index b10b2a7bc8f5..e742f8312e6d 100644 --- a/sys/dev/jedec_dimm/jedec_dimm.c +++ b/sys/dev/jedec_dimm/jedec_dimm.c @@ -144,6 +144,9 @@ const struct jedec_dimm_tsod_dev { { 0x104a, 0x03, "ST Microelectronics TSOD" }, }; +static int jedec_dimm_adjust_offset(struct jedec_dimm_softc *sc, + uint16_t orig_offset, uint16_t *new_offset, bool *page_changed); + static int jedec_dimm_attach(device_t dev); static int jedec_dimm_capacity(struct jedec_dimm_softc *sc, enum dram_type type, @@ -164,11 +167,81 @@ static int jedec_dimm_probe(device_t dev); static int jedec_dimm_readw_be(struct jedec_dimm_softc *sc, uint8_t reg, uint16_t *val); +static int jedec_dimm_reset_page0(struct jedec_dimm_softc *sc); + static int jedec_dimm_temp_sysctl(SYSCTL_HANDLER_ARGS); static const char *jedec_dimm_tsod_match(uint16_t vid, uint16_t did); +/** + * The DDR4 SPD information is spread across two 256-byte pages, but the + * offsets in the spec are absolute, not per-page. If a given offset is on the + * second page, we need to change to that page and adjust the offset to be + * relative to that page. + * + * @author rpokala + * + * @param[in] sc + * Instance-specific context data + * + * @param[in] orig_offset + * The original value of the offset, before any adjustment is made. + * + * @param[out] new_offset + * The offset to actually read from, adjusted if needed. + * + * @param[out] page_changed + * Whether or not the page was actually changed, and the offset adjusted. + * *If 'true', caller must call reset_page0() before itself returning.* + */ +static int +jedec_dimm_adjust_offset(struct jedec_dimm_softc *sc, uint16_t orig_offset, + uint16_t *new_offset, bool *page_changed) +{ + int rc; + + /* Don't change the offset, or indicate that the page has been changed, + * until the page has actually been changed. + */ + *new_offset = orig_offset; + *page_changed = false; + + /* Change to the proper page. Offsets [0, 255] are in page0; offsets + * [256, 511] are in page1. + */ + if (orig_offset < JEDEC_SPD_PAGE_SIZE) { + /* Within page0; no adjustment or page-change required. */ + rc = 0; + goto out; + } else if (orig_offset >= (2 * JEDEC_SPD_PAGE_SIZE)) { + /* Outside of expected range. */ + rc = EINVAL; + device_printf(sc->dev, "invalid offset 0x%04x\n", orig_offset); + goto out; + } + + /* 'orig_offset' is in page1. Switch to that page, and adjust + * 'new_offset' accordingly if successful. + * + * For the page-change operation, only the DTI and LSA matter; the + * offset and write-value are ignored, so just use 0. + */ + rc = smbus_writeb(sc->smbus, (JEDEC_DTI_PAGE | JEDEC_LSA_PAGE_SET1), + 0, 0); + if (rc != 0) { + device_printf(sc->dev, + "unable to change page for offset 0x%04x: %d\n", + orig_offset, rc); + goto out; + } + *page_changed = true; + *new_offset = orig_offset - JEDEC_SPD_PAGE_SIZE; + +out: + return (rc); +} + /** * device_attach() method. Read the DRAM type, use that to determine the offsets * and lengths of the asset string fields. Calculate the capacity. If a TSOD is @@ -458,9 +531,7 @@ jedec_dimm_capacity(struct jedec_dimm_softc *sc, enum dram_type type, sdram_width_offset = SPD_OFFSET_DDR4_SDRAM_WIDTH; break; default: - device_printf(sc->dev, "unsupported dram_type 0x%02x\n", type); - rc = EINVAL; - goto out; + __assert_unreachable(); } rc = smbus_readb(sc->smbus, sc->spd_addr, bus_width_offset, @@ -673,14 +744,13 @@ jedec_dimm_dump(struct jedec_dimm_softc *sc, enum dram_type type) out: if (page_changed) { int rc2; - /* Switch back to page0 before returning. */ - rc2 = smbus_writeb(sc->smbus, - (JEDEC_DTI_PAGE | JEDEC_LSA_PAGE_SET0), 0, 0); - if (rc2 != 0) { - device_printf(sc->dev, "unable to restore page: %d\n", - rc2); + + rc2 = jedec_dimm_reset_page0(sc); + if ((rc2 != 0) && (rc == 0)) { + rc = rc2; } } + return (rc); } @@ -715,54 +785,29 @@ jedec_dimm_field_to_str(struct jedec_dimm_softc *sc, char *dst, size_t dstsz, uint16_t offset, uint16_t len, bool ascii) { uint8_t byte; + uint16_t new_offset; int i; int rc; bool page_changed; - /* Change to the proper page. Offsets [0, 255] are in page0; offsets - * [256, 512] are in page1. - * - * *The page must be reset to page0 before returning.* - * - * For the page-change operation, only the DTI and LSA matter; the - * offset and write-value are ignored, so use just 0. - * - * Mercifully, JEDEC defined the fields such that none of them cross - * pages, so we don't need to worry about that complication. - */ - if (offset < JEDEC_SPD_PAGE_SIZE) { - page_changed = false; - } else if (offset < (2 * JEDEC_SPD_PAGE_SIZE)) { - page_changed = true; - rc = smbus_writeb(sc->smbus, - (JEDEC_DTI_PAGE | JEDEC_LSA_PAGE_SET1), 0, 0); - if (rc != 0) { - device_printf(sc->dev, - "unable to change page for offset 0x%04x: %d\n", - offset, rc); - } - /* Adjust the offset to account for the page change. */ - offset -= JEDEC_SPD_PAGE_SIZE; - } else { - page_changed = false; - rc = EINVAL; - device_printf(sc->dev, "invalid offset 0x%04x\n", offset); + rc = jedec_dimm_adjust_offset(sc, offset, &new_offset, &page_changed); + if (rc != 0) { goto out; } /* Sanity-check (adjusted) offset and length; everything must be within * the same page. */ - if (offset >= JEDEC_SPD_PAGE_SIZE) { + if (new_offset >= JEDEC_SPD_PAGE_SIZE) { rc = EINVAL; - device_printf(sc->dev, "invalid offset 0x%04x\n", offset); + device_printf(sc->dev, "invalid offset 0x%04x\n", new_offset); goto out; } - if ((offset + len) >= JEDEC_SPD_PAGE_SIZE) { + if ((new_offset + len) >= JEDEC_SPD_PAGE_SIZE) { rc = EINVAL; device_printf(sc->dev, - "(offset + len) would cross page (0x%04x + 0x%04x)\n", - offset, len); + "(new_offset + len) would cross page (0x%04x + 0x%04x)\n", + new_offset, len); goto out; } @@ -793,11 +838,12 @@ jedec_dimm_field_to_str(struct jedec_dimm_softc *sc, char *dst, size_t dstsz, /* Read a byte at a time. */ for (i = 0; i < len; i++) { - rc = smbus_readb(sc->smbus, sc->spd_addr, (offset + i), &byte); + rc = smbus_readb(sc->smbus, sc->spd_addr, (new_offset + i), + &byte); if (rc != 0) { device_printf(sc->dev, "failed to read byte at 0x%02x: %d\n", - (offset + i), rc); + (new_offset + i), rc); goto out; } if (ascii) { @@ -827,13 +873,10 @@ jedec_dimm_field_to_str(struct jedec_dimm_softc *sc, char *dst, size_t dstsz, out: if (page_changed) { int rc2; - /* Switch back to page0 before returning. */ - rc2 = smbus_writeb(sc->smbus, - (JEDEC_DTI_PAGE | JEDEC_LSA_PAGE_SET0), 0, 0); - if (rc2 != 0) { - device_printf(sc->dev, - "unable to restore page for offset 0x%04x: %d\n", - offset, rc2); + + rc2 = jedec_dimm_reset_page0(sc); + if ((rc2 != 0) && (rc == 0)) { + rc = rc2; } } @@ -880,10 +923,7 @@ jedec_dimm_mfg_date(struct jedec_dimm_softc *sc, enum dram_type type, week_offset = SPD_OFFSET_DDR4_MOD_MFG_WEEK; break; default: - device_printf(sc->dev, "unsupported dram_type 0x%02x\n", type); - rc = EINVAL; - page_changed = false; - goto out; + __assert_unreachable(); } /* Change to the proper page. Offsets [0, 255] are in page0; offsets @@ -1041,6 +1081,32 @@ out: return (rc); } +/** + * Reset to the default condition of operating on page0. This must be called + * after a previous operation changed to page1. + * + * @author rpokala + * + * @param[in] sc + * Instance-specific context data + */ +static int +jedec_dimm_reset_page0(struct jedec_dimm_softc *sc) +{ + int rc; + + /* For the page-change operation, only the DTI and LSA matter; the + * offset and write-value are ignored, so just use 0. + */ + rc = smbus_writeb(sc->smbus, (JEDEC_DTI_PAGE | JEDEC_LSA_PAGE_SET0), + 0, 0); + if (rc != 0) { + device_printf(sc->dev, "unable to restore page: %d\n", rc); + } + + return (rc); +} + /** * Read the temperature data from the TSOD and convert it to the deciKelvin * value that the sysctl expects. From nobody Fri May 5 06:38:55 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QCLcb4cXnz49qQY; Fri, 5 May 2023 06:38:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QCLcb3qWYz46x8; Fri, 5 May 2023 06:38:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683268735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NzvRajO3Np2xv27B6YH5nau/pwlFEVAzjzzqzcfWSv8=; b=sExWkEix/C7tTTUwUKnxoBsfvtUbmqy/x/DDc8x7XkC/Blvpdrh4MRQxTnFVTWE5qOpu/m MlMa8qPjiYZ5aXJaiRJfGZhS/Pk8iHsocgrGULpTZ28o3I5uHsZ92W007UdWwCGO8cIsxJ wjjzvEyyvZbjS9GXDhabc/ljaPQeP58eiV3DX4OHWLAOm7x2PtM388iG8/kbVKyuNQlAjp +p0QrFIX/n0y8MHua+A9rGv/AZzGaCaI4ApKPq/DnPdFOYrdwbTYT1AaaAi+xnfzVW2Z1n /95NND8mlcCMTfJi/AZItccPpuFRlR2pbhOBe0KK3r5Z/+/XzDuiWZ9sN4Drmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683268735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NzvRajO3Np2xv27B6YH5nau/pwlFEVAzjzzqzcfWSv8=; b=gm6SwG4eZzVJcNfBYOJUTgIE5e6PHB9Q8GnivjYCxzWR7fwD459/hh/C4Dtvltj1NaQww/ QMm43ebbJSNaPi/0uVPCpidMnyQTRsSljCerj4dYoQPkxx0CTJvnbGoEnoIZM/+qKtya76 t/ikyfQ7d6iwyjtsKUOnJZIa7kGgd/5M0UUkJV36O4FznQGVbHNsqvkbwOO5VUcWYTt3BC MarDNlNKequZ4+n+p49YZKB0zZAb7G2FrWsrXTlNwpf5DE3l+5cPoY4T73AiyzCq9PXhya atijXxoLabIRcPHcl/+8C49aHPUNaHvCd34Po8LhOOlawRVy42QtpryiZJhFfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683268735; a=rsa-sha256; cv=none; b=Ulg9j3uzOsNiEtibUQOh1yVqZieqE961LhjyOUrKzitQYzNRaaAv82NLPQRozzZ8poidb6 3bSZOKAK8x+kLkdHnX1WiaF/SlC5LuOJFFDgFZTq2iZWKu19GqPj5e0eXas3hZG7zSdEEl bWwQqrgnRErpJvfd751JrawFbl7tcp+x2pR6t0CoZi1lcKLyebpSaF+M5+4ioIdfO2ONQj 3vzQAtdBZjAGueuLuZ9kupTjbPQLnag66ns1G47Le6jLPbnf3Cfxbdx4g7CizF8Pqiali5 Lznu4VXoHTzn7ZtxeuczR+rUdgsilniAKh/RSdNnpmS+ek6AsZxdou9fCPgOPg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QCLcb2tFxzkV1; Fri, 5 May 2023 06:38:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3456ctx0039468; Fri, 5 May 2023 06:38:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3456ct0c039467; Fri, 5 May 2023 06:38:55 GMT (envelope-from git) Date: Fri, 5 May 2023 06:38:55 GMT Message-Id: <202305050638.3456ct0c039467@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 6ea02becc78c - stable/13 - vfs: Export get_next_dirent() as vn_dir_next_dirent() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6ea02becc78c1885ae13713a94e83a5160e63396 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6ea02becc78c1885ae13713a94e83a5160e63396 commit 6ea02becc78c1885ae13713a94e83a5160e63396 Author: Olivier Certner AuthorDate: 2023-04-23 07:47:58 +0000 Commit: Konstantin Belousov CommitDate: 2023-05-05 06:20:58 +0000 vfs: Export get_next_dirent() as vn_dir_next_dirent() (cherry picked from commit 6bce3f23d0aa045d61c0ec8d27100eb186a33375) --- sys/kern/vfs_default.c | 73 +++----------------------------------------------- sys/kern/vfs_vnops.c | 62 ++++++++++++++++++++++++++++++++++++++++++ sys/sys/vnode.h | 3 +++ 3 files changed, 69 insertions(+), 69 deletions(-) diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 6201426d582c..502a81d3036c 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -75,15 +75,9 @@ __FBSDID("$FreeBSD$"); static int vop_nolookup(struct vop_lookup_args *); static int vop_norename(struct vop_rename_args *); static int vop_nostrategy(struct vop_strategy_args *); -static int get_next_dirent(struct vnode *vp, struct dirent **dpp, - char *dirbuf, int dirbuflen, off_t *off, - char **cpos, int *len, int *eofflag, - struct thread *td); static int dirent_exists(struct vnode *vp, const char *dirname, struct thread *td); -#define DIRENT_MINSIZE (sizeof(struct dirent) - (MAXNAMLEN+1) + 4) - static int vop_stdis_text(struct vop_is_text_args *ap); static int vop_stdunset_text(struct vop_unset_text_args *ap); static int vop_stdadd_writecount(struct vop_add_writecount_args *ap); @@ -280,65 +274,6 @@ vop_nostrategy (struct vop_strategy_args *ap) return (EOPNOTSUPP); } -static int -get_next_dirent(struct vnode *vp, struct dirent **dpp, char *dirbuf, - int dirbuflen, off_t *off, char **cpos, int *len, - int *eofflag, struct thread *td) -{ - int error, reclen; - struct uio uio; - struct iovec iov; - struct dirent *dp; - - KASSERT(VOP_ISLOCKED(vp), ("vp %p is not locked", vp)); - KASSERT(vp->v_type == VDIR, ("vp %p is not a directory", vp)); - - if (*len == 0) { - iov.iov_base = dirbuf; - iov.iov_len = dirbuflen; - - uio.uio_iov = &iov; - uio.uio_iovcnt = 1; - uio.uio_offset = *off; - uio.uio_resid = dirbuflen; - uio.uio_segflg = UIO_SYSSPACE; - uio.uio_rw = UIO_READ; - uio.uio_td = td; - - *eofflag = 0; - -#ifdef MAC - error = mac_vnode_check_readdir(td->td_ucred, vp); - if (error == 0) -#endif - error = VOP_READDIR(vp, &uio, td->td_ucred, eofflag, - NULL, NULL); - if (error) - return (error); - - *off = uio.uio_offset; - - *cpos = dirbuf; - *len = (dirbuflen - uio.uio_resid); - - if (*len == 0) - return (ENOENT); - } - - dp = (struct dirent *)(*cpos); - reclen = dp->d_reclen; - *dpp = dp; - - /* check for malformed directory.. */ - if (reclen < DIRENT_MINSIZE) - return (EINVAL); - - *cpos += reclen; - *len -= reclen; - - return (0); -} - /* * Check if a named file exists in a given directory vnode. */ @@ -368,8 +303,8 @@ dirent_exists(struct vnode *vp, const char *dirname, struct thread *td) off = 0; len = 0; do { - error = get_next_dirent(vp, &dp, dirbuf, dirbuflen, &off, - &cpos, &len, &eofflag, td); + error = vn_dir_next_dirent(vp, &dp, dirbuf, dirbuflen, &off, + &cpos, &len, &eofflag, td); if (error) goto out; @@ -806,8 +741,8 @@ vop_stdvptocnp(struct vop_vptocnp_args *ap) len = 0; do { /* call VOP_READDIR of parent */ - error = get_next_dirent(*dvp, &dp, dirbuf, dirbuflen, &off, - &cpos, &len, &eofflag, td); + error = vn_dir_next_dirent(*dvp, &dp, dirbuf, dirbuflen, &off, + &cpos, &len, &eofflag, td); if (error) goto out; diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 215c9d1cc0cc..c35370d9d6b3 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -3594,6 +3595,67 @@ vn_fallocate(struct file *fp, off_t offset, off_t len, struct thread *td) return (error); } +#define DIRENT_MINSIZE (sizeof(struct dirent) - (MAXNAMLEN+1) + 4) + +int +vn_dir_next_dirent(struct vnode *vp, struct dirent **dpp, char *dirbuf, + int dirbuflen, off_t *off, char **cpos, int *len, + int *eofflag, struct thread *td) +{ + int error, reclen; + struct uio uio; + struct iovec iov; + struct dirent *dp; + + KASSERT(VOP_ISLOCKED(vp), ("vp %p is not locked", vp)); + KASSERT(vp->v_type == VDIR, ("vp %p is not a directory", vp)); + + if (*len == 0) { + iov.iov_base = dirbuf; + iov.iov_len = dirbuflen; + + uio.uio_iov = &iov; + uio.uio_iovcnt = 1; + uio.uio_offset = *off; + uio.uio_resid = dirbuflen; + uio.uio_segflg = UIO_SYSSPACE; + uio.uio_rw = UIO_READ; + uio.uio_td = td; + + *eofflag = 0; + +#ifdef MAC + error = mac_vnode_check_readdir(td->td_ucred, vp); + if (error == 0) +#endif + error = VOP_READDIR(vp, &uio, td->td_ucred, eofflag, + NULL, NULL); + if (error) + return (error); + + *off = uio.uio_offset; + + *cpos = dirbuf; + *len = (dirbuflen - uio.uio_resid); + + if (*len == 0) + return (ENOENT); + } + + dp = (struct dirent *)(*cpos); + reclen = dp->d_reclen; + *dpp = dp; + + /* check for malformed directory.. */ + if (reclen < DIRENT_MINSIZE) + return (EINVAL); + + *cpos += reclen; + *len -= reclen; + + return (0); +} + static u_long vn_lock_pair_pause_cnt; SYSCTL_ULONG(_debug, OID_AUTO, vn_lock_pair_pause, CTLFLAG_RD, &vn_lock_pair_pause_cnt, 0, diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 37cafdb0d5ae..d5d2776b2f5e 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -1096,6 +1096,9 @@ void vfs_hash_remove(struct vnode *vp); int vfs_kqfilter(struct vop_kqfilter_args *); struct dirent; +int vn_dir_next_dirent(struct vnode *vp, struct dirent **dpp, char *dirbuf, + int dirbuflen, off_t *off, char **cpos, int *len, + int *eofflag, struct thread *td); int vfs_read_dirent(struct vop_readdir_args *ap, struct dirent *dp, off_t off); int vfs_emptydir(struct vnode *vp); From nobody Fri May 5 06:38:56 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QCLcc6Gslz49qNN; Fri, 5 May 2023 06:38:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QCLcc4zS3z479y; Fri, 5 May 2023 06:38:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683268736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YjfbsWzIM4PcdObb7idMScXDrBKTOBC6BISB37N7Bic=; b=ehbXTZNBMsKJDEZ+vAKzrSJ25j2qPI2QBLPGwRxutkpV0qQBQdfPGLgnrwRqYvIYvuWCJC r+NGAoCCfyFkFQvC7H/ZlIL0UwY2VWWe+jnDfelfLWD2F6QC/bN2/LHjY1lSbtMN7RVZcl UcbBHpX9qhwDWI/yRgGZrLM0klCKHllGmyZv1FaGwKPoJmf4+z9YjYNJQGdCjG5QCnXyRh KB6c7foskeT3HK9AYAemnuAbL21QmTE65U4BKwCbIDN2dtQysbLkLYMjuwkMwt2C1Wnngh 9wYADhnFveyh8+PwZ97T3S5oOzFw24wZd3IAKnEMmxlJFRVmrj7Gl6r4XnHHWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683268736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YjfbsWzIM4PcdObb7idMScXDrBKTOBC6BISB37N7Bic=; b=T4dKlNqWHVbMcxSV80yAusqRk5hwCHs7arjQyd1/BLNSzxsOYuUuitXpE9OBAG0F2/OYCf 02V/Wr1z4kBYEAIVfn1Z5sbAsTJ5AkscdWxHMS9t7GfWABzx/92Pti/9DC/tccNewVJLxt LsfXpRnUuL3cj8DTKMmrSK6dpstPfuqM+zhuugBx716pe+mrN9C6Xqhbnbpofxghpecor4 CQ8U2dRJJJ/kysSaTgTVcbuoQoP4wrpWsVidP852Sx7NR6bnsrmL2UFUPofPG/pWFONff9 PM6DXcl0xjSBlVM5F1Hst2E6SkAppZJ/DRLifOPQw0brqNYNMiUmZFJa08kYFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683268736; a=rsa-sha256; cv=none; b=JZmw7vx0FdcKEt+H5o1CKrxXP3EdU0QVjTYuKiHAHu2/akfkm2S34SSWPupJ/pFbCue0YW XqTb/FiVjoS/6t+S2KcCH+eNAc+dfSKX7fQfq4TCCMi3xiABhlQFALY2RwmgkUj3oF4GZA LISW0pU+mi6eXWAbQkCRABnlgS2v5GggS7DkUsew/JLEwH7YTYBXxtzanCKb2/OZKf07mJ eAm8qlk2BqNKAeMus9IbIxcRiaAbo5xQROQ7aTf15hDDc3eTV2VZbf5/e4E4G+vac/yg0n 4x8J/xjdt/ApR6PlADOrCBXmN8rUPx+XyKUSn9hkpCRzU+jw/w396/cxBoWq2w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QCLcc437rzkRG; Fri, 5 May 2023 06:38: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 3456cu6I039487; Fri, 5 May 2023 06:38:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3456cuo8039486; Fri, 5 May 2023 06:38:56 GMT (envelope-from git) Date: Fri, 5 May 2023 06:38:56 GMT Message-Id: <202305050638.3456cuo8039486@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 6dae49bb3b4d - stable/13 - vfs: vn_dir_next_dirent(): Simplify interface and harden List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6dae49bb3b4de1de5648485530558d4a868d9b61 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6dae49bb3b4de1de5648485530558d4a868d9b61 commit 6dae49bb3b4de1de5648485530558d4a868d9b61 Author: Olivier Certner AuthorDate: 2023-04-24 08:25:15 +0000 Commit: Konstantin Belousov CommitDate: 2023-05-05 06:20:58 +0000 vfs: vn_dir_next_dirent(): Simplify interface and harden (cherry picked from commit 3d8450db4c603d18aa45422159170e133c95214d) --- sys/kern/vfs_default.c | 94 ++++++++++++++++------------- sys/kern/vfs_vnops.c | 156 ++++++++++++++++++++++++++++++++++++++++--------- sys/sys/dirent.h | 5 +- sys/sys/vnode.h | 6 +- 4 files changed, 188 insertions(+), 73 deletions(-) diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 502a81d3036c..75738aba359b 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -275,49 +275,56 @@ vop_nostrategy (struct vop_strategy_args *ap) } /* - * Check if a named file exists in a given directory vnode. + * Check if a named file exists in a given directory vnode + * + * Returns 0 if the file exists, ENOENT if it doesn't, or errors returned by + * vn_dir_next_dirent(). */ static int dirent_exists(struct vnode *vp, const char *dirname, struct thread *td) { - char *dirbuf, *cpos; - int error, eofflag, dirbuflen, len, found; + char *dirbuf; + int error, eofflag; + size_t dirbuflen, len; off_t off; struct dirent *dp; struct vattr va; - KASSERT(VOP_ISLOCKED(vp), ("vp %p is not locked", vp)); + ASSERT_VOP_LOCKED(vp, "vnode not locked"); KASSERT(vp->v_type == VDIR, ("vp %p is not a directory", vp)); - found = 0; - error = VOP_GETATTR(vp, &va, td->td_ucred); - if (error) - return (found); + if (error != 0) + return (error); - dirbuflen = DEV_BSIZE; + dirbuflen = MAX(DEV_BSIZE, GENERIC_MAXDIRSIZ); if (dirbuflen < va.va_blocksize) dirbuflen = va.va_blocksize; - dirbuf = (char *)malloc(dirbuflen, M_TEMP, M_WAITOK); + dirbuf = malloc(dirbuflen, M_TEMP, M_WAITOK); - off = 0; len = 0; - do { - error = vn_dir_next_dirent(vp, &dp, dirbuf, dirbuflen, &off, - &cpos, &len, &eofflag, td); - if (error) + off = 0; + eofflag = 0; + + for (;;) { + error = vn_dir_next_dirent(vp, td, dirbuf, dirbuflen, + &dp, &len, &off, &eofflag); + if (error != 0) goto out; + if (len == 0) + break; + if (dp->d_type != DT_WHT && dp->d_fileno != 0 && - strcmp(dp->d_name, dirname) == 0) { - found = 1; + strcmp(dp->d_name, dirname) == 0) goto out; - } - } while (len > 0 || !eofflag); + } + + error = ENOENT; out: free(dirbuf, M_TEMP); - return (found); + return (error); } int @@ -670,27 +677,24 @@ vop_stdvptofh(struct vop_vptofh_args *ap) int vop_stdvptocnp(struct vop_vptocnp_args *ap) { - struct vnode *vp = ap->a_vp; - struct vnode **dvp = ap->a_vpp; - struct ucred *cred; + struct vnode *const vp = ap->a_vp; + struct vnode **const dvp = ap->a_vpp; char *buf = ap->a_buf; size_t *buflen = ap->a_buflen; - char *dirbuf, *cpos; - int i, error, eofflag, dirbuflen, flags, locked, len, covered; + char *dirbuf; + int i = *buflen; + int error = 0, covered = 0; + int eofflag, flags, locked; + size_t dirbuflen, len; off_t off; ino_t fileno; struct vattr va; struct nameidata nd; - struct thread *td; + struct thread *const td = curthread; + struct ucred *const cred = td->td_ucred; struct dirent *dp; struct vnode *mvp; - i = *buflen; - error = 0; - covered = 0; - td = curthread; - cred = td->td_ucred; - if (vp->v_type != VDIR) return (ENOENT); @@ -727,31 +731,38 @@ vop_stdvptocnp(struct vop_vptocnp_args *ap) fileno = va.va_fileid; - dirbuflen = DEV_BSIZE; + dirbuflen = MAX(DEV_BSIZE, GENERIC_MAXDIRSIZ); if (dirbuflen < va.va_blocksize) dirbuflen = va.va_blocksize; - dirbuf = (char *)malloc(dirbuflen, M_TEMP, M_WAITOK); + dirbuf = malloc(dirbuflen, M_TEMP, M_WAITOK); if ((*dvp)->v_type != VDIR) { error = ENOENT; goto out; } - off = 0; len = 0; - do { + off = 0; + eofflag = 0; + + for (;;) { /* call VOP_READDIR of parent */ - error = vn_dir_next_dirent(*dvp, &dp, dirbuf, dirbuflen, &off, - &cpos, &len, &eofflag, td); - if (error) + error = vn_dir_next_dirent(*dvp, td, + dirbuf, dirbuflen, &dp, &len, &off, &eofflag); + if (error != 0) + goto out; + + if (len == 0) { + error = ENOENT; goto out; + } if ((dp->d_type != DT_WHT) && (dp->d_fileno == fileno)) { if (covered) { VOP_UNLOCK(*dvp); vn_lock(mvp, LK_SHARED | LK_RETRY); - if (dirent_exists(mvp, dp->d_name, td)) { + if (dirent_exists(mvp, dp->d_name, td) == 0) { error = ENOENT; VOP_UNLOCK(mvp); vn_lock(*dvp, LK_SHARED | LK_RETRY); @@ -774,8 +785,7 @@ vop_stdvptocnp(struct vop_vptocnp_args *ap) } goto out; } - } while (len > 0 || !eofflag); - error = ENOENT; + } out: free(dirbuf, M_TEMP); diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index c35370d9d6b3..6206c521ba48 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -3597,20 +3597,112 @@ vn_fallocate(struct file *fp, off_t offset, off_t len, struct thread *td) #define DIRENT_MINSIZE (sizeof(struct dirent) - (MAXNAMLEN+1) + 4) +/* + * Keep this assert as long as sizeof(struct dirent) is used as the maximum + * entry size. + */ +_Static_assert(_GENERIC_MAXDIRSIZ == sizeof(struct dirent), + "'struct dirent' size must be a multiple of its alignment " + "(see _GENERIC_DIRLEN())"); + +/* + * Returns successive directory entries through some caller's provided buffer + * + * This function automatically refills the provided buffer with calls to + * VOP_READDIR() (after MAC permission checks). + * + * 'td' is used for credentials and passed to uiomove(). 'dirbuf' is the + * caller's buffer to fill and 'dirbuflen' its allocated size. 'dirbuf' must be + * properly aligned to access 'struct dirent' structures and 'dirbuflen' must + * be greater than GENERIC_MAXDIRSIZ to avoid VOP_READDIR() returning EINVAL + * (the latter is not a strong guarantee (yet); but EINVAL will always be + * returned if this requirement is not verified). '*dpp' points to the current + * directory entry in the buffer and '*len' contains the remaining valid bytes + * in 'dirbuf' after 'dpp' (including the pointed entry). + * + * At first call (or when restarting the read), '*len' must have been set to 0, + * '*off' to 0 (or any valid start offset) and '*eofflag' to 0. There are no + * more entries as soon as '*len' is 0 after a call that returned 0. Calling + * again this function after such a condition is considered an error and EINVAL + * will be returned. Other possible error codes are those of VOP_READDIR(), + * EINTEGRITY if the returned entries do not pass coherency tests, or EINVAL + * (bad call). All errors are unrecoverable, i.e., the state ('*len', '*off' + * and '*eofflag') must be re-initialized before a subsequent call. On error or + * at end of directory, '*dpp' is reset to NULL. + * + * '*len', '*off' and '*eofflag' are internal state the caller should not + * tamper with except as explained above. '*off' is the next directory offset + * to read from to refill the buffer. '*eofflag' is set to 0 or 1 by the last + * internal call to VOP_READDIR() that returned without error, indicating + * whether it reached the end of the directory, and to 2 by this function after + * all entries have been read. + */ int -vn_dir_next_dirent(struct vnode *vp, struct dirent **dpp, char *dirbuf, - int dirbuflen, off_t *off, char **cpos, int *len, - int *eofflag, struct thread *td) +vn_dir_next_dirent(struct vnode *vp, struct thread *td, + char *dirbuf, size_t dirbuflen, + struct dirent **dpp, size_t *len, off_t *off, int *eofflag) { - int error, reclen; + struct dirent *dp = NULL; + int reclen; + int error; struct uio uio; struct iovec iov; - struct dirent *dp; - KASSERT(VOP_ISLOCKED(vp), ("vp %p is not locked", vp)); - KASSERT(vp->v_type == VDIR, ("vp %p is not a directory", vp)); + ASSERT_VOP_LOCKED(vp, "vnode not locked"); + VNASSERT(vp->v_type == VDIR, vp, ("vnode is not a directory")); + MPASS2((uintptr_t)dirbuf < (uintptr_t)dirbuf + dirbuflen, + "Address space overflow"); + + if (__predict_false(dirbuflen < GENERIC_MAXDIRSIZ)) { + /* Don't take any chances in this case */ + error = EINVAL; + goto out; + } + + if (*len != 0) { + dp = *dpp; + + /* + * The caller continued to call us after an error (we set dp to + * NULL in a previous iteration). Bail out right now. + */ + if (__predict_false(dp == NULL)) + return (EINVAL); + + MPASS(*len <= dirbuflen); + MPASS2((uintptr_t)dirbuf <= (uintptr_t)dp && + (uintptr_t)dp + *len <= (uintptr_t)dirbuf + dirbuflen, + "Filled range not inside buffer"); + + reclen = dp->d_reclen; + if (reclen >= *len) { + /* End of buffer reached */ + *len = 0; + } else { + dp = (struct dirent *)((char *)dp + reclen); + *len -= reclen; + } + } if (*len == 0) { + dp = NULL; + + /* Have to refill. */ + switch (*eofflag) { + case 0: + break; + + case 1: + /* Nothing more to read. */ + *eofflag = 2; /* Remember the caller reached EOF. */ + goto success; + + default: + /* The caller didn't test for EOF. */ + error = EINVAL; + goto out; + } + iov.iov_base = dirbuf; iov.iov_len = dirbuflen; @@ -3622,40 +3714,50 @@ vn_dir_next_dirent(struct vnode *vp, struct dirent **dpp, char *dirbuf, uio.uio_rw = UIO_READ; uio.uio_td = td; - *eofflag = 0; - #ifdef MAC error = mac_vnode_check_readdir(td->td_ucred, vp); if (error == 0) #endif error = VOP_READDIR(vp, &uio, td->td_ucred, eofflag, - NULL, NULL); - if (error) - return (error); + NULL, NULL); + if (error != 0) + goto out; + *len = dirbuflen - uio.uio_resid; *off = uio.uio_offset; - *cpos = dirbuf; - *len = (dirbuflen - uio.uio_resid); - - if (*len == 0) - return (ENOENT); - } + if (*len == 0) { + /* Sanity check on INVARIANTS. */ + MPASS(*eofflag != 0); + *eofflag = 1; + goto success; + } - dp = (struct dirent *)(*cpos); - reclen = dp->d_reclen; - *dpp = dp; + /* + * Normalize the flag returned by VOP_READDIR(), since we use 2 + * as a sentinel value. + */ + if (*eofflag != 0) + *eofflag = 1; - /* check for malformed directory.. */ - if (reclen < DIRENT_MINSIZE) - return (EINVAL); + dp = (struct dirent *)dirbuf; + } - *cpos += reclen; - *len -= reclen; + if (__predict_false(*len < GENERIC_MINDIRSIZ || + dp->d_reclen < GENERIC_MINDIRSIZ)) { + error = EINTEGRITY; + dp = NULL; + goto out; + } - return (0); +success: + error = 0; +out: + *dpp = dp; + return (error); } + static u_long vn_lock_pair_pause_cnt; SYSCTL_ULONG(_debug, OID_AUTO, vn_lock_pair_pause, CTLFLAG_RD, &vn_lock_pair_pause_cnt, 0, diff --git a/sys/sys/dirent.h b/sys/sys/dirent.h index b3c5e00cd9ad..9087b01fa597 100644 --- a/sys/sys/dirent.h +++ b/sys/sys/dirent.h @@ -122,11 +122,14 @@ struct freebsd11_dirent { #define _GENERIC_DIRLEN(namlen) \ ((__offsetof(struct dirent, d_name) + (namlen) + 1 + 7) & ~7) #define _GENERIC_DIRSIZ(dp) _GENERIC_DIRLEN((dp)->d_namlen) +#define _GENERIC_MINDIRSIZ _GENERIC_DIRLEN(1) /* Name must not be empty */ +#define _GENERIC_MAXDIRSIZ _GENERIC_DIRLEN(MAXNAMLEN) #endif /* __BSD_VISIBLE */ #ifdef _KERNEL #define GENERIC_DIRSIZ(dp) _GENERIC_DIRSIZ(dp) - +#define GENERIC_MINDIRSIZ _GENERIC_MINDIRSIZ +#define GENERIC_MAXDIRSIZ _GENERIC_MAXDIRSIZ /* * Ensure that padding bytes are zeroed and that the name is NUL-terminated. */ diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index d5d2776b2f5e..7b15cb95f63f 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -1096,9 +1096,9 @@ void vfs_hash_remove(struct vnode *vp); int vfs_kqfilter(struct vop_kqfilter_args *); struct dirent; -int vn_dir_next_dirent(struct vnode *vp, struct dirent **dpp, char *dirbuf, - int dirbuflen, off_t *off, char **cpos, int *len, - int *eofflag, struct thread *td); +int vn_dir_next_dirent(struct vnode *vp, struct thread *td, + char *dirbuf, size_t dirbuflen, + struct dirent **dpp, size_t *len, off_t *off, int *eofflag); int vfs_read_dirent(struct vop_readdir_args *ap, struct dirent *dp, off_t off); int vfs_emptydir(struct vnode *vp); From nobody Fri May 5 06:38:57 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QCLcd6J3kz49qL2; Fri, 5 May 2023 06:38: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 4QCLcd5hk6z47BK; Fri, 5 May 2023 06:38:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683268737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fIyK6vrBXrfifZKNrOI0uLEL2UXyKhje5jyPfejge3U=; b=eX1APAE2CUQq3It59qsY0fUik9x49SkLJSAVcWezpn8ZloOE8wfzPhWE1XtT6wlHHlaUbT 0RvbvkLkliJyPG3QeUnza+5kf/Uxo+L8jbywKVrh35KM43bYNRTnd4YToVyjTrRQVVha0S DsZvUw9m86/lFyYq/5rAz8xfwJOcNjEt9s8X62Hvt4AlX6cPMrBaxLfMiNgBu+aT+jKNhi fI6OpPo8w3FLmWD32vlgpVKWa+GSvnjQTfVoploipyRnyTejPQt7S/hQUhWy5Rk0feXTSk JHLtdZKbeobLcmWu93ucCvSKj1ce8IP5qHmCjHO66oKvI2W+Pr6FakMT5EnwSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683268737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fIyK6vrBXrfifZKNrOI0uLEL2UXyKhje5jyPfejge3U=; b=iikOnIMhgzE3Keffo5gdLHNGE7cuzqbLPoulkYvpwNdL38AYv+LLT1CHy70Fl3rEba6E4h AARLq0VF6KhJW0tGAn7ouMDlSkuAU0VDbjEwHZ9UQOf4IeC3mWLpBCsN1fBWq4tWQcyHRi tTvSeCDVJjFWPnZh33ZurYktXPWrKwtf48IoIUuIWMAjE7grp5LvsynHavn9hoT/2O0KZ1 K7IGYbO4PVX5vdAkUNK1N7hfMAcSOJ72kQcB8xyt8wlbwKnB1x+vgdqGUulKwn4oWVYZkn y6zhae2xs9DG1QAgltXBUW1flIpbm8UlkmHpUQxYUFUjp2epLeflBQrZ/03dSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683268737; a=rsa-sha256; cv=none; b=Cl2HimlcE8ivKHxROsyIS3hP4+UDY0MdVPys2A1F+dyehMvf/J87o8628pw1VbkcZp8aaP PRMIM5QhupEdcAvX83u82jF2tNaSmHAxN/wItlITOc3+gaXHBXaQrWeYrD9peKsjZJb+wp RBv8dBL7N55cD6zCCVSqn6VjinmDYtV25Ey8d67C2cJ1QcBaORbt6laPHiobk+czTd5t2I LEIjlc6Aseqw5rI/esyVhcG+86lu/v25z6kEplIWYK07W1GuqtucGcV4OTkITuBb022sWo KEGcjMjx34nFDbNcgu7xqcrw7NSaUE9snZdVLbpSGVpqcUifHWO0s318lXE2/w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QCLcd4mmNzklF; Fri, 5 May 2023 06:38: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 3456cvZN039515; Fri, 5 May 2023 06:38:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3456cvNM039514; Fri, 5 May 2023 06:38:57 GMT (envelope-from git) Date: Fri, 5 May 2023 06:38:57 GMT Message-Id: <202305050638.3456cvNM039514@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 6a53a4ff6537 - stable/13 - vfs: Fix "emptydir" mount option List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6a53a4ff653722488379cedf4326deabbfccd749 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6a53a4ff653722488379cedf4326deabbfccd749 commit 6a53a4ff653722488379cedf4326deabbfccd749 Author: Olivier Certner AuthorDate: 2023-04-22 16:07:07 +0000 Commit: Konstantin Belousov CommitDate: 2023-05-05 06:20:58 +0000 vfs: Fix "emptydir" mount option PR: 270988 (cherry picked from commit 6450e7bbad0c68176f28b51773a3af5d6022c7dd) --- sys/kern/vfs_subr.c | 115 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 67 insertions(+), 48 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index ff5b4822316f..dbedc16f555b 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -6452,65 +6452,84 @@ filt_vfsvnode(struct knote *kn, long hint) int vfs_emptydir(struct vnode *vp) { - struct uio uio; - struct iovec iov; - struct dirent *dirent, *dp, *endp; - int error, eof; - - error = 0; - eof = 0; + struct thread *const td = curthread; + char *dirbuf; + size_t dirbuflen, len; + off_t off; + int eofflag, error; + struct dirent *dp; + struct vattr va; ASSERT_VOP_LOCKED(vp, "vfs_emptydir"); VNASSERT(vp->v_type == VDIR, vp, ("vp is not a directory")); - dirent = malloc(sizeof(struct dirent), M_TEMP, M_WAITOK); - iov.iov_base = dirent; - iov.iov_len = sizeof(struct dirent); - - uio.uio_iov = &iov; - uio.uio_iovcnt = 1; - uio.uio_offset = 0; - uio.uio_resid = sizeof(struct dirent); - uio.uio_segflg = UIO_SYSSPACE; - uio.uio_rw = UIO_READ; - uio.uio_td = curthread; - - while (eof == 0 && error == 0) { - error = VOP_READDIR(vp, &uio, curthread->td_ucred, &eof, - NULL, NULL); + error = VOP_GETATTR(vp, &va, td->td_ucred); + if (error != 0) + return (error); + + dirbuflen = max(DEV_BSIZE, GENERIC_MAXDIRSIZ); + if (dirbuflen < va.va_blocksize) + dirbuflen = va.va_blocksize; + dirbuf = malloc(dirbuflen, M_TEMP, M_WAITOK); + + len = 0; + off = 0; + eofflag = 0; + + for (;;) { + error = vn_dir_next_dirent(vp, td, dirbuf, dirbuflen, + &dp, &len, &off, &eofflag); if (error != 0) - break; - endp = (void *)((uint8_t *)dirent + - sizeof(struct dirent) - uio.uio_resid); - for (dp = dirent; dp < endp; - dp = (void *)((uint8_t *)dp + GENERIC_DIRSIZ(dp))) { - if (dp->d_type == DT_WHT) - continue; - if (dp->d_namlen == 0) - continue; - if (dp->d_type != DT_DIR && - dp->d_type != DT_UNKNOWN) { - error = ENOTEMPTY; - break; - } - if (dp->d_namlen > 2) { - error = ENOTEMPTY; - break; - } - if (dp->d_namlen == 1 && - dp->d_name[0] != '.') { + goto end; + + if (len == 0) { + /* EOF */ + error = 0; + goto end; + } + + /* + * Skip whiteouts. Unionfs operates on filesystems only and not + * on hierarchies, so these whiteouts would be shadowed on the + * system hierarchy but not for a union using the filesystem of + * their directories as the upper layer. Additionally, unionfs + * currently transparently exposes union-specific metadata of + * its upper layer, meaning that whiteouts can be seen through + * the union view in empty directories. Taking into account + * these whiteouts would then prevent mounting another + * filesystem on such effectively empty directories. + */ + if (dp->d_type == DT_WHT) + continue; + + /* + * Any file in the directory which is not '.' or '..' indicates + * the directory is not empty. + */ + switch (dp->d_namlen) { + case 2: + if (dp->d_name[1] != '.') { + /* Can't be '..' (nor '.') */ error = ENOTEMPTY; - break; + goto end; } - if (dp->d_namlen == 2 && - dp->d_name[1] != '.') { + /* FALLTHROUGH */ + case 1: + if (dp->d_name[0] != '.') { + /* Can't be '..' nor '.' */ error = ENOTEMPTY; - break; + goto end; } - uio.uio_resid = sizeof(struct dirent); + break; + + default: + error = ENOTEMPTY; + goto end; } } - free(dirent, M_TEMP); + +end: + free(dirbuf, M_TEMP); return (error); } From nobody Fri May 5 06:38:58 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QCLcg0lZXz49qHy; Fri, 5 May 2023 06:38: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 4QCLcf6Shcz47DK; Fri, 5 May 2023 06:38:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683268738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CuHvUdTyhD5d7C6q/YTYqTW5xD5cGv/ydCNH/RP5wQM=; b=VJUxCI+YqRpye502Xf3Y3sHPCAbvKL9+BR9y6PCjYIBPy9uysfeGNqtkRdISHt+lYGmesg cULeArJsL0ZrCc4CpxKgU2miSECRo0Y+WSderzXb0RafveZPRx+h+NSqgstuXxi1Tp9Vse 6WGojs0eSD8s8cB5eNT08Nco3DhqU3nJZSRf9WzZM27raQWoQeWv5MSPhZgbvm5+UtnHGi OjeQcOPOK4wmCrrlqGInp/0GfwGq5PeMM31gl3H570Qz4LLG+TANecOVJzs6nrSeLCde81 mejE5p5LZXWilbDIheVZkOSh/q6XoMDPV1EBaRDuL8g3HA5Urn0cMlePZVi8Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683268738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CuHvUdTyhD5d7C6q/YTYqTW5xD5cGv/ydCNH/RP5wQM=; b=VPPp6RaX+Yv7NIV5duLF2ormXHS7YUh8+Uj2ni4VjXMTvbrC3uRpTJCAQYKFYq2g1Uo96b O5A73BeggruCHIXIoVbaSsRRM+rhC0PZjbteusXhPsAqU/FKYBrLjuogG5i0dJxIIrzSRu fbwBgZnWM5sQdBNNbVEjdmwZ19QBKXMC9HQc9Fy6imSBEzA6NfnnDbGRyJz5XxwQ6AsiR1 ewH0OXoA7vVdJiXm2a2SCkDOKzIdLiGH/MY8nZNnyEA8DJ+oe+nGKUExYEBfLmFAv+3nQ4 YDuGA/UqtYoRSZqRQlBiopB6r1vvGGJBqBvdkQYD3QoTLF3KzkoI5f81bTgLew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683268738; a=rsa-sha256; cv=none; b=bdCGXoJVd8bPr3zMooHlp70JYsNkHUJjL3Y1HmOKF10TvxNlD5g0S09cMmRmUvwJY2uDsC M7qbmC0pavjppPqvqHqljAT4H4ra9RNOUEVmp/hVku62YzKSbAscyVXB8Y36TnHeHMN5A5 XT4kcXF06q5/MHw8WQFNBYCR73v+c6CH2Cmq3OkNMyBhIuJjGhj3I9k77A4VtxKFySJd91 kc9g4Weyj4qurejRVm1leOg9XlzoAoAb9eEz4w0VXHxwI0tLcPqtl/9nEEfh1yjxrP822Y 5S2dZZKF0kiBqE7w2BTXlibpzT5GXs0LFrlRb9a7IlMxHvRd1a5AfgjK7xscMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QCLcf5YWtzkRH; Fri, 5 May 2023 06:38: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 3456cwPQ039538; Fri, 5 May 2023 06:38:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3456cw28039535; Fri, 5 May 2023 06:38:58 GMT (envelope-from git) Date: Fri, 5 May 2023 06:38:58 GMT Message-Id: <202305050638.3456cw28039535@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 21cc0c6cad65 - stable/13 - vfs: vn_dir_next_dirent(): Adapt comments to style(9) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 21cc0c6cad6597ef696e72a8ded6fc34e977ce6f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=21cc0c6cad6597ef696e72a8ded6fc34e977ce6f commit 21cc0c6cad6597ef696e72a8ded6fc34e977ce6f Author: Olivier Certner AuthorDate: 2023-04-28 09:04:16 +0000 Commit: Konstantin Belousov CommitDate: 2023-05-05 06:20:58 +0000 vfs: vn_dir_next_dirent(): Adapt comments to style(9) (cherry picked from commit c21d87a88c72804bc4fb86d7b0e8a846230e4ad0) --- sys/kern/vfs_vnops.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 6206c521ba48..8ad66be142b2 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -3606,33 +3606,33 @@ _Static_assert(_GENERIC_MAXDIRSIZ == sizeof(struct dirent), "(see _GENERIC_DIRLEN())"); /* - * Returns successive directory entries through some caller's provided buffer + * Returns successive directory entries through some caller's provided buffer. * * This function automatically refills the provided buffer with calls to * VOP_READDIR() (after MAC permission checks). * - * 'td' is used for credentials and passed to uiomove(). 'dirbuf' is the - * caller's buffer to fill and 'dirbuflen' its allocated size. 'dirbuf' must be - * properly aligned to access 'struct dirent' structures and 'dirbuflen' must - * be greater than GENERIC_MAXDIRSIZ to avoid VOP_READDIR() returning EINVAL - * (the latter is not a strong guarantee (yet); but EINVAL will always be - * returned if this requirement is not verified). '*dpp' points to the current - * directory entry in the buffer and '*len' contains the remaining valid bytes - * in 'dirbuf' after 'dpp' (including the pointed entry). + * 'td' is used for credentials and passed to uiomove(). 'dirbuf' is the + * caller's buffer to fill and 'dirbuflen' its allocated size. 'dirbuf' must + * be properly aligned to access 'struct dirent' structures and 'dirbuflen' + * must be greater than GENERIC_MAXDIRSIZ to avoid VOP_READDIR() returning + * EINVAL (the latter is not a strong guarantee (yet); but EINVAL will always + * be returned if this requirement is not verified). '*dpp' points to the + * current directory entry in the buffer and '*len' contains the remaining + * valid bytes in 'dirbuf' after 'dpp' (including the pointed entry). * * At first call (or when restarting the read), '*len' must have been set to 0, - * '*off' to 0 (or any valid start offset) and '*eofflag' to 0. There are no - * more entries as soon as '*len' is 0 after a call that returned 0. Calling + * '*off' to 0 (or any valid start offset) and '*eofflag' to 0. There are no + * more entries as soon as '*len' is 0 after a call that returned 0. Calling * again this function after such a condition is considered an error and EINVAL - * will be returned. Other possible error codes are those of VOP_READDIR(), + * will be returned. Other possible error codes are those of VOP_READDIR(), * EINTEGRITY if the returned entries do not pass coherency tests, or EINVAL - * (bad call). All errors are unrecoverable, i.e., the state ('*len', '*off' - * and '*eofflag') must be re-initialized before a subsequent call. On error or - * at end of directory, '*dpp' is reset to NULL. + * (bad call). All errors are unrecoverable, i.e., the state ('*len', '*off' + * and '*eofflag') must be re-initialized before a subsequent call. On error + * or at end of directory, '*dpp' is reset to NULL. * * '*len', '*off' and '*eofflag' are internal state the caller should not - * tamper with except as explained above. '*off' is the next directory offset - * to read from to refill the buffer. '*eofflag' is set to 0 or 1 by the last + * tamper with except as explained above. '*off' is the next directory offset + * to read from to refill the buffer. '*eofflag' is set to 0 or 1 by the last * internal call to VOP_READDIR() that returned without error, indicating * whether it reached the end of the directory, and to 2 by this function after * all entries have been read. @@ -3664,7 +3664,7 @@ vn_dir_next_dirent(struct vnode *vp, struct thread *td, /* * The caller continued to call us after an error (we set dp to - * NULL in a previous iteration). Bail out right now. + * NULL in a previous iteration). Bail out right now. */ if (__predict_false(dp == NULL)) return (EINVAL); From nobody Fri May 5 06:38:59 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QCLch1qJ4z49qQj; Fri, 5 May 2023 06:39:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QCLch0VpBz47Dc; Fri, 5 May 2023 06:39:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683268740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zr4JRyTM8QtLCWP0PfVWfQNsPEDJp6hPGjLma28zGU0=; b=pSKrUPs/hlSmPhsJmpQS3S2W6zSssFGUeOkPTG1flptz/1Sn/cb7ZA4zV0PFyKsWIAYHCA /cuedFspaCFvWbEdazanNzcdk0yUmSC2xxx5etK7lx9LHqB05sL+eA6mJePc3feL7hdtdB hKyCKGvH/XG/Ccyc+E6zTDaJ0nDG8OIfUhFksfVJE4KHHj0wYs0bPNc5NmBPl0k2xS2CP3 lUljReAQDR5Tc/WAKGdG37vordAfHrPW+Ts4XAKXI59Qa/MoDJlNPwn8ow0eFEt+WA5YF2 A3Pl50TmQgTf1Aptkt50XvVKWhEDa5pyrbx06mCgszY6JrVJnG5acZ1Lt1dcFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683268740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zr4JRyTM8QtLCWP0PfVWfQNsPEDJp6hPGjLma28zGU0=; b=IKDrNLG8bXRgjxg/6jfhAeTj4gBHLBdHk3IesVyadHonuUhVKuuAWqjtWLshGJ1QIrcBgh BOitPQ1X+4CS6SS/fHVvA7pIT6t/01geR8qJ5g/IiulBfEwyyM/2ZzLSBqsyIitfWRQ5oN JRQg2jt4QF7vbDzNTLQk3M7xuzgtWeiPg3ci46PkH/PNq7ZGZbHVaYU0l47wqR2502jFJY caP2ooubPAW2d/4bg7jCAKnIyBlzNwFbxvuL72eIpQ6Y7fkXY8XwB2fzSyGOPbKB2+7dWQ vgr5DKtKrohTSFzYILEtlFNXXkGJsNuVuG3+hftvss8p1okGF3vHwv8nOd/c2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683268740; a=rsa-sha256; cv=none; b=l5a2GF6dlIXTC4A0PY6/T2Glk8UZfnzxjdvKpgi4G6w2AFV6vWgWZPrCA9pGYO+/mgfDGy Mg3X4oA6ZosWS85sqLNGLHhCPJOrPSAyAegQMcG+ic1ZC3U1FA6dLXlXuK8hEmWehp44aN xAoYmb4OjUzbfDboUL+1v7u5BWgHMqy+wKGUlXihfi4rYgjZGxF2INPOtXQXzp00ea0FCy TiG7jcUCx+PhoVyj2MxxM8TKf61+4m4wukxYQ974kLKC8D3Nol8IrTdElPRNXBfROqSoOd iXzJ/Ck0f3VgthGl4SD+qar1p7eghE3pt+fybAeAPC9oBXXqs/sMDMCrHjlw5g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QCLcg6jZszkRJ; Fri, 5 May 2023 06:38:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3456cxD3039558; Fri, 5 May 2023 06:38:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3456cxn6039557; Fri, 5 May 2023 06:38:59 GMT (envelope-from git) Date: Fri, 5 May 2023 06:38:59 GMT Message-Id: <202305050638.3456cxn6039557@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 8ba938472706 - stable/13 - vfs: Rename vfs_emptydir() to vn_dir_check_empty() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 8ba9384727065435f699f29524980c89a9263e12 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8ba9384727065435f699f29524980c89a9263e12 commit 8ba9384727065435f699f29524980c89a9263e12 Author: Olivier Certner AuthorDate: 2023-04-28 09:00:11 +0000 Commit: Konstantin Belousov CommitDate: 2023-05-05 06:20:58 +0000 vfs: Rename vfs_emptydir() to vn_dir_check_empty() (cherry picked from commit 2544b8e00ca1afea64b00a6ddaf7b584244ade90) --- sys/kern/vfs_mount.c | 2 +- sys/kern/vfs_subr.c | 90 --------------------------------------------------- sys/kern/vfs_vnops.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++ sys/sys/vnode.h | 2 +- 4 files changed, 93 insertions(+), 92 deletions(-) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 32d24fb16526..d5b137e7ffab 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -979,7 +979,7 @@ vfs_domount_first( error = ENOTDIR; } if (error == 0 && (fsflags & MNT_EMPTYDIR) != 0) - error = vfs_emptydir(vp); + error = vn_dir_check_empty(vp); if (error == 0) { VI_LOCK(vp); if ((vp->v_iflag & VI_MOUNT) == 0 && vp->v_mountedhere == NULL) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index dbedc16f555b..2002f3b81937 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -6443,96 +6443,6 @@ filt_vfsvnode(struct knote *kn, long hint) return (res); } -/* - * Returns whether the directory is empty or not. - * If it is empty, the return value is 0; otherwise - * the return value is an error value (which may - * be ENOTEMPTY). - */ -int -vfs_emptydir(struct vnode *vp) -{ - struct thread *const td = curthread; - char *dirbuf; - size_t dirbuflen, len; - off_t off; - int eofflag, error; - struct dirent *dp; - struct vattr va; - - ASSERT_VOP_LOCKED(vp, "vfs_emptydir"); - VNASSERT(vp->v_type == VDIR, vp, ("vp is not a directory")); - - error = VOP_GETATTR(vp, &va, td->td_ucred); - if (error != 0) - return (error); - - dirbuflen = max(DEV_BSIZE, GENERIC_MAXDIRSIZ); - if (dirbuflen < va.va_blocksize) - dirbuflen = va.va_blocksize; - dirbuf = malloc(dirbuflen, M_TEMP, M_WAITOK); - - len = 0; - off = 0; - eofflag = 0; - - for (;;) { - error = vn_dir_next_dirent(vp, td, dirbuf, dirbuflen, - &dp, &len, &off, &eofflag); - if (error != 0) - goto end; - - if (len == 0) { - /* EOF */ - error = 0; - goto end; - } - - /* - * Skip whiteouts. Unionfs operates on filesystems only and not - * on hierarchies, so these whiteouts would be shadowed on the - * system hierarchy but not for a union using the filesystem of - * their directories as the upper layer. Additionally, unionfs - * currently transparently exposes union-specific metadata of - * its upper layer, meaning that whiteouts can be seen through - * the union view in empty directories. Taking into account - * these whiteouts would then prevent mounting another - * filesystem on such effectively empty directories. - */ - if (dp->d_type == DT_WHT) - continue; - - /* - * Any file in the directory which is not '.' or '..' indicates - * the directory is not empty. - */ - switch (dp->d_namlen) { - case 2: - if (dp->d_name[1] != '.') { - /* Can't be '..' (nor '.') */ - error = ENOTEMPTY; - goto end; - } - /* FALLTHROUGH */ - case 1: - if (dp->d_name[0] != '.') { - /* Can't be '..' nor '.' */ - error = ENOTEMPTY; - goto end; - } - break; - - default: - error = ENOTEMPTY; - goto end; - } - } - -end: - free(dirbuf, M_TEMP); - return (error); -} - int vfs_read_dirent(struct vop_readdir_args *ap, struct dirent *dp, off_t off) { diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 8ad66be142b2..dfaa6868c567 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -3757,6 +3757,97 @@ out: return (error); } +/* + * Checks whether a directory is empty or not. + * + * If the directory is empty, returns 0, and if it is not, ENOTEMPTY. Other + * values are genuine errors preventing the check. + */ +int +vn_dir_check_empty(struct vnode *vp) +{ + struct thread *const td = curthread; + char *dirbuf; + size_t dirbuflen, len; + off_t off; + int eofflag, error; + struct dirent *dp; + struct vattr va; + + ASSERT_VOP_LOCKED(vp, "vfs_emptydir"); + VNPASS(vp->v_type == VDIR, vp); + + error = VOP_GETATTR(vp, &va, td->td_ucred); + if (error != 0) + return (error); + + dirbuflen = max(DEV_BSIZE, GENERIC_MAXDIRSIZ); + if (dirbuflen < va.va_blocksize) + dirbuflen = va.va_blocksize; + dirbuf = malloc(dirbuflen, M_TEMP, M_WAITOK); + + len = 0; + off = 0; + eofflag = 0; + + for (;;) { + error = vn_dir_next_dirent(vp, td, dirbuf, dirbuflen, + &dp, &len, &off, &eofflag); + if (error != 0) + goto end; + + if (len == 0) { + /* EOF */ + error = 0; + goto end; + } + + /* + * Skip whiteouts. Unionfs operates on filesystems only and + * not on hierarchies, so these whiteouts would be shadowed on + * the system hierarchy but not for a union using the + * filesystem of their directories as the upper layer. + * Additionally, unionfs currently transparently exposes + * union-specific metadata of its upper layer, meaning that + * whiteouts can be seen through the union view in empty + * directories. Taking into account these whiteouts would then + * prevent mounting another filesystem on such effectively + * empty directories. + */ + if (dp->d_type == DT_WHT) + continue; + + /* + * Any file in the directory which is not '.' or '..' indicates + * the directory is not empty. + */ + switch (dp->d_namlen) { + case 2: + if (dp->d_name[1] != '.') { + /* Can't be '..' (nor '.') */ + error = ENOTEMPTY; + goto end; + } + /* FALLTHROUGH */ + case 1: + if (dp->d_name[0] != '.') { + /* Can't be '..' nor '.' */ + error = ENOTEMPTY; + goto end; + } + break; + + default: + error = ENOTEMPTY; + goto end; + } + } + +end: + free(dirbuf, M_TEMP); + return (error); +} + static u_long vn_lock_pair_pause_cnt; SYSCTL_ULONG(_debug, OID_AUTO, vn_lock_pair_pause, CTLFLAG_RD, diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 7b15cb95f63f..543eb06f2f16 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -1099,8 +1099,8 @@ struct dirent; int vn_dir_next_dirent(struct vnode *vp, struct thread *td, char *dirbuf, size_t dirbuflen, struct dirent **dpp, size_t *len, off_t *off, int *eofflag); +int vn_dir_check_empty(struct vnode *vp); int vfs_read_dirent(struct vop_readdir_args *ap, struct dirent *dp, off_t off); -int vfs_emptydir(struct vnode *vp); int vfs_unixify_accmode(accmode_t *accmode); From nobody Sat May 6 00:29:44 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QCpN82LQmz4B0b0; Sat, 6 May 2023 00:29: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 4QCpN81jJQz41b2; Sat, 6 May 2023 00:29:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683332984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a6wPuDNeCFfa/MyIfdT0J3UOznsme0F129zJQO04yAk=; b=KJpPum1kGgTtQyJrCz/El+pkFqB1y9nBGTOfrh33X6ribt2Ix4NQJRglIEZbBxF/24D02r tEtYjI4P1XwqQumuuL6EWHVy3X7ODJ2eURFq/+WFxsH173uvYuPUXR4qMec3hlFhR+j54x w22BhIhAhiJu3jgwrB8EENHw0m8cAjsGacGuEb6LrYzB94IJglU/T2U2XsA9fNCkmJpZ+U I5BGAUOeyki2eABkhyM4k/b6VVRSeMAMc2+xefjxl5KLfkDLuk7mWHlSYwTpn9saAesX87 h/lKJeMBsKUZruIEuQGTFFf44bJKE619wfgAix1SqCZuiD2Hg+hwtp2LkTV3LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683332984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a6wPuDNeCFfa/MyIfdT0J3UOznsme0F129zJQO04yAk=; b=dzTo3hH8kKBWhjfqDENOPfOPx/4PNuvoV6OH57ZQyTxSro2U0fJVaOtefb29dvH9lEzAnW zuzA2kOZ/KGSe+wwziQsCdRmGhGv9kz6ikw1m5GDUazkEKwHQ57VFwo80o9iZJIzMBUF4V PWGa0GSsTbobDCZtKEBnhqCugCdeAnwLgXWO1Av8lRZe4WPg9Hw1KAsTjHS5kwl4DEMcaE lRu4BaoHJXcTcBO4xm+jwgw+Tfj7cZLIs8akHK86arKqNIyyhcCPkBlLkeoWifctuGYn3X G7PWURZvOw7e1aFUZndUaiTB96PMB/wjCKesmI93oTuGzOtR5zc+SU95NctNVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683332984; a=rsa-sha256; cv=none; b=eOytDX7NdBfp7e1aRAOg+3UZDQX1ppgtRw/FowrCSUODfu3mzXunIPoHR7AHE5aBqILzLu wisAGjjSo7fLXrEpG4Di5O13nD0WHSFiOGOWOhRRRGUxSTMeg+Gq5RUb8Ynah+Mh3hd/gp q+Ami2fXLB6hFnbkf7y94bQlYN7rzw52vfQ5T3qkBBUFmibEmVoFb5+1MxgGetozCSs/xu B8I/0Z/GyRNPGuG9ZnAt0NtM5+esLAI1Vkdf0tQdrlQ/z0VIaIOCDMV8Z+to/RXeW9/4f2 C8fDeheCn5IUkWSc2d5hMIKdIns4zRez+ti1lxVwjMZQset1QQEYiBP+ArJ/Yw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QCpN80nvBzGJp; Sat, 6 May 2023 00:29: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 3460Ti1K004364; Sat, 6 May 2023 00:29:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3460TiH2004363; Sat, 6 May 2023 00:29:44 GMT (envelope-from git) Date: Sat, 6 May 2023 00:29:44 GMT Message-Id: <202305060029.3460TiH2004363@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: c6062b358862 - stable/13 - authpf: do not sprintf to a null pointer List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: c6062b3588624371feb24a52c34c8d0674f59f80 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c6062b3588624371feb24a52c34c8d0674f59f80 commit c6062b3588624371feb24a52c34c8d0674f59f80 Author: Ed Maste AuthorDate: 2023-05-03 13:26:42 +0000 Commit: Ed Maste CommitDate: 2023-05-06 00:29:31 +0000 authpf: do not sprintf to a null pointer The fgetln loop will terminate with buf = NULL at EOF. Reported by: GCC Reviewed by: kp MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39947 (cherry picked from commit 81f964e2ffb7cd5d30df0a5c3877900cca4fdd07) --- contrib/pf/authpf/authpf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/contrib/pf/authpf/authpf.c b/contrib/pf/authpf/authpf.c index 4032efb27895..5ffa5b9cfe43 100644 --- a/contrib/pf/authpf/authpf.c +++ b/contrib/pf/authpf/authpf.c @@ -566,9 +566,8 @@ allowed_luser(struct passwd *pw) syslog(LOG_INFO, "denied access to %s: not listed in %s", pw->pw_name, PATH_ALLOWFILE); - /* reuse buf */ - sprintf(buf, "%s", "\n\nSorry, you are not allowed to use this facility!\n"); - fputs(buf, stdout); + fputs("\n\nSorry, you are not allowed to use this facility!\n", + stdout); } fflush(stdout); return (0); From nobody Sat May 6 00:59:21 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QCq2L17Zrz4B1nQ; Sat, 6 May 2023 00:59: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 4QCq2L0Sgsz45DN; Sat, 6 May 2023 00:59:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683334762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7+XMeJ4qTAuovkFK+5aCxpVG89f8H0Q+aWf2pGan+qc=; b=jYm3yCY1LY6lYvGJKj1MEoB4BqIQZEeqhg1fKMTL3mvoCzfGH/tzNUaysIM6xOBTokLGqg ObaM2QuqcrE79AxJVd7lZvIaBf1eqBX0UKARrkYs2C5K/W0uEf/0XHflqCROmjwWdkSiks x5785qra4CV9SlhpWsMNy01m4G3no2V3PTVRgwwpHenuRoa/nF6jzUFwjxC/hzqpUrtdo/ pTly/lfY58QFTmbarHPR/max+h/Q0r3a6JtQuL9W8YK81yHwqWPf23kYpdoItR/gjQh247 zkOnV9a6AX3WDg9TpbWDCN7mOrFDwePGyEKnFyXLRnmJ4U2XeWMD8Pn5hmk5+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683334762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7+XMeJ4qTAuovkFK+5aCxpVG89f8H0Q+aWf2pGan+qc=; b=nUrE7Ar9M4K/cybsyZQwvzVjKknTt3ZlBg36k9OR4kxJVdwiC6oBT7BzQbbNOo2L9A9x97 itS3HVlhn7GBjGCdVfwB+HyNuRc4XydU1UTvlvocaMTvDBQviNZsyzqIR/rDmD9sLkBNxb TvDmS9km6IwDaVD1llLL1E4hcqB1klp9esyv2n3lNd26U8WibwgWiGixmKyk4l+14cH1gq jd9kGWGsPadg59I7imjVObbnkiPEtblbwp/33dsW2tv8T0GvWGSUFT7zy2ONbeKldh03+U 52umpz9+SbrPRCGTkdHo1gHAboFd+wRXcf48pB81hg0Qdb6asrGZ0dxfUa0QRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683334762; a=rsa-sha256; cv=none; b=aWRHEs4B2AXdf9z4q8v7N+x2szigIAj6susx0JuHxB82Vnyqmy1pnw4j+BH/Bia23ZvS94 8FeF2doPyO1HnkdF6TAuFIY4QUkvO7kvY+cDS2K7Abbboi4+YKVJCuZUlDx4puVeKK6AsK xr2qFhA10ZPjy006ddUWG0urcXCgM8KBZYdnp/vIWsfkoMT0bmpw7MgVvB4nkpuyMTCvUo Sk4quLXwbb73yPN/gLLBTjy8tx2hW+Vh3pw41c8uK8YGymAMlWPACn8RHtdzec/T+eKWYA kxLiBUf/OZtnkZcNF746SoEk0GIdCTvVo8Z/poGZakSiPuu+WVeeGyuuteAUsw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QCq2K6YbGzGNf; Sat, 6 May 2023 00:59: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 3460xLFD052702; Sat, 6 May 2023 00:59:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3460xLLw052701; Sat, 6 May 2023 00:59:21 GMT (envelope-from git) Date: Sat, 6 May 2023 00:59:21 GMT Message-Id: <202305060059.3460xLLw052701@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Jason A. Harmening" Subject: git: 651e037e2720 - stable/13 - Intel DMAR: remove parsing of 6-level paging capability List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jah X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 651e037e27207f94c50a3a07d78493c51065da64 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jah: URL: https://cgit.FreeBSD.org/src/commit/?id=651e037e27207f94c50a3a07d78493c51065da64 commit 651e037e27207f94c50a3a07d78493c51065da64 Author: Jason A. Harmening AuthorDate: 2023-05-01 16:22:39 +0000 Commit: Jason A. Harmening CommitDate: 2023-05-06 00:58:41 +0000 Intel DMAR: remove parsing of 6-level paging capability Early versions of the VT-d spec mentioned 6-level paging support as a possible value for the SAGAW capability, but later versions removed it and SAGAW=0x10 is currently listed as a reserved value. The 6-level (agaw=64) entry in sagaw_bits is furthermore problematic with clang15 because the attempted comparison against 1ULL << 64 in dmar_maxaddr2mgaw() causes the compiler to elide the last iteration of the initial loop, which bypasses the subsequent logic to find the greatest HW-supported address width. This results in 5-level paging always being selected regardless of whether the hardware supports it, which can result address translation failure due to invalid context- entry programming. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D39896 (cherry picked from commit 6f378116e9bf982b8246d033d81cb64d52b24462) --- sys/x86/iommu/intel_utils.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/x86/iommu/intel_utils.c b/sys/x86/iommu/intel_utils.c index 152c7cac3a7d..315ffc8d4160 100644 --- a/sys/x86/iommu/intel_utils.c +++ b/sys/x86/iommu/intel_utils.c @@ -99,9 +99,14 @@ static const struct sagaw_bits_tag { {.agaw = 48, .cap = DMAR_CAP_SAGAW_4LVL, .awlvl = DMAR_CTX2_AW_4LVL, .pglvl = 4}, {.agaw = 57, .cap = DMAR_CAP_SAGAW_5LVL, .awlvl = DMAR_CTX2_AW_5LVL, - .pglvl = 5}, - {.agaw = 64, .cap = DMAR_CAP_SAGAW_6LVL, .awlvl = DMAR_CTX2_AW_6LVL, - .pglvl = 6} + .pglvl = 5} + /* + * 6-level paging (DMAR_CAP_SAGAW_6LVL) is not supported on any + * current VT-d hardware and its SAGAW field value is listed as + * reserved in the VT-d spec. If support is added in the future, + * this structure and the logic in dmar_maxaddr2mgaw() will need + * to change to avoid attempted comparison against 1ULL << 64. + */ }; bool From nobody Sat May 6 01:13:48 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QCqM03R9Cz4B2hr; Sat, 6 May 2023 01:13: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 4QCqM02yzlz46pm; Sat, 6 May 2023 01:13:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683335628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RoU0voeTlgkbr7xISTjvxTJRV517U6oDdddmnfBtsYI=; b=yEFp7uJ6txg9MxJzWgeIf4XV0C2puXkIDQyDxG2vqI2gw3piSGV6gXv5IIucXE/mhZ1VOy eepCvdXB1om49bHQTRr0u06f/EVNeIWm9Mv0tMlm7Dve6dXnA6+xvRyVnQBtA+5pFzv6oL gnMbJWH0e9dQXr+UmQt9r11vyXPK932OZ1/EHys5j0gVXriOlO6xtQ7gOsI62aaOlN5yjs HeM3KtuD+0DCICsyh7UzNzjl1zA+A42cj3Qn0lMOLshtwBIKk+PcJF3JiLS0HK/moGvYMj bXZjWWM1WgiOtsONbiKuPkLh3KNH6o08xeeXIvPNNOG5B1aMlpNQOuWMWgZuEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683335628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RoU0voeTlgkbr7xISTjvxTJRV517U6oDdddmnfBtsYI=; b=bwl16izwx4OrhY3Vyk/ZBRvQS1YIhDT+OAgYq6fpA1R3sCwYhxMHnXjMLzZlIPaK19Dk5G vnWp3eXQHe7piYIcdAzI9XEiNNzKJ/OrMCivHJyWTXXhbBenm/OZkIUeISbjYLWJqBD+Eu V12mYtT865jXiWPgYYWyf8zOY2SvTgWd5SOSVjaMuzuxfOvd/hCaWvEiht62grWCFLH5ie SrCn4wddS1jZMcG1GGDqOKW9PbGeUghPRbX60jHobW7USqk0EkZD9GHB5sLj8PfyMQK7km lbFxMERlg/YeIJvMzaQwASwRjJsl1Dh+qg1xfNgpuBRDTKvvdbqc/9XCVmveMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683335628; a=rsa-sha256; cv=none; b=RhZ2VhQouOLNkyeK0OJ0/gpUJlahPnnfyfLhf0up6ri2gcWEfiJagYkBiOHjW/XoZ2L5Ox ybSAngFMpnP7ZWWC2aoY6KfheLvGLIqaMTpOaT1cQH2ZH4zRCNzhcvMjZfzhOFd1uha7jL XbCSBdCVVTEzvm0mfqo4up1NTx8PRRbyDNIa0vjXY6UmIVdgzKG4grkFIr+AxCSJ4iEcSt o2KQo2K/m/ZR6XMCOBF++ak1sGlFft9wJlS0xxsqLeTRxUM/HCMIJC2eY0K2wfTxJ8suWU e9Co3OApgiGfK8vTR94HZGYgnbSayNKDRm5r5+kyjXIqQk97WMhhV/hzJ4tx6Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QCqM023Z5zH9x; Sat, 6 May 2023 01:13: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 3461DmMZ085283; Sat, 6 May 2023 01:13:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3461DmcL085282; Sat, 6 May 2023 01:13:48 GMT (envelope-from git) Date: Sat, 6 May 2023 01:13:48 GMT Message-Id: <202305060113.3461DmcL085282@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Jason A. Harmening" Subject: git: 95e02a419224 - stable/12 - Intel DMAR: remove parsing of 6-level paging capability List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jah X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 95e02a41922437f0d616f9b61dfff5605ad7c601 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by jah: URL: https://cgit.FreeBSD.org/src/commit/?id=95e02a41922437f0d616f9b61dfff5605ad7c601 commit 95e02a41922437f0d616f9b61dfff5605ad7c601 Author: Jason A. Harmening AuthorDate: 2023-05-01 16:22:39 +0000 Commit: Jason A. Harmening CommitDate: 2023-05-06 01:00:34 +0000 Intel DMAR: remove parsing of 6-level paging capability Early versions of the VT-d spec mentioned 6-level paging support as a possible value for the SAGAW capability, but later versions removed it and SAGAW=0x10 is currently listed as a reserved value. The 6-level (agaw=64) entry in sagaw_bits is furthermore problematic with clang15 because the attempted comparison against 1ULL << 64 in dmar_maxaddr2mgaw() causes the compiler to elide the last iteration of the initial loop, which bypasses the subsequent logic to find the greatest HW-supported address width. This results in 5-level paging always being selected regardless of whether the hardware supports it, which can result address translation failure due to invalid context- entry programming. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D39896 (cherry picked from commit 6f378116e9bf982b8246d033d81cb64d52b24462) --- sys/x86/iommu/intel_utils.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/x86/iommu/intel_utils.c b/sys/x86/iommu/intel_utils.c index dd46c4290527..9e9c59d98fd0 100644 --- a/sys/x86/iommu/intel_utils.c +++ b/sys/x86/iommu/intel_utils.c @@ -100,9 +100,14 @@ static const struct sagaw_bits_tag { {.agaw = 48, .cap = DMAR_CAP_SAGAW_4LVL, .awlvl = DMAR_CTX2_AW_4LVL, .pglvl = 4}, {.agaw = 57, .cap = DMAR_CAP_SAGAW_5LVL, .awlvl = DMAR_CTX2_AW_5LVL, - .pglvl = 5}, - {.agaw = 64, .cap = DMAR_CAP_SAGAW_6LVL, .awlvl = DMAR_CTX2_AW_6LVL, - .pglvl = 6} + .pglvl = 5} + /* + * 6-level paging (DMAR_CAP_SAGAW_6LVL) is not supported on any + * current VT-d hardware and its SAGAW field value is listed as + * reserved in the VT-d spec. If support is added in the future, + * this structure and the logic in dmar_maxaddr2mgaw() will need + * to change to avoid attempted comparison against 1ULL << 64. + */ }; bool From nobody Sat May 6 14:42:44 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QD9JP0bfYz49gsJ; Sat, 6 May 2023 14:42: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 4QD9JN75Mnz4NM9; Sat, 6 May 2023 14:42:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683384165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PQKpI432RbKV0My+LqohRLxDQ2Q4vVP1/nA7vOO2laE=; b=DzSGiPc0iXyupkm352SOYNirCmXdlmOtnYRAKXvHFZOOYDRZW/iuH/f95m2wSfBD9ohrql 9mm/vde6q4RIg1/9RmbdXZScLco00IqqGMfYzD+H2crmagdti+3m/8jGDQDkR5dD/lz92r 67Q7RfW/qFmDBkYjmkdr6xYlC3LrTguiYDO4CqS6a07rUmQrhQt0KxMKUzLQ3tjWtpbdE8 PitEU1qyhcEfJSQUeg0S5vLm9IDIss/9oDV7qErVMYl/scB54zyDaS7Z2BeffkOglOG8Nx WtlJRoSm8HG3v+b1nIvHMXx/MXmEMJh3C7Zu3C7iv5j1NqyjqTccrlx+bOI0fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683384165; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PQKpI432RbKV0My+LqohRLxDQ2Q4vVP1/nA7vOO2laE=; b=Zda/eBeFi3dB5xHPpekNcr3YtFHAdBVygwyWZyZ2EF2Sv6CKvPf3o5sZJcfC+ch2HIgqfx /G/sutoBMTZEwuzSNVZeRG2IAP928ePyvP2oGi73ems+l9T1ZCYRyREoTY6ufIgbv5oJhL +fpVJqHW7/egkHVPfCi4Ijt3iFO+cobT+vrD9ooZz1uzBcBWtj3WPOjTPk78Fnsn1B4Dg9 ejcRKlr9fSGVP0qzE4n4hgVRqOn8KxcX17jXCQvSB02wx9CveM+QL8lEZn1xhYcBpUiMRg 7QhYjgAxZ99nZ2DlCvlu5CeT5Z00JiUSgKTg+IPdtg+WF+a/v3U9hZGlb+alWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683384165; a=rsa-sha256; cv=none; b=MKlZoikj+7yfDgg1PGxd96UAv7riS92HFZmX4lGO4xFzs6911jkvhRk2ruTvEP1nOv8kPA KKmP+gCvu3KjAjpATWbDfPG+uw8n+wqfv5dB3XmFjPXeoM2jPE1U07dDv4xjYkkypZ43Ad xbjQ1RQDSUWoiWMZvSLz3ESszVAz+S2UJPEsLdbc09y310w51liD3QZF6xh7Fvvt8KxfO7 QngNIuevyot5Fx48dAVPi4IfDzBSSpmMLfVOXmi4kJZKSaLE2xarcYo7VwuYqwixRN4F3h KwriB1Grwo69RSQ/F4ShG1HSPnjO38qohRqpJTYgOegg0xAg7sKhL5SmyN6dOg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QD9JN6BXMzgJm; Sat, 6 May 2023 14:42: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 346EgiLK020056; Sat, 6 May 2023 14:42:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 346EgitV020055; Sat, 6 May 2023 14:42:44 GMT (envelope-from git) Date: Sat, 6 May 2023 14:42:44 GMT Message-Id: <202305061442.346EgitV020055@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: 7c067d5b823d - stable/13 - renice: Avoid segfault if -n flag is given without argument. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7c067d5b823d34d22bbaa9e1f1dd16fdb99fbc2d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=7c067d5b823d34d22bbaa9e1f1dd16fdb99fbc2d commit 7c067d5b823d34d22bbaa9e1f1dd16fdb99fbc2d Author: Dag-Erling Smørgrav AuthorDate: 2023-04-17 19:49:13 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-05-06 13:14:01 +0000 renice: Avoid segfault if -n flag is given without argument. Fixes: 65ee0a8495538 MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D39623 (cherry picked from commit b03311cadd3a6f931e176f97b97bd72be3ef96d4) renice: Clean up the tests. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D39629 (cherry picked from commit d59dd30cf19bb6df5635b3c896c7c4262917a9b6) renice: Factor out common code in tests. Furthermore, prefer test -eq (which ignores whitespace) over a strict string equality test when comparing numerical values. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: thj Differential Revision: https://reviews.freebsd.org/D39650 (cherry picked from commit 1bc6dcc287fa80af74768c4e2b2a1d7511ba1729) --- usr.bin/renice/renice.c | 2 +- usr.bin/renice/tests/renice_test.sh | 92 +++++++++++++++++++------------------ 2 files changed, 49 insertions(+), 45 deletions(-) diff --git a/usr.bin/renice/renice.c b/usr.bin/renice/renice.c index 890d7043ebbd..42e93cce240e 100644 --- a/usr.bin/renice/renice.c +++ b/usr.bin/renice/renice.c @@ -94,7 +94,7 @@ main(int argc, char *argv[]) } if (strcmp(*argv, "-n") == 0) { /* may occur only once, prior to priority */ - if (haveprio || incr) + if (haveprio || incr || argc < 2) usage(); incr = true; (void)argc--, argv++; diff --git a/usr.bin/renice/tests/renice_test.sh b/usr.bin/renice/tests/renice_test.sh old mode 100644 new mode 100755 index 323fe44591c8..feb07a6af825 --- a/usr.bin/renice/tests/renice_test.sh +++ b/usr.bin/renice/tests/renice_test.sh @@ -1,28 +1,7 @@ -#!/bin/sh -#- -# Copyright (c) 2022 Klara, Inc. -# All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. +# Copyright (c) 2022-2023 Klara, Inc. # -# 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. +# SPDX-License-Identifier: BSD-2-Clause # # Name of user to use for -u tests when running as root. Beware that @@ -33,8 +12,16 @@ _renice() { atf_check -o empty -e ignore -s exit:0 renice "$@" } -# Set a process's nice number to an absolute value +atf_check_nice_value() { + local pid=$1 + local nice=$2 + atf_check test "$(ps -o nice= -p $pid)" -eq "$nice" +} + atf_test_case renice_abs_pid +renice_abs_pid_head() { + atf_set "descr" "Set a process's nice number to an absolute value" +} renice_abs_pid_body() { local pid nice incr sleep 60 & @@ -42,12 +29,14 @@ renice_abs_pid_body() { nice="$(ps -o nice= -p $pid)" incr=3 _renice $((nice+incr)) $pid - atf_check_equal $((nice+incr)) "$(ps -o nice= -p $pid)" + atf_check_nice_value $pid $((nice+incr)) kill $pid } -# Change a process's nice number by a relative value atf_test_case renice_rel_pid +renice_rel_pid_head() { + atf_set "descr" "Change a process's nice number by a relative value" +} renice_rel_pid_body() { local pid nice incr sleep 60 & @@ -57,12 +46,14 @@ renice_rel_pid_body() { _renice -n $incr $pid _renice -p -n $incr $pid _renice -n $incr -p $pid - atf_check_equal $((nice+incr+incr+incr)) "$(ps -o nice= -p $pid)" + atf_check_nice_value $pid $((nice+incr+incr+incr)) kill $pid } -# Set a process group's nice number to an absolute value atf_test_case renice_abs_pgid +renice_abs_pgid_head() { + atf_set "descr" "Set a process group's nice number to an absolute value" +} renice_abs_pgid_body() { local pid pgid nice incr # make sure target runs in a different pgrp than ours @@ -71,12 +62,14 @@ renice_abs_pgid_body() { nice="$(ps -o nice= -p $pid)" incr=3 _renice $((nice+incr)) -g $pgid - atf_check_equal $((nice+incr)) "$(ps -o nice= -p $pid)" + atf_check_nice_value $pid $((nice+incr)) kill $pid } -# Change a process group's nice number by a relative value atf_test_case renice_rel_pgid +renice_rel_pgid_head() { + atf_set "descr" "Change a process group's nice number by a relative value" +} renice_rel_pgid_body() { local pid pgid nice incr # make sure target runs in a different pgrp than ours @@ -86,13 +79,13 @@ renice_rel_pgid_body() { incr=3 _renice -g -n $incr $pgid _renice -n $incr -g $pgid - atf_check_equal $((nice+incr+incr)) "$(ps -o nice= -p $pid)" + atf_check_nice_value $pid $((nice+incr+incr)) kill $pid } -# Set a user's processes' nice numbers to an absolute value atf_test_case renice_abs_user renice_abs_user_head() { + atf_set "descr" "Set a user's processes' nice numbers to an absolute value" atf_set "require.user" "root" } renice_abs_user_body() { @@ -101,13 +94,13 @@ renice_abs_user_body() { nice="$(ps -o nice= -p $pid)" incr=3 _renice $((nice+incr)) -u $TEST_USER - atf_check_equal $((nice+incr)) "$(ps -o nice= -p $pid)" + atf_check_nice_value $pid $((nice+incr)) kill $pid } -# Change a user's processes' nice numbers by a relative value atf_test_case renice_rel_user renice_rel_user_head() { + atf_set "descr" "Change a user's processes' nice numbers by a relative value" atf_set "require.user" "root" } renice_rel_user_body() { @@ -117,12 +110,14 @@ renice_rel_user_body() { incr=3 _renice -u -n $incr $TEST_USER _renice -n $incr -u $TEST_USER - atf_check_equal $((nice+incr+incr)) "$(ps -o nice= -p $pid)" + atf_check_nice_value $pid $((nice+incr+incr)) kill $pid } -# Test various delimiter positions atf_test_case renice_delim +renice_delim_head() { + atf_set "descr" "Test various delimiter positions" +} renice_delim_body() { local pid nice incr sleep 60 & @@ -132,32 +127,40 @@ renice_delim_body() { # without -p : $((incr=incr+1)) _renice -- $((nice+incr)) $pid - atf_check_equal $((nice+incr)) "$(ps -o nice= -p $pid)" + atf_check_nice_value $pid $((nice+incr)) : $((incr=incr+1)) _renice $((nice+incr)) -- $pid - atf_check_equal $((nice+incr)) "$(ps -o nice= -p $pid)" + atf_check_nice_value $pid $((nice+incr)) : $((incr=incr+1)) _renice $((nice+incr)) $pid -- - atf_check_equal $((nice+incr)) "$(ps -o nice= -p $pid)" + atf_check_nice_value $pid $((nice+incr)) # with -p : $((incr=incr+1)) _renice -p -- $((nice+incr)) $pid - atf_check_equal $((nice+incr)) "$(ps -o nice= -p $pid)" + atf_check_nice_value $pid $((nice+incr)) : $((incr=incr+1)) _renice -p $((nice+incr)) -- $pid - atf_check_equal $((nice+incr)) "$(ps -o nice= -p $pid)" + atf_check_nice_value $pid $((nice+incr)) : $((incr=incr+1)) _renice -p $((nice+incr)) $pid -- - atf_check_equal $((nice+incr)) "$(ps -o nice= -p $pid)" + atf_check_nice_value $pid $((nice+incr)) : $((incr=incr+1)) _renice $((nice+incr)) -p -- $pid - atf_check_equal $((nice+incr)) "$(ps -o nice= -p $pid)" + atf_check_nice_value $pid $((nice+incr)) : $((incr=incr+1)) _renice $((nice+incr)) -p $pid -- - atf_check_equal $((nice+incr)) "$(ps -o nice= -p $pid)" + atf_check_nice_value $pid $((nice+incr)) kill $pid } +atf_test_case renice_incr_noarg +renice_incr_noarg_head() { + atf_set "descr" "Do not segfault if -n is given without an argument" +} +renice_incr_noarg_body() { + atf_check -o empty -e ignore -s exit:1 renice -n +} + atf_init_test_cases() { atf_add_test_case renice_abs_pid atf_add_test_case renice_rel_pid @@ -166,4 +169,5 @@ atf_init_test_cases() { atf_add_test_case renice_abs_user atf_add_test_case renice_rel_user atf_add_test_case renice_delim + atf_add_test_case renice_incr_noarg } From nobody Sat May 6 18:55:52 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QDGwT19Xgz48yGx; Sat, 6 May 2023 18:55:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QDGwT0Y7Rz3jG3; Sat, 6 May 2023 18:55:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683399353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Uy/XFeEGlehM0/4vUhVc3s6a6VC1FCWNezy3mKVLc8=; b=TJwuoIlBNYXKsLnGIel60L7hm2m49N8J3rTqqiWvhc1XdMMMNjHHUkwbNn+NZ47D1PlIzX xnveEScC/PES+0ZGXs0pmdwHb4twm0TfwdN3fnuh3XFgaSWyPX7aNmxEEjKXozKw1vBVRd kvx8rFsyvEUPz8lFQ/gUz520bEnMRODIA7HwP7cV8NDJmMjXG+xT27Y6TTjKOPedGZBMB6 C8RlOOrAQsTPGBh5rOhHa/eJAZeqtUAz4lHbtetyF6EIXUmKPvGAcooZ/QB4BiziCQ6V6J LTKEl20wiVH3sk8FGLL6X0fXTLNoFouBch1yTmt5llTuT8qTmez9HzS7nvMY9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683399353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Uy/XFeEGlehM0/4vUhVc3s6a6VC1FCWNezy3mKVLc8=; b=M1QTZ66Pyj3iP+p3dez1ST6Rqf93yQ1xzxuNbQdc7rqfPF+EUgyK6FPb0Jjwc0vQMv1iZA ycDCCZjgECF5zA9Lqr8EXcfWzFn5BBCso4rAked/c0a4s7+pqxAhqy0A5lim5nR8wuktEL UgXE0yqpVf3fkTxUuB43ZJPHMNif3pnLgrUW0urjhro0vfhD4Iworq9hHfFz2ncNEph/bP 1G22/rK1aaVjbdNNNH3GSlPmGlaJj1gc4J8gk4GNIrFm2Bgp77olikwKMOIyqS8h+ooE1c MYUwtFRgwysM8jngJTLD/Iav42T7dSAaNRN3Y0SrpVrnCCxotamiUWDs4tzvyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683399353; a=rsa-sha256; cv=none; b=anvRibZJ4noH3fDE5YlOCowDbrlOuwC5kUHldB9OqfiBcFaROQ0Nog8g8xioJeQ4xa89J9 PaDxubnl5EChmwv1LMg7xUWVJKKkpqCP/dNPNBhyv11ByQ5EwdnI/vapeojTp3z7Bv4faW gVw5cQoopkIpbuIWG84F1MPMnsHIm9VUI7m5F90u6+/+5YTy2A1+xQqYi5mmqy3Sjcn2FS 02b2yGdPCyU+0vtAQwIfgsQCt9JcNnJDLkbeArsKoCSIvn9foXyfFneIqFGGzaMr15ESSS ZXfpXyZI/zxY7Cj+v3cqwJ55CtfX8R91NPpx2V9KgHEvUPzBaC0pk9+DEXIsyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QDGwS6hWkznw2; Sat, 6 May 2023 18:55: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 346Itqa3032643; Sat, 6 May 2023 18:55:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 346Itqoq032642; Sat, 6 May 2023 18:55:52 GMT (envelope-from git) Date: Sat, 6 May 2023 18:55:52 GMT Message-Id: <202305061855.346Itqoq032642@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 899ba534a50a - stable/13 - release: Report disk image filename List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 899ba534a50a82ef994c9b9034e6efbe0cb70832 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=899ba534a50a82ef994c9b9034e6efbe0cb70832 commit 899ba534a50a82ef994c9b9034e6efbe0cb70832 Author: Ed Maste AuthorDate: 2022-05-16 18:37:21 +0000 Commit: Ed Maste CommitDate: 2023-05-06 18:55:33 +0000 release: Report disk image filename For someone new to the release bits it's not always clear what files are being created. Report the disk image name explicitly. Reviewed by: gjb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39953 (cherry picked from commit 4194bbb34c60a5bf0fd0ba28f7bfa20b7842ba3f) --- release/tools/vmimage.subr | 2 ++ 1 file changed, 2 insertions(+) diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr index 6e0c1ea633e2..bd592c94ec38 100644 --- a/release/tools/vmimage.subr +++ b/release/tools/vmimage.subr @@ -251,6 +251,8 @@ vm_create_disk() { ${ROOTFSPART} \ -o ${VMIMAGE} + echo "Disk image ${VMIMAGE} created." + if [ ${ESP} = "yes" ]; then rm ${espfilename} fi From nobody Sat May 6 18:55:53 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QDGwV1msnz48yGy; Sat, 6 May 2023 18:55:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QDGwV1JFVz3jVM; Sat, 6 May 2023 18:55:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683399354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E7dnJG9zkUGeurMAqPHaBTg+ETATJ2OrVFn3AGnbI3o=; b=koLtXq8YaWmw+ZbT0n1DaE392o3VfwfKLF24DxI7SxvoH1RK/lHSmJL9TSsZvoZ0JcHWPc Wyb1lPJI8iARAkb1Z8/QfJtUvnZvpSP8nTuekRXnrTS0Nbk/ukPh5NhZaJQMcEvETy2aXP I+fsUSlX4piWmT6gO/gfQcterCzD4fAiG4zI2R40P1BCsX2tr0hnqwek939nAdf2eFsyt3 4kBt7S96leX7mEXS8ABXPLDe6wT51H6/awT19WhaE8pHzKYN/Lx440PRgrHULBqI9auVav ZCiOKiI0yljwBbWk3BTukDEXUZfvBTLpWmFP1yI01zD2r9teX4g9t/7OanuLjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683399354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E7dnJG9zkUGeurMAqPHaBTg+ETATJ2OrVFn3AGnbI3o=; b=Oy1Ee+D2ifFRfzIe029iywAYLUA4BXQMdXh01pXn4YyRkrCfwKBSj02Nr2GrRib7ITdKBO Ml8pADs1TbMPPXPdYdYfN+sygE020t4NV4gYjbSjr/aEr5pQXmUJigYPfQLi2CSzdW+dwk CK/2SRkycJcuEczEivpqSVoKkVICPPjeWRyzJMbQyu1zNDR6hSXgWQwtmlKgJubkWxDAlI 9KBN20G7OIh05P9YFXFuY3agizZARmKoc9en42IrlxEboUQGMjfxETvMhoSJSKlLEJdHhF kqZPmRhWsj/xpiH+7jCVuiKLq26NVJzw/9cJO32utpLmlVbXtv4c5b/hwYq+MQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683399354; a=rsa-sha256; cv=none; b=QYTCnYU03q/8lz4t7QlMn6Ho28gF8OvQZhlXwLorFzRNWTViwSLloNUf6yWcKR2Ys4vQ37 x7xeRA7oGcjwdYkPOyz4Z6cAkkoanJz5rNRYhZ+jAS5IPHAuCe6RnOuoKk9UG2UTT5UVMU rnuZkhrPRJaejKxiqkV25j0csZoJV0k7rACqyt+HprLvgRuCJVAhHbJ6WeweT5+/4nVpM1 uxUtzPo2r1nRmED+VzXTKr84CHS0Bhpor+LMw4WOLbsyeOluKTeDghhwZrIji63rg+FJPu rfVZEon9XkqUQhEHL0rtm6sLnFzFgnpUCb1CxdNHeHPFfnHLoYnE8mMQZpsd3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QDGwV0NvLznLx; Sat, 6 May 2023 18:55:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 346Itrx0032671; Sat, 6 May 2023 18:55:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 346Itrtj032670; Sat, 6 May 2023 18:55:53 GMT (envelope-from git) Date: Sat, 6 May 2023 18:55:53 GMT Message-Id: <202305061855.346Itrtj032670@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: a0ef7a056027 - stable/13 - src.conf: add WITH_TOOLCHAIN description List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: a0ef7a056027d2046efaad8fa8a038475bcaba52 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a0ef7a056027d2046efaad8fa8a038475bcaba52 commit a0ef7a056027d2046efaad8fa8a038475bcaba52 Author: Ed Maste AuthorDate: 2023-05-02 17:27:18 +0000 Commit: Ed Maste CommitDate: 2023-05-06 18:55:33 +0000 src.conf: add WITH_TOOLCHAIN description It is not used by the in-tree default configuration, but adding it allows downstream projects with different defaults to make use of Cirrus-CI (as the makeman test added in 85e8c2a03490 requires that there are no missing option descriptions). Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39936 (cherry picked from commit fc2e2c950d97166ab32ca24134a37986ccaf94ab) --- tools/build/options/WITH_TOOLCHAIN | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/build/options/WITH_TOOLCHAIN b/tools/build/options/WITH_TOOLCHAIN new file mode 100644 index 000000000000..62624bf9e28b --- /dev/null +++ b/tools/build/options/WITH_TOOLCHAIN @@ -0,0 +1,2 @@ +Install programs used for software development such as +compilers, debuggers, linkers etc.