From nobody Sun May 21 00:31:57 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QP1jn29F4z4BlHH; Sun, 21 May 2023 00:31: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 4QP1jn1VT9z4RC5; Sun, 21 May 2023 00:31:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684629117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3INFTuNjDd4yDjiUVElNJ3FF6D7XgW8IjFAQW21GBUo=; b=LDbgQbWoDeW/4UuCCVQ7JIsYSSt4ix9hO+IvYP6ak9DA6IQUY7u2qastsrC3DTWL8Mn/Yq 8hTzBDTNpOlh2dVGO8ozOx4Y9lrRWcihHGbATfn9D8yV6i20NyhMP1fJ6Sl+F1+W2Fw+zA RQpDhcrImsQ/ivdRPerpBsALvZbplDn3iRust2xb8UNkKuWVdXuPnaFUeozk5AH2R4gxOQ prD/Is+A0XYWJsGJNasNwjkE/LehZZaFciqjSLNU6dFS+v98RYzVfKW2jFqWs6Yp/zcr79 Goe6j+MKgvpmRaxBktiHoolVFcmNirCRy19i1Y6jxQHw5g7PVUGshsilYkgBxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684629117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3INFTuNjDd4yDjiUVElNJ3FF6D7XgW8IjFAQW21GBUo=; b=Ziq6abyCRijqOQi+Nkp2gprrFS+/fhSQtHJ9eCSbiauUzW8ZNI2KJ/H/o0dQ6SjEjhA7vl gc8RHb/Y1pP02CwOhBqC9/aGYwNl4ma14y8ovn5+FTwMFMz1MbC3FhYZz/L+SWMnfcKr/v dg3ai4GLKlxGXU973Pw9J3BBfQmqUy9Nr1w6CvjiE05HvzJhnz7DxRpnMdcrMUtFM0GW+x 7FQq3xrRMLYdg2czWnhw50NvQ71jHOQsj4vw6aCtZI9Q2F20Cc7ZupMGzYcCEIq3pVWttd 3WFYVAyrskXubtZDZavSOdHU5TC0XBbn1qdrjJvwP8adBA5aapKadTsrJ5NcOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684629117; a=rsa-sha256; cv=none; b=aMqfWQU2GEsK7BfwQWsViEk+bj6Bi+yM7C0pUj3YoywgoHhM299raGzgh9iKb1sQa+yEhM H7Z0imHq0sYtmIbTicJuCYPwtnMtEY+gnJDC+GgF9kgYksZ7h7sHntPPzgy9PfZMIrYGyo bkv7x6bk3/dQVj5Hkzkga2OT0TtH7zmWOYVQ8f04FIaMtEDzoXP0liWGmlznkmArWzy2s+ sOhkMXuhwLUErFZxF3yuavkGOR0yqCxGTIBqRf9q4DrIqTtSG0qL1z9U38kYswz8tNryZN 7iBKWUuohzq8EcsrjnekyyB8GqYcssSgCbr5AkmQP1+//E/AvnaluZrhqQgosA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QP1jn0YNGzWRV; Sun, 21 May 2023 00:31: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 34L0VvHi095205; Sun, 21 May 2023 00:31:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34L0Vv2m095204; Sun, 21 May 2023 00:31:57 GMT (envelope-from git) Date: Sun, 21 May 2023 00:31:57 GMT Message-Id: <202305210031.34L0Vv2m095204@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 525dd4acaacc - main - LinuxKPI: implement pci_rescan_bus() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 525dd4acaacc59b815131caccfdebc905d4d7bff Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=525dd4acaacc59b815131caccfdebc905d4d7bff commit 525dd4acaacc59b815131caccfdebc905d4d7bff Author: Bjoern A. Zeeb AuthorDate: 2023-05-16 20:59:30 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-05-21 00:31:25 +0000 LinuxKPI: implement pci_rescan_bus() Try to implement pci_rescan_bus(). pci_rescan_method() is already doing most of the job. We only have to do the count for the return value again ourselves. Sponsored by: The FreeBSD Foundation MFC after: 10 days Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D40122 --- sys/compat/linuxkpi/common/include/linux/pci.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 9b2e9269d4d4..cc8dbe2fef11 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -260,6 +260,7 @@ struct pci_driver { struct pci_bus { struct pci_dev *self; + /* struct pci_bus *parent */ int domain; int number; }; @@ -1411,6 +1412,29 @@ pci_stop_and_remove_bus_device(struct pci_dev *pdev) { } +static inline int +pci_rescan_bus(struct pci_bus *pbus) +{ + device_t *devlist, parent; + int devcount, error; + + if (!device_is_attached(pbus->self->dev.bsddev)) + return (0); + /* pci_rescan_method() will work on the pcib (parent). */ + error = BUS_RESCAN(pbus->self->dev.bsddev); + if (error != 0) + return (0); + + parent = device_get_parent(pbus->self->dev.bsddev); + error = device_get_children(parent, &devlist, &devcount); + if (error != 0) + return (0); + if (devcount != 0) + free(devlist, M_TEMP); + + return (devcount); +} + /* * The following functions can be used to attach/detach the LinuxKPI's * PCI device runtime. The pci_driver and pci_device_id pointer is From nobody Sun May 21 05:20:28 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QP86h6m0Cz4C326; Sun, 21 May 2023 05:20: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 4QP86h61Tdz3M6b; Sun, 21 May 2023 05:20:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684646428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YbUUkOHDwfnrfy20HzMBMX1CRbS3ibO1tRwJZIK0+OI=; b=jADFCg01CvMmv3q6Shc4Il9f7mkTqYo6rwLCcdXdpunSO0rZXpwABk08dTtwqD2ujksxcD RkbOfOvlwfiq8lkqYHbuwmq5GJiMx4fxM4pFFimSILMIkZd9mP8y0dbPCof8FoO9EoiMqR Ag7bnIxJ/Z3iNaNh183lVlbRB+NfQl3nHkbb61n8GHHT+C1Tga7JkES9GoUodGFH3WtFG6 cbcWfIK3/pzKuVR5QuxnWtG5RwG3RfbFXi2s3EVZSWigzQCP6Nu+gPkqQHIuxwKzN2wW9a PJdOC0CeVFtzflkUvHQ1HZwGMcDccrAtjVGb6cid//xAsjk8lt5ftIfHxxhNRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684646428; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YbUUkOHDwfnrfy20HzMBMX1CRbS3ibO1tRwJZIK0+OI=; b=mu8+kkCjrXcUrCjIHgvuS+o2eQ0UdgQhqIdj3Rkqgqc4g9i2mHhe9yDHOQE9AzbBsq7Duq XjirENTnyyPdYuYBdSDzqIxf01s5fGy3cm4oCrRythElW131ZIH0VE29LeTctpdQf+ixtf lLH0MwK7hm4LosN9v4tyL4MTdMa+3DntI3N0jet55ZIYPKbg7wD1f5NMLpJ687n6zN5hEK NyCCPSMMBh0BiPziUaaUEL42Qc3IxUCr/BPj0g8XEeQQolkIfyXU8V+Mikpmm57yWdq9tG tjYaXbv9KikRsIU5Ze5YFza7uut5eKr1aVIkSj+yetzx/lnCR0MbLhOM+967Ew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684646428; a=rsa-sha256; cv=none; b=ZxACAWdgEWGc8nudUtdL+LQ3tc7bSeF+EKG6a5mnutoW9sUqDWdmxzhGd2c+kR++/udw4H /V8w+jrwvy820aK2o9V2FYvdl0uzNJFCKWm7I8R3JkIZ37KUePm2jfT69mFCJ86qPsocGi 9wtAnJ9oRL6pQAUhZBvUWoaqZcomuu9pE4PIE262RUi2mIbrFdgleR2Seb03UizAi+ImmF bpbFqPMs5lGt147HSdYGlsSLtcEoez3TwSEAHo9/BqUAyewBzotKYDhiwmtw31noUhiXXR +YCHgjEFs/NcE5JPIlq46+PbKH3+kuS5l20W2N26A65KYMXeu7Tf09i4lnScPg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QP86h53p3zfGh; Sun, 21 May 2023 05:20: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 34L5KSOZ071916; Sun, 21 May 2023 05:20:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34L5KSqR071915; Sun, 21 May 2023 05:20:28 GMT (envelope-from git) Date: Sun, 21 May 2023 05:20:28 GMT Message-Id: <202305210520.34L5KSqR071915@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Fedor Uporov Subject: git: 50be18cc77b2 - main - ext2fs: Add large sectorsize disks support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 50be18cc77b25891306f64192bf6f75e55d8903c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fsu: URL: https://cgit.FreeBSD.org/src/commit/?id=50be18cc77b25891306f64192bf6f75e55d8903c commit 50be18cc77b25891306f64192bf6f75e55d8903c Author: Fedor Uporov AuthorDate: 2023-05-08 16:14:02 +0000 Commit: Fedor Uporov CommitDate: 2023-05-21 05:17:47 +0000 ext2fs: Add large sectorsize disks support The ext2fs does not support disks with sectorsize more 512 bytes. The main issue is in reading/writing superblock, which is not aligned with 4k value. Reimplement the superblock reading logic to make it indifferent to disk logical sector size. The logical sector size more then page size is not supported, like it is doing on Linux side. PR: 271105 Reported by: k(at)vodka.home.kg Reviewed by: pfg MFC after: 2 week Differential Revision: https://reviews.freebsd.org/D40047 --- sys/fs/ext2fs/ext2_vfsops.c | 48 ++++++++++++++++++++++++--------------------- sys/fs/ext2fs/fs.h | 6 ++++-- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/sys/fs/ext2fs/ext2_vfsops.c b/sys/fs/ext2fs/ext2_vfsops.c index 9f76dc63300d..551597180465 100644 --- a/sys/fs/ext2fs/ext2_vfsops.c +++ b/sys/fs/ext2fs/ext2_vfsops.c @@ -111,7 +111,7 @@ static int ext2_check_sb_compat(struct ext2fs *es, struct cdev *dev, static int ext2_compute_sb_data(struct vnode * devvp, struct ext2fs * es, struct m_ext2fs * fs); -static const char *ext2_opts[] = { "acls", "async", "noatime", "noclusterr", +static const char *ext2_opts[] = { "acls", "async", "noatime", "noclusterr", "noclusterw", "noexec", "export", "force", "from", "multilabel", "suiddir", "nosymfollow", "sync", "union", NULL }; @@ -343,7 +343,7 @@ ext2_cg_location(struct m_ext2fs *fs, int number) * Godmar thinks: if the blocksize is greater than 1024, then * the superblock is logically part of block zero. */ - logical_sb = fs->e2fs_bsize > SBSIZE ? 0 : 1; + logical_sb = fs->e2fs_bsize > SBLOCKSIZE ? 0 : 1; if (!EXT2_HAS_INCOMPAT_FEATURE(fs, EXT2F_INCOMPAT_META_BG) || number < le32toh(fs->e2fs->e3fs_first_meta_bg)) @@ -760,9 +760,9 @@ ext2_reload(struct mount *mp, struct thread *td) * Step 2: re-read superblock from disk. * constants have been adjusted for ext2 */ - if ((error = bread(devvp, SBLOCK, SBSIZE, NOCRED, &bp)) != 0) + if ((error = bread(devvp, SBLOCK, SBLOCKBLKSIZE, NOCRED, &bp)) != 0) return (error); - es = (struct ext2fs *)bp->b_data; + es = (struct ext2fs *)((char *)bp->b_data + SBLOCKOFFSET); if (ext2_check_sb_compat(es, devvp->v_rdev, 0) != 0) { brelse(bp); return (EIO); /* XXX needs translation */ @@ -774,10 +774,7 @@ ext2_reload(struct mount *mp, struct thread *td) brelse(bp); return (error); } -#ifdef UNKLAR - if (fs->fs_sbsize < SBSIZE) - bp->b_flags |= B_INVAL; -#endif + brelse(bp); /* @@ -852,6 +849,9 @@ ext2_mountfs(struct vnode *devvp, struct mount *mp) int32_t *lp; int32_t e2fs_maxcontig; + bp = NULL; + ump = NULL; + ronly = vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0); /* XXX: use VOP_ACESS to check FS perms */ g_topology_lock(); @@ -861,13 +861,16 @@ ext2_mountfs(struct vnode *devvp, struct mount *mp) if (error) return (error); - /* XXX: should we check for some sectorsize or 512 instead? */ - if (((SBSIZE % cp->provider->sectorsize) != 0) || - (SBSIZE < cp->provider->sectorsize)) { - g_topology_lock(); - g_vfs_close(cp); - g_topology_unlock(); - return (EINVAL); + if (PAGE_SIZE != SBLOCKBLKSIZE) { + printf("WARNING: Unsupported page size %d\n", PAGE_SIZE); + error = EINVAL; + goto out; + } + if (cp->provider->sectorsize > PAGE_SIZE) { + printf("WARNING: Device sectorsize(%d) is more than %d\n", + cp->provider->sectorsize, PAGE_SIZE); + error = EINVAL; + goto out; } bo = &devvp->v_bufobj; @@ -877,12 +880,9 @@ ext2_mountfs(struct vnode *devvp, struct mount *mp) mp->mnt_iosize_max = devvp->v_rdev->si_iosize_max; if (mp->mnt_iosize_max > maxphys) mp->mnt_iosize_max = maxphys; - - bp = NULL; - ump = NULL; - if ((error = bread(devvp, SBLOCK, SBSIZE, NOCRED, &bp)) != 0) + if ((error = bread(devvp, SBLOCK, SBLOCKBLKSIZE, NOCRED, &bp)) != 0) goto out; - es = (struct ext2fs *)bp->b_data; + es = (struct ext2fs *)((char *)bp->b_data + SBLOCKOFFSET); if (ext2_check_sb_compat(es, dev, ronly) != 0) { error = EINVAL; /* XXX needs translation */ goto out; @@ -1377,8 +1377,12 @@ ext2_sbupdate(struct ext2mount *mp, int waitfor) if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_METADATA_CKSUM)) ext2_sb_csum_set(fs); - bp = getblk(mp->um_devvp, SBLOCK, SBSIZE, 0, 0, 0); - bcopy((caddr_t)es, bp->b_data, (u_int)sizeof(struct ext2fs)); + error = bread(mp->um_devvp, SBLOCK, SBLOCKBLKSIZE, NOCRED, &bp); + if (error != 0) + return (error); + + memcpy((char *)bp->b_data + SBLOCKOFFSET, (caddr_t)es, + (u_int)sizeof(struct ext2fs)); if (waitfor == MNT_WAIT) error = bwrite(bp); else diff --git a/sys/fs/ext2fs/fs.h b/sys/fs/ext2fs/fs.h index c09200af3935..ee7537253a27 100644 --- a/sys/fs/ext2fs/fs.h +++ b/sys/fs/ext2fs/fs.h @@ -56,8 +56,10 @@ * The first boot and super blocks are given in absolute disk addresses. * The byte-offset forms are preferred, as they don't imply a sector size. */ -#define SBSIZE 1024 -#define SBLOCK 2 +#define SBLOCK 0 +#define SBLOCKSIZE 1024 +#define SBLOCKOFFSET 1024 +#define SBLOCKBLKSIZE 4096 /* * The path name on which the file system is mounted is maintained From nobody Sun May 21 09:43:00 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPFxd1MjGz4CHYB; Sun, 21 May 2023 09:43: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 4QPFxd0vW2z42Zg; Sun, 21 May 2023 09:43:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684662181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ok3hW7Q+YtUJGdAlRsZiiZjwSWRINSb4osdBzGdILVc=; b=IaAdPNo5b/TI+sk81C4qOM8o4MCef2a3u+F4w0g8CW6VnrKKSKAmYW1O5iTvRK6iFTuWVf ZpA6AArBCZerZZbXXTk4q/I2A9/uMynmQWIr5E8GMsZHdwIRrq8B0FrXF8O69Cgyyebuqm 4bx+/rrahmX0hEM9v81ArsMF+fkDT1N5hvxcoTqO398nVK+TkA4dnTfEbcz/RGfrsfFpMo H18/YSs5IsL5NRq/gh1+mEw6PF4f/PkrWoA9QJ5RM5hGeXGdiM3e314aSAlQCEddSkOUdp EFgGIsspdMfmaZc3XmAc+1DXB28wA1WbHTzBBmONetdIX0cP5BrPaenizz0ZhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684662181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ok3hW7Q+YtUJGdAlRsZiiZjwSWRINSb4osdBzGdILVc=; b=YBSxO9xph7hIeavEL9tQmObuHs21tTeBdLAfJ006f2GxQjzeXxPXOPEhT/nnaUcN4+qXwx hwwd4RmTC5O72tvlg1DIUixAwGpNF7zSdYieBiWpO6nsv7lYvFsnHFHNML3vDnVWtcMPEW xFxCweB3RhzUMKb3tFtJgXNE2UtK35DUDBaFI93PGJsVGPHBcWaiuk/g2Ldu8zHy1QShIu gzTBaj2l2LjJhKiYLq+uVrDhqr+SUVAmUJN+n7hlaKL6rkmpStpDGBDUNI6b9KdZKD+/lW Ec5ydfI4Kj0ZT6F0mckaFaH/keEBCvQi2g0QrfmmMIccptBqYgD8hf4a+RtEkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684662181; a=rsa-sha256; cv=none; b=mgcQZVqTaq7wA1nu99VfLQpJbG7BMC8ci+WzR0zPKK2lGvQtdJB0Afdg4mFLvhH31315kx rNZckbRiBD5AxnH4vug2N+DtsNtMm9pgHfm4XkdP3AI0QtMt3CenQLrDMdv+zXPKDaf7nq hQTnQpWxqDObbgmAF3AKCrxKoj/+TBZ+KwSC8xnWosRcVFtOAqLu/jD+PEX6HxnXt+k3Po NUFgLgV4sBBUSmcZ5Tz3U4T/Q2AVXnKMZCwZdK3/JCPFOwMC/94YqqPZOcRqLw22kpedNu JYFfXu9jGH2AfSZ0MvHQL62sq0TkGy3Kw9nRCUZro8TgVHTq8+88qso9hgwl/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 4QPFxc74QmzmQg; Sun, 21 May 2023 09:43: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 34L9h0EZ006347; Sun, 21 May 2023 09:43:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34L9h0Me006346; Sun, 21 May 2023 09:43:00 GMT (envelope-from git) Date: Sun, 21 May 2023 09:43:00 GMT Message-Id: <202305210943.34L9h0Me006346@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 197bff385e2c - main - ifconfig: split argument parsing List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 197bff385e2caf82c52036f572e1cc79efc217f8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=197bff385e2caf82c52036f572e1cc79efc217f8 commit 197bff385e2caf82c52036f572e1cc79efc217f8 Author: Alexander V. Chernikov AuthorDate: 2023-05-20 11:14:39 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-05-21 09:42:11 +0000 ifconfig: split argument parsing Simplify main() by factoring out argument parsing code. Reviewed by: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D40179 --- sbin/ifconfig/ifconfig.c | 165 ++++++++++++++++++++++++++++------------------- 1 file changed, 98 insertions(+), 67 deletions(-) diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 8c3a7b4c0007..16ab651261d1 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -407,32 +407,34 @@ list_interfaces(struct ifconfig_args *args) #endif } -int -main(int argc, char *argv[]) +static char * +args_peek(struct ifconfig_args *args) { - int c; - const struct afswtch *afp = NULL; - int ifindex; - char options[1024], *envformat; - struct option *p; - size_t iflen; - int flags; + if (args->argc > 0) + return (args->argv[0]); + return (NULL); +} - f_inet = f_inet6 = f_ether = f_addr = NULL; +static char * +args_pop(struct ifconfig_args *args) +{ + if (args->argc == 0) + return (NULL); - lifh = ifconfig_open(); - if (lifh == NULL) - err(EXIT_FAILURE, "ifconfig_open"); + char *arg = args->argv[0]; - envformat = getenv("IFCONFIG_FORMAT"); - if (envformat != NULL) - setformat(envformat); + args->argc--; + args->argv++; - /* - * Ensure we print interface name when expected to, - * even if we terminate early due to error. - */ - atexit(printifnamemaybe); + return (arg); +} + +static void +args_parse(struct ifconfig_args *args, int argc, char *argv[]) +{ + char options[1024]; + struct option *p; + int c; /* Parse leading line options */ strlcpy(options, "G:adf:klmnuv", sizeof(options)); @@ -441,10 +443,10 @@ main(int argc, char *argv[]) while ((c = getopt(argc, argv, options)) != -1) { switch (c) { case 'a': /* scan all interfaces */ - args.all = true; + args->all = true; break; case 'd': /* restrict scan to "down" interfaces */ - args.downonly = true; + args->downonly = true; break; case 'f': if (optarg == NULL) @@ -452,33 +454,33 @@ main(int argc, char *argv[]) setformat(optarg); break; case 'G': - if (optarg == NULL || args.all == 0) + if (optarg == NULL || args->all == 0) usage(); - args.nogroup = optarg; + args->nogroup = optarg; break; case 'k': - args.printkeys = true; + args->printkeys = true; break; case 'l': /* scan interface names only */ - args.namesonly++; + args->namesonly++; break; case 'm': /* show media choices in status */ - args.supmedia = true; + args->supmedia = true; break; case 'n': /* suppress module loading */ - args.noload = true; + args->noload = true; break; case 'u': /* restrict scan to "up" interfaces */ - args.uponly = true; + args->uponly = true; break; case 'v': - args.verbose++; + args->verbose++; break; case 'g': - if (args.all) { + if (args->all) { if (optarg == NULL) usage(); - args.matchgroup = optarg; + args->matchgroup = optarg; break; } /* FALLTHROUGH */ @@ -496,30 +498,26 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - /* Sync global variables */ - printkeys = args.printkeys; - verbose = args.verbose; - /* -l cannot be used with -a or -m */ - if (args.namesonly && (args.all || args.supmedia)) + if (args->namesonly && (args->all || args->supmedia)) usage(); /* nonsense.. */ - if (args.uponly && args.downonly) + if (args->uponly && args->downonly) usage(); /* no arguments is equivalent to '-a' */ - if (!args.namesonly && argc < 1) - args.all = 1; + if (!args->namesonly && argc < 1) + args->all = 1; /* -a and -l allow an address family arg to limit the output */ - if (args.all || args.namesonly) { + if (args->all || args->namesonly) { if (argc > 1) usage(); - ifindex = 0; if (argc == 1) { - afp = af_getbyname(*argv); + const struct afswtch *afp = af_getbyname(*argv); + if (afp == NULL) { warnx("Address family '%s' unknown.", *argv); usage(); @@ -527,32 +525,68 @@ main(int argc, char *argv[]) if (afp->af_name != NULL) argc--, argv++; /* leave with afp non-zero */ + args->afp = afp; } } else { /* not listing, need an argument */ if (argc < 1) usage(); + } - args.ifname = *argv; - argc--, argv++; + args->argc = argc; + args->argv = argv; + + /* Sync global variables */ + printkeys = args->printkeys; + verbose = args->verbose; +} + +int +main(int ac, char *av[]) +{ + char *envformat; + size_t iflen; + int flags; + + f_inet = f_inet6 = f_ether = f_addr = NULL; + + lifh = ifconfig_open(); + if (lifh == NULL) + err(EXIT_FAILURE, "ifconfig_open"); + + envformat = getenv("IFCONFIG_FORMAT"); + if (envformat != NULL) + setformat(envformat); + + /* + * Ensure we print interface name when expected to, + * even if we terminate early due to error. + */ + atexit(printifnamemaybe); + + args_parse(&args, ac, av); + + if (!args.all && !args.namesonly) { + /* not listing, need an argument */ + args.ifname = args_pop(&args); /* check and maybe load support for this interface */ ifmaybeload(&args, args.ifname); - ifindex = if_nametoindex(args.ifname); - if (ifindex == 0) { + char *arg = args_peek(&args); + if (if_nametoindex(args.ifname) == 0) { /* * NOTE: We must special-case the `create' command * right here as we would otherwise fail when trying * to find the interface. */ - if (argc > 0 && (strcmp(argv[0], "create") == 0 || - strcmp(argv[0], "plumb") == 0)) { + if (arg != NULL && (strcmp(arg, "create") == 0 || + strcmp(arg, "plumb") == 0)) { iflen = strlcpy(name, args.ifname, sizeof(name)); if (iflen >= sizeof(name)) errx(1, "%s: cloning name too long", args.ifname); - ifconfig(argc, argv, 1, NULL); + ifconfig(args.argc, args.argv, 1, NULL); exit(exit_code); } #ifdef JAIL @@ -561,12 +595,12 @@ main(int argc, char *argv[]) * right here as we would otherwise fail when trying * to find the interface as it lives in another vnet. */ - if (argc > 0 && (strcmp(argv[0], "-vnet") == 0)) { + if (arg != NULL && (strcmp(arg, "-vnet") == 0)) { iflen = strlcpy(name, args.ifname, sizeof(name)); if (iflen >= sizeof(name)) errx(1, "%s: interface name too long", args.ifname); - ifconfig(argc, argv, 0, NULL); + ifconfig(args.argc, args.argv, 0, NULL); exit(exit_code); } #endif @@ -576,21 +610,21 @@ main(int argc, char *argv[]) * Do not allow use `create` command as hostname if * address family is not specified. */ - if (argc > 0 && (strcmp(argv[0], "create") == 0 || - strcmp(argv[0], "plumb") == 0)) { - if (argc == 1) + if (arg != NULL && (strcmp(arg, "create") == 0 || + strcmp(arg, "plumb") == 0)) { + if (args.argc == 1) errx(1, "interface %s already exists", args.ifname); - argc--, argv++; + args_pop(&args); } } } /* Check for address family */ - if (argc > 0) { - afp = af_getbyname(*argv); - if (afp != NULL) - argc--, argv++; + if (args.argc > 0) { + args.afp = af_getbyname(args_peek(&args)); + if (args.afp != NULL) + args_pop(&args); } /* @@ -598,7 +632,7 @@ main(int argc, char *argv[]) * which doesn't require building, sorting, and searching the entire * system address list */ - if ((argc > 0) && (args.ifname != NULL)) { + if ((args.argc > 0) && (args.ifname != NULL)) { iflen = strlcpy(name, args.ifname, sizeof(name)); if (iflen >= sizeof(name)) { warnx("%s: interface name too long, skipping", args.ifname); @@ -607,15 +641,12 @@ main(int argc, char *argv[]) if (!(((flags & IFF_CANTCONFIG) != 0) || (args.downonly && (flags & IFF_UP) != 0) || (args.uponly && (flags & IFF_UP) == 0))) - ifconfig(argc, argv, 0, afp); + ifconfig(args.argc, args.argv, 0, args.afp); } goto done; } - args.afp = afp; - args.allfamilies = afp == NULL; - args.argc = argc; - args.argv = argv; + args.allfamilies = args.afp == NULL; list_interfaces(&args); From nobody Sun May 21 09:43:02 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPFxf39lyz4CJlG; Sun, 21 May 2023 09:43: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 4QPFxf26Wqz42d1; Sun, 21 May 2023 09:43:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684662182; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KRvJ6xP0Fvi0VQ99YTpPpBBPADDV4/OVnJI4X1odDO8=; b=fdr+G0WU2yyv8a/wlK0IBYeSEp9iDavCTBtE3XTirFjblm1v10wGMvnanE1vp0YZ6NnWZV /KDV/2+bwRR9RHbqT1MseCL0VW3a5oAGV6E+y0kitJTsEkol1o3G9SANMvXbEP7BeSkqGN OYZqrv0MZmsBoBOGoqr9PMMiXMfKbRMi6MYLwv5+KQD83g5593Ey7mdC2swHGeAPmFyOt/ wZCKSEd2DEa5qd3tynxdg5zm6IxtZDWvoM9BAKge4sGtZ/s3M0KsWefB7JoyIxOYYdIo4/ LXfDG3H0zIHW9R3ZA8t71zIvr0B7o2+1QNuUnex5TPVgZzFuxASO0jVqYgKWxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684662182; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KRvJ6xP0Fvi0VQ99YTpPpBBPADDV4/OVnJI4X1odDO8=; b=eBTE4t5jGv22giEiz6MhDbhla/uhGWGFmd0Wa8m3m4NwlGjPheS8E3HUgf8EdbyADyzmwe 20Y3xEZC3lzeEH3TVXr3IkQyUgz7W3ZITyHziJDon3+dO4FP2CLOZuFiLBG/iP04BSWTIR 8kM/ufIpBj150hB2DdzyJNOGC5qFQ2+6ln0CY0QQOOo6FSKzuvlYIGD3pc+v3wG8S0rP2a JPQ7pqaK1Ke1cs/DcQUBH4HdCs5AHRSss+Wne57INk+OoQA7NruVc0uvgYrbpGHOcwnozC Q4dyk7jD9/IkkIr0xbxmjSJI0pAWD8r/9EsFN4gZxBbW+vTDvrEdrQTkPIOzaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684662182; a=rsa-sha256; cv=none; b=r+SZszCefpyy+qpVwg7EAmmT2+y6utcdokEcBUJpIGxPjVHMUKWon8Pa2ipv4qXod7ulDH gPe+w0dIZS8ixhiCPviBzryw25RC+lpVnl3ZtSUA2wKzKaZ+jRahbErYE+AlXYCakkfeGR nd5SX/eEn4GFzlau5gXBxRak7nCO5n1RewpJVuoN0NwkjfmegDSKXaYf57kB8qJg/Wwjh/ 8jVzq2WUDGWGDi039C0otH8RIPmT6tc5YQGq85qFVVR8mRO/YPizc4/LCBIywy6lCeDClg J7M0d1KnOhcpZIrK/tSxk9By4r2xsFhMlXKyjhCq5fpwKtCrF/Vtg33cGBxM9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QPFxf10qGzmfh; Sun, 21 May 2023 09:43: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 34L9h2KS006373; Sun, 21 May 2023 09:43:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34L9h2M9006372; Sun, 21 May 2023 09:43:02 GMT (envelope-from git) Date: Sun, 21 May 2023 09:43:02 GMT Message-Id: <202305210943.34L9h2M9006372@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 63ad5ce7335b - main - ifconfig: simplify ifconfig() by factoring out ifa add/del logic List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 63ad5ce7335be6a0cc4a7bf27fe03d72c28ad401 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=63ad5ce7335be6a0cc4a7bf27fe03d72c28ad401 commit 63ad5ce7335be6a0cc4a7bf27fe03d72c28ad401 Author: Alexander V. Chernikov AuthorDate: 2023-05-20 11:23:04 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-05-21 09:42:11 +0000 ifconfig: simplify ifconfig() by factoring out ifa add/del logic Reviewed by: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D40180 --- sbin/ifconfig/ifconfig.c | 83 +++++++++++++++++++++++++++--------------------- 1 file changed, 47 insertions(+), 36 deletions(-) diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 16ab651261d1..c5e7b7befc72 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -92,10 +92,10 @@ struct ifreq ifr; char name[IFNAMSIZ]; char *descr = NULL; size_t descrlen = 64; -int setaddr; -int setmask; -int doalias; -int clearaddr; +static int setaddr; +static int setmask; +static int doalias; +static int clearaddr; int newaddr = 1; int verbose; int printifname = 0; @@ -968,6 +968,45 @@ static void setifdstaddr(const char *, int, int, const struct afswtch *); static const struct cmd setifdstaddr_cmd = DEF_CMD("ifdstaddr", 0, setifdstaddr); +static void +delifaddr(int s, const struct afswtch *afp) +{ + if (afp->af_ridreq == NULL || afp->af_difaddr == 0) { + warnx("interface %s cannot change %s addresses!", + name, afp->af_name); + clearaddr = 0; + return; + } + + strlcpy(((struct ifreq *)afp->af_ridreq)->ifr_name, name, + sizeof ifr.ifr_name); + int ret = ioctl(s, afp->af_difaddr, afp->af_ridreq); + if (ret < 0) { + if (errno == EADDRNOTAVAIL && (doalias >= 0)) { + /* means no previous address for interface */ + } else + Perror("ioctl (SIOCDIFADDR)"); + } +} + +static void +addifaddr(int s, const struct afswtch *afp) +{ + if (afp->af_addreq == NULL || afp->af_aifaddr == 0) { + warnx("interface %s cannot change %s addresses!", + name, afp->af_name); + newaddr = 0; + return; + } + + if (setaddr || setmask) { + strlcpy(((struct ifreq *)afp->af_addreq)->ifr_name, name, + sizeof ifr.ifr_name); + if (ioctl(s, afp->af_aifaddr, afp->af_addreq) < 0) + Perror("ioctl (SIOCAIFADDR)"); + } +} + int ifconfig(int argc, char *const *argv, int iscreate, const struct afswtch *uafp) { @@ -1088,38 +1127,10 @@ top: /* * Do deferred operations. */ - if (clearaddr) { - if (afp->af_ridreq == NULL || afp->af_difaddr == 0) { - warnx("interface %s cannot change %s addresses!", - name, afp->af_name); - clearaddr = 0; - } - } - if (clearaddr) { - int ret; - strlcpy(((struct ifreq *)afp->af_ridreq)->ifr_name, name, - sizeof ifr.ifr_name); - ret = ioctl(s, afp->af_difaddr, afp->af_ridreq); - if (ret < 0) { - if (errno == EADDRNOTAVAIL && (doalias >= 0)) { - /* means no previous address for interface */ - } else - Perror("ioctl (SIOCDIFADDR)"); - } - } - if (newaddr) { - if (afp->af_addreq == NULL || afp->af_aifaddr == 0) { - warnx("interface %s cannot change %s addresses!", - name, afp->af_name); - newaddr = 0; - } - } - if (newaddr && (setaddr || setmask)) { - strlcpy(((struct ifreq *)afp->af_addreq)->ifr_name, name, - sizeof ifr.ifr_name); - if (ioctl(s, afp->af_aifaddr, afp->af_addreq) < 0) - Perror("ioctl (SIOCAIFADDR)"); - } + if (clearaddr) + delifaddr(s, afp); + if (newaddr) + addifaddr(s, afp); close(s); return(0); From nobody Sun May 21 16:21:54 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPQnt43VDz4CB5f; Sun, 21 May 2023 16:21: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 4QPQnt3Zd9z3Q8k; Sun, 21 May 2023 16:21:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684686114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P4BdUMoUfKXgbaUav2DgDw5GNdR35ibrGvLg1pLti3g=; b=Olygv/3tPK+pv+PD8yxRTcdrzxs6OYssBditd1Db5kP1NO1+65qIKNFoqK6+QjQYb2YEIW yXHUIyzr9vCZI+6rRhmuPxb5vz/neK7p8XylFAfATUlKZRNBDzj3kBgbQn07ui23WAfl9G RmZKoHWEtmElAaHPuz3UsEkpHmx2yEYlb43uPQzsH+dRBuHtHnyIPmjnetXeFenxOJSrRC s/NbE0Dk6acSzvXj2/Qmk6yZ0hcCJOsa3bQKvi7gP8pWW7J7z5/S8nBjHIuJuixowSi4RU HLqwqIiepY/AoG6GD0AoPOp5Nwh5RcEKBDAWHcTFJqZnakNDcxaLh5fMFO3AWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684686114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P4BdUMoUfKXgbaUav2DgDw5GNdR35ibrGvLg1pLti3g=; b=AAZenNT21KQjuf7rRF7NrfW6TnSNZQCzt3dhGley2NMaCoQY2V9gdYsmlZ02ta9fYCMfjW fEunRMmyXVRJHBqQHy1avGwzNwWKp4hXPcDGjOq3vcWYGjNyeh6vG0UP1WllGCzI07jTDY qSbdEWuLtV0YWdB21H2lS+j6z7N09IP0I4nBAAOGeIg1zGG7by7YqorlwNUOWUjuY1wskG mLW9MQnHN3pMW5y4mprUt2dT4l2yyNIB/nH3VkXhU1SBnfOfPcb3JZMdWknmUYFV9pMVU0 wmvbE4MVhFPnDFTLwqBXWzty6hKrz8R96DfhvNk86KMrcsHwobjt4P5x+1BM/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684686114; a=rsa-sha256; cv=none; b=xYZ1NSCpcQaraA5rYWZeEYg451UtanNPeHQ94AKK6oShMS9E0EnGV1vKwjPhUqYmnQBjm1 oXMBKVFth5cICX7s66i3DFXvCPY3OdlpnyBZw6+kwUmYFUX8TqEIgjpkQLijUfyYM9xqxl uTxd0rtnZ3SDXzPFDi8HZrT5Mrf37/9vA8whUmhB9Ak+lwbKdESPVsBtXzKXOeqCpDwrE0 R8ZEOtxL+b7T1vr5jtA6ds2Td46uAZRbcsDCjqsn62I6eO1F5y/28radk35yJTxApianvL MiMo73UxzFSAwfcqE+cVP8rBrLj7U5zAB2tjPiiPge0ditjaSOb6+U29vNzxGw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QPQnt2frLzyLH; Sun, 21 May 2023 16:21: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 34LGLsXs059862; Sun, 21 May 2023 16:21:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34LGLsup059861; Sun, 21 May 2023 16:21:54 GMT (envelope-from git) Date: Sun, 21 May 2023 16:21:54 GMT Message-Id: <202305211621.34LGLsup059861@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 805d759338a2 - main - mlx4: Move DEFINE_MUTEX() outside function body. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 805d759338a2be939fffc8bf3f25cfaab981a9be Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=805d759338a2be939fffc8bf3f25cfaab981a9be commit 805d759338a2be939fffc8bf3f25cfaab981a9be Author: Hans Petter Selasky AuthorDate: 2023-05-21 11:25:28 +0000 Commit: Hans Petter Selasky CommitDate: 2023-05-21 16:20:16 +0000 mlx4: Move DEFINE_MUTEX() outside function body. Move static mutex declaration outside function body, to avoid global variables being declared on the stack, when using SYSINITs. MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/mlx4/mlx4_core/mlx4_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/mlx4/mlx4_core/mlx4_main.c b/sys/dev/mlx4/mlx4_core/mlx4_main.c index ca63d1d12ba6..a37b900a2ed0 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_main.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_main.c @@ -1164,6 +1164,8 @@ err_sup: return err; } +static DEFINE_MUTEX(set_port_type_mutex); + static ssize_t set_port_type(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) @@ -1172,7 +1174,6 @@ static ssize_t set_port_type(struct device *dev, port_attr); struct mlx4_dev *mdev = info->dev; enum mlx4_port_type port_type; - static DEFINE_MUTEX(set_port_type_mutex); int err; mutex_lock(&set_port_type_mutex); From nobody Sun May 21 16:33:35 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPR3c4ZCQz4CC0n for ; Sun, 21 May 2023 16:33:48 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QPR3c2Dlpz3R7j for ; Sun, 21 May 2023 16:33:48 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-3f42c865535so51781985e9.1 for ; Sun, 21 May 2023 09:33:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684686826; x=1687278826; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OX4L48deeMkEquM53iR2ElYtR8+SHxiY9p3zFpviAm0=; b=Xpru3tv2D96jHwxBp9Te/js2S0dI854jKejNw+bHlys9oeDd5IQ6r+sxX/1tIVtGry K/sqdweOao5Wl8krIGFmRqtgIuihUgN9aZgPqjNwuhFILxfxebMMJMkCQZvOItErWVVz 3j7D3y3MDYkZo9PEtl1bmYIavtkiO9cBsrVM8S4gljrQ9FfGJjm0/lt0FOtZx8LPf/KC GFYzqFNNnIov9e+tvFaJzrbhRGZ9obD2vplsuJxqs5VS9fWEX9+qOB4rGFg34pBS0S0A +epBLvvSbLrQ7paXmhZogSXB1kHYlCXOZOWRcWn4ew5y3QhlB/HjtiCHyJrO3TyyUov4 uuuw== X-Gm-Message-State: AC+VfDzQrwHs4R0EG9m+3zv1nDrQ1JI2ObJeZqbMLJHQyKlLx9XoX0bm SCMxf7eUFr1Z9i59qguOzhYOAA== X-Google-Smtp-Source: ACHHUZ6HOLBq9JyCctn0p3+7Uijfq/q8U4nTRW3JPlEPYyDG0OxcapO6Q9E/f0qfXoMq/ycH38AEug== X-Received: by 2002:adf:f007:0:b0:2ef:b052:1296 with SMTP id j7-20020adff007000000b002efb0521296mr5880843wro.22.1684686826601; Sun, 21 May 2023 09:33:46 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.246]) by smtp.gmail.com with ESMTPSA id j17-20020a5d6191000000b0030639a86f9dsm5062037wru.51.2023.05.21.09.33.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 May 2023 09:33:46 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: git: 805d759338a2 - main - mlx4: Move DEFINE_MUTEX() outside function body. From: Jessica Clarke In-Reply-To: <202305211621.34LGLsup059861@gitrepo.freebsd.org> Date: Sun, 21 May 2023 17:33:35 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <54EF67D8-2A79-4EAB-8EFB-232F14FFE792@freebsd.org> References: <202305211621.34LGLsup059861@gitrepo.freebsd.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3731.500.231) X-Rspamd-Queue-Id: 4QPR3c2Dlpz3R7j X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 21 May 2023, at 17:21, Hans Petter Selasky = wrote: >=20 > The branch main has been updated by hselasky: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D805d759338a2be939fffc8bf3f25cfaa= b981a9be >=20 > commit 805d759338a2be939fffc8bf3f25cfaab981a9be > Author: Hans Petter Selasky > AuthorDate: 2023-05-21 11:25:28 +0000 > Commit: Hans Petter Selasky > CommitDate: 2023-05-21 16:20:16 +0000 >=20 > mlx4: Move DEFINE_MUTEX() outside function body. >=20 > Move static mutex declaration outside function body, to avoid = global > variables being declared on the stack, when using SYSINITs. What? This is nonsense. It=E2=80=99s not on the stack either way round. Please revert this. Jess > MFC after: 1 week > Sponsored by: NVIDIA Networking > --- > sys/dev/mlx4/mlx4_core/mlx4_main.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/sys/dev/mlx4/mlx4_core/mlx4_main.c = b/sys/dev/mlx4/mlx4_core/mlx4_main.c > index ca63d1d12ba6..a37b900a2ed0 100644 > --- a/sys/dev/mlx4/mlx4_core/mlx4_main.c > +++ b/sys/dev/mlx4/mlx4_core/mlx4_main.c > @@ -1164,6 +1164,8 @@ err_sup: > return err; > } >=20 > +static DEFINE_MUTEX(set_port_type_mutex); > + > static ssize_t set_port_type(struct device *dev, > struct device_attribute *attr, > const char *buf, size_t count) > @@ -1172,7 +1174,6 @@ static ssize_t set_port_type(struct device *dev, > port_attr); > struct mlx4_dev *mdev =3D info->dev; > enum mlx4_port_type port_type; > - static DEFINE_MUTEX(set_port_type_mutex); > int err; >=20 > mutex_lock(&set_port_type_mutex); From nobody Sun May 21 16:57:47 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPRbM66txz4CD2l; Sun, 21 May 2023 16:57:51 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4QPRbM3pchz3jhR; Sun, 21 May 2023 16:57:51 +0000 (UTC) (envelope-from hselasky@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from [10.36.2.145] (unknown [46.212.121.255]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id ACD4D260B9B; Sun, 21 May 2023 18:57:47 +0200 (CEST) Message-ID: <21c9532e-4ca7-a7fe-1ff6-07a94cbad6ab@freebsd.org> Date: Sun, 21 May 2023 18:57:47 +0200 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: git: 805d759338a2 - main - mlx4: Move DEFINE_MUTEX() outside function body. To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202305211621.34LGLsup059861@gitrepo.freebsd.org> <54EF67D8-2A79-4EAB-8EFB-232F14FFE792@freebsd.org> Content-Language: en-US From: Hans Petter Selasky In-Reply-To: <54EF67D8-2A79-4EAB-8EFB-232F14FFE792@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4QPRbM3pchz3jhR X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 5/21/23 18:33, Jessica Clarke wrote: > On 21 May 2023, at 17:21, Hans Petter Selasky wrote: >> >> The branch main has been updated by hselasky: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=805d759338a2be939fffc8bf3f25cfaab981a9be >> >> commit 805d759338a2be939fffc8bf3f25cfaab981a9be >> Author: Hans Petter Selasky >> AuthorDate: 2023-05-21 11:25:28 +0000 >> Commit: Hans Petter Selasky >> CommitDate: 2023-05-21 16:20:16 +0000 >> >> mlx4: Move DEFINE_MUTEX() outside function body. >> >> Move static mutex declaration outside function body, to avoid global >> variables being declared on the stack, when using SYSINITs. > > What? This is nonsense. It’s not on the stack either way round. > > Please revert this. > > Jess Hi Jess, I think this is a false positive of yours. You need to look through all the macros used there. Basically DEFINE_MUTEX() expands to a bunch of structures, which are not in any block. The "static" you see in patch just covers the first mutex structure. SYSINITs use "static" in front of all structure definitions. If you want to change from static structures to global symbols, then my change is correct. Before: static DEFINE_MUTEX(xxx); Expands to something like: static struct yyy xxx; static struct sysinit zzz; .... If you want to change from "static struct sysinit zzz;" to "extern struct sysinit zzz" and also initialize the structure there, then that won't work, based on what I currently know about C-programming. I tried, but clang gave me a warning about it. You can't declare global variables inside a function or it is not good style. From what I can see, this location is the only place I've come accross in the FreeBSD kernel, where a SYSINIT() is used inside a function, and I thought I would just move that outside the function instead. This change also allows for: https://reviews.freebsd.org/D40193 --HPS From nobody Sun May 21 17:05:41 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPRmf1KGhz4CDgf for ; Sun, 21 May 2023 17:05:54 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QPRmf0xChz3kd6 for ; Sun, 21 May 2023 17:05:54 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-3f601c57d8dso4266395e9.0 for ; Sun, 21 May 2023 10:05:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684688753; x=1687280753; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TiuRDeY/h11Wq/e90Q1jR5uaJRGfj/tTX1GTmYZDpzY=; b=HUEiMQI0zuR6hO31sAkyKC9EG2Xq0pw23y96kF/CovpqpPAApzlr0zPhj22EVsCnIZ wDS5eRr1/7gJTFKiC/+39ie0iYlyxYM5yJXiRBeqC5F9T/C61+0CzFIpRjRi9MVAdUx3 sKHHySF3+VGk6qjOkYp7cadnTdmtred/YcVePqsy8f9jVMRVkYH7dgvcbdrOKohPSq+6 eyEWlFv0p1klkvErpVPRhlijssqZQEEx6Bm3x0uEtUlBoFHbXtF9bf24YB2w7qS9qlVO hQkFF7IaJb24dI217UjEJwA9MHOxDZJIW7E2l+n6zJ38nZG5LPatvfwjghXoX23heMcf wF/g== X-Gm-Message-State: AC+VfDw7SuCuflFrasmqMpFSNr30YlyLZubjq0GBZ8mAJTNQfW2lGI6C BqCrnEFrOgEJyDJ+YrmbMp8mFemof0hbPotIpmk= X-Google-Smtp-Source: ACHHUZ4zsOuN8IATqQWFKrX5vLfbkwhinaZxwf3ao7Fhm2jj3sBh/Cg1EiX2NeMMCnbB5Qa/ZO64TQ== X-Received: by 2002:a1c:790b:0:b0:3f6:1ac:5feb with SMTP id l11-20020a1c790b000000b003f601ac5febmr1793005wme.16.1684688752905; Sun, 21 May 2023 10:05:52 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.246]) by smtp.gmail.com with ESMTPSA id l22-20020a7bc356000000b003f1751016desm5672024wmj.28.2023.05.21.10.05.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 May 2023 10:05:52 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: git: 805d759338a2 - main - mlx4: Move DEFINE_MUTEX() outside function body. From: Jessica Clarke In-Reply-To: <21c9532e-4ca7-a7fe-1ff6-07a94cbad6ab@freebsd.org> Date: Sun, 21 May 2023 18:05:41 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <3066464F-E4C6-4B84-ADFF-E578AFAFE622@freebsd.org> References: <202305211621.34LGLsup059861@gitrepo.freebsd.org> <54EF67D8-2A79-4EAB-8EFB-232F14FFE792@freebsd.org> <21c9532e-4ca7-a7fe-1ff6-07a94cbad6ab@freebsd.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3731.500.231) X-Rspamd-Queue-Id: 4QPRmf0xChz3kd6 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 21 May 2023, at 17:57, Hans Petter Selasky = wrote: >=20 > On 5/21/23 18:33, Jessica Clarke wrote: >> On 21 May 2023, at 17:21, Hans Petter Selasky = wrote: >>>=20 >>> The branch main has been updated by hselasky: >>>=20 >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D805d759338a2be939fffc8bf3f25cfaa= b981a9be >>>=20 >>> commit 805d759338a2be939fffc8bf3f25cfaab981a9be >>> Author: Hans Petter Selasky >>> AuthorDate: 2023-05-21 11:25:28 +0000 >>> Commit: Hans Petter Selasky >>> CommitDate: 2023-05-21 16:20:16 +0000 >>>=20 >>> mlx4: Move DEFINE_MUTEX() outside function body. >>>=20 >>> Move static mutex declaration outside function body, to avoid = global >>> variables being declared on the stack, when using SYSINITs. >> What? This is nonsense. It=E2=80=99s not on the stack either way = round. >> Please revert this. >> Jess >=20 > Hi Jess, >=20 > I think this is a false positive of yours. You need to look through = all the macros used there. No it=E2=80=99s not. All the definitions are static. > Basically DEFINE_MUTEX() expands to a bunch of structures, which are = not in any block. They are all static. > The "static" you see in patch just covers the first mutex structure. Because only the first one is ever not static. The rest always are. > SYSINITs use "static" in front of all structure definitions. Exactly. > If you want to change from static structures to global symbols, then = my change is correct. Which will bloat symbol tables excessively. But you didn=E2=80=99t state = this as your goal, you stated it as a behavioural change *today*, which = it=E2=80=99s not (other than changing the scope). Your commit message = was entirely nonsense, and so I told you that. If your goal is instead = to allow for future changes, put that in your commit message. I am not a = mind reader, nor is anyone else. It is extremely unhelpful to have = commits that say one thing but intend to achieve a different thing. > Before: >=20 > static DEFINE_MUTEX(xxx); >=20 > Expands to something like: >=20 > static struct yyy xxx; static struct sysinit zzz; .... >=20 >=20 >=20 > If you want to change from "static struct sysinit zzz;" to "extern = struct sysinit zzz" and also initialize the structure there, then that = won't work, based on what I currently know about C-programming. I tried, = but clang gave me a warning about it. Clearly trying to define a variable with global scope at function scope = isn=E2=80=99t going to work, yes. > You can't declare global variables inside a function or it is not good = style. >=20 >=20 >=20 > =46rom what I can see, this location is the only place I've come = accross in the FreeBSD kernel, where a SYSINIT() is used inside a = function, and I thought I would just move that outside the function = instead. >=20 > This change also allows for: >=20 > https://reviews.freebsd.org/D40193 Which looks like a mess to me. Jess > --HPS From nobody Sun May 21 17:14:26 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPRyq64zgz4CDlf for ; Sun, 21 May 2023 17:14:43 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic316-54.consmr.mail.gq1.yahoo.com (sonic316-54.consmr.mail.gq1.yahoo.com [98.137.69.30]) (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) by mx1.freebsd.org (Postfix) with ESMTPS id 4QPRyp3Zzcz3l8R for ; Sun, 21 May 2023 17:14:42 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=HS34FDZ9; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.69.30 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1684689280; bh=0r+kCCsMSwDl3lrwUH6v6+GKzVvgrtFJg7mdG7rujBk=; h=From:Subject:Date:To:References:From:Subject:Reply-To; b=HS34FDZ9rBor/R+00aOMrYx3/2eMJwhzz6bqZ4RDhaojj5R+PF3Spixqjn8I6ljbcCHWGbtYJR0qPABk8d5+f4rcOIPY9ycMldG25O436QKkjzt98Vf2mCMUZcZ1EwulVHUWHV+6z/F9HK6SBuMoCT8uDNRjNo+CB+VPBL3jj1pdIqtVp/JckZgAtcl9A3Wso7QJqCHuFly+fQjf/TGOAe3u00jPACs3lz4o1JF0SDX1RNLj3JJ8+GfIDV//s6xrMgZO7oyIG3Tk6bhz37do4YyY12AlPScMBQkltr0SkFe3rhZqh/T/HKCL8uf1DJo2AJoG+o2JOTU5gWole0jf8w== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1684689280; bh=CWKZJUSaRIOOjNJQC9FPZ1pM/WOgc3vnPo5vitWZ3x6=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=qfWxWKDHDKYrIQ2L5EXLCN2o5PVZCObO0E8NTGgBneXfI2h1yH8r7myIrwy/tgR2ByGdkYXoZ0p0D1COQCYiWDqOHmDLZOTEjC8G+LLB8xH4i5s+7AZk4xBtgtBxC2v8AZM4/5yfR9KTZDAD23zSCDPbD9sUkJMfjAabpBTIanGJ4PllVJunBRoH7sN+UZ16cEfFdvBIZTK5/UHtdpjAsEzgX7++O3qRSSZPciBA2EkZVVeAtlBXF2VZfLjYy7RpeARFayEBoIDuPKPOlXnwdIDzpO8mB1+wpyZpJ/ydiP4KgFZhpi4jhp3IeBlGjnNW19ely+opABlZcVrXTKYnug== X-YMail-OSG: H.5jwHMVM1nA9vWZjLBTfdfKxzeoetFDMomftC2s64fXJsQGXo.uX5LQslgSX_J g7bTh_Qk95fDxZU4HzieHkZdx7ujDQhFKrRR5S5gMlx_2ifcvJTjUCiJ3pFocfXYFnpLWokJBLeU Z3sJvuIqpJab.FdQvvEz_hG_e.Xggf6rc1r0h9mfFyxO2gWwKiTcNHVqJC4ZK4Hj.WJ4pGwMxgzN hEFJvnE.Xbf7CPYHl1OW.KdXUzi1azRO.pl.7NE2TnmtybXAAPFqCxsqewiiYpI8.kq3B5faD8N4 pucEB54eRwa6wtOKL.NbhrxqBBNoRDGeaS8K6HXc9GnhlOXdNuj3YcW0vR6Ri4FQlxTczGVvYoPP nGnusJY7L9P3rSiv5q77WBcYFscuCtABmbO7vZY9SjtEJDoHsB53LuVelAQzFVxA9vTSlhkizlU6 9D_SGjCXC3vph4llI53cMZ82q0NWcmrvJDgGo0F3Ir8r742SCyVa45LfbVD2zXzjzl4Ruq5Nipwo ftYSq_Ruj5z6poElQrBhB8yNOM2tw9RLTW_Izgcy4AHDeYZw2EV.B9nYcqelos2gd.mSAsR6tPit 1MN8cbsh16jg4gNBrcpY3ujRQQTQuIVsCk75vth6QXKxqCRHIPXZxsHUvnCAu6t.Cdh7xJS1muPQ uIR3Jse2u7OT8C13RLh9katpNsgyjjmIX.ussKX4J133Ocdrhk6WcXcKiNdH7rNn.omYBU6mHmCv z37U5hQ1uwdyWsudOcN2JB_Xkb1T4e50y.qr8LaV7cfA0KEIzWHDtVpk92ItQGVsxgx5CQjBQDG2 .p1e3V2k3o0KyChDJMPW1T4v26W6Et327QYada.oB46WEUV2Ce5qLwPS63AH6H2v7iKyZhM09dGJ c4lZv1k9LOVm5ePwGfZ3al1ZY6xxUov27KRNZnECmyrByaYNeNMjD13xPHXCcQ.oNJGrL5Yy34Ke g87eUeVpN.KHhb3aQ1zOevGGafdJL0Rr6LYYWE.SWIbox21N82L0jVthsOHUFSgqC82rX.8Jb1dh t_DGBUiEL7sTF.1whTpLtizprErjJ49YWrFhAD7s7fyP9EyRJxYdH3IbA_OEVHMph2C2maoNfF1x 5fLJvRZUNhyyoWGbSzT8SpnvwMDSsGMzKR3IzOectG0bJ7n2AfeAhZyjbwzYVT9hlIWAlv4gBkO5 oCH9T.dlPbellULM1VAgsahmKWExtwueWtHWctUnAvqxfWVAJgS8qqm.k5nXqefimcx5GVAb4_AV myc.7HAUqmhrNzA9v4j.gVw_BnWMLdxryuW1voPIqBW03YZJlpZgKt0Y3Kz28N9SbFtl.s_T6ttO EsvZksuHnTf4xkdq_rR1vJ4gx_.mgJoMbQb.acq5vEurQOaE5IRqK2Ign5OLYb_obQXcHIBa4dSe VqTTCMzq2Rq4czVoy3AGl5jP_8j.5Ee86Nj2wNb4mcevCGdmpwqFRT0HAgXKOOEVu8VdjhFa_SQM .5zJuEd3Uj6Od2LlJA9EPinjV3ZIBmJ5KZG2oyU3ikkTeHsZnIDKCm3I018f50AJQjDPIlS.wHjY 38SS15tweNr.GsyNGgiqICWdTWeFmQIElIRRyayul471pQo_HpZfAhSrKNUKwEyWpNTUzuasAw.L JnybaQDnk46AHl0Q0d8k9A9JVL6_He_f6Gvkyj0RrVeetH.phCmbEYfxm0k.j7nqxUVxqtAXGOqH Ujgu8JPnpEps0lJhs8UVYdWnYIVGUHI19Rw9jWW51JaohJEj2Gf2XrmzUVyKofv1xKCf7oPP1aKr T9OQO6_L318Gm59QnVhnI7LFuO6JeVpja58iOrL9abDoE0_.8wZ6XDxmHH6697A8J1jrxx3NwTsq y37Ox6dIWlKxPZJo7NoAoCwGtLVodSK9Bc5QXk7FPNgFxuCVAdQRD2UaLhJqyDvvoPQryr1WDnB0 sJjffpQkx.cbKQd.lKBGM9mkwJWGdOrF94dq.Xl5APECLxVsAYAPSkfHk2WZ4nUy.wpToUSFFDDX 6UdFyhp2YNUTajlaxmlUuNvUzcYo6554kNgfx_Jv9MAmsvx05OdYSK6Eb7Nmd3tQL4HUNzMb0Sty g9MDshLAq5s4NYmGSOz4bwM4iyEwEcxaq8H8ndfkSwtpf.KfpgJRe8Nz1sz._DZAiqIk9kazLZo7 9csesQheohO_tRbeDoCCUbZir2Ppr4JZ_7wmfAlWmeHNf49jop.Sefmiu.XDntuw67xp2q2VtnFC 4yXajiOtqVsI8PfnXMZuzOFptgGUaHowpnV5W93X33uzVsJe7EVORzlQSKilt51k5uNYOaybuET9 vBQ-- X-Sonic-MF: X-Sonic-ID: 5f23f646-6c90-45d4-a9f8-2dff2a771562 Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.gq1.yahoo.com with HTTP; Sun, 21 May 2023 17:14:40 +0000 Received: by hermes--production-bf1-54475bbfff-g6lsn (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID e03263792a8b8d05827d4542495e5b46; Sun, 21 May 2023 17:14:38 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Subject: RE: git: 805d759338a2 - main - mlx4: Move DEFINE_MUTEX() outside function body. Message-Id: Date: Sun, 21 May 2023 10:14:26 -0700 To: hselasky@freebsd.org, dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3731.400.51.1.1) References: X-Spamd-Result: default: False [-3.43 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.93)[-0.929]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; RCVD_IN_DNSWL_NONE(0.00)[98.137.69.30:from]; BLOCKLISTDE_FAIL(0.00)[98.137.69.30:server fail]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; MIME_TRACE(0.00)[0:+]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.69.30:from] X-Rspamd-Queue-Id: 4QPRyp3Zzcz3l8R X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N Hans Petter Selasky wrote on Date: Sun, 21 May 2023 16:57:47 UTC : > On 5/21/23 18:33, Jessica Clarke wrote: > > On 21 May 2023, at 17:21, Hans Petter Selasky = wrote: > >> > >> The branch main has been updated by hselasky: > >> > >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D805d759338a2be939fffc8bf3f25cfaa= b981a9be > >> > >> commit 805d759338a2be939fffc8bf3f25cfaab981a9be > >> Author: Hans Petter Selasky > >> AuthorDate: 2023-05-21 11:25:28 +0000 > >> Commit: Hans Petter Selasky > >> CommitDate: 2023-05-21 16:20:16 +0000 > >> > >> mlx4: Move DEFINE_MUTEX() outside function body. > >> > >> Move static mutex declaration outside function body, to avoid = global > >> variables being declared on the stack, when using SYSINITs. > >=20 > > What? This is nonsense. It=E2=80=99s not on the stack either way = round. > >=20 > > Please revert this. > >=20 > > Jess >=20 > Hi Jess, >=20 > I think this is a false positive of yours. You need to look through = all=20 > the macros used there. >=20 > Basically DEFINE_MUTEX() expands to a bunch of structures, which are = not=20 > in any block. DEFINE_MUTEX is from/for linux related code: # grep -r "define.*DEFINE_MUTEX" /usr/main-src/sys/ | more /usr/main-src/sys/compat/linuxkpi/common/include/linux/mutex.h:#define = DEFINE_MUTEX(lock) \ and looks like: #define DEFINE_MUTEX(lock) = \ mutex_t lock; = \ SX_SYSINIT_FLAGS(lock, &(lock).sx, mutex_name(#lock), SX_DUPOK) > The "static" you see in patch just covers the first mutex structure. >=20 > SYSINITs use "static" in front of all structure definitions. > If you want to change from static structures to global symbols, then = my=20 > change is correct. >=20 > Before: >=20 > static DEFINE_MUTEX(xxx); >=20 > Expands to something like: >=20 > static struct yyy xxx; static struct sysinit zzz; .... Not true. > If you want to change from "static struct sysinit zzz;" to "extern=20 > struct sysinit zzz" and also initialize the structure there, then that=20= > won't work, based on what I currently know about C-programming. I = tried,=20 > but clang gave me a warning about it. >=20 >=20 >=20 > You can't declare global variables inside a function or it is not good=20= > style. >=20 >=20 >=20 > =46rom what I can see, this location is the only place I've come = accross=20 > in the FreeBSD kernel, where a SYSINIT() is used inside a function, = and=20 > I thought I would just move that outside the function instead. >=20 > This change also allows for: >=20 > https://reviews.freebsd.org/D40193 >=20 =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Sun May 21 17:44:24 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPSdS0sFwz4CGRC for ; Sun, 21 May 2023 17:44:44 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic309-21.consmr.mail.gq1.yahoo.com (sonic309-21.consmr.mail.gq1.yahoo.com [98.137.65.147]) (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) by mx1.freebsd.org (Postfix) with ESMTPS id 4QPSdQ3DPBz3p92 for ; Sun, 21 May 2023 17:44:42 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=DtSFf9XQ; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.65.147 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1684691080; bh=yfPW/bIgT6+5s6Pa1iiNnz8sUaoNAMuaXp4osWZDdmI=; h=From:Subject:Date:References:To:In-Reply-To:From:Subject:Reply-To; b=DtSFf9XQJ0JMlBknZ3bc0xnZ/OyYeg2UJBguf/D5oPv3OxMoLXvUwp/R6ccwjq7+4maGFOyBpYECUjUaGppSB9UxXXP7wW7rRfefi3ko4PYKOX9XsUEi28/hubSkNpjj5PCa3K8YuZfnsAI60u3ygW2eiSZKkf0QACpUKsmvy1o/rwDU7zVai9EQYo+zhI/VGNBDpCqSnMW8JOiC6G3SbqekZ98qV9ytefspZCcMZiIH1bQWKfp/s5BlCyFnwJbcOZagRvufdNTBNCq8i4cZueRHXfVfcDvowRY5GxDwdZRwBquJ1w8DZBvd1MlWW0+LriPVv9yY9GVaPsVbvBOlmw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1684691080; bh=TgziR9RJ7+n00Lz6kqSJxyRnHF0JbTSXy9Mwh7UXtcm=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=IhE2dXkpMS7G+qV1YhTJRPSKyCiPDGdgitcINd5cb283iAL8DnW5W+kKUmtEtbyMJKAg13vGyIjA9PXueD9qsaTvVFxBZsJxLQeICdvWKci8/WTwartVz8mEZVbgKUiLA1s7olnnJ/Z/hIVdh4yrShITUnBqIyQuNrVueoNyPqcQ8rWtQvoB1KOuouInWGMoifeliTPK7ZYKV8zgPaHZxvTcd+5L5VxzutfWD6W9aPwN6JWUe6TFAYMeIa9PVQ9y9yFR8pSE54ld0VPbOSG1WJlQ10RBWelpSBmpaPZWDCdatglD9BZoizt62LG+JYm/tkYgveIeCGK29TF4j2UAvw== X-YMail-OSG: leg4tPsVM1lSmhUVafGRVJcWtJj10yjzkcMFsH_LwukPuezpO.Llu1tkPrTNSB3 dmGWLQqlihS9GXGxH20Pepfe4CYN8QH5POQiPzneYUJ7Jcg9yllY33SgQU3j8R6RI6FV7s9Dy6mb sDrK6J7D89A2hg8zlItxAsTtz1qwWYleZL7JmGAjnUFzHxFvLpCFqKzlQrJVFLC_v8uFQTw8T4Ce 6vhHSKKwcfdhdwaN_vBWtq5OjLTb0FSD2rqhO0pK6doxYJxjeVEY0dJiOu9dWdLgFc2Dux9UQ7fw UZOKd17.JlpAg88F1NOuSKaXVXn.3GVpLr5RbQ3EypXbFatR0jvaI_P7lBNftjc2v3.uzjjs3wR_ P5YYadWnYGSMYOloKzm_CKlsJn.D.09b.LTWfcLnFFso_Jva5xeZ1YXO.RNS85Pqa8CfDLe3.oUy 80j1MrYbxxhyQdq5HyNuq_CFeI0dz8KHNjDjXwk4TwZ_bzZMDqdeByIGCSWSM0kuwkYEIQ_iqHiK I53F4Rr7JWh0WN0sbtDxOoIQFz87Ds9Z8..vm7fxzrZVumQ5zjJbf0G7DXOzxyg.p0GMS4warndJ kU3vchq4SAlUHx1Ai16n858FyBi4LJGlV9apRUZ13vCUe28MIAVZ9R5D81QdkauxEjQnpDG430nU 5TPzHBRmtf.RPcm1JdbHf6qJ6VZWryooty6rwQwpjXryAUf7YlD3RTSS8Npf2iFz.a2BlsLidGZI f_MMZ6H34bTJf4wfS0rko4_26MFwPTeU780wcjprfufBSS0obuqVdjtoaWA5.1xkLLzuBOwmtI0t 6QzMoZ9wLSldEEa_jMbpJv4RmY1zZfdeUt7IntnTQOC2.h2lNebCrCWBkd8xqzDBE4SfvJXCPX1H qv280IJYx5tLjkRaahff0ZOJCin57v.cVHAFByiIvVCxQhJu9.U5OBi_xNuaqdm5VvQ.bXLPTkny EcqXlIdCoDEV8lL.spxO3mmRxUgMY99OPjJBbtfIeVNhOmNXj2O5H4YdEFJ58LbNE8gJcK25XBY9 sVPDrDsS6HgtijPIamUuz63NnP9OyNdhAetKav4OmXrVauPO3YuN_DVKEZbGKttNyQ1yI8MzP2Pm 0sUvZ7jKmDbNgR19cI88B0uvvEZx6HMpc7nlHyYlPj_0vr5a8UCsQ41a.Qgt6Z8hjMigS9bFRwF8 hqXCIGGo1kphd3YEQENX5HenpN8NAhf1vRbQYF80V6y74n_bNyisH0lXC7G8f23L_aU1PNGWNb.J VQm8khPMU4n.QeS29yC6.NhaBTxPCvtsXhty7qOzrXt9tYsl.qmaNmGZwibyLIk3DmM2h4_HyLMP R6_xzBT7yW10HqpOsXbLM33m0hfRfWVOCGtr5oKZV9ElJJICpfrZlzkhi5x_HWZVl1lLhTDQZiqx IeHJTDHW7.KRg5oMUaAAr2kAqbqH2djfMgQgelMejLdUceWYiJuw9K4o5IprbTulURPaUI20eAlc zdjdb.d0PZdCCRwAjG.Dn0zBqe9NiD2ZCJCBqnCxYMe_SUrkjdtFzg5JJbgaCl23KOWoFTX2O0_x tRoXPKVc4WJV5YgGR5cCCxEUBp7ILEf.WdxmFjiXZpUUfPjby.YMmTun37k2nqy8dpE_pPQGdqde nXBKweOMDUH9wOlFI6_5OjUGt2NXj9Ipfj.BL2ANZOUwgFe9RGzC6gl_7JE3SH6niea6oXAYkuCS WlIoSuJgP8FuXzzeioTjqxI2COY1boPTHdf_dkZJTGipJ2fH.t.pwV5TqvzL_5_HsPAGRw892L.n fEF6GES47r._iHlAPMWkD3MY9QklBK3mH4CFr6poVHXdaoafriEyqjTd_.ZncMjnq3wp3U5PHit8 R0Q70YWt8E_nO2ucUUSUxeCqQsmtX9aGG7P3_vXMOncfbTjZ5yPuGjLzJAiVh0Q4bl2Db0r9q7sd kVEj9dkBVnnVMtmd2nBoATN4glxtrVvlzXAtwGI5d7sP2oj6L.UCdjNLMDw5bSbmKQgN6PNfGl3J t6gYxmtGTuueCYMVcL7cJ2xdn87R41cW5WwELRMZKW7G6Qk2cLeioQmlu6lPJayit54DrndIvk4Y WdCCmfisHJn.ONgSSfdvG1VoMEmm74ui82AUwc7ZFuTUJUMVXmtQ8_2l_t6knyUwF.M6iAKKCGUR 6zHYxDQYlaO2DPhJudLce9.1HjYQV5zRgdlFdNRTidgqOzheuXn.jPIQXQUQOxCau2baqthTtAld ZYnNKcZvSgvFp8bINj.S1q.X3kM1NFDGnqH.BeBUKS1yRAxpK4fDN5zcNUEQN X-Sonic-MF: X-Sonic-ID: d595e3c0-dc79-4492-b83a-7ab631444897 Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.gq1.yahoo.com with HTTP; Sun, 21 May 2023 17:44:40 +0000 Received: by hermes--production-bf1-54475bbfff-xzdff (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 36f47a24694af5df4357bc199e5c103f; Sun, 21 May 2023 17:44:36 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Subject: Re: git: 805d759338a2 - main - mlx4: Move DEFINE_MUTEX() outside function body. Date: Sun, 21 May 2023 10:44:24 -0700 References: To: dev-commits-src-main@freebsd.org In-Reply-To: Message-Id: <333A3097-9FD1-4FE2-B7D1-5CE85F208C82@yahoo.com> X-Mailer: Apple Mail (2.3731.400.51.1.1) X-Spamd-Result: default: False [-3.12 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.62)[-0.619]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; MV_CASE(0.50)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.65.147:from]; BLOCKLISTDE_FAIL(0.00)[98.137.65.147:server fail]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; RCVD_TLS_LAST(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.65.147:from] X-Rspamd-Queue-Id: 4QPSdQ3DPBz3p92 X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N On May 21, 2023, at 10:14, Mark Millard wrote: > Hans Petter Selasky wrote on > Date: Sun, 21 May 2023 16:57:47 UTC : >=20 >> On 5/21/23 18:33, Jessica Clarke wrote: >>> On 21 May 2023, at 17:21, Hans Petter Selasky = wrote: >>>>=20 >>>> The branch main has been updated by hselasky: >>>>=20 >>>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3D805d759338a2be939fffc8bf3f25cfaa= b981a9be >>>>=20 >>>> commit 805d759338a2be939fffc8bf3f25cfaab981a9be >>>> Author: Hans Petter Selasky >>>> AuthorDate: 2023-05-21 11:25:28 +0000 >>>> Commit: Hans Petter Selasky >>>> CommitDate: 2023-05-21 16:20:16 +0000 >>>>=20 >>>> mlx4: Move DEFINE_MUTEX() outside function body. >>>>=20 >>>> Move static mutex declaration outside function body, to avoid = global >>>> variables being declared on the stack, when using SYSINITs. >>>=20 >>> What? This is nonsense. It=E2=80=99s not on the stack either way = round. >>>=20 >>> Please revert this. >>>=20 >>> Jess >>=20 >> Hi Jess, >>=20 >> I think this is a false positive of yours. You need to look through = all=20 >> the macros used there. >>=20 >> Basically DEFINE_MUTEX() expands to a bunch of structures, which are = not=20 >> in any block. >=20 > DEFINE_MUTEX is from/for linux related code: >=20 > # grep -r "define.*DEFINE_MUTEX" /usr/main-src/sys/ | more > /usr/main-src/sys/compat/linuxkpi/common/include/linux/mutex.h:#define = DEFINE_MUTEX(lock) \ >=20 > and looks like: >=20 > #define DEFINE_MUTEX(lock) = \ > mutex_t lock; = \ > SX_SYSINIT_FLAGS(lock, &(lock).sx, mutex_name(#lock), SX_DUPOK) Never mind: starting with mutex_t was not essential. >> The "static" you see in patch just covers the first mutex structure. >>=20 >> SYSINITs use "static" in front of all structure definitions. >> If you want to change from static structures to global symbols, then = my=20 >> change is correct. >>=20 >> Before: >>=20 >> static DEFINE_MUTEX(xxx); >>=20 >> Expands to something like: >>=20 >> static struct yyy xxx; static struct sysinit zzz; .... >=20 > Not true. Never mind: starting with mutex_t was not essential, despite it not having a "struct" explicitly. Sorry for the noise. >> If you want to change from "static struct sysinit zzz;" to "extern=20 >> struct sysinit zzz" and also initialize the structure there, then = that=20 >> won't work, based on what I currently know about C-programming. I = tried,=20 >> but clang gave me a warning about it. >>=20 >>=20 >>=20 >> You can't declare global variables inside a function or it is not = good=20 >> style. >>=20 >>=20 >>=20 >> =46rom what I can see, this location is the only place I've come = accross=20 >> in the FreeBSD kernel, where a SYSINIT() is used inside a function, = and=20 >> I thought I would just move that outside the function instead. >>=20 >> This change also allows for: >>=20 >> https://reviews.freebsd.org/D40193 >>=20 >=20 >=20 =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Sun May 21 17:46:51 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPSh36mDVz4CGSm; Sun, 21 May 2023 17:46:59 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4QPSh344lwz3ntT; Sun, 21 May 2023 17:46:59 +0000 (UTC) (envelope-from hselasky@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from [10.36.2.145] (unknown [46.212.121.255]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 16135260569; Sun, 21 May 2023 19:46:52 +0200 (CEST) Message-ID: Date: Sun, 21 May 2023 19:46:51 +0200 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: git: 805d759338a2 - main - mlx4: Move DEFINE_MUTEX() outside function body. To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202305211621.34LGLsup059861@gitrepo.freebsd.org> <54EF67D8-2A79-4EAB-8EFB-232F14FFE792@freebsd.org> <21c9532e-4ca7-a7fe-1ff6-07a94cbad6ab@freebsd.org> <3066464F-E4C6-4B84-ADFF-E578AFAFE622@freebsd.org> Content-Language: en-US From: Hans Petter Selasky In-Reply-To: <3066464F-E4C6-4B84-ADFF-E578AFAFE622@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4QPSh344lwz3ntT X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/32, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 5/21/23 19:05, Jessica Clarke wrote: > On 21 May 2023, at 17:57, Hans Petter Selasky wrote: > >> If you want to change from static structures to global symbols, then my change is correct. > > Which will bloat symbol tables excessively. But you didn’t state this as your goal, you stated it as a behavioural change *today*, which it’s not (other than changing the scope). Your commit message was entirely nonsense, and so I told you that. If your goal is instead to allow for future changes, put that in your commit message. I am not a mind reader, nor is anyone else. It is extremely unhelpful to have commits that say one thing but intend to achieve a different thing. Hi Jess, To me the word "avoid" is agnostic of time. And that's why I used it there. It doesn't mean there is a bug, but there may easily be a bug there. If you have time, I can add you for review more often. Let me know what you prefer. When the kernel uses dynamic linking, you end up having tons of relocation entries in the resulting ELF file. Getting rid of symbol names doesn't stop relocation entries from piling up. For example declaring a static mutex: At first you have the static mutex. Then the sysinit structure needs one relocation to refer to the static mutex. Then after that the dataset mechanism needs another relocation to refer to the sysinit structure. sysinit's work, but there may be better ways to do it. >> >> This change also allows for: >> >> https://reviews.freebsd.org/D40193 > > Which looks like a mess to me. If you have a better way in your mind to do this, then implement it, and let me know. --HPS From nobody Sun May 21 18:02:55 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPT2j5JGxz4CHcv for ; Sun, 21 May 2023 18:03:09 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QPT2j3BxPz3qWy for ; Sun, 21 May 2023 18:03:09 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-3f4249b7badso52274625e9.3 for ; Sun, 21 May 2023 11:03:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684692186; x=1687284186; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tOM1yX5eRVKVLoBpkb2lkJ3ChbfD8dQlzltKpV5R0Jc=; b=OZ9hOy3nAdJ/UCPh70lrYctFL521y2FfqrWcD4XQdUEBwXSvpV81q0G5BcMTO/8oRq wI1+Tx2Gbwnb7C0oYLDHOScRRVeRTisydw1bzWiBojbyP21WAZApizEFcj/N/UXFDys9 j7sZE4hI0VfwaHUMoc9p5KckGpf4ZpZKCCB7BvWbyuNa6xc1JBtwQz8s3lkecg85+0mq amfKyS/vlBN3lK2y0i6ujMIRWQniFZ+lA7x95+GSYrtzjPGPyLqvU+MlAUms9GFPq944 rrUswCky2d2Sn0+OjBbAVfbdQJtGupTUxqR6Ji9pvgnslUXe525uuSGN21I3vcNjRq/h qtQw== X-Gm-Message-State: AC+VfDyLo5RcHAObq9nZPDtvhhDcKUKAx1OqYbpyQlrqLP1TeVFkERdp cn4Sq5ZV/dFaN0OXxLaqE1tJmwCX6ffkUXGxkxM= X-Google-Smtp-Source: ACHHUZ4GLMdotKHJAAMQzLw7M4itHXeyNlyyhSNCjvyOqBbHKbuq7g/WdwCbggox7Voinj+nkNB/Bw== X-Received: by 2002:a05:600c:2608:b0:3f4:22ff:812 with SMTP id h8-20020a05600c260800b003f422ff0812mr5353129wma.26.1684692186637; Sun, 21 May 2023 11:03:06 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.246]) by smtp.gmail.com with ESMTPSA id s24-20020a1cf218000000b003f4f1b884cdsm9003433wmc.36.2023.05.21.11.03.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 May 2023 11:03:06 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: git: 805d759338a2 - main - mlx4: Move DEFINE_MUTEX() outside function body. From: Jessica Clarke In-Reply-To: Date: Sun, 21 May 2023 19:02:55 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <26465813-3B51-4E52-9E9D-F93A0F2AF6BD@freebsd.org> References: <202305211621.34LGLsup059861@gitrepo.freebsd.org> <54EF67D8-2A79-4EAB-8EFB-232F14FFE792@freebsd.org> <21c9532e-4ca7-a7fe-1ff6-07a94cbad6ab@freebsd.org> <3066464F-E4C6-4B84-ADFF-E578AFAFE622@freebsd.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3731.500.231) X-Rspamd-Queue-Id: 4QPT2j3BxPz3qWy X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 21 May 2023, at 18:46, Hans Petter Selasky = wrote: >=20 > On 5/21/23 19:05, Jessica Clarke wrote: >> On 21 May 2023, at 17:57, Hans Petter Selasky = wrote: >>> If you want to change from static structures to global symbols, then = my change is correct. >> Which will bloat symbol tables excessively. But you didn=E2=80=99t = state this as your goal, you stated it as a behavioural change *today*, = which it=E2=80=99s not (other than changing the scope). Your commit = message was entirely nonsense, and so I told you that. If your goal is = instead to allow for future changes, put that in your commit message. I = am not a mind reader, nor is anyone else. It is extremely unhelpful to = have commits that say one thing but intend to achieve a different thing. >=20 > Hi Jess, >=20 > To me the word "avoid" is agnostic of time. And that's why I used it = there. It doesn't mean there is a bug, but there may easily be a bug = there. I strongly disagree. Your wording heavily implied that you were avoiding = something that currently occurs. > If you have time, I can add you for review more often. Let me know = what you prefer. Code review is encouraged by the project, whether from me or anyone = else. > When the kernel uses dynamic linking, you end up having tons of = relocation entries in the resulting ELF file. Getting rid of symbol = names doesn't stop relocation entries from piling up. >=20 > For example declaring a static mutex: >=20 > At first you have the static mutex. Then the sysinit structure needs = one relocation to refer to the static mutex. Then after that the dataset = mechanism needs another relocation to refer to the sysinit structure. >=20 > sysinit's work, but there may be better ways to do it. I am well aware of how relocations work. I am a compiler and linker = developer (and co-chair of RISC-V=E2=80=99s psABI task group); my = expertise lies in the world of linking. Relocations serve a purpose at = run time. Symbols like this do not. Moreover they now risk clashing as = they=E2=80=99re now visible outside the translation unit. For example, = ib_addr.c and ib_cma.c both have static DEFINE_MUTEX(lock); and that = needs to work as-is because Linux=E2=80=99s DEFINE_MUTEX lets you do = that. So shoving a bunch of symbols into the global namespace is a = non-starter. Jess >>>=20 >>> This change also allows for: >>>=20 >>> https://reviews.freebsd.org/D40193 >> Which looks like a mess to me. > If you have a better way in your mind to do this, then implement it, = and let me know. >=20 > --HPS From nobody Sun May 21 19:01:38 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPVLT0p1Tz4CLdS; Sun, 21 May 2023 19:01:53 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QPVLR74nbz3wp5; Sun, 21 May 2023 19:01:51 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of antoine.brodin.freebsd@gmail.com designates 209.85.208.179 as permitted sender) smtp.mailfrom=antoine.brodin.freebsd@gmail.com; dmarc=none Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-2af1ae3a21fso43257371fa.0; Sun, 21 May 2023 12:01:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684695708; x=1687287708; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vOxp3gshki8RaZrXvuFbquVAfwaZiXs9lkqLtzHQTyc=; b=Idt5YAbGgD6DfO9AdgZ0eEqIY0SURoJtoljmLAaouiDZd/hUPl1A33LRNRNL1Ca38X EtohqA1mFhtJmhJuhFBe/EAXDtSBPLudbmfnQXbmbASdEUOu2u6LMDjC8XK1PYhBLx/m XExJ1Jfmqoil3EZunLCw+dpZxlzVSB27Yq2uXcFFUPIWNf2TTEEeZOb5Hcmrvg3jY7YA BAe86lmidXZCIXojUY5+bOUymIaFqukfnTf8aKoeRG1jczB/Yn0y5iWbdb+NYvguM68r 5GVntQzOaHMH+wXkn074Tz1kkBpZf88LZXs3Wm7Pw+1i5jxCYEqcnUFZIVq0XJTY7PTz hJGw== X-Gm-Message-State: AC+VfDzTL13JcXE54giYGOaXIyYy9J9xq8t1sOAojSfr+tIzp0HLNX3k kXOuNqQnwSVvPmq58KcJPhvRGTiXS95W6zeZIydz8R8l X-Google-Smtp-Source: ACHHUZ7wbDYnst2JZ54HdpuQtQAIZo1K/YjkP35wMtwoUUFcTfhMEAO3TF/43fPXx8StmlruHuMtVDu6yUbLxsY2T5w= X-Received: by 2002:a2e:b443:0:b0:2af:b4b:8581 with SMTP id o3-20020a2eb443000000b002af0b4b8581mr3259486ljm.0.1684695708205; Sun, 21 May 2023 12:01:48 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202304041231.334CVktq013660@gitrepo.freebsd.org> In-Reply-To: <202304041231.334CVktq013660@gitrepo.freebsd.org> From: Antoine Brodin Date: Sun, 21 May 2023 19:01:38 +0000 Message-ID: Subject: Re: git: 73ee5756dee6 - main - Fixes in the tcp infrastructure with respect to stack changes as well as other infrastructure updates for incoming rack features. To: Randall Stewart Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-1.69 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.998]; NEURAL_SPAM_SHORT(0.31)[0.311]; FORGED_SENDER(0.30)[antoine@freebsd.org,antoinebrodinfreebsd@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.179:from]; R_DKIM_NA(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.179:from]; FROM_NEQ_ENVFROM(0.00)[antoine@freebsd.org,antoinebrodinfreebsd@gmail.com]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_THREE(0.00)[4]; ARC_NA(0.00)[]; TAGGED_FROM(0.00)[]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4QPVLR74nbz3wp5 X-Spamd-Bar: - X-ThisMailContainsUnwantedMimeParts: N On Tue, Apr 4, 2023 at 12:31=E2=80=AFPM Randall Stewart w= rote: > > The branch main has been updated by rrs: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D73ee5756dee6b2110eb6fb2b2e= f3cde39a1fcb4f > > commit 73ee5756dee6b2110eb6fb2b2ef3cde39a1fcb4f > Author: Randall Stewart > AuthorDate: 2023-04-01 05:46:38 +0000 > Commit: Randall Stewart > CommitDate: 2023-04-01 05:46:38 +0000 > > Fixes in the tcp infrastructure with respect to stack changes as well= as other infrastructure updates for incoming rack features. > > So stack switching as always been a bit of a issue. We currently use = a break before make setup which means that > if something goes wrong you have to try to get back to a stack. This = patch among a lot of other things changes that so > that it is a make before break. We also expand some of the function b= locks in prep for new features in rack that will allow > more controlled pacing. We also add other abilities such as the pathw= ay for a stack to query a previous stack to acquire from > it critical state information so things in flight don't get dropped o= r mis-handled when switching stacks. We also add the > concept of a timer granularity. This allows an alternate stack to cha= nge from the old ticks granularity to microseconds and > of course this even gives us a pathway to go to nanosecond timekeepin= g if we need to (something for the data center to consider > for sure). > > Once all this lands I will then update rack to begin using all these = new features. > > Reviewed by: tuexen > Sponsored by: Netflix Inc > Differential Revision: https://reviews.freebsd.org/D39210 Hi, Could you hide some stuff in netinet/tcp.h? struct http_req breaks curl 8.1.0. Antoine From nobody Sun May 21 19:13:09 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPVbX41nXz4CLy5; Sun, 21 May 2023 19:13:12 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4QPVbX0NQSz3xXh; Sun, 21 May 2023 19:13:12 +0000 (UTC) (envelope-from hselasky@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from [10.36.2.145] (unknown [46.212.121.255]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 0C8192600D2; Sun, 21 May 2023 21:13:09 +0200 (CEST) Message-ID: Date: Sun, 21 May 2023 21:13:09 +0200 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: git: 805d759338a2 - main - mlx4: Move DEFINE_MUTEX() outside function body. Content-Language: en-US To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202305211621.34LGLsup059861@gitrepo.freebsd.org> <54EF67D8-2A79-4EAB-8EFB-232F14FFE792@freebsd.org> <21c9532e-4ca7-a7fe-1ff6-07a94cbad6ab@freebsd.org> <3066464F-E4C6-4B84-ADFF-E578AFAFE622@freebsd.org> <26465813-3B51-4E52-9E9D-F93A0F2AF6BD@freebsd.org> From: Hans Petter Selasky In-Reply-To: <26465813-3B51-4E52-9E9D-F93A0F2AF6BD@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4QPVbX0NQSz3xXh X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 5/21/23 20:02, Jessica Clarke wrote: > On 21 May 2023, at 18:46, Hans Petter Selasky wrote: >> >> On 5/21/23 19:05, Jessica Clarke wrote: >>> On 21 May 2023, at 17:57, Hans Petter Selasky wrote: >>>> If you want to change from static structures to global symbols, then my change is correct. >>> Which will bloat symbol tables excessively. But you didn’t state this as your goal, you stated it as a behavioural change *today*, which it’s not (other than changing the scope). Your commit message was entirely nonsense, and so I told you that. If your goal is instead to allow for future changes, put that in your commit message. I am not a mind reader, nor is anyone else. It is extremely unhelpful to have commits that say one thing but intend to achieve a different thing. >> >> Hi Jess, >> >> To me the word "avoid" is agnostic of time. And that's why I used it there. It doesn't mean there is a bug, but there may easily be a bug there. > > I strongly disagree. Your wording heavily implied that you were avoiding something that currently occurs. Hi Jess, Thanks for sharing your view. I know some words in English have multiple meanings, and should not be used, because the receiver may pick a different interpretation than you intended at the time of writing. The way you react makes me think "avoid" is one more of those words. I have a list of do-not-use words already. And it grows from time to time. Maybe an automated tool exists, to analyze texts for frequent multiple meanings, not just spell-checking. >> If you have time, I can add you for review more often. Let me know what you prefer. > > Code review is encouraged by the project, whether from me or anyone else. OK, no problem. > >> When the kernel uses dynamic linking, you end up having tons of relocation entries in the resulting ELF file. Getting rid of symbol names doesn't stop relocation entries from piling up. >> >> For example declaring a static mutex: >> >> At first you have the static mutex. Then the sysinit structure needs one relocation to refer to the static mutex. Then after that the dataset mechanism needs another relocation to refer to the sysinit structure. >> >> sysinit's work, but there may be better ways to do it. > > I am well aware of how relocations work. I am a compiler and linker developer (and co-chair of RISC-V’s psABI task group); my expertise lies in the world of linking. Relocations serve a purpose at run time. Symbols like this do not. Moreover they now risk clashing as they’re now visible outside the translation unit. For example, ib_addr.c and ib_cma.c both have static DEFINE_MUTEX(lock); and that needs to work as-is because Linux’s DEFINE_MUTEX lets you do that. So shoving a bunch of symbols into the global namespace is a non-starter. Yes, that is correct for Linux (and possibly other OS'es), but not for FreeBSD! Maybe I can take this opportunity to give you some insight. In the Linux kernel there may be multiple C- and object files resulting from compilation, sharing the same basename. Linux and FreeBSD both compile C-files into object files by substituting the ".c" suffix by ".o" (or something very similar). It depends a bit. In FreeBSD there are two modes of compilation: 1) Monotolith: /boot/kernel/kernel 2) Modules: /boot/kernel/*.ko If there is a kernel module, there is also a corresponding configuration keyword to include that kernel module into the monotolithic kernel. See for example "sys/amd64/conf/GENERIC". There are very few exceptions. The LINT target builds almost all sources into a monotolithic kernel. One difference between Linux and FreeBSD when doing the monotolithic kernel build: FreeBSD puts all object files resulting from compilation into the same object directory. This implies there cannot be two object files sharing the same name as a result of compilation. This in turn implies all source file names are unique across the whole of "sys/*", because converting a source file name into the corresponding object file name, is simply done by changing the suffix of the file in question. If you are worried multiple DEFINE_MUTEX(lock) will result in multiple global symbols having the same "lock" name, all you need to do is pass through the ${.TARGET} variable from "make" as a define, stripping a few invalid characters, and macro-concat that to the locally generated global variable name, and you are all good. Your comment is correct based on your prior knowledge about Linux and compilers. But at this point FreeBSD is different. That's why porting code from Linux to FreeBSD is sometimes difficult, because you need to keep track of how source files are renamed. You cannot just use "meld Linux/blah FreeBSD/blah" to compare directories ... --HPS From nobody Sun May 21 19:41:40 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPWDd54SJz4CP0K for ; Sun, 21 May 2023 19:41:53 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QPWDd18SQz429M for ; Sun, 21 May 2023 19:41:53 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-3f41d087bd3so31620595e9.3 for ; Sun, 21 May 2023 12:41:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684698111; x=1687290111; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z40xkHQf9aBfc6RDT43sO/1h+N0ROqGnUnByFPfFFEA=; b=VVGv6A6lRv1QIrUp8cJQisop57sgSTvrN4Hi+jnHW4t923U+PsERG4VHOuCmHuTRdG 5ZUjEVOKcWZri7FtCTBF9rcpIq6P7F3Xe0aeq6QE+kT37IBRvpL0PHdsKOeo5vSWsiK6 ofMln5UoXVtSMpfsLbcmob8IHtYccRtX9pJsk1gc39XicIJu8rXnVxkax2RwIbd+T6Vq afts7/7BZymsdFqJcZej4h5/X1dJ3wev2BQRc+c7xjVVOdm+hQHWOAqr7Gzvfp1dIZLR 6veDIWE3shp73SOGqfaVTTlarvgyjdgBTEq4Q1xpNWsL+MYdEGb/dClJI2jox0u4EAlu bT7w== X-Gm-Message-State: AC+VfDynld09sKav+kl8ll26JC99o6aWWuGpXCq4+e/froDEONckRtbc 8cpgRWnpJHJe35leN4C/DV0ZqyjJzItcnVMzHBc= X-Google-Smtp-Source: ACHHUZ7vsLUl+MSWrvr0xjytx8jF65tgXic+kqB9cIxRb0j3bn8SgG5ikmobxkLbiwfa1p8uH8+ELA== X-Received: by 2002:a05:600c:220d:b0:3f6:3bc:8562 with SMTP id z13-20020a05600c220d00b003f603bc8562mr1250071wml.1.1684698111350; Sun, 21 May 2023 12:41:51 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.246]) by smtp.gmail.com with ESMTPSA id l13-20020a7bc44d000000b003f42328b5d9sm5970983wmi.39.2023.05.21.12.41.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 May 2023 12:41:50 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: git: 805d759338a2 - main - mlx4: Move DEFINE_MUTEX() outside function body. From: Jessica Clarke In-Reply-To: Date: Sun, 21 May 2023 20:41:40 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <2BF2F7CF-82E6-4D98-800D-C35D7C29E948@freebsd.org> References: <202305211621.34LGLsup059861@gitrepo.freebsd.org> <54EF67D8-2A79-4EAB-8EFB-232F14FFE792@freebsd.org> <21c9532e-4ca7-a7fe-1ff6-07a94cbad6ab@freebsd.org> <3066464F-E4C6-4B84-ADFF-E578AFAFE622@freebsd.org> <26465813-3B51-4E52-9E9D-F93A0F2AF6BD@freebsd.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3731.500.231) X-Rspamd-Queue-Id: 4QPWDd18SQz429M X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 21 May 2023, at 20:13, Hans Petter Selasky = wrote: >=20 > On 5/21/23 20:02, Jessica Clarke wrote: >> On 21 May 2023, at 18:46, Hans Petter Selasky = wrote: >>>=20 >>> On 5/21/23 19:05, Jessica Clarke wrote: >>>> On 21 May 2023, at 17:57, Hans Petter Selasky = wrote: >>>>> If you want to change from static structures to global symbols, = then my change is correct. >>>> Which will bloat symbol tables excessively. But you didn=E2=80=99t = state this as your goal, you stated it as a behavioural change *today*, = which it=E2=80=99s not (other than changing the scope). Your commit = message was entirely nonsense, and so I told you that. If your goal is = instead to allow for future changes, put that in your commit message. I = am not a mind reader, nor is anyone else. It is extremely unhelpful to = have commits that say one thing but intend to achieve a different thing. >>>=20 >>> Hi Jess, >>>=20 >>> To me the word "avoid" is agnostic of time. And that's why I used it = there. It doesn't mean there is a bug, but there may easily be a bug = there. >> I strongly disagree. Your wording heavily implied that you were = avoiding something that currently occurs. >=20 > Hi Jess, >=20 > Thanks for sharing your view. I know some words in English have = multiple meanings, and should not be used, because the receiver may pick = a different interpretation than you intended at the time of writing. The = way you react makes me think "avoid" is one more of those words. I have = a list of do-not-use words already. And it grows from time to time. >=20 > Maybe an automated tool exists, to analyze texts for frequent multiple = meanings, not just spell-checking. >=20 >>> If you have time, I can add you for review more often. Let me know = what you prefer. >> Code review is encouraged by the project, whether from me or anyone = else. >=20 > OK, no problem. >=20 >>> When the kernel uses dynamic linking, you end up having tons of = relocation entries in the resulting ELF file. Getting rid of symbol = names doesn't stop relocation entries from piling up. >>>=20 >>> For example declaring a static mutex: >>>=20 >>> At first you have the static mutex. Then the sysinit structure needs = one relocation to refer to the static mutex. Then after that the dataset = mechanism needs another relocation to refer to the sysinit structure. >>>=20 >>> sysinit's work, but there may be better ways to do it. >> I am well aware of how relocations work. I am a compiler and linker = developer (and co-chair of RISC-V=E2=80=99s psABI task group); my = expertise lies in the world of linking. Relocations serve a purpose at = run time. Symbols like this do not. Moreover they now risk clashing as = they=E2=80=99re now visible outside the translation unit. For example, = ib_addr.c and ib_cma.c both have static DEFINE_MUTEX(lock); and that = needs to work as-is because Linux=E2=80=99s DEFINE_MUTEX lets you do = that. So shoving a bunch of symbols into the global namespace is a = non-starter. >=20 > Yes, that is correct for Linux (and possibly other OS'es), but not for = FreeBSD! Maybe I can take this opportunity to give you some insight. >=20 > In the Linux kernel there may be multiple C- and object files = resulting from compilation, sharing the same basename. Linux and FreeBSD = both compile C-files into object files by substituting the ".c" suffix = by ".o" (or something very similar). It depends a bit. >=20 > In FreeBSD there are two modes of compilation: >=20 > 1) Monotolith: /boot/kernel/kernel > 2) Modules: /boot/kernel/*.ko >=20 > If there is a kernel module, there is also a corresponding = configuration keyword to include that kernel module into the = monotolithic kernel. See for example "sys/amd64/conf/GENERIC". There are = very few exceptions. The LINT target builds almost all sources into a = monotolithic kernel. >=20 > One difference between Linux and FreeBSD when doing the monotolithic = kernel build: FreeBSD puts all object files resulting from compilation = into the same object directory. This implies there cannot be two object = files sharing the same name as a result of compilation. This in turn = implies all source file names are unique across the whole of "sys/*", = because converting a source file name into the corresponding object file = name, is simply done by changing the suffix of the file in question. I am aware of all of this. Please do not talk to me like I am an idiot. = Your tone here is extremely patronising. > If you are worried multiple DEFINE_MUTEX(lock) will result in multiple = global symbols having the same "lock" name, all you need to do is pass = through the ${.TARGET} variable from "make" as a define, stripping a few = invalid characters, and macro-concat that to the locally generated = global variable name, and you are all good. You could. But that=E2=80=99s a pretty gross hack IMO, and depending on = how you do it may still not be unique. Not to mention it=E2=80=99s going = to further bloat the symbol tables with these long names. Given the sysinit subsystem still needs to be able to merge in new = sysinits registered dynamically, one might as well just do the sort = dynamically, it=E2=80=99s very little added complexity on top, = especially when sorting functions are just a libkern call away. Much = less complexity than all this scripting to generate tables. > Your comment is correct based on your prior knowledge about Linux and = compilers. But at this point FreeBSD is different. That's why porting = code from Linux to FreeBSD is sometimes difficult, because you need to = keep track of how source files are renamed. You cannot just use "meld = Linux/blah FreeBSD/blah" to compare directories ... DEFINE_MUTEX is Linux=E2=80=99s API, implemented in LinuxKPI. So = Linux=E2=80=99s behaviour is absolutely relevant. Any deviation from = Linux=E2=80=99s semantics is an incompatibility that requires patching = any sources that are built for FreeBSD using LinuxKPI. It is generally = best to minimise that. So, once again, I am asking you to revert your change. Jess From nobody Sun May 21 21:37:13 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPYnn6P45z4CWFW; Sun, 21 May 2023 21:37:17 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4QPYnn1VVbz4JSY; Sun, 21 May 2023 21:37:17 +0000 (UTC) (envelope-from hselasky@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from [10.36.2.145] (unknown [46.212.121.255]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id C2EFC260D48; Sun, 21 May 2023 23:37:15 +0200 (CEST) Message-ID: Date: Sun, 21 May 2023 23:37:13 +0200 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: git: 805d759338a2 - main - mlx4: Move DEFINE_MUTEX() outside function body. Content-Language: en-US To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202305211621.34LGLsup059861@gitrepo.freebsd.org> <54EF67D8-2A79-4EAB-8EFB-232F14FFE792@freebsd.org> <21c9532e-4ca7-a7fe-1ff6-07a94cbad6ab@freebsd.org> <3066464F-E4C6-4B84-ADFF-E578AFAFE622@freebsd.org> <26465813-3B51-4E52-9E9D-F93A0F2AF6BD@freebsd.org> <2BF2F7CF-82E6-4D98-800D-C35D7C29E948@freebsd.org> From: Hans Petter Selasky In-Reply-To: <2BF2F7CF-82E6-4D98-800D-C35D7C29E948@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4QPYnn1VVbz4JSY X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 5/21/23 21:41, Jessica Clarke wrote: >> One difference between Linux and FreeBSD when doing the monotolithic kernel build: FreeBSD puts all object files resulting from compilation into the same object directory. This implies there cannot be two object files sharing the same name as a result of compilation. This in turn implies all source file names are unique across the whole of "sys/*", because converting a source file name into the corresponding object file name, is simply done by changing the suffix of the file in question. Hi Jess, > I am aware of all of this. Please do not talk to me like I am an idiot. Your tone here is extremely patronising. I can not know what you know before you tell me. I'm not a mind reader and I for sure don't think you are an idiot. Those are in such case your own words about yourself and not mine, to make it clear. >> If you are worried multiple DEFINE_MUTEX(lock) will result in multiple global symbols having the same "lock" name, all you need to do is pass through the ${.TARGET} variable from "make" as a define, stripping a few invalid characters, and macro-concat that to the locally generated global variable name, and you are all good. > You could. But that’s a pretty gross hack IMO, and depending on how you do it may still not be unique. Not to mention it’s going to further bloat the symbol tables with these long names. Why do you think I don't know what a hack is? In the case about the "lock" name being global: - My solution is to pass a define to the compiler to help make the identifier unique across the monotolithic kernel build. - When building the LINT target, the linker will fail if there are duplicate global symbols. Then the debug information output by the linker will tell the file and line. Go there and change the identifier. It should be rare. Problem solved. - All symbols being made global for the sake of processing them, are listed by name. And after the final sorted sysinit table is created and linked, all those symbol names can be stripped away from the resulting binary, and then only the relocations remain, if I'm not mistaken. I didn't do that in my differential review, because it is a prototype. The argument about symbol table bloat, because of prefixing or suffixing global symbols is not valid the way I see it. > > Given the sysinit subsystem still needs to be able to merge in new sysinits registered dynamically, one might as well just do the sort dynamically, it’s very little added complexity on top, especially when sorting functions are just a libkern call away. Much less complexity than all this scripting to generate tables. Do you agree about the following statement or not? If you have two already sorted lists and a pointer to each of them, then: Method a) place the two lists after each other in memory and then call qsort() on the resulting list, is relatively slow. Method b) look at the next element from each list, and store the smallest one into the destination list, and repeat until the end of both source lists are reached, is relatively much faster. > >> Your comment is correct based on your prior knowledge about Linux and compilers. But at this point FreeBSD is different. That's why porting code from Linux to FreeBSD is sometimes difficult, because you need to keep track of how source files are renamed. You cannot just use "meld Linux/blah FreeBSD/blah" to compare directories ... > DEFINE_MUTEX is Linux’s API, implemented in LinuxKPI. So Linux’s behaviour is absolutely relevant. Any deviation from Linux’s semantics is an incompatibility that requires patching any sources that are built for FreeBSD using LinuxKPI. It is generally best to minimise that. One side of this is compile time issues. If a developer needs to change something to make the code compile for FreeBSD, that's acceptable. And then the developer can also say the code was made for FreeBSD and not Linux, which is good with regards to the GPLv2 license, and not just copying solutions from Linux or being force to implement things exactly like on Linux, so-called bug-by-bug compliance. The other side is runtime issues. Here the goal should be to minimise issues to zero and try to outperform Linux. > So, once again, I am asking you to revert your change. I still cannot see why this change should be reverted. Does the following code example and compiler warning explain why this change should remain: # cat << EOF > test.c int main() { extern char string[]; char string[] = { "test" }; return (0); } EOF # cc -O2 -Wall test.c test.c:11:7: error: non-extern declaration of 'string' follows extern declaration char string[] = { "test" }; ^ test.c:10:14: note: previous declaration is here extern char string[]; Like my commit message says, you cannot declare global variables on the stack. When variables are on the stack, they are inside a function body. There is no stack outside any C-functions. It's just another way to say it and what is the problem about that? --HPS From nobody Sun May 21 21:58:45 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPZGp3Tzwz4CXQW for ; Sun, 21 May 2023 21:58:58 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QPZGp1tVxz4LYj for ; Sun, 21 May 2023 21:58:58 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-3078d1c8828so5053293f8f.3 for ; Sun, 21 May 2023 14:58:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684706336; x=1687298336; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z1KrN8S8Fr5ccnwuzvxQEbOWm4pD8ds7hWg4S1SGqSs=; b=ByZXUwfBBKix1QCF5Vb9zEgUFlNZe/TjmDFQBnFF8/vnFnYSoSXQRPLy18zKcPRVTZ y/D36jbNNlDcxH62e8VY1owge5mqMl0RoHbcupbya9G/ky+4fokynfVskfRsGcxwJ0Xs 67i591csguy0QkNWw7lHujIp7l9iXIlZ67sDKB9dhrsIIxoXQ5BJSXs1Kuhv5H9ElV7X k7BHdi0oHCllljYA63Lxl+/up//adcmr25JsFtdpkvxutVvLFCQ7lACKkrLTtprkwPq9 QcYuQycQUwRs5rKwuzJDekHt/GQbCY1RyY+Hyx0KcHqrGg8b/lE6SmbVqaITrKN+X6RK UR5w== X-Gm-Message-State: AC+VfDwpUK5W06cU93MbKp1MA2k0sJQj3rFm2E7QdCkn53y2/JYCAGZ3 aBUsOglxzZSIOH+QXSqAz79P/lNQEJlWurUiicQ= X-Google-Smtp-Source: ACHHUZ4DNmPOgFPkEdHKQXRQnHjx7rxbfLwkYvf3GahEkm6nVQP3Ry/5hWb8DizJfRTUXXsGoRUYmA== X-Received: by 2002:a5d:518a:0:b0:307:4836:64e4 with SMTP id k10-20020a5d518a000000b00307483664e4mr5934767wrv.52.1684706336569; Sun, 21 May 2023 14:58:56 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.246]) by smtp.gmail.com with ESMTPSA id c4-20020a7bc004000000b003f42461ac75sm9518004wmb.12.2023.05.21.14.58.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 May 2023 14:58:55 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: git: 805d759338a2 - main - mlx4: Move DEFINE_MUTEX() outside function body. From: Jessica Clarke In-Reply-To: Date: Sun, 21 May 2023 22:58:45 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202305211621.34LGLsup059861@gitrepo.freebsd.org> <54EF67D8-2A79-4EAB-8EFB-232F14FFE792@freebsd.org> <21c9532e-4ca7-a7fe-1ff6-07a94cbad6ab@freebsd.org> <3066464F-E4C6-4B84-ADFF-E578AFAFE622@freebsd.org> <26465813-3B51-4E52-9E9D-F93A0F2AF6BD@freebsd.org> <2BF2F7CF-82E6-4D98-800D-C35D7C29E948@freebsd.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3731.500.231) X-Rspamd-Queue-Id: 4QPZGp1tVxz4LYj X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 21 May 2023, at 22:37, Hans Petter Selasky = wrote: >=20 > On 5/21/23 21:41, Jessica Clarke wrote: >>> One difference between Linux and FreeBSD when doing the monotolithic = kernel build: FreeBSD puts all object files resulting from compilation = into the same object directory. This implies there cannot be two object = files sharing the same name as a result of compilation. This in turn = implies all source file names are unique across the whole of "sys/*", = because converting a source file name into the corresponding object file = name, is simply done by changing the suffix of the file in question. >=20 > Hi Jess, >=20 >> I am aware of all of this. Please do not talk to me like I am an = idiot. Your tone here is extremely patronising. >=20 > I can not know what you know before you tell me. I'm not a mind reader = and I for sure don't think you are an idiot. Those are in such case your = own words about yourself and not mine, to make it clear. You can=E2=80=99t know, though you could go look at commit history to = see that I have made changes to the build system and thus probably have = an understanding. Or you could assume that I know what I=E2=80=99m = talking about when I choose to engage. Both are good things to do that = show some amount of respect, otherwise you are at risk of insulting = people by assuming that you need to explain the basics to them. >>> If you are worried multiple DEFINE_MUTEX(lock) will result in = multiple global symbols having the same "lock" name, all you need to do = is pass through the ${.TARGET} variable from "make" as a define, = stripping a few invalid characters, and macro-concat that to the locally = generated global variable name, and you are all good. >=20 >> You could. But that=E2=80=99s a pretty gross hack IMO, and depending = on how you do it may still not be unique. Not to mention it=E2=80=99s = going to further bloat the symbol tables with these long names. >=20 > Why do you think I don't know what a hack is? I didn=E2=80=99t. I said =E2=80=9CIMO=E2=80=9D. *My* opinion. > In the case about the "lock" name being global: >=20 > - My solution is to pass a define to the compiler to help make the = identifier unique across the monotolithic kernel build. >=20 > - When building the LINT target, the linker will fail if there are = duplicate global symbols. Then the debug information output by the = linker will tell the file and line. Go there and change the identifier. = It should be rare. Problem solved. >=20 > - All symbols being made global for the sake of processing them, are = listed by name. And after the final sorted sysinit table is created and = linked, all those symbol names can be stripped away from the resulting = binary, and then only the relocations remain, if I'm not mistaken. I = didn't do that in my differential review, because it is a prototype. The = argument about symbol table bloat, because of prefixing or suffixing = global symbols is not valid the way I see it. >=20 >> Given the sysinit subsystem still needs to be able to merge in new = sysinits registered dynamically, one might as well just do the sort = dynamically, it=E2=80=99s very little added complexity on top, = especially when sorting functions are just a libkern call away. Much = less complexity than all this scripting to generate tables. >=20 > Do you agree about the following statement or not? >=20 > If you have two already sorted lists and a pointer to each of them, = then: >=20 > Method a) place the two lists after each other in memory and then call = qsort() on the resulting list, is relatively slow. >=20 > Method b) look at the next element from each list, and store the = smallest one into the destination list, and repeat until the end of both = source lists are reached, is relatively much faster. Clearly merging is faster. But compared with qsort it=E2=80=99s unlikely = to be all that significant; lg n grows slowly. >>> Your comment is correct based on your prior knowledge about Linux = and compilers. But at this point FreeBSD is different. That's why = porting code from Linux to FreeBSD is sometimes difficult, because you = need to keep track of how source files are renamed. You cannot just use = "meld Linux/blah FreeBSD/blah" to compare directories ... >> DEFINE_MUTEX is Linux=E2=80=99s API, implemented in LinuxKPI. So = Linux=E2=80=99s behaviour is absolutely relevant. Any deviation from = Linux=E2=80=99s semantics is an incompatibility that requires patching = any sources that are built for FreeBSD using LinuxKPI. It is generally = best to minimise that. >=20 > One side of this is compile time issues. If a developer needs to = change something to make the code compile for FreeBSD, that's = acceptable. And then the developer can also say the code was made for = FreeBSD and not Linux, which is good with regards to the GPLv2 license, = and not just copying solutions from Linux or being force to implement = things exactly like on Linux, so-called bug-by-bug compliance. >=20 > The other side is runtime issues. Here the goal should be to minimise = issues to zero and try to outperform Linux. I don=E2=80=99t have any clue what you=E2=80=99re going on about here. = Tweaking Linux code to be compatible with FreeBSD=E2=80=99s LinuxKPI = doesn=E2=80=99t suddenly render the code free from GPLv2, it=E2=80=99s = still Linux-derived code, but you=E2=80=99ve had to modify it rather = than be able to use it as-is, which is the goal of LinuxKPI, where = possible. And so ideally *no* changes would be acceptable. So I disagree = with your statement that needing to change things is acceptable; it=E2=80=99= s only acceptable where there is no good alternative. I don=E2=80=99t see what =E2=80=9Coutperform Linux=E2=80=9D has to do = with any of this discussion. >> So, once again, I am asking you to revert your change. >=20 > I still cannot see why this change should be reverted. Because it serves no purpose today, and should always remain valid code, = because Linux=E2=80=99s API makes that valid, and thus LinuxKPI should = ensure it=E2=80=99s valid too. If the change is required then LinuxKPI's = compatibility has been broken, which is a regression that should not be = permitted. Therefore it is totally unnecessary, and if anything is worse = because it unnecessarily increases the scope of a variable that is only = needed within a single function. > Does the following code example and compiler warning explain why this = change should remain: >=20 > # cat << EOF > test.c > int > main() > { > extern char string[]; > char string[] =3D { "test" }; >=20 > return (0); > } > EOF >=20 > # cc -O2 -Wall test.c > test.c:11:7: error: non-extern declaration of 'string' follows extern = declaration > char string[] =3D { "test" }; > ^ > test.c:10:14: note: previous declaration is here > extern char string[]; >=20 >=20 >=20 > Like my commit message says, you cannot declare global variables on = the stack. When variables are on the stack, they are inside a function = body. There is no stack outside any C-functions. It's just another way = to say it and what is the problem about that? I understood what you were *actually* trying to achieve with the change = from your first reply. I have never disputed that. What I disputed was = your commit message, which at best is extremely misleading and at worst = makes no sense, and the necessity of the change. But this case should = not be hit here, because if it is then you=E2=80=99ve broken LinuxKPI. Please revert the commit. It should never be necessary. I=E2=80=99m not = going to ask a fourth time. Jess From nobody Sun May 21 22:06:43 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPZRw3ltSz4CXZV for ; Sun, 21 May 2023 22:06:52 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from www121.sakura.ne.jp (www121.sakura.ne.jp [153.125.133.21]) (using TLSv1.3 with cipher TLS_AES_256_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 4QPZRt3sksz4ML5; Sun, 21 May 2023 22:06:49 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of junchoon@dec.sakura.ne.jp has no SPF policy when checking 153.125.133.21) smtp.mailfrom=junchoon@dec.sakura.ne.jp; dmarc=none Received: from kalamity.joker.local (123-1-88-210.area1b.commufa.jp [123.1.88.210]) (authenticated bits=0) by www121.sakura.ne.jp (8.16.1/8.16.1/[SAKURA-WEB]/20201212) with ESMTPA id 34LM6i3a012521; Mon, 22 May 2023 07:06:44 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) Date: Mon, 22 May 2023 07:06:43 +0900 From: Tomoaki AOKI To: Randall Stewart Cc: Antoine Brodin , dev-commits-src-main@freebsd.org Subject: Re: git: 73ee5756dee6 - main - Fixes in the tcp infrastructure with respect to stack changes as well as other infrastructure updates for incoming rack features. Message-Id: <20230522070643.99f8aa0c5509c0d3a5f2ae0b@dec.sakura.ne.jp> Organization: Junchoon corps X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd13.2) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-0.58 / 15.00]; FAKE_REPLY(1.00)[]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; NEURAL_HAM_SHORT(-0.98)[-0.981]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; ASN(0.00)[asn:7684, ipnet:153.125.128.0/18, country:JP]; FROM_EQ_ENVFROM(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; R_SPF_NA(0.00)[no SPF record]; HAS_ORG_HEADER(0.00)[]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCPT_COUNT_THREE(0.00)[3]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[sakura.ne.jp]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Queue-Id: 4QPZRt3sksz4ML5 X-Spamd-Bar: / X-ThisMailContainsUnwantedMimeParts: N > On Tue, Apr 4, 2023 at 12:31 PM Randall Stewart wrote: >> >> The branch main has been updated by rrs: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=73ee5756dee6b2110eb6fb2b2ef3cde39a1fcb4f >> >> commit 73ee5756dee6b2110eb6fb2b2ef3cde39a1fcb4f >> Author: Randall Stewart >> AuthorDate: 2023-04-01 05:46:38 +0000 >> Commit: Randall Stewart >> CommitDate: 2023-04-01 05:46:38 +0000 >> >> Fixes in the tcp infrastructure with respect to stack changes as well as other infrastructure updates for incoming rack features. >> >> So stack switching as always been a bit of a issue. We currently use a break before make setup which means that >> if something goes wrong you have to try to get back to a stack. This patch among a lot of other things changes that so >> that it is a make before break. We also expand some of the function blocks in prep for new features in rack that will allow >> more controlled pacing. We also add other abilities such as the pathway for a stack to query a previous stack to acquire from >> it critical state information so things in flight don't get dropped or mis-handled when switching stacks. We also add the >> concept of a timer granularity. This allows an alternate stack to change from the old ticks granularity to microseconds and >> of course this even gives us a pathway to go to nanosecond timekeeping if we need to (something for the data center to consider >> for sure). >> >> Once all this lands I will then update rack to begin using all these new features. >> >> Reviewed by: tuexen >> Sponsored by: Netflix Inc >> Differential Revision: https://reviews.freebsd.org/D39210 > > Hi, > > Could you hide some stuff in netinet/tcp.h? > struct http_req breaks curl 8.1.0. > > Antoine Please refer to Bug 271526 [1], especially Comment 4 [2] by Jonathan Reynolds. A patch is proposed there inline (not as an attachment). [1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271526 [2] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271526#c4 -- Tomoaki AOKI From nobody Sun May 21 22:13:26 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPZbX4yD4z4CXbQ; Sun, 21 May 2023 22:13:28 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4QPZbW4XJQz4MmP; Sun, 21 May 2023 22:13:27 +0000 (UTC) (envelope-from hselasky@freebsd.org) Authentication-Results: mx1.freebsd.org; dkim=none; spf=softfail (mx1.freebsd.org: 88.99.82.50 is neither permitted nor denied by domain of hselasky@freebsd.org) smtp.mailfrom=hselasky@freebsd.org; dmarc=none Received: from [10.36.2.145] (unknown [46.212.121.255]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 8C5C12600DD; Mon, 22 May 2023 00:13:26 +0200 (CEST) Message-ID: <8f46512a-f086-6da0-2fdd-3ffc89f4dfdd@freebsd.org> Date: Mon, 22 May 2023 00:13:26 +0200 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: git: 805d759338a2 - main - mlx4: Move DEFINE_MUTEX() outside function body. Content-Language: en-US From: Hans Petter Selasky To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202305211621.34LGLsup059861@gitrepo.freebsd.org> <54EF67D8-2A79-4EAB-8EFB-232F14FFE792@freebsd.org> <21c9532e-4ca7-a7fe-1ff6-07a94cbad6ab@freebsd.org> <3066464F-E4C6-4B84-ADFF-E578AFAFE622@freebsd.org> <26465813-3B51-4E52-9E9D-F93A0F2AF6BD@freebsd.org> <2BF2F7CF-82E6-4D98-800D-C35D7C29E948@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-3.09 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.986]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@FreeBSD.org,dev-commits-src-main@FreeBSD.org]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all:c]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[hselasky]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4QPZbW4XJQz4MmP X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N On 5/21/23 23:37, Hans Petter Selasky wrote: > DEFINE_MUTEX is Linux’s API, implemented in LinuxKPI. So Linux’s > behaviour is absolutely relevant. Any deviation from Linux’s semantics > is an incompatibility that requires patching any sources that are built > for FreeBSD using LinuxKPI. It is generally best to minimise that. Jess, listen: Probably at some point, there could be an initialization macro for the SX locks used in the LinuxKPI, being of type SX_NOWITNESS, simply plotting in the constants needed in the sx structure, exactly like they do under Linux. Then neither SYSINITs, nor my patch will be needed for the sake of DEFINE_MUTEX(). Can we wait for that? The reason for this is Linux has a bad habit of not destroying locks, so FreeBSD cannot add any WITNESS objects for locks that are not destroyed anyway. Most of the work done by sx_init() is putting a few constants into various SX structure fields. Only the WITNESS part needs execution, if you get what I mean. This change is made so I can let others easily test another patchset. Also this change is harmless as such. Looking at the whole Linux tree, the most common way is to use DEFINE_MUTEX() outside macros and functions: # grep -r DEFINE_MUTEX * | grep -vE ":static " | grep -vE ":DEFINE_MUTEX" | wc -l 57 # grep -r DEFINE_MUTEX * | wc -l 1293 --HPS From nobody Sun May 21 22:32:11 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPb1B3cJnz4CYsZ; Sun, 21 May 2023 22:32:14 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4QPb1B2h0mz4PCs; Sun, 21 May 2023 22:32:14 +0000 (UTC) (envelope-from hselasky@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from [10.36.2.145] (unknown [46.212.121.255]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 0163E26070C; Mon, 22 May 2023 00:32:12 +0200 (CEST) Message-ID: <19a57dbf-81f0-8f57-554f-1791c5303088@freebsd.org> Date: Mon, 22 May 2023 00:32:11 +0200 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: git: 805d759338a2 - main - mlx4: Move DEFINE_MUTEX() outside function body. Content-Language: en-US To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202305211621.34LGLsup059861@gitrepo.freebsd.org> <54EF67D8-2A79-4EAB-8EFB-232F14FFE792@freebsd.org> <21c9532e-4ca7-a7fe-1ff6-07a94cbad6ab@freebsd.org> <3066464F-E4C6-4B84-ADFF-E578AFAFE622@freebsd.org> <26465813-3B51-4E52-9E9D-F93A0F2AF6BD@freebsd.org> <2BF2F7CF-82E6-4D98-800D-C35D7C29E948@freebsd.org> From: Hans Petter Selasky In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4QPb1B2h0mz4PCs X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/32, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 5/21/23 23:58, Jessica Clarke wrote: > What I disputed was your commit message, which at best is extremely misleading and at worst makes no sense, and the necessity of the change. Hi Jess, Your request for revert has been noted, but I see no urgency in such a revert. The code is perfectly fine either way. --HPS From nobody Sun May 21 22:32:22 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPb1Z5qR2z4CYsc for ; Sun, 21 May 2023 22:32:34 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QPb1Z5Q5Jz4Q2b for ; Sun, 21 May 2023 22:32:34 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-307a8386946so3333768f8f.2 for ; Sun, 21 May 2023 15:32:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684708353; x=1687300353; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=auE9RGJvV48lZWdBD4OugXlFGkHJ/9pRUprocpkDo7o=; b=IidX+yI0euiSAQmDUR0NctK7cs04oX8XjdCg70lLCQpmMdG2Ifjpm8Q0vnouV0GfgZ F515yG7J3fQMqI/h5DY4SPm0hFN4OMxepUc8kzN/olIxjf6QhoLmj8qyg63219eiVfnl aR6jaREwEUARqvXVCs66pNeb11zQv6/AO3szLebNNopt8RAC1HiZYNsr8G9m0yYIAZ6W 5QTB2uQnwiCuTRY8FHJBmEW1Bwajq3+fe1wWHHHrFociZ2nQA8zvZzOEgRp9lZDSngxF 7YuSLIq3pcQ+DKxbR0BR8J7c19QilmSSkgIrnNttC9btzfX9DhcBoSeaRd3Y3tQZ+zsC QfaQ== X-Gm-Message-State: AC+VfDxllbBvEsjwYVES+qXosDHDeBgm1PlXSthQPtbNTEHLDl6LOYeV yqm6ZbAPoiS0m4s3igFAoPgKpA== X-Google-Smtp-Source: ACHHUZ5/BDqBagqB1NDTKkzi0QJebz3rojQUe0YWx13c3lMS+PwMCHc04PeMUVtEsg8r1O/30q57Jg== X-Received: by 2002:adf:de0e:0:b0:309:395d:8da5 with SMTP id b14-20020adfde0e000000b00309395d8da5mr6555329wrm.22.1684708353422; Sun, 21 May 2023 15:32:33 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.246]) by smtp.gmail.com with ESMTPSA id a9-20020a5d5709000000b0030922ba6d0csm5676280wrv.45.2023.05.21.15.32.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 May 2023 15:32:33 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: git: 805d759338a2 - main - mlx4: Move DEFINE_MUTEX() outside function body. From: Jessica Clarke In-Reply-To: <8f46512a-f086-6da0-2fdd-3ffc89f4dfdd@freebsd.org> Date: Sun, 21 May 2023 23:32:22 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <1787C08C-AD82-48EC-92E2-49360B1AB8B0@freebsd.org> References: <202305211621.34LGLsup059861@gitrepo.freebsd.org> <54EF67D8-2A79-4EAB-8EFB-232F14FFE792@freebsd.org> <21c9532e-4ca7-a7fe-1ff6-07a94cbad6ab@freebsd.org> <3066464F-E4C6-4B84-ADFF-E578AFAFE622@freebsd.org> <26465813-3B51-4E52-9E9D-F93A0F2AF6BD@freebsd.org> <2BF2F7CF-82E6-4D98-800D-C35D7C29E948@freebsd.org> <8f46512a-f086-6da0-2fdd-3ffc89f4dfdd@freebsd.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3731.500.231) X-Rspamd-Queue-Id: 4QPb1Z5Q5Jz4Q2b X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 21 May 2023, at 23:13, Hans Petter Selasky = wrote: >=20 > On 5/21/23 23:37, Hans Petter Selasky wrote: >> DEFINE_MUTEX is Linux=E2=80=99s API, implemented in LinuxKPI. So = Linux=E2=80=99s behaviour is absolutely relevant. Any deviation from = Linux=E2=80=99s semantics is an incompatibility that requires patching = any sources that are built for FreeBSD using LinuxKPI. It is generally = best to minimise that. >=20 > Jess, listen: >=20 > Probably at some point, there could be an initialization macro for the = SX locks used in the LinuxKPI, being of type SX_NOWITNESS, simply = plotting in the constants needed in the sx structure, exactly like they = do under Linux. >=20 > Then neither SYSINITs, nor my patch will be needed for the sake of = DEFINE_MUTEX(). Can we wait for that? No. If anything this is another reason why your patch is unnecessary; = you=E2=80=99re giving yet another reason here why it isn=E2=80=99t = needed for the changes you=E2=80=99re proposing. > The reason for this is Linux has a bad habit of not destroying locks, = so FreeBSD cannot add any WITNESS objects for locks that are not = destroyed anyway. Most of the work done by sx_init() is putting a few = constants into various SX structure fields. Only the WITNESS part needs = execution, if you get what I mean. >=20 > This change is made so I can let others easily test another patchset. = Also this change is harmless as such. Once again I will remind you that the FreeBSD tree is not somewhere for = you to play around with experiments. Changes should be properly = justified. This one is completely unjustified today, and should remain = unjustified in future lest LinuxKPI compatibility be broken. > Looking at the whole Linux tree, the most common way is to use = DEFINE_MUTEX() outside macros and functions: Because a lot of the time, mutexes are needed in multiple functions? All = this tells me is there are 57 cases of the pattern you want to break; = i.e. Linux supports this and makes use of it. Unless, and until, there is consensus that `static DEFINE_MUTEX(...);` = within a function body should be broken by LinuxKPI, this patch does not = belong in the tree. So, for the fourth time, please revert it. I do not = want to have to escalate this further; it would be a colossal waste of = everyone=E2=80=99s time. Jess > # grep -r DEFINE_MUTEX * | grep -vE ":static " | grep -vE = ":DEFINE_MUTEX" | wc -l > 57 >=20 > # grep -r DEFINE_MUTEX * | wc -l > 1293 >=20 > --HPS From nobody Sun May 21 22:51:32 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPbRV014Cz4CZq2; Sun, 21 May 2023 22:51:34 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4QPbRT6Jd2z3Bnl; Sun, 21 May 2023 22:51:33 +0000 (UTC) (envelope-from hselasky@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from [10.36.2.145] (unknown [46.212.121.255]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 65725260BF1; Mon, 22 May 2023 00:51:32 +0200 (CEST) Message-ID: <6ed6216b-d237-fbe0-e2b8-960c53a53562@freebsd.org> Date: Mon, 22 May 2023 00:51:32 +0200 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: git: 805d759338a2 - main - mlx4: Move DEFINE_MUTEX() outside function body. Content-Language: en-US To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202305211621.34LGLsup059861@gitrepo.freebsd.org> <54EF67D8-2A79-4EAB-8EFB-232F14FFE792@freebsd.org> <21c9532e-4ca7-a7fe-1ff6-07a94cbad6ab@freebsd.org> <3066464F-E4C6-4B84-ADFF-E578AFAFE622@freebsd.org> <26465813-3B51-4E52-9E9D-F93A0F2AF6BD@freebsd.org> <2BF2F7CF-82E6-4D98-800D-C35D7C29E948@freebsd.org> <8f46512a-f086-6da0-2fdd-3ffc89f4dfdd@freebsd.org> <1787C08C-AD82-48EC-92E2-49360B1AB8B0@freebsd.org> From: Hans Petter Selasky In-Reply-To: <1787C08C-AD82-48EC-92E2-49360B1AB8B0@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4QPbRT6Jd2z3Bnl X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 5/22/23 00:32, Jessica Clarke wrote: > Once again I will remind you that the FreeBSD tree is not somewhere for you to play around with experiments. Changes should be properly justified. Hi Jess, This is FreeBSD-current / main and my change is perfectly fine as such. Sorry. It is not my problem why GIT has to use cryptographic hashes, so that commit messages cannot be changed without forced pushing. The justification for this change should be clear from our e-mail exchange. --HPS From nobody Sun May 21 22:55:58 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPbXq4YQGz4CbNJ for ; Sun, 21 May 2023 22:56:11 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QPbXq0j9fz3CRZ for ; Sun, 21 May 2023 22:56:11 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-3f41d087b24so35409375e9.1 for ; Sun, 21 May 2023 15:56:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684709769; x=1687301769; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6Wsuem8UfpPbX9TXOTJntE4Y4yzuzt5h1wLg0ziuY0s=; b=Rna3/jnnJhA8jRRZ8yoRTS6E+ou5TnAFCxh/6lOgT3uzVBOYm369jDVCHq6PSK1bUD prQpWefmAtXmBNz7Isoqowhhmg+C0GMhL1cCVkzPi/K6ZeeWw4zxLVypiOYRFhG0WkAT WOXT2GaxdD5mpamIPfXT96yPrRhHZk4c+wO5GRcy8zgNGDWmj7vaKSui36sC9+jzYYze ylzEpyckiwiUl+jUuVmG8vjYTvLb4oIBBtmkmhVvDhTmkZnsJEwWCu4termW1UJuK+E0 twYCfAePhEk3mM/2WQR/wXW/vA4Hpr5BB+vJ/E5Kk++yf9AVhMxhNxMYZCa97Lg+prh6 YJZA== X-Gm-Message-State: AC+VfDw8L8F7bVL/HMxocRHffJAH+DkzIu4LMUtm7DoT5AkP4E6KThQC cQQJTm0BCQDfR1QxQ5Lyu11qPQ== X-Google-Smtp-Source: ACHHUZ7eC5/yUL/W/5TP+I/YlOF8Gi8SOjk4Kt1KdR6XSlzAmiJgaeXYPXwTCBpM+uKoGP7YpM54EA== X-Received: by 2002:adf:ee91:0:b0:309:509f:a7f0 with SMTP id b17-20020adfee91000000b00309509fa7f0mr6317193wro.44.1684709769552; Sun, 21 May 2023 15:56:09 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.246]) by smtp.gmail.com with ESMTPSA id f5-20020a5d4dc5000000b002fe13ec49fasm5716484wru.98.2023.05.21.15.56.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 May 2023 15:56:09 -0700 (PDT) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: git: 805d759338a2 - main - mlx4: Move DEFINE_MUTEX() outside function body. From: Jessica Clarke In-Reply-To: <6ed6216b-d237-fbe0-e2b8-960c53a53562@freebsd.org> Date: Sun, 21 May 2023 23:55:58 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <7482D20A-86B1-434B-A817-AECEF6D5828B@freebsd.org> References: <202305211621.34LGLsup059861@gitrepo.freebsd.org> <54EF67D8-2A79-4EAB-8EFB-232F14FFE792@freebsd.org> <21c9532e-4ca7-a7fe-1ff6-07a94cbad6ab@freebsd.org> <3066464F-E4C6-4B84-ADFF-E578AFAFE622@freebsd.org> <26465813-3B51-4E52-9E9D-F93A0F2AF6BD@freebsd.org> <2BF2F7CF-82E6-4D98-800D-C35D7C29E948@freebsd.org> <8f46512a-f086-6da0-2fdd-3ffc89f4dfdd@freebsd.org> <1787C08C-AD82-48EC-92E2-49360B1AB8B0@freebsd.org> <6ed6216b-d237-fbe0-e2b8-960c53a53562@freebsd.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3731.500.231) X-Rspamd-Queue-Id: 4QPbXq0j9fz3CRZ X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 21 May 2023, at 23:51, Hans Petter Selasky = wrote: >=20 > On 5/22/23 00:32, Jessica Clarke wrote: >> Once again I will remind you that the FreeBSD tree is not somewhere = for you to play around with experiments. Changes should be properly = justified. >=20 > Hi Jess, >=20 > This is FreeBSD-current / main and my change is perfectly fine as = such. Sorry. Just because it=E2=80=99s not stable/* or releng/* doesn=E2=80=99t mean = you can=E2=80=99t do whatever you want. > It is not my problem why GIT has to use cryptographic hashes, so that = commit messages cannot be changed without forced pushing. I don=E2=80=99t even want to start up that debate again. > The justification for this change should be clear from our e-mail = exchange. Your attempt at one is. A justification that I wholeheartedly disagree = with, and that you yourself have undermined by stating multiple ways in = which you would make it unnecessary. For the fifth time: revert this patch. Today. Not at some point in the = future of your choice when you feel like it. Jess From nobody Sun May 21 23:01:27 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPbg83KK7z4Cbcv for ; Sun, 21 May 2023 23:01:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QPbg80PmZz3DRs for ; Sun, 21 May 2023 23:01:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-5112cae8d82so4219882a12.2 for ; Sun, 21 May 2023 16:01:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1684710098; x=1687302098; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=WDXuVcUKV5xprYfj4Rcf1PWf++KRG6LKG5uLMauKOPY=; b=ZZKKczf2+XDquw5lgxU1OaA/2isQ5TAIG7oyNwiHmMWNvUvnhSiF2oJV9kw8fd6baq RqlWuuBpI5V08h1QVZ8ALc3Nr1a1AGorTzSR1QtgA730GXSDbXSNFZdlFa+dM57F6rTW 8lAJmWv89SFfWGQNmg66n5UHmyq556nh68xKduUAn/Hb3VUdIx0ma8r1NiDZal7PW3EO wPGpg9s1ckIHjRlMdoE6+VYMF0GxZmna/cbMrNo47xiob2khX9Xv90dh7AAHACEhW/yG vh1cuvG7zN6CwUpjLGh81rmbkkvfNsoaWuN73FsS4aNdLWKGsbVeNzOXV2LYLVfGT4gg 1Ctw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684710098; x=1687302098; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WDXuVcUKV5xprYfj4Rcf1PWf++KRG6LKG5uLMauKOPY=; b=bgjg+3gBZdYBmiVz1/4Bh1kysDhGURNx+MBjGZtwOFZIeB/0ntVdZK79Xsp5LF8ZZ9 pdqAyhSrH/itFrtf1FpZxO3paqEAGrWrwixnEX4JQwBER8iH9rO5aEVUcDKgplkEjP+z n29gFSt7ocw997F3DZe50GFRjYde//PzUNPks+Hawt0EHnNBMQqWIdhqIjtPmntc50v+ T5tjWhX/riXsB0l6Pk9pS4XH0DUqwcHwwrUYhsEe9Tmp+O1SyGEND03ipyZTX4S6Nemy C78QQY8C1Eo+CrPtlS4B1Z3ZW1dmCrC5CRnzYGOLrQREOMS31yxTfGUWnqMgnbwhabHC 8iBw== X-Gm-Message-State: AC+VfDz9BnmdLMrq78SE7SHnCPFP2Kf5lGcuC/sRns7ytTkHtISUcx5m C2UHEtQudPqX0uXXioYaISbAUPb3e7x7H+NNAnvBew== X-Google-Smtp-Source: ACHHUZ4ODtiPVNukYnSR3YYddBRErquV4HFv1yyHu0KDOnM3QAHf0lEw3YCLOQftQDyoJ96wmTkdGaGwur3wRe38zp4= X-Received: by 2002:a50:ed8d:0:b0:510:55a3:97ad with SMTP id h13-20020a50ed8d000000b0051055a397admr7049655edr.0.1684710098254; Sun, 21 May 2023 16:01:38 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202305211621.34LGLsup059861@gitrepo.freebsd.org> <54EF67D8-2A79-4EAB-8EFB-232F14FFE792@freebsd.org> <21c9532e-4ca7-a7fe-1ff6-07a94cbad6ab@freebsd.org> <3066464F-E4C6-4B84-ADFF-E578AFAFE622@freebsd.org> <26465813-3B51-4E52-9E9D-F93A0F2AF6BD@freebsd.org> <2BF2F7CF-82E6-4D98-800D-C35D7C29E948@freebsd.org> <19a57dbf-81f0-8f57-554f-1791c5303088@freebsd.org> In-Reply-To: <19a57dbf-81f0-8f57-554f-1791c5303088@freebsd.org> From: Warner Losh Date: Sun, 21 May 2023 19:01:27 -0400 Message-ID: Subject: Re: git: 805d759338a2 - main - mlx4: Move DEFINE_MUTEX() outside function body. To: Hans Petter Selasky Cc: Jessica Clarke , src-committers , "" , "" Content-Type: multipart/alternative; boundary="000000000000f4d7c205fc3c22b8" X-Rspamd-Queue-Id: 4QPbg80PmZz3DRs X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000f4d7c205fc3c22b8 Content-Type: text/plain; charset="UTF-8" On Sun, May 21, 2023, 4:32 PM Hans Petter Selasky wrote: > On 5/21/23 23:58, Jessica Clarke wrote: > > What I disputed was your commit message, which at best is extremely > misleading and at worst makes no sense, and the necessity of the change. > > Hi Jess, > > Your request for revert has been noted, but I see no urgency in such a > revert. The code is perfectly fine either way. > Now is not the time for stubbornness. This change is easy to bring back in if it proves to be what we want. Project custom dictates requests for back out be given strong consideration unless there's a really compelling reason why that's a bad idea. (And I don't see anything like that here). Just my suggestion... Also, I think time away from the keyboard would help de-escalate things. This change isn't worth getting so worked up over. Warner > --000000000000f4d7c205fc3c22b8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Sun, May 21, 2023, 4:32 PM Hans Petter Selasky <= hselasky@freebsd.org> wrote:=
On 5/21/23 23:58, Jessica Clarke w= rote:
> What I disputed was your commit message, which at best is extremely mi= sleading and at worst makes no sense, and the necessity of the change.

Hi Jess,

Your request for revert has been noted, but I see no urgency in such a
revert. The code is perfectly fine either way.
=


N= ow is not the time for stubbornness. This change is easy to bring back in i= f it proves to be what we want. Project custom dictates requests for back o= ut be given strong consideration unless there's a really compelling rea= son why that's a bad idea. (And I don't see anything like that here= ).=C2=A0

Just my suggest= ion...

Also, I think tim= e away from the keyboard would help de-escalate things. This change isn'= ;t worth getting so worked up over.

Warner
--000000000000f4d7c205fc3c22b8-- From nobody Sun May 21 23:14:27 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPbxw10XPz4Cc0l; Sun, 21 May 2023 23:14: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 4QPbxv6JTQz3FXB; Sun, 21 May 2023 23:14:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684710867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jeZfjF5oXhSdZ/Ixt+XHzh9U72xnB0ZokYAHsQJyZIk=; b=SYLTaTmJcxNPJpsF31R3PsGGx4rNRYP7Ksvt6fDn16ibTvWXW6IR7l1OUSU/TkPLHNv6z9 inZHzAPGAC8ZFhb6dUnbnfvIOJhIwiR6PcuQmwLbUrJkT20WCMoVaBJldyhcsNft1j2mbL zGMLFVF6R6RESQm9Gi+UFMssBbq6je0k35Q6RxhfRkefYt0Truu5G4lq0skwaligyX3kI8 72B8SHDHgatAenfFL1h1Ts8Ukg/nS/MR0nclNrWuA+CZ973ErPyiWH6b1FCvSQN047vamB ekrXaP4SWlB2ThreRBYfIjNSmroCv9hnWZpG7TqW/DKc4ABJl4ZQI+tAb7tuvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684710867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jeZfjF5oXhSdZ/Ixt+XHzh9U72xnB0ZokYAHsQJyZIk=; b=ieUbnj6VhI/Y8vZukpp7xUxVQF3vQhsuiXELW+fwEr5rHyKTEBer16temYvMOVTHezhhBS Rn3Xo/YPwKxXdld1XVAreVcSlJR1WGjXvigZnihQChHXhISv4F6YFbblLPwNs3YP3Gxgtk WbfFUXV2pGXSNFK8uXAjgeh98AWDu8IQGxElSeIkzJZVHi7+cv/+1niitsWbIoL7asc1eG B8dBRR1gnas9Awjyji2Bpl6t5VPrS9x0uZmdrqZD7HrZUNHP18/p9517BxZZGyRD7XhMcz 0fb4rf8wahj3Mvn7D5oxQKda60tm4Ij3ukQcptFNnoUFP1NcLiwiuP/zF5PqfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684710867; a=rsa-sha256; cv=none; b=ZH3JJjirxzdSDZig0IpVd0WygLJsWvrdXCHX2UMxYtJj9WDVQ4bXDbUURotzfGdQH+njcn LMWuhQh3eKvhFE5qMVS+3lDetXe9JwsaUB00jO/i2VoV67AaY5ZNiyKXwBnvFULOHizBGx 8kTtA8f6Inv6hHkH/JsG66/NxmhhYBq2aZn4qJSOwii2GARuNgYVnaKCDds2vfFpUa6lOJ gX3IEU111vzRsucwC+265Q/LWGrWA/R0wvunaSRv8M07mxtdhp8mc6/BlVWjeZ8g0Ax8b6 KTD0BS8gUgjapJFNXwj7wx0UvAbEorPl/OLhF+mcetXaDxXQtphOEqi/Hbmu6g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QPbxv5Ltzz19Qy; Sun, 21 May 2023 23:14: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 34LNERu9042021; Sun, 21 May 2023 23:14:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34LNER0S042020; Sun, 21 May 2023 23:14:27 GMT (envelope-from git) Date: Sun, 21 May 2023 23:14:27 GMT Message-Id: <202305212314.34LNER0S042020@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 046d8d89ed19 - main - LinuxKPI: fix WRITE_ONCE(), remove ACCESS_ONCE() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 046d8d89ed1956944b12ec4f0580c30bc202bbfb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=046d8d89ed1956944b12ec4f0580c30bc202bbfb commit 046d8d89ed1956944b12ec4f0580c30bc202bbfb Author: Bjoern A. Zeeb AuthorDate: 2023-05-13 15:17:47 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-05-21 23:14:05 +0000 LinuxKPI: fix WRITE_ONCE(), remove ACCESS_ONCE() Fix a gcc warning: "to be safe all intermediate pointers in cast from '...' to '...' must be 'const' qualified [-Wcast-qual]". Doing what is essentially a __DECONST() adding the uintptr_t gets rid of the massive amount of warnings we get in LinuxKPI and lets us see the actual problems a lot better. This is a follow-up to 74e908b3c63b28de1d590dc42502fbe959a6da2e which fixed READ_ONCE(). ACCESS_ONCE() seems to be an obsolete KPI these days in Linux and FreeBSD does not use it either directly so we can entirely remove it now. Sponsored by: The FreeBSD Foundation Suggested by: jhb Reviewed by: hselasky MFC after: 10 days Differential Revision: https://reviews.freebsd.org/D40084 --- sys/compat/linuxkpi/common/include/linux/compiler.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/compiler.h b/sys/compat/linuxkpi/common/include/linux/compiler.h index b2c835ad808d..323a583860b4 100644 --- a/sys/compat/linuxkpi/common/include/linux/compiler.h +++ b/sys/compat/linuxkpi/common/include/linux/compiler.h @@ -88,11 +88,9 @@ #define ___PASTE(a,b) a##b #define __PASTE(a,b) ___PASTE(a,b) -#define ACCESS_ONCE(x) (*(volatile __typeof(x) *)&(x)) - #define WRITE_ONCE(x,v) do { \ barrier(); \ - ACCESS_ONCE(x) = (v); \ + (*(volatile __typeof(x) *)(uintptr_t)&(x)) = (v); \ barrier(); \ } while (0) From nobody Sun May 21 23:16:21 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPc0N02YNz4CcJg; Sun, 21 May 2023 23:16:36 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QPc0L6RTjz3Gkn; Sun, 21 May 2023 23:16:34 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.167.51 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com; dmarc=none Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-4f3b9c88af8so1413147e87.2; Sun, 21 May 2023 16:16:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684710993; x=1687302993; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=V5r3YlEbo2NzW1Yra5/NDNZY9V/uyw5JQNxOATbvSVg=; b=l/PYUVGWEutEaWWOp7vJTSH/ox6wD2kQL3zKE0DNA5CeV1QFpjeSW1OD+Nh+5zVNBJ DYRpAsoCTn0h9Ed4077/n0OMRMHioH/c6wMKV4RPMh1gHb+rEHOLew0Zsnu6FxA/wWGk t+yyM2VPSYgvEZFpIohsRk007krfD52vwTNN7BXM9puHa2cX+bwz0Z8mRpkrDxhx4Dzv DsDYyhvQWZJ32K+94Md1bFJbYXpxCHBRp6+qUo7OggHTQNBJzl/nmIHm0Ji+dU2fEdk+ r4iDkS6W/y74zlno7NFcudzn3CJantZchbPAeKgwG7IrpbYAb5qdqkFjLNtvVtDZLMfu pldg== X-Gm-Message-State: AC+VfDwS12mAp8zFbP2TYn91xVuMDM61wN3/9qnjltfvXOZWl9iXp5eB gU13au3WEagI9aJGi3baORdtKBdbVuCatV/ZZao8p4vWTkI= X-Google-Smtp-Source: ACHHUZ5RMKI0BPRzVd9pxLEYDqzP/Vrq+YES6bMrUzxnHQ+aWqum6JyIBJzgjzWp2omp3sh0X6w6MJo2yh/nK+VNm2c= X-Received: by 2002:ac2:4355:0:b0:4f3:a9d4:45f0 with SMTP id o21-20020ac24355000000b004f3a9d445f0mr2908850lfl.17.1684710992837; Sun, 21 May 2023 16:16:32 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202305201841.34KIfpN7025526@gitrepo.freebsd.org> In-Reply-To: From: Ed Maste Date: Sun, 21 May 2023 19:16:21 -0400 Message-ID: Subject: Re: git: c6750ddec917 - main - Require the OpenSSL 1.1 APIs when compiling ldns To: Rick Macklem Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Spamd-Result: default: False [-2.21 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; NEURAL_HAM_SHORT(-0.21)[-0.209]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.51:from]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; R_DKIM_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.51:from]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[carpeddiem]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TAGGED_RCPT(0.00)[]; TO_DN_SOME(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4QPc0L6RTjz3Gkn X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N On Sat, 20 May 2023 at 17:32, Rick Macklem wrote: > > Ok, thanks to Jessica, I now see that the Committer's Guide has > "Submitted by:" listed as deprecated. I was confused because it is > listed in the left column and then you have to read the next column > to see what you are supposed to do now. > > I'll learn to read someday, rick No worries Rick. In my opinion if documentation is misinterpreted it's an indication that it is not as clear as it could be. I've opened a review to add "(deprecated)" in the first column to try to make it clear. https://reviews.freebsd.org/D40196 Best, Ed From nobody Mon May 22 08:08:43 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPqpM6pPcz4TCH3; Mon, 22 May 2023 08:08: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 4QPqpM6FQFz47JT; Mon, 22 May 2023 08:08:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684742923; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/UzlLZsuNi1JxT2WbcWj097AwO0NIT76P5hX42KqLxo=; b=lVhCCgnMxQu93DQAmRgXSe5ZngdN2DOgdbNJbyA5+1UECNlvioHlP2CchR7XhXyTj/W5XP lqZ8xsyL/fswVIv0LoaP/M1NnRCKxxXaypYIeduyCD//grhcMPRR8KscpZ1ZIYO44Xoor2 IYVyQQ7RPHDS+7jbO4lusLP/geB1CyX+W3RlsxtZskbkDo2JHeH8KV9eXPpLBRnbhRhI74 PCDtzHYzWWa2KLnpm75v41DfYifk8ZwW1EQv33QG/xvDPp28K7ZCLE/4LjgtSnDxyshTf9 osZO7kRmy0JgRmHgn0fDNDp6CUWfmRHTbEPq15MXT6C8I3qBB3SSJQqG8UGs5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684742923; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/UzlLZsuNi1JxT2WbcWj097AwO0NIT76P5hX42KqLxo=; b=owetIGFxGUuiTK8XRIs1M0AQ/DEOVaqYd3zqpTXy9TMoy728kP6QNp4eKeGcFYzR6jnNzx 2g3QNM1QIah3y4oW19+tZ9PXVgzOezB8MLpTWBrG3Wi/qvEqRkVtTlLPlM2hS1i99D24Lr iIKi3o791UIE7O/nWwuvp8l+mko8E8otm4qQJHcTY8cLc4nOIeN4FiLLhss5QHCcelpjbY Zb7E9zCxi7JZk/a2hIUtGUDcpZ/mZTrSy6EVuWZ49e3ldLwhPI2vranrjtq6rFc/yqtG26 pXFPYtcb2r6SOCo3ZH6zpanaMItrg51/iBMgCCMN5NmbqkmXM29ZEE1H9a77QA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684742923; a=rsa-sha256; cv=none; b=YI3q5XJdNlRmJwVpyCMVCBBewydwPKnbBEm3yxzmvil+exvlfieKg80ack7lgal0iUrt+P VRWFtT23SWXeogavMt5MguN2BSmMuEeRWqjWmUM5Cru0KuEMMik9oSBa1dR8/N8ipzzP6z mNgM1kOqugSb9l4862iQRJO9b73fXPJjFxjGfMRg2Zqc8q+p6g6U7su0qrmtJEoU6iD1yx JsbRDG4Mk1nWg9KKVhl4WcsU7hdCRef1tQBJZS5XhdhBt2IPI1jdEEQeWeim/3Yti/KDsM ptgV68GGOshEDT/NgNhx6iWgOawpFbVrZtTPEqii39McYIGTNfaTuh7GFJXiUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QPqpM5Jb0z1PTd; Mon, 22 May 2023 08:08: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 34M88hhZ018375; Mon, 22 May 2023 08:08:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34M88hgL018374; Mon, 22 May 2023 08:08:43 GMT (envelope-from git) Date: Mon, 22 May 2023 08:08:43 GMT Message-Id: <202305220808.34M88hgL018374@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: ca0088ae27a5 - main - stress2: Occasionally modify 8 bits List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ca0088ae27a5154f9279b53b2f7493986167d967 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=ca0088ae27a5154f9279b53b2f7493986167d967 commit ca0088ae27a5154f9279b53b2f7493986167d967 Author: Peter Holm AuthorDate: 2023-05-22 08:05:34 +0000 Commit: Peter Holm CommitDate: 2023-05-22 08:05:34 +0000 stress2: Occasionally modify 8 bits --- tools/test/stress2/tools/flip.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/test/stress2/tools/flip.c b/tools/test/stress2/tools/flip.c index a298aebf6d43..e1f12e97a79c 100644 --- a/tools/test/stress2/tools/flip.c +++ b/tools/test/stress2/tools/flip.c @@ -70,6 +70,15 @@ flip(void *ap, size_t len) #endif } +static void +trash(char *c) +{ + if (arc4random() % 2 == 1) + *c = 0; + else + arc4random_buf(c, sizeof(c)); +} + int main(int argc, char *argv[]) { @@ -122,7 +131,10 @@ main(int argc, char *argv[]) err(1, "lseek()"); if (read(fd, &c, 1) != 1) err(1, "read()"); - flip(&c, 1); + if (arc4random() % 100 < 80) + flip(&c, 1); + else + trash(&c); if (lseek(fd, pos, SEEK_SET) == -1) err(1, "lseek()"); if (write(fd, &c, 1) != 1) From nobody Mon May 22 08:08:44 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPqpP0R2Tz4TCH4; Mon, 22 May 2023 08:08: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 4QPqpP011Lz47KD; Mon, 22 May 2023 08:08:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684742925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Ysp/bEcCiFUXiGpbCdf1V62TzXy8lBOtSyCqGfGpBY=; b=MsGMksSNhpgw60azKMr/vzzATY4pbKpTnB56+7/ZlUYOQ0DKVksjZvLYsnETx2MtCnOocd v08blC9q0kOKrVyWgtz/kq861vz3SP9qeMMILcKTwSL0UZD8whGpVPnK05LFHaiVx7OGL/ Z1xbhVTgrhs6mH2tvjTj1evYeatlyXxzP0Cdw8v+GcjXesYcjWW76MgX1CX3HrfzSdRFuD 9H/FDKGEcXKOCE+K6qMuJNqGFyEiKKNGN/wn9pNYf7s4L2qtC5rlhq8SfNGsDx8JzgIIa3 rWk/d5HkrSYrhtRbMvfDgVbexPJgKmrPAzOchbCSI50Sp+Jkd6eVlTWAGgF9gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684742925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Ysp/bEcCiFUXiGpbCdf1V62TzXy8lBOtSyCqGfGpBY=; b=DfOW79fzorYO6GL3FMyd7pGSFku3+qmZ4Q9q/3sI8VsBA6C7aVsuXUh0QcdB+9GIDH4wMu yCdTlXVMt/IjOTSSU0zeNPpBMsUvt0t8XVa0n1DLoIlwB4UT5s1wRA6r9ETZtFGbEz//0o zAujaOTeOL0KmQF+CjaG9AQImWWUGdVyJqorZDNUhrjvP1I/4HYS17yRJLDgn2rmO3Hkm2 unoqenehVl/zUBWgw2DZ4PC8149NriOMXMzmXVtxWbmLhGe3PPuPbvsOtTUOrrJNXTEBE8 vT+cPWRdiOgNDmxVVve11TO/fB2T6y8DS/QfdtMureHPlYPwG543L+ApG2WcHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684742925; a=rsa-sha256; cv=none; b=BSBkdroWvpoAQVqAJtf/W+5T6VimqcWlda5QjQWbY/dYsSEuK6hu9pT9IgX63oQco9/H5m UdXH6OoRyiU5o9zxMv22MzGy8zQQi5T10TR0jCfEOPhI9lXxZJGieBiZ2VXOmLV8r95wXf ojvEQCJ6dWqhGd+F/T3hGht9Q6We4BlfN2kBTmKYABYIRaySZKwahMGy06Dbg9tFBbXRUR 9JG57gxVk6E6DnlM+8Npv+zecqI/DMRKanWL3GqzZoh05cMLuyLy4qBA3oPhBKzlswjWYb cITkiqOy3hpFJumLoFhjsOjqqUQByaK5zSOYibYIGa0ju0lsmDpbVP9TBZL77g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QPqpN6CxGz1PGF; Mon, 22 May 2023 08:08: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 34M88i56018395; Mon, 22 May 2023 08:08:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34M88if7018394; Mon, 22 May 2023 08:08:44 GMT (envelope-from git) Date: Mon, 22 May 2023 08:08:44 GMT Message-Id: <202305220808.34M88if7018394@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: be8d01b51516 - main - stress2: Added a faster test of fsck_ffs by omitting mount(8) and umount(8) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: be8d01b51516b96c07ea95e4dbcc6e23c73e3bb5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=be8d01b51516b96c07ea95e4dbcc6e23c73e3bb5 commit be8d01b51516b96c07ea95e4dbcc6e23c73e3bb5 Author: Peter Holm AuthorDate: 2023-05-22 08:07:40 +0000 Commit: Peter Holm CommitDate: 2023-05-22 08:07:40 +0000 stress2: Added a faster test of fsck_ffs by omitting mount(8) and umount(8) --- tools/test/stress2/misc/fsck13.sh | 152 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) diff --git a/tools/test/stress2/misc/fsck13.sh b/tools/test/stress2/misc/fsck13.sh new file mode 100755 index 000000000000..f279e0bae066 --- /dev/null +++ b/tools/test/stress2/misc/fsck13.sh @@ -0,0 +1,152 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2023 Peter Holm +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +# fsck_ffs(8) disk image fuzz test. +# Test without mount(8) and umount(8) + +. ../default.cfg + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +cc -o /tmp/flip -Wall -Wextra -O2 ../tools/flip.c || exit 1 + +# Disable the calls to sync(2) in fsck_ffs(8) to speed up the test +echo 'int sync(void) { return (0); }' > /tmp/fsck_preload.c +mycc -o /tmp/fsck_preload.so -shared -fpic /tmp/fsck_preload.c || exit 1 +rm /tmp/fsck_preload.c + +set -eu +u1=$mdstart +u2=$((mdstart + 1)) +mp1=${mntpoint}$u1 +prog=$(basename "$0" .sh) +mkdir -p $mp1 + +max=$((2 * 1024 * 1024)) # Two alternate super blocks @ 192 and 2240 +i=`jot -r 1 1 3` +[ $i -eq 1 ] && flags="-O2" +[ $i -eq 2 ] && flags="-U" +[ $i -eq 3 ] && { flags="-j"; max=$((8 * 1024 * 1024)); } + +backup=$mp1/$prog.diskimage.$flags.`date +%Y%m%dT%H%M%S` +core=/tmp/$prog.core.`date +%Y%m%dT%H%M%S` +diskimage=$mp1/$prog.diskimage +log=$mp1/$prog.log + +asbs=0 +cleans=0 +reruns=0 +waccess=0 + +set +e +mount | grep "on $mp1 " | grep -q /dev/md && umount -f $mp1 +[ -c /dev/md$u1 ] && mdconfig -d -u $u1 +mdconfig -a -t swap -s 10g -u $u1 +newfs $newfs_flags /dev/md$u1 > /dev/null +mount /dev/md$u1 $mp1 + +[ -c /dev/md$u2 ] && mdconfig -d -u $u2 +dd if=/dev/zero of=$diskimage bs=$max count=1 status=none +mdconfig -a -t vnode -f $diskimage -u $u2 +backups=`newfs -N $flags md$u2 | grep -A1 "super-block backups" | \ + tail -1 | sed 's/,//g'` +echo "newfs $flags /dev/md$u2" +newfs $flags md$u2 > /dev/null +mdconfig -d -u $u2 + +chk() { + local i + + clean=0 + rerun=0 + waccess=0 + LD_PRELOAD=/tmp/fsck_preload.so \ + timeout 2m fsck_ffs -fy $1 > $log 2>&1 + r=$? + if grep -qiE "super-?block.*failed" $log; then + for b in $backups; do + asbs=$((asbs + 1)) + LD_PRELOAD=/tmp/fsck_preload.so \ + timeout 2m fsck_ffs -b $b -fy $1 > $log 2>&1 + r=$? + grep -qiE "super-?block.*failed" $log || + break + done + usedasb=1 + else + usedasb=0 + fi + LANG=C egrep -q "[A-Z][A-Z]" $log && clean=0 + grep -Eq "IS CLEAN|MARKED CLEAN" $log && clean=1 + # For now regard a "was modified" as a cause for a rerun, + # disregarding "clean" claim. + grep -Eq "WAS MODIFIED" $log && rerun=1 + grep -q RERUN $log && rerun=1 + grep -q "NO WRITE ACCESS" $log && waccess=1 + [ $r -ne 0 -a $clean -eq 1 ] && echo "Exit code $r w/ clean == 1" +} + +cd $mp1 +s=0 +start=`date +%s` +while [ $((`date +%s` - start)) -lt 60 ]; do + /tmp/flip -n 50 $diskimage + + cp $diskimage $backup + + for i in `jot 10`; do + chk $diskimage + [ $i -eq 1 -a "$flags" = "-j" ] && continue # First run processes the journal + [ $rerun -eq 1 ] && { reruns=$((reruns + 1)); continue; } + [ $clean -eq 1 ] && { cleans=$((cleans + 1)); break; } + [ -f fsck_ffs.core ] && { s=1; break 2; } + [ $r -eq 124 ] && { s=2; break 2; } # timeout + done + [ $clean -ne 1 ] && break + [ $r -ne 0 -a $clean -eq 1 ] && + { echo "CLEAN && non zero exit code"; break; } + [ $clean -eq 1 ] && continue + [ $usedasb -eq 1 ] && { echo "Alt. SB failed"; s=104; } + [ $waccess -eq 1 ] && { echo "No write access"; s=105; } + break +done + +echo "$cleans cleans, $reruns reruns, $asbs alternate SBs." +if [ $clean -ne 1 ]; then + echo "FS still not clean. Last fsck_ffs exit code was $r." + [ $s -eq 0 ] && s=106 +fi +grep -q "Superblock check-hash failed" $log && s=0 # Ignore for now +grep -q "is not a file system superblock" $log && s=0 # Ignore for now +[ $s -ne 0 ] && { gzip $backup; cp -v $backup.gz /tmp; } +cd /tmp +umount $mp1 +mdconfig -d -u $u1 +rm -f /tmp/flip /tmp/fsck_preload.so +exit $s From nobody Mon May 22 10:42:39 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPvD20bKJz4TLlh; Mon, 22 May 2023 10:42:42 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4QPvD1707Cz4LSx; Mon, 22 May 2023 10:42:41 +0000 (UTC) (envelope-from hselasky@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from [10.36.2.145] (unknown [46.212.121.255]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id E2A7F260483; Mon, 22 May 2023 12:42:40 +0200 (CEST) Message-ID: Date: Mon, 22 May 2023 12:42:39 +0200 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: git: 805d759338a2 - main - mlx4: Move DEFINE_MUTEX() outside function body. Content-Language: en-US To: Warner Losh Cc: Jessica Clarke , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202305211621.34LGLsup059861@gitrepo.freebsd.org> <54EF67D8-2A79-4EAB-8EFB-232F14FFE792@freebsd.org> <21c9532e-4ca7-a7fe-1ff6-07a94cbad6ab@freebsd.org> <3066464F-E4C6-4B84-ADFF-E578AFAFE622@freebsd.org> <26465813-3B51-4E52-9E9D-F93A0F2AF6BD@freebsd.org> <2BF2F7CF-82E6-4D98-800D-C35D7C29E948@freebsd.org> <19a57dbf-81f0-8f57-554f-1791c5303088@freebsd.org> From: Hans Petter Selasky In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4QPvD1707Cz4LSx X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 5/22/23 01:01, Warner Losh wrote: > On Sun, May 21, 2023, 4:32 PM Hans Petter Selasky > wrote: > >> On 5/21/23 23:58, Jessica Clarke wrote: >>> What I disputed was your commit message, which at best is extremely >> misleading and at worst makes no sense, and the necessity of the change. >> >> Hi Jess, >> >> Your request for revert has been noted, but I see no urgency in such a >> revert. The code is perfectly fine either way. >> > > > Now is not the time for stubbornness. This change is easy to bring back in > if it proves to be what we want. Project custom dictates requests for back > out be given strong consideration unless there's a really compelling reason > why that's a bad idea. (And I don't see anything like that here). > > Just my suggestion... Hi Jess and Warner, Since the "stable/14" branch has not been made as it should, the 12th of May 2023, I'll revert this change, so it doesn't flow into there. Still, when commit messages are not clear, the FreeBSD way to handle that is by follow-up e-mails. Not so often I see people re-applying commits, because the commit message is wrong. As long as the code changes made er OK, the commit message is secondary. Honestly speaking, I see no code technical reason for immediate action on this issue. But I'll respect Jess's wish as a member of the FreeBSD team, even I don't agree about this decision. --HPS From nobody Mon May 22 10:44:32 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPvG82ZwPz4TMKp; Mon, 22 May 2023 10:44: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 4QPvG823M7z4Lm6; Mon, 22 May 2023 10:44:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684752272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=358+hv2TWqC/evMuWDPOSZ0yAexyUSSauiEBnBsk3Nw=; b=wstK+KpYg4OZconsu6siYPghsLdipROO2Sj/i5S8GrqBLHSYIlBMAoZ/spxTXLU7VWtSSH GGSwHA/3CDYRqremEWaIpRTNyAGIowRlB/rvzzygkYWK2yx/ay+KoUr5pPpVwOv7qETKCb wPEg6693+GNcs+AFWYj9je2i9/wz5AnnEQ7litE8M4mt4ih5VYxfFAQxI6SxK1WzBTXWYq ha4e0u8BEfSKVigFl89mqzMpPdqbGUy/KUxVu2640htt/loXhrDvMeteQFHoDMkxYOW3tT bwDR/PjbGKbkNlUWKngES8UY0vJSKwj9Ub8ESHupoh/TXcNpwr23oN3+KfC4NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684752272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=358+hv2TWqC/evMuWDPOSZ0yAexyUSSauiEBnBsk3Nw=; b=E1TWCcXeJu52sE0/0in1mrTOrrUxHF+saDQrXMhD2vtb9jCdom4t5UzOZjGt6utXJeipo+ gY1LFzhkxA5eNMksSk13cPc9GCDhFIPvrOxAPX965C2UpC8hKM+n2l1hOnTSwksOJYHaKU mGjq4shPRL21aNwcXBwH7xZZW96sJzyPCDfbDxL5Pd08SswUCMdNTZ4e+DDXCosNLh2WsM 42OvyBS4FuekcngUejit0fyf8N80J0kfoUsQXCxPqTIB+s6pyYf2ZLMqujq5xHGX9DT4uT shPBL6xgthUVWWo2XKmyQtoR/8MdKQf5BwJPSlAFktYb6vHwPJWhJZOF8So15A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684752272; a=rsa-sha256; cv=none; b=IegfRzB7pE/EmC9D/vHT2/HnT7q79a9jVOodXvvUvv+Qc7A0wJHUKV0zxXSjmcIPkbVelj nUc7c36/35Noght+P8LIYeY3QQrQxwdwiHMYSkFcOM1eEadS8vp2tsct0oEnk4F+9rdAy+ HWUuzC5VALJ1h5Q26o4rXVIZVZT3bbRZo5YpU73G7MTlm0BAMno+9ijPfQ6j5ZJ7R5ABNY a9WSeo6u8fOTOCrI0bK6aWRgwkpTtjqmMvBYVxIVYa8aFAdC3QYAAJ0R0GzTQeVxxZrSLF bkFIiwBzRzpd9P7W6Hb3fZ6hxGOWv40vhF/X6JPp0QFn6bt004kCDZKlpG1Z8A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QPvG815kkzFG7; Mon, 22 May 2023 10:44:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34MAiWdg080331; Mon, 22 May 2023 10:44:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34MAiWJk080330; Mon, 22 May 2023 10:44:32 GMT (envelope-from git) Date: Mon, 22 May 2023 10:44:32 GMT Message-Id: <202305221044.34MAiWJk080330@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: 951beab15d39 - main - taclib: 0 (not set) is a valid auth type in authorization requests. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 951beab15d397942b5306aae292cd16564abe9f9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=951beab15d397942b5306aae292cd16564abe9f9 commit 951beab15d397942b5306aae292cd16564abe9f9 Author: Dag-Erling Smørgrav AuthorDate: 2023-05-22 10:00:42 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-05-22 10:01:04 +0000 taclib: 0 (not set) is a valid auth type in authorization requests. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: rew Differential Revision: https://reviews.freebsd.org/D40132 --- lib/libtacplus/taclib.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libtacplus/taclib.h b/lib/libtacplus/taclib.h index cb08d94c0e74..67c7409657bc 100644 --- a/lib/libtacplus/taclib.h +++ b/lib/libtacplus/taclib.h @@ -60,6 +60,7 @@ struct tac_handle; #define TAC_AUTHEN_SENDAUTH 0x04 /* Authentication types */ +#define TAC_AUTHEN_TYPE_NOT_SET 0x00 #define TAC_AUTHEN_TYPE_ASCII 0x01 #define TAC_AUTHEN_TYPE_PAP 0x02 #define TAC_AUTHEN_TYPE_CHAP 0x03 From nobody Mon May 22 10:44:33 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPvG93ZTsz4TMHT; Mon, 22 May 2023 10:44: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 4QPvG92w2Tz4Lbq; Mon, 22 May 2023 10:44:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684752273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LpcmGkunANtoDR1hAvhpJrAYRW5f2i/N92uBdKE5DxU=; b=uLsI6QlgH23DpIZFxGjU9eeKYjjWcjCnq3N93SpViXvkb5axeNOVvxkoEhFUgKzXR55jIR vYXIZcxNfj+OI4STv3Vh3vqWPE0uZrijNiybEUdDTQQadUrXh+Be/qkYJxLQG5F+PfRgHX q1TmoQdWPI1uKY/UiG+aVKK0+/NSQlCe7XOLvNlaBjOZWZV6jXxab4HPRYkyX/YZzM0agL vp9QFPsdfN79kxwyqsblpS4d+C0IQaSvso8p3btvcunjNWps2LImqOxv9ccAB31mFnfpRk 259WhYvk38BLJ8CQ6/f4yIw2Ygu6WV+eHSNA8t6AHTOzDM+Pf05taonyuj5DcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684752273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LpcmGkunANtoDR1hAvhpJrAYRW5f2i/N92uBdKE5DxU=; b=jtl5MZMKxeWfZ+tWVKZ3K+KZwuSsOYA/TB8TwkzfUiXAx9tCCG1m0XrjuZmwDxuxnV6yWS EO9bLt7ukopbiCP83OnKW0yPrpOpprOj/Id09IVCUB+vZnczErRYW8P6nxN1+IKJpjZcOf tBg4mLcOm5mcsNk9k4Mh50MkjwY47C653o5UfUidKHpGrU7Sn4KqHJSLniBhO0Vu0ovv0q g03oyzB5ZUq8wcy3SX/V2oD3Pv/2yZCvXhIxgblTAFJYJajNoiN0oJLwlF2wSiRlgimYmR G8DNvPYGlK76stUoDT8TAQoGvTqB+ccm7QiLAwCWiGFhPoN5a/WYr8HFOJRMAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684752273; a=rsa-sha256; cv=none; b=ckEXcWdt25e4K50Vml1JxkGUiu3Rmms+TT9jgVf2ym9nIa0/7uxvxPoilJkti+EVpgSX7D 8ZNGxo0ONHN3pU6YnzjC3pQStyGTEvBVMnooUXG90Lxk/VWCha9NHrT5r8tMlB81Jdoibz V9TqLRhSVWXsv+s9yR7cFT+tj5Qse5wXNjr4C7ttNIYGNAfNiMtdShsHoB4kKhue6eRDhf /xy9kXDkVTUe/iz75Z2Pu37gEOrtVmg9/HKU18dC5+2yLEBBxMAGTcFmBDajsCREKv2ZtA GMYMsnX/KzrieDg0TXWgKn/hCPIXNzPH4L6t1+Al6Ia1iyC2eRCSrsxJiyZFcA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QPvG9216GzFG8; Mon, 22 May 2023 10:44: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 34MAiXoo080361; Mon, 22 May 2023 10:44:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34MAiXDR080360; Mon, 22 May 2023 10:44:33 GMT (envelope-from git) Date: Mon, 22 May 2023 10:44:33 GMT Message-Id: <202305221044.34MAiXDR080360@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: 6c5cdba1bafe - main - Add nss_tacplus, a TACACS+ NSS module. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6c5cdba1bafe77428b7721e49cc2b944885ec71a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=6c5cdba1bafe77428b7721e49cc2b944885ec71a commit 6c5cdba1bafe77428b7721e49cc2b944885ec71a Author: Dag-Erling Smørgrav AuthorDate: 2023-05-22 10:00:48 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-05-22 10:14:52 +0000 Add nss_tacplus, a TACACS+ NSS module. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D40133 --- lib/Makefile | 4 +- lib/nss_tacplus/Makefile | 9 ++ lib/nss_tacplus/nss_tacplus.8 | 86 +++++++++++++ lib/nss_tacplus/nss_tacplus.c | 273 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 371 insertions(+), 1 deletion(-) diff --git a/lib/Makefile b/lib/Makefile index e791c983cc77..982cff8a29f9 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -109,7 +109,8 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ liby \ libz \ libzstd \ - ncurses + ncurses \ + nss_tacplus # Inter-library dependencies. When the makefile for a library contains LDADD # libraries, those libraries should be listed as build order dependencies here. @@ -145,6 +146,7 @@ SUBDIR_DEPEND_liblzma= libthr .if ${MK_OFED} != "no" SUBDIR_DEPEND_libpcap= ofed .endif +SUBDIR_DEPEND_nss_tacplus= libtacplus .if !defined(COMPAT_32BIT) SUBDIR+= flua diff --git a/lib/nss_tacplus/Makefile b/lib/nss_tacplus/Makefile new file mode 100644 index 000000000000..f39788cfbdea --- /dev/null +++ b/lib/nss_tacplus/Makefile @@ -0,0 +1,9 @@ +LIB= nss_tacplus +SRCS= ${LIB}.8 +SHLIB_MAJOR= 1 +SHLIB_NAME= ${LIB}.so.${SHLIB_MAJOR} +LIBADD= tacplus +MK_INSTALLIB= no +MAN= ${LIB}.8 + +.include diff --git a/lib/nss_tacplus/nss_tacplus.8 b/lib/nss_tacplus/nss_tacplus.8 new file mode 100644 index 000000000000..4aaff4b5dd3a --- /dev/null +++ b/lib/nss_tacplus/nss_tacplus.8 @@ -0,0 +1,86 @@ +.\"- +.\" Copyright (c) 2023 Klara, Inc. +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.Dd May 17, 2023 +.Dt NSS_TACPLUS 8 +.Os +.Sh NAME +.Nm nss_tacplus +.Nd TACACS+ nsswitch module +.Sh SYNOPSIS +.Ic passwd : files tacplus +.Sh DESCRIPTION +The +.Nm +module is a loadable NSS module which provides a minimal identity +service using a TACACS+ backend. +.Pp +Due to the limitations of the TACACS+ protocol, the functionality +provided by the +.Nm +module is very limited: it can look up a user by name, but not by uid, +and it cannot enumerate users. +.Pp +To look up a user, the +.Nm +module submits an authorization request with authentication method +.Dv TAC_PLUS_AUTHEN_METH_NOT_SET , +authentication type +.Dv TAC_PLUS_AUTHEN_TYPE_NOT_SET , +and authentication service +.Dv TAC_PLUS_AUTHEN_SVC_LOGIN , +for the +.Dq shell +service. +If the response status is either +.Dv TAC_PLUS_AUTHOR_STATUS_PASS_ADD +or +.Dv TAC_PLUS_AUTHOR_STATUS_PASS_REPL , +the user is considered to exist and the +.Nm +module fills out a +.Vt struct passwd +for it. +.Pp +The following attributes, if included in the response from the TACACS+ +server, are used to construct the response: +.Bl -tag -width GECOS +.It Va UID +Numeric user ID. +Must be between 0 and +.Dv UID_MAX . +Defaults to 65534. +.It Va GID +Numeric primary group ID. +Must be between 0 and +.Dv GID_MAX . +Defaults to 65534. +.It Va GECOS +Display name. +If not provided, the user name is used instead. +.It Va HOME +Home directory. +Defaults to +.Pa / . +.It Va SHELL +Shell. +Defaults to +.Pa /bin/sh . +.El +.Pp +Case is ignored when matching attribute names. +If an attribute is included multiple times, the last value takes +effect. +.Sh SEE ALSO +.Xr libtacplus 3 , +.Xr tacplus.conf 5 , +.Xr pam_tacplus 8 +.Sh HISTORY +.An -nosplit +The +.Nm +module and this manual page were written by +.An Dag-Erling Smørgrav Aq Mt des@FreeBSD.org +for Klara Systems. diff --git a/lib/nss_tacplus/nss_tacplus.c b/lib/nss_tacplus/nss_tacplus.c new file mode 100644 index 000000000000..a59332504bc0 --- /dev/null +++ b/lib/nss_tacplus/nss_tacplus.c @@ -0,0 +1,273 @@ +/*- + * Copyright (c) 2023 Klara, Inc. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +extern int __isthreaded; + +#define DEF_UID 65534 +#define DEF_GID 65534 +#define DEF_DIR "/" +#define DEF_SHELL "/bin/sh" + +ns_mtab *nss_module_register(const char *, unsigned int *, + nss_module_unregister_fn *); + +static void +tacplus_error(struct tac_handle *h, const char *func) +{ + if (h == NULL) + syslog(LOG_ERR, "%s(): %m", func); + else + syslog(LOG_ERR, "%s(): %s", func, tac_strerror(h)); +} + +static pthread_key_t tacplus_key; + +static void +tacplus_fini(void *p) +{ + struct tac_handle **h = p; + + tac_close(*h); + free(h); +} + +static void +tacplus_keyinit(void) +{ + (void)pthread_key_create(&tacplus_key, tacplus_fini); +} + +static struct tac_handle * +tacplus_get_handle(void) +{ + static pthread_once_t keyinit = PTHREAD_ONCE_INIT; + static struct tac_handle *sth; + struct tac_handle **h = &sth; + int ret; + + if (__isthreaded && !pthread_main_np()) { + if ((ret = pthread_once(&keyinit, tacplus_keyinit)) != 0) + return (NULL); + if ((h = pthread_getspecific(tacplus_key)) == NULL) { + if ((h = calloc(1, sizeof(*h))) == NULL) + return (NULL); + if ((pthread_setspecific(tacplus_key, h)) != 0) { + free(h); + return (NULL); + } + } + } + if (*h == NULL) { + if ((*h = tac_open()) == NULL) { + tacplus_error(*h, "tac_open"); + return (NULL); + } + if (tac_config(*h, NULL) != 0) { + tacplus_error(*h, "tac_config"); + tac_close(*h); + *h = NULL; + return (NULL); + } + } + return (*h); +} + +static char * +tacplus_copystr(const char *str, char **buffer, size_t *bufsize) +{ + char *copy = *buffer; + size_t len = strlen(str) + 1; + + if (len > *bufsize) { + errno = ERANGE; + return (NULL); + } + memcpy(copy, str, len); + *buffer += len; + *bufsize -= len; + return (copy); +} + +static int +tacplus_getpwnam_r(const char *name, struct passwd *pwd, char *buffer, + size_t bufsize) +{ + struct tac_handle *h; + char *av, *key, *value, *end; + intmax_t num; + int i, ret; + + if ((h = tacplus_get_handle()) == NULL) + return (NS_UNAVAIL); + ret = tac_create_author(h, TAC_AUTHEN_METH_NOT_SET, + TAC_AUTHEN_TYPE_NOT_SET, TAC_AUTHEN_SVC_LOGIN); + if (ret < 0) { + tacplus_error(h, "tac_create_author"); + return (NS_TRYAGAIN); + } + if (tac_set_user(h, name) < 0) { + tacplus_error(h, "tac_set_user"); + return (NS_TRYAGAIN); + } + if (tac_set_av(h, 0, "service=shell") < 0) { + tacplus_error(h, "tac_set_av"); + return (NS_TRYAGAIN); + } + ret = tac_send_author(h); + switch (TAC_AUTHOR_STATUS(ret)) { + case TAC_AUTHOR_STATUS_PASS_ADD: + case TAC_AUTHOR_STATUS_PASS_REPL: + /* found */ + break; + case TAC_AUTHOR_STATUS_FAIL: + return (NS_NOTFOUND); + case TAC_AUTHOR_STATUS_ERROR: + return (NS_UNAVAIL); + default: + tacplus_error(h, "tac_send_author"); + return (NS_UNAVAIL); + } + memset(pwd, 0, sizeof(*pwd)); + + /* copy name */ + pwd->pw_name = tacplus_copystr(name, &buffer, &bufsize); + if (pwd->pw_name == NULL) + return (NS_RETURN); + + /* no password */ + pwd->pw_passwd = tacplus_copystr("*", &buffer, &bufsize); + if (2 > bufsize) + return (NS_RETURN); + + /* default uid and gid */ + pwd->pw_uid = DEF_UID; + pwd->pw_gid = DEF_GID; + + /* get attribute-value pairs from TACACS+ response */ + for (i = 0; i < TAC_AUTHEN_AV_COUNT(ret); i++) { + if ((av = tac_get_av(h, i)) == NULL) { + tacplus_error(h, "tac_get_av"); + return (NS_UNAVAIL); + } + key = av; + if ((value = strchr(av, '=')) == NULL) { + free(av); + return (NS_RETURN); + } + *value++ = '\0'; + if (strcasecmp(key, "uid") == 0) { + num = strtoimax(value, &end, 10); + if (end == value || *end != '\0' || + num < 0 || num > (intmax_t)UID_MAX) { + errno = EINVAL; + free(av); + return (NS_RETURN); + } + pwd->pw_uid = num; + } else if (strcasecmp(key, "gid") == 0) { + num = strtoimax(value, &end, 10); + if (end == value || *end != '\0' || + num < 0 || num > (intmax_t)GID_MAX) { + errno = EINVAL; + free(av); + return (NS_RETURN); + } + pwd->pw_gid = num; + } else if (strcasecmp(av, "gecos") == 0) { + pwd->pw_gecos = tacplus_copystr(value, &buffer, + &bufsize); + if (pwd->pw_gecos == NULL) { + free(av); + return (NS_RETURN); + } + } else if (strcasecmp(av, "home") == 0) { + pwd->pw_dir = tacplus_copystr(value, &buffer, + &bufsize); + if (pwd->pw_dir == NULL) { + free(av); + return (NS_RETURN); + } + } else if (strcasecmp(av, "shell") == 0) { + pwd->pw_shell = tacplus_copystr(value, &buffer, + &bufsize); + if (pwd->pw_shell == NULL) { + free(av); + return (NS_RETURN); + } + } + free(av); + } + + /* gecos equal to name if none was provided */ + if (pwd->pw_gecos == NULL) + pwd->pw_gecos = pwd->pw_name; + + /* default home directory if none was provided */ + if (pwd->pw_dir == NULL) + pwd->pw_dir = tacplus_copystr(DEF_DIR, &buffer, &bufsize); + if (pwd->pw_dir == NULL) + return (NS_RETURN); + + /* default shell if none was provided */ + if (pwd->pw_shell == NULL) + pwd->pw_shell = tacplus_copystr(DEF_SHELL, &buffer, &bufsize); + if (pwd->pw_shell == NULL) + return (NS_RETURN); + + /* done! */ + return (NS_SUCCESS); +} + +static int +nss_tacplus_getpwnam_r(void *retval, void *mdata __unused, va_list ap) +{ + char *name = va_arg(ap, char *); + struct passwd *pwd = va_arg(ap, struct passwd *); + char *buffer = va_arg(ap, char *); + size_t bufsize = va_arg(ap, size_t); + int *result = va_arg(ap, int *); + int ret; + + errno = 0; + ret = tacplus_getpwnam_r(name, pwd, buffer, bufsize); + if (ret == NS_SUCCESS) { + *(void **)retval = pwd; + *result = 0; + } else { + *(void **)retval = NULL; + *result = errno; + } + return (ret); +} + +ns_mtab * +nss_module_register(const char *name __unused, unsigned int *plen, + nss_module_unregister_fn *unreg) +{ + static ns_mtab mtab[] = { + { "passwd", "getpwnam_r", &nss_tacplus_getpwnam_r, NULL }, + }; + + *plen = nitems(mtab); + *unreg = NULL; + return (mtab); +} From nobody Mon May 22 10:44:34 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPvGB4L90z4TMHb; Mon, 22 May 2023 10:44: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 4QPvGB3r1Fz4LhW; Mon, 22 May 2023 10:44:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684752274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AOw31bSk0RmFSUMAmgiP8pbdUtwQCViETe4w0IicAQ8=; b=kAdTwlC84jH6QqYE85gvk1VtfHe/UoAyfqXgJjcU9tKp9/AYLZ+gZKVM43kpMisQel9Syp WCPw17fSc8NIal17KoNHi/JF2WQ2/d3b589OwMRU37uQk3PIZ3k6vHunB0qQQMkq4HN4jk PeIczgDTRjDqYldA5rMTE7KOiA1sYpsMCc77JvsATw0oA4Y0+EhcRfqSxlII+468TZARrr M1oPjqWj7dd/pcIKe26CfmiVQiLBdVXwG/gruPJjOE9NaDPj1QEOPBdMO5YbA5GaZFVfYw 4hsE4OGsO/ulAdVGbmjEfEFg76lXht27jT9s5jyAMOYU8GV84bbRgyRBx+r38Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684752274; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AOw31bSk0RmFSUMAmgiP8pbdUtwQCViETe4w0IicAQ8=; b=u/wJsbbJpbhJnJtEPM7IHlNMw5CfowSkzdGT2qFIXQAEhNWJd0TM2n4ZFJGxdcjzL2vIo/ odU1KAnYrYgMVjzzdFChUNTAFtd9PSlTdIawiS+EIWCWanwDsox7xnpR9ep7vTa7F/VPxU jua6CFIdAwcNAHc8tvCs/bHZDjf0siMp6GU+1Gdj2tziiB8LhAKC2vi7KhOn4azd6bZp20 Z91U4XQQsL3zYPEowdsFlq073eatW9Y41ounxSXBuRF+VGT+HgkGVqVFFbkFU44dOPRu53 5xD5cZi4AccmQ/T8H9EWvyRmIXElUaaEBTyvcs+cnI5Xd5+PWRTHuiG/5o4N+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684752274; a=rsa-sha256; cv=none; b=X4R/6gTiDtp9LRjBhzny1ZzK21iaUduyhtbbNFEFqExKIYSnevcBeVvA06b0SjZj3bHlod LtlfdevlfMJIsYgGKx9TiZNTIYI8+n4n52arZZgmEgdptM57oCJz5R4H7VFcu1smVCu9NG IMPi8l5GOPr38IBdITpCzITVp0zse4x+o3teuVFSXtbRtprXJSQLHFtnnLctnlLaRfXbmA UxEz7J3dWSwdCI9c0OFYfRwkI7GYvzyM6vupJ8tEOvZhWpgFI6cflKNBjAGXNn2Zl1MzLN WC4SJ+z9U7Ap3dnpwEm/7QDuMyhJwAHerP4JAP75LEb0CBvjzufFa+VaJB1/fQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QPvGB2xDyzFT4; Mon, 22 May 2023 10:44: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 34MAiYLg080394; Mon, 22 May 2023 10:44:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34MAiY7w080393; Mon, 22 May 2023 10:44:34 GMT (envelope-from git) Date: Mon, 22 May 2023 10:44:34 GMT Message-Id: <202305221044.34MAiY7w080393@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: c8d84fa75eef - main - pam_tacplus: Mention nss_tacplus in the manual page. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c8d84fa75eefdd4a6547c5367ae49954b9d8297e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=c8d84fa75eefdd4a6547c5367ae49954b9d8297e commit c8d84fa75eefdd4a6547c5367ae49954b9d8297e Author: Dag-Erling Smørgrav AuthorDate: 2023-05-22 10:00:52 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-05-22 10:14:52 +0000 pam_tacplus: Mention nss_tacplus in the manual page. MFC after: 1 week Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D40135 --- lib/libpam/modules/pam_tacplus/pam_tacplus.8 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libpam/modules/pam_tacplus/pam_tacplus.8 b/lib/libpam/modules/pam_tacplus/pam_tacplus.8 index 92534aafb925..a17dfdb78ed6 100644 --- a/lib/libpam/modules/pam_tacplus/pam_tacplus.8 +++ b/lib/libpam/modules/pam_tacplus/pam_tacplus.8 @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 2, 1999 +.Dd May 17, 2023 .Dt PAM_TACPLUS 8 .Os .Sh NAME @@ -103,9 +103,10 @@ The standard TACACS+ client configuration file for .Nm .El .Sh SEE ALSO +.Xr pam 3 , .Xr passwd 5 , .Xr tacplus.conf 5 , -.Xr pam 3 +.Xr nss_tacplus 8 .Sh HISTORY The .Nm From nobody Mon May 22 10:55:06 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPvVL6yk0z4TN0c; Mon, 22 May 2023 10:55: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 4QPvVL6RTyz4Nff; Mon, 22 May 2023 10:55:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684752906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NmHiVYlbKh9kE2xYtiRcw6sz08xQ1vJSwmqR7KURzgI=; b=f2+F+HLnW/6BGKcPvpCOnule8KOPYyn6jJHs6phJrItkIehU2Qi35bsLZvGMJFAcsnl+j+ BYPCr35n2E8sOf+m2Zwvll2EgjeSRLSMpnWaxmJRmIKFH6vWL+1uPzoj+sE1cFHV2Y3puw arGYfRb2T7ALSGGvANAjc4clfKTuFPjnjDXR3QStb1+dCbkAg61s1ByurDzrE03MODXt5O T0+5ttWIfSulXuGrjgwvfrrf3Yyf4p79fFBNBhd2fiZFnqHiWBMy/LcHtFHH6bKRAUg1XT 21+ML+PJEOv1LyaLLr1gLKVO+sPYfn+G0Hdr3tbp0eGDaWPJk5T6JSPM7+eXVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684752906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NmHiVYlbKh9kE2xYtiRcw6sz08xQ1vJSwmqR7KURzgI=; b=oduWeUvj2RXkd23DY870eRII9yBwF2T4ASQCpJXcqaWj1dDiQr9BbWBLYsQ3GCiP6+BSrW YLxep6Pf75qaAjCcRsTDJ62sAvfAh2uCL526gA3m5qTpvxrQH459zk4SUeO2b3onDPOFk9 LkEMsHkwBPCMOFNFLR+cFQRx6z9PL5zQ7HOCQqj6hBLPP1C1DnsMqHZs1bj7B9RJUeXx/H SCb/8NFaPUQJMSKEheZvbR2DqBjrJrgScwM+TrZLfTyF/IBeqF2hA8vG3Xy4huGsVg+Qlw 02V2sY4av5wkJvfHjmJAzdbz+omgwUwtQ7i4kPPvZ3VsSKRzXUESmzs1h/cQUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684752906; a=rsa-sha256; cv=none; b=ojmsQ4nC8M1B0i0CxGsP5xsIsQGC4eS2FPASLYBpl/Za5IKE/kEXee+486rTArXjScAHVV e013HOFN0JsJgomy1EVCB+VnwVc+WBCf8LhjPLk9c8ZPHBwNNvVqHWQsUiHyMYHKge9VMw NR6yBP62ibZBUUZsQVCTlOVkaTXbUG6W/9nXBQhgsowvMLXw2n4/qUK769EEd/Fv13zWzs 2JkQVZUaei3a3W374bYxzfY9cfVkSw6QPukD/8E9CnndKHM9YffDGSCA/XKViO+wWL2pam uqrWqt4BjDiZEHXIbgXTCVve52jcp+FBrKB2YUpwRFbp3fjV39EFdyCRKWcIRA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QPvVL5NkrzFrn; Mon, 22 May 2023 10:55:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34MAt6ka096977; Mon, 22 May 2023 10:55:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34MAt6v2096976; Mon, 22 May 2023 10:55:06 GMT (envelope-from git) Date: Mon, 22 May 2023 10:55:06 GMT Message-Id: <202305221055.34MAt6v2096976@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 47c887be4af7 - main - Revert "mlx4: Move DEFINE_MUTEX() outside function body." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47c887be4af7553a3fae05009516a904dfa2617e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=47c887be4af7553a3fae05009516a904dfa2617e commit 47c887be4af7553a3fae05009516a904dfa2617e Author: Hans Petter Selasky AuthorDate: 2023-05-22 10:52:10 +0000 Commit: Hans Petter Selasky CommitDate: 2023-05-22 10:53:38 +0000 Revert "mlx4: Move DEFINE_MUTEX() outside function body." Requested by: jrtc27@ This reverts commit 805d759338a2be939fffc8bf3f25cfaab981a9be. --- sys/dev/mlx4/mlx4_core/mlx4_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/mlx4/mlx4_core/mlx4_main.c b/sys/dev/mlx4/mlx4_core/mlx4_main.c index a37b900a2ed0..ca63d1d12ba6 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_main.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_main.c @@ -1164,8 +1164,6 @@ err_sup: return err; } -static DEFINE_MUTEX(set_port_type_mutex); - static ssize_t set_port_type(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) @@ -1174,6 +1172,7 @@ static ssize_t set_port_type(struct device *dev, port_attr); struct mlx4_dev *mdev = info->dev; enum mlx4_port_type port_type; + static DEFINE_MUTEX(set_port_type_mutex); int err; mutex_lock(&set_port_type_mutex); From nobody Mon May 22 13:36:41 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPz4n5S22z4BSWB; Mon, 22 May 2023 13:36: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 4QPz4n1nhNz4ZXR; Mon, 22 May 2023 13:36:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684762601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sL459Zdjo2JOA9wIFw2vKl1PK/APPvdzmxxsdXECSVU=; b=PXd3lNdr743hYcE8JUjqN6lhV7pwg6ifDkRnMNVXDLwBBhVobaESdzBF8yAyWozfQlyePC OXTUGFcNUGg7WkqPawr9xF4kPTNxoxlLc0AYc5yy66G3n9sjr4lW42B7pEY7+4CBal349d FQ5KXn9DHHckUQlMsHRjB58yQIMhtaUOFQck4Q/lO4X4D2apDGkoDC1u+VGUnjHimMU8ZI NkOXy7Z1C+WqwU+iBM3pBBgTgkHi/JvheHDmjuyqB7E4r1i6x+YsN/AgIATT5vXcSUBqLt xk/jIaUDmsqdo7GNfIU1+2+5lmMhWGcIsriyd5a+xzgrxHytROhZuhrTeU2gAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684762601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sL459Zdjo2JOA9wIFw2vKl1PK/APPvdzmxxsdXECSVU=; b=fSTk24BrgqDb83axqMXHFWcSU7IQRCHuzR/JADLZS5+lTuC+duKuBtW7Zb96rm087U0rrA qcDjXVeo/61AP7kC2h9zgA/SHwnZcECFqKCKoHwNTNuw3q0os/1lrv/2HI95hEz6OUtgMD sf6Vic4l6SsahLKyqqDCzEu3PSRC9vPl89ws0cvViunJWptChlcXF+qk70lS0J1udOJ4ja FEz2PYq1vkyWFs/Usp9XABF6QixZzh2LhmpEQIw9HDZ16RUqkKq5v6CLj62n8QScp1G6rT o2mIRYBtwQvTs4oozx8/HrOUvMlXyjtBa1Fk/knVZoatN3BepmXa45xjmJUV2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684762601; a=rsa-sha256; cv=none; b=EsF209SAwvnXj/SnuGJDQSwGfgRPZZIi78G1XQfNShEY+fgitgwIinPdjDxl0CtC03pwUw 9qXtTKKS7sev4JWb1jzguOMzpkcpg7wSoMMNjIm5KE0cAzuXpnwfpHPdHqoMKvAfWZf99v kZujo7yp+pUopZJibCLkzPXjllUjbNML4PaSAewHxp+dQ88fyMgPVvgf4V+iqZNLHxXkFQ befwvWXwD8xcQDjLoofa0lU9ZrVmKU7iGAvnMP8OLaOScievp8+kD9KkUH6YJlXEmnjmWC pK91h31V76g87/vYLlMWmrDpmWvvkU9wfhBP1eGZRYIbEhtcAjgfY+HD0WmVhw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QPz4n0tqbzKVr; Mon, 22 May 2023 13:36: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 34MDafPg059752; Mon, 22 May 2023 13:36:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34MDafhH059751; Mon, 22 May 2023 13:36:41 GMT (envelope-from git) Date: Mon, 22 May 2023 13:36:41 GMT Message-Id: <202305221336.34MDafhH059751@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: e3f7081b1c54 - main - fusefs: Remove an unused pbuf zone List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e3f7081b1c54fae55cb443a39c2ad44ac3ed4a75 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e3f7081b1c54fae55cb443a39c2ad44ac3ed4a75 commit e3f7081b1c54fae55cb443a39c2ad44ac3ed4a75 Author: Mark Johnston AuthorDate: 2023-05-22 13:33:57 +0000 Commit: Mark Johnston CommitDate: 2023-05-22 13:33:57 +0000 fusefs: Remove an unused pbuf zone The zone has been dead ever since commit b9e20197551d ("fusefs: rewrite vop_getpages and vop_putpages") No functional change intended. Reviewed by: asomers MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D40143 --- sys/fs/fuse/fuse_main.c | 3 --- sys/fs/fuse/fuse_vnops.c | 2 -- 2 files changed, 5 deletions(-) diff --git a/sys/fs/fuse/fuse_main.c b/sys/fs/fuse/fuse_main.c index 824458db72cb..ce40b73f656b 100644 --- a/sys/fs/fuse/fuse_main.c +++ b/sys/fs/fuse/fuse_main.c @@ -96,7 +96,6 @@ struct mtx fuse_mtx; extern struct vfsops fuse_vfsops; extern struct cdevsw fuse_cdevsw; extern struct vop_vector fuse_fifonops; -extern uma_zone_t fuse_pbuf_zone; static struct vfsconf fuse_vfsconf = { .vfc_version = VFS_VERSION, @@ -151,7 +150,6 @@ fuse_loader(struct module *m, int what, void *arg) fuse_file_init(); fuse_internal_init(); fuse_node_init(); - fuse_pbuf_zone = pbuf_zsecond_create("fusepbuf", nswbuf / 2); /* vfs_modevent ignores its first arg */ if ((err = vfs_modevent(NULL, what, &fuse_vfsconf))) @@ -161,7 +159,6 @@ fuse_loader(struct module *m, int what, void *arg) if ((err = vfs_modevent(NULL, what, &fuse_vfsconf))) return (err); fuse_bringdown(eh_tag); - uma_zdestroy(fuse_pbuf_zone); break; default: return (EINVAL); diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index 6ed44d73a8b9..1bb5b3834c76 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -229,8 +229,6 @@ struct vop_vector fuse_vnops = { }; VFS_VOP_VECTOR_REGISTER(fuse_vnops); -uma_zone_t fuse_pbuf_zone; - /* Check permission for extattr operations, much like extattr_check_cred */ static int fuse_extattr_check_cred(struct vnode *vp, int ns, struct ucred *cred, From nobody Mon May 22 13:45:19 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPzGl6s0Kz4BTHc; Mon, 22 May 2023 13:45: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 4QPzGl6RLjz4bZh; Mon, 22 May 2023 13:45:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684763119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RaUuesh1cBfaJGFp/ByJ/H4scNBFjb2lIzPwKo6/ShY=; b=mMD87PFYTj7V9bQr/63aGpvb/LDqBdQulk2l6ntsV74oGmT4eORBxe1O5hyOUJAPQoboYD pOhYd/I4pBAi+YB+QqN3Ku00V6OfGP6Sg8+OduWx+BsdF5FJ/5LNGpGLknSqycAbGZ3i8H OTbq19uanIJEySv4FhsXQ/qWfQxnawru5H8XOv1CRaaW3fM9Hp40QCfFBYhhMC4Q5YzHwC FE6CNnb9bGvH3UjM/KAgif2SGPaXKkEqg/GT493pDwlb2oyOczQkZAmhRkNFYSpwZHBpY4 NW9oP4yyx8DJGskvg6Y8FZ3VSOh/b8dOkoWjOfgo2z0MB767bgyO8RSR0Sz/eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684763119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RaUuesh1cBfaJGFp/ByJ/H4scNBFjb2lIzPwKo6/ShY=; b=vHHhZvR4kjV2oDhwsFimZkuzLDkzn2Nl/J9dsY5A2lB/Cf2GeTSdAHpzFtTCDKIXJySYqI 2wqP4KSMlbROMHyE8VzzpZinQGm/xshQ/yvzpNksZdD9KHU+sXJbtIydJ/vxUfEjH0GNmg hgyLFvInXVpEhBIZTI/WCm8FEThgf5RZ1R9PHgke20a+WDMwe5dUBN2R8bNNujsfyLPPd9 PLaSSKYPCloI0YIw4qAWecnotk488tnq4XXq3OPkZEieRqyoB2vSmGI10JtP0G7Ydoa863 1YhwNewyp4fVtpw4OludQRd+8/LMQXvcJnJrQpybn4/HqLmltWGjPcUWbMsmRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684763119; a=rsa-sha256; cv=none; b=xoH1N8qcSX/6x4GN14DoasUGma5MBe7NZp9+B28sqsDvUQQSzm4c39pUqDNLMqbxdhLN1w aAAMFtVTxK1G9wrnRoOq/dosnLGpvY8+MbMfkUfs0AyDja/lsNGbOwmR0NHEGzKJeJsvhx 7iehlGDIl8jnEkhtY/ufvypIly/E84+umMwSAi6A2UfTrDftyqRqFnaxOss42qVkYRqGYx ZhQBgrbXyuovvYEZQDAhVPddeNDkXITWcc5IxwtpVDZX31+kQojKiyZZ4MgKFbBUN2f0YG +N9264cDLGfE544r1l5JO7N4qGcTn3Lo92h5T7jB7j+up7LoIjxOdS2n6qQkjQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QPzGl5NDLzKmc; Mon, 22 May 2023 13:45: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 34MDjJEt076364; Mon, 22 May 2023 13:45:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34MDjJ0g076363; Mon, 22 May 2023 13:45:19 GMT (envelope-from git) Date: Mon, 22 May 2023 13:45:19 GMT Message-Id: <202305221345.34MDjJ0g076363@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 050815ae7f9d - main - netlink: call IPv6 hook when adding IPv4 addresses. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 050815ae7f9dc2a93599b5321441698e331d0ba7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=050815ae7f9dc2a93599b5321441698e331d0ba7 commit 050815ae7f9dc2a93599b5321441698e331d0ba7 Author: Alexander V. Chernikov AuthorDate: 2023-05-22 13:41:34 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-05-22 13:42:28 +0000 netlink: call IPv6 hook when adding IPv4 addresses. This provides compatibility with ifioctl() version of SIOCAIFADDR. This change is temporary until the IPv4/IPv6 address handling code is moved to netinet[6]. --- sys/netlink/route/iface.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/netlink/route/iface.c b/sys/netlink/route/iface.c index 84392aa5d7f7..920c473490ab 100644 --- a/sys/netlink/route/iface.c +++ b/sys/netlink/route/iface.c @@ -1155,7 +1155,12 @@ handle_newaddr_inet(struct nlmsghdr *hdr, struct nl_parsed_ifa *attrs, if (attrs->ifa_dst != NULL) req.ifra_dstaddr = *((struct sockaddr_in *)attrs->ifa_dst); - return (in_control(NULL, SIOCAIFADDR, &req, ifp, curthread)); + int error = in_control(NULL, SIOCAIFADDR, &req, ifp, curthread); +#ifdef INET6 + if (error == 0 && !(if_flags & IFF_UP) && (if_getflags(ifp) & IFF_UP)) + in6_if_up(ifp); +#endif + return (error); } static int From nobody Mon May 22 13:46:16 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPzHr2f18z4BT23; Mon, 22 May 2023 13:46: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 4QPzHr2Tk5z4brG; Mon, 22 May 2023 13:46:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684763176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lxgaR0AOpHIAXxzR8FZWVyINQrQcB3ZwcSI2Y0vGWAo=; b=tlQP5Gdb4TFU9iqloIHAIcJyhuBEPEPYzUbhn40gKOdHSDstBa/dHMZ3sSlYh6EA+sZpD4 HLepuX8rDYmh49bp9pcmzKedWQX5LPPNnehPseu4sRqNGyZ1idFvqE8Bkt1YydYZ5JGVDl bSIJAVHrdP8zPB4mx7RV8JJrfiTquSynYaDCWczVKJs7VBbjXTGavRWGweCY4wcbmMPzMK oi/B+EzbS5E2eIoyBigPAAOUzSbs9SYEOUSyhHl6bEtsPYEUexRkV7wTWFMEipUhJE0HXw MRUavVuDTVpLEbNMNiU/BS99NhmV+k5llJ65HJeLJmNs0f6i/pTdDWgq1p0xGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684763176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lxgaR0AOpHIAXxzR8FZWVyINQrQcB3ZwcSI2Y0vGWAo=; b=wf4TKiWnNbT8sSXoCbof5jrCn2qWXNZbwyWNS7VkuVbaqULE9xWVMjQt9ZcCb7Eea/YDV2 BKxksCiVhL+TmWuOTonwJKQzUJ567ZfYm5UkwvMefGEj33qFuOs2gEnwaJH8RYh/9upHu8 HRv46OFmtOZu1A+KVsoWa0/61Fbl3tE++p2AIJGIStdPzm9S4/UQoiMMlo29ObDgA7fzLJ quv5y4rWnZXQLilMFW34y+VUjAKkgZuI7402ql91/aQcYh1TD6nAbnA0hEDmpY5N8ISXAb 6lz+SYSiqt5DTBpUFAg6tdsxTaOv1miwIi0Xl7uuixzqRUyCMxf4T6pejqHMgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684763176; a=rsa-sha256; cv=none; b=J7n3YAItRIqZ12B8/R7XRnEydLIxtXWeQ2+l84DqHwtps7PvX4RM4JiOaXqsQNz1kH2i4a LME+XBPio6gdtLwiy5Sarb7IKGTcZH0MzQViOuY7tLGlgGdStIG0+wjeUXvjMumvF30sD/ u+NweIivvY6Gab5GFRFS4J0Tvdgr0aWxEdYeKc939s8N9NrXh2muCCXXQfYgkTAKnrjkR/ Kq0x6mv7nKq8baUXZ9o58igu/gTTj158BXzOn9GBy8kRRdDwmVOHnzyIWHSkRgD/IU+gEe RCcLLUHk9eSMGE9N+l+SxnBda+WSa1XM3FWbrhBmMTe9vRhyevEcQvs/6W1mew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QPzHr1MbMzKWX; Mon, 22 May 2023 13:46: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 34MDkGnl076700; Mon, 22 May 2023 13:46:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34MDkG8A076699; Mon, 22 May 2023 13:46:16 GMT (envelope-from git) Date: Mon, 22 May 2023 13:46:16 GMT Message-Id: <202305221346.34MDkG8A076699@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 54418f79fd29 - main - ifconfig: switch IPv4/IPv6 address manipulations to Netlink List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 54418f79fd292e14abf121f87a3c790a17447971 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=54418f79fd292e14abf121f87a3c790a17447971 commit 54418f79fd292e14abf121f87a3c790a17447971 Author: Alexander V. Chernikov AuthorDate: 2023-05-20 11:53:46 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-05-22 13:45:33 +0000 ifconfig: switch IPv4/IPv6 address manipulations to Netlink Subscribers: imp Differential Revision: https://reviews.freebsd.org/D40182 --- sbin/ifconfig/af_inet.c | 184 +++++++++++++++++++++++++++++++++++++-- sbin/ifconfig/af_inet6.c | 152 +++++++++++++++++++++++++++++++- sbin/ifconfig/af_link.c | 3 + sbin/ifconfig/ifconfig.c | 102 ++++++++++++++++------ sbin/ifconfig/ifconfig.h | 22 +++-- sbin/ifconfig/ifconfig_netlink.c | 46 +++++++++- 6 files changed, 464 insertions(+), 45 deletions(-) diff --git a/sbin/ifconfig/af_inet.c b/sbin/ifconfig/af_inet.c index cb030dbc711b..ab2b01320d04 100644 --- a/sbin/ifconfig/af_inet.c +++ b/sbin/ifconfig/af_inet.c @@ -55,8 +55,26 @@ static const char rcsid[] = #include "ifconfig.h" #include "ifconfig_netlink.h" +#ifdef WITHOUT_NETLINK static struct in_aliasreq in_addreq; static struct ifreq in_ridreq; +#else +struct in_px { + struct in_addr addr; + int plen; + bool addrset; + bool maskset; +}; +struct in_pdata { + struct in_px addr; + struct in_px dst_addr; + struct in_px brd_addr; + uint32_t flags; + uint32_t vhid; +}; +static struct in_pdata in_add, in_del; +#endif + static char addr_buf[NI_MAXHOST]; /*for getnameinfo()*/ extern char *f_inet, *f_addr; @@ -182,6 +200,8 @@ in_status_nl(struct ifconfig_args *args __unused, struct io_handler *h, } #endif + +#ifdef WITHOUT_NETLINK #define SIN(x) ((struct sockaddr_in *) &(x)) static struct sockaddr_in *sintab[] = { SIN(in_ridreq.ifr_addr), SIN(in_addreq.ifra_addr), @@ -233,14 +253,156 @@ in_getaddr(const char *s, int which) errx(1, "%s: bad value", s); } +#else + +static struct in_px *sintab_nl[] = { + &in_del.addr, /* RIDADDR */ + &in_add.addr, /* ADDR */ + NULL, /* MASK */ + &in_add.dst_addr, /* DSTADDR*/ + &in_add.brd_addr, /* BRDADDR*/ +}; + +static void +in_getip(const char *addr_str, struct in_addr *ip) +{ + struct hostent *hp; + struct netent *np; + + if (inet_aton(addr_str, ip)) + return; + if ((hp = gethostbyname(addr_str)) != NULL) + bcopy(hp->h_addr, (char *)ip, + MIN((size_t)hp->h_length, sizeof(ip))); + else if ((np = getnetbyname(addr_str)) != NULL) + *ip = inet_makeaddr(np->n_net, INADDR_ANY); + else + errx(1, "%s: bad value", addr_str); +} + +static void +in_getaddr(const char *s, int which) +{ + struct in_px *px = sintab_nl[which]; + + if (which == MASK) { + struct in_px *px_addr = sintab_nl[ADDR]; + struct in_addr mask = {}; + + in_getip(s, &mask); + px_addr->plen = __bitcount32(mask.s_addr); + px_addr->maskset = true; + return; + } + + if (which == ADDR) { + char *p = NULL; + + if((p = strrchr(s, '/')) != NULL) { + const char *errstr; + /* address is `name/masklen' */ + int masklen; + *p = '\0'; + if (!isdigit(*(p + 1))) + errstr = "invalid"; + else + masklen = (int)strtonum(p + 1, 0, 32, &errstr); + if (errstr != NULL) { + *p = '/'; + errx(1, "%s: bad value (width %s)", s, errstr); + } + px->plen = masklen; + px->maskset = true; + } + } + + in_getip(s, &px->addr); + px->addrset = true; +} + + +static int +in_exec_nl(struct io_handler *h, int action, void *data) +{ + struct in_pdata *pdata = (struct in_pdata *)data; + struct snl_writer nw = {}; + + snl_init_writer(h->ss, &nw); + struct nlmsghdr *hdr = snl_create_msg_request(&nw, action); + struct ifaddrmsg *ifahdr = snl_reserve_msg_object(&nw, struct ifaddrmsg); + + ifahdr->ifa_family = AF_INET; + ifahdr->ifa_prefixlen = pdata->addr.plen; + ifahdr->ifa_index = if_nametoindex_nl(h->ss, name); + + snl_add_msg_attr_ip4(&nw, IFA_LOCAL, &pdata->addr.addr); + if (action == NL_RTM_NEWADDR && pdata->dst_addr.addrset) + snl_add_msg_attr_ip4(&nw, IFA_ADDRESS, &pdata->dst_addr.addr); + if (action == NL_RTM_NEWADDR && pdata->brd_addr.addrset) + snl_add_msg_attr_ip4(&nw, IFA_BROADCAST, &pdata->brd_addr.addr); + + int off = snl_add_msg_attr_nested(&nw, IFA_FREEBSD); + snl_add_msg_attr_u32(&nw, IFAF_FLAGS, pdata->flags); + if (pdata->vhid != 0) + snl_add_msg_attr_u32(&nw, IFAF_VHID, pdata->vhid); + snl_end_attr_nested(&nw, off); + + if (!snl_finalize_msg(&nw) || !snl_send_message(h->ss, hdr)) + return (0); + + struct snl_errmsg_data e = {}; + snl_read_reply_code(h->ss, hdr->nlmsg_seq, &e); + if (e.error_str != NULL) + warnx("%s(): %s", __func__, e.error_str); + + return (e.error); +} + +static void +in_setdefaultmask_nl(void) +{ + struct in_px *px = sintab_nl[ADDR]; + + in_addr_t i = ntohl(px->addr.s_addr); + + /* + * If netmask isn't supplied, use historical default. + * This is deprecated for interfaces other than loopback + * or point-to-point; warn in other cases. In the future + * we should return an error rather than warning. + */ + if (IN_CLASSA(i)) + px->plen = IN_CLASSA_NSHIFT; + else if (IN_CLASSB(i)) + px->plen = IN_CLASSB_NSHIFT; + else + px->plen = IN_CLASSC_NSHIFT; + px->maskset = true; +} +#endif + +static void +warn_nomask(ifflags) +{ + if ((ifflags & (IFF_POINTOPOINT | IFF_LOOPBACK)) == 0) { + warnx("WARNING: setting interface address without mask " + "is deprecated,\ndefault mask may not be correct."); + } +} + static void in_postproc(int s, const struct afswtch *afp, int newaddr, int ifflags) { - if (sintab[ADDR]->sin_len != 0 && sintab[MASK]->sin_len == 0 && - newaddr && (ifflags & (IFF_POINTOPOINT | IFF_LOOPBACK)) == 0) { - warnx("WARNING: setting interface address without mask " - "is deprecated,\ndefault mask may not be correct."); +#ifdef WITHOUT_NETLINK + if (sintab[ADDR]->sin_len != 0 && sintab[MASK]->sin_len == 0 && newaddr) { + warn_nomask(ifflags); + } +#else + if (sintab_nl[ADDR]->addrset && !sintab_nl[ADDR]->maskset && newaddr) { + warn_nomask(ifflags); + in_setdefaultmask_nl(); } +#endif } static void @@ -288,10 +450,13 @@ in_set_tunnel(int s, struct addrinfo *srcres, struct addrinfo *dstres) static void in_set_vhid(int vhid) { +#ifdef WITHOUT_NETLINK in_addreq.ifra_vhid = vhid; +#else + in_add.vhid = (uint32_t)vhid; +#endif } - static struct afswtch af_inet = { .af_name = "inet", .af_af = AF_INET, @@ -305,10 +470,19 @@ static struct afswtch af_inet = { .af_status_tunnel = in_status_tunnel, .af_settunnel = in_set_tunnel, .af_setvhid = in_set_vhid, +#ifdef WITHOUT_NETLINK .af_difaddr = SIOCDIFADDR, .af_aifaddr = SIOCAIFADDR, .af_ridreq = &in_ridreq, .af_addreq = &in_addreq, + .af_exec = af_exec_ioctl, +#else + .af_difaddr = NL_RTM_DELADDR, + .af_aifaddr = NL_RTM_NEWADDR, + .af_ridreq = &in_del, + .af_addreq = &in_add, + .af_exec = in_exec_nl, +#endif }; static __constructor void diff --git a/sbin/ifconfig/af_inet6.c b/sbin/ifconfig/af_inet6.c index 1bb08c8a6a5a..c932087b4d86 100644 --- a/sbin/ifconfig/af_inet6.c +++ b/sbin/ifconfig/af_inet6.c @@ -59,10 +59,30 @@ static const char rcsid[] = #include "ifconfig.h" #include "ifconfig_netlink.h" +#ifndef WITHOUT_NETLINK +struct in6_px { + struct in6_addr addr; + int plen; + bool set; +}; +struct in6_pdata { + struct in6_px addr; + struct in6_px dst_addr; + struct in6_addrlifetime lifetime; + uint32_t flags; + uint32_t vhid; +}; + +static struct in6_pdata in6_del; +static struct in6_pdata in6_add = { + .lifetime = { 0, 0, ND6_INFINITE_LIFETIME, ND6_INFINITE_LIFETIME }, +}; +#else static struct in6_ifreq in6_ridreq; static struct in6_aliasreq in6_addreq = { .ifra_flags = 0, .ifra_lifetime = { 0, 0, ND6_INFINITE_LIFETIME, ND6_INFINITE_LIFETIME } }; +#endif static int ip6lifetime; static int prefix(void *, int); @@ -80,8 +100,16 @@ static void setifprefixlen(const char *addr, int dummy __unused, int s, const struct afswtch *afp) { +#ifdef WITHOUT_NETLINK if (afp->af_getprefix != NULL) afp->af_getprefix(addr, MASK); +#else + int plen = strtol(addr, NULL, 10); + + if ((plen < 0) || (plen > 128)) + errx(1, "%s: bad value", addr); + in6_add.addr.plen = plen; +#endif explicit_prefix = 1; } @@ -92,10 +120,17 @@ setip6flags(const char *dummyaddr __unused, int flag, int dummysoc __unused, if (afp->af_af != AF_INET6) err(1, "address flags can be set only for inet6 addresses"); +#ifdef WITHOUT_NETLINK if (flag < 0) in6_addreq.ifra_flags &= ~(-flag); else in6_addreq.ifra_flags |= flag; +#else + if (flag < 0) + in6_add.flags &= ~(-flag); + else + in6_add.flags |= flag; +#endif } static void @@ -105,6 +140,11 @@ setip6lifetime(const char *cmd, const char *val, int s, struct timespec now; time_t newval; char *ep; +#ifdef WITHOUT_NETLINK + struct in6_addrlifetime *lifetime = &in6_addreq.ifra_lifetime; +#else + struct in6_addrlifetime *lifetime = &in6_add.lifetime; +#endif clock_gettime(CLOCK_MONOTONIC_FAST, &now); newval = (time_t)strtoul(val, &ep, 0); @@ -113,11 +153,11 @@ setip6lifetime(const char *cmd, const char *val, int s, if (afp->af_af != AF_INET6) errx(1, "%s not allowed for the AF", cmd); if (strcmp(cmd, "vltime") == 0) { - in6_addreq.ifra_lifetime.ia6t_expire = now.tv_sec + newval; - in6_addreq.ifra_lifetime.ia6t_vltime = newval; + lifetime->ia6t_expire = now.tv_sec + newval; + lifetime->ia6t_vltime = newval; } else if (strcmp(cmd, "pltime") == 0) { - in6_addreq.ifra_lifetime.ia6t_preferred = now.tv_sec + newval; - in6_addreq.ifra_lifetime.ia6t_pltime = newval; + lifetime->ia6t_preferred = now.tv_sec + newval; + lifetime->ia6t_pltime = newval; } } @@ -146,7 +186,11 @@ setip6eui64(const char *cmd, int dummy __unused, int s, if (afp->af_af != AF_INET6) errx(EXIT_FAILURE, "%s not allowed for the AF", cmd); +#ifdef WITHOUT_NETLINK in6 = (struct in6_addr *)&in6_addreq.ifra_addr.sin6_addr; +#else + in6 = &in6_add.addr.addr; +#endif if (memcmp(&in6addr_any.s6_addr[8], &in6->s6_addr[8], 8) != 0) errx(EXIT_FAILURE, "interface index is already filled"); if (getifaddrs(&ifap) != 0) @@ -374,8 +418,92 @@ in6_status_nl(struct ifconfig_args *args __unused, struct io_handler *h, putchar('\n'); } + +static struct in6_px *sin6tab_nl[] = { + &in6_del.addr, /* RIDADDR */ + &in6_add.addr, /* ADDR */ + NULL, /* MASK */ + &in6_add.dst_addr, /* DSTADDR*/ +}; + +static void +in6_getaddr(const char *addr_str, int which) +{ + struct in6_px *px = sin6tab_nl[which]; + + newaddr &= 1; + + px->set = true; + px->plen = 128; + if (which == ADDR) { + char *p = NULL; + if((p = strrchr(addr_str, '/')) != NULL) { + *p = '\0'; + int plen = strtol(p + 1, NULL, 10); + if (plen < 0 || plen > 128) + errx(1, "%s: bad value", p + 1); + px->plen = plen; + explicit_prefix = 1; + } + } + + struct addrinfo hints = { .ai_family = AF_INET6 }; + struct addrinfo *res; + + int error = getaddrinfo(addr_str, NULL, &hints, &res); + if (error != 0) { + if (inet_pton(AF_INET6, addr_str, &px->addr) != 1) + errx(1, "%s: bad value", addr_str); + } else { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)(void *)res->ai_addr; + px->addr = sin6->sin6_addr; + freeaddrinfo(res); + } +} + +static int +in6_exec_nl(struct io_handler *h, int action, void *data) +{ + struct in6_pdata *pdata = (struct in6_pdata *)data; + struct snl_writer nw = {}; + + snl_init_writer(h->ss, &nw); + struct nlmsghdr *hdr = snl_create_msg_request(&nw, action); + struct ifaddrmsg *ifahdr = snl_reserve_msg_object(&nw, struct ifaddrmsg); + + ifahdr->ifa_family = AF_INET6; + ifahdr->ifa_prefixlen = pdata->addr.plen; + ifahdr->ifa_index = if_nametoindex_nl(h->ss, name); + + snl_add_msg_attr_ip6(&nw, IFA_LOCAL, &pdata->addr.addr); + if (action == NL_RTM_NEWADDR && pdata->dst_addr.set) + snl_add_msg_attr_ip6(&nw, IFA_ADDRESS, &pdata->dst_addr.addr); + + struct ifa_cacheinfo ci = { + .ifa_prefered = pdata->lifetime.ia6t_pltime, + .ifa_valid = pdata->lifetime.ia6t_vltime, + }; + snl_add_msg_attr(&nw, IFA_CACHEINFO, sizeof(ci), &ci); + + int off = snl_add_msg_attr_nested(&nw, IFA_FREEBSD); + snl_add_msg_attr_u32(&nw, IFAF_FLAGS, pdata->flags); + if (pdata->vhid != 0) + snl_add_msg_attr_u32(&nw, IFAF_VHID, pdata->vhid); + snl_end_attr_nested(&nw, off); + + if (!snl_finalize_msg(&nw) || !snl_send_message(h->ss, hdr)) + return (0); + + struct snl_errmsg_data e = {}; + snl_read_reply_code(h->ss, hdr->nlmsg_seq, &e); + + return (e.error); +} #endif +#ifdef WITHOUT_NETLINK #define SIN6(x) ((struct sockaddr_in6 *) &(x)) static struct sockaddr_in6 *sin6tab[] = { SIN6(in6_ridreq.ifr_addr), SIN6(in6_addreq.ifra_addr), @@ -463,6 +591,7 @@ prefix(void *val, int size) return(0); return (plen); } +#endif static char * sec2str(time_t total) @@ -558,7 +687,11 @@ in6_set_tunnel(int s, struct addrinfo *srcres, struct addrinfo *dstres) static void in6_set_vhid(int vhid) { +#ifdef WITHOUT_NETLINK in6_addreq.ifra_vhid = vhid; +#else + in6_add.vhid = (uint32_t)vhid; +#endif } static struct cmd inet6_cmds[] = { @@ -606,16 +739,27 @@ static struct afswtch af_inet6 = { .af_status_nl = in6_status_nl, #endif .af_getaddr = in6_getaddr, +#ifdef WITHOUT_NETLINK .af_getprefix = in6_getprefix, +#endif .af_other_status = nd6_status, .af_postproc = in6_postproc, .af_status_tunnel = in6_status_tunnel, .af_settunnel = in6_set_tunnel, .af_setvhid = in6_set_vhid, +#ifdef WITHOUT_NETLINK .af_difaddr = SIOCDIFADDR_IN6, .af_aifaddr = SIOCAIFADDR_IN6, .af_ridreq = &in6_addreq, .af_addreq = &in6_addreq, + .af_exec = af_exec_ioctl, +#else + .af_difaddr = NL_RTM_DELADDR, + .af_aifaddr = NL_RTM_NEWADDR, + .af_ridreq = &in6_add, + .af_addreq = &in6_add, + .af_exec = in6_exec_nl, +#endif }; static void diff --git a/sbin/ifconfig/af_link.c b/sbin/ifconfig/af_link.c index 52295453b4f0..0d1f5b1f6147 100644 --- a/sbin/ifconfig/af_link.c +++ b/sbin/ifconfig/af_link.c @@ -229,6 +229,7 @@ static struct afswtch af_link = { .af_getaddr = link_getaddr, .af_aifaddr = SIOCSIFLLADDR, .af_addreq = &link_ridreq, + .af_exec = af_exec_ioctl, }; static struct afswtch af_ether = { .af_name = "ether", @@ -241,6 +242,7 @@ static struct afswtch af_ether = { .af_getaddr = link_getaddr, .af_aifaddr = SIOCSIFLLADDR, .af_addreq = &link_ridreq, + .af_exec = af_exec_ioctl, }; static struct afswtch af_lladdr = { .af_name = "lladdr", @@ -253,6 +255,7 @@ static struct afswtch af_lladdr = { .af_getaddr = link_getaddr, .af_aifaddr = SIOCSIFLLADDR, .af_addreq = &link_ridreq, + .af_exec = af_exec_ioctl, }; static __constructor void diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index c5e7b7befc72..3b63eac5574a 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -112,6 +112,7 @@ static void list_interfaces_ioctl(struct ifconfig_args *args); static void status(struct ifconfig_args *args, const struct sockaddr_dl *sdl, struct ifaddrs *ifa); static _Noreturn void usage(void); +static void Perrorc(const char *cmd, int error); static int getifflags(const char *ifname, int us, bool err_ok); @@ -541,6 +542,30 @@ args_parse(struct ifconfig_args *args, int argc, char *argv[]) verbose = args->verbose; } +static int +ifconfig_wrapper(struct ifconfig_args *args, int iscreate, + const struct afswtch *uafp) +{ +#ifdef WITHOUT_NETLINK + struct io_handler h = {}; + return (ifconfig(args, &h, iscreate, uafp)); +#else + return (ifconfig_wrapper_nl(args, iscreate, uafp)); +#endif +} + +static bool +isargcreate(const char *arg) +{ + if (arg == NULL) + return (false); + + if (strcmp(arg, "create") == 0 || strcmp(arg, "plumb") == 0) + return (true); + + return (false); +} + int main(int ac, char *av[]) { @@ -580,13 +605,12 @@ main(int ac, char *av[]) * right here as we would otherwise fail when trying * to find the interface. */ - if (arg != NULL && (strcmp(arg, "create") == 0 || - strcmp(arg, "plumb") == 0)) { + if (isargcreate(arg)) { iflen = strlcpy(name, args.ifname, sizeof(name)); if (iflen >= sizeof(name)) errx(1, "%s: cloning name too long", args.ifname); - ifconfig(args.argc, args.argv, 1, NULL); + ifconfig_wrapper(&args, 1, NULL); exit(exit_code); } #ifdef JAIL @@ -600,7 +624,7 @@ main(int ac, char *av[]) if (iflen >= sizeof(name)) errx(1, "%s: interface name too long", args.ifname); - ifconfig(args.argc, args.argv, 0, NULL); + ifconfig_wrapper(&args, 0, NULL); exit(exit_code); } #endif @@ -610,8 +634,7 @@ main(int ac, char *av[]) * Do not allow use `create` command as hostname if * address family is not specified. */ - if (arg != NULL && (strcmp(arg, "create") == 0 || - strcmp(arg, "plumb") == 0)) { + if (isargcreate(arg)) { if (args.argc == 1) errx(1, "interface %s already exists", args.ifname); @@ -641,7 +664,7 @@ main(int ac, char *av[]) if (!(((flags & IFF_CANTCONFIG) != 0) || (args.downonly && (flags & IFF_UP) != 0) || (args.uponly && (flags & IFF_UP) == 0))) - ifconfig(args.argc, args.argv, 0, args.afp); + ifconfig_wrapper(&args, 0, args.afp); } goto done; } @@ -769,7 +792,7 @@ list_interfaces_ioctl(struct ifconfig_args *args) ifindex++; if (args->argc > 0) - ifconfig(args->argc, args->argv, 0, args->afp); + ifconfig_wrapper(args, 0, args->afp); else status(args, sdl, ifa); } @@ -968,31 +991,42 @@ static void setifdstaddr(const char *, int, int, const struct afswtch *); static const struct cmd setifdstaddr_cmd = DEF_CMD("ifdstaddr", 0, setifdstaddr); +int +af_exec_ioctl(struct io_handler *h, int action, void *data) +{ + struct ifreq *req = (struct ifreq *)data; + + strlcpy(req->ifr_name, name, sizeof(req->ifr_name)); + if (ioctl(h->s, action, req) == 0) + return (0); + return (errno); +} + static void -delifaddr(int s, const struct afswtch *afp) +delifaddr(struct io_handler *h, const struct afswtch *afp) { - if (afp->af_ridreq == NULL || afp->af_difaddr == 0) { + int error; + + if (afp->af_exec == NULL) { warnx("interface %s cannot change %s addresses!", name, afp->af_name); clearaddr = 0; return; } - strlcpy(((struct ifreq *)afp->af_ridreq)->ifr_name, name, - sizeof ifr.ifr_name); - int ret = ioctl(s, afp->af_difaddr, afp->af_ridreq); - if (ret < 0) { - if (errno == EADDRNOTAVAIL && (doalias >= 0)) { + afp->af_exec(h, afp->af_difaddr, afp->af_ridreq); + if (error != 0) { + if (error == EADDRNOTAVAIL && (doalias >= 0)) { /* means no previous address for interface */ } else - Perror("ioctl (SIOCDIFADDR)"); + Perrorc("ioctl (SIOCDIFADDR)", error); } } static void -addifaddr(int s, const struct afswtch *afp) +addifaddr(struct io_handler *h, const struct afswtch *afp) { - if (afp->af_addreq == NULL || afp->af_aifaddr == 0) { + if (afp->af_exec == NULL) { warnx("interface %s cannot change %s addresses!", name, afp->af_name); newaddr = 0; @@ -1000,21 +1034,24 @@ addifaddr(int s, const struct afswtch *afp) } if (setaddr || setmask) { - strlcpy(((struct ifreq *)afp->af_addreq)->ifr_name, name, - sizeof ifr.ifr_name); - if (ioctl(s, afp->af_aifaddr, afp->af_addreq) < 0) - Perror("ioctl (SIOCAIFADDR)"); + int error = afp->af_exec(h, afp->af_aifaddr, afp->af_addreq); + if (error != 0) + Perrorc("ioctl (SIOCAIFADDR)", error); } } int -ifconfig(int argc, char *const *argv, int iscreate, const struct afswtch *uafp) +ifconfig(struct ifconfig_args *args, struct io_handler *h, int iscreate, + const struct afswtch *uafp) { const struct afswtch *afp, *nafp; const struct cmd *p; struct callback *cb; int s; + int argc = args->argc; + char *const *argv = args->argv; + strlcpy(ifr.ifr_name, name, sizeof ifr.ifr_name); afp = NULL; if (uafp != NULL) @@ -1127,10 +1164,11 @@ top: /* * Do deferred operations. */ + h->s = s; if (clearaddr) - delifaddr(s, afp); + delifaddr(h, afp); if (newaddr) - addifaddr(s, afp); + addifaddr(h, afp); close(s); return(0); @@ -1237,7 +1275,7 @@ setifbroadaddr(const char *addr, int dummy __unused, int s, const struct afswtch *afp) { if (afp->af_getaddr != NULL) - afp->af_getaddr(addr, DSTADDR); + afp->af_getaddr(addr, BRDADDR); } static void @@ -1713,8 +1751,8 @@ tunnel_status(int s) af_all_tunnel_status(s); } -void -Perror(const char *cmd) +static void +Perrorc(const char *cmd, int error) { switch (errno) { @@ -1727,10 +1765,16 @@ Perror(const char *cmd) break; default: - err(1, "%s", cmd); + errc(1, error, "%s", cmd); } } +void +Perror(const char *cmd) +{ + Perrorc(cmd, errno); +} + /* * Print a value a la the %b format of the kernel's printf */ diff --git a/sbin/ifconfig/ifconfig.h b/sbin/ifconfig/ifconfig.h index 7b2b88a4dfac..9d37a6e75eba 100644 --- a/sbin/ifconfig/ifconfig.h +++ b/sbin/ifconfig/ifconfig.h @@ -144,10 +144,15 @@ struct ifaddrs; struct addrinfo; enum { - RIDADDR, - ADDR, - MASK, - DSTADDR, + RIDADDR = 0, + ADDR = 1, + MASK = 2, + DSTADDR = 3, +#ifdef WITHOUT_NETLINK + BRDADDR = 3, +#else + BRDADDR = 4, +#endif }; struct snl_state; @@ -164,6 +169,7 @@ struct io_handler { typedef void af_setvhid_f(int vhid); typedef void af_status_nl_f(struct ifconfig_args *args, struct io_handler *h, if_link_t *link, if_addr_t *ifa); +typedef int af_exec_f(struct io_handler *h, int action, void *data); struct afswtch { const char *af_name; /* as given on cmd line, e.g. "inet" */ @@ -190,6 +196,7 @@ struct afswtch { void (*af_postproc)(int s, const struct afswtch *, int newaddr, int ifflags); af_setvhid_f *af_setvhid; /* Set CARP vhid for an address */ + af_exec_f *af_exec; /* Handler to interact with kernel */ u_long af_difaddr; /* set dst if address ioctl */ u_long af_aifaddr; /* set if address ioctl */ void *af_ridreq; /* */ @@ -202,6 +209,7 @@ struct afswtch { struct addrinfo *dstres); }; void af_register(struct afswtch *); +int af_exec_ioctl(struct io_handler *h, int action, void *data); struct ifconfig_args { bool all; /* Match everything */ @@ -259,7 +267,8 @@ void sfp_status(int s, struct ifreq *ifr, int verbose); struct sockaddr_dl; bool match_ether(const struct sockaddr_dl *sdl); bool match_if_flags(struct ifconfig_args *args, int if_flags); -int ifconfig(int argc, char *const *argv, int iscreate, const struct afswtch *uafp); +int ifconfig(struct ifconfig_args *args, struct io_handler *h, + int iscreate, const struct afswtch *uafp); bool group_member(const char *ifname, const char *match, const char *nomatch); void print_ifcap(struct ifconfig_args *args, int s); void tunnel_status(int s); @@ -270,6 +279,9 @@ void print_metric(int s); /* Netlink-related functions */ void list_interfaces_nl(struct ifconfig_args *args); +int ifconfig_wrapper_nl(struct ifconfig_args *args, int iscreate, + const struct afswtch *uafp); +uint32_t if_nametoindex_nl(struct snl_state *ss, const char *ifname); /* * XXX expose this so modules that neeed to know of any pending diff --git a/sbin/ifconfig/ifconfig_netlink.c b/sbin/ifconfig/ifconfig_netlink.c index 26a42b5866c5..598444d0d029 100644 --- a/sbin/ifconfig/ifconfig_netlink.c +++ b/sbin/ifconfig/ifconfig_netlink.c @@ -122,6 +122,22 @@ nl_init_socket(struct snl_state *ss) err(1, "unable to open netlink socket"); } +int +ifconfig_wrapper_nl(struct ifconfig_args *args, int iscreate, + const struct afswtch *uafp) +{ + struct snl_state ss = {}; + struct io_handler h = { .ss = &ss }; + + nl_init_socket(&ss); + + int error = ifconfig(args, &h, iscreate, uafp); + + snl_free(&ss); + + return (error); +} + struct ifa { struct ifa *next; uint32_t count; @@ -186,6 +202,29 @@ prepare_ifmap(struct snl_state *ss) return (ifmap); } +uint32_t +if_nametoindex_nl(struct snl_state *ss, const char *ifname) +{ + struct snl_writer nw = {}; + struct snl_parsed_link_simple link = {}; + + snl_init_writer(ss, &nw); + struct nlmsghdr *hdr = snl_create_msg_request(&nw, RTM_GETLINK); + snl_reserve_msg_object(&nw, struct ifinfomsg); + snl_add_msg_attr_string(&nw, IFLA_IFNAME, ifname); + + if (!snl_finalize_msg(&nw) || !snl_send_message(ss, hdr)) + return (0); + + hdr = snl_read_reply(ss, hdr->nlmsg_seq); + if (hdr->nlmsg_type != NL_RTM_NEWLINK) + return (0); + if (!snl_parse_nlmsg(ss, hdr, &snl_rtm_link_parser_simple, &link)) + return (0); + + return (link.ifi_index); +} + static void prepare_ifaddrs(struct snl_state *ss, struct ifmap *ifmap) { @@ -415,8 +454,11 @@ list_interfaces_nl(struct ifconfig_args *args) fputs(iface->link.ifla_ifname, stdout); } else if (args->argc == 0) status_nl(args, &h, iface); - else - ifconfig(args->argc, args->argv, 0, args->afp); + else { + struct io_handler hh = { .s = -1, .ss = &ss }; + + ifconfig(args, &hh, 0, args->afp); + } } if (args->namesonly) printf("\n"); From nobody Mon May 22 13:46:48 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPzJT0tqxz4BTHk; Mon, 22 May 2023 13:46: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 4QPzJT0QHkz4c5d; Mon, 22 May 2023 13:46:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684763209; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oU++6TJAkLzZKMXqUpptFmJmVdIsC3HA+EOAjzxAHsU=; b=FnqCDKkZafWVjqPg/XDxkY8RuqjS5sHeCevSjmPnEs73+yfGCvmJQwJiwDBzg+4y+sOCiv cEqvYFDRvGW5KRG5A3NS7xKD/dRMjDNSad1J/lSwhtBkplo31iGLRPHQL5tHbgSuXWb8Ls YdArpH3ilkf0SspQvYa2zJp6gcY/gDzbFO0QtXW6DIfM/bENcaBiyLDOo3csku+eB4AZKk AsaUHKbqGPeCzLpuFt5a7+dQnCH7zWD0nMEv2s9ynySUddDTIeLG0DAnuy4AM741uzJZoh PObUajN06GFwiwRPY98NjsYBTatIQXhyojhkZLCKdmbeMRqEA4bSJX+Z6sc5TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684763209; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oU++6TJAkLzZKMXqUpptFmJmVdIsC3HA+EOAjzxAHsU=; b=PG0qV2wW2HuoQCWL6NwqiYO1o/HQecIRFkEcThDi+rXd39mXywjpCDGucMMJIIlOLJRMUV d8AkywEiorqyeGfsRvI4BMIVGO8fOVhYbU6Rcwq9ziqqR2DUkIcoVli2N6woeRGkCdB5Uf zF+Y/1G+sIo3nYBgm7sd2/kRC1U7O2yFfnFBteg0ZuJLnbTMyWYzoWXy6WYx+wz29nJVH+ M7R7dIWGtfVcp1j/bY3ED9WBIHDcsyfNt96x9uX1yvEkJCP4bV4ZL+YNDEJ5GAMx3zPSjN DJkum4aG38fl43zd8i/4iE9Gp2elA514FFsgmj+B13UjN5z5D9E9pWeWUa+7Pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684763209; a=rsa-sha256; cv=none; b=rPnmfBYiVzusT432O9v8XpiExtt8S3j8mvw/ymZ4mzxEKS4BKBnsA5zbviwfMJZGl+AH5s KzQJcYBksskFCt/JPo23tjvZ9jsuF9WGZmgLPsMsL6+jtBwd1eNq8FQql7k9mIMeD6nEmZ rLOMVxVcDb485+ELhqOBARgfNdHCm/Wg7rPvXdgdDb/Wtg+iqWW1jLC0jf8t2vTAwBDRco KaGzEXlr0xDi7zeO31At/TZYHwNH+xupLxl0Ix1WF+pf4dBN9x/6k985suKaN+6UskHl01 xihttb9bNhxw8IoeUmTXO8GUNFo7212+KQP5oCtq33RH9uo8n4hvpI5ctFH2sw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QPzJS6KrNzKmd; Mon, 22 May 2023 13:46: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 34MDkmKn076922; Mon, 22 May 2023 13:46:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34MDkmo9076921; Mon, 22 May 2023 13:46:48 GMT (envelope-from git) Date: Mon, 22 May 2023 13:46:48 GMT Message-Id: <202305221346.34MDkmo9076921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 6f49eafb056c - main - libthr rtld locks: do not leak URWLOCK_READ_WAITERS into child List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6f49eafb056cfa0703dfc97a731cabe4ed2596b8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=6f49eafb056cfa0703dfc97a731cabe4ed2596b8 commit 6f49eafb056cfa0703dfc97a731cabe4ed2596b8 Author: Konstantin Belousov AuthorDate: 2023-05-20 08:11:54 +0000 Commit: Konstantin Belousov CommitDate: 2023-05-22 13:46:42 +0000 libthr rtld locks: do not leak URWLOCK_READ_WAITERS into child Since there is only the current thread in the child, no pending readers exist. Clear the bit, since it confuses future attempts to acquire write ownership of the rtld locks, due to URWLOCK_PREFER_READERS flag. To be future-proof, clear all state about pending writers and readers. PR: 271490 Reported and tested by: KJ Tsanaktsidis Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D40178 --- lib/libthr/thread/thr_fork.c | 4 ++++ lib/libthr/thread/thr_private.h | 2 ++ lib/libthr/thread/thr_rtld.c | 11 +++++++++++ 3 files changed, 17 insertions(+) diff --git a/lib/libthr/thread/thr_fork.c b/lib/libthr/thread/thr_fork.c index 9861e93c427d..341afc2b06ec 100644 --- a/lib/libthr/thread/thr_fork.c +++ b/lib/libthr/thread/thr_fork.c @@ -78,6 +78,8 @@ __FBSDID("$FreeBSD$"); __weak_reference(_thr_atfork, _pthread_atfork); __weak_reference(_thr_atfork, pthread_atfork); +bool _thr_after_fork = false; + int _thr_atfork(void (*prepare)(void), void (*parent)(void), void (*child)(void)) @@ -243,7 +245,9 @@ thr_fork_impl(const struct thr_fork_args *a) _thr_signal_postfork_child(); if (was_threaded) { + _thr_after_fork = true; _rtld_atfork_post(rtld_locks); + _thr_after_fork = false; __thr_pshared_atfork_post(); } _thr_setthreaded(0); diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h index a64c3f1692ab..e235ff424358 100644 --- a/lib/libthr/thread/thr_private.h +++ b/lib/libthr/thread/thr_private.h @@ -779,6 +779,8 @@ extern int _suspend_all_waiters __hidden; extern int _suspend_all_cycle __hidden; extern struct pthread *_single_thread __hidden; +extern bool _thr_after_fork __hidden; + /* * Function prototype definitions. */ diff --git a/lib/libthr/thread/thr_rtld.c b/lib/libthr/thread/thr_rtld.c index a9d1924967a7..cedc13a1440e 100644 --- a/lib/libthr/thread/thr_rtld.c +++ b/lib/libthr/thread/thr_rtld.c @@ -158,6 +158,17 @@ _thr_rtld_lock_release(void *lock) l = (struct rtld_lock *)lock; state = l->lock.rw_state; + if (__predict_false(_thr_after_fork)) { + /* + * After fork, only this thread is running, there is no + * waiters. Keeping waiters recorded in rwlock breaks + * wake logic. + */ + atomic_clear_int(&l->lock.rw_state, + URWLOCK_WRITE_WAITERS | URWLOCK_READ_WAITERS); + l->lock.rw_blocked_readers = 0; + l->lock.rw_blocked_writers = 0; + } if (_thr_rwlock_unlock(&l->lock) == 0) { if ((state & URWLOCK_WRITE_OWNER) == 0) curthread->rdlock_count--; From nobody Mon May 22 13:55:34 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPzVf4VpMz4BTts; Mon, 22 May 2023 13:55:38 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4QPzVf19Fdz4dQm; Mon, 22 May 2023 13:55:38 +0000 (UTC) (envelope-from hselasky@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from [10.36.2.145] (unknown [46.212.121.255]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 54B112606CF; Mon, 22 May 2023 15:55:35 +0200 (CEST) Message-ID: <6de2b70e-7006-71e3-c81d-6de306c7aaa3@freebsd.org> Date: Mon, 22 May 2023 15:55:34 +0200 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: git: 805d759338a2 - main - mlx4: Move DEFINE_MUTEX() outside function body. To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202305211621.34LGLsup059861@gitrepo.freebsd.org> <54EF67D8-2A79-4EAB-8EFB-232F14FFE792@freebsd.org> <21c9532e-4ca7-a7fe-1ff6-07a94cbad6ab@freebsd.org> <3066464F-E4C6-4B84-ADFF-E578AFAFE622@freebsd.org> <26465813-3B51-4E52-9E9D-F93A0F2AF6BD@freebsd.org> <2BF2F7CF-82E6-4D98-800D-C35D7C29E948@freebsd.org> Content-Language: en-US From: Hans Petter Selasky In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4QPzVf19Fdz4dQm X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 5/21/23 23:58, Jessica Clarke wrote: > On 21 May 2023, at 22:37, Hans Petter Selasky wrote: >> On 5/21/23 21:41, Jessica Clarke wrote: >> >> I can not know what you know before you tell me. I'm not a mind reader and I for sure don't think you are an idiot. Those are in such case your own words about yourself and not mine, to make it clear. > > You can’t know, though you could go look at commit history to see that I have made changes to the build system and thus probably have an understanding. Or you could assume that I know what I’m talking about when I choose to engage. Both are good things to do that show some amount of respect, otherwise you are at risk of insulting people by assuming that you need to explain the basics to them. Hi Jess, I also have a commit history, but I don't use the number of commits I've made in the past as an argument to gain respect. Respect is something your earn from others and not something you give yourself. A good way to resolve disputes is to go through the basics to find out where differences occur. It is simply echoing back what the other person is saying in your own words. It has nothing to do about insulting people. That is something you need to accept as a method of resolving problems, because in this world there are many different people, and many different minds. > >>>> If you are worried multiple DEFINE_MUTEX(lock) will result in multiple global symbols having the same "lock" name, all you need to do is pass through the ${.TARGET} variable from "make" as a define, stripping a few invalid characters, and macro-concat that to the locally generated global variable name, and you are all good. >> >>> You could. But that’s a pretty gross hack IMO, and depending on how you do it may still not be unique. Not to mention it’s going to further bloat the symbol tables with these long names. >> >> Why do you think I don't know what a hack is? > > I didn’t. I said “IMO”. *My* opinion. It is a hack and that is what I do for a living. I write code, I don't buy code. I make solutions, I don't buy solutions. And regular people call me a hacker. And when newspapers write about hackers they show a screenshot of Linux Ubuntu and a terminal with green letters and black background. In the next sentence they usually write something about viruses spreading or Bitcoin dissappearing. According to the "world" I'm a criminal. And when you say "that's a pretty gross hack IMO", maybe I should take that as a compliment. Yeah, I'm a hacker after all, and my hacks are pretty gross. The worst hacker out there you can get .... > >> In the case about the "lock" name being global: >> >> - My solution is to pass a define to the compiler to help make the identifier unique across the monotolithic kernel build. >> >> - When building the LINT target, the linker will fail if there are duplicate global symbols. Then the debug information output by the linker will tell the file and line. Go there and change the identifier. It should be rare. Problem solved. >> >> - All symbols being made global for the sake of processing them, are listed by name. And after the final sorted sysinit table is created and linked, all those symbol names can be stripped away from the resulting binary, and then only the relocations remain, if I'm not mistaken. I didn't do that in my differential review, because it is a prototype. The argument about symbol table bloat, because of prefixing or suffixing global symbols is not valid the way I see it. >> >>> Given the sysinit subsystem still needs to be able to merge in new sysinits registered dynamically, one might as well just do the sort dynamically, it’s very little added complexity on top, especially when sorting functions are just a libkern call away. Much less complexity than all this scripting to generate tables. >> >> Do you agree about the following statement or not? >> >> If you have two already sorted lists and a pointer to each of them, then: >> >> Method a) place the two lists after each other in memory and then call qsort() on the resulting list, is relatively slow. >> >> Method b) look at the next element from each list, and store the smallest one into the destination list, and repeat until the end of both source lists are reached, is relatively much faster. > > Clearly merging is faster. But compared with qsort it’s unlikely to be all that significant; lg n grows slowly. Right, and invoking a sorting function on an already sorted list, is not needed if you think about it. >>>> Your comment is correct based on your prior knowledge about Linux and compilers. But at this point FreeBSD is different. That's why porting code from Linux to FreeBSD is sometimes difficult, because you need to keep track of how source files are renamed. You cannot just use "meld Linux/blah FreeBSD/blah" to compare directories ... >>> DEFINE_MUTEX is Linux’s API, implemented in LinuxKPI. So Linux’s behaviour is absolutely relevant. Any deviation from Linux’s semantics is an incompatibility that requires patching any sources that are built for FreeBSD using LinuxKPI. It is generally best to minimise that. >> >> One side of this is compile time issues. If a developer needs to change something to make the code compile for FreeBSD, that's acceptable. And then the developer can also say the code was made for FreeBSD and not Linux, which is good with regards to the GPLv2 license, and not just copying solutions from Linux or being force to implement things exactly like on Linux, so-called bug-by-bug compliance. >> >> The other side is runtime issues. Here the goal should be to minimise issues to zero and try to outperform Linux. > > I don’t have any clue what you’re going on about here. Tweaking Linux code to be compatible with FreeBSD’s LinuxKPI doesn’t suddenly render the code free from GPLv2, it’s still Linux-derived code, but you’ve had to modify it rather than be able to use it as-is, which is the goal of LinuxKPI, where possible. And so ideally *no* changes would be acceptable. So I disagree with your statement that needing to change things is acceptable; it’s only acceptable where there is no good alternative. This is about implementing the LinuxKPI itself and the APIs provided by the Linux kernel. Because the LinuxKPI is BSD licensed the code vendors have an option to dual license their kernel code between Linux and FreeBSD. Like I wrote, implementing APIs differently than in Linux, is good thing resolving disputes about licensing. And other times it is more difficult to do that. I hope these clues help you see what is going on there. > > I don’t see what “outperform Linux” has to do with any of this discussion. > That's about something else. --HPS From nobody Mon May 22 14:01:57 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QPzdx6sSrz4BVDv; Mon, 22 May 2023 14:01: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 4QPzdx6M6hz3BpY; Mon, 22 May 2023 14:01:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684764117; h=from:from:reply-to:subject:subject: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+QWL5+07mncLXZvxWOyQogGh9d25CGgF7uwoi7kPw4=; b=eNeKibmTRS7BYx7Cb5347W4PXGr22B0ShGUfIYXYe9gyiHSz4BDtLbmhdcGnDTzSdvDdtz ZRMny+P40MPsaE3/S3ZNPtXv8g9OtYiVl1ctu5kDMP9dvVBtb7VcF1OTt9tHu+iG/tcLZG bkr5TZ4FYZuSkFUYyEDW/jtlW70obv5RA837lpHE8ABYdr+Zs388zro9sP8lAW93KHL8fp VwJS0TDBM/aM9ccSCIp+VDXxP0hPyjHfptkTSSqFgmvUm5hwkghPuiQYBNPPEiqh9/LIxC OHeyQV8vG2AMU+Skltk6X+y25Db5p0W1AsC5erICSXpGUyzp7vMrfcuYu17fYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684764117; h=from:from:reply-to:subject:subject: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+QWL5+07mncLXZvxWOyQogGh9d25CGgF7uwoi7kPw4=; b=ZA94v9+iQfJvmGzuQEHxiiiuMj6gjXr9jeQdGdPFj7LZ48XICk5Wnhlw65fY89NnNcAsvX r0KDTzrNNhWM0Mvv5zBD/khuDd2WkcbkeUPP2fZ2XuEPeDbjwQCFukCOk+5gdNijRnFc29 KE5dvOorx9W13XS7F0J+IC7aNMrcWvP8qjYLY+XIJz3UGJPYQR7yoieTjrDJGtPfzTKBnS TtzMkeQUGGjQcMattr7Onoayc/lBrL6VAcnlKiXkAuNS9hb0wZ8akzWCRIQrqi1Tl4CWfC 7sm/XxsXHLxx8huOEYpW90XIrPLJt42Q2jXJmwRgyZ9XLulzFAO8BXiL1IB9Tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684764117; a=rsa-sha256; cv=none; b=v1fO+WwrV/iMCB9K6cmNHq66YqeO4gCXrZy9pl2eOuAiYp7hcQ5zsVt8IODx7szqHlsvxC EgplCpmmsQ2YCZs4a25eoLzPdRybk8AMb7Ddh/lkrib6sXQabH8v/85Qp/gfslttKQpE1P XOKDXlsj/W73bZHLJuHF+zaDW1NXsDODBHyzTV6GKkzsBcdbULNaB2/lXdYB4bFhheunvN V7qY5cu8iWgKQaluOBWQZWad7C+bqETuG15NSltWiYtMYgUjSmSxMS3YjEefteff4i9yHo rTO22pM+ZW8LHfJyvKu8yztdTOOsQgOHplPa7DwPZLVHGeK7kSHZfAFUKkvCCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QPzdx5QZ0zKvh; Mon, 22 May 2023 14:01: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 34ME1vi8008829; Mon, 22 May 2023 14:01:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34ME1vC2008817; Mon, 22 May 2023 14:01:57 GMT (envelope-from git) Date: Mon, 22 May 2023 14:01:57 GMT Message-Id: <202305221401.34ME1vC2008817@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: af15ae9dd139 - main - prepare-commit-msg: add 'Event' List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: af15ae9dd13969abd384cbbfb61bfcc298e5cc5a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=af15ae9dd13969abd384cbbfb61bfcc298e5cc5a commit af15ae9dd13969abd384cbbfb61bfcc298e5cc5a Author: Kristof Provost AuthorDate: 2023-05-20 14:52:38 +0000 Commit: Kristof Provost CommitDate: 2023-05-22 14:01:09 +0000 prepare-commit-msg: add 'Event' Add 'Event' to the pre-commit template. The key word is already documented at https://docs.freebsd.org/en/articles/committers-guide/#_include_appropriate_metadata_in_a_footer Suggested by: imp@ Event: BSDCan 2023 Differential Revision: https://reviews.freebsd.org/D40184 --- tools/tools/git/hooks/prepare-commit-msg | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/tools/git/hooks/prepare-commit-msg b/tools/tools/git/hooks/prepare-commit-msg index e8125f47eb33..ac3844accec2 100755 --- a/tools/tools/git/hooks/prepare-commit-msg +++ b/tools/tools/git/hooks/prepare-commit-msg @@ -52,6 +52,7 @@ $(awk '1;/^#$/{exit}' $1) # MFC after: # Relnotes: # Security: +# Event: # Sponsored by: # Pull Request: /pull/###> # Differential Revision: From nobody Mon May 22 14:47:24 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQ0fg6LGhz4BY0h; Mon, 22 May 2023 14:47:39 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQ0ff44gxz3FVN; Mon, 22 May 2023 14:47:38 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.167.41 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com; dmarc=none Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-4f3a873476bso4899372e87.1; Mon, 22 May 2023 07:47:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684766856; x=1687358856; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RPtLJuBzwlcAe6MBn0osw67T6IGz7SAU2MAHQ2v8zPE=; b=EhQPpWiSVDpJ25LDVSGVuNPwVEsEIu6MF+9LjWxV2T1fWN4qzslesjKTUVfFvOBirj ucS7NUu/yhkC8eZa161uO2GtCPTf1qUztV980uvyhijIUZil6QL5OF8d/lN5CT8m0CLK Oucdc1DT+Ga2jg7H8dbf8mz7M6bzd6GnV7yNj0eJRtKvohc4eahS3YjOrkeAccHf6nXd 70IrLwfZ9arD2ptAs1xJhE5MkHL3OJQqazAm+qSoIKR6L/mOSOmgIuFwtLfGAXt/d2sT qwDcLMfCpWT3HDIqS2V3cSEPqk5X8Co6Y741NvcOycv+OGNCqQ+83XJcqb0PtKXHepyy 1p+Q== X-Gm-Message-State: AC+VfDzQJckpgTDXr5SWhjdveaSUYqR3MqIsOk4CxTK7Cryj1y0FuRnk LUVJBKzLbXj76qjXVrzf2zyuohISnAgrDqAIRBCkRpNAJrQ= X-Google-Smtp-Source: ACHHUZ6jBhaJ/+b/QMym95CQQhkHHhAz6u8ThKvsemwbKPldg5mDK1bYG1IJv6qJaP309r38jWNE07qNkYE38AlWuRs= X-Received: by 2002:ac2:43dc:0:b0:4f3:b620:ce26 with SMTP id u28-20020ac243dc000000b004f3b620ce26mr1975465lfl.42.1684766856094; Mon, 22 May 2023 07:47:36 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202305121113.34CBDwTF017867@gitrepo.freebsd.org> In-Reply-To: From: Ed Maste Date: Mon, 22 May 2023 10:47:24 -0400 Message-ID: Subject: Re: git: e639e0d27cc8 - main - zfs: merge openzfs/zfs@e61076683 To: Martin Matuska Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Spamd-Result: default: False [-2.97 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.97)[-0.970]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.41:from]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.41:from]; BLOCKLISTDE_FAIL(0.00)[209.85.167.41:server fail]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[carpeddiem]; ARC_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4QQ0ff44gxz3FVN X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N On Sat, 13 May 2023 at 10:02, Mateusz Guzik wrote: > > > Hi Martin, > > This change seems to have broken CI with gcc12 on amd64: > > https://ci.freebsd.org/job/FreeBSD-main-amd64-gcc12_build/983/ > > -Enji > > i reported upstream > https://github.com/openzfs/zfs/pull/14813#issuecomment-1546659802 The upstream fix was committed last week - can you bring it in as soon as possible, so that we can get CI green again? https://github.com/openzfs/zfs/commit/c87798d8ff6a63158e80acbbce8b034518a1656e Or, I can cherry-pick just that change https://github.com/freebsd/freebsd-src/compare/main...emaste:freebsd:main From nobody Mon May 22 14:55:00 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQ0q830kRz4BXxP; Mon, 22 May 2023 14:55:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQ0q82Ffpz3GDQ; Mon, 22 May 2023 14:55:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684767300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1yQqrFNXSgZaKBONnPZOvQiu6xfljGzvKajQHTlODwY=; b=ax9gD3kNnXhwARnmqhtfX90e6L8Og0OHmGu6UTQRtbb/bZfz7M2CSlVonq8gLwwfzp5JnV b5bBA9uQryjxyBxjDkV7bxRHIff9GG9SNsNoSQxProVUnaCA5ukYCRIKArUBq9NEMZXDKm jRLT9p95/zt+FajBa8K0VpY/BCn37pVyM7OqWiux/r1vy3DdQcyVfbOUIPNwjx4Eu4acAD DMcZFu8wH4uX2ald/XqDi0tOOjbKbmbcywweP7fljwCx3FIdK9fxviHcUgwI0Cs5Q2Bril bxPMOq3Snb5dJoBkRk6PhAjNrYW/mbpgNKxi+SXH0LsVKnuiSGN6k+1+rfa1zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684767300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1yQqrFNXSgZaKBONnPZOvQiu6xfljGzvKajQHTlODwY=; b=S7pPr0Qg+m2gjFbvRYosd+OvQlIbhaMa4OrZ0JlyQq2LTuM7G5OW2ZI1kl4NdpyyGErh8r sgEMiZ8TtfMRuC2xepFldxuSY5O21V10HVO+YZPrMsXBp/s/ocTMFj6iuO3mmdSEcp5A9c 2aDpI1FzmE1JLnjDsl6SlUEBoBzGF2q48Ke3lZHN4gjdbfXMTrpiFmEd0zhjDGvdwjidMY mui0npoEF1DgX1I25Q5x/FAJf2qOI8P3aNwYf7sZNuXQ8sx+7owiI+VB592fW4iCPjUwta SZoCGfbo4FNuNuXDoiHgDLQKe1xaDgdbxjtigX55+GgpZr0FN8kT/X0GKOv+vQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684767300; a=rsa-sha256; cv=none; b=QnWOV1lraRREkfdXRT2rSR/VjmtTZ0vhPpZTWdTWaBRwUsCyM0YU3BDwZ/piYtHgHjHOW1 +JBjukEGES10MHZCjROae9q2pzgewFxXaLj6UWWnb4Y3Q/BHqpiJ79xEzMTz+nHD/RWFtY S2Mi2xwxJ9r/GbRWA/nhwfzyS/LSDNVqey6R4rnY2LjVjLmu5BlFodn1tR7cDV2oaExb/Z xD8kzB6keihcyYTj3x1ULWR9hudXHQnxNS13TESAxg4BMmVUtvVu9GoUvj4RPiPYU7g2JW jUQNl5ffQsyaA6eOtJeqEiIzincT8d0Ec/Qdyn9wT+RB9xZIaL5xDHuZstCXoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQ0q81DMqzMTt; Mon, 22 May 2023 14:55:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34MEt0kH091795; Mon, 22 May 2023 14:55:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34MEt0ZB091794; Mon, 22 May 2023 14:55:00 GMT (envelope-from git) Date: Mon, 22 May 2023 14:55:00 GMT Message-Id: <202305221455.34MEt0ZB091794@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 5b8ce85e1a72 - main - ifconfig: Fix the build List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5b8ce85e1a72d2c9541cb344b4e157f38f6a5d6c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5b8ce85e1a72d2c9541cb344b4e157f38f6a5d6c commit 5b8ce85e1a72d2c9541cb344b4e157f38f6a5d6c Author: Mark Johnston AuthorDate: 2023-05-22 14:53:38 +0000 Commit: Mark Johnston CommitDate: 2023-05-22 14:53:38 +0000 ifconfig: Fix the build Fix indentation in warn_nomask() while here. Fixes: 54418f79fd29 ("ifconfig: switch IPv4/IPv6 address manipulations to Netlink") --- sbin/ifconfig/af_inet.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sbin/ifconfig/af_inet.c b/sbin/ifconfig/af_inet.c index ab2b01320d04..53a9595653ba 100644 --- a/sbin/ifconfig/af_inet.c +++ b/sbin/ifconfig/af_inet.c @@ -382,12 +382,12 @@ in_setdefaultmask_nl(void) #endif static void -warn_nomask(ifflags) +warn_nomask(int ifflags) { - if ((ifflags & (IFF_POINTOPOINT | IFF_LOOPBACK)) == 0) { - warnx("WARNING: setting interface address without mask " - "is deprecated,\ndefault mask may not be correct."); - } + if ((ifflags & (IFF_POINTOPOINT | IFF_LOOPBACK)) == 0) { + warnx("WARNING: setting interface address without mask " + "is deprecated,\ndefault mask may not be correct."); + } } static void From nobody Mon May 22 14:57:56 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQ0tl5C88z4BYLF; Mon, 22 May 2023 14:58:07 +0000 (UTC) (envelope-from kevans@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 4QQ0tl4G0Zz3Gj7; Mon, 22 May 2023 14:58:07 +0000 (UTC) (envelope-from kevans@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684767487; 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=hBrLIGVG3jTm9Irc4bD55Q7yhyibcHuvPcmW6eDosWM=; b=CmyREVPQVniTaX7b0ROiOhdiax+Hg8rzkpEVejhYx9Xq6Ukx3F8UIV9ASvghN6kbdqiZWe zHo340T8i7evnMWhdM8xbka7uaD3tpvtmK/N5IZUBfnPBipsQOU+ohTzK6WvjbdvPN8tuc W0bTWd/W8KqIbH97H1Pz132PANKhIwaz7ePVaLojLC/9icI84SbkpWt+EM+d/NlPdade7F 7zBhtWYpc+4Or1nixEEQLHopseUaR/T1UXN5jy8xDWCHp53Bx2UIP0D0/Mo/UYVE/SocOR cJVUTbqxIr+2hap6zwfqv77PzaMnNL4FiFPQqa+JAAmB8wJ4GR9fDzyB+hoNuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684767487; 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=hBrLIGVG3jTm9Irc4bD55Q7yhyibcHuvPcmW6eDosWM=; b=ede4yoR3Q3L307D+jZI3wHw9+x8vHUMHlMB9KwLyB+TLfNN3A6e6vIx70qKL/pfBsBHyCa w0uRB26KA0jMuXl+JWM/NE6dvcOsb16F8RC3+Z4w/YzAQ2ov8fJo9F8E4987VP0jtFkMG7 d0kc73wd0YYDxpHBHLMUPcuTs3P1NQK2WOR0G3vxPC94Jd5gdd4TNZHDZp6A+Qe7rFqAFE z6U/zxkL/cdUD2OP9cBZOn/T2MB1q1CQWqizLVvjhtKhFR9qP986uDPYYeNsvivnGop+xT GjfzAQlkghdc/u+MAuh/A3oBngwIPoDC66hO99bBbEpAyPBfqUX1Jp0nlnrraQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684767487; a=rsa-sha256; cv=none; b=nKkyBQhvccIuoryTNs2cVwYdPbYZritiZkwx0Y4Hp5TSWKtNxbOw5HncJ4xZLb8TT+c2Wo wPqZTCHdO08jIGExK+wZ246MpMAtcRLFyoEVuU7U5YCEVgeNMIMCuA4peBhxelHybBEV7C svnuUNsb6wHXJRS6rAj6yr10Ig3IfIUmAzfcot5hN7I7pTT01aVkO5fIJaE9MLEQOz8bOe Ima3sKgKYrn2/D5C1J36BDlaE/xAxF86Et+dyvWoThoMxl+GKdpAQv6cJ1KiAFzoRP3sF7 Xb2Q0NCVL+xkOpmz5IBk0ofFRaw9qw9FPG1oBuV43Z0oSrfUuW3/4LaYyOt4dw== Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 4QQ0tl3BqPz15K8; Mon, 22 May 2023 14:58:07 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-62577da77d0so6393566d6.2; Mon, 22 May 2023 07:58:07 -0700 (PDT) X-Gm-Message-State: AC+VfDxDSZvGLSt48IfZss/NSDBqBhV4KdjyNlAaxPnj9TJ1/S9eLNr9 fR2ct+TGcvqUp/9I0j6pCOXI9UWCQLzkyNDDoCE= X-Google-Smtp-Source: ACHHUZ4RGCoCVvFjcIRigqQRVW2s+m00KgGqlJswCrm6FeZRE6xuzjea8ETKeSK3Bna3GWAltBlVH3Hn8Bqmo1QtDKI= X-Received: by 2002:a05:6214:f0a:b0:5fd:7701:88c5 with SMTP id gw10-20020a0562140f0a00b005fd770188c5mr22567052qvb.6.1684767487033; Mon, 22 May 2023 07:58:07 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202305151542.34FFgONF071780@gitrepo.freebsd.org> <663D9FB2-D1EF-4D51-9FB1-038AF6AA98C0@freebsd.org> In-Reply-To: <663D9FB2-D1EF-4D51-9FB1-038AF6AA98C0@freebsd.org> From: Kyle Evans Date: Mon, 22 May 2023 09:57:56 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: ccb59683b983 - main - arm64: add tests for swp/swpb emulation To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-ThisMailContainsUnwantedMimeParts: N On Mon, May 15, 2023 at 5:00=E2=80=AFPM Jessica Clarke = wrote: > > On 15 May 2023, at 16:42, Kyle Evans wrote: > > > > The branch main has been updated by kevans: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Dccb59683b98360afaf5b5bb6= 41a68fea22c68d0b > > > > commit ccb59683b98360afaf5b5bb641a68fea22c68d0b > > Author: Kyle Evans > > AuthorDate: 2023-05-15 15:42:16 +0000 > > Commit: Kyle Evans > > CommitDate: 2023-05-15 15:42:16 +0000 > > > > arm64: add tests for swp/swpb emulation > > > > One test is suitable to be hooked up to the build, so I've done this > > here. The other test lives in tools/regression because failure is a > > bit more subjective -- generally, one runs it for some unbounded amo= unt > > of time and observe if it eventually exits because two threads acqui= red > > the same mutex. > > > > Reviewed by: imp, mmel > > Sponsored by: Stormshield > > Sponsored by: Klara, Inc. > > Differential Revision: https://reviews.freebsd.org/D39668 > > --- > > etc/mtree/BSD.tests.dist | 2 + > > tests/sys/Makefile | 1 + > > tests/sys/compat32/Makefile | 6 + > > tests/sys/compat32/Makefile.inc | 4 + > > tests/sys/compat32/aarch64/Makefile | 24 ++ > > tests/sys/compat32/aarch64/common.sh | 9 + > > tests/sys/compat32/aarch64/swp_cond_test.sh | 14 + > > tests/sys/compat32/aarch64/swp_cond_test_impl.S | 413 +++++++++++++++= +++++++ > > tests/sys/compat32/aarch64/swp_test.sh | 14 + > > tests/sys/compat32/aarch64/swp_test_impl.S | 216 +++++++++++ > > tools/regression/compat32/aarch64/Makefile | 4 + > > tools/regression/compat32/aarch64/swp_test_impl.S | 410 +++++++++++++++= ++++++ > > 12 files changed, 1117 insertions(+) > > > > ... > > diff --git a/tests/sys/compat32/aarch64/Makefile b/tests/sys/compat32/a= arch64/Makefile > > new file mode 100644 > > index 000000000000..716182b15d9c > > --- /dev/null > > +++ b/tests/sys/compat32/aarch64/Makefile > > @@ -0,0 +1,24 @@ > > +PACKAGE=3D tests > > +FILESGROUPS+=3D asmprogs > > + > > +ACFLAGS=3D -target armv7-unknown-freebsd${OS_REVISION} -nostdlib -Wl,-= e -Wl,main -static > > This won=E2=80=99t work with GCC, nor will it work with an LLVM built wit= h only > AArch64 enabled as a target (e.g. -DWITHOUT_LLVM_TARGET_ALL > -DWITHOUT_LLVM_TARGET_ARM; latter is needed since we do default to > enabling ARM if AArch64 is even for a cut-down toolchain so that -m32 > works). This is why the freebsd32 sigcode in arm64 kernels is written > as hex (with disassembly comments) rather than assembled from proper > source. > Hi, Just dropping a note that I have still been thinking about this one. It's half tempting to leave the build infrastructure for the impl binaries in place (+ fixed for GCC, just to be flexible), but disconnected with the expectation that the result gets committed rather than run as part of the build. That's a bit gross, but getting hex with disassembly comments somewhere in such a way that we can exec it properly as a 32-bit arm image is also a bit gross. Thanks, Kyle Evans From nobody Mon May 22 15:19:14 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQ1M72HHkz4BZX7; Mon, 22 May 2023 15:19:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQ1M71ZCTz3MRf; Mon, 22 May 2023 15:19:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684768755; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qurempD4oPe38TSXXUWi9fmhs9HPd1t+BBkEOHdhzUc=; b=rSkNeWs3EgR/IqOEXmR7ViCg7hqyBsOil24aksf4Locz/kcOD9g5iXxXowxO4ihn/5PocY OgyGF/ssTPAvSTUHlByUpGBaZ9dN1yJqePxHWYqzGXYLMbtcf/vcxc6k3o9h+0P5hovAM0 F7C56lXNXtoK+erfhO+Tt5sd9BTmWrw4sFmU54tJc17rnvtmR4EJaCbDXpQ4lY3LjKTj8+ yWvYj8nr7/8ACctVdDprOnfeV31jeuxmp1SjxjQPxAIhKOjG6AuvL72wCh/BTrF5eOZ6MN LBJ0Gdcwjlj4gNKslo5IePhyEaiJcXIkE91nj8CpiCWqvuEL1HonqzFjBRF7Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684768755; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qurempD4oPe38TSXXUWi9fmhs9HPd1t+BBkEOHdhzUc=; b=EYqAOo/4rr746d1cq8hPS4VGRMgUJnoUw+lAYUAbaXJmJt1mNq2ILU5I3wnfH58D3tXPdG NpPjJeKsAfziogNRIq57OIBhEE0Os4LAuBsbjyQwFeIltXdNioHIil3vQfG2pUbXUrTTR8 lUZ+GG9CYD0Zr3lm8TfhEm4DoPcMnY9CxE0lbLkoUj5X/bouq5DiKPyvAbqZLg8gBFE1iM DiD+uG9zZIOgk1t4wafXuaCJabTdkbz2oQGHyR+YYg4wzyCacyKQQ4MN9Dbfnr/bATgqJ6 ZezFHn3hLhoCFGl7o0zw9Zt0jGyvXLjToh5dpaQD4iL+ba0opuCHwDwZa5zuCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684768755; a=rsa-sha256; cv=none; b=fBeBHlfqdYc143nYKWK8CADIzDd7PTmitpOsHn+wmgO1cwnxZsh7yRd4zKp6xPIqQkA8VZ 02txWP5CP9YB6OD81wesGa8j/1f4N4fNpxjyKMfynHeCjMLffHExbJ+cibOdOYsRvByu3h cHP2UXKQwkX+IhAXRVhnbLWYJKWYs1rCuhLmBjnX0pr//dipEPn7RNCvBn7Rxkw9hBTA7w u4IgsFKvCEY7nW5wpAz2mQX/KDe54YoKd/7xNPNIjJVHHo+sHJXZfWtN4bq3WsLKjiGdtk YykvptdgpGINPF4C2q9xQUI0zklJu/l2uTXBYiypyNFTwb/K+d4zi0F6jE8x6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQ1M70WB2zN2j; Mon, 22 May 2023 15:19:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34MFJEEb025316; Mon, 22 May 2023 15:19:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34MFJEcH025315; Mon, 22 May 2023 15:19:14 GMT (envelope-from git) Date: Mon, 22 May 2023 15:19:14 GMT Message-Id: <202305221519.34MFJEcH025315@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 454d72ec4098 - main - Revert "ifconfig: Fix the build" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 454d72ec409830c0de3be79c15ac7503221b66d4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=454d72ec409830c0de3be79c15ac7503221b66d4 commit 454d72ec409830c0de3be79c15ac7503221b66d4 Author: Alexander V. Chernikov AuthorDate: 2023-05-22 15:17:45 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-05-22 15:17:45 +0000 Revert "ifconfig: Fix the build" This reverts commit 5b8ce85e1a72d2c9541cb344b4e157f38f6a5d6c. --- sbin/ifconfig/af_inet.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sbin/ifconfig/af_inet.c b/sbin/ifconfig/af_inet.c index 53a9595653ba..ab2b01320d04 100644 --- a/sbin/ifconfig/af_inet.c +++ b/sbin/ifconfig/af_inet.c @@ -382,12 +382,12 @@ in_setdefaultmask_nl(void) #endif static void -warn_nomask(int ifflags) +warn_nomask(ifflags) { - if ((ifflags & (IFF_POINTOPOINT | IFF_LOOPBACK)) == 0) { - warnx("WARNING: setting interface address without mask " - "is deprecated,\ndefault mask may not be correct."); - } + if ((ifflags & (IFF_POINTOPOINT | IFF_LOOPBACK)) == 0) { + warnx("WARNING: setting interface address without mask " + "is deprecated,\ndefault mask may not be correct."); + } } static void From nobody Mon May 22 15:19:16 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQ1M82qQyz4BZtp; Mon, 22 May 2023 15:19:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQ1M82D79z3MMD; Mon, 22 May 2023 15:19:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684768756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XHUy4g7prE1b7tJYkzPsB8HfeU3l99UNqIeJF8Cll/4=; b=yIF3VxrVqvpa2Q+vOry48VDsnkvhIEMuHwLps2UuAcmZdzMNd3uiQFScwofg5jiJ4QMPDj 1SLD3+Dzo8ieXI7NcAMYYcAsd3SsKn9tsU96g7P8rbBgPRr+sONSAIKj6G5fLE1RTI615p 8/giAOP2gUuW5FMxym/kalVMX3xwPnypw1N8I6YrIfvFKuYCZWxzNfQ2bVmWrBuhEB8zVE yD8wqbsnFVHni12GaDDkwlEsJ6vKDMHGS7LjdTPK+g1qxTlxNIeJ3Hd1yCRIjyIfDQ0q2e c2M7GPevxKRiL8k7S0SjhM6FDWvHXDjeB3DVOd6KURCQ4zaW4VXZ+JYyeSIaqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684768756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XHUy4g7prE1b7tJYkzPsB8HfeU3l99UNqIeJF8Cll/4=; b=E5m405jpJJhD5RFTnX2zKaa5mfAUZomp5vlPi2ie4Ng/yBODC/WXBoGB7Su466+U7CqUVt 6kIl9Nc9DAhLqSOvN4ym/c94Q98gHR+PmyDL/vNPx/5M0JpwxIvs4tp3JO2IcliqSPDho1 velaAzghnFOvx1Ioyinoh8CR7O3laBFv0S+H5mZzvc8OtYF9xBr6B+HTuP/66NutEUfdw5 te2L/DaKshjuvIkWYhEHEuTwqAduu6hCHnZGR9W7GiuX9kPwqLua/nGDkLeu/3BPHd3xgl 2XYEgVC/f6wjlSE8IA3bEppZfrD8g67i928lFhzKK4pk77pKOohwRNdE0m2vxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684768756; a=rsa-sha256; cv=none; b=PlQyK+NuoBM6gVMj/CRsyLa4WH5UHFeUrNdJ0So4VOUmVVG8Wg5ZXFuIXiQOTht1yJIgrc av+QmODpDePsfIae8e9XzQ0xpH8t/JRWPOOSL7KwTPMg15DwysCdJ4R4MsTx00h3WU2w75 oen6OhWPKHOy0UtLO4s4C8a7RmTLknQHJVYz1YOBsJbHn7BLgnBk/JHc03nktKqGDNbnR4 RaBQIVwJfYXzP07cdc4+zu009VmrSX39m0nf4YpaCZq2FQZcrjarhh2B1P4t0k7MJcmV3/ FFixRbwoCR47O03v6u2UwIcbrdwKGM5yD+a7k+PyK4Y3jDdBFmyoKz7TWraiZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQ1M80sFlzMMX; Mon, 22 May 2023 15:19:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34MFJGIh025335; Mon, 22 May 2023 15:19:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34MFJGvV025334; Mon, 22 May 2023 15:19:16 GMT (envelope-from git) Date: Mon, 22 May 2023 15:19:16 GMT Message-Id: <202305221519.34MFJGvV025334@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 26056fa8d348 - main - Revert "ifconfig: switch IPv4/IPv6 address manipulations to Netlink" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 26056fa8d348b8ec03b4b2d0c9d086c4232f2711 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=26056fa8d348b8ec03b4b2d0c9d086c4232f2711 commit 26056fa8d348b8ec03b4b2d0c9d086c4232f2711 Author: Alexander V. Chernikov AuthorDate: 2023-05-22 15:17:57 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-05-22 15:17:57 +0000 Revert "ifconfig: switch IPv4/IPv6 address manipulations to Netlink" Revert the change as 2 non-expected issues have been reported. This reverts commit 54418f79fd292e14abf121f87a3c790a17447971. --- sbin/ifconfig/af_inet.c | 184 ++------------------------------------- sbin/ifconfig/af_inet6.c | 152 +------------------------------- sbin/ifconfig/af_link.c | 3 - sbin/ifconfig/ifconfig.c | 102 ++++++---------------- sbin/ifconfig/ifconfig.h | 22 ++--- sbin/ifconfig/ifconfig_netlink.c | 46 +--------- 6 files changed, 45 insertions(+), 464 deletions(-) diff --git a/sbin/ifconfig/af_inet.c b/sbin/ifconfig/af_inet.c index ab2b01320d04..cb030dbc711b 100644 --- a/sbin/ifconfig/af_inet.c +++ b/sbin/ifconfig/af_inet.c @@ -55,26 +55,8 @@ static const char rcsid[] = #include "ifconfig.h" #include "ifconfig_netlink.h" -#ifdef WITHOUT_NETLINK static struct in_aliasreq in_addreq; static struct ifreq in_ridreq; -#else -struct in_px { - struct in_addr addr; - int plen; - bool addrset; - bool maskset; -}; -struct in_pdata { - struct in_px addr; - struct in_px dst_addr; - struct in_px brd_addr; - uint32_t flags; - uint32_t vhid; -}; -static struct in_pdata in_add, in_del; -#endif - static char addr_buf[NI_MAXHOST]; /*for getnameinfo()*/ extern char *f_inet, *f_addr; @@ -200,8 +182,6 @@ in_status_nl(struct ifconfig_args *args __unused, struct io_handler *h, } #endif - -#ifdef WITHOUT_NETLINK #define SIN(x) ((struct sockaddr_in *) &(x)) static struct sockaddr_in *sintab[] = { SIN(in_ridreq.ifr_addr), SIN(in_addreq.ifra_addr), @@ -253,156 +233,14 @@ in_getaddr(const char *s, int which) errx(1, "%s: bad value", s); } -#else - -static struct in_px *sintab_nl[] = { - &in_del.addr, /* RIDADDR */ - &in_add.addr, /* ADDR */ - NULL, /* MASK */ - &in_add.dst_addr, /* DSTADDR*/ - &in_add.brd_addr, /* BRDADDR*/ -}; - -static void -in_getip(const char *addr_str, struct in_addr *ip) -{ - struct hostent *hp; - struct netent *np; - - if (inet_aton(addr_str, ip)) - return; - if ((hp = gethostbyname(addr_str)) != NULL) - bcopy(hp->h_addr, (char *)ip, - MIN((size_t)hp->h_length, sizeof(ip))); - else if ((np = getnetbyname(addr_str)) != NULL) - *ip = inet_makeaddr(np->n_net, INADDR_ANY); - else - errx(1, "%s: bad value", addr_str); -} - -static void -in_getaddr(const char *s, int which) -{ - struct in_px *px = sintab_nl[which]; - - if (which == MASK) { - struct in_px *px_addr = sintab_nl[ADDR]; - struct in_addr mask = {}; - - in_getip(s, &mask); - px_addr->plen = __bitcount32(mask.s_addr); - px_addr->maskset = true; - return; - } - - if (which == ADDR) { - char *p = NULL; - - if((p = strrchr(s, '/')) != NULL) { - const char *errstr; - /* address is `name/masklen' */ - int masklen; - *p = '\0'; - if (!isdigit(*(p + 1))) - errstr = "invalid"; - else - masklen = (int)strtonum(p + 1, 0, 32, &errstr); - if (errstr != NULL) { - *p = '/'; - errx(1, "%s: bad value (width %s)", s, errstr); - } - px->plen = masklen; - px->maskset = true; - } - } - - in_getip(s, &px->addr); - px->addrset = true; -} - - -static int -in_exec_nl(struct io_handler *h, int action, void *data) -{ - struct in_pdata *pdata = (struct in_pdata *)data; - struct snl_writer nw = {}; - - snl_init_writer(h->ss, &nw); - struct nlmsghdr *hdr = snl_create_msg_request(&nw, action); - struct ifaddrmsg *ifahdr = snl_reserve_msg_object(&nw, struct ifaddrmsg); - - ifahdr->ifa_family = AF_INET; - ifahdr->ifa_prefixlen = pdata->addr.plen; - ifahdr->ifa_index = if_nametoindex_nl(h->ss, name); - - snl_add_msg_attr_ip4(&nw, IFA_LOCAL, &pdata->addr.addr); - if (action == NL_RTM_NEWADDR && pdata->dst_addr.addrset) - snl_add_msg_attr_ip4(&nw, IFA_ADDRESS, &pdata->dst_addr.addr); - if (action == NL_RTM_NEWADDR && pdata->brd_addr.addrset) - snl_add_msg_attr_ip4(&nw, IFA_BROADCAST, &pdata->brd_addr.addr); - - int off = snl_add_msg_attr_nested(&nw, IFA_FREEBSD); - snl_add_msg_attr_u32(&nw, IFAF_FLAGS, pdata->flags); - if (pdata->vhid != 0) - snl_add_msg_attr_u32(&nw, IFAF_VHID, pdata->vhid); - snl_end_attr_nested(&nw, off); - - if (!snl_finalize_msg(&nw) || !snl_send_message(h->ss, hdr)) - return (0); - - struct snl_errmsg_data e = {}; - snl_read_reply_code(h->ss, hdr->nlmsg_seq, &e); - if (e.error_str != NULL) - warnx("%s(): %s", __func__, e.error_str); - - return (e.error); -} - -static void -in_setdefaultmask_nl(void) -{ - struct in_px *px = sintab_nl[ADDR]; - - in_addr_t i = ntohl(px->addr.s_addr); - - /* - * If netmask isn't supplied, use historical default. - * This is deprecated for interfaces other than loopback - * or point-to-point; warn in other cases. In the future - * we should return an error rather than warning. - */ - if (IN_CLASSA(i)) - px->plen = IN_CLASSA_NSHIFT; - else if (IN_CLASSB(i)) - px->plen = IN_CLASSB_NSHIFT; - else - px->plen = IN_CLASSC_NSHIFT; - px->maskset = true; -} -#endif - -static void -warn_nomask(ifflags) -{ - if ((ifflags & (IFF_POINTOPOINT | IFF_LOOPBACK)) == 0) { - warnx("WARNING: setting interface address without mask " - "is deprecated,\ndefault mask may not be correct."); - } -} - static void in_postproc(int s, const struct afswtch *afp, int newaddr, int ifflags) { -#ifdef WITHOUT_NETLINK - if (sintab[ADDR]->sin_len != 0 && sintab[MASK]->sin_len == 0 && newaddr) { - warn_nomask(ifflags); - } -#else - if (sintab_nl[ADDR]->addrset && !sintab_nl[ADDR]->maskset && newaddr) { - warn_nomask(ifflags); - in_setdefaultmask_nl(); + if (sintab[ADDR]->sin_len != 0 && sintab[MASK]->sin_len == 0 && + newaddr && (ifflags & (IFF_POINTOPOINT | IFF_LOOPBACK)) == 0) { + warnx("WARNING: setting interface address without mask " + "is deprecated,\ndefault mask may not be correct."); } -#endif } static void @@ -450,13 +288,10 @@ in_set_tunnel(int s, struct addrinfo *srcres, struct addrinfo *dstres) static void in_set_vhid(int vhid) { -#ifdef WITHOUT_NETLINK in_addreq.ifra_vhid = vhid; -#else - in_add.vhid = (uint32_t)vhid; -#endif } + static struct afswtch af_inet = { .af_name = "inet", .af_af = AF_INET, @@ -470,19 +305,10 @@ static struct afswtch af_inet = { .af_status_tunnel = in_status_tunnel, .af_settunnel = in_set_tunnel, .af_setvhid = in_set_vhid, -#ifdef WITHOUT_NETLINK .af_difaddr = SIOCDIFADDR, .af_aifaddr = SIOCAIFADDR, .af_ridreq = &in_ridreq, .af_addreq = &in_addreq, - .af_exec = af_exec_ioctl, -#else - .af_difaddr = NL_RTM_DELADDR, - .af_aifaddr = NL_RTM_NEWADDR, - .af_ridreq = &in_del, - .af_addreq = &in_add, - .af_exec = in_exec_nl, -#endif }; static __constructor void diff --git a/sbin/ifconfig/af_inet6.c b/sbin/ifconfig/af_inet6.c index c932087b4d86..1bb08c8a6a5a 100644 --- a/sbin/ifconfig/af_inet6.c +++ b/sbin/ifconfig/af_inet6.c @@ -59,30 +59,10 @@ static const char rcsid[] = #include "ifconfig.h" #include "ifconfig_netlink.h" -#ifndef WITHOUT_NETLINK -struct in6_px { - struct in6_addr addr; - int plen; - bool set; -}; -struct in6_pdata { - struct in6_px addr; - struct in6_px dst_addr; - struct in6_addrlifetime lifetime; - uint32_t flags; - uint32_t vhid; -}; - -static struct in6_pdata in6_del; -static struct in6_pdata in6_add = { - .lifetime = { 0, 0, ND6_INFINITE_LIFETIME, ND6_INFINITE_LIFETIME }, -}; -#else static struct in6_ifreq in6_ridreq; static struct in6_aliasreq in6_addreq = { .ifra_flags = 0, .ifra_lifetime = { 0, 0, ND6_INFINITE_LIFETIME, ND6_INFINITE_LIFETIME } }; -#endif static int ip6lifetime; static int prefix(void *, int); @@ -100,16 +80,8 @@ static void setifprefixlen(const char *addr, int dummy __unused, int s, const struct afswtch *afp) { -#ifdef WITHOUT_NETLINK if (afp->af_getprefix != NULL) afp->af_getprefix(addr, MASK); -#else - int plen = strtol(addr, NULL, 10); - - if ((plen < 0) || (plen > 128)) - errx(1, "%s: bad value", addr); - in6_add.addr.plen = plen; -#endif explicit_prefix = 1; } @@ -120,17 +92,10 @@ setip6flags(const char *dummyaddr __unused, int flag, int dummysoc __unused, if (afp->af_af != AF_INET6) err(1, "address flags can be set only for inet6 addresses"); -#ifdef WITHOUT_NETLINK if (flag < 0) in6_addreq.ifra_flags &= ~(-flag); else in6_addreq.ifra_flags |= flag; -#else - if (flag < 0) - in6_add.flags &= ~(-flag); - else - in6_add.flags |= flag; -#endif } static void @@ -140,11 +105,6 @@ setip6lifetime(const char *cmd, const char *val, int s, struct timespec now; time_t newval; char *ep; -#ifdef WITHOUT_NETLINK - struct in6_addrlifetime *lifetime = &in6_addreq.ifra_lifetime; -#else - struct in6_addrlifetime *lifetime = &in6_add.lifetime; -#endif clock_gettime(CLOCK_MONOTONIC_FAST, &now); newval = (time_t)strtoul(val, &ep, 0); @@ -153,11 +113,11 @@ setip6lifetime(const char *cmd, const char *val, int s, if (afp->af_af != AF_INET6) errx(1, "%s not allowed for the AF", cmd); if (strcmp(cmd, "vltime") == 0) { - lifetime->ia6t_expire = now.tv_sec + newval; - lifetime->ia6t_vltime = newval; + in6_addreq.ifra_lifetime.ia6t_expire = now.tv_sec + newval; + in6_addreq.ifra_lifetime.ia6t_vltime = newval; } else if (strcmp(cmd, "pltime") == 0) { - lifetime->ia6t_preferred = now.tv_sec + newval; - lifetime->ia6t_pltime = newval; + in6_addreq.ifra_lifetime.ia6t_preferred = now.tv_sec + newval; + in6_addreq.ifra_lifetime.ia6t_pltime = newval; } } @@ -186,11 +146,7 @@ setip6eui64(const char *cmd, int dummy __unused, int s, if (afp->af_af != AF_INET6) errx(EXIT_FAILURE, "%s not allowed for the AF", cmd); -#ifdef WITHOUT_NETLINK in6 = (struct in6_addr *)&in6_addreq.ifra_addr.sin6_addr; -#else - in6 = &in6_add.addr.addr; -#endif if (memcmp(&in6addr_any.s6_addr[8], &in6->s6_addr[8], 8) != 0) errx(EXIT_FAILURE, "interface index is already filled"); if (getifaddrs(&ifap) != 0) @@ -418,92 +374,8 @@ in6_status_nl(struct ifconfig_args *args __unused, struct io_handler *h, putchar('\n'); } - -static struct in6_px *sin6tab_nl[] = { - &in6_del.addr, /* RIDADDR */ - &in6_add.addr, /* ADDR */ - NULL, /* MASK */ - &in6_add.dst_addr, /* DSTADDR*/ -}; - -static void -in6_getaddr(const char *addr_str, int which) -{ - struct in6_px *px = sin6tab_nl[which]; - - newaddr &= 1; - - px->set = true; - px->plen = 128; - if (which == ADDR) { - char *p = NULL; - if((p = strrchr(addr_str, '/')) != NULL) { - *p = '\0'; - int plen = strtol(p + 1, NULL, 10); - if (plen < 0 || plen > 128) - errx(1, "%s: bad value", p + 1); - px->plen = plen; - explicit_prefix = 1; - } - } - - struct addrinfo hints = { .ai_family = AF_INET6 }; - struct addrinfo *res; - - int error = getaddrinfo(addr_str, NULL, &hints, &res); - if (error != 0) { - if (inet_pton(AF_INET6, addr_str, &px->addr) != 1) - errx(1, "%s: bad value", addr_str); - } else { - struct sockaddr_in6 *sin6; - - sin6 = (struct sockaddr_in6 *)(void *)res->ai_addr; - px->addr = sin6->sin6_addr; - freeaddrinfo(res); - } -} - -static int -in6_exec_nl(struct io_handler *h, int action, void *data) -{ - struct in6_pdata *pdata = (struct in6_pdata *)data; - struct snl_writer nw = {}; - - snl_init_writer(h->ss, &nw); - struct nlmsghdr *hdr = snl_create_msg_request(&nw, action); - struct ifaddrmsg *ifahdr = snl_reserve_msg_object(&nw, struct ifaddrmsg); - - ifahdr->ifa_family = AF_INET6; - ifahdr->ifa_prefixlen = pdata->addr.plen; - ifahdr->ifa_index = if_nametoindex_nl(h->ss, name); - - snl_add_msg_attr_ip6(&nw, IFA_LOCAL, &pdata->addr.addr); - if (action == NL_RTM_NEWADDR && pdata->dst_addr.set) - snl_add_msg_attr_ip6(&nw, IFA_ADDRESS, &pdata->dst_addr.addr); - - struct ifa_cacheinfo ci = { - .ifa_prefered = pdata->lifetime.ia6t_pltime, - .ifa_valid = pdata->lifetime.ia6t_vltime, - }; - snl_add_msg_attr(&nw, IFA_CACHEINFO, sizeof(ci), &ci); - - int off = snl_add_msg_attr_nested(&nw, IFA_FREEBSD); - snl_add_msg_attr_u32(&nw, IFAF_FLAGS, pdata->flags); - if (pdata->vhid != 0) - snl_add_msg_attr_u32(&nw, IFAF_VHID, pdata->vhid); - snl_end_attr_nested(&nw, off); - - if (!snl_finalize_msg(&nw) || !snl_send_message(h->ss, hdr)) - return (0); - - struct snl_errmsg_data e = {}; - snl_read_reply_code(h->ss, hdr->nlmsg_seq, &e); - - return (e.error); -} #endif -#ifdef WITHOUT_NETLINK #define SIN6(x) ((struct sockaddr_in6 *) &(x)) static struct sockaddr_in6 *sin6tab[] = { SIN6(in6_ridreq.ifr_addr), SIN6(in6_addreq.ifra_addr), @@ -591,7 +463,6 @@ prefix(void *val, int size) return(0); return (plen); } -#endif static char * sec2str(time_t total) @@ -687,11 +558,7 @@ in6_set_tunnel(int s, struct addrinfo *srcres, struct addrinfo *dstres) static void in6_set_vhid(int vhid) { -#ifdef WITHOUT_NETLINK in6_addreq.ifra_vhid = vhid; -#else - in6_add.vhid = (uint32_t)vhid; -#endif } static struct cmd inet6_cmds[] = { @@ -739,27 +606,16 @@ static struct afswtch af_inet6 = { .af_status_nl = in6_status_nl, #endif .af_getaddr = in6_getaddr, -#ifdef WITHOUT_NETLINK .af_getprefix = in6_getprefix, -#endif .af_other_status = nd6_status, .af_postproc = in6_postproc, .af_status_tunnel = in6_status_tunnel, .af_settunnel = in6_set_tunnel, .af_setvhid = in6_set_vhid, -#ifdef WITHOUT_NETLINK .af_difaddr = SIOCDIFADDR_IN6, .af_aifaddr = SIOCAIFADDR_IN6, .af_ridreq = &in6_addreq, .af_addreq = &in6_addreq, - .af_exec = af_exec_ioctl, -#else - .af_difaddr = NL_RTM_DELADDR, - .af_aifaddr = NL_RTM_NEWADDR, - .af_ridreq = &in6_add, - .af_addreq = &in6_add, - .af_exec = in6_exec_nl, -#endif }; static void diff --git a/sbin/ifconfig/af_link.c b/sbin/ifconfig/af_link.c index 0d1f5b1f6147..52295453b4f0 100644 --- a/sbin/ifconfig/af_link.c +++ b/sbin/ifconfig/af_link.c @@ -229,7 +229,6 @@ static struct afswtch af_link = { .af_getaddr = link_getaddr, .af_aifaddr = SIOCSIFLLADDR, .af_addreq = &link_ridreq, - .af_exec = af_exec_ioctl, }; static struct afswtch af_ether = { .af_name = "ether", @@ -242,7 +241,6 @@ static struct afswtch af_ether = { .af_getaddr = link_getaddr, .af_aifaddr = SIOCSIFLLADDR, .af_addreq = &link_ridreq, - .af_exec = af_exec_ioctl, }; static struct afswtch af_lladdr = { .af_name = "lladdr", @@ -255,7 +253,6 @@ static struct afswtch af_lladdr = { .af_getaddr = link_getaddr, .af_aifaddr = SIOCSIFLLADDR, .af_addreq = &link_ridreq, - .af_exec = af_exec_ioctl, }; static __constructor void diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 3b63eac5574a..c5e7b7befc72 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -112,7 +112,6 @@ static void list_interfaces_ioctl(struct ifconfig_args *args); static void status(struct ifconfig_args *args, const struct sockaddr_dl *sdl, struct ifaddrs *ifa); static _Noreturn void usage(void); -static void Perrorc(const char *cmd, int error); static int getifflags(const char *ifname, int us, bool err_ok); @@ -542,30 +541,6 @@ args_parse(struct ifconfig_args *args, int argc, char *argv[]) verbose = args->verbose; } -static int -ifconfig_wrapper(struct ifconfig_args *args, int iscreate, - const struct afswtch *uafp) -{ -#ifdef WITHOUT_NETLINK - struct io_handler h = {}; - return (ifconfig(args, &h, iscreate, uafp)); -#else - return (ifconfig_wrapper_nl(args, iscreate, uafp)); -#endif -} - -static bool -isargcreate(const char *arg) -{ - if (arg == NULL) - return (false); - - if (strcmp(arg, "create") == 0 || strcmp(arg, "plumb") == 0) - return (true); - - return (false); -} - int main(int ac, char *av[]) { @@ -605,12 +580,13 @@ main(int ac, char *av[]) * right here as we would otherwise fail when trying * to find the interface. */ - if (isargcreate(arg)) { + if (arg != NULL && (strcmp(arg, "create") == 0 || + strcmp(arg, "plumb") == 0)) { iflen = strlcpy(name, args.ifname, sizeof(name)); if (iflen >= sizeof(name)) errx(1, "%s: cloning name too long", args.ifname); - ifconfig_wrapper(&args, 1, NULL); + ifconfig(args.argc, args.argv, 1, NULL); exit(exit_code); } #ifdef JAIL @@ -624,7 +600,7 @@ main(int ac, char *av[]) if (iflen >= sizeof(name)) errx(1, "%s: interface name too long", args.ifname); - ifconfig_wrapper(&args, 0, NULL); + ifconfig(args.argc, args.argv, 0, NULL); exit(exit_code); } #endif @@ -634,7 +610,8 @@ main(int ac, char *av[]) * Do not allow use `create` command as hostname if * address family is not specified. */ - if (isargcreate(arg)) { + if (arg != NULL && (strcmp(arg, "create") == 0 || + strcmp(arg, "plumb") == 0)) { if (args.argc == 1) errx(1, "interface %s already exists", args.ifname); @@ -664,7 +641,7 @@ main(int ac, char *av[]) if (!(((flags & IFF_CANTCONFIG) != 0) || (args.downonly && (flags & IFF_UP) != 0) || (args.uponly && (flags & IFF_UP) == 0))) - ifconfig_wrapper(&args, 0, args.afp); + ifconfig(args.argc, args.argv, 0, args.afp); } goto done; } @@ -792,7 +769,7 @@ list_interfaces_ioctl(struct ifconfig_args *args) ifindex++; if (args->argc > 0) - ifconfig_wrapper(args, 0, args->afp); + ifconfig(args->argc, args->argv, 0, args->afp); else status(args, sdl, ifa); } @@ -991,42 +968,31 @@ static void setifdstaddr(const char *, int, int, const struct afswtch *); static const struct cmd setifdstaddr_cmd = DEF_CMD("ifdstaddr", 0, setifdstaddr); -int -af_exec_ioctl(struct io_handler *h, int action, void *data) -{ - struct ifreq *req = (struct ifreq *)data; - - strlcpy(req->ifr_name, name, sizeof(req->ifr_name)); - if (ioctl(h->s, action, req) == 0) - return (0); - return (errno); -} - static void -delifaddr(struct io_handler *h, const struct afswtch *afp) +delifaddr(int s, const struct afswtch *afp) { - int error; - - if (afp->af_exec == NULL) { + if (afp->af_ridreq == NULL || afp->af_difaddr == 0) { warnx("interface %s cannot change %s addresses!", name, afp->af_name); clearaddr = 0; return; } - afp->af_exec(h, afp->af_difaddr, afp->af_ridreq); - if (error != 0) { - if (error == EADDRNOTAVAIL && (doalias >= 0)) { + strlcpy(((struct ifreq *)afp->af_ridreq)->ifr_name, name, + sizeof ifr.ifr_name); + int ret = ioctl(s, afp->af_difaddr, afp->af_ridreq); + if (ret < 0) { + if (errno == EADDRNOTAVAIL && (doalias >= 0)) { /* means no previous address for interface */ } else - Perrorc("ioctl (SIOCDIFADDR)", error); + Perror("ioctl (SIOCDIFADDR)"); } } static void -addifaddr(struct io_handler *h, const struct afswtch *afp) +addifaddr(int s, const struct afswtch *afp) { - if (afp->af_exec == NULL) { + if (afp->af_addreq == NULL || afp->af_aifaddr == 0) { warnx("interface %s cannot change %s addresses!", name, afp->af_name); newaddr = 0; @@ -1034,24 +1000,21 @@ addifaddr(struct io_handler *h, const struct afswtch *afp) } if (setaddr || setmask) { - int error = afp->af_exec(h, afp->af_aifaddr, afp->af_addreq); - if (error != 0) - Perrorc("ioctl (SIOCAIFADDR)", error); + strlcpy(((struct ifreq *)afp->af_addreq)->ifr_name, name, + sizeof ifr.ifr_name); + if (ioctl(s, afp->af_aifaddr, afp->af_addreq) < 0) + Perror("ioctl (SIOCAIFADDR)"); } } int -ifconfig(struct ifconfig_args *args, struct io_handler *h, int iscreate, - const struct afswtch *uafp) +ifconfig(int argc, char *const *argv, int iscreate, const struct afswtch *uafp) { const struct afswtch *afp, *nafp; const struct cmd *p; struct callback *cb; int s; - int argc = args->argc; - char *const *argv = args->argv; - strlcpy(ifr.ifr_name, name, sizeof ifr.ifr_name); afp = NULL; if (uafp != NULL) @@ -1164,11 +1127,10 @@ top: /* * Do deferred operations. */ - h->s = s; if (clearaddr) - delifaddr(h, afp); + delifaddr(s, afp); if (newaddr) - addifaddr(h, afp); + addifaddr(s, afp); close(s); return(0); @@ -1275,7 +1237,7 @@ setifbroadaddr(const char *addr, int dummy __unused, int s, const struct afswtch *afp) { if (afp->af_getaddr != NULL) - afp->af_getaddr(addr, BRDADDR); + afp->af_getaddr(addr, DSTADDR); } static void @@ -1751,8 +1713,8 @@ tunnel_status(int s) af_all_tunnel_status(s); } -static void -Perrorc(const char *cmd, int error) +void +Perror(const char *cmd) { switch (errno) { @@ -1765,16 +1727,10 @@ Perrorc(const char *cmd, int error) break; default: - errc(1, error, "%s", cmd); + err(1, "%s", cmd); } } -void -Perror(const char *cmd) -{ - Perrorc(cmd, errno); -} - /* * Print a value a la the %b format of the kernel's printf */ diff --git a/sbin/ifconfig/ifconfig.h b/sbin/ifconfig/ifconfig.h index 9d37a6e75eba..7b2b88a4dfac 100644 --- a/sbin/ifconfig/ifconfig.h +++ b/sbin/ifconfig/ifconfig.h @@ -144,15 +144,10 @@ struct ifaddrs; struct addrinfo; enum { - RIDADDR = 0, - ADDR = 1, - MASK = 2, - DSTADDR = 3, -#ifdef WITHOUT_NETLINK - BRDADDR = 3, -#else - BRDADDR = 4, -#endif + RIDADDR, + ADDR, + MASK, + DSTADDR, }; struct snl_state; @@ -169,7 +164,6 @@ struct io_handler { typedef void af_setvhid_f(int vhid); typedef void af_status_nl_f(struct ifconfig_args *args, struct io_handler *h, if_link_t *link, if_addr_t *ifa); -typedef int af_exec_f(struct io_handler *h, int action, void *data); struct afswtch { const char *af_name; /* as given on cmd line, e.g. "inet" */ @@ -196,7 +190,6 @@ struct afswtch { void (*af_postproc)(int s, const struct afswtch *, int newaddr, int ifflags); af_setvhid_f *af_setvhid; /* Set CARP vhid for an address */ - af_exec_f *af_exec; /* Handler to interact with kernel */ u_long af_difaddr; /* set dst if address ioctl */ u_long af_aifaddr; /* set if address ioctl */ void *af_ridreq; /* */ @@ -209,7 +202,6 @@ struct afswtch { struct addrinfo *dstres); }; void af_register(struct afswtch *); -int af_exec_ioctl(struct io_handler *h, int action, void *data); struct ifconfig_args { bool all; /* Match everything */ @@ -267,8 +259,7 @@ void sfp_status(int s, struct ifreq *ifr, int verbose); struct sockaddr_dl; bool match_ether(const struct sockaddr_dl *sdl); bool match_if_flags(struct ifconfig_args *args, int if_flags); -int ifconfig(struct ifconfig_args *args, struct io_handler *h, - int iscreate, const struct afswtch *uafp); +int ifconfig(int argc, char *const *argv, int iscreate, const struct afswtch *uafp); bool group_member(const char *ifname, const char *match, const char *nomatch); void print_ifcap(struct ifconfig_args *args, int s); void tunnel_status(int s); @@ -279,9 +270,6 @@ void print_metric(int s); /* Netlink-related functions */ void list_interfaces_nl(struct ifconfig_args *args); -int ifconfig_wrapper_nl(struct ifconfig_args *args, int iscreate, - const struct afswtch *uafp); -uint32_t if_nametoindex_nl(struct snl_state *ss, const char *ifname); /* * XXX expose this so modules that neeed to know of any pending diff --git a/sbin/ifconfig/ifconfig_netlink.c b/sbin/ifconfig/ifconfig_netlink.c index 598444d0d029..26a42b5866c5 100644 --- a/sbin/ifconfig/ifconfig_netlink.c +++ b/sbin/ifconfig/ifconfig_netlink.c @@ -122,22 +122,6 @@ nl_init_socket(struct snl_state *ss) err(1, "unable to open netlink socket"); } -int -ifconfig_wrapper_nl(struct ifconfig_args *args, int iscreate, - const struct afswtch *uafp) -{ - struct snl_state ss = {}; - struct io_handler h = { .ss = &ss }; - - nl_init_socket(&ss); - - int error = ifconfig(args, &h, iscreate, uafp); - - snl_free(&ss); - - return (error); -} - struct ifa { struct ifa *next; uint32_t count; @@ -202,29 +186,6 @@ prepare_ifmap(struct snl_state *ss) return (ifmap); } -uint32_t -if_nametoindex_nl(struct snl_state *ss, const char *ifname) -{ - struct snl_writer nw = {}; - struct snl_parsed_link_simple link = {}; - - snl_init_writer(ss, &nw); - struct nlmsghdr *hdr = snl_create_msg_request(&nw, RTM_GETLINK); - snl_reserve_msg_object(&nw, struct ifinfomsg); - snl_add_msg_attr_string(&nw, IFLA_IFNAME, ifname); - - if (!snl_finalize_msg(&nw) || !snl_send_message(ss, hdr)) - return (0); - - hdr = snl_read_reply(ss, hdr->nlmsg_seq); - if (hdr->nlmsg_type != NL_RTM_NEWLINK) - return (0); - if (!snl_parse_nlmsg(ss, hdr, &snl_rtm_link_parser_simple, &link)) - return (0); - - return (link.ifi_index); -} - static void prepare_ifaddrs(struct snl_state *ss, struct ifmap *ifmap) { @@ -454,11 +415,8 @@ list_interfaces_nl(struct ifconfig_args *args) fputs(iface->link.ifla_ifname, stdout); } else if (args->argc == 0) status_nl(args, &h, iface); - else { - struct io_handler hh = { .s = -1, .ss = &ss }; - - ifconfig(args, &hh, 0, args->afp); - } + else + ifconfig(args->argc, args->argv, 0, args->afp); } if (args->namesonly) printf("\n"); From nobody Mon May 22 15:24:22 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQ1T32HNhz4BZyF; Mon, 22 May 2023 15:24: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 4QQ1T30dlDz3N3j; Mon, 22 May 2023 15:24:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684769063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tixsmHVS9MPqS+zdHlx1eVtf4jrTOi9ShsQMaam746I=; b=DkdaE/lb74MzxV7zknBIZm/Dxc8BcdeGqeZbW8H30g1HmbcemVRkQTWAlX8zCh4jh2OchM BE5vTczZwVzpStiVEJ3tMVPp0sU1UYLWDpOcXgXcZygMiXkvn3qeMZ1upb38B0XfFEn6tL Q9lVvEfokiLKV0ih2KZF0wPxmKCxqJCRr0E5gFvERppmoIMiB75W06TqkorODkiGRydBp3 hKLkP/m9oXuV193fpD83u57roHqB24DowToM7qQ8dV3DauTc7vwp+Yz98EEH2PM0yZYSUo FCVoaylzwH8bSGQqss8xpAE5r3D3tDEuMrs+rZbK1SZWliQ7GAT4P2mUUogs0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684769063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tixsmHVS9MPqS+zdHlx1eVtf4jrTOi9ShsQMaam746I=; b=iumnoXDtTDHaEEr7D6OKj47jObAU5+d6x/5eNx/xIzOwc4w6gsIQdMOZDj7tbP/P22J3nm UEAef0H6EakTAKp0KDyiFUObt8c1kNBm4LrDuOse4Gkpi/pH/0X0wTonNeHv2mO4MJfPLy QkzeOoTjZ1YlNphyPev4XQUZBwT2vVTpI4q6PMxZdJUnZ4Aj4/d+ic58q8BcyIElJX1LIr 2QZ3agE6wXwE/ATfSi7ZqMYSYt7VK1JcczuIhE5LFsDtIbt1gkZH5rme017skIuUdS7O3z EOz/r27+ApNmjq6qwyz2bi9+a3pXVtYEAuRCGin6GDmIMV8qQu3zLR9x15M6vg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684769063; a=rsa-sha256; cv=none; b=XzMja2OIUFMvvDp2FY3YCXuFBIM6PoTzOoDuWaxa97p6oar/YWy11tLtvhuktWil0GswfN Ifbcmxnsivv6LJeN3n2CzjKwxlpbR/ZfWk/N060IeTs2zuSZijspsZJrj/DYB1rbmiS1+J knuv27hIsyZ4xB+h5JlJ5X5MQqRosr3qzUax1pgS5LWBeAwQh9qxybWFrgTQWDxajOFKtb Kqg/LuXH5DfFhQppoxHB6UTvQVxCWs1esqstcJmH3oGmFK7tvsaXmO1uG8rKW/nWlB0CIa 0iCss6mZTXdFzOfV6GYPArAPqlScUuhbs+p552IqVmUF2ahADfsokYfAlAKlbA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQ1T26pB7zNSJ; Mon, 22 May 2023 15:24: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 34MFOM46041314; Mon, 22 May 2023 15:24:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34MFOMNi041313; Mon, 22 May 2023 15:24:22 GMT (envelope-from git) Date: Mon, 22 May 2023 15:24:22 GMT Message-Id: <202305221524.34MFOMNi041313@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 172af24449cd - main - arm64: gicv3: setup PPIs on all APs after they're online List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 172af24449cd8d34339172d125832b7ecd274213 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=172af24449cd8d34339172d125832b7ecd274213 commit 172af24449cd8d34339172d125832b7ecd274213 Author: Kyle Evans AuthorDate: 2023-05-15 17:21:45 +0000 Commit: Kyle Evans CommitDate: 2023-05-22 15:23:53 +0000 arm64: gicv3: setup PPIs on all APs after they're online For all PPIs setup earlier than SI_SUB_SMP, PIC_INIT_SECONDARY ends up cleaning these up for each AP as it comes online. Once they're online, we don't currently do anything to make sure they're configured for other APs. Fix it by using smp_rendezvous for the meaty bits of configuring a PPI, which will just do single-thread behavior before APs are online but do the right thing for other CPUs after. While we're here, make sure redistributor config is correct for other APs as they come online in gic_v3_init_secondary. Reported/Tested by: Souradeep Chakrabarti (Microsoft/Hyper-V) Reviewed by: andrew (before slight refactor) Differential Revision: https://reviews.freebsd.org/D40112 --- sys/arm64/arm64/gic_v3.c | 157 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 109 insertions(+), 48 deletions(-) diff --git a/sys/arm64/arm64/gic_v3.c b/sys/arm64/arm64/gic_v3.c index dfa0f6c7cad1..e9754797d095 100644 --- a/sys/arm64/arm64/gic_v3.c +++ b/sys/arm64/arm64/gic_v3.c @@ -835,15 +835,66 @@ gic_v3_map_intr(device_t dev, struct intr_map_data *data, return (error); } +struct gic_v3_setup_periph_args { + device_t dev; + struct intr_irqsrc *isrc; +}; + +static void +gic_v3_setup_intr_periph(void *argp) +{ + struct gic_v3_setup_periph_args *args = argp; + struct intr_irqsrc *isrc = args->isrc; + struct gic_v3_irqsrc *gi = (struct gic_v3_irqsrc *)isrc; + device_t dev = args->dev; + u_int irq = gi->gi_irq; + struct gic_v3_softc *sc = device_get_softc(dev); + uint32_t reg; + + MPASS(irq <= GIC_LAST_SPI); + + /* + * We need the lock for both SGIs and PPIs for an atomic CPU_SET() at a + * minimum, but we also need it below for SPIs. + */ + mtx_lock_spin(&sc->gic_mtx); + + if (isrc->isrc_flags & INTR_ISRCF_PPI) + CPU_SET(PCPU_GET(cpuid), &isrc->isrc_cpu); + + if (irq >= GIC_FIRST_PPI && irq <= GIC_LAST_SPI) { + /* Set the trigger and polarity */ + if (irq <= GIC_LAST_PPI) + reg = gic_r_read(sc, 4, + GICR_SGI_BASE_SIZE + GICD_ICFGR(irq)); + else + reg = gic_d_read(sc, 4, GICD_ICFGR(irq)); + if (gi->gi_trig == INTR_TRIGGER_LEVEL) + reg &= ~(2 << ((irq % 16) * 2)); + else + reg |= 2 << ((irq % 16) * 2); + + if (irq <= GIC_LAST_PPI) { + gic_r_write(sc, 4, + GICR_SGI_BASE_SIZE + GICD_ICFGR(irq), reg); + gic_v3_wait_for_rwp(sc, REDIST); + } else { + gic_d_write(sc, 4, GICD_ICFGR(irq), reg); + gic_v3_wait_for_rwp(sc, DIST); + } + } + + mtx_unlock_spin(&sc->gic_mtx); +} + static int gic_v3_setup_intr(device_t dev, struct intr_irqsrc *isrc, struct resource *res, struct intr_map_data *data) { - struct gic_v3_softc *sc = device_get_softc(dev); struct gic_v3_irqsrc *gi = (struct gic_v3_irqsrc *)isrc; + struct gic_v3_setup_periph_args pargs; enum intr_trigger trig; enum intr_polarity pol; - uint32_t reg; u_int irq; int error; @@ -872,41 +923,18 @@ gic_v3_setup_intr(device_t dev, struct intr_irqsrc *isrc, gi->gi_trig = trig; } - /* - * XXX - In case that per CPU interrupt is going to be enabled in time - * when SMP is already started, we need some IPI call which - * enables it on others CPUs. Further, it's more complicated as - * pic_enable_source() and pic_disable_source() should act on - * per CPU basis only. Thus, it should be solved here somehow. - */ - if (isrc->isrc_flags & INTR_ISRCF_PPI) - CPU_SET(PCPU_GET(cpuid), &isrc->isrc_cpu); - - if (irq >= GIC_FIRST_PPI && irq <= GIC_LAST_SPI) { - mtx_lock_spin(&sc->gic_mtx); - - /* Set the trigger and polarity */ - if (irq <= GIC_LAST_PPI) - reg = gic_r_read(sc, 4, - GICR_SGI_BASE_SIZE + GICD_ICFGR(irq)); - else - reg = gic_d_read(sc, 4, GICD_ICFGR(irq)); - if (trig == INTR_TRIGGER_LEVEL) - reg &= ~(2 << ((irq % 16) * 2)); - else - reg |= 2 << ((irq % 16) * 2); - - if (irq <= GIC_LAST_PPI) { - gic_r_write(sc, 4, - GICR_SGI_BASE_SIZE + GICD_ICFGR(irq), reg); - gic_v3_wait_for_rwp(sc, REDIST); - } else { - gic_d_write(sc, 4, GICD_ICFGR(irq), reg); - gic_v3_wait_for_rwp(sc, DIST); - } - - mtx_unlock_spin(&sc->gic_mtx); + pargs.dev = dev; + pargs.isrc = isrc; + if (isrc->isrc_flags & INTR_ISRCF_PPI) { + /* + * If APs haven't been fired up yet, smp_rendezvous() will just + * execute it on the single CPU and gic_v3_init_secondary() will + * clean up afterwards. + */ + smp_rendezvous(NULL, gic_v3_setup_intr_periph, NULL, &pargs); + } else if (irq >= GIC_FIRST_SPI && irq <= GIC_LAST_SPI) { + gic_v3_setup_intr_periph(&pargs); gic_v3_bind_intr(dev, isrc); } @@ -951,23 +979,50 @@ gic_v3_disable_intr(device_t dev, struct intr_irqsrc *isrc) panic("%s: Unsupported IRQ %u", __func__, irq); } +static void +gic_v3_enable_intr_periph(void *argp) +{ + struct gic_v3_setup_periph_args *args = argp; + struct gic_v3_irqsrc *gi = (struct gic_v3_irqsrc *)args->isrc; + device_t dev = args->dev; + struct gic_v3_softc *sc = device_get_softc(dev); + u_int irq = gi->gi_irq; + + /* SGIs and PPIs in corresponding Re-Distributor */ + gic_r_write(sc, 4, GICR_SGI_BASE_SIZE + GICD_ISENABLER(irq), + GICD_I_MASK(irq)); + gic_v3_wait_for_rwp(sc, REDIST); +} + static void gic_v3_enable_intr(device_t dev, struct intr_irqsrc *isrc) { + struct gic_v3_setup_periph_args pargs; struct gic_v3_softc *sc; struct gic_v3_irqsrc *gi; u_int irq; - sc = device_get_softc(dev); gi = (struct gic_v3_irqsrc *)isrc; irq = gi->gi_irq; + pargs.isrc = isrc; + pargs.dev = dev; if (irq <= GIC_LAST_PPI) { - /* SGIs and PPIs in corresponding Re-Distributor */ - gic_r_write(sc, 4, GICR_SGI_BASE_SIZE + GICD_ISENABLER(irq), - GICD_I_MASK(irq)); - gic_v3_wait_for_rwp(sc, REDIST); - } else if (irq >= GIC_FIRST_SPI && irq <= GIC_LAST_SPI) { + /* + * SGIs only need configured on the current AP. We'll setup and + * enable IPIs as APs come online. + */ + if (irq <= GIC_LAST_SGI) + gic_v3_enable_intr_periph(&pargs); + else + smp_rendezvous(NULL, gic_v3_enable_intr_periph, NULL, + &pargs); + return; + } + + sc = device_get_softc(dev); + + if (irq >= GIC_FIRST_SPI && irq <= GIC_LAST_SPI) { /* SPIs in distributor */ gic_d_write(sc, 4, GICD_ISENABLER(irq), GICD_I_MASK(irq)); gic_v3_wait_for_rwp(sc, DIST); @@ -1010,8 +1065,6 @@ gic_v3_bind_intr(device_t dev, struct intr_irqsrc *isrc) int cpu; gi = (struct gic_v3_irqsrc *)isrc; - if (gi->gi_irq <= GIC_LAST_PPI) - return (EINVAL); KASSERT(gi->gi_irq >= GIC_FIRST_SPI && gi->gi_irq <= GIC_LAST_SPI, ("%s: Attempting to bind an invalid IRQ", __func__)); @@ -1039,6 +1092,7 @@ gic_v3_bind_intr(device_t dev, struct intr_irqsrc *isrc) static void gic_v3_init_secondary(device_t dev) { + struct gic_v3_setup_periph_args pargs; device_t child; struct gic_v3_softc *sc; gic_v3_initseq_t *init_func; @@ -1060,18 +1114,25 @@ gic_v3_init_secondary(device_t dev) } } + pargs.dev = dev; + /* Unmask attached SGI interrupts. */ for (irq = GIC_FIRST_SGI; irq <= GIC_LAST_SGI; irq++) { isrc = GIC_INTR_ISRC(sc, irq); - if (intr_isrc_init_on_cpu(isrc, cpu)) - gic_v3_enable_intr(dev, isrc); + if (intr_isrc_init_on_cpu(isrc, cpu)) { + pargs.isrc = isrc; + gic_v3_enable_intr_periph(&pargs); + } } /* Unmask attached PPI interrupts. */ for (irq = GIC_FIRST_PPI; irq <= GIC_LAST_PPI; irq++) { isrc = GIC_INTR_ISRC(sc, irq); - if (intr_isrc_init_on_cpu(isrc, cpu)) - gic_v3_enable_intr(dev, isrc); + if (intr_isrc_init_on_cpu(isrc, cpu)) { + pargs.isrc = isrc; + gic_v3_setup_intr_periph(&pargs); + gic_v3_enable_intr_periph(&pargs); + } } for (i = 0; i < sc->gic_nchildren; i++) { From nobody Mon May 22 19:50:08 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQ7Mh5qc6z4CN9v; Mon, 22 May 2023 19:50: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 4QQ7Mh5BClz43dS; Mon, 22 May 2023 19:50:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684785008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p7HLH0m4P3pFB8WvmzYkuUbnmIQdhPYEnlVfT7fjijQ=; b=yoKCyp1JEv7ZGah24PnNIE/uI67fEm7xBoEtdob4psdwn0+mZd3gGlsQ/US70ujz2Jxbf0 mESJ1n/WG8yZqtwREPhYOHWH1Kd+H/8Pf08fBvfpLvFtLQFaRyOuqyx9QCC8oH2WnSrN7q uELyhWvca8WW+r5SnH9+qR+eK4lV+AawPZOq97boZm1KoPpv685JVEBkH7EBbp3vK9ZMig iEmz3R5peOW6B+Qz+YGcAsUiYgYkjHpBNlQujJ2V9gg9LTAnXC//1EGflXyqROq0uPdzs0 +7gHE2eyI0lvc1LmKCKGh+e2BALMGjLVsgU6xFfJXnUPUMA12LdRgomy7Lrz0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684785008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p7HLH0m4P3pFB8WvmzYkuUbnmIQdhPYEnlVfT7fjijQ=; b=xdYksYuB8Jj7AjAOHHVVqccgmH4ENwVkCdIPRRX2YHeRnsK7+TKrTwe6xDDPNe3z6uhjuR P6Bj3uZaiJUrjPiMOldbi+YIw6G6QVYC6tQURbQdhXR/3dGvPgijnCBYVxa+YSOw1y6fXY ejHeOL+MAqECvzsph6iV4a3lEVVUMF7WOKzQm/5p7/6d0yk9oG4NWp8Q5dpi8N19WotgyI cLahNmxfbgtHnaBeXTtQen642M8SHmkEwvSvM5nHnekE9Fqx9l7RPaWcSFLVFmugRB8qq9 0V3NEeg7r4rFwFaCJnWzu2+mOAT1ZoaeltiZo1BNgAocgHdJbG20BHa1x0j7MA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684785008; a=rsa-sha256; cv=none; b=AtnTBn01qSjals6j8ii/6A/K+2GDimBWP3Nj3YcFl5NK3QIGwmoqm/5vthRun6I96xIXSm nMNGqY6H35HRAC8lcgwCBKsLGlGnSR1gR0MrsLlvRiyBV1lrMN+yWjJgZ7a9jpGdw90oiP Er6NrfMRtqX6CU9LMObLP32c65nBuYdu/RndK7t7CLM0bK5gHkXvhmNtAUyT1tw1c/q+20 Zocd61602xBHPTm75xixaGQwb97gh6ejWAzmvHeiV/BN/C7NQz20TuPyIz1P0TRbfvP66S RVENthaDEfeOkXuEHGzu9b5JhAp5QoYS3pp/xS/R4fVeWmBmFcU8yukqM/w5UQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQ7Mh4Hw8zVrC; Mon, 22 May 2023 19:50:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34MJo8Pw074466; Mon, 22 May 2023 19:50:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34MJo8MG074463; Mon, 22 May 2023 19:50:08 GMT (envelope-from git) Date: Mon, 22 May 2023 19:50:08 GMT Message-Id: <202305221950.34MJo8MG074463@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 0688eac1f9d6 - main - git-arc: fix spelling error in -s option List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0688eac1f9d6a25f4d75ceca1fb1e32993bdb17c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=0688eac1f9d6a25f4d75ceca1fb1e32993bdb17c commit 0688eac1f9d6a25f4d75ceca1fb1e32993bdb17c Author: Christos Margiolis AuthorDate: 2023-05-22 19:49:32 +0000 Commit: Christos Margiolis CommitDate: 2023-05-22 19:49:32 +0000 git-arc: fix spelling error in -s option Reviewed by: imp Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D39962 --- tools/tools/git/git-arc.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/tools/git/git-arc.1 b/tools/tools/git/git-arc.1 index d6363b5d1641..63227ad760fa 100644 --- a/tools/tools/git/git-arc.1 +++ b/tools/tools/git/git-arc.1 @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 7, 2022 +.Dd May 5, 2023 .Dt GIT-ARC 1 .Os .Sh NAME @@ -77,7 +77,7 @@ and wait for confirmation. .It Fl r Ar reviewer Add one or more reviewers, separated by commas, to revision(s) being created. Argument(s) must be existing Phabricator user or group. -.It Fl r Ar subscriber +.It Fl s Ar subscriber Add one or more subscribers, separated by commas, to revision(s) being created. Each argument must be an existing Phabricator user or group. .It Fl p Ar parent From nobody Mon May 22 19:50:09 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQ7Mj6lQbz4CN27; Mon, 22 May 2023 19:50: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 4QQ7Mj677sz43hK; Mon, 22 May 2023 19:50:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684785009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z+ZrQ21cM4E/FLBoNx5kLW6m3OOduZIH7WdoHFr2yQs=; b=NZeuB5j801ih5AWwJbds3GfiiPx56SunoSoQ8MOaiynYOH1LCH98cAjpiwgXVrbxfyCh/S Hvd8FAxu9Mml5r/sVSiR88N30LkAUrUf8o0vakMfuE0UU/wtGShJA9GmX9AiX2ww34oDYU GUrte72gO0nSIAs6g7spv7kwND6Z2BqQ6fDri5iH3EuaKAmyouRNpepx+CU4SSQyjii7tT ihFjutbfCMy61FsjzYBSX3zlM3fw1KC+SAi/+/9AxGLkdgbT1X8VVlxTC/iN4kP41XVn+q K+db/9nUmteztrl9A4sx2kRbUQBboQC99kttmlMvmWmgsF18CeVzgZU34gainA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684785009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z+ZrQ21cM4E/FLBoNx5kLW6m3OOduZIH7WdoHFr2yQs=; b=tvPt7uD+gEiEeG+sBG5gGrOUcl4QtC2dnwE4rxufS2Iwv/cdMM/7DGa1bTqj/jN0YBRAqj bpnuk3FrH+mRMCAhGvFzo1jGDw7kAMVWQ9y847pbw6w8sb5FVwkG0Qgttc6h4BDcvTyKMz S8MIRHuRStJx+ocxpkgXrd+pNm9A2hfGx9vHD/VnjEifPZwwoC7R2Z9whefFYgy6BwNZEH xFAPmysmf1wH0qxyNYDyl1x4X1NhtLpy/4IiKWGe6Rm1Z8RUrGylKTnjJ6hT7gJXXWtv0O D+vxBp0ycYEJ8U7tbc8nXJC+ScNun4nymG7E2WZSLLwjM7rVQrxeVYlMuzfBCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684785009; a=rsa-sha256; cv=none; b=KJn7GibEx58Ra8TxMw1JMNjzor3+Piex31y83rDZ/dMyxbts8DSECgYTUMo/2mbeWtRT10 y3DNmViIGjMreNQplSrhDK3No7JmFRv6C4u0i6To2Q2vZwz0PNRVn9TTTUcmjzwBGsrIhx gk2BuJS9skM1IoFb7zs7yAP02ClWwNBF6Mu5rUtjwPGs0noMKd7qxF8dmR+idtTgJmIXGy OQtUgw1DY/cn1bWyvIUUxBDFvlHV0JyzHUohORg/H8JNSPBRZocupJxb9CZb8fGQY7GCEP mO/onb8ImcDgjz66wkD+wB9QTvjLLaZAVaQkYtV90DIG9d8mLdN1eOrPHupOhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQ7Mj52Y6zVrD; Mon, 22 May 2023 19:50: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 34MJo9NZ074938; Mon, 22 May 2023 19:50:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34MJo9Qt074936; Mon, 22 May 2023 19:50:09 GMT (envelope-from git) Date: Mon, 22 May 2023 19:50:09 GMT Message-Id: <202305221950.34MJo9Qt074936@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 0c08479898e6 - main - git-arc: mention creation of separate reviews in man page List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0c08479898e6d4d4dab071a19d906661947af108 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=0c08479898e6d4d4dab071a19d906661947af108 commit 0c08479898e6d4d4dab071a19d906661947af108 Author: Christos Margiolis AuthorDate: 2023-05-22 19:49:32 +0000 Commit: Christos Margiolis CommitDate: 2023-05-22 19:49:32 +0000 git-arc: mention creation of separate reviews in man page Reviewed by: imp Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D39963 --- tools/tools/git/git-arc.1 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/tools/git/git-arc.1 b/tools/tools/git/git-arc.1 index 63227ad760fa..c816de672984 100644 --- a/tools/tools/git/git-arc.1 +++ b/tools/tools/git/git-arc.1 @@ -37,19 +37,19 @@ .Op Fl r Ar reviewer1 Ns Op Cm \&, Ns Ar reviewer2 ... .Op Fl s Ar subscriber1 Ns Op Cm \&, Ns Ar subscriber2 ... .Op Fl p Ar parent -.Op Ar commit Ns | Ns Ar commit-range +.Op Ar commit ... Ns | Ns Ar commit-range .Nm -.Cm list Ar commit Ns | Ns Ar commit-range +.Cm list Ar commit ... Ns | Ns Ar commit-range .Nm .Cm patch Ar diff1 Ns Op Cm \&, Ns Ar diff2 .Nm .Cm stage .Op Fl b Ar branch -.Op Ar commit Ns | Ns Ar commit-range +.Op Ar commit ... Ns | Ns Ar commit-range .Nm .Cm update .Op Fl m Ar message -.Op Ar commit Ns | Ns Ar commit-range +.Op Ar commit ... Ns | Ns Ar commit-range .Sh DESCRIPTION The .Nm @@ -191,6 +191,11 @@ $ git arc create HEAD~3..HEAD Pairs of consecutive commits are linked into a patch stack. Note that the first commit in the specified range is excluded. .Pp +Create a series of separate reviews for each of the following commits: +.Bd -literal -offset indent +$ git arc create b409afcfedcdda ca03ed1345aff0 +.Ed +.Pp Update the review corresponding to commit b409afcfedcdda: .Bd -literal -offset indent $ git arc update b409afcfedcdda From nobody Mon May 22 19:50:10 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQ7Mk6yBLz4CNYX; Mon, 22 May 2023 19:50: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 4QQ7Mk6PX6z444c; Mon, 22 May 2023 19:50:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684785010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3atvR4ab/LQdopztWHgVwoShvHpGT6hPsqFR74IsjJU=; b=ZkJmJ46Ubqr/9AovlgvJAvFIrYqiGg8DL2SW326X4IVh+Juc/nvTIKmrrAN+LWjqeUdcFI G2w6OMIK98t+HaPxvVkOJWuxPLrKo8uilVEfcJjGfcq78JqJDCuYh32Kplr/e5/56voxik 9VqnsR3a5cEWv4Z+F2feGCzuho3NsqJ/ELnQmoyTh/l0zGbVJnBSQ64QukNICbtSVTfqXB 6oZB6Y5bqLV1mUOrr0be8pELizVHoBUZocX4T+Oo9LXtmF+0Du17ll5wqWAhcm9K+wxUYo Z88rFPwgptre8Hc5wKUfXgWghovxatYAg19ee2DzmG471QpxIEyVkgtZLteahw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684785010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3atvR4ab/LQdopztWHgVwoShvHpGT6hPsqFR74IsjJU=; b=LIsPWKQZrH5Uvvt3l64RStS770LSCuuOe8AqkPMFDhxWyahwdeL+YI57tOi0XpGaFd2FaR YdtD9L381/4yxjVX0TBwm62XtRGzocxZfV995v0tWfQK/JgJpdSIU8UOHJultl4YXfch+V IZzZ3E/97181uQ3ZRJqxrV3vD7p9eeYw1vQCMhTLOnYQiwywN6sL4GET81nzT8RCHlI3Lb Y6b0wy4ALh6fNQzbyBPMwaW2E4u8d5VArKGU62PhHwKTMlOWf1214+Pp/+NBiVBy0hQPIm gK0IOeGGOmXPtqX4SJPnvLK1Rlwh9aUIXFsTdI81YGbqSFcFt/oDNfCfPdBS1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684785010; a=rsa-sha256; cv=none; b=YSWqC/LKPFESf7u/YsowegJFruWGB8MzjtDBoYcysFZvhLS1wfcvHhX7uk8HeBRW3lac4m uv+vPtUmGDIdh3HGq37+x8q8b0EdWBwbIlyV3qQep4r41ge9DbbluDdx2WC6VZmPftz3Vk IunLISeaVfo8J9GDld6sUHwMGJJXxUwi2LjMD56K4+Wko7uFBlWQkbi8R3spkzrCvCVSp9 z1AHEb4Xk7iIbb2wxowTbU0n9V7MAPn4np2fZ9cwG4T4tfvlNq0OLXqLN2c6IT+9WNkXTI 3CFESAfN+YPsP0Y4R+Q/9QrWQyN7oJ8GiHqNBL/vmg4SPHaIwKTkv7DQFSc4YQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQ7Mk5VX4zVhL; Mon, 22 May 2023 19:50: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 34MJoAvO075534; Mon, 22 May 2023 19:50:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34MJoAfo075527; Mon, 22 May 2023 19:50:10 GMT (envelope-from git) Date: Mon, 22 May 2023 19:50:10 GMT Message-Id: <202305221950.34MJoAfo075527@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 94fe28babf1c - main - Add christos as a src committer and markj as mentor List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 94fe28babf1c26e6b38601c76d606b04b23a409e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=94fe28babf1c26e6b38601c76d606b04b23a409e commit 94fe28babf1c26e6b38601c76d606b04b23a409e Author: Christos Margiolis AuthorDate: 2023-05-22 19:49:32 +0000 Commit: Christos Margiolis CommitDate: 2023-05-22 19:49:32 +0000 Add christos as a src committer and markj as mentor Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D40210 --- share/misc/committers-src.dot | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot index b2e927d4d9fd..281cbaa6d3eb 100644 --- a/share/misc/committers-src.dot +++ b/share/misc/committers-src.dot @@ -142,6 +142,7 @@ bwidawsk [label="Ben Widawsky\nbwidawsk@FreeBSD.org\n2018/07/05"] bz [label="Bjoern A. Zeeb\nbz@FreeBSD.org\n2004/07/27"] cc [label="Cheng Cui\ncc@FreeBSD.org\n2023/02/15"] cem [label="Conrad Meyer\ncem@FreeBSD.org\n2015/07/05"] +christos [label="Christos Margiolis\nchristos@FreeBSD.org\n2023/05/22"] chuck [label="Chuck Tuffli\nchuck@FreeBSD.org\n2017/09/06"] cognet [label="Olivier Houchard\ncognet@FreeBSD.org\n2002/10/09"] cokane [label="Coleman Kane\ncokane@FreeBSD.org\n2000/06/19"] @@ -740,6 +741,7 @@ marcel -> nwhitehorn marcel -> sjg markj -> cem +markj -> christos markj -> dougm markj -> lwhsu markj -> mhorne From nobody Mon May 22 19:50:11 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQ7Mm1pqKz4CN7Q; Mon, 22 May 2023 19:50:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQ7Ml6rSHz442s; Mon, 22 May 2023 19:50:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684785012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MyKBO6wIddvIyJ9fWHlJcubkG+cnTIeSZN7u2QrN1+U=; b=oSU9ePLQvgJaGnHfkL6dbQ57EHVLuIUu9v6mkd/u9Q80S5sUIjqHpf77SogO4OI+KxwQSA yLj2pF+7NniHHEOExkgzQEgecYVhJr8DC97K31n56UHLCUS7YK0pylVzQA/y9RMh97eYwK 9yXgj0TSpvYm2KPjTOxNZnCn6lQ4FeBmcdT9dyhnFA4kkM5CTm5mkmykZEKp3gZi54uuFm rM0K7aIIgphAQ/SPo9B8BhI5MuUebjQslwT/Xj4IOSWLCTumhS5SYexvObgHGlg+Jlz5I6 +MobQAQ/7kufuRwODfxcP+LBKyrWeBBgNNx/AhKW9xOAxcqVubC16kKWtjb4LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684785012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MyKBO6wIddvIyJ9fWHlJcubkG+cnTIeSZN7u2QrN1+U=; b=rmcNAhiNimYiK4NqR5+tBdabXBOdu4sjOUgABtnHLCnhcEd5fZtDnoPB5iFObnfRuJJ6gJ GP9IQbJiyhGeDHRDGQxmKduGhwgo10JN70KejU3n3nkN3V9UQ9f2kVz/5Q77DBEKHdInuD rFqPjoGGOM9LsaCUl3+bAffwZWVAFfaoCCPZdPvNAiUo5Gw9+AxcxtO30BxzljyEyEsU5H cNwzakGswRVQMwikazDye6EB92ISJuKIK0nhc+JJ6MI+JTtInZe3qmfn923DJ8Y5amXmwP JbFbo+x563XdEYflzE5Inl4K6OeYaUfBopr+iVTjAO8AFB5DWAmmrKd5xao8ig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684785012; a=rsa-sha256; cv=none; b=Mu2NxvDreoGAPFp5RIWyvtnA4QrOtX4K/cusvsZVfsIF8ov58LWLBB3v9HNxrIonoF78RV EzxmRuaicq8mSsADLVjTtbYRoECBZVo5Okpd1Zr13fKVU/nPDx3MOyv3bjQFGiXZlGlZG9 iIhsWI2TsZs7NxTV5l3k6rdT8EpuRJ1I5voy92noRCR79uEKT/dCJHy7aWMa3iXaVDjiph 7F9NiYjr3UmgsR+3wcl1TNHfBUvC8smD9Oi7upO9EIFJarrMhCeZSc3xmtC9aeJbAansAv ZApDZ+mz87wliVZboL075FJRAimKBfb6ugGkkH8tpjoMiE26mT1q+inKgj68yQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQ7Ml5yd4zVrF; Mon, 22 May 2023 19:50: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 34MJoB6O076158; Mon, 22 May 2023 19:50:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34MJoBU2076152; Mon, 22 May 2023 19:50:11 GMT (envelope-from git) Date: Mon, 22 May 2023 19:50:11 GMT Message-Id: <202305221950.34MJoBU2076152@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 136b8bd610c5 - main - arm64: use PSR_DAIF instead of each individual flag List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 136b8bd610c5e5e3e3c4cf0491523fb35733d2df Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=136b8bd610c5e5e3e3c4cf0491523fb35733d2df commit 136b8bd610c5e5e3e3c4cf0491523fb35733d2df Author: Christos Margiolis AuthorDate: 2023-05-22 19:49:33 +0000 Commit: Christos Margiolis CommitDate: 2023-05-22 19:49:33 +0000 arm64: use PSR_DAIF instead of each individual flag No functional change intended. Reviewed by: mhorne, andrew Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D40165 --- sys/arm64/arm64/locore.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index e26003b6c926..79affe82a434 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -321,7 +321,7 @@ LENTRY(drop_to_el1) /* Zero vttbr_el2 so a hypervisor can tell the host and guest apart */ msr vttbr_el2, xzr - mov x2, #(PSR_F | PSR_I | PSR_A | PSR_D | PSR_M_EL1h) + mov x2, #(PSR_DAIF | PSR_M_EL1h) msr spsr_el2, x2 /* Configure GICv3 CPU interface */ From nobody Mon May 22 20:04:17 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQ7h20w9Cz4CPFG; Mon, 22 May 2023 20:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQ7h20GBmz4694; Mon, 22 May 2023 20:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684785858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LvNMHVPiVdr3fnu0O0wZQllRAAGba///LhhwN/SUyNo=; b=JTFU5CAzOX6RxQbAUPwzVs6Ihqbo4/X9Z6j4KC6uARU4vLR2jDITJP73i7JStJpCbQtaGc Oe04QqAXsunCBu0gkyVVy/7sM5RBqIpuQdSXUzzHQbtNm/uHe1WGsVseMKv6Yp53g3V6CE qxayDAdLA3PnWRiQh2ARGLVSvyhsqoGafjiPpgYE2lZEPmVPebmtHN+jvNWMERBLWzRBab lcz39UMYw5n10tdR3otsN/BCNWsXl0akV6OejzQ4gUaONLYea/J+Dx4qFVnFFeESAhI+Ar HVYNI8abILMRYQuAv+1j/y8Uo+VLuE2OXQM1Bns194NnUOPJ15NvllRdq1syHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684785858; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LvNMHVPiVdr3fnu0O0wZQllRAAGba///LhhwN/SUyNo=; b=XXpizpPbbeo53y7t8C46IZBTHhx1knZ2SBamIyFMn16nuFMiwqzvA/D8MHJDo8BB2DCfur gi4HEKpsst+JRlcptcARzW84TSDQ/Tu/FBEmMuemYmTg9esqzpDdca0DQgCs3iZnFvXv+/ pFwEipZ1Iozbeh7/17C9Z7hCL5r+h86T+T4wznjWVwjxS7grfjhke0aSQbvx3AWCo4Sp/V VvbthL6oP1AXyGd8/lTsMloQTbgEHJ792+CEarl2Ycdt8CcF+yNBwhTErIxmlgKpn30vos 3B0oA+4H3qa97hvIKRkRAiDpgcucY8Qe0FbRge1Tcvw+eE2GZTPgQ9UMsJGrWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684785858; a=rsa-sha256; cv=none; b=B31PgP+vrfMWhdVtflRVjmDuPASZOndPjF9ejIAx5Dtv1prWobkrOlkk66TvCkrIr/4ncW 2RMixDiA0udwHZrrBcuo9k1TZu+l3/m1WvwkmbnTBnRHRnfWbeHgDpUizLpSfU3CSXjka/ jOAfzZQuwZ8t8L88JGGy9b1d8DeOZrbcAM5brW/06VGkA8X1hXp/a/EjgKVv5qOyiRd99p oT5mTdbqufLe7GVFnbZ/2Vo5runD7DpBBYsLxOPbfCgBHPfrCyYovW0ZTGk8vk7dsmvwOR CFBwpj37ozCxud9n/nEcI5GXBRHqEB6+sT6BJSm5VvVqq14i8hfDXB801FQ+KQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQ7h16RTqzWcN; Mon, 22 May 2023 20:04:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34MK4HKk004026; Mon, 22 May 2023 20:04:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34MK4HAm004025; Mon, 22 May 2023 20:04:17 GMT (envelope-from git) Date: Mon, 22 May 2023 20:04:17 GMT Message-Id: <202305222004.34MK4HAm004025@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 3c6fb586b956 - main - riscv: do not duplicate sd of tp List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3c6fb586b956798fbff8e9c50e7e3a7f204ba5f3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=3c6fb586b956798fbff8e9c50e7e3a7f204ba5f3 commit 3c6fb586b956798fbff8e9c50e7e3a7f204ba5f3 Author: Christos Margiolis AuthorDate: 2023-05-22 20:03:06 +0000 Commit: Christos Margiolis CommitDate: 2023-05-22 20:03:06 +0000 riscv: do not duplicate sd of tp Reviewed by: jhb Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39894 --- sys/riscv/riscv/exception.S | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/riscv/riscv/exception.S b/sys/riscv/riscv/exception.S index a68e7938e537..17b2038d4068 100644 --- a/sys/riscv/riscv/exception.S +++ b/sys/riscv/riscv/exception.S @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); addi sp, sp, -(TF_SIZE) sd ra, (TF_RA)(sp) + sd tp, (TF_TP)(sp) .if \mode == 0 /* We came from userspace. */ sd gp, (TF_GP)(sp) @@ -54,10 +55,7 @@ __FBSDID("$FreeBSD$"); .option pop /* Load our pcpu */ - sd tp, (TF_TP)(sp) ld tp, (TF_SIZE)(sp) -.else - sd tp, (TF_TP)(sp) .endif sd t0, (TF_T + 0 * 8)(sp) From nobody Mon May 22 20:22:15 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQ84l3lP9z4CQ67; Mon, 22 May 2023 20:22: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 4QQ84l3KPbz49Sn; Mon, 22 May 2023 20:22:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684786935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3KN5HPJu3lCXHJ3BLHMWmnZ5MOjS0mY3pVPA+z+Ppjw=; b=rlVQhSmPXdWZR4Mt/+ELCWni/K7ilou3sJ/gwh9Gn2QOPVFO1KY8mrIEhUdsE5xrAwXsAr Jautw3VuoU2Ox9wveejA6s9W5ucIaSl9W6/057B0ERrP3yLAes4VzJiLeAUBVjnfINJZYo 0HBauJXlzmoIw4VSd8w7mW1pyZMVrCi+5Ruph8NkK1eVX9dP1gLOy7ilMlkWaUQpFA0OAp c2/3OVu/uwwFaInOuAMyDcFKb+RFe1C4tehocn7fdpnZc3xokM4xnzK9X58zMwDvD3JG6k KQEfWxdmrQRc7wLWrLKEL65BiYjgL5QZUogD9zKUYEIaKgLRs9gRmQ07nsyS0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684786935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3KN5HPJu3lCXHJ3BLHMWmnZ5MOjS0mY3pVPA+z+Ppjw=; b=b4jZBiuJeUWsaJqdy3eSoHtXETjAxnfwDYC3idSVG1AF9U0oxpaBmLWXLWZUr6OcsWt4h1 o5jeSXBOWp2u2jNm2iY7y0SVN9DwpW/wBrw5IhI7F/Wq0VQO68n1/8HoO9ukb339xJxky/ r/ZZNluUthJKzIWFlOg4lSn9gffwyPgUNCbZ75XBUQFEuIeK0Fj02G0gKRfyqnKeqFHY6Y 6DjTb6pPTP8miBWEkSB0yvQM5n/ZZEBUIsME4/PuBG0FCPtTgRgLKNZZipAs7/GasPeNjs oOzv03u/DnvpkPCLVoPOxBWcbbjvYoU7avbZffbALSUd6+6oaJRi/zjI37efCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684786935; a=rsa-sha256; cv=none; b=mOhaUEY8nJ37Ff/Q+Okc9wqaRQXVxQ0GvjvvdRLbBRLpjryqejFfQ5V+qO4K6OE6XXncfj SYvwo5mR0wd6wQZmAPBY5hOR/RpRIGxryI0rSKv1YWlzJPqwrZ3FR0mMgcw4VodRrLP5jh 88TpS+AIx3TAWGooSHauUvT27pS8h05+8mnlDoZltjS1daEbouF4mE4WQg0niE7r55zWwJ pAIpFOaUvMgBNgsxEoDOm5awcjOgftWVOffOCHRYDGi18QjI4FLs9BW6ckkb66PcgKO9Df AlYZSvTwsNacpCJIje57P+hSzalyHYOgda+Ukv/RepyMb2R6dFEToqHSzUsYbg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQ84l2GbczX8K; Mon, 22 May 2023 20:22: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 34MKMFSd036418; Mon, 22 May 2023 20:22:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34MKMFPO036417; Mon, 22 May 2023 20:22:15 GMT (envelope-from git) Date: Mon, 22 May 2023 20:22:15 GMT Message-Id: <202305222022.34MKMFPO036417@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: cef256558752 - main - dtrace: export dtrace_dis_get_byte() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cef256558752afa1f25afd7823bb01fde8bd63bd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=cef256558752afa1f25afd7823bb01fde8bd63bd commit cef256558752afa1f25afd7823bb01fde8bd63bd Author: Christos Margiolis AuthorDate: 2023-05-22 20:21:25 +0000 Commit: Christos Margiolis CommitDate: 2023-05-22 20:21:25 +0000 dtrace: export dtrace_dis_get_byte() kinst uses this function as well, but because it is not exported, it implements its own copy of it. The patch also exposes the function to userland, so programs that need to use dtrace_disx86() can use this function instead of rolling their own copies. Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39871 --- sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h | 4 ++++ sys/cddl/dev/dtrace/x86/instr_size.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h index 7b8da08e9ae9..6b09a1761af9 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h @@ -2431,6 +2431,10 @@ extern void dtrace_helpers_destroy(proc_t *); extern int dtrace_instr_size(uint8_t *instr); #endif +#if defined(__i386) || defined(__amd64) +extern int dtrace_dis_get_byte(void *p); +#endif + #endif /* _ASM */ #if defined(__i386) || defined(__amd64) diff --git a/sys/cddl/dev/dtrace/x86/instr_size.c b/sys/cddl/dev/dtrace/x86/instr_size.c index a2a9b9342566..878bcf7cf09e 100644 --- a/sys/cddl/dev/dtrace/x86/instr_size.c +++ b/sys/cddl/dev/dtrace/x86/instr_size.c @@ -49,6 +49,7 @@ typedef u_int model_t; #define DATAMODEL_NATIVE 0 +int dtrace_dis_get_byte(void *); int dtrace_instr_size(uint8_t *); int dtrace_instr_size_isa(uint8_t *, model_t, int *); #endif @@ -79,7 +80,7 @@ typedef enum dis_isize { /* * get a byte from instruction stream */ -static int +int dtrace_dis_get_byte(void *p) { int ret; From nobody Mon May 22 23:18:34 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQD0F5Hwpz4CZvj; Mon, 22 May 2023 23:18:37 +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 4QQD0F4qfbz4Qj8; Mon, 22 May 2023 23:18:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684797517; 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=r3em1INcx6hTyMO1coO4C06ReRJcBW0cMVvmpNhw3XM=; b=xIBOdmS7WGeu8+F+dk6uWm4GkRo+XKf86VkS/Qem5+m4Uuq/oqYGcXmkP9qrUlJIH9xAuT tX61lfRQrkL0GmJK4wRbkXtBOvJ993KjF7kOx4x0Jwt6d7G6CyhNCebBYHKVIIKv0SX5YM uIq6c/HYjbxYrpuR0Vfa0g0Rh6xfVh9PrlmUJlSHOKch+X7pRlGLCFkzGM8TeI9EjBolXl EUxR/WfLz2rCBADnoVdU1tWuTxJJHSN5pu0yjXp6KnIeZ5uX2WLNhIDnxpySTpz9rbqsSf tdvlcUz8N0mjbijncIm6SCHdMEDYXfVyXxYdKYWMEhrakxNe+BlBnvQZbC8w5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684797517; 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=r3em1INcx6hTyMO1coO4C06ReRJcBW0cMVvmpNhw3XM=; b=awdTEzoHRga05G/VVTymm3+MOGzwbap1ktW/cphLxpRu4pHTWKdsigwyVCCdCG2LJa7H+g NqU41uphjVJkDoiF4v9zwYUNL6Wh058NzHJTQniY0xVovgvqXLjvqIXNtV/emYeNidNO/w Ltg5/SMKOwiGHT+fqjz6nN1QFm1Lc8KidwZEmZtbVuab9qeILK0l3VLwBksLwEg+lnkFL6 dxHDQ24/BkNRJR3zYCf7n0qd/zrPkkyJJ+T3ozBoO1BqU5s+WN1Hbirwr66cTOEIVvAuj7 UC5GWoVfdG5wfzyfOK6eQTfpwienB4a1hkPVPAszfYH0l4QFrfAZrrduDiPr4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684797517; a=rsa-sha256; cv=none; b=w068WFizJdR2wMk2yii0hNauvb41kbqe2NSh+OJ7K6UHYurckTlV0jye7VoAptLmhC3jts AdmJR1FmqA6Lpdbr76V3QkYIa/VhrCwYZyUoq88/0evmDAdpew74oF7DW5TCZg08SIHiBL edSYApSKGrpRRbLhwDUfw5pv0c0gLeuoC+9OkYlhGyl4syDB7PWbIgmOso3kLdJHelnpsa GG60zF4w4brTRTB0NMgYYqxD6NI+iX6JzDl/j+Aa/FydrGthTPupvlRgvqrhbtKimw5PfG oUYGTzrv3oFYpNkqL7rMiB6cpctAKlxM2QVlOB/vFs521mrb+LLWaVlrmM4yDw== Received: from [IPV6:2601:648:8680:16b0:79e8:c02e:291a:4408] (unknown [IPv6:2601:648:8680:16b0:79e8:c02e:291a:4408]) (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 4QQD0F0DVWzG8J; Mon, 22 May 2023 23:18:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <91aa828c-fa59-3d53-f801-baa43ffba135@FreeBSD.org> Date: Mon, 22 May 2023 16:18:34 -0700 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: git: ccb59683b983 - main - arm64: add tests for swp/swpb emulation Content-Language: en-US To: Jessica Clarke , Kyle Evans Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202305151542.34FFgONF071780@gitrepo.freebsd.org> <663D9FB2-D1EF-4D51-9FB1-038AF6AA98C0@freebsd.org> From: John Baldwin In-Reply-To: <663D9FB2-D1EF-4D51-9FB1-038AF6AA98C0@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ThisMailContainsUnwantedMimeParts: N On 5/15/23 2:59 PM, Jessica Clarke wrote: > On 15 May 2023, at 16:42, Kyle Evans wrote: >> >> The branch main has been updated by kevans: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=ccb59683b98360afaf5b5bb641a68fea22c68d0b >> >> commit ccb59683b98360afaf5b5bb641a68fea22c68d0b >> Author: Kyle Evans >> AuthorDate: 2023-05-15 15:42:16 +0000 >> Commit: Kyle Evans >> CommitDate: 2023-05-15 15:42:16 +0000 >> >> arm64: add tests for swp/swpb emulation >> >> One test is suitable to be hooked up to the build, so I've done this >> here. The other test lives in tools/regression because failure is a >> bit more subjective -- generally, one runs it for some unbounded amount >> of time and observe if it eventually exits because two threads acquired >> the same mutex. >> >> Reviewed by: imp, mmel >> Sponsored by: Stormshield >> Sponsored by: Klara, Inc. >> Differential Revision: https://reviews.freebsd.org/D39668 >> --- >> etc/mtree/BSD.tests.dist | 2 + >> tests/sys/Makefile | 1 + >> tests/sys/compat32/Makefile | 6 + >> tests/sys/compat32/Makefile.inc | 4 + >> tests/sys/compat32/aarch64/Makefile | 24 ++ >> tests/sys/compat32/aarch64/common.sh | 9 + >> tests/sys/compat32/aarch64/swp_cond_test.sh | 14 + >> tests/sys/compat32/aarch64/swp_cond_test_impl.S | 413 ++++++++++++++++++++++ >> tests/sys/compat32/aarch64/swp_test.sh | 14 + >> tests/sys/compat32/aarch64/swp_test_impl.S | 216 +++++++++++ >> tools/regression/compat32/aarch64/Makefile | 4 + >> tools/regression/compat32/aarch64/swp_test_impl.S | 410 +++++++++++++++++++++ >> 12 files changed, 1117 insertions(+) >> >> ... >> diff --git a/tests/sys/compat32/aarch64/Makefile b/tests/sys/compat32/aarch64/Makefile >> new file mode 100644 >> index 000000000000..716182b15d9c >> --- /dev/null >> +++ b/tests/sys/compat32/aarch64/Makefile >> @@ -0,0 +1,24 @@ >> +PACKAGE= tests >> +FILESGROUPS+= asmprogs >> + >> +ACFLAGS= -target armv7-unknown-freebsd${OS_REVISION} -nostdlib -Wl,-e -Wl,main -static > > This won’t work with GCC, nor will it work with an LLVM built with only > AArch64 enabled as a target (e.g. -DWITHOUT_LLVM_TARGET_ALL > -DWITHOUT_LLVM_TARGET_ARM; latter is needed since we do default to > enabling ARM if AArch64 is even for a cut-down toolchain so that -m32 > works). This is why the freebsd32 sigcode in arm64 kernels is written > as hex (with disassembly comments) rather than assembled from proper > source. I haven't managed to get either 32-bit or 64-bit arm fully building with GCC FWIW. I think it can be fine to require that a system compiler for arm64 support -m32. We de-facto require such for amd64 already. -- John Baldwin From nobody Mon May 22 23:58:47 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQDtz4GpMz4CcbL for ; Mon, 22 May 2023 23:59:07 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic307-8.consmr.mail.gq1.yahoo.com (sonic307-8.consmr.mail.gq1.yahoo.com [98.137.64.32]) (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) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQDtx72z6z3DMV for ; Mon, 22 May 2023 23:59:05 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b="f+poqOj/"; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.64.32 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1684799944; bh=XAonoGbJ1Pz+R+3mQ0NBGuDM+Yr6/QvUcK14J6SR62w=; h=From:Subject:Date:Cc:To:References:From:Subject:Reply-To; b=f+poqOj/Fkv2KG36+RKh8dX+LIhlVbF50Vg83BU+sn/iBKxSRZ6VbJvc/17DUqVfCJGBS1JGzDZOx/H5k5cTsESjhAps6uYLH9TQ40fSYCf/qW5tO+KqeNhaXm8/fbI4r/rlZpZ9XwDnx6XTuDcAA5v2RbFJnZb0drTAmBy2R6i+Rxwz0nb0WTT9wCerY268640mlio2xz1tmhT4e2+mc5oGxGXABPlO6TrlNdvmQpfpCGeOwTW+6UCI03Z6TAPKGrVjDFpqdm7011NEfXbuhfRu15y4Hd5DkAebo/Z3HPOeGvcN+5wmv1XLV2n4KQAqLvUPLOmfPcIc4QVbbiyNXQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1684799944; bh=/GGTgy/0lL5Km8JD0W2UsT9bceJL2S8NP6fz+xODF7b=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=kpW3zE4fxw9ZYr+hb5eLH2cD+8S2oV3iw9yIdQ14wy5PIjEP5I5INT40C26/Q3mX6FfNVyuJldhlGJIS1rcAAAhdONes3CKMfmMDFmC3IRaLdoJG8WkelvWb+zpwSxpavbA8QxRBx23ZXQ8VyRxp+2NvrvGjsR745MaUGWPqLNmxQabWkRxve36mfz2tlHKiIrvZBv0QldCYSaq+X9lryiZJ5FaJFgEy70jvbxWTXqr9br536R5XPNhxnsKJjQd1M8tFxPEY7SD3+iUtk3yqsrnBq3vL/TkDciEZfTJb5RaNrXROt+d2E1bR77mkaDwWuKEW6SzgedAhGFsaBnp8AQ== X-YMail-OSG: yqT9tYYVM1kX1PX5yoe0D3gmPO33G2tb6IIkIJkLD1pQw1F4b_M7FO0R4qMoRvi zumbS33LzxPd4TxvqqCtTQlhvRC15K3vOeEz2MEqfDtRdnjrde_zXg0Pxt6Hg6lL9sVYZBvjPO0S pJnajlxyT90oUNCnFT_p.XqL5k8UifcpaEkppXYkBtIounQ7MZx1MkrU526vFgxfFbHeOPF5Od59 ZWafW7zIPU.VQJDeobkBcxIt9ayxlOYVZ2Hz8LrPE0cyp_Kr26NDnwhVrediuXD_mne89EAAfqvy WWnLS6HsmNQZasLl2NWbe9eQ2aJa44sN7Ba9IFi2Wfn8NYN6bsbcI3SmlvIEccPoRLGEELlvVZOF bWRZuOSrp15tWHSsQrnpbRsD1BtOhESh5HeVuhVkHqioubSFIa_VMrkr1pQH5As1yCwdRGPhM9jP t0v9kyDCcexxRoyqzZLBGLFuYuFBfBKe.x4hLQ8bWmpr7y.Q3.1AWHwhovNiYvG9qvRZwT5FcIOG WyLpzMKVawo7MqznLNA4cyWDTAjTdmuAHTTcAhOUnHMCgq1E40SF5jyrsXGnqOT89U2zAg1JC91l Yq47l9QJqCoqe.d9xSioja3_jIpkvT0TEhvN8zSqXUN_ve_.M.KQqpkhdiTx0yS.4lVGZWtGUqs9 73rvbu4cAN2NfXWzZfR25N1H2u83VC8Cp9e3jZlay1ZF1Dtlrai53cOhvD1XmMCrOFyGb4ciyGRx S0tHKu83NTYn68hN_ojmhwZ6X7wm_DTmeeAS7NZPV4eYlSaG2z_MBjBZouYSi7WH4OEQxFirC4EE dGekT7oG76A4dXxF4pjuMBKeA6VhTyxgvin8qevIMaIv_cyxgV3x6Qt8._JUUGGAbhZeCwuc5nNt dlwFCp6x3z20JOlTUgd.qahJQZX2.hVzLju6zf7eGKjp98DbhsdroHRLTLd3JcZmpYz5HZ5GvSV5 tOshxw9jDgkvNZkws8yjASNujuqfwh32ls4ti9oIPzMb64N5LO0bP7Oxuitib9UCssTkXCDYOEMu 6U2vPnS22gZKZUOGWtFx4WG9JqUEGfhht9zVR.Fp.qDaJrCJvkOzlZl5kuHWBS446mWFzd8qqWub Z1lovCdm2SP3jJtyQjDhKMeEvP49pX6asWaSrUGYLzqpfRmAPH6nKP9_8Mr8K9WoIBsErC8j_5xf vJWyJKePtL4oUSc1ZJUx80vQVGvfIlsQ58ZyCvjsa.txQv0_qEjGS8Fdhq1sLR7oypHNajdB7ex2 ZDDX_0EAKuhYfzPQS9PeZEMQdbPK8.xVEEX6YvB3.TKV4t45Kkumn4Js_Epd08Xy1sRHMdOC06f5 CWj7FoAokvfL8n5XjX9tx_dgxXbloC5nlb0K7Wh8ZyVtCM6TJGlDpSFRnT2ArHoIIkcJmtcnxyVp GFauB9mdfZKsoLgO5_Wfj.r4RmJjWYEuF5HVDPLVLGqCu51sQlauFypzPTwO_baUB6a9McuYvUgi gFisrkptx7tb4n4737MWxQpS3YIU5jJmEgouy1FCKcdHO90jqRSfMPqIM15r.07q1cXfVdpqYeIW VllT.SAuFeVtJXiMAgfOEQg8tW6d4a3pKGXlLNuExTY869aMr0UOQoyLcQIwhf_kvPSOtBK_T50F df_DQAj.WIz.tlCW0y5drC9S.rbFt_RL9dttqrVu0Td3yRXZro6isVqVZsrQoYsJmEoJXygRZFvH E.dsCOBN8tk.7d9.5l3BSITXuCINSvAu.KAYzIipIvJn.x7G8eWmGag8hMecNMu23cYVJ1WmXWEz MWOBkvK5CUPLYo5v56UG5H5lcJVh1h8Pn4WZ.ll7nN62vVR.NUw7Qg9Qm615B36MxoART0zOmSPG weN3_WkhYRvIMTMNambTYRr7.WJidHcM1bfCoISYHKV1bMR6o3g1Hm39SLrNpLvHATSkjFZI2jBj dXtXcyVZ29QUkWnvBnotevx7DcGtXGZZQcwt.Ed3TPsHckoAPEU_SAlZhRI8yZ7Qu6uckIrwpVPI CCjAjHptgX65ONHcWcH.rDpSSzK_wkurVW7nV2K8CFSgApNTmLrKuub2VARXISuJJIGkVdawM.rF FRTx5.pjS9eobCltlSRn7NU0gaaxXjegNU4pzn13k3dtglp6p0u8fTlg1YkDd2eSOd6M3fGM8hKu ygGXV5GF7jMSs4vVBstpS6lrX3Gm_MANB68Dw.kpVltKAuUormRCA0YRB5Nin25goWQBIUtDmOhO 2aYymwsMrdB2.BYHy4yWKxyH6kZ9KA_n4l2MAf.7OPjJC1TXC73Hbstxr7XJJ7xiZP0T_7d58F5M fRT_vIhgJ6eI- X-Sonic-MF: X-Sonic-ID: 5d72243d-5ff7-4f51-b664-ac9f31e3740b Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.gq1.yahoo.com with HTTP; Mon, 22 May 2023 23:59:04 +0000 Received: by hermes--production-bf1-54475bbfff-gh86g (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID f3aee8b5983aba47285d02b0946d711f; Mon, 22 May 2023 23:58:59 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Subject: Re: git: ccb59683b983 - main - arm64: add tests for swp/swpb emulation Message-Id: <894110D7-EFB1-4F76-ABD5-CD13DBAC4119@yahoo.com> Date: Mon, 22 May 2023 16:58:47 -0700 Cc: "kevans@freebsd.org" To: John Baldwin , dev-commits-src-main@freebsd.org X-Mailer: Apple Mail (2.3731.400.51.1.1) References: <894110D7-EFB1-4F76-ABD5-CD13DBAC4119.ref@yahoo.com> X-Spamd-Result: default: False [-2.97 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.97)[-0.969]; MV_CASE(0.50)[]; SUBJECT_ENDS_SPACES(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[text/plain]; TO_DN_EQ_ADDR_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; ARC_NA(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.64.32:from]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; RCVD_TLS_LAST(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.64.32:from] X-Rspamd-Queue-Id: 4QQDtx72z6z3DMV X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N John Baldwin wrote on Date: Mon, 22 May 2023 23:18:34 UTC : > On 5/15/23 2:59 PM, Jessica Clarke wrote: > > On 15 May 2023, at 16:42, Kyle Evans wrote: > >> > >> The branch main has been updated by kevans: > >> > >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dccb59683b98360afaf5b5bb641a68fea= 22c68d0b > >> > >> commit ccb59683b98360afaf5b5bb641a68fea22c68d0b > >> Author: Kyle Evans > >> AuthorDate: 2023-05-15 15:42:16 +0000 > >> Commit: Kyle Evans > >> CommitDate: 2023-05-15 15:42:16 +0000 > >> > >> arm64: add tests for swp/swpb emulation > >> > >> One test is suitable to be hooked up to the build, so I've done = this > >> here. The other test lives in tools/regression because failure is a > >> bit more subjective -- generally, one runs it for some unbounded = amount > >> of time and observe if it eventually exits because two threads = acquired > >> the same mutex. > >> > >> Reviewed by: imp, mmel > >> Sponsored by: Stormshield > >> Sponsored by: Klara, Inc. > >> Differential Revision: https://reviews.freebsd.org/D39668 > >> --- > >> etc/mtree/BSD.tests.dist | 2 + > >> tests/sys/Makefile | 1 + > >> tests/sys/compat32/Makefile | 6 + > >> tests/sys/compat32/Makefile.inc | 4 + > >> tests/sys/compat32/aarch64/Makefile | 24 ++ > >> tests/sys/compat32/aarch64/common.sh | 9 + > >> tests/sys/compat32/aarch64/swp_cond_test.sh | 14 + > >> tests/sys/compat32/aarch64/swp_cond_test_impl.S | 413 = ++++++++++++++++++++++ > >> tests/sys/compat32/aarch64/swp_test.sh | 14 + > >> tests/sys/compat32/aarch64/swp_test_impl.S | 216 +++++++++++ > >> tools/regression/compat32/aarch64/Makefile | 4 + > >> tools/regression/compat32/aarch64/swp_test_impl.S | 410 = +++++++++++++++++++++ > >> 12 files changed, 1117 insertions(+) > >> > >> ... > >> diff --git a/tests/sys/compat32/aarch64/Makefile = b/tests/sys/compat32/aarch64/Makefile > >> new file mode 100644 > >> index 000000000000..716182b15d9c > >> --- /dev/null > >> +++ b/tests/sys/compat32/aarch64/Makefile > >> @@ -0,0 +1,24 @@ > >> +PACKAGE=3D tests > >> +FILESGROUPS+=3D asmprogs > >> + > >> +ACFLAGS=3D -target armv7-unknown-freebsd${OS_REVISION} -nostdlib = -Wl,-e -Wl,main -static > >=20 > > This won=E2=80=99t work with GCC, nor will it work with an LLVM = built with only > > AArch64 enabled as a target (e.g. -DWITHOUT_LLVM_TARGET_ALL > > -DWITHOUT_LLVM_TARGET_ARM; latter is needed since we do default to > > enabling ARM if AArch64 is even for a cut-down toolchain so that = -m32 > > works). This is why the freebsd32 sigcode in arm64 kernels is = written > > as hex (with disassembly comments) rather than assembled from proper > > source. >=20 > I haven't managed to get either 32-bit or 64-bit arm fully building = with > GCC FWIW. I think it can be fine to require that a system compiler for > arm64 support -m32. We de-facto require such for amd64 already. There is a possible implication for the build environment compared to what it is now . . . For: WITHOUT_LLVM_TARGET_AARCH64 Do not build LLVM target support for AArch64. The LLVM_TARGET_ALL option should be used rather than this in = most cases. and: WITHOUT_LLVM_TARGET_ARM Do not build LLVM target support for ARM. The = LLVM_TARGET_ALL option should be used rather than this in most cases. and the ARM part of: WITHOUT_LLVM_TARGET_ALL Only build the required LLVM target support. This option = is preferred to specific target support options. When set, = these options are also in effect: WITHOUT_LLVM_TARGET_AARCH64 (unless = WITH_LLVM_TARGET_AARCH64 is set explicitly) WITHOUT_LLVM_TARGET_ARM (unless WITH_LLVM_TARGET_ARM is set explicitly) WITHOUT_LLVM_TARGET_POWERPC (unless = WITH_LLVM_TARGET_POWERPC is set explicitly) WITHOUT_LLVM_TARGET_RISCV (unless WITH_LLVM_TARGET_RISCV is = set explicitly) These might need some bundling such that AARCH64 being enabled (no WITHOUT) ends up forcing ARM to also be enabled (even if there is a WITHOUT). Or may be just report an incoherent combination and stop. =3D=3D=3D Mark Millard marklmi at yahoo.com From nobody Tue May 23 01:20:02 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQGhM2ZWgz4CjMN; Tue, 23 May 2023 01:20: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 4QQGhM0fF8z3L6j; Tue, 23 May 2023 01:20:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684804803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=llplxu9XNvTckR7bui4adrrDvhDcm+GzXGwgVr4T2UE=; b=XAuesmLzvqxMoj5dT/JbC4NJDTLXJ79CyE6OR6L+cNDiAz90bWXCjYU4i6H+Io9QQql/Bx YAuZmZ+PAoXDCPxLnfX5iJcpDR2pRhbbYJ1EdfyREHor02ZQzX1k+ddpP/lIx89fUCTRh8 0OzglAc8lEhxDt7ltVH0sJ5EerZpalwJk9btzPFF4F9rsHNQw0o6QdTfQ1DUHq30CsvMDM q0NLUdj0nas0OCTuA5ZH4NRb46XAtGoJJGhcXHIC3MPTHRP7LsFJmYrrcV6Z1rSQTrH/+g NvWTelTUvZqDuHMKHfNpqZmYnN/Tj14osgOsyWx3mE/k184Zf0/XFEoCQ/dC/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684804803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=llplxu9XNvTckR7bui4adrrDvhDcm+GzXGwgVr4T2UE=; b=k8ZAaFTvOGK7qUBnQv0kjEkLUqmlXgMfBVpoVjCUj9B0gwbW9UyI5o5U6M5tA/wPfGjBjo PX/P9mtnAOnnwP4ZcrdBSB9z3wICbAp1zUwUCXLq0NEYm4Fph71tE67fpP4riMi5ZlszXQ xrhXqB5yUd2ON4+xN0YK+pEOY1DWBlkG3ynHNPL/Ln7uICVEzfslf5MMi7MxHxqVUS0Uf9 +x9ZWvgCAdwo2Pbucr3A5AMgse6Gc4zMJ04G3OXss/7iHWlY/EgGqdtQt44ITgym7rUql/ vUyfQQU92B9YU6R27SyzOmBq7ZA5WG4uxEkxx2VcrlXXuox5hlUCTCLgAd1mcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684804803; a=rsa-sha256; cv=none; b=h9WVJ8KAeRnfjnR5a39vexElEHIQm8YC2b8KsFKCq5KsueWx9mFAkOQ8niJXaI4JyOJEGY 9n4iVr7nxLGMiu696IVbQnPoxXSAIC4OjeAeBvhVhNgXJyiVdFxk902STX3vfOTStQyH/n vrscOhp+Y/YzVMmZAUOo5U8yzJdLZG7+gZqewhN5eCXD5lZErc37UVE2qIueVlrlI0Lzzl 6dxPb0h7bJE6BfYRdDQPaBJLX3rtpYjW+N3Ieqc5BUSd17lNlzbHfR7qTBsH8/1PGoE4Og Hy0jdSikeE4M3/GCxsRJ+S7N58vQ/Z04UfqRcfG5yq/pTT6h4XUxtQkevK+Yow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQGhL6pgjzg4J; Tue, 23 May 2023 01:20:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34N1K2nm016493; Tue, 23 May 2023 01:20:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34N1K2iF016490; Tue, 23 May 2023 01:20:02 GMT (envelope-from git) Date: Tue, 23 May 2023 01:20:02 GMT Message-Id: <202305230120.34N1K2iF016490@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Enji Cooper Subject: git: 5a9c724847f9 - main - Correct size parameter to strncmp List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5a9c724847f9b4e3831aa2c16276cc2ae20a99cc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=5a9c724847f9b4e3831aa2c16276cc2ae20a99cc commit 5a9c724847f9b4e3831aa2c16276cc2ae20a99cc Author: Rose <83477269+AtariDreams@users.noreply.github.com> AuthorDate: 2023-05-08 23:08:18 +0000 Commit: Enji Cooper CommitDate: 2023-05-23 01:16:29 +0000 Correct size parameter to strncmp The wrong value passed to strncmp meant that only enable and disable were being accepted. This change corrects the logic so enabled and disabled are also accepted. Pull Request: https://github.com/freebsd/freebsd-src/pull/739 MFC after: 1 week Reviewed by: delphij, ngie --- usr.sbin/mptutil/mpt_volume.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/mptutil/mpt_volume.c b/usr.sbin/mptutil/mpt_volume.c index 9c160542f51c..04f69bcdf929 100644 --- a/usr.sbin/mptutil/mpt_volume.c +++ b/usr.sbin/mptutil/mpt_volume.c @@ -246,9 +246,9 @@ volume_cache(int ac, char **av) Settings = volume->VolumeSettings.Settings; NewSettings = Settings; - if (strncmp(av[2], "enable", sizeof("enable")) == 0) + if (strncmp(av[2], "enable", strlen("enable")) == 0) NewSettings |= 0x01; - if (strncmp(av[2], "disable", sizeof("disable")) == 0) + else if (strncmp(av[2], "disable", strlen("disable")) == 0) NewSettings &= ~0x01; if (NewSettings == Settings) { From nobody Tue May 23 01:38:12 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQH5W6xTRz4CkNd; Tue, 23 May 2023 01:38:23 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQH5W6S0hz3MVn; Tue, 23 May 2023 01:38:23 +0000 (UTC) (envelope-from kevans@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684805903; 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=OPE60WgJVdur+F4zkipq0fw2fnMAwaqVRCCIY1u83pE=; b=i4X0q1rvsgXmtNqCJxjnRr41yzLwWBrazsWwzXlthU2wt3uA6UyEoHlM54TU4ZkOZFQ72G /JJClRjJ3Apb6kNs/aZNw2Jg+d6JtucsQukx/m6e+jmV+Kip2fb10YXaPvT/EbtkEyZvF5 ELzyWNVwVsK6d2jep10jPl7J5NplH7G1sPLrzu4eECurb8HpgNBqpnVz8lrG3cJdndC9To vvswrPjKy2hffZArBGQqPNmtJPAIshyFiecCYRDFbjDF/AUXUkwq9vL+IURzbnLjQ4GO2+ QWNmXJxk0TKJHbV0udRc1mRSi48Pd2as1nIIBDm4a39QNT0Wcz2WkkZNmZsLJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684805903; 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=OPE60WgJVdur+F4zkipq0fw2fnMAwaqVRCCIY1u83pE=; b=MBeP6ASfOdRFvxUi4+gp/1iKj4SdLZ1TteZACSQ3dB1ProkqI5BxlLi8qJaWLFvH9hkk5s oWaAYI/O7tsGzujX9Pi2ZvkOKUItfKX4tpre8SAs4itKxXvpCPhRv49P8UeyN3lhb38O2h t6w+2eorov3h7ZUneR+sNQQTd+QsfmybH56lQ7ZQuCBPWjNXBHq9/b3rTml/mtea1cJ82L ZNit0EGP7AS+J8Vs+Au9dY1NkJSbyPR3I1cXptd3lnkfTml4fd/pOWPSAVrMjU+Bny1ujE 4dj7fE5dhH+I2leQqLbVuBhpZPI9BwUg1Hx7MltqFnpuBi1Za1/l7LNtK8xIWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684805903; a=rsa-sha256; cv=none; b=j6SUmK1dFLaTpOFDCt78u28j1pNFEyzIsiy9ikWQjq1mgNSWLCq8DJEfSWi+B1Po1u2cCo meFL0uwGTpkrNqs3tMwnzWbZjLI2I7r3610nKaPIYnS9Y3QXtdERid4U+1t94laxXSH7Wn hlo5cgrv3kYFhl3XN0UFc15fKDV/HqxkNy/mkKeSjxY6XB9PUVorklXhveEh/E5I/a+kz9 OtEv/yThn1N2JqXV9n/3GB4yNvkcxkUfegQLVLCM2ZQU6L1OQ8zdLI9fP30gWc2yNoN4Vp 56fS4n4GhIeGH8kr6i/zDfBXeGat5+L9wC92iM0lNnNCDUMMlzV9ebSE3DdqbQ== Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 4QQH5W5P8vzKGv; Tue, 23 May 2023 01:38:23 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f171.google.com with SMTP id af79cd13be357-75764d20db3so597093685a.2; Mon, 22 May 2023 18:38:23 -0700 (PDT) X-Gm-Message-State: AC+VfDyJgVko0YRsOJviFCXJZhwQQwyJNAKpNMiDsSuwWS9ITEESKTet Pjmu9ZZtHdEwZSRy3rzIrERc97phmnHXQwaq9PM= X-Google-Smtp-Source: ACHHUZ5HHqUu9O3NvoB2jhNMsn/KHNKUZIEfnEOeuAfDvqlYn4HxL1x8MQJIFN7cMieLMv9SSk81cfwldZK/am8yJrk= X-Received: by 2002:a05:620a:3a45:b0:75b:23a1:481 with SMTP id sk5-20020a05620a3a4500b0075b23a10481mr2628957qkn.71.1684805902853; Mon, 22 May 2023 18:38:22 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202305160109.34G19Zs0095589@gitrepo.freebsd.org> In-Reply-To: <202305160109.34G19Zs0095589@gitrepo.freebsd.org> From: Kyle Evans Date: Mon, 22 May 2023 20:38:12 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 816129210ad4 - main - tests: Don't recurse into sys/compat32 To: Jessica Clarke Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-ThisMailContainsUnwantedMimeParts: N On Mon, May 15, 2023 at 8:09=E2=80=AFPM Jessica Clarke = wrote: > > The branch main has been updated by jrtc27: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D816129210ad4f951059db2d942= b8213ffe0a0f89 > > commit 816129210ad4f951059db2d942b8213ffe0a0f89 > Author: Jessica Clarke > AuthorDate: 2023-05-16 01:06:34 +0000 > Commit: Jessica Clarke > CommitDate: 2023-05-16 01:06:34 +0000 > > tests: Don't recurse into sys/compat32 > > Stubbing out the whole file means it has no targets, so recursive mak= es > fail with "don't know how to make X". We could fix that, but because = the > level above is adding it to TESTS_SUBDIRS it'll generate an include l= ine > for the subdirectory in its Kyuafile, which won't work (the problem t= hat > was previously seen on non-aarch64 in CI). Thus we really need to not > even add it to TESTS_SUBDIRS in the first place. > > Reported by: Dan Mack > Fixes: 28f66935d400 ("tests: Disable sys/compat32 and sys/co= mpat32/aarch64 tests") Hi, For anyone interested, I posted a review for this part of the problem here: https://reviews.freebsd.org/D40224 This particular breakage wouldn't have happened if the flattening was done in a less fragile way to begin with. Thanks for helping me cover this up and discussing solutions, by the way- Thanks, Kyle Evans From nobody Tue May 23 03:31:06 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQKbg4Rwkz4Cqbh; Tue, 23 May 2023 03:31:11 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQKbf558rz3kRy; Tue, 23 May 2023 03:31:10 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20221208 header.b="Xa+M/cnN"; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::634 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1ae852a5330so25867675ad.3; Mon, 22 May 2023 20:31:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684812669; x=1687404669; h=to:references:message-id:cc:date:in-reply-to:from:subject :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=yJaSHffuzkuHtXSTOkaf4+cWAa8IAkPNbSSRsg93f/M=; b=Xa+M/cnNKfGRGzHSPT3B+k5XMrzv7Qiu+rL3htYD31KFnkth5HskjwgKrvlJWTHFj8 QS+Txf75rKQ35lxEbej6yh/+6vZYgijtgp+kr+NFeS3icxZn8ixNh87tBfR2CzcvKV6O JlhwVwo1HUsgqS/ZKcu1EG7eNDnxDteza72Dc9puwvRDjXGc2fcpzAZB1ufhufrTRr7b O4a+8+HuIB0dtUBnhyUCOB7vU8nW5WK0aO+hbXFj0WAiRewEEqbs1hbxn4WkiJYMc14G QcPN009khEZMN9qs62Z8jF00jAOjO9id02zkW+qIALljeob57WAU0Dgg4M9qTvF/6jZi oR1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684812669; x=1687404669; h=to:references:message-id:cc:date:in-reply-to:from:subject :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yJaSHffuzkuHtXSTOkaf4+cWAa8IAkPNbSSRsg93f/M=; b=X/Ayb4iFC1AJO0ZYdOxfxJiKycTvjzFazgWbwMzA4NmxKrl4s2ay59rTjy3LhJwOe+ NrbrI+A4duyjIYjpQht+tYTpPHamid/jyfzCajdr+XOqG3XGhJrW0eZd8ZtVUBIkbQAf RlR/ANyAvxkUJLZhrNvDR5TVHmogG6uqtBxMvGAaFQH1IMHLSyCRjjLmCWf7G9ZDws7w qWjg01/TaxJMrM9VSXD8JdBD5sXeW/k2MTbdq/APVMQsf1gl6Gu5APbWaHpdyeuZwjvv StfCQBFJ4BM/o7zcvjZI+1ygmbdaFYXc/4a2OHqr9+/pqlvH9HDmLyUSz32/iI3NBQgb Q74A== X-Gm-Message-State: AC+VfDzPd5FKN4lqQ/mcFLiBtl+5WHu+lhGwq3pUHiWBCro6OUm4PruR jz2FO4cHYlw3Y+q80zTGqsZfVkTIm0ggDQ== X-Google-Smtp-Source: ACHHUZ4f4oTHfKiQX7kgVszaONgBl1qyO5nBc/TVCjXWHMeY+1Dqamxzgb9uNJc8ZmDanmklkRuydg== X-Received: by 2002:a17:903:1d1:b0:1ac:8837:de9 with SMTP id e17-20020a17090301d100b001ac88370de9mr13796746plh.3.1684812668557; Mon, 22 May 2023 20:31:08 -0700 (PDT) Received: from smtpclient.apple (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id m4-20020a170902db0400b001a65fa33e62sm5543435plx.154.2023.05.22.20.31.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 May 2023 20:31:08 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_32CC27DB-F6A5-4FBD-8F13-DBCBF5551979"; protocol="application/pgp-signature"; micalg=pgp-sha256 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.3\)) Subject: Re: git: c6750ddec917 - main - Require the OpenSSL 1.1 APIs when compiling ldns From: Enji Cooper In-Reply-To: Date: Mon, 22 May 2023 20:31:06 -0700 Cc: Rick Macklem , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Message-Id: <50C9C8E7-3207-4574-A0F8-FDB3087D93EF@gmail.com> References: <202305201841.34KIfpN7025526@gitrepo.freebsd.org> To: Ed Maste X-Mailer: Apple Mail (2.3696.120.41.1.3) X-Spamd-Result: default: False [-5.60 / 15.00]; SIGNED_PGP(-2.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20221208]; FROM_HAS_DN(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TAGGED_RCPT(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; ARC_NA(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::634:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; HAS_ATTACHMENT(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Queue-Id: 4QQKbf558rz3kRy X-Spamd-Bar: ----- X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_32CC27DB-F6A5-4FBD-8F13-DBCBF5551979 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 21, 2023, at 4:16 PM, Ed Maste wrote: >=20 > On Sat, 20 May 2023 at 17:32, Rick Macklem = wrote: >>=20 >> Ok, thanks to Jessica, I now see that the Committer's Guide has >> "Submitted by:" listed as deprecated. I was confused because it is >> listed in the left column and then you have to read the next column >> to see what you are supposed to do now. >>=20 >> I'll learn to read someday, rick >=20 > No worries Rick. In my opinion if documentation is misinterpreted it's > an indication that it is not as clear as it could be. I've opened a > review to add "(deprecated)" in the first column to try to make it > clear. https://reviews.freebsd.org/D40196 Interesting =E2=80=94 I=E2=80=99m definitely learning a lot of = new git tricks post-FreeBSD svn->git migration; I can tell there=E2=80=99s= a fair bit I need to get caught up on. Thanks so much for the input everyone; I=E2=80=99ll adjust to = match the new format. Cheers! -Enji --Apple-Mail=_32CC27DB-F6A5-4FBD-8F13-DBCBF5551979 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----- iQIzBAEBCAAdFiEEtvtxN6kOllEF3nmX5JFNMZeDGN4FAmRsM3oACgkQ5JFNMZeD GN7+PhAAo+AdFoyRymOYsc1rlu945C5yjnI3+E76Dkx0A9Z+Cc1sxVyDkC8oc2mK xtB8GHXasdtaj0SpSvTszl1TYv4Rax8StkgGjpW3DDnzKi0ivmxqEm8sZTRwnjHC 5eM+b5oEBwX5LdXSbN6K/E2eyfCcKBfexfJkoY6dN8FqXFLURlSbfkl78gSuCEYt w5MwyBGrve8C1BhjVBsU4Y2duCOY5jXSvLhyUy8LuDssBA32YsdgAAFNS5tapbjS smaxW1SVuInAYgzler0s+6EeZLlAix2RpMmFigIr4P3uRELXBJOGhzE78J41eRbz PDTXqYKOlk9bV3Kl3rSKC0HY8IeWATIjMYSnXUcAe7u56e0Nz5sSvENpjErgjWNn q4wLXRFsEsvHo8XrKx8rujBXbk0xfwKA1yrtz0Z48MbtJPBAicnaGCy3IyAg7Nsw wrF+xvGxAP4WjPnwSBTgcLKJCCq3RRXoIiVWTT3s/3cHj0kQmd3cp2aJrjHe/iKB W4MVH0Ig90Chlby7kK7Sw0Vd6/vPQL1kx0+jGkS7/LrPe13Iv2wkYdg/wduqMjPX veHQHcdsBZ9xiGIYdaL0PjsnVjzGqyBlZJ7IvDjQz56cVmnRHaLlpFkze83CMDN3 dqOtn3yI+uwVbafzss6zApR3NCeExRgwkU0KVeLIz7H4BMJLxnI= =M4J6 -----END PGP SIGNATURE----- --Apple-Mail=_32CC27DB-F6A5-4FBD-8F13-DBCBF5551979-- From nobody Tue May 23 05:06:17 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQMjQ1qvmz4T25g; Tue, 23 May 2023 05:06: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 4QQMjQ1L77z3vRK; Tue, 23 May 2023 05:06:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684818378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=16++P8pEjmHjxSHUKdwJ0deXztXLMyJ0hQ2RqlQ487E=; b=rF/8T7KV/iSkEAZidFXa9usSxsmWjKb+kl+gaKa64kOlXIpyfsMQzKI5d4zwZGPng5/pth jAdZbbAD9HQ8Fp5lJ+mM3V/SqnmRPbYnvD2xOFb17CrLs/6lslX6aX5yR/8IPMOygdkiyo PmJCPxI+VGiIn2WXNzR14iqR/AVswI1rjdedN1uUOZWeHgY9MKjAIFe3zUzsk/AgacN4nO JtVvbeVVlE0uvvrO8vChgEDXHvnzzppu2E2R1XhzRkfzHiee38lrttaFdokwkUkHuhsYOh OfSuYVkG51wctaCPWtUQ92udFFJaEbbEWiKtHAbiDfY/hzLlH99xJJp1V82sJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684818378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=16++P8pEjmHjxSHUKdwJ0deXztXLMyJ0hQ2RqlQ487E=; b=JMaHUZ9OgFU9NwtMIoh6svFZUb5U+oiyZlOrbNe9Wsq2zpfI8uE7vI46VAIwx5bg7+xQbB UaBgMJoFBhZBQtUGnXyI53RW0XyRw+z9E6od2tYhxcFwIsmJ/hbhFPugyCJxFjarfZIqDh iKQ60J1FGxoJnStzbxXfUTQ51IYJVDORc+rV+b0DJRXfDBHZ0+pIiP2Om8fOOrU3ToKvnp ItMFqIW3tSEeMDfdtNbaqCfj36NGQsI+35Du0wVxMz/w98rl3zi+so0ZtZG1NJQ9ZBvafP QThIt58uV1/hUDtZWLOBZkIcQoxpRY2cpBZ5NO3zhBQjWCT3KhE7yJIVBQnqBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684818378; a=rsa-sha256; cv=none; b=G0fkxPd8Wy0HRhQ1kI3gfKMD+yPt5QwJGSx346UEh7oHurmki5tN2EVqDVoQYVqjKvSl8f IxfTMSaCelfQgDBIA/VDc1otfIS8yMUBDNNZ3xyMPuPfoipNm3HCJpuAZ04jNS/KKFe2mN YLAci0JJ3n35un44dEAS5ZkOqwU+x5EiRHzOFby19YAD+wznKo0vID31sKdy31UU8bhgZl ypcDuPVWdLdG7J0HL/Lr0XR+2umMA42K8NM6OUMLI5RyYlDZmpOVaxAp4pz6azxaAjkmiS ZUfBhjpVFtRDoshFh6Kk4v9xgNNN/HFXl7WwDpioa2f2v4rIhW1xUPzvmdKxKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQMjQ0FFHzn7S; Tue, 23 May 2023 05:06: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 34N56HlS093634; Tue, 23 May 2023 05:06:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34N56HQV093633; Tue, 23 May 2023 05:06:17 GMT (envelope-from git) Date: Tue, 23 May 2023 05:06:17 GMT Message-Id: <202305230506.34N56HQV093633@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: 634a770a5e16 - main - /etc/rc.d/motd: Update to accommodate changes in uname(1) and newvers.sh List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 634a770a5e16b424c096b74ac33a145e766dd7af Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=634a770a5e16b424c096b74ac33a145e766dd7af commit 634a770a5e16b424c096b74ac33a145e766dd7af Author: Xin LI AuthorDate: 2023-05-23 04:23:57 +0000 Commit: Xin LI CommitDate: 2023-05-23 05:05:35 +0000 /etc/rc.d/motd: Update to accommodate changes in uname(1) and newvers.sh The recent changes to the uname(1) command removed trailing spaces for better POSIX conformance, but it broke the regular expression used by the motd script which expected it. This commit addresses this by removing the requirement, as it is no longer present. Additionally, a recent change in newvers.sh introduced a new format for uname -v, which omited the build number and build dates to improve reproducible build support. This commit adds support for this new format. Reported-by: Jamie Landeg-Jones Reviewed-by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D40225 --- libexec/rc/rc.d/motd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/motd b/libexec/rc/rc.d/motd index d9dd60a0f59a..e27cf273741d 100755 --- a/libexec/rc/rc.d/motd +++ b/libexec/rc/rc.d/motd @@ -45,7 +45,8 @@ motd_start() fi T=`mktemp -t motd` - uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > ${T} + uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\)$,\1 (\3) #\2,' \ + -e 's,^\([^ ]*\) \([^ ]*\) \([^ ]*\) \([^ ]*\)$,\1 \2 (\4) \3,' > ${T} cat "${TEMPLATE}" >> ${T} install -C -o root -g wheel -m "${PERMS}" "$T" "${TARGET}" From nobody Tue May 23 10:23:35 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQVlp4z4Pz4CHvH for ; Tue, 23 May 2023 10:23:50 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-vs1-xe31.google.com (mail-vs1-xe31.google.com [IPv6:2607:f8b0:4864:20::e31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQVln2S9hz3Gqr for ; Tue, 23 May 2023 10:23:49 +0000 (UTC) (envelope-from rrs@netflix.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=netflix.com header.s=google header.b=NbKUXVLo; spf=pass (mx1.freebsd.org: domain of rrs@netflix.com designates 2607:f8b0:4864:20::e31 as permitted sender) smtp.mailfrom=rrs@netflix.com; dmarc=pass (policy=reject) header.from=netflix.com Received: by mail-vs1-xe31.google.com with SMTP id ada2fe7eead31-43951f7002dso431893137.3 for ; Tue, 23 May 2023 03:23:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; t=1684837426; x=1687429426; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=VKd4mbZB95JVeKTC9AZrPuRykvAxT+a5FGJ77eUJ0QY=; b=NbKUXVLoJHPj4dxpInpKvPSGCXQWsD2iIawVM2CaxZ4LlWlvpD4wc0HQtZsY6SESPW y7P/mCwUXLlSim5Grb0nANc29uFc4mTDKKBguCxvM0VaLf5fhMd8al+pPMV20CLXHP7e 7YpJ0WyT2qX4Nj6Xgbi2MQ/y+pZ8X49kmPVmU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684837426; x=1687429426; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VKd4mbZB95JVeKTC9AZrPuRykvAxT+a5FGJ77eUJ0QY=; b=H/k3UeqR27pC/VdByaWxTmaiDPriJXgDktPDH3r4pSl+o4LmeDrB93ZzQKSpnkxMfU J+ZlBVZbgr+xqdhzSTwZWI5AhEyoaTtmaxCLOrE4TRtVvooHscfE/Sm65mDouBcG0Epl teVskEYoPhzS26TkvD0sP88jHMEQ8toR2kPBsIVlqy73QVJx6JfS4SFxH2wWEwi1vQhd +EQWVFZkSj5QpuB2g6Wy/s339UxKjhm7BV8+5mDRzKsgH25apoh2oBvITaHH+1/ZW71y evzmjfra+nSQDhwJpww2dRIssJmHqrS9UaWqAfNPCdUbWh2tTZg9CULYBo7Co9U8DuS0 HBDg== X-Gm-Message-State: AC+VfDwdapDyqhcD+L4PpJGlnF6fnBhwWp2huzLHulTRzRHlPS5wtQU+ AVkp4KvP1uVo8nP6hS1DBMIKBArX0dj6tMV594yM2sJeaV6+uVsW X-Google-Smtp-Source: ACHHUZ5o7qh8aDVPy2KBXw4cN7BYLih8fBxnsJnYlkL8utLpKPHXNO3PmEsBsXnPHWCKDogtjdqMFH3DRLKLBJqKpo0= X-Received: by 2002:a67:d00b:0:b0:437:cd45:ba5f with SMTP id r11-20020a67d00b000000b00437cd45ba5fmr3730916vsi.24.1684837426055; Tue, 23 May 2023 03:23:46 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202304041231.334CVktq013660@gitrepo.freebsd.org> In-Reply-To: From: Randall Stewart Date: Tue, 23 May 2023 06:23:35 -0400 Message-ID: Subject: Re: git: 73ee5756dee6 - main - Fixes in the tcp infrastructure with respect to stack changes as well as other infrastructure updates for incoming rack features. To: antoine@freebsd.org Cc: Randall Stewart , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, src-committers@freebsd.org Content-Type: multipart/alternative; boundary="00000000000048f88a05fc59c8a1" X-Spamd-Result: default: False [-14.00 / 15.00]; WHITELIST_DMARC(-7.00)[netflix.com:D:+]; WHITELIST_SPF_DKIM(-3.00)[netflix.com:d:+,netflix.com:s:+]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; DMARC_POLICY_ALLOW(-0.50)[netflix.com,reject]; R_DKIM_ALLOW(-0.20)[netflix.com:s=google]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::e31:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[rrs]; DKIM_TRACE(0.00)[netflix.com:+]; TO_DN_SOME(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Queue-Id: 4QQVln2S9hz3Gqr X-Spamd-Bar: ------------- X-ThisMailContainsUnwantedMimeParts: N --00000000000048f88a05fc59c8a1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable It is an interface so hidden it would be useless. Though Michael=E2=80=99s suggestion should work ie tcp_xxx R On Sun, May 21, 2023 at 3:01 PM Antoine Brodin wrote: > On Tue, Apr 4, 2023 at 12:31=E2=80=AFPM Randall Stewart = wrote: > > > > The branch main has been updated by rrs: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D73ee5756dee6b2110eb6fb2b2ef3cde= 39a1fcb4f > > > > commit 73ee5756dee6b2110eb6fb2b2ef3cde39a1fcb4f > > Author: Randall Stewart > > AuthorDate: 2023-04-01 05:46:38 +0000 > > Commit: Randall Stewart > > CommitDate: 2023-04-01 05:46:38 +0000 > > > > Fixes in the tcp infrastructure with respect to stack changes as > well as other infrastructure updates for incoming rack features. > > > > So stack switching as always been a bit of a issue. We currently us= e > a break before make setup which means that > > if something goes wrong you have to try to get back to a stack. Thi= s > patch among a lot of other things changes that so > > that it is a make before break. We also expand some of the function > blocks in prep for new features in rack that will allow > > more controlled pacing. We also add other abilities such as the > pathway for a stack to query a previous stack to acquire from > > it critical state information so things in flight don't get dropped > or mis-handled when switching stacks. We also add the > > concept of a timer granularity. This allows an alternate stack to > change from the old ticks granularity to microseconds and > > of course this even gives us a pathway to go to nanosecond > timekeeping if we need to (something for the data center to consider > > for sure). > > > > Once all this lands I will then update rack to begin using all thes= e > new features. > > > > Reviewed by: tuexen > > Sponsored by: Netflix Inc > > Differential Revision: https://reviews.freebsd.org/D39210 > > Hi, > > Could you hide some stuff in netinet/tcp.h? > struct http_req breaks curl 8.1.0. > > Antoine > --=20 --- Randall Stewart rrs@netflix.com --00000000000048f88a05fc59c8a1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
It is an interface so hidden it would be useless. Though = Michael=E2=80=99s suggestion should work ie tcp_xxx
=
R

On Sun, May 21, 2023 at 3:01 PM Antoine B= rodin <antoine@freebsd.org>= ; wrote:
On Tue, Apr 4, 2023 at 12:= 31=E2=80=AFPM Randall Stewart <rrs@freebsd.org> wrote:
>
> The branch main has been updated by rrs:
>
> URL: https://= cgit.FreeBSD.org/src/commit/?id=3D73ee5756dee6b2110eb6fb2b2ef3cde39a1fcb4f<= /a>
>
> commit 73ee5756dee6b2110eb6fb2b2ef3cde39a1fcb4f
> Author:=C2=A0 =C2=A0 =C2=A0Randall Stewart <rrs@FreeBSD.org>
> AuthorDate: 2023-04-01 05:46:38 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Randall Stewart <rrs@FreeBSD.org>
> CommitDate: 2023-04-01 05:46:38 +0000
>
>=C2=A0 =C2=A0 =C2=A0Fixes in the tcp infrastructure with respect to sta= ck changes as well as other infrastructure updates for incoming rack featur= es.
>
>=C2=A0 =C2=A0 =C2=A0So stack switching as always been a bit of a issue.= We currently use a break before make setup which means that
>=C2=A0 =C2=A0 =C2=A0if something goes wrong you have to try to get back= to a stack. This patch among a lot of other things changes that so
>=C2=A0 =C2=A0 =C2=A0that it is a make before break. We also expand some= of the function blocks in prep for new features in rack that will allow >=C2=A0 =C2=A0 =C2=A0more controlled pacing. We also add other abilities= such as the pathway for a stack to query a previous stack to acquire from<= br> >=C2=A0 =C2=A0 =C2=A0it critical state information so things in flight d= on't get dropped or mis-handled when switching stacks. We also add the<= br> >=C2=A0 =C2=A0 =C2=A0concept of a timer granularity. This allows an alte= rnate stack to change from the old ticks granularity to microseconds and >=C2=A0 =C2=A0 =C2=A0of course this even gives us a pathway to go to nan= osecond timekeeping if we need to (something for the data center to conside= r
>=C2=A0 =C2=A0 =C2=A0for sure).
>
>=C2=A0 =C2=A0 =C2=A0Once all this lands I will then update rack to begi= n using all these new features.
>
>=C2=A0 =C2=A0 =C2=A0Reviewed by: tuexen
>=C2=A0 =C2=A0 =C2=A0Sponsored by: Netflix Inc
>=C2=A0 =C2=A0 =C2=A0Differential Revision:
https://reviews.fre= ebsd.org/D39210

Hi,

Could you hide some stuff in netinet/tcp.h?
struct http_req breaks curl 8.1.0.

Antoine
-- <= br>
---
Randall Stewart
--00000000000048f88a05fc59c8a1-- From nobody Tue May 23 11:34:32 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQXKW1mTHz4CN6S; Tue, 23 May 2023 11:34: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 4QQXKW02CKz3hGF; Tue, 23 May 2023 11:34:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684841679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fC+34Uv2zh1JkpYCnZOlFH2QOX6dWhECNKYpZtJPZJE=; b=u2g2406g8goA9dcW/RyqMnCgaeTbY1wWHPnVdxWFoD7V5u58zumMSFEWl2TLYe54+TCqt3 Vkx4FtA4FBlCuzqBDVdk8B1NWH7QkWq4ILnL9VzV6OgJ32DOHOxiJUI8oO7969OGlCXFGa InTFpLVBqPoUvkWG+fxtN8ayjmsKw+hkYXwz05066Q3X2hMYCLjJKsVMphY0y5R39O88Lj AKnVsgMosJhw4UMPpHPPHp/tCUii/Uf0JkKWkwa0CVfh5yEDFGDbb9e/SfvfKDXZMYmNwi 4TuXkpb4Y12TgctWXINj3jQ7uQCvFQs/X7aznfDV3cN99Xb9d0icfcCEp8w2Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684841679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fC+34Uv2zh1JkpYCnZOlFH2QOX6dWhECNKYpZtJPZJE=; b=cB7+pTFEoWbPlCxQ1a0VWQB5UjEaxLuLxXH8IvLdxcEsrYCy+xWviROGyiW8J6PgHFWs5h ys64T8o6wcocvKTISCnuESlBYQpAnQRTGzItPGq0j3cZX7dKHdlUCViCzaFJhBZ7xgaTbT ZP0PHdx+ROnLMhhM+tP863IBpCsaKeNbHMjxfJxM5Ngz0XK4UQekp/EGQn8Bq8CdcezURD Fa+sfJ89oPA2IK0MLSIoeF6aAXkMHBN/42ytFGo2iYGey68CMjgdIr24rWX4djlmQaj3sE Ex+ZZIMPeiMnouvgLhBJOLgvVKLk92czXPn4mUhJ+JAn/N2WbRC9hH43HNj7MA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684841679; a=rsa-sha256; cv=none; b=wMI6u4KNlUn5n71hVYA4q0vhlTLgICB8ohqhpQqkHY+wGjdOgVf3tyXl2bXVL+1Hb0hAlV K7RjOwZcfZHI1lJmdZQB9kJ6AVuEk7/ZbEVGyqOQ2WqScKp9T7EYhauD4sI4rPv1SwDgsW Y0TXVKTMfPDO0FE6GL6eWCoghUQXAya6R1xYhj+YypF+MRupFq4KJlMbtBjSBZ1vz7+c/h 2ZjLzH6V5CWZy7Itffl1H9C6CVT5VC5DXw8V9fbPS2sD4qsU4DlLeAAILtPv77d5PFxsT1 TaCbdd35FnFdWv+W2CwYMQ9zacsX2IopN+V0JVOMC9cLmdrOF+WJn5eFskIiTg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQXKV6Ct4zy1w; Tue, 23 May 2023 11:34: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 34NBYcM2034500; Tue, 23 May 2023 11:34:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NBYWox034484; Tue, 23 May 2023 11:34:32 GMT (envelope-from git) Date: Tue, 23 May 2023 11:34:32 GMT Message-Id: <202305231134.34NBYWox034484@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: c0a83fe074a3 - main - zfs: merge openzfs/zfs@ad0a55461 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c0a83fe074a375c66ca669bfe1f128fe12b9f377 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=c0a83fe074a375c66ca669bfe1f128fe12b9f377 commit c0a83fe074a375c66ca669bfe1f128fe12b9f377 Merge: 634a770a5e16 ad0a554614b0 Author: Martin Matuska AuthorDate: 2023-05-23 09:50:17 +0000 Commit: Martin Matuska CommitDate: 2023-05-23 09:51:52 +0000 zfs: merge openzfs/zfs@ad0a55461 Notable upstream pull request merges: #12355 Teach zpool scrub to scrub only blocks in error log #14811 Refine special_small_blocks property validation #14854 zil: Some micro-optimizations #14855 zil: Free lwb_buf after write completion #14860 Fixes for issues identified by recent Coverity defect reports #14861 Probe vdevs before marking removed #14873 Add the ability to uninitialize a zpool #14875 Hold db_mtx when updating db_state Obtained from: OpenZFS OpenZFS commit: ad0a554614b096698d9969340c4c593690042d5b sys/contrib/openzfs/cmd/zed/agents/zfs_retire.c | 8 +- sys/contrib/openzfs/cmd/zpool/zpool_main.c | 133 +++- sys/contrib/openzfs/include/libzfs.h | 3 + sys/contrib/openzfs/include/libzfs_core.h | 2 + sys/contrib/openzfs/include/sys/dmu.h | 1 + sys/contrib/openzfs/include/sys/dsl_scan.h | 27 +- sys/contrib/openzfs/include/sys/fs/zfs.h | 20 +- sys/contrib/openzfs/include/sys/spa.h | 8 + sys/contrib/openzfs/include/sys/spa_impl.h | 4 + .../openzfs/include/sys/sysevent/eventdefs.h | 5 + sys/contrib/openzfs/include/sys/vdev_initialize.h | 1 + sys/contrib/openzfs/lib/libzfs/libzfs.abi | 6 +- sys/contrib/openzfs/lib/libzfs/libzfs_dataset.c | 8 +- sys/contrib/openzfs/lib/libzfs/libzfs_pool.c | 120 +++- sys/contrib/openzfs/lib/libzfs/libzfs_util.c | 14 +- .../openzfs/lib/libzfs_core/libzfs_core.abi | 108 +++- sys/contrib/openzfs/lib/libzfs_core/libzfs_core.c | 7 + sys/contrib/openzfs/man/man4/zfs.4 | 3 + sys/contrib/openzfs/man/man8/zpool-initialize.8 | 10 +- sys/contrib/openzfs/man/man8/zpool-scrub.8 | 19 + sys/contrib/openzfs/module/zfs/dbuf.c | 6 +- sys/contrib/openzfs/module/zfs/dsl_scan.c | 696 ++++++++++++++++++++- sys/contrib/openzfs/module/zfs/spa.c | 21 +- sys/contrib/openzfs/module/zfs/spa_errlog.c | 84 ++- sys/contrib/openzfs/module/zfs/spa_misc.c | 25 +- sys/contrib/openzfs/module/zfs/vdev.c | 11 +- sys/contrib/openzfs/module/zfs/vdev_initialize.c | 66 +- sys/contrib/openzfs/module/zfs/zfs_ioctl.c | 49 +- sys/contrib/openzfs/module/zfs/zil.c | 93 +-- sys/contrib/openzfs/tests/runfiles/common.run | 7 +- .../tests/test-runner/bin/test-runner.py.in | 38 +- .../openzfs/tests/test-runner/bin/zts-report.py.in | 1 + .../tests/zfs-tests/cmd/libzfs_input_check.c | 15 + .../openzfs/tests/zfs-tests/include/libtest.shlib | 18 + .../openzfs/tests/zfs-tests/tests/Makefile.am | 7 + .../functional/alloc_class/alloc_class_014_neg.ksh | 38 ++ .../functional/alloc_class/alloc_class_015_pos.ksh | 45 ++ .../zpool_initialize/zpool_initialize_uninit.ksh | 141 +++++ .../zpool_scrub/zpool_error_scrub_001_pos.ksh | 79 +++ .../zpool_scrub/zpool_error_scrub_002_pos.ksh | 99 +++ .../zpool_scrub/zpool_error_scrub_003_pos.ksh | 109 ++++ .../zpool_scrub/zpool_error_scrub_004_pos.ksh | 54 ++ sys/modules/zfs/zfs_config.h | 4 +- sys/modules/zfs/zfs_gitrev.h | 2 +- 44 files changed, 2031 insertions(+), 184 deletions(-) diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/alloc_class/alloc_class_014_neg.ksh index 000000000000,1b52014fd2d9..1b52014fd2d9 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/alloc_class/alloc_class_014_neg.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/alloc_class/alloc_class_014_neg.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/alloc_class/alloc_class_015_pos.ksh index 000000000000,49c468af6702..49c468af6702 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/alloc_class/alloc_class_015_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/alloc_class/alloc_class_015_pos.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_uninit.ksh index 000000000000,17f776cfbc20..17f776cfbc20 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_uninit.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_uninit.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_001_pos.ksh index 000000000000,e414cd1beaad..e414cd1beaad mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_001_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_001_pos.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_002_pos.ksh index 000000000000,daa11c3949c6..daa11c3949c6 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_002_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_002_pos.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_003_pos.ksh index 000000000000,d0066fdbb4a3..d0066fdbb4a3 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_003_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_003_pos.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_004_pos.ksh index 000000000000,c88b9b0c8d33..c88b9b0c8d33 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_004_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zpool_scrub/zpool_error_scrub_004_pos.ksh diff --cc sys/modules/zfs/zfs_config.h index ec45185797b4,000000000000..d0ad587ed327 mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,1087 -1,0 +1,1087 @@@ +/* + * $FreeBSD$ + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* bio_end_io_t wants 1 arg */ +/* #undef HAVE_1ARG_BIO_END_IO_T */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* submit_bio() wants 1 arg */ +/* #undef HAVE_1ARG_SUBMIT_BIO */ + +/* bdi_setup_and_register() wants 2 args */ +/* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 2 args */ +/* #undef HAVE_2ARGS_VFS_GETATTR */ + +/* zlib_deflate_workspacesize() wants 2 args */ +/* #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */ + +/* bdi_setup_and_register() wants 3 args */ +/* #undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 3 args */ +/* #undef HAVE_3ARGS_VFS_GETATTR */ + +/* vfs_getattr wants 4 args */ +/* #undef HAVE_4ARGS_VFS_GETATTR */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* posix_acl has refcount_t */ +/* #undef HAVE_ACL_REFCOUNT */ + +/* add_disk() returns int */ +/* #undef HAVE_ADD_DISK_RET */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +/* Define if you have [rt] */ +#define HAVE_AIO_H 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* bdevname() is available */ +/* #undef HAVE_BDEVNAME */ + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_63 */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_OLD */ + +/* bdev_kobj() exists */ +/* #undef HAVE_BDEV_KOBJ */ + +/* bdev_max_discard_sectors() is available */ +/* #undef HAVE_BDEV_MAX_DISCARD_SECTORS */ + +/* bdev_max_secure_erase_sectors() is available */ +/* #undef HAVE_BDEV_MAX_SECURE_ERASE_SECTORS */ + +/* block_device_operations->submit_bio() returns void */ +/* #undef HAVE_BDEV_SUBMIT_BIO_RETURNS_VOID */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio_alloc() takes 4 arguments */ +/* #undef HAVE_BIO_ALLOC_4ARG */ + +/* bio->bi_bdev->bd_disk exists */ +/* #undef HAVE_BIO_BDEV_DISK */ + +/* bio->bi_opf is defined */ +/* #undef HAVE_BIO_BI_OPF */ + +/* bio->bi_status exists */ +/* #undef HAVE_BIO_BI_STATUS */ + +/* bio has bi_iter */ +/* #undef HAVE_BIO_BVEC_ITER */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_max_segs() is implemented */ +/* #undef HAVE_BIO_MAX_SEGS */ + +/* bio_set_dev() is available */ +/* #undef HAVE_BIO_SET_DEV */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_dev() is a macro */ +/* #undef HAVE_BIO_SET_DEV_MACRO */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_get_by_path() handles ERESTARTSYS */ +/* #undef HAVE_BLKDEV_GET_ERESTARTSYS */ + +/* blkdev_issue_discard() is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD */ + +/* blkdev_issue_secure_erase() is available */ +/* #undef HAVE_BLKDEV_ISSUE_SECURE_ERASE */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + +/* blk_alloc_disk() exists */ +/* #undef HAVE_BLK_ALLOC_DISK */ + +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk_cleanup_disk() exists */ +/* #undef HAVE_BLK_CLEANUP_DISK */ + +/* block multiqueue is available */ +/* #undef HAVE_BLK_MQ */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_discard() is available */ +/* #undef HAVE_BLK_QUEUE_DISCARD */ + +/* blk_queue_flag_clear() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_CLEAR */ + +/* blk_queue_flag_set() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_SET */ + +/* blk_queue_flush() is available */ +/* #undef HAVE_BLK_QUEUE_FLUSH */ + +/* blk_queue_flush() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY */ + +/* blk_queue_secdiscard() is available */ +/* #undef HAVE_BLK_QUEUE_SECDISCARD */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + +/* blk_queue_update_readahead() exists */ +/* #undef HAVE_BLK_QUEUE_UPDATE_READAHEAD */ + +/* blk_queue_write_cache() exists */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE */ + +/* blk_queue_write_cache() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY */ + +/* Define if revalidate_disk() in block_device_operations */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK */ + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + +/* clear_inode() is available */ +/* #undef HAVE_CLEAR_INODE */ + +/* dentry uses const struct dentry_operations */ +/* #undef HAVE_CONST_DENTRY_OPERATIONS */ + +/* copy_from_iter() is available */ +/* #undef HAVE_COPY_FROM_ITER */ + +/* copy_to_iter() is available */ +/* #undef HAVE_COPY_TO_ITER */ + +/* cpu_has_feature() is GPL-only */ +/* #undef HAVE_CPU_HAS_FEATURE_GPL_ONLY */ + +/* yes */ +/* #undef HAVE_CPU_HOTPLUG */ + +/* current_time() exists */ +/* #undef HAVE_CURRENT_TIME */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* DECLARE_EVENT_CLASS() is available */ +/* #undef HAVE_DECLARE_EVENT_CLASS */ + +/* dentry aliases are in d_u member */ +/* #undef HAVE_DENTRY_D_U_ALIASES */ + +/* dequeue_signal() takes 4 arguments */ +/* #undef HAVE_DEQUEUE_SIGNAL_4ARG */ + +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + +/* sops->dirty_inode() wants flags */ +/* #undef HAVE_DIRTY_INODE_WITH_FLAGS */ + +/* disk_*_io_acct() available */ +/* #undef HAVE_DISK_IO_ACCT */ + +/* disk_update_readahead() exists */ +/* #undef HAVE_DISK_UPDATE_READAHEAD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* d_make_root() is available */ +/* #undef HAVE_D_MAKE_ROOT */ + +/* d_prune_aliases() is available */ +/* #undef HAVE_D_PRUNE_ALIASES */ + +/* dops->d_revalidate() operation takes nameidata */ +/* #undef HAVE_D_REVALIDATE_NAMEIDATA */ + +/* eops->encode_fh() wants child and parent inodes */ +/* #undef HAVE_ENCODE_FH_WITH_INODE */ + +/* sops->evict_inode() exists */ +/* #undef HAVE_EVICT_INODE */ + +/* FALLOC_FL_ZERO_RANGE is defined */ +/* #undef HAVE_FALLOC_FL_ZERO_RANGE */ + +/* fault_in_iov_iter_readable() is available */ +/* #undef HAVE_FAULT_IN_IOV_ITER_READABLE */ + +/* filemap_range_has_page() is available */ +/* #undef HAVE_FILEMAP_RANGE_HAS_PAGE */ + +/* fops->aio_fsync() exists */ +/* #undef HAVE_FILE_AIO_FSYNC */ + +/* file_dentry() is available */ +/* #undef HAVE_FILE_DENTRY */ + +/* fops->fadvise() exists */ +/* #undef HAVE_FILE_FADVISE */ + +/* file_inode() is available */ +/* #undef HAVE_FILE_INODE */ + +/* flush_dcache_page() is GPL-only */ +/* #undef HAVE_FLUSH_DCACHE_PAGE_GPL_ONLY */ + +/* iops->follow_link() cookie */ +/* #undef HAVE_FOLLOW_LINK_COOKIE */ + +/* iops->follow_link() nameidata */ +/* #undef HAVE_FOLLOW_LINK_NAMEIDATA */ + +/* Define if compiler supports -Wformat-overflow */ +/* #undef HAVE_FORMAT_OVERFLOW */ + +/* fops->fsync() with range */ +/* #undef HAVE_FSYNC_RANGE */ + +/* fops->fsync() without dentry */ +/* #undef HAVE_FSYNC_WITHOUT_DENTRY */ + +/* yes */ +/* #undef HAVE_GENERIC_FADVISE */ + +/* generic_fillattr requires struct mnt_idmap* */ +/* #undef HAVE_GENERIC_FILLATTR_IDMAP */ + +/* generic_fillattr requires struct user_namespace* */ +/* #undef HAVE_GENERIC_FILLATTR_USERNS */ + +/* generic_*_io_acct() 3 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_3ARG */ + +/* generic_*_io_acct() 4 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_4ARG */ + +/* generic_readlink is global */ +/* #undef HAVE_GENERIC_READLINK */ + +/* generic_setxattr() exists */ +/* #undef HAVE_GENERIC_SETXATTR */ + +/* generic_write_checks() takes kiocb */ +/* #undef HAVE_GENERIC_WRITE_CHECKS_KIOCB */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* iops->get_acl() exists */ +/* #undef HAVE_GET_ACL */ + +/* iops->get_acl() takes rcu */ +/* #undef HAVE_GET_ACL_RCU */ + +/* has iops->get_inode_acl() */ +/* #undef HAVE_GET_INODE_ACL */ + +/* iops->get_link() cookie */ +/* #undef HAVE_GET_LINK_COOKIE */ + +/* iops->get_link() delayed */ +/* #undef HAVE_GET_LINK_DELAYED */ + +/* group_info->gid exists */ +/* #undef HAVE_GROUP_INFO_GID */ + +/* has_capability() is available */ +/* #undef HAVE_HAS_CAPABILITY */ + +/* iattr->ia_vfsuid and iattr->ia_vfsgid exist */ +/* #undef HAVE_IATTR_VFSID */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* iops->getattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_GETATTR */ + +/* iops->setattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_SETATTR */ + +/* APIs for idmapped mount are present */ +/* #undef HAVE_IDMAP_MNT_API */ + +/* Define if compiler supports -Wimplicit-fallthrough */ +/* #undef HAVE_IMPLICIT_FALLTHROUGH */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_INFINITE_RECURSION */ + +/* yes */ +/* #undef HAVE_INODE_LOCK_SHARED */ + +/* inode_owner_or_capable() exists */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE */ + +/* inode_owner_or_capable() takes mnt_idmap */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_IDMAP */ + +/* inode_owner_or_capable() takes user_ns */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_USERNS */ + +/* inode_set_flags() exists */ +/* #undef HAVE_INODE_SET_FLAGS */ + +/* inode_set_iversion() exists */ +/* #undef HAVE_INODE_SET_IVERSION */ + +/* inode->i_*time's are timespec64 */ +/* #undef HAVE_INODE_TIMESPEC64_TIMES */ + +/* timestamp_truncate() exists */ +/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* in_compat_syscall() is available */ +/* #undef HAVE_IN_COMPAT_SYSCALL */ + +/* iops->create() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_CREATE_IDMAP */ + +/* iops->create() takes struct user_namespace* */ +/* #undef HAVE_IOPS_CREATE_USERNS */ + +/* iops->mkdir() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_MKDIR_IDMAP */ + +/* iops->mkdir() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKDIR_USERNS */ + +/* iops->mknod() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_MKNOD_IDMAP */ + +/* iops->mknod() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKNOD_USERNS */ + +/* iops->permission() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_PERMISSION_IDMAP */ + +/* iops->permission() takes struct user_namespace* */ +/* #undef HAVE_IOPS_PERMISSION_USERNS */ + +/* iops->rename() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_RENAME_IDMAP */ + +/* iops->rename() takes struct user_namespace* */ +/* #undef HAVE_IOPS_RENAME_USERNS */ + +/* iops->setattr() exists */ +/* #undef HAVE_IOPS_SETATTR */ + +/* iops->symlink() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_SYMLINK_IDMAP */ + +/* iops->symlink() takes struct user_namespace* */ +/* #undef HAVE_IOPS_SYMLINK_USERNS */ + +/* iov_iter_advance() is available */ +/* #undef HAVE_IOV_ITER_ADVANCE */ + +/* iov_iter_count() is available */ +/* #undef HAVE_IOV_ITER_COUNT */ + +/* iov_iter_fault_in_readable() is available */ +/* #undef HAVE_IOV_ITER_FAULT_IN_READABLE */ + +/* iov_iter_revert() is available */ +/* #undef HAVE_IOV_ITER_REVERT */ + +/* iov_iter_type() is available */ +/* #undef HAVE_IOV_ITER_TYPE */ + +/* iov_iter types are available */ +/* #undef HAVE_IOV_ITER_TYPES */ + +/* yes */ +/* #undef HAVE_IO_SCHEDULE_TIMEOUT */ + +/* Define to 1 if you have the `issetugid' function. */ +#define HAVE_ISSETUGID 1 + +/* kernel has kernel_fpu_* functions */ +/* #undef HAVE_KERNEL_FPU */ + +/* kernel has asm/fpu/api.h */ +/* #undef HAVE_KERNEL_FPU_API_HEADER */ + +/* kernel fpu internal */ +/* #undef HAVE_KERNEL_FPU_INTERNAL */ + +/* kernel has asm/fpu/internal.h */ +/* #undef HAVE_KERNEL_FPU_INTERNAL_HEADER */ + +/* uncached_acl_sentinel() exists */ +/* #undef HAVE_KERNEL_GET_ACL_HANDLE_CACHE */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_KERNEL_INFINITE_RECURSION */ + +/* kernel does stack verification */ +/* #undef HAVE_KERNEL_OBJTOOL */ + +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + +/* kernel_read() take loff_t pointer */ +/* #undef HAVE_KERNEL_READ_PPOS */ + +/* timer_list.function gets a timer_list */ +/* #undef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST */ + +/* struct timer_list has a flags member */ +/* #undef HAVE_KERNEL_TIMER_LIST_FLAGS */ + +/* timer_setup() is available */ +/* #undef HAVE_KERNEL_TIMER_SETUP */ + +/* kernel_write() take loff_t pointer */ +/* #undef HAVE_KERNEL_WRITE_PPOS */ + +/* kmem_cache_create_usercopy() exists */ +/* #undef HAVE_KMEM_CACHE_CREATE_USERCOPY */ + +/* kstrtoul() exists */ +/* #undef HAVE_KSTRTOUL */ + +/* ktime_get_coarse_real_ts64() exists */ +/* #undef HAVE_KTIME_GET_COARSE_REAL_TS64 */ + +/* ktime_get_raw_ts64() exists */ +/* #undef HAVE_KTIME_GET_RAW_TS64 */ + +/* kvmalloc exists */ +/* #undef HAVE_KVMALLOC */ + +/* Define if you have [aio] */ +/* #undef HAVE_LIBAIO */ + +/* Define if you have [blkid] */ +/* #undef HAVE_LIBBLKID */ + +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 + +/* Define if you have [tirpc] */ +/* #undef HAVE_LIBTIRPC */ + +/* Define if you have [udev] */ +/* #undef HAVE_LIBUDEV */ + +/* Define if you have [uuid] */ +/* #undef HAVE_LIBUUID */ + +/* linux/blk-cgroup.h exists */ +/* #undef HAVE_LINUX_BLK_CGROUP_HEADER */ + +/* lseek_execute() is available */ +/* #undef HAVE_LSEEK_EXECUTE */ + +/* makedev() is declared in sys/mkdev.h */ +/* #undef HAVE_MAKEDEV_IN_MKDEV */ + +/* makedev() is declared in sys/sysmacros.h */ +/* #undef HAVE_MAKEDEV_IN_SYSMACROS */ + +/* Noting that make_request_fn() returns blk_qc_t */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_QC */ + +/* Noting that make_request_fn() returns void */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_VOID */ + +/* iops->mkdir() takes umode_t */ +/* #undef HAVE_MKDIR_UMODE_T */ + +/* Define to 1 if you have the `mlockall' function. */ +#define HAVE_MLOCKALL 1 + +/* lookup_bdev() wants mode arg */ +/* #undef HAVE_MODE_LOOKUP_BDEV */ + +/* Define if host toolchain supports MOVBE */ +#define HAVE_MOVBE 1 + +/* new_sync_read()/new_sync_write() are available */ +/* #undef HAVE_NEW_SYNC_READ */ + +/* folio_wait_bit() exists */ +/* #undef HAVE_PAGEMAP_FOLIO_WAIT_BIT */ + +/* part_to_dev() exists */ +/* #undef HAVE_PART_TO_DEV */ + +/* iops->getattr() takes a path */ +/* #undef HAVE_PATH_IOPS_GETATTR */ + +/* Define if host toolchain supports PCLMULQDQ */ +#define HAVE_PCLMULQDQ 1 + +/* percpu_counter_add_batch() is defined */ +/* #undef HAVE_PERCPU_COUNTER_ADD_BATCH */ + +/* percpu_counter_init() wants gfp_t */ +/* #undef HAVE_PERCPU_COUNTER_INIT_WITH_GFP */ + +/* posix_acl_chmod() exists */ +/* #undef HAVE_POSIX_ACL_CHMOD */ + +/* posix_acl_from_xattr() needs user_ns */ +/* #undef HAVE_POSIX_ACL_FROM_XATTR_USERNS */ + +/* posix_acl_release() is available */ +/* #undef HAVE_POSIX_ACL_RELEASE */ + +/* posix_acl_release() is GPL-only */ +/* #undef HAVE_POSIX_ACL_RELEASE_GPL_ONLY */ + +/* posix_acl_valid() wants user namespace */ +/* #undef HAVE_POSIX_ACL_VALID_WITH_NS */ + +/* proc_ops structure exists */ +/* #undef HAVE_PROC_OPS_STRUCT */ + +/* iops->put_link() cookie */ +/* #undef HAVE_PUT_LINK_COOKIE */ + +/* iops->put_link() delayed */ +/* #undef HAVE_PUT_LINK_DELAYED */ + +/* iops->put_link() nameidata */ +/* #undef HAVE_PUT_LINK_NAMEIDATA */ + +/* If available, contains the Python version number currently in use. */ +#define HAVE_PYTHON "3.7" + +/* qat is enabled and existed */ +/* #undef HAVE_QAT */ + +/* register_shrinker is vararg */ +/* #undef HAVE_REGISTER_SHRINKER_VARARG */ + +/* iops->rename2() exists */ +/* #undef HAVE_RENAME2 */ + +/* struct inode_operations_wrapper takes .rename2() */ +/* #undef HAVE_RENAME2_OPERATIONS_WRAPPER */ + +/* iops->rename() wants flags */ +/* #undef HAVE_RENAME_WANTS_FLAGS */ + +/* REQ_DISCARD is defined */ +/* #undef HAVE_REQ_DISCARD */ + +/* REQ_FLUSH is defined */ +/* #undef HAVE_REQ_FLUSH */ + +/* REQ_OP_DISCARD is defined */ +/* #undef HAVE_REQ_OP_DISCARD */ + +/* REQ_OP_FLUSH is defined */ +/* #undef HAVE_REQ_OP_FLUSH */ + +/* REQ_OP_SECURE_ERASE is defined */ +/* #undef HAVE_REQ_OP_SECURE_ERASE */ + +/* REQ_PREFLUSH is defined */ +/* #undef HAVE_REQ_PREFLUSH */ + +/* revalidate_disk() is available */ +/* #undef HAVE_REVALIDATE_DISK */ + +/* revalidate_disk_size() is available */ +/* #undef HAVE_REVALIDATE_DISK_SIZE */ + +/* struct rw_semaphore has member activity */ +/* #undef HAVE_RWSEM_ACTIVITY */ + +/* struct rw_semaphore has atomic_long_t member count */ +/* #undef HAVE_RWSEM_ATOMIC_LONG_COUNT */ + +/* linux/sched/signal.h exists */ +/* #undef HAVE_SCHED_SIGNAL_HEADER */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SECURITY_PAM_MODULES_H 1 + +/* setattr_prepare() accepts mnt_idmap */ +/* #undef HAVE_SETATTR_PREPARE_IDMAP */ + +/* setattr_prepare() is available, doesn't accept user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_NO_USERNS */ + +/* setattr_prepare() accepts user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_USERNS */ + +/* iops->set_acl() exists, takes 3 args */ +/* #undef HAVE_SET_ACL */ + +/* iops->set_acl() takes 4 args, arg1 is struct mnt_idmap * */ +/* #undef HAVE_SET_ACL_IDMAP_DENTRY */ + +/* iops->set_acl() takes 4 args */ +/* #undef HAVE_SET_ACL_USERNS */ + +/* iops->set_acl() takes 4 args, arg2 is struct dentry * */ +/* #undef HAVE_SET_ACL_USERNS_DENTRY_ARG2 */ + +/* set_cached_acl() is usable */ +/* #undef HAVE_SET_CACHED_ACL_USABLE */ + +/* set_special_state() exists */ +/* #undef HAVE_SET_SPECIAL_STATE */ + +/* struct shrink_control exists */ +/* #undef HAVE_SHRINK_CONTROL_STRUCT */ + +/* kernel_siginfo_t exists */ +/* #undef HAVE_SIGINFO */ + +/* signal_stop() exists */ +/* #undef HAVE_SIGNAL_STOP */ + +/* new shrinker callback wants 2 args */ +/* #undef HAVE_SINGLE_SHRINKER_CALLBACK */ + +/* cs->count_objects exists */ +/* #undef HAVE_SPLIT_SHRINKER_CALLBACK */ + +#if defined(__amd64__) || defined(__i386__) +/* Define if host toolchain supports SSE */ +#define HAVE_SSE 1 + +/* Define if host toolchain supports SSE2 */ +#define HAVE_SSE2 1 + +/* Define if host toolchain supports SSE3 */ +#define HAVE_SSE3 1 + +/* Define if host toolchain supports SSE4.1 */ +#define HAVE_SSE4_1 1 + +/* Define if host toolchain supports SSE4.2 */ +#define HAVE_SSE4_2 1 + +/* Define if host toolchain supports SSSE3 */ +#define HAVE_SSSE3 1 +#endif + +/* STACK_FRAME_NON_STANDARD is defined */ +/* #undef HAVE_STACK_FRAME_NON_STANDARD */ + +/* standalone exists */ +/* #undef HAVE_STANDALONE_LINUX_STDARG */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlcat' function. */ +#define HAVE_STRLCAT 1 + +/* Define to 1 if you have the `strlcpy' function. */ +#define HAVE_STRLCPY 1 + +/* submit_bio is member of struct block_device_operations */ +/* #undef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */ + +/* super_setup_bdi_name() exits */ +/* #undef HAVE_SUPER_SETUP_BDI_NAME */ + +/* super_block->s_user_ns exists */ +/* #undef HAVE_SUPER_USER_NS */ + +/* struct kobj_type has default_groups */ +/* #undef HAVE_SYSFS_DEFAULT_GROUPS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* i_op->tmpfile() exists */ +/* #undef HAVE_TMPFILE */ + +/* i_op->tmpfile() uses old dentry signature */ +/* #undef HAVE_TMPFILE_DENTRY */ + +/* i_op->tmpfile() has mnt_idmap */ +/* #undef HAVE_TMPFILE_IDMAP */ + +/* i_op->tmpfile() has userns */ +/* #undef HAVE_TMPFILE_USERNS */ + +/* totalhigh_pages() exists */ +/* #undef HAVE_TOTALHIGH_PAGES */ + +/* kernel has totalram_pages() */ +/* #undef HAVE_TOTALRAM_PAGES_FUNC */ + +/* Define to 1 if you have the `udev_device_get_is_initialized' function. */ +/* #undef HAVE_UDEV_DEVICE_GET_IS_INITIALIZED */ + +/* kernel has __kernel_fpu_* functions */ +/* #undef HAVE_UNDERSCORE_KERNEL_FPU */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* iops->getattr() takes struct user_namespace* */ +/* #undef HAVE_USERNS_IOPS_GETATTR */ + +/* iops->setattr() takes struct user_namespace* */ +/* #undef HAVE_USERNS_IOPS_SETATTR */ + +/* user_namespace->ns.inum exists */ +/* #undef HAVE_USER_NS_COMMON_INUM */ + +/* iops->getattr() takes a vfsmount */ +/* #undef HAVE_VFSMOUNT_IOPS_GETATTR */ + +/* aops->direct_IO() uses iovec */ +/* #undef HAVE_VFS_DIRECT_IO_IOVEC */ + +/* aops->direct_IO() uses iov_iter without rw */ +/* #undef HAVE_VFS_DIRECT_IO_ITER */ + +/* aops->direct_IO() uses iov_iter with offset */ +/* #undef HAVE_VFS_DIRECT_IO_ITER_OFFSET */ + +/* aops->direct_IO() uses iov_iter with rw and offset */ +/* #undef HAVE_VFS_DIRECT_IO_ITER_RW_OFFSET */ + +/* filemap_dirty_folio exists */ +/* #undef HAVE_VFS_FILEMAP_DIRTY_FOLIO */ + +/* All required iov_iter interfaces are available */ +/* #undef HAVE_VFS_IOV_ITER */ + +/* fops->iterate() is available */ +/* #undef HAVE_VFS_ITERATE */ + +/* fops->iterate_shared() is available */ +/* #undef HAVE_VFS_ITERATE_SHARED */ + +/* fops->readdir() is available */ *** 223 LINES SKIPPED *** From nobody Tue May 23 12:24:14 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQYQl1hqcz4CQM9; Tue, 23 May 2023 12:24:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQYQl15hvz3l5M; Tue, 23 May 2023 12:24:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684844655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pBta01M/PTrKf+MbxCgnY+WWDRmxVQsJn06y9sVFw7Q=; b=EbxjGZ1neSDo1ydad7xjIkq4qCFN5i1wig9AYtq6PAJcYQHSnxSerXNocxi7NPy0qiuUp7 /4yIoMuSUeG8K0IcISu9fMqiRjqSpsjZxgits4+d+csMrJiDWNYm+8d8c5Nz2hXyVKDKt8 4Qyadoha6rMI1eUNeBZAYvXFc1/q+lIkkOe6KUig+qr2hIkbpX1k+uo+tYX+p35VATjdU3 TOXKQklDJxPmXYOw8EIS3QWHk/CEDlzPNmEdPGhvXpJ4qNbgzuN9j2upse07ybyDKJUtNA nNbiwEel3xsW8mxccKd8c1H+FXTihHgRSor/AsubqWXVKmbzEx5qqF9/x80CoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684844655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pBta01M/PTrKf+MbxCgnY+WWDRmxVQsJn06y9sVFw7Q=; b=BNjOxq8FPhUNxKpockIMpmtq+Q478w4ZE3YLehpz9GF8Y3fdBw6NqWBEAnr0khR9ghaCOI QGTrmKbR5sHe4CXyKKdrpYyvqNi24BekCK3xJNL01Fhyqipt7rZHcqFnQObXsv/nHLKHTd 63SpTJTCeNAqo/l9whJmFk/z/wDsLGZA77CxAeZuyQJjHPf0nINTuKgRNUVmF7KHyGBdCP zwxMK1miqBQ1iRrliFz0p8eN4X7uhMVziL00DAeSp3oxCPFF8T2Gv+UHKsH3mmPKP7kazN uw8htEHMFh2uI8RLvET/pHnhAtqrjY40/3ReNxR8LVGA5ffNcXQ3B0vKnIydLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684844655; a=rsa-sha256; cv=none; b=Hk1DNylxglAOsy+G0uwztaIemA9a0TyYzzvPImhkmNE1wsTDCH3vmpYKiisfmN0HUbchLK a/SdLqaNBt0gw5+g/ugIwIKPe1txnM6Ry+c1+kMRWcHcTOlLoqaj1cgMojE3AQp9eYikDf q3bHWj1hUcn98XQ2XSVseZncDIA6rUAEbyYmbUCxS7qgevRTwcpz10pyZurzXBEydeZPkE /zG7/xSmGSJD79T9yJXP8sK+yBgdHon1EF91BQZ9vUbGqZRzWHJj0s6426m6URacvGmuHr EF5O/QAg88tOfEuo0q8/3LIrH/NWr5FWemmHLXtJhMUiafUN/rzZ+nMbuRKnmQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQYQl07QTz10T4; Tue, 23 May 2023 12:24: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 34NCOESC017535; Tue, 23 May 2023 12:24:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NCOEkA017534; Tue, 23 May 2023 12:24:14 GMT (envelope-from git) Date: Tue, 23 May 2023 12:24:14 GMT Message-Id: <202305231224.34NCOEkA017534@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: bbb2d2ce4220 - main - pw: do not move /home/$user to /usr/home List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bbb2d2ce422070869bd93a0771251e654c07b13d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=bbb2d2ce422070869bd93a0771251e654c07b13d commit bbb2d2ce422070869bd93a0771251e654c07b13d Author: Mike Karels AuthorDate: 2023-05-23 12:17:42 +0000 Commit: Mike Karels CommitDate: 2023-05-23 12:17:42 +0000 pw: do not move /home/$user to /usr/home When adding a user, pw will create the path to the home directory if needed. However, if creating a path with just one component, i.e. that appears to be in the root directory, pw would create the directory in /usr, and create a symlink from the root directory. Most commonly, this meant that the default of /home/$user would turn into /usr/home/$user. This was added in a self-described kludge 26 years ago. It made (some) sense when root was generally a small partition, with most of the space in /usr. However, the default is now one large partition. /home really doesn't belong under /usr, and anyone who wants to use /usr/home can specify it explicitly. Remove the kludge to move /home under /usr and create the symlink, and just use the specified path. Note that this operation was done only on the first invocation for a path, and this happened most commonly when adding a user during the install. Modify the test that checked for the creation of the symlink to verify that the symlink is *not* made, but rather a directory. Add a test that intermediate directories are still created. Reviewed by: rgrimes, bapt Differential Revision: https://reviews.freebsd.org/D40085 --- usr.sbin/pw/pw_user.c | 20 ++------------------ usr.sbin/pw/tests/pw_useradd_test.sh | 21 +++++++++++++++------ 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index c8e8de1fc46a..bea248c802ed 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/pw/pw_user.c @@ -114,36 +114,20 @@ mkdir_home_parents(int dfd, const char *dir) } tmp[0] = '\0'; - /* - * This is a kludge especially for Joerg :) - * If the home directory would be created in the root partition, then - * we really create it under /usr which is likely to have more space. - * But we create a symlink from cnf->home -> "/usr" -> cnf->home - */ - if (strchr(dirs, '/') == NULL) { - asprintf(&tmp, "usr/%s", dirs); - if (tmp == NULL) - errx(EX_UNAVAILABLE, "out of memory"); - if (mkdirat(dfd, tmp, _DEF_DIRMODE) != -1 || errno == EEXIST) { - fchownat(dfd, tmp, 0, 0, 0); - symlinkat(tmp, dfd, dirs); - } - free(tmp); - } tmp = dirs; if (fstatat(dfd, dirs, &st, 0) == -1) { while ((tmp = strchr(tmp + 1, '/')) != NULL) { *tmp = '\0'; if (fstatat(dfd, dirs, &st, 0) == -1) { if (mkdirat(dfd, dirs, _DEF_DIRMODE) == -1) - err(EX_OSFILE, "'%s' (root home parent) is not a directory", dirs); + err(EX_OSFILE, "'%s' (home parent) is not a directory", dirs); } *tmp = '/'; } } if (fstatat(dfd, dirs, &st, 0) == -1) { if (mkdirat(dfd, dirs, _DEF_DIRMODE) == -1) - err(EX_OSFILE, "'%s' (root home parent) is not a directory", dirs); + err(EX_OSFILE, "'%s' (home parent) is not a directory", dirs); fchownat(dfd, dirs, 0, 0, 0); } diff --git a/usr.sbin/pw/tests/pw_useradd_test.sh b/usr.sbin/pw/tests/pw_useradd_test.sh index a50f018ab99d..e9d0a3aa20af 100755 --- a/usr.sbin/pw/tests/pw_useradd_test.sh +++ b/usr.sbin/pw/tests/pw_useradd_test.sh @@ -295,15 +295,23 @@ user_add_R_body() { [ ! -d ${HOME}/home/bar ] || atf_fail "Directory not removed" } -atf_test_case user_add_R_symlink -user_add_R_symlink_body() { +atf_test_case user_add_R_no_symlink +user_add_R_no_symlink_body() { populate_root_etc_skel mkdir ${HOME}/usr atf_check -s exit:0 ${RPW} useradd foo -m - test -d ${HOME}/usr/home || atf_fail "Home parent directory not created" - test -h ${HOME}/home || atf_fail "/home directory is not a symlink" - atf_check -s exit:0 -o inline:"usr/home\n" readlink ${HOME}/home + [ ! -d ${HOME}/usr/home ] || atf_fail "/usr/home created" + test -d ${HOME}/home || atf_fail "/home directory not created" +} + +atf_test_case user_add_R_intermed +user_add_R_intermed_body() { + populate_root_etc_skel + + atf_check -s exit:0 ${RPW} useradd foo -m -d /a/b/c/foo + test -d ${HOME}/a/b/c || atf_fail "intermediate directories not created" + test -d ${HOME}/a/b/c/foo || atf_fail "user directory not created" } atf_test_case user_add_skel @@ -479,7 +487,8 @@ atf_init_test_cases() { atf_add_test_case user_add_invalid_group_entry atf_add_test_case user_add_password_from_h atf_add_test_case user_add_R - atf_add_test_case user_add_R_symlink + atf_add_test_case user_add_R_no_symlink + atf_add_test_case user_add_R_intermed atf_add_test_case user_add_skel atf_add_test_case user_add_uid0 atf_add_test_case user_add_uid_too_large From nobody Tue May 23 12:24:16 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQYQm2kJCz4CQlv; Tue, 23 May 2023 12:24:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQYQm1zWBz3lPW; Tue, 23 May 2023 12:24:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684844656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P8sGn3GDXgUjtP7vkCimGZkE0VYcVNhb053IGkT1xi8=; b=tocU4q7gADKgEXllCY1jttbFKUFtS+O5H7eRepAPAyzo730+Jk4IYM0fBB2i14XZz7E83w Hu7KRbtNcr8uLLcSx+XqKNGUhfuIL/ALh8/I9LTXUZ8wrBqR0jDDtNCEITcQQyljap+lwW FZkXyYfhS9BWNOw12j4aJQeTUhWAsBANuElQWoiJvakH5EcV/3m+G3NCdZkw0sk+75Gqz0 jSN/zfCf724Be7U/Fud4jr6BmyP7YaAOruCAA8fqEZWzYXFAn6TxawaExgp2ulBJx7ua/u +5dQ3NoNjMqePy8U0VF6YR9JFUjfEH9R5wX8hYoyFTN+52CVrgcJ8sdzoMdI2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684844656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P8sGn3GDXgUjtP7vkCimGZkE0VYcVNhb053IGkT1xi8=; b=iO3jxJp1slqAfvleoGtwJJsJYaQieho9yffL44rxbTh+HUcI44q33z/OIIn2P6f6uplvSX 9Vka+FuSHXPnzZgPiKiAOGeaGceC1zf6wAYtqEdXfJzRk5+nN2Sq19lTi8pifpgrpVILbf HawGghNNTtkrb1zRBlCSFvqOSKzcOiHa1G/1+EQeddM9O2Tj6gcnzpDle2oGfNNz3Q7ovO D3AkGr7Br0kOA9Vr+tsExvivPWopAheQ6NbJrdhKs5KNWs9HKAWRaOS0nLP8R7eUr/ISnO q+GZcDLUkMGLAjcApEdBYs4SjLdF5xc6hFj94wtrOLNQtKaZGOfah6jWakjRdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684844656; a=rsa-sha256; cv=none; b=K6Bknln5d67rLMwbGS8OcwoZSxCC/Zuy5o0AuyfB6Ibl0bE7Vy+eurOZ0cOqOuaGjYozbH d8YfxaNUdkR1uzPjNt9QuZhEt8e99c50oxWLG55UB9yOnDQ1yl96rjPNtAUXGUxyh1ZjcX tG0RyvmHt912HssZ6sJCIUqohkz/N1DNjtGxWr/mOdKi605BcErEgNULyPoZEy2l4PHaPb zRDmWNgRN7IRoPGEwe6LO3/D5A4iJ587zD9US4NGsi9f+/c1m1RZ5DsvsuQBGBwI3z33+2 a3lksO5TwJinWkQKD37a8Txt7anE9jSU3HcQhTAz1HkIXlaFpb4ttYEIPDdEjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQYQm137fz10df; Tue, 23 May 2023 12:24: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 34NCOG7R017557; Tue, 23 May 2023 12:24:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NCOGA6017556; Tue, 23 May 2023 12:24:16 GMT (envelope-from git) Date: Tue, 23 May 2023 12:24:16 GMT Message-Id: <202305231224.34NCOGA6017556@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: 3bb92304b4fe - main - bsdinstall on zfs: create dataset for /home rather than /usr/home List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3bb92304b4fe79babd19ba0d9c74d29af9117a22 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=3bb92304b4fe79babd19ba0d9c74d29af9117a22 commit 3bb92304b4fe79babd19ba0d9c74d29af9117a22 Author: Mike Karels AuthorDate: 2023-05-23 12:18:27 +0000 Commit: Mike Karels CommitDate: 2023-05-23 12:18:27 +0000 bsdinstall on zfs: create dataset for /home rather than /usr/home Now that pw (hence adduser and the initial install) use /home for user home directories rather than /usr/home, create a dataset for /home rather than /usr/home. Update the man page to match. Reviewed by: rgrimes, markj Differential Revision: https://reviews.freebsd.org/D40086 --- usr.sbin/bsdinstall/bsdinstall.8 | 8 ++++---- usr.sbin/bsdinstall/scripts/zfsboot | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.sbin/bsdinstall/bsdinstall.8 b/usr.sbin/bsdinstall/bsdinstall.8 index b76cdc04b9c3..edeeffa5f634 100644 --- a/usr.sbin/bsdinstall/bsdinstall.8 +++ b/usr.sbin/bsdinstall/bsdinstall.8 @@ -125,9 +125,9 @@ Provides a ZFS-only automatic interactive disk partitioner. Creates a single .Ic zpool with separate datasets for +.Pa /home , .Pa /tmp , .Pa /usr , -.Pa /usr/home , .Pa /usr/ports , .Pa /usr/src , and @@ -598,15 +598,15 @@ is: /$ZFSBOOT_BEROOT_NAME mountpoint=none /$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME mountpoint=/ +# Home directories separated so they are common to all BEs +/home mountpoint=/home + # Compress /tmp, allow exec but not setuid /tmp mountpoint=/tmp,exec=on,setuid=off # Do not mount /usr so that 'base' files go to the BEROOT /usr mountpoint=/usr,canmount=off -# Home directories separated so they are common to all BEs -/usr/home # NB: /home is a symlink to /usr/home - # Ports tree /usr/ports setuid=off diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot index c40a9484c8c4..c2d42f830a73 100755 --- a/usr.sbin/bsdinstall/scripts/zfsboot +++ b/usr.sbin/bsdinstall/scripts/zfsboot @@ -150,15 +150,15 @@ f_isset ZFSBOOT_DATASETS || ZFSBOOT_DATASETS=" /$ZFSBOOT_BEROOT_NAME mountpoint=none /$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME mountpoint=/ + # Home directories separated so they are common to all BEs + /home mountpoint=/home + # Compress /tmp, allow exec but not setuid /tmp mountpoint=/tmp,exec=on,setuid=off # Don't mount /usr so that 'base' files go to the BEROOT /usr mountpoint=/usr,canmount=off - # Home directories separated so they are common to all BEs - /usr/home # NB: /home is a symlink to /usr/home - # Ports tree /usr/ports setuid=off From nobody Tue May 23 12:24:17 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQYQn3YfRz4CQJl; Tue, 23 May 2023 12:24:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQYQn2xPyz3lL7; Tue, 23 May 2023 12:24:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684844657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6iACEiWjROW5eCMY4zzYekHcLxFj3Uki4ADT+mX5f1E=; b=Q/xTV0WEUsLUpK4ZVBsHbA3xtPU6Qq8+2wPzKALYuHk3UTQ1ImKKPFCRdJYIeUg5pAbZIt gujsjUbGakKohC9aTGGyHo5W3zqJmaQYS6wjESmBpbNO56MVId7WL8FBGWROe6lgQldCsU 0wkMaG9dMOnQU5QVCpZ8jwsPKHYyeVsUt4OewBx1tdpwdrSg+UMHQ5qgPz99E75ktt5g/V hO3JCNTTkT6g7BHGTX50v1R+4dkvWVGc4sCMr3QKNkpH+earOzWaxhN3BIVuP/3EjKaZuD f/TXVHbLnO0BZYaWM9UfTLGeegu1YwWKRx2kM6hLuffw+OHvAmZsarY2aSQmhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684844657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6iACEiWjROW5eCMY4zzYekHcLxFj3Uki4ADT+mX5f1E=; b=bg4gXZG9oiZ5GMkCEhDZ0i6yZrKqIO/89LJar6cRnpq4HPqj/QLXXdIbLIm1LPCyawEMLr GKWDi4rVqdQYl3Q4N5SPmVn/cMfaF/D1S4V+qmRDvW3cOm/kIMIdvIOQr1rHI1X5YWpBV5 J8FmcqtJQKL9RKg4wKARrMcSxbkTDSHJKxrQzMwU7B9nMPVNME5+GI69v1V7A78Rkj4FuJ R5YogiRgN5mRewlkGe9L3IZbixPKr5GZ8d78Qe+JsgXd4+zSgrBtIg5wJJNai2JWXJn+d/ oKvIM5FwfzKmBSu+UMf9ADQbeB70HTZ/S0lI8BV+8wH0qUb3JQTxAwT8kplEpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684844657; a=rsa-sha256; cv=none; b=M+N94d4AdTuEmgjDhVDd8OQiiiyXMDsCDGMG84p59LOwGvCHj3ChCcBruOlGrVQNwASORg pdURBwrNtowUTMpI71uJ34Z69vFZt93/lYa6qiloqViZzBFMn4MpIo1qgfGS4m3CNiukz8 9MDs9UJrPEGPiLwPms2+wdRbmEn0BNbhMjPWzN5kdMPEZMlYLc/NLky3T4r4LjBdYbNwPO Oi1Ub/JIk/KVhABMC0xWBCno3mhdy/Bs+Gvzi0mmpHhgG9M+JKsuzLpdENfn36YfnuC/FW d9Oq8gw6rC+qy3HzovoGKuLTOdkBrSlDeI+xFdrQkrn1uIagK3xMW1o/bzpgEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQYQn1pZZz10dg; Tue, 23 May 2023 12:24:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34NCOH6J017584; Tue, 23 May 2023 12:24:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NCOHAr017583; Tue, 23 May 2023 12:24:17 GMT (envelope-from git) Date: Tue, 23 May 2023 12:24:17 GMT Message-Id: <202305231224.34NCOHAr017583@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: d3c32c80a16b - main - release/tools/vmimage.subr: switch zfs dataset from /usr/home to /home List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d3c32c80a16bd0a2c65695640050f65bb10ac72f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=d3c32c80a16bd0a2c65695640050f65bb10ac72f commit d3c32c80a16bd0a2c65695640050f65bb10ac72f Author: Mike Karels AuthorDate: 2023-05-23 12:18:58 +0000 Commit: Mike Karels CommitDate: 2023-05-23 12:18:58 +0000 release/tools/vmimage.subr: switch zfs dataset from /usr/home to /home Change the vmimage script for zfs to create /home as a dataset rather than /usr/home, ala change to bsdinstall's zfs script. Reviewed by: markj Differential Revision: To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: 9a6a948128c9 - main - hier.7: update /home List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9a6a948128c9e2e39ea728e5f60b8bb82c9c1fca Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=9a6a948128c9e2e39ea728e5f60b8bb82c9c1fca commit 9a6a948128c9e2e39ea728e5f60b8bb82c9c1fca Author: Mike Karels AuthorDate: 2023-05-23 12:21:12 +0000 Commit: Mike Karels CommitDate: 2023-05-23 12:21:12 +0000 hier.7: update /home The default for home directories is changing from /usr/home to /home; update the corresponding entries. Also move /home into alphabetical order. Reviewed by: mhorne, manpages(bcr) Differential Revision: https://reviews.freebsd.org/D40203 --- share/man/man7/hier.7 | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/share/man/man7/hier.7 b/share/man/man7/hier.7 index e91bc2d5d193..d999c28b860e 100644 --- a/share/man/man7/hier.7 +++ b/share/man/man7/hier.7 @@ -28,7 +28,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd November 23, 2022 +.Dd May 22, 2023 .Dt HIER 7 .Os .Sh NAME @@ -90,10 +90,6 @@ file descriptor files; see .Xr fd 4 .El -.It Pa /home/ -user HOME directories. -This is a symlink to -.Pa /usr/home/ .It Pa /etc/ system configuration files and scripts .Pp @@ -141,6 +137,12 @@ see .It Pa ssl/ OpenSSL configuration files .El +.It Pa /home/ +users' HOME directories; +the layout is not standardized, but a typical interactive user +.Dv beastie +might receive their own directory +.Pa /home/beastie .It Pa /lib/ critical system libraries needed for binaries in .Pa /bin @@ -218,12 +220,6 @@ and .Xr bsdinstall 8 .It Pa include/ standard C include files -.It Pa home/ -users' HOME directories; -the layout is not standardized, but a typical interactive user -.Dv beastie -might receive their own directory under -.Pa /usr/home/beastie .Pp .It Pa lib/ shared and archive From nobody Tue May 23 12:24:19 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQYQq51tTz4CQS4; Tue, 23 May 2023 12:24:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQYQq4Zmmz3lhk; Tue, 23 May 2023 12:24:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684844659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8mVi5BsA/daqzCp325klnV5LPgbEYtAcR08ZvLu6jpc=; b=qR9wcNiFxvKZmYR4WzB/A/CflyyQx0Q3VFidnB7zUGnlxlYr4o94Ltt04/pNUFL/jjFid/ pm/qLNwT+8uf2deUSRrLDcq+403/njtSGeS0p3C24GhTHNViorlQGEwz5HBshro/2Ufb4d JOLvKwHuCz801Zcm0UZZRIB+2BVLWQh81iPo+/GO1th2nbaVhrw+EqIxcenVKboQENJ+wL f+X/fLN39y97kVC5YC3HiPhcZU/cTOQbAT2r+kmOMTSEqQ8rTY76XJd7Yh/HGfCvkQocL1 1SygpuXcLhH/eYBMkQO1dWIhG1U3hZEGv9idjWfvNvIvox1595clOGxPht8xIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684844659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8mVi5BsA/daqzCp325klnV5LPgbEYtAcR08ZvLu6jpc=; b=uHXM2YLN2I3qkBXi+VEJ2tHFuPv8zuTLh1wXW7JDY67m/viPlswA6zCX/ZdbQpYGxQo9jX hvNtKQI0qa3B6uXYil8dB7UQeuFlNtdFJwGKsOM7AGgKYL4TiczgJThWy7o3/AVI1kTe2x okJYInIbbJL/Gxf5Pa/cmqMM5qwNopvK+jBM3eLPvec0SRRWDjtXYto66KPGTITKUj3gMp 81hy/bKCgret/9Zbu6Mfhyfo30zq4B9uM0yT9jHUCfDWZ/5cIU7zJv/4R8zCbwWFCE2hM/ j+eu05hoIy0bEeW0gmPbZ5obYD59rxZQe/snN+vt9roop5H+v8rHs9HEqX6SSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684844659; a=rsa-sha256; cv=none; b=m7YBxbcsJaQuMm7f5d2/dXBnPaCZF3Y4MDroyXsFK/7eOMR5pPrRa1xep/3pWHr+IuZXGU GxCI1F09WzpNq8WBkCpN3tL1jUX7e2u6u7i274E80pBC9QgIs2khXEf2nVhywfznKhrdoF A+jqolnbKa5f5AaJC3odBAFgReHZo8r1Y4pfo1SH5cwQGYx2D6j7BbF4ZSDCwb4pemkTYi nNsamlv0uDn81ompjFAtlS2aV9BaYWHtxsurF3GNxYbxPTR/EZVdQtQ9AniIEvowgWdO0+ Tv6kghp6EsONaGQUFRPxjifuTUkQ93JqhW1bfE8bXo3qlOSqbzQ2J2yBhtuAyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQYQq3glFz10bL; Tue, 23 May 2023 12:24: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 34NCOJlU017622; Tue, 23 May 2023 12:24:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NCOJYg017621; Tue, 23 May 2023 12:24:19 GMT (envelope-from git) Date: Tue, 23 May 2023 12:24:19 GMT Message-Id: <202305231224.34NCOJYg017621@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: 108230743472 - main - pwd.1: replace /home with /sys in example List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 108230743472b8b4b38c9b858088ab5059a1dddd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=108230743472b8b4b38c9b858088ab5059a1dddd commit 108230743472b8b4b38c9b858088ab5059a1dddd Author: Mike Karels AuthorDate: 2023-05-23 12:21:50 +0000 Commit: Mike Karels CommitDate: 2023-05-23 12:21:50 +0000 pwd.1: replace /home with /sys in example The default location for home directories is moving from /usr/home to /home, and the /home symlink will no longer exist. Switch to another example that is in base, /sys. Reviewed by: fernape Differential Revision: To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 6265da14c913 - main - libdtrace: get rid of illumos ifdefs in dt_module_update(), fix dm_file and dm_modid List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6265da14c913e41827aa20a096103717243a1c1b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=6265da14c913e41827aa20a096103717243a1c1b commit 6265da14c913e41827aa20a096103717243a1c1b Author: Christos Margiolis AuthorDate: 2023-05-23 12:54:58 +0000 Commit: Christos Margiolis CommitDate: 2023-05-23 12:54:58 +0000 libdtrace: get rid of illumos ifdefs in dt_module_update(), fix dm_file and dm_modid Because dt_module_update() is highly OS-specific, the ifdefs make it hard to read and follow what is going on. Also handle dm_modid, and remove handling of the ".filename" section, since we can easily fetch the filename from the module's pathname (k_stat->pathname). Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39177 --- .../opensolaris/lib/libdtrace/common/dt_module.c | 30 +++------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c index b9408944f8c5..281c787de533 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c @@ -1129,33 +1129,21 @@ dt_module_getctflib(dtrace_hdl_t *dtp, dt_module_t *dmp, const char *name) * including the path. */ static void -#ifdef illumos -dt_module_update(dtrace_hdl_t *dtp, const char *name) -#else dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) -#endif { char fname[MAXPATHLEN]; struct stat64 st; int fd, err, bits; -#ifdef __FreeBSD__ struct module_stat ms; dt_kmodule_t *dkmp; uint_t h; int modid; -#endif - dt_module_t *dmp; const char *s; size_t shstrs; GElf_Shdr sh; Elf_Data *dp; Elf_Scn *sp; - -#ifdef illumos - (void) snprintf(fname, sizeof (fname), - "%s/%s/object", OBJFS_ROOT, name); -#else GElf_Ehdr ehdr; GElf_Phdr ph; char name[MAXPATHLEN]; @@ -1165,7 +1153,6 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) (void) strlcpy(name, k_stat->name, sizeof(name)); (void) strlcpy(fname, k_stat->pathname, sizeof(fname)); -#endif if ((fd = open(fname, O_RDONLY)) == -1 || fstat64(fd, &st) == -1 || (dmp = dt_module_create(dtp, name)) == NULL) { @@ -1174,6 +1161,9 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) return; } + (void) strlcpy(dmp->dm_file, fname, sizeof(dmp->dm_file)); + dmp->dm_modid = k_stat->id; + /* * Since the module can unload out from under us (and /system/object * will return ENOENT), tell libelf to cook the entire file now and @@ -1206,7 +1196,6 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) dt_module_destroy(dtp, dmp); return; } -#if defined(__FreeBSD__) mapbase = (uintptr_t)k_stat->address; gelf_getehdr(dmp->dm_elf, &ehdr); is_elf_obj = (ehdr.e_type == ET_REL); @@ -1219,7 +1208,6 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) return; } } -#endif /* * Iterate over the section headers locating various sections of * interest and use their attributes to flesh out the dt_module_t. @@ -1228,7 +1216,6 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) if (gelf_getshdr(sp, &sh) == NULL || sh.sh_type == SHT_NULL || (s = elf_strptr(dmp->dm_elf, shstrs, sh.sh_name)) == NULL) continue; /* skip any malformed sections */ -#if defined(__FreeBSD__) if (sh.sh_size == 0) continue; if (sh.sh_type == SHT_PROGBITS || sh.sh_type == SHT_NOBITS) { @@ -1240,7 +1227,6 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) dmp->dm_sec_offsets[elf_ndxscn(sp)] = sh.sh_addr; mapbase += sh.sh_size; } -#endif if (strcmp(s, ".text") == 0) { dmp->dm_text_size = sh.sh_size; dmp->dm_text_va = sh.sh_addr; @@ -1254,17 +1240,10 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) (dp = elf_getdata(sp, NULL)) != NULL) { bcopy(dp->d_buf, &dmp->dm_info, MIN(sh.sh_size, sizeof (dmp->dm_info))); - } else if (strcmp(s, ".filename") == 0 && - (dp = elf_getdata(sp, NULL)) != NULL) { - (void) strlcpy(dmp->dm_file, - dp->d_buf, sizeof (dmp->dm_file)); } } dmp->dm_flags |= DT_DM_KERNEL; -#ifdef illumos - dmp->dm_modid = (int)OBJFS_MODID(st.st_ino); -#else /* * Include .rodata and special sections into .text. * This depends on default section layout produced by GNU ld @@ -1285,12 +1264,10 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) } } #endif -#endif /* illumos */ if (dmp->dm_info.objfs_info_primary) dmp->dm_flags |= DT_DM_PRIMARY; -#ifdef __FreeBSD__ ms.version = sizeof(ms); for (modid = kldfirstmod(k_stat->id); modid > 0; modid = modnext(modid)) { @@ -1315,7 +1292,6 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) dkmp->dkm_module = dmp; dtp->dt_kmods[h] = dkmp; } -#endif dt_dprintf("opened %d-bit module %s (%s) [%d]\n", bits, dmp->dm_name, dmp->dm_file, dmp->dm_modid); From nobody Tue May 23 13:23:19 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQZkv3rZ6z4CTTQ; Tue, 23 May 2023 13:23: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 4QQZkv38RBz3sll; Tue, 23 May 2023 13:23:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684848199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q+KONPlGxF9rVUWjcYF1BpVWmoPiLl77UYeruNkzjnA=; b=Bc47zi+XmNwHoKTDKsqovAVd1MpvEPl7XGybq8KX3+VrroZR7Wcg1yYOFq8eb5RbIoZlO5 B0YCaa0uwi1cy6aCMbMfm+TbFO7JubXufB1uayh95zcoD1ILy+eY6NI9FYumeuRG1hB3dF SgOLPL3N/flydfXexj9Orj9cQfbwIup6e/E5C5stJ1fdtkPtP/Yvhwwl7hO3dSSbh2dqzM q3MX8cJQq8z6ufGqr8nicN1INqVezZ36i6zP9q3S+OASVO4YV2v5Cx4AbdyisjWRtqdksn cyBSZpzpmDLlgkOg70Q2upw72V9gEtSL2M7DfwWbwi+1UNxyj6kGWrK304YHmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684848199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q+KONPlGxF9rVUWjcYF1BpVWmoPiLl77UYeruNkzjnA=; b=ECW2O4VYd5Fzl4hLw8HmMlI4c3jr2+sRvecNHzMkQFZHcp+aQiXypJNvMj+I06Hd4ZCugK kGZopzCMdvv02fJfedSKFQ7Jq7v+UcwvGG3EfO1kYtwF9fD8l92VJVseu9D0zvh0M8LqIX mLv+dlbK9plHgMpuFKSijoAFg5TCz7e4bdjMI8r9iQIWpdBy/XhMH3Ov1p5Rfx3T7OkyG3 4KWRsVtdG8TRnwcts7jMaaJ0cbmfFhRfwytw3OIjay67hPGLJ0DmozcIQSKAoIthFYeaPI bK9TIPtorvms+Lm5bSlUL4mt9yiZ8QfUWE240XhNcmaNP+PaSZGTLsR6RLh71Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684848199; a=rsa-sha256; cv=none; b=Z/GLGHnuyQqfXPRrd0Y3KJjVbSDCP3i9nU7KuqTGyk/iKY7iOeMGO2PsJ1ae7udvX1f+7S JBl0bx7XEndHd9Y6t3a378ThBIBlxihnnt4crDFG2HEp9f8+Dc0kdBaJrdQdj8EjMoNcL4 MM0llqx0BA6gK7IOY3rz8l82ZJ1omee5q30Z04rsKSb+1WqOxosh3N9TBUxsEkEMvut5SK Wfzupv83wxpdfmtgqpT9a8ze6w7ZNsx82iaCLDuGBYPleyZeu4npBwO35jzkov83XVNFEv I0vVXxVwmwQ160/+qypw+ooKTFGkuytTXnmLXDOFnKXtX9qH7SLSBGu4UnKmiA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQZkv2CdVz11vQ; Tue, 23 May 2023 13:23:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34NDNJTR016482; Tue, 23 May 2023 13:23:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NDNJJv016481; Tue, 23 May 2023 13:23:19 GMT (envelope-from git) Date: Tue, 23 May 2023 13:23:19 GMT Message-Id: <202305231323.34NDNJJv016481@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 88b4d124efc5 - main - riscv: Rework CPU identification (first part) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 88b4d124efc5a2d45660551fe0750acc0be6d3cd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=88b4d124efc5a2d45660551fe0750acc0be6d3cd commit 88b4d124efc5a2d45660551fe0750acc0be6d3cd Author: Mitchell Horne AuthorDate: 2023-05-22 23:48:41 +0000 Commit: Mitchell Horne CommitDate: 2023-05-23 13:00:25 +0000 riscv: Rework CPU identification (first part) Make better use of the RISC-V identification CSRs: mvendorid, marchid, and mimpid. This code was written before these registers were well-specified, or even available to the kernel. It currently fails to recognize any CPU or platform. Per the privileged specification, mvendorid contains the JEDEC vendor ID, or zero. The marchid register denotes the CPU microarchitecture. This is either one of the globally allocated open-source implementation IDs, or the field has a custom encoding. Therefore, for known vendors (SiFive) we can also maintain a list of known marchid values. If we can not give a name to the CPU but marchid is non-zero, then just print its value in the report. The mimpid (implementation ID) could be used in the future to more uniquely identify the micro-architecture, but it really remains to be seen how it gets used. For now we just print its value. Thank you to Danjel Qyteza who submitted an early version of this change to me, although it has been almost entirely rewritten. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39809 --- sys/riscv/include/cpu.h | 45 +++++++++------- sys/riscv/riscv/identcpu.c | 128 ++++++++++++++++++++++++++------------------- 2 files changed, 101 insertions(+), 72 deletions(-) diff --git a/sys/riscv/include/cpu.h b/sys/riscv/include/cpu.h index ee7b1111af56..b33e34d350fb 100644 --- a/sys/riscv/include/cpu.h +++ b/sys/riscv/include/cpu.h @@ -52,27 +52,36 @@ #ifdef _KERNEL /* - * 0x0000 CPU ID unimplemented - * 0x0001 UC Berkeley Rocket repo - * 0x0002­0x7FFE Reserved for open-source repos - * 0x7FFF Reserved for extension - * 0x8000 Reserved for anonymous source - * 0x8001­0xFFFE Reserved for proprietary implementations - * 0xFFFF Reserved for extension + * Core manufacturer IDs, as reported by the mvendorid CSR. */ +#define MVENDORID_UNIMPL 0x0 +#define MVENDORID_SIFIVE 0x489 +#define MVENDORID_THEAD 0x5b7 -#define CPU_IMPL_SHIFT 0 -#define CPU_IMPL_MASK (0xffff << CPU_IMPL_SHIFT) -#define CPU_IMPL(mimpid) ((mimpid & CPU_IMPL_MASK) >> CPU_IMPL_SHIFT) -#define CPU_IMPL_UNIMPLEMEN 0x0 -#define CPU_IMPL_UCB_ROCKET 0x1 +/* + * Micro-architecture ID register, marchid. + * + * IDs for open-source implementations are allocated globally. Commercial IDs + * will have the most-significant bit set. + */ +#define MARCHID_UNIMPL 0x0 +#define MARCHID_MSB (1ul << (XLEN - 1)) +#define MARCHID_OPENSOURCE(v) (v) +#define MARCHID_COMMERCIAL(v) (MARCHID_MSB | (v)) +#define MARCHID_IS_OPENSOURCE(m) (((m) & MARCHID_MSB) == 0) + +/* + * Open-source marchid values. + * + * https://github.com/riscv/riscv-isa-manual/blob/master/marchid.md + */ +#define MARCHID_UCB_ROCKET MARCHID_OPENSOURCE(1) +#define MARCHID_UCB_BOOM MARCHID_OPENSOURCE(2) +#define MARCHID_UCB_SPIKE MARCHID_OPENSOURCE(5) +#define MARCHID_UCAM_RVBS MARCHID_OPENSOURCE(10) -#define CPU_PART_SHIFT 62 -#define CPU_PART_MASK (0x3ul << CPU_PART_SHIFT) -#define CPU_PART(misa) ((misa & CPU_PART_MASK) >> CPU_PART_SHIFT) -#define CPU_PART_RV32 0x1 -#define CPU_PART_RV64 0x2 -#define CPU_PART_RV128 0x3 +/* SiFive marchid values */ +#define MARCHID_SIFIVE_U7 MARCHID_COMMERCIAL(7) extern char btext[]; extern char etext[]; diff --git a/sys/riscv/riscv/identcpu.c b/sys/riscv/riscv/identcpu.c index c57a22c1b51a..9b2330ee7051 100644 --- a/sys/riscv/riscv/identcpu.c +++ b/sys/riscv/riscv/identcpu.c @@ -67,42 +67,47 @@ register_t marchid; /* The architecture ID */ register_t mimpid; /* The implementation ID */ struct cpu_desc { - u_int cpu_impl; - u_int cpu_part_num; - const char *cpu_impl_name; - const char *cpu_part_name; + const char *cpu_mvendor_name; + const char *cpu_march_name; }; struct cpu_desc cpu_desc[MAXCPU]; -struct cpu_parts { - u_int part_id; - const char *part_name; +/* + * Micro-architecture tables. + */ +struct marchid_entry { + register_t march_id; + const char *march_name; }; -#define CPU_PART_NONE { -1, "Unknown Processor" } -struct cpu_implementers { - u_int impl_id; - const char *impl_name; +#define MARCHID_END { -1ul, NULL } + +/* Open-source RISC-V architecture IDs; globally allocated. */ +static const struct marchid_entry global_marchids[] = { + { MARCHID_UCB_ROCKET, "UC Berkeley Rocket" }, + { MARCHID_UCB_BOOM, "UC Berkeley Boom" }, + { MARCHID_UCB_SPIKE, "UC Berkeley Spike" }, + { MARCHID_UCAM_RVBS, "University of Cambridge RVBS" }, + MARCHID_END }; -#define CPU_IMPLEMENTER_NONE { 0, "Unknown Implementer" } -/* - * CPU base - */ -static const struct cpu_parts cpu_parts_std[] = { - { CPU_PART_RV32, "RV32" }, - { CPU_PART_RV64, "RV64" }, - { CPU_PART_RV128, "RV128" }, - CPU_PART_NONE, +static const struct marchid_entry sifive_marchids[] = { + { MARCHID_SIFIVE_U7, "6/7/P200/X200-Series Processor" }, + MARCHID_END }; /* - * Implementers table. + * Known CPU vendor/manufacturer table. */ -const struct cpu_implementers cpu_implementers[] = { - { CPU_IMPL_UCB_ROCKET, "UC Berkeley Rocket" }, - CPU_IMPLEMENTER_NONE, +static const struct { + register_t mvendor_id; + const char *mvendor_name; + const struct marchid_entry *marchid_table; +} mvendor_ids[] = { + { MVENDORID_UNIMPL, "Unspecified", NULL }, + { MVENDORID_SIFIVE, "SiFive", sifive_marchids }, + { MVENDORID_THEAD, "T-Head", NULL }, }; /* @@ -319,48 +324,63 @@ fill_elf_hwcap(void *dummy __unused) SYSINIT(identcpu, SI_SUB_CPU, SI_ORDER_ANY, fill_elf_hwcap, NULL); #endif -void -identify_cpu(void) +static void +identify_cpu_ids(struct cpu_desc *desc) { - const struct cpu_parts *cpu_partsp; - uint32_t part_id; - uint32_t impl_id; - uint64_t misa; - u_int cpu; - size_t i; - - cpu_partsp = NULL; + const struct marchid_entry *table = NULL; + int i; - /* TODO: can we get misa somewhere ? */ - misa = 0; + desc->cpu_mvendor_name = "Unknown"; + desc->cpu_march_name = "Unknown"; - cpu = PCPU_GET(cpuid); - - impl_id = CPU_IMPL(mimpid); - for (i = 0; i < nitems(cpu_implementers); i++) { - if (impl_id == cpu_implementers[i].impl_id || - cpu_implementers[i].impl_id == 0) { - cpu_desc[cpu].cpu_impl = impl_id; - cpu_desc[cpu].cpu_impl_name = cpu_implementers[i].impl_name; - cpu_partsp = cpu_parts_std; + /* + * Search for a recognized vendor, and possibly obtain the secondary + * table for marchid lookup. + */ + for (i = 0; i < nitems(mvendor_ids); i++) { + if (mvendorid == mvendor_ids[i].mvendor_id) { + desc->cpu_mvendor_name = mvendor_ids[i].mvendor_name; + table = mvendor_ids[i].marchid_table; break; } } - part_id = CPU_PART(misa); - for (i = 0; &cpu_partsp[i] != NULL; i++) { - if (part_id == cpu_partsp[i].part_id || - cpu_partsp[i].part_id == -1) { - cpu_desc[cpu].cpu_part_num = part_id; - cpu_desc[cpu].cpu_part_name = cpu_partsp[i].part_name; + if (marchid == MARCHID_UNIMPL) { + desc->cpu_march_name = "Unspecified"; + return; + } + + if (MARCHID_IS_OPENSOURCE(marchid)) { + table = global_marchids; + } else if (table == NULL) + return; + + for (i = 0; table[i].march_name != NULL; i++) { + if (marchid == table[i].march_id) { + desc->cpu_march_name = table[i].march_name; break; } } +} + +void +identify_cpu(void) +{ + struct cpu_desc *desc; + u_int cpu, hart; + + cpu = PCPU_GET(cpuid); + hart = PCPU_GET(hart); + desc = &cpu_desc[cpu]; + + identify_cpu_ids(desc); /* Print details for boot CPU or if we want verbose output */ if (cpu == 0 || bootverbose) { - printf("CPU(%d): %s %s\n", cpu, - cpu_desc[cpu].cpu_impl_name, - cpu_desc[cpu].cpu_part_name); + /* Summary line. */ + printf("CPU %-3u: Vendor=%s Core=%s (Hart %u)\n", cpu, + desc->cpu_mvendor_name, desc->cpu_march_name, hart); + + printf(" marchid=%#lx, mimpid=%#lx\n", marchid, mimpid); } } From nobody Tue May 23 13:23:20 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQZkx2CDbz4CT4k; Tue, 23 May 2023 13:23: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 4QQZkw4dJSz3srd; Tue, 23 May 2023 13:23:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684848200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C3NCsozXM+YfGiatwa2gc9UGBobTSNnpR0c51drUUPM=; b=ebJa1KmEJIs+i6VF983mhYVm6Vh28WvAr8kKIoUspey7BX15WNNuKQF+85Z/couVJeWqqV DuOOdN5jtv0S3uCdUtbWoPWVkAdg9Wy3qf8qDG6GxOvA9993NpsirxTcKjMcb4M1rGLJas oaObDoMQreAlHgNaf+pQXoQDreMV/hhsMqcG5isLIzDaoO2sgsJYGuGmruLb/nZ4i+YNiG +ARnKks2ttPWtNLiADOy9XS/8OYvbrx5BAyNw+9hnLnyiD43ffGPVlG+6bam4stl0+cyhB FcHfFRQLJXvQ+UHoH54hQfj1VnWnK4FnTi7uE3E2hmgVPPyWYYeUXCuHhI6l0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684848200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C3NCsozXM+YfGiatwa2gc9UGBobTSNnpR0c51drUUPM=; b=YhHx7L2ow4yXzK0fd7wuhHjD5tVuuwz/v+tR+Ix37MyFCALQ3aJ+YBuP3y+rwewz0iRz3y mLggclMDYsz8mcb8SY1Kq6g1UOiU0bCOlU3EDtJf7Ab6Ze4FC7qfCPdLKe4YOhQwOw2aXC 9lA828mMJCbUdFnVBzUGIoaFx/7M40zUWaHzDXIlzHkHPGanINRZDHJzvW1uv+OsqQ3e4C ea/UlMkE3hsU4h8LgTK+sVB3d0chPZnoA4GxzV903mQQ/Fucq10haNDbQ16yLqzm5ua0MQ 87P8+U5xWxYsHjSwPmf9J2Y9OYLk0Lmbm0z4ByvjKzv19HGST9WahzMcNM2gfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684848200; a=rsa-sha256; cv=none; b=YoD9deKGCG5gbQLfh0GSR/iv42QG84iB3gYp/yS38Oc4tTN0/wtLFKGYlu3s+aslXd7Ijt 4wW57MUvpBBcBwYzOOjioT4bhfnjRvoJDolG6UrVkG9+DZXJAMs5/eJE5//kB5ej8mayJY ALWLxb3Pr+1P7/vdNsetS5Qo5GPfPRg2htrIG02JBjNUl0m0yq0u8EukXiu8eV5gxGFuqI KL4xXXmhOSFB5B202kLQtUpdYS6m1cjlxeIKQ/h/DeW/JKd/5JMx+P3/O0l5olNB4Pa1jK hKLAZQMvvexZ/AbjOxH+sWTjOu0tWchxfIbqlJzjUDdQ+mXffLYEBQFBqb2LoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQZkw3KJHz11ly; Tue, 23 May 2023 13:23:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34NDNKAL016501; Tue, 23 May 2023 13:23:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NDNKGi016500; Tue, 23 May 2023 13:23:20 GMT (envelope-from git) Date: Tue, 23 May 2023 13:23:20 GMT Message-Id: <202305231323.34NDNKGi016500@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: b0d45b023e8c - main - riscv: Call identify_cpu() earlier for CPU 0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b0d45b023e8c9af50312c7b56c4be9c39657afcb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=b0d45b023e8c9af50312c7b56c4be9c39657afcb commit b0d45b023e8c9af50312c7b56c4be9c39657afcb Author: Mitchell Horne AuthorDate: 2023-05-22 23:50:09 +0000 Commit: Mitchell Horne CommitDate: 2023-05-23 13:00:25 +0000 riscv: Call identify_cpu() earlier for CPU 0 It is advantageous to have knowledge of ISA features as early as possible. For example, the presence of newer virtual memory extensions may be useful to pmap_bootstrap(). To achieve this, split out the printf() parts of identify_cpu() into a separate function, printcpuinfo(). This latter function will be called later in boot after the console has been initialized. Reviewed by: markj MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39810 --- sys/riscv/include/cpu.h | 1 + sys/riscv/riscv/identcpu.c | 10 ++++++++-- sys/riscv/riscv/machdep.c | 7 ++++++- sys/riscv/riscv/mp_machdep.c | 1 + 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/sys/riscv/include/cpu.h b/sys/riscv/include/cpu.h index b33e34d350fb..64e93e984a9b 100644 --- a/sys/riscv/include/cpu.h +++ b/sys/riscv/include/cpu.h @@ -90,6 +90,7 @@ void cpu_halt(void) __dead2; void cpu_reset(void) __dead2; void fork_trampoline(void); void identify_cpu(void); +void printcpuinfo(void); static __inline uint64_t get_cyclecount(void) diff --git a/sys/riscv/riscv/identcpu.c b/sys/riscv/riscv/identcpu.c index 9b2330ee7051..c6e93d02cd36 100644 --- a/sys/riscv/riscv/identcpu.c +++ b/sys/riscv/riscv/identcpu.c @@ -365,6 +365,14 @@ identify_cpu_ids(struct cpu_desc *desc) void identify_cpu(void) +{ + struct cpu_desc *desc = &cpu_desc[PCPU_GET(cpuid)]; + + identify_cpu_ids(desc); +} + +void +printcpuinfo(void) { struct cpu_desc *desc; u_int cpu, hart; @@ -373,8 +381,6 @@ identify_cpu(void) hart = PCPU_GET(hart); desc = &cpu_desc[cpu]; - identify_cpu_ids(desc); - /* Print details for boot CPU or if we want verbose output */ if (cpu == 0 || bootverbose) { /* Summary line. */ diff --git a/sys/riscv/riscv/machdep.c b/sys/riscv/riscv/machdep.c index 6b8dcb647162..805cbe2d887b 100644 --- a/sys/riscv/riscv/machdep.c +++ b/sys/riscv/riscv/machdep.c @@ -128,7 +128,7 @@ cpu_startup(void *dummy) { sbi_print_version(); - identify_cpu(); + printcpuinfo(); printf("real memory = %ju (%ju MB)\n", ptoa((uintmax_t)realmem), ptoa((uintmax_t)realmem) / (1024 * 1024)); @@ -536,6 +536,11 @@ initriscv(struct riscv_bootparams *rvbp) physmem_hardware_regions(mem_regions, mem_regions_sz); #endif + /* + * Identify CPU/ISA features. + */ + identify_cpu(); + /* Do basic tuning, hz etc */ init_param1(); diff --git a/sys/riscv/riscv/mp_machdep.c b/sys/riscv/riscv/mp_machdep.c index 799f07036c00..291e94df1f21 100644 --- a/sys/riscv/riscv/mp_machdep.c +++ b/sys/riscv/riscv/mp_machdep.c @@ -255,6 +255,7 @@ init_secondary(uint64_t hart) * runtime chip identification. */ identify_cpu(); + printcpuinfo(); /* Enable software interrupts */ riscv_unmask_ipi(); From nobody Tue May 23 13:23:21 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQZky0tBHz4CT8m; Tue, 23 May 2023 13:23:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQZkx5HzQz3sm4; Tue, 23 May 2023 13:23:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684848201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K+K23xUAs3irntLhPSI+AfziquD2B0ZdO7KyJ1akJls=; b=aOLeDZyypLUhkfDuc4AvkpPfvVWVFatDkkJyviFHOrIcPNg949aY6nAWUQ9+twGvX3BjE8 E4e25cJr9K8f5Vi4SD/icu0fsSbfb7VZY9EZgJAPY4Xu4UmscGHb4wUTX00RZK5JBZGK33 ddbrBq9tls5n5bYDQx5Hvc6BC1yCjPYG2vcvi9llPp7zE5Suh35hxkmYAFVY0bP8Dk3P/G yW94Q77GQT8Arkb2XrS0vD8epytBXFrN9+f8JvrLkNhpfPiDEo+SqyEs/JrPS4TmA1wH4C Ab5vMsEHMzWUXHvxKWsOs9nSTyjHKMPiDcozjPqKNKjHkaZl1Cz0jaNwWgNcyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684848201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K+K23xUAs3irntLhPSI+AfziquD2B0ZdO7KyJ1akJls=; b=Uo4+EeNyKPzz43/z0efR00ePUkQ6SXTjRGijWwvUdH00d0CNFScQCUYCcPC+iYQECMzRUk gaN50qxIzj2OrLotYMjtBTgzKMPyqVMMBje4f+98QkN1y6k1Dlwd7RLCwNRxQPSTv92Yy1 y8G/SYQ8JPYuVXtDHRjruIevksxRbuNz/bQdFx2WZ4UHKJuTpbzJWsRzUuAAvSWtyeD5BW LiidHGdd4xzQBjj6CIgJKwyIwwuF6YOMjoHMA3k5oGR3zNvHrKX8y7PD00DxR3yORUzMGc 7+0EnivIA1//V6mYRduESdGi4UxXqHHOKhc0AqlY1dDiNDtNSGh1smG6/XURFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684848201; a=rsa-sha256; cv=none; b=ffSm+t0bMOfeA2OSyi9BP93wi+pwnMB3aJtG9SzCPoLL8w8GeFghcbttLSHmuRoH1BzZzp XY+gc0YG6SNv51dXO0QwlKwX1iMX3F4oGOU4t3UUseHFBWwYhdXdqST9SPLU5j2RESgnRo jyF+81F+2Mppg8KKKl7Ux0A5MToUCtknLeaOLWitDGu6lbymJlz9uDCGzo1qL6aBb6NT6Z gijciiEsQZanVhR6oPqNQJUcHawNEj0NbCj//Z3X+VZLRTYnamThADijBJDPmPDpjedVLS QXvbCsmqir8KjJ6r/ZelGboH/tTjV3HPUHZQJzIUs3GQHycVlR/PR9lwr4bHng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQZkx44WDz11xS; Tue, 23 May 2023 13:23:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34NDNLoU016520; Tue, 23 May 2023 13:23:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NDNL35016519; Tue, 23 May 2023 13:23:21 GMT (envelope-from git) Date: Tue, 23 May 2023 13:23:21 GMT Message-Id: <202305231323.34NDNL35016519@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: b37dc0903332 - main - riscv: Rework CPU identification (second part) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b37dc0903332c4e3b593f1c92df986e8d367d697 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=b37dc0903332c4e3b593f1c92df986e8d367d697 commit b37dc0903332c4e3b593f1c92df986e8d367d697 Author: Mitchell Horne AuthorDate: 2023-05-22 23:51:44 +0000 Commit: Mitchell Horne CommitDate: 2023-05-23 13:06:29 +0000 riscv: Rework CPU identification (second part) Modify when and how we perform parsing and reporting. Most notably, everything now executes on CPU 0. The de-facto standard way to enumerate CPU features (ISA extensions) on RISC-V is by parsing each CPU's ISA string. We currently obtain this information from the device tree, and in the future will be able to pull it from ACPI tables. Eliminate the SYSINIT from identcpu.c. We still need to walk the /cpus list in the device tree, but now do this one CPU at a time, as a step in the identify_cpu() procedure. This is slightly less error prone, and allows us to parse ISA features for CPU 0 much earlier. Make use of the SMP hooks cpu_mp_start() and cpu_mp_announce() to identify and print secondary CPU info, respectively. This causes secondary processor identification to be printed much earlier in boot; everything is done by SI_SUB_CPU, SI_ORDER_THIRD. Adjust some other printf() calls so that we get enough useful info to debug under bootverbose. Reviewed by: markj (slightly earlier version) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39811 --- sys/riscv/include/cpu.h | 4 +- sys/riscv/riscv/identcpu.c | 127 ++++++++++++++++++++++++++++--------------- sys/riscv/riscv/machdep.c | 4 +- sys/riscv/riscv/mp_machdep.c | 32 ++++++++--- 4 files changed, 111 insertions(+), 56 deletions(-) diff --git a/sys/riscv/include/cpu.h b/sys/riscv/include/cpu.h index 64e93e984a9b..b7d83aa0f25d 100644 --- a/sys/riscv/include/cpu.h +++ b/sys/riscv/include/cpu.h @@ -89,8 +89,8 @@ extern char etext[]; void cpu_halt(void) __dead2; void cpu_reset(void) __dead2; void fork_trampoline(void); -void identify_cpu(void); -void printcpuinfo(void); +void identify_cpu(u_int cpu); +void printcpuinfo(u_int cpu); static __inline uint64_t get_cyclecount(void) diff --git a/sys/riscv/riscv/identcpu.c b/sys/riscv/riscv/identcpu.c index c6e93d02cd36..6d82e4a2ad77 100644 --- a/sys/riscv/riscv/identcpu.c +++ b/sys/riscv/riscv/identcpu.c @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #ifdef FDT #include @@ -69,6 +68,7 @@ register_t mimpid; /* The implementation ID */ struct cpu_desc { const char *cpu_mvendor_name; const char *cpu_march_name; + u_int isa_extensions; /* Single-letter extensions. */ }; struct cpu_desc cpu_desc[MAXCPU]; @@ -128,7 +128,7 @@ static const struct { #define ISA_PREFIX_LEN (sizeof(ISA_PREFIX) - 1) static __inline int -parse_ext_s(char *isa, int idx, int len) +parse_ext_s(struct cpu_desc *desc __unused, char *isa, int idx, int len) { /* * Proceed to the next multi-letter extension or the end of the @@ -144,7 +144,7 @@ parse_ext_s(char *isa, int idx, int len) } static __inline int -parse_ext_x(char *isa, int idx, int len) +parse_ext_x(struct cpu_desc *desc __unused, char *isa, int idx, int len) { /* * Proceed to the next multi-letter extension or the end of the @@ -158,7 +158,7 @@ parse_ext_x(char *isa, int idx, int len) } static __inline int -parse_ext_z(char *isa, int idx, int len) +parse_ext_z(struct cpu_desc *desc __unused, char *isa, int idx, int len) { /* * Proceed to the next multi-letter extension or the end of the @@ -196,13 +196,17 @@ parse_ext_version(char *isa, int idx, u_int *majorp __unused, /* * Parse the ISA string, building up the set of HWCAP bits as they are found. */ -static void -parse_riscv_isa(char *isa, int len, u_long *hwcapp) +static int +parse_riscv_isa(struct cpu_desc *desc, char *isa, int len) { - u_long hwcap; int i; - hwcap = 0; + /* Check the string prefix. */ + if (strncmp(isa, ISA_PREFIX, ISA_PREFIX_LEN) != 0) { + printf("%s: Unrecognized ISA string: %s\n", __func__, isa); + return (-1); + } + i = ISA_PREFIX_LEN; while (i < len) { switch(isa[i]) { @@ -212,11 +216,11 @@ parse_riscv_isa(char *isa, int len, u_long *hwcapp) case 'f': case 'i': case 'm': - hwcap |= HWCAP_ISA_BIT(isa[i]); + desc->isa_extensions |= HWCAP_ISA_BIT(isa[i]); i++; break; case 'g': - hwcap |= HWCAP_ISA_G; + desc->isa_extensions |= HWCAP_ISA_G; i++; break; case 's': @@ -234,20 +238,20 @@ parse_riscv_isa(char *isa, int len, u_long *hwcapp) /* * Supervisor-level extension namespace. */ - i = parse_ext_s(isa, i, len); + i = parse_ext_s(desc, isa, i, len); break; case 'x': /* * Custom extension namespace. For now, we ignore * these. */ - i = parse_ext_x(isa, i, len); + i = parse_ext_x(desc, isa, i, len); break; case 'z': /* * Multi-letter standard extension namespace. */ - i = parse_ext_z(isa, i, len); + i = parse_ext_z(desc, isa, i, len); break; case '_': i++; @@ -261,48 +265,46 @@ parse_riscv_isa(char *isa, int len, u_long *hwcapp) i = parse_ext_version(isa, i, NULL, NULL); } - if (hwcapp != NULL) - *hwcapp = hwcap; + return (0); } #ifdef FDT static void -fill_elf_hwcap(void *dummy __unused) +identify_cpu_features_fdt(u_int cpu, struct cpu_desc *desc) { char isa[1024]; - u_long hwcap; phandle_t node; ssize_t len; + pcell_t reg; + u_int hart; node = OF_finddevice("/cpus"); if (node == -1) { - if (bootverbose) - printf("fill_elf_hwcap: Can't find cpus node\n"); + printf("%s: could not find /cpus node in FDT\n", __func__); return; } + hart = pcpu_find(cpu)->pc_hart; + /* - * Iterate through the CPUs and examine their ISA string. While we - * could assign elf_hwcap to be whatever the boot CPU supports, to - * handle the (unusual) case of running a system with hetergeneous - * ISAs, keep only the extension bits that are common to all harts. + * Locate our current CPU's node in the device-tree, and parse its + * contents to detect supported CPU/ISA features and extensions. */ for (node = OF_child(node); node > 0; node = OF_peer(node)) { /* Skip any non-CPU nodes, such as cpu-map. */ if (!ofw_bus_node_is_compatible(node, "riscv")) continue; + /* Find this CPU */ + if (OF_getencprop(node, "reg", ®, sizeof(reg)) <= 0 || + reg != hart) + continue; + len = OF_getprop(node, "riscv,isa", isa, sizeof(isa)); KASSERT(len <= sizeof(isa), ("ISA string truncated")); if (len == -1) { - if (bootverbose) - printf("fill_elf_hwcap: " - "Can't find riscv,isa property\n"); - return; - } else if (strncmp(isa, ISA_PREFIX, ISA_PREFIX_LEN) != 0) { - if (bootverbose) - printf("fill_elf_hwcap: " - "Unsupported ISA string: %s\n", isa); + printf("%s: could not find 'riscv,isa' property " + "for CPU %d, hart %u\n", __func__, cpu, hart); return; } @@ -312,17 +314,50 @@ fill_elf_hwcap(void *dummy __unused) */ for (int i = 0; i < len; i++) isa[i] = tolower(isa[i]); - parse_riscv_isa(isa, len, &hwcap); + if (parse_riscv_isa(desc, isa, len) != 0) + return; - if (elf_hwcap != 0) - elf_hwcap &= hwcap; - else - elf_hwcap = hwcap; + /* We are done. */ + break; + } + if (node <= 0) { + printf("%s: could not find FDT node for CPU %u, hart %u\n", + __func__, cpu, hart); } } +#endif -SYSINIT(identcpu, SI_SUB_CPU, SI_ORDER_ANY, fill_elf_hwcap, NULL); +static void +identify_cpu_features(u_int cpu, struct cpu_desc *desc) +{ +#ifdef FDT + identify_cpu_features_fdt(cpu, desc); #endif +} + +/* + * Update kernel/user global state based on the feature parsing results, stored + * in desc. + * + * We keep only the subset of values common to all CPUs. + */ +static void +update_global_capabilities(u_int cpu, struct cpu_desc *desc) +{ +#define UPDATE_CAP(t, v) \ + do { \ + if (cpu == 0) { \ + (t) = (v); \ + } else { \ + (t) &= (v); \ + } \ + } while (0) + + /* Update the capabilities exposed to userspace via AT_HWCAP. */ + UPDATE_CAP(elf_hwcap, (u_long)desc->isa_extensions); + +#undef UPDATE_CAP +} static void identify_cpu_ids(struct cpu_desc *desc) @@ -364,22 +399,28 @@ identify_cpu_ids(struct cpu_desc *desc) } void -identify_cpu(void) +identify_cpu(u_int cpu) { - struct cpu_desc *desc = &cpu_desc[PCPU_GET(cpuid)]; + struct cpu_desc *desc = &cpu_desc[cpu]; identify_cpu_ids(desc); + identify_cpu_features(cpu, desc); + + update_global_capabilities(cpu, desc); } void -printcpuinfo(void) +printcpuinfo(u_int cpu) { struct cpu_desc *desc; - u_int cpu, hart; + u_int hart; - cpu = PCPU_GET(cpuid); - hart = PCPU_GET(hart); desc = &cpu_desc[cpu]; + hart = pcpu_find(cpu)->pc_hart; + + /* XXX: check this here so we are guaranteed to have console output. */ + KASSERT(desc->isa_extensions != 0, + ("Empty extension set for CPU %u, did parsing fail?", cpu)); /* Print details for boot CPU or if we want verbose output */ if (cpu == 0 || bootverbose) { diff --git a/sys/riscv/riscv/machdep.c b/sys/riscv/riscv/machdep.c index 805cbe2d887b..aae2df569423 100644 --- a/sys/riscv/riscv/machdep.c +++ b/sys/riscv/riscv/machdep.c @@ -128,7 +128,7 @@ cpu_startup(void *dummy) { sbi_print_version(); - printcpuinfo(); + printcpuinfo(0); printf("real memory = %ju (%ju MB)\n", ptoa((uintmax_t)realmem), ptoa((uintmax_t)realmem) / (1024 * 1024)); @@ -539,7 +539,7 @@ initriscv(struct riscv_bootparams *rvbp) /* * Identify CPU/ISA features. */ - identify_cpu(); + identify_cpu(0); /* Do basic tuning, hz etc */ init_param1(); diff --git a/sys/riscv/riscv/mp_machdep.c b/sys/riscv/riscv/mp_machdep.c index 291e94df1f21..cd75f2dbbb73 100644 --- a/sys/riscv/riscv/mp_machdep.c +++ b/sys/riscv/riscv/mp_machdep.c @@ -249,14 +249,6 @@ init_secondary(uint64_t hart) pcpup->pc_curthread = pcpup->pc_idlethread; schedinit_ap(); - /* - * Identify current CPU. This is necessary to setup - * affinity registers and to provide support for - * runtime chip identification. - */ - identify_cpu(); - printcpuinfo(); - /* Enable software interrupts */ riscv_unmask_ipi(); @@ -285,6 +277,9 @@ init_secondary(uint64_t hart) mtx_unlock_spin(&ap_boot_mtx); + if (bootverbose) + printf("Secondary CPU %u fully online\n", cpuid); + /* Enter the scheduler */ sched_ap_entry(); @@ -494,7 +489,8 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg) naps = atomic_load_int(&aps_started); bootstack = (char *)bootstacks[cpuid] + MP_BOOTSTACK_SIZE; - printf("Starting CPU %u (hart %lx)\n", cpuid, hart); + if (bootverbose) + printf("Starting CPU %u (hart %lx)\n", cpuid, hart); atomic_store_32(&__riscv_boot_ap[hart], 1); /* Wait for the AP to switch to its boot stack. */ @@ -512,6 +508,7 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg) void cpu_mp_start(void) { + u_int cpu; mtx_init(&ap_boot_mtx, "ap boot", NULL, MTX_SPIN); @@ -527,12 +524,29 @@ cpu_mp_start(void) case CPUS_UNKNOWN: break; } + + CPU_FOREACH(cpu) { + /* Already identified. */ + if (cpu == 0) + continue; + + identify_cpu(cpu); + } } /* Introduce rest of cores to the world */ void cpu_mp_announce(void) { + u_int cpu; + + CPU_FOREACH(cpu) { + /* Already announced. */ + if (cpu == 0) + continue; + + printcpuinfo(cpu); + } } void From nobody Tue May 23 13:23:22 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQZky6sT2z4CT6j; Tue, 23 May 2023 13:23:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQZky6Bl3z3sxq; Tue, 23 May 2023 13:23:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684848202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZCY2Ulum+ycJZbjvfxUCNotxccs9jqqBa9i0+nSEkfo=; b=BSgpkPLBSN5IXrkrwDEIFiHMTJNfDuYrugGgtQEeBsbRSOmerzdT58uSZ5DGlbGZ3lTbl9 31fusQZjc4k/laykxxaFDqSIariyzbDqA/AAgrl8ZWmBgtIA5gHRBTk2HNppWN2+3LkDGj nQN6zkE77KxTM9yZ12BY7jgM3MnguzUqrj+r06IdUs8DNRb6gNwQ08jqoRUrWCX7QUCZ6e QT++Waxjy6oe84Ova9+bSn9h8vsHzMrbB9zGjZpQD/CNKy3Y1dvdNLz3VdRrJ8iMKIr/Ws bdbSuiCvOGeK89ipskupeGgQSSCUobMvSMpCkt7NrfxtuJm8YKxD7f3jh4aGGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684848202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZCY2Ulum+ycJZbjvfxUCNotxccs9jqqBa9i0+nSEkfo=; b=EAK4qyZoBby6GrzROf93jRyswj8+Fzk1gXvc+IBCnfyvtJfn3aj4WpO++MYXvq390RpIOW qjUU7CsE9BzS8/CcqEKiGiV3Ew+vlw41CDGZNj2kfCoOac82gyteEw8I+vY3Z7ehx2y7oI STy73647vj8TbkZ1M8vx+NacjDB9O1Vr95AwEmuQ17c1+7JXUdN6xBoCZpkh6oUCSfam1E 6vsBgqcOKmmoGS7FPF8akIzVT9ctWuvzRVLpt5aD3WluNqCXXcsHmYqwglf6cPMEfMHjJF kLz612i8+FS/VeiHFqjEZPSZpltpecsb9hozEQ9NBMYF7sCipWYd9vdz2/XWdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684848202; a=rsa-sha256; cv=none; b=JoAKT7bziBYz2Mn2vDcXD/BNg9uYYkXhEdcw722PT5vU8ZPBU5yJqk6EmaaX6mVHb+DGrj QCRsfPUkFlLbHc5sB9IVulEY517Uy2/d/ywsZPYQFE2ACYAfGcNXvepYAvFUFdy3+sYfSH Q23DAw4eZtuK6HYbCltJYTEuRwGvjqadSJD0hjT+zzSPksDjAySqBzpX4L/+ssUok0PN2C 9Cj4/LwGqwDAiYKGV91PeDxQ/I8Y4kVftSLx1hhSk0O6eMYtbR3xVfQ0oaJP/oSS45U2iz dmgRWvhuQy4PY+N6umZrJilOY3Ig1USLl247oQe7A2+PlaafrKTpdumbmNpILg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQZky4p8bz11Qc; Tue, 23 May 2023 13:23: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 34NDNMrt016543; Tue, 23 May 2023 13:23:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NDNM2Y016542; Tue, 23 May 2023 13:23:22 GMT (envelope-from git) Date: Tue, 23 May 2023 13:23:22 GMT Message-Id: <202305231323.34NDNM2Y016542@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 78a3420c20e0 - main - riscv: Print ISA extensions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 78a3420c20e075ca8c44a4670ab5ca5afe6bbdf5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=78a3420c20e075ca8c44a4670ab5ca5afe6bbdf5 commit 78a3420c20e075ca8c44a4670ab5ca5afe6bbdf5 Author: Mitchell Horne AuthorDate: 2023-05-22 23:52:28 +0000 Commit: Mitchell Horne CommitDate: 2023-05-23 13:19:26 +0000 riscv: Print ISA extensions Report the CPU's single-letter ISA extensions in printcpuinfo(). Reviewed by: markj MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39813 --- sys/riscv/riscv/identcpu.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/riscv/riscv/identcpu.c b/sys/riscv/riscv/identcpu.c index 6d82e4a2ad77..d4ad8a1078b6 100644 --- a/sys/riscv/riscv/identcpu.c +++ b/sys/riscv/riscv/identcpu.c @@ -429,5 +429,12 @@ printcpuinfo(u_int cpu) desc->cpu_mvendor_name, desc->cpu_march_name, hart); printf(" marchid=%#lx, mimpid=%#lx\n", marchid, mimpid); + printf(" ISA: %#b\n", desc->isa_extensions, + "\020" + "\01Atomic" + "\03Compressed" + "\04Double" + "\06Float" + "\15Mult/Div"); } } From nobody Tue May 23 13:23:23 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQZl008jTz4CTTf; Tue, 23 May 2023 13:23:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQZkz6hxGz3t5s; Tue, 23 May 2023 13:23:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684848203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LL7bD2mhQmadxEOcEYQ7eJM4/K095AXrzvyi1dd0xGE=; b=NqGEZFxQILOGWRKGulubAHS4WGf2C5Fb3rBjC7k6uQKHqexvpnevnIYZgyDoCNNaQ22Ira jlqMm5uvwM4VjlbaSxJ4iYyBewaQL+/h2YMVEOVhbBM1D1x6PnAm72+KdlSFqIIEvRYoJx WzAniyN9nTT6SSAeJoT0c9PVnW0vJy5BFyz0sh3wDwyE635dMZkzc7LS5c5tuxfC1irjnK k1FnM9GckRuqPUVcEkrf1IXP+pYzxZfcxN2my/ihmvCrZo+g0cmV9cQrkLRKlCK+foAcr1 4U0bxbGXNoBitLj/sOtPXnKY2hsFyDVgha7oky6jGmaEK4WmfcaOYT5vPyZ+iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684848203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LL7bD2mhQmadxEOcEYQ7eJM4/K095AXrzvyi1dd0xGE=; b=pjl8RgRzwlAxoblVjxV6gypAnG5u5SHc+cjbieB+6aM6LjyYhIWkvo50+rjD+3IBpFVlA9 nD/cF4jYMvGKSs7wHufG5SIE8XikHIjsLN0TeBK4QJKzg3sPM9L1b6VRlMKtmJ6kwtU08Z n3m9TVS+/2KTFGLqUdYEUPc3se4WCVvPYknqAqb+LP2cGXC1pMHUFJWF9iPXajDMHrdgUc +MelSQ9HNwwoStfXdSgHHdQ9JzqD9Y9BaZPirf5quFL9vEYI4aXvxr6bMkW+zDAOlrr9Rd pCPZZynpSvIo2ocfUpJDVHR+hpnN6VSotFY679QsdX8VecwGNi34exFRSJHEdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684848204; a=rsa-sha256; cv=none; b=nJPWfKDnEvWUMz9d9th83gnquWhcrGeGOw1dSVC8Hz/rFPQueQ+cXIRYJOiyi1n8yZ1GnP x2s87nj0snqVIqpj/uv5dAfhg+3jI4xhWopqeoHF3FdlA7ru7K5NClnrBD4pFbo1Y/XnO4 JYoROEyrJbqVJxs6OMIOYCn57p4m+1AtGraALJZchDZA+IlpUznp8uii+8xx/ECxAWbbkB CjWVLkYNj8kZRFyfsTGYKaJdYV3dHJmRICEtazGCYPSors1j7CncKlCXkUOd4U+hcy8keB 4A1S0GAHffo45iR7xX2C30xMtxAMnJsRog5AdQEseD0svpdKThpDeVW7sfY5Rg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQZkz5m88z1276; Tue, 23 May 2023 13:23:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34NDNNB9016563; Tue, 23 May 2023 13:23:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NDNNfb016562; Tue, 23 May 2023 13:23:23 GMT (envelope-from git) Date: Tue, 23 May 2023 13:23:23 GMT Message-Id: <202305231323.34NDNNfb016562@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 7245ffd10eda - main - riscv: MMU detection List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7245ffd10eda4ff604840350943d762f70657983 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=7245ffd10eda4ff604840350943d762f70657983 commit 7245ffd10eda4ff604840350943d762f70657983 Author: Mitchell Horne AuthorDate: 2023-05-22 23:53:43 +0000 Commit: Mitchell Horne CommitDate: 2023-05-23 13:19:26 +0000 riscv: MMU detection Detect and report the supported MMU for each CPU. Export the capabilities to the rest of the kernel and use it in pmap_bootstrap() to check for Sv48 support. Reviewed by: markj MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39814 --- sys/riscv/include/cpu.h | 8 ++++++++ sys/riscv/include/md_var.h | 1 + sys/riscv/riscv/identcpu.c | 30 ++++++++++++++++++++++++++++++ sys/riscv/riscv/pmap.c | 2 +- 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/sys/riscv/include/cpu.h b/sys/riscv/include/cpu.h index b7d83aa0f25d..d99142bc3c93 100644 --- a/sys/riscv/include/cpu.h +++ b/sys/riscv/include/cpu.h @@ -83,6 +83,14 @@ /* SiFive marchid values */ #define MARCHID_SIFIVE_U7 MARCHID_COMMERCIAL(7) +/* + * MMU virtual-addressing modes. Support for each level implies the previous, + * so Sv48-enabled systems MUST support Sv39, etc. + */ +#define MMU_SV39 0x1 /* 3-level paging */ +#define MMU_SV48 0x2 /* 4-level paging */ +#define MMU_SV57 0x4 /* 5-level paging */ + extern char btext[]; extern char etext[]; diff --git a/sys/riscv/include/md_var.h b/sys/riscv/include/md_var.h index 890f569782a3..687ab9a3a77e 100644 --- a/sys/riscv/include/md_var.h +++ b/sys/riscv/include/md_var.h @@ -40,6 +40,7 @@ extern u_long elf_hwcap; extern register_t mvendorid; extern register_t marchid; extern register_t mimpid; +extern u_int mmu_caps; struct dumperinfo; struct minidumpstate; diff --git a/sys/riscv/riscv/identcpu.c b/sys/riscv/riscv/identcpu.c index d4ad8a1078b6..01e9fe9b4669 100644 --- a/sys/riscv/riscv/identcpu.c +++ b/sys/riscv/riscv/identcpu.c @@ -65,10 +65,13 @@ register_t mvendorid; /* The CPU's JEDEC vendor ID */ register_t marchid; /* The architecture ID */ register_t mimpid; /* The implementation ID */ +u_int mmu_caps; + struct cpu_desc { const char *cpu_mvendor_name; const char *cpu_march_name; u_int isa_extensions; /* Single-letter extensions. */ + u_int mmu_caps; }; struct cpu_desc cpu_desc[MAXCPU]; @@ -269,6 +272,20 @@ parse_riscv_isa(struct cpu_desc *desc, char *isa, int len) } #ifdef FDT +static void +parse_mmu_fdt(struct cpu_desc *desc, phandle_t node) +{ + char mmu[16]; + + desc->mmu_caps |= MMU_SV39; + if (OF_getprop(node, "mmu-type", mmu, sizeof(mmu)) > 0) { + if (strcmp(mmu, "riscv,sv48") == 0) + desc->mmu_caps |= MMU_SV48; + else if (strcmp(mmu, "riscv,sv57") == 0) + desc->mmu_caps |= MMU_SV48 | MMU_SV57; + } +} + static void identify_cpu_features_fdt(u_int cpu, struct cpu_desc *desc) { @@ -317,6 +334,9 @@ identify_cpu_features_fdt(u_int cpu, struct cpu_desc *desc) if (parse_riscv_isa(desc, isa, len) != 0) return; + /* Check MMU features. */ + parse_mmu_fdt(desc, node); + /* We are done. */ break; } @@ -356,6 +376,11 @@ update_global_capabilities(u_int cpu, struct cpu_desc *desc) /* Update the capabilities exposed to userspace via AT_HWCAP. */ UPDATE_CAP(elf_hwcap, (u_long)desc->isa_extensions); + /* + * MMU capabilities, e.g. Sv48. + */ + UPDATE_CAP(mmu_caps, desc->mmu_caps); + #undef UPDATE_CAP } @@ -429,6 +454,11 @@ printcpuinfo(u_int cpu) desc->cpu_mvendor_name, desc->cpu_march_name, hart); printf(" marchid=%#lx, mimpid=%#lx\n", marchid, mimpid); + printf(" MMU: %#b\n", desc->mmu_caps, + "\020" + "\01Sv39" + "\02Sv48" + "\03Sv57"); printf(" ISA: %#b\n", desc->isa_extensions, "\020" "\01Atomic" diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 8d34dbc3637d..007ec1e678fc 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -704,7 +704,7 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, vm_size_t kernlen) mode = 0; TUNABLE_INT_FETCH("vm.pmap.mode", &mode); - if (mode == PMAP_MODE_SV48) { + if (mode == PMAP_MODE_SV48 && (mmu_caps & MMU_SV48) != 0) { /* * Enable SV48 mode: allocate an L0 page and set SV48 mode in * SATP. If the implementation does not provide SV48 mode, From nobody Tue May 23 13:23:24 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQZl11LXcz4CTn6; Tue, 23 May 2023 13:23: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 4QQZl10SBnz3swV; Tue, 23 May 2023 13:23:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684848205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s0YNOROvuUXqGaUxg+I+yHjz2G3lkeKInvJDvnwJS60=; b=JgfhMxGqjG8KQhgiInnAyj88MwMGZELDafWXZNVom7U2IyLQUV6p9l/ZhFLdXkjqvEUATs etJoXJXamurLchSmZTaTxPLXQpyFxhBS0WzraY6JNUdIQqCNxXFIPsSNcNp4wx+1z3keJh gp0qNbb5D5LIBP/81idDjfe+DN0934qQmtXLX1WicnXW9D4ZJKr1DzmQZFdfOIv/XYCwfo u2nfwC5/NZK8WwzZJl4MxxaOEEMDhZcfnILipF+OWXlBepFfsnUjZaUJDQih+FKBI4SdIb WRrL6Mw7+8dXyYHQ+/yYKSectvx3m1XeylbqhACOvbrAkEFDaxWX8HpkFNVlrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684848205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=s0YNOROvuUXqGaUxg+I+yHjz2G3lkeKInvJDvnwJS60=; b=OuZzYwzmoesqp+uk07Ss4V+5m7pr3oINysTUGVS302xmPCFKATImnWxCv1gdMJ8RlrBNYR TFrVb5nGqxfeXGjAKxn91G0/HZ29JQvwNU0nio2fDrjpYP7PhpF1B3KCfupDoACZ0x3WqQ nUVBwkfcOrcvFrcfX0jJCrF/jOQCBDMkEyTzpQFPoDA816c+iwcMlHInn/4zWTUT6IIuwU ysrPr1VGdeSjw4oZ5l3+xvqMhDtmpAxZ+GvL9p/9AWkBFOJ1isqo+gfXU0ONkGb5N060o2 3xL6kr/ttBvxs2e2/55bvEfqN8FekqVj1HR8i8El2PF7F3y/Agt+hdEA7aRKBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684848205; a=rsa-sha256; cv=none; b=gzUuTpfJrJ0zqSexInWvegy3ZW2QcDNLHoMFQbRDO3VfaaKQ7LoEGKR+0X91TnolKfEvye hglPfNXus4/H0wDkNLcSQ/pPTJ0f6UoCoQrPz7udwicfpqKlxvusFCpewfViBK9yt/7AVB hreyOFMrtkrE7J+vM4SZFtMj21X+MDKswI41lDn3p4Qxugq6tCLPy1NQpyftKEpujGBy7W IMUO2K5S5gX7tfUuaQg+QQkcDkzrjKBZciJcgcpR8P3nL62U7NFaPJ3NxdwsDVtP4GUpY5 le7jZVMSnCFHRe7AearKJ9i93sNI/W75cb/XbYq4j1jKVL7X+ZYJWkL3WrvQCQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQZl06g9cz11vR; Tue, 23 May 2023 13:23:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34NDNOTa016588; Tue, 23 May 2023 13:23:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NDNO5n016587; Tue, 23 May 2023 13:23:24 GMT (envelope-from git) Date: Tue, 23 May 2023 13:23:24 GMT Message-Id: <202305231323.34NDNO5n016587@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 940e6d36de1e - main - riscv: Print less CPU info List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 940e6d36de1ef010f731e290c9b2b08535fff424 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=940e6d36de1ef010f731e290c9b2b08535fff424 commit 940e6d36de1ef010f731e290c9b2b08535fff424 Author: Mitchell Horne AuthorDate: 2023-05-22 23:54:36 +0000 Commit: Mitchell Horne CommitDate: 2023-05-23 13:19:46 +0000 riscv: Print less CPU info Change the reporting strategy to more closely follow what arm64 implements: - Always print the one-line CPU summary when a core comes online - Only print the additional fields (e.g. ISA) when they differ from the CPU before it In the common case of identical CPUs this results in informative but non-repetitive output. For example, in QEMU: CPU 0 : Vendor=Unspecified Core=Unknown (Hart 0) marchid=0x80032, mimpid=0x80032 MMU: 0x7 ISA: 0x112d real memory = 8589934592 (8192 MB) avail memory = 8332300288 (7946 MB) FreeBSD/SMP: Multiprocessor System Detected: 6 CPUs CPU 1 : Vendor=Unspecified Core=Unknown (Hart 1) CPU 2 : Vendor=Unspecified Core=Unknown (Hart 2) CPU 3 : Vendor=Unspecified Core=Unknown (Hart 3) Reviewed by: markj MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40024 --- sys/riscv/riscv/identcpu.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/sys/riscv/riscv/identcpu.c b/sys/riscv/riscv/identcpu.c index 01e9fe9b4669..b68cc5c78352 100644 --- a/sys/riscv/riscv/identcpu.c +++ b/sys/riscv/riscv/identcpu.c @@ -447,18 +447,30 @@ printcpuinfo(u_int cpu) KASSERT(desc->isa_extensions != 0, ("Empty extension set for CPU %u, did parsing fail?", cpu)); - /* Print details for boot CPU or if we want verbose output */ - if (cpu == 0 || bootverbose) { - /* Summary line. */ - printf("CPU %-3u: Vendor=%s Core=%s (Hart %u)\n", cpu, - desc->cpu_mvendor_name, desc->cpu_march_name, hart); + /* + * Suppress the output of some fields in the common case of identical + * CPU features. + */ +#define SHOULD_PRINT(_field) \ + (cpu == 0 || desc[0]._field != desc[-1]._field) + /* Always print summary line. */ + printf("CPU %-3u: Vendor=%s Core=%s (Hart %u)\n", cpu, + desc->cpu_mvendor_name, desc->cpu_march_name, hart); + + /* These values are global. */ + if (cpu == 0) printf(" marchid=%#lx, mimpid=%#lx\n", marchid, mimpid); + + if (SHOULD_PRINT(mmu_caps)) { printf(" MMU: %#b\n", desc->mmu_caps, "\020" "\01Sv39" "\02Sv48" "\03Sv57"); + } + + if (SHOULD_PRINT(isa_extensions)) { printf(" ISA: %#b\n", desc->isa_extensions, "\020" "\01Atomic" @@ -467,4 +479,6 @@ printcpuinfo(u_int cpu) "\06Float" "\15Mult/Div"); } + +#undef SHOULD_PRINT } From nobody Tue May 23 13:59:11 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQbXH34nKz4CWMf; Tue, 23 May 2023 13:59: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 4QQbXH2XG5z40jQ; Tue, 23 May 2023 13:59:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684850351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qdpj660ds/sqyfTDKU4+dTX1SfpaNLAjPVwwc2rfUMM=; b=b/o8C7ZQz6PwhKo0XnxsSMSvOghg/EcjV6/2fhFNngtSSG2sI4SwurMGM1e/m1IvYKSzmD 1HbHjskd2tSTDX+XIh9zd0dSQ4DiRPz6L1m+oEar+Sh5NoBVSWBpcg0infQkjzN6ahHBUg uzds5GvyPQTsYkcyxm+dnoDFUaazjHLzJIzb+CkyoX3nAtaEjWTttHF0TDelTgOgJwnco8 5D6XZ8An7urTZN/qbYzszO8z21V8vPmaS1GQ94yoU7qE0ulcZ1cDwgAWoI96VQWXH/GL7U yzBoUejs4xRBD4LEguS6K6Z9KBkTuZY7yiIaVZ0OZegpwylTRH/uFLkurcxbZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684850351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qdpj660ds/sqyfTDKU4+dTX1SfpaNLAjPVwwc2rfUMM=; b=AhtIxDdvIQhp9Q970JcAmz+4pBCSYO77cVrj0X5riX4NdQOcR0+PfZZmmIhPzSB+bDqO0W +O/4HNCowNBisDIpjRxdegHbO9IUrAL/qbn/JlOm/M51A+XVaJ5Y9QKwR3tHMmyTgbGXKo H3rI6TfPfAnyqB2uajnQE9B7W17WkUWSOM6uJzTw/FUKFQbXlfMz7xKPYkegP8V6+BBdXt W4yTjYncE+5w4pvvSii5PZsd+g+9EXhLz7fqWvbM6vPWflJzLDdt/viD8TTETXDT1xUgNM 4HACLCsdTUzpzV36krsC/EQ1bpy+41Bcu3x+oSrsITXd9BjXsCq1op98UVdBYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684850351; a=rsa-sha256; cv=none; b=sHGjJhopDMCndMWfcGkxfPmjfVCVg698tkNOamKxV9oorEH+3CelEOlJqyassir+7o3vhC gm9yGRHv+ncQrnfcYhL1UgLqoPktimZgAMD/7zoZVS335idpJAqKVoOYLH9BWLMiEskoHZ G/5pyg3UQ5m1kjjqHPlmEWxjIjkor9klWRshrjGwhFRe1mFVKpnQtH5yA1gSaZahU7PuU6 +w/sNW6vG0lEWNraaF9ZXEpYkjSkRn/C/1PyOMPa7W0CmdWjndRqwyFR9NM+m0xP5ujdFz TznRbRUZR/DznMyglOTxcaupVlVAh2nESDG2yhznspJcnRU/EPLnf86gOi+nDg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQbXH1cV4z12w8; Tue, 23 May 2023 13:59: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 34NDxBmP065804; Tue, 23 May 2023 13:59:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NDxBb7065803; Tue, 23 May 2023 13:59:11 GMT (envelope-from git) Date: Tue, 23 May 2023 13:59:11 GMT Message-Id: <202305231359.34NDxBb7065803@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: ecca3180855a - main - kinst: replace KINST_TRAMP_INIT List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ecca3180855a2aa7eb394706c7ae69d9c67b87b5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=ecca3180855a2aa7eb394706c7ae69d9c67b87b5 commit ecca3180855a2aa7eb394706c7ae69d9c67b87b5 Author: Christos Margiolis AuthorDate: 2023-05-23 13:58:36 +0000 Commit: Christos Margiolis CommitDate: 2023-05-23 13:58:36 +0000 kinst: replace KINST_TRAMP_INIT The current implementation of KINST_TRAMP_INIT is working only on amd64, where the breakpoint instruction is one byte long, which might not be the case for other architectures (e.g in RISC-V it's either 2 or 4 bytes). This patch introduces two machine-dependent constants, KINST_TRAMP_FILL_PATTERN and KINST_TRAMP_FILL_SIZE, which hold the fill instruction and the size of that instruction in bytes respectively. Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39504 --- sys/cddl/dev/kinst/amd64/kinst_isa.h | 12 ++++-------- sys/cddl/dev/kinst/trampoline.c | 22 +++++++++++++++++----- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/sys/cddl/dev/kinst/amd64/kinst_isa.h b/sys/cddl/dev/kinst/amd64/kinst_isa.h index 4c6387b8cb50..eb4f79c4c726 100644 --- a/sys/cddl/dev/kinst/amd64/kinst_isa.h +++ b/sys/cddl/dev/kinst/amd64/kinst_isa.h @@ -17,14 +17,10 @@ * have 2 instructions stored in the trampoline, and each of them can take up * to 16 bytes, 32 bytes is enough to cover even the worst case scenario. */ -#define KINST_TRAMP_SIZE 32 -#define KINST_TRAMPCHUNK_SIZE PAGE_SIZE - -/* - * Fill the trampolines with breakpoint instructions so that the kernel will - * crash cleanly if things somehow go wrong. - */ -#define KINST_TRAMP_INIT(t, s) memset((t), KINST_PATCHVAL, (s)) +#define KINST_TRAMP_SIZE 32 +#define KINST_TRAMPCHUNK_SIZE PAGE_SIZE +#define KINST_TRAMP_FILL_PATTERN ((uint8_t []){KINST_PATCHVAL}) +#define KINST_TRAMP_FILL_SIZE sizeof(uint8_t) typedef uint8_t kinst_patchval_t; diff --git a/sys/cddl/dev/kinst/trampoline.c b/sys/cddl/dev/kinst/trampoline.c index 6614a6ed9302..5575503f60fb 100644 --- a/sys/cddl/dev/kinst/trampoline.c +++ b/sys/cddl/dev/kinst/trampoline.c @@ -28,9 +28,6 @@ #include "kinst.h" #include "kinst_isa.h" -/* - * We can have 4KB/32B = 128 trampolines per chunk. - */ #define KINST_TRAMPS_PER_CHUNK (KINST_TRAMPCHUNK_SIZE / KINST_TRAMP_SIZE) struct trampchunk { @@ -47,6 +44,21 @@ SX_SYSINIT(kinst_tramp_sx, &kinst_tramp_sx, "kinst tramp"); static eventhandler_tag kinst_thread_ctor_handler; static eventhandler_tag kinst_thread_dtor_handler; +/* + * Fill the trampolines with KINST_TRAMP_FILL_PATTERN so that the kernel will + * crash cleanly if things somehow go wrong. + */ +static void +kinst_trampoline_fill(uint8_t *addr, int size) +{ + int i; + + for (i = 0; i < size; i += KINST_TRAMP_FILL_SIZE) { + memcpy(&addr[i], KINST_TRAMP_FILL_PATTERN, + KINST_TRAMP_FILL_SIZE); + } +} + static struct trampchunk * kinst_trampchunk_alloc(void) { @@ -77,7 +89,7 @@ kinst_trampchunk_alloc(void) M_WAITOK | M_EXEC); KASSERT(error == KERN_SUCCESS, ("kmem_back failed: %d", error)); - KINST_TRAMP_INIT((void *)trampaddr, KINST_TRAMPCHUNK_SIZE); + kinst_trampoline_fill((uint8_t *)trampaddr, KINST_TRAMPCHUNK_SIZE); /* Allocate a tracker for this chunk. */ chunk = malloc(sizeof(*chunk), M_KINST, M_WAITOK); @@ -171,7 +183,7 @@ kinst_trampoline_dealloc_locked(uint8_t *tramp, bool freechunks) TAILQ_FOREACH(chunk, &kinst_trampchunks, next) { for (off = 0; off < KINST_TRAMPS_PER_CHUNK; off++) { if (chunk->addr + off * KINST_TRAMP_SIZE == tramp) { - KINST_TRAMP_INIT(tramp, KINST_TRAMP_SIZE); + kinst_trampoline_fill(tramp, KINST_TRAMP_SIZE); BIT_SET(KINST_TRAMPS_PER_CHUNK, off, &chunk->free); if (freechunks && From nobody Tue May 23 13:59:33 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQbXn56DCz4CWMs for ; Tue, 23 May 2023 13:59:37 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQbXm5Nk9z413R for ; Tue, 23 May 2023 13:59:36 +0000 (UTC) (envelope-from rrs@netflix.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=netflix.com header.s=google header.b=LPIt0kuh; spf=pass (mx1.freebsd.org: domain of rrs@netflix.com designates 2607:f8b0:4864:20::72b as permitted sender) smtp.mailfrom=rrs@netflix.com; dmarc=pass (policy=reject) header.from=netflix.com Received: by mail-qk1-x72b.google.com with SMTP id af79cd13be357-75b050b4fa0so256991685a.0 for ; Tue, 23 May 2023 06:59:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; t=1684850376; x=1687442376; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=jeoSEAL6mLQTMBn4CGO2KmvRyxJOf97sBuJdGur4X1M=; b=LPIt0kuhYN4ZWIF6ZAZ3IS18TKaADFcAUlLNV90Nd5n5wjwu9jCv5Gmy+4SRcfSmSV VKvHBM9wAl7PZPjaPOLFPGqI9vVLfZaT3ZU90P2KV7idwbBsnPzmBEii/YyAudLLsJbY AqCmIJuo6USAKqNWee6WBGXDOgQ0rLSEond4w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684850376; x=1687442376; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jeoSEAL6mLQTMBn4CGO2KmvRyxJOf97sBuJdGur4X1M=; b=fNEAnF5wC8+Cpq5TeUzwJnU05NzoItF2JMNkCUDmxXk66yDr2oMBzCFw6QwqnYdRsV qlHHCr3BOgx0slcXjeAxWGQxQGWpoJQiNHyJInph74CknNJaOtGwAqHmzmgZyXK3UpGU p0Axj/cXJvOerHg1PXLqtDM87op1u7efCBPjPy5DbF+o9SsE6rZpLIAPUjlTrknmfEG7 af5HrCDKEtXr4ne14/QP7BU1UR6+A2shbO1J7EsMEhy3i8ppDx1ZNXoGSK3ppnYbxPlU 7az5YCavy0RECX/3/rghxJ72bJS7rh/XA5OkJ8OHneo6GmtTgR1R3BhHN8uYV7r/pKo4 YHcg== X-Gm-Message-State: AC+VfDzh4y6gRqbWmvMQ1TyquzBiUmrlMeWFAn3YD3ZYYqQNIvIIYq77 GJXqMl3c0V3h+OQzSyqZhKrgNjsErftPnj+ATKg= X-Google-Smtp-Source: ACHHUZ6pewfwCuFjOxLSL2QsRrsF2g3eQXgnEt1MTgfAdKyfBnxebQCpHJMRu3l801jpgiVxLBXLlg== X-Received: by 2002:a05:620a:2a52:b0:75b:23a1:47b with SMTP id q18-20020a05620a2a5200b0075b23a1047bmr4307784qkp.65.1684850375867; Tue, 23 May 2023 06:59:35 -0700 (PDT) Received: from smtpclient.apple ([2607:fb10:7061:101::637]) by smtp.gmail.com with ESMTPSA id x25-20020a05620a12b900b007576f08d3a0sm2534069qki.44.2023.05.23.06.59.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 May 2023 06:59:35 -0700 (PDT) From: Randall Stewart Message-Id: <1E5C3216-1A6F-43AC-AA91-24FA1EA18842@netflix.com> Content-Type: multipart/signed; boundary="Apple-Mail=_1025A52E-98E4-4DB8-85E6-BD39C353D7B1"; protocol="application/pkcs7-signature"; micalg=sha-256 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.3\)) Subject: Re: git: 73ee5756dee6 - main - Fixes in the tcp infrastructure with respect to stack changes as well as other infrastructure updates for incoming rack features. Date: Tue, 23 May 2023 09:59:33 -0400 In-Reply-To: <20230522070643.99f8aa0c5509c0d3a5f2ae0b@dec.sakura.ne.jp> Cc: Randall Ray Stewart , Antoine Brodin , dev-commits-src-main@freebsd.org To: Tomoaki AOKI References: <20230522070643.99f8aa0c5509c0d3a5f2ae0b@dec.sakura.ne.jp> X-Mailer: Apple Mail (2.3696.120.41.1.3) X-Spamd-Result: default: False [-15.59 / 15.00]; WHITELIST_DMARC(-7.00)[netflix.com:D:+]; WHITELIST_SPF_DKIM(-3.00)[netflix.com:d:+,netflix.com:s:+]; SIGNED_SMIME(-2.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[netflix.com,reject]; R_DKIM_ALLOW(-0.20)[netflix.com:s=google]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.20)[multipart/signed,multipart/alternative,text/plain]; HAS_GOOGLE_REDIR(0.01)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TO_MATCH_ENVRCPT_SOME(0.00)[]; HAS_ATTACHMENT(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; TO_DN_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::72b:from]; BLOCKLISTDE_FAIL(0.00)[2607:fb10:7061:101::637:server fail,2607:f8b0:4864:20::72b:server fail]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~,4:~]; FREEFALL_USER(0.00)[rrs]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[netflix.com:+]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 4QQbXm5Nk9z413R X-Spamd-Bar: --------------- X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_1025A52E-98E4-4DB8-85E6-BD39C353D7B1 Content-Type: multipart/alternative; boundary="Apple-Mail=_2CFBEC81-0A8F-4100-92B3-C15C10F11BC2" --Apple-Mail=_2CFBEC81-0A8F-4100-92B3-C15C10F11BC2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 https://reviews.freebsd.org/D40229 Should fix this :) R > On May 21, 2023, at 6:06 PM, Tomoaki AOKI = wrote: >=20 >> On Tue, Apr 4, 2023 at 12:31=E2=80=AFPM Randall Stewart = wrote: >>>=20 >>> The branch main has been updated by rrs: >>>=20 >>> URL: = https://www.google.com/url?q=3Dhttps://cgit.FreeBSD.org/src/commit/?id%3D7= 3ee5756dee6b2110eb6fb2b2ef3cde39a1fcb4f&source=3Dgmail-imap&ust=3D16853116= 14000000&usg=3DAOvVaw0HmtU6ylNo8jRrPgvtzIB0 >>>=20 >>> commit 73ee5756dee6b2110eb6fb2b2ef3cde39a1fcb4f >>> Author: Randall Stewart >>> AuthorDate: 2023-04-01 05:46:38 +0000 >>> Commit: Randall Stewart >>> CommitDate: 2023-04-01 05:46:38 +0000 >>>=20 >>> Fixes in the tcp infrastructure with respect to stack changes as = well as other infrastructure updates for incoming rack features. >>>=20 >>> So stack switching as always been a bit of a issue. We currently = use a break before make setup which means that >>> if something goes wrong you have to try to get back to a stack. = This patch among a lot of other things changes that so >>> that it is a make before break. We also expand some of the = function blocks in prep for new features in rack that will allow >>> more controlled pacing. We also add other abilities such as the = pathway for a stack to query a previous stack to acquire from >>> it critical state information so things in flight don't get = dropped or mis-handled when switching stacks. We also add the >>> concept of a timer granularity. This allows an alternate stack to = change from the old ticks granularity to microseconds and >>> of course this even gives us a pathway to go to nanosecond = timekeeping if we need to (something for the data center to consider >>> for sure). >>>=20 >>> Once all this lands I will then update rack to begin using all = these new features. >>>=20 >>> Reviewed by: tuexen >>> Sponsored by: Netflix Inc >>> Differential Revision: = https://www.google.com/url?q=3Dhttps://reviews.freebsd.org/D39210&source=3D= gmail-imap&ust=3D1685311614000000&usg=3DAOvVaw1ZouYiMywAnpdYyYCp9T9O >>=20 >> Hi, >>=20 >> Could you hide some stuff in netinet/tcp.h? >> struct http_req breaks curl 8.1.0. >>=20 >> Antoine >=20 > Please refer to Bug 271526 [1], especially Comment 4 [2] by Jonathan > Reynolds. > A patch is proposed there inline (not as an attachment). >=20 > [1] = https://www.google.com/url?q=3Dhttps://bugs.freebsd.org/bugzilla/show_bug.= cgi?id%3D271526&source=3Dgmail-imap&ust=3D1685311614000000&usg=3DAOvVaw2e-= 0D0bz7CAIVj6kvLZOJg >=20 > [2] = https://www.google.com/url?q=3Dhttps://bugs.freebsd.org/bugzilla/show_bug.= cgi?id%3D271526%23c4&source=3Dgmail-imap&ust=3D1685311614000000&usg=3DAOvV= aw154j12MkBXKn2z9_gepR1n >=20 > --=20 > Tomoaki AOKI ------ Randall Stewart rrs@netflix.com --Apple-Mail=_2CFBEC81-0A8F-4100-92B3-C15C10F11BC2 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

Should fix this :)

R
On May 21, 2023, at 6:06 PM, Tomoaki AOKI = <junchoon@dec.sakura.ne.jp> wrote:

On Tue, Apr 4, 2023 at = 12:31=E2=80=AFPM Randall Stewart <rrs@freebsd.org> wrote:

The branch main has been updated = by rrs:

URL: https://www.google.com/url?q=3Dhttps://cgit.FreeBSD.org/src/com= mit/?id%3D73ee5756dee6b2110eb6fb2b2ef3cde39a1fcb4f&source=3Dgmail-imap= &ust=3D1685311614000000&usg=3DAOvVaw0HmtU6ylNo8jRrPgvtzIB0

commit = 73ee5756dee6b2110eb6fb2b2ef3cde39a1fcb4f
Author: =     Randall Stewart <rrs@FreeBSD.org>
AuthorDate: 2023-04-01 05:46:38 +0000
Commit: =     Randall Stewart <rrs@FreeBSD.org>
CommitDate: 2023-04-01 05:46:38 +0000

   Fixes in the tcp infrastructure with = respect to stack changes as well as other infrastructure updates for = incoming rack features.

=    So stack switching as always been a bit of a issue. We = currently use a break before make setup which means that
=    if something goes wrong you have to try to get back to = a stack. This patch among a lot of other things changes that so
   that it is a make before break. We also = expand some of the function blocks in prep for new features in rack that = will allow
   more controlled pacing. We = also add other abilities such as the pathway for a stack to query a = previous stack to acquire from
   it = critical state information so things in flight don't get dropped or = mis-handled when switching stacks. We also add the
=    concept of a timer granularity. This allows an = alternate stack to change from the old ticks granularity to microseconds = and
   of course this even gives us a = pathway to go to nanosecond timekeeping if we need to (something for the = data center to consider
   for sure).

   Once all this lands I will = then update rack to begin using all these new features.

   Reviewed by: tuexen
=    Sponsored by: Netflix Inc
=    Differential Revision: https://www.google.com/url?q=3Dhttps://reviews.freebsd.org/D392= 10&source=3Dgmail-imap&ust=3D1685311614000000&usg=3DAOvVaw1Zou= YiMywAnpdYyYCp9T9O

Hi,

Could you hide some stuff in netinet/tcp.h?
struct http_req breaks curl 8.1.0.

Antoine

Please = refer to Bug 271526 [1], especially Comment 4 [2] by Jonathan
Reynolds.
A patch is proposed there inline (not = as an attachment).

[1] https://www.google.com/url?q=3Dhttps://bugs.freebsd.org/bugzill= a/show_bug.cgi?id%3D271526&source=3Dgmail-imap&ust=3D1685311614000= 000&usg=3DAOvVaw2e-0D0bz7CAIVj6kvLZOJg

[2] https://www.google.com/url?q=3Dhttps://bugs.freebsd.org/bugzill= a/show_bug.cgi?id%3D271526%23c4&source=3Dgmail-imap&ust=3D16853116= 14000000&usg=3DAOvVaw154j12MkBXKn2z9_gepR1n

--
Tomoaki AOKI    <junchoon@dec.sakura.ne.jp>

------
Randall = Stewart



= --Apple-Mail=_2CFBEC81-0A8F-4100-92B3-C15C10F11BC2-- --Apple-Mail=_1025A52E-98E4-4DB8-85E6-BD39C353D7B1 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCAzYw ggMyMIICGqADAgECAgqxywKqrHPB2ybTMA0GCSqGSIb3DQEBCwUAMEcxGDAWBgNVBAMTD1JhbmRh bGwgU3Rld2FydDEeMBwGCSqGSIb3DQEJARYPcnJzQG5ldGZsaXguY29tMQswCQYDVQQGEwJVUzAe Fw0yMTAxMjQxMjIwMTRaFw0yNjAxMjQxMjIwMTRaMEcxGDAWBgNVBAMTD1JhbmRhbGwgU3Rld2Fy dDEeMBwGCSqGSIb3DQEJARYPcnJzQG5ldGZsaXguY29tMQswCQYDVQQGEwJVUzCCASIwDQYJKoZI hvcNAQEBBQADggEPADCCAQoCggEBAMUAht2nr/NFlK+tmmN9PdO3DBPfeYh9fLcbVihR+/dipO41 AsFy9y+2uDVaFhTEvp406P0o9PQQTuYXqrCr76eWQIj3V787e1WKjTup1mIyQeWHGf1gvb/7vmI2 zHg6QZEIC4W8xeO8SLKyHiwlFHZn8Rn1HxtB7Ge+NulygkgUgJYhXD5E29jVGXAc6Qn9Vr9AexPf KaOhHCaNB/Twcinayz6D8CO/Ym1LOs3+ceSOa4cB07fepmbqDSXDkOeA3U7KLaluHrRTlj6DO+JU nqKXX7jJ68KTYSZ0qH4fZsk8cxFkwYI/3HDJi+oF+FDkf7SRo1Q2w+e3M/5MReLIQ7sCAwEAAaMg MB4wDwYJKoZIhvcvAQEKBAIFADALBgNVHQ8EBAMCB4AwDQYJKoZIhvcNAQELBQADggEBAHJfum1j 1WIVFjOJT/hqMIN751aXkablmwesW94lNJKjslPULbbcP5nZGg2lGpHcZ+0I5F/1TTiEsT2H2rhA uAnSsUxTpxRA+aoe+xtJOa5vle3CprhFkHAvB7EIoLiNaPd0DNK6kKYsbvr5Z5Eq7TF3SIO77Qh9 /8VgUfOb0ARDgix59Q6MM0NmIabEwh0cDWQYlGgDDtN9DNk5PGM4pjs48suwEdLmFTMOmGTkCp7I Vq6iHDNinBiB6+BB4VYMAO1o9qS+0pnfdmPJybt0zVGrhm/c1Fmm3Jec7NEuiKeXmhPIwdwMkKyp AsX0sHuFCYwioBTHHZpvnir+H2rRakgxggHrMIIB5wIBATBVMEcxGDAWBgNVBAMTD1JhbmRhbGwg U3Rld2FydDEeMBwGCSqGSIb3DQEJARYPcnJzQG5ldGZsaXguY29tMQswCQYDVQQGEwJVUwIKscsC qqxzwdsm0zANBglghkgBZQMEAgEFAKBpMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZI hvcNAQkFMQ8XDTIzMDUyMzEzNTkzM1owLwYJKoZIhvcNAQkEMSIEIAbYQb7fTKF4Pexr1QJC+70g qQOunEr+EdpzNVV8zuEbMA0GCSqGSIb3DQEBCwUABIIBAKPBGO7X26mbuaKxnYl6ivOAtrO61moD G3s+Z3B9J7huKiT2fMnxDHLnir/Pj4VcYBJKzuI/nEgs5Y8TlP6+rrqjlUKkFckb7poGFyFt3uSK lz8tVA8dheiVisoIt4nOX6zQN/WyeCvp97oHT8KCjf2AQx4ms1DaeZldH5qCTF0kZKhXF6dHX3ET IYTtSHtZqLRh30Ibj2BFqlIKGaTGGuBVaE+kqLNk4RmG7zhSX1nu+JnJvffdERVZz6Jo7nioB+J5 0OudZOgqvOFCrd3JinhelYQg8mPjqc3VxO2poiYcEYOSHiWj1npnxn5dPCA72f/hsh1NOwITBDBK 2uvCCTYAAAAAAAA= --Apple-Mail=_1025A52E-98E4-4DB8-85E6-BD39C353D7B1-- From nobody Tue May 23 14:12:57 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQbrB0sFRz4CX78; Tue, 23 May 2023 14:12: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 4QQbr972N9z41hS; Tue, 23 May 2023 14:12:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684851178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nuNAfJix/D875H/4cTAn3noV0x4prFgxKh90aEuMXQQ=; b=SfxABdaGzbhycWQeDg3WeuibHVkDVdHInO/7NDQUVoTXftLF7irE0SQ1ci2w0JWIDxUTco ZKsSAvn2MA3SlEnOJl5CEJ98b30g8PvAS2dd64x6H90HAuOORUFGFkYpy0j3vCMXWR/dJd eefxBkEFyuT9TNVgiqrcUDECvyMJ0LNJmOh4bJI3OfZwaMNuhzDrTZTSRGQ8vW4SWAbwf1 naRXl9hTzLV8eD8za/r08EeMm2w1VxwGa+BhEwftR/vlKUB8SbVeJsLfrXqzBZsRRsy0jN GCC3O3PGwVvdg52TC7uNcgB8mnND4/8pdd5bRqaaTnqnUP+kJvxnhy9wu+1D5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684851178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nuNAfJix/D875H/4cTAn3noV0x4prFgxKh90aEuMXQQ=; b=f9foawaLiaQK/JiDBdQJIq6IDIDrMFG3yb8F+JEwHmBFaYJ9ik5mGC1q/rdBqbeD92BrCV aQNjTYgDeoUv2ww86vcFiy2JLhbZD5IIqfs6T+sKTGAS8R+U9585bqZw2lMBqr2eONFHOV oaLuS/7kpvsERGakcS82i1VcYMVF2uU5ksThRhS4gz3mw758/ju8DrK6mwfFc5MAG+DNcL /GwPsf9HkbcvHOV5Yqec6MZBz6/3pinRPP9tbE4G0N3hVxpbNgq4lTpL4AK7GceMEgw1iE sxlR8NN7zQXPPK0Mmm75W+iCyY7qgyq1wwNM/tOQ7KUWIHy4X90ydu9PW/qyyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684851178; a=rsa-sha256; cv=none; b=G51Mc/5RJ9dRT8S6sp44HvNKqMI3w6yl9vFlRH0h6jrJrZLJQqnXrJfk/xAFLf1xy++HLN wJenCzZYMqNPy+xJk49pV3V5cj5LgdzoVgscPvPP9g6M1I5Fdc+hi+rBns0zfwIUrFYdLA Mp0GzGyI1H76JwjwqJoohq3EGDN460wXt7R7VKAbpwYV96QcqeGGQdBbPHZHwzrHbu0Prg UP0gn6ZLQqnDA9H+ULZlrDvSnFq7afOGyJZdG9b+idM7OKSc+p5sHqTT2+GyUfH+sMsH/6 67q2h4M6nKLIS5YSeZnJHcUUzl2GgtiFcxSmCfa3ydJWvMpsMSC5biyhJW+uKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQbr965lyz13Ns; Tue, 23 May 2023 14:12:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34NECvF5098667; Tue, 23 May 2023 14:12:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NECv5s098666; Tue, 23 May 2023 14:12:57 GMT (envelope-from git) Date: Tue, 23 May 2023 14:12:57 GMT Message-Id: <202305231412.34NECv5s098666@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: c4a32455d9cb - main - pf: remove the use of caddr_t List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c4a32455d9cb7f680964243341cfd0f2448eee64 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c4a32455d9cb7f680964243341cfd0f2448eee64 commit c4a32455d9cb7f680964243341cfd0f2448eee64 Author: Kristof Provost AuthorDate: 2023-05-19 18:56:46 +0000 Commit: Kristof Provost CommitDate: 2023-05-23 14:11:13 +0000 pf: remove the use of caddr_t Replace caddr_t with void *, or more accurate types. Suggested by: glebius Reviewed by: zlei Differential Revision: https://reviews.freebsd.org/D40186 --- sys/net/pfvar.h | 6 +++--- sys/netpfil/pf/pf_ioctl.c | 4 ++-- sys/netpfil/pf/pf_norm.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index e3e467500b94..4bdfa22b58ab 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1704,7 +1704,7 @@ struct pfioc_state_kill { struct pfioc_states { int ps_len; union { - caddr_t ps_buf; + void *ps_buf; struct pfsync_state *ps_states; }; }; @@ -1713,7 +1713,7 @@ struct pfioc_states_v2 { int ps_len; uint64_t ps_req_version; union { - caddr_t ps_buf; + void *ps_buf; struct pf_state_export *ps_states; }; }; @@ -1721,7 +1721,7 @@ struct pfioc_states_v2 { struct pfioc_src_nodes { int psn_len; union { - caddr_t psn_buf; + void *psn_buf; struct pf_src_node *psn_src_nodes; }; }; diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index d5cea7d2a215..b71104a77996 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -1447,8 +1447,8 @@ pf_setup_pfsync_matching(struct pf_kruleset *rs) if (rs->rules[rs_cnt].inactive.rcount) { rs->rules[rs_cnt].inactive.ptr_array = - malloc(sizeof(caddr_t) * - rs->rules[rs_cnt].inactive.rcount, + mallocarray(rs->rules[rs_cnt].inactive.rcount, + sizeof(struct pf_rule **), M_TEMP, M_NOWAIT); if (!rs->rules[rs_cnt].inactive.ptr_array) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 8b267636751a..a902937c1253 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -883,7 +883,7 @@ pf_reassemble6(struct mbuf **m0, struct ip6_hdr *ip6, struct ip6_frag *fraghdr, /* Take protocol from first fragment header. */ m = m_getptr(m, hdrlen + offsetof(struct ip6_frag, ip6f_nxt), &off); KASSERT(m, ("%s: short mbuf chain", __func__)); - proto = *(mtod(m, caddr_t) + off); + proto = *(mtod(m, uint8_t *) + off); m = *m0; /* Delete frag6 header */ @@ -967,7 +967,7 @@ pf_refragment6(struct ifnet *ifp, struct mbuf **m0, struct m_tag *mtag, m = m_getptr(m, extoff + offsetof(struct ip6_ext, ip6e_nxt), &off); KASSERT((m != NULL), ("pf_refragment6: short mbuf chain")); - proto = *(mtod(m, caddr_t) + off); + proto = *(mtod(m, uint8_t *) + off); *(mtod(m, char *) + off) = IPPROTO_FRAGMENT; m = *m0; } else { From nobody Tue May 23 14:12:58 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQbrC1hSHz4CWht; Tue, 23 May 2023 14:12: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 4QQbrC0xdDz41Wp; Tue, 23 May 2023 14:12:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684851179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GXvaUMqHQvlOuA1jVjyD7+X94taq1MHzzqJmthDDOYQ=; b=VXqD8pV2mPRaoUFFfMRo0sIDMKhPCZkDaJakP3kzekeW/q2W6Ul6sJHaje60HZwU+a6CLD Cb7LcLFT1D9NfF7aZ2JhSDCONlo6y6JcK7CRZTrXpdP86R7cXW2+Lt82stKWhmv6SuhtyM OAIlaVMDPdtwBnACSDrwLDotSZ3SWhFGTWK3NIaoZYUjFt1kz1AlyI985/uXBmqFMC1YS0 TfdDkO8ZZxYGMDEn8mUwdGxMHGnsPqjAJC2yNr4bAOuqrmQiAPn3Pi3PUOpcr/Be6BY6ZR 9HoMeGpLDuqws08ylTPVgAXo+otxHmZzxMecFf+3E4cJnNLkbanzzkITCfL5xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684851179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GXvaUMqHQvlOuA1jVjyD7+X94taq1MHzzqJmthDDOYQ=; b=p0NC1nWMgbEPlmtEQ80bMBMDHYh5jfP80Fn2R6dyZcyYf/GLeByFRPI8TqpOKQhhvUuaT2 3Fmp2EM71HrGNC5pzu3dG4Slwp495AgP50oKAGrOcZtxGlOXqH8XltLuqjUSFTMPfC88NZ YKffEngM/7v8ZBfksSqGjmrd3sC5fhojSzfmtNUsdPKYIeFZK8DVCNUVtiJhjKxlNCQgGv umdc2teQw5M+lm6faUdCkC9DNKAJR0TbPAKb1KLmjYQa86nrsdDKhiIHd8W8E6YXZ//1Jl 5x5HhN6awrXg8gyFN9wYvo1hnkkB3W9xBoPfNfuEuaPYLj97LnPeApzxaJV6fg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684851179; a=rsa-sha256; cv=none; b=e/1RG3s/jPjGITlhQ69cZ4LltEh2nNjQHschY+p6g18VtBokTtJN+jpqOjdA1ccEI3MeZl 2MnVWER6jxN/E27dS27AAOidY3if7Yottim8nIE8gvv2r2jDp1NCGlxhh4tPDH6CzGXZ65 HEi6EJE4O4z4n5EBihKLjKOUSrvwRQfUKZFzIrwMDwCfDx680kNW9FqQSGyuWH4t/oxnMj vBQeBpPlmDKSF7bvsdnIcRFrlLrCMY2jTE19IqdlwHxvypTHrA6EfzNFjSqsKzj4QMroGr 29/fzc+Z0/VqR3jJw7E8qOaU2pYSXUekzTlS7xgkKoQWmigTdpw5PNIz9lYmjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQbrB724lz12fR; Tue, 23 May 2023 14:12: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 34NECw3J098686; Tue, 23 May 2023 14:12:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NECwcN098685; Tue, 23 May 2023 14:12:58 GMT (envelope-from git) Date: Tue, 23 May 2023 14:12:58 GMT Message-Id: <202305231412.34NECwcN098685@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 81877287a99e - main - if_ovpn: ensure we never re-use sequence numbers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 81877287a99e55b47a7045efa76945f368e90917 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=81877287a99e55b47a7045efa76945f368e90917 commit 81877287a99e55b47a7045efa76945f368e90917 Author: Kristof Provost AuthorDate: 2023-05-20 17:43:49 +0000 Commit: Kristof Provost CommitDate: 2023-05-23 14:11:26 +0000 if_ovpn: ensure we never re-use sequence numbers if_ovpn already notified userpsace when there was a risk of sequence number re-use, but it trusted userspace to actually rotate the key. Convert the internal sequence number counter to 64 bits so we can detect overflows and then refuse to send packets. Event: BSDCan 2023 Reviewed by: Leon Dang Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D40187 --- sys/net/if_ovpn.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index 3aec073c052e..49c8c8e9677a 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -93,7 +93,7 @@ struct ovpn_kkey_dir { * strictly higher than this. */ uint32_t rx_seq; - uint32_t tx_seq; + uint64_t tx_seq; /* Seen packets, relative to rx_seq. bit(0) will always be 0. */ uint64_t rx_window; @@ -1830,6 +1830,7 @@ ovpn_transmit_to_peer(struct ifnet *ifp, struct mbuf *m, struct ovpn_softc *sc; struct cryptop *crp; uint32_t af, seq; + uint64_t seq64; size_t len, ovpn_hdr_len; int tunnel_len; int ret; @@ -1873,11 +1874,24 @@ ovpn_transmit_to_peer(struct ifnet *ifp, struct mbuf *m, ohdr->opcode |= key->peerid; ohdr->opcode = htonl(ohdr->opcode); - seq = atomic_fetchadd_32(&peer->keys[OVPN_KEY_SLOT_PRIMARY].encrypt->tx_seq, 1); - if (seq == OVPN_SEQ_ROTATE) + seq64 = atomic_fetchadd_64(&peer->keys[OVPN_KEY_SLOT_PRIMARY].encrypt->tx_seq, 1); + if (seq64 == OVPN_SEQ_ROTATE) { ovpn_notify_key_rotation(sc, peer); + } else if (seq64 > UINT32_MAX) { + /* We've wrapped, give up on this packet. */ + if (_ovpn_lock_trackerp != NULL) + OVPN_RUNLOCK(sc); + OVPN_COUNTER_ADD(sc, nomem_data_pkts_out, 1); + + /* Let's avoid (very unlikely, but still) wraparounds of the + * 64-bit counter taking us back to 0. */ + atomic_set_64(&peer->keys[OVPN_KEY_SLOT_PRIMARY].encrypt->tx_seq, + UINT32_MAX); + + return (ENOBUFS); + } - seq = htonl(seq); + seq = htonl(seq64 & UINT32_MAX); ohdr->seq = seq; OVPN_PEER_COUNTER_ADD(peer, pkt_out, 1); From nobody Tue May 23 14:19:48 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQc044Z3kz4CXSx; Tue, 23 May 2023 14:19: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 4QQc0447Ghz42xD; Tue, 23 May 2023 14:19:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684851588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nzZu3lFIsgESrcIhi0hDJWjqvv29bh+PcFudtew9WsY=; b=rcyxhmeywVyOIfNaJ9wm4wuMJgsoHTe9hPXMnRoTXCjdrb7z3E4iwDXDzdhO2quQFCNtjF qulfiaRkOtnHPP8tI2/dGCcqscH0xMcdr0x9nV/gK/ySXSIhJwsYdbDc/aHpuKf/OhQvPD fK/UkcNG8pitSqo7Ina+mWYwIYlcg/QKzKkUHPKL6VOeJrSytcCS6J/FQTeREx9jJBOsvf 6v2bILypKiaxEw6HtWgfnh+t6FjY/srxwncA+RDktcfpwGcgFvxpfs0a0M7TCDglmdhM+H grjAUq6PeENi3xA3PVCuvYQ/4xnYSuUYYZXLLyaiQaqqnAPUY6F1Wq5+0Yr9nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684851588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nzZu3lFIsgESrcIhi0hDJWjqvv29bh+PcFudtew9WsY=; b=CpAe8idjfoQ+wgywXh58Rht3Ppi602ZM8vpLteeVYWsh0kwAh/W1dds9HFZLkeIB11hPH5 WyljwGGlCAFbzXHwJott1muGCFCrGF586RHifeJ528iO3oER4uwZxs+mw1zSsf7YZWbJA/ v0s42lCoffJXUI/YLdUwuccZFiSoBGwMkPlFFGBwOpGfy9hb9iK0mmeFiFRevvk3rzDE58 fZd99FYWY06q6At0aU+7YzNCbjgCprP+L+JcwcSOY/6NVfjCY9uI05wuJ4YCX2ZemOXa/A i8SY/FWWzXLU0ngxCOgpDKUu1eobnQwYrv+vk21X2UBcqEItMjcL6uCMSiR8fA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684851588; a=rsa-sha256; cv=none; b=G3T0k9trcuv/4gz4ARfu/kJZ6STXAab89OyytDwdIG5cAf6rezW+8XCpfjWFv+S6GwEmXK W87Zyqds8rUydMSxLTxN5BpNW4aMYNAs8wSALyQ6F5QhNk+6mds39gAwQtOUbjM62wKwe5 bf/N64gazB8KzZqGPGd0CkAxjzP9mv4ykasCTGUttXHxSxeOzy2s2eE/SH97h0UHIGrAGj fqpK1ry12yZOB7/29Mp/uymKCvrShE2liQm3HuZe7Zwq2ZtqSTp3wapTOOSYyV2iu/Hu/5 CuBaYYqXTDgYXPFlm6D4BBkqUgZ7a8l5UNTkETSBSBca6fK3lazRzhjDHHIR2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQc043BbLz13QP; Tue, 23 May 2023 14:19: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 34NEJmxo099876; Tue, 23 May 2023 14:19:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NEJm9T099875; Tue, 23 May 2023 14:19:48 GMT (envelope-from git) Date: Tue, 23 May 2023 14:19:48 GMT Message-Id: <202305231419.34NEJm9T099875@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 1e136a9cbd3a - main - dtrace(1): add -d flag to dump D script post-dt_sugar List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1e136a9cbd3a9d137037e47a53c1dba3be7f6925 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=1e136a9cbd3a9d137037e47a53c1dba3be7f6925 commit 1e136a9cbd3a9d137037e47a53c1dba3be7f6925 Author: Christos Margiolis AuthorDate: 2023-05-23 14:18:39 +0000 Commit: Christos Margiolis CommitDate: 2023-05-23 14:18:39 +0000 dtrace(1): add -d flag to dump D script post-dt_sugar By specifying the -d flag, libdtrace will dump the D script after it has applied syntactical sugar transformations (e.g if/else). This is useful for both understanding what dt_sugar does, as well as debugging it. Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38732 --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 10 ++++++++-- cddl/contrib/opensolaris/cmd/dtrace/dtrace.c | 9 +++++++-- cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c | 16 +++++++++++----- cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h | 3 ++- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index 8724b27f4cbb..c3c7b4cdc818 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -20,7 +20,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 7, 2021 +.Dd February 24, 2023 .Dt DTRACE 1 .Os .Sh NAME @@ -29,7 +29,7 @@ .Sh SYNOPSIS .Nm .Op Fl 32 | Fl 64 -.Op Fl aACeFGhHlqSvVwZ +.Op Fl aACdeFGhHlqSvVwZ .Op Fl b Ar bufsz .Op Fl c Ar cmd .Op Fl D Ar name Op Ns = Ns value @@ -195,6 +195,12 @@ option. For a description of the set of tokens defined by the D compiler when invoking the C preprocessor, see .Fl X . +.It Fl d +Dump the D script to standard output, after syntactic transformations have been +applied. +For example, if-statements in D are implemented using such transformations: a +conditional clause in a probe body is replaced at compile-time by a separate +probe predicated on the original condition. .It Fl D Ar name Op Ns = Ns value Define .Ar name diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c index 06eff2055c17..cdc476a43b08 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c @@ -77,7 +77,7 @@ typedef struct dtrace_cmd { #define E_USAGE 2 static const char DTRACE_OPTSTR[] = - "3:6:aAb:Bc:CD:ef:FGhHi:I:lL:m:n:o:p:P:qs:SU:vVwx:X:Z"; + "3:6:aAb:Bc:CdD:ef:FGhHi:I:lL:m:n:o:p:P:qs:SU:vVwx:X:Z"; static char **g_argv; static int g_argc; @@ -130,7 +130,7 @@ usage(FILE *fp) { static const char predact[] = "[[ predicate ] action ]"; - (void) fprintf(fp, "Usage: %s [-32|-64] [-aACeFGhHlqSvVwZ] " + (void) fprintf(fp, "Usage: %s [-32|-64] [-aACdeFGhHlqSvVwZ] " "[-b bufsz] [-c cmd] [-D name[=def]]\n\t[-I path] [-L path] " "[-o output] [-p pid] [-s script] [-U name]\n\t" "[-x opt[=val]] [-X a|c|s|t]\n\n" @@ -152,6 +152,7 @@ usage(FILE *fp) "\t-b set trace buffer size\n" "\t-c run specified command and exit upon its completion\n" "\t-C run cpp(1) preprocessor on script files\n" + "\t-d dump script after syntactic transformations\n" "\t-D define symbol when invoking preprocessor\n" "\t-e exit after compiling request but prior to enabling probes\n" "\t-f enable or list probes matching the specified function name\n" @@ -1559,6 +1560,10 @@ main(int argc, char *argv[]) g_cflags |= DTRACE_C_CPP; break; + case 'd': + g_cflags |= DTRACE_C_SUGAR; + break; + case 'D': if (dtrace_setopt(g_dtp, "define", optarg) != 0) dfatal("failed to set -D %s", optarg); diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c index e63771c91e08..f3fda4af834e 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c @@ -2478,10 +2478,7 @@ dt_compile(dtrace_hdl_t *dtp, int context, dtrace_probespec_t pspec, void *arg, "not referenced)\n", yypcb->pcb_sargv[argc - 1], argc - 1); } - /* - * Perform sugar transformations (for "if" / "else") and replace the - * existing clause chain with the new one. - */ + /* Perform sugar transformations. */ if (context == DT_CTX_DPROG) { dt_node_t *dnp, *next_dnp; dt_node_t *new_list = NULL; @@ -2492,8 +2489,17 @@ dt_compile(dtrace_hdl_t *dtp, int context, dtrace_probespec_t pspec, void *arg, next_dnp = dnp->dn_list; dnp->dn_list = NULL; - if (dnp->dn_kind == DT_NODE_CLAUSE) + if (dnp->dn_kind == DT_NODE_CLAUSE) { dnp = dt_compile_sugar(dtp, dnp); + if (cflags & DTRACE_C_SUGAR) { + dt_node_t *p; + + dt_printd(dnp, stdout, 0); + for (p = dnp->dn_list; p != NULL; + p = p->dn_list) + dt_printd(p, stdout, 0); + } + } /* append node to the new list */ new_list = dt_node_link(new_list, dnp); } diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h b/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h index f0bc83a7fc7b..af0213695f32 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h @@ -119,10 +119,11 @@ typedef struct dtrace_proginfo { #define DTRACE_C_PSPEC 0x0080 /* Interpret ambiguous specifiers as probes */ #define DTRACE_C_ETAGS 0x0100 /* Prefix error messages with error tags */ #define DTRACE_C_ARGREF 0x0200 /* Do not require all macro args to be used */ +#define DTRACE_C_SUGAR 0x0400 /* Dump D script post-dt_sugar */ #define DTRACE_C_DEFARG 0x0800 /* Use 0/"" as value for unspecified args */ #define DTRACE_C_NOLIBS 0x1000 /* Do not process D system libraries */ #define DTRACE_C_CTL 0x2000 /* Only process control directives */ -#define DTRACE_C_MASK 0x3bff /* mask of all valid flags to dtrace_*compile */ +#define DTRACE_C_MASK 0x3fff /* mask of all valid flags to dtrace_*compile */ extern dtrace_prog_t *dtrace_program_strcompile(dtrace_hdl_t *, const char *, dtrace_probespec_t, uint_t, int, char *const []); From nobody Tue May 23 14:19:49 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQc056HZhz4CXJK; Tue, 23 May 2023 14:19: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 4QQc055gNTz42rV; Tue, 23 May 2023 14:19:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684851589; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jdZbeSAsCLwg87TUHSiPmwCop11oq8IrDV+xuu6yP4o=; b=Xoacm+Nl/pK72x4Nxrqj2bzuuAa1W5mEyhQsMbnnuj/kLZyOMrJHXpm6/4G2FIWih/td5Y FtsH8KYKJhI4V1sh//+/O3bQGcRHkXXNZGTm1ElewwlxtwhB6B+bBuuyzeAACj9CP6p1mw gC68ZY1qhqxmiuO8H1NNM4kHWS/Gsi4y79FRMuagKZwYhPrf4dEXhp7PVCRt09zmMyJxV+ stn/gyuZhvxFW61ToXjtGkOFi4hU/n6ql6u57ylt5hLbkbK6UtE4uGK7Lw8pc5r1hFSmUC s1EfsGtd2AmJI+IWImNdeZLiXkJH8NgqsKAeMMd/iMZglfSAjWMrYLIs9yy6Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684851589; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jdZbeSAsCLwg87TUHSiPmwCop11oq8IrDV+xuu6yP4o=; b=qn1PhkzyX4y9F7x4FsUsMkTE3RJjXLg6fvzXxXf/suNEbpiDu7N7Adg34e+v9BpwVC5ncJ Sj/iYvZusivhnFDrjw6+8Fu44dFED/ND5PIP8gsVpR1dRkrr+PUDg6DkzvDbUrWdiUZXx4 +v0jiVHN6PqVRdYMApf5dDjKwXK1luKJM3XrCRfI3z0SJuT0+evQp2A52wKo9orsfO21Vo 3nmlIacfxrruhdhS7ifyHl244g4op9LQlxys34n5P42I8Sz3KkU3Vj3s0sje4rzhfZ0sE9 PCDNFPGzUTKdFwNlm3gaQbHQlIZf2Wa91mpRUNrHd+DMxSCuT2lDAN/uC0C8HA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684851589; a=rsa-sha256; cv=none; b=QEduW1orrZlv1XcZbrjL9Ra4Kgx36loKOWZ2SkiyRjZHJvLZEtSCeU5iD22RNN4HHAcetj s4sB+17oe6RflqfjbWlexYB25t6lTp435Q1aL2+pFoJ+AuynMPGjBQMKs467YF0EyflBUU KZ5VS2vbWNA9JnFCM1D6hOYKh7UJjHxmL20pZtrOJ7pXFksvxmmCBVzUoIVHxZ4CEOP+6u KEr/JtNme9W74DdVngQhZyY7XE09Subc3fyYEcCXZV2RtXFMoKwuC4xKXD0PRNF4G6vonU A3LDD+9J4tcjYvAJlMWrl3dXHX6bhnWKG+nU8tCmZpSGYb5DfdGxN+EoA3X+KA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQc0543tnz13Sg; Tue, 23 May 2023 14:19: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 34NEJnWs099896; Tue, 23 May 2023 14:19:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NEJnw3099895; Tue, 23 May 2023 14:19:49 GMT (envelope-from git) Date: Tue, 23 May 2023 14:19:49 GMT Message-Id: <202305231419.34NEJnw3099895@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 27ff920e6a0e - main - dtrace: remove ifdef around dtrace_instr_size() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 27ff920e6a0e0a918b3addb8cb0704949e41b374 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=27ff920e6a0e0a918b3addb8cb0704949e41b374 commit 27ff920e6a0e0a918b3addb8cb0704949e41b374 Author: Christos Margiolis AuthorDate: 2023-05-23 14:19:04 +0000 Commit: Christos Margiolis CommitDate: 2023-05-23 14:19:04 +0000 dtrace: remove ifdef around dtrace_instr_size() Architectures that are not included in the #ifdef won't be able to compile libdtrace. This was tested on an ARM64 build. If the ifdef is removed, libdtrace can be compiled with no problems, otherwise it fails at libdtrace. Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39948 --- sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h index 6b09a1761af9..a9730c356e9e 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h @@ -2427,9 +2427,7 @@ extern void dtrace_helpers_destroy(proc_t *); #endif /* _KERNEL */ -#if defined(__i386) || defined(__amd64) || defined (__riscv) extern int dtrace_instr_size(uint8_t *instr); -#endif #if defined(__i386) || defined(__amd64) extern int dtrace_dis_get_byte(void *p); From nobody Tue May 23 14:19:50 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQc071GCZz4CXJM; Tue, 23 May 2023 14:19: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 4QQc066H2dz430x; Tue, 23 May 2023 14:19:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684851590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RrNwjqS55bMMhWW/dsHj+4eD/rBxkaJ9BNwN4uoIVV8=; b=NI3JwMkfh+FVIipkrjNHuID4UkcPrcbtQg4ltYU078/BQkK5/CmJwtpTA+MTfFWszrMbNd 6ReI8n7pApqGIrgXiovEQ5+7Ig5YL5lI2RDhTzWw76sW/DPT+2LGSGOdtAag/Y50xuUZBF nInqIDL94yUZt7PaNezvWCdxsiUekYSxf+Ane/Z/PH0XN/Ljehtr/ArztAXnj3p9ye3vnj MOzdyIo+z20kAbActljRBnz+iZ+o8VCJ11JVY9baSCTFlUl3GRgQTVWPM47qNpLRM/nSUi ClwaRZ1g46mTobhqk4mHeTH/YZobpOq7aY/Lnn0Z2t3jth2AH4Rjfyb4nCW3sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684851590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RrNwjqS55bMMhWW/dsHj+4eD/rBxkaJ9BNwN4uoIVV8=; b=N4vu1cd1HS2VPthj4PDdBAa9+PP0iN6DHUp5Qd2j5XsfnCKqyR9kDRZR4E3ib5oEj+KnN1 6RIScrx5HOlZDM8I+fRkeGeZM8nTTx2tz/bFror4Hjf1zpIRsFkhfRKLtC8dnwFyHVzkR9 ixFGoUqPYrOi44CGfxks32MK0x/ak32wmy1gemIKTtnGSSfJ5bHOovrsugggUJ9dYRJy2l RdK3BRvXi1UkWk4727M0Z6t4AAfIuPV5L+cV5knzHMauzQdwYyXX4S5zi8F7yGLNdiSTnt St4YwEWURls5g+gJ6b9fOwzQlqMOtORHSvo/uqSKONYgqDj/nTYxemG4bn430A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684851590; a=rsa-sha256; cv=none; b=ybdM6q9URct5EMxD3hciLm8rPl1k/o+tZjLqKkZP5Nnbe5foiwHMt0o3LB7YBJK7Y1IBaV GCQ+QqIAGju1LQghyvRIu42aEjRA5Rr/OOYp3/wrhVxLTgNiKmFtin68S2mKH4oavjaqdh UVidthSJRlEOqiPl/lSF/m0TuGKzJqPgm2SqCcl4KA+Yfdbe8dzhGMVv+J0eYum/X2ye8c 4kaGw5jwVIC2Ki2QcTgEs9KtDE4ssdRW+AvKN6Yz/0jTPkwtsC09ZDnxU6HBkObIwM1n2Z Um12rIWmUJRYZUL5S7gncZ3XGYK55cjawFS5dJFjdh23qPFtX8HqIR/nBKqYSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQc0650KCz13PK; Tue, 23 May 2023 14:19: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 34NEJopB099922; Tue, 23 May 2023 14:19:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NEJocl099921; Tue, 23 May 2023 14:19:50 GMT (envelope-from git) Date: Tue, 23 May 2023 14:19:50 GMT Message-Id: <202305231419.34NEJocl099921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: db05f9fbfb1a - main - dtrace: implement dtrace_instr_size() for arm64 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: db05f9fbfb1a92caccaf37154666a99373028588 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=db05f9fbfb1a92caccaf37154666a99373028588 commit db05f9fbfb1a92caccaf37154666a99373028588 Author: Christos Margiolis AuthorDate: 2023-05-23 14:19:15 +0000 Commit: Christos Margiolis CommitDate: 2023-05-23 14:19:15 +0000 dtrace: implement dtrace_instr_size() for arm64 Reviewed by: markj Approved by; markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39955 --- cddl/lib/libdtrace/Makefile | 4 ++++ sys/cddl/dev/dtrace/aarch64/instr_size.c | 14 ++++++++++++++ sys/modules/dtrace/dtrace/Makefile | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/cddl/lib/libdtrace/Makefile b/cddl/lib/libdtrace/Makefile index 468603633658..5232293e0be5 100644 --- a/cddl/lib/libdtrace/Makefile +++ b/cddl/lib/libdtrace/Makefile @@ -131,6 +131,10 @@ SRCS+= instr_size.c DSRCS+= regs_riscv.d .endif +.if ${MACHINE_CPUARCH} == "aarch64" +SRCS+= instr_size.c +.endif + YFLAGS+=-d LIBADD= ctf elf proc pthread rtld_db diff --git a/sys/cddl/dev/dtrace/aarch64/instr_size.c b/sys/cddl/dev/dtrace/aarch64/instr_size.c new file mode 100644 index 000000000000..35964c0f0f78 --- /dev/null +++ b/sys/cddl/dev/dtrace/aarch64/instr_size.c @@ -0,0 +1,14 @@ +/* + * SPDX-License-Identifier: CDDL 1.0 + * + * Copyright 2023 Christos Margiolis + */ + +#include +#include + +int +dtrace_instr_size(uint8_t *instr __unused) +{ + return (INSN_SIZE); +} diff --git a/sys/modules/dtrace/dtrace/Makefile b/sys/modules/dtrace/dtrace/Makefile index 1513418281ad..04829bd1d2c4 100644 --- a/sys/modules/dtrace/dtrace/Makefile +++ b/sys/modules/dtrace/dtrace/Makefile @@ -24,7 +24,7 @@ CFLAGS+= -I${SYSDIR}/cddl/contrib/opensolaris/uts/intel \ -I${SYSDIR}/cddl/dev/dtrace/x86 .endif -.if ${MACHINE_CPUARCH} == "riscv" +.if ${MACHINE_CPUARCH} == "riscv" || ${MACHINE_CPUARCH} == "aarch64" SRCS+= instr_size.c .endif From nobody Tue May 23 14:19:51 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQc080gXPz4CXM8; Tue, 23 May 2023 14:19: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 4QQc0803kFz43GT; Tue, 23 May 2023 14:19:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684851592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=14+c6lL3dDomuS6qil4n/FRHLJnoqeAbsqgWOst25SA=; b=wpQrZaOYICvijbrQbbdd/MIgMs9VHc6UjL1TKb4gluXqyDYViuE4DV9+XgKT4K0GJPHpyy /AVfkp327aTTE/nfoqDsEYykIuEeqFYVbwIgNLTdnskEdbUZDh/KqB//utj0Ijo3QWOYSn CP5Tp3VpMLsZGB8UVp1tOvIA5NKeqqWuRRtpxoMHkYeGZhYjuESLXPTdYmhlMRdwPZ9kKE B59+gY/TIU7rJenFV7f1YuAu5Hy2ErfME2c2oeQSH+3yfe3aZinnTsfYFEyZ1XfH/JzUWB zLZS+Qgs4f+qMACYSGHxmKwiicifejTENLAm5pVRETUfSufHITt8wAaTxELExg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684851592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=14+c6lL3dDomuS6qil4n/FRHLJnoqeAbsqgWOst25SA=; b=jxLfXWFYW0mFKU7spKYUHqZIU76QLh8RwpLdLEXI1SokzteEEBmbi9Vp+AjLacUt8w6Ahv SQlGv7gc3SLBmMud8DxCz7zNUYyVaThP5eXonhTk26IGd1Nx0ebPHO+quhCzq4iOM5Z0Bq NTFRL1cYAfXzmGYCPygnDKR4Zp2x46qZ9UwIi59OAREdqlEQ2qQOppmR3aspSGwVXz6gfv GSFuItNMZz+T1gwR2YfMIje+WEz3cx7qBVaJKCakHY1p+RBVrjOM+vSXlhawSOLhXaXoKe o6dK/1AxEzZvjm2DDlVgRxAcrNpdqa6kHHZZkS4YNUM1mbTmiRy2ZEljmcNHnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684851592; a=rsa-sha256; cv=none; b=FwMA7c1s16CSF1Ujwm8Lmr91qbcaXDPs9nya1C5hHkErmKRrI6b2cm/jv6HdrC9TaXIjLd JsrZyegVZELgriZL4heWd9BYTpIg9xo6EGDLxDtSJnjAW2KGv9MijQNg1ixKC6h4omMpJ1 JuUT2NEuhaTes5c+PYgQlIGWed6Y/5qf18E2ohYrwfAiWrkOv0juy7Rw0B7q7e4GwZjhw5 Si6AWFUAhrmHpplp3RAlWu7BxMuYboFmTpNSsocbG/AMO5MR5XYTWwqYoKq24QRHxYzgWI dYto6wPXgBtrVDzAB+8795hjTsrWnfFCo1lDloMSYY4LXPnOmZFj8RoOXo6SKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQc075wv9z13PL; Tue, 23 May 2023 14:19: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 34NEJpq2099941; Tue, 23 May 2023 14:19:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NEJpBJ099940; Tue, 23 May 2023 14:19:51 GMT (envelope-from git) Date: Tue, 23 May 2023 14:19:51 GMT Message-Id: <202305231419.34NEJpBJ099940@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 21a16d55cc15 - main - dtrace: add register bindings for arm64 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 21a16d55cc15b12809b982c2026a26bcf97fe79b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=21a16d55cc15b12809b982c2026a26bcf97fe79b commit 21a16d55cc15b12809b982c2026a26bcf97fe79b Author: Christos Margiolis AuthorDate: 2023-05-23 14:19:25 +0000 Commit: Christos Margiolis CommitDate: 2023-05-23 14:19:25 +0000 dtrace: add register bindings for arm64 Reviewed by: mhorne, markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39956 --- cddl/lib/libdtrace/Makefile | 1 + cddl/lib/libdtrace/regs_aarch64.d | 74 ++++++++++++++++++++++++++++++++ sys/cddl/dev/dtrace/aarch64/dtrace_isa.c | 18 ++++++-- sys/cddl/dev/dtrace/aarch64/regset.h | 35 ++++++++++++++- 4 files changed, 123 insertions(+), 5 deletions(-) diff --git a/cddl/lib/libdtrace/Makefile b/cddl/lib/libdtrace/Makefile index 5232293e0be5..23cc8d2db574 100644 --- a/cddl/lib/libdtrace/Makefile +++ b/cddl/lib/libdtrace/Makefile @@ -133,6 +133,7 @@ DSRCS+= regs_riscv.d .if ${MACHINE_CPUARCH} == "aarch64" SRCS+= instr_size.c +DSRCS+= regs_aarch64.d .endif YFLAGS+=-d diff --git a/cddl/lib/libdtrace/regs_aarch64.d b/cddl/lib/libdtrace/regs_aarch64.d new file mode 100644 index 000000000000..7d20b5c546c5 --- /dev/null +++ b/cddl/lib/libdtrace/regs_aarch64.d @@ -0,0 +1,74 @@ +/* + * SPDX-License-Identifier: CDDL 1.0 + * + * Copyright 2023 Christos Margiolis + */ + +inline int R_X0 = 0; +#pragma D binding "1.13" R_X0 +inline int R_X1 = 1; +#pragma D binding "1.13" R_X1 +inline int R_X2 = 2; +#pragma D binding "1.13" R_X2 +inline int R_X3 = 3; +#pragma D binding "1.13" R_X3 +inline int R_X4 = 4; +#pragma D binding "1.13" R_X4 +inline int R_X5 = 5; +#pragma D binding "1.13" R_X5 +inline int R_X6 = 6; +#pragma D binding "1.13" R_X6 +inline int R_X7 = 7; +#pragma D binding "1.13" R_X7 +inline int R_X8 = 8; +#pragma D binding "1.13" R_X8 +inline int R_X9 = 9; +#pragma D binding "1.13" R_X9 +inline int R_X10 = 10; +#pragma D binding "1.13" R_X10 +inline int R_X11 = 11; +#pragma D binding "1.13" R_X11 +inline int R_X12 = 12; +#pragma D binding "1.13" R_X12 +inline int R_X13 = 13; +#pragma D binding "1.13" R_X13 +inline int R_X14 = 14; +#pragma D binding "1.13" R_X14 +inline int R_X15 = 15; +#pragma D binding "1.13" R_X15 +inline int R_X16 = 16; +#pragma D binding "1.13" R_X16 +inline int R_X17 = 17; +#pragma D binding "1.13" R_X17 +inline int R_X18 = 18; +#pragma D binding "1.13" R_X18 +inline int R_X19 = 19; +#pragma D binding "1.13" R_X19 +inline int R_X20 = 20; +#pragma D binding "1.13" R_X20 +inline int R_X21 = 21; +#pragma D binding "1.13" R_X21 +inline int R_X22 = 22; +#pragma D binding "1.13" R_X22 +inline int R_X23 = 23; +#pragma D binding "1.13" R_X23 +inline int R_X24 = 24; +#pragma D binding "1.13" R_X24 +inline int R_X25 = 25; +#pragma D binding "1.13" R_X25 +inline int R_X26 = 26; +#pragma D binding "1.13" R_X26 +inline int R_X27 = 27; +#pragma D binding "1.13" R_X27 +inline int R_X28 = 28; +#pragma D binding "1.13" R_X28 +inline int R_X29 = 29; +#pragma D binding "1.13" R_X29 +inline int R_FP= 29; +#pragma D binding "1.13" R_FP +inline int R_LR = 30; +#pragma D binding "1.13" R_LR +inline int R_SP = 31; +#pragma D binding "1.13" R_SP +inline int R_PC = 32; +#pragma D binding "1.13" R_PC diff --git a/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c b/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c index 98a0e6e498ed..09dc0b729928 100644 --- a/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c @@ -280,10 +280,20 @@ dtrace_getstackdepth(int aframes) ulong_t dtrace_getreg(struct trapframe *rp, uint_t reg) { - - printf("IMPLEMENT ME: %s\n", __func__); - - return (0); + switch (reg) { + case REG_X0 ... REG_X29: + return (rp->tf_x[reg]); + case REG_LR: + return (rp->tf_lr); + case REG_SP: + return (rp->tf_sp); + case REG_PC: + return (rp->tf_elr); + default: + DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); + return (0); + } + /* NOTREACHED */ } static int diff --git a/sys/cddl/dev/dtrace/aarch64/regset.h b/sys/cddl/dev/dtrace/aarch64/regset.h index f99b48f8354f..492405d4a258 100644 --- a/sys/cddl/dev/dtrace/aarch64/regset.h +++ b/sys/cddl/dev/dtrace/aarch64/regset.h @@ -42,7 +42,40 @@ extern "C" { #endif -/* Place here */ +#define REG_X0 0 +#define REG_X1 1 +#define REG_X2 2 +#define REG_X3 3 +#define REG_X4 4 +#define REG_X5 5 +#define REG_X6 6 +#define REG_X7 7 +#define REG_X8 8 +#define REG_X9 9 +#define REG_X10 10 +#define REG_X11 11 +#define REG_X12 12 +#define REG_X13 13 +#define REG_X14 14 +#define REG_X15 15 +#define REG_X16 16 +#define REG_X17 17 +#define REG_X18 18 +#define REG_X19 19 +#define REG_X20 20 +#define REG_X21 21 +#define REG_X22 22 +#define REG_X23 23 +#define REG_X24 24 +#define REG_X25 25 +#define REG_X26 26 +#define REG_X27 27 +#define REG_X28 28 +#define REG_X29 29 +#define REG_FP REG_X29 +#define REG_LR 30 +#define REG_SP 31 +#define REG_PC 32 #ifdef __cplusplus } From nobody Tue May 23 14:27:28 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQc8w3nGjz4CXTm; Tue, 23 May 2023 14:27: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 4QQc8w34hXz44LJ; Tue, 23 May 2023 14:27:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684852048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BsfyMIxhMOVMQA2Wm526YrUskDpewVmOh2hAArhBojA=; b=vykiMcJfabjjPwJkbBPUzh5iKarP/eo6KpbToI2JKoVjTx6V/O1b9H2Xga5xsuh17SBrty F4wWVIeT8KRRS+d/S1if9RBDHwYUbBFeELm2CaRSYzLd1v5UHx5rx73jYEz7wgxTeXB6di XrGp+FP3W83XCh/fTfy18zquGjX6nsV/actEThBYrhYYfU3ZkQlM6ktMgwwa06Zx33Letn 2nBAJk8yOdBqngrFWzEbSj1YUm6PNUa8YqkgmV2fRrUTCjQ1FkSIG7BR1lAWXG+oVetqQC ex9TraSCJ0k4oRTOPDMH4TS8U2cgXo7CEXbjf7Kat9tPUj74xu8SWfBWrjqyMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684852048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BsfyMIxhMOVMQA2Wm526YrUskDpewVmOh2hAArhBojA=; b=dN+Q80pD/+kSiUBSfJ7InK27gPh7BvyNAzcleWU6iiBkrOZDyUgsxI4A04m9YWBJcb1pOo pNggItqW4NUWpFjc6dLHqx2gswqFOJP+2TjoPNLQ1qIq8N6efQ9c1vSTfa9WKvtWWsIHjc Yi0WcVqovhyd6qrVdoLYcIeEgGgQSwdtODwdsejd9gYRIX1VJpUObAncz6vMztYDyirZEv gloS9lEZYXn4gPNXJk2SyXl/m8rkYw8rdpYrs1r0wAsbewYO6F8nkTAWNRiEux5vqeb8KY syZh3antaBsTsEIQGdgVTjKH5oijBYPk4UuTNhv725gxRvYGMgk7xTNzWDdYvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684852048; a=rsa-sha256; cv=none; b=Fb4WX8d1kvmDojHfbmKjadxhAresvPm9F2nk+JVkMvWHz/kCPQIXwsPAGMknJ0w70jXIAg 52hXt31u3Wrw/T4eqdsNJsTlG5Raas3WTOA5p9Yxh5Iqbj+jB0Gku//6uPwl+ZyfDgx7HP bJEuvdAArjlm9Ki0twREbg63D76WXCoyZRyf1VkM4Hg6pBCy0pxdwbHFzXcPyAUsCHesKM ylysw9G9OAev4Zin35hXVcNA2hizcwqEv0hlg2ay6vFVqRsT5Otxtd24pLGD0GMwUK1nbq b3iEL/i6LErW9ISbiNIw3LZ9QgyhJUHOQLSH3nzJC4f/tm370OQiJ7HrlATrQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQc8w22m5z13C9; Tue, 23 May 2023 14:27: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 34NERScf015610; Tue, 23 May 2023 14:27:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NERS3o015609; Tue, 23 May 2023 14:27:28 GMT (envelope-from git) Date: Tue, 23 May 2023 14:27:28 GMT Message-Id: <202305231427.34NERS3o015609@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 30038a8b4efc - main - md: Get rid of the pbuf zone List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 30038a8b4efc6d0b9f8f295e28bc205fe9728310 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=30038a8b4efc6d0b9f8f295e28bc205fe9728310 commit 30038a8b4efc6d0b9f8f295e28bc205fe9728310 Author: Mark Johnston AuthorDate: 2023-05-23 14:14:06 +0000 Commit: Mark Johnston CommitDate: 2023-05-23 14:27:10 +0000 md: Get rid of the pbuf zone The zone is used solely to provide KVA for mapping BIOs so that we can pass mapped buffers to VOP_READ and VOP_WRITE. Currently we preallocate nswbuf/10 bufs for this purpose during boot. The intent was to limit KVA usage on 32-bit systems, but the preallocation means that we in fact consumed more KVA than needed unless one has more than nswbuf/10 (typically 25) vnode-backed MD devices in existence, which I would argue is the uncommon case. Meanwhile, all I/O to an MD is handled by a dedicated thread, so we can instead simply preallocate the KVA region at MD device creation time. Event: BSDCan 2023 Reviewed by: kib MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D40215 --- sys/dev/md/md.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index bb4b61783c93..a719dccb1955 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -98,6 +98,7 @@ #include #include +#include #include #include #include @@ -232,8 +233,6 @@ static LIST_HEAD(, md_s) md_softc_list = LIST_HEAD_INITIALIZER(md_softc_list); #define NMASK (NINDIR-1) static int nshift; -static uma_zone_t md_pbuf_zone; - struct indir { uintptr_t *array; u_int total; @@ -276,6 +275,7 @@ struct md_s { char file[PATH_MAX]; char label[PATH_MAX]; struct ucred *cred; + vm_offset_t kva; /* MD_SWAP related fields */ vm_object_t object; @@ -877,11 +877,11 @@ mdstart_vnode(struct md_s *sc, struct bio *bp) struct iovec *piov; struct mount *mp; struct vnode *vp; - struct buf *pb; bus_dma_segment_t *vlist; struct thread *td; off_t iolen, iostart, off, len; int ma_offs, npages; + bool mapped; switch (bp->bio_cmd) { case BIO_READ: @@ -902,11 +902,11 @@ mdstart_vnode(struct md_s *sc, struct bio *bp) td = curthread; vp = sc->vnode; - pb = NULL; piov = NULL; ma_offs = bp->bio_ma_offset; off = bp->bio_offset; len = bp->bio_length; + mapped = false; /* * VNODE I/O @@ -955,22 +955,21 @@ mdstart_vnode(struct md_s *sc, struct bio *bp) auio.uio_iovcnt = piov - auio.uio_iov; piov = auio.uio_iov; } else if ((bp->bio_flags & BIO_UNMAPPED) != 0) { - pb = uma_zalloc(md_pbuf_zone, M_WAITOK); - MPASS((pb->b_flags & B_MAXPHYS) != 0); bp->bio_resid = len; unmapped_step: npages = atop(min(maxphys, round_page(len + (ma_offs & PAGE_MASK)))); iolen = min(ptoa(npages) - (ma_offs & PAGE_MASK), len); KASSERT(iolen > 0, ("zero iolen")); - pmap_qenter((vm_offset_t)pb->b_data, - &bp->bio_ma[atop(ma_offs)], npages); - aiov.iov_base = (void *)((vm_offset_t)pb->b_data + - (ma_offs & PAGE_MASK)); + KASSERT(npages <= atop(MAXPHYS + PAGE_SIZE), + ("npages %d too large", npages)); + pmap_qenter(sc->kva, &bp->bio_ma[atop(ma_offs)], npages); + aiov.iov_base = (void *)(sc->kva + (ma_offs & PAGE_MASK)); aiov.iov_len = iolen; auio.uio_iov = &aiov; auio.uio_iovcnt = 1; auio.uio_resid = iolen; + mapped = true; } else { aiov.iov_base = bp->bio_data; aiov.iov_len = bp->bio_length; @@ -998,8 +997,8 @@ unmapped_step: VOP_ADVISE(vp, iostart, auio.uio_offset - 1, POSIX_FADV_DONTNEED); - if (pb != NULL) { - pmap_qremove((vm_offset_t)pb->b_data, npages); + if (mapped) { + pmap_qremove(sc->kva, npages); if (error == 0) { len -= iolen; bp->bio_resid -= iolen; @@ -1007,7 +1006,6 @@ unmapped_step: if (len > 0) goto unmapped_step; } - uma_zfree(md_pbuf_zone, pb); } else { bp->bio_resid = auio.uio_resid; } @@ -1276,7 +1274,7 @@ mdnew(int unit, int *errp, enum md_types type) return (NULL); } - sc = (struct md_s *)malloc(sizeof *sc, M_MD, M_WAITOK | M_ZERO); + sc = malloc(sizeof(*sc), M_MD, M_WAITOK | M_ZERO); sc->type = type; bioq_init(&sc->bio_queue); mtx_init(&sc->queue_mtx, "md bio queue", NULL, MTX_DEF); @@ -1484,6 +1482,8 @@ mdcreate_vnode(struct md_s *sc, struct md_req *mdr, struct thread *td) nd.ni_vp->v_vflag &= ~VV_MD; goto bad; } + + sc->kva = kva_alloc(MAXPHYS + PAGE_SIZE); return (0); bad: VOP_UNLOCK(nd.ni_vp); @@ -1542,6 +1542,8 @@ mddestroy(struct md_s *sc, struct thread *td) destroy_indir(sc, sc->indir); if (sc->uma) uma_zdestroy(sc->uma); + if (sc->kva) + kva_free(sc->kva, MAXPHYS + PAGE_SIZE); LIST_REMOVE(sc, list); free_unr(md_uh, sc->unit); @@ -2076,7 +2078,6 @@ g_md_init(struct g_class *mp __unused) sx_xunlock(&md_sx); } } - md_pbuf_zone = pbuf_zsecond_create("mdpbuf", nswbuf / 10); status_dev = make_dev(&mdctl_cdevsw, INT_MAX, UID_ROOT, GID_WHEEL, 0600, MDCTL_NAME); g_topology_lock(); @@ -2172,6 +2173,5 @@ g_md_fini(struct g_class *mp __unused) sx_destroy(&md_sx); if (status_dev != NULL) destroy_dev(status_dev); - uma_zdestroy(md_pbuf_zone); delete_unrhdr(md_uh); } From nobody Tue May 23 14:29:34 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQcCM1593z4CXxk; Tue, 23 May 2023 14: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 4QQcCM0GZPz456K; Tue, 23 May 2023 14: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=1684852175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rUzCO3w4AVMlnRzeo8qG/091OArX0plQr2/EVHDTbro=; b=vU2oygYIvhwElydGRAhXL5IxJlTvrmjBhjqUOYFD5RDNhN6UooeA1jCtHJDhQLIA1WaXqJ K2NzpM0vlqN6BWNzkIqgCE2s4HX//TwhSSvvWk9bW+gnQNVHCJx1QNYZJrGA3H7pzWDvXq OQ6h19PVgyW6vsGAz7tlmu9u22DQMuHJjWob/Tz4Y+Y6FYXD0n1ylia/SDx3x5jf/06jDn TFP9yRioWqwGxSf4y+AZywh3BPdzu+gUXT+YUeiAj1TKCKvrHL7B8GNutZIxMXjD5pFJ0r VrQh+cCZZ2jnk2Bz9Ls8jfIJddBt57fr6jyNIwtL+mA6/C5aaLMcBNBFVhlkGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684852175; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rUzCO3w4AVMlnRzeo8qG/091OArX0plQr2/EVHDTbro=; b=hATT11OJvQrsg/eJovED1ZpviIxL5/iFgPlnIy5ob2CoZMUVg1KT3zBjgWwkE6fvdjmuwZ +tSCVfjZUHzpbMKjjW8FlID5BsqAwBmuqnuvs9vCITnwpcxFnXfYdL0K6FRDe3YRDuSqLt MhL3gah/tIZiO45Hqc3Iz4IXJIQ6XnoVqZs+GP6g91ZZhQuzwWOK2Lyq80xkODP7/S+dGW uMLwAuqP78cRb1ebEuoheSk2Bpi+Udadx2iLj6j0WLnF8BNpked/dmLxiWALDFSeuPO26m CDWx9DZmpqyWuw9XGynMt0J4ed0h8VNcTkE1KTYe6y8vh40RCHKhTTXhUH5YMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684852175; a=rsa-sha256; cv=none; b=nsW1zwL0VSgIWMzfAVcLaCKXl+8VAJUKTfziHbVlv9MesPBPbgpGTxntJFoWEmZodCn3r9 MHCT1bGCkZXDPO5h47NRjrvSCB2xvntKeZDOYw/GJh85QXbv1xUR7M7EqF24ubUaq2dc6A xEntdH1ZPdH7yIyq3Oll7KeA3HapIeXA2TxUHk1/htl8krL9F6BUR5aGWqf8/qG1WsUvxx eFaJQ5tbpzzvLO7cgiC1iq3Nls+1gZao8XSQ59xru34IhHprIF65GZvrAcPf8qPTdCO0wt +iAauDNIE/j0Lj+w/O9G4eWJ//qApyIGixcLKl3zm0hbOQ1SeFqhqIUxXezgUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQcCL6R8Rz13lY; Tue, 23 May 2023 14: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 34NETYGV015962; Tue, 23 May 2023 14: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 34NETYW3015961; Tue, 23 May 2023 14:29:34 GMT (envelope-from git) Date: Tue, 23 May 2023 14:29:34 GMT Message-Id: <202305231429.34NETYW3015961@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: ed35c7cf7762 - main - dtrace.1: fix mandoc -Tlint List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ed35c7cf7762c26246cb032b7ed30dcfbcee7a3b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=ed35c7cf7762c26246cb032b7ed30dcfbcee7a3b commit ed35c7cf7762c26246cb032b7ed30dcfbcee7a3b Author: Christos Margiolis AuthorDate: 2023-05-23 14:29:19 +0000 Commit: Christos Margiolis CommitDate: 2023-05-23 14:29:19 +0000 dtrace.1: fix mandoc -Tlint Reviewed by: markj Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D40230 --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index c3c7b4cdc818..42367b99b786 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -809,11 +809,6 @@ failed or that the specified request could not be satisfied. .It 2 Invalid command line options or arguments were specified. .El -.Sh HISTORY -The -.Nm -utility first appeared in -.Fx 7.1 . .Sh SEE ALSO .Xr cpp 1 , .Xr elf 5 , @@ -821,3 +816,8 @@ utility first appeared in .Rs .%T Solaris Dynamic Tracing Guide .Re +.Sh HISTORY +The +.Nm +utility first appeared in +.Fx 7.1 . From nobody Tue May 23 14:45:31 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQcYl4Dxwz4CYpv; Tue, 23 May 2023 14:45: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 4QQcYl3m55z475s; Tue, 23 May 2023 14:45:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684853131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qHMpm16T5DrMx6zSXUjRRHcWb41TbhwE846VRFYRQMY=; b=mRmdL/lH9x1yAPmlCP064Uw1vMmAI51UgtCY9otgY2QuSSTGAG8003DrZGzNVhDHBwRBqN lqsQp8amk/Nr5TsiFwcUHOQL8KprFqX9LRPvbWKyL/1z68OzMYVXcMRqGzlwkkQ1kN9zzI WYfiUPrYjS3LZ3uCVyU6c8aslCMQ3z3OMxbNJZZxyoj8kT9FXNDMsD6uLn5FJJGWdaAKPT M+XdTpBJ+r2fk3h0admrv0HAfARKFFd4tpfWiVD/+64yfEiXz5sgEY8QNNLCsLlLgDKxie sZ8STssEmYldOIUJtcV1MSYH+/7EbnuJXqpBM3u+Gw0SRdk6sMaK+eqF2Jdc5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684853131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qHMpm16T5DrMx6zSXUjRRHcWb41TbhwE846VRFYRQMY=; b=mW32glwKh4hwt3VfcAK9x+YEzamztEFxU1DCnqSSfCJB2/+nz4o1RKdfZ5uk/5TqykWOs7 qYFTJ59wlV0+m70SxaCfc8/m2PAbLaTLBvB6e2lFZg9eZ+DTJgcumt+J3+b/qD0no6oboW ODJrNIUGZ873oyBS53p++ug7E84A+g5lv3lMFIvEaQmvAdprNvJkNRjtXecpkeuq3oU4wS KOXNdQTaWa6ciwqLe8xzTe0gLC45CUh3gsIF2rXWcwutLNY79aOEkSZzsq5q87x08jVEot 3Om4K72pl6lzYYzw+fSLHYtiVFn/qd1z6ItzDKBxOuiyOUjOwRQS8qLAftJr7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684853131; a=rsa-sha256; cv=none; b=DYCA3L+RL/iJLFgAfrRBqsO30LDftg2bnsoUyerLNK9WNn7silMNALwEa3pBlhKTJpc3as rHIcnhYI0RRKZMcw3712Y0WaQ9XbEmlc8grLP1jHbpo5qmB9OZ4VZdboj9AMiJT/Cy/FhU FJvBOMXoijm6/c+pEItfBtL1VgrOl8U6NzJtCAcQqKDJv5JZEAAOQ1IlGIgbk5ndWIjcDx dvaVegnWTCPOXMhYNuRN7OMdGlFocNcgqpo0EaSrD10uInwJmIEKBJ4g79vlhyuhwr9E8V 5LeJbX6dXlv8PWZo5hJFEzIx1IjTJmO3JdK191SdGTVx4pV61PzkeWkDCFog1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQcYl2rS2z141X; Tue, 23 May 2023 14:45: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 34NEjVjY048788; Tue, 23 May 2023 14:45:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NEjVka048787; Tue, 23 May 2023 14:45:31 GMT (envelope-from git) Date: Tue, 23 May 2023 14:45:31 GMT Message-Id: <202305231445.34NEjVka048787@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 98ab9802affe - main - dtrace: rename rp to frame in dtrace_getreg() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 98ab9802affed1bf7c2009569eac468c86c159e8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=98ab9802affed1bf7c2009569eac468c86c159e8 commit 98ab9802affed1bf7c2009569eac468c86c159e8 Author: Christos Margiolis AuthorDate: 2023-05-23 14:40:07 +0000 Commit: Christos Margiolis CommitDate: 2023-05-23 14:44:47 +0000 dtrace: rename rp to frame in dtrace_getreg() Reviewed by: mhorne, markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40231 --- sys/cddl/dev/dtrace/aarch64/dtrace_isa.c | 10 +++--- sys/cddl/dev/dtrace/amd64/dtrace_isa.c | 54 ++++++++++++++++---------------- sys/cddl/dev/dtrace/arm/dtrace_isa.c | 2 +- sys/cddl/dev/dtrace/i386/dtrace_isa.c | 36 ++++++++++----------- sys/cddl/dev/dtrace/powerpc/dtrace_isa.c | 18 +++++------ sys/cddl/dev/dtrace/riscv/dtrace_isa.c | 22 ++++++------- 6 files changed, 71 insertions(+), 71 deletions(-) diff --git a/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c b/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c index 09dc0b729928..1641ad246419 100644 --- a/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c @@ -278,17 +278,17 @@ dtrace_getstackdepth(int aframes) } ulong_t -dtrace_getreg(struct trapframe *rp, uint_t reg) +dtrace_getreg(struct trapframe *frame, uint_t reg) { switch (reg) { case REG_X0 ... REG_X29: - return (rp->tf_x[reg]); + return (frame->tf_x[reg]); case REG_LR: - return (rp->tf_lr); + return (frame->tf_lr); case REG_SP: - return (rp->tf_sp); + return (frame->tf_sp); case REG_PC: - return (rp->tf_elr); + return (frame->tf_elr); default: DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); return (0); diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_isa.c b/sys/cddl/dev/dtrace/amd64/dtrace_isa.c index 55e51cee14d8..503dacdfab1f 100644 --- a/sys/cddl/dev/dtrace/amd64/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/amd64/dtrace_isa.c @@ -476,7 +476,7 @@ dtrace_getstackdepth(int aframes) } ulong_t -dtrace_getreg(struct trapframe *rp, uint_t reg) +dtrace_getreg(struct trapframe *frame, uint_t reg) { /* This table is dependent on reg.d. */ int regmap[] = { @@ -515,57 +515,57 @@ dtrace_getreg(struct trapframe *rp, uint_t reg) switch (reg) { case REG_RDI: - return (rp->tf_rdi); + return (frame->tf_rdi); case REG_RSI: - return (rp->tf_rsi); + return (frame->tf_rsi); case REG_RDX: - return (rp->tf_rdx); + return (frame->tf_rdx); case REG_RCX: - return (rp->tf_rcx); + return (frame->tf_rcx); case REG_R8: - return (rp->tf_r8); + return (frame->tf_r8); case REG_R9: - return (rp->tf_r9); + return (frame->tf_r9); case REG_RAX: - return (rp->tf_rax); + return (frame->tf_rax); case REG_RBX: - return (rp->tf_rbx); + return (frame->tf_rbx); case REG_RBP: - return (rp->tf_rbp); + return (frame->tf_rbp); case REG_R10: - return (rp->tf_r10); + return (frame->tf_r10); case REG_R11: - return (rp->tf_r11); + return (frame->tf_r11); case REG_R12: - return (rp->tf_r12); + return (frame->tf_r12); case REG_R13: - return (rp->tf_r13); + return (frame->tf_r13); case REG_R14: - return (rp->tf_r14); + return (frame->tf_r14); case REG_R15: - return (rp->tf_r15); + return (frame->tf_r15); case REG_DS: - return (rp->tf_ds); + return (frame->tf_ds); case REG_ES: - return (rp->tf_es); + return (frame->tf_es); case REG_FS: - return (rp->tf_fs); + return (frame->tf_fs); case REG_GS: - return (rp->tf_gs); + return (frame->tf_gs); case REG_TRAPNO: - return (rp->tf_trapno); + return (frame->tf_trapno); case REG_ERR: - return (rp->tf_err); + return (frame->tf_err); case REG_RIP: - return (rp->tf_rip); + return (frame->tf_rip); case REG_CS: - return (rp->tf_cs); + return (frame->tf_cs); case REG_SS: - return (rp->tf_ss); + return (frame->tf_ss); case REG_RFL: - return (rp->tf_rflags); + return (frame->tf_rflags); case REG_RSP: - return (rp->tf_rsp); + return (frame->tf_rsp); default: DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); return (0); diff --git a/sys/cddl/dev/dtrace/arm/dtrace_isa.c b/sys/cddl/dev/dtrace/arm/dtrace_isa.c index e6fba2d09be8..c50f9210f5dc 100644 --- a/sys/cddl/dev/dtrace/arm/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/arm/dtrace_isa.c @@ -157,7 +157,7 @@ dtrace_getstackdepth(int aframes) } ulong_t -dtrace_getreg(struct trapframe *rp, uint_t reg) +dtrace_getreg(struct trapframe *frame, uint_t reg) { printf("IMPLEMENT ME: %s\n", __func__); diff --git a/sys/cddl/dev/dtrace/i386/dtrace_isa.c b/sys/cddl/dev/dtrace/i386/dtrace_isa.c index 3c8602c1f7be..53a6aceffa73 100644 --- a/sys/cddl/dev/dtrace/i386/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/i386/dtrace_isa.c @@ -498,7 +498,7 @@ dtrace_getstackdepth(int aframes) } ulong_t -dtrace_getreg(struct trapframe *rp, uint_t reg) +dtrace_getreg(struct trapframe *frame, uint_t reg) { struct pcb *pcb; int regmap[] = { /* Order is dependent on reg.d */ @@ -543,41 +543,41 @@ dtrace_getreg(struct trapframe *rp, uint_t reg) } return (pcb->pcb_gs); case REG_FS: - return (rp->tf_fs); + return (frame->tf_fs); case REG_ES: - return (rp->tf_es); + return (frame->tf_es); case REG_DS: - return (rp->tf_ds); + return (frame->tf_ds); case REG_RDI: - return (rp->tf_edi); + return (frame->tf_edi); case REG_RSI: - return (rp->tf_esi); + return (frame->tf_esi); case REG_RBP: - return (rp->tf_ebp); + return (frame->tf_ebp); case REG_RSP: - return (rp->tf_isp); + return (frame->tf_isp); case REG_RBX: - return (rp->tf_ebx); + return (frame->tf_ebx); case REG_RCX: - return (rp->tf_ecx); + return (frame->tf_ecx); case REG_RAX: - return (rp->tf_eax); + return (frame->tf_eax); case REG_TRAPNO: - return (rp->tf_trapno); + return (frame->tf_trapno); case REG_ERR: - return (rp->tf_err); + return (frame->tf_err); case REG_RIP: - return (rp->tf_eip); + return (frame->tf_eip); case REG_CS: - return (rp->tf_cs); + return (frame->tf_cs); case REG_RFL: - return (rp->tf_eflags); + return (frame->tf_eflags); #if 0 case REG_RSP: - return (rp->tf_esp); + return (frame->tf_esp); #endif case REG_SS: - return (rp->tf_ss); + return (frame->tf_ss); default: DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); return (0); diff --git a/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c b/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c index 1fca72e5b7fd..d95dce4e32e4 100644 --- a/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c @@ -530,26 +530,26 @@ dtrace_getstackdepth(int aframes) } ulong_t -dtrace_getreg(struct trapframe *rp, uint_t reg) +dtrace_getreg(struct trapframe *frame, uint_t reg) { if (reg < 32) - return (rp->fixreg[reg]); + return (frame->fixreg[reg]); switch (reg) { case 32: - return (rp->lr); + return (frame->lr); case 33: - return (rp->cr); + return (frame->cr); case 34: - return (rp->xer); + return (frame->xer); case 35: - return (rp->ctr); + return (frame->ctr); case 36: - return (rp->srr0); + return (frame->srr0); case 37: - return (rp->srr1); + return (frame->srr1); case 38: - return (rp->exc); + return (frame->exc); default: DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); return (0); diff --git a/sys/cddl/dev/dtrace/riscv/dtrace_isa.c b/sys/cddl/dev/dtrace/riscv/dtrace_isa.c index 61743c42d9b7..666f754cc311 100644 --- a/sys/cddl/dev/dtrace/riscv/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/riscv/dtrace_isa.c @@ -309,31 +309,31 @@ dtrace_getstackdepth(int aframes) } ulong_t -dtrace_getreg(struct trapframe *rp, uint_t reg) +dtrace_getreg(struct trapframe *frame, uint_t reg) { switch (reg) { case REG_ZERO: return (0); case REG_RA: - return (rp->tf_ra); + return (frame->tf_ra); case REG_SP: - return (rp->tf_sp); + return (frame->tf_sp); case REG_GP: - return (rp->tf_gp); + return (frame->tf_gp); case REG_TP: - return (rp->tf_tp); + return (frame->tf_tp); case REG_T0 ... REG_T2: - return (rp->tf_t[reg - REG_T0]); + return (frame->tf_t[reg - REG_T0]); case REG_S0 ... REG_S1: - return (rp->tf_s[reg - REG_S0]); + return (frame->tf_s[reg - REG_S0]); case REG_A0 ... REG_A7: - return (rp->tf_a[reg - REG_A0]); + return (frame->tf_a[reg - REG_A0]); case REG_S2 ... REG_S11: - return (rp->tf_s[reg - REG_S2 + 2]); + return (frame->tf_s[reg - REG_S2 + 2]); case REG_T3 ... REG_T6: - return (rp->tf_t[reg - REG_T3 + 3]); + return (frame->tf_t[reg - REG_T3 + 3]); case REG_PC: - return (rp->tf_sepc); + return (frame->tf_sepc); default: DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); return (0); From nobody Tue May 23 15:13:30 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQdB24rSmz4CZcn; Tue, 23 May 2023 15:13:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQdB24NLnz4DKC; Tue, 23 May 2023 15:13:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684854810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qgQsttzOMsPBHGRTOpi8bBWu8BIjkrOU/hLYpvNqMVM=; b=enfmNYGDHzLk5i5Xvc5xws2lRf+kaoqXEv2igEfnkRAsWfUWUSGxBQtD1v+5FkhN8uqAg+ sc+LmYBLZ6aPTTyMjnFVh6HQ7qUvarXH+CCqCHMk1V9PRiZyyqW7UKhz1HYJxdkcUdQEB1 qbHSK1+7/dX64mcQ6xt0MfGZp23tP3ttlCxeMdI9/ye7PELhnAjLFde0TeQlSDaU7RsnZC 8aEszV7DrfyGooaqHj/sF95TBKmEBoU74T4lw5vob/f8YEsLmLaVVxBQKzt6ntqywOg/VA JrD+88YpCw5/I1KYgu9eB8x0G8oa1jkazWtTbm+OaqrJcCXn263sXzxvBBIqWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684854810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qgQsttzOMsPBHGRTOpi8bBWu8BIjkrOU/hLYpvNqMVM=; b=BbyIbYUH/JHm0KPaAcZTi95m7iAcW3KkftL/mjEDrplyLd0JLHU5GPJ1uQJyMgCkqQSDpk 2mtLUm3VJ0JYpoUas/qLydMCK2cl+03EUSviR+p6sYmmbwqWo6+T7ZulEHYk4Ddfaxb2ma nsnP2aan5Z/abExiX1xWkj1NrvuHjUPB/7SHp3FM2vSYYBmuDWAeSXUV16SSEsTE4h12VR zr+eM/442iq1rSgvBqzrAeBvqMAlT89Gpa4qpXuiIvy5Ovs+6jbGofsMQ3hWZ7TwnWrald pyimz0vbPM/jujR4K2V/JcjDDASb2YriZZsXHefI90tNS1HwZe5e3RGSI+4T2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684854810; a=rsa-sha256; cv=none; b=HD7lWFET/6XEQ/IL2gNTt3KWZGapJiwuohe3+e2ZY17as5sSB7WGBLVGx6d2Z3a9QVDApo 5OfFnqRSluT0aSU9MgU7F1kpkf4YhWERLqHE2J1jr79g9OBag5ZGJ2I/g2QOvXuYvCfK6y FV/dEfXdvJ3py3tOrPGxDGcGnkFgDIIF2L0r19ADPwApznYDAfb1GC5PdO7svqsq0chRO5 ytIBc1N7Cmc8X4pkMTwtAyGHig6l3wW8yiALyH872bhNEIZ+nDWBPwaVJV7/oioYa3Y3+Q M4kGRLtGHwiiWtn4KqheIksce1ktWJTW58XYArzdfUeb+nwTY8/fZawo7p6/oA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQdB23RkVz14WW; Tue, 23 May 2023 15:13:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34NFDUSq098737; Tue, 23 May 2023 15:13:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NFDUKl098736; Tue, 23 May 2023 15:13:30 GMT (envelope-from git) Date: Tue, 23 May 2023 15:13:30 GMT Message-Id: <202305231513.34NFDUKl098736@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 2cf8ef5910fd - main - rc.suspend: execute rc-scripts with suspend keyword List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2cf8ef5910fd3754f8021f9c67fde6b9d9030f33 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=2cf8ef5910fd3754f8021f9c67fde6b9d9030f33 commit 2cf8ef5910fd3754f8021f9c67fde6b9d9030f33 Author: Johannes Totz AuthorDate: 2023-05-23 15:11:31 +0000 Commit: Christos Margiolis CommitDate: 2023-05-23 15:11:31 +0000 rc.suspend: execute rc-scripts with suspend keyword For symmetry with rc.resume, give rc.suspend the ability to execute rc-scripts. Use the suspend keyword for that. Use-case is for setting a wake-up time, e.g. via efiwake. Reviewed by: christos Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D39965 --- libexec/rc/rc.suspend | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/libexec/rc/rc.suspend b/libexec/rc/rc.suspend index 5f22cd1a05b1..41b5bcbf897b 100755 --- a/libexec/rc/rc.suspend +++ b/libexec/rc/rc.suspend @@ -43,15 +43,28 @@ fi echo $$ 2> /dev/null > /var/run/rc.suspend.pid -# If you have troubles on suspending with PC-CARD modem, try this. -# See also contrib/pccardq.c (Only for PAO users). -# pccardq | awk -F '~' '$5 == "filled" && $4 ~ /uart/ \ -# { printf("pccardc power %d 0", $1); }' | sh - # If a device driver has problems suspending, try unloading it before # suspend and reloading it on resume. Example: # kldunload usb +. /etc/rc.subr + +load_rc_config + +rcorder_opts="-k suspend" + +case ${local_startup} in +[Nn][Oo] | '') ;; +*) find_local_scripts_new ;; +esac + +files=`rcorder ${rcorder_opts} /etc/rc.d/* ${local_rc} 2>/dev/null` + +for _rc_elem in $files; do + debug "run_rc_script $_rc_elem suspend" + run_rc_script $_rc_elem suspend +done + /usr/bin/logger -t $subsystem suspend at `/bin/date +'%Y%m%d %H:%M:%S'` /bin/sync && /bin/sync && /bin/sync /bin/sleep 3 From nobody Tue May 23 15:13:31 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQdB36gpQz4CZcr; Tue, 23 May 2023 15:13:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQdB35gpSz4D39; Tue, 23 May 2023 15:13:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684854811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=caASTqU4LCEsryGyF0i2dTUSV0AqEW3SjWGZT9RQ7DU=; b=KXfcFMTa6WVhoq6Bantwl8drgM0oQLl6duKaKZFdIvpUYT/mZOcMXCjKRlH1UiqJpxTenN eQ82ou+VYp3y1Q/WqFqymxaPxfM1CoaCvbrDeZ11w+qgYsI8b6kum5OguH9/FjGGD/itSr hEzs0d4LfTGGSBoiS053crIbTwytqPi2jFfJwxzhNpnKLuRd7cEtHth0h86u/4RvXJbZcq IqqPWz044LmnhEu4Gov3L/WpnPPDa5zEBezw9vHl2J5D9PBMPw+h+vRc3Q87jPGtW9OsCG hkeApmhoxpzx6gGY1AGa3gZCwdZagoaZH/wlJqI1uXEBckaYXnQyh8T3XPdAzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684854811; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=caASTqU4LCEsryGyF0i2dTUSV0AqEW3SjWGZT9RQ7DU=; b=Yx2zwDcTgnPpD+puxqPYGKJ68CxHhrJQDi9TNJAmWsTdfeDVEihH56H8+oV2KP5LeFu5zN pI1IV4ei+8miZeOUUcnEuSo6XRix5nZKoFOfYEdoHEBWMdNemk1AGExZyV8OjjPfqAPQz/ tgBlwZG/4e0n1wn9S0I7A+m4jZ0ByW54rMlBoBaLpLsotMMDO6ax3D2e6KiuP0uIkM2n6X UdKS9AusisBTFaGtD2SQLARlXMGjDJq56evuFuESnAb8xZLYYf6oDQWWx7Bt13qZwuxlmK 9CznWnEYH2hB1H5lKHcpu/rMHp1fgKcZ1EyGZbqA5RW9F0oFTbo8/Jmtk54P3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684854811; a=rsa-sha256; cv=none; b=rnNPhbh1VQZadaCutHhqm1AB6MvoUtv8GvsFwwcT/9nHJROM4+/it/MIc8df0FM4kg6eue qP2M5TREikR6AOzP0237fYAr9CYGaEW9HeancyyLev/mtrnwQ8o84daKtPSbzA7t8wPLDi OW72Ya6Ti1czAGS2Pr9RkK+Km+31DCT4+cF8JI+2z6JZxz2RBlKZfCnLdBq3NbqnqgB6eO R0yKyuCBZEwDsYETCEjg6SU0f1UIui7zTkOiDKLa6m2biPKJBMeN5Vxg+lIy9vfUjixmZj 5ygldVKgomFcikFOEx19GgCfLPnE1nXrmbH0vkIef8EIzCk2u6lb91AP0zJmvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQdB34c5Wz14mJ; Tue, 23 May 2023 15:13: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 34NFDVCC098760; Tue, 23 May 2023 15:13:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NFDVXd098759; Tue, 23 May 2023 15:13:31 GMT (envelope-from git) Date: Tue, 23 May 2023 15:13:31 GMT Message-Id: <202305231513.34NFDVXd098759@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: ff624eb63606 - main - kinst: use dtrace_dis_get_byte() instead of own copy List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ff624eb63606534304f2867db260e2c405ea1645 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=ff624eb63606534304f2867db260e2c405ea1645 commit ff624eb63606534304f2867db260e2c405ea1645 Author: Christos Margiolis AuthorDate: 2023-05-23 15:12:18 +0000 Commit: Christos Margiolis CommitDate: 2023-05-23 15:12:18 +0000 kinst: use dtrace_dis_get_byte() instead of own copy No functional change intended. Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39872 --- sys/cddl/dev/kinst/amd64/kinst_isa.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/sys/cddl/dev/kinst/amd64/kinst_isa.c b/sys/cddl/dev/kinst/amd64/kinst_isa.c index b89c3ce15a1a..5035f43be440 100644 --- a/sys/cddl/dev/kinst/amd64/kinst_isa.c +++ b/sys/cddl/dev/kinst/amd64/kinst_isa.c @@ -246,18 +246,6 @@ kinst_set_disp32(struct kinst_probe *kp, uint8_t *bytes) kp->kp_md.disp = (int64_t)disp32; } -static int -kinst_dis_get_byte(void *p) -{ - int ret; - uint8_t **instr = p; - - ret = **instr; - (*instr)++; - - return (ret); -} - /* * Set up all of the state needed to faithfully execute a probed instruction. * @@ -294,7 +282,7 @@ kinst_instr_dissect(struct kinst_probe *kp, uint8_t **instr) kpmd = &kp->kp_md; d86.d86_data = instr; - d86.d86_get_byte = kinst_dis_get_byte; + d86.d86_get_byte = dtrace_dis_get_byte; d86.d86_check_func = NULL; if (dtrace_disx86(&d86, SIZE64) != 0) { KINST_LOG("failed to disassemble instruction at: %p", *instr); From nobody Tue May 23 15:22:31 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQdNX1F3zz4CbRk; Tue, 23 May 2023 15:22:36 +0000 (UTC) (envelope-from christos@freebsd.org) Received: from margiolis.net (mail.margiolis.net [95.179.159.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQdNW0qD8z4GlN; Tue, 23 May 2023 15:22:35 +0000 (UTC) (envelope-from christos@freebsd.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=margiolis.net header.s=default header.b=Ce0BI+8H; spf=softfail (mx1.freebsd.org: 95.179.159.8 is neither permitted nor denied by domain of christos@freebsd.org) smtp.mailfrom=christos@freebsd.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=default; bh=VOoWT+OeZaws vXU7hKYFyKg/5zRU6mUPJkfdbb0zZgo=; h=in-reply-to:references:subject:to: from:date; d=margiolis.net; b=Ce0BI+8HYPOr6ymxoaEfNPFt03AetHHRUN/sFWSa n7fOP9sc9FMybgUE00/47fUzbkvGPInPCIEbPkJelm3uVXxBP7lXADUGmtWuf8yDrNDvHV qI4Lp47Bt643lpbcvcW4+zRcABC0QSXh7aOESo+KSrBLPYWepSN/PeS0rnppI= Received: from pleb (ppp-94-66-59-70.home.otenet.gr [94.66.59.70]) by margiolis.net (OpenSMTPD) with ESMTPSA id e23cb9b1 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Tue, 23 May 2023 15:22:32 +0000 (UTC) Date: Tue, 23 May 2023 18:22:31 +0300 From: Christos Margiolis To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 2cf8ef5910fd - main - rc.suspend: execute rc-scripts with suspend keyword Message-ID: <20230523152231.mdlnl6raoc3p7cmh@pleb> References: <202305231513.34NFDUKl098736@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202305231513.34NFDUKl098736@gitrepo.freebsd.org> X-Spamd-Result: default: False [-2.80 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; R_DKIM_ALLOW(-0.20)[margiolis.net:s=default]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[dev-commits-src-all@FreeBSD.org,dev-commits-src-main@FreeBSD.org]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; DKIM_TRACE(0.00)[margiolis.net:+]; ASN(0.00)[asn:20473, ipnet:95.179.144.0/20, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCVD_COUNT_TWO(0.00)[2]; FREEFALL_USER(0.00)[christos]; ARC_NA(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all:c]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4QQdNW0qD8z4GlN X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N The comment deletion is unrelated to the patch (should be its own patch) and was a result of misunderstanding in the PR. Christos Margiolis wrote: > The branch main has been updated by christos: > > URL: https://cgit.FreeBSD.org/src/commit/?id=2cf8ef5910fd3754f8021f9c67fde6b9d9030f33 > > commit 2cf8ef5910fd3754f8021f9c67fde6b9d9030f33 > Author: Johannes Totz > AuthorDate: 2023-05-23 15:11:31 +0000 > Commit: Christos Margiolis > CommitDate: 2023-05-23 15:11:31 +0000 > > rc.suspend: execute rc-scripts with suspend keyword > > For symmetry with rc.resume, give rc.suspend the ability to execute > rc-scripts. Use the suspend keyword for that. > > Use-case is for setting a wake-up time, e.g. via efiwake. > > Reviewed by: christos > Approved by: markj (mentor) > Differential Revision: https://reviews.freebsd.org/D39965 > --- > libexec/rc/rc.suspend | 23 ++++++++++++++++++----- > 1 file changed, 18 insertions(+), 5 deletions(-) > > diff --git a/libexec/rc/rc.suspend b/libexec/rc/rc.suspend > index 5f22cd1a05b1..41b5bcbf897b 100755 > --- a/libexec/rc/rc.suspend > +++ b/libexec/rc/rc.suspend > @@ -43,15 +43,28 @@ fi > > echo $$ 2> /dev/null > /var/run/rc.suspend.pid > > -# If you have troubles on suspending with PC-CARD modem, try this. > -# See also contrib/pccardq.c (Only for PAO users). > -# pccardq | awk -F '~' '$5 == "filled" && $4 ~ /uart/ \ > -# { printf("pccardc power %d 0", $1); }' | sh > - > # If a device driver has problems suspending, try unloading it before > # suspend and reloading it on resume. Example: > # kldunload usb > > +. /etc/rc.subr > + > +load_rc_config > + > +rcorder_opts="-k suspend" > + > +case ${local_startup} in > +[Nn][Oo] | '') ;; > +*) find_local_scripts_new ;; > +esac > + > +files=`rcorder ${rcorder_opts} /etc/rc.d/* ${local_rc} 2>/dev/null` > + > +for _rc_elem in $files; do > + debug "run_rc_script $_rc_elem suspend" > + run_rc_script $_rc_elem suspend > +done > + > /usr/bin/logger -t $subsystem suspend at `/bin/date +'%Y%m%d %H:%M:%S'` > /bin/sync && /bin/sync && /bin/sync > /bin/sleep 3 From nobody Tue May 23 15:27:14 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQdTt1wCCz4CbrX; Tue, 23 May 2023 15:27: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 4QQdTt1RCXz4Jrn; Tue, 23 May 2023 15:27:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684855634; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NF/T+0NQmDmZ6Q1pvAj7luozrdTKnx8PvKM5fyy4BuY=; b=mubTVhUGdBOtasVW2kKdLp6n98ozbHM5WGrw1Cm0BdWbqVLegLX2WRtrnOPCEkTGQiOj5+ V3Mz7yX1Qx6DV+53/noADpKAzB5Nrouw6dHUqEojKXnGW2C5+nGe45XRo1S/GTAiJo8qhg Xj0THkU2naxS/V/uybiX6r0tmaYohJVKCa9BxCIyIX2C4eWe+B8xSsrb0aFnJt5ecW9+dm xjPazBmDc+6Lu0i7hdTc2bCXUV5aZXcyZrIvcqY5CU4qGXv3IGtqexFY08+KNPeoJLQugP Z5UAZYaWbkMwTlMoq8C3u4iPUoEMJJL4FteeRYY3iUwFwWL65p17CxF7Zj6/LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684855634; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NF/T+0NQmDmZ6Q1pvAj7luozrdTKnx8PvKM5fyy4BuY=; b=GAv0KJq0T84URe6Mr0KmoBkxqAeqG0niLUrq85/CM+lG+ttmpxLfV4uXOddTS8JTaB+aNj AK4CCzHkXn0TamubTsjyIbYimrB09a8AWtVZwLxnQ+aRewZTknlbkMCuO8wQMmBmNOqZQl ufRsMBeUDW/31NheLO39m2ARoHnzRsCZZqWRyLEPmdjfEN6qODgYocUQ2clEjvycClKdE6 eOB2J0J7CLz3UogGDlZj3R1HQ+1PGrEV/xa0iMBT4QZW+MI0W6QcDPf2JKspsjvdL3flhI gi8ZHMx6G3vLPun/xDHY6IM064XLPk+y3GSx/eqhx4X0tbgjt8BLx5OQsVuBZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684855634; a=rsa-sha256; cv=none; b=AoQBvx3ehrOhEyj2/UarSUbCVLPP7Wdb0mNKSOzCMpwxAZNmaxfBVOK5VUEIRFkm1bLTbc DfODy3mluFYtRggj/cLONjMSmM2d5W9A9oAGh66JDn7vldflG+yF5n29WcH2e7OgOvLijw TLWVquAU+vuD0Ruzf5mAfgsqQ+CPP5rCLm1CeRXPL3XxYpcfoZOHzKTQS+uLJZsr+LHOc4 O1t3R5WypcUlRcina48+Xq02nKmtFyPXn8+53N/5VupD0GFUHNrdkkir0LNjM3LMy96cdC rpG12EZUfb7wCA9DR+kGfSbUH9lXV+ePL1fgYVk8g/mya8CPRYEqK5y7mHodog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQdTt0VM5z14XM; Tue, 23 May 2023 15:27: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 34NFRE3k015419; Tue, 23 May 2023 15:27:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NFREOb015418; Tue, 23 May 2023 15:27:14 GMT (envelope-from git) Date: Tue, 23 May 2023 15:27:14 GMT Message-Id: <202305231527.34NFREOb015418@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 7900879eec8d - main - rc.resume: remove obsolete comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7900879eec8d851f8ca8e45fd4863670a8da4e17 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=7900879eec8d851f8ca8e45fd4863670a8da4e17 commit 7900879eec8d851f8ca8e45fd4863670a8da4e17 Author: Christos Margiolis AuthorDate: 2023-05-23 15:26:56 +0000 Commit: Christos Margiolis CommitDate: 2023-05-23 15:26:56 +0000 rc.resume: remove obsolete comment Reviewed by: markj Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D40235 --- libexec/rc/rc.resume | 5 ----- 1 file changed, 5 deletions(-) diff --git a/libexec/rc/rc.resume b/libexec/rc/rc.resume index 55fd6ffec145..cee6f077a240 100755 --- a/libexec/rc/rc.resume +++ b/libexec/rc/rc.resume @@ -43,11 +43,6 @@ if [ -r /var/run/rc.suspend.pid ]; then echo 'rc.resume: killed rc.suspend that was still around' fi -# Turns on a power supply of a card in the slot inactivated. -# See also contrib/pccardq.c (only for PAO users). -# pccardq | awk -F '~' '$5 == "inactive" \ -# { printf("pccardc power %d 1", $1); }' | sh - # If a device driver has problems resuming, try unloading it before # suspend and reloading it on resume. Example: # kldload usb From nobody Tue May 23 15:31:35 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQdZw0XBCz4CbgL; Tue, 23 May 2023 15:31: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 4QQdZw05bgz4KPC; Tue, 23 May 2023 15:31:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684855896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=987lnOw0ba1pKYvza23vGb+gWqWrPix6iE+tJSMtWBY=; b=qD3hhNb54mDqFLQXNqK/aAE7fvW5sfuo3DF98tu4ONLk0EqTWN9XHxvqR+GQDHNg0vox1y ENxf9FLScslA7TFikPZERn86ydY4PlC3v4JxElNsEOBpjSbHzWUAz712EiEOHr8KwJ1xQB DPjlHh6L5hkr0LC7BaB6S09A6SYVu8n4WZ76J2tVdSYSHjHdwoLfzgguAeQ/WHaKOcW5kY HkyWFJMimdo+q9rHJ6qyA43DPor5845Dx8hwFQMharVw8gXF8iZQTmVvyst5e/MVc+ntPS sub+nA+seNWIWEzrqHdaMy2SMETj7i44py75PoqZ3yqVoqKQmobCIfZ0F7EwZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684855896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=987lnOw0ba1pKYvza23vGb+gWqWrPix6iE+tJSMtWBY=; b=fBXLexdo4y6/2BlI+kt7kFSahAc838UAgInSXSbVdkbWwox0ba+9qTvf+AHlhpZRAur/Ku k8BCEy/HFA2NFdAgbZFjpzAYeZ5ZiivcupyoLeh8Bt0DlmXmlEwfMv6Nt6MtJd+Abj7G6R bvO+7OxiQytgyHyiy+QjHfY+H8BSoALzUIy02ZtErqRxnYQfFiYcqoPjJJo+rDreCemyR0 O8bwQ2t4WG28GUprM9LeiIh0irLyfymQvLNyJv82VdcMQTIkrh6RNT3PPv/9M3J27HWaCv 7ZBjzeFynN1Y1tuErC7wEl/Pp2xsFm10EWaC7YAoFB24PeGYMuAevEAqTNcr1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684855896; a=rsa-sha256; cv=none; b=no4INtlW5dpgWMlXVF7go4GeXWl3uZHZPMD2ak9StEbSNKVY7IQqg1h4/9P/TdrrNbURO8 apZu6z/qceG9uVxSJs8dztcWVRediYpxNtvnqwVY3McKhbcA9pO4QsUahYAGlWLysD3TW/ gI0nl5kVqw5ebwA5uWCTZARFyfdSvXvAr840rQlKEu+jK/BI2vU2t9B/FZqUEuhsAR+baD H5C3gOr+zN/1yGmmTQSgbSFXI5Z77i71YJEKR//sQfpzd0RtjEvJ/gLT3NvZsQD5ivcQ4o UZ7JTtZMExEj5ur0kw4qMWyefyMWVOUrJKa5zMCSzWy4OZPAZUyYsazm22ZDMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQdZv6GBLz15L2; Tue, 23 May 2023 15:31: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 34NFVZvD027908; Tue, 23 May 2023 15:31:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NFVZB5027907; Tue, 23 May 2023 15:31:35 GMT (envelope-from git) Date: Tue, 23 May 2023 15:31:35 GMT Message-Id: <202305231531.34NFVZB5027907@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: 506321178137 - main - ctags: Error out if writing to stdout failed. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 506321178137b9d78d81bd971671e7bb51c3ecf0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=506321178137b9d78d81bd971671e7bb51c3ecf0 commit 506321178137b9d78d81bd971671e7bb51c3ecf0 Author: Dag-Erling Smørgrav AuthorDate: 2023-05-23 15:31:28 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-05-23 15:31:28 +0000 ctags: Error out if writing to stdout failed. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: cracauer, allanjude Differential Revision: https://reviews.freebsd.org/D40200 --- usr.bin/ctags/ctags.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.bin/ctags/ctags.c b/usr.bin/ctags/ctags.c index 3e933f033b3f..409b07f5354b 100644 --- a/usr.bin/ctags/ctags.c +++ b/usr.bin/ctags/ctags.c @@ -218,6 +218,8 @@ nextline: } } } + if (ferror(stdout) != 0 || fflush(stdout) != 0) + err(1, "stdout"); exit(exit_val); } From nobody Tue May 23 15:57:30 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQf9B5pn3z4CdX7; Tue, 23 May 2023 15:57:50 +0000 (UTC) (envelope-from garyj@gmx.de) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.gmx.net", Issuer "Telekom Security ServerID OV Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQf9B0d7Xz4MVZ; Tue, 23 May 2023 15:57:49 +0000 (UTC) (envelope-from garyj@gmx.de) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1684857468; i=garyj@gmx.de; bh=aKy5SfFHZ0PN0qAHDZikL/GOs2drBwyEZFqTQbZgfW0=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References: Reply-To; b=AHaXnImEUx7m+h0TMw6gpi0U+0dnrXGDaC3ZzHUcoybuJLYtM23Jfgx4juE9//QxA GpuHqBJ8exKHFwi8Ci8ouuDWYBD6atcU259l+vWKTHJYJlHW9zTqYPDFXCVFfUZLCJ r3dDzcMAycpNJKkKSG/yTJ7YiEfYv9hLYBZ689ExNACGQyDLrYoiOLRab+PjC86CwA 0M9O14x7juYUicuT8NKNpKYp71EQWrvUn2ZI58aWWuXee0aX1CqJTTrmspVmteByKP OHKUVD50NaOxxncH5wvHBtdDg0fhs42mIIznT+kMBX0Fn87bc0jILEiA+6fxX+6dAx npiyqXLXjn/HA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from ernst.home ([91.59.238.143]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MMobO-1pij3Q05sS-00IhZY; Tue, 23 May 2023 17:57:48 +0200 Date: Tue, 23 May 2023 15:57:30 +0000 From: Gary Jennejohn To: Mike Karels Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 108230743472 - main - pwd.1: replace /home with /sys in example Message-ID: <20230523175730.55eba02d@ernst.home> In-Reply-To: <202305231224.34NCOJYg017621@gitrepo.freebsd.org> References: <202305231224.34NCOJYg017621@gitrepo.freebsd.org> Reply-To: garyj@gmx.de X-Mailer: Claws Mail 3.19.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:Ltm88DqeuFWg5NLznv09xUS91ok+sB+kAw+p8F1XOAYInLNnrdR GQronMGax7qm0U2r7WUz/byrc3r+TgJ/FPniMIi0Yn7Z3CTq+FrA9bl+9Iyg/+27hsOuvq+ kGD/aORES4VLoHPDM6ofHEnQeh52b8/hmeQHzKh9b3l1PsKTJjCAIAxDSAIizYdXMMBa+hs DM4LJsUBYM+ERYMN3n3XA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:csUE7rax6RM=;Cs2agIpxX4ZqBE02t7MlyNVlGdX p+NYGXlqxHixSCApQK24N+9Ym6FXJDueTixUYcFB1aNry+quqoPR8R8EuFycTJcODTJq3gsvC kzikhZ7B7YWNttQycwfwyXt2RBpKe6lm2NJgQzF9ZLaSvY2clP5GLYVGNYT2C/5h9kMMZMcUl TNYNmmzkpCi4O7nl6wSxeioJL06eskgEbem8m3TEvV8PqiiW2fkShwcxriSpzETQ3ZXpXG2dT cSxX82jeNgqYbhYm1qBS3b9Hu0dZociO7tPdwe3gBcJqtiq3lzOriGmrO/7QEfGScyGWZZNHE jgAApFm9i5MkM54Lh8KY00VAdrbdvO1R0dCK4VgaoTrp/u/SXLnwTgIeZZZg3AtGW6vGv3zRM Ww1+Gano/PqDI5ij32Q0EcVGz4LBBApSyoY5DpHcenkeR5dqBtsNA03nQiZVUEFKbuTQTLQew 89SeSeMIT5JogYmrehPXLtHz57Ei59gIB545m5BXWF49ti47Q98q/cieTuxxIzjGqKGLJypB4 djXPqTUYxECx12Ry3+pbQ7grfMwtGwnzx1tlwq+qCj9xQ46Oq/xCAhR85KK1LTSAnypoz+BVf xpx2W3NZisSDN7HJhFZTO6NI/1OU7exY0W3iTfx8DRcD+6klXS+yCrSlJVEPpbDpTt/r4czwD Yraq53vPOQtl7rxo9hBXAqMyY3TN26FFgkwDOQ3PTOTrdEEgO9f4ZsShz7oY333RFpkSU52qz V+RXW5V4+j5fqAAxzfkA/SfjPtMb7iyyO/iwsRtKlwuiI0LK8Zm+yC9YDwlCzxZPswGDAYJMn DXdE+aijsQ4FNRV9eJSwL83Yc+S4z4Lmey2/hOFgXbRgbg5Ws7LtKRTdzPOiJBIOqpWF6qO1v mq0kxRQax6sVT1JoGvgbebRGm8sIJ72q26rhvb+eHNHnC9Rdq7cWrvYO3THCAm5Oj+UwIhCgJ YDMLKQ+BEBRGyRQXyKtKABO99i4= X-Rspamd-Queue-Id: 4QQf9B0d7Xz4MVZ X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Tue, 23 May 2023 12:24:19 GMT Mike Karels wrote: > The branch main has been updated by karels: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D108230743472b8b4b38c9b858= 088ab5059a1dddd > > commit 108230743472b8b4b38c9b858088ab5059a1dddd > Author: Mike Karels > AuthorDate: 2023-05-23 12:21:50 +0000 > Commit: Mike Karels > CommitDate: 2023-05-23 12:21:50 +0000 > > pwd.1: replace /home with /sys in example > > The default location for home directories is moving from /usr/home > to /home, and the /home symlink will no longer exist. Switch to > another example that is in base, /sys. > These files under /usr/src also include "/usr/home" in their contents: ./contrib/dialog/samples/form1-utf8 ./contrib/dialog/samples/passwordform1-utf8 ./contrib/libarchive/libarchive/test/test_write_format_ar.c ./contrib/libxo/libxo/libxo-csv.7 ./sbin/bectl/bectl.8 ./sbin/mksnap_ffs/mksnap_ffs.8 ./share/examples/diskless/README.TEMPLATING ./tests/sys/opencrypto/cryptodev.py ./usr.sbin/bsdconfig/usermgmt/include/usermgmt.hlp <=3D=3D this one has "/usr/home/ or /home/" in it Not sure whether the files under contrib need to be fixed. > Reviewed by: fernape > Differential Revision: --- > bin/pwd/pwd.1 | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/bin/pwd/pwd.1 b/bin/pwd/pwd.1 > index 2c27fcff9467..a6b62f7a595b 100644 > --- a/bin/pwd/pwd.1 > +++ b/bin/pwd/pwd.1 > @@ -32,7 +32,7 @@ > .\" @(#)pwd.1 8.2 (Berkeley) 4/28/95 > .\" $FreeBSD$ > .\" > -.Dd October 24, 2020 > +.Dd May 22, 2023 > .Dt PWD 1 > .Os > .Sh NAME > @@ -78,20 +78,20 @@ Logical current working directory. > Show current working directory with symbolic links resolved: > .Bd -literal -offset indent > $ /bin/pwd > -/usr/home/fernape > +/usr/src/sys/kern > .Ed > .Pp > Show the logical current directory. > Then use > .Xr file 1 > to inspect the > -.Pa /home > +.Pa /sys > directory: > .Bd -literal -offset indent > $ /bin/pwd -L > -/home/fernape > -$ file /home > -/home: symbolic link to usr/home > +/sys/kern > +$ file /sys > +/sys: symbolic link to usr/src/sys > .Ed > .Sh SEE ALSO > .Xr builtin 1 , > =2D- Gary Jennejohn From nobody Tue May 23 16:03:12 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQfHP2NSXz4CdnL; Tue, 23 May 2023 16:03: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 4QQfHP1dXbz4Mqb; Tue, 23 May 2023 16:03:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684857793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CMttGuA2UNLiQO9HDdguF/RcN1SyeDD4zXcN08P+hLw=; b=YSnd6d2r7IA9z32e2fVPm/QraJeA2eeHHa3rm9Wcrc8jeQnFyTvzHEvVhLR83FkYCVCr8W aqnsqTB8y+GJFVX76Ys28X1ybrrCiJHjWhpdpAFfZci3TAWNZityY2XtnJK8vf1dzEOxjJ DAXxz6pytMXnTXnaiU7W3mO09P5VtARufqmINSR+8VQKGSl/7sQZFPlBjMVtweh8ZwSuwg ndLuaL3948kdarzCDAxeVjMy+4hr0M+PMRUDMvtOQ9vdNZhQzoiUhnMqkX/+4GeiQNMoxh 0NnsMQR+uwJ0pkFFRZE1a9tjBim5v3gP63OSX7g31FyYj6XQR/nNHC/3mKyjsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684857793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CMttGuA2UNLiQO9HDdguF/RcN1SyeDD4zXcN08P+hLw=; b=Gyk3uqaCZtYszQFAbEWZQ+nYQX06x4sRH1M9qIlORtB1sUgU9vwcBBzxjsI5mWKRc5d8LX o1b/nG5BdROG3XbrVWtlsxgKyeVgYZloJLgqhf9gx6ZEL5pR1gat24B/H+hQRwimWefV4m 5DuPmfb0l3tDcQtjZFRRRaa9vSPKiIg+AhMgUrWqPqfTF+/E1KEqaVPv+qAiz3xQgCpPNP T0Wg7XEQPtltxajTuZ/OtINk3DiqNStEhp/9FQikM123XKb6S8j0mHwsJJgvd9HwBt+sTw KeC6HcOJ9Y3FXEBQ2arBsvQz6ox+JKOuQB+Wk26P/LM2OhP4i8hdjuXb5YjGjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684857793; a=rsa-sha256; cv=none; b=MKY/309VmXTBLFtzet3hjqkKvreh5JRNXGIEd9M/fvedFGgQ/joeJCXPQ9KLfDedbVF/8E txM1LiNQ5KOBkmgjthWl6JLoqvhBepiFmd4TRngkr0N4mK/vGcop18h6NeyKuWfrgNGuzw irPnjofPeWnpnw2XFZurvMChNlA5HI+7CmU4vRjLR7aS6RDMDrLPfdOX+Z4ZDhsDnSI5AC cVNJ+UJ1YjNpzKC08ouYIP61GakvPRwG3KaVG9UomVI176v0sb3aHrXtI82lsQTGhFTmbA wtHhNKwWt4cy+huYt7ohNLeAV7j491qomXzQk5hmCQKATaEc8OzQq/V5oXbQ/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 4QQfHP0fTpz16B1; Tue, 23 May 2023 16:03: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 34NG3Ciw081048; Tue, 23 May 2023 16:03:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NG3CPZ081047; Tue, 23 May 2023 16:03:12 GMT (envelope-from git) Date: Tue, 23 May 2023 16:03:12 GMT Message-Id: <202305231603.34NG3CPZ081047@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: 75e02c458a0d - main - libsecureboot ensure correct BUILD_UTC List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 75e02c458a0def1ee8054646434c738b4004de8f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=75e02c458a0def1ee8054646434c738b4004de8f commit 75e02c458a0def1ee8054646434c738b4004de8f Author: Simon J. Gerraty AuthorDate: 2023-05-23 16:02:00 +0000 Commit: Simon J. Gerraty CommitDate: 2023-05-23 16:02:00 +0000 libsecureboot ensure correct BUILD_UTC If using stat(1) on BUILD_UTC_FILE we should use -L incase it is a symlink. If we have new enough bmake though we can just use ${BUILD_UTC_FILE:mtime} --- lib/libsecureboot/Makefile.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/libsecureboot/Makefile.inc b/lib/libsecureboot/Makefile.inc index 921b5e7bc1d8..325eb5fb0d27 100644 --- a/lib/libsecureboot/Makefile.inc +++ b/lib/libsecureboot/Makefile.inc @@ -126,7 +126,11 @@ BUILD_UTC?= ${SOURCE_DATE_EPOCH} BUILD_UTC_FILE:= ${.PARSEDIR:tA}/${.PARSEFILE} .endif # you can of course set BUILD_UTC to any value you like -BUILD_UTC?= ${${STAT:Ustat} -f %m ${BUILD_UTC_FILE}:L:sh} +.if ${MAKE_VERSION} > 20230509 +BUILD_UTC?= ${BUILD_UTC_FILE:mtime} +.else +BUILD_UTC?= ${${STAT:Ustat} -L -f %m ${BUILD_UTC_FILE}:L:sh} +.endif # Generate ta.h containing one or more PEM encoded trust anchors in ta_PEM. # From nobody Tue May 23 16:05:53 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQfLd3HcZz4CdTZ; Tue, 23 May 2023 16:06:01 +0000 (UTC) (envelope-from karels@freebsd.org) Received: from mail2.karels.net (mail2.karels.net [3.19.118.201]) (using TLSv1.3 with cipher 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 "freebsd", Issuer "freebsd" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQfLc3XKRz4P4l; Tue, 23 May 2023 16:06:00 +0000 (UTC) (envelope-from karels@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from mail2.karels.net (localhost [IPv6:0:0:0:0:0:0:0:1]) by mail2.karels.net (8.17.1/8.17.1) with ESMTP id 34NG5sJi037226; Tue, 23 May 2023 11:05:54 -0500 (CDT) (envelope-from karels@freebsd.org) Received: from [10.0.2.130] ([73.62.165.147]) by mail2.karels.net with ESMTPSA id 7DuaDGLkbGRokQAAs/W3XQ (envelope-from ); Tue, 23 May 2023 11:05:54 -0500 From: Mike Karels To: Gary Jennejohn Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 108230743472 - main - pwd.1: replace /home with /sys in example Date: Tue, 23 May 2023 11:05:53 -0500 X-Mailer: MailMate (1.14r5964) Message-ID: In-Reply-To: <20230523175730.55eba02d@ernst.home> References: <202305231224.34NCOJYg017621@gitrepo.freebsd.org> <20230523175730.55eba02d@ernst.home> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4QQfLc3XKRz4P4l X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.16.0.0/14, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 23 May 2023, at 10:57, Gary Jennejohn wrote: > On Tue, 23 May 2023 12:24:19 GMT > Mike Karels wrote: > >> The branch main has been updated by karels: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=3D108230743472b8b4b38c9b8= 58088ab5059a1dddd >> >> commit 108230743472b8b4b38c9b858088ab5059a1dddd >> Author: Mike Karels >> AuthorDate: 2023-05-23 12:21:50 +0000 >> Commit: Mike Karels >> CommitDate: 2023-05-23 12:21:50 +0000 >> >> pwd.1: replace /home with /sys in example >> >> The default location for home directories is moving from /usr/home= >> to /home, and the /home symlink will no longer exist. Switch to >> another example that is in base, /sys. >> > > These files under /usr/src also include "/usr/home" in their contents: > > ./contrib/dialog/samples/form1-utf8 > ./contrib/dialog/samples/passwordform1-utf8 > ./contrib/libarchive/libarchive/test/test_write_format_ar.c > ./contrib/libxo/libxo/libxo-csv.7 > ./sbin/bectl/bectl.8 See https://reviews.freebsd.org/D40206. > ./sbin/mksnap_ffs/mksnap_ffs.8 https://reviews.freebsd.org/D40205 > ./share/examples/diskless/README.TEMPLATING This one is historical. > ./tests/sys/opencrypto/cryptodev.py > ./usr.sbin/bsdconfig/usermgmt/include/usermgmt.hlp <=3D=3D this one has= > "/usr/home/ or /home/" in it > > Not sure whether the files under contrib need to be fixed. I wasn=E2=80=99t sure either. Mike From nobody Tue May 23 17:49:00 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQhdT1qMnz4CkV0; Tue, 23 May 2023 17:49: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 4QQhdT1M2lz4b92; Tue, 23 May 2023 17:49:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684864141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iNzMPguUVVr+5BnkNXuR/lveCpWxTTmSMgd60oQqhIY=; b=QmfRPO7sxF11AFO+NjsTvOBx1es9b3nEASmf/OKxZyePkHuVTxUBx1c5mRl7NVoG11cq+8 0p9GeA+j5ezflfBJEtu7lHNh1bgVnynAEJAuhEUpJP9acoc1mvpCWXiZX9i7XYNxLn66oC KJ4wZKc7KnTwwbc2XubS1VFqrUEZLW3s1Bl3rzztyxeUKrjXfE6Y3rZDQsIcyfaYKNSvRe uiNW/Bpop1OKFh3TXh5zqwxZBXPv5wRzGIpu8QfI2Xy/aK6wkrekcumFFSFW4ieeIA2izu iTiGt7Kwx6pM5vEBTgp/2ETStdjLE+Ko+I4r+rBEWt/SOWuG6ksAsGhydcxhTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684864141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iNzMPguUVVr+5BnkNXuR/lveCpWxTTmSMgd60oQqhIY=; b=q0MYJSPxYdnvkXVBx1JqtPk0uKWzB95Mdbwg+dYHdrRmGU3+5MLBHYEcAAvrlBu/bGncEm us2WQzOX/6Jhejq03YWsjcKG6cz2yW0pu80ZOUQV/Pl1FVYZb4Rc0lfwTEdz79/IPsQGqs YEVeuHPmqS9HYFCaQ0WyyZOPHsQrxX5ZnS5GVHMMHsiDN4q8raYjazymBpKdiPc7xUIDUs pLAlUyBE21UFpSMQmhI4S4/3rnrzC2pKUSfVwwCu1S0cHpgvPsdKLcdzKe09bzUJMcqwKt qwp3+2+88QJ+acwTF9I8Of0anMKpMovWW4e2aACVMJtX80n64s2UHoU6KbWYbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684864141; a=rsa-sha256; cv=none; b=jj4s4LqHvSgZ3L1MMwoxSwY9lPRhUEE4UTxyOLnaWQI5viBkmL6WmvgMz46mNKFqLLGLQ0 yph97Et+XcTQDqCB2CY2FHSGLkJPkbIi/4gRi5kRdhDXXIuq3lPdkehlMw1STN70756T2j mDsERm4d1+NNPOj7U7TNjmbY/v+73UxJwSxN43F3dEBdKYt/DUDrRJ2PRigCPPpwZ0EDpg lbyT81p90EvcaWVTlLt6QARYQ3pr3GJa/fE/iOIJ4OxHsBVxl3edLBpfkOk4dYMdpGN1v6 vGSTxupvllNM58SQ5IQXstMkbgaFwrCsDNrWXUIDD+yRL3taAMGLsyEc5KSlvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQhdT0KTmz18XZ; Tue, 23 May 2023 17:49: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 34NHn0hv046211; Tue, 23 May 2023 17:49:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NHn0v6046210; Tue, 23 May 2023 17:49:00 GMT (envelope-from git) Date: Tue, 23 May 2023 17:49:00 GMT Message-Id: <202305231749.34NHn0v6046210@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 3006f6df025f - main - Update -ftrivial-auto-var-init flags for clang >= 16 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3006f6df025f3afd0fb3cca1b820cdac1f1ed4c9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=3006f6df025f3afd0fb3cca1b820cdac1f1ed4c9 commit 3006f6df025f3afd0fb3cca1b820cdac1f1ed4c9 Author: Dimitry Andric AuthorDate: 2023-05-23 17:40:36 +0000 Commit: Dimitry Andric CommitDate: 2023-05-23 17:44:45 +0000 Update -ftrivial-auto-var-init flags for clang >= 16 As of clang 16, the -ftrivial-auto-var-init=zero option no longer needs -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang to enable the option. Only add it for older clang versions. PR: 271047 Reviewed by: emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D40208 --- share/mk/bsd.lib.mk | 14 ++++++++------ share/mk/bsd.prog.mk | 14 ++++++++------ sys/conf/kern.mk | 6 ++++-- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 8e5035f6db41..9a947b85bfe2 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -99,19 +99,21 @@ LDFLAGS+= -Wl,-zretpolineplt # Initialize stack variables on function entry .if ${MK_INIT_ALL_ZERO} == "yes" .if ${COMPILER_FEATURES:Minit-all} -CFLAGS+= -ftrivial-auto-var-init=zero \ - -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang -CXXFLAGS+= -ftrivial-auto-var-init=zero \ - -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +CFLAGS+= -ftrivial-auto-var-init=zero +CXXFLAGS+= -ftrivial-auto-var-init=zero +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 160000 +CFLAGS+= -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +CXXFLAGS+= -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +.endif .else -.warning InitAll (zeros) requested but not support by compiler +.warning InitAll (zeros) requested but not supported by compiler .endif .elif ${MK_INIT_ALL_PATTERN} == "yes" .if ${COMPILER_FEATURES:Minit-all} CFLAGS+= -ftrivial-auto-var-init=pattern CXXFLAGS+= -ftrivial-auto-var-init=pattern .else -.warning InitAll (pattern) requested but not support by compiler +.warning InitAll (pattern) requested but not supported by compiler .endif .endif diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index de453564579d..6f1079944914 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -72,19 +72,21 @@ LDFLAGS+= -Wl,-zretpolineplt # Initialize stack variables on function entry .if ${MK_INIT_ALL_ZERO} == "yes" .if ${COMPILER_FEATURES:Minit-all} -CFLAGS+= -ftrivial-auto-var-init=zero \ - -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang -CXXFLAGS+= -ftrivial-auto-var-init=zero \ - -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +CFLAGS+= -ftrivial-auto-var-init=zero +CXXFLAGS+= -ftrivial-auto-var-init=zero +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 160000 +CFLAGS+= -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +CXXFLAGS+= -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +.endif .else -.warning InitAll (zeros) requested but not support by compiler +.warning InitAll (zeros) requested but not supported by compiler .endif .elif ${MK_INIT_ALL_PATTERN} == "yes" .if ${COMPILER_FEATURES:Minit-all} CFLAGS+= -ftrivial-auto-var-init=pattern CXXFLAGS+= -ftrivial-auto-var-init=pattern .else -.warning InitAll (pattern) requested but not support by compiler +.warning InitAll (pattern) requested but not supported by compiler .endif .endif diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 245f81e6ed71..b6646f6c35ca 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -252,8 +252,10 @@ CFLAGS+= -mretpoline # .if ${MK_INIT_ALL_ZERO} == "yes" .if ${COMPILER_FEATURES:Minit-all} -CFLAGS+= -ftrivial-auto-var-init=zero \ - -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +CFLAGS+= -ftrivial-auto-var-init=zero +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 160000 +CFLAGS+= -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang +.endif .else .warning InitAll (zeros) requested but not support by compiler .endif From nobody Tue May 23 17:49:02 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQhdV3cj0z4Ckjt; Tue, 23 May 2023 17:49: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 4QQhdV2lN5z4bNp; Tue, 23 May 2023 17:49:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684864142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/Y23Q89P5IVagX5SqE/T1Rh8nk6JjCLeDoIUpHP/ZGs=; b=I/Mu5NWFWKNNVqyDQO/TrO2oyO5XgmEFMR2vrqJcQa315OdepL0ABREpEpR7i8oUfNv6Yk yL8TUvqoj2PaeDfPlvjg80Vc4Y1CV56s9bDTZ2hTKrj7twdzxyo1SuWvfPIIQ1AuMF1Drs 0aUBy+LA6ZB9Bnq9rtx+sju+IXxV0k6Vib6x2ZkXqF1xzt89KtliTgObFoZT4E8cfsHTHH jY60yqBDKBR02kB+/feubEfl5A/mSm7Bk5xclXqx+Uv+ZwdlqXFTTt+gBJqVuOBBmGVCC8 hsysEvEaycFxon12hNL02HiQIPjrzgADPnirJJGSFvPNh6vsgPDDaAIw8Tw+eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684864142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/Y23Q89P5IVagX5SqE/T1Rh8nk6JjCLeDoIUpHP/ZGs=; b=gM4Do2WJPJ09PbpOwz/Ufnzv+0AAquhtMyFFG/DPDdIC8Yd6WpDrXhsUPc93rJcM01KQPL Q7lXe8791W55T05XecJ+gCHSQOBWurIug/ERRpfVObhymrXM0btSdgdM59HOXSNg3ux1e0 ZATH7KIJlatAJrNPBLEB2o3PPZF4+vYm68BRG3c3XI6PXq5KNt34RGD20H4CWr9dYft79n ibzkPcvgs12SV0is6MZJIuUQVjsRSh3cPAb8R+aEU1HuRfjgCWh6ky2+qSxfd/pfDYasPe ucgp/wkKErqckS2//DI7OXc5JgaTsC3oILgoL2uAkAbazHbW8IJkKQAjFmn24A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684864142; a=rsa-sha256; cv=none; b=MwULDbPg4npSDoekn3dEmA44DOcDIGXMLn43RYQlECKX3R7bNt/kyYpkhOKRyWdUs8ow+C rMcOwf3nUgejWp4S+o1Bynh4x+JVfPfu3aZuUenQomcb2IHCtIjho6mMLm3YkD0fiUtmco WbYqgsLlsL0vaWwYr8LbuoTxMByNES/SLUi8bB9+DJoDsqLqQHSczJZEJ6k3h8MTDkQ16v uePUePBDq/5+oiXSTyuzDoiWciRZhvOyDPfQzJXcBbVWt3au9nJW+gtKXyYVcPXwDxMS5M LxWTqV2rRU+QZJOeB+MZm5YmMADGqDKYjYBixloUjrY9d+ZgWyJcZGAt+dcFfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQhdV1J1zz18lc; Tue, 23 May 2023 17:49: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 34NHn2mV046230; Tue, 23 May 2023 17:49:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NHn2X3046229; Tue, 23 May 2023 17:49:02 GMT (envelope-from git) Date: Tue, 23 May 2023 17:49:02 GMT Message-Id: <202305231749.34NHn2X3046229@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: c32736222cdd - main - Enable -ftrivial-auto-var-init flags for gcc >= 12 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c32736222cdd92e1497d1154d81c9005757fb308 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=c32736222cdd92e1497d1154d81c9005757fb308 commit c32736222cdd92e1497d1154d81c9005757fb308 Author: Dimitry Andric AuthorDate: 2023-05-23 17:43:12 +0000 Commit: Dimitry Andric CommitDate: 2023-05-23 17:44:45 +0000 Enable -ftrivial-auto-var-init flags for gcc >= 12 Now that gcc >= 12 supports -ftrivial-auto-var-init, add it to bsd.compiler.mk's "init-all" feature. PR: 271047 Reviewed by: emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D40208 --- share/mk/bsd.compiler.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk index e34c3c62a7e8..b5a896b82a43 100644 --- a/share/mk/bsd.compiler.mk +++ b/share/mk/bsd.compiler.mk @@ -239,8 +239,12 @@ ${X_}COMPILER_FEATURES+= c++17 (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 100100) ${X_}COMPILER_FEATURES+= c++20 .endif +.if ${${X_}COMPILER_TYPE} == "clang" || \ + (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 120000) +${X_}COMPILER_FEATURES+= init-all +.endif .if ${${X_}COMPILER_TYPE} == "clang" -${X_}COMPILER_FEATURES+= retpoline init-all +${X_}COMPILER_FEATURES+= retpoline # PR257638 lld fails with BE compressed debug. Fixed in main but external tool # chains will initially not have the fix. For now limit the feature to LE # targets. From nobody Tue May 23 17:57:52 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQhqh2D2nz4ClDn; Tue, 23 May 2023 17: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 4QQhqh1kPQz4lGs; Tue, 23 May 2023 17: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=1684864672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u/AjmLAh+eqNT9gpIRx4qoNs8tnYVjuC86C/jNzwRJQ=; b=exkvvFKxsShu6kjtpxQHXsQz6XkGhClo80F+3gknjQpyfLsu6SSl+bLeso8u+ApzCIwwbF ged55Ku/TGaF3L39yn28D2dJ3T0IJbNzrc/ZEbdW+CVzfSBrDI46KoVAzThsbyntX4L7uc yyMbnWNFg07TB1F7C9DrpvMoMHmpiO1qf5vfGCP8yZnS0Dma8lkm4jpb4nJ47TJk+qGBlF WueH1D8znabE8iHQeJK6ZJSMAdH0AOV9squxT6s6Od51UInv8LuOY7Cc2isEkMlX30QSfW zl6EPBZn5aDrl5gW0QS/TXIftyKA4GTKRAM6MXZYA7GHmfBTpCy8KGRa2Oth3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684864672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u/AjmLAh+eqNT9gpIRx4qoNs8tnYVjuC86C/jNzwRJQ=; b=ufnkpKawEuOlV/w9czbYkNDdD/HyIb7PrKyo1kDTuWZIl4+PKH4W1q+IxdkNz9Q3vdVaT4 vmV2FThKjl2q6ILQ2u9CqoHqBKxt5S+IP3Mm0RssvSyWkeTyl8kZ9JJmYx50opgZ0DZnFJ fEcaP2cBWQv+9aQjU+syoDDCLGZSqTeaklaaAi5iCe8go+6l1ON+sagzz7zSFWhHJ86pDK 5lj+WSfHFKfI5H/vBctFP0DEaUxgEd4dypfdCYyMo1V9zZssjwz4mW+UsQIBMguZ+TESjs SonEzPvrFNMYPeX6R2oDCDqFY2ttqEfGYCEH5sf2Bfxd+a5oQPgPp0FuSNBJug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684864672; a=rsa-sha256; cv=none; b=l48kjRisJcQDjQrdTKAP13i2r2BBVx0zKdQQ1uzl2C4A2hF0K3Uzb2Kocd4N3FhUACgSnj UHH1Rf5LNTDCTiGOzctSvCJ3ZxOwtL7aVepRggrn19GvPOv02rYxApprHnS3O0v2NON3E1 i1PkaQwGC8Y2hQx2d+2+c0ggJcYkkPMZQIJGMv/IjqEhvAQ5ajE0GTEK1AfJb5PxssQLgx NWUbHt7BFrw2yMqcKQkozKPFLjZ5lo99UCSyp3niEjbeSsuilacm1UBCAC6g88Eg2EZ8dS JB9wlOOPN/GBMFHNweT+ziLBdTor5zVyPDXLmKlBuZI2IhaDIjNMJLT6Yztj0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQhqh0ntRz18Z0; Tue, 23 May 2023 17: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 34NHvqHR062133; Tue, 23 May 2023 17: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 34NHvqSb062132; Tue, 23 May 2023 17:57:52 GMT (envelope-from git) Date: Tue, 23 May 2023 17:57:52 GMT Message-Id: <202305231757.34NHvqSb062132@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 3741ffdb14ae - main - Fix typo in sys/conf/kern.mk's InitAll warning message List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3741ffdb14ae6915abfa55307f3e964492b272c3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=3741ffdb14ae6915abfa55307f3e964492b272c3 commit 3741ffdb14ae6915abfa55307f3e964492b272c3 Author: Dimitry Andric AuthorDate: 2023-05-23 17:56:41 +0000 Commit: Dimitry Andric CommitDate: 2023-05-23 17:56:46 +0000 Fix typo in sys/conf/kern.mk's InitAll warning message I missed this one in commit 3006f6df025f. Fixes: 3006f6df025f MFC after: 3 days --- sys/conf/kern.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index b6646f6c35ca..30f7fdbc869a 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -257,7 +257,7 @@ CFLAGS+= -ftrivial-auto-var-init=zero CFLAGS+= -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang .endif .else -.warning InitAll (zeros) requested but not support by compiler +.warning InitAll (zeros) requested but not supported by compiler .endif .elif ${MK_INIT_ALL_PATTERN} == "yes" .if ${COMPILER_FEATURES:Minit-all} From nobody Tue May 23 20:56:21 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQmnd6gpPz4T2nw; Tue, 23 May 2023 20:56: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 4QQmnd3qZpz3wBd; Tue, 23 May 2023 20:56:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684875381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ge5xNhLdD5JOKlvbcx10rsp1pAQ3JRwCSgihlmpSGUA=; b=gLugtUGsLVK36E+WZ49C7AhHSaemP9Wj9eM1fMbWMpbXFrI09yDijEoQm2/yNLUTZaAOh2 1i+UKrfvfVNYVpmUYh9vpAYnGDZS5K8X+RqRCW1AL+eSZwBZZnFjMbv5nbNJ7PuYPVrBtY EngrFcomCOwvNpCKRbIhYWK+hNtnHLGAG3xXCAx6KjZ3qDSzsOMdbE7L7Jacz182Sg7lHf 1fw79ni3GCMMYuX10NzXGg36/dMBc/NC9Z3O47ujQs+tqrTHvCPasu0ZBE1x6oAnPDDqxw 3YZEqwZaGBEbzH6+Orf6eFO9I+cpJvZmjmT6yBix+UhXuW9Ffzla82HhcOfsxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684875381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ge5xNhLdD5JOKlvbcx10rsp1pAQ3JRwCSgihlmpSGUA=; b=bF23c1bM+ybtxYv8WZSJ2iGuavh6957aJjH2zLFI1FUPKBrn2Viur8bT6ILYI4nHoYgWbD utAVEWjj4jq9B1zhDoztAcapnwZ84J7bK7/zElnwZ8hHre6Q/20/FXbCzox/8XefwvZvxD nxCJRMBCZlIMl9EAro2xqLeV6CH/GLc3bhiQcJSPIvsNsOl+LfXOwZqIcRVNUaHIIv5Aj+ RWENWTOZI37a0MaEbFqL5EuPuiXCu3I4rL2El2OH9kOwcM9OjamLxwxUFCSMFP7ZDsaUES 8mxsvR1gfnK+JC60OTJfQoRumIgJ5+t1H8EYSzVsmUr1TQz4bn1cQlyFoT8yqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684875381; a=rsa-sha256; cv=none; b=Qj4ZxGZqfME+F5Yr1IhBpXrfyziJI4Q9biEjaqTICEdW4qvJ5lkQFqPxjdmWuB8lgjFU6v bqocYmadNUnIrMQ9HNfeGEjB+LRu0fWWDk9UZ0Pap1bz0nA2BFfSodlxUQo0UpbCqWZdRT SJK9et9Vku04BWvoWUMK77fB0FMqQ1IrBiTKcMw5j/SlHC+VjKimMxxC+Ksf9pJPclULXx vHP559934vbwOltA/2QBlAj1o01F/kxIpPb79bLHWz63z2arJSY9Tha1A7fG3dalvjPLRv D/ojw+9IXH/VtIg7iY1n5eDwLx8yALneo9Mvc9H+YQtxJlgfkszfGayO7q7fMw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQmnd2wmGzFhX; Tue, 23 May 2023 20:56: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 34NKuL3l059110; Tue, 23 May 2023 20:56:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NKuLHU059109; Tue, 23 May 2023 20:56:21 GMT (envelope-from git) Date: Tue, 23 May 2023 20:56:21 GMT Message-Id: <202305232056.34NKuLHU059109@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 7e49aa86a282 - main - ifconfig(8): Teach ifconfig to attach and run itself in a jail List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7e49aa86a2824e76e9d9becf61db12066bc0d79d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=7e49aa86a2824e76e9d9becf61db12066bc0d79d commit 7e49aa86a2824e76e9d9becf61db12066bc0d79d Author: Yan Ka Chiu AuthorDate: 2023-05-23 20:39:22 +0000 Commit: Li-Wen Hsu CommitDate: 2023-05-23 20:39:22 +0000 ifconfig(8): Teach ifconfig to attach and run itself in a jail Add -j flag to ifconfig to allow ifconfig to attach and run inside a jail. This allow parent to configure network interfaces of its children even if ifconfig is not available in child's tree (e.g. Linux Jails) Reviewed by: emaste, khng, melifaro Event: Kitchener-Waterloo Hackathon 202305 MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D40213 --- sbin/ifconfig/ifconfig.8 | 24 +++++++++++++++++++++++- sbin/ifconfig/ifconfig.c | 38 +++++++++++++++++++++++++++++++------- sbin/ifconfig/ifconfig.h | 1 + 3 files changed, 55 insertions(+), 8 deletions(-) diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index 4669e96e28e6..a7e1bb26d81a 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd March 6, 2023 +.Dd May 22, 2023 .Dt IFCONFIG 8 .Os .Sh NAME @@ -36,6 +36,7 @@ .Nd configure network interface parameters .Sh SYNOPSIS .Nm +.Op Fl j Ar jail .Op Fl kLmn .Op Fl f Ar type Ns Cm \&: Ns Ar format .Ar interface @@ -49,9 +50,11 @@ .Oc .Op Ar parameters .Nm +.Op Fl j Ar jail .Ar interface .Cm destroy .Nm +.Op Fl j Ar jail .Fl a .Op Fl dkLmuv .Op Fl f Ar type Ns Cm \&: Ns Ar format @@ -61,13 +64,16 @@ .Nm .Fl C .Nm +.Op Fl j Ar jail .Fl g Ar groupname .Nm +.Op Fl j Ar jail .Fl l .Op Fl du .Op Fl g Ar groupname .Op Ar address_family .Nm +.Op Fl j Ar jail .Op Fl dkLmuv .Op Fl f Ar type Ns Cm \&: Ns Ar format .Sh DESCRIPTION @@ -233,6 +239,22 @@ Setting to .Cm all selects all interfaces. +.It Fl j Ar jail +Perform the actions inside the +.Ar jail . +.Pp +The +.Cm ifconfig +will first attach to the +.Ar jail +(by jail id or jail name) before performing the effects. +.Pp +This allow network interfaces of +.Ar jail +to be configured even if the +.Cm ifconfig +binary is not available in +.Ar jail . .It Fl k Print keying information for the .Ar interface , diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index c5e7b7befc72..e1467e661657 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -42,6 +42,9 @@ static const char rcsid[] = #include #include +#ifdef JAIL +#include +#endif #include #include #include @@ -184,12 +187,12 @@ usage(void) } fprintf(stderr, - "usage: ifconfig [-f type:format] %sinterface address_family\n" + "usage: ifconfig [-j jail] [-f type:format] %sinterface address_family\n" " [address [dest_address]] [parameters]\n" - " ifconfig interface create\n" - " ifconfig -a %s[-d] [-m] [-u] [-v] [address_family]\n" - " ifconfig -l [-d] [-u] [address_family]\n" - " ifconfig %s[-d] [-m] [-u] [-v]\n", + " ifconfig [-j jail] interface create\n" + " ifconfig [-j jail] -a %s[-d] [-m] [-u] [-v] [address_family]\n" + " ifconfig [-j jail] -l [-d] [-u] [address_family]\n" + " ifconfig [-j jail] %s[-d] [-m] [-u] [-v]\n", options, options, options); exit(1); } @@ -437,7 +440,7 @@ args_parse(struct ifconfig_args *args, int argc, char *argv[]) int c; /* Parse leading line options */ - strlcpy(options, "G:adf:klmnuv", sizeof(options)); + strlcpy(options, "G:adf:j:klmnuv", sizeof(options)); for (p = opts; p != NULL; p = p->next) strlcat(options, p->opt, sizeof(options)); while ((c = getopt(argc, argv, options)) != -1) { @@ -458,6 +461,15 @@ args_parse(struct ifconfig_args *args, int argc, char *argv[]) usage(); args->nogroup = optarg; break; + case 'j': +#ifdef JAIL + if (optarg == NULL) + usage(); + args->jail_name = optarg; +#else + Perror("not built with jail support"); +#endif + break; case 'k': args->printkeys = true; break; @@ -547,7 +559,9 @@ main(int ac, char *av[]) char *envformat; size_t iflen; int flags; - +#ifdef JAIL + int jid; +#endif f_inet = f_inet6 = f_ether = f_addr = NULL; lifh = ifconfig_open(); @@ -566,6 +580,16 @@ main(int ac, char *av[]) args_parse(&args, ac, av); +#ifdef JAIL + if (args.jail_name) { + jid = jail_getid(args.jail_name); + if (jid == -1) + Perror("jail not found"); + if (jail_attach(jid) != 0) + Perror("cannot attach to jail"); + } +#endif + if (!args.all && !args.namesonly) { /* not listing, need an argument */ args.ifname = args_pop(&args); diff --git a/sbin/ifconfig/ifconfig.h b/sbin/ifconfig/ifconfig.h index 7b2b88a4dfac..1df94f357c43 100644 --- a/sbin/ifconfig/ifconfig.h +++ b/sbin/ifconfig/ifconfig.h @@ -219,6 +219,7 @@ struct ifconfig_args { const char *matchgroup; /* Group name to match */ const char *nogroup; /* Group name to exclude */ const struct afswtch *afp; /* AF we're operating on */ + const char *jail_name; /* Jail name or jail id specified */ }; struct option { From nobody Tue May 23 22:03:40 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQpHT5NrVz4T6P6; Tue, 23 May 2023 22:03:49 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQpHT3GSWz44CJ; Tue, 23 May 2023 22:03:49 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Authentication-Results: mx1.freebsd.org; none Date: Wed, 24 May 2023 00:03:40 +0200 Author: Steffen Nurpmeso From: Steffen Nurpmeso To: Li-Wen Hsu Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 7e49aa86a282 - main - ifconfig(8): Teach ifconfig to attach and run itself in a jail Message-ID: <20230523220340._2XnU%steffen@sdaoden.eu> In-Reply-To: <202305232056.34NKuLHU059109@gitrepo.freebsd.org> References: <202305232056.34NKuLHU059109@gitrepo.freebsd.org> Mail-Followup-To: Li-Wen Hsu , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org User-Agent: s-nail v14.9.24-470-g00466668ef OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. X-Rspamd-Queue-Id: 4QQpHT3GSWz44CJ X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15987, ipnet:217.144.128.0/20, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Hello. Hm, from only looking at the mailed diff, and without real knowledge of getopt(3) (i "always" used my own thing) ... Li-Wen Hsu wrote in <202305232056.34NKuLHU059109@gitrepo.freebsd.org>: ... |URL: https://cgit.FreeBSD.org/src/commit/?id=7e49aa86a2824e76e9d9becf61d\ |b12066bc0d79d | |commit 7e49aa86a2824e76e9d9becf61db12066bc0d79d |Author: Yan Ka Chiu |AuthorDate: 2023-05-23 20:39:22 +0000 |Commit: Li-Wen Hsu |CommitDate: 2023-05-23 20:39:22 +0000 | | ifconfig(8): Teach ifconfig to attach and run itself in a jail ... [cool thing, by the way!] ... |- strlcpy(options, "G:adf:klmnuv", sizeof(options)); |+ strlcpy(options, "G:adf:j:klmnuv", sizeof(options)); ... |+ case 'j': |+#ifdef JAIL |+ if (optarg == NULL) |+ usage(); ... i think for "j:" getopt(3) guarantees 'j' has an argument? |+ args->jail_name = optarg; ... Ciao! --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) |~~ |..and in spring, hear David Leonard sing.. | |The black bear, The black bear, |blithely holds his own holds himself at leisure |beating it, up and down tossing over his ups and downs with pleasure |~~ |Farewell, dear collar bear From nobody Tue May 23 23:19:12 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQqyS36NCz4T9JM; Tue, 23 May 2023 23:19:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQqyS288Zz48j1; Tue, 23 May 2023 23:19:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684883952; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9MHrOZgm0JEyyyAky8wHzFHfJW/baCKhyS0kXGlPTHg=; b=De5WAIMZxvpy2XZQbVQkC15RlYEqnDjj4OfO+0DXtyGI4quUnZlz8RmUfr5c7sx3PO9Z0J Wjc0/Ox3PqYYeOtk8AY1pwUNHGgsXiwvBlOfGh+ooJP/Xsbxlt1ogEvh363jDAxM5JJE8u AQUR6xjX32ZVVAaYcKjjgbgCqhPfAqcwO8WS3+CAnBGz4zD8uziJR/6cxv9GZ8cLYFEmBr SjGNljO9QxD7dYXRPDYherMeM15Xq4CiXMgyFc+dVwuBFq4XcywF3BPsbCT8BhP9IY9yNA GILouFWMdzZOy7tu4kVofxxluN1Ec/YiZadO4NKFarijbFcy9bX8BOJ2HupeEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684883952; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9MHrOZgm0JEyyyAky8wHzFHfJW/baCKhyS0kXGlPTHg=; b=szKCXlPd7L501CUDCHZvuUXbs8g0lgXAbWPnmnmhCn8x8Ga/7XOKJ3KPpebu22KZEWUlD0 54R7N7zIslxbv8cFQDRB3qA9Dc+RmAaEA2Y/GBbzsQRFaKv8DRJNBUSkuFlDE9v0U5gmhn GAV8C64QdVyODE3J8UGB5076EZab/zrTrBpuUGkUJGMlBC8lex9RlD7tKDKZ647Hb9GicC iu/BXNETwMRGaeUydFKQiOyTe0mPu09LZBBGZU//gOeLjJfUskLgrwZEaotqg1/w8t2JpJ tEr3nwJMDO1BcaaR0DqyXFZqyeTYok5LcbRD2Lt9JHFbC28P0dskLKfEJxo7yA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684883952; a=rsa-sha256; cv=none; b=beIgRnN1n4CuPVQ2CSKkzmk/lDTHZIG33Wvo9ws63t/M/UrUZQ3tKR0i3yxtDZuvahw0Fm /hvcHsFbL/yfRtbd0e4B+9bA81lu7dDlMDPla3PbE123mtE8sZClEGGirInI0bgQHJIXXU QdCxnNxNKR9pseSWO9yqosJ3uW85upwgON6akb1jAXDyKpHeYFS8Lpxo+ZWfTNrKug+bu5 COpw8SrW/s2SJsd3/ksRNcJcmtilK1pO2BM5UIqQ9qryqX2a9kl8aHn7ik+6Z3YSM942ab dpMZ2HvohbsJaG7tJ1hzq8J9g+bVpxFuxRgroYU7csCNlR9HTjzop9WOxtY4hg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQqyS15KbzKKQ; Tue, 23 May 2023 23:19:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34NNJCbH090570; Tue, 23 May 2023 23:19:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NNJCqj090569; Tue, 23 May 2023 23:19:12 GMT (envelope-from git) Date: Tue, 23 May 2023 23:19:12 GMT Message-Id: <202305232319.34NNJCqj090569@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 1213a6bea8a1 - main - LinuxKPI: skbuff: add napi_build_skb() and skb_mark_for_recycle() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1213a6bea8a16dc797efea5a7ed7d6a4d7cb4675 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=1213a6bea8a16dc797efea5a7ed7d6a4d7cb4675 commit 1213a6bea8a16dc797efea5a7ed7d6a4d7cb4675 Author: Bjoern A. Zeeb AuthorDate: 2023-05-23 23:07:31 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-05-23 23:18:35 +0000 LinuxKPI: skbuff: add napi_build_skb() and skb_mark_for_recycle() Add more (skeleton) functions used by wireless drivers. MFC after: 10 days --- sys/compat/linuxkpi/common/include/linux/skbuff.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/skbuff.h b/sys/compat/linuxkpi/common/include/linux/skbuff.h index 81b594895dbf..8d4fefdb1a2b 100644 --- a/sys/compat/linuxkpi/common/include/linux/skbuff.h +++ b/sys/compat/linuxkpi/common/include/linux/skbuff.h @@ -1,6 +1,6 @@ /*- * Copyright (c) 2020-2023 The FreeBSD Foundation - * Copyright (c) 2021-2022 Bjoern A. Zeeb + * Copyright (c) 2021-2023 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from * the FreeBSD Foundation. @@ -1046,6 +1046,15 @@ napi_consume_skb(struct sk_buff *skb, int budget) SKB_TODO(); } +static inline struct sk_buff * +napi_build_skb(void *data, size_t len) +{ + + SKB_TRACE(skb); + SKB_TODO(); + return (NULL); +} + static inline uint32_t skb_get_hash(struct sk_buff *skb) { @@ -1054,6 +1063,13 @@ skb_get_hash(struct sk_buff *skb) return (0); } +static inline void +skb_mark_for_recycle(struct sk_buff *skb) +{ + SKB_TRACE(skb); + SKB_TODO(); +} + #define SKB_WITH_OVERHEAD(_s) \ (_s) - ALIGN(sizeof(struct skb_shared_info), CACHE_LINE_SIZE) From nobody Tue May 23 23:24:16 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQr4J60cNz4TBJx; Tue, 23 May 2023 23:24:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQr4J561Tz49Y3; Tue, 23 May 2023 23:24:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684884256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ovyDDyJzYfTIA/FSE0+rQ1C7HCiNeU/jpuAz9RGOPUA=; b=DWTfvn9Gr6ThEk725kpVTG3u5q/OCjlIuYTxZmMz1tE3bsdJEY4eNZmtJ/nARlp5YWKD+R XM6eCQZrZF6wUXQLxIHR9TqZD37KSkDHUZX8hrRfh78LNwNsQQbQL3iQ97g3u5u828SIDP 9E1Lkx9eEvYEXLht4nz/NdUglQVMafp+2TrZe2p9I8butXV/ms7jYKUiv1q3NeW9s1YpiM UCOdzhGrDv+eXEgBBe7ZLxSLHGbRASUUzoapFHBJilYLpXusO/UP5NGDOL1IrzEao6KXM1 0zDwRlS4BviDC8sLzg+5feudfaYbmb/Z8R2adm6QMcaQXvkbdn0FLVWslvOLAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684884256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ovyDDyJzYfTIA/FSE0+rQ1C7HCiNeU/jpuAz9RGOPUA=; b=e2atpYR0hSUbgGvRSegQdjbmNhkLNu6fado8FcRGXoX7RU9c88EarJ6U+Ttm7fLcq/4gd5 uM+UPMNUgdDKdD3c9ozViAgIggVEJrf3BQ58WZEVk23tusYstRUoRAqP/f16fgjS/QCkwy sHm6zJnomG18XAUMIFM7Nb3kczmRTpkhXKm3d9yxItywTby5fotCz+MYQBernZIH/3FXfV TS/gD/B0ZtNJAVkFRp8sd+x956Rc8WO/am6rfue4hRmNFbwwGNDXZqXLGdo1lco00d0kuU 5hNhDpHcKKM0dWh+NYWXntUpuO9v0EwKqo1nRUOB4PrzSd0b5h9fFGnpd+Vyiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684884256; a=rsa-sha256; cv=none; b=Js1nH3E8zQ4Se+s2mcNwr4OXTDce73nHXm937cFrl8uqrLVj1XBnGl2yMLG6303ztRTNWi JD0Qck8BPlNi0QbQK6d/F/j+4VfU0DaGoiAuCxti5lI2orwzaiz6y1wFmNn9HN1UFWpZBa UvNDtwXwlZnDZDKM59PfBXEZXymKwALdAUolkj2FeIWW34iM8hH9TXUn9+eBtEKlrN5AEE m44tStG5ujGkGzc1RAS/g/V4QTD8Om7gJimL62SV0ADqsnoFrEwn1bVMC3BsXe3TKm8nUz gpUjvGSf7W5ita++Cp2R3Mr1TgwYTJZ+/K/xVC5MYHnz90cHpIAH5eQ7zO0hhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQr4J481SzKNs; Tue, 23 May 2023 23:24: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 34NNOGLC006557; Tue, 23 May 2023 23:24:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NNOGoO006556; Tue, 23 May 2023 23:24:16 GMT (envelope-from git) Date: Tue, 23 May 2023 23:24:16 GMT Message-Id: <202305232324.34NNOGoO006556@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 6a1c5037363a - main - LinuxKPI: add thermal.h to dummy files for now List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6a1c5037363aebd14333bb759237d2b19a1608d8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=6a1c5037363aebd14333bb759237d2b19a1608d8 commit 6a1c5037363aebd14333bb759237d2b19a1608d8 Author: Bjoern A. Zeeb AuthorDate: 2023-05-23 23:04:44 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-05-23 23:23:59 +0000 LinuxKPI: add thermal.h to dummy files for now Sponsored by: The FreeBSD Foundation MFC after: 10 days --- sys/compat/linuxkpi/dummy/include/linux/thermal.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/sys/compat/linuxkpi/dummy/include/linux/thermal.h b/sys/compat/linuxkpi/dummy/include/linux/thermal.h new file mode 100644 index 000000000000..e69de29bb2d1 From nobody Tue May 23 23:41:57 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQrSj3j8Tz4TCDj; Tue, 23 May 2023 23:41:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQrSj3Frnz4Cjd; Tue, 23 May 2023 23:41:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684885317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KGT8J0cOso2209ls30OdplK8M0n5fxAblydv6XxWqy4=; b=WoQnhAGyFm609IbkqPErane+SNIILmFU5xNESzQ3OrAp0d3azPRQC4si/SGAbNbCvanlho Urt0kCuPVNHCcOruDn1I2Fqvi6hP0yCqiO81ggcLsyGqaY3V+upCE0WZZzQsteRTxMj+qS 2qyORhYCDKtXFKO3/G6TGLfwFaHxHXaiSZ71NpVYhWF18mcmyFJQoeRtOr97AsEZ+L9paA BFFnr/KHymrdSpDiAjgLq6mTbSx0AAcWsapZX1B7skQNhQbHlg+1hkoMFKHcESGCbpUykJ dRdM+tPeWfBm/jly2L2B1PZc8cjWHZQxYlH+86KQtgidUR5buZucZdvaxBLMEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684885317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KGT8J0cOso2209ls30OdplK8M0n5fxAblydv6XxWqy4=; b=MIRjFmerdGdKY379OGCgdlGusTLCOYPdtSlAR1zcywCY311YLYlEB8+7guUUakCUVXLbog IO8JBLmiZgnz8bCyBvyhYJeM9DgTiXTGS+BSkneXTvHXBMVdrnVgdXGtfe3Os5K6ufldrf SCicv5K00atFYcP/NbU9GLyNz9woz6+Dr6n4x3Kx3J0v/GTF6CaQ6LpHMsshwLshWs+rH2 r8BXhbSckf85S3xDFe6+8rSUwKxlfr+WSndLsgA/mkbWqACptu/7RCYF16CkO4cybEAqPc tsnR8I2UM6oTSVvSY98DzIhY95b8kacy1MsqR7p121892s9ZKJGecaV92jw+yA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684885317; a=rsa-sha256; cv=none; b=tcsa0/N0CpqiY7DQG+3GVuxukTpOEB/+/IIMEFmLUFk7CvkPsktTLDePwV7TEpEFZQ8F84 xLY7koGE12gS7Bz3tu3oy7wqnGx5H4NLa2yYnQJk5WUHAkO58Mscee1P/7bEZKat0u7JLP PUmGwZ0BFrYdJUR2buU8FVcPCnob0pMV1T41w3h9JoSHV0lbN5nLKl4m1fRHebf9YykLu9 Gcgk+2zCrUE4DzvMXw3ZkwoH5rdKWuZnCcV9jeixNz+al+jFRCe9ihMxm2vLxc0CGZdrNg aLFujCuPOqfvmcy26oGLLTYSdGTRfr3lB4I9DRm0PfuPbGEadCTV70qldbQogw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQrSj2KfXzLBW; Tue, 23 May 2023 23:41:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34NNfvjr033848; Tue, 23 May 2023 23:41:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34NNfvbC033832; Tue, 23 May 2023 23:41:57 GMT (envelope-from git) Date: Tue, 23 May 2023 23:41:57 GMT Message-Id: <202305232341.34NNfvbC033832@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 0be82d56b44f - main - fwget: update pci_network_mediatek for mt7996 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0be82d56b44fbe157d4bf1c125eca6625486d17f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=0be82d56b44fbe157d4bf1c125eca6625486d17f commit 0be82d56b44fbe157d4bf1c125eca6625486d17f Author: Bjoern A. Zeeb AuthorDate: 2023-05-23 23:40:05 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-05-23 23:41:24 +0000 fwget: update pci_network_mediatek for mt7996 Add support for another chipset and fix mt7915 to not match on all IDs. --- usr.sbin/fwget/pci/pci_network_mediatek | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/usr.sbin/fwget/pci/pci_network_mediatek b/usr.sbin/fwget/pci/pci_network_mediatek index 5de31e6661eb..5e4d2af9eb26 100644 --- a/usr.sbin/fwget/pci/pci_network_mediatek +++ b/usr.sbin/fwget/pci/pci_network_mediatek @@ -29,13 +29,11 @@ pci_network_mediatek_mt7915() { - # awk '/PCI_DEVICE\(PCI_VENDOR_ID_MEDIATEK,/ { gsub(").*", "", $3); printf "%s)\taddpkg \"wifi-firmware-mt76-kmod\"; return 1 ;;\n", tolower($3) }' *.c + # awk 'BEGIN { x = 0; } { if (/mt7915_pci_device_table/) { x=1 }; if (/^\};/) { x=0 }; if (x==1 && /PCI_DEVICE\(PCI_VENDOR_ID_MEDIATEK,/) { gsub(").*", "", $3); printf "%s)\taddpkg \"wifi-firmware-mt76-kmod\"; return 1 ;;\n", tolower($3) } }' *.c case "$1" in 0x7915) addpkg "wifi-firmware-mt76-kmod"; return 1 ;; 0x7906) addpkg "wifi-firmware-mt76-kmod"; return 1 ;; - 0x7916) addpkg "wifi-firmware-mt76-kmod"; return 1 ;; - 0x790a) addpkg "wifi-firmware-mt76-kmod"; return 1 ;; esac } @@ -43,7 +41,7 @@ pci_network_mediatek_mt7915() pci_network_mediatek_mt7921() { - # awk '/PCI_DEVICE\(PCI_VENDOR_ID_MEDIATEK,/ { gsub(").*", "", $3); printf "%s)\taddpkg \"wifi-firmware-mt76-kmod\"; return 1 ;;\n", tolower($3) }' *.c + # awk 'BEGIN { x = 0; } { if (/mt7921_pci_device_table/) { x=1 }; if (/^\};/) { x=0 }; if (x==1 && /PCI_DEVICE\(PCI_VENDOR_ID_MEDIATEK,/) { gsub(").*", "", $3); printf "%s)\taddpkg \"wifi-firmware-mt76-kmod\"; return 1 ;;\n", tolower($3) } }' *.c case "$1" in 0x7961) addpkg "wifi-firmware-mt76-kmod"; return 1 ;; 0x7922) addpkg "wifi-firmware-mt76-kmod"; return 1 ;; @@ -52,11 +50,20 @@ pci_network_mediatek_mt7921() esac } +# mt7996 +pci_network_mediatek_mt7996() +{ + + # awk 'BEGIN { x = 0; } { if (/mt7996_pci_device_table/) { x=1 }; if (/^\};/) { x=0 }; if (x==1 && /PCI_DEVICE\(PCI_VENDOR_ID_MEDIATEK,/) { gsub(").*", "", $3); printf "%s)\taddpkg \"wifi-firmware-mt76-kmod\"; return 1 ;;\n", tolower($3) } }' *.c + case "$1" in + 0x7990) addpkg "wifi-firmware-mt76-kmod"; return 1 ;; + esac +} pci_network_mediatek() { - for _drv in mt7915 mt7921; do + for _drv in mt7915 mt7921 mt7996; do pci_network_mediatek_${_drv} "$1" case $? in 1) break ;; From nobody Wed May 24 01:17:52 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQtbN61KWz4TJ5q; Wed, 24 May 2023 01:17: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 4QQtbN5fRpz3CQ0; Wed, 24 May 2023 01:17:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684891072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LDgfgpBJ7E77xYpGlDKdixDMBPZGUKSlqf2PtLs+yLc=; b=UmXOkluTmOJdWKjunBvioVyd5NdO5jsptY4gOx8aYMPqbMsSEfRsWhvA1um+5r39AvKvdf w6Y5PD2lxO310uzWDHZtGPhscH3fXSAMP/40FvQYfbqtrZN7CE8Fe4prIAq2pwHXCKbCKu 5yRNoUM2bn+OhCxudfOIwq+qRZRgO0rjHe3BOIc43q45BIxxLpWonnllgPGiw2hbt1wTyz tOG5a8G1vABtes0ouhq0QLY/15JPiWsvBw3BeKHQZtLElcaRg7m40okCTO0/fA7Rb60WXy qXmEvxU76L9riVVg5XcOTyNlzpMJIYFf6FY5vM8XlmooZvkrrFlGoRpgOFWWXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684891072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LDgfgpBJ7E77xYpGlDKdixDMBPZGUKSlqf2PtLs+yLc=; b=USp7+e5yKIicZX2IkSoPnxm64pE1vq29tMqGQxAGQhhbrh6sBnDAXNy2tx3YXZTFXc2YH9 2BfNXGo6KBj0qPiBSdeCZ4RypQ0KmthfR1+51L2XUnqefNlhXVMOmbFdDG6MdAdwhgektT iSvPmakKT3wI8TWFDKiE9Y0aUG/TlrLc8SNUac0WkEFrx+Q2GzfEyxJA+R5hnY6DYUQiXv 1xaT1T9rfjwqLhoJWac6t0bj5vunCfed3K4K7nvP36mGiGceUPePPWDzIAMrWBUcAmTBmp 3pL/3duLki/iyxdp4Q5BIN9GG5a1mJFuG0WL74FLw36FDG6QQ9FtA0XdtpWEaw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684891072; a=rsa-sha256; cv=none; b=qB3olA+g5f3aY+AvKRqkF5GNU7GBfvK4Y+1ZR+y8Na10LLe5srUWX1WRJEl7p+F7txGu3M C/fav+KS91xF7HeNMttE9Re6FuUy8Q3Hf5XYhyiK2g4dFVMerlh/wv9ImM3hTYyrKPYWWv UxxfBHwYeNTaobNCEHNc/wdu5CtZvkSvQCJWCEqZ6+8gIezH7GiRUZ+V6BEHKgmSvnR+Ww uxesLItv760IJGyZgBSNTKV8RI844Djsa9wO2EyDqCy3mAJH3s5ZC6Vhlnmlv2Hs7S2aSj 1yVBTwuSfFfFE3jsCvsxhk5cRjN0jkoxp6bodjSxmqo+X4sDFfr3gfZ5D1+u6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQtbN4hJnzNKP; Wed, 24 May 2023 01:17: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 34O1HqD4087001; Wed, 24 May 2023 01:17:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34O1Hqbf086999; Wed, 24 May 2023 01:17:52 GMT (envelope-from git) Date: Wed, 24 May 2023 01:17:52 GMT Message-Id: <202305240117.34O1Hqbf086999@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: e17eca327633 - main - vmm: Avoid embedding cpuset_t ioctl ABIs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e17eca327633efc511450310afb5e4a662724e3d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e17eca327633efc511450310afb5e4a662724e3d commit e17eca327633efc511450310afb5e4a662724e3d Author: Mark Johnston AuthorDate: 2023-05-24 01:13:33 +0000 Commit: Mark Johnston CommitDate: 2023-05-24 01:15:59 +0000 vmm: Avoid embedding cpuset_t ioctl ABIs Commit 0bda8d3e9f7a ("vmm: permit some IPIs to be handled by userspace") embedded cpuset_t into the vmm(4) ioctl ABI. This was a mistake since we otherwise have some leeway to change the cpuset_t for the whole system, but we want to keep the vmm ioctl ABI stable. Rework IPI reporting to avoid this problem. Along the way, make VM_RUN a bit more efficient: - Split vmexit metadata out of the main VM_RUN structure. This data is only written by the kernel. - Have userspace pass a cpuset_t pointer and cpusetsize in the VM_RUN structure, as is done for cpuset syscalls. - Have the destination CPU mask for VM_EXITCODE_IPIs live outside the vmexit info structure, and make VM_RUN copy it out separately. Zero out any extra bytes in the CPU mask, like cpuset syscalls do. - Modify the vmexit handler prototype to take a full VM_RUN structure. PR: 271330 Reviewed by: corvink, jhb (previous versions) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40113 --- lib/libvmmapi/vmmapi.c | 11 +---- lib/libvmmapi/vmmapi.h | 2 +- sys/amd64/include/vmm.h | 9 +++- sys/amd64/include/vmm_dev.h | 6 ++- sys/amd64/vmm/io/vlapic.c | 4 +- sys/amd64/vmm/vmm.c | 11 +++-- sys/amd64/vmm/vmm_dev.c | 98 ++++++++++++++++++++++++++++++++++++++++++-- usr.sbin/bhyve/bhyverun.c | 91 +++++++++++++++++++++++++--------------- usr.sbin/bhyve/bhyverun.h | 4 +- usr.sbin/bhyve/task_switch.c | 4 +- 10 files changed, 182 insertions(+), 58 deletions(-) diff --git a/lib/libvmmapi/vmmapi.c b/lib/libvmmapi/vmmapi.c index 05b0d1135fd1..25e19c0d9931 100644 --- a/lib/libvmmapi/vmmapi.c +++ b/lib/libvmmapi/vmmapi.c @@ -721,16 +721,9 @@ vm_get_register_set(struct vcpu *vcpu, unsigned int count, } int -vm_run(struct vcpu *vcpu, struct vm_exit *vmexit) +vm_run(struct vcpu *vcpu, struct vm_run *vmrun) { - int error; - struct vm_run vmrun; - - bzero(&vmrun, sizeof(vmrun)); - - error = vcpu_ioctl(vcpu, VM_RUN, &vmrun); - bcopy(&vmrun.vm_exit, vmexit, sizeof(struct vm_exit)); - return (error); + return (vcpu_ioctl(vcpu, VM_RUN, vmrun)); } int diff --git a/lib/libvmmapi/vmmapi.h b/lib/libvmmapi/vmmapi.h index e75f5e471d77..00d48a61fda2 100644 --- a/lib/libvmmapi/vmmapi.h +++ b/lib/libvmmapi/vmmapi.h @@ -155,7 +155,7 @@ int vm_set_register_set(struct vcpu *vcpu, unsigned int count, const int *regnums, uint64_t *regvals); int vm_get_register_set(struct vcpu *vcpu, unsigned int count, const int *regnums, uint64_t *regvals); -int vm_run(struct vcpu *vcpu, struct vm_exit *ret_vmexit); +int vm_run(struct vcpu *vcpu, struct vm_run *vmrun); int vm_suspend(struct vmctx *ctx, enum vm_suspend_how how); int vm_reinit(struct vmctx *ctx); int vm_apicid2vcpu(struct vmctx *ctx, int apicid); diff --git a/sys/amd64/include/vmm.h b/sys/amd64/include/vmm.h index ca7ed25506b0..163fcf669ae0 100644 --- a/sys/amd64/include/vmm.h +++ b/sys/amd64/include/vmm.h @@ -273,7 +273,7 @@ int vm_get_seg_desc(struct vcpu *vcpu, int reg, struct seg_desc *ret_desc); int vm_set_seg_desc(struct vcpu *vcpu, int reg, struct seg_desc *desc); -int vm_run(struct vcpu *vcpu, struct vm_exit *vme_user); +int vm_run(struct vcpu *vcpu); int vm_suspend(struct vm *vm, enum vm_suspend_how how); int vm_inject_nmi(struct vcpu *vcpu); int vm_nmi_pending(struct vcpu *vcpu); @@ -297,6 +297,7 @@ int vm_suspend_cpu(struct vm *vm, struct vcpu *vcpu); int vm_resume_cpu(struct vm *vm, struct vcpu *vcpu); int vm_restart_instruction(struct vcpu *vcpu); struct vm_exit *vm_exitinfo(struct vcpu *vcpu); +cpuset_t *vm_exitinfo_cpuset(struct vcpu *vcpu); void vm_exit_suspended(struct vcpu *vcpu, uint64_t rip); void vm_exit_debug(struct vcpu *vcpu, uint64_t rip); void vm_exit_rendezvous(struct vcpu *vcpu, uint64_t rip); @@ -754,9 +755,13 @@ struct vm_exit { enum vm_suspend_how how; } suspended; struct { + /* + * The destination vCPU mask is saved in vcpu->cpuset + * and is copied out to userspace separately to avoid + * ABI concerns. + */ uint32_t mode; uint8_t vector; - cpuset_t dmask; } ipi; struct vm_task_switch task_switch; } u; diff --git a/sys/amd64/include/vmm_dev.h b/sys/amd64/include/vmm_dev.h index def48a9f86fe..42406b115933 100644 --- a/sys/amd64/include/vmm_dev.h +++ b/sys/amd64/include/vmm_dev.h @@ -89,7 +89,9 @@ struct vm_register_set { struct vm_run { int cpuid; - struct vm_exit vm_exit; + cpuset_t *cpuset; /* CPU set storage */ + size_t cpusetsize; + struct vm_exit *vm_exit; }; struct vm_exception { @@ -349,7 +351,7 @@ enum { }; #define VM_RUN \ - _IOWR('v', IOCNUM_RUN, struct vm_run) + _IOW('v', IOCNUM_RUN, struct vm_run) #define VM_SUSPEND \ _IOW('v', IOCNUM_SUSPEND, struct vm_suspend) #define VM_REINIT \ diff --git a/sys/amd64/vmm/io/vlapic.c b/sys/amd64/vmm/io/vlapic.c index 45a70e494e62..d36a7738278e 100644 --- a/sys/amd64/vmm/io/vlapic.c +++ b/sys/amd64/vmm/io/vlapic.c @@ -1146,7 +1146,7 @@ vlapic_icrlo_write_handler(struct vlapic *vlapic, bool *retu) vmexit->exitcode = VM_EXITCODE_IPI; vmexit->u.ipi.mode = mode; vmexit->u.ipi.vector = vec; - vmexit->u.ipi.dmask = ipimask; + *vm_exitinfo_cpuset(vlapic->vcpu) = ipimask; *retu = true; } @@ -1166,7 +1166,7 @@ int vm_handle_ipi(struct vcpu *vcpu, struct vm_exit *vme, bool *retu) { struct vlapic *vlapic = vm_lapic(vcpu); - cpuset_t *dmask = &vme->u.ipi.dmask; + cpuset_t *dmask = vm_exitinfo_cpuset(vcpu); uint8_t vec = vme->u.ipi.vector; *retu = true; diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index 81d5212ec744..0f29a6845f9e 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -123,6 +123,7 @@ struct vcpu { uint64_t guest_xcr0; /* (i) guest %xcr0 register */ void *stats; /* (a,i) statistics */ struct vm_exit exitinfo; /* (x) exit reason and collateral */ + cpuset_t exitinfo_cpuset; /* (x) storage for vmexit handlers */ uint64_t nextrip; /* (x) next instruction to execute */ uint64_t tsc_offset; /* (o) TSC offsetting */ }; @@ -399,6 +400,12 @@ vm_exitinfo(struct vcpu *vcpu) return (&vcpu->exitinfo); } +cpuset_t * +vm_exitinfo_cpuset(struct vcpu *vcpu) +{ + return (&vcpu->exitinfo_cpuset); +} + static int vmm_init(void) { @@ -1837,7 +1844,7 @@ vm_exit_astpending(struct vcpu *vcpu, uint64_t rip) } int -vm_run(struct vcpu *vcpu, struct vm_exit *vme_user) +vm_run(struct vcpu *vcpu) { struct vm *vm = vcpu->vm; struct vm_eventinfo evinfo; @@ -1938,8 +1945,6 @@ restart: vmm_stat_incr(vcpu, VMEXIT_USERSPACE, 1); VMM_CTR2(vcpu, "retu %d/%d", error, vme->exitcode); - /* copy the exit information */ - *vme_user = *vme; return (error); } diff --git a/sys/amd64/vmm/vmm_dev.c b/sys/amd64/vmm/vmm_dev.c index 85b5bac9efe1..f9fcb32d8e28 100644 --- a/sys/amd64/vmm/vmm_dev.c +++ b/sys/amd64/vmm/vmm_dev.c @@ -93,7 +93,29 @@ struct vm_snapshot_meta_old { #define VM_SNAPSHOT_REQ_OLD \ _IOWR('v', IOCNUM_SNAPSHOT_REQ, struct vm_snapshot_meta_old) -#endif + +struct vm_exit_ipi_13 { + uint32_t mode; + uint8_t vector; + __BITSET_DEFINE(, 256) dmask; +}; + +struct vm_exit_13 { + uint32_t exitcode; + int32_t inst_length; + uint64_t rip; + uint64_t u[120 / sizeof(uint64_t)]; +}; + +struct vm_run_13 { + int cpuid; + struct vm_exit_13 vm_exit; +}; + +#define VM_RUN_13 \ + _IOWR('v', IOCNUM_RUN, struct vm_run_13) + +#endif /* COMPAT_FREEBSD13 */ struct devmem_softc { int segid; @@ -396,6 +418,9 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag, struct vm_seg_desc *vmsegdesc; struct vm_register_set *vmregset; struct vm_run *vmrun; +#ifdef COMPAT_FREEBSD13 + struct vm_run_13 *vmrun_13; +#endif struct vm_exception *vmexc; struct vm_lapic_irq *vmirq; struct vm_lapic_msi *vmmsi; @@ -459,6 +484,9 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag, */ switch (cmd) { case VM_RUN: +#ifdef COMPAT_FREEBSD13 + case VM_RUN_13: +#endif case VM_GET_REGISTER: case VM_SET_REGISTER: case VM_GET_SEGMENT_DESCRIPTOR: @@ -579,11 +607,73 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag, break; } - switch(cmd) { - case VM_RUN: + switch (cmd) { + case VM_RUN: { + struct vm_exit *vme; + vmrun = (struct vm_run *)data; - error = vm_run(vcpu, &vmrun->vm_exit); + vme = vm_exitinfo(vcpu); + + error = vm_run(vcpu); + if (error != 0) + break; + + error = copyout(vme, vmrun->vm_exit, sizeof(*vme)); + if (error != 0) + break; + if (vme->exitcode == VM_EXITCODE_IPI) { + error = copyout(vm_exitinfo_cpuset(vcpu), + vmrun->cpuset, + min(vmrun->cpusetsize, sizeof(cpuset_t))); + if (error != 0) + break; + if (sizeof(cpuset_t) < vmrun->cpusetsize) { + uint8_t *p; + + p = (uint8_t *)vmrun->cpuset + + sizeof(cpuset_t); + while (error == 0 && + p < (uint8_t *)vmrun->cpuset + + vmrun->cpusetsize) { + error = subyte(p++, 0); + } + } + } break; + } +#ifdef COMPAT_FREEBSD13 + case VM_RUN_13: { + struct vm_exit *vme; + struct vm_exit_13 *vme_13; + + vmrun_13 = (struct vm_run_13 *)data; + vme_13 = &vmrun_13->vm_exit; + vme = vm_exitinfo(vcpu); + + error = vm_run(vcpu); + if (error == 0) { + vme_13->exitcode = vme->exitcode; + vme_13->inst_length = vme->inst_length; + vme_13->rip = vme->rip; + memcpy(vme_13->u, &vme->u, sizeof(vme_13->u)); + if (vme->exitcode == VM_EXITCODE_IPI) { + struct vm_exit_ipi_13 *ipi; + cpuset_t *dmask; + int cpu; + + dmask = vm_exitinfo_cpuset(vcpu); + ipi = (struct vm_exit_ipi_13 *)&vme_13->u[0]; + BIT_ZERO(256, &ipi->dmask); + CPU_FOREACH_ISSET(cpu, dmask) { + if (cpu >= 256) + break; + BIT_SET(256, cpu, &ipi->dmask); + } + } + } + break; + } +#endif case VM_SUSPEND: vmsuspend = (struct vm_suspend *)data; error = vm_suspend(sc->vm, vmsuspend->how); diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index 25d8937138e6..7be97ecedfdc 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -184,7 +184,7 @@ static const char * const vmx_exit_reason_desc[] = { [EXIT_REASON_XRSTORS] = "XRSTORS" }; -typedef int (*vmexit_handler_t)(struct vmctx *, struct vcpu *, struct vm_exit *); +typedef int (*vmexit_handler_t)(struct vmctx *, struct vcpu *, struct vm_run *); int guest_ncpus; uint16_t cpu_cores, cpu_sockets, cpu_threads; @@ -592,11 +592,13 @@ vmexit_handle_notify(struct vmctx *ctx __unused, struct vcpu *vcpu __unused, } static int -vmexit_inout(struct vmctx *ctx, struct vcpu *vcpu, struct vm_exit *vme) +vmexit_inout(struct vmctx *ctx, struct vcpu *vcpu, struct vm_run *vmrun) { + struct vm_exit *vme; int error; int bytes, port, in, out; + vme = vmrun->vm_exit; port = vme->u.inout.port; bytes = vme->u.inout.bytes; in = vme->u.inout.in; @@ -621,12 +623,16 @@ vmexit_inout(struct vmctx *ctx, struct vcpu *vcpu, struct vm_exit *vme) } static int -vmexit_rdmsr(struct vmctx *ctx __unused, struct vcpu *vcpu, struct vm_exit *vme) +vmexit_rdmsr(struct vmctx *ctx __unused, struct vcpu *vcpu, + struct vm_run *vmrun) { + struct vm_exit *vme; uint64_t val; uint32_t eax, edx; int error; + vme = vmrun->vm_exit; + val = 0; error = emulate_rdmsr(vcpu, vme->u.msr.code, &val); if (error != 0) { @@ -650,10 +656,14 @@ vmexit_rdmsr(struct vmctx *ctx __unused, struct vcpu *vcpu, struct vm_exit *vme) } static int -vmexit_wrmsr(struct vmctx *ctx __unused, struct vcpu *vcpu, struct vm_exit *vme) +vmexit_wrmsr(struct vmctx *ctx __unused, struct vcpu *vcpu, + struct vm_run *vmrun) { + struct vm_exit *vme; int error; + vme = vmrun->vm_exit; + error = emulate_wrmsr(vcpu, vme->u.msr.code, vme->u.msr.wval); if (error != 0) { fprintf(stderr, "wrmsr to register %#x(%#lx) on vcpu %d\n", @@ -685,8 +695,11 @@ vmexit_vmx_desc(uint32_t exit_reason) } static int -vmexit_vmx(struct vmctx *ctx, struct vcpu *vcpu, struct vm_exit *vme) +vmexit_vmx(struct vmctx *ctx, struct vcpu *vcpu, struct vm_run *vmrun) { + struct vm_exit *vme; + + vme = vmrun->vm_exit; fprintf(stderr, "vm exit[%d]\n", vcpu_id(vcpu)); fprintf(stderr, "\treason\t\tVMX\n"); @@ -718,8 +731,11 @@ vmexit_vmx(struct vmctx *ctx, struct vcpu *vcpu, struct vm_exit *vme) } static int -vmexit_svm(struct vmctx *ctx __unused, struct vcpu *vcpu, struct vm_exit *vme) +vmexit_svm(struct vmctx *ctx __unused, struct vcpu *vcpu, struct vm_run *vmrun) { + struct vm_exit *vme; + + vme = vmrun->vm_exit; fprintf(stderr, "vm exit[%d]\n", vcpu_id(vcpu)); fprintf(stderr, "\treason\t\tSVM\n"); @@ -733,10 +749,9 @@ vmexit_svm(struct vmctx *ctx __unused, struct vcpu *vcpu, struct vm_exit *vme) static int vmexit_bogus(struct vmctx *ctx __unused, struct vcpu *vcpu __unused, - struct vm_exit *vme) + struct vm_run *vmrun) { - - assert(vme->inst_length == 0); + assert(vmrun->vm_exit->inst_length == 0); stats.vmexit_bogus++; @@ -745,10 +760,9 @@ vmexit_bogus(struct vmctx *ctx __unused, struct vcpu *vcpu __unused, static int vmexit_reqidle(struct vmctx *ctx __unused, struct vcpu *vcpu __unused, - struct vm_exit *vme) + struct vm_run *vmrun) { - - assert(vme->inst_length == 0); + assert(vmrun->vm_exit->inst_length == 0); stats.vmexit_reqidle++; @@ -757,9 +771,8 @@ vmexit_reqidle(struct vmctx *ctx __unused, struct vcpu *vcpu __unused, static int vmexit_hlt(struct vmctx *ctx __unused, struct vcpu *vcpu __unused, - struct vm_exit *vme __unused) + struct vm_run *vmrun __unused) { - stats.vmexit_hlt++; /* @@ -772,9 +785,8 @@ vmexit_hlt(struct vmctx *ctx __unused, struct vcpu *vcpu __unused, static int vmexit_pause(struct vmctx *ctx __unused, struct vcpu *vcpu __unused, - struct vm_exit *vme __unused) + struct vm_run *vmrun __unused) { - stats.vmexit_pause++; return (VMEXIT_CONTINUE); @@ -782,10 +794,9 @@ vmexit_pause(struct vmctx *ctx __unused, struct vcpu *vcpu __unused, static int vmexit_mtrap(struct vmctx *ctx __unused, struct vcpu *vcpu, - struct vm_exit *vme) + struct vm_run *vmrun) { - - assert(vme->inst_length == 0); + assert(vmrun->vm_exit->inst_length == 0); stats.vmexit_mtrap++; @@ -802,12 +813,15 @@ vmexit_mtrap(struct vmctx *ctx __unused, struct vcpu *vcpu, static int vmexit_inst_emul(struct vmctx *ctx __unused, struct vcpu *vcpu, - struct vm_exit *vme) + struct vm_run *vmrun) { - int err, i, cs_d; + struct vm_exit *vme; struct vie *vie; + int err, i, cs_d; enum vm_cpu_mode mode; + vme = vmrun->vm_exit; + stats.vmexit_inst_emul++; vie = &vme->u.inst_emul.vie; @@ -852,11 +866,14 @@ static pthread_mutex_t resetcpu_mtx = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t resetcpu_cond = PTHREAD_COND_INITIALIZER; static int -vmexit_suspend(struct vmctx *ctx, struct vcpu *vcpu, struct vm_exit *vme) +vmexit_suspend(struct vmctx *ctx, struct vcpu *vcpu, struct vm_run *vmrun) { + struct vm_exit *vme; enum vm_suspend_how how; int vcpuid = vcpu_id(vcpu); + vme = vmrun->vm_exit; + how = vme->u.suspended.how; fbsdrun_deletecpu(vcpuid); @@ -894,7 +911,7 @@ vmexit_suspend(struct vmctx *ctx, struct vcpu *vcpu, struct vm_exit *vme) static int vmexit_debug(struct vmctx *ctx __unused, struct vcpu *vcpu, - struct vm_exit *vme __unused) + struct vm_run *vmrun __unused) { #ifdef BHYVE_SNAPSHOT @@ -914,22 +931,27 @@ vmexit_debug(struct vmctx *ctx __unused, struct vcpu *vcpu, static int vmexit_breakpoint(struct vmctx *ctx __unused, struct vcpu *vcpu, - struct vm_exit *vme) + struct vm_run *vmrun) { - - gdb_cpu_breakpoint(vcpu, vme); + gdb_cpu_breakpoint(vcpu, vmrun->vm_exit); return (VMEXIT_CONTINUE); } static int vmexit_ipi(struct vmctx *ctx __unused, struct vcpu *vcpu __unused, - struct vm_exit *vme) + struct vm_run *vmrun) { + struct vm_exit *vme; + cpuset_t *dmask; int error = -1; int i; + + dmask = vmrun->cpuset; + vme = vmrun->vm_exit; + switch (vme->u.ipi.mode) { case APIC_DELMODE_INIT: - CPU_FOREACH_ISSET(i, &vme->u.ipi.dmask) { + CPU_FOREACH_ISSET(i, dmask) { error = vm_suspend_cpu(vcpu_info[i].vcpu); if (error) { warnx("%s: failed to suspend cpu %d\n", @@ -939,7 +961,7 @@ vmexit_ipi(struct vmctx *ctx __unused, struct vcpu *vcpu __unused, } break; case APIC_DELMODE_STARTUP: - CPU_FOREACH_ISSET(i, &vme->u.ipi.dmask) { + CPU_FOREACH_ISSET(i, dmask) { spinup_ap(vcpu_info[i].vcpu, vme->u.ipi.vector << PAGE_SHIFT); } @@ -974,15 +996,20 @@ static void vm_loop(struct vmctx *ctx, struct vcpu *vcpu) { struct vm_exit vme; + struct vm_run vmrun; int error, rc; enum vm_exitcode exitcode; - cpuset_t active_cpus; + cpuset_t active_cpus, dmask; error = vm_active_cpus(ctx, &active_cpus); assert(CPU_ISSET(vcpu_id(vcpu), &active_cpus)); + vmrun.vm_exit = &vme; + vmrun.cpuset = &dmask; + vmrun.cpusetsize = sizeof(dmask); + while (1) { - error = vm_run(vcpu, &vme); + error = vm_run(vcpu, &vmrun); if (error != 0) break; @@ -993,7 +1020,7 @@ vm_loop(struct vmctx *ctx, struct vcpu *vcpu) exit(4); } - rc = (*handler[exitcode])(ctx, vcpu, &vme); + rc = (*handler[exitcode])(ctx, vcpu, &vmrun); switch (rc) { case VMEXIT_CONTINUE: diff --git a/usr.sbin/bhyve/bhyverun.h b/usr.sbin/bhyve/bhyverun.h index f45b97e779c8..47f9d5071044 100644 --- a/usr.sbin/bhyve/bhyverun.h +++ b/usr.sbin/bhyve/bhyverun.h @@ -39,7 +39,7 @@ extern uint16_t cpu_cores, cpu_sockets, cpu_threads; struct vcpu; struct vmctx; -struct vm_exit; +struct vm_run; void *paddr_guest2host(struct vmctx *ctx, uintptr_t addr, size_t len); #ifdef BHYVE_SNAPSHOT @@ -48,6 +48,6 @@ uintptr_t paddr_host2guest(struct vmctx *ctx, void *addr); int fbsdrun_virtio_msix(void); -int vmexit_task_switch(struct vmctx *, struct vcpu *, struct vm_exit *); +int vmexit_task_switch(struct vmctx *, struct vcpu *, struct vm_run *); #endif diff --git a/usr.sbin/bhyve/task_switch.c b/usr.sbin/bhyve/task_switch.c index cf4c2356e155..17b311d8f211 100644 --- a/usr.sbin/bhyve/task_switch.c +++ b/usr.sbin/bhyve/task_switch.c @@ -704,7 +704,7 @@ push_errcode(struct vcpu *vcpu, struct vm_guest_paging *paging, } while (0) int -vmexit_task_switch(struct vmctx *ctx, struct vcpu *vcpu, struct vm_exit *vmexit) +vmexit_task_switch(struct vmctx *ctx, struct vcpu *vcpu, struct vm_run *vmrun) { struct seg_desc nt; struct tss32 oldtss, newtss; @@ -712,12 +712,14 @@ vmexit_task_switch(struct vmctx *ctx, struct vcpu *vcpu, struct vm_exit *vmexit) struct vm_guest_paging *paging, sup_paging; struct user_segment_descriptor nt_desc, ot_desc; struct iovec nt_iov[2], ot_iov[2]; + struct vm_exit *vmexit; uint64_t cr0, ot_base; uint32_t eip, ot_lim, access; int error, ext, fault, minlimit, nt_type, ot_type; enum task_switch_reason reason; uint16_t nt_sel, ot_sel; + vmexit = vmrun->vm_exit; task_switch = &vmexit->u.task_switch; nt_sel = task_switch->tsssel; ext = vmexit->u.task_switch.ext; From nobody Wed May 24 01:17:53 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QQtbQ0v2sz4TJ8N; Wed, 24 May 2023 01:17:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QQtbP73mBz3C8H; Wed, 24 May 2023 01:17:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684891074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OpdrJj7Laasehq1tNv/Dq0px+N6ZzkZszFfSqdwiynE=; b=GaZPWH4GM/w2qJzitpLfVpK0nsaExw05PG4d6JycWV0l547h5gE3limApZWu+LRjv6oWPy r2OiG2vwECG43DEXTuJTVKNt34yoV4YrRjUon1lkF7ZaMAV4nZZknQU19uO1/zjjUkDuHX RsAUiv4jDolVkSVrF5HWZYq7v9NnNT6SavdVVd2uc6MsDbaY9n2mFHd3rWKT5ysPZ53HkK 70DxRw/btkmgBz0SVoUU0OljG7Jduifnt5AOfo2sP89iqbwW7td6khmaBq0bYzMtbawc/f myA1dzHu0MUGZEO1RER+OZgkZtKhTCg+VH1o3pFlvZTFE2HK96tixToozgA1PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684891074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OpdrJj7Laasehq1tNv/Dq0px+N6ZzkZszFfSqdwiynE=; b=veQth2mqZK8z79iF7wGFfMVYgur+a1YGKsTC7QvcuZbFjM8ko8pmSiIdiMskO5hAzOr1+Q FNxYEJIot05O4cgEQtfh5nTQoirbLTP3r0jQRqheT6+WhWrs96wu55ZvzAVEFwvPn5/T/U m6RSGvgP2WnJk6iQX4U6EWNfZq5nLxFIQJ1KbCx5HVm15mVsjbjsSuJacgBEDZPP5VcgZD 6y8kr2A01b3WYpN3js/nAjsIzblKlKPmrv7zmH9PXf2Ta/QgKQ6y3y6qYLzr4jxcOYH+Xu JfRgyxHZDMyAsrL0LtiQrPZcnHaCiHHvOMQw5mZkld1gErwKgADWTO1kQRaJLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684891074; a=rsa-sha256; cv=none; b=LP02nH59Y4h3JmnYgrnsm9mlUDT/rWJl8FDetcSRvNunJSCb00RgxtJKLflKf9YHAcA6qz 0nfI6MiumQgsL5xvNJQf7wgCBlQDcytqLxviiKBKzevykUTpDnmScgnwwB8jHQTmneyQrg AFA9bv7JfnLNFpUE73oY3otTnU4Yw6p+cxe1aObVqXU/Q/jWXB+nX2wELsV351bWueTU/f wpORvrdgHSkusO8KuyETysodgrAX5loaqa2t2CHyhGPT2MJ1WYrTpVTOcM6smgRMANLCke J8T9CdruqUHKSQn8LApJGriPbRVaUaXmeE/rl7K9rzqUAwhzh6CDxSV0dv1Z8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QQtbP5XWHzMv4; Wed, 24 May 2023 01:17: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 34O1Hrk0087021; Wed, 24 May 2023 01:17:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34O1Hr99087020; Wed, 24 May 2023 01:17:53 GMT (envelope-from git) Date: Wed, 24 May 2023 01:17:53 GMT Message-Id: <202305240117.34O1Hr99087020@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 80764cdb73f5 - main - bhyve: Remove the exitcode stats structure List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 80764cdb73f5476b695afc1bbabc3eccf55a26c5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=80764cdb73f5476b695afc1bbabc3eccf55a26c5 commit 80764cdb73f5476b695afc1bbabc3eccf55a26c5 Author: Mark Johnston AuthorDate: 2023-05-24 01:14:36 +0000 Commit: Mark Johnston CommitDate: 2023-05-24 01:17:02 +0000 bhyve: Remove the exitcode stats structure This structure isn't used for anything, and only counts a subset of vmexit types. Moreover, it is not accurate since there is no synchronization between vcpu threads. Simply remove it. No functional change intended. Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40245 --- usr.sbin/bhyve/bhyverun.c | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index 7be97ecedfdc..ef5968ba6385 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -198,17 +198,6 @@ static cpuset_t cpumask; static void vm_loop(struct vmctx *ctx, struct vcpu *vcpu); -static struct bhyvestats { - uint64_t vmexit_bogus; - uint64_t vmexit_reqidle; - uint64_t vmexit_hlt; - uint64_t vmexit_pause; - uint64_t vmexit_mtrap; - uint64_t vmexit_inst_emul; - uint64_t cpu_switch_rotate; - uint64_t cpu_switch_direct; -} stats; - static struct vcpu_info { struct vmctx *ctx; struct vcpu *vcpu; @@ -753,8 +742,6 @@ vmexit_bogus(struct vmctx *ctx __unused, struct vcpu *vcpu __unused, { assert(vmrun->vm_exit->inst_length == 0); - stats.vmexit_bogus++; - return (VMEXIT_CONTINUE); } @@ -764,8 +751,6 @@ vmexit_reqidle(struct vmctx *ctx __unused, struct vcpu *vcpu __unused, { assert(vmrun->vm_exit->inst_length == 0); - stats.vmexit_reqidle++; - return (VMEXIT_CONTINUE); } @@ -773,8 +758,6 @@ static int vmexit_hlt(struct vmctx *ctx __unused, struct vcpu *vcpu __unused, struct vm_run *vmrun __unused) { - stats.vmexit_hlt++; - /* * Just continue execution with the next instruction. We use * the HLT VM exit as a way to be friendly with the host @@ -787,8 +770,6 @@ static int vmexit_pause(struct vmctx *ctx __unused, struct vcpu *vcpu __unused, struct vm_run *vmrun __unused) { - stats.vmexit_pause++; - return (VMEXIT_CONTINUE); } @@ -798,8 +779,6 @@ vmexit_mtrap(struct vmctx *ctx __unused, struct vcpu *vcpu, { assert(vmrun->vm_exit->inst_length == 0); - stats.vmexit_mtrap++; - #ifdef BHYVE_SNAPSHOT checkpoint_cpu_suspend(vcpu_id(vcpu)); #endif @@ -822,8 +801,6 @@ vmexit_inst_emul(struct vmctx *ctx __unused, struct vcpu *vcpu, vme = vmrun->vm_exit; - stats.vmexit_inst_emul++; - vie = &vme->u.inst_emul.vie; if (!vie->decoded) { /* From nobody Wed May 24 08:13:57 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QR3qW3Xrkz4CPMr; Wed, 24 May 2023 08:13:59 +0000 (UTC) (envelope-from madpilot@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 4QR3qW2Jpsz41X1; Wed, 24 May 2023 08:13:59 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684916039; h=from:from:reply-to:subject: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=Xcrtw402S8TlbFaVPVw9XqzcOIrdahH99bPGIpsF07c=; b=N4L7xejILFIrjBHPNfj+e4qD9QgUpvOqwDxiDFda0krnCBEJ8/So+z3NPo/z0+NkEgXjE9 aMTAfjgjc0shk0rnNjKr6pR4Jv/sG7+9eIl3CWKVIOepTTLWp5WaGwkU2mzg05eSipfBbt KVg5S9bpVvWX34EYMGG/JlDRXB/GEIS7kxDOsjGUAuRdqGBMf16k6os0qC4MMm86bzcFXP LFTLG/56EUkWVMFCmWZswGdfJ5YQtG3PnU6Z6Vh8hUWppoS5NWSXs0dMnze0sPe/KIk1A9 apRZS5o8owZ/UMqrXFOJW7Ov505o1A4x+0LqqaMnfAghZwlwe5rkQhccbBA8JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684916039; h=from:from:reply-to:subject: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=Xcrtw402S8TlbFaVPVw9XqzcOIrdahH99bPGIpsF07c=; b=EsaS1adnKTJJ4xr2jG7RwIeDwiMxJnRmM6pXMysRXOcw1B05yITh/xh9Y6qqsjvagHo8aV SWExGpoV/VKyhljpd0ZmWjiU9pKKDod4jcqCTHrX85nU7d17y20v09i/HlDyy/aNNgVwCf o+1zvDEBwVlzA8xZtP2ZJcQwqPUja88cyy3Im7rv0wBx4VmcgijtBGVrIyMiIFikGWNWG0 fwxHmdLz3vsKMlF+JoTWiJwV+RK2UuRHTekC/LtaaFAy3iWzlrKcwHBQSxA16wdMZSoflZ EV9iPtainSip3cI+b6zLPJVeK5dUu1uFd75YUvbOWa+CE318yAPGKwWWFCI1hA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684916039; a=rsa-sha256; cv=none; b=sELHGdM6K/4xNHFVz/kkVCUyfb9HKCRnStsN33wWwZjDy6HULqj6YPTOtLcWx3369cx0LW sZSFv4c8baLZwq3qX0n7San8SR14jcY7kEjuxWXAMbT5b6TZ47Tgy9pPGD8NS6H7Bp6c0L 5RNdaUJJVn1Jsmc8Mpft8r/IaoW1PJ1f/lEPg5VZr72WlxT6EFzb2yGWZDCsPSJ2TAeZpW 733zW0YkvvGs8eI+hPp/hI8+GpETxlJ5PI39BFXIf4ZFyp/l3c7p/aEVkoN6hhpqZyiZH8 a6Y0ZR3M1hSQYQFZ3tcdySjnO+OxVVHdLk+5FhHh19MuYq2+RTSJo06BypssWg== Received: from [IPV6:2a01:e11:2002:4280::13:1] (unknown [IPv6:2a01:e11:2002:4280::13:1]) (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: madpilot/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4QR3qV40PtzwvS; Wed, 24 May 2023 08:13:58 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Message-ID: Date: Wed, 24 May 2023 10:13:57 +0200 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: git: e17eca327633 - main - vmm: Avoid embedding cpuset_t ioctl ABIs To: Mark Johnston , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202305240117.34O1Hqbf086999@gitrepo.freebsd.org> Content-Language: en-US From: Guido Falsi In-Reply-To: <202305240117.34O1Hqbf086999@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 24/05/23 03:17, Mark Johnston wrote: > The branch main has been updated by markj: > > URL: https://cgit.FreeBSD.org/src/commit/?id=e17eca327633efc511450310afb5e4a662724e3d > > commit e17eca327633efc511450310afb5e4a662724e3d > Author: Mark Johnston > AuthorDate: 2023-05-24 01:13:33 +0000 > Commit: Mark Johnston > CommitDate: 2023-05-24 01:15:59 +0000 > > vmm: Avoid embedding cpuset_t ioctl ABIs > > Commit 0bda8d3e9f7a ("vmm: permit some IPIs to be handled by userspace") > embedded cpuset_t into the vmm(4) ioctl ABI. This was a mistake since > we otherwise have some leeway to change the cpuset_t for the whole > system, but we want to keep the vmm ioctl ABI stable. > > Rework IPI reporting to avoid this problem. Along the way, make VM_RUN > a bit more efficient: > - Split vmexit metadata out of the main VM_RUN structure. This data is > only written by the kernel. > - Have userspace pass a cpuset_t pointer and cpusetsize in the VM_RUN > structure, as is done for cpuset syscalls. > - Have the destination CPU mask for VM_EXITCODE_IPIs live outside the > vmexit info structure, and make VM_RUN copy it out separately. Zero > out any extra bytes in the CPU mask, like cpuset syscalls do. > - Modify the vmexit handler prototype to take a full VM_RUN structure. > > PR: 271330 > Reviewed by: corvink, jhb (previous versions) > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D40113 Looks like this is breaking world build: /poudriere/jails/14amd64/usr/src/usr.sbin/bhyvectl/bhyvectl.c:2389:24: error: incompatible pointer types passing 'struct vm_exit *' to paramet er of type 'struct vm_run *' [-Werror,-Wincompatible-pointer-types] error = vm_run(vcpu, &vmexit); ^~~~~~~ /usr/obj/poudriere/jails/14amd64/usr/src/amd64.amd64/tmp/usr/include/vmmapi.h:158:46: note: passing argument to parameter 'vmrun' here int vm_run(struct vcpu *vcpu, struct vm_run *vmrun); ^ 1 error generated. *** [bhyvectl.o] Error code 1 make[4]: stopped in /poudriere/jails/14amd64/usr/src/usr.sbin/bhyvectl Looks like required adaptations to bhyvectl.c where left out. -- Guido Falsi From nobody Wed May 24 08:34:47 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QR4HW5cbGz4CQp5; Wed, 24 May 2023 08:34: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 4QR4HW59Zyz43QT; Wed, 24 May 2023 08:34:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684917287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GSRSyCPTgVxafFrwL3sQEGZKoFPzbLUjEJAGfj3kvPw=; b=KB/VHTtCZ7MtDAqZmwhsdozoTdzDLtPY8oPpRZRfzeIkxcaNY7yetTt26k97LT93sAk7qc SBnMW46vW0oLqDb3g16BiT/ykAPr2n2JrdqA2DEUEvB51wwiqcDfcHWUbe8JDEWBwBKaRZ SW8y1e3wwcSmm+1wvLUHGi5ZMVLziqXS2uxjIXWkVs28Zuhfe8gC5MbLGbeMvKwTd97AFd 3rJZJ7X28nyQVc2crXXBnjuQv6JFcu7mUBHsiTwQkGOZXtrDbJ56MpZypmH4QLl5M6pIUk hiL9vHXBCPoSEEqf9NURvKbOUgAK7ApHK95uKGCUpVR+xuJJqsWRh6gKYbBR5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684917287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GSRSyCPTgVxafFrwL3sQEGZKoFPzbLUjEJAGfj3kvPw=; b=ji3EA3dhFT9fGnAs8IjjjboSTt9rYuQt3siKm8lJQIcKWj4W3C+t35HgG6F/7Gn8TUgkFQ 2WhA8S7wlFebPdLh/PwJMpcLdVm73b36FFbhJC5wud/hxqFCSWb5OXpzWX3vGXGu1AWm6o zx81TBbVXVpmkWHJF184qvR/T4qZdyEWPIvneJhf1P1j7HqxK/M3eXPndJZK6lGcys+/ej FXtU14B5Gf4UFp1X46YPccAbyDyanzVmB07IYZ3cYFzbbZhhmjhCDlchrg8b7Eg9QLqnBL FSjZsljzM7kRdCe39YIlHhS5uJ9SLM82IEamh2dEDymaX/a1ixFmzeNVv8DDRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684917287; a=rsa-sha256; cv=none; b=qyPvsl/72BFu2EulpguGbeN8lEeco32FmL2BuVI0xj7uDEIeynFbsLhmMpFstHfjwQnZpU euq+l5qsvyqI/fNWIZTy++2DvVqCJUY0PunDbGy9801mKxpBqgyfPGmhEPpGp1+EkJM/RP NMDbIhqdYAZDpImIvZ6WO1GCvU+kMMhhGgPPMi1r2iyHuWYudoArqb9VJb2rqVh+pkKtdG 30KpKGeq16/2Sq2PpHl+j/mvNq10y0j9/Rdb9DbW4ppuQpMETqMGbc26nB0AF9+AMeAXSd BX2okZ1WQ08DIN0+Ql0gSMsuLIy6tDYXLrktCyRfzU8QInzq/e4aNwZNiqSCZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QR4HW4FYWzbpt; Wed, 24 May 2023 08:34: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 34O8Ylm6011304; Wed, 24 May 2023 08:34:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34O8YlTS011303; Wed, 24 May 2023 08:34:47 GMT (envelope-from git) Date: Wed, 24 May 2023 08:34:47 GMT Message-Id: <202305240834.34O8YlTS011303@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: c1b6e9121e88 - main - LinuxKPI: uuid: add guid_gen() and guid_copy() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c1b6e9121e889608b86530d1a37047797dfeb460 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c1b6e9121e889608b86530d1a37047797dfeb460 commit c1b6e9121e889608b86530d1a37047797dfeb460 Author: Bjoern A. Zeeb AuthorDate: 2023-05-23 23:15:12 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-05-24 08:34:28 +0000 LinuxKPI: uuid: add guid_gen() and guid_copy() Add function used by a wireless driver. Sponsored by: The FreeBSD Foundation MFC after: 10 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D40249 --- sys/compat/linuxkpi/common/include/linux/uuid.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/uuid.h b/sys/compat/linuxkpi/common/include/linux/uuid.h index 31a018497f78..63b77dd7d0bc 100644 --- a/sys/compat/linuxkpi/common/include/linux/uuid.h +++ b/sys/compat/linuxkpi/common/include/linux/uuid.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2021 The FreeBSD Foundation + * Copyright (c) 2021,2023 The FreeBSD Foundation * * This software was developed by Björn Zeeb under sponsorship from * the FreeBSD Foundation. @@ -33,6 +33,8 @@ #ifndef _LINUXKPI_LINUX_UUID_H #define _LINUXKPI_LINUX_UUID_H +#include + #define UUID_STRING_LEN 36 #define GUID_INIT(x0_3, x4_5, x6_7, x8, x9, x10, x11, x12, x13, x14, x15) \ @@ -59,4 +61,19 @@ typedef struct { char x[16]; } guid_t; +static inline void +guid_gen(guid_t *g) +{ + + get_random_bytes(g, 16); + g->x[7] = (g->x[7] & 0x0f) | 0x40; + g->x[8] = (g->x[8] & 0x3f) | 0x80; +} + +static inline void +guid_copy(guid_t *dst, const guid_t *src) +{ + memcpy(dst, src, sizeof(*dst)); +} + #endif /* _LINUXKPI_LINUX_UUID_H */ From nobody Wed May 24 08:50:27 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QR4dc0k0mz4CRQR; Wed, 24 May 2023 08:50: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 4QR4db73Ywz45bb; Wed, 24 May 2023 08:50:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684918228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tumbDtGX76tFOl1+QXHz57Q8n7nvpXgtDDdrCks7Rd8=; b=T67u62WWItpezdJNA8P3qh2cFLBDVXNv99DcaDB4oi40tBQEWmjuoRJm8kzX2bkYtsPmSf RH/w9YVFBaU8QK9Ez8kVjNnlDHekj2CaDC9OaDM9wt7DiAxvbchNhZg7/AkcFkxpr7zIm5 ArmdrK5IZ7ntLb0U0xtoZWB8L/tUJJl9evF7xbvfEueLgVpkXHMPD2owr/OKLnwySL9Z/z N2t/U35MFUlSU6U4HdjcUex+KM8Rw5U+oAC2zs7ILMpl6XNC+oMDxN6XvwdVoEcroLK+xT vecz++2MFdICeJVFh9gYBFeZD6eY1M8MTDaiBI6DFsw9mwOEoP863yl+Ji+PsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684918228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tumbDtGX76tFOl1+QXHz57Q8n7nvpXgtDDdrCks7Rd8=; b=IEwAfileEfVDwdKH5+4LOVRjdNEgTuKtcrGKK8nFs0uLndZz4Nvy7BPN3uKr1Y+Uy3tmdg cN6dKSV5dEB9XU0pCPfGR0mptygJ1goA2sUtmyjO+TsNwIHhAIhqSWLEDju5UFLvUIGRPr 9Wm6iylVe/6i4UNttwaTOvYjNnBf2MjzDXMhllSnUmcFrdjsBZU7VeEXq3SToO+Tx505dV TLOr1V76i19YhIqd5DSOJMWE4g930q+AVBY4tRxXu/qjytH7T7debkjI7zcmyXaQIbOiPm 1478LJNauPm2bxBhdS5WtD6m9tfDMZCQroA85CC9D+aghG4ZfmeFwbM0PDcsLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684918228; a=rsa-sha256; cv=none; b=ldwlYrQD2BL4CFWDewArjj1dvhKSL7v/D4qUchjlrsS5PlRi9FRtbsKeJKnbCTVaH4p8+E DSbxLX/nlKgAmGzo07lzk7UylwhhBoDIGCKygJrItxeSq6EOOMYb4OzJ0//pVRqnkkDIXs wMVezaG1/aYdGNXtXa34AfXw/UsfKS60epMOgPiAzXTCDzpIW1HuX3fTY/v1sGeO4S69Xq H7Yx+wkbz5qfCJ30fPv422k8ypVRktBjy82eb9qV1TNh8ekcFUbPEzv4CmlJUzkxvRVbK+ SfiYxev1FOCVLytQL2t5EG3Cs4Gnr7LoDkQU2LMYk1zgWpAfBOqwHxQYIBfU+g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QR4db66fVzbW8; Wed, 24 May 2023 08:50: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 34O8oRRN037703; Wed, 24 May 2023 08:50:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34O8oRcs037702; Wed, 24 May 2023 08:50:27 GMT (envelope-from git) Date: Wed, 24 May 2023 08:50:27 GMT Message-Id: <202305240850.34O8oRcs037702@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: ad513b4dba3e - main - LinuxKPI: add utsname for init_utsname() with release List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ad513b4dba3e330b6f2714bdde4d864898c4222e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=ad513b4dba3e330b6f2714bdde4d864898c4222e commit ad513b4dba3e330b6f2714bdde4d864898c4222e Author: Bjoern A. Zeeb AuthorDate: 2023-05-23 23:12:47 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-05-24 08:41:28 +0000 LinuxKPI: add utsname for init_utsname() with release A wireless dirver is requesting release from the result of init_utsname(). Populate the field on startup. MFC after: 10 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D40248 --- sys/compat/linuxkpi/common/include/linux/utsname.h | 51 ++++++++++++++++++++++ sys/compat/linuxkpi/common/src/linux_compat.c | 4 ++ 2 files changed, 55 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/utsname.h b/sys/compat/linuxkpi/common/include/linux/utsname.h new file mode 100644 index 000000000000..1f7f4b7f4289 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/utsname.h @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2023 Bjoern A. Zeeb + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUXKPI_LINUX_UTSNAME_H +#define _LINUXKPI_LINUX_UTSNAME_H + +#include +#include + +struct _utsname { + char release[OSRELEASELEN]; +}; + +struct uts_namespace { + struct _utsname name; +}; + +extern struct uts_namespace init_uts_ns; + +static inline struct _utsname * +init_utsname(void) +{ + + return &init_uts_ns.name; +} + +#endif /* _LINUXKPI_LINUX_UTSNAME_H */ diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 8a2473e82d66..d639cda64dc9 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -139,6 +140,7 @@ struct class linux_class_misc; struct list_head pci_drivers; struct list_head pci_devices; spinlock_t pci_lock; +struct uts_namespace init_uts_ns; unsigned long linux_timer_hz_mask; @@ -2813,6 +2815,8 @@ linux_compat_init(void *arg) */ for (i = 0; i < MAXCPU; i++) CPU_SET(i, &static_single_cpu_mask[i]); + + strlcpy(init_uts_ns.name.release, osrelease, sizeof(init_uts_ns.name.release)); } SYSINIT(linux_compat, SI_SUB_DRIVERS, SI_ORDER_SECOND, linux_compat_init, NULL); From nobody Wed May 24 10:40:42 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QR74p5bBjz4CXvW; Wed, 24 May 2023 10:40: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 4QR74p5Mm6z4FmT; Wed, 24 May 2023 10:40:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684924842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A2metjA/O/IVmo5VqRLOTd/MJRVaHYeda3qoYvVz030=; b=PD86RD5rbzccx+nfdC4GC+sVbgffxUR5Ci2BVRxVrAPgLTCEVrV6RO4Hy67Qvo18dX1g9A +3Pem6PM+BIsgFvKpMDd5UtAZDaDO43Xuuiy7ak/rQ4/VWeHQWZ36J5A9KdhrwsgXHF3qQ 60FU/6xPy9be+0X/0oT/GNEnL2uhA+KOMUvrwR9pWEdtzljXQSWHBEPdQHUZhvT6o5E/d+ 7uu7mF5foRKruUiPfb+DaDlBHUvWxgjRiHlWDAcCAU91LxGWvzBXNkzLWAZEuD4W0JNvzI g44hyxB4Dd4pCu8xdWQ7WOL+KvWrtVy/r+bOezuHq7Bpd1RCAwElmE0CyJanyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684924842; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A2metjA/O/IVmo5VqRLOTd/MJRVaHYeda3qoYvVz030=; b=yXriOM0WXqx9FqqhVp7FjBJ+4/euyXBiBB1eDYzmaRLL/R68QLJN44r+ynDvRmB7UTFOLV CQ7vMAv7UghRqjWR+rz00HFT4ypbmmEkgGtMKKp3ZCCj4VC/U6eCr/fWcPFvzfmfL4k8lR 2j7pugLzjJPxPLPo8s5hmhcxJqsBdCj86FsKWGrpRflbV2f0cAKVz04GZqsbY136RRdIkt UL/6CCufV6K2zdZC8mxJHLrqrRXPLtdkAEy0tGSiiQR4Q3eKgjzFssmWEAZTx3i96RzYk3 9SzeIIJKAHL+guNi8bO7q8Iv2IXGB8nqyJHQ9atUJfQkNEqvVXkmmG4bf1bjow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684924842; a=rsa-sha256; cv=none; b=KnZOvhH/qyD4Z9IfIb5f1zdvsKS/qrQiisV3mzc8uSI6tq+dCA+TBeNcjW79Fu2Lez6V4Q A3/qZ/BAs2qF4ysA++HG4eWrziiCZm+IoBmbYE3kxI0uCnZUfW2vEDjQD9hH6pwgOykbJx J/Fqwr54SnElErWFObm301Tp1PSrZgyRxZjl4tA3vf33mJexQwpKxaJT8S+XhStL+cnAkA nCo+UmQfNZK3yppxGxO4/rkwof7JlHdFUN5r+FqL74WYPch4/rSvvBs+3ifpis4cXp0Y7Q r6KFptgYKWvesykouLVV+6Wh4l+wQop8jXjWHtnSF9x0C5izo0eqLluZYpEU3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QR74p4RRxzfJQ; Wed, 24 May 2023 10:40: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 34OAegLt019631; Wed, 24 May 2023 10:40:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34OAeg7P019630; Wed, 24 May 2023 10:40:42 GMT (envelope-from git) Date: Wed, 24 May 2023 10:40:42 GMT Message-Id: <202305241040.34OAeg7P019630@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 44cd85d42e5d - main - ifconfig: cleanup warnings #1 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 44cd85d42e5ddb1d5811b388218e14582e078bf8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=44cd85d42e5ddb1d5811b388218e14582e078bf8 commit 44cd85d42e5ddb1d5811b388218e14582e078bf8 Author: Alexander V. Chernikov AuthorDate: 2023-05-23 11:04:09 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-05-24 10:40:34 +0000 ifconfig: cleanup warnings #1 Cleanup compiler warnings in preparation to set Wextra and remove WARNS?=2 Differential Revision: https://reviews.freebsd.org/D40238 MFC after: 2 weeks --- sbin/ifconfig/af_inet.c | 8 +----- sbin/ifconfig/af_inet6.c | 17 +++++------- sbin/ifconfig/carp.c | 4 +-- sbin/ifconfig/ifbridge.c | 8 ++---- sbin/ifconfig/ifconfig.c | 49 +++++++++++++++++++-------------- sbin/ifconfig/ifconfig.h | 18 ++++++++++++ sbin/ifconfig/ifconfig_netlink.c | 11 ++++---- sbin/ifconfig/ifgroup.c | 14 ++++++---- sbin/ifconfig/ifieee80211.c | 59 ++++++++++++++++++---------------------- sbin/ifconfig/iflagg.c | 12 +++----- sbin/ifconfig/ifmedia.c | 6 ++-- sbin/ifconfig/ifpfsync.c | 8 ++---- sbin/ifconfig/ifstf.c | 4 +-- sbin/ifconfig/ifvxlan.c | 16 +++++------ 14 files changed, 118 insertions(+), 116 deletions(-) diff --git a/sbin/ifconfig/af_inet.c b/sbin/ifconfig/af_inet.c index cb030dbc711b..8d302b260bd1 100644 --- a/sbin/ifconfig/af_inet.c +++ b/sbin/ifconfig/af_inet.c @@ -142,12 +142,6 @@ get_mask(int plen) return (a); } -static struct sockaddr_in * -satosin(struct sockaddr *sa) -{ - return ((struct sockaddr_in *)(void *)sa); -} - static void in_status_nl(struct ifconfig_args *args __unused, struct io_handler *h, if_link_t *link, if_addr_t *ifa) @@ -204,7 +198,7 @@ in_getaddr(const char *s, int which) if((p = strrchr(s, '/')) != NULL) { const char *errstr; /* address is `name/masklen' */ - int masklen; + int masklen = 0; struct sockaddr_in *min = sintab[MASK]; *p = '\0'; if (!isdigit(*(p + 1))) diff --git a/sbin/ifconfig/af_inet6.c b/sbin/ifconfig/af_inet6.c index 1bb08c8a6a5a..af4cecf057da 100644 --- a/sbin/ifconfig/af_inet6.c +++ b/sbin/ifconfig/af_inet6.c @@ -65,7 +65,9 @@ static struct in6_aliasreq in6_addreq = .ifra_lifetime = { 0, 0, ND6_INFINITE_LIFETIME, ND6_INFINITE_LIFETIME } }; static int ip6lifetime; +#ifdef WITHOUT_NETLINK static int prefix(void *, int); +#endif static char *sec2str(time_t); static int explicit_prefix = 0; extern char *f_inet6, *f_addr; @@ -154,7 +156,7 @@ setip6eui64(const char *cmd, int dummy __unused, int s, for (ifa = ifap; ifa; ifa = ifa->ifa_next) { if (ifa->ifa_addr->sa_family == AF_INET6 && strcmp(ifa->ifa_name, name) == 0) { - sin6 = (const struct sockaddr_in6 *)ifa->ifa_addr; + sin6 = (const struct sockaddr_in6 *)satosin6(ifa->ifa_addr); if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { lladdr = &sin6->sin6_addr; break; @@ -338,12 +340,6 @@ show_lifetime(struct ifa_cacheinfo *ci) print_lifetime("vltime", vl + now.tv_sec, &now); } -static struct sockaddr_in6 * -satosin6(struct sockaddr *sa) -{ - return ((struct sockaddr_in6 *)(void *)sa); -} - static void in6_status_nl(struct ifconfig_args *args __unused, struct io_handler *h, if_link_t *link, if_addr_t *ifa) @@ -376,10 +372,9 @@ in6_status_nl(struct ifconfig_args *args __unused, struct io_handler *h, } #endif -#define SIN6(x) ((struct sockaddr_in6 *) &(x)) static struct sockaddr_in6 *sin6tab[] = { - SIN6(in6_ridreq.ifr_addr), SIN6(in6_addreq.ifra_addr), - SIN6(in6_addreq.ifra_prefixmask), SIN6(in6_addreq.ifra_dstaddr) + &in6_ridreq.ifr_addr, &in6_addreq.ifra_addr, + &in6_addreq.ifra_prefixmask, &in6_addreq.ifra_dstaddr }; static void @@ -440,6 +435,7 @@ in6_getaddr(const char *s, int which) } } +#ifdef WITHOUT_NETLINK static int prefix(void *val, int size) { @@ -463,6 +459,7 @@ prefix(void *val, int size) return(0); return (plen); } +#endif static char * sec2str(time_t total) diff --git a/sbin/ifconfig/carp.c b/sbin/ifconfig/carp.c index cc38eed4cb4b..2d6c581582b1 100644 --- a/sbin/ifconfig/carp.c +++ b/sbin/ifconfig/carp.c @@ -252,13 +252,11 @@ static struct afswtch af_carp = { static __constructor void carp_ctor(void) { - int i; - /* Default to multicast. */ setcarp_mcast(NULL, 0, 0, NULL); setcarp_mcast6(NULL, 0, 0, NULL); - for (i = 0; i < nitems(carp_cmds); i++) + for (size_t i = 0; i < nitems(carp_cmds); i++) cmd_register(&carp_cmds[i]); af_register(&af_carp); } diff --git a/sbin/ifconfig/ifbridge.c b/sbin/ifconfig/ifbridge.c index 3a78b068eb5d..6bbc63ac9779 100644 --- a/sbin/ifconfig/ifbridge.c +++ b/sbin/ifconfig/ifbridge.c @@ -124,7 +124,7 @@ bridge_addresses(int s, const char *prefix) struct ifbaconf ifbac; struct ifbareq *ifba; char *inbuf = NULL, *ninbuf; - int i, len = 8192; + size_t len = 8192; struct ether_addr ea; for (;;) { @@ -140,7 +140,7 @@ bridge_addresses(int s, const char *prefix) len *= 2; } - for (i = 0; i < ifbac.ifbac_len / sizeof(*ifba); i++) { + for (unsigned long i = 0; i < ifbac.ifbac_len / sizeof(*ifba); i++) { ifba = ifbac.ifbac_req + i; memcpy(ea.octet, ifba->ifba_dst, sizeof(ea.octet)); @@ -683,9 +683,7 @@ static struct afswtch af_bridge = { static __constructor void bridge_ctor(void) { - int i; - - for (i = 0; i < nitems(bridge_cmds); i++) + for (size_t i = 0; i < nitems(bridge_cmds); i++) cmd_register(&bridge_cmds[i]); af_register(&af_bridge); } diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index e1467e661657..db275d877c00 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -93,8 +93,10 @@ ifconfig_handle_t *lifh; struct ifreq ifr; char name[IFNAMSIZ]; -char *descr = NULL; -size_t descrlen = 64; +#ifdef WITHOUT_NETLINK +static char *descr = NULL; +static size_t descrlen = 64; +#endif static int setaddr; static int setmask; static int doalias; @@ -111,17 +113,17 @@ int exit_code = 0; /* Formatter Strings */ char *f_inet, *f_inet6, *f_ether, *f_addr; +#ifdef WITHOUT_NETLINK static void list_interfaces_ioctl(struct ifconfig_args *args); static void status(struct ifconfig_args *args, const struct sockaddr_dl *sdl, struct ifaddrs *ifa); +#endif static _Noreturn void usage(void); static int getifflags(const char *ifname, int us, bool err_ok); static struct afswtch *af_getbyname(const char *name); -void printifnamemaybe(void); - static struct option *opts = NULL; struct ifa_order_elt { @@ -210,6 +212,7 @@ ioctl_ifcreate(int s, struct ifreq *ifr) } } +#ifdef WITHOUT_NETLINK static int calcorders(struct ifaddrs *ifa, struct ifa_queue *q) { @@ -296,6 +299,7 @@ cmpifaddrs(struct ifaddrs *a, struct ifaddrs *b, struct ifa_queue *q) return (0); } +#endif static void freeformat(void) { @@ -339,6 +343,7 @@ static void setformat(char *input) free(formatstr); } +#ifdef WITHOUT_NETLINK static struct ifaddrs * sortifaddrs(struct ifaddrs *list, int (*compare)(struct ifaddrs *, struct ifaddrs *, struct ifa_queue *), @@ -393,8 +398,10 @@ sortifaddrs(struct ifaddrs *list, return (result); } +#endif -void printifnamemaybe() +static void +printifnamemaybe(void) { if (printifname) printf("%s\n", name); @@ -694,6 +701,19 @@ match_ether(const struct sockaddr_dl *sdl) } } +bool +match_if_flags(struct ifconfig_args *args, int if_flags) +{ + if ((if_flags & IFF_CANTCONFIG) != 0) + return (false); + if (args->downonly && (if_flags & IFF_UP) != 0) + return (false); + if (args->uponly && (if_flags & IFF_UP) == 0) + return (false); + return (true); +} + +#ifdef WITHOUT_NETLINK static bool match_afp(const struct afswtch *afp, int sa_family, const struct sockaddr_dl *sdl) { @@ -708,19 +728,6 @@ match_afp(const struct afswtch *afp, int sa_family, const struct sockaddr_dl *sd return (afp->af_af == sa_family); } -bool -match_if_flags(struct ifconfig_args *args, int if_flags) -{ - if ((if_flags & IFF_CANTCONFIG) != 0) - return (false); - if (args->downonly && (if_flags & IFF_UP) != 0) - return (false); - if (args->uponly && (if_flags & IFF_UP) == 0) - return (false); - return (true); -} - -#ifdef WITHOUT_NETLINK static void list_interfaces_ioctl(struct ifconfig_args *args) { @@ -815,7 +822,7 @@ group_member(const char *ifname, const char *match, const char *nomatch) struct ifgroupreq ifgr; struct ifg_req *ifg; - int len; + unsigned int len; bool matched, nomatched; /* Sanity checks. */ @@ -1806,7 +1813,7 @@ ifmaybeload(struct ifconfig_args *args, const char *name) { #define MOD_PREFIX_LEN 3 /* "if_" */ struct module_stat mstat; - int i, fileid, modid; + int fileid, modid; char ifkind[IFNAMSIZ + MOD_PREFIX_LEN], ifname[IFNAMSIZ], *dp; const char *cp; struct module_map_entry *mme; @@ -1829,7 +1836,7 @@ ifmaybeload(struct ifconfig_args *args, const char *name) /* Either derive it from the map or guess otherwise */ *ifkind = '\0'; found = false; - for (i = 0; i < nitems(module_map); ++i) { + for (unsigned i = 0; i < nitems(module_map); ++i) { mme = &module_map[i]; if (strcmp(mme->ifname, ifname) == 0) { strlcpy(ifkind, mme->kldname, sizeof(ifkind)); diff --git a/sbin/ifconfig/ifconfig.h b/sbin/ifconfig/ifconfig.h index 1df94f357c43..1f60164b7075 100644 --- a/sbin/ifconfig/ifconfig.h +++ b/sbin/ifconfig/ifconfig.h @@ -240,6 +240,7 @@ extern int verbose; extern int printifname; extern int exit_code; extern struct ifconfig_args args; +extern char *f_inet, *f_inet6, *f_ether, *f_addr; void setifcap(const char *, int value, int s, const struct afswtch *); void setifcapnv(const char *vname, const char *arg, int s, @@ -281,3 +282,20 @@ struct ifmediareq *ifmedia_getstate(void); void print_vhid(const struct ifaddrs *, const char *); void ioctl_ifcreate(int s, struct ifreq *); + +/* Helpers */ +struct sockaddr_in; +struct sockaddr_in6; +struct sockaddr; + +static inline struct sockaddr_in6 * +satosin6(struct sockaddr *sa) +{ + return ((struct sockaddr_in6 *)(void *)sa); +} + +static inline struct sockaddr_in * +satosin(struct sockaddr *sa) +{ + return ((struct sockaddr_in *)(void *)sa); +} diff --git a/sbin/ifconfig/ifconfig_netlink.c b/sbin/ifconfig/ifconfig_netlink.c index 26a42b5866c5..96f945de65b1 100644 --- a/sbin/ifconfig/ifconfig_netlink.c +++ b/sbin/ifconfig/ifconfig_netlink.c @@ -288,7 +288,7 @@ sort_iface_ifaddrs(struct snl_state *ss, struct iface *iface) struct ifa **sorted_ifaddrs = snl_allocz(ss, iface->ifa_count * sizeof(void *)); struct ifa *ifa = iface->ifa; - for (int i = 0; i < iface->ifa_count; i++) { + for (uint32_t i = 0; i < iface->ifa_count; i++) { struct ifa *ifa_next = ifa->next; sorted_ifaddrs[i] = ifa; @@ -298,7 +298,7 @@ sort_iface_ifaddrs(struct snl_state *ss, struct iface *iface) qsort(sorted_ifaddrs, iface->ifa_count, sizeof(void *), cmp_ifaddr); ifa = sorted_ifaddrs[0]; iface->ifa = ifa; - for (int i = 1; i < iface->ifa_count; i++) { + for (uint32_t i = 1; i < iface->ifa_count; i++) { ifa->next = sorted_ifaddrs[i]; ifa = sorted_ifaddrs[i]; } @@ -371,7 +371,8 @@ get_local_socket(void) static void set_global_ifname(if_link_t *link) { - int iflen = strlcpy(name, link->ifla_ifname, sizeof(name)); + size_t iflen = strlcpy(name, link->ifla_ifname, sizeof(name)); + if (iflen >= sizeof(name)) errx(1, "%s: cloning name too long", link->ifla_ifname); strlcpy(ifr.ifr_name, link->ifla_ifname, sizeof(ifr.ifr_name)); @@ -386,7 +387,7 @@ list_interfaces_nl(struct ifconfig_args *args) struct ifmap *ifmap = prepare_ifmap(&ss); struct iface **sorted_ifaces = snl_allocz(&ss, ifmap->count * sizeof(void *)); - for (int i = 0, num = 0; i < ifmap->size; i++) { + for (uint32_t i = 0, num = 0; i < ifmap->size; i++) { if (ifmap->ifaces[i] != NULL) { sorted_ifaces[num++] = ifmap->ifaces[i]; if (num == ifmap->count) @@ -401,7 +402,7 @@ list_interfaces_nl(struct ifconfig_args *args) .ss = &ss, }; - for (int i = 0, num = 0; i < ifmap->count; i++) { + for (uint32_t i = 0, num = 0; i < ifmap->count; i++) { struct iface *iface = sorted_ifaces[i]; if (!match_iface(args, iface)) diff --git a/sbin/ifconfig/ifgroup.c b/sbin/ifconfig/ifgroup.c index 67dbc7f689f5..fc252d783d40 100644 --- a/sbin/ifconfig/ifgroup.c +++ b/sbin/ifconfig/ifgroup.c @@ -114,7 +114,7 @@ printgroup(const char *groupname) { struct ifgroupreq ifgr; struct ifg_req *ifg; - int len; + unsigned int len; int s; s = socket(AF_LOCAL, SOCK_DGRAM, 0); @@ -150,19 +150,23 @@ static struct cmd group_cmds[] = { DEF_CMD_ARG("group", setifgroup), DEF_CMD_ARG("-group", unsetifgroup), }; + static struct afswtch af_group = { .af_name = "af_group", .af_af = AF_UNSPEC, .af_other_status = getifgroups, }; -static struct option group_gopt = { "g:", "[-g groupname]", printgroup }; + +static struct option group_gopt = { + .opt = "g:", + .opt_usage = "[-g groupname]", + .cb = printgroup, +}; static __constructor void group_ctor(void) { - int i; - - for (i = 0; i < nitems(group_cmds); i++) + for (size_t i = 0; i < nitems(group_cmds); i++) cmd_register(&group_cmds[i]); af_register(&af_group); opt_register(&group_gopt); diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index 065a141da0f1..fc47105d9366 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -264,7 +264,7 @@ getregdata(void) * 11b > 11g. */ static int -canpromote(int i, int from, int to) +canpromote(unsigned int i, uint32_t from, uint32_t to) { const struct ieee80211_channel *fc = &chaninfo->ic_chans[i]; u_int j; @@ -301,7 +301,7 @@ canpromote(int i, int from, int to) * XXX VHT */ static int -promote(int i) +promote(unsigned int i) { /* * Query the current mode of the interface in case it's @@ -347,7 +347,7 @@ promote(int i) } static void -mapfreq(struct ieee80211_channel *chan, int freq, int flags) +mapfreq(struct ieee80211_channel *chan, uint16_t freq, unsigned int flags) { u_int i; @@ -367,7 +367,7 @@ mapfreq(struct ieee80211_channel *chan, int freq, int flags) } static void -mapchan(struct ieee80211_channel *chan, int ieee, int flags) +mapchan(struct ieee80211_channel *chan, uint8_t ieee, unsigned int flags) { u_int i; @@ -662,7 +662,7 @@ set80211stationname(const char *val, int d, int s, const struct afswtch *rafp) * The result is not validated here; it's assumed to be * checked against the channel table fetched from the kernel. */ -static int +static unsigned int getchannelflags(const char *val, int freq) { #define _CHAN_HT 0x80000000 @@ -808,7 +808,7 @@ getchannelflags(const char *val, int freq) static void getchannel(int s, struct ieee80211_channel *chan, const char *val) { - int v, flags; + unsigned int v, flags; char *eptr; memset(chan, 0, sizeof(*chan)); @@ -2084,11 +2084,9 @@ chanlookup(const struct ieee80211_channel chans[], int nchans, } static int -chanfind(const struct ieee80211_channel chans[], int nchans, int flags) +chanfind(const struct ieee80211_channel chans[], int nchans, unsigned int flags) { - int i; - - for (i = 0; i < nchans; i++) { + for (int i = 0; i < nchans; i++) { const struct ieee80211_channel *c = &chans[i]; if ((c->ic_flags & flags) == flags) return 1; @@ -2699,7 +2697,7 @@ getflags(int flags) } static void -printie(const char* tag, const uint8_t *ie, size_t ielen, int maxlen) +printie(const char* tag, const uint8_t *ie, size_t ielen, unsigned int maxlen) { printf("%s", tag); if (verbose) { @@ -2829,14 +2827,14 @@ printvhtpwrenv(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen) if (verbose) { const struct ieee80211_ie_vht_txpwrenv *vhtpwr = (const struct ieee80211_ie_vht_txpwrenv *) ie; - int i, n; + size_t i, n; const char *sep = ""; /* Get count; trim at ielen */ n = (vhtpwr->tx_info & IEEE80211_VHT_TXPWRENV_INFO_COUNT_MASK) + 1; /* Trim at ielen */ - if (n > ielen - 3) + if (n + 3 > ielen) n = ielen - 3; printf("tx_info); for (i = 0; i < n; i++) { @@ -3006,11 +3004,10 @@ printapchanrep(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen) const struct ieee80211_ap_chan_report_ie *ap = (const struct ieee80211_ap_chan_report_ie *) ie; const char *sep = ""; - int i; printf("i_class); - for (i = 3; i < ielen; i++) { + for (size_t i = 3; i < ielen; i++) { printf("%s%u", sep, ie[i]); sep = ","; } @@ -3331,7 +3328,7 @@ printwpsie(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen) break; case IEEE80211_WPS_ATTR_DEV_PASSWORD_ID: n = LE_READ_2(ie); - if (n < nitems(dev_pass_id)) + if (n < (int)nitems(dev_pass_id)) printf(" dpi:%s", dev_pass_id[n]); break; case IEEE80211_WPS_ATTR_MANUFACTURER: @@ -3492,11 +3489,10 @@ static void printrates(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen) { const char *sep; - int i; printf("%s", tag); sep = "<"; - for (i = 2; i < ielen; i++) { + for (size_t i = 2; i < ielen; i++) { printf("%s%s%d", sep, ie[i] & IEEE80211_RATE_BASIC ? "B" : "", ie[i] & IEEE80211_RATE_VAL); @@ -3603,7 +3599,7 @@ iename(int elemid) } static void -printies(const u_int8_t *vp, int ielen, int maxcols) +printies(const u_int8_t *vp, int ielen, unsigned int maxcols) { while (ielen > 0) { switch (vp[0]) { @@ -3737,7 +3733,7 @@ list_scan(int s) if (get80211len(s, IEEE80211_IOC_SCAN_RESULTS, buf, sizeof(buf), &len) < 0) errx(1, "unable to get scan results"); - if (len < sizeof(struct ieee80211req_scan_result)) + if (len < (int)sizeof(struct ieee80211req_scan_result)) return; getchaninfo(s); @@ -3756,7 +3752,7 @@ list_scan(int s) const struct ieee80211req_scan_result *sr; const uint8_t *vp, *idp; - sr = (const struct ieee80211req_scan_result *) cp; + sr = (const struct ieee80211req_scan_result *)(const void *) cp; vp = cp + sr->isr_ie_off; if (sr->isr_meshid_len) { idp = vp + sr->isr_ssid_len; @@ -3781,7 +3777,7 @@ list_scan(int s) printbssidname((const struct ether_addr *)sr->isr_bssid); printf("\n"); cp += sr->isr_len, len -= sr->isr_len; - } while (len >= sizeof(struct ieee80211req_scan_result)); + } while (len >= (int)sizeof(struct ieee80211req_scan_result)); } static void @@ -3862,13 +3858,13 @@ gettxseq(const struct ieee80211req_sta_info *si) static int getrxseq(const struct ieee80211req_sta_info *si) { - int i, rxseq; + int rxseq; if ((si->isi_state & IEEE80211_NODE_QOS) == 0) return si->isi_rxseqs[0]; /* XXX not right but usually what folks want */ rxseq = 0; - for (i = 0; i < IEEE80211_TID_SIZE; i++) + for (unsigned int i = 0; i < IEEE80211_TID_SIZE; i++) if (si->isi_rxseqs[i] > rxseq) rxseq = si->isi_rxseqs[i]; return rxseq; @@ -3896,7 +3892,7 @@ list_stations(int s) } if (get80211len(s, IEEE80211_IOC_STA_INFO, &u, sizeof(u), &len) < 0) errx(1, "unable to get station information"); - if (len < sizeof(struct ieee80211req_sta_info)) + if (len < (int)sizeof(struct ieee80211req_sta_info)) return; getchaninfo(s); @@ -3968,7 +3964,7 @@ list_stations(int s) printmimo(&si->isi_mimo); printf("\n"); cp += si->isi_len, len -= si->isi_len; - } while (len >= sizeof(struct ieee80211req_sta_info)); + } while (len >= (int)sizeof(struct ieee80211req_sta_info)); } static const char * @@ -4108,7 +4104,7 @@ print_channels(int s, const struct ieee80211req_chaninfo *chans, struct ieee80211req_chaninfo *achans; uint8_t reported[IEEE80211_CHAN_BYTES]; const struct ieee80211_channel *c; - int i, half; + unsigned int i, half; achans = malloc(IEEE80211_CHANINFO_SPACE(chans)); if (achans == NULL) @@ -4202,7 +4198,7 @@ list_txpow(int s) struct ieee80211req_chaninfo *achans; uint8_t reported[IEEE80211_CHAN_BYTES]; struct ieee80211_channel *c, *prev; - int i, half; + unsigned int i, half; getchaninfo(s); achans = malloc(IEEE80211_CHANINFO_SPACE(chaninfo)); @@ -4623,7 +4619,8 @@ list_mesh(int s) , "MSEQ" , "FLAGS"); - for (rt = &routes[0]; rt - &routes[0] < ireq.i_len / sizeof(*rt); rt++){ + for (unsigned int i = 0; i < ireq.i_len / sizeof(*rt); i++) { + rt = &routes[i]; printf("%s ", ether_ntoa((const struct ether_addr *)rt->imr_dest)); printf("%s %4u %4u %6u %6u %c%c\n", @@ -6079,9 +6076,7 @@ static struct afswtch af_ieee80211 = { static __constructor void ieee80211_ctor(void) { - int i; - - for (i = 0; i < nitems(ieee80211_cmds); i++) + for (size_t i = 0; i < nitems(ieee80211_cmds); i++) cmd_register(&ieee80211_cmds[i]); af_register(&af_ieee80211); clone_setdefcallback_prefix("wlan", wlan_create); diff --git a/sbin/ifconfig/iflagg.c b/sbin/ifconfig/iflagg.c index 48d7450076a9..4040d423cc6a 100644 --- a/sbin/ifconfig/iflagg.c +++ b/sbin/ifconfig/iflagg.c @@ -78,12 +78,11 @@ setlaggproto(const char *val, int d, int s, const struct afswtch *afp) { struct lagg_protos lpr[] = LAGG_PROTOS; struct lagg_reqall ra; - int i; bzero(&ra, sizeof(ra)); ra.ra_proto = LAGG_PROTO_MAX; - for (i = 0; i < nitems(lpr); i++) { + for (size_t i = 0; i < nitems(lpr); i++) { if (strcmp(val, lpr[i].lpr_name) == 0) { ra.ra_proto = lpr[i].lpr_proto; break; @@ -279,7 +278,7 @@ lagg_status(int s) } } - for (size_t i = 0; i < ra->ra_ports; ++i) { + for (size_t i = 0; i < (size_t)ra->ra_ports; ++i) { lp = &ports[i].rp_lacpreq; printf("\tlaggport: %s ", ports[i].rp_portname); printb("flags", ports[i].rp_flags, LAGG_PORT_BITS); @@ -298,9 +297,8 @@ static DECL_CMD_FUNC(setlaggtype, arg, d) { static const struct lagg_types lt[] = LAGG_TYPES; - int i; - for (i = 0; i < nitems(lt); i++) { + for (size_t i = 0; i < nitems(lt); i++) { if (strcmp(arg, lt[i].lt_name) == 0) { params.lagg_type = lt[i].lt_value; return; @@ -346,9 +344,7 @@ static struct afswtch af_lagg = { static __constructor void lagg_ctor(void) { - int i; - - for (i = 0; i < nitems(lagg_cmds); i++) + for (size_t i = 0; i < nitems(lagg_cmds); i++) cmd_register(&lagg_cmds[i]); af_register(&af_lagg); clone_setdefcallback_prefix("lagg", lagg_create); diff --git a/sbin/ifconfig/ifmedia.c b/sbin/ifconfig/ifmedia.c index 3014d19b00ff..510c74b8be21 100644 --- a/sbin/ifconfig/ifmedia.c +++ b/sbin/ifconfig/ifmedia.c @@ -146,7 +146,7 @@ media_status(int s) if (args.supmedia) { printf("\tsupported media:\n"); - for (size_t i = 0; i < ifmr->ifm_count; ++i) { + for (int i = 0; i < ifmr->ifm_count; ++i) { printf("\t\t"); print_media_ifconfig(ifmr->ifm_ulist[i]); putchar('\n'); @@ -486,9 +486,7 @@ static struct afswtch af_media = { static __constructor void ifmedia_ctor(void) { - size_t i; - - for (i = 0; i < nitems(media_cmds); i++) + for (size_t i = 0; i < nitems(media_cmds); i++) cmd_register(&media_cmds[i]); af_register(&af_media); } diff --git a/sbin/ifconfig/ifpfsync.c b/sbin/ifconfig/ifpfsync.c index e5118fff36af..eb214ed6e634 100644 --- a/sbin/ifconfig/ifpfsync.c +++ b/sbin/ifconfig/ifpfsync.c @@ -330,8 +330,8 @@ pfsync_status(int s) char syncdev[IFNAMSIZ]; char syncpeer_str[NI_MAXHOST]; struct sockaddr_storage syncpeer; - int maxupdates; - int flags; + int maxupdates = 0; + int flags = 0; int error; nvl = nvlist_create(0); @@ -401,9 +401,7 @@ static struct afswtch af_pfsync = { static __constructor void pfsync_ctor(void) { - int i; - - for (i = 0; i < nitems(pfsync_cmds); i++) + for (size_t i = 0; i < nitems(pfsync_cmds); i++) cmd_register(&pfsync_cmds[i]); af_register(&af_pfsync); } diff --git a/sbin/ifconfig/ifstf.c b/sbin/ifconfig/ifstf.c index f6c3cb5d5447..035793ccd98f 100644 --- a/sbin/ifconfig/ifstf.c +++ b/sbin/ifconfig/ifstf.c @@ -144,9 +144,7 @@ static struct afswtch af_stf = { static __constructor void stf_ctor(void) { - int i; - - for (i = 0; i < nitems(stf_cmds); i++) + for (size_t i = 0; i < nitems(stf_cmds); i++) cmd_register(&stf_cmds[i]); af_register(&af_stf); } diff --git a/sbin/ifconfig/ifvxlan.c b/sbin/ifconfig/ifvxlan.c index fda435343a16..131bbc105973 100644 --- a/sbin/ifconfig/ifvxlan.c +++ b/sbin/ifconfig/ifvxlan.c @@ -128,10 +128,10 @@ vxlan_status(int s) dst[0] = dstport[0] = '\0'; if (!ipv6) { - struct sockaddr_in *sin = (struct sockaddr_in *)rsa; + struct sockaddr_in *sin = satosin(rsa); mc = IN_MULTICAST(ntohl(sin->sin_addr.s_addr)); } else { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)rsa; + struct sockaddr_in6 *sin6 = satosin6(rsa); mc = IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr); } @@ -235,7 +235,7 @@ DECL_CMD_FUNC(setvxlan_local, addr, d) switch (ai->ai_family) { #ifdef INET case AF_INET: { - struct sockaddr_in *sin = (struct sockaddr_in *)sa; + struct sockaddr_in *sin = satosin(sa); if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) errx(1, "local address cannot be multicast"); @@ -246,7 +246,7 @@ DECL_CMD_FUNC(setvxlan_local, addr, d) #endif #ifdef INET6 case AF_INET6: { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; + struct sockaddr_in6 *sin6 = satosin6(sa); if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) errx(1, "local address cannot be multicast"); @@ -295,7 +295,7 @@ DECL_CMD_FUNC(setvxlan_remote, addr, d) switch (ai->ai_family) { #ifdef INET case AF_INET: { - struct sockaddr_in *sin = (struct sockaddr_in *)sa; + struct sockaddr_in *sin = satosin(sa); if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) errx(1, "remote address cannot be multicast"); @@ -306,7 +306,7 @@ DECL_CMD_FUNC(setvxlan_remote, addr, d) #endif #ifdef INET6 case AF_INET6: { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; + struct sockaddr_in6 *sin6 = satosin6(sa); if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) errx(1, "remote address cannot be multicast"); @@ -355,7 +355,7 @@ DECL_CMD_FUNC(setvxlan_group, addr, d) switch (ai->ai_family) { #ifdef INET case AF_INET: { - struct sockaddr_in *sin = (struct sockaddr_in *)sa; + struct sockaddr_in *sin = satosin(sa); if (!IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) errx(1, "group address must be multicast"); @@ -366,7 +366,7 @@ DECL_CMD_FUNC(setvxlan_group, addr, d) #endif #ifdef INET6 case AF_INET6: { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; + struct sockaddr_in6 *sin6 = satosin6(sa); if (!IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) errx(1, "group address must be multicast"); From nobody Wed May 24 10:40:43 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QR74q71vjz4CXkD; Wed, 24 May 2023 10:40: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 4QR74q6Gghz4Fkl; Wed, 24 May 2023 10:40:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684924843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AmXDyaQcgV+RTzYbhrgQf7sVIsEXYZZH5d6+dVIlxTQ=; b=bY/83wQObF9IntdIXJptXMJFBD/uDwP1DQETSu2Jv2i4U7LfRbF2NT/QWKtUvp1zWBU8IR fvSGgIlpxPhlfi9zDFtzqt7UVE6ElLGzUQ53VuwLkC8EP7ZjX6bl7JBJM0drPn/Fhr0xOS sjcglxffxzNhybNWezW1tJU12zpnZhsk3OLe7eDIWBxMI+8PB6rNmJWT90w1FJznX/R98Z ncLndWLUOf0og3RDMFn+scAsoOLStcqW6Xqn5VTeH2Jhze+SLQ2CBgX904/SvF9sKMKVaP eR3mCXYCJxLXhb4YN3maW1HNPB2A5PiG6f1/OPrbtmB/uc1xakJCX3fkeOVUNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684924843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AmXDyaQcgV+RTzYbhrgQf7sVIsEXYZZH5d6+dVIlxTQ=; b=hT/yO8FA7p3xl3kFWkPlMvtraxP/cPeBgAM+bLv6lz8MoIjP8ZTGsfohppjp6hKTguh2K+ s1Kpg5DxDbz/Y7z2xP+r7571KYAYWdNl/IdgfCvZ67UdBzunWU1soFVYQGLDJ4Kf7fAPTB kVIqsCIUOEB2+cWnQjj1EQS3XxXWePUAXbutMfx9kn2ShbdD3bJpM9JTbySTqCXucVdf2V 5O3EsHfIRpLD2YQiHTWkA2cMvKdq+ytelxZP1fAIK1V59MnghL7niowhUAWKjcujmjsLQD JeDHukHr5DMc2ZvPzYMd/D+72fv4AaaD0Uy8ULIrMBdPYyi00AYPwERTtcKdcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684924843; a=rsa-sha256; cv=none; b=IDIXipKvS6kMmj815gTL4XOlk+5TBRV+u2oFw5KErvEfwUAuRoa7MwPyWMR6h3ZELqVjxz jxeeNv16xgbEl6+rr6PWZmygOrpg9mqwhEbExxcRRoR6saKLwVSnGftJamb7Tl56BDy+Su iB8djIl60awIRlbuJPW1iRXy/bgcXiEF2xY9oXBthaMjuRou+4dqFdsjSmEqVhxjnFJFiW TYZ0tC/w5i9dFhPHZDy/9Dub/SBbJMToQ2biff9rdX+Eg3hs2B4DvsomwDZf3AMZIcHD39 h/oUgO/sq/DUQWVwCA+QKmjTcInKwrPH35/FdiNXvpWntoOyPkMsCLZO02aVFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QR74q5LYVzdyL; Wed, 24 May 2023 10:40: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 34OAeh7Z019650; Wed, 24 May 2023 10:40:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34OAeh2N019649; Wed, 24 May 2023 10:40:43 GMT (envelope-from git) Date: Wed, 24 May 2023 10:40:43 GMT Message-Id: <202305241040.34OAeh2N019649@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 6e3a9d7f2c8d - main - ifconfig: introduce `ifconfig_context` to store current global state. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6e3a9d7f2c8dc18dc901d4f860a65028c0a82a64 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=6e3a9d7f2c8dc18dc901d4f860a65028c0a82a64 commit 6e3a9d7f2c8dc18dc901d4f860a65028c0a82a64 Author: Alexander V. Chernikov AuthorDate: 2023-05-23 17:02:12 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-05-24 10:40:34 +0000 ifconfig: introduce `ifconfig_context` to store current global state. The structure consists of all current context - arguments, open sockets, current family and so on. Pass this structure as a first argument to most of the af_ menthods. This allows to propagate and update shared data without using global variables. The diff is pretty large, but de-facto mechanical. All changes except the structure setup in ifconfig[_netlink].c are one-line mechanical changes. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D40239 MFC after: 2 weeks --- sbin/ifconfig/af_inet.c | 9 +- sbin/ifconfig/af_inet6.c | 45 ++-- sbin/ifconfig/af_link.c | 15 +- sbin/ifconfig/af_nd6.c | 24 +- sbin/ifconfig/carp.c | 30 +-- sbin/ifconfig/ifbridge.c | 158 ++++++----- sbin/ifconfig/ifclone.c | 12 +- sbin/ifconfig/ifconfig.c | 199 +++++++------- sbin/ifconfig/ifconfig.h | 61 ++--- sbin/ifconfig/ifconfig_netlink.c | 40 +-- sbin/ifconfig/iffib.c | 16 +- sbin/ifconfig/ifgif.c | 12 +- sbin/ifconfig/ifgre.c | 26 +- sbin/ifconfig/ifgroup.c | 12 +- sbin/ifconfig/ifieee80211.c | 547 ++++++++++++++++++++------------------- sbin/ifconfig/ifipsec.c | 10 +- sbin/ifconfig/iflagg.c | 34 +-- sbin/ifconfig/ifmac.c | 8 +- sbin/ifconfig/ifmedia.c | 18 +- sbin/ifconfig/ifpfsync.c | 68 ++--- sbin/ifconfig/ifstf.c | 16 +- sbin/ifconfig/ifvlan.c | 44 ++-- sbin/ifconfig/ifvxlan.c | 112 ++++---- 23 files changed, 755 insertions(+), 761 deletions(-) diff --git a/sbin/ifconfig/af_inet.c b/sbin/ifconfig/af_inet.c index 8d302b260bd1..fdde3bd23595 100644 --- a/sbin/ifconfig/af_inet.c +++ b/sbin/ifconfig/af_inet.c @@ -83,7 +83,7 @@ print_addr(struct sockaddr_in *sin) #ifdef WITHOUT_NETLINK static void -in_status(int s __unused, const struct ifaddrs *ifa) +in_status(if_ctx *ctx __unused, const struct ifaddrs *ifa) { struct sockaddr_in *sin, null_sin = {}; @@ -143,8 +143,7 @@ get_mask(int plen) } static void -in_status_nl(struct ifconfig_args *args __unused, struct io_handler *h, - if_link_t *link, if_addr_t *ifa) +in_status_nl(if_ctx *ctx __unused, if_link_t *link, if_addr_t *ifa) { struct sockaddr_in *sin = satosin(ifa->ifa_local); int plen = ifa->ifa_prefixlen; @@ -228,7 +227,7 @@ in_getaddr(const char *s, int which) } static void -in_postproc(int s, const struct afswtch *afp, int newaddr, int ifflags) +in_postproc(if_ctx *ctx __unused, int newaddr, int ifflags) { if (sintab[ADDR]->sin_len != 0 && sintab[MASK]->sin_len == 0 && newaddr && (ifflags & (IFF_POINTOPOINT | IFF_LOOPBACK)) == 0) { @@ -292,7 +291,7 @@ static struct afswtch af_inet = { #ifdef WITHOUT_NETLINK .af_status = in_status, #else - .af_status_nl = in_status_nl, + .af_status = in_status_nl, #endif .af_getaddr = in_getaddr, .af_postproc = in_postproc, diff --git a/sbin/ifconfig/af_inet6.c b/sbin/ifconfig/af_inet6.c index af4cecf057da..8e2c4946e962 100644 --- a/sbin/ifconfig/af_inet6.c +++ b/sbin/ifconfig/af_inet6.c @@ -72,25 +72,27 @@ static char *sec2str(time_t); static int explicit_prefix = 0; extern char *f_inet6, *f_addr; -extern void setnd6flags(const char *, int, int, const struct afswtch *); -extern void setnd6defif(const char *, int, int, const struct afswtch *); -extern void nd6_status(int); +extern void setnd6flags(if_ctx *, const char *, int); +extern void setnd6defif(if_ctx *,const char *, int); +extern void nd6_status(if_ctx *); static char addr_buf[NI_MAXHOST]; /*for getnameinfo()*/ static void -setifprefixlen(const char *addr, int dummy __unused, int s, - const struct afswtch *afp) +setifprefixlen(if_ctx *ctx, const char *addr, int dummy __unused) { + const struct afswtch *afp = ctx->afp; + if (afp->af_getprefix != NULL) afp->af_getprefix(addr, MASK); explicit_prefix = 1; } static void -setip6flags(const char *dummyaddr __unused, int flag, int dummysoc __unused, - const struct afswtch *afp) +setip6flags(if_ctx *ctx, const char *dummyaddr __unused, int flag) { + const struct afswtch *afp = ctx->afp; + if (afp->af_af != AF_INET6) err(1, "address flags can be set only for inet6 addresses"); @@ -101,9 +103,9 @@ setip6flags(const char *dummyaddr __unused, int flag, int dummysoc __unused, } static void -setip6lifetime(const char *cmd, const char *val, int s, - const struct afswtch *afp) +setip6lifetime(if_ctx *ctx, const char *cmd, const char *val) { + const struct afswtch *afp = ctx->afp; struct timespec now; time_t newval; char *ep; @@ -124,23 +126,21 @@ setip6lifetime(const char *cmd, const char *val, int s, } static void -setip6pltime(const char *seconds, int dummy __unused, int s, - const struct afswtch *afp) +setip6pltime(if_ctx *ctx, const char *seconds, int dummy __unused) { - setip6lifetime("pltime", seconds, s, afp); + setip6lifetime(ctx, "pltime", seconds); } static void -setip6vltime(const char *seconds, int dummy __unused, int s, - const struct afswtch *afp) +setip6vltime(if_ctx *ctx, const char *seconds, int dummy __unused) { - setip6lifetime("vltime", seconds, s, afp); + setip6lifetime(ctx, "vltime", seconds); } static void -setip6eui64(const char *cmd, int dummy __unused, int s, - const struct afswtch *afp) +setip6eui64(if_ctx *ctx, const char *cmd, int dummy __unused) { + const struct afswtch *afp = ctx->afp; struct ifaddrs *ifap, *ifa; const struct sockaddr_in6 *sin6 = NULL; const struct in6_addr *lladdr = NULL; @@ -247,7 +247,7 @@ print_lifetime(const char *prepend, time_t px_time, struct timespec *now) #ifdef WITHOUT_NETLINK static void -in6_status(int s __unused, const struct ifaddrs *ifa) +in6_status(if_ctx *ctx __unused, const struct ifaddrs *ifa) { struct sockaddr_in6 *sin, null_sin = {}; struct in6_ifreq ifr6; @@ -341,8 +341,7 @@ show_lifetime(struct ifa_cacheinfo *ci) } static void -in6_status_nl(struct ifconfig_args *args __unused, struct io_handler *h, - if_link_t *link, if_addr_t *ifa) +in6_status_nl(if_ctx *ctx __unused, if_link_t *link, if_addr_t *ifa) { int plen = ifa->ifa_prefixlen; uint32_t scopeid; @@ -495,14 +494,14 @@ sec2str(time_t total) } static void -in6_postproc(int s, const struct afswtch *afp, int newaddr __unused, +in6_postproc(if_ctx *ctx, int newaddr __unused, int ifflags __unused) { if (explicit_prefix == 0) { /* Aggregatable address architecture defines all prefixes are 64. So, it is convenient to set prefixlen to 64 if it is not specified. */ - setifprefixlen("64", 0, s, afp); + setifprefixlen(ctx, "64", 0); /* in6_getprefix("64", MASK) if MASK is available here... */ } } @@ -600,7 +599,7 @@ static struct afswtch af_inet6 = { #ifdef WITHOUT_NETLINK .af_status = in6_status, #else - .af_status_nl = in6_status_nl, + .af_status = in6_status_nl, #endif .af_getaddr = in6_getaddr, .af_getprefix = in6_getprefix, diff --git a/sbin/ifconfig/af_link.c b/sbin/ifconfig/af_link.c index 52295453b4f0..978006c217de 100644 --- a/sbin/ifconfig/af_link.c +++ b/sbin/ifconfig/af_link.c @@ -93,7 +93,7 @@ print_pcp(int s) #ifdef WITHOUT_NETLINK static void -link_status(int s __unused, const struct ifaddrs *ifa) +link_status(if_ctx *ctx, const struct ifaddrs *ifa) { /* XXX no const 'cuz LLADDR is defined wrong */ struct sockaddr_dl *sdl; @@ -142,7 +142,7 @@ link_status(int s __unused, const struct ifaddrs *ifa) print_ether((const struct ether_addr *)&ifr.ifr_addr.sa_data, "hwaddr"); pcp: - print_pcp(s); + print_pcp(ctx->io_s); } #else @@ -159,8 +159,7 @@ convert_iftype(uint8_t iftype) } static void -link_status_nl(struct ifconfig_args *args __unused, struct io_handler *h, - if_link_t *link, if_addr_t *ifa __unused) +link_status_nl(if_ctx *ctx, if_link_t *link, if_addr_t *ifa __unused) { if (link->ifla_address != NULL) { struct sockaddr_dl sdl = { @@ -180,7 +179,7 @@ link_status_nl(struct ifconfig_args *args __unused, struct io_handler *h, } } if (convert_iftype(link->ifi_type) == IFT_ETHER) - print_pcp(h->s); + print_pcp(ctx->io_s); } #endif @@ -224,7 +223,7 @@ static struct afswtch af_link = { #ifdef WITHOUT_NETLINK .af_status = link_status, #else - .af_status_nl = link_status_nl, + .af_status = link_status_nl, #endif .af_getaddr = link_getaddr, .af_aifaddr = SIOCSIFLLADDR, @@ -236,7 +235,7 @@ static struct afswtch af_ether = { #ifdef WITHOUT_NETLINK .af_status = link_status, #else - .af_status_nl = link_status_nl, + .af_status = link_status_nl, #endif .af_getaddr = link_getaddr, .af_aifaddr = SIOCSIFLLADDR, @@ -248,7 +247,7 @@ static struct afswtch af_lladdr = { #ifdef WITHOUT_NETLINK .af_status = link_status, #else - .af_status_nl = link_status_nl, + .af_status = link_status_nl, #endif .af_getaddr = link_getaddr, .af_aifaddr = SIOCSIFLLADDR, diff --git a/sbin/ifconfig/af_nd6.c b/sbin/ifconfig/af_nd6.c index d1be5a4dc00f..ef46f5694cc0 100644 --- a/sbin/ifconfig/af_nd6.c +++ b/sbin/ifconfig/af_nd6.c @@ -70,21 +70,19 @@ static const char rcsid[] = #endif static int isnd6defif(int); -void setnd6flags(const char *, int, int, const struct afswtch *); -void setnd6defif(const char *, int, int, const struct afswtch *); -void nd6_status(int); +void setnd6flags(if_ctx *, const char *, int); +void setnd6defif(if_ctx *,const char *, int); +void nd6_status(if_ctx *); void -setnd6flags(const char *dummyaddr __unused, - int d, int s, - const struct afswtch *afp) +setnd6flags(if_ctx *ctx, const char *dummyaddr __unused, int d) { struct in6_ndireq nd; int error; memset(&nd, 0, sizeof(nd)); strlcpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname)); - error = ioctl(s, SIOCGIFINFO_IN6, &nd); + error = ioctl_ctx(ctx, SIOCGIFINFO_IN6, &nd); if (error) { warn("ioctl(SIOCGIFINFO_IN6)"); return; @@ -93,15 +91,13 @@ setnd6flags(const char *dummyaddr __unused, nd.ndi.flags &= ~(-d); else nd.ndi.flags |= d; - error = ioctl(s, SIOCSIFINFO_IN6, (caddr_t)&nd); + error = ioctl_ctx(ctx, SIOCSIFINFO_IN6, (caddr_t)&nd); if (error) warn("ioctl(SIOCSIFINFO_IN6)"); } void -setnd6defif(const char *dummyaddr __unused, - int d, int s, - const struct afswtch *afp) +setnd6defif(if_ctx *ctx, const char *dummyaddr __unused, int d) { struct in6_ndifreq ndifreq; int ifindex; @@ -111,7 +107,7 @@ setnd6defif(const char *dummyaddr __unused, strlcpy(ndifreq.ifname, ifr.ifr_name, sizeof(ndifreq.ifname)); if (d < 0) { - if (isnd6defif(s)) { + if (isnd6defif(ctx->io_s)) { /* ifindex = 0 means to remove default if */ ifindex = 0; } else @@ -122,7 +118,7 @@ setnd6defif(const char *dummyaddr __unused, } ndifreq.ifindex = ifindex; - error = ioctl(s, SIOCSDEFIFACE_IN6, (caddr_t)&ndifreq); + error = ioctl_ctx(ctx, SIOCSDEFIFACE_IN6, (caddr_t)&ndifreq); if (error) warn("ioctl(SIOCSDEFIFACE_IN6)"); } @@ -147,7 +143,7 @@ isnd6defif(int s) } void -nd6_status(int s) +nd6_status(if_ctx *ctx __unused) { struct in6_ndireq nd; int s6; diff --git a/sbin/ifconfig/carp.c b/sbin/ifconfig/carp.c index 2d6c581582b1..d4978d53f083 100644 --- a/sbin/ifconfig/carp.c +++ b/sbin/ifconfig/carp.c @@ -60,12 +60,7 @@ static const char *carp_states[] = { CARP_STATES }; -static void carp_status(int s); -static void setcarp_vhid(const char *, int, int, const struct afswtch *rafp); static void setcarp_callback(int, void *); -static void setcarp_advbase(const char *,int, int, const struct afswtch *rafp); -static void setcarp_advskew(const char *, int, int, const struct afswtch *rafp); -static void setcarp_passwd(const char *, int, int, const struct afswtch *rafp); static int carpr_vhid = -1; static int carpr_advskew = -1; @@ -76,7 +71,7 @@ static struct in6_addr carp_addr6; static unsigned char const *carpr_key; static void -carp_status(int s) +carp_status(if_ctx *ctx __unused) { struct ifconfig_carp carpr[CARP_MAXVHID]; char addr_buf[NI_MAXHOST]; @@ -102,8 +97,9 @@ carp_status(int s) } static void -setcarp_vhid(const char *val, int d, int s, const struct afswtch *afp) +setcarp_vhid(if_ctx *ctx, const char *val, int dummy __unused) { + const struct afswtch *afp = ctx->afp; carpr_vhid = atoi(val); @@ -148,7 +144,7 @@ setcarp_callback(int s, void *arg __unused) } static void -setcarp_passwd(const char *val, int d, int s, const struct afswtch *afp) +setcarp_passwd(if_ctx *ctx __unused, const char *val, int dummy __unused) { if (carpr_vhid == -1) @@ -158,7 +154,7 @@ setcarp_passwd(const char *val, int d, int s, const struct afswtch *afp) } static void -setcarp_advskew(const char *val, int d, int s, const struct afswtch *afp) +setcarp_advskew(if_ctx *ctx __unused, const char *val, int dummy __unused) { if (carpr_vhid == -1) @@ -168,7 +164,7 @@ setcarp_advskew(const char *val, int d, int s, const struct afswtch *afp) } static void -setcarp_advbase(const char *val, int d, int s, const struct afswtch *afp) +setcarp_advbase(if_ctx *ctx __unused, const char *val, int dummy __unused) { if (carpr_vhid == -1) @@ -178,7 +174,7 @@ setcarp_advbase(const char *val, int d, int s, const struct afswtch *afp) } static void -setcarp_state(const char *val, int d, int s, const struct afswtch *afp) +setcarp_state(if_ctx *ctx __unused, const char *val, int dummy __unused) { int i; @@ -195,19 +191,19 @@ setcarp_state(const char *val, int d, int s, const struct afswtch *afp) } static void -setcarp_peer(const char *val, int d, int s, const struct afswtch *afp) +setcarp_peer(if_ctx *ctx __unused, const char *val, int dummy __unused) { carp_addr.s_addr = inet_addr(val); } static void -setcarp_mcast(const char *val, int d, int s, const struct afswtch *afp) +setcarp_mcast(if_ctx *ctx __unused, const char *val __unused, int dummy __unused) { carp_addr.s_addr = htonl(INADDR_CARP_GROUP); } static void -setcarp_peer6(const char *val, int d, int s, const struct afswtch *afp) +setcarp_peer6(if_ctx *ctx __unused, const char *val, int dummy __unused) { struct addrinfo hints, *res; @@ -224,7 +220,7 @@ setcarp_peer6(const char *val, int d, int s, const struct afswtch *afp) } static void -setcarp_mcast6(const char *val, int d, int s, const struct afswtch *afp) +setcarp_mcast6(if_ctx *ctx __unused, const char *val __unused, int dummy __unused) { bzero(&carp_addr6, sizeof(carp_addr6)); carp_addr6.s6_addr[0] = 0xff; @@ -253,8 +249,8 @@ static __constructor void carp_ctor(void) { /* Default to multicast. */ - setcarp_mcast(NULL, 0, 0, NULL); - setcarp_mcast6(NULL, 0, 0, NULL); + setcarp_mcast(NULL, NULL, 0); + setcarp_mcast6(NULL, NULL, 0); for (size_t i = 0; i < nitems(carp_cmds); i++) cmd_register(&carp_cmds[i]); diff --git a/sbin/ifconfig/ifbridge.c b/sbin/ifconfig/ifbridge.c index 6bbc63ac9779..9d3c64a184b4 100644 --- a/sbin/ifconfig/ifbridge.c +++ b/sbin/ifconfig/ifbridge.c @@ -154,7 +154,7 @@ bridge_addresses(int s, const char *prefix) } static void -bridge_status(int s) +bridge_status(if_ctx *ctx __unused) { struct ifconfig_bridge_status *bridge; struct ifbropreq *params; @@ -225,178 +225,177 @@ bridge_status(int s) } static void -setbridge_add(const char *val, int d, int s, const struct afswtch *afp) +setbridge_add(if_ctx *ctx, const char *val, int dummy __unused) { struct ifbreq req; memset(&req, 0, sizeof(req)); strlcpy(req.ifbr_ifsname, val, sizeof(req.ifbr_ifsname)); - if (do_cmd(s, BRDGADD, &req, sizeof(req), 1) < 0) + if (do_cmd(ctx->io_s, BRDGADD, &req, sizeof(req), 1) < 0) err(1, "BRDGADD %s", val); } static void -setbridge_delete(const char *val, int d, int s, const struct afswtch *afp) +setbridge_delete(if_ctx *ctx, const char *val, int dummy __unused) { struct ifbreq req; memset(&req, 0, sizeof(req)); strlcpy(req.ifbr_ifsname, val, sizeof(req.ifbr_ifsname)); - if (do_cmd(s, BRDGDEL, &req, sizeof(req), 1) < 0) + if (do_cmd(ctx->io_s, BRDGDEL, &req, sizeof(req), 1) < 0) err(1, "BRDGDEL %s", val); } static void -setbridge_discover(const char *val, int d, int s, const struct afswtch *afp) +setbridge_discover(if_ctx *ctx, const char *val, int dummy __unused) { - do_bridgeflag(s, val, IFBIF_DISCOVER, 1); + do_bridgeflag(ctx->io_s, val, IFBIF_DISCOVER, 1); } static void -unsetbridge_discover(const char *val, int d, int s, const struct afswtch *afp) +unsetbridge_discover(if_ctx *ctx, const char *val, int dummy __unused) { - do_bridgeflag(s, val, IFBIF_DISCOVER, 0); + do_bridgeflag(ctx->io_s, val, IFBIF_DISCOVER, 0); } static void -setbridge_learn(const char *val, int d, int s, const struct afswtch *afp) +setbridge_learn(if_ctx *ctx, const char *val, int dummy __unused) { - do_bridgeflag(s, val, IFBIF_LEARNING, 1); + do_bridgeflag(ctx->io_s, val, IFBIF_LEARNING, 1); } static void -unsetbridge_learn(const char *val, int d, int s, const struct afswtch *afp) +unsetbridge_learn(if_ctx *ctx, const char *val, int dummy __unused) { - do_bridgeflag(s, val, IFBIF_LEARNING, 0); + do_bridgeflag(ctx->io_s, val, IFBIF_LEARNING, 0); } static void -setbridge_sticky(const char *val, int d, int s, const struct afswtch *afp) +setbridge_sticky(if_ctx *ctx, const char *val, int dummy __unused) { - do_bridgeflag(s, val, IFBIF_STICKY, 1); + do_bridgeflag(ctx->io_s, val, IFBIF_STICKY, 1); } static void -unsetbridge_sticky(const char *val, int d, int s, const struct afswtch *afp) +unsetbridge_sticky(if_ctx *ctx, const char *val, int dummy __unused) { - do_bridgeflag(s, val, IFBIF_STICKY, 0); + do_bridgeflag(ctx->io_s, val, IFBIF_STICKY, 0); } static void -setbridge_span(const char *val, int d, int s, const struct afswtch *afp) +setbridge_span(if_ctx *ctx, const char *val, int dummy __unused) { struct ifbreq req; memset(&req, 0, sizeof(req)); strlcpy(req.ifbr_ifsname, val, sizeof(req.ifbr_ifsname)); - if (do_cmd(s, BRDGADDS, &req, sizeof(req), 1) < 0) + if (do_cmd(ctx->io_s, BRDGADDS, &req, sizeof(req), 1) < 0) err(1, "BRDGADDS %s", val); } static void -unsetbridge_span(const char *val, int d, int s, const struct afswtch *afp) +unsetbridge_span(if_ctx *ctx, const char *val, int dummy __unused) { struct ifbreq req; memset(&req, 0, sizeof(req)); strlcpy(req.ifbr_ifsname, val, sizeof(req.ifbr_ifsname)); - if (do_cmd(s, BRDGDELS, &req, sizeof(req), 1) < 0) + if (do_cmd(ctx->io_s, BRDGDELS, &req, sizeof(req), 1) < 0) err(1, "BRDGDELS %s", val); } static void -setbridge_stp(const char *val, int d, int s, const struct afswtch *afp) +setbridge_stp(if_ctx *ctx, const char *val, int dummy __unused) { - do_bridgeflag(s, val, IFBIF_STP, 1); + do_bridgeflag(ctx->io_s, val, IFBIF_STP, 1); } static void -unsetbridge_stp(const char *val, int d, int s, const struct afswtch *afp) +unsetbridge_stp(if_ctx *ctx, const char *val, int dummy __unused) { - do_bridgeflag(s, val, IFBIF_STP, 0); + do_bridgeflag(ctx->io_s, val, IFBIF_STP, 0); } static void -setbridge_edge(const char *val, int d, int s, const struct afswtch *afp) +setbridge_edge(if_ctx *ctx, const char *val, int dummy __unused) { - do_bridgeflag(s, val, IFBIF_BSTP_EDGE, 1); + do_bridgeflag(ctx->io_s, val, IFBIF_BSTP_EDGE, 1); } static void -unsetbridge_edge(const char *val, int d, int s, const struct afswtch *afp) +unsetbridge_edge(if_ctx *ctx, const char *val, int dummy __unused) { - do_bridgeflag(s, val, IFBIF_BSTP_EDGE, 0); + do_bridgeflag(ctx->io_s, val, IFBIF_BSTP_EDGE, 0); } static void -setbridge_autoedge(const char *val, int d, int s, const struct afswtch *afp) +setbridge_autoedge(if_ctx *ctx, const char *val, int dummy __unused) { - do_bridgeflag(s, val, IFBIF_BSTP_AUTOEDGE, 1); + do_bridgeflag(ctx->io_s, val, IFBIF_BSTP_AUTOEDGE, 1); } static void -unsetbridge_autoedge(const char *val, int d, int s, const struct afswtch *afp) +unsetbridge_autoedge(if_ctx *ctx, const char *val, int dummy __unused) { - do_bridgeflag(s, val, IFBIF_BSTP_AUTOEDGE, 0); + do_bridgeflag(ctx->io_s, val, IFBIF_BSTP_AUTOEDGE, 0); } static void -setbridge_ptp(const char *val, int d, int s, const struct afswtch *afp) +setbridge_ptp(if_ctx *ctx, const char *val, int dummy __unused) { - do_bridgeflag(s, val, IFBIF_BSTP_PTP, 1); + do_bridgeflag(ctx->io_s, val, IFBIF_BSTP_PTP, 1); } static void -unsetbridge_ptp(const char *val, int d, int s, const struct afswtch *afp) +unsetbridge_ptp(if_ctx *ctx, const char *val, int dummy __unused) { - do_bridgeflag(s, val, IFBIF_BSTP_PTP, 0); + do_bridgeflag(ctx->io_s, val, IFBIF_BSTP_PTP, 0); } static void -setbridge_autoptp(const char *val, int d, int s, const struct afswtch *afp) +setbridge_autoptp(if_ctx *ctx, const char *val, int dummy __unused) { - do_bridgeflag(s, val, IFBIF_BSTP_AUTOPTP, 1); + do_bridgeflag(ctx->io_s, val, IFBIF_BSTP_AUTOPTP, 1); } static void -unsetbridge_autoptp(const char *val, int d, int s, const struct afswtch *afp) +unsetbridge_autoptp(if_ctx *ctx, const char *val, int dummy __unused) { - do_bridgeflag(s, val, IFBIF_BSTP_AUTOPTP, 0); + do_bridgeflag(ctx->io_s, val, IFBIF_BSTP_AUTOPTP, 0); } static void -setbridge_flush(const char *val, int d, int s, const struct afswtch *afp) +setbridge_flush(if_ctx *ctx, const char *val, int dummy __unused) { struct ifbreq req; memset(&req, 0, sizeof(req)); req.ifbr_ifsflags = IFBF_FLUSHDYN; - if (do_cmd(s, BRDGFLUSH, &req, sizeof(req), 1) < 0) + if (do_cmd(ctx->io_s, BRDGFLUSH, &req, sizeof(req), 1) < 0) err(1, "BRDGFLUSH"); } static void -setbridge_flushall(const char *val, int d, int s, const struct afswtch *afp) +setbridge_flushall(if_ctx *ctx, const char *val, int dummy __unused) { struct ifbreq req; memset(&req, 0, sizeof(req)); req.ifbr_ifsflags = IFBF_FLUSHALL; - if (do_cmd(s, BRDGFLUSH, &req, sizeof(req), 1) < 0) + if (do_cmd(ctx->io_s, BRDGFLUSH, &req, sizeof(req), 1) < 0) err(1, "BRDGFLUSH"); } static void -setbridge_static(const char *val, const char *mac, int s, - const struct afswtch *afp) +setbridge_static(if_ctx *ctx, const char *val, const char *mac) { struct ifbareq req; struct ether_addr *ea; @@ -412,12 +411,12 @@ setbridge_static(const char *val, const char *mac, int s, req.ifba_flags = IFBAF_STATIC; req.ifba_vlan = 1; /* XXX allow user to specify */ - if (do_cmd(s, BRDGSADDR, &req, sizeof(req), 1) < 0) + if (do_cmd(ctx->io_s, BRDGSADDR, &req, sizeof(req), 1) < 0) err(1, "BRDGSADDR %s", val); } static void -setbridge_deladdr(const char *val, int d, int s, const struct afswtch *afp) +setbridge_deladdr(if_ctx *ctx, const char *val, int dummy __unused) { struct ifbareq req; struct ether_addr *ea; @@ -430,19 +429,19 @@ setbridge_deladdr(const char *val, int d, int s, const struct afswtch *afp) memcpy(req.ifba_dst, ea->octet, sizeof(req.ifba_dst)); - if (do_cmd(s, BRDGDADDR, &req, sizeof(req), 1) < 0) + if (do_cmd(ctx->io_s, BRDGDADDR, &req, sizeof(req), 1) < 0) err(1, "BRDGDADDR %s", val); } static void -setbridge_addr(const char *val, int d, int s, const struct afswtch *afp) +setbridge_addr(if_ctx *ctx, const char *val, int dummy __unused) { - bridge_addresses(s, ""); + bridge_addresses(ctx->io_s, ""); } static void -setbridge_maxaddr(const char *arg, int d, int s, const struct afswtch *afp) +setbridge_maxaddr(if_ctx *ctx, const char *arg, int dummy __unused) { struct ifbrparam param; u_long val; @@ -452,12 +451,12 @@ setbridge_maxaddr(const char *arg, int d, int s, const struct afswtch *afp) param.ifbrp_csize = val & 0xffffffff; - if (do_cmd(s, BRDGSCACHE, ¶m, sizeof(param), 1) < 0) + if (do_cmd(ctx->io_s, BRDGSCACHE, ¶m, sizeof(param), 1) < 0) err(1, "BRDGSCACHE %s", arg); } static void -setbridge_hellotime(const char *arg, int d, int s, const struct afswtch *afp) +setbridge_hellotime(if_ctx *ctx, const char *arg, int dummy __unused) { struct ifbrparam param; u_long val; @@ -467,12 +466,12 @@ setbridge_hellotime(const char *arg, int d, int s, const struct afswtch *afp) param.ifbrp_hellotime = val & 0xff; - if (do_cmd(s, BRDGSHT, ¶m, sizeof(param), 1) < 0) + if (do_cmd(ctx->io_s, BRDGSHT, ¶m, sizeof(param), 1) < 0) err(1, "BRDGSHT %s", arg); } static void -setbridge_fwddelay(const char *arg, int d, int s, const struct afswtch *afp) +setbridge_fwddelay(if_ctx *ctx, const char *arg, int dummy __unused) { struct ifbrparam param; u_long val; @@ -482,12 +481,12 @@ setbridge_fwddelay(const char *arg, int d, int s, const struct afswtch *afp) param.ifbrp_fwddelay = val & 0xff; - if (do_cmd(s, BRDGSFD, ¶m, sizeof(param), 1) < 0) + if (do_cmd(ctx->io_s, BRDGSFD, ¶m, sizeof(param), 1) < 0) err(1, "BRDGSFD %s", arg); } static void -setbridge_maxage(const char *arg, int d, int s, const struct afswtch *afp) +setbridge_maxage(if_ctx *ctx, const char *arg, int dummy __unused) { struct ifbrparam param; u_long val; @@ -497,12 +496,12 @@ setbridge_maxage(const char *arg, int d, int s, const struct afswtch *afp) param.ifbrp_maxage = val & 0xff; - if (do_cmd(s, BRDGSMA, ¶m, sizeof(param), 1) < 0) + if (do_cmd(ctx->io_s, BRDGSMA, ¶m, sizeof(param), 1) < 0) err(1, "BRDGSMA %s", arg); } static void -setbridge_priority(const char *arg, int d, int s, const struct afswtch *afp) +setbridge_priority(if_ctx *ctx, const char *arg, int dummy __unused) { struct ifbrparam param; u_long val; @@ -512,12 +511,12 @@ setbridge_priority(const char *arg, int d, int s, const struct afswtch *afp) param.ifbrp_prio = val & 0xffff; - if (do_cmd(s, BRDGSPRI, ¶m, sizeof(param), 1) < 0) + if (do_cmd(ctx->io_s, BRDGSPRI, ¶m, sizeof(param), 1) < 0) err(1, "BRDGSPRI %s", arg); } static void -setbridge_protocol(const char *arg, int d, int s, const struct afswtch *afp) +setbridge_protocol(if_ctx *ctx, const char *arg, int dummy __unused) { struct ifbrparam param; @@ -529,12 +528,12 @@ setbridge_protocol(const char *arg, int d, int s, const struct afswtch *afp) errx(1, "unknown stp protocol"); } - if (do_cmd(s, BRDGSPROTO, ¶m, sizeof(param), 1) < 0) + if (do_cmd(ctx->io_s, BRDGSPROTO, ¶m, sizeof(param), 1) < 0) err(1, "BRDGSPROTO %s", arg); } static void -setbridge_holdcount(const char *arg, int d, int s, const struct afswtch *afp) +setbridge_holdcount(if_ctx *ctx, const char *arg, int dummy __unused) { struct ifbrparam param; u_long val; @@ -544,13 +543,12 @@ setbridge_holdcount(const char *arg, int d, int s, const struct afswtch *afp) param.ifbrp_txhc = val & 0xff; - if (do_cmd(s, BRDGSTXHC, ¶m, sizeof(param), 1) < 0) + if (do_cmd(ctx->io_s, BRDGSTXHC, ¶m, sizeof(param), 1) < 0) err(1, "BRDGSTXHC %s", arg); } static void -setbridge_ifpriority(const char *ifn, const char *pri, int s, - const struct afswtch *afp) +setbridge_ifpriority(if_ctx *ctx, const char *ifn, const char *pri) { struct ifbreq req; u_long val; @@ -563,13 +561,12 @@ setbridge_ifpriority(const char *ifn, const char *pri, int s, strlcpy(req.ifbr_ifsname, ifn, sizeof(req.ifbr_ifsname)); req.ifbr_priority = val & 0xff; - if (do_cmd(s, BRDGSIFPRIO, &req, sizeof(req), 1) < 0) + if (do_cmd(ctx->io_s, BRDGSIFPRIO, &req, sizeof(req), 1) < 0) err(1, "BRDGSIFPRIO %s", pri); } static void -setbridge_ifpathcost(const char *ifn, const char *cost, int s, - const struct afswtch *afp) +setbridge_ifpathcost(if_ctx *ctx, const char *ifn, const char *cost) { struct ifbreq req; u_long val; @@ -582,13 +579,12 @@ setbridge_ifpathcost(const char *ifn, const char *cost, int s, strlcpy(req.ifbr_ifsname, ifn, sizeof(req.ifbr_ifsname)); req.ifbr_path_cost = val; - if (do_cmd(s, BRDGSIFCOST, &req, sizeof(req), 1) < 0) + if (do_cmd(ctx->io_s, BRDGSIFCOST, &req, sizeof(req), 1) < 0) err(1, "BRDGSIFCOST %s", cost); } static void -setbridge_ifmaxaddr(const char *ifn, const char *arg, int s, - const struct afswtch *afp) +setbridge_ifmaxaddr(if_ctx *ctx, const char *ifn, const char *arg) { struct ifbreq req; u_long val; @@ -601,12 +597,12 @@ setbridge_ifmaxaddr(const char *ifn, const char *arg, int s, strlcpy(req.ifbr_ifsname, ifn, sizeof(req.ifbr_ifsname)); req.ifbr_addrmax = val & 0xffffffff; - if (do_cmd(s, BRDGSIFAMAX, &req, sizeof(req), 1) < 0) + if (do_cmd(ctx->io_s, BRDGSIFAMAX, &req, sizeof(req), 1) < 0) err(1, "BRDGSIFAMAX %s", arg); } static void -setbridge_timeout(const char *arg, int d, int s, const struct afswtch *afp) +setbridge_timeout(if_ctx *ctx, const char *arg, int dummy __unused) { struct ifbrparam param; u_long val; @@ -616,22 +612,22 @@ setbridge_timeout(const char *arg, int d, int s, const struct afswtch *afp) param.ifbrp_ctime = val & 0xffffffff; - if (do_cmd(s, BRDGSTO, ¶m, sizeof(param), 1) < 0) + if (do_cmd(ctx->io_s, BRDGSTO, ¶m, sizeof(param), 1) < 0) err(1, "BRDGSTO %s", arg); } static void -setbridge_private(const char *val, int d, int s, const struct afswtch *afp) +setbridge_private(if_ctx *ctx, const char *val, int dummy __unused) { - do_bridgeflag(s, val, IFBIF_PRIVATE, 1); + do_bridgeflag(ctx->io_s, val, IFBIF_PRIVATE, 1); } static void -unsetbridge_private(const char *val, int d, int s, const struct afswtch *afp) +unsetbridge_private(if_ctx *ctx, const char *val, int dummy __unused) { - do_bridgeflag(s, val, IFBIF_PRIVATE, 0); + do_bridgeflag(ctx->io_s, val, IFBIF_PRIVATE, 0); } static struct cmd bridge_cmds[] = { diff --git a/sbin/ifconfig/ifclone.c b/sbin/ifconfig/ifclone.c index 9cacff239967..0894366bb185 100644 --- a/sbin/ifconfig/ifclone.c +++ b/sbin/ifconfig/ifclone.c @@ -160,17 +160,17 @@ ifclonecreate(int s, void *arg) } } -static -DECL_CMD_FUNC(clone_create, arg, d) +static void +clone_create(if_ctx *ctx __unused, const char *cmd __unused, int d __unused) { callback_register(ifclonecreate, NULL); } -static -DECL_CMD_FUNC(clone_destroy, arg, d) +static void +clone_destroy(if_ctx *ctx, const char *cmd __unused, int d __unused) { - (void) strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); - if (ioctl(s, SIOCIFDESTROY, &ifr) < 0) + strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); + if (ioctl(ctx->io_s, SIOCIFDESTROY, &ifr) < 0) err(1, "SIOCIFDESTROY"); } diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index db275d877c00..ba14f84f7e7e 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -105,7 +105,7 @@ int newaddr = 1; int verbose; int printifname = 0; -struct ifconfig_args args; +struct ifconfig_args global_args; int printkeys = 0; /* Print keying material for interfaces. */ int exit_code = 0; @@ -569,6 +569,8 @@ main(int ac, char *av[]) #ifdef JAIL int jid; #endif + struct ifconfig_args *args = &global_args; + f_inet = f_inet6 = f_ether = f_addr = NULL; lifh = ifconfig_open(); @@ -585,11 +587,11 @@ main(int ac, char *av[]) *** 3308 LINES SKIPPED *** From nobody Wed May 24 10:59:22 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QR7VM0VCnz4CYcH; Wed, 24 May 2023 10:59: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 4QR7VM02xXz4HG4; Wed, 24 May 2023 10:59:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684925963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kCdNf9KSnph7blUKuBkTxmILJSGjoUzdxDUIfj7Lh+0=; b=NCWGSO7h5cJiinghkTu0zLfRRY+GeCJnFLKVspE69mnid3vxQn2Kxv+sX12AQPUIRHan2n w60/QjyYzj23z/EhQ4N3k37NWSmg6NXahHYFuzo1T/wSfGLkYV86pAzcXxzNm6wFOxm8hN sdE7NQE2tcRS1q9fz6o+mnsI7ZemOI3Y+sPp/Jp0dWKdmtKp+452AzXWSYob7ynyZfHus6 zUc8HNswN2x/YLDc3LV39uz0wJ/ocNrp/w4HiB9zh7I3qKCcGPyf2YqkaxpL3FE4CBo97v YOMPcizpWxVqeRY4U/8gxZ8qq3TlRgiBvheO6IUbDdSsxvEG5+3+eRntxPDJdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684925963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kCdNf9KSnph7blUKuBkTxmILJSGjoUzdxDUIfj7Lh+0=; b=CLiFRpd1IKjaMtcJi90HS0R0oE9iNskuutZSccHzV4UalPKBGG+k+WB9lEUC87bSfD+P8N TTZWYLuFri6yMSsZKZPn3GCJ8LxIua4eIgTTqNSDiQDSQIWDJBvzluiH2WhGlN4HBZETuI ADKt61Gh+XzzjaExsuVmqvQn+Ok0RfFimfV4+qxOhu3cufrIG7gtki4Z7AmFLO3djZlWoE HVYEIBUy6vjUOuTU0clwaCu+3q5kZJF5qz77sUSe+VJJYmxaVPf1PrZcvN5wv+dYOzFy84 d/7XfsPCI+gUhZ/AyT/3ScRXapw49jEiyAb0p3gyMRCZyeCEJJS1tOQivpoknQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684925963; a=rsa-sha256; cv=none; b=xJCclzYQNPPL6XbLfL1oS9RED7In9sImq6ZCivJWRd1LhxKvaeUoo6rlqKRHYPCbOvbU98 bgmk/l/GOIbFXrPy86wzsGtDJ5m/7FTr19n2NkSh9I48TF4exDCfSpPCu3Ck3bulgKJO60 yw/t9NunzLQx8LXF95G4OI1gDncm7FHl6gFN88j6ClMxz+vk3hjPIXgmH4+NjrQx9hRiJw TvvfHx38hbGKIluds9ByZq+IwY17xMiYxR1ctn2GC0cTenqWByQP7xeOzL0l8PwA2NtYEt 0AcP9BnKSmVSqNRN3DJUyTt/Y14HypejmxeDS3qRufTnwmcgDnUCw5l2eWDNNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QR7VL5z5Czg9Z; Wed, 24 May 2023 10:59: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 34OAxM4V042305; Wed, 24 May 2023 10:59:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34OAxM3p042304; Wed, 24 May 2023 10:59:22 GMT (envelope-from git) Date: Wed, 24 May 2023 10:59:22 GMT Message-Id: <202305241059.34OAxM3p042304@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 0f54e49d4b78 - main - arm64 pmap: introduce PTE_TO_PHYS macro List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0f54e49d4b7865dc99707106281d0454859f0916 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=0f54e49d4b7865dc99707106281d0454859f0916 commit 0f54e49d4b7865dc99707106281d0454859f0916 Author: Zachary Leaf AuthorDate: 2023-04-24 12:51:00 +0000 Commit: Andrew Turner CommitDate: 2023-05-24 10:55:38 +0000 arm64 pmap: introduce PTE_TO_PHYS macro Introduce macro for PTE_TO_PHYS, setting the groundwork for future support of various Arm VMSA extensions. For extensions such as 52-bit VA/PA (FEAT_LPA2), the representation of an address between a PTE and PA are not equivalent. This macro will allow converting between the different representations. Currently going from PTE to PA is achieved by masking off the upper and lower attributes. Retain this behaviour but replace all instances with the new macro instead. Reviewed by: alc, markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D39827 --- sys/arm64/arm64/efirt_machdep.c | 6 +- sys/arm64/arm64/minidump_machdep.c | 12 +-- sys/arm64/arm64/pmap.c | 149 +++++++++++++++++++------------------ sys/arm64/include/pte.h | 6 ++ 4 files changed, 90 insertions(+), 83 deletions(-) diff --git a/sys/arm64/arm64/efirt_machdep.c b/sys/arm64/arm64/efirt_machdep.c index 727c9c37f94d..c63cb016bf68 100644 --- a/sys/arm64/arm64/efirt_machdep.c +++ b/sys/arm64/arm64/efirt_machdep.c @@ -110,7 +110,7 @@ efi_1t1_l3(vm_offset_t va) mphys = VM_PAGE_TO_PHYS(m); *l0 = mphys | L0_TABLE; } else { - mphys = *l0 & ~ATTR_MASK; + mphys = PTE_TO_PHYS(*l0); } l1 = (pd_entry_t *)PHYS_TO_DMAP(mphys); @@ -121,7 +121,7 @@ efi_1t1_l3(vm_offset_t va) mphys = VM_PAGE_TO_PHYS(m); *l1 = mphys | L1_TABLE; } else { - mphys = *l1 & ~ATTR_MASK; + mphys = PTE_TO_PHYS(*l1); } l2 = (pd_entry_t *)PHYS_TO_DMAP(mphys); @@ -132,7 +132,7 @@ efi_1t1_l3(vm_offset_t va) mphys = VM_PAGE_TO_PHYS(m); *l2 = mphys | L2_TABLE; } else { - mphys = *l2 & ~ATTR_MASK; + mphys = PTE_TO_PHYS(*l2); } l3 = (pt_entry_t *)PHYS_TO_DMAP(mphys); diff --git a/sys/arm64/arm64/minidump_machdep.c b/sys/arm64/arm64/minidump_machdep.c index ee2b1be9b0b1..a82546a6381a 100644 --- a/sys/arm64/arm64/minidump_machdep.c +++ b/sys/arm64/arm64/minidump_machdep.c @@ -183,7 +183,7 @@ cpu_minidumpsys(struct dumperinfo *di, const struct minidumpstate *state) l1e = atomic_load_64(l1); l2e = atomic_load_64(l2); if ((l1e & ATTR_DESCR_MASK) == L1_BLOCK) { - pa = l1e & ~ATTR_MASK; + pa = PTE_TO_PHYS(l1e); for (i = 0; i < Ln_ENTRIES * Ln_ENTRIES; i++, pa += PAGE_SIZE) if (vm_phys_is_dumpable(pa)) @@ -192,7 +192,7 @@ cpu_minidumpsys(struct dumperinfo *di, const struct minidumpstate *state) pmapsize += (Ln_ENTRIES - 1) * PAGE_SIZE; va += L1_SIZE - L2_SIZE; } else if ((l2e & ATTR_DESCR_MASK) == L2_BLOCK) { - pa = l2e & ~ATTR_MASK; + pa = PTE_TO_PHYS(l2e); for (i = 0; i < Ln_ENTRIES; i++, pa += PAGE_SIZE) { if (vm_phys_is_dumpable(pa)) vm_page_dump_add(state->dump_bitset, @@ -203,7 +203,7 @@ cpu_minidumpsys(struct dumperinfo *di, const struct minidumpstate *state) l3e = atomic_load_64(&l3[i]); if ((l3e & ATTR_DESCR_MASK) != L3_PAGE) continue; - pa = l3e & ~ATTR_MASK; + pa = PTE_TO_PHYS(l3e); if (PHYS_IN_DMAP(pa) && vm_phys_is_dumpable(pa)) vm_page_dump_add(state->dump_bitset, pa); @@ -306,7 +306,7 @@ cpu_minidumpsys(struct dumperinfo *di, const struct minidumpstate *state) * Handle a 1GB block mapping: write out 512 fake L2 * pages. */ - pa = (l1e & ~ATTR_MASK) | (va & L1_OFFSET); + pa = PTE_TO_PHYS(l1e) | (va & L1_OFFSET); for (i = 0; i < Ln_ENTRIES; i++) { for (j = 0; j < Ln_ENTRIES; j++) { @@ -326,7 +326,7 @@ cpu_minidumpsys(struct dumperinfo *di, const struct minidumpstate *state) bzero(&tmpbuffer, sizeof(tmpbuffer)); va += L1_SIZE - L2_SIZE; } else if ((l2e & ATTR_DESCR_MASK) == L2_BLOCK) { - pa = (l2e & ~ATTR_MASK) | (va & L2_OFFSET); + pa = PTE_TO_PHYS(l2e) | (va & L2_OFFSET); /* Generate fake l3 entries based upon the l1 entry */ for (i = 0; i < Ln_ENTRIES; i++) { @@ -343,7 +343,7 @@ cpu_minidumpsys(struct dumperinfo *di, const struct minidumpstate *state) bzero(&tmpbuffer, sizeof(tmpbuffer)); continue; } else { - pa = l2e & ~ATTR_MASK; + pa = PTE_TO_PHYS(l2e); /* * We always write a page, even if it is zero. If pa diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 69073c5c56db..521b173c612b 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -519,7 +519,7 @@ pmap_l0_to_l1(pd_entry_t *l0, vm_offset_t va) { pd_entry_t *l1; - l1 = (pd_entry_t *)PHYS_TO_DMAP(pmap_load(l0) & ~ATTR_MASK); + l1 = (pd_entry_t *)PHYS_TO_DMAP(PTE_TO_PHYS(pmap_load(l0))); return (&l1[pmap_l1_index(va)]); } @@ -552,7 +552,7 @@ pmap_l1_to_l2(pd_entry_t *l1p, vm_offset_t va) ("%s: L1 entry %#lx for %#lx is invalid", __func__, l1, va)); KASSERT((l1 & ATTR_DESCR_TYPE_MASK) == ATTR_DESCR_TYPE_TABLE, ("%s: L1 entry %#lx for %#lx is a leaf", __func__, l1, va)); - l2p = (pd_entry_t *)PHYS_TO_DMAP(l1 & ~ATTR_MASK); + l2p = (pd_entry_t *)PHYS_TO_DMAP(PTE_TO_PHYS(l1)); return (&l2p[pmap_l2_index(va)]); } @@ -586,7 +586,7 @@ pmap_l2_to_l3(pd_entry_t *l2p, vm_offset_t va) ("%s: L2 entry %#lx for %#lx is invalid", __func__, l2, va)); KASSERT((l2 & ATTR_DESCR_TYPE_MASK) == ATTR_DESCR_TYPE_TABLE, ("%s: L2 entry %#lx for %#lx is a leaf", __func__, l2, va)); - l3p = (pt_entry_t *)PHYS_TO_DMAP(l2 & ~ATTR_MASK); + l3p = (pt_entry_t *)PHYS_TO_DMAP(PTE_TO_PHYS(l2)); return (&l3p[pmap_l3_index(va)]); } @@ -948,7 +948,7 @@ pmap_bootstrap_l0_table(struct pmap_bootstrap_state *state) l0e = pagetable_l0_ttbr1[l0_slot]; if ((l0e & ATTR_DESCR_VALID) != 0) { MPASS((l0e & ATTR_DESCR_MASK) == L0_TABLE); - l1_pa = l0e & ~ATTR_MASK; + l1_pa = PTE_TO_PHYS(l0e); state->l1 = (pt_entry_t *)PHYS_TO_DMAP(l1_pa); return; } @@ -996,7 +996,7 @@ pmap_bootstrap_l1_table(struct pmap_bootstrap_state *state) l1e = state->l1[l1_slot]; if ((l1e & ATTR_DESCR_VALID) != 0) { MPASS((l1e & ATTR_DESCR_MASK) == L1_TABLE); - l2_pa = l1e & ~ATTR_MASK; + l2_pa = PTE_TO_PHYS(l1e); state->l2 = (pt_entry_t *)PHYS_TO_DMAP(l2_pa); return; } @@ -1040,7 +1040,7 @@ pmap_bootstrap_l2_table(struct pmap_bootstrap_state *state) l2e = state->l2[l2_slot]; if ((l2e & ATTR_DESCR_VALID) != 0) { MPASS((l2e & ATTR_DESCR_MASK) == L2_TABLE); - l3_pa = l2e & ~ATTR_MASK; + l3_pa = PTE_TO_PHYS(l2e); state->l3 = (pt_entry_t *)PHYS_TO_DMAP(l3_pa); return; } @@ -1792,7 +1792,7 @@ pmap_extract(pmap_t pmap, vm_offset_t va) pte = pmap_pte(pmap, va, &lvl); if (pte != NULL) { tpte = pmap_load(pte); - pa = tpte & ~ATTR_MASK; + pa = PTE_TO_PHYS(tpte); switch(lvl) { case 1: PMAP_ASSERT_L1_BLOCKS_SUPPORTED; @@ -1875,7 +1875,7 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot) default: off = 0; } - m = PHYS_TO_VM_PAGE((tpte & ~ATTR_MASK) | off); + m = PHYS_TO_VM_PAGE(PTE_TO_PHYS(tpte) | off); if (m != NULL && !vm_page_wire_mapped(m)) m = NULL; } @@ -1935,7 +1935,7 @@ pmap_klookup(vm_offset_t va, vm_paddr_t *pa) return (false); if ((tpte & ATTR_DESCR_TYPE_MASK) == ATTR_DESCR_TYPE_BLOCK) { if (pa != NULL) - *pa = (tpte & ~ATTR_MASK) | (va & L1_OFFSET); + *pa = PTE_TO_PHYS(tpte) | (va & L1_OFFSET); return (true); } pte = pmap_l1_to_l2(&tpte, va); @@ -1944,7 +1944,7 @@ pmap_klookup(vm_offset_t va, vm_paddr_t *pa) return (false); if ((tpte & ATTR_DESCR_TYPE_MASK) == ATTR_DESCR_TYPE_BLOCK) { if (pa != NULL) - *pa = (tpte & ~ATTR_MASK) | (va & L2_OFFSET); + *pa = PTE_TO_PHYS(tpte) | (va & L2_OFFSET); return (true); } pte = pmap_l2_to_l3(&tpte, va); @@ -1952,7 +1952,7 @@ pmap_klookup(vm_offset_t va, vm_paddr_t *pa) if (tpte == 0) return (false); if (pa != NULL) - *pa = (tpte & ~ATTR_MASK) | (va & L3_OFFSET); + *pa = PTE_TO_PHYS(tpte) | (va & L3_OFFSET); return (true); } @@ -2204,7 +2204,7 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free) l1 = pmap_l1(pmap, va); tl1 = pmap_load(l1); - l2pg = PHYS_TO_VM_PAGE(tl1 & ~ATTR_MASK); + l2pg = PHYS_TO_VM_PAGE(PTE_TO_PHYS(tl1)); pmap_unwire_l3(pmap, va, l2pg, free); } else if (m->pindex < (NUL2E + NUL1E)) { /* We just released an l2, unhold the matching l1 */ @@ -2213,7 +2213,7 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free) l0 = pmap_l0(pmap, va); tl0 = pmap_load(l0); - l1pg = PHYS_TO_VM_PAGE(tl0 & ~ATTR_MASK); + l1pg = PHYS_TO_VM_PAGE(PTE_TO_PHYS(tl0)); pmap_unwire_l3(pmap, va, l1pg, free); } pmap_invalidate_page(pmap, va, false); @@ -2240,7 +2240,7 @@ pmap_unuse_pt(pmap_t pmap, vm_offset_t va, pd_entry_t ptepde, if (ADDR_IS_KERNEL(va)) return (0); KASSERT(ptepde != 0, ("pmap_unuse_pt: ptepde != 0")); - mpte = PHYS_TO_VM_PAGE(ptepde & ~ATTR_MASK); + mpte = PHYS_TO_VM_PAGE(PTE_TO_PHYS(ptepde)); return (pmap_unwire_l3(pmap, va, mpte, free)); } @@ -2425,11 +2425,11 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp) return (NULL); } } else { - l1pg = PHYS_TO_VM_PAGE(tl0 & ~ATTR_MASK); + l1pg = PHYS_TO_VM_PAGE(PTE_TO_PHYS(tl0)); l1pg->ref_count++; } - l1 = (pd_entry_t *)PHYS_TO_DMAP(pmap_load(l0) & ~ATTR_MASK); + l1 = (pd_entry_t *)PHYS_TO_DMAP(PTE_TO_PHYS(pmap_load(l0))); l1 = &l1[ptepindex & Ln_ADDR_MASK]; KASSERT((pmap_load(l1) & ATTR_DESCR_VALID) == 0, ("%s: L1 entry %#lx is valid", __func__, pmap_load(l1))); @@ -2453,10 +2453,10 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp) return (NULL); } tl0 = pmap_load(l0); - l1 = (pd_entry_t *)PHYS_TO_DMAP(tl0 & ~ATTR_MASK); + l1 = (pd_entry_t *)PHYS_TO_DMAP(PTE_TO_PHYS(tl0)); l1 = &l1[l1index & Ln_ADDR_MASK]; } else { - l1 = (pd_entry_t *)PHYS_TO_DMAP(tl0 & ~ATTR_MASK); + l1 = (pd_entry_t *)PHYS_TO_DMAP(PTE_TO_PHYS(tl0)); l1 = &l1[l1index & Ln_ADDR_MASK]; tl1 = pmap_load(l1); if (tl1 == 0) { @@ -2468,12 +2468,12 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp) return (NULL); } } else { - l2pg = PHYS_TO_VM_PAGE(tl1 & ~ATTR_MASK); + l2pg = PHYS_TO_VM_PAGE(PTE_TO_PHYS(tl1)); l2pg->ref_count++; } } - l2 = (pd_entry_t *)PHYS_TO_DMAP(pmap_load(l1) & ~ATTR_MASK); + l2 = (pd_entry_t *)PHYS_TO_DMAP(PTE_TO_PHYS(pmap_load(l1))); l2 = &l2[ptepindex & Ln_ADDR_MASK]; KASSERT((pmap_load(l2) & ATTR_DESCR_VALID) == 0, ("%s: L2 entry %#lx is valid", __func__, pmap_load(l2))); @@ -2502,7 +2502,7 @@ retry: l2 = pmap_l1_to_l2(l1, va); if (!ADDR_IS_KERNEL(va)) { /* Add a reference to the L2 page. */ - l2pg = PHYS_TO_VM_PAGE(pmap_load(l1) & ~ATTR_MASK); + l2pg = PHYS_TO_VM_PAGE(PTE_TO_PHYS(pmap_load(l1))); l2pg->ref_count++; } else l2pg = NULL; @@ -2571,7 +2571,7 @@ retry: case 2: tpde = pmap_load(pde); if (tpde != 0) { - m = PHYS_TO_VM_PAGE(tpde & ~ATTR_MASK); + m = PHYS_TO_VM_PAGE(PTE_TO_PHYS(tpde)); m->ref_count++; return (m); } @@ -2884,7 +2884,7 @@ reclaim_pv_chunk_domain(pmap_t locked_pmap, struct rwlock **lockp, int domain) if ((tpte & ATTR_SW_WIRED) != 0) continue; tpte = pmap_load_clear(pte); - m = PHYS_TO_VM_PAGE(tpte & ~ATTR_MASK); + m = PHYS_TO_VM_PAGE(PTE_TO_PHYS(tpte)); if (pmap_pte_dirty(pmap, tpte)) vm_page_dirty(m); if ((tpte & ATTR_AF) != 0) { @@ -3357,7 +3357,7 @@ pmap_pv_insert_l2(pmap_t pmap, vm_offset_t va, pd_entry_t l2e, u_int flags, NULL : lockp)) == NULL) return (false); pv->pv_va = va; - pa = l2e & ~ATTR_MASK; + pa = PTE_TO_PHYS(l2e); CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa); pvh = pa_to_pvh(pa); TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next); @@ -3426,9 +3426,9 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, pmap->pm_stats.wired_count -= L2_SIZE / PAGE_SIZE; pmap_resident_count_dec(pmap, L2_SIZE / PAGE_SIZE); if (old_l2 & ATTR_SW_MANAGED) { - m = PHYS_TO_VM_PAGE(old_l2 & ~ATTR_MASK); + m = PHYS_TO_VM_PAGE(PTE_TO_PHYS(old_l2)); pvh = page_to_pvh(m); - CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, old_l2 & ~ATTR_MASK); + CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, PTE_TO_PHYS(old_l2)); pmap_pvh_free(pvh, pmap, sva); for (mt = m; mt < &m[L2_SIZE / PAGE_SIZE]; mt++) { if (pmap_pte_dirty(pmap, old_l2)) @@ -3475,7 +3475,7 @@ pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_t va, pmap->pm_stats.wired_count -= 1; pmap_resident_count_dec(pmap, 1); if (old_l3 & ATTR_SW_MANAGED) { - m = PHYS_TO_VM_PAGE(old_l3 & ~ATTR_MASK); + m = PHYS_TO_VM_PAGE(PTE_TO_PHYS(old_l3)); if (pmap_pte_dirty(pmap, old_l3)) vm_page_dirty(m); if (old_l3 & ATTR_AF) @@ -3514,7 +3514,7 @@ pmap_remove_l3_range(pmap_t pmap, pd_entry_t l2e, vm_offset_t sva, PMAP_LOCK_ASSERT(pmap, MA_OWNED); KASSERT(rounddown2(sva, L2_SIZE) + L2_SIZE == roundup2(eva, L2_SIZE), ("pmap_remove_l3_range: range crosses an L3 page table boundary")); - l3pg = !ADDR_IS_KERNEL(sva) ? PHYS_TO_VM_PAGE(l2e & ~ATTR_MASK) : NULL; + l3pg = !ADDR_IS_KERNEL(sva) ? PHYS_TO_VM_PAGE(PTE_TO_PHYS(l2e)) : NULL; va = eva; for (l3 = pmap_l2_to_l3(&l2e, sva); sva != eva; l3++, sva += L3_SIZE) { if (!pmap_l3_valid(pmap_load(l3))) { @@ -3529,7 +3529,7 @@ pmap_remove_l3_range(pmap_t pmap, pd_entry_t l2e, vm_offset_t sva, pmap->pm_stats.wired_count--; pmap_resident_count_dec(pmap, 1); if ((old_l3 & ATTR_SW_MANAGED) != 0) { - m = PHYS_TO_VM_PAGE(old_l3 & ~ATTR_MASK); + m = PHYS_TO_VM_PAGE(PTE_TO_PHYS(old_l3)); if (pmap_pte_dirty(pmap, old_l3)) vm_page_dirty(m); if ((old_l3 & ATTR_AF) != 0) @@ -3831,7 +3831,7 @@ pmap_protect_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, pt_entry_t mask, if ((old_l2 & ATTR_SW_MANAGED) != 0 && (nbits & ATTR_S1_AP(ATTR_S1_AP_RO)) != 0 && pmap_pte_dirty(pmap, old_l2)) { - m = PHYS_TO_VM_PAGE(old_l2 & ~ATTR_MASK); + m = PHYS_TO_VM_PAGE(PTE_TO_PHYS(old_l2)); for (mt = m; mt < &m[L2_SIZE / PAGE_SIZE]; mt++) vm_page_dirty(mt); } @@ -3941,7 +3941,7 @@ pmap_mask_set_locked(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, pt_entry_t m if ((l3 & ATTR_SW_MANAGED) != 0 && (nbits & ATTR_S1_AP(ATTR_S1_AP_RO)) != 0 && pmap_pte_dirty(pmap, l3)) - vm_page_dirty(PHYS_TO_VM_PAGE(l3 & ~ATTR_MASK)); + vm_page_dirty(PHYS_TO_VM_PAGE(PTE_TO_PHYS(l3))); if (va == va_next) va = sva; @@ -4137,14 +4137,15 @@ pmap_promote_l2(pmap_t pmap, pd_entry_t *l2, vm_offset_t va, vm_page_t mpte, /* * Examine the first L3E in the specified PTP. Abort if this L3E is - * ineligible for promotion, invalid, or does not map the first 4KB - * physical page within a 2MB page. + * ineligible for promotion... */ - firstl3 = (pt_entry_t *)PHYS_TO_DMAP(pmap_load(l2) & ~ATTR_MASK); + firstl3 = (pt_entry_t *)PHYS_TO_DMAP(PTE_TO_PHYS(pmap_load(l2))); newl2 = pmap_load(firstl3); if ((newl2 & ATTR_SW_NO_PROMOTE) != 0) return; - if ((newl2 & ((~ATTR_MASK & L2_OFFSET) | ATTR_DESCR_MASK)) != L3_PAGE) { + /* ... is not the first physical page within an L2 block */ + if ((PTE_TO_PHYS(newl2) & L2_OFFSET) != 0 || + ((newl2 & ATTR_DESCR_MASK) != L3_PAGE)) { /* ... or is invalid */ atomic_add_long(&pmap_l2_p_failures, 1); CTR2(KTR_PMAP, "pmap_promote_l2: failure for va %#lx" " in pmap %p", va, pmap); @@ -4190,10 +4191,11 @@ setl2: * L3E maps an unexpected 4KB physical page or does not have identical * characteristics to the first L3E. */ - pa = (newl2 & (~ATTR_MASK | ATTR_DESCR_MASK)) + L2_SIZE - PAGE_SIZE; + pa = (PTE_TO_PHYS(newl2) | (newl2 & ATTR_DESCR_MASK)) + + L2_SIZE - PAGE_SIZE; for (l3 = firstl3 + NL3PG - 1; l3 > firstl3; l3--) { oldl3 = pmap_load(l3); - if ((oldl3 & (~ATTR_MASK | ATTR_DESCR_MASK)) != pa) { + if ((PTE_TO_PHYS(oldl3) | (oldl3 & ATTR_DESCR_MASK)) != pa) { atomic_add_long(&pmap_l2_p_failures, 1); CTR2(KTR_PMAP, "pmap_promote_l2: failure for va %#lx" " in pmap %p", va, pmap); @@ -4227,7 +4229,7 @@ setl3: * destroyed by pmap_remove_l3(). */ if (mpte == NULL) - mpte = PHYS_TO_VM_PAGE(pmap_load(l2) & ~ATTR_MASK); + mpte = PHYS_TO_VM_PAGE(PTE_TO_PHYS(pmap_load(l2))); KASSERT(mpte >= vm_page_array && mpte < &vm_page_array[vm_page_array_size], ("pmap_promote_l2: page table page is out of range")); @@ -4242,7 +4244,7 @@ setl3: } if ((newl2 & ATTR_SW_MANAGED) != 0) - pmap_pv_promote_l2(pmap, va, newl2 & ~ATTR_MASK, lockp); + pmap_pv_promote_l2(pmap, va, PTE_TO_PHYS(newl2), lockp); newl2 &= ~ATTR_DESCR_MASK; newl2 |= L2_BLOCK; @@ -4265,9 +4267,9 @@ pmap_enter_largepage(pmap_t pmap, vm_offset_t va, pt_entry_t newpte, int flags, PMAP_LOCK_ASSERT(pmap, MA_OWNED); KASSERT(psind > 0 && psind < MAXPAGESIZES, ("psind %d unexpected", psind)); - KASSERT(((newpte & ~ATTR_MASK) & (pagesizes[psind] - 1)) == 0, + KASSERT((PTE_TO_PHYS(newpte) & (pagesizes[psind] - 1)) == 0, ("unaligned phys address %#lx newpte %#lx psind %d", - (newpte & ~ATTR_MASK), newpte, psind)); + PTE_TO_PHYS(newpte), newpte, psind)); restart: if (psind == 2) { @@ -4292,12 +4294,12 @@ restart: KASSERT(l1p != NULL, ("va %#lx lost l1 entry", va)); origpte = pmap_load(l1p); if ((origpte & ATTR_DESCR_VALID) == 0) { - mp = PHYS_TO_VM_PAGE(pmap_load(l0p) & - ~ATTR_MASK); + mp = PHYS_TO_VM_PAGE( + PTE_TO_PHYS(pmap_load(l0p))); mp->ref_count++; } } - KASSERT(((origpte & ~ATTR_MASK) == (newpte & ~ATTR_MASK) && + KASSERT((PTE_TO_PHYS(origpte) == PTE_TO_PHYS(newpte) && (origpte & ATTR_DESCR_MASK) == L1_BLOCK) || (origpte & ATTR_DESCR_VALID) == 0, ("va %#lx changing 1G phys page l1 %#lx newpte %#lx", @@ -4322,14 +4324,14 @@ restart: l1p = pmap_l1(pmap, va); origpte = pmap_load(l2p); if ((origpte & ATTR_DESCR_VALID) == 0) { - mp = PHYS_TO_VM_PAGE(pmap_load(l1p) & - ~ATTR_MASK); + mp = PHYS_TO_VM_PAGE( + PTE_TO_PHYS(pmap_load(l1p))); mp->ref_count++; } } KASSERT((origpte & ATTR_DESCR_VALID) == 0 || ((origpte & ATTR_DESCR_MASK) == L2_BLOCK && - (origpte & ~ATTR_MASK) == (newpte & ~ATTR_MASK)), + PTE_TO_PHYS(origpte) == PTE_TO_PHYS(newpte)), ("va %#lx changing 2M phys page l2 %#lx newpte %#lx", va, origpte, newpte)); pmap_store(l2p, newpte); @@ -4456,7 +4458,7 @@ retry: if (pde != NULL && lvl == 2) { l3 = pmap_l2_to_l3(pde, va); if (!ADDR_IS_KERNEL(va) && mpte == NULL) { - mpte = PHYS_TO_VM_PAGE(pmap_load(pde) & ~ATTR_MASK); + mpte = PHYS_TO_VM_PAGE(PTE_TO_PHYS(pmap_load(pde))); mpte->ref_count++; } goto havel3; @@ -4467,7 +4469,7 @@ retry: l3 = &l3[pmap_l3_index(va)]; if (!ADDR_IS_KERNEL(va)) { mpte = PHYS_TO_VM_PAGE( - pmap_load(l2) & ~ATTR_MASK); + PTE_TO_PHYS(pmap_load(l2))); mpte->ref_count++; } goto havel3; @@ -4495,7 +4497,7 @@ retry: havel3: orig_l3 = pmap_load(l3); - opa = orig_l3 & ~ATTR_MASK; + opa = PTE_TO_PHYS(orig_l3); pv = NULL; /* @@ -4543,7 +4545,7 @@ havel3: * the mapping. */ orig_l3 = pmap_load_clear(l3); - KASSERT((orig_l3 & ~ATTR_MASK) == opa, + KASSERT(PTE_TO_PHYS(orig_l3) == opa, ("pmap_enter: unexpected pa update for %#lx", va)); if ((orig_l3 & ATTR_SW_MANAGED) != 0) { om = PHYS_TO_VM_PAGE(opa); @@ -4778,7 +4780,7 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t new_l2, u_int flags, " in pmap %p", va, pmap); return (KERN_NO_SPACE); } else if (!ADDR_IS_KERNEL(va) || - !pmap_every_pte_zero(old_l2 & ~ATTR_MASK)) { + !pmap_every_pte_zero(PTE_TO_PHYS(old_l2))) { if (l2pg != NULL) l2pg->ref_count--; CTR2(KTR_PMAP, @@ -4810,7 +4812,7 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t new_l2, u_int flags, * an invalidation at all levels after clearing * the L2_TABLE entry. */ - mt = PHYS_TO_VM_PAGE(pmap_load(l2) & ~ATTR_MASK); + mt = PHYS_TO_VM_PAGE(PTE_TO_PHYS(pmap_load(l2))); if (pmap_insert_pt_page(pmap, mt, false)) panic("pmap_enter_l2: trie insert failed"); pmap_clear(l2); @@ -4845,10 +4847,10 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t new_l2, u_int flags, /* * Conditionally sync the icache. See pmap_enter() for details. */ - if ((new_l2 & ATTR_S1_XN) == 0 && ((new_l2 & ~ATTR_MASK) != - (old_l2 & ~ATTR_MASK) || (old_l2 & ATTR_S1_XN) != 0) && + if ((new_l2 & ATTR_S1_XN) == 0 && (PTE_TO_PHYS(new_l2) != + PTE_TO_PHYS(old_l2) || (old_l2 & ATTR_S1_XN) != 0) && pmap != kernel_pmap && m->md.pv_memattr == VM_MEMATTR_WRITE_BACK) { - cpu_icache_sync_range(PHYS_TO_DMAP(new_l2 & ~ATTR_MASK), + cpu_icache_sync_range(PHYS_TO_DMAP(PTE_TO_PHYS(new_l2)), L2_SIZE); } @@ -4983,8 +4985,8 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, if ((pmap_load(l2) & ATTR_DESCR_MASK) == L2_BLOCK) return (NULL); - mpte = PHYS_TO_VM_PAGE(pmap_load(l2) & - ~ATTR_MASK); + mpte = PHYS_TO_VM_PAGE( + PTE_TO_PHYS(pmap_load(l2))); mpte->ref_count++; } else { mpte = _pmap_alloc_l3(pmap, l2pindex, @@ -5243,8 +5245,8 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t len, l1 = pmap_l1(dst_pmap, addr); } else { l0 = pmap_l0(dst_pmap, addr); - dst_m = PHYS_TO_VM_PAGE(pmap_load(l0) & - ~ATTR_MASK); + dst_m = PHYS_TO_VM_PAGE( + PTE_TO_PHYS(pmap_load(l0))); dst_m->ref_count++; } KASSERT(pmap_load(l1) == 0, @@ -5299,13 +5301,12 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t len, } KASSERT((srcptepaddr & ATTR_DESCR_MASK) == L2_TABLE, ("pmap_copy: invalid L2 entry")); - srcptepaddr &= ~ATTR_MASK; - srcmpte = PHYS_TO_VM_PAGE(srcptepaddr); + srcmpte = PHYS_TO_VM_PAGE(PTE_TO_PHYS(srcptepaddr)); KASSERT(srcmpte->ref_count > 0, ("pmap_copy: source page table page is unused")); if (va_next > end_addr) va_next = end_addr; - src_pte = (pt_entry_t *)PHYS_TO_DMAP(srcptepaddr); + src_pte = (pt_entry_t *)PHYS_TO_DMAP(PTE_TO_PHYS(srcptepaddr)); src_pte = &src_pte[pmap_l3_index(addr)]; dstmpte = NULL; for (; addr < va_next; addr += PAGE_SIZE, src_pte++) { @@ -5329,7 +5330,7 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t len, dst_pte = &dst_pte[pmap_l3_index(addr)]; if (pmap_load(dst_pte) == 0 && pmap_try_insert_pv_entry(dst_pmap, addr, - PHYS_TO_VM_PAGE(ptetemp & ~ATTR_MASK), &lock)) { + PHYS_TO_VM_PAGE(PTE_TO_PHYS(ptetemp)), &lock)) { /* * Clear the wired, modified, and accessed * (referenced) bits during the copy. @@ -5685,7 +5686,7 @@ pmap_remove_pages(pmap_t pmap) */ pmap_clear(pte); - pa = tpte & ~ATTR_MASK; + pa = PTE_TO_PHYS(tpte); m = PHYS_TO_VM_PAGE(pa); KASSERT(m->phys_addr == pa, @@ -6273,7 +6274,7 @@ pmap_advise(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, int advice) * can be avoided by making the page * dirty now. */ - m = PHYS_TO_VM_PAGE(oldl3 & ~ATTR_MASK); + m = PHYS_TO_VM_PAGE(PTE_TO_PHYS(oldl3)); vm_page_dirty(m); } while (!atomic_fcmpset_long(l3, &oldl3, @@ -6348,7 +6349,7 @@ restart: * Write protect the mapping to a single page so that * a subsequent write access may repromote. */ - va += VM_PAGE_TO_PHYS(m) - (oldl2 & ~ATTR_MASK); + va += VM_PAGE_TO_PHYS(m) - PTE_TO_PHYS(oldl2); l3 = pmap_l2_to_l3(l2, va); oldl3 = pmap_load(l3); while (!atomic_fcmpset_long(l3, &oldl3, @@ -6756,7 +6757,7 @@ pmap_change_props_locked(vm_offset_t va, vm_size_t size, vm_prot_t prot, pmap_update_entry(kernel_pmap, ptep, pte, tmpva, pte_size); - pa = pte & ~ATTR_MASK; + pa = PTE_TO_PHYS(pte); if (!VIRT_IN_DMAP(tmpva) && PHYS_IN_DMAP(pa)) { /* * Keep the DMAP memory in sync. @@ -6824,7 +6825,7 @@ pmap_demote_l1(pmap_t pmap, pt_entry_t *l1, vm_offset_t va) l2 = (pt_entry_t *)PHYS_TO_DMAP(l2phys); /* Address the range points at */ - phys = oldl1 & ~ATTR_MASK; + phys = PTE_TO_PHYS(oldl1); /* The attributed from the old l1 table to be copied */ newl2 = oldl1 & ATTR_MASK; @@ -7018,7 +7019,7 @@ pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_offset_t va, * Demote the PV entry. */ if ((oldl2 & ATTR_SW_MANAGED) != 0) - pmap_pv_demote_l2(pmap, va, oldl2 & ~ATTR_MASK, lockp); + pmap_pv_demote_l2(pmap, va, PTE_TO_PHYS(oldl2), lockp); atomic_add_long(&pmap_l2_demotions, 1); CTR3(KTR_PMAP, "pmap_demote_l2: success for va %#lx" @@ -7090,7 +7091,7 @@ pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t *pap) if ((tpte & ATTR_AF) == ATTR_AF) val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; - pa = (tpte & ~ATTR_MASK) | (addr & mask); + pa = PTE_TO_PHYS(tpte) | (addr & mask); } else { managed = false; val = 0; @@ -8018,7 +8019,7 @@ sysctl_kmaps(SYSCTL_HANDLER_ARGS) sva += L0_SIZE; continue; } - pa = l0e & ~ATTR_MASK; + pa = PTE_TO_PHYS(l0e); l1 = (pd_entry_t *)PHYS_TO_DMAP(pa); for (j = pmap_l1_index(sva); j < Ln_ENTRIES; j++) { @@ -8036,7 +8037,7 @@ sysctl_kmaps(SYSCTL_HANDLER_ARGS) sva += L1_SIZE; continue; } - pa = l1e & ~ATTR_MASK; + pa = PTE_TO_PHYS(l1e); l2 = (pd_entry_t *)PHYS_TO_DMAP(pa); for (k = pmap_l2_index(sva); k < Ln_ENTRIES; k++) { @@ -8053,7 +8054,7 @@ sysctl_kmaps(SYSCTL_HANDLER_ARGS) sva += L2_SIZE; continue; } - pa = l2e & ~ATTR_MASK; + pa = PTE_TO_PHYS(l2e); l3 = (pt_entry_t *)PHYS_TO_DMAP(pa); for (l = pmap_l3_index(sva); l < Ln_ENTRIES; diff --git a/sys/arm64/include/pte.h b/sys/arm64/include/pte.h index 24130f26cee1..7836759d17bc 100644 --- a/sys/arm64/include/pte.h +++ b/sys/arm64/include/pte.h @@ -51,6 +51,12 @@ typedef uint64_t pt_entry_t; /* page table entry */ #define ATTR_MASK_H UINT64_C(0xfffc000000000000) #define ATTR_MASK_L UINT64_C(0x0000000000000fff) #define ATTR_MASK (ATTR_MASK_H | ATTR_MASK_L) + +#define BASE_MASK ~ATTR_MASK +#define BASE_ADDR(x) ((x) & BASE_MASK) + +#define PTE_TO_PHYS(pte) BASE_ADDR(pte) + /* Bits 58:55 are reserved for software */ #define ATTR_SW_UNUSED1 (1UL << 58) #define ATTR_SW_NO_PROMOTE (1UL << 57) From nobody Wed May 24 10:59:23 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QR7VN1qQkz4CYHt; Wed, 24 May 2023 10:59: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 4QR7VN0rTFz4HNg; Wed, 24 May 2023 10:59:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684925964; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p3X3jCqbn9n2Zwot7z7/ZyLWkmJGCR3/u2ampcoWjpU=; b=R8DUngAx/jfOmkDi75l1JdkH+LzOeur77iJ4R9DEJKrXv5pUz/LevnTawKn+Ygeu4YmMIA QyM39+74/IkMb4VRAL3PITJN47oBMhsQ1/UbGBSkSj+g6X3sQ8EiwQyz8pLghT0j0jmoTK q5bbGEkepllWlYgXQeb08+OJlaSo/gpXUCNCN80nG9pUIkGm2XLoXjVA7+ugKylCcm1oT9 mkn13YTthsg04Jl7KRUIIL0PvtXIBZ+YHRp98kdAUZXS5h5EyVBTw3I9RkurxHVexHd2L+ DCwRCIPrUeCKQ2Kn8t9BWZLpY5ViwJcOEdrScscvKTciBVCLOCuJPwU8M9W1ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684925964; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p3X3jCqbn9n2Zwot7z7/ZyLWkmJGCR3/u2ampcoWjpU=; b=AQGQ8CTTpruKuBOvwjHArH7Wazm/ht9z6wLpddP3aULnBQxtYZCGc5jNlhHZ+Cc1ve8ujL EniSqpm4FbvvQ9FWztM/t1lWsr4T70pf9w5ifIPQYZ4l+9BaOQ+zeaCz13zmlC9jLndwyD RoYV7xEJyTqbabKBOt67w0wG2bvK+zxrqVCA2CNiK3I5uqf3N127nyykCtF1BYAAHGCTtb 4Zjky7MV3JcCHcmgNp2L91KFoYwEYLiJJ3yTgpwZhcCU+soBO4PErGczkbzPRbzWfsf8Ab 0g5Nkd9em3ix3UI46wUkg3ZYuMRtEM7qODTtoemf56RBPZZVhQ0YGEx8OzQ98A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684925964; a=rsa-sha256; cv=none; b=cd5PJWahLSh6Xiyfge5Bv1lRNCdWn7GGLWg815usbZf7TUdeacuWSPZslnaJuiXSgyA5c5 dI7VShkJEFV+caLOUpVhrn7btnK2to5voCTUyZluPkuCu/3EzjZ+IxhfJkfNDq7bMF1+TS JlkNJFTtkZHSZT5Jds2LUKuSEOys7UICQTKnYAl/uAR7Pwto01OH3jyRqdu+1qJs1IMae/ SJkYibf0kNJiXO1K4SjssIIK2oOgXSGzX/tQWYPkGhaGD7QTKEHomWZhsDT4KTKXzuTJAe 3SzUeIlm4tTH9oAiWaS+XN8QGqs3p0rdN5JI1Irm2r9LYexGSii3mh6UjAgGWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QR7VM6MSKzfhf; Wed, 24 May 2023 10:59: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 34OAxN4V042330; Wed, 24 May 2023 10:59:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34OAxNYk042329; Wed, 24 May 2023 10:59:23 GMT (envelope-from git) Date: Wed, 24 May 2023 10:59:23 GMT Message-Id: <202305241059.34OAxNYk042329@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 012ea67d2d17 - main - arm64 pmap: introduce PHYS_TO_PTE macro List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 012ea67d2d17bb47a52260db5190f86714b24c6f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=012ea67d2d17bb47a52260db5190f86714b24c6f commit 012ea67d2d17bb47a52260db5190f86714b24c6f Author: Zachary Leaf AuthorDate: 2023-04-26 11:10:00 +0000 Commit: Andrew Turner CommitDate: 2023-05-24 10:55:38 +0000 arm64 pmap: introduce PHYS_TO_PTE macro Introduce macro for PHYS_TO_PTE, setting the groundwork for future support of various Arm VMSA extensions. For extensions such as 52-bit VA/PA (FEAT_LPA2), the representation of an address between a PTE and PA are not equivalent. This macro will allow converting between the different representations. Currently PHYS_TO_PTE is a NOP. Replace all instances where we go from PA to PTE with new PHYS_TO_PTE macro. Reviewed by: markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D39828 --- sys/arm64/arm64/efirt_machdep.c | 6 ++-- sys/arm64/arm64/pmap.c | 73 +++++++++++++++++++++-------------------- sys/arm64/include/pte.h | 2 ++ 3 files changed, 43 insertions(+), 38 deletions(-) diff --git a/sys/arm64/arm64/efirt_machdep.c b/sys/arm64/arm64/efirt_machdep.c index c63cb016bf68..9f13dea5b698 100644 --- a/sys/arm64/arm64/efirt_machdep.c +++ b/sys/arm64/arm64/efirt_machdep.c @@ -108,7 +108,7 @@ efi_1t1_l3(vm_offset_t va) if (*l0 == 0) { m = efi_1t1_page(); mphys = VM_PAGE_TO_PHYS(m); - *l0 = mphys | L0_TABLE; + *l0 = PHYS_TO_PTE(mphys) | L0_TABLE; } else { mphys = PTE_TO_PHYS(*l0); } @@ -119,7 +119,7 @@ efi_1t1_l3(vm_offset_t va) if (*l1 == 0) { m = efi_1t1_page(); mphys = VM_PAGE_TO_PHYS(m); - *l1 = mphys | L1_TABLE; + *l1 = PHYS_TO_PTE(mphys) | L1_TABLE; } else { mphys = PTE_TO_PHYS(*l1); } @@ -130,7 +130,7 @@ efi_1t1_l3(vm_offset_t va) if (*l2 == 0) { m = efi_1t1_page(); mphys = VM_PAGE_TO_PHYS(m); - *l2 = mphys | L2_TABLE; + *l2 = PHYS_TO_PTE(mphys) | L2_TABLE; } else { mphys = PTE_TO_PHYS(*l2); } diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 521b173c612b..16e671295ca6 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -962,7 +962,7 @@ pmap_bootstrap_l0_table(struct pmap_bootstrap_state *state) l1_pa = pmap_early_vtophys((vm_offset_t)state->l1); MPASS((l1_pa & Ln_TABLE_MASK) == 0); MPASS(pagetable_l0_ttbr1[l0_slot] == 0); - pmap_store(&pagetable_l0_ttbr1[l0_slot], l1_pa | + pmap_store(&pagetable_l0_ttbr1[l0_slot], PHYS_TO_PTE(l1_pa) | TATTR_UXN_TABLE | TATTR_AP_TABLE_NO_EL0 | L0_TABLE); } KASSERT(state->l1 != NULL, ("%s: NULL l1", __func__)); @@ -1010,8 +1010,8 @@ pmap_bootstrap_l1_table(struct pmap_bootstrap_state *state) l2_pa = pmap_early_vtophys((vm_offset_t)state->l2); MPASS((l2_pa & Ln_TABLE_MASK) == 0); MPASS(state->l1[l1_slot] == 0); - pmap_store(&state->l1[l1_slot], l2_pa | state->table_attrs | - L1_TABLE); + pmap_store(&state->l1[l1_slot], PHYS_TO_PTE(l2_pa) | + state->table_attrs | L1_TABLE); } KASSERT(state->l2 != NULL, ("%s: NULL l2", __func__)); } @@ -1054,8 +1054,8 @@ pmap_bootstrap_l2_table(struct pmap_bootstrap_state *state) l3_pa = pmap_early_vtophys((vm_offset_t)state->l3); MPASS((l3_pa & Ln_TABLE_MASK) == 0); MPASS(state->l2[l2_slot] == 0); - pmap_store(&state->l2[l2_slot], l3_pa | state->table_attrs | - L2_TABLE); + pmap_store(&state->l2[l2_slot], PHYS_TO_PTE(l3_pa) | + state->table_attrs | L2_TABLE); } KASSERT(state->l3 != NULL, ("%s: NULL l3", __func__)); } @@ -1088,9 +1088,9 @@ pmap_bootstrap_l2_block(struct pmap_bootstrap_state *state, int i) l2_slot = pmap_l2_index(state->va); MPASS((state->pa & L2_OFFSET) == 0); MPASS(state->l2[l2_slot] == 0); - pmap_store(&state->l2[l2_slot], state->pa | ATTR_DEFAULT | - ATTR_S1_XN | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK) | - L2_BLOCK); + pmap_store(&state->l2[l2_slot], PHYS_TO_PTE(state->pa) | + ATTR_DEFAULT | ATTR_S1_XN | + ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK) | L2_BLOCK); } MPASS(state->va == (state->pa - dmap_phys_base + DMAP_MIN_ADDRESS)); } @@ -1123,9 +1123,9 @@ pmap_bootstrap_l3_page(struct pmap_bootstrap_state *state, int i) l3_slot = pmap_l3_index(state->va); MPASS((state->pa & L3_OFFSET) == 0); MPASS(state->l3[l3_slot] == 0); - pmap_store(&state->l3[l3_slot], state->pa | ATTR_DEFAULT | - ATTR_S1_XN | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK) | - L3_PAGE); + pmap_store(&state->l3[l3_slot], PHYS_TO_PTE(state->pa) | + ATTR_DEFAULT | ATTR_S1_XN | + ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK) | L3_PAGE); } MPASS(state->va == (state->pa - dmap_phys_base + DMAP_MIN_ADDRESS)); } @@ -1163,9 +1163,9 @@ pmap_bootstrap_dmap(vm_paddr_t min_pa) MPASS((bs_state.pa & L1_OFFSET) == 0); pmap_store( &bs_state.l1[pmap_l1_index(bs_state.va)], - bs_state.pa | ATTR_DEFAULT | ATTR_S1_XN | + PHYS_TO_PTE(bs_state.pa) | ATTR_DEFAULT | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK) | - L1_BLOCK); + ATTR_S1_XN | L1_BLOCK); } MPASS(bs_state.pa <= physmap[i + 1]); @@ -1241,7 +1241,7 @@ pmap_bootstrap_allocate_kasan_l2(vm_paddr_t start_pa, vm_paddr_t end_pa, continue; } - pmap_store(l2, pa | PMAP_SAN_PTE_BITS | L2_BLOCK); + pmap_store(l2, PHYS_TO_PTE(pa) | PMAP_SAN_PTE_BITS | L2_BLOCK); } /* @@ -1998,7 +1998,7 @@ pmap_kenter(vm_offset_t sva, vm_size_t size, vm_paddr_t pa, int mode) KASSERT(lvl == 2, ("pmap_kenter: Invalid level %d", lvl)); pte = pmap_l2_to_l3(pde, va); - pmap_load_store(pte, (pa & ~L3_OFFSET) | attr); + pmap_load_store(pte, PHYS_TO_PTE(pa) | attr); va += PAGE_SIZE; pa += PAGE_SIZE; @@ -2080,7 +2080,7 @@ void pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) { pd_entry_t *pde; - pt_entry_t *pte, pa; + pt_entry_t *pte, pa, attr; vm_offset_t va; vm_page_t m; int i, lvl; @@ -2094,11 +2094,11 @@ pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) ("pmap_qenter: Invalid level %d", lvl)); m = ma[i]; - pa = VM_PAGE_TO_PHYS(m) | ATTR_DEFAULT | - ATTR_S1_AP(ATTR_S1_AP_RW) | ATTR_S1_XN | + pa = VM_PAGE_TO_PHYS(m); + attr = ATTR_DEFAULT | ATTR_S1_AP(ATTR_S1_AP_RW) | ATTR_S1_XN | ATTR_S1_IDX(m->md.pv_memattr) | L3_PAGE; pte = pmap_l2_to_l3(pde, va); - pmap_load_store(pte, pa); + pmap_load_store(pte, PHYS_TO_PTE(pa) | attr); va += L3_SIZE; } @@ -2393,7 +2393,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp) l0p = &pmap->pm_l0[l0index]; KASSERT((pmap_load(l0p) & ATTR_DESCR_VALID) == 0, ("%s: L0 entry %#lx is valid", __func__, pmap_load(l0p))); - l0e = VM_PAGE_TO_PHYS(m) | L0_TABLE; + l0e = PHYS_TO_PTE(VM_PAGE_TO_PHYS(m)) | L0_TABLE; /* * Mark all kernel memory as not accessible from userspace @@ -2433,7 +2433,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp) l1 = &l1[ptepindex & Ln_ADDR_MASK]; KASSERT((pmap_load(l1) & ATTR_DESCR_VALID) == 0, ("%s: L1 entry %#lx is valid", __func__, pmap_load(l1))); - pmap_store(l1, VM_PAGE_TO_PHYS(m) | L1_TABLE); + pmap_store(l1, PHYS_TO_PTE(VM_PAGE_TO_PHYS(m)) | L1_TABLE); } else { vm_pindex_t l0index, l1index; pd_entry_t *l0, *l1, *l2; @@ -2477,7 +2477,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp) l2 = &l2[ptepindex & Ln_ADDR_MASK]; KASSERT((pmap_load(l2) & ATTR_DESCR_VALID) == 0, ("%s: L2 entry %#lx is valid", __func__, pmap_load(l2))); - pmap_store(l2, VM_PAGE_TO_PHYS(m) | L2_TABLE); + pmap_store(l2, PHYS_TO_PTE(VM_PAGE_TO_PHYS(m)) | L2_TABLE); } pmap_resident_count_inc(pmap, 1); @@ -2712,7 +2712,7 @@ pmap_growkernel(vm_offset_t addr) /* See the dmb() in _pmap_alloc_l3(). */ dmb(ishst); paddr = VM_PAGE_TO_PHYS(nkpg); - pmap_store(l1, paddr | L1_TABLE); + pmap_store(l1, PHYS_TO_PTE(paddr) | L1_TABLE); continue; /* try again */ } l2 = pmap_l1_to_l2(l1, kernel_vm_end); @@ -2733,7 +2733,7 @@ pmap_growkernel(vm_offset_t addr) /* See the dmb() in _pmap_alloc_l3(). */ dmb(ishst); paddr = VM_PAGE_TO_PHYS(nkpg); - pmap_store(l2, paddr | L2_TABLE); + pmap_store(l2, PHYS_TO_PTE(paddr) | L2_TABLE); kernel_vm_end = (kernel_vm_end + L2_SIZE) & ~L2_OFFSET; if (kernel_vm_end - 1 >= vm_map_max(kernel_map)) { @@ -3381,7 +3381,7 @@ pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va) panic("pmap_remove_kernel_l2: Missing pt page"); ml3pa = VM_PAGE_TO_PHYS(ml3); - newl2 = ml3pa | L2_TABLE; + newl2 = PHYS_TO_PTE(ml3pa) | L2_TABLE; /* * If this page table page was unmapped by a promotion, then it @@ -4382,7 +4382,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, if ((m->oflags & VPO_UNMANAGED) == 0) VM_PAGE_OBJECT_BUSY_ASSERT(m); pa = VM_PAGE_TO_PHYS(m); - new_l3 = (pt_entry_t)(pa | ATTR_DEFAULT | L3_PAGE); + new_l3 = (pt_entry_t)(PHYS_TO_PTE(pa) | ATTR_DEFAULT | L3_PAGE); new_l3 |= pmap_pte_memattr(pmap, m->md.pv_memattr); new_l3 |= pmap_pte_prot(pmap, prot); @@ -4696,7 +4696,7 @@ pmap_enter_2mpage(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, KASSERT(ADDR_IS_CANONICAL(va), ("%s: Address not in canonical form: %lx", __func__, va)); - new_l2 = (pd_entry_t)(VM_PAGE_TO_PHYS(m) | ATTR_DEFAULT | + new_l2 = (pd_entry_t)(PHYS_TO_PTE(VM_PAGE_TO_PHYS(m)) | ATTR_DEFAULT | ATTR_S1_IDX(m->md.pv_memattr) | ATTR_S1_AP(ATTR_S1_AP_RO) | L2_BLOCK); if ((m->oflags & VPO_UNMANAGED) == 0) { @@ -5038,7 +5038,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, pmap_resident_count_inc(pmap, 1); pa = VM_PAGE_TO_PHYS(m); - l3_val = pa | ATTR_DEFAULT | ATTR_S1_IDX(m->md.pv_memattr) | + l3_val = PHYS_TO_PTE(pa) | ATTR_DEFAULT | ATTR_S1_IDX(m->md.pv_memattr) | ATTR_S1_AP(ATTR_S1_AP_RO) | L3_PAGE; if ((prot & VM_PROT_EXECUTE) == 0 || m->md.pv_memattr == VM_MEMATTR_DEVICE) @@ -6462,7 +6462,7 @@ pmap_mapbios(vm_paddr_t pa, vm_size_t size) /* Insert L2_BLOCK */ l2 = pmap_l1_to_l2(pde, va); pmap_load_store(l2, - pa | ATTR_DEFAULT | ATTR_S1_XN | + PHYS_TO_PTE(pa) | ATTR_DEFAULT | ATTR_S1_XN | ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK) | L2_BLOCK); va += L2_SIZE; @@ -7799,7 +7799,8 @@ pmap_san_enter(vm_offset_t va) if ((pmap_load(&l2[slot]) & ATTR_DESCR_VALID) == 0) { MPASS(first); block = pmap_san_enter_bootstrap_alloc_l2(); - pmap_store(&l2[slot], pmap_early_vtophys(block) | + pmap_store(&l2[slot], + PHYS_TO_PTE(pmap_early_vtophys(block)) | PMAP_SAN_PTE_BITS | L2_BLOCK); dmb(ishst); } @@ -7812,17 +7813,18 @@ pmap_san_enter(vm_offset_t va) MPASS(l1 != NULL); if ((pmap_load(l1) & ATTR_DESCR_VALID) == 0) { m = pmap_san_enter_alloc_l3(); - pmap_store(l1, VM_PAGE_TO_PHYS(m) | L1_TABLE); + pmap_store(l1, PHYS_TO_PTE(VM_PAGE_TO_PHYS(m)) | L1_TABLE); } l2 = pmap_l1_to_l2(l1, va); if ((pmap_load(l2) & ATTR_DESCR_VALID) == 0) { m = pmap_san_enter_alloc_l2(); if (m != NULL) { - pmap_store(l2, VM_PAGE_TO_PHYS(m) | PMAP_SAN_PTE_BITS | - L2_BLOCK); + pmap_store(l2, PHYS_TO_PTE(VM_PAGE_TO_PHYS(m)) | + PMAP_SAN_PTE_BITS | L2_BLOCK); } else { m = pmap_san_enter_alloc_l3(); - pmap_store(l2, VM_PAGE_TO_PHYS(m) | L2_TABLE); + pmap_store(l2, PHYS_TO_PTE(VM_PAGE_TO_PHYS(m)) | + L2_TABLE); } dmb(ishst); } @@ -7832,7 +7834,8 @@ pmap_san_enter(vm_offset_t va) if ((pmap_load(l3) & ATTR_DESCR_VALID) != 0) return; m = pmap_san_enter_alloc_l3(); - pmap_store(l3, VM_PAGE_TO_PHYS(m) | PMAP_SAN_PTE_BITS | L3_PAGE); + pmap_store(l3, PHYS_TO_PTE(VM_PAGE_TO_PHYS(m)) | + PMAP_SAN_PTE_BITS | L3_PAGE); dmb(ishst); } #endif /* KASAN */ diff --git a/sys/arm64/include/pte.h b/sys/arm64/include/pte.h index 7836759d17bc..c320d71bb0f6 100644 --- a/sys/arm64/include/pte.h +++ b/sys/arm64/include/pte.h @@ -56,6 +56,8 @@ typedef uint64_t pt_entry_t; /* page table entry */ #define BASE_ADDR(x) ((x) & BASE_MASK) #define PTE_TO_PHYS(pte) BASE_ADDR(pte) +/* Convert a phys addr to the output address field of a PTE */ +#define PHYS_TO_PTE(pa) (pa) /* Bits 58:55 are reserved for software */ #define ATTR_SW_UNUSED1 (1UL << 58) From nobody Wed May 24 10:59:24 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QR7VP1bwJz4CXxQ; Wed, 24 May 2023 10:59:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QR7VP16Qvz4Hfm; Wed, 24 May 2023 10:59:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684925965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Y9EGO9UO3+9e9INV3gGzO8+LDc2HNSQG5v/+zg97UU=; b=kXb+eaQZ/mn3kLU3ewaX/VbOfhTkJIoFRA49WRw7qzD26wPzUQAVY8/phBFBD/khzOla/T K4aDUb/gXHYnAkaZE8jKM/sELFDxYCb/MvlDctuBetPicWkdcMkgxwRJFGqmLvX4xuytpl sTGSR0WGCoxQ+0x4rXbQ/S5OLCXrtV3tcH/+cd3A9sejHDdpSNfGs1IXDOnW1FdQGsPFHK 9JqRSz62ybrvLuNUXyTmo/ohdtJqbN5SV/OkiPRNS6RfCxRuJfpGrUcTnBXU7qwTGEUcF1 eF5VmJzo1Upy1TLV2/5S63Y5XCSqO2/+nBWHc6gEyaG5mIilINpl+QIx0fQr3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684925965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Y9EGO9UO3+9e9INV3gGzO8+LDc2HNSQG5v/+zg97UU=; b=uGOzmCh5fA6LalYNY6p+GsTmbsK7aXpl1xWz7qKb60aprufF9yOhLZJpr+9Xmv/uSm3qcC latRDfxM330DTKVCyYlqsul7Tmn2q6DAMeTrh9X866wwq8uG6yn6glMQv9d61WwHs7Ru+l LoYNLABjPkhoKnSlVmRzR/XMN4q8LCjfHKxDuyolTGfIIscgGFJYBwBw7Ofp5GPbagtJ7I YL6YhDXA9UHX25Ge8StzR/Nu3iYKg2m4WG04ILGFdouiyjVCXfx8PKKjJhAGt5mWROnC5x gY9vdjp7x3AqU2A96xhu3dwa3tSFaH/fFR2TFDnKn5asklLDwfSApvTOvUrZ8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684925965; a=rsa-sha256; cv=none; b=r07CcnobEQwASjZLI6v6DXi5PIeps2O/C5k3qWGcvDW6qYJt9CZHCDZy1IpSNBEWmuUyaZ 9CWJmppKFG2x0oxMRigN9VH/crttP1k4JocDBNyCDF0OuC2YWA6xnpznbBb6//ikP2xaAH BXAkwRS3mha8IFeVo7gaCky7N4PJQVPZcIWOgOFmlMUNhnult2H15KRaStmkHHbXoqb7Fx Iev+auU63tjtGKmM3V7YqWzN3wlz62yEfnPNXgKi4gnUbb5EK1dHa5baKrk4EbmXohkbYC rOssSvwlH+n1XGmZ6M/WP9k13jnjDDLzao0zf2dWVLQIgK4V+y5AXKsrK7dDMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QR7VP0BMlzfyk; Wed, 24 May 2023 10:59:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34OAxOgl042355; Wed, 24 May 2023 10:59:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34OAxO0D042354; Wed, 24 May 2023 10:59:24 GMT (envelope-from git) Date: Wed, 24 May 2023 10:59:24 GMT Message-Id: <202305241059.34OAxO0D042354@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 419f8fc7fbc8 - main - Add more arm64 special registers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 419f8fc7fbc8b860df92db58d13ac9c9aafa1c10 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=419f8fc7fbc8b860df92db58d13ac9c9aafa1c10 commit 419f8fc7fbc8b860df92db58d13ac9c9aafa1c10 Author: Andrew Turner AuthorDate: 2023-05-04 10:30:57 +0000 Commit: Andrew Turner CommitDate: 2023-05-24 10:55:38 +0000 Add more arm64 special registers These will be used by bhyve Reviewed by: markj Sponsored by: Arm Ltd Sponsored by: Innovate UK Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40128 --- sys/arm64/include/armreg.h | 48 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 45f6145de8bd..5c174bcbc838 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -435,12 +435,24 @@ #define ICC_SGI1R_EL1_CRn 12 #define ICC_SGI1R_EL1_CRm 11 #define ICC_SGI1R_EL1_op2 5 -#define ICC_SGI1R_EL1_TL_MASK 0xffffUL +#define ICC_SGI1R_EL1_TL_SHIFT 0 +#define ICC_SGI1R_EL1_TL_MASK (0xffffUL << ICC_SGI1R_EL1_TL_SHIFT) +#define ICC_SGI1R_EL1_TL_VAL(x) ((x) & ICC_SGI1R_EL1_TL_MASK) #define ICC_SGI1R_EL1_AFF1_SHIFT 16 +#define ICC_SGI1R_EL1_AFF1_MASK (0xfful << ICC_SGI1R_EL1_AFF1_SHIFT) +#define ICC_SGI1R_EL1_AFF1_VAL(x) ((x) & ICC_SGI1R_EL1_AFF1_MASK) #define ICC_SGI1R_EL1_SGIID_SHIFT 24 +#define ICC_SGI1R_EL1_SGIID_MASK (0xfUL << ICC_SGI1R_EL1_SGIID_SHIFT) +#define ICC_SGI1R_EL1_SGIID_VAL(x) ((x) & ICC_SGI1R_EL1_SGIID_MASK) #define ICC_SGI1R_EL1_AFF2_SHIFT 32 +#define ICC_SGI1R_EL1_AFF2_MASK (0xfful << ICC_SGI1R_EL1_AFF2_SHIFT) +#define ICC_SGI1R_EL1_AFF2_VAL(x) ((x) & ICC_SGI1R_EL1_AFF2_MASK) +#define ICC_SGI1R_EL1_RS_SHIFT 44 +#define ICC_SGI1R_EL1_RS_MASK (0xful << ICC_SGI1R_EL1_RS_SHIFT) +#define ICC_SGI1R_EL1_RS_VAL(x) ((x) & ICC_SGI1R_EL1_RS_MASK) #define ICC_SGI1R_EL1_AFF3_SHIFT 48 -#define ICC_SGI1R_EL1_SGIID_MASK 0xfUL +#define ICC_SGI1R_EL1_AFF3_MASK (0xfful << ICC_SGI1R_EL1_AFF3_SHIFT) +#define ICC_SGI1R_EL1_AFF3_VAL(x) ((x) & ICC_SGI1R_EL1_AFF3_MASK) #define ICC_SGI1R_EL1_IRM (0x1UL << 40) /* ICC_SRE_EL1 */ @@ -503,6 +515,14 @@ #define ID_AA64DFR0_TraceFilt_NONE (UL(0x0) << ID_AA64DFR0_TraceFilt_SHIFT) #define ID_AA64DFR0_TraceFilt_8_4 (UL(0x1) << ID_AA64DFR0_TraceFilt_SHIFT) +/* ID_AA64DFR1_EL1 */ +#define ID_AA64DFR1_EL1 MRS_REG(ID_AA64DFR0_EL1) +#define ID_AA64DFR1_EL1_op0 3 +#define ID_AA64DFR1_EL1_op1 0 +#define ID_AA64DFR1_EL1_CRn 0 +#define ID_AA64DFR1_EL1_CRm 5 +#define ID_AA64DFR1_EL1_op2 1 + /* ID_AA64ISAR0_EL1 */ #define ID_AA64ISAR0_EL1 MRS_REG(ID_AA64ISAR0_EL1) #define ID_AA64ISAR0_EL1_op0 0x3 @@ -1193,6 +1213,30 @@ #define MDSCR_MDE_SHIFT 15 #define MDSCR_MDE (UL(0x1) << MDSCR_MDE_SHIFT) +/* MPIDR_EL1 - Multiprocessor Affinity Register */ +#define MPIDR_EL1 MRS_REG(MPIDR_EL1) +#define MPIDR_EL1_op0 3 +#define MPIDR_EL1_op1 0 +#define MPIDR_EL1_CRn 0 +#define MPIDR_EL1_CRm 0 +#define MPIDR_EL1_op2 5 +#define MPIDR_AFF0_SHIFT 0 +#define MPIDR_AFF0_MASK (UL(0xff) << MPIDR_AFF0_SHIFT) +#define MPIDR_AFF0_VAL(x) ((x) & MPIDR_AFF0_MASK) +#define MPIDR_AFF1_SHIFT 8 +#define MPIDR_AFF1_MASK (UL(0xff) << MPIDR_AFF1_SHIFT) +#define MPIDR_AFF1_VAL(x) ((x) & MPIDR_AFF1_MASK) +#define MPIDR_AFF2_SHIFT 16 +#define MPIDR_AFF2_MASK (UL(0xff) << MPIDR_AFF2_SHIFT) +#define MPIDR_AFF2_VAL(x) ((x) & MPIDR_AFF2_MASK) +#define MPIDR_MT_SHIFT 24 +#define MPIDR_MT_MASK (UL(0x1) << MPIDR_MT_SHIFT) +#define MPIDR_U_SHIFT 30 +#define MPIDR_U_MASK (UL(0x1) << MPIDR_U_SHIFT) +#define MPIDR_AFF3_SHIFT 32 +#define MPIDR_AFF3_MASK (UL(0xff) << MPIDR_AFF3_SHIFT) +#define MPIDR_AFF3_VAL(x) ((x) & MPIDR_AFF3_MASK) + /* MVFR0_EL1 */ #define MVFR0_EL1 MRS_REG(MVFR0_EL1) #define MVFR0_EL1_op0 0x3 From nobody Wed May 24 10:59:26 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QR7VQ375rz4CYhF; Wed, 24 May 2023 10:59: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 4QR7VQ2QQpz4HgB; Wed, 24 May 2023 10:59:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684925966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9jU2ST2h6P6O0kJt1ckeUIfkI5m3php8tKRJPrSxnCw=; b=wWKSziL2hDxMnfZQbliuSh2xMg76BAkHDYQtJuBTXYg086UqCGR05Z4r4HC7ak6fsC8Pt3 B2Ak5fDRXMv2zWTmXyJ1DmHkxljYsNxo0OPOAXOIO2cBuagwXmrzt2qzZbtFApjQcD0gd7 xKDNHRAn1Ze24Glh1LCSGqchuBHrc1zmnDna+CShKcyK4u+OpJR/oG86LdhXkqoLGODuNw bVtUhWHVvHkWZXSv66/P13I5/CviqzOb1IBhP5PBXBpsZvagvOnUajbRZgYyu42lqoVZ9T Lfn7icgv3yCoQY3AqDQJFtKiLAH3HmjDylyiNIlBri8wVwuXsXmd/Dq37ZI+5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684925966; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9jU2ST2h6P6O0kJt1ckeUIfkI5m3php8tKRJPrSxnCw=; b=F5AVeaVN5FlC3BWJixzEgTneV35HnK6EMcdFNPnzboLn3mWIZIsiS1BiTTVncFC3svvaB4 efV3FS9idyo7JsrwM9/QNPsGWf2xfuWHBaTV0V9t0Vpa5X76YrfZUuvxs2DB3svt2lnkkV C77RI1XUiyfCSBWXB8LXNaJ9Ttaezkz6ljqUbfX35QIEoXpWva1UeCIMVD3o4LXvVPzZkl gNbgenA4IYI6oi9TZJnkcOJ+FjB7WGheGZiIO/adqIYYhwhHjLUKspgqNiQ+VoZq+UkqSE sOnQe4iWp79/FAXgnz6LPT0CTK0Q5NouWSJG1wWWjZ5s2r8rO0zIzooYFmjmmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684925966; a=rsa-sha256; cv=none; b=lbrastjKf52vc7SR3HO0AH7OxI4ztR9PrZld/DMtN9qzDa/NYBpv5o5+ZmcyQ1K+Edltnb 7jFY5mM5EjyJoo5HZDkPxwumS9HZQ0SazlI/sgqRmks5bbyEqdE/7sW7XTHeKxmghlHKkZ QjugnHZ4pd4ebRSLtopMF+vckAXiHmd0gXCVH0Mm3ySeQ2KqBPp9IoD8unxJ8JDgY5yJGB Q8KV/DCyiwa6wsCq5thTPdB8XAGLbXR5GqMQw0rDds8XtpUEM8PCXmZSIuKT/4iD5P80ph XCrE+RFE0FV9Yf2Y/Lzo6gfBg5To3a9BWyz9NTG2+U14Lws+nqiGg5a8Did3Kg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QR7VQ15NDzg7D; Wed, 24 May 2023 10:59: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 34OAxQTW042377; Wed, 24 May 2023 10:59:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34OAxQg2042376; Wed, 24 May 2023 10:59:26 GMT (envelope-from git) Date: Wed, 24 May 2023 10:59:26 GMT Message-Id: <202305241059.34OAxQg2042376@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 255adf35c0b9 - main - Export arm64 VFP handling functions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 255adf35c0b928e43c82ade2a491eea51e71383f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=255adf35c0b928e43c82ade2a491eea51e71383f commit 255adf35c0b928e43c82ade2a491eea51e71383f Author: Andrew Turner AuthorDate: 2023-05-16 10:08:03 +0000 Commit: Andrew Turner CommitDate: 2023-05-24 10:55:38 +0000 Export arm64 VFP handling functions These will be used by bhyve to manage the host VFP registers, e.g. saving the host state before entering a guest. Reviewed by: markj Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D40130 --- sys/arm64/arm64/vfp.c | 8 ++++---- sys/arm64/include/vfp.h | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/vfp.c b/sys/arm64/arm64/vfp.c index 49a83d3fe71f..22b15ee78596 100644 --- a/sys/arm64/arm64/vfp.c +++ b/sys/arm64/arm64/vfp.c @@ -57,7 +57,7 @@ struct fpu_kern_ctx { struct vfpstate state; }; -static void +void vfp_enable(void) { uint32_t cpacr; @@ -68,7 +68,7 @@ vfp_enable(void) isb(); } -static void +void vfp_disable(void) { uint32_t cpacr; @@ -99,7 +99,7 @@ vfp_discard(struct thread *td) vfp_disable(); } -static void +void vfp_store(struct vfpstate *state) { __uint128_t *vfp_state; @@ -131,7 +131,7 @@ vfp_store(struct vfpstate *state) state->vfp_fpsr = fpsr; } -static void +void vfp_restore(struct vfpstate *state) { __uint128_t *vfp_state; diff --git a/sys/arm64/include/vfp.h b/sys/arm64/include/vfp.h index a450a5f31fdd..4f64b0396417 100644 --- a/sys/arm64/include/vfp.h +++ b/sys/arm64/include/vfp.h @@ -67,7 +67,11 @@ struct pcb; struct thread; void vfp_init(void); +void vfp_enable(void); +void vfp_disable(void); void vfp_discard(struct thread *); +void vfp_store(struct vfpstate *); +void vfp_restore(struct vfpstate *); void vfp_new_thread(struct thread *, struct thread *, bool); void vfp_reset_state(struct thread *, struct pcb *); void vfp_restore_state(void); From nobody Wed May 24 12:24:20 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QR9NN2NQCz4Cf5y; Wed, 24 May 2023 12:24:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QR9NN1s01z3FGW; Wed, 24 May 2023 12:24:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684931060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0u/p4goGu2LqJ56EZAUN3FMosn/VE6buyJSGeF/8JPE=; b=W6gC8gdtv7ICE48nGV58fGkQ/SYrjhdBIAWHHWuUwri2q5yH99gJyd7R5jiVQ2nEZ46M3F VxW/9eWBpC1lmC+bpy46ka/CZ+RdNO0/Z5O/nsIEHxAgrVsFxy0YASiUneggyxb4jMHrzO tCV6wgSSK0zFR2rT25AJKGhM01vFyiAyBK+9zuzXk9DwFXEC6o2N/w9yA4brq8xOqNPoXo ZJ7Lz3S/UEA6mIbc9axWFP9tayhLib9dJ+2S9mdFH5+iezjqjEdhVhN4hGkTKXWwWqc1/U 3B5Hp77hVpDUfnjGuCcm1aVdF0H8p5l0phKD8wU26V5fTk+5BU9/1N797brkCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684931060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0u/p4goGu2LqJ56EZAUN3FMosn/VE6buyJSGeF/8JPE=; b=ro8Fw5EuWNYuTho91wvdYUXvhfOmydJi0RN3tsa9CRWTa7oOfl3uErb4MUcxWfzsNR1gp8 33wcUTOgGGm8tl4xR1c3REMVclMZRnxtCaxSQLsCN/bsi9wbgzxbqX2IQ1CPb25S237HVm XUOxFEsxqrEv9DpAhBVCRQ3jc4fsg2wDgL6G8Ym/kjI2uOt/2Y3n8h+2j5DILw/qDqeMve 6AwcmTrpNQHm5v0nUv2I003oSox/SvEP1Er/YTAVUkis6JHOmqZeuJq7+AHMK1jWnlYd4i 8W9D8JwKL1kKlyvFimDZeR48VIsGQMKIyF4RXwzBq5Kk5nXYGlVYaM46fIKWtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684931060; a=rsa-sha256; cv=none; b=dg3UcJrkUI9jtCi4jN6JfnrCdu0rlS4AZ04Dujjn6ZqrilEDYp23mAZ+zMmF3oKnWC+Ntw qqO4qi9c41qLOxfjotKBzReZ4leSDIJCu1tJZ5C+m35Zdg4/luH5a+Gcnd5HK+iLVL00a1 IadSEK1rh/6ldMBlrvj6KtQ+Zh/g5AWSGhhedkEqbOiktjiHJ87x1ZJ19EZjZzvWjndla6 nOVKicbo7RIPRn/fCWJEbU3t7QGtL6sKfH/lujj23DRfbdKP4DbBJWmfTeB3YohQoK/we2 PmqB1fQ44lyCt92nNHN5ph19+sCos4+RoLeT5SMar2mSIA8E493kXmCOpCDaCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QR9NN0tZgzhwg; Wed, 24 May 2023 12:24: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 34OCOKkV091134; Wed, 24 May 2023 12:24:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34OCOK6k091133; Wed, 24 May 2023 12:24:20 GMT (envelope-from git) Date: Wed, 24 May 2023 12:24:20 GMT Message-Id: <202305241224.34OCOK6k091133@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 2c0a6d0e7b82 - main - bhyvectl: Update usage of vm_run() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2c0a6d0e7b82fbe6657fe90d990aa2e812f49b44 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2c0a6d0e7b82fbe6657fe90d990aa2e812f49b44 commit 2c0a6d0e7b82fbe6657fe90d990aa2e812f49b44 Author: Mark Johnston AuthorDate: 2023-05-24 12:17:49 +0000 Commit: Mark Johnston CommitDate: 2023-05-24 12:23:22 +0000 bhyvectl: Update usage of vm_run() Fixes: e17eca327633 ("vmm: Avoid embedding cpuset_t ioctl ABIs") --- usr.sbin/bhyvectl/bhyvectl.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c index 5dcdb8e06c96..f723ff1f2e82 100644 --- a/usr.sbin/bhyvectl/bhyvectl.c +++ b/usr.sbin/bhyvectl/bhyvectl.c @@ -1751,7 +1751,7 @@ main(int argc, char *argv[]) char *vmname; int error, ch, vcpuid, ptenum; vm_paddr_t gpa_pmap; - struct vm_exit vmexit; + struct vm_run vmrun; uint64_t rax, cr0, cr2, cr3, cr4, dr0, dr1, dr2, dr3, dr6, dr7; uint64_t rsp, rip, rflags, efer, pat; uint64_t eptp, bm, addr, u64, pteval[4], *pte, info[2]; @@ -2386,7 +2386,13 @@ main(int argc, char *argv[]) } if (!error && run) { - error = vm_run(vcpu, &vmexit); + struct vm_exit vmexit; + cpuset_t cpuset; + + vmrun.vm_exit = &vmexit; + vmrun.cpuset = &cpuset; + vmrun.cpusetsize = sizeof(cpuset); + error = vm_run(vcpu, &vmrun); if (error == 0) dump_vm_run_exitcode(&vmexit, vcpuid); else From nobody Wed May 24 13:28:55 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRBpv2VHNz4CjFZ; Wed, 24 May 2023 13:28: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 4QRBpv22nDz3R69; Wed, 24 May 2023 13:28:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684934935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=it7KafxQQ7xex3tGRCAZqmK/zdVh0UbtX33n99UCh7s=; b=R53rF3rAGLUUb2k54SYjxAULant/1cnLV6gsB89aTh5xQb43LTv5JeY6omD9x7z3VdhtOy MdOkEL0XVhJtDY+MvFNPEgTWnntexSjdpTqQPRlFYgxJEdR5ru3xIZAFdZq74C2Sg5bEVi 406i+texr1cJ/33tKgKaH+05o3Y1rWkKQNeSGMiQNq/XhuadgAuJi6FRofw3q9/dx8lnpU A7K1DTn8MBGvP2odCnnqbmzQ/qxAr9CUJXdBl6EWusnIbdwWV6Vg6jofo0Y3H1/+xPciWR UdaTNJWGM+fOwRBRs47oKMYBIt4Kynuf7QMFuuvowcs49Dk3VlplyU5XviPzpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684934935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=it7KafxQQ7xex3tGRCAZqmK/zdVh0UbtX33n99UCh7s=; b=Ka2/ptPaKoYv63z9qqcOXsQLl+sDMzxhQsGp2NzN4ebtYsdmxn8GI8XRVLqV+lkTOb0arz bt6zoyptTCG+e/sWk4r4VWSEHbZKt4g6kr4hxi84KLg7WO0225qG4F34S8Nnv51JqY5UcX GNEkUlCrxUiTHHKskuuGsFCTxkpwXnkC0/BKis3Vo26n18jqW0En28RMV9rY4skMLY2tAm j7zBhbJixXpo0hpKqZ5J9DB4EoP/v1PDGItdqth8C2abnOrfQC6FAt8hyTHk/kOMdgpFmx /hJYI5bf+OSEe2lkfckX0tsJgB6kbmThUseERCNuvyD77BD9cOv2fcipN6biXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684934935; a=rsa-sha256; cv=none; b=jrUzAe7ThcMRR87rD7rqJNpWOGeMSEG/4v3bP+dGmMWSj6Zrbm3U0c9c+P401gWR0SlDZP nlv1L7BC8JIMCHpeUd/FAOE/1KOqSwvkMZDgBwCADlteKFQ0gt96cQgOP1G9/WCDh2GQQz xy9zztQdPWHK97f1os7mFdbBfLGN9CmsbfXP9pHtc30qEEEWI5FBamlQpz/ETgLef+OUb5 zKz+4XtByLz4dvuycPbOBPF7l8ddElRlyovTr6U/sp+BG09m16IE3fCoCbucpMbuUNPed7 PlFgcGKRqcknQ0RDC01tV9w1KEvB1UmyB7IpbvNF668nqfNvXnMhLJxFlNxwxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRBpv15lMzkjf; Wed, 24 May 2023 13:28: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 34ODSt0E090079; Wed, 24 May 2023 13:28:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34ODSt1R090078; Wed, 24 May 2023 13:28:55 GMT (envelope-from git) Date: Wed, 24 May 2023 13:28:55 GMT Message-Id: <202305241328.34ODSt1R090078@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 5edffecc4b4e - main - ofw_cpu: whitespace cleanup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5edffecc4b4ec6c3e1f09174f155a3abdd928d01 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=5edffecc4b4ec6c3e1f09174f155a3abdd928d01 commit 5edffecc4b4ec6c3e1f09174f155a3abdd928d01 Author: Mitchell Horne AuthorDate: 2023-05-24 13:27:34 +0000 Commit: Mitchell Horne CommitDate: 2023-05-24 13:28:26 +0000 ofw_cpu: whitespace cleanup Reviewed by: jhb, emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40242 --- sys/dev/ofw/ofw_cpu.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/sys/dev/ofw/ofw_cpu.c b/sys/dev/ofw/ofw_cpu.c index 8b48e645f1b4..d460060a7f6e 100644 --- a/sys/dev/ofw/ofw_cpu.c +++ b/sys/dev/ofw/ofw_cpu.c @@ -89,10 +89,10 @@ static driver_t ofw_cpulist_driver = { DRIVER_MODULE(ofw_cpulist, ofwbus, ofw_cpulist_driver, 0, 0); -static int -ofw_cpulist_probe(device_t dev) +static int +ofw_cpulist_probe(device_t dev) { - const char *name; + const char *name; name = ofw_bus_get_name(dev); @@ -104,8 +104,8 @@ ofw_cpulist_probe(device_t dev) return (0); } -static int -ofw_cpulist_attach(device_t dev) +static int +ofw_cpulist_attach(device_t dev) { struct ofw_cpulist_softc *sc; phandle_t root, child; @@ -122,18 +122,18 @@ ofw_cpulist_attach(device_t dev) for (child = OF_child(root); child != 0; child = OF_peer(child)) { dinfo = malloc(sizeof(*dinfo), M_OFWCPU, M_WAITOK | M_ZERO); - if (ofw_bus_gen_setup_devinfo(dinfo, child) != 0) { - free(dinfo, M_OFWCPU); - continue; - } - cdev = device_add_child(dev, NULL, -1); - if (cdev == NULL) { - device_printf(dev, "<%s>: device_add_child failed\n", - dinfo->obd_name); - ofw_bus_gen_destroy_devinfo(dinfo); - free(dinfo, M_OFWCPU); - continue; - } + if (ofw_bus_gen_setup_devinfo(dinfo, child) != 0) { + free(dinfo, M_OFWCPU); + continue; + } + cdev = device_add_child(dev, NULL, -1); + if (cdev == NULL) { + device_printf(dev, "<%s>: device_add_child failed\n", + dinfo->obd_name); + ofw_bus_gen_destroy_devinfo(dinfo); + free(dinfo, M_OFWCPU); + continue; + } device_set_ivars(cdev, dinfo); } @@ -141,9 +141,9 @@ ofw_cpulist_attach(device_t dev) } static const struct ofw_bus_devinfo * -ofw_cpulist_get_devinfo(device_t dev, device_t child) +ofw_cpulist_get_devinfo(device_t dev, device_t child) { - return (device_get_ivars(child)); + return (device_get_ivars(child)); } static int ofw_cpu_probe(device_t); @@ -242,8 +242,8 @@ ofw_cpu_attach(device_t dev) struct cpuref cpuref; cell_t *servers; int i, nservers, rv; - - if ((nservers = OF_getencprop_alloc(node, + + if ((nservers = OF_getencprop_alloc(node, "ibm,ppc-interrupt-server#s", (void **)&servers)) < 0) return (ENXIO); nservers /= sizeof(cell_t); From nobody Wed May 24 13:28:56 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRBpw3Yqbz4ChwG; Wed, 24 May 2023 13:28: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 4QRBpw2xgtz3h3f; Wed, 24 May 2023 13:28:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684934936; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LV6WC50zDd5Ok0pt1MncQPkD76nnKlgdH182omnVDSI=; b=Rl+UgAJuFjZQVxXKiLQ3aRRguvjE4R7qkSEJz4oMHHZXTq9+WDQNt4/8cRCOxWPUBIXJpL lgKx1xVsuToW3664wGoAM4/kxw4/nITkltyPDFu/14aC+J9fe40HtNjD99iMrO2sqOhbcR xe476EBDelb+acjhxOmB4aQ9FL9VeohTunr/LVuReZOLa3A1bd678kl+D/nW3ll6zXMlOK YJ3JmjZGQnf6oc7Wym8h02RTkpzGplZL1EErU4No79zQfKwPyd/Ki4npeLYIhmtGIwB186 56BkH7iW8N1Zd2ABl5OLIvjHq3BaEFz5fFgfhbig1uemnV0Nr5Y9FSM8WxmzNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684934936; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LV6WC50zDd5Ok0pt1MncQPkD76nnKlgdH182omnVDSI=; b=nN1dmY2fh5f5EQnVmfc8/0LQ7yQCJVI20zcOl+88Ip5QiI4IRlVZH1qs1KQD7VygPTchyt ens/856e7yLZHyIuqOEz6VPf0ekbq60g8uTlgfy69kJyLgmzhyxXRG3RXFfNBQtbcY4CI3 Mgh23A0MdzpwQC/LWuJvd58geirItRBaCAkuNFKpauDdObH/bZN/rMazXHtFZ/wqE3MMPK 8zf1Adn+O9IYA/XOBmdfjh7gLzCqsH2ueY660puRgb4ej8hHabYX3hM85FG6uEkPixFPin r5MGBVFSF5bSGpl7Wno5d7nhcyhPYWQ/y8q8S53RDVY9+c0G44OglJmWWKOrhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684934936; a=rsa-sha256; cv=none; b=RZGN7oiIJIjXbyQmZsNKY/IRgBKNFXBW1GsPHpsTvAdKjrONWKphwVa+emiF4P5BgR/zQR YJL/JmgDgyIWvEh1dN3uBrhP7RqFRvTbDpQGcM9qfm8Hvt/QjVyP09n4XhWeUbASynM5o3 LnYH0OtW+MxDU5yH//3AOC9NLN8iribtFSiEIrYceH5/fZgyi52mmUChd96WqJhQD/rJHO YSFvkDrqCvfR8utEIbG4xkBmoHllK2Q1DhIgD62tyApc5Q939Yvoe1CMYsde4Wv7GIbDGP OwDlDKIfZkvxQc0PgICehx/b9Sd+tlX6b4UdmQmxFOJe/stNW8S+228rX2LTvQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRBpw1zbWzkJM; Wed, 24 May 2023 13:28: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 34ODSuQL090099; Wed, 24 May 2023 13:28:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34ODSu19090098; Wed, 24 May 2023 13:28:56 GMT (envelope-from git) Date: Wed, 24 May 2023 13:28:56 GMT Message-Id: <202305241328.34ODSu19090098@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 08637d5d1580 - main - ofw_cpu: quiet secondary CPU devices List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 08637d5d1580af743f4ed6504104d038e017f918 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=08637d5d1580af743f4ed6504104d038e017f918 commit 08637d5d1580af743f4ed6504104d038e017f918 Author: Mitchell Horne AuthorDate: 2023-05-24 13:27:55 +0000 Commit: Mitchell Horne CommitDate: 2023-05-24 13:28:26 +0000 ofw_cpu: quiet secondary CPU devices We already do plenty to announce the different CPUs in dmesg. Follow the ACPI CPU strategy of reporting the first CPU device, but quieting the rest for non-verbose boot. This cuts down slightly on dmesg output. Reviewed by: manu, jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40243 --- sys/dev/ofw/ofw_cpu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/ofw/ofw_cpu.c b/sys/dev/ofw/ofw_cpu.c index d460060a7f6e..56e09125abbc 100644 --- a/sys/dev/ofw/ofw_cpu.c +++ b/sys/dev/ofw/ofw_cpu.c @@ -192,6 +192,11 @@ ofw_cpu_probe(device_t dev) return (ENXIO); device_set_desc(dev, "Open Firmware CPU"); + if (!bootverbose && device_get_unit(dev) != 0) { + device_quiet(dev); + device_quiet_children(dev); + } + return (0); } From nobody Wed May 24 13:30:08 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRBrK38JKz4CjFt; Wed, 24 May 2023 13:30: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 4QRBrK1NPyz3hYS; Wed, 24 May 2023 13:30:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684935009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o5g5j0LDG4NGp6dWIdoH2TcWE5f1blO7npspdbI8Tg0=; b=hbhCQxMrXnFc9U8FrZwX25md+/PdbUKGZWs6eKMHaLjbfHoFEvVuA1ll9lukcbOgjZrIqt JhqB72Bx+w1D7UjfCgpY/n7H1kE4kVG94xiosdpjKw9JKWbssB3318ur9GfLl2pBVgawrm zLZJpaUheIGGEt9SWwp/PkNoTkqhST8E21qTteGmXZtzUXuKZL32A8xz+qMOqe27Ml+TNa EzIl6dx6Eg9tBsVMhPNIJixPK9YnVjF9Htf3U71EFiwYVIO60jtCyAHimQTzgE8ixh53ze hKrAsE0Pgm+GYs6AqL5pLdx2B4BW/a7I4cMlbJuvO20tFE9i/ssjWgYRp/fQLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684935009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o5g5j0LDG4NGp6dWIdoH2TcWE5f1blO7npspdbI8Tg0=; b=ULsbIoy1DPvXznVdFNHv/9p65lZiupe9fXzJPUGG+xKhUDxKITMAd19KDDCr1tnv1/WOD5 zQZhNoaKVQ3HiP9nnbbUWxJaSHw7zPI3iJFUFQ57+CvNd4JU/uhgc52cps3gE2xF/3O5rs eDP8KpJTskzEa5kIRLrbtJE/Jf+q8vtcLl+OpU5RyzNxpJt+PITVTXyETVfsXAPNbuqvUK 8cgIHKgPQvjtXkWturaYaBTOpIXxiZmWF03we7aRtIEhYz9Djy6EOkp6CFenHkp8UUOEX8 SME3MBH5iBdAunVMta2MlC1E3jFoUzjrefxyTEz1HVX3DVCzwv/7qkr95u/zYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684935009; a=rsa-sha256; cv=none; b=sL7GL0IRB1dnNl9w+ngsTWwNWzXraqFYpyB11oxzPJaUuDV9xLRoQ44C7/Y0yQV7zC63Gf nnXufc1eQERnaVUzVRZDOOVynOw19FMXW56A0VoWyNzUkbxoR2VpwmVlwWzzywJ6LGwyYr JHHeYTP7klB5d1W/aDRZ2fVTvOVeiWPaw7GQgZKtTft2x8ltmosKbZZLHp1L5rsVwx39RJ 4EVUHyZBPhHPdSZtjptm8Lj8x8ZfdYCacQFEVBUvi2osT2xqCTIWG+zyrI+RG5xgAn0LvI fbtmdwHKNJKVNYiK63CaPe5H2nocBk7ilGxyUSfy1t+xY28l7r0pKYEy64GUcw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRBrK0SlWzklw; Wed, 24 May 2023 13:30: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 34ODU9Sl094015; Wed, 24 May 2023 13:30:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34ODU8Es093991; Wed, 24 May 2023 13:30:08 GMT (envelope-from git) Date: Wed, 24 May 2023 13:30:08 GMT Message-Id: <202305241330.34ODU8Es093991@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Randall Stewart Subject: git: 57a3a161a92f - main - tcp: request tracking is not http specific. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 57a3a161a92fb8eb15cadca917d351628105d9e5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rrs: URL: https://cgit.FreeBSD.org/src/commit/?id=57a3a161a92fb8eb15cadca917d351628105d9e5 commit 57a3a161a92fb8eb15cadca917d351628105d9e5 Author: Randall Stewart AuthorDate: 2023-05-24 10:35:36 +0000 Commit: Randall Stewart CommitDate: 2023-05-24 10:35:36 +0000 tcp: request tracking is not http specific. This change is a name change only. TCP Request tracking can track sendfile and even non-sendfile requests. The names however in the current code use http, and they should not. The feature is not http specific. Lets change the name so they more properly reflect whats going on. This also fixes conflicts with http_req which caused application pain. Reviewed by: tuexen Sponsored by: Netflix Inc Differential Revision:https://reviews.freebsd.org/D40229 --- sys/netinet/tcp.h | 6 +- sys/netinet/tcp_log_buf.c | 37 +++---- sys/netinet/tcp_log_buf.h | 6 +- sys/netinet/tcp_stacks/rack.c | 130 ++++++++++++------------- sys/netinet/tcp_stacks/tcp_rack.h | 2 +- sys/netinet/tcp_subr.c | 198 +++++++++++++++++++------------------- sys/netinet/tcp_var.h | 66 ++++++------- 7 files changed, 222 insertions(+), 223 deletions(-) diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index 51156e9ec76a..314cad76dee2 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -463,7 +463,7 @@ struct tcp_function_set { /* * TCP log user opaque */ -struct http_req { +struct tcp_snd_req { uint64_t timestamp; uint64_t start; uint64_t end; @@ -471,7 +471,7 @@ struct http_req { }; union tcp_log_userdata { - struct http_req http_req; + struct tcp_snd_req tcp_req; }; struct tcp_log_user { @@ -501,7 +501,7 @@ struct tcp_log_user { #define TCP_HYBRID_PACING_SETMSS 0x1000 /* Internal flag that tellsus we set the mss on this entry */ struct tcp_hybrid_req { - struct http_req req; + struct tcp_snd_req req; uint64_t cspr; uint32_t hint_maxseg; uint32_t hybrid_flags; diff --git a/sys/netinet/tcp_log_buf.c b/sys/netinet/tcp_log_buf.c index 79ea0da7cbec..e0334c69b46f 100644 --- a/sys/netinet/tcp_log_buf.c +++ b/sys/netinet/tcp_log_buf.c @@ -1,3 +1,4 @@ + /*- * SPDX-License-Identifier: BSD-2-Clause * @@ -2852,7 +2853,7 @@ tcp_log_sendfile(struct socket *so, off_t offset, size_t nbytes, int flags) struct inpcb *inp; struct tcpcb *tp; #ifdef TCP_REQUEST_TRK - struct http_sendfile_track *ent; + struct tcp_sendfile_track *ent; int i, fnd; #endif @@ -2885,27 +2886,27 @@ tcp_log_sendfile(struct socket *so, off_t offset, size_t nbytes, int flags) TCP_LOG_SENDFILE, 0, 0, &log, false, &tv); } #ifdef TCP_REQUEST_TRK - if (tp->t_http_req == 0) { + if (tp->t_tcpreq_req == 0) { /* No http requests to track */ goto done; } fnd = 0; - if (tp->t_http_closed == 0) { + if (tp->t_tcpreq_closed == 0) { /* No closed end req to track */ goto skip_closed_req; } - for(i = 0; i < MAX_TCP_HTTP_REQ; i++) { + for(i = 0; i < MAX_TCP_TRK_REQ; i++) { /* Lets see if this one can be found */ - ent = &tp->t_http_info[i]; - if (ent->flags == TCP_HTTP_TRACK_FLG_EMPTY) { + ent = &tp->t_tcpreq_info[i]; + if (ent->flags == TCP_TRK_TRACK_FLG_EMPTY) { /* Not used */ continue; } - if (ent->flags & TCP_HTTP_TRACK_FLG_OPEN) { + if (ent->flags & TCP_TRK_TRACK_FLG_OPEN) { /* This pass does not consider open requests */ continue; } - if (ent->flags & TCP_HTTP_TRACK_FLG_COMP) { + if (ent->flags & TCP_TRK_TRACK_FLG_COMP) { /* Don't look at what we have completed */ continue; } @@ -2919,7 +2920,7 @@ tcp_log_sendfile(struct socket *so, off_t offset, size_t nbytes, int flags) /* * It is at or past the end, its complete. */ - ent->flags |= TCP_HTTP_TRACK_FLG_SEQV; + ent->flags |= TCP_TRK_TRACK_FLG_SEQV; /* * When an entry completes we can take (snd_una + sb_cc) and know where * the end of the range really is. Note that this works since two @@ -2934,10 +2935,10 @@ tcp_log_sendfile(struct socket *so, off_t offset, size_t nbytes, int flags) if (SEQ_GT((tp->snd_una + so->so_snd.sb_ccc), ent->end_seq)) ent->end_seq = tp->snd_una + so->so_snd.sb_ccc; if ((offset + nbytes) >= ent->end) { - ent->flags |= TCP_HTTP_TRACK_FLG_COMP; - tcp_http_log_req_info(tp, ent, i, TCP_HTTP_REQ_LOG_COMPLETE, offset, nbytes); + ent->flags |= TCP_TRK_TRACK_FLG_COMP; + tcp_req_log_req_info(tp, ent, i, TCP_TRK_REQ_LOG_COMPLETE, offset, nbytes); } else { - tcp_http_log_req_info(tp, ent, i, TCP_HTTP_REQ_LOG_MOREYET, offset, nbytes); + tcp_req_log_req_info(tp, ent, i, TCP_TRK_REQ_LOG_MOREYET, offset, nbytes); } /* We assume that sendfile never sends overlapping requests */ goto done; @@ -2946,23 +2947,23 @@ tcp_log_sendfile(struct socket *so, off_t offset, size_t nbytes, int flags) skip_closed_req: if (!fnd) { /* Ok now lets look for open requests */ - for(i = 0; i < MAX_TCP_HTTP_REQ; i++) { - ent = &tp->t_http_info[i]; - if (ent->flags == TCP_HTTP_TRACK_FLG_EMPTY) { + for(i = 0; i < MAX_TCP_TRK_REQ; i++) { + ent = &tp->t_tcpreq_info[i]; + if (ent->flags == TCP_TRK_TRACK_FLG_EMPTY) { /* Not used */ continue; } - if ((ent->flags & TCP_HTTP_TRACK_FLG_OPEN) == 0) + if ((ent->flags & TCP_TRK_TRACK_FLG_OPEN) == 0) continue; /* If we reach here its an allocated open request */ if (ent->start == offset) { /* It begins this request */ ent->start_seq = tp->snd_una + tptosocket(tp)->so_snd.sb_ccc; - ent->flags |= TCP_HTTP_TRACK_FLG_SEQV; + ent->flags |= TCP_TRK_TRACK_FLG_SEQV; break; } else if (offset > ent->start) { - ent->flags |= TCP_HTTP_TRACK_FLG_SEQV; + ent->flags |= TCP_TRK_TRACK_FLG_SEQV; break; } } diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h index a79a78ab256b..d08440f1671f 100644 --- a/sys/netinet/tcp_log_buf.h +++ b/sys/netinet/tcp_log_buf.h @@ -259,7 +259,7 @@ enum tcp_log_events { TCP_TIMELY_WORK, /* Logs regarding Timely CC tweaks 58 */ TCP_LOG_USER_EVENT, /* User space event data 59 */ TCP_LOG_SENDFILE, /* sendfile() logging for TCP connections 60 */ - TCP_LOG_HTTP_T, /* logging of http request tracking 61 */ + TCP_LOG_REQ_T, /* logging of request tracking 61 */ TCP_LOG_ACCOUNTING, /* Log of TCP Accounting data 62 */ TCP_LOG_FSB, /* FSB information 63 */ RACK_DSACK_HANDLING, /* Handling of DSACK in rack for reordering window 64 */ @@ -371,7 +371,7 @@ struct tcp_log_dev_log_queue { #define TCP_TP_ENOBUF 0x00000002 /* When we hit enobufs with software pacing */ #define TCP_TP_COLLAPSED_WND 0x00000003 /* When a peer to collapses its rwnd on us */ #define TCP_TP_COLLAPSED_RXT 0x00000004 /* When we actually retransmit a collapsed window rsm */ -#define TCP_TP_HTTP_LOG_FAIL 0x00000005 /* We tried to allocate a HTTP log but had no space */ +#define TCP_TP_REQ_LOG_FAIL 0x00000005 /* We tried to allocate a Request log but had no space */ #define TCP_TP_RESET_RCV 0x00000006 /* Triggers when we receive a RST */ #define TCP_TP_EXCESS_RXT 0x00000007 /* When we get excess RXT's clamping the cwnd */ #define TCP_TP_SAD_TRIGGERED 0x00000008 /* Sack Attack Detection triggers */ @@ -511,7 +511,7 @@ tcp_trace_point(struct tcpcb *tp, int num) * your point will never come out. You specify your defined point in the bbpoint * side of the inline. An example of this you can find in rack where the * TCP_BBPOINT_REQ_LEVEL_LOGGING is used. There a specific set of logs are generated - * for each http request that rack is tracking. + * for each request that tcp is tracking. * * When turning on BB logging use the inline: * tcp_set_bblog_state(struct tcpcb *tp, uint8_t ls, uint8_t bbpoint) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 44606c287f25..affd135bb453 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -559,7 +559,7 @@ static int rack_do_syn_sent(struct mbuf *m, struct tcphdr *th, struct socket *so, struct tcpcb *tp, struct tcpopt *to, int32_t drop_hdrlen, int32_t tlen, uint32_t tiwin, int32_t thflags, int32_t nxt_pkt, uint8_t iptos); -static void rack_chk_http_and_hybrid_on_out(struct tcp_rack *rack, tcp_seq seq, uint32_t len, uint64_t cts); +static void rack_chk_req_and_hybrid_on_out(struct tcp_rack *rack, tcp_seq seq, uint32_t len, uint64_t cts); struct rack_sendmap * tcp_rack_output(struct tcpcb *tp, struct tcp_rack *rack, uint32_t tsused); @@ -1967,7 +1967,7 @@ rack_get_fixed_pacing_bw(struct tcp_rack *rack) static void rack_log_hybrid_bw(struct tcp_rack *rack, uint32_t seq, uint64_t cbw, uint64_t tim, uint64_t data, uint8_t mod, uint16_t aux, - struct http_sendfile_track *cur) + struct tcp_sendfile_track *cur) { #ifdef TCP_REQUEST_TRK int do_log = 0; @@ -2049,8 +2049,8 @@ rack_log_hybrid_bw(struct tcp_rack *rack, uint32_t seq, uint64_t cbw, uint64_t t /* localtime = */ log.u_bbr.applimited = (uint32_t)(cur->localtime & 0x00000000ffffffff); log.u_bbr.delivered = (uint32_t)((cur->localtime >> 32) & 0x00000000ffffffff); - off = (uint64_t)(cur) - (uint64_t)(&rack->rc_tp->t_http_info[0]); - log.u_bbr.bbr_substate = (uint8_t)(off / sizeof(struct http_sendfile_track)); + off = (uint64_t)(cur) - (uint64_t)(&rack->rc_tp->t_tcpreq_info[0]); + log.u_bbr.bbr_substate = (uint8_t)(off / sizeof(struct tcp_sendfile_track)); log.u_bbr.flex4 = (uint32_t)(rack->rc_tp->t_sndbytes - cur->sent_at_fs); log.u_bbr.flex5 = (uint32_t)(rack->rc_tp->t_snd_rxt_bytes - cur->rxt_at_fs); log.u_bbr.flex7 = (uint16_t)cur->hybrid_flags; @@ -2126,7 +2126,7 @@ rack_rate_cap_bw(struct tcp_rack *rack, uint64_t *bw, int *capped) * is in bw_rate_cap, but we need to look at * how long it is until we hit the deadline. */ - struct http_sendfile_track *ent; + struct tcp_sendfile_track *ent; ent = rack->r_ctl.rc_last_sft; microuptime(&tv); @@ -2153,7 +2153,7 @@ rack_rate_cap_bw(struct tcp_rack *rack, uint64_t *bw, int *capped) * Now ideally we want to use the end_seq to figure out how much more * but it might not be possible (only if we have the TRACK_FG_COMP on the entry.. */ - if (ent->flags & TCP_HTTP_TRACK_FLG_COMP) { + if (ent->flags & TCP_TRK_TRACK_FLG_COMP) { if (SEQ_GT(ent->end_seq, rack->rc_tp->snd_una)) lenleft = ent->end_seq - rack->rc_tp->snd_una; else { @@ -8364,7 +8364,7 @@ rack_log_output(struct tcpcb *tp, struct tcpopt *to, int32_t len, /* First question is it a retransmission or new? */ if (seq_out == snd_max) { /* Its new */ - rack_chk_http_and_hybrid_on_out(rack, seq_out, len, cts); + rack_chk_req_and_hybrid_on_out(rack, seq_out, len, cts); again: rsm = rack_alloc(rack); if (rsm == NULL) { @@ -11552,7 +11552,7 @@ rack_check_bottom_drag(struct tcpcb *tp, #ifdef TCP_REQUEST_TRK static void rack_log_hybrid(struct tcp_rack *rack, uint32_t seq, - struct http_sendfile_track *cur, uint8_t mod, int line, int err) + struct tcp_sendfile_track *cur, uint8_t mod, int line, int err) { int do_log; @@ -11593,8 +11593,8 @@ rack_log_hybrid(struct tcp_rack *rack, uint32_t seq, log.u_bbr.epoch = (uint32_t)(cur->deadline & 0x00000000ffffffff); log.u_bbr.lt_epoch = (uint32_t)((cur->deadline >> 32) & 0x00000000ffffffff) ; log.u_bbr.bbr_state = 1; - off = (uint64_t)(cur) - (uint64_t)(&rack->rc_tp->t_http_info[0]); - log.u_bbr.use_lt_bw = (uint8_t)(off / sizeof(struct http_sendfile_track)); + off = (uint64_t)(cur) - (uint64_t)(&rack->rc_tp->t_tcpreq_info[0]); + log.u_bbr.use_lt_bw = (uint8_t)(off / sizeof(struct tcp_sendfile_track)); } else { log.u_bbr.flex2 = err; } @@ -11626,15 +11626,15 @@ rack_log_hybrid(struct tcp_rack *rack, uint32_t seq, static void rack_set_dgp_hybrid_mode(struct tcp_rack *rack, tcp_seq seq, uint32_t len) { - struct http_sendfile_track *rc_cur; + struct tcp_sendfile_track *rc_cur; struct tcpcb *tp; int err = 0; - rc_cur = tcp_http_find_req_for_seq(rack->rc_tp, seq); + rc_cur = tcp_req_find_req_for_seq(rack->rc_tp, seq); if (rc_cur == NULL) { /* If not in the beginning what about the end piece */ rack_log_hybrid(rack, seq, NULL, HYBRID_LOG_NO_RANGE, __LINE__, err); - rc_cur = tcp_http_find_req_for_seq(rack->rc_tp, (seq + len - 1)); + rc_cur = tcp_req_find_req_for_seq(rack->rc_tp, (seq + len - 1)); } else { err = 12345; } @@ -11728,14 +11728,14 @@ rack_set_dgp_hybrid_mode(struct tcp_rack *rack, tcp_seq seq, uint32_t len) #endif static void -rack_chk_http_and_hybrid_on_out(struct tcp_rack *rack, tcp_seq seq, uint32_t len, uint64_t cts) +rack_chk_req_and_hybrid_on_out(struct tcp_rack *rack, tcp_seq seq, uint32_t len, uint64_t cts) { #ifdef TCP_REQUEST_TRK - struct http_sendfile_track *ent; + struct tcp_sendfile_track *ent; ent = rack->r_ctl.rc_last_sft; if ((ent == NULL) || - (ent->flags == TCP_HTTP_TRACK_FLG_EMPTY) || + (ent->flags == TCP_TRK_TRACK_FLG_EMPTY) || (SEQ_GEQ(seq, ent->end_seq))) { /* Time to update the track. */ rack_set_dgp_hybrid_mode(rack, seq, len); @@ -11760,8 +11760,8 @@ rack_chk_http_and_hybrid_on_out(struct tcp_rack *rack, tcp_seq seq, uint32_t len rack_log_hybrid_bw(rack, seq, len, 0, 0, HYBRID_LOG_EXTEND, 0, ent); } /* Now validate we have set the send time of this one */ - if ((ent->flags & TCP_HTTP_TRACK_FLG_FSND) == 0) { - ent->flags |= TCP_HTTP_TRACK_FLG_FSND; + if ((ent->flags & TCP_TRK_TRACK_FLG_FSND) == 0) { + ent->flags |= TCP_TRK_TRACK_FLG_FSND; ent->first_send = cts; ent->sent_at_fs = rack->rc_tp->t_sndbytes; ent->rxt_at_fs = rack->rc_tp->t_snd_rxt_bytes; @@ -11908,9 +11908,9 @@ rack_adjust_sendmap_head(struct tcp_rack *rack, struct sockbuf *sb) #ifdef TCP_REQUEST_TRK static inline void -rack_http_check_for_comp(struct tcp_rack *rack, tcp_seq th_ack) +rack_req_check_for_comp(struct tcp_rack *rack, tcp_seq th_ack) { - struct http_sendfile_track *ent; + struct tcp_sendfile_track *ent; int i; if ((rack->rc_hybrid_mode == 0) && @@ -11919,7 +11919,7 @@ rack_http_check_for_comp(struct tcp_rack *rack, tcp_seq th_ack) * Just do normal completions hybrid pacing is not on * and CLDL is off as well. */ - tcp_http_check_for_comp(rack->rc_tp, th_ack); + tcp_req_check_for_comp(rack->rc_tp, th_ack); return; } /* @@ -11929,12 +11929,12 @@ rack_http_check_for_comp(struct tcp_rack *rack, tcp_seq th_ack) * need to find all entries that are completed by th_ack not * just a single entry and do our logging. */ - ent = tcp_http_find_a_req_that_is_completed_by(rack->rc_tp, th_ack, &i); + ent = tcp_req_find_a_req_that_is_completed_by(rack->rc_tp, th_ack, &i); while (ent != NULL) { /* * We may be doing hybrid pacing or CLDL and need more details possibly * so we do it manually instead of calling - * tcp_http_check_for_comp() + * tcp_req_check_for_comp() */ uint64_t laa, tim, data, cbw, ftim; @@ -11944,7 +11944,7 @@ rack_http_check_for_comp(struct tcp_rack *rack, tcp_seq th_ack) /* calculate the time based on the ack arrival */ data = ent->end - ent->start; laa = tcp_tv_to_lusectick(&rack->r_ctl.act_rcv_time); - if (ent->flags & TCP_HTTP_TRACK_FLG_FSND) { + if (ent->flags & TCP_TRK_TRACK_FLG_FSND) { if (ent->first_send > ent->localtime) ftim = ent->first_send; else @@ -11971,11 +11971,11 @@ rack_http_check_for_comp(struct tcp_rack *rack, tcp_seq th_ack) if (ent == rack->r_ctl.rc_last_sft) rack->r_ctl.rc_last_sft = NULL; /* Generate the log that the tcp_netflix call would have */ - tcp_http_log_req_info(rack->rc_tp, ent, - i, TCP_HTTP_REQ_LOG_FREED, 0, 0); + tcp_req_log_req_info(rack->rc_tp, ent, + i, TCP_TRK_REQ_LOG_FREED, 0, 0); /* Free it and see if there is another one */ - tcp_http_free_a_slot(rack->rc_tp, ent); - ent = tcp_http_find_a_req_that_is_completed_by(rack->rc_tp, th_ack, &i); + tcp_req_free_a_slot(rack->rc_tp, ent); + ent = tcp_req_find_a_req_that_is_completed_by(rack->rc_tp, th_ack, &i); } } #endif @@ -12126,7 +12126,7 @@ rack_process_ack(struct mbuf *m, struct tcphdr *th, struct socket *so, if (rack->r_ctl.rc_hpts_flags & PACE_TMR_RXT) rack_timer_cancel(tp, rack, rack->r_ctl.rc_rcvtime, __LINE__); #ifdef TCP_REQUEST_TRK - rack_http_check_for_comp(rack, th->th_ack); + rack_req_check_for_comp(rack, th->th_ack); #endif } /* @@ -12984,7 +12984,7 @@ rack_fastack(struct mbuf *m, struct tcphdr *th, struct socket *so, rack_timer_cancel(tp, rack, rack->r_ctl.rc_rcvtime, __LINE__); #ifdef TCP_REQUEST_TRK - rack_http_check_for_comp(rack, th->th_ack); + rack_req_check_for_comp(rack, th->th_ack); #endif } /* @@ -15571,12 +15571,12 @@ rack_log_input_packet(struct tcpcb *tp, struct tcp_rack *rack, struct tcp_ackent uint8_t xx = 0; #ifdef TCP_REQUEST_TRK - struct http_sendfile_track *http_req; + struct tcp_sendfile_track *tcp_req; if (SEQ_GT(ae->ack, tp->snd_una)) { - http_req = tcp_http_find_req_for_seq(tp, (ae->ack-1)); + tcp_req = tcp_req_find_req_for_seq(tp, (ae->ack-1)); } else { - http_req = tcp_http_find_req_for_seq(tp, ae->ack); + tcp_req = tcp_req_find_req_for_seq(tp, ae->ack); } #endif memset(&log.u_bbr, 0, sizeof(log.u_bbr)); @@ -15618,29 +15618,29 @@ rack_log_input_packet(struct tcpcb *tp, struct tcp_rack *rack, struct tcp_ackent /* Log the rcv time */ log.u_bbr.delRate = ae->timestamp; #ifdef TCP_REQUEST_TRK - log.u_bbr.applimited = tp->t_http_closed; + log.u_bbr.applimited = tp->t_tcpreq_closed; log.u_bbr.applimited <<= 8; - log.u_bbr.applimited |= tp->t_http_open; + log.u_bbr.applimited |= tp->t_tcpreq_open; log.u_bbr.applimited <<= 8; - log.u_bbr.applimited |= tp->t_http_req; - if (http_req) { + log.u_bbr.applimited |= tp->t_tcpreq_req; + if (tcp_req) { /* Copy out any client req info */ /* seconds */ - log.u_bbr.pkt_epoch = (http_req->localtime / HPTS_USEC_IN_SEC); + log.u_bbr.pkt_epoch = (tcp_req->localtime / HPTS_USEC_IN_SEC); /* useconds */ - log.u_bbr.delivered = (http_req->localtime % HPTS_USEC_IN_SEC); - log.u_bbr.rttProp = http_req->timestamp; - log.u_bbr.cur_del_rate = http_req->start; - if (http_req->flags & TCP_HTTP_TRACK_FLG_OPEN) { + log.u_bbr.delivered = (tcp_req->localtime % HPTS_USEC_IN_SEC); + log.u_bbr.rttProp = tcp_req->timestamp; + log.u_bbr.cur_del_rate = tcp_req->start; + if (tcp_req->flags & TCP_TRK_TRACK_FLG_OPEN) { log.u_bbr.flex8 |= 1; } else { log.u_bbr.flex8 |= 2; - log.u_bbr.bw_inuse = http_req->end; + log.u_bbr.bw_inuse = tcp_req->end; } - log.u_bbr.flex6 = http_req->start_seq; - if (http_req->flags & TCP_HTTP_TRACK_FLG_COMP) { + log.u_bbr.flex6 = tcp_req->start_seq; + if (tcp_req->flags & TCP_TRK_TRACK_FLG_COMP) { log.u_bbr.flex8 |= 4; - log.u_bbr.epoch = http_req->end_seq; + log.u_bbr.epoch = tcp_req->end_seq; } } #endif @@ -16028,7 +16028,7 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mb rack_process_to_cumack(tp, rack, ae->ack, cts, to, tcp_tv_to_lusectick(&rack->r_ctl.act_rcv_time)); #ifdef TCP_REQUEST_TRK - rack_http_check_for_comp(rack, high_seq); + rack_req_check_for_comp(rack, high_seq); #endif if (rack->rc_dsack_round_seen) { /* Is the dsack round over? */ @@ -16665,12 +16665,12 @@ rack_do_segment_nounlock(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, union tcp_log_stackspecific log; struct timeval ltv; #ifdef TCP_REQUEST_TRK - struct http_sendfile_track *http_req; + struct tcp_sendfile_track *tcp_req; if (SEQ_GT(th->th_ack, tp->snd_una)) { - http_req = tcp_http_find_req_for_seq(tp, (th->th_ack-1)); + tcp_req = tcp_req_find_req_for_seq(tp, (th->th_ack-1)); } else { - http_req = tcp_http_find_req_for_seq(tp, th->th_ack); + tcp_req = tcp_req_find_req_for_seq(tp, th->th_ack); } #endif memset(&log.u_bbr, 0, sizeof(log.u_bbr)); @@ -16711,29 +16711,29 @@ rack_do_segment_nounlock(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, /* Log the rcv time */ log.u_bbr.delRate = m->m_pkthdr.rcv_tstmp; #ifdef TCP_REQUEST_TRK - log.u_bbr.applimited = tp->t_http_closed; + log.u_bbr.applimited = tp->t_tcpreq_closed; log.u_bbr.applimited <<= 8; - log.u_bbr.applimited |= tp->t_http_open; + log.u_bbr.applimited |= tp->t_tcpreq_open; log.u_bbr.applimited <<= 8; - log.u_bbr.applimited |= tp->t_http_req; - if (http_req) { + log.u_bbr.applimited |= tp->t_tcpreq_req; + if (tcp_req) { /* Copy out any client req info */ /* seconds */ - log.u_bbr.pkt_epoch = (http_req->localtime / HPTS_USEC_IN_SEC); + log.u_bbr.pkt_epoch = (tcp_req->localtime / HPTS_USEC_IN_SEC); /* useconds */ - log.u_bbr.delivered = (http_req->localtime % HPTS_USEC_IN_SEC); - log.u_bbr.rttProp = http_req->timestamp; - log.u_bbr.cur_del_rate = http_req->start; - if (http_req->flags & TCP_HTTP_TRACK_FLG_OPEN) { + log.u_bbr.delivered = (tcp_req->localtime % HPTS_USEC_IN_SEC); + log.u_bbr.rttProp = tcp_req->timestamp; + log.u_bbr.cur_del_rate = tcp_req->start; + if (tcp_req->flags & TCP_TRK_TRACK_FLG_OPEN) { log.u_bbr.flex8 |= 1; } else { log.u_bbr.flex8 |= 2; - log.u_bbr.bw_inuse = http_req->end; + log.u_bbr.bw_inuse = tcp_req->end; } - log.u_bbr.flex6 = http_req->start_seq; - if (http_req->flags & TCP_HTTP_TRACK_FLG_COMP) { + log.u_bbr.flex6 = tcp_req->start_seq; + if (tcp_req->flags & TCP_TRK_TRACK_FLG_COMP) { log.u_bbr.flex8 |= 4; - log.u_bbr.epoch = http_req->end_seq; + log.u_bbr.epoch = tcp_req->end_seq; } } #endif @@ -22603,7 +22603,7 @@ static int process_hybrid_pacing(struct tcp_rack *rack, struct tcp_hybrid_req *hybrid) { #ifdef TCP_REQUEST_TRK - struct http_sendfile_track *sft; + struct tcp_sendfile_track *sft; struct timeval tv; tcp_seq seq; int err; @@ -22629,7 +22629,7 @@ process_hybrid_pacing(struct tcp_rack *rack, struct tcp_hybrid_req *hybrid) rack->r_ctl.rc_fixed_pacing_rate_ca = 0; rack->r_ctl.rc_fixed_pacing_rate_ss = 0; /* Now allocate or find our entry that will have these settings */ - sft = tcp_http_alloc_req_full(rack->rc_tp, &hybrid->req, tcp_tv_to_lusectick(&tv), 0); + sft = tcp_req_alloc_req_full(rack->rc_tp, &hybrid->req, tcp_tv_to_lusectick(&tv), 0); if (sft == NULL) { rack->rc_tp->tcp_hybrid_error++; /* no space, where would it have gone? */ diff --git a/sys/netinet/tcp_stacks/tcp_rack.h b/sys/netinet/tcp_stacks/tcp_rack.h index fbf7b4bddda9..8e34fc33ef18 100644 --- a/sys/netinet/tcp_stacks/tcp_rack.h +++ b/sys/netinet/tcp_stacks/tcp_rack.h @@ -452,7 +452,7 @@ struct rack_control { uint64_t lt_bw_time; /* Total time with data outstanding (lt_bw = long term bandwidth) */ uint64_t lt_bw_bytes; /* Total bytes acked */ uint64_t lt_timemark; /* 64 bit timestamp when we started sending */ - struct http_sendfile_track *rc_last_sft; + struct tcp_sendfile_track *rc_last_sft; uint32_t lt_seq; /* Seq at start of lt_bw gauge */ int32_t rc_rtt_diff; /* Timely style rtt diff of our gp_srtt */ uint64_t last_sndbytes; diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 7e156bcd5355..8636ff4cefeb 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -4304,10 +4304,10 @@ tcp_estimate_tls_overhead(struct socket *so, uint64_t tls_usr_bytes) extern uint32_t tcp_stale_entry_time; uint32_t tcp_stale_entry_time = 250000; SYSCTL_UINT(_net_inet_tcp, OID_AUTO, usrlog_stale, CTLFLAG_RW, - &tcp_stale_entry_time, 250000, "Time that a http entry without a sendfile ages out"); + &tcp_stale_entry_time, 250000, "Time that a tcpreq entry without a sendfile ages out"); void -tcp_http_log_req_info(struct tcpcb *tp, struct http_sendfile_track *http, +tcp_req_log_req_info(struct tcpcb *tp, struct tcp_sendfile_track *req, uint16_t slot, uint8_t val, uint64_t offset, uint64_t nbytes) { if (tcp_bblogging_on(tp)) { @@ -4319,61 +4319,61 @@ tcp_http_log_req_info(struct tcpcb *tp, struct http_sendfile_track *http, log.u_bbr.inhpts = tcp_in_hpts(tp); #endif log.u_bbr.flex8 = val; - log.u_bbr.rttProp = http->timestamp; - log.u_bbr.delRate = http->start; - log.u_bbr.cur_del_rate = http->end; - log.u_bbr.flex1 = http->start_seq; - log.u_bbr.flex2 = http->end_seq; - log.u_bbr.flex3 = http->flags; - log.u_bbr.flex4 = ((http->localtime >> 32) & 0x00000000ffffffff); - log.u_bbr.flex5 = (http->localtime & 0x00000000ffffffff); + log.u_bbr.rttProp = req->timestamp; + log.u_bbr.delRate = req->start; + log.u_bbr.cur_del_rate = req->end; + log.u_bbr.flex1 = req->start_seq; + log.u_bbr.flex2 = req->end_seq; + log.u_bbr.flex3 = req->flags; + log.u_bbr.flex4 = ((req->localtime >> 32) & 0x00000000ffffffff); + log.u_bbr.flex5 = (req->localtime & 0x00000000ffffffff); log.u_bbr.flex7 = slot; log.u_bbr.bw_inuse = offset; /* nbytes = flex6 | epoch */ log.u_bbr.flex6 = ((nbytes >> 32) & 0x00000000ffffffff); log.u_bbr.epoch = (nbytes & 0x00000000ffffffff); /* cspr = lt_epoch | pkts_out */ - log.u_bbr.lt_epoch = ((http->cspr >> 32) & 0x00000000ffffffff); - log.u_bbr.pkts_out |= (http->cspr & 0x00000000ffffffff); - log.u_bbr.applimited = tp->t_http_closed; + log.u_bbr.lt_epoch = ((req->cspr >> 32) & 0x00000000ffffffff); + log.u_bbr.pkts_out |= (req->cspr & 0x00000000ffffffff); + log.u_bbr.applimited = tp->t_tcpreq_closed; log.u_bbr.applimited <<= 8; - log.u_bbr.applimited |= tp->t_http_open; + log.u_bbr.applimited |= tp->t_tcpreq_open; log.u_bbr.applimited <<= 8; - log.u_bbr.applimited |= tp->t_http_req; + log.u_bbr.applimited |= tp->t_tcpreq_req; log.u_bbr.timeStamp = tcp_get_usecs(&tv); TCP_LOG_EVENTP(tp, NULL, &tptosocket(tp)->so_rcv, &tptosocket(tp)->so_snd, - TCP_LOG_HTTP_T, 0, + TCP_LOG_REQ_T, 0, 0, &log, false, &tv); } } void -tcp_http_free_a_slot(struct tcpcb *tp, struct http_sendfile_track *ent) +tcp_req_free_a_slot(struct tcpcb *tp, struct tcp_sendfile_track *ent) { - if (tp->t_http_req > 0) - tp->t_http_req--; - if (ent->flags & TCP_HTTP_TRACK_FLG_OPEN) { - if (tp->t_http_open > 0) - tp->t_http_open--; + if (tp->t_tcpreq_req > 0) + tp->t_tcpreq_req--; + if (ent->flags & TCP_TRK_TRACK_FLG_OPEN) { + if (tp->t_tcpreq_open > 0) + tp->t_tcpreq_open--; } else { - if (tp->t_http_closed > 0) - tp->t_http_closed--; + if (tp->t_tcpreq_closed > 0) + tp->t_tcpreq_closed--; } - ent->flags = TCP_HTTP_TRACK_FLG_EMPTY; + ent->flags = TCP_TRK_TRACK_FLG_EMPTY; } static void -tcp_http_check_for_stale_entries(struct tcpcb *tp, uint64_t ts, int rm_oldest) +tcp_req_check_for_stale_entries(struct tcpcb *tp, uint64_t ts, int rm_oldest) { - struct http_sendfile_track *ent; + struct tcp_sendfile_track *ent; uint64_t time_delta, oldest_delta; int i, oldest, oldest_set = 0, cnt_rm = 0; - for(i = 0; i < MAX_TCP_HTTP_REQ; i++) { - ent = &tp->t_http_info[i]; - if (ent->flags != TCP_HTTP_TRACK_FLG_USED) { + for(i = 0; i < MAX_TCP_TRK_REQ; i++) { + ent = &tp->t_tcpreq_info[i]; + if (ent->flags != TCP_TRK_TRACK_FLG_USED) { /* * We only care about closed end ranges * that are allocated and have no sendfile @@ -4398,43 +4398,43 @@ tcp_http_check_for_stale_entries(struct tcpcb *tp, uint64_t ts, int rm_oldest) * time to purge it. */ cnt_rm++; - tcp_http_log_req_info(tp, &tp->t_http_info[i], i, TCP_HTTP_REQ_LOG_STALE, + tcp_req_log_req_info(tp, &tp->t_tcpreq_info[i], i, TCP_TRK_REQ_LOG_STALE, time_delta, 0); - tcp_http_free_a_slot(tp, ent); + tcp_req_free_a_slot(tp, ent); } } if ((cnt_rm == 0) && rm_oldest && oldest_set) { - ent = &tp->t_http_info[oldest]; - tcp_http_log_req_info(tp, &tp->t_http_info[i], i, TCP_HTTP_REQ_LOG_STALE, + ent = &tp->t_tcpreq_info[oldest]; + tcp_req_log_req_info(tp, &tp->t_tcpreq_info[i], i, TCP_TRK_REQ_LOG_STALE, oldest_delta, 1); - tcp_http_free_a_slot(tp, ent); + tcp_req_free_a_slot(tp, ent); } } int -tcp_http_check_for_comp(struct tcpcb *tp, tcp_seq ack_point) +tcp_req_check_for_comp(struct tcpcb *tp, tcp_seq ack_point) { int i, ret=0; - struct http_sendfile_track *ent; + struct tcp_sendfile_track *ent; /* Clean up any old closed end requests that are now completed */ - if (tp->t_http_req == 0) + if (tp->t_tcpreq_req == 0) return(0); - if (tp->t_http_closed == 0) + if (tp->t_tcpreq_closed == 0) return(0); - for(i = 0; i < MAX_TCP_HTTP_REQ; i++) { - ent = &tp->t_http_info[i]; + for(i = 0; i < MAX_TCP_TRK_REQ; i++) { + ent = &tp->t_tcpreq_info[i]; /* Skip empty ones */ - if (ent->flags == TCP_HTTP_TRACK_FLG_EMPTY) + if (ent->flags == TCP_TRK_TRACK_FLG_EMPTY) continue; /* Skip open ones */ - if (ent->flags & TCP_HTTP_TRACK_FLG_OPEN) + if (ent->flags & TCP_TRK_TRACK_FLG_OPEN) continue; if (SEQ_GEQ(ack_point, ent->end_seq)) { /* We are past it -- free it */ - tcp_http_log_req_info(tp, ent, - i, TCP_HTTP_REQ_LOG_FREED, 0, 0); - tcp_http_free_a_slot(tp, ent); + tcp_req_log_req_info(tp, ent, + i, TCP_TRK_REQ_LOG_FREED, 0, 0); + tcp_req_free_a_slot(tp, ent); ret++; } } @@ -4442,13 +4442,13 @@ tcp_http_check_for_comp(struct tcpcb *tp, tcp_seq ack_point) } int -tcp_http_is_entry_comp(struct tcpcb *tp, struct http_sendfile_track *ent, tcp_seq ack_point) +tcp_req_is_entry_comp(struct tcpcb *tp, struct tcp_sendfile_track *ent, tcp_seq ack_point) { - if (tp->t_http_req == 0) + if (tp->t_tcpreq_req == 0) return(-1); - if (tp->t_http_closed == 0) + if (tp->t_tcpreq_closed == 0) return(-1); - if (ent->flags == TCP_HTTP_TRACK_FLG_EMPTY) + if (ent->flags == TCP_TRK_TRACK_FLG_EMPTY) return(-1); if (SEQ_GEQ(ack_point, ent->end_seq)) { return (1); @@ -4456,26 +4456,26 @@ tcp_http_is_entry_comp(struct tcpcb *tp, struct http_sendfile_track *ent, tcp_se return (0); } -struct http_sendfile_track * -tcp_http_find_a_req_that_is_completed_by(struct tcpcb *tp, tcp_seq th_ack, int *ip) +struct tcp_sendfile_track * +tcp_req_find_a_req_that_is_completed_by(struct tcpcb *tp, tcp_seq th_ack, int *ip) { /* * Given an ack point (th_ack) walk through our entries and * return the first one found that th_ack goes past the * end_seq. */ - struct http_sendfile_track *ent; + struct tcp_sendfile_track *ent; int i; - if (tp->t_http_req == 0) { + if (tp->t_tcpreq_req == 0) { /* none open */ return (NULL); } - for(i = 0; i < MAX_TCP_HTTP_REQ; i++) { - ent = &tp->t_http_info[i]; - if (ent->flags == TCP_HTTP_TRACK_FLG_EMPTY) + for(i = 0; i < MAX_TCP_TRK_REQ; i++) { + ent = &tp->t_tcpreq_info[i]; + if (ent->flags == TCP_TRK_TRACK_FLG_EMPTY) continue; - if ((ent->flags & TCP_HTTP_TRACK_FLG_OPEN) == 0) { + if ((ent->flags & TCP_TRK_TRACK_FLG_OPEN) == 0) { if (SEQ_GEQ(th_ack, ent->end_seq)) { *ip = i; return (ent); @@ -4485,24 +4485,24 @@ tcp_http_find_a_req_that_is_completed_by(struct tcpcb *tp, tcp_seq th_ack, int * return (NULL); } -struct http_sendfile_track * -tcp_http_find_req_for_seq(struct tcpcb *tp, tcp_seq seq) +struct tcp_sendfile_track * +tcp_req_find_req_for_seq(struct tcpcb *tp, tcp_seq seq) { - struct http_sendfile_track *ent; + struct tcp_sendfile_track *ent; int i; - if (tp->t_http_req == 0) { + if (tp->t_tcpreq_req == 0) { /* none open */ return (NULL); } - for(i = 0; i < MAX_TCP_HTTP_REQ; i++) { - ent = &tp->t_http_info[i]; - tcp_http_log_req_info(tp, ent, i, TCP_HTTP_REQ_LOG_SEARCH, + for(i = 0; i < MAX_TCP_TRK_REQ; i++) { + ent = &tp->t_tcpreq_info[i]; + tcp_req_log_req_info(tp, ent, i, TCP_TRK_REQ_LOG_SEARCH, (uint64_t)seq, 0); - if (ent->flags == TCP_HTTP_TRACK_FLG_EMPTY) { + if (ent->flags == TCP_TRK_TRACK_FLG_EMPTY) { continue; } - if (ent->flags & TCP_HTTP_TRACK_FLG_OPEN) { + if (ent->flags & TCP_TRK_TRACK_FLG_OPEN) { /* * An open end request only needs to * match the beginning seq or be @@ -4511,7 +4511,7 @@ tcp_http_find_req_for_seq(struct tcpcb *tp, tcp_seq seq) * wrap). */ if ((SEQ_GEQ(seq, ent->start_seq)) || - (tp->t_http_closed == 0)) + (tp->t_tcpreq_closed == 0)) return (ent); } else { /* @@ -4528,28 +4528,28 @@ tcp_http_find_req_for_seq(struct tcpcb *tp, tcp_seq seq) return (NULL); } -/* Should this be in its own file tcp_http.c ? */ -struct http_sendfile_track * -tcp_http_alloc_req_full(struct tcpcb *tp, struct http_req *req, uint64_t ts, int rec_dups) +/* Should this be in its own file tcp_req.c ? */ +struct tcp_sendfile_track * +tcp_req_alloc_req_full(struct tcpcb *tp, struct tcp_snd_req *req, uint64_t ts, int rec_dups) { - struct http_sendfile_track *fil; + struct tcp_sendfile_track *fil; int i, allocated; /* In case the stack does not check for completions do so now */ - tcp_http_check_for_comp(tp, tp->snd_una); + tcp_req_check_for_comp(tp, tp->snd_una); /* Check for stale entries */ - if (tp->t_http_req) - tcp_http_check_for_stale_entries(tp, ts, - (tp->t_http_req >= MAX_TCP_HTTP_REQ)); + if (tp->t_tcpreq_req) + tcp_req_check_for_stale_entries(tp, ts, + (tp->t_tcpreq_req >= MAX_TCP_TRK_REQ)); /* Check to see if this is a duplicate of one not started */ - if (tp->t_http_req) { - for(i = 0, allocated = 0; i < MAX_TCP_HTTP_REQ; i++) { - fil = &tp->t_http_info[i]; - if (fil->flags != TCP_HTTP_TRACK_FLG_USED) + if (tp->t_tcpreq_req) { + for(i = 0, allocated = 0; i < MAX_TCP_TRK_REQ; i++) { + fil = &tp->t_tcpreq_info[i]; + if (fil->flags != TCP_TRK_TRACK_FLG_USED) continue; if ((fil->timestamp == req->timestamp) && (fil->start == req->start) && - ((fil->flags & TCP_HTTP_TRACK_FLG_OPEN) || + ((fil->flags & TCP_TRK_TRACK_FLG_OPEN) || (fil->end == req->end))) { /* * We already have this request @@ -4563,19 +4563,19 @@ tcp_http_alloc_req_full(struct tcpcb *tp, struct http_req *req, uint64_t ts, int } } /* Ok if there is no room at the inn we are in trouble */ - if (tp->t_http_req >= MAX_TCP_HTTP_REQ) { - tcp_trace_point(tp, TCP_TP_HTTP_LOG_FAIL); - for(i = 0; i < MAX_TCP_HTTP_REQ; i++) { - tcp_http_log_req_info(tp, &tp->t_http_info[i], - i, TCP_HTTP_REQ_LOG_ALLOCFAIL, 0, 0); + if (tp->t_tcpreq_req >= MAX_TCP_TRK_REQ) { + tcp_trace_point(tp, TCP_TP_REQ_LOG_FAIL); + for(i = 0; i < MAX_TCP_TRK_REQ; i++) { + tcp_req_log_req_info(tp, &tp->t_tcpreq_info[i], + i, TCP_TRK_REQ_LOG_ALLOCFAIL, 0, 0); } return (NULL); } - for(i = 0, allocated = 0; i < MAX_TCP_HTTP_REQ; i++) { - fil = &tp->t_http_info[i]; - if (fil->flags == TCP_HTTP_TRACK_FLG_EMPTY) { + for(i = 0, allocated = 0; i < MAX_TCP_TRK_REQ; i++) { + fil = &tp->t_tcpreq_info[i]; + if (fil->flags == TCP_TRK_TRACK_FLG_EMPTY) { allocated = 1; - fil->flags = TCP_HTTP_TRACK_FLG_USED; + fil->flags = TCP_TRK_TRACK_FLG_USED; fil->timestamp = req->timestamp; fil->localtime = ts; fil->start = req->start; @@ -4583,7 +4583,7 @@ tcp_http_alloc_req_full(struct tcpcb *tp, struct http_req *req, uint64_t ts, int fil->end = req->end; } else { fil->end = 0; - fil->flags |= TCP_HTTP_TRACK_FLG_OPEN; + fil->flags |= TCP_TRK_TRACK_FLG_OPEN; } /* * We can set the min boundaries to the TCP Sequence space, @@ -4602,13 +4602,13 @@ tcp_http_alloc_req_full(struct tcpcb *tp, struct http_req *req, uint64_t ts, int fil->end_seq += tcp_estimate_tls_overhead( tptosocket(tp), (fil->end - fil->start)); } - tp->t_http_req++; - if (fil->flags & TCP_HTTP_TRACK_FLG_OPEN) - tp->t_http_open++; + tp->t_tcpreq_req++; + if (fil->flags & TCP_TRK_TRACK_FLG_OPEN) + tp->t_tcpreq_open++; else - tp->t_http_closed++; - tcp_http_log_req_info(tp, fil, i, - TCP_HTTP_REQ_LOG_NEW, 0, 0); + tp->t_tcpreq_closed++; + tcp_req_log_req_info(tp, fil, i, + TCP_TRK_REQ_LOG_NEW, 0, 0); break; } else fil = NULL; @@ -4617,9 +4617,9 @@ tcp_http_alloc_req_full(struct tcpcb *tp, struct http_req *req, uint64_t ts, int } void -tcp_http_alloc_req(struct tcpcb *tp, union tcp_log_userdata *user, uint64_t ts) +tcp_req_alloc_req(struct tcpcb *tp, union tcp_log_userdata *user, uint64_t ts) { - (void)tcp_http_alloc_req_full(tp, &user->http_req, ts, 1); + (void)tcp_req_alloc_req_full(tp, &user->tcp_req, ts, 1); } #endif diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 680797e508a2..86345b2aa630 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -61,14 +61,14 @@ #define TCP_EI_STATUS_2MSL 0xb #define TCP_EI_STATUS_MAX_VALUE 0xb -#define TCP_HTTP_REQ_LOG_NEW 0x01 -#define TCP_HTTP_REQ_LOG_COMPLETE 0x02 -#define TCP_HTTP_REQ_LOG_FREED 0x03 -#define TCP_HTTP_REQ_LOG_ALLOCFAIL 0x04 -#define TCP_HTTP_REQ_LOG_MOREYET 0x05 -#define TCP_HTTP_REQ_LOG_FORCEFREE 0x06 -#define TCP_HTTP_REQ_LOG_STALE 0x07 -#define TCP_HTTP_REQ_LOG_SEARCH 0x08 +#define TCP_TRK_REQ_LOG_NEW 0x01 +#define TCP_TRK_REQ_LOG_COMPLETE 0x02 +#define TCP_TRK_REQ_LOG_FREED 0x03 +#define TCP_TRK_REQ_LOG_ALLOCFAIL 0x04 +#define TCP_TRK_REQ_LOG_MOREYET 0x05 +#define TCP_TRK_REQ_LOG_FORCEFREE 0x06 +#define TCP_TRK_REQ_LOG_STALE 0x07 +#define TCP_TRK_REQ_LOG_SEARCH 0x08 /************************************************/ /* Status bits we track to assure no duplicates, @@ -135,16 +135,15 @@ struct sackhint { STAILQ_HEAD(tcp_log_stailq, tcp_log_mem); -#define TCP_HTTP_TRACK_FLG_EMPTY 0x00 /* Available */ -#define TCP_HTTP_TRACK_FLG_USED 0x01 /* In use */ -#define TCP_HTTP_TRACK_FLG_OPEN 0x02 /* End is not valid (open range request) */ -#define TCP_HTTP_TRACK_FLG_SEQV 0x04 /* We had a sendfile that touched it */ -#define TCP_HTTP_TRACK_FLG_COMP 0x08 /* Sendfile as placed the last bits (range req only) */ -#define TCP_HTTP_TRACK_FLG_FSND 0x10 /* First send has been done into the seq space */ -#define MAX_TCP_HTTP_REQ 5 /* Max we will have at once */ +#define TCP_TRK_TRACK_FLG_EMPTY 0x00 /* Available */ +#define TCP_TRK_TRACK_FLG_USED 0x01 /* In use */ +#define TCP_TRK_TRACK_FLG_OPEN 0x02 /* End is not valid (open range request) */ +#define TCP_TRK_TRACK_FLG_SEQV 0x04 /* We had a sendfile that touched it */ +#define TCP_TRK_TRACK_FLG_COMP 0x08 /* Sendfile as placed the last bits (range req only) */ +#define TCP_TRK_TRACK_FLG_FSND 0x10 /* First send has been done into the seq space */ +#define MAX_TCP_TRK_REQ 5 /* Max we will have at once */ -#ifdef TCP_REQUEST_TRK -struct http_sendfile_track { +struct tcp_sendfile_track { uint64_t timestamp; /* User sent timestamp */ *** 65 LINES SKIPPED *** From nobody Wed May 24 15:08:16 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRF1X3SY8z4Cphf; Wed, 24 May 2023 15:08: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 4QRF1X2YDLz3rvF; Wed, 24 May 2023 15:08:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684940896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rb4yzO8/s31orRTXFoBzKjdcdfpDw1zpOmubYFuS9tI=; b=FUcUBO/n/EQon9DkDElYFPFVt0jsccR3B31mejW+JR9+MAeWBqOkXziiHDvdctpS3BGsEy eYsO/MpBVqNXmzuRAlbAg8lux/5dmfRJeXZ3vzmxEPavPvxiX72N4EhXuSJFDgrC/2eiu6 S0YLfhc0vTRN0YxCWzvw7Sk75CznZnMp3KdYl4D9T/ikJ8iqo9S2lIVXcd7DccsWU0Nw/8 a0yPM9Ve4cgb40fC4eGAd+Z+0Ymp54NEsIeZxlewFnYNNg6bU8B4/vAfYRG/R4X2ZJFxvu H580Q8Yllap+5SLtiR6M+cwl2J/e40EmDddEakQhpb0naaOOMwXIZE9hgxIKwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684940896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rb4yzO8/s31orRTXFoBzKjdcdfpDw1zpOmubYFuS9tI=; b=g8G1gtOhW9RLq5nQ32Yn0vO3t5dFCjOu8jfJBppH0ytL+lRnIv3rsNIMOD7gckXZZqCiB4 dAlmTply253tZ6bp09l6p473PtSSCFuE8HUywOEnjVSRiu50bfuD2NjA8ifwruGIKNnVe7 kJipaXeKD0qinrqk62dZhO6JL2kam3p10JYh+XoKioJmPY4YdejdMWCguuZxviI/qLSKV1 0+rSA/PqHh1nFXZ2DN9o69KNIwSJPigzZ3hXJnnN55c9yi2GygMsxuLgNSoCXjCuyL7wp+ qQSKbDojxV9PgbWqoJwTTOALiidkNZZze+QbXOVefW+bCfYXyQzamq6VUtfdDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684940896; a=rsa-sha256; cv=none; b=xrt+UTWJ3qH6Xc38mL0g02jElIkK4dZHupwway1PapFSRQgCNV55CuQ73aDl03QgvwkkPN 4yUj9C3HJdao7iWVNatjLCEPHInrf55u8qV/r6qONq3zrd6v27sOqjcfloC+jgXTG7Q0w5 a4iiztPpxAKUF1ojkaRFHvQfHpE/pqJjT1qmekwppUgPRbcHBQZNwi7Qg9rCOQifFkvcCT p/goANBLCa73erIMjBRK68rayIq+/uQEZFiEqD6XH7qa/StlcIKd8qNKc122/jne0r6Rfn Cbx8f91DB/OkOLVgUoS/1ws+XaxSN4/h+MUIP1p01O7ByBq8T/4wdLV/fiNsRA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRF1X1bk6zn9s; Wed, 24 May 2023 15:08:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34OF8Gnj055676; Wed, 24 May 2023 15:08:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34OF8G16055675; Wed, 24 May 2023 15:08:16 GMT (envelope-from git) Date: Wed, 24 May 2023 15:08:16 GMT Message-Id: <202305241508.34OF8G16055675@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: d1639e43c589 - main - cpuset: increase userland maximum size to 1024 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d1639e43c589644510198dc53aef87e8908a1507 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d1639e43c589644510198dc53aef87e8908a1507 commit d1639e43c589644510198dc53aef87e8908a1507 Author: Ed Maste AuthorDate: 2023-05-02 20:57:12 +0000 Commit: Ed Maste CommitDate: 2023-05-24 14:59:05 +0000 cpuset: increase userland maximum size to 1024 Hardware with more than 256 CPU cores is now available and will become increasingly common. Bump CPU_MAXSIZE (used for userland cpuset_t sizing) to 1024 to define the ABI for FreeBSD 14. This change is reapplied after a change to decouple cpuset from bhyve: commit e17eca327633 ("vmm: Avoid embedding cpuset_t ioctl ABIs"). PR: 269572, 271213 [exp-run] Reviewed by: mjg, jhb Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39941 (cherry picked from commit 76887e84be975698b14699d7d0dfb157d73e9990) --- sys/sys/_cpuset.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/_cpuset.h b/sys/sys/_cpuset.h index e7dabe249aac..dde7a4a7e16f 100644 --- a/sys/sys/_cpuset.h +++ b/sys/sys/_cpuset.h @@ -40,7 +40,7 @@ #define CPU_SETSIZE MAXCPU #endif -#define CPU_MAXSIZE 256 +#define CPU_MAXSIZE 1024 #ifndef CPU_SETSIZE #define CPU_SETSIZE CPU_MAXSIZE From nobody Wed May 24 15:21:21 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRFJg0lxsz4Cqch; Wed, 24 May 2023 15:21:23 +0000 (UTC) (envelope-from madpilot@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 4QRFJf70Rrz3wBc; Wed, 24 May 2023 15:21:22 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684941683; h=from:from:reply-to:subject: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=IVb8rv1oBU5KA/fv3lGHloTxH6OUjepFph1H7zrN/jQ=; b=TsclVofBoA2P0/LS+ZVocG/TGu7ekfL8+axvFQ4d0EOKVg2OarEHnhzxbhSDwUmIEV1n/c kMmjIKVFENdl5oX9WQHKQj0VmgnAcu+/iNS755OdYBh6ztc2O3IouNQarkETxbfRw00Iy7 BiFq0RfnkHShnZzzs1ALmqF7H2XDNkg1q/ScYAwUo+DdFROD+uBmG1weecKIan3/0W8FEj L+v8O1DG7e0AWWRUY4QMHojiWZCgVqZpnirHvq7FYaGUlsmFKYiwUiw7AtN+f6ER32vlbt jLfVUALXZnKJLdUyL1g6epSLQg7PnYDdunVlpdwhk8KzEI2jtdH6qcXKOGLckA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684941683; h=from:from:reply-to:subject: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=IVb8rv1oBU5KA/fv3lGHloTxH6OUjepFph1H7zrN/jQ=; b=o5ZoMOx1wy/McUC2VO2WtBxMq/S2pfWuEiQ9rBQpl3/nL6UCO59dLrLRo6YI7jgp8ODkP3 dk1m/YGwJOcpLqJ0lINRCCnAnMBxMh+htQYJPIRPcZ1XvnUVbIIPIW6yZ3FV05ddnT6X2Q ST/nmzAJu89C9CgXpezErX/AEMPAXXyQJDZ9RBe1UnPk6wxPSrpaIXQHHTY/EOM4tVih3L KZg9trqtwHSt6urUCWnRy5y5jOgYO/HMGnpiRsZ5ncxEFIEGI/OTcH9/T0OPgd4H88+zO+ TJxptprKT5LFDYTqu2LZn8Rx12J1l/m0T3UD4rC/PlDxJWJP660E2KZ3hwOBQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684941683; a=rsa-sha256; cv=none; b=bFhTGQKZzvQ34ahPxSdnYz34d5XmFIyTFCg3ZAxxvwRa8R1yy4w827d7AVns4XvUput6UI b1HwYBrGQ3h+kGHEOF6schdPJnm2NRCkaPCBmdGGgy5UaiiyFPcaVAUF66d9YeVVCSG2s8 P+DHdE+kire7jBhsWO/2Ph19BS5ZbSLpknpZ9aRk0ohCZ8wk1a58njvXpuod+qxUGbY36n zLkQC8LqFzlsahhLxeQMD1T8pfy2s8smdItW6aNRxFExRZHSxuXVk3lozKzVs9KzDIJfq5 elGTa6ZKMA3mklEFFK+xMRPGq9ET7pZqvGS9Dg9tEScxBj1Pg58kHGDmihMHHA== Received: from [IPV6:2a01:e11:2002:4280::13:1] (unknown [IPv6:2a01:e11:2002:4280::13:1]) (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: madpilot/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4QRFJf2JwLz14n2; Wed, 24 May 2023 15:21:22 +0000 (UTC) (envelope-from madpilot@FreeBSD.org) Message-ID: Date: Wed, 24 May 2023 17:21:21 +0200 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: git: 2c0a6d0e7b82 - main - bhyvectl: Update usage of vm_run() Content-Language: en-US To: Mark Johnston , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202305241224.34OCOK6k091133@gitrepo.freebsd.org> From: Guido Falsi In-Reply-To: <202305241224.34OCOK6k091133@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 24/05/23 14:24, Mark Johnston wrote: > The branch main has been updated by markj: > > URL: https://cgit.FreeBSD.org/src/commit/?id=2c0a6d0e7b82fbe6657fe90d990aa2e812f49b44 > > commit 2c0a6d0e7b82fbe6657fe90d990aa2e812f49b44 > Author: Mark Johnston > AuthorDate: 2023-05-24 12:17:49 +0000 > Commit: Mark Johnston > CommitDate: 2023-05-24 12:23:22 +0000 > > bhyvectl: Update usage of vm_run() > > Fixes: e17eca327633 ("vmm: Avoid embedding cpuset_t ioctl ABIs") Thanks! -- Guido Falsi From nobody Wed May 24 15:32:21 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRFYK3k4Tz4CqKS; Wed, 24 May 2023 15:32: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 4QRFYK37nbz3wyk; Wed, 24 May 2023 15:32:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684942341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=veOMchYuEH4GsKxsJjmSsURhzAreaV1wz/WBpzb537Y=; b=VOCUAwHboyLEoIwWfW/8fUI6TdJix8xwp+xKmPi0r/igWAWxqgsXEUwwTflm5YJbxfdxDA fW+hRgLsdA2bav/h8ofJSofzf6MkWrvCM3itR4g2RyBsW5o7V7px06jABgzhBTaiIjQ8eX rIUGiG1wMfEJ02IH5vn7J6wI0tA3cA+cN1+rDOO7UFfargiBjpO/zPCGeKXRTwdvwrh65C VtOnLaOJP4Ca6ytPxHT5hUwtO1Xrr/UaPfnHjWMZgHvpj3UQrkGd7ugD10/tVSQ9HaqEoH JsVYZZKwodR3uWtr/hN+N5NEqM6JO3746tK7U3huPX1ZYeHhB3GsaR1gNYKf/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684942341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=veOMchYuEH4GsKxsJjmSsURhzAreaV1wz/WBpzb537Y=; b=P/Bi4Dohquv7cpb+o58O4ZBRvMJtlPX6a1/zQcBKgupvZLlPYlNFIWK3+tTrbxg5mOmSnB UA6l6SX6m84tLvq7bIifrp/ZqoE6hSxeSLoOmcJMqx8ubsBcUmed6GZUNXhN7C7Zo33wXm pj2zp8EkMtqmLS/FEvnfKfSjFQKQtT6y9NNwNYcb3kLoGT5r4x0fcpDcC1/BsAD3n2GAWa IRRqCnmvO4j5+vjyQhDyyWNlfydTRF3LdtD/MujXRjOPnFxb6tR0ypqWjw5Z4sB1ezs4ax MP56fQxfMQcANngQV5ZzCAeU6h6di5CJY+at27qf464ViG4cBmtJ7JGJRW95Ow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684942341; a=rsa-sha256; cv=none; b=qSyO7MnLpPzXB7LeF9jZbFjghNdtqmyBS7vWpNU3u9K1liEL72S+n7jijQ3nX9dRFlT6Ek lGbeSQ0xMuzJOpbDH8v8x+Upi3TqSV9kUBMzpuauil5gkTWfFyc4Cc3hrumoOBljoqyBzO 0ph24pxBCz+5kbW00bLPlRBc5eEOcoVeEYR/rc9DFz+PjS/BC/2KLXe2yIebFzebNjS5Tk WHJUIlCggoiWVqWU00KzedXiD0TTECGf8JclnShpWGmMmozIfVoJOGD+eFGIF4Wiaobauo lL6oA1Oc3MM4EF3qvlEgWvgt5Kzv/AlUbbxOOVd052k1Tg60l9xRqXPc7hpcvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRFYK2CdHznmG; Wed, 24 May 2023 15:32:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34OFWLFN002129; Wed, 24 May 2023 15:32:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34OFWLtY002128; Wed, 24 May 2023 15:32:21 GMT (envelope-from git) Date: Wed, 24 May 2023 15:32:21 GMT Message-Id: <202305241532.34OFWLtY002128@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: aa1a1e7dc42f - main - mksnap_ffs.8: update /home examples List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa1a1e7dc42f954832a63c340de61f771b27278e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=aa1a1e7dc42f954832a63c340de61f771b27278e commit aa1a1e7dc42f954832a63c340de61f771b27278e Author: Mike Karels AuthorDate: 2023-05-24 15:31:50 +0000 Commit: Mike Karels CommitDate: 2023-05-24 15:31:50 +0000 mksnap_ffs.8: update /home examples The default location for home directories is moving from /usr/home to /home. Update the examples accordingly. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D40205 --- sbin/mksnap_ffs/mksnap_ffs.8 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sbin/mksnap_ffs/mksnap_ffs.8 b/sbin/mksnap_ffs/mksnap_ffs.8 index 2bba68150636..f28c15f73ad5 100644 --- a/sbin/mksnap_ffs/mksnap_ffs.8 +++ b/sbin/mksnap_ffs/mksnap_ffs.8 @@ -32,7 +32,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 5, 2023 +.Dd May 22, 2023 .Dt MKSNAP_FFS 8 .Os .Sh NAME @@ -70,17 +70,17 @@ or members of the group. .Sh EXAMPLES Create a snapshot of -.Pa /usr/home +.Pa /home file system and mount the snapshot elsewhere: .Bd -literal -offset indent -mksnap_ffs /usr/home/.snap/snap1 -mdconfig -a -t vnode -o readonly -f /usr/home/.snap/snap1 +mksnap_ffs /home/.snap/snap1 +mdconfig -a -t vnode -o readonly -f /home/.snap/snap1 mount -o ro /dev/md0 /mnt/ .Ed .Pp Delete a snapshot: .Bd -literal -offset indent -rm /usr/home/.snap/snap1 +rm /home/.snap/snap1 .Ed .Sh SEE ALSO .Xr rm 1 , From nobody Wed May 24 15:32:22 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRFYL4KXPz4CqfD; Wed, 24 May 2023 15:32:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QRFYL3n4wz3wqp; Wed, 24 May 2023 15:32:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684942342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8/5rUjqA8TSi41cKulBw6bzKlfK17/an66Gk48lA2R4=; b=JmkFfx4drru2bcoH68w3SPDLJy1Bcd+w9hsL4k1SbyqJstW7cerhTHW6YuagHpFEDNjwiK bS9AsLcsIa535+YIDSdrjHmWn++K9ISUJECSUiY28GaBRr4h1Qc6sP9xUPMKIhaQHObjtN +pKm8BP7oX3nclQBpVwRHlPPXT4RFVmL1SBDAyc3nj0hwp24QaOiackTeAcMlYJiDP2xk0 fAZAMasmQkHV4GRGZiGSxNR/N/17K/CaijsoJTDXiMm0EemQeOO2ltOhafbol1TJ5GSbNs zLdAif4bgIns5ZWPIWZcTimVhBLhqsNVjW/QzUsxwh65CZ1zUHGetXIlvASJbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684942342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8/5rUjqA8TSi41cKulBw6bzKlfK17/an66Gk48lA2R4=; b=YZ5FH3psJh9gSoS/Zzf+XXnV8T/TtdvmCyeMVrMIlF9pRWkwJBvlFNAWQ4ivAbhbxytVBl r5qGgD30viuLs0QlCKhQFzSqfCDUh80E4CqoKGEejiQlEsurr36rn8HyGZEbYx4u1N0niB TYdsCb+IzrhUf1NowZPnX3dB4UX3r8MIHPeodFGYcdxxzWTDa9+JBZfepZ/b1wcF6pVkYj kS7ZK9DcMeYGeZATSmUdAHzWSdS/aSZvUMef914Z+VXk4PkVQoR8wvhA+8KJugdabpNj/S XeAdXEUtfhgZ5Wy6Z0g7QZniLkIgY6+2H4xhd3Z0pqHRUw0hEd2fVCgTAea2/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684942342; a=rsa-sha256; cv=none; b=q4jAeG2zqtY6UPX7LM/Esm6Jch3ZRQ84okywuFCpsE/43HYPLinP4Ki7lpblI8e/akFO7i 4VRkDQrnKaGK7Z3AEYOEcWs3KojfEmjjw1qX0YIPGIoOYPgxh7Fi6tYKrg6/koztouiJBa h6vbyO71t0IPjgl8h/cnPgivRDa9XEP7QBz30wpFv5Or7q0GvYt3Jvl/nlp15vp5rCBeu7 y5MmAVBd0gQCHVGl0eSJgIMveEb6ORB6SWobaKfBlNfEeLwIjZMGuK6NTdqyK2Abin/CdA XEdsFU9ZOMolUWDWkfQE7XkAyDHAW0u/zpMZICdUPcVkkKVlKQ+M6SI0xdt92A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRFYL2gqMznmK; Wed, 24 May 2023 15:32:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34OFWMqK003001; Wed, 24 May 2023 15:32:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34OFWMZa002985; Wed, 24 May 2023 15:32:22 GMT (envelope-from git) Date: Wed, 24 May 2023 15:32:22 GMT Message-Id: <202305241532.34OFWMZa002985@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: 1186ef86c3e1 - main - RELNOTES: add note about moving /usr/home to /home List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1186ef86c3e18c7ed7e458260b73794c60aad7a1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=1186ef86c3e18c7ed7e458260b73794c60aad7a1 commit 1186ef86c3e18c7ed7e458260b73794c60aad7a1 Author: Mike Karels AuthorDate: 2023-05-24 12:03:35 +0000 Commit: Mike Karels CommitDate: 2023-05-24 15:32:07 +0000 RELNOTES: add note about moving /usr/home to /home Document change to pw and hence bsdinstall. --- RELNOTES | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/RELNOTES b/RELNOTES index 2046e1f3c60f..99a37fe20732 100644 --- a/RELNOTES +++ b/RELNOTES @@ -10,6 +10,14 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +bbb2d2ce4220: + Change pw (hence bsdinstall) not to move /home to /usr/home. + Previously, when creating the path to home directories, pw + would move any path in the root directory under /usr, creating + a symlink in root. In particular, the default /home would become + /usr/home. Now /home is at the top level by default. /usr/home + can be used explicitly. + 3416e102c4e9: Remove TI code from armv7 GENERIC kernel. This code doesn't cope with newer DTS and hasn't in a long time so From nobody Wed May 24 15:35:01 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRFcP6mwbz4CqpF; Wed, 24 May 2023 15:35: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 4QRFcP66bwz3yBX; Wed, 24 May 2023 15:35:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684942501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t8G+/XvRZBVq5DeckpPBHOJERHvZT8B53+a1DjZw4NQ=; b=Rz9D4qjNQPCBXs/yL/11tR02bdHqpQ/+eQF9qupvkJklvpBcRe8tcnctclB+UHmjnpwTcB RSMApGyTz/xO598AXEASEGqFknNNm2JcCeJKguoS3fuSFVfxrP6RWSTnZAcYGgji/lI+eZ jd1EqBiChLXmwdOh+gT8eDSK6YY0igdwfiF8D8CYoFov+j64+MXht+amGipjzgXrH+G7is DoTTu3nehwu2ExkCvYuEj2mZ3tCJPU2jD/7NLUqAtqPmbmnApx2OjXfRAQ4hCPs9RpAeCn XlwbH/rKL0YVDhB+xgBsP61QSbfQJrzDFNIlwcNT+TYUAlEK0UwYs/Pnch6xvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684942501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t8G+/XvRZBVq5DeckpPBHOJERHvZT8B53+a1DjZw4NQ=; b=gdZTZ0OckAiGSAwbdbIBL2Wz1XIBWOaI4xyBye+sQkY+kvB7yrbJboljLAonVoiRZqrcXY o2krnTmTKD6v8nALG4WW4ZU/uwRtc1lcACRG6VWu/qt2OZs6nS/kmxpBf/gjDvB0dDbkV6 Fo0Tpfjvj8GmDdRYI82dq0POMaWLq6s4HEwqG5MyG5L1uU3Wr6tmn/2f8I18mcsmIdU1Nd p6RJIoLwdeNF8LwJWg6nrypdbGr2uamEYwKkE3rEPQfHnahQaKBqLz7my2HTwmPHB1F4u6 R/2MKypoUMGWG+IoM/z4XkFbF3n/mVXzJTv1n0QF7ixPJMx7B3UHdg1Vym6K8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684942501; a=rsa-sha256; cv=none; b=Svk2DaIY9en2sfL+fxriFlmpOVng4AiKxrLJDa8SQVHmE94udpR8Um2BUFmm9VH7aVKS5I 9RJ0mQz1UoLavB+CnbjPE4r2Yk/6sRw2J4tO2nyozOpUKvscIbNz2wwU2iUT7U4/Wk6mGk 3Wz3LOPXFrA67afYXX9GebpOegeciIJUCcKLGGLHF2fer5Llpsn9TsNl0mOhsEsO5Qa9Ar 4LzTNE/RZkSysnyKR6sZuTSdVBFhOR3pBXFEkWB1haeItF1j+KxmMW9Q+zJeUBRfnTS/0V p6oqoUwgaQj+YxcOW2kGGngW+8FcKnStGotTyO0QJ4BFDJBR7BHWxEZZDiHKPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRFcP5BLVznX0; Wed, 24 May 2023 15:35: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 34OFZ1VJ003637; Wed, 24 May 2023 15:35:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34OFZ1DR003635; Wed, 24 May 2023 15:35:01 GMT (envelope-from git) Date: Wed, 24 May 2023 15:35:01 GMT Message-Id: <202305241535.34OFZ1DR003635@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 12cfa3c1bd56 - main - ifconfig: fix interface address ordering with Netlink. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 12cfa3c1bd5629a35df3a9b7b023c1a802ae771c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=12cfa3c1bd5629a35df3a9b7b023c1a802ae771c commit 12cfa3c1bd5629a35df3a9b7b023c1a802ae771c Author: Alexander V. Chernikov AuthorDate: 2023-05-24 15:34:21 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-05-24 15:34:21 +0000 ifconfig: fix interface address ordering with Netlink. --- sbin/ifconfig/ifconfig_netlink.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sbin/ifconfig/ifconfig_netlink.c b/sbin/ifconfig/ifconfig_netlink.c index 1df90c2963e3..140808e18681 100644 --- a/sbin/ifconfig/ifconfig_netlink.c +++ b/sbin/ifconfig/ifconfig_netlink.c @@ -124,7 +124,6 @@ nl_init_socket(struct snl_state *ss) struct ifa { struct ifa *next; - uint32_t count; uint32_t idx; struct snl_parsed_addr addr; }; @@ -214,7 +213,7 @@ prepare_ifaddrs(struct snl_state *ss, struct ifmap *ifmap) continue; struct iface *iface = ifmap->ifaces[ifindex]; ifa->next = iface->ifa; - ifa->count = ++count; + ifa->idx = ++count; iface->ifa = ifa; iface->ifa_count++; } From nobody Wed May 24 15:51:13 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRFz63wbrz4Crkd; Wed, 24 May 2023 15:51: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 4QRFz63cbPz416G; Wed, 24 May 2023 15:51:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684943474; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yfZGwPK8K6oIKvsj9IZ0+YYyflLbtfI2pJnrc0MrabA=; b=iLSRRSPp+ciHnMBE5x78GcLmJhcAel9e1FVCoBlR9ne5LtRswRp+yBfoiHEtORSvJ0ANYw Mpv2yQQvyWE+zowKAtZgV7FaUL9kEbVrgnpZ3dPgHPm9JnQBy1XEVO931uS8DEMikodp9+ rxInD1zNDi1GQiLln8RENF8x7xpYrUZAxHQyTOTO93gOYVqolzMEP6obWr4NIYFfDfOlNT P4olXDKLnuRbzvm/QbwM5eUnOt005t9eVYgDiS0RgScluzGXpnRsZlIzWzg5eZNCsRplN4 OSYB2DJLOMXaYnQFg8V80yHEHZm5ORc6IY+ULgeRHmelAs9ai3yahaJVqFdACg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684943474; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yfZGwPK8K6oIKvsj9IZ0+YYyflLbtfI2pJnrc0MrabA=; b=jhLCS62fqd1dHVhs35vtaz02nU1dWL8+ruaa96420IjvlzXLAOfws+B39WahcU0iUslITX FCZuwWWNxQ14KZBtQjCMe+8O1G0qvSJ8eLRSgnAFW+pAzEK2P5Fj9+B2LKUkzJO45F68cw /w1c3FHD1ueGwGGv/C1h1ekfybHiPTHGfWm9LRRgB0G8C6V5fkT2nj0gQj3XCrbydpUsyG 0adItBJLMZ0wmHuS+v1vo1SJWjBaFu7R+vsSoRf/G2xJrpSyGswU8K76NMUPIlDJ3AY/h0 T6ME8wbzBKpKtYBha00EuG1BaUgYQ0bxP+HilkH9Seerkd6EquzixEVuIwfymg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684943474; a=rsa-sha256; cv=none; b=T+pLycdNSCXvVedyuGqFY70QuNWOUIs3w8EzppB1JZFLzLFN3Re6ZSOlZCAW0TQCPhtTiG wGpdL6+GDjHxJuGux5KghPndMT447aFdX0aWaUPENMVD1Yoxv6JZrcyb1JsRsng1mTbCyN MChAVpO3sVUaJjmv0XM6og9qIzVjxdAs2ZOq332xYQXHkRflg5KDoybiqhkD6WedKjPiF5 tswdwwXVEG8NdjEkLh44D9r6CYB+A8zwjgTBEpxMdLEH6MYtLm1d2VcG2oG/3aphWg72NI YcGbpPWKK8e02o/MGY4SnP872k8B8kTLsV06nI8rbAMSap8279w1uKbruz08+Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRFz62hV6znY9; Wed, 24 May 2023 15:51: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 34OFpEdK031088; Wed, 24 May 2023 15:51:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34OFpDG4031082; Wed, 24 May 2023 15:51:13 GMT (envelope-from git) Date: Wed, 24 May 2023 15:51:13 GMT Message-Id: <202305241551.34OFpDG4031082@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: 5afab0e5e56f - main - ldns: Upgrade to 1.8.3. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5afab0e5e56fe90a378fb57249600e7924e1cab2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=5afab0e5e56fe90a378fb57249600e7924e1cab2 commit 5afab0e5e56fe90a378fb57249600e7924e1cab2 Merge: 12cfa3c1bd56 cf3e3d5bd0a1 Author: Dag-Erling Smørgrav AuthorDate: 2023-05-24 15:50:18 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-05-24 15:50:18 +0000 ldns: Upgrade to 1.8.3. Merge commit 'cf3e3d5bd0a1fae39c74c7db5a4e8b10732d0766' Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D40226 contrib/ldns/Changelog | 195 +- contrib/ldns/Makefile.in | 622 +- contrib/ldns/README | 5 +- contrib/ldns/README-Travis.md | 274 + contrib/ldns/aclocal.m4 | 4 +- contrib/ldns/acx_nlnetlabs.m4 | 126 +- contrib/ldns/ax_pkg_swig.m4 | 14 +- contrib/ldns/ax_python_devel.m4 | 39 +- contrib/ldns/buffer.c | 2 +- contrib/ldns/config.guess | 1646 ++-- contrib/ldns/config.sub | 2649 +++--- contrib/ldns/configure | 9584 ++++++++++++-------- contrib/ldns/configure.ac | 256 +- contrib/ldns/dane.c | 65 +- contrib/ldns/dname.c | 2 +- contrib/ldns/dnssec.c | 91 +- contrib/ldns/dnssec_sign.c | 318 +- contrib/ldns/dnssec_verify.c | 208 +- contrib/ldns/dnssec_zone.c | 850 +- contrib/ldns/drill/ChangeLog.22-nov-2005 | 6 +- contrib/ldns/drill/Makefile.in | 119 - contrib/ldns/drill/chasetrace.c | 4 +- contrib/ldns/drill/config.h | 294 - contrib/ldns/drill/config.h.in | 293 - contrib/ldns/drill/configure | 6714 -------------- contrib/ldns/drill/configure.ac | 276 - contrib/ldns/drill/dnssec.c | 16 +- contrib/ldns/drill/drill.1.in | 13 +- contrib/ldns/drill/drill.c | 221 +- contrib/ldns/drill/drill.h | 1 - contrib/ldns/drill/error.c | 2 +- contrib/ldns/drill/securetrace.c | 56 +- contrib/ldns/duration.c | 143 +- contrib/ldns/edns.c | 436 + contrib/ldns/error.c | 31 +- contrib/ldns/freebsd-configure.sh | 9 +- contrib/ldns/host2str.c | 1247 ++- contrib/ldns/host2wire.c | 63 +- contrib/ldns/install-sh | 181 +- contrib/ldns/keys.c | 253 +- contrib/ldns/ldns/buffer.h | 31 + contrib/ldns/ldns/common.h | 3 + contrib/ldns/ldns/common.h.in | 3 + contrib/ldns/ldns/config.h | 209 +- contrib/ldns/ldns/config.h.in | 199 +- contrib/ldns/ldns/dane.h | 4 +- contrib/ldns/ldns/dname.h | 2 +- contrib/ldns/ldns/dnssec.h | 52 +- contrib/ldns/ldns/dnssec_sign.h | 16 +- contrib/ldns/ldns/dnssec_verify.h | 6 +- contrib/ldns/ldns/dnssec_zone.h | 14 +- contrib/ldns/ldns/edns.h | 272 + contrib/ldns/ldns/error.h | 14 +- contrib/ldns/ldns/host2str.h | 38 +- contrib/ldns/ldns/host2wire.h | 15 +- contrib/ldns/ldns/internal.h | 14 + contrib/ldns/ldns/keys.h | 60 +- contrib/ldns/ldns/ldns.h | 1 + contrib/ldns/ldns/net.h | 63 +- contrib/ldns/ldns/net.h.in | 63 +- contrib/ldns/ldns/packet.h | 49 +- contrib/ldns/ldns/parse.h | 38 +- contrib/ldns/ldns/radix.h | 4 +- contrib/ldns/ldns/rbtree.h | 2 +- contrib/ldns/ldns/rdata.h | 28 +- contrib/ldns/ldns/resolver.h | 6 +- contrib/ldns/ldns/rr.h | 21 +- contrib/ldns/ldns/rr_functions.h | 4 +- contrib/ldns/ldns/sha1.h | 9 +- contrib/ldns/ldns/sha2.h | 27 +- contrib/ldns/ldns/str2host.h | 90 +- contrib/ldns/ldns/update.h | 2 +- contrib/ldns/ldns/util.h | 13 +- contrib/ldns/ldns/util.h.in | 9 +- contrib/ldns/ldns/wire2host.h | 8 +- contrib/ldns/ldns/zone.h | 6 +- contrib/ldns/{libdns.doxygen => libdns.doxygen.in} | 415 +- contrib/ldns/ltmain.sh | 219 +- contrib/ldns/m4/ax_config_feature.m4 | 6 +- contrib/ldns/m4/ax_have_poll.m4 | 4 +- contrib/ldns/m4/libtool.m4 | 31 +- contrib/ldns/makewin.sh | 263 + contrib/ldns/net.c | 108 +- contrib/ldns/packaging/fedora/ldns.spec | 4 +- contrib/ldns/packaging/ldns-config.in | 17 +- contrib/ldns/packet.c | 114 +- contrib/ldns/parse.c | 97 +- contrib/ldns/radix.c | 5 +- contrib/ldns/rbtree.c | 2 +- contrib/ldns/rdata.c | 8 +- contrib/ldns/resolver.c | 22 +- contrib/ldns/rr.c | 200 +- contrib/ldns/rr_functions.c | 8 +- contrib/ldns/sha1.c | 3 +- contrib/ldns/sha2.c | 21 +- contrib/ldns/str2host.c | 901 +- contrib/ldns/tsig.c | 16 +- contrib/ldns/util.c | 34 +- contrib/ldns/wire2host.c | 8 +- contrib/ldns/zone.c | 77 +- lib/libldns/Makefile | 11 +- usr.bin/drill/Makefile | 4 +- 102 files changed, 15589 insertions(+), 15732 deletions(-) diff --cc contrib/ldns/README-Travis.md index 000000000000,faa534353119..faa534353119 mode 000000,100644..100644 --- a/contrib/ldns/README-Travis.md +++ b/contrib/ldns/README-Travis.md diff --cc contrib/ldns/configure index f085a9e36e1d,000000000000..425ac0e02268 mode 100755,000000..100755 --- a/contrib/ldns/configure +++ b/contrib/ldns/configure @@@ -1,20018 -1,0 +1,21632 @@@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. - # Generated by GNU Autoconf 2.69 for ldns 1.7.0. ++# Generated by GNU Autoconf 2.71 for ldns 1.8.3. +# +# Report bugs to . +# +# - # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. ++# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, ++# Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh - if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : ++as_nop=: ++if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 ++then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST - else ++else $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + ++ ++# Reset variables that may have inherited troublesome values from ++# the environment. ++ ++# IFS needs to be set, to space, tab, and newline, in precisely that order. ++# (If _AS_PATH_WALK were called with IFS unset, it would have the ++# side effect of setting IFS to empty, thus disabling word splitting.) ++# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl - # Printing a long string crashes Solaris 7 /usr/bin/printf. - as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo - as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo - # Prefer a ksh shell builtin over an external printf program on Solaris, - # but without wasting forks for bash or zsh. - if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' - elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' - else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' - fi ++IFS=" "" $as_nl" ++ ++PS1='$ ' ++PS2='> ' ++PS4='+ ' ++ ++# Ensure predictable behavior from utilities with locale-dependent output. ++LC_ALL=C ++export LC_ALL ++LANGUAGE=C ++export LANGUAGE ++ ++# We cannot yet rely on "unset" to work, but we need these variables ++# to be unset--not just set to an empty or harmless value--now, to ++# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct ++# also avoids known problems related to "unset" and subshell syntax ++# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). ++for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH ++do eval test \${$as_var+y} \ ++ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : ++done ++ ++# Ensure that fds 0, 1, and 2 are open. ++if (exec 3>&0) 2>/dev/null; then :; else exec 0
&1) 2>/dev/null; then :; else exec 1>/dev/null; fi ++if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. - if test "${PATH_SEPARATOR+set}" != set; then ++if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + - # IFS - # We need space, tab and new line, in precisely that order. Quoting is - # there to prevent editors from complaining about space-tab. - # (If _AS_PATH_WALK were called with IFS unset, it would disable word - # splitting by setting IFS to empty value.) - IFS=" "" $as_nl" - +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac ++ test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 ++ printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + - # Unset variables that we do not need and which cause bugs (e.g. in - # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" - # suppresses any "Segmentation fault" message there. '((' could - # trigger a bug in pdksh 5.2.14. - for as_var in BASH_ENV ENV MAIL MAILPATH - do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : - done - PS1='$ ' - PS2='> ' - PS4='+ ' - - # NLS nuisances. - LC_ALL=C - export LC_ALL - LANGUAGE=C - export LANGUAGE - - # CDPATH. - (unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. - $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 - as_fn_exit 255 ++printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 ++exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : ++ as_bourne_compatible="as_nop=: ++if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 ++then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST - else ++else \$as_nop + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } - if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : ++if ( set x; as_fn_ret_success y && test x = \"\$1\" ) ++then : + - else ++else \$as_nop + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 ++blah=\$(echo \$(echo blah)) ++test x\"\$blah\" = xblah || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 - test \$(( 1 + 1 )) = 2 || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" - if (eval "$as_required") 2>/dev/null; then : ++ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 ++test \$(( 1 + 1 )) = 2 || exit 1" ++ if (eval "$as_required") 2>/dev/null ++then : + as_have_required=yes - else ++else $as_nop + as_have_required=no +fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : ++ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null ++then : + - else ++else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base ++ as_shell=$as_dir$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : ++ as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null ++then : + CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : ++ if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null ++then : + break 2 +fi +fi + done;; + esac + as_found=false +done - $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes - fi; } +IFS=$as_save_IFS ++if $as_found ++then : ++ ++else $as_nop ++ if { test -f "$SHELL" || test -f "$SHELL.exe"; } && ++ as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null ++then : ++ CONFIG_SHELL=$SHELL as_have_required=yes ++fi ++fi + + - if test "x$CONFIG_SHELL" != x; then : ++ if test "x$CONFIG_SHELL" != x ++then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. - $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 ++printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." ++ if test x$as_have_required = xno ++then : ++ printf "%s\n" "$0: This script requires a shell more modern than all" ++ printf "%s\n" "$0: the shells that I found on your system." ++ if test ${ZSH_VERSION+y} ; then ++ printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" ++ printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." + else - $as_echo "$0: Please tell bug-autoconf@gnu.org and ++ printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and +$0: libdns@nlnetlabs.nl about your system, including any +$0: error possibly output before this message. Then install +$0: a modern shell, or manually run the script under such a +$0: shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + ++ +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit ++# as_fn_nop ++# --------- ++# Do nothing but, unlike ":", preserve the value of $?. ++as_fn_nop () ++{ ++ return $? ++} ++as_nop=as_fn_nop + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( ++ *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || - $as_echo X"$as_dir" | ++printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. - if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : ++if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null ++then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' - else ++else $as_nop + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. - if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : ++if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null ++then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' - else ++else $as_nop + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + ++# as_fn_nop ++# --------- ++# Do nothing but, unlike ":", preserve the value of $?. ++as_fn_nop () ++{ ++ return $? ++} ++as_nop=as_fn_nop + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi - $as_echo "$as_me: error: $2" >&2 ++ printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || - $as_echo X/"$0" | ++printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } ++ { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + ++ ++# Determine whether it's possible to make 'echo' print without a newline. ++# These variables are no longer used directly by Autoconf, but are AC_SUBSTed ++# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + ++# For backward compatibility with old third-party macros, we provide ++# the shell variables $as_echo and $as_echo_n. New code should use ++# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. ++as_echo='printf %s\n' ++as_echo_n='printf %s' ++ ++ +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='ldns' +PACKAGE_TARNAME='libdns' - PACKAGE_VERSION='1.7.0' - PACKAGE_STRING='ldns 1.7.0' ++PACKAGE_VERSION='1.8.3' ++PACKAGE_STRING='ldns 1.8.3' +PACKAGE_BUGREPORT='libdns@nlnetlabs.nl' +PACKAGE_URL='' + +ac_unique_file="packet.c" +# Factoring default headers for most tests. +ac_includes_default="\ - #include - #ifdef HAVE_SYS_TYPES_H - # include ++#include ++#ifdef HAVE_STDIO_H ++# include +#endif - #ifdef HAVE_SYS_STAT_H - # include - #endif - #ifdef STDC_HEADERS ++#ifdef HAVE_STDLIB_H +# include - # include - #else - # ifdef HAVE_STDLIB_H - # include - # endif +#endif +#ifdef HAVE_STRING_H - # if !defined STDC_HEADERS && defined HAVE_MEMORY_H - # include - # endif +# include +#endif - #ifdef HAVE_STRINGS_H - # include - #endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif ++#ifdef HAVE_STRINGS_H ++# include ++#endif ++#ifdef HAVE_SYS_TYPES_H ++# include ++#endif ++#ifdef HAVE_SYS_STAT_H ++# include ++#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + ++ac_header_c_list= ++ac_func_c_list= +ac_subst_vars='LTLIBOBJS +CONFIG_FILES +ldns_build_config_have_attr_unused +ldns_build_config_have_attr_format +ldns_build_config_have_ssl +DEFAULT_CAPATH +DEFAULT_CAFILE +LDNS_TRUST_ANCHOR_FILE +WINDRES +ldns_build_config_have_b32_pton +ldns_build_config_have_b32_ntop +LIBOBJS +ldns_build_config_have_socklen_t +LIBPCAP_LIBS +include_unistd_h +include_systypes_h +include_inttypes_h +ldns_build_config_have_inttypes_h +include_sys_socket_h +LIBSSL_SSL_LIBS +LIBSSL_LIBS +LIBSSL_LDFLAGS +LIBSSL_CPPFLAGS +ldns_build_config_use_dane_ta_usage +ldns_build_config_use_dane_verify +ldns_build_config_use_dane ++ldns_build_config_use_ed448 ++ldns_build_config_use_ed25519 ++ldns_build_config_use_dsa +RUNTIME_PATH +HAVE_SSL +libtool +CLEAN_P5_DNS_LDNS +UNINSTALL_P5_DNS_LDNS +INSTALL_P5_DNS_LDNS +TEST_P5_DNS_LDNS +P5_DNS_LDNS +PERL +PYLDNSXUNINST +PYLDNSXINST +PYLDNSUNINST +PYLDNSINST +PYLDNSX +PYTHON_X_CFLAGS +swig +PYLDNS +SWIG_LIB +SWIG +SWIGPY3 +PYTHON_EXTRA_LDFLAGS +PYTHON_EXTRA_LIBS +PYTHON_SITE_PKG - PYTHON_LDFLAGS ++PYTHON_LIBS +PYTHON_CPPFLAGS +PYTHON +PYTHON_VERSION +UNINSTALL_CONFIG_MANPAGE +UNINSTALL_CONFIG +INSTALL_CONFIG_MANPAGE +INSTALL_CONFIG +LINT_EXAMPLES +CLEAN_EXAMPLES +UNINSTALL_EXAMPLES *** 30097 LINES SKIPPED *** From nobody Wed May 24 16:20:17 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRGcf0hKtz4TDs8; Wed, 24 May 2023 16:20: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 4QRGcf06xhz43hq; Wed, 24 May 2023 16:20:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684945218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pv9/KV563JUDm6Js727AlEcXItGuVozvg4ja6Z2qiXw=; b=r79VDNZOMvYBYmZpY4xMfMOQW5+xVIjCUnypRfK366+7U4S/bEV/q1zkiYIgp0mHlohmhs Q3/HXNiG21xyv74mjQDZoGaZRtZ0wqgb/1snF+waaLzOT1U+lgMjDx7MaC3dQfUudD+hSs nRIag5mzCal+ilyf+SAdDOVQBwXQBNFGcz/zjXGBLLoC5wTOSGf5cmFbYVpiKW5VOQFuso MnLhm92miumgiMDV2bM/v5tySlbeYUJ9HsbW5iDYFh9PVAFdnGwBKWD0Z9T2kJvsPMEukp bo6SRFmhSopgBFnXGgcvzG/oL28HP9bmK0xLJD9zSPA6XiTcF/j800jozy+zEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684945218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pv9/KV563JUDm6Js727AlEcXItGuVozvg4ja6Z2qiXw=; b=tT4fX2+l0SDl8NozYu74bS91hzom+H7mbJp69eIL/u1OHiT0NVJseNvkoVbYxyUoZV7jgf 4+uIRbtpZVnb0CO8UXVDxAd8hWYsulZhAWd5PAC9ht86BQjvekRz+d67HQgu257xnTreYg 1vHcSAn2rYEX5tPhHvcFXthImPCPFXrTQiXZhulOOE7vCZlko6N66TU878EFO6gdwNC627 lu/CPpccuynl9vzEhOCfcGVGmaScLPkmW8ZnCFHRON5K8uI7Kh6tkcR3xxiSwKUqZvaP3l 3TG3u9KQko2zu+/xbgzwiNjJqOCHJMeqc5LEIWY1R2VHBYW497pG5Z1A4EVB/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684945218; a=rsa-sha256; cv=none; b=mFOadbPlVbgAT4CK+JkNe6s84dvVvsp+hEdgSGk9OM4LS+V7TItyEik18SyZf3JxXVkHV4 PQE4LQLJvbjr3O/a3VwzjsjAJp6A6Ek7byh1VwLQh23EVS5kd/webK5f8EpY+pE6Kj/5Ju BBdQlr1X0P87VY58SHYAj6lC2CSUAakBGfZDNAAY38zsg8ONGC8LuWcOylXBziNmxK0p0F gsEYiLnCUOS4RkNLeVMU3IOkxT9JZYw1sSnQRIt4jNGiaG/sqUUNGwe5LEpaSpDvAN0A9M uJd6Svk50/Zdjskz3vdXq9uuHWKwUfOnvmbFXgf139a+qpj5yaGLautz0mmvZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRGcd6JKBzpFt; Wed, 24 May 2023 16:20:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34OGKHYd078793; Wed, 24 May 2023 16:20:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34OGKHaQ078792; Wed, 24 May 2023 16:20:17 GMT (envelope-from git) Date: Wed, 24 May 2023 16:20:17 GMT Message-Id: <202305241620.34OGKHaQ078792@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 800b39cf99b2 - main - arm64: Remove CNTHCTL_EL2 from arm64.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 800b39cf99b22614c17a5e12156acbb3df66156a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=800b39cf99b22614c17a5e12156acbb3df66156a commit 800b39cf99b22614c17a5e12156acbb3df66156a Author: Andrew Turner AuthorDate: 2023-05-24 14:22:41 +0000 Commit: Andrew Turner CommitDate: 2023-05-24 16:20:05 +0000 arm64: Remove CNTHCTL_EL2 from arm64.h It is also in hypervisor.h where it belongs. Sponsored by: Arm Ltd --- sys/arm64/include/armreg.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 5c174bcbc838..cd5e7b8e1db8 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -101,13 +101,6 @@ #define CLIDR_CTYPE_ID 0x3 /* Split instruction and data */ #define CLIDR_CTYPE_UNIFIED 0x4 /* Unified */ -/* CNTHCTL_EL2 - Counter-timer Hypervisor Control register */ -#define CNTHCTL_EVNTI_MASK (0xf << 4) /* Bit to trigger event stream */ -#define CNTHCTL_EVNTDIR (1 << 3) /* Control transition trigger bit */ -#define CNTHCTL_EVNTEN (1 << 2) /* Enable event stream */ -#define CNTHCTL_EL1PCEN (1 << 1) /* Allow EL0/1 physical timer access */ -#define CNTHCTL_EL1PCTEN (1 << 0) /*Allow EL0/1 physical counter access*/ - /* CNTP_CTL_EL0 - Counter-timer Physical Timer Control register */ #define CNTP_CTL_EL0 MRS_REG(CNTP_CTL_EL0) #define CNTP_CTL_EL0_op0 3 From nobody Wed May 24 16:20:18 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRGcg4D1tz4TF1k; Wed, 24 May 2023 16:20: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 4QRGcg1nm6z446M; Wed, 24 May 2023 16:20:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684945219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RwWObW9rWgrAwP9ol9fkr5dhEZ6kE3QBibAcL6t6Ep0=; b=E7tJFyOndPgVbqaagjeeN+wr40kLG+eDiD+W/UP4Bep9D7UMTtUx0Lmkdakcqy3jLYuK3G G/SQrLGGcm14l4bbF7FXNJsHiqN/ySFyNH9Rlqb199hmbbh6lfXFKpafmmPhIhPOcOEKSI luD6IJ8q8AbnmXaG0beqOj4fzsCse+khvuGYQOSRJvx8IZnT5M7vVx/oLharcaznRS9AGW VBefqeFy+s2SqLMNtfwhnPCo9C8DG91WHovwwDBxaE5ABX5ZdC5sDuhWLkQChK2v6Q8gZH lPaCs1XV5UMSSCchdq6XDFrIvq8Tc60gRTyTLS3fTLCT08dUW1C3FjzufW0TLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684945219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RwWObW9rWgrAwP9ol9fkr5dhEZ6kE3QBibAcL6t6Ep0=; b=vcqBY2hQHmn1hBjQPBGZPr258byQkVZEsN19I/UkGF/K/ou24EiGX1ER1oFP+okkEOqlez PC5/AjvpGuAIMrOyZaKNzWS/aXiNepjHzNG9q/lfBrZYawxzf5AgvCJ52jqKF7YT5FFQ+G Wx03mV6w7KO8WTV90vFIPLMux76RxkKGDyQ5U8RqGdydZJ0Vj7Tb0GSAyRhbvhGa9ft2kR m5A7omTVsTtUCJubBXeiGdO8knN/bwOykW1vl1J+l6ukkaKFg1dtqTyHd4P2WfHV6bb72z a+uGN1PayokRgYc3o9kHfU7nnP3qvhYqrSN6yfqJ3oEFikobX3KOmGNNwhz9lg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684945219; a=rsa-sha256; cv=none; b=JOBK/BT6DMwmjRP93k9T6dVADh3DVkCW0crG5yxluLzk1UfoI3hMGn0tedMIpuTIh+8dWx odA3+fDm1xnUI31PIu0ylio1VzQrKRzRBP/1lZK2NqwJf+UdbRotvQXJgwtkBfBH1yVDTJ Ulkq+76qcPDE1sKi3u8ZjaUMFUrQhPGJu+/W/CIM8AvaJW/BZEG2qk56mMMyZ0ZGMiFOPx tV5oHjUow2i3vy8kT+W1/vlQ4zvKkZSBvItddxo/tDi5suN8hFRiwH35T+F717E+mvOXIi jQLgO2ziWG+32NK7fi3V8KTIXZxZgD1JnJ7fLXanpSH2tlJzpP1pzEuNMdUzBw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRGcg0Js6zpPG; Wed, 24 May 2023 16:20: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 34OGKI35078812; Wed, 24 May 2023 16:20:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34OGKImo078811; Wed, 24 May 2023 16:20:18 GMT (envelope-from git) Date: Wed, 24 May 2023 16:20:18 GMT Message-Id: <202305241620.34OGKImo078811@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: b81e1c6b72f1 - main - Don't print leading 0's in the arm64 esr List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b81e1c6b72f1b0ee57311c2bf51c3549d5c44d3a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=b81e1c6b72f1b0ee57311c2bf51c3549d5c44d3a commit b81e1c6b72f1b0ee57311c2bf51c3549d5c44d3a Author: Andrew Turner AuthorDate: 2023-05-16 09:42:45 +0000 Commit: Andrew Turner CommitDate: 2023-05-24 16:20:06 +0000 Don't print leading 0's in the arm64 esr We don't print leading zeros for other registers, so do the same with ESR_EL1. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D40129 --- sys/arm64/arm64/trap.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index 0ee1bed0c35a..95f2bf46e18e 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -213,7 +213,7 @@ align_abort(struct thread *td, struct trapframe *frame, uint64_t esr, if (!lower) { print_registers(frame); print_gp_register("far", far); - printf(" esr: %.16lx\n", esr); + printf(" esr: %16lx\n", esr); panic("Misaligned access from kernel space!"); } @@ -330,7 +330,7 @@ data_abort(struct thread *td, struct trapframe *frame, uint64_t esr, WARN_GIANTOK, NULL, "Kernel page fault") != 0) { print_registers(frame); print_gp_register("far", far); - printf(" esr: %.16lx\n", esr); + printf(" esr: %16lx\n", esr); panic("data abort in critical section or under mutex"); } @@ -371,7 +371,7 @@ bad_far: printf("Fatal data abort:\n"); print_registers(frame); print_gp_register("far", far); - printf(" esr: %.16lx\n", esr); + printf(" esr: %16lx\n", esr); #ifdef KDB if (debugger_on_trap) { @@ -499,7 +499,7 @@ do_el1h_sync(struct thread *td, struct trapframe *frame) #endif { print_registers(frame); - printf(" esr: %.16lx\n", esr); + printf(" esr: %16lx\n", esr); panic("VFP exception in the kernel"); } break; @@ -512,7 +512,7 @@ do_el1h_sync(struct thread *td, struct trapframe *frame) } else { print_registers(frame); print_gp_register("far", far); - printf(" esr: %.16lx\n", esr); + printf(" esr: %16lx\n", esr); panic("Unhandled EL1 %s abort: %x", exception == EXCP_INSN_ABORT ? "instruction" : "data", dfsc); @@ -630,7 +630,7 @@ do_el0_sync(struct thread *td, struct trapframe *frame) else { print_registers(frame); print_gp_register("far", far); - printf(" esr: %.16lx\n", esr); + printf(" esr: %16lx\n", esr); panic("Unhandled EL0 %s abort: %x", exception == EXCP_INSN_ABORT_L ? "instruction" : "data", dfsc); @@ -723,7 +723,7 @@ do_serror(struct trapframe *frame) print_registers(frame); print_gp_register("far", far); - printf(" esr: %.16lx\n", esr); + printf(" esr: %16lx\n", esr); panic("Unhandled System Error"); } @@ -738,6 +738,6 @@ unhandled_exception(struct trapframe *frame) print_registers(frame); print_gp_register("far", far); - printf(" esr: %.16lx\n", esr); + printf(" esr: %16lx\n", esr); panic("Unhandled exception"); } From nobody Wed May 24 16:20:20 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRGch2Tn1z4TF1q; Wed, 24 May 2023 16:20:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QRGch1pqKz449D; Wed, 24 May 2023 16:20:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684945220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wAFnTJ0fI27umnlITK4LPvTLk3JVF5sm0kjmYLHMXPw=; b=Jo9oZPblM8QV53v+MouLLFE33m6dn6Xp9QMzjbluxCECQN3RhS11CiU+cke+P+xy6SF+6Y tqHoJnpZzlJodSvKa5yfZLaagCBMapdSXWYXJ6Lg1BgQ69BtBHR8vNOsPyMTNWgbe0dTzc sBE3K917MTEttsFNNvJ85SNciLJ9CXP3FN8A0rcadWx6i0iiMRVdfoZmvxuXJsoqL7g/9h mtKyrJTM2vRKfm6iaasPh8o92YButlHT+HzX0WRN5dXbFM3yBc86b0bONM5yl145q48kD7 eLoZyB2IFSJdz+mGbTGoTYZjhW8eDDif9a6QPmtsk6R4Zy39tikMNcICdMuGIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684945220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wAFnTJ0fI27umnlITK4LPvTLk3JVF5sm0kjmYLHMXPw=; b=iSgMonzv3Yvxz4PUILI8K5uqmy2KFZN8eyYESRFOs+9DY9UlPcJf++ZUU9x3xdulLnHMIq hfmjSH+wn4PckLZrMwB1wjRXVNIe3qXoj2kZTEAzhlO2AZrYdzXhKChwZifl3vit1SjLD9 XjfpehYtjZOuVjpvulV5xXv+5PBWotq7jMYegOgBWIi7PXF+idAAR3sHB7jPKEM74wRqxH RrJWrZAtilHsNg1dI1YDS7sTDivfQSq63FvP1qWYuIyY1Jje0tOuyLnBzyyukxICKTXDYP ZhYBBNlDv8JIYmNEJgbPDbBu7GX4b55L4btD8R/jClKrEGmCBKGajtvsJmjVhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684945220; a=rsa-sha256; cv=none; b=f+bks+hZ6y5b9spETFBN5vq7vZwccje4Tr407h+SRJNB7iyGgedVxTXMD4riODx31s9pAe bhpJruGA2JrylPhk2kbWDDldzS8inyL2i3XeXaf1aNskGP1m7eDNsfUpLZv/KZW5hVlmmI JPKVd3KeNUTAjRo30A8O46AHJtkoXAIz6DR4fsONxfAXEAWUifGiE8361NcWVZ3h+itg6g MJkde1EJluLtAN2LhYgyLivKrl8mowjNww6650Kbp5xN/VJPOyKfpIkv+QbmcsENh60AXB crBtrfKQCMYeU6zh8XPqXpAarV9+9NpZxdQn9ib3LVf4sUTCjVm+xVh8xcQHow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRGch0tqgzpsF; Wed, 24 May 2023 16:20: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 34OGKKDA078832; Wed, 24 May 2023 16:20:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34OGKKr5078831; Wed, 24 May 2023 16:20:20 GMT (envelope-from git) Date: Wed, 24 May 2023 16:20:20 GMT Message-Id: <202305241620.34OGKKr5078831@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 0731b0a9f1f9 - main - Print registers on an arm64 spinlock data abort List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0731b0a9f1f9e3b4ec699ec67b6eb24159fa9b05 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=0731b0a9f1f9e3b4ec699ec67b6eb24159fa9b05 commit 0731b0a9f1f9e3b4ec699ec67b6eb24159fa9b05 Author: Andrew Turner AuthorDate: 2023-05-23 09:21:39 +0000 Commit: Andrew Turner CommitDate: 2023-05-24 16:20:06 +0000 Print registers on an arm64 spinlock data abort When checking if the spinlock count is correct in a data abort we can panic without printing the registers. These are useful to debug the abort, e.g. by giving the fault address register. Reviewed by: kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D40228 --- sys/arm64/arm64/trap.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index 95f2bf46e18e..17bda56d806e 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -324,8 +324,14 @@ data_abort(struct thread *td, struct trapframe *frame, uint64_t esr, pmap_fault(map->pmap, esr, far) == KERN_SUCCESS) return; - KASSERT(td->td_md.md_spinlock_count == 0, - ("data abort with spinlock held")); +#ifdef INVARIANTS + if (td->td_md.md_spinlock_count != 0) { + print_registers(frame); + print_gp_register("far", far); + printf(" esr: %.16lx\n", esr); + panic("data abort with spinlock held"); + } +#endif if (td->td_critnest != 0 || WITNESS_CHECK(WARN_SLEEPOK | WARN_GIANTOK, NULL, "Kernel page fault") != 0) { print_registers(frame); From nobody Wed May 24 16:20:21 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRGcj3P5rz4TFG8; Wed, 24 May 2023 16:20:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QRGcj2hPcz444p; Wed, 24 May 2023 16:20:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684945221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ljB46mUc+21cK1h6lnOCZzUoeJwTNzINVtWVyjZ8AAU=; b=VzmgbJmuhy8/VDkdX1H+3ZUtL/YGlxprjpcpZzGhs7+FgoPDchrghMLXQ5AMGkquTWIpdU G4yy/Ljxj6SJqE6S+FHfFVnMhPbAb1LKdSaOzeQPeZ1XSgwvGQB7ty/bsTP3yVDoraguBF nuRClQYgo/cKsLhfXWGg/6OHqsHS0U/5bZP1ZqZX1YNr01FjDq6Qe9hzr5ksdGw73VH4XV 2pcmZK+bd26m7nsgMQuDMZHuTgGk/KvYuOAj+smIMMfa5+akKQ4cV9yZPMBqKTPRujS+t/ eyoEpOvAIsaBqbPlCsmY9FXVgiHYD/Goej83GTyFTWN9mi2/XddVhQL76O013g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684945221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ljB46mUc+21cK1h6lnOCZzUoeJwTNzINVtWVyjZ8AAU=; b=NRhgDtgwh31xFvV5lusTCv2R4vgiZnyaKFfU+XE3ZEnO44qJB6Dq7nwyWIktpOhBgOxNdf fV5/D6E4MX9Bo/B0Hsrq1sx4/LIRd2FwyZPtj8PnEpBMn3nivQO0JR0SmPfcWJaB0M+2De 6xpg3uaj2vHpr9iLlEQPYMzW8F3x3W6hHhJCVfbml55PJouMo1j4+LFZol+tviKNRI6kcs 6SOp7rR6ErAUbgg+l+aplGEJw0wVTzl6DlWTMa6NqwmN+Tu+qCKRCASsXSRA8VWOJ7RDOC KILdOruQlt2uuG6x3Ex59Qs5E9z+LUJEOL3PdLqALI2N+rpzFP9USsz+7M10Cw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684945221; a=rsa-sha256; cv=none; b=D7tXPEHiYi6LjzmYZ9T31+sTdpawwsF/wlc+iUIxhIbz+op57eJ8je/EdkUWMmRwyvIuHE M7jNAMEfRjq4a5GIASwbdZMhhE83+kd8i6qFA672RUMZzSxwYSueoM+P64onbB05y5wBX8 /f6qz5CBaIBjfSmhqqf5DU5KHMN4s6jCEExJniS0Ps+y5YfDfFKGAePUNSx8A+pM8ujd0t RnMFKIIxXED5hXbhiTctjgtJvf8sGAx5EbUjbjb0mVry3zTW/LEGJK4hPC/rptUbp3Mult aVdGG/7QNo1lTW9Is8JEsel3mTg3xa7ykTqehGCPG4wdjdXFCYimPQUU7rLZBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRGcj1nxTzpfc; Wed, 24 May 2023 16:20: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 34OGKLKX078857; Wed, 24 May 2023 16:20:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34OGKLH9078856; Wed, 24 May 2023 16:20:21 GMT (envelope-from git) Date: Wed, 24 May 2023 16:20:21 GMT Message-Id: <202305241620.34OGKLH9078856@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: fa512fcd8fe7 - main - arm64: Print the spinlock count on panic List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa512fcd8fe74d72b7f29a324c8cd3ca20ff25c8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=fa512fcd8fe74d72b7f29a324c8cd3ca20ff25c8 commit fa512fcd8fe74d72b7f29a324c8cd3ca20ff25c8 Author: Andrew Turner AuthorDate: 2023-05-24 14:40:30 +0000 Commit: Andrew Turner CommitDate: 2023-05-24 16:20:06 +0000 arm64: Print the spinlock count on panic When the spinlock count is non-zero while taking a data abort we panic. Print this count to help debugging. Sponsored by: Arm Ltd --- sys/arm64/arm64/trap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index 17bda56d806e..9b1b73aeb55d 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -329,7 +329,8 @@ data_abort(struct thread *td, struct trapframe *frame, uint64_t esr, print_registers(frame); print_gp_register("far", far); printf(" esr: %.16lx\n", esr); - panic("data abort with spinlock held"); + panic("data abort with spinlock held (spinlock count %d != 0)", + td->td_md.md_spinlock_count); } #endif if (td->td_critnest != 0 || WITNESS_CHECK(WARN_SLEEPOK | From nobody Wed May 24 16:29:42 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRGqV5G0Hz4TFXp; Wed, 24 May 2023 16: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 4QRGqV4lpkz46lg; Wed, 24 May 2023 16: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=1684945782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XhUj+JHEaXvEBjyczR45LiLFGa9LIeMw/cTI/9N9SNA=; b=tsCnnRTJQf1W/YKrH34Gl5npDx1JMcfqzXe0nskz1+Pb6uKoSdYRWSjbxkvSjeMZmR9gkX zAiSGRnklCNl7HrGLuZnb0Z9/IDOIdkcsNcCojNw1hkJI7Zmbvf1zByrBmjvSkvDjx4x9e SwNQqpIS+oStEyDhbUWKNNNFp5vX3ROvJ0NA9PkfkAICRNR5Il3EHAt3FK79UbCo2AZL1M PALs51omajNkIPEzldGis7VYmsEZ3Ok45gjBtHytfJt1fMtTP6jtGyRawSdOAVybdGDFzR 4pVgVYlY1MKItzBA1eUX8cw4hixkQc/XjkR/1rTOYUsRxxZ02sLzJ6WILdoNKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684945782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XhUj+JHEaXvEBjyczR45LiLFGa9LIeMw/cTI/9N9SNA=; b=dlPl0BoT+5LpiTW5dNI5lkG9zUbYrRb6ztyqwzOxJKIFEE7sZaCseWwuwfiB8gYnb3A1tv eVAGLxB2VZNPXAp1/aDl35e4+wP+Mf6Fx1tZmHYK8OhXY62cEjUV05SqU/ux/3YZOMPQcO BKJBx1r46Xc89N6RB9bA1iLq/SSbFWKuyWY2UdUbe1AK4wu61RpnPiktWDj9r8SvqEXGYh cn23fY9boxSNnvDoO42w0AD/VozrdEiYp5Nz8Fz9DEnH4t76tStJAf20CNzgh7cwk9oItP cuFZfufJuUhRTIcvv4W3e/0URo53PPeCqYHg4lvcNGvujRL21BgPZhut5EqpEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684945782; a=rsa-sha256; cv=none; b=Cq1NnlpOrbfOIamsPo29tJerio6w2jzAdQ67NYpabcbXqHzUdkL9wbS6vJMEA9W652VZm7 ypEUEtddFFt0OlTYl/45lvknc+BjQlbd2s3S2Mnlkxqc8wWGsNc9MztAtXBIsqJoAS2L5N N7B1MtZYGb3DCAKxw1thiEBJOu5Y5kNOtNh5yo0AkUenFm5mYXZ0jYKzQDg2Ex/FU8b/NV Dm4SiG+AsZZJn88Q27KANaWF3+s0Z3F1Z2L10bM6llili1H/X9cTCCyLR/iqmlCiKBngZa L6y83m//RjHYadfilTYWPuE3bSNgRsCwnFMAWUL0ItiDvOnuYhwVaoLbImN4Yw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRGqV3j1Nzpgf; Wed, 24 May 2023 16: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 34OGTguf087627; Wed, 24 May 2023 16: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 34OGTgmO087626; Wed, 24 May 2023 16:29:42 GMT (envelope-from git) Date: Wed, 24 May 2023 16:29:42 GMT Message-Id: <202305241629.34OGTgmO087626@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 6342c9ed178e - main - if_ovpn: atomic_set -> atomic_store List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6342c9ed178e6507d29accd07f1d53bb827162f7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6342c9ed178e6507d29accd07f1d53bb827162f7 commit 6342c9ed178e6507d29accd07f1d53bb827162f7 Author: Kristof Provost AuthorDate: 2023-05-24 16:27:53 +0000 Commit: Kristof Provost CommitDate: 2023-05-24 16:29:21 +0000 if_ovpn: atomic_set -> atomic_store The intent is to set the value to UINT32_MAX, not to |= UINT32_MAX. Happily the intent (ensure that we do not send further packets) is achieved either way. Reported by: markj Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/if_ovpn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_ovpn.c b/sys/net/if_ovpn.c index 49c8c8e9677a..a05b06f090e3 100644 --- a/sys/net/if_ovpn.c +++ b/sys/net/if_ovpn.c @@ -1885,7 +1885,7 @@ ovpn_transmit_to_peer(struct ifnet *ifp, struct mbuf *m, /* Let's avoid (very unlikely, but still) wraparounds of the * 64-bit counter taking us back to 0. */ - atomic_set_64(&peer->keys[OVPN_KEY_SLOT_PRIMARY].encrypt->tx_seq, + atomic_store_64(&peer->keys[OVPN_KEY_SLOT_PRIMARY].encrypt->tx_seq, UINT32_MAX); return (ENOBUFS); From nobody Wed May 24 17:11:38 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRHlt2HT7z4THcH; Wed, 24 May 2023 17:11:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QRHlt1mG4z4Cwt; Wed, 24 May 2023 17:11:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684948298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v4i46aVFaUgP79AOVNQLcryPLzu4o2+rC5WTjkiQ1HY=; b=rl0nGCwjIT34JU51iet72az4LYMXEOPJm7P32K/dlTkuStJ8dbjI3hb8i5a+k44RKc659T jwGlOGMMqE9BM8TiSEPwqDXIeC/rKsCcvso1/GhqBA/bsuCl4NxE4nAoGh099/Epzs7Cpp JnA/zK5VHOfBLI507/YpcK83a3xdz5j9iePZeGgJb+1ysbhN7RbuWczc+J85y7tbZ+RSQl vIzMYkIYNKkCARYBH2jSrCs9+da3/R7Cqs6BxUaiCWt7HpZIwzpSUHhfj/z5VFdDMJJCOO xTSnfCHNNR2dxn1t0xZi7CM7SJGkxODYP4s/836Mm6JO/LdwFkDGLiW/mAuVnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684948298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v4i46aVFaUgP79AOVNQLcryPLzu4o2+rC5WTjkiQ1HY=; b=r/VWcMJOvLWOoQbce8exXBheZSrR48SqmhuBTULLHO9SUJHNyRH9hY/XE7TAQE+jJXBDDr zDyIhHA9LPL9lZz2JmNP/txmuvd4/1/Vrm/FX20Vb58fEQxhUrJGK71SY2jyhVV5A7Mvj2 7rwMhpnwJF24WSdge8yOP+/Y6WAZzMRWN2LUhvCmqcSPUfjeD7E0yII0lZRyJKt2rRaqLi 18UZtOQgYR0p/ApZA9cdvuQESN7vbHi4o1LPHaJ5NBSEfV4jqgQTufvdvwzu+g4P8r85xm IvGOVHvCoc2ZXGjLMyAV8TCNR8jHKVaAXqcw5qny5utPv4/iL18dJrxSjcY2lw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684948298; a=rsa-sha256; cv=none; b=mZP10U0m0Ig/KsUw8rVTun/sMF9bc4rFWY4MNMzv+xdIWyypvcM9TQD/fPhimZtFlgF5Qd HTMwj5wrUY785y95tr7QV/r+SqvIVJ1jp/c+aChgh//kye+rkZ0Keg4bXK5oYBFSH1CPfk z2t6pXg90jGaBerd96FfrKk40kJz4TfBWwdDCsPy3l66AEZpANM24JotBZq+hBw/TNkG7C hSe9QeIgCqm5wmBPpFvmOW9OP1SV1kz9Hgb5SH76xscmW51sfMZtHgMjyeHqPKvEfSwJXR 8QJOXI3oVmUyZvedXH5sa7lzAGviqQpiPa405IV7YplD08jkCudFYO1EdxMUrQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRHlt0q5Bzqgd; Wed, 24 May 2023 17:11: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 34OHBcb8065885; Wed, 24 May 2023 17:11:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34OHBcch065870; Wed, 24 May 2023 17:11:38 GMT (envelope-from git) Date: Wed, 24 May 2023 17:11:38 GMT Message-Id: <202305241711.34OHBcch065870@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: ae60012e46ec - main - release/oci.conf: add missing vm_extra_pre_umount() steps List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ae60012e46ecfe59a3506b903e685b6a3347807b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ae60012e46ecfe59a3506b903e685b6a3347807b commit ae60012e46ecfe59a3506b903e685b6a3347807b Author: Ed Maste AuthorDate: 2023-05-24 15:45:29 +0000 Commit: Ed Maste CommitDate: 2023-05-24 17:11:07 +0000 release/oci.conf: add missing vm_extra_pre_umount() steps vm.subr's default vm_extra_pre_umount removes /qemu and /etc/resolv.conf. When vm_extra_pre_umount is overridden these steps need to be performed in the cloud-specific conf file. PR: 271602 Reviewed by: dch, lwhsu Event: Kitchener-Waterloo Hackathon 202305 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40257 --- release/tools/oci.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/release/tools/oci.conf b/release/tools/oci.conf index 7260cd24defd..47231d65d79b 100644 --- a/release/tools/oci.conf +++ b/release/tools/oci.conf @@ -90,5 +90,10 @@ EOF touch ${DESTDIR}/firstboot + if ! [ -z "${QEMUSTATIC}" ]; then + rm -f ${DESTDIR}/${EMULATOR} + fi + rm -f ${DESTDIR}/etc/resolv.conf + return 0 } From nobody Wed May 24 18:40:41 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRKkd40CDz4TN3b; Wed, 24 May 2023 18:40: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 4QRKkd229Hz4Qml; Wed, 24 May 2023 18:40:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684953641; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lVTgNM2Z2Pyy6J2Ok6aFiT3vYlGsJ/wmBz7RZGD3tLc=; b=mNUj08sNAj5d/3T5AwPnClNW8JABeVoVjTR965ZoyFlDahBaLpflxR/xE7/f1rlziCZdIH FiZziImoYpiWICslBqTp3BHAXOudMIezZCOYb+4CgZXqK+nw0J8H5sy6HgU5VhUzqYfH3B XKnL38pf4MAbBVs9MOe6X7HyuhHe3/U+eUgxnAyw5gwhaKaucb9fmZzjMB1zG8XyIvRpCj 3EQXKQ3z+t78BNXHpziBY61j0ZTA37Y4d2WbII2h4xsc7SwPrHc4XMSLAXRP+u+Q3dh004 PvaqSXAQ1ivAs1MoFLF0sZQIzR+ibF21fG7u7fTHv4VWNas+56+qVVKq7bOSwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684953641; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lVTgNM2Z2Pyy6J2Ok6aFiT3vYlGsJ/wmBz7RZGD3tLc=; b=iby80WA+i6RHNr0APEaMRgmiPJ2q9UCqO4OCN1sQ4K1Sk2DcklbWoQxK8nGPwueuA56U1r Xy5W4QSAGTKID1D+yov48naxpNGY6tLRZCyDm3Jd8J6d9cbu0HHrm5SSlF5Ijd/iZntCZA 5upnoxzWierAZMWisLXDhh0lg9GDWmES4Lm6Eg7wT+TXMr8LF7FL0IDCwy/UN76x1bmR1+ NGsaYLBbKi0zeiAcrJlvDPBGNueJFcfIWaoffM/zlhcMXBTh6L9bzDc4Pj/jt1O0miSqJj Llfuqke4Q6wNA3e2FUgeNRBfPhBlTq0IThxtcEUT7IPSHWTKjbO+IlL5vz7vHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684953641; a=rsa-sha256; cv=none; b=JdLUBO0JV6zzm04Nkq0LDRpyhF8yy+o+FpdyVUx42V1NHZg3zLoQyEG4zSzbZPF3sQXOqw DOeP4pVUcyjKfF+GMU9r730TgAQgQY+1OfSzlOeTrpce+7reZOP6xPJecERQUIzyAD9jJT nmQ4jKeR+VlIoMk4u5n2+RQAYXEjRvAze1cRsJVc1yUZhcPAK046zlqAZZ8pP5D9qjBvWl sdeyi3EmbdTLuw2XsXbIzz7GaArx+hj+A9GuSxmgKhl8XeVgvSRWTPqWrzRJgZhksuQN77 zo5AtLLiWto3r7bqFdGNnr9fDTyiPtR1qeXqUZSrku0ezSESRmELtfauJklq9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRKkd17ZRzt6p; Wed, 24 May 2023 18:40: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 34OIefWE009429; Wed, 24 May 2023 18:40:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34OIefJk009428; Wed, 24 May 2023 18:40:41 GMT (envelope-from git) Date: Wed, 24 May 2023 18:40:41 GMT Message-Id: <202305241840.34OIefJk009428@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: ffbd1c8bc08e - main - libtelnet: specify OpenSSL 1.1 APIs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ffbd1c8bc08ec34006b8c0b6b6d3d333033364f5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ffbd1c8bc08ec34006b8c0b6b6d3d333033364f5 commit ffbd1c8bc08ec34006b8c0b6b6d3d333033364f5 Author: Ed Maste AuthorDate: 2023-05-24 18:14:28 +0000 Commit: Ed Maste CommitDate: 2023-05-24 18:31:14 +0000 libtelnet: specify OpenSSL 1.1 APIs OPENSSL_API_COMPAT can be used to specify the OpenSSL API version in use for the purpose of hiding deprecated interfaces and enabling the appropriate deprecation notices. This change is a NFC while we're still using OpenSSL 1.1.1 but will avoid deprecation warnings upon the switch to OpenSSL 3.0. A future change should migrate to use the OpenSSL 3.0 APIs, or just remove libtelnet. PR: 271615 Event: Kitchener-Waterloo Hackathon 202305 Sponsored by: The FreeBSD Foundation --- lib/libtelnet/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libtelnet/Makefile b/lib/libtelnet/Makefile index 27bd2d5a22e0..220717b5efa0 100644 --- a/lib/libtelnet/Makefile +++ b/lib/libtelnet/Makefile @@ -19,6 +19,7 @@ WARNS?= 2 .if ${MK_OPENSSL} != "no" SRCS+= encrypt.c auth.c enc_des.c sra.c pk.c CFLAGS+= -DENCRYPTION -DAUTHENTICATION -DSRA +CFLAGS+= -DOPENSSL_API_COMPAT=0x10100000L .endif .if ${MK_KERBEROS_SUPPORT} != "no" From nobody Wed May 24 18:55:30 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRL3l03VLz4TNmG; Wed, 24 May 2023 18:55: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 4QRL3k6d56z4V5g; Wed, 24 May 2023 18:55:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684954530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AbZGrUdfo7k72fTS9/griBYc4URTvhqiKO+K4stjsPI=; b=LM/cCpsZijI5uagNtZxuFQZkpjxE3vXA8JYgHcEnxIsdCzedGCblCLXlT+mMpz5CDN8Zam uxzCz3bagSFvrGJiewULdHQMfRIRhvbJMSiF820UOPNei5PYfKOTTGZroB8SQYgWJsvBz+ CfPvpohTVyAJxlCwc0HIfHJACnoVp8BYJ8yPDy9FQhVx0PqNNZNnAPzJtU7gX9CO5o+Abi fdpyv7E7aY5RSF2UJPc3tDuVx0tYVFT4CV7mbwu0JKbGxujYzKvPoxN4gSyBG+QiuD/Ht7 O9iNDH6Vtoyo3ZmWrKBRJEQu4fEnb7QKBIzt5KJaK5C17mAysTa5+/AwzLOfjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684954530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AbZGrUdfo7k72fTS9/griBYc4URTvhqiKO+K4stjsPI=; b=Rb+vzducGVzcD+xFwtLXsy2dOqt972++FN/HiCgfHbTOxuSwxYeQRX54Qz+oxZT6mJKMcm uXdTbeJkg5fAktfobsKbHBtZIgjCr4KfpjLPHVtTmVInKRy+sWhnr27ReefuI6YKKg8KYW jQADzupo3N/ODGH1YeaUUkRx8swiSt1aeUfc+4f37Z9kzuN8dk4xXiCD3C00EcyMJnrB5v Ohz59tQeUoHMejBL9F7xmGKsioNH03MWiYgCpzkSGf427DSpxA+QdoG+Chf8o90EvygXdb SBd1vEo1oQ+dcZC8Tqy/BXrBJtXsGEVb4poux2czyVGbUngDCrPly0WhCt0QDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684954530; a=rsa-sha256; cv=none; b=MAsotQoBdCFDZaLIyyivjRfKwtq5tsGpDGWRghK241Zk6y09vV/dDY4wIpyBP9CuL9aSkQ 4WhOrdfj7+oC2s+NiUutuJnOvm1njJYBC9I5nFZuWBQCEoRjhlhO4zd/DVJF6lGMbou8Re ddjmYNwgl7GZORPAG7GoDKrLcZCUPRPncEXWOfRnMIpgEfN+yHwysk0bsmkjQ90v6MwkJB O9tfkQsIztR6ADIBJbf2HwMSOyLLicHnNo7ityTRUQNCS6K49fVaMwELVi/PIIKo0cJXZJ A02UfL0APD9s1vh60IlC2bsT7PbdqGMSjEX7h3dQlFginZNe60Y4/ZS4VMhgjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRL3k5kSyztkw; Wed, 24 May 2023 18:55: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 34OItUIf033516; Wed, 24 May 2023 18:55:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34OItUid033515; Wed, 24 May 2023 18:55:30 GMT (envelope-from git) Date: Wed, 24 May 2023 18:55:30 GMT Message-Id: <202305241855.34OItUid033515@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 96e6e5b5fe9b - main - ppp: specify OpenSSL 1.1 APIs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 96e6e5b5fe9b510fd9a416f486860c2acad4219b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=96e6e5b5fe9b510fd9a416f486860c2acad4219b commit 96e6e5b5fe9b510fd9a416f486860c2acad4219b Author: Pierre Pronchery AuthorDate: 2023-05-09 13:01:40 +0000 Commit: Ed Maste CommitDate: 2023-05-24 18:55:07 +0000 ppp: specify OpenSSL 1.1 APIs OPENSSL_API_COMPAT can be used to specify the OpenSSL API version in use for the purpose of hiding deprecated interfaces and enabling the appropriate deprecation notices. This change is a NFC while we're still using OpenSSL 1.1.1 but will avoid deprecation warnings upon the switch to OpenSSL 3.0. A future change should migrate to use the OpenSSL 3.0 APIs. PR: 271615 Reviewed by: emaste Event: Kitchener-Waterloo Hackathon 202305 Sponsored by: The FreeBSD Foundation --- usr.sbin/ppp/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/ppp/Makefile b/usr.sbin/ppp/Makefile index a7a35d49295e..3e70da14eafc 100644 --- a/usr.sbin/ppp/Makefile +++ b/usr.sbin/ppp/Makefile @@ -66,6 +66,7 @@ SRCS+= id.c CFLAGS+=-DNODES .else SRCS+= chap_ms.c mppe.c +CFLAGS+= -DOPENSSL_API_COMPAT=0x10100000L LIBADD+= crypto .endif From nobody Wed May 24 20:04:24 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRMbF1MBPz4TS0f; Wed, 24 May 2023 20:04: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 4QRMbF0tJsz4ZXq; Wed, 24 May 2023 20:04:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684958665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2NfFfV0aoyw/xguY6EzgkIYi0oRkw/kIQskw0XBoCqU=; b=Sh8nkHUVVFItkyfhELoOGgtN9l3moNqTCE+F2YZ/gk9ES5gBH7F5nfM6Bhl3aa9kGdNAYY VY5S0/KNwRGfabm4rQEzIfzb1GNOxXcEoZ8sKTK2foLtSvqP7MOiE2YezK66vURRY2eyPl +ZGgkGofDY72S+7jqh78s2/q/xJSZrS2gVrVRZzYzsECUxUxHk2+TIEjaP3rYDokIJuqrY X1tQugR/3npN+eCJcJcSypAsUioa24EzVzGw3tkqzthDRD9fvg5Dgs9XfzyHUbobwlgzZ6 VxKPbKvQLuZxXN83e+MOVlLtCK4YKPCimTmlEbbAygyzGhLtOlGWrn63SwjuTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684958665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2NfFfV0aoyw/xguY6EzgkIYi0oRkw/kIQskw0XBoCqU=; b=mxg1ws/S8Jxkt0fJEalRdO6ILJQiw/xxvGksoynNK3bU+1Klgqhmx2lo0uGv0DZ/29qRqx CIXtkElZdeuM4qmSEARIqDrGWI5tYo3ORwn1mzf/2Tv+AxdQXPC7PNm0M9psRYJIdMmiP0 KnpK2+dMn1HI9AUmnF1eXHZEGc3HrzlS3cgYZUQ3iJIsgyoGz7aVTTeNmH90AnK8gEOUCT MHT5/AVDqCsh9gCQbqNcCcJvTCtuazFA4lSO496o+2OqESWh8jbrBTTnz4icWfcwkFjf35 fGYHBbdnmrlHW5W00x/kQGQYZc5GN3Cee6L6l1bP1BmslAaI7HnpmRSboNXvmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684958665; a=rsa-sha256; cv=none; b=fKMAWZN1Rd5POkuvNBEAyMQGZsheHEBygpJtOLStGpU1w6YRVN4V3SVOp9G9L368BpJ/px fFO1riJd9/0KQGYlqvRL4fXLgz1uvL9WUPgmzmv6nrGJ2p+Ic4oX1Q9jsSDry/29EUg466 ecHbcRlZj8UsfFEZrXRKd91NvrEP3qURxvVRRbcsXSKzNBpLCSd/sXHZqBmIrzIWh+JQD6 ncq2iZnCTX7wo+HhdiS0GOIULvPdKxs+IOg1i/QsCXfJ4/xJaiK8FumZKnSER1NUTnhh+W +n/RRcCJMubsJ8heT7M1uoWQH6mOsNOpZ3IpIDbmPRM1oDpaz9tE7hVfGEcjiA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRMbD6rfbzwB9; Wed, 24 May 2023 20:04: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 34OK4OEB049268; Wed, 24 May 2023 20:04:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34OK4Oax049267; Wed, 24 May 2023 20:04:24 GMT (envelope-from git) Date: Wed, 24 May 2023 20:04:24 GMT Message-Id: <202305242004.34OK4Oax049267@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Wemm Subject: git: ba244e2a986f - main - delete-old: add two files left behind in certs/blacklisted List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: peter X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ba244e2a986fca388b0be8804c8d84276593f817 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by peter: URL: https://cgit.FreeBSD.org/src/commit/?id=ba244e2a986fca388b0be8804c8d84276593f817 commit ba244e2a986fca388b0be8804c8d84276593f817 Author: Peter Wemm AuthorDate: 2023-05-24 19:46:51 +0000 Commit: Peter Wemm CommitDate: 2023-05-24 20:03:10 +0000 delete-old: add two files left behind in certs/blacklisted The untrusted certs directory was renamed a while ago and these files were moved to the new location. Various upgrade paths cause these files to be missed and prevent deletion of the directory. --- ObsoleteFiles.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 97881f40ac59..a67a95325dfd 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -2583,6 +2583,8 @@ OLD_FILES+=usr/share/certs/blacklisted/GeoTrust_Universal_CA.pem OLD_FILES+=usr/share/certs/blacklisted/Global_Chambersign_Root_-_2008.pem OLD_FILES+=usr/share/certs/blacklisted/LuxTrust_Global_Root_2.pem OLD_FILES+=usr/share/certs/blacklisted/OISTE_WISeKey_Global_Root_GA_CA.pem +OLD_FILES+=usr/share/certs/blacklisted/QuoVadis_Root_CA.pem +OLD_FILES+=usr/share/certs/blacklisted/Sonera_Class_2_Root_CA.pem OLD_FILES+=usr/share/certs/blacklisted/Staat_der_Nederlanden_Root_CA_-_G2.pem OLD_FILES+=usr/share/certs/blacklisted/Staat_der_Nederlanden_Root_CA_-_G3.pem OLD_FILES+=usr/share/certs/blacklisted/SwissSign_Platinum_CA_-_G2.pem From nobody Wed May 24 22:14:06 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRQT64Hq5z4V4XV for ; Wed, 24 May 2023 22:14:18 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from www121.sakura.ne.jp (www121.sakura.ne.jp [153.125.133.21]) (using TLSv1.3 with cipher TLS_AES_256_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 4QRQT430v4z3K8y for ; Wed, 24 May 2023 22:14:15 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of junchoon@dec.sakura.ne.jp has no SPF policy when checking 153.125.133.21) smtp.mailfrom=junchoon@dec.sakura.ne.jp; dmarc=none Received: from kalamity.joker.local (123-1-88-210.area1b.commufa.jp [123.1.88.210]) (authenticated bits=0) by www121.sakura.ne.jp (8.16.1/8.16.1/[SAKURA-WEB]/20201212) with ESMTPA id 34OME6Yu005601; Thu, 25 May 2023 07:14:06 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) Date: Thu, 25 May 2023 07:14:06 +0900 From: Tomoaki AOKI To: dev-commits-src-main@freebsd.org Cc: Randall Stewart Subject: Re: git: 73ee5756dee6 - main - Fixes in the tcp infrastructure with respect to stack changes as well as other infrastructure updates for incoming rack features. Message-Id: <20230525071406.c5ea33f08fd27adb0c39f158@dec.sakura.ne.jp> In-Reply-To: <1E5C3216-1A6F-43AC-AA91-24FA1EA18842@netflix.com> References: <20230522070643.99f8aa0c5509c0d3a5f2ae0b@dec.sakura.ne.jp> <1E5C3216-1A6F-43AC-AA91-24FA1EA18842@netflix.com> Reply-To: junchoon@dec.sakura.ne.jp Organization: Junchoon corps X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd13.2) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-0.83 / 15.00]; AUTH_NA(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-0.99)[-0.988]; MV_CASE(0.50)[]; NEURAL_HAM_SHORT(-0.25)[-0.252]; MIME_GOOD(-0.10)[text/plain]; HAS_GOOGLE_REDIR(0.01)[]; FROM_HAS_DN(0.00)[]; DMARC_NA(0.00)[sakura.ne.jp]; HAS_REPLYTO(0.00)[junchoon@dec.sakura.ne.jp]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; R_SPF_NA(0.00)[no SPF record]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:7684, ipnet:153.125.128.0/18, country:JP]; REPLYTO_ADDR_EQ_FROM(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; HAS_ORG_HEADER(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Queue-Id: 4QRQT430v4z3K8y X-Spamd-Bar: / X-ThisMailContainsUnwantedMimeParts: N On Tue, 23 May 2023 09:59:33 -0400 Randall Stewart wrote: > > https://reviews.freebsd.org/D40229 > > Should fix this :) > > R > > On May 21, 2023, at 6:06 PM, Tomoaki AOKI wrote: > > > >> On Tue, Apr 4, 2023 at 12:31 PM Randall Stewart wrote: > >>> > >>> The branch main has been updated by rrs: > >>> > >>> URL: https://www.google.com/url?q=https://cgit.FreeBSD.org/src/commit/?id%3D73ee5756dee6b2110eb6fb2b2ef3cde39a1fcb4f&source=gmail-imap&ust=1685311614000000&usg=AOvVaw0HmtU6ylNo8jRrPgvtzIB0 > >>> > >>> commit 73ee5756dee6b2110eb6fb2b2ef3cde39a1fcb4f > >>> Author: Randall Stewart > >>> AuthorDate: 2023-04-01 05:46:38 +0000 > >>> Commit: Randall Stewart > >>> CommitDate: 2023-04-01 05:46:38 +0000 > >>> > >>> Fixes in the tcp infrastructure with respect to stack changes as well as other infrastructure updates for incoming rack features. > >>> > >>> So stack switching as always been a bit of a issue. We currently use a break before make setup which means that > >>> if something goes wrong you have to try to get back to a stack. This patch among a lot of other things changes that so > >>> that it is a make before break. We also expand some of the function blocks in prep for new features in rack that will allow > >>> more controlled pacing. We also add other abilities such as the pathway for a stack to query a previous stack to acquire from > >>> it critical state information so things in flight don't get dropped or mis-handled when switching stacks. We also add the > >>> concept of a timer granularity. This allows an alternate stack to change from the old ticks granularity to microseconds and > >>> of course this even gives us a pathway to go to nanosecond timekeeping if we need to (something for the data center to consider > >>> for sure). > >>> > >>> Once all this lands I will then update rack to begin using all these new features. > >>> > >>> Reviewed by: tuexen > >>> Sponsored by: Netflix Inc > >>> Differential Revision: https://www.google.com/url?q=https://reviews.freebsd.org/D39210&source=gmail-imap&ust=1685311614000000&usg=AOvVaw1ZouYiMywAnpdYyYCp9T9O > >> > >> Hi, > >> > >> Could you hide some stuff in netinet/tcp.h? > >> struct http_req breaks curl 8.1.0. > >> > >> Antoine > > > > Please refer to Bug 271526 [1], especially Comment 4 [2] by Jonathan > > Reynolds. > > A patch is proposed there inline (not as an attachment). > > > > [1] https://www.google.com/url?q=https://bugs.freebsd.org/bugzilla/show_bug.cgi?id%3D271526&source=gmail-imap&ust=1685311614000000&usg=AOvVaw2e-0D0bz7CAIVj6kvLZOJg > > > > [2] https://www.google.com/url?q=https://bugs.freebsd.org/bugzilla/show_bug.cgi?id%3D271526%23c4&source=gmail-imap&ust=1685311614000000&usg=AOvVaw154j12MkBXKn2z9_gepR1n > > > > -- > > Tomoaki AOKI > > ------ > Randall Stewart > rrs@netflix.com Thanks! ftp/curl 8.1 built fine with your diff. What's done: Back out the patch at Bug 271526 Apply your diff at D40229 Forcibly rebuild/reinstall base as usual and reboot Forcibly rebuild ftp/curl, which is still before 8.1.1 base is at commit 902dc544cc5859e24c727126e45416133c1c6d46, amd64. Regards. -- Tomoaki AOKI From nobody Wed May 24 23:36:40 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRSJ82TWCz4V89f; Wed, 24 May 2023 23:36: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 4QRSJ81vfvz3Qy6; Wed, 24 May 2023 23:36:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684971400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q35WGXk+HXZ7B44M/TiUw6dR7WtU5yj1A2d73OVo8Yo=; b=GELJqT+jh+nTQHqD5R2vMXrt5Y6LHBMjeXa+ALB8JxDCc5UuU+FpZ68uEkiTz7dDBGbDXE XF7MkvBGEf1E4dT7iw727D6Tb3UilYXlBTlGGeExh5Y7Ou3Pj6q200HF9xMx+cp03ULHt7 khp+ylqeXb1RvIQFvw3yG5TuKbU6BIJIxJIDf/WuyZcrAtPEzX0LRv8loqY/eY6JfLupXv WrnsVhcEe2zSzipPf5KXySglNYRFMxapjB+UbtgsZFhlP0dpqPIIxRIMK0r3v121sSDR+D SJIYD0CAbHDYIZ+e9H6c2g4xeYav9hXqVcB2FxoCfLDZGCFJkz8ndX2S7sxrzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684971400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q35WGXk+HXZ7B44M/TiUw6dR7WtU5yj1A2d73OVo8Yo=; b=s8boL9DyYyyKxFlzi3JwvNZSsPNlS+SaUJNi2SbONHy3I0bjTM41G8W9pYb0twkXk6flXN YfrkZ1Y675cn5VpI/mQ2YfeITA2Z9QDEKTBjAYYMpDRFWqhZa7as5Io4AinPtNO4p4gfUJ MnLynKX+FLiZxJdSypgKtMjoBZaX3xh8U69CR+WotkYjMW5AbNDOxl6a7RZEIchDekETiu W77Ec0zS8SmVYv9gkrSVZ/Yojv+gqIM906tHdx4nTzhX99cUbgxHClxouF6zslanvQZg3n 3crsuxZMVwQAKZjn2FMMRmBLTodZ8IXLnTFwYTddzobq1u6ErMK2Lv9Rgdi0yA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684971400; a=rsa-sha256; cv=none; b=mIC1SwUK6N8wenD5wBJ7DgsNONm2HgppJpQaV3bRRY8IYlYP4edwqyvuyygQtP49YTNl0s b8fuPXaICnzpPPVVJY3As9phLHwlFlV5pTAz9nEcg+TxN8aYwLCBltfORQsz7sgnOPBlGi F59EWPOBNjZnxjfDp7aG7szbjP9xkNYyab+Z2/3lmWI5BSxCb5tl6JAGVUucFBR8YVh7xi sktjK/dVfEGhUjXpP7ktOwDhA/mhMPtw2M973ofpjT4FsGgwXwbx0O6YC5yTtpySANBW8u u+j3PNPexJuoGtQHqQQznfN2HXCPYKkfzj/jXMdilC3rErWhd9+FHisCSz8DFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRSJ80z2jz12Nk; Wed, 24 May 2023 23:36: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 34ONaeS2094637; Wed, 24 May 2023 23:36:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34ONaeUF094636; Wed, 24 May 2023 23:36:40 GMT (envelope-from git) Date: Wed, 24 May 2023 23:36:40 GMT Message-Id: <202305242336.34ONaeUF094636@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: 156424fce98a - main - ixgbe: Change if condition for RSS and rxcsum List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 156424fce98a0240c702da0a918b027d1979bfdb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=156424fce98a0240c702da0a918b027d1979bfdb commit 156424fce98a0240c702da0a918b027d1979bfdb Author: Przemyslaw Lewandowski AuthorDate: 2023-05-24 23:24:54 +0000 Commit: Eric Joyner CommitDate: 2023-05-24 23:29:40 +0000 ixgbe: Change if condition for RSS and rxcsum This patch fixes TCP connection hangs for 1 rxq and 1 txq without rxcsum enabled. Documentation for 10G cards and other drivers suggest enabling rxcsum for RSS and disabling otherwise. When PCSD bit is not set then fragment checksum and IP identification are reported in the rx descriptor. When PCSD bit is set then RSS hash value is reported in the rx descriptor. RSS and RX IPP checksum are mutually exclusive. Signed-off-by: Eric Joyner PR: 268910 Reviewed by: erj@ Tested by: jeffrey.e.pieper@intel.com MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D38621 --- sys/dev/ixgbe/if_ix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 8df0e59a8346..0179c6456de8 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -754,7 +754,7 @@ ixgbe_initialize_receive_units(if_ctx_t ctx) ixgbe_initialize_rss_mapping(sc); - if (sc->num_rx_queues > 1) { + if (sc->feat_en & IXGBE_FEATURE_RSS) { /* RSS and RX IPP Checksum are mutually exclusive */ rxcsum |= IXGBE_RXCSUM_PCSD; } From nobody Wed May 24 23:43:59 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRSSc2C27z4V8lV; Wed, 24 May 2023 23:44: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 4QRSSc1g0Vz3hgf; Wed, 24 May 2023 23:44:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684971840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ECCWRUTMd2pa2zmV5V1ZvZ1Prg90/IOrxdTZ/tlAeZQ=; b=amoQy7ouzwhJzgk9NxkAjl4VBeV5qLviqjUzOoad1twFDBycBW000M2jXJ1LkRE4kCTNVv xgoZTF6mpl0353z6QT/dfxvjS7INgSeX3bkYxgzSBRg7iHHncm2rJ1P8FhpdF4GLAcOv6Q C9q9Rmsj89wGTg6dA8tEopbxMV+lk+zN8Y2haVkWUB6AwPc4EC+srPH2/0cV6m587Yv5ol PMgw9bsJln1nktPtWDXx2vapenbLbssZOuzymFzcMowjHsd+ay7HXssankpgDvTSoFzECe GlwmhPEOLTizECq3SAE5aZBJ++5eQ9OA4LnW74geno9xm10Y0wfSNRS5gjHJEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684971840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ECCWRUTMd2pa2zmV5V1ZvZ1Prg90/IOrxdTZ/tlAeZQ=; b=uU7ivs7alyHbv70JGYXLYsODRgy0NWV6KKN+DHvhxI33FuHSXGUqDYTF9QsahrxnezPGHC IVdfykvTHXFDRqHJHxaW2CO4k4FzJ1PQwvALk1mH+ESoFqueqzovT6UvsMNF9kXK+RL/BR vtNjzZzxpguZIwtMMZFh8Lej18V/gb2NSHlePeZtdhsVU0w+dleNGYH+wy/j/SBE/M7AN6 nHWBxusoLWN8wvfYjrxPgWzPdfiK7uo5iNEq/oazc179TcG1Bup5yFxiP2I6KfXP/qwedz b4dI+ZBB65vR/gYwKcTj9xBEDNO7LZcrzl6PenUIHM5EcpJf+Pys30t1JjnKaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684971840; a=rsa-sha256; cv=none; b=EDRcTwHUKeZsM1ori8Q7RLF3AVrM94CATDTumEcXMIVxoNeVPhWf3UfqBLPYLU4tjeLwsh 2Z5gQDfBpUka9U53Pl0GlZWD1EXASWST6myienp9jxw9k5zBRcU6MxvuDH1wBw55VE+kPz /NcJn0L0WAZZJp+7ZURrbpTlTBYPTs4/I+oD06b5j43E9zBlddsHL7oubO/rpStM36EO+Q Ow49YbE2/dlFDcITuv+VHMBYi7JvAwU4bnRVFS5f9VVjEOlODU0Cs/4nHW1R/ZQiPOrqvc 6ZFnL8BJiH07TJa58VDhx1RmMjqXTIjgNd+tUZY5bl7Sa4zJRjV1dmiC9/7PUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRSSc0jbHz12Mm; Wed, 24 May 2023 23:44: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 34ONi0NN010444; Wed, 24 May 2023 23:44:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34ONhxn7010433; Wed, 24 May 2023 23:43:59 GMT (envelope-from git) Date: Wed, 24 May 2023 23:43:59 GMT Message-Id: <202305242343.34ONhxn7010433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: 9dc2f6e26fc2 - main - ice(4): Update to 1.37.11-k List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9dc2f6e26fc24b88f9046667708a5555c63fb461 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=9dc2f6e26fc24b88f9046667708a5555c63fb461 commit 9dc2f6e26fc24b88f9046667708a5555c63fb461 Author: Eric Joyner AuthorDate: 2023-05-24 23:38:02 +0000 Commit: Eric Joyner CommitDate: 2023-05-24 23:38:28 +0000 ice(4): Update to 1.37.11-k This driver update has no corresponding ice_ddp update, and doesn't contain very many functional changes: - Some refactoring for future SR-IOV PF support - Various minor fixes Signed-off-by: Eric Joyner Tested by: jeffrey.e.pieper@intel.com MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D39821 --- sys/dev/ice/ice_adminq_cmd.h | 3 +- sys/dev/ice/ice_alloc.h | 2 +- sys/dev/ice/ice_bitops.h | 4 +- sys/dev/ice/ice_common.c | 341 +++++++++++++++++++++++----------- sys/dev/ice/ice_common.h | 18 +- sys/dev/ice/ice_common_sysctls.h | 2 +- sys/dev/ice/ice_common_txrx.h | 2 +- sys/dev/ice/ice_controlq.c | 2 +- sys/dev/ice/ice_controlq.h | 2 +- sys/dev/ice/ice_dcb.c | 2 +- sys/dev/ice/ice_dcb.h | 2 +- sys/dev/ice/ice_ddp_common.c | 6 +- sys/dev/ice/ice_ddp_common.h | 8 +- sys/dev/ice/ice_defs.h | 2 +- sys/dev/ice/ice_devids.h | 2 +- sys/dev/ice/ice_drv_info.h | 10 +- sys/dev/ice/ice_features.h | 2 +- sys/dev/ice/ice_flex_pipe.c | 2 +- sys/dev/ice/ice_flex_pipe.h | 2 +- sys/dev/ice/ice_flex_type.h | 2 +- sys/dev/ice/ice_flow.c | 15 +- sys/dev/ice/ice_flow.h | 2 +- sys/dev/ice/ice_fw_logging.c | 2 +- sys/dev/ice/ice_fwlog.c | 2 +- sys/dev/ice/ice_fwlog.h | 2 +- sys/dev/ice/ice_hw_autogen.h | 2 +- sys/dev/ice/ice_iflib.h | 2 +- sys/dev/ice/ice_iflib_recovery_txrx.c | 2 +- sys/dev/ice/ice_iflib_sysctls.h | 2 +- sys/dev/ice/ice_iflib_txrx.c | 2 +- sys/dev/ice/ice_lan_tx_rx.h | 5 +- sys/dev/ice/ice_lib.c | 332 +++++++++++++++++++++++---------- sys/dev/ice/ice_lib.h | 21 ++- sys/dev/ice/ice_nvm.c | 52 ++++-- sys/dev/ice/ice_nvm.h | 2 +- sys/dev/ice/ice_opts.h | 2 +- sys/dev/ice/ice_osdep.c | 2 +- sys/dev/ice/ice_osdep.h | 4 +- sys/dev/ice/ice_protocol_type.h | 41 ++-- sys/dev/ice/ice_rdma.c | 2 +- sys/dev/ice/ice_rdma.h | 2 +- sys/dev/ice/ice_rdma_internal.h | 2 +- sys/dev/ice/ice_resmgr.c | 2 +- sys/dev/ice/ice_resmgr.h | 2 +- sys/dev/ice/ice_rss.h | 2 +- sys/dev/ice/ice_sbq_cmd.h | 2 +- sys/dev/ice/ice_sched.c | 2 +- sys/dev/ice/ice_sched.h | 2 +- sys/dev/ice/ice_status.h | 2 +- sys/dev/ice/ice_strings.c | 2 +- sys/dev/ice/ice_switch.c | 2 +- sys/dev/ice/ice_switch.h | 7 +- sys/dev/ice/ice_type.h | 12 +- sys/dev/ice/ice_vlan_mode.c | 2 +- sys/dev/ice/ice_vlan_mode.h | 2 +- sys/dev/ice/if_ice_iflib.c | 17 +- sys/dev/ice/irdma_di_if.m | 2 +- sys/dev/ice/irdma_if.m | 2 +- sys/dev/ice/virtchnl.h | 105 ++++++++++- sys/dev/ice/virtchnl_inline_ipsec.h | 2 +- 60 files changed, 741 insertions(+), 344 deletions(-) diff --git a/sys/dev/ice/ice_adminq_cmd.h b/sys/dev/ice/ice_adminq_cmd.h index 92ad8055b666..56bfbf27cda2 100644 --- a/sys/dev/ice/ice_adminq_cmd.h +++ b/sys/dev/ice/ice_adminq_cmd.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2022, Intel Corporation +/* Copyright (c) 2023, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1987,6 +1987,7 @@ struct ice_aqc_get_port_options { u8 port_options_count; #define ICE_AQC_PORT_OPT_COUNT_S 0 #define ICE_AQC_PORT_OPT_COUNT_M (0xF << ICE_AQC_PORT_OPT_COUNT_S) +#define ICE_AQC_PORT_OPT_MAX 16 u8 innermost_phy_index; u8 port_options; #define ICE_AQC_PORT_OPT_ACTIVE_S 0 diff --git a/sys/dev/ice/ice_alloc.h b/sys/dev/ice/ice_alloc.h index bfcb376d45b2..d84be78b4bc2 100644 --- a/sys/dev/ice/ice_alloc.h +++ b/sys/dev/ice/ice_alloc.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2022, Intel Corporation +/* Copyright (c) 2023, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_bitops.h b/sys/dev/ice/ice_bitops.h index c29963d0a318..e7b8b19cfe8a 100644 --- a/sys/dev/ice/ice_bitops.h +++ b/sys/dev/ice/ice_bitops.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2022, Intel Corporation +/* Copyright (c) 2023, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -461,7 +461,7 @@ ice_bitmap_hweight(ice_bitmap_t *bm, u16 size) } /** - * ice_cmp_bitmaps - compares two bitmaps. + * ice_cmp_bitmap - compares two bitmaps. * @bmp1: the bitmap to compare * @bmp2: the bitmap to compare with bmp1 * @size: Size of the bitmaps in bits diff --git a/sys/dev/ice/ice_common.c b/sys/dev/ice/ice_common.c index c2efddeb4f7c..e4c112d3a3c2 100644 --- a/sys/dev/ice/ice_common.c +++ b/sys/dev/ice/ice_common.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2022, Intel Corporation +/* Copyright (c) 2023, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,81 +37,81 @@ #include "ice_flow.h" #include "ice_switch.h" -#define ICE_PF_RESET_WAIT_COUNT 300 +#define ICE_PF_RESET_WAIT_COUNT 500 static const char * const ice_link_mode_str_low[] = { - [0] = "100BASE_TX", - [1] = "100M_SGMII", - [2] = "1000BASE_T", - [3] = "1000BASE_SX", - [4] = "1000BASE_LX", - [5] = "1000BASE_KX", - [6] = "1G_SGMII", - [7] = "2500BASE_T", - [8] = "2500BASE_X", - [9] = "2500BASE_KX", - [10] = "5GBASE_T", - [11] = "5GBASE_KR", - [12] = "10GBASE_T", - [13] = "10G_SFI_DA", - [14] = "10GBASE_SR", - [15] = "10GBASE_LR", - [16] = "10GBASE_KR_CR1", - [17] = "10G_SFI_AOC_ACC", - [18] = "10G_SFI_C2C", - [19] = "25GBASE_T", - [20] = "25GBASE_CR", - [21] = "25GBASE_CR_S", - [22] = "25GBASE_CR1", - [23] = "25GBASE_SR", - [24] = "25GBASE_LR", - [25] = "25GBASE_KR", - [26] = "25GBASE_KR_S", - [27] = "25GBASE_KR1", - [28] = "25G_AUI_AOC_ACC", - [29] = "25G_AUI_C2C", - [30] = "40GBASE_CR4", - [31] = "40GBASE_SR4", - [32] = "40GBASE_LR4", - [33] = "40GBASE_KR4", - [34] = "40G_XLAUI_AOC_ACC", - [35] = "40G_XLAUI", - [36] = "50GBASE_CR2", - [37] = "50GBASE_SR2", - [38] = "50GBASE_LR2", - [39] = "50GBASE_KR2", - [40] = "50G_LAUI2_AOC_ACC", - [41] = "50G_LAUI2", - [42] = "50G_AUI2_AOC_ACC", - [43] = "50G_AUI2", - [44] = "50GBASE_CP", - [45] = "50GBASE_SR", - [46] = "50GBASE_FR", - [47] = "50GBASE_LR", - [48] = "50GBASE_KR_PAM4", - [49] = "50G_AUI1_AOC_ACC", - [50] = "50G_AUI1", - [51] = "100GBASE_CR4", - [52] = "100GBASE_SR4", - [53] = "100GBASE_LR4", - [54] = "100GBASE_KR4", - [55] = "100G_CAUI4_AOC_ACC", - [56] = "100G_CAUI4", - [57] = "100G_AUI4_AOC_ACC", - [58] = "100G_AUI4", - [59] = "100GBASE_CR_PAM4", - [60] = "100GBASE_KR_PAM4", - [61] = "100GBASE_CP2", - [62] = "100GBASE_SR2", - [63] = "100GBASE_DR", + ice_arr_elem_idx(0, "100BASE_TX"), + ice_arr_elem_idx(1, "100M_SGMII"), + ice_arr_elem_idx(2, "1000BASE_T"), + ice_arr_elem_idx(3, "1000BASE_SX"), + ice_arr_elem_idx(4, "1000BASE_LX"), + ice_arr_elem_idx(5, "1000BASE_KX"), + ice_arr_elem_idx(6, "1G_SGMII"), + ice_arr_elem_idx(7, "2500BASE_T"), + ice_arr_elem_idx(8, "2500BASE_X"), + ice_arr_elem_idx(9, "2500BASE_KX"), + ice_arr_elem_idx(10, "5GBASE_T"), + ice_arr_elem_idx(11, "5GBASE_KR"), + ice_arr_elem_idx(12, "10GBASE_T"), + ice_arr_elem_idx(13, "10G_SFI_DA"), + ice_arr_elem_idx(14, "10GBASE_SR"), + ice_arr_elem_idx(15, "10GBASE_LR"), + ice_arr_elem_idx(16, "10GBASE_KR_CR1"), + ice_arr_elem_idx(17, "10G_SFI_AOC_ACC"), + ice_arr_elem_idx(18, "10G_SFI_C2C"), + ice_arr_elem_idx(19, "25GBASE_T"), + ice_arr_elem_idx(20, "25GBASE_CR"), + ice_arr_elem_idx(21, "25GBASE_CR_S"), + ice_arr_elem_idx(22, "25GBASE_CR1"), + ice_arr_elem_idx(23, "25GBASE_SR"), + ice_arr_elem_idx(24, "25GBASE_LR"), + ice_arr_elem_idx(25, "25GBASE_KR"), + ice_arr_elem_idx(26, "25GBASE_KR_S"), + ice_arr_elem_idx(27, "25GBASE_KR1"), + ice_arr_elem_idx(28, "25G_AUI_AOC_ACC"), + ice_arr_elem_idx(29, "25G_AUI_C2C"), + ice_arr_elem_idx(30, "40GBASE_CR4"), + ice_arr_elem_idx(31, "40GBASE_SR4"), + ice_arr_elem_idx(32, "40GBASE_LR4"), + ice_arr_elem_idx(33, "40GBASE_KR4"), + ice_arr_elem_idx(34, "40G_XLAUI_AOC_ACC"), + ice_arr_elem_idx(35, "40G_XLAUI"), + ice_arr_elem_idx(36, "50GBASE_CR2"), + ice_arr_elem_idx(37, "50GBASE_SR2"), + ice_arr_elem_idx(38, "50GBASE_LR2"), + ice_arr_elem_idx(39, "50GBASE_KR2"), + ice_arr_elem_idx(40, "50G_LAUI2_AOC_ACC"), + ice_arr_elem_idx(41, "50G_LAUI2"), + ice_arr_elem_idx(42, "50G_AUI2_AOC_ACC"), + ice_arr_elem_idx(43, "50G_AUI2"), + ice_arr_elem_idx(44, "50GBASE_CP"), + ice_arr_elem_idx(45, "50GBASE_SR"), + ice_arr_elem_idx(46, "50GBASE_FR"), + ice_arr_elem_idx(47, "50GBASE_LR"), + ice_arr_elem_idx(48, "50GBASE_KR_PAM4"), + ice_arr_elem_idx(49, "50G_AUI1_AOC_ACC"), + ice_arr_elem_idx(50, "50G_AUI1"), + ice_arr_elem_idx(51, "100GBASE_CR4"), + ice_arr_elem_idx(52, "100GBASE_SR4"), + ice_arr_elem_idx(53, "100GBASE_LR4"), + ice_arr_elem_idx(54, "100GBASE_KR4"), + ice_arr_elem_idx(55, "100G_CAUI4_AOC_ACC"), + ice_arr_elem_idx(56, "100G_CAUI4"), + ice_arr_elem_idx(57, "100G_AUI4_AOC_ACC"), + ice_arr_elem_idx(58, "100G_AUI4"), + ice_arr_elem_idx(59, "100GBASE_CR_PAM4"), + ice_arr_elem_idx(60, "100GBASE_KR_PAM4"), + ice_arr_elem_idx(61, "100GBASE_CP2"), + ice_arr_elem_idx(62, "100GBASE_SR2"), + ice_arr_elem_idx(63, "100GBASE_DR"), }; static const char * const ice_link_mode_str_high[] = { - [0] = "100GBASE_KR2_PAM4", - [1] = "100G_CAUI2_AOC_ACC", - [2] = "100G_CAUI2", - [3] = "100G_AUI2_AOC_ACC", - [4] = "100G_AUI2", + ice_arr_elem_idx(0, "100GBASE_KR2_PAM4"), + ice_arr_elem_idx(1, "100G_CAUI2_AOC_ACC"), + ice_arr_elem_idx(2, "100G_CAUI2"), + ice_arr_elem_idx(3, "100G_AUI2_AOC_ACC"), + ice_arr_elem_idx(4, "100G_AUI2"), }; /** @@ -1292,7 +1292,7 @@ static enum ice_status ice_pf_reset(struct ice_hw *hw) * that is occurring during a download package operation. */ for (cnt = 0; cnt < ICE_GLOBAL_CFG_LOCK_TIMEOUT + - ICE_PF_RESET_WAIT_COUNT; cnt++) { + ICE_PF_RESET_WAIT_COUNT; cnt++) { reg = rd32(hw, PFGEN_CTRL); if (!(reg & PFGEN_CTRL_PFSWR_M)) break; @@ -1378,6 +1378,37 @@ ice_copy_rxq_ctx_to_hw(struct ice_hw *hw, u8 *ice_rxq_ctx, u32 rxq_index) return ICE_SUCCESS; } +/** + * ice_copy_rxq_ctx_from_hw - Copy rxq context register from HW + * @hw: pointer to the hardware structure + * @ice_rxq_ctx: pointer to the rxq context + * @rxq_index: the index of the Rx queue + * + * Copies rxq context from HW register space to dense structure + */ +static enum ice_status +ice_copy_rxq_ctx_from_hw(struct ice_hw *hw, u8 *ice_rxq_ctx, u32 rxq_index) +{ + u8 i; + + if (!ice_rxq_ctx) + return ICE_ERR_BAD_PTR; + + if (rxq_index > QRX_CTRL_MAX_INDEX) + return ICE_ERR_PARAM; + + /* Copy each dword separately from HW */ + for (i = 0; i < ICE_RXQ_CTX_SIZE_DWORDS; i++) { + u32 *ctx = (u32 *)(ice_rxq_ctx + (i * sizeof(u32))); + + *ctx = rd32(hw, QRX_CONTEXT(i, rxq_index)); + + ice_debug(hw, ICE_DBG_QCTX, "qrxdata[%d]: %08X\n", i, *ctx); + } + + return ICE_SUCCESS; +} + /* LAN Rx Queue Context */ static const struct ice_ctx_ele ice_rlan_ctx_info[] = { /* Field Width LSB */ @@ -1429,6 +1460,32 @@ ice_write_rxq_ctx(struct ice_hw *hw, struct ice_rlan_ctx *rlan_ctx, return ice_copy_rxq_ctx_to_hw(hw, ctx_buf, rxq_index); } +/** + * ice_read_rxq_ctx - Read rxq context from HW + * @hw: pointer to the hardware structure + * @rlan_ctx: pointer to the rxq context + * @rxq_index: the index of the Rx queue + * + * Read rxq context from HW register space and then converts it from dense + * structure to sparse + */ +enum ice_status +ice_read_rxq_ctx(struct ice_hw *hw, struct ice_rlan_ctx *rlan_ctx, + u32 rxq_index) +{ + u8 ctx_buf[ICE_RXQ_CTX_SZ] = { 0 }; + enum ice_status status; + + if (!rlan_ctx) + return ICE_ERR_BAD_PTR; + + status = ice_copy_rxq_ctx_from_hw(hw, ctx_buf, rxq_index); + if (status) + return status; + + return ice_get_ctx(ctx_buf, (u8 *)rlan_ctx, ice_rlan_ctx_info); +} + /** * ice_clear_rxq_ctx * @hw: pointer to the hardware structure @@ -1450,7 +1507,9 @@ enum ice_status ice_clear_rxq_ctx(struct ice_hw *hw, u32 rxq_index) return ICE_SUCCESS; } -/* LAN Tx Queue Context */ +/* LAN Tx Queue Context used for set Tx config by ice_aqc_opc_add_txqs, + * Bit[0-175] is valid + */ const struct ice_ctx_ele ice_tlan_ctx_info[] = { /* Field Width LSB */ ICE_CTX_STORE(ice_tlan_ctx, base, 57, 0), @@ -3041,7 +3100,6 @@ enum ice_status ice_aq_set_port_params(struct ice_port_info *pi, u16 bad_frame_vsi, bool save_bad_pac, bool pad_short_pac, bool double_vlan, struct ice_sq_cd *cd) - { struct ice_aqc_set_port_params *cmd; struct ice_hw *hw = pi->hw; @@ -3093,8 +3151,8 @@ bool ice_is_100m_speed_supported(struct ice_hw *hw) * Note: In the structure of [phy_type_low, phy_type_high], there should * be one bit set, as this function will convert one PHY type to its * speed. - * If no bit gets set, ICE_LINK_SPEED_UNKNOWN will be returned - * If more than one bit gets set, ICE_LINK_SPEED_UNKNOWN will be returned + * If no bit gets set, ICE_AQ_LINK_SPEED_UNKNOWN will be returned + * If more than one bit gets set, ICE_AQ_LINK_SPEED_UNKNOWN will be returned */ static u16 ice_get_link_speed_based_on_phy_type(u64 phy_type_low, u64 phy_type_high) @@ -4772,7 +4830,7 @@ ice_aq_get_internal_data(struct ice_hw *hw, u8 cluster_id, u16 table_id, * @ce_info: a description of the struct to be filled */ static void -ice_read_byte(u8 *src_ctx, u8 *dest_ctx, struct ice_ctx_ele *ce_info) +ice_read_byte(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) { u8 dest_byte, mask; u8 *src, *target; @@ -4790,7 +4848,7 @@ ice_read_byte(u8 *src_ctx, u8 *dest_ctx, struct ice_ctx_ele *ce_info) ice_memcpy(&dest_byte, src, sizeof(dest_byte), ICE_DMA_TO_NONDMA); - dest_byte &= ~(mask); + dest_byte &= mask; dest_byte >>= shift_width; @@ -4808,7 +4866,7 @@ ice_read_byte(u8 *src_ctx, u8 *dest_ctx, struct ice_ctx_ele *ce_info) * @ce_info: a description of the struct to be filled */ static void -ice_read_word(u8 *src_ctx, u8 *dest_ctx, struct ice_ctx_ele *ce_info) +ice_read_word(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) { u16 dest_word, mask; u8 *src, *target; @@ -4830,7 +4888,7 @@ ice_read_word(u8 *src_ctx, u8 *dest_ctx, struct ice_ctx_ele *ce_info) /* the data in the memory is stored as little endian so mask it * correctly */ - src_word &= ~(CPU_TO_LE16(mask)); + src_word &= CPU_TO_LE16(mask); /* get the data back into host order before shifting */ dest_word = LE16_TO_CPU(src_word); @@ -4851,7 +4909,7 @@ ice_read_word(u8 *src_ctx, u8 *dest_ctx, struct ice_ctx_ele *ce_info) * @ce_info: a description of the struct to be filled */ static void -ice_read_dword(u8 *src_ctx, u8 *dest_ctx, struct ice_ctx_ele *ce_info) +ice_read_dword(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) { u32 dest_dword, mask; __le32 src_dword; @@ -4881,7 +4939,7 @@ ice_read_dword(u8 *src_ctx, u8 *dest_ctx, struct ice_ctx_ele *ce_info) /* the data in the memory is stored as little endian so mask it * correctly */ - src_dword &= ~(CPU_TO_LE32(mask)); + src_dword &= CPU_TO_LE32(mask); /* get the data back into host order before shifting */ dest_dword = LE32_TO_CPU(src_dword); @@ -4902,7 +4960,7 @@ ice_read_dword(u8 *src_ctx, u8 *dest_ctx, struct ice_ctx_ele *ce_info) * @ce_info: a description of the struct to be filled */ static void -ice_read_qword(u8 *src_ctx, u8 *dest_ctx, struct ice_ctx_ele *ce_info) +ice_read_qword(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) { u64 dest_qword, mask; __le64 src_qword; @@ -4932,7 +4990,7 @@ ice_read_qword(u8 *src_ctx, u8 *dest_ctx, struct ice_ctx_ele *ce_info) /* the data in the memory is stored as little endian so mask it * correctly */ - src_qword &= ~(CPU_TO_LE64(mask)); + src_qword &= CPU_TO_LE64(mask); /* get the data back into host order before shifting */ dest_qword = LE64_TO_CPU(src_qword); @@ -4953,7 +5011,7 @@ ice_read_qword(u8 *src_ctx, u8 *dest_ctx, struct ice_ctx_ele *ce_info) * @ce_info: a description of the structure to be read from */ enum ice_status -ice_get_ctx(u8 *src_ctx, u8 *dest_ctx, struct ice_ctx_ele *ce_info) +ice_get_ctx(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) { int f; @@ -5789,7 +5847,7 @@ enum ice_fw_modes ice_get_fw_mode(struct ice_hw *hw) } /** - * ice_cfg_get_cur_lldp_persist_status + * ice_get_cur_lldp_persist_status * @hw: pointer to the HW struct * @lldp_status: return value of LLDP persistent status * @@ -6266,6 +6324,8 @@ ice_aq_set_health_status_config(struct ice_hw *hw, u8 event_source, * when PF owns more than 1 port it must be true * @active_option_idx: index of active port option in returned buffer * @active_option_valid: active option in returned buffer is valid + * @pending_option_idx: index of pending port option in returned buffer + * @pending_option_valid: pending option in returned buffer is valid * * Calls Get Port Options AQC (0x06ea) and verifies result. */ @@ -6273,17 +6333,14 @@ enum ice_status ice_aq_get_port_options(struct ice_hw *hw, struct ice_aqc_get_port_options_elem *options, u8 *option_count, u8 lport, bool lport_valid, - u8 *active_option_idx, bool *active_option_valid) + u8 *active_option_idx, bool *active_option_valid, + u8 *pending_option_idx, bool *pending_option_valid) { struct ice_aqc_get_port_options *cmd; struct ice_aq_desc desc; enum ice_status status; - u8 pmd_count; - u8 max_speed; u8 i; - ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__); - /* options buffer shall be able to hold max returned options */ if (*option_count < ICE_AQC_PORT_OPT_COUNT_M) return ICE_ERR_PARAM; @@ -6291,8 +6348,7 @@ ice_aq_get_port_options(struct ice_hw *hw, cmd = &desc.params.get_port_options; ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_port_options); - if (lport_valid) - cmd->lport_num = lport; + cmd->lport_num = lport; cmd->lport_num_valid = lport_valid; status = ice_aq_send_cmd(hw, &desc, options, @@ -6313,34 +6369,59 @@ ice_aq_get_port_options(struct ice_hw *hw, *active_option_idx); } - /* verify indirect FW response & mask output options fields */ + *pending_option_valid = cmd->pending_port_option_status & + ICE_AQC_PENDING_PORT_OPT_VALID; + if (*pending_option_valid) { + *pending_option_idx = cmd->pending_port_option_status & + ICE_AQC_PENDING_PORT_OPT_IDX_M; + if (*pending_option_idx > (*option_count - 1)) + return ICE_ERR_OUT_OF_RANGE; + ice_debug(hw, ICE_DBG_PHY, "pending idx: %x\n", + *pending_option_idx); + } + + /* mask output options fields */ for (i = 0; i < *option_count; i++) { options[i].pmd &= ICE_AQC_PORT_OPT_PMD_COUNT_M; options[i].max_lane_speed &= ICE_AQC_PORT_OPT_MAX_LANE_M; - pmd_count = options[i].pmd; - max_speed = options[i].max_lane_speed; ice_debug(hw, ICE_DBG_PHY, "pmds: %x max speed: %x\n", - pmd_count, max_speed); - - /* check only entries containing valid max pmd speed values, - * other reserved values may be returned, when logical port - * used is unrelated to specific option - */ - if (max_speed <= ICE_AQC_PORT_OPT_MAX_LANE_100G) { - if (pmd_count > ICE_MAX_PORT_PER_PCI_DEV) - return ICE_ERR_OUT_OF_RANGE; - if (pmd_count > 2 && - max_speed > ICE_AQC_PORT_OPT_MAX_LANE_25G) - return ICE_ERR_CFG; - if (pmd_count > 7 && - max_speed > ICE_AQC_PORT_OPT_MAX_LANE_10G) - return ICE_ERR_CFG; - } + options[i].pmd, options[i].max_lane_speed); } return ICE_SUCCESS; } +/** + * ice_aq_set_port_option + * @hw: pointer to the hw struct + * @lport: logical port to call the command with + * @lport_valid: when false, FW uses port owned by the PF instead of lport, + * when PF owns more than 1 port it must be true + * @new_option: new port option to be written + * + * Calls Set Port Options AQC (0x06eb). + */ +enum ice_status +ice_aq_set_port_option(struct ice_hw *hw, u8 lport, u8 lport_valid, + u8 new_option) +{ + struct ice_aqc_set_port_option *cmd; + struct ice_aq_desc desc; + + if (new_option >= ICE_AQC_PORT_OPT_COUNT_M) + return ICE_ERR_PARAM; + + cmd = &desc.params.set_port_option; + ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_port_option); + + cmd->lport_num = lport; + + cmd->lport_num_valid = lport_valid; + cmd->selected_port_option = new_option; + + return ice_aq_send_cmd(hw, &desc, NULL, 0, NULL); +} + /** * ice_aq_set_lldp_mib - Set the LLDP MIB * @hw: pointer to the HW struct @@ -6440,6 +6521,42 @@ bool ice_fw_supports_report_dflt_cfg(struct ice_hw *hw) ICE_FW_API_REPORT_DFLT_CFG_PATCH); } +/* each of the indexes into the following array match the speed of a return + * value from the list of AQ returned speeds like the range: + * ICE_AQ_LINK_SPEED_10MB .. ICE_AQ_LINK_SPEED_100GB excluding + * ICE_AQ_LINK_SPEED_UNKNOWN which is BIT(15) The array is defined as 15 + * elements long because the link_speed returned by the firmware is a 16 bit + * value, but is indexed by [fls(speed) - 1] + */ +static const u32 ice_aq_to_link_speed[15] = { + ICE_LINK_SPEED_10MBPS, /* BIT(0) */ + ICE_LINK_SPEED_100MBPS, + ICE_LINK_SPEED_1000MBPS, + ICE_LINK_SPEED_2500MBPS, + ICE_LINK_SPEED_5000MBPS, + ICE_LINK_SPEED_10000MBPS, + ICE_LINK_SPEED_20000MBPS, + ICE_LINK_SPEED_25000MBPS, + ICE_LINK_SPEED_40000MBPS, + ICE_LINK_SPEED_50000MBPS, + ICE_LINK_SPEED_100000MBPS, /* BIT(10) */ + ICE_LINK_SPEED_UNKNOWN, + ICE_LINK_SPEED_UNKNOWN, + ICE_LINK_SPEED_UNKNOWN, + ICE_LINK_SPEED_UNKNOWN /* BIT(14) */ +}; + +/** + * ice_get_link_speed - get integer speed from table + * @index: array index from fls(aq speed) - 1 + * + * Returns: u32 value containing integer speed + */ +u32 ice_get_link_speed(u16 index) +{ + return ice_aq_to_link_speed[index]; +} + /** * ice_fw_supports_fec_dis_auto * @hw: pointer to the hardware structure diff --git a/sys/dev/ice/ice_common.h b/sys/dev/ice/ice_common.h index 73e051fdda67..01ed55c192a1 100644 --- a/sys/dev/ice/ice_common.h +++ b/sys/dev/ice/ice_common.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2022, Intel Corporation +/* Copyright (c) 2023, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -57,7 +57,6 @@ enum ice_status ice_init_hw(struct ice_hw *hw); void ice_deinit_hw(struct ice_hw *hw); enum ice_status ice_check_reset(struct ice_hw *hw); enum ice_status ice_reset(struct ice_hw *hw, enum ice_reset_req req); - enum ice_status ice_create_all_ctrlq(struct ice_hw *hw); enum ice_status ice_init_all_ctrlq(struct ice_hw *hw); void ice_shutdown_all_ctrlq(struct ice_hw *hw, bool unloading); @@ -85,7 +84,6 @@ ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq, struct ice_aq_desc *desc, void *buf, u16 buf_size, struct ice_sq_cd *cd); void ice_clear_pxe_mode(struct ice_hw *hw); - enum ice_status ice_get_caps(struct ice_hw *hw); void ice_set_safe_mode_caps(struct ice_hw *hw); @@ -109,9 +107,14 @@ enum ice_status ice_set_mac_type(struct ice_hw *hw); */ #define ICE_ALIGN(ptr, align) (((ptr) + ((align) - 1)) & ~((align) - 1)) +#define ice_arr_elem_idx(idx, val) [(idx)] = (val) + enum ice_status ice_write_rxq_ctx(struct ice_hw *hw, struct ice_rlan_ctx *rlan_ctx, u32 rxq_index); +enum ice_status +ice_read_rxq_ctx(struct ice_hw *hw, struct ice_rlan_ctx *rlan_ctx, + u32 rxq_index); enum ice_status ice_clear_rxq_ctx(struct ice_hw *hw, u32 rxq_index); enum ice_status ice_clear_tx_cmpltnq_ctx(struct ice_hw *hw, u32 tx_cmpltnq_index); @@ -159,6 +162,8 @@ extern const struct ice_ctx_ele ice_tlan_ctx_info[]; enum ice_status ice_set_ctx(struct ice_hw *hw, u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info); +enum ice_status +ice_get_ctx(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info); enum ice_status ice_aq_send_cmd(struct ice_hw *hw, struct ice_aq_desc *desc, @@ -240,6 +245,7 @@ enum ice_status ice_aq_sff_eeprom(struct ice_hw *hw, u16 lport, u8 bus_addr, u16 mem_addr, u8 page, u8 set_page, u8 *data, u8 length, bool write, struct ice_sq_cd *cd); +u32 ice_get_link_speed(u16 index); enum ice_status ice_aq_prog_topo_dev_nvm(struct ice_hw *hw, @@ -255,9 +261,11 @@ enum ice_status ice_aq_get_port_options(struct ice_hw *hw, struct ice_aqc_get_port_options_elem *options, u8 *option_count, u8 lport, bool lport_valid, - u8 *active_option_idx, bool *active_option_valid); + u8 *active_option_idx, bool *active_option_valid, + u8 *pending_option_idx, bool *pending_option_valid); enum ice_status -ice_get_ctx(u8 *src_ctx, u8 *dest_ctx, struct ice_ctx_ele *ce_info); +ice_aq_set_port_option(struct ice_hw *hw, u8 lport, u8 lport_valid, + u8 new_option); enum ice_status __ice_write_sr_word(struct ice_hw *hw, u32 offset, const u16 *data); enum ice_status diff --git a/sys/dev/ice/ice_common_sysctls.h b/sys/dev/ice/ice_common_sysctls.h index 11cfc50848f5..98a1bd6f8df6 100644 --- a/sys/dev/ice/ice_common_sysctls.h +++ b/sys/dev/ice/ice_common_sysctls.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2022, Intel Corporation +/* Copyright (c) 2023, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_common_txrx.h b/sys/dev/ice/ice_common_txrx.h index dd2b3c5bff0d..4797fe86b835 100644 --- a/sys/dev/ice/ice_common_txrx.h +++ b/sys/dev/ice/ice_common_txrx.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2022, Intel Corporation +/* Copyright (c) 2023, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_controlq.c b/sys/dev/ice/ice_controlq.c index 76de98dcfafc..aeb651b45fa8 100644 --- a/sys/dev/ice/ice_controlq.c +++ b/sys/dev/ice/ice_controlq.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2022, Intel Corporation +/* Copyright (c) 2023, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_controlq.h b/sys/dev/ice/ice_controlq.h index 16d47ae77f8f..c556fcd20255 100644 --- a/sys/dev/ice/ice_controlq.h +++ b/sys/dev/ice/ice_controlq.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2022, Intel Corporation +/* Copyright (c) 2023, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_dcb.c b/sys/dev/ice/ice_dcb.c index 19ab0d349cf7..244566bca308 100644 --- a/sys/dev/ice/ice_dcb.c +++ b/sys/dev/ice/ice_dcb.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2022, Intel Corporation +/* Copyright (c) 2023, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_dcb.h b/sys/dev/ice/ice_dcb.h index 504a356221c5..d3f371deed4f 100644 --- a/sys/dev/ice/ice_dcb.h +++ b/sys/dev/ice/ice_dcb.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2022, Intel Corporation +/* Copyright (c) 2023, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_ddp_common.c b/sys/dev/ice/ice_ddp_common.c index 730b78b0f81e..91dde8666153 100644 --- a/sys/dev/ice/ice_ddp_common.c +++ b/sys/dev/ice/ice_ddp_common.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2022, Intel Corporation +/* Copyright (c) 2023, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1470,14 +1470,14 @@ struct ice_buf_build *ice_pkg_buf_alloc(struct ice_hw *hw) return bld; } -static bool ice_is_gtp_u_profile(u16 prof_idx) +static bool ice_is_gtp_u_profile(u32 prof_idx) { return (prof_idx >= ICE_PROFID_IPV6_GTPU_TEID && prof_idx <= ICE_PROFID_IPV6_GTPU_IPV6_TCP) || prof_idx == ICE_PROFID_IPV4_GTPU_TEID; } -static bool ice_is_gtp_c_profile(u16 prof_idx) +static bool ice_is_gtp_c_profile(u32 prof_idx) { switch (prof_idx) { case ICE_PROFID_IPV4_GTPC_TEID: diff --git a/sys/dev/ice/ice_ddp_common.h b/sys/dev/ice/ice_ddp_common.h index 621729b03446..f59c0a614888 100644 --- a/sys/dev/ice/ice_ddp_common.h +++ b/sys/dev/ice/ice_ddp_common.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2022, Intel Corporation +/* Copyright (c) 2023, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -30,8 +30,8 @@ */ /*$FreeBSD$*/ -#ifndef _ICE_DDP_H_ -#define _ICE_DDP_H_ +#ifndef _ICE_DDP_COMMON_H_ +#define _ICE_DDP_COMMON_H_ #include "ice_osdep.h" #include "ice_adminq_cmd.h" @@ -475,4 +475,4 @@ void ice_pkg_buf_free(struct ice_hw *hw, struct ice_buf_build *bld); enum ice_status ice_cfg_tx_topo(struct ice_hw *hw, u8 *buf, u32 len); -#endif /* _ICE_DDP_H_ */ +#endif /* _ICE_DDP_COMMON_H_ */ diff --git a/sys/dev/ice/ice_defs.h b/sys/dev/ice/ice_defs.h index 8a1dda2c492c..5205a3d9b492 100644 --- a/sys/dev/ice/ice_defs.h +++ b/sys/dev/ice/ice_defs.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2022, Intel Corporation +/* Copyright (c) 2023, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_devids.h b/sys/dev/ice/ice_devids.h index dc8970952b49..1048da7ac5de 100644 --- a/sys/dev/ice/ice_devids.h +++ b/sys/dev/ice/ice_devids.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2022, Intel Corporation +/* Copyright (c) 2023, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_drv_info.h b/sys/dev/ice/ice_drv_info.h index f47adb1572c6..407b6d555130 100644 --- a/sys/dev/ice/ice_drv_info.h +++ b/sys/dev/ice/ice_drv_info.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2022, Intel Corporation +/* Copyright (c) 2023, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -63,16 +63,16 @@ * @var ice_rc_version * @brief driver release candidate version number */ -const char ice_driver_version[] = "1.37.7-k"; +const char ice_driver_version[] = "1.37.11-k"; const uint8_t ice_major_version = 1; const uint8_t ice_minor_version = 37; -const uint8_t ice_patch_version = 7; +const uint8_t ice_patch_version = 11; const uint8_t ice_rc_version = 0; #define PVIDV(vendor, devid, name) \ - PVID(vendor, devid, name " - 1.37.7-k") + PVID(vendor, devid, name " - 1.37.11-k") #define PVIDV_OEM(vendor, devid, svid, sdevid, revid, name) \ - PVID_OEM(vendor, devid, svid, sdevid, revid, name " - 1.37.7-k") + PVID_OEM(vendor, devid, svid, sdevid, revid, name " - 1.37.11-k") /** * @var ice_vendor_info_array diff --git a/sys/dev/ice/ice_features.h b/sys/dev/ice/ice_features.h index efbeb12c3ab1..24404434d162 100644 --- a/sys/dev/ice/ice_features.h +++ b/sys/dev/ice/ice_features.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2022, Intel Corporation +/* Copyright (c) 2023, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_flex_pipe.c b/sys/dev/ice/ice_flex_pipe.c index 36c420478131..5a6a77a65c43 100644 --- a/sys/dev/ice/ice_flex_pipe.c +++ b/sys/dev/ice/ice_flex_pipe.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2022, Intel Corporation +/* Copyright (c) 2023, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_flex_pipe.h b/sys/dev/ice/ice_flex_pipe.h index ada71b2d446a..a20be014763b 100644 --- a/sys/dev/ice/ice_flex_pipe.h +++ b/sys/dev/ice/ice_flex_pipe.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2022, Intel Corporation +/* Copyright (c) 2023, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_flex_type.h b/sys/dev/ice/ice_flex_type.h index 145797f34b7a..56587e890a0f 100644 --- a/sys/dev/ice/ice_flex_type.h +++ b/sys/dev/ice/ice_flex_type.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2022, Intel Corporation +/* Copyright (c) 2023, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_flow.c b/sys/dev/ice/ice_flow.c index 73abf03d43b8..954ca84175db 100644 --- a/sys/dev/ice/ice_flow.c +++ b/sys/dev/ice/ice_flow.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2022, Intel Corporation +/* Copyright (c) 2023, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1368,6 +1368,7 @@ enum ice_status ice_rem_vsi_rss_cfg(struct ice_hw *hw, u16 vsi_handle) const enum ice_block blk = ICE_BLK_RSS; struct ice_flow_prof *p, *t; enum ice_status status = ICE_SUCCESS; + u16 vsig; if (!ice_is_vsi_valid(hw, vsi_handle)) return ICE_ERR_PARAM; @@ -1377,7 +1378,16 @@ enum ice_status ice_rem_vsi_rss_cfg(struct ice_hw *hw, u16 vsi_handle) ice_acquire_lock(&hw->rss_locks); LIST_FOR_EACH_ENTRY_SAFE(p, t, &hw->fl_profs[blk], ice_flow_prof, - l_entry) + l_entry) { + int ret; + + /* check if vsig is already removed */ + ret = ice_vsig_find_vsi(hw, blk, + ice_get_hw_vsi_num(hw, vsi_handle), + &vsig); + if (!ret && !vsig) + break; + *** 1429 LINES SKIPPED *** From nobody Wed May 24 23:44:47 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRSTX0Bfdz4V97T; Wed, 24 May 2023 23:44: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 4QRSTW4x7Sz3hvj; Wed, 24 May 2023 23:44:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684971887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=24PN8TPOaT/qnaEdZiarofnhyGUBkbF/M8emDZWGqTk=; b=jTHi6m+zOi4Bx6x3JF6oMJwAN5nqE9kai2Ceqm125Mq4oYnsuYZIrzZDNVY0HJNwziCiLr AIyCcqK39cM/wDfkqN7wt/sQWX1dzyRPD/MKVmDgSJn+2+3xAkwVc+6/se5xS7x+4gmiXS E6dU25VovEUqVp2dCx8+RXElpssnQNUT0U1JZz5ATmsKguETlI8YC6kL+Uc3a9XVF4Ru4L XPSQ7MnbFM8DmlvUkFVf6AN87Iecv4hq3TE4phhHBT5BnhM3aE9Pq3Kjp0JTleL7c8XgRe EUUd35p1o98AHfUbWn6dvzxf0nNQBuoVcknQTUYnPkeAEuWvUPvDw7fxzaGwlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684971887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=24PN8TPOaT/qnaEdZiarofnhyGUBkbF/M8emDZWGqTk=; b=gg8Lo9sFE5Qc0i1vq+8wkR+LKjf7th8TGqvkN2tOd4icPZ03GXoSkzKr8kBDUpn9hNLlvv aB1D8u+EGgDHQMlg6oKNyat+CWnjEZ7SSfdYnLSpMYr5hRRxLGaCczPC0YzQcLV4Bi6zzN 88F9gqRuaTJIgYFL8K6Tc12yTryPoSuyjq5mbqpTlyV0alvEj4/RxDGrMKk82xZNptc8h9 Ww6p5nJQV4t1FdXBAURifNbgxBVORlj3XJYn8QXUNzB2nXiGVPY5TDA3qfpKPOwdLyfCME hI1fF8z0L/3vaqIFZOUOtP6COC28PxSnlU0mn52FboQjNin7zwoH3mQc0iaGZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684971887; a=rsa-sha256; cv=none; b=JADkozDWgibHpB5Ha8cKMmNan6m886e27RXy+i1m9+/i0JJjy3s92JBJYv0rLjyb+C2QyN wFNhRwVB5p7iGIQTTEhhnD+K0D1cuFTqCmf2cDaz8RUwwdkZ2N3bzJ+8FM/Rf80yOxB0GM eL/R7PlPiGH8xitJG/WySuTF+DDGgoM9zHauDBSVEHEN/+fx6ro51cFef/m+5nwNMKpNOU 2XV3hAb3Z4AiguSV8iuzQUPmdWOWRG37nq65qqU0QA+ASPZuMjcXjctRyT9RWVukV3yzIW fwiceJqY0syuvcVA0N7BrxA60pEQihhhGGvMBRV3FJry+r1HZbEgYmPipst3XA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRSTW42mcz12g1; Wed, 24 May 2023 23:44: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 34ONilpJ010717; Wed, 24 May 2023 23:44:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34ONilgB010716; Wed, 24 May 2023 23:44:47 GMT (envelope-from git) Date: Wed, 24 May 2023 23:44:47 GMT Message-Id: <202305242344.34ONilgB010716@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: baef3a5b585f - main - tcpdump: specify OpenSSL 1.1 APIs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: baef3a5b585f462d9256f3b5a771ab5508ef6fd2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=baef3a5b585f462d9256f3b5a771ab5508ef6fd2 commit baef3a5b585f462d9256f3b5a771ab5508ef6fd2 Author: Pierre Pronchery AuthorDate: 2023-05-09 13:04:45 +0000 Commit: Ed Maste CommitDate: 2023-05-24 23:44:24 +0000 tcpdump: specify OpenSSL 1.1 APIs OPENSSL_API_COMPAT can be used to specify the OpenSSL API version in use for the purpose of hiding deprecated interfaces and enabling the appropriate deprecation notices. This change is a NFC while we're still using OpenSSL 1.1.1 but will avoid deprecation warnings upon the switch to OpenSSL 3.0. A future update should migrate to use the OpenSSL 3.0 APIs. PR: 271615 Reviewed by: emaste Event: Kitchener-Waterloo Hackathon 202305 Sponsored by: The FreeBSD Foundation --- usr.sbin/tcpdump/tcpdump/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/tcpdump/tcpdump/Makefile b/usr.sbin/tcpdump/tcpdump/Makefile index 1133a0a150d5..35f0df0e0f47 100644 --- a/usr.sbin/tcpdump/tcpdump/Makefile +++ b/usr.sbin/tcpdump/tcpdump/Makefile @@ -196,6 +196,7 @@ CFLAGS+=-DHAVE_CASPER LIBADD+= crypto CFLAGS+= -I${SYSROOT:U${DESTDIR}}/usr/include/openssl CFLAGS+= -DHAVE_LIBCRYPTO -DHAVE_OPENSSL_EVP_H +CFLAGS+= -DOPENSSL_API_COMPAT=0x10100000L .endif .if ${MK_PF} != "no" From nobody Thu May 25 02:17:04 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRWsF1FdPz4CTmL; Thu, 25 May 2023 02:17: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 4QRWsF0brRz3y1G; Thu, 25 May 2023 02:17:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684981025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E5SAzHuA76sQDD8bG3buYLr8ArGAInJfRPDAuLzRB0U=; b=liUCqZW72iK91ze2zxhWCXjysb4xVGWU8dmN1jy+3/lf69Vz4H86QRR1ylXpEbZxbY2ZtE tFlrIWoYUS84LfFwE6EpWMMw9n0WG6uzqPfUXc99T3D21ja/6QdWg67TYYlfnfKqkASWsa WUEiSCxviREKIQCqVNwuG5DWv94A82k8lCa8zNakhqIkfZG/iwtXI7K73rtMpU28Ry4v9l ZU8G1s1Sz8xFbyAuh7BzcGEIr2CQAbzitXZvaglrfvivb6e3hVYGnUL/Y3Edq58fVBPdHk BddLp6SDxp0joUcHYpG15UCMkqF2Wj1ngconbCPG6F7iG0jS/Ky264NlzJKhBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684981025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E5SAzHuA76sQDD8bG3buYLr8ArGAInJfRPDAuLzRB0U=; b=jwSbsO+4YsZOvAiJRpO2tHnmv7S1wXuYhrC1lVJkSpCmvecIrjSz/hDcu2EsbPQezqhJxB qvHMeaT6oWemC7QFRrKMSFKIhYskFcbPxmiTq5ZiucjEbPDTv0/Y/WteCcp2sR9ai62h9c P1l3Nu/qAYaRVp/spW4b8+QZV8R9SltNaU3ZGISl+Wzc2J5hFCzJauZ3VLaQufUGJlIYh8 9Gv/79QaAVdbvh71BdPdj3mnXjvtQpEM0iTeTTYVSynWqYnTVAScQ631Y1TOs4p03O/bk4 yf0dwp7L4RhtvxOOH6wOZV05R0geaViotem2k81nE7BFwNieFvDnsKK7dS9rhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684981025; a=rsa-sha256; cv=none; b=frLbiOKjiEzhFZRrAIZEF/jKzW+jrBTVy8d8iCaZNp0n+IizSdqmxLgbeGcZHpLTFPV577 +QSCrRBfRrVruRulsUCRK5nrJMgH3j5a7yJU9wIurgcIhBqq086axBIu79f0epxNk3qibr 8onD+Y1iKdT40P4vp9kaJ2L4BW/H1Q0hKf/0gsWZ8/xnuVAgGYS//+zzTzb530xF8lgKnj g6D7xcl5F10fTftDrguPPBEURoTCYxcX+7JRFiPxHJeUOxJjK6LMiw07IiGv3p4p2Sileh GAzXz5kX2qQ/H2JcJsVgjyrzmm27OkIlvRj2RvEUh1PLkoDL7xHIqJvewc85xg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRWsD6n2xz162H; Thu, 25 May 2023 02:17: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 34P2H4mN058057; Thu, 25 May 2023 02:17:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34P2H4SO058056; Thu, 25 May 2023 02:17:04 GMT (envelope-from git) Date: Thu, 25 May 2023 02:17:04 GMT Message-Id: <202305250217.34P2H4SO058056@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: b238d51d0adc - main - ldns: specify OpenSSL 1.1 APIs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b238d51d0adc43e2bab347e5ef13c323c1857c5e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b238d51d0adc43e2bab347e5ef13c323c1857c5e commit b238d51d0adc43e2bab347e5ef13c323c1857c5e Author: Pierre Pronchery AuthorDate: 2023-05-13 02:38:18 +0000 Commit: Ed Maste CommitDate: 2023-05-25 02:16:48 +0000 ldns: specify OpenSSL 1.1 APIs OPENSSL_API_COMPAT can be used to specify the OpenSSL API version in use for the purpose of hiding deprecated interfaces and enabling the appropriate deprecation notices. This change is a NFC while we're still using OpenSSL 1.1.1 but will avoid deprecation warnings upon the switch to OpenSSL 3.0. A future ldns update should migrate to use the OpenSSL 3.0 APIs. This is a recommit of c6750ddec917 after the ldns update in 5afab0e5e56f. PR: 271615 Event: Kitchener-Waterloo Hackathon 202305 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40082 --- lib/libldns/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libldns/Makefile b/lib/libldns/Makefile index 5764089e60a1..7714db950f00 100644 --- a/lib/libldns/Makefile +++ b/lib/libldns/Makefile @@ -10,6 +10,7 @@ LIB= ldns PRIVATELIB= true CFLAGS+= -I${LDNSDIR} +CFLAGS+= -DOPENSSL_API_COMPAT=0x10100000L SRCS= buffer.c dane.c dname.c dnssec.c dnssec_sign.c dnssec_verify.c \ dnssec_zone.c duration.c edns.c error.c higher.c host2str.c \ From nobody Thu May 25 03:09:08 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRY1K1Xr6z4CWrs; Thu, 25 May 2023 03:09: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 4QRY1K0mtBz42wg; Thu, 25 May 2023 03:09:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684984149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4Uq093qy7F8Epa8oRyph8iNE6deZbiDZx4UNq5mHJJc=; b=WucASQM/67iUjlBfKmJULs4a+S0mL2NsVdBCT16yrrzH18HjeNAbGnMHOledZcoSrDJGlX qckUh4KcUXsef1Pss0Sy8DPNJfUhgHmmwoLPYL6l+WZfTjezF1+72BtjdxbtY/XKf7Q54K GSTR0+fIvb/TkVW6Pf+grejJIHSk41oO1dTU4w1lhYfmXn/KntIpvxhIP365gLxFiAWAUt thtvD90kVyv3+CAGN5ro7144i7v8g6cB3VMl5GLKQfRcQov5geVTX7uRW5wczbFvfUAmtK Y18uuF26VLiMsXVxMfpolfL0CXpNPMSXtMmcHbZhW7xdqY+Ikoh5MvfMRLsHgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684984149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4Uq093qy7F8Epa8oRyph8iNE6deZbiDZx4UNq5mHJJc=; b=SVLbK9tU9jB/35P5teBii4fE1BjQR8gJBiIk0xlAe4yNfOyEcFFMV5PLhQMvWiOftx6FGi YBD6DHjDiKbYnRQ2uTMrY8wXCWs4Ce7rtHNRIju/2PiM4r6pBrVpgobevmoT8ZC4wbzK0p nwsAQbv5NzW9GNwpDv6B++027NJY7yOegH3/xcSvHaANsh8VfKAPpekL2TFTo/rXk2iFdP F3afQQP4QBklvFocT8MHdfZM5uvfjCbzKUVdnjK/kjDPCA6zO4KvjWBvXqgTU3M/iojohP 8SVuxXfDLAWIDMeBLLywpC3fte+iTttlqB1b91BYhCwbP/pDLJm/wGCWxIl/fg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684984149; a=rsa-sha256; cv=none; b=gbj1TaqSmd5dKFR40mKlHZd/TtvUFWrv5ZUI+85d19y4x8UeGr9pjgp3hNn+Aa5Po9mXDV ZLOfumj15Z11c459/iEBmiYGGSIpQAgTQd9FO0el5ug24CnPcjqfaX68d+O09u+c/XxuTz 5Y0wdH6C9DtyYETQTTM31kGXjmnrXLLyqATElXZJIjOZ1LsHMomT17BRYTERsXLbylUBhw /ugdEXUVA8dflSfDmnpDwudgeLw6UQV2aaVjd7H+c6VeuOPc9ezPReVF0UzioI7QIGi7De ZDasaVgC1cMaD4bmdjQTl6+U/E0AemWEIUd9FLAPTKD9aBZbZEqxMsEOZJO75Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRY1J6yYXz17VH; Thu, 25 May 2023 03:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34P3982T042630; Thu, 25 May 2023 03:09:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34P398H8042629; Thu, 25 May 2023 03:09:08 GMT (envelope-from git) Date: Thu, 25 May 2023 03:09:08 GMT Message-Id: <202305250309.34P398H8042629@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: 8955236a1013 - main - bectl.8: update /home List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8955236a10137a1b645e642baf4eaca9c6460547 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=8955236a10137a1b645e642baf4eaca9c6460547 commit 8955236a10137a1b645e642baf4eaca9c6460547 Author: Mike Karels AuthorDate: 2023-05-25 03:08:39 +0000 Commit: Mike Karels CommitDate: 2023-05-25 03:08:39 +0000 bectl.8: update /home The default location for home directories is moving from /usr/home to /home, including the default zfs datasets. Update accordingly. Add zroot/usr/src as replacement example of nested datasets. While here, mark zroot/var as "canmount off" as per current setup. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D40206 --- sbin/bectl/bectl.8 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sbin/bectl/bectl.8 b/sbin/bectl/bectl.8 index a989ffd8bba0..61efabb98df4 100644 --- a/sbin/bectl/bectl.8 +++ b/sbin/bectl/bectl.8 @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 26, 2023 +.Dd May 24, 2023 .Dt BECTL 8 .Os .Sh NAME @@ -404,9 +404,10 @@ NAME CANMOUNT MOUNTPOINT zroot zroot/ROOT noauto none zroot/ROOT/default noauto none +zroot/home on /home zroot/usr off /usr -zroot/usr/home on /usr/home -zroot/var on /var +zroot/usr/src on /usr/src +zroot/var off /var .Ed .Pp In that example, @@ -418,9 +419,9 @@ set to thus files in .Pa /usr typically fall into the boot environment because this dataset is not mounted. -.Pa zroot/usr/home +.Pa zroot/usr/src is mounted, thus files in -.Pa /usr/home +.Pa /usr/src are not in the boot environment. .Pp The other style of boot environments in use, frequently called From nobody Thu May 25 04:34:01 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRZvF63RMz4Cd0b; Thu, 25 May 2023 04:34: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 4QRZvF5cBZz48l3; Thu, 25 May 2023 04:34:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684989241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qua91DN7n8a6nxtqvFA8fvlWgOUU2wpHlBf/97sFNhg=; b=e5n9WJcpysCWID3j5F3QIkcB3Hutxf7cW88JsJ5bMxav9JYJ2oww8i1EMhGldBbe+OzUGx KBTbJebpO2p3srp75i67s2H6D11nXMqrdWnbZrQkHIXr3HiPX7madwpH+8jS7beWNGykyS EYN1Qnm6XpZviLwKA4ohMO0SRMGyPwgcMzd8C1du7eTxPHK9S0L2yWOiF4TYqvOmtYHa1v 7uy7nOQAGOzCCRi0l7W5aNCI5AvAWEpC+PqqinAjoLerygHhiS0IKAMcvhmMezaEvabV8Q hjizHCOLEWPXOMDpdEoPlHvNAfOOpM13qvPcgS01oEsitqrZUrXpwqVB/Pmtcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684989241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qua91DN7n8a6nxtqvFA8fvlWgOUU2wpHlBf/97sFNhg=; b=SRxJY/RYLOFqrgWwaB3OwdRrybT5qWZhWPXHqlC8kyt9li2YKV2BQRboVA1B9VI8IDInxD BSnzmS8hBX4I5/++8DSJCFWn25wmRYQ59ngwXbkDabU5jMoVNzbH6BZnOwrInbFHOmWnKc Iu+USYY8S/qUPy5+pYk6NivcEADJJIP7KKp+H5oavYjTc3zJJ2S8KzVFM/QB3qx1cPW7nD vkmFq8kb176DYNYxl2MKTYsaxcRFLCMqTrZxixip2Hxdajf3HduvDtuI6ebIi2kbn9ceY3 DQV/51oen7gxYvoEXatrln8cLbTGwUxwfZlwy1DWeVTtSxYajsuwyb+tvkMoxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684989241; a=rsa-sha256; cv=none; b=k+Q/9Fo/sBGq52/aceUe7J9jhHg9xuJbfgMOBRae4gRWpTI2YjRIveuZjn0hp+0a/5B9H0 JTwWQFvLmZHln8cskCj5qmIOluwvbTQhwSV/7OC0ykjEKRi2vKXKf6SYnUISk27Sfb1T0t pDjPfW1lXxgPeNMPe1TB+/FQhJSNSD23lDOFPqkxQu3BCIPMLGryLrlnQFTR+f6+t0FvRY 88TgmK5ubr1hvut6NS55VRceFY+AjlZJaT9Ldyu6sE7ZVklB0OwtHXMZvAhAWa3Ic52jXM WHmOkhI194sQZvl7fQYC5hP6tpI5vZDpbNUOsaJtRWcWI3XaAwLsvItYBQp6OA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRZvF4htsz19Ln; Thu, 25 May 2023 04:34: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 34P4Y1gi089260; Thu, 25 May 2023 04:34:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34P4Y1bB089259; Thu, 25 May 2023 04:34:01 GMT (envelope-from git) Date: Thu, 25 May 2023 04:34:01 GMT Message-Id: <202305250434.34P4Y1bB089259@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 2efbc8e2840f - main - stand/efi/smbios: Move detection of smbios earlier. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2efbc8e2840f6c0b8255a46527f2cdb32ace1bd1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2efbc8e2840f6c0b8255a46527f2cdb32ace1bd1 commit 2efbc8e2840f6c0b8255a46527f2cdb32ace1bd1 Author: Warner Losh AuthorDate: 2023-05-24 22:34:21 +0000 Commit: Warner Losh CommitDate: 2023-05-25 04:33:53 +0000 stand/efi/smbios: Move detection of smbios earlier. It would be nice to make decisions early in boot, about maybe consoles, based on smbios variables. Set them just after we setup the archsw so we can use them everywhere. Sponsored by: Netflix Reviewed by: tsoome, kevans Differential Revision: https://reviews.freebsd.org/D40219 --- stand/efi/loader/main.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index e5f9b40ae55f..8419331f7a19 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -930,6 +930,22 @@ main(int argc, CHAR16 *argv[]) archsw.arch_readin = efi_readin; archsw.arch_zfs_probe = efi_zfs_probe; +#if !defined(__arm__) + for (k = 0; k < ST->NumberOfTableEntries; k++) { + guid = &ST->ConfigurationTable[k].VendorGuid; + if (!memcmp(guid, &smbios, sizeof(EFI_GUID)) || + !memcmp(guid, &smbios3, sizeof(EFI_GUID))) { + char buf[40]; + + snprintf(buf, sizeof(buf), "%p", + ST->ConfigurationTable[k].VendorTable); + setenv("hint.smbios.0.mem", buf, 1); + smbios_detect(ST->ConfigurationTable[k].VendorTable); + break; + } + } +#endif + /* Get our loaded image protocol interface structure. */ (void) OpenProtocolByHandle(IH, &imgid, (void **)&boot_img); @@ -1181,22 +1197,6 @@ main(int argc, CHAR16 *argv[]) autoload_font(false); /* Set up the font list for console. */ efi_init_environment(); -#if !defined(__arm__) - for (k = 0; k < ST->NumberOfTableEntries; k++) { - guid = &ST->ConfigurationTable[k].VendorGuid; - if (!memcmp(guid, &smbios, sizeof(EFI_GUID)) || - !memcmp(guid, &smbios3, sizeof(EFI_GUID))) { - char buf[40]; - - snprintf(buf, sizeof(buf), "%p", - ST->ConfigurationTable[k].VendorTable); - setenv("hint.smbios.0.mem", buf, 1); - smbios_detect(ST->ConfigurationTable[k].VendorTable); - break; - } - } -#endif - interact(); /* doesn't return */ return (EFI_SUCCESS); /* keep compiler happy */ From nobody Thu May 25 04:34:02 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRZvH0LjDz4CclV; Thu, 25 May 2023 04:34:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QRZvG6nZRz49LH; Thu, 25 May 2023 04:34:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684989243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SG/ZIMfYKZP8gM5cKvdMN4GA3CIHEiF581qCibJ4yQo=; b=kjA7Fjv1Xhf484sfgR9j/e0sezDf2y/n8rcAbS03GMJk7PcjG3owMv8a9FYpJOVfWJFmwV 8Xe5j04wlS4K3wfQTvmSxbaFzW9BulHeTQpiHFS91035zQnasAYvw5PEGkC8/M208WJGEn xcWlkgYRKy7MsSX3kzR4GpZZL9qddj8WwLvh/rz01aJZtNhsccZ/tj9srcee5E5yKn4PSY AHcCVkNYj/Kz1JpvTNWuUkOQHsUNy5+HAIdVL6Gv2fCSEEMM3Q1yViPm3m9VnTv6Ytj+WP J6un93dhYmxegnkiO5Lj4fb3lm1BBgVA/6E+1lu4vlNlhCghhj+ZhPkvkkcV0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684989242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SG/ZIMfYKZP8gM5cKvdMN4GA3CIHEiF581qCibJ4yQo=; b=oo6Sx0n9x0g6ZIreznd1M3O9at191MEa5GhfJBXSszXUoLcawPx3NvyAGx42NGw/Jf4Nv0 Fub4a+eJOlWvGJcDaBQzgxA/DH9VtCJIE/1wBM4OnXEgU7JfGVG1D2svQXLNlFmo/hM6t3 6Av1d0GT+oUh+ITvY6vfaUkvvaY9XzMnJorg90yibQoiJT0OHHzGSSWRHhvcnAFuiK3zQr Xqi3RoQH3hl/8ln6KFMM37jZ/epktAXcOP0PPSLc1Zm/iVp/dhg2ECGI/aZ5AifxVXZG0L FnhRSKo4ugQZDNyeI/H4AlBWDkhDWzz1Ul4Bec9K08B7m9U0Tc8n9vAyV4+OfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684989243; a=rsa-sha256; cv=none; b=J0eZJ4Anz8jO8Fx0w4LK6MvNShojpHtE2Vfb1TQiO3JQtZbALDctv28VtCk8Oyg+29lMEz DX+alFza+OS+rCkWIYR+wY8a9wbRE4RbS7wlwTakln5aA+HgYPMjVJb8iWg/RkHOfb8ivs 55SZ8LsQlH3B8IzbN1uqHh0TcVI5Yp8NBu6h73Q8sD3Ripp1HfBsJucLtABvpqTBuYxGid ErAHMcluvmeALOL0dconGFfI1eOAG9/aC+Vn6N2qTenX6TLmu6b7d+js2r3ytsEg3eYx22 J11tBae8TvpEjX51X4fBwvQZskgb6ZliKtyPJuVmSaZ+LvNXDvSOy7EPbmf5ow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRZvG5NWPz19X7; Thu, 25 May 2023 04:34:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34P4Y22j089279; Thu, 25 May 2023 04:34:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34P4Y2On089278; Thu, 25 May 2023 04:34:02 GMT (envelope-from git) Date: Thu, 25 May 2023 04:34:02 GMT Message-Id: <202305250434.34P4Y2On089278@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: f28dff43ad62 - main - stand/efi/eficom: better handling of absent device List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f28dff43ad62ee7396abde1f8449ead1ece98053 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f28dff43ad62ee7396abde1f8449ead1ece98053 commit f28dff43ad62ee7396abde1f8449ead1ece98053 Author: Warner Losh AuthorDate: 2023-05-24 22:34:31 +0000 Commit: Warner Losh CommitDate: 2023-05-25 04:33:53 +0000 stand/efi/eficom: better handling of absent device Don't even have a comc_port when the port doesn't exist: always free it if we probe that it's not there. Also, when it's not present, clear the flags indicating presence to avoid disturbing other flags. Sponsored by: Netflix Reviewed by: tsoome, kevans Differential Revision: https://reviews.freebsd.org/D40220 --- stand/efi/libefi/eficom.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/stand/efi/libefi/eficom.c b/stand/efi/libefi/eficom.c index b1c84399a05d..ca08458c2ca2 100644 --- a/stand/efi/libefi/eficom.c +++ b/stand/efi/libefi/eficom.c @@ -332,9 +332,12 @@ comc_probe(struct console *sc) env_setenv("efi_com_speed", EV_VOLATILE, value, comc_speed_set, env_nounset); - eficom.c_flags = 0; if (comc_setup()) { sc->c_flags = C_PRESENTIN | C_PRESENTOUT; + } else { + sc->c_flags &= ~(C_PRESENTIN | C_PRESENTOUT); + free(comc_port); + comc_port = NULL; } } @@ -349,14 +352,20 @@ comc_probe_compat(struct console *sc) } #endif +/* + * Called when the console is selected in cons_change. If we didn't detect the + * device, comc_port will be NULL, and comc_setup will fail. It may be called + * even when the device isn't present as a 'fallback' console or when listed + * specifically in console env, so we have to reset the c_flags in those case to + * say it's not present. + */ static int comc_init(int arg __unused) { - if (comc_setup()) return (CMD_OK); - eficom.c_flags = 0; + eficom.c_flags &= ~(C_ACTIVEIN | C_ACTIVEOUT); return (CMD_ERROR); } @@ -516,8 +525,10 @@ comc_setup(void) EFI_STATUS status; char *ev; - /* port is not usable */ - if (comc_port->sio == NULL) + /* + * If the device isn't active, or there's no port present. + */ + if ((eficom.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) == 0 || comc_port == NULL) return (false); if (comc_port->sio->Reset != NULL) { From nobody Thu May 25 04:34:03 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRZvJ0J1gz4CcxR; Thu, 25 May 2023 04:34: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 4QRZvH6rsFz49QZ; Thu, 25 May 2023 04:34:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684989244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jufPJ6kD1xWBijmeyfwKivTD6XeKuq/qeQbjYmGuDWI=; b=Odp1ApHZojEH3V/vPDb47mEoNzsN7gOQmQvf8s1mz1nNVYKIQjdWFWo+/sDAUFlB5tX+jk U0YcXrnYPNtZVyQzSPeWXQW6n1M5hI6a29OWyV90J9KQoE2bHwZ8GnycfjbeTHOBAYnN1d 0mNh1RwLkJvaabQdZwoPDgEOUqd6vE7P8YXh4Ou9UhXHG3M3VSCH74YJ8Wo80ECrKFG32H Jdvfyu5STWF8a+BjttdtGbw+zqUW7ZK6N0wcEhC8ngOWYfvnmaDZD22OvMBqCSzL0UIvk7 dN7eWuop4xsSjpQHR82e5Dnuadchxe7IlJ6RAbx/hO0kZ9Xyj7C+98iuYjL6dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684989244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jufPJ6kD1xWBijmeyfwKivTD6XeKuq/qeQbjYmGuDWI=; b=nFR9AubW56ykG97esIu4MxUZWyG0z/39mMkcaYcVsEZrzZBQXu8hXtR0N8gp3LEGd+5x9v pF8CovpHNrZ6gLRmVfQaL1Mha7HcTzDijKOMgwyuFc3pr5nxBkmXxQGi8GSRmi81gzkqwg EzCuLVgx6mbslQkUwG9u9SkwR/dDRnVCxNVakeUg2ddDfPnTrvHp37RguKrku2CeUV1JFy vG/jNyQ3T3tWFLPlLUawqynh1NW+gkN2KrI6qPOJwH+02bDMq+juQuTxKkq7z/VAjnUmcR HXEhNNwPWmnLgJz0cPHKnpGsfkFh1rAcYJxSoJJRcM7R3EPX9SoLSHsK+z+Z1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684989244; a=rsa-sha256; cv=none; b=fXOBpMU9qnFSuK6zdJbJZNjZWCoeWeYVd6SLEAuviTWL/n+vayYUfULTftLVHtbFnBJKlU ce0vkr7IkEEEHbje9u54pGo7Ia6cqpNW8i0sOq0k2gEGGp9qMr4d5uCP/kY37xOIJPpsRY a2pYbth+7O9MHJZZnotPoucvc/7WesL9G7Qse2hOyCtjFlpKUx2i1CQxFMkRNhMRUg75uB x/9B7aW4iAtddYltSQQx8E/1r4ntSGYRd/fJlHGe1VywOYfCa9BhBdAafsr3Whmw53sxXf Mc/idvg6J8JGprRCGrZrXSyxrs/03XqhRl++is7BH1aFzpFD0DlhP27xg9ppqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRZvH5xpyz19X8; Thu, 25 May 2023 04:34: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 34P4Y38U089302; Thu, 25 May 2023 04:34:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34P4Y3N5089301; Thu, 25 May 2023 04:34:03 GMT (envelope-from git) Date: Thu, 25 May 2023 04:34:03 GMT Message-Id: <202305250434.34P4Y3N5089301@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 42b0b7a926e3 - main - stand/efi/eficom: Don't allow this for !HYPERV machines List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 42b0b7a926e3e4834dda923a0751f312e008ad92 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=42b0b7a926e3e4834dda923a0751f312e008ad92 commit 42b0b7a926e3e4834dda923a0751f312e008ad92 Author: Warner Losh AuthorDate: 2023-05-24 22:34:37 +0000 Commit: Warner Losh CommitDate: 2023-05-25 04:33:53 +0000 stand/efi/eficom: Don't allow this for !HYPERV machines If the machine isn't hyperv on amd64, then this driver fails the probe and will do nothing further now, even if explicitly listed in a config. Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D40221 --- stand/efi/libefi/eficom.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/stand/efi/libefi/eficom.c b/stand/efi/libefi/eficom.c index ca08458c2ca2..586202efee00 100644 --- a/stand/efi/libefi/eficom.c +++ b/stand/efi/libefi/eficom.c @@ -254,6 +254,11 @@ comc_get_con_serial_handle(const char *name) return (NULL); } +/* + * Called from cons_probe() to see if this device is available. + * Return immediately on x86, except for hyperv, since it interferes with + * common configurations otherwise (yes, this is just firewalling the bug). + */ static void comc_probe(struct console *sc) { @@ -265,6 +270,18 @@ comc_probe(struct console *sc) char *env, *buf, *ep; size_t sz; +#ifdef __amd64__ + /* + * This driver tickles issues on a number of different firmware loads. + * It is only required for HyperV, and is only known to work on HyperV, + * so only allow it on HyperV. + */ + env = getenv("smbios.bios.version"); + if (env == NULL || strncmp(env, "Hyper-V", 7) != 0) { + return; + } +#endif + if (comc_port == NULL) { comc_port = calloc(1, sizeof (struct serial)); if (comc_port == NULL) From nobody Thu May 25 04:34:04 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRZvK17rfz4Cd0m; Thu, 25 May 2023 04:34: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 4QRZvK0d3jz49Tk; Thu, 25 May 2023 04:34:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684989245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WXzVFN/a1lNkD7pxrfCjCW5VkZGKNNraSM5Na6jxqFE=; b=liCH0XVXtnl8l/urozmg7eAjLevK0F5nW4bCTBUc3O4TzkQ/fusR0P4rFZ009WooHWepYQ y6+sXXYpWPsIk+YLXYAzGPfmndHy8DiN7vdzFijOLID0VgbhEyr4X0w8+F07Gxl7UxltSE rxu7ekVPcAeZle/G07tbJLqlfVW+Tph4ZYuSs2YLqyO6P4QO8tz0hqFIpPq9l64YCZRep8 tHAQbjSMLB1fwl4/rtxC4E6lpEAJTJ21ceB8W8wIdj8lMBc+U5dkZAhFkmilZHOzLUvYLm 0m3E8E/Y2zaEG8G0A9JGaN7oMLQcxI0yLhqj7SOxGLz6hV+lsmw6sXWKF7WwNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684989245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WXzVFN/a1lNkD7pxrfCjCW5VkZGKNNraSM5Na6jxqFE=; b=uqpPWm3vhjjLY0P8pocafv3CWyFPamU9OAXocLuo15mFo+XaXBBKJh6cINwS3MvJNR0ZVH mZBR3TWpJ+U6hydW76BVeYksH6jvbNzJO6uzgmogflWCWkgxTLKZ7VEZ+pCf2JOmVWwHGG mhxweYjd3ir19HaNN/3ehEsUo9ligCVSlMM7NNVWX+s2n4O5zBCIJwZJ/gAqIJZkAlzjhB mjNVm3jfGhANLAh0nUsyoihDdNI9bxhoJnnhfdYTHigJTpxsOyvWGS8n8KzHbokX63QHMY +Nfem3uwvBmXBmmJ79wVWpCEqvEE8s09qjf/1O25sh4af9ydc0af0TMFWO6crQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684989245; a=rsa-sha256; cv=none; b=xoWFcvMHWE4d2IC6uOn5kskDBhIT1XHVRMbMXYLVZlkEvshQoTDiDKSYpF8hNCocBQ0s+v bqnXb2v0EwxODWJM/iaeZ9FzDsCpfAPWpjZjq9dsA6ygt2FzuZMVCRVa+DfDpbbiLC73qr 9hluRuUJU+5AlTNqED/MfPs0Od8NdR0e0cRCbJbmxUxblTRgDGP4ke04w2IiNXqBg0AjFR NOnkMGAi3QAyiwMxj37Urb8XyJPzHQNtxPMth8zCAAQkRkuNrr1fleBtYCmqDmKeuZVH/1 LzbpolF5O1HrgVdJlULwf1/6uuTO1ucv/HwWY3T76nJ8m+RRvWB96tR1X2H+xg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRZvJ6qjbz19Lp; Thu, 25 May 2023 04:34: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 34P4Y4lH089326; Thu, 25 May 2023 04:34:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34P4Y4db089325; Thu, 25 May 2023 04:34:04 GMT (envelope-from git) Date: Thu, 25 May 2023 04:34:04 GMT Message-Id: <202305250434.34P4Y4db089325@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: e5d4e036f247 - main - stand/efi/eficom: Make aarch64 compat code probe correctly List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e5d4e036f2476927369615d4c29651dd2eb3b8a1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e5d4e036f2476927369615d4c29651dd2eb3b8a1 commit e5d4e036f2476927369615d4c29651dd2eb3b8a1 Author: Warner Losh AuthorDate: 2023-05-24 22:34:44 +0000 Commit: Warner Losh CommitDate: 2023-05-25 04:33:53 +0000 stand/efi/eficom: Make aarch64 compat code probe correctly Make the compat code more correct by probing using the eficom console structure, not the comconsole one. Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D40222 --- stand/efi/libefi/eficom.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/stand/efi/libefi/eficom.c b/stand/efi/libefi/eficom.c index 586202efee00..6ff8512dedd7 100644 --- a/stand/efi/libefi/eficom.c +++ b/stand/efi/libefi/eficom.c @@ -362,10 +362,13 @@ comc_probe(struct console *sc) static void comc_probe_compat(struct console *sc) { - comc_probe(sc); - if (sc->c_flags & (C_PRESENTIN | C_PRESENTOUT)) { + comc_probe(&eficom); + if (eficom.c_flags & (C_PRESENTIN | C_PRESENTOUT)) { printf("comconsole: comconsole device name is deprecated, switch to eficom\n"); } + /* + * Note: We leave the present bits unset in sc to avoid ghosting. + */ } #endif From nobody Thu May 25 04:34:06 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRZvL2dj4z4Ccdf; Thu, 25 May 2023 04:34:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QRZvL1v8Sz49fn; Thu, 25 May 2023 04:34:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684989246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QwBtSh2VzvryGL6PgubI/8dXnnfI9sw4eXdYw178chw=; b=k4n+6eR6uRRzrQSnxjT0j3rsrlSEOtl9DnVh0BApDBCqS3u1BdqoLfqmcIoNG3WRcxReUX sSsL06varrPnmaG4ldeRrgpRKfO7C2eMSHT+b6YNqK4CAWUJPUihekBpvPgrBOMRK9TMiO akM7U99tflG8sI5blrROoc24zqgPmUry+Bbznk7X57Jt2isssGn2wKf44uPuqD/Eads3XG aT4yDVFNoW9HziHN10FFcnbBM0Y9UnHrpCcIYHuY07euly5Zt4uTHQwjb/2Iz8uH1hGlvQ Hva+c1CncYDclOrFHyp6cGZORFLCZ0kq8rUiCRz172gNSdscGInBBvaGO9Wc7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684989246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QwBtSh2VzvryGL6PgubI/8dXnnfI9sw4eXdYw178chw=; b=GCZGodRSpu2mESCnhdfK2R3rVI9WOKt376kyWIA2fHRkJSB9m/A/I4D26kD9xrRUMyIsKz PpzrYt1IyB9ZBKU18dPAmytGgwXrAHKlegvz0NNnnY9AWxdvqKlHkuUVF2KjmWXL13phgN uDBd2k6Dj8CRlOeJaITRYVnsWoNf99XwzbbKs2A4n99pMsbBv+f7StkJegP4NhLmm0jJgz gyf8ebF8bioAbIqcf875yFSzuYyeYcLWuDZecPfq3ozNrLJni9Ef5xppETIYGECMW6wqry S1WEt0C0OLTHcQKHTueeL6xXcPvhNnnjna0UIVW4La64iq3dG3VH3J+c3F2QVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684989246; a=rsa-sha256; cv=none; b=VG6HngiY/Kzhud7wBUR6zy016S/5CtSyGMYSY9M7DGgLtabcPtVKJYPtYkez91vOBl7q9X 2CqTeCDgfJpnQvG32ERSXchB9IpxzwwvA2xZH1mC8lC//I0jUbWSdPnLE/51JrqLf2gcxz KLgHg2TjPw2QBNwP+qWAV7XJMgeMZqMK9Zsh6Wyiwj2Ylgr4Oixfn0KHN2cedRYWlUpRya YCcsIH1PCt7Ld+i5C2f/RyykCLrC+YvRhJdnd1m9QuVM92DLBuF4dntzlf5xDuYWQ4PYkY 84N7oPN+PEcjC5SyS66q0hiKVwuSEWZV8EG3WzAqhOyjLt8/FbrbkqOD8AKuig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRZvL0rRnz19ml; Thu, 25 May 2023 04:34: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 34P4Y6uR089345; Thu, 25 May 2023 04:34:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34P4Y6hU089344; Thu, 25 May 2023 04:34:06 GMT (envelope-from git) Date: Thu, 25 May 2023 04:34:06 GMT Message-Id: <202305250434.34P4Y6hU089344@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 46927f674466 - main - stand/efi/eficom: Free comc_port if we can't find the serial port List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 46927f674466965db76f8e3138bcc630cdd6ed11 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=46927f674466965db76f8e3138bcc630cdd6ed11 commit 46927f674466965db76f8e3138bcc630cdd6ed11 Author: Warner Losh AuthorDate: 2023-05-24 22:34:51 +0000 Commit: Warner Losh CommitDate: 2023-05-25 04:33:53 +0000 stand/efi/eficom: Free comc_port if we can't find the serial port If we can't find the serial port, free comc_port and return early. The serial port just isn't there. Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D40223 --- stand/efi/libefi/eficom.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/stand/efi/libefi/eficom.c b/stand/efi/libefi/eficom.c index 6ff8512dedd7..4c104114d445 100644 --- a/stand/efi/libefi/eficom.c +++ b/stand/efi/libefi/eficom.c @@ -329,6 +329,16 @@ comc_probe(struct console *sc) } } + /* + * If there's no sio, then the device isn't there, so just return since + * the present flags aren't yet set. + */ + if (comc_port->sio == NULL) { + free(comc_port); + comc_port = NULL; + return; + } + if (env != NULL) unsetenv("efi_com_port"); snprintf(value, sizeof (value), "%u", comc_port->ioaddr); From nobody Thu May 25 04:56:57 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRbPk4Dwvz4CfFt; Thu, 25 May 2023 04:56:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QRbPj389cz4GPr; Thu, 25 May 2023 04:56:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684990617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IFMpkfKHsitt/ysUinp6Bz12KnrMvpShIPYbS3MCO9E=; b=frh1q77BujhqFmQYJTmff37B810R8x6vHLXQHPHEv/DoU8QS9QO2OKRu/Jl874Sh8UsgZO hbPDD69dETR+wO6Cl+zMkRBW/gnCReGw7u328mOwmL6xQ46YpeQwCEH6U9tT5FGSNmJsF/ wQyEq0RasWBw2pjnMpvwdRgidyiZtB3MReABcA6n2VWBa7kL5HGgdh2uAFG9JVlKL+owsh 2TxWdqn34Q9v+1vhRgDFDBuryJPn2C0mEdVlel8hfY0LSwAWyH/YaysHg6yodQG5Xc904R K3fgxQKLX7XmVY8FcY680H+bsmfuKdDZ1btle/nixcxaA94/hnYDowiUg49byg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684990617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IFMpkfKHsitt/ysUinp6Bz12KnrMvpShIPYbS3MCO9E=; b=r1yMdF8lPEUrXy2Lo9XuQZsInjEevNvHO6o5XzmzhO032J2TRFuKOWEOBTsYxkLl5GO1+h UNNMtfCGdACXJ9xEa4LqyYxX6VXlBFRgU/ONacHwmIito2PFe0uEK0Uk4cHMSvKND17Jjt zlUdpZMSBiZI1AyZRML5V53JBggmvi6mQ+oXGjy9L+wUWfp1R3pozjQ1U4eGyb2EEDm3ie x5YCLF/Qz51j0KwccMzBRU66ltLP3ls7IeeYt6CrEPGZRHh/kc3W5YclQHlHgfoIzaHNx8 BVowjMeODCi/xHhVA/HehdGrOGZxbPv07CDc7/Zczomtgi9OxT+rHFwDn2t9Sw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684990617; a=rsa-sha256; cv=none; b=P9JiLmMD+qMGpxDlrSlbCTPQavCYXs1drGH+ySJdWrv0Vmjj03ieCSvMDCGWEJ8SpUdkLR 4/N4QGZxoD26nPolkLZQVp9xlyPMmT5OC8BdWU1pcKixNBx5Ezib2+1i/r/eZU03w77EcG Ke4eVIpTnGZgl9IKgVVvf1/eepOIvGh9guJEAPbdzy8hx7t8Bq9ibc8ww+gLbipFhsYZPD z5zldgOz+qRl02TDNKamJ0eP1uDoy0/pnB+AzfncI794QxsjeIejRumgTlkYujsN2CLCAE WIhoOwS5Mj1+BBcLfy9mRHUrbMbBhsAyzDacKUPhncaNNH+g78vqrtqwwPXQhw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRbPj2Fymz1BGG; Thu, 25 May 2023 04:56: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 34P4uv16022771; Thu, 25 May 2023 04:56:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34P4uvQl022770; Thu, 25 May 2023 04:56:57 GMT (envelope-from git) Date: Thu, 25 May 2023 04:56:57 GMT Message-Id: <202305250456.34P4uvQl022770@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Enji Cooper Subject: git: 9a49a3792940 - main - mptutil: document that disabled/enabled are also supported List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9a49a3792940497ddf4657f6e5be56d8ef881edc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=9a49a3792940497ddf4657f6e5be56d8ef881edc commit 9a49a3792940497ddf4657f6e5be56d8ef881edc Author: Enji Cooper AuthorDate: 2023-05-25 04:54:02 +0000 Commit: Enji Cooper CommitDate: 2023-05-25 04:56:42 +0000 mptutil: document that disabled/enabled are also supported This change officially documents the fact that the `volume cache enabled` and `volume cache disabled` are also supported. While here, remove an unnecessary newline at the end of a warn*(3) call. warn*(3) adds a newline automatically. MFC after: 1 week --- usr.sbin/mptutil/mpt_volume.c | 3 ++- usr.sbin/mptutil/mptutil.8 | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/usr.sbin/mptutil/mpt_volume.c b/usr.sbin/mptutil/mpt_volume.c index 04f69bcdf929..ddf6492a8592 100644 --- a/usr.sbin/mptutil/mpt_volume.c +++ b/usr.sbin/mptutil/mpt_volume.c @@ -219,7 +219,8 @@ volume_cache(int ac, char **av) *s1 = tolower(*s1); if ((strcmp(av[2], "enable")) && (strcmp(av[2], "enabled")) && (strcmp(av[2], "disable")) && (strcmp(av[2], "disabled"))) { - warnx("volume cache: invalid flag, must be 'enable' or 'disable'\n"); + warnx("volume cache: invalid flag; " + "must be 'enable', 'enabled', 'disable', or 'disabled'"); return (EINVAL); } diff --git a/usr.sbin/mptutil/mptutil.8 b/usr.sbin/mptutil/mptutil.8 index e8b617ffbcaf..2059bc994849 100644 --- a/usr.sbin/mptutil/mptutil.8 +++ b/usr.sbin/mptutil/mptutil.8 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 16, 2009 +.Dd May 24, 2024 .Dt MPTUTIL 8 .Os .Sh NAME @@ -71,7 +71,7 @@ .Nm .Op Fl u Ar unit .Cm volume cache Ar volume -.Ar enable|disable +.Ar enable|enabled|disable|disabled .Nm .Op Fl u Ar unit .Cm clear @@ -239,7 +239,7 @@ Sets the name of .Ar volume to .Ar name . -.It Cm volume cache Ar volume Ar enable|disable +.It Cm volume cache Ar volume Ar enable|enabled|disable|disabled Enables or disables the drive write cache for the member drives of .Ar volume . .It Cm volume status Ar volume From nobody Thu May 25 10:02:18 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRkB24vB3z4TJDv; Thu, 25 May 2023 10:02: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 4QRkB24SXQz3p3V; Thu, 25 May 2023 10:02:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685008938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zS03OBd5VNYoTKzqL2jgf73r42HNfu4YbdgDfsqf1+g=; b=usl9nreoWqpZyPK+/uW26wKSEriAxKYou8ajvisPQTyM9e9Vo/3jDslHIXBES65ZP/f8kl W2WsVnfKnF9q3eWSEHqOX8TkZ2toGjxL/UJ179H4LS4RNunl6QevcLouFKUCtrqq/DoPeS /GV31sXgRRi0TWU5fwbjKo91kdIsPbQ0jMTLR6LEr19WCN8CSjtbPinu2SZH7eC250GZaI XZQd1yUBftRKeEGUw4RcaHCRlYXj/IveVWFFVWo40RN6qF00voWvkFcIv6EYz9xhZzax7A h+wPNmCennZ1lY0XEzUFTkaFPOh2IHzocTnXUhnN1Bu4y124s7MivX6aT49Iqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685008938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zS03OBd5VNYoTKzqL2jgf73r42HNfu4YbdgDfsqf1+g=; b=yxZcuvyChHV2SQ6EEgF3ynEVL/RU9mz8KU0vGpM+UvKRDFo+Gvp+qvVCBF3WmZYP0kzN0G iBci+OTp2LEUup8MVN2SmN6rNyx6GXAgbgAdhKUsjoW2RgrHOtWBYuGq7ns5vwnkKjrV+S cCxxeUJECYCaLo7EZof7GM33k5r28V+ZSATjcG0VR51pe5eqPI9Ka0jfsU615JS6tNwu/C nuF/czuaqEPpzfmhxyZ1cL1+fsXx3ZC4/eocZNJfoHs//qz3d+BttsboA4tCIvsXg5HgSS R+LrYwzbVC2ZWsPDKujhxrub9dlDloHsILIiEkC9PzUnA8s3K2HWT2Ldtx/xDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685008938; a=rsa-sha256; cv=none; b=HQMxJlB3df5kB9hRKuwFGPl0h4w36hjvwUC79RW7IFVwxlyGdUgVCvOtS5aL11hzI1K8bl vniIomuCJn2BRKEvhGzkhwtrG4pUTgr0C0xSCYLDDXQ3DnaQxKDqgp3PrKndIJEcHTA78g yoKTqc8ib+9ayM6O0fU+nyhepEo5XAEfc2jjrhcKRJ4SigTadCMVE4ihhVsIQ2OGmKFK8k xgxIC1olPSl7LwFVPZVZhVuslttvqrqRn5JB82P51/Q5I145HPLayRSvuDiJ1Q5unapsYY bUuy+pvsEH/lAXQNGAOCQ8X9VdESRwQoPmzjtdAT/UOAoBPDS/tZdK/HEDV3Og== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRkB23WxlzL6S; Thu, 25 May 2023 10:02: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 34PA2IbZ035178; Thu, 25 May 2023 10:02:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PA2Ir8035177; Thu, 25 May 2023 10:02:18 GMT (envelope-from git) Date: Thu, 25 May 2023 10:02:18 GMT Message-Id: <202305251002.34PA2Ir8035177@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 8b709c88e56d - main - Add brackets around GICv3 redistributor macros List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b709c88e56dc7e035be6744572bd2978a704338 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=8b709c88e56dc7e035be6744572bd2978a704338 commit 8b709c88e56dc7e035be6744572bd2978a704338 Author: Andrew Turner AuthorDate: 2023-05-25 08:35:14 +0000 Commit: Andrew Turner CommitDate: 2023-05-25 08:50:34 +0000 Add brackets around GICv3 redistributor macros The GICv3 redistributor register access macros take arguments that are used as variables. Add brackets around them as is the style, and for safety. Sponsored by: Arm Ltd --- sys/arm64/arm64/gic_v3_var.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/gic_v3_var.h b/sys/arm64/arm64/gic_v3_var.h index 61c3ff0b61ae..9fa8b82e16bc 100644 --- a/sys/arm64/arm64/gic_v3_var.h +++ b/sys/arm64/arm64/gic_v3_var.h @@ -137,8 +137,8 @@ void gic_r_write_8(device_t, bus_size_t, uint64_t var); u_int cpu = PCPU_GET(cpuid); \ \ bus_read_##len( \ - &sc->gic_redists.pcpu[cpu]->res, \ - reg); \ + &(sc)->gic_redists.pcpu[cpu]->res, \ + (reg)); \ }) #define gic_r_write(sc, len, reg, val) \ @@ -146,8 +146,8 @@ void gic_r_write_8(device_t, bus_size_t, uint64_t var); u_int cpu = PCPU_GET(cpuid); \ \ bus_write_##len( \ - &sc->gic_redists.pcpu[cpu]->res, \ - reg, val); \ + &(sc)->gic_redists.pcpu[cpu]->res, \ + (reg), (val)); \ }) #endif /* _GIC_V3_VAR_H_ */ From nobody Thu May 25 12:22:38 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRnHy50NVz4TRDp; Thu, 25 May 2023 12:22:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QRnHy4jZqz40bl; Thu, 25 May 2023 12:22:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685017358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y290sSHZr976I6EjX4lRzVbjF5bxVQEaWScHJ294jL0=; b=gYzwYTqpS8pwawwE/XvfU9HmSQnVHVu8MBoLEEIvqCLsM+R07IthdF5KXhp7SBW4+xiGte A9cVrWUODxFAg6g6id1i1uxz4Sy8SUO2ZKJ6nX1q25bdgpKmPZzkjpRXkaBge8CdKrfira wQFku9NKnWRQGL6AeFISJfCWZHzfQEXqrGNdZVr+ZS/m9slUn5KqAi5uDi75n1HScXfZQN rPki87NxdsYUb8RqLpGKznTqqlQIF0Ot1eWY1WVHU1HHajy3NUUvGdO3zP+caRY77vy4q7 5t0QPArDvChr55QsJqK3WRtozZ56sfmHuDjvGlqLZQ72rZiRF8HfjgpnM1pE/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685017358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y290sSHZr976I6EjX4lRzVbjF5bxVQEaWScHJ294jL0=; b=ZfB0JyhX+6UGB6kKJSvwiz8gN6/AVSZEWdKVkp8C5W1p+g8YEyukqaZyfaGaNzb385xx/I qp4tsxcYSMlegpKIEeH/gr0DKV+28XuCwn/a16sES69A6I6nj5GQRIJaulptphcGgkYk0+ U5lt+4K6wUOUhY1bQElwch5ek80qNfhdvnEXD1kLiyBCzCAS5joPydg6YH9nXq6NFaIhK4 6Da6DnW3NtfjKMojYYJAsTtqblkTpoGlLH2EDgSPWd3mlqaT8tD3RJEVlJ32rcvzMfQqC+ Jw3TCwPyg9Fwp1WXzfJnMXsfAOJcs1IZAGAYHqTHZt0TEpNTgMm2P7i8h7dDIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685017358; a=rsa-sha256; cv=none; b=J/ef5t87q2X3lhy9Av66wZyWu7bpdGbQZalX3qThhzjH9Af5w8Tem5eFlFMGJY4in1BMc5 SHQuAUOquj97WWWyRc7U9KWL8oggixuxhXd/mxFiEXgZibq0WMH7U71GzZV6bDQRC1Lipk T+74rserW5/M80DCvknJXc9k2lpmWxaGW918aoIafjPjkMR6Rj/OxDxAiUzHBEIPJuA9jN y17i9bK61Fz1rbICD3h6v5MSvu4al6ID5edmsroGykVSYFNXvfmUj5L9DzpnIyh2EIT3cA VjWaeUJ9yc2lH034MOaiXrLNrUhKfsQjxe6DTvlfwew3CqT/KCFHGDXeUI++0A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRnHy3md3zPGj; Thu, 25 May 2023 12:22: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 34PCMcxI064859; Thu, 25 May 2023 12:22:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PCMcCw064858; Thu, 25 May 2023 12:22:38 GMT (envelope-from git) Date: Thu, 25 May 2023 12:22:38 GMT Message-Id: <202305251222.34PCMcCw064858@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 4bf44dd73bc0 - main - ifconfig: switch IPv4/IPv6 address manipulations to Netlink. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4bf44dd73bc0a68b73f7ee50d52adf5d7cda3eb8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=4bf44dd73bc0a68b73f7ee50d52adf5d7cda3eb8 commit 4bf44dd73bc0a68b73f7ee50d52adf5d7cda3eb8 Author: Alexander V. Chernikov AuthorDate: 2023-05-20 11:53:46 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-05-25 12:22:18 +0000 ifconfig: switch IPv4/IPv6 address manipulations to Netlink. Differential Revision: https://reviews.freebsd.org/D40182 --- sbin/ifconfig/af_inet.c | 262 ++++++++++++++++++++++++++++++++++++++- sbin/ifconfig/af_inet6.c | 152 ++++++++++++++++++++++- sbin/ifconfig/af_link.c | 3 + sbin/ifconfig/ifconfig.c | 125 +++++++++++++------ sbin/ifconfig/ifconfig.h | 21 +++- sbin/ifconfig/ifconfig_netlink.c | 45 ++++++- 6 files changed, 554 insertions(+), 54 deletions(-) diff --git a/sbin/ifconfig/af_inet.c b/sbin/ifconfig/af_inet.c index fdde3bd23595..73decb229d0f 100644 --- a/sbin/ifconfig/af_inet.c +++ b/sbin/ifconfig/af_inet.c @@ -55,8 +55,26 @@ static const char rcsid[] = #include "ifconfig.h" #include "ifconfig_netlink.h" +#ifdef WITHOUT_NETLINK static struct in_aliasreq in_addreq; static struct ifreq in_ridreq; +#else +struct in_px { + struct in_addr addr; + int plen; + bool addrset; + bool maskset; +}; +struct in_pdata { + struct in_px addr; + struct in_px dst_addr; + struct in_px brd_addr; + uint32_t flags; + uint32_t vhid; +}; +static struct in_pdata in_add, in_del; +#endif + static char addr_buf[NI_MAXHOST]; /*for getnameinfo()*/ extern char *f_inet, *f_addr; @@ -175,6 +193,8 @@ in_status_nl(if_ctx *ctx __unused, if_link_t *link, if_addr_t *ifa) } #endif + +#ifdef WITHOUT_NETLINK #define SIN(x) ((struct sockaddr_in *) &(x)) static struct sockaddr_in *sintab[] = { SIN(in_ridreq.ifr_addr), SIN(in_addreq.ifra_addr), @@ -226,14 +246,234 @@ in_getaddr(const char *s, int which) errx(1, "%s: bad value", s); } +#else + +static struct in_px *sintab_nl[] = { + &in_del.addr, /* RIDADDR */ + &in_add.addr, /* ADDR */ + NULL, /* MASK */ + &in_add.dst_addr, /* DSTADDR*/ + &in_add.brd_addr, /* BRDADDR*/ +}; + +static void +in_getip(const char *addr_str, struct in_addr *ip) +{ + struct hostent *hp; + struct netent *np; + + if (inet_aton(addr_str, ip)) + return; + if ((hp = gethostbyname(addr_str)) != NULL) + bcopy(hp->h_addr, (char *)ip, + MIN((size_t)hp->h_length, sizeof(ip))); + else if ((np = getnetbyname(addr_str)) != NULL) + *ip = inet_makeaddr(np->n_net, INADDR_ANY); + else + errx(1, "%s: bad value", addr_str); +} + +static void +in_getaddr(const char *s, int which) +{ + struct in_px *px = sintab_nl[which]; + + if (which == MASK) { + struct in_px *px_addr = sintab_nl[ADDR]; + struct in_addr mask = {}; + + in_getip(s, &mask); + px_addr->plen = __bitcount32(mask.s_addr); + px_addr->maskset = true; + return; + } + + if (which == ADDR) { + char *p = NULL; + + if((p = strrchr(s, '/')) != NULL) { + const char *errstr; + /* address is `name/masklen' */ + int masklen; + *p = '\0'; + if (!isdigit(*(p + 1))) + errstr = "invalid"; + else + masklen = (int)strtonum(p + 1, 0, 32, &errstr); + if (errstr != NULL) { + *p = '/'; + errx(1, "%s: bad value (width %s)", s, errstr); + } + px->plen = masklen; + px->maskset = true; + } + } + + in_getip(s, &px->addr); + px->addrset = true; +} + +/* + * Deletes the first found IPv4 interface address for the interface. + * + * This function provides SIOCDIFADDR semantics missing in Netlink. + * When no valid IPv4 address is specified (sin_family or sin_len is wrong) to + * the SIOCDIFADDR call, it deletes the first found IPv4 address on the interface. + * 'ifconfig IFNAME inet addr/prefix' relies on that behavior, as it + * executes empty SIOCDIFADDR before adding a new address. + */ +static int +in_delete_first_nl(if_ctx *ctx) +{ + struct nlmsghdr *hdr; + struct ifaddrmsg *ifahdr; + uint32_t nlmsg_seq; + struct in_addr addr; + struct snl_writer nw = {}; + struct snl_errmsg_data e = {}; + struct snl_state *ss = ctx->io_ss; + bool found = false; + + uint32_t ifindex = if_nametoindex_nl(ss, name); + if (ifindex == 0) { + /* No interface with the desired name, nothing to delete */ + return (EADDRNOTAVAIL); + } + + snl_init_writer(ss, &nw); + hdr = snl_create_msg_request(&nw, NL_RTM_GETADDR); + hdr->nlmsg_flags |= NLM_F_DUMP; + ifahdr = snl_reserve_msg_object(&nw, struct ifaddrmsg); + ifahdr->ifa_family = AF_INET; + ifahdr->ifa_index = ifindex; + + if (!snl_finalize_msg(&nw) || !snl_send_message(ss, hdr)) + return (EINVAL); + + nlmsg_seq = hdr->nlmsg_seq; + while ((hdr = snl_read_reply_multi(ss, nlmsg_seq, &e)) != NULL) { + struct snl_parsed_addr attrs = {}; + if (snl_parse_nlmsg(ss, hdr, &snl_rtm_addr_parser, &attrs)) { + addr = satosin(attrs.ifa_local)->sin_addr; + ifindex = attrs.ifa_index; + found = true; + break; + } else + return (EINVAL); + } + if (e.error != 0) { + if (e.error_str != NULL) + warnx("%s(): %s", __func__, e.error_str); + return (e.error); + } + + if (!found) + return (0); + + /* Try to delete the found address */ + snl_init_writer(ss, &nw); + hdr = snl_create_msg_request(&nw, NL_RTM_DELADDR); + ifahdr = snl_reserve_msg_object(&nw, struct ifaddrmsg); + ifahdr->ifa_family = AF_INET; + ifahdr->ifa_index = ifindex; + snl_add_msg_attr_ip4(&nw, IFA_LOCAL, &addr); + + if (!snl_finalize_msg(&nw) || !snl_send_message(ss, hdr)) + return (EINVAL); + memset(&e, 0, sizeof(e)); + snl_read_reply_code(ss, hdr->nlmsg_seq, &e); + if (e.error_str != NULL) + warnx("%s(): %s", __func__, e.error_str); + + return (e.error); +} + + +static int +in_exec_nl(if_ctx *ctx, unsigned long action, void *data) +{ + struct in_pdata *pdata = (struct in_pdata *)data; + struct snl_writer nw = {}; + + if (action == NL_RTM_DELADDR && !pdata->addr.addrset) + return (in_delete_first_nl(ctx)); + + snl_init_writer(ctx->io_ss, &nw); + struct nlmsghdr *hdr = snl_create_msg_request(&nw, action); + struct ifaddrmsg *ifahdr = snl_reserve_msg_object(&nw, struct ifaddrmsg); + + ifahdr->ifa_family = AF_INET; + ifahdr->ifa_prefixlen = pdata->addr.plen; + ifahdr->ifa_index = if_nametoindex_nl(ctx->io_ss, name); + + snl_add_msg_attr_ip4(&nw, IFA_LOCAL, &pdata->addr.addr); + if (action == NL_RTM_NEWADDR && pdata->dst_addr.addrset) + snl_add_msg_attr_ip4(&nw, IFA_ADDRESS, &pdata->dst_addr.addr); + if (action == NL_RTM_NEWADDR && pdata->brd_addr.addrset) + snl_add_msg_attr_ip4(&nw, IFA_BROADCAST, &pdata->brd_addr.addr); + + int off = snl_add_msg_attr_nested(&nw, IFA_FREEBSD); + snl_add_msg_attr_u32(&nw, IFAF_FLAGS, pdata->flags); + if (pdata->vhid != 0) + snl_add_msg_attr_u32(&nw, IFAF_VHID, pdata->vhid); + snl_end_attr_nested(&nw, off); + + if (!snl_finalize_msg(&nw) || !snl_send_message(ctx->io_ss, hdr)) + return (0); + + struct snl_errmsg_data e = {}; + snl_read_reply_code(ctx->io_ss, hdr->nlmsg_seq, &e); + if (e.error_str != NULL) + warnx("%s(): %s", __func__, e.error_str); + + return (e.error); +} + +static void +in_setdefaultmask_nl(void) +{ + struct in_px *px = sintab_nl[ADDR]; + + in_addr_t i = ntohl(px->addr.s_addr); + + /* + * If netmask isn't supplied, use historical default. + * This is deprecated for interfaces other than loopback + * or point-to-point; warn in other cases. In the future + * we should return an error rather than warning. + */ + if (IN_CLASSA(i)) + px->plen = IN_CLASSA_NSHIFT; + else if (IN_CLASSB(i)) + px->plen = IN_CLASSB_NSHIFT; + else + px->plen = IN_CLASSC_NSHIFT; + px->maskset = true; +} +#endif + +static void +warn_nomask(int ifflags) +{ + if ((ifflags & (IFF_POINTOPOINT | IFF_LOOPBACK)) == 0) { + warnx("WARNING: setting interface address without mask " + "is deprecated,\ndefault mask may not be correct."); + } +} + static void in_postproc(if_ctx *ctx __unused, int newaddr, int ifflags) { - if (sintab[ADDR]->sin_len != 0 && sintab[MASK]->sin_len == 0 && - newaddr && (ifflags & (IFF_POINTOPOINT | IFF_LOOPBACK)) == 0) { - warnx("WARNING: setting interface address without mask " - "is deprecated,\ndefault mask may not be correct."); +#ifdef WITHOUT_NETLINK + if (sintab[ADDR]->sin_len != 0 && sintab[MASK]->sin_len == 0 && newaddr) { + warn_nomask(ifflags); + } +#else + if (sintab_nl[ADDR]->addrset && !sintab_nl[ADDR]->maskset && newaddr) { + warn_nomask(ifflags); + in_setdefaultmask_nl(); } +#endif } static void @@ -281,10 +521,13 @@ in_set_tunnel(int s, struct addrinfo *srcres, struct addrinfo *dstres) static void in_set_vhid(int vhid) { +#ifdef WITHOUT_NETLINK in_addreq.ifra_vhid = vhid; +#else + in_add.vhid = (uint32_t)vhid; +#endif } - static struct afswtch af_inet = { .af_name = "inet", .af_af = AF_INET, @@ -298,10 +541,19 @@ static struct afswtch af_inet = { .af_status_tunnel = in_status_tunnel, .af_settunnel = in_set_tunnel, .af_setvhid = in_set_vhid, +#ifdef WITHOUT_NETLINK .af_difaddr = SIOCDIFADDR, .af_aifaddr = SIOCAIFADDR, .af_ridreq = &in_ridreq, .af_addreq = &in_addreq, + .af_exec = af_exec_ioctl, +#else + .af_difaddr = NL_RTM_DELADDR, + .af_aifaddr = NL_RTM_NEWADDR, + .af_ridreq = &in_del, + .af_addreq = &in_add, + .af_exec = in_exec_nl, +#endif }; static __constructor void diff --git a/sbin/ifconfig/af_inet6.c b/sbin/ifconfig/af_inet6.c index 8e2c4946e962..d5418b827789 100644 --- a/sbin/ifconfig/af_inet6.c +++ b/sbin/ifconfig/af_inet6.c @@ -59,10 +59,30 @@ static const char rcsid[] = #include "ifconfig.h" #include "ifconfig_netlink.h" +#ifndef WITHOUT_NETLINK +struct in6_px { + struct in6_addr addr; + int plen; + bool set; +}; +struct in6_pdata { + struct in6_px addr; + struct in6_px dst_addr; + struct in6_addrlifetime lifetime; + uint32_t flags; + uint32_t vhid; +}; + +static struct in6_pdata in6_del; +static struct in6_pdata in6_add = { + .lifetime = { 0, 0, ND6_INFINITE_LIFETIME, ND6_INFINITE_LIFETIME }, +}; +#else static struct in6_ifreq in6_ridreq; static struct in6_aliasreq in6_addreq = { .ifra_flags = 0, .ifra_lifetime = { 0, 0, ND6_INFINITE_LIFETIME, ND6_INFINITE_LIFETIME } }; +#endif static int ip6lifetime; #ifdef WITHOUT_NETLINK @@ -81,10 +101,18 @@ static char addr_buf[NI_MAXHOST]; /*for getnameinfo()*/ static void setifprefixlen(if_ctx *ctx, const char *addr, int dummy __unused) { +#ifdef WITHOUT_NETLINK const struct afswtch *afp = ctx->afp; if (afp->af_getprefix != NULL) afp->af_getprefix(addr, MASK); +#else + int plen = strtol(addr, NULL, 10); + + if ((plen < 0) || (plen > 128)) + errx(1, "%s: bad value", addr); + in6_add.addr.plen = plen; +#endif explicit_prefix = 1; } @@ -96,10 +124,17 @@ setip6flags(if_ctx *ctx, const char *dummyaddr __unused, int flag) if (afp->af_af != AF_INET6) err(1, "address flags can be set only for inet6 addresses"); +#ifdef WITHOUT_NETLINK if (flag < 0) in6_addreq.ifra_flags &= ~(-flag); else in6_addreq.ifra_flags |= flag; +#else + if (flag < 0) + in6_add.flags &= ~(-flag); + else + in6_add.flags |= flag; +#endif } static void @@ -109,6 +144,11 @@ setip6lifetime(if_ctx *ctx, const char *cmd, const char *val) struct timespec now; time_t newval; char *ep; +#ifdef WITHOUT_NETLINK + struct in6_addrlifetime *lifetime = &in6_addreq.ifra_lifetime; +#else + struct in6_addrlifetime *lifetime = &in6_add.lifetime; +#endif clock_gettime(CLOCK_MONOTONIC_FAST, &now); newval = (time_t)strtoul(val, &ep, 0); @@ -117,11 +157,11 @@ setip6lifetime(if_ctx *ctx, const char *cmd, const char *val) if (afp->af_af != AF_INET6) errx(1, "%s not allowed for the AF", cmd); if (strcmp(cmd, "vltime") == 0) { - in6_addreq.ifra_lifetime.ia6t_expire = now.tv_sec + newval; - in6_addreq.ifra_lifetime.ia6t_vltime = newval; + lifetime->ia6t_expire = now.tv_sec + newval; + lifetime->ia6t_vltime = newval; } else if (strcmp(cmd, "pltime") == 0) { - in6_addreq.ifra_lifetime.ia6t_preferred = now.tv_sec + newval; - in6_addreq.ifra_lifetime.ia6t_pltime = newval; + lifetime->ia6t_preferred = now.tv_sec + newval; + lifetime->ia6t_pltime = newval; } } @@ -148,7 +188,11 @@ setip6eui64(if_ctx *ctx, const char *cmd, int dummy __unused) if (afp->af_af != AF_INET6) errx(EXIT_FAILURE, "%s not allowed for the AF", cmd); +#ifdef WITHOUT_NETLINK in6 = (struct in6_addr *)&in6_addreq.ifra_addr.sin6_addr; +#else + in6 = &in6_add.addr.addr; +#endif if (memcmp(&in6addr_any.s6_addr[8], &in6->s6_addr[8], 8) != 0) errx(EXIT_FAILURE, "interface index is already filled"); if (getifaddrs(&ifap) != 0) @@ -369,8 +413,92 @@ in6_status_nl(if_ctx *ctx __unused, if_link_t *link, if_addr_t *ifa) putchar('\n'); } + +static struct in6_px *sin6tab_nl[] = { + &in6_del.addr, /* RIDADDR */ + &in6_add.addr, /* ADDR */ + NULL, /* MASK */ + &in6_add.dst_addr, /* DSTADDR*/ +}; + +static void +in6_getaddr(const char *addr_str, int which) +{ + struct in6_px *px = sin6tab_nl[which]; + + newaddr &= 1; + + px->set = true; + px->plen = 128; + if (which == ADDR) { + char *p = NULL; + if((p = strrchr(addr_str, '/')) != NULL) { + *p = '\0'; + int plen = strtol(p + 1, NULL, 10); + if (plen < 0 || plen > 128) + errx(1, "%s: bad value", p + 1); + px->plen = plen; + explicit_prefix = 1; + } + } + + struct addrinfo hints = { .ai_family = AF_INET6 }; + struct addrinfo *res; + + int error = getaddrinfo(addr_str, NULL, &hints, &res); + if (error != 0) { + if (inet_pton(AF_INET6, addr_str, &px->addr) != 1) + errx(1, "%s: bad value", addr_str); + } else { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)(void *)res->ai_addr; + px->addr = sin6->sin6_addr; + freeaddrinfo(res); + } +} + +static int +in6_exec_nl(if_ctx *ctx, unsigned long action, void *data) +{ + struct in6_pdata *pdata = (struct in6_pdata *)data; + struct snl_writer nw = {}; + + snl_init_writer(ctx->io_ss, &nw); + struct nlmsghdr *hdr = snl_create_msg_request(&nw, action); + struct ifaddrmsg *ifahdr = snl_reserve_msg_object(&nw, struct ifaddrmsg); + + ifahdr->ifa_family = AF_INET6; + ifahdr->ifa_prefixlen = pdata->addr.plen; + ifahdr->ifa_index = if_nametoindex_nl(ctx->io_ss, name); + + snl_add_msg_attr_ip6(&nw, IFA_LOCAL, &pdata->addr.addr); + if (action == NL_RTM_NEWADDR && pdata->dst_addr.set) + snl_add_msg_attr_ip6(&nw, IFA_ADDRESS, &pdata->dst_addr.addr); + + struct ifa_cacheinfo ci = { + .ifa_prefered = pdata->lifetime.ia6t_pltime, + .ifa_valid = pdata->lifetime.ia6t_vltime, + }; + snl_add_msg_attr(&nw, IFA_CACHEINFO, sizeof(ci), &ci); + + int off = snl_add_msg_attr_nested(&nw, IFA_FREEBSD); + snl_add_msg_attr_u32(&nw, IFAF_FLAGS, pdata->flags); + if (pdata->vhid != 0) + snl_add_msg_attr_u32(&nw, IFAF_VHID, pdata->vhid); + snl_end_attr_nested(&nw, off); + + if (!snl_finalize_msg(&nw) || !snl_send_message(ctx->io_ss, hdr)) + return (0); + + struct snl_errmsg_data e = {}; + snl_read_reply_code(ctx->io_ss, hdr->nlmsg_seq, &e); + + return (e.error); +} #endif +#ifdef WITHOUT_NETLINK static struct sockaddr_in6 *sin6tab[] = { &in6_ridreq.ifr_addr, &in6_addreq.ifra_addr, &in6_addreq.ifra_prefixmask, &in6_addreq.ifra_dstaddr @@ -434,7 +562,6 @@ in6_getaddr(const char *s, int which) } } -#ifdef WITHOUT_NETLINK static int prefix(void *val, int size) { @@ -554,7 +681,11 @@ in6_set_tunnel(int s, struct addrinfo *srcres, struct addrinfo *dstres) static void in6_set_vhid(int vhid) { +#ifdef WITHOUT_NETLINK in6_addreq.ifra_vhid = vhid; +#else + in6_add.vhid = (uint32_t)vhid; +#endif } static struct cmd inet6_cmds[] = { @@ -602,16 +733,27 @@ static struct afswtch af_inet6 = { .af_status = in6_status_nl, #endif .af_getaddr = in6_getaddr, +#ifdef WITHOUT_NETLINK .af_getprefix = in6_getprefix, +#endif .af_other_status = nd6_status, .af_postproc = in6_postproc, .af_status_tunnel = in6_status_tunnel, .af_settunnel = in6_set_tunnel, .af_setvhid = in6_set_vhid, +#ifdef WITHOUT_NETLINK .af_difaddr = SIOCDIFADDR_IN6, .af_aifaddr = SIOCAIFADDR_IN6, .af_ridreq = &in6_addreq, .af_addreq = &in6_addreq, + .af_exec = af_exec_ioctl, +#else + .af_difaddr = NL_RTM_DELADDR, + .af_aifaddr = NL_RTM_NEWADDR, + .af_ridreq = &in6_add, + .af_addreq = &in6_add, + .af_exec = in6_exec_nl, +#endif }; static void diff --git a/sbin/ifconfig/af_link.c b/sbin/ifconfig/af_link.c index 978006c217de..8fd5e05044e2 100644 --- a/sbin/ifconfig/af_link.c +++ b/sbin/ifconfig/af_link.c @@ -228,6 +228,7 @@ static struct afswtch af_link = { .af_getaddr = link_getaddr, .af_aifaddr = SIOCSIFLLADDR, .af_addreq = &link_ridreq, + .af_exec = af_exec_ioctl, }; static struct afswtch af_ether = { .af_name = "ether", @@ -240,6 +241,7 @@ static struct afswtch af_ether = { .af_getaddr = link_getaddr, .af_aifaddr = SIOCSIFLLADDR, .af_addreq = &link_ridreq, + .af_exec = af_exec_ioctl, }; static struct afswtch af_lladdr = { .af_name = "lladdr", @@ -252,6 +254,7 @@ static struct afswtch af_lladdr = { .af_getaddr = link_getaddr, .af_aifaddr = SIOCSIFLLADDR, .af_addreq = &link_ridreq, + .af_exec = af_exec_ioctl, }; static __constructor void diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index ba14f84f7e7e..8ae7920e6ea9 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -119,6 +119,7 @@ static void status(struct ifconfig_args *args, const struct sockaddr_dl *sdl, struct ifaddrs *ifa); #endif static _Noreturn void usage(void); +static void Perrorc(const char *cmd, int error); static int getifflags(const char *ifname, int us, bool err_ok); @@ -560,6 +561,34 @@ args_parse(struct ifconfig_args *args, int argc, char *argv[]) verbose = args->verbose; } +static int +ifconfig_wrapper(struct ifconfig_args *args, int iscreate, + const struct afswtch *uafp) +{ +#ifdef WITHOUT_NETLINK + struct ifconfig_context ctx = { + .args = args, + .io_s = -1, + }; + + return (ifconfig(&ctx, iscreate, uafp)); +#else + return (ifconfig_wrapper_nl(args, iscreate, uafp)); +#endif +} + +static bool +isargcreate(const char *arg) +{ + if (arg == NULL) + return (false); + + if (strcmp(arg, "create") == 0 || strcmp(arg, "plumb") == 0) + return (true); + + return (false); +} + int main(int ac, char *av[]) { @@ -613,13 +642,12 @@ main(int ac, char *av[]) * right here as we would otherwise fail when trying * to find the interface. */ - if (arg != NULL && (strcmp(arg, "create") == 0 || - strcmp(arg, "plumb") == 0)) { + if (isargcreate(arg)) { iflen = strlcpy(name, args->ifname, sizeof(name)); if (iflen >= sizeof(name)) errx(1, "%s: cloning name too long", args->ifname); - ifconfig(args->argc, args->argv, 1, NULL); + ifconfig_wrapper(args, 1, NULL); exit(exit_code); } #ifdef JAIL @@ -633,7 +661,7 @@ main(int ac, char *av[]) if (iflen >= sizeof(name)) errx(1, "%s: interface name too long", args->ifname); - ifconfig(args->argc, args->argv, 0, NULL); + ifconfig_wrapper(args, 0, NULL); exit(exit_code); } #endif @@ -643,8 +671,7 @@ main(int ac, char *av[]) * Do not allow use `create` command as hostname if * address family is not specified. */ - if (arg != NULL && (strcmp(arg, "create") == 0 || - strcmp(arg, "plumb") == 0)) { + if (isargcreate(arg)) { if (args->argc == 1) errx(1, "interface %s already exists", args->ifname); @@ -674,7 +701,7 @@ main(int ac, char *av[]) if (!(((flags & IFF_CANTCONFIG) != 0) || (args->downonly && (flags & IFF_UP) != 0) || (args->uponly && (flags & IFF_UP) == 0))) - ifconfig(args->argc, args->argv, 0, args->afp); + ifconfig_wrapper(args, 0, args->afp); } goto done; } @@ -802,7 +829,7 @@ list_interfaces_ioctl(struct ifconfig_args *args) ifindex++; if (args->argc > 0) - ifconfig(args->argc, args->argv, 0, args->afp); + ifconfig_wrapper(args, 0, args->afp); else status(args, sdl, ifa); } @@ -1001,31 +1028,42 @@ static void setifdstaddr(if_ctx *ctx, const char *addr, int param __unused); static const struct cmd setifdstaddr_cmd = DEF_CMD("ifdstaddr", 0, setifdstaddr); +int +af_exec_ioctl(if_ctx *ctx, unsigned long action, void *data) +{ + struct ifreq *req = (struct ifreq *)data; + + strlcpy(req->ifr_name, name, sizeof(req->ifr_name)); + if (ioctl_ctx(ctx, action, req) == 0) + return (0); + return (errno); +} + static void -delifaddr(int s, const struct afswtch *afp) +delifaddr(if_ctx *ctx, const struct afswtch *afp) { - if (afp->af_ridreq == NULL || afp->af_difaddr == 0) { + int error; + + if (afp->af_exec == NULL) { warnx("interface %s cannot change %s addresses!", name, afp->af_name); clearaddr = 0; return; } - strlcpy(((struct ifreq *)afp->af_ridreq)->ifr_name, name, - sizeof ifr.ifr_name); - int ret = ioctl(s, afp->af_difaddr, afp->af_ridreq); - if (ret < 0) { - if (errno == EADDRNOTAVAIL && (doalias >= 0)) { + error = afp->af_exec(ctx, afp->af_difaddr, afp->af_ridreq); + if (error != 0) { + if (error == EADDRNOTAVAIL && (doalias >= 0)) { /* means no previous address for interface */ } else - Perror("ioctl (SIOCDIFADDR)"); + Perrorc("ioctl (SIOCDIFADDR)", error); } } static void -addifaddr(int s, const struct afswtch *afp) +addifaddr(if_ctx *ctx, const struct afswtch *afp) { - if (afp->af_addreq == NULL || afp->af_aifaddr == 0) { + if (afp->af_exec == NULL) { warnx("interface %s cannot change %s addresses!", name, afp->af_name); newaddr = 0; @@ -1033,21 +1071,26 @@ addifaddr(int s, const struct afswtch *afp) } if (setaddr || setmask) { - strlcpy(((struct ifreq *)afp->af_addreq)->ifr_name, name, - sizeof ifr.ifr_name); - if (ioctl(s, afp->af_aifaddr, afp->af_addreq) < 0) - Perror("ioctl (SIOCAIFADDR)"); + int error = afp->af_exec(ctx, afp->af_aifaddr, afp->af_addreq); + if (error != 0) + Perrorc("ioctl (SIOCAIFADDR)", error); } } int -ifconfig(int argc, char *const *argv, int iscreate, const struct afswtch *uafp) +ifconfig(if_ctx *orig_ctx, int iscreate, const struct afswtch *uafp) { - struct ifconfig_context ctx = {}; const struct afswtch *afp, *nafp; const struct cmd *p; struct callback *cb; int s; + int argc = orig_ctx->args->argc; + char *const *argv = orig_ctx->args->argv; + struct ifconfig_context _ctx = { + .args = orig_ctx->args, + .io_ss = orig_ctx->io_ss, + }; + struct ifconfig_context *ctx = &_ctx; strlcpy(ifr.ifr_name, name, sizeof ifr.ifr_name); afp = NULL; @@ -1085,8 +1128,8 @@ top: (s = socket(AF_LOCAL, SOCK_DGRAM, 0)) < 0)) err(1, "socket(family %u,SOCK_DGRAM)", ifr.ifr_addr.sa_family); - ctx.io_s = s; - ctx.afp = afp; + ctx->io_s = s; + ctx->afp = afp; while (argc > 0) { p = cmd_lookup(*argv, iscreate); @@ -1132,22 +1175,22 @@ top: if (argv[1] == NULL) errx(1, "'%s' requires argument", p->c_name); - p->c_u.c_func(&ctx, argv[1], 0); + p->c_u.c_func(ctx, argv[1], 0); argc--, argv++; } else if (p->c_parameter == OPTARG && p->c_u.c_func) { - p->c_u.c_func(&ctx, argv[1], 0); + p->c_u.c_func(ctx, argv[1], 0); if (argv[1] != NULL) argc--, argv++; } else if (p->c_parameter == NEXTARG2 && p->c_u.c_func2) { if (argc < 3) errx(1, "'%s' requires 2 arguments", p->c_name); - p->c_u.c_func2(&ctx, argv[1], argv[2]); + p->c_u.c_func2(ctx, argv[1], argv[2]); argc -= 2, argv += 2; } else if (p->c_parameter == SPARAM && p->c_u.c_func3) { - p->c_u.c_func3(&ctx, *argv, p->c_sparameter); + p->c_u.c_func3(ctx, *argv, p->c_sparameter); } else if (p->c_u.c_func) - p->c_u.c_func(&ctx, *argv, p->c_parameter); + p->c_u.c_func(ctx, *argv, p->c_parameter); argc--, argv++; } @@ -1155,7 +1198,7 @@ top: * Do any post argument processing required by the address family. */ if (afp->af_postproc != NULL) - afp->af_postproc(&ctx, newaddr, getifflags(name, s, true)); + afp->af_postproc(ctx, newaddr, getifflags(name, s, true)); /* * Do deferred callbacks registered while processing * command-line arguments. @@ -1166,9 +1209,9 @@ top: * Do deferred operations. */ if (clearaddr) - delifaddr(s, afp); + delifaddr(ctx, afp); if (newaddr) - addifaddr(s, afp); + addifaddr(ctx, afp); close(s); return(0); @@ -1276,7 +1319,7 @@ setifbroadaddr(if_ctx *ctx, const char *addr, int dummy __unused) const struct afswtch *afp = ctx->afp; if (afp->af_getaddr != NULL) - afp->af_getaddr(addr, DSTADDR); + afp->af_getaddr(addr, BRDADDR); } static void @@ -1749,8 +1792,8 @@ tunnel_status(int s) af_all_tunnel_status(s); } -void -Perror(const char *cmd) +static void +Perrorc(const char *cmd, int error) { switch (errno) { @@ -1763,10 +1806,16 @@ Perror(const char *cmd) break; default: - err(1, "%s", cmd); + errc(1, error, "%s", cmd); } } +void +Perror(const char *cmd) +{ + Perrorc(cmd, errno); +} + /* * Print a value a la the %b format of the kernel's printf */ diff --git a/sbin/ifconfig/ifconfig.h b/sbin/ifconfig/ifconfig.h index 994596f02bcb..62dc0bdfe1f4 100644 --- a/sbin/ifconfig/ifconfig.h +++ b/sbin/ifconfig/ifconfig.h @@ -152,10 +152,15 @@ struct ifaddrs; struct addrinfo; enum { - RIDADDR, - ADDR, - MASK, - DSTADDR, + RIDADDR = 0, + ADDR = 1, + MASK = 2, + DSTADDR = 3, +#ifdef WITHOUT_NETLINK + BRDADDR = 3, +#else + BRDADDR = 4, +#endif }; struct snl_parsed_addr; @@ -168,6 +173,7 @@ typedef void af_status_nl_f(if_ctx *ctx, if_link_t *link, if_addr_t *ifa); typedef void af_status_f(if_ctx *ctx, const struct ifaddrs *); typedef void af_other_status_f(if_ctx *ctx); typedef void af_postproc_f(if_ctx *ctx, int newaddr, int ifflags); +typedef int af_exec_f(if_ctx *ctx, unsigned long action, void *data); struct afswtch { const char *af_name; /* as given on cmd line, e.g. "inet" */ @@ -192,6 +198,7 @@ struct afswtch { void (*af_getprefix)(const char *, int); af_postproc_f *af_postproc; af_setvhid_f *af_setvhid; /* Set CARP vhid for an address */ + af_exec_f *af_exec; /* Handler to interact with kernel */ u_long af_difaddr; /* set dst if address ioctl */ u_long af_aifaddr; /* set if address ioctl */ void *af_ridreq; /* */ @@ -204,6 +211,7 @@ struct afswtch { struct addrinfo *dstres); }; void af_register(struct afswtch *); +int af_exec_ioctl(if_ctx *ctx, unsigned long action, void *data); struct ifconfig_args { bool all; /* Match everything */ @@ -262,7 +270,7 @@ void sfp_status(int s, struct ifreq *ifr, int verbose); struct sockaddr_dl; bool match_ether(const struct sockaddr_dl *sdl); bool match_if_flags(struct ifconfig_args *args, int if_flags); -int ifconfig(int argc, char *const *argv, int iscreate, const struct afswtch *uafp); +int ifconfig(if_ctx *ctx, int iscreate, const struct afswtch *uafp); bool group_member(const char *ifname, const char *match, const char *nomatch); void print_ifcap(struct ifconfig_args *args, int s); void tunnel_status(int s); @@ -273,6 +281,9 @@ void print_metric(int s); /* Netlink-related functions */ void list_interfaces_nl(struct ifconfig_args *args); +int ifconfig_wrapper_nl(struct ifconfig_args *args, int iscreate, + const struct afswtch *uafp); +uint32_t if_nametoindex_nl(struct snl_state *ss, const char *ifname); /* * XXX expose this so modules that neeed to know of any pending diff --git a/sbin/ifconfig/ifconfig_netlink.c b/sbin/ifconfig/ifconfig_netlink.c index 140808e18681..ebebea33f3f6 100644 --- a/sbin/ifconfig/ifconfig_netlink.c +++ b/sbin/ifconfig/ifconfig_netlink.c @@ -122,6 +122,26 @@ nl_init_socket(struct snl_state *ss) err(1, "unable to open netlink socket"); } +int +ifconfig_wrapper_nl(struct ifconfig_args *args, int iscreate, + const struct afswtch *uafp) +{ + struct snl_state ss = {}; + struct ifconfig_context ctx = { + .args = args, + .io_s = -1, + .io_ss = &ss, + }; + *** 51 LINES SKIPPED *** From nobody Thu May 25 13:25:50 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRphv16Rwz4V0Fm; Thu, 25 May 2023 13:25: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 4QRphv0ckMz46QJ; Thu, 25 May 2023 13:25:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685021151; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H9RUfMvDzC7dn5aSq0d4aMaBrH76oeTN4M+BvG4nThE=; b=qTH6Pk2SRd+3gQsr+r9DURA9cW5o1H/8Rqn8fF7MmgLnOTu0zK/VdmXtGtlHuGjNoq2wFf /qZVH+lb9zrObX36VQHZLMWv9nWeurNicHK+/aYDrpJNEZvAsH6vih5CoV4kDf7zqJ0Omy K3feiqHwWX32MjX3tAOVM+t3s7syh51KJ19rxeG8Rma4eYQotkBxlAILLWGFtNbxtKvGRW WFfXBXq/MSOHtVHlQxjfrhepio8+mTqshHJiqILyFzdXZbMKHY5g3Q1PI8kv3qCoWmsB59 /0QFt0lbIBlDxqyAMRyia6iQM/UjF+5JtA/5t8ufbRJS1J1lND/ACagZC44feA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685021151; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H9RUfMvDzC7dn5aSq0d4aMaBrH76oeTN4M+BvG4nThE=; b=VctqNYzsGN+mPBy6UXGuJkR+LJTKKuI8KQFJ0NiVsHyvi0q1OYsITlyu5nlKxvw1UQYbFB Mbvuc73DHqGsjOYvD6Mcav5IZkdfKtiapoy5/vgxDdUBOlXiw/MbtRPi7en187VUr6lunJ zGACxXAam09cCyvUYtMBndk4VIANV2SMHkXSUhy/mk6IzTWmhqoMehm6BO5aeOaBIHkozA IZGriW504lsupzexuw7HU26r5IZnpaeZUK4Ca41zlPnVavC5Q1QKtY6AFi81aI+PD54/Uz 5VdE2qiF1iRnvApAH3Ayi2a+FLlgxgNRjKGMlmIBeSFYe6Doo2qpTfDzta5/pw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685021151; a=rsa-sha256; cv=none; b=SZky/N96iK9BDj1cITeN+WkWMxKwfrrErt2+k9HVi3NXhkAfXSj4q/jP6bQNU6qU2QmYoL DlvQyqPS7910SfjIhoo/l/hB+mGmsyGOV+EqUyJ7sdMCwGrXpuNZdXkXwPdi3pNKsaL1Wu tE7pvWj0apo5MHXPxqD/AOx8O+wUFtD5sLvmGjD6NecDyo6CtmkU1ktReFUFZoaYQNKpjw v9TWxFy2lV6l3yT02xk9nHkW5STug7v9fNf/VRAdlgqC/nB2/M66/tH3781IIeXmXs+yQG llW7stQ7gaVDaQ7T2RbbnfGcYYnOU0aGd9GPa/msYS8NmdjRQ/hXbQ44hUZiJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRpht6qZnzRG1; Thu, 25 May 2023 13:25: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 34PDPoNR064473; Thu, 25 May 2023 13:25:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PDPonu064472; Thu, 25 May 2023 13:25:50 GMT (envelope-from git) Date: Thu, 25 May 2023 13:25:50 GMT Message-Id: <202305251325.34PDPonu064472@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: 430d064ba5b0 - main - ctags: Support writing to stdout instead of a file. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 430d064ba5b0cb2e91a26af34c15df48d290e417 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=430d064ba5b0cb2e91a26af34c15df48d290e417 commit 430d064ba5b0cb2e91a26af34c15df48d290e417 Author: Dag-Erling Smørgrav AuthorDate: 2023-05-25 11:55:56 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-05-25 13:22:18 +0000 ctags: Support writing to stdout instead of a file. * Understand "-" to mean stdout as per convention. * Check that the output is a regular file and ignore -u if not, otherwise we might try to rm /dev/stdout. * As a bonus, if -u was specified but the output file does not exist, proceed as if -u had not been specified instead of erroring out. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: cracauer, debdrup Differential Revision: https://reviews.freebsd.org/D40237 --- usr.bin/ctags/ctags.1 | 16 +++++++++++++--- usr.bin/ctags/ctags.c | 23 +++++++++++++++++++++-- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/usr.bin/ctags/ctags.1 b/usr.bin/ctags/ctags.1 index 9b68f669202e..40c502b3ecdd 100644 --- a/usr.bin/ctags/ctags.1 +++ b/usr.bin/ctags/ctags.1 @@ -28,7 +28,7 @@ .\" @(#)ctags.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 6, 1993 +.Dd May 23, 2023 .Dt CTAGS 1 .Os .Sh NAME @@ -93,16 +93,26 @@ Place the tag descriptions in a file called .Ar tagsfile . The default behaviour is to place them in a file called .Pa tags . +If +.Ar tagsfile +is +.Dq - , +the tags will be written to standard output instead. .It Fl u Update the specified files in the .Pa tags file, that is, all references to them are deleted, and the new values are appended to the file. -(Beware: this option is implemented in a way which is rather +This is ignored if the tags file does not exist or is not a regular +file (e.g. +.Fl f Ns - +was used to write to standard output). +.Pp +Beware: this option is implemented in a way which is rather slow; it is usually faster to simply rebuild the .Pa tags -file.) +file. .It Fl v An index of the form expected by .Xr vgrind 1 diff --git a/usr.bin/ctags/ctags.c b/usr.bin/ctags/ctags.c index 409b07f5354b..d94b6e87ae1b 100644 --- a/usr.bin/ctags/ctags.c +++ b/usr.bin/ctags/ctags.c @@ -42,11 +42,14 @@ static char sccsid[] = "@(#)ctags.c 8.4 (Berkeley) 2/7/95"; #endif #include +__FBSDID("$FreeBSD$"); + #include +#include #include -__FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -143,6 +146,9 @@ main(int argc, char **argv) if (!argc) usage(); + if (strcmp(outfile, "-") == 0) + outfile = "/dev/stdout"; + if (!xflag) setlocale(LC_COLLATE, "C"); @@ -164,11 +170,23 @@ main(int argc, char **argv) put_entries(head); else { if (uflag) { + struct stat sb; FILE *oldf; regex_t *regx; - if ((oldf = fopen(outfile, "r")) == NULL) + if ((oldf = fopen(outfile, "r")) == NULL) { + if (errno == ENOENT) { + uflag = 0; + goto udone; + } err(1, "opening %s", outfile); + } + if (fstat(fileno(oldf), &sb) != 0 || + !S_ISREG(sb.st_mode)) { + fclose(oldf); + uflag = 0; + goto udone; + } if (unlink(outfile)) err(1, "unlinking %s", outfile); if ((outf = fopen(outfile, "w")) == NULL) @@ -198,6 +216,7 @@ nextline: fclose(outf); ++aflag; } +udone: if (!(outf = fopen(outfile, aflag ? "a" : "w"))) err(1, "%s", outfile); put_entries(head); From nobody Thu May 25 13:42:22 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRq3y6wKkz4V1VW; Thu, 25 May 2023 13:42: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 4QRq3y6MFrz4Cx0; Thu, 25 May 2023 13:42:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685022142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rywri9aHyR2Oqrr+SC3hAHg3PCshnL926i81z4XnZnk=; b=F1U164q2VVDUP7YgPpmHwuaKeQ+L4dnRPFPFsKbdwM34kyvf5u9a4Isuk8pawBXeBCDGUt mLrnFEf/074SEv43JCTGhEJSD7Dnudki8rmTvcNjTYUXaHjdobMTJ5mtWpezKAJvcjU1WO /GSUxkCwCRwyOBRokPCK1ZhYl2oY72cLNAdRG4CKkqAi5cfHW9X34lvsXm3CjJBt4edtRN +RnsUPsRpWxM1TfPGnDYQNGwC5Tl0WKhc7/tDYbbTxQtjPrErOrd/Tb8foSZJf2J5xpXE8 eC3l65hGe9AbAkRlp4Y+PbbRYVLP39Iz6Luh20NhFnrxSGEYz8oUmBIIHAdWkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685022142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rywri9aHyR2Oqrr+SC3hAHg3PCshnL926i81z4XnZnk=; b=XYeLOaBBk9EaVpOH501QW3KBEbw1XpeAJ7pUE3YrIj7o/lN7PHpfrU3xThXo9ot9qP0mWI vqgY032RN2M4ytvyxa9jkLLx56KyLAwH0YU6TXfI+PXZxeJSigproK6YLwrH0/lMjlO52i eX9pIVcXUvWlJU9T+8dS8uvoFs88nW3yr7srFPkhNzcH/V9ZtEk02HwdGGQuih3Blb6zwS JEXu3jT8rFwkwd+GSurg1ta4RgTHaSjquT1IRyjPrHC0fJ8aJCHs8WM4eLhqej552Q4Jy4 nTwfz6PoHsb82rWkDyhqWW8ZXBVzmPOWVS3GqWuiXzA//kmrgBCmgtIjAHiYGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685022142; a=rsa-sha256; cv=none; b=es1X7cpLRxAW/j9k7eq6kWmT2A9TrGqon42ndb/to1QhPOIuIYYO0UWs/EMG86PcfQFCLB 2U6sysaHSUZhjkOO+8zt90XVQXbAYnX50psheuS9cFSKMNoNYAAji7NCJjztlH1pGEOKzl X+Z5t/eKKE6t+JqLu4w3kH5OnHJgLLcUs+UpVlzcKZYeE3oTqqjmDLnHTvMr+jLGgjpID8 2araSKvetay8sSjiRM/MU12EMAtOOjFL/tqqg8Q/l/8+s4nj8h2wz4ZoJ4CR6BavHZm5fY epuU9v3IBERMkNcolVPswccAzHG77ZW8DdI9Xkko7bynzkOAOn/Hn6WQdQ+Q+Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRq3y5Q6XzRL9; Thu, 25 May 2023 13:42: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 34PDgMEA096212; Thu, 25 May 2023 13:42:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PDgMgT096211; Thu, 25 May 2023 13:42:22 GMT (envelope-from git) Date: Thu, 25 May 2023 13:42:22 GMT Message-Id: <202305251342.34PDgMgT096211@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: fd96685a4a57 - main - Revert "When stopping powerd, set the CPU frequency back to its maximum value" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fd96685a4a579fc84031e8e66d8f8b1ce8cdf1e5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=fd96685a4a579fc84031e8e66d8f8b1ce8cdf1e5 commit fd96685a4a579fc84031e8e66d8f8b1ce8cdf1e5 Author: Andrew Gallatin AuthorDate: 2023-05-22 00:47:28 +0000 Commit: Andrew Gallatin CommitDate: 2023-05-25 13:40:26 +0000 Revert "When stopping powerd, set the CPU frequency back to its maximum value" This reverts commit 1dcb6ad173e57b489a859ea59ed6eaa733bdb5bc. As of "8cb16fdbea6b Restore original frequency on exit.", powerd restores the original frequency itself. Further, if the original frequency is not the same as the first frequency found in the frequency list, then the restoration done by the powerd_poststop will restore the wrong frequency. This can happen on Intel machines where Turbo is not enabled, but the turbo frequency is first in the list of frequencies. In this case, turbo will be enabled when the user did not want it to be. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D40197 Reviewed by: imp, mav --- libexec/rc/rc.d/powerd | 7 ------- 1 file changed, 7 deletions(-) diff --git a/libexec/rc/rc.d/powerd b/libexec/rc/rc.d/powerd index 2fc783a627e9..6f63bb96ff42 100755 --- a/libexec/rc/rc.d/powerd +++ b/libexec/rc/rc.d/powerd @@ -14,13 +14,6 @@ name="powerd" desc="Modify the power profile based on AC line state" rcvar="powerd_enable" command="/usr/sbin/${name}" -stop_postcmd=powerd_poststop - -powerd_poststop() -{ - sysctl dev.cpu.0.freq=`sysctl -n dev.cpu.0.freq_levels | - sed -e 's:/.*::'` > /dev/null -} load_rc_config $name run_rc_command "$1" From nobody Thu May 25 14:12:13 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRqkQ0QGZz4V2yV; Thu, 25 May 2023 14:12: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 4QRqkP6hY2z4HT2; Thu, 25 May 2023 14:12:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685023933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZnSIBeULwYXfQh5mfVvTd2UfKuDR/UAvvC2dX9psnP8=; b=cJApZMZ0nABuptCKmPCnxqdcMGUEHV9IAqKHbPxQ9MHdbyhVoZiRaCIV05nJH4ZRUBnid6 vgqXHiiu0anDwj2dPBL+8ryutaO3vJhxB7Lj8wIh3geVVN1VRCBYUTRvlBL1EKo9WFUqwK qNg0mZFceLkrCHM32XhZOXi+a6Kbc7QmF3s2P3Vrl713RttXX2dq5CPtbsQuHCLQ6xSGnC VQvKQu00Vl9pSb0MJX6cTfSYPV+4SN80n2fS+EnaxbK4DgKD+q3/Y/73pcFHKZU+b+ePP4 4ogmVPqHO4pMVUdoKmh+KrLa7M2fo7bFKE+9nuMQLTfFc4XSCbyNLzHGLBdl2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685023933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZnSIBeULwYXfQh5mfVvTd2UfKuDR/UAvvC2dX9psnP8=; b=W4sRcRfoy8nQm6C4wHEi7wGEvIZ9ro6+mjfGUcWv6BP4vNbBM9HwfbmLoc01S+C8BSM+6c zneK6VyEXeKrtXaO1c+T1PgVPEuPOmPrGFHuTxS8EIV6bIWJTcTHV433K6Gvib0Wt4A2jj grLIemSBMWV65nn5RsRateDbFgbSjO0VMO3gN1M8hKr8V2GB6J0heRWP9jou1/FcMZXbHr hG/OFn8l7zWlMyfAs7go8wwPN8blbxls3CPOKttPxiYFH5n+SO/vad7rkzqpFhqSKPBxA6 krDvhkjdSWgr896U6RXiwN/Ij9mu0j34QRDleT6/bCkZd0Ya6Yurb7vSLbJZHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685023933; a=rsa-sha256; cv=none; b=PlCw3qHkTGD3rhqy1PEVYAU7dWWMjPYZr6Duqy1soljKdzvvp+3KwQzGHp70az06T6sauR mHAHlDkfm3EgHdZA4QGBH6rWf4B7JhPLydbovBCQor26WMNUlC9k3i6saSJfWZA+I3Z1PW 3CSORHoR0JJg/kLEaeoLla3ZYD8t9lOz+AgfHIAJDqBPHLyZqr7hlhSizQC0iNyWxSkt7Z +xjI8/sUP917XSPOdWa2rZFOgXKBqhjbBinhhcUB1wi2MH7tjCttVgn9AtVMQ7B3QQy7g6 Cw9Q3xAH58ai4EG+GcccwHG5KCwJxiTnKHS9jNz+KAo3lUs7UCM86hXtF4vXow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRqkP5lkHzSZ1; Thu, 25 May 2023 14:12: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 34PECD1M045901; Thu, 25 May 2023 14:12:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PECDM9045900; Thu, 25 May 2023 14:12:13 GMT (envelope-from git) Date: Thu, 25 May 2023 14:12:13 GMT Message-Id: <202305251412.34PECDM9045900@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 48f52d9179d5 - main - zfs: Fix build on 32-bit platforms after most recent import. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 48f52d9179d5920750cef0c5d921db63de4d767d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=48f52d9179d5920750cef0c5d921db63de4d767d commit 48f52d9179d5920750cef0c5d921db63de4d767d Author: John Baldwin AuthorDate: 2023-05-25 14:11:38 +0000 Commit: John Baldwin CommitDate: 2023-05-25 14:11:38 +0000 zfs: Fix build on 32-bit platforms after most recent import. unsigned long is not a uint64_t on 32-bit platforms. The zfs.4 manpage documents this variable as a uint, and it is only compared with other variables of type int, so uint_t makes more sense than unsigned long. (I also wasn't sure if ULONG would work as a ZFS_MODULE_PARAM type on other OS's) --- sys/contrib/openzfs/module/zfs/dsl_scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/contrib/openzfs/module/zfs/dsl_scan.c b/sys/contrib/openzfs/module/zfs/dsl_scan.c index 5e3559b251e3..07a527e332bc 100644 --- a/sys/contrib/openzfs/module/zfs/dsl_scan.c +++ b/sys/contrib/openzfs/module/zfs/dsl_scan.c @@ -234,7 +234,7 @@ static int zfs_resilver_disable_defer = B_FALSE; static int zfs_free_bpobj_enabled = 1; /* Error blocks to be scrubbed in one txg. */ -unsigned long zfs_scrub_error_blocks_per_txg = 1 << 12; +uint_t zfs_scrub_error_blocks_per_txg = 1 << 12; /* the order has to match pool_scan_type */ static scan_cb_t *scan_funcs[POOL_SCAN_FUNCS] = { @@ -5242,6 +5242,6 @@ ZFS_MODULE_PARAM(zfs, zfs_, scan_report_txgs, UINT, ZMOD_RW, ZFS_MODULE_PARAM(zfs, zfs_, resilver_disable_defer, INT, ZMOD_RW, "Process all resilvers immediately"); -ZFS_MODULE_PARAM(zfs, zfs_, scrub_error_blocks_per_txg, U64, ZMOD_RW, +ZFS_MODULE_PARAM(zfs, zfs_, scrub_error_blocks_per_txg, UINT, ZMOD_RW, "Error blocks to be scrubbed in one txg"); /* END CSTYLED */ From nobody Thu May 25 14:12:14 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRqkR1Cy7z4V2tF; Thu, 25 May 2023 14:12: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 4QRqkR0Qk5z4HPk; Thu, 25 May 2023 14:12:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685023935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GkbkWjT+kiNrIfqnJwX0IbilUKEJa2D3/UareLbws1M=; b=iWzhWDfr2lSATnldxUNOIckU7XJAhc8iVPvyiU9kw/mE4s0ZzlAj4AgRppn7qiUdVyeJMa tAKz5Fkv/pqXNxKbr7WBcZpMdMN8RGULCm9+sjehriyL0stLkDID/0dWnc2O9BExXwxh0C EZ1Uxsc53nS4CMAesi4Rqubk3kR7aqHjoovyh9J1UJrn2dmbkHsykX2wGH2vCdfA8FFVvS rRs1aqFSg9bhlt/gJ0JzyzRid4Rggmz+AxpCDQmPouizKvHx+Ty2TXD+lHaw7NlZhdB7IJ UjhH3xqfqKoCyGkBmagWE4KZAddNYf7XB5cVAw0u/no//nMVm+MEkdnkHYxi4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685023935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GkbkWjT+kiNrIfqnJwX0IbilUKEJa2D3/UareLbws1M=; b=mOykl0QuPoBeCr+Zs6IxGxvhv+jwgJV/H+gcBldGpu5h6RgyZjxdzUpo7Y/vo52VizBUJW 7CW7TJptykTllP/oYIsHfcdOGgH4qqavqo/3wwIkuZCTzOmCDCGaN92Ccqvpc/OnYH/fUU WlSxL90BmpRI6dspIQiX+i+5x6uZAG1btk49xQQ1Hpla81SBR4pQ0XdYkkFEGEf3NsLk7D fnagUXNCz60qvPp22tnXqZBg2x1pq+FTYpLQ/FOdY6oIjVJlA/lTSt8ycNrAYbDJXNkiXT Kts+m0pq8PDlyZSOsFu0pwyJi8Jnj4QnGVgGeIGhdwgUB92jTzILPtjNUUcydQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685023935; a=rsa-sha256; cv=none; b=XdycWlulq3M5DNUW3zYlCSYfmaVoPH/Hg7qv1kF1lHLTJ/BEKoRF+9iile6CQX+C8j+7dZ mCmlKZytIV0VwPZr/TqYuaAWLC/IwVeI+YloL+pa3JlX6SmfiJbztIRU0wreB95JfKZkiF +i2oHMVKkVl/gLEdOGkR33L+rJEmQpY4MFF4vBsxH3CYn2l41Qp127THs/Vi2BvbKevQGy PMYrm0e4G1oh1E4euOI7R9iuBg3Xlq9wFRgmXU4FPnZReQ+MKZ1ro4jikgGnr9wJMOQK+h rJ5B2Dalqv4azNUB8QQPjW1EtanhXTgFdV4ZpmPQZZGl4r4KvPFPsXy5JJhHjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRqkQ6dcFzShK; Thu, 25 May 2023 14:12: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 34PECElR045928; Thu, 25 May 2023 14:12:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PECE5E045927; Thu, 25 May 2023 14:12:14 GMT (envelope-from git) Date: Thu, 25 May 2023 14:12:14 GMT Message-Id: <202305251412.34PECE5E045927@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 4ef3b0c138d4 - main - ldns: Silence -Wstrict-prototypes warnings. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4ef3b0c138d4e51c34ef90054cdbdf79b9436d04 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4ef3b0c138d4e51c34ef90054cdbdf79b9436d04 commit 4ef3b0c138d4e51c34ef90054cdbdf79b9436d04 Author: John Baldwin AuthorDate: 2023-05-25 14:11:38 +0000 Commit: John Baldwin CommitDate: 2023-05-25 14:11:38 +0000 ldns: Silence -Wstrict-prototypes warnings. Hopefully upstream will fix the function declaration of ldns_edns_option_list_new in the future. --- lib/libldns/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libldns/Makefile b/lib/libldns/Makefile index 7714db950f00..2692b2b29e2e 100644 --- a/lib/libldns/Makefile +++ b/lib/libldns/Makefile @@ -24,6 +24,7 @@ LIBADD= ssl crypto WARNS?= 3 +CWARNFLAGS.edns.c= ${NO_WSTRICT_PROTOTYPES} CWARNFLAGS.parse.c= ${NO_WUSE_AFTER_FREE} CWARNFLAGS.sha2.c= ${NO_WARRAY_PARAMETER} From nobody Thu May 25 14:12:15 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRqkS1ZwMz4V2yZ; Thu, 25 May 2023 14:12: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 4QRqkS14Jpz4Hcb; Thu, 25 May 2023 14:12:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685023936; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vjJuzVreU7V4Jbz3u6jy3Z+dr8K0YuLiC3DognPiGxc=; b=Xqcuzl4YpqYfE/J1BThd28RzxUit7xmDcpv0pQ183RNrsz+e8xv0iieZRcMwBgckq4WMIm V0s3SZL37e6RaMEGw0xOU7wNf3hWBipD1Gn8qCGw3WHwo+JP2jYIckwrV8f7cyPmtth2jf 8LMU/mLmmJwfV2YA/34geC4lMxRM1oZvF6ohlEHcxUCjGRMRSjYdgO5OZvZx+RcmMIFQj9 vLm31bF3hEsDZCzIJMbd1m2kWH042Tun3LsjW5356N2BC58OK4OF8O2V+IBHsbnwE0DNDY qlfh3SrYxcVputNVbo8KY+b8ZsmDuBCMsoYl7o1YEbD8BmVWiUVO9jfoR1HBmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685023936; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vjJuzVreU7V4Jbz3u6jy3Z+dr8K0YuLiC3DognPiGxc=; b=wqfhoWlSNPzKbWW8omCJlHWhuW+ThVyIkq2UZm61ygBg3/p1t5EXnb1hLh+Qo8J5bSjn+x KhlXmjgNa8ANq4bZylHqDC0Zpv0w9nSGakVsCkWH/awvz/b5YTVtHudby+Tpd3aPXRyWR6 plFV0Y2Z3FbbSErSal9zTuS3c9JJHWRaKSO5DPPk6aGti1417ZpbmPJM6lhy97ABXacEIg cWhJzMF8AeYd5REe52yJy5e3BI7r4stvbc8MQZOraVU5APRo7wzdbO4r0otKolOEM3USah fKroWhMYWnaSUqOHvhUY3Df9G7Ohe0st8OXngSJaiiGfysJaOUGhzoJWasUpvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685023936; a=rsa-sha256; cv=none; b=NAJz89oddByUOkjL9isjshi7y+/IyUE73I4Pe8ZOQPWNvsC3/JjclzcqAqw7B8IUpCw/2Z UbGBE/3WgVRDfGKxJx+aLaU7ceOxnMzqbD2iHi79w064/zNjg8hehYUhuwWuUVxooiJT91 wbEc94VSXrQzJgR64DFd6+RKvQMQpXk4OOC7+LVNcostjtvkWtByD7t9Hqk1+elbRLQ/9l g6Tg2w22UwD9JS5BNbymbKhBl+uAn0vTA1ILGlhYvFk7r3qPRyMBHIFUJoRM0CdngBOLGY ai6x5UjY6eTZ64eumEWQHKdRD/mt9Fz4d2Q0IJf+QGc/+932xUOZEnzowiTV9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRqkS0B2wzSVD; Thu, 25 May 2023 14:12: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 34PECFaT045947; Thu, 25 May 2023 14:12:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PECFem045946; Thu, 25 May 2023 14:12:15 GMT (envelope-from git) Date: Thu, 25 May 2023 14:12:15 GMT Message-Id: <202305251412.34PECFem045946@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 3dad1c6696d2 - main - Enable -Wstrict-prototypes for all clang versions at WARNS >= 3. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3dad1c6696d2b86d7c4662b509f09b91f7f1aed4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3dad1c6696d2b86d7c4662b509f09b91f7f1aed4 commit 3dad1c6696d2b86d7c4662b509f09b91f7f1aed4 Author: John Baldwin AuthorDate: 2023-05-25 14:11:38 +0000 Commit: John Baldwin CommitDate: 2023-05-25 14:11:38 +0000 Enable -Wstrict-prototypes for all clang versions at WARNS >= 3. Previously clang 15+ only enabled it for WARNS >= 5. PR: 271072 (exp-run) Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D39732 --- share/mk/bsd.sys.mk | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 8141ed0661d1..b4a417236c65 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -50,7 +50,7 @@ CWARNFLAGS+= -Wall -Wno-format-y2k .endif # WARNS >= 2 .if ${WARNS} >= 3 CWARNFLAGS+= -W -Wno-unused-parameter -.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 150000 +.if ${COMPILER_TYPE} == "clang" CWARNFLAGS+= -Wstrict-prototypes .endif CWARNFLAGS+= -Wmissing-prototypes -Wpointer-arith @@ -62,11 +62,6 @@ CWARNFLAGS+= -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow\ CWARNFLAGS+= -Wcast-align .endif # !NO_WCAST_ALIGN !NO_WCAST_ALIGN.${COMPILER_TYPE} .endif # WARNS >= 4 -.if ${WARNS} >= 5 -.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 150000 -CWARNFLAGS+= -Wstrict-prototypes -.endif -.endif # WARNS >= 4 .if ${WARNS} >= 6 CWARNFLAGS+= -Wchar-subscripts -Wnested-externs \ -Wold-style-definition From nobody Thu May 25 14:12:17 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRqkT4hjBz4V2bx; Thu, 25 May 2023 14:12: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 4QRqkT2DfPz4HVR; Thu, 25 May 2023 14:12:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685023937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ltVQLxvh+l8/W2pshU0UOJiSX7MNnMfjNpnIRBm9MFo=; b=aD8QoLGZCEdILaz9a9jGLuJiJvAhJAHVvt5l0jyf1QNpiFXdNKF3EOmrQW5Oz88r6Qa/tf s6E/UwkLJ3NnmrjWeEdiYlI8xfxqKididQoGbKYxyxYodg69pKHCfbwji5iFRPKJwNFXjS CHZNXmVvQ+6T5f3ukiBIzuzTTNJbU8uD77qvAvLgtxDKQrvWVtNDe8RdRk7Ts6Msd96bMG kv36IAley39QjS3MtxjHcyONu337h7pS7f1O+KbFjj+KY0EO/EAuv7lxb2WWJGIrR56o3x 2BDxf2WYB8jx8pdvdwUpflqw4nZIYxPVx4OxEQERklDJgvnnAhXxYxlWkwwngg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685023937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ltVQLxvh+l8/W2pshU0UOJiSX7MNnMfjNpnIRBm9MFo=; b=sLZX2gExbqj58Ygrww6/vsmbYKwADffsIVMTVY1Q5cNBWijKNaI3Tt0GT6yTqsS+z+HaxN VA8uyFp8i59D254Jkw4fNIZnuUior3Yt7J8bRSudSeSd0EmzQ7X9tia0p4Meg5pWu+iGcL rEFZuQDIR+wefFAmGyC1/uNII++KAsQm4iXgaZlmwhnFwLrwsF6FjDuGdCG4Z3hQbo+2ta qjAL2UqG37rYCZD0ALYm7OiqLqEC/yG9iJENyChFhJGYCww+eg3k7t+IDWCNaMXY6NVZdl iN4I/wsYiU+NPhfAl2UAYHCyjL7rQdU7Z4Ex/Oe0oDPRL31j9P3aj3EECkobww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685023937; a=rsa-sha256; cv=none; b=AhrtIFBCvGO+BKzKobdoRwib9yrLC3YMOCtyO9MqQ2PXyTKa93JeLFsNl/+v6QlIvGDDdC CDimLlU150jd+NlPKV+n2kVBXPwqg9GbsY3lR0+Ps8NKhK4QA9qP9z9nnDJDrAOrfAcxRh JG2q1rWe7xYZdSLEP5Fj7tR3l3ut1c/HANGEVKxEKGimAh2keTXgo/2NjqxY/W0VQGYAZ3 7sRC1LGxwQwAG9pdikcfNI7e4zh5un+Jl+M06qg/RklKIZMov6m5eLJyHmhPEhm5ZKFZlN UDCVDtrw6WAlz+KqnzDGp5Bvm7NCV+qUPF4FL0beLj9GTPGbpgEUiHH5CYqP9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRqkT1KyRzSZ2; Thu, 25 May 2023 14:12:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34PECHGg045966; Thu, 25 May 2023 14:12:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PECHR6045965; Thu, 25 May 2023 14:12:17 GMT (envelope-from git) Date: Thu, 25 May 2023 14:12:17 GMT Message-Id: <202305251412.34PECHR6045965@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 6c08fd3dc804 - main - Enable -Wstrict-prototypes by default in the kernel for clang 15+. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6c08fd3dc804c9c3064add3b9a6ff678a541d210 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6c08fd3dc804c9c3064add3b9a6ff678a541d210 commit 6c08fd3dc804c9c3064add3b9a6ff678a541d210 Author: John Baldwin AuthorDate: 2023-05-25 14:11:38 +0000 Commit: John Baldwin CommitDate: 2023-05-25 14:11:38 +0000 Enable -Wstrict-prototypes by default in the kernel for clang 15+. PR: 271072 (exp-run) Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D39734 --- sys/conf/kern.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 30f7fdbc869a..be7e452bb6e3 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -48,9 +48,8 @@ CWARNEXTRA+= -Wno-error=shift-negative-value CWARNEXTRA+= -Wno-address-of-packed-member .if ${COMPILER_VERSION} >= 150000 # Clang 15 has much more aggressive diagnostics about -# mismatched prototypes and unused-but-set variables. Make these +# unused-but-set variables. Make these # non-fatal for the time being. -CWARNEXTRA+= -Wno-error=strict-prototypes CWARNEXTRA+= -Wno-error=unused-but-set-variable .endif .endif # clang From nobody Thu May 25 15:03:57 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRrt54NBZz4V5k5; Thu, 25 May 2023 15:03: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 4QRrt53wybz3CMG; Thu, 25 May 2023 15:03:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685027037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+Xo3Fh7FIsN+PJJT+olGJnNXQ9wJ0BsWBEu8ZpgcSHU=; b=nfNrTuvdjecMDZbdbwkJh+ZXVBov2fsXT7OYiELIhsGp+tVn/5EK7saibaLXH2URboag+Y 8czgL/dkfOzQTcwDS84RQa+GvGAWzs87ObYisBo9QIf3fOqzYAFQPjqsB9Tw2HuqsNmQwP 8hppGH7AYxLPZNIx3PiUgh+5K9E4uUVfLzkUlOMaSnR2L/HzLrBrl4V52qq7YkXXYztYfE omJnncyCyzXoZ0mdfb9h6ozJxmlS08LAzHGq/bg6QqgEtNmXbF4kyxZV3QW3hDIVUtTSrF UhaumIkZ6A2EznSHr3sxkgHZvCPDM1rNIBgs4ag2bJDr5+56iVPWw+hQEFNx1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685027037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+Xo3Fh7FIsN+PJJT+olGJnNXQ9wJ0BsWBEu8ZpgcSHU=; b=e5cZ9o+eIw2zazh06nD6mBcw1/1IS44RUmaAKG4xCzrQziiFv2cfjkbuVq4mAs7Zztibln mCAGYUTqXtJUxeHzIW4Gi8ZMQHaS1kM0bg1Us3/g9Xt0YT7Hr+U8HcBfC55Dx2Q2Bx2lfA XkNPV8QC45HFMyZfVP36LsLZU/93TEGMFE7sAh/Ms4yXRQHYjlaWSwWdmhISd9UMOPx3/H BbmYRD3PCVdeeKTcakw4Kpj70dp2WZt7R2GY50OCs6tBewBW21fx5EGzkbe/RxVqEdcPA+ R9HEjo4PeWwn1n+fE0LWJKm1O5G18ypqHO9185G8PTMg+eR1lUS0MPIGzyUGdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685027037; a=rsa-sha256; cv=none; b=kz0pDKQLio3qZ5CY6rN4xN5LPlBY+hDRdVqETS2XSByD1VxNBSBJ3NS/AYKf4DIyh4xd2N yfahMzCkZwewkbE3LKoFbWZYtaEUGrZ8sP5kdFqkaslYuv2aOKjTYLhyb4OdAhjsut0gau VKsDTm5rhncmsVL/LMw8g/weGCJ1W829ZJEaDxd8HF41g+mnbQEl/YsykVUZy6WDa/5VKZ DU5lW46gbcgv1uP6gMeCpRNuW3Zrl8uFDrUyp2Wj3+zQNuUDOcBA5t6Z0MOQ+7rz0NTkN8 7HHQ8XHCZvOsVN57RrQGGnUdRvc1gcOtwYOE1hZs7XETYDC1Ku2s6JRnTySPhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRrt52zzgzVFw; Thu, 25 May 2023 15:03: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 34PF3vJT029533; Thu, 25 May 2023 15:03:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PF3vGo029532; Thu, 25 May 2023 15:03:57 GMT (envelope-from git) Date: Thu, 25 May 2023 15:03:57 GMT Message-Id: <202305251503.34PF3vGo029532@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 6d204407ec6e - main - ifconfig: fix ifconfig IFX inet[6] ADDR -alias List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d204407ec6eb3403306578a2550a92b8560d92b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=6d204407ec6eb3403306578a2550a92b8560d92b commit 6d204407ec6eb3403306578a2550a92b8560d92b Author: Alexander V. Chernikov AuthorDate: 2023-05-25 14:50:57 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-05-25 15:03:35 +0000 ifconfig: fix ifconfig IFX inet[6] ADDR -alias Internally, inet and inet6 family handlers store state for address addition and deletion separately, as, for example, "ifconfig lo0 inet 127.0.0.2/32" triggers a) deletion of the first interface address and b) addition of a new one. The current logic behind handling "-alias" being the last argument is to copy the address from "addition" state to the "deletion" state. It is done by the generic ifconfig code, which explicitly typecasts opaque handler state pointers to "struct ifreq", which doesn't work in the Netlink case. Fix this by introducing family-specific "af_copyaddr" handler, which removes the peeking & typecasting logic from the generic code. Reported by: otis Tested by: otis --- sbin/ifconfig/af_inet.c | 14 ++++++++++++++ sbin/ifconfig/af_inet6.c | 14 ++++++++++++++ sbin/ifconfig/ifconfig.c | 11 ++++------- sbin/ifconfig/ifconfig.h | 2 ++ 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/sbin/ifconfig/af_inet.c b/sbin/ifconfig/af_inet.c index 73decb229d0f..76787e62d908 100644 --- a/sbin/ifconfig/af_inet.c +++ b/sbin/ifconfig/af_inet.c @@ -201,6 +201,12 @@ static struct sockaddr_in *sintab[] = { SIN(in_addreq.ifra_mask), SIN(in_addreq.ifra_broadaddr) }; +static void +in_copyaddr(if_ctx *ctx, int to, int from) +{ + memcpy(sintab[to], sintab[from], sizeof(struct sockaddr_in)); +} + static void in_getaddr(const char *s, int which) { @@ -256,6 +262,13 @@ static struct in_px *sintab_nl[] = { &in_add.brd_addr, /* BRDADDR*/ }; +static void +in_copyaddr(if_ctx *ctx, int to, int from) +{ + sintab_nl[to]->addr = sintab_nl[from]->addr; + sintab_nl[to]->addrset = sintab_nl[from]->addrset; +} + static void in_getip(const char *addr_str, struct in_addr *ip) { @@ -537,6 +550,7 @@ static struct afswtch af_inet = { .af_status = in_status_nl, #endif .af_getaddr = in_getaddr, + .af_copyaddr = in_copyaddr, .af_postproc = in_postproc, .af_status_tunnel = in_status_tunnel, .af_settunnel = in_set_tunnel, diff --git a/sbin/ifconfig/af_inet6.c b/sbin/ifconfig/af_inet6.c index d5418b827789..f735afdc8797 100644 --- a/sbin/ifconfig/af_inet6.c +++ b/sbin/ifconfig/af_inet6.c @@ -421,6 +421,13 @@ static struct in6_px *sin6tab_nl[] = { &in6_add.dst_addr, /* DSTADDR*/ }; +static void +in6_copyaddr(if_ctx *ctx, int to, int from) +{ + sin6tab_nl[to]->addr = sin6tab_nl[from]->addr; + sin6tab_nl[to]->set = sin6tab_nl[from]->set; +} + static void in6_getaddr(const char *addr_str, int which) { @@ -504,6 +511,12 @@ static struct sockaddr_in6 *sin6tab[] = { &in6_addreq.ifra_prefixmask, &in6_addreq.ifra_dstaddr }; +static void +in6_copyaddr(if_ctx *ctx, int to, int from) +{ + memcpy(sin6tab[to], sin6tab[from], sizeof(struct sockaddr_in6)); +} + static void in6_getprefix(const char *plen, int which) { @@ -733,6 +746,7 @@ static struct afswtch af_inet6 = { .af_status = in6_status_nl, #endif .af_getaddr = in6_getaddr, + .af_copyaddr = in6_copyaddr, #ifdef WITHOUT_NETLINK .af_getprefix = in6_getprefix, #endif diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 8ae7920e6ea9..84df15a58ce1 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1327,19 +1327,16 @@ notealias(if_ctx *ctx, const char *addr, int param) { const struct afswtch *afp = ctx->afp; -#define rqtosa(x) (&(((struct ifreq *)(afp->x))->ifr_addr)) - if (setaddr && doalias == 0 && param < 0) - if (afp->af_addreq != NULL && afp->af_ridreq != NULL) - bcopy((caddr_t)rqtosa(af_addreq), - (caddr_t)rqtosa(af_ridreq), - rqtosa(af_addreq)->sa_len); + if (setaddr && doalias == 0 && param < 0) { + if (afp->af_copyaddr != NULL) + afp->af_copyaddr(ctx, RIDADDR, ADDR); + } doalias = param; if (param < 0) { clearaddr = 1; newaddr = 0; } else clearaddr = 0; -#undef rqtosa } static void diff --git a/sbin/ifconfig/ifconfig.h b/sbin/ifconfig/ifconfig.h index 62dc0bdfe1f4..054e7a12f488 100644 --- a/sbin/ifconfig/ifconfig.h +++ b/sbin/ifconfig/ifconfig.h @@ -174,6 +174,7 @@ typedef void af_status_f(if_ctx *ctx, const struct ifaddrs *); typedef void af_other_status_f(if_ctx *ctx); typedef void af_postproc_f(if_ctx *ctx, int newaddr, int ifflags); typedef int af_exec_f(if_ctx *ctx, unsigned long action, void *data); +typedef void af_copyaddr_f(if_ctx *ctx, int to, int from); struct afswtch { const char *af_name; /* as given on cmd line, e.g. "inet" */ @@ -194,6 +195,7 @@ struct afswtch { #endif af_other_status_f *af_other_status; void (*af_getaddr)(const char *, int); + af_copyaddr_f *af_copyaddr; /* Copy address between ADDR */ /* parse prefix method (IPv6) */ void (*af_getprefix)(const char *, int); af_postproc_f *af_postproc; From nobody Thu May 25 15:20:03 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRsDh0FZvz4V6Fh; Thu, 25 May 2023 15:20:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QRsDg6xHYz3FHW; Thu, 25 May 2023 15:20:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685028004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=umZ34mKn5kzsNd3Pia9lIHXC+w1K8T1j8ZfJl1yUEZY=; b=hlIZeSLm/dEKqkDelSTBPWd3Jpu2Xpk8kdvkSxSjIr8rs0QonVSO0GUAN1c2ve5VpRoUK/ +UKSytnIlmqiGyIhCqAuihWWjkwRBgNfNqHPVYAK4iey03FKTeOp4DDxNSWp69fFAvPI9A iehNS9oDZjpq2ZIYAue+CGTf9Tzc6UV+sndHTt70Mfp77cZEz25+cTzVYJcnKe4HQCG7g0 jvYhqWwH5Ee2o1XlxclK1QiNZN02QUaj3iMHqMhArQ56eDEoyWF3g58TWmPth4egYd4sFu ZvqsL91B9lsQdnNeXTgnkZxjGQYyjsE5Z7Ji0aAcyM69ojidhtI8hx7St4TGLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685028004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=umZ34mKn5kzsNd3Pia9lIHXC+w1K8T1j8ZfJl1yUEZY=; b=XmkEV3MEJ3EkJlAvTJZfqfLSsdbwpwuyhphPwCBSEHj91gyrXN9ECB6yqz2nY9y09euCZK te0qIL0AQW74AipOwkmkb5Pa7kgbqtC5/b37vfGS1ptPZnsOO7O1KgfdNEuQMqa0wXWw5N mJOKeausTzIFNiLEBCGd/daA0tVmS4XTX8kVJzzy3uK1p0XVAfxxgwXHW/NmFSRh2wYasA V/SuekHTVPLskpOq2pVtGAeOvtaX7xcAgqJJTA1SB+W5+0+5qyHcsXgPvkU3XbyEe+MDmf o60ISFbgoJXvMZh3z6zuMOSgr4b4PV/Fp2iloiWFrlIhplJTQnzju26clpjAIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685028004; a=rsa-sha256; cv=none; b=p2EzGy9UnfZtm9Wea0H7KB8HtL0lfN4WpWIZwKsRKum9ayHtryQaWFQqNbwRMvv5MjQ+G4 e0HWp37IIJg6kBZcvdISwSphMQOdKVHOL9xyIAqUXZG2ACBh44A8aazcquuA/7bwoRPSR5 RReqawhxP+S3020zKmkMY/EC9LfX2tqbslCa6RTAchScK55rAOI9fDHg2eLfZiqixc+gH/ AGPVy8LWzW71hG+8dm7INppE+d7X32Mk7Qg72bappTarrVMuoFadUczKo3buFOdeS2GA9J 48lj4bCV6zAUX7dVW4SIroAT+1kU0hhUbN8jM/o8k7fO8JClQ1tAXbFQOD2xTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRsDg633czVHJ; Thu, 25 May 2023 15:20:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34PFK34e049087; Thu, 25 May 2023 15:20:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PFK33h049084; Thu, 25 May 2023 15:20:03 GMT (envelope-from git) Date: Thu, 25 May 2023 15:20:03 GMT Message-Id: <202305251520.34PFK33h049084@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 5804b7ab378d - main - superio: Add device ID for ITE IT8613 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5804b7ab378d6207130bd1685c931da6a4e76e55 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5804b7ab378d6207130bd1685c931da6a4e76e55 commit 5804b7ab378d6207130bd1685c931da6a4e76e55 Author: Johannes Totz AuthorDate: 2023-05-25 14:23:06 +0000 Commit: Ed Maste CommitDate: 2023-05-25 15:06:51 +0000 superio: Add device ID for ITE IT8613 Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D39969 --- sys/dev/superio/superio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/superio/superio.c b/sys/dev/superio/superio.c index 37b8d24dd375..6f2e44450681 100644 --- a/sys/dev/superio/superio.c +++ b/sys/dev/superio/superio.c @@ -295,6 +295,10 @@ static const struct { const char *descr; const struct sio_device *devices; } superio_table[] = { + { + .vendor = SUPERIO_VENDOR_ITE, .devid = 0x8613, + .devices = ite_devices, + }, { .vendor = SUPERIO_VENDOR_ITE, .devid = 0x8712, .devices = ite_devices, From nobody Thu May 25 15:58:03 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRt4X1Fv8z4V8Xl; Thu, 25 May 2023 15:58: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 4QRt4X0spSz3Jqb; Thu, 25 May 2023 15: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=1685030284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kD+XFrcNzFnrl0biEnmlJqfzlDEqiPjVowvv7DjPzD0=; b=eeGufUVC2W261o8qa6+3FMZfVY8hpzW19v6NiknVjXNMWdRwcSpQ9ZHDBp6FSDW7oXBBfd ME2p/Kq9mX5jg51bgMyD37LNob4/56dWRgkRyb2AQjAPyFwRQmd/op9VnlptPM4HcUkLzg nHYdSxVmKYyiHn9BG8lTcI0vRHDL8X7o2Wy8YnW8Xh3uQWRGUQZPCIwsYkqnDj/2U5cLHA 0Sbl8UrtOlX2IkhDSiJR86I9T3MYB6ncX3TUgSAc7ljxOuwga19zQyUs/aNVWlYsof+DpI TMHndqTK5g63qhpDfVCeMRm1Y7jjdjXv0At7YU/7ne9GuQ3i7iXr93s+elmYYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685030284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kD+XFrcNzFnrl0biEnmlJqfzlDEqiPjVowvv7DjPzD0=; b=UP3dklmtJ4Q4VV1xG95F7K545H/g3SVJ+30iFPqsE2+v3FN5a33iBt9z4bVuGtySn+to06 rN24NhhD79NJMoF4qldGJokrLA6NxAWfyx+8HqtnUfZzrV7rvdSoipLIyoa5buyIv83A46 U18DJkTyZpH4TvR+lazZqnjF8mFxZhtzv69TbQZH4rF/uEbFNPeKF7rE0b5K4ZORIuRqfr Ftk/3kDZ7B4F5qp5OJh2ihudF/XQJysYtgMqIKniBuZs2Bz2fza0aBf1GYuOL4MUBgifSr GNQHT4RA4bfC/CVTo5CbZJc/BM5XCuBgpmD6Jqko02l5F25tyxnjqyIWGaENZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685030284; a=rsa-sha256; cv=none; b=VLR1eN4O7kJFYvgi316zTLi46XkYkiZL2io4V+SmrOqVlZT3UcIPjDFJZQeanvrxX27OKW BZ+jNRdHwv4+QVWALl5s3eGW5snCmBYc+HgzM2IB2YIhWmnTAZx7AE33K4gJ8exPLjqHdi u6VFVIbT2rjQiepjsjgrMTvusnR2JuJW7MJrZ2DWdz5RmpkvD21is8YnTHbVfb3xWC5eB9 FmgfHcCnN2bgVeWOj/jeuyVYefqxXhMJJ+Jc0BrkhKCihEmM4yxzMLBXXmZ8eyHso72cNi hRXKbM2Ivrjt7blxXBud9uA8dSGWoZWahJ37dJHEKEdz+Ey65jQRf62KC7gD6g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRt4W6y60zWKW; Thu, 25 May 2023 15: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 34PFw3XC011489; Thu, 25 May 2023 15: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 34PFw36A011488; Thu, 25 May 2023 15:58:03 GMT (envelope-from git) Date: Thu, 25 May 2023 15:58:03 GMT Message-Id: <202305251558.34PFw36A011488@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Stefan=20E=C3=9Fer?= Subject: git: 76238846ad3e - main - contrib/bc: upgrade to version 6.6.0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 76238846ad3e9e271a3d1f792f72beab727fd153 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=76238846ad3e9e271a3d1f792f72beab727fd153 commit 76238846ad3e9e271a3d1f792f72beab727fd153 Author: Stefan Eßer AuthorDate: 2023-05-25 15:55:31 +0000 Commit: Stefan Eßer CommitDate: 2023-05-25 15:55:31 +0000 contrib/bc: upgrade to version 6.6.0 This update removes printing of a leading zero in scientific or engineering output modes (which are an extended feature of this implementation). (cherry-picked from commit 8b83ef067441f6d3a4a55e92d1738724954a057c) MFC after: 2 weeks --- contrib/bc/LICENSE.md | 2 +- contrib/bc/Makefile.in | 2 +- contrib/bc/NEWS.md | 12 ++ contrib/bc/README.md | 18 +- contrib/bc/configure.sh | 32 +++- contrib/bc/include/num.h | 8 + contrib/bc/include/status.h | 7 + contrib/bc/include/version.h | 2 +- contrib/bc/src/num.c | 83 ++++++-- contrib/bc/src/program.c | 15 +- contrib/bc/src/rand.c | 5 +- contrib/bc/tests/bc/all.txt | 1 + contrib/bc/tests/bc/rand_limits.txt | 284 ++++++++++++++++++++++++++++ contrib/bc/tests/bc/rand_limits_results.txt | 222 ++++++++++++++++++++++ contrib/bc/tests/extra_required.txt | 1 + contrib/bc/tests/script.sh | 14 +- 16 files changed, 674 insertions(+), 34 deletions(-) diff --git a/contrib/bc/LICENSE.md b/contrib/bc/LICENSE.md index b65095edc26c..74441065df35 100644 --- a/contrib/bc/LICENSE.md +++ b/contrib/bc/LICENSE.md @@ -59,7 +59,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The files `src/rand.c` and `include/rand.h` are under the following copyrights and license: -Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors +Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors
Copyright (c) 2018-2023 Gavin D. Howard Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/contrib/bc/Makefile.in b/contrib/bc/Makefile.in index f936fc2c6de6..55e2e4a6270a 100644 --- a/contrib/bc/Makefile.in +++ b/contrib/bc/Makefile.in @@ -205,7 +205,7 @@ DC_DEFS = $(DC_DEFS1) $(DC_DEFS2) $(DC_DEFS3) $(DC_DEFS4) $(DC_DEFS5) CPPFLAGS1 = -D$(BC_ENABLED_NAME)=$(BC_ENABLED) -D$(DC_ENABLED_NAME)=$(DC_ENABLED) CPPFLAGS2 = $(CPPFLAGS1) -I$(INCDIR)/ -DBUILD_TYPE=$(BC_BUILD_TYPE) %%LONG_BIT_DEFINE%% CPPFLAGS3 = $(CPPFLAGS2) -DEXECPREFIX=$(EXEC_PREFIX) -DMAINEXEC=$(MAIN_EXEC) -CPPFLAGS4 = $(CPPFLAGS3) %%BSD%% +CPPFLAGS4 = $(CPPFLAGS3) %%BSD%% %%APPLE%% CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN) CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS) CPPFLAGS7 = $(CPPFLAGS6) -D$(BC_ENABLE_EXTRA_MATH_NAME)=$(BC_ENABLE_EXTRA_MATH) diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index 44b17b060f5c..de3b35026fea 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,17 @@ # News +## 6.6.0 + +This is a production release with two bug fixes and one change. + +The first bug fix is to fix the build on Mac OSX. + +The second bug was to remove printing a leading zero in scientific or +engineering output modes. + +The change was that the implementation of `irand()` was improved to call the +PRNG less. + ## 6.5.0 This is a production release that fixes an infinite loop bug in `root()` and diff --git a/contrib/bc/README.md b/contrib/bc/README.md index 9d395f747185..943ca89eee2c 100644 --- a/contrib/bc/README.md +++ b/contrib/bc/README.md @@ -422,13 +422,23 @@ Other projects based on this bc are: * [busybox `bc`][8]. The busybox maintainers have made their own changes, so any bugs in the busybox `bc` should be reported to them. - * [toybox `bc`][9]. The maintainer has also made his own changes, so bugs in the toybox `bc` should be reported there. - * [FreeBSD `bc`][23]. While the `bc` in FreeBSD is kept up-to-date, it is better to [report bugs there][24], as well as [submit patches][25], and the maintainers of the package will contact me if necessary. +* [Mac OSX `bc`][35]. Any bugs in that `bc` should be reported to me, but do + expect bugs because the version is old. +* [Android Open Source `bc`][32]. Any bugs in that `bc` can be reported here. + +This is a non-comprehensive list of Linux distros that use this `bc` as the +system `bc`: + +* [Gentoo][33]; it is a first-class alternative to GNU `bc`, but not exclusive. +* [Linux from Scratch][34]. + +Other Linux distros package it as a second-class alternative, usually as `bc-gh` +or `howard-bc`. ## Language @@ -500,3 +510,7 @@ Folders: [29]: https://github.com/gavinhoward/bc [30]: ./manuals/bc/A.1.md#extended-library [31]: ./manuals/build.md#settings +[32]: https://android.googlesource.com/platform/external/bc/ +[33]: https://github.com/gentoo/gentoo/blob/master/app-alternatives/bc/bc-0.ebuild#L8 +[34]: https://www.linuxfromscratch.org/lfs/view/stable/chapter08/bc.html +[35]: https://github.com/apple-oss-distributions/bc/tree/main/bc diff --git a/contrib/bc/configure.sh b/contrib/bc/configure.sh index 021d30807ffb..4ba957131d52 100755 --- a/contrib/bc/configure.sh +++ b/contrib/bc/configure.sh @@ -772,7 +772,7 @@ predefined_build() { dc_default_digit_clamp=0;; GDH) - CFLAGS="-flto -Weverything -Wno-padded -Werror -pedantic -std=c11" + CFLAGS="-flto -Weverything -Wno-padded -Wno-unsafe-buffer-usage -Werror -pedantic -std=c11" bc_only=0 dc_only=0 coverage=0 @@ -806,7 +806,7 @@ predefined_build() { dc_default_digit_clamp=1;; DBG) - CFLAGS="-Weverything -Wno-padded -Werror -pedantic -std=c11" + CFLAGS="-Weverything -Wno-padded -Wno-unsafe-buffer-usage -Werror -pedantic -std=c11" bc_only=0 dc_only=0 coverage=0 @@ -1653,12 +1653,12 @@ else # We are also setting the CFLAGS and LDFLAGS here. if [ "$editline" -ne 0 ]; then LDFLAGS="$LDFLAGS -ledit" - CFLAGS="$CFLAGS -DBC_ENABLE_EDITLINE=1 -DBC_ENABLE_READLINE=0" + CPPFLAGS="$CPPFLAGS -DBC_ENABLE_EDITLINE=1 -DBC_ENABLE_READLINE=0" elif [ "$readline" -ne 0 ]; then LDFLAGS="$LDFLAGS -lreadline" - CFLAGS="$CFLAGS -DBC_ENABLE_EDITLINE=0 -DBC_ENABLE_READLINE=1" + CPPFLAGS="$CPPFLAGS -DBC_ENABLE_EDITLINE=0 -DBC_ENABLE_READLINE=1" else - CFLAGS="$CFLAGS -DBC_ENABLE_EDITLINE=0 -DBC_ENABLE_READLINE=0" + CPPFLAGS="$CPPFLAGS -DBC_ENABLE_EDITLINE=0 -DBC_ENABLE_READLINE=0" fi fi @@ -1682,6 +1682,24 @@ else CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700" fi +# Test Mac OSX. This is not in an if statement because regardless of whatever +# the user says, we need to know if we are on Mac OSX. If we are, we have to set +# _DARWIN_C_SOURCE. +printf 'Testing for Mac OSX...\n' + +flags="-DBC_TEST_APPLE -DBC_ENABLE_AFL=0" +"$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/src/vm.c" > /dev/null 2>&1 + +err="$?" + +if [ "$err" -ne 0 ]; then + printf 'On Mac OSX. Using _DARWIN_C_SOURCE.\n\n' + apple="-D_DARWIN_C_SOURCE" +else + printf 'Not on Mac OSX.\n\n' + apple="" +fi + # Test OpenBSD. This is not in an if statement because regardless of whatever # the user says, we need to know if we are on OpenBSD to activate _BSD_SOURCE. # No, I cannot `#define _BSD_SOURCE` in a header because OpenBSD's patched GCC @@ -1690,7 +1708,6 @@ fi # we have to set it because we also set _POSIX_C_SOURCE, which OpenBSD headers # detect, and when they detect it, they turn off _BSD_SOURCE unless it is # specifically requested. -set +e printf 'Testing for OpenBSD...\n' flags="-DBC_TEST_OPENBSD -DBC_ENABLE_AFL=0" @@ -1713,6 +1730,8 @@ else bsd="" fi +set -e + if [ "$library" -eq 1 ]; then bc_lib="" fi @@ -2072,6 +2091,7 @@ contents=$(replace "$contents" "CLEAN_PREREQS" "$CLEAN_PREREQS") contents=$(replace "$contents" "GEN_EMU" "$GEN_EMU") contents=$(replace "$contents" "BSD" "$bsd") +contents=$(replace "$contents" "APPLE" "$apple") contents=$(replace "$contents" "BC_DEFAULT_BANNER" "$bc_default_banner") contents=$(replace "$contents" "BC_DEFAULT_SIGINT_RESET" "$bc_default_sigint_reset") diff --git a/contrib/bc/include/num.h b/contrib/bc/include/num.h index 8078809250f8..d24c206cbe51 100644 --- a/contrib/bc/include/num.h +++ b/contrib/bc/include/num.h @@ -71,6 +71,10 @@ typedef BclBigDig BcBigDig; /// An alias for portability. #define BC_NUM_BIGDIG_C UINT64_C +/// The max number + 1 that two limbs can hold. This is used for generating +/// numbers because the PRNG can generate a number that will fill two limbs. +#define BC_BASE_RAND_POW (BC_NUM_BIGDIG_C(1000000000000000000)) + /// The actual limb type. typedef int_least32_t BcDig; @@ -88,6 +92,10 @@ typedef int_least32_t BcDig; /// An alias for portability. #define BC_NUM_BIGDIG_C UINT32_C +/// The max number + 1 that two limbs can hold. This is used for generating +/// numbers because the PRNG can generate a number that will fill two limbs. +#define BC_BASE_RAND_POW (UINT64_C(100000000)) + /// The actual limb type. typedef int_least16_t BcDig; diff --git a/contrib/bc/include/status.h b/contrib/bc/include/status.h index 198cf5704a57..242514edb476 100644 --- a/contrib/bc/include/status.h +++ b/contrib/bc/include/status.h @@ -60,6 +60,13 @@ #endif // __FreeBSD__ #endif // BC_TEST_FREEBSD +// This is used by configure.sh to test for Mac OSX. +#ifdef BC_TEST_APPLE +#ifdef __APPLE__ +#error On Mac OSX without _DARWIN_C_SOURCE +#endif // __APPLE__ +#endif // BC_TEST_APPLE + // Windows has deprecated isatty() and the rest of these. Or doesn't have them. // So these are just fixes for Windows. #ifdef _WIN32 diff --git a/contrib/bc/include/version.h b/contrib/bc/include/version.h index daa1977c3cb6..a4df383e284a 100644 --- a/contrib/bc/include/version.h +++ b/contrib/bc/include/version.h @@ -37,6 +37,6 @@ #define BC_VERSION_H /// The current version. -#define VERSION 6.5.0 +#define VERSION 6.6.0 #endif // BC_VERSION_H diff --git a/contrib/bc/src/num.c b/contrib/bc/src/num.c index 8f70c6a409d1..0a59707268df 100644 --- a/contrib/bc/src/num.c +++ b/contrib/bc/src/num.c @@ -3515,8 +3515,9 @@ bc_num_print(BcNum* restrict n, BcBigDig base, bool newline) // Print the sign. if (BC_NUM_NEG(n)) bc_num_putchar('-', true); - // Print the leading zero if necessary. - if (BC_Z && BC_NUM_RDX_VAL(n) == n->len) + // Print the leading zero if necessary. We don't print when using + // scientific or engineering modes. + if (BC_Z && BC_NUM_RDX_VAL(n) == n->len && base != 0 && base != 1) { bc_num_printHex(0, 1, false, !newline); } @@ -3815,7 +3816,7 @@ void bc_num_irand(BcNum* restrict a, BcNum* restrict b, BcRNG* restrict rng) { BcNum atemp; - size_t i, len; + size_t i; assert(a != b); @@ -3835,24 +3836,76 @@ bc_num_irand(BcNum* restrict a, BcNum* restrict b, BcRNG* restrict rng) assert(atemp.num != NULL); assert(atemp.len); - len = atemp.len - 1; + if (atemp.len > 2) + { + size_t len; + + len = atemp.len - 2; - // Just generate a random number for each limb. - for (i = 0; i < len; ++i) + // Just generate a random number for each limb. + for (i = 0; i < len; i += 2) + { + BcRand dig; + + dig = bc_rand_bounded(rng, BC_BASE_RAND_POW); + + b->num[i] = (BcDig) (dig % BC_BASE_POW); + b->num[i + 1] = (BcDig) (dig / BC_BASE_POW); + } + } + else { - b->num[i] = (BcDig) bc_rand_bounded(rng, BC_BASE_POW); + // We need this set. + i = 0; } - // Do the last digit explicitly because the bound must be right. But only - // do it if the limb does not equal 1. If it does, we have already hit the - // limit. - if (atemp.num[i] != 1) + // This will be true if there's one full limb after the two limb groups. + if (i == atemp.len - 2) { - b->num[i] = (BcDig) bc_rand_bounded(rng, (BcRand) atemp.num[i]); - b->len = atemp.len; + // Increment this for easy use. + i += 1; + + // If the last digit is not one, we need to set a bound for it + // explicitly. Since there's still an empty limb, we need to fill that. + if (atemp.num[i] != 1) + { + BcRand dig; + BcRand bound; + + // Set the bound to the bound of the last limb times the amount + // needed to fill the second-to-last limb as well. + bound = ((BcRand) atemp.num[i]) * BC_BASE_POW; + + dig = bc_rand_bounded(rng, bound); + + // Fill the last two. + b->num[i - 1] = (BcDig) (dig % BC_BASE_POW); + b->num[i] = (BcDig) (dig / BC_BASE_POW); + + // Ensure that the length will be correct. If the last limb is zero, + // then the length needs to be one less than the bound. + b->len = atemp.len - (b->num[i] == 0); + } + // Here the last limb *is* one, which means the last limb does *not* + // need to be filled. Also, the length needs to be one less because the + // last limb is 0. + else + { + b->num[i - 1] = (BcDig) bc_rand_bounded(rng, BC_BASE_POW); + b->len = atemp.len - 1; + } + } + // Here, there is only one limb to fill. + else + { + // See above for how this works. + if (atemp.num[i] != 1) + { + b->num[i] = (BcDig) bc_rand_bounded(rng, (BcRand) atemp.num[i]); + b->len = atemp.len - (b->num[i] == 0); + } + else b->len = atemp.len - 1; } - // We want 1 less len in the case where we skip the last limb. - else b->len = len; bc_num_clean(b); diff --git a/contrib/bc/src/program.c b/contrib/bc/src/program.c index 243f827fe98c..2f26589166e3 100644 --- a/contrib/bc/src/program.c +++ b/contrib/bc/src/program.c @@ -2703,12 +2703,21 @@ bc_program_globalSetting(BcProgram* p, uchar inst) assert(inst >= BC_INST_LINE_LENGTH && inst <= BC_INST_LEADING_ZERO); #endif // DC_ENABLED - if (inst == BC_INST_LINE_LENGTH) val = (BcBigDig) vm->line_len; + if (inst == BC_INST_LINE_LENGTH) + { + val = (BcBigDig) vm->line_len; + } #if BC_ENABLED - else if (inst == BC_INST_GLOBAL_STACKS) val = (BC_G != 0); + else if (inst == BC_INST_GLOBAL_STACKS) + { + val = (BC_G != 0); + } #endif // BC_ENABLED #if DC_ENABLED - else if (inst == BC_INST_EXTENDED_REGISTERS) val = (DC_X != 0); + else if (inst == BC_INST_EXTENDED_REGISTERS) + { + val = (DC_X != 0); + } #endif // DC_ENABLED else val = (BC_Z != 0); diff --git a/contrib/bc/src/rand.c b/contrib/bc/src/rand.c index 11c22cd507c3..560e494214ad 100644 --- a/contrib/bc/src/rand.c +++ b/contrib/bc/src/rand.c @@ -517,8 +517,11 @@ bc_rand_int(BcRNG* r) BcRand bc_rand_bounded(BcRNG* r, BcRand bound) { + BcRand rand; + BcRand threshold; + // Calculate the threshold below which we have to try again. - BcRand rand, threshold = (0 - bound) % bound; + threshold = (0 - bound) % bound; do { diff --git a/contrib/bc/tests/bc/all.txt b/contrib/bc/tests/bc/all.txt index 3d0ea05ba7c0..c710534aac1b 100644 --- a/contrib/bc/tests/bc/all.txt +++ b/contrib/bc/tests/bc/all.txt @@ -47,6 +47,7 @@ misc7 misc8 void rand +rand_limits recursive_arrays divmod modexp diff --git a/contrib/bc/tests/bc/rand_limits.txt b/contrib/bc/tests/bc/rand_limits.txt new file mode 100644 index 000000000000..9f6848739e3b --- /dev/null +++ b/contrib/bc/tests/bc/rand_limits.txt @@ -0,0 +1,284 @@ +seed = 12183415694832323910165063565742029266.78201143488173352403523006\ + 17939450703787369504276248076613097826033345478457018711188931947\ + 5643844725709641352295875549316406250 + +if (maxrand() >= 2^64 - 1) { + + for (i = 1; i <= 37; ++i) + { + irand(10^i) + } + + 1 + 77 + 914 + 8200 + 44887 + 866441 + 2358358 + 13559535 + 416767986 + 9276295152 + 89383616490 + 954770306600 + 8117340260822 + 90441255304792 + 123091484400148 + 673234816385761 + 33144762500773628 + 741775860680476044 + 4715856253932519349 + 44722685516799788803 + 691627564627043533689 + 3601367765145373281202 + 27535154823004408648947 + 51478009115008961612866 + 4031778740698066425486191 + 95653217339584215257144674 + 426302455455598639876532628 + 1216686741117783240797844143 + 17705719185928989853748208134 + 784851648926334033332776172502 + 3120413811981279690501349408357 + 38214388551463331616358091659583 + 720453131307667144268209805308554 + 8939221360785849706894139937864130 + 10262211588802126422696984407808741 + 267283013443362846268603285132432016 + 2034014520976339794036584994364919660 +} +else { + + 5 + 15 + 701 + 8215 + 98794 + 602366 + 2027255 + 74687524 + 830825144 + 6081336208 + 24314055735 + 838559932276 + 6866719060925 + 36806875401211 + 406827598340727 + 5356006452532004 + 38220052834497507 + 337361587138720056 + 1181974760686154481 + 16008532535003488966 + 951908092544652236970 + 90730737551380302703 + 46492092840194767743061 + 188697840939074129889664 + 3963332393372745718515074 + 78044317381361304314479194 + 257814131633376797403093774 + 5383100889234097635148206308 + 39812361752905775691804497289 + 222434065196674291290714932718 + 4942298796724199168854529657788 + 30804146383811856719866376789543 + 817977187096950760817419359822004 + 922359768927341898905002631901715 + 84002847212517205019842390182209654 + 423700247670879534125867432896848815 + 982360002329187383971171836321012954 + + for (i = 1; i <= 37; ++i) + { + irand(10^i) + } +} + +seed = 12183415694832323910165063565742029266.82951754507405817776622978\ + 09630984098584076072986006731059784797092101840727292180396879039\ + 9608224106486886739730834960937500000 + +if (maxrand() >= 2^64 - 1) { + + for (i = 1; i <= 37; ++i) + { + irand(10^i) + } + + 9 + 84 + 802 + 9765 + 80115 + 246589 + 4463508 + 85992729 + 977135 + 4189279533 + 68755431294 + 107950335674 + 9675253977558 + 87867459318681 + 801765066192715 + 2162649050595056 + 2892195376814570 + 134060417012729962 + 7176764836888537721 + 5273685153052366176 + 461774434438273613889 + 152344588818260411506 + 11709967193759556155964 + 533206453770793013516792 + 2511508581949736433569969 + 1573162243991468106989339 + 215826582488545888127004159 + 1480805837640270183994742134 + 61049958584446767740466194227 + 145231395106326027295263107581 + 7023255505921253691380349839502 + 48606431941187693512006850149822 + 87214859605659588002413450479944 + 7949773868584392220935704452065706 + 4544031206641768922348422844031232 + 37285268346623956247142903563298469 + 696722030777467416877847444483018982 +} +else { + + 9 + 73 + 468 + 1781 + 79556 + 166610 + 9336284 + 96403025 + 23318279 + 1074901232 + 30659049590 + 125915951725 + 3123436435684 + 52610031172756 + 445020218860038 + 87520306151384 + 47213087211849485 + 154045322058555704 + 9488624282418036451 + 12849313140308039019 + 828063328914872193931 + 2956454855398834052902 + 87417046449320418408586 + 165187095179884370295407 + 3602892678245454556711806 + 88079064510429999588220544 + 376741359503002189591164726 + 56633499559885161310029862 + 11172900796387700171428233596 + 473873806840427957175182603343 + 824290276873152640168308384248 + 36092351141101218267245025967581 + 39973475177812910298579659860850 + 7364670182480566996610562443888661 + 51592684301602944329896812066058114 + 951444349069518195584787848316744461 + 3234933598293500107173129970384252570 + + for (i = 1; i <= 37; ++i) + { + irand(10^i) + } +} + +seed = 149423560533592712773538909996244073918.2952752612544959208642520\ + 06505634103779572918483064082477106507620297186161725006312917321\ + 53815843275879160501062870025634765625 + +if (maxrand() >= 2^64 - 1) { + + for (i = 1; i <= 37; ++i) + { + irand(10^i) + } + + 0 + 94 + 825 + 907 + 62512 + 633399 + 3539412 + 65712557 + 329618801 + 9052319971 + 50117657456 + 719515050973 + 396081658001 + 98762199564287 + 537857673363391 + 5701380917944903 + 16144997029797264 + 918603142053856533 + 4437053492025674148 + 76125560050255946142 + 262504846798815931770 + 688599520356200914010 + 77509440962809216890090 + 889672321539369676198789 + 5795540531885308263478299 + 88374255397211092706329509 + 118231692173643319720953958 + 6218036129497143746927154520 + 3236727278542723274070894570 + 72098882691751515204435662053 + 8305331942254135876823981226459 + 33980292322856768815329277766669 + 154632353482145519952015208333866 + 192400848794451940507964192401413 + 69666401739718540927805290639731997 + 545814355378177567662640611917018958 + 4986776343571879972263664198494529846 +} +else { + + 6 + 47 + 709 + 350 + 45155 + 117711 + 6147313 + 26359748 + 56878412 + 930721373 + 47052494689 + 84216331603 + 1874946867051 + 30417072907659 + 157776263741438 + 3325742508233965 + 39500653878059614 + 278676289794009775 + 3342139004245631096 + 63313724143310202591 + 647891168358497623537 + 5925769871143510986759 + 3051401096746445704645 + 761857520743586046415633 + 9077595326394996332524977 + 2159936754163773508122732 + 426809670586105698135317225 + 3294516277260755029991322796 + 14749983115477586453985047494 + 692100641365100970093726483540 + 9502478720578852594268790479747 + 9062487417784678956874793130476 + 352159971921852073191742323073689 + 2270803770328639487517517910897872 + 35166631277333300065883628523569361 + 596441689792333324819903835359197616 + 6933582360405829608479430394981956723 + + for (i = 1; i <= 37; ++i) + { + irand(10^i) + } +} diff --git a/contrib/bc/tests/bc/rand_limits_results.txt b/contrib/bc/tests/bc/rand_limits_results.txt new file mode 100644 index 000000000000..7950429c5e67 --- /dev/null +++ b/contrib/bc/tests/bc/rand_limits_results.txt @@ -0,0 +1,222 @@ +5 +15 +701 +8215 +98794 +602366 +2027255 +74687524 +830825144 +6081336208 +24314055735 +838559932276 +6866719060925 +36806875401211 +406827598340727 +5356006452532004 +38220052834497507 +337361587138720056 +1181974760686154481 +16008532535003488966 +951908092544652236970 +90730737551380302703 +46492092840194767743061 +188697840939074129889664 +3963332393372745718515074 +78044317381361304314479194 +257814131633376797403093774 +5383100889234097635148206308 +39812361752905775691804497289 +222434065196674291290714932718 +4942298796724199168854529657788 +30804146383811856719866376789543 +817977187096950760817419359822004 +922359768927341898905002631901715 +84002847212517205019842390182209654 +423700247670879534125867432896848815 +982360002329187383971171836321012954 +1 +77 +914 +8200 +44887 +866441 +2358358 +13559535 +416767986 +9276295152 +89383616490 +954770306600 +8117340260822 +90441255304792 +123091484400148 +673234816385761 +33144762500773628 +741775860680476044 +4715856253932519349 +44722685516799788803 +691627564627043533689 +3601367765145373281202 +27535154823004408648947 +51478009115008961612866 +4031778740698066425486191 +95653217339584215257144674 +426302455455598639876532628 +1216686741117783240797844143 +17705719185928989853748208134 +784851648926334033332776172502 +3120413811981279690501349408357 +38214388551463331616358091659583 +720453131307667144268209805308554 +8939221360785849706894139937864130 +10262211588802126422696984407808741 +267283013443362846268603285132432016 +2034014520976339794036584994364919660 +9 +73 +468 +1781 +79556 +166610 +9336284 +96403025 +23318279 +1074901232 +30659049590 +125915951725 +3123436435684 +52610031172756 +445020218860038 +87520306151384 +47213087211849485 +154045322058555704 +9488624282418036451 +12849313140308039019 +828063328914872193931 +2956454855398834052902 +87417046449320418408586 +165187095179884370295407 +3602892678245454556711806 +88079064510429999588220544 +376741359503002189591164726 +56633499559885161310029862 +11172900796387700171428233596 +473873806840427957175182603343 +824290276873152640168308384248 +36092351141101218267245025967581 +39973475177812910298579659860850 +7364670182480566996610562443888661 +51592684301602944329896812066058114 +951444349069518195584787848316744461 +3234933598293500107173129970384252570 +9 +84 +802 +9765 +80115 +246589 +4463508 +85992729 +977135 +4189279533 +68755431294 +107950335674 +9675253977558 +87867459318681 +801765066192715 +2162649050595056 +2892195376814570 +134060417012729962 +7176764836888537721 +5273685153052366176 +461774434438273613889 +152344588818260411506 +11709967193759556155964 +533206453770793013516792 +2511508581949736433569969 +1573162243991468106989339 +215826582488545888127004159 +1480805837640270183994742134 +61049958584446767740466194227 +145231395106326027295263107581 +7023255505921253691380349839502 +48606431941187693512006850149822 +87214859605659588002413450479944 +7949773868584392220935704452065706 +4544031206641768922348422844031232 +37285268346623956247142903563298469 +696722030777467416877847444483018982 +6 +47 +709 +350 +45155 +117711 +6147313 +26359748 +56878412 +930721373 +47052494689 +84216331603 +1874946867051 +30417072907659 +157776263741438 +3325742508233965 +39500653878059614 +278676289794009775 +3342139004245631096 +63313724143310202591 +647891168358497623537 +5925769871143510986759 +3051401096746445704645 +761857520743586046415633 +9077595326394996332524977 +2159936754163773508122732 +426809670586105698135317225 +3294516277260755029991322796 +14749983115477586453985047494 +692100641365100970093726483540 +9502478720578852594268790479747 +9062487417784678956874793130476 +352159971921852073191742323073689 +2270803770328639487517517910897872 +35166631277333300065883628523569361 +596441689792333324819903835359197616 +6933582360405829608479430394981956723 +0 +94 +825 +907 +62512 +633399 +3539412 +65712557 +329618801 +9052319971 +50117657456 +719515050973 +396081658001 +98762199564287 +537857673363391 +5701380917944903 +16144997029797264 +918603142053856533 +4437053492025674148 +76125560050255946142 +262504846798815931770 +688599520356200914010 +77509440962809216890090 +889672321539369676198789 +5795540531885308263478299 +88374255397211092706329509 +118231692173643319720953958 +6218036129497143746927154520 +3236727278542723274070894570 +72098882691751515204435662053 +8305331942254135876823981226459 +33980292322856768815329277766669 +154632353482145519952015208333866 +192400848794451940507964192401413 +69666401739718540927805290639731997 +545814355378177567662640611917018958 +4986776343571879972263664198494529846 diff --git a/contrib/bc/tests/extra_required.txt b/contrib/bc/tests/extra_required.txt index c498802ffaea..038e6775d644 100644 --- a/contrib/bc/tests/extra_required.txt +++ b/contrib/bc/tests/extra_required.txt @@ -3,6 +3,7 @@ lib2 fib places rand +rand_limits scientific shift trunc diff --git a/contrib/bc/tests/script.sh b/contrib/bc/tests/script.sh index fef0c5290615..c38cbabe9adc 100755 --- a/contrib/bc/tests/script.sh +++ b/contrib/bc/tests/script.sh @@ -190,11 +190,17 @@ else exit 0 fi - # This sed, and the script, are to remove an incompatibility with GNU bc, - # where GNU bc is wrong. See the development manual - # (manuals/development.md#script-tests) for more information. printf 'Generating %s results...' "$f" - printf '%s\n' "$halt" 2> /dev/null | "$d" "$s" | sed -n -f "$testdir/script.sed" > "$results" + + # This particular test needs to be generated straight. + if [ "$d" = "dc" ] && [ "$f" = "stream.dc" ]; then + printf '%s\n' "$halt" 2> /dev/null | "$d" "$s" > "$results" *** 9 LINES SKIPPED *** From nobody Thu May 25 16:17:07 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRtVW57hwz4V9T9; Thu, 25 May 2023 16:17: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 4QRtVW4NZlz3LCr; Thu, 25 May 2023 16:17:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685031427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HvZwD4AdYwaKvyaDlD/AztSjmd/1VHztrkqVX8dGe7c=; b=eu83MAAp0RNjm9WZVZaiXxSh9ZFBXY21ikJ1X6YcmiZSFHpFJW9c+KKtucVZztR0+DIVSb UVn4X/xeLicpwYgntDJWaH9pmEzj9IdwRBIDRmfMtbvrVGS93o8xBJ+s0GkEf1EsE9r/w1 w8i6IWLAierC10p13U2u3uyI6t3PUw46KmIOMrnNicp0PQaBd8X/Fe/W8Lg1HylxFVsgDu fRKxJOwIgBm4liXg2URPH99x/WKL9pdWDg7U7J03s7ERpg5oy7ZcGwy9W79QTqy4z3nFp1 +65NmB/N0UW78VZPmZGWTki4ExKrjizUzDXRm7DC+ka9s05QK38YT5YMa9Y1fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685031427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HvZwD4AdYwaKvyaDlD/AztSjmd/1VHztrkqVX8dGe7c=; b=E5IAGvAJE8kbwNsFLVdTjctBd16Hv3C0X6bgfJcu3+2+fS1hQLN//8GgZHPDNFpxvG+sCc nGiqYEVzLkrUYINv8TO+bJv0bEVxraPjKpzJ8YkMpGgDsvNJfRoOWY+CKB5vNLBIuF72V8 Q7RsjhOQjEZ88q4r57R0VM5pRtmAaPLlQBIkAaWVDpiCOLZU6N7/VJmcHjb/nx/Jy0+Mvj JMmOZlZA1EzhyhmW/XJcGBH4oL3dGZaG5SI3hfMfAyicOn0pJ4/weY14G4VAbzkYBWbrD6 SZEK5UblCCoEkfZGNoBbkGQhtQys3vkHsjYC60DdPqKZhbTsSMzBf4Vnf0rZzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685031427; a=rsa-sha256; cv=none; b=uuE+3AzZPHZZpyYZDlYwJXs5Qp3O2h300lDfs4Gf8oHG7pxnZHh5pj1yE6qI+jgqq4Sj+k Gg/CXm6hUOBZl6oYw9rhgGQhgXHU5NpSzTXri1uWMf3tB15JZBW2bSnbR6nGYuayo68Lgx UzlCCg2ntUlluWnBW9hNfMbVFgQbfniZuCEex8EHuB0JCERo2XGBGEVScCc7oLWGZhTxgL tm2XqpeY5YZUkMd13GNCxZwEwdAkMcT3QCCNuvWMBy0LgaslEjsePTxg/e+ozM1oDFHne0 AKoTjQthZnXWgCXPDBwWw8SL+WcLhD+DLPyFrIbr0NKxkeaVaBKSfjfxe7FeHw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRtVW3Rl4zWv4; Thu, 25 May 2023 16:17: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 34PGH7P6045161; Thu, 25 May 2023 16:17:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PGH7iq045160; Thu, 25 May 2023 16:17:07 GMT (envelope-from git) Date: Thu, 25 May 2023 16:17:07 GMT Message-Id: <202305251617.34PGH7iq045160@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 555b62e1c8ec - main - less: Re-enable -Wdeprecated-non-prototype warnings. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 555b62e1c8ecf718b4fe5282457b8543cc1b8d99 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=555b62e1c8ecf718b4fe5282457b8543cc1b8d99 commit 555b62e1c8ecf718b4fe5282457b8543cc1b8d99 Author: John Baldwin AuthorDate: 2023-05-25 16:16:20 +0000 Commit: John Baldwin CommitDate: 2023-05-25 16:16:20 +0000 less: Re-enable -Wdeprecated-non-prototype warnings. These were fixed in the most recent update to contrib/less. --- usr.bin/less/Makefile | 2 -- usr.bin/lessecho/Makefile | 2 -- usr.bin/lesskey/Makefile | 2 -- 3 files changed, 6 deletions(-) diff --git a/usr.bin/less/Makefile b/usr.bin/less/Makefile index c55ce3581cbf..27415573a8ee 100644 --- a/usr.bin/less/Makefile +++ b/usr.bin/less/Makefile @@ -21,5 +21,3 @@ CLEANFILES= less.1 .include "Makefile.common" .include - -CWARNFLAGS+= ${NO_WDEPRECATED_NON_PROTOTYPE} diff --git a/usr.bin/lessecho/Makefile b/usr.bin/lessecho/Makefile index 0d40cc209548..af0a7c1550ab 100644 --- a/usr.bin/lessecho/Makefile +++ b/usr.bin/lessecho/Makefile @@ -6,5 +6,3 @@ CLEANFILES= lessecho.1 .include "${SRCTOP}/usr.bin/less/Makefile.common" .include - -CWARNFLAGS+= ${NO_WDEPRECATED_NON_PROTOTYPE} diff --git a/usr.bin/lesskey/Makefile b/usr.bin/lesskey/Makefile index 6809d9dba124..4677e7c7e6c7 100644 --- a/usr.bin/lesskey/Makefile +++ b/usr.bin/lesskey/Makefile @@ -6,5 +6,3 @@ CLEANFILES= lesskey.1 .include "${SRCTOP}/usr.bin/less/Makefile.common" .include - -CWARNFLAGS+= ${NO_WDEPRECATED_NON_PROTOTYPE} From nobody Thu May 25 16:22:06 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRtcG2VYPz4V9XK; Thu, 25 May 2023 16: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 4QRtcG22jzz3MBB; Thu, 25 May 2023 16: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=1685031726; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cbpQ6kaqXY+WWayoX4aFUIbGWLc+tDXTRGEBs5Px46s=; b=r+cFGs/lrqAIR7HD2jZo4rSTs7YePIRiDXhU4aAwacqYe2Ze4FHCQ7TqtHDnPN4tHzc5bs ap3RucJ71MB3iFvt1U+BnoVY/smZQK3qYqs18guXmEdMu+gbN1rIup4GPLRblxpSiH7Ewz L6lBhE68fR2Z961h6Ff1wv1Z1HM9xjPR6IU/MkHsPmePxXRoeaSU0DnHlMgS23aPc3Y0L4 Ct5STTIAEfok6obv0bofCZcNa9yZ178R8R0cuWZ1pcdOdhNas7AwgIWpe22zTwZ7AxpDok DbDIbcjJ24dm17QOzL0FXt7clRtx7vRRCEsrcFIrlElLq6PbZGVbbCJDmbOmZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685031726; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cbpQ6kaqXY+WWayoX4aFUIbGWLc+tDXTRGEBs5Px46s=; b=irPTPiaqbulZpRqYTVp22tnTNZs7ADoJPc9qf0zQvJDCMOcXkLHC7n7L5P2zY33CFCDg6t DhLS/G8OWy9Yjcx8ynF+gQMa5wdEX2CAMYlttWtHWsjPX78I9OJhBtTi1uvVCUSLSCsrnX 6dwojih2cQgKSekIhjvj4BhtIsdGxL5x6UKBThXWHvvA9tUPBRcfk0jIRxZU5juC69rxVO jjKkW9iW+TsAY5HF1gCs3VvGae1uAc4RnyrWfLf1exJlLhrDIrmrCgl1s901e6fq3tbR7B oznHEPmnQYyBteRS7R6rwd+WHOzJ38skmq+NHOmZKsMx3cpW3LrsB3zcvdMUPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685031726; a=rsa-sha256; cv=none; b=i/PR4mMpQ3Tv0jFmieM3pUjejmvhPwGbGFwfZR0H99+DtXQQTE7iyQ0OZ9iLqeejrJUfxC dUwZg/7Yr1n1FTym1wROYSNBTuHVQdIFIyoPodJBxG9OWQt6FpFKcpqe1jPG+RnkPLFlHZ ThZ34S2wtSxUZpHBG9Kc4kw8ryIVX5gVo0MCuXFw5BJoECCuO0bPUOG2jGzbpYoDiQNSjn yFiRTiy3b/jFb74GLvPUxALN2amAl7H+CENyQhFivwt7HGVPZhDr5n4tKmZweRswe5/S8o JSFpKsKV4NMOEHD7AI8dKXdVOt5A6e2SLxg475zUnAx4YWy8DvS1o4dBPVWjMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRtcG160rzWvx; Thu, 25 May 2023 16: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 34PGM6qU060354; Thu, 25 May 2023 16: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 34PGM6mN060353; Thu, 25 May 2023 16:22:06 GMT (envelope-from git) Date: Thu, 25 May 2023 16:22:06 GMT Message-Id: <202305251622.34PGM6mN060353@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 01aee8c92d93 - main - libfetch: do not call deprecated OpenSSL functions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 01aee8c92d936470c44821736e0d9e11ed7ce812 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=01aee8c92d936470c44821736e0d9e11ed7ce812 commit 01aee8c92d936470c44821736e0d9e11ed7ce812 Author: Ed Maste AuthorDate: 2023-05-25 15:24:48 +0000 Commit: Ed Maste CommitDate: 2023-05-25 16:20:15 +0000 libfetch: do not call deprecated OpenSSL functions As of OpenSSL 1.1 SSL_library_init() and SSL_load_error_strings() are deprecated. There are replacement initialization functions but they do not need to be called: "As of version 1.1.0 OpenSSL will automatically allocate all resources that it needs so no explicit initialisation is required." Wrap both calls in an OPENSSL_VERSION_NUMBER block. PR: 271615 Reviewed by: Pierre Pronchery Event: Kitchener-Waterloo Hackathon 202305 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40265 --- lib/libfetch/common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c index 7bf487b0db1d..f2122d7f45c9 100644 --- a/lib/libfetch/common.c +++ b/lib/libfetch/common.c @@ -1204,6 +1204,7 @@ fetch_ssl(conn_t *conn, const struct url *URL, int verbose) X509_NAME *name; char *str; +#if OPENSSL_VERSION_NUMBER < 0x10100000L /* Init the SSL library and context */ if (!SSL_library_init()){ fprintf(stderr, "SSL library init failed\n"); @@ -1211,6 +1212,7 @@ fetch_ssl(conn_t *conn, const struct url *URL, int verbose) } SSL_load_error_strings(); +#endif conn->ssl_meth = SSLv23_client_method(); conn->ssl_ctx = SSL_CTX_new(conn->ssl_meth); From nobody Thu May 25 16:49:42 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRvD826qzz4VBw4; Thu, 25 May 2023 16:49:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QRvD81QPZz3hZN; Thu, 25 May 2023 16:49:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685033384; h=from:from:reply-to:subject: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=wjZ9CdjFRrm51CsyAeDyHUoU9xFUERk/O6KF1rmoNaY=; b=pWC1lbtlKWFiX97R6rMKtMDCpZtO4iEddfeDAEfWTd2VOTLjMQ/G2pfqBNFYUFhLQNgidm qrWXbtb0Xq0q284jzTxzyuZ6zQMA0vyAFajJJtJp5oGdFDKVCSeuEv+GQ8V1KfZJHH6pq/ CA2HMxIUMDLVmtCf5pzRrxemmuvJdCFxzGGkPmWLGElunxg96/qBiwii5ucTw7Y6+LFCRe H/FMMXobxv9Ouuj864pSV/UOV14yXtkGRqUnceyhbac3VomsgaHJhaBItka+MFG3dklfoD 2VQNR3TUSnzfXnW9fRMEyAHqsJFTxULhTlWUzp6/dJlbD7Dyk3IsqkLaNn+m/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685033384; h=from:from:reply-to:subject: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=wjZ9CdjFRrm51CsyAeDyHUoU9xFUERk/O6KF1rmoNaY=; b=lKmQ4/hw0+kgiPZCb7SI+YvMbFw5GwTOOHO3aIR0j60QHpVtielrIK0cTNCF1s84HC0thE EZKrKM+oxM/XhobgTvfJYu+sPkCEcIyPS2Vi97W0xx3FJseRnE9iV4ES3JQlXxghekt/KW m6GTWt96E6VFgv5PwQ2ygSslLUC6MMfi0pYaZr0ZYLqpMmUUehplQuyQR/kqltnT6JDx/T /58KDHt4C2WUS3yNMn8hVVwkMAaE0lrbMIBXaSSzV6bMEV6DH7a5+BGYDf/6GU3gcTqrPQ qMdPezIs0RbKYluUi/oH2Img5YM3r/YKp1PkwMHA5ewW+QSr2wh2da333JXewQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685033384; a=rsa-sha256; cv=none; b=KFtTxF7/lnI+gvs3YdYGbyKLY0yz6UH3UaC7D/KaD8IDDJTMkHMMIz36c9pbVmo7ZGVaCA HkWXuI4HzwBScKhANNJeqHIMrLnI8g3AUMsbtRSaKAnvH6IA9Ss0mChWGK1iit7JcmIyCG +gtxXznFKhwpKdiwRHkFu+A71Z23i6TW5ZiDimo2IwzE2P3x0GFS1PYNGvWUem+xUIupCL qGF3fCVDf67WtxfPdL17BGv1pv6gIgRmt72yP8XBLLtF+IsVGDyUhB1AmxureBE7+x/p6x +oegnWKfP9Kt3lPpO0imCRoV8kyge5xuF/8bd9iFV89xtro0fMX2C7k4su00vQ== Received: from [IPV6:2601:648:8680:16b0:90c3:f402:d706:387d] (unknown [IPv6:2601:648:8680:16b0:90c3:f402:d706:387d]) (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 4QRvD74BJKzYcY; Thu, 25 May 2023 16:49:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Thu, 25 May 2023 09:49:42 -0700 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: git: 01aee8c92d93 - main - libfetch: do not call deprecated OpenSSL functions Content-Language: en-US To: Ed Maste , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202305251622.34PGM6mN060353@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202305251622.34PGM6mN060353@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 5/25/23 9:22 AM, Ed Maste wrote: > The branch main has been updated by emaste: > > URL: https://cgit.FreeBSD.org/src/commit/?id=01aee8c92d936470c44821736e0d9e11ed7ce812 > > commit 01aee8c92d936470c44821736e0d9e11ed7ce812 > Author: Ed Maste > AuthorDate: 2023-05-25 15:24:48 +0000 > Commit: Ed Maste > CommitDate: 2023-05-25 16:20:15 +0000 > > libfetch: do not call deprecated OpenSSL functions > > As of OpenSSL 1.1 SSL_library_init() and SSL_load_error_strings() are > deprecated. There are replacement initialization functions but they do > not need to be called: "As of version 1.1.0 OpenSSL will automatically > allocate all resources that it needs so no explicit initialisation is > required." > > Wrap both calls in an OPENSSL_VERSION_NUMBER block. > > PR: 271615 > Reviewed by: Pierre Pronchery > Event: Kitchener-Waterloo Hackathon 202305 > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D40265 > --- > lib/libfetch/common.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c > index 7bf487b0db1d..f2122d7f45c9 100644 > --- a/lib/libfetch/common.c > +++ b/lib/libfetch/common.c > @@ -1204,6 +1204,7 @@ fetch_ssl(conn_t *conn, const struct url *URL, int verbose) > X509_NAME *name; > char *str; > > +#if OPENSSL_VERSION_NUMBER < 0x10100000L > /* Init the SSL library and context */ > if (!SSL_library_init()){ > fprintf(stderr, "SSL library init failed\n"); > @@ -1211,6 +1212,7 @@ fetch_ssl(conn_t *conn, const struct url *URL, int verbose) > } > > SSL_load_error_strings(); > +#endif Should we just remove this code outright? I don't think there's any value in supporting pre-1.1 OpenSSL versions? -- John Baldwin From nobody Thu May 25 17:06:32 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRvbX3N4vz4WS7w; Thu, 25 May 2023 17:06: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 4QRvbX2rYXz3kPj; Thu, 25 May 2023 17:06:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685034392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sWWW4iyZThV+f6/RELWDGrl07HIPF7F/5tvgMQZdwAc=; b=tDc4Gdt4Wk9iGcT1o3lcPuTbi3c6I6vBicw6UTOV/OOHQhr6/j7POWuFlWw/fGW6q2Y1/s BnHeNECeBrZP2ETMl8wxJcds16nxBSqIFu4DQxiTNsm/RejnZN5CBd1l2YXiKv5xZVFWBi yCmommbECKejAmCc0W8aaYRMoKY8J1468kTSsOYVaXFGjGPD8FCazNJCoc1JNPBmgPOTbC 8MFa+XbZVP/HutBn7oK2XAXQFVFHDZCllkSUsKmLQwF05jTPo8C0zZm8FGnpPvOUqk1/Vs L2xPj0upRrhKo0qTwX/RsFvk5OJ1YNq10SK8sen5iePY8pzn/lvHP11icl2lsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685034392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sWWW4iyZThV+f6/RELWDGrl07HIPF7F/5tvgMQZdwAc=; b=yH1t3LVx1HAu72zeW2z24ccfBxDBvJBD7oOKESDv8e96ppPVikOT0QGpyqBZUkQcZjLaJF j4ZBVwHIXzAV44CbaxWGxeSkw373EsNIfO6sHt4P9UNDrilefKPIkNpvrOZcBz93pYEkuT nPL5qzEuN8Cp+NeCFit5+blnAvzrGxSPSLUQ/hgC9SmMOcgxpTcp8qUVbzu3EXVyFB99Ud Gbtt6ruCAnvV7r7uxrkzPSzNyBwzLCoGrw0aKhLPgdtB+TWoE2oYpUcwOVVhihQQR84Hsz HIbfWKPUEWcu518tF3m5dU/Ch3juzZanGz4R4oATyV4O5bW3tR+meeFn6E7lbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685034392; a=rsa-sha256; cv=none; b=vR5osmTtuAfL3N1NNJT49JRT1nCrLl1jVkeeA5yF8VvuwFUHUGDAJERkXiSEN3MyBloq0Y uhoeB9QhslLZ3V+3xf7PDdUX8m/fjmC9LbaAux4oPGyGvtB5dObYqPh7NenSZCHuu5P0st pMLgtIhBps6nDwWuBk/4k6OQHlMoEH/RG6bcRiiuWVxCWf4+iImjksAaUehDSOttIYbKyu wIsw4Utdd9QDwTzkWy8yfoiJgQUq8MTLGVGMkbjgbVcjbxiNMRcOrholyxY7sBo5uB3H8h weYB9V6+H7/M4cCzjwglLfNHueNGm+VDNYDsruVOkQdz8bUv4npkiiiCPrYzIQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRvbX1wrfzY7K; Thu, 25 May 2023 17:06:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34PH6WAq028000; Thu, 25 May 2023 17:06:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PH6WAf027999; Thu, 25 May 2023 17:06:32 GMT (envelope-from git) Date: Thu, 25 May 2023 17:06:32 GMT Message-Id: <202305251706.34PH6WAf027999@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 8a852d3e9ff7 - main - arm64/disassem.c: Make output lowercase List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8a852d3e9ff7c4d6f93b65beba8d674127109fc4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=8a852d3e9ff7c4d6f93b65beba8d674127109fc4 commit 8a852d3e9ff7c4d6f93b65beba8d674127109fc4 Author: Mykola Hohsadze AuthorDate: 2023-05-25 14:40:38 +0000 Commit: Mitchell Horne CommitDate: 2023-05-25 17:06:15 +0000 arm64/disassem.c: Make output lowercase Update the few uppercase fields fields to be consistent with others. Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D39820 --- sys/arm64/arm64/disassem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/disassem.c b/sys/arm64/arm64/disassem.c index 9db4ea040d37..2ec0d04d5491 100644 --- a/sys/arm64/arm64/disassem.c +++ b/sys/arm64/arm64/disassem.c @@ -65,11 +65,11 @@ static const char *x_reg[] = { "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23", - "x24", "x25", "x26", "x27", "x28", "x29", "LR" + "x24", "x25", "x26", "x27", "x28", "x29", "lr" }; static const char *shift_2[] = { - "LSL", "LSR", "ASR", "RSV" + "lsl", "lsr", "asr", "rsv" }; /* @@ -482,7 +482,7 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) if (imm != 0 || shift != 0) di->di_printf(", #0x%x", imm); if (shift != 0) - di->di_printf(" LSL #12"); + di->di_printf(" lsl #12"); } break; case TYPE_02: @@ -576,7 +576,7 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) di->di_printf(", sxtx #%d", amount); break; default: - di->di_printf(", RSVD"); + di->di_printf(", rsv"); break; } di->di_printf("]"); From nobody Thu May 25 17:06:33 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRvbY4bg3z4WS5c; Thu, 25 May 2023 17:06: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 4QRvbY3tF1z3kmp; Thu, 25 May 2023 17:06:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685034393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oLWboI9LFnSgy7tMEYVFs6qNR/yaSfCLL+6Tw39qWfQ=; b=Lla8UQfd9IkIh/FSu+C/auZKHqlNsgP7pg0GtqAl5ogk6nvEnz0g61V+q0Sbr5pFuK7CC8 tZqtukNuar8xEcZ+WwNrauWABdcUnGvXty9rQMx3ITmLDX5YoxhfCVca7+5Xx1zP+m6+KU FvOczc430U65fKbrrI38CFxR65gDq32yLHUwb2CNpMDwZsvcZ4FmKUh2nZ6cskFg15Ljey 1e/9G+g9+iibwPF424pZ9rZI59JQ6TEmwNWXxha6cV/TGZp25Z0QtdlvxgiUpltgG9Z7LT XnyQWvQz9WNUqe5xg4OLv16l9QAdawTQAoJ53zqxY9CFwnfmyBlCFDsDFzSRTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685034393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oLWboI9LFnSgy7tMEYVFs6qNR/yaSfCLL+6Tw39qWfQ=; b=Hn4pL2Pxr02yQzwptNzisxHyILrbgE3nFmHYwFDpi+rQWC2nZ/YXdZeJwrnixtLDnaxXfg dHOKg77K+6HtgS6RLTvfla+fnkxD11gcOmxGiae2vEH2xQoIe9oEh0SluR1PokgYs2TmMF UQLag1b0qEgiidi7nY4Y6ug8BrPSMwH8sIwb4C0YXaTgqrJN1mSuOi5FnVd5Yy3RWiYUUx 3jEdC3lBSYU8a2vGbEVLqGihFyL6pl++iIZy5tjwqntM7bTEzGGaYzhR1Fy/+TWdbzzBrd UTF51dPMSROXPfdP+A4QAVbg4wm612G4X/tEYx9K7qA9rTC8+o8gU1F4v+xWEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685034393; a=rsa-sha256; cv=none; b=j55jrv5l2Jfrzk45dZ37xjdUT6hLWcLVNCsFJhTPj+b3PMah//1gUKlbK63U8UOBwCNAPp jID0KFaOygh88lNoJcg+y8S2x2JgoVfFhF8AihNLk+AQykZ/PJ6Xmf67tkZtQN/t8TQtZk o2/RV62dhu4+lkxxFnwJdGRTBT7/2OodBPVP8G5qPiQUX3f84k6kijoLbyy5yAvrHVxuDw 3QicjBfcJDkgCa4rD39CGkkiP4XM6p7ldUqxzwU9WJq2mvw/30hKJDs595O1WxI4QsA1w7 tRRb3pAg8FOZQBWZlB/ZUIORKInPdWIZ2r095fBO6ZQweS2bPD0JzJmGUqpB1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRvbY2gDYzYNg; Thu, 25 May 2023 17:06: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 34PH6Xrr028019; Thu, 25 May 2023 17:06:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PH6XNm028018; Thu, 25 May 2023 17:06:33 GMT (envelope-from git) Date: Thu, 25 May 2023 17:06:33 GMT Message-Id: <202305251706.34PH6XNm028018@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: ffa75b573f04 - main - arm64/disassem.c: Add shifted register instruction definitions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ffa75b573f043951c7958c200c1e0e1b1f703740 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=ffa75b573f043951c7958c200c1e0e1b1f703740 commit ffa75b573f043951c7958c200c1e0e1b1f703740 Author: Mykola Hohsadze AuthorDate: 2023-05-25 14:41:55 +0000 Commit: Mitchell Horne CommitDate: 2023-05-25 17:06:15 +0000 arm64/disassem.c: Add shifted register instruction definitions Add disassembly support for the following shifted register instructions: * adds * subs * sub * neg * negs * cmp * cmn The 'Mandatory Tokens' checks are relaxed to allow for the alias instructions (e.g. cmp) which hard-code one or more registers as xzr. Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D40006 --- sys/arm64/arm64/disassem.c | 58 +++++++++++++++++++++++++++++++++------------- 1 file changed, 42 insertions(+), 16 deletions(-) diff --git a/sys/arm64/arm64/disassem.c b/sys/arm64/arm64/disassem.c index 2ec0d04d5491..f1a4f9206c1b 100644 --- a/sys/arm64/arm64/disassem.c +++ b/sys/arm64/arm64/disassem.c @@ -91,6 +91,8 @@ enum arm64_format_type { /* * OP , , {, #imm} SF32/64 * OP , , #{, } SF32/64 + * OP , {, # } + * OP , {, # } */ TYPE_01, @@ -151,6 +153,10 @@ static struct arm64_insn arm64_i[] = { TYPE_01, OP_RD_SP | OP_RN_SP }, /* mov (to/from sp) */ { "add", "SF(1)|0010001|SHIFT(2)|IMM(12)|RN(5)|RD(5)", TYPE_01, OP_RD_SP | OP_RN_SP }, /* add immediate */ + { "cmn", "SF(1)|0101011|SHIFT(2)|0|RM(5)|IMM(6)|RN(5)|11111", + TYPE_01, 0 }, /* cmn shifted register */ + { "adds", "SF(1)|0101011|SHIFT(2)|0|RM(5)|IMM(6)|RN(5)|RD(5)", + TYPE_01, 0 }, /* adds shifted register */ { "ldr", "1|SF(1)|111000010|IMM(9)|OPTION(2)|RN(5)|RT(5)", TYPE_02, OP_SIGN_EXT | OP_RN_SP }, /* ldr immediate post/pre index */ { "ldr", "1|SF(1)|11100101|IMM(12)|RN(5)|RT(5)", @@ -216,6 +222,16 @@ static struct arm64_insn arm64_i[] = { { "strh", "01111000001|RM(5)|OPTION(3)|SCALE(1)|10|RN(5)|RT(5)", TYPE_02, OP_SF32 | OP_RN_SP }, /* strh register */ + { "neg", "SF(1)|1001011|SHIFT(2)|0|RM(5)|IMM(6)|11111|RD(5)", + TYPE_01, 0 }, /* neg shifted register */ + { "sub", "SF(1)|1001011|SHIFT(2)|0|RM(5)|IMM(6)|RN(5)|RD(5)", + TYPE_01, 0 }, /* sub shifted register */ + { "cmp", "SF(1)|1101011|SHIFT(2)|0|RM(5)|IMM(6)|RN(5)|11111", + TYPE_01, 0 }, /* cmp shifted register */ + { "negs", "SF(1)|1101011|SHIFT(2)|0|RM(5)|IMM(6)|11111|RD(5)", + TYPE_01, 0 }, /* negs shifted register */ + { "subs", "SF(1)|1101011|SHIFT(2)|0|RM(5)|IMM(6)|RN(5)|RD(5)", + TYPE_01, 0 }, /* subs shifted register */ { NULL, NULL } }; @@ -397,7 +413,7 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) int ret; int shift, rm, rt, rd, rn, imm, sf, idx, option, scale, amount; int sign_ext; - int rm_absent; + bool rm_absent, rd_absent, rn_absent; /* Indicate if immediate should be outside or inside brackets */ int inside; /* Print exclamation mark if pre-incremented */ @@ -454,27 +470,37 @@ disasm(const struct disasm_interface *di, vm_offset_t loc, int altfmt) /* * OP , , {, #} SF32/64 * OP , , #{, } SF32/64 + * OP , {, # } + * OP , {, # } */ - /* Mandatory tokens */ - ret = arm64_disasm_read_token(i_ptr, insn, "RD", &rd); - ret |= arm64_disasm_read_token(i_ptr, insn, "RN", &rn); - if (ret != 0) { - printf("ERROR: " - "Missing mandatory token for op %s type %d\n", - i_ptr->name, i_ptr->type); - goto undefined; - } - - /* Optional tokens */ - arm64_disasm_read_token(i_ptr, insn, "SHIFT", &shift); + rd_absent = arm64_disasm_read_token(i_ptr, insn, "RD", &rd); + rn_absent = arm64_disasm_read_token(i_ptr, insn, "RN", &rn); rm_absent = arm64_disasm_read_token(i_ptr, insn, "RM", &rm); + arm64_disasm_read_token(i_ptr, insn, "SHIFT", &shift); - di->di_printf("%s\t%s, %s", i_ptr->name, - arm64_reg(sf, rd, rd_sp), arm64_reg(sf, rn, rn_sp)); + di->di_printf("%s\t", i_ptr->name); + + /* + * If RD and RN are present, we will display the following + * patterns: + * - OP , , {, #} SF32/64 + * - OP , , #{, } SF32/64 + * Otherwise if only RD is present: + * - OP , {, # } + * Otherwise if only RN is present: + * - OP , {, # } + */ + if (!rd_absent && !rn_absent) + di->di_printf("%s, %s", arm64_reg(sf, rd, rd_sp), + arm64_reg(sf, rn, rn_sp)); + else if (!rd_absent) + di->di_printf("%s", arm64_reg(sf, rd, rd_sp)); + else + di->di_printf("%s", arm64_reg(sf, rn, rn_sp)); /* If RM is present use it, otherwise use immediate notation */ - if (rm_absent == 0) { + if (!rm_absent) { di->di_printf(", %s", arm64_reg(sf, rm, rm_sp)); if (imm != 0) di->di_printf(", %s #%d", shift_2[shift], imm); From nobody Thu May 25 17:06:34 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRvbZ4yyLz4WS88; Thu, 25 May 2023 17:06: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 4QRvbZ4XYkz3knF; Thu, 25 May 2023 17:06:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685034394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LNox0VzUuE2JtxGDfqr1/RTWSxwY9PDLB3HpUsQpIS4=; b=NYVVeQN4yQT5Ku9MFVBDNKG9vjqhqy0Yo3CEoSabKrTeB7+aGLK7Ss+Z76+aw6w6OqLiOP 5wAyC+1z/L4i1ZLFNzQTC5DBVuvTeX5SsRvr0lyK26P+YfawJFUS7cQ0tBsYJvPk0WtQrb jYjpcTyRTq3row7CALoZiPMH63RxdwIyPXeiAil2tm4Aeu1PhiiwBpXBCkFuKY+WoskGRh XRRUTN4xxhkHkOfAfQmLykQ6iVqnFiJByoBKMsEOr9yanBzeYHQ38oIoQiNP3+DpFw372A l2B07yWH9k/giwx/RN/KDin+XizYk0s0k694Bj402byDLstQlnaL2WoWKC7uMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685034394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LNox0VzUuE2JtxGDfqr1/RTWSxwY9PDLB3HpUsQpIS4=; b=hRi0F7+qrM1EpwaA5MSNXJE+T9hMAQfVb2EyVZ6wRYRtqyHcTVd5FXBqGdP0kgLmP9q95/ HZgj+XL3iUm6nbMCzolnXS2CUOojiNBPocVwNl4OU7ntlFFeOOi+Pyh+m/vHYCB0JAxHO2 Txx7XVG+lCzG4A6sFLiQVlvLamod6xiv/ht1F2rP9xwv/On+GsR8596v5MBV3OUPCCzfVV viSNzyKzWzkJHDFxm/XwpRUJ4kO9Tye4RUivN2KGIpl+dkM9rexuxzldQNieDksUKvcd2I 7xJC4RlaYvurybiV518UKvwxRd9YQyCe5T6EwJZAmoQOQgqv21R2K/o6KoKr5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685034394; a=rsa-sha256; cv=none; b=wW4iKzoh97RvwKbR7y19tW0ccGsIIijThUdIKtRzQ2K4x5KmzdVVddFOvsWuqsW0pCDuva izK/EDedXZqekHtKzYSJafe0P3cWCd5itR6TyezlaqEBuakfHdpp9Ke1YI3RoyrQB9B+6X 7eyuMgLgc7dPb4VKb7t9HNU6m1NSuKIh2Rd8J4of4ABqHjCp7mSC4WOMyflghT2NywtqSM cysQ8H+0d+ZFfMMODPVwfU3RJ4RvaMfq8MaMe7GG2Xn6mG1LcmLPwZqGp5nTOFVotW5NcR rXo8gM/aHYo2brkgm322Bq7ICw8FfGWhOEBLNp3LrrE3imqjZ8YyHUxlprBrlQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRvbZ3bdHzXwR; Thu, 25 May 2023 17:06: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 34PH6YLv028039; Thu, 25 May 2023 17:06:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PH6YrH028038; Thu, 25 May 2023 17:06:34 GMT (envelope-from git) Date: Thu, 25 May 2023 17:06:34 GMT Message-Id: <202305251706.34PH6YrH028038@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: ef0a711fd5d0 - main - riscv: Use PMAP_MAPDEV_EARLY_SIZE in locore and pmap_bootstrap List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ef0a711fd5d0d389205c18c869c78b9a4d639ddb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=ef0a711fd5d0d389205c18c869c78b9a4d639ddb commit ef0a711fd5d0d389205c18c869c78b9a4d639ddb Author: Alfredo Mazzinghi AuthorDate: 2023-05-25 15:33:12 +0000 Commit: Mitchell Horne CommitDate: 2023-05-25 17:06:16 +0000 riscv: Use PMAP_MAPDEV_EARLY_SIZE in locore and pmap_bootstrap Use PMAP_MAPDEV_EARLY_SIZE instead of assuming that its value is always L2_SIZE. Add compile-time assertions to check that the size matches the expectations in locore. Reviewed by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D40110 --- sys/riscv/include/vmparam.h | 2 +- sys/riscv/riscv/genassym.c | 1 + sys/riscv/riscv/locore.S | 6 ++++-- sys/riscv/riscv/pmap.c | 13 +++++++++++-- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/sys/riscv/include/vmparam.h b/sys/riscv/include/vmparam.h index 6e1c9e11a3cc..5f76b312c7fd 100644 --- a/sys/riscv/include/vmparam.h +++ b/sys/riscv/include/vmparam.h @@ -250,7 +250,7 @@ extern vm_offset_t init_pt_va; #define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ #define DEVMAP_MAX_VADDR VM_MAX_KERNEL_ADDRESS -#define PMAP_MAPDEV_EARLY_SIZE (L2_SIZE * 2) +#define PMAP_MAPDEV_EARLY_SIZE L2_SIZE /* * No non-transparent large page support in the pmap. diff --git a/sys/riscv/riscv/genassym.c b/sys/riscv/riscv/genassym.c index e45b7c288676..ce2c2e3964cf 100644 --- a/sys/riscv/riscv/genassym.c +++ b/sys/riscv/riscv/genassym.c @@ -62,6 +62,7 @@ ASSYM(KERNBASE, KERNBASE); ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS); ASSYM(VM_MAX_KERNEL_ADDRESS, VM_MAX_KERNEL_ADDRESS); ASSYM(VM_EARLY_DTB_ADDRESS, VM_EARLY_DTB_ADDRESS); +ASSYM(PMAP_MAPDEV_EARLY_SIZE, PMAP_MAPDEV_EARLY_SIZE); ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault)); ASSYM(PCB_SIZE, sizeof(struct pcb)); diff --git a/sys/riscv/riscv/locore.S b/sys/riscv/riscv/locore.S index bf0ac8e122be..32d1b6198de8 100644 --- a/sys/riscv/riscv/locore.S +++ b/sys/riscv/riscv/locore.S @@ -162,7 +162,7 @@ pagetables: lla s2, pagetable_l2_devmap /* Link to next level PN */ srli s2, s2, PAGE_SHIFT - li a5, (VM_MAX_KERNEL_ADDRESS - L2_SIZE) + li a5, (VM_MAX_KERNEL_ADDRESS - PMAP_MAPDEV_EARLY_SIZE) srli a5, a5, L1_SHIFT /* >> L1_SHIFT */ andi a5, a5, Ln_ADDR_MASK /* & Ln_ADDR_MASK */ li t4, PTE_V @@ -191,7 +191,9 @@ pagetables: /* Store the L2 table entry for the DTB */ li a6, PTE_SIZE - li a5, 510 + li a5, VM_EARLY_DTB_ADDRESS + srli a5, a5, L2_SHIFT /* >> L2_SHIFT */ + andi a5, a5, Ln_ADDR_MASK /* & Ln_ADDR_MASK */ mulw a5, a5, a6 add t1, s1, a5 sd t0, (t1) diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 007ec1e678fc..5d35488c415c 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -254,6 +254,15 @@ vm_offset_t dmap_max_addr; /* The virtual address limit of the dmap */ CTASSERT((DMAP_MIN_ADDRESS & ~L1_OFFSET) == DMAP_MIN_ADDRESS); CTASSERT((DMAP_MAX_ADDRESS & ~L1_OFFSET) == DMAP_MAX_ADDRESS); +/* + * This code assumes that the early DEVMAP is L2_SIZE aligned and is fully + * contained within a single L2 entry. The early DTB is mapped immediately + * before the devmap L2 entry. + */ +CTASSERT((PMAP_MAPDEV_EARLY_SIZE & L2_OFFSET) == 0); +CTASSERT((VM_EARLY_DTB_ADDRESS & L2_OFFSET) == 0); +CTASSERT(VM_EARLY_DTB_ADDRESS < (VM_MAX_KERNEL_ADDRESS - PMAP_MAPDEV_EARLY_SIZE)); + static struct rwlock_padalign pvh_global_lock; static struct mtx_padalign allpmaps_lock; @@ -684,7 +693,7 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, vm_size_t kernlen) /* Create the l3 tables for the early devmap */ freemempos = pmap_bootstrap_l3(l1pt, - VM_MAX_KERNEL_ADDRESS - L2_SIZE, freemempos); + VM_MAX_KERNEL_ADDRESS - PMAP_MAPDEV_EARLY_SIZE, freemempos); /* * Invalidate the mapping we created for the DTB. At this point a copy @@ -738,7 +747,7 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, vm_size_t kernlen) msgbufp = (void *)msgbufpv; virtual_avail = roundup2(freemempos, L2_SIZE); - virtual_end = VM_MAX_KERNEL_ADDRESS - L2_SIZE; + virtual_end = VM_MAX_KERNEL_ADDRESS - PMAP_MAPDEV_EARLY_SIZE; kernel_vm_end = virtual_avail; pa = pmap_early_vtophys(l1pt, freemempos); From nobody Thu May 25 17:11:40 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRvjT0sTKz4WSN8; Thu, 25 May 2023 17:11: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 4QRvjT02thz3lpC; Thu, 25 May 2023 17:11:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685034701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Uo6fK29/flEPjauqgUmhRF3FkDsFqK/UUAoOioqY8EY=; b=mqbiwQ0UXOHi3pWz80cJeB7ohg30gDCFS23NL1XAasMTFcD2I6nOQLrhlSCFHDgKjAjPGJ Z6Hi9XuFP5Jj3Jf9gvVPVSjK0SIkirT7xfmjKlC5XBZ/8wir3NbrszNCY0d+jQQMNJZef+ ddzgBW8cGfJymyiZGf1wSKNpgIwPh22ATM/F1ib4B1f/NUVQ/IJayK7EEg+B2IYqMeuZuv uvnI3cB1kg5gS4YA9aumVYPgZXjvAohAbX2AoVH1KynYsmTgNiwpXobRdjsixLbpLadmh0 5xO9d0J4D2P1qFJ37F51Wb4PD7apn1k1v7+g3W0vOVt75VW7DD7vyXZJW89KBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685034701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Uo6fK29/flEPjauqgUmhRF3FkDsFqK/UUAoOioqY8EY=; b=eeIJYxJevy0Fig03awjJfDcCMhTCjoOnN5oBWq5iOpIyaeTwjn19k4bUlcZJJKaSjEzycq 2w2eM950pyEafqA2fDp4EDl+7AhzkAQ5pkwWrTP2H0iSHo7i82qDO4D/LkZPeOE1jryqps 35hzELDPYHUaXMokRElGE1m+l/OfUriV84R4vfth2xwUs+wnPloUJ+6T0tWu9B2GnoCJs+ X2qt/l/N6NfPXct7WC9PJhJ2aLmbpemqXSx69QNICsGqJIQ4GGugUwvNsqxDfQSaM7+bxd jxNV0SRhDSWlygi19h1q0e3FeZagCuK/KA8gVgjUfpSqu6PSg3oSLDOO8H0CoA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685034701; a=rsa-sha256; cv=none; b=IdLQeRNK7PSVHXzpZC3UoFT4+8WLITToF2GG1RBt3zMM5qrv20sfQkFnlrEZTj2yyPci1d BOTj1ssjh9AYoC9VBGeTaTi7TvoowcZm+b52Xma2D5aFhG7kATYtEIXs0b6d5LhzQ+rYlk pLuue0jXicV5Wy1SnVieyLgGAgiGluaoojsUFrlGoLOre1yT5QHJm1hxN5OSxKKOYirBI0 qOr7DJfv+k9pWMKOaPHPhmLDDnRyAcjdvExhWvH5g5iSPmznbxLdjE0DeydctTY9kDQhPb tk+WN+OMJQsv1ng6itn61zfxT/vY/Qf70cixs0a0TduGO2p4UcfPeQDijOVw0w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRvjS5wvRzYBw; Thu, 25 May 2023 17:11: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 34PHBelB041661; Thu, 25 May 2023 17:11:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PHBec4041660; Thu, 25 May 2023 17:11:40 GMT (envelope-from git) Date: Thu, 25 May 2023 17:11:40 GMT Message-Id: <202305251711.34PHBec4041660@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 8bebb786820f - main - riscv: S-mode extension parsing List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8bebb786820f634d47522711b8cd56a66db3785d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=8bebb786820f634d47522711b8cd56a66db3785d commit 8bebb786820f634d47522711b8cd56a66db3785d Author: Mitchell Horne AuthorDate: 2023-05-25 17:07:26 +0000 Commit: Mitchell Horne CommitDate: 2023-05-25 17:07:26 +0000 riscv: S-mode extension parsing There are now several Supervisor-mode extensions that have entered the 'ratified' status, so begin parsing and reporting a few of these. Recognize the following extensions: - Sstc: stimecmp/vstimecmp CSR - Svnapot: NAPOT* translation contiguity - Svpbmt: page-based memory types - Svinval: fine-grained TLB invalidation instructions - Sscofpmf: performance counter overflow *i.e. "naturally aligned power-of-2" page granularity For now, provide globals for Sstc and Sscofpmf, as we will make use of these in the near future. Plus, update the copyright statement after my recent work on this file. Reviewed by: jhb MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40240 --- sys/riscv/include/md_var.h | 4 ++++ sys/riscv/riscv/identcpu.c | 53 +++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/sys/riscv/include/md_var.h b/sys/riscv/include/md_var.h index 687ab9a3a77e..9951c838a2e6 100644 --- a/sys/riscv/include/md_var.h +++ b/sys/riscv/include/md_var.h @@ -42,6 +42,10 @@ extern register_t marchid; extern register_t mimpid; extern u_int mmu_caps; +/* Supervisor-mode extension support */ +extern bool has_sstc; +extern bool has_sscofpmf; + struct dumperinfo; struct minidumpstate; diff --git a/sys/riscv/riscv/identcpu.c b/sys/riscv/riscv/identcpu.c index b68cc5c78352..a57d5139e0cc 100644 --- a/sys/riscv/riscv/identcpu.c +++ b/sys/riscv/riscv/identcpu.c @@ -1,6 +1,10 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2015-2016 Ruslan Bukin * All rights reserved. + * Copyright (c) 2022 Mitchell Horne + * Copyright (c) 2023 The FreeBSD Foundation * * Portions of this software were developed by SRI International and the * University of Cambridge Computer Laboratory under DARPA/AFRL contract @@ -10,6 +14,9 @@ * Computer Laboratory as part of the CTSRD Project, with support from the * UK Higher Education Innovation Fund (HEIF). * + * Portions of this software were developed by Mitchell Horne + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -67,11 +74,21 @@ register_t mimpid; /* The implementation ID */ u_int mmu_caps; +/* Supervisor-mode extension support. */ +bool __read_frequently has_sstc; +bool __read_frequently has_sscofpmf; + struct cpu_desc { const char *cpu_mvendor_name; const char *cpu_march_name; u_int isa_extensions; /* Single-letter extensions. */ u_int mmu_caps; + u_int smode_extensions; +#define SV_SSTC (1 << 0) +#define SV_SVNAPOT (1 << 1) +#define SV_SVPBMT (1 << 2) +#define SV_SVINVAL (1 << 3) +#define SV_SSCOFPMF (1 << 4) }; struct cpu_desc cpu_desc[MAXCPU]; @@ -131,13 +148,29 @@ static const struct { #define ISA_PREFIX_LEN (sizeof(ISA_PREFIX) - 1) static __inline int -parse_ext_s(struct cpu_desc *desc __unused, char *isa, int idx, int len) +parse_ext_s(struct cpu_desc *desc, char *isa, int idx, int len) { +#define CHECK_S_EXT(str, flag) \ + do { \ + if (strncmp(&isa[idx], (str), \ + MIN(strlen(str), len - idx)) == 0) { \ + desc->smode_extensions |= flag; \ + return (idx + strlen(str)); \ + } \ + } while (0) + + /* Check for known/supported extensions. */ + CHECK_S_EXT("sstc", SV_SSTC); + CHECK_S_EXT("svnapot", SV_SVNAPOT); + CHECK_S_EXT("svpbmt", SV_SVPBMT); + CHECK_S_EXT("svinval", SV_SVINVAL); + CHECK_S_EXT("sscofpmf", SV_SSCOFPMF); + +#undef CHECK_S_EXT + /* * Proceed to the next multi-letter extension or the end of the * string. - * - * TODO: parse these once we gain support */ while (isa[idx] != '_' && idx < len) { idx++; @@ -381,6 +414,10 @@ update_global_capabilities(u_int cpu, struct cpu_desc *desc) */ UPDATE_CAP(mmu_caps, desc->mmu_caps); + /* Supervisor-mode extension support. */ + UPDATE_CAP(has_sstc, (desc->smode_extensions & SV_SSTC) != 0); + UPDATE_CAP(has_sscofpmf, (desc->smode_extensions & SV_SSCOFPMF) != 0); + #undef UPDATE_CAP } @@ -480,5 +517,15 @@ printcpuinfo(u_int cpu) "\15Mult/Div"); } + if (SHOULD_PRINT(smode_extensions)) { + printf(" S-mode Extensions: %#b\n", desc->smode_extensions, + "\020" + "\01Sstc" + "\02Svnapot" + "\03Svpbmt" + "\04Svinval" + "\05Sscofpmf"); + } + #undef SHOULD_PRINT } From nobody Thu May 25 17:11:41 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRvjV1MFhz4WSct; Thu, 25 May 2023 17:11: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 4QRvjV0dV0z3lyM; Thu, 25 May 2023 17:11:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685034702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+wazijFpNt5NmNfd9DhLIYgRZRTgTOBxrL7/lJhRNfI=; b=g1tLf6Sc88wJsuXVGMEReJzTppyRNJGn57UXTO14JhlRY4EtbRqsovebukCBgPPCJfK+TM lGp8F2jkJBEKKq25aQlcs4NVaCz/R6EUxLmQGMZ2RQQKEKZMrFQ9ttFwth9nzG2U3U4rt9 6glGIKJ0Jgfh2EligGJqbLGV+yJu4/+aBJ/AUJAS443f8SABzPOh9krrv1gYB00q3+c3cS zkVe4LiO88RrVmdgMdU4AdBfbmyp+6lWgBWpKQHFHx5WiRco0XbDu0+IhHOpYgOGJ76hG7 jl2d5TqdAX7KHW6+t1zGAETbMJdH3qCCPYDkWWrOecseRT330CE24idmj09E0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685034702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+wazijFpNt5NmNfd9DhLIYgRZRTgTOBxrL7/lJhRNfI=; b=YEXMdf0gNHegQG4UKLHD3FiSTYZAHtbgxzXdmbJZMBqrQMG9kj8EVrnEfKQRLUugXQyUU/ LeJCqLEjGcle4ZTr4dDx8KuueRfxCa24io9bGzHYsU9+thbzgWEPw57uJWkpBeEt6yPY+G z6tuahIlBz5Z1f21e9XzrJTBZzK3ZDfvCcyZysEsIuxEK5LrQ+77air3jAIOPd5+eqIn4j aY1vGLdM6QBXCNLZrSs5kV0TVeiocttiKGxJJTvNwerg5qA/FrI5CGSH2sPuaNzOnavSLL osdzWC4YRO93gv3Sf1KuZRwp3owAxwwqxuiroNbb4LmiVPvhDiTRlc9BZZdMBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685034702; a=rsa-sha256; cv=none; b=gtQMQRTXIk+fByOnIhhPLiDDR2XQqrWY8+heKjy+EeCUMXahoxHvZYJx+EhqdA7UExaUjz BjE/cacpZ5w+omx7hRmkzL99DpchrNdadyL37K/vejc4BlrgTsCD4ZDeDMDIGcGUjhlkdF thC07RY1ht0ix3tVdoN/m+acd/7Py0Zz0/Jwlkhk41geyt2/AiIIYfyipul1yg7F2qnP6U TI86dso3oKCGvMp6Cpl4oxEyv+NqeuFeAjf2LgmCrZSpznpI+FI6tNpNMFM/3n+ev303p1 lDSgDGa3+lH63XIHxRF0LSZl25Djwf7d4l2g28f+/kRViomRoPghezfa1TkosQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRvjT6qrZzYPF; Thu, 25 May 2023 17:11: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 34PHBfS9041687; Thu, 25 May 2023 17:11:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PHBfTe041686; Thu, 25 May 2023 17:11:41 GMT (envelope-from git) Date: Thu, 25 May 2023 17:11:41 GMT Message-Id: <202305251711.34PHBfTe041686@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: cadaabcc720b - main - riscv timer: use stimecmp CSR when available List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cadaabcc720bb20d6d604c4792acb29072d2882d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=cadaabcc720bb20d6d604c4792acb29072d2882d commit cadaabcc720bb20d6d604c4792acb29072d2882d Author: Mitchell Horne AuthorDate: 2023-05-25 17:07:49 +0000 Commit: Mitchell Horne CommitDate: 2023-05-25 17:07:49 +0000 riscv timer: use stimecmp CSR when available The Sstc extension defines a new stimecmp CSR, allowing supervisor software to set the timer, rather than just read it. When supported, using this avoids the frequent trips through the SBI every time the CPU's timer expires. Reviewed by: jhb MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40241 --- sys/riscv/riscv/timer.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/riscv/riscv/timer.c b/sys/riscv/riscv/timer.c index 8f01ef2a720f..d23d88d2c0ec 100644 --- a/sys/riscv/riscv/timer.c +++ b/sys/riscv/riscv/timer.c @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -84,6 +85,16 @@ get_timecount(void) return (rdtime()); } +static inline void +set_timecmp(uint64_t timecmp) +{ + + if (has_sstc) + csr_write(stimecmp, timecmp); + else + sbi_set_timer(timecmp); +} + static u_int riscv_timer_tc_get_timecount(struct timecounter *tc __unused) { @@ -107,7 +118,7 @@ riscv_timer_et_start(struct eventtimer *et, sbintime_t first, sbintime_t period) if (first != 0) { counts = ((uint32_t)et->et_frequency * first) >> 32; - sbi_set_timer(get_timecount() + counts); + set_timecmp(get_timecount() + counts); csr_set(sie, SIE_STIE); return (0); From nobody Thu May 25 17:16:58 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRvqZ58dbz4WSfw; Thu, 25 May 2023 17:16: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 4QRvqZ4YcXz3n35; Thu, 25 May 2023 17:16:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685035018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L5eyC8Uzm4xzKz4dG70EgZrmhhubGAYhl8TA41+NjdI=; b=oY35Rkv5pwpbGyxpJU4RqNBTbPe5Keadt6nxa0O63YvRQwTZ3VX5q29Q1llBTY/2jk0aqz 38gI5ZXpyolXrX+KeQqYm2c20vxUopuuacTqj0ndcNWqnMI4tlUxxb2A+Jzv/9KlNTVIfb TthqASpMmUIEDvjVwNQP7GxP8EuzNumWHo38ROT+sBs4ly2nr3GXezLfgnZj1Tlw2a27i2 CI2AJl3HHNyXFEVA4NP1OtoyMoJWGq1hvzRSNx1Dh2oYyPMl9Bm6lT6N0TdkoO70YguqP6 e2HbWkfYbh+FouY9YWkjojjYzpk3TefC6HpQIxVfP6620b9SACGiQolVeEpTGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685035018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L5eyC8Uzm4xzKz4dG70EgZrmhhubGAYhl8TA41+NjdI=; b=mGhXPSqtrhs/ViXKWcCsQ2pd5+5XuX2yB370FPI/PTDPAn6U7t4FuiZtfqpsc7CYLPGygH xWmYfS9/LOUCnKXL/+tRt74sm5b0NaUDdB5VYVFq5kQGIBoTK8v51sGF4InfCQsSyEOpd8 zhzoQlIkmth3RXcK4+GxQYPl8QbPvp9O4m/6O3akiyNwdCdIy5mTdYClxzAns56Zix8Gwi Xa9PMo3LdRuNr0j3mf9ZX5QBSoFgZ/zy20Qm1Qt5U1mZ3Kf9HnxbtLice93UkpSrhL5u1S ynebkIPL5WBOwjsuKqxGK/VED5+c1yuVfc0AbDAeG3viiDZS79/dgClYwlkHrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685035018; a=rsa-sha256; cv=none; b=bgetfKmw3/rW1mOhsrsVRWtTOsIGZiflE1yqP/EChSGc4r/smIYk8YKIXx/gKIz/uEhBkJ Byxe5lneKO2LLW68AhxdkGsiw5RiMU5jqlHyWuuReWoFM3UtVdNL5x5ZrzaXrX4tPwCEBk 4GL1WphRL8W32a3Ivkz5v5bIC0HmD+zuMA+O5nsRBED5UCwdJ9hXHciZuUD+fPJ05t+xjL gIFjQ5vvQUsvuJjvb0x7KNalggPaRNRiJyJ9RwAMgFhmv5KkTe94fJeT2OeUxjVx/df6MD XrBXhoLO9BQlRt5ftqmUrEY6i3nwPP2YGlFUBRcqog8tV9bB6vUaJG9Ga4kS8A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRvqZ3ZFrzYXT; Thu, 25 May 2023 17:16: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 34PHGwH0044623; Thu, 25 May 2023 17:16:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PHGwJc044622; Thu, 25 May 2023 17:16:58 GMT (envelope-from git) Date: Thu, 25 May 2023 17:16:58 GMT Message-Id: <202305251716.34PHGwJc044622@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 77d788e23d09 - main - libfetch: specify OpenSSL 1.1 APIs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 77d788e23d0964053b81b5de307fa04bd1ccadc5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=77d788e23d0964053b81b5de307fa04bd1ccadc5 commit 77d788e23d0964053b81b5de307fa04bd1ccadc5 Author: Pierre Pronchery AuthorDate: 2023-05-25 06:46:02 +0000 Commit: Ed Maste CommitDate: 2023-05-25 17:15:45 +0000 libfetch: specify OpenSSL 1.1 APIs OPENSSL_API_COMPAT can be used to specify the OpenSSL API version in use for the purpose of hiding deprecated interfaces and enabling the appropriate deprecation notices. This change is a NFC while we're still using OpenSSL 1.1.1 but will avoid deprecation warnings upon the switch to OpenSSL 3.0. Future work should migrate to use the OpenSSL 3.0 APIs. PR: 271615 Reviewed by: emaste Event: Kitchener-Waterloo Hackathon 202305 Sponsored by: The FreeBSD Foundation --- lib/libfetch/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libfetch/Makefile b/lib/libfetch/Makefile index 607ff6e05c5e..9ac370faa05d 100644 --- a/lib/libfetch/Makefile +++ b/lib/libfetch/Makefile @@ -18,6 +18,7 @@ CFLAGS+= -DINET6 .if ${MK_OPENSSL} != "no" CFLAGS+= -DWITH_SSL +CFLAGS+= -DOPENSSL_API_COMPAT=0x10100000L LIBADD+= ssl crypto .else LIBADD+= md From nobody Thu May 25 17:16:59 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRvqb63Kyz4WSV1; Thu, 25 May 2023 17:16: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 4QRvqb55Qwz3mxw; Thu, 25 May 2023 17:16:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685035019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PoZLifEzVlBU6soehnU8zu2DGQ/zLaQaYVBE/dQTVsE=; b=D6By8/JEDZnZRD2AoP31QjvGht+nUB9m1YToUw2upQ7pmyfOOTFM58M8F6y0bDfMlG6dHr fNk2PVrWlHkKXSGaZzbZ9NiBY/GaT42eHU9z+wIDyquxh54lCjWuynM/o4JJKyWs/aO03p ImgUHZxSKZ9KDRM/Q6igHuaEcx91k/oe8eltgNRKucHLBB+QQWEsnVYh/6SVEXlszXNc1s ZYwAit/6uj2WE3NurbRDROAtvxS2RBTSqIoBpHrSHqAWliULTr77SN3TqPVf4nFGS5s6Xz KI9fzvWy7AztQIRP+pru4nITjMSqLH4mjZMkqy6aoo7p1MsV1zQ8VHjLCxgoug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685035019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PoZLifEzVlBU6soehnU8zu2DGQ/zLaQaYVBE/dQTVsE=; b=qqs7vP5ZQfZZdo4bwMs1Ux4SEvwo6+ysoLxoGqiKL/4AXyY4XtLypMQIoeegvs1EMWxElp atcqf3M7K2peujF1wYwgfj+RhpoRR/2avV1NHaPTfvehh2MICeoLmu9fetS2zYAukVL/6Q eidG8957jGEmcRjcCIIjdBwRfkKxCPhRwiM2+ugHgAtOv5to8E1OR5N8YnreyOmxvaQDKI 02S6p9MFAfRgCtrTKcHN5fI7Cr80jZ9280fBDUqSJucJxu3n/xh+V/Vyqt4GvdJNdgV6Os lVGo5CTXwf6UAoujgdUc6qeK12+j8thjB1bXXNfaYkO+h7bN6PhpkUjUlrwaUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685035019; a=rsa-sha256; cv=none; b=LCC9HHBpyqOwRsGwwlsS+9MSSSsJ0iy9JnKNw7EcGULwF/lLDrZ7D8wbpED58TWbgnAaeA OHh4krKA5m91AETsLQ6kWgkVfZXEmg97WXny8dPonY13q5d5DjHZyabQrsYpdG+SrI2dov 17Whg23c9ZIm9DuBrsr7sbno0Sq33vVuSAaHXkOIECp86OTxbynF/psxeKDS4hnxYPQ5fR Kn/4o/CSdie2PD3cbG265Agupj18eqMzXp1cdagQpQ5YUx5iKYo0y2+J4Ci7x4F1GgA5DN Jl6X8VflSBbr6V2uYBmLoUYD8pJpkycD0EQ/fyGoDhDnqaJqvYaYivKcxgrG6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRvqb4401zYXV; Thu, 25 May 2023 17:16: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 34PHGxEl044652; Thu, 25 May 2023 17:16:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PHGxJm044651; Thu, 25 May 2023 17:16:59 GMT (envelope-from git) Date: Thu, 25 May 2023 17:16:59 GMT Message-Id: <202305251716.34PHGxJm044651@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 07523f1d4fae - main - libradius: specify OpenSSL 1.1 APIs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 07523f1d4fae44967b274175d48480fafb6d9f34 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=07523f1d4fae44967b274175d48480fafb6d9f34 commit 07523f1d4fae44967b274175d48480fafb6d9f34 Author: Pierre Pronchery AuthorDate: 2023-05-25 05:42:38 +0000 Commit: Ed Maste CommitDate: 2023-05-25 17:15:45 +0000 libradius: specify OpenSSL 1.1 APIs OPENSSL_API_COMPAT can be used to specify the OpenSSL API version in use for the purpose of hiding deprecated interfaces and enabling the appropriate deprecation notices. This change is a NFC while we're still using OpenSSL 1.1.1 but will avoid deprecation warnings upon the switch to OpenSSL 3.0. Future work should migrate to use the OpenSSL 3.0 APIs. PR: 271615 Reviewed by: emaste Event: Kitchener-Waterloo Hackathon 202305 Sponsored by: The FreeBSD Foundation --- lib/libradius/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libradius/Makefile b/lib/libradius/Makefile index 42f5def20ef1..d10e67c7224b 100644 --- a/lib/libradius/Makefile +++ b/lib/libradius/Makefile @@ -30,6 +30,7 @@ LIB= radius SRCS= radlib.c INCS= radlib.h radlib_vs.h CFLAGS+= -Wall +CFLAGS+= -DOPENSSL_API_COMPAT=0x10100000L SHLIB_MAJOR= 4 MAN= libradius.3 radius.conf.5 From nobody Thu May 25 17:45:02 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRwRz2T1Tz4WV3K; Thu, 25 May 2023 17: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 4QRwRz0GtTz3s9R; Thu, 25 May 2023 17: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=1685036703; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WhbBQbEeNwpm0b/6DD/BlNhz2mzrKOleFOn3xsFanaQ=; b=amANbdidCJPg+F4MwK9fi1uAMdeBdPMz/SqLUW5+owOVCvMZAfLTIeAufA0ImRG61Y+oBe WpYitode7RnC9gOENmK5cc+XlabcS7PkgbUFqruITAleEYtmtmdxxPD7gvzrtRCd//ZjUC ilwrbKUnKx0pWKWTvID77hVXDHtVjjUPySwcL7mkdLhcEJr4pUBrRhORpcEMyDDU7D58mL dZhvnVXRzR9Y4OF45bX+1ZqJDvZt9rs9McFneXlqOVaC2qsWHl3cn69dPeMEUQ9a3QlRz2 noRdFvRQRBHIy7S0TM6VKeNDSSrFKizClRXUnYvwP4KEf+SdEGnIH3bpyo3Yvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685036703; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WhbBQbEeNwpm0b/6DD/BlNhz2mzrKOleFOn3xsFanaQ=; b=dXl3YnrU3TOIOmYps6d4eAJ7/hcKhFrAz9nCCys+YDs4KFe3r+BRp8CUa93ZaxDBHbctMU jnnI7dYp2l+ST93NbUfaczNCgspgRIdMyl/iEl8d68ccJODtbY3gFkp/036K8AqLnMTPGe FBeYTup3SeNorq5oExu8+vmupJRie4JcrAGIOyUD0mwoPJasattiulnpE/qs/0bGlLYl5e wevxGKRinzugmThC0KawtV1ciZlIidnzKG0GRg9tvIPPjDBO1Uv7R9b6dbl+h+hFb8h0Xs qGoeNC3fRX3d8Wm6+X6ZHYxaiyysf6UdColNEo36xKpSQfwH9CRUwzogTrl1IA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685036703; a=rsa-sha256; cv=none; b=AG06HP6bQjGzRD7kS9GWDvAmBBkFolIU/loJmDt2zI7Oyq991j3Zs4hyQQzA2Cs9FSxZdb /MN5Ia3IdS+ilQDYO3MBPeGBFCN3iuqcg/PGIonH2SZ+Iv4vUKWDhiLfCC/w7s5wwKPh9b ZMnav3lqIsSwoLEQQNzlNE8GePpy0mk+ACXF/s1wj54gDXRv8YITkIINwGYQE0UDGoVNKS wefBkXPpoJqpkxXrGBrN0hnl9gNcpdv1W08kgl6qskTzPNIsTLUdI6uOB3kmhE9PZjDc3V U8Uz2pWh/+P0/6+TzjsXdgLMyLfbPbA+Qp8HXU/K7+70SFl111CNLdn+FEmIZg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRwRy6TBszYtH; Thu, 25 May 2023 17:45: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 34PHj2lX093535; Thu, 25 May 2023 17:45:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PHj2l3093534; Thu, 25 May 2023 17:45:02 GMT (envelope-from git) Date: Thu, 25 May 2023 17:45:02 GMT Message-Id: <202305251745.34PHj2l3093534@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 61fab1341a6b - main - powerpc booke: Add an __unused wrapper for a variable only used under DEBUG. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 61fab1341a6b51c1964bcd1eb800fbdf5a34a0ac Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=61fab1341a6b51c1964bcd1eb800fbdf5a34a0ac commit 61fab1341a6b51c1964bcd1eb800fbdf5a34a0ac Author: John Baldwin AuthorDate: 2023-05-25 17:44:53 +0000 Commit: John Baldwin CommitDate: 2023-05-25 17:44:53 +0000 powerpc booke: Add an __unused wrapper for a variable only used under DEBUG. --- sys/powerpc/booke/pmap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c index 1d8f95594399..07e961995cd7 100644 --- a/sys/powerpc/booke/pmap.c +++ b/sys/powerpc/booke/pmap.c @@ -133,8 +133,10 @@ __FBSDID("$FreeBSD$"); #ifdef DEBUG #define debugf(fmt, args...) printf(fmt, ##args) +#define __debug_used #else #define debugf(fmt, args...) +#define __debug_used __unused #endif #ifdef __powerpc64__ @@ -632,7 +634,7 @@ mmu_booke_bootstrap(vm_offset_t start, vm_offset_t kernelend) int cnt, i, j; vm_paddr_t s, e, sz; vm_paddr_t physsz, hwphyssz; - u_int phys_avail_count; + u_int phys_avail_count __debug_used; vm_size_t kstack0_sz; vm_paddr_t kstack0_phys; vm_offset_t kstack0; From nobody Thu May 25 17:45:03 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRwS04Z1Mz4WVBt; Thu, 25 May 2023 17:45: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 4QRwS023lzz3s73; Thu, 25 May 2023 17:45:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685036704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KTXJiUQg3HDrLFhtkJxTMBAUWRocRCX50bjo9wb2vEw=; b=CdWhR+lbrY/84AOPh6VVaec+jCy6sHr0P8HE2/HnBSOgX6dzXL/NrVZqRwq93YQCpMPktD lFPUQCjjrZsgkwenHmar7lEM4/4O16i+DamBQrBsuQdnPeaPd756Dmeq7jtvn2xE7Kq+/D BcnotD226utpMV+jiK9s5nBDbzN4yeLaRH1TzexXL3Sgqx/5oBjXPI7ZPG/P7jT9NNaeSd lCfTgjAus12jL3eXmYqsTmCkcBq6XKW7J8s5Z3ZUwSyZ7Iitljj6QExR98Mor80b7ustVf Gh4y+acvSFMlV7V9j5dyzZRYvdcjvPJdNGJGLMJrvaa0yVSyInjN59VkiQpkjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685036704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KTXJiUQg3HDrLFhtkJxTMBAUWRocRCX50bjo9wb2vEw=; b=JfZl5SsG3Y6StNkQoom5ufceOXcdomKbuaZoTcLoJIXwvkqpal2ykt7x7AVu2rGCM7an8S UBVLaK8mVXm9GdkBTeTwrycUdYMPsjQMGbV3cOzGopXD36r0+yKjKWhnHMTP+SVL+jdpFj ma7Tui2UcqPIUL8nMpjlHdSTaJI/1frwzvGsSzH9F+V6WOLRTfhY5o8Po8SD4m3xGFncNx p2iqEHHv7fwsjV1k0dP85BGlYheFimOqKkrQYVUe8pOKeFCOgCisPQqSkQA8mRjLT/jzj3 08je9aHFuffZTybqoBf+ssOy5Mb/ufHQfR5TVhwzXPG5FxEopFT2/i7EVOgqQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685036704; a=rsa-sha256; cv=none; b=aXa9CfsaF/UNBGCOpsC8tEZIY5YgRRvzu6D06ni37HeG9qVaf7DDZuC3/i7JlT9K0WvNQV oZpfOt7Z1VZSkrm32w84miZI50EhE0jYkDzP6wfhccyFQ4ruG3inCRuEWP3MaXAuJvlsuA 3tz3dc7PDe6g7GAswcC3DLVdm+K313auLcz7oHhqFcS73s7tGeqUIanrLBy76ePFj2jPR5 5AZzls3jgko8YUl9Hy7oSGXRX4np0DlMOzOBVliT2iDZzQPMKkvuo2QcsSQnBtz2UdIgJk IuRb/F3TBk01gZc/F14vs68U30rhzwSoBBKkPiquwRaU7zj28vHnUTszWT1nlw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRwS00FnGzZLd; Thu, 25 May 2023 17:45: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 34PHj3YS093555; Thu, 25 May 2023 17: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 34PHj3Xk093554; Thu, 25 May 2023 17:45:03 GMT (envelope-from git) Date: Thu, 25 May 2023 17:45:03 GMT Message-Id: <202305251745.34PHj3Xk093554@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 73cc3dbce13f - main - riscv pmap: Add an __unused wrapper for a variable only used under PV_STATS. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 73cc3dbce13f987760112be95bf3f0d7a08a57d0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=73cc3dbce13f987760112be95bf3f0d7a08a57d0 commit 73cc3dbce13f987760112be95bf3f0d7a08a57d0 Author: John Baldwin AuthorDate: 2023-05-25 17:44:53 +0000 Commit: John Baldwin CommitDate: 2023-05-25 17:44:53 +0000 riscv pmap: Add an __unused wrapper for a variable only used under PV_STATS. --- sys/riscv/riscv/pmap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 5d35488c415c..ac3565ce69b1 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -187,8 +187,10 @@ __FBSDID("$FreeBSD$"); #ifdef PV_STATS #define PV_STAT(x) do { x ; } while (0) +#define __pv_stat_used #else #define PV_STAT(x) do { } while (0) +#define __pv_stat_used __unused #endif #define pmap_l1_pindex(v) (NUL2E + ((v) >> L1_SHIFT)) @@ -3895,7 +3897,7 @@ pmap_remove_pages(pmap_t pmap) struct rwlock *lock; int64_t bit; uint64_t inuse, bitmask; - int allfree, field, freed, idx; + int allfree, field, freed __pv_stat_used, idx; bool superpage; lock = NULL; From nobody Thu May 25 17:45:05 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRwS13nNmz4WTTF; Thu, 25 May 2023 17:45: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 4QRwS12F5pz3sD0; Thu, 25 May 2023 17:45:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685036705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4qKY36jzQMZHByzFi82KdSj4SPOFp5EZb4YPf5Ex+Uk=; b=UkJERbTjpobRnx+AV1SUrShPARV5QVwF6i+/9IzJo+he2oviWgn2ThVP4gOIcsJ5YDEezT BwanwNgdenvq6WvG17rJzjKR7V1D80KN9sMbdBrtr/QS7mqNXdlJH5T9SIunsgihx03x8j 2Gx12ObXA2+dEOwDlcOqRXsMfpOp9o+0fyMlXw4CoH+JAQe7Jo6j+a/LnTYRvfPyvjj0tE TBN7w5iT6lGD/3XxyIMHI/BX0kPAPui8ct2T33oJs4bn43oWc/NiaaYcfUZIxfY2N8oAuv rtsuutExCSZiYaoRIEHtDZAtOQRs6XXvP0SjxTHaeuHtHqtJsTTyXTZA8zR6qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685036705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4qKY36jzQMZHByzFi82KdSj4SPOFp5EZb4YPf5Ex+Uk=; b=q+axN5418xuXD1DkH8igcUeXUARxvAuC3uZD1IKJcHGXNcQLMw0bZU9GyqSUS3rSn0YVFT JWuyuo/9ucWREVQpQVJTCFal6fYuDmFjrOa24HWocmxgRmOHgqfA+fOHszdf/mc7c088Fv jCdN8xcxzfcVvkzB9WI2tyP+63gDNnH75myogtbTR4X9jWr/iPjeX94DVGiJnJfuAjXN43 CE7BOdxEmERzwTTjvKfvzK5aZf1cdVgWZig6UYv5qlY6JTyrd/VGuIrTxCn2h/X4IK4zUn uejAqngxq2CvuNxdKa0WFB5tU+/W6MChEr/xFc6wt/f3CX/O+RXHFwXGDiUbaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685036705; a=rsa-sha256; cv=none; b=xP+uUcMjrw1pYTvAL/J2nkxUdwHmjhCeMAze7JwTqu1Vnr2OhISF0TPPUabnge149N055+ UTYtrvrfbAGTY/puoKeBaAkOP98y50xmDjyh73H3NAPnDSl2cc3HeDLeg6C4StUn8lcbuC yY5fJCh4CSVfYhdztOJcm1VcqDvNMzWlFOUkHfuoQFqhyGlKNE4150m7nTCQfKDyItsy7E FhbPoZi9OeuVkHu1BteECDfqki/q/NhSElBnCSe4H1RPJKaHkR0htCB0kkM85Pmnvj6kvU lMvA/PKGG5G2qRpMaN3mpy8xacUZjivb2+vlec/AtidxFtdncZX2EjYp5EQXkQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRwS11980zZP7; Thu, 25 May 2023 17:45: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 34PHj5AK093574; Thu, 25 May 2023 17:45:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PHj54m093573; Thu, 25 May 2023 17:45:05 GMT (envelope-from git) Date: Thu, 25 May 2023 17:45:05 GMT Message-Id: <202305251745.34PHj54m093573@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 98d06eea14a5 - main - sys: Enable -Wunused-but-set-variable for clang 15+. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 98d06eea14a5056e22328140fee517a4f0612bf8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=98d06eea14a5056e22328140fee517a4f0612bf8 commit 98d06eea14a5056e22328140fee517a4f0612bf8 Author: John Baldwin AuthorDate: 2023-05-25 17:44:53 +0000 Commit: John Baldwin CommitDate: 2023-05-25 17:44:53 +0000 sys: Enable -Wunused-but-set-variable for clang 15+. It was already enabled for older clang versions and GCC. --- sys/conf/kern.mk | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index be7e452bb6e3..9e977a6e4a01 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -46,12 +46,6 @@ CWARNEXTRA?= -Wno-error=tautological-compare -Wno-error=empty-body \ -Wno-error=pointer-sign CWARNEXTRA+= -Wno-error=shift-negative-value CWARNEXTRA+= -Wno-address-of-packed-member -.if ${COMPILER_VERSION} >= 150000 -# Clang 15 has much more aggressive diagnostics about -# unused-but-set variables. Make these -# non-fatal for the time being. -CWARNEXTRA+= -Wno-error=unused-but-set-variable -.endif .endif # clang .if ${COMPILER_TYPE} == "gcc" From nobody Thu May 25 18:16:50 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRx8f3Kczz4WWp1; Thu, 25 May 2023 18:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QRx8f2jGFz3x6Z; Thu, 25 May 2023 18:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685038610; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vbysc1HIkr7xFHYElBefLvC248SFRiN2A6fohI5wGEA=; b=C/RKFUnW+cxhKP1kSXeC1aVELR1OwhRdmJ3Vn4PuLd1sY0q8mT5DqaOGO6hC+NmTIghTAC MlVez4taey2SfNmG6xsrAGaJdKanupoyE0TygVGgiAzyyDBKXG9AV/ZhFrriT4ztUpIAC+ 9kJNRCNrm/4MSno0On5NHSAy77o2b7oJkJQ/PxPfD+H/kCoB0quVt/zFcmtWcTyxbh+Mcl WJJlNlzYa/4mWGaVvFx1rfMeaaKEG2y+z/ZmYKDtWMtspBjVVOWgrtwJGLyOfXLPGT5Yge g8qFEtpYzt8f5Z5rbEw8nEH0UtWWgAjYojDXiSukqAWQ5m0QCkCPAiAI4rcm0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685038610; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vbysc1HIkr7xFHYElBefLvC248SFRiN2A6fohI5wGEA=; b=PRDr2PSAsq3FJT9HbSCAZ01cxvchGXCXth17rBo+PzLmYDxml8SEMc5ms0qy+wXzOD1H8p gxmP2gw8ofbLJlglt70GziL1R8OjGyXecP9ITnNzd99VS2YssfRr+jfrM9eBt8Gh8GZCSX APiD+5TLTyczBu8v7X+x9j4ITEYTlgnOyrFwzxGgOOLN91TkwCzQBlzKPj0CLZ2kAEQqgt YIYREEelzPtVxZtnuc0w7E2CsfdoAp/Uyicjtlodk5geiXorDP7dPygAMaMRpU+V7Yt09J y+MkdjX2GrBoaZdUO5jrplmdTpWBbDtIW+7/of1ZNJccWwZUpq3RVxT74kMsDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685038610; a=rsa-sha256; cv=none; b=TDstuN9teAuVqr0i4IOZHomqJoZKxrBxGnBYv4qEBxzKplkRTiTHSFLjfvsC/NPKBcRYC2 GSFpYrGrqWwvHoh/tY2JU7fRKYYK2yF+pXWKUJ9ZfRcxZ3N6td51+3/6NEBo3xOnd7kek6 L+vIWhYTH7yApFdzeJorrqQdZ203/RCPmzjeaMvm9T3lVEBatcxbvfB0YACSB1935bAhtV EbB66t2+MWmCiNg7P4dO2xrLFnO+ZsZFMzlV0p3W3BTOoyLdtBXfrdo9keQHYcQeMArmxc uUZtUk4YnUqGFiG3090X4iECBuI5ZeXHhQuG2zyBAAFI6uASToEoTMXCsbjhJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRx8f1nRXzbMs; Thu, 25 May 2023 18:16: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 34PIGoek044100; Thu, 25 May 2023 18:16:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PIGomk044099; Thu, 25 May 2023 18:16:50 GMT (envelope-from git) Date: Thu, 25 May 2023 18:16:50 GMT Message-Id: <202305251816.34PIGomk044099@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: 9f35eb8f96a5 - main - ctags: Recognize __attribute__ in function declarations. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9f35eb8f96a55aac92fc0c7d08f4b6ab0ae9bc39 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=9f35eb8f96a55aac92fc0c7d08f4b6ab0ae9bc39 commit 9f35eb8f96a55aac92fc0c7d08f4b6ab0ae9bc39 Author: Dag-Erling Smørgrav AuthorDate: 2023-05-25 17:07:25 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-05-25 18:02:24 +0000 ctags: Recognize __attribute__ in function declarations. MFC after: 1 week Obtained from: NetBSD Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D40264 --- usr.bin/ctags/C.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/usr.bin/ctags/C.c b/usr.bin/ctags/C.c index aca50c67226b..80b6c42a7a5c 100644 --- a/usr.bin/ctags/C.c +++ b/usr.bin/ctags/C.c @@ -39,6 +39,7 @@ static char sccsid[] = "@(#)C.c 8.4 (Berkeley) 4/2/94"; __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -261,6 +262,9 @@ func_entry(void) { int c; /* current character */ int level = 0; /* for matching '()' */ + static char attribute[] = "__attribute__"; + char maybe_attribute[sizeof attribute + 1], + *anext; /* * Find the end of the assumed function declaration. @@ -298,10 +302,37 @@ fnd: * is a token character if it's a function and a non-token * character if it's a declaration. Comments don't count... */ - for (;;) { + for (anext = maybe_attribute;;) { while (GETC(!=, EOF) && iswhite(c)) if (c == '\n') SETLINE; + if (c == EOF) + return NO; + /* + * Recognize the gnu __attribute__ extension, which would + * otherwise make the heuristic test DTWT + */ + if (anext == maybe_attribute) { + if (intoken(c)) { + *anext++ = c; + continue; + } + } else { + if (intoken(c)) { + if (anext - maybe_attribute + < (ptrdiff_t)(sizeof attribute - 1)) + *anext++ = c; + else break; + continue; + } else { + *anext++ = '\0'; + if (strcmp(maybe_attribute, attribute) == 0) { + (void)ungetc(c, inf); + return NO; + } + break; + } + } if (intoken(c) || c == '{') break; if (c == '/' && (GETC(==, '*') || c == '/')) From nobody Thu May 25 18:57:26 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRy3j31x4z4WYtQ; Thu, 25 May 2023 18:57:35 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Received: from sdaoden.eu (sdaoden.eu [217.144.132.164]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4QRy3f6s57z43yr; Thu, 25 May 2023 18:57:34 +0000 (UTC) (envelope-from steffen@sdaoden.eu) Authentication-Results: mx1.freebsd.org; none Date: Thu, 25 May 2023 20:57:26 +0200 Author: Steffen Nurpmeso From: Steffen Nurpmeso To: Ed Maste Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 77d788e23d09 - main - libfetch: specify OpenSSL 1.1 APIs Message-ID: <20230525185726.MsrLK%steffen@sdaoden.eu> In-Reply-To: <202305251716.34PHGwJc044622@gitrepo.freebsd.org> References: <202305251716.34PHGwJc044622@gitrepo.freebsd.org> Mail-Followup-To: Ed Maste , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org User-Agent: s-nail v14.9.24-470-g00466668ef OpenPGP: id=EE19E1C1F2F7054F8D3954D8308964B51883A0DD; url=https://ftp.sdaoden.eu/steffen.asc; preference=signencrypt BlahBlahBlah: Any stupid boy can crush a beetle. But all the professors in the world can make no bugs. X-Rspamd-Queue-Id: 4QRy3f6s57z43yr X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15987, ipnet:217.144.128.0/20, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Hello. Ed Maste wrote in <202305251716.34PHGwJc044622@gitrepo.freebsd.org>: |The branch main has been updated by emaste: | |URL: https://cgit.FreeBSD.org/src/commit/?id=77d788e23d0964053b81b5de307\ |fa04bd1ccadc5 | |commit 77d788e23d0964053b81b5de307fa04bd1ccadc5 |Author: Pierre Pronchery |AuthorDate: 2023-05-25 06:46:02 +0000 |Commit: Ed Maste |CommitDate: 2023-05-25 17:15:45 +0000 | | libfetch: specify OpenSSL 1.1 APIs ... Btw out of interest (sorry to be here again) i looked into that just now, and it seems to me, i may be mistaken and should reread anything from scratch etc etc, that * the client. This includes wildcard matching. The algorithm is based on * RFC6125, sections 6.4.3 and 7.2, which clarifies RFC2818 and RFC3280. */ static int fetch_ssl_hname_match(const char *h, size_t hlen, const char *m, size_t mlen) and its claim /* * there must be at least two more domain labels and * wildcard has to be in the leftmost label (RFC6125) */ that can be verified is the way it works (that code uses too much in-place string-offset calculations so i copied it out to a file "t.c" and tried it by running): #?148|kent:tmp$ tcc -run t.c www.x.com www.x.com #?0|kent:tmp$ tcc -run t.c www.x.com www.xs.com ^ ? -> $? of last command #?1|kent:tmp$ tcc -run t.c www.x.com *.x.com #?0|kent:tmp$ tcc -run t.c www.com *.com #?1|kent:tmp$ jobs ie it really imposes a two-more-domain-labels rule, cannot be found in the mentioned RFC 6125 (despite RFC 2595 defines wildcard, as in Appendix B.1 of 6125)? I think the imposed two-more-domain-labels is libfetch specific. (Other than that looking into causes trouble as re-verifying what i do leads to manual entries like "considered deprecated" for X509_NAME_get_text_by_NID, whereas libfetch is far off. Sigh.) --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) |~~ |..and in spring, hear David Leonard sing.. | |The black bear, The black bear, |blithely holds his own holds himself at leisure |beating it, up and down tossing over his ups and downs with pleasure |~~ |Farewell, dear collar bear From nobody Thu May 25 19:09:17 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRyK95ftnz4WZRR; Thu, 25 May 2023 19:09: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 4QRyK958Twz45Rh; Thu, 25 May 2023 19:09:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685041757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7C5tSaynDSGBfk0xpVDOkBIhojz+LaL2zdLxVW+LNIU=; b=AHrWdHnMatW2YMZlT9/QWVWEIvGGhd/pleVxbUP3ihxagevHw4Ij0BFngY34Lwt34208Dd bo5lQ6Qx5UfhFcLgYgdYJ7CIkBX/7zG+Ot1WkCV75eNLYfAwZTy2YESFb3z9QwbxqYHxbW goaBGeUnFjCzjNAl4XS8AAnTP/Ag2xSHfkaFvcqyIYBn/r6VS1cRmiMIwfwjcP2t7dumEM w01KbnL4OXCddv0OR4ei7Fc2n8BZOlEkUdxvyPGX7GMbNLsnw+U+kzSVU9AxHuu3bgCVUK 986O8mEzKLDJTHxsm3Cw3GGj1VK+OY7jkjeSlhxrodj7A0BwjaHZn4dSF8thcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685041757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7C5tSaynDSGBfk0xpVDOkBIhojz+LaL2zdLxVW+LNIU=; b=iqC9HdCdZ90nznZ47/jpXk1I/TbuFSmRMd2xNuXkVd1HdvV+7mTXfx7UReOzHANoLw/hSK A2dVqiX5IEFKi/KAmCfzCYfgBWNrmt2vRq3jwNOW2oIsCidJTS4d5BB7sFAYG09n4HxLzv pkebPetxs6ioG3lQAv4tmNuOM9zTArSjWc/tzhd+x6dWGoz1ic5VcqBE3ZuLXDL7XyIV8+ W4f1nH8hKr69nPmynaHdYeoNgVGWb1J3Ex9YuVgSQs40dGz6IxgvTHl8LFecADMUVLun+x 5V5OmSiRuLAbrm1lrdUso1Frb4GhfR6/DxOJ9ZjfDMFCrM6n4zs2H9FTaDAp1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685041757; a=rsa-sha256; cv=none; b=ivQmAL5Au69ffexwYHMIiWqrUkMx3133NDJfy7Mj9HOPUOPvo6eobN/wdVRnbSBMrohpJK cUYjgckOoANgPArrPn71EhsYkxuO2yShDi3VcIdgcCnEv7mAzc7sBYW16kPmdlF46aE4uk xO4iudJLy0LU6oK7baHN8g04PwpTZ57jiSFjAEUrOlXp128zS5zfX34AnB59lSTlcTu7Z5 I5dct9OC0CV+LJZ4aiz29duytO4Lqr/1+7BPAScPAux+hBeYpIz4p+YcBg0JsQvEf6jm0Q lw9kZRY4Czl36lDMt0KSH4ML1NmVGQvE68R2EQ3GYPPTjuiucXBJYuaBs7amvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QRyK94DmBzcbV; Thu, 25 May 2023 19:09:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34PJ9H8X026808; Thu, 25 May 2023 19:09:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PJ9HWq026807; Thu, 25 May 2023 19:09:17 GMT (envelope-from git) Date: Thu, 25 May 2023 19:09:17 GMT Message-Id: <202305251909.34PJ9HWq026807@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 5a7500dab9b8 - main - libarchive: Request the OpenSSL 1.1 API List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5a7500dab9b8480dacd5a9b70bad1541391342e4 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5a7500dab9b8480dacd5a9b70bad1541391342e4 commit 5a7500dab9b8480dacd5a9b70bad1541391342e4 Author: Pierre Pronchery AuthorDate: 2023-05-25 07:26:58 +0000 Commit: Ed Maste CommitDate: 2023-05-25 19:08:05 +0000 libarchive: Request the OpenSSL 1.1 API OPENSSL_API_COMPAT can be used to specify the OpenSSL API version in use for the purpose of hiding deprecated interfaces and enabling the appropriate deprecation notices. This change is a NFC while we're still using OpenSSL 1.1.1 but will avoid deprecation warnings upon the switch to OpenSSL 3.0. A future update should migrate to use the OpenSSL 3.0 APIs. PR: 271615 Reviewed by: emaste Event: Kitchener-Waterloo Hackathon 202305 Sponsored by: The FreeBSD Foundation --- lib/libarchive/Makefile.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libarchive/Makefile.inc b/lib/libarchive/Makefile.inc index 409e1972191d..a03f87d7b6c3 100644 --- a/lib/libarchive/Makefile.inc +++ b/lib/libarchive/Makefile.inc @@ -10,6 +10,7 @@ CFLAGS+= -DPLATFORM_CONFIG_H=\"${.CURDIR}/config_freebsd.h\" .if ${MK_OPENSSL} != "no" CFLAGS+= -DWITH_OPENSSL +CFLAGS+= -DOPENSSL_API_COMPAT=0x10100000L LIBADD+= crypto .else LIBADD+= md From nobody Thu May 25 20:04:22 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QRzXw5NhFz4Wf79; Thu, 25 May 2023 20:04:32 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QRzXw3kRqz4Hgf; Thu, 25 May 2023 20:04:32 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-4f3b5881734so3081194e87.0; Thu, 25 May 2023 13:04:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685045070; x=1687637070; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RtWKryacB6ByX99GSzO6p5DQtpCR6WUVLTZb+ohdc24=; b=KrkSL7ezsLAD922KnOnmPohOhJVI8LGgU8zj38vY5LBV1++/EArTLU8xOYkIBsnwHX hPP5Js5S5TrfeyA17M2WdJykdF01HcM6diHwogNeZeuzW8TeoXtJxTHSsVX/xtdmt93O VotNRSgwY1Wm0miH8tWxAB3pT888+DXR1/7JTxoOyvxx5jfCifs04UW7USJiqZ8USZol /AoRQLUmOdO/iBJsrwgCsAgx9o3nox6S1NU31GvaCUlv/w0AGh3sGmfv16OphKbVy04W dQ/TTE2Nm2zusrlzJzIb9Rm3EOX+kUKB1y5/z0ug7Mf9KWwOXqfBO0sTFQeRSfedSe3b tbIQ== X-Gm-Message-State: AC+VfDwuDfB0XZV4gfbdAVLv/kS6r/rNhjvjV/JKPTMWOHwrdodf3NEA T4FTHBgJh8jQVqLUUJAvFBlLbzgpEU2d7zofGwUKRTSY X-Google-Smtp-Source: ACHHUZ7NzG5eJ9MenyJRbNNyn+8qSvfvgfo9gwMuIaJC7O2uL2xyfbw14rIyg/G77EWcWzptgxvlxda97Xz78eRQqU8= X-Received: by 2002:a19:c513:0:b0:4f3:ba53:35f2 with SMTP id w19-20020a19c513000000b004f3ba5335f2mr5725178lfe.49.1685045069673; Thu, 25 May 2023 13:04:29 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202305251622.34PGM6mN060353@gitrepo.freebsd.org> In-Reply-To: From: Ed Maste Date: Thu, 25 May 2023 16:04:22 -0400 Message-ID: Subject: Re: git: 01aee8c92d93 - main - libfetch: do not call deprecated OpenSSL functions To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4QRzXw3kRqz4Hgf X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Thu, 25 May 2023 at 12:49, John Baldwin wrote: > > > +#if OPENSSL_VERSION_NUMBER < 0x10100000L > > /* Init the SSL library and context */ > > if (!SSL_library_init()){ > > fprintf(stderr, "SSL library init failed\n"); > > @@ -1211,6 +1212,7 @@ fetch_ssl(conn_t *conn, const struct url *URL, int verbose) > > } > > > > SSL_load_error_strings(); > > +#endif > > Should we just remove this code outright? I don't think there's any value in > supporting pre-1.1 OpenSSL versions? Indeed that should be our end goal, but my initial desire is for minimal changes. I also think there's some value in having these functions as placeholders for now, in case anything with OpenSSL's automatic init doesn't work as expected. From nobody Thu May 25 20:41:32 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QS0Mc37N7z4Wgs8; Thu, 25 May 2023 20:41: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 4QS0Mc2b1Nz4Nw6; Thu, 25 May 2023 20:41:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685047292; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7q4ZpRNDNU4qlRkELXe8ts2bnT5+o8gDyMbWBBLqWH4=; b=XbUwJZWd9YgS3jxfzXPGTjo2tRqXSIfpMn+bCIHZPHR/kwxsrH+aYechOLUg0vZ+sOuHuE KZXe9d2Y6bRo9+ei86HygBpjIMaKUi2gFxx2MxDJFqa1iybFTgNKV13t9v5s3qeSaX1PeY y4H1GafLitMsnI9jPvoeFqNdnhk/cFH6C5HS10b8UBhxoysAz6p7HMVztR+l288WxMO6Xm JGZRSume1jTJeWxqWNOQfYWpa9OPYtDUnBQZlmPTkTg9tdlVGK9a1Hz14dyjD4xtb6jh69 WGxwfA4d7TJG+rpj3sUnyZbPvT73z60Y5eG/M6j089JpX0BV27tAmvQOjuc3NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685047292; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7q4ZpRNDNU4qlRkELXe8ts2bnT5+o8gDyMbWBBLqWH4=; b=iUJKTeiSod/OIXAgD7jhhuZDqCH+we90GzAexp8nu7IUb6ZS1my3BLBOmSo0TAjpuOv0qp cGOFNdnj9If86NG8EDq/WzFYl/MPbGT5J1xZ4DCxBN4ubvWv0mzJoQPxOYM8pCFRAOE/rh HbQB/COze6/rSbS8TRC7q/Xb8568JnBpy9FLJdQofxVhCqPn/VtUMOLsRKYppUjTdJU5H3 6uZYUFOZUr+kP9VKGKjXzeM2PAL1Nbjb9oaHv/fty893dS+QxLppfmPGTyy7hSvphYC8AN uK2YGEmH4lqGohzaKW9WRPRx+/2uQQA+sh4iNWRKPQMHI+r+mspKTDBnexPWaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685047292; a=rsa-sha256; cv=none; b=xWUV7l79ahKJJHboiEf31WhAdh3R6itOUXcsFk/Wsj88v3VgI2xvNrqfCRlQDaQZLMqR2n qllZlC3my+JPOV8Rzpftu0tTa2rDgIV3vQPCoNYZ8O/QC5abc66KAMb/mYDaBFO6+JGjlZ Q9M4cpesUbMtl82sNH4FwlxUeGwfIlNO7+dYRHFiju7p54t2aAOCmd06leM8qzoWnECWXa N3xFm+dtNBMaolpCumVqYfkv5dZLoRqcPWUMBJI2eH3j1l7WnxL07G0lF2IOnLyTO5Q4CP p0AXgf8gEvhFC4DOB5WlUucjGRXnSJamYohSLQG735lVLqowI+cWr2/ucy0oqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QS0Mc1fjwzfYn; Thu, 25 May 2023 20:41:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34PKfWTF086024; Thu, 25 May 2023 20: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 34PKfWd7086008; Thu, 25 May 2023 20:41:32 GMT (envelope-from git) Date: Thu, 25 May 2023 20:41:32 GMT Message-Id: <202305252041.34PKfWd7086008@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 855ade9e722a - main - kinst: be explicit about trampoline placement List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 855ade9e722a5c3f7363f5f78798bdfedadb1005 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=855ade9e722a5c3f7363f5f78798bdfedadb1005 commit 855ade9e722a5c3f7363f5f78798bdfedadb1005 Author: Christos Margiolis AuthorDate: 2023-05-25 20:40:46 +0000 Commit: Christos Margiolis CommitDate: 2023-05-25 20:40:46 +0000 kinst: be explicit about trampoline placement The current implementation and comment was specific to amd64. Even though in the case of kinst's supported architectures (RISC-V and ARM64) VM_MIN_KERNEL_ADDRESS is equal to KERNBASE, it's better to be explicit. Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40266 --- sys/cddl/dev/kinst/trampoline.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/sys/cddl/dev/kinst/trampoline.c b/sys/cddl/dev/kinst/trampoline.c index 5575503f60fb..75efd022fb20 100644 --- a/sys/cddl/dev/kinst/trampoline.c +++ b/sys/cddl/dev/kinst/trampoline.c @@ -68,15 +68,22 @@ kinst_trampchunk_alloc(void) sx_assert(&kinst_tramp_sx, SX_XLOCKED); +#ifdef __amd64__ /* - * Allocate virtual memory for the trampoline chunk. The returned - * address is saved in "trampaddr". To simplify population of - * trampolines, we follow the amd64 kernel's code model and allocate - * them above KERNBASE, i.e., in the top 2GB of the kernel's virtual - * address space. Trampolines must be executable so max_prot must - * include VM_PROT_EXECUTE. + * To simplify population of trampolines, we follow the amd64 kernel's + * code model and allocate them above KERNBASE, i.e., in the top 2GB of + * the kernel's virtual address space (not the case for other + * platforms). */ trampaddr = KERNBASE; +#else + trampaddr = VM_MIN_KERNEL_ADDRESS; +#endif + /* + * Allocate virtual memory for the trampoline chunk. The returned + * address is saved in "trampaddr". Trampolines must be executable so + * max_prot must include VM_PROT_EXECUTE. + */ error = vm_map_find(kernel_map, NULL, 0, &trampaddr, KINST_TRAMPCHUNK_SIZE, 0, VMFS_ANY_SPACE, VM_PROT_ALL, VM_PROT_ALL, 0); From nobody Thu May 25 20:47:56 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QS0W10K5Hz4CdQc; Thu, 25 May 2023 20:47: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 4QS0W06qcCz4PsG; Thu, 25 May 2023 20:47:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685047677; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hL7baf91hoVkQsaQ25i1w7xxPX2Fn/9s7KBwyxsx1AY=; b=uRuRlrpTQC3UlN7w5iuIyvDM0p9zkp6gwRQ28lsvWpc/TxNkMA4gdI8S98Kqn3MCXGWS42 qpxobX2sDY3V8yha0oLxA/Y0yOQnJwqitMZJ295x7cSznlwjfE6833/kcnEc8w4W5frIgb hOMOod1vQjIbw4hBbSw2dW4He9NJq91YoV17Pf1m2ay1ZAEc0H5YmSyBGPZpzrCH63xYYO cNJGJzMY/2jeqpbkkqWIfjCl9bOanC8bKIPFi/L7SiQhOS79GyI7BW15i7T7YH0AG9pLyA WnSQeRfw1xwhcxVRZkxqasdEOP2n5uqGAvDVaHykNZRsdBvSE1U2m4YABQVCKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685047677; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hL7baf91hoVkQsaQ25i1w7xxPX2Fn/9s7KBwyxsx1AY=; b=FlsLXMuWggies0UldFBDrMAUv1TPLkn6aPvYHEMKsV/H50U+z5VOMURl2yvZZPTjQj51PQ topv3sXLijs76F9760NLYKHbaViM9XULy4KLtyE1j2aCeojNYHAUQsiTlU0oTzAWdCdNj/ qPSA4kdppsdU05AJfnrTVPPPGinIq8XQACC6qQ1aIHc7y4nNpP8O5zVLcKbMfU4mK75BKu 2XTgrFpWahCVZD9iaWsZHLeY7whwvSUeK0M7jHOZYwirapKA9wZDs7gvOSYdDP7sEXhJV3 FuXBPtdoCjedyf11oMdkWXdc5S+tc/oSZe2bkP743jVVLE8XZkrcTekwBSqDPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685047677; a=rsa-sha256; cv=none; b=y340Qh+bMQo6Jp8WIk3yoapMsRpyb9ms0F7sqB/ATTugok7UtKVF0iHdU45z0OdbZ9L5rh cF+58LVnTW3dm7hRJQjydgl7QQsYbkQtYQWRlofKeo7KoRHF8UySmgIPUfcI37On6f4goS 9GTqmn51OLkdBrY4PE8wZEbn3YmuZ56bZ7r9SrUC6kYqJAV9kmzus3eV3jF35eku64E8uK 6XFU5M04i+MAEQy6zwbtzSZGPA+6s9pcQLOiamLta44pH39WgRB8gVju6ZVqBEolKyCF+N 14ebdbKjfqs8ufdp+UA1/D8Y9K2StPkE9D1iGGUl8OwOOyINxGmxQ/8drPSQBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QS0W05rD0zfqx; Thu, 25 May 2023 20:47: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 34PKluqu091549; Thu, 25 May 2023 20:47:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PKlukX091548; Thu, 25 May 2023 20:47:56 GMT (envelope-from git) Date: Thu, 25 May 2023 20:47:56 GMT Message-Id: <202305252047.34PKlukX091548@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 9105ba047181 - main - ofw: remove redundant calls in ofwbus_attach() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9105ba047181a5b4a04046557d41849c92d6a787 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=9105ba047181a5b4a04046557d41849c92d6a787 commit 9105ba047181a5b4a04046557d41849c92d6a787 Author: Christos Margiolis AuthorDate: 2023-05-25 20:47:41 +0000 Commit: Christos Margiolis CommitDate: 2023-05-25 20:47:41 +0000 ofw: remove redundant calls in ofwbus_attach() Since commit ecaecbc7d8bc212d8e854088106b3b21e631bb52, calling ofw_bus_gen_setup_devinfo() is redundant, as the call to device_set_ivars() now happens inside simplebus_add_device(). Reviewed by: markj Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D40271 --- sys/dev/ofw/ofwbus.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/dev/ofw/ofwbus.c b/sys/dev/ofw/ofwbus.c index b35a3ce968e6..2b32d5a539c4 100644 --- a/sys/dev/ofw/ofwbus.c +++ b/sys/dev/ofw/ofwbus.c @@ -102,7 +102,6 @@ static int ofwbus_attach(device_t dev) { phandle_t node; - struct ofw_bus_devinfo obd; node = OF_peer(0); @@ -126,12 +125,9 @@ ofwbus_attach(device_t dev) /* * Now walk the OFW tree and attach top-level devices. */ - for (node = OF_child(node); node > 0; node = OF_peer(node)) { - if (ofw_bus_gen_setup_devinfo(&obd, node) != 0) - continue; + for (node = OF_child(node); node > 0; node = OF_peer(node)) simplebus_add_device(dev, node, 0, NULL, -1, NULL); - ofw_bus_gen_destroy_devinfo(&obd); - } + return (bus_generic_attach(dev)); } From nobody Thu May 25 20:53:07 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QS0cz5n1qz4Cddw; Thu, 25 May 2023 20:53: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 4QS0cz5G1Wz4Qbk; Thu, 25 May 2023 20:53:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685047987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m/eTG4ZsJqF1F3ezjPgiLX+tdU92/a0ma6+POoZRfGk=; b=AHJDf9Ujx+zuSxyf+RY8SWZiD4jTKxROYVpjPSeg4Qb/XUvKJylTi9NfnpyJn/p4R4c9db wnmrEb8nxbUVihkgIEuA3NnoDJa/lyZjISfdC6mxKwVb20FQwXjnCQCFWmOZYC1J0o8jIs CAj3sv796mp+F9WJ3VebIKN9YR7Dod8y+GA7aMR+VlCFnhpr/d1XZ8/JF4x/hU3T1xVU17 xVb7qnQQUtlbrd9eCeYv/ZlZi12yGIrr+vjikk1vSK5zkqh+TRjfqLCDLc1NwTlh6YIeka RGsir2MMyFNPTl9J2AFaxd4FSjt9nlLL48X2SyOlwnBmt9cZNoLBHvs8BYMrzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685047987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m/eTG4ZsJqF1F3ezjPgiLX+tdU92/a0ma6+POoZRfGk=; b=YUBQNn5OAyfzK9iX41UwOM0ZqXFHCKIP66N5FDuIo5QSc/96g07YHZxenyVeA/+6NqkJZn VDILJdZZguCoeMtLVp/5rjlqEByIcE3VCDmiGnB0UtWnaAjmp+Ho8PaqWwSIA6ChxMflJa slqACo8cWxJasiVRReY+aXtdsS3KIhiD+RZA2jmPQG8muG1MWxbI2CMLIzVsN/vMntkT9Q o8mEkA0kdSkac4DJXAkq544bt03718e1pTKRJRY3VkXgRw5W4XLbx/ikUUcGS9wEsfvSZz ORUQDIqZ3EuXHpHs68KhXT2NGLJE1ASCaYiG+TDMoiByO1rK8HF4OjqTxV2UyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685047987; a=rsa-sha256; cv=none; b=JFTSpZEywbVOB1zUeLQZXIbo/vaWcbTA6/LDwo8fjCjDTSfWpmXiS6UmUTC0mHkoDajhqi rXfc22HoB5fAu/MUrBgzF0mp7a/gvsuvRvrRL1KnXLFO4KJod2dYqQof3lmlAjC6KNrCiR +5t4BrsFrd85QRtleGpaD71JfUZ4MVBvAnz9mQ7Kwa8IhDTW5KKfqZ5s5JuQfDvx7jDWPv a2Q2wWvrPLMgbgUTiigmhLlvtEC/lwhhCwrGWzCj3e77CGA0i8ukypvtX8dzraw6seEM3y RzhJQpCXQnkc8BS8GwOs4nQkcdhpiO+rpBCrlFV9jilkMY7NY4hPaSeAed7/TQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QS0cz4KGFzfcQ; Thu, 25 May 2023 20:53: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 34PKr7Al007505; Thu, 25 May 2023 20:53:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PKr7Jr007504; Thu, 25 May 2023 20:53:07 GMT (envelope-from git) Date: Thu, 25 May 2023 20:53:07 GMT Message-Id: <202305252053.34PKr7Jr007504@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: fed03614bd2d - main - factor: Request the OpenSSL 1.1 API List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fed03614bd2d070ffb351af8042fda9805341c29 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=fed03614bd2d070ffb351af8042fda9805341c29 commit fed03614bd2d070ffb351af8042fda9805341c29 Author: Pierre Pronchery AuthorDate: 2023-05-25 17:44:47 +0000 Commit: Ed Maste CommitDate: 2023-05-25 20:52:52 +0000 factor: Request the OpenSSL 1.1 API OPENSSL_API_COMPAT can be used to specify the OpenSSL API version in use for the purpose of hiding deprecated interfaces and enabling the appropriate deprecation notices. This change is a NFC while we're still using OpenSSL 1.1.1 but will avoid deprecation warnings upon the switch to OpenSSL 3.0. A future change should migrate to use the OpenSSL 3.0 APIs. PR: 271615 Reviewed by: emaste Event: Kitchener-Waterloo Hackathon 202305 Sponsored by: The FreeBSD Foundation --- usr.bin/factor/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.bin/factor/Makefile b/usr.bin/factor/Makefile index dd7466302263..f180c0f135e7 100644 --- a/usr.bin/factor/Makefile +++ b/usr.bin/factor/Makefile @@ -9,6 +9,7 @@ CFLAGS+=-I${SRCTOP}/usr.bin/primes .if ${MK_OPENSSL} != "no" CFLAGS+=-DHAVE_OPENSSL +CFLAGS+=-DOPENSSL_API_COMPAT=0x10100000L LIBADD+=crypto .endif From nobody Thu May 25 21:03:02 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QS0rh3w6Vz4CfXX for ; Thu, 25 May 2023 21:03:16 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QS0rh1jCqz4RVV for ; Thu, 25 May 2023 21:03:16 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-3078a3f3b5fso2547509f8f.0 for ; Thu, 25 May 2023 14:03:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685048594; x=1687640594; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4m11MoNJm3DnIeQCbxGlotbH0yypEKYB0Ut3gY5TMMQ=; b=EUqtt/GzKCgJd+i1z1ctVak/f4b/t+vpsbAXe4Z4PDS+kiRsCwRF5Dsoe0CamDFXi1 YR+4B7WoEZhqs29Nxcb4YCwaoZd+Gjvbf+IpGE1qNsLDu1mR1sHRcNWpMq3YHkv6ll4d WWD6vPzV2TcZ2mNjaOwr4MYafHKQ7wGnQeBKkL0qyAySdAvxMGAY9VPKbuNZQSy671wB Pvo6zUcLPmOwrkmH9KEq6CiMOQ7/OCZ1CV75F19rw8B6yWJGRbluYXcoTA9Q6QxzgRxf pj+szTPlDcxTZuka1Y6zq94li6lMRVaMi/hKwlqLPse38Q2vBC8kXLxaBSzo9AnFGEfD YN9Q== X-Gm-Message-State: AC+VfDypzhAZlighpgdjErBbbarjuchV9RFO/eKGKltCBk0KyuzdStgq a0gnus1/ysU524CVR8b28JuykA== X-Google-Smtp-Source: ACHHUZ635ohZ6ipbqigGTqdDll3bHE8BW7G4S3cucf2zL6X1Wlfho1cXh8lTJhKubqYEMZBEOBNGbg== X-Received: by 2002:adf:ff8d:0:b0:2dc:cad4:87b9 with SMTP id j13-20020adfff8d000000b002dccad487b9mr3700837wrr.68.1685048593715; Thu, 25 May 2023 14:03:13 -0700 (PDT) Received: from smtpclient.apple ([131.111.5.246]) by smtp.gmail.com with ESMTPSA id o4-20020a5d4744000000b003062675d4c9sm2895552wrs.39.2023.05.25.14.03.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 May 2023 14:03:13 -0700 (PDT) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: git: 48f52d9179d5 - main - zfs: Fix build on 32-bit platforms after most recent import. From: Jessica Clarke In-Reply-To: <202305251412.34PECDM9045900@gitrepo.freebsd.org> Date: Thu, 25 May 2023 22:03:02 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <029A33E2-BB27-4D43-808B-1634E7EA69C0@freebsd.org> References: <202305251412.34PECDM9045900@gitrepo.freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.3731.500.231) X-Rspamd-Queue-Id: 4QS0rh1jCqz4RVV X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On 25 May 2023, at 15:12, John Baldwin wrote: >=20 > The branch main has been updated by jhb: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D48f52d9179d5920750cef0c5d921db63= de4d767d >=20 > commit 48f52d9179d5920750cef0c5d921db63de4d767d > Author: John Baldwin > AuthorDate: 2023-05-25 14:11:38 +0000 > Commit: John Baldwin > CommitDate: 2023-05-25 14:11:38 +0000 >=20 > zfs: Fix build on 32-bit platforms after most recent import. >=20 > unsigned long is not a uint64_t on 32-bit platforms. The zfs.4 > manpage documents this variable as a uint, and it is only compared > with other variables of type int, so uint_t makes more sense than > unsigned long. >=20 > (I also wasn't sure if ULONG would work as a ZFS_MODULE_PARAM type > on other OS's) FYI https://github.com/openzfs/zfs/pull/14894 Jess > --- > sys/contrib/openzfs/module/zfs/dsl_scan.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/sys/contrib/openzfs/module/zfs/dsl_scan.c = b/sys/contrib/openzfs/module/zfs/dsl_scan.c > index 5e3559b251e3..07a527e332bc 100644 > --- a/sys/contrib/openzfs/module/zfs/dsl_scan.c > +++ b/sys/contrib/openzfs/module/zfs/dsl_scan.c > @@ -234,7 +234,7 @@ static int zfs_resilver_disable_defer =3D B_FALSE; > static int zfs_free_bpobj_enabled =3D 1; >=20 > /* Error blocks to be scrubbed in one txg. */ > -unsigned long zfs_scrub_error_blocks_per_txg =3D 1 << 12; > +uint_t zfs_scrub_error_blocks_per_txg =3D 1 << 12; >=20 > /* the order has to match pool_scan_type */ > static scan_cb_t *scan_funcs[POOL_SCAN_FUNCS] =3D { > @@ -5242,6 +5242,6 @@ ZFS_MODULE_PARAM(zfs, zfs_, scan_report_txgs, = UINT, ZMOD_RW, > ZFS_MODULE_PARAM(zfs, zfs_, resilver_disable_defer, INT, ZMOD_RW, > "Process all resilvers immediately"); >=20 > -ZFS_MODULE_PARAM(zfs, zfs_, scrub_error_blocks_per_txg, U64, ZMOD_RW, > +ZFS_MODULE_PARAM(zfs, zfs_, scrub_error_blocks_per_txg, UINT, = ZMOD_RW, > "Error blocks to be scrubbed in one txg"); > /* END CSTYLED */ From nobody Thu May 25 22:10:29 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QS2LF29T1z4Cjq4; Thu, 25 May 2023 22:10: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 4QS2LF1hFnz4Vkl; Thu, 25 May 2023 22:10:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685052629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ogLkSx3z3RfmvLcjTOJn62TNGFh12zbNt8tMbCJOy6I=; b=vFFWBTYmGlSqaBPDyD++82jnUg+zXezTjgXKLRrDmyEcD8gMTK5HEbl62lFOF/SNVl6Y5F WsMSV9QUDuLfqa3eTfV9jnnEpjBA/7UwxkPXRvOVdJ8P4Ea8nKehdekoDbc2/z8DJTUcXK phpAUuIlRaYwhAOLmuyl1UaDQ0K9Cdty+MxepmXGw0tiJ7SDztDAE6+eo2RRMcItFG95b8 l2T634lngcVSC4MpsM0+Xd8KzaKMl2B9D4n6N+siduQH9BtEyUMve65X6kO9lpy7svC8Na V9U0RE1rLcYBhsLD6frLXosTX2R87PkWt7p0iDmQgOIUYQLBVvSvJLJXYanG5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685052629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ogLkSx3z3RfmvLcjTOJn62TNGFh12zbNt8tMbCJOy6I=; b=PqSrp9ILCBBXq6bkJNULJI28ROG6wSsVeNfK0gQMjUvT+EXG+OZgX9QyJX+INuzoPFG+3w nsz0MDJ0UBKdR0af3OPz36YkppGen9iK6KpxrmUPrXMI//BtBTs5M2pQYipgYf2UDMfyXE 0c1Y8Oj/yk//lTjILsCbj3x4h+KKFI6QbNk6I9bIwnLmd2WfaoadYbXvetp+U18/k2+aVa DkCxPBwlKr2QEOqk47OIEAcxREZ+pB4WH8hDI6ZjOCdfxovQSLHCGmLRguSxlZKhxJM/Ad mQv8Ink1GG4TDkOfdSHEX1m6h+qiKKzTrcoUyfkSJmiFQ8rJMiM4TmwafuSOtA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685052629; a=rsa-sha256; cv=none; b=aenHGaCtR4jxylxY/ktFp3nQxgkoFryMCGvJcxZGIsTD2tsbtCI+SW8IqUgHOZ3EwVV9XQ vPjLEJU65PXw+CB7HnHqDRWoD1o/CgABWvNBijdD3meRsCNktG2ecAacfu+lf+KM7caxl0 JL2s/LNpn3g52ZHZl3XHHOup7mr/w48vm70dIiwLCjQFDYZu+SQAg5tTCotfxcdWRA/38u Rxunql32bZym4daspsyzcXoX63vnOuK1QCPCGSo8D2508xj00lLHFxnzQd3EJPCw539alX MKdDivPf+KJf+f0FqGbuETDnyQE9oxmF5TpO835ZN6JmIjqvMSLx12fLqHsmng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QS2LF0lQWzhnC; Thu, 25 May 2023 22:10: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 34PMATkw032833; Thu, 25 May 2023 22:10:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PMATMV032832; Thu, 25 May 2023 22:10:29 GMT (envelope-from git) Date: Thu, 25 May 2023 22:10:29 GMT Message-Id: <202305252210.34PMATMV032832@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 9fb6718d1b18 - main - smp: Dynamically allocate the stoppcbs array List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9fb6718d1b180c341373b25c03dbfc221ddee311 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9fb6718d1b180c341373b25c03dbfc221ddee311 commit 9fb6718d1b180c341373b25c03dbfc221ddee311 Author: Mark Johnston AuthorDate: 2023-04-25 16:09:24 +0000 Commit: Mark Johnston CommitDate: 2023-05-25 22:09:55 +0000 smp: Dynamically allocate the stoppcbs array This avoids bloating the kernel image when MAXCPU is large. A follow-up patch for kgdb and other kernel debuggers is needed since the stoppcbs symbol is now a pointer. Bump __FreeBSD_version so that debuggers can use osreldate to figure out how to handle stoppcbs. PR: 269572 MFC after: never Reviewed by: mjg, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39806 --- sys/amd64/include/kdb.h | 2 -- sys/arm/arm/mp_machdep.c | 1 - sys/arm/include/kdb.h | 2 -- sys/arm/include/smp.h | 3 --- sys/arm64/arm64/mp_machdep.c | 2 -- sys/arm64/include/smp.h | 3 --- sys/i386/include/kdb.h | 2 -- sys/kern/subr_kdb.c | 6 +++--- sys/kern/subr_smp.c | 7 +++++++ sys/powerpc/include/kdb.h | 2 -- sys/powerpc/include/smp.h | 2 -- sys/powerpc/powerpc/mp_machdep.c | 1 - sys/riscv/include/kdb.h | 2 -- sys/riscv/include/smp.h | 2 -- sys/riscv/riscv/mp_machdep.c | 2 -- sys/sys/param.h | 2 +- sys/sys/smp.h | 3 +++ sys/x86/include/x86_smp.h | 1 - sys/x86/x86/mp_x86.c | 1 - 19 files changed, 14 insertions(+), 32 deletions(-) diff --git a/sys/amd64/include/kdb.h b/sys/amd64/include/kdb.h index e2a16ccca0eb..6612bfce6361 100644 --- a/sys/amd64/include/kdb.h +++ b/sys/amd64/include/kdb.h @@ -34,8 +34,6 @@ #include #include -#define KDB_STOPPEDPCB(pc) &stoppcbs[pc->pc_cpuid] - int kdb_cpu_set_watchpoint(vm_offset_t addr, vm_size_t size, int access); int kdb_cpu_clr_watchpoint(vm_offset_t addr, vm_size_t size); diff --git a/sys/arm/arm/mp_machdep.c b/sys/arm/arm/mp_machdep.c index 36a38291dd3a..b823270eb1c9 100644 --- a/sys/arm/arm/mp_machdep.c +++ b/sys/arm/arm/mp_machdep.c @@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$"); /* used to hold the AP's until we are ready to release them */ struct mtx ap_boot_mtx; -struct pcb stoppcbs[MAXCPU]; /* # of Applications processors */ volatile int mp_naps; diff --git a/sys/arm/include/kdb.h b/sys/arm/include/kdb.h index fde37d148fb6..3fed40807761 100644 --- a/sys/arm/include/kdb.h +++ b/sys/arm/include/kdb.h @@ -36,8 +36,6 @@ #include #include -#define KDB_STOPPEDPCB(pc) &stoppcbs[pc->pc_cpuid] - extern void kdb_cpu_clear_singlestep(void); extern void kdb_cpu_set_singlestep(void); boolean_t kdb_cpu_pc_is_singlestep(db_addr_t); diff --git a/sys/arm/include/smp.h b/sys/arm/include/smp.h index 4f1545872a4e..fbb769151de6 100644 --- a/sys/arm/include/smp.h +++ b/sys/arm/include/smp.h @@ -29,7 +29,4 @@ void ipi_selected(cpuset_t cpus, u_int ipi); void platform_mp_setmaxid(void); void platform_mp_start_ap(void); -/* global data in mp_machdep.c */ -extern struct pcb stoppcbs[]; - #endif /* !_MACHINE_SMP_H_ */ diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c index 9a4997358f8a..9dd1182e5721 100644 --- a/sys/arm64/arm64/mp_machdep.c +++ b/sys/arm64/arm64/mp_machdep.c @@ -126,8 +126,6 @@ static void ipi_preempt(void *); static void ipi_rendezvous(void *); static void ipi_stop(void *); -struct pcb stoppcbs[MAXCPU]; - #ifdef FDT static u_int fdt_cpuid; #endif diff --git a/sys/arm64/include/smp.h b/sys/arm64/include/smp.h index 538981a954f0..1404a72f13cc 100644 --- a/sys/arm64/include/smp.h +++ b/sys/arm64/include/smp.h @@ -49,7 +49,4 @@ void ipi_all_but_self(u_int ipi); void ipi_cpu(int cpu, u_int ipi); void ipi_selected(cpuset_t cpus, u_int ipi); -/* global data in mp_machdep.c */ -extern struct pcb stoppcbs[]; - #endif /* !_MACHINE_SMP_H_ */ diff --git a/sys/i386/include/kdb.h b/sys/i386/include/kdb.h index 53fbe6cbe908..47a8ff86fd44 100644 --- a/sys/i386/include/kdb.h +++ b/sys/i386/include/kdb.h @@ -34,8 +34,6 @@ #include #include -#define KDB_STOPPEDPCB(pc) &stoppcbs[pc->pc_cpuid] - int kdb_cpu_set_watchpoint(vm_offset_t addr, vm_size_t size, int access); int kdb_cpu_clr_watchpoint(vm_offset_t addr, vm_size_t size); diff --git a/sys/kern/subr_kdb.c b/sys/kern/subr_kdb.c index 79b61f67b1e0..f8b37c2319b0 100644 --- a/sys/kern/subr_kdb.c +++ b/sys/kern/subr_kdb.c @@ -627,18 +627,18 @@ kdb_reenter_silent(void) struct pcb * kdb_thr_ctx(struct thread *thr) { -#if defined(SMP) && defined(KDB_STOPPEDPCB) +#ifdef SMP struct pcpu *pc; #endif if (thr == curthread) return (&kdb_pcb); -#if defined(SMP) && defined(KDB_STOPPEDPCB) +#ifdef SMP STAILQ_FOREACH(pc, &cpuhead, pc_allcpu) { if (pc->pc_curthread == thr && CPU_ISSET(pc->pc_cpuid, &stopped_cpus)) - return (KDB_STOPPEDPCB(pc)); + return (&stoppcbs[pc->pc_cpuid]); } #endif return (thr->td_pcb); diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index 00e2396d5774..cdee6fbebb3c 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "opt_sched.h" @@ -76,6 +77,9 @@ int mp_maxcpus = MAXCPU; volatile int smp_started; u_int mp_maxid; +/* Array of CPU contexts saved during a panic. */ +struct pcb *stoppcbs; + static SYSCTL_NODE(_kern, OID_AUTO, smp, CTLFLAG_RD | CTLFLAG_CAPRD | CTLFLAG_MPSAFE, NULL, "Kernel SMP"); @@ -178,6 +182,9 @@ mp_start(void *dummy) if (mp_ncores < 0) mp_ncores = mp_ncpus; + stoppcbs = mallocarray(mp_maxid + 1, sizeof(struct pcb), M_DEVBUF, + M_WAITOK | M_ZERO); + cpu_mp_announce(); } SYSINIT(cpu_mp, SI_SUB_CPU, SI_ORDER_THIRD, mp_start, NULL); diff --git a/sys/powerpc/include/kdb.h b/sys/powerpc/include/kdb.h index f399b7523143..6594acb77fd1 100644 --- a/sys/powerpc/include/kdb.h +++ b/sys/powerpc/include/kdb.h @@ -40,8 +40,6 @@ void kdb_cpu_clear_singlestep(void); void kdb_cpu_set_singlestep(void); -#define KDB_STOPPEDPCB(pc) &stoppcbs[pc->pc_cpuid] - static __inline void kdb_cpu_sync_icache(unsigned char *addr, size_t size) { diff --git a/sys/powerpc/include/smp.h b/sys/powerpc/include/smp.h index 67e9d51f0bc4..6fcff18ffa4b 100644 --- a/sys/powerpc/include/smp.h +++ b/sys/powerpc/include/smp.h @@ -61,8 +61,6 @@ uintptr_t cpudep_ap_bootstrap(void); void cpudep_ap_setup(void); void machdep_ap_bootstrap(void); -extern struct pcb stoppcbs[]; - #endif /* !LOCORE */ #endif /* _KERNEL */ #endif /* !_MACHINE_SMP_H */ diff --git a/sys/powerpc/powerpc/mp_machdep.c b/sys/powerpc/powerpc/mp_machdep.c index df602912b234..59a000e8e24d 100644 --- a/sys/powerpc/powerpc/mp_machdep.c +++ b/sys/powerpc/powerpc/mp_machdep.c @@ -66,7 +66,6 @@ volatile static int ap_awake; volatile static u_int ap_letgo; volatile static u_quad_t ap_timebase; static struct mtx ap_boot_mtx; -struct pcb stoppcbs[MAXCPU]; void machdep_ap_bootstrap(void) diff --git a/sys/riscv/include/kdb.h b/sys/riscv/include/kdb.h index 0fdff26bb432..24c6145853c3 100644 --- a/sys/riscv/include/kdb.h +++ b/sys/riscv/include/kdb.h @@ -31,8 +31,6 @@ #include -#define KDB_STOPPEDPCB(pc) &stoppcbs[pc->pc_cpuid] - static __inline void kdb_cpu_clear_singlestep(void) { diff --git a/sys/riscv/include/smp.h b/sys/riscv/include/smp.h index a1d588f31567..1760647903cb 100644 --- a/sys/riscv/include/smp.h +++ b/sys/riscv/include/smp.h @@ -52,6 +52,4 @@ void ipi_all_but_self(u_int ipi); void ipi_cpu(int cpu, u_int ipi); void ipi_selected(cpuset_t cpus, u_int ipi); -extern struct pcb stoppcbs[]; - #endif /* !_MACHINE_SMP_H_ */ diff --git a/sys/riscv/riscv/mp_machdep.c b/sys/riscv/riscv/mp_machdep.c index cd75f2dbbb73..018d7c653304 100644 --- a/sys/riscv/riscv/mp_machdep.c +++ b/sys/riscv/riscv/mp_machdep.c @@ -88,8 +88,6 @@ static device_attach_t riscv64_cpu_attach; static int ipi_handler(void *); -struct pcb stoppcbs[MAXCPU]; - extern uint32_t boot_hart; extern cpuset_t all_harts; diff --git a/sys/sys/param.h b/sys/sys/param.h index 25fac3efde1d..5bdc3e2ebee4 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -76,7 +76,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1400088 +#define __FreeBSD_version 1400089 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, diff --git a/sys/sys/smp.h b/sys/sys/smp.h index 4583dc4350c9..7c3ce7f4ff8d 100644 --- a/sys/sys/smp.h +++ b/sys/sys/smp.h @@ -178,6 +178,9 @@ extern int smp_threads_per_core; extern cpuset_t all_cpus; extern cpuset_t cpuset_domain[MAXMEMDOM]; /* CPUs in each NUMA domain. */ +struct pcb; +extern struct pcb *stoppcbs; + /* * Macro allowing us to determine whether a CPU is absent at any given * time, thus permitting us to configure sparse maps of cpuid-dependent diff --git a/sys/x86/include/x86_smp.h b/sys/x86/include/x86_smp.h index 9d8e1c4ebaec..356d8b881962 100644 --- a/sys/x86/include/x86_smp.h +++ b/sys/x86/include/x86_smp.h @@ -30,7 +30,6 @@ extern unsigned int boot_address; /* global data in mp_x86.c */ extern int mp_naps; extern int boot_cpu_id; -extern struct pcb stoppcbs[]; extern int cpu_apic_ids[]; extern int bootAP; extern void *dpcpu; diff --git a/sys/x86/x86/mp_x86.c b/sys/x86/x86/mp_x86.c index 34c54b27eeff..581ec0ac518a 100644 --- a/sys/x86/x86/mp_x86.c +++ b/sys/x86/x86/mp_x86.c @@ -99,7 +99,6 @@ int bootAP; void *bootstacks[MAXCPU]; void *dpcpu; -struct pcb stoppcbs[MAXCPU]; struct susppcb **susppcbs; #ifdef COUNT_IPIS From nobody Thu May 25 22:10:30 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QS2LG3Bzwz4Cjq7; Thu, 25 May 2023 22:10:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QS2LG2YGWz4VnZ; Thu, 25 May 2023 22:10:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685052630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tUk0AGeQHQLmAHWA141QCv5Mub75wFIYToKmWCQmKdI=; b=R17KpT/e0jRpt5xHY7584kUhvAiLbCIjxtS6mdMpGq6hmDE4KBfOJXffxPe5IXIsEDfzhO 0u2GQ8cS60IkbtcDlByvw3Nn+mzMTvHCq8xP2oxXB/xkhMaIW2w1eWgiu9owDO2YxXW7xR L2v+6D9RqeXNqTdRjpXYGx3Gr+wieFYWK3ko3Wk2O31qm8PFExcsJpIWs6eYiPqkKPxMff T4ntZroYEKwRvuJ83YKnUylNbXzZERKrWEOs1WRg2ccAWaI3gi/n+N7g4k06n+ekIhK5Ay 2MyfMkKJq8eCG498cyhB3AvTaGs2emZBuGGW/dzOQOr9va4sQkQ9Py03AnnoXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685052630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tUk0AGeQHQLmAHWA141QCv5Mub75wFIYToKmWCQmKdI=; b=FTZPUNjkslV60ogaX+yHP+KaBzM7sqi7Ge3qSb/xwgKGcw0ZJm9UKnfhcm9v/CS0hFm/JB 2dDqfO95mrXIOwAbIsC7iHP7pxoQpaS/r0JQWQiDr0eugdaVPqimSxg6ib1giyNmSXgBga q6lRHO7FCBjOtaGaL2DMxbjHXVrOB1XOEr72QhsA+p55VQTp7VIkpP/tqqJcI3KTwl71b5 SKZ5/wKa1GGu3a4LZj2usocQKyrkpAXA3waclSPrbxw0ruR/R7niS10s0xlgAEWBRQjK6p CIMFLp6v4C7t4JXiBftK1qfQxB63v7XWHAeRqR9Pl9qVm3hGi6fLBALuIuXMeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685052630; a=rsa-sha256; cv=none; b=ac+0f0vt4n5OBRnwkxQbPfv9Qum3o+1ilvacVhISp+Q0yeEpsc7M7WYvrbxHgkIdJJyqsz 2rUocQfsnXR9VEXWnND7CawmvNhPRZpVfVhVxk7NY1Hsg6lgwVOOaq7VqShpbXI1iSRs3o klQrHeWfoamdsPWyrsOtjhDczCm0hof7zr7Ps7FivLynnYSE0fkDFYRqy6YiawXcy3w4t7 8r9Za/ou5Kp4wiJvKgIvKhg7LJ1Mgg2JW1kQNYlzr846VLCygZOyTNPkfthlIg3p1UA6jQ yICSMvcPr8thKmTNL2EoV+Dhq7hDr4S2b0fYCcn5ywiQS0/vKsJjmNv+I+a3iA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QS2LG1fYXzhnD; Thu, 25 May 2023 22:10: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 34PMAU24032854; Thu, 25 May 2023 22:10:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34PMAU2c032853; Thu, 25 May 2023 22:10:30 GMT (envelope-from git) Date: Thu, 25 May 2023 22:10:30 GMT Message-Id: <202305252210.34PMAU2c032853@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: db289ababf90 - main - posixshmcontrol.1: Document posixshmcontrol create -l List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: db289ababf9053236deb945e70167947d36b8692 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=db289ababf9053236deb945e70167947d36b8692 commit db289ababf9053236deb945e70167947d36b8692 Author: Mark Johnston AuthorDate: 2023-05-25 21:08:55 +0000 Commit: Mark Johnston CommitDate: 2023-05-25 22:09:55 +0000 posixshmcontrol.1: Document posixshmcontrol create -l Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D40270 --- usr.bin/posixshmcontrol/posixshmcontrol.1 | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/usr.bin/posixshmcontrol/posixshmcontrol.1 b/usr.bin/posixshmcontrol/posixshmcontrol.1 index 1d8c3438b165..292768c39ce4 100644 --- a/usr.bin/posixshmcontrol/posixshmcontrol.1 +++ b/usr.bin/posixshmcontrol/posixshmcontrol.1 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 26, 2022 +.Dd May 25, 2023 .Dt POSIXSHMCONTROL 1 .Os .Sh NAME @@ -36,6 +36,7 @@ .Sh SYNOPSIS .Nm .Ar create +.Op Fl l Ar pagesize .Op Fl m Ar mode .Op Pa path \&... .Nm @@ -79,10 +80,24 @@ for transient references. The following subcommands are provided: .Bl -tag -width truncate .It Ic create -Create segments with the specified paths, if not exist. +Create segments with the specified paths, if they do not already exist. +.Pp +The optional +.Ar pagesize +argument specifies the size of the virtual pages used to map the +object with +.Xr mmap 2 . +By default, the system page size is used, but on some platforms a +larger page size can be specified. +The size of an object backed by large pages must be a multiple of the +specified page size. The +.Va hw.pagesizes +sysctl variable lists the available page sizes. +.Pp +The optional numerical .Ar mode -optional numerical argument specifies initial access mode. +argument specifies the initial access mode. .It Ic rm Unlink the paths specified. .It Ic ls @@ -138,12 +153,14 @@ and then enlarge it to 1M, use the sequence of commands .Xr hexdump 1 , .Xr stat 1 , .Xr ftruncate 2 , +.Xr mmap 2 , .Xr read 2 , .Xr shm_open 2 , .Xr shm_unlink 2 , .Xr stat 2 , .Xr expand_number 3 , .Xr humanize_number 3 , +.Xr shm_create_largepage 3 , .Xr sysctl 3 .Sh HISTORY The From nobody Fri May 26 01:49:51 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QS7CN2MLWz4THTx; Fri, 26 May 2023 01:49: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 4QS7CN05W0z3Lld; Fri, 26 May 2023 01:49:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685065792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EsBic5LthwatqcUeZ5lRto+7H9dNHUqI03uv5BwEh20=; b=yZyLGk/dbWHvIu6QQdv/PWjC0nTqq5OyyXCnyfR74gaaWin35J3zhzf66gIPzoYm9+gt9+ QFFO91VNi6YZF+tImigusEn34thp3l0YlIugSt1/HtgOvdaBGR2sXY8afQpXykxn53ENxJ mDLe22V3EZzc4IHVo0U7dd1rnrRIPfB2y6hEtW54O4VmxGaSifGSE+MA9V5lg5TVCrzAHD 9lK4tZBaYMLNBNTlWazDynX7jGFqosj+XTQjtd5YsZsYJooaOuwO/+905D1y/2/9OIP70s hM0j6x635KH0RCd10SH8Ky8D/qYx5Jeh0ervV82d1BaGrabgF0x0cJQFGzzo+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685065792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EsBic5LthwatqcUeZ5lRto+7H9dNHUqI03uv5BwEh20=; b=PZrWcsuskgcO0Vi+T/aRCFeCTTw7XpZ97iiH+iulbBsr9DD3HF0Sxqf9FEnZiYE9U1QVIa ZBBmb2O66hw7GB/b+C1iKoJTmIaaehuELh/xCOJ03RmPwN0174A16x0bWkODLRvRZhwrMB VAgUgmL2DXnKTLycT/CoMjCKkTy7Ex9XIstoI2Na87t01TZQ0vmpfjTDQAF/9pLEC5JM7A 7SvTajhEYboYT/ewGFlF3KtPdV68JAMb0h2BvMtWtYP3C6DmoyAxYeQh9kRG1SRtIfoQD0 +wN3PwMbn54GsCBh4eRcqvIxg+afpVlU+4QN6sgAP6YSXZnBm6nYCA8IoPV8+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685065792; a=rsa-sha256; cv=none; b=l18OA/qHnGuyp0b+Vd/LrgbWc0Gy5npRtG2o5/QsqVxjgrnHWNZJ3EP0t52HfM7oW/Yqcq I45vh7RJ27ATFQ5hpW2llH6XHmwOVmPJEFbqeoRwkYbdiC3UEvCEgh0D6jvWuSiBlWrI5t OTdlRzqa6OHz77T3yvXkpJ0Ql4fBv3Lk4qSgNMwLcABkKxVlV3TmNU74UcWzyVW6yaTSgj AUS0ANKHnbQfPlFbzefpHGpIX8x7Br68LxcMCKdNE8zMzULEH+6+Sj1y9rdU45bUjAVHan wGe+AEz2HvQpU5HBY4EL3y/87wLduWKf/YYV9WY87OSx101AszXyX/j1KfLeHg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QS7CM6H3pzpBM; Fri, 26 May 2023 01:49: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 34Q1npv7085788; Fri, 26 May 2023 01:49:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34Q1npmg085787; Fri, 26 May 2023 01:49:51 GMT (envelope-from git) Date: Fri, 26 May 2023 01:49:51 GMT Message-Id: <202305260149.34Q1npmg085787@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 0f2bb40bc7dd - main - lldb: dereference stoppcbs based on target kernel version List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0f2bb40bc7ddee7ba329d9b344623e2a186b4046 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0f2bb40bc7ddee7ba329d9b344623e2a186b4046 commit 0f2bb40bc7ddee7ba329d9b344623e2a186b4046 Author: Ed Maste AuthorDate: 2023-05-02 20:24:46 +0000 Commit: Ed Maste CommitDate: 2023-05-26 01:45:52 +0000 lldb: dereference stoppcbs based on target kernel version As of 9fb6718d1b18 / __FreeBSD_version 1400089 stoppcbs is a pointer to the pcbs array. Dereference stoppcbs on sufficiently new kernels. Reviewed by: markj (earlier) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39939 --- .../source/Plugins/Process/FreeBSDKernel/ProcessFreeBSDKernel.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSDKernel/ProcessFreeBSDKernel.cpp b/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSDKernel/ProcessFreeBSDKernel.cpp index e3707365a9c3..30eace1ba94f 100644 --- a/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSDKernel/ProcessFreeBSDKernel.cpp +++ b/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSDKernel/ProcessFreeBSDKernel.cpp @@ -178,6 +178,11 @@ bool ProcessFreeBSDKernel::DoUpdateThreadList(ThreadList &old_thread_list, int32_t pcbsize = ReadSignedIntegerFromMemory(FindSymbol("pcb_size"), 4, -1, error); lldb::addr_t stoppcbs = FindSymbol("stoppcbs"); + // In later FreeBSD versions stoppcbs is a pointer to the array. + int32_t osreldate = + ReadSignedIntegerFromMemory(FindSymbol("osreldate"), 4, -1, error); + if (stoppcbs != LLDB_INVALID_ADDRESS && osreldate >= 1400089) + stoppcbs = ReadPointerFromMemory(stoppcbs, error); // from FreeBSD sys/param.h constexpr size_t fbsd_maxcomlen = 19; From nobody Fri May 26 01:59:38 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QS7Qf72Cwz4THs7; Fri, 26 May 2023 01:59:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QS7Qf6XXZz3NXH; Fri, 26 May 2023 01:59:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685066378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JhZBZaprS5D3NgWSGpSgS3TS6OicRckmUmz6Vzr0w7w=; b=Nxx0RCGKN5/t0xb2leS/QQFCiGTdjyRFTS3yRaZXuEw9aBkR96WqikaRUWFBGz6koqMuO0 VtCJ7kFKzcVERnEL1ITlpy3kdFmILLPMMuCIiJ975VG2JgVn5FLQUAg8d7Z0wNuHZfDwI1 YIysjJuHVer0h973DmqHgbz3mh6Cu2mvhVvEeUNzX1vck93Wco81WFB296c6dl0w6fsGho i/sS9BDnFxUwGn+P/r74b5icHel4INDp0MvNF64huocQofsYxFCjZkVd6mcEsUqhMMcCej FpCunqwtaukUzE05YHMAfLCertStpofpGbsVcH/ktE438pp7t0q9OnEr7Jzdsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685066378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JhZBZaprS5D3NgWSGpSgS3TS6OicRckmUmz6Vzr0w7w=; b=ROtNcVpQwQGS6V2cU/QTECriTACkLWNbdT9WLuVF/ncczZcSooDp2W2Oxh1JDWNwrE31ag vLPz9GqmXDbLsBjVr5QEdzOjwarrrZaemWCQpg0ClfEZDAhgUY7GHoEAPpfIAPz7xzzL33 gKGYwn8eH/rab65XdUJBgkodZmGsLXXu6TKnCGWg0vwC0bdpimMtD77QXoqh0K/Isk9P0T RCdPwHa11Wg0gyT9p+3Hd/rullfy1ohCmxN+MpvYLlkXfGn6wMYbaZ4cBV/uywjH8srkEj m/k6sIX8iSaTOzzWPFncuBw6zgMMU+5JPArR0dQwlBbwcx7qrFAKlddFk/bcNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685066378; a=rsa-sha256; cv=none; b=K3wceap4PHG4VU0wjbwjXl749NDRFHsA67okB3/fnaCHXQCQJzJkt2hUKWHL5eFHhD3iwY icraSm0ujiEpnUBfn0GTtQ9jMc1TvpNyxBtJXSxaTDrmVA+g86AM/H2A9MvZr/Q2rbRPEI soggiNXNCGX3ErF+FGUDvmZ/d6IR5iH84bb/zOrdpH9G4/GUuPpp5gHuV5/uczKiXeb3Lv t6T7KayNVUAuRAlkv+xc0eZ55WSDg7pO2hG3QZSo58WBsraYIcC9EB2/vPTgUEQfPyuY+Z tfrHDzCPM32C+DMr9M4GjiZpYxe0IwgClHV/4OJhjX5jBv2BMK243iAoRac21Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QS7Qf5cBXzpMB; Fri, 26 May 2023 01:59: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 34Q1xcBW001996; Fri, 26 May 2023 01:59:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34Q1xcA0001994; Fri, 26 May 2023 01:59:38 GMT (envelope-from git) Date: Fri, 26 May 2023 01:59:38 GMT Message-Id: <202305260159.34Q1xcA0001994@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: 4b08a62ed441 - main - When running fsck_ffs(8) in background ensure that a superblock has been read. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4b08a62ed441668c103f834f5fe756ece5a8d9b3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=4b08a62ed441668c103f834f5fe756ece5a8d9b3 commit 4b08a62ed441668c103f834f5fe756ece5a8d9b3 Author: Kirk McKusick AuthorDate: 2023-05-26 01:56:22 +0000 Commit: Kirk McKusick CommitDate: 2023-05-26 01:59:16 +0000 When running fsck_ffs(8) in background ensure that a superblock has been read. Reported by: Mikhail T. PR: 271352 MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sbin/fsck_ffs/main.c | 5 ++++- sbin/fsck_ffs/setup.c | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c index 566fbe5ccd15..60a542785541 100644 --- a/sbin/fsck_ffs/main.c +++ b/sbin/fsck_ffs/main.c @@ -711,7 +711,10 @@ setup_bkgrdchk(struct statfs *mntp, int sbreadfailed, char **filesys) } free(sblock.fs_csp); free(sblock.fs_si); - havesb = 0; + if (readsb() == 0) { + pwarn("CANNOT READ SNAPSHOT SUPERBLOCK\n"); + return (0); + } *filesys = snapname; cmd.version = FFS_CMD_VERSION; cmd.handle = fsreadfd; diff --git a/sbin/fsck_ffs/setup.c b/sbin/fsck_ffs/setup.c index 1d62a733c2f6..fbcf069c9c97 100644 --- a/sbin/fsck_ffs/setup.c +++ b/sbin/fsck_ffs/setup.c @@ -88,8 +88,12 @@ setup(char *dev) * We are expected to have an open file descriptor and a superblock. */ if (fsreadfd < 0 || havesb == 0) { - if (debug) - printf("setup: bad fsreadfd or missing superblock\n"); + if (debug) { + if (fsreadfd < 0) + printf("setup: missing fsreadfd\n"); + else + printf("setup: missing superblock\n"); + } return (0); } if (preen == 0) From nobody Fri May 26 02:28:44 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QS84D3p4Kz4TKbR; Fri, 26 May 2023 02:28: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 4QS84D2sNQz3k3L; Fri, 26 May 2023 02:28:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685068124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0ov4ibZB4EuiyMwsHsmHkj9lC8n/v2ptLxPHQetkbbA=; b=Z4dssT2Q0AWRmpxjOvO1qwMq9xTCjlPXszXp2R7czZ4D4y/8O/rVcgjQHCYJtVTJuEJ9TD SfkbTbZ/UiyxEmy/HO9QYj4iavYtEQc6XzHDm+o0xjdBigTmZpp0CyK6ojB454Q5V0lo0R GAYgldE0gm3VW8OpE27bl87jsCRvLbcsYHlrKAQeYX7wdAn1ye5pnGDd66XSN7fZpaadE4 9t/Aj13TdTRRS+HGe0+ZeQEkf341gYKijVIWcE6WPO/tdWYo5Xgai0iF1RUcllDAhLrpRL AtdJhB8bxWxDbEYsCU25Mf1Dp9gNUzQfeBhAeDLwRc+aPUhJa3U35ZAyIBNIxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685068124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0ov4ibZB4EuiyMwsHsmHkj9lC8n/v2ptLxPHQetkbbA=; b=p0rcfWaZIWoS41NZ5IiXPiPhfFPJYkXrGwsQzfZN9mR/nvuWAZ0wipNVjn/TL+0V0uuTSb UCDkbl0Kbg/OMxJ7yO3qA4Ec1TiCDiofnXhHVhiz3Oisj7ssijqmLqM6hUQSwfEgZUlKdQ QAa44+a1II9A8QeZTOMu+hkRFBUytv5iL/h52o+Y1Mwk+w8S1ZPK/KVbl2LhQsGUtlcKC7 rJHuCNPh++bEJZmqnlJAWyppSXB9VOJ4EmjuSIH6kzYjfyU0KQAG26Cx4c1/c3A1Dy/krR w7XCPIBdhqPJPoin+78qwL5uI0dI1Gn2G7v+qKZkfJHKRuJGiyBg/r+pbgqHCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685068124; a=rsa-sha256; cv=none; b=ZWSYCnf8S41RXdoc5fUpXztkx7FWWVOexORiNIgmhu4q8M89XzJQIPvndXv5Ndk8ahN17W cAGg/IISmeNvdxXYGgbU/V/vZv7i5mtDtkda0xo1X3oLxYWhTyZ9VRIeeAl8wtd6o08OiK 2X3/T4GTNP4xqW5MIsWbibz/90w64fb0NopH6bG6d2KBfaxfpPgWhDz0RA7JzHG83ZPNOJ Ugz3LWpZkw3Vhkyip+QrPq6yHpTAbtHVV54k8ys/4TPa68DrTgQ/VTo3UM2jKhx9xh1SjP vlfOju0bBMZ24VAl5DZZrUbJOKC1W8kNbO95GCdj5VifqT1m2PYlvt8TnLGIlA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QS84D1vm1zpgc; Fri, 26 May 2023 02:28: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 34Q2Siwa051614; Fri, 26 May 2023 02:28:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34Q2SiFi051613; Fri, 26 May 2023 02:28:44 GMT (envelope-from git) Date: Fri, 26 May 2023 02:28:44 GMT Message-Id: <202305260228.34Q2SiFi051613@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: e4a905d1e0d9 - main - Add the ability to adjust directory depths to background fsck_ffs(8). List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e4a905d1e0d94ddb8e15de50d37e67f13e058047 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=e4a905d1e0d94ddb8e15de50d37e67f13e058047 commit e4a905d1e0d94ddb8e15de50d37e67f13e058047 Author: Kirk McKusick AuthorDate: 2023-05-26 02:27:04 +0000 Commit: Kirk McKusick CommitDate: 2023-05-26 02:27:04 +0000 Add the ability to adjust directory depths to background fsck_ffs(8). Commit fe5e6e2 improved FFS directory placement when creating new directories. It is done by keeping track of the depth of directories in the filesystem and placing those lower in the tree closer together while spreading out those higher in the tree. Fsck_ffs(8) checks these depths and if incorrect adjusts them to their correct value. When running in background fsck_ffs(8) needs to be able to make an adjustment to the depth. This commit adds the sysctl to make such an adjustment and adds the code to fsck_ffs(8) to use the new sysctl. MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sbin/fsck_ffs/dir.c | 26 +++++++++++++++++++++----- sbin/fsck_ffs/fsck.h | 1 + sbin/fsck_ffs/globs.c | 2 ++ sys/ufs/ffs/ffs_alloc.c | 28 ++++++++++++++++++++++++++++ sys/ufs/ffs/fs.h | 3 ++- 5 files changed, 54 insertions(+), 6 deletions(-) diff --git a/sbin/fsck_ffs/dir.c b/sbin/fsck_ffs/dir.c index cc5305c390a4..e5f0e1e7e7f4 100644 --- a/sbin/fsck_ffs/dir.c +++ b/sbin/fsck_ffs/dir.c @@ -105,6 +105,7 @@ check_dirdepth(struct inoinfo *inp) struct inode ip; union dinode *dp; int saveresolved; + size_t size; static int updateasked, dirdepthupdate; if ((parentinp = getinoinfo(inp->i_parent)) == NULL) { @@ -141,9 +142,11 @@ check_dirdepth(struct inoinfo *inp) } } /* - * If we are not converting, nothing more to do. + * If we are not converting or we are running in no-write mode + * there is nothing more to do. */ - if (inp->i_depth == 0 && dirdepthupdate == 0) + if ((inp->i_depth == 0 && dirdepthupdate == 0) || + (fswritefd < 0 && bkgrdflag == 0)) return; /* * Individual directory at wrong depth. Report it and correct if @@ -174,8 +177,20 @@ check_dirdepth(struct inoinfo *inp) printf(" (ADJUSTED)\n"); } inp->i_depth = parentinp->i_depth + 1; - DIP_SET(dp, di_dirdepth, inp->i_depth); - inodirty(&ip); + if (bkgrdflag == 0) { + DIP_SET(dp, di_dirdepth, inp->i_depth); + inodirty(&ip); + } else { + cmd.value = inp->i_number; + cmd.size = (int64_t)inp->i_depth - DIP(dp, di_dirdepth); + if (debug) + printf("adjdepth ino %ld amt %jd\n", (long)cmd.value, + (intmax_t)cmd.size); + size = MIBSIZE; + if (sysctlnametomib("vfs.ffs.adjdepth", adjdepth, &size) < 0 || + sysctl(adjdepth, MIBSIZE, 0, 0, &cmd, sizeof cmd) == -1) + rwerror("ADJUST INODE DEPTH", cmd.value); + } irelse(&ip); } @@ -506,7 +521,8 @@ adjust(struct inodesc *idesc, int lcnt) (long long)cmd.size); if (sysctl(adjrefcnt, MIBSIZE, 0, 0, &cmd, sizeof cmd) == -1) - rwerror("ADJUST INODE", cmd.value); + rwerror("ADJUST INODE LINK COUNT", + cmd.value); } } } diff --git a/sbin/fsck_ffs/fsck.h b/sbin/fsck_ffs/fsck.h index 092d9575dc2a..ad82c5f80da1 100644 --- a/sbin/fsck_ffs/fsck.h +++ b/sbin/fsck_ffs/fsck.h @@ -333,6 +333,7 @@ extern int adjnbfree[MIBSIZE]; /* MIB cmd to adjust number of free blocks */ extern int adjnifree[MIBSIZE]; /* MIB cmd to adjust number of free inodes */ extern int adjnffree[MIBSIZE]; /* MIB cmd to adjust number of free frags */ extern int adjnumclusters[MIBSIZE]; /* MIB cmd adjust number of free clusters */ +extern int adjdepth[MIBSIZE]; /* MIB cmd to adjust directory depth count */ extern int freefiles[MIBSIZE]; /* MIB cmd to free a set of files */ extern int freedirs[MIBSIZE]; /* MIB cmd to free a set of directories */ extern int freeblks[MIBSIZE]; /* MIB cmd to free a set of data blocks */ diff --git a/sbin/fsck_ffs/globs.c b/sbin/fsck_ffs/globs.c index bce499754301..7aef7364eeba 100644 --- a/sbin/fsck_ffs/globs.c +++ b/sbin/fsck_ffs/globs.c @@ -68,6 +68,7 @@ int adjnbfree[MIBSIZE]; /* MIB command to adjust number of free blocks */ int adjnifree[MIBSIZE]; /* MIB command to adjust number of free inodes */ int adjnffree[MIBSIZE]; /* MIB command to adjust number of free frags */ int adjnumclusters[MIBSIZE]; /* MIB command to adjust number of free clusters */ +int adjdepth[MIBSIZE]; /* MIB cmd to adjust directory depth count */ int freefiles[MIBSIZE]; /* MIB command to free a set of files */ int freedirs[MIBSIZE]; /* MIB command to free a set of directories */ int freeblks[MIBSIZE]; /* MIB command to free a set of data blocks */ @@ -140,6 +141,7 @@ fsckinit(void) bzero(adjnifree, sizeof(int) * MIBSIZE); bzero(adjnffree, sizeof(int) * MIBSIZE); bzero(adjnumclusters, sizeof(int) * MIBSIZE); + bzero(adjdepth, sizeof(int) * MIBSIZE); bzero(freefiles, sizeof(int) * MIBSIZE); bzero(freedirs, sizeof(int) * MIBSIZE); bzero(freeblks, sizeof(int) * MIBSIZE); diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index fbc99951bcc6..957be753ce15 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -3108,6 +3108,8 @@ ffs_fserr(struct fs *fs, * the count to zero will cause the inode to be freed. * adjblkcnt(inode, amt) - adjust the number of blocks used by the * inode by the specified amount. + * adjdepth(inode, amt) - adjust the depth of the specified directory + * inode by the specified amount. * setsize(inode, size) - set the size of the inode to the * specified size. * adjndir, adjbfree, adjifree, adjffree, adjnumclusters(amt) - @@ -3142,6 +3144,10 @@ static SYSCTL_NODE(_vfs_ffs, FFS_ADJ_BLKCNT, adjblkcnt, CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, "Adjust Inode Used Blocks Count"); +static SYSCTL_NODE(_vfs_ffs, FFS_ADJ_DEPTH, adjdepth, + CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, + "Adjust Directory Inode Depth"); + static SYSCTL_NODE(_vfs_ffs, FFS_SET_SIZE, setsize, CTLFLAG_WR | CTLFLAG_NEEDGIANT, sysctl_ffs_fsck, "Set the inode size"); @@ -3299,6 +3305,28 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) vput(vp); break; + case FFS_ADJ_DEPTH: +#ifdef DIAGNOSTIC + if (fsckcmds) { + printf("%s: adjust directory inode %jd depth by %jd\n", + mp->mnt_stat.f_mntonname, (intmax_t)cmd.value, + (intmax_t)cmd.size); + } +#endif /* DIAGNOSTIC */ + if ((error = ffs_vget(mp, (ino_t)cmd.value, LK_EXCLUSIVE, &vp))) + break; + if (vp->v_type != VDIR) { + vput(vp); + error = ENOTDIR; + break; + } + ip = VTOI(vp); + DIP_SET(ip, i_dirdepth, DIP(ip, i_dirdepth) + cmd.size); + UFS_INODE_SET_FLAG(ip, IN_CHANGE | IN_MODIFIED); + error = ffs_update(vp, 1); + vput(vp); + break; + case FFS_SET_SIZE: #ifdef DIAGNOSTIC if (fsckcmds) { diff --git a/sys/ufs/ffs/fs.h b/sys/ufs/ffs/fs.h index 7b7a1f9f2ef6..1f2a56c26641 100644 --- a/sys/ufs/ffs/fs.h +++ b/sys/ufs/ffs/fs.h @@ -263,7 +263,8 @@ /* Was FFS_SET_INODE 15 */ /* Was FFS_SET_BUFOUTPUT 16 */ #define FFS_SET_SIZE 17 /* set inode size */ -#define FFS_MAXID 17 /* number of valid ffs ids */ +#define FFS_ADJ_DEPTH 18 /* adjust directory inode depth */ +#define FFS_MAXID 18 /* number of valid ffs ids */ /* * Command structure passed in to the filesystem to adjust filesystem values. From nobody Fri May 26 03:37:43 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QS9c620khz4TPc3; Fri, 26 May 2023 03:37:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QS9c56Tymz3nWC; Fri, 26 May 2023 03:37:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1ae74ab3089so1831895ad.0; Thu, 25 May 2023 20:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685072276; x=1687664276; h=to:references:message-id:cc:date:in-reply-to:from:subject :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=QkoWk9y3svZoLTHxdPvAZOzuozhdFVd0pghyjjYK3o8=; b=V6w3pVKd28kNNteh/cNPSUlGY5rDI8o8n2JvFvXDnE6DLdF3cc7GIJASDBzrBuZwae +3KoKM/mV0WY2QtpqQdey9CDx/CMxtiEK/61B/4xNCv+lXzm/2R8mIS5vQ64EDupHQx9 CV3BfCbiIqdmUzawJomztyDTv41JZNTB7ngPyMboSxk1+vk4z3MMkKz7I+qexMhlvx7B Fh1b4DPJ1YJQA8YuQI6WlZFXP/gYnFtqHxQWdTjHtsE2IOtEyFKNEWRUItjWYkYIKSQr wZR7SRa8d4S/ulzMV/SV5P+hndw9cKlG3T8d3JJ387F+XVAqeyGcmR4Y2fRmnW+44EMY dq7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685072276; x=1687664276; h=to:references:message-id:cc:date:in-reply-to:from:subject :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QkoWk9y3svZoLTHxdPvAZOzuozhdFVd0pghyjjYK3o8=; b=KXEiwUGkgqBD+TVTczz0kAlhSWlr3WUNr2qb36Fqftv5HVcSjnTzSu7itZ+2gS5Abv bha2XE6dpTGS19Se3634gJH3xCK72a7nuxGRXpKiALYqJKUvfRW4FcOummpPEII3HmIv VYU1ABHajj0zvQen3LyGWh0RkkB6eRdnwEN90sGQA+CrP6MUsoCl4fX4LPR4jOWWLvOw tqApbD+J19l4YWIP/Y4hWTUxEIf3LEQbmf2APrpsDFndL07igGMPJfzH4pcNM88JMpn3 C9tcd1YTJNU7wn+9WBNFpC4+R1DukmHTO9RqSXofKkTCtkeGdsLy13MmaqvMUIW95Yn8 Sk1g== X-Gm-Message-State: AC+VfDwYASntCoiu2ecLxnW32N85i9qrs76Zlwnounxyi5Sfym034Tlj dUJTI8i4w9lfaUauX9VMPz3ha1WG/fcK7A== X-Google-Smtp-Source: ACHHUZ5hAoXlgbo0ZVt3ayPV+IW0AZFiegpal4HGKUlsDNGAO45S8KHGUsXY6cYUpgIW2vfnWZk2qA== X-Received: by 2002:a17:902:c94f:b0:1af:b681:5313 with SMTP id i15-20020a170902c94f00b001afb6815313mr1180396pla.33.1685072275713; Thu, 25 May 2023 20:37:55 -0700 (PDT) Received: from smtpclient.apple (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id u16-20020a170902e5d000b001a260b5319bsm2118397plf.91.2023.05.25.20.37.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 May 2023 20:37:55 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_1941A19C-43CE-4F6C-B216-4D4654833558"; protocol="application/pgp-signature"; micalg=pgp-sha256 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: git: 5a7500dab9b8 - main - libarchive: Request the OpenSSL 1.1 API From: Enji Cooper In-Reply-To: <202305251909.34PJ9HWq026807@gitrepo.freebsd.org> Date: Thu, 25 May 2023 20:37:43 -0700 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Message-Id: <8541AF31-C268-474F-ADE9-D045D0061CD0@gmail.com> References: <202305251909.34PJ9HWq026807@gitrepo.freebsd.org> To: Ed Maste X-Mailer: Apple Mail (2.3731.500.231) X-Rspamd-Queue-Id: 4QS9c56Tymz3nWC X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_1941A19C-43CE-4F6C-B216-4D4654833558 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On May 25, 2023, at 12:09 PM, Ed Maste wrote: >=20 > The branch main has been updated by emaste: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D5a7500dab9b8480dacd5a9b70bad1541= 391342e4 >=20 > commit 5a7500dab9b8480dacd5a9b70bad1541391342e4 > Author: Pierre Pronchery > AuthorDate: 2023-05-25 07:26:58 +0000 > Commit: Ed Maste > CommitDate: 2023-05-25 19:08:05 +0000 >=20 > libarchive: Request the OpenSSL 1.1 API >=20 > OPENSSL_API_COMPAT can be used to specify the OpenSSL API version = in > use for the purpose of hiding deprecated interfaces and enabling > the appropriate deprecation notices. >=20 > This change is a NFC while we're still using OpenSSL 1.1.1 but will > avoid deprecation warnings upon the switch to OpenSSL 3.0. >=20 > A future update should migrate to use the OpenSSL 3.0 APIs. >=20 > PR: 271615 > Reviewed by: emaste > Event: Kitchener-Waterloo Hackathon 202305 > Sponsored by: The FreeBSD Foundation The latest version of libarchive should support OpenSSL 3. Cheers, -Enji --Apple-Mail=_1941A19C-43CE-4F6C-B216-4D4654833558 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----- iQIzBAEBCAAdFiEEtvtxN6kOllEF3nmX5JFNMZeDGN4FAmRwKYcACgkQ5JFNMZeD GN5pqBAAkD4wMnqZNZ2EqA6euMhtztRhHaaoR0OhaLCUZI1fNzsudgh5BL8b7F0T eeC7wpnVngK32K9r79h6knBH+MEdUz28VzUYCXJQxduNPUJSUy6WK60Qjjd5VSOG /qQpnvdfeTahnAoXxQpFo81OTZ+qRY0VfE1uKmfp7ChrACa3BzmQAWKs1GNdld8D 8ixZKvCqCXYUOk3AYVtCeREp7+mh4e6eGod3zbFpOaNCRixPdI/V4WCy5+ifqVmu 2iPOpSUaI6hptdNgWIVChtUvYaH8nXbpWOt2m49JFQ1uq9mNuc2YwFJetoGlKT7g sDYc5hHPzZQTif7Qjb+6SBSynlLax/7nDG/QAbWk4rDzyCWMf6Ia4tU/zKYmNtZO xjZ74mqKYqlEQs4sPlMafc+vNSIXBhCsbgQptGoBw72hMcvyvRwB7DXbsbQMxgxM SVM69zsCVh2fsomWJrAg58begS5B7CeFU+NxTlY1UAZt3yBtiJ5MvSi8NKQgewMI jmAsvOvJcxu2iYzSJbBR5UjoucrNIdIdpwf9QYIi1GIe2rjc2QkNskuyGQEMzgjX ayUhoXnImnpPzVv5mqHPo/Uw5ppZVDwjvfyYYs6cKgUBQBvZETXn6++jqHdeKel5 RpiMAfma2nH+AajtYOX/a1c263Oc/NBILAPjbl6T/tWXnu8TFgA= =Dn6C -----END PGP SIGNATURE----- --Apple-Mail=_1941A19C-43CE-4F6C-B216-4D4654833558-- From nobody Fri May 26 10:35:18 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSLsf2Xjkz4WYFV; Fri, 26 May 2023 10:35: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 4QSLsf1tXRz4PBF; Fri, 26 May 2023 10:35:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685097318; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2eglkmeANHI33AJXilpzRE9NX7wG/Ot++e4Z4ESwDeQ=; b=uKJkT/V9UcaO9gol5WVrEspVaLiBIPCIeMQY7fJVl3m6yYhrT0CURjciMZqN25LNzpKubz aaxdakExqgVWmtXVN3zoqAxpsjaPj5cl4/cpmnymYtc71i+nW1xtC2yob9ccLrY4vP53MA BMTPvguuc/0DoSr2IoEMBoKCooGoXy2EDnlIi445HmqOs4NUCtetmvbyg3wBx/A8B6cUN3 5eYSZF0gZu2V4qpxi70/2YzaHpPTd8DCA/LuCa1LiPUWDD1wBLIqYbMu67fcERvtD22oUq dPbz70wFjozV9SEypuH4r00KDPVjaBQCZ/06IN4niy7LTnQu/iNFtBGaMiA46w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685097318; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2eglkmeANHI33AJXilpzRE9NX7wG/Ot++e4Z4ESwDeQ=; b=CaM8IovbleweaCmjsG6S1a/LRsPK0WPujoP8FgC0of5pQWua7FlEm+nekVi1EbK85rBNye EFnIFHmWBoVN6Qsf9H4YX6kEdHAP2pRKfGEc7ZfWfdqN2HW6/XA2MRK7nyL99vm7qxXnOp 5LEx7EKQ1ajeTvCzf0AXXtxImnegccr8CRsbDb7f8K0CNDOo0bn/k1Pip7Akv2Xo7K7x0a 26KhvQxIOa2ldfpvaFxqauGq33XOuvXX0WBEvDr8PZ11vKoQtipG1T28wlnXOITuKSsTk/ uvcyWD7dWu0oeV4lkqht6U+eEBKPuCfoWUS7s9bBaUYLwjNNGTw/wUk/IrIwhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685097318; a=rsa-sha256; cv=none; b=ll/ZFvD3f02i0P3amdRgaG++NJ2sec7Qh0KNOBkEJmcm5Rpxyi622oOqX+c4FbSpk1+g/n RxNZPekYWKawpqEL0CVhiMB4evWf8EZX3X4MBQBrPGYiWiU8IAOsQVER9vBs0HzAgXp766 MxdQ2Z5OzHW0aflxYZ/MeuTgVc1NDxIG4XsZK3RJQoXmUsoc1xLy1F1bARMXq73z4D3Sh0 xPBo1fcXIbHHhB0yOpgiQNyF50xmYpHET6jtN7e0xACoTFUr5V8VLRGevkZ8FqmQj7ws4+ JtiknjIqmocBFlHHmyhncCwNCMSZgNlQBW7Shc9zCNJnHXXt1RxxPcob3iFd6Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSLsf0z4cz13Wk; Fri, 26 May 2023 10:35: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 34QAZIHZ059561; Fri, 26 May 2023 10:35:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34QAZIO8059560; Fri, 26 May 2023 10:35:18 GMT (envelope-from git) Date: Fri, 26 May 2023 10:35:18 GMT Message-Id: <202305261035.34QAZIO8059560@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cheng Cui Subject: git: f5abdb03119a - main - tcp: fix a bug where unshifting should be put last in tcp_get_srtt() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f5abdb03119a7e6608f0cfee0e7a28c94b9b0ca1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cc: URL: https://cgit.FreeBSD.org/src/commit/?id=f5abdb03119a7e6608f0cfee0e7a28c94b9b0ca1 commit f5abdb03119a7e6608f0cfee0e7a28c94b9b0ca1 Author: Cheng Cui AuthorDate: 2023-05-25 13:14:38 +0000 Commit: Cheng Cui CommitDate: 2023-05-26 06:30:52 +0000 tcp: fix a bug where unshifting should be put last in tcp_get_srtt() Reported by: Bhaskar Pardeshi from VMware. Reviewers: rscheff, tuexen, #transport! Approved by: tuexen (mentor) Subscribers: imp, melifaro, glebius Differential Revision: https://reviews.freebsd.org/D40267 --- sys/netinet/tcp_subr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 8636ff4cefeb..52222d7c1634 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -4660,8 +4660,9 @@ tcp_get_srtt(struct tcpcb *tp, int granularity) /* * The user wants useconds and internally * its kept in ticks, convert to useconds. + * Put unshift at last improves precision. */ - srtt = TICKS_2_USEC(srtt); + srtt = TICKS_2_USEC(tp->t_srtt) >> TCP_RTT_SHIFT; } else if (granularity == TCP_TMR_GRANULARITY_TICKS) { /* * The user wants ticks and internally its From nobody Fri May 26 13:21:52 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSQYs4xVyz4Wk78; Fri, 26 May 2023 13:21:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QSQYs0zmKz3PPN; Fri, 26 May 2023 13:21:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685107313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R/tREswVPR8lNWY2RqtEeZubrmXtFIalQDRR1IJqsSE=; b=ovyLlsHeCa/mrjrSsyzfgorJgwtDL3IABfZH4LPlx0QrAeA5Dje8ZwV6hXhnc5rtnincG9 83xASTtH/HK+DwzglO+h+tD5jNF4uNGp4cSn6XuCsSD7fN4HsEUtxtj03oEOdRnnN7LJWp nA5FBHhr/sdF84JrIXRUSyLSavHb8RFrTneEBgVnD1C/RemZtsybnWd9rwvPoQvDHhj8qA jA3d1X6ttPAwsOTtFp+VsIlZQJHES2q+++PB0ej32oszlk5j7PUUFKKfAsZoG9j5dTWYMU 7/HtxHR7wYhjySsTGIJd08a6ozZNyp41yKbEctCQ58o9HFHNVkiARiWf3oCn/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685107313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R/tREswVPR8lNWY2RqtEeZubrmXtFIalQDRR1IJqsSE=; b=TFxhM+cI377omI/eHtgyWb7KdQquxHztKTKd85imKzBa+ATcceUqP7sVAp9T4LLKOrvBUa QsU77DJE0Hodm/K8DatasQOdVN9tfRA8lIvkPMPS4QS7qEOvIep+vKBGeO6mwO9t89AhO1 gIWlL1Dl5yB/e39wLOqJKWLB8PHfcx9dXqZl1Mwe44dCNZUF4lHlNOjdAY4AwNNeX1Yhwl RsM8y9D7mCMQlJktzpnle3LFJ5/Evq2mfnEeNz8cVR2uCdtLhH+eIkv3XgL2SBS47nyr9i A09PI5gFBolGSKDT5Epnd7RpLll01RY1ce8Su17EfR2aoJNdbCHyvtiS88TZ/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685107313; a=rsa-sha256; cv=none; b=uHT9Ob6r2TKykDO9M8umwQPLV4wFSwS9hdPAxMEyioC92CY6y7lpbOiM5Bi8Qj00iDO6Er ZCTw1f8+jhrRWtZb2kQRCQoj8p2D3+p3rQiosV0rhm5VtOoEOCwIkfpqE1h/DR/guxV+RX GFCZaSi2d3HoKCtCg4rNdNcvyihrMjIhU0fV+BrXHGT3F7gnF5IAX/iTHW1KUDlUeUlv3P n4ob1akIxtgjRALmAmJ5h8kcssvnQMmU2rMVaVW7xNt2DikA1gSF8y8VIQ4Zwe7ilGzN4Y rR8K/Bg/N6s9XgSjuc6iEJnLn7ze0mwOVTkYoZdnk8/1Vywc1JBqXAYpsJzOLA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSQYs046Sz17f8; Fri, 26 May 2023 13:21:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34QDLqx9034235; Fri, 26 May 2023 13:21:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34QDLqiT034234; Fri, 26 May 2023 13:21:52 GMT (envelope-from git) Date: Fri, 26 May 2023 13:21:52 GMT Message-Id: <202305261321.34QDLqiT034234@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: b01c10d25d06 - main - auditdistd: Avoid calling deprecated OpenSSL functions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b01c10d25d06047e45c3d5dc6a4e757a9b35ab78 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b01c10d25d06047e45c3d5dc6a4e757a9b35ab78 commit b01c10d25d06047e45c3d5dc6a4e757a9b35ab78 Author: Ed Maste AuthorDate: 2023-05-25 19:17:13 +0000 Commit: Ed Maste CommitDate: 2023-05-26 13:15:25 +0000 auditdistd: Avoid calling deprecated OpenSSL functions As of OpenSSL 1.1 SSL_library_init() and SSL_load_error_strings() are deprecated. There are replacement initialization functions but they do not need to be called: "As of version 1.1.0 OpenSSL will automatically allocate all resources that it needs so no explicit initialisation is required." Wrap both calls in an OPENSSL_VERSION_NUMBER block. Upstream pull request submitted at https://github.com/openbsm/openbsm/pull/82 PR: 271615 Reviewed by: ngie Event: Kitchener-Waterloo Hackathon 202305 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40273 --- contrib/openbsm/bin/auditdistd/proto_tls.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/openbsm/bin/auditdistd/proto_tls.c b/contrib/openbsm/bin/auditdistd/proto_tls.c index 31673084d5b5..4de2bbd9f9fa 100644 --- a/contrib/openbsm/bin/auditdistd/proto_tls.c +++ b/contrib/openbsm/bin/auditdistd/proto_tls.c @@ -371,8 +371,10 @@ tls_exec_client(const char *user, int startfd, const char *srcaddr, if (proto_connect(saddr, daddr, timeout, &tcp) == -1) exit(EX_TEMPFAIL); +#if OPENSSL_VERSION_NUMBER < 0x10100000L SSL_load_error_strings(); SSL_library_init(); +#endif /* * TODO: On FreeBSD we could move this below sandbox() once libc and @@ -663,8 +665,10 @@ tls_exec_server(const char *user, int startfd, const char *privkey, sockfd = startfd; tcpfd = startfd + 1; +#if OPENSSL_VERSION_NUMBER < 0x10100000L SSL_load_error_strings(); SSL_library_init(); +#endif sslctx = SSL_CTX_new(TLS_server_method()); if (sslctx == NULL) From nobody Fri May 26 13:21:54 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSQYt2mTbz4WkJ2; Fri, 26 May 2023 13:21: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 4QSQYt1Vxmz3PRs; Fri, 26 May 2023 13:21:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685107314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g6DvUjLVB0kIzP1NKI6fRWDvMiHBMG7x6WSc+zCXl3g=; b=K+riIaUMAHILPfKda+VxzeWDP3DEebDdGRBOFRlnELBJIMhPEOZAQTef6/pa8I5ksm+7t8 8DWg9HlrcyECxcgwyfCb4lO+XE4IIcIGnnlBC7cxL0/yQaPWdsMMrjN3lVtl5Wo14QZTB6 jg9ggAJg+H/Z0NJ0q62HBR6iJs++SoBGS0LXrDFPzS3YaFcNDuvupS4hLe18zqOf+gt286 MJBIVirwGZXcuvfa5XqpqhZfMHOZtne93bqAlINuwE2mbXBWwIBcORPq4yhjdC+gVIqRVo 1tqNmGU42It95EOQSIkXph+/e+E+9XSuae8G7fq90E3EmgB5DmxzCqqFysXqrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685107314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g6DvUjLVB0kIzP1NKI6fRWDvMiHBMG7x6WSc+zCXl3g=; b=Zj5SQH4gf8HtZDr9GAAU2cI7Vn4X3FgtSHODQqYqV8eTQfy2JWoHBhw5fQ03aO4fDniBGn FQWB/kIpp5SxOm6W+ttfuWYusYvLS3tKlxGY/qu8UoyfU1dwsmlYdQgetFuvCee/DJHJ30 /IO9i2zHIJXfZ6JW60iUPRYm3xiqWArjWUAEDFsmAhYZr0AaIJSDO5zn3PAVRPc4nQiCgU HjksQu8y4NHS3uTgy1ZiULCJjV7SoaR/YqPt/uyHAYvGQI16LrX46XxzaxUi42DOoSh1vF IkWlo9txW/9r8AByZFvpd//FHdSMZRaSFK6/ER5ZFrWmu8N8aENbKF2boVRJzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685107314; a=rsa-sha256; cv=none; b=kfajGPROvDC4qZBroEl2sA9E/GVnoham6DVyLibAKC2bjyzL2tTwUq7yyHJUmJa9mnev4L 3Vrf+s1hUVcF2RJrNN3rojhrjZV08oG/CPudQoUjgRrVt8jquG8SU47aHtWQxMQPoI5B5k LajHxjD/IaQfFVkQcBrk6w6eC5wzeJXWTDk7Xfw+1QDz2JiZxHlI69zvHi36T/Fae2pl+p GMKcdvFmuqFsKowduuoeI53BqpFEfbeBmOxgyPDTLRWTmTPWm1G4BBTDJ0tSxtX5HU+6aR 4lW9NFaArDEB/dfnRnCjl9Yn90iwfN7BCKnb/UfiY+bK+mQSA30JeBO7iM4A+Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSQYt0bg5z17Kj; Fri, 26 May 2023 13:21: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 34QDLsK1034254; Fri, 26 May 2023 13:21:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34QDLsPb034253; Fri, 26 May 2023 13:21:54 GMT (envelope-from git) Date: Fri, 26 May 2023 13:21:54 GMT Message-Id: <202305261321.34QDLsPb034253@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 7409d45ed4c5 - main - auditdistd: Request the OpenSSL 1.1 API List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7409d45ed4c515b80d75491492808b6b284a207b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7409d45ed4c515b80d75491492808b6b284a207b commit 7409d45ed4c515b80d75491492808b6b284a207b Author: Pierre Pronchery AuthorDate: 2023-05-25 17:44:36 +0000 Commit: Ed Maste CommitDate: 2023-05-26 13:20:27 +0000 auditdistd: Request the OpenSSL 1.1 API OPENSSL_API_COMPAT can be used to specify the OpenSSL API version in use for the purpose of hiding deprecated interfaces and enabling the appropriate deprecation notices. This change is a NFC while we're still using OpenSSL 1.1.1 but will avoid deprecation warnings upon the switch to OpenSSL 3.0. A future change should migrate to use the OpenSSL 3.0 APIs. PR: 271615 Reviewed by: emaste Event: Kitchener-Waterloo Hackathon 202305 Sponsored by: The FreeBSD Foundation --- usr.sbin/auditdistd/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.sbin/auditdistd/Makefile b/usr.sbin/auditdistd/Makefile index ef323152f171..df970d611bbf 100644 --- a/usr.sbin/auditdistd/Makefile +++ b/usr.sbin/auditdistd/Makefile @@ -9,6 +9,8 @@ OPENBSMDIR=${SRCTOP}/contrib/openbsm # auditdistd.h. This seems like a makefile non-feature. CFLAGS+=-I${OPENBSMDIR} -I${OPENBSMDIR}/bin/auditdistd +CFLAGS+=-DOPENSSL_API_COMPAT=0x10100000L + NO_WFORMAT= NO_WMISSING_VARIABLE_DECLARATIONS= From nobody Fri May 26 13:54:29 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSRHT6Yqxz4WmDQ; Fri, 26 May 2023 13:54:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QSRHT4C9fz3kJ5; Fri, 26 May 2023 13:54:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685109269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K4YX8M3rFwmuidb6AqqbIeW4uPCqC/KySiDSYrPolWc=; b=fFC9wUUd/AEUXwiGcybyehHXVqaOjUgQz7LJL5e591zmg1kwvosl4XIX9FaP231f7n3Qv5 LQucGD1iKI+Hm3uzGfsNYhGBHKrALTsbT0ggAMq+g0dyQxS7kzhs2uDqctW+n2mSNhvzbx YMQnKuvmK0bj4NR+LKwGO9AgYRWbnA4fP8qMAr+uaCJudvbZY0RV4lfwuwW/B/C6wUSwGw p7ZfIU0GGepBup1n21Bx/A/mAGiVRUW4b44j2KPKEGkOvgEmbJhiVE/cr8Eiu7hkNXA32n fKyGnh672h+P3qhzPkuT3P+sQnZwUCnBVEI3Bk14fRObY7Tq9jA/4pI6PLbxRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685109269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K4YX8M3rFwmuidb6AqqbIeW4uPCqC/KySiDSYrPolWc=; b=weFyhQhSaaErzcFeWCq4d3S5NWIRt95vTAwVEBzaXwwjwNnJwjikZ4p9zPk+nrC3eu71Y3 80VQYhhUvA6ejd/zTDbMdnwSm4PWpM3evOd8UHq/YX6hglr3glE+rmn4gRwIbxx7y9aFWL Pdri6OY2tG4M6pG3EajI5KvTtFaJQNPWnG7JMZetxcKYSKF7WBxIGBVxH94Ctt2mmSck1Z Hf71JbFhve3twXiJFFpJo7+nnmxAxJ0vow4lWmRHKIejYKBRqbzsMKAcPzo25Poa8cJfm9 5Z+VCus+Tlzk+BVqExRt0AjXEQmJD57S2Gj94SfYdPdnuUAACTeJIWpIhWDFgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685109269; a=rsa-sha256; cv=none; b=JsSWgJ7j4WgPdX51lacBBS659e2uUnqw/zcs91W0fO88oFQuOsvmGemRRJ2/XegoyFWA0V poJc+avFTuuZyuFRMD1s0rcnj8mleCRJh43hINltQX9eIJGS5xamp5+j/vkHukhb0zs4Cf zdWwbw1qv8SKZK0JSFyCeh460lOzkKBazGuyb17IwiTMSugPGAsbM27OCiVzGohOdUdTfe TLp3wYtuodMH6Q1DJGMbI/Iw2JDHoxxM0vFAtpDtJ6+dByS3mN2g1OeSIqYAGtFKgsmhGP kzR+faDT5Os0uqAAFEAC+qCRuNcSseA0Bt/Zb2TeaUUFfWdToJQwlBjb7fYonw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSRHT3HKQz18gg; Fri, 26 May 2023 13:54: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 34QDsTjR088265; Fri, 26 May 2023 13:54:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34QDsTE8088264; Fri, 26 May 2023 13:54:29 GMT (envelope-from git) Date: Fri, 26 May 2023 13:54:29 GMT Message-Id: <202305261354.34QDsTE8088264@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 9c80ad6839cd - main - kinst: add kinst_excluded() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9c80ad6839cd30ecfeff2fb946d86888815da600 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=9c80ad6839cd30ecfeff2fb946d86888815da600 commit 9c80ad6839cd30ecfeff2fb946d86888815da600 Author: Christos Margiolis AuthorDate: 2023-05-26 13:54:08 +0000 Commit: Christos Margiolis CommitDate: 2023-05-26 13:54:08 +0000 kinst: add kinst_excluded() Exclude functions that are not safe-to-trace. Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation ifferential Revision: https://reviews.freebsd.org/D39229 --- sys/cddl/dev/kinst/amd64/kinst_isa.c | 13 +++++++++- sys/cddl/dev/kinst/kinst.c | 50 ++++++++++++++++++++++++++++++++++++ sys/cddl/dev/kinst/kinst.h | 2 ++ 3 files changed, 64 insertions(+), 1 deletion(-) diff --git a/sys/cddl/dev/kinst/amd64/kinst_isa.c b/sys/cddl/dev/kinst/amd64/kinst_isa.c index 5035f43be440..7aba79c1d481 100644 --- a/sys/cddl/dev/kinst/amd64/kinst_isa.c +++ b/sys/cddl/dev/kinst/amd64/kinst_isa.c @@ -500,7 +500,9 @@ kinst_make_probe(linker_file_t lf, int symindx, linker_symval_t *symval, pd = opaque; func = symval->name; - if (strcmp(func, pd->kpd_func) != 0 || strcmp(func, "trap_check") == 0) + if (kinst_excluded(func)) + return (0); + if (strcmp(func, pd->kpd_func) != 0) return (0); instr = (uint8_t *)symval->value; @@ -605,3 +607,12 @@ kinst_md_deinit(void) } } } + +/* + * Exclude machine-dependent functions that are not safe-to-trace. + */ +int +kinst_md_excluded(const char *name) +{ + return (0); +} diff --git a/sys/cddl/dev/kinst/kinst.c b/sys/cddl/dev/kinst/kinst.c index 8c9872ba86c8..46b9bf2f41e8 100644 --- a/sys/cddl/dev/kinst/kinst.c +++ b/sys/cddl/dev/kinst/kinst.c @@ -65,6 +65,56 @@ static dtrace_provider_id_t kinst_id; struct kinst_probe_list *kinst_probetab; static struct cdev *kinst_cdev; +int +kinst_excluded(const char *name) +{ + if (kinst_md_excluded(name)) + return (1); + + /* + * Anything beginning with "dtrace_" may be called from probe context + * unless it explicitly indicates that it won't be called from probe + * context by using the prefix "dtrace_safe_". + */ + if (strncmp(name, "dtrace_", strlen("dtrace_")) == 0 && + strncmp(name, "dtrace_safe_", strlen("dtrace_safe_")) != 0) + return (1); + + /* + * Omit instrumentation of functions that are probably in DDB. It + * makes it too hard to debug broken kinst. + * + * NB: kdb_enter() can be excluded, but its call to printf() can't be. + * This is generally OK since we're not yet in debugging context. + */ + if (strncmp(name, "db_", strlen("db_")) == 0 || + strncmp(name, "kdb_", strlen("kdb_")) == 0) + return (1); + + /* + * Lock owner methods may be called from probe context. + */ + if (strcmp(name, "owner_mtx") == 0 || + strcmp(name, "owner_rm") == 0 || + strcmp(name, "owner_rw") == 0 || + strcmp(name, "owner_sx") == 0) + return (1); + + /* + * When DTrace is built into the kernel we need to exclude the kinst + * functions from instrumentation. + */ +#ifndef _KLD_MODULE + if (strncmp(name, "kinst_", strlen("kinst_")) == 0) + return (1); +#endif + + if (strcmp(name, "trap_check") == 0) + return (1); + + return (0); +} + void kinst_probe_create(struct kinst_probe *kp, linker_file_t lf) { diff --git a/sys/cddl/dev/kinst/kinst.h b/sys/cddl/dev/kinst/kinst.h index b7abfd1e61e0..ee756dc87d09 100644 --- a/sys/cddl/dev/kinst/kinst.h +++ b/sys/cddl/dev/kinst/kinst.h @@ -46,6 +46,8 @@ extern struct kinst_probe_list *kinst_probetab; struct linker_file; struct linker_symval; +int kinst_excluded(const char *); +int kinst_md_excluded(const char *); int kinst_invop(uintptr_t, struct trapframe *, uintptr_t); int kinst_make_probe(struct linker_file *, int, struct linker_symval *, void *); From nobody Fri May 26 15:43:57 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSTjp21K7z4Wsr2; Fri, 26 May 2023 15:43: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 4QSTjp1RBJz3x2X; Fri, 26 May 2023 15:43:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685115838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gbq0qLbWQ3hmgQqINldHYfLgPtHYFA52CERd8+92g1k=; b=crimvrucUJZ+h6AxbZErCd+o7d6YlPp/k/dxLyExeBd+K5vpvphvbcUf8Tor5UUSVisAGb /GxYRP7Y0myD86YHP4M1IcRibzk9TOMsFy8bK4vPgYM89uI9tLBQKp0Cbebs26uuAMC8rO tu3KQ/QRpnsvvS0DLg5Xg0q7DyHcPT4yAiX2wao9MjgqXuXf+Fx2L80kFCInWDvtzMUe6m aWQH79B0ZWVgavEhVlOHuNOaVv8qP6lbCuhXG56FirGQMN1dsx3CRZghZd2tv6B8AoAGx1 zZElwf4pBcYTlNe+3zE3GsWC54n70tvciO0ubwNg9ona4dgtFN7YXA8Nq99V6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685115838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gbq0qLbWQ3hmgQqINldHYfLgPtHYFA52CERd8+92g1k=; b=Ky5HZjgwM0xY3r7+dEiHIp84V68cY3nquZYyM8tdYyoiy8E/Nv1gEeT93eYFiUUI3YsGKC GRhBHvqKBdBpvIsLtvZiHt12F2l7/cLUXQe79hccYPujJVXQ1XNHoTclXtUntQu5G/3vfZ IKizK7YH2JIBlnFG574D/DuPefXC+Ovd260SeONDjXwSuKq6ISeYKM/SLRC/111MawGZNW qJfY2dENqBcFXQe3FS9dTeJZ+rIhxmysOzsttRZHYi+w56U7kLn/TU90lLhqVx+IH3psRs Hise5myCXiI4Brc7deOtMhNn2bM5mWdgMPgQnmu7K2wsWvuH7aEgx5R7avGXTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685115838; a=rsa-sha256; cv=none; b=KVwjnObPk99tBH2R7zf58oaOnJ1CIX8PhYhdajucVePCYMkp12cZiF0AwPtT2yxOsSjoGe zSAZHUMJoEJpQy1DPOVEBpJ4gN8WzXvcVeKmRm3oi6+TEZdpDak12wXpx+Ca/uJMIc9/oL 6nVwUTGZr+lohE3UnlydpZVFr9wWpNY1Oo65dUyIU0R4jo6Cr17b4mXnLNixgWzAeHUj6G 8j0W0MmzbXHlN4CBymB1yuFvDXISTHMtQnkEFAzsspSwxbuI/k043Uw8eFhGDzebB9QFzt Ry9ODS5rIN1lf48o8uKgolXs6i37DsZjUkQjIvpmyuHi/BDy7DeU2PMZHpxRJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSTjp0VHQz1BqS; Fri, 26 May 2023 15:43: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 34QFhv70069266; Fri, 26 May 2023 15:43:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34QFhvsM069265; Fri, 26 May 2023 15:43:57 GMT (envelope-from git) Date: Fri, 26 May 2023 15:43:57 GMT Message-Id: <202305261543.34QFhvsM069265@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 5c134fba225f - main - kinst: fix memcpy() tracing crash List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5c134fba225fabb2e0f9c763aaca0eeee81d8f9f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=5c134fba225fabb2e0f9c763aaca0eeee81d8f9f commit 5c134fba225fabb2e0f9c763aaca0eeee81d8f9f Author: Christos Margiolis AuthorDate: 2023-05-26 15:43:37 +0000 Commit: Christos Margiolis CommitDate: 2023-05-26 15:43:37 +0000 kinst: fix memcpy() tracing crash Tracing memcpy() would crash the kernel, because we'd also trace the memcpy() calls from kinst_invop(). To fix this, introduce kinst_memcpy() whose arguments are 'volatile', so that we avoid having the compiler replace it with a regular memcpy(). Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40284 --- .../cmd/dtrace/test/tst/amd64/kinst/tst.basic.ksh | 1 + sys/cddl/dev/kinst/amd64/kinst_isa.c | 6 +++--- sys/cddl/dev/kinst/kinst.c | 21 +++++++++++++++++++++ sys/cddl/dev/kinst/kinst.h | 1 + 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/kinst/tst.basic.ksh b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/kinst/tst.basic.ksh index e3585ca70793..3005da74c895 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/kinst/tst.basic.ksh +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/amd64/kinst/tst.basic.ksh @@ -21,6 +21,7 @@ kinst::vm_fault: {} kinst::amd64_syscall: {} kinst::exit1: {} kinst::spinlock_enter: {} +kinst::memcpy: {} tick-10s {exit(0);} __EOF__ diff --git a/sys/cddl/dev/kinst/amd64/kinst_isa.c b/sys/cddl/dev/kinst/amd64/kinst_isa.c index 7aba79c1d481..d29f1cd4181f 100644 --- a/sys/cddl/dev/kinst/amd64/kinst_isa.c +++ b/sys/cddl/dev/kinst/amd64/kinst_isa.c @@ -107,10 +107,10 @@ kinst_trampoline_populate(struct kinst_probe *kp, uint8_t *tramp) ilen = kp->kp_md.tinstlen; - memcpy(tramp, kp->kp_md.template, ilen); + kinst_memcpy(tramp, kp->kp_md.template, ilen); if ((kp->kp_md.flags & KINST_F_RIPREL) != 0) { disp = kinst_riprel_disp(kp, tramp); - memcpy(&tramp[kp->kp_md.dispoff], &disp, sizeof(uint32_t)); + kinst_memcpy(&tramp[kp->kp_md.dispoff], &disp, sizeof(uint32_t)); } /* @@ -126,7 +126,7 @@ kinst_trampoline_populate(struct kinst_probe *kp, uint8_t *tramp) tramp[ilen + 4] = 0x00; tramp[ilen + 5] = 0x00; instr = kp->kp_patchpoint + kp->kp_md.instlen; - memcpy(&tramp[ilen + 6], &instr, sizeof(uintptr_t)); + kinst_memcpy(&tramp[ilen + 6], &instr, sizeof(uintptr_t)); } int diff --git a/sys/cddl/dev/kinst/kinst.c b/sys/cddl/dev/kinst/kinst.c index 46b9bf2f41e8..e30b813e0400 100644 --- a/sys/cddl/dev/kinst/kinst.c +++ b/sys/cddl/dev/kinst/kinst.c @@ -65,6 +65,27 @@ static dtrace_provider_id_t kinst_id; struct kinst_probe_list *kinst_probetab; static struct cdev *kinst_cdev; +/* + * Tracing memcpy() will crash the kernel when kinst tries to trace an instance + * of the memcpy() calls in kinst_invop(). To fix this, we can use + * kinst_memcpy() in those cases, with its arguments marked as 'volatile' to + * "outsmart" the compiler and avoid having it replaced by a regular memcpy(). + */ +volatile void * +kinst_memcpy(volatile void *dst, volatile const void *src, size_t len) +{ + volatile const unsigned char *src0; + volatile unsigned char *dst0; + + src0 = src; + dst0 = dst; + + while (len--) + *dst0++ = *src0++; + + return (dst); +} + int kinst_excluded(const char *name) { diff --git a/sys/cddl/dev/kinst/kinst.h b/sys/cddl/dev/kinst/kinst.h index ee756dc87d09..1107a274333f 100644 --- a/sys/cddl/dev/kinst/kinst.h +++ b/sys/cddl/dev/kinst/kinst.h @@ -46,6 +46,7 @@ extern struct kinst_probe_list *kinst_probetab; struct linker_file; struct linker_symval; +volatile void *kinst_memcpy(volatile void *, volatile const void *, size_t); int kinst_excluded(const char *); int kinst_md_excluded(const char *); int kinst_invop(uintptr_t, struct trapframe *, uintptr_t); From nobody Fri May 26 16:35:30 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSVsH3cBTz4WwPF; Fri, 26 May 2023 16:35: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 4QSVsH2PVNz43CD; Fri, 26 May 2023 16:35:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685118931; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zYepdY0qYxyBg/4B53Wnom/ErgTaVl72XdecveN/Q7Q=; b=mx2ava8XCalr3oIp2tLspYRzyjv5nAyRu+n6CH3ZJXwLDfEnaPT3g5fu18kHVI2Ulayz5L 25j4l8XdjGc4Ol3fBpdJZS3EjTMsmcZQVT3FMvnJXtR8K1XeVHyp3HZz+Uv3ylMttsCYnR qMtSF+HvnYQeOE/LdNNWq9rUEtaexH2/WWjnMaaGhBYZaIFE2rjrq1LhncuotMUz3EQMhx iux4daeffuzxUHcLfaj1wregsZTITWxrdO6OcZ2UHwbFa4E221Q3y+xHABXdemr4mEXEuH iMEnhE21nnmyu5HxSSZ6nLuShB258Mrz7gm3QYuOAYTLMMGG+mOQnlHmYD940A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685118931; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zYepdY0qYxyBg/4B53Wnom/ErgTaVl72XdecveN/Q7Q=; b=qKyE7YHgOY9u2AyZdXMhVZ/2FqyHZrfcoaTepsjb1rP/Xi9iZM5cneaQNR0uERrtnyLI6c mjVIpskbYdJ1F0VJ6x7+0lnjbogunok9DEhXkqsm7xmBYDHHLHialtJ22cnQMLVblXVgHz If9ZLj/l/m+mMOghWcpb+Y3CpXN2z1SJPIwDwC5SqZRU6d69GQYZVNeGn2myf5RNIXb9lC qQUcl7kh0Ig4n+giP88UaJ62qccssBWl+o8OxeGblFc6+6wG9US8CgGOQTKCWDjAg5qXLL IuWML488gTrUegRVXfky39L3Z8WIUd04Ld2NUFB23Su0cDs+X0F4cZxhWYq5+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685118931; a=rsa-sha256; cv=none; b=WjhQbN1gueuvm+LTrfUzrGpEPOB2kL4lnKUACSkwYWzVfxIONlk+5eKZ6Ru4Ufh/VVyYfd KAA9N4Ez+l5wZq40frk+LXNGoElnH3J2WTyBaBOCbzkM115fOnUI2sUOFf4cGFuRujDwN9 Pdqz3JZptKPfOfkDYc1RqzZgw3LKRDVlzHUj6hSncLqNGZ3okGw03j5nBBj2CmdIEfXc5L uxauYKAx8BecEy6ReVdngWVDmmsuvBHAlQmuBAAWB5Tt8EZ4HLRmW6vzs84PcyvvNlj3zk rq8nRTgFDVGVRy7kgSZ6Rdk5p86p+sliOpyjqF97TLEGxaa6nrLbY+XBIABi+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 4QSVsH1SVKzDfK; Fri, 26 May 2023 16:35: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 34QGZUuv052183; Fri, 26 May 2023 16:35:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34QGZUOh052182; Fri, 26 May 2023 16:35:30 GMT (envelope-from git) Date: Fri, 26 May 2023 16:35:30 GMT Message-Id: <202305261635.34QGZUOh052182@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 3f1bfc136f8f - main - linux(4): Guard linux_fork.h by _KERNEL for use by libsysdecode List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3f1bfc136f8fb8c6a7c4dcccebd27962bc104670 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=3f1bfc136f8fb8c6a7c4dcccebd27962bc104670 commit 3f1bfc136f8fb8c6a7c4dcccebd27962bc104670 Author: Dmitry Chagin AuthorDate: 2023-05-26 16:31:47 +0000 Commit: Dmitry Chagin CommitDate: 2023-05-26 16:31:47 +0000 linux(4): Guard linux_fork.h by _KERNEL for use by libsysdecode Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D40149 MFC after: 1 month --- sys/compat/linux/linux_fork.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linux/linux_fork.h b/sys/compat/linux/linux_fork.h index bdc201bce57e..2a6e2a158241 100644 --- a/sys/compat/linux/linux_fork.h +++ b/sys/compat/linux/linux_fork.h @@ -62,6 +62,7 @@ #define LINUX_CSIGNAL 0x000000ff +#if defined(_KERNEL) /* * User-space clone3 args layout. */ @@ -97,5 +98,6 @@ struct l_clone_args { int linux_set_upcall(struct thread *, register_t); int linux_set_cloned_tls(struct thread *, void *); void linux_thread_detach(struct thread *); +#endif /* defined(_KERNEL) */ #endif /* _LINUX_FORK_H_ */ From nobody Fri May 26 16:35:32 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSVsJ4V3nz4WwXB; Fri, 26 May 2023 16:35: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 4QSVsJ3lvxz43Yt; Fri, 26 May 2023 16:35:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685118932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=12R/j6a/xkJvZEd1MzElVmsA+0y56IfKCTkL7a5WtAo=; b=iak4wWJWdP9EO9HKYnmGELI1PITltLSPR7Pwo3ZQ04Vu+4D7X8PcHnFfGgiDIZRAtuvuSP z9ObgvtXGZwASbAsUaNhoTUP6VIpyiTA/0YQvMSekovkyQO0omSKiwakzVIZl5XuUGFVrc OlqexnZUdcIHuQlVn7URfp6Y13cDU/rJDuRmZd9CF1uKqkgXkvsdhvXDThVN4+VvWhXKYs U+phId8N7u/CKNaDA5rYT0i/9nzxjcMtpcD1NUfv/29dtr96J5/oH6R6ZkleEGQDP4QI+s RszFNcYbCIPkcQZhx64KU23Faadc1gxkjWtJKKmJkucaHLMu9o6v4yItw1kmMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685118932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=12R/j6a/xkJvZEd1MzElVmsA+0y56IfKCTkL7a5WtAo=; b=H7+1gN2FuAUsOfohukcpJ6oAaa7X7HwluI+n2NPmjjcpqLTHxDB7LUdvwTCvFEQrpuNGLw zYP8jOBRu4JAFqkO2xCqfQHPyRGzpjiaDe6cnPy31g+AgiuL18qXyEKCCe2ZwlulxuJ8EA riv1LLJLIAwvS0jaB4g4GeqCq7QcgahaDn7JdTA3dnXT8+lIFV/RAhVopclzt82QJEEBeB +ym1yaxKfzL7Ci7+xSQcALDsx1gZ2WF+HA/jLMCzS2VBc6458hIZUwxCP/1OQ4uZKqAj/u oSF86a3AAGngkwK7ry3OS+RTjxV4hSUua103OJrg1kLXaLrgcNYDwsCHWdmYpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685118932; a=rsa-sha256; cv=none; b=ZraI77ycTCg0K/3vo5VUZvrt6/KChyhvGAzNGQSaQl6g1FXIbjl+EPNDUS0tJVV3uZs2ZM opyUxUiXsD1y4O8rFRIM65jWcFgQXsg8eVdM8ntMjNFzuBgWdDL4P9T2h8YPmIkrOGWcMZ 2Wmnd1LYINvk/jpGL0fqEIbM4JK6MXJwtRVISYv+6Z8jA7iDTYubjgISysfqm4d0XSfoeV KH4td+oEHbtjwrU0NtUkld8u28VJz1nwx1AKbRa97zZ6UWoKFgnIv/hkQnfW9lJT32cCkQ pTVtgzSav9O97dL0vbQa4yXyQ4I2gC+TV87lLQHM23NucVPhXrfPLolYd4YCdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSVsJ1DlzzDtJ; Fri, 26 May 2023 16:35:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34QGZW8V052203; Fri, 26 May 2023 16:35:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34QGZWH5052202; Fri, 26 May 2023 16:35:32 GMT (envelope-from git) Date: Fri, 26 May 2023 16:35:32 GMT Message-Id: <202305261635.34QGZWH5052202@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: bd35e83bcf03 - main - libsysdecode: Decode linux_clone syscall flags List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd35e83bcf03a3650b5574f81201e8e55af4cdd7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=bd35e83bcf03a3650b5574f81201e8e55af4cdd7 commit bd35e83bcf03a3650b5574f81201e8e55af4cdd7 Author: Dmitry Chagin AuthorDate: 2023-05-26 16:32:20 +0000 Commit: Dmitry Chagin CommitDate: 2023-05-26 16:32:20 +0000 libsysdecode: Decode linux_clone syscall flags Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D40150 MFC after: 1 week --- lib/libsysdecode/linux.c | 18 ++++++++++++++++++ lib/libsysdecode/mklinuxtables | 1 + lib/libsysdecode/sysdecode.h | 1 + 3 files changed, 20 insertions(+) diff --git a/lib/libsysdecode/linux.c b/lib/libsysdecode/linux.c index 4b6aab478a33..44de91ef66cb 100644 --- a/lib/libsysdecode/linux.c +++ b/lib/libsysdecode/linux.c @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #define X(a,b) { a, #b }, @@ -240,3 +241,20 @@ sysdecode_linux_open_flags(FILE *fp, int flags, int *rem) *rem = val | mode; return (printed); } + +bool +sysdecode_linux_clone_flags(FILE *fp, int flags, int *rem) +{ + uintmax_t val; + bool printed; + int sig; + + sig = flags & LINUX_CSIGNAL; + if (sig != 0) + fprintf(fp, "(%s)", sysdecode_linux_signal(sig)); + val = (unsigned)flags & ~LINUX_CSIGNAL; + print_mask_part(fp, cloneflags, &val, &printed); + if (rem != NULL) + *rem = val; + return (printed); +} diff --git a/lib/libsysdecode/mklinuxtables b/lib/libsysdecode/mklinuxtables index eebdadd03613..70490321cc68 100644 --- a/lib/libsysdecode/mklinuxtables +++ b/lib/libsysdecode/mklinuxtables @@ -94,6 +94,7 @@ gen_table "clockflags" "LINUX_TIMER_[A-Z_]+[[:space:]]+0x[0-9]+" "compat gen_table "clockcpuids" "LINUX_CPUCLOCK_[A-Z_]+[[:space:]]+[0-9]+" "compat/linux/linux_time.h" "_MASK|_MAX" gen_table "openflags" "LINUX_O_[A-Z_]+[[:space:]]+[0-9]+" "compat/linux/linux_file.h" "O_RDONLY|O_RDWR|O_WRONLY|O_ACCMODE" gen_table "sigprocmaskhow" "LINUX_SIG_[A-Z]+[[:space:]]+[0-9]+" "compat/linux/linux.h" +gen_table "cloneflags" "LINUX_CLONE_[A-Z_]+[[:space:]]+[[:alnum:]]+" "compat/linux/linux_fork.h" "LINUX_CLONE_LEGACY_FLAGS|LINUX_CLONE_CLEAR_SIGHAND|LINUX_CLONE_INTO_CGROUP|LINUX_CLONE_NEWTIME" # Generate a .depend file for our output file if [ -n "$output_file" ]; then diff --git a/lib/libsysdecode/sysdecode.h b/lib/libsysdecode/sysdecode.h index 5bd4b136cdab..810d3426bc14 100644 --- a/lib/libsysdecode/sysdecode.h +++ b/lib/libsysdecode/sysdecode.h @@ -142,6 +142,7 @@ bool sysdecode_shmflags(FILE *_fp, int _flags, int *_rem); bool sysdecode_linux_atflags(FILE *_fp, int _flag, int *_rem); void sysdecode_linux_clockid(FILE *_fp, clockid_t _which); bool sysdecode_linux_clock_flags(FILE *_fp, int _flags, int *_rem); +bool sysdecode_linux_clone_flags(FILE *_fp, int _flags, int *_rem); bool sysdecode_linux_open_flags(FILE *_fp, int _flags, int *_rem); const char *sysdecode_linux_signal(int _sig); const char *sysdecode_linux_sigprocmask_how(int _how); From nobody Fri May 26 16:35:33 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSVsK3pPkz4CdQR; Fri, 26 May 2023 16:35: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 4QSVsK34LMz43fy; Fri, 26 May 2023 16:35:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685118933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pberAYlHFWfjsGgcyzP/DtmfCZRCz/bMnteZB2L7yCs=; b=kUeDq0SFDFk5yeccI9hdfM17sAG7pdn3B/i3eJDvGGXrwXzXYnCOBRfz33Fv2G0Qznq+ya /vVd22Q6Lk6tPlHexGqWcy8u9wyEThHB8wQH4BxGm5E2dnjN2T+wauc285EXBvf+2shNBB Cq3XGuD+s4nAR0lAGqGg6CPGuw8z/x7plOd0DUw6x7/bEJTayJGyTqCnyVq0Xy81T4CkG4 0fXHy2643giS/FQJJQ051eoi69Vl2ulBy8gQ8hN0tFZDlCBWyve1qqheQAkdRDV8moTnrx vh1RlwS4n8NPRoU4k4HNu5f6oTpW1yfcZmqd4N0I3QC/X21aygsC+CUrYOBS5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685118933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pberAYlHFWfjsGgcyzP/DtmfCZRCz/bMnteZB2L7yCs=; b=kYi4K9hFgIkQf3b5jwFElUkACg6XMQy2/5HpExN0g//2ppLX08tQY69u+xJaQbSw44fX3D Kbgsq/rF7gYu/q5XL9dy+FI51/cjC5fJUnMJeSInwnGp2GjDI1ysK9h8aDEIXRd1xqWp+h dEYoA74evX7W5bio5aSzBrhyAYaBMTLVwLN/l0yPGuxhGsZDaQNtZfgVu+FE8UR/ruaFgr BnmDDWRvN21QKxuakmlsrLhJ/5o7JDK9xKu/mcwu4ZTSaNgQ2ZZkei1i2Cy6x+ezmMQrUB JTobwRRPq9tsYARtBQ21rgwe9DaILDhCj60hehqOfFGRfeyvPisUfbq91U25Kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685118933; a=rsa-sha256; cv=none; b=XR10BZj0o3TVbdHVmJN/RREgn/nJu713niDjsna3g+DANoqbiBsOoDrUHND21B615HJR8S HI7N22bU2Emruu4lcK2G5A14L8lRDtDLBV44pfvVibT/W5PHGdaZS2KxcuV64PYc4YYK55 8hf7KlQj6F2bVRo9iT7/OLJ05tbpMtbEil87kUbvoZzZ3Y9q2TmxAeqnyuh4qlJQ8CsB3M AKOXi4KT19NhccO5cexxcvcAzgugT6frgJdiR/gXIYHh3BUrIjTJYf3r9vKXYD8PHDjMq1 R9io6+IcNgl474F+u/yVx0HIq9ZCs7+VKta2BlD/YN2xcH3hyHFeryOuPPw0Aw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSVsK29tWzF5x; Fri, 26 May 2023 16:35: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 34QGZXUA052230; Fri, 26 May 2023 16:35:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34QGZXj0052229; Fri, 26 May 2023 16:35:33 GMT (envelope-from git) Date: Fri, 26 May 2023 16:35:33 GMT Message-Id: <202305261635.34QGZXj0052229@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 829f3d7d2640 - main - kdump: Decode linux_clone syscall flags List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 829f3d7d2640490ea3dc4180aa96041f440fd743 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=829f3d7d2640490ea3dc4180aa96041f440fd743 commit 829f3d7d2640490ea3dc4180aa96041f440fd743 Author: Dmitry Chagin AuthorDate: 2023-05-26 16:34:33 +0000 Commit: Dmitry Chagin CommitDate: 2023-05-26 16:34:33 +0000 kdump: Decode linux_clone syscall flags Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D40151 MFC after: 1 week --- usr.bin/kdump/linux.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/usr.bin/kdump/linux.c b/usr.bin/kdump/linux.c index 49dec3443e2a..6395f00b6e3b 100644 --- a/usr.bin/kdump/linux.c +++ b/usr.bin/kdump/linux.c @@ -192,6 +192,13 @@ ktrsyscall_linux(struct ktr_syscall *ktr, register_t **resip, ip++; narg--; break; + case LINUX_SYS_linux_clone: + putchar('('); + print_mask_arg(sysdecode_linux_clone_flags, *ip); + ip++; + narg--; + c = ','; + break; case LINUX_SYS_linux_kill: case LINUX_SYS_linux_tkill: case LINUX_SYS_linux_rt_sigqueueinfo: @@ -394,6 +401,13 @@ ktrsyscall_linux32(struct ktr_syscall *ktr, register_t **resip, ip++; narg--; break; + case LINUX32_SYS_linux_clone: + putchar('('); + print_mask_arg(sysdecode_linux_clone_flags, *ip); + ip++; + narg--; + c = ','; + break; case LINUX32_SYS_linux_kill: case LINUX32_SYS_linux_tkill: case LINUX32_SYS_linux_rt_sigqueueinfo: From nobody Fri May 26 16:35:34 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSVsL4S0kz4WwbZ; Fri, 26 May 2023 16:35: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 4QSVsL401hz43Y3; Fri, 26 May 2023 16:35:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685118934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AkFCmwUDqFemQ7WifFFmoQ73s7TjbiwsbPxHbhXHPqY=; b=YIY7mxPHSWT8F7FFVUha+266Us/qDbUkZNoRNkpl9dp7wBsFH2oeJtLW8kzz3RZLGAVsZm BHv53ooZEV7AZLJf5leF1ZJ47iz2BCGBEJR3qHlfkfIBbDavP8zug2pA+vI1DqjaVpBcTs D7eFcXguVUQREpR5w8BycH2kuyK0ZVfL6VgeJcRPz2UxI5FQQxwzEE3vYnhbAbmyn7DEFg 8SmPxFKukGxkmuL+QG91Kk13yoC0+AYpviuCB8g8ZI/hfGaleM2XGBfYOpOD2ZsA7N6Udh Q4ONwMhnA2upZpQCj46U1YLcRoKBSTmeuP3kOrCdsueR5+zwBo90J1+pe3fv5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685118934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AkFCmwUDqFemQ7WifFFmoQ73s7TjbiwsbPxHbhXHPqY=; b=seaTG66E4eYGN8NbM1RK3jDiDYkPVVrQGMlM4HESRJljSz6TYqL/oAr3in+hx8pQF8a2Ju cFyfPlMeTQ0XLV1Y2OZDlqCASM1sa5xSeDxDxUvju8+vZcokXvubTzPde88l5T89W3EQv1 FYMSAeyDU35H+c5VVS8Bve5/tE0RQjMcH6yycVTaxy0WKxQlodTicfqCNjXpd0eNvNyKIP 3j+WZcV1c/aClHklpFu1vkQwtQtSuVTRUJyAD2nUNYl/1pI19Ac68KChpiwVKPB3GMrtCK ooc95ScetPtYT+6QMdDGl0s0YN1zjlGIrbeMO8noh7rs5FcqvgTvL149jeFUiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685118934; a=rsa-sha256; cv=none; b=C2HAA4C451SqJXHp4iBzuOmXkCvsKBV0XnPk5O/FSiaO/lrnm/xP3DLjiwQIKaFEyK/LX9 mRGkRsHe31Qdp8ZnmmpCx63EqcdmqmVHXjEpzvanSrVNNfAKZhtPqcZmHq8E9hKWcWhSHg 9s6jacON690GYVbNf0RWwYPRr/bp9dse59OSKsUzL3dFY08VEqglxcrXbjUBQT6bWXOhpG Ul6MjPf+WXWC8CR8LDaMBJgubCAva2ugqOr3WbqFcB6HJebwVfXvfnXSIcYThum4q2dzl1 aw5pUPxjUqVxzf5pfyYHDEHSiT6/KUNNezWRpvfSQ8D1aJk8s/4S5hzWHaTQuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSVsL35txzDfL; Fri, 26 May 2023 16:35: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 34QGZYG0052250; Fri, 26 May 2023 16:35:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34QGZYJ2052249; Fri, 26 May 2023 16:35:34 GMT (envelope-from git) Date: Fri, 26 May 2023 16:35:34 GMT Message-Id: <202305261635.34QGZYJ2052249@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: c2c9ac88c2bb - main - kdump: Add a facility to print numbers in decimal format always List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c2c9ac88c2bb62423ae91beeee4083b596922adc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=c2c9ac88c2bb62423ae91beeee4083b596922adc commit c2c9ac88c2bb62423ae91beeee4083b596922adc Author: Dmitry Chagin AuthorDate: 2023-05-26 16:35:08 +0000 Commit: Dmitry Chagin CommitDate: 2023-05-26 16:35:08 +0000 kdump: Add a facility to print numbers in decimal format always To help grepping kdump output by pid or tid it makes sence to print some numbers in decimal format always. Eg, process or thread identifier at least, as they already printed in decimal format. Switch to print pid/tid arguments of some Linux signal related syscalls in decimal format. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D40099 MFC after: 1 week --- usr.bin/kdump/kdump.h | 13 +++++++++---- usr.bin/kdump/linux.c | 12 ++++++------ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/usr.bin/kdump/kdump.h b/usr.bin/kdump/kdump.h index f5b9b85f9779..1d3e9be2b6e0 100644 --- a/usr.bin/kdump/kdump.h +++ b/usr.bin/kdump/kdump.h @@ -34,7 +34,7 @@ extern bool decimal, fancy, resolv; -#define print_number64(first,i,n,c) do { \ +#define _print_number64(first,i,n,c,d) do { \ uint64_t __v; \ \ if (quad_align && (((ptrdiff_t)((i) - (first))) & 1) == 1) { \ @@ -46,7 +46,7 @@ extern bool decimal, fancy, resolv; ((uint64_t)(uint32_t)(i)[1]) << 32; \ else \ __v = (uint64_t)*(i); \ - if (decimal) \ + if (d) \ printf("%c%jd", (c), (intmax_t)__v); \ else \ printf("%c%#jx", (c), (uintmax_t)__v); \ @@ -55,8 +55,8 @@ extern bool decimal, fancy, resolv; (c) = ','; \ } while (0) -#define print_number(i,n,c) do { \ - if (decimal) \ +#define _print_number(i,n,c,d) do { \ + if (d) \ printf("%c%jd", c, (intmax_t)*i); \ else \ printf("%c%#jx", c, (uintmax_t)(u_register_t)*i); \ @@ -65,6 +65,11 @@ extern bool decimal, fancy, resolv; c = ','; \ } while (0) +#define print_number(i,n,c) _print_number(i,n,c,decimal) +#define print_decimal_number(i,n,c) _print_number(i,n,c,true) +#define print_number64(first,i,n,c) _print_number64(first,i,n,c,decimal) +#define print_decimal_number64(first,i,n,c) _print_number64(first,i,n,c,true) + void decode_filemode(int value); void print_integer_arg(const char *(*decoder)(int), int value); void print_integer_arg_valid(const char *(*decoder)(int), int value); diff --git a/usr.bin/kdump/linux.c b/usr.bin/kdump/linux.c index 6395f00b6e3b..48c82b2a8017 100644 --- a/usr.bin/kdump/linux.c +++ b/usr.bin/kdump/linux.c @@ -202,7 +202,7 @@ ktrsyscall_linux(struct ktr_syscall *ktr, register_t **resip, case LINUX_SYS_linux_kill: case LINUX_SYS_linux_tkill: case LINUX_SYS_linux_rt_sigqueueinfo: - print_number(ip, narg, c); + print_decimal_number(ip, narg, c); putchar(','); print_linux_signal(*ip); ip++; @@ -210,8 +210,8 @@ ktrsyscall_linux(struct ktr_syscall *ktr, register_t **resip, break; case LINUX_SYS_linux_tgkill: case LINUX_SYS_linux_rt_tgsigqueueinfo: - print_number(ip, narg, c); - print_number(ip, narg, c); + print_decimal_number(ip, narg, c); + print_decimal_number(ip, narg, c); putchar(','); print_linux_signal(*ip); ip++; @@ -411,7 +411,7 @@ ktrsyscall_linux32(struct ktr_syscall *ktr, register_t **resip, case LINUX32_SYS_linux_kill: case LINUX32_SYS_linux_tkill: case LINUX32_SYS_linux_rt_sigqueueinfo: - print_number(ip, narg, c); + print_decimal_number(ip, narg, c); putchar(','); print_linux_signal(*ip); ip++; @@ -419,8 +419,8 @@ ktrsyscall_linux32(struct ktr_syscall *ktr, register_t **resip, break; case LINUX32_SYS_linux_tgkill: case LINUX32_SYS_linux_rt_tgsigqueueinfo: - print_number(ip, narg, c); - print_number(ip, narg, c); + print_decimal_number(ip, narg, c); + print_decimal_number(ip, narg, c); putchar(','); print_linux_signal(*ip); ip++; From nobody Fri May 26 20:06:53 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSbYB08QBz4CrjM; Fri, 26 May 2023 20:06: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 4QSbY96lsmz3CpY; Fri, 26 May 2023 20:06:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685131613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c98ZG7ajK+ohn+3m2Zd+/0bPGSx++D7cpoeThTAgvlM=; b=hJBNVRbUki8h5uO0RyMjDnrQL753cMdzS0zTC40FCrD/zoLFoVduAyjrWUblRWMl6AaF0W WTDYC6yZvP/ldpm9nqnKNO4K/NfeuHxsJp5vP2cFx31BN0zjBRthZ6Q19zbz3zS3Y+jvnk V3fwYGtaTkAXeE9YIBRVXWgQmBWuZ3//v4LOWPfPRyUMHqmIX9jw1+Llc3twgv+tl//po5 mRW1GkCh+DoZ8WruhwLxO/yBTOUmEDVkmMF/7Mzy8ToDuw5abQyLV6u3KXIIe/pEJ1Fhdl /N0Kg/9RtX4vLRNru5r/5bp5c8VnsAQEON5m/ZUH10k828JlsmnAiHb/RJ/T9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685131613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c98ZG7ajK+ohn+3m2Zd+/0bPGSx++D7cpoeThTAgvlM=; b=dp90FS+N1WaJ8DOFkBI7YToqtyt2muyOG4calNSJqbfKTgd6vonPItzG8StCOJzZa+ujy9 ktlud/gSZcbhHXCooEyYrU//vS8cTO8ikt5jsSM0AkjAgNo0uiqnlXflvkU5XzazatGaPx 3qQjHGURSS6/qwCTptJmqOxOhNaW5MH/YyzMETgIUQ5MyhAJrxwAwzK5ckLzBfilm9kvL1 bA77iZ+D9ChiUgsRDFNFODk2KnlGGWUM97hwsRf4dwxSpshGhdnyM2/uX/koJEzFsbh8y/ vfxECY3qNfEnvG/I56wA79gy+hck8CWiUe/zZQzeDHH7gk3LMNHEvNDsTPUSTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685131613; a=rsa-sha256; cv=none; b=OKrFtSVIDKsscTOig18IK0OpdW2RVBPohp7UAvritPgKzSJDe2A6QAscqwQqan0C43o9t/ p4RdBQI5NdWCvi1ehNaC/5/3Zly1eXqjNwRMA9A16yD3UL2aQO3US8wPurOeHGMm21Jku0 2KT17DXQ1gUtDCDqM1taSIdIK612m5M5a8+zpzdkJARJG7wq2tpWtaHf81lHm4fO+kYCnH 0BK1osntsC0wJV27l7yzm3BFBeaIC+5pfgk1Vyj+J0hB5bkuSgDM+UzpS5KaTrsqLVYfHx XoaSR0+N5aNWjMS73aiXEq7aUhHaIfkRTKss1Rk4q6neVE/+D8pq9OT5WGpOTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSbY95cGNzK1M; Fri, 26 May 2023 20:06: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 34QK6reS098144; Fri, 26 May 2023 20:06:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34QK6roO098143; Fri, 26 May 2023 20:06:53 GMT (envelope-from git) Date: Fri, 26 May 2023 20:06:53 GMT Message-Id: <202305262006.34QK6roO098143@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 844942888f7d - main - tests: Add a simple regression test for ptrace(PT_SC_REMOTE) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 844942888f7d87885c79d87d808311086c664417 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=844942888f7d87885c79d87d808311086c664417 commit 844942888f7d87885c79d87d808311086c664417 Author: Mark Johnston AuthorDate: 2023-05-26 19:13:20 +0000 Commit: Mark Johnston CommitDate: 2023-05-26 19:38:08 +0000 tests: Add a simple regression test for ptrace(PT_SC_REMOTE) MFC after: 1 week --- tests/sys/kern/ptrace_test.c | 55 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/tests/sys/kern/ptrace_test.c b/tests/sys/kern/ptrace_test.c index 9cee07639f0c..49670fbf102e 100644 --- a/tests/sys/kern/ptrace_test.c +++ b/tests/sys/kern/ptrace_test.c @@ -4318,9 +4318,61 @@ ATF_TC_BODY(ptrace__procdesc_reparent_wait_child, tc) REQUIRE_EQ(close(pd), 0); } -ATF_TP_ADD_TCS(tp) +/* + * Try using PT_SC_REMOTE to get the PID of a traced child process. + */ +ATF_TC_WITHOUT_HEAD(ptrace__PT_SC_REMOTE_getpid); +ATF_TC_BODY(ptrace__PT_SC_REMOTE_getpid, tc) { + struct ptrace_sc_remote pscr; + pid_t fpid, wpid; + int status; + + ATF_REQUIRE((fpid = fork()) != -1); + if (fpid == 0) { + trace_me(); + exit(0); + } + + attach_child(fpid); + + pscr.pscr_syscall = SYS_getpid; + pscr.pscr_nargs = 0; + pscr.pscr_args = NULL; + ATF_REQUIRE(ptrace(PT_SC_REMOTE, fpid, (caddr_t)&pscr, sizeof(pscr)) != + -1); + ATF_REQUIRE_MSG(pscr.pscr_ret.sr_error == 0, + "remote getpid failed with error %d", pscr.pscr_ret.sr_error); + ATF_REQUIRE_MSG(pscr.pscr_ret.sr_retval[0] == fpid, + "unexpected return value %lu instead of %d", + pscr.pscr_ret.sr_retval[0], fpid); + + wpid = waitpid(fpid, &status, 0); + REQUIRE_EQ(wpid, fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + REQUIRE_EQ(WSTOPSIG(status), SIGSTOP); + pscr.pscr_syscall = SYS_getppid; + pscr.pscr_nargs = 0; + pscr.pscr_args = NULL; + ATF_REQUIRE(ptrace(PT_SC_REMOTE, fpid, (caddr_t)&pscr, sizeof(pscr)) != + -1); + ATF_REQUIRE_MSG(pscr.pscr_ret.sr_error == 0, + "remote getppid failed with error %d", pscr.pscr_ret.sr_error); + ATF_REQUIRE_MSG(pscr.pscr_ret.sr_retval[0] == getpid(), + "unexpected return value %lu instead of %d", + pscr.pscr_ret.sr_retval[0], fpid); + + wpid = waitpid(fpid, &status, 0); + REQUIRE_EQ(wpid, fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + REQUIRE_EQ(WSTOPSIG(status), SIGSTOP); + + ATF_REQUIRE(ptrace(PT_DETACH, fpid, (caddr_t)1, 0) != -1); +} + +ATF_TP_ADD_TCS(tp) +{ ATF_TP_ADD_TC(tp, ptrace__parent_wait_after_trace_me); ATF_TP_ADD_TC(tp, ptrace__parent_wait_after_attach); ATF_TP_ADD_TC(tp, ptrace__parent_sees_exit_after_child_debugger); @@ -4384,6 +4436,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, ptrace__proc_reparent); ATF_TP_ADD_TC(tp, ptrace__procdesc_wait_child); ATF_TP_ADD_TC(tp, ptrace__procdesc_reparent_wait_child); + ATF_TP_ADD_TC(tp, ptrace__PT_SC_REMOTE_getpid); return (atf_no_error()); } From nobody Fri May 26 20:06:54 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSbYC3fdbz4Crlg; Fri, 26 May 2023 20:06: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 4QSbYC0YbBz3Cd3; Fri, 26 May 2023 20:06:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685131615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KyiDIwVAkocD3Nv4bFJUlLs7L5Sr25rXgZljKyn2fvY=; b=CCFPSDM0PYtVtY8z+lQjQaqCI7xYGSmly4J3FmCX1boWRp8Mnf/LvgAx5MS98dnGyzKCxT lBDU1dKKtJaqB9CQv0G8pjzT0rwOyjNQ10AmFQthbcGZrV9nfa5w1K1xLrxkrPvWuryQpS ZD7FA5L0erZM9ACfYAoUm84GF37qt7igKLRuJUXPxZzlf10hURorpg+iTF5oFEJ/CWDsUe 2lMGMhaZ2+KP9U2q3gJznGaM9cWYwD9WOdQIeGzYkF0DLxORA3Vq2podQa6qttWuwfKhil TA9XpVd85VmBKrXw2AjH2Z5SvymVvT4KVWoP3KcZ60YPFuYqKLZbe7a/5bmlsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685131615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KyiDIwVAkocD3Nv4bFJUlLs7L5Sr25rXgZljKyn2fvY=; b=cu635OoBcRQcUq6XAZZKlB8zgYzmm+QHeJ+cXFJ9nLaNjGpxFFZlPtumigQSHOc/UNgiBh rJ++Q88GDjCmZbq5KTaDaJu/Xs2MOBFdwYRvv5Dkp92PX4YwUliJhMvi4PEaf2d3ScB+CV w5PBxgLHA6z0AFHFCaubVPfeU7ztVPPe+lxm/gxqGFN61ruef/O4mnWl7Qu1c3TF7O7f6c UWz9Olbf7vxRYOxbPPKelj9yKaw/MATHyHr9ooBZE8X8IZQyJfLRuib7XfTPR2X+mtzq7C tHv+81djY4DajAHb7jbTTNPCCfpTXbQqa7xfmLx+Jim9KMbtVKUiP2qFG7bb5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685131615; a=rsa-sha256; cv=none; b=xjbApyroi1ptDIZEd0E88Ty5431XySrffHZxwRfiJ2Fkko8djnhPsPFKBfvxHBerTbUoP5 Jf9YyIDi+Eiov8K9ouFNmDDVqD9yd1tQrsgCaUAbBlS/GafaR/4yLwDTXh1MVvkps9fJrh GvT0L/h353lhtlsUsMyc64kAUESqFFk3vpQUpWncwmx6JjD6Dwz2JKJUAyd70RWuKmiiuh fyL8FUhiB8IybF5ottmBKxRGsLCT/WJ3Z8vHvCixyoJYujlCM1g3JtzoPuArcep6aInn1O NwJ1Wx4NXJd0ltJAM5hLmfz5KXs1nYCBGWZgReLiAUpX6fjMzTbU8W/6Qk5RnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSbYB6Gs7zKdm; Fri, 26 May 2023 20:06: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 34QK6sKR098172; Fri, 26 May 2023 20:06:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34QK6sv1098171; Fri, 26 May 2023 20:06:54 GMT (envelope-from git) Date: Fri, 26 May 2023 20:06:54 GMT Message-Id: <202305262006.34QK6sv1098171@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 14c5cf3a16c9 - main - makefs/zfs: Avoid generating a GUID of zero List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 14c5cf3a16c9c21b49e0ec0a109467d81e5a47ff Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=14c5cf3a16c9c21b49e0ec0a109467d81e5a47ff commit 14c5cf3a16c9c21b49e0ec0a109467d81e5a47ff Author: Mark Johnston AuthorDate: 2023-05-26 19:14:00 +0000 Commit: Mark Johnston CommitDate: 2023-05-26 19:38:08 +0000 makefs/zfs: Avoid generating a GUID of zero --- usr.sbin/makefs/zfs.c | 20 ++++++++++++++++++-- usr.sbin/makefs/zfs/dsl.c | 2 +- usr.sbin/makefs/zfs/zfs.h | 1 + 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/usr.sbin/makefs/zfs.c b/usr.sbin/makefs/zfs.c index 7c2805ae5bbb..4d45926fb33f 100644 --- a/usr.sbin/makefs/zfs.c +++ b/usr.sbin/makefs/zfs.c @@ -274,6 +274,22 @@ nvlist_copy(const nvlist_t *nvl, char *buf, size_t sz) memcpy(buf + sizeof(nvl->nv_header), nvl->nv_data, nvl->nv_size); } +/* + * Avoid returning a GUID of 0, just to avoid the possibility that something + * will interpret that as meaning that the GUID is uninitialized. + */ +uint64_t +randomguid(void) +{ + uint64_t ret; + + do { + ret = ((uint64_t)random() << 32) | random(); + } while (ret == 0); + + return (ret); +} + static nvlist_t * pool_config_nvcreate(zfs_opt_t *zfs) { @@ -529,8 +545,8 @@ pool_init(zfs_opt_t *zfs) { uint64_t dnid; - zfs->poolguid = ((uint64_t)random() << 32) | random(); - zfs->vdevguid = ((uint64_t)random() << 32) | random(); + zfs->poolguid = randomguid(); + zfs->vdevguid = randomguid(); zfs->mos = objset_alloc(zfs, DMU_OST_META); diff --git a/usr.sbin/makefs/zfs/dsl.c b/usr.sbin/makefs/zfs/dsl.c index f6b7dc0ede17..a9ab93a90c38 100644 --- a/usr.sbin/makefs/zfs/dsl.c +++ b/usr.sbin/makefs/zfs/dsl.c @@ -602,7 +602,7 @@ dsl_dataset_alloc(zfs_opt_t *zfs, zfs_dsl_dir_t *dir) ds->phys->ds_creation_txg = TXG - 1; if (ds != zfs->snapds) ds->phys->ds_prev_snap_txg = TXG - 1; - ds->phys->ds_guid = ((uint64_t)random() << 32) | random(); + ds->phys->ds_guid = randomguid(); ds->dir = dir; return (ds); diff --git a/usr.sbin/makefs/zfs/zfs.h b/usr.sbin/makefs/zfs/zfs.h index b585955f7a1d..193ca1248d89 100644 --- a/usr.sbin/makefs/zfs/zfs.h +++ b/usr.sbin/makefs/zfs/zfs.h @@ -168,5 +168,6 @@ struct dnode_cursor *dnode_cursor_init(zfs_opt_t *, zfs_objset_t *, dnode_phys_t *, off_t, off_t); blkptr_t *dnode_cursor_next(zfs_opt_t *, struct dnode_cursor *, off_t); void dnode_cursor_finish(zfs_opt_t *, struct dnode_cursor *); +uint64_t randomguid(void); #endif /* !_MAKEFS_ZFS_H_ */ From nobody Fri May 26 20:06:55 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSbYD2VFrz4Crd4; Fri, 26 May 2023 20:06: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 4QSbYD1SBfz3Crk; Fri, 26 May 2023 20:06:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685131616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RzUinnj3oiHoWZ9l5avTSklByP/UeQiJ1np2nSBpf/U=; b=ItziecaGDiehmIr/+RwzrCzQVYIcKBr1NIM1nPQJtbwc0sRWaaKZC/nhx0xZv1Dw020uEh ehKH/fPhk0gzOhNL2AVTJtJFb/DQufMPo3dBjjGsuijIws+u6LtBOlssNMnsSkE8xe2urh 1EMXL516g/X5XiQXjPy606CVcLMtOQk0BbtNov0Fcb4I2+2g7nRMhrvw5m8WW9nTXMQV19 xu+GCUMpeQW3LfJRGDkBWNlbeCz5+Z6gOXNmjRhpLzCytWW05kHibZEOkBWsjODLyQvmIF uAcWG6Egos9ttx1DpV+fFhVahjGSJxD2Y5hFiTwjElNEVmb+QHqCX3nYgDMEcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685131616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RzUinnj3oiHoWZ9l5avTSklByP/UeQiJ1np2nSBpf/U=; b=xrdTfpjnJmucmoeqOqx1r6tPzB5Wb3FZw2TDHLxWcDinHXPUO4iZ/VwqeNzlu/vWzyv3vN 3mkmwDYXlQYzXNwxkH746ydMGsDTBg+ZnTOBrJNlQWjR3SjGzptxivUR9hZtdLgnIPmg/U P7xcn/KVF7MRozPU85Fp7mt2a1yAQNZjIvIXBVDlx91FY/A+PERUfOz2YIi8IHzwLXyztb y1Hmzv44KFM1wsvuvYUoTxy1ie58e5suBOIojI+EQu7v/O264KEWVr2oyZhGBH6E5AVEN4 MUVCijTKBSwv0U73LT0M6e/igyzCqfUPOEth/Qu+3jYsXLPlYkB1/B5YIY7d3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685131616; a=rsa-sha256; cv=none; b=nNJ3vAkvJT+da3mXBCP/xCU+2MORWAZEtDTDhCJLaXC6TkgBIfeCCT1P/3kVwODyp2PRmj mDU47CArbBk+0F9bF7e/vWdALVqhQ4Lnrm5FFo8DomDB82aU4VjYU0CD1/qAq0BfmVQy+R NbXkFCHZKqYcd2r8mZdJauWidEnc00oRdXGBeVJscG+h+zSLCIm73VG/ePX1BrrrZerkoi 3hCDuWlk7wJG3T8TNtoE+nkF5zlhDZZYD/J52s8x6DWd8i2oYvwoJPhfXXmJcrih+lXyH1 Kwxie+OFclGvdoXFRBza5uUCqiZcxxKzd7bMba1ilnn8HNt6paQr1kGZQwdFHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSbYD05hHzKZT; Fri, 26 May 2023 20:06: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 34QK6tMS098191; Fri, 26 May 2023 20:06:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34QK6tIw098190; Fri, 26 May 2023 20:06:55 GMT (envelope-from git) Date: Fri, 26 May 2023 20:06:55 GMT Message-Id: <202305262006.34QK6tIw098190@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: e96ed177465e - main - top: Use a cpuset_t to represent a CPU mask List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e96ed177465ee59fcc43dd0696106e5342e28c27 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e96ed177465ee59fcc43dd0696106e5342e28c27 commit e96ed177465ee59fcc43dd0696106e5342e28c27 Author: Mark Johnston AuthorDate: 2023-05-26 19:14:21 +0000 Commit: Mark Johnston CommitDate: 2023-05-26 19:38:08 +0000 top: Use a cpuset_t to represent a CPU mask The code attempts to detect holes in the CPU ID space, but previously this would only work for up to sizeof(long)*8 CPUs. MFC after: 2 weeks --- usr.bin/top/machine.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index be667ec0e461..2fbdb8551bb0 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -16,9 +16,10 @@ * $FreeBSD$ */ +#include +#include #include #include -#include #include #include #include @@ -204,7 +205,7 @@ static const char *ordernames[] = { static int maxcpu; static int maxid; static int ncpus; -static unsigned long cpumask; +static cpuset_t cpumask; static long *times; static long *pcpu_cp_time; static long *pcpu_cp_old; @@ -347,8 +348,6 @@ machine_init(struct statics *statics) statics->order_names = ordernames; /* Allocate state for per-CPU stats. */ - cpumask = 0; - ncpus = 0; GETSYSCTL("kern.smp.maxcpus", maxcpu); times = calloc(maxcpu * CPUSTATES, sizeof(long)); if (times == NULL) @@ -357,18 +356,18 @@ machine_init(struct statics *statics) if (sysctlbyname("kern.cp_times", times, &size, NULL, 0) == -1) err(1, "sysctlbyname kern.cp_times"); pcpu_cp_time = calloc(1, size); - maxid = (size / CPUSTATES / sizeof(long)) - 1; + maxid = MIN(size / CPUSTATES / sizeof(long) - 1, CPU_SETSIZE - 1); + CPU_ZERO(&cpumask); for (i = 0; i <= maxid; i++) { empty = 1; for (j = 0; empty && j < CPUSTATES; j++) { if (times[i * CPUSTATES + j] != 0) empty = 0; } - if (!empty) { - cpumask |= (1ul << i); - ncpus++; - } + if (!empty) + CPU_SET(i, &cpumask); } + ncpus = CPU_COUNT(&cpumask); assert(ncpus > 0); pcpu_cp_old = calloc(ncpus * CPUSTATES, sizeof(long)); pcpu_cp_diff = calloc(ncpus * CPUSTATES, sizeof(long)); @@ -466,7 +465,7 @@ get_system_info(struct system_info *si) /* convert cp_time counts to percentages */ for (i = j = 0; i <= maxid; i++) { - if ((cpumask & (1ul << i)) == 0) + if (!CPU_ISSET(i, &cpumask)) continue; percentages(CPUSTATES, &pcpu_cpu_states[j * CPUSTATES], &pcpu_cp_time[j * CPUSTATES], From nobody Fri May 26 20:06:57 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSbYF30Zzz4CrrX; Fri, 26 May 2023 20:06: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 4QSbYF2Q4rz3Cqp; Fri, 26 May 2023 20:06:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685131617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DXUS1voBPexCjC1YWcThd/FkGT5LHHmzHsTzKxIkB1E=; b=XYYDu9kFl0AO4QEyuo3pZscLRctgHUvAMwqI9Vf5r8oQ8389YRGCcDEn6HAaq0F/62ODSX YWdENJjAFBsWKi8DXzhhzGliwBVlDFreyDy/bygwlp/UQ0FICTF+HB+HMFvX8E/HFCyYAM 1luwn+VpBSSorsgUAX04oHykUDNYahf/PurcDvgUgNNTnGtn83VZTsvqjIf/2yfC46yfkt hcMFYx7V4kaCx+0EbNjO9dkOGbaA7Scnh136vX7QLKkuC4dfiGqTgqVZWyoGkfpyyN6lxu qlz0XUw56FV45XVeRKfawK5TtfjQkerlZbZZIuLpr/buLZYsMsnDoaAyzJclBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685131617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DXUS1voBPexCjC1YWcThd/FkGT5LHHmzHsTzKxIkB1E=; b=o9+N2n6QkUZuexIdaunDzhZFtiNIbuXricyOjyBp4kED2Rj5nLfiF2mGvItSXdyv23Aw8X /+1oXWIY1zt9XDHJvNsLI0kPe4L/8EmpMij09zKESaDWF57S63k04DpTRGbNCDhVjNdOoA QeeybQAaxUfY55x4YG36Jat9W+ghEUo6Tb3Nbfgm8vSHDASDp9Tx5lPHAI+UZqqqGV5N/y Bq7LGb8BZ5pO3ULsL4zP6PrGlkRLzy0jMMtvf3TFVIZz6T1I4tbxvIPp12u3jaSmA5f7Sn DunXjByOIPvjvYmpKcpqDdyQSVSJ00wOH6fvpYQdR4uk2IbRvulhKSs9YxsW+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685131617; a=rsa-sha256; cv=none; b=oy5WYLfTcHlkLWtmZrrVeMS/K+NGUV5vZ35OwZrrWHeprJ6tP/+rHeB5RKaE03AlYHQ2cK oELdlsjGaNJrgmEnYeny1nmnhm+tPQCh8Al4UPqUa6XdL4VRzkk6NTYI5PAOI400yTIh4V HXs9mRRMUjEn2x4qtrlEyReaE29X8WGIx64yepxV8GbjUDpTVnaIk5ENa7HK53zswpbIud BACEPyhHqOgYyVe1hVo50b5CTl/0YWSoUx2OjUSWxY7pFHyfmAbVehYzYOluehIHshmTsR C+//vv+tv9ymEUGcCUcM121SCE+X2r/UiktVspJ1+FiVBORAzJeeXa2mLUeNSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSbYF0z3YzKZV; Fri, 26 May 2023 20:06: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 34QK6vWF098210; Fri, 26 May 2023 20:06:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34QK6vxx098209; Fri, 26 May 2023 20:06:57 GMT (envelope-from git) Date: Fri, 26 May 2023 20:06:57 GMT Message-Id: <202305262006.34QK6vxx098209@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 44866dfb4417 - main - bitset: Remove BITSET_FOREACH_ADVANCE List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 44866dfb44178c86b6f380eb713a8f07c3d3b566 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=44866dfb44178c86b6f380eb713a8f07c3d3b566 commit 44866dfb44178c86b6f380eb713a8f07c3d3b566 Author: Mark Johnston AuthorDate: 2023-05-24 17:05:03 +0000 Commit: Mark Johnston CommitDate: 2023-05-26 19:38:08 +0000 bitset: Remove BITSET_FOREACH_ADVANCE __BITSET_FOREACH_ADVANCE is a helper macro for __BITSET_FOREACH_IS(SET|CLR) and wasn't meant to be used directly by consumers. While here, fix some whitespace and move a comment back to where it belongs. Fixes: 5e04571cf3cf ("sys/bitset.h: reduce visibility of BIT_* macros") MFC after: 1 week --- sys/sys/bitset.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/sys/bitset.h b/sys/sys/bitset.h index ca6dd4590e89..a6e504e7f3b3 100644 --- a/sys/sys/bitset.h +++ b/sys/sys/bitset.h @@ -309,9 +309,6 @@ #define __BITSET_SIZE(_s) (__bitset_words((_s)) * sizeof(long)) #if defined(_KERNEL) || defined(_WANT_FREEBSD_BITSET) -/* - * Dynamically allocate a bitset. - */ #define BIT_AND(_s, d, s) __BIT_AND(_s, d, s) #define BIT_AND2(_s, d, s1, s2) __BIT_AND2(_s, d, s1, s2) #define BIT_ANDNOT(_s, d, s) __BIT_ANDNOT(_s, d, s) @@ -328,8 +325,7 @@ #define BIT_FFS_AT(_s, p, start) __BIT_FFS_AT(_s, p, start) #define BIT_FILL(_s, p) __BIT_FILL(_s, p) #define BIT_FLS(_s, p) __BIT_FLS(_s, p) -#define BIT_FOREACH(_s, i, p, op) __BIT_FOREACH(_s, i, p, op) -#define BIT_FOREACH_ADVANCE(_s, i, p, op) __BIT_FOREACH_ADVANCE(_s, i, p, op) +#define BIT_FOREACH(_s, i, p, op) __BIT_FOREACH(_s, i, p, op) #define BIT_FOREACH_ISCLR(_s, i, p) __BIT_FOREACH_ISCLR(_s, i, p) #define BIT_FOREACH_ISSET(_s, i, p) __BIT_FOREACH_ISSET(_s, i, p) #define BIT_ISFULLSET(_s, p) __BIT_ISFULLSET(_s, p) @@ -350,6 +346,9 @@ #define BIT_ZERO(_s, p) __BIT_ZERO(_s, p) #if defined(_KERNEL) +/* + * Dynamically allocate a bitset. + */ #define BITSET_ALLOC(_s, mt, mf) malloc(__BITSET_SIZE((_s)), mt, (mf)) #define BITSET_FREE(p, mt) free(p, mt) #endif /* _KERNEL */ From nobody Fri May 26 20:06:58 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSbYG3Lsfz4Crrb; Fri, 26 May 2023 20:06: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 4QSbYG2pMcz3CsX; Fri, 26 May 2023 20:06:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685131618; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QrID28GCnV5zu+SIOTtIYaRIPxO3cmbs8wPLNOJth24=; b=ppcpGpCmW4LMbpvy+0L+2VAdJ3NuUu7AInoRx9ZGx1ZlUGsiDkRnGCudYLA8/lgUkwafFf DlEaYj89jQOkDuvefmXyd52hARMlNWlBTSrO82lLDDDpKHigIf1zH+GP/gCgzN54kDRmgC n6HDjhGa9Sf7Mkj5m+W16FGB6lLbu3MG8rgBk5aJaOOOvFKseseTAiZFCuBKtwptbHUHdO KL8jZO3qZD797zwbClvmgURlH7NzmG8KWga/HwWIt071Y/SeKN6faLTFQA0LjgTTpwREbo HZtWQvmJQj1YfbLDM6TyTqhbvxY3uXrCojAvAiwtJe5OiJxYCugln7lHo8GBWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685131618; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QrID28GCnV5zu+SIOTtIYaRIPxO3cmbs8wPLNOJth24=; b=Is2Yznf6d0IuMeZ7BiLkliWZkSHogvgeOESmkm5qfC4gO1JCFJKTCnyxxDUdNNtV86y7cX rYFNTgAOZanrhSrAk7IMZ8UcorJZbQI2OO2bRF26fptAwgisH5fsJGrW3zU3RHyWuJOqUJ NVLKnjjNFkHia1COmPxBcj2XiNyeiac4jZRuS/JqlTLQ41QASvYsduwFGlT1+pJFpRKlfP xCq26+OX61vZcP9WUxKxumXp+nptBuHtz1U0FajBB45JTbhp4CpTcRk7VrHy7nQ4GdNdTZ egpHBX2ZEYLeQdvPDz5gnAWMXVuRObd+wwSupPeh9PtST6982vg2S94QNje6BA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685131618; a=rsa-sha256; cv=none; b=MsW7Klo8qAC6S71QhoamLe7OI/qwuxP8aWUH79EXkTy1uXzzNnoneowRkerVSwsCBMUVOs gBhMuEMXje7QfeU8kDbBJ4mtWuzGf1Hs8MPgAmqKcesdevzta1Mncy37WhJSALm+ljca0K aZsu1PGH7rqSj3aiBEcKFzxW5YwVNp7AAM3jnJLKzi+aP0X7jGFb4LxOf7puBVHzjNIe/i 27twIeA+ABnXNZs8Lu/xiK4FqMen8twnHFmHO2aLy99Vrhhg3KZJ3kIUKoh6hjWQ7tg9iF 4gaB9vB6cre6mpnn/3qfZ/9CZ1z/csbZb3chEco61Ln0yfAALJIxwmJk6KbHlg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSbYG1pM5zKXt; Fri, 26 May 2023 20:06:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34QK6wsO098232; Fri, 26 May 2023 20:06:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34QK6w5s098231; Fri, 26 May 2023 20:06:58 GMT (envelope-from git) Date: Fri, 26 May 2023 20:06:58 GMT Message-Id: <202305262006.34QK6w5s098231@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: ca4c78590095 - main - nexus: Consistently return a pointer in failure paths List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ca4c7859009549975229d854888231e48938035e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ca4c7859009549975229d854888231e48938035e commit ca4c7859009549975229d854888231e48938035e Author: Mark Johnston AuthorDate: 2023-04-26 21:19:28 +0000 Commit: Mark Johnston CommitDate: 2023-05-26 19:38:08 +0000 nexus: Consistently return a pointer in failure paths No functional change intended. MFC after: 1 week --- sys/arm/arm/nexus.c | 2 +- sys/x86/x86/nexus.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/arm/arm/nexus.c b/sys/arm/arm/nexus.c index 48e766b0cc62..430373d3679f 100644 --- a/sys/arm/arm/nexus.c +++ b/sys/arm/arm/nexus.c @@ -256,7 +256,7 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, if (needactivate) { if (bus_activate_resource(child, type, *rid, rv)) { rman_release_resource(rv); - return (0); + return (NULL); } } diff --git a/sys/x86/x86/nexus.c b/sys/x86/x86/nexus.c index d02d081de1e8..332b1527efbd 100644 --- a/sys/x86/x86/nexus.c +++ b/sys/x86/x86/nexus.c @@ -388,13 +388,13 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid, rv = rman_reserve_resource(rm, start, end, count, flags, child); if (rv == NULL) - return (0); + return (NULL); rman_set_rid(rv, *rid); if (needactivate) { if (bus_activate_resource(child, type, *rid, rv)) { rman_release_resource(rv); - return (0); + return (NULL); } } From nobody Fri May 26 21:38:53 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSdbL0xfrz4THy8; Fri, 26 May 2023 21:38: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 4QSdbL0SM6z3MYr; Fri, 26 May 2023 21:38:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685137134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3OqQT9PNQ76tOPAp6aGY1f1Mkrho/szm5vQP7vxslxo=; b=hiGIDrGmBSjQ/oiVi1JcxMqMLOWfa1GRVj+VIKAe/gpY2uQ+OHYNsyoLf68Vhk9Ur7b7Eb Kb9+qa3NjK2KUvDEiyKxlfmyQlC+mpUzpOBv50Yk1mvbhj6pV7WfPBowtv4KqFP4QtWWa7 IebZtRgeaoN3OntNsbSE8t7xgeu2sbl5BNDvbBJB24E3MB4xv3jtFrdW97PaAU2Abwa+pb iiPQ2yUhg5uqqzEcNOvNwYsYeV0PoF5TaZUVFLKRkrKCnShr7+bTsnkG8uhgEYlkjWrzsn VjU2b3TQ1BxeWzSnSyizqRWJfE8A0c4xInd96PpPgSZ3iD75rmAQWePa60JFDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685137134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3OqQT9PNQ76tOPAp6aGY1f1Mkrho/szm5vQP7vxslxo=; b=j9d5y3lRQySDYRS3W0MPPjjzJs7m8Xa4u3vXDSz249u6nWAssLmfnt215EJ90ziv0kvfq3 9JT4me5lOAEnBzjsq1n4hH29XH3sgBuoZ8ayMKEALdyjhyA7YN26cHKrChYd6PTKKfuyX0 NhK5wsWtPKS3N2vFvnPq5kONK1zt2DgD8wc9r52eHtiaJOD+wgxhi/6CP4d1TTYEPIHEjC DqzqbFDl2XSFTva0J+7QPX+yb83dQiC6t8dfTrfDhSRE0SxFapPleC3gUeMBdRGwY6eFaK x8Gz6anC/wi7xo/gTxojK+3j3ZfdFVpzOObJ4YHwj4Spk6Fo8aONTYUe76MIZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685137134; a=rsa-sha256; cv=none; b=sO26qkjaH0PCGhnCQJpzeVBLrGAvA9sogXcNHTzCTXOYZdFgFd2nylMDX6d3CHA0SGy5Vc B6UnGGSiBaDCME0jAZtlp0fZ2nwptRcNzgnCwt89Nns7G3fzARgyzgBaNOCaMFYnZr/TMF QqbG42KBre/GmDKws1yV9HkdycT6Nu0FiPrDFoQQfh8lUNNmtZ5xBK2TmcRlJaV0XqtFdQ BatmzZtpinW12KIY64QtI5ue6N7wGBlf4W/6VG0p4gFw8RIirPNHJkW6I3vcYj88CZbiy+ i6a2dtOPWV39z/onT2e5mJW6XvZqsgJdN7Yr4CBUP+rVYCKmY4queOM1mk1JVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSdbK6Yz4zMlC; Fri, 26 May 2023 21:38: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 34QLcrIG045625; Fri, 26 May 2023 21:38:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34QLcrUD045624; Fri, 26 May 2023 21:38:53 GMT (envelope-from git) Date: Fri, 26 May 2023 21:38:53 GMT Message-Id: <202305262138.34QLcrUD045624@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: da8c3d21490f - main - tests: Fix format strings List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: da8c3d21490fe791f8e4405216d5490dbea4dbe5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=da8c3d21490fe791f8e4405216d5490dbea4dbe5 commit da8c3d21490fe791f8e4405216d5490dbea4dbe5 Author: Mark Johnston AuthorDate: 2023-05-26 21:38:06 +0000 Commit: Mark Johnston CommitDate: 2023-05-26 21:38:06 +0000 tests: Fix format strings Reported by: Jenkins Fixes: 844942888f7d ("tests: Add a simple regression test for ptrace(PT_SC_REMOTE)") --- tests/sys/kern/ptrace_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/sys/kern/ptrace_test.c b/tests/sys/kern/ptrace_test.c index 49670fbf102e..0a0f219d6f36 100644 --- a/tests/sys/kern/ptrace_test.c +++ b/tests/sys/kern/ptrace_test.c @@ -4344,8 +4344,8 @@ ATF_TC_BODY(ptrace__PT_SC_REMOTE_getpid, tc) ATF_REQUIRE_MSG(pscr.pscr_ret.sr_error == 0, "remote getpid failed with error %d", pscr.pscr_ret.sr_error); ATF_REQUIRE_MSG(pscr.pscr_ret.sr_retval[0] == fpid, - "unexpected return value %lu instead of %d", - pscr.pscr_ret.sr_retval[0], fpid); + "unexpected return value %jd instead of %d", + (intmax_t)pscr.pscr_ret.sr_retval[0], fpid); wpid = waitpid(fpid, &status, 0); REQUIRE_EQ(wpid, fpid); @@ -4360,8 +4360,8 @@ ATF_TC_BODY(ptrace__PT_SC_REMOTE_getpid, tc) ATF_REQUIRE_MSG(pscr.pscr_ret.sr_error == 0, "remote getppid failed with error %d", pscr.pscr_ret.sr_error); ATF_REQUIRE_MSG(pscr.pscr_ret.sr_retval[0] == getpid(), - "unexpected return value %lu instead of %d", - pscr.pscr_ret.sr_retval[0], fpid); + "unexpected return value %jd instead of %d", + (intmax_t)pscr.pscr_ret.sr_retval[0], fpid); wpid = waitpid(fpid, &status, 0); REQUIRE_EQ(wpid, fpid); From nobody Sat May 27 01:05:28 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSk9h6Q2tz4V1Br; Sat, 27 May 2023 01:05:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QSk9h5hz0z3tmy; Sat, 27 May 2023 01:05:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685149528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gejlFYYODVmolsKy1zdkf6fGBHL9soodWS0IG8c9WCY=; b=uMsThyhUEN7x1zIb0uqn0s7nkB/HzxI6hK5p/eIEAgPsWK0/TWgjv5kHkKSfba2EYLmgAX tOWOqAV05TFLZDClsWuaQfK9go/IFJuOCo7QRIUKnJRDArqeWErhMOCzhDsuZy9vn+uIVU 7Dfk911GC7+ycnXEtljui1B7D9mInK2U+tRK2B3S+MZih0osDa1QGu1PSzjnFClkfUTwSF kjPpc3C+suUYO12Z4GbrtQPyRV2zDVwEFDGLJ+A1npzKhGLtUON4iQXPYbIL3ghXm4Wvk/ ETVpmp9BDFJFfaGFuERY2l1OMVf1ZAy4eabYxWa+WKEyz/rHr++EaDmWboM4OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685149528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gejlFYYODVmolsKy1zdkf6fGBHL9soodWS0IG8c9WCY=; b=SjqMvrL8f0QxrCS0IlTqvwKJD/47u0amXOMuXUMEenMh1QoczsqCJFqhcyna00G4SsJi2Q 2Y4Xbox524yGgzZUGtIu7rL+5IFj2v05nL6lfgfBynxwSirC+8lu9wTDaWKnx0CPR1A8hw kfRC8qMBHSiPZRGj7xP0z9QB67pWm10VCS8JfQEdt66k9wRHTpU7I4WdFZd2hwB3iAA0Pq F5wVG1/EhutcQd41x3ZosrdRodjzCHizlgsPWuWO7oDjnP/TrEB+QFlGfJ3pI/uUJRece4 ocbciaqT3kV1HsH+AVeAWGrJX70fTX1Aux2pmr6+ImxTkAP4qNELjrN1VTBYOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685149528; a=rsa-sha256; cv=none; b=gyU9AgFmH9Vcu67F4e/Vgl83D1dmV20i8ptDOAz/zttD+4dD3kIUOmh2IdTi0MYsSCdSwz 0gjQDzVz71IbiY+5jn9TC/OGDd8G7Xb3NOXJOI5OyoKAyxccLkS1NqHp01bPMYBSNGBA+F pjCQ0QnS1O0OKUfu7IgdEPdUH0Ukta0cTgQ0b0Y0TQGj6A7AN7lTQUg9ITT3CdDnSpjlsA OnMcJ0P/WrngYVW66lfcqvpUadMWd2yKgtBI6auPZxVzRzfzk5m9GJY7YORcoW7TKTKBX+ BrOeDrZq92jSl3q5ONErNISWtwgQFYlPEZGSl1bv6XZZzohPbSHVDtOEqSY/Bg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSk9h4kzczTKv; Sat, 27 May 2023 01:05: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 34R15SPR090348; Sat, 27 May 2023 01:05:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34R15S6h090347; Sat, 27 May 2023 01:05:28 GMT (envelope-from git) Date: Sat, 27 May 2023 01:05:28 GMT Message-Id: <202305270105.34R15S6h090347@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Enji Cooper Subject: git: 52b63df9b6df - main - dumpon: provide diag info when `PEM_read_RSA_PUBKEY` fails List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 52b63df9b6dfc157fb0b9f61a770b64e3663dee9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=52b63df9b6dfc157fb0b9f61a770b64e3663dee9 commit 52b63df9b6dfc157fb0b9f61a770b64e3663dee9 Author: Enji Cooper AuthorDate: 2023-05-27 01:02:34 +0000 Commit: Enji Cooper CommitDate: 2023-05-27 01:05:04 +0000 dumpon: provide diag info when `PEM_read_RSA_PUBKEY` fails This change modifies dumpon to print out the last error from OpenSSL when `PEM_read_RSA_PUBKEY` fails. This allows end-users to diagnose why reading in RSA pubkey files fails so they can adjust the usage to meet the needs of the command. MFC after: 1 week --- sbin/dumpon/dumpon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sbin/dumpon/dumpon.c b/sbin/dumpon/dumpon.c index 626350427595..c530c9ad59ed 100644 --- a/sbin/dumpon/dumpon.c +++ b/sbin/dumpon/dumpon.c @@ -270,7 +270,8 @@ _genkey(const char *pubkeyfile, struct diocskerneldump_arg *kdap) fclose(fp); fp = NULL; if (pubkey == NULL) - errx(1, "Unable to read data from %s.", pubkeyfile); + errx(1, "Unable to read data from %s: %s", pubkeyfile, + ERR_error_string(ERR_get_error(), NULL)); /* * RSA keys under ~1024 bits are trivially factorable (2018). OpenSSL From nobody Sat May 27 05:43:45 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSrLp3SCRz4WXls; Sat, 27 May 2023 05:43:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QSrLp1XZCz51hQ; Sat, 27 May 2023 05:43:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685166226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Opuqcz+wij+ZWo8acn6Hr+ZhgA/GlmmrjHFr+msAnU0=; b=YGUFop3qJH1gMP5nI8j4C9QK83JEzH345xfGk+3Nnco/d6T+2sEXu8jceqy2nVj8insKpZ Uwk+8sVrOTM1gzkpCnALz7McoIPK3K8ezFHwCVdzOTFCY67Z051uxDdlJCMDHVcWhybexk ek8auKkursHA9j+YDoACevuu5ENPfwhiRipxs5/Xrl+lzcO22JxIMUUKnsgAhFP5hMFUDb FGJ8JS/InFbvFxLkYSdeleESni+Py+lJfvyuNaB1plyVB82ijMXhezgPNuTaEA3RMcptxr mNdzBmHOMWC4qE9TOH4jZ6C8cAuOUEF3y86HCz33j/KCFxiOFztSesPgXdWy7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685166226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Opuqcz+wij+ZWo8acn6Hr+ZhgA/GlmmrjHFr+msAnU0=; b=CH30a3gF/Yq0djsWt46rPqczPwQodCGL2ft3VnRB5E9UVOwYf4Z+whE0mnh6w6Ghq2jsX5 8/5gdilbl8bYIclT6kbfVC6S7S7O218UmCjAZuCiUlkLd9L505XlUULDpQNTQl7rVEjlqC hm9KyDthTHRWg+zF00oEH0VSwR9+gsFVLebGW9cfmrIxSpnW7QYT+ddi8Sq9QJKj1H1jg3 xXYIp9j6nMyn5j5ZoLSH4UcdX91FWrirZyRuDWQRKNKrMcqUBpz6ABtCe7MHyfhcbMIhr7 XDfh/k2pz5nXYBTPnGCYL6woJzd39nKKTiL/34udhlRNRmbgrpn2WRzaEqVaaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685166226; a=rsa-sha256; cv=none; b=Gfo+/K8h7EmYhgSr1M8/pWvHECWmzVR0YkObn2GLWMYeOoIfUvkSKJbeIWMnJO5hLBHt/x 5/hbndlV3nFp0nFTTzRairpUW8CGzKSnB0dlgEpqThbekqapQHsPT7yrlM3UYZ3GwpSMiP naOvTnqpi6koQMGiREci3Xixbo3vN7gEngLYZmLr69HNascyPH57iTidChqe3UusSHwrfs 5HfKNenK0LQZClQMWgn5KuTBSQO6KbeiE/oue8+APziCyw9kSJOl9KhdkqGNPsjwCywr3n e/srubpf0hvMsF0HDMqb3iWuXg7/wt2aIdrZYjxRS5KLl1eo1ZKfr7CWCS3obA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSrLp0d1Szcv9; Sat, 27 May 2023 05:43: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 34R5hjeV061332; Sat, 27 May 2023 05:43:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34R5hjF8061331; Sat, 27 May 2023 05:43:45 GMT (envelope-from git) Date: Sat, 27 May 2023 05:43:45 GMT Message-Id: <202305270543.34R5hjF8061331@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: 03a8680202ef - main - Correct two bugs in fsck_ffs(8) triggered by corrupted filesystems. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 03a8680202ef7d7e68adc70625633c490b4ed637 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=03a8680202ef7d7e68adc70625633c490b4ed637 commit 03a8680202ef7d7e68adc70625633c490b4ed637 Author: Kirk McKusick AuthorDate: 2023-05-27 05:41:57 +0000 Commit: Kirk McKusick CommitDate: 2023-05-27 05:43:21 +0000 Correct two bugs in fsck_ffs(8) triggered by corrupted filesystems. Always create a directory inode structure when a directory inode is found in Pass 1 as it is not known whether it will be saved or removed in later passes. If it is to be saved the directory inode structure is needed to track its status and fsck_ffs(8) will segment fault if it does not exist. Reported-by: Robert Morris PR: 271310 PR: 271354 MFC-after: 1 week Sponsored-by: The FreeBSD Foundation --- sbin/fsck_ffs/pass1.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/fsck_ffs/pass1.c b/sbin/fsck_ffs/pass1.c index e784fd29dc1c..863bf34ff0fc 100644 --- a/sbin/fsck_ffs/pass1.c +++ b/sbin/fsck_ffs/pass1.c @@ -400,13 +400,13 @@ checkinode(ino_t inumber, struct inodesc *idesc, int rebuiltcg) if (mode == IFDIR) { if (DIP(dp, di_size) == 0) { inoinfo(inumber)->ino_state = DCLEAR; - } else if (DIP(dp, di_nlink) <= 0) { + } else if (DIP(dp, di_nlink) == 0) { inoinfo(inumber)->ino_state = DZLINK; } else { inoinfo(inumber)->ino_state = DSTATE; - cacheino(dp, inumber); - countdirs++; } + cacheino(dp, inumber); + countdirs++; } else if (DIP(dp, di_nlink) <= 0) inoinfo(inumber)->ino_state = FZLINK; else From nobody Sat May 27 05:56:00 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSrcx1yNFz4WY3K; Sat, 27 May 2023 05:56: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 4QSrcx1CxFz53jj; Sat, 27 May 2023 05:56:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685166961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KIo8ZnTMFZRbxHGxJZWrOQ2WKIh129eHOcJ0zZpvDrw=; b=jMQh+shYOrQLvk4a6sjH6DJtdb1dowFQqR876xJH3Q7O1580X2REX3vewI0QxTMfO/iy4P LfLBA2tqWh1XRcQzcP58LnfdglZahP7Zx+UQ0KZQ7VEJLktol0NPZbwDaARvy0bSTbU9RM dK6mocXMsxDHxKwmk7Av0rES4oBIjikib9FC32Wr35pAM7l8WXSetpxujXYsMFY8kl6Q5a J1bibTShJosoVSL4u1MkFWOR+r4VgI6UTjVD1a/hme7SXyjn7e+Hy9Q5UfU3fAAZF7sDnt xLdQD80bgPZW7q0tIXx5Ll0mPVqceXXFBHbN39vNgxTRmmvgddHJEWZoGHAr2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685166961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KIo8ZnTMFZRbxHGxJZWrOQ2WKIh129eHOcJ0zZpvDrw=; b=n7zp3NKU8o5cynR4AnU0lNHibGXm56PfTju4dXxuy84m7zvCdannren7Lu5iovOaHgZ3Zs kD1cecKYdIUQ5prgRgg2+9ErzHAmT3Ybo+a/+/+MV5gPwLBPtatwjCCKo4Kko9XG5BVHOw 27cM37GXbFw7dm1PRkUlq5TU8bdmr3cKyAxCQffbMhYzZRgSctNGwpp/FGD8ghJXMSu5UM lHaMNWD/4p2Vhp6uiqBYnVlRp/A3NTTkB/WQERmNAEHBjdXdyb3DKbBA6FcLuVbAC5Z9gC DpndP3xOlk3JK287ewg2suAg/jF46BLmvPdRxg8QjTCux5odPKOnRCOak0+mEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685166961; a=rsa-sha256; cv=none; b=FSs5oo6/Trjk1aaztdcGKwBZYvOHyFPpkYnigHujFPIZ2heGdl9s5BQRKB18tEEqikRyHV H/Mvm4oZxMZSepKmIELW4eGxmMtnsnn8pZkx0J7/3bENbzCEVD2P+D4R19fW9Dpl/kZO7e FMpzzRziZkBZmFWxI+lk3mne0tywSyz3snA//QfOJ89MRRRVn/lmRC7U+dCkal//WlDAip qJvaYzEiQ3nz1JGTxaqapAJOGfb7gU/IEsQO+Xh1d0dI6uh9lKm7E3h8sKfBJse2wC3aHP 3i/J3di53kVZVJ/MFJUheSFU3fPuDSgwpPIEAWNsnWbXwS5h0jSRtr3uEJK3Ng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSrcx0K61zd6F; Sat, 27 May 2023 05:56: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 34R5u0Rq078467; Sat, 27 May 2023 05:56:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34R5u08A078466; Sat, 27 May 2023 05:56:00 GMT (envelope-from git) Date: Sat, 27 May 2023 05:56:00 GMT Message-Id: <202305270556.34R5u08A078466@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: 49943856eb27 - main - Do not try to adjust a directory depth when its reconnection is declined. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 49943856eb2710c6a6debdfa40d89d31d3fdb8ea Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=49943856eb2710c6a6debdfa40d89d31d3fdb8ea commit 49943856eb2710c6a6debdfa40d89d31d3fdb8ea Author: Kirk McKusick AuthorDate: 2023-05-27 05:55:11 +0000 Commit: Kirk McKusick CommitDate: 2023-05-27 05:55:11 +0000 Do not try to adjust a directory depth when its reconnection is declined. MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sbin/fsck_ffs/pass3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/fsck_ffs/pass3.c b/sbin/fsck_ffs/pass3.c index b9d24f18371b..49cb43620392 100644 --- a/sbin/fsck_ffs/pass3.c +++ b/sbin/fsck_ffs/pass3.c @@ -100,10 +100,10 @@ pass3(void) if (linkup(orphan, inp->i_dotdot, NULL)) { inp->i_parent = inp->i_dotdot = lfdir; inoinfo(lfdir)->ino_linkcnt--; + inoinfo(orphan)->ino_state = DFOUND; + check_dirdepth(inp); + propagate(); } - inoinfo(orphan)->ino_state = DFOUND; - check_dirdepth(inp); - propagate(); continue; } pfatal("ORPHANED DIRECTORY LOOP DETECTED I=%lu", From nobody Sat May 27 07:11:41 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QStJF461jz4WdPq; Sat, 27 May 2023 07:11: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 4QStJF3bsMz59L0; Sat, 27 May 2023 07:11:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685171501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fW4QdZVvu3GbVOGBDMoimiuzXLsZ0ZJyqFJ2/vkkXa8=; b=lBj0nqetukAufCAQ/lJi5WnHiwZZ1YFDyNTrXeQ7b1YMJyi2KUK04c5wIyiwxqaCX/XlEb COExL0BICvmOffAWS835G153E+kasidEyPjpy+f104s7r3hnPivhuHECJtbBy/YJzfAYUy zaa01NCp616+ILQA8XXzL9kyPXKFB2voUhepvvvR/QINJfyHhl7mnrdq+RKrB58N0zr14U JNUD8u0kbeqC/3ZVi3Bg9m09/6gdMbgJAxAIqFHpFajFTZXyoLciFLDLNLpl/XcL0HxQKc EUQqbOzfYxMKkxWegS/3P2H5YABtgFOWpFu62yW/YMfxuODGBEj+6celq7aPNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685171501; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fW4QdZVvu3GbVOGBDMoimiuzXLsZ0ZJyqFJ2/vkkXa8=; b=rREzJOTFBJNBQam5QYsIBWItfZCCHA7jVChPSaE1n+E1ND+gwCLokk86HNK0VvBe9jc7lc G8Vfs1k63YgOofZy71D/eS0VQl3AgH/vrFWfGIs/Xze7xi/1YtyqoUtvwItoc4+kom5P3I s5L05HGO8IzYaVIrBWyJUZThQ7UXvi2PK6i6BTimPeAQX0Cmj2UxFYR/bond6oJwJgtKiB f5rtbo64k/oBlEKRcqriCmwy5oEfnuZsLNoIRkoVUK+1YQ8Yvqvoy0D/c0g9fmH6HS/wIE NgbWDjE9SJ1ISlUxROkj4J87w3JHwsPNcJCJ4iMuOwL3MjpuqSedqvzjzknP6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685171501; a=rsa-sha256; cv=none; b=XRKsrDE50agoAMw/ESS+BtWz35SXJBbg63LqVHmwg/eWMUfXLaV4Vr/8kFDUaHTICEyil2 g7DlONSk0z/hJ15827draJX7yIWj1NZ5vRVz9FLM1oYFjAWD7h8m+/koMM9hck7zDeK+CB fhZxG5PX6fiaF7DSHynZ+wPu0k17j8/dZ3CLBtJtWmAfEewNsfWA4XnLwfjEfLLKsZdTyp nXgGurknmAl6McGT8T1SHw6ThPpj1/a3jzf+Gpyc12td2GIw6JbfqoqrY4BcNtJmw5BH6g aNuymuRM2tuQwAAA67aiwDuo3DLiDoOlOkM2m1zIzFpqvwsr5vPteP8gJ5B2aA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QStJF2j8fzg0K; Sat, 27 May 2023 07:11: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 34R7BfZ3006849; Sat, 27 May 2023 07:11:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34R7BfJn006848; Sat, 27 May 2023 07:11:41 GMT (envelope-from git) Date: Sat, 27 May 2023 07:11:41 GMT Message-Id: <202305270711.34R7BfJn006848@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: 5d1ee799de65 - main - arm64 pmap: Eliminate an unused global variable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5d1ee799de65ca62cd94c1602b41255bdbc3312d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=5d1ee799de65ca62cd94c1602b41255bdbc3312d commit 5d1ee799de65ca62cd94c1602b41255bdbc3312d Author: Alan Cox AuthorDate: 2023-05-27 06:23:48 +0000 Commit: Alan Cox CommitDate: 2023-05-27 06:38:20 +0000 arm64 pmap: Eliminate an unused global variable The global variable "pmap_last_pa" was copied from the amd64 pmap as a part of commit c15085278cb5 "arm64 pmap: implement per-superpage locks" but it is neither used nor needed by the arm64 pmap. --- sys/arm64/arm64/pmap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 16e671295ca6..6bc9adba71e0 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -341,7 +341,6 @@ struct pv_chunks_list __exclusive_cache_line pv_chunks[PMAP_MEMDOM]; __exclusive_cache_line static struct pmap_large_md_page pv_dummy_large; #define pv_dummy pv_dummy_large.pv_page __read_mostly static struct pmap_large_md_page *pv_table; -__read_mostly vm_paddr_t pmap_last_pa; vm_paddr_t dmap_phys_base; /* The start of the dmap region */ vm_paddr_t dmap_phys_max; /* The limit of the dmap region */ From nobody Sat May 27 08:35:10 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSw8b270Nz4Wk8F; Sat, 27 May 2023 08:35: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 4QSw8b0HDXz3M2f; Sat, 27 May 2023 08:35:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685176511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rFepOBO7l+oKUG/+EDt6oYTUJS2vYpLqSkAtdDVKgac=; b=vzUePYBi/NePklw7ptSXp9kyU64Ex+33b3tm1oRx7bE1XeCbxWc0QMIkAZtwa2zCWjcQ8F ihIn90fA2yjSC6cHlNqkyp5TMJ3ZzhHAS/SHuQI2DfljoX6HrxUd9N/Fpsa7/4cNlrwXG8 u0RTT792sSo1cpiW04G1rUc9hyjzvo1UXfwJVEcgYTp2T9Zx0CiDF8oZh+SIYlb0dkw36m olSqRCbBuojY0VNwXpap22pw2sVK3ffIbTywmsAtMhTIFjyC8zMEM3tD/yVnnRuANu4pDD eHAHJp+fEbbYcOUzwCaFbxuAs6+QAHrPDO/SmyWlWRLRz4XeTA0R/8dbmtnC1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685176511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rFepOBO7l+oKUG/+EDt6oYTUJS2vYpLqSkAtdDVKgac=; b=SrY7iUR4Hm8xbiBRqBX/Zoe79E+t7UInZ6FVZ4gsn+3K2WM0JnCBO/a1nJN9/6BtIvHxf4 hx33JvEf+HmlGhNzoZQliGK84HaLIY1LmEWM93X2i2gzEIrPOUTPJfynheWpzyUwMO3OYd zvG4Jno0aag4hNG05e/keRVgGYIEZ+hu8TNcHrj58ZVR+rANc8PupjRNXerL+jMqFiA6CC GFqXaY/Cy5vOJ8I+zEmVSxxPJyYjlbWaQW+310yukc9TObZZgB+tx17dldsySo0QODn4Qv V/J6yp4bdN76mpM+SgxHZrxZweIJV6DWZubsiKwFJj01h6tzxwfqWRXpEtneqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685176511; a=rsa-sha256; cv=none; b=BtKQeIA0AYHFZq3R580kveU460nAW8T52h5h+ExsUASpPowRX3InNzY0nvL2rVuCuSS4t/ goyIvKuu37eIKvw/wvcEsTPAosXwMmU2AlBJDzd8ZhGahMlSKFy76TxkqWqWwCCyIX/b3s mB2dFPH7RCRi+qW10DTZUviP17mgd4d6asAH5sLvpfvUbGymVvQJjWOIW1jMW5eSOSTtKD p7B8EBC7SDQCC+pmfpKg0SxF2nHtb5HS01s9RYkH7+i3fKtu6Q6TdzppgVMWGY1OrYaYrk RJueVS0nzP4aSmtMufS/YhG9rfiEL43BEUk9SZUWQhbYexDlLIHBvWnl6CL5hA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSw8Z6P0zzhww; Sat, 27 May 2023 08:35: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 34R8ZANu041897; Sat, 27 May 2023 08:35:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34R8ZA3g041896; Sat, 27 May 2023 08:35:10 GMT (envelope-from git) Date: Sat, 27 May 2023 08:35:10 GMT Message-Id: <202305270835.34R8ZA3g041896@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: acfb06062a68 - main - stress2: Fix warnings List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: acfb06062a6862f7c823242243e68f7bcaf29999 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=acfb06062a6862f7c823242243e68f7bcaf29999 commit acfb06062a6862f7c823242243e68f7bcaf29999 Author: Peter Holm AuthorDate: 2023-05-27 08:31:00 +0000 Commit: Peter Holm CommitDate: 2023-05-27 08:31:00 +0000 stress2: Fix warnings --- tools/test/stress2/misc/reaper2.sh | 2 +- tools/test/stress2/misc/reaper3.sh | 2 +- tools/test/stress2/misc/reaper4.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/test/stress2/misc/reaper2.sh b/tools/test/stress2/misc/reaper2.sh index 4a0a9296aca1..1643e9985240 100755 --- a/tools/test/stress2/misc/reaper2.sh +++ b/tools/test/stress2/misc/reaper2.sh @@ -65,7 +65,7 @@ test(void) { struct procctl_reaper_kill killemall; pid_t pid; time_t start; - int data[20], e, n, m; + int data[20], e, n __unused, m; n = m = 0; if (procctl(P_PID, getpid(), PROC_REAP_ACQUIRE, NULL) == -1) diff --git a/tools/test/stress2/misc/reaper3.sh b/tools/test/stress2/misc/reaper3.sh index 5faf2f6b4e88..90bb395da5c1 100755 --- a/tools/test/stress2/misc/reaper3.sh +++ b/tools/test/stress2/misc/reaper3.sh @@ -86,7 +86,7 @@ test(void) { struct procctl_reaper_kill killemall; pid_t pid; time_t start; - int data[20], e, n, m; + int data[20], e, n __unused, m; n = m = 0; if (procctl(P_PID, getpid(), PROC_REAP_ACQUIRE, NULL) == -1) diff --git a/tools/test/stress2/misc/reaper4.sh b/tools/test/stress2/misc/reaper4.sh index c78b9705e3c4..bd30bd1b0efd 100755 --- a/tools/test/stress2/misc/reaper4.sh +++ b/tools/test/stress2/misc/reaper4.sh @@ -85,7 +85,7 @@ test(void) { struct procctl_reaper_kill killemall; pid_t pid; time_t start; - int data[20], e, n, m; + int data[20], e, n __unused, m; n = m = 0; if (procctl(P_PID, getpid(), PROC_REAP_ACQUIRE, NULL) == -1) From nobody Sat May 27 08:35:11 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSw8c1RPyz4Wjmx; Sat, 27 May 2023 08:35: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 4QSw8c0r05z3M2C; Sat, 27 May 2023 08:35:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685176512; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oed3aYTf2jf+rVLeHSEU41KrS+VrLTp39IevE+q/DwM=; b=VuUAYyADTX7/Jqms45rOsF8lbbMv4VNFJXjsWzQDb1jthJuNAbtSMUsMFrXvbQO4XToSf0 mJQyMHdZhROuqqGU1vJMEpDTK3/kW5Xew+XOneHu1b5wffZslD+1tPPV1lK4OqkkaFAVEX m5pgV1wOfWjXTYlb6wXHRBgwDXmA514bW+p9/SnXYyg9Ps3s6FCrNrMXpaJ5sG+m/g+YYB pIfdYGvM7WsZon4dwlxsJcYDVX20pL80m7loTBNiyKs4NTat9Dy7+oSmf9Cw/oYwE6533D wMJ217WLxJ9Lb8h2lX1fqpmE7XsF6NoanaHtYbWi8ecbfuh928BCqDW9LLgF6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685176512; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oed3aYTf2jf+rVLeHSEU41KrS+VrLTp39IevE+q/DwM=; b=m5mlzlpGoQmfGm0DC9F8O1IHia9k4ES/dyawCnnRu3lwxsGBU2YzS9RKJ4CxOiBaj21gZw HXiDC9Ve0cON1+GVoVv96q61/K6xUFQj9rF7aOi7JoaRNz1Uy9Pwzy+TMK+ZQmsdIVf7nP kyQDey3zYuWgx5o8nUeFPPFJG7jcN6D48fduhp7C/ja/jzn4U4MybHYnLA47H5aOGa3Ftp I3ThofnxdslReiJayW1HJU/0DrMW8uSZEh+JFCw8y6q5gIdjwIhpNLnFM7Vbamo77Fu9G2 JsHjxHFGFngiXdnjFywbs379l8ATWURkniUs9hZ+eci+uFEvbEUkMg6Oz3yTEw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685176512; a=rsa-sha256; cv=none; b=iUk85GWNi+n8bWFvUlF1uR7tACaZZ2ecJjxzuCsUZw1pK+Hff1RNapZBSXfw544MilBb5u heB3G9sr5Mp/6duwAQmt+BxdBXhXjVk7gGP8JubWiwez39not4tfBKSsJrtACA//WoFcqR U/yEmpH59GD/uVfjK1YcD/fpoalGHDvYoaBLg4Ax/f2X8+meC/ST1xdwxAacEqfGwqp3TF uos2AyyZ2bmoZII1+tAr0y7KWGhLku4QLAqKL9/MnPc6OU+D4cN3F5jzgOG5Neld5LTlqY pc1WMaXyjt971vGzUVHYZBzvUcIwSV/Yd4cLg0sURgNt8/C6pBOeu3nBz//Afg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSw8b71s1zhj0; Sat, 27 May 2023 08:35: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 34R8ZBit041920; Sat, 27 May 2023 08:35:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34R8ZBgX041919; Sat, 27 May 2023 08:35:11 GMT (envelope-from git) Date: Sat, 27 May 2023 08:35:11 GMT Message-Id: <202305270835.34R8ZBgX041919@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: 273a89bb14f3 - main - stress2: Tune to get more slightly broken file systems List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 273a89bb14f37c17b1aefa5bc80e559bd785d0ed Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=273a89bb14f37c17b1aefa5bc80e559bd785d0ed commit 273a89bb14f37c17b1aefa5bc80e559bd785d0ed Author: Peter Holm AuthorDate: 2023-05-27 08:31:44 +0000 Commit: Peter Holm CommitDate: 2023-05-27 08:31:44 +0000 stress2: Tune to get more slightly broken file systems --- tools/test/stress2/tools/flip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/stress2/tools/flip.c b/tools/test/stress2/tools/flip.c index e1f12e97a79c..cdc2742de59f 100644 --- a/tools/test/stress2/tools/flip.c +++ b/tools/test/stress2/tools/flip.c @@ -131,7 +131,7 @@ main(int argc, char *argv[]) err(1, "lseek()"); if (read(fd, &c, 1) != 1) err(1, "read()"); - if (arc4random() % 100 < 80) + if (arc4random() % 100 < 98) flip(&c, 1); else trash(&c); From nobody Sat May 27 08:35:13 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSw8d2HqBz4Wk25; Sat, 27 May 2023 08:35: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 4QSw8d1jnmz3Lmf; Sat, 27 May 2023 08:35:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685176513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=msj0ExCkch+NzvlZ/PuhvTXTgYctJQ6p+j2YOV4BIYg=; b=bD/DZOxloefxuo6plgzrrHdpzFvqUjo3LV0YKDQfxYMrQ1SGtUFf1DdLNI0u/+Y+PP6/p3 gbZljmxM2syl7GBiGO/Tz7Z/mbYKC+PUEkZsNjDia5/QV4ZokYNEAqAomPTabL2t0jq1qC A6xWA1afwEc5gvYvfujjkzCSeLlbfwdJe1i22dNBMevVyfBTyk12J8J1m54+FpEVq7m3z9 6mnBOpe+Nwo7QesOkn6Lo8EDgDhmUON+oy4XObeqh3M11nf6uAFCUP6cEQ45nJ5REtPRuA xQ3L1LGDjmtg9z7WsK8Ik/tuoHCBcWMZrYi3cVxKSJeQ36dMG2MN5FD/gTgJxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685176513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=msj0ExCkch+NzvlZ/PuhvTXTgYctJQ6p+j2YOV4BIYg=; b=rs7UuheKmpH1D1SSi10JngjgViyWJ1vkRXaoPKWH6srC15sgXUNcWCJRwJou4Pz/4WP9xu 4RSg8YCGUlwjeEJ04YDGgntnzlqwvpYygrEKlNDNCu+kJZSbL9le5BRGGLjVUzFc3Bt3A/ tMEbydiJ2T+Ryjm8yWJHYcw4El/2v+lZO3+fE6dBY6qoVqtOJlgdxacam74t37jOPUkaY+ cJ4Ot6th0iwnvPsPgqXMFKP+etQoQAZv/jgnC7tTI/Zc1BuAp4tUhHXxxHJMO6hOjzi4kC EEJ6aqR3cldlHfFdJkse9YXAlCEJ5pPj74lr4qGhsDDEiK12KwCOlZyZO0dVXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685176513; a=rsa-sha256; cv=none; b=AyOcP808rcFdTTsi42kvM0uaoUeNV7F0Rjvq1a8I7/++9iVLBG6yxmwUM6ErcVI5SFuO/5 JbYNEV79C5WNVYiNA6EfTtxluqIuHDGLSL1cfiiqcmYZzRDqDFiV8T+IZfiLsjb6rLNXmJ rdqY4zBHUJ41iNTNNf+6k2iPYOCbisdQbMQVrsdngX4KmquV2OhltC8hpzCE2zMRYI2nG6 A+zGh2XGovTjW/yW9PFc9HRk520e0PZB7SPFF9frvWIA0oYqj1qYjX7rtEgaeSgA6m1JbY QGPcEUr4Ax2QUWj/FOsPWESS1ZqjJfWwCVKW2l90spCDOYCup1EnV7C1vLG3/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 4QSw8d0pnBzhlY; Sat, 27 May 2023 08:35: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 34R8ZDAF041943; Sat, 27 May 2023 08:35:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34R8ZDDu041942; Sat, 27 May 2023 08:35:13 GMT (envelope-from git) Date: Sat, 27 May 2023 08:35:13 GMT Message-Id: <202305270835.34R8ZDDu041942@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: 750ae32b9e60 - main - stress2: Initialize variable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 750ae32b9e601cc0091ca0c1c67bfcc21428ade2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=750ae32b9e601cc0091ca0c1c67bfcc21428ade2 commit 750ae32b9e601cc0091ca0c1c67bfcc21428ade2 Author: Peter Holm AuthorDate: 2023-05-27 08:34:48 +0000 Commit: Peter Holm CommitDate: 2023-05-27 08:34:48 +0000 stress2: Initialize variable --- tools/test/stress2/default.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/test/stress2/default.cfg b/tools/test/stress2/default.cfg index f7748b55fa04..bff7f3f168a9 100644 --- a/tools/test/stress2/default.cfg +++ b/tools/test/stress2/default.cfg @@ -88,6 +88,7 @@ checkfs () { # BMODE=1 ./all.sh -on `grep -lw mycc *.sh` # BMODE=2 STRESS2BIN=/home/pho/stress2/bin.i386.r276368 ./all.sh +BMODE=${BMODE:-0} CC=${CC:-cc} top=`dirname $(pwd)` # cwd for the all.sh script STRESS2BIN=${STRESS2BIN:-$top/bin} From nobody Sat May 27 10:44:21 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSz1d6bXnz4Wrmm; Sat, 27 May 2023 10:44: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 4QSz1d5frdz3rMr; Sat, 27 May 2023 10:44:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685184261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lpAj2GIHiBEqNcrKlVd/cQvLowNvu+a20dZd0x9Xi1k=; b=tfLB+vnyezSgpRSQKLrw20+6lKkyW8q+t6Rik4RwINReJ8HhkJu6X7fWIlnTupT1Y4VA7o VR/hpwSYggRjGEbS/hSTStIf2/q3LHKLrWU7IGA1b7v4odY5l480zdMeOdi8E5m0MOJ8i9 Q4Supoq94OrFhw57BX9ptaL9n9wXCyNrtXco0d9oeol7MOPjgHCIA++iVDQqykrjZ/p1LJ 0s6yjQEx+nIV9J/vVPOKLdZAa+7+/ceqw7OU/fUz0GBv81/ctznMORVhztP11wScWZ3peN AwyfnCzHbLkxxcL0+XHq9QWdbGbY4d4k6ZuQR0Gvmc/gsKHu+8/aBzhRfAau1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685184261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lpAj2GIHiBEqNcrKlVd/cQvLowNvu+a20dZd0x9Xi1k=; b=BNWRLC//5Pfm+8R0JMRb8VLbvvFnIrTxfCrBNBbz+700hJEOePiv5Htwc2NPbjust6i3A0 UBRzDs3mWaON4CpI4I4Sfc6Hdvp/xoXBvewH7Mw+EBtrQFs3gYw0C5BeaW7nD9RzifwGq+ zVKQ0++tPOseCfqPI4RooIeQpYgT41McEuqDuQ73b6w42mabIy7V4pAfIQyk2Dw4uLbM4/ TKP+PkHB3q2iuSpFifaQCBpqMnLUMtmqHphKGketuxgEJU6FsWOpBMj+PgKVuZpawZLVFL ok4PgMKdaZDHAF2bVzYDDQAHSn+xofuJk5hzPl+xUh8qA80/cAdsP1zHBLQT4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685184261; a=rsa-sha256; cv=none; b=nbI7kJG1O6iP1ljOKK+KIgBYfYqGgKLxM+UMpkCuYPxo0sNICNp4SEf/DyfYCfM1TfUGP4 rX4SFiSYsatWiUB4dVmUqdrLG+Ng/gJEdCcIucoIGQKOLnpPYiuLemQGbpX+E4N6GLOxRs qRQ4XWxS6MNw3Aq2gFq2kyIJH7ERQdjgeJ8ZRC1lKhPqTQ6E8P6FHKXh7mwZSVJ58d2pW+ /YJ84gzdD6Phg+xbwV1mai1fdyM9v3naC/jYyM5VbnTCkKX9wFmLHHyC6qtX3IHnMOuJaq ToftdQAnIgEosYyjy/S8NNx+vObSPf/9MciVi9mJtV3NJnjaIHBPXWgd5gBoqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSz1d4gv7zlrh; Sat, 27 May 2023 10:44: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 34RAiL86057015; Sat, 27 May 2023 10:44:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34RAiLLC057014; Sat, 27 May 2023 10:44:21 GMT (envelope-from git) Date: Sat, 27 May 2023 10:44:21 GMT Message-Id: <202305271044.34RAiLLC057014@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: dfc15e761b84 - main - netlink: call IPv6 hook after the ifaddr operation when ifp is brought up. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dfc15e761b84c6dcaee68a18e8077058479c928f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=dfc15e761b84c6dcaee68a18e8077058479c928f commit dfc15e761b84c6dcaee68a18e8077058479c928f Author: Alexander V. Chernikov AuthorDate: 2023-05-27 10:38:32 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-05-27 10:38:32 +0000 netlink: call IPv6 hook after the ifaddr operation when ifp is brought up. This change fixes the case when the first address added to the interface is IPv6 GU address. Before the change, IPv6 LL addition was not triggered. PR: 271661 MFC after: 2 weeks --- sys/netlink/route/iface.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/netlink/route/iface.c b/sys/netlink/route/iface.c index 920c473490ab..e7a66a3d32fc 100644 --- a/sys/netlink/route/iface.c +++ b/sys/netlink/route/iface.c @@ -1155,12 +1155,7 @@ handle_newaddr_inet(struct nlmsghdr *hdr, struct nl_parsed_ifa *attrs, if (attrs->ifa_dst != NULL) req.ifra_dstaddr = *((struct sockaddr_in *)attrs->ifa_dst); - int error = in_control(NULL, SIOCAIFADDR, &req, ifp, curthread); -#ifdef INET6 - if (error == 0 && !(if_flags & IFF_UP) && (if_getflags(ifp) & IFF_UP)) - in6_if_up(ifp); -#endif - return (error); + return (in_control(NULL, SIOCAIFADDR, &req, ifp, curthread)); } static int @@ -1262,6 +1257,7 @@ rtnl_handle_addr(struct nlmsghdr *hdr, struct nlpcb *nlp, struct nl_pstate *npt) attrs.ifa_index); return (ENOENT); } + int if_flags = if_getflags(ifp); #if defined(INET) || defined(INET6) bool new = hdr->nlmsg_type == NL_RTM_NEWADDR; @@ -1294,6 +1290,11 @@ rtnl_handle_addr(struct nlmsghdr *hdr, struct nlpcb *nlp, struct nl_pstate *npt) error = EAFNOSUPPORT; } +#ifdef INET6 + if (error == 0 && !(if_flags & IFF_UP) && (if_getflags(ifp) & IFF_UP)) + in6_if_up(ifp); +#endif + if_rele(ifp); return (error); From nobody Sat May 27 10:46:36 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSz4D333gz4Ws6P; Sat, 27 May 2023 10:46: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 4QSz4D2bbQz3rvM; Sat, 27 May 2023 10:46:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685184396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iVlWLqccr0cmW/Z/eHoA7u3YN/Byu8XOUZF3b0BdUco=; b=XwkPZR3wz8j7aeM7a8SYZPsxq4wwklgjjjk6cmAzeWa/V0LSE7AtdqFsBT19vTbQvOe3dK jneGJrAYeQCuRpShfeO4ulg1rJQyjVj2FIB2/yZ4mOI7iRWkX12XN9XLQdK4+EVJLnFuk2 UlgvPsaaZSO4opgMnMO7Iltq29sn8Kkp6+8ZcqivTxKnPwrt4AJHuOk/tRt3UTszh0pXgo +u4tuRn+zTYXBB6wQ/BD5JJ4POlxjUmCwHld/LNk5BEli7vhFxm3AXznsukjqfI+qLn7ye 5sGaUQDLrVYL3rDfcgbDgauUjAvGIBQw2pu76JCJwSMwh3FzLVFInzj4nXaAww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685184396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iVlWLqccr0cmW/Z/eHoA7u3YN/Byu8XOUZF3b0BdUco=; b=ZWl9BfgoQaKGkQBa8V+WyFAYhOT6qgRcEEaSTqNgAXcoevItbAnq9/MjCnEQ38xYYPrMxD LclnjS07kc13DtAmiFIJK+KTjWCkFqHuAeYsxCRTg4R/av9R+xC5UcmPHAjjrGvqm/v5do DZ2DSQq2xPLgY8OY8QNJez3K6vd+8FSTwqwGUg7p169VpgBIsmJ2vrCcAnt4lfB3X5oRoS K9XoyWHnKcfvyfFsrpZt/OMoEoRal5iUVdo7AFmCNDgQ4xxjXbFpGO9lrRMAUKUvWlDEzB wkIWyHsunFWzK+m/S73RJWgocrTNAfmS1c9jzwMfcqNRvVjo2y3BesX99TuPtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685184396; a=rsa-sha256; cv=none; b=tMgMUBezdnKFJejCROGAetPHEk4L3fraQFATER0Z4Z1JcWj4jst05zsxcy5eKy7xvIdHTe 6NWoBjV/njvIiuvqOzOJJv6m/3fAZ2TSeS+ecEKThkzh0MA3+WvHpfpxgNLeOQv1Qi+Zbz hSqb8dnn8Ph/EeB7nodPrbLQwLH+JLx6ttVqlLu9lJGjvhNfcmTsz4NXUZmuY8sIP1uYTj lT05FVDzoiqHdOpFO0aqEySCTIi0w9+SoFtl+2f6jnrv0bNf8PxXdiZDALLkDfD26W9gkQ EfJC8Al7J/cswfStzPG2SZsBHv2ELySQusoOiMCXZUtTIVAgNV4RLlTi/0DL5w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSz4D1YZZzlcM; Sat, 27 May 2023 10:46: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 34RAkaAs057456; Sat, 27 May 2023 10:46:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34RAkaab057455; Sat, 27 May 2023 10:46:36 GMT (envelope-from git) Date: Sat, 27 May 2023 10:46:36 GMT Message-Id: <202305271046.34RAkaab057455@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 99ea21744b9f - main - netlink: fix bulding with NOINET6 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 99ea21744b9ff306cf870be6f8899c66352e185f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=99ea21744b9ff306cf870be6f8899c66352e185f commit 99ea21744b9ff306cf870be6f8899c66352e185f Author: Alexander V. Chernikov AuthorDate: 2023-05-27 10:46:25 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-05-27 10:46:25 +0000 netlink: fix bulding with NOINET6 --- sys/netlink/route/iface.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netlink/route/iface.c b/sys/netlink/route/iface.c index e7a66a3d32fc..e40d7097ca61 100644 --- a/sys/netlink/route/iface.c +++ b/sys/netlink/route/iface.c @@ -1257,7 +1257,9 @@ rtnl_handle_addr(struct nlmsghdr *hdr, struct nlpcb *nlp, struct nl_pstate *npt) attrs.ifa_index); return (ENOENT); } +#ifdef INET6 int if_flags = if_getflags(ifp); +#endif #if defined(INET) || defined(INET6) bool new = hdr->nlmsg_type == NL_RTM_NEWADDR; From nobody Sat May 27 11:14:13 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSzh620vbz4WtbJ; Sat, 27 May 2023 11:14: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 4QSzh61Yv4z3vRc; Sat, 27 May 2023 11:14:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685186054; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XTbs8uABdZjBbNBj2X3lk4w/1aSXt4y0WWInutg1/vw=; b=Kys/KTayNw04bGA+8vQr3+ph2Qjku5pOTkqFJkaAAEMs43OFx9sMTteXgioQIS/8RqEr0u SKUfbr96s5QwPBCvVjk+MR9H/ze4nCUYg+HIuDc7C87HzCU0BguuMOGU1fUhgoz5c+vuHp 6CPswmg3Vq0lC7BCc4Nq/6uWnDLKYC16dOMCYx8CDjPGYkSa63wUXnZpkl7WLLYCVf0gUD 6yOVdkf2iL6+V3ZMoSIjTjfHAyYJJ44wCgY35+adZEreLo/djQ21vatuk3XB8UuD+Ky2UE VR/cTdP3nSDVxG6DVVlnA3N49joynPlXaxpBKzUn8StcBk+iG54cyfRqxwzlsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685186054; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XTbs8uABdZjBbNBj2X3lk4w/1aSXt4y0WWInutg1/vw=; b=kbngg8MZi2bv7rn/OowJHVNYmVf6LXhYY3TjNJDMns/hhRYB2uFGuXZQAiLDSG2oivhFBk 5ZUffLpMrdXU2W/JdvTLwpp2dXffD9GAINHfYFL2wBCI2pc2vZS+x3ZlL+vOHF/87sdTa1 yCCRgaqMxcyi/NpU5D5xvHfFzE8hhTo2BC4K36nZoGI/CxeVe4YfUMV2bng0miMM1wvg6P N3ZsOq4UIlUQBf0e108tszQbfex5GKc/Am3LqVF/8aBCElLmitbRsep1KFfeAeUkNdqIPn oDiLpL4TQWIm9YM1VZb9Qlk5vIKKNDqPapqVQrhAE00SWlh8+uex3loQYkuGPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685186054; a=rsa-sha256; cv=none; b=RfCtgc/PmCtDVHqoKCNrfouhWyWAaWSRdfXVXaZ9/VNQMXGpDdhvYC+/Nl2S0ftQQNUBEO qZMLfULIdKiLiKo2nkbgQ/k/VjWxm3Sd6bqxLsgDE717WGa9LZRU2wtiCoddaudXTDffRO ZWEFh+l+MYpmaGwh/GuLvtY1t51BLJRa2Hu8cNkiujYrlI+/CQmGkzhsPhWErRh6etKc25 6aMl77bv7wCPFv1PDFdnm+HQnWUMzT+JaDgNPdUIA/fI1AEBFRjxuvDiA/NWvrnC6jswy1 TV7IHb0vZ2zUoGlWCCFr3W3JboR2wHb75q+bPUfmMcnuCPUuDKlW1o4WAlZkSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSzh60dF5zmbL; Sat, 27 May 2023 11:14: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 34RBED9t007213; Sat, 27 May 2023 11:14:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34RBED8O007212; Sat, 27 May 2023 11:14:13 GMT (envelope-from git) Date: Sat, 27 May 2023 11:14:13 GMT Message-Id: <202305271114.34RBED8O007212@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 5f19f790b392 - main - netlink: add snl(3) support for parsing unknown-size arrays List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f19f790b3923354871ce049b84c7807ecb0cad5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=5f19f790b3923354871ce049b84c7807ecb0cad5 commit 5f19f790b3923354871ce049b84c7807ecb0cad5 Author: Alexander V. Chernikov AuthorDate: 2023-05-27 11:09:01 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-05-27 11:13:14 +0000 netlink: add snl(3) support for parsing unknown-size arrays Reviewed by: bapt Differential Review: https://reviews.freebsd.org/D40282 MFC after: 2 weeks --- sys/netlink/netlink_snl.h | 122 ++++++++++++++++++++++++++------ sys/netlink/netlink_snl_route_parsers.h | 19 +++-- 2 files changed, 116 insertions(+), 25 deletions(-) diff --git a/sys/netlink/netlink_snl.h b/sys/netlink/netlink_snl.h index 5844994b5e47..6d97c1afd4ee 100644 --- a/sys/netlink/netlink_snl.h +++ b/sys/netlink/netlink_snl.h @@ -149,33 +149,40 @@ struct snl_attr_parser { typedef bool snl_parse_post_f(struct snl_state *ss, void *target); struct snl_hdr_parser { - int hdr_off; /* aligned header size */ - int fp_size; - int np_size; + uint16_t in_hdr_size; /* Input header size */ + uint16_t out_size; /* Output structure size */ + uint16_t fp_size; /* Number of items in field parser */ + uint16_t np_size; /* Number of items in attribute parser */ const struct snl_field_parser *fp; /* array of header field parsers */ const struct snl_attr_parser *np; /* array of attribute parsers */ snl_parse_post_f *cb_post; /* post-parse callback */ }; -#define SNL_DECLARE_PARSER_EXT(_name, _t, _fp, _np, _cb) \ -static const struct snl_hdr_parser _name = { \ - .hdr_off = sizeof(_t), \ - .fp = &((_fp)[0]), \ - .np = &((_np)[0]), \ - .fp_size = NL_ARRAY_LEN(_fp), \ - .np_size = NL_ARRAY_LEN(_np), \ - .cb_post = _cb, \ +#define SNL_DECLARE_PARSER_EXT(_name, _sz_h_in, _sz_out, _fp, _np, _cb) \ +static const struct snl_hdr_parser _name = { \ + .in_hdr_size = _sz_h_in, \ + .out_size = _sz_out, \ + .fp = &((_fp)[0]), \ + .np = &((_np)[0]), \ + .fp_size = NL_ARRAY_LEN(_fp), \ + .np_size = NL_ARRAY_LEN(_np), \ + .cb_post = _cb, \ } -#define SNL_DECLARE_PARSER(_name, _t, _fp, _np) \ - SNL_DECLARE_PARSER_EXT(_name, _t, _fp, _np, NULL) +#define SNL_DECLARE_PARSER(_name, _t, _fp, _np) \ + SNL_DECLARE_PARSER_EXT(_name, sizeof(_t), 0, _fp, _np, NULL) -#define SNL_DECLARE_ATTR_PARSER(_name, _np) \ -static const struct snl_hdr_parser _name = { \ - .np = &((_np)[0]), \ - .np_size = NL_ARRAY_LEN(_np), \ +#define SNL_DECLARE_ATTR_PARSER_EXT(_name, _sz_out, _np, _cb) \ +static const struct snl_hdr_parser _name = { \ + .out_size = _sz_out, \ + .np = &((_np)[0]), \ + .np_size = NL_ARRAY_LEN(_np), \ + .cb_post = _cb, \ } +#define SNL_DECLARE_ATTR_PARSER(_name, _np) \ + SNL_DECLARE_ATTR_PARSER_EXT(_name, 0, _np, NULL) + static inline void * snl_allocz(struct snl_state *ss, int len) @@ -471,11 +478,13 @@ static inline bool snl_parse_header(struct snl_state *ss, void *hdr, int len, const struct snl_hdr_parser *parser, void *target) { + struct nlattr *nla_head; + /* Extract fields first (if any) */ - snl_parse_fields(ss, hdr, parser->hdr_off, parser->fp, parser->fp_size, target); + snl_parse_fields(ss, hdr, parser->in_hdr_size, parser->fp, parser->fp_size, target); - struct nlattr *nla_head = (struct nlattr *)(void *)((char *)hdr + parser->hdr_off); - bool result = snl_parse_attrs_raw(ss, nla_head, len - parser->hdr_off, + nla_head = (struct nlattr *)(void *)((char *)hdr + parser->in_hdr_size); + bool result = snl_parse_attrs_raw(ss, nla_head, len - parser->in_hdr_size, parser->np, parser->np_size, target); if (result && parser->cb_post != NULL) @@ -642,6 +651,78 @@ snl_attr_get_nested(struct snl_state *ss, struct nlattr *nla, const void *arg, v return (snl_parse_header(ss, NLA_DATA(nla), NLA_DATA_LEN(nla), p, target)); } +struct snl_parray { + uint32_t count; + void **items; +}; + +static inline bool +snl_attr_get_parray_sz(struct snl_state *ss, struct nlattr *container_nla, + uint32_t start_size, const void *arg, void *target) +{ + const struct snl_hdr_parser *p = (const struct snl_hdr_parser *)arg; + struct snl_parray *array = target; + struct nlattr *nla; + uint32_t count = 0, size = start_size; + + if (p->out_size == 0) + return (false); + + array->items = snl_allocz(ss, size * sizeof(void *)); + if (array->items == NULL) + return (false); + + /* + * If the provided parser is an attribute parser, assume that each + * nla in the container nla is the container nla itself and parse + * the contents of this nla. + * Otherwise, run the parser on raw data, assuming the header of this + * data has u16 field with total size in the beginning. + */ + uint32_t data_off = 0; + + if (p->in_hdr_size == 0) + data_off = sizeof(struct nlattr); + + NLA_FOREACH(nla, NLA_DATA(container_nla), NLA_DATA_LEN(container_nla)) { + void *item = snl_allocz(ss, p->out_size); + + if (item == NULL) + return (false); + + void *data = (char *)(void *)nla + data_off; + int data_len = nla->nla_len - data_off; + + if (!(snl_parse_header(ss, data, data_len, p, item))) + return (false); + + if (count == size) { + uint32_t new_size = size * 2; + void **new_array = snl_allocz(ss, new_size *sizeof(void *)); + + memcpy(new_array, array->items, size * sizeof(void *)); + array->items = new_array; + size = new_size; + } + array->items[count++] = item; + } + array->count = count; + + return (true); +} + +/* + * Parses and stores the unknown-size array. + * Assumes each array item is a container and the NLAs in the container are parsable + * by the parser provided in @arg. + * Assumes @target is struct snl_parray + */ +static inline bool +snl_attr_get_parray(struct snl_state *ss, struct nlattr *nla, const void *arg, void *target) +{ + return (snl_attr_get_parray_sz(ss, nla, 8, arg, target)); +} + static inline bool snl_attr_get_nla(struct snl_state *ss __unused, struct nlattr *nla, const void *arg __unused, void *target) @@ -878,6 +959,7 @@ snl_realloc_msg_buffer(struct snl_writer *nw, size_t sz) memcpy(new_base, nw->base, nw->offset); if (nw->hdr != NULL) { int hdr_off = (char *)(nw->hdr) - nw->base; + nw->hdr = (struct nlmsghdr *)(void *)((char *)new_base + hdr_off); } nw->base = new_base; diff --git a/sys/netlink/netlink_snl_route_parsers.h b/sys/netlink/netlink_snl_route_parsers.h index c76e1cd6440a..0ab338cbe6e8 100644 --- a/sys/netlink/netlink_snl_route_parsers.h +++ b/sys/netlink/netlink_snl_route_parsers.h @@ -85,7 +85,9 @@ _cb_p_mp_nh(struct snl_state *ss __unused, void *_target) } #undef _IN #undef _OUT -SNL_DECLARE_PARSER_EXT(_mpath_nh_parser, struct rtnexthop, _fp_p_mp_nh, _nla_p_mp_nh, _cb_p_mp_nh); +SNL_DECLARE_PARSER_EXT(_mpath_nh_parser, sizeof(struct rtnexthop), + sizeof(struct rta_mpath_nh), _fp_p_mp_nh, _nla_p_mp_nh, + _cb_p_mp_nh); struct rta_mpath { int num_nhops; @@ -185,7 +187,9 @@ _cb_p_route(struct snl_state *ss __unused, void *_target) } #undef _IN #undef _OUT -SNL_DECLARE_PARSER_EXT(snl_rtm_route_parser, struct rtmsg, _fp_p_route, _nla_p_route, _cb_p_route); +SNL_DECLARE_PARSER_EXT(snl_rtm_route_parser, sizeof(struct rtmsg), + sizeof(struct snl_parsed_route), _fp_p_route, _nla_p_route, + _cb_p_route); /* RTM_LINK message parser */ struct snl_parsed_link { @@ -299,7 +303,9 @@ _cb_p_neigh(struct snl_state *ss __unused, void *_target) } #undef _IN #undef _OUT -SNL_DECLARE_PARSER_EXT(snl_rtm_neigh_parser, struct ndmsg, _fp_p_neigh_s, _nla_p_neigh_s, _cb_p_neigh); +SNL_DECLARE_PARSER_EXT(snl_rtm_neigh_parser, sizeof(struct ndmsg), + sizeof(struct snl_parsed_neigh), _fp_p_neigh_s, _nla_p_neigh_s, + _cb_p_neigh); struct snl_parsed_addr { uint8_t ifa_family; @@ -347,7 +353,9 @@ _cb_p_addr(struct snl_state *ss __unused, void *_target) } #undef _IN #undef _OUT -SNL_DECLARE_PARSER_EXT(snl_rtm_addr_parser, struct ifaddrmsg, _fp_p_addr_s, _nla_p_addr_s, _cb_p_addr); +SNL_DECLARE_PARSER_EXT(snl_rtm_addr_parser, sizeof(struct ifaddrmsg), + sizeof(struct snl_parsed_addr), _fp_p_addr_s, _nla_p_addr_s, + _cb_p_addr); struct snl_parsed_nhop { uint32_t nha_id; @@ -397,7 +405,8 @@ _cb_p_nh(struct snl_state *ss __unused, void *_target) } #undef _IN #undef _OUT -SNL_DECLARE_PARSER_EXT(snl_nhmsg_parser, struct nhmsg, _fp_p_nh, _nla_p_nh, _cb_p_nh); +SNL_DECLARE_PARSER_EXT(snl_nhmsg_parser, sizeof(struct nhmsg), + sizeof(struct snl_parsed_nhop), _fp_p_nh, _nla_p_nh, _cb_p_nh); static const struct snl_hdr_parser *snl_all_route_parsers[] = { &_metrics_mp_nh_parser, &_mpath_nh_parser, &_metrics_parser, &snl_rtm_route_parser, From nobody Sat May 27 11:14:15 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSzh73BXMz4WtWb; Sat, 27 May 2023 11:14: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 4QSzh72X3pz3vS2; Sat, 27 May 2023 11:14:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685186055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RjVZ6uJhqDPvh0Itjckv+d9YHJ9ZzY/T5R21wTl89Nw=; b=GOS6+5WpAP/vlFf6MFN2FXkWbisG34IbVmD9+vELuVf/vdRwgeS1ALXQjOrwgwtf/+/CJY BxRINyPcuLkFD1ahg1LGzRC4+oyQHDDlllQu6LuvjdE3/1P4t8t8u48Odabx/rARmRZugW 2fy+iVsn9t1S9eX7znrkwTFFS+/K6Wzb5LdzuvStZub1KS+iW+TEZKsMbIeBJY9+V8qC7x 4crzTeSE4ngHJoe05ZZHzclbFuVFWWrqGZg9b4n52srQe999BXISGdDp0eYQ8UtHUXAJet 2GZ+4TZOPMRJrYConUDt5rgX3z/k+bOwBzMYLB0TcWXJNFaIXfTuKTtzu+uPfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685186055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RjVZ6uJhqDPvh0Itjckv+d9YHJ9ZzY/T5R21wTl89Nw=; b=vsZ/o6fiJyspT+hTaaSadCMQjgL0cjwLNWujF08rSXxNC5FcZbIp356cjEPew4mBEp5w7y OmOlHqPkl9QWjUNl1OVD4ngatz24lqeVoGKzUmTD7VRP5rXqzY3tC1aJbILYZMRAD8X/OX bDwOgzil8HOvRHgImNeEong/6GpwKecgaSTVt5OvWJIN3eZJJVYnuA/nepaQ5oul3LUVcF q2mDnzjYWaLN3Y9QzuE4ZsQrj7MiPoLO6nYNgepY4tkS/loLeTWwzbzAoaHqadyTYfxufm 36gs52t4NiTTwLpvHICnyx84bGxy10fPrd4HJD3aZnHLxm91HDWsmIeF8h8IfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685186055; a=rsa-sha256; cv=none; b=mdQjOUC+D3ktNgwAP/S3RHLFP0ZKGHk1+VPVdPEoY7h/0RkkTkRlYfqhg9aewANIYgjdTY 75Hj0d9KSaTKulhxI+UUxmYsZ3iGoy6C/fLaVuPjTr2AyQOaaxf6ejyCutqejHmpgrS3+t /he4IB2HCeIbG18doHEroPVmp314gqtUjsM+fAhddr+o1ATniXRf/A/2OfEy5IimCicVTO +TJSO7IvaqdCVAm9hwDx+wQ8rrXk6tMykcOdD3GyOmDsviYXhv5Vp9OtX/ddmyNBGRKnkG fGSDYc5m7pp4W9k8RX9flUVBRvEE2CAwvPnuK1RGUc0JG2gA50j2I2MO6wbrhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSzh71YbBzmQ6; Sat, 27 May 2023 11:14: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 34RBEFHX007237; Sat, 27 May 2023 11:14:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34RBEF4Z007236; Sat, 27 May 2023 11:14:15 GMT (envelope-from git) Date: Sat, 27 May 2023 11:14:15 GMT Message-Id: <202305271114.34RBEF4Z007236@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 656a39c1a062 - main - netlink: use newly-added snl(3) array parsing for handling multipath routes. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 656a39c1a062411dca09d1566a7a0709c30f3bc7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=656a39c1a062411dca09d1566a7a0709c30f3bc7 commit 656a39c1a062411dca09d1566a7a0709c30f3bc7 Author: Alexander V. Chernikov AuthorDate: 2023-05-27 11:11:04 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-05-27 11:13:14 +0000 netlink: use newly-added snl(3) array parsing for handling multipath routes. MFC after: 2 weeks --- sbin/route/route_netlink.c | 12 +++++------ sys/netlink/netlink_snl_route_parsers.h | 37 +++++++-------------------------- usr.bin/netstat/route_netlink.c | 6 +++--- 3 files changed, 17 insertions(+), 38 deletions(-) diff --git a/sbin/route/route_netlink.c b/sbin/route/route_netlink.c index 01494fbefd51..0dbd90151e10 100644 --- a/sbin/route/route_netlink.c +++ b/sbin/route/route_netlink.c @@ -533,14 +533,14 @@ print_nlmsg_route(struct nl_helper *h, struct nlmsghdr *hdr, return; } - if (r.rta_multipath != NULL) { + if (r.rta_multipath.num_nhops != 0) { bool first = true; memset(buf, ' ', sizeof(buf)); buf[len] = '\0'; - for (int i = 0; i < r.rta_multipath->num_nhops; i++) { - struct rta_mpath_nh *nh = &r.rta_multipath->nhops[i]; + for (uint32_t i = 0; i < r.rta_multipath.num_nhops; i++) { + struct rta_mpath_nh *nh = r.rta_multipath.nhops[i]; if (!first) printf("%s", buf); @@ -834,9 +834,9 @@ flushroute_one(struct nl_helper *h, struct snl_parsed_route *r) print_nlmsg(h, hdr, &attrs); } else { - if (r->rta_multipath != NULL) { - for (int i = 0; i < r->rta_multipath->num_nhops; i++) { - struct rta_mpath_nh *nh = &r->rta_multipath->nhops[i]; + if (r->rta_multipath.num_nhops != 0) { + for (uint32_t i = 0; i < r->rta_multipath.num_nhops; i++) { + struct rta_mpath_nh *nh = r->rta_multipath.nhops[i]; print_flushed_route(r, nh->gw); } diff --git a/sys/netlink/netlink_snl_route_parsers.h b/sys/netlink/netlink_snl_route_parsers.h index 0ab338cbe6e8..a89462210133 100644 --- a/sys/netlink/netlink_snl_route_parsers.h +++ b/sys/netlink/netlink_snl_route_parsers.h @@ -90,48 +90,27 @@ SNL_DECLARE_PARSER_EXT(_mpath_nh_parser, sizeof(struct rtnexthop), _cb_p_mp_nh); struct rta_mpath { - int num_nhops; - struct rta_mpath_nh nhops[0]; + uint32_t num_nhops; + struct rta_mpath_nh **nhops; }; static bool -nlattr_get_multipath(struct snl_state *ss, struct nlattr *nla, const void *arg __unused, +nlattr_get_multipath(struct snl_state *ss, struct nlattr *nla, const void *arg, void *target) { - int data_len = nla->nla_len - sizeof(struct nlattr); - struct rtnexthop *rtnh; + uint32_t start_size = 4; - int max_nhops = data_len / sizeof(struct rtnexthop); - size_t sz = (max_nhops + 2) * sizeof(struct rta_mpath_nh); + while (start_size < NLA_DATA_LEN(nla) / sizeof(struct rtnexthop)) + start_size *= 2; - struct rta_mpath *mp = snl_allocz(ss, sz); - if (mp == NULL) - return (false); - mp->num_nhops = 0; - - for (rtnh = (struct rtnexthop *)(void *)(nla + 1); data_len > 0; ) { - struct rta_mpath_nh *mpnh = &mp->nhops[mp->num_nhops++]; - - if (!snl_parse_header(ss, rtnh, rtnh->rtnh_len, &_mpath_nh_parser, mpnh)) - return (false); - - int len = NL_ITEM_ALIGN(rtnh->rtnh_len); - data_len -= len; - rtnh = (struct rtnexthop *)(void *)((char *)rtnh + len); - } - if (data_len != 0 || mp->num_nhops == 0) { - return (false); - } - - *((struct rta_mpath **)target) = mp; - return (true); + return (snl_attr_get_parray_sz(ss, nla, start_size, &_mpath_nh_parser, target)); } struct snl_parsed_route { struct sockaddr *rta_dst; struct sockaddr *rta_gw; struct nlattr *rta_metrics; - struct rta_mpath *rta_multipath; + struct rta_mpath rta_multipath; uint32_t rta_expires; uint32_t rta_oif; uint32_t rta_expire; diff --git a/usr.bin/netstat/route_netlink.c b/usr.bin/netstat/route_netlink.c index 6e7e505c9619..3b1880fb9d90 100644 --- a/usr.bin/netstat/route_netlink.c +++ b/usr.bin/netstat/route_netlink.c @@ -237,11 +237,11 @@ p_rtentry_netlink(struct snl_state *ss, const char *name, struct nlmsghdr *hdr) if (rt.rtax_weight == 0) rt.rtax_weight = rt_default_weight; - if (rt.rta_multipath != NULL) { + if (rt.rta_multipath.num_nhops != 0) { uint32_t orig_rtflags = rt.rta_rtflags; uint32_t orig_mtu = rt.rtax_mtu; - for (int i = 0; i < rt.rta_multipath->num_nhops; i++) { - struct rta_mpath_nh *nhop = &rt.rta_multipath->nhops[i]; + for (uint32_t i = 0; i < rt.rta_multipath.num_nhops; i++) { + struct rta_mpath_nh *nhop = rt.rta_multipath.nhops[i]; rt.rta_gw = nhop->gw; rt.rta_oif = nhop->ifindex; From nobody Sat May 27 11:14:16 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QSzh84B5gz4Wslq; Sat, 27 May 2023 11:14: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 4QSzh83jsrz3vSX; Sat, 27 May 2023 11:14:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685186056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P2W9DJCEJ3qBWJJGJeTzxrOSieiR76/4P1EJQOfEJYo=; b=A40+a/zAdDw8ftIlkYNtrWumrq+zIm8DlyHPeFIdGmR4PuelT0ZR78hMh8bTpPBJWSpGSf 7r0COs71UmNSkTkY1DQW+TIPmJvPqyadYcA31fo+OMGmlfoJQu4jOoo+7Bw0ns/pe1mO0d TYu59f/Ojo5ZyToZIqAQHTgQGnCYBZ1BpqMyhfX+EvaVFNUCH0yxnAZ7X36xw0j1HFRwzt J3BCPXu8n4TZGmOfya5PQWBPlRcnycpFCE/GCzMgksdJ0VZ3KrQsbIG7YVeDVGe5VoUU+2 gkB6wR83G6BdBo0FuKrUnHsNk+kUXStV2uTqJCIF0Ziur2qsVYtwctQ34D8bgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685186056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P2W9DJCEJ3qBWJJGJeTzxrOSieiR76/4P1EJQOfEJYo=; b=FkurHbv7/oCnFCEl8WrxOYpD2a/hOG4udaw9NluoGW4Q9cWnuBZUQpSPZDSw+MZaJjWBcf j7GbWpvtdSLZlMRXNPnI3sJlsZqA8rsDMswC+/RJ0Mzc0uMlaXtQOr5ZjmeMaR7tJP+gZ1 OlASKLe4yc7Mb13/vpmEJqiLyxGxBLsr1uD+tpmIiIMWr+sLO6ClZ9c6yE9RF4wGLCyZdh RgtRH1hfEbGDkz2U8Uwi77QpE51Cwi3SJ/P8903Oq38gIAP7oCaTXuhF3dweBegNesp5cy ebwtOtedtD8dNuvXFO7ANlpTTQRsr+CSXpQXvc6Hb4O+bgc+TcmBeyEcllpPNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685186056; a=rsa-sha256; cv=none; b=Ur5tXF7MmgT35pyQUr65wsNJI5X4uyyRHunKoYjxa6VXJVQPq1CbEMdOnYIzkdw/COFhZe kDVQ379yKdpVMUVzJ3mOcjjKSwcTnAo4BxwBtyzgG6pBHcNIiUh6UQmM8yH/Nw+Kn9C2CE ii2vxLtVCwrFARgcQkZ51zlqmGtdBtM8Ufp6qw3A6ui5os8ny8E+sOYRUnDnEi3igE4I1j 24J0mXnUiCQmsTtm5wHSR98NFmt8xZht+shaf1ZTXqLKJ/agNYE1/FSgvMj+La9vxoLt+K xegZajV5y2XD9QrcEUIgThQ9EXLFW2e+lnpaD0hMSUa9dL38e51OP+qvymbW7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QSzh82Tnvzmjk; Sat, 27 May 2023 11:14: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 34RBEG6M007256; Sat, 27 May 2023 11:14:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34RBEGoV007255; Sat, 27 May 2023 11:14:16 GMT (envelope-from git) Date: Sat, 27 May 2023 11:14:16 GMT Message-Id: <202305271114.34RBEGoV007255@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 7ee6b0f125a0 - main - netlink: add snl(3) support for listing genetlink multicast groups List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7ee6b0f125a092ed99d327bb8d608dd2ff77b7aa Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=7ee6b0f125a092ed99d327bb8d608dd2ff77b7aa commit 7ee6b0f125a092ed99d327bb8d608dd2ff77b7aa Author: Alexander V. Chernikov AuthorDate: 2023-05-27 11:12:04 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-05-27 11:13:14 +0000 netlink: add snl(3) support for listing genetlink multicast groups Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D40282 MFC after: 2 weeks --- sys/netlink/netlink_snl_generic.h | 55 ++++++++++++++++++++++++++++++------ tests/sys/netlink/test_snl_generic.c | 39 +++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 9 deletions(-) diff --git a/sys/netlink/netlink_snl_generic.h b/sys/netlink/netlink_snl_generic.h index 1a1e592aa54d..1324cf3da17a 100644 --- a/sys/netlink/netlink_snl_generic.h +++ b/sys/netlink/netlink_snl_generic.h @@ -52,9 +52,30 @@ static struct snl_field_parser snl_fp_genl[] = {}; #define SNL_DECLARE_GENL_PARSER(_name, _np) SNL_DECLARE_PARSER(_name,\ struct genlmsghdr, snl_fp_genl, _np) +struct snl_genl_ctrl_mcast_group { + uint32_t mcast_grp_id; + char *mcast_grp_name; +}; + +struct snl_genl_ctrl_mcast_groups { + uint32_t num_groups; + struct snl_genl_ctrl_mcast_group **groups; +}; + +#define _OUT(_field) offsetof(struct snl_genl_ctrl_mcast_group, _field) +static struct snl_attr_parser _nla_p_getmc[] = { + { .type = CTRL_ATTR_MCAST_GRP_NAME, .off = _OUT(mcast_grp_name), .cb = snl_attr_get_string }, + { .type = CTRL_ATTR_MCAST_GRP_ID, .off = _OUT(mcast_grp_id), .cb = snl_attr_get_uint32 }, +}; +#undef _OUT +SNL_DECLARE_ATTR_PARSER_EXT(_genl_ctrl_mc_parser, + sizeof(struct snl_genl_ctrl_mcast_group), + _nla_p_getmc, NULL); + struct _getfamily_attrs { uint16_t family_id; char *family_name; + struct snl_genl_ctrl_mcast_groups mcast_groups; }; #define _IN(_field) offsetof(struct genlmsghdr, _field) @@ -62,36 +83,52 @@ struct _getfamily_attrs { static struct snl_attr_parser _nla_p_getfam[] = { { .type = CTRL_ATTR_FAMILY_ID , .off = _OUT(family_id), .cb = snl_attr_get_uint16 }, { .type = CTRL_ATTR_FAMILY_NAME, .off = _OUT(family_name), .cb = snl_attr_get_string }, + { + .type = CTRL_ATTR_MCAST_GROUPS, + .off = _OUT(mcast_groups), + .cb = snl_attr_get_parray, + .arg = &_genl_ctrl_mc_parser, + }, }; #undef _IN #undef _OUT SNL_DECLARE_GENL_PARSER(_genl_ctrl_getfam_parser, _nla_p_getfam); -static inline uint16_t -snl_get_genl_family(struct snl_state *ss, const char *family_name) +static bool +snl_get_genl_family_info(struct snl_state *ss, const char *family_name, + struct _getfamily_attrs *attrs) { struct snl_writer nw; struct nlmsghdr *hdr; + memset(attrs, 0, sizeof(*attrs)); + snl_init_writer(ss, &nw); hdr = snl_create_genl_msg_request(&nw, GENL_ID_CTRL, CTRL_CMD_GETFAMILY); snl_add_msg_attr_string(&nw, CTRL_ATTR_FAMILY_NAME, family_name); if (snl_finalize_msg(&nw) == NULL || !snl_send_message(ss, hdr)) - return (0); + return (false); hdr = snl_read_reply(ss, hdr->nlmsg_seq); if (hdr != NULL && hdr->nlmsg_type != NLMSG_ERROR) { - struct _getfamily_attrs attrs = {}; - - if (snl_parse_nlmsg(ss, hdr, &_genl_ctrl_getfam_parser, &attrs)) - return (attrs.family_id); + if (snl_parse_nlmsg(ss, hdr, &_genl_ctrl_getfam_parser, attrs)) + return (true); } - return (0); + return (false); +} + +static inline uint16_t +snl_get_genl_family(struct snl_state *ss, const char *family_name) +{ + struct _getfamily_attrs attrs = {}; + + snl_get_genl_family_info(ss, family_name, &attrs); + return (attrs.family_id); } static const struct snl_hdr_parser *snl_all_genl_parsers[] = { - &_genl_ctrl_getfam_parser, + &_genl_ctrl_getfam_parser, &_genl_ctrl_mc_parser, }; #endif diff --git a/tests/sys/netlink/test_snl_generic.c b/tests/sys/netlink/test_snl_generic.c index c65d134f080d..f3c11daf19e1 100644 --- a/tests/sys/netlink/test_snl_generic.c +++ b/tests/sys/netlink/test_snl_generic.c @@ -66,11 +66,50 @@ ATF_TC_BODY(test_snl_get_genl_family_failure, tc) ATF_CHECK_EQ(snl_get_genl_family(&ss, "no-such-family"), 0); } +ATF_TC(test_snl_get_genl_family_groups); +ATF_TC_HEAD(test_snl_get_genl_family_groups, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests getting 'nlctrl' groups"); +} + +ATF_TC_BODY(test_snl_get_genl_family_groups, tc) +{ + struct snl_state ss; + struct snl_writer nw; + struct nlmsghdr *hdr; + + require_netlink(); + + if (!snl_init(&ss, NETLINK_GENERIC)) + atf_tc_fail("snl_init() failed"); + + snl_init_writer(&ss, &nw); + hdr = snl_create_genl_msg_request(&nw, GENL_ID_CTRL, CTRL_CMD_GETFAMILY); + snl_add_msg_attr_string(&nw, CTRL_ATTR_FAMILY_NAME, "nlctrl"); + snl_finalize_msg(&nw); + snl_send_message(&ss, hdr); + + hdr = snl_read_reply(&ss, hdr->nlmsg_seq); + ATF_CHECK(hdr != NULL); + ATF_CHECK(hdr->nlmsg_type != NLMSG_ERROR); + + struct _getfamily_attrs attrs = {}; + + ATF_CHECK(snl_parse_nlmsg(&ss, hdr, &_genl_ctrl_getfam_parser, &attrs)); + ATF_CHECK_EQ(attrs.mcast_groups.num_groups, 1); + + struct snl_genl_ctrl_mcast_group *group = attrs.mcast_groups.groups[0]; + + ATF_CHECK(group->mcast_grp_id > 0); + ATF_CHECK(!strcmp(group->mcast_grp_name, "notify")); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, snl_verify_genl_parsers); ATF_TP_ADD_TC(tp, test_snl_get_genl_family_success); ATF_TP_ADD_TC(tp, test_snl_get_genl_family_failure); + ATF_TP_ADD_TC(tp, test_snl_get_genl_family_groups); return (atf_no_error()); } From nobody Sat May 27 12:29:44 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QT1MD6cfmz4Cg7D; Sat, 27 May 2023 12: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 4QT1MD5qhyz46GQ; Sat, 27 May 2023 12: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=1685190584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2R6fSzX2XEF9ep6fSZn5cRPlJutBT2+uTBFLNu6B7Tg=; b=DY6cIdgIB35qUs4T1s4FYfiqrb1NGuPM6WW+O+8IwmUkh1bbxWOaC51smSjFznB4qUBjF3 lojp94t9lJG4FsdnJHmZB1mPvPSUce+uuet5tQRQdu2nSZsLkurlC7I+Ve3ndUcNmEtw0X 0PlDAK37RBHCTnn74JboHy7FbfRDyAHHlhQ889cvqCPd0zSXauEtOFckq0fGlwu8Kp1Z/Z Kt+7y7vMcqQCaZuMpdv88rEWqC+yQh5VbvUVwbEWEZHXFgLZ4+bgCuyiAMLsNmuoTGbq+3 1/9Hob/Zc+xEeKQCqPWRjmwPn3PLLNpXzpHk5NQPQHiVIDo1QdXs9kDBgIctPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685190584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2R6fSzX2XEF9ep6fSZn5cRPlJutBT2+uTBFLNu6B7Tg=; b=OmZE7vQSJgXXvOHvJ6xdO0+1ZB7hXMwRW+o5inntsmaPxzaArrivQT6gvPdMF7RBhCGUo4 Q1PW+TucFohSMUPYk9QPU7tsAnVq9z9uDtVJKUs/cNsBwA9o7BGKd8190g1hf9AEMRtDCE Vj7TCY/gxC9U/ceLLNa/OXdbB6ySk0ZUXIQa4dEZaWBo8Ba+qGxrfmV+RUSLFEz4NgWUJv 9WYs1ERGT9Indvd1Hii0eOPP4Yc92OB4EH6KpVvpkSC88GtxN3CHOnDknauyECGMy0EkeZ oWNxL+67HfNLjj4YcXusxgD7ejenEeX36/SFIDL1Jl/F1qbUxudMZXWxJmS1ow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685190584; a=rsa-sha256; cv=none; b=ngE0j3FyxiW+nQjgAQX6QjHeQZnXQ/kJMtQJXec3fVLwoZWBS1xPFoTc90TS4o3zPOTBlv 8/tFVvWgGVkIybVECQJvjBrszTf6dHZWmdN+4f8ZKzuuhKo6npKpivTAyuvy2ArI89pjrH /t34y2KzNfoQ9Pju0BveY8vNnuVRg9joPiCxsT82JwhevRwngDt33Br0XmltSvR9DwLSPn 4/cQLqQweAmFHuqgVkdrqCWApGxml1L0f0BncOcAIDUVNDNkuB6Ecvd8BaEccWYO+O9Ci7 reKOcPQ51qy43eygLN256O1yv2BV4nqQ60D+/SWG/HW69mWtltWqvwfjunMNSw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QT1MD4YWYzpPf; Sat, 27 May 2023 12: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 34RCTiMN022864; Sat, 27 May 2023 12: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 34RCTiul022863; Sat, 27 May 2023 12:29:44 GMT (envelope-from git) Date: Sat, 27 May 2023 12:29:44 GMT Message-Id: <202305271229.34RCTiul022863@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 30376771fc79 - main - netlink: fix build List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 30376771fc79810ffdcc47a68772c23e27b729ff Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=30376771fc79810ffdcc47a68772c23e27b729ff commit 30376771fc79810ffdcc47a68772c23e27b729ff Author: Alexander V. Chernikov AuthorDate: 2023-05-27 12:29:14 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-05-27 12:29:14 +0000 netlink: fix build --- sys/netlink/netlink_snl_route_parsers.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netlink/netlink_snl_route_parsers.h b/sys/netlink/netlink_snl_route_parsers.h index a89462210133..1e9320a4559e 100644 --- a/sys/netlink/netlink_snl_route_parsers.h +++ b/sys/netlink/netlink_snl_route_parsers.h @@ -95,8 +95,8 @@ struct rta_mpath { }; static bool -nlattr_get_multipath(struct snl_state *ss, struct nlattr *nla, const void *arg, - void *target) +nlattr_get_multipath(struct snl_state *ss, struct nlattr *nla, + const void *arg __unused, void *target) { uint32_t start_size = 4; From nobody Sat May 27 13:26:29 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QT2cj2fgRz4CkG9; Sat, 27 May 2023 13:26: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 4QT2cj1wzZz3D7h; Sat, 27 May 2023 13:26:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685193989; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IPWdWC/2FmDfIfSRjlGiFS7Pm1PpO/vkTo3BDFIABW8=; b=qjtfGPl0lwe8mJOMI5wMnzEtYxSLH+kf2RVMeGA2MjCU6DCKcWPq86jT7VfXd4DCsIwMh7 +1WXGxWBP+TyUela/enejI69ab7xE9ZYJ1tPgS+0z/RmIddZcuvN2LaYYfRo1QjG9ML7/F lVt8eNQJheYeZueoabAFZ8qgmJqry/20cHQr/OQrIRKfAIsqUYghjOJiq2gKMZ2DuAY++x ZJ/ctT6l+QKfHN53M3qSy1T1FYMLfqhrFl1dSKYY1HHUCsVhr0eKut5LJ+X1vbZYQKBYxZ 3deV6Cj+x3yr21h7kK3AWggjakTlo7HULNPbUW5PxOT97jqHEuDT0cXw5aLKdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685193989; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IPWdWC/2FmDfIfSRjlGiFS7Pm1PpO/vkTo3BDFIABW8=; b=NquIovsso5yML4xC2e8hAV+2txSCLeyaA5fOsyaXkkcl5DlsgYdFQx7fkOCw2eewFGfETr Aexrl6mHIoC4uHapCJNg95jSWvSnCQ++raJGpgO1RJ2wJNQvivbGsU8uLan3oaSZ5paCEs 7ORporziwM2wE4983yNZ1col5B1RWK6+8gqZw6vs3QiPQlHapNrPv0Oa9/rWM1UPzQ/4oM fNRxJDOVWErs23vqNEStzIyOgbYFnH7qvphYe4/iEBvFcxiyV9R8Dypc0RG3TqtmkX6+wI VV5EaSDI6+5FnfdXNvkIA2pZAxxefuvmC3hpbl0KZ+z2NfhjCwtuuGylnLuhpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685193989; a=rsa-sha256; cv=none; b=Xi7j0rV0V49RrOyqaItlJX+6w5VqwSyKoXHE4xqNPuuHQNP06CJxW+lgj5DgCYhH7XZwxY so6Ec7rXJy0pFGuv1K6ygeqr0HgF9yY9qJ5DDFtxJbbnKvaYyFGtEWEERjfZmw9kwIbre/ DCr9Y3ihKowV2qSAK8sJPS+r/Vq80G9q5Nadgms+ilUossKkywHD8i9XlDVAbb9kxpVb99 i0DWTxOcjBTIt7ZfYVUfYWrV95kd3q7jNEGgif5yRu8M7Q2xXj0yU9eA0pozrszdrUb52y d4aOj2QLTKYSJGtSbQBDsWTHouymr7w9fBYohu/qKiz/rRIC6ifgoavwIr0Hrw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QT2cj10Cfzqn7; Sat, 27 May 2023 13:26: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 34RDQT0i020076; Sat, 27 May 2023 13:26:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34RDQTYe020075; Sat, 27 May 2023 13:26:29 GMT (envelope-from git) Date: Sat, 27 May 2023 13:26:29 GMT Message-Id: <202305271326.34RDQTYe020075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: c90901245e9c - main - netlink: update rta_multipath conditions in arp/ndp after 656a39c1a062 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c90901245e9c1816f2a2c2d1e2242b0772f4bd31 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=c90901245e9c1816f2a2c2d1e2242b0772f4bd31 commit c90901245e9c1816f2a2c2d1e2242b0772f4bd31 Author: Alexander V. Chernikov AuthorDate: 2023-05-27 13:25:16 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-05-27 13:25:16 +0000 netlink: update rta_multipath conditions in arp/ndp after 656a39c1a062 --- usr.sbin/arp/arp_netlink.c | 2 +- usr.sbin/ndp/ndp_netlink.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/arp/arp_netlink.c b/usr.sbin/arp/arp_netlink.c index be52ca7fa92a..4e5c8f3d9940 100644 --- a/usr.sbin/arp/arp_netlink.c +++ b/usr.sbin/arp/arp_netlink.c @@ -130,7 +130,7 @@ guess_ifindex(struct snl_state *ss, uint32_t fibnum, struct in_addr addr) if (!snl_parse_nlmsg(ss, hdr, &snl_rtm_route_parser, &r)) return (0); - if (r.rta_multipath || (r.rta_rtflags & RTF_GATEWAY)) + if (r.rta_multipath.num_nhops > 0 || (r.rta_rtflags & RTF_GATEWAY)) return (0); /* Check if the interface is of supported type */ diff --git a/usr.sbin/ndp/ndp_netlink.c b/usr.sbin/ndp/ndp_netlink.c index e15dc900f0c7..a34359a4343f 100644 --- a/usr.sbin/ndp/ndp_netlink.c +++ b/usr.sbin/ndp/ndp_netlink.c @@ -167,7 +167,7 @@ guess_ifindex(struct snl_state *ss, uint32_t fibnum, const struct sockaddr_in6 * if (!snl_parse_nlmsg(ss, hdr, &snl_rtm_route_parser, &r)) return (0); - if (r.rta_multipath || (r.rta_rtflags & RTF_GATEWAY)) + if (r.rta_multipath.num_nhops > 0 || (r.rta_rtflags & RTF_GATEWAY)) return (0); /* Check if the interface is of supported type */ From nobody Sat May 27 15:40:01 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QT5Zn6NGHz4CsVD; Sat, 27 May 2023 15:40:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QT5Zn5cyQz3Q1h; Sat, 27 May 2023 15:40:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685202001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FmQVZNx2EYMfzI6Jf9WvdqzfiXIaZxyv7ZmBw5ru4kk=; b=f5XQkn5gWkGIVZO2SwDGR7g/Qj8mALxO2yex3Q0jiUzFYDGSnZ8J8nsBwUHpMyd7Sm5Kpb KsB8N7wgL+GwAwUsZT89JVZ71aR3VyEUMUYQe7QXPGtekDxnJ/7gkwQnIck6jfw8HIlyPb D/TXNmq5tolgV266vvOODlF0bPSaR6rvGC+5qi0qQK9zdnNQo2r2GCYxIIIQjHzn3BDm8b EV5xX3SlhlYXyfVu7cVsljL/fnBxe4fWswC9GY8H9V7suJnAy8ImSkof477sdK+EZkDicj /E6KF65bjaTf0oYathmcw1kGdlbz372+0iaze8XuVnCGKEbM5bAIRfN2OXyeqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685202001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FmQVZNx2EYMfzI6Jf9WvdqzfiXIaZxyv7ZmBw5ru4kk=; b=TjXAXnAJNjSBSBf8Sm6ZHAQaEA+/NbX26fxKlUmK+ZJjLqMGNDFG0gqn16Pf5XQzez16HH 4AOnP6ix+ZqDtoH+sFUYlcPuOpvPdTgOXVn/ehVwSbrhpBVg7Gl9kGSbKoIAcu66C6yg7M tEq8cm8RvhCvQYpzlLoP8KlDj8+4NO+dqDwdZppE4NBTj1cuvi7V6Crka3nhFJ5JnkN2z/ iB7O0i+IFhfu3wflWPRMDpbzI/+BdG6jEXLpPmoDBE3Qj4wnQY4OFTIh5n+hnAiSg5aMUq K2urhcKVlcISHAxSaQ3o4tqvP+NxaUao75tGXhXS0scOD/HMq+a5Lg97yrWGpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685202001; a=rsa-sha256; cv=none; b=NyDYgvaBqnyj+J0/65sQqIFP073/z8MoLcd1sNWLE/iPE3tglGvlfIZgzl1LfQRNFAmltY S2T5IwdV+LfEV3E3zHPV/APSyfMgP7BoEaj0M92zaNz/MwPMAAIZk0lTUItSOQJzoCfBLq eSIxTuSO8ewvbtmRUIFSrDyqlXNhmoYhlrNfJ1dLhdgjpqMGmc1d8Tq633wmHs/qgZ6x7V SShnnhFE+cNQkFhn60GenxQ7gI0Jvu1LVvMBJHsvRbPAqFaz5FvYrJK8kpURLSN6er5Ae1 cCD9/vNIvDYsV5NrjSsWOYwYcrmZSfFakx4UwFFwdjRuy+aXpTVZWh/wWBflRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QT5Zn4gYBzv05; Sat, 27 May 2023 15:40:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34RFe19G036245; Sat, 27 May 2023 15:40:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34RFe1SJ036242; Sat, 27 May 2023 15:40:01 GMT (envelope-from git) Date: Sat, 27 May 2023 15:40:01 GMT Message-Id: <202305271540.34RFe1SJ036242@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Joseph Mingrone Subject: git: 270d20ce91c8 - main - libpcap: Update PACKAGE_STRING to 1.10.4 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 270d20ce91c898c532ebaff76bb5b71c8544e928 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=270d20ce91c898c532ebaff76bb5b71c8544e928 commit 270d20ce91c898c532ebaff76bb5b71c8544e928 Author: Joseph Mingrone AuthorDate: 2023-05-27 01:45:43 +0000 Commit: Joseph Mingrone CommitDate: 2023-05-27 15:38:38 +0000 libpcap: Update PACKAGE_STRING to 1.10.4 Reviewed by: emaste Fixes: 6f9cba8f8b5e (libpcap: Update to 1.10.3) Fixes: dd744a896be3 (libpcap: Update to 1.10.4) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40295 --- lib/libpcap/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libpcap/config.h b/lib/libpcap/config.h index a0e94c76c8b9..7c823a07c3a4 100644 --- a/lib/libpcap/config.h +++ b/lib/libpcap/config.h @@ -184,7 +184,7 @@ #define PACKAGE_NAME "pcap" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "pcap 1.9.1" +#define PACKAGE_STRING "pcap 1.10.4" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "pcap" From nobody Sat May 27 16:20:47 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QT6Tq4lKkz4V0pp; Sat, 27 May 2023 16:20: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 4QT6Tq4LMdz3jQR; Sat, 27 May 2023 16:20:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685204447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L887SFc7+3mfSHIycuImSO0U6H7Q1WXwBLuf1e/xR6Y=; b=LFB+G1SoFyFVfaXAE/pX3ZfWawT+LZM3I/zd+g5jjtL5Jgn3wi44UgZbl2rem90U/Rw/kq HzLRWD4db2iI/k792E6iOggHhbIYwybu13NM33rznyG7v75jg6QXS2Izacx85oJIO8ySVP W5HQpZIkn8+0Yagi0hL6jHnYA6d+5PhNLDlJmkl8Jl+bS94n+SNDY+K6M2OM6+da0pgHAb UCbS5KZ3HQwhDa5rXBlCMArEAHVDMAJa103QE1G3eHqfaH+C5suPL2HEi2gMdFWxLuG5AQ xVLJjymN3puQ+JgHroN/EpEc2YswYQ//AldWVAHt9vDN9GaAxsTdv+YtLWv90Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685204447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L887SFc7+3mfSHIycuImSO0U6H7Q1WXwBLuf1e/xR6Y=; b=sHEFZRd8ieykvK1GpiR4sDWiCp0KtpOgCDIxeV5CQ9hgPR5NGPJX+q5LGbMgH7tFgkirdn ouTKx0f3EK/T1PmSZWaHlwJCq68uiw5EbB/4wpT0JZZx3HHxnwBmceVFfwM2FnKj0/AdSW JPvN6Am+Gp5l9DQeFDInCQOvI/GPpiMbMwSjptcPQiq9J5wfuiJFgdySO5SD4BPj1kL363 jnMnsVzCoJuJN0ywAgbWyIDFiy75aA8ru/kPBz4X2AAymp2K62F0wOcUF//tpT8t+LuI3g +6BHvnafvSUdzf1BR2JyznlzUCCSqxT0urtuVqaRfmxi0e5oFopWQP+T7eUgig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685204447; a=rsa-sha256; cv=none; b=Wjtq1RcAtJPjvU45V7oWFv0oKnMNV+I2vgvBpYOwdF66DDpvEZaT3bXUcgl1w+7eU2lIxF 2JaJwew3NvvVj60qjV0/6YDnHrBqHmU9c8Mf2yDnE28UyW+BNO8regAJH+WCIf9oLtxbPs /+fu24ZpiCDRth7+cmpZIyDg+sKv5JTfd3tDTcaxUh9xgZbKFOtENZQvTAuCMjjcBjRx2I N1TiNfzyE9u5aDd3BuLyXNhC7jyHB+quKbMFUxKGnnbZSR6Ifu72BGrpJmLlaYXVp6RLjk v8BTEAubCYhB7NS7qJNwNpunjEZ4uH70L0SkxR5GgNauwN/e19f6fx/4alXEaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QT6Tq3PChzvf2; Sat, 27 May 2023 16:20: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 34RGKl3R009840; Sat, 27 May 2023 16:20:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34RGKljt009839; Sat, 27 May 2023 16:20:47 GMT (envelope-from git) Date: Sat, 27 May 2023 16:20:47 GMT Message-Id: <202305271620.34RGKljt009839@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 1f571f8767e6 - main - Apply libc++ fix for compiling with clang 16 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1f571f8767e6e48e7175cdaa27ed11d0c473d4c2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=1f571f8767e6e48e7175cdaa27ed11d0c473d4c2 commit 1f571f8767e6e48e7175cdaa27ed11d0c473d4c2 Author: Dimitry Andric AuthorDate: 2023-05-27 16:19:37 +0000 Commit: Dimitry Andric CommitDate: 2023-05-27 16:19:37 +0000 Apply libc++ fix for compiling with clang 16 Merge commit 0e7971154ecb from llvm-project (by Christopher Di Bella): [libcxx][NFC] utilises compiler builtins for unary transform type-traits Depends on D116203 Reviewed By: #libc, philnik Differential Revision: https://reviews.llvm.org/D131732 Clang 16 got new builtins that are equivalent to hand-written parts of . When building world with the devel/llvm16 package installed and CROSS_TOOLCHAIN=llvm16 set, this would lead to -Werror warnings about those builtins being overridden. Reported by: emaste MFC after: 3 days --- .../include/__type_traits/add_lvalue_reference.h | 12 +++++++++++- .../libcxx/include/__type_traits/add_pointer.h | 15 +++++++++++---- .../include/__type_traits/add_rvalue_reference.h | 12 +++++++++++- .../llvm-project/libcxx/include/__type_traits/decay.h | 9 ++++++++- .../libcxx/include/__type_traits/is_referenceable.h | 18 +++++++++++++----- .../libcxx/include/__type_traits/make_signed.h | 19 +++++++++++++------ .../libcxx/include/__type_traits/make_unsigned.h | 19 +++++++++++++------ .../libcxx/include/__type_traits/remove_all_extents.h | 7 +++++++ .../libcxx/include/__type_traits/remove_const.h | 8 ++++++++ .../libcxx/include/__type_traits/remove_cv.h | 8 ++++++++ .../libcxx/include/__type_traits/remove_cvref.h | 5 +++++ .../libcxx/include/__type_traits/remove_extent.h | 7 +++++++ .../libcxx/include/__type_traits/remove_pointer.h | 7 +++++++ .../libcxx/include/__type_traits/remove_reference.h | 7 +++++++ .../libcxx/include/__type_traits/remove_volatile.h | 8 ++++++++ contrib/llvm-project/libcxx/include/type_traits | 4 ++-- 16 files changed, 139 insertions(+), 26 deletions(-) diff --git a/contrib/llvm-project/libcxx/include/__type_traits/add_lvalue_reference.h b/contrib/llvm-project/libcxx/include/__type_traits/add_lvalue_reference.h index 0d1ee4185c8c..9126caa9c7e9 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/add_lvalue_reference.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/add_lvalue_reference.h @@ -18,11 +18,21 @@ _LIBCPP_BEGIN_NAMESPACE_STD -template ::value> struct __add_lvalue_reference_impl { typedef _LIBCPP_NODEBUG _Tp type; }; +#if __has_builtin(__add_lvalue_reference) +template +struct add_lvalue_reference { + using type _LIBCPP_NODEBUG = __add_lvalue_reference(_Tp); +}; +#else +template ::value> +struct __add_lvalue_reference_impl { + typedef _LIBCPP_NODEBUG _Tp type; +}; template struct __add_lvalue_reference_impl<_Tp, true> { typedef _LIBCPP_NODEBUG _Tp& type; }; template struct _LIBCPP_TEMPLATE_VIS add_lvalue_reference {typedef _LIBCPP_NODEBUG typename __add_lvalue_reference_impl<_Tp>::type type;}; +#endif // __has_builtin(__add_lvalue_reference) #if _LIBCPP_STD_VER > 11 template using add_lvalue_reference_t = typename add_lvalue_reference<_Tp>::type; diff --git a/contrib/llvm-project/libcxx/include/__type_traits/add_pointer.h b/contrib/llvm-project/libcxx/include/__type_traits/add_pointer.h index aea2490c5d0c..be3f758da4af 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/add_pointer.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/add_pointer.h @@ -21,16 +21,23 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__add_pointer) +template +struct add_pointer { + using type _LIBCPP_NODEBUG = __add_pointer(_Tp); +}; +#else template ::value || - _IsSame::type, void>::value> -struct __add_pointer_impl - {typedef _LIBCPP_NODEBUG typename remove_reference<_Tp>::type* type;}; + bool = __libcpp_is_referenceable<_Tp>::value || _IsSame::type, void>::value> +struct __add_pointer_impl { + typedef _LIBCPP_NODEBUG typename remove_reference<_Tp>::type* type; +}; template struct __add_pointer_impl<_Tp, false> {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS add_pointer {typedef _LIBCPP_NODEBUG typename __add_pointer_impl<_Tp>::type type;}; +#endif // __has_builtin(__add_pointer) #if _LIBCPP_STD_VER > 11 template using add_pointer_t = typename add_pointer<_Tp>::type; diff --git a/contrib/llvm-project/libcxx/include/__type_traits/add_rvalue_reference.h b/contrib/llvm-project/libcxx/include/__type_traits/add_rvalue_reference.h index b2a1428095d8..be01d4ec5ba8 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/add_rvalue_reference.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/add_rvalue_reference.h @@ -18,11 +18,21 @@ _LIBCPP_BEGIN_NAMESPACE_STD -template ::value> struct __add_rvalue_reference_impl { typedef _LIBCPP_NODEBUG _Tp type; }; +#if __has_builtin(__add_rvalue_reference) +template +struct add_rvalue_reference { + using type _LIBCPP_NODEBUG = __add_rvalue_reference(_Tp); +}; +#else +template ::value> +struct __add_rvalue_reference_impl { + typedef _LIBCPP_NODEBUG _Tp type; +}; template struct __add_rvalue_reference_impl<_Tp, true> { typedef _LIBCPP_NODEBUG _Tp&& type; }; template struct _LIBCPP_TEMPLATE_VIS add_rvalue_reference {typedef _LIBCPP_NODEBUG typename __add_rvalue_reference_impl<_Tp>::type type;}; +#endif // __has_builtin(__add_rvalue_reference) #if _LIBCPP_STD_VER > 11 template using add_rvalue_reference_t = typename add_rvalue_reference<_Tp>::type; diff --git a/contrib/llvm-project/libcxx/include/__type_traits/decay.h b/contrib/llvm-project/libcxx/include/__type_traits/decay.h index 2af0c1ca42c3..ced21d81c815 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/decay.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/decay.h @@ -26,6 +26,12 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__decay) +template +struct decay { + using type _LIBCPP_NODEBUG = __decay(_Tp); +}; +#else template struct __decay { typedef _LIBCPP_NODEBUG typename remove_cv<_Up>::type type; @@ -53,8 +59,9 @@ struct _LIBCPP_TEMPLATE_VIS decay private: typedef _LIBCPP_NODEBUG typename remove_reference<_Tp>::type _Up; public: - typedef _LIBCPP_NODEBUG typename __decay<_Up, __is_referenceable<_Up>::value>::type type; + typedef _LIBCPP_NODEBUG typename __decay<_Up, __libcpp_is_referenceable<_Up>::value>::type type; }; +#endif // __has_builtin(__decay) #if _LIBCPP_STD_VER > 11 template using decay_t = typename decay<_Tp>::type; diff --git a/contrib/llvm-project/libcxx/include/__type_traits/is_referenceable.h b/contrib/llvm-project/libcxx/include/__type_traits/is_referenceable.h index b97631cc39dd..4b34ec257231 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/is_referenceable.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/is_referenceable.h @@ -19,14 +19,22 @@ _LIBCPP_BEGIN_NAMESPACE_STD -struct __is_referenceable_impl { - template static _Tp& __test(int); - template static false_type __test(...); +#if __has_builtin(__is_referenceable) +template +struct __libcpp_is_referenceable : integral_constant {}; +#else +struct __libcpp_is_referenceable_impl { + template + static _Tp& __test(int); + template + static false_type __test(...); }; template -struct __is_referenceable : integral_constant(0)), false_type>::value> {}; +struct __libcpp_is_referenceable + : integral_constant(0)), false_type>::value> { +}; +#endif // __has_builtin(__is_referenceable) _LIBCPP_END_NAMESPACE_STD diff --git a/contrib/llvm-project/libcxx/include/__type_traits/make_signed.h b/contrib/llvm-project/libcxx/include/__type_traits/make_signed.h index fbc31172a978..c36e2292f16f 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/make_signed.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/make_signed.h @@ -23,19 +23,25 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__make_signed) +template +struct make_signed { + using type _LIBCPP_NODEBUG = __make_signed(_Tp); +}; +#else typedef __type_list -#endif +# endif > > > > > __signed_types; template ::value || is_enum<_Tp>::value> @@ -56,16 +62,17 @@ template <> struct __make_signed< signed long, true> {typedef long ty template <> struct __make_signed {typedef long type;}; template <> struct __make_signed< signed long long, true> {typedef long long type;}; template <> struct __make_signed {typedef long long type;}; -#ifndef _LIBCPP_HAS_NO_INT128 +# ifndef _LIBCPP_HAS_NO_INT128 template <> struct __make_signed<__int128_t, true> {typedef __int128_t type;}; template <> struct __make_signed<__uint128_t, true> {typedef __int128_t type;}; -#endif +# endif template struct _LIBCPP_TEMPLATE_VIS make_signed { typedef typename __apply_cv<_Tp, typename __make_signed::type>::type>::type type; }; +#endif // __has_builtin(__make_signed) #if _LIBCPP_STD_VER > 11 template using make_signed_t = typename make_signed<_Tp>::type; diff --git a/contrib/llvm-project/libcxx/include/__type_traits/make_unsigned.h b/contrib/llvm-project/libcxx/include/__type_traits/make_unsigned.h index 8110a5ca9609..6d4e482a8d97 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/make_unsigned.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/make_unsigned.h @@ -25,19 +25,25 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__make_unsigned) +template +struct make_unsigned { + using type _LIBCPP_NODEBUG = __make_unsigned(_Tp); +}; +#else typedef __type_list -#endif +# endif > > > > > __unsigned_types; template ::value || is_enum<_Tp>::value> @@ -58,16 +64,17 @@ template <> struct __make_unsigned< signed long, true> {typedef unsigned l template <> struct __make_unsigned {typedef unsigned long type;}; template <> struct __make_unsigned< signed long long, true> {typedef unsigned long long type;}; template <> struct __make_unsigned {typedef unsigned long long type;}; -#ifndef _LIBCPP_HAS_NO_INT128 +# ifndef _LIBCPP_HAS_NO_INT128 template <> struct __make_unsigned<__int128_t, true> {typedef __uint128_t type;}; template <> struct __make_unsigned<__uint128_t, true> {typedef __uint128_t type;}; -#endif +# endif template struct _LIBCPP_TEMPLATE_VIS make_unsigned { typedef typename __apply_cv<_Tp, typename __make_unsigned::type>::type>::type type; }; +#endif // __has_builtin(__make_unsigned) #if _LIBCPP_STD_VER > 11 template using make_unsigned_t = typename make_unsigned<_Tp>::type; diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_all_extents.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_all_extents.h index 075e3acabb44..cc00a61c92b3 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_all_extents.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_all_extents.h @@ -18,12 +18,19 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_all_extents) +template +struct remove_all_extents { + using type _LIBCPP_NODEBUG = __remove_all_extents(_Tp); +}; +#else template struct _LIBCPP_TEMPLATE_VIS remove_all_extents {typedef _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_all_extents<_Tp[]> {typedef typename remove_all_extents<_Tp>::type type;}; template struct _LIBCPP_TEMPLATE_VIS remove_all_extents<_Tp[_Np]> {typedef typename remove_all_extents<_Tp>::type type;}; +#endif // __has_builtin(__remove_all_extents) #if _LIBCPP_STD_VER > 11 template using remove_all_extents_t = typename remove_all_extents<_Tp>::type; diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_const.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_const.h index 8efc893e965a..8eefbd099cb3 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_const.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_const.h @@ -17,8 +17,16 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_const) +template +struct remove_const { + using type _LIBCPP_NODEBUG = __remove_const(_Tp); +}; +#else template struct _LIBCPP_TEMPLATE_VIS remove_const {typedef _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_const {typedef _Tp type;}; +#endif // __has_builtin(__remove_const) + #if _LIBCPP_STD_VER > 11 template using remove_const_t = typename remove_const<_Tp>::type; #endif diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_cv.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_cv.h index ce1e4e45c6d1..9e3dee6c46ed 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_cv.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_cv.h @@ -19,8 +19,16 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_cv) +template +struct remove_cv { + using type _LIBCPP_NODEBUG = __remove_cv(_Tp); +}; +#else template struct _LIBCPP_TEMPLATE_VIS remove_cv {typedef typename remove_volatile::type>::type type;}; +#endif // __has_builtin(__remove_cv) + #if _LIBCPP_STD_VER > 11 template using remove_cv_t = typename remove_cv<_Tp>::type; #endif diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_cvref.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_cvref.h index d937501fedce..3af261db3949 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_cvref.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_cvref.h @@ -20,8 +20,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_cvref) +template +using __uncvref_t _LIBCPP_NODEBUG = __remove_cvref(_Tp); +#else template using __uncvref_t _LIBCPP_NODEBUG = typename remove_cv::type>::type; +#endif // __has_builtin(__remove_cvref) template struct __is_same_uncvref : _IsSame<__uncvref_t<_Tp>, __uncvref_t<_Up> > {}; diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_extent.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_extent.h index e353de361616..88da32a4e265 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_extent.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_extent.h @@ -18,12 +18,19 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_extent) +template +struct remove_extent { + using type _LIBCPP_NODEBUG = __remove_extent(_Tp); +}; +#else template struct _LIBCPP_TEMPLATE_VIS remove_extent {typedef _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_extent<_Tp[]> {typedef _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_extent<_Tp[_Np]> {typedef _Tp type;}; +#endif // __has_builtin(__remove_extent) #if _LIBCPP_STD_VER > 11 template using remove_extent_t = typename remove_extent<_Tp>::type; diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_pointer.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_pointer.h index 50cde3829470..9042a5250055 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_pointer.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_pointer.h @@ -17,11 +17,18 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_pointer) +template +struct remove_pointer { + using type _LIBCPP_NODEBUG = __remove_pointer(_Tp); +}; +#else template struct _LIBCPP_TEMPLATE_VIS remove_pointer {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp*> {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const> {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* volatile> {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_pointer<_Tp* const volatile> {typedef _LIBCPP_NODEBUG _Tp type;}; +#endif // __has_builtin(__remove_pointer) #if _LIBCPP_STD_VER > 11 template using remove_pointer_t = typename remove_pointer<_Tp>::type; diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_reference.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_reference.h index a69e48dc584b..7ea7fa52ecc5 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_reference.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_reference.h @@ -18,9 +18,16 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_reference) +template +struct remove_reference { + using type _LIBCPP_NODEBUG = __remove_reference(_Tp); +}; +#else template struct _LIBCPP_TEMPLATE_VIS remove_reference {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&> {typedef _LIBCPP_NODEBUG _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_reference<_Tp&&> {typedef _LIBCPP_NODEBUG _Tp type;}; +#endif // __has_builtin(__remove_reference) #if _LIBCPP_STD_VER > 11 template using remove_reference_t = typename remove_reference<_Tp>::type; diff --git a/contrib/llvm-project/libcxx/include/__type_traits/remove_volatile.h b/contrib/llvm-project/libcxx/include/__type_traits/remove_volatile.h index 79f64c46a27d..8c7aa6744193 100644 --- a/contrib/llvm-project/libcxx/include/__type_traits/remove_volatile.h +++ b/contrib/llvm-project/libcxx/include/__type_traits/remove_volatile.h @@ -17,8 +17,16 @@ _LIBCPP_BEGIN_NAMESPACE_STD +#if __has_builtin(__remove_volatile) +template +struct remove_volatile { + using type _LIBCPP_NODEBUG = __remove_volatile(_Tp); +}; +#else template struct _LIBCPP_TEMPLATE_VIS remove_volatile {typedef _Tp type;}; template struct _LIBCPP_TEMPLATE_VIS remove_volatile {typedef _Tp type;}; +#endif // __has_builtin(__remove_volatile) + #if _LIBCPP_STD_VER > 11 template using remove_volatile_t = typename remove_volatile<_Tp>::type; #endif diff --git a/contrib/llvm-project/libcxx/include/type_traits b/contrib/llvm-project/libcxx/include/type_traits index 3a086c595f92..dc05f9a44daf 100644 --- a/contrib/llvm-project/libcxx/include/type_traits +++ b/contrib/llvm-project/libcxx/include/type_traits @@ -679,7 +679,7 @@ struct _LIBCPP_TEMPLATE_VIS is_swappable_with template struct _LIBCPP_TEMPLATE_VIS is_swappable : public conditional< - __is_referenceable<_Tp>::value, + __libcpp_is_referenceable<_Tp>::value, is_swappable_with< typename add_lvalue_reference<_Tp>::type, typename add_lvalue_reference<_Tp>::type>, @@ -697,7 +697,7 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_swappable_with template struct _LIBCPP_TEMPLATE_VIS is_nothrow_swappable : public conditional< - __is_referenceable<_Tp>::value, + __libcpp_is_referenceable<_Tp>::value, is_nothrow_swappable_with< typename add_lvalue_reference<_Tp>::type, typename add_lvalue_reference<_Tp>::type>, From nobody Sat May 27 16:35:44 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QT6q456ytz4V1X2; Sat, 27 May 2023 16:35: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 4QT6q44Nwvz3lB8; Sat, 27 May 2023 16:35:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685205344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NuOPBmAFBASbqnZPXratVWrYAxQJdR/ExKDvnLGXa7k=; b=llh1ooVJ+bWjqog7W+BZaTa2taslpKwqo3RG40SzIUtPLk08pMFoOpHhK1dbUvDnhtUeV6 hTZK+tF+gucA2kAlaIaV2ohfRlvQhH7pzwFTjTZNd2VV1rfMhMDaWG/MqJuoccXLR5q1Kv FI87IMvmHrl1A/tkxD/zFLpV868gYjOpnYwXEbU9GfWbjGcwUgMuXiNzjRnzZLDLzhVYca KGjBq1kqjQEj9ayYNUnrjsCQyx6zN5ZkOckXjjIJ5lQfmooQJ3Z6BENgOIXJ3TU5VGWLoy g5G841ObqGFpVgza00i2e8TRUf6Ij4ReZcuXzgzNSG4XwpE0B6bktu5mY25Ezg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685205344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NuOPBmAFBASbqnZPXratVWrYAxQJdR/ExKDvnLGXa7k=; b=Dli40rGyTjrVM+YKFrYMpP0f8Wp4FqG46BV34I0RudheRrBzKtK0CsMBXlT9apcajpuGjh eZ63MfdqsqhlHQLzgzN+xuTezznplCIBVfFIvvd9JY2vtpLfUQrKM8gPLrE92BTZlryqpz 6lD3VRJH8fvCsWu8pwht2E7RC94MnIEEm4d1K60msneI9irXTpv5euHYy3oobRXvrVkMgi p37W38PUz54sqahzTe9B0q/8vJx7DzLo7iod+ZYKFv5Nu7CGC0/qsb5h5UqekfUWEECJL4 lO15qAVBnsnUvS45YWVDZ8h3/MYxd55bOPs7oBGytFNv1docJgCm2ee/ylhdyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685205344; a=rsa-sha256; cv=none; b=wt8JRusLn7kqzviTMPiN8MmKM56VzuO6Dpakd3XqWMKabCsRaA+BDhUgKxDoiNFjT8Q3Z2 bkNc1M0GHk7sr4Rnlw//yyCL87uITz68cyNfGZV+rtCxmalWCY5ZMwZjncmGHCzoPZtZYe ZgBEZPHf5aKFvOh8lEPNVGmb44bWDU4U6rYDDNPSMmga9BaozmNpWNdmeWDbbtOFocJpFv wuBoKmJowYlNm2+KVBElc8lJV2cxXAZO3D1Xj61kg/QCC9zU2uLkJ6Z5TLbX+GgH5T41ZR dAlVu0xkn0Y92V5Jt69f5z2DQFMbG+6Q9GyA626XScy0G+bBG1KPDbvqiRPgaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QT6q4397FzvjJ; Sat, 27 May 2023 16:35: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 34RGZiAp032693; Sat, 27 May 2023 16:35:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34RGZi19032692; Sat, 27 May 2023 16:35:44 GMT (envelope-from git) Date: Sat, 27 May 2023 16:35:44 GMT Message-Id: <202305271635.34RGZi19032692@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bryan Drewery Subject: git: b498331b037f - main - netgdb: Fix netgdb double ack, print proxy address List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bdrewery X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b498331b037f20bde90b46fc37678fbd421dcf09 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bdrewery: URL: https://cgit.FreeBSD.org/src/commit/?id=b498331b037f20bde90b46fc37678fbd421dcf09 commit b498331b037f20bde90b46fc37678fbd421dcf09 Author: John Reimer AuthorDate: 2023-05-27 02:48:14 +0000 Commit: Bryan Drewery CommitDate: 2023-05-27 16:34:17 +0000 netgdb: Fix netgdb double ack, print proxy address - Fixes netgdb's double ack - Moving ack responsibility to debugnet, decision to ack made by netdump/netgdb. - Finish responsibility moved to debugnet, new finish handler. - netgdb now prints the address to connect to in case the user doesn't have access to the proxy machine. Sponsored by: Dell EMC Reviewed By: markj, bdrewery (earlier version) Differential Revision: https://reviews.freebsd.org/D40064 --- sys/gdb/netgdb.c | 76 ++++++++++++++++++++------------------------------ sys/net/debugnet.c | 57 ++++++++++++++++++++++++++++--------- sys/net/debugnet.h | 15 +++++++++- sys/net/debugnet_int.h | 6 ++-- 4 files changed, 93 insertions(+), 61 deletions(-) diff --git a/sys/gdb/netgdb.c b/sys/gdb/netgdb.c index dc426adea766..58e02bb97d28 100644 --- a/sys/gdb/netgdb.c +++ b/sys/gdb/netgdb.c @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #error "NetGDB cannot be used without DDB at this time" #endif +#include #include #include #include @@ -110,64 +111,27 @@ static int *netgdb_prev_kdb_inactive; /* TODO(CEM) disable ack mode */ /* - * Receive non-TX ACK packets on the client port. + * Attempt to accept the incoming packet. If we run into ENOBUFS or another + * error, return it. * - * The mbuf chain will have all non-debugnet framing headers removed - * (ethernet, inet, udp). It will start with a debugnet_msg_hdr, of - * which the header is guaranteed to be contiguous. If m_pullup is - * used, the supplied in-out mbuf pointer should be updated - * appropriately. - * - * If the handler frees the mbuf chain, it should set the mbuf pointer - * to NULL. Otherwise, the debugnet input framework will free the - * chain. + * The mbuf chain will have all framing headers removed (ethernet, inet, udp, + * debugnet). */ -static void -netgdb_rx(struct debugnet_pcb *pcb, struct mbuf **mb) +static int +netgdb_rx(struct mbuf *m) { - const struct debugnet_msg_hdr *dnh; - struct mbuf *m; uint32_t rlen, count; - int error; - - m = *mb; - dnh = mtod(m, const void *); - - if (ntohl(dnh->mh_type) == DEBUGNET_FINISHED) { - sbuf_putc(&netgdb_rxsb, CTRL('C')); - return; - } - - if (ntohl(dnh->mh_type) != DEBUGNET_DATA) { - printf("%s: Got unexpected debugnet message %u\n", - __func__, ntohl(dnh->mh_type)); - return; - } - rlen = ntohl(dnh->mh_len); + rlen = m->m_pkthdr.len; #define _SBUF_FREESPACE(s) ((s)->s_size - ((s)->s_len + 1)) if (_SBUF_FREESPACE(&netgdb_rxsb) < rlen) { NETGDB_DEBUG("Backpressure: Not ACKing RX of packet that " "would overflow our buffer (%zd/%zd used).\n", netgdb_rxsb.s_len, netgdb_rxsb.s_size); - return; + return (ENOBUFS); } #undef _SBUF_FREESPACE - error = debugnet_ack_output(pcb, dnh->mh_seqno); - if (error != 0) { - printf("%s: Couldn't ACK rx packet %u; %d\n", __func__, - ntohl(dnh->mh_seqno), error); - /* - * Sender will re-xmit, and assuming the condition is - * transient, we'll process the packet's contentss later. - */ - return; - } - - m_adj(m, sizeof(*dnh)); - dnh = NULL; - /* * Inlined m_apply -- why isn't there a macro or inline function * version? @@ -181,6 +145,13 @@ netgdb_rx(struct debugnet_pcb *pcb, struct mbuf **mb) rlen -= count; m = m->m_next; } + return (0); +} + +static void +netgdb_finish(void) +{ + sbuf_putc(&netgdb_rxsb, CTRL('C')); } /* @@ -338,6 +309,7 @@ DB_COMMAND_FLAGS(netgdb, db_netgdb_cmd, CS_OWN) struct debugnet_ddb_config params; struct debugnet_conn_params dcp; struct debugnet_pcb *pcb; + char proxy_buf[INET_ADDRSTRLEN]; int error; if (!KERNEL_PANICKED()) { @@ -374,6 +346,7 @@ DB_COMMAND_FLAGS(netgdb, db_netgdb_cmd, CS_OWN) .dc_client_port = NETGDB_CLIENTPORT, .dc_herald_aux2 = NETGDB_PROTO_V1, .dc_rx_handler = netgdb_rx, + .dc_finish_handler = netgdb_finish, }; error = debugnet_connect(&dcp, &pcb); @@ -398,6 +371,19 @@ DB_COMMAND_FLAGS(netgdb, db_netgdb_cmd, CS_OWN) db_cmd_loop_done = 1; gdb_return_to_ddb = true; db_printf("(detaching GDB will return control to DDB)\n"); + + const in_addr_t *proxy_addr = debugnet_get_server_addr(netgdb_conn); + const uint16_t proxy_port = debugnet_get_server_port(netgdb_conn) + 1; + inet_ntop(AF_INET, proxy_addr, proxy_buf, sizeof(proxy_buf)); + if (inet_ntop(AF_INET, proxy_addr, proxy_buf, sizeof(proxy_buf)) == NULL) { + db_printf("Connected to proxy. " + "Use target remote :%hu to begin debugging.\n", + proxy_port); + } else { + db_printf("Connected to proxy. " + "Use target remote %s:%hu to begin debugging.\n", + proxy_buf, proxy_port); + } #if 0 /* Aspirational, but does not work reliably. */ db_printf("(ctrl-c will return control to ddb)\n"); diff --git a/sys/net/debugnet.c b/sys/net/debugnet.c index 96cd61b4dd10..cefdd4f582ce 100644 --- a/sys/net/debugnet.c +++ b/sys/net/debugnet.c @@ -115,6 +115,22 @@ debugnet_get_gw_mac(const struct debugnet_pcb *pcb) return (pcb->dp_gw_mac.octet); } +const in_addr_t * +debugnet_get_server_addr(const struct debugnet_pcb *pcb) +{ + MPASS(g_debugnet_pcb_inuse && pcb == &g_dnet_pcb && + pcb->dp_state >= DN_STATE_GOT_HERALD_PORT); + return (&pcb->dp_server); +} + +const uint16_t +debugnet_get_server_port(const struct debugnet_pcb *pcb) +{ + MPASS(g_debugnet_pcb_inuse && pcb == &g_dnet_pcb && + pcb->dp_state >= DN_STATE_GOT_HERALD_PORT); + return (pcb->dp_server_port); +} + /* * Start of network primitives, beginning with output primitives. */ @@ -365,6 +381,8 @@ debugnet_handle_rx_msg(struct debugnet_pcb *pcb, struct mbuf **mb) { const struct debugnet_msg_hdr *dnh; struct mbuf *m; + uint32_t hdr_type; + uint32_t seqno; int error; m = *mb; @@ -383,33 +401,46 @@ debugnet_handle_rx_msg(struct debugnet_pcb *pcb, struct mbuf **mb) return; } } - dnh = mtod(m, const void *); + dnh = mtod(m, const void *); if (ntohl(dnh->mh_len) + sizeof(*dnh) > m->m_pkthdr.len) { DNETDEBUG("Dropping short packet.\n"); return; } + hdr_type = ntohl(dnh->mh_type); + if (hdr_type != DEBUGNET_DATA) { + if (hdr_type == DEBUGNET_FINISHED) { + printf("Remote shut down the connection on us!\n"); + pcb->dp_state = DN_STATE_REMOTE_CLOSED; + if (pcb->dp_finish_handler != NULL) { + pcb->dp_finish_handler(); + } + } else { + DNETDEBUG("Got unexpected debugnet message %u\n", hdr_type); + } + return; + } + /* * If the issue is transient (ENOBUFS), sender should resend. If * non-transient (like driver objecting to rx -> tx from the same * thread), not much else we can do. */ - error = debugnet_ack_output(pcb, dnh->mh_seqno); - if (error != 0) + seqno = dnh->mh_seqno; /* net endian */ + m_adj(m, sizeof(*dnh)); + dnh = NULL; + error = pcb->dp_rx_handler(m); + if (error != 0) { + DNETDEBUG("RX handler was not able to accept message, error %d. " + "Skipping ack.\n", error); return; - - if (ntohl(dnh->mh_type) == DEBUGNET_FINISHED) { - printf("Remote shut down the connection on us!\n"); - pcb->dp_state = DN_STATE_REMOTE_CLOSED; - - /* - * Continue through to the user handler so they are signalled - * not to wait for further rx. - */ } - pcb->dp_rx_handler(pcb, mb); + error = debugnet_ack_output(pcb, seqno); + if (error != 0) { + DNETDEBUG("Couldn't ACK rx packet %u; %d\n", ntohl(seqno), error); + } } static void diff --git a/sys/net/debugnet.h b/sys/net/debugnet.h index 4d209df4cd8b..81962070c9e3 100644 --- a/sys/net/debugnet.h +++ b/sys/net/debugnet.h @@ -134,7 +134,10 @@ struct debugnet_conn_params { * * The handler should ACK receieved packets with debugnet_ack_output. */ - void (*dc_rx_handler)(struct debugnet_pcb *, struct mbuf **); + int (*dc_rx_handler)(struct mbuf *); + + /* Cleanup signal for bidirectional protocols. */ + void (*dc_finish_handler)(void); }; /* @@ -207,6 +210,16 @@ void debugnet_network_poll(struct debugnet_pcb *); */ const unsigned char *debugnet_get_gw_mac(const struct debugnet_pcb *); +/* + * Get the connected server address. + */ +const in_addr_t *debugnet_get_server_addr(const struct debugnet_pcb *); + +/* + * Get the connected server port. + */ +const uint16_t debugnet_get_server_port(const struct debugnet_pcb *); + /* * Callbacks from core mbuf code. */ diff --git a/sys/net/debugnet_int.h b/sys/net/debugnet_int.h index 982000248374..b6c5f2cecff1 100644 --- a/sys/net/debugnet_int.h +++ b/sys/net/debugnet_int.h @@ -69,8 +69,10 @@ struct debugnet_pcb { void (*dp_drv_input)(struct ifnet *, struct mbuf *); /* RX handler for bidirectional protocols. */ - void (*dp_rx_handler)(struct debugnet_pcb *, - struct mbuf **); + int (*dp_rx_handler)(struct mbuf *); + + /* Cleanup signal for bidirectional protocols. */ + void (*dp_finish_handler)(void); enum dnet_pcb_st dp_state; uint16_t dp_client_port; From nobody Sat May 27 18:10:23 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QT8wZ1X0fz4V6vR; Sat, 27 May 2023 18:10:38 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QT8wY67nkz43FF; Sat, 27 May 2023 18:10:37 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1b024e29657so6012165ad.3; Sat, 27 May 2023 11:10:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685211036; x=1687803036; h=to:references:message-id:cc:date:in-reply-to:from:subject :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=0IClT4MZTDnjUdsZoaKX0bFLLIH4mmQFw5icAB45CKM=; b=bJfvCFtVyBluWi1r9++wQWH+h+Qyjz/51JSKZhYJdXpQOtPR8EHfZpX1HtB5CvfTu1 gdbIdgInLvw7nOk6aKlrQtTYzrO2ML2i2iiLfclxV22FoErZvJBCgto3rOfHCrv75N/k QyP+BLYC6Xc+ElIXH7ehPXQeJtEvAfLc0hPNW0d+A2bVUqfUvnaXO0exSI0bMCEG6f7r NLXOObAk0O+sunrBjDPdTajuYuzRxRCtIvb46Dm0r7IquvUQ5bjjCLLOwG1rpPoz/U+4 YOoLRX0Bg1d/pJVb1atWMeQk6ZLr88hqbcVK5cccseD/nfujZd9tEwJ12F429cuQ0Lud WCag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685211036; x=1687803036; h=to:references:message-id:cc:date:in-reply-to:from:subject :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0IClT4MZTDnjUdsZoaKX0bFLLIH4mmQFw5icAB45CKM=; b=FKQQ3Z+Pw3nbBAK097TDwvLVv2EGLgs+6x1y1psTYnHDY6e43AaMT6aFQd9On7lDJ4 ic4t6P+6Illx/Sr4u4tjPGhd/eIDjxRneYWqLTa0/CypbQ9Hjiex5ok4R+CtSjOAPdfk GKAEYEYMKMtnKys1/LizToaLOfJbOUxeOCRHK/sgCeOJ1D4yeXyJgloF8xI9WgJ/1frK W5JMr9TzkXdS2wzgBr1MKadnZt4+M7jEvEU4eCoDwiI8mDpyhNcsDUKuPPLewBZQAaDv mtEjFbzaCeJwU/ELdoGh56ggcU6HTsqP9RVwYny2VMwwvXDjbBxA+i2zNwUFHY1qTk1f b4rA== X-Gm-Message-State: AC+VfDyYHJvi7oG31mxpVlsTWJD9irqiuk1ZqHzonh4iRHicHkXPV3xM j4PHtd4CPIIbxFwBEBv9amVSbPQdz/Vrkg== X-Google-Smtp-Source: ACHHUZ6C8A/3YnZ1zdk0Y8rgbe2WjvICzXRIAfDCvTZqySKVHZf/hZxsKDCBdKu7+rPhVxjBenNN6w== X-Received: by 2002:a17:902:c40e:b0:1ae:44f0:82d0 with SMTP id k14-20020a170902c40e00b001ae44f082d0mr7550115plk.43.1685211035481; Sat, 27 May 2023 11:10:35 -0700 (PDT) Received: from smtpclient.apple (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id m24-20020a170902bb9800b001a94a497b50sm5204894pls.20.2023.05.27.11.10.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 May 2023 11:10:34 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_3CF63A9F-1097-43FE-A5AD-D681CD8994D3"; protocol="application/pgp-signature"; micalg=pgp-sha256 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: git: acfb06062a68 - main - stress2: Fix warnings From: Enji Cooper In-Reply-To: <202305270835.34R8ZA3g041896@gitrepo.freebsd.org> Date: Sat, 27 May 2023 11:10:23 -0700 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Message-Id: <41908493-F312-4BA2-A72B-B3C047656CCC@gmail.com> References: <202305270835.34R8ZA3g041896@gitrepo.freebsd.org> To: Peter Holm X-Mailer: Apple Mail (2.3731.500.231) X-Rspamd-Queue-Id: 4QT8wY67nkz43FF X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_3CF63A9F-1097-43FE-A5AD-D681CD8994D3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On May 27, 2023, at 1:35 AM, Peter Holm wrote: >=20 > The branch main has been updated by pho: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dacfb06062a6862f7c823242243e68f7b= caf29999 >=20 > commit acfb06062a6862f7c823242243e68f7bcaf29999 > Author: Peter Holm > AuthorDate: 2023-05-27 08:31:00 +0000 > Commit: Peter Holm > CommitDate: 2023-05-27 08:31:00 +0000 >=20 > stress2: Fix warnings It seems like `n` could be removed in all of the sample programs. Cheers, -Enji --Apple-Mail=_3CF63A9F-1097-43FE-A5AD-D681CD8994D3 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----- iQIzBAEBCAAdFiEEtvtxN6kOllEF3nmX5JFNMZeDGN4FAmRyR48ACgkQ5JFNMZeD GN5BuQ//fB9yNI0Xzz0jZ37OEvzC6gpC9WpQ7UlTZvTLdtuTgG61Hh2OcTBqQz9j 1f6jCKIqJ0gZwZhExRej9AghGEMBjnU3G0Y+RSSZKlNzlvfFy7FHaRXKSFoOluK1 cCEWiapjbURpqZnUwt2Va7oenXmcpaYWOXOzT2W+5TRNyA1noyKF/s5Xb42yebP7 z8c/igcCOZRzsGUya7tqfMLpK4Mpdhsu1voTEbqym51FORQXweUrAmmUmbkQP5my JnHKKMw78CftvcG+qHAtnOdZEVoyGWZ/JRTdQY9Dh82mCmJsj4q2cCr9Gdgf+uS2 ALPotQq9GBqspmWxyTcS+sb4pieoxbXrHCv3tIhbpgK50ebUr1ZIIitpTo6AwG35 8I9pZuaIJdBu4qboh0fDxQfKUoebtIssm0JL+RU0MKpa6v2fNqxN6YHCFqNRHTT9 6aaH+ri0Oz7wYR2muEp4OyEKS0mmjd3UY9QVljC/BfqVOxCRHo1xn1w17A1yL79t QSJL7pv3bnxJ3ZOaw2kOPFZfK0/c08eQqDpL7QpRstFbE6i1q+nO930WgXbT5KpE BO6hMOYicmuJfdggr/jI/RFZmRn9GHLnEMTu3wnVq+TdG809S4jNyp29tteiFLn0 a3e+WY0EB9zYWq9eUk/yRmWQ1Gp3fG8NHbHzVjEUA/pcWGriLbE= =PBPJ -----END PGP SIGNATURE----- --Apple-Mail=_3CF63A9F-1097-43FE-A5AD-D681CD8994D3-- From nobody Sat May 27 18:11:54 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QT8y23byqz4V6rB; Sat, 27 May 2023 18:11: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 4QT8y239S8z43nC; Sat, 27 May 2023 18:11:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685211114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3LPGCLFFQnyJQzJ4xtNm53xzhsnuU2p93pRxaBCjdV8=; b=fLqkIdpqjXRl3yBvNLFAUsw4FGfU+Vp0rpzd/47NqxT/1vSaqVmVL2L0Wl9yDdcJWSEGVw tSdviGQ49RPkzQuOrjkjCYcL6hO5my599+1JO45nMV29eOzIeCVHje0ySYgN8T9mxZQtzA HdLcMcTpX/Pm8W8uRgniFYVpL51M8tbddiVAwI+yOZbAhB732P2MxukBR6zySp3wlJ0wG9 FdCiym5tG/4NUSvL7UPGWpjzXU7zAzEdzGKheNoE89UQ+ktMmjz/WAQLQt1CQ0qA0oHSch NJO0rJkA7oxgtQtSyVp1+yn05FN3Ed0E7ixvnrNbdkiQWNv5IvkoAPnG2+qxEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685211114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3LPGCLFFQnyJQzJ4xtNm53xzhsnuU2p93pRxaBCjdV8=; b=Z/kudn/kJSP3KiGcAN9skm9cOqObcpUdZ+bOQVlhT2BlMWp0+jersvHMp/ikGasoGQQOHi EA3UfomwyZwcbHx8k/CFC0SNpkJfdvbR5hUqbpUmvp7TRGp+T4iNnllmA1Erd8sFToUbfD +0P1kjUSnYJIBzXH2LoSnpU3e3RR0bh9pGolyC+od+W9cGE84XPP8VYSx68636ELmwdUXn KkOccds/ACRd8zvolaK5i2uCybP2p98RKeACx4KsOMdXQH11sj2KqTzqX7xCoL2JyzNWRR WjqndRo7o6a6kYvMX1glLb/6TAsScVB1rkqAPXFlVqrzuRfnsQwjfr3DjXbHiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685211114; a=rsa-sha256; cv=none; b=HSYZM5xBnhz8vtfJFkVc0d8vPTkQ1dQ2OrMkGcC5kteUpBaL7xr4zoRsD5NGhboOZVru0N n63Ko/QXaHUBKnBG+zgAXtrkWVkhUXHy4M0CauCQXCzBbM5W6xyA/L0Whu4VUfr09FEqUE L0M7WhzFlzmGgJskolUiFrkXKlouQSRnpY51BaNutZ97HxQXCjCWfL4rcgkxlR4aCUbYMU tHrjkfcUGqgiGTLRxPla8vV1h/kP2gr35aYU0uiYwoGwenyCibj6hlGWe3wciKVhl8TIPV P22oU71xDwzb54/v+pVpJz7ZOtHZ8t1xJz5jYqKtjf1y4FqXHCQ2Vq5bNsT4oA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QT8y22DnMzyWq; Sat, 27 May 2023 18:11: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 34RIBsm8093513; Sat, 27 May 2023 18:11:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34RIBs6U093512; Sat, 27 May 2023 18:11:54 GMT (envelope-from git) Date: Sat, 27 May 2023 18:11:54 GMT Message-Id: <202305271811.34RIBs6U093512@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Enji Cooper Subject: git: c60be9ea6b1e - main - Add simple factor/primes regression tests List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c60be9ea6b1ecef6e77096601660f9573ec59a26 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=c60be9ea6b1ecef6e77096601660f9573ec59a26 commit c60be9ea6b1ecef6e77096601660f9573ec59a26 Author: Enji Cooper AuthorDate: 2023-05-27 04:51:24 +0000 Commit: Enji Cooper CommitDate: 2023-05-27 18:11:44 +0000 Add simple factor/primes regression tests This will help ensure that the change following this one to support OpenSSL 3 is sane. MFC after: 1 week Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D40297 --- etc/mtree/BSD.tests.dist | 2 + usr.bin/factor/Makefile | 3 ++ usr.bin/factor/tests/Makefile | 4 ++ usr.bin/factor/tests/factor_tests.sh | 85 ++++++++++++++++++++++++++++++++++++ usr.bin/factor/tests/primes_tests.sh | 75 +++++++++++++++++++++++++++++++ 5 files changed, 169 insertions(+) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 77c07960f938..8dc52086fe33 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -1036,6 +1036,8 @@ .. du .. + factor + .. file2c .. file diff --git a/usr.bin/factor/Makefile b/usr.bin/factor/Makefile index f180c0f135e7..255160ef6e00 100644 --- a/usr.bin/factor/Makefile +++ b/usr.bin/factor/Makefile @@ -17,4 +17,7 @@ MAN= factor.6 MLINKS+=factor.6 primes.6 .PATH: ${SRCTOP}/usr.bin/primes +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + .include diff --git a/usr.bin/factor/tests/Makefile b/usr.bin/factor/tests/Makefile new file mode 100644 index 000000000000..f9b13443ae92 --- /dev/null +++ b/usr.bin/factor/tests/Makefile @@ -0,0 +1,4 @@ +ATF_TESTS_SH+= factor_tests +ATF_TESTS_SH+= primes_tests + +.include diff --git a/usr.bin/factor/tests/factor_tests.sh b/usr.bin/factor/tests/factor_tests.sh new file mode 100755 index 000000000000..0d9156673582 --- /dev/null +++ b/usr.bin/factor/tests/factor_tests.sh @@ -0,0 +1,85 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright 2023 (C) Enji Cooper +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +atf_test_case float_non_prime +float_non_prime_head() +{ + atf_set "descr" "Test with a float non-prime number" +} +float_non_prime_body() +{ + atf_check -o inline:"1: 1\n" factor 1.44 +} + +atf_test_case float_prime +float_prime_head() +{ + atf_set "descr" "Test with a float prime number" +} +float_prime_body() +{ + pi="3.141592653589793238462643383279502884197" + atf_check -o inline:"3: 3\n" factor $pi +} + +atf_test_case int_non_prime +int_non_prime_head() +{ + atf_set "descr" "Test with an integral prime number" +} +int_non_prime_body() +{ + atf_check -o inline:"8: 2 2 2\n" factor 8 +} + +atf_test_case int_prime +int_prime_head() +{ + atf_set "descr" "Test with an integral prime number" +} +int_prime_body() +{ + atf_check -o inline:"31: 31\n" factor 31 +} + +atf_test_case negative_numbers_not_allowed +negative_numbers_not_allowed_head() +{ + atf_set "descr" "Verify that negative numbers are not allowed." +} +negative_numbers_not_allowed_body() +{ + atf_check -s not-exit:0 -e inline:"factor: negative numbers aren't permitted.\n" factor -- -4 +} + +atf_init_test_cases() +{ + atf_add_test_case float_non_prime + atf_add_test_case float_prime + atf_add_test_case int_non_prime + atf_add_test_case int_prime + atf_add_test_case negative_numbers_not_allowed +} diff --git a/usr.bin/factor/tests/primes_tests.sh b/usr.bin/factor/tests/primes_tests.sh new file mode 100755 index 000000000000..2b00e9ba34c8 --- /dev/null +++ b/usr.bin/factor/tests/primes_tests.sh @@ -0,0 +1,75 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright 2023 (C) Enji Cooper +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +atf_test_case invalid_range +invalid_range_head() +{ + atf_set "descr" "Verify that invalid ranges are not allowed." +} +invalid_range_body() +{ + atf_check -s not-exit:0 -e inline:"primes: start value must be less than stop value.\n" primes -- 2 1 +} + +atf_test_case negative_numbers_not_allowed +negative_numbers_not_allowed_head() +{ + atf_set "descr" "Verify that negative numbers are not allowed." +} +negative_numbers_not_allowed_body() +{ + atf_check -s not-exit:0 -e inline:"primes: negative numbers aren't permitted.\n" primes -- -1 0 +} + +atf_test_case no_primes_between_between_20_and_22 +no_primes_between_between_20_and_22_head() +{ + atf_set "descr" "Show that no primes exist between [20, 22]." +} + +no_primes_between_between_20_and_22_body() +{ + atf_check primes 20 22 +} + +atf_test_case primes_in_20_to_50_range +primes_in_20_to_50_range_head() +{ + atf_set "descr" "Find all primes between [20, 50]." +} + +primes_in_20_to_50_range_body() +{ + atf_check -o inline:"23\n29\n31\n37\n41\n43\n47\n" primes 20 50 +} + +atf_init_test_cases() +{ + atf_add_test_case invalid_range + atf_add_test_case negative_numbers_not_allowed + atf_add_test_case no_primes_between_between_20_and_22 + atf_add_test_case primes_in_20_to_50_range +} From nobody Sat May 27 18:11:55 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QT8y351H4z4V6sb; Sat, 27 May 2023 18:11: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 4QT8y3423Rz43q6; Sat, 27 May 2023 18:11:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685211115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FpdrMlL+xTU3vr4CM3IE+yna9/LxP/92LtfTr+vPcCg=; b=d28/PlNQqW/GhPN0EP9MuzhYzjAtq8wMbuZYyX4z/m3SjslfN1M4pF+I+tOlDV9+hxxpNG wT1oIu6dVJzTFW1yUbW/4pN0l22KLeur8DXvOVmZUknjyunK/+2uvMx10v4QV91/DBoFqi ua6BmHHgtUdNmAt7oz9jNff5pBVIMJLvjKtk3JuYiBpsjD8gC/uH5lqSPEFU7A/fq2J2jI +YVaiocLL4YdQ8PYn2vYj3T0xv4SRCZlsvsyLSRyI+PY5kQVvoUC4A2hTscaDi3CRHgBSt eiFxmhNb+xNNA2srJfgls7dypEDePoYZ+Snwz+S2SRpBwX1q+38xnEixIgwTAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685211115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FpdrMlL+xTU3vr4CM3IE+yna9/LxP/92LtfTr+vPcCg=; b=xQCJF0nRXfr03ue/cumPNRj3eVH1dkQJmdb06kLiCQpFLQkIJhCRoc3V7tGeOl3MhekT3D mqfAd4KmKggQtpIqYupZ9ZEcZKA0nEY99vgMsaI+P3byIszXuoj6JdhYjfjyaUm7u8SAcN TaaUa40RUULHEx1o8q2psCA5pBJoFccAbvQLC0Z7MRRm0RrRiXaaGceRQts6KBPUpu1Avd rF0KIR5N7U7/7rzZ9gYJ08X8DWtnABxJyVLNfdBhyQeqwZUDxDW4K7bJWU+3d0gcg3N9dr WKdxoChynD04LbByTzgCb5w6kaZwjgMZ10CBib3PX4qXczWAqSrIDr5hHZpfcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685211115; a=rsa-sha256; cv=none; b=F96uHUjoniFBisRk2wNxHtegUb/gVRdfd94gGTjTH2Fo2KU/VbCDFSTZWjI40CxaTuxGks RS11or37M09DkKCDXldyjCJmhOyvJ4VtdmmERM32lb+tdgSoTXy5DRSd8f4KvoBJv9YN6x 7GpsB4XtCszO93QTye7zNNVUsGIrT3Bg3jWatJQpiQmcNNA9SOqUB5c+nYv+72YfqdddOU u+wfKttTFGXc0wUD/kXhVhh/EyZJabBhXwfRvESPRlR82U0rbYG8QsRqNM2nO0cmhqDmfT Alhig7U76RdSUslvvIw/I7uP7qFjOtFGASojxmH/NiHDsAFGH6Frrd0eDPXN7g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QT8y335KdzyjP; Sat, 27 May 2023 18:11: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 34RIBtiT093539; Sat, 27 May 2023 18:11:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34RIBtHY093538; Sat, 27 May 2023 18:11:55 GMT (envelope-from git) Date: Sat, 27 May 2023 18:11:55 GMT Message-Id: <202305271811.34RIBtHY093538@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Enji Cooper Subject: git: 537cd766435c - main - factor: support OpenSSL 3 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 537cd766435c80e61e72bb9369f77aa9630a1537 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=537cd766435c80e61e72bb9369f77aa9630a1537 commit 537cd766435c80e61e72bb9369f77aa9630a1537 Author: Enji Cooper AuthorDate: 2023-05-27 04:55:12 +0000 Commit: Enji Cooper CommitDate: 2023-05-27 18:11:44 +0000 factor: support OpenSSL 3 This change ports the BN APIs to an OpenSSL 3 compatible set of APIs. This removes the need for requesting OpenSSL 1.1 compatible APIs. MFC after: 1 week Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D40298 --- usr.bin/factor/Makefile | 1 - usr.bin/factor/factor.c | 17 +++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/usr.bin/factor/Makefile b/usr.bin/factor/Makefile index 255160ef6e00..ffa9ec7de1f8 100644 --- a/usr.bin/factor/Makefile +++ b/usr.bin/factor/Makefile @@ -9,7 +9,6 @@ CFLAGS+=-I${SRCTOP}/usr.bin/primes .if ${MK_OPENSSL} != "no" CFLAGS+=-DHAVE_OPENSSL -CFLAGS+=-DOPENSSL_API_COMPAT=0x10100000L LIBADD+=crypto .endif diff --git a/usr.bin/factor/factor.c b/usr.bin/factor/factor.c index 4edc2ed2a72c..a3b0a65b5eca 100644 --- a/usr.bin/factor/factor.c +++ b/usr.bin/factor/factor.c @@ -209,7 +209,11 @@ pr_fact(BIGNUM *val) if (!BN_sqr(bnfact, bnfact, ctx)) errx(1, "error in BN_sqr()"); if (BN_cmp(bnfact, val) > 0 || +#if OPENSSL_VERSION_NUMBER >= 0x30000000L + BN_check_prime(val, NULL, NULL) == 1) +#else BN_is_prime_ex(val, PRIME_CHECKS, NULL, NULL) == 1) +#endif pr_print(val); else pollard_pminus1(val); @@ -282,7 +286,11 @@ newbase: errx(1, "error in BN_gcd()"); if (!BN_is_one(x)) { +#if OPENSSL_VERSION_NUMBER >= 0x30000000L + if (BN_check_prime(x, NULL, NULL) == 1) +#else if (BN_is_prime_ex(x, PRIME_CHECKS, NULL, NULL) == 1) +#endif pr_print(x); else pollard_pminus1(x); @@ -291,8 +299,13 @@ newbase: BN_div(num, NULL, val, x, ctx); if (BN_is_one(num)) return; - if (BN_is_prime_ex(num, PRIME_CHECKS, NULL, - NULL) == 1) { +#if OPENSSL_VERSION_NUMBER >= 0x30000000L + if (BN_check_prime(num, NULL, NULL) == 1) +#else + if (BN_is_prime_ex(num, PRIME_CHECKS, NULL, NULL) + == 1) +#endif + { pr_print(num); fflush(stdout); return; From nobody Sat May 27 19:21:58 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QTBVx2b9Mz4VBt3; Sat, 27 May 2023 19:22:01 +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 4QTBVx28Nbz482Z; Sat, 27 May 2023 19:22:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685215321; h=from:from:reply-to:subject: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=VSy/CyTv78jds9wBLEDdiX6P9r4r4HK+bU+dylaHvuM=; b=o+h3vQonD6DaTrMIj5tITF/86uc+sQ+PCop5t9MVAZS4LOhwWsOS0xxpP+r4MZGJNMOiPd NsTQ8dzYA7OvCNBhB4i6xhQOJPJ9pXbT+PnW4OTMUoMA9ytUBWf0rdsozj/7CcwEgvtRZc jaXTaa0YkY9vdEYxsEUYvG4owWhjy1tGtMdvqE2XIljeNddHcVk9/icsP1P2BQRCnKb0m8 zsetNHKYZs9Vgi2zjYUSIbrEEbrRHcH1u3K8dA8bn/HukXpF6+UDTdd+J7IN+14UQk01n/ Yo6CXH2VHZj+krrz9p13DXSEx2RH3sy6c8ZeciXY7IoMY1OB1DOODjul8wNQgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685215321; h=from:from:reply-to:subject: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=VSy/CyTv78jds9wBLEDdiX6P9r4r4HK+bU+dylaHvuM=; b=ffdUsZFl15YkPH0R6qBpXsCKMLnHdJ/faAX4R/9pLI6STAiB3VPGvnwEhm2862WsO2X57R mXb3TT2ZEofIbpG2WObZLgRqEZ0kWbHxL/t9bwoX5uqa16/3SC8tglb3GOJ6YgNAg/SgQX zZJPZl/hfzhuzTQpO22Lnx/UzV2iPusLy06DCdccAzL3ZdBJ+/Mx38pSZTSTQpd0FWcL/7 mjiSOwA5Z0r1b7a0nFpc/ZntuAkoVIt6ABRT08LtN4g1Y35daSUSNYszVplC6c5IpOCyfC FxYiM+URuJv+Miqb2033QLx9UIALgvON2N+/xC8bD8Rq+5YE3+pym9gKUpGaTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685215321; a=rsa-sha256; cv=none; b=qlZfHpNB7Vr3T9w5cNxV/TP0y9IrwJN/czEcR/cJ8qkX3F11H7cf6jl4RoHwSYVGoDk+aR qAYMiWbsZ4k4UORBO8P05PeCTSRHbkyn0AvRd76hW1z3PDcvzSRDVYf5/Y1RdxaESiWaLI s645qL41cbpg80EUMphnxoHmKAbQif9Kt5kk3bZLCDdqkcde0It5W78qN+btEGJBiysrHb d7pQpdRNeFXLGlj5m96fyDf6F+uM0fGRpz8wCNYfhRYVdv6lhDyO9uy1lDzMak8qKAABZb zrxhVmyD2dqSW8h5qw2IqGnmcb26Unxta7QXzeFzExULlwh77y44FFo2VbeM1w== Received: from [IPV6:2601:648:8680:16b0:186d:70a9:97fb:a487] (unknown [IPv6:2601:648:8680:16b0:186d:70a9:97fb:a487]) (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 4QTBVw4v9JzLlh; Sat, 27 May 2023 19:22:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <626f675b-f304-b772-61a4-0a92283ac348@FreeBSD.org> Date: Sat, 27 May 2023 12:21:58 -0700 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Content-Language: en-US To: Enji Cooper , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202305271811.34RIBtHY093538@gitrepo.freebsd.org> From: John Baldwin Subject: Re: git: 537cd766435c - main - factor: support OpenSSL 3 In-Reply-To: <202305271811.34RIBtHY093538@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 5/27/23 11:11 AM, Enji Cooper wrote: > The branch main has been updated by ngie: > > URL: https://cgit.FreeBSD.org/src/commit/?id=537cd766435c80e61e72bb9369f77aa9630a1537 > > commit 537cd766435c80e61e72bb9369f77aa9630a1537 > Author: Enji Cooper > AuthorDate: 2023-05-27 04:55:12 +0000 > Commit: Enji Cooper > CommitDate: 2023-05-27 18:11:44 +0000 > > factor: support OpenSSL 3 > > This change ports the BN APIs to an OpenSSL 3 compatible set of APIs. > > This removes the need for requesting OpenSSL 1.1 compatible APIs. > > MFC after: 1 week > Reviewed by: emaste > Differential Revision: https://reviews.freebsd.org/D40298 > --- > usr.bin/factor/Makefile | 1 - > usr.bin/factor/factor.c | 17 +++++++++++++++-- > 2 files changed, 15 insertions(+), 3 deletions(-) > > diff --git a/usr.bin/factor/Makefile b/usr.bin/factor/Makefile > index 255160ef6e00..ffa9ec7de1f8 100644 > --- a/usr.bin/factor/Makefile > +++ b/usr.bin/factor/Makefile > @@ -9,7 +9,6 @@ CFLAGS+=-I${SRCTOP}/usr.bin/primes > > .if ${MK_OPENSSL} != "no" > CFLAGS+=-DHAVE_OPENSSL > -CFLAGS+=-DOPENSSL_API_COMPAT=0x10100000L > LIBADD+=crypto > .endif > > diff --git a/usr.bin/factor/factor.c b/usr.bin/factor/factor.c > index 4edc2ed2a72c..a3b0a65b5eca 100644 > --- a/usr.bin/factor/factor.c > +++ b/usr.bin/factor/factor.c > @@ -209,7 +209,11 @@ pr_fact(BIGNUM *val) > if (!BN_sqr(bnfact, bnfact, ctx)) > errx(1, "error in BN_sqr()"); > if (BN_cmp(bnfact, val) > 0 || > +#if OPENSSL_VERSION_NUMBER >= 0x30000000L > + BN_check_prime(val, NULL, NULL) == 1) > +#else > BN_is_prime_ex(val, PRIME_CHECKS, NULL, NULL) == 1) > +#endif > pr_print(val); > else > pollard_pminus1(val); > @@ -282,7 +286,11 @@ newbase: > errx(1, "error in BN_gcd()"); > > if (!BN_is_one(x)) { > +#if OPENSSL_VERSION_NUMBER >= 0x30000000L > + if (BN_check_prime(x, NULL, NULL) == 1) > +#else > if (BN_is_prime_ex(x, PRIME_CHECKS, NULL, NULL) == 1) > +#endif > pr_print(x); > else > pollard_pminus1(x); > @@ -291,8 +299,13 @@ newbase: > BN_div(num, NULL, val, x, ctx); > if (BN_is_one(num)) > return; > - if (BN_is_prime_ex(num, PRIME_CHECKS, NULL, > - NULL) == 1) { > +#if OPENSSL_VERSION_NUMBER >= 0x30000000L > + if (BN_check_prime(num, NULL, NULL) == 1) > +#else > + if (BN_is_prime_ex(num, PRIME_CHECKS, NULL, NULL) > + == 1) > +#endif > + { > pr_print(num); > fflush(stdout); > return; I would suggest restructing this by having a compat shim for the 3.0 API at the top of the file (something like this): #if OPENSSL_VERSION_NUMBER < 0x30000000L #define PRIME_CHECKS 5 static int BN_check_prime(const BIGNUM *p, BN_CTX *ctx, BN_GENCB *cb) { return (BN_is_prime_ex(p, PRIME_CHECKS, ctx, cb)); } #endif And then just using BN_check_prime in the rest of the file without #ifdef's. This is the approach we used for OpenSSL 1.1.x and will result in fewer #ifdef's and cleaner code overall. One thing we didn't do for OpenSSL 1.1.x but could choose to do in this case is to define a header with these shims that could be shared to reduce the work needed to update programs to move away from APIs deprecated in 3.0. -- John Baldwin From nobody Sat May 27 19:24:26 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QTBYk3p0cz4VCFb; Sat, 27 May 2023 19:24: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 4QTBYk3HmYz49cT; Sat, 27 May 2023 19:24:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685215466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hYAb7yiCnQDXvGsBPKGKIGLWpdiaxJl4d+eOLWBa9Wg=; b=Yfz+X1hom8ApbXBHFWqmePKE0orBLT9F/hgen/ASfoEjqTP+er7xAd7lMSu1+/Sok18tz3 llwI9MGJiarRy4SWrD7YnqHipBxWJ2NasIpRvJaBlviseoxh5N6EJhuiJYqEX4qsp95Vld /UcoEFWlq3r6qQ42SbQ+oChUnlohoh4N5jGqOiJsjdamAjny8fKu+oCON67Qh7YYhdUOYy jh9B5Tq3mJxLsL9mSkV6peCu/KZ/Lfr8jK4Eqn/PKJV195PT+aBzb7eypWa80bE8lWLn2i xX2oLLi6wxNBIMaUIt8kzZEhoewi3tuWSpk5bQAPdhS0LfEfjQDjhVsXugDjSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685215466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hYAb7yiCnQDXvGsBPKGKIGLWpdiaxJl4d+eOLWBa9Wg=; b=euAr96JVWHC1upt6tayGLVQE4kvMy1rKvaJIFIeihRLXlGRO5z9EAmMsAW7eBZzhgOv6op vdy/gRHGqlX4XDY2iIgenyMoMFVCVo2Xgg9eZxKXV+FmrpLtaPDaW5/LjA/dwXAK1YSzLK r6z6SMsC5h1dw+EB1mjZgTduQhKpDOiCu3MeeKtxhKeN4/pd3y1nh6rwEBvjWsk/JW+n9O Ap0Z4MIp7E9yryAxK0WxrwO/gC4TqY1YyM/YWiPd737lEANOTVurVSrjM+0I9ARTzZ48xP IfgS7YqrqQvxf+XSxRI+tQavlsBjIQbYvUqELMelhx2YKFV6rcAGv5CO1F5sKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685215466; a=rsa-sha256; cv=none; b=LlF83F7sJZX3LeCHmGDdh+Y9PmieTa/ZbBV+Y9kpgvS8wlPBYvr3bjG1SDw5y8vm+DD6Y9 ePmBLvcCx5ctlDdFJLCpDSGHt0gXxq9uaKzzfh99LNH3YdP5Nd82l9WeQWlC7+iE17VNzF Ajf5ozhgvjK/T8J5pytYCm+GGZ36ruSV85Glmpz2exrM51axiEvmYzqLCRL8HpR6Wu2FJ6 +Ntt8AHwRF7p4fan1El9ZJ5/zlY0+xhMmmbigUGdWOX6YChAiHNtZdf2kitk9c+urGX/eX aEl6RKvcqmrbqFOW0A8WH7g/c7TCTU4IFgU9kvApJFqUiMQlf/aWZjEq4Vj1lA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QTBYk26DXz1199; Sat, 27 May 2023 19:24: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 34RJOQo4012172; Sat, 27 May 2023 19:24:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34RJOQtn012171; Sat, 27 May 2023 19:24:26 GMT (envelope-from git) Date: Sat, 27 May 2023 19:24:26 GMT Message-Id: <202305271924.34RJOQtn012171@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: c79a1416955a - main - Updates to UFS/FFS superblock integrity checks when reading a superblock. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c79a1416955a260424a5dd2013b114ff864bc926 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=c79a1416955a260424a5dd2013b114ff864bc926 commit c79a1416955a260424a5dd2013b114ff864bc926 Author: Kirk McKusick AuthorDate: 2023-05-27 19:23:39 +0000 Commit: Kirk McKusick CommitDate: 2023-05-27 19:24:11 +0000 Updates to UFS/FFS superblock integrity checks when reading a superblock. Verify that the summary information does not extend past the end of the filesystem. No legitimate superblocks should fail as a result of these changes. Reported-by: Robert Morris PR: 271351 MFC-after: 1 week Sponsored-by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_subr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index 5b4ad96f4638..3959c3a7008b 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -443,7 +443,8 @@ validate_sblock(struct fs *fs, int flags) FCHK(fs->fs_csaddr, <, 0, %jd); FCHK(fs->fs_cssize, !=, fragroundup(fs, fs->fs_ncg * sizeof(struct csum)), %jd); - FCHK(dtog(fs, fs->fs_csaddr), >, fs->fs_ncg, %jd); + FCHK(fs->fs_csaddr + howmany(fs->fs_cssize, fs->fs_fsize), >, + fs->fs_size, %jd); FCHK(fs->fs_csaddr, <, cgdmin(fs, dtog(fs, fs->fs_csaddr)), %jd); FCHK(dtog(fs, fs->fs_csaddr + howmany(fs->fs_cssize, @@ -594,7 +595,8 @@ validate_sblock(struct fs *fs, int flags) FCHK(fs->fs_csaddr, <, 0, %jd); FCHK(fs->fs_cssize, !=, fragroundup(fs, fs->fs_ncg * sizeof(struct csum)), %jd); - FCHK(dtog(fs, fs->fs_csaddr), >, fs->fs_ncg, %jd); + FCHK(fs->fs_csaddr + howmany(fs->fs_cssize, fs->fs_fsize), >, + fs->fs_size, %jd); FCHK(fs->fs_csaddr, <, cgdmin(fs, dtog(fs, fs->fs_csaddr)), %jd); FCHK(dtog(fs, fs->fs_csaddr + howmany(fs->fs_cssize, fs->fs_fsize)), >, dtog(fs, fs->fs_csaddr), %jd); From nobody Sat May 27 19:35:19 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QTBpM60q3z4WhYp; Sat, 27 May 2023 19:35:23 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from kaskal.pair.com (kaskal.pair.com [209.68.5.173]) (using TLSv1.3 with cipher TLS_AES_256_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 4QTBpM4LzGz4F9B; Sat, 27 May 2023 19:35:23 +0000 (UTC) (envelope-from pho@FreeBSD.org) Authentication-Results: mx1.freebsd.org; none Received: from kaskal.pair.com (localhost [127.0.0.1]) by kaskal.pair.com (Postfix) with ESMTP id EC1B0D6572A; Sat, 27 May 2023 15:35:22 -0400 (EDT) Received: from Peters-MacBook-Air.local (unknown [IPv6:2a01:cb10:8542:a600:b451:c8cb:7e32:ba9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by kaskal.pair.com (Postfix) with ESMTPSA id 39F41D8D42D; Sat, 27 May 2023 15:35:22 -0400 (EDT) Date: Sat, 27 May 2023 21:35:19 +0200 From: Peter Holm To: Enji Cooper Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: acfb06062a68 - main - stress2: Fix warnings Message-ID: References: <202305270835.34R8ZA3g041896@gitrepo.freebsd.org> <41908493-F312-4BA2-A72B-B3C047656CCC@gmail.com> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41908493-F312-4BA2-A72B-B3C047656CCC@gmail.com> X-Scanned-By: mailmunge 3.11 on 209.68.5.173 X-Rspamd-Queue-Id: 4QTBpM4LzGz4F9B X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:7859, ipnet:209.68.0.0/18, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Sat, May 27, 2023 at 11:10:23AM -0700, Enji Cooper wrote: > > > On May 27, 2023, at 1:35 AM, Peter Holm wrote: > > > > The branch main has been updated by pho: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=acfb06062a6862f7c823242243e68f7bcaf29999 > > > > commit acfb06062a6862f7c823242243e68f7bcaf29999 > > Author: Peter Holm > > AuthorDate: 2023-05-27 08:31:00 +0000 > > Commit: Peter Holm > > CommitDate: 2023-05-27 08:31:00 +0000 > > > > stress2: Fix warnings > > It seems like `n` could be removed in all of the sample programs. > Cheers, > -Enji > Both 'n' and 'm' are used if DEBUG is defined. [pho@mercat1 /usr/src/tools/test/stress2/misc]$ ./reaper2.sh n = 19779 out of 56033 n = 20099 out of 56319 n = 20121 out of 56406 : - Peter From nobody Sat May 27 20:55:23 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QTDZy5Nlvz4Wmg6; Sat, 27 May 2023 20:55:38 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QTDZx39d5z4Kvl; Sat, 27 May 2023 20:55:37 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1ae8ecb4f9aso12920815ad.1; Sat, 27 May 2023 13:55:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685220936; x=1687812936; h=to:references:message-id:cc:date:in-reply-to:from:subject :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Cxx9RYk2Hkxs7Lv0ki2wEc2NwotpQT8brUEctZUo2d0=; b=JPD1eCMytsupY97nljmvWUtzpW8FUN8mcsCaVZSTvR4rpgLM3XG0PWoLbSFt2E9rGo bTLxCjogJmuGRxz5scDykNiXKzak7a/e/E0w4+vxw2s4gzAseAt8VYPwyuLOJqXj8Zw3 hawV6/M6FGG4sSGwwCwv8VQ9eTSHJDo3c6jE5DFfyjKY1VpnL5CeCK38GWPEnAZC39Lp q/WxxKu0jz0r0ncvQz7Ken5eJ00DWwP9XvbqWh8zKY1ObV8tmgKB2oqR0m4yxvFmDUZ2 hI1UmcdqdPWHjRtTS0FZYz/f2sK4t6lsBxL/0MWPpGvubVNoHxj4AUT2SvURhkO/c5DM i0gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685220936; x=1687812936; h=to:references:message-id:cc:date:in-reply-to:from:subject :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Cxx9RYk2Hkxs7Lv0ki2wEc2NwotpQT8brUEctZUo2d0=; b=e254khx8IXp64Cymje+Sy3GtiY3EeO11g6qoPGqanDwEhJlqyEr4X/6EF126nNi3tM gEY2J6Qnos1E0PCNhVldLfa3bGdnc6Zta9xospFL8rIa+JK9J2uJjvgCvsuOPYuAX5sf FhVq4x/3L9Tu2YbUo3K3PnpLQq6/CQTHD7u/f4k7o1uqVxNpq9J1s5P9x5ZBXPx90HCK X65yp/hK19DhwFMNfsfnddWq5aRAsrWo1WdtvcChhpHn9aeu5XoK/q7YNkiBUllGWjEQ 3e/vCciVD0ytLezQcpSf//OFI6zE1DXX95HYS0z4LOZesdh6UxE30wtxGypRffUNELzE ZN7w== X-Gm-Message-State: AC+VfDw9A/UMLHFqvjiWt/ORvXa4a4vljHcKydf34vz6Kpz1tUsDAvfw RaQsogp+nzck5jiZIMfqJwCNzmHAMidopQ== X-Google-Smtp-Source: ACHHUZ4Z20ZVZGRwrYNNAd85negWE+5VXMDlyecOMxNnX8VdDz2bPjYcA96nzXo11B0HfQjH04Ltvw== X-Received: by 2002:a17:902:f64e:b0:1ae:626b:475f with SMTP id m14-20020a170902f64e00b001ae626b475fmr7243723plg.12.1685220935398; Sat, 27 May 2023 13:55:35 -0700 (PDT) Received: from smtpclient.apple (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id k18-20020a170902761200b001aaeba5ce0fsm5309225pll.68.2023.05.27.13.55.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 May 2023 13:55:34 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_0D323EFD-8A98-495C-B40D-404F90AA91D8"; protocol="application/pgp-signature"; micalg=pgp-sha256 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: git: acfb06062a68 - main - stress2: Fix warnings From: Enji Cooper In-Reply-To: Date: Sat, 27 May 2023 13:55:23 -0700 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Message-Id: <605A888E-8907-4B20-8922-86511E383377@gmail.com> References: <202305270835.34R8ZA3g041896@gitrepo.freebsd.org> <41908493-F312-4BA2-A72B-B3C047656CCC@gmail.com> To: Peter Holm X-Mailer: Apple Mail (2.3731.500.231) X-Rspamd-Queue-Id: 4QTDZx39d5z4Kvl X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_0D323EFD-8A98-495C-B40D-404F90AA91D8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On May 27, 2023, at 12:35 PM, Peter Holm wrote: >=20 > On Sat, May 27, 2023 at 11:10:23AM -0700, Enji Cooper wrote: >>=20 >>> On May 27, 2023, at 1:35 AM, Peter Holm wrote: >>>=20 >>> The branch main has been updated by pho: >>>=20 >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dacfb06062a6862f7c823242243e68f7b= caf29999 >>>=20 >>> commit acfb06062a6862f7c823242243e68f7bcaf29999 >>> Author: Peter Holm >>> AuthorDate: 2023-05-27 08:31:00 +0000 >>> Commit: Peter Holm >>> CommitDate: 2023-05-27 08:31:00 +0000 >>>=20 >>> stress2: Fix warnings >>=20 >> It seems like `n` could be removed in all of the sample programs. >> Cheers, >> -Enji >>=20 >=20 > Both 'n' and 'm' are used if DEBUG is defined. >=20 > [pho@mercat1 /usr/src/tools/test/stress2/misc]$ ./reaper2.sh > n =3D 19779 out of 56033 > n =3D 20099 out of 56319 > n =3D 20121 out of 56406 I see. Maybe the variables should only be declared/defined in the DEBUG = case? Right now __unused kind of sends the wrong message to the = developer and to the compiler (potentially). Cheers, -Enji --Apple-Mail=_0D323EFD-8A98-495C-B40D-404F90AA91D8 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----- iQIzBAEBCAAdFiEEtvtxN6kOllEF3nmX5JFNMZeDGN4FAmRybjsACgkQ5JFNMZeD GN6A4A/8CenQCNZ/OD8t3LOmZi+roaXqzkz6L+7MSOgnQB6VTR9Yyronu3HM3swj bqMJXd0Us9wFvcCbVZyNuN2D92dju6s2fx6GjrgvUwN29XkKU7f711maxeG/r7wS y/aZSHwOQqksbNHtpKhcHs6KQO2zeDfDIIxBMRdnDeDqBRzvBQoo3WHa2eBuojIb AkA2ig27tA3a11Vh5kHjJYs/KdOs/3HipFmrHOfaFE2MN8P4hO8bl6BhNs/n+Tc7 oxVg1nLE7zcK3F2mdeob4uDuaPSs4aEfLzcXkDOtFKoeB5pufalk/H7+RMCm3trZ RkyBDbgqybQz88nXXDw+554tRsukR3GZbgTt2NEf/zv+lM05vVE/OYfQBJtnHMWY b3huUgGowqJBeEjYY+5TQpA7u35QUwBDtsVdF5vtkcPjHnSAT7fPOXzM62A7biEK van0VhfELp4dBU7RXyihkpkWN7ivYNYt8U8144eOK+1DdxiT3GFqgrA03A0sF3p8 i031UmCAFHMT1PAF71JGirbm3Vb8q6MtYZAaotKNGv9ibksliET283rxE2n1Qcjf aCrUrXmI1vGHJ05n7NDb6BDy4aYuZG7Hb8lHfBmwYwJn4WOdoO0xPGciKLep6OGR m8urjvogqJyn4LhGBLrEXLhwLEgKK5iRN9vcn6aT8gapUEseEkI= =lXGo -----END PGP SIGNATURE----- --Apple-Mail=_0D323EFD-8A98-495C-B40D-404F90AA91D8-- From nobody Sat May 27 20:58:16 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QTDf90MYGz4Wn1T; Sat, 27 May 2023 20:58:25 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Received: from heemeyer.club (heemeyer.club [195.93.173.158]) (using TLSv1.3 with cipher TLS_AES_256_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 4QTDf83Xg7z4Lbb; Sat, 27 May 2023 20:58:24 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Authentication-Results: mx1.freebsd.org; none Received: from heemeyer.club (localhost [127.0.0.1]) by heemeyer.club (8.17.1/8.16.1) with ESMTP id 34RKwGJ0052970; Sat, 27 May 2023 23:58:16 +0300 (MSK) (envelope-from dchagin@heemeyer.club) Received: (from dchagin@localhost) by heemeyer.club (8.17.1/8.16.1/Submit) id 34RKwGa4052969; Sat, 27 May 2023 23:58:16 +0300 (MSK) (envelope-from dchagin) Date: Sat, 27 May 2023 23:58:16 +0300 From: Dmitry Chagin To: Enji Cooper Cc: Peter Holm , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: acfb06062a68 - main - stress2: Fix warnings Message-ID: References: <202305270835.34R8ZA3g041896@gitrepo.freebsd.org> <41908493-F312-4BA2-A72B-B3C047656CCC@gmail.com> <605A888E-8907-4B20-8922-86511E383377@gmail.com> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <605A888E-8907-4B20-8922-86511E383377@gmail.com> X-Rspamd-Queue-Id: 4QTDf83Xg7z4Lbb X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:61400, ipnet:195.93.173.0/24, country:RU] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Sat, May 27, 2023 at 01:55:23PM -0700, Enji Cooper wrote: > > > On May 27, 2023, at 12:35 PM, Peter Holm wrote: > > > > On Sat, May 27, 2023 at 11:10:23AM -0700, Enji Cooper wrote: > >> > >>> On May 27, 2023, at 1:35 AM, Peter Holm wrote: > >>> > >>> The branch main has been updated by pho: > >>> > >>> URL: https://cgit.FreeBSD.org/src/commit/?id=acfb06062a6862f7c823242243e68f7bcaf29999 > >>> > >>> commit acfb06062a6862f7c823242243e68f7bcaf29999 > >>> Author: Peter Holm > >>> AuthorDate: 2023-05-27 08:31:00 +0000 > >>> Commit: Peter Holm > >>> CommitDate: 2023-05-27 08:31:00 +0000 > >>> > >>> stress2: Fix warnings > >> > >> It seems like `n` could be removed in all of the sample programs. > >> Cheers, > >> -Enji > >> > > > > Both 'n' and 'm' are used if DEBUG is defined. > > > > [pho@mercat1 /usr/src/tools/test/stress2/misc]$ ./reaper2.sh > > n = 19779 out of 56033 > > n = 20099 out of 56319 > > n = 20121 out of 56406 > > I see. Maybe the variables should only be declared/defined in the DEBUG case? Right now __unused kind of sends the wrong message to the developer and to the compiler (potentially). __diagused > Cheers, > -Enji > From nobody Sat May 27 21:16:21 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QTF380jx3z4WnkG; Sat, 27 May 2023 21:16:36 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QTF3761lNz4NPy; Sat, 27 May 2023 21:16:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-5346d150972so1778808a12.3; Sat, 27 May 2023 14:16:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685222194; x=1687814194; h=to:references:message-id:cc:date:in-reply-to:from:subject :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=rWpjTtqlKWsosw7yLVovRnR9Qo2VoKAZgvSIW6LF4Rw=; b=agj8CA/ZPdWZLvVip6YemF3vlpThyxkkVnOaLJ7Dh4LSap1d8xCIxsNqQYtb3xsn3y fhMj3iwlRD34yNZrSBzhpAFe7e2Dl4vL3ILdTpCuvVp5mQKXMaPcojHjiWm6WBxeBERY g8Evehi/zHzxXSXrkgg4yPvlHqwlYqtPJ5sHxFe+7buLCV3HeXfmBIB8kU7jjRska53G lF4KxfQfU7wUO7ve3veglyUvRdV2iTTmU9GhvBUKpNUJJ3SByRfapNjNwsUY3DunEf5+ 28mx9V1ev/p8XOtoRz0ULzO6bmDOquEQew1uU+7cAyywgbesG5BoWs8n6pJDk2ax3Bai iGCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685222194; x=1687814194; h=to:references:message-id:cc:date:in-reply-to:from:subject :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rWpjTtqlKWsosw7yLVovRnR9Qo2VoKAZgvSIW6LF4Rw=; b=IML8VKdTzWziPDlJMpEHKOfRcxsZm6IvVnHigVW/2QYMi9p9UlB1BSOai6nqLAvBiT +O/qXjdGa1QtRqpAOGhQZCEbSSNNjm81HQKtkLv4fBE+uSvjaMj3YnoGv4J6iwdu4t55 ngHd6CvFEeUeITqC2c1c/InCgUKXO3/VdoryKrPNnQT8sr09iZTNn7bEZ3fhdpUIYfEY wZFpB5HNePouDcgbqY/lq7VJwukrodT7D6SOpy4J1gPkGT8TfGAyRAo2R0COM8PpJBtP wlY5Ad5ftENuvcJPHx2oM7gyetbg7eX7UUSMwABgdD6EQEQajiD+u26HpuuyCc0v3JVj xyzA== X-Gm-Message-State: AC+VfDzBPTNuXZZn7OcpORNROUm+y1LkdRvKmnsZ7vuRy/7noeaO5nS2 IJuGCFT1CJO+3idyMhSiI4oNI9RCWn03AA== X-Google-Smtp-Source: ACHHUZ7kZdqpHxp3AdJG4hi5BLnLUiNTk5Jny4mYrAWx1o3Jrsv3Akd7Uugs/JLgDg0ePzVz94f4VA== X-Received: by 2002:a17:90a:c704:b0:250:69c7:a95e with SMTP id o4-20020a17090ac70400b0025069c7a95emr6073397pjt.48.1685222193517; Sat, 27 May 2023 14:16:33 -0700 (PDT) Received: from smtpclient.apple (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id i6-20020a17090aee8600b002566caf4466sm80851pjz.24.2023.05.27.14.16.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 May 2023 14:16:33 -0700 (PDT) Content-Type: multipart/signed; boundary="Apple-Mail=_736430BD-4CA6-48CB-8F24-727A6A6C6C83"; protocol="application/pgp-signature"; micalg=pgp-sha256 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: git: 537cd766435c - main - factor: support OpenSSL 3 From: Enji Cooper In-Reply-To: <626f675b-f304-b772-61a4-0a92283ac348@FreeBSD.org> Date: Sat, 27 May 2023 14:16:21 -0700 Cc: Enji Cooper , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Message-Id: <7F042D0C-F994-40A6-B5AB-4710052815DA@gmail.com> References: <202305271811.34RIBtHY093538@gitrepo.freebsd.org> <626f675b-f304-b772-61a4-0a92283ac348@FreeBSD.org> To: John Baldwin X-Mailer: Apple Mail (2.3731.500.231) X-Rspamd-Queue-Id: 4QTF3761lNz4NPy X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_736430BD-4CA6-48CB-8F24-727A6A6C6C83 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 27, 2023, at 12:21 PM, John Baldwin wrote: =E2=80=A6 > I would suggest restructing this by having a compat shim for the 3.0 = API at > the top of the file (something like this): >=20 > #if OPENSSL_VERSION_NUMBER < 0x30000000L > #define PRIME_CHECKS 5 >=20 > static int > BN_check_prime(const BIGNUM *p, BN_CTX *ctx, BN_GENCB *cb) > { > return (BN_is_prime_ex(p, PRIME_CHECKS, ctx, cb)); > } > #endif >=20 > And then just using BN_check_prime in the rest of the file without = #ifdef's. >=20 > This is the approach we used for OpenSSL 1.1.x and will result in = fewer #ifdef's > and cleaner code overall. One thing we didn't do for OpenSSL 1.1.x = but could > choose to do in this case is to define a header with these shims that = could be > shared to reduce the work needed to update programs to move away from = APIs > deprecated in 3.0. That=E2=80=99s a really fair point. I opened up = https://reviews.freebsd.org/D40305 to track the suggested updates to use = a compat function for pre-3.0. Cheers, -Enji --Apple-Mail=_736430BD-4CA6-48CB-8F24-727A6A6C6C83 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----- iQIzBAEBCAAdFiEEtvtxN6kOllEF3nmX5JFNMZeDGN4FAmRycyUACgkQ5JFNMZeD GN5OkxAAhzG3uUStzaUFSYfkyf3vlYKWKigxAuI1gStU4hTMvbsQImLzgquKiJEG eO3xYPJ7RJc6TppSofFEqdGHR7I1bM0P/aBZ6eMt2Eq30sJEELuhqGc3eJztcD+b GDdCSC+5El59HL2uaHX5O6cM3I5OAJCNdoUehVTBmhE656FqyV1MTp+TtnA5MwN6 XgDfv/d0iFSoXfCGwWLGHbJFyHKg/g5CmaAaqmkDvABH3HPHvSeV7mNfiLHb6E2T jmILX7Wmxfe1fJHkQdraN+IfqAHUs/AHpAeul+d941xMmqv0DVOMoCX6k6lvhS3J wieSfz4ZT6a9jx2rT0h1rB1TjJ8TWoQfVAq10Cn4Z/52N0X1xfTQstIi+cp+pbMV VyK73CiqAqsqTfTcH8EdK7ZbctVh7XBD00Tu7EwuvpqSpptoEFisO+iM/TCsB5cN 7bvyiaV/BmEnanE71hff2kT8XxomDaSE5XM//eY1wOPaR7gkwmE0DY8K+ZjBqYvN 8V1yCZo1ST2UUzaRi300FUXEa0CrOluZPHe4qlQulL0KiauyQxEIZiN8SYqxCHOq KlTwnSpTppVRCN3F8uAwGPVTXIRU+/rCU2R6TxGFxVV1z1p8uhiBpasBonNOdKn9 wBcDvkgYk6eSi7/d909QE5jpc9koe8BhP/cb0hlGGG128N4xDgQ= =Dxup -----END PGP SIGNATURE----- --Apple-Mail=_736430BD-4CA6-48CB-8F24-727A6A6C6C83--