From owner-svn-src-head@freebsd.org Sun Jul 26 00:45:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD8853764D3; Sun, 26 Jul 2020 00:45:02 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDkjp5WBJz3cLb; Sun, 26 Jul 2020 00:45:02 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 863C82437E; Sun, 26 Jul 2020 00:45:02 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06Q0j27m076617; Sun, 26 Jul 2020 00:45:02 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06Q0j0M7076605; Sun, 26 Jul 2020 00:45:00 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202007260045.06Q0j0M7076605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 26 Jul 2020 00:45:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363537 - head/sys/geom/label X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sys/geom/label X-SVN-Commit-Revision: 363537 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 00:45:02 -0000 Author: delphij Date: Sun Jul 26 00:44:59 2020 New Revision: 363537 URL: https://svnweb.freebsd.org/changeset/base/363537 Log: geom_label: Make glabel labels more trivial by separating the tasting routines out. While there, also simplify the creation of label paths a little bit by requiring the / suffix for label directory prefixes (ld_dir renamed to ld_dirprefix to indicate the change) and stop defining macros for these when they are only used once. Reviewed by: cem MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25597 Modified: head/sys/geom/label/g_label.c head/sys/geom/label/g_label.h head/sys/geom/label/g_label_disk_ident.c head/sys/geom/label/g_label_ext2fs.c head/sys/geom/label/g_label_flashmap.c head/sys/geom/label/g_label_gpt.c head/sys/geom/label/g_label_iso9660.c head/sys/geom/label/g_label_msdosfs.c head/sys/geom/label/g_label_ntfs.c head/sys/geom/label/g_label_reiserfs.c head/sys/geom/label/g_label_ufs.c Modified: head/sys/geom/label/g_label.c ============================================================================== --- head/sys/geom/label/g_label.c Sat Jul 25 23:08:51 2020 (r363536) +++ head/sys/geom/label/g_label.c Sun Jul 26 00:44:59 2020 (r363537) @@ -63,9 +63,12 @@ static int g_label_destroy_geom(struct gctl_req *req, static int g_label_destroy(struct g_geom *gp, boolean_t force); static struct g_geom *g_label_taste(struct g_class *mp, struct g_provider *pp, int flags __unused); +static void g_label_generic_taste(struct g_consumer *, char *, size_t); static void g_label_config(struct gctl_req *req, struct g_class *mp, const char *verb); +#define G_LABEL_DIRPREFIX "label/" + struct g_class g_label_class = { .name = G_LABEL_CLASS_NAME, .version = G_VERSION, @@ -74,6 +77,12 @@ struct g_class g_label_class = { .destroy_geom = g_label_destroy_geom }; +static struct g_label_desc g_label_generic = { + .ld_taste = g_label_generic_taste, + .ld_dirprefix = G_LABEL_DIRPREFIX, + .ld_enabled = 1 +}; + /* * To add a new file system where you want to look for volume labels, * you have to: @@ -99,6 +108,7 @@ const struct g_label_desc *g_labels[] = { &g_label_disk_ident, &g_label_flashmap, #endif + &g_label_generic, NULL }; @@ -213,7 +223,7 @@ g_label_mangle_name(char *label, size_t size) static struct g_geom * g_label_create(struct gctl_req *req, struct g_class *mp, struct g_provider *pp, - const char *label, const char *dir, off_t mediasize) + const char *label, const char *dirprefix, off_t mediasize) { struct g_geom *gp; struct g_provider *pp2; @@ -232,7 +242,7 @@ g_label_create(struct gctl_req *req, struct g_class *m } gp = NULL; cp = NULL; - if (snprintf(name, sizeof(name), "%s/%s", dir, label) >= sizeof(name)) { + if (snprintf(name, sizeof(name), "%s%s", dirprefix, label) >= sizeof(name)) { if (req != NULL) gctl_error(req, "Label name %s is too long.", label); return (NULL); @@ -300,13 +310,9 @@ g_label_read_metadata(struct g_consumer *cp, struct g_ u_char *buf; int error; - g_topology_assert(); - pp = cp->provider; - g_topology_unlock(); buf = g_read_data(cp, pp->mediasize - pp->sectorsize, pp->sectorsize, &error); - g_topology_lock(); if (buf == NULL) return (error); /* Decode metadata. */ @@ -339,12 +345,43 @@ g_label_access_taste(struct g_provider *pp __unused, i return (EOPNOTSUPP); } +static void +g_label_generic_taste(struct g_consumer *cp, char *label, size_t size) +{ + struct g_provider *pp; + struct g_label_metadata md; + + g_topology_assert_not(); + label[0] = '\0'; + pp = cp->provider; + + if (g_label_read_metadata(cp, &md) != 0) + return; + + if (strcmp(md.md_magic, G_LABEL_MAGIC) != 0) + return; + + if (md.md_version > G_LABEL_VERSION) { + printf("geom_label.ko module is too old to handle %s.\n", + pp->name); + return; + } + /* + * Backward compatibility: there was no md_provsize field in + * earlier versions of metadata, so only check if we have it. + */ + if (md.md_version >= 2 && md.md_provsize != pp->mediasize) + return; + + strlcpy(label, md.md_label, size); +} + static struct g_geom * g_label_taste(struct g_class *mp, struct g_provider *pp, int flags __unused) { - struct g_label_metadata md; struct g_consumer *cp; struct g_geom *gp; + off_t mediasize; int i; g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name); @@ -367,33 +404,6 @@ g_label_taste(struct g_class *mp, struct g_provider *p g_attach(cp, pp); if (g_access(cp, 1, 0, 0) != 0) goto end; - do { - if (g_label_read_metadata(cp, &md) != 0) - break; - if (strcmp(md.md_magic, G_LABEL_MAGIC) != 0) - break; - if (md.md_version > G_LABEL_VERSION) { - printf("geom_label.ko module is too old to handle %s.\n", - pp->name); - break; - } - - /* - * Backward compatibility: - */ - /* - * There was no md_provsize field in earlier versions of - * metadata. - */ - if (md.md_version < 2) - md.md_provsize = pp->mediasize; - - if (md.md_provsize != pp->mediasize) - break; - - g_label_create(NULL, mp, pp, md.md_label, G_LABEL_DIR, - pp->mediasize - pp->sectorsize); - } while (0); for (i = 0; g_labels[i] != NULL; i++) { char label[128]; @@ -405,8 +415,13 @@ g_label_taste(struct g_class *mp, struct g_provider *p g_topology_lock(); if (label[0] == '\0') continue; - g_label_create(NULL, mp, pp, label, g_labels[i]->ld_dir, - pp->mediasize); + if (g_labels[i] != &g_label_generic) { + mediasize = pp->mediasize; + } else { + mediasize = pp->mediasize - pp->sectorsize; + } + g_label_create(NULL, mp, pp, label, + g_labels[i]->ld_dirprefix, mediasize); } g_access(cp, -1, 0, 0); end: @@ -448,23 +463,20 @@ g_label_ctl_create(struct gctl_req *req, struct g_clas gctl_error(req, "No 'arg%d' argument", 0); return; } - g_label_create(req, mp, pp, name, G_LABEL_DIR, pp->mediasize); + g_label_create(req, mp, pp, name, G_LABEL_DIRPREFIX, pp->mediasize); } static const char * g_label_skip_dir(const char *name) { - char path[64]; u_int i; if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) name += strlen(_PATH_DEV); - if (strncmp(name, G_LABEL_DIR "/", strlen(G_LABEL_DIR "/")) == 0) - name += strlen(G_LABEL_DIR "/"); for (i = 0; g_labels[i] != NULL; i++) { - snprintf(path, sizeof(path), "%s/", g_labels[i]->ld_dir); - if (strncmp(name, path, strlen(path)) == 0) { - name += strlen(path); + if (strncmp(name, g_labels[i]->ld_dirprefix, + strlen(g_labels[i]->ld_dirprefix)) == 0) { + name += strlen(g_labels[i]->ld_dirprefix); break; } } Modified: head/sys/geom/label/g_label.h ============================================================================== --- head/sys/geom/label/g_label.h Sat Jul 25 23:08:51 2020 (r363536) +++ head/sys/geom/label/g_label.h Sun Jul 26 00:44:59 2020 (r363537) @@ -45,7 +45,6 @@ * 2 - Added md_provsize field to metadata. */ #define G_LABEL_VERSION 2 -#define G_LABEL_DIR "label" #ifdef _KERNEL extern u_int g_label_debug; @@ -66,7 +65,7 @@ typedef void g_label_taste_t (struct g_consumer *cp, c struct g_label_desc { g_label_taste_t *ld_taste; - char *ld_dir; + char *ld_dirprefix; int ld_enabled; }; Modified: head/sys/geom/label/g_label_disk_ident.c ============================================================================== --- head/sys/geom/label/g_label_disk_ident.c Sat Jul 25 23:08:51 2020 (r363536) +++ head/sys/geom/label/g_label_disk_ident.c Sun Jul 26 00:44:59 2020 (r363537) @@ -40,8 +40,6 @@ __FBSDID("$FreeBSD$"); #include -#define G_LABEL_DISK_IDENT_DIR "diskid" - static char* classes_pass[] = { G_DISK_CLASS_NAME, G_MULTIPATH_CLASS_NAME, NULL }; @@ -82,7 +80,7 @@ g_label_disk_ident_taste(struct g_consumer *cp, char * struct g_label_desc g_label_disk_ident = { .ld_taste = g_label_disk_ident_taste, - .ld_dir = G_LABEL_DISK_IDENT_DIR, + .ld_dirprefix = "diskid/", .ld_enabled = 1 }; Modified: head/sys/geom/label/g_label_ext2fs.c ============================================================================== --- head/sys/geom/label/g_label_ext2fs.c Sat Jul 25 23:08:51 2020 (r363536) +++ head/sys/geom/label/g_label_ext2fs.c Sun Jul 26 00:44:59 2020 (r363537) @@ -97,7 +97,7 @@ exit_free: struct g_label_desc g_label_ext2fs = { .ld_taste = g_label_ext2fs_taste, - .ld_dir = "ext2fs", + .ld_dirprefix = "ext2fs/", .ld_enabled = 1 }; Modified: head/sys/geom/label/g_label_flashmap.c ============================================================================== --- head/sys/geom/label/g_label_flashmap.c Sat Jul 25 23:08:51 2020 (r363536) +++ head/sys/geom/label/g_label_flashmap.c Sun Jul 26 00:44:59 2020 (r363537) @@ -39,8 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define G_LABEL_FLASHMAP_SLICE_DIR "flash" - static void g_label_flashmap_taste(struct g_consumer *cp, char *label, size_t size) { @@ -70,7 +68,7 @@ g_label_flashmap_taste(struct g_consumer *cp, char *la struct g_label_desc g_label_flashmap = { .ld_taste = g_label_flashmap_taste, - .ld_dir = G_LABEL_FLASHMAP_SLICE_DIR, + .ld_dirprefix = "flash/", .ld_enabled = 1 }; Modified: head/sys/geom/label/g_label_gpt.c ============================================================================== --- head/sys/geom/label/g_label_gpt.c Sat Jul 25 23:08:51 2020 (r363536) +++ head/sys/geom/label/g_label_gpt.c Sun Jul 26 00:44:59 2020 (r363537) @@ -44,9 +44,6 @@ __FBSDID("$FreeBSD$"); #define PART_CLASS_NAME "PART" #define SCHEME_NAME "GPT" -#define G_LABEL_GPT_VOLUME_DIR "gpt" -#define G_LABEL_GPT_ID_DIR "gptid" - /* XXX: Also defined in geom/part/g_part_gpt.c */ struct g_part_gpt_entry { struct g_part_entry base; @@ -158,13 +155,13 @@ g_label_gpt_uuid_taste(struct g_consumer *cp, char *la struct g_label_desc g_label_gpt = { .ld_taste = g_label_gpt_taste, - .ld_dir = G_LABEL_GPT_VOLUME_DIR, + .ld_dirprefix = "gpt/", .ld_enabled = 1 }; struct g_label_desc g_label_gpt_uuid = { .ld_taste = g_label_gpt_uuid_taste, - .ld_dir = G_LABEL_GPT_ID_DIR, + .ld_dirprefix = "gptid/", .ld_enabled = 1 }; Modified: head/sys/geom/label/g_label_iso9660.c ============================================================================== --- head/sys/geom/label/g_label_iso9660.c Sat Jul 25 23:08:51 2020 (r363536) +++ head/sys/geom/label/g_label_iso9660.c Sun Jul 26 00:44:59 2020 (r363537) @@ -38,8 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define G_LABEL_ISO9660_DIR "iso9660" - #define ISO9660_MAGIC "\x01" "CD001" "\x01\x00" #define ISO9660_OFFSET 0x8000 #define VOLUME_LEN 32 @@ -75,7 +73,7 @@ g_label_iso9660_taste(struct g_consumer *cp, char *lab struct g_label_desc g_label_iso9660 = { .ld_taste = g_label_iso9660_taste, - .ld_dir = G_LABEL_ISO9660_DIR, + .ld_dirprefix = "iso9660/", .ld_enabled = 1 }; Modified: head/sys/geom/label/g_label_msdosfs.c ============================================================================== --- head/sys/geom/label/g_label_msdosfs.c Sat Jul 25 23:08:51 2020 (r363536) +++ head/sys/geom/label/g_label_msdosfs.c Sun Jul 26 00:44:59 2020 (r363537) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define G_LABEL_MSDOSFS_DIR "msdosfs" #define LABEL_NO_NAME "NO NAME " static void @@ -213,7 +212,7 @@ error: struct g_label_desc g_label_msdosfs = { .ld_taste = g_label_msdosfs_taste, - .ld_dir = G_LABEL_MSDOSFS_DIR, + .ld_dirprefix = "msdosfs/", .ld_enabled = 1 }; Modified: head/sys/geom/label/g_label_ntfs.c ============================================================================== --- head/sys/geom/label/g_label_ntfs.c Sat Jul 25 23:08:51 2020 (r363536) +++ head/sys/geom/label/g_label_ntfs.c Sun Jul 26 00:44:59 2020 (r363537) @@ -41,8 +41,6 @@ __FBSDID("$FreeBSD$"); #define NTFS_FILEMAGIC ((uint32_t)(0x454C4946)) #define NTFS_VOLUMEINO 3 -#define G_LABEL_NTFS_DIR "ntfs" - struct ntfs_attr { uint32_t a_type; uint32_t reclen; @@ -170,7 +168,7 @@ done: struct g_label_desc g_label_ntfs = { .ld_taste = g_label_ntfs_taste, - .ld_dir = G_LABEL_NTFS_DIR, + .ld_dirprefix = "ntfs/", .ld_enabled = 1 }; Modified: head/sys/geom/label/g_label_reiserfs.c ============================================================================== --- head/sys/geom/label/g_label_reiserfs.c Sat Jul 25 23:08:51 2020 (r363536) +++ head/sys/geom/label/g_label_reiserfs.c Sun Jul 26 00:44:59 2020 (r363537) @@ -116,7 +116,7 @@ exit_free: struct g_label_desc g_label_reiserfs = { .ld_taste = g_label_reiserfs_taste, - .ld_dir = "reiserfs", + .ld_dirprefix = "reiserfs/", .ld_enabled = 1 }; Modified: head/sys/geom/label/g_label_ufs.c ============================================================================== --- head/sys/geom/label/g_label_ufs.c Sat Jul 25 23:08:51 2020 (r363536) +++ head/sys/geom/label/g_label_ufs.c Sun Jul 26 00:44:59 2020 (r363537) @@ -45,9 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define G_LABEL_UFS_VOLUME_DIR "ufs" -#define G_LABEL_UFS_ID_DIR "ufsid" - #define G_LABEL_UFS_VOLUME 0 #define G_LABEL_UFS_ID 1 @@ -142,13 +139,13 @@ g_label_ufs_id_taste(struct g_consumer *cp, char *labe struct g_label_desc g_label_ufs_volume = { .ld_taste = g_label_ufs_volume_taste, - .ld_dir = G_LABEL_UFS_VOLUME_DIR, + .ld_dirprefix = "ufs/", .ld_enabled = 1 }; struct g_label_desc g_label_ufs_id = { .ld_taste = g_label_ufs_id_taste, - .ld_dir = G_LABEL_UFS_ID_DIR, + .ld_dirprefix = "ufsid/", .ld_enabled = 1 }; From owner-svn-src-head@freebsd.org Sun Jul 26 01:45:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D832E377DFF; Sun, 26 Jul 2020 01:45:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDm3W53kxz3gCx; Sun, 26 Jul 2020 01:45:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 918E424FD2; Sun, 26 Jul 2020 01:45:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06Q1jRM1014158; Sun, 26 Jul 2020 01:45:27 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06Q1jQKX014154; Sun, 26 Jul 2020 01:45:26 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202007260145.06Q1jQKX014154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 26 Jul 2020 01:45:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363540 - in head/sys/geom: . part virstor X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head/sys/geom: . part virstor X-SVN-Commit-Revision: 363540 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 01:45:27 -0000 Author: delphij Date: Sun Jul 26 01:45:26 2020 New Revision: 363540 URL: https://svnweb.freebsd.org/changeset/base/363540 Log: Use snprintf instead of sprintf. MFC after: 2 weeks Modified: head/sys/geom/geom_ccd.c head/sys/geom/part/g_part_vtoc8.c head/sys/geom/virstor/g_virstor.c Modified: head/sys/geom/geom_ccd.c ============================================================================== --- head/sys/geom/geom_ccd.c Sun Jul 26 01:11:30 2020 (r363539) +++ head/sys/geom/geom_ccd.c Sun Jul 26 01:45:26 2020 (r363540) @@ -771,7 +771,7 @@ g_ccd_create(struct gctl_req *req, struct g_class *mp) /* Check all providers are valid */ for (i = 0; i < *nprovider; i++) { - sprintf(buf, "provider%d", i); + snprintf(buf, sizeof(buf), "provider%d", i); pp = gctl_get_provider(req, buf); if (pp == NULL) return; @@ -788,7 +788,7 @@ g_ccd_create(struct gctl_req *req, struct g_class *mp) /* Create consumers and attach to all providers */ for (i = 0; i < *nprovider; i++) { - sprintf(buf, "provider%d", i); + snprintf(buf, sizeof(buf), "provider%d", i); pp = gctl_get_provider(req, buf); cp = g_new_consumer(gp); error = g_attach(cp, pp); Modified: head/sys/geom/part/g_part_vtoc8.c ============================================================================== --- head/sys/geom/part/g_part_vtoc8.c Sun Jul 26 01:11:30 2020 (r363539) +++ head/sys/geom/part/g_part_vtoc8.c Sun Jul 26 01:45:26 2020 (r363540) @@ -224,7 +224,8 @@ g_part_vtoc8_create(struct g_part_table *basetable, st ncyls = pcyls - acyls; msize = ncyls * table->secpercyl; - sprintf(table->vtoc.ascii, "FreeBSD%lldM cyl %u alt %u hd %u sec %u", + snprintf(table->vtoc.ascii, sizeof(table->vtoc.ascii), + "FreeBSD%lldM cyl %u alt %u hd %u sec %u", (long long)(msize / 2048), ncyls, acyls, basetable->gpt_heads, basetable->gpt_sectors); be32enc(&table->vtoc.version, VTOC_VERSION); @@ -338,7 +339,8 @@ vtoc8_set_rawsize(struct g_part_table *basetable, stru basetable->gpt_last = msize - 1; bzero(table->vtoc.ascii, sizeof(table->vtoc.ascii)); - sprintf(table->vtoc.ascii, "FreeBSD%lldM cyl %u alt %u hd %u sec %u", + snprintf(table->vtoc.ascii, sizeof(table->vtoc.ascii), + "FreeBSD%lldM cyl %u alt %u hd %u sec %u", (long long)(msize / 2048), ncyls, acyls, basetable->gpt_heads, basetable->gpt_sectors); be16enc(&table->vtoc.physcyls, pcyls); Modified: head/sys/geom/virstor/g_virstor.c ============================================================================== --- head/sys/geom/virstor/g_virstor.c Sun Jul 26 01:11:30 2020 (r363539) +++ head/sys/geom/virstor/g_virstor.c Sun Jul 26 01:45:26 2020 (r363540) @@ -227,7 +227,7 @@ virstor_ctl_stop(struct gctl_req *req, struct g_class struct g_virstor_softc *sc; int error; - sprintf(param, "arg%d", i); + snprintf(param, sizeof(param), "arg%d", i); name = gctl_get_asciiparam(req, param); if (name == NULL) { gctl_error(req, "No 'arg%d' argument", i); @@ -565,7 +565,7 @@ virstor_ctl_remove(struct gctl_req *req, struct g_clas int j, found; struct g_virstor_component *newcomp, *compbak; - sprintf(param, "arg%d", i); + snprintf(param, sizeof(param), "arg%d", i); prov_name = gctl_get_asciiparam(req, param); if (prov_name == NULL) { gctl_error(req, "Error fetching argument '%s'", param); From owner-svn-src-head@freebsd.org Sun Jul 26 02:42:10 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C81BA37A00A; Sun, 26 Jul 2020 02:42:10 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDnJy4ycZz40LS; Sun, 26 Jul 2020 02:42:10 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DF84257DF; Sun, 26 Jul 2020 02:42:10 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06Q2gA68046680; Sun, 26 Jul 2020 02:42:10 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06Q2g9fA046676; Sun, 26 Jul 2020 02:42:09 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202007260242.06Q2g9fA046676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 26 Jul 2020 02:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363541 - in head/sys/fs: nfs nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsserver X-SVN-Commit-Revision: 363541 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 02:42:10 -0000 Author: rmacklem Date: Sun Jul 26 02:42:09 2020 New Revision: 363541 URL: https://svnweb.freebsd.org/changeset/base/363541 Log: Add support for ext_pgs mbufs to nfsrv_adj(). This patch uses a slightly different algorithm for nfsrv_adj() since ext_pgs mbuf lists are not permitted to have m_len == 0 mbufs. As such, the code now frees mbufs after the adjustment in the list instead of setting their m_len field to 0. Since mbuf(s) may be trimmed off the tail of the list, the function now returns a pointer to the last mbuf in the list. This saves the caller from needing to use m_last() to find the last mbuf. It also implies that it might return a nul list, which required a check for that in nfsrvd_readlink(). This is another in the series of commits that add support to the NFS client and server for building RPC messages in ext_pgs mbufs with anonymous pages. This is useful so that the entire mbuf list does not need to be copied before calling sosend() when NFS over TLS is enabled. Use of ext_pgs mbufs will not be enabled until the kernel RPC is updated to handle TLS. Modified: head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/nfsserver/nfs_nfsdserv.c head/sys/fs/nfsserver/nfs_nfsdsubs.c Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Sun Jul 26 01:45:26 2020 (r363540) +++ head/sys/fs/nfs/nfs_var.h Sun Jul 26 02:42:09 2020 (r363541) @@ -391,7 +391,7 @@ int nfsv4_fillattr(struct nfsrv_descript *, struct mou struct vattr *, fhandle_t *, int, nfsattrbit_t *, struct ucred *, NFSPROC_T *, int, int, int, int, uint64_t, struct statfs *); void nfsrv_fillattr(struct nfsrv_descript *, struct nfsvattr *); -void nfsrv_adj(struct mbuf *, int, int); +struct mbuf *nfsrv_adj(struct mbuf *, int, int); void nfsrv_postopattr(struct nfsrv_descript *, int, struct nfsvattr *); int nfsd_errmap(struct nfsrv_descript *); void nfsv4_uidtostr(uid_t, u_char **, int *); Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Sun Jul 26 01:45:26 2020 (r363540) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Sun Jul 26 02:42:09 2020 (r363541) @@ -757,7 +757,12 @@ nfsvno_readlink(struct vnode *vp, struct ucred *cred, if (uiop->uio_resid > 0) { len -= uiop->uio_resid; tlen = NFSM_RNDUP(len); - nfsrv_adj(mp3, NFS_MAXPATHLEN - tlen, tlen - len); + if (tlen == 0) { + m_freem(mp3); + mp3 = mp = NULL; + } else if (tlen != NFS_MAXPATHLEN || tlen != len) + mp = nfsrv_adj(mp3, NFS_MAXPATHLEN - tlen, + tlen - len); } *lenp = len; *mpp = mp3; @@ -872,9 +877,9 @@ nfsvno_read(struct vnode *vp, off_t off, int cnt, stru tlen = NFSM_RNDUP(cnt); if (tlen == 0) { m_freem(m3); - m3 = NULL; + m3 = m = NULL; } else if (len != tlen || tlen != cnt) - nfsrv_adj(m3, len - tlen, tlen - cnt); + m = nfsrv_adj(m3, len - tlen, tlen - cnt); *mpp = m3; *mpendp = m; @@ -6247,7 +6252,11 @@ nfsvno_getxattr(struct vnode *vp, char *name, uint32_t tlen = NFSM_RNDUP(len); if (alen != tlen) printf("nfsvno_getxattr: weird size read\n"); - nfsrv_adj(m, alen - tlen, tlen - len); + if (tlen == 0) { + m_freem(m); + m = m2 = NULL; + } else if (alen != tlen || tlen != len) + m2 = nfsrv_adj(m, alen - tlen, tlen - len); } *lenp = len; *mpp = m; Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Sun Jul 26 01:45:26 2020 (r363540) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Sun Jul 26 02:42:09 2020 (r363541) @@ -690,9 +690,11 @@ nfsrvd_readlink(struct nfsrv_descript *nd, __unused in goto out; NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(len); - nd->nd_mb->m_next = mp; - nd->nd_mb = mpend; - nd->nd_bpos = mtod(mpend, caddr_t) + mpend->m_len; + if (mp != NULL) { + nd->nd_mb->m_next = mp; + nd->nd_mb = mpend; + nd->nd_bpos = mtod(mpend, caddr_t) + mpend->m_len; + } out: NFSEXITCODE2(0, nd); Modified: head/sys/fs/nfsserver/nfs_nfsdsubs.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdsubs.c Sun Jul 26 01:45:26 2020 (r363540) +++ head/sys/fs/nfsserver/nfs_nfsdsubs.c Sun Jul 26 02:42:09 2020 (r363541) @@ -1268,62 +1268,100 @@ static short *nfsrv_v4errmap[] = { }; /* - * A fiddled version of m_adj() that ensures null fill to a long - * boundary and only trims off the back end + * Trim tlen bytes off the end of the mbuf list and then ensure + * the end of the last mbuf is nul filled to a long boundary, + * as indicated by the value of "nul". + * Return the last mbuf in the updated list and free and mbufs + * that follow it in the original list. + * This is somewhat different than the old nfsrv_adj() with + * support for ext_pgs mbufs. It frees the remaining mbufs + * instead of setting them 0 length, since lists of ext_pgs + * mbufs are all expected to be non-empty. */ -void +struct mbuf * nfsrv_adj(struct mbuf *mp, int len, int nul) { - struct mbuf *m; - int count, i; + struct mbuf *m, *m2; + vm_page_t pg; + int i, lastlen, pgno, plen, tlen, trim; + uint16_t off; char *cp; /* - * Trim from tail. Scan the mbuf chain, - * calculating its length and finding the last mbuf. - * If the adjustment only affects this mbuf, then just - * adjust and return. Otherwise, rescan and truncate - * after the remaining size. + * Find the last mbuf after adjustment and + * how much it needs to be adjusted by. */ - count = 0; + tlen = 0; m = mp; for (;;) { - count += m->m_len; + tlen += m->m_len; if (m->m_next == NULL) break; m = m->m_next; } - if (m->m_len > len) { - m->m_len -= len; - if (nul > 0) { - cp = mtod(m, caddr_t) + m->m_len - nul; - for (i = 0; i < nul; i++) - *cp++ = '\0'; + /* m is now the last mbuf and tlen the total length. */ + + if (len >= m->m_len) { + /* Need to trim away the last mbuf(s). */ + i = tlen - len; + m = mp; + for (;;) { + if (m->m_len >= i) + break; + i -= m->m_len; + m = m->m_next; } - return; - } - count -= len; - if (count < 0) - count = 0; + lastlen = i; + } else + lastlen = m->m_len - len; + /* - * Correct length for chain is "count". - * Find the mbuf with last data, adjust its length, - * and toss data from remaining mbufs on chain. + * m is now the last mbuf after trimming and its length needs to + * be lastlen. + * Adjust the last mbuf and set cp to point to where nuls must be + * written. */ - for (m = mp; m; m = m->m_next) { - if (m->m_len >= count) { - m->m_len = count; - if (nul > 0) { - cp = mtod(m, caddr_t) + m->m_len - nul; - for (i = 0; i < nul; i++) - *cp++ = '\0'; + if ((m->m_flags & M_EXTPG) != 0) { + pgno = m->m_epg_npgs - 1; + off = (pgno == 0) ? m->m_epg_1st_off : 0; + plen = m_epg_pagelen(m, pgno, off); + if (m->m_len > lastlen) { + /* Trim this mbuf. */ + trim = m->m_len - lastlen; + while (trim >= plen) { + KASSERT(pgno > 0, + ("nfsrv_adj: freeing page 0")); + /* Free page. */ + pg = PHYS_TO_VM_PAGE(m->m_epg_pa[pgno]); + vm_page_unwire_noq(pg); + vm_page_free(pg); + trim -= plen; + m->m_epg_npgs--; + pgno--; + off = (pgno == 0) ? m->m_epg_1st_off : 0; + plen = m_epg_pagelen(m, pgno, off); } - break; + plen -= trim; + m->m_epg_last_len = plen; + m->m_len = lastlen; } - count -= m->m_len; + cp = (char *)(void *)PHYS_TO_DMAP(m->m_epg_pa[pgno]); + cp += off + plen - nul; + } else { + m->m_len = lastlen; + cp = mtod(m, char *) + m->m_len - nul; } - for (m = m->m_next; m; m = m->m_next) - m->m_len = 0; + + /* Write the nul bytes. */ + for (i = 0; i < nul; i++) + *cp++ = '\0'; + + /* Free up any mbufs past "m". */ + m2 = m->m_next; + m->m_next = NULL; + if (m2 != NULL) + m_freem(m2); + return (m); } /* From owner-svn-src-head@freebsd.org Sun Jul 26 09:15:06 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 426103A20F5; Sun, 26 Jul 2020 09:15:06 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDy2L13Gzz4K5n; Sun, 26 Jul 2020 09:15:06 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE86CA835; Sun, 26 Jul 2020 09:15:05 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06Q9F5mj094458; Sun, 26 Jul 2020 09:15:05 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06Q9F5YY094456; Sun, 26 Jul 2020 09:15:05 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <202007260915.06Q9F5YY094456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Sun, 26 Jul 2020 09:15:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363543 - in head/usr.bin/sed: . tests X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: in head/usr.bin/sed: . tests X-SVN-Commit-Revision: 363543 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 09:15:06 -0000 Author: yuripv Date: Sun Jul 26 09:15:05 2020 New Revision: 363543 URL: https://svnweb.freebsd.org/changeset/base/363543 Log: sed: treat '[' as ordinary character in 'y' command 'y' does not handle bracket expressions, treat '[' as ordinary character and do not apply bracket expression checks (GNU sed agrees). PR: 247931 Reviewed by: pfg, kevans Tested by: antoine (exp-run), Quentin L'Hours Differential Revision: https://reviews.freebsd.org/D25640 Modified: head/usr.bin/sed/compile.c head/usr.bin/sed/tests/sed2_test.sh Modified: head/usr.bin/sed/compile.c ============================================================================== --- head/usr.bin/sed/compile.c Sun Jul 26 02:51:00 2020 (r363542) +++ head/usr.bin/sed/compile.c Sun Jul 26 09:15:05 2020 (r363543) @@ -437,11 +437,19 @@ compile_delimited(char *p, char *d, int is_tr) linenum, fname); while (*p) { if (*p == '[' && *p != c) { - if ((d = compile_ccl(&p, d)) == NULL) - errx(1, "%lu: %s: unbalanced brackets ([])", linenum, fname); - continue; + if (!is_tr) { + if ((d = compile_ccl(&p, d)) == NULL) { + errx(1, + "%lu: %s: unbalanced brackets ([])", + linenum, fname); + } + continue; + } } else if (*p == '\\' && p[1] == '[') { - *d++ = *p++; + if (is_tr) + p++; + else + *d++ = *p++; } else if (*p == '\\' && p[1] == c) { p++; } else if (*p == '\\' && Modified: head/usr.bin/sed/tests/sed2_test.sh ============================================================================== --- head/usr.bin/sed/tests/sed2_test.sh Sun Jul 26 02:51:00 2020 (r363542) +++ head/usr.bin/sed/tests/sed2_test.sh Sun Jul 26 09:15:05 2020 (r363543) @@ -134,6 +134,22 @@ commands_on_stdin_body() atf_check -o 'empty' sed -f - < insert_x } +atf_test_case bracket_y +bracket_y_head() +{ + atf_set "descr" "Verify '[' is ordinary character for 'y' command" +} +bracket_y_body() +{ + atf_check -e empty -o ignore echo | sed 'y/[/x/' + atf_check -e empty -o ignore echo | sed 'y/[]/xy/' + atf_check -e empty -o ignore echo | sed 'y/[a]/xyz/' + atf_check -e empty -o "inline:zyx" echo '][a' | sed 'y/[a]/xyz/' + atf_check -e empty -o "inline:bracket\n" echo 'bra[ke]' | sed 'y/[]/ct/' + atf_check -e empty -o "inline:bracket\n" \ + echo 'bra[ke]' | sed 'y[\[][ct[' +} + atf_init_test_cases() { atf_add_test_case inplace_command_q @@ -142,4 +158,5 @@ atf_init_test_cases() atf_add_test_case escape_subst atf_add_test_case commands_on_stdin atf_add_test_case hex_subst + atf_add_test_case bracket_y } From owner-svn-src-head@freebsd.org Sun Jul 26 10:07:05 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1DF13A366E; Sun, 26 Jul 2020 10:07:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDzBK5Djyz4NZ0; Sun, 26 Jul 2020 10:07:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 97C91B236; Sun, 26 Jul 2020 10:07:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06QA75kj025855; Sun, 26 Jul 2020 10:07:05 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06QA75rW025854; Sun, 26 Jul 2020 10:07:05 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202007261007.06QA75rW025854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 26 Jul 2020 10:07:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363555 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 363555 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 10:07:05 -0000 Author: manu Date: Sun Jul 26 10:07:05 2020 New Revision: 363555 URL: https://svnweb.freebsd.org/changeset/base/363555 Log: arm64: Only compile imx8 files if soc_freescale_imx8 is selected No Objection from: gonzo Modified: head/sys/conf/files.arm64 Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Sun Jul 26 10:04:02 2020 (r363554) +++ head/sys/conf/files.arm64 Sun Jul 26 10:07:05 2020 (r363555) @@ -408,8 +408,8 @@ arm64/freescale/imx/clk/imx_clk_sscg_pll.c optional fd arm64/freescale/imx/clk/imx_clk_frac_pll.c optional fdt soc_freescale_imx8 # iMX drivers -arm/freescale/imx/imx_gpio.c optional gpio +arm/freescale/imx/imx_gpio.c optional gpio soc_freescale_imx8 arm/freescale/imx/imx_i2c.c optional fsliic -arm/freescale/imx/imx_machdep.c standard +arm/freescale/imx/imx_machdep.c optional fdt soc_freescale_imx8 arm64/freescale/imx/imx7gpc.c optional fdt soc_freescale_imx8 dev/ffec/if_ffec.c optional ffec From owner-svn-src-head@freebsd.org Sun Jul 26 12:29:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 90C023A6EB8; Sun, 26 Jul 2020 12:29:24 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BF2LX3jhRz4WXt; Sun, 26 Jul 2020 12:29:24 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E672CD86; Sun, 26 Jul 2020 12:29:24 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06QCTOCI013211; Sun, 26 Jul 2020 12:29:24 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06QCTMZi013204; Sun, 26 Jul 2020 12:29:22 GMT (envelope-from br@FreeBSD.org) Message-Id: <202007261229.06QCTMZi013204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Sun, 26 Jul 2020 12:29:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363560 - in head/sys: dev/iommu x86/iommu X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: dev/iommu x86/iommu X-SVN-Commit-Revision: 363560 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 12:29:24 -0000 Author: br Date: Sun Jul 26 12:29:22 2020 New Revision: 363560 URL: https://svnweb.freebsd.org/changeset/base/363560 Log: Rename DMAR flags: o DMAR_DOMAIN_* -> IOMMU_DOMAIN_* o DMAR_PGF_* -> IOMMU_PGF_* Reviewed by: kib Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D25812 Modified: head/sys/dev/iommu/busdma_iommu.c head/sys/dev/iommu/iommu.h head/sys/dev/iommu/iommu_gas.c head/sys/x86/iommu/intel_ctx.c head/sys/x86/iommu/intel_drv.c head/sys/x86/iommu/intel_idpgtbl.c head/sys/x86/iommu/intel_utils.c Modified: head/sys/dev/iommu/busdma_iommu.c ============================================================================== --- head/sys/dev/iommu/busdma_iommu.c Sun Jul 26 11:16:43 2020 (r363559) +++ head/sys/dev/iommu/busdma_iommu.c Sun Jul 26 12:29:22 2020 (r363560) @@ -1017,7 +1017,7 @@ bus_dma_dmar_load_ident(bus_dma_tag_t dmat, bus_dmamap map = (struct bus_dmamap_iommu *)map1; waitok = (flags & BUS_DMA_NOWAIT) != 0; - entry = iommu_map_alloc_entry(domain, waitok ? 0 : DMAR_PGF_WAITOK); + entry = iommu_map_alloc_entry(domain, waitok ? 0 : IOMMU_PGF_WAITOK); if (entry == NULL) return (ENOMEM); entry->start = start; Modified: head/sys/dev/iommu/iommu.h ============================================================================== --- head/sys/dev/iommu/iommu.h Sun Jul 26 11:16:43 2020 (r363559) +++ head/sys/dev/iommu/iommu.h Sun Jul 26 12:29:22 2020 (r363560) @@ -134,11 +134,11 @@ struct iommu_ctx { ephemeral reference is kept to prevent context destruction */ -#define DMAR_DOMAIN_GAS_INITED 0x0001 -#define DMAR_DOMAIN_PGTBL_INITED 0x0002 -#define DMAR_DOMAIN_IDMAP 0x0010 /* Domain uses identity +#define IOMMU_DOMAIN_GAS_INITED 0x0001 +#define IOMMU_DOMAIN_PGTBL_INITED 0x0002 +#define IOMMU_DOMAIN_IDMAP 0x0010 /* Domain uses identity page table */ -#define DMAR_DOMAIN_RMRR 0x0020 /* Domain contains RMRR entry, +#define IOMMU_DOMAIN_RMRR 0x0020 /* Domain contains RMRR entry, cannot be turned off */ /* Map flags */ @@ -146,11 +146,11 @@ struct iommu_ctx { #define IOMMU_MF_CANSPLIT 0x0002 #define IOMMU_MF_RMRR 0x0004 -#define DMAR_PGF_WAITOK 0x0001 -#define DMAR_PGF_ZERO 0x0002 -#define DMAR_PGF_ALLOC 0x0004 -#define DMAR_PGF_NOALLOC 0x0008 -#define DMAR_PGF_OBJL 0x0010 +#define IOMMU_PGF_WAITOK 0x0001 +#define IOMMU_PGF_ZERO 0x0002 +#define IOMMU_PGF_ALLOC 0x0004 +#define IOMMU_PGF_NOALLOC 0x0008 +#define IOMMU_PGF_OBJL 0x0010 #define IOMMU_LOCK(unit) mtx_lock(&(unit)->lock) #define IOMMU_UNLOCK(unit) mtx_unlock(&(unit)->lock) Modified: head/sys/dev/iommu/iommu_gas.c ============================================================================== --- head/sys/dev/iommu/iommu_gas.c Sun Jul 26 11:16:43 2020 (r363559) +++ head/sys/dev/iommu/iommu_gas.c Sun Jul 26 12:29:22 2020 (r363560) @@ -98,10 +98,10 @@ iommu_gas_alloc_entry(struct iommu_domain *domain, u_i { struct iommu_map_entry *res; - KASSERT((flags & ~(DMAR_PGF_WAITOK)) == 0, + KASSERT((flags & ~(IOMMU_PGF_WAITOK)) == 0, ("unsupported flags %x", flags)); - res = uma_zalloc(iommu_map_entry_zone, ((flags & DMAR_PGF_WAITOK) != + res = uma_zalloc(iommu_map_entry_zone, ((flags & IOMMU_PGF_WAITOK) != 0 ? M_WAITOK : M_NOWAIT) | M_ZERO); if (res != NULL) { res->domain = domain; @@ -218,8 +218,8 @@ iommu_gas_init_domain(struct iommu_domain *domain) { struct iommu_map_entry *begin, *end; - begin = iommu_gas_alloc_entry(domain, DMAR_PGF_WAITOK); - end = iommu_gas_alloc_entry(domain, DMAR_PGF_WAITOK); + begin = iommu_gas_alloc_entry(domain, IOMMU_PGF_WAITOK); + end = iommu_gas_alloc_entry(domain, IOMMU_PGF_WAITOK); IOMMU_DOMAIN_LOCK(domain); KASSERT(domain->entries_cnt == 2, ("dirty domain %p", domain)); @@ -238,7 +238,7 @@ iommu_gas_init_domain(struct iommu_domain *domain) domain->first_place = begin; domain->last_place = end; - domain->flags |= DMAR_DOMAIN_GAS_INITED; + domain->flags |= IOMMU_DOMAIN_GAS_INITED; IOMMU_DOMAIN_UNLOCK(domain); } @@ -598,7 +598,7 @@ iommu_gas_map(struct iommu_domain *domain, ("invalid flags 0x%x", flags)); entry = iommu_gas_alloc_entry(domain, - (flags & IOMMU_MF_CANWAIT) != 0 ? DMAR_PGF_WAITOK : 0); + (flags & IOMMU_MF_CANWAIT) != 0 ? IOMMU_PGF_WAITOK : 0); if (entry == NULL) return (ENOMEM); IOMMU_DOMAIN_LOCK(domain); @@ -622,7 +622,7 @@ iommu_gas_map(struct iommu_domain *domain, error = domain_map_buf(domain, entry->start, entry->end - entry->start, ma, eflags, - ((flags & IOMMU_MF_CANWAIT) != 0 ? DMAR_PGF_WAITOK : 0)); + ((flags & IOMMU_MF_CANWAIT) != 0 ? IOMMU_PGF_WAITOK : 0)); if (error == ENOMEM) { iommu_domain_unload_entry(entry, true); return (error); @@ -660,7 +660,7 @@ iommu_gas_map_region(struct iommu_domain *domain, stru error = domain_map_buf(domain, entry->start, entry->end - entry->start, ma + OFF_TO_IDX(start - entry->start), eflags, - ((flags & IOMMU_MF_CANWAIT) != 0 ? DMAR_PGF_WAITOK : 0)); + ((flags & IOMMU_MF_CANWAIT) != 0 ? IOMMU_PGF_WAITOK : 0)); if (error == ENOMEM) { iommu_domain_unload_entry(entry, false); return (error); @@ -678,7 +678,7 @@ iommu_gas_reserve_region(struct iommu_domain *domain, struct iommu_map_entry *entry; int error; - entry = iommu_gas_alloc_entry(domain, DMAR_PGF_WAITOK); + entry = iommu_gas_alloc_entry(domain, IOMMU_PGF_WAITOK); entry->start = start; entry->end = end; IOMMU_DOMAIN_LOCK(domain); Modified: head/sys/x86/iommu/intel_ctx.c ============================================================================== --- head/sys/x86/iommu/intel_ctx.c Sun Jul 26 11:16:43 2020 (r363559) +++ head/sys/x86/iommu/intel_ctx.c Sun Jul 26 12:29:22 2020 (r363560) @@ -89,7 +89,7 @@ dmar_ensure_ctx_page(struct dmar_unit *dmar, int bus) /* * Allocated context page must be linked. */ - ctxm = dmar_pgalloc(dmar->ctx_obj, 1 + bus, DMAR_PGF_NOALLOC); + ctxm = dmar_pgalloc(dmar->ctx_obj, 1 + bus, IOMMU_PGF_NOALLOC); if (ctxm != NULL) return; @@ -100,9 +100,9 @@ dmar_ensure_ctx_page(struct dmar_unit *dmar, int bus) * threads are equal. */ TD_PREP_PINNED_ASSERT; - ctxm = dmar_pgalloc(dmar->ctx_obj, 1 + bus, DMAR_PGF_ZERO | - DMAR_PGF_WAITOK); - re = dmar_map_pgtbl(dmar->ctx_obj, 0, DMAR_PGF_NOALLOC, &sf); + ctxm = dmar_pgalloc(dmar->ctx_obj, 1 + bus, IOMMU_PGF_ZERO | + IOMMU_PGF_WAITOK); + re = dmar_map_pgtbl(dmar->ctx_obj, 0, IOMMU_PGF_NOALLOC, &sf); re += bus; dmar_pte_store(&re->r1, DMAR_ROOT_R1_P | (DMAR_ROOT_R1_CTP_MASK & VM_PAGE_TO_PHYS(ctxm))); @@ -120,7 +120,7 @@ dmar_map_ctx_entry(struct dmar_ctx *ctx, struct sf_buf dmar = (struct dmar_unit *)ctx->context.domain->iommu; ctxp = dmar_map_pgtbl(dmar->ctx_obj, 1 + - PCI_RID2BUS(ctx->rid), DMAR_PGF_NOALLOC | DMAR_PGF_WAITOK, sfp); + PCI_RID2BUS(ctx->rid), IOMMU_PGF_NOALLOC | IOMMU_PGF_WAITOK, sfp); ctxp += ctx->rid & 0xff; return (ctxp); } @@ -186,13 +186,14 @@ ctx_id_entry_init(struct dmar_ctx *ctx, dmar_ctx_entry pci_get_function(ctx->context.tag->owner), ctxp->ctx1, ctxp->ctx2)); - if ((domain->iodom.flags & DMAR_DOMAIN_IDMAP) != 0 && + if ((domain->iodom.flags & IOMMU_DOMAIN_IDMAP) != 0 && (unit->hw_ecap & DMAR_ECAP_PT) != 0) { KASSERT(domain->pgtbl_obj == NULL, ("ctx %p non-null pgtbl_obj", ctx)); ctx_root = NULL; } else { - ctx_root = dmar_pgalloc(domain->pgtbl_obj, 0, DMAR_PGF_NOALLOC); + ctx_root = dmar_pgalloc(domain->pgtbl_obj, 0, + IOMMU_PGF_NOALLOC); } if (dmar_is_buswide_ctx(unit, busno)) { @@ -295,7 +296,7 @@ domain_init_rmrr(struct dmar_domain *domain, device_t if (error1 == 0 && entry->end != entry->start) { IOMMU_LOCK(domain->iodom.iommu); domain->refs++; /* XXXKIB prevent free */ - domain->iodom.flags |= DMAR_DOMAIN_RMRR; + domain->iodom.flags |= IOMMU_DOMAIN_RMRR; IOMMU_UNLOCK(domain->iodom.iommu); } else { if (error1 != 0) { @@ -363,7 +364,7 @@ dmar_domain_alloc(struct dmar_unit *dmar, bool id_mapp domain->pgtbl_obj = domain_get_idmap_pgtbl(domain, domain->iodom.end); } - domain->iodom.flags |= DMAR_DOMAIN_IDMAP; + domain->iodom.flags |= IOMMU_DOMAIN_IDMAP; } else { error = domain_alloc_pgtbl(domain); if (error != 0) @@ -440,12 +441,12 @@ dmar_domain_destroy(struct dmar_domain *domain) ("destroying dom %p with ctx_cnt %d", domain, domain->ctx_cnt)); KASSERT(domain->refs == 0, ("destroying dom %p with refs %d", domain, domain->refs)); - if ((domain->iodom.flags & DMAR_DOMAIN_GAS_INITED) != 0) { + if ((domain->iodom.flags & IOMMU_DOMAIN_GAS_INITED) != 0) { DMAR_DOMAIN_LOCK(domain); iommu_gas_fini_domain((struct iommu_domain *)domain); DMAR_DOMAIN_UNLOCK(domain); } - if ((domain->iodom.flags & DMAR_DOMAIN_PGTBL_INITED) != 0) { + if ((domain->iodom.flags & IOMMU_DOMAIN_PGTBL_INITED) != 0) { if (domain->pgtbl_obj != NULL) DMAR_DOMAIN_PGLOCK(domain); domain_free_pgtbl(domain); @@ -643,7 +644,7 @@ dmar_move_ctx_to_domain(struct dmar_domain *domain, st /* If flush failed, rolling back would not work as well. */ printf("dmar%d rid %x domain %d->%d %s-mapped\n", dmar->iommu.unit, ctx->rid, old_domain->domain, domain->domain, - (domain->iodom.flags & DMAR_DOMAIN_IDMAP) != 0 ? "id" : "re"); + (domain->iodom.flags & IOMMU_DOMAIN_IDMAP) != 0 ? "id" : "re"); dmar_unref_domain_locked(dmar, old_domain); TD_PINNED_ASSERT; return (error); @@ -667,7 +668,7 @@ dmar_unref_domain_locked(struct dmar_unit *dmar, struc return; } - KASSERT((domain->iodom.flags & DMAR_DOMAIN_RMRR) == 0, + KASSERT((domain->iodom.flags & IOMMU_DOMAIN_RMRR) == 0, ("lost ref on RMRR domain %p", domain)); LIST_REMOVE(domain, link); @@ -848,7 +849,7 @@ dmar_domain_unload(struct dmar_domain *domain, KASSERT((entry->flags & IOMMU_MAP_ENTRY_MAP) != 0, ("not mapped entry %p %p", domain, entry)); error = domain_unmap_buf(domain, entry->start, entry->end - - entry->start, cansleep ? DMAR_PGF_WAITOK : 0); + entry->start, cansleep ? IOMMU_PGF_WAITOK : 0); KASSERT(error == 0, ("unmap %p error %d", domain, error)); if (!unit->qi_enabled) { domain_flush_iotlb_sync(domain, entry->start, Modified: head/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Sun Jul 26 11:16:43 2020 (r363559) +++ head/sys/x86/iommu/intel_drv.c Sun Jul 26 12:29:22 2020 (r363560) @@ -489,7 +489,7 @@ dmar_attach(device_t dev) * address translation after the required invalidations are * done. */ - dmar_pgalloc(unit->ctx_obj, 0, DMAR_PGF_WAITOK | DMAR_PGF_ZERO); + dmar_pgalloc(unit->ctx_obj, 0, IOMMU_PGF_WAITOK | IOMMU_PGF_ZERO); DMAR_LOCK(unit); error = dmar_load_root_entry_ptr(unit); if (error != 0) { @@ -944,7 +944,7 @@ dmar_rmrr_iter(ACPI_DMAR_HEADER *dmarh, void *arg) if (match == 1) { entry = iommu_gas_alloc_entry( (struct iommu_domain *)ria->domain, - DMAR_PGF_WAITOK); + IOMMU_PGF_WAITOK); entry->start = resmem->BaseAddress; /* The RMRR entry end address is inclusive. */ entry->end = resmem->EndAddress; Modified: head/sys/x86/iommu/intel_idpgtbl.c ============================================================================== --- head/sys/x86/iommu/intel_idpgtbl.c Sun Jul 26 11:16:43 2020 (r363559) +++ head/sys/x86/iommu/intel_idpgtbl.c Sun Jul 26 12:29:22 2020 (r363560) @@ -121,8 +121,8 @@ domain_idmap_nextlvl(struct idpgtbl *tbl, int lvl, vm_ VM_OBJECT_ASSERT_LOCKED(tbl->pgtbl_obj); if (addr >= tbl->maxaddr) return; - (void)dmar_pgalloc(tbl->pgtbl_obj, idx, DMAR_PGF_OBJL | DMAR_PGF_WAITOK | - DMAR_PGF_ZERO); + (void)dmar_pgalloc(tbl->pgtbl_obj, idx, IOMMU_PGF_OBJL | + IOMMU_PGF_WAITOK | IOMMU_PGF_ZERO); base = idx * DMAR_NPTEPG + 1; /* Index of the first child page of idx */ pg_sz = pglvl_page_size(tbl->pglvl, lvl); if (lvl != tbl->leaf) { @@ -130,7 +130,7 @@ domain_idmap_nextlvl(struct idpgtbl *tbl, int lvl, vm_ domain_idmap_nextlvl(tbl, lvl + 1, base + i, f); } VM_OBJECT_WUNLOCK(tbl->pgtbl_obj); - pte = dmar_map_pgtbl(tbl->pgtbl_obj, idx, DMAR_PGF_WAITOK, &sf); + pte = dmar_map_pgtbl(tbl->pgtbl_obj, idx, IOMMU_PGF_WAITOK, &sf); if (lvl == tbl->leaf) { for (i = 0, f = addr; i < DMAR_NPTEPG; i++, f += pg_sz) { if (f >= tbl->maxaddr) @@ -143,7 +143,7 @@ domain_idmap_nextlvl(struct idpgtbl *tbl, int lvl, vm_ if (f >= tbl->maxaddr) break; m1 = dmar_pgalloc(tbl->pgtbl_obj, base + i, - DMAR_PGF_NOALLOC); + IOMMU_PGF_NOALLOC); KASSERT(m1 != NULL, ("lost page table page")); pte[i].pte = (DMAR_PTE_ADDR_MASK & VM_PAGE_TO_PHYS(m1)) | DMAR_PTE_R | DMAR_PTE_W; @@ -362,7 +362,7 @@ domain_pgtbl_map_pte(struct dmar_domain *domain, iommu vm_pindex_t idx, idx1; DMAR_DOMAIN_ASSERT_PGLOCKED(domain); - KASSERT((flags & DMAR_PGF_OBJL) != 0, ("lost PGF_OBJL")); + KASSERT((flags & IOMMU_PGF_OBJL) != 0, ("lost PGF_OBJL")); idx = domain_pgtbl_get_pindex(domain, base, lvl); if (*sf != NULL && idx == *idxp) { @@ -382,7 +382,7 @@ retry: * to reference the allocated page table page. */ m = dmar_pgalloc(domain->pgtbl_obj, idx, flags | - DMAR_PGF_ZERO); + IOMMU_PGF_ZERO); if (m == NULL) return (NULL); @@ -435,7 +435,7 @@ domain_map_buf_locked(struct dmar_domain *domain, iomm base1 = base; size1 = size; - flags |= DMAR_PGF_OBJL; + flags |= IOMMU_PGF_OBJL; TD_PREP_PINNED_ASSERT; for (sf = NULL, pi = 0; size > 0; base += pg_sz, size -= pg_sz, @@ -478,7 +478,7 @@ domain_map_buf_locked(struct dmar_domain *domain, iomm KASSERT(pg_sz > 0, ("pg_sz 0 lvl %d", lvl)); pte = domain_pgtbl_map_pte(domain, base, lvl, flags, &idx, &sf); if (pte == NULL) { - KASSERT((flags & DMAR_PGF_WAITOK) == 0, + KASSERT((flags & IOMMU_PGF_WAITOK) == 0, ("failed waitable pte alloc %p", domain)); if (sf != NULL) dmar_unmap_pgtbl(sf); @@ -515,7 +515,7 @@ domain_map_buf(struct iommu_domain *iodom, iommu_gaddr domain = (struct dmar_domain *)iodom; unit = domain->dmar; - KASSERT((domain->iodom.flags & DMAR_DOMAIN_IDMAP) == 0, + KASSERT((domain->iodom.flags & IOMMU_DOMAIN_IDMAP) == 0, ("modifying idmap pagetable domain %p", domain)); KASSERT((base & DMAR_PAGE_MASK) == 0, ("non-aligned base %p %jx %jx", domain, (uintmax_t)base, @@ -547,7 +547,7 @@ domain_map_buf(struct iommu_domain *iodom, iommu_gaddr (unit->hw_ecap & DMAR_ECAP_DI) != 0, ("PTE_TM for dmar without DIOTLB %p %jx", domain, (uintmax_t)pflags)); - KASSERT((flags & ~DMAR_PGF_WAITOK) == 0, ("invalid flags %x", flags)); + KASSERT((flags & ~IOMMU_PGF_WAITOK) == 0, ("invalid flags %x", flags)); DMAR_DOMAIN_PGLOCK(domain); error = domain_map_buf_locked(domain, base, size, ma, pflags, flags); @@ -626,7 +626,7 @@ domain_unmap_buf_locked(struct dmar_domain *domain, io if (size == 0) return (0); - KASSERT((domain->iodom.flags & DMAR_DOMAIN_IDMAP) == 0, + KASSERT((domain->iodom.flags & IOMMU_DOMAIN_IDMAP) == 0, ("modifying idmap pagetable domain %p", domain)); KASSERT((base & DMAR_PAGE_MASK) == 0, ("non-aligned base %p %jx %jx", domain, (uintmax_t)base, @@ -643,10 +643,10 @@ domain_unmap_buf_locked(struct dmar_domain *domain, io KASSERT(base + size > base, ("size overflow %p %jx %jx", domain, (uintmax_t)base, (uintmax_t)size)); - KASSERT((flags & ~DMAR_PGF_WAITOK) == 0, ("invalid flags %x", flags)); + KASSERT((flags & ~IOMMU_PGF_WAITOK) == 0, ("invalid flags %x", flags)); pg_sz = 0; /* silence gcc */ - flags |= DMAR_PGF_OBJL; + flags |= IOMMU_PGF_OBJL; TD_PREP_PINNED_ASSERT; for (sf = NULL; size > 0; base += pg_sz, size -= pg_sz) { @@ -707,13 +707,13 @@ domain_alloc_pgtbl(struct dmar_domain *domain) domain->pgtbl_obj = vm_pager_allocate(OBJT_PHYS, NULL, IDX_TO_OFF(pglvl_max_pages(domain->pglvl)), 0, 0, NULL); DMAR_DOMAIN_PGLOCK(domain); - m = dmar_pgalloc(domain->pgtbl_obj, 0, DMAR_PGF_WAITOK | - DMAR_PGF_ZERO | DMAR_PGF_OBJL); + m = dmar_pgalloc(domain->pgtbl_obj, 0, IOMMU_PGF_WAITOK | + IOMMU_PGF_ZERO | IOMMU_PGF_OBJL); /* No implicit free of the top level page table page. */ m->ref_count = 1; DMAR_DOMAIN_PGUNLOCK(domain); DMAR_LOCK(domain->dmar); - domain->iodom.flags |= DMAR_DOMAIN_PGTBL_INITED; + domain->iodom.flags |= IOMMU_DOMAIN_PGTBL_INITED; DMAR_UNLOCK(domain->dmar); return (0); } @@ -727,16 +727,16 @@ domain_free_pgtbl(struct dmar_domain *domain) obj = domain->pgtbl_obj; if (obj == NULL) { KASSERT((domain->dmar->hw_ecap & DMAR_ECAP_PT) != 0 && - (domain->iodom.flags & DMAR_DOMAIN_IDMAP) != 0, + (domain->iodom.flags & IOMMU_DOMAIN_IDMAP) != 0, ("lost pagetable object domain %p", domain)); return; } DMAR_DOMAIN_ASSERT_PGLOCKED(domain); domain->pgtbl_obj = NULL; - if ((domain->iodom.flags & DMAR_DOMAIN_IDMAP) != 0) { + if ((domain->iodom.flags & IOMMU_DOMAIN_IDMAP) != 0) { put_idmap_pgtbl(obj); - domain->iodom.flags &= ~DMAR_DOMAIN_IDMAP; + domain->iodom.flags &= ~IOMMU_DOMAIN_IDMAP; return; } Modified: head/sys/x86/iommu/intel_utils.c ============================================================================== --- head/sys/x86/iommu/intel_utils.c Sun Jul 26 11:16:43 2020 (r363559) +++ head/sys/x86/iommu/intel_utils.c Sun Jul 26 12:29:22 2020 (r363560) @@ -262,22 +262,22 @@ dmar_pgalloc(vm_object_t obj, vm_pindex_t idx, int fla vm_page_t m; int zeroed, aflags; - zeroed = (flags & DMAR_PGF_ZERO) != 0 ? VM_ALLOC_ZERO : 0; + zeroed = (flags & IOMMU_PGF_ZERO) != 0 ? VM_ALLOC_ZERO : 0; aflags = zeroed | VM_ALLOC_NOBUSY | VM_ALLOC_SYSTEM | VM_ALLOC_NODUMP | - ((flags & DMAR_PGF_WAITOK) != 0 ? VM_ALLOC_WAITFAIL : + ((flags & IOMMU_PGF_WAITOK) != 0 ? VM_ALLOC_WAITFAIL : VM_ALLOC_NOWAIT); for (;;) { - if ((flags & DMAR_PGF_OBJL) == 0) + if ((flags & IOMMU_PGF_OBJL) == 0) VM_OBJECT_WLOCK(obj); m = vm_page_lookup(obj, idx); - if ((flags & DMAR_PGF_NOALLOC) != 0 || m != NULL) { - if ((flags & DMAR_PGF_OBJL) == 0) + if ((flags & IOMMU_PGF_NOALLOC) != 0 || m != NULL) { + if ((flags & IOMMU_PGF_OBJL) == 0) VM_OBJECT_WUNLOCK(obj); break; } m = vm_page_alloc_contig(obj, idx, aflags, 1, 0, dmar_high, PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); - if ((flags & DMAR_PGF_OBJL) == 0) + if ((flags & IOMMU_PGF_OBJL) == 0) VM_OBJECT_WUNLOCK(obj); if (m != NULL) { if (zeroed && (m->flags & PG_ZERO) == 0) @@ -285,7 +285,7 @@ dmar_pgalloc(vm_object_t obj, vm_pindex_t idx, int fla atomic_add_int(&dmar_tbl_pagecnt, 1); break; } - if ((flags & DMAR_PGF_WAITOK) == 0) + if ((flags & IOMMU_PGF_WAITOK) == 0) break; } return (m); @@ -296,14 +296,14 @@ dmar_pgfree(vm_object_t obj, vm_pindex_t idx, int flag { vm_page_t m; - if ((flags & DMAR_PGF_OBJL) == 0) + if ((flags & IOMMU_PGF_OBJL) == 0) VM_OBJECT_WLOCK(obj); m = vm_page_grab(obj, idx, VM_ALLOC_NOCREAT); if (m != NULL) { vm_page_free(m); atomic_subtract_int(&dmar_tbl_pagecnt, 1); } - if ((flags & DMAR_PGF_OBJL) == 0) + if ((flags & IOMMU_PGF_OBJL) == 0) VM_OBJECT_WUNLOCK(obj); } @@ -314,39 +314,39 @@ dmar_map_pgtbl(vm_object_t obj, vm_pindex_t idx, int f vm_page_t m; bool allocated; - if ((flags & DMAR_PGF_OBJL) == 0) + if ((flags & IOMMU_PGF_OBJL) == 0) VM_OBJECT_WLOCK(obj); m = vm_page_lookup(obj, idx); - if (m == NULL && (flags & DMAR_PGF_ALLOC) != 0) { - m = dmar_pgalloc(obj, idx, flags | DMAR_PGF_OBJL); + if (m == NULL && (flags & IOMMU_PGF_ALLOC) != 0) { + m = dmar_pgalloc(obj, idx, flags | IOMMU_PGF_OBJL); allocated = true; } else allocated = false; if (m == NULL) { - if ((flags & DMAR_PGF_OBJL) == 0) + if ((flags & IOMMU_PGF_OBJL) == 0) VM_OBJECT_WUNLOCK(obj); return (NULL); } /* Sleepable allocations cannot fail. */ - if ((flags & DMAR_PGF_WAITOK) != 0) + if ((flags & IOMMU_PGF_WAITOK) != 0) VM_OBJECT_WUNLOCK(obj); sched_pin(); - *sf = sf_buf_alloc(m, SFB_CPUPRIVATE | ((flags & DMAR_PGF_WAITOK) + *sf = sf_buf_alloc(m, SFB_CPUPRIVATE | ((flags & IOMMU_PGF_WAITOK) == 0 ? SFB_NOWAIT : 0)); if (*sf == NULL) { sched_unpin(); if (allocated) { VM_OBJECT_ASSERT_WLOCKED(obj); - dmar_pgfree(obj, m->pindex, flags | DMAR_PGF_OBJL); + dmar_pgfree(obj, m->pindex, flags | IOMMU_PGF_OBJL); } - if ((flags & DMAR_PGF_OBJL) == 0) + if ((flags & IOMMU_PGF_OBJL) == 0) VM_OBJECT_WUNLOCK(obj); return (NULL); } - if ((flags & (DMAR_PGF_WAITOK | DMAR_PGF_OBJL)) == - (DMAR_PGF_WAITOK | DMAR_PGF_OBJL)) + if ((flags & (IOMMU_PGF_WAITOK | IOMMU_PGF_OBJL)) == + (IOMMU_PGF_WAITOK | IOMMU_PGF_OBJL)) VM_OBJECT_WLOCK(obj); - else if ((flags & (DMAR_PGF_WAITOK | DMAR_PGF_OBJL)) == 0) + else if ((flags & (IOMMU_PGF_WAITOK | IOMMU_PGF_OBJL)) == 0) VM_OBJECT_WUNLOCK(obj); return ((void *)sf_buf_kva(*sf)); } From owner-svn-src-head@freebsd.org Sun Jul 26 13:30:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B8D5E360507; Sun, 26 Jul 2020 13:30:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BF3j54ZVdz4ZbB; Sun, 26 Jul 2020 13:30:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 815BED4DF; Sun, 26 Jul 2020 13:30:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06QDUX7W050460; Sun, 26 Jul 2020 13:30:33 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06QDUXi5050459; Sun, 26 Jul 2020 13:30:33 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007261330.06QDUXi5050459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 26 Jul 2020 13:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363562 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 363562 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 13:30:33 -0000 Author: mjg Date: Sun Jul 26 13:30:33 2020 New Revision: 363562 URL: https://svnweb.freebsd.org/changeset/base/363562 Log: Bump __FreeBSD_version after introduction of lockless lookup to the VFS layer Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Jul 26 13:07:09 2020 (r363561) +++ head/sys/sys/param.h Sun Jul 26 13:30:33 2020 (r363562) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300101 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300102 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Sun Jul 26 15:10:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 003B53629D6; Sun, 26 Jul 2020 15:10:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BF5wT5RkDz3RgK; Sun, 26 Jul 2020 15:10:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CF6EE678; Sun, 26 Jul 2020 15:10:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06QFAXvu012914; Sun, 26 Jul 2020 15:10:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06QFAXZV012913; Sun, 26 Jul 2020 15:10:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202007261510.06QFAXZV012913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 26 Jul 2020 15:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363563 - head/bin/chio X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/bin/chio X-SVN-Commit-Revision: 363563 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 15:10:34 -0000 Author: emaste Date: Sun Jul 26 15:10:33 2020 New Revision: 363563 URL: https://svnweb.freebsd.org/changeset/base/363563 Log: chio: avoid out of bounds read ch_ces is alloacated with space for total_elem entries. CID: 1418536 Reported by: Coverity Scan Sponsored by: The FreeBSD Foundation Modified: head/bin/chio/chio.c Modified: head/bin/chio/chio.c ============================================================================== --- head/bin/chio/chio.c Sun Jul 26 13:30:33 2020 (r363562) +++ head/bin/chio/chio.c Sun Jul 26 15:10:33 2020 (r363563) @@ -1144,7 +1144,7 @@ find_element(char *voltag, uint16_t *et, uint16_t *eu) /* * Now search the list the specified */ - for (elem = 0; elem <= total_elem; ++elem) { + for (elem = 0; elem < total_elem; ++elem) { ces = &ch_ces[elem]; From owner-svn-src-head@freebsd.org Sun Jul 26 16:30:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7688A365217; Sun, 26 Jul 2020 16:30:02 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BF7hB2Y04z3Wqc; Sun, 26 Jul 2020 16:30:02 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3696FFA93; Sun, 26 Jul 2020 16:30:02 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06QGU25K061979; Sun, 26 Jul 2020 16:30:02 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06QGU20h061978; Sun, 26 Jul 2020 16:30:02 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202007261630.06QGU20h061978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 26 Jul 2020 16:30:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363564 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363564 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 16:30:02 -0000 Author: manu Date: Sun Jul 26 16:30:01 2020 New Revision: 363564 URL: https://svnweb.freebsd.org/changeset/base/363564 Log: linuxkpi: Include linux/sizes.h in dma-mapping.h Linux does the same, this avoids ifdef or extra includes in ported drivers. Reviewed by: emaste, hselasky Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25701 Modified: head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Modified: head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Sun Jul 26 15:10:33 2020 (r363563) +++ head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Sun Jul 26 16:30:01 2020 (r363564) @@ -38,6 +38,7 @@ #include #include #include +#include #include #include From owner-svn-src-head@freebsd.org Sun Jul 26 16:31:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C9023649CE; Sun, 26 Jul 2020 16:31:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BF7jJ1NDtz3Wrw; Sun, 26 Jul 2020 16:31:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13035FA9F; Sun, 26 Jul 2020 16:31:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06QGUxe1065137; Sun, 26 Jul 2020 16:30:59 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06QGUxRi065135; Sun, 26 Jul 2020 16:30:59 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202007261630.06QGUxRi065135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 26 Jul 2020 16:30:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363565 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363565 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 16:31:00 -0000 Author: manu Date: Sun Jul 26 16:30:59 2020 New Revision: 363565 URL: https://svnweb.freebsd.org/changeset/base/363565 Log: linuxkpi: Include hardirq.h in preempt.h and lockdep.h in hardirq.h Linux does the same, this avoids ifdef or extra includes in ported drivers. Reviewed by: emaste, hselasky Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25702 Modified: head/sys/compat/linuxkpi/common/include/linux/hardirq.h head/sys/compat/linuxkpi/common/include/linux/preempt.h Modified: head/sys/compat/linuxkpi/common/include/linux/hardirq.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/hardirq.h Sun Jul 26 16:30:01 2020 (r363564) +++ head/sys/compat/linuxkpi/common/include/linux/hardirq.h Sun Jul 26 16:30:59 2020 (r363565) @@ -32,6 +32,7 @@ #define _LINUX_HARDIRQ_H_ #include +#include #include #include Modified: head/sys/compat/linuxkpi/common/include/linux/preempt.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/preempt.h Sun Jul 26 16:30:01 2020 (r363564) +++ head/sys/compat/linuxkpi/common/include/linux/preempt.h Sun Jul 26 16:30:59 2020 (r363565) @@ -29,6 +29,7 @@ #ifndef _LINUX_PREEMPT_H_ #define _LINUX_PREEMPT_H_ +#include #include #define in_interrupt() \ From owner-svn-src-head@freebsd.org Sun Jul 26 16:31:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 833003649DB; Sun, 26 Jul 2020 16:31:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BF7kG2zL0z3XDj; Sun, 26 Jul 2020 16:31:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 499B1FD33; Sun, 26 Jul 2020 16:31:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06QGVogI066074; Sun, 26 Jul 2020 16:31:50 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06QGVou8066073; Sun, 26 Jul 2020 16:31:50 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202007261631.06QGVou8066073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 26 Jul 2020 16:31:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363566 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363566 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 16:31:50 -0000 Author: manu Date: Sun Jul 26 16:31:49 2020 New Revision: 363566 URL: https://svnweb.freebsd.org/changeset/base/363566 Log: linuxkpi: Add taint* defines This isn't used for us but allow us to port drivers more easily. Reviewed by: hselasky Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25703 Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Sun Jul 26 16:30:59 2020 (r363565) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Sun Jul 26 16:31:49 2020 (r363566) @@ -593,4 +593,7 @@ linux_ratelimited(linux_ratelimit_t *rl) (is_signed(datatype) ? INT8_MIN : 0) \ ) +#define TAINT_WARN 0 +#define test_taint(x) (0) + #endif /* _LINUX_KERNEL_H_ */ From owner-svn-src-head@freebsd.org Sun Jul 26 17:21:25 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A2D936616A; Sun, 26 Jul 2020 17:21:25 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BF8qS72TTz3ZDg; Sun, 26 Jul 2020 17:21:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5B8910073; Sun, 26 Jul 2020 17:21:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06QHLOwm093118; Sun, 26 Jul 2020 17:21:24 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06QHLOS6093117; Sun, 26 Jul 2020 17:21:24 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202007261721.06QHLOS6093117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 26 Jul 2020 17:21:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363567 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363567 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 17:21:25 -0000 Author: manu Date: Sun Jul 26 17:21:24 2020 New Revision: 363567 URL: https://svnweb.freebsd.org/changeset/base/363567 Log: Revert r363564 linux/sizes.h doesn't exists in base ... sorry. Modified: head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Modified: head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Sun Jul 26 16:31:49 2020 (r363566) +++ head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Sun Jul 26 17:21:24 2020 (r363567) @@ -38,7 +38,6 @@ #include #include #include -#include #include #include From owner-svn-src-head@freebsd.org Sun Jul 26 17:50:39 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9495367308; Sun, 26 Jul 2020 17:50:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BF9TC51Rtz3bPw; Sun, 26 Jul 2020 17:50:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 910211084E; Sun, 26 Jul 2020 17:50:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06QHodwF011695; Sun, 26 Jul 2020 17:50:39 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06QHodVs011694; Sun, 26 Jul 2020 17:50:39 GMT (envelope-from ian@FreeBSD.org) Message-Id: <202007261750.06QHodVs011694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Jul 2020 17:50:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363569 - head/usr.bin/vmstat X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/usr.bin/vmstat X-SVN-Commit-Revision: 363569 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 17:50:39 -0000 Author: ian Date: Sun Jul 26 17:50:39 2020 New Revision: 363569 URL: https://svnweb.freebsd.org/changeset/base/363569 Log: Remove commented-out lines describing the old never-implemented -t option. In 2018, r338094 removed the commented-out code for supporting the -t command line option which had been present since the BSD 4.4 Lite import, but was never implemented for freebsd. This does the same for the man page. Modified: head/usr.bin/vmstat/vmstat.8 Modified: head/usr.bin/vmstat/vmstat.8 ============================================================================== --- head/usr.bin/vmstat/vmstat.8 Sun Jul 26 17:44:03 2020 (r363568) +++ head/usr.bin/vmstat/vmstat.8 Sun Jul 26 17:50:39 2020 (r363569) @@ -28,7 +28,7 @@ .\" @(#)vmstat.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd May 26, 2020 +.Dd July 26, 2020 .Dt VMSTAT 8 .Os .Sh NAME @@ -209,9 +209,6 @@ Display the contents of the .Em sum structure, giving the total number of several kinds of paging related events which have occurred since system startup. -.\" .It Fl t -.\" Report on the number of page in and page reclaims since system startup, -.\" and the amount of time required by each. .It Fl w Pause .Ar wait From owner-svn-src-head@freebsd.org Sun Jul 26 18:15:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31164367A7E; Sun, 26 Jul 2020 18:15:17 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFB1d0JnNz3d94; Sun, 26 Jul 2020 18:15:16 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA9FC10E65; Sun, 26 Jul 2020 18:15:16 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06QIFGvn030073; Sun, 26 Jul 2020 18:15:16 GMT (envelope-from jrtc27@FreeBSD.org) Received: (from jrtc27@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06QIFG2F030071; Sun, 26 Jul 2020 18:15:16 GMT (envelope-from jrtc27@FreeBSD.org) Message-Id: <202007261815.06QIFG2F030071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jrtc27 set sender to jrtc27@FreeBSD.org using -f From: Jessica Clarke Date: Sun, 26 Jul 2020 18:15:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363571 - in head/sys: conf dev/goldfish riscv/conf X-SVN-Group: head X-SVN-Commit-Author: jrtc27 X-SVN-Commit-Paths: in head/sys: conf dev/goldfish riscv/conf X-SVN-Commit-Revision: 363571 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 18:15:17 -0000 Author: jrtc27 Date: Sun Jul 26 18:15:16 2020 New Revision: 363571 URL: https://svnweb.freebsd.org/changeset/base/363571 Log: Add Goldfish RTC device driver for RISC-V This device was originally used as part of the goldfish virtual hardware platform used for emulating Android on QEMU, but is now also used as the RTC for the RISC-V virt machine in QEMU. It provides a simple 64-bit nanosecond timer exposed via a pair of memory-mapped 32-bit registers, although only with 1s granularity. Reviewed by: brooks (mentor), jhb (mentor), kp Approved by: brooks (mentor), jhb (mentor), kp Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D25717 Added: head/sys/dev/goldfish/ head/sys/dev/goldfish/goldfish_rtc.c (contents, props changed) Modified: head/sys/conf/files head/sys/riscv/conf/GENERIC Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jul 26 18:12:54 2020 (r363570) +++ head/sys/conf/files Sun Jul 26 18:15:16 2020 (r363571) @@ -1736,6 +1736,7 @@ dev/fxp/if_fxp.c optional fxp dev/fxp/inphy.c optional fxp dev/gem/if_gem.c optional gem dev/gem/if_gem_pci.c optional gem pci +dev/goldfish/goldfish_rtc.c optional goldfish_rtc fdt dev/gpio/dwgpio/dwgpio.c optional gpio dwgpio fdt dev/gpio/dwgpio/dwgpio_bus.c optional gpio dwgpio fdt dev/gpio/dwgpio/dwgpio_if.m optional gpio dwgpio fdt Added: head/sys/dev/goldfish/goldfish_rtc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/goldfish/goldfish_rtc.c Sun Jul 26 18:15:16 2020 (r363571) @@ -0,0 +1,182 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Jessica Clarke + * + * 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. + */ + +/* + * RTC for the goldfish virtual hardware platform implemented in QEMU, + * initially for Android but now also used for RISC-V's virt machine. + * + * https://android.googlesource.com/platform/external/qemu/+/master/docs/GOLDFISH-VIRTUAL-HARDWARE.TXT + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "clock_if.h" + +#define GOLDFISH_RTC_TIME_LOW 0x00 +#define GOLDFISH_RTC_TIME_HIGH 0x04 + +struct goldfish_rtc_softc { + struct resource *res; + int rid; + struct mtx mtx; +}; + +static int +goldfish_rtc_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_is_compatible(dev, "google,goldfish-rtc")) { + device_set_desc(dev, "Goldfish RTC"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static int +goldfish_rtc_attach(device_t dev) +{ + struct goldfish_rtc_softc *sc; + + sc = device_get_softc(dev); + + sc->rid = 0; + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->rid, + RF_ACTIVE); + if (sc->res == NULL) { + device_printf(dev, "could not allocate resource\n"); + return (ENXIO); + } + + mtx_init(&sc->mtx, device_get_nameunit(dev), NULL, MTX_DEF); + + /* + * Register as a system realtime clock with 1 second resolution. + */ + clock_register_flags(dev, 1000000, CLOCKF_SETTIME_NO_ADJ); + clock_schedule(dev, 1); + + return (0); +} + +static int +goldfish_rtc_detach(device_t dev) +{ + struct goldfish_rtc_softc *sc; + + sc = device_get_softc(dev); + + clock_unregister(dev); + mtx_destroy(&sc->mtx); + bus_release_resource(dev, SYS_RES_MEMORY, sc->rid, sc->res); + + return (0); +} + +static int +goldfish_rtc_gettime(device_t dev, struct timespec *ts) +{ + struct goldfish_rtc_softc *sc; + uint64_t low, high, nsec; + + sc = device_get_softc(dev); + + /* + * Reading TIME_HIGH is defined in the documentation to give the high + * 32 bits corresponding to the last TIME_LOW read, so must be done in + * that order, but means we have atomicity guaranteed. + */ + mtx_lock(&sc->mtx); + low = bus_read_4(sc->res, GOLDFISH_RTC_TIME_LOW); + high = bus_read_4(sc->res, GOLDFISH_RTC_TIME_HIGH); + mtx_unlock(&sc->mtx); + + nsec = (high << 32) | low; + ts->tv_sec = nsec / 1000000000; + ts->tv_nsec = nsec % 1000000000; + + return (0); +} + +static int +goldfish_rtc_settime(device_t dev, struct timespec *ts) +{ + struct goldfish_rtc_softc *sc; + uint64_t nsec; + + sc = device_get_softc(dev); + + nsec = (uint64_t)ts->tv_sec * 1000000000 + ts->tv_nsec; + + mtx_lock(&sc->mtx); + bus_write_4(sc->res, GOLDFISH_RTC_TIME_HIGH, nsec >> 32); + bus_write_4(sc->res, GOLDFISH_RTC_TIME_LOW, nsec); + mtx_unlock(&sc->mtx); + + return (0); +} + +static device_method_t goldfish_rtc_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, goldfish_rtc_probe), + DEVMETHOD(device_attach, goldfish_rtc_attach), + DEVMETHOD(device_detach, goldfish_rtc_detach), + + /* Clock interface */ + DEVMETHOD(clock_gettime, goldfish_rtc_gettime), + DEVMETHOD(clock_settime, goldfish_rtc_settime), + + DEVMETHOD_END, +}; + +DEFINE_CLASS_0(goldfish_rtc, goldfish_rtc_driver, goldfish_rtc_methods, + sizeof(struct goldfish_rtc_softc)); +static devclass_t goldfish_rtc_devclass; + +DRIVER_MODULE(goldfish_rtc, simplebus, goldfish_rtc_driver, + goldfish_rtc_devclass, NULL, NULL); Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Sun Jul 26 18:12:54 2020 (r363570) +++ head/sys/riscv/conf/GENERIC Sun Jul 26 18:15:16 2020 (r363571) @@ -101,6 +101,8 @@ device uart # Generic UART driver device uart_lowrisc # lowRISC UART driver device uart_ns8250 # ns8250-type UART driver +# RTC +device goldfish_rtc # QEMU RTC # Ethernet drivers device miibus # MII bus support From owner-svn-src-head@freebsd.org Sun Jul 26 18:17:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9815336810B; Sun, 26 Jul 2020 18:17:37 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFB4K3Vskz3dG2; Sun, 26 Jul 2020 18:17:37 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 575B910E69; Sun, 26 Jul 2020 18:17:37 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06QIHbx8030220; Sun, 26 Jul 2020 18:17:37 GMT (envelope-from jrtc27@FreeBSD.org) Received: (from jrtc27@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06QIHa5x030218; Sun, 26 Jul 2020 18:17:36 GMT (envelope-from jrtc27@FreeBSD.org) Message-Id: <202007261817.06QIHa5x030218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jrtc27 set sender to jrtc27@FreeBSD.org using -f From: Jessica Clarke Date: Sun, 26 Jul 2020 18:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363572 - in head/stand/efi/loader/arch: arm riscv X-SVN-Group: head X-SVN-Commit-Author: jrtc27 X-SVN-Commit-Paths: in head/stand/efi/loader/arch: arm riscv X-SVN-Commit-Revision: 363572 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 18:17:37 -0000 Author: jrtc27 Date: Sun Jul 26 18:17:36 2020 New Revision: 363572 URL: https://svnweb.freebsd.org/changeset/base/363572 Log: loader: Avoid -Wpointer-to-int cast warnings for Arm and RISC-V On RISC-V, Clang warns with: cast to smaller integer type 'unsigned int' from 'void (*)(void *)' Instead, use %p as the standard format specifier for printing pointers. Whilst Arm's pointer size is the same as unsigned, it's still cleaner to use the right thing there too. Reviewed by: brooks (mentor), emaste Approved by: brooks (mentor), emaste Differential Revision: https://reviews.freebsd.org/D25718 Modified: head/stand/efi/loader/arch/arm/exec.c head/stand/efi/loader/arch/riscv/exec.c Modified: head/stand/efi/loader/arch/arm/exec.c ============================================================================== --- head/stand/efi/loader/arch/arm/exec.c Sun Jul 26 18:15:16 2020 (r363571) +++ head/stand/efi/loader/arch/arm/exec.c Sun Jul 26 18:17:36 2020 (r363572) @@ -77,7 +77,7 @@ __elfN(arm_exec)(struct preloaded_file *fp) entry = efi_translate(e->e_entry); - printf("Kernel entry at 0x%x...\n", (unsigned)entry); + printf("Kernel entry at %p...\n", entry); printf("Kernel args: %s\n", fp->f_args); if ((error = bi_load(fp->f_args, &modulep, &kernend)) != 0) { Modified: head/stand/efi/loader/arch/riscv/exec.c ============================================================================== --- head/stand/efi/loader/arch/riscv/exec.c Sun Jul 26 18:15:16 2020 (r363571) +++ head/stand/efi/loader/arch/riscv/exec.c Sun Jul 26 18:17:36 2020 (r363572) @@ -63,7 +63,7 @@ __elfN(exec)(struct preloaded_file *fp) entry = efi_translate(e->e_entry); - printf("Kernel entry at 0x%x...\n", (unsigned)entry); + printf("Kernel entry at %p...\n", entry); printf("Kernel args: %s\n", fp->f_args); if ((error = bi_load(fp->f_args, &modulep, &kernend)) != 0) { From owner-svn-src-head@freebsd.org Sun Jul 26 18:19:51 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3B97368286; Sun, 26 Jul 2020 18:19:51 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFB6v3sMwz3dJ5; Sun, 26 Jul 2020 18:19:51 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 67AD610BB8; Sun, 26 Jul 2020 18:19:51 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06QIJp8B030474; Sun, 26 Jul 2020 18:19:51 GMT (envelope-from jrtc27@FreeBSD.org) Received: (from jrtc27@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06QIJpeB030472; Sun, 26 Jul 2020 18:19:51 GMT (envelope-from jrtc27@FreeBSD.org) Message-Id: <202007261819.06QIJpeB030472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jrtc27 set sender to jrtc27@FreeBSD.org using -f From: Jessica Clarke Date: Sun, 26 Jul 2020 18:19:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363573 - in head/sys: conf dev/extres/syscon X-SVN-Group: head X-SVN-Commit-Author: jrtc27 X-SVN-Commit-Paths: in head/sys: conf dev/extres/syscon X-SVN-Commit-Revision: 363573 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 18:19:51 -0000 Author: jrtc27 Date: Sun Jul 26 18:19:50 2020 New Revision: 363573 URL: https://svnweb.freebsd.org/changeset/base/363573 Log: Add syscon power and reset control device driver This device driver supports both syscon-power and syscon-reset devices, as specified in [1] and [2]. These provide a very simple interface for power and reset control, and among other things are used by QEMU's virt machine on RISC-V. A separate commit will enable this on RISC-V, as that requires adding a RISC-V-specific riscv_syscon akin to r327936's aw_syscon. [1] https://www.kernel.org/doc/Documentation/devicetree/bindings/power/reset/syscon-poweroff.txt [2] https://www.kernel.org/doc/Documentation/devicetree/bindings/power/reset/syscon-reboot.txt Reviewed by: brooks (mentor), jhb (mentor) Approved by: brooks (mentor), jhb (mentor) Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D25724 Added: head/sys/dev/extres/syscon/syscon_power.c (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jul 26 18:17:36 2020 (r363572) +++ head/sys/conf/files Sun Jul 26 18:19:50 2020 (r363573) @@ -1702,6 +1702,7 @@ dev/extres/regulator/regulator_fixed.c optional ext_re dev/extres/syscon/syscon.c optional ext_resources syscon dev/extres/syscon/syscon_generic.c optional ext_resources syscon fdt dev/extres/syscon/syscon_if.m optional ext_resources syscon +dev/extres/syscon/syscon_power.c optional ext_resources syscon syscon_power fdt dev/fb/fbd.c optional fbd | vt dev/fb/fb_if.m standard dev/fb/splash.c optional sc splash Added: head/sys/dev/extres/syscon/syscon_power.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/extres/syscon/syscon_power.c Sun Jul 26 18:19:50 2020 (r363573) @@ -0,0 +1,198 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Jessica Clarke + * + * 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. + */ + +/* + * Driver for simple syscon poweroff and reset devices. The device tree + * specifications are fully described at: + * + * https://www.kernel.org/doc/Documentation/devicetree/bindings/power/reset/syscon-poweroff.txt + * https://www.kernel.org/doc/Documentation/devicetree/bindings/power/reset/syscon-reboot.txt + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include "syscon_if.h" +#include "syscon.h" + +struct syscon_power_softc { + struct syscon *regmap; + uint32_t offset; + uint32_t value; + uint32_t mask; + bool reboot; + eventhandler_tag shutdown_tag; +}; + +static void +syscon_power_shutdown_final(device_t dev, int howto) +{ + struct syscon_power_softc *sc; + bool write; + + sc = device_get_softc(dev); + if (sc->reboot) + write = (howto & RB_HALT) == 0; + else + write = (howto & RB_POWEROFF) != 0; + + if (write) + SYSCON_MODIFY_4(sc->regmap, sc->offset, sc->mask, + sc->value & sc->mask); +} + +static int +syscon_power_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_is_compatible(dev, "syscon-poweroff")) { + device_set_desc(dev, "Syscon poweroff"); + return (BUS_PROBE_DEFAULT); + } else if (ofw_bus_is_compatible(dev, "syscon-reboot")) { + device_set_desc(dev, "Syscon reboot"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static int +syscon_power_attach(device_t dev) +{ + struct syscon_power_softc *sc; + phandle_t node; + int error, len; + bool has_mask; + + sc = device_get_softc(dev); + node = ofw_bus_get_node(dev); + + if (!OF_hasprop(node, "regmap")) { + device_printf(dev, "could not find regmap\n"); + return (ENXIO); + } + + error = syscon_get_by_ofw_property(dev, node, "regmap", &sc->regmap); + if (error != 0) { + device_printf(dev, "could not get syscon\n"); + return (ENXIO); + } + + len = OF_getproplen(node, "offset"); + if (len != 4) { + device_printf(dev, "could not get offset\n"); + return (ENXIO); + } + + OF_getencprop(node, "offset", &sc->offset, sizeof(sc->offset)); + + /* Optional mask */ + has_mask = OF_hasprop(node, "mask"); + if (has_mask) { + len = OF_getproplen(node, "mask"); + if (len != 4) { + device_printf(dev, "cannot handle mask\n"); + return (ENXIO); + } + + OF_getencprop(node, "mask", &sc->mask, sizeof(sc->mask)); + } else { + sc->mask = 0xffffffff; + } + + /* + * From the device tree specification: + * + * Legacy usage: If a node doesn't contain a value property but + * contains a mask property, the mask property is used as the value. + */ + if (!OF_hasprop(node, "value")) { + if (!has_mask) { + device_printf(dev, "must have a value or a mask\n"); + return (ENXIO); + } + + sc->value = sc->mask; + } else { + len = OF_getproplen(node, "value"); + if (len != 4) { + device_printf(dev, "cannot handle value\n"); + return (ENXIO); + } + + OF_getencprop(node, "value", &sc->value, sizeof(sc->value)); + } + + sc->reboot = ofw_bus_is_compatible(dev, "syscon-reboot"); + sc->shutdown_tag = EVENTHANDLER_REGISTER(shutdown_final, + syscon_power_shutdown_final, dev, SHUTDOWN_PRI_LAST); + + return (0); +} + +static int +syscon_power_detach(device_t dev) +{ + struct syscon_power_softc *sc; + + sc = device_get_softc(dev); + EVENTHANDLER_DEREGISTER(shutdown_final, sc->shutdown_tag); + + return (0); +} + +static device_method_t syscon_power_methods[] = { + DEVMETHOD(device_probe, syscon_power_probe), + DEVMETHOD(device_attach, syscon_power_attach), + DEVMETHOD(device_detach, syscon_power_detach), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(syscon_power, syscon_power_driver, syscon_power_methods, + sizeof(struct syscon_power_softc)); +static devclass_t syscon_power_devclass; + +DRIVER_MODULE(syscon_power, simplebus, syscon_power_driver, + syscon_power_devclass, NULL, NULL); From owner-svn-src-head@freebsd.org Sun Jul 26 18:21:03 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F39D368383; Sun, 26 Jul 2020 18:21:03 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFB8H3m2Rz3djM; Sun, 26 Jul 2020 18:21:03 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6476C11197; Sun, 26 Jul 2020 18:21:03 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06QIL3aA032206; Sun, 26 Jul 2020 18:21:03 GMT (envelope-from jrtc27@FreeBSD.org) Received: (from jrtc27@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06QIL25C032203; Sun, 26 Jul 2020 18:21:02 GMT (envelope-from jrtc27@FreeBSD.org) Message-Id: <202007261821.06QIL25C032203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jrtc27 set sender to jrtc27@FreeBSD.org using -f From: Jessica Clarke Date: Sun, 26 Jul 2020 18:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363574 - in head/sys: conf riscv/conf riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jrtc27 X-SVN-Commit-Paths: in head/sys: conf riscv/conf riscv/riscv X-SVN-Commit-Revision: 363574 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 18:21:03 -0000 Author: jrtc27 Date: Sun Jul 26 18:21:02 2020 New Revision: 363574 URL: https://svnweb.freebsd.org/changeset/base/363574 Log: riscv: Include syscon_power device driver in GENERIC kernel config QEMU's RISC-V virt machine provides syscon-power and syscon-reset devices as the means by which to shutdown and reboot. We also need to ensure that we have attached the syscon_generic device before attaching any syscon_power devices, and so we introduce a new riscv_syscon device akin to aw_syscon added in r327936. Currently the SiFive test finisher is used as the specific implementation of such a syscon device. Reviewed by: br, brooks (mentor), jhb (mentor) Approved by: br, brooks (mentor), jhb (mentor) Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D25725 Added: head/sys/riscv/riscv/riscv_syscon.c (contents, props changed) Modified: head/sys/conf/files.riscv head/sys/riscv/conf/GENERIC Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Sun Jul 26 18:19:50 2020 (r363573) +++ head/sys/conf/files.riscv Sun Jul 26 18:21:02 2020 (r363574) @@ -57,6 +57,7 @@ riscv/riscv/ofw_machdep.c optional fdt riscv/riscv/plic.c standard riscv/riscv/pmap.c standard riscv/riscv/riscv_console.c optional rcons +riscv/riscv/riscv_syscon.c optional ext_resources syscon riscv_syscon fdt riscv/riscv/sbi.c standard riscv/riscv/soc.c standard riscv/riscv/stack_machdep.c optional ddb | stack Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Sun Jul 26 18:19:50 2020 (r363573) +++ head/sys/riscv/conf/GENERIC Sun Jul 26 18:21:02 2020 (r363574) @@ -77,6 +77,13 @@ options INTRNG # RISC-V SBI console device rcons +# EXT_RESOURCES pseudo devices +options EXT_RESOURCES +device clk +device syscon +device syscon_power +device riscv_syscon + # Bus drivers device pci Added: head/sys/riscv/riscv/riscv_syscon.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/riscv/riscv_syscon.c Sun Jul 26 18:21:02 2020 (r363574) @@ -0,0 +1,84 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Kyle Evans + * Copyright (c) 2020 Jessica Clarke + * + * 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. + */ + +/* + * RISC-V syscon driver. Used as a generic interface by QEMU's virt machine for + * describing the SiFive test finisher as a power and reset controller. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +static struct ofw_compat_data compat_data[] = { + {"sifive,test0", 1}, + {"sifive,test1", 1}, + {NULL, 0} +}; + +static int +riscv_syscon_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "RISC-V syscon"); + return (BUS_PROBE_DEFAULT); +} + +static device_method_t riscv_syscon_methods[] = { + DEVMETHOD(device_probe, riscv_syscon_probe), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(riscv_syscon, riscv_syscon_driver, riscv_syscon_methods, + sizeof(struct syscon_generic_softc), syscon_generic_driver); + +static devclass_t riscv_syscon_devclass; +/* riscv_syscon needs to attach prior to syscon_power */ +EARLY_DRIVER_MODULE(riscv_syscon, simplebus, riscv_syscon_driver, + riscv_syscon_devclass, 0, 0, BUS_PASS_SCHEDULER + BUS_PASS_ORDER_LAST); +MODULE_VERSION(riscv_syscon, 1); From owner-svn-src-head@freebsd.org Sun Jul 26 18:33:29 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D38FD36871B; Sun, 26 Jul 2020 18:33:29 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFBQd5FdVz3fJ3; Sun, 26 Jul 2020 18:33:29 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9621411041; Sun, 26 Jul 2020 18:33:29 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06QIXTjm042483; Sun, 26 Jul 2020 18:33:29 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06QIXTqD042482; Sun, 26 Jul 2020 18:33:29 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202007261833.06QIXTqD042482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 26 Jul 2020 18:33:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363575 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363575 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 18:33:29 -0000 Author: manu Date: Sun Jul 26 18:33:29 2020 New Revision: 363575 URL: https://svnweb.freebsd.org/changeset/base/363575 Log: Fix r363565 lockdep.h needs sys/lock.h for LOCK_CLASS Modified: head/sys/compat/linuxkpi/common/include/linux/lockdep.h Modified: head/sys/compat/linuxkpi/common/include/linux/lockdep.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/lockdep.h Sun Jul 26 18:21:02 2020 (r363574) +++ head/sys/compat/linuxkpi/common/include/linux/lockdep.h Sun Jul 26 18:33:29 2020 (r363575) @@ -32,6 +32,8 @@ #ifndef _LINUX_LOCKDEP_H_ #define _LINUX_LOCKDEP_H_ +#include + struct lock_class_key { }; From owner-svn-src-head@freebsd.org Sun Jul 26 18:33:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A1E1368449; Sun, 26 Jul 2020 18:33:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFBQf3dNPz3fWZ; Sun, 26 Jul 2020 18:33:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60054111E1; Sun, 26 Jul 2020 18:33:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06QIXU9f042526; Sun, 26 Jul 2020 18:33:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06QIXUCU042525; Sun, 26 Jul 2020 18:33:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <202007261833.06QIXUCU042525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Jul 2020 18:33:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363576 - head/usr.bin/vmstat X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/usr.bin/vmstat X-SVN-Commit-Revision: 363576 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 18:33:30 -0000 Author: ian Date: Sun Jul 26 18:33:29 2020 New Revision: 363576 URL: https://svnweb.freebsd.org/changeset/base/363576 Log: Describe the value in the 're' column of vmstat(8) in terms of freebsd's vm implementation. The old description was left over from the 4.4 BSD Lite import in 1994, and was a bit misleading (not all arches use simulated reference bits, some implement reference tracking in hardware). Modified: head/usr.bin/vmstat/vmstat.8 Modified: head/usr.bin/vmstat/vmstat.8 ============================================================================== --- head/usr.bin/vmstat/vmstat.8 Sun Jul 26 18:33:29 2020 (r363575) +++ head/usr.bin/vmstat/vmstat.8 Sun Jul 26 18:33:29 2020 (r363576) @@ -283,7 +283,7 @@ These are given in units per second. .It flt total number of page faults .It re -page reclaims (simulating reference bits) +pages reactivated (found in laundry or inactive queues) .\" .It at .\" pages attached (found in free list) .It pi From owner-svn-src-head@freebsd.org Sun Jul 26 22:30:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B9B436EAAC; Sun, 26 Jul 2020 22:30:02 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFHgZ1qlwz49Bn; Sun, 26 Jul 2020 22:30:02 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 237C814104; Sun, 26 Jul 2020 22:30:02 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06QMU2NA084794; Sun, 26 Jul 2020 22:30:02 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06QMU1Xw084792; Sun, 26 Jul 2020 22:30:01 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202007262230.06QMU1Xw084792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 26 Jul 2020 22:30:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363584 - head/sys/geom X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sys/geom X-SVN-Commit-Revision: 363584 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 22:30:02 -0000 Author: delphij Date: Sun Jul 26 22:30:01 2020 New Revision: 363584 URL: https://svnweb.freebsd.org/changeset/base/363584 Log: geom_map and geom_redboot: Remove unused ctlreq handler. The two classes do not take any verbs and always gctl_error for all requests, so don't bother to provide a ctlreq handler. Reviewed by: mav MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25810 Modified: head/sys/geom/geom_map.c head/sys/geom/geom_redboot.c Modified: head/sys/geom/geom_map.c ============================================================================== --- head/sys/geom/geom_map.c Sun Jul 26 19:51:42 2020 (r363583) +++ head/sys/geom/geom_map.c Sun Jul 26 22:30:01 2020 (r363584) @@ -387,24 +387,11 @@ g_map_taste(struct g_class *mp, struct g_provider *pp, return (gp); } -static void -g_map_config(struct gctl_req *req, struct g_class *mp, const char *verb) -{ - struct g_geom *gp; - - g_topology_assert(); - gp = gctl_get_geom(req, mp, "geom"); - if (gp == NULL) - return; - gctl_error(req, "Unknown verb"); -} - static struct g_class g_map_class = { .name = MAP_CLASS_NAME, .version = G_VERSION, .taste = g_map_taste, .dumpconf = g_map_dumpconf, - .ctlreq = g_map_config, }; DECLARE_GEOM_CLASS(g_map_class, g_map); MODULE_VERSION(geom_map, 0); Modified: head/sys/geom/geom_redboot.c ============================================================================== --- head/sys/geom/geom_redboot.c Sun Jul 26 19:51:42 2020 (r363583) +++ head/sys/geom/geom_redboot.c Sun Jul 26 22:30:01 2020 (r363584) @@ -336,24 +336,11 @@ again: return (gp); } -static void -g_redboot_config(struct gctl_req *req, struct g_class *mp, const char *verb) -{ - struct g_geom *gp; - - g_topology_assert(); - gp = gctl_get_geom(req, mp, "geom"); - if (gp == NULL) - return; - gctl_error(req, "Unknown verb"); -} - static struct g_class g_redboot_class = { .name = REDBOOT_CLASS_NAME, .version = G_VERSION, .taste = g_redboot_taste, .dumpconf = g_redboot_dumpconf, - .ctlreq = g_redboot_config, .ioctl = g_redboot_ioctl, }; DECLARE_GEOM_CLASS(g_redboot_class, g_redboot); From owner-svn-src-head@freebsd.org Sun Jul 26 22:30:56 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 16A5636EB97; Sun, 26 Jul 2020 22:30:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFHhb6vYQz49cw; Sun, 26 Jul 2020 22:30:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6EA713F9C; Sun, 26 Jul 2020 22:30:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06QMUtuL085626; Sun, 26 Jul 2020 22:30:55 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06QMUtBi085623; Sun, 26 Jul 2020 22:30:55 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202007262230.06QMUtBi085623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 26 Jul 2020 22:30:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363585 - head/sys/geom X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sys/geom X-SVN-Commit-Revision: 363585 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 22:30:56 -0000 Author: delphij Date: Sun Jul 26 22:30:55 2020 New Revision: 363585 URL: https://svnweb.freebsd.org/changeset/base/363585 Log: gctl_get_geom: Skip validation of g_class. The caller from kernel is expected to provide an valid g_class pointer, instead of traversing the global g_class list, just use that pointer directly instead. Reviewed by: mav MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25811 Modified: head/sys/geom/geom.h head/sys/geom/geom_ctl.c Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Sun Jul 26 22:30:01 2020 (r363584) +++ head/sys/geom/geom.h Sun Jul 26 22:30:55 2020 (r363585) @@ -434,7 +434,7 @@ void *gctl_get_paraml(struct gctl_req *req, const char void *gctl_get_paraml_opt(struct gctl_req *req, const char *param, int len); int gctl_error(struct gctl_req *req, const char *fmt, ...) __printflike(2, 3); struct g_class *gctl_get_class(struct gctl_req *req, char const *arg); -struct g_geom *gctl_get_geom(struct gctl_req *req, struct g_class *mpr, char const *arg); +struct g_geom *gctl_get_geom(struct gctl_req *req, struct g_class *mp, char const *arg); struct g_provider *gctl_get_provider(struct gctl_req *req, char const *arg); #endif /* _GEOM_GEOM_H_ */ Modified: head/sys/geom/geom_ctl.c ============================================================================== --- head/sys/geom/geom_ctl.c Sun Jul 26 22:30:01 2020 (r363584) +++ head/sys/geom/geom_ctl.c Sun Jul 26 22:30:55 2020 (r363585) @@ -409,25 +409,20 @@ gctl_get_class(struct gctl_req *req, char const *arg) } struct g_geom * -gctl_get_geom(struct gctl_req *req, struct g_class *mpr, char const *arg) +gctl_get_geom(struct gctl_req *req, struct g_class *mp, char const *arg) { char const *p; - struct g_class *mp; struct g_geom *gp; + MPASS(mp != NULL); p = gctl_get_asciiparam(req, arg); if (p == NULL) { gctl_error(req, "Missing %s argument", arg); return (NULL); } - LIST_FOREACH(mp, &g_classes, class) { - if (mpr != NULL && mpr != mp) - continue; - LIST_FOREACH(gp, &mp->geom, geom) { - if (!strcmp(p, gp->name)) - return (gp); - } - } + LIST_FOREACH(gp, &mp->geom, geom) + if (!strcmp(p, gp->name)) + return (gp); gctl_error(req, "Geom not found: \"%s\"", p); return (NULL); } From owner-svn-src-head@freebsd.org Sun Jul 26 23:03:42 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24FBF36F7D0; Sun, 26 Jul 2020 23:03:42 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFJQQ09LCz4Bly; Sun, 26 Jul 2020 23:03:42 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2EA9142F5; Sun, 26 Jul 2020 23:03:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06QN3fRt009027; Sun, 26 Jul 2020 23:03:41 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06QN3f14009026; Sun, 26 Jul 2020 23:03:41 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202007262303.06QN3f14009026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 26 Jul 2020 23:03:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363586 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 363586 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 23:03:42 -0000 Author: rmacklem Date: Sun Jul 26 23:03:41 2020 New Revision: 363586 URL: https://svnweb.freebsd.org/changeset/base/363586 Log: Fix the NFS server so that it sets va_birthtime. r362490 marked that the NFSv4 attribute TimeCreate (va_birthtime) is supported, but it did not change the NFS server code to actually do it. As such, errors could occur when unrolling a tarball onto an NFSv4 mounted volume, since setting TimeCreate would fail with a NFSERR_ATTRNOTSUPP reply. This patch fixes the server so that it does TimeCreate and also makes sure that TimeCreate will not be set for a DS file for a pNFS server. A separate commit will add a check to the NFSv4 client for support of the TimeCreate attribute before attempting to set it, to avoid a problem when mounting a server that does not support the attribute. The failures will still occur for r362490 or later kernels that do not have this patch, since they indicate support for the attribute, but do not actually support the attribute. Modified: head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Sun Jul 26 22:30:55 2020 (r363585) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Sun Jul 26 23:03:41 2020 (r363586) @@ -459,6 +459,7 @@ nfsvno_setattr(struct vnode *vp, struct nfsvattr *nvap { u_quad_t savsize = 0; int error, savedit; + time_t savbtime; /* * If this is an exported file system and a pNFS service is running, @@ -490,9 +491,13 @@ nfsvno_setattr(struct vnode *vp, struct nfsvattr *nvap nvap->na_vattr.va_mode != (mode_t)VNOVAL || nvap->na_vattr.va_atime.tv_sec != VNOVAL || nvap->na_vattr.va_mtime.tv_sec != VNOVAL)) { + /* Never modify birthtime on a DS file. */ + savbtime = nvap->na_vattr.va_birthtime.tv_sec; + nvap->na_vattr.va_birthtime.tv_sec = VNOVAL; /* For a pNFS server, set the attributes on the DS file. */ error = nfsrv_proxyds(vp, 0, 0, cred, p, NFSPROC_SETATTR, NULL, NULL, NULL, nvap, NULL, NULL, 0, NULL); + nvap->na_vattr.va_birthtime.tv_sec = savbtime; if (error == ENOENT) error = 0; } @@ -2914,8 +2919,7 @@ nfsv4_sattr(struct nfsrv_descript *nd, vnode_t vp, str break; case NFSATTRBIT_TIMECREATE: NFSM_DISSECT(tl, u_int32_t *, NFSX_V4TIME); - if (!nd->nd_repstat) - nd->nd_repstat = NFSERR_ATTRNOTSUPP; + fxdr_nfsv4time(tl, &nvap->na_btime); attrsum += NFSX_V4TIME; break; case NFSATTRBIT_TIMEMODIFYSET: From owner-svn-src-head@freebsd.org Sun Jul 26 23:13:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A115436F82C; Sun, 26 Jul 2020 23:13:11 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFJdM3jvwz4CLL; Sun, 26 Jul 2020 23:13:11 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6415214918; Sun, 26 Jul 2020 23:13:11 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06QNDBRs014916; Sun, 26 Jul 2020 23:13:11 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06QNDBJu014915; Sun, 26 Jul 2020 23:13:11 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202007262313.06QNDBJu014915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 26 Jul 2020 23:13:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363587 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 363587 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 23:13:11 -0000 Author: rmacklem Date: Sun Jul 26 23:13:10 2020 New Revision: 363587 URL: https://svnweb.freebsd.org/changeset/base/363587 Log: Fix the NFSv4 client so that it checks for support of TimeCreate before trying to set it. r362490 added support for setting of the TimeCreate (va_birthtime) attribute, but it does so without checking to see if the server supports the attribute. This could result in NFSERR_ATTRNOTSUPP error replies to the Setattr operation. This patch adds code to check that the server supports TimeCreate before attempting to do a Setattr of it to avoid these error returns. Modified: head/sys/fs/nfs/nfs_commonsubs.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Sun Jul 26 23:03:41 2020 (r363586) +++ head/sys/fs/nfs/nfs_commonsubs.c Sun Jul 26 23:13:10 2020 (r363587) @@ -504,6 +504,7 @@ nfscl_fillsattr(struct nfsrv_descript *nd, struct vatt u_int32_t *tl; struct nfsv2_sattr *sp; nfsattrbit_t attrbits; + struct nfsnode *np; switch (nd->nd_flag & (ND_NFSV2 | ND_NFSV3 | ND_NFSV4)) { case ND_NFSV2: @@ -605,8 +606,18 @@ nfscl_fillsattr(struct nfsrv_descript *nd, struct vatt NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEACCESSSET); if (vap->va_mtime.tv_sec != VNOVAL) NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMEMODIFYSET); - if (vap->va_birthtime.tv_sec != VNOVAL) - NFSSETBIT_ATTRBIT(&attrbits, NFSATTRBIT_TIMECREATE); + if (vap->va_birthtime.tv_sec != VNOVAL && + strcmp(vp->v_mount->mnt_vfc->vfc_name, "nfs") == 0) { + /* + * We can only test for support of TimeCreate if + * the "vp" argument is for an NFS vnode. + */ + np = VTONFS(vp); + if (NFSISSET_ATTRBIT(&np->n_vattr.na_suppattr, + NFSATTRBIT_TIMECREATE)) + NFSSETBIT_ATTRBIT(&attrbits, + NFSATTRBIT_TIMECREATE); + } (void) nfsv4_fillattr(nd, vp->v_mount, vp, NULL, vap, NULL, 0, &attrbits, NULL, NULL, 0, 0, 0, 0, (uint64_t)0, NULL); break; From owner-svn-src-head@freebsd.org Mon Jul 27 01:18:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B74137215F; Mon, 27 Jul 2020 01:18:00 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFMPN1kBsz4J98; Mon, 27 Jul 2020 01:18:00 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A03315F89; Mon, 27 Jul 2020 01:18:00 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06R1Hx9f089243; Mon, 27 Jul 2020 01:17:59 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06R1HxSX089242; Mon, 27 Jul 2020 01:17:59 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202007270117.06R1HxSX089242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 27 Jul 2020 01:17:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363590 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 363590 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 01:18:00 -0000 Author: mmacy Date: Mon Jul 27 01:17:59 2020 New Revision: 363590 URL: https://svnweb.freebsd.org/changeset/base/363590 Log: iflib: fix LOR with bpf detach Reported by: grehan@ Approved by: grehan@ MFC after: 1 week Sponsored by: Netgate Differential Revision: https://reviews.freebsd.org/D25530 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Mon Jul 27 00:26:54 2020 (r363589) +++ head/sys/net/iflib.c Mon Jul 27 01:17:59 2020 (r363590) @@ -4192,7 +4192,9 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) { if ((if_getflags(ifp) ^ ctx->ifc_if_flags) & (IFF_PROMISC | IFF_ALLMULTI)) { + CTX_UNLOCK(ctx); err = IFDI_PROMISC_SET(ctx, if_getflags(ifp)); + CTX_LOCK(ctx); } } else reinit = 1; From owner-svn-src-head@freebsd.org Mon Jul 27 03:13:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0500337536B; Mon, 27 Jul 2020 03:13:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFPyW6J5Xz4PXL; Mon, 27 Jul 2020 03:13:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB76117428; Mon, 27 Jul 2020 03:13:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06R3DNf9063937; Mon, 27 Jul 2020 03:13:23 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06R3DN0c063936; Mon, 27 Jul 2020 03:13:23 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202007270313.06R3DN0c063936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 27 Jul 2020 03:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363595 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363595 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 03:13:24 -0000 Author: kevans Date: Mon Jul 27 03:13:23 2020 New Revision: 363595 URL: https://svnweb.freebsd.org/changeset/base/363595 Log: makesyscalls.sh: spit out a deprecation notice to stderr This has for a while been replaced by makesyscalls.lua in the stock FreeBSD build. Ensure downstreams get some notice that it'a going away if they're reliant on it, maybe. Modified: head/sys/kern/makesyscalls.sh Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Mon Jul 27 01:53:27 2020 (r363594) +++ head/sys/kern/makesyscalls.sh Mon Jul 27 03:13:23 2020 (r363595) @@ -60,6 +60,8 @@ case $# in ;; esac +1>&2 echo "$0: This script is deprecated and will be removed before FreeBSD 13." + if [ -n "$2" ]; then . "$2" fi From owner-svn-src-head@freebsd.org Mon Jul 27 07:56:56 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1748C379C0B; Mon, 27 Jul 2020 07:56:56 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFXFh0BhMz4bfL; Mon, 27 Jul 2020 07:56:56 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDDE21A6E9; Mon, 27 Jul 2020 07:56:55 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06R7utY1035265; Mon, 27 Jul 2020 07:56:55 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06R7ut6m035264; Mon, 27 Jul 2020 07:56:55 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <202007270756.06R7ut6m035264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Mon, 27 Jul 2020 07:56:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363596 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 363596 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 07:56:56 -0000 Author: grehan Date: Mon Jul 27 07:56:55 2020 New Revision: 363596 URL: https://svnweb.freebsd.org/changeset/base/363596 Log: Support the setting of additional AHCI controller parameters. Allow the serial number, firmware revision, model number and nominal media rotation rate (nmrr) parameters to be set from the command line. Note that setting the nmrr value can be used to indicate the AHCI device is an SSD. Submitted by: Wanpeng Qian Reviewed by: jhb, grehan (#bhyve) Approved by: jhb, grehan MFC after: 3 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D24174 Modified: head/usr.sbin/bhyve/bhyve.8 head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Mon Jul 27 03:13:23 2020 (r363595) +++ head/usr.sbin/bhyve/bhyve.8 Mon Jul 27 07:56:55 2020 (r363596) @@ -540,6 +540,18 @@ Sector size (defaults to blockif sector size). Serial number with maximum 20 characters. .El .Pp +AHCI devices: +.Bl -tag -width 10n +.It Li nmrr +Nominal Media Rotation Rate, known as RPM. value 1 will indicate device as Solid State Disk. default value is 0, not report. +.It Li ser +Serial Number with maximum 20 characters. +.It Li rev +Revision Number with maximum 8 characters. +.It Li model +Model Number with maximum 40 characters. +.El +.Pp HD Audio devices: .Bl -tag -width 10n .It Li play Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Mon Jul 27 03:13:23 2020 (r363595) +++ head/usr.sbin/bhyve/pci_ahci.c Mon Jul 27 07:56:55 2020 (r363596) @@ -139,9 +139,9 @@ struct ahci_ioreq { struct ahci_port { struct blockif_ctxt *bctx; struct pci_ahci_softc *pr_sc; + struct ata_params ata_ident; uint8_t *cmd_lst; uint8_t *rfis; - char ident[AHCI_PORT_IDENT]; int port; int atapi; int reset; @@ -987,7 +987,49 @@ handle_identify(struct ahci_port *p, int slot, uint8_t ahci_write_fis_d2h(p, slot, cfis, (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); } else { - uint16_t buf[256]; + ahci_write_fis_piosetup(p); + write_prdt(p, slot, cfis, (void*)&p->ata_ident, sizeof(struct ata_params)); + ahci_write_fis_d2h(p, slot, cfis, ATA_S_DSC | ATA_S_READY); + } +} + +static void +ata_identify_init(struct ahci_port* p, int atapi) +{ + struct ata_params* ata_ident = &p->ata_ident; + + if (atapi) { + ata_ident->config = (2 << 14 | 5 << 8 | 1 << 7 | 2 << 5); + ata_ident->capabilities1 = ATA_SUPPORT_LBA | + ATA_SUPPORT_DMA; + ata_ident->capabilities2 = (1 << 14 | 1); + ata_ident->atavalid = ATA_FLAG_54_58 | ATA_FLAG_64_70; + ata_ident->obsolete62 = 0x3f; + ata_ident->mwdmamodes = 7; + if (p->xfermode & ATA_WDMA0) + ata_ident->mwdmamodes |= (1 << ((p->xfermode & 7) + 8)); + ata_ident->apiomodes = 3; + ata_ident->mwdmamin = 0x0078; + ata_ident->mwdmarec = 0x0078; + ata_ident->pioblind = 0x0078; + ata_ident->pioiordy = 0x0078; + ata_ident->satacapabilities = (ATA_SATA_GEN1 | ATA_SATA_GEN2 | ATA_SATA_GEN3); + ata_ident->satacapabilities2 = ((p->ssts & ATA_SS_SPD_MASK) >> 3); + ata_ident->satasupport = ATA_SUPPORT_NCQ_STREAM; + ata_ident->version_major = 0x3f0; + ata_ident->support.command1 = (ATA_SUPPORT_POWERMGT | ATA_SUPPORT_PACKET | + ATA_SUPPORT_RESET | ATA_SUPPORT_NOP); + ata_ident->support.command2 = (1 << 14); + ata_ident->support.extension = (1 << 14); + ata_ident->enabled.command1 = (ATA_SUPPORT_POWERMGT | ATA_SUPPORT_PACKET | + ATA_SUPPORT_RESET | ATA_SUPPORT_NOP); + ata_ident->enabled.extension = (1 << 14); + ata_ident->udmamodes = 0x7f; + if (p->xfermode & ATA_UDMA0) + ata_ident->udmamodes |= (1 << ((p->xfermode & 7) + 8)); + ata_ident->transport_major = 0x1020; + ata_ident->integrity = 0x00a5; + } else { uint64_t sectors; int sectsz, psectsz, psectoff, candelete, ro; uint16_t cyl; @@ -999,87 +1041,85 @@ handle_identify(struct ahci_port *p, int slot, uint8_t sectors = blockif_size(p->bctx) / sectsz; blockif_chs(p->bctx, &cyl, &heads, &sech); blockif_psectsz(p->bctx, &psectsz, &psectoff); - memset(buf, 0, sizeof(buf)); - buf[0] = 0x0040; - buf[1] = cyl; - buf[3] = heads; - buf[6] = sech; - ata_string((uint8_t *)(buf+10), p->ident, 20); - ata_string((uint8_t *)(buf+23), "001", 8); - ata_string((uint8_t *)(buf+27), "BHYVE SATA DISK", 40); - buf[47] = (0x8000 | 128); - buf[48] = 0; - buf[49] = (1 << 8 | 1 << 9 | 1 << 11); - buf[50] = (1 << 14); - buf[53] = (1 << 1 | 1 << 2); + ata_ident->config = ATA_DRQ_FAST; + ata_ident->cylinders = cyl; + ata_ident->heads = heads; + ata_ident->sectors = sech; + + ata_ident->sectors_intr = (0x8000 | 128); + ata_ident->tcg = 0; + + ata_ident->capabilities1 = ATA_SUPPORT_DMA | + ATA_SUPPORT_LBA | ATA_SUPPORT_IORDY; + ata_ident->capabilities2 = (1 << 14); + ata_ident->atavalid = ATA_FLAG_54_58 | + ATA_FLAG_64_70; if (p->mult_sectors) - buf[59] = (0x100 | p->mult_sectors); + ata_ident->multi = (ATA_MULTI_VALID | p->mult_sectors); if (sectors <= 0x0fffffff) { - buf[60] = sectors; - buf[61] = (sectors >> 16); + ata_ident->lba_size_1 = sectors; + ata_ident->lba_size_2 = (sectors >> 16); } else { - buf[60] = 0xffff; - buf[61] = 0x0fff; + ata_ident->lba_size_1 = 0xffff; + ata_ident->lba_size_2 = 0x0fff; } - buf[63] = 0x7; + ata_ident->mwdmamodes = 0x7; if (p->xfermode & ATA_WDMA0) - buf[63] |= (1 << ((p->xfermode & 7) + 8)); - buf[64] = 0x3; - buf[65] = 120; - buf[66] = 120; - buf[67] = 120; - buf[68] = 120; - buf[69] = 0; - buf[75] = 31; - buf[76] = (ATA_SATA_GEN1 | ATA_SATA_GEN2 | ATA_SATA_GEN3 | - ATA_SUPPORT_NCQ); - buf[77] = (ATA_SUPPORT_RCVSND_FPDMA_QUEUED | - (p->ssts & ATA_SS_SPD_MASK) >> 3); - buf[80] = 0x3f0; - buf[81] = 0x28; - buf[82] = (ATA_SUPPORT_POWERMGT | ATA_SUPPORT_WRITECACHE| - ATA_SUPPORT_LOOKAHEAD | ATA_SUPPORT_NOP); - buf[83] = (ATA_SUPPORT_ADDRESS48 | ATA_SUPPORT_FLUSHCACHE | - ATA_SUPPORT_FLUSHCACHE48 | 1 << 14); - buf[84] = (1 << 14); - buf[85] = (ATA_SUPPORT_POWERMGT | ATA_SUPPORT_WRITECACHE| - ATA_SUPPORT_LOOKAHEAD | ATA_SUPPORT_NOP); - buf[86] = (ATA_SUPPORT_ADDRESS48 | ATA_SUPPORT_FLUSHCACHE | - ATA_SUPPORT_FLUSHCACHE48 | 1 << 15); - buf[87] = (1 << 14); - buf[88] = 0x7f; + ata_ident->mwdmamodes |= (1 << ((p->xfermode & 7) + 8)); + ata_ident->apiomodes = 0x3; + ata_ident->mwdmamin = 0x0078; + ata_ident->mwdmarec = 0x0078; + ata_ident->pioblind = 0x0078; + ata_ident->pioiordy = 0x0078; + ata_ident->support3 = 0; + ata_ident->queue = 31; + ata_ident->satacapabilities = (ATA_SATA_GEN1 | ATA_SATA_GEN2 | ATA_SATA_GEN3 | + ATA_SUPPORT_NCQ); + ata_ident->satacapabilities2 = (ATA_SUPPORT_RCVSND_FPDMA_QUEUED | + (p->ssts & ATA_SS_SPD_MASK) >> 3); + ata_ident->version_major = 0x3f0; + ata_ident->version_minor = 0x28; + ata_ident->support.command1 = (ATA_SUPPORT_POWERMGT | ATA_SUPPORT_WRITECACHE | + ATA_SUPPORT_LOOKAHEAD | ATA_SUPPORT_NOP); + ata_ident->support.command2 = (ATA_SUPPORT_ADDRESS48 | ATA_SUPPORT_FLUSHCACHE | + ATA_SUPPORT_FLUSHCACHE48 | 1 << 14); + ata_ident->support.extension = (1 << 14); + ata_ident->enabled.command1 = (ATA_SUPPORT_POWERMGT | ATA_SUPPORT_WRITECACHE | + ATA_SUPPORT_LOOKAHEAD | ATA_SUPPORT_NOP); + ata_ident->enabled.command2 = (ATA_SUPPORT_ADDRESS48 | ATA_SUPPORT_FLUSHCACHE | + ATA_SUPPORT_FLUSHCACHE48 | 1 << 15); + ata_ident->enabled.extension = (1 << 14); + ata_ident->udmamodes = 0x7f; if (p->xfermode & ATA_UDMA0) - buf[88] |= (1 << ((p->xfermode & 7) + 8)); - buf[100] = sectors; - buf[101] = (sectors >> 16); - buf[102] = (sectors >> 32); - buf[103] = (sectors >> 48); + ata_ident->udmamodes |= (1 << ((p->xfermode & 7) + 8)); + ata_ident->lba_size48_1 = sectors; + ata_ident->lba_size48_2 = (sectors >> 16); + ata_ident->lba_size48_3 = (sectors >> 32); + ata_ident->lba_size48_4 = (sectors >> 48); + if (candelete && !ro) { - buf[69] |= ATA_SUPPORT_RZAT | ATA_SUPPORT_DRAT; - buf[105] = 1; - buf[169] = ATA_SUPPORT_DSM_TRIM; + ata_ident->support3 |= ATA_SUPPORT_RZAT | ATA_SUPPORT_DRAT; + ata_ident->max_dsm_blocks = 1; + ata_ident->support_dsm = ATA_SUPPORT_DSM_TRIM; } - buf[106] = 0x4000; - buf[209] = 0x4000; + ata_ident->pss = ATA_PSS_VALID_VALUE; + ata_ident->lsalign = 0x4000; if (psectsz > sectsz) { - buf[106] |= 0x2000; - buf[106] |= ffsl(psectsz / sectsz) - 1; - buf[209] |= (psectoff / sectsz); + ata_ident->pss |= ATA_PSS_MULTLS; + ata_ident->pss |= ffsl(psectsz / sectsz) - 1; + ata_ident->lsalign |= (psectoff / sectsz); } if (sectsz > 512) { - buf[106] |= 0x1000; - buf[117] = sectsz / 2; - buf[118] = ((sectsz / 2) >> 16); + ata_ident->pss |= ATA_PSS_LSSABOVE512; + ata_ident->lss_1 = sectsz / 2; + ata_ident->lss_2 = ((sectsz / 2) >> 16); } - buf[119] = (ATA_SUPPORT_RWLOGDMAEXT | 1 << 14); - buf[120] = (ATA_SUPPORT_RWLOGDMAEXT | 1 << 14); - buf[222] = 0x1020; - buf[255] = 0x00a5; - ahci_checksum((uint8_t *)buf, sizeof(buf)); - ahci_write_fis_piosetup(p); - write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); - ahci_write_fis_d2h(p, slot, cfis, ATA_S_DSC | ATA_S_READY); + ata_ident->support2 = (ATA_SUPPORT_RWLOGDMAEXT | 1 << 14); + ata_ident->enabled2 = (ATA_SUPPORT_RWLOGDMAEXT | 1 << 14); + ata_ident->transport_major = 0x1020; + ata_ident->integrity = 0x00a5; } + ahci_checksum((uint8_t*)ata_ident, sizeof(struct ata_params)); } static void @@ -1089,44 +1129,8 @@ handle_atapi_identify(struct ahci_port *p, int slot, u ahci_write_fis_d2h(p, slot, cfis, (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR); } else { - uint16_t buf[256]; - - memset(buf, 0, sizeof(buf)); - buf[0] = (2 << 14 | 5 << 8 | 1 << 7 | 2 << 5); - ata_string((uint8_t *)(buf+10), p->ident, 20); - ata_string((uint8_t *)(buf+23), "001", 8); - ata_string((uint8_t *)(buf+27), "BHYVE SATA DVD ROM", 40); - buf[49] = (1 << 9 | 1 << 8); - buf[50] = (1 << 14 | 1); - buf[53] = (1 << 2 | 1 << 1); - buf[62] = 0x3f; - buf[63] = 7; - if (p->xfermode & ATA_WDMA0) - buf[63] |= (1 << ((p->xfermode & 7) + 8)); - buf[64] = 3; - buf[65] = 120; - buf[66] = 120; - buf[67] = 120; - buf[68] = 120; - buf[76] = (ATA_SATA_GEN1 | ATA_SATA_GEN2 | ATA_SATA_GEN3); - buf[77] = ((p->ssts & ATA_SS_SPD_MASK) >> 3); - buf[78] = (1 << 5); - buf[80] = 0x3f0; - buf[82] = (ATA_SUPPORT_POWERMGT | ATA_SUPPORT_PACKET | - ATA_SUPPORT_RESET | ATA_SUPPORT_NOP); - buf[83] = (1 << 14); - buf[84] = (1 << 14); - buf[85] = (ATA_SUPPORT_POWERMGT | ATA_SUPPORT_PACKET | - ATA_SUPPORT_RESET | ATA_SUPPORT_NOP); - buf[87] = (1 << 14); - buf[88] = 0x7f; - if (p->xfermode & ATA_UDMA0) - buf[88] |= (1 << ((p->xfermode & 7) + 8)); - buf[222] = 0x1020; - buf[255] = 0x00a5; - ahci_checksum((uint8_t *)buf, sizeof(buf)); ahci_write_fis_piosetup(p); - write_prdt(p, slot, cfis, (void *)buf, sizeof(buf)); + write_prdt(p, slot, cfis, (void *)&p->ata_ident, sizeof(struct ata_params)); ahci_write_fis_d2h(p, slot, cfis, ATA_S_DSC | ATA_S_READY); } } @@ -2319,6 +2323,10 @@ pci_ahci_init(struct vmctx *ctx, struct pci_devinst *p MD5_CTX mdctx; u_char digest[16]; char *next, *next2; + char *bopt, *uopt, *xopts, *config; + FILE* fp; + size_t block_len; + int comma, optpos; ret = 0; @@ -2335,6 +2343,9 @@ pci_ahci_init(struct vmctx *ctx, struct pci_devinst *p slots = 32; for (p = 0; p < MAX_PORTS && opts != NULL; p++, opts = next) { + struct ata_params *ata_ident = &sc->port[p].ata_ident; + memset(ata_ident, 0, sizeof(struct ata_params)); + /* Identify and cut off type of present port. */ if (strncmp(opts, "hd:", 3) == 0) { atapi = 0; @@ -2357,13 +2368,82 @@ pci_ahci_init(struct vmctx *ctx, struct pci_devinst *p if (opts[0] == 0) continue; + uopt = strdup(opts); + bopt = NULL; + fp = open_memstream(&bopt, &block_len); + comma = 0; + optpos = 0; + + for (xopts = strtok(uopt, ","); + xopts != NULL; + xopts = strtok(NULL, ",")) { + + /* First option assume as block filename. */ + if (optpos == 0) { + /* + * Create an identifier for the backing file. + * Use parts of the md5 sum of the filename + */ + char ident[AHCI_PORT_IDENT]; + MD5Init(&mdctx); + MD5Update(&mdctx, opts, strlen(opts)); + MD5Final(digest, &mdctx); + snprintf(ident, AHCI_PORT_IDENT, + "BHYVE-%02X%02X-%02X%02X-%02X%02X", + digest[0], digest[1], digest[2], digest[3], digest[4], + digest[5]); + ata_string((uint8_t*)&ata_ident->serial, ident, 20); + ata_string((uint8_t*)&ata_ident->revision, "001", 8); + if (atapi) { + ata_string((uint8_t*)&ata_ident->model, "BHYVE SATA DVD ROM", 40); + } + else { + ata_string((uint8_t*)&ata_ident->model, "BHYVE SATA DISK", 40); + } + } + + if ((config = strchr(xopts, '=')) != NULL) { + *config++ = '\0'; + if (!strcmp("nmrr", xopts)) { + ata_ident->media_rotation_rate = atoi(config); + } + else if (!strcmp("ser", xopts)) { + ata_string((uint8_t*)(&ata_ident->serial), config, 20); + } + else if (!strcmp("rev", xopts)) { + ata_string((uint8_t*)(&ata_ident->revision), config, 8); + } + else if (!strcmp("model", xopts)) { + ata_string((uint8_t*)(&ata_ident->model), config, 40); + } + else { + /* Pass all other options to blockif_open. */ + *--config = '='; + fprintf(fp, "%s%s", comma ? "," : "", xopts); + comma = 1; + } + } + else { + /* Pass all other options to blockif_open. */ + fprintf(fp, "%s%s", comma ? "," : "", xopts); + comma = 1; + } + optpos++; + } + free(uopt); + fclose(fp); + + DPRINTF("%s\n", bopt); + /* * Attempt to open the backing image. Use the PCI slot/func * and the port number for the identifier string. */ snprintf(bident, sizeof(bident), "%d:%d:%d", pi->pi_slot, pi->pi_func, p); - bctxt = blockif_open(opts, bident); + bctxt = blockif_open(bopt, bident); + free(bopt); + if (bctxt == NULL) { sc->ports = p; ret = 1; @@ -2374,17 +2454,7 @@ pci_ahci_init(struct vmctx *ctx, struct pci_devinst *p sc->port[p].port = p; sc->port[p].atapi = atapi; - /* - * Create an identifier for the backing file. - * Use parts of the md5 sum of the filename - */ - MD5Init(&mdctx); - MD5Update(&mdctx, opts, strlen(opts)); - MD5Final(digest, &mdctx); - snprintf(sc->port[p].ident, AHCI_PORT_IDENT, - "BHYVE-%02X%02X-%02X%02X-%02X%02X", - digest[0], digest[1], digest[2], digest[3], digest[4], - digest[5]); + ata_identify_init(&sc->port[p], atapi); /* * Allocate blockif request structures and add them From owner-svn-src-head@freebsd.org Mon Jul 27 09:01:56 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C82037B3EE; Mon, 27 Jul 2020 09:01:56 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFYhg3Gldz4gYG; Mon, 27 Jul 2020 09:01:55 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf1-f48.google.com with SMTP id 140so8585162lfi.5; Mon, 27 Jul 2020 02:01:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=OkJ99ADtUm7YdFrtQtXjUO9LfDRfNi2bE7Ux9La+lE8=; b=VzaCK9TvObBbgUzpzPM7+oFSoBezld6lOMXvAdzmdFOFW6S8j6bdt1SsAHqaUUurhH uRYDD4FK2jI2TDKz38kHSB0V9qcf1FJGCUXqWT9AzvFQSirCuQvofyG1kF6/IAo3KPLh JynX7N2VsCh9pbvxB0GziL/c6oWnOkb81RsI87Og5XLbgcyLtlkEH/WCjseUibfpoPOI BBBrPmM4VavH1bRmNSXXhMrzCdLNaIalkFruRYDdeypqDT1NCN3E0G5NA0zEG7n10vlt lhtVKsIUzyKkKFOXhUAWE6RfgReA1XEnArSWuHKRfnKBQDpOzXD7EfnzOqC1nGPRT/NB /MxQ== X-Gm-Message-State: AOAM5333JSAt+7zbtOYleQKtxhXpFblW7cawLjnz9tHWmAVevIj99afc OcHN9S3VXdk7l5mjmr8EU3C5ENa3 X-Google-Smtp-Source: ABdhPJzj/cBRYQWJOqyfpoOfKn2Uedti3krBL9nsagGvQxb9Vd+GkqDPq1upkhzEvlQ5Lh5KbyzPsw== X-Received: by 2002:a19:8295:: with SMTP id e143mr11029930lfd.95.1595840513239; Mon, 27 Jul 2020 02:01:53 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id z12sm2903256lfh.61.2020.07.27.02.01.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Jul 2020 02:01:52 -0700 (PDT) Subject: Re: svn commit: r363382 - head/sys/dev/gpio To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202007210735.06L7Z4HM057413@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: Date: Mon, 27 Jul 2020 12:01:50 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Firefox/60.0 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <202007210735.06L7Z4HM057413@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BFYhg3Gldz4gYG X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.167.48 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-0.11 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; ARC_NA(0.00)[]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-0.06)[-0.059]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.29)[-0.291]; NEURAL_SPAM_SHORT(0.24)[0.241]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.48:from]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.48:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; RCVD_TLS_ALL(0.00)[]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[93.72.151.96:received] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 09:01:56 -0000 On 21/07/2020 10:35, Andriy Gapon wrote: > Author: avg > Date: Tue Jul 21 07:35:03 2020 > New Revision: 363382 > URL: https://svnweb.freebsd.org/changeset/base/363382 > > Log: > gpioiic: never drive lines active high > > I2C communication is done by a combination of driving a line low or > letting it float, so that it is either pulled up or driven low by > another party. > > r355276 besides the stated goal of the change -- using the new GPIO API > -- also changed the logic, so that active state is signaled by actively > driving a line. Actually, the code was not incorrect. Ian pointed out something that I overlooked. The driver configures I2C pins as GPIO_PIN_OPENDRAIN and that alone should have ensured the correct behavior of setting active and inactive output states (that is, active == hi-Z). The real problem is that only a few drivers implement or emulate that configuration bit. Far from all hardware provides that option natively too. > That worked with iicbb prior to r362042, but stopped working after that > commit on at least some hardware. My guess that the breakage was > related to getting an ACK bit. A device expected to be able to drive > SDA actively low, but controller was actively driving it high for some > time. > > Anyway, this change seems to fix the problem. > Tested using gpioiic on Orange Pi PC Plus with HTU21 sensor. > > Reported by: Nick Kostirya > Reviewed by: manu > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D25684 > > Modified: > head/sys/dev/gpio/gpioiic.c > > Modified: head/sys/dev/gpio/gpioiic.c > ============================================================================== > --- head/sys/dev/gpio/gpioiic.c Mon Jul 20 23:57:53 2020 (r363381) > +++ head/sys/dev/gpio/gpioiic.c Tue Jul 21 07:35:03 2020 (r363382) > @@ -191,16 +191,14 @@ static void > gpioiic_setsda(device_t dev, int val) > { > struct gpioiic_softc *sc = device_get_softc(dev); > - int err; > > - /* > - * Some controllers cannot set an output value while a pin is in input > - * mode; in that case we set the pin again after changing mode. > - */ > - err = gpio_pin_set_active(sc->sdapin, val); > - gpio_pin_setflags(sc->sdapin, GPIO_PIN_OUTPUT | GPIO_PIN_OPENDRAIN); > - if (err != 0) > - gpio_pin_set_active(sc->sdapin, val); > + if (val) { > + gpio_pin_setflags(sc->sdapin, GPIO_PIN_INPUT); > + } else { > + gpio_pin_setflags(sc->sdapin, > + GPIO_PIN_OUTPUT | GPIO_PIN_OPENDRAIN); > + gpio_pin_set_active(sc->sdapin, 0); > + } > } > > static void > @@ -208,8 +206,13 @@ gpioiic_setscl(device_t dev, int val) > { > struct gpioiic_softc *sc = device_get_softc(dev); > > - gpio_pin_setflags(sc->sclpin, GPIO_PIN_OUTPUT | GPIO_PIN_OPENDRAIN); > - gpio_pin_set_active(sc->sclpin, val); > + if (val) { > + gpio_pin_setflags(sc->sclpin, GPIO_PIN_INPUT); > + } else { > + gpio_pin_setflags(sc->sclpin, > + GPIO_PIN_OUTPUT | GPIO_PIN_OPENDRAIN); > + gpio_pin_set_active(sc->sclpin, 0); > + } > } > > static int > -- Andriy Gapon From owner-svn-src-head@freebsd.org Mon Jul 27 09:10:03 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A8C337BA29; Mon, 27 Jul 2020 09:10:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFYt32BXzz4gtq; Mon, 27 Jul 2020 09:10:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B7401B3F7; Mon, 27 Jul 2020 09:10:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06R9A2PM078339; Mon, 27 Jul 2020 09:10:02 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06R9A2Ok078338; Mon, 27 Jul 2020 09:10:02 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202007270910.06R9A2Ok078338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 27 Jul 2020 09:10:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363597 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 363597 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 09:10:03 -0000 Author: avg Date: Mon Jul 27 09:10:02 2020 New Revision: 363597 URL: https://svnweb.freebsd.org/changeset/base/363597 Log: actually enable gate control for allwinner's r-ccu ir clock The gate control bit offset was correctly specified, but AW_CLK_HAS_GATE flag was not set. Tested with (C)IR receiver on Orange Pi PC Plus. Reviewed by: manu MFC after: 1 week Modified: head/sys/arm/allwinner/clkng/ccu_sun8i_r.c Modified: head/sys/arm/allwinner/clkng/ccu_sun8i_r.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_sun8i_r.c Mon Jul 27 07:56:55 2020 (r363596) +++ head/sys/arm/allwinner/clkng/ccu_sun8i_r.c Mon Jul 27 09:10:02 2020 (r363597) @@ -122,7 +122,7 @@ NM_CLK(r_ccu_ir_clk, 16, 2, 0, 0, /* M flags */ 24, 2, /* mux */ 31, /* gate */ - AW_CLK_HAS_MUX | AW_CLK_REPARENT); /* flags */ + AW_CLK_HAS_MUX | AW_CLK_REPARENT | AW_CLK_HAS_GATE);/* flags */ static const char *a83t_ir_parents[] = {"osc16M", "osc24M"}; static struct aw_clk_nm_def a83t_ir_clk = { From owner-svn-src-head@freebsd.org Mon Jul 27 09:33:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D20037C393; Mon, 27 Jul 2020 09:33:35 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp-relay-int.realworks.nl (smtp-relay-int.realworks.nl [194.109.157.24]) (using TLSv1.3 with cipher TLS_AES_256_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 4BFZPB2gSrz4jCq; Mon, 27 Jul 2020 09:33:33 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Date: Mon, 27 Jul 2020 11:33:29 +0200 (CEST) From: Ronald Klop To: Kyle Evans Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org, src-committers@freebsd.org Message-ID: <2138073301.3.1595842409922@localhost> In-Reply-To: <202007270313.06R3DN0c063936@repo.freebsd.org> References: <202007270313.06R3DN0c063936@repo.freebsd.org> Subject: Re: svn commit: r363595 - head/sys/kern MIME-Version: 1.0 X-Mailer: Realworks (518.382.73a5c78e092) Importance: Normal X-Priority: 3 (Normal) X-Rspamd-Queue-Id: 4BFZPB2gSrz4jCq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:3265, ipnet:194.109.0.0/16, country:NL] Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 09:33:35 -0000 Hi, Helpful addition. Might it help people more to make the message point to the replacement of the deprecated functionality? Regards, Ronald. Van: Kyle Evans Datum: maandag, 27 juli 2020 05:13 Aan: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Onderwerp: svn commit: r363595 - head/sys/kern > > Author: kevans > Date: Mon Jul 27 03:13:23 2020 > New Revision: 363595 > URL: https://svnweb.freebsd.org/changeset/base/363595 > > Log: > makesyscalls.sh: spit out a deprecation notice to stderr > > This has for a while been replaced by makesyscalls.lua in the stock FreeBSD > build. Ensure downstreams get some notice that it'a going away if they're > reliant on it, maybe. > > Modified: > head/sys/kern/makesyscalls.sh > > Modified: head/sys/kern/makesyscalls.sh > ============================================================================== > --- head/sys/kern/makesyscalls.sh Mon Jul 27 01:53:27 2020 (r363594) > +++ head/sys/kern/makesyscalls.sh Mon Jul 27 03:13:23 2020 (r363595) > @@ -60,6 +60,8 @@ case $# in > ;; > esac > > +1>&2 echo "$0: This script is deprecated and will be removed before FreeBSD 13." > + > if [ -n "$2" ]; then > . "$2" > fi > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > > > From owner-svn-src-head@freebsd.org Mon Jul 27 10:45:47 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E868C37DD43; Mon, 27 Jul 2020 10:45:47 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFc0W5sDPz4nPJ; Mon, 27 Jul 2020 10:45:47 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A895C1CA04; Mon, 27 Jul 2020 10:45:47 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06RAjlGS039880; Mon, 27 Jul 2020 10:45:47 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06RAjlfP039879; Mon, 27 Jul 2020 10:45:47 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202007271045.06RAjlfP039879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 27 Jul 2020 10:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363598 - head/usr.sbin/nologin X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/usr.sbin/nologin X-SVN-Commit-Revision: 363598 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 10:45:48 -0000 Author: 0mp (doc,ports committer) Date: Mon Jul 27 10:45:47 2020 New Revision: 363598 URL: https://svnweb.freebsd.org/changeset/base/363598 Log: nologin.8: Improve wording Reported by: yuripv Reviewed by: bcr, yuripv MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D25814 Modified: head/usr.sbin/nologin/nologin.8 Modified: head/usr.sbin/nologin/nologin.8 ============================================================================== --- head/usr.sbin/nologin/nologin.8 Mon Jul 27 09:10:02 2020 (r363597) +++ head/usr.sbin/nologin/nologin.8 Mon Jul 27 10:45:47 2020 (r363598) @@ -44,7 +44,7 @@ have been disabled. .Pp When executed, .Nm -first writes about the login attempt to +first logs about the login attempt using .Xr syslog 3 and then displays a message that an account is not available. .Pp From owner-svn-src-head@freebsd.org Mon Jul 27 11:42:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 594B037F390; Mon, 27 Jul 2020 11:42:23 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFdFq1lVlz4rms; Mon, 27 Jul 2020 11:42:23 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F52B1D13C; Mon, 27 Jul 2020 11:42:23 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06RBgNFP076122; Mon, 27 Jul 2020 11:42:23 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06RBgMUD076121; Mon, 27 Jul 2020 11:42:22 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202007271142.06RBgMUD076121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 27 Jul 2020 11:42:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363599 - head/share/man/man3 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man3 X-SVN-Commit-Revision: 363599 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 11:42:23 -0000 Author: 0mp (doc,ports committer) Date: Mon Jul 27 11:42:22 2020 New Revision: 363599 URL: https://svnweb.freebsd.org/changeset/base/363599 Log: tree.3: Bump date after 363450 (WAVL) While here: - Address whitespace warnings. - Start sentences on a new line. Modified: head/share/man/man3/tree.3 Modified: head/share/man/man3/tree.3 ============================================================================== --- head/share/man/man3/tree.3 Mon Jul 27 10:45:47 2020 (r363598) +++ head/share/man/man3/tree.3 Mon Jul 27 11:42:22 2020 (r363599) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 25, 2020 +.Dd July 27, 2020 .Dt TREE 3 .Os .Sh NAME @@ -371,7 +371,7 @@ Each tree node has an associated rank. Balance conditions are expressed by conditions on the differences in rank between any node and its children. Rank differences are stored in each tree node. -.Pp +.Pp The balance conditions implemented by the RB macros lead to weak AVL (wavl) trees, which combine the best aspects of AVL and red-black trees. @@ -380,7 +380,8 @@ with the same worst-case time as red-black trees offer better balance in the resulting tree. Wavl trees rebalance after a removal in a way that requires less restructuring, in the worst case, than either AVL or red-black trees -do. Removals can lead to a tree almost as unbalanced as a red-black +do. +Removals can lead to a tree almost as unbalanced as a red-black tree; insertions lead to a tree becoming as balanced as an AVL tree. .Pp A rank-balanced tree is headed by a structure defined by the From owner-svn-src-head@freebsd.org Mon Jul 27 14:25:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F27FD36437F; Mon, 27 Jul 2020 14:25:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFhsg3pY1z3Z98; Mon, 27 Jul 2020 14:25:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62CEC1F1AF; Mon, 27 Jul 2020 14:25:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06REPBZW075772; Mon, 27 Jul 2020 14:25:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06REPBtv075771; Mon, 27 Jul 2020 14:25:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007271425.06REPBtv075771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 27 Jul 2020 14:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363607 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 363607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 14:25:12 -0000 Author: markj Date: Mon Jul 27 14:25:10 2020 New Revision: 363607 URL: https://svnweb.freebsd.org/changeset/base/363607 Log: vm_page_free_invalid(): Relax the xbusy assertion. vm_page_assert_xbusied() asserts that the busying thread is the current thread. For some uses of vm_page_free_invalid() (e.g., error handling in vnode_pager_generic_getpages_done()), this condition might not hold. Reported by: Jenkins via trasz Reviewed by: chs, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25828 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Mon Jul 27 14:16:27 2020 (r363606) +++ head/sys/vm/vm_page.c Mon Jul 27 14:25:10 2020 (r363607) @@ -1371,9 +1371,14 @@ vm_page_free_invalid(vm_page_t m) KASSERT(vm_page_none_valid(m), ("page %p is valid", m)); KASSERT(!pmap_page_is_mapped(m), ("page %p is mapped", m)); - vm_page_assert_xbusied(m); KASSERT(m->object != NULL, ("page %p has no object", m)); VM_OBJECT_ASSERT_WLOCKED(m->object); + + /* + * We may be attempting to free the page as part of the handling for an + * I/O error, in which case the page was xbusied by a different thread. + */ + vm_page_xbusy_claim(m); /* * If someone has wired this page while the object lock From owner-svn-src-head@freebsd.org Mon Jul 27 14:28:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B6F5364791; Mon, 27 Jul 2020 14:28:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFhy074Svz3ZPf; Mon, 27 Jul 2020 14:28:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D209D1ED7A; Mon, 27 Jul 2020 14:28:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06RESuXO075994; Mon, 27 Jul 2020 14:28:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06REStR3075987; Mon, 27 Jul 2020 14:28:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007271428.06REStR3075987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 27 Jul 2020 14:28:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363608 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 363608 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 14:28:57 -0000 Author: markj Date: Mon Jul 27 14:28:55 2020 New Revision: 363608 URL: https://svnweb.freebsd.org/changeset/base/363608 Log: mpr(4), mps(4): Stop checking for failures from malloc(M_WAITOK). PR: 240545 Submitted by: Andrew Reiter Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25766 Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mpr_sas.c head/sys/dev/mpr/mpr_user.c head/sys/dev/mps/mps.c head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mps_user.c Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Mon Jul 27 14:25:10 2020 (r363607) +++ head/sys/dev/mpr/mpr.c Mon Jul 27 14:28:55 2020 (r363608) @@ -1529,10 +1529,6 @@ mpr_alloc_requests(struct mpr_softc *sc) */ sc->commands = malloc(sizeof(struct mpr_command) * sc->num_reqs, M_MPR, M_WAITOK | M_ZERO); - if (!sc->commands) { - mpr_dprint(sc, MPR_ERROR, "Cannot allocate command memory\n"); - return (ENOMEM); - } for (i = 1; i < sc->num_reqs; i++) { cm = &sc->commands[i]; cm->cm_req = sc->req_frames + i * sc->reqframesz; @@ -2684,11 +2680,6 @@ mpr_register_events(struct mpr_softc *sc, uint8_t *mas int error = 0; eh = malloc(sizeof(struct mpr_event_handle), M_MPR, M_WAITOK|M_ZERO); - if (!eh) { - mpr_dprint(sc, MPR_EVENT|MPR_ERROR, - "Cannot allocate event memory\n"); - return (ENOMEM); - } eh->callback = cb; eh->data = data; TAILQ_INSERT_TAIL(&sc->event_list, eh, eh_list); Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Mon Jul 27 14:25:10 2020 (r363607) +++ head/sys/dev/mpr/mpr_sas.c Mon Jul 27 14:28:55 2020 (r363608) @@ -736,11 +736,6 @@ mpr_attach_sas(struct mpr_softc *sc) mpr_dprint(sc, MPR_INIT, "%s entered\n", __func__); sassc = malloc(sizeof(struct mprsas_softc), M_MPR, M_WAITOK|M_ZERO); - if (!sassc) { - mpr_dprint(sc, MPR_INIT|MPR_ERROR, - "Cannot allocate SAS subsystem memory\n"); - return (ENOMEM); - } /* * XXX MaxTargets could change during a reinit. Since we don't @@ -751,12 +746,6 @@ mpr_attach_sas(struct mpr_softc *sc) sassc->maxtargets = sc->facts->MaxTargets + sc->facts->MaxVolumes; sassc->targets = malloc(sizeof(struct mprsas_target) * sassc->maxtargets, M_MPR, M_WAITOK|M_ZERO); - if (!sassc->targets) { - mpr_dprint(sc, MPR_INIT|MPR_ERROR, - "Cannot allocate SAS target memory\n"); - free(sassc, M_MPR); - return (ENOMEM); - } sc->sassc = sassc; sassc->sc = sc; @@ -3556,8 +3545,4 @@ mprsas_realloc_targets(struct mpr_softc *sc, int maxta sassc->targets = malloc(sizeof(struct mprsas_target) * maxtargets, M_MPR, M_WAITOK|M_ZERO); - if (!sassc->targets) { - panic("%s failed to alloc targets with error %d\n", - __func__, ENOMEM); - } } Modified: head/sys/dev/mpr/mpr_user.c ============================================================================== --- head/sys/dev/mpr/mpr_user.c Mon Jul 27 14:25:10 2020 (r363607) +++ head/sys/dev/mpr/mpr_user.c Mon Jul 27 14:28:55 2020 (r363608) @@ -1528,13 +1528,6 @@ mpr_diag_register(struct mpr_softc *sc, mpr_fw_diag_re bzero(sc->fw_diag_buffer, buffer_size); ctx = malloc(sizeof(*ctx), M_MPR, M_WAITOK | M_ZERO); - if (ctx == NULL) { - device_printf(sc->mpr_dev, "%s: context malloc failed\n", - __func__); - *return_code = MPR_FW_DIAG_ERROR_NO_BUFFER; - status = MPR_DIAG_FAILURE; - goto bailout; - } ctx->addr = &sc->fw_diag_busaddr; ctx->buffer_dmat = sc->fw_diag_dmat; ctx->buffer_dmamap = sc->fw_diag_map; Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Mon Jul 27 14:25:10 2020 (r363607) +++ head/sys/dev/mps/mps.c Mon Jul 27 14:28:55 2020 (r363608) @@ -1520,10 +1520,6 @@ mps_alloc_requests(struct mps_softc *sc) */ sc->commands = malloc(sizeof(struct mps_command) * sc->num_reqs, M_MPT2, M_WAITOK | M_ZERO); - if(!sc->commands) { - mps_dprint(sc, MPS_ERROR, "Cannot allocate command memory\n"); - return (ENOMEM); - } for (i = 1; i < sc->num_reqs; i++) { cm = &sc->commands[i]; cm->cm_req = sc->req_frames + i * sc->reqframesz; @@ -2598,10 +2594,6 @@ mps_register_events(struct mps_softc *sc, u32 *mask, int error = 0; eh = malloc(sizeof(struct mps_event_handle), M_MPT2, M_WAITOK|M_ZERO); - if(!eh) { - mps_dprint(sc, MPS_ERROR, "Cannot allocate event memory\n"); - return (ENOMEM); - } eh->callback = cb; eh->data = data; TAILQ_INSERT_TAIL(&sc->event_list, eh, eh_list); Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Mon Jul 27 14:25:10 2020 (r363607) +++ head/sys/dev/mps/mps_sas.c Mon Jul 27 14:28:55 2020 (r363608) @@ -722,11 +722,6 @@ mps_attach_sas(struct mps_softc *sc) mps_dprint(sc, MPS_INIT, "%s entered\n", __func__); sassc = malloc(sizeof(struct mpssas_softc), M_MPT2, M_WAITOK|M_ZERO); - if(!sassc) { - mps_dprint(sc, MPS_INIT|MPS_ERROR, - "Cannot allocate SAS controller memory\n"); - return (ENOMEM); - } /* * XXX MaxTargets could change during a reinit. Since we don't @@ -737,12 +732,6 @@ mps_attach_sas(struct mps_softc *sc) sassc->maxtargets = sc->facts->MaxTargets + sc->facts->MaxVolumes; sassc->targets = malloc(sizeof(struct mpssas_target) * sassc->maxtargets, M_MPT2, M_WAITOK|M_ZERO); - if(!sassc->targets) { - mps_dprint(sc, MPS_INIT|MPS_ERROR, - "Cannot allocate SAS target memory\n"); - free(sassc, M_MPT2); - return (ENOMEM); - } sc->sassc = sassc; sassc->sc = sc; @@ -3421,8 +3410,4 @@ mpssas_realloc_targets(struct mps_softc *sc, int maxta sassc->targets = malloc(sizeof(struct mpssas_target) * maxtargets, M_MPT2, M_WAITOK|M_ZERO); - if (!sassc->targets) { - panic("%s failed to alloc targets with error %d\n", - __func__, ENOMEM); - } } Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Mon Jul 27 14:25:10 2020 (r363607) +++ head/sys/dev/mps/mps_user.c Mon Jul 27 14:28:55 2020 (r363608) @@ -1436,13 +1436,6 @@ mps_diag_register(struct mps_softc *sc, mps_fw_diag_re bzero(sc->fw_diag_buffer, buffer_size); ctx = malloc(sizeof(*ctx), M_MPSUSER, M_WAITOK | M_ZERO); - if (ctx == NULL) { - device_printf(sc->mps_dev, "%s: context malloc failed\n", - __func__); - *return_code = MPS_FW_DIAG_ERROR_NO_BUFFER; - status = MPS_DIAG_FAILURE; - goto bailout; - } ctx->addr = &sc->fw_diag_busaddr; ctx->buffer_dmat = sc->fw_diag_dmat; ctx->buffer_dmamap = sc->fw_diag_map; From owner-svn-src-head@freebsd.org Mon Jul 27 15:25:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E58C5366278; Mon, 27 Jul 2020 15:25:04 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFkBm5qrXz3fBq; Mon, 27 Jul 2020 15:25:04 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A880F1FCAC; Mon, 27 Jul 2020 15:25:04 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06RFP41W012993; Mon, 27 Jul 2020 15:25:04 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06RFP4JU012992; Mon, 27 Jul 2020 15:25:04 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202007271525.06RFP4JU012992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Mon, 27 Jul 2020 15:25:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363611 - head/usr.bin/truncate X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/usr.bin/truncate X-SVN-Commit-Revision: 363611 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 15:25:05 -0000 Author: fernape (ports committer) Date: Mon Jul 27 15:25:04 2020 New Revision: 363611 URL: https://svnweb.freebsd.org/changeset/base/363611 Log: truncate(1): Add EXAMPLES section Add four simple examples showing the use of -c, -r and -s Approved by: manpages (bcr@) Differential Revision: https://reviews.freebsd.org/D25774 Modified: head/usr.bin/truncate/truncate.1 Modified: head/usr.bin/truncate/truncate.1 ============================================================================== --- head/usr.bin/truncate/truncate.1 Mon Jul 27 15:09:07 2020 (r363610) +++ head/usr.bin/truncate/truncate.1 Mon Jul 27 15:25:04 2020 (r363611) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 19, 2006 +.Dd July 27, 2020 .Dt TRUNCATE 1 .Os .Sh NAME @@ -143,6 +143,43 @@ If the operation fails for an argument, .Nm will issue a diagnostic and continue processing the remaining arguments. +.Sh EXAMPLES +Adjust the size of the file +.Pa test_file +to 10 Megabytes but do not create it if it does not exist: +.Bd -literal -offset indent +truncate -c -s +10M test_file +.Ed +.Pp +Same as above but create the file if it does not exist: +.Bd -literal -offset indent +truncate -s +10M test_file +ls -l test_file +-rw-r--r-- 1 root wheel 10485760 Jul 22 18:48 test_file +.Ed +.Pp +Adjust the size of +.Pa test_file +to the size of the kernel and create another file +.Pa test_file2 +with the same size: +.Bd -literal -offset indent +truncate -r /boot/kernel/kernel test_file test_file2 +ls -l /boot/kernel/kernel test_file* +-r-xr-xr-x 1 root wheel 31352552 May 15 14:18 /boot/kernel/kernel* +-rw-r--r-- 1 root wheel 31352552 Jul 22 19:15 test_file +-rw-r--r-- 1 root wheel 31352552 Jul 22 19:15 test_file2 +.Ed +.Pp +Downsize +.Pa test_file +in 5 Megabytes: +.Bd -literal -offset indent +# truncate -s -5M test_file +ls -l test_file* +-rw-r--r-- 1 root wheel 26109672 Jul 22 19:17 test_file +-rw-r--r-- 1 root wheel 31352552 Jul 22 19:15 test_file2 +.Ed .Sh SEE ALSO .Xr dd 1 , .Xr touch 1 , From owner-svn-src-head@freebsd.org Mon Jul 27 16:25:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 173B2367CA2; Mon, 27 Jul 2020 16:25:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFlXG6wkWz416g; Mon, 27 Jul 2020 16:25:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC133205CB; Mon, 27 Jul 2020 16:25:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06RGPIZt051029; Mon, 27 Jul 2020 16:25:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06RGPI9b051028; Mon, 27 Jul 2020 16:25:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202007271625.06RGPI9b051028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 27 Jul 2020 16:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363613 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 363613 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 16:25:19 -0000 Author: jhb Date: Mon Jul 27 16:25:18 2020 New Revision: 363613 URL: https://svnweb.freebsd.org/changeset/base/363613 Log: Don't include T_USER in si_trapno reported to userland. Signals are only reported for user traps, so T_USER is redundant. It is also a software convention and not included in the value reported by the hardware. Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25769 Modified: head/sys/mips/mips/trap.c Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Mon Jul 27 15:34:07 2020 (r363612) +++ head/sys/mips/mips/trap.c Mon Jul 27 16:25:18 2020 (r363613) @@ -1107,7 +1107,7 @@ err: ksi.ksi_signo = i; ksi.ksi_code = ucode; ksi.ksi_addr = (void *)addr; - ksi.ksi_trapno = type; + ksi.ksi_trapno = type & ~T_USER; trapsignal(td, &ksi); out: From owner-svn-src-head@freebsd.org Mon Jul 27 16:28:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 78D6D367CC3; Mon, 27 Jul 2020 16:28:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFlcF2dV7z415q; Mon, 27 Jul 2020 16:28:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3DA81205CC; Mon, 27 Jul 2020 16:28:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06RGSjcr051447; Mon, 27 Jul 2020 16:28:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06RGSjT7051446; Mon, 27 Jul 2020 16:28:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202007271628.06RGSjT7051446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 27 Jul 2020 16:28:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363614 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 363614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 16:28:45 -0000 Author: jhb Date: Mon Jul 27 16:28:44 2020 New Revision: 363614 URL: https://svnweb.freebsd.org/changeset/base/363614 Log: Set si_trapno to the exception code from scause. Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25770 Modified: head/sys/riscv/riscv/trap.c Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Mon Jul 27 16:25:18 2020 (r363613) +++ head/sys/riscv/riscv/trap.c Mon Jul 27 16:28:44 2020 (r363614) @@ -80,7 +80,7 @@ void do_trap_supervisor(struct trapframe *); void do_trap_user(struct trapframe *); static __inline void -call_trapsignal(struct thread *td, int sig, int code, void *addr) +call_trapsignal(struct thread *td, int sig, int code, void *addr, int trapno) { ksiginfo_t ksi; @@ -88,6 +88,7 @@ call_trapsignal(struct thread *td, int sig, int code, ksi.ksi_signo = sig; ksi.ksi_code = code; ksi.ksi_addr = addr; + ksi.ksi_trapno = trapno; trapsignal(td, &ksi); } @@ -224,7 +225,8 @@ data_abort(struct trapframe *frame, int usermode) error = vm_fault_trap(map, va, ftype, VM_FAULT_NORMAL, &sig, &ucode); if (error != KERN_SUCCESS) { if (usermode) { - call_trapsignal(td, sig, ucode, (void *)stval); + call_trapsignal(td, sig, ucode, (void *)stval, + frame->tf_scause & EXCP_MASK); } else { if (pcb->pcb_onfault != 0) { frame->tf_a[0] = error; @@ -353,11 +355,13 @@ do_trap_user(struct trapframe *frame) break; } #endif - call_trapsignal(td, SIGILL, ILL_ILLTRP, (void *)frame->tf_sepc); + call_trapsignal(td, SIGILL, ILL_ILLTRP, (void *)frame->tf_sepc, + exception); userret(td, frame); break; case EXCP_BREAKPOINT: - call_trapsignal(td, SIGTRAP, TRAP_BRKPT, (void *)frame->tf_sepc); + call_trapsignal(td, SIGTRAP, TRAP_BRKPT, (void *)frame->tf_sepc, + exception); userret(td, frame); break; default: From owner-svn-src-head@freebsd.org Mon Jul 27 16:29:22 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0CCEA367D2D; Mon, 27 Jul 2020 16:29:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFlcx6fPVz41Mj; Mon, 27 Jul 2020 16:29:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C88BE20753; Mon, 27 Jul 2020 16:29:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06RGTLi1051545; Mon, 27 Jul 2020 16:29:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06RGTLN6051544; Mon, 27 Jul 2020 16:29:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202007271629.06RGTLN6051544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 27 Jul 2020 16:29:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363615 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 363615 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 16:29:22 -0000 Author: jhb Date: Mon Jul 27 16:29:21 2020 New Revision: 363615 URL: https://svnweb.freebsd.org/changeset/base/363615 Log: Set si_trapno to the fault index from fsr. Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25772 Modified: head/sys/arm/arm/trap-v6.c Modified: head/sys/arm/arm/trap-v6.c ============================================================================== --- head/sys/arm/arm/trap-v6.c Mon Jul 27 16:28:44 2020 (r363614) +++ head/sys/arm/arm/trap-v6.c Mon Jul 27 16:29:21 2020 (r363615) @@ -169,7 +169,8 @@ static const struct abort aborts[] = { }; static __inline void -call_trapsignal(struct thread *td, int sig, int code, vm_offset_t addr) +call_trapsignal(struct thread *td, int sig, int code, vm_offset_t addr, + int trapno) { ksiginfo_t ksi; @@ -185,6 +186,7 @@ call_trapsignal(struct thread *td, int sig, int code, ksi.ksi_signo = sig; ksi.ksi_code = code; ksi.ksi_addr = (void *)addr; + ksi.ksi_trapno = trapno; trapsignal(td, &ksi); } @@ -252,7 +254,7 @@ abort_debug(struct trapframe *tf, u_int fsr, u_int pre struct thread *td; td = curthread; - call_trapsignal(td, SIGTRAP, TRAP_BRKPT, far); + call_trapsignal(td, SIGTRAP, TRAP_BRKPT, far, FAULT_DEBUG); userret(td, tf); } else { #ifdef KDB @@ -523,7 +525,7 @@ nogo: ksig.addr = far; do_trapsignal: - call_trapsignal(td, ksig.sig, ksig.code, ksig.addr); + call_trapsignal(td, ksig.sig, ksig.code, ksig.addr, idx); out: if (usermode) userret(td, tf); From owner-svn-src-head@freebsd.org Mon Jul 27 16:31:22 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66A26368185; Mon, 27 Jul 2020 16:31:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFlgG25Qwz41ZV; Mon, 27 Jul 2020 16:31:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B31720AF1; Mon, 27 Jul 2020 16:31:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06RGVMha053264; Mon, 27 Jul 2020 16:31:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06RGVLv0053262; Mon, 27 Jul 2020 16:31:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202007271631.06RGVLv0053262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 27 Jul 2020 16:31:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363616 - head/sys/geom/eli X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/geom/eli X-SVN-Commit-Revision: 363616 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 16:31:22 -0000 Author: jhb Date: Mon Jul 27 16:31:21 2020 New Revision: 363616 URL: https://svnweb.freebsd.org/changeset/base/363616 Log: Fix indentation. Modified: head/sys/geom/eli/g_eli_integrity.c head/sys/geom/eli/g_eli_privacy.c Modified: head/sys/geom/eli/g_eli_integrity.c ============================================================================== --- head/sys/geom/eli/g_eli_integrity.c Mon Jul 27 16:29:21 2020 (r363615) +++ head/sys/geom/eli/g_eli_integrity.c Mon Jul 27 16:31:21 2020 (r363616) @@ -543,7 +543,7 @@ g_eli_auth_run(struct g_eli_worker *wr, struct bio *bp if (g_eli_ivlen(sc->sc_ealgo) != 0) { crp->crp_flags |= CRYPTO_F_IV_SEPARATE; g_eli_crypto_ivgen(sc, dstoff, crp->crp_iv, - sizeof(crp->crp_iv)); + sizeof(crp->crp_iv)); } g_eli_auth_keygen(sc, dstoff, authkey); Modified: head/sys/geom/eli/g_eli_privacy.c ============================================================================== --- head/sys/geom/eli/g_eli_privacy.c Mon Jul 27 16:29:21 2020 (r363615) +++ head/sys/geom/eli/g_eli_privacy.c Mon Jul 27 16:31:21 2020 (r363616) @@ -288,7 +288,7 @@ g_eli_crypto_run(struct g_eli_worker *wr, struct bio * if (g_eli_ivlen(sc->sc_ealgo) != 0) { crp->crp_flags |= CRYPTO_F_IV_SEPARATE; g_eli_crypto_ivgen(sc, dstoff, crp->crp_iv, - sizeof(crp->crp_iv)); + sizeof(crp->crp_iv)); } error = crypto_dispatch(crp); From owner-svn-src-head@freebsd.org Mon Jul 27 16:32:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF65F367D4F; Mon, 27 Jul 2020 16:32:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFlhP56bNz41mP; Mon, 27 Jul 2020 16:32:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93C4A205E2; Mon, 27 Jul 2020 16:32:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06RGWLik056414; Mon, 27 Jul 2020 16:32:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06RGWLER056413; Mon, 27 Jul 2020 16:32:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202007271632.06RGWLER056413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 27 Jul 2020 16:32:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363617 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 363617 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 16:32:21 -0000 Author: jhb Date: Mon Jul 27 16:32:21 2020 New Revision: 363617 URL: https://svnweb.freebsd.org/changeset/base/363617 Log: Fix si_addr value for breakpoints in a delay slot. Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25773 Modified: head/sys/mips/mips/trap.c Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Mon Jul 27 16:31:21 2020 (r363616) +++ head/sys/mips/mips/trap.c Mon Jul 27 16:32:21 2020 (r363617) @@ -824,12 +824,12 @@ dofault: i = SIGTRAP; ucode = TRAP_BRKPT; - addr = trapframe->pc; /* compute address of break instruction */ va = trapframe->pc; if (DELAYBRANCH(trapframe->cause)) va += sizeof(int); + addr = va; if (td->td_md.md_ss_addr != va) break; From owner-svn-src-head@freebsd.org Mon Jul 27 16:34:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 987F8368248; Mon, 27 Jul 2020 16:34:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFlkw3XsCz422W; Mon, 27 Jul 2020 16:34:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57DC7205E7; Mon, 27 Jul 2020 16:34:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06RGYWrP057359; Mon, 27 Jul 2020 16:34:32 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06RGYWKM057358; Mon, 27 Jul 2020 16:34:32 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202007271634.06RGYWKM057358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 27 Jul 2020 16:34:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363618 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 363618 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 16:34:32 -0000 Author: jhb Date: Mon Jul 27 16:34:31 2020 New Revision: 363618 URL: https://svnweb.freebsd.org/changeset/base/363618 Log: Set si_addr to dar for MMU and alignment faults. Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25776 Modified: head/sys/powerpc/powerpc/trap.c Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Mon Jul 27 16:32:21 2020 (r363617) +++ head/sys/powerpc/powerpc/trap.c Mon Jul 27 16:34:31 2020 (r363618) @@ -207,7 +207,7 @@ trap(struct trapframe *frame) int sig, type, user; u_int ucode; ksiginfo_t ksi; - register_t fscr; + register_t addr, fscr; VM_CNT_INC(v_trap); @@ -224,6 +224,7 @@ trap(struct trapframe *frame) type = ucode = frame->exc; sig = 0; user = frame->srr1 & PSL_PR; + addr = 0; CTR3(KTR_TRAP, "trap: %s type=%s (%s)", td->td_name, trapname(type), user ? "user" : "kernel"); @@ -248,6 +249,7 @@ trap(struct trapframe *frame) if (user) { td->td_pticks = 0; td->td_frame = frame; + addr = frame->srr0; if (td->td_cowgen != p->p_cowgen) thread_cow_update(td); @@ -261,18 +263,22 @@ trap(struct trapframe *frame) break; #if defined(__powerpc64__) && defined(AIM) - case EXC_ISE: case EXC_DSE: + addr = frame->dar; + /* FALLTHROUGH */ + case EXC_ISE: /* DSE/ISE are automatically fatal with radix pmap. */ if (radix_mmu || handle_user_slb_spill(&p->p_vmspace->vm_pmap, - (type == EXC_ISE) ? frame->srr0 : frame->dar) != 0){ + addr) != 0){ sig = SIGSEGV; ucode = SEGV_MAPERR; } break; #endif case EXC_DSI: + addr = frame->dar; + /* FALLTHROUGH */ case EXC_ISI: if (trap_pfault(frame, true, &sig, &ucode)) sig = 0; @@ -368,6 +374,7 @@ trap(struct trapframe *frame) if (fix_unaligned(td, frame) != 0) { sig = SIGBUS; ucode = BUS_ADRALN; + addr = frame->dar; } else frame->srr0 += 4; @@ -481,7 +488,7 @@ trap(struct trapframe *frame) ksiginfo_init_trap(&ksi); ksi.ksi_signo = sig; ksi.ksi_code = (int) ucode; /* XXX, not POSIX */ - ksi.ksi_addr = (void *)frame->srr0; + ksi.ksi_addr = (void *)addr; ksi.ksi_trapno = type; trapsignal(td, &ksi); } From owner-svn-src-head@freebsd.org Mon Jul 27 16:37:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 15672367F7E; Mon, 27 Jul 2020 16:37:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFlp66mm9z42G6; Mon, 27 Jul 2020 16:37:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C77FB205E8; Mon, 27 Jul 2020 16:37:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06RGbILQ057554; Mon, 27 Jul 2020 16:37:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06RGbIlV057553; Mon, 27 Jul 2020 16:37:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202007271637.06RGbIlV057553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 27 Jul 2020 16:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363619 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 363619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 16:37:19 -0000 Author: jhb Date: Mon Jul 27 16:37:18 2020 New Revision: 363619 URL: https://svnweb.freebsd.org/changeset/base/363619 Log: Trim some extraneous parentheses. Reported by: kib (do_trap_user) Sponsored by: DARPA Modified: head/sys/riscv/riscv/intr_machdep.c head/sys/riscv/riscv/trap.c Modified: head/sys/riscv/riscv/intr_machdep.c ============================================================================== --- head/sys/riscv/riscv/intr_machdep.c Mon Jul 27 16:34:31 2020 (r363618) +++ head/sys/riscv/riscv/intr_machdep.c Mon Jul 27 16:37:18 2020 (r363619) @@ -163,7 +163,7 @@ riscv_cpu_intr(struct trapframe *frame) KASSERT(frame->tf_scause & EXCP_INTR, ("riscv_cpu_intr: wrong frame passed")); - active_irq = (frame->tf_scause & EXCP_MASK); + active_irq = frame->tf_scause & EXCP_MASK; switch (active_irq) { case IRQ_SOFTWARE_USER: Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Mon Jul 27 16:34:31 2020 (r363618) +++ head/sys/riscv/riscv/trap.c Mon Jul 27 16:37:18 2020 (r363619) @@ -256,7 +256,7 @@ do_trap_supervisor(struct trapframe *frame) KASSERT((csr_read(sstatus) & (SSTATUS_SPP | SSTATUS_SIE)) == SSTATUS_SPP, ("Came from S mode with interrupts enabled")); - exception = (frame->tf_scause & EXCP_MASK); + exception = frame->tf_scause & EXCP_MASK; if (frame->tf_scause & EXCP_INTR) { /* Interrupt */ riscv_cpu_intr(frame); @@ -318,7 +318,7 @@ do_trap_user(struct trapframe *frame) KASSERT((csr_read(sstatus) & (SSTATUS_SPP | SSTATUS_SIE)) == 0, ("Came from U mode with interrupts enabled")); - exception = (frame->tf_scause & EXCP_MASK); + exception = frame->tf_scause & EXCP_MASK; if (frame->tf_scause & EXCP_INTR) { /* Interrupt */ riscv_cpu_intr(frame); From owner-svn-src-head@freebsd.org Mon Jul 27 16:39:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 385AA3683AF; Mon, 27 Jul 2020 16:39:32 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFlrd6Rg8z42Mr; Mon, 27 Jul 2020 16:39:29 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 06RGdMr7070220; Mon, 27 Jul 2020 09:39:22 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 06RGdLkp070219; Mon, 27 Jul 2020 09:39:21 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202007271639.06RGdLkp070219@gndrsh.dnsmgr.net> Subject: Re: svn commit: r363595 - head/sys/kern In-Reply-To: <2138073301.3.1595842409922@localhost> To: Ronald Klop Date: Mon, 27 Jul 2020 09:39:21 -0700 (PDT) CC: Kyle Evans , svn-src-all@freebsd.org, svn-src-head@freebsd.org, src-committers@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4BFlrd6Rg8z42Mr X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd@gndrsh.dnsmgr.net X-Spamd-Result: default: False [0.71 / 15.00]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.21)[-0.209]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_SPAM_MEDIUM(0.37)[0.366]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.35)[-0.350]; RCVD_TLS_LAST(0.00)[]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 16:39:32 -0000 > Hi, > > Helpful addition. Might it help people more to make the message point to the replacement of the deprecated functionality? > > Regards, > Ronald. I tend to agree here, the functionality was not depricated, it was replaced by a new implementation in another language. It would be better to replace the word deprecated with "replaced by" as in: This script has been replaced by makesyscalls.lua and this version shall be removed in FreeBSD 13. > > > Van: Kyle Evans > Datum: maandag, 27 juli 2020 05:13 > Aan: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org > Onderwerp: svn commit: r363595 - head/sys/kern > > > > Author: kevans > > Date: Mon Jul 27 03:13:23 2020 > > New Revision: 363595 > > URL: https://svnweb.freebsd.org/changeset/base/363595 > > > > Log: > > makesyscalls.sh: spit out a deprecation notice to stderr > > > > This has for a while been replaced by makesyscalls.lua in the stock FreeBSD > > build. Ensure downstreams get some notice that it'a going away if they're > > reliant on it, maybe. > > > > Modified: > > head/sys/kern/makesyscalls.sh > > > > Modified: head/sys/kern/makesyscalls.sh > > ============================================================================== > > --- head/sys/kern/makesyscalls.sh Mon Jul 27 01:53:27 2020 (r363594) > > +++ head/sys/kern/makesyscalls.sh Mon Jul 27 03:13:23 2020 (r363595) > > @@ -60,6 +60,8 @@ case $# in > > ;; > > esac > > > > +1>&2 echo "$0: This script is deprecated and will be removed before FreeBSD 13." > > + > > if [ -n "$2" ]; then > > . "$2" > > fi > > _______________________________________________ > > svn-src-all@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-all > > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > > > > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jul 27 16:41:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24A5C3684CD; Mon, 27 Jul 2020 16:41:58 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFlvT66BCz42rH; Mon, 27 Jul 2020 16:41:57 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 06RGftq1070236; Mon, 27 Jul 2020 09:41:55 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 06RGftS7070235; Mon, 27 Jul 2020 09:41:55 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202007271641.06RGftS7070235@gndrsh.dnsmgr.net> Subject: Re: svn commit: r363598 - head/usr.sbin/nologin In-Reply-To: <202007271045.06RAjlfP039879@repo.freebsd.org> To: Mateusz Piotrowski <0mp@freebsd.org> Date: Mon, 27 Jul 2020 09:41:55 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4BFlvT66BCz42rH X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 16:41:58 -0000 > Author: 0mp (doc,ports committer) > Date: Mon Jul 27 10:45:47 2020 > New Revision: 363598 > URL: https://svnweb.freebsd.org/changeset/base/363598 > > Log: > nologin.8: Improve wording I disagree that this improves wording. The norm of action for "logging" in Unix is to "write to syslog", not "log to syslog". > Reported by: yuripv > Reviewed by: bcr, yuripv > MFC after: 3 days > Differential Revision: https://reviews.freebsd.org/D25814 > > Modified: > head/usr.sbin/nologin/nologin.8 > > Modified: head/usr.sbin/nologin/nologin.8 > ============================================================================== > --- head/usr.sbin/nologin/nologin.8 Mon Jul 27 09:10:02 2020 (r363597) > +++ head/usr.sbin/nologin/nologin.8 Mon Jul 27 10:45:47 2020 (r363598) > @@ -44,7 +44,7 @@ have been disabled. > .Pp > When executed, > .Nm > -first writes about the login attempt to > +first logs about the login attempt using > .Xr syslog 3 > and then displays a message that an account is not available. > .Pp > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jul 27 16:51:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 35729368B13; Mon, 27 Jul 2020 16:51:24 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFm6N0hqTz43lq; Mon, 27 Jul 2020 16:51:24 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0BDE20D33; Mon, 27 Jul 2020 16:51:23 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06RGpNrl064988; Mon, 27 Jul 2020 16:51:23 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06RGpNcK064987; Mon, 27 Jul 2020 16:51:23 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202007271651.06RGpNcK064987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Mon, 27 Jul 2020 16:51:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363620 - head/usr.bin/comm X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/usr.bin/comm X-SVN-Commit-Revision: 363620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 16:51:24 -0000 Author: fernape (ports committer) Date: Mon Jul 27 16:51:23 2020 New Revision: 363620 URL: https://svnweb.freebsd.org/changeset/base/363620 Log: comm(1): Add EXAMPLES section Add two very simple examples. Approved by: manpages (gbe@) Differential Revision: https://reviews.freebsd.org/D25344 Modified: head/usr.bin/comm/comm.1 Modified: head/usr.bin/comm/comm.1 ============================================================================== --- head/usr.bin/comm/comm.1 Mon Jul 27 16:37:18 2020 (r363619) +++ head/usr.bin/comm/comm.1 Mon Jul 27 16:51:23 2020 (r363620) @@ -31,7 +31,7 @@ .\" From: @(#)comm.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd December 12, 2009 +.Dd July 27, 2020 .Dt COMM 1 .Os .Sh NAME @@ -95,6 +95,35 @@ as described in .Xr environ 7 . .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Assuming a file named +.Pa example.txt +with the following contents: +.Bd -literal -offset indent +a +b +c +d +.Ed +.Pp +Show lines only in +.Pa example.txt , +lines only in stdin and common lines: +.Bd -literal -offset indent +$ echo -e "B\enc" | comm example.txt - + B +a +b + c +d +.Ed +.Pp +Show only common lines doing case insensitive comparisons: +.Bd -literal -offset indent +$ echo -e "B\enc" | comm -1 -2 -i example.txt - +b +c +.Ed .Sh SEE ALSO .Xr cmp 1 , .Xr diff 1 , @@ -108,9 +137,7 @@ utility conforms to .Pp The .Fl i -option is an extension to the -.Tn POSIX -standard. +option is an extension to the POSIX standard. .Sh HISTORY A .Nm From owner-svn-src-head@freebsd.org Mon Jul 27 16:57:38 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D1B3368BA4; Mon, 27 Jul 2020 16:57:38 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFmFX5VCtz44Dy; Mon, 27 Jul 2020 16:57:36 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: by mail-ej1-f43.google.com with SMTP id d6so3963357ejr.5; Mon, 27 Jul 2020 09:57:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=1FXg3FapMiqgq03V1T2J5TbjEUTfNqUaNUlo6YSNy8E=; b=R7UPdRyZ3kfISsWKeVEFBkUmS0D+s1HZV55XdLleahBEsdg/kKS7lSGH14upeWdxWp 4nM9JCcaulat29kZaIcQ3XwOC2a6yc2VUJPzH8p3Bf5CSF/vXfnhN7MoJY1zuExOnXAp BfF94Fww/80KiQC7sdR2EGiNR+oGSzN31kaZcTtFm4St1S90Xbc7/rxbQ9DL1JXGMaT6 atgyAHqnZ4NM565bOXCH6QIDTirs1RS/Og3nfLKTR4Z8WpYXXNEYldQLGo7pz+noNQ1v +z3/5Q6ck6GqR5S2wXC+fUKRE9sLZjjg/moo1DZrmMyLj6a0tDeLEwv6Sy7sbRzkNvSP nPWA== X-Gm-Message-State: AOAM530kogK4GdCryWivweNyYKJeevqPCs4M5Kx+b7/NxZoiY82MZxyu VmTmKSHxmlNWwxorn4uKdhFrdgYM1aA= X-Google-Smtp-Source: ABdhPJzfSV1lzW4SjvJ5niNKqheG9hmwPiY0UhPfWu1oZv0kkMK4bgSxSK5ecSnvIybrKLhoQBDq/g== X-Received: by 2002:a17:906:1e83:: with SMTP id e3mr22518357ejj.7.1595869054852; Mon, 27 Jul 2020 09:57:34 -0700 (PDT) Received: from ?IPv6:2a02:8109:98c0:1bc0:5e5f:67ff:fef4:ffd8? ([2a02:8109:98c0:1bc0:5e5f:67ff:fef4:ffd8]) by smtp.gmail.com with ESMTPSA id r25sm6591710edy.93.2020.07.27.09.57.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Jul 2020 09:57:34 -0700 (PDT) Subject: Re: svn commit: r363598 - head/usr.sbin/nologin To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202007271641.06RGftS7070235@gndrsh.dnsmgr.net> From: Mateusz Piotrowski <0mp@FreeBSD.org> Message-ID: Date: Mon, 27 Jul 2020 18:57:41 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <202007271641.06RGftS7070235@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 4BFmFX5VCtz44Dy X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of mpp302@gmail.com designates 209.85.218.43 as permitted sender) smtp.mailfrom=mpp302@gmail.com X-Spamd-Result: default: False [-1.12 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; ARC_NA(0.00)[]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-0.33)[-0.333]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.63)[-0.627]; NEURAL_HAM_SHORT(-0.16)[-0.158]; RCVD_IN_DNSWL_NONE(0.00)[209.85.218.43:from]; FORGED_SENDER(0.30)[0mp@FreeBSD.org,mpp302@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.218.43:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[0mp@FreeBSD.org,mpp302@gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 16:57:38 -0000 Hi! On 7/27/20 6:41 PM, Rodney W. Grimes wrote: >> Author: 0mp (doc,ports committer) >> Date: Mon Jul 27 10:45:47 2020 >> New Revision: 363598 >> URL: https://svnweb.freebsd.org/changeset/base/363598 >> >> Log: >> nologin.8: Improve wording > I disagree that this improves wording. The norm of action for > "logging" in Unix is to "write to syslog", not "log to syslog". Hmm, I agree, but here it is "log using syslog". Have you got any idea how to further improve this sentence? >> Reported by: yuripv >> Reviewed by: bcr, yuripv >> MFC after: 3 days >> Differential Revision: https://reviews.freebsd.org/D25814 >> >> Modified: >> head/usr.sbin/nologin/nologin.8 >> >> Modified: head/usr.sbin/nologin/nologin.8 >> ============================================================================== >> --- head/usr.sbin/nologin/nologin.8 Mon Jul 27 09:10:02 2020 (r363597) >> +++ head/usr.sbin/nologin/nologin.8 Mon Jul 27 10:45:47 2020 (r363598) >> @@ -44,7 +44,7 @@ have been disabled. >> .Pp >> When executed, >> .Nm >> -first writes about the login attempt to >> +first logs about the login attempt using >> .Xr syslog 3 >> and then displays a message that an account is not available. >> .Pp Cheers! Mateusz Piotrowski From owner-svn-src-head@freebsd.org Mon Jul 27 17:17:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 939853691BD; Mon, 27 Jul 2020 17:17:40 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFmhh2jFyz455q; Mon, 27 Jul 2020 17:17:40 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 06RHHcUn070403; Mon, 27 Jul 2020 10:17:38 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 06RHHc0j070402; Mon, 27 Jul 2020 10:17:38 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202007271717.06RHHc0j070402@gndrsh.dnsmgr.net> Subject: Re: svn commit: r363598 - head/usr.sbin/nologin In-Reply-To: To: Mateusz Piotrowski <0mp@freebsd.org> Date: Mon, 27 Jul 2020 10:17:38 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4BFmhh2jFyz455q X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 17:17:40 -0000 [ Charset UTF-8 unsupported, converting... ] > Hi! > > On 7/27/20 6:41 PM, Rodney W. Grimes wrote: > >> Author: 0mp (doc,ports committer) > >> Date: Mon Jul 27 10:45:47 2020 > >> New Revision: 363598 > >> URL: https://svnweb.freebsd.org/changeset/base/363598 > >> > >> Log: > >> nologin.8: Improve wording > > I disagree that this improves wording. The norm of action for > > "logging" in Unix is to "write to syslog", not "log to syslog". > > Hmm, I agree, but here it is "log using syslog". Please read syslog(3) it is rather consistent about using "write to syslog". The action of calling syslog(3) is to "writes message to the system message logger." > > Have you got any idea how to further improve this sentence? No, but can we not degrade it? > > >> Reported by: yuripv > >> Reviewed by: bcr, yuripv > >> MFC after: 3 days > >> Differential Revision: https://reviews.freebsd.org/D25814 > >> > >> Modified: > >> head/usr.sbin/nologin/nologin.8 > >> > >> Modified: head/usr.sbin/nologin/nologin.8 > >> ============================================================================== > >> --- head/usr.sbin/nologin/nologin.8 Mon Jul 27 09:10:02 2020 (r363597) > >> +++ head/usr.sbin/nologin/nologin.8 Mon Jul 27 10:45:47 2020 (r363598) > >> @@ -44,7 +44,7 @@ have been disabled. > >> .Pp > >> When executed, > >> .Nm > >> -first writes about the login attempt to > >> +first logs about the login attempt using > >> .Xr syslog 3 > >> and then displays a message that an account is not available. > >> .Pp > > Cheers! > > Mateusz Piotrowski > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Jul 27 18:46:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 629EE36BE16; Mon, 27 Jul 2020 18:46:21 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFpg121Trz4Bxd; Mon, 27 Jul 2020 18:46:21 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 291B421FDF; Mon, 27 Jul 2020 18:46:21 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06RIkKda038428; Mon, 27 Jul 2020 18:46:20 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06RIkKBs038427; Mon, 27 Jul 2020 18:46:20 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <202007271846.06RIkKBs038427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Mon, 27 Jul 2020 18:46:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363621 - head/bin/sh X-SVN-Group: head X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: head/bin/sh X-SVN-Commit-Revision: 363621 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 18:46:21 -0000 Author: pstef Date: Mon Jul 27 18:46:20 2020 New Revision: 363621 URL: https://svnweb.freebsd.org/changeset/base/363621 Log: sh(1): print a newline when ^D quits sh I've always found this a little bit confusing: > sh $ ^D> sh $ ^D> Reviewed by: 0mp, jilles MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25813 Modified: head/bin/sh/main.c Modified: head/bin/sh/main.c ============================================================================== --- head/bin/sh/main.c Mon Jul 27 16:51:23 2020 (r363620) +++ head/bin/sh/main.c Mon Jul 27 18:46:20 2020 (r363621) @@ -228,6 +228,10 @@ cmdloop(int top) } } popstackmark(&smark); + if (top && iflag) { + out2c('\n'); + flushout(out2); + } } From owner-svn-src-head@freebsd.org Mon Jul 27 18:57:29 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F83736BE7D; Mon, 27 Jul 2020 18:57:29 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFpvs04G3z4ChF; Mon, 27 Jul 2020 18:57:29 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA708225B5; Mon, 27 Jul 2020 18:57:28 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06RIvSCJ044935; Mon, 27 Jul 2020 18:57:28 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06RIvSS7044934; Mon, 27 Jul 2020 18:57:28 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202007271857.06RIvSS7044934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 27 Jul 2020 18:57:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363622 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 363622 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 18:57:29 -0000 Author: asomers Date: Mon Jul 27 18:57:28 2020 New Revision: 363622 URL: https://svnweb.freebsd.org/changeset/base/363622 Log: Restrict definition of CTL_P1003_1B_MAXID to the kernel This constant is only used to size an array within the kernel. There are probably no legitimate uses in userland. Worse, since the kernel's array could theoretically change size over time, any use of that symbol in userland wouldn't be forwards compatible to new kernel versions. Reviewed by: jhb MFC after: Never Differential Revision: https://reviews.freebsd.org/D25816 Modified: head/sys/sys/sysctl.h Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Mon Jul 27 18:46:20 2020 (r363621) +++ head/sys/sys/sysctl.h Mon Jul 27 18:57:28 2020 (r363622) @@ -1096,9 +1096,9 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); #define CTL_P1003_1B_SIGQUEUE_MAX 24 /* int */ #define CTL_P1003_1B_TIMER_MAX 25 /* int */ -#define CTL_P1003_1B_MAXID 26 - #ifdef _KERNEL + +#define CTL_P1003_1B_MAXID 26 /* * Declare some common oids. From owner-svn-src-head@freebsd.org Mon Jul 27 19:05:54 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95A8236C3F1; Mon, 27 Jul 2020 19:05:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFq5Z3SsXz4DZY; Mon, 27 Jul 2020 19:05:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B38F228FF; Mon, 27 Jul 2020 19:05:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06RJ5sok051039; Mon, 27 Jul 2020 19:05:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06RJ5sin051038; Mon, 27 Jul 2020 19:05:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007271905.06RJ5sin051038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 27 Jul 2020 19:05:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363623 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 363623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 19:05:54 -0000 Author: markj Date: Mon Jul 27 19:05:53 2020 New Revision: 363623 URL: https://svnweb.freebsd.org/changeset/base/363623 Log: cxgbe(4): Stop checking for failures from malloc(M_WAITOK). PR: 240545 Submitted by: Andrew Reiter Reviewed by: np MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25767 Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Jul 27 18:57:28 2020 (r363622) +++ head/sys/dev/cxgbe/t4_main.c Mon Jul 27 19:05:53 2020 (r363623) @@ -10003,10 +10003,6 @@ load_fw(struct adapter *sc, struct t4_data *fw) } fw_data = malloc(fw->len, M_CXGBE, M_WAITOK); - if (fw_data == NULL) { - rc = ENOMEM; - goto done; - } rc = copyin(fw->data, fw_data, fw->len); if (rc == 0) @@ -10035,10 +10031,6 @@ load_cfg(struct adapter *sc, struct t4_data *cfg) } cfg_data = malloc(cfg->len, M_CXGBE, M_WAITOK); - if (cfg_data == NULL) { - rc = ENOMEM; - goto done; - } rc = copyin(cfg->data, cfg_data, cfg->len); if (rc == 0) @@ -10084,10 +10076,6 @@ load_boot(struct adapter *sc, struct t4_bootrom *br) } br_data = malloc(br->len, M_CXGBE, M_WAITOK); - if (br_data == NULL) { - rc = ENOMEM; - goto done; - } rc = copyin(br->data, br_data, br->len); if (rc == 0) @@ -10116,10 +10104,6 @@ load_bootcfg(struct adapter *sc, struct t4_data *bc) } bc_data = malloc(bc->len, M_CXGBE, M_WAITOK); - if (bc_data == NULL) { - rc = ENOMEM; - goto done; - } rc = copyin(bc->data, bc_data, bc->len); if (rc == 0) From owner-svn-src-head@freebsd.org Mon Jul 27 21:19:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 09012370105; Mon, 27 Jul 2020 21:19:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFt3z6ZZ1z4MB5; Mon, 27 Jul 2020 21:19:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1A682428F; Mon, 27 Jul 2020 21:19:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06RLJhQB031091; Mon, 27 Jul 2020 21:19:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06RLJf3f031079; Mon, 27 Jul 2020 21:19:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202007272119.06RLJf3f031079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 27 Jul 2020 21:19:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363624 - in head/sys: arm64/arm64 arm64/include conf dev/acpica dev/pci x86/include x86/x86 X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys: arm64/arm64 arm64/include conf dev/acpica dev/pci x86/include x86/x86 X-SVN-Commit-Revision: 363624 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2020 21:19:44 -0000 Author: mav Date: Mon Jul 27 21:19:41 2020 New Revision: 363624 URL: https://svnweb.freebsd.org/changeset/base/363624 Log: Add initial driver for ACPI Platform Error Interfaces. APEI allows platform to report different kinds of errors to OS in several ways. We've found that Supermicro X10/X11 motherboards report PCIe errors appearing on hot-unplug via this interface using NMI. Without respective driver it ended up in kernel panic without any additional information. This driver introduces support for the APEI Generic Hardware Error Source reporting via NMI, SCI or polling. It decodes the reported errors and either pass them to pci(4) for processing or just logs otherwise. Errors marked as fatal still end up in kernel panic, but some more informative. When somebody get to native PCIe AER support implementation both of the reporting mechanisms should get common error recovery code. Since in our case errors happen when the device is already gone, there is nothing to recover, so the code just clears the error statuses, practically ignoring the otherwise destructive NMIs in nicer way. MFC after: 2 weeks Relnotes: yes Sponsored by: iXsystems, Inc. Added: head/sys/dev/acpica/acpi_apei.c (contents, props changed) Modified: head/sys/arm64/arm64/machdep.c head/sys/arm64/include/acpica_machdep.h head/sys/conf/files head/sys/dev/acpica/acpi.c head/sys/dev/pci/pci.c head/sys/dev/pci/pcivar.h head/sys/x86/include/acpica_machdep.h head/sys/x86/x86/cpu_machdep.c Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Mon Jul 27 19:05:53 2020 (r363623) +++ head/sys/arm64/arm64/machdep.c Mon Jul 27 21:19:41 2020 (r363624) @@ -132,6 +132,8 @@ void pagezero_cache(void *); /* pagezero_simple is default pagezero */ void (*pagezero)(void *p) = pagezero_simple; +int (*apei_nmi)(void); + static void pan_setup(void) { Modified: head/sys/arm64/include/acpica_machdep.h ============================================================================== --- head/sys/arm64/include/acpica_machdep.h Mon Jul 27 19:05:53 2020 (r363623) +++ head/sys/arm64/include/acpica_machdep.h Mon Jul 27 21:19:41 2020 (r363624) @@ -57,6 +57,8 @@ struct acpi_generic_address; int acpi_map_addr(struct acpi_generic_address *, bus_space_tag_t *, bus_space_handle_t *, bus_size_t); +extern int (*apei_nmi)(void); + #endif /* _KERNEL */ #endif /* __ACPICA_MACHDEP_H__ */ Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Jul 27 19:05:53 2020 (r363623) +++ head/sys/conf/files Mon Jul 27 21:19:41 2020 (r363624) @@ -754,6 +754,7 @@ dev/acpica/Osd/OsdSynch.c optional acpi dev/acpica/Osd/OsdTable.c optional acpi dev/acpica/acpi.c optional acpi dev/acpica/acpi_acad.c optional acpi +dev/acpica/acpi_apei.c optional acpi dev/acpica/acpi_battery.c optional acpi dev/acpica/acpi_button.c optional acpi dev/acpica/acpi_cmbat.c optional acpi Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Mon Jul 27 19:05:53 2020 (r363623) +++ head/sys/dev/acpica/acpi.c Mon Jul 27 21:19:41 2020 (r363624) @@ -152,6 +152,7 @@ static ACPI_STATUS acpi_device_scan_children(device_t int max_depth, acpi_scan_cb_t user_fn, void *arg); static int acpi_isa_pnp_probe(device_t bus, device_t child, struct isa_pnp_id *ids); +static void acpi_platform_osc(device_t dev); static void acpi_probe_children(device_t bus); static void acpi_probe_order(ACPI_HANDLE handle, int *order); static ACPI_STATUS acpi_probe_child(ACPI_HANDLE handle, UINT32 level, @@ -683,6 +684,8 @@ acpi_attach(device_t dev) /* Register ACPI again to pass the correct argument of pm_func. */ power_pm_register(POWER_PM_TYPE_ACPI, acpi_pm_func, sc); + acpi_platform_osc(dev); + if (!acpi_disabled("bus")) { EVENTHANDLER_REGISTER(dev_lookup, acpi_lookup, NULL, 1000); acpi_probe_children(dev); @@ -1941,6 +1944,34 @@ acpi_enable_pcie(void) alloc++; } #endif +} + +static void +acpi_platform_osc(device_t dev) +{ + ACPI_HANDLE sb_handle; + ACPI_STATUS status; + uint32_t cap_set[2]; + + /* 0811B06E-4A27-44F9-8D60-3CBBC22E7B48 */ + static uint8_t acpi_platform_uuid[ACPI_UUID_LENGTH] = { + 0x6e, 0xb0, 0x11, 0x08, 0x27, 0x4a, 0xf9, 0x44, + 0x8d, 0x60, 0x3c, 0xbb, 0xc2, 0x2e, 0x7b, 0x48 + }; + + if (ACPI_FAILURE(AcpiGetHandle(ACPI_ROOT_OBJECT, "\\_SB_", &sb_handle))) + return; + + cap_set[1] = 0x10; /* APEI Support */ + status = acpi_EvaluateOSC(sb_handle, acpi_platform_uuid, 1, + nitems(cap_set), cap_set, cap_set, false); + if (ACPI_FAILURE(status)) { + if (status == AE_NOT_FOUND) + return; + device_printf(dev, "_OSC failed: %s\n", + AcpiFormatException(status)); + return; + } } /* Added: head/sys/dev/acpica/acpi_apei.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/acpica/acpi_apei.c Mon Jul 27 21:19:41 2020 (r363624) @@ -0,0 +1,684 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Alexander Motin + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_acpi.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +struct apei_ge { + union { + ACPI_HEST_GENERIC v1; + ACPI_HEST_GENERIC_V2 v2; + }; + int res_type; + int res_rid; + struct resource *res; + int res2_type; + int res2_rid; + struct resource *res2; + uint8_t *buf, *copybuf; + TAILQ_ENTRY(apei_ge) link; + struct callout poll; + void *swi_ih; +} *apei_nmi_ge; + +struct apei_softc { + ACPI_TABLE_HEST *hest; + TAILQ_HEAD(, apei_ge) ges; +}; + +struct apei_mem_error { + uint64_t ValidationBits; + uint64_t ErrorStatus; + uint64_t PhysicalAddress; + uint64_t PhysicalAddressMask; + uint16_t Node; + uint16_t Card; + uint16_t Module; + uint16_t Bank; + uint16_t Device; + uint16_t Row; + uint16_t Column; + uint16_t BitPosition; + uint64_t RequesterID; + uint64_t ResponderID; + uint64_t TargetID; + uint8_t MemoryErrorType; + uint8_t Extended; + uint16_t RankNumber; + uint16_t CardHandle; + uint16_t ModuleHandle; +}; + +struct apei_pcie_error { + uint64_t ValidationBits; + uint32_t PortType; + uint32_t Version; + uint32_t CommandStatus; + uint32_t Reserved; + uint8_t DeviceID[16]; + uint8_t DeviceSerialNumber[8]; + uint8_t BridgeControlStatus[4]; + uint8_t CapabilityStructure[60]; + uint8_t AERInfo[96]; +}; + +#ifdef __i386__ +static __inline uint64_t +apei_bus_read_8(struct resource *res, bus_size_t offset) +{ + return (bus_read_4(res, offset) | + ((uint64_t)bus_read_4(res, offset + 4)) << 32); +} +static __inline void +apei_bus_write_8(struct resource *res, bus_size_t offset, uint64_t val) +{ + bus_write_4(res, offset, val); + bus_write_4(res, offset + 4, val >> 32); +} +#define READ8(r, o) apei_bus_read_8((r), (o)) +#define WRITE8(r, o, v) apei_bus_write_8((r), (o), (v)) +#else +#define READ8(r, o) bus_read_8((r), (o)) +#define WRITE8(r, o, v) bus_write_8((r), (o), (v)) +#endif + +int apei_nmi_handler(void); + +static const char * +apei_severity(uint32_t s) +{ + switch (s) { + case ACPI_HEST_GEN_ERROR_RECOVERABLE: + return ("Recoverable"); + case ACPI_HEST_GEN_ERROR_FATAL: + return ("Fatal"); + case ACPI_HEST_GEN_ERROR_CORRECTED: + return ("Corrected"); + case ACPI_HEST_GEN_ERROR_NONE: + return ("Informational"); + } + return ("???"); +} + +static int +apei_mem_handler(ACPI_HEST_GENERIC_DATA *ged) +{ + struct apei_mem_error *p = (struct apei_mem_error *)(ged + 1); + + printf("APEI %s Memory Error:\n", apei_severity(ged->ErrorSeverity)); + if (p->ValidationBits & 0x01) + printf(" Error Status: 0x%jx\n", p->ErrorStatus); + if (p->ValidationBits & 0x02) + printf(" Physical Address: 0x%jx\n", p->PhysicalAddress); + if (p->ValidationBits & 0x04) + printf(" Physical Address Mask: 0x%jx\n", p->PhysicalAddressMask); + if (p->ValidationBits & 0x08) + printf(" Node: %u\n", p->Node); + if (p->ValidationBits & 0x10) + printf(" Card: %u\n", p->Card); + if (p->ValidationBits & 0x20) + printf(" Module: %u\n", p->Module); + if (p->ValidationBits & 0x40) + printf(" Bank: %u\n", p->Bank); + if (p->ValidationBits & 0x80) + printf(" Device: %u\n", p->Device); + if (p->ValidationBits & 0x100) + printf(" Row: %u\n", p->Row); + if (p->ValidationBits & 0x200) + printf(" Column: %u\n", p->Column); + if (p->ValidationBits & 0x400) + printf(" Bit Position: %u\n", p->BitPosition); + if (p->ValidationBits & 0x800) + printf(" Requester ID: 0x%jx\n", p->RequesterID); + if (p->ValidationBits & 0x1000) + printf(" Responder ID: 0x%jx\n", p->ResponderID); + if (p->ValidationBits & 0x2000) + printf(" Target ID: 0x%jx\n", p->TargetID); + if (p->ValidationBits & 0x4000) + printf(" Memory Error Type: %u\n", p->MemoryErrorType); + if (p->ValidationBits & 0x8000) + printf(" Rank Number: %u\n", p->RankNumber); + if (p->ValidationBits & 0x10000) + printf(" Card Handle: 0x%x\n", p->CardHandle); + if (p->ValidationBits & 0x20000) + printf(" Module Handle: 0x%x\n", p->ModuleHandle); + if (p->ValidationBits & 0x40000) + printf(" Extended Row: %u\n", + (uint32_t)(p->Extended & 0x3) << 16 | p->Row); + if (p->ValidationBits & 0x80000) + printf(" Bank Group: %u\n", p->Bank >> 8); + if (p->ValidationBits & 0x100000) + printf(" Bank Address: %u\n", p->Bank & 0xff); + if (p->ValidationBits & 0x200000) + printf(" Chip Identification: %u\n", (p->Extended >> 5) & 0x7); + + return (0); +} + +static int +apei_pcie_handler(ACPI_HEST_GENERIC_DATA *ged) +{ + struct apei_pcie_error *p = (struct apei_pcie_error *)(ged + 1); + device_t dev; + int h = 0, off, sev; + + if ((p->ValidationBits & 0x8) == 0x8) { + mtx_lock(&Giant); + dev = pci_find_dbsf((uint32_t)p->DeviceID[10] << 8 | + p->DeviceID[9], p->DeviceID[11], p->DeviceID[8], + p->DeviceID[7]); + if (dev != NULL) { + switch (ged->ErrorSeverity) { + case ACPI_HEST_GEN_ERROR_FATAL: + sev = PCIEM_STA_FATAL_ERROR; + break; + case ACPI_HEST_GEN_ERROR_RECOVERABLE: + sev = PCIEM_STA_NON_FATAL_ERROR; + break; + default: + sev = PCIEM_STA_CORRECTABLE_ERROR; + break; + } + pcie_apei_error(dev, sev, + (p->ValidationBits & 0x80) ? p->AERInfo : NULL); + h = 1; + } + mtx_unlock(&Giant); + } + if (h) + return (h); + + printf("APEI %s PCIe Error:\n", apei_severity(ged->ErrorSeverity)); + if (p->ValidationBits & 0x01) + printf(" Port Type: %u\n", p->PortType); + if (p->ValidationBits & 0x02) + printf(" Version: %x\n", p->Version); + if (p->ValidationBits & 0x04) + printf(" Command Status: 0x%08x\n", p->CommandStatus); + if (p->ValidationBits & 0x08) { + printf(" DeviceID:"); + for (off = 0; off < sizeof(p->DeviceID); off++) + printf(" %02x", p->DeviceID[off]); + printf("\n"); + } + if (p->ValidationBits & 0x10) { + printf(" Device Serial Number:"); + for (off = 0; off < sizeof(p->DeviceSerialNumber); off++) + printf(" %02x", p->DeviceSerialNumber[off]); + printf("\n"); + } + if (p->ValidationBits & 0x20) { + printf(" Bridge Control Status:"); + for (off = 0; off < sizeof(p->BridgeControlStatus); off++) + printf(" %02x", p->BridgeControlStatus[off]); + printf("\n"); + } + if (p->ValidationBits & 0x40) { + printf(" Capability Structure:\n"); + for (off = 0; off < sizeof(p->CapabilityStructure); off++) { + printf(" %02x", p->CapabilityStructure[off]); + if ((off % 16) == 15 || + off + 1 == sizeof(p->CapabilityStructure)) + printf("\n"); + } + } + if (p->ValidationBits & 0x80) { + printf(" AER Info:\n"); + for (off = 0; off < sizeof(p->AERInfo); off++) { + printf(" %02x", p->AERInfo[off]); + if ((off % 16) == 15 || off + 1 == sizeof(p->AERInfo)) + printf("\n"); + } + } + return (h); +} + +static void +apei_ged_handler(ACPI_HEST_GENERIC_DATA *ged) +{ + ACPI_HEST_GENERIC_DATA_V300 *ged3 = (ACPI_HEST_GENERIC_DATA_V300 *)ged; + /* A5BC1114-6F64-4EDE-B863-3E83ED7C83B1 */ + static uint8_t mem_uuid[ACPI_UUID_LENGTH] = { + 0x14, 0x11, 0xBC, 0xA5, 0x64, 0x6F, 0xDE, 0x4E, + 0xB8, 0x63, 0x3E, 0x83, 0xED, 0x7C, 0x83, 0xB1 + }; + /* D995E954-BBC1-430F-AD91-B44DCB3C6F35 */ + static uint8_t pcie_uuid[ACPI_UUID_LENGTH] = { + 0x54, 0xE9, 0x95, 0xD9, 0xC1, 0xBB, 0x0F, 0x43, + 0xAD, 0x91, 0xB4, 0x4D, 0xCB, 0x3C, 0x6F, 0x35 + }; + uint8_t *t; + int h = 0, off; + + if (memcmp(mem_uuid, ged->SectionType, ACPI_UUID_LENGTH) == 0) { + h = apei_mem_handler(ged); + } else if (memcmp(pcie_uuid, ged->SectionType, ACPI_UUID_LENGTH) == 0) { + h = apei_pcie_handler(ged); + } else { + t = ged->SectionType; + printf("APEI %s Error %02x%02x%02x%02x-%02x%02x-" + "%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x:\n", + apei_severity(ged->ErrorSeverity), + t[3], t[2], t[1], t[0], t[5], t[4], t[7], t[6], + t[8], t[9], t[10], t[11], t[12], t[13], t[14], t[15]); + printf(" Error Data:\n"); + t = (uint8_t *)(ged + 1); + for (off = 0; off < ged->ErrorDataLength; off++) { + printf(" %02x", t[off]); + if ((off % 16) == 15 || off + 1 == ged->ErrorDataLength) + printf("\n"); + } + } + if (h) + return; + + printf(" Flags: 0x%x\n", ged->Flags); + if (ged->ValidationBits & ACPI_HEST_GEN_VALID_FRU_ID) { + t = ged->FruId; + printf(" FRU Id: %02x%02x%02x%02x-%02x%02x-%02x%02x-" + "%02x%02x-%02x%02x%02x%02x%02x%02x\n", + t[3], t[2], t[1], t[0], t[5], t[4], t[7], t[6], + t[8], t[9], t[10], t[11], t[12], t[13], t[14], t[15]); + } + if (ged->ValidationBits & ACPI_HEST_GEN_VALID_FRU_STRING) + printf(" FRU Text: %.20s", ged->FruText); + if (ged->Revision == 0x300 && + ged->ValidationBits & ACPI_HEST_GEN_VALID_TIMESTAMP) + printf(" Timestamp: %016jx", ged3->TimeStamp); +} + +static int +apei_ge_handler(struct apei_ge *ge, bool copy) +{ + uint8_t *buf = copy ? ge->copybuf : ge->buf; + ACPI_HEST_GENERIC_STATUS *ges = (ACPI_HEST_GENERIC_STATUS *)buf; + ACPI_HEST_GENERIC_DATA *ged; + uint32_t sev; + int i, c, off; + + if (ges->BlockStatus == 0) + return (0); + + c = (ges->BlockStatus >> 4) & 0x3ff; + sev = ges->ErrorSeverity; + + /* Process error entries. */ + for (off = i = 0; i < c && off + sizeof(*ged) <= ges->DataLength; i++) { + ged = (ACPI_HEST_GENERIC_DATA *)&buf[sizeof(*ges) + off]; + apei_ged_handler(ged); + off += sizeof(*ged) + ged->ErrorDataLength; + } + + /* Acknowledge the error has been processed. */ + ges->BlockStatus = 0; + if (!copy && ge->v1.Header.Type == ACPI_HEST_TYPE_GENERIC_ERROR_V2) { + uint64_t val = READ8(ge->res2, 0); + val &= ge->v2.ReadAckPreserve; + val |= ge->v2.ReadAckWrite; + WRITE8(ge->res2, 0, val); + } + + /* If ACPI told the error is fatal -- make it so. */ + if (sev == ACPI_HEST_GEN_ERROR_FATAL) + panic("APEI Fatal Hardware Error!"); + + return (1); +} + +static void +apei_nmi_swi(void *arg) +{ + struct apei_ge *ge = arg; + + apei_ge_handler(ge, true); +} + +int +apei_nmi_handler(void) +{ + struct apei_ge *ge = apei_nmi_ge; + ACPI_HEST_GENERIC_STATUS *ges, *gesc; + + if (ge == NULL) + return (0); + + ges = (ACPI_HEST_GENERIC_STATUS *)ge->buf; + if (ges->BlockStatus == 0) + return (0); + + /* If ACPI told the error is fatal -- make it so. */ + if (ges->ErrorSeverity == ACPI_HEST_GEN_ERROR_FATAL) + panic("APEI Fatal Hardware Error!"); + + /* Copy the buffer for later processing. */ + gesc = (ACPI_HEST_GENERIC_STATUS *)ge->copybuf; + if (gesc->BlockStatus == 0) + memcpy(ge->copybuf, ge->buf, ge->v1.ErrorBlockLength); + + /* Acknowledge the error has been processed. */ + ges->BlockStatus = 0; + if (ge->v1.Header.Type == ACPI_HEST_TYPE_GENERIC_ERROR_V2) { + uint64_t val = READ8(ge->res2, 0); + val &= ge->v2.ReadAckPreserve; + val |= ge->v2.ReadAckWrite; + WRITE8(ge->res2, 0, val); + } + + /* Schedule SWI for real handling. */ + swi_sched(ge->swi_ih, SWI_FROMNMI); + + return (1); +} + +static void +apei_callout_handler(void *context) +{ + struct apei_ge *ge = context; + + apei_ge_handler(ge, false); + callout_schedule(&ge->poll, ge->v1.Notify.PollInterval * hz / 1000); +} + +static void +apei_notify_handler(ACPI_HANDLE h, UINT32 notify, void *context) +{ + device_t dev = context; + struct apei_softc *sc = device_get_softc(dev); + struct apei_ge *ge; + + TAILQ_FOREACH(ge, &sc->ges, link) { + if (ge->v1.Notify.Type == ACPI_HEST_NOTIFY_SCI || + ge->v1.Notify.Type == ACPI_HEST_NOTIFY_GPIO || + ge->v1.Notify.Type == ACPI_HEST_NOTIFY_GSIV) + apei_ge_handler(ge, false); + } +} + +static int +hest_parse_structure(struct apei_softc *sc, void *addr, int remaining) +{ + ACPI_HEST_HEADER *hdr = addr; + struct apei_ge *ge; + + if (remaining < (int)sizeof(ACPI_HEST_HEADER)) + return (-1); + + switch (hdr->Type) { + case ACPI_HEST_TYPE_IA32_CHECK: { + ACPI_HEST_IA_MACHINE_CHECK *s = addr; + return (sizeof(*s) + s->NumHardwareBanks * + sizeof(ACPI_HEST_IA_ERROR_BANK)); + } + case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK: { + ACPI_HEST_IA_CORRECTED *s = addr; + return (sizeof(*s) + s->NumHardwareBanks * + sizeof(ACPI_HEST_IA_ERROR_BANK)); + } + case ACPI_HEST_TYPE_IA32_NMI: { + ACPI_HEST_IA_NMI *s = addr; + return (sizeof(*s)); + } + case ACPI_HEST_TYPE_AER_ROOT_PORT: { + ACPI_HEST_AER_ROOT *s = addr; + return (sizeof(*s)); + } + case ACPI_HEST_TYPE_AER_ENDPOINT: { + ACPI_HEST_AER *s = addr; + return (sizeof(*s)); + } + case ACPI_HEST_TYPE_AER_BRIDGE: { + ACPI_HEST_AER_BRIDGE *s = addr; + return (sizeof(*s)); + } + case ACPI_HEST_TYPE_GENERIC_ERROR: { + ACPI_HEST_GENERIC *s = addr; + ge = malloc(sizeof(*ge), M_DEVBUF, M_WAITOK | M_ZERO); + ge->v1 = *s; + TAILQ_INSERT_TAIL(&sc->ges, ge, link); + return (sizeof(*s)); + } + case ACPI_HEST_TYPE_GENERIC_ERROR_V2: { + ACPI_HEST_GENERIC_V2 *s = addr; + ge = malloc(sizeof(*ge), M_DEVBUF, M_WAITOK | M_ZERO); + ge->v2 = *s; + TAILQ_INSERT_TAIL(&sc->ges, ge, link); + return (sizeof(*s)); + } + case ACPI_HEST_TYPE_IA32_DEFERRED_CHECK: { + ACPI_HEST_IA_DEFERRED_CHECK *s = addr; + return (sizeof(*s) + s->NumHardwareBanks * + sizeof(ACPI_HEST_IA_ERROR_BANK)); + } + default: + return (-1); + } +} + +static void +hest_parse_table(struct apei_softc *sc) +{ + ACPI_TABLE_HEST *hest = sc->hest; + char *cp; + int remaining, consumed; + + remaining = hest->Header.Length - sizeof(ACPI_TABLE_HEST); + while (remaining > 0) { + cp = (char *)hest + hest->Header.Length - remaining; + consumed = hest_parse_structure(sc, cp, remaining); + if (consumed <= 0) + break; + else + remaining -= consumed; + } +} + +static char *apei_ids[] = { "PNP0C33", NULL }; +static devclass_t apei_devclass; + +static ACPI_STATUS +apei_find(ACPI_HANDLE handle, UINT32 level, void *context, + void **status) +{ + int *found = (int *)status; + char **ids; + + for (ids = apei_ids; *ids != NULL; ids++) { + if (acpi_MatchHid(handle, *ids)) { + *found = 1; + break; + } + } + return (AE_OK); +} + +static void +apei_identify(driver_t *driver, device_t parent) +{ + device_t child; + int found; + + if (acpi_disabled("apei")) + return; + if (acpi_find_table(ACPI_SIG_HEST) == 0) + return; + /* Only one APEI device can exist. */ + if (devclass_get_device(apei_devclass, 0)) + return; + /* Search for ACPI error device to be used. */ + found = 0; + AcpiWalkNamespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, + 100, apei_find, NULL, NULL, (void *)&found); + if (found) + return; + /* If not found - create a fake one. */ + child = BUS_ADD_CHILD(parent, 2, "apei", 0); + if (child == NULL) + printf("%s: can't add child\n", __func__); +} + +static int +apei_probe(device_t dev) +{ + int rv; + + if (acpi_disabled("apei")) + return (ENXIO); + if (acpi_find_table(ACPI_SIG_HEST) == 0) + return (ENXIO); + if (acpi_get_handle(dev) != NULL) + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, apei_ids, NULL); + else + rv = 0; + if (rv <= 0) + device_set_desc(dev, "Platform Error Interface"); + return (rv); +} + +static int +apei_attach(device_t dev) +{ + struct apei_softc *sc = device_get_softc(dev); + struct apei_ge *ge; + ACPI_STATUS status; + int rid; + + TAILQ_INIT(&sc->ges); + + /* Search and parse HEST table. */ + status = AcpiGetTable(ACPI_SIG_HEST, 0, (ACPI_TABLE_HEADER **)&sc->hest); + if (ACPI_FAILURE(status)) + return (ENXIO); + hest_parse_table(sc); + AcpiPutTable((ACPI_TABLE_HEADER *)sc->hest); + + rid = 0; + TAILQ_FOREACH(ge, &sc->ges, link) { + ge->res_rid = rid++; + acpi_bus_alloc_gas(dev, &ge->res_type, &ge->res_rid, + &ge->v1.ErrorStatusAddress, &ge->res, 0); + if (ge->v1.Header.Type == ACPI_HEST_TYPE_GENERIC_ERROR_V2) { + ge->res2_rid = rid++; + acpi_bus_alloc_gas(dev, &ge->res2_type, &ge->res2_rid, + &ge->v2.ReadAckRegister, &ge->res2, 0); + } + ge->buf = pmap_mapdev_attr(READ8(ge->res, 0), + ge->v1.ErrorBlockLength, VM_MEMATTR_WRITE_COMBINING); + if (ge->v1.Notify.Type == ACPI_HEST_NOTIFY_POLLED) { + callout_init(&ge->poll, 1); + callout_reset(&ge->poll, + ge->v1.Notify.PollInterval * hz / 1000, + apei_callout_handler, ge); + } else if (ge->v1.Notify.Type == ACPI_HEST_NOTIFY_NMI) { + ge->copybuf = malloc(ge->v1.ErrorBlockLength, + M_DEVBUF, M_WAITOK | M_ZERO); + swi_add(&clk_intr_event, "apei", apei_nmi_swi, ge, + SWI_CLOCK, INTR_MPSAFE, &ge->swi_ih); + apei_nmi_ge = ge; + apei_nmi = apei_nmi_handler; + } + } + + if (acpi_get_handle(dev) != NULL) { + AcpiInstallNotifyHandler(acpi_get_handle(dev), + ACPI_DEVICE_NOTIFY, apei_notify_handler, dev); + } + return (0); +} + +static int +apei_detach(device_t dev) +{ + struct apei_softc *sc = device_get_softc(dev); + struct apei_ge *ge; + + apei_nmi = NULL; + apei_nmi_ge = NULL; + if (acpi_get_handle(dev) != NULL) { + AcpiRemoveNotifyHandler(acpi_get_handle(dev), + ACPI_DEVICE_NOTIFY, apei_notify_handler); + } + + while ((ge = TAILQ_FIRST(&sc->ges)) != NULL) { + TAILQ_REMOVE(&sc->ges, ge, link); + bus_release_resource(dev, ge->res_type, ge->res_rid, ge->res); + if (ge->res2) { + bus_release_resource(dev, ge->res2_type, + ge->res2_rid, ge->res2); + } + if (ge->v1.Notify.Type == ACPI_HEST_NOTIFY_POLLED) { + callout_drain(&ge->poll); + } else if (ge->v1.Notify.Type == ACPI_HEST_NOTIFY_NMI) { + swi_remove(&ge->swi_ih); + free(ge->copybuf, M_DEVBUF); + } + pmap_unmapdev((vm_offset_t)ge->buf, ge->v1.ErrorBlockLength); + free(ge, M_DEVBUF); + } + return (0); +} + +static device_method_t apei_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, apei_identify), + DEVMETHOD(device_probe, apei_probe), + DEVMETHOD(device_attach, apei_attach), + DEVMETHOD(device_detach, apei_detach), + DEVMETHOD_END +}; + +static driver_t apei_driver = { + "apei", + apei_methods, + sizeof(struct apei_softc), +}; + +DRIVER_MODULE(apei, acpi, apei_driver, apei_devclass, 0, 0); +MODULE_DEPEND(apei, acpi, 1, 1, 1); Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Mon Jul 27 19:05:53 2020 (r363623) +++ head/sys/dev/pci/pci.c Mon Jul 27 21:19:41 2020 (r363624) @@ -6306,6 +6306,67 @@ pcie_get_max_completion_timeout(device_t dev) } } +void +pcie_apei_error(device_t dev, int sev, uint8_t *aerp) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + const char *s; + int aer; + uint32_t r, r1; + uint16_t rs; + + if (sev == PCIEM_STA_CORRECTABLE_ERROR) + s = "Correctable"; + else if (sev == PCIEM_STA_NON_FATAL_ERROR) + s = "Uncorrectable (Non-Fatal)"; + else + s = "Uncorrectable (Fatal)"; + device_printf(dev, "%s PCIe error reported by APEI\n", s); + if (aerp) { + if (sev == PCIEM_STA_CORRECTABLE_ERROR) { + r = le32dec(aerp + PCIR_AER_COR_STATUS); + r1 = le32dec(aerp + PCIR_AER_COR_MASK); + } else { + r = le32dec(aerp + PCIR_AER_UC_STATUS); + r1 = le32dec(aerp + PCIR_AER_UC_MASK); + } + device_printf(dev, "status 0x%08x mask 0x%08x", r, r1); + if (sev != PCIEM_STA_CORRECTABLE_ERROR) { + r = le32dec(aerp + PCIR_AER_UC_SEVERITY); + rs = le16dec(aerp + PCIR_AER_CAP_CONTROL); + printf(" severity 0x%08x first %d\n", + r, rs & 0x1f); + } else + printf("\n"); + } + + /* As kind of recovery just report and clear the error statuses. */ + if (pci_find_extcap(dev, PCIZ_AER, &aer) == 0) { + r = pci_read_config(dev, aer + PCIR_AER_UC_STATUS, 4); + if (r != 0) { + pci_write_config(dev, aer + PCIR_AER_UC_STATUS, r, 4); + device_printf(dev, "Clearing UC AER errors 0x%08x\n", r); + } + + r = pci_read_config(dev, aer + PCIR_AER_COR_STATUS, 4); + if (r != 0) { + pci_write_config(dev, aer + PCIR_AER_COR_STATUS, r, 4); + device_printf(dev, "Clearing COR AER errors 0x%08x\n", r); + } + } + if (dinfo->cfg.pcie.pcie_location != 0) { + rs = pci_read_config(dev, dinfo->cfg.pcie.pcie_location + + PCIER_DEVICE_STA, 2); + if ((rs & (PCIEM_STA_CORRECTABLE_ERROR | + PCIEM_STA_NON_FATAL_ERROR | PCIEM_STA_FATAL_ERROR | + PCIEM_STA_UNSUPPORTED_REQ)) != 0) { + pci_write_config(dev, dinfo->cfg.pcie.pcie_location + + PCIER_DEVICE_STA, rs, 2); + device_printf(dev, "Clearing PCIe errors 0x%04x\n", rs); + } + } +} + /* * Perform a Function Level Reset (FLR) on a device. * Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Mon Jul 27 19:05:53 2020 (r363623) +++ head/sys/dev/pci/pcivar.h Mon Jul 27 21:19:41 2020 (r363624) @@ -686,6 +686,7 @@ uint32_t pcie_read_config(device_t dev, int reg, int w void pcie_write_config(device_t dev, int reg, uint32_t value, int width); uint32_t pcie_adjust_config(device_t dev, int reg, uint32_t mask, uint32_t value, int width); +void pcie_apei_error(device_t dev, int sev, uint8_t *aer); bool pcie_flr(device_t dev, u_int max_delay, bool force); int pcie_get_max_completion_timeout(device_t dev); bool pcie_wait_for_pending_transactions(device_t dev, u_int max_delay); Modified: head/sys/x86/include/acpica_machdep.h ============================================================================== --- head/sys/x86/include/acpica_machdep.h Mon Jul 27 19:05:53 2020 (r363623) +++ head/sys/x86/include/acpica_machdep.h Mon Jul 27 21:19:41 2020 (r363624) @@ -84,6 +84,7 @@ void madt_parse_interrupt_values(void *entry, enum intr_trigger *trig, enum intr_polarity *pol); extern int madt_found_sci_override; +extern int (*apei_nmi)(void); #endif /* _KERNEL */ Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Mon Jul 27 19:05:53 2020 (r363623) +++ head/sys/x86/x86/cpu_machdep.c Mon Jul 27 21:19:41 2020 (r363624) @@ -831,6 +831,7 @@ int nmi_is_broadcast = 1; SYSCTL_INT(_machdep, OID_AUTO, nmi_is_broadcast, CTLFLAG_RWTUN, &nmi_is_broadcast, 0, "Chipset NMI is broadcast"); +int (*apei_nmi)(void); void nmi_call_kdb(u_int cpu, u_int type, struct trapframe *frame) @@ -845,6 +846,10 @@ nmi_call_kdb(u_int cpu, u_int type, struct trapframe * panic("NMI indicates hardware failure"); } #endif /* DEV_ISA */ + + /* ACPI Platform Error Interfaces callback. */ + if (apei_nmi != NULL && (*apei_nmi)()) + claimed = true; /* * NMIs can be useful for debugging. They can be hooked up to a From owner-svn-src-head@freebsd.org Tue Jul 28 00:24:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9803F3747A9; Tue, 28 Jul 2020 00:24:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFy8s3TwTz4XPK; Tue, 28 Jul 2020 00:24:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BEE2263D3; Tue, 28 Jul 2020 00:24:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06S0ODuw047471; Tue, 28 Jul 2020 00:24:13 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06S0OCw6047467; Tue, 28 Jul 2020 00:24:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202007280024.06S0OCw6047467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 28 Jul 2020 00:24:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363627 - head/crypto/openssh X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/crypto/openssh X-SVN-Commit-Revision: 363627 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 00:24:13 -0000 Author: emaste Date: Tue Jul 28 00:24:12 2020 New Revision: 363627 URL: https://svnweb.freebsd.org/changeset/base/363627 Log: ssh: Remove AES-CBC ciphers from default server and client lists A base system OpenSSH update in 2016 or so removed a number of ciphers from the default lists offered by the server/client, due to known weaknesses. This caused POLA issues for some users and prompted PR207679; the ciphers were restored to the default lists in r296634. When upstream removed these ciphers from the default server list, they moved them to the client-only default list. They were subsequently removed from the client default, in OpenSSH 7.9p1. The change has persisted long enough. Remove these extra ciphers from both the server and client default lists, in advance of FreeBSD 13. Reviewed by: markm, rgrimes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25833 Modified: head/crypto/openssh/FREEBSD-upgrade head/crypto/openssh/myproposal.h head/crypto/openssh/sshd_config.5 Modified: head/crypto/openssh/FREEBSD-upgrade ============================================================================== --- head/crypto/openssh/FREEBSD-upgrade Mon Jul 27 23:19:46 2020 (r363626) +++ head/crypto/openssh/FREEBSD-upgrade Tue Jul 28 00:24:12 2020 (r363627) @@ -168,13 +168,6 @@ ignore HPN-related configuration options to avoid breaking existing configurations. -9) AES-CBC - - The AES-CBC ciphers were removed from the server-side proposal list - in 6.7p1 due to theoretical weaknesses and the availability of - superior ciphers (including AES-CTR and AES-GCM). We have re-added - them for compatibility with third-party clients. - This port was brought to you by (in no particular order) DARPA, NAI Modified: head/crypto/openssh/myproposal.h ============================================================================== --- head/crypto/openssh/myproposal.h Mon Jul 27 23:19:46 2020 (r363626) +++ head/crypto/openssh/myproposal.h Tue Jul 28 00:24:12 2020 (r363627) @@ -1,5 +1,4 @@ /* $OpenBSD: myproposal.h,v 1.57 2018/09/12 01:34:02 djm Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. @@ -122,8 +121,7 @@ #define KEX_SERVER_ENCRYPT \ "chacha20-poly1305@openssh.com," \ "aes128-ctr,aes192-ctr,aes256-ctr" \ - AESGCM_CIPHER_MODES \ - ",aes128-cbc,aes192-cbc,aes256-cbc" + AESGCM_CIPHER_MODES #define KEX_CLIENT_ENCRYPT KEX_SERVER_ENCRYPT Modified: head/crypto/openssh/sshd_config.5 ============================================================================== --- head/crypto/openssh/sshd_config.5 Mon Jul 27 23:19:46 2020 (r363626) +++ head/crypto/openssh/sshd_config.5 Tue Jul 28 00:24:12 2020 (r363627) @@ -495,8 +495,7 @@ The default is: .Bd -literal -offset indent chacha20-poly1305@openssh.com, aes128-ctr,aes192-ctr,aes256-ctr, -aes128-gcm@openssh.com,aes256-gcm@openssh.com, -aes128-cbc,aes192-cbc,aes256-cbc +aes128-gcm@openssh.com,aes256-gcm@openssh.com .Ed .Pp The list of available ciphers may also be obtained using From owner-svn-src-head@freebsd.org Tue Jul 28 01:05:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 965D9374EF8; Tue, 28 Jul 2020 01:05:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFz4j3HW9z4ZJn; Tue, 28 Jul 2020 01:05:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54379269D2; Tue, 28 Jul 2020 01:05:41 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06S15fS9072591; Tue, 28 Jul 2020 01:05:41 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06S15ffo072590; Tue, 28 Jul 2020 01:05:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202007280105.06S15ffo072590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 28 Jul 2020 01:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363628 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 01:05:41 -0000 Author: kevans Date: Tue Jul 28 01:05:40 2020 New Revision: 363628 URL: https://svnweb.freebsd.org/changeset/base/363628 Log: makesyscalls.sh: improve the 'this is going away' message Reported by: Ronald Klop, rgrimes Modified: head/sys/kern/makesyscalls.sh Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Tue Jul 28 00:24:12 2020 (r363627) +++ head/sys/kern/makesyscalls.sh Tue Jul 28 01:05:40 2020 (r363628) @@ -60,7 +60,8 @@ case $# in ;; esac -1>&2 echo "$0: This script is deprecated and will be removed before FreeBSD 13." +1>&2 echo "$0: This script has been replaced by sys/tools/makesyscalls.lua and" +1>&2 echo "$0: will be removed before FreeBSD 13. See also: sys/conf/sysent.mk" if [ -n "$2" ]; then . "$2" From owner-svn-src-head@freebsd.org Tue Jul 28 01:08:51 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67D0B37543A; Tue, 28 Jul 2020 01:08:51 +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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BFz8M2Cwfz4Zgk; Tue, 28 Jul 2020 01:08:51 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 2AC2823D43; Tue, 28 Jul 2020 01:08:51 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f172.google.com with SMTP id h7so17218608qkk.7; Mon, 27 Jul 2020 18:08:51 -0700 (PDT) X-Gm-Message-State: AOAM531Oo2Z1hWsKzKY7aPZ5I3XpQ4zmilPNCH1g2QffPBT+VX8vC9/Q KeSM7rE0EWYXvVaggjsmIbDGpvPPFx2yA3YbDVg= X-Google-Smtp-Source: ABdhPJz59OZyHXGStIHBUOW7prYAHYVACyCtno4niPMGlNA8awkGDT6DK0jtCi82pGg4CgB5bqO+K7peZ0Q1ljBfUpY= X-Received: by 2002:a37:9147:: with SMTP id t68mr25181302qkd.34.1595898530627; Mon, 27 Jul 2020 18:08:50 -0700 (PDT) MIME-Version: 1.0 References: <2138073301.3.1595842409922@localhost> <202007271639.06RGdLkp070219@gndrsh.dnsmgr.net> In-Reply-To: <202007271639.06RGdLkp070219@gndrsh.dnsmgr.net> From: Kyle Evans Date: Mon, 27 Jul 2020 20:08:39 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r363595 - head/sys/kern To: "Rodney W. Grimes" Cc: Ronald Klop , svn-src-all , svn-src-head , src-committers Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 01:08:51 -0000 On Mon, Jul 27, 2020 at 11:39 AM Rodney W. Grimes wrote: > > > Hi, > > > > Helpful addition. Might it help people more to make the message point to the replacement of the deprecated functionality? > > > > Regards, > > Ronald. > > I tend to agree here, the functionality was not depricated, > it was replaced by a new implementation in another language. > Sure, that's why the wording was specifically that "this script is deprecated." Because it is, we no longer support generating syscall bits with it. I don't really care much about this at all because I'm not convinced any downstreams are doing anything special here (besides, of course, the one I already know about), and thus I think this will have very little or no impact. Either way, I've incorporated the two suggestions above into r363628. Feel free to tweak it however you want and just commit it... consider any adjustment okay by me unless said adjustment is the complete opposite of what we're doing. Thanks, Kyle Evans > > > > > > Van: Kyle Evans > > Datum: maandag, 27 juli 2020 05:13 > > Aan: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org > > Onderwerp: svn commit: r363595 - head/sys/kern > > > > > > Author: kevans > > > Date: Mon Jul 27 03:13:23 2020 > > > New Revision: 363595 > > > URL: https://svnweb.freebsd.org/changeset/base/363595 > > > > > > Log: > > > makesyscalls.sh: spit out a deprecation notice to stderr > > > > > > This has for a while been replaced by makesyscalls.lua in the stock FreeBSD > > > build. Ensure downstreams get some notice that it'a going away if they're > > > reliant on it, maybe. > > > > > > Modified: > > > head/sys/kern/makesyscalls.sh > > > > > > Modified: head/sys/kern/makesyscalls.sh > > > ============================================================================== > > > --- head/sys/kern/makesyscalls.sh Mon Jul 27 01:53:27 2020 (r363594) > > > +++ head/sys/kern/makesyscalls.sh Mon Jul 27 03:13:23 2020 (r363595) > > > @@ -60,6 +60,8 @@ case $# in > > > ;; > > > esac > > > > > > +1>&2 echo "$0: This script is deprecated and will be removed before FreeBSD 13." > > > + > > > if [ -n "$2" ]; then > > > . "$2" > > > fi > > > _______________________________________________ > > > svn-src-all@freebsd.org mailing list > > > https://lists.freebsd.org/mailman/listinfo/svn-src-all > > > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > > > > > > > > > > > -- > Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Jul 28 02:56:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53D2E378FD3; Tue, 28 Jul 2020 02:56:27 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BG1XW1WbKz3Sd1; Tue, 28 Jul 2020 02:56:27 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F1F0927F48; Tue, 28 Jul 2020 02:56:26 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06S2uQbb040240; Tue, 28 Jul 2020 02:56:26 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06S2uQ8e040238; Tue, 28 Jul 2020 02:56:26 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202007280256.06S2uQ8e040238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Tue, 28 Jul 2020 02:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363630 - in head: lib/libpmc sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in head: lib/libpmc sys/dev/hwpmc X-SVN-Commit-Revision: 363630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 02:56:27 -0000 Author: freqlabs Date: Tue Jul 28 02:56:26 2020 New Revision: 363630 URL: https://svnweb.freebsd.org/changeset/base/363630 Log: libpmc: Use known pmc_cpuid buffer size Use the existing PMC_CPUID_LEN to size pmc_cpuid in the kernel and various buffers for reading it in libpmc. This avoids some extra syscalls and malloc/frees. While in here, use strlcpy to copy a user-provided cpuid string instead of memcpy, to make sure we terminate the buffer. Reviewed by: mav MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D25679 Modified: head/lib/libpmc/libpmc_pmu_util.c head/sys/dev/hwpmc/hwpmc_mod.c Modified: head/lib/libpmc/libpmc_pmu_util.c ============================================================================== --- head/lib/libpmc/libpmc_pmu_util.c Tue Jul 28 02:53:44 2020 (r363629) +++ head/lib/libpmc/libpmc_pmu_util.c Tue Jul 28 02:56:26 2020 (r363630) @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -89,20 +90,13 @@ static struct pmu_alias pmu_amd_alias_table[] = { static pmu_mfr_t pmu_events_mfr(void) { - char *buf; - size_t s; + char buf[PMC_CPUID_LEN]; + size_t s = sizeof(buf); pmu_mfr_t mfr; - if (sysctlbyname("kern.hwpmc.cpuid", (void *)NULL, &s, + if (sysctlbyname("kern.hwpmc.cpuid", buf, &s, (void *)NULL, 0) == -1) return (PMU_INVALID); - if ((buf = malloc(s + 1)) == NULL) - return (PMU_INVALID); - if (sysctlbyname("kern.hwpmc.cpuid", buf, &s, - (void *)NULL, 0) == -1) { - free(buf); - return (PMU_INVALID); - } if (strcasestr(buf, "AuthenticAMD") != NULL || strcasestr(buf, "HygonGenuine") != NULL) mfr = PMU_AMD; @@ -110,7 +104,6 @@ pmu_events_mfr(void) mfr = PMU_INTEL; else mfr = PMU_INVALID; - free(buf); return (mfr); } @@ -169,17 +162,14 @@ pmu_events_map_get(const char *cpuid) { regex_t re; regmatch_t pmatch[1]; - size_t s; - char buf[64]; + char buf[PMC_CPUID_LEN]; + size_t s = sizeof(buf); int match; const struct pmu_events_map *pme; if (cpuid != NULL) { - memcpy(buf, cpuid, 64); + strlcpy(buf, cpuid, s); } else { - if (sysctlbyname("kern.hwpmc.cpuid", (void *)NULL, &s, - (void *)NULL, 0) == -1) - return (NULL); if (sysctlbyname("kern.hwpmc.cpuid", buf, &s, (void *)NULL, 0) == -1) return (NULL); Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Tue Jul 28 02:53:44 2020 (r363629) +++ head/sys/dev/hwpmc/hwpmc_mod.c Tue Jul 28 02:56:26 2020 (r363630) @@ -305,7 +305,7 @@ static int pmc_callchaindepth = PMC_CALLCHAIN_DEPTH; SYSCTL_INT(_kern_hwpmc, OID_AUTO, callchaindepth, CTLFLAG_RDTUN, &pmc_callchaindepth, 0, "depth of call chain records"); -char pmc_cpuid[64]; +char pmc_cpuid[PMC_CPUID_LEN]; SYSCTL_STRING(_kern_hwpmc, OID_AUTO, cpuid, CTLFLAG_RD, pmc_cpuid, 0, "cpu version string"); #ifdef HWPMC_DEBUG From owner-svn-src-head@freebsd.org Tue Jul 28 09:29:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20E1E3A3896; Tue, 28 Jul 2020 09:29:58 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGBGY75BGz47YJ; Tue, 28 Jul 2020 09:29:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7019C7EA; Tue, 28 Jul 2020 09:29:57 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06S9TvP2080429; Tue, 28 Jul 2020 09:29:57 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06S9Tu2X080424; Tue, 28 Jul 2020 09:29:56 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202007280929.06S9Tu2X080424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 28 Jul 2020 09:29:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363636 - in head/sys: conf dev/smc X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: conf dev/smc X-SVN-Commit-Revision: 363636 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 09:29:58 -0000 Author: andrew Date: Tue Jul 28 09:29:56 2020 New Revision: 363636 URL: https://svnweb.freebsd.org/changeset/base/363636 Log: Add an ACPI attachment for if_smc This is needed by some of the Arm simulators as they implement a smc based network interface, but use ACPI rather than FDT. Sponsored by: Innovate UK Added: head/sys/dev/smc/if_smc_acpi.c - copied, changed from r363635, head/sys/dev/smc/if_smc_fdt.c Modified: head/sys/conf/files head/sys/dev/smc/if_smc.c head/sys/dev/smc/if_smc_fdt.c head/sys/dev/smc/if_smcvar.h Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Jul 28 07:07:38 2020 (r363635) +++ head/sys/conf/files Tue Jul 28 09:29:56 2020 (r363636) @@ -3029,6 +3029,7 @@ dev/smbus/smbconf.c optional smbus dev/smbus/smbus.c optional smbus dev/smbus/smbus_if.m optional smbus dev/smc/if_smc.c optional smc +dev/smc/if_smc_acpi.c optional smc acpi dev/smc/if_smc_fdt.c optional smc fdt dev/snp/snp.c optional snp dev/sound/clone.c optional sound Modified: head/sys/dev/smc/if_smc.c ============================================================================== --- head/sys/dev/smc/if_smc.c Tue Jul 28 07:07:38 2020 (r363635) +++ head/sys/dev/smc/if_smc.c Tue Jul 28 09:29:56 2020 (r363636) @@ -80,6 +80,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "miibus_if.h" + #define SMC_LOCK(sc) mtx_lock(&(sc)->smc_mtx) #define SMC_UNLOCK(sc) mtx_unlock(&(sc)->smc_mtx) #define SMC_ASSERT_LOCKED(sc) mtx_assert(&(sc)->smc_mtx, MA_OWNED) @@ -479,6 +481,27 @@ smc_detach(device_t dev) return (0); } + +static device_method_t smc_methods[] = { + /* Device interface */ + DEVMETHOD(device_attach, smc_attach), + DEVMETHOD(device_detach, smc_detach), + + /* MII interface */ + DEVMETHOD(miibus_readreg, smc_miibus_readreg), + DEVMETHOD(miibus_writereg, smc_miibus_writereg), + DEVMETHOD(miibus_statchg, smc_miibus_statchg), + + { 0, 0 } +}; + +driver_t smc_driver = { + "smc", + smc_methods, + sizeof(struct smc_softc), +}; + +DRIVER_MODULE(miibus, smc, miibus_driver, miibus_devclass, 0, 0); static void smc_start(struct ifnet *ifp) Copied and modified: head/sys/dev/smc/if_smc_acpi.c (from r363635, head/sys/dev/smc/if_smc_fdt.c) ============================================================================== --- head/sys/dev/smc/if_smc_fdt.c Tue Jul 28 07:07:38 2020 (r363635, copy source) +++ head/sys/dev/smc/if_smc_acpi.c Tue Jul 28 09:29:56 2020 (r363636) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2008 Benno Rice * All rights reserved. + * Copyright (c) 2020 Andrew Turner * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -35,92 +36,45 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include - -#include #include -#include -#include #include -#include -#include +#include +#include -#include -#include -#include -#include +static int smc_acpi_probe(device_t); -#include "miibus_if.h" - -static int smc_fdt_probe(device_t); -static int smc_fdt_attach(device_t); -static int smc_fdt_detach(device_t); - static int -smc_fdt_probe(device_t dev) +smc_acpi_probe(device_t dev) { struct smc_softc *sc; + ACPI_HANDLE h; - if (!ofw_bus_status_okay(dev)) + if ((h = acpi_get_handle(dev)) == NULL) return (ENXIO); - if (ofw_bus_is_compatible(dev, "smsc,lan91c111")) { - sc = device_get_softc(dev); - sc->smc_usemem = 1; + if (!acpi_MatchHid(h, "LNRO0003")) + return (ENXIO); - if (smc_probe(dev) != 0) { - return (ENXIO); - } + sc = device_get_softc(dev); + sc->smc_usemem = 1; - return (0); - } - - return (ENXIO); + return (smc_probe(dev)); } -static int -smc_fdt_attach(device_t dev) -{ - - return smc_attach(dev); -} - -static int -smc_fdt_detach(device_t dev) -{ - - smc_detach(dev); - - return (0); -} - -static device_method_t smc_fdt_methods[] = { +static device_method_t smc_acpi_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, smc_fdt_probe), - DEVMETHOD(device_attach, smc_fdt_attach), - DEVMETHOD(device_detach, smc_fdt_detach), - - /* MII interface */ - DEVMETHOD(miibus_readreg, smc_miibus_readreg), - DEVMETHOD(miibus_writereg, smc_miibus_writereg), - DEVMETHOD(miibus_statchg, smc_miibus_statchg), - + DEVMETHOD(device_probe, smc_acpi_probe), { 0, 0 } }; -static driver_t smc_fdt_driver = { - "smc", - smc_fdt_methods, - sizeof(struct smc_softc), -}; +DEFINE_CLASS_1(smc, smc_acpi_driver, smc_acpi_methods, + sizeof(struct smc_softc), smc_driver); extern devclass_t smc_devclass; -DRIVER_MODULE(smc, simplebus, smc_fdt_driver, smc_devclass, 0, 0); -DRIVER_MODULE(miibus, smc, miibus_driver, miibus_devclass, 0, 0); -MODULE_DEPEND(smc, fdt, 1, 1, 1); +DRIVER_MODULE(smc, acpi, smc_acpi_driver, smc_devclass, 0, 0); +MODULE_DEPEND(smc, acpi, 1, 1, 1); MODULE_DEPEND(smc, ether, 1, 1, 1); MODULE_DEPEND(smc, miibus, 1, 1, 1); Modified: head/sys/dev/smc/if_smc_fdt.c ============================================================================== --- head/sys/dev/smc/if_smc_fdt.c Tue Jul 28 07:07:38 2020 (r363635) +++ head/sys/dev/smc/if_smc_fdt.c Tue Jul 28 09:29:56 2020 (r363636) @@ -35,29 +35,16 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include - -#include #include -#include -#include #include -#include -#include - #include #include #include #include -#include "miibus_if.h" - static int smc_fdt_probe(device_t); -static int smc_fdt_attach(device_t); -static int smc_fdt_detach(device_t); static int smc_fdt_probe(device_t dev) @@ -81,46 +68,18 @@ smc_fdt_probe(device_t dev) return (ENXIO); } -static int -smc_fdt_attach(device_t dev) -{ - - return smc_attach(dev); -} - -static int -smc_fdt_detach(device_t dev) -{ - - smc_detach(dev); - - return (0); -} - static device_method_t smc_fdt_methods[] = { /* Device interface */ DEVMETHOD(device_probe, smc_fdt_probe), - DEVMETHOD(device_attach, smc_fdt_attach), - DEVMETHOD(device_detach, smc_fdt_detach), - - /* MII interface */ - DEVMETHOD(miibus_readreg, smc_miibus_readreg), - DEVMETHOD(miibus_writereg, smc_miibus_writereg), - DEVMETHOD(miibus_statchg, smc_miibus_statchg), - { 0, 0 } }; -static driver_t smc_fdt_driver = { - "smc", - smc_fdt_methods, - sizeof(struct smc_softc), -}; +DEFINE_CLASS_1(smc, smc_fdt_driver, smc_fdt_methods, + sizeof(struct smc_softc), smc_driver); extern devclass_t smc_devclass; DRIVER_MODULE(smc, simplebus, smc_fdt_driver, smc_devclass, 0, 0); -DRIVER_MODULE(miibus, smc, miibus_driver, miibus_devclass, 0, 0); MODULE_DEPEND(smc, fdt, 1, 1, 1); MODULE_DEPEND(smc, ether, 1, 1, 1); MODULE_DEPEND(smc, miibus, 1, 1, 1); Modified: head/sys/dev/smc/if_smcvar.h ============================================================================== --- head/sys/dev/smc/if_smcvar.h Tue Jul 28 07:07:38 2020 (r363635) +++ head/sys/dev/smc/if_smcvar.h Tue Jul 28 09:29:56 2020 (r363636) @@ -68,6 +68,8 @@ struct smc_softc { void *smc_read_arg; }; +DECLARE_CLASS(smc_driver); + int smc_probe(device_t); int smc_attach(device_t); int smc_detach(device_t); From owner-svn-src-head@freebsd.org Tue Jul 28 09:46:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2593A3A3CFD; Tue, 28 Jul 2020 09:46:59 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGBfB73Qqz48nd; Tue, 28 Jul 2020 09:46:58 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5526CCFD; Tue, 28 Jul 2020 09:46:58 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06S9kwsE092806; Tue, 28 Jul 2020 09:46:58 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06S9kwir092805; Tue, 28 Jul 2020 09:46:58 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202007280946.06S9kwir092805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 28 Jul 2020 09:46:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363637 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 363637 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 09:46:59 -0000 Author: andrew Date: Tue Jul 28 09:46:58 2020 New Revision: 363637 URL: https://svnweb.freebsd.org/changeset/base/363637 Log: Enable use of the regulator in the Broadcom SDHCI controller This will be needed before a future GPIO controller driver is added as the later enables regulators that leave the SDHCI controller disabled. Reviewed by: manu Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D25834 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Tue Jul 28 09:29:56 2020 (r363636) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Tue Jul 28 09:46:58 2020 (r363637) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include @@ -155,6 +156,7 @@ struct bcm_sdhci_softc { void * sc_intrhand; struct mmc_request * sc_req; struct sdhci_slot sc_slot; + struct mmc_fdt_helper sc_mmc_helper; int sc_dma_ch; bus_dma_tag_t sc_dma_tag; bus_dmamap_t sc_dma_map; @@ -315,6 +317,7 @@ bcm_sdhci_attach(device_t dev) sc->sc_slot.quirks = sc->conf->quirks; sdhci_init_slot(dev, &sc->sc_slot, 0); + mmc_fdt_parse(dev, 0, &sc->sc_mmc_helper, &sc->sc_slot.host); sc->sc_dma_ch = bcm_dma_allocate(BCM_DMA_CH_ANY); if (sc->sc_dma_ch == BCM_DMA_CH_INVALID) @@ -389,6 +392,37 @@ bcm_sdhci_intr(void *arg) } static int +bcm_sdhci_update_ios(device_t bus, device_t child) +{ + struct bcm_sdhci_softc *sc; + struct mmc_ios *ios; + int rv; + + sc = device_get_softc(bus); + ios = &sc->sc_slot.host.ios; + + if (ios->power_mode == power_up) { + if (sc->sc_mmc_helper.vmmc_supply) + regulator_enable(sc->sc_mmc_helper.vmmc_supply); + if (sc->sc_mmc_helper.vqmmc_supply) + regulator_enable(sc->sc_mmc_helper.vqmmc_supply); + } + + rv = sdhci_generic_update_ios(bus, child); + if (rv != 0) + return (rv); + + if (ios->power_mode == power_off) { + if (sc->sc_mmc_helper.vmmc_supply) + regulator_disable(sc->sc_mmc_helper.vmmc_supply); + if (sc->sc_mmc_helper.vqmmc_supply) + regulator_disable(sc->sc_mmc_helper.vqmmc_supply); + } + + return (0); +} + +static int bcm_sdhci_get_ro(device_t bus, device_t child) { @@ -787,7 +821,7 @@ static device_method_t bcm_sdhci_methods[] = { DEVMETHOD(bus_add_child, bus_generic_add_child), /* MMC bridge interface */ - DEVMETHOD(mmcbr_update_ios, sdhci_generic_update_ios), + DEVMETHOD(mmcbr_update_ios, bcm_sdhci_update_ios), DEVMETHOD(mmcbr_request, sdhci_generic_request), DEVMETHOD(mmcbr_get_ro, bcm_sdhci_get_ro), DEVMETHOD(mmcbr_acquire_host, sdhci_generic_acquire_host), From owner-svn-src-head@freebsd.org Tue Jul 28 09:51:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7CA473A423B; Tue, 28 Jul 2020 09:51:31 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.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 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGBlQ0zg9z49Sh; Tue, 28 Jul 2020 09:51:29 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: by mail-ej1-f44.google.com with SMTP id gg18so16626118ejb.6; Tue, 28 Jul 2020 02:51:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=LN05giEESP4h76x7zUiRaHCPeyKlCHO1PrljaGpOkoQ=; b=I+yYOiXfnD9sEvOwthSRjTaZvo7d8s20lCDTD5pQU2f6hpxyHvggc9NyXKJtCKLL/9 oYKb3lu8buUwavzegHsZSvt5mKHDuSWx/+0pI0cqWpuZttEC+gKb+ODiSJqZBYMH2C69 KAMHxytXoWvzjsofUKmCHDCijY/zhsc2pMK3AE1TWEHafPsgII6Q9Zkj30hCezC8Ylz5 2jB9swGJVT2p+i+RTn7UMGzILjVo+Yp3n0BdlI/yO2GawwlsBt+N/ckMVSOZzYo4x7o3 hTXzxQw+b5rpMxoegUkDAcdRNLf35Mrt/KQ5ZadLIBVNLN8B8FpDj2GiAoDEMxKAXO2m QYNw== X-Gm-Message-State: AOAM532ZY99/g4283OsFrL/+zXN+88bZYs/FlxQ5eRinsI+z4qsdnilI JXR9/sp819U+D6rrGSFXtUKGNRK0FKY= X-Google-Smtp-Source: ABdhPJy+jgpiDBenPrnqhJX70gjMf7mkFU9Ngw4ACwmnk0FBMi2tuE0S1ghu4HFyumjKQq+4wHf/Ng== X-Received: by 2002:a17:906:960a:: with SMTP id s10mr14642138ejx.60.1595929888215; Tue, 28 Jul 2020 02:51:28 -0700 (PDT) Received: from ?IPv6:2a02:8109:98c0:1bc0:5e5f:67ff:fef4:ffd8? ([2a02:8109:98c0:1bc0:5e5f:67ff:fef4:ffd8]) by smtp.gmail.com with ESMTPSA id ck6sm9438217edb.18.2020.07.28.02.51.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Jul 2020 02:51:27 -0700 (PDT) Subject: Re: svn commit: r363598 - head/usr.sbin/nologin To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, yuripv@freebsd.org References: <202007271717.06RHHc0j070402@gndrsh.dnsmgr.net> From: Mateusz Piotrowski <0mp@FreeBSD.org> Message-ID: <65062b6a-9a8e-e4fc-9355-99f26e7ef341@FreeBSD.org> Date: Tue, 28 Jul 2020 11:51:35 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <202007271717.06RHHc0j070402@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 4BGBlQ0zg9z49Sh X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of mpp302@gmail.com designates 209.85.218.44 as permitted sender) smtp.mailfrom=mpp302@gmail.com X-Spamd-Result: default: False [-0.98 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[FreeBSD.org]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-0.72)[-0.720]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.25)[-0.250]; NEURAL_HAM_SHORT(-0.01)[-0.009]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.218.44:from]; FORGED_SENDER(0.30)[0mp@FreeBSD.org,mpp302@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.218.44:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[0mp@FreeBSD.org,mpp302@gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 09:51:31 -0000 Hi, On 7/27/20 7:17 PM, Rodney W. Grimes wrote: > On 7/27/20 6:41 PM, Rodney W. Grimes wrote: >>>> Author: 0mp (doc,ports committer) >>>> Date: Mon Jul 27 10:45:47 2020 >>>> New Revision: 363598 >>>> URL: https://svnweb.freebsd.org/changeset/base/363598 >>>> >>>> Log: >>>> nologin.8: Improve wording >>> I disagree that this improves wording. The norm of action for >>> "logging" in Unix is to "write to syslog", not "log to syslog". >> Hmm, I agree, but here it is "log using syslog". > Please read syslog(3) it is rather consistent about using > "write to syslog". The action of calling syslog(3) is to > "writes message to the system message logger." Obviously, we write to syslog but from what I remember the reason why we decided to change the wording to "log using syscall" was that you don't write to the syslog(3) function, but you use it instead. > >> Have you got any idea how to further improve this sentence? > No, but can we not degrade it? Sure. Would you like me to just revert it? Cheers, Mateusz From owner-svn-src-head@freebsd.org Tue Jul 28 10:08:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A596D3A4F5F; Tue, 28 Jul 2020 10:08:08 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGC6c3rycz4BpP; Tue, 28 Jul 2020 10:08:08 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 67B0BD254; Tue, 28 Jul 2020 10:08:08 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06SA889a005043; Tue, 28 Jul 2020 10:08:08 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06SA8861005042; Tue, 28 Jul 2020 10:08:08 GMT (envelope-from mw@FreeBSD.org) Message-Id: <202007281008.06SA8861005042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 28 Jul 2020 10:08:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363638 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 363638 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 10:08:08 -0000 Author: mw Date: Tue Jul 28 10:08:07 2020 New Revision: 363638 URL: https://svnweb.freebsd.org/changeset/base/363638 Log: Fix ENA build when integrated into kernel Provide missing rules for ena_datapath.c and ena_netmap.c, which prevented the ENA driver from building. This issue was showing up only when building the driver statically into the kernel. PR: 248116 Submitted by: Artur Rojek MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25796 Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Jul 28 09:46:58 2020 (r363637) +++ head/sys/conf/files Tue Jul 28 10:08:07 2020 (r363638) @@ -1641,6 +1641,10 @@ dev/e1000/e1000_osdep.c optional em \ dev/et/if_et.c optional et dev/ena/ena.c optional ena \ compile-with "${NORMAL_C} -I$S/contrib" +dev/ena/ena_datapath.c optional ena \ + compile-with "${NORMAL_C} -I$S/contrib" +dev/ena/ena_netmap.c optional ena \ + compile-with "${NORMAL_C} -I$S/contrib" dev/ena/ena_sysctl.c optional ena \ compile-with "${NORMAL_C} -I$S/contrib" contrib/ena-com/ena_com.c optional ena From owner-svn-src-head@freebsd.org Tue Jul 28 10:37:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9AF53A5A8D; Tue, 28 Jul 2020 10:37:58 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGCn2401jz4DSd; Tue, 28 Jul 2020 10:37:58 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BD9DDC17; Tue, 28 Jul 2020 10:37:58 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06SAbwLe023269; Tue, 28 Jul 2020 10:37:58 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06SAbwQA023268; Tue, 28 Jul 2020 10:37:58 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202007281037.06SAbwQA023268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 28 Jul 2020 10:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363639 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 363639 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 10:37:58 -0000 Author: andrew Date: Tue Jul 28 10:37:58 2020 New Revision: 363639 URL: https://svnweb.freebsd.org/changeset/base/363639 Log: Have the bcm2835 firmware driver depend on the mailbox driver The firmware driver uses the mailbox driver to communicate with the firmware. Make this a more formal dependency. Reviewed by: manu Sponsored by: Innovate UK Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c Tue Jul 28 10:08:07 2020 (r363638) +++ head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c Tue Jul 28 10:37:58 2020 (r363639) @@ -177,5 +177,6 @@ static driver_t bcm2835_firmware_driver = { sizeof(struct bcm2835_firmware_softc), }; -DRIVER_MODULE(bcm2835_firmware, simplebus, bcm2835_firmware_driver, - bcm2835_firmware_devclass, 0, 0); +EARLY_DRIVER_MODULE(bcm2835_firmware, simplebus, bcm2835_firmware_driver, + bcm2835_firmware_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); +MODULE_DEPEND(bcm2835_firmware, mbox, 1, 1, 1); From owner-svn-src-head@freebsd.org Tue Jul 28 10:40:01 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44FBF3A5666; Tue, 28 Jul 2020 10:40:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGCqP13YLz4DXS; Tue, 28 Jul 2020 10:40:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07831D8C7; Tue, 28 Jul 2020 10:40:01 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06SAe0Qk023440; Tue, 28 Jul 2020 10:40:00 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06SAe0i4023439; Tue, 28 Jul 2020 10:40:00 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202007281040.06SAe0i4023439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 28 Jul 2020 10:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363640 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 363640 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 10:40:01 -0000 Author: andrew Date: Tue Jul 28 10:40:00 2020 New Revision: 363640 URL: https://svnweb.freebsd.org/changeset/base/363640 Log: Move the bcm2835 mailbox driver earlier in the boot This will be needed before the firmware driver is loaded Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Tue Jul 28 10:37:58 2020 (r363639) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Tue Jul 28 10:40:00 2020 (r363640) @@ -293,7 +293,8 @@ static driver_t bcm_mbox_driver = { static devclass_t bcm_mbox_devclass; -DRIVER_MODULE(mbox, simplebus, bcm_mbox_driver, bcm_mbox_devclass, 0, 0); +EARLY_DRIVER_MODULE(mbox, simplebus, bcm_mbox_driver, bcm_mbox_devclass, 0, 0, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); static void bcm2835_mbox_dma_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err) From owner-svn-src-head@freebsd.org Tue Jul 28 10:41:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A9EC3A5C9B; Tue, 28 Jul 2020 10:41:44 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGCsN2F73z4DkR; Tue, 28 Jul 2020 10:41:44 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30423D939; Tue, 28 Jul 2020 10:41:44 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06SAfhfg026552; Tue, 28 Jul 2020 10:41:43 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06SAfhRW026551; Tue, 28 Jul 2020 10:41:43 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202007281041.06SAfhRW026551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 28 Jul 2020 10:41:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363641 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 363641 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 10:41:44 -0000 Author: andrew Date: Tue Jul 28 10:41:43 2020 New Revision: 363641 URL: https://svnweb.freebsd.org/changeset/base/363641 Log: Revert r363639 so I can use a more correct commit message Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c Tue Jul 28 10:40:00 2020 (r363640) +++ head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c Tue Jul 28 10:41:43 2020 (r363641) @@ -177,6 +177,5 @@ static driver_t bcm2835_firmware_driver = { sizeof(struct bcm2835_firmware_softc), }; -EARLY_DRIVER_MODULE(bcm2835_firmware, simplebus, bcm2835_firmware_driver, - bcm2835_firmware_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); -MODULE_DEPEND(bcm2835_firmware, mbox, 1, 1, 1); +DRIVER_MODULE(bcm2835_firmware, simplebus, bcm2835_firmware_driver, + bcm2835_firmware_devclass, 0, 0); From owner-svn-src-head@freebsd.org Tue Jul 28 10:43:53 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 183BA3A5A6A; Tue, 28 Jul 2020 10:43:53 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGCvr6y6nz4Dnt; Tue, 28 Jul 2020 10:43:52 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2115DC45; Tue, 28 Jul 2020 10:43:52 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06SAhqFk029196; Tue, 28 Jul 2020 10:43:52 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06SAhqnf029195; Tue, 28 Jul 2020 10:43:52 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202007281043.06SAhqnf029195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 28 Jul 2020 10:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363642 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 363642 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 10:43:53 -0000 Author: andrew Date: Tue Jul 28 10:43:52 2020 New Revision: 363642 URL: https://svnweb.freebsd.org/changeset/base/363642 Log: Move the bcm2835 firmware driver earlier in the boot. It will be needed by other eaarly drivers. While here make the dependency of the mailbox formal with MODULE_DEPEND. Reviewed by: manu Sponsored by: Innovate UK Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c Tue Jul 28 10:41:43 2020 (r363641) +++ head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c Tue Jul 28 10:43:52 2020 (r363642) @@ -177,5 +177,6 @@ static driver_t bcm2835_firmware_driver = { sizeof(struct bcm2835_firmware_softc), }; -DRIVER_MODULE(bcm2835_firmware, simplebus, bcm2835_firmware_driver, - bcm2835_firmware_devclass, 0, 0); +EARLY_DRIVER_MODULE(bcm2835_firmware, simplebus, bcm2835_firmware_driver, + bcm2835_firmware_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); +MODULE_DEPEND(bcm2835_firmware, mbox, 1, 1, 1); From owner-svn-src-head@freebsd.org Tue Jul 28 10:45:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 659623A5B73; Tue, 28 Jul 2020 10:45:30 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGCxk2STJz4Dtg; Tue, 28 Jul 2020 10:45:30 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38A26DBCC; Tue, 28 Jul 2020 10:45:30 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06SAjU1u029354; Tue, 28 Jul 2020 10:45:30 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06SAjThn029351; Tue, 28 Jul 2020 10:45:29 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202007281045.06SAjThn029351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 28 Jul 2020 10:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363643 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 363643 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 10:45:30 -0000 Author: andrew Date: Tue Jul 28 10:45:29 2020 New Revision: 363643 URL: https://svnweb.freebsd.org/changeset/base/363643 Log: Switch the bcm2835 cpufreq driver to use the firmware interface Use the new Raspberry Pi firmware driver in the cpufreq driver. It is intended all drivers that need to interact with the firmware will move to use the firmware driver, this is the first. Reviewed by: manu Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D25609 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c head/sys/arm/broadcom/bcm2835/bcm2835_firmware.h head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Modified: head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Tue Jul 28 10:43:52 2020 (r363642) +++ head/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c Tue Jul 28 10:45:29 2020 (r363643) @@ -47,12 +47,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include #include #include "cpufreq_if.h" -#include "mbox_if.h" #ifdef DEBUG #define DPRINTF(fmt, ...) do { \ @@ -101,6 +99,7 @@ static struct sysctl_ctx_list bcm2835_sysctl_ctx; struct bcm2835_cpufreq_softc { device_t dev; + device_t firmware; int arm_max_freq; int arm_min_freq; int core_max_freq; @@ -161,7 +160,7 @@ static int bcm2835_cpufreq_get_clock_rate(struct bcm2835_cpufreq_softc *sc, uint32_t clock_id) { - struct msg_get_clock_rate msg; + union msg_get_clock_rate_body msg; int rate; int err; @@ -181,16 +180,11 @@ bcm2835_cpufreq_get_clock_rate(struct bcm2835_cpufreq_ /* setup single tag buffer */ memset(&msg, 0, sizeof(msg)); - msg.hdr.buf_size = sizeof(msg); - msg.hdr.code = BCM2835_MBOX_CODE_REQ; - msg.tag_hdr.tag = BCM2835_MBOX_TAG_GET_CLOCK_RATE; - msg.tag_hdr.val_buf_size = sizeof(msg.body); - msg.tag_hdr.val_len = sizeof(msg.body.req); - msg.body.req.clock_id = clock_id; - msg.end_tag = 0; + msg.req.clock_id = clock_id; /* call mailbox property */ - err = bcm2835_mbox_property(&msg, sizeof(msg)); + err = bcm2835_firmware_property(sc->firmware, + BCM2835_FIRMWARE_TAG_GET_CLOCK_RATE, &msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't get clock rate (id=%u)\n", clock_id); @@ -198,7 +192,7 @@ bcm2835_cpufreq_get_clock_rate(struct bcm2835_cpufreq_ } /* result (Hz) */ - rate = (int)msg.body.resp.rate_hz; + rate = (int)msg.resp.rate_hz; DPRINTF("clock = %d(Hz)\n", rate); return (rate); } @@ -207,7 +201,7 @@ static int bcm2835_cpufreq_get_max_clock_rate(struct bcm2835_cpufreq_softc *sc, uint32_t clock_id) { - struct msg_get_max_clock_rate msg; + union msg_get_clock_rate_body msg; int rate; int err; @@ -227,16 +221,11 @@ bcm2835_cpufreq_get_max_clock_rate(struct bcm2835_cpuf /* setup single tag buffer */ memset(&msg, 0, sizeof(msg)); - msg.hdr.buf_size = sizeof(msg); - msg.hdr.code = BCM2835_MBOX_CODE_REQ; - msg.tag_hdr.tag = BCM2835_MBOX_TAG_GET_MAX_CLOCK_RATE; - msg.tag_hdr.val_buf_size = sizeof(msg.body); - msg.tag_hdr.val_len = sizeof(msg.body.req); - msg.body.req.clock_id = clock_id; - msg.end_tag = 0; + msg.req.clock_id = clock_id; /* call mailbox property */ - err = bcm2835_mbox_property(&msg, sizeof(msg)); + err = bcm2835_firmware_property(sc->firmware, + BCM2835_FIRMWARE_TAG_GET_MAX_CLOCK_RATE, &msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't get max clock rate (id=%u)\n", clock_id); @@ -244,7 +233,7 @@ bcm2835_cpufreq_get_max_clock_rate(struct bcm2835_cpuf } /* result (Hz) */ - rate = (int)msg.body.resp.rate_hz; + rate = (int)msg.resp.rate_hz; DPRINTF("clock = %d(Hz)\n", rate); return (rate); } @@ -253,7 +242,7 @@ static int bcm2835_cpufreq_get_min_clock_rate(struct bcm2835_cpufreq_softc *sc, uint32_t clock_id) { - struct msg_get_min_clock_rate msg; + union msg_get_clock_rate_body msg; int rate; int err; @@ -273,16 +262,11 @@ bcm2835_cpufreq_get_min_clock_rate(struct bcm2835_cpuf /* setup single tag buffer */ memset(&msg, 0, sizeof(msg)); - msg.hdr.buf_size = sizeof(msg); - msg.hdr.code = BCM2835_MBOX_CODE_REQ; - msg.tag_hdr.tag = BCM2835_MBOX_TAG_GET_MIN_CLOCK_RATE; - msg.tag_hdr.val_buf_size = sizeof(msg.body); - msg.tag_hdr.val_len = sizeof(msg.body.req); - msg.body.req.clock_id = clock_id; - msg.end_tag = 0; + msg.req.clock_id = clock_id; /* call mailbox property */ - err = bcm2835_mbox_property(&msg, sizeof(msg)); + err = bcm2835_firmware_property(sc->firmware, + BCM2835_FIRMWARE_TAG_GET_MIN_CLOCK_RATE, &msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't get min clock rate (id=%u)\n", clock_id); @@ -290,7 +274,7 @@ bcm2835_cpufreq_get_min_clock_rate(struct bcm2835_cpuf } /* result (Hz) */ - rate = (int)msg.body.resp.rate_hz; + rate = (int)msg.resp.rate_hz; DPRINTF("clock = %d(Hz)\n", rate); return (rate); } @@ -299,7 +283,7 @@ static int bcm2835_cpufreq_set_clock_rate(struct bcm2835_cpufreq_softc *sc, uint32_t clock_id, uint32_t rate_hz) { - struct msg_set_clock_rate msg; + union msg_set_clock_rate_body msg; int rate; int err; @@ -320,17 +304,12 @@ bcm2835_cpufreq_set_clock_rate(struct bcm2835_cpufreq_ /* setup single tag buffer */ memset(&msg, 0, sizeof(msg)); - msg.hdr.buf_size = sizeof(msg); - msg.hdr.code = BCM2835_MBOX_CODE_REQ; - msg.tag_hdr.tag = BCM2835_MBOX_TAG_SET_CLOCK_RATE; - msg.tag_hdr.val_buf_size = sizeof(msg.body); - msg.tag_hdr.val_len = sizeof(msg.body.req); - msg.body.req.clock_id = clock_id; - msg.body.req.rate_hz = rate_hz; - msg.end_tag = 0; + msg.req.clock_id = clock_id; + msg.req.rate_hz = rate_hz; /* call mailbox property */ - err = bcm2835_mbox_property(&msg, sizeof(msg)); + err = bcm2835_firmware_property(sc->firmware, + BCM2835_FIRMWARE_TAG_SET_CLOCK_RATE, &msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't set clock rate (id=%u)\n", clock_id); @@ -338,7 +317,7 @@ bcm2835_cpufreq_set_clock_rate(struct bcm2835_cpufreq_ } /* workaround for core clock */ - if (clock_id == BCM2835_MBOX_CLOCK_ID_CORE) { + if (clock_id == BCM2835_FIRMWARE_CLOCK_ID_CORE) { /* for safety (may change voltage without changing clock) */ DELAY(TRANSITION_LATENCY); @@ -349,17 +328,12 @@ bcm2835_cpufreq_set_clock_rate(struct bcm2835_cpufreq_ /* setup single tag buffer */ memset(&msg, 0, sizeof(msg)); - msg.hdr.buf_size = sizeof(msg); - msg.hdr.code = BCM2835_MBOX_CODE_REQ; - msg.tag_hdr.tag = BCM2835_MBOX_TAG_SET_CLOCK_RATE; - msg.tag_hdr.val_buf_size = sizeof(msg.body); - msg.tag_hdr.val_len = sizeof(msg.body.req); - msg.body.req.clock_id = clock_id; - msg.body.req.rate_hz = rate_hz; - msg.end_tag = 0; + msg.req.clock_id = clock_id; + msg.req.rate_hz = rate_hz; /* call mailbox property */ - err = bcm2835_mbox_property(&msg, sizeof(msg)); + err = bcm2835_firmware_property(sc->firmware, + BCM2835_FIRMWARE_TAG_SET_CLOCK_RATE, &msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't set clock rate (id=%u)\n", clock_id); @@ -368,7 +342,7 @@ bcm2835_cpufreq_set_clock_rate(struct bcm2835_cpufreq_ } /* result (Hz) */ - rate = (int)msg.body.resp.rate_hz; + rate = (int)msg.resp.rate_hz; DPRINTF("clock = %d(Hz)\n", rate); return (rate); } @@ -376,7 +350,7 @@ bcm2835_cpufreq_set_clock_rate(struct bcm2835_cpufreq_ static int bcm2835_cpufreq_get_turbo(struct bcm2835_cpufreq_softc *sc) { - struct msg_get_turbo msg; + union msg_get_turbo_body msg; int level; int err; @@ -396,23 +370,18 @@ bcm2835_cpufreq_get_turbo(struct bcm2835_cpufreq_softc /* setup single tag buffer */ memset(&msg, 0, sizeof(msg)); - msg.hdr.buf_size = sizeof(msg); - msg.hdr.code = BCM2835_MBOX_CODE_REQ; - msg.tag_hdr.tag = BCM2835_MBOX_TAG_GET_TURBO; - msg.tag_hdr.val_buf_size = sizeof(msg.body); - msg.tag_hdr.val_len = sizeof(msg.body.req); - msg.body.req.id = 0; - msg.end_tag = 0; + msg.req.id = 0; /* call mailbox property */ - err = bcm2835_mbox_property(&msg, sizeof(msg)); + err = bcm2835_firmware_property(sc->firmware, + BCM2835_FIRMWARE_TAG_GET_TURBO, &msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't get turbo\n"); return (MSG_ERROR); } /* result 0=non-turbo, 1=turbo */ - level = (int)msg.body.resp.level; + level = (int)msg.resp.level; DPRINTF("level = %d\n", level); return (level); } @@ -420,7 +389,7 @@ bcm2835_cpufreq_get_turbo(struct bcm2835_cpufreq_softc static int bcm2835_cpufreq_set_turbo(struct bcm2835_cpufreq_softc *sc, uint32_t level) { - struct msg_set_turbo msg; + union msg_set_turbo_body msg; int value; int err; @@ -440,29 +409,25 @@ bcm2835_cpufreq_set_turbo(struct bcm2835_cpufreq_softc */ /* replace unknown value to OFF */ - if (level != BCM2835_MBOX_TURBO_ON && level != BCM2835_MBOX_TURBO_OFF) - level = BCM2835_MBOX_TURBO_OFF; + if (level != BCM2835_FIRMWARE_TURBO_ON && + level != BCM2835_FIRMWARE_TURBO_OFF) + level = BCM2835_FIRMWARE_TURBO_OFF; /* setup single tag buffer */ memset(&msg, 0, sizeof(msg)); - msg.hdr.buf_size = sizeof(msg); - msg.hdr.code = BCM2835_MBOX_CODE_REQ; - msg.tag_hdr.tag = BCM2835_MBOX_TAG_SET_TURBO; - msg.tag_hdr.val_buf_size = sizeof(msg.body); - msg.tag_hdr.val_len = sizeof(msg.body.req); - msg.body.req.id = 0; - msg.body.req.level = level; - msg.end_tag = 0; + msg.req.id = 0; + msg.req.level = level; /* call mailbox property */ - err = bcm2835_mbox_property(&msg, sizeof(msg)); + err = bcm2835_firmware_property(sc->firmware, + BCM2835_FIRMWARE_TAG_SET_TURBO, &msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't set turbo\n"); return (MSG_ERROR); } /* result 0=non-turbo, 1=turbo */ - value = (int)msg.body.resp.level; + value = (int)msg.resp.level; DPRINTF("level = %d\n", value); return (value); } @@ -471,7 +436,7 @@ static int bcm2835_cpufreq_get_voltage(struct bcm2835_cpufreq_softc *sc, uint32_t voltage_id) { - struct msg_get_voltage msg; + union msg_get_voltage_body msg; int value; int err; @@ -491,23 +456,18 @@ bcm2835_cpufreq_get_voltage(struct bcm2835_cpufreq_sof /* setup single tag buffer */ memset(&msg, 0, sizeof(msg)); - msg.hdr.buf_size = sizeof(msg); - msg.hdr.code = BCM2835_MBOX_CODE_REQ; - msg.tag_hdr.tag = BCM2835_MBOX_TAG_GET_VOLTAGE; - msg.tag_hdr.val_buf_size = sizeof(msg.body); - msg.tag_hdr.val_len = sizeof(msg.body.req); - msg.body.req.voltage_id = voltage_id; - msg.end_tag = 0; + msg.req.voltage_id = voltage_id; /* call mailbox property */ - err = bcm2835_mbox_property(&msg, sizeof(msg)); + err = bcm2835_firmware_property(sc->firmware, + BCM2835_FIRMWARE_TAG_GET_VOLTAGE, &msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't get voltage\n"); return (MSG_ERROR); } /* result (offset from 1.2V) */ - value = (int)msg.body.resp.value; + value = (int)msg.resp.value; DPRINTF("value = %d\n", value); return (value); } @@ -516,7 +476,7 @@ static int bcm2835_cpufreq_get_max_voltage(struct bcm2835_cpufreq_softc *sc, uint32_t voltage_id) { - struct msg_get_max_voltage msg; + union msg_get_voltage_body msg; int value; int err; @@ -536,23 +496,18 @@ bcm2835_cpufreq_get_max_voltage(struct bcm2835_cpufreq /* setup single tag buffer */ memset(&msg, 0, sizeof(msg)); - msg.hdr.buf_size = sizeof(msg); - msg.hdr.code = BCM2835_MBOX_CODE_REQ; - msg.tag_hdr.tag = BCM2835_MBOX_TAG_GET_MAX_VOLTAGE; - msg.tag_hdr.val_buf_size = sizeof(msg.body); - msg.tag_hdr.val_len = sizeof(msg.body.req); - msg.body.req.voltage_id = voltage_id; - msg.end_tag = 0; + msg.req.voltage_id = voltage_id; /* call mailbox property */ - err = bcm2835_mbox_property(&msg, sizeof(msg)); + err = bcm2835_firmware_property(sc->firmware, + BCM2835_FIRMWARE_TAG_GET_MAX_VOLTAGE, &msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't get max voltage\n"); return (MSG_ERROR); } /* result (offset from 1.2V) */ - value = (int)msg.body.resp.value; + value = (int)msg.resp.value; DPRINTF("value = %d\n", value); return (value); } @@ -560,7 +515,7 @@ static int bcm2835_cpufreq_get_min_voltage(struct bcm2835_cpufreq_softc *sc, uint32_t voltage_id) { - struct msg_get_min_voltage msg; + union msg_get_voltage_body msg; int value; int err; @@ -580,23 +535,18 @@ bcm2835_cpufreq_get_min_voltage(struct bcm2835_cpufreq /* setup single tag buffer */ memset(&msg, 0, sizeof(msg)); - msg.hdr.buf_size = sizeof(msg); - msg.hdr.code = BCM2835_MBOX_CODE_REQ; - msg.tag_hdr.tag = BCM2835_MBOX_TAG_GET_MIN_VOLTAGE; - msg.tag_hdr.val_buf_size = sizeof(msg.body); - msg.tag_hdr.val_len = sizeof(msg.body.req); - msg.body.req.voltage_id = voltage_id; - msg.end_tag = 0; + msg.req.voltage_id = voltage_id; /* call mailbox property */ - err = bcm2835_mbox_property(&msg, sizeof(msg)); + err = bcm2835_firmware_property(sc->firmware, + BCM2835_FIRMWARE_TAG_GET_MIN_VOLTAGE, &msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't get min voltage\n"); return (MSG_ERROR); } /* result (offset from 1.2V) */ - value = (int)msg.body.resp.value; + value = (int)msg.resp.value; DPRINTF("value = %d\n", value); return (value); } @@ -605,7 +555,7 @@ static int bcm2835_cpufreq_set_voltage(struct bcm2835_cpufreq_softc *sc, uint32_t voltage_id, int32_t value) { - struct msg_set_voltage msg; + union msg_set_voltage_body msg; int err; /* @@ -636,24 +586,19 @@ bcm2835_cpufreq_set_voltage(struct bcm2835_cpufreq_sof /* setup single tag buffer */ memset(&msg, 0, sizeof(msg)); - msg.hdr.buf_size = sizeof(msg); - msg.hdr.code = BCM2835_MBOX_CODE_REQ; - msg.tag_hdr.tag = BCM2835_MBOX_TAG_SET_VOLTAGE; - msg.tag_hdr.val_buf_size = sizeof(msg.body); - msg.tag_hdr.val_len = sizeof(msg.body.req); - msg.body.req.voltage_id = voltage_id; - msg.body.req.value = (uint32_t)value; - msg.end_tag = 0; + msg.req.voltage_id = voltage_id; + msg.req.value = (uint32_t)value; /* call mailbox property */ - err = bcm2835_mbox_property(&msg, sizeof(msg)); + err = bcm2835_firmware_property(sc->firmware, + BCM2835_FIRMWARE_TAG_SET_VOLTAGE, &msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't set voltage\n"); return (MSG_ERROR); } /* result (offset from 1.2V) */ - value = (int)msg.body.resp.value; + value = (int)msg.resp.value; DPRINTF("value = %d\n", value); return (value); } @@ -661,7 +606,7 @@ bcm2835_cpufreq_set_voltage(struct bcm2835_cpufreq_sof static int bcm2835_cpufreq_get_temperature(struct bcm2835_cpufreq_softc *sc) { - struct msg_get_temperature msg; + union msg_get_temperature_body msg; int value; int err; @@ -681,23 +626,18 @@ bcm2835_cpufreq_get_temperature(struct bcm2835_cpufreq /* setup single tag buffer */ memset(&msg, 0, sizeof(msg)); - msg.hdr.buf_size = sizeof(msg); - msg.hdr.code = BCM2835_MBOX_CODE_REQ; - msg.tag_hdr.tag = BCM2835_MBOX_TAG_GET_TEMPERATURE; - msg.tag_hdr.val_buf_size = sizeof(msg.body); - msg.tag_hdr.val_len = sizeof(msg.body.req); - msg.body.req.temperature_id = 0; - msg.end_tag = 0; + msg.req.temperature_id = 0; /* call mailbox property */ - err = bcm2835_mbox_property(&msg, sizeof(msg)); + err = bcm2835_firmware_property(sc->firmware, + BCM2835_FIRMWARE_TAG_GET_TEMPERATURE, &msg, sizeof(msg)); if (err) { device_printf(sc->dev, "can't get temperature\n"); return (MSG_ERROR); } /* result (temperature of degree C) */ - value = (int)msg.body.resp.value; + value = (int)msg.resp.value; DPRINTF("value = %d\n", value); return (value); } @@ -713,7 +653,7 @@ sysctl_bcm2835_cpufreq_arm_freq(SYSCTL_HANDLER_ARGS) /* get realtime value */ VC_LOCK(sc); - val = bcm2835_cpufreq_get_clock_rate(sc, BCM2835_MBOX_CLOCK_ID_ARM); + val = bcm2835_cpufreq_get_clock_rate(sc, BCM2835_FIRMWARE_CLOCK_ID_ARM); VC_UNLOCK(sc); if (val == MSG_ERROR) return (EIO); @@ -724,7 +664,7 @@ sysctl_bcm2835_cpufreq_arm_freq(SYSCTL_HANDLER_ARGS) /* write request */ VC_LOCK(sc); - err = bcm2835_cpufreq_set_clock_rate(sc, BCM2835_MBOX_CLOCK_ID_ARM, + err = bcm2835_cpufreq_set_clock_rate(sc, BCM2835_FIRMWARE_CLOCK_ID_ARM, val); VC_UNLOCK(sc); if (err == MSG_ERROR) { @@ -745,7 +685,8 @@ sysctl_bcm2835_cpufreq_core_freq(SYSCTL_HANDLER_ARGS) /* get realtime value */ VC_LOCK(sc); - val = bcm2835_cpufreq_get_clock_rate(sc, BCM2835_MBOX_CLOCK_ID_CORE); + val = bcm2835_cpufreq_get_clock_rate(sc, + BCM2835_FIRMWARE_CLOCK_ID_CORE); VC_UNLOCK(sc); if (val == MSG_ERROR) return (EIO); @@ -756,7 +697,7 @@ sysctl_bcm2835_cpufreq_core_freq(SYSCTL_HANDLER_ARGS) /* write request */ VC_LOCK(sc); - err = bcm2835_cpufreq_set_clock_rate(sc, BCM2835_MBOX_CLOCK_ID_CORE, + err = bcm2835_cpufreq_set_clock_rate(sc, BCM2835_FIRMWARE_CLOCK_ID_CORE, val); if (err == MSG_ERROR) { VC_UNLOCK(sc); @@ -778,7 +719,8 @@ sysctl_bcm2835_cpufreq_sdram_freq(SYSCTL_HANDLER_ARGS) /* get realtime value */ VC_LOCK(sc); - val = bcm2835_cpufreq_get_clock_rate(sc, BCM2835_MBOX_CLOCK_ID_SDRAM); + val = bcm2835_cpufreq_get_clock_rate(sc, + BCM2835_FIRMWARE_CLOCK_ID_SDRAM); VC_UNLOCK(sc); if (val == MSG_ERROR) return (EIO); @@ -789,8 +731,8 @@ sysctl_bcm2835_cpufreq_sdram_freq(SYSCTL_HANDLER_ARGS) /* write request */ VC_LOCK(sc); - err = bcm2835_cpufreq_set_clock_rate(sc, BCM2835_MBOX_CLOCK_ID_SDRAM, - val); + err = bcm2835_cpufreq_set_clock_rate(sc, + BCM2835_FIRMWARE_CLOCK_ID_SDRAM, val); VC_UNLOCK(sc); if (err == MSG_ERROR) { device_printf(sc->dev, "set clock sdram_freq error\n"); @@ -821,9 +763,9 @@ sysctl_bcm2835_cpufreq_turbo(SYSCTL_HANDLER_ARGS) /* write request */ if (val > 0) - sc->turbo_mode = BCM2835_MBOX_TURBO_ON; + sc->turbo_mode = BCM2835_FIRMWARE_TURBO_ON; else - sc->turbo_mode = BCM2835_MBOX_TURBO_OFF; + sc->turbo_mode = BCM2835_FIRMWARE_TURBO_OFF; VC_LOCK(sc); err = bcm2835_cpufreq_set_turbo(sc, sc->turbo_mode); @@ -846,7 +788,7 @@ sysctl_bcm2835_cpufreq_voltage_core(SYSCTL_HANDLER_ARG /* get realtime value */ VC_LOCK(sc); - val = bcm2835_cpufreq_get_voltage(sc, BCM2835_MBOX_VOLTAGE_ID_CORE); + val = bcm2835_cpufreq_get_voltage(sc, BCM2835_FIRMWARE_VOLTAGE_ID_CORE); VC_UNLOCK(sc); if (val == MSG_ERROR) return (EIO); @@ -861,7 +803,7 @@ sysctl_bcm2835_cpufreq_voltage_core(SYSCTL_HANDLER_ARG sc->voltage_core = val; VC_LOCK(sc); - err = bcm2835_cpufreq_set_voltage(sc, BCM2835_MBOX_VOLTAGE_ID_CORE, + err = bcm2835_cpufreq_set_voltage(sc, BCM2835_FIRMWARE_VOLTAGE_ID_CORE, sc->voltage_core); VC_UNLOCK(sc); if (err == MSG_ERROR) { @@ -882,7 +824,8 @@ sysctl_bcm2835_cpufreq_voltage_sdram_c(SYSCTL_HANDLER_ /* get realtime value */ VC_LOCK(sc); - val = bcm2835_cpufreq_get_voltage(sc, BCM2835_MBOX_VOLTAGE_ID_SDRAM_C); + val = bcm2835_cpufreq_get_voltage(sc, + BCM2835_FIRMWARE_VOLTAGE_ID_SDRAM_C); VC_UNLOCK(sc); if (val == MSG_ERROR) return (EIO); @@ -897,7 +840,8 @@ sysctl_bcm2835_cpufreq_voltage_sdram_c(SYSCTL_HANDLER_ sc->voltage_sdram_c = val; VC_LOCK(sc); - err = bcm2835_cpufreq_set_voltage(sc, BCM2835_MBOX_VOLTAGE_ID_SDRAM_C, + err = bcm2835_cpufreq_set_voltage(sc, + BCM2835_FIRMWARE_VOLTAGE_ID_SDRAM_C, sc->voltage_sdram_c); VC_UNLOCK(sc); if (err == MSG_ERROR) { @@ -918,7 +862,8 @@ sysctl_bcm2835_cpufreq_voltage_sdram_i(SYSCTL_HANDLER_ /* get realtime value */ VC_LOCK(sc); - val = bcm2835_cpufreq_get_voltage(sc, BCM2835_MBOX_VOLTAGE_ID_SDRAM_I); + val = bcm2835_cpufreq_get_voltage(sc, + BCM2835_FIRMWARE_VOLTAGE_ID_SDRAM_I); VC_UNLOCK(sc); if (val == MSG_ERROR) return (EIO); @@ -933,8 +878,8 @@ sysctl_bcm2835_cpufreq_voltage_sdram_i(SYSCTL_HANDLER_ sc->voltage_sdram_i = val; VC_LOCK(sc); - err = bcm2835_cpufreq_set_voltage(sc, BCM2835_MBOX_VOLTAGE_ID_SDRAM_I, - sc->voltage_sdram_i); + err = bcm2835_cpufreq_set_voltage(sc, + BCM2835_FIRMWARE_VOLTAGE_ID_SDRAM_I, sc->voltage_sdram_i); VC_UNLOCK(sc); if (err == MSG_ERROR) { device_printf(sc->dev, "set voltage sdram_i error\n"); @@ -954,7 +899,8 @@ sysctl_bcm2835_cpufreq_voltage_sdram_p(SYSCTL_HANDLER_ /* get realtime value */ VC_LOCK(sc); - val = bcm2835_cpufreq_get_voltage(sc, BCM2835_MBOX_VOLTAGE_ID_SDRAM_P); + val = bcm2835_cpufreq_get_voltage(sc, + BCM2835_FIRMWARE_VOLTAGE_ID_SDRAM_P); VC_UNLOCK(sc); if (val == MSG_ERROR) return (EIO); @@ -969,8 +915,8 @@ sysctl_bcm2835_cpufreq_voltage_sdram_p(SYSCTL_HANDLER_ sc->voltage_sdram_p = val; VC_LOCK(sc); - err = bcm2835_cpufreq_set_voltage(sc, BCM2835_MBOX_VOLTAGE_ID_SDRAM_P, - sc->voltage_sdram_p); + err = bcm2835_cpufreq_set_voltage(sc, + BCM2835_FIRMWARE_VOLTAGE_ID_SDRAM_P, sc->voltage_sdram_p); VC_UNLOCK(sc); if (err == MSG_ERROR) { device_printf(sc->dev, "set voltage sdram_p error\n"); @@ -1002,22 +948,22 @@ sysctl_bcm2835_cpufreq_voltage_sdram(SYSCTL_HANDLER_AR sc->voltage_sdram = val; VC_LOCK(sc); - err = bcm2835_cpufreq_set_voltage(sc, BCM2835_MBOX_VOLTAGE_ID_SDRAM_C, - val); + err = bcm2835_cpufreq_set_voltage(sc, + BCM2835_FIRMWARE_VOLTAGE_ID_SDRAM_C, val); if (err == MSG_ERROR) { VC_UNLOCK(sc); device_printf(sc->dev, "set voltage sdram_c error\n"); return (EIO); } - err = bcm2835_cpufreq_set_voltage(sc, BCM2835_MBOX_VOLTAGE_ID_SDRAM_I, - val); + err = bcm2835_cpufreq_set_voltage(sc, + BCM2835_FIRMWARE_VOLTAGE_ID_SDRAM_I, val); if (err == MSG_ERROR) { VC_UNLOCK(sc); device_printf(sc->dev, "set voltage sdram_i error\n"); return (EIO); } - err = bcm2835_cpufreq_set_voltage(sc, BCM2835_MBOX_VOLTAGE_ID_SDRAM_P, - val); + err = bcm2835_cpufreq_set_voltage(sc, + BCM2835_FIRMWARE_VOLTAGE_ID_SDRAM_P, val); if (err == MSG_ERROR) { VC_UNLOCK(sc); device_printf(sc->dev, "set voltage sdram_p error\n"); @@ -1097,42 +1043,42 @@ bcm2835_cpufreq_init(void *arg) /* current clock */ arm_freq = bcm2835_cpufreq_get_clock_rate(sc, - BCM2835_MBOX_CLOCK_ID_ARM); + BCM2835_FIRMWARE_CLOCK_ID_ARM); core_freq = bcm2835_cpufreq_get_clock_rate(sc, - BCM2835_MBOX_CLOCK_ID_CORE); + BCM2835_FIRMWARE_CLOCK_ID_CORE); sdram_freq = bcm2835_cpufreq_get_clock_rate(sc, - BCM2835_MBOX_CLOCK_ID_SDRAM); + BCM2835_FIRMWARE_CLOCK_ID_SDRAM); /* max/min clock */ arm_max_freq = bcm2835_cpufreq_get_max_clock_rate(sc, - BCM2835_MBOX_CLOCK_ID_ARM); + BCM2835_FIRMWARE_CLOCK_ID_ARM); arm_min_freq = bcm2835_cpufreq_get_min_clock_rate(sc, - BCM2835_MBOX_CLOCK_ID_ARM); + BCM2835_FIRMWARE_CLOCK_ID_ARM); core_max_freq = bcm2835_cpufreq_get_max_clock_rate(sc, - BCM2835_MBOX_CLOCK_ID_CORE); + BCM2835_FIRMWARE_CLOCK_ID_CORE); core_min_freq = bcm2835_cpufreq_get_min_clock_rate(sc, - BCM2835_MBOX_CLOCK_ID_CORE); + BCM2835_FIRMWARE_CLOCK_ID_CORE); sdram_max_freq = bcm2835_cpufreq_get_max_clock_rate(sc, - BCM2835_MBOX_CLOCK_ID_SDRAM); + BCM2835_FIRMWARE_CLOCK_ID_SDRAM); sdram_min_freq = bcm2835_cpufreq_get_min_clock_rate(sc, - BCM2835_MBOX_CLOCK_ID_SDRAM); + BCM2835_FIRMWARE_CLOCK_ID_SDRAM); /* turbo mode */ turbo = bcm2835_cpufreq_get_turbo(sc); if (turbo > 0) - sc->turbo_mode = BCM2835_MBOX_TURBO_ON; + sc->turbo_mode = BCM2835_FIRMWARE_TURBO_ON; else - sc->turbo_mode = BCM2835_MBOX_TURBO_OFF; + sc->turbo_mode = BCM2835_FIRMWARE_TURBO_OFF; /* voltage */ voltage_core = bcm2835_cpufreq_get_voltage(sc, - BCM2835_MBOX_VOLTAGE_ID_CORE); + BCM2835_FIRMWARE_VOLTAGE_ID_CORE); voltage_sdram_c = bcm2835_cpufreq_get_voltage(sc, - BCM2835_MBOX_VOLTAGE_ID_SDRAM_C); + BCM2835_FIRMWARE_VOLTAGE_ID_SDRAM_C); voltage_sdram_i = bcm2835_cpufreq_get_voltage(sc, - BCM2835_MBOX_VOLTAGE_ID_SDRAM_I); + BCM2835_FIRMWARE_VOLTAGE_ID_SDRAM_I); voltage_sdram_p = bcm2835_cpufreq_get_voltage(sc, - BCM2835_MBOX_VOLTAGE_ID_SDRAM_P); + BCM2835_FIRMWARE_VOLTAGE_ID_SDRAM_P); /* current values (offset from 1.2V) */ sc->voltage_core = voltage_core; @@ -1143,21 +1089,21 @@ bcm2835_cpufreq_init(void *arg) /* max/min voltage */ max_voltage_core = bcm2835_cpufreq_get_max_voltage(sc, - BCM2835_MBOX_VOLTAGE_ID_CORE); + BCM2835_FIRMWARE_VOLTAGE_ID_CORE); min_voltage_core = bcm2835_cpufreq_get_min_voltage(sc, - BCM2835_MBOX_VOLTAGE_ID_CORE); + BCM2835_FIRMWARE_VOLTAGE_ID_CORE); max_voltage_sdram_c = bcm2835_cpufreq_get_max_voltage(sc, - BCM2835_MBOX_VOLTAGE_ID_SDRAM_C); + BCM2835_FIRMWARE_VOLTAGE_ID_SDRAM_C); max_voltage_sdram_i = bcm2835_cpufreq_get_max_voltage(sc, - BCM2835_MBOX_VOLTAGE_ID_SDRAM_I); + BCM2835_FIRMWARE_VOLTAGE_ID_SDRAM_I); max_voltage_sdram_p = bcm2835_cpufreq_get_max_voltage(sc, - BCM2835_MBOX_VOLTAGE_ID_SDRAM_P); + BCM2835_FIRMWARE_VOLTAGE_ID_SDRAM_P); min_voltage_sdram_c = bcm2835_cpufreq_get_min_voltage(sc, - BCM2835_MBOX_VOLTAGE_ID_SDRAM_C); + BCM2835_FIRMWARE_VOLTAGE_ID_SDRAM_C); min_voltage_sdram_i = bcm2835_cpufreq_get_min_voltage(sc, - BCM2835_MBOX_VOLTAGE_ID_SDRAM_I); + BCM2835_FIRMWARE_VOLTAGE_ID_SDRAM_I); min_voltage_sdram_p = bcm2835_cpufreq_get_min_voltage(sc, - BCM2835_MBOX_VOLTAGE_ID_SDRAM_P); + BCM2835_FIRMWARE_VOLTAGE_ID_SDRAM_P); /* temperature */ temperature = bcm2835_cpufreq_get_temperature(sc); @@ -1168,7 +1114,7 @@ bcm2835_cpufreq_init(void *arg) device_printf(sc->dev, "current ARM %dMHz, Core %dMHz, SDRAM %dMHz, Turbo %s\n", HZ2MHZ(arm_freq), HZ2MHZ(core_freq), HZ2MHZ(sdram_freq), - (sc->turbo_mode == BCM2835_MBOX_TURBO_ON) ? "ON" : "OFF"); + (sc->turbo_mode == BCM2835_FIRMWARE_TURBO_ON) ? "ON":"OFF"); device_printf(sc->dev, "max/min ARM %d/%dMHz, Core %d/%dMHz, SDRAM %d/%dMHz\n", @@ -1202,7 +1148,7 @@ bcm2835_cpufreq_init(void *arg) device_printf(sc->dev, "ARM %dMHz, Core %dMHz, SDRAM %dMHz, Turbo %s\n", HZ2MHZ(arm_freq), HZ2MHZ(core_freq), HZ2MHZ(sdram_freq), - (sc->turbo_mode == BCM2835_MBOX_TURBO_ON) ? "ON" : "OFF"); + (sc->turbo_mode == BCM2835_FIRMWARE_TURBO_ON) ? "ON":"OFF"); } /* keep in softc (MHz/mV) */ @@ -1216,25 +1162,25 @@ bcm2835_cpufreq_init(void *arg) sc->min_voltage_core = OFFSET2MVOLT(min_voltage_core); /* if turbo is on, set to max values */ - if (sc->turbo_mode == BCM2835_MBOX_TURBO_ON) { - bcm2835_cpufreq_set_clock_rate(sc, BCM2835_MBOX_CLOCK_ID_ARM, - arm_max_freq); + if (sc->turbo_mode == BCM2835_FIRMWARE_TURBO_ON) { + bcm2835_cpufreq_set_clock_rate(sc, + BCM2835_FIRMWARE_CLOCK_ID_ARM, arm_max_freq); DELAY(TRANSITION_LATENCY); - bcm2835_cpufreq_set_clock_rate(sc, BCM2835_MBOX_CLOCK_ID_CORE, - core_max_freq); + bcm2835_cpufreq_set_clock_rate(sc, + BCM2835_FIRMWARE_CLOCK_ID_CORE, core_max_freq); DELAY(TRANSITION_LATENCY); bcm2835_cpufreq_set_clock_rate(sc, - BCM2835_MBOX_CLOCK_ID_SDRAM, sdram_max_freq); + BCM2835_FIRMWARE_CLOCK_ID_SDRAM, sdram_max_freq); DELAY(TRANSITION_LATENCY); } else { - bcm2835_cpufreq_set_clock_rate(sc, BCM2835_MBOX_CLOCK_ID_ARM, - arm_min_freq); + bcm2835_cpufreq_set_clock_rate(sc, + BCM2835_FIRMWARE_CLOCK_ID_ARM, arm_min_freq); DELAY(TRANSITION_LATENCY); - bcm2835_cpufreq_set_clock_rate(sc, BCM2835_MBOX_CLOCK_ID_CORE, - core_min_freq); + bcm2835_cpufreq_set_clock_rate(sc, + BCM2835_FIRMWARE_CLOCK_ID_CORE, core_min_freq); DELAY(TRANSITION_LATENCY); bcm2835_cpufreq_set_clock_rate(sc, - BCM2835_MBOX_CLOCK_ID_SDRAM, sdram_min_freq); + BCM2835_FIRMWARE_CLOCK_ID_SDRAM, sdram_min_freq); DELAY(TRANSITION_LATENCY); } @@ -1297,6 +1243,12 @@ bcm2835_cpufreq_attach(device_t dev) /* set self dev */ sc = device_get_softc(dev); sc->dev = dev; + sc->firmware = devclass_get_device( + devclass_find("bcm2835_firmware"), 0); + if (sc->firmware == NULL) { + device_printf(dev, "Unable to find firmware device\n"); + return (ENXIO); + } /* initial values */ sc->arm_max_freq = -1; @@ -1430,7 +1382,7 @@ bcm2835_cpufreq_set(device_t dev, const struct cf_sett /* adjust min freq */ min_freq = sc->arm_min_freq; - if (sc->turbo_mode != BCM2835_MBOX_TURBO_ON) + if (sc->turbo_mode != BCM2835_FIRMWARE_TURBO_ON) if (min_freq > cpufreq_lowest_freq) min_freq = cpufreq_lowest_freq; @@ -1441,28 +1393,28 @@ bcm2835_cpufreq_set(device_t dev, const struct cf_sett VC_LOCK(sc); #ifdef DEBUG cur_freq = bcm2835_cpufreq_get_clock_rate(sc, - BCM2835_MBOX_CLOCK_ID_ARM); + BCM2835_FIRMWARE_CLOCK_ID_ARM); #endif resp_freq = bcm2835_cpufreq_set_clock_rate(sc, - BCM2835_MBOX_CLOCK_ID_ARM, rate_hz); + BCM2835_FIRMWARE_CLOCK_ID_ARM, rate_hz); DELAY(TRANSITION_LATENCY); arm_freq = bcm2835_cpufreq_get_clock_rate(sc, - BCM2835_MBOX_CLOCK_ID_ARM); + BCM2835_FIRMWARE_CLOCK_ID_ARM); /* * if non-turbo and lower than or equal min_freq, * clock down core and sdram to default first. */ - if (sc->turbo_mode != BCM2835_MBOX_TURBO_ON) { + if (sc->turbo_mode != BCM2835_FIRMWARE_TURBO_ON) { core_freq = bcm2835_cpufreq_get_clock_rate(sc, - BCM2835_MBOX_CLOCK_ID_CORE); + BCM2835_FIRMWARE_CLOCK_ID_CORE); if (rate_hz > MHZ2HZ(sc->arm_min_freq)) { bcm2835_cpufreq_set_clock_rate(sc, - BCM2835_MBOX_CLOCK_ID_CORE, + BCM2835_FIRMWARE_CLOCK_ID_CORE, MHZ2HZ(sc->core_max_freq)); DELAY(TRANSITION_LATENCY); bcm2835_cpufreq_set_clock_rate(sc, - BCM2835_MBOX_CLOCK_ID_SDRAM, + BCM2835_FIRMWARE_CLOCK_ID_SDRAM, MHZ2HZ(sc->sdram_max_freq)); DELAY(TRANSITION_LATENCY); } else { @@ -1471,20 +1423,20 @@ bcm2835_cpufreq_set(device_t dev, const struct cf_sett /* first, down to 250, then down to min */ DELAY(TRANSITION_LATENCY); bcm2835_cpufreq_set_clock_rate(sc, - BCM2835_MBOX_CLOCK_ID_CORE, + BCM2835_FIRMWARE_CLOCK_ID_CORE, MHZ2HZ(DEFAULT_CORE_FREQUENCY)); DELAY(TRANSITION_LATENCY); /* reset core voltage */ bcm2835_cpufreq_set_voltage(sc, - BCM2835_MBOX_VOLTAGE_ID_CORE, 0); + BCM2835_FIRMWARE_VOLTAGE_ID_CORE, 0); DELAY(TRANSITION_LATENCY); } bcm2835_cpufreq_set_clock_rate(sc, - BCM2835_MBOX_CLOCK_ID_CORE, + BCM2835_FIRMWARE_CLOCK_ID_CORE, MHZ2HZ(sc->core_min_freq)); DELAY(TRANSITION_LATENCY); bcm2835_cpufreq_set_clock_rate(sc, - BCM2835_MBOX_CLOCK_ID_SDRAM, + BCM2835_FIRMWARE_CLOCK_ID_SDRAM, MHZ2HZ(sc->sdram_min_freq)); DELAY(TRANSITION_LATENCY); } @@ -1517,7 +1469,7 @@ bcm2835_cpufreq_get(device_t dev, struct cf_setting *c /* get cuurent value */ VC_LOCK(sc); arm_freq = bcm2835_cpufreq_get_clock_rate(sc, - BCM2835_MBOX_CLOCK_ID_ARM); + BCM2835_FIRMWARE_CLOCK_ID_ARM); VC_UNLOCK(sc); if (arm_freq < 0) { device_printf(dev, "can't get clock\n"); @@ -1557,7 +1509,7 @@ bcm2835_cpufreq_make_freq_list(device_t dev, struct cf freq = min_freq; /* if non-turbo, add extra low freq */ - if (sc->turbo_mode != BCM2835_MBOX_TURBO_ON) + if (sc->turbo_mode != BCM2835_FIRMWARE_TURBO_ON) if (min_freq > cpufreq_lowest_freq) min_freq = cpufreq_lowest_freq; @@ -1654,3 +1606,4 @@ static driver_t bcm2835_cpufreq_driver = { DRIVER_MODULE(bcm2835_cpufreq, cpu, bcm2835_cpufreq_driver, bcm2835_cpufreq_devclass, 0, 0); +MODULE_DEPEND(bcm2835_cpufreq, bcm2835_firmware, 1, 1, 1); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_firmware.h Tue Jul 28 10:43:52 2020 (r363642) +++ head/sys/arm/broadcom/bcm2835/bcm2835_firmware.h Tue Jul 28 10:45:29 2020 (r363643) @@ -33,6 +33,115 @@ #ifndef _BCM2835_FIRMWARE_H_ #define _BCM2835_FIRMWARE_H_ +#define BCM2835_FIRMWARE_TAG_GET_CLOCK_RATE 0x00030002 +#define BCM2835_FIRMWARE_TAG_SET_CLOCK_RATE 0x00038002 +#define BCM2835_FIRMWARE_TAG_GET_MAX_CLOCK_RATE 0x00030004 +#define BCM2835_FIRMWARE_TAG_GET_MIN_CLOCK_RATE 0x00030007 + +#define BCM2835_FIRMWARE_CLOCK_ID_EMMC 0x00000001 +#define BCM2835_FIRMWARE_CLOCK_ID_UART 0x00000002 +#define BCM2835_FIRMWARE_CLOCK_ID_ARM 0x00000003 +#define BCM2835_FIRMWARE_CLOCK_ID_CORE 0x00000004 +#define BCM2835_FIRMWARE_CLOCK_ID_V3D 0x00000005 +#define BCM2835_FIRMWARE_CLOCK_ID_H264 0x00000006 +#define BCM2835_FIRMWARE_CLOCK_ID_ISP 0x00000007 +#define BCM2835_FIRMWARE_CLOCK_ID_SDRAM 0x00000008 +#define BCM2835_FIRMWARE_CLOCK_ID_PIXEL 0x00000009 +#define BCM2835_FIRMWARE_CLOCK_ID_PWM 0x0000000a +#define BCM2838_FIRMWARE_CLOCK_ID_EMMC2 0x0000000c + +union msg_get_clock_rate_body { + struct { + uint32_t clock_id; + } req; + struct { + uint32_t clock_id; + uint32_t rate_hz; + } resp; +}; + +union msg_set_clock_rate_body { + struct { + uint32_t clock_id; + uint32_t rate_hz; + } req; + struct { + uint32_t clock_id; + uint32_t rate_hz; + } resp; +}; + +#define BCM2835_FIRMWARE_TAG_GET_VOLTAGE 0x00030003 +#define BCM2835_FIRMWARE_TAG_SET_VOLTAGE 0x00038003 +#define BCM2835_FIRMWARE_TAG_GET_MAX_VOLTAGE 0x00030005 +#define BCM2835_FIRMWARE_TAG_GET_MIN_VOLTAGE 0x00030008 + +#define BCM2835_FIRMWARE_VOLTAGE_ID_CORE 0x00000001 +#define BCM2835_FIRMWARE_VOLTAGE_ID_SDRAM_C 0x00000002 +#define BCM2835_FIRMWARE_VOLTAGE_ID_SDRAM_P 0x00000003 +#define BCM2835_FIRMWARE_VOLTAGE_ID_SDRAM_I 0x00000004 + +union msg_get_voltage_body { + struct { + uint32_t voltage_id; + } req; + struct { + uint32_t voltage_id; + uint32_t value; + } resp; +}; + +union msg_set_voltage_body { + struct { + uint32_t voltage_id; + uint32_t value; + } req; + struct { + uint32_t voltage_id; + uint32_t value; + } resp; +}; + +#define BCM2835_FIRMWARE_TAG_GET_TEMPERATURE 0x00030006 +#define BCM2835_FIRMWARE_TAG_GET_MAX_TEMPERATURE 0x0003000a + +union msg_get_temperature_body { + struct { + uint32_t temperature_id; + } req; + struct { + uint32_t temperature_id; + uint32_t value; + } resp; +}; + +#define BCM2835_FIRMWARE_TAG_GET_TURBO 0x00030009 +#define BCM2835_FIRMWARE_TAG_SET_TURBO 0x00038009 + +#define BCM2835_FIRMWARE_TURBO_ON 1 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Jul 28 10:58:39 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9DFA63A5F5F; Tue, 28 Jul 2020 10:58:39 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGDDv3Z6rz4FZs; Tue, 28 Jul 2020 10:58:39 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DBC7E106; Tue, 28 Jul 2020 10:58:39 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06SAwdQT035796; Tue, 28 Jul 2020 10:58:39 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06SAwbcj035789; Tue, 28 Jul 2020 10:58:37 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <202007281058.06SAwbcj035789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Tue, 28 Jul 2020 10:58:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363644 - in head: cddl/lib cddl/lib/libdtrace cddl/lib/libzpool etc/mtree release/sparc64 rescue/rescue sbin/init sys/kern sys/modules/esp sys/modules/uart usr.sbin/bsdinstall/partedit... X-SVN-Group: head X-SVN-Commit-Author: nyan X-SVN-Commit-Paths: in head: cddl/lib cddl/lib/libdtrace cddl/lib/libzpool etc/mtree release/sparc64 rescue/rescue sbin/init sys/kern sys/modules/esp sys/modules/uart usr.sbin/bsdinstall/partedit usr.sbin/kldxref X-SVN-Commit-Revision: 363644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 10:58:39 -0000 Author: nyan Date: Tue Jul 28 10:58:37 2020 New Revision: 363644 URL: https://svnweb.freebsd.org/changeset/base/363644 Log: - Cleanups related to sparc64 removal. - Remove remains of sparc64 files. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D25831 Deleted: head/release/sparc64/ head/sbin/init/ttys.sparc64 head/usr.sbin/bsdinstall/partedit/partedit_sparc64.c head/usr.sbin/kldxref/ef_sparc64.c Modified: head/cddl/lib/Makefile head/cddl/lib/libdtrace/Makefile head/cddl/lib/libzpool/Makefile head/etc/mtree/BSD.usr.dist head/rescue/rescue/Makefile head/sys/kern/kern_dump.c head/sys/modules/esp/Makefile head/sys/modules/uart/Makefile Modified: head/cddl/lib/Makefile ============================================================================== --- head/cddl/lib/Makefile Tue Jul 28 10:45:29 2020 (r363643) +++ head/cddl/lib/Makefile Tue Jul 28 10:58:37 2020 (r363644) @@ -2,10 +2,10 @@ .include -SUBDIR= ${_drti} \ +SUBDIR= drti \ libavl \ libctf \ - ${_libdtrace} \ + libdtrace \ libnvpair \ libumem \ libuutil \ @@ -21,11 +21,6 @@ _libzfs= libzfs .if ${MK_LIBTHR} != "no" _libzpool= libzpool .endif -.endif - -.if ${MACHINE_CPUARCH} != "sparc64" -_drti= drti -_libdtrace= libdtrace .endif SUBDIR_DEPEND_libdtrace= libctf Modified: head/cddl/lib/libdtrace/Makefile ============================================================================== --- head/cddl/lib/libdtrace/Makefile Tue Jul 28 10:45:29 2020 (r363643) +++ head/cddl/lib/libdtrace/Makefile Tue Jul 28 10:58:37 2020 (r363644) @@ -103,9 +103,6 @@ CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/powerpc CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/riscv .PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/riscv .PATH: ${SRCTOP}/sys/cddl/dev/dtrace/riscv -.elif ${MACHINE_CPUARCH} == "sparc64" -CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/sparc -.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/sparc .else # temporary hack CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel Modified: head/cddl/lib/libzpool/Makefile ============================================================================== --- head/cddl/lib/libzpool/Makefile Tue Jul 28 10:45:29 2020 (r363643) +++ head/cddl/lib/libzpool/Makefile Tue Jul 28 10:58:37 2020 (r363644) @@ -18,9 +18,7 @@ .if exists(${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}/opensolaris_atomic.S) .PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH} ATOMIC_SRCS= opensolaris_atomic.S -.if ${MACHINE_ARCH} != "sparc64" ACFLAGS+= -Wa,--noexecstack -.endif .else .PATH: ${SRCTOP}/sys/cddl/compat/opensolaris/kern ATOMIC_SRCS= opensolaris_atomic.c Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Tue Jul 28 10:45:29 2020 (r363643) +++ head/etc/mtree/BSD.usr.dist Tue Jul 28 10:58:37 2020 (r363644) @@ -864,8 +864,6 @@ .. powerpc .. - sparc64 - .. .. man5 .. @@ -879,8 +877,6 @@ i386 .. powerpc - .. - sparc64 .. .. man9 Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Tue Jul 28 10:45:29 2020 (r363643) +++ head/rescue/rescue/Makefile Tue Jul 28 10:58:37 2020 (r363644) @@ -147,10 +147,6 @@ CRUNCH_ALIAS_bsdlabel= disklabel #CRUNCH_LIBS+= -lsmb .endif -.if ${MACHINE_CPUARCH} == "sparc64" -CRUNCH_PROGS_sbin+= bsdlabel sunlabel -.endif - .if ${MACHINE_CPUARCH} == "amd64" CRUNCH_PROGS_sbin+= bsdlabel fdisk CRUNCH_ALIAS_bsdlabel= disklabel Modified: head/sys/kern/kern_dump.c ============================================================================== --- head/sys/kern/kern_dump.c Tue Jul 28 10:45:29 2020 (r363643) +++ head/sys/kern/kern_dump.c Tue Jul 28 10:58:37 2020 (r363644) @@ -54,7 +54,7 @@ static size_t fragsz; struct dump_pa dump_map[DUMPSYS_MD_PA_NPAIRS]; -#if !defined(__powerpc__) && !defined(__sparc__) +#if !defined(__powerpc__) void dumpsys_gen_pa_init(void) { @@ -97,14 +97,12 @@ dumpsys_gen_unmap_chunk(vm_paddr_t pa __unused, size_t } -#if !defined(__sparc__) int dumpsys_gen_write_aux_headers(struct dumperinfo *di) { return (0); } -#endif int dumpsys_buf_seek(struct dumperinfo *di, size_t sz) @@ -240,7 +238,6 @@ dumpsys_foreach_chunk(dumpsys_callback_t cb, void *arg return (seqnr); } -#if !defined(__sparc__) static off_t fileofs; static int @@ -387,4 +384,3 @@ dumpsys_generic(struct dumperinfo *di) printf("\n** DUMP FAILED (ERROR %d) **\n", error); return (error); } -#endif Modified: head/sys/modules/esp/Makefile ============================================================================== --- head/sys/modules/esp/Makefile Tue Jul 28 10:45:29 2020 (r363643) +++ head/sys/modules/esp/Makefile Tue Jul 28 10:58:37 2020 (r363644) @@ -3,7 +3,7 @@ .PATH: ${SRCTOP}/sys/dev/esp KMOD= esp -SRCS= device_if.h esp_pci.c ${esp_sbus} bus_if.h ncr53c9x.c ${ofw_bus_if} +SRCS= device_if.h esp_pci.c bus_if.h ncr53c9x.c SRCS+= opt_cam.h pci_if.h .include Modified: head/sys/modules/uart/Makefile ============================================================================== --- head/sys/modules/uart/Makefile Tue Jul 28 10:45:29 2020 (r363643) +++ head/sys/modules/uart/Makefile Tue Jul 28 10:58:37 2020 (r363644) @@ -28,7 +28,7 @@ uart_dev_mu=uart_dev_mu.c .endif KMOD= uart -SRCS= ${uart_bus_acpi} ${uart_bus_ebus} uart_bus_isa.c uart_bus_pccard.c \ +SRCS= ${uart_bus_acpi} uart_bus_isa.c uart_bus_pccard.c \ uart_bus_pci.c uart_bus_puc.c uart_bus_scc.c \ uart_core.c ${uart_cpu_acpi} ${uart_cpu_machine} uart_dbg.c \ ${uart_dev_mvebu} uart_dev_ns8250.c ${uart_dev_mu} \ From owner-svn-src-head@freebsd.org Tue Jul 28 11:13:38 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47AAF3A65CF; Tue, 28 Jul 2020 11:13:38 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGDZB18L1z4GwW; Tue, 28 Jul 2020 11:13:38 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B5F7E423; Tue, 28 Jul 2020 11:13:38 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06SBDbE9047710; Tue, 28 Jul 2020 11:13:37 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06SBDbBn047709; Tue, 28 Jul 2020 11:13:37 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202007281113.06SBDbBn047709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 28 Jul 2020 11:13:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363645 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 363645 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 11:13:38 -0000 Author: andrew Date: Tue Jul 28 11:13:37 2020 New Revision: 363645 URL: https://svnweb.freebsd.org/changeset/base/363645 Log: Aadd Raspberry Pi firmware messages to manage GPIOs Some GPIOs are managed by an external IO expaandder through the firmware. Add the message details for these. Sponsored by: Innovate UK Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.h Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_firmware.h Tue Jul 28 10:58:37 2020 (r363644) +++ head/sys/arm/broadcom/bcm2835/bcm2835_firmware.h Tue Jul 28 11:13:37 2020 (r363645) @@ -142,6 +142,61 @@ union msg_set_turbo_body { } resp; }; +#define BCM2835_FIRMWARE_TAG_GET_GPIO_STATE 0x00030041 +#define BCM2835_FIRMWARE_TAG_SET_GPIO_STATE 0x00038041 +#define BCM2835_FIRMWARE_TAG_GET_GPIO_CONFIG 0x00030043 +#define BCM2835_FIRMWARE_TAG_SET_GPIO_CONFIG 0x00038043 + +#define BCM2835_FIRMWARE_GPIO_IN 0 +#define BCM2835_FIRMWARE_GPIO_OUT 1 + +union msg_get_gpio_state { + struct { + uint32_t gpio; + } req; + struct { + uint32_t gpio; + uint32_t state; + } resp; +}; + +union msg_set_gpio_state { + struct { + uint32_t gpio; + uint32_t state; + } req; + struct { + uint32_t gpio; + } resp; +}; + +union msg_get_gpio_config { + struct { + uint32_t gpio; + } req; + struct { + uint32_t gpio; + uint32_t dir; + uint32_t pol; + uint32_t term_en; + uint32_t term_pull_up; + } resp; +}; + +union msg_set_gpio_config { + struct { + uint32_t gpio; + uint32_t dir; + uint32_t pol; + uint32_t term_en; + uint32_t term_pull_up; + uint32_t state; + } req; + struct { + uint32_t gpio; + } resp; +}; + int bcm2835_firmware_property(device_t, uint32_t, void *, size_t); #endif From owner-svn-src-head@freebsd.org Tue Jul 28 11:23:38 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39B5D3A68B9; Tue, 28 Jul 2020 11:23:38 +0000 (UTC) (envelope-from alfredo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGDnk0Tqvz4H9S; Tue, 28 Jul 2020 11:23:38 +0000 (UTC) (envelope-from alfredo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E80D9E5A4; Tue, 28 Jul 2020 11:23:37 +0000 (UTC) (envelope-from alfredo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06SBNbcf053883; Tue, 28 Jul 2020 11:23:37 GMT (envelope-from alfredo@FreeBSD.org) Received: (from alfredo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06SBNb0E053882; Tue, 28 Jul 2020 11:23:37 GMT (envelope-from alfredo@FreeBSD.org) Message-Id: <202007281123.06SBNb0E053882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alfredo set sender to alfredo@FreeBSD.org using -f From: "Alfredo Dal'Ava Junior" Date: Tue, 28 Jul 2020 11:23:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363646 - head/sys/dev/virtio/pci X-SVN-Group: head X-SVN-Commit-Author: alfredo X-SVN-Commit-Paths: head/sys/dev/virtio/pci X-SVN-Commit-Revision: 363646 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 11:23:38 -0000 Author: alfredo Date: Tue Jul 28 11:23:37 2020 New Revision: 363646 URL: https://svnweb.freebsd.org/changeset/base/363646 Log: virtio: fix mips regression introduced by r357596 PowerPC support was fixed in r357596 by changing PCI bustag to BE as part of the solution, but this caused regression on mips. This change implements byte swapping of virtio PCI config area in the driver, leaving lower layer untouched. Submittnd by: Fernando Valle Reported by: arichardson Reviewed by: alfredo, arichardson Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D25416 Modified: head/sys/dev/virtio/pci/virtio_pci.c Modified: head/sys/dev/virtio/pci/virtio_pci.c ============================================================================== --- head/sys/dev/virtio/pci/virtio_pci.c Tue Jul 28 11:13:37 2020 (r363645) +++ head/sys/dev/virtio/pci/virtio_pci.c Tue Jul 28 11:23:37 2020 (r363646) @@ -179,23 +179,25 @@ static void vtpci_config_intr(void *); * I/O port read/write wrappers. */ #define vtpci_read_config_1(sc, o) bus_read_1((sc)->vtpci_res, (o)) -#define vtpci_read_config_2(sc, o) bus_read_2((sc)->vtpci_res, (o)) -#define vtpci_read_config_4(sc, o) bus_read_4((sc)->vtpci_res, (o)) #define vtpci_write_config_1(sc, o, v) bus_write_1((sc)->vtpci_res, (o), (v)) -#define vtpci_write_config_2(sc, o, v) bus_write_2((sc)->vtpci_res, (o), (v)) -#define vtpci_write_config_4(sc, o, v) bus_write_4((sc)->vtpci_res, (o), (v)) /* - * Legacy VirtIO header is always PCI endianness (little), so if we - * are in a BE machine we need to swap bytes from LE to BE when reading - * and from BE to LE when writing. - * If we are in a LE machine, there will be no swaps. + * Virtio-pci specifies that PCI Configuration area is guest endian. However, + * since PCI devices are inherently little-endian, on BE systems the bus layer + * transparently converts it to BE. For virtio-legacy, this conversion is + * undesired, so an extra byte swap is required to fix it. */ -#define vtpci_read_header_2(sc, o) le16toh(vtpci_read_config_2(sc, o)) -#define vtpci_read_header_4(sc, o) le32toh(vtpci_read_config_4(sc, o)) -#define vtpci_write_header_2(sc, o, v) vtpci_write_config_2(sc, o, (htole16(v))) -#define vtpci_write_header_4(sc, o, v) vtpci_write_config_4(sc, o, (htole32(v))) +#define vtpci_read_config_2(sc, o) le16toh(bus_read_2((sc)->vtpci_res, (o))) +#define vtpci_read_config_4(sc, o) le32toh(bus_read_4((sc)->vtpci_res, (o))) +#define vtpci_write_config_2(sc, o, v) bus_write_2((sc)->vtpci_res, (o), (htole16(v))) +#define vtpci_write_config_4(sc, o, v) bus_write_4((sc)->vtpci_res, (o), (htole32(v))) +/* PCI Header LE. On BE systems the bus layer takes care of byte swapping */ +#define vtpci_read_header_2(sc, o) (bus_read_2((sc)->vtpci_res, (o))) +#define vtpci_read_header_4(sc, o) (bus_read_4((sc)->vtpci_res, (o))) +#define vtpci_write_header_2(sc, o, v) bus_write_2((sc)->vtpci_res, (o), (v)) +#define vtpci_write_header_4(sc, o, v) bus_write_4((sc)->vtpci_res, (o), (v)) + /* Tunables. */ static int vtpci_disable_msix = 0; TUNABLE_INT("hw.virtio.pci.disable_msix", &vtpci_disable_msix); @@ -289,17 +291,6 @@ vtpci_attach(device_t dev) device_printf(dev, "cannot map I/O space\n"); return (ENXIO); } - -/* - * For legacy VirtIO, the device-specific configuration is guest - * endian, while the common configuration header is always - * PCI (little) endian and will be handled specifically in - * other parts of this file via functions - * 'vtpci_[read|write]_header_[2|4]' - */ -#if _BYTE_ORDER == _BIG_ENDIAN - rman_set_bustag(sc->vtpci_res, &bs_be_tag); -#endif if (pci_find_cap(dev, PCIY_MSI, NULL) != 0) sc->vtpci_flags |= VTPCI_FLAG_NO_MSI; From owner-svn-src-head@freebsd.org Tue Jul 28 11:32:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A82A83A6D27; Tue, 28 Jul 2020 11:32:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGF0F3ylPz4HYb; Tue, 28 Jul 2020 11:32:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B414E819; Tue, 28 Jul 2020 11:32:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06SBWj0h060189; Tue, 28 Jul 2020 11:32:45 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06SBWjBH060188; Tue, 28 Jul 2020 11:32:45 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202007281132.06SBWjBH060188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 28 Jul 2020 11:32:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363647 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 363647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 11:32:45 -0000 Author: andrew Date: Tue Jul 28 11:32:45 2020 New Revision: 363647 URL: https://svnweb.freebsd.org/changeset/base/363647 Log: Add a workaround for a bug when setting the Raspberry GIO config and state The Raspberry Pi GPIO config and state messages incorrectly return with the tag length set to 0. We then check this value to have the response flag set. Work around this by setting the response flag when setting the GPIO config or state and this value is zero. Sponsored by: Innovate UK Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Tue Jul 28 11:23:37 2020 (r363646) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Tue Jul 28 11:32:45 2020 (r363647) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -362,6 +363,16 @@ bcm2835_mbox_err(device_t dev, bus_addr_t msg_phys, ui tag = (struct bcm2835_mbox_tag_hdr *)(msg + 1); last = (uint8_t *)msg + len; for (idx = 0; tag->tag != 0; idx++) { + /* + * When setting the GPIO config or state the firmware doesn't + * set tag->val_len correctly. + */ + if ((tag->tag == BCM2835_FIRMWARE_TAG_SET_GPIO_CONFIG || + tag->tag == BCM2835_FIRMWARE_TAG_SET_GPIO_STATE) && + tag->val_len == 0) { + tag->val_len = BCM2835_MBOX_TAG_VAL_LEN_RESPONSE | + tag->val_buf_size; + } if ((tag->val_len & BCM2835_MBOX_TAG_VAL_LEN_RESPONSE) == 0) { device_printf(dev, "tag %d response error\n", idx); return (EIO); From owner-svn-src-head@freebsd.org Tue Jul 28 13:44:22 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D471C36A532; Tue, 28 Jul 2020 13:44:22 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) (using TLSv1.3 with cipher TLS_AES_256_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 4BGHw63WGHz4R9R; Tue, 28 Jul 2020 13:44:22 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from disco.vangyzen.net (unknown [70.97.188.230]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 8481556487; Tue, 28 Jul 2020 08:44:14 -0500 (CDT) Subject: Re: svn commit: r363607 - head/sys/vm To: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202007271425.06REPBtv075771@repo.freebsd.org> From: Eric van Gyzen Message-ID: Date: Tue, 28 Jul 2020 08:44:11 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: <202007271425.06REPBtv075771@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BGHw63WGHz4R9R X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:36236, ipnet:2607:fc50:1000::/36, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 13:44:22 -0000 On 7/27/20 9:25 AM, Mark Johnston wrote: > + > + /* > + * We may be attempting to free the page as part of the handling for an > + * I/O error, in which case the page was xbusied by a different thread. > + */ > + vm_page_xbusy_claim(m); I've just noticed that vm_page_xbusy_claim() ignores the WAITERS bit. Is this not a problem in practice? Eric From owner-svn-src-head@freebsd.org Tue Jul 28 15:14:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1DAD336C8CB; Tue, 28 Jul 2020 15:14:23 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGKvy23d5z4WFk; Tue, 28 Jul 2020 15:14:22 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd2a.google.com with SMTP id a5so5869878ioa.13; Tue, 28 Jul 2020 08:14:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=nKFgKvHVY7BJjktMQ97WwxfuyPRo92GSzSsByqlBtk4=; b=XtE5WWtHN5sUBFJu3bdxKQdhNdLGNKp+WdRT3hKTN2q2eBuga7034yxIdQu6+gZHaz Z2VHA6PuEELC6weDXINuO4TQAJkT0nUwLpo+oP2JR7EGagTXizlbK/Zws+GM0vBp/Gvz ZQ/vfDi5xrZKUFAr2KtFOl3E2Spfbeks2Tw053XO+YRotOBdYUxS65YUb3fYXNfhtm3G OOUhlejuNosAghwxDfSKHKHMQjO1GF9Ojovt9EKLG7YbSHQxOAPtHLLo9B+zxQS+Q639 52begwXa1ge8UUNV6oQn8zLRPtvjAu4qyT4ZAao/ULjw5ueEUZEt4Ewl+v59ivRQKU1C 6yYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=nKFgKvHVY7BJjktMQ97WwxfuyPRo92GSzSsByqlBtk4=; b=Gu05Jbo/TED2/lf2Sgn5NdgMKtLmLPm1gfgIW6LBmh/hREbdNCQ+mKpqbghEH3wE5k kGXKHs1W4hmmUMCGdRu1D82mgwlUeuF1vPHt2KpD+L94/y5GfjG/BoCaTLryfeR42qUp kcbXmcl3it568XV8wYrHv4oZRxBeQ+Ii6S7kAUDdgb91V4itDc+1l8ENLZD/MVlD7nY5 jQkMsYnP8GBq99Ko0WXoH61OvNVcs/scKdVU62bdTjkkZV2qlcBQjQ+NiRA9sOBi4hyr 2ZvA1HDiLo9DgehE3eeKL7T6DLPhD8+voW+GgK3OSufbBAV/yEYdm0+5wBYqtvP6GyA6 oNkw== X-Gm-Message-State: AOAM5306FE2cgcjgxzpXiZ3/mpA8XnRye/4147LXGeDWmhklhVFZSnX4 qJH8Fu9MxHeSCkK85SyAXxgQqhXJ+Tw= X-Google-Smtp-Source: ABdhPJyBHCNKxkgIxguZy3Vg+3nVUi2VkR7n8Sg0cObqY9xll6zLpT5gGxMOzXgHARUUjxnwklWpZQ== X-Received: by 2002:a05:6638:138a:: with SMTP id w10mr17004926jad.36.1595949261077; Tue, 28 Jul 2020 08:14:21 -0700 (PDT) Received: from raichu (toroon0560w-lp130-08-67-71-176-35.dsl.bell.ca. [67.71.176.35]) by smtp.gmail.com with ESMTPSA id x88sm3404761ilk.81.2020.07.28.08.14.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2020 08:14:20 -0700 (PDT) Sender: Mark Johnston Date: Tue, 28 Jul 2020 11:14:18 -0400 From: Mark Johnston To: Eric van Gyzen Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r363607 - head/sys/vm Message-ID: <20200728151418.GE59953@raichu> References: <202007271425.06REPBtv075771@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4BGKvy23d5z4WFk X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=XtE5WWtH; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::d2a as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-1.94 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-0.98)[-0.976]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; NEURAL_HAM_LONG(-1.02)[-1.024]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.24)[-0.240]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::d2a:from]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 15:14:23 -0000 On Tue, Jul 28, 2020 at 08:44:11AM -0500, Eric van Gyzen wrote: > On 7/27/20 9:25 AM, Mark Johnston wrote: > > + > > + /* > > + * We may be attempting to free the page as part of the handling for an > > + * I/O error, in which case the page was xbusied by a different thread. > > + */ > > + vm_page_xbusy_claim(m); > > I've just noticed that vm_page_xbusy_claim() ignores the WAITERS bit. > Is this not a problem in practice? Thanks, I think you're right. I posted a proposed patch here: https://reviews.freebsd.org/D25859 From owner-svn-src-head@freebsd.org Tue Jul 28 15:26:20 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD39736D029; Tue, 28 Jul 2020 15:26:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGL9m3xzsz4XJm; Tue, 28 Jul 2020 15:26:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C48911329; Tue, 28 Jul 2020 15:26:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06SFQKTh002448; Tue, 28 Jul 2020 15:26:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06SFQKe7002447; Tue, 28 Jul 2020 15:26:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007281526.06SFQKe7002447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 28 Jul 2020 15:26:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363649 - head/bin/ps X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/bin/ps X-SVN-Commit-Revision: 363649 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 15:26:20 -0000 Author: markj Date: Tue Jul 28 15:26:19 2020 New Revision: 363649 URL: https://svnweb.freebsd.org/changeset/base/363649 Log: ps(1): Fix formatting of the "command" field for kernel threads. When -H is specified, for kernel threads the command is formatted as "/" and truncated to MAXCOMLEN. But each of the proc name and td name may be up to MAXCOMLEN bytes in length. Also handle the ki_moretdname field to ensure that the full thread name gets printed. This is already handled correctly when formatting for "-o tdname". Reported by: freqlabs Reviewed by: freqlabs MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25840 Modified: head/bin/ps/ps.c Modified: head/bin/ps/ps.c ============================================================================== --- head/bin/ps/ps.c Tue Jul 28 15:16:29 2020 (r363648) +++ head/bin/ps/ps.c Tue Jul 28 15:26:19 2020 (r363649) @@ -1264,6 +1264,7 @@ fmt(char **(*fn)(kvm_t *, const struct kinfo_proc *, i static void saveuser(KINFO *ki) { + char tdname[COMMLEN + 1]; char *argsp; if (ki->ki_p->ki_flag & P_INMEM) { @@ -1280,12 +1281,14 @@ saveuser(KINFO *ki) * save arguments if needed */ if (needcomm) { - if (ki->ki_p->ki_stat == SZOMB) + if (ki->ki_p->ki_stat == SZOMB) { ki->ki_args = strdup(""); - else if (UREADOK(ki) || (ki->ki_p->ki_args != NULL)) + } else if (UREADOK(ki) || (ki->ki_p->ki_args != NULL)) { + (void)snprintf(tdname, sizeof(tdname), "%s%s", + ki->ki_p->ki_tdname, ki->ki_p->ki_moretdname); ki->ki_args = fmt(kvm_getargv, ki, - ki->ki_p->ki_comm, ki->ki_p->ki_tdname, MAXCOMLEN); - else { + ki->ki_p->ki_comm, tdname, COMMLEN * 2 + 1); + } else { asprintf(&argsp, "(%s)", ki->ki_p->ki_comm); ki->ki_args = argsp; } From owner-svn-src-head@freebsd.org Tue Jul 28 16:08:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E23E836DECE; Tue, 28 Jul 2020 16:08:16 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGM685gSGz4ZFy; Tue, 28 Jul 2020 16:08:16 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A69D6119A2; Tue, 28 Jul 2020 16:08:16 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06SG8GdZ027555; Tue, 28 Jul 2020 16:08:16 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06SG8FgP027547; Tue, 28 Jul 2020 16:08:15 GMT (envelope-from br@FreeBSD.org) Message-Id: <202007281608.06SG8FgP027547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 28 Jul 2020 16:08:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363650 - in head/sys: dev/iommu dev/ntb/ntb_hw x86/include x86/iommu x86/x86 X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: dev/iommu dev/ntb/ntb_hw x86/include x86/iommu x86/x86 X-SVN-Commit-Revision: 363650 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 16:08:16 -0000 Author: br Date: Tue Jul 28 16:08:14 2020 New Revision: 363650 URL: https://svnweb.freebsd.org/changeset/base/363650 Log: o Move the buswide_ctxs bitmap to iommu_unit and rename related functions. o Rename bus_dma_dmar_load_ident() as well. Reviewed by: kib Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D25852 Modified: head/sys/dev/iommu/busdma_iommu.c head/sys/dev/iommu/iommu.h head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c head/sys/x86/include/bus_dma.h head/sys/x86/iommu/intel_ctx.c head/sys/x86/iommu/intel_dmar.h head/sys/x86/iommu/intel_drv.c head/sys/x86/x86/busdma_machdep.c Modified: head/sys/dev/iommu/busdma_iommu.c ============================================================================== --- head/sys/dev/iommu/busdma_iommu.c Tue Jul 28 15:26:19 2020 (r363649) +++ head/sys/dev/iommu/busdma_iommu.c Tue Jul 28 16:08:14 2020 (r363650) @@ -299,7 +299,7 @@ acpi_iommu_get_dma_tag(device_t dev, device_t child) } bool -bus_dma_dmar_set_buswide(device_t dev) +bus_dma_iommu_set_buswide(device_t dev) { struct iommu_unit *unit; device_t parent; @@ -317,12 +317,12 @@ bus_dma_dmar_set_buswide(device_t dev) if (slot != 0 || func != 0) { if (bootverbose) { device_printf(dev, - "dmar%d pci%d:%d:%d requested buswide busdma\n", + "iommu%d pci%d:%d:%d requested buswide busdma\n", unit->unit, busno, slot, func); } return (false); } - dmar_set_buswide_ctx(unit, busno); + iommu_set_buswide_ctx(unit, busno); return (true); } @@ -987,7 +987,7 @@ iommu_fini_busdma(struct iommu_unit *unit) } int -bus_dma_dmar_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map1, +bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map1, vm_paddr_t start, vm_size_t length, int flags) { struct bus_dma_tag_common *tc; Modified: head/sys/dev/iommu/iommu.h ============================================================================== --- head/sys/dev/iommu/iommu.h Tue Jul 28 15:26:19 2020 (r363649) +++ head/sys/dev/iommu/iommu.h Tue Jul 28 16:08:14 2020 (r363650) @@ -34,12 +34,14 @@ #ifndef _SYS_IOMMU_H_ #define _SYS_IOMMU_H_ +#include #include #include #include #include -#include +#include + /* Host or physical memory address, after translation. */ typedef uint64_t iommu_haddr_t; /* Guest or bus address, before translation. */ @@ -96,6 +98,14 @@ struct iommu_unit { struct task dmamap_load_task; TAILQ_HEAD(, bus_dmamap_iommu) delayed_maps; struct taskqueue *delayed_taskqueue; + + /* + * Bitmap of buses for which context must ignore slot:func, + * duplicating the page table pointer into all context table + * entries. This is a client-controlled quirk to support some + * NTBs. + */ + uint32_t buswide_ctxs[(PCI_BUSMAX + 1) / NBBY / sizeof(uint32_t)]; }; /* Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Tue Jul 28 15:26:19 2020 (r363649) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Tue Jul 28 16:08:14 2020 (r363650) @@ -811,7 +811,7 @@ intel_ntb_map_pci_bars(struct ntb_softc *ntb) device_printf(ntb->device, "Unable to create BAR0 map\n"); return (ENOMEM); } - if (bus_dma_dmar_load_ident(ntb->bar0_dma_tag, ntb->bar0_dma_map, + if (bus_dma_iommu_load_ident(ntb->bar0_dma_tag, ntb->bar0_dma_map, bar->pbase, bar->size, 0)) { device_printf(ntb->device, "Unable to load BAR0 map\n"); return (ENOMEM); Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Tue Jul 28 15:26:19 2020 (r363649) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Tue Jul 28 16:08:14 2020 (r363650) @@ -343,7 +343,7 @@ ntb_plx_attach(device_t dev) * The device occupies whole bus. In translated TLP slot field * keeps LUT index (original bus/slot), function is passed through. */ - bus_dma_dmar_set_buswide(dev); + bus_dma_iommu_set_buswide(dev); /* Identify chip port we are connected to. */ val = bus_read_4(sc->conf_res, 0x360); Modified: head/sys/x86/include/bus_dma.h ============================================================================== --- head/sys/x86/include/bus_dma.h Tue Jul 28 15:26:19 2020 (r363649) +++ head/sys/x86/include/bus_dma.h Tue Jul 28 16:08:14 2020 (r363650) @@ -192,8 +192,8 @@ _bus_dmamap_complete(bus_dma_tag_t dmat, bus_dmamap_t } #ifdef _KERNEL -bool bus_dma_dmar_set_buswide(device_t dev); -int bus_dma_dmar_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map, +bool bus_dma_iommu_set_buswide(device_t dev); +int bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t start, vm_size_t length, int flags); #endif Modified: head/sys/x86/iommu/intel_ctx.c ============================================================================== --- head/sys/x86/iommu/intel_ctx.c Tue Jul 28 15:26:19 2020 (r363649) +++ head/sys/x86/iommu/intel_ctx.c Tue Jul 28 16:08:14 2020 (r363650) @@ -196,7 +196,7 @@ ctx_id_entry_init(struct dmar_ctx *ctx, dmar_ctx_entry IOMMU_PGF_NOALLOC); } - if (dmar_is_buswide_ctx(unit, busno)) { + if (iommu_is_buswide_ctx((struct iommu_unit *)unit, busno)) { MPASS(!move); for (i = 0; i <= PCI_BUSMAX; i++) { ctx_id_entry_init_one(&ctxp[i], domain, ctx_root); @@ -464,6 +464,7 @@ dmar_get_ctx_for_dev1(struct dmar_unit *dmar, device_t { struct dmar_domain *domain, *domain1; struct dmar_ctx *ctx, *ctx1; + struct iommu_unit *unit; dmar_ctx_entry_t *ctxp; struct sf_buf *sf; int bus, slot, func, error; @@ -480,9 +481,10 @@ dmar_get_ctx_for_dev1(struct dmar_unit *dmar, device_t } enable = false; TD_PREP_PINNED_ASSERT; + unit = (struct iommu_unit *)dmar; DMAR_LOCK(dmar); - KASSERT(!dmar_is_buswide_ctx(dmar, bus) || (slot == 0 && func == 0), - ("dmar%d pci%d:%d:%d get_ctx for buswide", dmar->iommu.unit, bus, + KASSERT(!iommu_is_buswide_ctx(unit, bus) || (slot == 0 && func == 0), + ("iommu%d pci%d:%d:%d get_ctx for buswide", dmar->iommu.unit, bus, slot, func)); ctx = dmar_find_ctx_locked(dmar, rid); error = 0; Modified: head/sys/x86/iommu/intel_dmar.h ============================================================================== --- head/sys/x86/iommu/intel_dmar.h Tue Jul 28 15:26:19 2020 (r363649) +++ head/sys/x86/iommu/intel_dmar.h Tue Jul 28 16:08:14 2020 (r363650) @@ -167,15 +167,6 @@ struct dmar_unit { struct iommu_map_entries_tailq tlb_flush_entries; struct task qi_task; struct taskqueue *qi_taskqueue; - - /* - * Bitmap of buses for which context must ignore slot:func, - * duplicating the page table pointer into all context table - * entries. This is a client-controlled quirk to support some - * NTBs. - */ - uint32_t buswide_ctxs[(PCI_BUSMAX + 1) / NBBY / sizeof(uint32_t)]; - }; #define DMAR_LOCK(dmar) mtx_lock(&(dmar)->iommu.lock) @@ -290,8 +281,8 @@ void dmar_quirks_pre_use(struct iommu_unit *dmar); int dmar_init_irt(struct dmar_unit *unit); void dmar_fini_irt(struct dmar_unit *unit); -void dmar_set_buswide_ctx(struct iommu_unit *unit, u_int busno); -bool dmar_is_buswide_ctx(struct dmar_unit *unit, u_int busno); +void iommu_set_buswide_ctx(struct iommu_unit *unit, u_int busno); +bool iommu_is_buswide_ctx(struct iommu_unit *unit, u_int busno); extern iommu_haddr_t dmar_high; extern int haw; Modified: head/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Tue Jul 28 15:26:19 2020 (r363649) +++ head/sys/x86/iommu/intel_drv.c Tue Jul 28 16:08:14 2020 (r363650) @@ -593,21 +593,18 @@ DRIVER_MODULE(dmar, acpi, dmar_driver, dmar_devclass, MODULE_DEPEND(dmar, acpi, 1, 1, 1); void -dmar_set_buswide_ctx(struct iommu_unit *unit, u_int busno) +iommu_set_buswide_ctx(struct iommu_unit *unit, u_int busno) { - struct dmar_unit *dmar; - dmar = (struct dmar_unit *)unit; - MPASS(busno <= PCI_BUSMAX); - DMAR_LOCK(dmar); - dmar->buswide_ctxs[busno / NBBY / sizeof(uint32_t)] |= + IOMMU_LOCK(unit); + unit->buswide_ctxs[busno / NBBY / sizeof(uint32_t)] |= 1 << (busno % (NBBY * sizeof(uint32_t))); - DMAR_UNLOCK(dmar); + IOMMU_UNLOCK(unit); } bool -dmar_is_buswide_ctx(struct dmar_unit *unit, u_int busno) +iommu_is_buswide_ctx(struct iommu_unit *unit, u_int busno) { MPASS(busno <= PCI_BUSMAX); Modified: head/sys/x86/x86/busdma_machdep.c ============================================================================== --- head/sys/x86/x86/busdma_machdep.c Tue Jul 28 15:26:19 2020 (r363649) +++ head/sys/x86/x86/busdma_machdep.c Tue Jul 28 16:08:14 2020 (r363650) @@ -301,13 +301,13 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) #ifndef ACPI_DMAR bool -bus_dma_dmar_set_buswide(device_t dev) +bus_dma_iommu_set_buswide(device_t dev) { return (false); } int -bus_dma_dmar_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map, +bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t start, vm_size_t length, int flags) { return (0); From owner-svn-src-head@freebsd.org Tue Jul 28 17:09:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F4C336F3E7; Tue, 28 Jul 2020 17:09:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGNSX011lz4dpC; Tue, 28 Jul 2020 17:09:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D76641276B; Tue, 28 Jul 2020 17:09:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06SH9FQk065836; Tue, 28 Jul 2020 17:09:15 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06SH9FLv065835; Tue, 28 Jul 2020 17:09:15 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202007281709.06SH9FLv065835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 28 Jul 2020 17:09:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363652 - head/share/man/man3 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/man/man3 X-SVN-Commit-Revision: 363652 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 17:09:16 -0000 Author: jhb Date: Tue Jul 28 17:09:15 2020 New Revision: 363652 URL: https://svnweb.freebsd.org/changeset/base/363652 Log: Add further clarification on si_addr and si_trapno. - In the initial description of si_addr, do not claim that it is always the faulting instruction. - For si_addr, document that it is generally set to the PC for synchronous signals, but that it can be set to the the address of the faulting memory reference for some signals including SIGSEGV and SIGBUS. In particular, while SIGSEGV generally sets si_addr to the faulting memory reference, SIGBUS can vary. On some platforms, some SIGBUS signals set si_addr to the PC and other SIGBUS signals set si_addr to the faulting address depending on the specific hardware exception. - For si_trapno, synchronous signals should set this to some value. Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25777 Modified: head/share/man/man3/siginfo.3 Modified: head/share/man/man3/siginfo.3 ============================================================================== --- head/share/man/man3/siginfo.3 Tue Jul 28 16:10:51 2020 (r363651) +++ head/share/man/man3/siginfo.3 Tue Jul 28 17:09:15 2020 (r363652) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 8, 2020 +.Dd July 28, 2020 .Dt SIGINFO 3 .Os .Sh NAME @@ -68,7 +68,7 @@ sending process ID .It Vt uid_t Ta Va si_uid Ta sending process's real user ID .It Vt void Ta Va *si_addr Ta -address of faulting instruction +virtual address .It Vt int Ta Va si_status Ta exit value or signal .It Vt long Ta Va si_band Ta @@ -208,25 +208,24 @@ signal sent by .Xr pthread_kill 3 .El .Pp +For synchronous signals, +.Va si_addr +is generally set to the address of the faulting instruction. +However, synchronous signals raised by a faulting memory access such as +.Dv SIGSEGV +and +.Dv SIGBUS +may report the address of the faulting memory access (if available) in +.Va si_addr +instead. +.Pp +Sychronous signals set +.Va si_trapno +to a machine-dependent trap number. +.Pp In addition, the following signal-specific information is available: .Bl -column ".Dv SIGPOLL" ".Dv CLD_CONTINUED" .It Sy Signal Ta Sy Member Ta Sy Value -.It Dv SIGILL Ta Va si_addr Ta -address of faulting instruction -.It Ta Va si_trapno Ta -machine dependent of trap code -.It Dv SIGFPE Ta Va si_addr Ta -address of faulting instruction -.It Ta Va si_trapno Ta -machine dependent of trap code -.It Dv SIGSEGV Ta Va si_addr Ta -address of faulting memory reference -.It Ta Va si_trapno Ta -machine dependent of trap code -.It Dv SIGBUS Ta Va si_addr Ta -address of faulting instruction -.It Ta Va si_trapno Ta -machine dependent of trap code .It Dv SIGCHLD Ta Va si_pid Ta child process ID .It Ta Va si_status Ta From owner-svn-src-head@freebsd.org Tue Jul 28 18:42:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 70E69371942; Tue, 28 Jul 2020 18:42:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGQWY1T6Gz3VNB; Tue, 28 Jul 2020 18:42:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 06SIfq8F022469 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 28 Jul 2020 21:41:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 06SIfq8F022469 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 06SIfqgm022468; Tue, 28 Jul 2020 21:41:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 28 Jul 2020 21:41:52 +0300 From: Konstantin Belousov To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r363482 - in head/sys: kern sys Message-ID: <20200728184152.GH2551@kib.kiev.ua> References: <202007241734.06OHY53J080448@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202007241734.06OHY53J080448@repo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4BGQWY1T6Gz3VNB X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [1.83 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_MEDIUM(0.56)[0.558]; NEURAL_SPAM_SHORT(0.98)[0.984]; NEURAL_SPAM_LONG(0.29)[0.292]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 18:42:02 -0000 On Fri, Jul 24, 2020 at 05:34:05PM +0000, Conrad Meyer wrote: > Author: cem > Date: Fri Jul 24 17:34:04 2020 > New Revision: 363482 > URL: https://svnweb.freebsd.org/changeset/base/363482 > > Log: > Add unlocked/SMR fast path to getblk() > > Convert the bufobj tries to an SMR zone/PCTRIE and add a gbincore_unlocked() > API wrapping this functionality. Use it for a fast path in getblkx(), > falling back to locked lookup if we raced a thread changing the buf's > identity. > > Reported by: Attilio > Reviewed by: kib, markj > Testing: pho (in progress) > Sponsored by: Isilon > Differential Revision: https://reviews.freebsd.org/D25782 > > Modified: > head/sys/kern/vfs_bio.c > head/sys/kern/vfs_subr.c > head/sys/sys/buf.h > > Modified: head/sys/kern/vfs_bio.c > ============================================================================== > --- head/sys/kern/vfs_bio.c Fri Jul 24 17:32:10 2020 (r363481) > +++ head/sys/kern/vfs_bio.c Fri Jul 24 17:34:04 2020 (r363482) > @@ -3849,7 +3849,7 @@ getblkx(struct vnode *vp, daddr_t blkno, daddr_t dblkn > struct buf *bp; > struct bufobj *bo; > daddr_t d_blkno; > - int bsize, error, maxsize, vmio; > + int bsize, error, maxsize, vmio, lockflags; > off_t offset; > > CTR3(KTR_BUF, "getblk(%p, %ld, %d)", vp, (long)blkno, size); > @@ -3864,11 +3864,33 @@ getblkx(struct vnode *vp, daddr_t blkno, daddr_t dblkn > > bo = &vp->v_bufobj; > d_blkno = dblkno; > + > + /* Attempt lockless lookup first. */ > + bp = gbincore_unlocked(bo, blkno); > + if (bp == NULL) > + goto newbuf_unlocked; > + > + lockflags = LK_EXCLUSIVE | LK_SLEEPFAIL | > + ((flags & GB_LOCK_NOWAIT) ? LK_NOWAIT : 0); > + > + error = BUF_TIMELOCK(bp, lockflags, NULL, "getblku", slpflag, > + slptimeo); I realized that this is not safe. There is an ordering between buffer types that defines which order buffer locks should obey. For instance, on UFS the critical order is inode buffer -> snaplk -> cg buffer, or data block -> indirect data block. Since buffer identity can change under us, we might end up waiting for a lock of type that is incompatible with the currently owned lock. I think the easiest fix is to use LK_NOWAIT always, after all it is lockless path. ERESTART/EINTR checks below than can be removed. > + if (error == EINTR || error == ERESTART) > + return (error); > + else if (error != 0) > + goto loop; > + > + /* Verify buf identify has not changed since lookup. */ > + if (bp->b_bufobj == bo && bp->b_lblkno == blkno) > + goto foundbuf_fastpath; > + > + /* It changed, fallback to locked lookup. */ > + BUF_UNLOCK_RAW(bp); > + > loop: > BO_RLOCK(bo); > bp = gbincore(bo, blkno); > if (bp != NULL) { > - int lockflags; > /* > * Buffer is in-core. If the buffer is not busy nor managed, > * it must be on a queue. > @@ -3890,8 +3912,10 @@ loop: > /* We timed out or were interrupted. */ > else if (error != 0) > return (error); > + > +foundbuf_fastpath: > /* If recursed, assume caller knows the rules. */ > - else if (BUF_LOCKRECURSED(bp)) > + if (BUF_LOCKRECURSED(bp)) > goto end; > > /* > @@ -3989,6 +4013,7 @@ loop: > * buffer is also considered valid (not marked B_INVAL). > */ > BO_RUNLOCK(bo); > +newbuf_unlocked: > /* > * If the user does not want us to create the buffer, bail out > * here. > > Modified: head/sys/kern/vfs_subr.c > ============================================================================== > --- head/sys/kern/vfs_subr.c Fri Jul 24 17:32:10 2020 (r363481) > +++ head/sys/kern/vfs_subr.c Fri Jul 24 17:34:04 2020 (r363482) > @@ -234,6 +234,7 @@ static struct mtx __exclusive_cache_line vnode_list_mt > struct nfs_public nfs_pub; > > static uma_zone_t buf_trie_zone; > +static smr_t buf_trie_smr; > > /* Zone for allocation of new vnodes - used exclusively by getnewvnode() */ > static uma_zone_t vnode_zone; > @@ -491,17 +492,16 @@ static int vnsz2log; > static void * > buf_trie_alloc(struct pctrie *ptree) > { > - > - return uma_zalloc(buf_trie_zone, M_NOWAIT); > + return (uma_zalloc_smr(buf_trie_zone, M_NOWAIT)); > } > > static void > buf_trie_free(struct pctrie *ptree, void *node) > { > - > - uma_zfree(buf_trie_zone, node); > + uma_zfree_smr(buf_trie_zone, node); > } > -PCTRIE_DEFINE(BUF, buf, b_lblkno, buf_trie_alloc, buf_trie_free); > +PCTRIE_DEFINE_SMR(BUF, buf, b_lblkno, buf_trie_alloc, buf_trie_free, > + buf_trie_smr); > > /* > * Initialize the vnode management data structures. > @@ -675,7 +675,8 @@ vntblinit(void *dummy __unused) > */ > buf_trie_zone = uma_zcreate("BUF TRIE", pctrie_node_size(), > NULL, NULL, pctrie_zone_init, NULL, UMA_ALIGN_PTR, > - UMA_ZONE_NOFREE); > + UMA_ZONE_NOFREE | UMA_ZONE_SMR); > + buf_trie_smr = uma_zone_get_smr(buf_trie_zone); > uma_prealloc(buf_trie_zone, nbuf); > > vnodes_created = counter_u64_alloc(M_WAITOK); > @@ -2330,7 +2331,25 @@ gbincore(struct bufobj *bo, daddr_t lblkno) > bp = BUF_PCTRIE_LOOKUP(&bo->bo_clean.bv_root, lblkno); > if (bp != NULL) > return (bp); > - return BUF_PCTRIE_LOOKUP(&bo->bo_dirty.bv_root, lblkno); > + return (BUF_PCTRIE_LOOKUP(&bo->bo_dirty.bv_root, lblkno)); > +} > + > +/* > + * Look up a buf using the buffer tries, without the bufobj lock. This relies > + * on SMR for safe lookup, and bufs being in a no-free zone to provide type > + * stability of the result. Like other lockless lookups, the found buf may > + * already be invalid by the time this function returns. > + */ > +struct buf * > +gbincore_unlocked(struct bufobj *bo, daddr_t lblkno) > +{ > + struct buf *bp; > + > + ASSERT_BO_UNLOCKED(bo); > + bp = BUF_PCTRIE_LOOKUP_UNLOCKED(&bo->bo_clean.bv_root, lblkno); > + if (bp != NULL) > + return (bp); > + return (BUF_PCTRIE_LOOKUP_UNLOCKED(&bo->bo_dirty.bv_root, lblkno)); > } > > /* > > Modified: head/sys/sys/buf.h > ============================================================================== > --- head/sys/sys/buf.h Fri Jul 24 17:32:10 2020 (r363481) > +++ head/sys/sys/buf.h Fri Jul 24 17:34:04 2020 (r363482) > @@ -326,6 +326,9 @@ extern const char *buf_wmesg; /* Default buffer lock > KASSERT(((bp)->b_flags & B_REMFREE) == 0, \ > ("BUF_UNLOCK %p while B_REMFREE is still set.", (bp))); \ > \ > + BUF_UNLOCK_RAW((bp)); \ > +} while (0) > +#define BUF_UNLOCK_RAW(bp) do { \ > (void)_lockmgr_args(&(bp)->b_lock, LK_RELEASE, NULL, \ > LK_WMESG_DEFAULT, LK_PRIO_DEFAULT, LK_TIMO_DEFAULT, \ > LOCK_FILE, LOCK_LINE); \ > @@ -547,6 +550,7 @@ void vfs_busy_pages_acquire(struct buf *bp); > void vfs_busy_pages_release(struct buf *bp); > struct buf *incore(struct bufobj *, daddr_t); > struct buf *gbincore(struct bufobj *, daddr_t); > +struct buf *gbincore_unlocked(struct bufobj *, daddr_t); > struct buf *getblk(struct vnode *, daddr_t, int, int, int, int); > int getblkx(struct vnode *vp, daddr_t blkno, daddr_t dblkno, int size, > int slpflag, int slptimeo, int flags, struct buf **bpp); From owner-svn-src-head@freebsd.org Tue Jul 28 19:47:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 64533372F4A; Tue, 28 Jul 2020 19:47:09 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGRyh6jXPz3Z1P; Tue, 28 Jul 2020 19:47:08 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 06SJl10A075165; Tue, 28 Jul 2020 12:47:01 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 06SJl1IC075164; Tue, 28 Jul 2020 12:47:01 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202007281947.06SJl1IC075164@gndrsh.dnsmgr.net> Subject: Re: svn commit: r363598 - head/usr.sbin/nologin In-Reply-To: <65062b6a-9a8e-e4fc-9355-99f26e7ef341@FreeBSD.org> To: Mateusz Piotrowski <0mp@freebsd.org> Date: Tue, 28 Jul 2020 12:47:01 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, yuripv@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4BGRyh6jXPz3Z1P X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 19:47:09 -0000 > Hi, > > On 7/27/20 7:17 PM, Rodney W. Grimes wrote: > > On 7/27/20 6:41 PM, Rodney W. Grimes wrote: > >>>> Author: 0mp (doc,ports committer) > >>>> Date: Mon Jul 27 10:45:47 2020 > >>>> New Revision: 363598 > >>>> URL: https://svnweb.freebsd.org/changeset/base/363598 > >>>> > >>>> Log: > >>>> nologin.8: Improve wording > >>> I disagree that this improves wording. The norm of action for > >>> "logging" in Unix is to "write to syslog", not "log to syslog". > >> Hmm, I agree, but here it is "log using syslog". > > Please read syslog(3) it is rather consistent about using > > "write to syslog". The action of calling syslog(3) is to > > "writes message to the system message logger." > > Obviously, we write to syslog but from what I remember the reason why we decided to change the > wording to "log using syscall" was that you don't write to the syslog(3) function, but you use it > instead. > > > > >> Have you got any idea how to further improve this sentence? > > No, but can we not degrade it? > > Sure. Would you like me to just revert it? Without beter wording that would be easy to do. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Jul 28 19:50:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3E34A373284; Tue, 28 Jul 2020 19:50:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGS2m0t8Tz3Z2h; Tue, 28 Jul 2020 19:50:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0153114524; Tue, 28 Jul 2020 19:50:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06SJodhZ066882; Tue, 28 Jul 2020 19:50:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06SJod0j066881; Tue, 28 Jul 2020 19:50:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007281950.06SJod0j066881@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 28 Jul 2020 19:50:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363654 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 363654 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 19:50:40 -0000 Author: markj Date: Tue Jul 28 19:50:39 2020 New Revision: 363654 URL: https://svnweb.freebsd.org/changeset/base/363654 Log: vm_page_xbusy_claim(): Use atomics to update busy lock state. vm_page_xbusy_claim() could clobber the waiter bit. For its original use, kernel memory pages, this was not a problem since nothing would ever block on the busy lock for such pages. r363607 introduced a new use where this could in principle be a problem. Fix the problem by using atomic_cmpset to update the lock owner. Since this macro is defined only for INVARIANTS kernels the extra overhead doesn't seem prohibitive. Reported by: vangyzen Reviewed by: alc, kib, vangyzen Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25859 Modified: head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Tue Jul 28 19:35:24 2020 (r363653) +++ head/sys/vm/vm_page.h Tue Jul 28 19:50:39 2020 (r363654) @@ -772,8 +772,13 @@ void vm_page_assert_pga_writeable(vm_page_t m, uint16_ #define VM_PAGE_ASSERT_PGA_WRITEABLE(m, bits) \ vm_page_assert_pga_writeable(m, bits) #define vm_page_xbusy_claim(m) do { \ + u_int _busy_lock; \ + \ vm_page_assert_xbusied_unchecked((m)); \ - (m)->busy_lock = VPB_CURTHREAD_EXCLUSIVE; \ + do { \ + _busy_lock = atomic_load_int(&(m)->busy_lock); \ + } while (!atomic_cmpset_int(&(m)->busy_lock, _busy_lock, \ + (_busy_lock & VPB_BIT_FLAGMASK) | VPB_CURTHREAD_EXCLUSIVE)); \ } while (0) #else #define VM_PAGE_OBJECT_BUSY_ASSERT(m) (void)0 From owner-svn-src-head@freebsd.org Tue Jul 28 20:06:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD80E373833; Tue, 28 Jul 2020 20:06:19 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGSNq5bryz3ZsD; Tue, 28 Jul 2020 20:06:19 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A08B51445E; Tue, 28 Jul 2020 20:06:19 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06SK6Jgf078716; Tue, 28 Jul 2020 20:06:19 GMT (envelope-from csjp@FreeBSD.org) Received: (from csjp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06SK6GmX078702; Tue, 28 Jul 2020 20:06:16 GMT (envelope-from csjp@FreeBSD.org) Message-Id: <202007282006.06SK6GmX078702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: csjp set sender to csjp@FreeBSD.org using -f From: "Christian S.J. Peron" Date: Tue, 28 Jul 2020 20:06:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363655 - in head/contrib/openbsm: . bin/auditd bin/auditdistd libauditd libbsm man sys/bsm X-SVN-Group: head X-SVN-Commit-Author: csjp X-SVN-Commit-Paths: in head/contrib/openbsm: . bin/auditd bin/auditdistd libauditd libbsm man sys/bsm X-SVN-Commit-Revision: 363655 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 20:06:19 -0000 Author: csjp Date: Tue Jul 28 20:06:16 2020 New Revision: 363655 URL: https://svnweb.freebsd.org/changeset/base/363655 Log: Fixup some incorrect information and some comments. These changes were cherry picked up the upstream OpenBSD repository. At some point we will look at doing another import, but the diffs are substantial and will require some careful testing. Differential Revision: https://reviews.freebsd.org/D25021 MFC after: 2 weeks Submitted by: gbe Reviewed by: myself, bcr Modified: head/contrib/openbsm/CREDITS head/contrib/openbsm/bin/auditd/auditd.c head/contrib/openbsm/bin/auditdistd/auditdistd.c head/contrib/openbsm/bin/auditdistd/proto_tls.c head/contrib/openbsm/libauditd/auditd_lib.c head/contrib/openbsm/libbsm/au_control.3 head/contrib/openbsm/libbsm/au_domain.3 head/contrib/openbsm/libbsm/au_errno.3 head/contrib/openbsm/libbsm/au_socket_type.3 head/contrib/openbsm/man/audit.log.5 head/contrib/openbsm/man/getaudit.2 head/contrib/openbsm/sys/bsm/audit.h Modified: head/contrib/openbsm/CREDITS ============================================================================== --- head/contrib/openbsm/CREDITS Tue Jul 28 19:50:39 2020 (r363654) +++ head/contrib/openbsm/CREDITS Tue Jul 28 20:06:16 2020 (r363655) @@ -36,6 +36,9 @@ the development of OpenBSM: Ryan Steinmetz The FreeBSD Foundation Brooks Davis + Mateusz Piotrowski + Alan Somers + Aniket Pandey In addition, Coverity, Inc.'s Prevent(tm) static analysis tool and Gimpel Software's FlexeLint tool were used to identify a number of bugs in the Modified: head/contrib/openbsm/bin/auditd/auditd.c ============================================================================== --- head/contrib/openbsm/bin/auditd/auditd.c Tue Jul 28 19:50:39 2020 (r363654) +++ head/contrib/openbsm/bin/auditd/auditd.c Tue Jul 28 20:06:16 2020 (r363655) @@ -712,7 +712,7 @@ auditd_config_controls(void) */ err = auditd_set_qsize(); if (err) { - auditd_log_err("audit_set_qsize() %s: %m", + auditd_log_err("auditd_set_qsize() %s: %m", auditd_strerror(err)); ret = -1; } else Modified: head/contrib/openbsm/bin/auditdistd/auditdistd.c ============================================================================== --- head/contrib/openbsm/bin/auditdistd/auditdistd.c Tue Jul 28 19:50:39 2020 (r363654) +++ head/contrib/openbsm/bin/auditdistd/auditdistd.c Tue Jul 28 20:06:16 2020 (r363655) @@ -523,7 +523,7 @@ main_loop(void) } TAILQ_FOREACH(adhost, &adcfg->adc_hosts, adh_next) { if (adhost->adh_role == ADIST_ROLE_SENDER) { - /* Only sender workers asks for connections. */ + /* Only sender workers ask for connections. */ PJDLOG_ASSERT(adhost->adh_conn != NULL); fd = proto_descriptor(adhost->adh_conn); PJDLOG_ASSERT(fd >= 0); Modified: head/contrib/openbsm/bin/auditdistd/proto_tls.c ============================================================================== --- head/contrib/openbsm/bin/auditdistd/proto_tls.c Tue Jul 28 19:50:39 2020 (r363654) +++ head/contrib/openbsm/bin/auditdistd/proto_tls.c Tue Jul 28 20:06:16 2020 (r363655) @@ -413,7 +413,7 @@ tls_exec_client(const char *user, int startfd, const c tls_certificate_verify(ssl, fingerprint); /* - * The following byte is send to make proto_connect_wait() to work. + * The following byte is sent to make proto_connect_wait() work. */ connected = 1; for (;;) { @@ -460,7 +460,7 @@ tls_call_exec_client(struct proto_conn *sock, const ch proto_close(sock); } else { /* - * The FD_CLOEXEC is cleared by dup2(2), so when we not + * The FD_CLOEXEC is cleared by dup2(2), so when we do not * call it, we have to clear it by hand in case it is set. */ if (fcntl(startfd, F_SETFD, 0) == -1) Modified: head/contrib/openbsm/libauditd/auditd_lib.c ============================================================================== --- head/contrib/openbsm/libauditd/auditd_lib.c Tue Jul 28 19:50:39 2020 (r363654) +++ head/contrib/openbsm/libauditd/auditd_lib.c Tue Jul 28 20:06:16 2020 (r363655) @@ -498,7 +498,7 @@ auditd_expire_trails(int (*warn_expired)(char *)) * update the mtime of the trail file to the current * time. This is so we don't prematurely remove a trail * file that was created while the system clock reset - * to the * "beginning of time" but later the system + * to the "beginning of time" but later the system * clock is set to the correct current time. */ if (current_time >= JAN_01_2000 && Modified: head/contrib/openbsm/libbsm/au_control.3 ============================================================================== --- head/contrib/openbsm/libbsm/au_control.3 Tue Jul 28 19:50:39 2020 (r363654) +++ head/contrib/openbsm/libbsm/au_control.3 Tue Jul 28 20:06:16 2020 (r363655) @@ -201,7 +201,7 @@ converts an audit policy flags string, .Fa polstr , to a numeric audit policy mask returned via .Fa policy . -.Sh RETURN VALULES +.Sh RETURN VALUES The .Fn getacfilesz , .Fn getacdir , Modified: head/contrib/openbsm/libbsm/au_domain.3 ============================================================================== --- head/contrib/openbsm/libbsm/au_domain.3 Tue Jul 28 19:50:39 2020 (r363654) +++ head/contrib/openbsm/libbsm/au_domain.3 Tue Jul 28 20:06:16 2020 (r363655) @@ -62,7 +62,7 @@ The function accepts a local domain, and returns the BSM domain for it. This call cannot fail, and instead returns a BSM domain indicating to a later decoder that the domain could not be encoded. -.Sh RETURN VALULES +.Sh RETURN VALUES On success, .Fn au_bsm_to_domain returns 0 and a converted domain; on failure, it returns -1 but does not set Modified: head/contrib/openbsm/libbsm/au_errno.3 ============================================================================== --- head/contrib/openbsm/libbsm/au_errno.3 Tue Jul 28 19:50:39 2020 (r363654) +++ head/contrib/openbsm/libbsm/au_errno.3 Tue Jul 28 20:06:16 2020 (r363655) @@ -76,7 +76,7 @@ function converts a BSM error value to a string, gener local error number and using the local .Xr strerror 3 function, but will also work for errors that are not locally defined. -.Sh RETURN VALULES +.Sh RETURN VALUES On success, .Fn au_bsm_to_errno returns 0 and a converted error value; on failure, it returns -1 but does not Modified: head/contrib/openbsm/libbsm/au_socket_type.3 ============================================================================== --- head/contrib/openbsm/libbsm/au_socket_type.3 Tue Jul 28 19:50:39 2020 (r363654) +++ head/contrib/openbsm/libbsm/au_socket_type.3 Tue Jul 28 20:06:16 2020 (r363655) @@ -61,7 +61,7 @@ operating system. function accepts a local socket type, and returns the BSM socket type for it. This call cannot fail, and instead returns a BSM socket type indicating to a later decoder that the socket type could not be encoded. -.Sh RETURN VALULES +.Sh RETURN VALUES On success, .Fn au_bsm_to_socket_type returns 0 and a converted socket type; on failure, it returns -1 but does not Modified: head/contrib/openbsm/man/audit.log.5 ============================================================================== --- head/contrib/openbsm/man/audit.log.5 Tue Jul 28 19:50:39 2020 (r363654) +++ head/contrib/openbsm/man/audit.log.5 Tue Jul 28 20:06:16 2020 (r363655) @@ -102,7 +102,7 @@ token can be created using .It Sy "Field Bytes Description" .It "Token ID 1 byte Token ID" .It "Record Byte Count 4 bytes Number of bytes in record" -.It "Version Number 2 bytes Record version number" +.It "Version Number 1 byte Record version number" .It "Event Type 2 bytes Event type" .It "Event Modifier 2 bytes Event sub-type" .It "Seconds 4/8 bytes Record time stamp (32/64-bits)" @@ -126,7 +126,7 @@ token can be created using .It Sy "Field Bytes Description" .It "Token ID 1 byte Token ID" .It "Record Byte Count 4 bytes Number of bytes in record" -.It "Version Number 2 bytes Record version number" +.It "Version Number 1 byte Record version number" .It "Event Type 2 bytes Event type" .It "Event Modifier 2 bytes Event sub-type" .It "Address Type/Length 1 byte Host address type and length" @@ -325,7 +325,7 @@ or .It "Process ID 4 bytes Process ID" .It "Session ID 4 bytes Audit session ID" .It "Terminal Port ID 4/8 bytes Terminal port ID (32/64-bits)" -.It "Terminal Address Type/Length 1 byte Length of machine address" +.It "Terminal Address Type/Length 4 bytes Length of machine address" .It "Terminal Machine Address 4 bytes IPv4 or IPv6 address of machine" .El .Ss Return Token Modified: head/contrib/openbsm/man/getaudit.2 ============================================================================== --- head/contrib/openbsm/man/getaudit.2 Tue Jul 28 19:50:39 2020 (r363654) +++ head/contrib/openbsm/man/getaudit.2 Tue Jul 28 20:06:16 2020 (r363655) @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 19, 2008 +.Dd March 14, 2018 .Dt GETAUDIT 2 .Os .Sh NAME @@ -62,6 +62,7 @@ struct auditinfo { au_mask_t ai_mask; /* Audit masks */ au_tid_t ai_termid; /* Terminal ID */ au_asid_t ai_asid; /* Audit session ID */ + au_asflgs_t ai_flags; /* Audit session flags. */ }; typedef struct auditinfo auditinfo_t; .Ed Modified: head/contrib/openbsm/sys/bsm/audit.h ============================================================================== --- head/contrib/openbsm/sys/bsm/audit.h Tue Jul 28 19:50:39 2020 (r363654) +++ head/contrib/openbsm/sys/bsm/audit.h Tue Jul 28 20:06:16 2020 (r363655) @@ -46,7 +46,7 @@ #define MIN_AUDIT_FILE_SIZE (512 * 1024) /* - * Minimum noumber of free blocks on the filesystem containing the audit + * Minimum number of free blocks on the filesystem containing the audit * log necessary to avoid a hard log rotation. DO NOT SET THIS VALUE TO 0 * as the kernel does an unsigned compare, plus we want to leave a few blocks * free so userspace can terminate the log, etc. @@ -249,14 +249,14 @@ typedef struct au_token token_t; /* * Kernel audit queue control parameters: * Default: Maximum: - * aq_hiwater: AQ_HIWATER (100) AQ_MAXHIGH (10000) + * aq_hiwater: AQ_HIWATER (100) AQ_MAXHIGH (10000) * aq_lowater: AQ_LOWATER (10) Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AAFBC373ABE; Tue, 28 Jul 2020 20:18:42 +0000 (UTC) (envelope-from csjp@ion.sqrt.ca) Received: from ion.sqrt.ca (ion.sqrt.ca [192.73.242.220]) by mx1.freebsd.org (Postfix) with ESMTP id 4BGSg62VQSz3bMK; Tue, 28 Jul 2020 20:18:42 +0000 (UTC) (envelope-from csjp@ion.sqrt.ca) Received: by ion.sqrt.ca (Postfix, from userid 1000) id 40CC981A1D; Tue, 28 Jul 2020 13:18:36 -0700 (PDT) Date: Tue, 28 Jul 2020 13:18:36 -0700 From: Christian Peron To: "Christian S.J. Peron" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r363655 - in head/contrib/openbsm: . bin/auditd bin/auditdistd libauditd libbsm man sys/bsm Message-ID: <20200728201836.GA31178@ion.sqrt.ca> References: <202007282006.06SK6GmX078702@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202007282006.06SK6GmX078702@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Rspamd-Queue-Id: 4BGSg62VQSz3bMK X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36236, ipnet:192.73.242.0/24, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 20:18:42 -0000 On Tue, Jul 28, 2020 at 08:06:16PM +0000, Christian S.J. Peron wrote: > Author: csjp > Date: Tue Jul 28 20:06:16 2020 > New Revision: 363655 > URL: https://svnweb.freebsd.org/changeset/base/363655 > > Log: > Fixup some incorrect information and some comments. These changes > were cherry picked up the upstream OpenBSD repository. At some point we ^ This should be OpenBSM :) From owner-svn-src-head@freebsd.org Tue Jul 28 22:32:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C1BA537646D; Tue, 28 Jul 2020 22:32:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGWdt4mMKz406Q; Tue, 28 Jul 2020 22:32:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8772E16481; Tue, 28 Jul 2020 22:32:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06SMWovq071104; Tue, 28 Jul 2020 22:32:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06SMWob3071103; Tue, 28 Jul 2020 22:32:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202007282232.06SMWob3071103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 28 Jul 2020 22:32:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363656 - head/usr.sbin/ctld X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/usr.sbin/ctld X-SVN-Commit-Revision: 363656 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 22:32:50 -0000 Author: mav Date: Tue Jul 28 22:32:50 2020 New Revision: 363656 URL: https://svnweb.freebsd.org/changeset/base/363656 Log: When modifying LUN pass "special" options too. Before switching to nvlists CTL merged previous and new options, so any options not passed just kept previous value. Now CTL completely replaces them, so we must pass everything still relevant. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/usr.sbin/ctld/kernel.c Modified: head/usr.sbin/ctld/kernel.c ============================================================================== --- head/usr.sbin/ctld/kernel.c Tue Jul 28 20:06:16 2020 (r363655) +++ head/usr.sbin/ctld/kernel.c Tue Jul 28 22:32:50 2020 (r363656) @@ -777,6 +777,30 @@ kernel_lun_modify(struct lun *lun) req.reqdata.modify.lun_id = lun->l_ctl_lun; req.reqdata.modify.lun_size_bytes = lun->l_size; + if (lun->l_path != NULL) { + o = option_find(&lun->l_options, "file"); + if (o != NULL) { + option_set(o, lun->l_path); + } else { + o = option_new(&lun->l_options, "file", lun->l_path); + assert(o != NULL); + } + } + + o = option_find(&lun->l_options, "ctld_name"); + if (o != NULL) { + option_set(o, lun->l_name); + } else { + o = option_new(&lun->l_options, "ctld_name", lun->l_name); + assert(o != NULL); + } + + o = option_find(&lun->l_options, "scsiname"); + if (o == NULL && lun->l_scsiname != NULL) { + o = option_new(&lun->l_options, "scsiname", lun->l_scsiname); + assert(o != NULL); + } + if (!TAILQ_EMPTY(&lun->l_options)) { req.args_nvl = nvlist_create(0); if (req.args_nvl == NULL) { From owner-svn-src-head@freebsd.org Wed Jul 29 00:34:25 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4EFEB3784C6; Wed, 29 Jul 2020 00:34:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGZL91DfPz455W; Wed, 29 Jul 2020 00:34:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D425175F2; Wed, 29 Jul 2020 00:34:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06T0YO6U044583; Wed, 29 Jul 2020 00:34:24 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06T0YOPQ044582; Wed, 29 Jul 2020 00:34:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202007290034.06T0YOPQ044582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 29 Jul 2020 00:34:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363657 - head/crypto/openssh X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/crypto/openssh X-SVN-Commit-Revision: 363657 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2020 00:34:25 -0000 Author: emaste Date: Wed Jul 29 00:34:24 2020 New Revision: 363657 URL: https://svnweb.freebsd.org/changeset/base/363657 Log: sshd: allow UseBlocklist alias for UseBlacklist blacklistd has been renamed to blocklistd upstream, and a future import into FreeBSD will follow that change. Support the new name as an alias in config files. Reviewed by: bz, delphij MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25865 Modified: head/crypto/openssh/servconf.c head/crypto/openssh/sshd_config.5 Modified: head/crypto/openssh/servconf.c ============================================================================== --- head/crypto/openssh/servconf.c Tue Jul 28 22:32:50 2020 (r363656) +++ head/crypto/openssh/servconf.c Wed Jul 29 00:34:24 2020 (r363657) @@ -660,6 +660,7 @@ static struct { { "rdomain", sRDomain, SSHCFG_ALL }, { "casignaturealgorithms", sCASignatureAlgorithms, SSHCFG_ALL }, { "useblacklist", sUseBlacklist, SSHCFG_GLOBAL }, + { "useblocklist", sUseBlacklist, SSHCFG_GLOBAL }, /* alias */ { "noneenabled", sUnsupported, SSHCFG_ALL }, { "hpndisabled", sDeprecated, SSHCFG_ALL }, { "hpnbuffersize", sDeprecated, SSHCFG_ALL }, Modified: head/crypto/openssh/sshd_config.5 ============================================================================== --- head/crypto/openssh/sshd_config.5 Tue Jul 28 22:32:50 2020 (r363656) +++ head/crypto/openssh/sshd_config.5 Wed Jul 29 00:34:24 2020 (r363657) @@ -35,7 +35,7 @@ .\" .\" $OpenBSD: sshd_config.5,v 1.282 2018/09/20 03:28:06 djm Exp $ .\" $FreeBSD$ -.Dd $Mdocdate: September 20 2018 $ +.Dd $Mdocdate: July 28 2020 $ .Dt SSHD_CONFIG 5 .Os .Sh NAME @@ -1602,6 +1602,11 @@ to the daemon. The default is .Cm no . +For forward compatibility with an upcoming +.Xr blacklistd +rename, the +.Cm UseBlocklist +alias can be used instead. .It Cm UseDNS Specifies whether .Xr sshd 8 From owner-svn-src-head@freebsd.org Wed Jul 29 05:27:20 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBD5137E86E; Wed, 29 Jul 2020 05:27:20 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGhr84NkJz4KnB; Wed, 29 Jul 2020 05:27:20 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7586A1B08F; Wed, 29 Jul 2020 05:27:20 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06T5RKaE025227; Wed, 29 Jul 2020 05:27:20 GMT (envelope-from rew@FreeBSD.org) Received: (from rew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06T5RK0L025226; Wed, 29 Jul 2020 05:27:20 GMT (envelope-from rew@FreeBSD.org) Message-Id: <202007290527.06T5RK0L025226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rew set sender to rew@FreeBSD.org using -f From: Robert Wing Date: Wed, 29 Jul 2020 05:27:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363659 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: rew X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 363659 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2020 05:27:20 -0000 Author: rew Date: Wed Jul 29 05:27:19 2020 New Revision: 363659 URL: https://svnweb.freebsd.org/changeset/base/363659 Log: Add myself (rew) as src committer. Reviewed by: kevans (mentor), allanjude (mentor) Approved by: kevans (mentor), allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D25837 Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Jul 29 04:36:45 2020 (r363658) +++ head/share/misc/committers-src.dot Wed Jul 29 05:27:19 2020 (r363659) @@ -300,6 +300,7 @@ ram [label="Ram Kishore Vegesna\nram@FreeBSD.org\n2018 ray [label="Aleksandr Rybalko\nray@FreeBSD.org\n2011/05/25"] rdivacky [label="Roman Divacky\nrdivacky@FreeBSD.org\n2008/03/13"] remko [label="Remko Lodder\nremko@FreeBSD.org\n2007/02/23"] +rew [label="Robert Wing\nrew@FreeBSD.org\n2020/07/23"] rgrimes [label="Rodney W. Grimes\nrgrimes@FreeBSD.org\n1993/06/12\n2017/03/03"] rik [label="Roman Kurakin\nrik@FreeBSD.org\n2003/12/18"] rlibby [label="Ryan Libby\nrlibby@FreeBSD.org\n2017/06/07"] @@ -404,6 +405,7 @@ adrian -> sgalabov ae -> melifaro +allanjude -> rew allanjude -> tsoome alc -> davide @@ -672,6 +674,8 @@ ken -> chuck ken -> ram ken -> slm ken -> will + +kevans -> rew kib -> ae kib -> badger From owner-svn-src-head@freebsd.org Wed Jul 29 08:24:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED68F3A3880; Wed, 29 Jul 2020 08:24:40 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGmmm60MBz4TYx; Wed, 29 Jul 2020 08:24:40 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B295D1D07F; Wed, 29 Jul 2020 08:24:40 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06T8OeW8035467; Wed, 29 Jul 2020 08:24:40 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06T8Oev4035466; Wed, 29 Jul 2020 08:24:40 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202007290824.06T8Oev4035466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 29 Jul 2020 08:24:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363660 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 363660 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2020 08:24:41 -0000 Author: andrew Date: Wed Jul 29 08:24:40 2020 New Revision: 363660 URL: https://svnweb.freebsd.org/changeset/base/363660 Log: Only try managing the regulator when EXT_RESOURCES is defined Not all Raspberry Pi kernel configs define EXT_RESOURCES. Check for this before trying to manage the regulator. Sponsored by: Innovate UK Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Wed Jul 29 05:27:19 2020 (r363659) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Wed Jul 29 08:24:40 2020 (r363660) @@ -394,10 +394,13 @@ bcm_sdhci_intr(void *arg) static int bcm_sdhci_update_ios(device_t bus, device_t child) { +#ifdef EXT_RESOURCES struct bcm_sdhci_softc *sc; struct mmc_ios *ios; +#endif int rv; +#ifdef EXT_RESOURCES sc = device_get_softc(bus); ios = &sc->sc_slot.host.ios; @@ -407,17 +410,20 @@ bcm_sdhci_update_ios(device_t bus, device_t child) if (sc->sc_mmc_helper.vqmmc_supply) regulator_enable(sc->sc_mmc_helper.vqmmc_supply); } +#endif rv = sdhci_generic_update_ios(bus, child); if (rv != 0) return (rv); +#ifdef EXT_RESOURCES if (ios->power_mode == power_off) { if (sc->sc_mmc_helper.vmmc_supply) regulator_disable(sc->sc_mmc_helper.vmmc_supply); if (sc->sc_mmc_helper.vqmmc_supply) regulator_disable(sc->sc_mmc_helper.vqmmc_supply); } +#endif return (0); } From owner-svn-src-head@freebsd.org Wed Jul 29 09:43:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 40CEF3A5A4F; Wed, 29 Jul 2020 09:43:58 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay104.isp.belgacom.be (mailrelay104.isp.belgacom.be [195.238.20.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign RSA OV SSL CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGpXD42sFz4Z02; Wed, 29 Jul 2020 09:43:56 +0000 (UTC) (envelope-from tijl@freebsd.org) IronPort-SDR: 6RqUIZCjavrFaRBhDCZcoUjwjOoW5c/x3CF1MWd4ZsZiVN5+faOFlQDo1wgBzqIi9O/yYVk18O 9wVPz6tO7KtH6ZU12y/HFuw5VPRxlb74+//keOv5r4bOxj20ZGZeKtyeoIH7Ku5xb2TmoWkNzG fSGEPH3pYzWx1E2bDoguDIr6XExVJkVw+OBZ4DcPbgE8VPijEZ9GKHXofc4EoU32VJ1wLa9y/k dmHA3E36ZlK0Ull5nTE8DG+9wJ9+y9Cnkp83gBfvAcBkNG5eWJQEby7Kfs0lOi8x+/MEd/EUFj sRc= X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3AkR7oVxZrku5dhaTBdDY31Kj/LSx+4OfEezUN45?= =?us-ascii?q?9isYplN5qZpsyyYh7h7PlgxGXEQZ/co6odzbaP7ea+BSdZvt6oizMrSNR0TR?= =?us-ascii?q?gLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpTEdFQ?= =?us-ascii?q?/iOgVrO+/7BpDdj9it1+C15pbffxhEiCCybL9vLRi6twTcu8YZjYd/KKs61w?= =?us-ascii?q?fErGZPd+lK321jOEidnwz75se+/Z5j9zpftvc8/MNeUqv0Yro1Q6VAADspL2?= =?us-ascii?q?466svrtQLeTQSU/XsTTn8WkhtTDAfb6hzxQ4r8vTH7tup53ymaINH2QLUpUj?= =?us-ascii?q?ms86tnVBnlgzocOjUn7G/YlNB/jKNDoBKguRN/xZLUYJqIP/Z6Z6/RYM8WSX?= =?us-ascii?q?ZEUstXSidPAJ6zb5EXAuQPPehWsZTzqVgMohuwCgajGOzhxyRUhnL0x6A2z/?= =?us-ascii?q?gtHR3Y0AEmAtkAsG7UrNLwNKoKT+63ya3IxijdYvNR3jf985bHchU7rvGKRr?= =?us-ascii?q?J7bM3cyVUuFwPHilWdsozrPymL2esTrmWV8uRuWfioi249pAF8uz6izdojhY?= =?us-ascii?q?fVnIwa0EzE9Tlnz4YvI921UFB2bNq5HZZesyyXK4h7T80+Tm12pis3yaALtY?= =?us-ascii?q?C/cSUOyZkq2gPSZuKJfYWH7B/uUOmfLCpkiHxqeb+ymhe//0amx+bhWMe011?= =?us-ascii?q?NKoTBEktnKrn0N2QbT5daZRfRm5UeuxCyD1wfJ6uFLJ00/iKnVK4Y5z7Mzi5?= =?us-ascii?q?Yfq1rPEyDqlEnsg6KbdF8o9vWs5unjZLjtu4WSOJVuig7kN6Qjgsm/AeMlPQ?= =?us-ascii?q?cQR2Wb4uG81KH7/U3+XbVKkuU6kqnHv5DeIsQWvq25DBVR0oYi7hawES2m0N?= =?us-ascii?q?MCkXkbLVJFehaHg5L1NFHJJ/D4Fumwg1G2nzdt3PDKJLrhAo/CLnTbkbfhe6?= =?us-ascii?q?hy61JExQcw0NxT/YxYB74dLP7pVUL8tsbUAgI9PgGw2+rnDc9y1oIaWWKBGK?= =?us-ascii?q?+ZN6bSvEeU5uIuIemMYJQYuDjnK/c7+fHhlmQ5lkIHcamux5sXZ2i0Hu56LE?= =?us-ascii?q?WBfXrsntABHH8RvgogSuzmkUaCUSRPaHqrX6Iz+Cs0B5+9AIfNXICinqKO0z?= =?us-ascii?q?ygHpJLfGxGDUqMEXjwfYWeR/gMcD6SItNmkjEcTrihVYkh2Qi1tA/g17VrN/?= =?us-ascii?q?Db+ikctZ/42th1/fPcmg8p+jxvEsuRyWaNT3t7nmkQXT85wLh/oVBhyleEya?= =?us-ascii?q?V4mOZYGsBK6/xVVQc6MJvcz+1mC9DuRA3BZMyJRU2oQtW8Hz4+UMk+w8QTbE?= =?us-ascii?q?pnHNWilB/D1TKwA7AJj7yLGIA08qXE0nfvIsZy0W3G1LU/gFQ9TMtPL3Opib?= =?us-ascii?q?Bk+AjIGoHFiUKZl7yldfdU4CmY2WvL6GOVoEwQBAN1WL7ZUFgxfEbbh+/VoE?= =?us-ascii?q?TYQOn9J64gN159LsrKAaxNcdDshFNdDKP/OdbaS0yrlmqaPjrOwamDOtm5M1?= =?us-ascii?q?4B1TnQXRBX2zsY+myLYE1nXn+s?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2BfAACIRCFf/8cv8FFgHAEBAQEBAQc?= =?us-ascii?q?BARIBAQQEAQFAB4ExBQEBCwEBgwMUVAFJFY02hgaCEIhdgiWPDYF9CwEBAQE?= =?us-ascii?q?BAQEBASsMBAEBhEwCgiQlNgcOAgMBAQEDAgUBAQYBAQEBAQEFBAGGDzkMQwE?= =?us-ascii?q?QAYFiKQGDEQEFOhwjEAsOBgQuVwYTgyeDAAuud4E0hDsBCwGBCoQRfwaBOAG?= =?us-ascii?q?GO4UIgV2CAIERgxA+hD2FdgSZb4EYmgtygmmIW5ETMJ90hVCXApZuCoIATTA?= =?us-ascii?q?IO4JpUBkNlyOFRD8DMDcCBggBAQMJiQCHaAEB?= X-IPAS-Result: =?us-ascii?q?A2BfAACIRCFf/8cv8FFgHAEBAQEBAQcBARIBAQQEAQFAB?= =?us-ascii?q?4ExBQEBCwEBgwMUVAFJFY02hgaCEIhdgiWPDYF9CwEBAQEBAQEBASsMBAEBh?= =?us-ascii?q?EwCgiQlNgcOAgMBAQEDAgUBAQYBAQEBAQEFBAGGDzkMQwEQAYFiKQGDEQEFO?= =?us-ascii?q?hwjEAsOBgQuVwYTgyeDAAuud4E0hDsBCwGBCoQRfwaBOAGGO4UIgV2CAIERg?= =?us-ascii?q?xA+hD2FdgSZb4EYmgtygmmIW5ETMJ90hVCXApZuCoIATTAIO4JpUBkNlyOFR?= =?us-ascii?q?D8DMDcCBggBAQMJiQCHaAEB?= Received: from 199.47-240-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.240.47.199]) by relay.skynet.be with ESMTP; 29 Jul 2020 11:43:23 +0200 Received: from localhost (localhost [127.0.0.1]) by kalimero.tijl.coosemans.org (8.16.1/8.16.1) with ESMTP id 06T9hMAM016702; Wed, 29 Jul 2020 11:43:22 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Wed, 29 Jul 2020 11:43:22 +0200 From: =?UTF-8?B?VMSzbA==?= Coosemans To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r363657 - head/crypto/openssh Message-ID: <20200729114322.4ff17fde@FreeBSD.org> In-Reply-To: <202007290034.06T0YOPQ044582@repo.freebsd.org> References: <202007290034.06T0YOPQ044582@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BGpXD42sFz4Z02 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:5432, ipnet:195.238.0.0/19, country:BE] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2020 09:43:58 -0000 On Wed, 29 Jul 2020 00:34:24 +0000 (UTC) Ed Maste wrote: > Author: emaste > Date: Wed Jul 29 00:34:24 2020 > New Revision: 363657 > URL: https://svnweb.freebsd.org/changeset/base/363657 > > Log: > sshd: allow UseBlocklist alias for UseBlacklist > > blacklistd has been renamed to blocklistd upstream, and a future > import into FreeBSD will follow that change. Support the new name > as an alias in config files. > > Reviewed by: bz, delphij > MFC after: 1 week > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D25865 > > Modified: > head/crypto/openssh/servconf.c > head/crypto/openssh/sshd_config.5 > > Modified: head/crypto/openssh/servconf.c > ============================================================================== > --- head/crypto/openssh/servconf.c Tue Jul 28 22:32:50 2020 (r363656) > +++ head/crypto/openssh/servconf.c Wed Jul 29 00:34:24 2020 (r363657) > @@ -660,6 +660,7 @@ static struct { > { "rdomain", sRDomain, SSHCFG_ALL }, > { "casignaturealgorithms", sCASignatureAlgorithms, SSHCFG_ALL }, > { "useblacklist", sUseBlacklist, SSHCFG_GLOBAL }, > + { "useblocklist", sUseBlacklist, SSHCFG_GLOBAL }, /* alias */ > { "noneenabled", sUnsupported, SSHCFG_ALL }, > { "hpndisabled", sDeprecated, SSHCFG_ALL }, > { "hpnbuffersize", sDeprecated, SSHCFG_ALL }, > > Modified: head/crypto/openssh/sshd_config.5 > ============================================================================== > --- head/crypto/openssh/sshd_config.5 Tue Jul 28 22:32:50 2020 (r363656) > +++ head/crypto/openssh/sshd_config.5 Wed Jul 29 00:34:24 2020 (r363657) > @@ -35,7 +35,7 @@ > .\" > .\" $OpenBSD: sshd_config.5,v 1.282 2018/09/20 03:28:06 djm Exp $ > .\" $FreeBSD$ > -.Dd $Mdocdate: September 20 2018 $ > +.Dd $Mdocdate: July 28 2020 $ > .Dt SSHD_CONFIG 5 > .Os > .Sh NAME > @@ -1602,6 +1602,11 @@ to the > daemon. > The default is > .Cm no . > +For forward compatibility with an upcoming > +.Xr blacklistd > +rename, the > +.Cm UseBlocklist I realise this is very pedantic, but my spell checker says it's "block list", two words, so if you're using camel case it should be UseBlockList. From owner-svn-src-head@freebsd.org Wed Jul 29 11:17:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D2F4E3A7CEA; Wed, 29 Jul 2020 11:17:44 +0000 (UTC) (envelope-from debdrup@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGrcS5H73z4fYc; Wed, 29 Jul 2020 11:17:44 +0000 (UTC) (envelope-from debdrup@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9894E1F0A7; Wed, 29 Jul 2020 11:17:44 +0000 (UTC) (envelope-from debdrup@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06TBHi59039365; Wed, 29 Jul 2020 11:17:44 GMT (envelope-from debdrup@FreeBSD.org) Received: (from debdrup@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06TBHiDE039362; Wed, 29 Jul 2020 11:17:44 GMT (envelope-from debdrup@FreeBSD.org) Message-Id: <202007291117.06TBHiDE039362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: debdrup set sender to debdrup@FreeBSD.org using -f From: Daniel Ebdrup Jensen Date: Wed, 29 Jul 2020 11:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363661 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: debdrup X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 363661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2020 11:17:44 -0000 Author: debdrup (doc committer) Date: Wed Jul 29 11:17:44 2020 New Revision: 363661 URL: https://svnweb.freebsd.org/changeset/base/363661 Log: Outline mentorship As part of onboarding and while listening to Holy Ghost by The Bar-Kays, outline my mentorship. 0mp is mentor, with allanjude and bcr as co-mentor. Reviewed by: 0mp, allanjude, bcr Approved by: 0mp (mentor), allanjude (mentor), bcr (mentor) Differential Revision: D25855 Modified: head/share/misc/committers-doc.dot Modified: head/share/misc/committers-doc.dot ============================================================================== --- head/share/misc/committers-doc.dot Wed Jul 29 08:24:40 2020 (r363660) +++ head/share/misc/committers-doc.dot Wed Jul 29 11:17:44 2020 (r363661) @@ -62,6 +62,7 @@ carlavilla [label="Sergio Carlavilla\ncarlavilla@FreeB chinsan [label="Chinsan Huang\nchinsan@FreeBSD.org\n2006/09/20"] crees [label="Chris Rees\ncrees@FreeBSD.org\n2013/05/27"] danger [label="Daniel Gerzo\ndanger@FreeBSD.org\n2006/08/20"] +debdrup [label="Daniel Ebdrup Jensen\ndebdrup@FreeBSD.org\n2020/07/26"] delphij [label="Xin Li\ndelphij@FreeBSD.org\n2004/09/14"] dexter [label="Michael Dexter\ndexter@FreeBSD.org\n2016/11/15"] dru [label="Dru Lavigne\ndru@FreeBSD.org\n2013/01/22"] @@ -103,6 +104,10 @@ zeising [label="Niclas Zeising\nzeising@FreeBSD.org\n2 # Group together all the mentees for a particular mentor. # Keep the list sorted by mentor login. +"0mp" -> debdrup + +allanjude -> debdrup + bcr -> gavin bcr -> wblock bcr -> eadler @@ -117,6 +122,7 @@ bcr -> sg bcr -> carlavilla bcr -> "0mp" bcr -> gbe +bcr -> debdrup blackend -> ale From owner-svn-src-head@freebsd.org Wed Jul 29 11:19:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 918903A7E10; Wed, 29 Jul 2020 11:19:58 +0000 (UTC) (envelope-from debdrup@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGrg23HfYz4flf; Wed, 29 Jul 2020 11:19:58 +0000 (UTC) (envelope-from debdrup@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 542FD1F02D; Wed, 29 Jul 2020 11:19:58 +0000 (UTC) (envelope-from debdrup@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06TBJwfC039502; Wed, 29 Jul 2020 11:19:58 GMT (envelope-from debdrup@FreeBSD.org) Received: (from debdrup@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06TBJw8v039501; Wed, 29 Jul 2020 11:19:58 GMT (envelope-from debdrup@FreeBSD.org) Message-Id: <202007291119.06TBJw8v039501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: debdrup set sender to debdrup@FreeBSD.org using -f From: Daniel Ebdrup Jensen Date: Wed, 29 Jul 2020 11:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363662 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: debdrup X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 363662 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2020 11:19:58 -0000 Author: debdrup (doc committer) Date: Wed Jul 29 11:19:57 2020 New Revision: 363662 URL: https://svnweb.freebsd.org/changeset/base/363662 Log: Add my entry to the calendar file As part of onboarding, ensure that I'm listed in the FreeBSD calendar file, while listening to Don't Take Away The Music by Tavares. Reviewed by: 0mp, bcr Approved by: 0mp (mentor), allanjude (mentor) Differential Revision: D25856 Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Wed Jul 29 11:17:44 2020 (r363661) +++ head/usr.bin/calendar/calendars/calendar.freebsd Wed Jul 29 11:19:57 2020 (r363662) @@ -404,6 +404,7 @@ 10/20 Joel Dahl born in Bitterna, Skaraborg, Sweden, 1983 10/20 Dmitry Marakasov born in Moscow, Russian Federation, 1984 10/21 Ben Smithurst born in Sheffield, South Yorkshire, United Kingdom, 1981 +10/21 Daniel Ebdrup Jensen born in Aalborg, Denmark, 19XX 10/22 Jean-Sebastien Pedron born in Redon, Ille-et-Vilaine, France, 1980 10/23 Mario Sergio Fujikawa Ferreira born in Brasilia, Distrito Federal, Brazil, 1976 10/23 Romain Tartière born in Clermont-Ferrand, France, 1984 From owner-svn-src-head@freebsd.org Wed Jul 29 13:23:29 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 728EC3AACA6; Wed, 29 Jul 2020 13:23:29 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGvPY2N8Mz3Xkp; Wed, 29 Jul 2020 13:23:29 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 34EB8203FD; Wed, 29 Jul 2020 13:23:29 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06TDNS9I019489; Wed, 29 Jul 2020 13:23:28 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06TDNSdU019484; Wed, 29 Jul 2020 13:23:28 GMT (envelope-from br@FreeBSD.org) Message-Id: <202007291323.06TDNSdU019484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 29 Jul 2020 13:23:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363663 - in head/sys: dev/iommu x86/include x86/iommu X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: dev/iommu x86/include x86/iommu X-SVN-Commit-Revision: 363663 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2020 13:23:29 -0000 Author: br Date: Wed Jul 29 13:23:27 2020 New Revision: 363663 URL: https://svnweb.freebsd.org/changeset/base/363663 Log: o Move iommu_set_buswide_ctx, iommu_is_buswide_ctx to the generic iommu busdma backend; o Move bus_dma_iommu_set_buswide, bus_dma_iommu_load_ident prototypes to iommu.h. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D25866 Modified: head/sys/dev/iommu/busdma_iommu.c head/sys/dev/iommu/iommu.h head/sys/x86/include/bus_dma.h head/sys/x86/iommu/intel_dmar.h head/sys/x86/iommu/intel_drv.c Modified: head/sys/dev/iommu/busdma_iommu.c ============================================================================== --- head/sys/dev/iommu/busdma_iommu.c Wed Jul 29 11:19:57 2020 (r363662) +++ head/sys/dev/iommu/busdma_iommu.c Wed Jul 29 13:23:27 2020 (r363663) @@ -326,6 +326,26 @@ bus_dma_iommu_set_buswide(device_t dev) return (true); } +void +iommu_set_buswide_ctx(struct iommu_unit *unit, u_int busno) +{ + + MPASS(busno <= PCI_BUSMAX); + IOMMU_LOCK(unit); + unit->buswide_ctxs[busno / NBBY / sizeof(uint32_t)] |= + 1 << (busno % (NBBY * sizeof(uint32_t))); + IOMMU_UNLOCK(unit); +} + +bool +iommu_is_buswide_ctx(struct iommu_unit *unit, u_int busno) +{ + + MPASS(busno <= PCI_BUSMAX); + return ((unit->buswide_ctxs[busno / NBBY / sizeof(uint32_t)] & + (1U << (busno % (NBBY * sizeof(uint32_t))))) != 0); +} + static MALLOC_DEFINE(M_IOMMU_DMAMAP, "iommu_dmamap", "IOMMU DMA Map"); static void iommu_bus_schedule_dmamap(struct iommu_unit *unit, Modified: head/sys/dev/iommu/iommu.h ============================================================================== --- head/sys/dev/iommu/iommu.h Wed Jul 29 11:19:57 2020 (r363662) +++ head/sys/dev/iommu/iommu.h Wed Jul 29 13:23:27 2020 (r363663) @@ -221,6 +221,13 @@ int iommu_gas_map_region(struct iommu_domain *domain, int iommu_gas_reserve_region(struct iommu_domain *domain, iommu_gaddr_t start, iommu_gaddr_t end); +void iommu_set_buswide_ctx(struct iommu_unit *unit, u_int busno); +bool iommu_is_buswide_ctx(struct iommu_unit *unit, u_int busno); + +bool bus_dma_iommu_set_buswide(device_t dev); +int bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_paddr_t start, vm_size_t length, int flags); + SYSCTL_DECL(_hw_iommu); #endif /* !_SYS_IOMMU_H_ */ Modified: head/sys/x86/include/bus_dma.h ============================================================================== --- head/sys/x86/include/bus_dma.h Wed Jul 29 11:19:57 2020 (r363662) +++ head/sys/x86/include/bus_dma.h Wed Jul 29 13:23:27 2020 (r363663) @@ -191,11 +191,5 @@ _bus_dmamap_complete(bus_dma_tag_t dmat, bus_dmamap_t return (tc->impl->map_complete(dmat, map, segs, nsegs, error)); } -#ifdef _KERNEL -bool bus_dma_iommu_set_buswide(device_t dev); -int bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map, - vm_paddr_t start, vm_size_t length, int flags); -#endif - #endif /* !_X86_BUS_DMA_H_ */ Modified: head/sys/x86/iommu/intel_dmar.h ============================================================================== --- head/sys/x86/iommu/intel_dmar.h Wed Jul 29 11:19:57 2020 (r363662) +++ head/sys/x86/iommu/intel_dmar.h Wed Jul 29 13:23:27 2020 (r363663) @@ -281,9 +281,6 @@ void dmar_quirks_pre_use(struct iommu_unit *dmar); int dmar_init_irt(struct dmar_unit *unit); void dmar_fini_irt(struct dmar_unit *unit); -void iommu_set_buswide_ctx(struct iommu_unit *unit, u_int busno); -bool iommu_is_buswide_ctx(struct iommu_unit *unit, u_int busno); - extern iommu_haddr_t dmar_high; extern int haw; extern int dmar_tbl_pagecnt; Modified: head/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Wed Jul 29 11:19:57 2020 (r363662) +++ head/sys/x86/iommu/intel_drv.c Wed Jul 29 13:23:27 2020 (r363663) @@ -592,26 +592,6 @@ static driver_t dmar_driver = { DRIVER_MODULE(dmar, acpi, dmar_driver, dmar_devclass, 0, 0); MODULE_DEPEND(dmar, acpi, 1, 1, 1); -void -iommu_set_buswide_ctx(struct iommu_unit *unit, u_int busno) -{ - - MPASS(busno <= PCI_BUSMAX); - IOMMU_LOCK(unit); - unit->buswide_ctxs[busno / NBBY / sizeof(uint32_t)] |= - 1 << (busno % (NBBY * sizeof(uint32_t))); - IOMMU_UNLOCK(unit); -} - -bool -iommu_is_buswide_ctx(struct iommu_unit *unit, u_int busno) -{ - - MPASS(busno <= PCI_BUSMAX); - return ((unit->buswide_ctxs[busno / NBBY / sizeof(uint32_t)] & - (1U << (busno % (NBBY * sizeof(uint32_t))))) != 0); -} - static void dmar_print_path(int busno, int depth, const ACPI_DMAR_PCI_PATH *path) { From owner-svn-src-head@freebsd.org Wed Jul 29 15:46:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F213B3AD3B3; Wed, 29 Jul 2020 15:46:17 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BGyZK6FVFz3gYh; Wed, 29 Jul 2020 15:46:17 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAFA8222B2; Wed, 29 Jul 2020 15:46:17 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06TFkHFF005513; Wed, 29 Jul 2020 15:46:17 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06TFkHMH005512; Wed, 29 Jul 2020 15:46:17 GMT (envelope-from br@FreeBSD.org) Message-Id: <202007291546.06TFkHMH005512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 29 Jul 2020 15:46:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363666 - head/sys/dev/ntb/ntb_hw X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/ntb/ntb_hw X-SVN-Commit-Revision: 363666 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2020 15:46:18 -0000 Author: br Date: Wed Jul 29 15:46:17 2020 New Revision: 363666 URL: https://svnweb.freebsd.org/changeset/base/363666 Log: Fix build. Reviewed by: kib Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D25879 Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Wed Jul 29 14:33:31 2020 (r363665) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Wed Jul 29 15:46:17 2020 (r363666) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "ntb_hw_intel.h" #include "../ntb.h" Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Wed Jul 29 14:33:31 2020 (r363665) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Wed Jul 29 15:46:17 2020 (r363666) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "../ntb.h" From owner-svn-src-head@freebsd.org Wed Jul 29 17:04:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25BE13AEB74; Wed, 29 Jul 2020 17:04:34 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BH0Jd75g7z422H; Wed, 29 Jul 2020 17:04:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D6FF4230CD; Wed, 29 Jul 2020 17:04:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06TH4Xc8054647; Wed, 29 Jul 2020 17:04:33 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06TH4Xgc054646; Wed, 29 Jul 2020 17:04:33 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007291704.06TH4Xgc054646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 29 Jul 2020 17:04:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363667 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2020 17:04:34 -0000 Author: mjg Date: Wed Jul 29 17:04:33 2020 New Revision: 363667 URL: https://svnweb.freebsd.org/changeset/base/363667 Log: vfs: honor error code returned by mac_vnode_check_rename_from MFC after: 3 days Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Wed Jul 29 15:46:17 2020 (r363666) +++ head/sys/kern/vfs_syscalls.c Wed Jul 29 17:04:33 2020 (r363667) @@ -3556,20 +3556,27 @@ again: NDINIT_ATRIGHTS(&fromnd, DELETE, LOCKPARENT | LOCKLEAF | SAVESTART | AUDITVNODE1, pathseg, old, oldfd, &cap_renameat_source_rights, td); -#else - NDINIT_ATRIGHTS(&fromnd, DELETE, WANTPARENT | SAVESTART | AUDITVNODE1, - pathseg, old, oldfd, - &cap_renameat_source_rights, td); -#endif - if ((error = namei(&fromnd)) != 0) return (error); -#ifdef MAC error = mac_vnode_check_rename_from(td->td_ucred, fromnd.ni_dvp, fromnd.ni_vp, &fromnd.ni_cnd); VOP_UNLOCK(fromnd.ni_dvp); if (fromnd.ni_dvp != fromnd.ni_vp) VOP_UNLOCK(fromnd.ni_vp); + if (error != 0) { + NDFREE(&fromnd, NDF_ONLY_PNBUF); + vrele(fromnd.ni_dvp); + vrele(fromnd.ni_vp); + if (fromnd.ni_startdir) + vrele(fromnd.ni_startdir); + return (error); + } +#else + NDINIT_ATRIGHTS(&fromnd, DELETE, WANTPARENT | SAVESTART | AUDITVNODE1, + pathseg, old, oldfd, + &cap_renameat_source_rights, td); + if ((error = namei(&fromnd)) != 0) + return (error); #endif fvp = fromnd.ni_vp; NDINIT_ATRIGHTS(&tond, RENAME, LOCKPARENT | LOCKLEAF | NOCACHE | From owner-svn-src-head@freebsd.org Wed Jul 29 17:05:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED09E3AEC65; Wed, 29 Jul 2020 17:05:32 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BH0Km5SMPz42Jm; Wed, 29 Jul 2020 17:05:32 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E88D2332B; Wed, 29 Jul 2020 17:05:32 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06TH5WLN054754; Wed, 29 Jul 2020 17:05:32 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06TH5Wlb054752; Wed, 29 Jul 2020 17:05:32 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007291705.06TH5Wlb054752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 29 Jul 2020 17:05:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363668 - in head/sys: kern security/mac X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern security/mac X-SVN-Commit-Revision: 363668 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2020 17:05:33 -0000 Author: mjg Date: Wed Jul 29 17:05:31 2020 New Revision: 363668 URL: https://svnweb.freebsd.org/changeset/base/363668 Log: vfs: elide MAC-induced locking on rename if there are no relevant hoooks Modified: head/sys/kern/vfs_syscalls.c head/sys/security/mac/mac_framework.c head/sys/security/mac/mac_framework.h Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Wed Jul 29 17:04:33 2020 (r363667) +++ head/sys/kern/vfs_syscalls.c Wed Jul 29 17:05:31 2020 (r363668) @@ -3541,6 +3541,33 @@ sys_renameat(struct thread *td, struct renameat_args * UIO_USERSPACE)); } +#ifdef MAC +static int +kern_renameat_mac(struct thread *td, int oldfd, const char *old, int newfd, + const char *new, enum uio_seg pathseg, struct nameidata *fromnd) +{ + int error; + + NDINIT_ATRIGHTS(fromnd, DELETE, LOCKPARENT | LOCKLEAF | SAVESTART | + AUDITVNODE1, pathseg, old, oldfd, &cap_renameat_source_rights, td); + if ((error = namei(fromnd)) != 0) + return (error); + error = mac_vnode_check_rename_from(td->td_ucred, fromnd->ni_dvp, + fromnd->ni_vp, &fromnd->ni_cnd); + VOP_UNLOCK(fromnd->ni_dvp); + if (fromnd->ni_dvp != fromnd->ni_vp) + VOP_UNLOCK(fromnd->ni_vp); + if (error != 0) { + NDFREE(fromnd, NDF_ONLY_PNBUF); + vrele(fromnd->ni_dvp); + vrele(fromnd->ni_vp); + if (fromnd->ni_startdir) + vrele(fromnd->ni_startdir); + } + return (error); +} +#endif + int kern_renameat(struct thread *td, int oldfd, const char *old, int newfd, const char *new, enum uio_seg pathseg) @@ -3553,30 +3580,19 @@ kern_renameat(struct thread *td, int oldfd, const char again: bwillwrite(); #ifdef MAC - NDINIT_ATRIGHTS(&fromnd, DELETE, LOCKPARENT | LOCKLEAF | SAVESTART | - AUDITVNODE1, pathseg, old, oldfd, - &cap_renameat_source_rights, td); - if ((error = namei(&fromnd)) != 0) - return (error); - error = mac_vnode_check_rename_from(td->td_ucred, fromnd.ni_dvp, - fromnd.ni_vp, &fromnd.ni_cnd); - VOP_UNLOCK(fromnd.ni_dvp); - if (fromnd.ni_dvp != fromnd.ni_vp) - VOP_UNLOCK(fromnd.ni_vp); - if (error != 0) { - NDFREE(&fromnd, NDF_ONLY_PNBUF); - vrele(fromnd.ni_dvp); - vrele(fromnd.ni_vp); - if (fromnd.ni_startdir) - vrele(fromnd.ni_startdir); - return (error); - } -#else + if (mac_vnode_check_rename_from_enabled()) { + error = kern_renameat_mac(td, oldfd, old, newfd, new, pathseg, + &fromnd); + if (error != 0) + return (error); + } else { +#endif NDINIT_ATRIGHTS(&fromnd, DELETE, WANTPARENT | SAVESTART | AUDITVNODE1, - pathseg, old, oldfd, - &cap_renameat_source_rights, td); + pathseg, old, oldfd, &cap_renameat_source_rights, td); if ((error = namei(&fromnd)) != 0) return (error); +#ifdef MAC + } #endif fvp = fromnd.ni_vp; NDINIT_ATRIGHTS(&tond, RENAME, LOCKPARENT | LOCKLEAF | NOCACHE | Modified: head/sys/security/mac/mac_framework.c ============================================================================== --- head/sys/security/mac/mac_framework.c Wed Jul 29 17:04:33 2020 (r363667) +++ head/sys/security/mac/mac_framework.c Wed Jul 29 17:05:31 2020 (r363668) @@ -139,6 +139,7 @@ FPFLAG(vnode_check_read); FPFLAG(vnode_check_write); FPFLAG(vnode_check_mmap); FPFLAG_RARE(vnode_check_poll); +FPFLAG_RARE(vnode_check_rename_from); #undef FPFLAG #undef FPFLAG_RARE @@ -427,6 +428,8 @@ struct mac_policy_fastpath_elem mac_policy_fastpath_ar .flag = &mac_vnode_check_mmap_fp_flag }, { .offset = FPO(vnode_check_poll), .flag = &mac_vnode_check_poll_fp_flag }, + { .offset = FPO(vnode_check_rename_from), + .flag = &mac_vnode_check_rename_from_fp_flag }, }; static void Modified: head/sys/security/mac/mac_framework.h ============================================================================== --- head/sys/security/mac/mac_framework.h Wed Jul 29 17:04:33 2020 (r363667) +++ head/sys/security/mac/mac_framework.h Wed Jul 29 17:05:31 2020 (r363668) @@ -482,6 +482,10 @@ mac_vnode_check_poll(struct ucred *active_cred, struct #endif int mac_vnode_check_readdir(struct ucred *cred, struct vnode *vp); int mac_vnode_check_readlink(struct ucred *cred, struct vnode *vp); +#define mac_vnode_check_rename_from_enabled() __predict_false(mac_vnode_check_rename_from_fp_flag) +#ifdef MAC +extern bool mac_vnode_check_rename_from_fp_flag; +#endif int mac_vnode_check_rename_from(struct ucred *cred, struct vnode *dvp, struct vnode *vp, struct componentname *cnp); int mac_vnode_check_rename_to(struct ucred *cred, struct vnode *dvp, From owner-svn-src-head@freebsd.org Wed Jul 29 19:22:51 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B12F3696C3; Wed, 29 Jul 2020 19:22:51 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BH3NC1lpgz48Vk; Wed, 29 Jul 2020 19:22:51 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 207CF24DBE; Wed, 29 Jul 2020 19:22:51 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06TJMptt040169; Wed, 29 Jul 2020 19:22:51 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06TJMpT0040168; Wed, 29 Jul 2020 19:22:51 GMT (envelope-from br@FreeBSD.org) Message-Id: <202007291922.06TJMpT0040168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 29 Jul 2020 19:22:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363669 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 363669 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2020 19:22:51 -0000 Author: br Date: Wed Jul 29 19:22:50 2020 New Revision: 363669 URL: https://svnweb.freebsd.org/changeset/base/363669 Log: Fix !ACPI_DMAR build. Reviewed by: kib Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D25882 Modified: head/sys/x86/x86/busdma_machdep.c Modified: head/sys/x86/x86/busdma_machdep.c ============================================================================== --- head/sys/x86/x86/busdma_machdep.c Wed Jul 29 17:05:31 2020 (r363668) +++ head/sys/x86/x86/busdma_machdep.c Wed Jul 29 19:22:50 2020 (r363669) @@ -300,6 +300,10 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) } #ifndef ACPI_DMAR +bool bus_dma_iommu_set_buswide(device_t dev); +int bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map, + vm_paddr_t start, vm_size_t length, int flags); + bool bus_dma_iommu_set_buswide(device_t dev) { From owner-svn-src-head@freebsd.org Wed Jul 29 19:36:26 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 935FF36A59F; Wed, 29 Jul 2020 19:36:26 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BH3gt3MG2z49br; Wed, 29 Jul 2020 19:36:26 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5679F25085; Wed, 29 Jul 2020 19:36:26 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06TJaQ30046410; Wed, 29 Jul 2020 19:36:26 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06TJaOpQ046402; Wed, 29 Jul 2020 19:36:24 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202007291936.06TJaOpQ046402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 29 Jul 2020 19:36:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363670 - in head/contrib/ipfilter: iplang ipsend X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in head/contrib/ipfilter: iplang ipsend X-SVN-Commit-Revision: 363670 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2020 19:36:26 -0000 Author: cy Date: Wed Jul 29 19:36:24 2020 New Revision: 363670 URL: https://svnweb.freebsd.org/changeset/base/363670 Log: Continued ipfilter #ifdef cleanup. The r343701 log entry contains a complete description. MFC after: 1 week Modified: head/contrib/ipfilter/iplang/iplang_y.y head/contrib/ipfilter/ipsend/arp.c head/contrib/ipfilter/ipsend/ipresend.c head/contrib/ipfilter/ipsend/ipsend.c head/contrib/ipfilter/ipsend/iptest.c head/contrib/ipfilter/ipsend/iptests.c head/contrib/ipfilter/ipsend/sock.c Modified: head/contrib/ipfilter/iplang/iplang_y.y ============================================================================== --- head/contrib/ipfilter/iplang/iplang_y.y Wed Jul 29 19:22:50 2020 (r363669) +++ head/contrib/ipfilter/iplang/iplang_y.y Wed Jul 29 19:36:24 2020 (r363670) @@ -45,11 +45,6 @@ #include "ipf.h" #include "iplang.h" -#if !defined(__NetBSD__) && (!defined(__FreeBSD_version) && \ - __FreeBSD_version < 400020) && (!SOLARIS || SOLARIS2 < 10) -extern struct ether_addr *ether_aton __P((char *)); -#endif - extern int opts; extern struct ipopt_names ionames[]; extern int state, state, lineNum, token; @@ -58,11 +53,7 @@ extern char yytext[]; extern FILE *yyin; int yylex __P((void)); #define YYDEBUG 1 -#if !defined(ultrix) && !defined(hpux) int yydebug = 1; -#else -extern int yydebug; -#endif iface_t *iflist = NULL, **iftail = &iflist; iface_t *cifp = NULL; Modified: head/contrib/ipfilter/ipsend/arp.c ============================================================================== --- head/contrib/ipfilter/ipsend/arp.c Wed Jul 29 19:22:50 2020 (r363669) +++ head/contrib/ipfilter/ipsend/arp.c Wed Jul 29 19:36:24 2020 (r363670) @@ -11,17 +11,13 @@ static const char rcsid[] = "@(#)$Id$"; #endif #include #include -#if !defined(ultrix) && !defined(hpux) && !defined(__hpux) && !defined(__osf__) && !defined(_AIX51) # include -#endif #include #include #include #include #include -#ifndef ultrix # include -#endif #include #include #include Modified: head/contrib/ipfilter/ipsend/ipresend.c ============================================================================== --- head/contrib/ipfilter/ipsend/ipresend.c Wed Jul 29 19:22:50 2020 (r363669) +++ head/contrib/ipfilter/ipsend/ipresend.c Wed Jul 29 19:36:24 2020 (r363670) @@ -38,15 +38,7 @@ int opts = 0; # ifdef sun char default_device[] = "le0"; # else -# ifdef ultrix -char default_device[] = "ln0"; -# else -# ifdef __bsdi__ -char default_device[] = "ef0"; -# else char default_device[] = "lan0"; -# endif -# endif # endif #else char default_device[] = DEFAULT_DEVICE; Modified: head/contrib/ipfilter/ipsend/ipsend.c ============================================================================== --- head/contrib/ipfilter/ipsend/ipsend.c Wed Jul 29 19:22:50 2020 (r363669) +++ head/contrib/ipfilter/ipsend/ipsend.c Wed Jul 29 19:36:24 2020 (r363670) @@ -33,15 +33,7 @@ extern void iplang __P((FILE *)); char options[68]; int opts; -# ifdef ultrix -char default_device[] = "ln0"; -# else -# ifdef __bsdi__ -char default_device[] = "ef0"; -# else char default_device[] = "le0"; -# endif /* __bsdi__ */ -# endif /* ultrix */ static void usage __P((char *)); Modified: head/contrib/ipfilter/ipsend/iptest.c ============================================================================== --- head/contrib/ipfilter/ipsend/iptest.c Wed Jul 29 19:22:50 2020 (r363669) +++ head/contrib/ipfilter/ipsend/iptest.c Wed Jul 29 19:36:24 2020 (r363670) @@ -34,15 +34,7 @@ char options[68]; # ifdef sun char default_device[] = "le0"; # else -# ifdef ultrix -char default_device[] = "ln0"; -# else -# ifdef __bsdi__ -char default_device[] = "ef0"; -# else char default_device[] = "lan0"; -# endif -# endif # endif static void usage __P((char *)); Modified: head/contrib/ipfilter/ipsend/iptests.c ============================================================================== --- head/contrib/ipfilter/ipsend/iptests.c Wed Jul 29 19:22:50 2020 (r363669) +++ head/contrib/ipfilter/ipsend/iptests.c Wed Jul 29 19:36:24 2020 (r363670) @@ -36,18 +36,13 @@ typedef int boolean_t; # endif # undef _KERNEL # undef KERNEL -#if !defined(solaris) && !defined(linux) && !defined(__sgi) +#if !defined(solaris) # include # include # include #endif -#if !defined(ultrix) && !defined(hpux) && !defined(linux) && \ - !defined(__sgi) && !defined(__osf__) && !defined(_AIX51) # include -#endif -#ifndef ultrix # include -#endif #if defined(solaris) # include #else @@ -57,11 +52,9 @@ typedef int boolean_t; #include #include #endif -#if BSD >= 199103 # include # include # include -#endif #include #include #include @@ -74,7 +67,7 @@ typedef int boolean_t; #include #include #include -#if defined(__SVR4) || defined(__svr4__) || defined(__sgi) +#if defined(__SVR4) || defined(__svr4__) # include #endif #include @@ -82,7 +75,7 @@ typedef int boolean_t; #include #include # include -# if !defined(__hpux) && !defined(solaris) +# if !defined(solaris) # include # endif #include "ipsend.h" Modified: head/contrib/ipfilter/ipsend/sock.c ============================================================================== --- head/contrib/ipfilter/ipsend/sock.c Wed Jul 29 19:22:50 2020 (r363669) +++ head/contrib/ipfilter/ipsend/sock.c Wed Jul 29 19:36:24 2020 (r363670) @@ -21,14 +21,8 @@ static const char rcsid[] = "@(#)$Id$"; */ typedef int boolean_t; #endif -#ifndef ultrix #include -#endif -#if (__FreeBSD_version >= 300000) # include -#else -# include -#endif # ifdef __NetBSD__ # include # endif @@ -38,10 +32,6 @@ typedef int boolean_t; # define _KERNEL # define KERNEL # endif -# ifdef ultrix -# undef LOCORE -# include -# endif # include # ifdef __FreeBSD__ # undef _WANT_FILE @@ -54,18 +44,14 @@ typedef int boolean_t; #include #include #include -#if !defined(ultrix) && !defined(hpux) && !defined(__osf__) # include -#endif #ifdef sun #include #include #endif -#if BSD >= 199103 #include #include #include -#endif #include #include #include @@ -143,128 +129,10 @@ int kmemcpy(buf, pos, n) struct nlist names[4] = { { "_proc" }, { "_nproc" }, -#ifdef ultrix - { "_u" }, -#else { NULL }, -#endif { NULL } }; -#if BSD < 199103 -static struct proc *getproc() -{ - struct proc *p; - pid_t pid = getpid(); - int siz, n; - - n = nlist(KERNEL, names); - if (n != 0) - { - fprintf(stderr, "nlist(%#x) == %d\n", names, n); - return NULL; - } - if (KMCPY(&nproc, names[1].n_value, sizeof(nproc)) == -1) - { - fprintf(stderr, "read nproc (%#x)\n", names[1].n_value); - return NULL; - } - siz = nproc * sizeof(struct proc); - if (KMCPY(&p, names[0].n_value, sizeof(p)) == -1) - { - fprintf(stderr, "read(%#x,%#x,%d) proc\n", - names[0].n_value, &p, sizeof(p)); - return NULL; - } - proc = (struct proc *)malloc(siz); - if (KMCPY(proc, p, siz) == -1) - { - fprintf(stderr, "read(%#x,%#x,%d) proc\n", - p, proc, siz); - return NULL; - } - - p = proc; - - for (n = nproc; n; n--, p++) - if (p->p_pid == pid) - break; - if (!n) - return NULL; - - return p; -} - - -struct tcpcb *find_tcp(fd, ti) - int fd; - struct tcpiphdr *ti; -{ - struct tcpcb *t; - struct inpcb *i; - struct socket *s; - struct user *up; - struct proc *p; - struct file *f, **o; - - if (!(p = getproc())) - return NULL; - up = (struct user *)malloc(sizeof(*up)); -#ifndef ultrix - if (KMCPY(up, p->p_uarea, sizeof(*up)) == -1) - { - fprintf(stderr, "read(%#x,%#x) failed\n", p, p->p_uarea); - return NULL; - } -#else - if (KMCPY(up, names[2].n_value, sizeof(*up)) == -1) - { - fprintf(stderr, "read(%#x,%#x) failed\n", p, names[2].n_value); - return NULL; - } -#endif - - o = (struct file **)calloc(up->u_lastfile + 1, sizeof(*o)); - if (KMCPY(o, up->u_ofile, (up->u_lastfile + 1) * sizeof(*o)) == -1) - { - fprintf(stderr, "read(%#x,%#x,%d) - u_ofile - failed\n", - up->u_ofile, o, sizeof(*o)); - return NULL; - } - f = (struct file *)calloc(1, sizeof(*f)); - if (KMCPY(f, o[fd], sizeof(*f)) == -1) - { - fprintf(stderr, "read(%#x,%#x,%d) - o[fd] - failed\n", - up->u_ofile[fd], f, sizeof(*f)); - return NULL; - } - - s = (struct socket *)calloc(1, sizeof(*s)); - if (KMCPY(s, f->f_data, sizeof(*s)) == -1) - { - fprintf(stderr, "read(%#x,%#x,%d) - f_data - failed\n", - o[fd], s, sizeof(*s)); - return NULL; - } - - i = (struct inpcb *)calloc(1, sizeof(*i)); - if (KMCPY(i, s->so_pcb, sizeof(*i)) == -1) - { - fprintf(stderr, "kvm_read(%#x,%#x,%d) - so_pcb - failed\n", - s->so_pcb, i, sizeof(*i)); - return NULL; - } - - t = (struct tcpcb *)calloc(1, sizeof(*t)); - if (KMCPY(t, i->inp_ppcb, sizeof(*t)) == -1) - { - fprintf(stderr, "read(%#x,%#x,%d) - inp_ppcb - failed\n", - i->inp_ppcb, t, sizeof(*t)); - return NULL; - } - return (struct tcpcb *)i->inp_ppcb; -} -#else static struct kinfo_proc *getproc() { static struct kinfo_proc kp; @@ -304,7 +172,7 @@ struct tcpcb *find_tcp(tfd, ti) fd = (struct filedesc *)malloc(sizeof(*fd)); if (fd == NULL) return NULL; -#if defined( __FreeBSD_version) && __FreeBSD_version >= 500013 +#if defined( __FreeBSD_version) if (KMCPY(fd, p->ki_fd, sizeof(*fd)) == -1) { fprintf(stderr, "read(%#lx,%#lx) failed\n", @@ -381,7 +249,6 @@ finderror: free(t); return NULL; } -#endif /* BSD < 199301 */ int do_socket(dev, mtu, ti, gwip) char *dev; From owner-svn-src-head@freebsd.org Wed Jul 29 19:38:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D9BAE36A43E; Wed, 29 Jul 2020 19:38:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BH3kf5NCnz49nk; Wed, 29 Jul 2020 19:38:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 97F1225086; Wed, 29 Jul 2020 19:38:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06TJco2M046562; Wed, 29 Jul 2020 19:38:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06TJcoeA046560; Wed, 29 Jul 2020 19:38:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007291938.06TJcoeA046560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 29 Jul 2020 19:38:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363671 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 363671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2020 19:38:50 -0000 Author: markj Date: Wed Jul 29 19:38:49 2020 New Revision: 363671 URL: https://svnweb.freebsd.org/changeset/base/363671 Log: Remove the volatile qualifier from busy_lock. Use atomic(9) to load the lock state. Some places were doing this already, so it was inconsistent. In initialization code, the lock state is still initialized with plain stores. Reviewed by: alc, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25861 Modified: head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Jul 29 19:36:24 2020 (r363670) +++ head/sys/vm/vm_page.c Wed Jul 29 19:38:49 2020 (r363671) @@ -908,7 +908,7 @@ vm_page_busy_downgrade(vm_page_t m) vm_page_assert_xbusied(m); - x = m->busy_lock; + x = vm_page_busy_fetch(m); for (;;) { if (atomic_fcmpset_rel_int(&m->busy_lock, &x, VPB_SHARERS_WORD(1))) @@ -931,7 +931,7 @@ vm_page_busy_tryupgrade(vm_page_t m) vm_page_assert_sbusied(m); - x = m->busy_lock; + x = vm_page_busy_fetch(m); ce = VPB_CURTHREAD_EXCLUSIVE; for (;;) { if (VPB_SHARERS(x) > 1) @@ -955,7 +955,7 @@ vm_page_sbusied(vm_page_t m) { u_int x; - x = m->busy_lock; + x = vm_page_busy_fetch(m); return ((x & VPB_BIT_SHARED) != 0 && x != VPB_UNBUSIED); } @@ -971,7 +971,7 @@ vm_page_sunbusy(vm_page_t m) vm_page_assert_sbusied(m); - x = m->busy_lock; + x = vm_page_busy_fetch(m); for (;;) { KASSERT(x != VPB_FREED, ("vm_page_sunbusy: Unlocking freed page.")); @@ -1072,7 +1072,7 @@ _vm_page_busy_sleep(vm_object_t obj, vm_page_t m, vm_p xsleep = (allocflags & (VM_ALLOC_SBUSY | VM_ALLOC_IGN_SBUSY)) != 0; sleepq_lock(m); - x = atomic_load_int(&m->busy_lock); + x = vm_page_busy_fetch(m); do { /* * If the page changes objects or becomes unlocked we can @@ -1110,7 +1110,7 @@ vm_page_trysbusy(vm_page_t m) u_int x; obj = m->object; - x = m->busy_lock; + x = vm_page_busy_fetch(m); for (;;) { if ((x & VPB_BIT_SHARED) == 0) return (0); @@ -1146,7 +1146,7 @@ vm_page_tryxbusy(vm_page_t m) { vm_object_t obj; - if (atomic_cmpset_acq_int(&(m)->busy_lock, VPB_UNBUSIED, + if (atomic_cmpset_acq_int(&m->busy_lock, VPB_UNBUSIED, VPB_CURTHREAD_EXCLUSIVE) == 0) return (0); @@ -1354,7 +1354,7 @@ vm_page_readahead_finish(vm_page_t m) * have shown that deactivating the page is usually the best choice, * unless the page is wanted by another thread. */ - if ((m->busy_lock & VPB_BIT_WAITERS) != 0) + if ((vm_page_busy_fetch(m) & VPB_BIT_WAITERS) != 0) vm_page_activate(m); else vm_page_deactivate(m); @@ -1719,7 +1719,7 @@ vm_page_busy_release(vm_page_t m) { u_int x; - x = atomic_load_int(&m->busy_lock); + x = vm_page_busy_fetch(m); for (;;) { if (x == VPB_FREED) break; Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Wed Jul 29 19:36:24 2020 (r363670) +++ head/sys/vm/vm_page.h Wed Jul 29 19:38:49 2020 (r363671) @@ -100,7 +100,8 @@ * field and is described in detail below. * * The following annotations are possible: - * (A) the field is atomic and may require additional synchronization. + * (A) the field must be accessed using atomic(9) and may require + * additional synchronization. * (B) the page busy lock. * (C) the field is immutable. * (F) the per-domain lock for the free queues @@ -243,8 +244,8 @@ struct vm_page { vm_paddr_t phys_addr; /* physical address of page (C) */ struct md_page md; /* machine dependent stuff */ u_int ref_count; /* page references (A) */ - volatile u_int busy_lock; /* busy owners lock */ - union vm_page_astate a; /* state accessed atomically */ + u_int busy_lock; /* busy owners lock (A) */ + union vm_page_astate a; /* state accessed atomically (A) */ uint8_t order; /* index of the buddy queue (F) */ uint8_t pool; /* vm_phys freepool index (F) */ uint8_t flags; /* page PG_* flags (P) */ @@ -701,6 +702,8 @@ void vm_page_assert_locked_KBI(vm_page_t m, const char void vm_page_lock_assert_KBI(vm_page_t m, int a, const char *file, int line); #endif +#define vm_page_busy_fetch(m) atomic_load_int(&(m)->busy_lock) + #define vm_page_assert_busied(m) \ KASSERT(vm_page_busied(m), \ ("vm_page_assert_busied: page %p not busy @ %s:%d", \ @@ -712,7 +715,7 @@ void vm_page_lock_assert_KBI(vm_page_t m, int a, const (m), __FILE__, __LINE__)) #define vm_page_assert_unbusied(m) \ - KASSERT((m->busy_lock & ~VPB_BIT_WAITERS) != \ + KASSERT((vm_page_busy_fetch(m) & ~VPB_BIT_WAITERS) != \ VPB_CURTHREAD_EXCLUSIVE, \ ("vm_page_assert_xbusied: page %p busy_lock %#x owned" \ " by me @ %s:%d", \ @@ -725,7 +728,7 @@ void vm_page_lock_assert_KBI(vm_page_t m, int a, const } while (0) #define vm_page_assert_xbusied(m) do { \ vm_page_assert_xbusied_unchecked(m); \ - KASSERT((m->busy_lock & ~VPB_BIT_WAITERS) == \ + KASSERT((vm_page_busy_fetch(m) & ~VPB_BIT_WAITERS) == \ VPB_CURTHREAD_EXCLUSIVE, \ ("vm_page_assert_xbusied: page %p busy_lock %#x not owned" \ " by me @ %s:%d", \ @@ -733,7 +736,7 @@ void vm_page_lock_assert_KBI(vm_page_t m, int a, const } while (0) #define vm_page_busied(m) \ - ((m)->busy_lock != VPB_UNBUSIED) + (vm_page_busy_fetch(m) != VPB_UNBUSIED) #define vm_page_sbusy(m) do { \ if (!vm_page_trysbusy(m)) \ @@ -742,10 +745,10 @@ void vm_page_lock_assert_KBI(vm_page_t m, int a, const } while (0) #define vm_page_xbusied(m) \ - (((m)->busy_lock & VPB_SINGLE_EXCLUSIVE) != 0) + ((vm_page_busy_fetch(m) & VPB_SINGLE_EXCLUSIVE) != 0) #define vm_page_busy_freed(m) \ - ((m)->busy_lock == VPB_FREED) + (vm_page_busy_fetch(m) == VPB_FREED) #define vm_page_xbusy(m) do { \ if (!vm_page_tryxbusy(m)) \ @@ -771,12 +774,17 @@ void vm_page_object_busy_assert(vm_page_t m); void vm_page_assert_pga_writeable(vm_page_t m, uint16_t bits); #define VM_PAGE_ASSERT_PGA_WRITEABLE(m, bits) \ vm_page_assert_pga_writeable(m, bits) +/* + * Claim ownership of a page's xbusy state. In non-INVARIANTS kernels this + * operation is a no-op since ownership is not tracked. In particular + * this macro does not provide any synchronization with the previous owner. + */ #define vm_page_xbusy_claim(m) do { \ u_int _busy_lock; \ \ vm_page_assert_xbusied_unchecked((m)); \ do { \ - _busy_lock = atomic_load_int(&(m)->busy_lock); \ + _busy_lock = vm_page_busy_fetch(m); \ } while (!atomic_cmpset_int(&(m)->busy_lock, _busy_lock, \ (_busy_lock & VPB_BIT_FLAGMASK) | VPB_CURTHREAD_EXCLUSIVE)); \ } while (0) From owner-svn-src-head@freebsd.org Wed Jul 29 21:15:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9EFB836CC77; Wed, 29 Jul 2020 21:15:08 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BH5sm3fHGz4Gqt; Wed, 29 Jul 2020 21:15:08 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 609F226212; Wed, 29 Jul 2020 21:15:08 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06TLF8gV007477; Wed, 29 Jul 2020 21:15:08 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06TLF66w007470; Wed, 29 Jul 2020 21:15:06 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <202007292115.06TLF66w007470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Wed, 29 Jul 2020 21:15:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363674 - in head/share/man/man4: . man4.aarch64 man4.i386 X-SVN-Group: head X-SVN-Commit-Author: jmg X-SVN-Commit-Paths: in head/share/man/man4: . man4.aarch64 man4.i386 X-SVN-Commit-Revision: 363674 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2020 21:15:08 -0000 Author: jmg Date: Wed Jul 29 21:15:06 2020 New Revision: 363674 URL: https://svnweb.freebsd.org/changeset/base/363674 Log: add link to crypto(7) page, and drop a link to unrelated crypt(3) page.. Modified: head/share/man/man4/aesni.4 head/share/man/man4/hifn.4 head/share/man/man4/man4.aarch64/armv8crypto.4 head/share/man/man4/man4.i386/glxsb.4 head/share/man/man4/padlock.4 head/share/man/man4/safe.4 head/share/man/man4/safexcel.4 Modified: head/share/man/man4/aesni.4 ============================================================================== --- head/share/man/man4/aesni.4 Wed Jul 29 20:31:11 2020 (r363673) +++ head/share/man/man4/aesni.4 Wed Jul 29 21:15:06 2020 (r363674) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 26, 2017 +.Dd July 29, 2020 .Dt AESNI 4 .Os .Sh NAME @@ -88,6 +88,7 @@ implementations. .Xr ipsec 4 , .Xr padlock 4 , .Xr random 4 , +.Xr crypto 7 , .Xr crypto 9 .Sh HISTORY The Modified: head/share/man/man4/hifn.4 ============================================================================== --- head/share/man/man4/hifn.4 Wed Jul 29 20:31:11 2020 (r363673) +++ head/share/man/man4/hifn.4 Wed Jul 29 21:15:06 2020 (r363674) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 11, 2020 +.Dd July 29, 2020 .Dt HIFN 4 .Os .Sh NAME @@ -101,11 +101,11 @@ See Contains a 7955 and supports symmetric and random number operations. .El .Sh SEE ALSO -.Xr crypt 3 , .Xr crypto 4 , .Xr intro 4 , .Xr ipsec 4 , .Xr random 4 , +.Xr crypto 7 , .Xr crypto 9 .Sh HISTORY The Modified: head/share/man/man4/man4.aarch64/armv8crypto.4 ============================================================================== --- head/share/man/man4/man4.aarch64/armv8crypto.4 Wed Jul 29 20:31:11 2020 (r363673) +++ head/share/man/man4/man4.aarch64/armv8crypto.4 Wed Jul 29 21:15:06 2020 (r363674) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 20, 2016 +.Dd July 29, 2020 .Dt ARMV8CRYPTO 4 .Os .Sh NAME @@ -69,6 +69,7 @@ driver registers itself to accelerate AES operations f .Xr intro 4 , .Xr ipsec 4 , .Xr random 4 , +.Xr crypto 7 , .Xr crypto 9 .Sh HISTORY The Modified: head/share/man/man4/man4.i386/glxsb.4 ============================================================================== --- head/share/man/man4/man4.i386/glxsb.4 Wed Jul 29 20:31:11 2020 (r363673) +++ head/share/man/man4/man4.i386/glxsb.4 Wed Jul 29 21:15:06 2020 (r363674) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 8, 2008 +.Dd July 29, 2020 .Dt GLXSB 4 i386 .Os .Sh NAME @@ -73,6 +73,7 @@ device driver with AES keys of length != 128 bits. .Xr ipsec 4 , .Xr pci 4 , .Xr random 4 , +.Xr crypto 7 , .Xr crypto 9 .Sh HISTORY The Modified: head/share/man/man4/padlock.4 ============================================================================== --- head/share/man/man4/padlock.4 Wed Jul 29 20:31:11 2020 (r363673) +++ head/share/man/man4/padlock.4 Wed Jul 29 21:15:06 2020 (r363674) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2010 +.Dd July 29, 2020 .Dt PADLOCK 4 .Os .Sh NAME @@ -72,6 +72,7 @@ subsystem. .Xr intro 4 , .Xr ipsec 4 , .Xr random 4 , +.Xr crypto 7 , .Xr crypto 9 .Sh HISTORY The Modified: head/share/man/man4/safe.4 ============================================================================== --- head/share/man/man4/safe.4 Wed Jul 29 20:31:11 2020 (r363673) +++ head/share/man/man4/safe.4 Wed Jul 29 21:15:06 2020 (r363674) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd May 11, 2020 +.Dd July 29, 2020 .Dt SAFE 4 .Os .Sh NAME @@ -124,6 +124,7 @@ A faster version of the 1141. .Xr intro 4 , .Xr ipsec 4 , .Xr random 4 , +.Xr crypto 7 , .Xr crypto 9 .Sh BUGS Public key support is not implemented. Modified: head/share/man/man4/safexcel.4 ============================================================================== --- head/share/man/man4/safexcel.4 Wed Jul 29 20:31:11 2020 (r363673) +++ head/share/man/man4/safexcel.4 Wed Jul 29 21:15:06 2020 (r363674) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 23, 2020 +.Dd July 29, 2020 .Dt SAFEXCEL 4 .Os .Sh NAME @@ -75,6 +75,7 @@ with SHA1-HMAC and SHA2-HMAC for encrypt-then-authenti .Xr crypto 4 , .Xr ipsec 4 , .Xr random 4 , +.Xr crypto 7 , .Xr geli 8 , .Xr crypto 9 .Sh HISTORY From owner-svn-src-head@freebsd.org Wed Jul 29 22:08:56 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C300D36DF17; Wed, 29 Jul 2020 22:08:56 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BH73r4rkVz4KMw; Wed, 29 Jul 2020 22:08:56 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89D4626CCA; Wed, 29 Jul 2020 22:08:56 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06TM8uVE039425; Wed, 29 Jul 2020 22:08:56 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06TM8sOH039412; Wed, 29 Jul 2020 22:08:54 GMT (envelope-from br@FreeBSD.org) Message-Id: <202007292208.06TM8sOH039412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 29 Jul 2020 22:08:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363675 - in head/sys: dev/iommu dev/ntb/ntb_hw x86/iommu X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: dev/iommu dev/ntb/ntb_hw x86/iommu X-SVN-Commit-Revision: 363675 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2020 22:08:56 -0000 Author: br Date: Wed Jul 29 22:08:54 2020 New Revision: 363675 URL: https://svnweb.freebsd.org/changeset/base/363675 Log: o Don't include headers from iommu.h, include them from the header consumers instead; o Order includes properly. Reviewed by: kib Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D25878 Modified: head/sys/dev/iommu/iommu.h head/sys/dev/iommu/iommu_gas.c head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c head/sys/x86/iommu/intel_ctx.c head/sys/x86/iommu/intel_drv.c head/sys/x86/iommu/intel_idpgtbl.c head/sys/x86/iommu/intel_intrmap.c head/sys/x86/iommu/intel_qi.c head/sys/x86/iommu/intel_quirks.c head/sys/x86/iommu/intel_utils.c Modified: head/sys/dev/iommu/iommu.h ============================================================================== --- head/sys/dev/iommu/iommu.h Wed Jul 29 21:15:06 2020 (r363674) +++ head/sys/dev/iommu/iommu.h Wed Jul 29 22:08:54 2020 (r363675) @@ -34,14 +34,6 @@ #ifndef _SYS_IOMMU_H_ #define _SYS_IOMMU_H_ -#include -#include -#include -#include -#include - -#include - /* Host or physical memory address, after translation. */ typedef uint64_t iommu_haddr_t; /* Guest or bus address, before translation. */ Modified: head/sys/dev/iommu/iommu_gas.c ============================================================================== --- head/sys/dev/iommu/iommu_gas.c Wed Jul 29 21:15:06 2020 (r363674) +++ head/sys/dev/iommu/iommu_gas.c Wed Jul 29 22:08:54 2020 (r363675) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -60,6 +59,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include #include #include @@ -67,11 +69,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include #include #endif +#include /* * Guest Address Space management. Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Wed Jul 29 21:15:06 2020 (r363674) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Wed Jul 29 22:08:54 2020 (r363675) @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Wed Jul 29 21:15:06 2020 (r363674) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_plx.c Wed Jul 29 22:08:54 2020 (r363675) @@ -42,6 +42,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include Modified: head/sys/x86/iommu/intel_ctx.c ============================================================================== --- head/sys/x86/iommu/intel_ctx.c Wed Jul 29 21:15:06 2020 (r363674) +++ head/sys/x86/iommu/intel_ctx.c Wed Jul 29 22:08:54 2020 (r363675) @@ -58,18 +58,18 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include +#include #include #include #include #include -#include -#include #include -#include #include -#include +#include #include -#include static MALLOC_DEFINE(M_DMAR_CTX, "dmar_ctx", "Intel DMAR Context"); static MALLOC_DEFINE(M_DMAR_DOMAIN, "dmar_dom", "Intel DMAR Domain"); Modified: head/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Wed Jul 29 21:15:06 2020 (r363674) +++ head/sys/x86/iommu/intel_drv.c Wed Jul 29 22:08:54 2020 (r363675) @@ -54,11 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include -#include -#include #include #include #include @@ -66,11 +61,16 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include +#include +#include +#include #include #include +#include +#include +#include +#include +#include #include #ifdef DEV_APIC Modified: head/sys/x86/iommu/intel_idpgtbl.c ============================================================================== --- head/sys/x86/iommu/intel_idpgtbl.c Wed Jul 29 21:15:06 2020 (r363674) +++ head/sys/x86/iommu/intel_idpgtbl.c Wed Jul 29 22:08:54 2020 (r363675) @@ -58,15 +58,15 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include #include -#include #include -#include +#include #include static int domain_unmap_buf_locked(struct dmar_domain *domain, Modified: head/sys/x86/iommu/intel_intrmap.c ============================================================================== --- head/sys/x86/iommu/intel_intrmap.c Wed Jul 29 21:15:06 2020 (r363674) +++ head/sys/x86/iommu/intel_intrmap.c Wed Jul 29 22:08:54 2020 (r363675) @@ -40,24 +40,25 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include -#include -#include #include #include #include #include #include +#include +#include +#include +#include #include #include #include -#include #include -#include +#include #include -#include #include static struct dmar_unit *dmar_ir_find(device_t src, uint16_t *rid, Modified: head/sys/x86/iommu/intel_qi.c ============================================================================== --- head/sys/x86/iommu/intel_qi.c Wed Jul 29 21:15:06 2020 (r363674) +++ head/sys/x86/iommu/intel_qi.c Wed Jul 29 22:08:54 2020 (r363675) @@ -45,20 +45,20 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include -#include #include #include #include #include #include +#include +#include +#include +#include +#include #include #include -#include #include -#include +#include #include static bool Modified: head/sys/x86/iommu/intel_quirks.c ============================================================================== --- head/sys/x86/iommu/intel_quirks.c Wed Jul 29 21:15:06 2020 (r363674) +++ head/sys/x86/iommu/intel_quirks.c Wed Jul 29 22:08:54 2020 (r363675) @@ -46,10 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include -#include #include #include #include @@ -57,12 +53,16 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include +#include +#include +#include #include -#include #include -#include +#include #include -#include typedef void (*dmar_quirk_cpu_fun)(struct dmar_unit *); Modified: head/sys/x86/iommu/intel_utils.c ============================================================================== --- head/sys/x86/iommu/intel_utils.c Wed Jul 29 21:15:06 2020 (r363674) +++ head/sys/x86/iommu/intel_utils.c Wed Jul 29 22:08:54 2020 (r363675) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -59,14 +58,15 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include #include #include -#include #include -#include +#include #include u_int From owner-svn-src-head@freebsd.org Wed Jul 29 22:58:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67D8E36E7D0; Wed, 29 Jul 2020 22:58:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BH88d1vvpz4Md9; Wed, 29 Jul 2020 22:58:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A7A7274C5; Wed, 29 Jul 2020 22:58:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06TMw8BW070178; Wed, 29 Jul 2020 22:58:08 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06TMw806070177; Wed, 29 Jul 2020 22:58:08 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202007292258.06TMw806070177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Wed, 29 Jul 2020 22:58:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363677 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 363677 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2020 22:58:09 -0000 Author: rmacklem Date: Wed Jul 29 22:58:08 2020 New Revision: 363677 URL: https://svnweb.freebsd.org/changeset/base/363677 Log: Add support for ext_pgs mbufs to nfsrvd_readdir() and nfsrvd_readdirplus(). This patch code that optionally (based on ND_TLS, never set yet) generates readdir replies in ext_pgs mbufs. To trim the list back, a new function that is ext_pgs aware called nfsm_trimtrailing() replaces newnfs_trimtrailing(). newnfs_trimtrailing() is no longer used, but will be removed in a future commit, since its removal does modify the internal kpi between the NFS modules. This is another in the series of commits that add support to the NFS client and server for building RPC messages in ext_pgs mbufs with anonymous pages. This is useful so that the entire mbuf list does not need to be copied before calling sosend() when NFS over TLS is enabled. Use of ext_pgs mbufs will not be enabled until the kernel RPC is updated to handle TLS. Modified: head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Wed Jul 29 22:10:25 2020 (r363676) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Wed Jul 29 22:58:08 2020 (r363677) @@ -144,6 +144,8 @@ static int nfsrv_dsremove(struct vnode *, char *, stru static int nfsrv_dssetacl(struct vnode *, struct acl *, struct ucred *, NFSPROC_T *); static int nfsrv_pnfsstatfs(struct statfs *, struct mount *); +static void nfsm_trimtrailing(struct nfsrv_descript *, struct mbuf *, + char *, int, int); int nfs_pnfsio(task_fn_t *, void *); @@ -2043,6 +2045,17 @@ again: vput(vp); /* + * If cnt > MCLBYTES and the reply will not be saved, use + * ext_pgs mbufs for TLS. + * For NFSv4.0, we do not know for sure if the reply will + * be saved, so do not use ext_pgs mbufs for NFSv4.0. + */ + if (cnt > MCLBYTES && siz > MCLBYTES && + (nd->nd_flag & (ND_TLS | ND_EXTPG | ND_SAVEREPLY)) == ND_TLS && + (nd->nd_flag & (ND_NFSV4 | ND_NFSV41)) != ND_NFSV4) + nd->nd_flag |= ND_EXTPG; + + /* * dirlen is the size of the reply, including all XDR and must * not exceed cnt. For NFSv2, RFC1094 didn't clearly indicate * if the XDR should be included in "count", but to be safe, we do. @@ -2146,6 +2159,7 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdg struct mount *mp, *new_mp; uint64_t mounted_on_fileno; struct thread *p = curthread; + int bextpg0, bextpg1, bextpgsiz0, bextpgsiz1; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &at); @@ -2359,11 +2373,27 @@ again: } /* + * If the reply is likely to exceed MCLBYTES and the reply will + * not be saved, use ext_pgs mbufs for TLS. + * It is difficult to predict how large each entry will be and + * how many entries have been read, so just assume the directory + * entries grow by a factor of 4 when attributes are included. + * For NFSv4.0, we do not know for sure if the reply will + * be saved, so do not use ext_pgs mbufs for NFSv4.0. + */ + if (cnt > MCLBYTES && siz > MCLBYTES / 4 && + (nd->nd_flag & (ND_TLS | ND_EXTPG | ND_SAVEREPLY)) == ND_TLS && + (nd->nd_flag & (ND_NFSV4 | ND_NFSV41)) != ND_NFSV4) + nd->nd_flag |= ND_EXTPG; + + /* * Save this position, in case there is an error before one entry * is created. */ mb0 = nd->nd_mb; bpos0 = nd->nd_bpos; + bextpg0 = nd->nd_bextpg; + bextpgsiz0 = nd->nd_bextpgsiz; /* * Fill in the first part of the reply. @@ -2385,6 +2415,8 @@ again: */ mb1 = nd->nd_mb; bpos1 = nd->nd_bpos; + bextpg1 = nd->nd_bextpg; + bextpgsiz1 = nd->nd_bextpgsiz; /* Loop through the records and build reply */ entrycnt = 0; @@ -2401,6 +2433,8 @@ again: */ mb1 = nd->nd_mb; bpos1 = nd->nd_bpos; + bextpg1 = nd->nd_bextpg; + bextpgsiz1 = nd->nd_bextpgsiz; /* * For readdir_and_lookup get the vnode using @@ -2626,11 +2660,11 @@ invalid: if (!nd->nd_repstat && entrycnt == 0) nd->nd_repstat = NFSERR_TOOSMALL; if (nd->nd_repstat) { - newnfs_trimtrailing(nd, mb0, bpos0); + nfsm_trimtrailing(nd, mb0, bpos0, bextpg0, bextpgsiz0); if (nd->nd_flag & ND_NFSV3) nfsrv_postopattr(nd, getret, &at); } else - newnfs_trimtrailing(nd, mb1, bpos1); + nfsm_trimtrailing(nd, mb1, bpos1, bextpg1, bextpgsiz1); eofflag = 0; } else if (cpos < cend) eofflag = 0; @@ -6416,6 +6450,44 @@ out: } NFSEXITCODE(error); return (error); +} + +/* + * Trim trailing data off the mbuf list being built. + */ +static void +nfsm_trimtrailing(struct nfsrv_descript *nd, struct mbuf *mb, char *bpos, + int bextpg, int bextpgsiz) +{ + vm_page_t pg; + int fullpgsiz, i; + + if (mb->m_next != NULL) { + m_freem(mb->m_next); + mb->m_next = NULL; + } + if ((mb->m_flags & M_EXTPG) != 0) { + /* First, get rid of any pages after this position. */ + for (i = mb->m_epg_npgs - 1; i > bextpg; i--) { + pg = PHYS_TO_VM_PAGE(mb->m_epg_pa[i]); + vm_page_unwire_noq(pg); + vm_page_free(pg); + } + mb->m_epg_npgs = bextpg + 1; + if (bextpg == 0) + fullpgsiz = PAGE_SIZE - mb->m_epg_1st_off; + else + fullpgsiz = PAGE_SIZE; + mb->m_epg_last_len = fullpgsiz - bextpgsiz; + mb->m_len = m_epg_pagelen(mb, 0, mb->m_epg_1st_off); + for (i = 1; i < mb->m_epg_npgs; i++) + mb->m_len += m_epg_pagelen(mb, i, 0); + nd->nd_bextpgsiz = bextpgsiz; + nd->nd_bextpg = bextpg; + } else + mb->m_len = bpos - mtod(mb, char *); + nd->nd_mb = mb; + nd->nd_bpos = bpos; } extern int (*nfsd_call_nfsd)(struct thread *, struct nfssvc_args *); From owner-svn-src-head@freebsd.org Wed Jul 29 23:21:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7678236F15E; Wed, 29 Jul 2020 23:21:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BH8h52bzBz4Ncm; Wed, 29 Jul 2020 23:21:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C28E276E1; Wed, 29 Jul 2020 23:21:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06TNLv1u087455; Wed, 29 Jul 2020 23:21:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06TNLuoq087451; Wed, 29 Jul 2020 23:21:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202007292321.06TNLuoq087451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 29 Jul 2020 23:21:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex X-SVN-Commit-Revision: 363679 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2020 23:21:57 -0000 Author: kevans Date: Wed Jul 29 23:21:56 2020 New Revision: 363679 URL: https://svnweb.freebsd.org/changeset/base/363679 Log: regex(3): Interpret many escaped ordinary characters as EESCAPE In IEEE 1003.1-2008 [1] and earlier revisions, BRE/ERE grammar allows for any character to be escaped, but "ORD_CHAR preceded by an unescaped character [gives undefined results]". Historically, we've interpreted an escaped ordinary character as the ordinary character itself. This becomes problematic when some extensions give special meanings to an otherwise ordinary character (e.g. GNU's \b, \s, \w), meaning we may have two different valid interpretations of the same sequence. To make this easier to deal with and given that the standard calls this undefined, we should throw an error (EESCAPE) if we run into this scenario to ease transition into a state where some escaped ordinaries are blessed with a special meaning -- it will either error out or have extended behavior, rather than have two entirely different versions of undefined behavior that leave the consumer of regex(3) guessing as to what behavior will be used or leaving them with false impressions. This change bumps the symbol version of regcomp to FBSD_1.6 and provides the old escape semantics for legacy applications, just in case one has an older application that would immediately turn into a pumpkin because of an extraneous escape that's embedded or otherwise critical to its operation. This is the final piece needed before enhancing libregex with GNU extensions and flipping the switch on bsdgrep. [1] http://pubs.opengroup.org/onlinepubs/9699919799.2016edition/ PR: 229925 (exp-run, courtesy of antoine) Differential Revision: https://reviews.freebsd.org/D10510 Modified: head/contrib/netbsd-tests/lib/libc/regex/data/meta.in head/contrib/netbsd-tests/lib/libc/regex/data/subexp.in head/lib/libc/regex/Symbol.map head/lib/libc/regex/regcomp.c Modified: head/contrib/netbsd-tests/lib/libc/regex/data/meta.in ============================================================================== --- head/contrib/netbsd-tests/lib/libc/regex/data/meta.in Wed Jul 29 23:17:16 2020 (r363678) +++ head/contrib/netbsd-tests/lib/libc/regex/data/meta.in Wed Jul 29 23:21:56 2020 (r363679) @@ -4,7 +4,9 @@ a[bc]d & abd abd a\*c & a*c a*c a\\b & a\b a\b a\\\*b & a\*b a\*b -a\bc & abc abc +# Begin FreeBSD +a\bc &C EESCAPE +# End FreeBSD a\ &C EESCAPE a\\bc & a\bc a\bc \{ bC BADRPT Modified: head/contrib/netbsd-tests/lib/libc/regex/data/subexp.in ============================================================================== --- head/contrib/netbsd-tests/lib/libc/regex/data/subexp.in Wed Jul 29 23:17:16 2020 (r363678) +++ head/contrib/netbsd-tests/lib/libc/regex/data/subexp.in Wed Jul 29 23:21:56 2020 (r363679) @@ -12,7 +12,7 @@ a(b+)c - abbbc abbbc bbb a(b*)c - ac ac @c (a|ab)(bc([de]+)f|cde) - abcdef abcdef a,bcdef,de # Begin FreeBSD -a\(b\|c\)d b ab|cd ab|cd b|c +a\(b|c\)d b ab|cd ab|cd b|c # End FreeBSD # the regression tester only asks for 9 subexpressions a(b)(c)(d)(e)(f)(g)(h)(i)(j)k - abcdefghijk abcdefghijk b,c,d,e,f,g,h,i,j Modified: head/lib/libc/regex/Symbol.map ============================================================================== --- head/lib/libc/regex/Symbol.map Wed Jul 29 23:17:16 2020 (r363678) +++ head/lib/libc/regex/Symbol.map Wed Jul 29 23:21:56 2020 (r363679) @@ -3,8 +3,11 @@ */ FBSD_1.0 { - regcomp; regerror; regexec; regfree; +}; + +FBSD_1.6 { + regcomp; }; Modified: head/lib/libc/regex/regcomp.c ============================================================================== --- head/lib/libc/regex/regcomp.c Wed Jul 29 23:17:16 2020 (r363678) +++ head/lib/libc/regex/regcomp.c Wed Jul 29 23:21:56 2020 (r363679) @@ -102,11 +102,14 @@ struct parse { sopno pend[NPAREN]; /* -> ) ([0] unused) */ bool allowbranch; /* can this expression branch? */ bool bre; /* convenience; is this a BRE? */ + int pflags; /* other parsing flags -- legacy escapes? */ bool (*parse_expr)(struct parse *, struct branchc *); void (*pre_parse)(struct parse *, struct branchc *); void (*post_parse)(struct parse *, struct branchc *); }; +#define PFLAG_LEGACY_ESC 0x00000001 + /* ========= begin header generated by ./mkh ========= */ #ifdef __cplusplus extern "C" { @@ -132,6 +135,7 @@ static void p_b_cclass(struct parse *p, cset *cs); static void p_b_eclass(struct parse *p, cset *cs); static wint_t p_b_symbol(struct parse *p); static wint_t p_b_coll_elem(struct parse *p, wint_t endc); +static bool may_escape(struct parse *p, const wint_t ch); static wint_t othercase(wint_t ch); static void bothcases(struct parse *p, wint_t ch); static void ordinary(struct parse *p, wint_t ch); @@ -199,22 +203,10 @@ static char nuls[10]; /* place to point scanner in ev /* Macro used by computejump()/computematchjump() */ #define MIN(a,b) ((a)<(b)?(a):(b)) -/* - - regcomp - interface for parser and compilation - = extern int regcomp(regex_t *, const char *, int); - = #define REG_BASIC 0000 - = #define REG_EXTENDED 0001 - = #define REG_ICASE 0002 - = #define REG_NOSUB 0004 - = #define REG_NEWLINE 0010 - = #define REG_NOSPEC 0020 - = #define REG_PEND 0040 - = #define REG_DUMP 0200 - */ -int /* 0 success, otherwise REG_something */ -regcomp(regex_t * __restrict preg, +static int /* 0 success, otherwise REG_something */ +regcomp_internal(regex_t * __restrict preg, const char * __restrict pattern, - int cflags) + int cflags, int pflags) { struct parse pa; struct re_guts *g; @@ -273,6 +265,7 @@ regcomp(regex_t * __restrict preg, p->end = p->next + len; p->error = 0; p->ncsalloc = 0; + p->pflags = pflags; for (i = 0; i < NPAREN; i++) { p->pbegin[i] = 0; p->pend[i] = 0; @@ -346,6 +339,43 @@ regcomp(regex_t * __restrict preg, } /* + - regcomp - interface for parser and compilation + = extern int regcomp(regex_t *, const char *, int); + = #define REG_BASIC 0000 + = #define REG_EXTENDED 0001 + = #define REG_ICASE 0002 + = #define REG_NOSUB 0004 + = #define REG_NEWLINE 0010 + = #define REG_NOSPEC 0020 + = #define REG_PEND 0040 + = #define REG_DUMP 0200 + */ +int /* 0 success, otherwise REG_something */ +regcomp(regex_t * __restrict preg, + const char * __restrict pattern, + int cflags) +{ + + return (regcomp_internal(preg, pattern, cflags, 0)); +} + +#ifndef LIBREGEX +/* + * Legacy interface that requires more lax escaping behavior. + */ +int +freebsd12_regcomp(regex_t * __restrict preg, + const char * __restrict pattern, + int cflags, int pflags) +{ + + return (regcomp_internal(preg, pattern, cflags, PFLAG_LEGACY_ESC)); +} + +__sym_compat(regcomp, freebsd12_regcomp, FBSD_1.0); +#endif /* !LIBREGEX */ + +/* - p_ere_exp - parse one subERE, an atom possibly followed by a repetition op, - return whether we should terminate or not == static bool p_ere_exp(struct parse *p); @@ -435,7 +465,10 @@ p_ere_exp(struct parse *p, struct branchc *bc) EMIT(OEOW, 0); break; default: - ordinary(p, wc); + if (may_escape(p, wc)) + ordinary(p, wc); + else + SETERROR(REG_EESCAPE); break; } break; @@ -797,7 +830,10 @@ p_simp_re(struct parse *p, struct branchc *bc) return (false); /* Definitely not $... */ p->next--; wc = WGETNEXT(); - ordinary(p, wc); + if ((c & BACKSL) == 0 || may_escape(p, wc)) + ordinary(p, wc); + else + SETERROR(REG_EESCAPE); break; } @@ -1092,6 +1128,55 @@ p_b_coll_elem(struct parse *p, else SETERROR(REG_ECOLLATE); /* neither */ return(0); +} + +/* + - may_escape - determine whether 'ch' is escape-able in the current context + == static int may_escape(struct parse *p, const wint_t ch) + */ +static bool +may_escape(struct parse *p, const wint_t ch) +{ + + if ((p->pflags & PFLAG_LEGACY_ESC) != 0) + return (true); + if (isalpha(ch) || ch == '\'' || ch == '`') + return (false); + return (true); +#ifdef NOTYET + /* + * Build a whitelist of characters that may be escaped to produce an + * ordinary in the current context. This assumes that these have not + * been otherwise interpreted as a special character. Escaping an + * ordinary character yields undefined results according to + * IEEE 1003.1-2008. Some extensions (notably, some GNU extensions) take + * advantage of this and use escaped ordinary characters to provide + * special meaning, e.g. \b, \B, \w, \W, \s, \S. + */ + switch(ch) { + case '|': + case '+': + case '?': + /* The above characters may not be escaped in BREs */ + if (!(p->g->cflags®_EXTENDED)) + return (false); + /* Fallthrough */ + case '(': + case ')': + case '{': + case '}': + case '.': + case '[': + case ']': + case '\\': + case '*': + case '^': + case '$': + return (true); + default: + return (false); + } +#endif } /* From owner-svn-src-head@freebsd.org Wed Jul 29 23:24:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79B1A36F0C4; Wed, 29 Jul 2020 23:24:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BH8l52g5cz4P5y; Wed, 29 Jul 2020 23:24:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E25D271FD; Wed, 29 Jul 2020 23:24:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06TNOX55088385; Wed, 29 Jul 2020 23:24:33 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06TNOXhl088384; Wed, 29 Jul 2020 23:24:33 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202007292324.06TNOXhl088384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 29 Jul 2020 23:24:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363680 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363680 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2020 23:24:33 -0000 Author: jhb Date: Wed Jul 29 23:24:32 2020 New Revision: 363680 URL: https://svnweb.freebsd.org/changeset/base/363680 Log: Properly handle a closed TLS socket with pending receive data. If the remote end closes a TLS socket and the socket buffer still contains not-yet-decrypted TLS records but no decrypted TLS records, soreceive needs to block or fail with EWOULDBLOCK. Previously it was trying to return data and dereferencing a NULL pointer. Reviewed by: np Sponsored by: Chelsio Differential Revision: https://reviews.freebsd.org/D25838 Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Wed Jul 29 23:21:56 2020 (r363679) +++ head/sys/kern/uipc_socket.c Wed Jul 29 23:24:32 2020 (r363680) @@ -1965,12 +1965,17 @@ restart: } SOCKBUF_LOCK_ASSERT(&so->so_rcv); if (so->so_rcv.sb_state & SBS_CANTRCVMORE) { - if (m == NULL && so->so_rcv.sb_tlsdcc == 0 && + if (m != NULL) + goto dontblock; +#ifdef KERN_TLS + else if (so->so_rcv.sb_tlsdcc == 0 && so->so_rcv.sb_tlscc == 0) { +#else + else { +#endif SOCKBUF_UNLOCK(&so->so_rcv); goto release; - } else - goto dontblock; + } } for (; m != NULL; m = m->m_next) if (m->m_type == MT_OOBDATA || (m->m_flags & M_EOR)) { From owner-svn-src-head@freebsd.org Wed Jul 29 23:59:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95C3536FE3C; Wed, 29 Jul 2020 23:59:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BH9WX3Xzfz4QTV; Wed, 29 Jul 2020 23:59:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CB5427B52; Wed, 29 Jul 2020 23:59:36 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06TNxarS007350; Wed, 29 Jul 2020 23:59:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06TNxaJV007347; Wed, 29 Jul 2020 23:59:36 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202007292359.06TNxaJV007347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 29 Jul 2020 23:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363681 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 363681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2020 23:59:36 -0000 Author: kevans Date: Wed Jul 29 23:59:35 2020 New Revision: 363681 URL: https://svnweb.freebsd.org/changeset/base/363681 Log: UPDATING / RELNOTES: Document new regcomp(3) behavior This is a breaking change that had a not-insignificant impact in ports, it is worth documenting it well. Modified: head/RELNOTES head/UPDATING Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Wed Jul 29 23:24:32 2020 (r363680) +++ head/RELNOTES Wed Jul 29 23:59:35 2020 (r363681) @@ -10,6 +10,10 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +r363679: + Applications using regex(3), e.g. sed/grep, will no longer accept + redundant escapes for most ordinary characters. + r363253: SCTP support has been removed from GENERIC kernel configurations. The SCTP stack is now built as sctp.ko and can be dynamically loaded. Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Jul 29 23:24:32 2020 (r363680) +++ head/UPDATING Wed Jul 29 23:59:35 2020 (r363681) @@ -26,6 +26,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20200729: + r363679 has redefined some undefined behavior in regcomp(3); notably, + extraneous escapes of most ordinary characters will no longer be + accepted. An exp-run has identified all of the problems with this in + ports, but other non-ports software may need extra escapes removed to + continue to function. + 20200627: A new implementation of bc and dc has been imorted in r362681. This implementation corrects non-conformant behavior of the previous bc From owner-svn-src-head@freebsd.org Thu Jul 30 00:52:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B96353712B3; Thu, 30 Jul 2020 00:52:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHBhj4Tq0z4TFN; Thu, 30 Jul 2020 00:52:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D0658BA0; Thu, 30 Jul 2020 00:52:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06U0qb8e044357; Thu, 30 Jul 2020 00:52:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06U0qb7K044356; Thu, 30 Jul 2020 00:52:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007300052.06U0qb7K044356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 30 Jul 2020 00:52:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363682 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 00:52:37 -0000 Author: markj Date: Thu Jul 30 00:52:37 2020 New Revision: 363682 URL: https://svnweb.freebsd.org/changeset/base/363682 Log: Fix a logic error in uipc_ready_scan(). When processing the last record in a socket buffer, take care to avoid a NULL pointer dereference when advancing the record iterator. Reported by: syzbot+6a689cc9c27bd265237a@syzkaller.appspotmail.com Fixes: r359778 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Wed Jul 29 23:59:35 2020 (r363681) +++ head/sys/kern/uipc_usrreq.c Thu Jul 30 00:52:37 2020 (r363682) @@ -1279,7 +1279,8 @@ uipc_ready_scan(struct socket *so, struct mbuf *m, int mb = mb->m_next; if (mb == NULL) { mb = n; - n = mb->m_nextpkt; + if (mb != NULL) + n = mb->m_nextpkt; } } } From owner-svn-src-head@freebsd.org Thu Jul 30 00:53:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC17F37130D; Thu, 30 Jul 2020 00:53:57 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHBkF47vHz4TSn; Thu, 30 Jul 2020 00:53:57 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5808D87EB; Thu, 30 Jul 2020 00:53:57 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06U0rvpK044456; Thu, 30 Jul 2020 00:53:57 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06U0ruI2044453; Thu, 30 Jul 2020 00:53:56 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <202007300053.06U0ruI2044453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Thu, 30 Jul 2020 00:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363683 - in head: . share/man/man4 sys/conf sys/dev/cy sys/dev/rc sys/dev/rp sys/modules/rc sys/modules/rp X-SVN-Group: head X-SVN-Commit-Author: jmg X-SVN-Commit-Paths: in head: . share/man/man4 sys/conf sys/dev/cy sys/dev/rc sys/dev/rp sys/modules/rc sys/modules/rp X-SVN-Commit-Revision: 363683 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 00:53:57 -0000 Author: jmg Date: Thu Jul 30 00:53:56 2020 New Revision: 363683 URL: https://svnweb.freebsd.org/changeset/base/363683 Log: remove some long abandonded serial drivers (cy, rc, rp) since 2008 Reviewed by: phk (earlier version) Reviewed by: emaste (earlier version) Reviewed by: bcr (earlier version) Reviewed by: zeising (earlier version) Differential Revision: https://reviews.freebsd.org/D25874 Deleted: head/share/man/man4/cy.4 head/share/man/man4/rc.4 head/share/man/man4/rp.4 head/sys/dev/cy/ head/sys/dev/rc/ head/sys/dev/rp/ head/sys/modules/rc/ head/sys/modules/rp/ Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/sys/conf/files Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Jul 30 00:52:37 2020 (r363682) +++ head/ObsoleteFiles.inc Thu Jul 30 00:53:56 2020 (r363683) @@ -36,6 +36,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20200729: remove long expired serial drivers +OLD_FILES+=usr/share/man/man4/cy.4.gz +OLD_FILES+=usr/share/man/man4/rc.4.gz +OLD_FILES+=usr/share/man/man4/rp.4.gz + # 20200715: rework of devstat(9) man page OLD_FILES+=usr/share/man/man9/devstat_add_entry.9.gz Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Jul 30 00:52:37 2020 (r363682) +++ head/share/man/man4/Makefile Thu Jul 30 00:53:56 2020 (r363683) @@ -121,7 +121,6 @@ MAN= aac.4 \ cxgb.4 \ cxgbe.4 \ cxgbev.4 \ - cy.4 \ cyapa.4 \ da.4 \ dc.4 \ @@ -434,7 +433,6 @@ MAN= aac.4 \ ${_qlnxe.4} \ ral.4 \ random.4 \ - rc.4 \ rctl.4 \ re.4 \ rgephy.4 \ @@ -442,7 +440,6 @@ MAN= aac.4 \ rl.4 \ rndtest.4 \ route.4 \ - rp.4 \ rtwn.4 \ rtwnfw.4 \ rtwn_pci.4 \ Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jul 30 00:52:37 2020 (r363682) +++ head/sys/conf/files Thu Jul 30 00:53:56 2020 (r363683) @@ -1541,9 +1541,6 @@ t6fw.fw optional cxgbe \ clean "t6fw.fw" dev/cxgbe/crypto/t4_crypto.c optional ccr \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" -dev/cy/cy.c optional cy -dev/cy/cy_isa.c optional cy isa -dev/cy/cy_pci.c optional cy pci dev/cyapa/cyapa.c optional cyapa iicbus dev/dc/if_dc.c optional dc pci dev/dc/dcphy.c optional dc pci @@ -2775,14 +2772,10 @@ dev/random/random_harvestq.c standard dev/random/randomdev.c optional !random_loadable dev/random/fortuna.c optional !random_loadable dev/random/hash.c optional !random_loadable -dev/rc/rc.c optional rc dev/rccgpio/rccgpio.c optional rccgpio gpio dev/re/if_re.c optional re dev/rl/if_rl.c optional rl pci dev/rndtest/rndtest.c optional rndtest -dev/rp/rp.c optional rp -dev/rp/rp_isa.c optional rp isa -dev/rp/rp_pci.c optional rp pci # dev/rtwn/if_rtwn.c optional rtwn dev/rtwn/if_rtwn_beacon.c optional rtwn From owner-svn-src-head@freebsd.org Thu Jul 30 03:53:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC9D8376C9E; Thu, 30 Jul 2020 03:53:44 +0000 (UTC) (envelope-from lwhsu@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHGjh41DTz4ffr; Thu, 30 Jul 2020 03:53:44 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: from mail-yb1-f171.google.com (mail-yb1-f171.google.com [209.85.219.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: lwhsu/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 684BE1A9DB; Thu, 30 Jul 2020 03:53:44 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: by mail-yb1-f171.google.com with SMTP id c14so13728112ybj.0; Wed, 29 Jul 2020 20:53:44 -0700 (PDT) X-Gm-Message-State: AOAM530e8mD14GwWJrwfD+rIfE7sfgcEMS8lFxdckXPj9b41LfIKBK7K IRCbu9YYo8waLc5MRf35JLXuRdtuvknNBiWUrts= X-Google-Smtp-Source: ABdhPJygu0EUkCuhL5zIQUXFlVeoLC5G/UsLsi+rcA/ytgJ3Em6Y7xmQdVWzx+0AgfLA1KK7QbrwwM4MCx5huJjRzP0= X-Received: by 2002:a25:b1a5:: with SMTP id h37mr53960180ybj.241.1596081223622; Wed, 29 Jul 2020 20:53:43 -0700 (PDT) MIME-Version: 1.0 References: <202007292321.06TNLuoq087451@repo.freebsd.org> In-Reply-To: <202007292321.06TNLuoq087451@repo.freebsd.org> From: Li-Wen Hsu Date: Thu, 30 Jul 2020 11:53:32 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 03:53:44 -0000 On Thu, Jul 30, 2020 at 7:22 AM Kyle Evans wrote: > > Author: kevans > Date: Wed Jul 29 23:21:56 2020 > New Revision: 363679 > URL: https://svnweb.freebsd.org/changeset/base/363679 > > Log: > regex(3): Interpret many escaped ordinary characters as EESCAPE > > In IEEE 1003.1-2008 [1] and earlier revisions, BRE/ERE grammar allows for > any character to be escaped, but "ORD_CHAR preceded by an unescaped > character [gives undefined results]". > > Historically, we've interpreted an escaped ordinary character as the > ordinary character itself. This becomes problematic when some extensions > give special meanings to an otherwise ordinary character > (e.g. GNU's \b, \s, \w), meaning we may have two different valid > interpretations of the same sequence. > > To make this easier to deal with and given that the standard calls this > undefined, we should throw an error (EESCAPE) if we run into this scenario > to ease transition into a state where some escaped ordinaries are blessed > with a special meaning -- it will either error out or have extended > behavior, rather than have two entirely different versions of undefined > behavior that leave the consumer of regex(3) guessing as to what behavior > will be used or leaving them with false impressions. > > This change bumps the symbol version of regcomp to FBSD_1.6 and provides the > old escape semantics for legacy applications, just in case one has an older > application that would immediately turn into a pumpkin because of an > extraneous escape that's embehttps://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/lib.googletest.gtest_main/googletest-port-test/main/dded or otherwise critical to its operation. > > This is the final piece needed before enhancing libregex with GNU extensions > and flipping the switch on bsdgrep. > > [1] http://pubs.opengroup.org/onlinepubs/9699919799.2016edition/ > > PR: 229925 (exp-run, courtesy of antoine) > Differential Revision: https://reviews.freebsd.org/D10510 > > Modified: > head/contrib/netbsd-tests/lib/libc/regex/data/meta.in > head/contrib/netbsd-tests/lib/libc/regex/data/subexp.in > head/lib/libc/regex/Symbol.map > head/lib/libc/regex/regcomp.c I think there are 3 test cases need to be modified after this change: https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/lib.googletest.gtest_main/googletest-port-test/main/ https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/usr.bin.diff/diff_test/side_by_side/ https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/usr.bin.sed/sed2_test/hex_subst/ Please help to check them, thanks! Li-Wen From owner-svn-src-head@freebsd.org Thu Jul 30 04:07:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A8A0376DDA; Thu, 30 Jul 2020 04:07:24 +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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHH1S1Fgjz4g9m; Thu, 30 Jul 2020 04:07:24 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 08CF51AA0D; Thu, 30 Jul 2020 04:07:24 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f169.google.com with SMTP id b79so24447833qkg.9; Wed, 29 Jul 2020 21:07:24 -0700 (PDT) X-Gm-Message-State: AOAM533wh2E6fJ1coHodcf27G9zZDVdh8NL/DpwxMF6EJX6PicVM0gTB xqB8FvwdhFiF1WuImSodAzjIJT68xX3LYdtLKsg= X-Google-Smtp-Source: ABdhPJzlioR3HP9WPy2waGWRKu7tmUcCHQLgarVmnUN40oWQqt0F0T1U4VrOn6Qn5X1odmGayChQZ3PdA8eDsOGxV1I= X-Received: by 2002:a05:620a:628:: with SMTP id 8mr37632630qkv.103.1596082043533; Wed, 29 Jul 2020 21:07:23 -0700 (PDT) MIME-Version: 1.0 References: <202007292321.06TNLuoq087451@repo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Wed, 29 Jul 2020 23:07:12 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex To: Li-Wen Hsu Cc: Kyle Evans , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 04:07:24 -0000 Sorry, on mobile, so doubling down on bad formatting by top-posting... The sed/diff tests are easy to fix, will do those in about 8/9 hours. The Google test failure is interesting- this expression has clearly been wrong and getting the wrong results, so we've caught a legitimate issue here. I think the best path forward for that one is to commit my libregex extensions and link that baby up so that \w works. Thanks, Kyle Evans On Wed, Jul 29, 2020, 22:53 Li-Wen Hsu wrote: > On Thu, Jul 30, 2020 at 7:22 AM Kyle Evans wrote: > > > > Author: kevans > > Date: Wed Jul 29 23:21:56 2020 > > New Revision: 363679 > > URL: https://svnweb.freebsd.org/changeset/base/363679 > > > > Log: > > regex(3): Interpret many escaped ordinary characters as EESCAPE > > > > In IEEE 1003.1-2008 [1] and earlier revisions, BRE/ERE grammar allows > for > > any character to be escaped, but "ORD_CHAR preceded by an unescaped > > character [gives undefined results]". > > > > Historically, we've interpreted an escaped ordinary character as the > > ordinary character itself. This becomes problematic when some > extensions > > give special meanings to an otherwise ordinary character > > (e.g. GNU's \b, \s, \w), meaning we may have two different valid > > interpretations of the same sequence. > > > > To make this easier to deal with and given that the standard calls this > > undefined, we should throw an error (EESCAPE) if we run into this > scenario > > to ease transition into a state where some escaped ordinaries are > blessed > > with a special meaning -- it will either error out or have extended > > behavior, rather than have two entirely different versions of undefined > > behavior that leave the consumer of regex(3) guessing as to what > behavior > > will be used or leaving them with false impressions. > > > > This change bumps the symbol version of regcomp to FBSD_1.6 and > provides the > > old escape semantics for legacy applications, just in case one has an > older > > application that would immediately turn into a pumpkin because of an > > extraneous escape that's embehttps:// > ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/lib.googletest.gtest_main/googletest-port-test/main/dded > or otherwise critical to its operation. > > > > This is the final piece needed before enhancing libregex with GNU > extensions > > and flipping the switch on bsdgrep. > > > > [1] http://pubs.opengroup.org/onlinepubs/9699919799.2016edition/ > > > > PR: 229925 (exp-run, courtesy of antoine) > > Differential Revision: https://reviews.freebsd.org/D10510 > > > > Modified: > > head/contrib/netbsd-tests/lib/libc/regex/data/meta.in > > head/contrib/netbsd-tests/lib/libc/regex/data/subexp.in > > head/lib/libc/regex/Symbol.map > > head/lib/libc/regex/regcomp.c > > I think there are 3 test cases need to be modified after this change: > > > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/lib.googletest.gtest_main/googletest-port-test/main/ > > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/usr.bin.diff/diff_test/side_by_side/ > > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/usr.bin.sed/sed2_test/hex_subst/ > > Please help to check them, thanks! > > Li-Wen > From owner-svn-src-head@freebsd.org Thu Jul 30 07:11:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8174937B037; Thu, 30 Jul 2020 07:11:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHM5T2tZNz3c4w; Thu, 30 Jul 2020 07:11:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 463ACD248; Thu, 30 Jul 2020 07:11:09 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06U7B94m074227; Thu, 30 Jul 2020 07:11:09 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06U7B9tF074226; Thu, 30 Jul 2020 07:11:09 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007300711.06U7B9tF074226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Jul 2020 07:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363688 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363688 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 07:11:09 -0000 Author: mjg Date: Thu Jul 30 07:11:08 2020 New Revision: 363688 URL: https://svnweb.freebsd.org/changeset/base/363688 Log: vfs: make sure startdir_used is always assigned to before use CID: 1431070 Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Thu Jul 30 04:05:59 2020 (r363687) +++ head/sys/kern/vfs_lookup.c Thu Jul 30 07:11:08 2020 (r363688) @@ -289,11 +289,13 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, struct pwd *pwd; cap_rights_t rights; struct filecaps dirfd_caps; - int error, startdir_used; + int error; + bool startdir_used; cnp = &ndp->ni_cnd; td = cnp->cn_thread; + startdir_used = false; *pwdp = NULL; #ifdef CAPABILITY_MODE @@ -340,7 +342,7 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, } else { if (ndp->ni_startdir != NULL) { *dpp = ndp->ni_startdir; - startdir_used = 1; + startdir_used = true; } else if (ndp->ni_dirfd == AT_FDCWD) { *dpp = pwd->pwd_cdir; vrefact(*dpp); From owner-svn-src-head@freebsd.org Thu Jul 30 07:26:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 557BB37BC54; Thu, 30 Jul 2020 07:26:12 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHMQr1Zcjz3chv; Thu, 30 Jul 2020 07:26:12 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 195ADD524; Thu, 30 Jul 2020 07:26:12 +0000 (UTC) (envelope-from whu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06U7QBHM084773; Thu, 30 Jul 2020 07:26:11 GMT (envelope-from whu@FreeBSD.org) Received: (from whu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06U7QBvq084772; Thu, 30 Jul 2020 07:26:11 GMT (envelope-from whu@FreeBSD.org) Message-Id: <202007300726.06U7QBvq084772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: whu set sender to whu@FreeBSD.org using -f From: Wei Hu Date: Thu, 30 Jul 2020 07:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363689 - head/sys/dev/hyperv/vmbus X-SVN-Group: head X-SVN-Commit-Author: whu X-SVN-Commit-Paths: head/sys/dev/hyperv/vmbus X-SVN-Commit-Revision: 363689 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 07:26:12 -0000 Author: whu Date: Thu Jul 30 07:26:11 2020 New Revision: 363689 URL: https://svnweb.freebsd.org/changeset/base/363689 Log: Prevent framebuffer mmio space from being allocated to other devices on HyperV. On Gen2 VMs, Hyper-V provides mmio space for framebuffer. This mmio address range is not useable for other PCI devices. Currently only efifb driver is using this range without reserving it from system. Therefore, vmbus driver reserves it before any other PCI device drivers start to request mmio addresses. PR: 222996 Submitted by: weh@microsoft.com Reported by: dmitry_kuleshov@ukr.net Reviewed by: decui@microsoft.com Sponsored by: Microsoft Modified: head/sys/dev/hyperv/vmbus/vmbus.c Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Thu Jul 30 07:11:08 2020 (r363688) +++ head/sys/dev/hyperv/vmbus/vmbus.c Thu Jul 30 07:26:11 2020 (r363689) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -46,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1332,12 +1334,66 @@ vmbus_get_mmio_res(device_t dev) vmbus_get_mmio_res_pass(dev, parse_32); } +/* + * On Gen2 VMs, Hyper-V provides mmio space for framebuffer. + * This mmio address range is not useable for other PCI devices. + * Currently only efifb driver is using this range without reserving + * it from system. + * Therefore, vmbus driver reserves it before any other PCI device + * drivers start to request mmio addresses. + */ +static struct resource *hv_fb_res; + static void +vmbus_fb_mmio_res(device_t dev) +{ + struct efi_fb *efifb; + caddr_t kmdp; + + struct vmbus_softc *sc = device_get_softc(dev); + int rid = 0; + + kmdp = preload_search_by_type("elf kernel"); + if (kmdp == NULL) + kmdp = preload_search_by_type("elf64 kernel"); + efifb = (struct efi_fb *)preload_search_info(kmdp, + MODINFO_METADATA | MODINFOMD_EFI_FB); + if (efifb == NULL) { + if (bootverbose) + device_printf(dev, + "fb has no preloaded kernel efi information\n"); + /* We are on Gen1 VM, just return. */ + return; + } else { + if (bootverbose) + device_printf(dev, + "efifb: fb_addr: %#jx, size: %#jx, " + "actual size needed: 0x%x\n", + efifb->fb_addr, efifb->fb_size, + (int) efifb->fb_height * efifb->fb_width); + } + + hv_fb_res = pcib_host_res_alloc(&sc->vmbus_mmio_res, dev, + SYS_RES_MEMORY, &rid, + efifb->fb_addr, efifb->fb_addr + efifb->fb_size, efifb->fb_size, + RF_ACTIVE | rman_make_alignment_flags(PAGE_SIZE)); + + if (hv_fb_res && bootverbose) + device_printf(dev, + "successfully reserved memory for framebuffer " + "starting at %#jx, size %#jx\n", + efifb->fb_addr, efifb->fb_size); +} + +static void vmbus_free_mmio_res(device_t dev) { struct vmbus_softc *sc = device_get_softc(dev); pcib_host_res_free(dev, &sc->vmbus_mmio_res); + + if (hv_fb_res) + hv_fb_res = NULL; } #endif /* NEW_PCIB */ @@ -1387,6 +1443,7 @@ vmbus_doattach(struct vmbus_softc *sc) #ifdef NEW_PCIB vmbus_get_mmio_res(sc->vmbus_dev); + vmbus_fb_mmio_res(sc->vmbus_dev); #endif sc->vmbus_flags |= VMBUS_FLAG_ATTACHED; From owner-svn-src-head@freebsd.org Thu Jul 30 11:26:49 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 93CB33A23B1; Thu, 30 Jul 2020 11:26:49 +0000 (UTC) (envelope-from se@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHSmT3RqGz4D6k; Thu, 30 Jul 2020 11:26:49 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MacBook-Pro-449.fritz.box (p200300cd5f2774009111951f0e662ec3.dip0.t-ipconnect.de [IPv6:2003:cd:5f27:7400:9111:951f:e66:2ec3]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id B9F2A1D57A; Thu, 30 Jul 2020 11:26:48 +0000 (UTC) (envelope-from se@freebsd.org) Subject: Re: svn commit: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex To: Kyle Evans References: <202007292321.06TNLuoq087451@repo.freebsd.org> From: =?UTF-8?Q?Stefan_E=c3=9fer?= Autocrypt: addr=se@freebsd.org; keydata= mQENBFVxiRIBCADOLNOZBsqlplHUQ3tG782FNtVT33rQli9EjNt2fhFERHIo4NxHlWBpHLnU b0s4L/eItx7au0i7Gegv01A9LUMwOnAc9EFAm4EW3Wmoa6MYrcP7xDClohg/Y69f7SNpEs3x YATBy+L6NzWZbJjZXD4vqPgZSDuMcLU7BEdJf0f+6h1BJPnGuwHpsSdnnMrZeIM8xQ8PPUVQ L0GZkVojHgNUngJH6e21qDrud0BkdiBcij0M3TCP4GQrJ/YMdurfc8mhueLpwGR2U1W8TYB7 4UY+NLw0McThOCLCxXflIeF/Y7jSB0zxzvb/H3LWkodUTkV57yX9IbUAGA5RKRg9zsUtABEB AAG0J1N0ZWZhbiBFw59lciAoRnJlZUJTRCkgPHNlQGZyZWVic2Qub3JnPokBVAQTAQoAPgIb AwULCQgHAwUVCgkICwUWAwIBAAIeAQIXgBYhBKNx6mWcC+zIK3FTE0frte9a/fVEBQJa8u+q BQkLJQETAAoJEEfrte9a/fVEOeMH/icmdK1eZQvB3U8quJo9VMaZsaTuCMbUE4NThyfsIvIm MCd+rb/yULmMYwqNfjyKB1x4ikR4x+94l+yJoz7K0Usks+eNKDmMGJM6pWWssTigaJubFdVd hVVC+C1QJi7JshYSib08uONoPmO4lv5Az0TDYGtsMzsES2sIlc62c9go5WPGYhQFRbX3Lk6y V6m8OHh+G9XGSj3oPO4UteRwu+SzTdOLunZBWG1wu34+IeZm663D+2gOppQLWpLa2qaTerqw THu377ayZ2B2LPJ5JkvkZeHYPkwDQ+b5PGn0UhfkxPnDVYki5F7qKxvQ5uq1/q9YaCX7mmOl H2yO7tgVsrW5AQ0EVXGJEgEIALEj9qCXMZVucjpcd3QxM/TlUr98m5viEd1z4tCnPUyRWcIC EVtj2h5xMH+2iB0q1+KWhq+NsWtvScmEmfHnsr7dJ1K677OdpDhKVaJk61eeRulFY1R4yb6C 1MMxK+WgYB+vvpG0UeyR0M4uBewcPvRsq4yGUHFQKtLAbMdoPTSryJA+ElnmK1vdY+rPcHgi OIMBZM7ahsPXC0C9K4e5SP9clGyIoMpbfHXdx9q+Rp3zVtlbhyk3BS/xccu/+9pk9ICXL6GR js2sNnJ0wxdU1DsAlC59a5MnSruwiZFwRnkQhr3x6wk97Lg7sLS9jjTnCN7LGlVmSmpOEMy6 uq1AWfUAEQEAAYkBPAQYAQoAJgIbDBYhBKNx6mWcC+zIK3FTE0frte9a/fVEBQJa8u+rBQkL JQEZAAoJEEfrte9a/fVEuesH/2DNxGWnHvWwMyiyhlQtafvDKwEn/wAgR8gHJFodB7emf8rA TnukH7MVttCoHtjN5lvv9RSBHjNTZls5wR/ANlwdRuPQHd8ZGxLe3S6IuUB3zDSwFltLGurO N2kOMhs5mTGyypSa+uw3rtQbUAVYf1oPbiR4FLtiM8FLyEvE95hX5fPq9Qvx9FmN79kmCIEw jDKPqDaUf/OR2fEF0LSIbXHEk4tNqCEwx5DIJ0fp5/z5UzICUAmwxyRs5O/Hre1jzPsMVyud Ml9t7UTOJGKVWwRory1PMnOFxN+iz5/d4FhYSKXF7kfMiFgol4LuWaxJRwbBrr71VGBrRy2a L1nw6Bc= Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <270c05f8-c75d-363f-c067-18c4c4773338@freebsd.org> Date: Thu, 30 Jul 2020 13:26:46 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <202007292321.06TNLuoq087451@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 11:26:49 -0000 Am 30.07.20 um 01:21 schrieb Kyle Evans: [...] > This change bumps the symbol version of regcomp to FBSD_1.6 and provides the > old escape semantics for legacy applications, just in case one has an older > application that would immediately turn into a pumpkin because of an > extraneous escape that's embedded or otherwise critical to its operation. I get an error during make buildworld with option WITH_TESTS=yes: ===> usr.bin/bmake/tests (install) ld-elf.so.1: /usr/src/amd64.amd64/tmp/legacy/usr/sbin/make: Undefined symbol "regcomp@FBSD_1.6" Regards, STefan From owner-svn-src-head@freebsd.org Thu Jul 30 11:46:29 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 660863A267F; Thu, 30 Jul 2020 11:46:29 +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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHTC91xWNz4FGk; Thu, 30 Jul 2020 11:46:29 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 1F6051E033; Thu, 30 Jul 2020 11:46:29 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f170.google.com with SMTP id k18so20019324qtm.10; Thu, 30 Jul 2020 04:46:29 -0700 (PDT) X-Gm-Message-State: AOAM530H/p3Jyyxwrc8ei/sWyD1xRb894Bvqq5Wp3/em16dFe9entuzg HpWV74KJGFCtqjtcRXqN6UkajBVJLYDUJOp3/aE= X-Google-Smtp-Source: ABdhPJw1sGjIhtl9EqcIPKh2jDGc/QWqSw6ooSqpnEXN7TK+JZOZ71m0I7OKKnaK9dyZERe+KOwtB71saeO6PvJ5JDM= X-Received: by 2002:aed:2822:: with SMTP id r31mr2445337qtd.310.1596109588542; Thu, 30 Jul 2020 04:46:28 -0700 (PDT) MIME-Version: 1.0 References: <202007292321.06TNLuoq087451@repo.freebsd.org> <270c05f8-c75d-363f-c067-18c4c4773338@freebsd.org> In-Reply-To: <270c05f8-c75d-363f-c067-18c4c4773338@freebsd.org> From: Kyle Evans Date: Thu, 30 Jul 2020 06:46:17 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex To: =?UTF-8?B?U3RlZmFuIEXDn2Vy?= Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 11:46:29 -0000 On Thu, Jul 30, 2020 at 6:26 AM Stefan E=C3=9Fer wrote: > > Am 30.07.20 um 01:21 schrieb Kyle Evans: > [...] > > This change bumps the symbol version of regcomp to FBSD_1.6 and provi= des the > > old escape semantics for legacy applications, just in case one has an= older > > application that would immediately turn into a pumpkin because of an > > extraneous escape that's embedded or otherwise critical to its operat= ion. > > I get an error during make buildworld with option WITH_TESTS=3Dyes: > > =3D=3D=3D> usr.bin/bmake/tests (install) > ld-elf.so.1: /usr/src/amd64.amd64/tmp/legacy/usr/sbin/make: Undefined > symbol "regcomp@FBSD_1.6" > > Regards, STefan Hi, Can you describe the environment in which you're running installworld, please? i.e. is it just a raw installworld directly in your shell, or something more complicated? I observed this in testing an exceptional scenario; running installworld in a buildenv. installworld injects .WAIT between lib and libexec + other subdirs, which is supposed to prevent stuff like this (new binary got installed linked against new libc before new libc). Running in a buildenv set SYSROOT and stripped out the .WAITs, leaving me with an annoyance where I had to installworld twice. Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Thu Jul 30 11:48:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E3713A2870; Thu, 30 Jul 2020 11:48:58 +0000 (UTC) (envelope-from gbe@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHTG20QcKz4FRb; Thu, 30 Jul 2020 11:48:58 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from localhost (p4fd3ae86.dip0.t-ipconnect.de [79.211.174.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gbe) by smtp.freebsd.org (Postfix) with ESMTPSA id A75161E10F; Thu, 30 Jul 2020 11:48:57 +0000 (UTC) (envelope-from gbe@freebsd.org) Date: Thu, 30 Jul 2020 13:48:56 +0200 From: Gordon Bergling To: Stefan =?iso-8859-1?Q?E=DFer?= Cc: Kyle Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, david@catwhisker.org Subject: Re: svn commit: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex Message-ID: <20200730114856.GA21708@lion.0xfce3.net> References: <202007292321.06TNLuoq087451@repo.freebsd.org> <270c05f8-c75d-363f-c067-18c4c4773338@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <270c05f8-c75d-363f-c067-18c4c4773338@freebsd.org> X-Url: X-Operating-System: FreeBSD 12.1-STABLE amd64 X-Host-Uptime: 1:42PM up 2 days, 19:34, 4 users, load averages: 0.38, 0.33, 0.31 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 11:48:58 -0000 On Thu, Jul 30, 2020 at 01:26:46PM +0200, Stefan Eßer wrote: > Am 30.07.20 um 01:21 schrieb Kyle Evans: > [...] > > This change bumps the symbol version of regcomp to FBSD_1.6 and provides the > > old escape semantics for legacy applications, just in case one has an older > > application that would immediately turn into a pumpkin because of an > > extraneous escape that's embedded or otherwise critical to its operation. > > I get an error during make buildworld with option WITH_TESTS=yes: > > ===> usr.bin/bmake/tests (install) > ld-elf.so.1: /usr/src/amd64.amd64/tmp/legacy/usr/sbin/make: Undefined > symbol "regcomp@FBSD_1.6" > > Regards, STefan I got the same error this morning and was able to solve it by doing a full buildworld without NO_CLEAN=yes. You may want to try this in case you are using NO_CLEAN=yes. --Gordon From owner-svn-src-head@freebsd.org Thu Jul 30 11:54:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A9373A2E34; Thu, 30 Jul 2020 11:54:28 +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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHTNN0skQz4G3Q; Thu, 30 Jul 2020 11:54:28 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id F08521E285; Thu, 30 Jul 2020 11:54:27 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f181.google.com with SMTP id o22so19819698qtt.13; Thu, 30 Jul 2020 04:54:27 -0700 (PDT) X-Gm-Message-State: AOAM5310veQG9+vg13w7J01CIEqpkHBfY/EwlqjgicKQ73QHMzyAH92W 6jQAk3JCLH5ap4g9fggjn0ab9N6J0gUOR9LDGAk= X-Google-Smtp-Source: ABdhPJx9W4M3QhWQoh+aAGWskWswUee4IqP3HRemPf/KnWoy1HveDQ0NRTnseJdVVO0Vm+hQ/7m/Zg0faYoDpZBdWb0= X-Received: by 2002:ac8:7a66:: with SMTP id w6mr2583311qtt.242.1596110067577; Thu, 30 Jul 2020 04:54:27 -0700 (PDT) MIME-Version: 1.0 References: <202007292321.06TNLuoq087451@repo.freebsd.org> <270c05f8-c75d-363f-c067-18c4c4773338@freebsd.org> <20200730114856.GA21708@lion.0xfce3.net> In-Reply-To: <20200730114856.GA21708@lion.0xfce3.net> From: Kyle Evans Date: Thu, 30 Jul 2020 06:54:16 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex To: Gordon Bergling Cc: =?UTF-8?B?U3RlZmFuIEXDn2Vy?= , src-committers , svn-src-all , svn-src-head , David Wolfskill Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 11:54:28 -0000 On Thu, Jul 30, 2020 at 6:48 AM Gordon Bergling wrote: > > On Thu, Jul 30, 2020 at 01:26:46PM +0200, Stefan E=C3=9Fer wrote: > > Am 30.07.20 um 01:21 schrieb Kyle Evans: > > [...] > > > This change bumps the symbol version of regcomp to FBSD_1.6 and pro= vides the > > > old escape semantics for legacy applications, just in case one has = an older > > > application that would immediately turn into a pumpkin because of a= n > > > extraneous escape that's embedded or otherwise critical to its oper= ation. > > > > I get an error during make buildworld with option WITH_TESTS=3Dyes: > > > > =3D=3D=3D> usr.bin/bmake/tests (install) > > ld-elf.so.1: /usr/src/amd64.amd64/tmp/legacy/usr/sbin/make: Undefined > > symbol "regcomp@FBSD_1.6" > > > > Regards, STefan > > I got the same error this morning and was able to solve it by doing a ful= l > buildworld without NO_CLEAN=3Dyes. > > You may want to try this in case you are using NO_CLEAN=3Dyes. > This is interesting; there shouldn't be any NO_CLEAN implications with this change. There were no dependency changes, libc should definitely get rebuilt because regcomp.c changed and thus, the libc in your objdir should have the symbol. The binary referenced above is one that we symlink into OBJDIR from the host system. I think it's also likely your problem was just fixed by the second installworld. The first one will manage to get libc installed, but not before you get errors from all the other stuff. Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Thu Jul 30 12:02:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C41BE3A3DAD; Thu, 30 Jul 2020 12:02:17 +0000 (UTC) (envelope-from se@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHTYP4sH4z4H6S; Thu, 30 Jul 2020 12:02:17 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MacBook-Pro-449.fritz.box (p200300cd5f2774009111951f0e662ec3.dip0.t-ipconnect.de [IPv6:2003:cd:5f27:7400:9111:951f:e66:2ec3]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 9A6D51E09A; Thu, 30 Jul 2020 12:02:16 +0000 (UTC) (envelope-from se@freebsd.org) Subject: Re: svn commit: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex To: Gordon Bergling Cc: Kyle Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, david@catwhisker.org References: <202007292321.06TNLuoq087451@repo.freebsd.org> <270c05f8-c75d-363f-c067-18c4c4773338@freebsd.org> <20200730114856.GA21708@lion.0xfce3.net> From: =?UTF-8?Q?Stefan_E=c3=9fer?= Autocrypt: addr=se@freebsd.org; keydata= mQENBFVxiRIBCADOLNOZBsqlplHUQ3tG782FNtVT33rQli9EjNt2fhFERHIo4NxHlWBpHLnU b0s4L/eItx7au0i7Gegv01A9LUMwOnAc9EFAm4EW3Wmoa6MYrcP7xDClohg/Y69f7SNpEs3x YATBy+L6NzWZbJjZXD4vqPgZSDuMcLU7BEdJf0f+6h1BJPnGuwHpsSdnnMrZeIM8xQ8PPUVQ L0GZkVojHgNUngJH6e21qDrud0BkdiBcij0M3TCP4GQrJ/YMdurfc8mhueLpwGR2U1W8TYB7 4UY+NLw0McThOCLCxXflIeF/Y7jSB0zxzvb/H3LWkodUTkV57yX9IbUAGA5RKRg9zsUtABEB AAG0J1N0ZWZhbiBFw59lciAoRnJlZUJTRCkgPHNlQGZyZWVic2Qub3JnPokBVAQTAQoAPgIb AwULCQgHAwUVCgkICwUWAwIBAAIeAQIXgBYhBKNx6mWcC+zIK3FTE0frte9a/fVEBQJa8u+q BQkLJQETAAoJEEfrte9a/fVEOeMH/icmdK1eZQvB3U8quJo9VMaZsaTuCMbUE4NThyfsIvIm MCd+rb/yULmMYwqNfjyKB1x4ikR4x+94l+yJoz7K0Usks+eNKDmMGJM6pWWssTigaJubFdVd hVVC+C1QJi7JshYSib08uONoPmO4lv5Az0TDYGtsMzsES2sIlc62c9go5WPGYhQFRbX3Lk6y V6m8OHh+G9XGSj3oPO4UteRwu+SzTdOLunZBWG1wu34+IeZm663D+2gOppQLWpLa2qaTerqw THu377ayZ2B2LPJ5JkvkZeHYPkwDQ+b5PGn0UhfkxPnDVYki5F7qKxvQ5uq1/q9YaCX7mmOl H2yO7tgVsrW5AQ0EVXGJEgEIALEj9qCXMZVucjpcd3QxM/TlUr98m5viEd1z4tCnPUyRWcIC EVtj2h5xMH+2iB0q1+KWhq+NsWtvScmEmfHnsr7dJ1K677OdpDhKVaJk61eeRulFY1R4yb6C 1MMxK+WgYB+vvpG0UeyR0M4uBewcPvRsq4yGUHFQKtLAbMdoPTSryJA+ElnmK1vdY+rPcHgi OIMBZM7ahsPXC0C9K4e5SP9clGyIoMpbfHXdx9q+Rp3zVtlbhyk3BS/xccu/+9pk9ICXL6GR js2sNnJ0wxdU1DsAlC59a5MnSruwiZFwRnkQhr3x6wk97Lg7sLS9jjTnCN7LGlVmSmpOEMy6 uq1AWfUAEQEAAYkBPAQYAQoAJgIbDBYhBKNx6mWcC+zIK3FTE0frte9a/fVEBQJa8u+rBQkL JQEZAAoJEEfrte9a/fVEuesH/2DNxGWnHvWwMyiyhlQtafvDKwEn/wAgR8gHJFodB7emf8rA TnukH7MVttCoHtjN5lvv9RSBHjNTZls5wR/ANlwdRuPQHd8ZGxLe3S6IuUB3zDSwFltLGurO N2kOMhs5mTGyypSa+uw3rtQbUAVYf1oPbiR4FLtiM8FLyEvE95hX5fPq9Qvx9FmN79kmCIEw jDKPqDaUf/OR2fEF0LSIbXHEk4tNqCEwx5DIJ0fp5/z5UzICUAmwxyRs5O/Hre1jzPsMVyud Ml9t7UTOJGKVWwRory1PMnOFxN+iz5/d4FhYSKXF7kfMiFgol4LuWaxJRwbBrr71VGBrRy2a L1nw6Bc= Message-ID: <1084ccea-e91c-eefe-9628-837b6f3fa7d0@freebsd.org> Date: Thu, 30 Jul 2020 14:02:15 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200730114856.GA21708@lion.0xfce3.net> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 12:02:17 -0000 Am 30.07.20 um 13:48 schrieb Gordon Bergling: > On Thu, Jul 30, 2020 at 01:26:46PM +0200, Stefan Eßer wrote: >> Am 30.07.20 um 01:21 schrieb Kyle Evans: >> [...] >>> This change bumps the symbol version of regcomp to FBSD_1.6 and provides the >>> old escape semantics for legacy applications, just in case one has an older >>> application that would immediately turn into a pumpkin because of an >>> extraneous escape that's embedded or otherwise critical to its operation. >> >> I get an error during make buildworld with option WITH_TESTS=yes: >> >> ===> usr.bin/bmake/tests (install) >> ld-elf.so.1: /usr/src/amd64.amd64/tmp/legacy/usr/sbin/make: Undefined >> symbol "regcomp@FBSD_1.6" >> >> Regards, STefan > > I got the same error this morning and was able to solve it by doing a full > buildworld without NO_CLEAN=yes. > > You may want to try this in case you are using NO_CLEAN=yes. Too late ... but thanks for the hint ... I have restarted make buildworld installworld on an unmodified source tree from when the error occurred and it just finished, without error this time. Maybe that it will work with WITH_TESTS too, now - I'll start another build/install cycle now and will report back. If it does not work, I'll try without NO_CLEAN (I'm building with META_MODE enabled, normally). Regards, STefan From owner-svn-src-head@freebsd.org Thu Jul 30 12:17:56 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B0F53A47B5; Thu, 30 Jul 2020 12:17:56 +0000 (UTC) (envelope-from se@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHTvS0sMtz4JSY; Thu, 30 Jul 2020 12:17:56 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MacBook-Pro-449.fritz.box (p200300cd5f2774009111951f0e662ec3.dip0.t-ipconnect.de [IPv6:2003:cd:5f27:7400:9111:951f:e66:2ec3]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 31F3E1E048; Thu, 30 Jul 2020 12:17:55 +0000 (UTC) (envelope-from se@freebsd.org) Subject: Re: svn commit: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex To: Kyle Evans Cc: Gordon Bergling , src-committers , svn-src-all , svn-src-head , David Wolfskill References: <202007292321.06TNLuoq087451@repo.freebsd.org> <270c05f8-c75d-363f-c067-18c4c4773338@freebsd.org> <20200730114856.GA21708@lion.0xfce3.net> From: =?UTF-8?Q?Stefan_E=c3=9fer?= Autocrypt: addr=se@freebsd.org; keydata= mQENBFVxiRIBCADOLNOZBsqlplHUQ3tG782FNtVT33rQli9EjNt2fhFERHIo4NxHlWBpHLnU b0s4L/eItx7au0i7Gegv01A9LUMwOnAc9EFAm4EW3Wmoa6MYrcP7xDClohg/Y69f7SNpEs3x YATBy+L6NzWZbJjZXD4vqPgZSDuMcLU7BEdJf0f+6h1BJPnGuwHpsSdnnMrZeIM8xQ8PPUVQ L0GZkVojHgNUngJH6e21qDrud0BkdiBcij0M3TCP4GQrJ/YMdurfc8mhueLpwGR2U1W8TYB7 4UY+NLw0McThOCLCxXflIeF/Y7jSB0zxzvb/H3LWkodUTkV57yX9IbUAGA5RKRg9zsUtABEB AAG0J1N0ZWZhbiBFw59lciAoRnJlZUJTRCkgPHNlQGZyZWVic2Qub3JnPokBVAQTAQoAPgIb AwULCQgHAwUVCgkICwUWAwIBAAIeAQIXgBYhBKNx6mWcC+zIK3FTE0frte9a/fVEBQJa8u+q BQkLJQETAAoJEEfrte9a/fVEOeMH/icmdK1eZQvB3U8quJo9VMaZsaTuCMbUE4NThyfsIvIm MCd+rb/yULmMYwqNfjyKB1x4ikR4x+94l+yJoz7K0Usks+eNKDmMGJM6pWWssTigaJubFdVd hVVC+C1QJi7JshYSib08uONoPmO4lv5Az0TDYGtsMzsES2sIlc62c9go5WPGYhQFRbX3Lk6y V6m8OHh+G9XGSj3oPO4UteRwu+SzTdOLunZBWG1wu34+IeZm663D+2gOppQLWpLa2qaTerqw THu377ayZ2B2LPJ5JkvkZeHYPkwDQ+b5PGn0UhfkxPnDVYki5F7qKxvQ5uq1/q9YaCX7mmOl H2yO7tgVsrW5AQ0EVXGJEgEIALEj9qCXMZVucjpcd3QxM/TlUr98m5viEd1z4tCnPUyRWcIC EVtj2h5xMH+2iB0q1+KWhq+NsWtvScmEmfHnsr7dJ1K677OdpDhKVaJk61eeRulFY1R4yb6C 1MMxK+WgYB+vvpG0UeyR0M4uBewcPvRsq4yGUHFQKtLAbMdoPTSryJA+ElnmK1vdY+rPcHgi OIMBZM7ahsPXC0C9K4e5SP9clGyIoMpbfHXdx9q+Rp3zVtlbhyk3BS/xccu/+9pk9ICXL6GR js2sNnJ0wxdU1DsAlC59a5MnSruwiZFwRnkQhr3x6wk97Lg7sLS9jjTnCN7LGlVmSmpOEMy6 uq1AWfUAEQEAAYkBPAQYAQoAJgIbDBYhBKNx6mWcC+zIK3FTE0frte9a/fVEBQJa8u+rBQkL JQEZAAoJEEfrte9a/fVEuesH/2DNxGWnHvWwMyiyhlQtafvDKwEn/wAgR8gHJFodB7emf8rA TnukH7MVttCoHtjN5lvv9RSBHjNTZls5wR/ANlwdRuPQHd8ZGxLe3S6IuUB3zDSwFltLGurO N2kOMhs5mTGyypSa+uw3rtQbUAVYf1oPbiR4FLtiM8FLyEvE95hX5fPq9Qvx9FmN79kmCIEw jDKPqDaUf/OR2fEF0LSIbXHEk4tNqCEwx5DIJ0fp5/z5UzICUAmwxyRs5O/Hre1jzPsMVyud Ml9t7UTOJGKVWwRory1PMnOFxN+iz5/d4FhYSKXF7kfMiFgol4LuWaxJRwbBrr71VGBrRy2a L1nw6Bc= Message-ID: <0f9136da-9c0f-93eb-d51b-63d637081d49@freebsd.org> Date: Thu, 30 Jul 2020 14:17:54 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 12:17:56 -0000 Am 30.07.20 um 13:54 schrieb Kyle Evans: > On Thu, Jul 30, 2020 at 6:48 AM Gordon Bergling wrote: >> I got the same error this morning and was able to solve it by doing a full >> buildworld without NO_CLEAN=yes. >> >> You may want to try this in case you are using NO_CLEAN=yes. >> > > This is interesting; there shouldn't be any NO_CLEAN implications with > this change. There were no dependency changes, libc should definitely > get rebuilt because regcomp.c changed and thus, the libc in your > objdir should have the symbol. The binary referenced above is one that > we symlink into OBJDIR from the host system. > > I think it's also likely your problem was just fixed by the second > installworld. The first one will manage to get libc installed, but not > before you get errors from all the other stuff. This appears to be true: after once completing installworld with WITHOUT_TESTS=yes the build and installation does also succeed for subsequent runs with WITH_TESTS=yes. My guess is that "make install" in tests tries to link against the base system version of the library and the freshly built one with the correct symbol version has not been installed, yet. Regards, STefan From owner-svn-src-head@freebsd.org Thu Jul 30 13:33:46 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 937D73A5D6D; Thu, 30 Jul 2020 13:33:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHWZy325zz4NJ7; Thu, 30 Jul 2020 13:33:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BAB811B9D; Thu, 30 Jul 2020 13:33:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06UDXka6018687; Thu, 30 Jul 2020 13:33:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06UDXk8L018686; Thu, 30 Jul 2020 13:33:46 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202007301333.06UDXk8L018686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 30 Jul 2020 13:33:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363692 - head/usr.bin/diff/tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/diff/tests X-SVN-Commit-Revision: 363692 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 13:33:46 -0000 Author: kevans Date: Thu Jul 30 13:33:45 2020 New Revision: 363692 URL: https://svnweb.freebsd.org/changeset/base/363692 Log: diff: fix side_by_side after r363679 It's currently unclear to me how this could have worked previously; \n here is not a literal newline but actual '\' 'n', and was getting passed to the underlying regex engine as such. regex(3) does not translate this to a newline, and this became an error because we don't really allow escaping of arbitrary ordinary characters anymore. Run the pattern strings through printf to make sure we're dealing with real newlines before passing them through to atf_check, which ultimately feeds them directly to regcomp(3). This fix is different than that will be needed for sed, in that this is the proper way to inject newlines into search strings as long as regex(3) won't combine \ + n as folks might expect. Reported by: Jenkins via lwhsu MFC after: 1 week Modified: head/usr.bin/diff/tests/diff_test.sh Modified: head/usr.bin/diff/tests/diff_test.sh ============================================================================== --- head/usr.bin/diff/tests/diff_test.sh Thu Jul 30 13:17:01 2020 (r363691) +++ head/usr.bin/diff/tests/diff_test.sh Thu Jul 30 13:33:45 2020 (r363692) @@ -108,8 +108,8 @@ side_by_side_body() atf_check -o save:A printf "A\nB\nC\n" atf_check -o save:B printf "D\nB\nE\n" - exp_output="A[[:space:]]+|[[:space:]]+D\nB[[:space:]]+B\nC[[:space:]]+|[[:space:]]+E" - exp_output_suppressed="A[[:space:]]+|[[:space:]]+D\nC[[:space:]]+|[[:space:]]+E" + exp_output=$(printf "A[[:space:]]+|[[:space:]]+D\nB[[:space:]]+B\nC[[:space:]]+|[[:space:]]+E") + exp_output_suppressed=$(printf "A[[:space:]]+|[[:space:]]+D\nC[[:space:]]+|[[:space:]]+E") atf_check -o match:"$exp_output" -s exit:1 \ diff --side-by-side A B From owner-svn-src-head@freebsd.org Thu Jul 30 13:36:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F28243A5CEB; Thu, 30 Jul 2020 13:36:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHWf06BLgz4NDZ; Thu, 30 Jul 2020 13:36:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7C61118B9; Thu, 30 Jul 2020 13:36:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06UDaOIP018856; Thu, 30 Jul 2020 13:36:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06UDaOva018855; Thu, 30 Jul 2020 13:36:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202007301336.06UDaOva018855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 30 Jul 2020 13:36:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363693 - head/usr.bin/sed/tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/sed/tests X-SVN-Commit-Revision: 363693 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 13:36:25 -0000 Author: kevans Date: Thu Jul 30 13:36:24 2020 New Revision: 363693 URL: https://svnweb.freebsd.org/changeset/base/363693 Log: sed: fix hex_subst test after after r363679 r363679 is in-fact the future change referenced by the comment, helpfully left and forgotten by kevans. Instead of just silently not matching, we should now be erroring out with vigor. Modified: head/usr.bin/sed/tests/sed2_test.sh Modified: head/usr.bin/sed/tests/sed2_test.sh ============================================================================== --- head/usr.bin/sed/tests/sed2_test.sh Thu Jul 30 13:33:45 2020 (r363692) +++ head/usr.bin/sed/tests/sed2_test.sh Thu Jul 30 13:36:24 2020 (r363693) @@ -109,11 +109,9 @@ hex_subst_body() # Single digit \x should work as well. atf_check -o "inline:xn" sed 's/\xd/x/' c - # Invalid digit should cause us to ignore the sequence. This test - # invokes UB, escapes of an ordinary character. A future change will - # make regex(3) on longer tolerate this and we'll need to adjust what - # we're doing, but for now this will suffice. - atf_check -o "inline:" sed 's/\xx//' d + # This should get passed through to the underlying regex engine as + # \xx, which is an invalid escape of an ordinary character. + atf_check -s exit:1 -e not-empty sed 's/\xx//' d } atf_test_case commands_on_stdin From owner-svn-src-head@freebsd.org Thu Jul 30 14:45:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DACE53A76B1; Thu, 30 Jul 2020 14:45:07 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHY9H5mb6z4Scc; Thu, 30 Jul 2020 14:45:07 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA21E12842; Thu, 30 Jul 2020 14:45:07 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06UEj7s1062028; Thu, 30 Jul 2020 14:45:07 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06UEj5uj062013; Thu, 30 Jul 2020 14:45:05 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202007301445.06UEj5uj062013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Thu, 30 Jul 2020 14:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363700 - in head/sys: arm/ti arm/ti/am335x arm/ti/clk arm/ti/cpsw arm/ti/omap4 arm/ti/usb dev/uart modules X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: in head/sys: arm/ti arm/ti/am335x arm/ti/clk arm/ti/cpsw arm/ti/omap4 arm/ti/usb dev/uart modules X-SVN-Commit-Revision: 363700 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 14:45:07 -0000 Author: mmel Date: Thu Jul 30 14:45:05 2020 New Revision: 363700 URL: https://svnweb.freebsd.org/changeset/base/363700 Log: Move Ti AM335x to dev/extres/clk framework. Re-implement clocks for these SoC by using now standard extres/clk framework. This is necessary for future expansion of these. The new implementation is (due to the size of the patch) only the initial (minimum) version. It will be updated/expanded with a subsequent set of particular patches. This patch is also not tested on OMAP4 based boards (BeagleBone), so all possible issues should be (and will be) fixed by ASAP once identified. Submited by: Oskar Holmlund (oskar.holmlund@ohdata.se) Differential Revision: https://reviews.freebsd.org/D25118 Added: head/sys/arm/ti/am335x/am3359_cppi41.c (contents, props changed) head/sys/arm/ti/am335x/am335x_usb_phy.c (contents, props changed) head/sys/arm/ti/clk/ head/sys/arm/ti/clk/clock_common.c (contents, props changed) head/sys/arm/ti/clk/clock_common.h (contents, props changed) head/sys/arm/ti/clk/ti_clk_clkctrl.c (contents, props changed) head/sys/arm/ti/clk/ti_clk_clkctrl.h (contents, props changed) head/sys/arm/ti/clk/ti_clk_dpll.c (contents, props changed) head/sys/arm/ti/clk/ti_clk_dpll.h (contents, props changed) head/sys/arm/ti/clk/ti_clkctrl.c (contents, props changed) head/sys/arm/ti/clk/ti_divider_clock.c (contents, props changed) head/sys/arm/ti/clk/ti_dpll_clock.c (contents, props changed) head/sys/arm/ti/clk/ti_gate_clock.c (contents, props changed) head/sys/arm/ti/clk/ti_mux_clock.c (contents, props changed) head/sys/arm/ti/ti_omap4_cm.c (contents, props changed) head/sys/arm/ti/ti_omap4_cm.h (contents, props changed) head/sys/arm/ti/ti_prm.c (contents, props changed) head/sys/arm/ti/ti_prm.h (contents, props changed) head/sys/arm/ti/ti_scm_syscon.c (contents, props changed) head/sys/arm/ti/ti_sysc.h (contents, props changed) Deleted: head/sys/arm/ti/am335x/am335x_prcm.c head/sys/arm/ti/am335x/am335x_usbss.c head/sys/arm/ti/ti_hwmods.c head/sys/arm/ti/ti_hwmods.h Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c head/sys/arm/ti/am335x/am335x_dmtpps.c head/sys/arm/ti/am335x/am335x_dmtreg.h head/sys/arm/ti/am335x/am335x_gpio.c head/sys/arm/ti/am335x/am335x_lcd.c head/sys/arm/ti/am335x/am335x_musb.c head/sys/arm/ti/am335x/am335x_pwmss.c head/sys/arm/ti/am335x/am335x_rtc.c head/sys/arm/ti/am335x/am335x_scm.c head/sys/arm/ti/am335x/files.am335x head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/ti/files.ti head/sys/arm/ti/omap4/files.omap4 head/sys/arm/ti/ti_adc.c head/sys/arm/ti/ti_edma3.c head/sys/arm/ti/ti_gpio.c head/sys/arm/ti/ti_i2c.c head/sys/arm/ti/ti_mbox.c head/sys/arm/ti/ti_pinmux.c head/sys/arm/ti/ti_prcm.c head/sys/arm/ti/ti_prcm.h head/sys/arm/ti/ti_pruss.c head/sys/arm/ti/ti_scm.c head/sys/arm/ti/ti_sdhci.c head/sys/arm/ti/ti_sdma.c head/sys/arm/ti/ti_spi.c head/sys/arm/ti/ti_sysc.c head/sys/arm/ti/ti_wdt.c head/sys/arm/ti/usb/omap_ehci.c head/sys/arm/ti/usb/omap_host.c head/sys/arm/ti/usb/omap_tll.c head/sys/dev/uart/uart_dev_ti8250.c head/sys/modules/Makefile Added: head/sys/arm/ti/am335x/am3359_cppi41.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/am335x/am3359_cppi41.c Thu Jul 30 14:45:05 2020 (r363700) @@ -0,0 +1,192 @@ +/*- + * Copyright (c) 2019 Emmanuel Vadot + * + * Copyright (c) 2020 Oskar Holmlund + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +/* Based on sys/arm/ti/ti_sysc.c */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include + +#include + +#if 0 +#define DPRINTF(dev, msg...) device_printf(dev, msg) +#else +#define DPRINTF(dev, msg...) +#endif + +struct ti_am3359_cppi41_softc { + device_t dev; + struct syscon * syscon; + struct resource * res[4]; + bus_space_tag_t bst; + bus_space_handle_t bsh; + struct mtx mtx; +}; + +static struct resource_spec ti_am3359_cppi41_res_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE | RF_SHAREABLE }, + { SYS_RES_MEMORY, 1, RF_ACTIVE | RF_SHAREABLE }, + { SYS_RES_MEMORY, 2, RF_ACTIVE | RF_SHAREABLE }, + { SYS_RES_MEMORY, 3, RF_ACTIVE | RF_SHAREABLE }, + { -1, 0 } +}; + +/* Device */ +static struct ofw_compat_data compat_data[] = { + { "ti,am3359-cppi41", 1 }, + { NULL, 0 } +}; + +static int +ti_am3359_cppi41_write_4(device_t dev, bus_addr_t addr, uint32_t val) +{ + struct ti_am3359_cppi41_softc *sc; + + sc = device_get_softc(dev); + DPRINTF(sc->dev, "offset=%lx write %x\n", addr, val); + mtx_lock(&sc->mtx); + bus_space_write_4(sc->bst, sc->bsh, addr, val); + mtx_unlock(&sc->mtx); + return (0); +} + +static uint32_t +ti_am3359_cppi41_read_4(device_t dev, bus_addr_t addr) +{ + struct ti_am3359_cppi41_softc *sc; + uint32_t val; + + sc = device_get_softc(dev); + + mtx_lock(&sc->mtx); + val = bus_space_read_4(sc->bst, sc->bsh, addr); + mtx_unlock(&sc->mtx); + DPRINTF(sc->dev, "offset=%lx Read %x\n", addr, val); + return (val); +} + +/* device interface */ +static int +ti_am3359_cppi41_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "TI AM3359 CPPI 41"); + return(BUS_PROBE_DEFAULT); +} + +static int +ti_am3359_cppi41_attach(device_t dev) +{ + struct ti_am3359_cppi41_softc *sc; + phandle_t node; + uint32_t reg, reset_bit, timeout=10; + uint64_t sysc_address; + device_t parent; + + sc = device_get_softc(dev); + sc->dev = dev; + + if (bus_alloc_resources(dev, ti_am3359_cppi41_res_spec, sc->res)) { + device_printf(sc->dev, "Cant allocate resources\n"); + return (ENXIO); + } + + sc->dev = dev; + sc->bst = rman_get_bustag(sc->res[0]); + sc->bsh = rman_get_bushandle(sc->res[0]); + + mtx_init(&sc->mtx, device_get_nameunit(sc->dev), NULL, MTX_DEF); + node = ofw_bus_get_node(sc->dev); + + /* variant of am335x_usbss.c */ + DPRINTF(dev, "-- RESET USB --\n"); + parent = device_get_parent(dev); + reset_bit = ti_sysc_get_soft_reset_bit(parent); + if (reset_bit == 0) { + DPRINTF(dev, "Dont have reset bit\n"); + return (0); + } + sysc_address = ti_sysc_get_sysc_address_offset_host(parent); + DPRINTF(dev, "sysc_address %x\n", sysc_address); + ti_am3359_cppi41_write_4(dev, sysc_address, reset_bit); + DELAY(100); + reg = ti_am3359_cppi41_read_4(dev, sysc_address); + if ((reg & reset_bit) && timeout--) { + DPRINTF(dev, "Reset still ongoing - wait a little bit longer\n"); + DELAY(100); + reg = ti_am3359_cppi41_read_4(dev, sysc_address); + } + if (timeout == 0) + device_printf(dev, "USB Reset timeout\n"); + + return (0); +} + + +static device_method_t ti_am3359_cppi41_methods[] = { + DEVMETHOD(device_probe, ti_am3359_cppi41_probe), + DEVMETHOD(device_attach, ti_am3359_cppi41_attach), + + DEVMETHOD_END +}; + + +DEFINE_CLASS_1(ti_am3359_cppi41, ti_am3359_cppi41_driver, + ti_am3359_cppi41_methods,sizeof(struct ti_am3359_cppi41_softc), + simplebus_driver); + +static devclass_t ti_am3359_cppi41_devclass; + +EARLY_DRIVER_MODULE(ti_am3359_cppi41, simplebus, ti_am3359_cppi41_driver, + ti_am3359_cppi41_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); +MODULE_VERSION(ti_am3359_cppi41, 1); +MODULE_DEPEND(ti_am3359_cppi41, ti_sysc, 1, 1, 1); Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_dmtimer.c Thu Jul 30 14:42:50 2020 (r363699) +++ head/sys/arm/ti/am335x/am335x_dmtimer.c Thu Jul 30 14:45:05 2020 (r363700) @@ -42,12 +42,13 @@ __FBSDID("$FreeBSD$"); #include /* For arm_set_delay */ +#include + #include #include #include -#include -#include +#include #include "am335x_dmtreg.h" @@ -58,7 +59,8 @@ struct am335x_dmtimer_softc { int tmr_irq_rid; struct resource * tmr_irq_res; void *tmr_irq_handler; - uint32_t sysclk_freq; + clk_t clk_fck; + uint64_t sysclk_freq; uint32_t tclr; /* Cached TCLR register. */ union { struct timecounter tc; @@ -251,6 +253,7 @@ am335x_dmtimer_probe(device_t dev) { char strbuf[32]; int tmr_num; + uint64_t rev_address; if (!ofw_bus_status_okay(dev)) return (ENXIO); @@ -259,13 +262,22 @@ am335x_dmtimer_probe(device_t dev) return (ENXIO); /* - * Get the hardware unit number (the N from ti,hwmods="timerN"). + * Get the hardware unit number from address of rev register. * If this isn't the hardware unit we're going to use for either the * eventtimer or the timecounter, no point in instantiating the device. */ - tmr_num = ti_hwmods_get_unit(dev, "timer"); - if (tmr_num != ET_TMR_NUM && tmr_num != TC_TMR_NUM) - return (ENXIO); + rev_address = ti_sysc_get_rev_address(device_get_parent(dev)); + switch (rev_address) { + case DMTIMER2_REV: + tmr_num = 2; + break; + case DMTIMER3_REV: + tmr_num = 3; + break; + default: + /* Not DMTIMER2 or DMTIMER3 */ + return (ENXIO); + } snprintf(strbuf, sizeof(strbuf), "AM335x DMTimer%d", tmr_num); device_set_desc_copy(dev, strbuf); @@ -277,24 +289,47 @@ static int am335x_dmtimer_attach(device_t dev) { struct am335x_dmtimer_softc *sc; - clk_ident_t timer_id; int err; + uint64_t rev_address; + clk_t sys_clkin; sc = device_get_softc(dev); sc->dev = dev; - /* Get the base clock frequency. */ - if ((err = ti_prcm_clk_get_source_freq(SYS_CLK, &sc->sysclk_freq)) != 0) - return (err); + /* expect one clock */ + err = clk_get_by_ofw_index(dev, 0, 0, &sc->clk_fck); + if (err != 0) { + device_printf(dev, "Cant find clock index 0. err: %d\n", err); + return (ENXIO); + } + err = clk_get_by_name(dev, "sys_clkin_ck@40", &sys_clkin); + if (err != 0) { + device_printf(dev, "Cant find sys_clkin_ck@40 err: %d\n", err); + return (ENXIO); + } + + /* Select M_OSC as DPLL parent */ + err = clk_set_parent_by_clk(sc->clk_fck, sys_clkin); + if (err != 0) { + device_printf(dev, "Cant set mux to CLK_M_OSC\n"); + return (ENXIO); + } + /* Enable clocks and power on the device. */ - if ((timer_id = ti_hwmods_get_clock(dev)) == INVALID_CLK_IDENT) + err = ti_sysc_clock_enable(device_get_parent(dev)); + if (err != 0) { + device_printf(dev, "Cant enable sysc clkctrl, err %d\n", err); return (ENXIO); - if ((err = ti_prcm_clk_set_source(timer_id, SYSCLK_CLK)) != 0) - return (err); - if ((err = ti_prcm_clk_enable(timer_id)) != 0) - return (err); + } + /* Get the base clock frequency. */ + err = clk_get_freq(sc->clk_fck, &sc->sysclk_freq); + if (err != 0) { + device_printf(dev, "Cant get sysclk frequency, err %d\n", err); + return (ENXIO); + } + /* Request the memory resources. */ sc->tmr_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->tmr_mem_rid, RF_ACTIVE); @@ -302,7 +337,20 @@ am335x_dmtimer_attach(device_t dev) return (ENXIO); } - sc->tmr_num = ti_hwmods_get_unit(dev, "timer"); + rev_address = ti_sysc_get_rev_address(device_get_parent(dev)); + switch (rev_address) { + case DMTIMER2_REV: + sc->tmr_num = 2; + break; + case DMTIMER3_REV: + sc->tmr_num = 3; + break; + default: + device_printf(dev, "Not timer 2 or 3! %#jx\n", + rev_address); + return (ENXIO); + } + snprintf(sc->tmr_name, sizeof(sc->tmr_name), "DMTimer%d", sc->tmr_num); /* @@ -334,7 +382,7 @@ static driver_t am335x_dmtimer_driver = { static devclass_t am335x_dmtimer_devclass; DRIVER_MODULE(am335x_dmtimer, simplebus, am335x_dmtimer_driver, am335x_dmtimer_devclass, 0, 0); -MODULE_DEPEND(am335x_dmtimer, am335x_prcm, 1, 1, 1); +MODULE_DEPEND(am335x_dmtimer, ti_sysc, 1, 1, 1); static void am335x_dmtimer_delay(int usec, void *arg) Modified: head/sys/arm/ti/am335x/am335x_dmtpps.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_dmtpps.c Thu Jul 30 14:42:50 2020 (r363699) +++ head/sys/arm/ti/am335x/am335x_dmtpps.c Thu Jul 30 14:45:05 2020 (r363700) @@ -43,6 +43,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_platform.h" + #include #include #include @@ -60,9 +62,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include -#include -#include +#include #include #include @@ -82,6 +84,8 @@ struct dmtpps_softc { struct cdev * pps_cdev; struct pps_state pps_state; struct mtx pps_mtx; + clk_t clk_fck; + uint64_t sysclk_freq; }; static int dmtpps_tmr_num; /* Set by probe() */ @@ -383,6 +387,7 @@ dmtpps_probe(device_t dev) { char strbuf[64]; int tmr_num; + uint64_t rev_address; if (!ofw_bus_status_okay(dev)) return (ENXIO); @@ -402,7 +407,33 @@ dmtpps_probe(device_t dev) * Figure out which hardware timer is being probed and see if it matches * the configured timer number determined earlier. */ - tmr_num = ti_hwmods_get_unit(dev, "timer"); + rev_address = ti_sysc_get_rev_address(device_get_parent(dev)); + switch (rev_address) { + case DMTIMER1_1MS_REV: + tmr_num = 1; + break; + case DMTIMER2_REV: + tmr_num = 2; + break; + case DMTIMER3_REV: + tmr_num = 3; + break; + case DMTIMER4_REV: + tmr_num = 4; + break; + case DMTIMER5_REV: + tmr_num = 5; + break; + case DMTIMER6_REV: + tmr_num = 6; + break; + case DMTIMER7_REV: + tmr_num = 7; + break; + default: + return (ENXIO); + } + if (dmtpps_tmr_num != tmr_num) return (ENXIO); @@ -418,23 +449,73 @@ dmtpps_attach(device_t dev) { struct dmtpps_softc *sc; struct make_dev_args mda; - clk_ident_t timer_id; - int err, sysclk_freq; + int err; + clk_t sys_clkin; + uint64_t rev_address; sc = device_get_softc(dev); sc->dev = dev; - /* Get the base clock frequency. */ - err = ti_prcm_clk_get_source_freq(SYS_CLK, &sysclk_freq); + /* Figure out which hardware timer this is and set the name string. */ + rev_address = ti_sysc_get_rev_address(device_get_parent(dev)); + switch (rev_address) { + case DMTIMER1_1MS_REV: + sc->tmr_num = 1; + break; + case DMTIMER2_REV: + sc->tmr_num = 2; + break; + case DMTIMER3_REV: + sc->tmr_num = 3; + break; + case DMTIMER4_REV: + sc->tmr_num = 4; + break; + case DMTIMER5_REV: + sc->tmr_num = 5; + break; + case DMTIMER6_REV: + sc->tmr_num = 6; + break; + case DMTIMER7_REV: + sc->tmr_num = 7; + break; + } + snprintf(sc->tmr_name, sizeof(sc->tmr_name), "DMTimer%d", sc->tmr_num); + /* expect one clock */ + err = clk_get_by_ofw_index(dev, 0, 0, &sc->clk_fck); + if (err != 0) { + device_printf(dev, "Cant find clock index 0. err: %d\n", err); + return (ENXIO); + } + + err = clk_get_by_name(dev, "sys_clkin_ck@40", &sys_clkin); + if (err != 0) { + device_printf(dev, "Cant find sys_clkin_ck@40 err: %d\n", err); + return (ENXIO); + } + + /* Select M_OSC as DPLL parent */ + err = clk_set_parent_by_clk(sc->clk_fck, sys_clkin); + if (err != 0) { + device_printf(dev, "Cant set mux to CLK_M_OSC\n"); + return (ENXIO); + } + /* Enable clocks and power on the device. */ - if ((timer_id = ti_hwmods_get_clock(dev)) == INVALID_CLK_IDENT) + err = ti_sysc_clock_enable(device_get_parent(dev)); + if (err != 0) { + device_printf(dev, "Cant enable sysc clkctrl, err %d\n", err); return (ENXIO); - if ((err = ti_prcm_clk_set_source(timer_id, SYSCLK_CLK)) != 0) - return (err); - if ((err = ti_prcm_clk_enable(timer_id)) != 0) - return (err); + } + /* Get the base clock frequency. */ + err = clk_get_freq(sc->clk_fck, &sc->sysclk_freq); + if (err != 0) { + device_printf(dev, "Cant get sysclk frequency, err %d\n", err); + return (ENXIO); + } /* Request the memory resources. */ sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, RF_ACTIVE); @@ -442,10 +523,6 @@ dmtpps_attach(device_t dev) return (ENXIO); } - /* Figure out which hardware timer this is and set the name string. */ - sc->tmr_num = ti_hwmods_get_unit(dev, "timer"); - snprintf(sc->tmr_name, sizeof(sc->tmr_name), "DMTimer%d", sc->tmr_num); - /* * Configure the timer pulse/capture pin to input/capture mode. This is * required in addition to configuring the pin as input with the pinmux @@ -468,7 +545,7 @@ dmtpps_attach(device_t dev) sc->tc.tc_name = sc->tmr_name; sc->tc.tc_get_timecount = dmtpps_get_timecount; sc->tc.tc_counter_mask = ~0u; - sc->tc.tc_frequency = sysclk_freq; + sc->tc.tc_frequency = sc->sysclk_freq; sc->tc.tc_quality = 1000; sc->tc.tc_priv = sc; @@ -541,5 +618,4 @@ static driver_t dmtpps_driver = { static devclass_t dmtpps_devclass; DRIVER_MODULE(am335x_dmtpps, simplebus, dmtpps_driver, dmtpps_devclass, 0, 0); -MODULE_DEPEND(am335x_dmtpps, am335x_prcm, 1, 1, 1); - +MODULE_DEPEND(am335x_dmtpps, ti_sysc, 1, 1, 1); Modified: head/sys/arm/ti/am335x/am335x_dmtreg.h ============================================================================== --- head/sys/arm/ti/am335x/am335x_dmtreg.h Thu Jul 30 14:42:50 2020 (r363699) +++ head/sys/arm/ti/am335x/am335x_dmtreg.h Thu Jul 30 14:45:05 2020 (r363700) @@ -73,4 +73,16 @@ #define DMT_TSICR_RESET (1 << 1) /* TSICR perform soft reset */ #define DMT_TCAR2 0x48 /* Capture Reg */ +/* Location of revision register from TRM Memory map chapter 2 */ +/* L4_WKUP */ +#define DMTIMER0_REV 0x05000 +#define DMTIMER1_1MS_REV 0x31000 +/* L4_PER */ +#define DMTIMER2_REV 0x40000 +#define DMTIMER3_REV 0x42000 +#define DMTIMER4_REV 0x44000 +#define DMTIMER5_REV 0x46000 +#define DMTIMER6_REV 0x48000 +#define DMTIMER7_REV 0x4A000 + #endif /* AM335X_DMTREG_H */ Modified: head/sys/arm/ti/am335x/am335x_gpio.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_gpio.c Thu Jul 30 14:42:50 2020 (r363699) +++ head/sys/arm/ti/am335x/am335x_gpio.c Thu Jul 30 14:45:05 2020 (r363700) @@ -155,3 +155,4 @@ DEFINE_CLASS_1(gpio, am335x_gpio_driver, am335x_gpio_m sizeof(struct ti_gpio_softc), ti_gpio_driver); DRIVER_MODULE(am335x_gpio, simplebus, am335x_gpio_driver, am335x_gpio_devclass, 0, 0); +MODULE_DEPEND(am335x_gpio, ti_sysc, 1, 1, 1); Modified: head/sys/arm/ti/am335x/am335x_lcd.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_lcd.c Thu Jul 30 14:42:50 2020 (r363699) +++ head/sys/arm/ti/am335x/am335x_lcd.c Thu Jul 30 14:45:05 2020 (r363700) @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); #include +#include + #include #include #include @@ -65,7 +67,7 @@ __FBSDID("$FreeBSD$"); #include #endif -#include +#include #include #include "am335x_lcd.h" @@ -219,6 +221,9 @@ struct am335x_lcd_softc { /* HDMI framer */ phandle_t sc_hdmi_framer; eventhandler_tag sc_hdmi_evh; + + /* Clock */ + clk_t sc_clk_dpll_disp_ck; }; static void @@ -615,24 +620,28 @@ am335x_lcd_configure(struct am335x_lcd_softc *sc) uint32_t hbp, hfp, hsw; uint32_t vbp, vfp, vsw; uint32_t width, height; - unsigned int ref_freq; + uint64_t ref_freq; int err; /* * try to adjust clock to get double of requested frequency * HDMI/DVI displays are very sensitive to error in frequncy value */ - if (ti_prcm_clk_set_source_freq(LCDC_CLK, sc->sc_panel.panel_pxl_clk*2)) { + + err = clk_set_freq(sc->sc_clk_dpll_disp_ck, sc->sc_panel.panel_pxl_clk*2, + CLK_SET_ROUND_ANY); + if (err != 0) { device_printf(sc->sc_dev, "can't set source frequency\n"); return (ENXIO); } - if (ti_prcm_clk_get_source_freq(LCDC_CLK, &ref_freq)) { + err = clk_get_freq(sc->sc_clk_dpll_disp_ck, &ref_freq); + if (err != 0) { device_printf(sc->sc_dev, "can't get reference frequency\n"); return (ENXIO); } - /* Panle initialization */ + /* Panel initialization */ dma_size = round_page(sc->sc_panel.panel_width*sc->sc_panel.panel_height*sc->sc_panel.bpp/8); /* @@ -967,6 +976,13 @@ am335x_lcd_attach(device_t dev) return (ENXIO); } + /* Fixme: Cant find any reference in DTS for dpll_disp_ck@498 for now. */ + err = clk_get_by_name(dev, "dpll_disp_ck@498", &sc->sc_clk_dpll_disp_ck); + if (err != 0) { + device_printf(dev, "Cant get dpll_disp_ck@49\n"); + return (ENXIO); + } + sc->sc_panel.ac_bias = 255; sc->sc_panel.ac_bias_intrpt = 0; sc->sc_panel.dma_burst_sz = 16; @@ -989,7 +1005,11 @@ am335x_lcd_attach(device_t dev) } } - ti_prcm_clk_enable(LCDC_CLK); + err = ti_sysc_clock_enable(device_get_parent(dev)); + if (err != 0) { + device_printf(dev, "Failed to enable sysc clkctrl, err %d\n", err); + return (ENXIO); + } rid = 0; sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, @@ -1081,3 +1101,4 @@ static devclass_t am335x_lcd_devclass; DRIVER_MODULE(am335x_lcd, simplebus, am335x_lcd_driver, am335x_lcd_devclass, 0, 0); MODULE_VERSION(am335x_lcd, 1); MODULE_DEPEND(am335x_lcd, simplebus, 1, 1, 1); +MODULE_DEPEND(am335x_lcd, ti_sysc, 1, 1, 1); Modified: head/sys/arm/ti/am335x/am335x_musb.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_musb.c Thu Jul 30 14:42:50 2020 (r363699) +++ head/sys/arm/ti/am335x/am335x_musb.c Thu Jul 30 14:45:05 2020 (r363700) @@ -66,9 +66,11 @@ __FBSDID("$FreeBSD$"); #include -#include -#include #include +#include +#include +#include +#include "syscon_if.h" #define USBCTRL_REV 0x00 #define USBCTRL_CTRL 0x14 @@ -130,6 +132,7 @@ struct musbotg_super_softc { struct musbotg_softc sc_otg; struct resource *sc_mem_res[2]; int sc_irq_rid; + struct syscon *syscon; }; static void @@ -155,30 +158,33 @@ static void musbotg_clocks_on(void *arg) { struct musbotg_softc *sc; - uint32_t c, reg; + struct musbotg_super_softc *ssc; + uint32_t reg; sc = arg; - reg = USB_CTRL[sc->sc_id]; + ssc = sc->sc_platform_data; - ti_scm_reg_read_4(reg, &c); - c &= ~3; /* Enable power */ - c |= 1 << 19; /* VBUS detect enable */ - c |= 1 << 20; /* Session end enable */ - ti_scm_reg_write_4(reg, c); + reg = SYSCON_READ_4(ssc->syscon, USB_CTRL[sc->sc_id]); + reg &= ~3; /* Enable power */ + reg |= 1 << 19; /* VBUS detect enable */ + reg |= 1 << 20; /* Session end enable */ + + SYSCON_WRITE_4(ssc->syscon, USB_CTRL[sc->sc_id], reg); } static void musbotg_clocks_off(void *arg) { struct musbotg_softc *sc; - uint32_t c, reg; + struct musbotg_super_softc *ssc; + uint32_t reg; sc = arg; - reg = USB_CTRL[sc->sc_id]; + ssc = sc->sc_platform_data; /* Disable power to PHY */ - ti_scm_reg_read_4(reg, &c); - ti_scm_reg_write_4(reg, c | 3); + reg = SYSCON_READ_4(ssc->syscon, USB_CTRL[sc->sc_id]); + SYSCON_WRITE_4(ssc->syscon, USB_CTRL[sc->sc_id], reg | 3); } static void @@ -241,9 +247,42 @@ musbotg_attach(device_t dev) char mode[16]; int err; uint32_t reg; + phandle_t opp_table; + clk_t clk_usbotg_fck; sc->sc_otg.sc_id = device_get_unit(dev); + /* FIXME: The devicetree needs to be updated to get a handle to the gate + * usbotg_fck@47c. see TRM 8.1.12.2 CM_WKUP CM_CLKDCOLDO_DPLL_PER. + */ + err = clk_get_by_name(dev, "usbotg_fck@47c", &clk_usbotg_fck); + if (err) { + device_printf(dev, "Can not find usbotg_fck@47c\n"); + return (ENXIO); + } + + err = clk_enable(clk_usbotg_fck); + if (err) { + device_printf(dev, "Can not enable usbotg_fck@47c\n"); + return (ENXIO); + } + + /* FIXME: For now; Go and kidnap syscon from opp-table */ + opp_table = OF_finddevice("/opp-table"); + if (opp_table == -1) { + device_printf(dev, "Cant find /opp-table\n"); + return (ENXIO); + } + if (!OF_hasprop(opp_table, "syscon")) { + device_printf(dev, "/opp-table missing syscon property\n"); + return (ENXIO); + } + err = syscon_get_by_ofw_property(dev, opp_table, "syscon", &sc->syscon); + if (err) { + device_printf(dev, "Failed to get syscon\n"); + return (ENXIO); + } + /* Request the memory resources */ err = bus_alloc_resources(dev, am335x_musbotg_mem_spec, sc->sc_mem_res); @@ -417,5 +456,7 @@ static driver_t musbotg_driver = { static devclass_t musbotg_devclass; -DRIVER_MODULE(musbotg, usbss, musbotg_driver, musbotg_devclass, 0, 0); -MODULE_DEPEND(musbotg, usbss, 1, 1, 1); +DRIVER_MODULE(musbotg, ti_sysc, musbotg_driver, musbotg_devclass, 0, 0); +MODULE_DEPEND(musbotg, ti_sysc, 1, 1, 1); +MODULE_DEPEND(musbotg, ti_am3359_cppi41, 1, 1, 1); +MODULE_DEPEND(usbss, usb, 1, 1, 1); Modified: head/sys/arm/ti/am335x/am335x_pwmss.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_pwmss.c Thu Jul 30 14:42:50 2020 (r363699) +++ head/sys/arm/ti/am335x/am335x_pwmss.c Thu Jul 30 14:45:05 2020 (r363700) @@ -46,10 +46,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include +#include +#include +#include "syscon_if.h" + #include "am335x_pwm.h" #include "am335x_scm.h" @@ -59,6 +60,11 @@ __FBSDID("$FreeBSD$"); #define CLKCONFIG_EPWMCLK_EN (1 << 8) #define PWMSS_CLKSTATUS 0x0C +/* TRM chapter 2 memory map table 2-3 + VER register location */ +#define PWMSS_REV_0 0x0000 +#define PWMSS_REV_1 0x2000 +#define PWMSS_REV_2 0x4000 + static device_probe_t am335x_pwmss_probe; static device_attach_t am335x_pwmss_attach; static device_detach_t am335x_pwmss_detach; @@ -66,7 +72,7 @@ static device_detach_t am335x_pwmss_detach; struct am335x_pwmss_softc { struct simplebus_softc sc_simplebus; device_t sc_dev; - clk_ident_t sc_clk; + struct syscon *syscon; }; static device_method_t am335x_pwmss_methods[] = { @@ -97,36 +103,45 @@ am335x_pwmss_attach(device_t dev) { struct am335x_pwmss_softc *sc; uint32_t reg, id; - phandle_t node; + uint64_t rev_address; + phandle_t node, opp_table; sc = device_get_softc(dev); sc->sc_dev = dev; - sc->sc_clk = ti_hwmods_get_clock(dev); - if (sc->sc_clk == INVALID_CLK_IDENT) { - device_printf(dev, "failed to get device id based on ti,hwmods\n"); - return (EINVAL); + /* FIXME: For now; Go and kidnap syscon from opp-table */ + opp_table = OF_finddevice("/opp-table"); + if (opp_table == -1) { + device_printf(dev, "Cant find /opp-table\n"); + return (ENXIO); } + if (!OF_hasprop(opp_table, "syscon")) { + device_printf(dev, "/opp-table doesnt have required syscon property\n"); + return (ENXIO); + } + if (syscon_get_by_ofw_property(dev, opp_table, "syscon", &sc->syscon) != 0) { + device_printf(dev, "Failed to get syscon\n"); + return (ENXIO); + } - ti_prcm_clk_enable(sc->sc_clk); - ti_scm_reg_read_4(SCM_PWMSS_CTRL, ®); - switch (sc->sc_clk) { - case PWMSS0_CLK: - id = 0; - break; - case PWMSS1_CLK: - id = 1; - break; + ti_sysc_clock_enable(device_get_parent(dev)); - case PWMSS2_CLK: - id = 2; - break; - default: - device_printf(dev, "unknown pwmss clock id: %d\n", sc->sc_clk); - return (EINVAL); + rev_address = ti_sysc_get_rev_address(device_get_parent(dev)); + switch (rev_address) { + case PWMSS_REV_0: + id = 0; + break; + case PWMSS_REV_1: + id = 1; + break; + case PWMSS_REV_2: + id = 2; + break; } + + reg = SYSCON_READ_4(sc->syscon, SCM_PWMSS_CTRL); reg |= (1 << id); - ti_scm_reg_write_4(SCM_PWMSS_CTRL, reg); + SYSCON_WRITE_4(sc->syscon, SCM_PWMSS_CTRL, reg); node = ofw_bus_get_node(dev); @@ -161,3 +176,4 @@ DEFINE_CLASS_1(am335x_pwmss, am335x_pwmss_driver, am33 static devclass_t am335x_pwmss_devclass; DRIVER_MODULE(am335x_pwmss, simplebus, am335x_pwmss_driver, am335x_pwmss_devclass, 0, 0); MODULE_VERSION(am335x_pwmss, 1); +MODULE_DEPEND(am335x_pwmss, ti_sysc, 1, 1, 1); Modified: head/sys/arm/ti/am335x/am335x_rtc.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_rtc.c Thu Jul 30 14:42:50 2020 (r363699) +++ head/sys/arm/ti/am335x/am335x_rtc.c Thu Jul 30 14:45:05 2020 (r363700) @@ -39,8 +39,9 @@ __FBSDID("$FreeBSD$"); #include +#include #include -#include +#include #include #include @@ -110,7 +111,7 @@ am335x_rtc_attach(device_t dev) RTC_LOCK_INIT(sc); /* Enable the RTC module. */ - ti_prcm_clk_enable(RTC_CLK); + ti_sysc_clock_enable(device_get_parent(dev)); rev = RTC_READ4(sc, RTC_REVISION); device_printf(dev, "AM335X RTC v%d.%d.%d\n", (rev >> 8) & 0x7, (rev >> 6) & 0x3, rev & 0x3f); @@ -209,3 +210,4 @@ static devclass_t am335x_rtc_devclass; DRIVER_MODULE(am335x_rtc, simplebus, am335x_rtc_driver, am335x_rtc_devclass, 0, 0); MODULE_VERSION(am335x_rtc, 1); MODULE_DEPEND(am335x_rtc, simplebus, 1, 1, 1); +MODULE_DEPEND(am335x_rtc, ti_sysc, 1, 1, 1); Modified: head/sys/arm/ti/am335x/am335x_scm.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_scm.c Thu Jul 30 14:42:50 2020 (r363699) +++ head/sys/arm/ti/am335x/am335x_scm.c Thu Jul 30 14:45:05 2020 (r363700) @@ -40,11 +40,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include "syscon_if.h" + #define TZ_ZEROC 2731 struct am335x_scm_softc { int sc_last_temp; struct sysctl_oid *sc_temp_oid; + struct syscon *syscon; }; static int @@ -60,7 +64,7 @@ am335x_scm_temp_sysctl(SYSCTL_HANDLER_ARGS) /* Read the temperature and convert to Kelvin. */ for(i = 50; i > 0; i--) { - ti_scm_reg_read_4(SCM_BGAP_CTRL, ®); + reg = SYSCON_READ_4(sc->syscon, SCM_BGAP_CTRL); if ((reg & SCM_BGAP_EOCZ) == 0) break; DELAY(50); @@ -96,6 +100,9 @@ am335x_scm_identify(driver_t *driver, device_t parent) static int am335x_scm_probe(device_t dev) { + /* Just allow the first one */ + if (strcmp(device_get_nameunit(dev), "am335x_scm0") != 0) + return (ENXIO); device_set_desc(dev, "AM335x Control Module Extension"); @@ -109,21 +116,40 @@ am335x_scm_attach(device_t dev) struct sysctl_ctx_list *ctx; struct sysctl_oid_list *tree; uint32_t reg; + phandle_t opp_table; + int err; + sc = device_get_softc(dev); + + /* FIXME: For now; Go and kidnap syscon from opp-table */ + opp_table = OF_finddevice("/opp-table"); + if (opp_table == -1) { + device_printf(dev, "Cant find /opp-table\n"); + return (ENXIO); + } + if (!OF_hasprop(opp_table, "syscon")) { + device_printf(dev, "/opp-table missing syscon property\n"); + return (ENXIO); + } + err = syscon_get_by_ofw_property(dev, opp_table, "syscon", &sc->syscon); + if (err) { + device_printf(dev, "Failed to get syscon\n"); + return (ENXIO); + } + /* Reset the digital outputs. */ - ti_scm_reg_write_4(SCM_BGAP_CTRL, 0); - ti_scm_reg_read_4(SCM_BGAP_CTRL, ®); + SYSCON_WRITE_4(sc->syscon, SCM_BGAP_CTRL, 0); + reg = SYSCON_READ_4(sc->syscon, SCM_BGAP_CTRL); DELAY(500); /* Set continous mode. */ - ti_scm_reg_write_4(SCM_BGAP_CTRL, SCM_BGAP_CONTCONV); - ti_scm_reg_read_4(SCM_BGAP_CTRL, ®); + SYSCON_WRITE_4(sc->syscon, SCM_BGAP_CTRL, SCM_BGAP_CONTCONV); + reg = SYSCON_READ_4(sc->syscon, SCM_BGAP_CTRL); DELAY(500); /* Start the ADC conversion. */ reg = SCM_BGAP_CLRZ | SCM_BGAP_CONTCONV | SCM_BGAP_SOC; - ti_scm_reg_write_4(SCM_BGAP_CTRL, reg); + SYSCON_WRITE_4(sc->syscon, SCM_BGAP_CTRL, reg); /* Temperature sysctl. */ - sc = device_get_softc(dev); ctx = device_get_sysctl_ctx(dev); tree = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); sc->sc_temp_oid = SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, @@ -145,7 +171,7 @@ am335x_scm_detach(device_t dev) sysctl_remove_oid(sc->sc_temp_oid, 1, 0); /* Stop the bandgap ADC. */ - ti_scm_reg_write_4(SCM_BGAP_CTRL, SCM_BGAP_BGOFF); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Jul 30 15:43:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80B563A8A6F; Thu, 30 Jul 2020 15:43:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHZSP2x8sz4WhS; Thu, 30 Jul 2020 15:43:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4869D135E7; Thu, 30 Jul 2020 15:43:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06UFhHgn099324; Thu, 30 Jul 2020 15:43:17 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06UFhHGO099323; Thu, 30 Jul 2020 15:43:17 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007301543.06UFhHGO099323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Jul 2020 15:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363703 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363703 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 15:43:17 -0000 Author: mjg Date: Thu Jul 30 15:43:16 2020 New Revision: 363703 URL: https://svnweb.freebsd.org/changeset/base/363703 Log: vfs: add NOMACCHECK and AUDITVNODE2 to lockless lookup They are both nops since lookup does not progress with either mac or audit enabled. Tested by: pho Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Jul 30 14:50:43 2020 (r363702) +++ head/sys/kern/vfs_cache.c Thu Jul 30 15:43:16 2020 (r363703) @@ -3002,7 +3002,8 @@ cache_fpl_handled_impl(struct cache_fpl *fpl, int erro #define cache_fpl_handled(x, e) cache_fpl_handled_impl((x), (e), __LINE__) #define CACHE_FPL_SUPPORTED_CN_FLAGS \ - (LOCKLEAF | FOLLOW | LOCKSHARED | SAVENAME | ISOPEN | AUDITVNODE1) + (LOCKLEAF | FOLLOW | LOCKSHARED | SAVENAME | ISOPEN | NOMACCHECK | \ + AUDITVNODE1 | AUDITVNODE2) static bool cache_can_fplookup(struct cache_fpl *fpl) From owner-svn-src-head@freebsd.org Thu Jul 30 15:44:10 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B42C83A8ADF; Thu, 30 Jul 2020 15:44:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHZTQ4LcNz4WjS; Thu, 30 Jul 2020 15:44:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77FE4132A6; Thu, 30 Jul 2020 15:44:10 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06UFiARO099426; Thu, 30 Jul 2020 15:44:10 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06UFiAIh099425; Thu, 30 Jul 2020 15:44:10 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007301544.06UFiAIh099425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Jul 2020 15:44:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363704 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 15:44:10 -0000 Author: mjg Date: Thu Jul 30 15:44:10 2020 New Revision: 363704 URL: https://svnweb.freebsd.org/changeset/base/363704 Log: vfs: support negative entry promotion in lockless lookup Tested by: pho Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Jul 30 15:43:16 2020 (r363703) +++ head/sys/kern/vfs_cache.c Thu Jul 30 15:44:10 2020 (r363704) @@ -807,6 +807,15 @@ cache_negative_remove(struct namecache *ncp) } else { list_locked = true; mtx_lock(&neglist->nl_lock); + /* + * We may be racing against promotion in lockless lookup. + */ + if ((negstate->neg_flag & NEG_HOT) != 0) { + mtx_unlock(&neglist->nl_lock); + hot_locked = true; + mtx_lock(&ncneg_hot.nl_lock); + mtx_lock(&neglist->nl_lock); + } } if ((negstate->neg_flag & NEG_HOT) != 0) { mtx_assert(&ncneg_hot.nl_lock, MA_OWNED); @@ -3061,6 +3070,103 @@ cache_fplookup_vnode_supported(struct vnode *vp) } /* + * Move a negative entry to the hot list. + * + * We have to take locks, but they may be contended and in the worst + * case we may need to go off CPU. We don't want to spin within the + * smr section and we can't block with it. Instead we are going to + * look up the entry again. + */ +static int __noinline +cache_fplookup_negative_promote(struct cache_fpl *fpl, struct namecache *oncp, + uint32_t hash) +{ + struct componentname *cnp; + struct namecache *ncp; + struct neglist *neglist; + struct negstate *negstate; + struct vnode *dvp; + u_char nc_flag; + + cnp = fpl->cnp; + dvp = fpl->dvp; + + if (!vhold_smr(dvp)) + return (cache_fpl_aborted(fpl)); + + neglist = NCP2NEGLIST(oncp); + cache_fpl_smr_exit(fpl); + + mtx_lock(&ncneg_hot.nl_lock); + mtx_lock(&neglist->nl_lock); + /* + * For hash iteration. + */ + cache_fpl_smr_enter(fpl); + + /* + * Avoid all surprises by only succeeding if we got the same entry and + * bailing completely otherwise. + * + * In particular at this point there can be a new ncp which matches the + * search but hashes to a different neglist. + */ + CK_LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { + if (ncp == oncp) + break; + } + + /* + * No match to begin with. + */ + if (__predict_false(ncp == NULL)) { + goto out_abort; + } + + /* + * The newly found entry may be something different... + */ + if (!(ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && + !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen))) { + goto out_abort; + } + + /* + * ... and not even negative. + */ + nc_flag = atomic_load_char(&ncp->nc_flag); + if ((nc_flag & NCF_NEGATIVE) == 0) { + goto out_abort; + } + + if (__predict_false(cache_ncp_invalid(ncp))) { + goto out_abort; + } + + negstate = NCP2NEGSTATE(ncp); + if ((negstate->neg_flag & NEG_HOT) == 0) { + numhotneg++; + TAILQ_REMOVE(&neglist->nl_list, ncp, nc_dst); + TAILQ_INSERT_TAIL(&ncneg_hot.nl_list, ncp, nc_dst); + negstate->neg_flag |= NEG_HOT; + } + + SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name); + counter_u64_add(numneghits, 1); + cache_fpl_smr_exit(fpl); + mtx_unlock(&neglist->nl_lock); + mtx_unlock(&ncneg_hot.nl_lock); + vdrop(dvp); + return (cache_fpl_handled(fpl, ENOENT)); +out_abort: + cache_fpl_smr_exit(fpl); + mtx_unlock(&neglist->nl_lock); + mtx_unlock(&ncneg_hot.nl_lock); + vdrop(dvp); + return (cache_fpl_aborted(fpl)); +} + +/* * The target vnode is not supported, prepare for the slow path to take over. */ static int @@ -3204,12 +3310,7 @@ cache_fplookup_next(struct cache_fpl *fpl) return (cache_fpl_partial(fpl)); } if (!neg_hot) { - /* - * TODO - * Promoting to hot negative requires locks, thus is - * left not yet supported for simplicity. - */ - return (cache_fpl_partial(fpl)); + return (cache_fplookup_negative_promote(fpl, ncp, hash)); } SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name); From owner-svn-src-head@freebsd.org Thu Jul 30 15:45:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E602D3A8AFE; Thu, 30 Jul 2020 15:45:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHZVb5vTSz4X1P; Thu, 30 Jul 2020 15:45:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD864133FE; Thu, 30 Jul 2020 15:45:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06UFjBup099655; Thu, 30 Jul 2020 15:45:11 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06UFjBrA099654; Thu, 30 Jul 2020 15:45:11 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007301545.06UFjBrA099654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Jul 2020 15:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363705 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363705 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 15:45:12 -0000 Author: mjg Date: Thu Jul 30 15:45:11 2020 New Revision: 363705 URL: https://svnweb.freebsd.org/changeset/base/363705 Log: vfs: add support for WANTPARENT and LOCKPARENT to lockless lookup This makes the realpath syscall operational with the new lookup. Note that the walk to obtain the full path name still takes locks. Tested by: pho Differential Revision: https://reviews.freebsd.org/D23917 Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Jul 30 15:44:10 2020 (r363704) +++ head/sys/kern/vfs_cache.c Thu Jul 30 15:45:11 2020 (r363705) @@ -3011,8 +3011,8 @@ cache_fpl_handled_impl(struct cache_fpl *fpl, int erro #define cache_fpl_handled(x, e) cache_fpl_handled_impl((x), (e), __LINE__) #define CACHE_FPL_SUPPORTED_CN_FLAGS \ - (LOCKLEAF | FOLLOW | LOCKSHARED | SAVENAME | ISOPEN | NOMACCHECK | \ - AUDITVNODE1 | AUDITVNODE2) + (LOCKLEAF | LOCKPARENT | WANTPARENT | FOLLOW | LOCKSHARED | SAVENAME | \ + ISOPEN | NOMACCHECK | AUDITVNODE1 | AUDITVNODE2) static bool cache_can_fplookup(struct cache_fpl *fpl) @@ -3208,10 +3208,42 @@ cache_fplookup_partial_setup(struct cache_fpl *fpl) } static int -cache_fplookup_final(struct cache_fpl *fpl) +cache_fplookup_final_child(struct cache_fpl *fpl, enum vgetstate tvs) { struct componentname *cnp; - enum vgetstate tvs; + struct vnode *tvp; + seqc_t tvp_seqc; + int error; + + cnp = fpl->cnp; + tvp = fpl->tvp; + tvp_seqc = fpl->tvp_seqc; + + if ((cnp->cn_flags & LOCKLEAF) != 0) { + error = vget_finish(tvp, cnp->cn_lkflags, tvs); + if (error != 0) { + return (cache_fpl_aborted(fpl)); + } + } else { + vget_finish_ref(tvp, tvs); + } + + if (!vn_seqc_consistent(tvp, tvp_seqc)) { + if ((cnp->cn_flags & LOCKLEAF) != 0) + vput(tvp); + else + vrele(tvp); + return (cache_fpl_aborted(fpl)); + } + + return (cache_fpl_handled(fpl, 0)); +} + +static int __noinline +cache_fplookup_final_withparent(struct cache_fpl *fpl) +{ + enum vgetstate dvs, tvs; + struct componentname *cnp; struct vnode *dvp, *tvp; seqc_t dvp_seqc, tvp_seqc; int error; @@ -3222,39 +3254,90 @@ cache_fplookup_final(struct cache_fpl *fpl) tvp = fpl->tvp; tvp_seqc = fpl->tvp_seqc; - VNPASS(cache_fplookup_vnode_supported(dvp), dvp); + MPASS((cnp->cn_flags & (LOCKPARENT|WANTPARENT)) != 0); + /* + * This is less efficient than it can be for simplicity. + */ + dvs = vget_prep_smr(dvp); + if (dvs == VGET_NONE) { + return (cache_fpl_aborted(fpl)); + } tvs = vget_prep_smr(tvp); if (tvs == VGET_NONE) { - return (cache_fpl_partial(fpl)); - } - - if (!vn_seqc_consistent(dvp, dvp_seqc)) { cache_fpl_smr_exit(fpl); - vget_abort(tvp, tvs); + vget_abort(dvp, dvs); return (cache_fpl_aborted(fpl)); } cache_fpl_smr_exit(fpl); - if ((cnp->cn_flags & LOCKLEAF) != 0) { - error = vget_finish(tvp, cnp->cn_lkflags, tvs); + if ((cnp->cn_flags & LOCKPARENT) != 0) { + error = vget_finish(dvp, LK_EXCLUSIVE, dvs); if (error != 0) { + vget_abort(tvp, tvs); return (cache_fpl_aborted(fpl)); } } else { - vget_finish_ref(tvp, tvs); + vget_finish_ref(dvp, dvs); } - if (!vn_seqc_consistent(tvp, tvp_seqc)) { - if ((cnp->cn_flags & LOCKLEAF) != 0) - vput(tvp); + if (!vn_seqc_consistent(dvp, dvp_seqc)) { + vget_abort(tvp, tvs); + if ((cnp->cn_flags & LOCKPARENT) != 0) + vput(dvp); else - vrele(tvp); + vrele(dvp); + cache_fpl_aborted(fpl); + return (error); + } + + error = cache_fplookup_final_child(fpl, tvs); + if (error != 0) { + MPASS(fpl->status == CACHE_FPL_STATUS_ABORTED); + if ((cnp->cn_flags & LOCKPARENT) != 0) + vput(dvp); + else + vrele(dvp); + return (error); + } + + MPASS(fpl->status == CACHE_FPL_STATUS_HANDLED); + return (0); +} + +static int +cache_fplookup_final(struct cache_fpl *fpl) +{ + struct componentname *cnp; + enum vgetstate tvs; + struct vnode *dvp, *tvp; + seqc_t dvp_seqc, tvp_seqc; + + cnp = fpl->cnp; + dvp = fpl->dvp; + dvp_seqc = fpl->dvp_seqc; + tvp = fpl->tvp; + tvp_seqc = fpl->tvp_seqc; + + VNPASS(cache_fplookup_vnode_supported(dvp), dvp); + + if ((cnp->cn_flags & (LOCKPARENT|WANTPARENT)) != 0) + return (cache_fplookup_final_withparent(fpl)); + + tvs = vget_prep_smr(tvp); + if (tvs == VGET_NONE) { + return (cache_fpl_partial(fpl)); + } + + if (!vn_seqc_consistent(dvp, dvp_seqc)) { + cache_fpl_smr_exit(fpl); + vget_abort(tvp, tvs); return (cache_fpl_aborted(fpl)); } - return (cache_fpl_handled(fpl, 0)); + cache_fpl_smr_exit(fpl); + return (cache_fplookup_final_child(fpl, tvs)); } static int From owner-svn-src-head@freebsd.org Thu Jul 30 15:47:42 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 402233A8EA4; Thu, 30 Jul 2020 15:47:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHZYV14WNz4XN4; Thu, 30 Jul 2020 15:47:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0930D135E8; Thu, 30 Jul 2020 15:47:42 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06UFlfU3099797; Thu, 30 Jul 2020 15:47:41 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06UFlf5J099795; Thu, 30 Jul 2020 15:47:41 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007301547.06UFlf5J099795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Jul 2020 15:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363706 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 363706 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 15:47:42 -0000 Author: mjg Date: Thu Jul 30 15:47:41 2020 New Revision: 363706 URL: https://svnweb.freebsd.org/changeset/base/363706 Log: vfs: short-circuit the common case NDFREE calls Almost all consumers use the NDF_ONLY_PNBUF macro, making them avoidably branch a lot in the NDFREE routine. Also note most of them should not need to call any cleanup anyway as they don't request HASBUF. Modified: head/sys/kern/vfs_lookup.c head/sys/sys/namei.h Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Thu Jul 30 15:45:11 2020 (r363705) +++ head/sys/kern/vfs_lookup.c Thu Jul 30 15:47:41 2020 (r363706) @@ -1390,18 +1390,26 @@ NDINIT_ALL(struct nameidata *ndp, u_long op, u_long fl * Free data allocated by namei(); see namei(9) for details. */ void -NDFREE(struct nameidata *ndp, const u_int flags) +NDFREE_PNBUF(struct nameidata *ndp) { + + if ((ndp->ni_cnd.cn_flags & HASBUF) != 0) { + uma_zfree(namei_zone, ndp->ni_cnd.cn_pnbuf); + ndp->ni_cnd.cn_flags &= ~HASBUF; + } +} + +void +(NDFREE)(struct nameidata *ndp, const u_int flags) +{ int unlock_dvp; int unlock_vp; unlock_dvp = 0; unlock_vp = 0; - if (!(flags & NDF_NO_FREE_PNBUF) && - (ndp->ni_cnd.cn_flags & HASBUF)) { - uma_zfree(namei_zone, ndp->ni_cnd.cn_pnbuf); - ndp->ni_cnd.cn_flags &= ~HASBUF; + if (!(flags & NDF_NO_FREE_PNBUF)) { + NDFREE_PNBUF(ndp); } if (!(flags & NDF_NO_VP_UNLOCK) && (ndp->ni_cnd.cn_flags & LOCKLEAF) && ndp->ni_vp) Modified: head/sys/sys/namei.h ============================================================================== --- head/sys/sys/namei.h Thu Jul 30 15:45:11 2020 (r363705) +++ head/sys/sys/namei.h Thu Jul 30 15:47:41 2020 (r363706) @@ -210,7 +210,15 @@ void NDINIT_ALL(struct nameidata *ndp, u_long op, u_lo #define NDF_NO_FREE_PNBUF 0x00000020 #define NDF_ONLY_PNBUF (~NDF_NO_FREE_PNBUF) +void NDFREE_PNBUF(struct nameidata *); void NDFREE(struct nameidata *, const u_int); +#define NDFREE(ndp, flags) do { \ + struct nameidata *_ndp = (ndp); \ + if (__builtin_constant_p(flags) && flags == NDF_ONLY_PNBUF) \ + NDFREE_PNBUF(_ndp); \ + else \ + NDFREE(_ndp, flags); \ +} while (0) int namei(struct nameidata *ndp); int lookup(struct nameidata *ndp); From owner-svn-src-head@freebsd.org Thu Jul 30 15:48:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 348633A8E59; Thu, 30 Jul 2020 15:48:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHZZw6yY3z4XZP; Thu, 30 Jul 2020 15:48:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 773FB135E9; Thu, 30 Jul 2020 15:48:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06UFmuns099898; Thu, 30 Jul 2020 15:48:56 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06UFmuLJ099897; Thu, 30 Jul 2020 15:48:56 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007301548.06UFmuLJ099897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Jul 2020 15:48:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363707 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363707 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 15:48:59 -0000 Author: mjg Date: Thu Jul 30 15:48:56 2020 New Revision: 363707 URL: https://svnweb.freebsd.org/changeset/base/363707 Log: vfs: fold poll_no_poll into vop_nopoll The logic was almost completely present in vop_stdpoll anyway. Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Thu Jul 30 15:47:41 2020 (r363706) +++ head/sys/kern/vfs_default.c Thu Jul 30 15:48:56 2020 (r363707) @@ -616,7 +616,9 @@ vop_nopoll(ap) } */ *ap; { - return (poll_no_poll(ap->a_events)); + if (ap->a_events & ~POLLSTANDARD) + return (POLLNVAL); + return (ap->a_events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)); } /* From owner-svn-src-head@freebsd.org Thu Jul 30 15:50:52 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D9DD03A909B; Thu, 30 Jul 2020 15:50:52 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHZd85Sv0z4Xpk; Thu, 30 Jul 2020 15:50:52 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EF35135C4; Thu, 30 Jul 2020 15:50:52 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06UFoqji001587; Thu, 30 Jul 2020 15:50:52 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06UFopxF001582; Thu, 30 Jul 2020 15:50:51 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007301550.06UFopxF001582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Jul 2020 15:50:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363708 - in head/sys: kern sys tools X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys tools X-SVN-Commit-Revision: 363708 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 15:50:52 -0000 Author: mjg Date: Thu Jul 30 15:50:51 2020 New Revision: 363708 URL: https://svnweb.freebsd.org/changeset/base/363708 Log: vfs: inline vops if there are no pre/post associated calls This removes a level of indirection from frequently used methods, most notably VOP_LOCK1 and VOP_UNLOCK1. Tested by: pho Modified: head/sys/kern/vfs_subr.c head/sys/kern/vnode_if.src head/sys/sys/vnode.h head/sys/tools/vnode_if.awk Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Thu Jul 30 15:48:56 2020 (r363707) +++ head/sys/kern/vfs_subr.c Thu Jul 30 15:50:51 2020 (r363708) @@ -5597,21 +5597,21 @@ vop_rename_pre(void *ap) #ifdef DEBUG_VFS_LOCKS void -vop_fplookup_vexec_pre(void *ap __unused) +vop_fplookup_vexec_debugpre(void *ap __unused) { VFS_SMR_ASSERT_ENTERED(); } void -vop_fplookup_vexec_post(void *ap __unused, int rc __unused) +vop_fplookup_vexec_debugpost(void *ap __unused, int rc __unused) { VFS_SMR_ASSERT_ENTERED(); } void -vop_strategy_pre(void *ap) +vop_strategy_debugpre(void *ap) { struct vop_strategy_args *a; struct buf *bp; @@ -5635,7 +5635,7 @@ vop_strategy_pre(void *ap) } void -vop_lock_pre(void *ap) +vop_lock_debugpre(void *ap) { struct vop_lock1_args *a = ap; @@ -5646,7 +5646,7 @@ vop_lock_pre(void *ap) } void -vop_lock_post(void *ap, int rc) +vop_lock_debugpost(void *ap, int rc) { struct vop_lock1_args *a = ap; @@ -5656,7 +5656,7 @@ vop_lock_post(void *ap, int rc) } void -vop_unlock_pre(void *ap) +vop_unlock_debugpre(void *ap) { struct vop_unlock_args *a = ap; @@ -5664,7 +5664,7 @@ vop_unlock_pre(void *ap) } void -vop_need_inactive_pre(void *ap) +vop_need_inactive_debugpre(void *ap) { struct vop_need_inactive_args *a = ap; @@ -5672,7 +5672,7 @@ vop_need_inactive_pre(void *ap) } void -vop_need_inactive_post(void *ap, int rc) +vop_need_inactive_debugpost(void *ap, int rc) { struct vop_need_inactive_args *a = ap; Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Thu Jul 30 15:48:56 2020 (r363707) +++ head/sys/kern/vnode_if.src Thu Jul 30 15:50:51 2020 (r363708) @@ -147,8 +147,8 @@ vop_close { %% fplookup_vexec vp - - - -%! fplookup_vexec pre vop_fplookup_vexec_pre -%! fplookup_vexec post vop_fplookup_vexec_post +%! fplookup_vexec debugpre vop_fplookup_vexec_debugpre +%! fplookup_vexec debugpost vop_fplookup_vexec_debugpost vop_fplookup_vexec { IN struct vnode *vp; @@ -379,8 +379,8 @@ vop_inactive { IN struct thread *td; }; -%! need_inactive pre vop_need_inactive_pre -%! need_inactive post vop_need_inactive_post +%! need_inactive debugpre vop_need_inactive_debugpre +%! need_inactive debugpost vop_need_inactive_debugpost vop_need_inactive { IN struct vnode *vp; @@ -395,8 +395,8 @@ vop_reclaim { }; -%! lock1 pre vop_lock_pre -%! lock1 post vop_lock_post +%! lock1 debugpre vop_lock_debugpre +%! lock1 debugpost vop_lock_debugpost vop_lock1 { IN struct vnode *vp; @@ -406,7 +406,7 @@ vop_lock1 { }; -%! unlock pre vop_unlock_pre +%! unlock debugpre vop_unlock_debugpre vop_unlock { IN struct vnode *vp; @@ -426,7 +426,7 @@ vop_bmap { %% strategy vp L L L -%! strategy pre vop_strategy_pre +%! strategy debugpre vop_strategy_debugpre vop_strategy { IN struct vnode *vp; Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Thu Jul 30 15:48:56 2020 (r363707) +++ head/sys/sys/vnode.h Thu Jul 30 15:50:51 2020 (r363708) @@ -869,23 +869,23 @@ void vop_symlink_post(void *a, int rc); int vop_sigdefer(struct vop_vector *vop, struct vop_generic_args *a); #ifdef DEBUG_VFS_LOCKS -void vop_fplookup_vexec_pre(void *a); -void vop_fplookup_vexec_post(void *a, int rc); -void vop_strategy_pre(void *a); -void vop_lock_pre(void *a); -void vop_lock_post(void *a, int rc); -void vop_unlock_pre(void *a); -void vop_need_inactive_pre(void *a); -void vop_need_inactive_post(void *a, int rc); +void vop_fplookup_vexec_debugpre(void *a); +void vop_fplookup_vexec_debugpost(void *a, int rc); +void vop_strategy_debugpre(void *a); +void vop_lock_debugpre(void *a); +void vop_lock_debugpost(void *a, int rc); +void vop_unlock_debugpre(void *a); +void vop_need_inactive_debugpre(void *a); +void vop_need_inactive_debugpost(void *a, int rc); #else -#define vop_fplookup_vexec_pre(x) do { } while (0) -#define vop_fplookup_vexec_post(x, y) do { } while (0) -#define vop_strategy_pre(x) do { } while (0) -#define vop_lock_pre(x) do { } while (0) -#define vop_lock_post(x, y) do { } while (0) -#define vop_unlock_pre(x) do { } while (0) -#define vop_need_inactive_pre(x) do { } while (0) -#define vop_need_inactive_post(x, y) do { } while (0) +#define vop_fplookup_vexec_debugpre(x) do { } while (0) +#define vop_fplookup_vexec_debugpost(x, y) do { } while (0) +#define vop_strategy_debugpre(x) do { } while (0) +#define vop_lock_debugpre(x) do { } while (0) +#define vop_lock_debugpost(x, y) do { } while (0) +#define vop_unlock_debugpre(x) do { } while (0) +#define vop_need_inactive_debugpre(x) do { } while (0) +#define vop_need_inactive_debugpost(x, y) do { } while (0) #endif void vop_rename_fail(struct vop_rename_args *ap); Modified: head/sys/tools/vnode_if.awk ============================================================================== --- head/sys/tools/vnode_if.awk Thu Jul 30 15:48:56 2020 (r363707) +++ head/sys/tools/vnode_if.awk Thu Jul 30 15:50:51 2020 (r363708) @@ -87,6 +87,24 @@ function add_debug_code(name, arg, pos, ind) } } +function add_debugpre(name) +{ + if (lockdata[name, "debugpre"]) { + printc("#ifdef DEBUG_VFS_LOCKS"); + printc("\t"lockdata[name, "debugpre"]"(a);"); + printc("#endif"); + } +} + +function add_debugpost(name) +{ + if (lockdata[name, "debugpost"]) { + printc("#ifdef DEBUG_VFS_LOCKS"); + printc("\t"lockdata[name, "debugpost"]"(a, rc);"); + printc("#endif"); + } +} + function add_pre(name) { if (lockdata[name, "pre"]) { @@ -101,6 +119,15 @@ function add_post(name) } } +function can_inline(name) +{ + if (lockdata[name, "pre"]) + return 0; + if (lockdata[name, "post"]) + return 0; + return 1; +} + function find_arg_with_type (type) { for (jj = 0; jj < numargs; jj++) { @@ -213,7 +240,8 @@ while ((getline < srcfile) > 0) { if ($1 ~ /^%!/) { if (NF != 4 || - ($3 != "pre" && $3 != "post")) { + ($3 != "pre" && $3 != "post" && + $3 != "debugpre" && $3 != "debugpost")) { die("Invalid %s construction", "%!"); continue; } @@ -316,7 +344,18 @@ while ((getline < srcfile) > 0) { printh("\ta.a_gen.a_desc = &" name "_desc;"); for (i = 0; i < numargs; ++i) printh("\ta.a_" args[i] " = " args[i] ";"); + if (can_inline(name)) { + printh("\n#if !defined(DEBUG_VFS_LOCKS) && !defined(INVARIANTS) && !defined(KTR)"); + printh("\tif (!SDT_PROBES_ENABLED())"); + printh("\t\treturn (" args[0]"->v_op->"name"(&a));"); + printh("\telse"); + printh("\t\treturn (" uname "_APV("args[0]"->v_op, &a));"); + printh("#else"); + } printh("\treturn (" uname "_APV("args[0]"->v_op, &a));"); + if (can_inline(name)) + printh("#endif"); + printh("}"); printh(""); @@ -364,6 +403,7 @@ while ((getline < srcfile) > 0) { printc("\t (\"Wrong a_desc in " name "(%p, %p)\", a->a_" args[0]", a));"); printc("\tVNASSERT(vop != NULL, a->a_" args[0]", (\"No "name"(%p, %p)\", a->a_" args[0]", a));") printc("\tKTR_START" ctrstr); + add_debugpre(name); add_pre(name); for (i = 0; i < numargs; ++i) add_debug_code(name, args[i], "Entry", "\t"); @@ -382,6 +422,7 @@ while ((getline < srcfile) > 0) { add_debug_code(name, args[i], "Error", "\t\t"); printc("\t}"); add_post(name); + add_debugpost(name); printc("\tKTR_STOP" ctrstr); printc("\treturn (rc);"); printc("}\n"); From owner-svn-src-head@freebsd.org Thu Jul 30 16:20:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 905443A9655; Thu, 30 Jul 2020 16:20:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHbGz3MZxz4ZhS; Thu, 30 Jul 2020 16:20:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from ivaldir.etoilebsd.net (unknown [IPv6:2001:41d0:8:db4c::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 3FEDB20234; Thu, 30 Jul 2020 16:20:11 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by ivaldir.etoilebsd.net (Postfix, from userid 1001) id 57B80E835B; Thu, 30 Jul 2020 18:20:09 +0200 (CEST) Date: Thu, 30 Jul 2020 18:20:09 +0200 From: Baptiste Daroussin To: Stefan =?utf-8?B?RcOfZXI=?= Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc Message-ID: <20200730162009.rnjs6l5rjqsoiqpq@ivaldir.net> References: <202007110733.06B7XJrp033777@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="zzsvtkfi7lba5cnk" Content-Disposition: inline In-Reply-To: <202007110733.06B7XJrp033777@repo.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 16:20:11 -0000 --zzsvtkfi7lba5cnk Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jul 11, 2020 at 07:33:19AM +0000, Stefan E=DFer wrote: > Author: se > Date: Sat Jul 11 07:33:18 2020 > New Revision: 363091 > URL: https://svnweb.freebsd.org/changeset/base/363091 >=20 > Log: > Update to version 3.1.3 > =20 Jumping on that commit, since the switch from our previous bc. The output of the interactive bc has changed, the previous version had a cl= ean UI, the new version "pollutes" the output with plenty of lines about the copyright: =3D=3D=3D=3D Copyright (c) 2018-2020 Gavin D. Howard and contributors Report bugs at: https://git.yzena.com/gavin/bc This is free software with ABSOLUTELY NO WARRANTY. =3D=3D=3D=3D Imagine if all programs where doing that, it would be painful, do you think upstream can be convinced to remove those lines? I no the GNU version also has the same polluted output which was one of the reason I was happy with out previous version of bc. Best regards, Bapt --zzsvtkfi7lba5cnk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAl8i8zkACgkQY4mL3PG3 PloXvQ//Yks3vPzLtUEJdy+VPBiYEKA+pQ6G8KKMSWyXQp2SXHec7sAq5f6EqqFW bRO6eBrurFGvYY6I13rC6TwTCUI4yqalJwJYaZTD8Iy0heilwlzz0VEja/HZSoRN UybgG9A+qfMMNFp9NK9tc9c6r5dgFK9hiIl9By4rEkAuQjhSAtL8Od5hQV6nu7IB r0iO5SVmboEeiOmrzK2nx80qbevNpjIgog7A8+8cvJXo4Is4NwlPKCVExYPqcBf0 6ozAbBv00aMCHUwXtqxTnqH/gsXrGIxAGYBSvaBSIGvIHggLMjBRJq3MJIH+sL2n gERv0KwV3LLEwn0Cpsvl3YTCQghgZ0C0sqO3RnRgfSP3+AyXd/LoLSv/xbLGP5+s jpW8xJcj2ZnI7BNDTOGzKmR6IKxzcCoRsh9g+Fe6/2Ed5+2BxYhgSExtOHKgiG/N p3C2eAgsf6E1/ZIftDnxVvw4Sj7mna3AK1KH8mPZFmPYPNPGGRt2t8bsG8u5cEOX EaUrOCxV076MjAMTqvwHHOBp57b0ycNdtIqBxFQpis2iAwgpkR9eEisqiXXQE2hy +FoneR4fUstdujIBQO/HuRo4if0gKx1zcQQvI+l4xDz+lB2AFs/9i3yLIFe1gArg 5K+Vk+fbAHYooyHlkEG5poRU5aYyhC6pNXydNKGQDTnWEy9BY9Y= =pxic -----END PGP SIGNATURE----- --zzsvtkfi7lba5cnk-- From owner-svn-src-head@freebsd.org Thu Jul 30 16:28:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC91C3A9460 for ; Thu, 30 Jul 2020 16:28:50 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHbSx5g2jz4b3d for ; Thu, 30 Jul 2020 16:28:49 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f65.google.com with SMTP id r4so22529603wrx.9 for ; Thu, 30 Jul 2020 09:28:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=WA0U0+WcG7wpQBSnjIAVHbJsChEnMM9HOQegAeYhhow=; b=IZHN/3kpp8CMwBfkQJZEXbghMuTNwU2rN5IxGvWNxBdPcB9bbLGvPQLOrjkDV1TIMh v/3EmyGvCJWkXJNWEikN4w/Q0G8YJfp6bLXU1SwmEcL2PrgthhInLWQMV3sEpVTWRwRU sHCf4A0ZkKbDwQ/n2ayvpz+mwNWJj0vaguch+GBTpX+lc00c2mZkqH441uV5J+MpRBg8 5KDzlGA/zkGpGc3jA6HluoG7rb8ctsia3vbRYVZwOV9iXJkKZ4b9ZInXQ+8BedJAVWKs 0B4bWLOR5XsJYauGfSYh7fzXMA+telqAdV8GsnC3JWGkb+3DCssyz98F1JhGgWijOZpz qwjg== X-Gm-Message-State: AOAM533N7Vf4DoqLAi+fm8/+5Cjg759AwvXaCEm6dH2RcQG5TKNpXqFz /JhKch2clgPZ7FLvdWK2tyHfARowTl8= X-Google-Smtp-Source: ABdhPJx6s7WXX48S6zQMmvWy3nHbYbVM1e4caY2iYzhH+Fke7zV5QY/BEamv5TfpMHjxcu/eLfOkeA== X-Received: by 2002:a5d:4984:: with SMTP id r4mr34869732wrq.401.1596126501227; Thu, 30 Jul 2020 09:28:21 -0700 (PDT) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id g145sm15448637wmg.23.2020.07.30.09.28.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jul 2020 09:28:20 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc From: Jessica Clarke In-Reply-To: <20200730162009.rnjs6l5rjqsoiqpq@ivaldir.net> Date: Thu, 30 Jul 2020 17:28:19 +0100 Cc: =?utf-8?Q?Stefan_E=C3=9Fer?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <202007110733.06B7XJrp033777@repo.freebsd.org> <20200730162009.rnjs6l5rjqsoiqpq@ivaldir.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Rspamd-Queue-Id: 4BHbSx5g2jz4b3d X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.221.65 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-1.83 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.07)[-1.069]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.28)[-0.282]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.65:from]; NEURAL_HAM_MEDIUM(-0.98)[-0.978]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.65:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 16:28:51 -0000 On 30 Jul 2020, at 17:20, Baptiste Daroussin wrote: > On Sat, Jul 11, 2020 at 07:33:19AM +0000, Stefan E=C3=9Fer wrote: >> Author: se >> Date: Sat Jul 11 07:33:18 2020 >> New Revision: 363091 >> URL: https://svnweb.freebsd.org/changeset/base/363091 >>=20 >> Log: >> Update to version 3.1.3 >>=20 > Jumping on that commit, since the switch from our previous bc. >=20 > The output of the interactive bc has changed, the previous version had = a clean > UI, the new version "pollutes" the output with plenty of lines about = the > copyright: >=20 > =3D=3D=3D=3D > Copyright (c) 2018-2020 Gavin D. Howard and contributors > Report bugs at: https://git.yzena.com/gavin/bc >=20 > This is free software with ABSOLUTELY NO WARRANTY. > =3D=3D=3D=3D >=20 > Imagine if all programs where doing that, it would be painful, do you = think > upstream can be convinced to remove those lines? >=20 > I no the GNU version also has the same polluted output which was one = of the > reason I was happy with out previous version of bc. By default both will print such a banner if and only if being called interactively. You can disable the banner explicitly with -q/--quiet for both GNU bc and this bc. I agree it's a bit noisy and would be nicer to not have that printed, but it's not without precedent for REPL-like things. Jess From owner-svn-src-head@freebsd.org Thu Jul 30 16:31:56 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 88B133A9A6D; Thu, 30 Jul 2020 16:31:56 +0000 (UTC) (envelope-from bapt@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHbXX37Dlz4bNt; Thu, 30 Jul 2020 16:31:56 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from ivaldir.etoilebsd.net (etoilebsd.net [178.32.217.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 3DF2C1F85F; Thu, 30 Jul 2020 16:31:56 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by ivaldir.etoilebsd.net (Postfix, from userid 1001) id E4B30E837D; Thu, 30 Jul 2020 18:31:54 +0200 (CEST) Date: Thu, 30 Jul 2020 18:31:54 +0200 From: Baptiste Daroussin To: Jessica Clarke Cc: Stefan =?utf-8?B?RcOfZXI=?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc Message-ID: <20200730163154.a4d7672xsugkhmxq@ivaldir.net> References: <202007110733.06B7XJrp033777@repo.freebsd.org> <20200730162009.rnjs6l5rjqsoiqpq@ivaldir.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6xxtvwingvletleg" Content-Disposition: inline In-Reply-To: X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 16:31:56 -0000 --6xxtvwingvletleg Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 30, 2020 at 05:28:19PM +0100, Jessica Clarke wrote: > On 30 Jul 2020, at 17:20, Baptiste Daroussin wrote: > > On Sat, Jul 11, 2020 at 07:33:19AM +0000, Stefan E=DFer wrote: > >> Author: se > >> Date: Sat Jul 11 07:33:18 2020 > >> New Revision: 363091 > >> URL: https://svnweb.freebsd.org/changeset/base/363091 > >>=20 > >> Log: > >> Update to version 3.1.3 > >>=20 > > Jumping on that commit, since the switch from our previous bc. > >=20 > > The output of the interactive bc has changed, the previous version had = a clean > > UI, the new version "pollutes" the output with plenty of lines about the > > copyright: > >=20 > > =3D=3D=3D=3D > > Copyright (c) 2018-2020 Gavin D. Howard and contributors > > Report bugs at: https://git.yzena.com/gavin/bc > >=20 > > This is free software with ABSOLUTELY NO WARRANTY. > > =3D=3D=3D=3D > >=20 > > Imagine if all programs where doing that, it would be painful, do you t= hink > > upstream can be convinced to remove those lines? > >=20 > > I no the GNU version also has the same polluted output which was one of= the > > reason I was happy with out previous version of bc. >=20 > By default both will print such a banner if and only if being called > interactively. You can disable the banner explicitly with -q/--quiet > for both GNU bc and this bc. I agree it's a bit noisy and would be > nicer to not have that printed, but it's not without precedent for > REPL-like things. Yes it is not without precedent for REPL-like things, still I dislike this = and would be happy to get bc interactive be as nice as the previous one we had = :) If not I will deal with it and just yell internally each time I run it :D Bapt --6xxtvwingvletleg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAl8i9foACgkQY4mL3PG3 PloD/w//baB3yA3BXTukgaBYtsAHC4ttp1C1Jl0AZvsW9fd+Lv3ioOB0RA1quSIi 3OE0aWBZaSYqbxqlm50t6qhs5wqOC3Xvwj6LQR7qi1s3wvPm8iABNYc4SlTDtuCe /piuBC0Q1LyeN1Dk3WWnB66zYvJILNE037z3SVg+geIbuIkzmJftNCPk0dZNm9dx S+EBgDkTqxwHu86O3RCcCxA2e2PRZgB1de4df9EHktYuK6V5BoRSfG8YsXUWve2Y IJJvEuUCvWJJ8t9X4Sfw2xIh1llSzap5ZSRC/ToryrLxi8b3rRKZliYfelWWbldw S/ZMpsK94mdY7Ed+Cw/DX7TRiMcrcblsKj16wNfq94ViT1PUGpo4WFNaDjow0mqr 9Li6XIH3T1Ge/N9SE2kX1JOKchAXmw6CnuYMhZzBR9xO7psKSPH1G2GQbBeDBRxP Qk6cAGq+bIdcFCP5Ui9I24S3mJlMzmnV8jZwUfGaat4T54vzJJ3mpnFZoVdqdaxa xjsdQ1UJymDGXJNY5Fbh9F5Qt/JHrJesPJi3tvmrlN6bvXJISp7A/rzY1Jw7Ns1A 1SCRDxHcXoHqp0PAi91r7++ei6a845863pVEjoRYrZY8BOkzFS+Nk74ii54oRSjI i9wgdHxF/uefx3BxsDSuMID+tFi8iNYL3OYY949o6oxqsibNSxQ= =DUzf -----END PGP SIGNATURE----- --6xxtvwingvletleg-- From owner-svn-src-head@freebsd.org Thu Jul 30 16:35:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F3693A99CD for ; Thu, 30 Jul 2020 16:35:24 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHbcW349bz4bkj for ; Thu, 30 Jul 2020 16:35:23 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f66.google.com with SMTP id b6so25496164wrs.11 for ; Thu, 30 Jul 2020 09:35:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=xxKDaWWI2VvHs8vceOc3uEn073EhLNQOBn6B0ji5Jf8=; b=heXi81RcNiYaAO422SzExRuvIY07OwJBDMWlrXdHKEjn7uZyJ+Wc6M7gArHRi3zynF elKJR/0x13CZU8L+Kv932vbMobCvfw+ETufK/truivX513YCxS7cC8Ll0zzEQR30uFO/ gBXLmcl2XoEAad0r/ggItkGxZknosLCd92a9z8VUvSXGwsNKe25itxdW10Ti4TwiTf3N 3ewRsgnUVYQ157H+M+fBtCE1Kn1UMACqcSIgIaZzOEPr3LHobDaRRx+1j1tKhqFwa2Xc wApb5vxJP+pEbRssWeGtQXt1i6xSCImVvscyZomxQ6YS3pEQqWxhzZjUJ5VRJVOGRpKl 9ieg== X-Gm-Message-State: AOAM533388vnSBI+gXpSibZ0AVB6iHZUjqInG+v5BoigYC3EmQY0imLk yOdwzzzePpPNEFMKv8bfJwUcsw== X-Google-Smtp-Source: ABdhPJzMQT4r/2TRo8cXYFt5KOpEXx6eg4izrHAfo1t3LUO+u6wT/XabJCJJ9EX23XsUQI90rhr/FQ== X-Received: by 2002:adf:a11d:: with SMTP id o29mr35428934wro.421.1596126921928; Thu, 30 Jul 2020 09:35:21 -0700 (PDT) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id a123sm10483828wmd.28.2020.07.30.09.35.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jul 2020 09:35:21 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc From: Jessica Clarke In-Reply-To: <20200730163154.a4d7672xsugkhmxq@ivaldir.net> Date: Thu, 30 Jul 2020 17:35:20 +0100 Cc: =?utf-8?Q?Stefan_E=C3=9Fer?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <202007110733.06B7XJrp033777@repo.freebsd.org> <20200730162009.rnjs6l5rjqsoiqpq@ivaldir.net> <20200730163154.a4d7672xsugkhmxq@ivaldir.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Rspamd-Queue-Id: 4BHbcW349bz4bkj X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.221.66 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-1.81 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.07)[-1.073]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.26)[-0.262]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.66:from]; NEURAL_HAM_MEDIUM(-0.98)[-0.977]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.66:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 16:35:24 -0000 On 30 Jul 2020, at 17:31, Baptiste Daroussin wrote: > On Thu, Jul 30, 2020 at 05:28:19PM +0100, Jessica Clarke wrote: >> On 30 Jul 2020, at 17:20, Baptiste Daroussin = wrote: >>> On Sat, Jul 11, 2020 at 07:33:19AM +0000, Stefan E=C3=9Fer wrote: >>>> Author: se >>>> Date: Sat Jul 11 07:33:18 2020 >>>> New Revision: 363091 >>>> URL: https://svnweb.freebsd.org/changeset/base/363091 >>>>=20 >>>> Log: >>>> Update to version 3.1.3 >>>>=20 >>> Jumping on that commit, since the switch from our previous bc. >>>=20 >>> The output of the interactive bc has changed, the previous version = had a clean >>> UI, the new version "pollutes" the output with plenty of lines about = the >>> copyright: >>>=20 >>> =3D=3D=3D=3D >>> Copyright (c) 2018-2020 Gavin D. Howard and contributors >>> Report bugs at: https://git.yzena.com/gavin/bc >>>=20 >>> This is free software with ABSOLUTELY NO WARRANTY. >>> =3D=3D=3D=3D >>>=20 >>> Imagine if all programs where doing that, it would be painful, do = you think >>> upstream can be convinced to remove those lines? >>>=20 >>> I no the GNU version also has the same polluted output which was one = of the >>> reason I was happy with out previous version of bc. >>=20 >> By default both will print such a banner if and only if being called >> interactively. You can disable the banner explicitly with -q/--quiet >> for both GNU bc and this bc. I agree it's a bit noisy and would be >> nicer to not have that printed, but it's not without precedent for >> REPL-like things. >=20 > Yes it is not without precedent for REPL-like things, still I dislike = this and > would be happy to get bc interactive be as nice as the previous one we = had :) >=20 > If not I will deal with it and just yell internally each time I run it = :D `alias bc=3D'bc -q'` / `alias bc bc -q` and preserve your inner zen? :) Jess From owner-svn-src-head@freebsd.org Thu Jul 30 16:39:26 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F12C23A9DD4; Thu, 30 Jul 2020 16:39:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHbjB68S6z4c47; Thu, 30 Jul 2020 16:39:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from ivaldir.etoilebsd.net (etoilebsd.net [178.32.217.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 9E571200BE; Thu, 30 Jul 2020 16:39:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by ivaldir.etoilebsd.net (Postfix, from userid 1001) id 31BC8E8393; Thu, 30 Jul 2020 18:38:55 +0200 (CEST) Date: Thu, 30 Jul 2020 18:38:55 +0200 From: Baptiste Daroussin To: Jessica Clarke Cc: Stefan =?utf-8?B?RcOfZXI=?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc Message-ID: <20200730163855.7ff2tqugsuakp4ca@ivaldir.net> References: <202007110733.06B7XJrp033777@repo.freebsd.org> <20200730162009.rnjs6l5rjqsoiqpq@ivaldir.net> <20200730163154.a4d7672xsugkhmxq@ivaldir.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5i2eodukm37k4ydf" Content-Disposition: inline In-Reply-To: X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 16:39:27 -0000 --5i2eodukm37k4ydf Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 30, 2020 at 05:35:20PM +0100, Jessica Clarke wrote: > On 30 Jul 2020, at 17:31, Baptiste Daroussin wrote: > > On Thu, Jul 30, 2020 at 05:28:19PM +0100, Jessica Clarke wrote: > >> On 30 Jul 2020, at 17:20, Baptiste Daroussin wrote: > >>> On Sat, Jul 11, 2020 at 07:33:19AM +0000, Stefan E=DFer wrote: > >>>> Author: se > >>>> Date: Sat Jul 11 07:33:18 2020 > >>>> New Revision: 363091 > >>>> URL: https://svnweb.freebsd.org/changeset/base/363091 > >>>>=20 > >>>> Log: > >>>> Update to version 3.1.3 > >>>>=20 > >>> Jumping on that commit, since the switch from our previous bc. > >>>=20 > >>> The output of the interactive bc has changed, the previous version ha= d a clean > >>> UI, the new version "pollutes" the output with plenty of lines about = the > >>> copyright: > >>>=20 > >>> =3D=3D=3D=3D > >>> Copyright (c) 2018-2020 Gavin D. Howard and contributors > >>> Report bugs at: https://git.yzena.com/gavin/bc > >>>=20 > >>> This is free software with ABSOLUTELY NO WARRANTY. > >>> =3D=3D=3D=3D > >>>=20 > >>> Imagine if all programs where doing that, it would be painful, do you= think > >>> upstream can be convinced to remove those lines? > >>>=20 > >>> I no the GNU version also has the same polluted output which was one = of the > >>> reason I was happy with out previous version of bc. > >>=20 > >> By default both will print such a banner if and only if being called > >> interactively. You can disable the banner explicitly with -q/--quiet > >> for both GNU bc and this bc. I agree it's a bit noisy and would be > >> nicer to not have that printed, but it's not without precedent for > >> REPL-like things. > >=20 > > Yes it is not without precedent for REPL-like things, still I dislike t= his and > > would be happy to get bc interactive be as nice as the previous one we = had :) > >=20 > > If not I will deal with it and just yell internally each time I run it = :D >=20 > `alias bc=3D'bc -q'` / `alias bc bc -q` and preserve your inner zen? :) >=20 That was my actual plan but it was less fun to write :D Bapt --5i2eodukm37k4ydf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAl8i958ACgkQY4mL3PG3 Plrqng/9G6VEeJwOHKddPNbu9AQm491RfOCixoJYyby4QYlXyx2Leuo+xv8y1gXr 5y/acZ/Yf7n8uTb+Kk77xZD1AqP7SJ6xUMy8lK4RjpCJFlYnIHD0+GmsiNHGPALl X7HwR7j5+u8i7wZtK4WUURG2A2PxNSs2d9cgYm6xS5D0qRvCcUV40lXKD9//1E7T TG0Nx2N3YFYqF7yG0fPs+NJLxhxl0OqpTdWerHy7EmgXRXI/zj8If1kNb+5VOwtV OWR8Kacoiza99/zDyxKMB6O5yhYf28TR3TYLo6uFwjixHJXeS/wht1U4X1pQ+301 i9yMqQy7T9Lm94GMayMEhmwtqNfMNsFn0qr1xaseSstDnEvGp0aXy4sOek0YGKFn vHI/9MTepr3kVcYwUxXMfKKB72RhOP89wQGnKl1MH4WeScrbrs1oRMKHk2aKaS9q SF8C+J0G34ytBluXdGmj8Ax5fSGX/q+EbsebxRA2hROUrYZ1Jw0X7Je0fSrbwKUD yE49vxtlUa7Up28xDuZeBJgXKOC73erJl44pL8gSkEsT2VVg29eUJNew1n6Kz5Cj UEWHMOAUZjgnN7jGW3RMgikFXWrJTTXMYbiZSXkLPnVkwIW/eEF9GIFhaw4Uvv2L 9Cv7WW1x0eEhTFxGwX7wQK0LC6XYRkOCth1IxQE5iZjEIbc2R+M= =Nl1W -----END PGP SIGNATURE----- --5i2eodukm37k4ydf-- From owner-svn-src-head@freebsd.org Thu Jul 30 16:40:43 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 981563AA182; Thu, 30 Jul 2020 16:40:43 +0000 (UTC) (envelope-from rpokala@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHbkf6r7qz4c84; Thu, 30 Jul 2020 16:40:42 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (c-98-207-126-143.hsd1.ca.comcast.net [98.207.126.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id B3B501FF2B; Thu, 30 Jul 2020 16:40:41 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.39.20071300 Date: Thu, 30 Jul 2020 09:40:36 -0700 Subject: Re: svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc From: Ravi Pokala To: Jessica Clarke , Baptiste Daroussin CC: Stefan =?UTF-8?B?RcOfZXI=?= , src-committers , , Message-ID: Thread-Topic: svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc References: <202007110733.06B7XJrp033777@repo.freebsd.org> <20200730162009.rnjs6l5rjqsoiqpq@ivaldir.net> <20200730163154.a4d7672xsugkhmxq@ivaldir.net> In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 16:40:43 -0000 -----Original Message----- From: on behalf of Jessica Clarke Date: 2020-07-30, Thursday at 09:35 To: Baptiste Daroussin Cc: Stefan E=C3=9Fer , src-committers , , Subject: Re: svn commit: r363091 - in head/contrib/bc: . include manuals sr= c tests tests/bc On 30 Jul 2020, at 17:31, Baptiste Daroussin wrote: > On Thu, Jul 30, 2020 at 05:28:19PM +0100, Jessica Clarke wrote: >> On 30 Jul 2020, at 17:20, Baptiste Daroussin wrot= e: >>> On Sat, Jul 11, 2020 at 07:33:19AM +0000, Stefan E=C3=9Fer wrote: >>>> Author: se >>>> Date: Sat Jul 11 07:33:18 2020 >>>> New Revision: 363091 >>>> URL: https://svnweb.freebsd.org/changeset/base/363091 >>>>=20 >>>> Log: >>>> Update to version 3.1.3 >>>>=20 >>> Jumping on that commit, since the switch from our previous bc. >>>=20 >>> The output of the interactive bc has changed, the previous version = had a clean >>> UI, the new version "pollutes" the output with plenty of lines abou= t the >>> copyright: >>>=20 >>> =3D=3D=3D=3D >>> Copyright (c) 2018-2020 Gavin D. Howard and contributors >>> Report bugs at: https://git.yzena.com/gavin/bc >>>=20 >>> This is free software with ABSOLUTELY NO WARRANTY. >>> =3D=3D=3D=3D >>>=20 >>> Imagine if all programs where doing that, it would be painful, do y= ou think >>> upstream can be convinced to remove those lines? >>>=20 >>> I no the GNU version also has the same polluted output which was on= e of the >>> reason I was happy with out previous version of bc. >>=20 >> By default both will print such a banner if and only if being called >> interactively. You can disable the banner explicitly with -q/--quiet >> for both GNU bc and this bc. I agree it's a bit noisy and would be >> nicer to not have that printed, but it's not without precedent for >> REPL-like things. >=20 > Yes it is not without precedent for REPL-like things, still I dislike= this and > would be happy to get bc interactive be as nice as the previous one w= e had :) >=20 > If not I will deal with it and just yell internally each time I run i= t :D `alias bc=3D'bc -q'` / `alias bc bc -q` and preserve your inner zen? :) Jess I was actually about to complain about the new `dc' not exiting after evalu= ating a '-e' expression, without an explicit 'q'. But then I noticed the "DC= _EXPR_EXIT" envvar, which restores the desired behavior. That lead me to dis= cover "DC_ENV_ARGS" and, correspondingly, "BC_ENV_ARGS"; that last one would= be helpful here. Thanks, Ravi (rpokala@) From owner-svn-src-head@freebsd.org Thu Jul 30 16:46:01 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A630D3AA267 for ; Thu, 30 Jul 2020 16:46:01 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHbrm6fyDz4cTp for ; Thu, 30 Jul 2020 16:46:00 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f67.google.com with SMTP id f18so25553941wrs.0 for ; Thu, 30 Jul 2020 09:46:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=00ffhTcbb8GMkZjTdW7mvirTRuDSRAokcJczfk0fhpE=; b=dWlzPOGDnCicxzRq906Fsum11W+wjxDduetYYJoIYk8K2rKbSwGzdMxL21tXaRlSS2 InezIboS62eEnHYQxH8D9YzPCa2xLBoz8Gw1O55K9v+uyM7IRJylh15T5yNZiNPfwqU4 fuE32sYh9dcImLOODZy71GwNX27p+2kKGMweBRoW5P1O/syiBSypeZz/yHcBatXqOZCP J9lGiEtaLsxqXzi7hY7V0kxoHm80GzeIi59VVmuEPt1doiJsUGmeUIVbx/OCaWwuQ+j7 /9ejQQOm6jMtvNfKUDkKN1rvr4Qw9SbTgTzufFud4KPUZA/XyIXADTZahasw41fih/Bm +qCQ== X-Gm-Message-State: AOAM532sILDb8/heYAhf6DmJEHQF+xtWMKBl4MBtsx/jbkv+AAAk7r8y Q+e7bNIgr/behPhdeKfcEpHo4x5+PkM= X-Google-Smtp-Source: ABdhPJxKDTJTqm6al073OOFoPZEsUYTbf4F9BLj9aCH1pIFc5GQkCXIQzRZ0JrysY5jZh3gvWkn+Kg== X-Received: by 2002:a5d:5151:: with SMTP id u17mr3603031wrt.154.1596127559601; Thu, 30 Jul 2020 09:45:59 -0700 (PDT) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id f9sm9754267wru.47.2020.07.30.09.45.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jul 2020 09:45:58 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc From: Jessica Clarke In-Reply-To: Date: Thu, 30 Jul 2020 17:45:58 +0100 Cc: Baptiste Daroussin , =?utf-8?Q?Stefan_E=C3=9Fer?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <7257CDA6-0D66-42EB-9920-90DB90B9CA63@freebsd.org> References: <202007110733.06B7XJrp033777@repo.freebsd.org> <20200730162009.rnjs6l5rjqsoiqpq@ivaldir.net> <20200730163154.a4d7672xsugkhmxq@ivaldir.net> To: Ravi Pokala X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Rspamd-Queue-Id: 4BHbrm6fyDz4cTp X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.221.67 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-2.65 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_FIVE(0.00)[6]; NEURAL_HAM_LONG(-1.07)[-1.071]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-1.10)[-1.101]; RCVD_IN_DNSWL_NONE(0.00)[209.85.221.67:from]; NEURAL_HAM_MEDIUM(-0.98)[-0.978]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.221.67:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 16:46:01 -0000 On 30 Jul 2020, at 17:40, Ravi Pokala wrote: >=20 > -----Original Message----- > From: on behalf of Jessica Clarke = > Date: 2020-07-30, Thursday at 09:35 > To: Baptiste Daroussin > Cc: Stefan E=C3=9Fer , src-committers = , , = > Subject: Re: svn commit: r363091 - in head/contrib/bc: . include = manuals src tests tests/bc >=20 > On 30 Jul 2020, at 17:31, Baptiste Daroussin = wrote: >> On Thu, Jul 30, 2020 at 05:28:19PM +0100, Jessica Clarke wrote: >>> On 30 Jul 2020, at 17:20, Baptiste Daroussin = wrote: >>>> On Sat, Jul 11, 2020 at 07:33:19AM +0000, Stefan E=C3=9Fer wrote: >>>>> Author: se >>>>> Date: Sat Jul 11 07:33:18 2020 >>>>> New Revision: 363091 >>>>> URL: https://svnweb.freebsd.org/changeset/base/363091 >>>>>=20 >>>>> Log: >>>>> Update to version 3.1.3 >>>>>=20 >>>> Jumping on that commit, since the switch from our previous bc. >>>>=20 >>>> The output of the interactive bc has changed, the previous version = had a clean >>>> UI, the new version "pollutes" the output with plenty of lines = about the >>>> copyright: >>>>=20 >>>> =3D=3D=3D=3D >>>> Copyright (c) 2018-2020 Gavin D. Howard and contributors >>>> Report bugs at: https://git.yzena.com/gavin/bc >>>>=20 >>>> This is free software with ABSOLUTELY NO WARRANTY. >>>> =3D=3D=3D=3D >>>>=20 >>>> Imagine if all programs where doing that, it would be painful, do = you think >>>> upstream can be convinced to remove those lines? >>>>=20 >>>> I no the GNU version also has the same polluted output which was = one of the >>>> reason I was happy with out previous version of bc. >>>=20 >>> By default both will print such a banner if and only if being called >>> interactively. You can disable the banner explicitly with -q/--quiet >>> for both GNU bc and this bc. I agree it's a bit noisy and would be >>> nicer to not have that printed, but it's not without precedent for >>> REPL-like things. >>=20 >> Yes it is not without precedent for REPL-like things, still I dislike = this and >> would be happy to get bc interactive be as nice as the previous one = we had :) >>=20 >> If not I will deal with it and just yell internally each time I run = it :D >=20 > `alias bc=3D'bc -q'` / `alias bc bc -q` and preserve your inner = zen? :) >=20 > Jess >=20 > I was actually about to complain about the new `dc' not exiting after = evaluating a '-e' expression, without an explicit 'q'. But then I = noticed the "DC_EXPR_EXIT" envvar, which restores the desired behavior. = That lead me to discover "DC_ENV_ARGS" and, correspondingly, = "BC_ENV_ARGS"; that last one would be helpful here. That does feel like the wrong default; even GNU dc doesn't do that, and the principle of least surprise would suggest exiting is the right thing to do. It's also unlikely you want to evaluate something and then use it interactively. Jess From owner-svn-src-head@freebsd.org Thu Jul 30 16:50:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD85E3AA5A3; Thu, 30 Jul 2020 16:50: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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHby55bL5z4cn8; Thu, 30 Jul 2020 16:50:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8203:2990:f066:4d74:69d2:b3d6]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 0D0CF20246; Thu, 30 Jul 2020 16:50:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc To: Baptiste Daroussin , Jessica Clarke Cc: =?UTF-8?Q?Stefan_E=c3=9fer?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202007110733.06B7XJrp033777@repo.freebsd.org> <20200730162009.rnjs6l5rjqsoiqpq@ivaldir.net> <20200730163154.a4d7672xsugkhmxq@ivaldir.net> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Thu, 30 Jul 2020 09:50:34 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200730163154.a4d7672xsugkhmxq@ivaldir.net> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 16:50:37 -0000 On 7/30/20 9:31 AM, Baptiste Daroussin wrote: > On Thu, Jul 30, 2020 at 05:28:19PM +0100, Jessica Clarke wrote: >> On 30 Jul 2020, at 17:20, Baptiste Daroussin wrote: >>> On Sat, Jul 11, 2020 at 07:33:19AM +0000, Stefan Eßer wrote: >>>> Author: se >>>> Date: Sat Jul 11 07:33:18 2020 >>>> New Revision: 363091 >>>> URL: https://svnweb.freebsd.org/changeset/base/363091 >>>> >>>> Log: >>>> Update to version 3.1.3 >>>> >>> Jumping on that commit, since the switch from our previous bc. >>> >>> The output of the interactive bc has changed, the previous version had a clean >>> UI, the new version "pollutes" the output with plenty of lines about the >>> copyright: >>> >>> ==== >>> Copyright (c) 2018-2020 Gavin D. Howard and contributors >>> Report bugs at: https://git.yzena.com/gavin/bc >>> >>> This is free software with ABSOLUTELY NO WARRANTY. >>> ==== >>> >>> Imagine if all programs where doing that, it would be painful, do you think >>> upstream can be convinced to remove those lines? >>> >>> I no the GNU version also has the same polluted output which was one of the >>> reason I was happy with out previous version of bc. >> >> By default both will print such a banner if and only if being called >> interactively. You can disable the banner explicitly with -q/--quiet >> for both GNU bc and this bc. I agree it's a bit noisy and would be >> nicer to not have that printed, but it's not without precedent for >> REPL-like things. > > Yes it is not without precedent for REPL-like things, still I dislike this and > would be happy to get bc interactive be as nice as the previous one we had :) > > If not I will deal with it and just yell internally each time I run it :D FWIW, I also consider this a regression relative to the previous bc. I had gotten used to the lack of spam when invoking bc and it was the first thing I noticed when the new one was imported, just hadn't sat down and wrote an e-mail about it yet. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Jul 30 16:52:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E8A63AA713; Thu, 30 Jul 2020 16:52:08 +0000 (UTC) (envelope-from st_esser@t-online.de) Received: from mailout01.t-online.de (mailout01.t-online.de [194.25.134.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout00.t-online.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHbzq4Yncz4d6s; Thu, 30 Jul 2020 16:52:07 +0000 (UTC) (envelope-from st_esser@t-online.de) Received: from fwd19.aul.t-online.de (fwd19.aul.t-online.de [172.20.27.65]) by mailout01.t-online.de (Postfix) with SMTP id 9834C4278DA1; Thu, 30 Jul 2020 18:52:05 +0200 (CEST) Received: from Stefans-MacBook-Pro-449.fritz.box (Vgd20eZEwhj1cBWBjhapfLq9IQgNY+qjLQUaTBifgOn+O0a6xpbb-DFkPOa1D57Qpk@[93.200.63.47]) by fwd19.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1k1Bmh-2Oyvqa0; Thu, 30 Jul 2020 18:51:59 +0200 Subject: Re: svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc To: Baptiste Daroussin , Jessica Clarke Cc: =?UTF-8?Q?Stefan_E=c3=9fer?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202007110733.06B7XJrp033777@repo.freebsd.org> <20200730162009.rnjs6l5rjqsoiqpq@ivaldir.net> <20200730163154.a4d7672xsugkhmxq@ivaldir.net> From: =?UTF-8?Q?Stefan_E=c3=9fer?= Message-ID: <7f89d655-eeaf-beca-5531-77da2b790c01@t-online.de> Date: Thu, 30 Jul 2020 18:51:58 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200730163154.a4d7672xsugkhmxq@ivaldir.net> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ID: Vgd20eZEwhj1cBWBjhapfLq9IQgNY+qjLQUaTBifgOn+O0a6xpbb-DFkPOa1D57Qpk X-TOI-EXPURGATEID: 150726::1596127919-00008954-9EF43298/0/0 CLEAN NORMAL X-TOI-MSGID: 5a900d75-76e5-48b9-9db3-6a929b047788 X-Rspamd-Queue-Id: 4BHbzq4Yncz4d6s X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:3320, ipnet:194.25.0.0/16, country:DE]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 16:52:08 -0000 Am 30.07.20 um 18:31 schrieb Baptiste Daroussin: > On Thu, Jul 30, 2020 at 05:28:19PM +0100, Jessica Clarke wrote: >> On 30 Jul 2020, at 17:20, Baptiste Daroussin wrote: >>> On Sat, Jul 11, 2020 at 07:33:19AM +0000, Stefan Eßer wrote: >>>> Author: se >>>> Date: Sat Jul 11 07:33:18 2020 >>>> New Revision: 363091 >>>> URL: https://svnweb.freebsd.org/changeset/base/363091 >>>> >>>> Log: >>>> Update to version 3.1.3 >>>> >>> Jumping on that commit, since the switch from our previous bc. >>> >>> The output of the interactive bc has changed, the previous version had a clean >>> UI, the new version "pollutes" the output with plenty of lines about the >>> copyright: >>> >>> ==== >>> Copyright (c) 2018-2020 Gavin D. Howard and contributors >>> Report bugs at: https://git.yzena.com/gavin/bc >>> >>> This is free software with ABSOLUTELY NO WARRANTY. >>> ==== >>> >>> Imagine if all programs where doing that, it would be painful, do you think >>> upstream can be convinced to remove those lines? >>> >>> I no the GNU version also has the same polluted output which was one of the >>> reason I was happy with out previous version of bc. >> >> By default both will print such a banner if and only if being called >> interactively. You can disable the banner explicitly with -q/--quiet >> for both GNU bc and this bc. I agree it's a bit noisy and would be >> nicer to not have that printed, but it's not without precedent for >> REPL-like things. > > Yes it is not without precedent for REPL-like things, still I dislike this and > would be happy to get bc interactive be as nice as the previous one we had :) > > If not I will deal with it and just yell internally each time I run it :D I'll forward this thread to the author - had already stated similar thought to him for consideration. Is very interested to prevent forks of his software - although not forbidden by the license - but he wants to keep his sources as the official and "clean" upstream for other projects. My guess is that he'll add a compile time switch to his version that will be added to our usr.bin Makefile and will suppress the start-up message in our base system version. (I'll keep the port version as is unless there is a strong preference to suppress it also in the port). I'd expect it to take a few days (since he only tags new versions after running a fuzzer for a few days if non-trivial changes have been performed and I know he improved something in the interpreter without publishing it, yet) ... Regards, STefan From owner-svn-src-head@freebsd.org Thu Jul 30 16:55:56 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E28203AA6CE; Thu, 30 Jul 2020 16:55:56 +0000 (UTC) (envelope-from st_esser@t-online.de) Received: from mailout10.t-online.de (mailout10.t-online.de [194.25.134.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout00.t-online.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHc492PJ7z4dKl; Thu, 30 Jul 2020 16:55:53 +0000 (UTC) (envelope-from st_esser@t-online.de) Received: from fwd21.aul.t-online.de (fwd21.aul.t-online.de [172.20.27.66]) by mailout10.t-online.de (Postfix) with SMTP id 708F541655DA; Thu, 30 Jul 2020 18:55:51 +0200 (CEST) Received: from Stefans-MacBook-Pro-449.fritz.box (JT9t1GZpYhOlPNszakVc8kXyhjq7se5ZLPOftP6B71a-HqXxRQwK3e-yOk0-fxqQd9@[93.200.63.47]) by fwd21.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1k1BqK-4D4Hpo0; Thu, 30 Jul 2020 18:55:44 +0200 Subject: Re: svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc To: Jessica Clarke , Ravi Pokala Cc: Baptiste Daroussin , =?UTF-8?Q?Stefan_E=c3=9fer?= , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202007110733.06B7XJrp033777@repo.freebsd.org> <20200730162009.rnjs6l5rjqsoiqpq@ivaldir.net> <20200730163154.a4d7672xsugkhmxq@ivaldir.net> <7257CDA6-0D66-42EB-9920-90DB90B9CA63@freebsd.org> From: =?UTF-8?Q?Stefan_E=c3=9fer?= Message-ID: <42f2dcf3-6eda-fb69-cc95-30a18e716407@t-online.de> Date: Thu, 30 Jul 2020 18:55:43 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <7257CDA6-0D66-42EB-9920-90DB90B9CA63@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 8bit X-ID: JT9t1GZpYhOlPNszakVc8kXyhjq7se5ZLPOftP6B71a-HqXxRQwK3e-yOk0-fxqQd9 X-TOI-EXPURGATEID: 150726::1596128144-0000D063-5DF8DEF2/0/0 CLEAN NORMAL X-TOI-MSGID: 1ce1b80d-64de-49f4-bc07-acdad585c175 X-Rspamd-Queue-Id: 4BHc492PJ7z4dKl X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of st_esser@t-online.de has no SPF policy when checking 194.25.134.21) smtp.mailfrom=st_esser@t-online.de X-Spamd-Result: default: False [2.43 / 15.00]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[93.200.63.47:received]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[t-online.de]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[t-online.de]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.77)[0.774]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.16)[-0.157]; NEURAL_SPAM_LONG(0.91)[0.908]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_IN_DNSWL_NONE(0.00)[194.25.134.21:from]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:3320, ipnet:194.25.0.0/16, country:DE]; RCVD_TLS_LAST(0.00)[]; FREEMAIL_ENVFROM(0.00)[t-online.de]; RWL_MAILSPIKE_POSSIBLE(0.00)[194.25.134.21:from] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 16:55:56 -0000 Am 30.07.20 um 18:45 schrieb Jessica Clarke: > On 30 Jul 2020, at 17:40, Ravi Pokala wrote: >> >> -----Original Message----- >> From: on behalf of Jessica Clarke >> Date: 2020-07-30, Thursday at 09:35 >> To: Baptiste Daroussin >> Cc: Stefan Eßer , src-committers , , >> Subject: Re: svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc >> >> On 30 Jul 2020, at 17:31, Baptiste Daroussin wrote: >>> On Thu, Jul 30, 2020 at 05:28:19PM +0100, Jessica Clarke wrote: >>>> On 30 Jul 2020, at 17:20, Baptiste Daroussin wrote: >>>>> On Sat, Jul 11, 2020 at 07:33:19AM +0000, Stefan Eßer wrote: >>>>>> Author: se >>>>>> Date: Sat Jul 11 07:33:18 2020 >>>>>> New Revision: 363091 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/363091 >>>>>> >>>>>> Log: >>>>>> Update to version 3.1.3 >>>>>> >>>>> Jumping on that commit, since the switch from our previous bc. >>>>> >>>>> The output of the interactive bc has changed, the previous version had a clean >>>>> UI, the new version "pollutes" the output with plenty of lines about the >>>>> copyright: >>>>> >>>>> ==== >>>>> Copyright (c) 2018-2020 Gavin D. Howard and contributors >>>>> Report bugs at: https://git.yzena.com/gavin/bc >>>>> >>>>> This is free software with ABSOLUTELY NO WARRANTY. >>>>> ==== >>>>> >>>>> Imagine if all programs where doing that, it would be painful, do you think >>>>> upstream can be convinced to remove those lines? >>>>> >>>>> I no the GNU version also has the same polluted output which was one of the >>>>> reason I was happy with out previous version of bc. >>>> >>>> By default both will print such a banner if and only if being called >>>> interactively. You can disable the banner explicitly with -q/--quiet >>>> for both GNU bc and this bc. I agree it's a bit noisy and would be >>>> nicer to not have that printed, but it's not without precedent for >>>> REPL-like things. >>> >>> Yes it is not without precedent for REPL-like things, still I dislike this and >>> would be happy to get bc interactive be as nice as the previous one we had :) >>> >>> If not I will deal with it and just yell internally each time I run it :D >> >> `alias bc='bc -q'` / `alias bc bc -q` and preserve your inner zen? :) >> >> Jess >> >> I was actually about to complain about the new `dc' not exiting after evaluating a '-e' expression, without an explicit 'q'. But then I noticed the "DC_EXPR_EXIT" envvar, which restores the desired behavior. That lead me to discover "DC_ENV_ARGS" and, correspondingly, "BC_ENV_ARGS"; that last one would be helpful here. > > That does feel like the wrong default; even GNU dc doesn't do that, and > the principle of least surprise would suggest exiting is the right > thing to do. It's also unlikely you want to evaluate something and then > use it interactively. Interesting observation - I've got to admit that I hardly ever use dc (despite being the owner of a collection of HP UPN calculators ;-) ). I'll forward this to the author of this bc/dc and I'm sure he will offer a patched version (unless there are strong reasons for the current behavior, e.g. compatibility with another dc ...) Regards, STefan From owner-svn-src-head@freebsd.org Thu Jul 30 17:10:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0CED63AAB16; Thu, 30 Jul 2020 17:10:02 +0000 (UTC) (envelope-from rpokala@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHcNT6XCnz4fQ2; Thu, 30 Jul 2020 17:10:01 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (c-98-207-126-143.hsd1.ca.comcast.net [98.207.126.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id A3B4D203A1; Thu, 30 Jul 2020 17:09:59 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.39.20071300 Date: Thu, 30 Jul 2020 10:09:56 -0700 Subject: Re: svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc From: Ravi Pokala To: Stefan =?UTF-8?B?RcOfZXI=?= , Jessica Clarke CC: Baptiste Daroussin , Stefan =?UTF-8?B?RcOfZXI=?= , src-committers , , Message-ID: Thread-Topic: svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc References: <202007110733.06B7XJrp033777@repo.freebsd.org> <20200730162009.rnjs6l5rjqsoiqpq@ivaldir.net> <20200730163154.a4d7672xsugkhmxq@ivaldir.net> <7257CDA6-0D66-42EB-9920-90DB90B9CA63@freebsd.org> <42f2dcf3-6eda-fb69-cc95-30a18e716407@t-online.de> In-Reply-To: <42f2dcf3-6eda-fb69-cc95-30a18e716407@t-online.de> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 17:10:02 -0000 -----Original Message----- From: on behalf of Stefan E=C3=9Fer Date: 2020-07-30, Thursday at 09:55 To: Jessica Clarke , Ravi Pokala Cc: Baptiste Daroussin , Stefan E=C3=9Fer , s= rc-committers , , Subject: Re: svn commit: r363091 - in head/contrib/bc: . include manuals sr= c tests tests/bc Am 30.07.20 um 18:45 schrieb Jessica Clarke: > On 30 Jul 2020, at 17:40, Ravi Pokala wrote: >> >> -----Original Message----- >> From: on behalf of Jessica Clarke= >> Date: 2020-07-30, Thursday at 09:35 >> To: Baptiste Daroussin >> Cc: Stefan E=C3=9Fer , src-committers , , >> Subject: Re: svn commit: r363091 - in head/contrib/bc: . include man= uals src tests tests/bc >> >> On 30 Jul 2020, at 17:31, Baptiste Daroussin w= rote: >>> On Thu, Jul 30, 2020 at 05:28:19PM +0100, Jessica Clarke wrote: >>>> On 30 Jul 2020, at 17:20, Baptiste Daroussin wr= ote: >>>>> On Sat, Jul 11, 2020 at 07:33:19AM +0000, Stefan E=C3=9Fer wrote: >>>>>> Author: se >>>>>> Date: Sat Jul 11 07:33:18 2020 >>>>>> New Revision: 363091 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/363091 >>>>>> >>>>>> Log: >>>>>> Update to version 3.1.3 >>>>>> >>>>> Jumping on that commit, since the switch from our previous bc. >>>>> >>>>> The output of the interactive bc has changed, the previous versio= n had a clean >>>>> UI, the new version "pollutes" the output with plenty of lines ab= out the >>>>> copyright: >>>>> >>>>> =3D=3D=3D=3D >>>>> Copyright (c) 2018-2020 Gavin D. Howard and contributors >>>>> Report bugs at: https://git.yzena.com/gavin/bc >>>>> >>>>> This is free software with ABSOLUTELY NO WARRANTY. >>>>> =3D=3D=3D=3D >>>>> >>>>> Imagine if all programs where doing that, it would be painful, do= you think >>>>> upstream can be convinced to remove those lines? >>>>> >>>>> I no the GNU version also has the same polluted output which was = one of the >>>>> reason I was happy with out previous version of bc. >>>> >>>> By default both will print such a banner if and only if being call= ed >>>> interactively. You can disable the banner explicitly with -q/--qui= et >>>> for both GNU bc and this bc. I agree it's a bit noisy and would be >>>> nicer to not have that printed, but it's not without precedent for >>>> REPL-like things. >>> >>> Yes it is not without precedent for REPL-like things, still I disli= ke this and >>> would be happy to get bc interactive be as nice as the previous one= we had :) >>> >>> If not I will deal with it and just yell internally each time I run= it :D >> >> `alias bc=3D'bc -q'` / `alias bc bc -q` and preserve your inner zen= ? :) >> >> Jess >> >> I was actually about to complain about the new `dc' not exiting afte= r evaluating a '-e' expression, without an explicit 'q'. But then I noticed = the "DC_EXPR_EXIT" envvar, which restores the desired behavior. That lead me= to discover "DC_ENV_ARGS" and, correspondingly, "BC_ENV_ARGS"; that last on= e would be helpful here. >=20 > That does feel like the wrong default; even GNU dc doesn't do that, a= nd > the principle of least surprise would suggest exiting is the right > thing to do. It's also unlikely you want to evaluate something and th= en > use it interactively. Interesting observation - I've got to admit that I hardly ever use dc (despite being the owner of a collection of HP UPN calculators ;-) ). Ironically, I couldn't wrap my head around HP RPN calculators in the '90s, = so I used a TI-85 or TI-89 instead. Now, I do all my non-trivial math using = RPN in `dc'. :-) -Ravi I'll forward this to the author of this bc/dc and I'm sure he will offer a patched version (unless there are strong reasons for the current behavior, e.g. compatibility with another dc ...) Regards, STefan From owner-svn-src-head@freebsd.org Thu Jul 30 17:43:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC35D3AB173; Thu, 30 Jul 2020 17:43:23 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHd6z4d7Sz3St4; Thu, 30 Jul 2020 17:43:23 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8232E148AF; Thu, 30 Jul 2020 17:43:23 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06UHhNlY074352; Thu, 30 Jul 2020 17:43:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06UHhNsm074351; Thu, 30 Jul 2020 17:43:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007301743.06UHhNsm074351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 30 Jul 2020 17:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363710 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 363710 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 17:43:23 -0000 Author: markj Date: Thu Jul 30 17:43:23 2020 New Revision: 363710 URL: https://svnweb.freebsd.org/changeset/base/363710 Log: ip6_output(): Check the return value of in6_getlinkifnet(). If the destination address has an embedded scope ID, make sure that it corresponds to a valid ifnet before proceeding. Otherwise a sendto() with a bogus link-local address can trigger a NULL pointer dereference. Reported by: syzkaller Reviewed by: ae Fixes: r358572 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25887 Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Thu Jul 30 17:18:42 2020 (r363709) +++ head/sys/netinet6/ip6_output.c Thu Jul 30 17:43:23 2020 (r363710) @@ -761,6 +761,10 @@ again: IN6_IS_ADDR_MC_NODELOCAL(&dst_sa.sin6_addr)) { if (scopeid > 0) { ifp = in6_getlinkifnet(scopeid); + if (ifp == NULL) { + error = EHOSTUNREACH; + goto bad; + } *dst = dst_sa; /* XXX */ goto nonh6lookup; } From owner-svn-src-head@freebsd.org Thu Jul 30 18:31:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5395B3ABE36 for ; Thu, 30 Jul 2020 18:31:59 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHfC22hWJz3Vd4 for ; Thu, 30 Jul 2020 18:31:58 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: by mail-lf1-f50.google.com with SMTP id u13so2042211lff.11 for ; Thu, 30 Jul 2020 11:31:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rrzwe31JDGy+p7jhmmjTBz4cyS5ibD+jbLuRSHG5ZPQ=; b=sLjJuyZM3uGcDRiMaeO7h5+QQnQET6VWYTdtGTGQBw5ZukA7KTRB3TnrIA3cH3ezZD 6LZCwgClIcQ3ANd0j6wUot0/VIla/RfhjZ3ODJgj1G55+P5DNZJ+cUn6Kg2AMx83tWen 1v1uhBfShoiKKha2L/0NaC2HTS0/4dDHTV/P+xM/Y3nDPN8Bhuinn+p/B7LbuPvBx2HC Hg51OJkM8Qz/kSNEb6wNTdQqOyBmHWK/8HvEt3cRc2c1CFNykDpH5lbPdSQOxn3WQcF9 Bed/1A8zI+m5V1v65wG+iNPh4SMcFSMfFpF6tWBIggDK10fvzpMAX+KYlg1xxkVtpruP /A+g== X-Gm-Message-State: AOAM5326Ex7QjKvoENQDqLMaZaWADoUpp8/Qep//QpF258Ta85hJRfC0 TdCUIT4aInYHtXPN4Uidt4L7AfAi X-Google-Smtp-Source: ABdhPJyqVO6Q4eWSN2xv6mnoOAV2O9DRrF7+iXn/CRYrzQGDEfJSevziqZE8Jk3juOpxq6hUUzZ5kg== X-Received: by 2002:a19:8044:: with SMTP id b65mr2295014lfd.91.1596133916351; Thu, 30 Jul 2020 11:31:56 -0700 (PDT) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com. [209.85.167.42]) by smtp.gmail.com with ESMTPSA id f9sm1350848lfc.43.2020.07.30.11.31.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Jul 2020 11:31:55 -0700 (PDT) Received: by mail-lf1-f42.google.com with SMTP id h8so15465531lfp.9 for ; Thu, 30 Jul 2020 11:31:54 -0700 (PDT) X-Received: by 2002:a19:8b55:: with SMTP id n82mr2278855lfd.35.1596133914502; Thu, 30 Jul 2020 11:31:54 -0700 (PDT) MIME-Version: 1.0 References: <202006111559.05BFxnSa070435@repo.freebsd.org> <20200725.124911.256350108759170094.nyan@FreeBSD.org> In-Reply-To: <20200725.124911.256350108759170094.nyan@FreeBSD.org> From: Eric Joyner Date: Thu, 30 Jul 2020 11:31:43 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r362063 - head/sys/dev/e1000 To: Yoshihiro Takahashi Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4BHfC22hWJz3Vd4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of ricera10@gmail.com designates 209.85.167.50 as permitted sender) smtp.mailfrom=ricera10@gmail.com X-Spamd-Result: default: False [-2.10 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.001]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.38)[-0.382]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.50:from]; NEURAL_HAM_MEDIUM(-0.72)[-0.718]; FORGED_SENDER(0.30)[erj@freebsd.org,ricera10@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.50:from]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FROM_NEQ_ENVFROM(0.00)[erj@freebsd.org,ricera10@gmail.com] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 18:31:59 -0000 Done in r363711. I apologize for it taking so long. On Fri, Jul 24, 2020 at 8:49 PM Yoshihiro Takahashi wrote: > Please merge this change to stable/12 branch until a proper fix is > done. > > --- > Yoshihiro Takahashi > > In article <202006111559.05BFxnSa070435@repo.freebsd.org> > Eric Joyner writes: > > > Author: erj > > Date: Thu Jun 11 15:59:49 2020 > > New Revision: 362063 > > URL: https://svnweb.freebsd.org/changeset/base/362063 > > > > Log: > > em(4): Always reinit interface when adding/removing VLAN > > > > This partially reverts r361053 since there have been reports > > by users that this breaks some functionality for em(4) > > devices; it seems at first glance that some sort of interface > > restart is required for those cards. > > > > This isn't a proper fix; this unbreaks those users until a proper > > fix is found for their issues. > > > > PR: 240818 > > Reported by: Marek Zarychta > > MFC after: 3 days > > > > Modified: > > head/sys/dev/e1000/if_em.c > > > > Modified: head/sys/dev/e1000/if_em.c > > > ============================================================================== > > --- head/sys/dev/e1000/if_em.c Thu Jun 11 15:17:13 2020 > (r362062) > > +++ head/sys/dev/e1000/if_em.c Thu Jun 11 15:59:49 2020 > (r362063) > > @@ -4059,7 +4059,6 @@ em_if_needs_restart(if_ctx_t ctx __unused, enum > iflib_ > > { > > switch (event) { > > case IFLIB_RESTART_VLAN_CONFIG: > > - return (false); > > default: > > return (true); > > } > From owner-svn-src-head@freebsd.org Thu Jul 30 22:13:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E80E736850A; Thu, 30 Jul 2020 22:13:15 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHl6M5kYpz41MR; Thu, 30 Jul 2020 22:13:15 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A80A217E94; Thu, 30 Jul 2020 22:13:15 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06UMDFht047265; Thu, 30 Jul 2020 22:13:15 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06UMDF6g047264; Thu, 30 Jul 2020 22:13:15 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007302213.06UMDF6g047264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Jul 2020 22:13:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363713 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 363713 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 22:13:16 -0000 Author: mjg Date: Thu Jul 30 22:13:15 2020 New Revision: 363713 URL: https://svnweb.freebsd.org/changeset/base/363713 Log: fd: predict in fdrop Modified: head/sys/sys/file.h Modified: head/sys/sys/file.h ============================================================================== --- head/sys/sys/file.h Thu Jul 30 19:11:01 2020 (r363712) +++ head/sys/sys/file.h Thu Jul 30 22:13:15 2020 (r363713) @@ -279,21 +279,22 @@ int fgetvp_read(struct thread *td, int fd, cap_rights_ int fgetvp_write(struct thread *td, int fd, cap_rights_t *rightsp, struct vnode **vpp); -static __inline int -_fnoop(void) -{ - - return (0); -} - static __inline __result_use_check bool fhold(struct file *fp) { return (refcount_acquire_checked(&fp->f_count)); } -#define fdrop(fp, td) \ - (refcount_release(&(fp)->f_count) ? _fdrop((fp), (td)) : _fnoop()) +#define fdrop(fp, td) ({ \ + struct file *_fp; \ + int _error; \ + \ + _error = 0; \ + _fp = (fp); \ + if (__predict_false(refcount_release(&_fp->f_count))) \ + _error = _fdrop(_fp, td); \ + _error; \ +}) static __inline fo_rdwr_t fo_read; static __inline fo_rdwr_t fo_write; From owner-svn-src-head@freebsd.org Thu Jul 30 22:13:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9B27C3684B3; Thu, 30 Jul 2020 22:13:32 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f68.google.com (mail-ot1-f68.google.com [209.85.210.68]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHl6g64T1z41TH; Thu, 30 Jul 2020 22:13:31 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f68.google.com with SMTP id q9so5619483oth.5; Thu, 30 Jul 2020 15:13:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=KNd8UhbNyp+BadnkEJlAptn2TkUaasQPbQVL74ntPhQ=; b=es110Lw6VjpMuaUZ1/3c2Si2N53gIG8uE3Gyb+veaczIkQL/U+os5WJ1G8ib3lZH7E n0EzPeCXkwHbsT6DegLMvE4yFpYF5w5ue27v9roBqg1pOSRH0oaOstyByi+VUwGYQQPG lsq/HZzSfWGod6cnBuwaDqLhsamIyMxfnhVPXYKNQiI4bGbEK5Zr87Ge2dfNZ419zzmo gLLQU8tKd7KnEhBkdbI4X/vxvqcVdKYJojqwKrq7R+QrNmbUx4YgPYdW3I7xltHDXHqp Y/mrZ5Vuh0lZnJ4WtaqZ4CWZThyJnvCqDOIhqQDd69NefGI3Ezi8Dvf9ywVbVQMhcWP0 S3ag== X-Gm-Message-State: AOAM531aO+4WsxTymHawF95mr1ALFpiaH7cvTkCnaqLMhUMk5/jVm9HB gFmL76vRl40YVZERHcUarJnNW2t6 X-Google-Smtp-Source: ABdhPJz5lLszaVrPt0+Ykj+C90x/jgMHfFhoaKwg8dBheWdFZUF8sApe3wuuudel6Oc4nTbfBf7vgg== X-Received: by 2002:a9d:355:: with SMTP id 79mr567526otv.330.1596147210499; Thu, 30 Jul 2020 15:13:30 -0700 (PDT) Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com. [209.85.210.51]) by smtp.gmail.com with ESMTPSA id m13sm1041349otf.43.2020.07.30.15.13.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Jul 2020 15:13:30 -0700 (PDT) Received: by mail-ot1-f51.google.com with SMTP id a65so12113535otc.8; Thu, 30 Jul 2020 15:13:30 -0700 (PDT) X-Received: by 2002:a9d:3b61:: with SMTP id z88mr641237otb.135.1596147209962; Thu, 30 Jul 2020 15:13:29 -0700 (PDT) MIME-Version: 1.0 References: <202007241734.06OHY53J080448@repo.freebsd.org> <20200728184152.GH2551@kib.kiev.ua> In-Reply-To: <20200728184152.GH2551@kib.kiev.ua> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Thu, 30 Jul 2020 15:13:19 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r363482 - in head/sys: kern sys To: Konstantin Belousov Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BHl6g64T1z41TH X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.210.68 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-1.55 / 15.00]; HAS_REPLYTO(0.00)[cem@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[209.85.210.68:from]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.13)[-0.131]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; R_DKIM_NA(0.00)[]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.47)[-0.468]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-0.95)[-0.955]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.210.68:from]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 22:13:32 -0000 Hi Konstantin, On Tue, Jul 28, 2020 at 11:42 AM Konstantin Belousov wrote: > > On Fri, Jul 24, 2020 at 05:34:05PM +0000, Conrad Meyer wrote: > > ... > > --- head/sys/kern/vfs_bio.c Fri Jul 24 17:32:10 2020 (r363481) > > +++ head/sys/kern/vfs_bio.c Fri Jul 24 17:34:04 2020 (r363482) > > @@ -3849,7 +3849,7 @@ getblkx(struct vnode *vp, daddr_t blkno, daddr_t dblkn > > ... > > + /* Attempt lockless lookup first. */ > > + bp = gbincore_unlocked(bo, blkno); > > + if (bp == NULL) > > + goto newbuf_unlocked; > > + > > + lockflags = LK_EXCLUSIVE | LK_SLEEPFAIL | > > + ((flags & GB_LOCK_NOWAIT) ? LK_NOWAIT : 0); > > + > > + error = BUF_TIMELOCK(bp, lockflags, NULL, "getblku", slpflag, > > + slptimeo); > I realized that this is not safe. There is an ordering between buffer > types that defines which order buffer locks should obey. For instance, > on UFS the critical order is inode buffer -> snaplk -> cg buffer, or > data block -> indirect data block. Since buffer identity can change under > us, we might end up waiting for a lock of type that is incompatible with > the currently owned lock. > > I think the easiest fix is to use LK_NOWAIT always, after all it is lockless > path. ERESTART/EINTR checks below than can be removed. Thanks, that makes sense to me. Please see https://reviews.freebsd.org/D25898 . (For the UFS scenario, I think this requires an on-disk sector changing identity from one kind to another? I believe lblknos are mostly statically typed in UFS, but it could happen with data blocks and indirect blocks? Of course, UFS is not the only filesystem.) Best regards, Conrad From owner-svn-src-head@freebsd.org Thu Jul 30 22:14:05 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55E803684B8; Thu, 30 Jul 2020 22:14:05 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHl7K1fGYz4209; Thu, 30 Jul 2020 22:14:05 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BE8217E95; Thu, 30 Jul 2020 22:14:05 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06UME4BG047349; Thu, 30 Jul 2020 22:14:04 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06UME4Iw047348; Thu, 30 Jul 2020 22:14:04 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007302214.06UME4Iw047348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Jul 2020 22:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363714 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363714 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 22:14:05 -0000 Author: mjg Date: Thu Jul 30 22:14:04 2020 New Revision: 363714 URL: https://svnweb.freebsd.org/changeset/base/363714 Log: Further depessimize priv_check_cred_vfs_generation Modified: head/sys/kern/kern_priv.c Modified: head/sys/kern/kern_priv.c ============================================================================== --- head/sys/kern/kern_priv.c Thu Jul 30 22:13:15 2020 (r363713) +++ head/sys/kern/kern_priv.c Thu Jul 30 22:14:04 2020 (r363714) @@ -247,8 +247,8 @@ priv_check(struct thread *td, int priv) return (priv_check_cred(td->td_ucred, priv)); } -int -priv_check_cred_vfs_generation(struct ucred *cred) +static int __noinline +priv_check_cred_vfs_generation_slow(struct ucred *cred) { int error; @@ -270,4 +270,19 @@ priv_check_cred_vfs_generation(struct ucred *cred) out: return (priv_check_cred_post(cred, PRIV_VFS_GENERATION, error, true)); +} + +int +priv_check_cred_vfs_generation(struct ucred *cred) +{ + int error; + + if (__predict_false(mac_priv_check_fp_flag || + mac_priv_grant_fp_flag || SDT_PROBES_ENABLED())) + return (priv_check_cred_vfs_generation_slow(cred)); + + error = EPERM; + if (!jailed(cred) && cred->cr_uid == 0 && suser_enabled) + error = 0; + return (error); } From owner-svn-src-head@freebsd.org Thu Jul 30 22:33:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F2CF5368B44; Thu, 30 Jul 2020 22:33:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHlYM3QwCz42sw; Thu, 30 Jul 2020 22:33:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 06UMWvvj056787 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 31 Jul 2020 01:33:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 06UMWvvj056787 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 06UMWvm3056786; Fri, 31 Jul 2020 01:32:57 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 31 Jul 2020 01:32:57 +0300 From: Konstantin Belousov To: Conrad Meyer Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r363482 - in head/sys: kern sys Message-ID: <20200730223257.GL2551@kib.kiev.ua> References: <202007241734.06OHY53J080448@repo.freebsd.org> <20200728184152.GH2551@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4BHlYM3QwCz42sw X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 22:33:12 -0000 On Thu, Jul 30, 2020 at 03:13:19PM -0700, Conrad Meyer wrote: > Hi Konstantin, > > On Tue, Jul 28, 2020 at 11:42 AM Konstantin Belousov > wrote: > > > > On Fri, Jul 24, 2020 at 05:34:05PM +0000, Conrad Meyer wrote: > > > ... > > > --- head/sys/kern/vfs_bio.c Fri Jul 24 17:32:10 2020 (r363481) > > > +++ head/sys/kern/vfs_bio.c Fri Jul 24 17:34:04 2020 (r363482) > > > @@ -3849,7 +3849,7 @@ getblkx(struct vnode *vp, daddr_t blkno, daddr_t dblkn > > > ... > > > + /* Attempt lockless lookup first. */ > > > + bp = gbincore_unlocked(bo, blkno); > > > + if (bp == NULL) > > > + goto newbuf_unlocked; > > > + > > > + lockflags = LK_EXCLUSIVE | LK_SLEEPFAIL | > > > + ((flags & GB_LOCK_NOWAIT) ? LK_NOWAIT : 0); > > > + > > > + error = BUF_TIMELOCK(bp, lockflags, NULL, "getblku", slpflag, > > > + slptimeo); > > I realized that this is not safe. There is an ordering between buffer > > types that defines which order buffer locks should obey. For instance, > > on UFS the critical order is inode buffer -> snaplk -> cg buffer, or > > data block -> indirect data block. Since buffer identity can change under > > us, we might end up waiting for a lock of type that is incompatible with > > the currently owned lock. > > > > I think the easiest fix is to use LK_NOWAIT always, after all it is lockless > > path. ERESTART/EINTR checks below than can be removed. > > Thanks, that makes sense to me. Please see https://reviews.freebsd.org/D25898 . > > (For the UFS scenario, I think this requires an on-disk sector > changing identity from one kind to another? I believe lblknos are > mostly statically typed in UFS, but it could happen with data blocks > and indirect blocks? Of course, UFS is not the only filesystem.) For UFS, it is enough for buffer to change its identity due to reclaim. We do not pin buffers to device/block number for their lifetime. So buffer might be freed and reassigned to different block under us. From owner-svn-src-head@freebsd.org Thu Jul 30 22:52:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6187A368AEB; Thu, 30 Jul 2020 22:52:19 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHlzR20Lpz43SH; Thu, 30 Jul 2020 22:52:19 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2838A184F6; Thu, 30 Jul 2020 22:52:19 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06UMqJ9L069028; Thu, 30 Jul 2020 22:52:19 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06UMqJYU069027; Thu, 30 Jul 2020 22:52:19 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007302252.06UMqJYU069027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Jul 2020 22:52:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363715 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363715 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 22:52:19 -0000 Author: mjg Date: Thu Jul 30 22:52:18 2020 New Revision: 363715 URL: https://svnweb.freebsd.org/changeset/base/363715 Log: cache: drop the useless numchecks counter Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Jul 30 22:14:04 2020 (r363714) +++ head/sys/kern/vfs_cache.c Thu Jul 30 22:52:18 2020 (r363715) @@ -419,7 +419,6 @@ STATNODE_COUNTER(numcachehv, "Number of namecache entr STATNODE_COUNTER(numdrops, "Number of dropped entries due to reaching the limit"); STATNODE_COUNTER(dothits, "Number of '.' hits"); STATNODE_COUNTER(dotdothits, "Number of '..' hits"); -STATNODE_COUNTER(numchecks, "Number of checks in lookup"); STATNODE_COUNTER(nummiss, "Number of cache misses"); STATNODE_COUNTER(nummisszap, "Number of cache misses we do not want to cache"); STATNODE_COUNTER(numposzaps, @@ -1315,7 +1314,6 @@ retry: rw_wlock(blp); CK_LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { - counter_u64_add(numchecks, 1); if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) break; @@ -1460,7 +1458,6 @@ retry_hashed: } CK_LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { - counter_u64_add(numchecks, 1); if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) break; @@ -3366,7 +3363,6 @@ cache_fplookup_next(struct cache_fpl *fpl) hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); CK_LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { - counter_u64_add(numchecks, 1); if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) break; From owner-svn-src-head@freebsd.org Thu Jul 30 22:56:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C04F7368FAD; Thu, 30 Jul 2020 22:56:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHm4n4g0Hz43wM; Thu, 30 Jul 2020 22:56:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 835D31852B; Thu, 30 Jul 2020 22:56:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06UMuvex071859; Thu, 30 Jul 2020 22:56:57 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06UMuvYN071858; Thu, 30 Jul 2020 22:56:57 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202007302256.06UMuvYN071858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 30 Jul 2020 22:56:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363716 - head/sys/security/mac X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/security/mac X-SVN-Commit-Revision: 363716 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 22:56:57 -0000 Author: mjg Date: Thu Jul 30 22:56:57 2020 New Revision: 363716 URL: https://svnweb.freebsd.org/changeset/base/363716 Log: Fix tinderbox build after r363714 Modified: head/sys/security/mac/mac_framework.h Modified: head/sys/security/mac/mac_framework.h ============================================================================== --- head/sys/security/mac/mac_framework.h Thu Jul 30 22:52:18 2020 (r363715) +++ head/sys/security/mac/mac_framework.h Thu Jul 30 22:56:57 2020 (r363716) @@ -259,7 +259,11 @@ void mac_posixshm_destroy(struct shmfd *); void mac_posixshm_init(struct shmfd *); int mac_priv_check_impl(struct ucred *cred, int priv); +#ifdef MAC extern bool mac_priv_check_fp_flag; +#else +#define mac_priv_check_fp_flag 0 +#endif static inline int mac_priv_check(struct ucred *cred, int priv) { @@ -270,7 +274,11 @@ mac_priv_check(struct ucred *cred, int priv) } int mac_priv_grant_impl(struct ucred *cred, int priv); +#ifdef MAC extern bool mac_priv_grant_fp_flag; +#else +#define mac_priv_grant_fp_flag 0 +#endif static inline int mac_priv_grant(struct ucred *cred, int priv) { From owner-svn-src-head@freebsd.org Thu Jul 30 23:49:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 40D1C36A981; Thu, 30 Jul 2020 23:49:50 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHnFp0xbXz46SH; Thu, 30 Jul 2020 23:49:50 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03D1219026; Thu, 30 Jul 2020 23:49:50 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06UNnn93003027; Thu, 30 Jul 2020 23:49:49 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06UNnnbM003026; Thu, 30 Jul 2020 23:49:49 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <202007302349.06UNnnbM003026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Thu, 30 Jul 2020 23:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363719 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 363719 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 23:49:50 -0000 Author: grehan Date: Thu Jul 30 23:49:49 2020 New Revision: 363719 URL: https://svnweb.freebsd.org/changeset/base/363719 Log: Definition for the 'removable media flag' from word 0 in the Identify page. This will be used to remove a magic number in the bhyve AHCI emulation. Reported by: rpokala Reviewed by: imp, rpokala Approved by: imp, rpokala MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D25893 Modified: head/sys/sys/ata.h Modified: head/sys/sys/ata.h ============================================================================== --- head/sys/sys/ata.h Thu Jul 30 23:20:09 2020 (r363718) +++ head/sys/sys/ata.h Thu Jul 30 23:49:49 2020 (r363719) @@ -46,6 +46,7 @@ struct ata_params { #define ATA_ATAPI_TYPE_TAPE 0x0100 /* streaming tape */ #define ATA_ATAPI_TYPE_CDROM 0x0500 /* CD-ROM device */ #define ATA_ATAPI_TYPE_OPTICAL 0x0700 /* optical disk */ +#define ATA_ATAPI_REMOVABLE 0x0080 #define ATA_DRQ_MASK 0x0060 #define ATA_DRQ_SLOW 0x0000 /* cpu 3 ms delay */ #define ATA_DRQ_INTR 0x0020 /* interrupt 10 ms delay */ From owner-svn-src-head@freebsd.org Thu Jul 30 23:54:26 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62EB036A55C; Thu, 30 Jul 2020 23:54:26 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHnM61LTJz46qV; Thu, 30 Jul 2020 23:54:26 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ECB9D18F23; Thu, 30 Jul 2020 23:54:25 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06UNsPZO008770; Thu, 30 Jul 2020 23:54:25 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06UNsPC0008769; Thu, 30 Jul 2020 23:54:25 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202007302354.06UNsPC0008769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 30 Jul 2020 23:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363720 - head/sys/contrib/pcg-c X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/contrib/pcg-c X-SVN-Commit-Revision: 363720 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2020 23:54:26 -0000 Author: cem Date: Thu Jul 30 23:54:25 2020 New Revision: 363720 URL: https://svnweb.freebsd.org/changeset/base/363720 Log: Import PCG-C into sys/contrib The intended (future) use is to provide fast pseudo-random numbers in non- cryptographic applications. Added: head/sys/contrib/pcg-c/ - copied from r363718, vendor/pcg-c/20190718-83252d9/ From owner-svn-src-head@freebsd.org Fri Jul 31 00:07:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 32A9736ADF7; Fri, 31 Jul 2020 00:07:02 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHndf0Zbpz47Mb; Fri, 31 Jul 2020 00:07:02 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E831D18D5B; Fri, 31 Jul 2020 00:07:01 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06V071BN015083; Fri, 31 Jul 2020 00:07:01 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06V071Kv015082; Fri, 31 Jul 2020 00:07:01 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202007310007.06V071Kv015082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 31 Jul 2020 00:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363721 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363721 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2020 00:07:02 -0000 Author: cem Date: Fri Jul 31 00:07:01 2020 New Revision: 363721 URL: https://svnweb.freebsd.org/changeset/base/363721 Log: getblk: Avoid sleeping on wrong buf in lockless path If the buffer identity changed during lookup, sleeping could introduce a lock order reversal. Since we do not know if the identity changed until we get the lock, we must try-lock (LK_NOWAIT) only. EINTR and ERESTART error handling becomes irrelevant, as we no longer sleep. Reported by: kib Reviewed by: kib X-MFC-With: r363482 Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D25898 Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Thu Jul 30 23:54:25 2020 (r363720) +++ head/sys/kern/vfs_bio.c Fri Jul 31 00:07:01 2020 (r363721) @@ -3844,7 +3844,7 @@ getblkx(struct vnode *vp, daddr_t blkno, daddr_t dblkn struct buf *bp; struct bufobj *bo; daddr_t d_blkno; - int bsize, error, maxsize, vmio, lockflags; + int bsize, error, maxsize, vmio; off_t offset; CTR3(KTR_BUF, "getblk(%p, %ld, %d)", vp, (long)blkno, size); @@ -3865,14 +3865,9 @@ getblkx(struct vnode *vp, daddr_t blkno, daddr_t dblkn if (bp == NULL) goto newbuf_unlocked; - lockflags = LK_EXCLUSIVE | LK_SLEEPFAIL | - ((flags & GB_LOCK_NOWAIT) ? LK_NOWAIT : 0); - - error = BUF_TIMELOCK(bp, lockflags, NULL, "getblku", slpflag, - slptimeo); - if (error == EINTR || error == ERESTART) - return (error); - else if (error != 0) + error = BUF_TIMELOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL, "getblku", 0, + 0); + if (error != 0) goto loop; /* Verify buf identify has not changed since lookup. */ @@ -3886,6 +3881,8 @@ loop: BO_RLOCK(bo); bp = gbincore(bo, blkno); if (bp != NULL) { + int lockflags; + /* * Buffer is in-core. If the buffer is not busy nor managed, * it must be on a queue. From owner-svn-src-head@freebsd.org Fri Jul 31 00:13:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F093F36B22A; Fri, 31 Jul 2020 00:13:40 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHnnJ6BTyz48Cj; Fri, 31 Jul 2020 00:13:40 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7ED9193B0; Fri, 31 Jul 2020 00:13:40 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06V0Deas021409; Fri, 31 Jul 2020 00:13:40 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06V0Dei9021408; Fri, 31 Jul 2020 00:13:40 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202007310013.06V0Dei9021408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 31 Jul 2020 00:13:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363722 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363722 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2020 00:13:41 -0000 Author: cem Date: Fri Jul 31 00:13:40 2020 New Revision: 363722 URL: https://svnweb.freebsd.org/changeset/base/363722 Log: getblk: Remove a non-sensical LK_NOWAIT | LK_SLEEPFAIL No functional change. LK_SLEEPFAIL implies a behavior that is only possible if the lock operation can sleep. LK_NOWAIT prevents the lock operation from sleeping. Discussed with: kib Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri Jul 31 00:07:01 2020 (r363721) +++ head/sys/kern/vfs_bio.c Fri Jul 31 00:13:40 2020 (r363722) @@ -3887,10 +3887,8 @@ loop: * Buffer is in-core. If the buffer is not busy nor managed, * it must be on a queue. */ - lockflags = LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK; - - if ((flags & GB_LOCK_NOWAIT) != 0) - lockflags |= LK_NOWAIT; + lockflags = LK_EXCLUSIVE | LK_INTERLOCK | + ((flags & GB_LOCK_NOWAIT) ? LK_NOWAIT : LK_SLEEPFAIL); error = BUF_TIMELOCK(bp, lockflags, BO_LOCKPTR(bo), "getblk", slpflag, slptimeo); From owner-svn-src-head@freebsd.org Fri Jul 31 01:47:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7587236D62F; Fri, 31 Jul 2020 01:47:33 +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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHqsd2J19z4DKL; Fri, 31 Jul 2020 01:47:33 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 3305C24123; Fri, 31 Jul 2020 01:47:33 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f173.google.com with SMTP id s23so21894785qtq.12; Thu, 30 Jul 2020 18:47:33 -0700 (PDT) X-Gm-Message-State: AOAM533HEIu8HfT/d7gDESlxkkdOM/iKnF5zor6Nto5q/7zh+sTl69Fh IosrKKo2Wy+gKb3ysuFrSkfcHcmWCoIab2ZUJvo= X-Google-Smtp-Source: ABdhPJymOVnrSbsIG7fpDMUJ3r9UkEhdW2kEMpNXRDJks4H70Cj+v7uH3a+JWzJp+RWF5fZUa79hbCsmSW8OyqHWWhw= X-Received: by 2002:ac8:70cd:: with SMTP id g13mr1568283qtp.53.1596160052216; Thu, 30 Jul 2020 18:47:32 -0700 (PDT) MIME-Version: 1.0 References: <202007292321.06TNLuoq087451@repo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Thu, 30 Jul 2020 20:47:21 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex To: Li-Wen Hsu Cc: src-committers , svn-src-all , svn-src-head , Ngie Cooper , Alan Somers Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2020 01:47:33 -0000 On Wed, Jul 29, 2020 at 10:53 PM Li-Wen Hsu wrote: > > On Thu, Jul 30, 2020 at 7:22 AM Kyle Evans wrote: > > > > Author: kevans > > Date: Wed Jul 29 23:21:56 2020 > > New Revision: 363679 > > URL: https://svnweb.freebsd.org/changeset/base/363679 > > > > Log: > > regex(3): Interpret many escaped ordinary characters as EESCAPE > > > > In IEEE 1003.1-2008 [1] and earlier revisions, BRE/ERE grammar allows for > > any character to be escaped, but "ORD_CHAR preceded by an unescaped > > character [gives undefined results]". > > > > Historically, we've interpreted an escaped ordinary character as the > > ordinary character itself. This becomes problematic when some extensions > > give special meanings to an otherwise ordinary character > > (e.g. GNU's \b, \s, \w), meaning we may have two different valid > > interpretations of the same sequence. > > > > To make this easier to deal with and given that the standard calls this > > undefined, we should throw an error (EESCAPE) if we run into this scenario > > to ease transition into a state where some escaped ordinaries are blessed > > with a special meaning -- it will either error out or have extended > > behavior, rather than have two entirely different versions of undefined > > behavior that leave the consumer of regex(3) guessing as to what behavior > > will be used or leaving them with false impressions. > > > > This change bumps the symbol version of regcomp to FBSD_1.6 and provides the > > old escape semantics for legacy applications, just in case one has an older > > application that would immediately turn into a pumpkin because of an > > extraneous escape that's embehttps://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/lib.googletest.gtest_main/googletest-port-test/main/dded or otherwise critical to its operation. > > > > This is the final piece needed before enhancing libregex with GNU extensions > > and flipping the switch on bsdgrep. > > > > [1] http://pubs.opengroup.org/onlinepubs/9699919799.2016edition/ > > > > PR: 229925 (exp-run, courtesy of antoine) > > Differential Revision: https://reviews.freebsd.org/D10510 > > > > Modified: > > head/contrib/netbsd-tests/lib/libc/regex/data/meta.in > > head/contrib/netbsd-tests/lib/libc/regex/data/subexp.in > > head/lib/libc/regex/Symbol.map > > head/lib/libc/regex/regcomp.c > > I think there are 3 test cases need to be modified after this change: > > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/lib.googletest.gtest_main/googletest-port-test/main/ > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/usr.bin.diff/diff_test/side_by_side/ > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/usr.bin.sed/sed2_test/hex_subst/ > CC'ing asomers@ and ngie@, because ISTR they have some googletest stock. Testing my libregex GNU extensions revealed that I'm really not ready to commit that just yet. We have two options here for googletest: 1. Disable it and create a PR to be fixed when my changes are done, hopefully by the end of the week, or 2. Fix the expressions in contrib/googletest/googletest/test/googletest-port-test.cc to be POSIX compliant and upstream that. #2 is generally a replacement of \w -> [[:alnum:]] and \W -> [^[:alnum:]] and maybe \s -> [[:space:]]. Thoughts? Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Fri Jul 31 01:50:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F227536D4EE; Fri, 31 Jul 2020 01:50:32 +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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHqx46BlTz4D8x; Fri, 31 Jul 2020 01:50:32 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id B2AE824124; Fri, 31 Jul 2020 01:50:32 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f173.google.com with SMTP id 11so27562227qkn.2; Thu, 30 Jul 2020 18:50:32 -0700 (PDT) X-Gm-Message-State: AOAM5329BUnIJgVCqGfmmgU4PfbhqLCkA7QXdD0tYyDhi6kwbMWZDfVW P+InPV2BW/2yVY72fumK+r3qA7td/cjNW9hmUFs= X-Google-Smtp-Source: ABdhPJwvRPREy6ipwuw3BJYmjyqU+juNxnJVPl4ET06kc0WrFUKQBJ3t73SNqbiLFiKXWjroUQUQz87JTohVvlK4Qpc= X-Received: by 2002:a05:620a:628:: with SMTP id 8mr2026932qkv.103.1596160232254; Thu, 30 Jul 2020 18:50:32 -0700 (PDT) MIME-Version: 1.0 References: <202007292321.06TNLuoq087451@repo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Thu, 30 Jul 2020 20:50:21 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex To: Kyle Evans Cc: Li-Wen Hsu , src-committers , svn-src-all , svn-src-head , Ngie Cooper , Alan Somers Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2020 01:50:33 -0000 On Thu, Jul 30, 2020 at 8:47 PM Kyle Evans wrote: > > On Wed, Jul 29, 2020 at 10:53 PM Li-Wen Hsu wrote: > > > > On Thu, Jul 30, 2020 at 7:22 AM Kyle Evans wrote: > > > > > > Author: kevans > > > Date: Wed Jul 29 23:21:56 2020 > > > New Revision: 363679 > > > URL: https://svnweb.freebsd.org/changeset/base/363679 > > > > > > Log: > > > regex(3): Interpret many escaped ordinary characters as EESCAPE > > > > > > In IEEE 1003.1-2008 [1] and earlier revisions, BRE/ERE grammar allows for > > > any character to be escaped, but "ORD_CHAR preceded by an unescaped > > > character [gives undefined results]". > > > > > > Historically, we've interpreted an escaped ordinary character as the > > > ordinary character itself. This becomes problematic when some extensions > > > give special meanings to an otherwise ordinary character > > > (e.g. GNU's \b, \s, \w), meaning we may have two different valid > > > interpretations of the same sequence. > > > > > > To make this easier to deal with and given that the standard calls this > > > undefined, we should throw an error (EESCAPE) if we run into this scenario > > > to ease transition into a state where some escaped ordinaries are blessed > > > with a special meaning -- it will either error out or have extended > > > behavior, rather than have two entirely different versions of undefined > > > behavior that leave the consumer of regex(3) guessing as to what behavior > > > will be used or leaving them with false impressions. > > > > > > This change bumps the symbol version of regcomp to FBSD_1.6 and provides the > > > old escape semantics for legacy applications, just in case one has an older > > > application that would immediately turn into a pumpkin because of an > > > extraneous escape that's embehttps://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/lib.googletest.gtest_main/googletest-port-test/main/dded or otherwise critical to its operation. > > > > > > This is the final piece needed before enhancing libregex with GNU extensions > > > and flipping the switch on bsdgrep. > > > > > > [1] http://pubs.opengroup.org/onlinepubs/9699919799.2016edition/ > > > > > > PR: 229925 (exp-run, courtesy of antoine) > > > Differential Revision: https://reviews.freebsd.org/D10510 > > > > > > Modified: > > > head/contrib/netbsd-tests/lib/libc/regex/data/meta.in > > > head/contrib/netbsd-tests/lib/libc/regex/data/subexp.in > > > head/lib/libc/regex/Symbol.map > > > head/lib/libc/regex/regcomp.c > > > > I think there are 3 test cases need to be modified after this change: > > > > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/lib.googletest.gtest_main/googletest-port-test/main/ > > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/usr.bin.diff/diff_test/side_by_side/ > > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/usr.bin.sed/sed2_test/hex_subst/ > > > > CC'ing asomers@ and ngie@, because ISTR they have some googletest stock. > > Testing my libregex GNU extensions revealed that I'm really not ready > to commit that just yet. We have two options here for googletest: > > 1. Disable it and create a PR to be fixed when my changes are done, > hopefully by the end of the week, or > 2. Fix the expressions in > contrib/googletest/googletest/test/googletest-port-test.cc to be POSIX > compliant and upstream that. > > #2 is generally a replacement of \w -> [[:alnum:]] and \W -> > [^[:alnum:]] and maybe \s -> [[:space:]]. > Sorry, to be more precise: disable it meaning expect failure of that specific test or something similar. From owner-svn-src-head@freebsd.org Fri Jul 31 02:21:20 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2EBC936DD9A; Fri, 31 Jul 2020 02:21:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHrcc0RGxz4FHt; Fri, 31 Jul 2020 02:21:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4F071A9CA; Fri, 31 Jul 2020 02:21:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06V2LJDR097558; Fri, 31 Jul 2020 02:21:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06V2LJbj097557; Fri, 31 Jul 2020 02:21:19 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202007310221.06V2LJbj097557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 31 Jul 2020 02:21:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363723 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 363723 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2020 02:21:20 -0000 Author: kevans Date: Fri Jul 31 02:21:19 2020 New Revision: 363723 URL: https://svnweb.freebsd.org/changeset/base/363723 Log: UPDATING: Add a note about running installworld twice Some folks seem to be hitting issues with build orchestration; presumably some of our .WAIT-removal optimizations are going awry, and they're ending up with applications linked against new libc being installed before the new libc. Letting installworld complete the first time should ensure that the new libc is installed by the end of it, then the second installworld will ensure consistency as everything should succeed. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Jul 31 00:13:40 2020 (r363722) +++ head/UPDATING Fri Jul 31 02:21:19 2020 (r363723) @@ -33,6 +33,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: ports, but other non-ports software may need extra escapes removed to continue to function. + Because of this change, installworld may encounter the following error + from rtld: Undefined symbol "regcomp@FBSD_1.6" -- It is imperative that + you do not halt installworld. Instead, let it run to completion (whether + successful or not) and run installworld once more. + 20200627: A new implementation of bc and dc has been imorted in r362681. This implementation corrects non-conformant behavior of the previous bc From owner-svn-src-head@freebsd.org Fri Jul 31 03:54:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D37A36FAA5; Fri, 31 Jul 2020 03:54:00 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BHtgX09k1z4KMr; Fri, 31 Jul 2020 03:54:00 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id E249529CE; Fri, 31 Jul 2020 03:53:59 +0000 (UTC) Date: Fri, 31 Jul 2020 03:53:59 +0000 From: Alexey Dokuchaev To: Stefan E??er Cc: Baptiste Daroussin , Jessica Clarke , Stefan E??er , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r363091 - in head/contrib/bc: . include manuals src tests tests/bc Message-ID: <20200731035359.GA51370@FreeBSD.org> References: <202007110733.06B7XJrp033777@repo.freebsd.org> <20200730162009.rnjs6l5rjqsoiqpq@ivaldir.net> <20200730163154.a4d7672xsugkhmxq@ivaldir.net> <7f89d655-eeaf-beca-5531-77da2b790c01@t-online.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7f89d655-eeaf-beca-5531-77da2b790c01@t-online.de> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2020 03:54:00 -0000 On Thu, Jul 30, 2020 at 06:51:58PM +0200, Stefan E??er wrote: > ... > My guess is that he'll add a compile time switch to his version > that will be added to our usr.bin Makefile and will suppress the > start-up message in our base system version. (I'll keep the port > version as is unless there is a strong preference to suppress it > also in the port). Yes, this is the correct approach, thank you Stefan. ./danfe From owner-svn-src-head@freebsd.org Fri Jul 31 10:03:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56642375196; Fri, 31 Jul 2020 10:03:33 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJ2sx1YHpz4ZrC; Fri, 31 Jul 2020 10:03:33 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 187DA1FCC2; Fri, 31 Jul 2020 10:03:33 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06VA3WMl083555; Fri, 31 Jul 2020 10:03:32 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06VA3W15083554; Fri, 31 Jul 2020 10:03:32 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <202007311003.06VA3W15083554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Fri, 31 Jul 2020 10:03:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363725 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 363725 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2020 10:03:33 -0000 Author: rrs Date: Fri Jul 31 10:03:32 2020 New Revision: 363725 URL: https://svnweb.freebsd.org/changeset/base/363725 Log: The recent changes to move the ref count increment back from the end of the function created an issue. If one of the routines returns NULL during setup we have inp's with extra references (which is why the increment was at the end). Also the stack switch return code was being ignored and actually has meaning if the stack cannot take over it should return NULL. Fix both of these situation by being sure to test the return code and of course in any case of return NULL (there are 3) make sure we properly reduce the ref count. Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D25903 Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Fri Jul 31 07:37:08 2020 (r363724) +++ head/sys/netinet/tcp_subr.c Fri Jul 31 10:03:32 2020 (r363725) @@ -1713,6 +1713,7 @@ tcp_newtcpcb(struct inpcb *inp) if (CC_ALGO(tp)->cb_init(tp->ccv) > 0) { if (tp->t_fb->tfb_tcp_fb_fini) (*tp->t_fb->tfb_tcp_fb_fini)(tp, 1); + in_pcbrele_wlocked(inp); refcount_release(&tp->t_fb->tfb_refcnt); uma_zfree(V_tcpcb_zone, tm); return (NULL); @@ -1723,6 +1724,7 @@ tcp_newtcpcb(struct inpcb *inp) if (khelp_init_osd(HELPER_CLASS_TCP, tp->osd)) { if (tp->t_fb->tfb_tcp_fb_fini) (*tp->t_fb->tfb_tcp_fb_fini)(tp, 1); + in_pcbrele_wlocked(inp); refcount_release(&tp->t_fb->tfb_refcnt); uma_zfree(V_tcpcb_zone, tm); return (NULL); @@ -1783,7 +1785,12 @@ tcp_newtcpcb(struct inpcb *inp) tcp_log_tcpcbinit(tp); #endif if (tp->t_fb->tfb_tcp_fb_init) { - (*tp->t_fb->tfb_tcp_fb_init)(tp); + if ((*tp->t_fb->tfb_tcp_fb_init)(tp)) { + refcount_release(&tp->t_fb->tfb_refcnt); + in_pcbrele_wlocked(inp); + uma_zfree(V_tcpcb_zone, tm); + return (NULL); + } } #ifdef STATS if (V_tcp_perconn_stats_enable == 1) From owner-svn-src-head@freebsd.org Fri Jul 31 11:28:10 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0809E376EF8; Fri, 31 Jul 2020 11:28:10 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJ4lY6W7Rz4ffh; Fri, 31 Jul 2020 11:28:09 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3CAF20EF6; Fri, 31 Jul 2020 11:28:09 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06VBS9ZB033103; Fri, 31 Jul 2020 11:28:09 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06VBS9FA033102; Fri, 31 Jul 2020 11:28:09 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202007311128.06VBS9FA033102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Fri, 31 Jul 2020 11:28:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363730 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 363730 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2020 11:28:10 -0000 Author: arichardson Date: Fri Jul 31 11:28:09 2020 New Revision: 363730 URL: https://svnweb.freebsd.org/changeset/base/363730 Log: Include virtio support in std.MALTA The MALTA kernel config is generally used for QEMU and having support for VirtIO there by default is quite useful. Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D25217 Modified: head/sys/mips/conf/std.MALTA Modified: head/sys/mips/conf/std.MALTA ============================================================================== --- head/sys/mips/conf/std.MALTA Fri Jul 31 11:14:11 2020 (r363729) +++ head/sys/mips/conf/std.MALTA Fri Jul 31 11:28:09 2020 (r363730) @@ -55,3 +55,10 @@ device miibus device bpf device md device uart + +# VirtIO support +device virtio # Generic VirtIO bus (required) +device virtio_pci # VirtIO PCI Interface +device vtnet # VirtIO Ethernet device +device virtio_blk # VirtIO Block device +device virtio_random # VirtIO Entropy device From owner-svn-src-head@freebsd.org Fri Jul 31 12:10:29 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF8233789D3; Fri, 31 Jul 2020 12:10:29 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJ5hP4Bb9z4hmM; Fri, 31 Jul 2020 12:10:29 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73C842136B; Fri, 31 Jul 2020 12:10:29 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06VCATwH057872; Fri, 31 Jul 2020 12:10:29 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06VCATN9057871; Fri, 31 Jul 2020 12:10:29 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <202007311210.06VCATN9057871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Fri, 31 Jul 2020 12:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363733 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 363733 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2020 12:10:29 -0000 Author: grehan Date: Fri Jul 31 12:10:28 2020 New Revision: 363733 URL: https://svnweb.freebsd.org/changeset/base/363733 Log: Replace magic numbers in Identify page register 0 with ATA definitions. No functional change. Verified with objdump output before/after. Requested by: rpokala Reviewed by: rpokala MFC after: 3 weeks Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Fri Jul 31 12:09:59 2020 (r363732) +++ head/usr.sbin/bhyve/pci_ahci.c Fri Jul 31 12:10:28 2020 (r363733) @@ -999,7 +999,8 @@ ata_identify_init(struct ahci_port* p, int atapi) struct ata_params* ata_ident = &p->ata_ident; if (atapi) { - ata_ident->config = (2 << 14 | 5 << 8 | 1 << 7 | 2 << 5); + ata_ident->config = ATA_PROTO_ATAPI | ATA_ATAPI_TYPE_CDROM | + ATA_ATAPI_REMOVABLE | ATA_DRQ_FAST; ata_ident->capabilities1 = ATA_SUPPORT_LBA | ATA_SUPPORT_DMA; ata_ident->capabilities2 = (1 << 14 | 1); From owner-svn-src-head@freebsd.org Fri Jul 31 12:40:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 204F33793F2; Fri, 31 Jul 2020 12:40:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJ6M403c8z4klW; Fri, 31 Jul 2020 12:40:32 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4D0C218C7; Fri, 31 Jul 2020 12:40:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06VCeVGT076486; Fri, 31 Jul 2020 12:40:31 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06VCeVKj076485; Fri, 31 Jul 2020 12:40:31 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202007311240.06VCeVKj076485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 31 Jul 2020 12:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363734 - head/include X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/include X-SVN-Commit-Revision: 363734 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2020 12:40:32 -0000 Author: kevans Date: Fri Jul 31 12:40:31 2020 New Revision: 363734 URL: https://svnweb.freebsd.org/changeset/base/363734 Log: : reserve a regcomp field for REG_POSIX For libc regcomp, this will be a nop. libregex will take this to mean that it needs to turn off GNU extensions, effectively switching it back to the POSIX-compliant libc implementation at runtime. Modified: head/include/regex.h Modified: head/include/regex.h ============================================================================== --- head/include/regex.h Fri Jul 31 12:10:28 2020 (r363733) +++ head/include/regex.h Fri Jul 31 12:40:31 2020 (r363734) @@ -71,6 +71,7 @@ typedef struct { #define REG_NOSPEC 0020 #define REG_PEND 0040 #define REG_DUMP 0200 +#define REG_POSIX 0400 /* only POSIX-compliant regex (libregex) */ /* regerror() flags */ #define REG_ENOSYS (-1) From owner-svn-src-head@freebsd.org Fri Jul 31 13:39:20 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A838A37A1D9; Fri, 31 Jul 2020 13:39:20 +0000 (UTC) (envelope-from lwhsu@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJ7fw403Kz4n9f; Fri, 31 Jul 2020 13:39:20 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com [209.85.219.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: lwhsu/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 66A5E29653; Fri, 31 Jul 2020 13:39:20 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: by mail-yb1-f178.google.com with SMTP id m200so12091560ybf.10; Fri, 31 Jul 2020 06:39:20 -0700 (PDT) X-Gm-Message-State: AOAM530aunMCM2y5pOMGlw15y5Hvq/y2Cr63rNsj5I+l0j3tKpjdKba/ PIK6PZEQY3PtMfZhbahxahN48dsw2SZc/+Vg7PA= X-Google-Smtp-Source: ABdhPJwvxiZLi5/BfX+tUZJsc4BmUIQ4KRCoCUvpnzHgojEXTFUA1MyK3kNSNxCoK1L2HnpZnImE7icV2l1JviQT1FM= X-Received: by 2002:a25:bfd1:: with SMTP id q17mr6396263ybm.176.1596202759639; Fri, 31 Jul 2020 06:39:19 -0700 (PDT) MIME-Version: 1.0 References: <202007292321.06TNLuoq087451@repo.freebsd.org> In-Reply-To: From: Li-Wen Hsu Date: Fri, 31 Jul 2020 21:39:08 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head , Ngie Cooper , Alan Somers Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2020 13:39:20 -0000 On Fri, Jul 31, 2020 at 9:50 AM Kyle Evans wrote: > > On Thu, Jul 30, 2020 at 8:47 PM Kyle Evans wrote: > > > > On Wed, Jul 29, 2020 at 10:53 PM Li-Wen Hsu wrote: > > > > > > On Thu, Jul 30, 2020 at 7:22 AM Kyle Evans wrote: > > > > > > > > Author: kevans > > > > Date: Wed Jul 29 23:21:56 2020 > > > > New Revision: 363679 > > > > URL: https://svnweb.freebsd.org/changeset/base/363679 > > > > > > > > Log: > > > > regex(3): Interpret many escaped ordinary characters as EESCAPE > > > > > > > > In IEEE 1003.1-2008 [1] and earlier revisions, BRE/ERE grammar allows for > > > > any character to be escaped, but "ORD_CHAR preceded by an unescaped > > > > character [gives undefined results]". > > > > > > > > Historically, we've interpreted an escaped ordinary character as the > > > > ordinary character itself. This becomes problematic when some extensions > > > > give special meanings to an otherwise ordinary character > > > > (e.g. GNU's \b, \s, \w), meaning we may have two different valid > > > > interpretations of the same sequence. > > > > > > > > To make this easier to deal with and given that the standard calls this > > > > undefined, we should throw an error (EESCAPE) if we run into this scenario > > > > to ease transition into a state where some escaped ordinaries are blessed > > > > with a special meaning -- it will either error out or have extended > > > > behavior, rather than have two entirely different versions of undefined > > > > behavior that leave the consumer of regex(3) guessing as to what behavior > > > > will be used or leaving them with false impressions. > > > > > > > > This change bumps the symbol version of regcomp to FBSD_1.6 and provides the > > > > old escape semantics for legacy applications, just in case one has an older > > > > application that would immediately turn into a pumpkin because of an > > > > extraneous escape that's embedded or otherwise critical to its operation. > > > > > > > > This is the final piece needed before enhancing libregex with GNU extensions > > > > and flipping the switch on bsdgrep. > > > > > > > > [1] http://pubs.opengroup.org/onlinepubs/9699919799.2016edition/ > > > > > > > > PR: 229925 (exp-run, courtesy of antoine) > > > > Differential Revision: https://reviews.freebsd.org/D10510 > > > > > > > > Modified: > > > > head/contrib/netbsd-tests/lib/libc/regex/data/meta.in > > > > head/contrib/netbsd-tests/lib/libc/regex/data/subexp.in > > > > head/lib/libc/regex/Symbol.map > > > > head/lib/libc/regex/regcomp.c > > > > > > I think there are 3 test cases need to be modified after this change: > > > > > > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/lib.googletest.gtest_main/googletest-port-test/main/ > > > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/usr.bin.diff/diff_test/side_by_side/ > > > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/usr.bin.sed/sed2_test/hex_subst/ > > > > > > > CC'ing asomers@ and ngie@, because ISTR they have some googletest stock. > > > > Testing my libregex GNU extensions revealed that I'm really not ready > > to commit that just yet. We have two options here for googletest: > > > > 1. Disable it and create a PR to be fixed when my changes are done, > > hopefully by the end of the week, or > > 2. Fix the expressions in > > contrib/googletest/googletest/test/googletest-port-test.cc to be POSIX > > compliant and upstream that. > > > > #2 is generally a replacement of \w -> [[:alnum:]] and \W -> > > [^[:alnum:]] and maybe \s -> [[:space:]]. > > > > Sorry, to be more precise: disable it meaning expect failure of that > specific test or something similar. I think there's no need to let a known issue generate lots of failure reports for more than 24 hours, I suggest let's go with 1) first. For 2), It's also good that both libregex and googletest can aware the difference between POSIX and GNU extensions, but I am not sure how upstream thinks about this. Still worth trying, though. Best, Li-Wen From owner-svn-src-head@freebsd.org Fri Jul 31 13:41:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75CDD37A693; Fri, 31 Jul 2020 13:41:41 +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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJ7jd2bWCz4n8f; Fri, 31 Jul 2020 13:41:41 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 3D0FC29813; Fri, 31 Jul 2020 13:41:41 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f47.google.com with SMTP id y11so11127226qvl.4; Fri, 31 Jul 2020 06:41:41 -0700 (PDT) X-Gm-Message-State: AOAM531u63mqUJrLnme24ScjhVrGXa3rusZI+2FsIyszPfLkqnEc1j3h GVLxGugy+f901TInkm2DqT1hk9wGMbROXp4NM2o= X-Google-Smtp-Source: ABdhPJzjjygKY6TabhfCfjbJkwc89wlJerQvCvdnjkXyMSopCm3kp3zL+etgd6Ad4kJ1v0qcJ21nrfUKa838DRtzvpE= X-Received: by 2002:a0c:b310:: with SMTP id s16mr3985039qve.5.1596202900817; Fri, 31 Jul 2020 06:41:40 -0700 (PDT) MIME-Version: 1.0 References: <202007292321.06TNLuoq087451@repo.freebsd.org> In-Reply-To: From: Kyle Evans Date: Fri, 31 Jul 2020 08:41:28 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r363679 - in head: contrib/netbsd-tests/lib/libc/regex/data lib/libc/regex To: Li-Wen Hsu Cc: src-committers , svn-src-all , svn-src-head , Ngie Cooper , Alan Somers Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2020 13:41:41 -0000 On Fri, Jul 31, 2020 at 8:39 AM Li-Wen Hsu wrote: > > On Fri, Jul 31, 2020 at 9:50 AM Kyle Evans wrote: > > > > On Thu, Jul 30, 2020 at 8:47 PM Kyle Evans wrote: > > > > > > On Wed, Jul 29, 2020 at 10:53 PM Li-Wen Hsu wrote: > > > > > > > > On Thu, Jul 30, 2020 at 7:22 AM Kyle Evans wrote: > > > > > > > > > > Author: kevans > > > > > Date: Wed Jul 29 23:21:56 2020 > > > > > New Revision: 363679 > > > > > URL: https://svnweb.freebsd.org/changeset/base/363679 > > > > > > > > > > Log: > > > > > regex(3): Interpret many escaped ordinary characters as EESCAPE > > > > > > > > > > In IEEE 1003.1-2008 [1] and earlier revisions, BRE/ERE grammar allows for > > > > > any character to be escaped, but "ORD_CHAR preceded by an unescaped > > > > > character [gives undefined results]". > > > > > > > > > > Historically, we've interpreted an escaped ordinary character as the > > > > > ordinary character itself. This becomes problematic when some extensions > > > > > give special meanings to an otherwise ordinary character > > > > > (e.g. GNU's \b, \s, \w), meaning we may have two different valid > > > > > interpretations of the same sequence. > > > > > > > > > > To make this easier to deal with and given that the standard calls this > > > > > undefined, we should throw an error (EESCAPE) if we run into this scenario > > > > > to ease transition into a state where some escaped ordinaries are blessed > > > > > with a special meaning -- it will either error out or have extended > > > > > behavior, rather than have two entirely different versions of undefined > > > > > behavior that leave the consumer of regex(3) guessing as to what behavior > > > > > will be used or leaving them with false impressions. > > > > > > > > > > This change bumps the symbol version of regcomp to FBSD_1.6 and provides the > > > > > old escape semantics for legacy applications, just in case one has an older > > > > > application that would immediately turn into a pumpkin because of an > > > > > extraneous escape that's embedded or otherwise critical to its operation. > > > > > > > > > > This is the final piece needed before enhancing libregex with GNU extensions > > > > > and flipping the switch on bsdgrep. > > > > > > > > > > [1] http://pubs.opengroup.org/onlinepubs/9699919799.2016edition/ > > > > > > > > > > PR: 229925 (exp-run, courtesy of antoine) > > > > > Differential Revision: https://reviews.freebsd.org/D10510 > > > > > > > > > > Modified: > > > > > head/contrib/netbsd-tests/lib/libc/regex/data/meta.in > > > > > head/contrib/netbsd-tests/lib/libc/regex/data/subexp.in > > > > > head/lib/libc/regex/Symbol.map > > > > > head/lib/libc/regex/regcomp.c > > > > > > > > I think there are 3 test cases need to be modified after this change: > > > > > > > > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/lib.googletest.gtest_main/googletest-port-test/main/ > > > > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/usr.bin.diff/diff_test/side_by_side/ > > > > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/16011/testReport/junit/usr.bin.sed/sed2_test/hex_subst/ > > > > > > > > > > CC'ing asomers@ and ngie@, because ISTR they have some googletest stock. > > > > > > Testing my libregex GNU extensions revealed that I'm really not ready > > > to commit that just yet. We have two options here for googletest: > > > > > > 1. Disable it and create a PR to be fixed when my changes are done, > > > hopefully by the end of the week, or > > > 2. Fix the expressions in > > > contrib/googletest/googletest/test/googletest-port-test.cc to be POSIX > > > compliant and upstream that. > > > > > > #2 is generally a replacement of \w -> [[:alnum:]] and \W -> > > > [^[:alnum:]] and maybe \s -> [[:space:]]. > > > > > > > Sorry, to be more precise: disable it meaning expect failure of that > > specific test or something similar. > > I think there's no need to let a known issue generate lots of failure > reports for more than 24 hours, I suggest let's go with 1) first. For > 2), It's also good that both libregex and googletest can aware the > difference between POSIX and GNU extensions, but I am not sure how > upstream thinks about this. Still worth trying, though. > Sure- if you have time and no one objects, please proceed with #1 (no time at the moment myself) and I'll get it fixed this weekend, even if I have to hold back implementation of some of the GNU extensions to nab the few googletest's tests care about. Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Fri Jul 31 14:08:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C42237A9B4; Fri, 31 Jul 2020 14:08:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJ8Jd3dYsz4pHN; Fri, 31 Jul 2020 14:08:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60C0322E8E; Fri, 31 Jul 2020 14:08:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06VE8XW0032035; Fri, 31 Jul 2020 14:08:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06VE8X7p032034; Fri, 31 Jul 2020 14:08:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007311408.06VE8X7p032034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 31 Jul 2020 14:08:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363735 - head/sys/netgraph X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/netgraph X-SVN-Commit-Revision: 363735 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2020 14:08:33 -0000 Author: markj Date: Fri Jul 31 14:08:32 2020 New Revision: 363735 URL: https://svnweb.freebsd.org/changeset/base/363735 Log: ng_iface(4): Set the current VNET before calling netisr_dispatch(). This is normally handled by a netgraph thread, but netgraph messages may be dispatched directly to a node, in which case no VNET is set before ng_iface calls into the network stack. Netgraph could probably handle this more generally, but for now just be sure to set the current VNET in ng_iface. PR: 242406 Tested by: Michael Muenz Reviewed by: Lutz Donnerhacke MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25788 Modified: head/sys/netgraph/ng_iface.c Modified: head/sys/netgraph/ng_iface.c ============================================================================== --- head/sys/netgraph/ng_iface.c Fri Jul 31 12:40:31 2020 (r363734) +++ head/sys/netgraph/ng_iface.c Fri Jul 31 14:08:32 2020 (r363735) @@ -732,9 +732,11 @@ ng_iface_rcvdata(hook_p hook, item_p item) } random_harvest_queue(m, sizeof(*m), RANDOM_NET_NG); M_SETFIB(m, ifp->if_fib); + CURVNET_SET(ifp->if_vnet); NET_EPOCH_ENTER(et); netisr_dispatch(isr, m); NET_EPOCH_EXIT(et); + CURVNET_RESTORE(); return (0); } From owner-svn-src-head@freebsd.org Fri Jul 31 14:08:55 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 49A4F37AA18; Fri, 31 Jul 2020 14:08:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJ8K315wLz4pWc; Fri, 31 Jul 2020 14:08:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09BF422E9F; Fri, 31 Jul 2020 14:08:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06VE8sB9032116; Fri, 31 Jul 2020 14:08:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06VE8sB0032113; Fri, 31 Jul 2020 14:08:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202007311408.06VE8sB0032113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 31 Jul 2020 14:08:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363736 - in head: share/man/man4 sys/netgraph X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: share/man/man4 sys/netgraph X-SVN-Commit-Revision: 363736 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2020 14:08:55 -0000 Author: markj Date: Fri Jul 31 14:08:54 2020 New Revision: 363736 URL: https://svnweb.freebsd.org/changeset/base/363736 Log: ng_iface(4): Remove unsupported protocols. Update the ng_iface documentation and hooks to reflect the fact that the node currently only supports IPv4 and v6 packets. Reviewed by: Lutz Donnerhacke MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25862 Modified: head/share/man/man4/ng_iface.4 head/sys/netgraph/ng_iface.c head/sys/netgraph/ng_iface.h Modified: head/share/man/man4/ng_iface.4 ============================================================================== --- head/share/man/man4/ng_iface.4 Fri Jul 31 14:08:32 2020 (r363735) +++ head/share/man/man4/ng_iface.4 Fri Jul 31 14:08:54 2020 (r363736) @@ -35,7 +35,7 @@ .\" $FreeBSD$ .\" $Whistle: ng_iface.8,v 1.5 1999/01/25 23:46:26 archie Exp $ .\" -.Dd February 6, 2019 +.Dd July 31, 2020 .Dt NG_IFACE 4 .Os .Sh NAME @@ -70,7 +70,7 @@ Packets transmitted via the interface flow out the cor protocol-specific hook. Similarly, packets received on a hook appear on the interface as packets received into the corresponding protocol stack. -The currently supported protocols are IP, IPv6, ATM, NATM, and NS. +The currently supported protocols are IP and IPv6. .Pp An .Nm iface @@ -87,12 +87,6 @@ This node type supports the following hooks: Transmission and reception of IP packets. .It Va inet6 Transmission and reception of IPv6 packets. -.It Va atm -Transmission and reception of ATM packets. -.It Va natm -Transmission and reception of NATM packets. -.It Va ns -Transmission and reception of NS packets. .El .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: Modified: head/sys/netgraph/ng_iface.c ============================================================================== --- head/sys/netgraph/ng_iface.c Fri Jul 31 14:08:32 2020 (r363735) +++ head/sys/netgraph/ng_iface.c Fri Jul 31 14:08:54 2020 (r363736) @@ -111,8 +111,6 @@ typedef const struct iffam *iffam_p; const static struct iffam gFamilies[] = { { AF_INET, NG_IFACE_HOOK_INET }, { AF_INET6, NG_IFACE_HOOK_INET6 }, - { AF_ATM, NG_IFACE_HOOK_ATM }, - { AF_NATM, NG_IFACE_HOOK_NATM }, }; #define NUM_FAMILIES nitems(gFamilies) Modified: head/sys/netgraph/ng_iface.h ============================================================================== --- head/sys/netgraph/ng_iface.h Fri Jul 31 14:08:32 2020 (r363735) +++ head/sys/netgraph/ng_iface.h Fri Jul 31 14:08:54 2020 (r363736) @@ -54,8 +54,6 @@ /* My hook names */ #define NG_IFACE_HOOK_INET "inet" #define NG_IFACE_HOOK_INET6 "inet6" -#define NG_IFACE_HOOK_ATM "atm" -#define NG_IFACE_HOOK_NATM "natm" /* MTU bounds */ #define NG_IFACE_MTU_MIN 72 From owner-svn-src-head@freebsd.org Fri Jul 31 14:13:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D8A637AC28; Fri, 31 Jul 2020 14:13:27 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJ8QH2Fvwz4pxp; Fri, 31 Jul 2020 14:13:27 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31F7222E3B; Fri, 31 Jul 2020 14:13:27 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06VEDQlS037992; Fri, 31 Jul 2020 14:13:26 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06VEDQcN037991; Fri, 31 Jul 2020 14:13:26 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202007311413.06VEDQcN037991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Fri, 31 Jul 2020 14:13:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363737 - head/share/man/man8 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man8 X-SVN-Commit-Revision: 363737 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2020 14:13:27 -0000 Author: 0mp (doc,ports committer) Date: Fri Jul 31 14:13:26 2020 New Revision: 363737 URL: https://svnweb.freebsd.org/changeset/base/363737 Log: Point to rc(8) for more details about the autoboot variable Reviewed by: bcr, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25904 Modified: head/share/man/man8/rc.subr.8 Modified: head/share/man/man8/rc.subr.8 ============================================================================== --- head/share/man/man8/rc.subr.8 Fri Jul 31 14:08:54 2020 (r363736) +++ head/share/man/man8/rc.subr.8 Fri Jul 31 14:13:26 2020 (r363737) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 2020 +.Dd July 31, 2020 .Dt RC.SUBR 8 .Os .Sh NAME @@ -882,7 +882,11 @@ Prevent booting to multiuser mode. If the .Va autoboot variable is set to -.Ql yes , +.Ql yes +(see +.Xr rc 8 +to learn more about +.Va autoboot ) , or .Ic checkyesno Ar always indicates a truth value, then a From owner-svn-src-head@freebsd.org Fri Jul 31 16:08:25 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B54BF37CBCE; Fri, 31 Jul 2020 16:08:25 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJByx4Pl6z4vPw; Fri, 31 Jul 2020 16:08:25 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7629524147; Fri, 31 Jul 2020 16:08:25 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06VG8P6j005959; Fri, 31 Jul 2020 16:08:25 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06VG8Prr005958; Fri, 31 Jul 2020 16:08:25 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <202007311608.06VG8Prr005958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Fri, 31 Jul 2020 16:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363738 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: stevek X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 363738 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2020 16:08:25 -0000 Author: stevek Date: Fri Jul 31 16:08:25 2020 New Revision: 363738 URL: https://svnweb.freebsd.org/changeset/base/363738 Log: Fix compilation error for install.c in loader Fix typo in interp_include() invocation (missing 'p') Remove setting tftpip, as servip is used by the tftp code in libsa. There is no separate tftpip global variable any more. Obtained from: Juniper Networks, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25897 Modified: head/stand/common/install.c Modified: head/stand/common/install.c ============================================================================== --- head/stand/common/install.c Fri Jul 31 14:13:26 2020 (r363737) +++ head/stand/common/install.c Fri Jul 31 16:08:25 2020 (r363738) @@ -286,10 +286,6 @@ install(char *pkgname) setenv("serverip", inet_ntoa(servip), 1); - if (proto == &tftp_fsops) { - tftpip.s_addr = servip.s_addr; - } - *pkgname = '/'; } else pkgname = s; @@ -340,7 +336,7 @@ install(char *pkgname) fd = open(s, O_RDONLY); if (fd != -1) { close(fd); - error = inter_include(s); + error = interp_include(s); if (error == CMD_ERROR) goto fail; } From owner-svn-src-head@freebsd.org Fri Jul 31 23:02:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4726A3A570E; Fri, 31 Jul 2020 23:02:19 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJN8W19ndz43qs; Fri, 31 Jul 2020 23:02:19 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BC698EC8; Fri, 31 Jul 2020 23:02:19 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06VN2IMN065120; Fri, 31 Jul 2020 23:02:18 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06VN2ImD065116; Fri, 31 Jul 2020 23:02:18 GMT (envelope-from br@FreeBSD.org) Message-Id: <202007312302.06VN2ImD065116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 31 Jul 2020 23:02:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363747 - in head/sys: dev/iommu x86/iommu X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: dev/iommu x86/iommu X-SVN-Commit-Revision: 363747 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2020 23:02:19 -0000 Author: br Date: Fri Jul 31 23:02:17 2020 New Revision: 363747 URL: https://svnweb.freebsd.org/changeset/base/363747 Log: Add iommu_domain_map_ops virtual table with map/unmap methods so x86 can support Intel DMAR and AMD IOMMU simultaneously. Reviewed by: kib Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D25894 Modified: head/sys/dev/iommu/iommu.h head/sys/dev/iommu/iommu_gas.c head/sys/x86/iommu/intel_ctx.c head/sys/x86/iommu/intel_dmar.h head/sys/x86/iommu/intel_idpgtbl.c Modified: head/sys/dev/iommu/iommu.h ============================================================================== --- head/sys/dev/iommu/iommu.h Fri Jul 31 22:23:32 2020 (r363746) +++ head/sys/dev/iommu/iommu.h Fri Jul 31 23:02:17 2020 (r363747) @@ -100,6 +100,13 @@ struct iommu_unit { uint32_t buswide_ctxs[(PCI_BUSMAX + 1) / NBBY / sizeof(uint32_t)]; }; +struct iommu_domain_map_ops { + int (*map)(struct iommu_domain *domain, iommu_gaddr_t base, + iommu_gaddr_t size, vm_page_t *ma, uint64_t pflags, int flags); + int (*unmap)(struct iommu_domain *domain, iommu_gaddr_t base, + iommu_gaddr_t size, int flags); +}; + /* * Locking annotations: * (u) - Protected by iommu unit lock @@ -109,6 +116,7 @@ struct iommu_unit { struct iommu_domain { struct iommu_unit *iommu; /* (c) */ + const struct iommu_domain_map_ops *ops; struct mtx lock; /* (c) */ struct task unload_task; /* (c) */ u_int entries_cnt; /* (d) */ Modified: head/sys/dev/iommu/iommu_gas.c ============================================================================== --- head/sys/dev/iommu/iommu_gas.c Fri Jul 31 22:23:32 2020 (r363746) +++ head/sys/dev/iommu/iommu_gas.c Fri Jul 31 23:02:17 2020 (r363747) @@ -66,10 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #if defined(__amd64__) || defined(__i386__) -#include -#include #include -#include #endif #include @@ -620,9 +617,9 @@ iommu_gas_map(struct iommu_domain *domain, entry->flags |= eflags; IOMMU_DOMAIN_UNLOCK(domain); - error = domain_map_buf(domain, entry->start, entry->end - entry->start, - ma, eflags, - ((flags & IOMMU_MF_CANWAIT) != 0 ? IOMMU_PGF_WAITOK : 0)); + error = domain->ops->map(domain, entry->start, + entry->end - entry->start, ma, eflags, + ((flags & IOMMU_MF_CANWAIT) != 0 ? IOMMU_PGF_WAITOK : 0)); if (error == ENOMEM) { iommu_domain_unload_entry(entry, true); return (error); @@ -658,9 +655,9 @@ iommu_gas_map_region(struct iommu_domain *domain, stru if (entry->end == entry->start) return (0); - error = domain_map_buf(domain, entry->start, entry->end - entry->start, - ma + OFF_TO_IDX(start - entry->start), eflags, - ((flags & IOMMU_MF_CANWAIT) != 0 ? IOMMU_PGF_WAITOK : 0)); + error = domain->ops->map(domain, entry->start, + entry->end - entry->start, ma + OFF_TO_IDX(start - entry->start), + eflags, ((flags & IOMMU_MF_CANWAIT) != 0 ? IOMMU_PGF_WAITOK : 0)); if (error == ENOMEM) { iommu_domain_unload_entry(entry, false); return (error); Modified: head/sys/x86/iommu/intel_ctx.c ============================================================================== --- head/sys/x86/iommu/intel_ctx.c Fri Jul 31 22:23:32 2020 (r363746) +++ head/sys/x86/iommu/intel_ctx.c Fri Jul 31 23:02:17 2020 (r363747) @@ -341,6 +341,7 @@ dmar_domain_alloc(struct dmar_unit *dmar, bool id_mapp mtx_init(&domain->iodom.lock, "dmardom", NULL, MTX_DEF); domain->dmar = dmar; domain->iodom.iommu = &dmar->iommu; + domain_pgtbl_init(domain); /* * For now, use the maximal usable physical address of the @@ -842,15 +843,17 @@ dmar_domain_unload(struct dmar_domain *domain, struct iommu_map_entries_tailq *entries, bool cansleep) { struct dmar_unit *unit; + struct iommu_domain *iodom; struct iommu_map_entry *entry, *entry1; int error; + iodom = (struct iommu_domain *)domain; unit = (struct dmar_unit *)domain->iodom.iommu; TAILQ_FOREACH_SAFE(entry, entries, dmamap_link, entry1) { KASSERT((entry->flags & IOMMU_MAP_ENTRY_MAP) != 0, ("not mapped entry %p %p", domain, entry)); - error = domain_unmap_buf(domain, entry->start, entry->end - + error = iodom->ops->unmap(iodom, entry->start, entry->end - entry->start, cansleep ? IOMMU_PGF_WAITOK : 0); KASSERT(error == 0, ("unmap %p error %d", domain, error)); if (!unit->qi_enabled) { Modified: head/sys/x86/iommu/intel_dmar.h ============================================================================== --- head/sys/x86/iommu/intel_dmar.h Fri Jul 31 22:23:32 2020 (r363746) +++ head/sys/x86/iommu/intel_dmar.h Fri Jul 31 23:02:17 2020 (r363747) @@ -244,14 +244,11 @@ void dmar_qi_invalidate_iec(struct dmar_unit *unit, u_ vm_object_t domain_get_idmap_pgtbl(struct dmar_domain *domain, iommu_gaddr_t maxaddr); void put_idmap_pgtbl(vm_object_t obj); -int domain_map_buf(struct iommu_domain *domain, iommu_gaddr_t base, - iommu_gaddr_t size, vm_page_t *ma, uint64_t pflags, int flags); -int domain_unmap_buf(struct dmar_domain *domain, iommu_gaddr_t base, - iommu_gaddr_t size, int flags); void domain_flush_iotlb_sync(struct dmar_domain *domain, iommu_gaddr_t base, iommu_gaddr_t size); int domain_alloc_pgtbl(struct dmar_domain *domain); void domain_free_pgtbl(struct dmar_domain *domain); +void domain_pgtbl_init(struct dmar_domain *domain); int dmar_dev_depth(device_t child); void dmar_dev_path(device_t child, int *busno, void *path1, int depth); Modified: head/sys/x86/iommu/intel_idpgtbl.c ============================================================================== --- head/sys/x86/iommu/intel_idpgtbl.c Fri Jul 31 22:23:32 2020 (r363746) +++ head/sys/x86/iommu/intel_idpgtbl.c Fri Jul 31 23:02:17 2020 (r363747) @@ -498,7 +498,7 @@ domain_map_buf_locked(struct dmar_domain *domain, iomm return (0); } -int +static int domain_map_buf(struct iommu_domain *iodom, iommu_gaddr_t base, iommu_gaddr_t size, vm_page_t *ma, uint64_t eflags, int flags) { @@ -684,12 +684,15 @@ domain_unmap_buf_locked(struct dmar_domain *domain, io return (0); } -int -domain_unmap_buf(struct dmar_domain *domain, iommu_gaddr_t base, +static int +domain_unmap_buf(struct iommu_domain *iodom, iommu_gaddr_t base, iommu_gaddr_t size, int flags) { + struct dmar_domain *domain; int error; + domain = (struct dmar_domain *)iodom; + DMAR_DOMAIN_PGLOCK(domain); error = domain_unmap_buf_locked(domain, base, size, flags); DMAR_DOMAIN_PGUNLOCK(domain); @@ -808,4 +811,18 @@ domain_flush_iotlb_sync(struct dmar_domain *domain, io } } DMAR_UNLOCK(unit); +} + +static const struct iommu_domain_map_ops dmar_domain_map_ops = { + .map = domain_map_buf, + .unmap = domain_unmap_buf, +}; + +void +domain_pgtbl_init(struct dmar_domain *domain) +{ + struct iommu_domain *iodom; + + iodom = (struct iommu_domain *)domain; + iodom->ops = &dmar_domain_map_ops; } From owner-svn-src-head@freebsd.org Fri Jul 31 23:35:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7EAEA3A57E8; Fri, 31 Jul 2020 23:35:50 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJNvB2Wmkz44gq; Fri, 31 Jul 2020 23:35:50 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C21C95C6; Fri, 31 Jul 2020 23:35:50 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06VNZnuI083746; Fri, 31 Jul 2020 23:35:49 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06VNZn8n083743; Fri, 31 Jul 2020 23:35:49 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202007312335.06VNZn8n083743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 31 Jul 2020 23:35:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363748 - in head/sys/fs: nfs nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsserver X-SVN-Commit-Revision: 363748 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2020 23:35:50 -0000 Author: rmacklem Date: Fri Jul 31 23:35:49 2020 New Revision: 363748 URL: https://svnweb.freebsd.org/changeset/base/363748 Log: Add optional support for ext_pgs mbufs to the NFS server's read, readlink and getxattr operations. This patch optionally enables generation of read, readlink and getxattr replies in ext_pgs mbufs. Since neither of ND_EXTPG or ND_TLS are currently ever set, there is no change in semantics at this time. It also corrects the message in a couple of panic()s that should never occur. This is another in the series of commits that add support to the NFS client and server for building RPC messages in ext_pgs mbufs with anonymous pages. This is useful so that the entire mbuf list does not need to be copied before calling sosend() when NFS over TLS is enabled. Use of ext_pgs mbufs will not be enabled until the kernel RPC is updated to handle TLS. Modified: head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/nfsserver/nfs_nfsdserv.c Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Fri Jul 31 23:02:17 2020 (r363747) +++ head/sys/fs/nfs/nfs_var.h Fri Jul 31 23:35:49 2020 (r363748) @@ -680,9 +680,9 @@ int nfsvno_namei(struct nfsrv_descript *, struct namei vnode_t, int, struct nfsexstuff *, NFSPROC_T *, vnode_t *); void nfsvno_setpathbuf(struct nameidata *, char **, u_long **); void nfsvno_relpathbuf(struct nameidata *); -int nfsvno_readlink(vnode_t, struct ucred *, NFSPROC_T *, struct mbuf **, +int nfsvno_readlink(vnode_t, struct ucred *, int, NFSPROC_T *, struct mbuf **, struct mbuf **, int *); -int nfsvno_read(vnode_t, off_t, int, struct ucred *, NFSPROC_T *, +int nfsvno_read(vnode_t, off_t, int, struct ucred *, int, NFSPROC_T *, struct mbuf **, struct mbuf **); int nfsvno_write(vnode_t, off_t, int, int *, struct mbuf *, char *, struct ucred *, NFSPROC_T *); @@ -748,7 +748,7 @@ int nfsvno_seek(struct nfsrv_descript *, struct vnode bool *, struct ucred *, NFSPROC_T *); int nfsvno_allocate(struct vnode *, off_t, off_t, struct ucred *, NFSPROC_T *); int nfsvno_getxattr(struct vnode *, char *, uint32_t, struct ucred *, - struct thread *, struct mbuf **, struct mbuf **, int *); + uint64_t, int, struct thread *, struct mbuf **, struct mbuf **, int *); int nfsvno_setxattr(struct vnode *, char *, int, struct mbuf *, char *, struct ucred *, struct thread *); int nfsvno_rmxattr(struct nfsrv_descript *, struct vnode *, char *, Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Fri Jul 31 23:02:17 2020 (r363747) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Fri Jul 31 23:35:49 2020 (r363748) @@ -108,6 +108,8 @@ extern struct nfsdevicehead nfsrv_devidhead; static int nfsrv_createiovec(int, struct mbuf **, struct mbuf **, struct iovec **); +static int nfsrv_createiovec_extpgs(int, int, struct mbuf **, + struct mbuf **, struct iovec **); static int nfsrv_createiovecw(int, struct mbuf *, char *, struct iovec **, int *); static void nfsrv_pnfscreate(struct vnode *, struct vattr *, struct ucred *, @@ -738,8 +740,8 @@ nfsvno_relpathbuf(struct nameidata *ndp) * Readlink vnode op into an mbuf list. */ int -nfsvno_readlink(struct vnode *vp, struct ucred *cred, struct thread *p, - struct mbuf **mpp, struct mbuf **mpendp, int *lenp) +nfsvno_readlink(struct vnode *vp, struct ucred *cred, int maxextsiz, + struct thread *p, struct mbuf **mpp, struct mbuf **mpendp, int *lenp) { struct iovec *iv; struct uio io, *uiop = &io; @@ -747,7 +749,11 @@ nfsvno_readlink(struct vnode *vp, struct ucred *cred, int len, tlen, error = 0; len = NFS_MAXPATHLEN; - uiop->uio_iovcnt = nfsrv_createiovec(len, &mp3, &mp, &iv); + if (maxextsiz > 0) + uiop->uio_iovcnt = nfsrv_createiovec_extpgs(len, maxextsiz, + &mp3, &mp, &iv); + else + uiop->uio_iovcnt = nfsrv_createiovec(len, &mp3, &mp, &iv); uiop->uio_iov = iv; uiop->uio_offset = 0; uiop->uio_resid = len; @@ -819,7 +825,7 @@ nfsrv_createiovec(int len, struct mbuf **mpp, struct m i = 0; while (left > 0) { if (m == NULL) - panic("nfsvno_read iov"); + panic("nfsrv_createiovec iov"); siz = min(M_TRAILINGSPACE(m), left); if (siz > 0) { iv->iov_base = mtod(m, caddr_t) + m->m_len; @@ -837,11 +843,76 @@ nfsrv_createiovec(int len, struct mbuf **mpp, struct m } /* + * Create an mbuf chain and an associated iovec that can be used to Read + * or Getextattr of data. + * Upon success, return pointers to the first and last mbufs in the chain + * plus the malloc'd iovec and its iovlen. + * Same as above, but creates ext_pgs mbuf(s). + */ +static int +nfsrv_createiovec_extpgs(int len, int maxextsiz, struct mbuf **mpp, + struct mbuf **mpendp, struct iovec **ivp) +{ + struct mbuf *m, *m2 = NULL, *m3; + struct iovec *iv; + int i, left, pgno, siz; + + left = len; + m3 = NULL; + /* + * Generate the mbuf list with the uio_iov ref. to it. + */ + i = 0; + while (left > 0) { + siz = min(left, maxextsiz); + m = mb_alloc_ext_plus_pages(siz, M_WAITOK); + left -= siz; + i += m->m_epg_npgs; + if (m3 != NULL) + m2->m_next = m; + else + m3 = m; + m2 = m; + } + *ivp = iv = malloc(i * sizeof (struct iovec), M_TEMP, M_WAITOK); + m = m3; + left = len; + i = 0; + pgno = 0; + while (left > 0) { + if (m == NULL) + panic("nfsvno_createiovec_extpgs iov"); + siz = min(PAGE_SIZE, left); + if (siz > 0) { + iv->iov_base = (void *)PHYS_TO_DMAP(m->m_epg_pa[pgno]); + iv->iov_len = siz; + m->m_len += siz; + if (pgno == m->m_epg_npgs - 1) + m->m_epg_last_len = siz; + left -= siz; + iv++; + i++; + pgno++; + } + if (pgno == m->m_epg_npgs && left > 0) { + m = m->m_next; + if (m == NULL) + panic("nfsvno_createiovec_extpgs iov"); + pgno = 0; + } + } + *mpp = m3; + *mpendp = m2; + return (i); +} + +/* * Read vnode op call into mbuf list. */ int nfsvno_read(struct vnode *vp, off_t off, int cnt, struct ucred *cred, - struct thread *p, struct mbuf **mpp, struct mbuf **mpendp) + int maxextsiz, struct thread *p, struct mbuf **mpp, + struct mbuf **mpendp) { struct mbuf *m; struct iovec *iv; @@ -860,7 +931,11 @@ nfsvno_read(struct vnode *vp, off_t off, int cnt, stru return (error); len = NFSM_RNDUP(cnt); - uiop->uio_iovcnt = nfsrv_createiovec(len, &m3, &m, &iv); + if (maxextsiz > 0) + uiop->uio_iovcnt = nfsrv_createiovec_extpgs(len, maxextsiz, + &m3, &m, &iv); + else + uiop->uio_iovcnt = nfsrv_createiovec(len, &m3, &m, &iv); uiop->uio_iov = iv; uiop->uio_offset = off; uiop->uio_resid = len; @@ -938,7 +1013,7 @@ nfsrv_createiovecw(int retlen, struct mbuf *m, char *c len = retlen; while (len > 0) { if (mp == NULL) - panic("nfsvno_write"); + panic("nfsrv_createiovecw"); if (i > 0) { i = min(i, len); ivp->iov_base = cp; @@ -6241,8 +6316,8 @@ nfsvno_allocate(struct vnode *vp, off_t off, off_t len */ int nfsvno_getxattr(struct vnode *vp, char *name, uint32_t maxresp, - struct ucred *cred, struct thread *p, struct mbuf **mpp, - struct mbuf **mpendp, int *lenp) + struct ucred *cred, uint64_t flag, int maxextsiz, struct thread *p, + struct mbuf **mpp, struct mbuf **mpendp, int *lenp) { struct iovec *iv; struct uio io, *uiop = &io; @@ -6260,7 +6335,21 @@ nfsvno_getxattr(struct vnode *vp, char *name, uint32_t len = siz; tlen = NFSM_RNDUP(len); if (tlen > 0) { - uiop->uio_iovcnt = nfsrv_createiovec(tlen, &m, &m2, &iv); + /* + * If cnt > MCLBYTES and the reply will not be saved, use + * ext_pgs mbufs for TLS. + * For NFSv4.0, we do not know for sure if the reply will + * be saved, so do not use ext_pgs mbufs for NFSv4.0. + * Always use ext_pgs mbufs if ND_EXTPG is set. + */ + if ((flag & ND_EXTPG) != 0 || (tlen > MCLBYTES && + (flag & (ND_TLS | ND_SAVEREPLY)) == ND_TLS && + (flag & (ND_NFSV4 | ND_NFSV41)) != ND_NFSV4)) + uiop->uio_iovcnt = nfsrv_createiovec_extpgs(tlen, + maxextsiz, &m, &m2, &iv); + else + uiop->uio_iovcnt = nfsrv_createiovec(tlen, &m, &m2, + &iv); uiop->uio_iov = iv; } else { uiop->uio_iovcnt = 0; Modified: head/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdserv.c Fri Jul 31 23:02:17 2020 (r363747) +++ head/sys/fs/nfsserver/nfs_nfsdserv.c Fri Jul 31 23:35:49 2020 (r363748) @@ -667,6 +667,7 @@ nfsrvd_readlink(struct nfsrv_descript *nd, __unused in int getret = 1, len; struct nfsvattr nva; struct thread *p = curthread; + uint16_t off; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &nva); @@ -678,9 +679,14 @@ nfsrvd_readlink(struct nfsrv_descript *nd, __unused in else nd->nd_repstat = EINVAL; } - if (!nd->nd_repstat) - nd->nd_repstat = nfsvno_readlink(vp, nd->nd_cred, p, - &mp, &mpend, &len); + if (nd->nd_repstat == 0) { + if ((nd->nd_flag & ND_EXTPG) != 0) + nd->nd_repstat = nfsvno_readlink(vp, nd->nd_cred, + nd->nd_maxextsiz, p, &mp, &mpend, &len); + else + nd->nd_repstat = nfsvno_readlink(vp, nd->nd_cred, + 0, p, &mp, &mpend, &len); + } if (nd->nd_flag & ND_NFSV3) getret = nfsvno_getattr(vp, &nva, nd, p, 1, NULL); vput(vp); @@ -693,7 +699,16 @@ nfsrvd_readlink(struct nfsrv_descript *nd, __unused in if (mp != NULL) { nd->nd_mb->m_next = mp; nd->nd_mb = mpend; - nd->nd_bpos = mtod(mpend, caddr_t) + mpend->m_len; + if ((mpend->m_flags & M_EXTPG) != 0) { + nd->nd_bextpg = mpend->m_epg_npgs - 1; + nd->nd_bpos = (char *)(void *) + PHYS_TO_DMAP(mpend->m_epg_pa[nd->nd_bextpg]); + off = (nd->nd_bextpg == 0) ? mpend->m_epg_1st_off : 0; + nd->nd_bpos += off + mpend->m_epg_last_len; + nd->nd_bextpgsiz = PAGE_SIZE - mpend->m_epg_last_len - + off; + } else + nd->nd_bpos = mtod(mpend, char *) + mpend->m_len; } out: @@ -718,6 +733,7 @@ nfsrvd_read(struct nfsrv_descript *nd, __unused int is nfsv4stateid_t stateid; nfsquad_t clientid; struct thread *p = curthread; + uint16_t poff; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &nva); @@ -839,8 +855,21 @@ nfsrvd_read(struct nfsrv_descript *nd, __unused int is cnt = reqlen; m3 = NULL; if (cnt > 0) { - nd->nd_repstat = nfsvno_read(vp, off, cnt, nd->nd_cred, p, - &m3, &m2); + /* + * If cnt > MCLBYTES and the reply will not be saved, use + * ext_pgs mbufs for TLS. + * For NFSv4.0, we do not know for sure if the reply will + * be saved, so do not use ext_pgs mbufs for NFSv4.0. + * Always use ext_pgs mbufs if ND_EXTPG is set. + */ + if ((nd->nd_flag & ND_EXTPG) != 0 || (cnt > MCLBYTES && + (nd->nd_flag & (ND_TLS | ND_SAVEREPLY)) == ND_TLS && + (nd->nd_flag & (ND_NFSV4 | ND_NFSV41)) != ND_NFSV4)) + nd->nd_repstat = nfsvno_read(vp, off, cnt, nd->nd_cred, + nd->nd_maxextsiz, p, &m3, &m2); + else + nd->nd_repstat = nfsvno_read(vp, off, cnt, nd->nd_cred, + 0, p, &m3, &m2); if (!(nd->nd_flag & ND_NFSV4)) { getret = nfsvno_getattr(vp, &nva, nd, p, 1, NULL); if (!nd->nd_repstat) @@ -875,7 +904,17 @@ nfsrvd_read(struct nfsrv_descript *nd, __unused int is if (m3) { nd->nd_mb->m_next = m3; nd->nd_mb = m2; - nd->nd_bpos = mtod(m2, caddr_t) + m2->m_len; + if ((m2->m_flags & M_EXTPG) != 0) { + nd->nd_flag |= ND_EXTPG; + nd->nd_bextpg = m2->m_epg_npgs - 1; + nd->nd_bpos = (char *)(void *) + PHYS_TO_DMAP(m2->m_epg_pa[nd->nd_bextpg]); + poff = (nd->nd_bextpg == 0) ? m2->m_epg_1st_off : 0; + nd->nd_bpos += poff + m2->m_epg_last_len; + nd->nd_bextpgsiz = PAGE_SIZE - m2->m_epg_last_len - + poff; + } else + nd->nd_bpos = mtod(m2, char *) + m2->m_len; } out: @@ -5536,6 +5575,7 @@ nfsrvd_getxattr(struct nfsrv_descript *nd, __unused in int error, len; char *name; struct thread *p = curthread; + uint16_t off; error = 0; if (nfs_rootfhset == 0 || nfsd_checkrootexp(nd) != 0) { @@ -5555,8 +5595,9 @@ nfsrvd_getxattr(struct nfsrv_descript *nd, __unused in name = malloc(len + 1, M_TEMP, M_WAITOK); nd->nd_repstat = nfsrv_mtostr(nd, name, len); if (nd->nd_repstat == 0) - nd->nd_repstat = nfsvno_getxattr(vp, name, nd->nd_maxresp, - nd->nd_cred, p, &mp, &mpend, &len); + nd->nd_repstat = nfsvno_getxattr(vp, name, + nd->nd_maxresp, nd->nd_cred, nd->nd_flag, + nd->nd_maxextsiz, p, &mp, &mpend, &len); if (nd->nd_repstat == ENOATTR) nd->nd_repstat = NFSERR_NOXATTR; else if (nd->nd_repstat == EOPNOTSUPP) @@ -5567,7 +5608,19 @@ nfsrvd_getxattr(struct nfsrv_descript *nd, __unused in if (len > 0) { nd->nd_mb->m_next = mp; nd->nd_mb = mpend; - nd->nd_bpos = mtod(mpend, caddr_t) + mpend->m_len; + if ((mpend->m_flags & M_EXTPG) != 0) { + nd->nd_flag |= ND_EXTPG; + nd->nd_bextpg = mpend->m_epg_npgs - 1; + nd->nd_bpos = (char *)(void *) + PHYS_TO_DMAP(mpend->m_epg_pa[nd->nd_bextpg]); + off = (nd->nd_bextpg == 0) ? + mpend->m_epg_1st_off : 0; + nd->nd_bpos += off + mpend->m_epg_last_len; + nd->nd_bextpgsiz = PAGE_SIZE - + mpend->m_epg_last_len - off; + } else + nd->nd_bpos = mtod(mpend, char *) + + mpend->m_len; } } free(name, M_TEMP); From owner-svn-src-head@freebsd.org Sat Aug 1 04:40:01 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5D33E36CEC2; Sat, 1 Aug 2020 04:40:01 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJWf805r7z4KXn; Sat, 1 Aug 2020 04:39:59 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x342.google.com with SMTP id q76so9691103wme.4; Fri, 31 Jul 2020 21:39:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=a5aXiFyEmM4oTiQJ+XEZa/KlF9DRT0upL7gxKQUhHEI=; b=gMCfWit6aBCdf997pctojkxNgAqsyjRBV7DpQvhHU1g+Fb/CJeizSJPzlpyRmezVYv cauy9CfR0dtDHZA3JfZ00cSGQVE9Z4O0FahP0R8RxOwT4jRfpsWZ1G9h0MoOOdMT9avx sGD6XEltWznCUM6oeoYsZ5fd076XVv+r/Hi9AbN7JBdkysR+WTE2ZHwjZDhoNEhliVu+ KVpRFvybWBTkgM3dRsILsQB+HfN7Z2tAQQ8VZmYIQ4Ql3xt82xO+FqVSFQbzND3SbVVc CPSlKAn5AcBVlcM/A9mr5gSk5Gm8QNZ6kNr9e1rfK5iHQb08j1XOQThkdhCm9ROy3Weg 6WFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=a5aXiFyEmM4oTiQJ+XEZa/KlF9DRT0upL7gxKQUhHEI=; b=jhIkFl+o48v1NiLySZ/7A4xoKXfFCf718FGAJM41hREf+3G3zMEwKLE8AclC+vgKPa /ZFKrzcVZYVuY9bXT2eovTKLTTPFDzPNwRmml/iVw3UffamG9nszGGSWzIrYvGFLc2Oq 7PgKWcbpa3UjJgjBrbr1dcTlxEtKK4QgC9wOmvvXpyECw7tQE6VV83lypAPat6k3+ori zTM3YPTo/k65xRyb5xX7FgFmF0KZDmXWp4ZoywxIh5CAihqbuYDfDtvIhr8sZD7fh/Ju vXbyh+U/urzb9r4WFYs7++KmKufio04yioX/3w+zygn4r8qrkLvKe4Nae1Rvb1es+Obd HCbQ== X-Gm-Message-State: AOAM532d7Si6GJoiLYVAV2Zm1t1/H9jrsg/irbjdduLnbxWvjCuYoI5g ndAZyGAAiMXzeDas0JAIRMDmLzw9IvUI5Hm0L9jezQ== X-Google-Smtp-Source: ABdhPJydPPynEvvvfee2L+TAXDYr0n5rcjMW6OOHIVzX4M7FTyNoaF/k1haszgMQcLkl6vmVx/qJ2ZRmLczMm7WtvQ4= X-Received: by 2002:a1c:790b:: with SMTP id l11mr6686579wme.127.1596256797299; Fri, 31 Jul 2020 21:39:57 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a5d:614c:0:0:0:0:0 with HTTP; Fri, 31 Jul 2020 21:39:56 -0700 (PDT) In-Reply-To: <202007301445.06UEj5uj062013@repo.freebsd.org> References: <202007301445.06UEj5uj062013@repo.freebsd.org> From: Mateusz Guzik Date: Sat, 1 Aug 2020 06:39:56 +0200 Message-ID: Subject: Re: svn commit: r363700 - in head/sys: arm/ti arm/ti/am335x arm/ti/clk arm/ti/cpsw arm/ti/omap4 arm/ti/usb dev/uart modules To: Michal Meloun Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BJWf805r7z4KXn X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=gMCfWit6; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::342 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-3.14 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.002]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.96)[-0.961]; TO_DN_SOME(0.00)[]; SH_EMAIL_DBL_DONT_QUERY_IPS(0.00)[0.0.0.40:email,0.0.1.242:email]; DBL_PROHIBIT(0.00)[0.0.0.40:email,0.0.1.242:email]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::342:from]; NEURAL_HAM_SHORT(-0.18)[-0.180]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2020 04:40:01 -0000 This breaks tinderbox for several arm kernels. On 7/30/20, Michal Meloun wrote: > Author: mmel > Date: Thu Jul 30 14:45:05 2020 > New Revision: 363700 > URL: https://svnweb.freebsd.org/changeset/base/363700 > > Log: > Move Ti AM335x to dev/extres/clk framework. > > Re-implement clocks for these SoC by using now standard extres/clk > framework. > This is necessary for future expansion of these. The new implementation > is (due to the size of the patch) only the initial (minimum) version. > It will be updated/expanded with a subsequent set of particular patches. > > This patch is also not tested on OMAP4 based boards (BeagleBone), > so all possible issues should be (and will be) fixed by ASAP once > identified. > > Submited by: Oskar Holmlund (oskar.holmlund@ohdata.se) > Differential Revision: https://reviews.freebsd.org/D25118 > > Added: > head/sys/arm/ti/am335x/am3359_cppi41.c (contents, props changed) > head/sys/arm/ti/am335x/am335x_usb_phy.c (contents, props changed) > head/sys/arm/ti/clk/ > head/sys/arm/ti/clk/clock_common.c (contents, props changed) > head/sys/arm/ti/clk/clock_common.h (contents, props changed) > head/sys/arm/ti/clk/ti_clk_clkctrl.c (contents, props changed) > head/sys/arm/ti/clk/ti_clk_clkctrl.h (contents, props changed) > head/sys/arm/ti/clk/ti_clk_dpll.c (contents, props changed) > head/sys/arm/ti/clk/ti_clk_dpll.h (contents, props changed) > head/sys/arm/ti/clk/ti_clkctrl.c (contents, props changed) > head/sys/arm/ti/clk/ti_divider_clock.c (contents, props changed) > head/sys/arm/ti/clk/ti_dpll_clock.c (contents, props changed) > head/sys/arm/ti/clk/ti_gate_clock.c (contents, props changed) > head/sys/arm/ti/clk/ti_mux_clock.c (contents, props changed) > head/sys/arm/ti/ti_omap4_cm.c (contents, props changed) > head/sys/arm/ti/ti_omap4_cm.h (contents, props changed) > head/sys/arm/ti/ti_prm.c (contents, props changed) > head/sys/arm/ti/ti_prm.h (contents, props changed) > head/sys/arm/ti/ti_scm_syscon.c (contents, props changed) > head/sys/arm/ti/ti_sysc.h (contents, props changed) > Deleted: > head/sys/arm/ti/am335x/am335x_prcm.c > head/sys/arm/ti/am335x/am335x_usbss.c > head/sys/arm/ti/ti_hwmods.c > head/sys/arm/ti/ti_hwmods.h > Modified: > head/sys/arm/ti/am335x/am335x_dmtimer.c > head/sys/arm/ti/am335x/am335x_dmtpps.c > head/sys/arm/ti/am335x/am335x_dmtreg.h > head/sys/arm/ti/am335x/am335x_gpio.c > head/sys/arm/ti/am335x/am335x_lcd.c > head/sys/arm/ti/am335x/am335x_musb.c > head/sys/arm/ti/am335x/am335x_pwmss.c > head/sys/arm/ti/am335x/am335x_rtc.c > head/sys/arm/ti/am335x/am335x_scm.c > head/sys/arm/ti/am335x/files.am335x > head/sys/arm/ti/cpsw/if_cpsw.c > head/sys/arm/ti/files.ti > head/sys/arm/ti/omap4/files.omap4 > head/sys/arm/ti/ti_adc.c > head/sys/arm/ti/ti_edma3.c > head/sys/arm/ti/ti_gpio.c > head/sys/arm/ti/ti_i2c.c > head/sys/arm/ti/ti_mbox.c > head/sys/arm/ti/ti_pinmux.c > head/sys/arm/ti/ti_prcm.c > head/sys/arm/ti/ti_prcm.h > head/sys/arm/ti/ti_pruss.c > head/sys/arm/ti/ti_scm.c > head/sys/arm/ti/ti_sdhci.c > head/sys/arm/ti/ti_sdma.c > head/sys/arm/ti/ti_spi.c > head/sys/arm/ti/ti_sysc.c > head/sys/arm/ti/ti_wdt.c > head/sys/arm/ti/usb/omap_ehci.c > head/sys/arm/ti/usb/omap_host.c > head/sys/arm/ti/usb/omap_tll.c > head/sys/dev/uart/uart_dev_ti8250.c > head/sys/modules/Makefile > > Added: head/sys/arm/ti/am335x/am3359_cppi41.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/arm/ti/am335x/am3359_cppi41.c Thu Jul 30 14:45:05 > 2020 (r363700) > @@ -0,0 +1,192 @@ > +/*- > + * Copyright (c) 2019 Emmanuel Vadot > + * > + * Copyright (c) 2020 Oskar Holmlund > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED > WARRANTIES > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, > + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; > + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED > + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, > + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + * > + * $FreeBSD$ > + */ > +/* Based on sys/arm/ti/ti_sysc.c */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +#include > + > +#include > +#include > +#include > + > +#include > + > +#if 0 > +#define DPRINTF(dev, msg...) device_printf(dev, msg) > +#else > +#define DPRINTF(dev, msg...) > +#endif > + > +struct ti_am3359_cppi41_softc { > + device_t dev; > + struct syscon * syscon; > + struct resource * res[4]; > + bus_space_tag_t bst; > + bus_space_handle_t bsh; > + struct mtx mtx; > +}; > + > +static struct resource_spec ti_am3359_cppi41_res_spec[] = { > + { SYS_RES_MEMORY, 0, RF_ACTIVE | RF_SHAREABLE }, > + { SYS_RES_MEMORY, 1, RF_ACTIVE | RF_SHAREABLE }, > + { SYS_RES_MEMORY, 2, RF_ACTIVE | RF_SHAREABLE }, > + { SYS_RES_MEMORY, 3, RF_ACTIVE | RF_SHAREABLE }, > + { -1, 0 } > +}; > + > +/* Device */ > +static struct ofw_compat_data compat_data[] = { > + { "ti,am3359-cppi41", 1 }, > + { NULL, 0 } > +}; > + > +static int > +ti_am3359_cppi41_write_4(device_t dev, bus_addr_t addr, uint32_t val) > +{ > + struct ti_am3359_cppi41_softc *sc; > + > + sc = device_get_softc(dev); > + DPRINTF(sc->dev, "offset=%lx write %x\n", addr, val); > + mtx_lock(&sc->mtx); > + bus_space_write_4(sc->bst, sc->bsh, addr, val); > + mtx_unlock(&sc->mtx); > + return (0); > +} > + > +static uint32_t > +ti_am3359_cppi41_read_4(device_t dev, bus_addr_t addr) > +{ > + struct ti_am3359_cppi41_softc *sc; > + uint32_t val; > + > + sc = device_get_softc(dev); > + > + mtx_lock(&sc->mtx); > + val = bus_space_read_4(sc->bst, sc->bsh, addr); > + mtx_unlock(&sc->mtx); > + DPRINTF(sc->dev, "offset=%lx Read %x\n", addr, val); > + return (val); > +} > + > +/* device interface */ > +static int > +ti_am3359_cppi41_probe(device_t dev) > +{ > + if (!ofw_bus_status_okay(dev)) > + return (ENXIO); > + > + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) > + return (ENXIO); > + > + device_set_desc(dev, "TI AM3359 CPPI 41"); > + return(BUS_PROBE_DEFAULT); > +} > + > +static int > +ti_am3359_cppi41_attach(device_t dev) > +{ > + struct ti_am3359_cppi41_softc *sc; > + phandle_t node; > + uint32_t reg, reset_bit, timeout=10; > + uint64_t sysc_address; > + device_t parent; > + > + sc = device_get_softc(dev); > + sc->dev = dev; > + > + if (bus_alloc_resources(dev, ti_am3359_cppi41_res_spec, sc->res)) { > + device_printf(sc->dev, "Cant allocate resources\n"); > + return (ENXIO); > + } > + > + sc->dev = dev; > + sc->bst = rman_get_bustag(sc->res[0]); > + sc->bsh = rman_get_bushandle(sc->res[0]); > + > + mtx_init(&sc->mtx, device_get_nameunit(sc->dev), NULL, MTX_DEF); > + node = ofw_bus_get_node(sc->dev); > + > + /* variant of am335x_usbss.c */ > + DPRINTF(dev, "-- RESET USB --\n"); > + parent = device_get_parent(dev); > + reset_bit = ti_sysc_get_soft_reset_bit(parent); > + if (reset_bit == 0) { > + DPRINTF(dev, "Dont have reset bit\n"); > + return (0); > + } > + sysc_address = ti_sysc_get_sysc_address_offset_host(parent); > + DPRINTF(dev, "sysc_address %x\n", sysc_address); > + ti_am3359_cppi41_write_4(dev, sysc_address, reset_bit); > + DELAY(100); > + reg = ti_am3359_cppi41_read_4(dev, sysc_address); > + if ((reg & reset_bit) && timeout--) { > + DPRINTF(dev, "Reset still ongoing - wait a little bit longer\n"); > + DELAY(100); > + reg = ti_am3359_cppi41_read_4(dev, sysc_address); > + } > + if (timeout == 0) > + device_printf(dev, "USB Reset timeout\n"); > + > + return (0); > +} > + > + > +static device_method_t ti_am3359_cppi41_methods[] = { > + DEVMETHOD(device_probe, ti_am3359_cppi41_probe), > + DEVMETHOD(device_attach, ti_am3359_cppi41_attach), > + > + DEVMETHOD_END > +}; > + > + > +DEFINE_CLASS_1(ti_am3359_cppi41, ti_am3359_cppi41_driver, > + ti_am3359_cppi41_methods,sizeof(struct ti_am3359_cppi41_softc), > + simplebus_driver); > + > +static devclass_t ti_am3359_cppi41_devclass; > + > +EARLY_DRIVER_MODULE(ti_am3359_cppi41, simplebus, ti_am3359_cppi41_driver, > + ti_am3359_cppi41_devclass, 0, 0, BUS_PASS_BUS + > BUS_PASS_ORDER_MIDDLE); > +MODULE_VERSION(ti_am3359_cppi41, 1); > +MODULE_DEPEND(ti_am3359_cppi41, ti_sysc, 1, 1, 1); > > Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c > ============================================================================== > --- head/sys/arm/ti/am335x/am335x_dmtimer.c Thu Jul 30 14:42:50 > 2020 (r363699) > +++ head/sys/arm/ti/am335x/am335x_dmtimer.c Thu Jul 30 14:45:05 > 2020 (r363700) > @@ -42,12 +42,13 @@ __FBSDID("$FreeBSD$"); > > #include /* For arm_set_delay */ > > +#include > + > #include > #include > #include > > -#include > -#include > +#include > > #include "am335x_dmtreg.h" > > @@ -58,7 +59,8 @@ struct am335x_dmtimer_softc { > int tmr_irq_rid; > struct resource * tmr_irq_res; > void *tmr_irq_handler; > - uint32_t sysclk_freq; > + clk_t clk_fck; > + uint64_t sysclk_freq; > uint32_t tclr; /* Cached TCLR register. */ > union { > struct timecounter tc; > @@ -251,6 +253,7 @@ am335x_dmtimer_probe(device_t dev) > { > char strbuf[32]; > int tmr_num; > + uint64_t rev_address; > > if (!ofw_bus_status_okay(dev)) > return (ENXIO); > @@ -259,13 +262,22 @@ am335x_dmtimer_probe(device_t dev) > return (ENXIO); > > /* > - * Get the hardware unit number (the N from ti,hwmods="timerN"). > + * Get the hardware unit number from address of rev register. > * If this isn't the hardware unit we're going to use for either the > * eventtimer or the timecounter, no point in instantiating the device. > */ > - tmr_num = ti_hwmods_get_unit(dev, "timer"); > - if (tmr_num != ET_TMR_NUM && tmr_num != TC_TMR_NUM) > - return (ENXIO); > + rev_address = ti_sysc_get_rev_address(device_get_parent(dev)); > + switch (rev_address) { > + case DMTIMER2_REV: > + tmr_num = 2; > + break; > + case DMTIMER3_REV: > + tmr_num = 3; > + break; > + default: > + /* Not DMTIMER2 or DMTIMER3 */ > + return (ENXIO); > + } > > snprintf(strbuf, sizeof(strbuf), "AM335x DMTimer%d", tmr_num); > device_set_desc_copy(dev, strbuf); > @@ -277,24 +289,47 @@ static int > am335x_dmtimer_attach(device_t dev) > { > struct am335x_dmtimer_softc *sc; > - clk_ident_t timer_id; > int err; > + uint64_t rev_address; > + clk_t sys_clkin; > > sc = device_get_softc(dev); > sc->dev = dev; > > - /* Get the base clock frequency. */ > - if ((err = ti_prcm_clk_get_source_freq(SYS_CLK, &sc->sysclk_freq)) != 0) > - return (err); > + /* expect one clock */ > + err = clk_get_by_ofw_index(dev, 0, 0, &sc->clk_fck); > + if (err != 0) { > + device_printf(dev, "Cant find clock index 0. err: %d\n", err); > + return (ENXIO); > + } > > + err = clk_get_by_name(dev, "sys_clkin_ck@40", &sys_clkin); > + if (err != 0) { > + device_printf(dev, "Cant find sys_clkin_ck@40 err: %d\n", err); > + return (ENXIO); > + } > + > + /* Select M_OSC as DPLL parent */ > + err = clk_set_parent_by_clk(sc->clk_fck, sys_clkin); > + if (err != 0) { > + device_printf(dev, "Cant set mux to CLK_M_OSC\n"); > + return (ENXIO); > + } > + > /* Enable clocks and power on the device. */ > - if ((timer_id = ti_hwmods_get_clock(dev)) == INVALID_CLK_IDENT) > + err = ti_sysc_clock_enable(device_get_parent(dev)); > + if (err != 0) { > + device_printf(dev, "Cant enable sysc clkctrl, err %d\n", err); > return (ENXIO); > - if ((err = ti_prcm_clk_set_source(timer_id, SYSCLK_CLK)) != 0) > - return (err); > - if ((err = ti_prcm_clk_enable(timer_id)) != 0) > - return (err); > + } > > + /* Get the base clock frequency. */ > + err = clk_get_freq(sc->clk_fck, &sc->sysclk_freq); > + if (err != 0) { > + device_printf(dev, "Cant get sysclk frequency, err %d\n", err); > + return (ENXIO); > + } > + > /* Request the memory resources. */ > sc->tmr_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, > &sc->tmr_mem_rid, RF_ACTIVE); > @@ -302,7 +337,20 @@ am335x_dmtimer_attach(device_t dev) > return (ENXIO); > } > > - sc->tmr_num = ti_hwmods_get_unit(dev, "timer"); > + rev_address = ti_sysc_get_rev_address(device_get_parent(dev)); > + switch (rev_address) { > + case DMTIMER2_REV: > + sc->tmr_num = 2; > + break; > + case DMTIMER3_REV: > + sc->tmr_num = 3; > + break; > + default: > + device_printf(dev, "Not timer 2 or 3! %#jx\n", > + rev_address); > + return (ENXIO); > + } > + > snprintf(sc->tmr_name, sizeof(sc->tmr_name), "DMTimer%d", sc->tmr_num); > > /* > @@ -334,7 +382,7 @@ static driver_t am335x_dmtimer_driver = { > static devclass_t am335x_dmtimer_devclass; > > DRIVER_MODULE(am335x_dmtimer, simplebus, am335x_dmtimer_driver, > am335x_dmtimer_devclass, 0, 0); > -MODULE_DEPEND(am335x_dmtimer, am335x_prcm, 1, 1, 1); > +MODULE_DEPEND(am335x_dmtimer, ti_sysc, 1, 1, 1); > > static void > am335x_dmtimer_delay(int usec, void *arg) > > Modified: head/sys/arm/ti/am335x/am335x_dmtpps.c > ============================================================================== > --- head/sys/arm/ti/am335x/am335x_dmtpps.c Thu Jul 30 14:42:50 > 2020 (r363699) > +++ head/sys/arm/ti/am335x/am335x_dmtpps.c Thu Jul 30 14:45:05 > 2020 (r363700) > @@ -43,6 +43,8 @@ > #include > __FBSDID("$FreeBSD$"); > > +#include "opt_platform.h" > + > #include > #include > #include > @@ -60,9 +62,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > > -#include > -#include > +#include > #include > #include > > @@ -82,6 +84,8 @@ struct dmtpps_softc { > struct cdev * pps_cdev; > struct pps_state pps_state; > struct mtx pps_mtx; > + clk_t clk_fck; > + uint64_t sysclk_freq; > }; > > static int dmtpps_tmr_num; /* Set by probe() */ > @@ -383,6 +387,7 @@ dmtpps_probe(device_t dev) > { > char strbuf[64]; > int tmr_num; > + uint64_t rev_address; > > if (!ofw_bus_status_okay(dev)) > return (ENXIO); > @@ -402,7 +407,33 @@ dmtpps_probe(device_t dev) > * Figure out which hardware timer is being probed and see if it matches > * the configured timer number determined earlier. > */ > - tmr_num = ti_hwmods_get_unit(dev, "timer"); > + rev_address = ti_sysc_get_rev_address(device_get_parent(dev)); > + switch (rev_address) { > + case DMTIMER1_1MS_REV: > + tmr_num = 1; > + break; > + case DMTIMER2_REV: > + tmr_num = 2; > + break; > + case DMTIMER3_REV: > + tmr_num = 3; > + break; > + case DMTIMER4_REV: > + tmr_num = 4; > + break; > + case DMTIMER5_REV: > + tmr_num = 5; > + break; > + case DMTIMER6_REV: > + tmr_num = 6; > + break; > + case DMTIMER7_REV: > + tmr_num = 7; > + break; > + default: > + return (ENXIO); > + } > + > if (dmtpps_tmr_num != tmr_num) > return (ENXIO); > > @@ -418,23 +449,73 @@ dmtpps_attach(device_t dev) > { > struct dmtpps_softc *sc; > struct make_dev_args mda; > - clk_ident_t timer_id; > - int err, sysclk_freq; > + int err; > + clk_t sys_clkin; > + uint64_t rev_address; > > sc = device_get_softc(dev); > sc->dev = dev; > > - /* Get the base clock frequency. */ > - err = ti_prcm_clk_get_source_freq(SYS_CLK, &sysclk_freq); > + /* Figure out which hardware timer this is and set the name string. */ > + rev_address = ti_sysc_get_rev_address(device_get_parent(dev)); > + switch (rev_address) { > + case DMTIMER1_1MS_REV: > + sc->tmr_num = 1; > + break; > + case DMTIMER2_REV: > + sc->tmr_num = 2; > + break; > + case DMTIMER3_REV: > + sc->tmr_num = 3; > + break; > + case DMTIMER4_REV: > + sc->tmr_num = 4; > + break; > + case DMTIMER5_REV: > + sc->tmr_num = 5; > + break; > + case DMTIMER6_REV: > + sc->tmr_num = 6; > + break; > + case DMTIMER7_REV: > + sc->tmr_num = 7; > + break; > + } > + snprintf(sc->tmr_name, sizeof(sc->tmr_name), "DMTimer%d", sc->tmr_num); > > + /* expect one clock */ > + err = clk_get_by_ofw_index(dev, 0, 0, &sc->clk_fck); > + if (err != 0) { > + device_printf(dev, "Cant find clock index 0. err: %d\n", err); > + return (ENXIO); > + } > + > + err = clk_get_by_name(dev, "sys_clkin_ck@40", &sys_clkin); > + if (err != 0) { > + device_printf(dev, "Cant find sys_clkin_ck@40 err: %d\n", err); > + return (ENXIO); > + } > + > + /* Select M_OSC as DPLL parent */ > + err = clk_set_parent_by_clk(sc->clk_fck, sys_clkin); > + if (err != 0) { > + device_printf(dev, "Cant set mux to CLK_M_OSC\n"); > + return (ENXIO); > + } > + > /* Enable clocks and power on the device. */ > - if ((timer_id = ti_hwmods_get_clock(dev)) == INVALID_CLK_IDENT) > + err = ti_sysc_clock_enable(device_get_parent(dev)); > + if (err != 0) { > + device_printf(dev, "Cant enable sysc clkctrl, err %d\n", err); > return (ENXIO); > - if ((err = ti_prcm_clk_set_source(timer_id, SYSCLK_CLK)) != 0) > - return (err); > - if ((err = ti_prcm_clk_enable(timer_id)) != 0) > - return (err); > + } > > + /* Get the base clock frequency. */ > + err = clk_get_freq(sc->clk_fck, &sc->sysclk_freq); > + if (err != 0) { > + device_printf(dev, "Cant get sysclk frequency, err %d\n", err); > + return (ENXIO); > + } > /* Request the memory resources. */ > sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, > &sc->mem_rid, RF_ACTIVE); > @@ -442,10 +523,6 @@ dmtpps_attach(device_t dev) > return (ENXIO); > } > > - /* Figure out which hardware timer this is and set the name string. */ > - sc->tmr_num = ti_hwmods_get_unit(dev, "timer"); > - snprintf(sc->tmr_name, sizeof(sc->tmr_name), "DMTimer%d", sc->tmr_num); > - > /* > * Configure the timer pulse/capture pin to input/capture mode. This is > * required in addition to configuring the pin as input with the pinmux > @@ -468,7 +545,7 @@ dmtpps_attach(device_t dev) > sc->tc.tc_name = sc->tmr_name; > sc->tc.tc_get_timecount = dmtpps_get_timecount; > sc->tc.tc_counter_mask = ~0u; > - sc->tc.tc_frequency = sysclk_freq; > + sc->tc.tc_frequency = sc->sysclk_freq; > sc->tc.tc_quality = 1000; > sc->tc.tc_priv = sc; > > @@ -541,5 +618,4 @@ static driver_t dmtpps_driver = { > static devclass_t dmtpps_devclass; > > DRIVER_MODULE(am335x_dmtpps, simplebus, dmtpps_driver, dmtpps_devclass, 0, > 0); > -MODULE_DEPEND(am335x_dmtpps, am335x_prcm, 1, 1, 1); > - > +MODULE_DEPEND(am335x_dmtpps, ti_sysc, 1, 1, 1); > > Modified: head/sys/arm/ti/am335x/am335x_dmtreg.h > ============================================================================== > --- head/sys/arm/ti/am335x/am335x_dmtreg.h Thu Jul 30 14:42:50 > 2020 (r363699) > +++ head/sys/arm/ti/am335x/am335x_dmtreg.h Thu Jul 30 14:45:05 > 2020 (r363700) > @@ -73,4 +73,16 @@ > #define DMT_TSICR_RESET (1 << 1) /* TSICR perform soft reset */ > #define DMT_TCAR2 0x48 /* Capture Reg */ > > +/* Location of revision register from TRM Memory map chapter 2 */ > +/* L4_WKUP */ > +#define DMTIMER0_REV 0x05000 > +#define DMTIMER1_1MS_REV 0x31000 > +/* L4_PER */ > +#define DMTIMER2_REV 0x40000 > +#define DMTIMER3_REV 0x42000 > +#define DMTIMER4_REV 0x44000 > +#define DMTIMER5_REV 0x46000 > +#define DMTIMER6_REV 0x48000 > +#define DMTIMER7_REV 0x4A000 > + > #endif /* AM335X_DMTREG_H */ > > Modified: head/sys/arm/ti/am335x/am335x_gpio.c > ============================================================================== > --- head/sys/arm/ti/am335x/am335x_gpio.c Thu Jul 30 14:42:50 2020 (r363699) > +++ head/sys/arm/ti/am335x/am335x_gpio.c Thu Jul 30 14:45:05 2020 (r363700) > @@ -155,3 +155,4 @@ DEFINE_CLASS_1(gpio, am335x_gpio_driver, am335x_gpio_m > sizeof(struct ti_gpio_softc), ti_gpio_driver); > DRIVER_MODULE(am335x_gpio, simplebus, am335x_gpio_driver, > am335x_gpio_devclass, > 0, 0); > +MODULE_DEPEND(am335x_gpio, ti_sysc, 1, 1, 1); > > Modified: head/sys/arm/ti/am335x/am335x_lcd.c > ============================================================================== > --- head/sys/arm/ti/am335x/am335x_lcd.c Thu Jul 30 14:42:50 2020 (r363699) > +++ head/sys/arm/ti/am335x/am335x_lcd.c Thu Jul 30 14:45:05 2020 (r363700) > @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); > > #include > > +#include > + > #include > #include > #include > @@ -65,7 +67,7 @@ __FBSDID("$FreeBSD$"); > #include > #endif > > -#include > +#include > #include > > #include "am335x_lcd.h" > @@ -219,6 +221,9 @@ struct am335x_lcd_softc { > /* HDMI framer */ > phandle_t sc_hdmi_framer; > eventhandler_tag sc_hdmi_evh; > + > + /* Clock */ > + clk_t sc_clk_dpll_disp_ck; > }; > > static void > @@ -615,24 +620,28 @@ am335x_lcd_configure(struct am335x_lcd_softc *sc) > uint32_t hbp, hfp, hsw; > uint32_t vbp, vfp, vsw; > uint32_t width, height; > - unsigned int ref_freq; > + uint64_t ref_freq; > int err; > > /* > * try to adjust clock to get double of requested frequency > * HDMI/DVI displays are very sensitive to error in frequncy value > */ > - if (ti_prcm_clk_set_source_freq(LCDC_CLK, sc->sc_panel.panel_pxl_clk*2)) > { > + > + err = clk_set_freq(sc->sc_clk_dpll_disp_ck, sc->sc_panel.panel_pxl_clk*2, > + CLK_SET_ROUND_ANY); > + if (err != 0) { > device_printf(sc->sc_dev, "can't set source frequency\n"); > return (ENXIO); > } > > - if (ti_prcm_clk_get_source_freq(LCDC_CLK, &ref_freq)) { > + err = clk_get_freq(sc->sc_clk_dpll_disp_ck, &ref_freq); > + if (err != 0) { > device_printf(sc->sc_dev, "can't get reference frequency\n"); > return (ENXIO); > } > > - /* Panle initialization */ > + /* Panel initialization */ > dma_size = > round_page(sc->sc_panel.panel_width*sc->sc_panel.panel_height*sc->sc_panel.bpp/8); > > /* > @@ -967,6 +976,13 @@ am335x_lcd_attach(device_t dev) > return (ENXIO); > } > > + /* Fixme: Cant find any reference in DTS for dpll_disp_ck@498 for now. */ > + err = clk_get_by_name(dev, "dpll_disp_ck@498", &sc->sc_clk_dpll_disp_ck); > + if (err != 0) { > + device_printf(dev, "Cant get dpll_disp_ck@49\n"); > + return (ENXIO); > + } > + > sc->sc_panel.ac_bias = 255; > sc->sc_panel.ac_bias_intrpt = 0; > sc->sc_panel.dma_burst_sz = 16; > @@ -989,7 +1005,11 @@ am335x_lcd_attach(device_t dev) > } > } > > - ti_prcm_clk_enable(LCDC_CLK); > + err = ti_sysc_clock_enable(device_get_parent(dev)); > + if (err != 0) { > + device_printf(dev, "Failed to enable sysc clkctrl, err %d\n", err); > + return (ENXIO); > + } > > rid = 0; > sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, > @@ -1081,3 +1101,4 @@ static devclass_t am335x_lcd_devclass; > DRIVER_MODULE(am335x_lcd, simplebus, am335x_lcd_driver, > am335x_lcd_devclass, 0, 0); > MODULE_VERSION(am335x_lcd, 1); > MODULE_DEPEND(am335x_lcd, simplebus, 1, 1, 1); > +MODULE_DEPEND(am335x_lcd, ti_sysc, 1, 1, 1); > > Modified: head/sys/arm/ti/am335x/am335x_musb.c > ============================================================================== > --- head/sys/arm/ti/am335x/am335x_musb.c Thu Jul 30 14:42:50 2020 (r363699) > +++ head/sys/arm/ti/am335x/am335x_musb.c Thu Jul 30 14:45:05 2020 (r363700) > @@ -66,9 +66,11 @@ __FBSDID("$FreeBSD$"); > > #include > > -#include > -#include > #include > +#include > +#include > +#include > +#include "syscon_if.h" > > #define USBCTRL_REV 0x00 > #define USBCTRL_CTRL 0x14 > @@ -130,6 +132,7 @@ struct musbotg_super_softc { > struct musbotg_softc sc_otg; > struct resource *sc_mem_res[2]; > int sc_irq_rid; > + struct syscon *syscon; > }; > > static void > @@ -155,30 +158,33 @@ static void > musbotg_clocks_on(void *arg) > { > struct musbotg_softc *sc; > - uint32_t c, reg; > + struct musbotg_super_softc *ssc; > + uint32_t reg; > > sc = arg; > - reg = USB_CTRL[sc->sc_id]; > + ssc = sc->sc_platform_data; > > - ti_scm_reg_read_4(reg, &c); > - c &= ~3; /* Enable power */ > - c |= 1 << 19; /* VBUS detect enable */ > - c |= 1 << 20; /* Session end enable */ > - ti_scm_reg_write_4(reg, c); > + reg = SYSCON_READ_4(ssc->syscon, USB_CTRL[sc->sc_id]); > + reg &= ~3; /* Enable power */ > + reg |= 1 << 19; /* VBUS detect enable */ > + reg |= 1 << 20; /* Session end enable */ > + > + SYSCON_WRITE_4(ssc->syscon, USB_CTRL[sc->sc_id], reg); > } > > static void > musbotg_clocks_off(void *arg) > { > struct musbotg_softc *sc; > - uint32_t c, reg; > + struct musbotg_super_softc *ssc; > + uint32_t reg; > > sc = arg; > - reg = USB_CTRL[sc->sc_id]; > + ssc = sc->sc_platform_data; > > /* Disable power to PHY */ > - ti_scm_reg_read_4(reg, &c); > - ti_scm_reg_write_4(reg, c | 3); > + reg = SYSCON_READ_4(ssc->syscon, USB_CTRL[sc->sc_id]); > + SYSCON_WRITE_4(ssc->syscon, USB_CTRL[sc->sc_id], reg | 3); > } > > static void > @@ -241,9 +247,42 @@ musbotg_attach(device_t dev) > char mode[16]; > int err; > uint32_t reg; > + phandle_t opp_table; > + clk_t clk_usbotg_fck; > > sc->sc_otg.sc_id = device_get_unit(dev); > > + /* FIXME: The devicetree needs to be updated to get a handle to the gate > + * usbotg_fck@47c. see TRM 8.1.12.2 CM_WKUP CM_CLKDCOLDO_DPLL_PER. > + */ > + err = clk_get_by_name(dev, "usbotg_fck@47c", &clk_usbotg_fck); > + if (err) { > + device_printf(dev, "Can not find usbotg_fck@47c\n"); > + return (ENXIO); > + } > + > + err = clk_enable(clk_usbotg_fck); > + if (err) { > + device_printf(dev, "Can not enable usbotg_fck@47c\n"); > + return (ENXIO); > + } > + > + /* FIXME: For now; Go and kidnap syscon from opp-table */ > + opp_table = OF_finddevice("/opp-table"); > + if (opp_table == -1) { > + device_printf(dev, "Cant find /opp-table\n"); > + return (ENXIO); > + } > + if (!OF_hasprop(opp_table, "syscon")) { > + device_printf(dev, "/opp-table missing syscon property\n"); > + return (ENXIO); > + } > + err = syscon_get_by_ofw_property(dev, opp_table, "syscon", &sc->syscon); > + if (err) { > + device_printf(dev, "Failed to get syscon\n"); > + return (ENXIO); > + } > + > /* Request the memory resources */ > err = bus_alloc_resources(dev, am335x_musbotg_mem_spec, > sc->sc_mem_res); > @@ -417,5 +456,7 @@ static driver_t musbotg_driver = { > > static devclass_t musbotg_devclass; > > -DRIVER_MODULE(musbotg, usbss, musbotg_driver, musbotg_devclass, 0, 0); > -MODULE_DEPEND(musbotg, usbss, 1, 1, 1); > +DRIVER_MODULE(musbotg, ti_sysc, musbotg_driver, musbotg_devclass, 0, 0); > +MODULE_DEPEND(musbotg, ti_sysc, 1, 1, 1); > +MODULE_DEPEND(musbotg, ti_am3359_cppi41, 1, 1, 1); > +MODULE_DEPEND(usbss, usb, 1, 1, 1); > > Modified: head/sys/arm/ti/am335x/am335x_pwmss.c > ============================================================================== > --- head/sys/arm/ti/am335x/am335x_pwmss.c Thu Jul 30 14:42:50 > 2020 (r363699) > +++ head/sys/arm/ti/am335x/am335x_pwmss.c Thu Jul 30 14:45:05 > 2020 (r363700) > @@ -46,10 +46,11 @@ __FBSDID("$FreeBSD$"); > #include > #include > > -#include > -#include > -#include > +#include > > +#include > +#include "syscon_if.h" > + > #include "am335x_pwm.h" > #include "am335x_scm.h" > > @@ -59,6 +60,11 @@ __FBSDID("$FreeBSD$"); > #define CLKCONFIG_EPWMCLK_EN (1 << 8) > #define PWMSS_CLKSTATUS 0x0C > > +/* TRM chapter 2 memory map table 2-3 + VER register location */ > +#define PWMSS_REV_0 0x0000 > +#define PWMSS_REV_1 0x2000 > +#define PWMSS_REV_2 0x4000 > + > static device_probe_t am335x_pwmss_probe; > static device_attach_t am335x_pwmss_attach; > static device_detach_t am335x_pwmss_detach; > @@ -66,7 +72,7 @@ static device_detach_t am335x_pwmss_detach; > struct am335x_pwmss_softc { > struct simplebus_softc sc_simplebus; > device_t sc_dev; > - clk_ident_t sc_clk; > + struct syscon *syscon; > }; > > static device_method_t am335x_pwmss_methods[] = { > @@ -97,36 +103,45 @@ am335x_pwmss_attach(device_t dev) > { > struct am335x_pwmss_softc *sc; > uint32_t reg, id; > - phandle_t node; > + uint64_t rev_address; > + phandle_t node, opp_table; > > sc = device_get_softc(dev); > sc->sc_dev = dev; > > - sc->sc_clk = ti_hwmods_get_clock(dev); > - if (sc->sc_clk == INVALID_CLK_IDENT) { > - device_printf(dev, "failed to get device id based on ti,hwmods\n"); > - return (EINVAL); > + /* FIXME: For now; Go and kidnap syscon from opp-table */ > + opp_table = OF_finddevice("/opp-table"); > + if (opp_table == -1) { > + device_printf(dev, "Cant find /opp-table\n"); > + return (ENXIO); > } > + if (!OF_hasprop(opp_table, "syscon")) { > + device_printf(dev, "/opp-table doesnt have required syscon property\n"); > + return (ENXIO); > + } > + if (syscon_get_by_ofw_property(dev, opp_table, "syscon", &sc->syscon) != > 0) { > + device_printf(dev, "Failed to get syscon\n"); > + return (ENXIO); > + } > > - ti_prcm_clk_enable(sc->sc_clk); > - ti_scm_reg_read_4(SCM_PWMSS_CTRL, ®); > - switch (sc->sc_clk) { > - case PWMSS0_CLK: > - id = 0; > - break; > - case PWMSS1_CLK: > - id = 1; > - break; > + ti_sysc_clock_enable(device_get_parent(dev)); > > - case PWMSS2_CLK: > - id = 2; > - break; > - default: > - device_printf(dev, "unknown pwmss clock id: %d\n", sc->sc_clk); > - return (EINVAL); > + rev_address = ti_sysc_get_rev_address(device_get_parent(dev)); > + switch (rev_address) { > + case PWMSS_REV_0: > + id = 0; > + break; > + case PWMSS_REV_1: > + id = 1; > + break; > + case PWMSS_REV_2: > + id = 2; > + break; > } > + > + reg = SYSCON_READ_4(sc->syscon, SCM_PWMSS_CTRL); > reg |= (1 << id); > - ti_scm_reg_write_4(SCM_PWMSS_CTRL, reg); > + SYSCON_WRITE_4(sc->syscon, SCM_PWMSS_CTRL, reg); > > node = ofw_bus_get_node(dev); > > @@ -161,3 +176,4 @@ DEFINE_CLASS_1(am335x_pwmss, am335x_pwmss_driver, am33 > static devclass_t am335x_pwmss_devclass; > DRIVER_MODULE(am335x_pwmss, simplebus, am335x_pwmss_driver, > am335x_pwmss_devclass, 0, 0); > MODULE_VERSION(am335x_pwmss, 1); > +MODULE_DEPEND(am335x_pwmss, ti_sysc, 1, 1, 1); > > Modified: head/sys/arm/ti/am335x/am335x_rtc.c > ============================================================================== > --- head/sys/arm/ti/am335x/am335x_rtc.c Thu Jul 30 14:42:50 2020 (r363699) > +++ head/sys/arm/ti/am335x/am335x_rtc.c Thu Jul 30 14:45:05 2020 (r363700) > @@ -39,8 +39,9 @@ __FBSDID("$FreeBSD$"); > > #include > > +#include > #include > -#include > +#include > #include > #include > > @@ -110,7 +111,7 @@ am335x_rtc_attach(device_t dev) > RTC_LOCK_INIT(sc); > > /* Enable the RTC module. */ > - ti_prcm_clk_enable(RTC_CLK); > + ti_sysc_clock_enable(device_get_parent(dev)); > rev = RTC_READ4(sc, RTC_REVISION); > device_printf(dev, "AM335X RTC v%d.%d.%d\n", > (rev >> 8) & 0x7, (rev >> 6) & 0x3, rev & 0x3f); > @@ -209,3 +210,4 @@ static devclass_t am335x_rtc_devclass; > DRIVER_MODULE(am335x_rtc, simplebus, am335x_rtc_driver, > am335x_rtc_devclass, 0, 0); > MODULE_VERSION(am335x_rtc, 1); > MODULE_DEPEND(am335x_rtc, simplebus, 1, 1, 1); > +MODULE_DEPEND(am335x_rtc, ti_sysc, 1, 1, 1); > > Modified: head/sys/arm/ti/am335x/am335x_scm.c > ============================================================================== > --- head/sys/arm/ti/am335x/am335x_scm.c Thu Jul 30 14:42:50 2020 (r363699) > +++ head/sys/arm/ti/am335x/am335x_scm.c Thu Jul 30 14:45:05 2020 (r363700) > @@ -40,11 +40,15 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#include > +#include "syscon_if.h" > + > #define TZ_ZEROC 2731 > > struct am335x_scm_softc { > int sc_last_temp; > struct sysctl_oid *sc_temp_oid; > + struct syscon *syscon; > }; > > static int > @@ -60,7 +64,7 @@ am335x_scm_temp_sysctl(SYSCTL_HANDLER_ARGS) > > /* Read the temperature and convert to Kelvin. */ > for(i = 50; i > 0; i--) { > - ti_scm_reg_read_4(SCM_BGAP_CTRL, ®); > + reg = SYSCON_READ_4(sc->syscon, SCM_BGAP_CTRL); > if ((reg & SCM_BGAP_EOCZ) == 0) > break; > DELAY(50); > @@ -96,6 +100,9 @@ am335x_scm_identify(driver_t *driver, device_t parent) > static int > am335x_scm_probe(device_t dev) > { > + /* Just allow the first one */ > + if (strcmp(device_get_nameunit(dev), "am335x_scm0") != 0) > + return (ENXIO); > > device_set_desc(dev, "AM335x Control Module Extension"); > > @@ -109,21 +116,40 @@ am335x_scm_attach(device_t dev) > struct sysctl_ctx_list *ctx; > struct sysctl_oid_list *tree; > uint32_t reg; > + phandle_t opp_table; > + int err; > > + sc = device_get_softc(dev); > + > + /* FIXME: For now; Go and kidnap syscon from opp-table */ > + opp_table = OF_finddevice("/opp-table"); > + if (opp_table == -1) { > + device_printf(dev, "Cant find /opp-table\n"); > + return (ENXIO); > + } > + if (!OF_hasprop(opp_table, "syscon")) { > + device_printf(dev, "/opp-table missing syscon property\n"); > + return (ENXIO); > + } > + err = syscon_get_by_ofw_property(dev, opp_table, "syscon", &sc->syscon); > + if (err) { > + device_printf(dev, "Failed to get syscon\n"); > + return (ENXIO); > + } > + > /* Reset the digital outputs. */ > - ti_scm_reg_write_4(SCM_BGAP_CTRL, 0); > - ti_scm_reg_read_4(SCM_BGAP_CTRL, ®); > + SYSCON_WRITE_4(sc->syscon, SCM_BGAP_CTRL, 0); > + reg = SYSCON_READ_4(sc->syscon, SCM_BGAP_CTRL); > DELAY(500); > /* Set continous mode. */ > - ti_scm_reg_write_4(SCM_BGAP_CTRL, SCM_BGAP_CONTCONV); > - ti_scm_reg_read_4(SCM_BGAP_CTRL, ®); > + SYSCON_WRITE_4(sc->syscon, SCM_BGAP_CTRL, SCM_BGAP_CONTCONV); > + reg = SYSCON_READ_4(sc->syscon, SCM_BGAP_CTRL); > DELAY(500); > /* Start the ADC conversion. */ > reg = SCM_BGAP_CLRZ | SCM_BGAP_CONTCONV | SCM_BGAP_SOC; > - ti_scm_reg_write_4(SCM_BGAP_CTRL, reg); > + SYSCON_WRITE_4(sc->syscon, SCM_BGAP_CTRL, reg); > > /* Temperature sysctl. */ > - sc = device_get_softc(dev); > ctx = device_get_sysctl_ctx(dev); > tree = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); > sc->sc_temp_oid = SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, > @@ -145,7 +171,7 @@ am335x_scm_detach(device_t dev) > sysctl_remove_oid(sc->sc_temp_oid, 1, 0); > > /* Stop the bandgap ADC. */ > - ti_scm_reg_write_4(SCM_BGAP_CTRL, SCM_BGAP_BGOFF); > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > -- Mateusz Guzik From owner-svn-src-head@freebsd.org Sat Aug 1 04:57:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57F5036DAC3; Sat, 1 Aug 2020 04:57:31 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJX2M1b5xz4L9K; Sat, 1 Aug 2020 04:57:31 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AD4DD79D; Sat, 1 Aug 2020 04:57:31 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0714vUs7080090; Sat, 1 Aug 2020 04:57:30 GMT (envelope-from gshapiro@FreeBSD.org) Received: (from gshapiro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0714vUvN080089; Sat, 1 Aug 2020 04:57:30 GMT (envelope-from gshapiro@FreeBSD.org) Message-Id: <202008010457.0714vUvN080089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gshapiro set sender to gshapiro@FreeBSD.org using -f From: Gregory Neil Shapiro Date: Sat, 1 Aug 2020 04:57:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363750 - head/share/examples/etc X-SVN-Group: head X-SVN-Commit-Author: gshapiro X-SVN-Commit-Paths: head/share/examples/etc X-SVN-Commit-Revision: 363750 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2020 04:57:31 -0000 Author: gshapiro Date: Sat Aug 1 04:57:30 2020 New Revision: 363750 URL: https://svnweb.freebsd.org/changeset/base/363750 Log: Mirror recommendation from Handbook to avoid linking conflicts when pulling in SASL libraries. PR: 247959 Reported by: Scott Allendorf MFC after: 3 days Modified: head/share/examples/etc/make.conf Modified: head/share/examples/etc/make.conf ============================================================================== --- head/share/examples/etc/make.conf Sat Aug 1 02:21:20 2020 (r363749) +++ head/share/examples/etc/make.conf Sat Aug 1 04:57:30 2020 (r363750) @@ -239,13 +239,11 @@ # # with SASLv1: # SENDMAIL_CFLAGS=-I/usr/local/include/sasl1 -DSASL -# SENDMAIL_LDFLAGS=-L/usr/local/lib -# SENDMAIL_LDADD=-lsasl +# SENDMAIL_LDADD=/usr/local/lib/libsasl.so # # with SASLv2: # SENDMAIL_CFLAGS=-I/usr/local/include -DSASL=2 -# SENDMAIL_LDFLAGS=-L/usr/local/lib -# SENDMAIL_LDADD=-lsasl2 +# SENDMAIL_LDADD=/usr/local/lib/libsasl2.so # # Note: If you are using Cyrus SASL with other applications which require # access to the sasldb file, you should add the following to your From owner-svn-src-head@freebsd.org Sat Aug 1 06:31:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96159370CF5; Sat, 1 Aug 2020 06:31:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJZ7M3VS0z3gqp; Sat, 1 Aug 2020 06:31:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C2C2E542; Sat, 1 Aug 2020 06:31:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0716VxcY041433; Sat, 1 Aug 2020 06:31:59 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0716Vx03041428; Sat, 1 Aug 2020 06:31:59 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008010631.0716Vx03041428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 1 Aug 2020 06:31:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363751 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 363751 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2020 06:31:59 -0000 Author: mjg Date: Sat Aug 1 06:31:58 2020 New Revision: 363751 URL: https://svnweb.freebsd.org/changeset/base/363751 Log: capsicum: move global caps to caprights.h .. for easier inclusion Modified: head/sys/sys/caprights.h head/sys/sys/capsicum.h Modified: head/sys/sys/caprights.h ============================================================================== --- head/sys/sys/caprights.h Sat Aug 1 04:57:30 2020 (r363750) +++ head/sys/sys/caprights.h Sat Aug 1 06:31:58 2020 (r363751) @@ -60,4 +60,52 @@ struct cap_rights { typedef struct cap_rights cap_rights_t; #endif +#ifdef _KERNEL +extern cap_rights_t cap_accept_rights; +extern cap_rights_t cap_bind_rights; +extern cap_rights_t cap_connect_rights; +extern cap_rights_t cap_event_rights; +extern cap_rights_t cap_fchdir_rights; +extern cap_rights_t cap_fchflags_rights; +extern cap_rights_t cap_fchmod_rights; +extern cap_rights_t cap_fchown_rights; +extern cap_rights_t cap_fcntl_rights; +extern cap_rights_t cap_fexecve_rights; +extern cap_rights_t cap_flock_rights; +extern cap_rights_t cap_fpathconf_rights; +extern cap_rights_t cap_fstat_rights; +extern cap_rights_t cap_fstatfs_rights; +extern cap_rights_t cap_fsync_rights; +extern cap_rights_t cap_ftruncate_rights; +extern cap_rights_t cap_futimes_rights; +extern cap_rights_t cap_getpeername_rights; +extern cap_rights_t cap_getsockopt_rights; +extern cap_rights_t cap_getsockname_rights; +extern cap_rights_t cap_ioctl_rights; +extern cap_rights_t cap_linkat_source_rights; +extern cap_rights_t cap_linkat_target_rights; +extern cap_rights_t cap_listen_rights; +extern cap_rights_t cap_mkdirat_rights; +extern cap_rights_t cap_mkfifoat_rights; +extern cap_rights_t cap_mknodat_rights; +extern cap_rights_t cap_mmap_rights; +extern cap_rights_t cap_no_rights; +extern cap_rights_t cap_pdgetpid_rights; +extern cap_rights_t cap_pdkill_rights; +extern cap_rights_t cap_pread_rights; +extern cap_rights_t cap_pwrite_rights; +extern cap_rights_t cap_read_rights; +extern cap_rights_t cap_recv_rights; +extern cap_rights_t cap_renameat_source_rights; +extern cap_rights_t cap_renameat_target_rights; +extern cap_rights_t cap_seek_rights; +extern cap_rights_t cap_send_rights; +extern cap_rights_t cap_send_connect_rights; +extern cap_rights_t cap_setsockopt_rights; +extern cap_rights_t cap_shutdown_rights; +extern cap_rights_t cap_symlinkat_rights; +extern cap_rights_t cap_unlinkat_rights; +extern cap_rights_t cap_write_rights; +#endif + #endif /* !_SYS_CAPRIGHTS_H_ */ Modified: head/sys/sys/capsicum.h ============================================================================== --- head/sys/sys/capsicum.h Sat Aug 1 04:57:30 2020 (r363750) +++ head/sys/sys/capsicum.h Sat Aug 1 06:31:58 2020 (r363751) @@ -419,51 +419,6 @@ __END_DECLS #ifdef _KERNEL #include -extern cap_rights_t cap_accept_rights; -extern cap_rights_t cap_bind_rights; -extern cap_rights_t cap_connect_rights; -extern cap_rights_t cap_event_rights; -extern cap_rights_t cap_fchdir_rights; -extern cap_rights_t cap_fchflags_rights; -extern cap_rights_t cap_fchmod_rights; -extern cap_rights_t cap_fchown_rights; -extern cap_rights_t cap_fcntl_rights; -extern cap_rights_t cap_fexecve_rights; -extern cap_rights_t cap_flock_rights; -extern cap_rights_t cap_fpathconf_rights; -extern cap_rights_t cap_fstat_rights; -extern cap_rights_t cap_fstatfs_rights; -extern cap_rights_t cap_fsync_rights; -extern cap_rights_t cap_ftruncate_rights; -extern cap_rights_t cap_futimes_rights; -extern cap_rights_t cap_getpeername_rights; -extern cap_rights_t cap_getsockopt_rights; -extern cap_rights_t cap_getsockname_rights; -extern cap_rights_t cap_ioctl_rights; -extern cap_rights_t cap_linkat_source_rights; -extern cap_rights_t cap_linkat_target_rights; -extern cap_rights_t cap_listen_rights; -extern cap_rights_t cap_mkdirat_rights; -extern cap_rights_t cap_mkfifoat_rights; -extern cap_rights_t cap_mknodat_rights; -extern cap_rights_t cap_mmap_rights; -extern cap_rights_t cap_no_rights; -extern cap_rights_t cap_pdgetpid_rights; -extern cap_rights_t cap_pdkill_rights; -extern cap_rights_t cap_pread_rights; -extern cap_rights_t cap_pwrite_rights; -extern cap_rights_t cap_read_rights; -extern cap_rights_t cap_recv_rights; -extern cap_rights_t cap_renameat_source_rights; -extern cap_rights_t cap_renameat_target_rights; -extern cap_rights_t cap_seek_rights; -extern cap_rights_t cap_send_rights; -extern cap_rights_t cap_send_connect_rights; -extern cap_rights_t cap_setsockopt_rights; -extern cap_rights_t cap_shutdown_rights; -extern cap_rights_t cap_symlinkat_rights; -extern cap_rights_t cap_unlinkat_rights; -extern cap_rights_t cap_write_rights; #define IN_CAPABILITY_MODE(td) (((td)->td_ucred->cr_flags & CRED_FLAG_CAPMODE) != 0) From owner-svn-src-head@freebsd.org Sat Aug 1 06:32:26 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E576B371003; Sat, 1 Aug 2020 06:32:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJZ7t5sKRz3gsy; Sat, 1 Aug 2020 06:32:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94818E89B; Sat, 1 Aug 2020 06:32:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0716WQbK041499; Sat, 1 Aug 2020 06:32:26 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0716WQVX041497; Sat, 1 Aug 2020 06:32:26 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008010632.0716WQVX041497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 1 Aug 2020 06:32:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363752 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 363752 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2020 06:32:27 -0000 Author: mjg Date: Sat Aug 1 06:32:25 2020 New Revision: 363752 URL: https://svnweb.freebsd.org/changeset/base/363752 Log: vfs: make rights mandatory for NDINIT_ALL Modified: head/sys/kern/vfs_lookup.c head/sys/sys/namei.h Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Sat Aug 1 06:31:58 2020 (r363751) +++ head/sys/kern/vfs_lookup.c Sat Aug 1 06:32:25 2020 (r363752) @@ -1371,6 +1371,7 @@ NDINIT_ALL(struct nameidata *ndp, u_long op, u_long fl struct thread *td) { + MPASS(rightsp != NULL); ndp->ni_cnd.cn_nameiop = op; ndp->ni_cnd.cn_flags = flags; ndp->ni_segflg = segflg; @@ -1380,10 +1381,7 @@ NDINIT_ALL(struct nameidata *ndp, u_long op, u_long fl ndp->ni_resflags = 0; filecaps_init(&ndp->ni_filecaps); ndp->ni_cnd.cn_thread = td; - if (rightsp != NULL) - ndp->ni_rightsneeded = *rightsp; - else - cap_rights_init_zero(&ndp->ni_rightsneeded); + ndp->ni_rightsneeded = *rightsp; } /* Modified: head/sys/sys/namei.h ============================================================================== --- head/sys/sys/namei.h Sat Aug 1 06:31:58 2020 (r363751) +++ head/sys/sys/namei.h Sat Aug 1 06:32:25 2020 (r363752) @@ -188,13 +188,13 @@ int cache_fplookup(struct nameidata *ndp, enum cache_f * Initialization of a nameidata structure. */ #define NDINIT(ndp, op, flags, segflg, namep, td) \ - NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, NULL, 0, td) + NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, NULL, &cap_no_rights, td) #define NDINIT_AT(ndp, op, flags, segflg, namep, dirfd, td) \ - NDINIT_ALL(ndp, op, flags, segflg, namep, dirfd, NULL, 0, td) + NDINIT_ALL(ndp, op, flags, segflg, namep, dirfd, NULL, &cap_no_rights, td) #define NDINIT_ATRIGHTS(ndp, op, flags, segflg, namep, dirfd, rightsp, td) \ NDINIT_ALL(ndp, op, flags, segflg, namep, dirfd, NULL, rightsp, td) #define NDINIT_ATVP(ndp, op, flags, segflg, namep, vp, td) \ - NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, vp, 0, td) + NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, vp, &cap_no_rights, td) void NDINIT_ALL(struct nameidata *ndp, u_long op, u_long flags, enum uio_seg segflg, const char *namep, int dirfd, struct vnode *startdir, From owner-svn-src-head@freebsd.org Sat Aug 1 06:33:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 670D1370FAD; Sat, 1 Aug 2020 06:33:12 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJZ8m27pPz3y12; Sat, 1 Aug 2020 06:33:12 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DAB5EA0A; Sat, 1 Aug 2020 06:33:12 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0716XCgj041614; Sat, 1 Aug 2020 06:33:12 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0716XBSg041613; Sat, 1 Aug 2020 06:33:11 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008010633.0716XBSg041613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 1 Aug 2020 06:33:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363753 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 363753 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2020 06:33:12 -0000 Author: mjg Date: Sat Aug 1 06:33:11 2020 New Revision: 363753 URL: https://svnweb.freebsd.org/changeset/base/363753 Log: vfs: convert ni_rigthsneeded to a pointer Shaves 8 bytes of struct nameidata on 64-bit platforms. Modified: head/sys/kern/vfs_lookup.c head/sys/sys/namei.h Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Sat Aug 1 06:32:25 2020 (r363752) +++ head/sys/kern/vfs_lookup.c Sat Aug 1 06:33:11 2020 (r363753) @@ -347,7 +347,7 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, *dpp = pwd->pwd_cdir; vrefact(*dpp); } else { - rights = ndp->ni_rightsneeded; + rights = *ndp->ni_rightsneeded; cap_rights_set_one(&rights, CAP_LOOKUP); if (cnp->cn_flags & AUDITVNODE1) @@ -403,7 +403,7 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, ndp->ni_beneath_latch = pwd->pwd_cdir; vrefact(ndp->ni_beneath_latch); } else { - rights = ndp->ni_rightsneeded; + rights = *ndp->ni_rightsneeded; cap_rights_set_one(&rights, CAP_LOOKUP); error = fgetvp_rights(td, ndp->ni_dirfd, &rights, &dirfd_caps, &ndp->ni_beneath_latch); @@ -1381,7 +1381,7 @@ NDINIT_ALL(struct nameidata *ndp, u_long op, u_long fl ndp->ni_resflags = 0; filecaps_init(&ndp->ni_filecaps); ndp->ni_cnd.cn_thread = td; - ndp->ni_rightsneeded = *rightsp; + ndp->ni_rightsneeded = rightsp; } /* Modified: head/sys/sys/namei.h ============================================================================== --- head/sys/sys/namei.h Sat Aug 1 06:32:25 2020 (r363752) +++ head/sys/sys/namei.h Sat Aug 1 06:33:11 2020 (r363753) @@ -69,7 +69,7 @@ struct nameidata { */ const char *ni_dirp; /* pathname pointer */ enum uio_seg ni_segflg; /* location of pathname */ - cap_rights_t ni_rightsneeded; /* rights required to look up vnode */ + cap_rights_t *ni_rightsneeded; /* rights required to look up vnode */ /* * Arguments to lookup. */ From owner-svn-src-head@freebsd.org Sat Aug 1 06:33:39 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 861F9370FB4; Sat, 1 Aug 2020 06:33:39 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJZ9H3579z3yCJ; Sat, 1 Aug 2020 06:33:39 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E95CE933; Sat, 1 Aug 2020 06:33:39 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0716XdGi041677; Sat, 1 Aug 2020 06:33:39 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0716XctF041675; Sat, 1 Aug 2020 06:33:38 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008010633.0716XctF041675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 1 Aug 2020 06:33:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363754 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 363754 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2020 06:33:39 -0000 Author: mjg Date: Sat Aug 1 06:33:38 2020 New Revision: 363754 URL: https://svnweb.freebsd.org/changeset/base/363754 Log: vfs: inline NDINIT_ALL The routine takes more than 6 arguments, which on amd64 means some of them have to be passed through the stack. Modified: head/sys/kern/vfs_lookup.c head/sys/sys/namei.h Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Sat Aug 1 06:33:11 2020 (r363753) +++ head/sys/kern/vfs_lookup.c Sat Aug 1 06:33:38 2020 (r363754) @@ -1365,25 +1365,6 @@ bad: return (error); } -void -NDINIT_ALL(struct nameidata *ndp, u_long op, u_long flags, enum uio_seg segflg, - const char *namep, int dirfd, struct vnode *startdir, cap_rights_t *rightsp, - struct thread *td) -{ - - MPASS(rightsp != NULL); - ndp->ni_cnd.cn_nameiop = op; - ndp->ni_cnd.cn_flags = flags; - ndp->ni_segflg = segflg; - ndp->ni_dirp = namep; - ndp->ni_dirfd = dirfd; - ndp->ni_startdir = startdir; - ndp->ni_resflags = 0; - filecaps_init(&ndp->ni_filecaps); - ndp->ni_cnd.cn_thread = td; - ndp->ni_rightsneeded = rightsp; -} - /* * Free data allocated by namei(); see namei(9) for details. */ Modified: head/sys/sys/namei.h ============================================================================== --- head/sys/sys/namei.h Sat Aug 1 06:33:11 2020 (r363753) +++ head/sys/sys/namei.h Sat Aug 1 06:33:38 2020 (r363754) @@ -196,9 +196,22 @@ int cache_fplookup(struct nameidata *ndp, enum cache_f #define NDINIT_ATVP(ndp, op, flags, segflg, namep, vp, td) \ NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, vp, &cap_no_rights, td) -void NDINIT_ALL(struct nameidata *ndp, u_long op, u_long flags, - enum uio_seg segflg, const char *namep, int dirfd, struct vnode *startdir, - cap_rights_t *rightsp, struct thread *td); +#define NDINIT_ALL(ndp, op, flags, segflg, namep, dirfd, startdir, rightsp, td) \ +do { \ + struct nameidata *_ndp = (ndp); \ + cap_rights_t *_rightsp = (rightsp); \ + MPASS(_rightsp != NULL); \ + _ndp->ni_cnd.cn_nameiop = op; \ + _ndp->ni_cnd.cn_flags = flags; \ + _ndp->ni_segflg = segflg; \ + _ndp->ni_dirp = namep; \ + _ndp->ni_dirfd = dirfd; \ + _ndp->ni_startdir = startdir; \ + _ndp->ni_resflags = 0; \ + filecaps_init(&_ndp->ni_filecaps); \ + _ndp->ni_cnd.cn_thread = td; \ + _ndp->ni_rightsneeded = _rightsp; \ +} while (0) #define NDF_NO_DVP_RELE 0x00000001 #define NDF_NO_DVP_UNLOCK 0x00000002 From owner-svn-src-head@freebsd.org Sat Aug 1 06:34:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7CC30370B6B; Sat, 1 Aug 2020 06:34:19 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJZB32ntmz3yWh; Sat, 1 Aug 2020 06:34:19 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43566EA0B; Sat, 1 Aug 2020 06:34:19 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0716YJ4f041757; Sat, 1 Aug 2020 06:34:19 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0716YJ3M041756; Sat, 1 Aug 2020 06:34:19 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008010634.0716YJ3M041756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 1 Aug 2020 06:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363755 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363755 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2020 06:34:19 -0000 Author: mjg Date: Sat Aug 1 06:34:18 2020 New Revision: 363755 URL: https://svnweb.freebsd.org/changeset/base/363755 Log: cache: mark climb_mount as __noinline Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Aug 1 06:33:38 2020 (r363754) +++ head/sys/kern/vfs_cache.c Sat Aug 1 06:34:18 2020 (r363755) @@ -3448,7 +3448,7 @@ cache_fplookup_mp_supported(struct mount *mp) * By the end of successful walk we are guaranteed the reached state was * indeed present at least at some point which matches the regular lookup. */ -static int +static int __noinline cache_fplookup_climb_mount(struct cache_fpl *fpl) { struct mount *mp, *prev_mp; @@ -3457,9 +3457,8 @@ cache_fplookup_climb_mount(struct cache_fpl *fpl) vp = fpl->tvp; vp_seqc = fpl->tvp_seqc; - if (vp->v_type != VDIR) - return (0); + VNPASS(vp->v_type == VDIR || vp->v_type == VBAD, vp); mp = atomic_load_ptr(&vp->v_mountedhere); if (mp == NULL) return (0); @@ -3503,6 +3502,26 @@ cache_fplookup_climb_mount(struct cache_fpl *fpl) return (0); } +static bool +cache_fplookup_need_climb_mount(struct cache_fpl *fpl) +{ + struct mount *mp; + struct vnode *vp; + + vp = fpl->tvp; + + /* + * Hack: while this is a union, the pointer tends to be NULL so save on + * a branch. + */ + mp = atomic_load_ptr(&vp->v_mountedhere); + if (mp == NULL) + return (false); + if (vp->v_type == VDIR) + return (true); + return (false); +} + /* * Parse the path. * @@ -3689,9 +3708,11 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fp VNPASS(!seqc_in_modify(fpl->tvp_seqc), fpl->tvp); - error = cache_fplookup_climb_mount(fpl); - if (__predict_false(error != 0)) { - break; + if (cache_fplookup_need_climb_mount(fpl)) { + error = cache_fplookup_climb_mount(fpl); + if (__predict_false(error != 0)) { + break; + } } VNPASS(!seqc_in_modify(fpl->tvp_seqc), fpl->tvp); From owner-svn-src-head@freebsd.org Sat Aug 1 06:35:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2C0DF370E54; Sat, 1 Aug 2020 06:35:19 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJZCC0N6Qz3yRN; Sat, 1 Aug 2020 06:35:19 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4537EA0C; Sat, 1 Aug 2020 06:35:18 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0716ZIJn041871; Sat, 1 Aug 2020 06:35:18 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0716ZIv8041870; Sat, 1 Aug 2020 06:35:18 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008010635.0716ZIv8041870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 1 Aug 2020 06:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363756 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363756 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2020 06:35:19 -0000 Author: mjg Date: Sat Aug 1 06:35:18 2020 New Revision: 363756 URL: https://svnweb.freebsd.org/changeset/base/363756 Log: cache: reshuffle struct cache_fpl and nameidata_saved Shaves 16 bytes. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Aug 1 06:34:18 2020 (r363755) +++ head/sys/kern/vfs_cache.c Sat Aug 1 06:35:18 2020 (r363756) @@ -2890,24 +2890,24 @@ cache_fpl_handle_root(struct nameidata *ndp, struct vn * need restoring in case fast path lookup fails. */ struct nameidata_saved { - int cn_flags; long cn_namelen; char *cn_nameptr; size_t ni_pathlen; + int cn_flags; }; struct cache_fpl { - int line; - enum cache_fpl_status status; - bool in_smr; struct nameidata *ndp; - struct nameidata_saved snd; struct componentname *cnp; + struct pwd *pwd; struct vnode *dvp; - seqc_t dvp_seqc; struct vnode *tvp; + seqc_t dvp_seqc; seqc_t tvp_seqc; - struct pwd *pwd; + struct nameidata_saved snd; + int line; + enum cache_fpl_status status:8; + bool in_smr; }; static void From owner-svn-src-head@freebsd.org Sat Aug 1 06:37:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3377C371145; Sat, 1 Aug 2020 06:37:27 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJZFg0ck2z3yPy; Sat, 1 Aug 2020 06:37:27 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC9C2E834; Sat, 1 Aug 2020 06:37:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0716bQpD042031; Sat, 1 Aug 2020 06:37:26 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0716bQhW042030; Sat, 1 Aug 2020 06:37:26 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008010637.0716bQhW042030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 1 Aug 2020 06:37:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363757 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 363757 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2020 06:37:27 -0000 Author: mjg Date: Sat Aug 1 06:37:26 2020 New Revision: 363757 URL: https://svnweb.freebsd.org/changeset/base/363757 Log: Bump __FreeBSD_version after making rights mandatory for NDINIT_ALL Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Aug 1 06:35:18 2020 (r363756) +++ head/sys/sys/param.h Sat Aug 1 06:37:26 2020 (r363757) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300102 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300103 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Sat Aug 1 09:06:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57D5F374238; Sat, 1 Aug 2020 09:06:17 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJdYP1gJgz45JJ; Sat, 1 Aug 2020 09:06:17 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C65C106C1; Sat, 1 Aug 2020 09:06:17 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07196G2d038995; Sat, 1 Aug 2020 09:06:16 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07196Gw3038994; Sat, 1 Aug 2020 09:06:16 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202008010906.07196Gw3038994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 1 Aug 2020 09:06:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363758 - head/sys/modules/cpsw X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/modules/cpsw X-SVN-Commit-Revision: 363758 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2020 09:06:17 -0000 Author: mmel Date: Sat Aug 1 09:06:16 2020 New Revision: 363758 URL: https://svnweb.freebsd.org/changeset/base/363758 Log: Add missing dependency for cpsw module. Reported by: mjg MFC with: r363700 Modified: head/sys/modules/cpsw/Makefile Modified: head/sys/modules/cpsw/Makefile ============================================================================== --- head/sys/modules/cpsw/Makefile Sat Aug 1 06:37:26 2020 (r363757) +++ head/sys/modules/cpsw/Makefile Sat Aug 1 09:06:16 2020 (r363758) @@ -3,6 +3,6 @@ .PATH: ${SRCTOP}/sys/arm/ti/cpsw KMOD= if_cpsw -SRCS= if_cpsw.c device_if.h bus_if.h ofw_bus_if.h miibus_if.h +SRCS= if_cpsw.c device_if.h bus_if.h ofw_bus_if.h miibus_if.h syscon_if.h .include From owner-svn-src-head@freebsd.org Sat Aug 1 09:11:03 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 45F713742FC; Sat, 1 Aug 2020 09:11:03 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJdft1fYmz45f5; Sat, 1 Aug 2020 09:11:01 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: by mail-wm1-x344.google.com with SMTP id x5so10324562wmi.2; Sat, 01 Aug 2020 02:11:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:reply-to:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=OEMAo4i1AWTO3Ja4Og8vVm0CDcasC4n/s6doHN4n408=; b=kWSxVcY/PMZQtCf+zmIam8CCXqaWyx/ZUGOX+EoQ0lj6mJFMxYY9fBZbrl/7VrjMhD Ck2fiOY2dyk+qcyWrvrN7CfDs7/XF4zc91Tn8Zu5Cq5B2HVLKaJAcab9SlsaMAZWZ9bz VNLpGWrZkfKwrLbbAXPoU8CZ83bIb1yrym78Dhz1dtLfHPSv7Z3EldImGjU4UDpbhO56 DzK4BXnIoeOkuF4wSVFMfYdnYQMUfKQjSbkcMcWGyIxB115U2VPG7jsWJJGqUwUHwptQ 4jJfoDj+27uoMdzc8ZYLh5c2U7oDA9hfC8hLe4pAKq9N7pD/sqv0mYkEH85BYAWeff8d kfUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:reply-to:subject:to:cc:references :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=OEMAo4i1AWTO3Ja4Og8vVm0CDcasC4n/s6doHN4n408=; b=oytgIIhhwoNwZ1cNJCDAnJMktJ/FRbtv1VR/U18cKUdZyG85QGJAjRbX4VEejcrkC1 eRdwo287KeD0kmzWcEljGHjklnu68RYhxg4TyNo0gzTubIP3MZhPPsQAWZ9N/SpNE/iE wIup8HUxixX10hJrhTi1KlZwJT+ln3udYE6uOFKzrMTYW5eraKTIHKcd21FhCApirUIK 2t0Hn26VU6ifJPAo16gCUlbjbHvYY1W9Z5VZPoRfNKAWWLyIRp5w95OY82DUtlDz76hZ j3aQVmFI0J7plGl+D+8vpWPXSR8eALPOwVhpO+SqQHdm3UlzsTqcU/MjMSGa7Pziy40x ndRw== X-Gm-Message-State: AOAM532VO3jvjH/rP5aaGlBgrw2vWKd1ZaKCSR8oTQzaJd1TCZZ2X3Ea xdiMc1K/MnBHXx2s8iVISojoQzOn X-Google-Smtp-Source: ABdhPJz6w6F5kYd6RV++uRXJzMUR/I6gZEfzA2Porlab33R01E8yC7AqkTsDVG7Fp3w0LzYm3fSVXw== X-Received: by 2002:a1c:1d52:: with SMTP id d79mr7735302wmd.82.1596273059048; Sat, 01 Aug 2020 02:10:59 -0700 (PDT) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id s125sm16128046wmf.14.2020.08.01.02.10.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 01 Aug 2020 02:10:58 -0700 (PDT) Sender: Michal Meloun From: Michal Meloun X-Google-Original-From: Michal Meloun Reply-To: mmel@freebsd.org Subject: Re: svn commit: r363700 - in head/sys: arm/ti arm/ti/am335x arm/ti/clk arm/ti/cpsw arm/ti/omap4 arm/ti/usb dev/uart modules To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202007301445.06UEj5uj062013@repo.freebsd.org> Message-ID: <85d52020-3aff-7210-ace7-12ae19ad5d9a@freebsd.org> Date: Sat, 1 Aug 2020 11:10:58 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BJdft1fYmz45f5 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=kWSxVcY/; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of melounmichal@gmail.com designates 2a00:1450:4864:20::344 as permitted sender) smtp.mailfrom=melounmichal@gmail.com X-Spamd-Result: default: False [-3.90 / 15.00]; HAS_REPLYTO(0.00)[mmel@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.94)[-0.941]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.995]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; SH_EMAIL_DBL_DONT_QUERY_IPS(0.00)[0.0.0.40:email,0.0.1.242:email]; NEURAL_HAM_LONG(-0.96)[-0.963]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DBL_PROHIBIT(0.00)[0.0.0.40:email,0.0.1.242:email]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::344:from]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2020 09:11:03 -0000 Oups, next module dependency on autogenerated header... Fixed in r363758. Thanks for report Michal On 01.08.2020 6:39, Mateusz Guzik wrote: > This breaks tinderbox for several arm kernels. > > On 7/30/20, Michal Meloun wrote: >> Author: mmel >> Date: Thu Jul 30 14:45:05 2020 >> New Revision: 363700 >> URL: https://svnweb.freebsd.org/changeset/base/363700 >> >> Log: >> Move Ti AM335x to dev/extres/clk framework. >> >> Re-implement clocks for these SoC by using now standard extres/clk >> framework. >> This is necessary for future expansion of these. The new implementation >> is (due to the size of the patch) only the initial (minimum) version. >> It will be updated/expanded with a subsequent set of particular patches. >> >> This patch is also not tested on OMAP4 based boards (BeagleBone), >> so all possible issues should be (and will be) fixed by ASAP once >> identified. >> >> Submited by: Oskar Holmlund (oskar.holmlund@ohdata.se) >> Differential Revision: https://reviews.freebsd.org/D25118 >> >> Added: >> head/sys/arm/ti/am335x/am3359_cppi41.c (contents, props changed) >> head/sys/arm/ti/am335x/am335x_usb_phy.c (contents, props changed) >> head/sys/arm/ti/clk/ >> head/sys/arm/ti/clk/clock_common.c (contents, props changed) >> head/sys/arm/ti/clk/clock_common.h (contents, props changed) >> head/sys/arm/ti/clk/ti_clk_clkctrl.c (contents, props changed) >> head/sys/arm/ti/clk/ti_clk_clkctrl.h (contents, props changed) >> head/sys/arm/ti/clk/ti_clk_dpll.c (contents, props changed) >> head/sys/arm/ti/clk/ti_clk_dpll.h (contents, props changed) >> head/sys/arm/ti/clk/ti_clkctrl.c (contents, props changed) >> head/sys/arm/ti/clk/ti_divider_clock.c (contents, props changed) >> head/sys/arm/ti/clk/ti_dpll_clock.c (contents, props changed) >> head/sys/arm/ti/clk/ti_gate_clock.c (contents, props changed) >> head/sys/arm/ti/clk/ti_mux_clock.c (contents, props changed) >> head/sys/arm/ti/ti_omap4_cm.c (contents, props changed) >> head/sys/arm/ti/ti_omap4_cm.h (contents, props changed) >> head/sys/arm/ti/ti_prm.c (contents, props changed) >> head/sys/arm/ti/ti_prm.h (contents, props changed) >> head/sys/arm/ti/ti_scm_syscon.c (contents, props changed) >> head/sys/arm/ti/ti_sysc.h (contents, props changed) >> Deleted: >> head/sys/arm/ti/am335x/am335x_prcm.c >> head/sys/arm/ti/am335x/am335x_usbss.c >> head/sys/arm/ti/ti_hwmods.c >> head/sys/arm/ti/ti_hwmods.h >> Modified: >> head/sys/arm/ti/am335x/am335x_dmtimer.c >> head/sys/arm/ti/am335x/am335x_dmtpps.c >> head/sys/arm/ti/am335x/am335x_dmtreg.h >> head/sys/arm/ti/am335x/am335x_gpio.c >> head/sys/arm/ti/am335x/am335x_lcd.c >> head/sys/arm/ti/am335x/am335x_musb.c >> head/sys/arm/ti/am335x/am335x_pwmss.c >> head/sys/arm/ti/am335x/am335x_rtc.c >> head/sys/arm/ti/am335x/am335x_scm.c >> head/sys/arm/ti/am335x/files.am335x >> head/sys/arm/ti/cpsw/if_cpsw.c >> head/sys/arm/ti/files.ti >> head/sys/arm/ti/omap4/files.omap4 >> head/sys/arm/ti/ti_adc.c >> head/sys/arm/ti/ti_edma3.c >> head/sys/arm/ti/ti_gpio.c >> head/sys/arm/ti/ti_i2c.c >> head/sys/arm/ti/ti_mbox.c >> head/sys/arm/ti/ti_pinmux.c >> head/sys/arm/ti/ti_prcm.c >> head/sys/arm/ti/ti_prcm.h >> head/sys/arm/ti/ti_pruss.c >> head/sys/arm/ti/ti_scm.c >> head/sys/arm/ti/ti_sdhci.c >> head/sys/arm/ti/ti_sdma.c >> head/sys/arm/ti/ti_spi.c >> head/sys/arm/ti/ti_sysc.c >> head/sys/arm/ti/ti_wdt.c >> head/sys/arm/ti/usb/omap_ehci.c >> head/sys/arm/ti/usb/omap_host.c >> head/sys/arm/ti/usb/omap_tll.c >> head/sys/dev/uart/uart_dev_ti8250.c >> head/sys/modules/Makefile >> >> Added: head/sys/arm/ti/am335x/am3359_cppi41.c >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/sys/arm/ti/am335x/am3359_cppi41.c Thu Jul 30 14:45:05 >> 2020 (r363700) >> @@ -0,0 +1,192 @@ >> +/*- >> + * Copyright (c) 2019 Emmanuel Vadot >> + * >> + * Copyright (c) 2020 Oskar Holmlund >> + * >> + * Redistribution and use in source and binary forms, with or without >> + * modification, are permitted provided that the following conditions >> + * are met: >> + * 1. Redistributions of source code must retain the above copyright >> + * notice, this list of conditions and the following disclaimer. >> + * 2. Redistributions in binary form must reproduce the above copyright >> + * notice, this list of conditions and the following disclaimer in the >> + * documentation and/or other materials provided with the distribution. >> + * >> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR >> + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >> WARRANTIES >> + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. >> + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, >> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, >> + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >> + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED >> + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, >> + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY >> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF >> + * SUCH DAMAGE. >> + * >> + * $FreeBSD$ >> + */ >> +/* Based on sys/arm/ti/ti_sysc.c */ >> + >> +#include >> +__FBSDID("$FreeBSD$"); >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#include >> +#include >> + >> +#include >> + >> +#include >> +#include >> +#include >> + >> +#include >> + >> +#if 0 >> +#define DPRINTF(dev, msg...) device_printf(dev, msg) >> +#else >> +#define DPRINTF(dev, msg...) >> +#endif >> + >> +struct ti_am3359_cppi41_softc { >> + device_t dev; >> + struct syscon * syscon; >> + struct resource * res[4]; >> + bus_space_tag_t bst; >> + bus_space_handle_t bsh; >> + struct mtx mtx; >> +}; >> + >> +static struct resource_spec ti_am3359_cppi41_res_spec[] = { >> + { SYS_RES_MEMORY, 0, RF_ACTIVE | RF_SHAREABLE }, >> + { SYS_RES_MEMORY, 1, RF_ACTIVE | RF_SHAREABLE }, >> + { SYS_RES_MEMORY, 2, RF_ACTIVE | RF_SHAREABLE }, >> + { SYS_RES_MEMORY, 3, RF_ACTIVE | RF_SHAREABLE }, >> + { -1, 0 } >> +}; >> + >> +/* Device */ >> +static struct ofw_compat_data compat_data[] = { >> + { "ti,am3359-cppi41", 1 }, >> + { NULL, 0 } >> +}; >> + >> +static int >> +ti_am3359_cppi41_write_4(device_t dev, bus_addr_t addr, uint32_t val) >> +{ >> + struct ti_am3359_cppi41_softc *sc; >> + >> + sc = device_get_softc(dev); >> + DPRINTF(sc->dev, "offset=%lx write %x\n", addr, val); >> + mtx_lock(&sc->mtx); >> + bus_space_write_4(sc->bst, sc->bsh, addr, val); >> + mtx_unlock(&sc->mtx); >> + return (0); >> +} >> + >> +static uint32_t >> +ti_am3359_cppi41_read_4(device_t dev, bus_addr_t addr) >> +{ >> + struct ti_am3359_cppi41_softc *sc; >> + uint32_t val; >> + >> + sc = device_get_softc(dev); >> + >> + mtx_lock(&sc->mtx); >> + val = bus_space_read_4(sc->bst, sc->bsh, addr); >> + mtx_unlock(&sc->mtx); >> + DPRINTF(sc->dev, "offset=%lx Read %x\n", addr, val); >> + return (val); >> +} >> + >> +/* device interface */ >> +static int >> +ti_am3359_cppi41_probe(device_t dev) >> +{ >> + if (!ofw_bus_status_okay(dev)) >> + return (ENXIO); >> + >> + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) >> + return (ENXIO); >> + >> + device_set_desc(dev, "TI AM3359 CPPI 41"); >> + return(BUS_PROBE_DEFAULT); >> +} >> + >> +static int >> +ti_am3359_cppi41_attach(device_t dev) >> +{ >> + struct ti_am3359_cppi41_softc *sc; >> + phandle_t node; >> + uint32_t reg, reset_bit, timeout=10; >> + uint64_t sysc_address; >> + device_t parent; >> + >> + sc = device_get_softc(dev); >> + sc->dev = dev; >> + >> + if (bus_alloc_resources(dev, ti_am3359_cppi41_res_spec, sc->res)) { >> + device_printf(sc->dev, "Cant allocate resources\n"); >> + return (ENXIO); >> + } >> + >> + sc->dev = dev; >> + sc->bst = rman_get_bustag(sc->res[0]); >> + sc->bsh = rman_get_bushandle(sc->res[0]); >> + >> + mtx_init(&sc->mtx, device_get_nameunit(sc->dev), NULL, MTX_DEF); >> + node = ofw_bus_get_node(sc->dev); >> + >> + /* variant of am335x_usbss.c */ >> + DPRINTF(dev, "-- RESET USB --\n"); >> + parent = device_get_parent(dev); >> + reset_bit = ti_sysc_get_soft_reset_bit(parent); >> + if (reset_bit == 0) { >> + DPRINTF(dev, "Dont have reset bit\n"); >> + return (0); >> + } >> + sysc_address = ti_sysc_get_sysc_address_offset_host(parent); >> + DPRINTF(dev, "sysc_address %x\n", sysc_address); >> + ti_am3359_cppi41_write_4(dev, sysc_address, reset_bit); >> + DELAY(100); >> + reg = ti_am3359_cppi41_read_4(dev, sysc_address); >> + if ((reg & reset_bit) && timeout--) { >> + DPRINTF(dev, "Reset still ongoing - wait a little bit longer\n"); >> + DELAY(100); >> + reg = ti_am3359_cppi41_read_4(dev, sysc_address); >> + } >> + if (timeout == 0) >> + device_printf(dev, "USB Reset timeout\n"); >> + >> + return (0); >> +} >> + >> + >> +static device_method_t ti_am3359_cppi41_methods[] = { >> + DEVMETHOD(device_probe, ti_am3359_cppi41_probe), >> + DEVMETHOD(device_attach, ti_am3359_cppi41_attach), >> + >> + DEVMETHOD_END >> +}; >> + >> + >> +DEFINE_CLASS_1(ti_am3359_cppi41, ti_am3359_cppi41_driver, >> + ti_am3359_cppi41_methods,sizeof(struct ti_am3359_cppi41_softc), >> + simplebus_driver); >> + >> +static devclass_t ti_am3359_cppi41_devclass; >> + >> +EARLY_DRIVER_MODULE(ti_am3359_cppi41, simplebus, ti_am3359_cppi41_driver, >> + ti_am3359_cppi41_devclass, 0, 0, BUS_PASS_BUS + >> BUS_PASS_ORDER_MIDDLE); >> +MODULE_VERSION(ti_am3359_cppi41, 1); >> +MODULE_DEPEND(ti_am3359_cppi41, ti_sysc, 1, 1, 1); >> >> Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c >> ============================================================================== >> --- head/sys/arm/ti/am335x/am335x_dmtimer.c Thu Jul 30 14:42:50 >> 2020 (r363699) >> +++ head/sys/arm/ti/am335x/am335x_dmtimer.c Thu Jul 30 14:45:05 >> 2020 (r363700) >> @@ -42,12 +42,13 @@ __FBSDID("$FreeBSD$"); >> >> #include /* For arm_set_delay */ >> >> +#include >> + >> #include >> #include >> #include >> >> -#include >> -#include >> +#include >> >> #include "am335x_dmtreg.h" >> >> @@ -58,7 +59,8 @@ struct am335x_dmtimer_softc { >> int tmr_irq_rid; >> struct resource * tmr_irq_res; >> void *tmr_irq_handler; >> - uint32_t sysclk_freq; >> + clk_t clk_fck; >> + uint64_t sysclk_freq; >> uint32_t tclr; /* Cached TCLR register. */ >> union { >> struct timecounter tc; >> @@ -251,6 +253,7 @@ am335x_dmtimer_probe(device_t dev) >> { >> char strbuf[32]; >> int tmr_num; >> + uint64_t rev_address; >> >> if (!ofw_bus_status_okay(dev)) >> return (ENXIO); >> @@ -259,13 +262,22 @@ am335x_dmtimer_probe(device_t dev) >> return (ENXIO); >> >> /* >> - * Get the hardware unit number (the N from ti,hwmods="timerN"). >> + * Get the hardware unit number from address of rev register. >> * If this isn't the hardware unit we're going to use for either the >> * eventtimer or the timecounter, no point in instantiating the device. >> */ >> - tmr_num = ti_hwmods_get_unit(dev, "timer"); >> - if (tmr_num != ET_TMR_NUM && tmr_num != TC_TMR_NUM) >> - return (ENXIO); >> + rev_address = ti_sysc_get_rev_address(device_get_parent(dev)); >> + switch (rev_address) { >> + case DMTIMER2_REV: >> + tmr_num = 2; >> + break; >> + case DMTIMER3_REV: >> + tmr_num = 3; >> + break; >> + default: >> + /* Not DMTIMER2 or DMTIMER3 */ >> + return (ENXIO); >> + } >> >> snprintf(strbuf, sizeof(strbuf), "AM335x DMTimer%d", tmr_num); >> device_set_desc_copy(dev, strbuf); >> @@ -277,24 +289,47 @@ static int >> am335x_dmtimer_attach(device_t dev) >> { >> struct am335x_dmtimer_softc *sc; >> - clk_ident_t timer_id; >> int err; >> + uint64_t rev_address; >> + clk_t sys_clkin; >> >> sc = device_get_softc(dev); >> sc->dev = dev; >> >> - /* Get the base clock frequency. */ >> - if ((err = ti_prcm_clk_get_source_freq(SYS_CLK, &sc->sysclk_freq)) != 0) >> - return (err); >> + /* expect one clock */ >> + err = clk_get_by_ofw_index(dev, 0, 0, &sc->clk_fck); >> + if (err != 0) { >> + device_printf(dev, "Cant find clock index 0. err: %d\n", err); >> + return (ENXIO); >> + } >> >> + err = clk_get_by_name(dev, "sys_clkin_ck@40", &sys_clkin); >> + if (err != 0) { >> + device_printf(dev, "Cant find sys_clkin_ck@40 err: %d\n", err); >> + return (ENXIO); >> + } >> + >> + /* Select M_OSC as DPLL parent */ >> + err = clk_set_parent_by_clk(sc->clk_fck, sys_clkin); >> + if (err != 0) { >> + device_printf(dev, "Cant set mux to CLK_M_OSC\n"); >> + return (ENXIO); >> + } >> + >> /* Enable clocks and power on the device. */ >> - if ((timer_id = ti_hwmods_get_clock(dev)) == INVALID_CLK_IDENT) >> + err = ti_sysc_clock_enable(device_get_parent(dev)); >> + if (err != 0) { >> + device_printf(dev, "Cant enable sysc clkctrl, err %d\n", err); >> return (ENXIO); >> - if ((err = ti_prcm_clk_set_source(timer_id, SYSCLK_CLK)) != 0) >> - return (err); >> - if ((err = ti_prcm_clk_enable(timer_id)) != 0) >> - return (err); >> + } >> >> + /* Get the base clock frequency. */ >> + err = clk_get_freq(sc->clk_fck, &sc->sysclk_freq); >> + if (err != 0) { >> + device_printf(dev, "Cant get sysclk frequency, err %d\n", err); >> + return (ENXIO); >> + } >> + >> /* Request the memory resources. */ >> sc->tmr_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, >> &sc->tmr_mem_rid, RF_ACTIVE); >> @@ -302,7 +337,20 @@ am335x_dmtimer_attach(device_t dev) >> return (ENXIO); >> } >> >> - sc->tmr_num = ti_hwmods_get_unit(dev, "timer"); >> + rev_address = ti_sysc_get_rev_address(device_get_parent(dev)); >> + switch (rev_address) { >> + case DMTIMER2_REV: >> + sc->tmr_num = 2; >> + break; >> + case DMTIMER3_REV: >> + sc->tmr_num = 3; >> + break; >> + default: >> + device_printf(dev, "Not timer 2 or 3! %#jx\n", >> + rev_address); >> + return (ENXIO); >> + } >> + >> snprintf(sc->tmr_name, sizeof(sc->tmr_name), "DMTimer%d", sc->tmr_num); >> >> /* >> @@ -334,7 +382,7 @@ static driver_t am335x_dmtimer_driver = { >> static devclass_t am335x_dmtimer_devclass; >> >> DRIVER_MODULE(am335x_dmtimer, simplebus, am335x_dmtimer_driver, >> am335x_dmtimer_devclass, 0, 0); >> -MODULE_DEPEND(am335x_dmtimer, am335x_prcm, 1, 1, 1); >> +MODULE_DEPEND(am335x_dmtimer, ti_sysc, 1, 1, 1); >> >> static void >> am335x_dmtimer_delay(int usec, void *arg) >> >> Modified: head/sys/arm/ti/am335x/am335x_dmtpps.c >> ============================================================================== >> --- head/sys/arm/ti/am335x/am335x_dmtpps.c Thu Jul 30 14:42:50 >> 2020 (r363699) >> +++ head/sys/arm/ti/am335x/am335x_dmtpps.c Thu Jul 30 14:45:05 >> 2020 (r363700) >> @@ -43,6 +43,8 @@ >> #include >> __FBSDID("$FreeBSD$"); >> >> +#include "opt_platform.h" >> + >> #include >> #include >> #include >> @@ -60,9 +62,9 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> +#include >> >> -#include >> -#include >> +#include >> #include >> #include >> >> @@ -82,6 +84,8 @@ struct dmtpps_softc { >> struct cdev * pps_cdev; >> struct pps_state pps_state; >> struct mtx pps_mtx; >> + clk_t clk_fck; >> + uint64_t sysclk_freq; >> }; >> >> static int dmtpps_tmr_num; /* Set by probe() */ >> @@ -383,6 +387,7 @@ dmtpps_probe(device_t dev) >> { >> char strbuf[64]; >> int tmr_num; >> + uint64_t rev_address; >> >> if (!ofw_bus_status_okay(dev)) >> return (ENXIO); >> @@ -402,7 +407,33 @@ dmtpps_probe(device_t dev) >> * Figure out which hardware timer is being probed and see if it matches >> * the configured timer number determined earlier. >> */ >> - tmr_num = ti_hwmods_get_unit(dev, "timer"); >> + rev_address = ti_sysc_get_rev_address(device_get_parent(dev)); >> + switch (rev_address) { >> + case DMTIMER1_1MS_REV: >> + tmr_num = 1; >> + break; >> + case DMTIMER2_REV: >> + tmr_num = 2; >> + break; >> + case DMTIMER3_REV: >> + tmr_num = 3; >> + break; >> + case DMTIMER4_REV: >> + tmr_num = 4; >> + break; >> + case DMTIMER5_REV: >> + tmr_num = 5; >> + break; >> + case DMTIMER6_REV: >> + tmr_num = 6; >> + break; >> + case DMTIMER7_REV: >> + tmr_num = 7; >> + break; >> + default: >> + return (ENXIO); >> + } >> + >> if (dmtpps_tmr_num != tmr_num) >> return (ENXIO); >> >> @@ -418,23 +449,73 @@ dmtpps_attach(device_t dev) >> { >> struct dmtpps_softc *sc; >> struct make_dev_args mda; >> - clk_ident_t timer_id; >> - int err, sysclk_freq; >> + int err; >> + clk_t sys_clkin; >> + uint64_t rev_address; >> >> sc = device_get_softc(dev); >> sc->dev = dev; >> >> - /* Get the base clock frequency. */ >> - err = ti_prcm_clk_get_source_freq(SYS_CLK, &sysclk_freq); >> + /* Figure out which hardware timer this is and set the name string. */ >> + rev_address = ti_sysc_get_rev_address(device_get_parent(dev)); >> + switch (rev_address) { >> + case DMTIMER1_1MS_REV: >> + sc->tmr_num = 1; >> + break; >> + case DMTIMER2_REV: >> + sc->tmr_num = 2; >> + break; >> + case DMTIMER3_REV: >> + sc->tmr_num = 3; >> + break; >> + case DMTIMER4_REV: >> + sc->tmr_num = 4; >> + break; >> + case DMTIMER5_REV: >> + sc->tmr_num = 5; >> + break; >> + case DMTIMER6_REV: >> + sc->tmr_num = 6; >> + break; >> + case DMTIMER7_REV: >> + sc->tmr_num = 7; >> + break; >> + } >> + snprintf(sc->tmr_name, sizeof(sc->tmr_name), "DMTimer%d", sc->tmr_num); >> >> + /* expect one clock */ >> + err = clk_get_by_ofw_index(dev, 0, 0, &sc->clk_fck); >> + if (err != 0) { >> + device_printf(dev, "Cant find clock index 0. err: %d\n", err); >> + return (ENXIO); >> + } >> + >> + err = clk_get_by_name(dev, "sys_clkin_ck@40", &sys_clkin); >> + if (err != 0) { >> + device_printf(dev, "Cant find sys_clkin_ck@40 err: %d\n", err); >> + return (ENXIO); >> + } >> + >> + /* Select M_OSC as DPLL parent */ >> + err = clk_set_parent_by_clk(sc->clk_fck, sys_clkin); >> + if (err != 0) { >> + device_printf(dev, "Cant set mux to CLK_M_OSC\n"); >> + return (ENXIO); >> + } >> + >> /* Enable clocks and power on the device. */ >> - if ((timer_id = ti_hwmods_get_clock(dev)) == INVALID_CLK_IDENT) >> + err = ti_sysc_clock_enable(device_get_parent(dev)); >> + if (err != 0) { >> + device_printf(dev, "Cant enable sysc clkctrl, err %d\n", err); >> return (ENXIO); >> - if ((err = ti_prcm_clk_set_source(timer_id, SYSCLK_CLK)) != 0) >> - return (err); >> - if ((err = ti_prcm_clk_enable(timer_id)) != 0) >> - return (err); >> + } >> >> + /* Get the base clock frequency. */ >> + err = clk_get_freq(sc->clk_fck, &sc->sysclk_freq); >> + if (err != 0) { >> + device_printf(dev, "Cant get sysclk frequency, err %d\n", err); >> + return (ENXIO); >> + } >> /* Request the memory resources. */ >> sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, >> &sc->mem_rid, RF_ACTIVE); >> @@ -442,10 +523,6 @@ dmtpps_attach(device_t dev) >> return (ENXIO); >> } >> >> - /* Figure out which hardware timer this is and set the name string. */ >> - sc->tmr_num = ti_hwmods_get_unit(dev, "timer"); >> - snprintf(sc->tmr_name, sizeof(sc->tmr_name), "DMTimer%d", sc->tmr_num); >> - >> /* >> * Configure the timer pulse/capture pin to input/capture mode. This is >> * required in addition to configuring the pin as input with the pinmux >> @@ -468,7 +545,7 @@ dmtpps_attach(device_t dev) >> sc->tc.tc_name = sc->tmr_name; >> sc->tc.tc_get_timecount = dmtpps_get_timecount; >> sc->tc.tc_counter_mask = ~0u; >> - sc->tc.tc_frequency = sysclk_freq; >> + sc->tc.tc_frequency = sc->sysclk_freq; >> sc->tc.tc_quality = 1000; >> sc->tc.tc_priv = sc; >> >> @@ -541,5 +618,4 @@ static driver_t dmtpps_driver = { >> static devclass_t dmtpps_devclass; >> >> DRIVER_MODULE(am335x_dmtpps, simplebus, dmtpps_driver, dmtpps_devclass, 0, >> 0); >> -MODULE_DEPEND(am335x_dmtpps, am335x_prcm, 1, 1, 1); >> - >> +MODULE_DEPEND(am335x_dmtpps, ti_sysc, 1, 1, 1); >> >> Modified: head/sys/arm/ti/am335x/am335x_dmtreg.h >> ============================================================================== >> --- head/sys/arm/ti/am335x/am335x_dmtreg.h Thu Jul 30 14:42:50 >> 2020 (r363699) >> +++ head/sys/arm/ti/am335x/am335x_dmtreg.h Thu Jul 30 14:45:05 >> 2020 (r363700) >> @@ -73,4 +73,16 @@ >> #define DMT_TSICR_RESET (1 << 1) /* TSICR perform soft reset */ >> #define DMT_TCAR2 0x48 /* Capture Reg */ >> >> +/* Location of revision register from TRM Memory map chapter 2 */ >> +/* L4_WKUP */ >> +#define DMTIMER0_REV 0x05000 >> +#define DMTIMER1_1MS_REV 0x31000 >> +/* L4_PER */ >> +#define DMTIMER2_REV 0x40000 >> +#define DMTIMER3_REV 0x42000 >> +#define DMTIMER4_REV 0x44000 >> +#define DMTIMER5_REV 0x46000 >> +#define DMTIMER6_REV 0x48000 >> +#define DMTIMER7_REV 0x4A000 >> + >> #endif /* AM335X_DMTREG_H */ >> >> Modified: head/sys/arm/ti/am335x/am335x_gpio.c >> ============================================================================== >> --- head/sys/arm/ti/am335x/am335x_gpio.c Thu Jul 30 14:42:50 2020 (r363699) >> +++ head/sys/arm/ti/am335x/am335x_gpio.c Thu Jul 30 14:45:05 2020 (r363700) >> @@ -155,3 +155,4 @@ DEFINE_CLASS_1(gpio, am335x_gpio_driver, am335x_gpio_m >> sizeof(struct ti_gpio_softc), ti_gpio_driver); >> DRIVER_MODULE(am335x_gpio, simplebus, am335x_gpio_driver, >> am335x_gpio_devclass, >> 0, 0); >> +MODULE_DEPEND(am335x_gpio, ti_sysc, 1, 1, 1); >> >> Modified: head/sys/arm/ti/am335x/am335x_lcd.c >> ============================================================================== >> --- head/sys/arm/ti/am335x/am335x_lcd.c Thu Jul 30 14:42:50 2020 (r363699) >> +++ head/sys/arm/ti/am335x/am335x_lcd.c Thu Jul 30 14:45:05 2020 (r363700) >> @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); >> >> #include >> >> +#include >> + >> #include >> #include >> #include >> @@ -65,7 +67,7 @@ __FBSDID("$FreeBSD$"); >> #include >> #endif >> >> -#include >> +#include >> #include >> >> #include "am335x_lcd.h" >> @@ -219,6 +221,9 @@ struct am335x_lcd_softc { >> /* HDMI framer */ >> phandle_t sc_hdmi_framer; >> eventhandler_tag sc_hdmi_evh; >> + >> + /* Clock */ >> + clk_t sc_clk_dpll_disp_ck; >> }; >> >> static void >> @@ -615,24 +620,28 @@ am335x_lcd_configure(struct am335x_lcd_softc *sc) >> uint32_t hbp, hfp, hsw; >> uint32_t vbp, vfp, vsw; >> uint32_t width, height; >> - unsigned int ref_freq; >> + uint64_t ref_freq; >> int err; >> >> /* >> * try to adjust clock to get double of requested frequency >> * HDMI/DVI displays are very sensitive to error in frequncy value >> */ >> - if (ti_prcm_clk_set_source_freq(LCDC_CLK, sc->sc_panel.panel_pxl_clk*2)) >> { >> + >> + err = clk_set_freq(sc->sc_clk_dpll_disp_ck, sc->sc_panel.panel_pxl_clk*2, >> + CLK_SET_ROUND_ANY); >> + if (err != 0) { >> device_printf(sc->sc_dev, "can't set source frequency\n"); >> return (ENXIO); >> } >> >> - if (ti_prcm_clk_get_source_freq(LCDC_CLK, &ref_freq)) { >> + err = clk_get_freq(sc->sc_clk_dpll_disp_ck, &ref_freq); >> + if (err != 0) { >> device_printf(sc->sc_dev, "can't get reference frequency\n"); >> return (ENXIO); >> } >> >> - /* Panle initialization */ >> + /* Panel initialization */ >> dma_size = >> round_page(sc->sc_panel.panel_width*sc->sc_panel.panel_height*sc->sc_panel.bpp/8); >> >> /* >> @@ -967,6 +976,13 @@ am335x_lcd_attach(device_t dev) >> return (ENXIO); >> } >> >> + /* Fixme: Cant find any reference in DTS for dpll_disp_ck@498 for now. */ >> + err = clk_get_by_name(dev, "dpll_disp_ck@498", &sc->sc_clk_dpll_disp_ck); >> + if (err != 0) { >> + device_printf(dev, "Cant get dpll_disp_ck@49\n"); >> + return (ENXIO); >> + } >> + >> sc->sc_panel.ac_bias = 255; >> sc->sc_panel.ac_bias_intrpt = 0; >> sc->sc_panel.dma_burst_sz = 16; >> @@ -989,7 +1005,11 @@ am335x_lcd_attach(device_t dev) >> } >> } >> >> - ti_prcm_clk_enable(LCDC_CLK); >> + err = ti_sysc_clock_enable(device_get_parent(dev)); >> + if (err != 0) { >> + device_printf(dev, "Failed to enable sysc clkctrl, err %d\n", err); >> + return (ENXIO); >> + } >> >> rid = 0; >> sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, >> @@ -1081,3 +1101,4 @@ static devclass_t am335x_lcd_devclass; >> DRIVER_MODULE(am335x_lcd, simplebus, am335x_lcd_driver, >> am335x_lcd_devclass, 0, 0); >> MODULE_VERSION(am335x_lcd, 1); >> MODULE_DEPEND(am335x_lcd, simplebus, 1, 1, 1); >> +MODULE_DEPEND(am335x_lcd, ti_sysc, 1, 1, 1); >> >> Modified: head/sys/arm/ti/am335x/am335x_musb.c >> ============================================================================== >> --- head/sys/arm/ti/am335x/am335x_musb.c Thu Jul 30 14:42:50 2020 (r363699) >> +++ head/sys/arm/ti/am335x/am335x_musb.c Thu Jul 30 14:45:05 2020 (r363700) >> @@ -66,9 +66,11 @@ __FBSDID("$FreeBSD$"); >> >> #include >> >> -#include >> -#include >> #include >> +#include >> +#include >> +#include >> +#include "syscon_if.h" >> >> #define USBCTRL_REV 0x00 >> #define USBCTRL_CTRL 0x14 >> @@ -130,6 +132,7 @@ struct musbotg_super_softc { >> struct musbotg_softc sc_otg; >> struct resource *sc_mem_res[2]; >> int sc_irq_rid; >> + struct syscon *syscon; >> }; >> >> static void >> @@ -155,30 +158,33 @@ static void >> musbotg_clocks_on(void *arg) >> { >> struct musbotg_softc *sc; >> - uint32_t c, reg; >> + struct musbotg_super_softc *ssc; >> + uint32_t reg; >> >> sc = arg; >> - reg = USB_CTRL[sc->sc_id]; >> + ssc = sc->sc_platform_data; >> >> - ti_scm_reg_read_4(reg, &c); >> - c &= ~3; /* Enable power */ >> - c |= 1 << 19; /* VBUS detect enable */ >> - c |= 1 << 20; /* Session end enable */ >> - ti_scm_reg_write_4(reg, c); >> + reg = SYSCON_READ_4(ssc->syscon, USB_CTRL[sc->sc_id]); >> + reg &= ~3; /* Enable power */ >> + reg |= 1 << 19; /* VBUS detect enable */ >> + reg |= 1 << 20; /* Session end enable */ >> + >> + SYSCON_WRITE_4(ssc->syscon, USB_CTRL[sc->sc_id], reg); >> } >> >> static void >> musbotg_clocks_off(void *arg) >> { >> struct musbotg_softc *sc; >> - uint32_t c, reg; >> + struct musbotg_super_softc *ssc; >> + uint32_t reg; >> >> sc = arg; >> - reg = USB_CTRL[sc->sc_id]; >> + ssc = sc->sc_platform_data; >> >> /* Disable power to PHY */ >> - ti_scm_reg_read_4(reg, &c); >> - ti_scm_reg_write_4(reg, c | 3); >> + reg = SYSCON_READ_4(ssc->syscon, USB_CTRL[sc->sc_id]); >> + SYSCON_WRITE_4(ssc->syscon, USB_CTRL[sc->sc_id], reg | 3); >> } >> >> static void >> @@ -241,9 +247,42 @@ musbotg_attach(device_t dev) >> char mode[16]; >> int err; >> uint32_t reg; >> + phandle_t opp_table; >> + clk_t clk_usbotg_fck; >> >> sc->sc_otg.sc_id = device_get_unit(dev); >> >> + /* FIXME: The devicetree needs to be updated to get a handle to the gate >> + * usbotg_fck@47c. see TRM 8.1.12.2 CM_WKUP CM_CLKDCOLDO_DPLL_PER. >> + */ >> + err = clk_get_by_name(dev, "usbotg_fck@47c", &clk_usbotg_fck); >> + if (err) { >> + device_printf(dev, "Can not find usbotg_fck@47c\n"); >> + return (ENXIO); >> + } >> + >> + err = clk_enable(clk_usbotg_fck); >> + if (err) { >> + device_printf(dev, "Can not enable usbotg_fck@47c\n"); >> + return (ENXIO); >> + } >> + >> + /* FIXME: For now; Go and kidnap syscon from opp-table */ >> + opp_table = OF_finddevice("/opp-table"); >> + if (opp_table == -1) { >> + device_printf(dev, "Cant find /opp-table\n"); >> + return (ENXIO); >> + } >> + if (!OF_hasprop(opp_table, "syscon")) { >> + device_printf(dev, "/opp-table missing syscon property\n"); >> + return (ENXIO); >> + } >> + err = syscon_get_by_ofw_property(dev, opp_table, "syscon", &sc->syscon); >> + if (err) { >> + device_printf(dev, "Failed to get syscon\n"); >> + return (ENXIO); >> + } >> + >> /* Request the memory resources */ >> err = bus_alloc_resources(dev, am335x_musbotg_mem_spec, >> sc->sc_mem_res); >> @@ -417,5 +456,7 @@ static driver_t musbotg_driver = { >> >> static devclass_t musbotg_devclass; >> >> -DRIVER_MODULE(musbotg, usbss, musbotg_driver, musbotg_devclass, 0, 0); >> -MODULE_DEPEND(musbotg, usbss, 1, 1, 1); >> +DRIVER_MODULE(musbotg, ti_sysc, musbotg_driver, musbotg_devclass, 0, 0); >> +MODULE_DEPEND(musbotg, ti_sysc, 1, 1, 1); >> +MODULE_DEPEND(musbotg, ti_am3359_cppi41, 1, 1, 1); >> +MODULE_DEPEND(usbss, usb, 1, 1, 1); >> >> Modified: head/sys/arm/ti/am335x/am335x_pwmss.c >> ============================================================================== >> --- head/sys/arm/ti/am335x/am335x_pwmss.c Thu Jul 30 14:42:50 >> 2020 (r363699) >> +++ head/sys/arm/ti/am335x/am335x_pwmss.c Thu Jul 30 14:45:05 >> 2020 (r363700) >> @@ -46,10 +46,11 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> >> -#include >> -#include >> -#include >> +#include >> >> +#include >> +#include "syscon_if.h" >> + >> #include "am335x_pwm.h" >> #include "am335x_scm.h" >> >> @@ -59,6 +60,11 @@ __FBSDID("$FreeBSD$"); >> #define CLKCONFIG_EPWMCLK_EN (1 << 8) >> #define PWMSS_CLKSTATUS 0x0C >> >> +/* TRM chapter 2 memory map table 2-3 + VER register location */ >> +#define PWMSS_REV_0 0x0000 >> +#define PWMSS_REV_1 0x2000 >> +#define PWMSS_REV_2 0x4000 >> + >> static device_probe_t am335x_pwmss_probe; >> static device_attach_t am335x_pwmss_attach; >> static device_detach_t am335x_pwmss_detach; >> @@ -66,7 +72,7 @@ static device_detach_t am335x_pwmss_detach; >> struct am335x_pwmss_softc { >> struct simplebus_softc sc_simplebus; >> device_t sc_dev; >> - clk_ident_t sc_clk; >> + struct syscon *syscon; >> }; >> >> static device_method_t am335x_pwmss_methods[] = { >> @@ -97,36 +103,45 @@ am335x_pwmss_attach(device_t dev) >> { >> struct am335x_pwmss_softc *sc; >> uint32_t reg, id; >> - phandle_t node; >> + uint64_t rev_address; >> + phandle_t node, opp_table; >> >> sc = device_get_softc(dev); >> sc->sc_dev = dev; >> >> - sc->sc_clk = ti_hwmods_get_clock(dev); >> - if (sc->sc_clk == INVALID_CLK_IDENT) { >> - device_printf(dev, "failed to get device id based on ti,hwmods\n"); >> - return (EINVAL); >> + /* FIXME: For now; Go and kidnap syscon from opp-table */ >> + opp_table = OF_finddevice("/opp-table"); >> + if (opp_table == -1) { >> + device_printf(dev, "Cant find /opp-table\n"); >> + return (ENXIO); >> } >> + if (!OF_hasprop(opp_table, "syscon")) { >> + device_printf(dev, "/opp-table doesnt have required syscon property\n"); >> + return (ENXIO); >> + } >> + if (syscon_get_by_ofw_property(dev, opp_table, "syscon", &sc->syscon) != >> 0) { >> + device_printf(dev, "Failed to get syscon\n"); >> + return (ENXIO); >> + } >> >> - ti_prcm_clk_enable(sc->sc_clk); >> - ti_scm_reg_read_4(SCM_PWMSS_CTRL, ®); >> - switch (sc->sc_clk) { >> - case PWMSS0_CLK: >> - id = 0; >> - break; >> - case PWMSS1_CLK: >> - id = 1; >> - break; >> + ti_sysc_clock_enable(device_get_parent(dev)); >> >> - case PWMSS2_CLK: >> - id = 2; >> - break; >> - default: >> - device_printf(dev, "unknown pwmss clock id: %d\n", sc->sc_clk); >> - return (EINVAL); >> + rev_address = ti_sysc_get_rev_address(device_get_parent(dev)); >> + switch (rev_address) { >> + case PWMSS_REV_0: >> + id = 0; >> + break; >> + case PWMSS_REV_1: >> + id = 1; >> + break; >> + case PWMSS_REV_2: >> + id = 2; >> + break; >> } >> + >> + reg = SYSCON_READ_4(sc->syscon, SCM_PWMSS_CTRL); >> reg |= (1 << id); >> - ti_scm_reg_write_4(SCM_PWMSS_CTRL, reg); >> + SYSCON_WRITE_4(sc->syscon, SCM_PWMSS_CTRL, reg); >> >> node = ofw_bus_get_node(dev); >> >> @@ -161,3 +176,4 @@ DEFINE_CLASS_1(am335x_pwmss, am335x_pwmss_driver, am33 >> static devclass_t am335x_pwmss_devclass; >> DRIVER_MODULE(am335x_pwmss, simplebus, am335x_pwmss_driver, >> am335x_pwmss_devclass, 0, 0); >> MODULE_VERSION(am335x_pwmss, 1); >> +MODULE_DEPEND(am335x_pwmss, ti_sysc, 1, 1, 1); >> >> Modified: head/sys/arm/ti/am335x/am335x_rtc.c >> ============================================================================== >> --- head/sys/arm/ti/am335x/am335x_rtc.c Thu Jul 30 14:42:50 2020 (r363699) >> +++ head/sys/arm/ti/am335x/am335x_rtc.c Thu Jul 30 14:45:05 2020 (r363700) >> @@ -39,8 +39,9 @@ __FBSDID("$FreeBSD$"); >> >> #include >> >> +#include >> #include >> -#include >> +#include >> #include >> #include >> >> @@ -110,7 +111,7 @@ am335x_rtc_attach(device_t dev) >> RTC_LOCK_INIT(sc); >> >> /* Enable the RTC module. */ >> - ti_prcm_clk_enable(RTC_CLK); >> + ti_sysc_clock_enable(device_get_parent(dev)); >> rev = RTC_READ4(sc, RTC_REVISION); >> device_printf(dev, "AM335X RTC v%d.%d.%d\n", >> (rev >> 8) & 0x7, (rev >> 6) & 0x3, rev & 0x3f); >> @@ -209,3 +210,4 @@ static devclass_t am335x_rtc_devclass; >> DRIVER_MODULE(am335x_rtc, simplebus, am335x_rtc_driver, >> am335x_rtc_devclass, 0, 0); >> MODULE_VERSION(am335x_rtc, 1); >> MODULE_DEPEND(am335x_rtc, simplebus, 1, 1, 1); >> +MODULE_DEPEND(am335x_rtc, ti_sysc, 1, 1, 1); >> >> Modified: head/sys/arm/ti/am335x/am335x_scm.c >> ============================================================================== >> --- head/sys/arm/ti/am335x/am335x_scm.c Thu Jul 30 14:42:50 2020 (r363699) >> +++ head/sys/arm/ti/am335x/am335x_scm.c Thu Jul 30 14:45:05 2020 (r363700) >> @@ -40,11 +40,15 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> >> +#include >> +#include "syscon_if.h" >> + >> #define TZ_ZEROC 2731 >> >> struct am335x_scm_softc { >> int sc_last_temp; >> struct sysctl_oid *sc_temp_oid; >> + struct syscon *syscon; >> }; >> >> static int >> @@ -60,7 +64,7 @@ am335x_scm_temp_sysctl(SYSCTL_HANDLER_ARGS) >> >> /* Read the temperature and convert to Kelvin. */ >> for(i = 50; i > 0; i--) { >> - ti_scm_reg_read_4(SCM_BGAP_CTRL, ®); >> + reg = SYSCON_READ_4(sc->syscon, SCM_BGAP_CTRL); >> if ((reg & SCM_BGAP_EOCZ) == 0) >> break; >> DELAY(50); >> @@ -96,6 +100,9 @@ am335x_scm_identify(driver_t *driver, device_t parent) >> static int >> am335x_scm_probe(device_t dev) >> { >> + /* Just allow the first one */ >> + if (strcmp(device_get_nameunit(dev), "am335x_scm0") != 0) >> + return (ENXIO); >> >> device_set_desc(dev, "AM335x Control Module Extension"); >> >> @@ -109,21 +116,40 @@ am335x_scm_attach(device_t dev) >> struct sysctl_ctx_list *ctx; >> struct sysctl_oid_list *tree; >> uint32_t reg; >> + phandle_t opp_table; >> + int err; >> >> + sc = device_get_softc(dev); >> + >> + /* FIXME: For now; Go and kidnap syscon from opp-table */ >> + opp_table = OF_finddevice("/opp-table"); >> + if (opp_table == -1) { >> + device_printf(dev, "Cant find /opp-table\n"); >> + return (ENXIO); >> + } >> + if (!OF_hasprop(opp_table, "syscon")) { >> + device_printf(dev, "/opp-table missing syscon property\n"); >> + return (ENXIO); >> + } >> + err = syscon_get_by_ofw_property(dev, opp_table, "syscon", &sc->syscon); >> + if (err) { >> + device_printf(dev, "Failed to get syscon\n"); >> + return (ENXIO); >> + } >> + >> /* Reset the digital outputs. */ >> - ti_scm_reg_write_4(SCM_BGAP_CTRL, 0); >> - ti_scm_reg_read_4(SCM_BGAP_CTRL, ®); >> + SYSCON_WRITE_4(sc->syscon, SCM_BGAP_CTRL, 0); >> + reg = SYSCON_READ_4(sc->syscon, SCM_BGAP_CTRL); >> DELAY(500); >> /* Set continous mode. */ >> - ti_scm_reg_write_4(SCM_BGAP_CTRL, SCM_BGAP_CONTCONV); >> - ti_scm_reg_read_4(SCM_BGAP_CTRL, ®); >> + SYSCON_WRITE_4(sc->syscon, SCM_BGAP_CTRL, SCM_BGAP_CONTCONV); >> + reg = SYSCON_READ_4(sc->syscon, SCM_BGAP_CTRL); >> DELAY(500); >> /* Start the ADC conversion. */ >> reg = SCM_BGAP_CLRZ | SCM_BGAP_CONTCONV | SCM_BGAP_SOC; >> - ti_scm_reg_write_4(SCM_BGAP_CTRL, reg); >> + SYSCON_WRITE_4(sc->syscon, SCM_BGAP_CTRL, reg); >> >> /* Temperature sysctl. */ >> - sc = device_get_softc(dev); >> ctx = device_get_sysctl_ctx(dev); >> tree = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); >> sc->sc_temp_oid = SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, >> @@ -145,7 +171,7 @@ am335x_scm_detach(device_t dev) >> sysctl_remove_oid(sc->sc_temp_oid, 1, 0); >> >> /* Stop the bandgap ADC. */ >> - ti_scm_reg_write_4(SCM_BGAP_CTRL, SCM_BGAP_BGOFF); >> >> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >> _______________________________________________ >> svn-src-all@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-all >> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" >> > > From owner-svn-src-head@freebsd.org Sat Aug 1 09:40:20 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A065375674; Sat, 1 Aug 2020 09:40:20 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJfJg6spHz47R8; Sat, 1 Aug 2020 09:40:19 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF90010D0A; Sat, 1 Aug 2020 09:40:19 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0719eJj1057884; Sat, 1 Aug 2020 09:40:19 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0719eJM0057883; Sat, 1 Aug 2020 09:40:19 GMT (envelope-from mw@FreeBSD.org) Message-Id: <202008010940.0719eJM0057883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Sat, 1 Aug 2020 09:40:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363759 - head/sys/dev/neta X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/neta X-SVN-Commit-Revision: 363759 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2020 09:40:20 -0000 Author: mw Date: Sat Aug 1 09:40:19 2020 New Revision: 363759 URL: https://svnweb.freebsd.org/changeset/base/363759 Log: Fix TX csum handling in if_mvneta The mvneta device requires MVNETA_TX_CMD_L4_CHECKSUM_NONE bit to be set in the tx descriptor is checksum not required. However, mvneta_tx_set_csumflag() is not setting this flag currently, causing the hardware to randomly corrupt IP header during transmission. This affects injected IPv4 packets that skips kernel IP stack processing (e.g. DHCP), as well as all IPv6 packets, since the driver currently does not offload csum for IPv6. The fix is to remove all the early return paths from mvneta_tx_set_csumflag() which do not set the MVNETA_TX_CMD_L4_CHECKSUM_NONE flag. PR: 248306 Submitted by: Mike Cui Reported by: Mike Cui Modified: head/sys/dev/neta/if_mvneta.c Modified: head/sys/dev/neta/if_mvneta.c ============================================================================== --- head/sys/dev/neta/if_mvneta.c Sat Aug 1 09:06:16 2020 (r363758) +++ head/sys/dev/neta/if_mvneta.c Sat Aug 1 09:40:19 2020 (r363759) @@ -2828,18 +2828,15 @@ mvneta_tx_set_csumflag(struct ifnet *ifp, csum_flags = ifp->if_hwassist & m->m_pkthdr.csum_flags; eh = mtod(m, struct ether_header *); - if (csum_flags == 0) - return; - switch (ntohs(eh->ether_type)) { case ETHERTYPE_IP: ipoff = ETHER_HDR_LEN; break; - case ETHERTYPE_IPV6: - return; case ETHERTYPE_VLAN: ipoff = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; break; + default: + csum_flags = 0; } if (__predict_true(csum_flags & (CSUM_IP|CSUM_IP_TCP|CSUM_IP_UDP))) { From owner-svn-src-head@freebsd.org Sat Aug 1 16:02:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA4B837EDE9; Sat, 1 Aug 2020 16:02:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJpnj4Xbtz4Rxq; Sat, 1 Aug 2020 16:02:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FD651551E; Sat, 1 Aug 2020 16:02:33 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 071G2XDj097021; Sat, 1 Aug 2020 16:02:33 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 071G2XdZ097020; Sat, 1 Aug 2020 16:02:33 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008011602.071G2XdZ097020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 1 Aug 2020 16:02:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363767 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363767 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2020 16:02:33 -0000 Author: mjg Date: Sat Aug 1 16:02:32 2020 New Revision: 363767 URL: https://svnweb.freebsd.org/changeset/base/363767 Log: cred: add more asserts for td_realucred == td_ucred Modified: head/sys/kern/kern_prot.c head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Sat Aug 1 14:58:43 2020 (r363766) +++ head/sys/kern/kern_prot.c Sat Aug 1 16:02:32 2020 (r363767) @@ -1881,7 +1881,8 @@ crunuse(struct thread *td) { struct ucred *cr, *crold; - cr = td->td_ucred; + MPASS(td->td_realucred == td->td_ucred); + cr = td->td_realucred; mtx_lock(&cr->cr_mtx); cr->cr_ref += td->td_ucredref; td->td_ucredref = 0; @@ -1897,6 +1898,7 @@ crunuse(struct thread *td) crold = NULL; } mtx_unlock(&cr->cr_mtx); + td->td_realucred = NULL; return (crold); } Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Sat Aug 1 14:58:43 2020 (r363766) +++ head/sys/kern/kern_thread.c Sat Aug 1 16:02:32 2020 (r363767) @@ -543,6 +543,7 @@ thread_exit(void) (long)p->p_pid, td->td_name); SDT_PROBE0(proc, , , lwp__exit); KASSERT(TAILQ_EMPTY(&td->td_sigqueue.sq_list), ("signal pending")); + MPASS(td->td_realucred == td->td_ucred); /* * drop FPU & debug register state storage, or any other From owner-svn-src-head@freebsd.org Sat Aug 1 17:37:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 862F43A1925; Sat, 1 Aug 2020 17:37:27 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BJrvB5ftpz4Wnq; Sat, 1 Aug 2020 17:37:26 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x344.google.com with SMTP id k8so11934458wma.2; Sat, 01 Aug 2020 10:37:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=6UIYoSB6SRd0eBuEdOQEDINY8Facwlr/l6DQgOoS7Wc=; b=GvjGVnwlAUTX3ZH3XC+zzMQto66GndpF2yrFkoQZhzesJH/oyZanYHzRvh33xTjfSH 0XQa+HeVSRVoCjzmt08RombqTOiGKP7DKM2gBznBukgjDtKjGnUFAlym1H/dSK9DF/G/ CVdglu66hTfDj0rTb0BT4wFq5TEry7LIJsrqEDLkydNKDSPCbFqtJGX4j5Bazc9IzWHp vC67C9IpZXMS9ziHDC3SR2fzJu0RXDATwoURYJS1WOpPJLKSODId1kTxgCKhkVnozh+Z ALsLPBpf30WyIY4IRmQnTgXibcn/nxOkDCn4j12vo+/LNI1AinxclhtL0dT4l70Cqfst 2EkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=6UIYoSB6SRd0eBuEdOQEDINY8Facwlr/l6DQgOoS7Wc=; b=AzAWXZmarHQ7QrXliWwP3x8ui8J/EvKxk5JbfIdioPtWxHXd5l03D41vL++4s1SfXy T8YwQMoNyE076QrpRtgqepKxB5Iql/B+B5XMHf7U0nplEV92KZTPHDzBZbjv9dbDBlBb XRMd65k4HUykSCwUDOq7tYANxvYKBcKGCA8Btc07gPgwrMQJJ3F5QBsZUdyEMmV8isD+ JVygn8l6wIy2ATQ1JWw2hKB1EAV6UoTZBioDf0KXEhQA5mP7K/aAKyvDr2dNEWuom0zx TJFTBF8V2GVOgu1tjBob94SY95kJZpsByb9R8eLi49A2i2W0EdyibGt1cwlFYH1Qu2/D AuzQ== X-Gm-Message-State: AOAM530Rxt5bj8fnAWgt/fQID+FnukvDeF3a9k7rwNqQQ9vcdA6Nq9kg JMq/1MS5xwX8mX+WB4DOSCB+aLunKpHWwZdXop/TlA== X-Google-Smtp-Source: ABdhPJxV1UA9P8gpIAnmlWEYH+eQTzHPDMrq9WAgBpAYoRL81c1SEqVx+T67Y+RxD/uSe3uSflMWOmMwCbYJYrgUM3s= X-Received: by 2002:a1c:e90d:: with SMTP id q13mr9078536wmc.187.1596303444025; Sat, 01 Aug 2020 10:37:24 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a5d:614c:0:0:0:0:0 with HTTP; Sat, 1 Aug 2020 10:37:23 -0700 (PDT) In-Reply-To: <85d52020-3aff-7210-ace7-12ae19ad5d9a@freebsd.org> References: <202007301445.06UEj5uj062013@repo.freebsd.org> <85d52020-3aff-7210-ace7-12ae19ad5d9a@freebsd.org> From: Mateusz Guzik Date: Sat, 1 Aug 2020 19:37:23 +0200 Message-ID: Subject: Re: svn commit: r363700 - in head/sys: arm/ti arm/ti/am335x arm/ti/clk arm/ti/cpsw arm/ti/omap4 arm/ti/usb dev/uart modules To: mmel@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BJrvB5ftpz4Wnq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2020 17:37:27 -0000 thanks for prompt response. I confirm the issue is fixed. On 8/1/20, Michal Meloun wrote: > Oups, next module dependency on autogenerated header... > Fixed in r363758. > > Thanks for report > Michal > > > On 01.08.2020 6:39, Mateusz Guzik wrote: >> This breaks tinderbox for several arm kernels. >> >> On 7/30/20, Michal Meloun wrote: >>> Author: mmel >>> Date: Thu Jul 30 14:45:05 2020 >>> New Revision: 363700 >>> URL: https://svnweb.freebsd.org/changeset/base/363700 >>> >>> Log: >>> Move Ti AM335x to dev/extres/clk framework. >>> >>> Re-implement clocks for these SoC by using now standard extres/clk >>> framework. >>> This is necessary for future expansion of these. The new >>> implementation >>> is (due to the size of the patch) only the initial (minimum) version. >>> It will be updated/expanded with a subsequent set of particular >>> patches. >>> >>> This patch is also not tested on OMAP4 based boards (BeagleBone), >>> so all possible issues should be (and will be) fixed by ASAP once >>> identified. >>> >>> Submited by: Oskar Holmlund (oskar.holmlund@ohdata.se) >>> Differential Revision: https://reviews.freebsd.org/D25118 >>> >>> Added: >>> head/sys/arm/ti/am335x/am3359_cppi41.c (contents, props changed) >>> head/sys/arm/ti/am335x/am335x_usb_phy.c (contents, props changed) >>> head/sys/arm/ti/clk/ >>> head/sys/arm/ti/clk/clock_common.c (contents, props changed) >>> head/sys/arm/ti/clk/clock_common.h (contents, props changed) >>> head/sys/arm/ti/clk/ti_clk_clkctrl.c (contents, props changed) >>> head/sys/arm/ti/clk/ti_clk_clkctrl.h (contents, props changed) >>> head/sys/arm/ti/clk/ti_clk_dpll.c (contents, props changed) >>> head/sys/arm/ti/clk/ti_clk_dpll.h (contents, props changed) >>> head/sys/arm/ti/clk/ti_clkctrl.c (contents, props changed) >>> head/sys/arm/ti/clk/ti_divider_clock.c (contents, props changed) >>> head/sys/arm/ti/clk/ti_dpll_clock.c (contents, props changed) >>> head/sys/arm/ti/clk/ti_gate_clock.c (contents, props changed) >>> head/sys/arm/ti/clk/ti_mux_clock.c (contents, props changed) >>> head/sys/arm/ti/ti_omap4_cm.c (contents, props changed) >>> head/sys/arm/ti/ti_omap4_cm.h (contents, props changed) >>> head/sys/arm/ti/ti_prm.c (contents, props changed) >>> head/sys/arm/ti/ti_prm.h (contents, props changed) >>> head/sys/arm/ti/ti_scm_syscon.c (contents, props changed) >>> head/sys/arm/ti/ti_sysc.h (contents, props changed) >>> Deleted: >>> head/sys/arm/ti/am335x/am335x_prcm.c >>> head/sys/arm/ti/am335x/am335x_usbss.c >>> head/sys/arm/ti/ti_hwmods.c >>> head/sys/arm/ti/ti_hwmods.h >>> Modified: >>> head/sys/arm/ti/am335x/am335x_dmtimer.c >>> head/sys/arm/ti/am335x/am335x_dmtpps.c >>> head/sys/arm/ti/am335x/am335x_dmtreg.h >>> head/sys/arm/ti/am335x/am335x_gpio.c >>> head/sys/arm/ti/am335x/am335x_lcd.c >>> head/sys/arm/ti/am335x/am335x_musb.c >>> head/sys/arm/ti/am335x/am335x_pwmss.c >>> head/sys/arm/ti/am335x/am335x_rtc.c >>> head/sys/arm/ti/am335x/am335x_scm.c >>> head/sys/arm/ti/am335x/files.am335x >>> head/sys/arm/ti/cpsw/if_cpsw.c >>> head/sys/arm/ti/files.ti >>> head/sys/arm/ti/omap4/files.omap4 >>> head/sys/arm/ti/ti_adc.c >>> head/sys/arm/ti/ti_edma3.c >>> head/sys/arm/ti/ti_gpio.c >>> head/sys/arm/ti/ti_i2c.c >>> head/sys/arm/ti/ti_mbox.c >>> head/sys/arm/ti/ti_pinmux.c >>> head/sys/arm/ti/ti_prcm.c >>> head/sys/arm/ti/ti_prcm.h >>> head/sys/arm/ti/ti_pruss.c >>> head/sys/arm/ti/ti_scm.c >>> head/sys/arm/ti/ti_sdhci.c >>> head/sys/arm/ti/ti_sdma.c >>> head/sys/arm/ti/ti_spi.c >>> head/sys/arm/ti/ti_sysc.c >>> head/sys/arm/ti/ti_wdt.c >>> head/sys/arm/ti/usb/omap_ehci.c >>> head/sys/arm/ti/usb/omap_host.c >>> head/sys/arm/ti/usb/omap_tll.c >>> head/sys/dev/uart/uart_dev_ti8250.c >>> head/sys/modules/Makefile >>> >>> Added: head/sys/arm/ti/am335x/am3359_cppi41.c >>> ============================================================================== >>> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >>> +++ head/sys/arm/ti/am335x/am3359_cppi41.c Thu Jul 30 14:45:05 >>> 2020 (r363700) >>> @@ -0,0 +1,192 @@ >>> +/*- >>> + * Copyright (c) 2019 Emmanuel Vadot >>> + * >>> + * Copyright (c) 2020 Oskar Holmlund >>> + * >>> + * Redistribution and use in source and binary forms, with or without >>> + * modification, are permitted provided that the following conditions >>> + * are met: >>> + * 1. Redistributions of source code must retain the above copyright >>> + * notice, this list of conditions and the following disclaimer. >>> + * 2. Redistributions in binary form must reproduce the above copyright >>> + * notice, this list of conditions and the following disclaimer in >>> the >>> + * documentation and/or other materials provided with the >>> distribution. >>> + * >>> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR >>> + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >>> WARRANTIES >>> + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >>> DISCLAIMED. >>> + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, >>> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, >>> + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >>> + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER >>> CAUSED >>> + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT >>> LIABILITY, >>> + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY >>> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY >>> OF >>> + * SUCH DAMAGE. >>> + * >>> + * $FreeBSD$ >>> + */ >>> +/* Based on sys/arm/ti/ti_sysc.c */ >>> + >>> +#include >>> +__FBSDID("$FreeBSD$"); >>> + >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> +#include >>> + >>> +#include >>> +#include >>> + >>> +#include >>> + >>> +#include >>> +#include >>> +#include >>> + >>> +#include >>> + >>> +#if 0 >>> +#define DPRINTF(dev, msg...) device_printf(dev, msg) >>> +#else >>> +#define DPRINTF(dev, msg...) >>> +#endif >>> + >>> +struct ti_am3359_cppi41_softc { >>> + device_t dev; >>> + struct syscon * syscon; >>> + struct resource * res[4]; >>> + bus_space_tag_t bst; >>> + bus_space_handle_t bsh; >>> + struct mtx mtx; >>> +}; >>> + >>> +static struct resource_spec ti_am3359_cppi41_res_spec[] = { >>> + { SYS_RES_MEMORY, 0, RF_ACTIVE | RF_SHAREABLE }, >>> + { SYS_RES_MEMORY, 1, RF_ACTIVE | RF_SHAREABLE }, >>> + { SYS_RES_MEMORY, 2, RF_ACTIVE | RF_SHAREABLE }, >>> + { SYS_RES_MEMORY, 3, RF_ACTIVE | RF_SHAREABLE }, >>> + { -1, 0 } >>> +}; >>> + >>> +/* Device */ >>> +static struct ofw_compat_data compat_data[] = { >>> + { "ti,am3359-cppi41", 1 }, >>> + { NULL, 0 } >>> +}; >>> + >>> +static int >>> +ti_am3359_cppi41_write_4(device_t dev, bus_addr_t addr, uint32_t val) >>> +{ >>> + struct ti_am3359_cppi41_softc *sc; >>> + >>> + sc = device_get_softc(dev); >>> + DPRINTF(sc->dev, "offset=%lx write %x\n", addr, val); >>> + mtx_lock(&sc->mtx); >>> + bus_space_write_4(sc->bst, sc->bsh, addr, val); >>> + mtx_unlock(&sc->mtx); >>> + return (0); >>> +} >>> + >>> +static uint32_t >>> +ti_am3359_cppi41_read_4(device_t dev, bus_addr_t addr) >>> +{ >>> + struct ti_am3359_cppi41_softc *sc; >>> + uint32_t val; >>> + >>> + sc = device_get_softc(dev); >>> + >>> + mtx_lock(&sc->mtx); >>> + val = bus_space_read_4(sc->bst, sc->bsh, addr); >>> + mtx_unlock(&sc->mtx); >>> + DPRINTF(sc->dev, "offset=%lx Read %x\n", addr, val); >>> + return (val); >>> +} >>> + >>> +/* device interface */ >>> +static int >>> +ti_am3359_cppi41_probe(device_t dev) >>> +{ >>> + if (!ofw_bus_status_okay(dev)) >>> + return (ENXIO); >>> + >>> + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) >>> + return (ENXIO); >>> + >>> + device_set_desc(dev, "TI AM3359 CPPI 41"); >>> + return(BUS_PROBE_DEFAULT); >>> +} >>> + >>> +static int >>> +ti_am3359_cppi41_attach(device_t dev) >>> +{ >>> + struct ti_am3359_cppi41_softc *sc; >>> + phandle_t node; >>> + uint32_t reg, reset_bit, timeout=10; >>> + uint64_t sysc_address; >>> + device_t parent; >>> + >>> + sc = device_get_softc(dev); >>> + sc->dev = dev; >>> + >>> + if (bus_alloc_resources(dev, ti_am3359_cppi41_res_spec, sc->res)) { >>> + device_printf(sc->dev, "Cant allocate resources\n"); >>> + return (ENXIO); >>> + } >>> + >>> + sc->dev = dev; >>> + sc->bst = rman_get_bustag(sc->res[0]); >>> + sc->bsh = rman_get_bushandle(sc->res[0]); >>> + >>> + mtx_init(&sc->mtx, device_get_nameunit(sc->dev), NULL, MTX_DEF); >>> + node = ofw_bus_get_node(sc->dev); >>> + >>> + /* variant of am335x_usbss.c */ >>> + DPRINTF(dev, "-- RESET USB --\n"); >>> + parent = device_get_parent(dev); >>> + reset_bit = ti_sysc_get_soft_reset_bit(parent); >>> + if (reset_bit == 0) { >>> + DPRINTF(dev, "Dont have reset bit\n"); >>> + return (0); >>> + } >>> + sysc_address = ti_sysc_get_sysc_address_offset_host(parent); >>> + DPRINTF(dev, "sysc_address %x\n", sysc_address); >>> + ti_am3359_cppi41_write_4(dev, sysc_address, reset_bit); >>> + DELAY(100); >>> + reg = ti_am3359_cppi41_read_4(dev, sysc_address); >>> + if ((reg & reset_bit) && timeout--) { >>> + DPRINTF(dev, "Reset still ongoing - wait a little bit longer\n"); >>> + DELAY(100); >>> + reg = ti_am3359_cppi41_read_4(dev, sysc_address); >>> + } >>> + if (timeout == 0) >>> + device_printf(dev, "USB Reset timeout\n"); >>> + >>> + return (0); >>> +} >>> + >>> + >>> +static device_method_t ti_am3359_cppi41_methods[] = { >>> + DEVMETHOD(device_probe, ti_am3359_cppi41_probe), >>> + DEVMETHOD(device_attach, ti_am3359_cppi41_attach), >>> + >>> + DEVMETHOD_END >>> +}; >>> + >>> + >>> +DEFINE_CLASS_1(ti_am3359_cppi41, ti_am3359_cppi41_driver, >>> + ti_am3359_cppi41_methods,sizeof(struct ti_am3359_cppi41_softc), >>> + simplebus_driver); >>> + >>> +static devclass_t ti_am3359_cppi41_devclass; >>> + >>> +EARLY_DRIVER_MODULE(ti_am3359_cppi41, simplebus, >>> ti_am3359_cppi41_driver, >>> + ti_am3359_cppi41_devclass, 0, 0, BUS_PASS_BUS + >>> BUS_PASS_ORDER_MIDDLE); >>> +MODULE_VERSION(ti_am3359_cppi41, 1); >>> +MODULE_DEPEND(ti_am3359_cppi41, ti_sysc, 1, 1, 1); >>> >>> Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c >>> ============================================================================== >>> --- head/sys/arm/ti/am335x/am335x_dmtimer.c Thu Jul 30 14:42:50 >>> 2020 (r363699) >>> +++ head/sys/arm/ti/am335x/am335x_dmtimer.c Thu Jul 30 14:45:05 >>> 2020 (r363700) >>> @@ -42,12 +42,13 @@ __FBSDID("$FreeBSD$"); >>> >>> #include /* For arm_set_delay */ >>> >>> +#include >>> + >>> #include >>> #include >>> #include >>> >>> -#include >>> -#include >>> +#include >>> >>> #include "am335x_dmtreg.h" >>> >>> @@ -58,7 +59,8 @@ struct am335x_dmtimer_softc { >>> int tmr_irq_rid; >>> struct resource * tmr_irq_res; >>> void *tmr_irq_handler; >>> - uint32_t sysclk_freq; >>> + clk_t clk_fck; >>> + uint64_t sysclk_freq; >>> uint32_t tclr; /* Cached TCLR register. */ >>> union { >>> struct timecounter tc; >>> @@ -251,6 +253,7 @@ am335x_dmtimer_probe(device_t dev) >>> { >>> char strbuf[32]; >>> int tmr_num; >>> + uint64_t rev_address; >>> >>> if (!ofw_bus_status_okay(dev)) >>> return (ENXIO); >>> @@ -259,13 +262,22 @@ am335x_dmtimer_probe(device_t dev) >>> return (ENXIO); >>> >>> /* >>> - * Get the hardware unit number (the N from ti,hwmods="timerN"). >>> + * Get the hardware unit number from address of rev register. >>> * If this isn't the hardware unit we're going to use for either the >>> * eventtimer or the timecounter, no point in instantiating the >>> device. >>> */ >>> - tmr_num = ti_hwmods_get_unit(dev, "timer"); >>> - if (tmr_num != ET_TMR_NUM && tmr_num != TC_TMR_NUM) >>> - return (ENXIO); >>> + rev_address = ti_sysc_get_rev_address(device_get_parent(dev)); >>> + switch (rev_address) { >>> + case DMTIMER2_REV: >>> + tmr_num = 2; >>> + break; >>> + case DMTIMER3_REV: >>> + tmr_num = 3; >>> + break; >>> + default: >>> + /* Not DMTIMER2 or DMTIMER3 */ >>> + return (ENXIO); >>> + } >>> >>> snprintf(strbuf, sizeof(strbuf), "AM335x DMTimer%d", tmr_num); >>> device_set_desc_copy(dev, strbuf); >>> @@ -277,24 +289,47 @@ static int >>> am335x_dmtimer_attach(device_t dev) >>> { >>> struct am335x_dmtimer_softc *sc; >>> - clk_ident_t timer_id; >>> int err; >>> + uint64_t rev_address; >>> + clk_t sys_clkin; >>> >>> sc = device_get_softc(dev); >>> sc->dev = dev; >>> >>> - /* Get the base clock frequency. */ >>> - if ((err = ti_prcm_clk_get_source_freq(SYS_CLK, &sc->sysclk_freq)) != >>> 0) >>> - return (err); >>> + /* expect one clock */ >>> + err = clk_get_by_ofw_index(dev, 0, 0, &sc->clk_fck); >>> + if (err != 0) { >>> + device_printf(dev, "Cant find clock index 0. err: %d\n", err); >>> + return (ENXIO); >>> + } >>> >>> + err = clk_get_by_name(dev, "sys_clkin_ck@40", &sys_clkin); >>> + if (err != 0) { >>> + device_printf(dev, "Cant find sys_clkin_ck@40 err: %d\n", err); >>> + return (ENXIO); >>> + } >>> + >>> + /* Select M_OSC as DPLL parent */ >>> + err = clk_set_parent_by_clk(sc->clk_fck, sys_clkin); >>> + if (err != 0) { >>> + device_printf(dev, "Cant set mux to CLK_M_OSC\n"); >>> + return (ENXIO); >>> + } >>> + >>> /* Enable clocks and power on the device. */ >>> - if ((timer_id = ti_hwmods_get_clock(dev)) == INVALID_CLK_IDENT) >>> + err = ti_sysc_clock_enable(device_get_parent(dev)); >>> + if (err != 0) { >>> + device_printf(dev, "Cant enable sysc clkctrl, err %d\n", err); >>> return (ENXIO); >>> - if ((err = ti_prcm_clk_set_source(timer_id, SYSCLK_CLK)) != 0) >>> - return (err); >>> - if ((err = ti_prcm_clk_enable(timer_id)) != 0) >>> - return (err); >>> + } >>> >>> + /* Get the base clock frequency. */ >>> + err = clk_get_freq(sc->clk_fck, &sc->sysclk_freq); >>> + if (err != 0) { >>> + device_printf(dev, "Cant get sysclk frequency, err %d\n", err); >>> + return (ENXIO); >>> + } >>> + >>> /* Request the memory resources. */ >>> sc->tmr_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, >>> &sc->tmr_mem_rid, RF_ACTIVE); >>> @@ -302,7 +337,20 @@ am335x_dmtimer_attach(device_t dev) >>> return (ENXIO); >>> } >>> >>> - sc->tmr_num = ti_hwmods_get_unit(dev, "timer"); >>> + rev_address = ti_sysc_get_rev_address(device_get_parent(dev)); >>> + switch (rev_address) { >>> + case DMTIMER2_REV: >>> + sc->tmr_num = 2; >>> + break; >>> + case DMTIMER3_REV: >>> + sc->tmr_num = 3; >>> + break; >>> + default: >>> + device_printf(dev, "Not timer 2 or 3! %#jx\n", >>> + rev_address); >>> + return (ENXIO); >>> + } >>> + >>> snprintf(sc->tmr_name, sizeof(sc->tmr_name), "DMTimer%d", >>> sc->tmr_num); >>> >>> /* >>> @@ -334,7 +382,7 @@ static driver_t am335x_dmtimer_driver = { >>> static devclass_t am335x_dmtimer_devclass; >>> >>> DRIVER_MODULE(am335x_dmtimer, simplebus, am335x_dmtimer_driver, >>> am335x_dmtimer_devclass, 0, 0); >>> -MODULE_DEPEND(am335x_dmtimer, am335x_prcm, 1, 1, 1); >>> +MODULE_DEPEND(am335x_dmtimer, ti_sysc, 1, 1, 1); >>> >>> static void >>> am335x_dmtimer_delay(int usec, void *arg) >>> >>> Modified: head/sys/arm/ti/am335x/am335x_dmtpps.c >>> ============================================================================== >>> --- head/sys/arm/ti/am335x/am335x_dmtpps.c Thu Jul 30 14:42:50 >>> 2020 (r363699) >>> +++ head/sys/arm/ti/am335x/am335x_dmtpps.c Thu Jul 30 14:45:05 >>> 2020 (r363700) >>> @@ -43,6 +43,8 @@ >>> #include >>> __FBSDID("$FreeBSD$"); >>> >>> +#include "opt_platform.h" >>> + >>> #include >>> #include >>> #include >>> @@ -60,9 +62,9 @@ __FBSDID("$FreeBSD$"); >>> #include >>> #include >>> #include >>> +#include >>> >>> -#include >>> -#include >>> +#include >>> #include >>> #include >>> >>> @@ -82,6 +84,8 @@ struct dmtpps_softc { >>> struct cdev * pps_cdev; >>> struct pps_state pps_state; >>> struct mtx pps_mtx; >>> + clk_t clk_fck; >>> + uint64_t sysclk_freq; >>> }; >>> >>> static int dmtpps_tmr_num; /* Set by probe() */ >>> @@ -383,6 +387,7 @@ dmtpps_probe(device_t dev) >>> { >>> char strbuf[64]; >>> int tmr_num; >>> + uint64_t rev_address; >>> >>> if (!ofw_bus_status_okay(dev)) >>> return (ENXIO); >>> @@ -402,7 +407,33 @@ dmtpps_probe(device_t dev) >>> * Figure out which hardware timer is being probed and see if it >>> matches >>> * the configured timer number determined earlier. >>> */ >>> - tmr_num = ti_hwmods_get_unit(dev, "timer"); >>> + rev_address = ti_sysc_get_rev_address(device_get_parent(dev)); >>> + switch (rev_address) { >>> + case DMTIMER1_1MS_REV: >>> + tmr_num = 1; >>> + break; >>> + case DMTIMER2_REV: >>> + tmr_num = 2; >>> + break; >>> + case DMTIMER3_REV: >>> + tmr_num = 3; >>> + break; >>> + case DMTIMER4_REV: >>> + tmr_num = 4; >>> + break; >>> + case DMTIMER5_REV: >>> + tmr_num = 5; >>> + break; >>> + case DMTIMER6_REV: >>> + tmr_num = 6; >>> + break; >>> + case DMTIMER7_REV: >>> + tmr_num = 7; >>> + break; >>> + default: >>> + return (ENXIO); >>> + } >>> + >>> if (dmtpps_tmr_num != tmr_num) >>> return (ENXIO); >>> >>> @@ -418,23 +449,73 @@ dmtpps_attach(device_t dev) >>> { >>> struct dmtpps_softc *sc; >>> struct make_dev_args mda; >>> - clk_ident_t timer_id; >>> - int err, sysclk_freq; >>> + int err; >>> + clk_t sys_clkin; >>> + uint64_t rev_address; >>> >>> sc = device_get_softc(dev); >>> sc->dev = dev; >>> >>> - /* Get the base clock frequency. */ >>> - err = ti_prcm_clk_get_source_freq(SYS_CLK, &sysclk_freq); >>> + /* Figure out which hardware timer this is and set the name string. */ >>> + rev_address = ti_sysc_get_rev_address(device_get_parent(dev)); >>> + switch (rev_address) { >>> + case DMTIMER1_1MS_REV: >>> + sc->tmr_num = 1; >>> + break; >>> + case DMTIMER2_REV: >>> + sc->tmr_num = 2; >>> + break; >>> + case DMTIMER3_REV: >>> + sc->tmr_num = 3; >>> + break; >>> + case DMTIMER4_REV: >>> + sc->tmr_num = 4; >>> + break; >>> + case DMTIMER5_REV: >>> + sc->tmr_num = 5; >>> + break; >>> + case DMTIMER6_REV: >>> + sc->tmr_num = 6; >>> + break; >>> + case DMTIMER7_REV: >>> + sc->tmr_num = 7; >>> + break; >>> + } >>> + snprintf(sc->tmr_name, sizeof(sc->tmr_name), "DMTimer%d", >>> sc->tmr_num); >>> >>> + /* expect one clock */ >>> + err = clk_get_by_ofw_index(dev, 0, 0, &sc->clk_fck); >>> + if (err != 0) { >>> + device_printf(dev, "Cant find clock index 0. err: %d\n", err); >>> + return (ENXIO); >>> + } >>> + >>> + err = clk_get_by_name(dev, "sys_clkin_ck@40", &sys_clkin); >>> + if (err != 0) { >>> + device_printf(dev, "Cant find sys_clkin_ck@40 err: %d\n", err); >>> + return (ENXIO); >>> + } >>> + >>> + /* Select M_OSC as DPLL parent */ >>> + err = clk_set_parent_by_clk(sc->clk_fck, sys_clkin); >>> + if (err != 0) { >>> + device_printf(dev, "Cant set mux to CLK_M_OSC\n"); >>> + return (ENXIO); >>> + } >>> + >>> /* Enable clocks and power on the device. */ >>> - if ((timer_id = ti_hwmods_get_clock(dev)) == INVALID_CLK_IDENT) >>> + err = ti_sysc_clock_enable(device_get_parent(dev)); >>> + if (err != 0) { >>> + device_printf(dev, "Cant enable sysc clkctrl, err %d\n", err); >>> return (ENXIO); >>> - if ((err = ti_prcm_clk_set_source(timer_id, SYSCLK_CLK)) != 0) >>> - return (err); >>> - if ((err = ti_prcm_clk_enable(timer_id)) != 0) >>> - return (err); >>> + } >>> >>> + /* Get the base clock frequency. */ >>> + err = clk_get_freq(sc->clk_fck, &sc->sysclk_freq); >>> + if (err != 0) { >>> + device_printf(dev, "Cant get sysclk frequency, err %d\n", err); >>> + return (ENXIO); >>> + } >>> /* Request the memory resources. */ >>> sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, >>> &sc->mem_rid, RF_ACTIVE); >>> @@ -442,10 +523,6 @@ dmtpps_attach(device_t dev) >>> return (ENXIO); >>> } >>> >>> - /* Figure out which hardware timer this is and set the name string. */ >>> - sc->tmr_num = ti_hwmods_get_unit(dev, "timer"); >>> - snprintf(sc->tmr_name, sizeof(sc->tmr_name), "DMTimer%d", >>> sc->tmr_num); >>> - >>> /* >>> * Configure the timer pulse/capture pin to input/capture mode. This >>> is >>> * required in addition to configuring the pin as input with the >>> pinmux >>> @@ -468,7 +545,7 @@ dmtpps_attach(device_t dev) >>> sc->tc.tc_name = sc->tmr_name; >>> sc->tc.tc_get_timecount = dmtpps_get_timecount; >>> sc->tc.tc_counter_mask = ~0u; >>> - sc->tc.tc_frequency = sysclk_freq; >>> + sc->tc.tc_frequency = sc->sysclk_freq; >>> sc->tc.tc_quality = 1000; >>> sc->tc.tc_priv = sc; >>> >>> @@ -541,5 +618,4 @@ static driver_t dmtpps_driver = { >>> static devclass_t dmtpps_devclass; >>> >>> DRIVER_MODULE(am335x_dmtpps, simplebus, dmtpps_driver, dmtpps_devclass, >>> 0, >>> 0); >>> -MODULE_DEPEND(am335x_dmtpps, am335x_prcm, 1, 1, 1); >>> - >>> +MODULE_DEPEND(am335x_dmtpps, ti_sysc, 1, 1, 1); >>> >>> Modified: head/sys/arm/ti/am335x/am335x_dmtreg.h >>> ============================================================================== >>> --- head/sys/arm/ti/am335x/am335x_dmtreg.h Thu Jul 30 14:42:50 >>> 2020 (r363699) >>> +++ head/sys/arm/ti/am335x/am335x_dmtreg.h Thu Jul 30 14:45:05 >>> 2020 (r363700) >>> @@ -73,4 +73,16 @@ >>> #define DMT_TSICR_RESET (1 << 1) /* TSICR perform soft reset */ >>> #define DMT_TCAR2 0x48 /* Capture Reg */ >>> >>> +/* Location of revision register from TRM Memory map chapter 2 */ >>> +/* L4_WKUP */ >>> +#define DMTIMER0_REV 0x05000 >>> +#define DMTIMER1_1MS_REV 0x31000 >>> +/* L4_PER */ >>> +#define DMTIMER2_REV 0x40000 >>> +#define DMTIMER3_REV 0x42000 >>> +#define DMTIMER4_REV 0x44000 >>> +#define DMTIMER5_REV 0x46000 >>> +#define DMTIMER6_REV 0x48000 >>> +#define DMTIMER7_REV 0x4A000 >>> + >>> #endif /* AM335X_DMTREG_H */ >>> >>> Modified: head/sys/arm/ti/am335x/am335x_gpio.c >>> ============================================================================== >>> --- head/sys/arm/ti/am335x/am335x_gpio.c Thu Jul 30 14:42:50 >>> 2020 (r363699) >>> +++ head/sys/arm/ti/am335x/am335x_gpio.c Thu Jul 30 14:45:05 >>> 2020 (r363700) >>> @@ -155,3 +155,4 @@ DEFINE_CLASS_1(gpio, am335x_gpio_driver, >>> am335x_gpio_m >>> sizeof(struct ti_gpio_softc), ti_gpio_driver); >>> DRIVER_MODULE(am335x_gpio, simplebus, am335x_gpio_driver, >>> am335x_gpio_devclass, >>> 0, 0); >>> +MODULE_DEPEND(am335x_gpio, ti_sysc, 1, 1, 1); >>> >>> Modified: head/sys/arm/ti/am335x/am335x_lcd.c >>> ============================================================================== >>> --- head/sys/arm/ti/am335x/am335x_lcd.c Thu Jul 30 14:42:50 >>> 2020 (r363699) >>> +++ head/sys/arm/ti/am335x/am335x_lcd.c Thu Jul 30 14:45:05 >>> 2020 (r363700) >>> @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); >>> >>> #include >>> >>> +#include >>> + >>> #include >>> #include >>> #include >>> @@ -65,7 +67,7 @@ __FBSDID("$FreeBSD$"); >>> #include >>> #endif >>> >>> -#include >>> +#include >>> #include >>> >>> #include "am335x_lcd.h" >>> @@ -219,6 +221,9 @@ struct am335x_lcd_softc { >>> /* HDMI framer */ >>> phandle_t sc_hdmi_framer; >>> eventhandler_tag sc_hdmi_evh; >>> + >>> + /* Clock */ >>> + clk_t sc_clk_dpll_disp_ck; >>> }; >>> >>> static void >>> @@ -615,24 +620,28 @@ am335x_lcd_configure(struct am335x_lcd_softc *sc) >>> uint32_t hbp, hfp, hsw; >>> uint32_t vbp, vfp, vsw; >>> uint32_t width, height; >>> - unsigned int ref_freq; >>> + uint64_t ref_freq; >>> int err; >>> >>> /* >>> * try to adjust clock to get double of requested frequency >>> * HDMI/DVI displays are very sensitive to error in frequncy value >>> */ >>> - if (ti_prcm_clk_set_source_freq(LCDC_CLK, >>> sc->sc_panel.panel_pxl_clk*2)) >>> { >>> + >>> + err = clk_set_freq(sc->sc_clk_dpll_disp_ck, >>> sc->sc_panel.panel_pxl_clk*2, >>> + CLK_SET_ROUND_ANY); >>> + if (err != 0) { >>> device_printf(sc->sc_dev, "can't set source frequency\n"); >>> return (ENXIO); >>> } >>> >>> - if (ti_prcm_clk_get_source_freq(LCDC_CLK, &ref_freq)) { >>> + err = clk_get_freq(sc->sc_clk_dpll_disp_ck, &ref_freq); >>> + if (err != 0) { >>> device_printf(sc->sc_dev, "can't get reference frequency\n"); >>> return (ENXIO); >>> } >>> >>> - /* Panle initialization */ >>> + /* Panel initialization */ >>> dma_size = >>> round_page(sc->sc_panel.panel_width*sc->sc_panel.panel_height*sc->sc_panel.bpp/8); >>> >>> /* >>> @@ -967,6 +976,13 @@ am335x_lcd_attach(device_t dev) >>> return (ENXIO); >>> } >>> >>> + /* Fixme: Cant find any reference in DTS for dpll_disp_ck@498 for now. >>> */ >>> + err = clk_get_by_name(dev, "dpll_disp_ck@498", >>> &sc->sc_clk_dpll_disp_ck); >>> + if (err != 0) { >>> + device_printf(dev, "Cant get dpll_disp_ck@49\n"); >>> + return (ENXIO); >>> + } >>> + >>> sc->sc_panel.ac_bias = 255; >>> sc->sc_panel.ac_bias_intrpt = 0; >>> sc->sc_panel.dma_burst_sz = 16; >>> @@ -989,7 +1005,11 @@ am335x_lcd_attach(device_t dev) >>> } >>> } >>> >>> - ti_prcm_clk_enable(LCDC_CLK); >>> + err = ti_sysc_clock_enable(device_get_parent(dev)); >>> + if (err != 0) { >>> + device_printf(dev, "Failed to enable sysc clkctrl, err %d\n", err); >>> + return (ENXIO); >>> + } >>> >>> rid = 0; >>> sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, >>> @@ -1081,3 +1101,4 @@ static devclass_t am335x_lcd_devclass; >>> DRIVER_MODULE(am335x_lcd, simplebus, am335x_lcd_driver, >>> am335x_lcd_devclass, 0, 0); >>> MODULE_VERSION(am335x_lcd, 1); >>> MODULE_DEPEND(am335x_lcd, simplebus, 1, 1, 1); >>> +MODULE_DEPEND(am335x_lcd, ti_sysc, 1, 1, 1); >>> >>> Modified: head/sys/arm/ti/am335x/am335x_musb.c >>> ============================================================================== >>> --- head/sys/arm/ti/am335x/am335x_musb.c Thu Jul 30 14:42:50 >>> 2020 (r363699) >>> +++ head/sys/arm/ti/am335x/am335x_musb.c Thu Jul 30 14:45:05 >>> 2020 (r363700) >>> @@ -66,9 +66,11 @@ __FBSDID("$FreeBSD$"); >>> >>> #include >>> >>> -#include >>> -#include >>> #include >>> +#include >>> +#include >>> +#include >>> +#include "syscon_if.h" >>> >>> #define USBCTRL_REV 0x00 >>> #define USBCTRL_CTRL 0x14 >>> @@ -130,6 +132,7 @@ struct musbotg_super_softc { >>> struct musbotg_softc sc_otg; >>> struct resource *sc_mem_res[2]; >>> int sc_irq_rid; >>> + struct syscon *syscon; >>> }; >>> >>> static void >>> @@ -155,30 +158,33 @@ static void >>> musbotg_clocks_on(void *arg) >>> { >>> struct musbotg_softc *sc; >>> - uint32_t c, reg; >>> + struct musbotg_super_softc *ssc; >>> + uint32_t reg; >>> >>> sc = arg; >>> - reg = USB_CTRL[sc->sc_id]; >>> + ssc = sc->sc_platform_data; >>> >>> - ti_scm_reg_read_4(reg, &c); >>> - c &= ~3; /* Enable power */ >>> - c |= 1 << 19; /* VBUS detect enable */ >>> - c |= 1 << 20; /* Session end enable */ >>> - ti_scm_reg_write_4(reg, c); >>> + reg = SYSCON_READ_4(ssc->syscon, USB_CTRL[sc->sc_id]); >>> + reg &= ~3; /* Enable power */ >>> + reg |= 1 << 19; /* VBUS detect enable */ >>> + reg |= 1 << 20; /* Session end enable */ >>> + >>> + SYSCON_WRITE_4(ssc->syscon, USB_CTRL[sc->sc_id], reg); >>> } >>> >>> static void >>> musbotg_clocks_off(void *arg) >>> { >>> struct musbotg_softc *sc; >>> - uint32_t c, reg; >>> + struct musbotg_super_softc *ssc; >>> + uint32_t reg; >>> >>> sc = arg; >>> - reg = USB_CTRL[sc->sc_id]; >>> + ssc = sc->sc_platform_data; >>> >>> /* Disable power to PHY */ >>> - ti_scm_reg_read_4(reg, &c); >>> - ti_scm_reg_write_4(reg, c | 3); >>> + reg = SYSCON_READ_4(ssc->syscon, USB_CTRL[sc->sc_id]); >>> + SYSCON_WRITE_4(ssc->syscon, USB_CTRL[sc->sc_id], reg | 3); >>> } >>> >>> static void >>> @@ -241,9 +247,42 @@ musbotg_attach(device_t dev) >>> char mode[16]; >>> int err; >>> uint32_t reg; >>> + phandle_t opp_table; >>> + clk_t clk_usbotg_fck; >>> >>> sc->sc_otg.sc_id = device_get_unit(dev); >>> >>> + /* FIXME: The devicetree needs to be updated to get a handle to the >>> gate >>> + * usbotg_fck@47c. see TRM 8.1.12.2 CM_WKUP CM_CLKDCOLDO_DPLL_PER. >>> + */ >>> + err = clk_get_by_name(dev, "usbotg_fck@47c", &clk_usbotg_fck); >>> + if (err) { >>> + device_printf(dev, "Can not find usbotg_fck@47c\n"); >>> + return (ENXIO); >>> + } >>> + >>> + err = clk_enable(clk_usbotg_fck); >>> + if (err) { >>> + device_printf(dev, "Can not enable usbotg_fck@47c\n"); >>> + return (ENXIO); >>> + } >>> + >>> + /* FIXME: For now; Go and kidnap syscon from opp-table */ >>> + opp_table = OF_finddevice("/opp-table"); >>> + if (opp_table == -1) { >>> + device_printf(dev, "Cant find /opp-table\n"); >>> + return (ENXIO); >>> + } >>> + if (!OF_hasprop(opp_table, "syscon")) { >>> + device_printf(dev, "/opp-table missing syscon property\n"); >>> + return (ENXIO); >>> + } >>> + err = syscon_get_by_ofw_property(dev, opp_table, "syscon", >>> &sc->syscon); >>> + if (err) { >>> + device_printf(dev, "Failed to get syscon\n"); >>> + return (ENXIO); >>> + } >>> + >>> /* Request the memory resources */ >>> err = bus_alloc_resources(dev, am335x_musbotg_mem_spec, >>> sc->sc_mem_res); >>> @@ -417,5 +456,7 @@ static driver_t musbotg_driver = { >>> >>> static devclass_t musbotg_devclass; >>> >>> -DRIVER_MODULE(musbotg, usbss, musbotg_driver, musbotg_devclass, 0, 0); >>> -MODULE_DEPEND(musbotg, usbss, 1, 1, 1); >>> +DRIVER_MODULE(musbotg, ti_sysc, musbotg_driver, musbotg_devclass, 0, >>> 0); >>> +MODULE_DEPEND(musbotg, ti_sysc, 1, 1, 1); >>> +MODULE_DEPEND(musbotg, ti_am3359_cppi41, 1, 1, 1); >>> +MODULE_DEPEND(usbss, usb, 1, 1, 1); >>> >>> Modified: head/sys/arm/ti/am335x/am335x_pwmss.c >>> ============================================================================== >>> --- head/sys/arm/ti/am335x/am335x_pwmss.c Thu Jul 30 14:42:50 >>> 2020 (r363699) >>> +++ head/sys/arm/ti/am335x/am335x_pwmss.c Thu Jul 30 14:45:05 >>> 2020 (r363700) >>> @@ -46,10 +46,11 @@ __FBSDID("$FreeBSD$"); >>> #include >>> #include >>> >>> -#include >>> -#include >>> -#include >>> +#include >>> >>> +#include >>> +#include "syscon_if.h" >>> + >>> #include "am335x_pwm.h" >>> #include "am335x_scm.h" >>> >>> @@ -59,6 +60,11 @@ __FBSDID("$FreeBSD$"); >>> #define CLKCONFIG_EPWMCLK_EN (1 << 8) >>> #define PWMSS_CLKSTATUS 0x0C >>> >>> +/* TRM chapter 2 memory map table 2-3 + VER register location */ >>> +#define PWMSS_REV_0 0x0000 >>> +#define PWMSS_REV_1 0x2000 >>> +#define PWMSS_REV_2 0x4000 >>> + >>> static device_probe_t am335x_pwmss_probe; >>> static device_attach_t am335x_pwmss_attach; >>> static device_detach_t am335x_pwmss_detach; >>> @@ -66,7 +72,7 @@ static device_detach_t am335x_pwmss_detach; >>> struct am335x_pwmss_softc { >>> struct simplebus_softc sc_simplebus; >>> device_t sc_dev; >>> - clk_ident_t sc_clk; >>> + struct syscon *syscon; >>> }; >>> >>> static device_method_t am335x_pwmss_methods[] = { >>> @@ -97,36 +103,45 @@ am335x_pwmss_attach(device_t dev) >>> { >>> struct am335x_pwmss_softc *sc; >>> uint32_t reg, id; >>> - phandle_t node; >>> + uint64_t rev_address; >>> + phandle_t node, opp_table; >>> >>> sc = device_get_softc(dev); >>> sc->sc_dev = dev; >>> >>> - sc->sc_clk = ti_hwmods_get_clock(dev); >>> - if (sc->sc_clk == INVALID_CLK_IDENT) { >>> - device_printf(dev, "failed to get device id based on ti,hwmods\n"); >>> - return (EINVAL); >>> + /* FIXME: For now; Go and kidnap syscon from opp-table */ >>> + opp_table = OF_finddevice("/opp-table"); >>> + if (opp_table == -1) { >>> + device_printf(dev, "Cant find /opp-table\n"); >>> + return (ENXIO); >>> } >>> + if (!OF_hasprop(opp_table, "syscon")) { >>> + device_printf(dev, "/opp-table doesnt have required syscon >>> property\n"); >>> + return (ENXIO); >>> + } >>> + if (syscon_get_by_ofw_property(dev, opp_table, "syscon", &sc->syscon) >>> != >>> 0) { >>> + device_printf(dev, "Failed to get syscon\n"); >>> + return (ENXIO); >>> + } >>> >>> - ti_prcm_clk_enable(sc->sc_clk); >>> - ti_scm_reg_read_4(SCM_PWMSS_CTRL, ®); >>> - switch (sc->sc_clk) { >>> - case PWMSS0_CLK: >>> - id = 0; >>> - break; >>> - case PWMSS1_CLK: >>> - id = 1; >>> - break; >>> + ti_sysc_clock_enable(device_get_parent(dev)); >>> >>> - case PWMSS2_CLK: >>> - id = 2; >>> - break; >>> - default: >>> - device_printf(dev, "unknown pwmss clock id: %d\n", sc->sc_clk); >>> - return (EINVAL); >>> + rev_address = ti_sysc_get_rev_address(device_get_parent(dev)); >>> + switch (rev_address) { >>> + case PWMSS_REV_0: >>> + id = 0; >>> + break; >>> + case PWMSS_REV_1: >>> + id = 1; >>> + break; >>> + case PWMSS_REV_2: >>> + id = 2; >>> + break; >>> } >>> + >>> + reg = SYSCON_READ_4(sc->syscon, SCM_PWMSS_CTRL); >>> reg |= (1 << id); >>> - ti_scm_reg_write_4(SCM_PWMSS_CTRL, reg); >>> + SYSCON_WRITE_4(sc->syscon, SCM_PWMSS_CTRL, reg); >>> >>> node = ofw_bus_get_node(dev); >>> >>> @@ -161,3 +176,4 @@ DEFINE_CLASS_1(am335x_pwmss, am335x_pwmss_driver, >>> am33 >>> static devclass_t am335x_pwmss_devclass; >>> DRIVER_MODULE(am335x_pwmss, simplebus, am335x_pwmss_driver, >>> am335x_pwmss_devclass, 0, 0); >>> MODULE_VERSION(am335x_pwmss, 1); >>> +MODULE_DEPEND(am335x_pwmss, ti_sysc, 1, 1, 1); >>> >>> Modified: head/sys/arm/ti/am335x/am335x_rtc.c >>> ============================================================================== >>> --- head/sys/arm/ti/am335x/am335x_rtc.c Thu Jul 30 14:42:50 >>> 2020 (r363699) >>> +++ head/sys/arm/ti/am335x/am335x_rtc.c Thu Jul 30 14:45:05 >>> 2020 (r363700) >>> @@ -39,8 +39,9 @@ __FBSDID("$FreeBSD$"); >>> >>> #include >>> >>> +#include >>> #include >>> -#include >>> +#include >>> #include >>> #include >>> >>> @@ -110,7 +111,7 @@ am335x_rtc_attach(device_t dev) >>> RTC_LOCK_INIT(sc); >>> >>> /* Enable the RTC module. */ >>> - ti_prcm_clk_enable(RTC_CLK); >>> + ti_sysc_clock_enable(device_get_parent(dev)); >>> rev = RTC_READ4(sc, RTC_REVISION); >>> device_printf(dev, "AM335X RTC v%d.%d.%d\n", >>> (rev >> 8) & 0x7, (rev >> 6) & 0x3, rev & 0x3f); >>> @@ -209,3 +210,4 @@ static devclass_t am335x_rtc_devclass; >>> DRIVER_MODULE(am335x_rtc, simplebus, am335x_rtc_driver, >>> am335x_rtc_devclass, 0, 0); >>> MODULE_VERSION(am335x_rtc, 1); >>> MODULE_DEPEND(am335x_rtc, simplebus, 1, 1, 1); >>> +MODULE_DEPEND(am335x_rtc, ti_sysc, 1, 1, 1); >>> >>> Modified: head/sys/arm/ti/am335x/am335x_scm.c >>> ============================================================================== >>> --- head/sys/arm/ti/am335x/am335x_scm.c Thu Jul 30 14:42:50 >>> 2020 (r363699) >>> +++ head/sys/arm/ti/am335x/am335x_scm.c Thu Jul 30 14:45:05 >>> 2020 (r363700) >>> @@ -40,11 +40,15 @@ __FBSDID("$FreeBSD$"); >>> #include >>> #include >>> >>> +#include >>> +#include "syscon_if.h" >>> + >>> #define TZ_ZEROC 2731 >>> >>> struct am335x_scm_softc { >>> int sc_last_temp; >>> struct sysctl_oid *sc_temp_oid; >>> + struct syscon *syscon; >>> }; >>> >>> static int >>> @@ -60,7 +64,7 @@ am335x_scm_temp_sysctl(SYSCTL_HANDLER_ARGS) >>> >>> /* Read the temperature and convert to Kelvin. */ >>> for(i = 50; i > 0; i--) { >>> - ti_scm_reg_read_4(SCM_BGAP_CTRL, ®); >>> + reg = SYSCON_READ_4(sc->syscon, SCM_BGAP_CTRL); >>> if ((reg & SCM_BGAP_EOCZ) == 0) >>> break; >>> DELAY(50); >>> @@ -96,6 +100,9 @@ am335x_scm_identify(driver_t *driver, device_t >>> parent) >>> static int >>> am335x_scm_probe(device_t dev) >>> { >>> + /* Just allow the first one */ >>> + if (strcmp(device_get_nameunit(dev), "am335x_scm0") != 0) >>> + return (ENXIO); >>> >>> device_set_desc(dev, "AM335x Control Module Extension"); >>> >>> @@ -109,21 +116,40 @@ am335x_scm_attach(device_t dev) >>> struct sysctl_ctx_list *ctx; >>> struct sysctl_oid_list *tree; >>> uint32_t reg; >>> + phandle_t opp_table; >>> + int err; >>> >>> + sc = device_get_softc(dev); >>> + >>> + /* FIXME: For now; Go and kidnap syscon from opp-table */ >>> + opp_table = OF_finddevice("/opp-table"); >>> + if (opp_table == -1) { >>> + device_printf(dev, "Cant find /opp-table\n"); >>> + return (ENXIO); >>> + } >>> + if (!OF_hasprop(opp_table, "syscon")) { >>> + device_printf(dev, "/opp-table missing syscon property\n"); >>> + return (ENXIO); >>> + } >>> + err = syscon_get_by_ofw_property(dev, opp_table, "syscon", >>> &sc->syscon); >>> + if (err) { >>> + device_printf(dev, "Failed to get syscon\n"); >>> + return (ENXIO); >>> + } >>> + >>> /* Reset the digital outputs. */ >>> - ti_scm_reg_write_4(SCM_BGAP_CTRL, 0); >>> - ti_scm_reg_read_4(SCM_BGAP_CTRL, ®); >>> + SYSCON_WRITE_4(sc->syscon, SCM_BGAP_CTRL, 0); >>> + reg = SYSCON_READ_4(sc->syscon, SCM_BGAP_CTRL); >>> DELAY(500); >>> /* Set continous mode. */ >>> - ti_scm_reg_write_4(SCM_BGAP_CTRL, SCM_BGAP_CONTCONV); >>> - ti_scm_reg_read_4(SCM_BGAP_CTRL, ®); >>> + SYSCON_WRITE_4(sc->syscon, SCM_BGAP_CTRL, SCM_BGAP_CONTCONV); >>> + reg = SYSCON_READ_4(sc->syscon, SCM_BGAP_CTRL); >>> DELAY(500); >>> /* Start the ADC conversion. */ >>> reg = SCM_BGAP_CLRZ | SCM_BGAP_CONTCONV | SCM_BGAP_SOC; >>> - ti_scm_reg_write_4(SCM_BGAP_CTRL, reg); >>> + SYSCON_WRITE_4(sc->syscon, SCM_BGAP_CTRL, reg); >>> >>> /* Temperature sysctl. */ >>> - sc = device_get_softc(dev); >>> ctx = device_get_sysctl_ctx(dev); >>> tree = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); >>> sc->sc_temp_oid = SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, >>> @@ -145,7 +171,7 @@ am335x_scm_detach(device_t dev) >>> sysctl_remove_oid(sc->sc_temp_oid, 1, 0); >>> >>> /* Stop the bandgap ADC. */ >>> - ti_scm_reg_write_4(SCM_BGAP_CTRL, SCM_BGAP_BGOFF); >>> >>> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >>> _______________________________________________ >>> svn-src-all@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/svn-src-all >>> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" >>> >> >> > -- Mateusz Guzik