From owner-svn-src-head@freebsd.org Sun Oct 4 13:24: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 DF7ED42880B; Sun, 4 Oct 2020 13:24:59 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C44GM5dBXz4g5Z; Sun, 4 Oct 2020 13:24:59 +0000 (UTC) (envelope-from melifaro@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 A443A24EAB; Sun, 4 Oct 2020 13:24:59 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 094DOxOj023168; Sun, 4 Oct 2020 13:24:59 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 094DOwRj023164; Sun, 4 Oct 2020 13:24:58 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202010041324.094DOwRj023164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 4 Oct 2020 13:24:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366424 - in head: sys/net sys/net/route tests/sys/net/routing X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head: sys/net sys/net/route tests/sys/net/routing X-SVN-Commit-Revision: 366424 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, 04 Oct 2020 13:24:59 -0000 Author: melifaro Date: Sun Oct 4 13:24:58 2020 New Revision: 366424 URL: https://svnweb.freebsd.org/changeset/base/366424 Log: Fix route flags update during RTM_CHANGE. Nexthop lookup was not consireding rt_flags when doing structure comparison, which lead to an original nexthop selection when changing flags. Fix the case by adding rt_flags field into comparison and rearranging nhop_priv fields to allow for efficient matching. Fix `route change X/Y flags` case - recent changes disallowed specifying RTF_GATEWAY flag without actual gateway. It turns out, route(8) fills in RTF_GATEWAY by default, unless -interface flag is specified. Fix regression by clearing RTF_GATEWAY flag instead of failing. Fix route flag reporting in RTM_CHANGE messages by explicitly updating rtm_flags after operation competion. Add IPv4/IPv6 tests for flag-only route changes. Modified: head/sys/net/route/nhop_ctl.c head/sys/net/route/nhop_var.h head/sys/net/route/route_ctl.c head/sys/net/rtsock.c head/tests/sys/net/routing/test_rtsock_l3.c Modified: head/sys/net/route/nhop_ctl.c ============================================================================== --- head/sys/net/route/nhop_ctl.c Sun Oct 4 06:14:51 2020 (r366423) +++ head/sys/net/route/nhop_ctl.c Sun Oct 4 13:24:58 2020 (r366424) @@ -164,8 +164,7 @@ cmp_priv(const struct nhop_priv *_one, const struct nh if (memcmp(_one->nh, _two->nh, NHOP_END_CMP) != 0) return (0); - if ((_one->nh_type != _two->nh_type) || - (_one->nh_family != _two->nh_family)) + if (memcmp(_one, _two, NH_PRIV_END_CMP) != 0) return (0); return (1); Modified: head/sys/net/route/nhop_var.h ============================================================================== --- head/sys/net/route/nhop_var.h Sun Oct 4 06:14:51 2020 (r366423) +++ head/sys/net/route/nhop_var.h Sun Oct 4 13:24:58 2020 (r366424) @@ -74,19 +74,24 @@ struct nh_control { /* Control plane-only nhop data */ struct nhop_object; struct nhop_priv { - uint32_t nh_idx; /* nexthop index */ + /* nhop lookup comparison start */ uint8_t nh_family; /* address family of the lookup */ + uint8_t spare; uint16_t nh_type; /* nexthop type */ + uint32_t rt_flags; /* routing flags for the control plane */ + /* nhop lookup comparison end */ + uint32_t nh_idx; /* nexthop index */ void *cb_func; /* function handling additional rewrite caps */ u_int nh_refcnt; /* number of references, refcount(9) */ u_int nh_linked; /* refcount(9), == 2 if linked to the list */ - int rt_flags; /* routing flags for the control plane */ struct nhop_object *nh; /* backreference to the dataplane nhop */ struct nh_control *nh_control; /* backreference to the rnh */ struct nhop_priv *nh_next; /* hash table membership */ struct vnet *nh_vnet; /* vnet nhop belongs to */ struct epoch_context nh_epoch_ctx; /* epoch data for nhop */ }; + +#define NH_PRIV_END_CMP (__offsetof(struct nhop_priv, nh_idx)) #define NH_IS_PINNED(_nh) ((!NH_IS_NHGRP(_nh)) && \ ((_nh)->nh_priv->rt_flags & RTF_PINNED)) Modified: head/sys/net/route/route_ctl.c ============================================================================== --- head/sys/net/route/route_ctl.c Sun Oct 4 06:14:51 2020 (r366423) +++ head/sys/net/route/route_ctl.c Sun Oct 4 13:24:58 2020 (r366424) @@ -733,8 +733,15 @@ rib_change_route(uint32_t fibnum, struct rt_addrinfo * /* Check if updated gateway exists */ if ((info->rti_flags & RTF_GATEWAY) && - (info->rti_info[RTAX_GATEWAY] == NULL)) - return (EINVAL); + (info->rti_info[RTAX_GATEWAY] == NULL)) { + + /* + * route(8) adds RTF_GATEWAY flag if -interface is not set. + * Remove RTF_GATEWAY to enforce consistency and maintain + * compatibility.. + */ + info->rti_flags &= ~RTF_GATEWAY; + } /* * route change is done in multiple steps, with dropping and Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sun Oct 4 06:14:51 2020 (r366423) +++ head/sys/net/rtsock.c Sun Oct 4 13:24:58 2020 (r366424) @@ -965,6 +965,7 @@ route_output(struct mbuf *m, struct socket *so, ...) #endif nh = rc.rc_nh_new; rtm->rtm_index = nh->nh_ifp->if_index; + rtm->rtm_flags = rc.rc_rt->rte_flags | nhop_get_rtflags(nh); } break; Modified: head/tests/sys/net/routing/test_rtsock_l3.c ============================================================================== --- head/tests/sys/net/routing/test_rtsock_l3.c Sun Oct 4 06:14:51 2020 (r366423) +++ head/tests/sys/net/routing/test_rtsock_l3.c Sun Oct 4 13:24:58 2020 (r366424) @@ -431,8 +431,8 @@ ATF_TC_BODY(rtm_add_v4_gw_direct_success, tc) verify_route_message(rtm, RTM_ADD, (struct sockaddr *)&net4, (struct sockaddr *)&mask4, (struct sockaddr *)&gw4); - /* XXX: Currently kernel sets RTF_UP automatically but does NOT report it in the reply */ - verify_route_message_extra(rtm, c->ifindex, RTF_DONE | RTF_GATEWAY | RTF_STATIC); + verify_route_message_extra(rtm, c->ifindex, + RTF_UP | RTF_DONE | RTF_GATEWAY | RTF_STATIC); } ATF_TC_CLEANUP(rtm_add_v4_gw_direct_success, tc) @@ -568,7 +568,7 @@ ATF_TC_BODY(rtm_change_v4_gw_success, tc) (struct sockaddr *)&mask4, (struct sockaddr *)&gw4); verify_route_message_extra(rtm, if_nametoindex(c->ifnames[1]), - RTF_DONE | RTF_GATEWAY | RTF_STATIC); + RTF_UP | RTF_DONE | RTF_GATEWAY | RTF_STATIC); /* Verify the change has actually taken place */ prepare_route_message(rtm, RTM_GET, (struct sockaddr *)&net4, @@ -591,7 +591,7 @@ ATF_TC_BODY(rtm_change_v4_gw_success, tc) } RTM_DECLARE_ROOT_TEST(rtm_change_v4_mtu_success, - "Tests IPv4 path mtu change"); + "Tests IPv4 path mtu change"); ATF_TC_BODY(rtm_change_v4_mtu_success, tc) { @@ -639,7 +639,56 @@ ATF_TC_BODY(rtm_change_v4_mtu_success, tc) "expected mtu: %lu, got %lu", test_mtu, rtm->rtm_rmx.rmx_mtu); } +RTM_DECLARE_ROOT_TEST(rtm_change_v4_flags_success, + "Tests IPv4 path flags change"); +ATF_TC_BODY(rtm_change_v4_flags_success, tc) +{ + DECLARE_TEST_VARS; + + uint32_t test_flags = RTF_PROTO1 | RTF_PROTO2 | RTF_PROTO3 | RTF_STATIC; + uint32_t desired_flags; + + c = presetup_ipv4(tc); + + /* Create IPv4 subnetwork with smaller prefix */ + struct sockaddr_in mask4; + struct sockaddr_in net4; + struct sockaddr_in gw4; + prepare_v4_network(c, &net4, &mask4, &gw4); + + prepare_route_message(rtm, RTM_ADD, (struct sockaddr *)&net4, + (struct sockaddr *)&mask4, (struct sockaddr *)&gw4); + + /* Set test flags during route addition */ + desired_flags = RTF_UP | RTF_DONE | RTF_GATEWAY | test_flags; + rtm->rtm_flags |= test_flags; + rtsock_send_rtm(c->rtsock_fd, rtm); + rtm = rtsock_read_rtm_reply(c->rtsock_fd, buffer, sizeof(buffer), rtm->rtm_seq); + + /* Change flags */ + prepare_route_message(rtm, RTM_CHANGE, (struct sockaddr *)&net4, + (struct sockaddr *)&mask4, NULL); + rtm->rtm_flags &= ~test_flags; + desired_flags &= ~test_flags; + + rtsock_send_rtm(c->rtsock_fd, rtm); + rtm = rtsock_read_rtm_reply(c->rtsock_fd, buffer, sizeof(buffer), rtm->rtm_seq); + + /* Verify updated flags */ + verify_route_message_extra(rtm, c->ifindex, desired_flags | RTF_DONE); + + /* Verify the change has actually taken place */ + prepare_route_message(rtm, RTM_GET, (struct sockaddr *)&net4, + (struct sockaddr *)&mask4, NULL); + + rtsock_send_rtm(c->rtsock_fd, rtm); + rtm = rtsock_read_rtm_reply(c->rtsock_fd, buffer, sizeof(buffer), rtm->rtm_seq); + + verify_route_message_extra(rtm, c->ifindex, desired_flags | RTF_DONE); +} + + ATF_TC_WITH_CLEANUP(rtm_add_v6_gu_gw_gu_direct_success); ATF_TC_HEAD(rtm_add_v6_gu_gw_gu_direct_success, tc) { @@ -674,8 +723,8 @@ ATF_TC_BODY(rtm_add_v6_gu_gw_gu_direct_success, tc) verify_route_message(rtm, RTM_ADD, (struct sockaddr *)&net6, (struct sockaddr *)&mask6, (struct sockaddr *)&gw6); - /* XXX: Currently kernel sets RTF_UP automatically but does NOT report it in the reply */ - verify_route_message_extra(rtm, c->ifindex, RTF_DONE | RTF_GATEWAY | RTF_STATIC); + verify_route_message_extra(rtm, c->ifindex, + RTF_UP | RTF_DONE | RTF_GATEWAY | RTF_STATIC); } ATF_TC_CLEANUP(rtm_add_v6_gu_gw_gu_direct_success, tc) @@ -791,7 +840,7 @@ ATF_TC_BODY(rtm_change_v6_gw_success, tc) (struct sockaddr *)&mask6, (struct sockaddr *)&gw6); verify_route_message_extra(rtm, if_nametoindex(c->ifnames[1]), - RTF_DONE | RTF_GATEWAY | RTF_STATIC); + RTF_UP | RTF_DONE | RTF_GATEWAY | RTF_STATIC); /* Verify the change has actually taken place */ prepare_route_message(rtm, RTM_GET, (struct sockaddr *)&net6, @@ -862,6 +911,55 @@ ATF_TC_BODY(rtm_change_v6_mtu_success, tc) "expected mtu: %lu, got %lu", test_mtu, rtm->rtm_rmx.rmx_mtu); } +RTM_DECLARE_ROOT_TEST(rtm_change_v6_flags_success, + "Tests IPv6 path flags change"); + +ATF_TC_BODY(rtm_change_v6_flags_success, tc) +{ + DECLARE_TEST_VARS; + + uint32_t test_flags = RTF_PROTO1 | RTF_PROTO2 | RTF_PROTO3 | RTF_STATIC; + uint32_t desired_flags; + + c = presetup_ipv6(tc); + + /* Create IPv6 subnetwork with smaller prefix */ + struct sockaddr_in6 mask6; + struct sockaddr_in6 net6; + struct sockaddr_in6 gw6; + prepare_v6_network(c, &net6, &mask6, &gw6); + + prepare_route_message(rtm, RTM_ADD, (struct sockaddr *)&net6, + (struct sockaddr *)&mask6, (struct sockaddr *)&gw6); + + /* Set test flags during route addition */ + desired_flags = RTF_UP | RTF_DONE | RTF_GATEWAY | test_flags; + rtm->rtm_flags |= test_flags; + rtsock_send_rtm(c->rtsock_fd, rtm); + rtm = rtsock_read_rtm_reply(c->rtsock_fd, buffer, sizeof(buffer), rtm->rtm_seq); + + /* Change flags */ + prepare_route_message(rtm, RTM_CHANGE, (struct sockaddr *)&net6, + (struct sockaddr *)&mask6, NULL); + rtm->rtm_flags &= ~test_flags; + desired_flags &= ~test_flags; + + rtsock_send_rtm(c->rtsock_fd, rtm); + rtm = rtsock_read_rtm_reply(c->rtsock_fd, buffer, sizeof(buffer), rtm->rtm_seq); + + /* Verify updated flags */ + verify_route_message_extra(rtm, c->ifindex, desired_flags | RTF_DONE); + + /* Verify the change has actually taken place */ + prepare_route_message(rtm, RTM_GET, (struct sockaddr *)&net6, + (struct sockaddr *)&mask6, NULL); + + rtsock_send_rtm(c->rtsock_fd, rtm); + rtm = rtsock_read_rtm_reply(c->rtsock_fd, buffer, sizeof(buffer), rtm->rtm_seq); + + verify_route_message_extra(rtm, c->ifindex, desired_flags | RTF_DONE); +} + ATF_TC_WITH_CLEANUP(rtm_add_v4_temporal1_success); ATF_TC_HEAD(rtm_add_v4_temporal1_success, tc) { @@ -900,7 +998,8 @@ ATF_TC_BODY(rtm_add_v4_temporal1_success, tc) verify_route_message(rtm, RTM_DELETE, (struct sockaddr *)&net4, (struct sockaddr *)&mask4, (struct sockaddr *)&gw4); - verify_route_message_extra(rtm, c->ifindex, RTF_GATEWAY | RTF_DONE | RTF_STATIC); + verify_route_message_extra(rtm, c->ifindex, + RTF_DONE | RTF_GATEWAY | RTF_STATIC); } ATF_TC_CLEANUP(rtm_add_v4_temporal1_success, tc) @@ -946,9 +1045,8 @@ ATF_TC_BODY(rtm_add_v6_temporal1_success, tc) verify_route_message(rtm, RTM_DELETE, (struct sockaddr *)&net6, (struct sockaddr *)&mask6, (struct sockaddr *)&gw6); - - /* XXX: Currently kernel sets RTF_UP automatically but does NOT report it in the reply */ - verify_route_message_extra(rtm, c->ifindex, RTF_GATEWAY | RTF_DONE | RTF_STATIC); + verify_route_message_extra(rtm, c->ifindex, + RTF_DONE | RTF_GATEWAY | RTF_STATIC); } ATF_TC_CLEANUP(rtm_add_v6_temporal1_success, tc) @@ -1299,8 +1397,10 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, rtm_del_v6_gu_prefix_nogw_success); ATF_TP_ADD_TC(tp, rtm_change_v4_gw_success); ATF_TP_ADD_TC(tp, rtm_change_v4_mtu_success); + ATF_TP_ADD_TC(tp, rtm_change_v4_flags_success); ATF_TP_ADD_TC(tp, rtm_change_v6_gw_success); ATF_TP_ADD_TC(tp, rtm_change_v6_mtu_success); + ATF_TP_ADD_TC(tp, rtm_change_v6_flags_success); /* ifaddr tests */ ATF_TP_ADD_TC(tp, rtm_add_v6_gu_ifa_hostroute_success); ATF_TP_ADD_TC(tp, rtm_add_v6_gu_ifa_prefixroute_success); From owner-svn-src-head@freebsd.org Sun Oct 4 15:22: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 230AB42B276; Sun, 4 Oct 2020 15:22:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C46sg0BCQz3bxL; Sun, 4 Oct 2020 15:22:15 +0000 (UTC) (envelope-from tuexen@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 DF1B626788; Sun, 4 Oct 2020 15:22:14 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 094FMEZb001738; Sun, 4 Oct 2020 15:22:14 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 094FMEAh001737; Sun, 4 Oct 2020 15:22:14 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202010041522.094FMEAh001737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 4 Oct 2020 15:22:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366425 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 366425 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, 04 Oct 2020 15:22:15 -0000 Author: tuexen Date: Sun Oct 4 15:22:14 2020 New Revision: 366425 URL: https://svnweb.freebsd.org/changeset/base/366425 Log: Cleanup, no functional change intended. MFC after: 3 days Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sun Oct 4 13:24:58 2020 (r366424) +++ head/sys/netinet/sctp_indata.c Sun Oct 4 15:22:14 2020 (r366425) @@ -285,17 +285,15 @@ sctp_build_ctl_nchunk(struct sctp_inpcb *inp, struct s static void sctp_mark_non_revokable(struct sctp_association *asoc, uint32_t tsn) { - uint32_t gap, i, cumackp1; - int fnd = 0; - int in_r = 0, in_nr = 0; + uint32_t gap, i; + int in_r, in_nr; if (SCTP_BASE_SYSCTL(sctp_do_drain) == 0) { return; } - cumackp1 = asoc->cumulative_tsn + 1; - if (SCTP_TSN_GT(cumackp1, tsn)) { + if (SCTP_TSN_GE(asoc->cumulative_tsn, tsn)) { /* - * this tsn is behind the cum ack and thus we don't need to + * This tsn is behind the cum ack and thus we don't need to * worry about it being moved from one to the other. */ return; @@ -303,33 +301,27 @@ sctp_mark_non_revokable(struct sctp_association *asoc, SCTP_CALC_TSN_TO_GAP(gap, tsn, asoc->mapping_array_base_tsn); in_r = SCTP_IS_TSN_PRESENT(asoc->mapping_array, gap); in_nr = SCTP_IS_TSN_PRESENT(asoc->nr_mapping_array, gap); - if ((in_r == 0) && (in_nr == 0)) { -#ifdef INVARIANTS - panic("Things are really messed up now"); -#else - SCTP_PRINTF("gap:%x tsn:%x\n", gap, tsn); - sctp_print_mapping_array(asoc); -#endif - } - if (in_nr == 0) + KASSERT(in_r || in_nr, ("%s: Things are really messed up now", __FUNCTION__)); + if (!in_nr) { SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); - if (in_r) - SCTP_UNSET_TSN_PRESENT(asoc->mapping_array, gap); - if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { - asoc->highest_tsn_inside_nr_map = tsn; + if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { + asoc->highest_tsn_inside_nr_map = tsn; + } } - if (tsn == asoc->highest_tsn_inside_map) { - /* We must back down to see what the new highest is */ - for (i = tsn - 1; SCTP_TSN_GE(i, asoc->mapping_array_base_tsn); i--) { - SCTP_CALC_TSN_TO_GAP(gap, i, asoc->mapping_array_base_tsn); - if (SCTP_IS_TSN_PRESENT(asoc->mapping_array, gap)) { - asoc->highest_tsn_inside_map = i; - fnd = 1; - break; + if (in_r) { + SCTP_UNSET_TSN_PRESENT(asoc->mapping_array, gap); + if (tsn == asoc->highest_tsn_inside_map) { + /* We must back down to see what the new highest is. */ + for (i = tsn - 1; SCTP_TSN_GE(i, asoc->mapping_array_base_tsn); i--) { + SCTP_CALC_TSN_TO_GAP(gap, i, asoc->mapping_array_base_tsn); + if (SCTP_IS_TSN_PRESENT(asoc->mapping_array, gap)) { + asoc->highest_tsn_inside_map = i; + break; + } } - } - if (!fnd) { - asoc->highest_tsn_inside_map = asoc->mapping_array_base_tsn - 1; + if (!SCTP_TSN_GE(i, asoc->mapping_array_base_tsn)) { + asoc->highest_tsn_inside_map = asoc->mapping_array_base_tsn - 1; + } } } } From owner-svn-src-head@freebsd.org Sun Oct 4 15:37: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 BB5C842BBA9; Sun, 4 Oct 2020 15:37:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C47CM4Vljz3cv7; Sun, 4 Oct 2020 15:37:35 +0000 (UTC) (envelope-from tuexen@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 7F3BF267B3; Sun, 4 Oct 2020 15:37:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 094FbZNV008152; Sun, 4 Oct 2020 15:37:35 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 094FbZWK008151; Sun, 4 Oct 2020 15:37:35 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202010041537.094FbZWK008151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 4 Oct 2020 15:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366426 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 366426 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, 04 Oct 2020 15:37:35 -0000 Author: tuexen Date: Sun Oct 4 15:37:34 2020 New Revision: 366426 URL: https://svnweb.freebsd.org/changeset/base/366426 Log: Use __func__ instead of __FUNCTION__ for consistency. MFC after: 3 days Modified: head/sys/netinet/sctp_bsd_addr.c head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_bsd_addr.c ============================================================================== --- head/sys/netinet/sctp_bsd_addr.c Sun Oct 4 15:22:14 2020 (r366425) +++ head/sys/netinet/sctp_bsd_addr.c Sun Oct 4 15:37:34 2020 (r366426) @@ -373,7 +373,7 @@ sctp_get_mbuf_for_msg(unsigned int space_needed, int w m_freem(m); return (NULL); } - KASSERT(SCTP_BUF_NEXT(m) == NULL, ("%s: no chain allowed", __FUNCTION__)); + KASSERT(SCTP_BUF_NEXT(m) == NULL, ("%s: no chain allowed", __func__)); } #ifdef SCTP_MBUF_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sun Oct 4 15:22:14 2020 (r366425) +++ head/sys/netinet/sctp_indata.c Sun Oct 4 15:37:34 2020 (r366426) @@ -301,7 +301,7 @@ sctp_mark_non_revokable(struct sctp_association *asoc, SCTP_CALC_TSN_TO_GAP(gap, tsn, asoc->mapping_array_base_tsn); in_r = SCTP_IS_TSN_PRESENT(asoc->mapping_array, gap); in_nr = SCTP_IS_TSN_PRESENT(asoc->nr_mapping_array, gap); - KASSERT(in_r || in_nr, ("%s: Things are really messed up now", __FUNCTION__)); + KASSERT(in_r || in_nr, ("%s: Things are really messed up now", __func__)); if (!in_nr) { SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); if (SCTP_TSN_GT(tsn, asoc->highest_tsn_inside_nr_map)) { From owner-svn-src-head@freebsd.org Sun Oct 4 16:30: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 6131C42CADF; Sun, 4 Oct 2020 16:30:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C48My1wCZz3frH; Sun, 4 Oct 2020 16:30:06 +0000 (UTC) (envelope-from kib@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 2501E271BA; Sun, 4 Oct 2020 16:30:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 094GU6N5038651; Sun, 4 Oct 2020 16:30:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 094GU5MQ038649; Sun, 4 Oct 2020 16:30:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010041630.094GU5MQ038649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 4 Oct 2020 16:30:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366428 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 366428 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, 04 Oct 2020 16:30:06 -0000 Author: kib Date: Sun Oct 4 16:30:05 2020 New Revision: 366428 URL: https://svnweb.freebsd.org/changeset/base/366428 Log: Refactor sleepq_catch_signals(). - Extract suspension check into sig_ast_checksusp() helper. - Extract signal check and calculation of the interruption errno into sig_ast_needsigchk() helper. The helpers are moved to kern_sig.c which is the proper place for signal-related code. Improve control flow in sleepq_catch_signals(), to handle ret == 0 (can sleep) and ret != 0 (interrupted) only once, by separating checking code into sleepq_check_ast_sq_locked(), which return value is interpreted at single location. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D26628 Modified: head/sys/kern/kern_sig.c head/sys/kern/subr_sleepqueue.c head/sys/sys/signalvar.h Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Sun Oct 4 16:27:49 2020 (r366427) +++ head/sys/kern/kern_sig.c Sun Oct 4 16:30:05 2020 (r366428) @@ -3139,6 +3139,71 @@ postsig(int sig) return (1); } +int +sig_ast_checksusp(struct thread *td) +{ + struct proc *p; + int ret; + + p = td->td_proc; + PROC_LOCK_ASSERT(p, MA_OWNED); + + if ((td->td_flags & TDF_NEEDSUSPCHK) == 0) + return (0); + + ret = thread_suspend_check(1); + MPASS(ret == 0 || ret == EINTR || ret == ERESTART); + return (ret); +} + +int +sig_ast_needsigchk(struct thread *td) +{ + struct proc *p; + struct sigacts *ps; + int ret, sig; + + p = td->td_proc; + PROC_LOCK_ASSERT(p, MA_OWNED); + + if ((td->td_flags & TDF_NEEDSIGCHK) == 0) + return (0); + + ps = p->p_sigacts; + mtx_lock(&ps->ps_mtx); + sig = cursig(td); + if (sig == -1) { + mtx_unlock(&ps->ps_mtx); + KASSERT((td->td_flags & TDF_SBDRY) != 0, ("lost TDF_SBDRY")); + KASSERT(TD_SBDRY_INTR(td), + ("lost TDF_SERESTART of TDF_SEINTR")); + KASSERT((td->td_flags & (TDF_SEINTR | TDF_SERESTART)) != + (TDF_SEINTR | TDF_SERESTART), + ("both TDF_SEINTR and TDF_SERESTART")); + ret = TD_SBDRY_ERRNO(td); + } else if (sig != 0) { + ret = SIGISMEMBER(ps->ps_sigintr, sig) ? EINTR : ERESTART; + mtx_unlock(&ps->ps_mtx); + } else { + mtx_unlock(&ps->ps_mtx); + ret = 0; + } + + /* + * Do not go into sleep if this thread was the ptrace(2) + * attach leader. cursig() consumed SIGSTOP from PT_ATTACH, + * but we usually act on the signal by interrupting sleep, and + * should do that here as well. + */ + if ((td->td_dbgflags & TDB_FSTP) != 0) { + if (ret == 0) + ret = EINTR; + td->td_dbgflags &= ~TDB_FSTP; + } + + return (ret); +} + void proc_wkilled(struct proc *p) { Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Sun Oct 4 16:27:49 2020 (r366427) +++ head/sys/kern/subr_sleepqueue.c Sun Oct 4 16:30:05 2020 (r366428) @@ -433,33 +433,20 @@ sleepq_sleepcnt(const void *wchan, int queue) return (sq->sq_blockedcnt[queue]); } -/* - * Marks the pending sleep of the current thread as interruptible and - * makes an initial check for pending signals before putting a thread - * to sleep. Enters and exits with the thread lock held. Thread lock - * may have transitioned from the sleepq lock to a run lock. - */ static int -sleepq_catch_signals(const void *wchan, int pri) +sleepq_check_ast_sc_locked(struct thread *td, struct sleepqueue_chain *sc) { - struct sleepqueue_chain *sc; - struct sleepqueue *sq; - struct thread *td; struct proc *p; - struct sigacts *ps; - int sig, ret; + int ret; - ret = 0; - td = curthread; - p = curproc; - sc = SC_LOOKUP(wchan); mtx_assert(&sc->sc_lock, MA_OWNED); - MPASS(wchan != NULL); + + ret = 0; if ((td->td_pflags & TDP_WAKEUP) != 0) { td->td_pflags &= ~TDP_WAKEUP; ret = EINTR; thread_lock(td); - goto out; + return (0); } /* @@ -467,91 +454,89 @@ sleepq_catch_signals(const void *wchan, int pri) * thread. If not, we can switch immediately. */ thread_lock(td); - if ((td->td_flags & (TDF_NEEDSIGCHK | TDF_NEEDSUSPCHK)) != 0) { - thread_unlock(td); - mtx_unlock_spin(&sc->sc_lock); - CTR3(KTR_PROC, "sleepq catching signals: thread %p (pid %ld, %s)", - (void *)td, (long)p->p_pid, td->td_name); - PROC_LOCK(p); - /* - * Check for suspension first. Checking for signals and then - * suspending could result in a missed signal, since a signal - * can be delivered while this thread is suspended. - */ - if ((td->td_flags & TDF_NEEDSUSPCHK) != 0) { - ret = thread_suspend_check(1); - MPASS(ret == 0 || ret == EINTR || ret == ERESTART); - if (ret != 0) { - PROC_UNLOCK(p); - mtx_lock_spin(&sc->sc_lock); - thread_lock(td); - goto out; - } - } - if ((td->td_flags & TDF_NEEDSIGCHK) != 0) { - ps = p->p_sigacts; - mtx_lock(&ps->ps_mtx); - sig = cursig(td); - if (sig == -1) { - mtx_unlock(&ps->ps_mtx); - KASSERT((td->td_flags & TDF_SBDRY) != 0, - ("lost TDF_SBDRY")); - KASSERT(TD_SBDRY_INTR(td), - ("lost TDF_SERESTART of TDF_SEINTR")); - KASSERT((td->td_flags & - (TDF_SEINTR | TDF_SERESTART)) != - (TDF_SEINTR | TDF_SERESTART), - ("both TDF_SEINTR and TDF_SERESTART")); - ret = TD_SBDRY_ERRNO(td); - } else if (sig != 0) { - ret = SIGISMEMBER(ps->ps_sigintr, sig) ? - EINTR : ERESTART; - mtx_unlock(&ps->ps_mtx); - } else { - mtx_unlock(&ps->ps_mtx); - } + if ((td->td_flags & (TDF_NEEDSIGCHK | TDF_NEEDSUSPCHK)) == 0) + return (0); - /* - * Do not go into sleep if this thread was the - * ptrace(2) attach leader. cursig() consumed - * SIGSTOP from PT_ATTACH, but we usually act - * on the signal by interrupting sleep, and - * should do that here as well. - */ - if ((td->td_dbgflags & TDB_FSTP) != 0) { - if (ret == 0) - ret = EINTR; - td->td_dbgflags &= ~TDB_FSTP; - } - } - /* - * Lock the per-process spinlock prior to dropping the PROC_LOCK - * to avoid a signal delivery race. PROC_LOCK, PROC_SLOCK, and - * thread_lock() are currently held in tdsendsignal(). - */ - PROC_SLOCK(p); - mtx_lock_spin(&sc->sc_lock); + thread_unlock(td); + mtx_unlock_spin(&sc->sc_lock); + + p = td->td_proc; + CTR3(KTR_PROC, "sleepq catching signals: thread %p (pid %ld, %s)", + (void *)td, (long)p->p_pid, td->td_name); + PROC_LOCK(p); + + /* + * Check for suspension first. Checking for signals and then + * suspending could result in a missed signal, since a signal + * can be delivered while this thread is suspended. + */ + ret = sig_ast_checksusp(td); + if (ret != 0) { PROC_UNLOCK(p); + mtx_lock_spin(&sc->sc_lock); thread_lock(td); - PROC_SUNLOCK(p); + return (ret); } - if (ret == 0) { - sleepq_switch(wchan, pri); - return (0); - } -out: + + ret = sig_ast_needsigchk(td); + /* - * There were pending signals and this thread is still - * on the sleep queue, remove it from the sleep queue. + * Lock the per-process spinlock prior to dropping the + * PROC_LOCK to avoid a signal delivery race. + * PROC_LOCK, PROC_SLOCK, and thread_lock() are + * currently held in tdsendsignal(). */ - if (TD_ON_SLEEPQ(td)) { - sq = sleepq_lookup(wchan); - sleepq_remove_thread(sq, td); - } - MPASS(td->td_lock != &sc->sc_lock); - mtx_unlock_spin(&sc->sc_lock); - thread_unlock(td); + PROC_SLOCK(p); + mtx_lock_spin(&sc->sc_lock); + PROC_UNLOCK(p); + thread_lock(td); + PROC_SUNLOCK(p); + return (ret); +} + +/* + * Marks the pending sleep of the current thread as interruptible and + * makes an initial check for pending signals before putting a thread + * to sleep. Enters and exits with the thread lock held. Thread lock + * may have transitioned from the sleepq lock to a run lock. + */ +static int +sleepq_catch_signals(const void *wchan, int pri) +{ + struct thread *td; + struct sleepqueue_chain *sc; + struct sleepqueue *sq; + int ret; + + sc = SC_LOOKUP(wchan); + mtx_assert(&sc->sc_lock, MA_OWNED); + MPASS(wchan != NULL); + td = curthread; + + ret = sleepq_check_ast_sc_locked(td, sc); + THREAD_LOCK_ASSERT(td, MA_OWNED); + mtx_assert(&sc->sc_lock, MA_OWNED); + + if (ret == 0) { + /* + * No pending signals and no suspension requests found. + * Switch the thread off the cpu. + */ + sleepq_switch(wchan, pri); + } else { + /* + * There were pending signals and this thread is still + * on the sleep queue, remove it from the sleep queue. + */ + if (TD_ON_SLEEPQ(td)) { + sq = sleepq_lookup(wchan); + sleepq_remove_thread(sq, td); + } + MPASS(td->td_lock != &sc->sc_lock); + mtx_unlock_spin(&sc->sc_lock); + thread_unlock(td); + } return (ret); } Modified: head/sys/sys/signalvar.h ============================================================================== --- head/sys/sys/signalvar.h Sun Oct 4 16:27:49 2020 (r366427) +++ head/sys/sys/signalvar.h Sun Oct 4 16:30:05 2020 (r366428) @@ -399,6 +399,8 @@ void sigacts_copy(struct sigacts *dest, struct sigacts void sigacts_free(struct sigacts *ps); struct sigacts *sigacts_hold(struct sigacts *ps); int sigacts_shared(struct sigacts *ps); +int sig_ast_checksusp(struct thread *td); +int sig_ast_needsigchk(struct thread *td); void sig_drop_caught(struct proc *p); void sigexit(struct thread *td, int sig) __dead2; int sigev_findtd(struct proc *p, struct sigevent *sigev, struct thread **); From owner-svn-src-head@freebsd.org Sun Oct 4 16:33: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 1655742CC32; Sun, 4 Oct 2020 16:33:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C48S66sBWz3g6j; Sun, 4 Oct 2020 16:33:42 +0000 (UTC) (envelope-from kib@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 CE92E272C9; Sun, 4 Oct 2020 16:33:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 094GXgeE044464; Sun, 4 Oct 2020 16:33:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 094GXg4l044462; Sun, 4 Oct 2020 16:33:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010041633.094GXg4l044462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 4 Oct 2020 16:33:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366429 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 366429 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, 04 Oct 2020 16:33:43 -0000 Author: kib Date: Sun Oct 4 16:33:42 2020 New Revision: 366429 URL: https://svnweb.freebsd.org/changeset/base/366429 Log: Add sig_intr(9). It gives the answer would the thread sleep according to current state of signals and suspensions. Of course the answer is racy and allows for false-negatives (no sleep when signal is delivered after process lock is dropped). Also the answer might change due to signal rescheduling among threads in multi-threaded process. Still it is the best approximation I can provide, to answering the question was the thread interrupted. Reviewed by: markj Tested by: pho, rmacklem Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D26628 Modified: head/sys/kern/kern_sig.c head/sys/sys/signalvar.h Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Sun Oct 4 16:30:05 2020 (r366428) +++ head/sys/kern/kern_sig.c Sun Oct 4 16:33:42 2020 (r366429) @@ -3204,6 +3204,24 @@ sig_ast_needsigchk(struct thread *td) return (ret); } +int +sig_intr(void) +{ + struct thread *td; + struct proc *p; + int ret; + + td = curthread; + p = td->td_proc; + + PROC_LOCK(p); + ret = sig_ast_checksusp(td); + if (ret == 0) + ret = sig_ast_needsigchk(td); + PROC_UNLOCK(p); + return (ret); +} + void proc_wkilled(struct proc *p) { Modified: head/sys/sys/signalvar.h ============================================================================== --- head/sys/sys/signalvar.h Sun Oct 4 16:30:05 2020 (r366428) +++ head/sys/sys/signalvar.h Sun Oct 4 16:33:42 2020 (r366429) @@ -408,6 +408,7 @@ int sig_ffs(sigset_t *set); void sigfastblock_clear(struct thread *td); void sigfastblock_fetch(struct thread *td); void sigfastblock_setpend(struct thread *td, bool resched); +int sig_intr(void); void siginit(struct proc *p); void signotify(struct thread *td); void sigqueue_delete(struct sigqueue *queue, int sig); From owner-svn-src-head@freebsd.org Sun Oct 4 17:07: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 E445342D569; Sun, 4 Oct 2020 17:07:13 +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 4C49Bn5jDBz3yVJ; Sun, 4 Oct 2020 17:07:13 +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 A777427B79; Sun, 4 Oct 2020 17:07:13 +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 094H7DVv063363; Sun, 4 Oct 2020 17:07:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 094H7D2B063362; Sun, 4 Oct 2020 17:07:13 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202010041707.094H7D2B063362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 4 Oct 2020 17:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366430 - head/usr.sbin/ngctl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/ngctl X-SVN-Commit-Revision: 366430 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, 04 Oct 2020 17:07:14 -0000 Author: kevans Date: Sun Oct 4 17:07:13 2020 New Revision: 366430 URL: https://svnweb.freebsd.org/changeset/base/366430 Log: ngctl: add -c (compact output) for the dot command The output of "ngctl dot" is suitable for small netgraph networks. Even moderate complex netgraph setups (about a dozen nodes) are hard to understand from the .dot output, because each node and each hook are shown as a full blown structure. This patch allows to generate much more compact output and graphs by omitting the extra structures for the individual hooks. Instead the names of the hooks are labels to the edges. Submitted by: Lutz Donnerhacke Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21965 Modified: head/usr.sbin/ngctl/dot.c Modified: head/usr.sbin/ngctl/dot.c ============================================================================== --- head/usr.sbin/ngctl/dot.c Sun Oct 4 16:33:42 2020 (r366429) +++ head/usr.sbin/ngctl/dot.c Sun Oct 4 17:07:13 2020 (r366430) @@ -2,6 +2,7 @@ /* * dot.c * + * Copyright (c) 2019 Lutz Donnerhacke * Copyright (c) 2004 Brian Fundakowski Feldman * Copyright (c) 1996-1999 Whistle Communications, Inc. * All rights reserved. @@ -53,9 +54,11 @@ static int DotCmd(int ac, char **av); const struct ngcmd dot_cmd = { DotCmd, - "dot [outputfile]", + "dot [-c] [outputfile]", "Produce a GraphViz (.dot) of the entire netgraph.", - "If no outputfile is specified, stdout will be assumed.", + "If no outputfile is specified, stdout will be assumed." + " The optional -c argument generates a graph without separate" + " structures for edge names. Such a graph is more compact.", { "graphviz", "confdot" } }; @@ -66,12 +69,16 @@ DotCmd(int ac, char **av) struct namelist *nlist; FILE *f = stdout; int ch; + int compact = 0; u_int i; /* Get options */ optind = 1; - while ((ch = getopt(ac, av, "")) != -1) { + while ((ch = getopt(ac, av, "c")) != -1) { switch (ch) { + case 'c': + compact = 1; + break; case '?': default: return (CMDRTN_USAGE); @@ -109,9 +116,14 @@ DotCmd(int ac, char **av) } nlist = (struct namelist *)nlresp->data; - fprintf(f, "graph netgraph {\n"); - /* TODO: implement rank = same or subgraphs at some point */ - fprintf(f, "\tedge [ weight = 1.0 ];\n"); + if (compact) { + fprintf(f, "digraph netgraph {\n"); + fprintf(f, "\tedge [ dir = \"none\", fontsize = 10 ];\n"); + } else { + fprintf(f, "graph netgraph {\n"); + /* TODO: implement rank = same or subgraphs at some point */ + fprintf(f, "\tedge [ weight = 1.0 ];\n"); + } fprintf(f, "\tnode [ shape = record, fontsize = 12 ] {\n"); for (i = 0; i < nlist->numnames; i++) fprintf(f, "\t\t\"%jx\" [ label = \"{%s:|{%s|[%jx]:}}\" ];\n", @@ -159,30 +171,40 @@ DotCmd(int ac, char **av) continue; } - fprintf(f, "\tnode [ shape = octagon, fontsize = 10 ] {\n"); - for (j = 0; j < ninfo->hooks; j++) - fprintf(f, "\t\t\"%jx.%s\" [ label = \"%s\" ];\n", - (uintmax_t)nlist->nodeinfo[i].id, - hlist->link[j].ourhook, hlist->link[j].ourhook); - fprintf(f, "\t};\n"); + if (!compact) { + fprintf(f, "\tnode [ shape = octagon, fontsize = 10 ] {\n"); + for (j = 0; j < ninfo->hooks; j++) + fprintf(f, "\t\t\"%jx.%s\" [ label = \"%s\" ];\n", + (uintmax_t)nlist->nodeinfo[i].id, + hlist->link[j].ourhook, hlist->link[j].ourhook); + fprintf(f, "\t};\n"); - fprintf(f, "\t{\n\t\tedge [ weight = 2.0, style = bold ];\n"); - for (j = 0; j < ninfo->hooks; j++) - fprintf(f, "\t\t\"%jx\" -- \"%jx.%s\";\n", - (uintmax_t)nlist->nodeinfo[i].id, - (uintmax_t)nlist->nodeinfo[i].id, - hlist->link[j].ourhook); - fprintf(f, "\t};\n"); + fprintf(f, "\t{\n\t\tedge [ weight = 2.0, style = bold ];\n"); + for (j = 0; j < ninfo->hooks; j++) + fprintf(f, "\t\t\"%jx\" -- \"%jx.%s\";\n", + (uintmax_t)nlist->nodeinfo[i].id, + (uintmax_t)nlist->nodeinfo[i].id, + hlist->link[j].ourhook); + fprintf(f, "\t};\n"); + } for (j = 0; j < ninfo->hooks; j++) { /* Only print the edges going in one direction. */ if (hlist->link[j].nodeinfo.id > nlist->nodeinfo[i].id) continue; - fprintf(f, "\t\"%jx.%s\" -- \"%jx.%s\";\n", - (uintmax_t)nlist->nodeinfo[i].id, - hlist->link[j].ourhook, - (uintmax_t)hlist->link[j].nodeinfo.id, - hlist->link[j].peerhook); + if (compact) { + fprintf(f, "\t\"%jx\" -> \"%jx\" [ headlabel = \"%s\", taillabel = \"%s\" ] ;\n", + (uintmax_t)hlist->link[j].nodeinfo.id, + (uintmax_t)nlist->nodeinfo[i].id, + hlist->link[j].ourhook, + hlist->link[j].peerhook); + } else { + fprintf(f, "\t\"%jx.%s\" -- \"%jx.%s\";\n", + (uintmax_t)nlist->nodeinfo[i].id, + hlist->link[j].ourhook, + (uintmax_t)hlist->link[j].nodeinfo.id, + hlist->link[j].peerhook); + } } free(hlresp); } From owner-svn-src-head@freebsd.org Sun Oct 4 17:17: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 64C7C42D8F4; Sun, 4 Oct 2020 17:17:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C49QP22P6z3yxy; Sun, 4 Oct 2020 17:17:17 +0000 (UTC) (envelope-from hselasky@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 29A6427DD0; Sun, 4 Oct 2020 17:17:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 094HHHt0069579; Sun, 4 Oct 2020 17:17:17 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 094HHH9d069578; Sun, 4 Oct 2020 17:17:17 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010041717.094HHH9d069578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 4 Oct 2020 17:17:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366431 - head/sys/dev/usb/serial X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb/serial X-SVN-Commit-Revision: 366431 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, 04 Oct 2020 17:17:17 -0000 Author: hselasky Date: Sun Oct 4 17:17:16 2020 New Revision: 366431 URL: https://svnweb.freebsd.org/changeset/base/366431 Log: Add support for Google Cr50 (GSC) Closed Case Debugging UART interfaces to the USB generic serial port driver, ugensa. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21863 Submitted by: greg_unrelenting.technology (Greg V) Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/dev/usb/serial/ugensa.c Modified: head/sys/dev/usb/serial/ugensa.c ============================================================================== --- head/sys/dev/usb/serial/ugensa.c Sun Oct 4 17:07:13 2020 (r366430) +++ head/sys/dev/usb/serial/ugensa.c Sun Oct 4 17:17:16 2020 (r366431) @@ -161,6 +161,8 @@ static const STRUCT_USB_HOST_ID ugensa_devs[] = { {USB_VPI(USB_VENDOR_KYOCERA2, USB_PRODUCT_KYOCERA2_CDMA_MSM_K, 1)}, {USB_VPI(USB_VENDOR_HP, USB_PRODUCT_HP_49GPLUS, 1)}, {USB_VPI(USB_VENDOR_NOVATEL2, USB_PRODUCT_NOVATEL2_FLEXPACKGPS, 3)}, + {USB_VENDOR(USB_VENDOR_GOOGLE), USB_IFACE_CLASS(UICLASS_VENDOR), + USB_IFACE_SUBCLASS(0x50), USB_IFACE_PROTOCOL(0x01), USB_DRIVER_INFO(10)}, }; DRIVER_MODULE(ugensa, uhub, ugensa_driver, ugensa_devclass, NULL, 0); From owner-svn-src-head@freebsd.org Sun Oct 4 17:23: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 DDA7C42DF51; Sun, 4 Oct 2020 17:23:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C49Ym5YSyz40pl; Sun, 4 Oct 2020 17:23:40 +0000 (UTC) (envelope-from hselasky@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 A1F3F27C54; Sun, 4 Oct 2020 17:23:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 094HNeAd075461; Sun, 4 Oct 2020 17:23:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 094HNeSi075459; Sun, 4 Oct 2020 17:23:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010041723.094HNeSi075459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 4 Oct 2020 17:23:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366432 - in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux compat/linuxkpi/common/src sys X-SVN-Commit-Revision: 366432 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, 04 Oct 2020 17:23:40 -0000 Author: hselasky Date: Sun Oct 4 17:23:39 2020 New Revision: 366432 URL: https://svnweb.freebsd.org/changeset/base/366432 Log: Populate the acquire context field of a ww_mutex in the LinuxKPI. Bump the FreeBSD version to force recompilation of external kernel modules. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26657 Submitted by: greg_unrelenting.technology (Greg V) Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/compat/linuxkpi/common/include/linux/ww_mutex.h head/sys/compat/linuxkpi/common/src/linux_lock.c head/sys/sys/param.h Modified: head/sys/compat/linuxkpi/common/include/linux/ww_mutex.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/ww_mutex.h Sun Oct 4 17:17:16 2020 (r366431) +++ head/sys/compat/linuxkpi/common/include/linux/ww_mutex.h Sun Oct 4 17:23:39 2020 (r366432) @@ -76,7 +76,8 @@ ww_mutex_trylock(struct ww_mutex *lock) return (mutex_trylock(&lock->base)); } -extern int linux_ww_mutex_lock_sub(struct ww_mutex *, int catch_signal); +extern int linux_ww_mutex_lock_sub(struct ww_mutex *, + struct ww_acquire_ctx *, int catch_signal); static inline int ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx) @@ -86,7 +87,7 @@ ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire else if ((struct thread *)SX_OWNER(lock->base.sx.sx_lock) == curthread) return (-EALREADY); else - return (linux_ww_mutex_lock_sub(lock, 0)); + return (linux_ww_mutex_lock_sub(lock, ctx, 0)); } static inline int @@ -97,7 +98,7 @@ ww_mutex_lock_interruptible(struct ww_mutex *lock, str else if ((struct thread *)SX_OWNER(lock->base.sx.sx_lock) == curthread) return (-EALREADY); else - return (linux_ww_mutex_lock_sub(lock, 1)); + return (linux_ww_mutex_lock_sub(lock, ctx, 1)); } extern void linux_ww_mutex_unlock_sub(struct ww_mutex *); Modified: head/sys/compat/linuxkpi/common/src/linux_lock.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_lock.c Sun Oct 4 17:17:16 2020 (r366431) +++ head/sys/compat/linuxkpi/common/src/linux_lock.c Sun Oct 4 17:23:39 2020 (r366432) @@ -71,7 +71,8 @@ linux_ww_unlock(void) /* lock a mutex with deadlock avoidance */ int -linux_ww_mutex_lock_sub(struct ww_mutex *lock, int catch_signal) +linux_ww_mutex_lock_sub(struct ww_mutex *lock, + struct ww_acquire_ctx *ctx, int catch_signal) { struct task_struct *task; struct ww_mutex_thread entry; @@ -126,6 +127,9 @@ done: if ((struct thread *)SX_OWNER(lock->base.sx.sx_lock) == NULL) cv_signal(&lock->condvar); } + + if (retval == 0) + lock->ctx = ctx; linux_ww_unlock(); return (retval); } @@ -135,6 +139,7 @@ linux_ww_mutex_unlock_sub(struct ww_mutex *lock) { /* protect ww_mutex ownership change */ linux_ww_lock(); + lock->ctx = NULL; sx_xunlock(&lock->base.sx); /* wakeup a lock waiter, if any */ cv_signal(&lock->condvar); Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Oct 4 17:17:16 2020 (r366431) +++ head/sys/sys/param.h Sun Oct 4 17:23:39 2020 (r366432) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300118 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300119 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Sun Oct 4 18: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 69BB442F489; Sun, 4 Oct 2020 18:29:22 +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 4C4C1Z0Wpvz42y0; Sun, 4 Oct 2020 18:29:21 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x342.google.com with SMTP id d4so6363325wmd.5; Sun, 04 Oct 2020 11:29:21 -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=t6C3bLUb6CfOEFtd5Uk7287XXTnqGan5mBo/6Em8/aI=; b=OR+WUWPbNNssFy/OnQNX/mtfvoWQElvvW1cTpApqizTqD7FDx/+l9EwiwBZkF/FGCm EbAxhi5Cih4QzXPbc9lHcs4Sf2IHfMnbKy1JDApmUB7iZwLQEBe39ZHbiJJtMBT8Td9N 79xV9LytMQLXjf19Yaip12i2k9rEdyQBriFeS3zHOlSFQmcFs4oSOTYy7LB2g/BgJLn8 dxaI2Tpwvf/v3SKavOillpV4MMcUcI5FcyytEZaln05haDxSSPCh9PtnsctREw8hrgHF NzBmlLMsSvgOJUrBsAJ+JlRHhiGBuA0fHW5UhGWr5Bei8Cug/muQn2aHTx4bRvKag0qC xebQ== 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=t6C3bLUb6CfOEFtd5Uk7287XXTnqGan5mBo/6Em8/aI=; b=FI1liOLI/3UXUW5mLd/BLNTKvx1GkJs0XVqR4RfaW4Wqdu3twFADJYZogUVcczW++E SO8fp3QpR5btNHl/WEgwhDFGb40kBXRhJv39EiU6jbNhu6k6qEycNRjserzE2KGyHd6M bMBvC8f+nI5NzDWXG7yAGfOYdjI5Rs3sPnyWZoRRuGTDPd1agfJr+P7b04Tx1ztLePs/ //f3K3JenJzyZdudrhHsstnaWII/rKtCYoMS2Rc+vZRaJgRNC5sVD9WF8qJfD60z6WmY ty/Ml55V70uJsq8qD1znGOSnNSNDJnSdNiZ71fgjKeZzzi+jHJkqhu5zobGaPrijcUnr SVQQ== X-Gm-Message-State: AOAM530ZdMk/y8SK2Gi9NxratSFiA1RA2dfRKCUkTy5YTiA+YUhieq5l Vc8+IJvLSjEB5egeUUyBATMRLhLERN6l5ock30jVZ6hQ/04= X-Google-Smtp-Source: ABdhPJxKp3xwDlQZJFUHXGAOeuj3ePO6HA0lwJWzB7CFWR4OHZG4UtlJvXpHzXhE/9IADfD9LFO23p1wUlN6KC+wWdw= X-Received: by 2002:a1c:dfd4:: with SMTP id w203mr12881474wmg.178.1601836159806; Sun, 04 Oct 2020 11:29:19 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6000:187:0:0:0:0 with HTTP; Sun, 4 Oct 2020 11:29:18 -0700 (PDT) In-Reply-To: <202010041633.094GXg4l044462@repo.freebsd.org> References: <202010041633.094GXg4l044462@repo.freebsd.org> From: Mateusz Guzik Date: Sun, 4 Oct 2020 20:29:18 +0200 Message-ID: Subject: Re: svn commit: r366429 - in head/sys: kern sys To: Konstantin Belousov 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: 4C4C1Z0Wpvz42y0 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: Sun, 04 Oct 2020 18:29:22 -0000 Why is the process lock always taken? It looks like both routines just check a thread-local flag, so perhaps this can get away without serializing this process-wide? On 10/4/20, Konstantin Belousov wrote: > Author: kib > Date: Sun Oct 4 16:33:42 2020 > New Revision: 366429 > URL: https://svnweb.freebsd.org/changeset/base/366429 > > Log: > Add sig_intr(9). > > It gives the answer would the thread sleep according to current state > of signals and suspensions. Of course the answer is racy and allows > for false-negatives (no sleep when signal is delivered after process > lock is dropped). Also the answer might change due to signal > rescheduling among threads in multi-threaded process. > > Still it is the best approximation I can provide, to answering the > question was the thread interrupted. > > Reviewed by: markj > Tested by: pho, rmacklem > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > Differential revision: https://reviews.freebsd.org/D26628 > > Modified: > head/sys/kern/kern_sig.c > head/sys/sys/signalvar.h > > Modified: head/sys/kern/kern_sig.c > ============================================================================== > --- head/sys/kern/kern_sig.c Sun Oct 4 16:30:05 2020 (r366428) > +++ head/sys/kern/kern_sig.c Sun Oct 4 16:33:42 2020 (r366429) > @@ -3204,6 +3204,24 @@ sig_ast_needsigchk(struct thread *td) > return (ret); > } > > +int > +sig_intr(void) > +{ > + struct thread *td; > + struct proc *p; > + int ret; > + > + td = curthread; > + p = td->td_proc; > + > + PROC_LOCK(p); > + ret = sig_ast_checksusp(td); > + if (ret == 0) > + ret = sig_ast_needsigchk(td); > + PROC_UNLOCK(p); > + return (ret); > +} > + > void > proc_wkilled(struct proc *p) > { > > Modified: head/sys/sys/signalvar.h > ============================================================================== > --- head/sys/sys/signalvar.h Sun Oct 4 16:30:05 2020 (r366428) > +++ head/sys/sys/signalvar.h Sun Oct 4 16:33:42 2020 (r366429) > @@ -408,6 +408,7 @@ int sig_ffs(sigset_t *set); > void sigfastblock_clear(struct thread *td); > void sigfastblock_fetch(struct thread *td); > void sigfastblock_setpend(struct thread *td, bool resched); > +int sig_intr(void); > void siginit(struct proc *p); > void signotify(struct thread *td); > void sigqueue_delete(struct sigqueue *queue, int sig); > _______________________________________________ > 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 Sun Oct 4 19:37: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 0AD484313B4; Sun, 4 Oct 2020 19:37:17 +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 4C4DWw3yLrz47HT; Sun, 4 Oct 2020 19:37:16 +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 6BA119878; Sun, 4 Oct 2020 19:37:16 +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 094JbGiU055587; Sun, 4 Oct 2020 19:37:16 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 094JbGZl055585; Sun, 4 Oct 2020 19:37:16 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202010041937.094JbGZl055585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Sun, 4 Oct 2020 19:37:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366433 - in head/sys: contrib/ipfilter/netinet x86/bios X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in head/sys: contrib/ipfilter/netinet x86/bios X-SVN-Commit-Revision: 366433 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, 04 Oct 2020 19:37:17 -0000 Author: freqlabs Date: Sun Oct 4 19:37:15 2020 New Revision: 366433 URL: https://svnweb.freebsd.org/changeset/base/366433 Log: Explicit CTLFLAG_DYN not needed Dynamically created OIDs automatically get this flag set. Reviewed by: jhb MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D26561 Modified: head/sys/contrib/ipfilter/netinet/mlfk_ipl.c head/sys/x86/bios/vpd.c Modified: head/sys/contrib/ipfilter/netinet/mlfk_ipl.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Sun Oct 4 17:23:39 2020 (r366432) +++ head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Sun Oct 4 19:37:15 2020 (r366433) @@ -88,19 +88,19 @@ SYSCTL_DECL(_net_inet); ptr, val, sysctl_ipf_int, "I", descr) #define SYSCTL_DYN_IPF_NAT(parent, nbr, name, access,ptr, val, descr) \ SYSCTL_ADD_OID(&ipf_clist, SYSCTL_STATIC_CHILDREN(parent), nbr, name, \ - CTLFLAG_DYN | CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_MPSAFE |access, \ + CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_MPSAFE |access, \ ptr, val, sysctl_ipf_int_nat, "I", descr) #define SYSCTL_DYN_IPF_STATE(parent, nbr, name, access,ptr, val, descr) \ SYSCTL_ADD_OID(&ipf_clist, SYSCTL_STATIC_CHILDREN(parent), nbr, name, \ - CTLFLAG_DYN | CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_MPSAFE | access, \ + CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_MPSAFE | access, \ ptr, val, sysctl_ipf_int_state, "I", descr) #define SYSCTL_DYN_IPF_FRAG(parent, nbr, name, access,ptr, val, descr) \ SYSCTL_ADD_OID(&ipf_clist, SYSCTL_STATIC_CHILDREN(parent), nbr, name, \ - CTLFLAG_DYN | CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_MPSAFE | access, \ + CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_MPSAFE | access, \ ptr, val, sysctl_ipf_int_frag, "I", descr) #define SYSCTL_DYN_IPF_AUTH(parent, nbr, name, access,ptr, val, descr) \ SYSCTL_ADD_OID(&ipf_clist, SYSCTL_STATIC_CHILDREN(parent), nbr, name, \ - CTLFLAG_DYN | CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_MPSAFE | access, \ + CTLTYPE_INT | CTLFLAG_VNET | CTLFLAG_MPSAFE | access, \ ptr, val, sysctl_ipf_int_auth, "I", descr) static struct sysctl_ctx_list ipf_clist; #define CTLFLAG_OFF 0x00800000 /* IPFilter must be disabled */ Modified: head/sys/x86/bios/vpd.c ============================================================================== --- head/sys/x86/bios/vpd.c Sun Oct 4 17:23:39 2020 (r366432) +++ head/sys/x86/bios/vpd.c Sun Oct 4 19:37:15 2020 (r366433) @@ -210,19 +210,19 @@ vpd_attach (device_t dev) sysctl_ctx_init(&sc->ctx); SYSCTL_ADD_STRING(&sc->ctx, SYSCTL_STATIC_CHILDREN(_hw_vpd_machine_type), OID_AUTO, - unit, CTLFLAG_RD|CTLFLAG_DYN, sc->MachineType, 0, NULL); + unit, CTLFLAG_RD, sc->MachineType, 0, NULL); SYSCTL_ADD_STRING(&sc->ctx, SYSCTL_STATIC_CHILDREN(_hw_vpd_machine_model), OID_AUTO, - unit, CTLFLAG_RD|CTLFLAG_DYN, sc->MachineModel, 0, NULL); + unit, CTLFLAG_RD, sc->MachineModel, 0, NULL); SYSCTL_ADD_STRING(&sc->ctx, SYSCTL_STATIC_CHILDREN(_hw_vpd_build_id), OID_AUTO, - unit, CTLFLAG_RD|CTLFLAG_DYN, sc->BuildID, 0, NULL); + unit, CTLFLAG_RD, sc->BuildID, 0, NULL); SYSCTL_ADD_STRING(&sc->ctx, SYSCTL_STATIC_CHILDREN(_hw_vpd_serial_box), OID_AUTO, - unit, CTLFLAG_RD|CTLFLAG_DYN, sc->BoxSerial, 0, NULL); + unit, CTLFLAG_RD, sc->BoxSerial, 0, NULL); SYSCTL_ADD_STRING(&sc->ctx, SYSCTL_STATIC_CHILDREN(_hw_vpd_serial_planar), OID_AUTO, - unit, CTLFLAG_RD|CTLFLAG_DYN, sc->PlanarSerial, 0, NULL); + unit, CTLFLAG_RD, sc->PlanarSerial, 0, NULL); device_printf(dev, "Machine Type: %.4s, Model: %.3s, Build ID: %.9s\n", sc->MachineType, sc->MachineModel, sc->BuildID); From owner-svn-src-head@freebsd.org Sun Oct 4 21:06: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 16741433C4E; Sun, 4 Oct 2020 21:06:16 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-to1can01on062a.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5d::62a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C4GVZ32sfz4H6F; Sun, 4 Oct 2020 21:06:14 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WIwG2alDgHl/Zsc8xTI/D0hmryoGKPGnQYtnh4iTbadYKl3ZNlabSstkk51prwEe2zPIhfV9dTk9SRM3rrls2wmvCrji7hoMhTDWi1QoFHzLYqksCnQZTHc2VPxSb9dczHvESUUgQnrstkC7dTw8YrBT442IllPPF5kKnLmbCpD0eMvpX6PnQMnrEbv71JYGBVQrt7mikLYYuP/BRbxtvbSRYifSwIiBN6FoZBxWTUmxu1C2H/Y5NuQtMQeKMdBsr6rdd3aQDuaiAjJrwstQ5SEnOfWz4qEa9ZsNABpxvQQZHpmhdoTvHR/kH9fs5RJolcy3MEGdgI8GGBEk0+MaZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6rmRIKf2CXv3hoGMf0hGipzm9t4RioeKL0yCwBP6JuQ=; b=fbVZhCv4Cb+a+yG9djYuITb2KeuZw0om+ibdLiIuSpUQjkQsDWy4pyZf7S2FHZYlkQ2Ho/0wzGkFFXfArK2IWSxpXzo0BsYiFjXHZWkHMFqPFY+mqD8f/shNid4lB4Lez5t1qcIMexoL0v3vfvB7dsL9a71ydjKXNtUarS6JZOB7n7u5szqSgFtpoesMgWvpKWpdF5fchn9cN05J7ObSyp4kMCjNWqzswF6pOZfjaxN9Gm4JGaPFcuzrodgel6tH7WihPVga4f2FpqNuE7t023CWORKbEdz8boTJCK0QwnB5NEH/PBJnTu8fLBGil7POHHTfuQTVPokuDai09WjSpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=uoguelph.ca; dmarc=pass action=none header.from=uoguelph.ca; dkim=pass header.d=uoguelph.ca; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uoguelph.ca; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6rmRIKf2CXv3hoGMf0hGipzm9t4RioeKL0yCwBP6JuQ=; b=Ft9y4i2E7DWk5tToUit+yrsqrre1yKTZYd8Ny3w8p+XKRXXsG2enY2nPalxIn+9t09QgbBwVeKGCflGgUFUszEMLPlKa9YE5SIMa4qDsxTg/pMrHJXiuD9xyjtEBdfwzW7AFk+lkmCIj9cwh6nnQphHclDw3YWdvSw3hcGN72Z47QVllbUmgCanBdVpcWS+uaOgMInM67WlNEn1U3F1IGJaw0GfOCQiuOBfevtatWzy1ZTbJrMsgJQtPrUQVW/oUSBeqoyTr+jjU9K6+/WKsyYbavGAaMryfIFWvPhDbqwOgv9LJTFQV0OBbMchouvVzkaXDPPfyyJZEw4ejZz60zg== Received: from YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:24::27) by YTOPR0101MB2124.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b00:1d::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.37; Sun, 4 Oct 2020 21:06:12 +0000 Received: from YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM ([fe80::687f:d85a:a0a3:bd20]) by YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM ([fe80::687f:d85a:a0a3:bd20%6]) with mapi id 15.20.3433.044; Sun, 4 Oct 2020 21:06:02 +0000 From: Rick Macklem To: Mateusz Guzik , Konstantin Belousov CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r366429 - in head/sys: kern sys Thread-Topic: svn commit: r366429 - in head/sys: kern sys Thread-Index: AQHWmmwkwGWcutQP9ECZTNSVKp4v5qmHw7EAgAArAUk= Date: Sun, 4 Oct 2020 21:06:02 +0000 Message-ID: References: <202010041633.094GXg4l044462@repo.freebsd.org>, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 86a87d54-49f2-4040-8fee-08d868a94d2d x-ms-traffictypediagnostic: YTOPR0101MB2124: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: tXBuSyfFb4A+HkWkD4SzDC/nnv4cRt895EJVy8KoQtA1bz/g3xj82Pe5RzVOwJjdJ+4609dLQJQAxXY2lZZQLODB1+fL1MIXRqDElRKQz1G/6Z5vOm4c4twixSCdcIjQbLuBpl3jymx3dGkgPY3jzQeTzKki0zbx7iOJADT0wyeS6zkZCJ2v7ldBo7B5sOSG4AagGfoOpffJ/dFAMTzPYgN9JJQ/aeWsTjCxlj7XxyHpu5/fwhRjocivCzWZl+WDP+YuYejy/ZSMLZOgxPMRv/ZaoNDoC3cCcGcq1+94Dc4/1jW+ylEaId4WB3kDeo6oBDH2jRoh55Oj6ssd0KbOTGm2Ozdt/gtJGvUbvxLG5m089tXsQZM7yKESP9jqWTJsQ/Yv2ktJU8eQZmta8x68FA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(39850400004)(346002)(136003)(366004)(376002)(396003)(33656002)(4326008)(66556008)(71200400001)(66476007)(66946007)(7696005)(110136005)(83380400001)(8676002)(76116006)(478600001)(54906003)(316002)(86362001)(786003)(52536014)(186003)(6506007)(83080400001)(9686003)(8936002)(66446008)(64756008)(55016002)(2906002)(966005)(5660300002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: jPppVEFkMWoFBct0DvIJByQa7sINbQq8X1XTH6gvD80IDFd6f0xdGgLnKzgEd0Dn5fgGQYVoGWjglXvNBhDebK7488p/HRu9zeB3uiJw6miEdGcmnxSI3+sPVL5OULnm/zbNlWNZBgR+C8Q9MiGKyXCy88jsDESw9YsxBeaxz7uDsuM+8lIrMtqL9woU+2Sp19lsByFdh8vLm7c3oBnsIlSUpoXwyGkqDUCEZo/jeGTlhVVSpROpKYx4hX3l6MzIwCaPU+GRWCHJ3jHRN0MFaEa16WviOpsZa1a9PAWHPTxmsM1ejE8APNii3U5w2sJ08mPO4uo11rDgupqnXSLDuFr8FpjSwDt7zOZRHT8avJ96r0m+g+RDAFaXTtWMUYt47zsdDKRUcuQgt8dJb4R7u/7XYYQlVwGNbF3diTJFDcoNDoxhrin/VfxDeQ3657iLr0wJJ+6fqsjgG/qCL8fwPlwqB9mgmCvq6/ljAbsL8FMS2cpAwNyoSBvZUpwMZ415kVDZayHnT6tyW1lnwXozaGVVgNUAkeJrKEFUcO9vXla7C6/EtZ4GP4ZMmJ1wCP9yRyKEcuPbxNGmDct46Ffn1Q+4C8MxupZr9ZmLNm5uyL4e8tM1kDP6FmEZX7q2y2Q41aWuIBIkeHa7wAd/WAiUbSdQlECKTsPIWkkvg/IP+8mpa5pWchkXTtxsw+79rE/f1UGUmHvT27x8nOmbLXWBQg== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 86a87d54-49f2-4040-8fee-08d868a94d2d X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Oct 2020 21:06:02.5509 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 3D1uVLawcn8QugqFzNvbxcd/2AzeY9BEJHG0Y+VFk/oYX99U6W1oteM0zluf2KrAmWLD5y5CEY4sjKKQZEyx1A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTOPR0101MB2124 X-Rspamd-Queue-Id: 4C4GVZ32sfz4H6F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=uoguelph.ca header.s=selector1 header.b=Ft9y4i2E; dmarc=pass (policy=none) header.from=uoguelph.ca; spf=pass (mx1.freebsd.org: domain of rmacklem@uoguelph.ca designates 2a01:111:f400:fe5d::62a as permitted sender) smtp.mailfrom=rmacklem@uoguelph.ca X-Spamd-Result: default: False [-6.04 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.01)[-1.006]; R_DKIM_ALLOW(-0.20)[uoguelph.ca:s=selector1]; FREEFALL_USER(0.00)[rmacklem]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a01:111:f400::/48]; NEURAL_HAM_LONG(-1.00)[-1.003]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_FIVE(0.00)[5]; DWL_DNSWL_LOW(-1.00)[uoguelph.ca:dkim]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[uoguelph.ca:+]; DMARC_POLICY_ALLOW(-0.50)[uoguelph.ca,none]; NEURAL_HAM_SHORT(-1.03)[-1.029]; FREEMAIL_TO(0.00)[gmail.com,FreeBSD.org]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:8075, ipnet:2a01:111:f000::/36, country:US]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] 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, 04 Oct 2020 21:06:16 -0000 Mateusz Guzik wrote:=0A= >Why is the process lock always taken? It looks like both routines just=0A= >check a thread-local flag, so perhaps this can get away without=0A= >serializing this process-wide?=0A= I did spot this slight difference between the initial version of sig_intr()= and=0A= this one. At least w.r.t. copy_file_range(2), the call happens infrequentl= y=0A= enough that the overhead of acquiring the lock is not significant.=0A= =0A= rick=0A= =0A= On 10/4/20, Konstantin Belousov wrote:=0A= > Author: kib=0A= > Date: Sun Oct 4 16:33:42 2020=0A= > New Revision: 366429=0A= > URL: https://svnweb.freebsd.org/changeset/base/366429=0A= >=0A= > Log:=0A= > Add sig_intr(9).=0A= >=0A= > It gives the answer would the thread sleep according to current state= =0A= > of signals and suspensions. Of course the answer is racy and allows=0A= > for false-negatives (no sleep when signal is delivered after process=0A= > lock is dropped). Also the answer might change due to signal=0A= > rescheduling among threads in multi-threaded process.=0A= >=0A= > Still it is the best approximation I can provide, to answering the=0A= > question was the thread interrupted.=0A= >=0A= > Reviewed by: markj=0A= > Tested by: pho, rmacklem=0A= > Sponsored by: The FreeBSD Foundation=0A= > MFC after: 2 weeks=0A= > Differential revision: https://reviews.freebsd.org/D26628=0A= >=0A= > Modified:=0A= > head/sys/kern/kern_sig.c=0A= > head/sys/sys/signalvar.h=0A= >=0A= > Modified: head/sys/kern/kern_sig.c=0A= > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=0A= > --- head/sys/kern/kern_sig.c Sun Oct 4 16:30:05 2020 (r366428)= =0A= > +++ head/sys/kern/kern_sig.c Sun Oct 4 16:33:42 2020 (r366429)= =0A= > @@ -3204,6 +3204,24 @@ sig_ast_needsigchk(struct thread *td)=0A= > return (ret);=0A= > }=0A= >=0A= > +int=0A= > +sig_intr(void)=0A= > +{=0A= > + struct thread *td;=0A= > + struct proc *p;=0A= > + int ret;=0A= > +=0A= > + td =3D curthread;=0A= > + p =3D td->td_proc;=0A= > +=0A= > + PROC_LOCK(p);=0A= > + ret =3D sig_ast_checksusp(td);=0A= > + if (ret =3D=3D 0)=0A= > + ret =3D sig_ast_needsigchk(td);=0A= > + PROC_UNLOCK(p);=0A= > + return (ret);=0A= > +}=0A= > +=0A= > void=0A= > proc_wkilled(struct proc *p)=0A= > {=0A= >=0A= > Modified: head/sys/sys/signalvar.h=0A= > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=0A= > --- head/sys/sys/signalvar.h Sun Oct 4 16:30:05 2020 (r366428)= =0A= > +++ head/sys/sys/signalvar.h Sun Oct 4 16:33:42 2020 (r366429)= =0A= > @@ -408,6 +408,7 @@ int sig_ffs(sigset_t *set);=0A= > void sigfastblock_clear(struct thread *td);=0A= > void sigfastblock_fetch(struct thread *td);=0A= > void sigfastblock_setpend(struct thread *td, bool resched);=0A= > +int sig_intr(void);=0A= > void siginit(struct proc *p);=0A= > void signotify(struct thread *td);=0A= > void sigqueue_delete(struct sigqueue *queue, int sig);=0A= > _______________________________________________=0A= > svn-src-all@freebsd.org mailing list=0A= > https://lists.freebsd.org/mailman/listinfo/svn-src-all=0A= > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"=0A= >=0A= =0A= =0A= --=0A= Mateusz Guzik =0A= From owner-svn-src-head@freebsd.org Sun Oct 4 22:41: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 D16BC435F13; Sun, 4 Oct 2020 22:41:45 +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 4C4Jcn5dCKz4M19; Sun, 4 Oct 2020 22:41:45 +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 A45DEBB46; Sun, 4 Oct 2020 22:41:45 +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 094MfjhM068835; Sun, 4 Oct 2020 22:41:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 094MfhOV068827; Sun, 4 Oct 2020 22:41:43 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202010042241.094MfhOV068827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 4 Oct 2020 22:41:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366435 - in head: . stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: . stand/lua X-SVN-Commit-Revision: 366435 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, 04 Oct 2020 22:41:45 -0000 Author: kevans Date: Sun Oct 4 22:41:43 2020 New Revision: 366435 URL: https://svnweb.freebsd.org/changeset/base/366435 Log: lualoader: improve the design of the brand-/logo- mechanism In the previous world order, any brand/logo was forced to pull in the drawer and call drawer.add{Brand,Logo} with the name their brand/logo is taking and a table describing it. In the new world order, these files just need to return a table that maps out graphics types to a table of the exact same format as what was previously being passed back into the drawer. The appeal here is not needing to grab a reference back to the drawer module and having a cleaner data-driven looking format for these. The format has been renamed to 'gfx-*' prefixes and each one can provide a logo and a brand. drawer.addBrand/drawer.addLogo will remain in place until FreeBSD 13, as there's no overhead to them and it's not yet worth the break in compatibility with any pre-existing brands and logos. Reviewed by: freqlabs MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24966 Added: head/stand/lua/gfx-beastie.lua - copied, changed from r366434, head/stand/lua/logo-beastie.lua head/stand/lua/gfx-beastiebw.lua - copied, changed from r366434, head/stand/lua/logo-beastiebw.lua head/stand/lua/gfx-fbsdbw.lua - copied, changed from r366434, head/stand/lua/logo-fbsdbw.lua head/stand/lua/gfx-orb.lua - copied, changed from r366434, head/stand/lua/logo-orb.lua head/stand/lua/gfx-orbbw.lua - copied, changed from r366434, head/stand/lua/logo-orbbw.lua Deleted: head/stand/lua/logo-beastie.lua head/stand/lua/logo-beastiebw.lua head/stand/lua/logo-fbsdbw.lua head/stand/lua/logo-orb.lua head/stand/lua/logo-orbbw.lua Modified: head/ObsoleteFiles.inc head/stand/lua/Makefile head/stand/lua/drawer.lua Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Oct 4 19:59:12 2020 (r366434) +++ head/ObsoleteFiles.inc Sun Oct 4 22:41:43 2020 (r366435) @@ -36,6 +36,13 @@ # xargs -n1 | sort | uniq -d; # done +# 20201004: logo files renamed to type-agnostic gfx-*.lua +OLD_FILES+=boot/lua/logo-beastie.lua +OLD_FILES+=boot/lua/logo-beastiebw.lua +OLD_FILES+=boot/lua/logo-fbsdbw.lua +OLD_FILES+=boot/lua/logo-orb.lua +OLD_FILES+=boot/lua/logo-orbbw.lua + # 20200923: memfd_test moved to /usr/tests/sys/posixshm OLD_FILES+=usr/tests/sys/kern/memfd_test Modified: head/stand/lua/Makefile ============================================================================== --- head/stand/lua/Makefile Sun Oct 4 19:59:12 2020 (r366434) +++ head/stand/lua/Makefile Sun Oct 4 22:41:43 2020 (r366435) @@ -20,11 +20,11 @@ FILES= cli.lua \ drawer.lua \ hook.lua \ loader.lua \ - logo-beastie.lua \ - logo-beastiebw.lua \ - logo-fbsdbw.lua \ - logo-orb.lua \ - logo-orbbw.lua \ + gfx-beastie.lua \ + gfx-beastiebw.lua \ + gfx-fbsdbw.lua \ + gfx-orb.lua \ + gfx-orbbw.lua \ menu.lua \ password.lua \ screen.lua Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Sun Oct 4 19:59:12 2020 (r366434) +++ head/stand/lua/drawer.lua Sun Oct 4 22:41:43 2020 (r366435) @@ -61,6 +61,35 @@ local function menuEntryName(drawing_menu, entry) return entry.name end +local function processFile(gfxname) + if gfxname == nil then + return false, "Missing filename" + end + + local ret = try_include('gfx-' .. gfxname) + if ret == nil then + return false, "Failed to include gfx-" .. gfxname + end + + -- Legacy format + if type(ret) ~= "table" then + return true + end + + for gfxtype, def in pairs(ret) do + if gfxtype == "brand" then + drawer.addBrand(gfxname, def) + elseif gfxtype == "logo" then + drawer.addLogo(gfxname, def) + else + return false, "Unknown graphics type '" .. gfxtype .. + "'" + end + end + + return true +end + local function getBranddef(brand) if brand == nil then return nil @@ -70,7 +99,18 @@ local function getBranddef(brand) -- Try to pull it in if branddef == nil then - try_include('brand-' .. brand) + local res, err = processFile(brand) + if not res then + -- This fallback should go away after FreeBSD 13. + try_include('brand-' .. brand) + -- If the fallback also failed, print whatever error + -- we encountered in the original processing. + if branddefs[brand] == nil then + print(err) + return nil + end + end + branddef = branddefs[brand] end @@ -86,7 +126,18 @@ local function getLogodef(logo) -- Try to pull it in if logodef == nil then - try_include('logo-' .. logo) + local res, err = processFile(logo) + if not res then + -- This fallback should go away after FreeBSD 13. + try_include('logo-' .. logo) + -- If the fallback also failed, print whatever error + -- we encountered in the original processing. + if logodefs[logo] == nil then + print(err) + return nil + end + end + logodef = logodefs[logo] end @@ -364,6 +415,8 @@ drawer.default_bw_logodef = 'orbbw' -- drawer module in case it's a filesystem issue. drawer.default_fallback_logodef = 'none' +-- These should go away after FreeBSD 13; only available for backwards +-- compatibility with old logo- files. function drawer.addBrand(name, def) branddefs[name] = def end Copied and modified: head/stand/lua/gfx-beastie.lua (from r366434, head/stand/lua/logo-beastie.lua) ============================================================================== --- head/stand/lua/logo-beastie.lua Sun Oct 4 19:59:12 2020 (r366434, copy source) +++ head/stand/lua/gfx-beastie.lua Sun Oct 4 22:41:43 2020 (r366435) @@ -27,33 +27,29 @@ -- $FreeBSD$ -- -local drawer = require("drawer") - -local beastie_color = { -" \027[31m, ,", -" /( )`", -" \\ \\___ / |", -" /- \027[37m_\027[31m `-/ '", -" (\027[37m/\\/ \\\027[31m \\ /\\", -" \027[37m/ / |\027[31m ` \\", -" \027[34mO O \027[37m) \027[31m/ |", -" \027[37m`-^--'\027[31m`< '", -" (_.) _ ) /", -" `.___/` /", -" `-----' /", -" \027[33m<----.\027[31m __ / __ \\", -" \027[33m<----|====\027[31mO)))\027[33m==\027[31m) \\) /\027[33m====|", -" \027[33m<----'\027[31m `--' `.__,' \\", -" | |", -" \\ / /\\", -" \027[36m______\027[31m( (_ / \\______/", -" \027[36m,' ,-----' |", -" `--{__________)\027[m" +return { + logo = { + graphic = { + " \027[31m, ,", + " /( )`", + " \\ \\___ / |", + " /- \027[37m_\027[31m `-/ '", + " (\027[37m/\\/ \\\027[31m \\ /\\", + " \027[37m/ / |\027[31m ` \\", + " \027[34mO O \027[37m) \027[31m/ |", + " \027[37m`-^--'\027[31m`< '", + " (_.) _ ) /", + " `.___/` /", + " `-----' /", + " \027[33m<----.\027[31m __ / __ \\", + " \027[33m<----|====\027[31mO)))\027[33m==\027[31m) \\) /\027[33m====|", + " \027[33m<----'\027[31m `--' `.__,' \\", + " | |", + " \\ / /\\", + " \027[36m______\027[31m( (_ / \\______/", + " \027[36m,' ,-----' |", + " `--{__________)\027[m", + }, + requires_color = true, + } } - -drawer.addLogo("beastie", { - requires_color = true, - graphic = beastie_color, -}) - -return true Copied and modified: head/stand/lua/gfx-beastiebw.lua (from r366434, head/stand/lua/logo-beastiebw.lua) ============================================================================== --- head/stand/lua/logo-beastiebw.lua Sun Oct 4 19:59:12 2020 (r366434, copy source) +++ head/stand/lua/gfx-beastiebw.lua Sun Oct 4 22:41:43 2020 (r366435) @@ -27,32 +27,28 @@ -- $FreeBSD$ -- -local drawer = require("drawer") - -local beastiebw = { -" , ,", -" /( )`", -" \\ \\___ / |", -" /- _ `-/ '", -" (/\\/ \\ \\ /\\", -" / / | ` \\", -" O O ) / |", -" `-^--'`< '", -" (_.) _ ) /", -" `.___/` /", -" `-----' /", -" <----. __ / __ \\", -" <----|====O)))==) \\) /====|", -" <----' `--' `.__,' \\", -" | |", -" \\ / /\\", -" ______( (_ / \\______/", -" ,' ,-----' |", -" `--{__________)" +return { + logo = { + graphic = { + " , ,", + " /( )`", + " \\ \\___ / |", + " /- _ `-/ '", + " (/\\/ \\ \\ /\\", + " / / | ` \\", + " O O ) / |", + " `-^--'`< '", + " (_.) _ ) /", + " `.___/` /", + " `-----' /", + " <----. __ / __ \\", + " <----|====O)))==) \\) /====|", + " <----' `--' `.__,' \\", + " | |", + " \\ / /\\", + " ______( (_ / \\______/", + " ,' ,-----' |", + " `--{__________)", + }, + } } - -drawer.addLogo("beastiebw", { - graphic = beastiebw, -}) - -return true Copied and modified: head/stand/lua/gfx-fbsdbw.lua (from r366434, head/stand/lua/logo-fbsdbw.lua) ============================================================================== --- head/stand/lua/logo-fbsdbw.lua Sun Oct 4 19:59:12 2020 (r366434, copy source) +++ head/stand/lua/gfx-fbsdbw.lua Sun Oct 4 22:41:43 2020 (r366435) @@ -27,27 +27,23 @@ -- $FreeBSD$ -- -local drawer = require("drawer") - -local fbsd_logo = { -" ______", -" | ____| __ ___ ___ ", -" | |__ | '__/ _ \\/ _ \\", -" | __|| | | __/ __/", -" | | | | | | |", -" |_| |_| \\___|\\___|", -" ____ _____ _____", -" | _ \\ / ____| __ \\", -" | |_) | (___ | | | |", -" | _ < \\___ \\| | | |", -" | |_) |____) | |__| |", -" | | | |", -" |____/|_____/|_____/" +return { + logo = { + graphic = { + " ______", + " | ____| __ ___ ___ ", + " | |__ | '__/ _ \\/ _ \\", + " | __|| | | __/ __/", + " | | | | | | |", + " |_| |_| \\___|\\___|", + " ____ _____ _____", + " | _ \\ / ____| __ \\", + " | |_) | (___ | | | |", + " | _ < \\___ \\| | | |", + " | |_) |____) | |__| |", + " | | | |", + " |____/|_____/|_____/", + }, + shift = {x = 5, y = 4}, + } } - -drawer.addLogo("fbsdbw", { - graphic = fbsd_logo, - shift = {x = 5, y = 4}, -}) - -return true Copied and modified: head/stand/lua/gfx-orb.lua (from r366434, head/stand/lua/logo-orb.lua) ============================================================================== --- head/stand/lua/logo-orb.lua Sun Oct 4 19:59:12 2020 (r366434, copy source) +++ head/stand/lua/gfx-orb.lua Sun Oct 4 22:41:43 2020 (r366435) @@ -27,30 +27,26 @@ -- $FreeBSD$ -- -local drawer = require("drawer") - -local orb_color = { -" \027[31m``` \027[31;1m`\027[31m", -" s` `.....---...\027[31;1m....--.``` -/\027[31m", -" +o .--` \027[31;1m/y:` +.\027[31m", -" yo`:. \027[31;1m:o `+-\027[31m", -" y/ \027[31;1m-/` -o/\027[31m", -" .- \027[31;1m::/sy+:.\027[31m", -" / \027[31;1m`-- /\027[31m", -" `: \027[31;1m:`\027[31m", -" `: \027[31;1m:`\027[31m", -" / \027[31;1m/\027[31m", -" .- \027[31;1m-.\027[31m", -" -- \027[31;1m-.\027[31m", -" `:` \027[31;1m`:`", -" \027[31;1m.-- `--.", -" .---.....----.\027[m" +return { + logo = { + graphic = { + " \027[31m``` \027[31;1m`\027[31m", + " s` `.....---...\027[31;1m....--.``` -/\027[31m", + " +o .--` \027[31;1m/y:` +.\027[31m", + " yo`:. \027[31;1m:o `+-\027[31m", + " y/ \027[31;1m-/` -o/\027[31m", + " .- \027[31;1m::/sy+:.\027[31m", + " / \027[31;1m`-- /\027[31m", + " `: \027[31;1m:`\027[31m", + " `: \027[31;1m:`\027[31m", + " / \027[31;1m/\027[31m", + " .- \027[31;1m-.\027[31m", + " -- \027[31;1m-.\027[31m", + " `:` \027[31;1m`:`", + " \027[31;1m.-- `--.", + " .---.....----.\027[m", + }, + requires_color = true, + shift = {x = 2, y = 4}, + } } - -drawer.addLogo("orb", { - requires_color = true, - graphic = orb_color, - shift = {x = 2, y = 4}, -}) - -return true Copied and modified: head/stand/lua/gfx-orbbw.lua (from r366434, head/stand/lua/logo-orbbw.lua) ============================================================================== --- head/stand/lua/logo-orbbw.lua Sun Oct 4 19:59:12 2020 (r366434, copy source) +++ head/stand/lua/gfx-orbbw.lua Sun Oct 4 22:41:43 2020 (r366435) @@ -27,29 +27,25 @@ -- $FreeBSD$ -- -local drawer = require("drawer") - -local orbbw = { -" ``` `", -" s` `.....---.......--.``` -/", -" +o .--` /y:` +.", -" yo`:. :o `+-", -" y/ -/` -o/", -" .- ::/sy+:.", -" / `-- /", -" `: :`", -" `: :`", -" / /", -" .- -.", -" -- -.", -" `:` `:`", -" .-- `--.", -" .---.....----." +return { + logo = { + graphic = { + " ``` `", + " s` `.....---.......--.``` -/", + " +o .--` /y:` +.", + " yo`:. :o `+-", + " y/ -/` -o/", + " .- ::/sy+:.", + " / `-- /", + " `: :`", + " `: :`", + " / /", + " .- -.", + " -- -.", + " `:` `:`", + " .-- `--.", + " .---.....----.", + }, + shift = {x = 2, y = 4}, + } } - -drawer.addLogo("orbbw", { - graphic = orbbw, - shift = {x = 2, y = 4}, -}) - -return true From owner-svn-src-head@freebsd.org Mon Oct 5 01:18:48 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 CF7333F2132; Mon, 5 Oct 2020 01:18:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C4N5z4yM9z4VP3; Mon, 5 Oct 2020 01:18:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 0951IXOP044295 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 5 Oct 2020 04:18:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 0951IXOP044295 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 0951IXPN044294; Mon, 5 Oct 2020 04:18:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 5 Oct 2020 04:18:33 +0300 From: Konstantin Belousov To: Rick Macklem Cc: Mateusz Guzik , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r366429 - in head/sys: kern sys Message-ID: <20201005011833.GI2643@kib.kiev.ua> References: <202010041633.094GXg4l044462@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4C4N5z4yM9z4VP3 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.87 / 15.00]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; TO_DN_EQ_ADDR_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_TLS_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all:c]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_SPAM_MEDIUM(0.63)[0.628]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.47)[0.467]; NEURAL_SPAM_LONG(0.77)[0.772]; 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]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; RCVD_COUNT_TWO(0.00)[2] 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, 05 Oct 2020 01:18:48 -0000 On Sun, Oct 04, 2020 at 09:06:02PM +0000, Rick Macklem wrote: > Mateusz Guzik wrote: > >Why is the process lock always taken? It looks like both routines just > >check a thread-local flag, so perhaps this can get away without > >serializing this process-wide? > I did spot this slight difference between the initial version of sig_intr() and > this one. At least w.r.t. copy_file_range(2), the call happens infrequently > enough that the overhead of acquiring the lock is not significant. > Yes, the function should not be on any frequent path. That said, all signal delivery to process is covered by the process lock, so checks under process lock make the advisory answer provide less false negatives. If considered too importand in some cases (when ?), the following patch can be applied. diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 8108d4cb3a5..ed4dd52b66d 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -3212,6 +3212,9 @@ sig_intr(void) int ret; td = curthread; + if ((td->td_flags & (TDF_NEEDSIGCHK | TDF_NEEDSUSPCHK)) == 0) + return (0); + p = td->td_proc; PROC_LOCK(p); From owner-svn-src-head@freebsd.org Mon Oct 5 06:53: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 2D52D3FA3E4; Mon, 5 Oct 2020 06:53:30 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C4WXB0K5bz4lwQ; Mon, 5 Oct 2020 06:53:30 +0000 (UTC) (envelope-from np@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 E1FE211B39; Mon, 5 Oct 2020 06:53:29 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0956rTZj074442; Mon, 5 Oct 2020 06:53:29 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0956rTNb074441; Mon, 5 Oct 2020 06:53:29 GMT (envelope-from np@FreeBSD.org) Message-Id: <202010050653.0956rTNb074441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 5 Oct 2020 06:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366440 - head/tools/tools/cxgbtool X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/tools/tools/cxgbtool X-SVN-Commit-Revision: 366440 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, 05 Oct 2020 06:53:30 -0000 Author: np Date: Mon Oct 5 06:53:29 2020 New Revision: 366440 URL: https://svnweb.freebsd.org/changeset/base/366440 Log: Get tools/tools/cxgbtool to build with the latest clang. Reported by: olivier@ Modified: head/tools/tools/cxgbtool/Makefile Modified: head/tools/tools/cxgbtool/Makefile ============================================================================== --- head/tools/tools/cxgbtool/Makefile Mon Oct 5 06:38:56 2020 (r366439) +++ head/tools/tools/cxgbtool/Makefile Mon Oct 5 06:53:29 2020 (r366440) @@ -6,5 +6,6 @@ MAN= CFLAGS+= -I${.CURDIR}/../../../sys/dev/cxgb -I. CFLAGS+= -DCONFIG_T3_REGS -DCHELSIO_INTERNAL BINDIR?= /usr/sbin +WARNS?= 3 .include From owner-svn-src-head@freebsd.org Mon Oct 5 10:16: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 D3A483FEA89; Mon, 5 Oct 2020 10:16:40 +0000 (UTC) (envelope-from gbe@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 4C4c2c5Fv4z3SZZ; Mon, 5 Oct 2020 10:16:40 +0000 (UTC) (envelope-from gbe@freebsd.org) Received: from localhost (p4fd3acce.dip0.t-ipconnect.de [79.211.172.206]) (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 3F24B1E4B5; Mon, 5 Oct 2020 10:16:40 +0000 (UTC) (envelope-from gbe@freebsd.org) Date: Mon, 5 Oct 2020 12:16:39 +0200 From: Gordon Bergling To: xtouqh@hotmail.com Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366403 - head/bin/ls Message-ID: <20201005101639.GA34424@lion.0xfce3.net> References: <202010031834.093IYO3r026370@repo.freebsd.org> <20201003192916.GA41544@lion.0xfce3.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Url: X-Operating-System: FreeBSD 12.2-STABLE amd64 X-Host-Uptime: 12:09PM up 18 days, 1:16, 3 users, load averages: 0.51, 0.29, 0.20 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, 05 Oct 2020 10:16:40 -0000 On Sat, Oct 03, 2020 at 10:33:28PM +0300, xtouqh@hotmail.com wrote: > Gordon Bergling wrote: > > On Sat, Oct 03, 2020 at 09:47:48PM +0300, xtouqh@hotmail.com wrote: > >> Gordon Bergling wrote: > >>> Author: gbe (doc committer) > >>> Date: Sat Oct 3 18:34:24 2020 > >>> New Revision: 366403 > >>> URL: https://svnweb.freebsd.org/changeset/base/366403 > >>> > >>> Log: > >>> ls(1): Bugfix for an issue reported by mandoc > >>> > >>> - no blank before trailing delimiter > >>> > >>> MFC after: 1 week > >>> > >>> Modified: > >>> head/bin/ls/ls.1 > >>> > >>> Modified: head/bin/ls/ls.1 > >>> ============================================================================== > >>> --- head/bin/ls/ls.1 Sat Oct 3 18:30:01 2020 (r366402) > >>> +++ head/bin/ls/ls.1 Sat Oct 3 18:34:24 2020 (r366403) > >>> @@ -40,7 +40,7 @@ > >>> .Nd list directory contents > >>> .Sh SYNOPSIS > >>> .Nm > >>> -.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1, > >>> +.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1 , > >> > >> This makes the "," appear after the "]", how about using the following > >> instead: > >> > >> .Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1\&, > > > > The comma is appearing right before the ']', like it was before. I'll check > > the recommended syntax regarding '\&' tomorrow. > > That's not what I'm seeing: > > polaris:xtouqh:/usr/src$ svnlite info bin/ls/ls.1 > Path: bin/ls/ls.1 > Name: ls.1 > Working Copy Root Path: /usr/src > URL: svn://svn.freebsd.org/base/head/bin/ls/ls.1 > Relative URL: ^/head/bin/ls/ls.1 > Repository Root: svn://svn.freebsd.org/base > Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f > Revision: 366414 > Node Kind: file > Schedule: normal > Last Changed Author: gbe > Last Changed Rev: 366403 > Last Changed Date: 2020-10-03 18:34:24 +0000 (Sat, 03 Oct 2020) > Text Last Updated: 2020-10-03 18:51:31 +0000 (Sat, 03 Oct 2020) > Checksum: 72fe092ab2b5ac3363ea0681cfda216876d24fcd > > $ man bin/ls/ls.1 | head > LS(1) FreeBSD General Commands Manual > LS(1) > > NAME > ls – list directory contents > > SYNOPSIS > ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1], [--color=when] [-D > format] > [file ...] > > DESCRIPTION That is strange. I have checked the output from mandoc and man, and with r366403 applied, it is always the following: ------------------------------------------------------------------------------- LS(1) FreeBSD General Commands Manual LS(1) NAME ls – list directory contents SYNOPSIS ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1,] [--color=when] [-D format] [file ...] DESCRIPTION ------------------------------------------------------------------------------- --Gordon From owner-svn-src-head@freebsd.org Mon Oct 5 11:46: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 2EC1D421325; Mon, 5 Oct 2020 11:46:19 +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 4C4f225pycz3X8x; Mon, 5 Oct 2020 11:46:18 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Date: Mon, 5 Oct 2020 13:46:14 +0200 (CEST) From: Ronald Klop To: Hans Petter Selasky Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org, src-committers@freebsd.org Message-ID: <476286772.120.1601898374873@localhost> In-Reply-To: <202010041717.094HHH9d069578@repo.freebsd.org> References: <202010041717.094HHH9d069578@repo.freebsd.org> Subject: Re: svn commit: r366431 - head/sys/dev/usb/serial MIME-Version: 1.0 X-Mailer: Realworks (528.767.4b26219e445) Importance: Normal X-Priority: 3 (Normal) X-Rspamd-Queue-Id: 4C4f225pycz3X8x 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, 05 Oct 2020 11:46:19 -0000 Hi, I was interested by this commit. But the commit and commit message don't have much information. I was surprised that the "Differential Revision" link contains a lot of info about this. How permanent is this review.freebsd.org server? Wil it stay after the git migration? Ronald. Van: Hans Petter Selasky Datum: zondag, 4 oktober 2020 19:17 Aan: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Onderwerp: svn commit: r366431 - head/sys/dev/usb/serial > > Author: hselasky > Date: Sun Oct 4 17:17:16 2020 > New Revision: 366431 > URL: https://svnweb.freebsd.org/changeset/base/366431 > > Log: > Add support for Google Cr50 (GSC) Closed Case Debugging UART interfaces to > the USB generic serial port driver, ugensa. > > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D21863 > Submitted by: greg_unrelenting.technology (Greg V) > Sponsored by: Mellanox Technologies // NVIDIA Networking > > Modified: > head/sys/dev/usb/serial/ugensa.c > > Modified: head/sys/dev/usb/serial/ugensa.c > ============================================================================== > --- head/sys/dev/usb/serial/ugensa.c Sun Oct 4 17:07:13 2020 (r366430) > +++ head/sys/dev/usb/serial/ugensa.c Sun Oct 4 17:17:16 2020 (r366431) > @@ -161,6 +161,8 @@ static const STRUCT_USB_HOST_ID ugensa_devs[] = { > {USB_VPI(USB_VENDOR_KYOCERA2, USB_PRODUCT_KYOCERA2_CDMA_MSM_K, 1)}, > {USB_VPI(USB_VENDOR_HP, USB_PRODUCT_HP_49GPLUS, 1)}, > {USB_VPI(USB_VENDOR_NOVATEL2, USB_PRODUCT_NOVATEL2_FLEXPACKGPS, 3)}, > + {USB_VENDOR(USB_VENDOR_GOOGLE), USB_IFACE_CLASS(UICLASS_VENDOR), > + USB_IFACE_SUBCLASS(0x50), USB_IFACE_PROTOCOL(0x01), USB_DRIVER_INFO(10)}, > }; > > DRIVER_MODULE(ugensa, uhub, ugensa_driver, ugensa_devclass, NULL, 0); > _______________________________________________ > 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 Oct 5 12:37: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 2E5E14235F8; Mon, 5 Oct 2020 12:37:17 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.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 4C4g8q61Hpz3Zq4; Mon, 5 Oct 2020 12:37:15 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f67.google.com with SMTP id y13so8921471iow.4; Mon, 05 Oct 2020 05:37:15 -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:content-transfer-encoding; bh=Ruj7YXqcHJ0ni/R9UmL0/eL7NwcVrTCuUSZjxFrDC4k=; b=XbLvVr5wcjmbi8kVWiofvtonHzH6bKDnj5GOqBHQdmEXKRJyZo6JAcTVZsf7tQGh7j 7czS0zJcXlo0/q3DiLv4SIV0BoNCcE5uqyLI4BySmeuQu9PAdftj7HJaaGw1i0qAUCZ5 CEENdqym0uMKMY1tU9A3jZ8ojocnm6I1lV5LfyRWVwjFd1ZO/jtrOfFTYWnfyLVr9ePw dOe0nKhIO1N11GngVB/Xhx88x/BZ3u854VKOyMF95VuaYievU1OB4TADk46dtfACBTXm gxt4bhsfoBUirLH5J7BbEVV/zd/ilxcHrOkKi+yeNZzWX1w9ru8yEhLCg003r5MdwoG0 lrzQ== X-Gm-Message-State: AOAM531VKIEfOYJgYLYDKg91TcFLXbbqB1xc+SjTfxLqWHoE107Rv9/n gj5PEGvYGX52TZ9439t68n74ZgjY9P6DJd9e4g6c9PTy X-Google-Smtp-Source: ABdhPJwB3Nq3dUyXx9doZJ/G3iw3wPDfh64w5AwnAKFdSLLkeoESbAhvPW8AD79Oy3JCK0guzQq5cEk9i8AdpRSLcyQ= X-Received: by 2002:a05:6638:14c8:: with SMTP id l8mr13042649jak.136.1601901434055; Mon, 05 Oct 2020 05:37:14 -0700 (PDT) MIME-Version: 1.0 References: <202010041717.094HHH9d069578@repo.freebsd.org> <476286772.120.1601898374873@localhost> In-Reply-To: <476286772.120.1601898374873@localhost> From: Ed Maste Date: Mon, 5 Oct 2020 08:37:02 -0400 Message-ID: Subject: Re: svn commit: r366431 - head/sys/dev/usb/serial To: Ronald Klop Cc: Hans Petter Selasky , svn-src-all , svn-src-head , src-committers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4C4g8q61Hpz3Zq4 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.67 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-1.74 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FREEFALL_USER(0.00)[carpeddiem]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-0.91)[-0.909]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.97)[-0.965]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.166.67:from]; NEURAL_SPAM_SHORT(0.14)[0.137]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.166.67: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:+]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] 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, 05 Oct 2020 12:37:17 -0000 On Mon, 5 Oct 2020 at 07:46, Ronald Klop wrote: > > Hi, > > I was interested by this commit. But the commit and commit message don't = have much information. I was surprised that the "Differential Revision" lin= k contains a lot of info about this. How permanent is this review.freebsd.o= rg server? Wil it stay after the git migration? It will remain, but commit messages ought to contain all of the information necessary to make sense of the commit even in the absence of reviews.freebsd.org. From owner-svn-src-head@freebsd.org Mon Oct 5 13:35: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 AB887424CE9; Mon, 5 Oct 2020 13:35:34 +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 4C4hS644CXz3dZ5; Mon, 5 Oct 2020 13:35:34 +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 6EF5616791; Mon, 5 Oct 2020 13:35:34 +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 095DZYLv020446; Mon, 5 Oct 2020 13:35:34 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 095DZYhO020445; Mon, 5 Oct 2020 13:35:34 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202010051335.095DZYhO020445@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, 5 Oct 2020 13:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366444 - head/bin/pwait X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/bin/pwait X-SVN-Commit-Revision: 366444 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, 05 Oct 2020 13:35:34 -0000 Author: fernape (ports committer) Date: Mon Oct 5 13:35:34 2020 New Revision: 366444 URL: https://svnweb.freebsd.org/changeset/base/366444 Log: pwait(1): Add EXAMPLES section to man page * Add small EXAMPLES section to the man page showing the different flags and exit codes. * Complete description for -v flag. Approved by: manpages (bcr@) Modified: head/bin/pwait/pwait.1 Modified: head/bin/pwait/pwait.1 ============================================================================== --- head/bin/pwait/pwait.1 Mon Oct 5 09:03:17 2020 (r366443) +++ head/bin/pwait/pwait.1 Mon Oct 5 13:35:34 2020 (r366444) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 26, 2020 +.Dd October 5, 2020 .Dt PWAIT 1 .Os .Sh NAME @@ -73,7 +73,9 @@ minutes hours .El .It Fl v -Print the exit status when each process terminates. +Print the exit status when each process terminates or +.Ql timeout +if the timer goes off earlier. .El .Sh EXIT STATUS The @@ -85,6 +87,52 @@ If the flag is specified and a timeout occurs, the exit status will be 124. .Pp Invalid pids elicit a warning message but are otherwise ignored. +.Sh EXAMPLES +Start two +.Xr sleep 1 +processes in the background. +The first one will sleep for 30 seconds and the second one for one hour. +Wait for any of them to finish but no more than 5 seconds. +Since a timeout occurs the exit status is 124: +.Bd -literal -offset indent +$ sleep 30 & sleep 3600 & +[1] 1646 +[2] 1647 +$ pwait -o -t5 1646 1647 +$? +124 +.Ed +.Pp +Same as above but try to obtain the exit status of the processes. +In this case +.Ql timeout +is shown and the exit status is 124: +.Bd -literal -offset indent +$ sleep 30 & sleep 3600 & +[1] 1652 +[2] 1653 +$ pwait -v -t 5 1652 1653 +timeout +$? +124 +.Ed +.Pp +Start two +.Xr sleep 1 +processes in the background sleeping for 30 and 40 seconds respectively. +Wait 60 seconds for any of them to finish and get their exit codes: +.Bd -literal -offset indent +$ sleep 30 & sleep 40 & +[1] 1674 +[2] 1675 +$ pwait -v -t 60 1674 1675 +1674: exited with status 0. +1675: exited with status 0. +[1]- Done sleep 30 +[2]+ Done sleep 40 +$ echo $? +0 +.Ed .Sh SEE ALSO .Xr kill 1 , .Xr pkill 1 , From owner-svn-src-head@freebsd.org Mon Oct 5 13:39: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 A3B05424D6E; Mon, 5 Oct 2020 13:39:38 +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 4C4hXp3tqFz3f20; Mon, 5 Oct 2020 13:39:38 +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 67E07162B7; Mon, 5 Oct 2020 13:39:38 +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 095DdcoC020656; Mon, 5 Oct 2020 13:39:38 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 095DdcO1020655; Mon, 5 Oct 2020 13:39:38 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202010051339.095DdcO1020655@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, 5 Oct 2020 13:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366445 - head/bin/df X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/bin/df X-SVN-Commit-Revision: 366445 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, 05 Oct 2020 13:39:38 -0000 Author: fernape (ports committer) Date: Mon Oct 5 13:39:37 2020 New Revision: 366445 URL: https://svnweb.freebsd.org/changeset/base/366445 Log: df(1): Add EXAMPLES section to man page * Add EXAMPLES section with four simple examples. * Simplify -H flag description. This makes easy to see the difference between this flag and -h * While here, fix .Tn deprecated macro. Approved by: manpages (bcr@) Differential Revision: https://reviews.freebsd.org/D26662 Modified: head/bin/df/df.1 Modified: head/bin/df/df.1 ============================================================================== --- head/bin/df/df.1 Mon Oct 5 13:35:34 2020 (r366444) +++ head/bin/df/df.1 Mon Oct 5 13:39:37 2020 (r366445) @@ -29,7 +29,7 @@ .\" @(#)df.1 8.3 (Berkeley) 5/8/95 .\" $FreeBSD$ .\" -.Dd August 8, 2017 +.Dd October 5, 2020 .Dt DF 1 .Os .Sh NAME @@ -98,12 +98,9 @@ Use unit suffixes: Byte, Kibibyte, Mebibyte, Gibibyte, Pebibyte (based on powers of 1024) in order to reduce the number of digits to four or fewer. .It Fl H , Fl Fl si -.Dq Human-readable -output. -Use unit suffixes: Byte, Kilobyte, Megabyte, -Gigabyte, Terabyte and Petabyte (based on powers of 1000) in order to -reduce the number of -digits to four or fewer. +Same as +.Fl h +but based on powers of 1000. .It Fl i Include statistics on the number of free and used inodes. In conjunction with the @@ -159,10 +156,7 @@ command: df -t nonfs,nullfs .Ed .Pp -lists all file systems except those of type -.Tn NFS -and -.Tn NULLFS . +lists all file systems except those of type NFS and NULLFS. The .Xr lsvfs 1 command can be used to find out the types of file systems @@ -193,6 +187,52 @@ which allows units of bytes or numbers scaled with the The allowed range is 512 bytes to 1 GB. If the value is outside, it will be set to the appropriate limit. .El +.Sh EXAMPLES +Show human readable free disk space for all mount points including file system +type: +.Bd -literal -offset indent +$ df -ahT +Filesystem Type Size Used Avail Capacity Mounted on +/dev/ada1p2 ufs 213G 152G 44G 78% / +devfs devfs 1.0K 1.0K 0B 100% /dev +/dev/ada0p1 ufs 1.8T 168G 1.5T 10% /data +linsysfs linsysfs 4.0K 4.0K 0B 100% /compat/linux/sys +/dev/da0 msdosfs 7.6G 424M 7.2G 5% /mnt/usb +.Ed +.Pp +Show previously collected data including inode statistics except for devfs or +linsysfs file systems. +Note that the +.Dq no +prefix affects all the file systems in the list and the +.Fl t +option can be specified only once: +.Bd -literal -offset indent +$ df -i -n -t nodevfs,linsysfs +Filesystem 1K-blocks Used Avail Capacity iused ifree %iused +Mounted on +/dev/ada1p2 223235736 159618992 45757888 78% 1657590 27234568 6% / +/dev/ada0p1 1892163184 176319420 1564470712 10% 1319710 243300576 1% +/data +/dev/da0 7989888 433664 7556224 5% 0 0 100% +/mnt/usb +.Ed +.Pp +Show human readable information for the file system containing the file +.Pa /etc/rc.conf +: +.Bd -literal -offset indent +$ df -h /etc/rc.conf +Filesystem Size Used Avail Capacity Mounted on +/dev/ada1p2 213G 152G 44G 78% / +.Ed +.Pp +Same as above but specifying some file system: +.Bd -literal -offset indent +$ df -h /dev/ada1p2 +Filesystem Size Used Avail Capacity Mounted on +/dev/ada1p2 213G 152G 44G 78% / +.Ed .Sh SEE ALSO .Xr lsvfs 1 , .Xr quota 1 , From owner-svn-src-head@freebsd.org Mon Oct 5 13:46: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 2EE28425125; Mon, 5 Oct 2020 13:46:20 +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 4C4hhX0Xsrz3fkK; Mon, 5 Oct 2020 13:46:20 +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 EA69F16892; Mon, 5 Oct 2020 13:46:19 +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 095DkJ4g026658; Mon, 5 Oct 2020 13:46:19 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 095DkJ4Z026657; Mon, 5 Oct 2020 13:46:19 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202010051346.095DkJ4Z026657@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, 5 Oct 2020 13:46:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366446 - head/bin/hostname X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/bin/hostname X-SVN-Commit-Revision: 366446 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, 05 Oct 2020 13:46:20 -0000 Author: fernape (ports committer) Date: Mon Oct 5 13:46:19 2020 New Revision: 366446 URL: https://svnweb.freebsd.org/changeset/base/366446 Log: hostname(1): Add EXAMPLES to man page Add a very simple set of examples Approved by: manpages (bcr@) Differential Revision: https://reviews.freebsd.org/D26663 Modified: head/bin/hostname/hostname.1 Modified: head/bin/hostname/hostname.1 ============================================================================== --- head/bin/hostname/hostname.1 Mon Oct 5 13:39:37 2020 (r366445) +++ head/bin/hostname/hostname.1 Mon Oct 5 13:46:19 2020 (r366446) @@ -29,7 +29,7 @@ .\" @(#)hostname.1 8.2 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd November 10, 2016 +.Dd October 5, 2020 .Dt HOSTNAME 1 .Os .Sh NAME @@ -66,6 +66,25 @@ name. .It Fl d Only print domain information. .El +.Sh EXAMPLES +Set the host name of the machine and check the result: +.Bd -literal -offset indent +$ hostname beastie.localdomain.org +$ hostname +beastie.localdomain.org +.Ed +.Pp +Do not show domain information: +.Bd -literal -offset indent +$ hostname -s +beastie +.Ed +.Pp +Show only domain information: +.Bd -literal -offset indent +$ hostname -d +localdomain.org +.Ed .Sh SEE ALSO .Xr gethostname 3 , .Xr rc.conf 5 From owner-svn-src-head@freebsd.org Mon Oct 5 13:49: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 30C1F425403; Mon, 5 Oct 2020 13:49:46 +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 4C4hmV0XLGz3fSn; Mon, 5 Oct 2020 13:49:46 +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 E572316352; Mon, 5 Oct 2020 13:49:45 +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 095DnjsI026845; Mon, 5 Oct 2020 13:49:45 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 095Dnj3G026844; Mon, 5 Oct 2020 13:49:45 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202010051349.095Dnj3G026844@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, 5 Oct 2020 13:49:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366447 - head/bin/kenv X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/bin/kenv X-SVN-Commit-Revision: 366447 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, 05 Oct 2020 13:49:46 -0000 Author: fernape (ports committer) Date: Mon Oct 5 13:49:45 2020 New Revision: 366447 URL: https://svnweb.freebsd.org/changeset/base/366447 Log: kenv(1): Add EXAMPLES to man page Add EXAMPLES section covering all the options Approved by: manpages (bcr@) Differential Revision: https://reviews.freebsd.org/D26664 Modified: head/bin/kenv/kenv.1 Modified: head/bin/kenv/kenv.1 ============================================================================== --- head/bin/kenv/kenv.1 Mon Oct 5 13:46:19 2020 (r366446) +++ head/bin/kenv/kenv.1 Mon Oct 5 13:49:45 2020 (r366447) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 11, 2012 +.Dd October 5, 2020 .Dt KENV 1 .Os .Sh NAME @@ -102,6 +102,44 @@ Almost any printable character except .Sq = is acceptable as part of a name. Quotes are optional and necessary only if the value contains whitespace. +.Sh EXAMPLES +Show kernel probe hints variable names and filter for the uart +device +.Bd -literal -offset indent +$ kenv -h -N | grep uart +hint.uart.0.at +hint.uart.0.flags +hint.uart.0.irq +hint.uart.0.port +hint.uart.1.at +hint.uart.1.irq +hint.uart.1.port +.Ed +.Pp +Show the value of a specific variable: +.Bd -literal -offset indent +$ kenv hint.uart.1.at +isa +.Ed +.Pp +Same as above but adding the name of the variable in the report: +.Bd -literal -offset indent +$ kenv -v hint.uart.1.at +hint.uart.1.at="isa" +.Ed +.Pp +Try to delete a variable and suppress warnings if any: +.Bd -literal -offset indent +$ kenv -q -u hint.uart.1.at +.Ed +.Pp +Set the value of the +.Ev verbose_loading +variable +.Bd -literal -offset indent +$ kenv verbose_loading="YES" +verbose_loading="YES" +.Ed .Sh SEE ALSO .Xr kenv 2 , .Xr config 5 , From owner-svn-src-head@freebsd.org Mon Oct 5 13:52: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 AE341425511; Mon, 5 Oct 2020 13:52:31 +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 4C4hqg4D3Vz3gKd; Mon, 5 Oct 2020 13:52:31 +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 7444D16852; Mon, 5 Oct 2020 13:52:31 +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 095DqV9I032712; Mon, 5 Oct 2020 13:52:31 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 095DqVlf032711; Mon, 5 Oct 2020 13:52:31 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202010051352.095DqVlf032711@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, 5 Oct 2020 13:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366448 - head/bin/pkill X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/bin/pkill X-SVN-Commit-Revision: 366448 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, 05 Oct 2020 13:52:31 -0000 Author: fernape (ports committer) Date: Mon Oct 5 13:52:31 2020 New Revision: 366448 URL: https://svnweb.freebsd.org/changeset/base/366448 Log: pkill(1): Add EXAMPLES section to man page Add a dozen of examples to the EXAMPLES section for pgrep(1) and pkill(1). Flags covered: -f, -F, -n, -j, -l, -S, -x Approved by: mandoc (bcr@) Differential Revision: pkill(1): Add EXAMPLES section to man page Modified: head/bin/pkill/pkill.1 Modified: head/bin/pkill/pkill.1 ============================================================================== --- head/bin/pkill/pkill.1 Mon Oct 5 13:49:45 2020 (r366447) +++ head/bin/pkill/pkill.1 Mon Oct 5 13:52:31 2020 (r366448) @@ -29,7 +29,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd December 3, 2018 +.Dd October 5, 2020 .Dt PKILL 1 .Os .Sh NAME @@ -270,6 +270,111 @@ Invalid options were specified on the command line. .It 3 An internal error occurred. .El +.Sh EXAMPLES +Show the pid of the process holding the +.Pa /tmp/.X0-lock +pid file: +.Bd -literal -offset indent +$ pgrep -F /tmp/.X0-lock +1211 +.Ed +.Pp +Show the pid and the name of the process including kernel threads in the +search: +.Bd -literal -offset indent +$ pgrep -lS vnlru +37 vnlru +.Ed +.Pp +Search for processes including kernel threads that match the extended regular +expression pattern: +.Bd -literal -offset indent +$ pgrep -S 'crypto.*[2-3]' +20 +19 +6 +5 +.Ed +.Pp +Show long output for firefox processes: +.Bd -literal -offset indent +$ pgrep -l firefox +1312 firefox +1309 firefox +1288 firefox +1280 firefox +1279 firefox +1278 firefox +1277 firefox +1264 firefox +.Ed +.Pp +Same as above but just showing the pid of the most recent process: +.Bd -literal -offset indent +$ pgrep -n firefox +1312 +.Ed +.Pp +Look for vim processes. +Match against the full argument list: +.Bd -literal -offset indent +$ pgrep -f vim +44968 +30790 +.Ed +.Pp +Same as above but matching against the +.Ql list +word and showing the full argument list: +.Bd -literal -offset indent +$ pgrep -f -l list +30790 vim list.txt +.Ed +.Pp +Send +.Va SIGSTOP +signal to processes that are an exact match: +.Bd -literal -offset indent +$ pkill -SIGSTOP -f -x "vim list.txt" +.Ed +.Pp +Without +.Fl f +names over 19 characters will silently fail: +.Bd -literal -offset indent +$ vim this_is_a_very_long_file_name & +[1] 36689 +$ + +[1]+ Stopped vim this_is_a_very_long_file_name +$ pgrep "vim this" +$ +.Ed +.Pp +Same as above using the +.Fl f +flag: +.Bd -literal -offset indent +$ pgrep -f "vim this" +36689 +.Ed +.Pp +Find the +.Xr top 1 +command running in any jail: +.Bd -literal -offset indent +$ pgrep -j any top +34498 +.Ed +.Pp +Show all processes running in jail ID 58: +.Bd -literal -offset indent +$ pgrep -l -j58 '.*' +28397 pkg-static +28396 pkg-static +28255 sh +28254 make +.Ed .Sh COMPATIBILITY Historically the option .Dq Fl j Li 0 From owner-svn-src-head@freebsd.org Mon Oct 5 14:07: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 3DE71425ABD; Mon, 5 Oct 2020 14:07:33 +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 4C4j910zG1z3yMr; Mon, 5 Oct 2020 14:07:33 +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 05942167F0; Mon, 5 Oct 2020 14:07:33 +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 095E7WPD039275; Mon, 5 Oct 2020 14:07:32 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 095E7WBV039274; Mon, 5 Oct 2020 14:07:32 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202010051407.095E7WBV039274@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, 5 Oct 2020 14:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366449 - head/usr.bin/procstat X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/usr.bin/procstat X-SVN-Commit-Revision: 366449 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, 05 Oct 2020 14:07:33 -0000 Author: fernape (ports committer) Date: Mon Oct 5 14:07:32 2020 New Revision: 366449 URL: https://svnweb.freebsd.org/changeset/base/366449 Log: procstat(1): Add EXAMPLES section * Add some examples showing binary, arguments and file info from living processes. * Show information from core dumps including an attempt using an old core file. * While here, fix warning 'no blank before trailing delimiter' reported by igor. Approved by: manpages (0mp@) Differential Revision: https://reviews.freebsd.org/D25467 Modified: head/usr.bin/procstat/procstat.1 Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Mon Oct 5 13:52:31 2020 (r366448) +++ head/usr.bin/procstat/procstat.1 Mon Oct 5 14:07:32 2020 (r366449) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 14, 2020 +.Dd October 5, 2020 .Dt PROCSTAT 1 .Os .Sh NAME @@ -710,6 +710,51 @@ auxiliary vector value .El .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Show binary information about the current shell: +.Bd -literal -offset indent +$ procstat binary $$ + PID COMM OSREL PATH +46620 bash 1201000 /usr/local/bin/bash +.Ed +.Pp +Same as above but showing information about open file descriptors: +.Bd -literal -offset indent +$ procstat files $$ + PID COMM FD T V FLAGS REF OFFSET PRO NAME +46620 bash text v r r------- - - - /usr/local/bin/bash +46620 bash ctty v c rw------ - - - /dev/pts/12 +46620 bash cwd v d r------- - - - /tmp +46620 bash root v d r------- - - - / +46620 bash 0 v c rw------ 7 372071 - /dev/pts/12 +46620 bash 1 v c rw------ 7 372071 - /dev/pts/12 +46620 bash 2 v c rw------ 7 372071 - /dev/pts/12 +46620 bash 255 v c rw------ 7 372071 - /dev/pts/12 +.Ed +.Pp +Show the arguments used to launch +.Xr init 8 : +.Bd -literal -offset indent +$ procstat arguments 1 + PID COMM ARGS + 1 init /sbin/init -- +.Ed +.Pp +Extract binary information from a core dump: +.Bd -literal -offset indent +$ procstat binary core.36642 + PID COMM OSREL PATH +36642 top 1201000 /usr/bin/top +.Ed +.Pp +Trying to extract information from a core file generated in a different major +.Fx +version might show an error like this: +.Bd -literal -offset indent +$ procstat mplayer.core +procstat: kinfo_proc structure size mismatch +procstat: procstat_getprocs() +.Ed .Sh SEE ALSO .Xr fstat 1 , .Xr ps 1 , From owner-svn-src-head@freebsd.org Mon Oct 5 15:54: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 21504428240; Mon, 5 Oct 2020 15:54: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 4C4lXD02HHz44Xt; Mon, 5 Oct 2020 15:54: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 D890D17F6F; Mon, 5 Oct 2020 15:54:19 +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 095FsJll008672; Mon, 5 Oct 2020 15:54:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 095FsJ8h008671; Mon, 5 Oct 2020 15:54:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010051554.095FsJ8h008671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 5 Oct 2020 15:54:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366450 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366450 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, 05 Oct 2020 15:54:20 -0000 Author: markj Date: Mon Oct 5 15:54:19 2020 New Revision: 366450 URL: https://svnweb.freebsd.org/changeset/base/366450 Log: Remove sysctl_kern_consmute() It is a trivial wrapper for sysctl_handle_int() since r184521. Also remove the NEEDGIANT flag, cn_mute is accessed locklessly. MFC after: 1 week Modified: head/sys/kern/kern_cons.c Modified: head/sys/kern/kern_cons.c ============================================================================== --- head/sys/kern/kern_cons.c Mon Oct 5 14:07:32 2020 (r366449) +++ head/sys/kern/kern_cons.c Mon Oct 5 15:54:19 2020 (r366450) @@ -93,7 +93,11 @@ int cons_avail_mask = 0; /* Bit mask. Each registered * (i.e., if it is in graphics mode) will have * this bit cleared. */ + static int cn_mute; +SYSCTL_INT(_kern, OID_AUTO, consmute, CTLFLAG_RW, &cn_mute, 0, + "State of the console muting"); + static char *consbuf; /* buffer used by `consmsgbuf' */ static struct callout conscallout; /* callout for outputting to constty */ struct msgbuf consmsgbuf; /* message buffer for console tty */ @@ -364,26 +368,6 @@ SYSCTL_PROC(_kern, OID_AUTO, console, CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, 0, sysctl_kern_console, "A", "Console device control"); - -/* - * User has changed the state of the console muting. - * This may require us to open or close the device in question. - */ -static int -sysctl_kern_consmute(SYSCTL_HANDLER_ARGS) -{ - int error; - - error = sysctl_handle_int(oidp, &cn_mute, 0, req); - if (error != 0 || req->newptr == NULL) - return (error); - return (error); -} - -SYSCTL_PROC(_kern, OID_AUTO, consmute, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, 0, sizeof(cn_mute), - sysctl_kern_consmute, "I", - "State of the console muting"); void cngrab() From owner-svn-src-head@freebsd.org Mon Oct 5 18:17: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 6402A42C1F0; Mon, 5 Oct 2020 18:17:51 +0000 (UTC) (envelope-from chs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C4pjq1yD3z4Jxq; Mon, 5 Oct 2020 18:17:51 +0000 (UTC) (envelope-from chs@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 233FA19E81; Mon, 5 Oct 2020 18:17:51 +0000 (UTC) (envelope-from chs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 095IHpnB099085; Mon, 5 Oct 2020 18:17:51 GMT (envelope-from chs@FreeBSD.org) Received: (from chs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 095IHpSF099084; Mon, 5 Oct 2020 18:17:51 GMT (envelope-from chs@FreeBSD.org) Message-Id: <202010051817.095IHpSF099084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chs set sender to chs@FreeBSD.org using -f From: Chuck Silvers Date: Mon, 5 Oct 2020 18:17:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366453 - head/sys/ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: chs X-SVN-Commit-Paths: head/sys/ufs/ufs X-SVN-Commit-Revision: 366453 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, 05 Oct 2020 18:17:51 -0000 Author: chs Date: Mon Oct 5 18:17:50 2020 New Revision: 366453 URL: https://svnweb.freebsd.org/changeset/base/366453 Log: ufs: restore uniqueness of st_dev as returned by ufs_stat() switch ufs_stat() to use the same value for st_dev as was used by the previous ufs_getattr() stat path. Submitted by: gallatin Reviewed by: mjg, imp, kib, mckusick Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D26596 Modified: head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Mon Oct 5 18:08:52 2020 (r366452) +++ head/sys/ufs/ufs/ufs_vnops.c Mon Oct 5 18:17:50 2020 (r366453) @@ -498,7 +498,7 @@ ufs_stat(struct vop_stat_args *ap) } VI_UNLOCK(vp); - sb->st_dev = vp->v_mount->mnt_stat.f_fsid.val[0]; + sb->st_dev = dev2udev(ITOUMP(ip)->um_dev); sb->st_ino = ip->i_number; sb->st_mode = (ip->i_mode & ~IFMT) | VTTOIF(vp->v_type); sb->st_nlink = ip->i_effnlink; From owner-svn-src-head@freebsd.org Mon Oct 5 18:41: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 D042F42CA46; Mon, 5 Oct 2020 18:41:35 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C4qFC59CBz4LDd; Mon, 5 Oct 2020 18:41:35 +0000 (UTC) (envelope-from trasz@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 95FF41A0CE; Mon, 5 Oct 2020 18:41:35 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 095IfZna015001; Mon, 5 Oct 2020 18:41:35 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 095IfZU1015000; Mon, 5 Oct 2020 18:41:35 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010051841.095IfZU1015000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 5 Oct 2020 18:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366454 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 366454 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, 05 Oct 2020 18:41:35 -0000 Author: trasz Date: Mon Oct 5 18:41:35 2020 New Revision: 366454 URL: https://svnweb.freebsd.org/changeset/base/366454 Log: Drop useless assignment, and add a KASSERT to make sure it really was useless. Reviewed by: nick, jhb Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26649 Modified: head/sys/riscv/riscv/trap.c Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Mon Oct 5 18:17:50 2020 (r366453) +++ head/sys/riscv/riscv/trap.c Mon Oct 5 18:41:35 2020 (r366454) @@ -163,7 +163,9 @@ svc_handler(struct trapframe *frame) struct thread *td; td = curthread; - td->td_frame = frame; + + KASSERT(td->td_frame == frame, + ("%s: td_frame %p != frame %p", __func__, td->td_frame, frame)); syscallenter(td); syscallret(td); From owner-svn-src-head@freebsd.org Mon Oct 5 18:46:14 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 A639642CB60; Mon, 5 Oct 2020 18:46:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C4qLZ3z10z4LSR; Mon, 5 Oct 2020 18:46:14 +0000 (UTC) (envelope-from trasz@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 6C9931A034; Mon, 5 Oct 2020 18:46:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 095IkE9O017717; Mon, 5 Oct 2020 18:46:14 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 095IkEqo017716; Mon, 5 Oct 2020 18:46:14 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010051846.095IkEqo017716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 5 Oct 2020 18:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366456 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 366456 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, 05 Oct 2020 18:46:14 -0000 Author: trasz Date: Mon Oct 5 18:46:14 2020 New Revision: 366456 URL: https://svnweb.freebsd.org/changeset/base/366456 Log: Tweak arm64's cpu_fetch_syscall_args(). This should make it possible for the compiler to inline the memcpy(). Reviewed by: andrew Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26629 Modified: head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Mon Oct 5 18:45:32 2020 (r366455) +++ head/sys/arm64/arm64/trap.c Mon Oct 5 18:46:14 2020 (r366456) @@ -123,30 +123,31 @@ int cpu_fetch_syscall_args(struct thread *td) { struct proc *p; - register_t *ap; + register_t *ap, *dst_ap; struct syscall_args *sa; - int nap; - nap = MAXARGS; p = td->td_proc; - ap = td->td_frame->tf_x; sa = &td->td_sa; + ap = td->td_frame->tf_x; + dst_ap = &sa->args[0]; sa->code = td->td_frame->tf_x[8]; - if (sa->code == SYS_syscall || sa->code == SYS___syscall) { + if (__predict_false(sa->code == SYS_syscall || sa->code == SYS___syscall)) { sa->code = *ap++; - nap--; + } else { + *dst_ap++ = *ap++; } - if (sa->code >= p->p_sysent->sv_size) + if (__predict_false(sa->code >= p->p_sysent->sv_size)) sa->callp = &p->p_sysent->sv_table[0]; else sa->callp = &p->p_sysent->sv_table[sa->code]; - memcpy(sa->args, ap, nap * sizeof(register_t)); - if (sa->callp->sy_narg > nap) - panic("ARM64TODO: Could we have more than %d args?", MAXARGS); + KASSERT(sa->callp->sy_narg <= nitems(sa->args), + ("Syscall %d takes too many arguments", sa->code)); + + memcpy(dst_ap, ap, (MAXARGS - 1) * sizeof(register_t)); td->td_retval[0] = 0; td->td_retval[1] = 0; From owner-svn-src-head@freebsd.org Mon Oct 5 18:57: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 85F1542D0D0 for ; Mon, 5 Oct 2020 18:57:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf43.google.com (mail-qv1-xf43.google.com [IPv6:2607:f8b0:4864:20::f43]) (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 4C4qbk5hLVz4MS3 for ; Mon, 5 Oct 2020 18:57:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf43.google.com with SMTP id s17so74065qvr.11 for ; Mon, 05 Oct 2020 11:57:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JGg8r7lZ8V62j/xVQicFyv/B4AuhWwGhb2kFocJgrYo=; b=yn+l+Rm9/PgsKCKMB4gX6EMn86nCS++kOtv52okKQ+j/Nzi8zWlJorNKfCOGMax6lD A3GHItQNiMevY3JlRqHmlxrFeS8QmWVh0eIEmsl64FBiBBepOUnS86R1hBTS++UZ4XDP se5Bxo7emTJdt6TZqLwARhoWB/ZkWMiHLcXpWAxLynYx2zYcpR68rDZ8KJ4zL5mGExfD ZalHcd4NbnqpW2owx0qGhCAjM+EW+3hTG5IZuIEqkarH3smFBjcfwBBNDpvhaDykwe7N tNoNfUqn1sadgC9XvO93OLjZ+hl7KQjXU9w1AeoAFpFq6TJo5sgqe6ERIKf6oR6RhXP4 7YCg== 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=JGg8r7lZ8V62j/xVQicFyv/B4AuhWwGhb2kFocJgrYo=; b=D7g+uCRgEBf9odexXvuXI7sI8Hsxpiju3i/+lix/XQbJ1GMCcwXMQlw32B0+8a60du 5XVeJtX4tNF8PJl1WleefN/5xt3WSgF88t66GuE71zmM7f1TfwxYsTwhoqTjxXenJml7 wHUP9eNWx3gSxEjIpPqV0/6XgzhfUuUyQtF9viYPR9rMvgXsLOoqNL2RL8/PCBaXM4qe YXXy7Uo4ycKT9Faoe8rBhQtXvFVfaF1EdNHg8DVL/l5O/QnBcKgQfDtdLyHrFf3DqcJQ 1lmBC+C3z2EU717z9CIHjjK0HRyBMDGHQg2JZxUWkESKHdt9/O4iz/NixXMtTqYqIYPp 7S1Q== X-Gm-Message-State: AOAM531svW3BOd0w8eRG9mBmwrcls7AsMI1IHOB6clkrDHbbninnc5KK N+0ibz3ND51jVMu0ba7d21BuCyyd2W5ixhkNBCtf8UHCVRhe/Q== X-Google-Smtp-Source: ABdhPJzEHnzZRNTVK9f3XSzSQz2TioF3diWDCY+1FWcslj8Be+X2yRz3sq3KNRWl+3/vEQgR+FuAdaPqhVS432xdwS8= X-Received: by 2002:a05:6214:174f:: with SMTP id dc15mr1054554qvb.26.1601924258029; Mon, 05 Oct 2020 11:57:38 -0700 (PDT) MIME-Version: 1.0 References: <202010041717.094HHH9d069578@repo.freebsd.org> <476286772.120.1601898374873@localhost> In-Reply-To: <476286772.120.1601898374873@localhost> From: Warner Losh Date: Mon, 5 Oct 2020 12:57:26 -0600 Message-ID: Subject: Re: svn commit: r366431 - head/sys/dev/usb/serial To: Ronald Klop Cc: Hans Petter Selasky , svn-src-all , svn-src-head , src-committers X-Rspamd-Queue-Id: 4C4qbk5hLVz4MS3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=yn+l+Rm9; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::f43) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.02 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.94)[-0.940]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.90)[-0.898]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.19)[-0.187]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f43:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; MAILMAN_DEST(0.00)[svn-src-head]; RCVD_COUNT_TWO(0.00)[2] 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: Mon, 05 Oct 2020 18:57:39 -0000 On Mon, Oct 5, 2020 at 5:46 AM Ronald Klop wrote: > Hi, > > I was interested by this commit. But the commit and commit message don't > have much information. I was surprised that the "Differential Revision" > link contains a lot of info about this. How permanent is this > review.freebsd.org server? Wil it stay after the git migration? > Yes. It's anticipated that we'll keep it around forever. Warner > Ronald. > > > *Van:* Hans Petter Selasky > *Datum:* zondag, 4 oktober 2020 19:17 > *Aan:* src-committers@freebsd.org, svn-src-all@freebsd.org, > svn-src-head@freebsd.org > *Onderwerp:* svn commit: r366431 - head/sys/dev/usb/serial > > Author: hselasky > Date: Sun Oct 4 17:17:16 2020 > New Revision: 366431 > URL: https://svnweb.freebsd.org/changeset/base/366431 > > Log: > Add support for Google Cr50 (GSC) Closed Case Debugging UART interfaces > to > the USB generic serial port driver, ugensa. > > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D21863 > Submitted by: greg_unrelenting.technology (Greg V) > Sponsored by: Mellanox Technologies // NVIDIA Networking > > Modified: > head/sys/dev/usb/serial/ugensa.c > > Modified: head/sys/dev/usb/serial/ugensa.c > > ============================================================================== > --- head/sys/dev/usb/serial/ugensa.c Sun Oct 4 17:07:13 2020 > (r366430) > +++ head/sys/dev/usb/serial/ugensa.c Sun Oct 4 17:17:16 2020 > (r366431) > @@ -161,6 +161,8 @@ static const STRUCT_USB_HOST_ID ugensa_devs[] = { > {USB_VPI(USB_VENDOR_KYOCERA2, USB_PRODUCT_KYOCERA2_CDMA_MSM_K, 1)}, > {USB_VPI(USB_VENDOR_HP, USB_PRODUCT_HP_49GPLUS, 1)}, > {USB_VPI(USB_VENDOR_NOVATEL2, USB_PRODUCT_NOVATEL2_FLEXPACKGPS, 3)}, > + {USB_VENDOR(USB_VENDOR_GOOGLE), USB_IFACE_CLASS(UICLASS_VENDOR), > + USB_IFACE_SUBCLASS(0x50), USB_IFACE_PROTOCOL(0x01), > USB_DRIVER_INFO(10)}, > }; > > DRIVER_MODULE(ugensa, uhub, ugensa_driver, ugensa_devclass, NULL, 0); > _______________________________________________ > 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 Oct 5 19:26: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 4016E42DC64; Mon, 5 Oct 2020 19:26:55 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C4rFW0ym4z4PN6; Mon, 5 Oct 2020 19:26:55 +0000 (UTC) (envelope-from kp@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 049521A7F4; Mon, 5 Oct 2020 19:26:55 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 095JQs1U042934; Mon, 5 Oct 2020 19:26:54 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 095JQsIP042933; Mon, 5 Oct 2020 19:26:54 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202010051926.095JQsIP042933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 5 Oct 2020 19:26:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366461 - head/sbin/devfs X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sbin/devfs X-SVN-Commit-Revision: 366461 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, 05 Oct 2020 19:26:55 -0000 Author: kp Date: Mon Oct 5 19:26:54 2020 New Revision: 366461 URL: https://svnweb.freebsd.org/changeset/base/366461 Log: devfs.rules: unhide pf in vnet jails /dev/pf is usable in vnet jails, so don't hide the node there. We shouldn't expose /dev/pf in regular jails, as that gives them control over the host (or parent vnet jail) firewall. Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D26537 Modified: head/sbin/devfs/devfs.rules Modified: head/sbin/devfs/devfs.rules ============================================================================== --- head/sbin/devfs/devfs.rules Mon Oct 5 19:22:28 2020 (r366460) +++ head/sbin/devfs/devfs.rules Mon Oct 5 19:26:54 2020 (r366461) @@ -86,3 +86,7 @@ add include $devfsrules_unhide_basic add include $devfsrules_unhide_login add path fuse unhide add path zfs unhide + +[devfsrules_jail_vnet=5] +add include $devfsrules_jail +add path pf unhide From owner-svn-src-head@freebsd.org Mon Oct 5 19:35: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 058AB42E281; Mon, 5 Oct 2020 19:35:56 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) (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 4C4rRt6rrxz4PtY; Mon, 5 Oct 2020 19:35:54 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm1-x341.google.com with SMTP id e2so710780wme.1; Mon, 05 Oct 2020 12:35:54 -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=TR3xq2GtggHSdOO4TnUu85QEXUnEasNf3WMFvNpQBLM=; b=q6S/R1jcaR4KcHTLP8OfTqGd4UeZLF8C9z4cwWY6YUnrxhR3nOCOqIRRDvosalqkvk 1lZg1uwlen3On9UbK5jHBc/7hnOeiJ1vRu9rBa3A0k7zygvIn/MS0pzuaK/JB1jhDdTR 38npj1M8sEVUwC/dKpR+MGJewNqhmP8kUaogVVoiSJjNiKNCRVihVsDtXjyDPuZBbaBj +q0uzLh7c2lWVQq5YFSTohJld5ul2uFBuMnZZi5lc7BFbNTfQO3HHiiyaqKiZiSbPUpB AGuwGK+cHRCTikCZzXd+8Cv0wk8BKqv78KDvjdzI/D+Dj3VIrQg4/WgkbwXU8j7RqK4r c/eg== 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=TR3xq2GtggHSdOO4TnUu85QEXUnEasNf3WMFvNpQBLM=; b=FpLZJ/ThpKLuD5Ff2R13IAmUnOIgsRbONOHcwoS/K0dxFlHDLCX+lcamIUALfQFZu9 bcW0ArokIhVlqEBcRVImjCWvOsS8uBKANwW+OHGb7AYVx7UkAOoNnj5K/8l/pN2CrbeJ DrYLnXZNNfPJDSoV91OekuxFxuBMn3zSasCCN+YN08fcWYHFXHQz79S3yU3zqua3dsqk PqsF5Mcay4L6lytnodqRu9e8hAMg1icN2UKlxF/LbDbXJYY0pPFIN45BGW4EcTSfHvGp 4JIwT8MxymwOjEiWfwiYEiTMk2JTnXSJWMQ2nTOvVA3yLK3TXtvCZdFgtbgCqe74PqBg Zf+w== X-Gm-Message-State: AOAM531ky+6JsUgwgj4sKaIM8AkZ+ptfzfRHIfKtHsz0XNJoZgmzmth9 ITvShiIE9MOAtDJIfBvHYsRYK/6Zs8mdwK+0rRk= X-Google-Smtp-Source: ABdhPJy1ra/8/1a0sPEC61i8Iqc53A87YWyflo5IFKho+BLQ1nPLf3CqvkrIbd2MTdQrdMxfYkMpIJYI5t83azxCPq4= X-Received: by 2002:a1c:98d4:: with SMTP id a203mr963282wme.83.1601926552727; Mon, 05 Oct 2020 12:35:52 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6000:187:0:0:0:0 with HTTP; Mon, 5 Oct 2020 12:35:51 -0700 (PDT) In-Reply-To: <20201005011833.GI2643@kib.kiev.ua> References: <202010041633.094GXg4l044462@repo.freebsd.org> <20201005011833.GI2643@kib.kiev.ua> From: Mateusz Guzik Date: Mon, 5 Oct 2020 21:35:51 +0200 Message-ID: Subject: Re: svn commit: r366429 - in head/sys: kern sys To: Konstantin Belousov Cc: Rick Macklem , "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: 4C4rRt6rrxz4PtY X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=q6S/R1jc; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::341 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-2.55 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_SHORT(0.46)[0.464]; NEURAL_HAM_LONG(-1.02)[-1.016]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::341:from]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; 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]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; 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: Mon, 05 Oct 2020 19:35:56 -0000 On 10/5/20, Konstantin Belousov wrote: > On Sun, Oct 04, 2020 at 09:06:02PM +0000, Rick Macklem wrote: >> Mateusz Guzik wrote: >> >Why is the process lock always taken? It looks like both routines just >> >check a thread-local flag, so perhaps this can get away without >> >serializing this process-wide? >> I did spot this slight difference between the initial version of >> sig_intr() and >> this one. At least w.r.t. copy_file_range(2), the call happens >> infrequently >> enough that the overhead of acquiring the lock is not significant. >> > Yes, the function should not be on any frequent path. > > That said, all signal delivery to process is covered by the process lock, > so checks under process lock make the advisory answer provide less false > negatives. If considered too importand in some cases (when ?), the > following > patch can be applied. > > diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c > index 8108d4cb3a5..ed4dd52b66d 100644 > --- a/sys/kern/kern_sig.c > +++ b/sys/kern/kern_sig.c > @@ -3212,6 +3212,9 @@ sig_intr(void) > int ret; > > td = curthread; > + if ((td->td_flags & (TDF_NEEDSIGCHK | TDF_NEEDSUSPCHK)) == 0) > + return (0); > + > p = td->td_proc; > > PROC_LOCK(p); > I presume copy_file_range will not be the only consumer going forward. The default for all new code should be to avoid locks or other atomics if it can be helped, otherwise it's just never ending whack-a-mole and this is bound to become a bottleneck at some point. So happens process lock is already quite contended (e.g., when running poudriere) and adding to it is the wrong way to go. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Mon Oct 5 19:38: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 6C97942E508; Mon, 5 Oct 2020 19:38: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 4C4rWJ2Kc8z4Q2h; Mon, 5 Oct 2020 19:38: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 1925F1AA2B; Mon, 5 Oct 2020 19:38: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 095Jcp4W049333; Mon, 5 Oct 2020 19:38:51 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 095Jcp7v049331; Mon, 5 Oct 2020 19:38:51 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010051938.095Jcp7v049331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 5 Oct 2020 19:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366462 - 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: 366462 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, 05 Oct 2020 19:38:52 -0000 Author: mjg Date: Mon Oct 5 19:38:51 2020 New Revision: 366462 URL: https://svnweb.freebsd.org/changeset/base/366462 Log: cache: fix pwd use-after-free in setting up fallback Since the code exits smr section prior to calling pwd_hold, the used pwd can be freed and a new one allocated with the same address, making the comparison erroneously true. Note it is very unlikely anyone ran into it. Modified: head/sys/kern/kern_descrip.c head/sys/kern/vfs_cache.c head/sys/sys/filedesc.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Mon Oct 5 19:26:54 2020 (r366461) +++ head/sys/kern/kern_descrip.c Mon Oct 5 19:38:51 2020 (r366462) @@ -3344,6 +3344,17 @@ pwd_hold_filedesc(struct filedesc *fdp) return (pwd); } +bool +pwd_hold_smr(struct pwd *pwd) +{ + + MPASS(pwd != NULL); + if (__predict_true(refcount_acquire_if_not_zero(&pwd->pwd_refcount))) { + return (true); + } + return (false); +} + struct pwd * pwd_hold(struct thread *td) { @@ -3354,8 +3365,7 @@ pwd_hold(struct thread *td) vfs_smr_enter(); pwd = vfs_smr_entered_load(&fdp->fd_pwd); - MPASS(pwd != NULL); - if (__predict_true(refcount_acquire_if_not_zero(&pwd->pwd_refcount))) { + if (pwd_hold_smr(pwd)) { vfs_smr_exit(); return (pwd); } Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Mon Oct 5 19:26:54 2020 (r366461) +++ head/sys/kern/vfs_cache.c Mon Oct 5 19:38:51 2020 (r366462) @@ -3484,25 +3484,24 @@ cache_fplookup_partial_setup(struct cache_fpl *fpl) ndp = fpl->ndp; cnp = fpl->cnp; + pwd = fpl->pwd; dvp = fpl->dvp; dvp_seqc = fpl->dvp_seqc; - dvs = vget_prep_smr(dvp); - if (__predict_false(dvs == VGET_NONE)) { + if (!pwd_hold_smr(pwd)) { cache_fpl_smr_exit(fpl); return (cache_fpl_aborted(fpl)); } + dvs = vget_prep_smr(dvp); cache_fpl_smr_exit(fpl); - - vget_finish_ref(dvp, dvs); - if (!vn_seqc_consistent(dvp, dvp_seqc)) { - vrele(dvp); + if (__predict_false(dvs == VGET_NONE)) { + pwd_drop(pwd); return (cache_fpl_aborted(fpl)); } - pwd = pwd_hold(curthread); - if (fpl->pwd != pwd) { + vget_finish_ref(dvp, dvs); + if (!vn_seqc_consistent(dvp, dvp_seqc)) { vrele(dvp); pwd_drop(pwd); return (cache_fpl_aborted(fpl)); Modified: head/sys/sys/filedesc.h ============================================================================== --- head/sys/sys/filedesc.h Mon Oct 5 19:26:54 2020 (r366461) +++ head/sys/sys/filedesc.h Mon Oct 5 19:38:51 2020 (r366462) @@ -302,6 +302,7 @@ void pwd_ensure_dirs(void); void pwd_set_rootvnode(void); struct pwd *pwd_hold_filedesc(struct filedesc *fdp); +bool pwd_hold_smr(struct pwd *pwd); struct pwd *pwd_hold(struct thread *td); void pwd_drop(struct pwd *pwd); static inline void From owner-svn-src-head@freebsd.org Mon Oct 5 19:58: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 866E142E5EE; Mon, 5 Oct 2020 19:58:56 +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 4C4ryS2x86z4RJ0; Mon, 5 Oct 2020 19:58: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 43EDB1B20E; Mon, 5 Oct 2020 19:58: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 095JwuDJ061855; Mon, 5 Oct 2020 19:58:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 095Jwtwr061852; Mon, 5 Oct 2020 19:58:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010051958.095Jwtwr061852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 5 Oct 2020 19:58:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366464 - in head/sys/dev: re rl X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/dev: re rl X-SVN-Commit-Revision: 366464 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, 05 Oct 2020 19:58:56 -0000 Author: markj Date: Mon Oct 5 19:58:55 2020 New Revision: 366464 URL: https://svnweb.freebsd.org/changeset/base/366464 Log: re(4): Add a 8168-compatible device ID This is described in RealTek's driver as a "RTL8168 Series add-on card." PR: 250037 Submitted by: Hiroshi HASEGAWA MFC after: 1 week Modified: head/sys/dev/re/if_re.c head/sys/dev/rl/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Mon Oct 5 19:45:11 2020 (r366463) +++ head/sys/dev/re/if_re.c Mon Oct 5 19:58:55 2020 (r366464) @@ -186,6 +186,8 @@ static const struct rl_type re_devs[] = { "RealTek 810xE PCIe 10/100baseTX" }, { RT_VENDORID, RT_DEVICEID_8168, 0, "RealTek 8168/8111 B/C/CP/D/DP/E/F/G PCIe Gigabit Ethernet" }, + { RT_VENDORID, RT_DEVICEID_8161, 0, + "RealTek 8168 Gigabit Ethernet" }, { NCUBE_VENDORID, RT_DEVICEID_8168, 0, "TP-Link TG-3468 v2 (RTL8168) Gigabit Ethernet" }, { RT_VENDORID, RT_DEVICEID_8169, 0, Modified: head/sys/dev/rl/if_rlreg.h ============================================================================== --- head/sys/dev/rl/if_rlreg.h Mon Oct 5 19:45:11 2020 (r366463) +++ head/sys/dev/rl/if_rlreg.h Mon Oct 5 19:58:55 2020 (r366464) @@ -999,6 +999,7 @@ struct rl_softc { #define RT_DEVICEID_8138 0x8138 #define RT_DEVICEID_8139 0x8139 #define RT_DEVICEID_8169SC 0x8167 +#define RT_DEVICEID_8161 0x8161 #define RT_DEVICEID_8168 0x8168 #define RT_DEVICEID_8169 0x8169 #define RT_DEVICEID_8100 0x8100 From owner-svn-src-head@freebsd.org Mon Oct 5 20: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 344B342EE4F; Mon, 5 Oct 2020 20:13:24 +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 4C4sH80StRz4S3b; Mon, 5 Oct 2020 20:13:24 +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 E75621B3C4; Mon, 5 Oct 2020 20:13:23 +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 095KDNGL073904; Mon, 5 Oct 2020 20:13:23 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 095KDNHJ073900; Mon, 5 Oct 2020 20:13:23 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202010052013.095KDNHJ073900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Mon, 5 Oct 2020 20:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366465 - in head: sbin/sysctl sys/kern sys/sys usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in head: sbin/sysctl sys/kern sys/sys usr.bin/truss X-SVN-Commit-Revision: 366465 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, 05 Oct 2020 20:13:24 -0000 Author: freqlabs Date: Mon Oct 5 20:13:22 2020 New Revision: 366465 URL: https://svnweb.freebsd.org/changeset/base/366465 Log: Enable iterating all sysctls, even ones with CTLFLAG_SKIP Add an "nextnoskip" sysctl that allows for listing of sysctls intended to be normally skipped for cost reasons. This makes it so the names/descriptions of those sysctls can be discovered with sysctl -aN/sysctl -ad/sysctl -at. It also makes it so children are visited when a node flagged with CTLFLAG_SKIP is explicitly requested. The intended use case is to mark the root "kstat" node with CTLFLAG_SKIP so that the extensive and expensive stats are skipped by default but may still be easily obtained without having to know them all (which may not even be possible) and request each one-by-one. Reviewed by: jhb MFC after: 2 weeks Relnotes: yes Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D26560 Modified: head/sbin/sysctl/sysctl.c head/sys/kern/kern_sysctl.c head/sys/sys/sysctl.h head/usr.bin/truss/syscalls.c Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Mon Oct 5 19:58:55 2020 (r366464) +++ head/sbin/sysctl/sysctl.c Mon Oct 5 20:13:22 2020 (r366465) @@ -81,7 +81,7 @@ static int Nflag, nflag, oflag, qflag, tflag, Tflag, W static int oidfmt(int *, int, char *, u_int *); static int parsefile(const char *); static int parse(const char *, int); -static int show_var(int *, int); +static int show_var(int *, int, bool); static int sysctl_all(int *oid, int len); static int name2oid(const char *, int *); @@ -428,13 +428,13 @@ parse(const char *string, int lineno) if (newvalstr == NULL || dflag) { if ((kind & CTLTYPE) == CTLTYPE_NODE) { if (dflag) { - i = show_var(mib, len); + i = show_var(mib, len, false); if (!i && !bflag) putchar('\n'); } sysctl_all(mib, len); } else { - i = show_var(mib, len); + i = show_var(mib, len, false); if (!i && !bflag) putchar('\n'); } @@ -504,7 +504,7 @@ parse(const char *string, int lineno) break; } - i = show_var(mib, len); + i = show_var(mib, len, false); if (sysctl(mib, len, 0, 0, newval, newsize) == -1) { free(newbuf); if (!i && !bflag) @@ -532,7 +532,7 @@ parse(const char *string, int lineno) printf(" -> "); i = nflag; nflag = 1; - j = show_var(mib, len); + j = show_var(mib, len, false); if (!j && !bflag) putchar('\n'); nflag = i; @@ -942,7 +942,7 @@ oidfmt(int *oid, int len, char *fmt, u_int *kind) * Return minus one if we had errors. */ static int -show_var(int *oid, int nlen) +show_var(int *oid, int nlen, bool honor_skip) { u_char buf[BUFSIZ], *val, *oval, *p; char name[BUFSIZ], fmt[BUFSIZ]; @@ -976,11 +976,11 @@ show_var(int *oid, int nlen) oidfmt(oid, nlen, fmt, &kind); /* if Wflag then only list sysctls that are writeable and not stats. */ if (Wflag && ((kind & CTLFLAG_WR) == 0 || (kind & CTLFLAG_STATS) != 0)) - return 1; + return (1); /* if Tflag then only list sysctls that are tuneables. */ if (Tflag && (kind & CTLFLAG_TUN) == 0) - return 1; + return (1); if (Nflag) { printf("%s", name); @@ -1013,6 +1013,10 @@ show_var(int *oid, int nlen) return (0); } + /* bail before fetching the value if we're honoring skip */ + if (honor_skip && (kind & CTLFLAG_SKIP) != 0) + return (1); + /* don't fetch opaques that we don't know how to print */ if (ctltype == CTLTYPE_OPAQUE) { if (strcmp(fmt, "S,clockinfo") == 0) @@ -1195,15 +1199,17 @@ sysctl_all(int *oid, int len) int name1[22], name2[22]; int i, j; size_t l1, l2; + bool honor_skip = false; - name1[0] = 0; - name1[1] = 2; + name1[0] = CTL_SYSCTL; + name1[1] = (oid != NULL || Nflag || dflag || tflag) ? + CTL_SYSCTL_NEXTNOSKIP : CTL_SYSCTL_NEXT; l1 = 2; if (len) { - memcpy(name1+2, oid, len * sizeof(int)); + memcpy(name1 + 2, oid, len * sizeof(int)); l1 += len; } else { - name1[2] = 1; + name1[2] = CTL_KERN; l1++; } for (;;) { @@ -1225,11 +1231,12 @@ sysctl_all(int *oid, int len) if (name2[i] != oid[i]) return (0); - i = show_var(name2, l2); + i = show_var(name2, l2, honor_skip); if (!i && !bflag) putchar('\n'); - memcpy(name1+2, name2, l2 * sizeof(int)); + memcpy(name1 + 2, name2, l2 * sizeof(int)); l1 = 2 + l2; + honor_skip = true; } } Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Mon Oct 5 19:58:55 2020 (r366464) +++ head/sys/kern/kern_sysctl.c Mon Oct 5 20:13:22 2020 (r366465) @@ -950,7 +950,8 @@ SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_re * {CTL_SYSCTL, CTL_SYSCTL_DEBUG} printf the entire MIB-tree. * {CTL_SYSCTL, CTL_SYSCTL_NAME, ...} return the name of the "..." * OID. - * {CTL_SYSCTL, CTL_SYSCTL_NEXT, ...} return the next OID. + * {CTL_SYSCTL, CTL_SYSCTL_NEXT, ...} return the next OID, honoring + * CTLFLAG_SKIP. * {CTL_SYSCTL, CTL_SYSCTL_NAME2OID} return the OID of the name in * "new" * {CTL_SYSCTL, CTL_SYSCTL_OIDFMT, ...} return the kind & format info @@ -959,6 +960,8 @@ SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_re * "..." OID. * {CTL_SYSCTL, CTL_SYSCTL_OIDLABEL, ...} return the aggregation label of * the "..." OID. + * {CTL_SYSCTL, CTL_SYSCTL_NEXTNOSKIP, ...} return the next OID, ignoring + * CTLFLAG_SKIP. */ #ifdef SYSCTL_DEBUG @@ -1099,7 +1102,7 @@ static SYSCTL_NODE(_sysctl, CTL_SYSCTL_NAME, name, CTL static int sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int *name, u_int namelen, - int *next, int *len, int level, struct sysctl_oid **oidpp) + int *next, int *len, int level, struct sysctl_oid **oidpp, bool honor_skip) { struct sysctl_oid *oidp; @@ -1109,9 +1112,12 @@ sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int *next = oidp->oid_number; *oidpp = oidp; - if ((oidp->oid_kind & (CTLFLAG_SKIP | CTLFLAG_DORMANT)) != 0) + if ((oidp->oid_kind & CTLFLAG_DORMANT) != 0) continue; + if (honor_skip && (oidp->oid_kind & CTLFLAG_SKIP) != 0) + continue; + if (!namelen) { if ((oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE) return (0); @@ -1120,7 +1126,7 @@ sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int return (0); lsp = SYSCTL_CHILDREN(oidp); if (!sysctl_sysctl_next_ls(lsp, 0, 0, next+1, - len, level+1, oidpp)) + len, level+1, oidpp, honor_skip)) return (0); goto emptynode; } @@ -1135,7 +1141,7 @@ sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int return (0); lsp = SYSCTL_CHILDREN(oidp); if (!sysctl_sysctl_next_ls(lsp, name+1, namelen-1, - next+1, len, level+1, oidpp)) + next+1, len, level+1, oidpp, honor_skip)) return (0); goto next; } @@ -1147,14 +1153,14 @@ sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int lsp = SYSCTL_CHILDREN(oidp); if (!sysctl_sysctl_next_ls(lsp, name+1, namelen-1, next+1, - len, level+1, oidpp)) + len, level+1, oidpp, honor_skip)) return (0); next: namelen = 1; emptynode: *len = level; } - return (1); + return (ENOENT); } static int @@ -1162,18 +1168,19 @@ sysctl_sysctl_next(SYSCTL_HANDLER_ARGS) { int *name = (int *) arg1; u_int namelen = arg2; - int i, j, error; + int len, error; struct sysctl_oid *oid; struct sysctl_oid_list *lsp = &sysctl__children; struct rm_priotracker tracker; - int newoid[CTL_MAXNAME]; + int next[CTL_MAXNAME]; SYSCTL_RLOCK(&tracker); - i = sysctl_sysctl_next_ls(lsp, name, namelen, newoid, &j, 1, &oid); + error = sysctl_sysctl_next_ls(lsp, name, namelen, next, &len, 1, &oid, + oidp->oid_number == CTL_SYSCTL_NEXT); SYSCTL_RUNLOCK(&tracker); - if (i) - return (ENOENT); - error = SYSCTL_OUT(req, newoid, j * sizeof (int)); + if (error) + return (error); + error = SYSCTL_OUT(req, next, len * sizeof (int)); return (error); } @@ -1184,6 +1191,9 @@ sysctl_sysctl_next(SYSCTL_HANDLER_ARGS) static SYSCTL_NODE(_sysctl, CTL_SYSCTL_NEXT, next, CTLFLAG_RD | CTLFLAG_MPSAFE | CTLFLAG_CAPRD, sysctl_sysctl_next, ""); +static SYSCTL_NODE(_sysctl, CTL_SYSCTL_NEXTNOSKIP, nextnoskip, CTLFLAG_RD | + CTLFLAG_MPSAFE | CTLFLAG_CAPRD, sysctl_sysctl_next, ""); + static int name2oid(char *name, int *oid, int *len, struct sysctl_oid **oidpp) { @@ -2726,10 +2736,10 @@ db_show_sysctl_all(int *oid, size_t len, int flags) name1[1] = CTL_SYSCTL_NEXT; l1 = 2; if (len) { - memcpy(name1+2, oid, len * sizeof(int)); - l1 +=len; + memcpy(name1 + 2, oid, len * sizeof(int)); + l1 += len; } else { - name1[2] = 1; + name1[2] = CTL_KERN; l1++; } for (;;) { @@ -2742,7 +2752,7 @@ db_show_sysctl_all(int *oid, size_t len, int flags) if (error == ENOENT) return (0); else - db_error("sysctl(getnext)"); + db_error("sysctl(next)"); } l2 /= sizeof(int); Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Mon Oct 5 19:58:55 2020 (r366464) +++ head/sys/sys/sysctl.h Mon Oct 5 20:13:22 2020 (r366465) @@ -934,11 +934,12 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); */ #define CTL_SYSCTL_DEBUG 0 /* printf all nodes */ #define CTL_SYSCTL_NAME 1 /* string name of OID */ -#define CTL_SYSCTL_NEXT 2 /* next OID */ +#define CTL_SYSCTL_NEXT 2 /* next OID, honoring CTLFLAG_SKIP */ #define CTL_SYSCTL_NAME2OID 3 /* int array of name */ #define CTL_SYSCTL_OIDFMT 4 /* OID's kind and format */ #define CTL_SYSCTL_OIDDESCR 5 /* OID's description */ #define CTL_SYSCTL_OIDLABEL 6 /* aggregation label */ +#define CTL_SYSCTL_NEXTNOSKIP 7 /* next OID, ignoring CTLFLAG_SKIP */ /* * CTL_KERN identifiers Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Mon Oct 5 19:58:55 2020 (r366464) +++ head/usr.bin/truss/syscalls.c Mon Oct 5 20:13:22 2020 (r366465) @@ -2360,6 +2360,9 @@ print_arg(struct syscall_args *sc, unsigned long *args fprintf(fp, "oidlabel "); print_sysctl(fp, oid + 2, len - 2); break; + case CTL_SYSCTL_NEXTNOSKIP: + fprintf(fp, "nextnoskip"); + break; default: print_sysctl(fp, oid + 1, len - 1); } From owner-svn-src-head@freebsd.org Mon Oct 5 20:57: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 37C3142F933; Mon, 5 Oct 2020 20:57:45 +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 4C4tGK0jpGz4TV3; Mon, 5 Oct 2020 20:57:45 +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 F14541BD15; Mon, 5 Oct 2020 20:57:44 +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 095KviiB098470; Mon, 5 Oct 2020 20:57:44 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 095Kvi7e098469; Mon, 5 Oct 2020 20:57:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202010052057.095Kvi7e098469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 5 Oct 2020 20:57:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366466 - head/usr.sbin/crunch/crunchgen X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/crunch/crunchgen X-SVN-Commit-Revision: 366466 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, 05 Oct 2020 20:57:45 -0000 Author: kevans Date: Mon Oct 5 20:57:44 2020 New Revision: 366466 URL: https://svnweb.freebsd.org/changeset/base/366466 Log: crunchgen: fix MK_AUTO_OBJ logic after r364166 r364166 converted echo -n `/bin/pwd` to a raw pwd invocation, leaving a trailing newline at the end of path. This caused a later stat() of it to erroneously fail and the fallback to MK_AUTO_OBJ=no logic proceeded as unexpected. Harry Schmalzbauer bissected the resulting build failure he experienced (stable/12 host, -HEAD build) down to r365887. This change is mostly unrelated, except it switches the build to bootstrapped crunchgen - clue! I then bissected recent crunchgen changes going back a bit since we wouldn't observe the failure immediately with -CURRENT in most configurations, which landed me on r364166. After many intense head-scratching minutes and printf debugging, I realized that the newline was the difference. This is where our tale ends. Reported by: Harry Schmalzbauer, O. Hartmann, Mike Tancsa, kevans MFC after: 3 days Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c ============================================================================== --- head/usr.sbin/crunch/crunchgen/crunchgen.c Mon Oct 5 20:13:22 2020 (r366465) +++ head/usr.sbin/crunch/crunchgen/crunchgen.c Mon Oct 5 20:57:44 2020 (r366466) @@ -666,6 +666,8 @@ fillin_program(prog_t *p) if (!*path) errx(1, "Can't perform pwd on: %s\n", p->srcdir); + /* Chop off trailing newline. */ + path[strlen(path) - 1] = '\0'; p->realsrcdir = strdup(path); } From owner-svn-src-head@freebsd.org Mon Oct 5 21:39:14 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 58F3E4307A4; Mon, 5 Oct 2020 21:39:14 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 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 4C4vBB1VDSz4WK1; Mon, 5 Oct 2020 21:39:14 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1601933954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gdqVwIQFHE8F9uq5mnfAT+tG0rLekitLmSBSfFmEjPM=; b=fnGG+1GhtohV1lr2Uykm5zDWN8v+PFeyurnabDcVjGLqYYkVS2MdMGMUyUyEBOWxKQHuzG uotWoLNN3x+gU+OqB6FXSM7kTBd/HeTvhJS0n9v8ML7hOOFla9b1VmGXWa8QWlDWfbopYX 20t09XHXW1nurQZGCr6qubRoZTRS+1ZBsL9DTwk3H9FbShJzcXOM5e0g6qfYvgMpJAAlzd mfG08P/y3RRkr0t0wuwXZV9Spa4wODJwls9HovvLRSwxGLP8W/yrg1kHUqZ/qZ5pkO1VOt npMVyT9arQVRVjM9MIPFyQ/re+x8L5eDzUYffWLSSrfxib4VqI+a3uGwiGG7tA== Received: by freefall.freebsd.org (Postfix, from userid 1033) id 2475C1CBAD; Mon, 5 Oct 2020 21:39:14 +0000 (UTC) Date: Mon, 5 Oct 2020 21:39:14 +0000 From: Alexey Dokuchaev To: Kyle Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366466 - head/usr.sbin/crunch/crunchgen Message-ID: <20201005213914.GA28182@FreeBSD.org> References: <202010052057.095Kvi7e098469@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202010052057.095Kvi7e098469@repo.freebsd.org> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1601933954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gdqVwIQFHE8F9uq5mnfAT+tG0rLekitLmSBSfFmEjPM=; b=hwo4GWdzcek4uOhGW5ayfdNXrU70fLBXcHKTphAxvmIawDrP3yu8z6mPfv3Cv63dEPQoh5 W+a8LO5orHfHCSsrdHmxjlj9apA1pFU5Ax3SA5F0NaQUFrFWm/Gy4WHpoMC3GR1nBpjh0X U57nbFmDFiKXZ+3i5RMtGYSbTdqOIF1gsuARh3qcOcO0hCB4mB7eNi+zyqOZsb6ycUdKBb UvxOXzgjIKKRfG4+BdzFRqQKKKudUSgPiVdHEjqudiM2a0ugqqkDrSg9c7GN2f/NivbqDm S1l8orylnEDqFrFohydcnRZaA3Y5EJvbswR72ov2EzvHoijeRZUpjSdohnACSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1601933954; a=rsa-sha256; cv=none; b=SDJU5unH7De+lv8yRCmBRWxpL+xHRm0BPw8nf11RvzZUD17YpZRgJ+Z+fiE7n0OoHNKV5c loPeV4VZrWZoGk11HqnWL7kGPTkYtBkRZucG0FZ3PExjRTazy0H2OZ3/t4Uv6iZ/S0TE11 Y6QSnOTFm4FdSIEUm33DAC/6h+bzWnPtYr0n74NpH9ni5Cn52lQGFHQ/0NOzex3coyTYhN A3wdpXptsa6OwHng2eIJmmD/9VI+JxZ6OIcRWqpn97QBaJpNAFdGiIUR2QC+XY2mTlTIbS sZFNZlbTGNNiBUC7NMTJzs+uIPwiV5rBlENCq2y+trg0tT2KoHeG6I5PAmGavQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; 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: Mon, 05 Oct 2020 21:39:14 -0000 On Mon, Oct 05, 2020 at 08:57:44PM +0000, Kyle Evans wrote: > New Revision: 366466 > URL: https://svnweb.freebsd.org/changeset/base/366466 > > Log: > crunchgen: fix MK_AUTO_OBJ logic after r364166 > > r364166 converted echo -n `/bin/pwd` to a raw pwd invocation, leaving a > trailing newline at the end of path. This caused a later stat() of it to > erroneously fail and the fallback to MK_AUTO_OBJ=no logic proceeded as > unexpected. [...] @@ -648,8 +653,7 @@ /* Determine the actual srcdir (maybe symlinked). */ if (p->srcdir) { - snprintf(line, MAXLINELEN, "cd %s && echo -n `/bin/pwd`", - p->srcdir); + snprintf(line, MAXLINELEN, "cd %s && pwd", p->srcdir); f = popen(line,"r"); Calling popen("cd somedir && pwd") in a C program to resolve symlinks, seriously? Why not simply call realpath(3) instead? :-/ ./danfe From owner-svn-src-head@freebsd.org Mon Oct 5 22:18: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 08D9743198E; Mon, 5 Oct 2020 22:18:05 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C4w306qZwz4Yv5; Mon, 5 Oct 2020 22:18:04 +0000 (UTC) (envelope-from np@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 C91251CD0D; Mon, 5 Oct 2020 22:18:04 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 095MI4Ws047530; Mon, 5 Oct 2020 22:18:04 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 095MI499047528; Mon, 5 Oct 2020 22:18:04 GMT (envelope-from np@FreeBSD.org) Message-Id: <202010052218.095MI499047528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 5 Oct 2020 22:18:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366467 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 366467 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, 05 Oct 2020 22:18:05 -0000 Author: np Date: Mon Oct 5 22:18:04 2020 New Revision: 366467 URL: https://svnweb.freebsd.org/changeset/base/366467 Log: cxgbe(4) sysctls do not need Giant. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Oct 5 20:57:44 2020 (r366466) +++ head/sys/dev/cxgbe/t4_main.c Mon Oct 5 22:18:04 2020 (r366467) @@ -6327,7 +6327,7 @@ t4_sysctls(struct adapter *sc) sc->params.nports, "# of ports"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "doorbells", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, doorbells, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, doorbells, (uintptr_t)&sc->doorbells, sysctl_bitfield_8b, "A", "available doorbells"); @@ -6335,12 +6335,12 @@ t4_sysctls(struct adapter *sc) sc->params.vpd.cclk, "core clock frequency (in KHz)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_timers", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc->params.sge.timer_val, sizeof(sc->params.sge.timer_val), sysctl_int_array, "A", "interrupt holdoff timer values (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_pkt_counts", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc->params.sge.counter_val, sizeof(sc->params.sge.counter_val), sysctl_int_array, "A", "interrupt holdoff packet counter values"); @@ -6400,7 +6400,7 @@ t4_sysctls(struct adapter *sc) #define SYSCTL_CAP(name, n, text) \ SYSCTL_ADD_PROC(ctx, children, OID_AUTO, #name, \ - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, caps_decoder[n], \ + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, caps_decoder[n], \ (uintptr_t)&sc->name, sysctl_bitfield_16b, "A", \ "available " text " capabilities") @@ -6419,27 +6419,27 @@ t4_sysctls(struct adapter *sc) NULL, sc->tids.nftids, "number of filters"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "temperature", - CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_temperature, "I", "chip temperature (in Celsius)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "reset_sensor", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, sysctl_reset_sensor, "I", "reset the chip's temperature sensor."); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "loadavg", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_loadavg, "A", "microprocessor load averages (debug firmwares only)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "core_vdd", - CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, sysctl_vdd, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_vdd, "I", "core Vdd (in mV)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "local_cpus", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, LOCAL_CPUS, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, LOCAL_CPUS, sysctl_cpus, "A", "local CPUs"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_cpus", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, INTR_CPUS, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, INTR_CPUS, sysctl_cpus, "A", "preferred CPUs for interrupts"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "swintr", CTLFLAG_RW, @@ -6454,175 +6454,175 @@ t4_sysctls(struct adapter *sc) children = SYSCTL_CHILDREN(oid); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cctrl", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_cctrl, "A", "congestion control"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_tp0", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_cim_ibq_obq, "A", "CIM IBQ 0 (TP0)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_tp1", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 1, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 1, sysctl_cim_ibq_obq, "A", "CIM IBQ 1 (TP1)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_ulp", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 2, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 2, sysctl_cim_ibq_obq, "A", "CIM IBQ 2 (ULP)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_sge0", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 3, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 3, sysctl_cim_ibq_obq, "A", "CIM IBQ 3 (SGE0)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_sge1", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 4, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 4, sysctl_cim_ibq_obq, "A", "CIM IBQ 4 (SGE1)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ibq_ncsi", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 5, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 5, sysctl_cim_ibq_obq, "A", "CIM IBQ 5 (NCSI)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_la", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_cim_la, "A", "CIM logic analyzer"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_ma_la", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_cim_ma_la, "A", "CIM MA logic analyzer"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_ulp0", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", "CIM OBQ 0 (ULP0)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_ulp1", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 1 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", "CIM OBQ 1 (ULP1)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_ulp2", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 2 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", "CIM OBQ 2 (ULP2)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_ulp3", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 3 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", "CIM OBQ 3 (ULP3)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_sge", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 4 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", "CIM OBQ 4 (SGE)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_ncsi", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 5 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", "CIM OBQ 5 (NCSI)"); if (chip_id(sc) > CHELSIO_T4) { SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_sge0_rx", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 6 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", "CIM OBQ 6 (SGE0-RX)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_obq_sge1_rx", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 7 + CIM_NUM_IBQ, sysctl_cim_ibq_obq, "A", "CIM OBQ 7 (SGE1-RX)"); } SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_pif_la", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_cim_pif_la, "A", "CIM PIF logic analyzer"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cim_qcfg", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_cim_qcfg, "A", "CIM queue configuration"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cpl_stats", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_cpl_stats, "A", "CPL statistics"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "ddp_stats", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_ddp_stats, "A", "non-TCP DDP statistics"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "devlog", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_devlog, "A", "firmware's device log"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "fcoe_stats", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_fcoe_stats, "A", "FCoE statistics"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "hw_sched", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_hw_sched, "A", "hardware scheduler "); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "l2t", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_l2t, "A", "hardware L2 table"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "smt", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_smt, "A", "hardware source MAC table"); #ifdef INET6 SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "clip", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_clip, "A", "active CLIP table entries"); #endif SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "lb_stats", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_lb_stats, "A", "loopback statistics"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "meminfo", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_meminfo, "A", "memory regions"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "mps_tcam", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, chip_id(sc) <= CHELSIO_T5 ? sysctl_mps_tcam : sysctl_mps_tcam_t6, "A", "MPS TCAM entries"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "path_mtus", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_path_mtus, "A", "path MTUs"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "pm_stats", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_pm_stats, "A", "PM statistics"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rdma_stats", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_rdma_stats, "A", "RDMA statistics"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tcp_stats", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_tcp_stats, "A", "TCP statistics"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tids", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_tids, "A", "TID information"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tp_err_stats", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_tp_err_stats, "A", "TP error statistics"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tp_la_mask", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, sysctl_tp_la_mask, "I", "TP logic analyzer event capture mask"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tp_la", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_tp_la, "A", "TP logic analyzer"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tx_rate", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_tx_rate, "A", "Tx rate"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "ulprx_la", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_ulprx_la, "A", "ULPRX logic analyzer"); if (chip_id(sc) >= CHELSIO_T5) { SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "wcwr_stats", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_wcwr_stats, "A", "write combined work requests"); } @@ -6679,11 +6679,11 @@ t4_sysctls(struct adapter *sc) sc->tt.tls = 0; SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tls", CTLTYPE_INT | - CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, sysctl_tls, "I", + CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, sysctl_tls, "I", "Inline TLS allowed"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tls_rx_ports", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, sysctl_tls_rx_ports, "I", "TCP ports that use inline TLS+TOE RX"); @@ -6708,72 +6708,72 @@ t4_sysctls(struct adapter *sc) "autorcvbuf increment"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "timer_tick", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_tp_tick, "A", "TP timer tick (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "timestamp_tick", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 1, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 1, sysctl_tp_tick, "A", "TCP timestamp tick (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "dack_tick", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 2, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 2, sysctl_tp_tick, "A", "DACK tick (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "dack_timer", - CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_tp_dack_timer, "IU", "DACK timer (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rexmt_min", - CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, A_TP_RXT_MIN, sysctl_tp_timer, "LU", "Minimum retransmit interval (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rexmt_max", - CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, A_TP_RXT_MAX, sysctl_tp_timer, "LU", "Maximum retransmit interval (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "persist_min", - CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, A_TP_PERS_MIN, sysctl_tp_timer, "LU", "Persist timer min (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "persist_max", - CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, A_TP_PERS_MAX, sysctl_tp_timer, "LU", "Persist timer max (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "keepalive_idle", - CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, A_TP_KEEP_IDLE, sysctl_tp_timer, "LU", "Keepalive idle timer (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "keepalive_interval", - CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, A_TP_KEEP_INTVL, sysctl_tp_timer, "LU", "Keepalive interval timer (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "initial_srtt", - CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, A_TP_INIT_SRTT, sysctl_tp_timer, "LU", "Initial SRTT (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "finwait2_timer", - CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_ULONG | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, A_TP_FINWAIT2_TIMER, sysctl_tp_timer, "LU", "FINWAIT2 timer (us)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "syn_rexmt_count", - CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, S_SYNSHIFTMAX, sysctl_tp_shift_cnt, "IU", "Number of SYN retransmissions before abort"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rexmt_count", - CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, S_RXTSHIFTMAXR2, sysctl_tp_shift_cnt, "IU", "Number of retransmissions before abort"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "keepalive_count", - CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, S_KEEPALIVEMAXR2, sysctl_tp_shift_cnt, "IU", "Number of keepalive probes before abort"); @@ -6784,7 +6784,7 @@ t4_sysctls(struct adapter *sc) for (i = 0; i < 16; i++) { snprintf(s, sizeof(s), "%u", i); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, s, - CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, i, sysctl_tp_backoff, "IU", "TOE retransmit backoff"); } @@ -6824,7 +6824,7 @@ vi_sysctls(struct vi_info *vi) if (IS_MAIN_VI(vi)) { SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rsrv_noflowq", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, vi, 0, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, vi, 0, sysctl_noflowq, "IU", "Reserve queue 0 for non-flowid packets"); } @@ -6835,7 +6835,7 @@ vi_sysctls(struct vi_info *vi) NULL, 1, "use VM work requests for transmit"); } else { SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tx_vm_wr", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, vi, 0, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, vi, 0, sysctl_tx_vm_wr, "I", "use VM work requestes for transmit"); } @@ -6848,11 +6848,11 @@ vi_sysctls(struct vi_info *vi) CTLFLAG_RD, &vi->first_ofld_rxq, 0, "index of first TOE rx queue"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_tmr_idx_ofld", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, vi, 0, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, vi, 0, sysctl_holdoff_tmr_idx_ofld, "I", "holdoff timer index for TOE queues"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_pktc_idx_ofld", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, vi, 0, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, vi, 0, sysctl_holdoff_pktc_idx_ofld, "I", "holdoff packet counter index for TOE queues"); } @@ -6883,17 +6883,17 @@ vi_sysctls(struct vi_info *vi) #endif SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_tmr_idx", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, vi, 0, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, vi, 0, sysctl_holdoff_tmr_idx, "I", "holdoff timer index"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_pktc_idx", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, vi, 0, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, vi, 0, sysctl_holdoff_pktc_idx, "I", "holdoff packet counter index"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "qsize_rxq", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, vi, 0, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, vi, 0, sysctl_qsize_rxq, "I", "rx queue size"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "qsize_txq", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, vi, 0, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, vi, 0, sysctl_qsize_txq, "I", "tx queue size"); } @@ -6917,30 +6917,30 @@ cxgbe_sysctls(struct port_info *pi) children = SYSCTL_CHILDREN(oid); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "linkdnrc", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, pi, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, pi, 0, sysctl_linkdnrc, "A", "reason why link is down"); if (pi->port_type == FW_PORT_TYPE_BT_XAUI) { SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "temperature", - CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, pi, 0, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, pi, 0, sysctl_btphy, "I", "PHY temperature (in Celsius)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "fw_version", - CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, pi, 1, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, pi, 1, sysctl_btphy, "I", "PHY firmware version"); } SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "pause_settings", - CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, pi, 0, + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, pi, 0, sysctl_pause_settings, "A", "PAUSE settings (bit 0 = rx_pause, 1 = tx_pause, 2 = pause_autoneg)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "fec", - CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_NEEDGIANT, pi, 0, + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, pi, 0, sysctl_fec, "A", "FECs to use (bit 0 = RS, 1 = FC, 2 = none, 5 = auto, 6 = module)"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "module_fec", - CTLTYPE_STRING | CTLFLAG_NEEDGIANT, pi, 0, sysctl_module_fec, "A", + CTLTYPE_STRING | CTLFLAG_MPSAFE, pi, 0, sysctl_module_fec, "A", "FEC recommended by the cable/transceiver"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "autoneg", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, pi, 0, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, pi, 0, sysctl_autoneg, "I", "autonegotiation (-1 = not supported)"); @@ -6982,12 +6982,12 @@ cxgbe_sysctls(struct port_info *pi) SYSCTL_CHILDREN(oid), OID_AUTO, name, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "traffic class")); SYSCTL_ADD_PROC(ctx, children2, OID_AUTO, "flags", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, tc_flags, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, tc_flags, (uintptr_t)&tc->flags, sysctl_bitfield_8b, "A", "flags"); SYSCTL_ADD_UINT(ctx, children2, OID_AUTO, "refcount", CTLFLAG_RD, &tc->refcount, 0, "references to this class"); SYSCTL_ADD_PROC(ctx, children2, OID_AUTO, "params", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, (pi->port_id << 16) | i, sysctl_tc_params, "A", "traffic class parameters"); } @@ -7004,7 +7004,7 @@ cxgbe_sysctls(struct port_info *pi) #define SYSCTL_ADD_T4_REG64(pi, name, desc, reg) \ SYSCTL_ADD_OID(ctx, children, OID_AUTO, name, \ - CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, reg, \ + CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, reg, \ sysctl_handle_t4_reg64, "QU", desc) SYSCTL_ADD_T4_REG64(pi, "tx_octets", "# of octets in good frames", Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Oct 5 20:57:44 2020 (r366466) +++ head/sys/dev/cxgbe/t4_sge.c Mon Oct 5 22:18:04 2020 (r366467) @@ -963,7 +963,7 @@ t4_sge_sysctls(struct adapter *sc, struct sysctl_ctx_l struct sge_params *sp = &sc->params.sge; SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "buffer_sizes", - CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, sysctl_bufsizes, "A", "freelist buffer sizes"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "fl_pktshift", CTLFLAG_RD, @@ -3698,13 +3698,13 @@ add_iq_sysctls(struct sysctl_ctx_list *ctx, struct sys SYSCTL_ADD_INT(ctx, children, OID_AUTO, "dmalen", CTLFLAG_RD, NULL, iq->qsize * IQ_ESIZE, "descriptor ring size in bytes"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "abs_id", - CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &iq->abs_id, 0, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, &iq->abs_id, 0, sysctl_uint16, "I", "absolute id of the queue"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cntxt_id", - CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &iq->cntxt_id, 0, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, &iq->cntxt_id, 0, sysctl_uint16, "I", "SGE context id of the queue"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cidx", - CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &iq->cidx, 0, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, &iq->cidx, 0, sysctl_uint16, "I", "consumer index"); } @@ -3724,7 +3724,7 @@ add_fl_sysctls(struct adapter *sc, struct sysctl_ctx_l fl->sidx * EQ_ESIZE + sc->params.sge.spg_len, "desc ring size in bytes"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cntxt_id", - CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &fl->cntxt_id, 0, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, &fl->cntxt_id, 0, sysctl_uint16, "I", "SGE context id of the freelist"); SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "padding", CTLFLAG_RD, NULL, fl_pad ? 1 : 0, "padding enabled"); @@ -3988,13 +3988,13 @@ alloc_nm_rxq(struct vi_info *vi, struct sge_nm_rxq *nm children = SYSCTL_CHILDREN(oid); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "abs_id", - CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &nm_rxq->iq_abs_id, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, &nm_rxq->iq_abs_id, 0, sysctl_uint16, "I", "absolute id of the queue"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cntxt_id", - CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &nm_rxq->iq_cntxt_id, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, &nm_rxq->iq_cntxt_id, 0, sysctl_uint16, "I", "SGE context id of the queue"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cidx", - CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &nm_rxq->iq_cidx, 0, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, &nm_rxq->iq_cidx, 0, sysctl_uint16, "I", "consumer index"); children = SYSCTL_CHILDREN(oid); @@ -4003,7 +4003,7 @@ alloc_nm_rxq(struct vi_info *vi, struct sge_nm_rxq *nm children = SYSCTL_CHILDREN(oid); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cntxt_id", - CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &nm_rxq->fl_cntxt_id, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, &nm_rxq->fl_cntxt_id, 0, sysctl_uint16, "I", "SGE context id of the freelist"); SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "cidx", CTLFLAG_RD, &nm_rxq->fl_cidx, 0, "consumer index"); @@ -4071,10 +4071,10 @@ alloc_nm_txq(struct vi_info *vi, struct sge_nm_txq *nm SYSCTL_ADD_UINT(&vi->ctx, children, OID_AUTO, "cntxt_id", CTLFLAG_RD, &nm_txq->cntxt_id, 0, "SGE context id of the queue"); SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "cidx", - CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &nm_txq->cidx, 0, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, &nm_txq->cidx, 0, sysctl_uint16, "I", "consumer index"); SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "pidx", - CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &nm_txq->pidx, 0, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, &nm_txq->pidx, 0, sysctl_uint16, "I", "producer index"); return (rc); @@ -4392,10 +4392,10 @@ alloc_wrq(struct adapter *sc, struct vi_info *vi, stru SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "cntxt_id", CTLFLAG_RD, &wrq->eq.cntxt_id, 0, "SGE context id of the queue"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cidx", - CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &wrq->eq.cidx, 0, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, &wrq->eq.cidx, 0, sysctl_uint16, "I", "consumer index"); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "pidx", - CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &wrq->eq.pidx, 0, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, &wrq->eq.pidx, 0, sysctl_uint16, "I", "producer index"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "sidx", CTLFLAG_RD, NULL, wrq->eq.sidx, "status page index"); @@ -4495,16 +4495,16 @@ alloc_txq(struct vi_info *vi, struct sge_txq *txq, int SYSCTL_ADD_UINT(&vi->ctx, children, OID_AUTO, "cntxt_id", CTLFLAG_RD, &eq->cntxt_id, 0, "SGE context id of the queue"); SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "cidx", - CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &eq->cidx, 0, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, &eq->cidx, 0, sysctl_uint16, "I", "consumer index"); SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "pidx", - CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, &eq->pidx, 0, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, &eq->pidx, 0, sysctl_uint16, "I", "producer index"); SYSCTL_ADD_INT(&vi->ctx, children, OID_AUTO, "sidx", CTLFLAG_RD, NULL, eq->sidx, "status page index"); SYSCTL_ADD_PROC(&vi->ctx, children, OID_AUTO, "tc", - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, vi, idx, sysctl_tc, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, vi, idx, sysctl_tc, "I", "traffic class (-1 means none)"); SYSCTL_ADD_UQUAD(&vi->ctx, children, OID_AUTO, "txcsum", CTLFLAG_RD, From owner-svn-src-head@freebsd.org Tue Oct 6 01:33: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 5884D436084; Tue, 6 Oct 2020 01:33:57 +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 4C50P11hQdz3VZF; Tue, 6 Oct 2020 01:33:57 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (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 1940325F08; Tue, 6 Oct 2020 01:33:57 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f175.google.com with SMTP id r8so11627865qtp.13; Mon, 05 Oct 2020 18:33:57 -0700 (PDT) X-Gm-Message-State: AOAM530uEBjYUF3S0fkE9yPdaKB6EDFYW3kvDtsg5SvaunaFfoWQgPEm F4SpMNeYZ1usK+s/zdK1/HSpZY5DqMEZZg/6ECY= X-Google-Smtp-Source: ABdhPJxw5blr3hrnRTjn4glTwiDzAZGPQ3rmdm+zhA2+XK8CqLAfwCtBWzbWUnnI2I8I9mD2xy35rpeyOyK0THbdvzI= X-Received: by 2002:ac8:a0e:: with SMTP id b14mr307900qti.242.1601948036524; Mon, 05 Oct 2020 18:33:56 -0700 (PDT) MIME-Version: 1.0 References: <202010052057.095Kvi7e098469@repo.freebsd.org> <20201005213914.GA28182@FreeBSD.org> In-Reply-To: <20201005213914.GA28182@FreeBSD.org> From: Kyle Evans Date: Mon, 5 Oct 2020 20:33:45 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366466 - head/usr.sbin/crunch/crunchgen To: Alexey Dokuchaev Cc: src-committers , svn-src-all , svn-src-head , Alex Richardson 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, 06 Oct 2020 01:33:57 -0000 On Mon, Oct 5, 2020 at 4:39 PM Alexey Dokuchaev wrote: > > On Mon, Oct 05, 2020 at 08:57:44PM +0000, Kyle Evans wrote: > > New Revision: 366466 > > URL: https://svnweb.freebsd.org/changeset/base/366466 > > > > Log: > > crunchgen: fix MK_AUTO_OBJ logic after r364166 > > > > r364166 converted echo -n `/bin/pwd` to a raw pwd invocation, leaving a > > trailing newline at the end of path. This caused a later stat() of it to > > erroneously fail and the fallback to MK_AUTO_OBJ=no logic proceeded as > > unexpected. > > [...] > @@ -648,8 +653,7 @@ > > /* Determine the actual srcdir (maybe symlinked). */ > if (p->srcdir) { > - snprintf(line, MAXLINELEN, "cd %s && echo -n `/bin/pwd`", > - p->srcdir); > + snprintf(line, MAXLINELEN, "cd %s && pwd", p->srcdir); > f = popen(line,"r"); > > Calling popen("cd somedir && pwd") in a C program to resolve symlinks, > seriously? Why not simply call realpath(3) instead? :-/ > Excellent question. :-) CC'ing Alex, because he might have looked at this more in-depth. I don't see any real reason for the status quo vs. realpath(3) off the top of my head, but I'm not familiar with the history and don't quite have the time to track down the ramifications of the change. Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Tue Oct 6 02:03: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 46C8843771F; Tue, 6 Oct 2020 02:03:35 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C513B3k3Tz3Xb5; Tue, 6 Oct 2020 02:03:34 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 814E85C013F; Mon, 5 Oct 2020 22:03:33 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 05 Oct 2020 22:03:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm1; bh=E GeGg5fc8OsZ4dyBbdi7m4txftTtZk/zOoQB0+dnL3g=; b=xim1MKt4hs9t0aQko hPcS026qTmQBnlGaRPx95kBasjzDXVVX7c3TFUIvFDQu+w5YepgZcm4LnjNnGU5+ S537SLQOYk+FMah+RtQzZtYUBrw56f5n18Mg6Y9LEvLGibA7uui6tFFKpIj5aoBN 2SokCAQAusl51uywuxfcq8f4qPXWoTsP++zd5DfHPdTWRmGg/2gOCv7sGc5x47zO fCRQM56mzBEvXLmK1JfUJlVSycHnQubEP+KLQZpWXgm/fE6QG8ozqEglNkaOA5GM rz3lLHjOF7VpbUmo8DZ+ioV/rdn7x9vllA+QDXaU9CvvDGmvdVeb5X4aa5y7PsHK WARNQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=EGeGg5fc8OsZ4dyBbdi7m4txftTtZk/zOoQB0+dnL 3g=; b=gQ+qVyuwZwX5uAn1d8O2ZR6+wBAhZhmscZV75p6TQjGLZY4YXY1M0oBeY 1agm7naNHOHQaZACtBO8OJE2HaWuXfCa/epPEbr7a/EbfJpyE8EpIQ+91SewLlMk vbCuZJGSrOBAmf2GJiaEpCSZFjFqKz8qiExh7JOiweJyK/hpbUXbhJlV4fhDDMOJ YyskS4bgm3dCQfKQICnsnMjjaQ3y1fFphvPEYMNZIr+C68fM1z9viURAmpCNXd9C +9IvxF33NULkzyPgqzigAhc69TJwbZffTZ8RhJHDjaI0fHQU9fQb9WWqBzQr6wNr Ddfly6ki0VhXK74RbrVRHrZ6cBytA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrgeefgdehgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpegtggfuhfgjfffgkfhfvffosehtqhhmtdhhtdejnecuhfhrohhmpefutghothht ucfnohhnghcuoehstghothhtlhesshgrmhhstghordhorhhgqeenucggtffrrghtthgvrh hnpeefjeeggfejhffgtdejveejkeegveeileeuheejgfduteevgfdttefggfeggfdvgeen ucfkphepkedrgeeirdekledrvddufeenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehstghothhtlhesshgrmhhstghordhorhhg X-ME-Proxy: Received: from [192.168.0.114] (unknown [8.46.89.213]) by mail.messagingengine.com (Postfix) with ESMTPA id 979113064680; Mon, 5 Oct 2020 22:03:32 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: svn commit: r366429 - in head/sys: kern sys From: Scott Long In-Reply-To: Date: Mon, 5 Oct 2020 20:03:31 -0600 Cc: Konstantin Belousov , Rick Macklem , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <33690A29-E145-44B7-AA9B-5FDE05F5C459@samsco.org> References: <202010041633.094GXg4l044462@repo.freebsd.org> <20201005011833.GI2643@kib.kiev.ua> To: Mateusz Guzik X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Rspamd-Queue-Id: 4C513B3k3Tz3Xb5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=samsco.org header.s=fm1 header.b=xim1MKt4; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=gQ+qVyuw; dmarc=none; spf=pass (mx1.freebsd.org: domain of scottl@samsco.org designates 66.111.4.26 as permitted sender) smtp.mailfrom=scottl@samsco.org X-Spamd-Result: default: False [-2.76 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:66.111.4.26]; RWL_MAILSPIKE_GOOD(0.00)[66.111.4.26:from]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[samsco.org:+,messagingengine.com:+]; NEURAL_HAM_SHORT(-0.61)[-0.611]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[66.111.4.26:from]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.004]; R_DKIM_ALLOW(-0.20)[samsco.org:s=fm1,messagingengine.com:s=fm1]; FREEFALL_USER(0.00)[scottl]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.04)[-1.043]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[samsco.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,uoguelph.ca,freebsd.org]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] 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, 06 Oct 2020 02:03:35 -0000 > On Oct 5, 2020, at 1:35 PM, Mateusz Guzik wrote: >=20 > On 10/5/20, Konstantin Belousov wrote: >> On Sun, Oct 04, 2020 at 09:06:02PM +0000, Rick Macklem wrote: >>> Mateusz Guzik wrote: >>>> Why is the process lock always taken? It looks like both routines = just >>>> check a thread-local flag, so perhaps this can get away without >>>> serializing this process-wide? >>> I did spot this slight difference between the initial version of >>> sig_intr() and >>> this one. At least w.r.t. copy_file_range(2), the call happens >>> infrequently >>> enough that the overhead of acquiring the lock is not significant. >>>=20 >> Yes, the function should not be on any frequent path. >>=20 >> That said, all signal delivery to process is covered by the process = lock, >> so checks under process lock make the advisory answer provide less = false >> negatives. If considered too importand in some cases (when ?), the >> following >> patch can be applied. >>=20 >> diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c >> index 8108d4cb3a5..ed4dd52b66d 100644 >> --- a/sys/kern/kern_sig.c >> +++ b/sys/kern/kern_sig.c >> @@ -3212,6 +3212,9 @@ sig_intr(void) >> int ret; >>=20 >> td =3D curthread; >> + if ((td->td_flags & (TDF_NEEDSIGCHK | TDF_NEEDSUSPCHK)) =3D=3D = 0) >> + return (0); >> + >> p =3D td->td_proc; >>=20 >> PROC_LOCK(p); >>=20 >=20 > I presume copy_file_range will not be the only consumer going forward. >=20 > The default for all new code should be to avoid locks or other atomics > if it can be helped, otherwise it's just never ending whack-a-mole and > this is bound to become a bottleneck at some point. >=20 > So happens process lock is already quite contended (e.g., when running > poudriere) and adding to it is the wrong way to go. >=20 > --=20 >=20 Agreed. After all of the work that=E2=80=99s been done in the last 20 = years to make SMP work well on FreeBSD, I=E2=80=99m not sure why it=E2=80=99s ok to = wave ones hand and say that serializing locks are still ok, or that they don=E2=80=99t = matter. The bias needs to be against adding more serialization points, even if it=E2=80=99s not = convenient. Scott From owner-svn-src-head@freebsd.org Tue Oct 6 02: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 773E93F8E35; Tue, 6 Oct 2020 02:57:38 +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 4C52FZ2XtVz3b0r; Tue, 6 Oct 2020 02:57:38 +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 3B09120101; Tue, 6 Oct 2020 02:57:38 +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 0962vc1u019503; Tue, 6 Oct 2020 02:57:38 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0962vcxS019502; Tue, 6 Oct 2020 02:57:38 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010060257.0962vcxS019502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 6 Oct 2020 02:57:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366468 - head/lib/libkvm X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/lib/libkvm X-SVN-Commit-Revision: 366468 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, 06 Oct 2020 02:57:38 -0000 Author: mjg Date: Tue Oct 6 02:57:37 2020 New Revision: 366468 URL: https://svnweb.freebsd.org/changeset/base/366468 Log: libkvm: catch up with pre-subtracated per-cpu addresses Only concerns amd64. Reported by: imp Modified: head/lib/libkvm/kvm_pcpu.c Modified: head/lib/libkvm/kvm_pcpu.c ============================================================================== --- head/lib/libkvm/kvm_pcpu.c Mon Oct 5 22:18:04 2020 (r366467) +++ head/lib/libkvm/kvm_pcpu.c Tue Oct 6 02:57:37 2020 (r366468) @@ -50,15 +50,23 @@ __FBSDID("$FreeBSD$"); #include "kvm_private.h" +#ifdef __amd64__ +#define __OFFSET_BY_PCPU +#endif + static struct nlist kvm_pcpu_nl[] = { { .n_name = "_cpuid_to_pcpu" }, { .n_name = "_mp_maxcpus" }, { .n_name = "_mp_ncpus" }, +#ifdef __OFFSET_BY_PCPU + { .n_name = "___pcpu" }, +#endif { .n_name = NULL }, }; #define NL_CPUID_TO_PCPU 0 #define NL_MP_MAXCPUS 1 #define NL_MP_NCPUS 2 +#define NL___PCPU 3 /* * Kernel per-CPU data state. We cache this stuff on the first @@ -71,6 +79,9 @@ static struct nlist kvm_pcpu_nl[] = { static void **pcpu_data; static int maxcpu; static int mp_ncpus; +#ifdef __OFFSET_BY_PCPU +static unsigned long __pcpu; +#endif static int _kvm_pcpu_init(kvm_t *kd) @@ -103,6 +114,17 @@ _kvm_pcpu_init(kvm_t *kd) _kvm_err(kd, kd->program, "cannot read mp_ncpus"); return (-1); } +#ifdef __OFFSET_BY_PCPU + if (kvm_pcpu_nl[NL___PCPU].n_value == 0) { + _kvm_err(kd, kd->program, "unable to find __pcpu"); + return (-1); + } + if (kvm_read(kd, kvm_pcpu_nl[NL___PCPU].n_value, &__pcpu, + sizeof(__pcpu)) != sizeof(__pcpu)) { + _kvm_err(kd, kd->program, "cannot read __pcpu"); + return (-1); + } +#endif len = max * sizeof(void *); data = malloc(len); if (data == NULL) { @@ -329,6 +351,13 @@ kvm_read_zpcpu(kvm_t *kd, u_long base, void *buf, size if (!kvm_native(kd)) return (-1); + if (mp_ncpus == 0) + if (_kvm_pcpu_init(kd) < 0) + return (0); + +#ifdef __OFFSET_BY_PCPU + base += __pcpu; +#endif return (kvm_read(kd, (uintptr_t)(base + sizeof(struct pcpu) * cpu), buf, size)); } From owner-svn-src-head@freebsd.org Tue Oct 6 04:18: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 D23E93F9D4A; Tue, 6 Oct 2020 04:18:42 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C543652dfz3dck; Tue, 6 Oct 2020 04:18:42 +0000 (UTC) (envelope-from lwhsu@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 918FC20C4B; Tue, 6 Oct 2020 04:18:42 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0964Ig0A069296; Tue, 6 Oct 2020 04:18:42 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0964Igjq069295; Tue, 6 Oct 2020 04:18:42 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202010060418.0964Igjq069295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 6 Oct 2020 04:18:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366469 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 366469 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, 06 Oct 2020 04:18:42 -0000 Author: lwhsu Date: Tue Oct 6 04:18:42 2020 New Revision: 366469 URL: https://svnweb.freebsd.org/changeset/base/366469 Log: Clear the dmesg buffer to prevent rotating causes issues This is a workaround for the current continuously failing test case sys.kern.sonewconn_overflow.sonewconn_overflow_01 The side effect is the dmesg buffer got cleared and may effect other tests depends on dmesg output running in parallel. The better solution would be tailing the log file like /var/log/debug.log Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/kern/sonewconn_overflow.py Modified: head/tests/sys/kern/sonewconn_overflow.py ============================================================================== --- head/tests/sys/kern/sonewconn_overflow.py Tue Oct 6 02:57:37 2020 (r366468) +++ head/tests/sys/kern/sonewconn_overflow.py Tue Oct 6 04:18:42 2020 (r366469) @@ -85,6 +85,8 @@ class UnixTest(GenericTest): class LogChecker(): def __init__(self): + # Clear the dmesg buffer to prevent rotating causes issues + os.system('/sbin/dmesg -c > /dev/null') # Figure out how big the dmesg buffer is. self.dmesgOff = len(check_output("/sbin/dmesg")) From owner-svn-src-head@freebsd.org Tue Oct 6 06:45: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 946C142A704; Tue, 6 Oct 2020 06:45:53 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C57Jx3JQxz43M0; Tue, 6 Oct 2020 06:45:53 +0000 (UTC) (envelope-from lwhsu@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 5050D22368; Tue, 6 Oct 2020 06:45:53 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0966jrMR061208; Tue, 6 Oct 2020 06:45:53 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0966jqaO061204; Tue, 6 Oct 2020 06:45:52 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202010060645.0966jqaO061204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 6 Oct 2020 06:45:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366470 - in head: share/mk tests/sys/capsicum X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: in head: share/mk tests/sys/capsicum X-SVN-Commit-Revision: 366470 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, 06 Oct 2020 06:45:53 -0000 Author: lwhsu Date: Tue Oct 6 06:45:52 2020 New Revision: 366470 URL: https://svnweb.freebsd.org/changeset/base/366470 Log: Make capsicum test cases fine-grained Add a wrapping script to use ATF to run tests written with Googletest one by one. This helps locating and tracking the failing case in CI easier. This is a temporarily solution while Googletest support in Kyua is developing. We will revert this once Kyua+Googletest integration is ready. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25896 Added: head/tests/sys/capsicum/functional.sh (contents, props changed) Modified: head/share/mk/bsd.test.mk head/share/mk/googletest.test.mk head/tests/sys/capsicum/Makefile Modified: head/share/mk/bsd.test.mk ============================================================================== --- head/share/mk/bsd.test.mk Tue Oct 6 04:18:42 2020 (r366469) +++ head/share/mk/bsd.test.mk Tue Oct 6 06:45:52 2020 (r366470) @@ -62,10 +62,11 @@ TESTS_ENV+= LD_LIBRARY_PATH=${TESTS_LD_LIBRARY_PATH:tW _TESTS= # Pull in the definitions of all supported test interfaces. -.include .include .include .include +# Include atf last to let other test framework use it +.include # Sort the tests alphabetically, so the results are deterministically formed # across runs. Modified: head/share/mk/googletest.test.mk ============================================================================== --- head/share/mk/googletest.test.mk Tue Oct 6 04:18:42 2020 (r366469) +++ head/share/mk/googletest.test.mk Tue Oct 6 06:45:52 2020 (r366470) @@ -30,12 +30,18 @@ GTESTS?= .include PROGS_CXX+= ${GTESTS} -_TESTS+= ${GTESTS} .for _T in ${GTESTS} BINDIR.${_T}= ${TESTSDIR} CXXFLAGS.${_T}+= ${GTESTS_CXXFLAGS} MAN.${_T}?= # empty SRCS.${_T}?= ${_T}.cc +.if !empty(GTESTS_WRAPPER_SH.${_T}) +# A stopgap/workaround to let kyua execute test case one by one +ATF_TESTS_SH+= ${GTESTS_WRAPPER_SH.${_T}} +.else +_TESTS+= ${_T} TEST_INTERFACE.${_T}= plain +.endif + .endfor .endif Modified: head/tests/sys/capsicum/Makefile ============================================================================== --- head/tests/sys/capsicum/Makefile Tue Oct 6 04:18:42 2020 (r366469) +++ head/tests/sys/capsicum/Makefile Tue Oct 6 06:45:52 2020 (r366470) @@ -14,6 +14,7 @@ CFLAGS+= -I${SRCTOP}/tests .PATH: ${SRCTOP}/contrib/capsicum-test GTESTS+= capsicum-test +GTESTS_WRAPPER_SH.capsicum-test= functional SRCS.capsicum-test+= \ capsicum-test-main.cc \ @@ -50,6 +51,6 @@ BINMODE.mini-me.setuid= 4555 WARNS.capsicum-test= 3 -.endif +.endif # MK_GOOGLETEST .include Added: head/tests/sys/capsicum/functional.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/capsicum/functional.sh Tue Oct 6 06:45:52 2020 (r366470) @@ -0,0 +1,68 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2020 The FreeBSD Foundation +# +# This software was developed by Li-Wen Hsu +# under sponsorship from the FreeBSD Foundation. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +SRCDIR=$(atf_get_srcdir) +CAPSICUM_TEST_BIN=capsicum-test + +check() +{ + local tc=${1} + + atf_check -s exit:0 -o match:PASSED -e ignore \ + ${SRCDIR}/${CAPSICUM_TEST_BIN} --gtest_filter=${tc} +} + +add_testcase() +{ + local tc=${1} + local tc_escaped word + + tc_escaped=$(echo ${tc} | sed -e 's/\./__/') + + atf_test_case ${tc_escaped} + eval "${tc_escaped}_body() { check ${tc}; }" + atf_add_test_case ${tc_escaped} +} + +list_tests() +{ + ${SRCDIR}/${CAPSICUM_TEST_BIN} --gtest_list_tests | awk ' + /^[^ ]/ { CAT=$0 } + /^[ ]/ { print CAT $1}' +} + +atf_init_test_cases() +{ + local t + for t in `list_tests`; do + add_testcase $t + done +} From owner-svn-src-head@freebsd.org Tue Oct 6 08:05: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 7F8BB42B751; Tue, 6 Oct 2020 08:05:20 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C594c2rplz46g3; Tue, 6 Oct 2020 08:05:20 +0000 (UTC) (envelope-from bapt@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 41C7A23A8C; Tue, 6 Oct 2020 08:05:20 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09685K5m009788; Tue, 6 Oct 2020 08:05:20 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09685J6l009787; Tue, 6 Oct 2020 08:05:19 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202010060805.09685J6l009787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 6 Oct 2020 08:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366471 - head/usr.bin/backlight X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/backlight X-SVN-Commit-Revision: 366471 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, 06 Oct 2020 08:05:20 -0000 Author: bapt Date: Tue Oct 6 08:05:19 2020 New Revision: 366471 URL: https://svnweb.freebsd.org/changeset/base/366471 Log: backlight: accept '%' in the brightness input value Improve friendlyness of the command line by accepting the percent brightness in both format: with or without a trailing '%' Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D26692 Modified: head/usr.bin/backlight/backlight.8 head/usr.bin/backlight/backlight.c Modified: head/usr.bin/backlight/backlight.8 ============================================================================== --- head/usr.bin/backlight/backlight.8 Tue Oct 6 06:45:52 2020 (r366470) +++ head/usr.bin/backlight/backlight.8 Tue Oct 6 08:05:19 2020 (r366471) @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 02, 2020 +.Dd October 06, 2020 .Dt BACKLIGHT 8 .Os .Sh NAME @@ -63,6 +63,7 @@ When querying the brightness level only print the valu Query information about the backlight (name, type). .It Ar value Set the brightness level to this value, must be between 0 and 100. +A trailing '%' is valid. .It Ar incr | + .Op Ar value Decrement the backlight level. Modified: head/usr.bin/backlight/backlight.c ============================================================================== --- head/usr.bin/backlight/backlight.c Tue Oct 6 06:45:52 2020 (r366470) +++ head/usr.bin/backlight/backlight.c Tue Oct 6 08:05:19 2020 (r366471) @@ -144,6 +144,9 @@ main(int argc, char *argv[]) action = BACKLIGHT_SET_BRIGHTNESS; if (argc == 1) { + /* ignore a trailing % for user friendlyness */ + if (argv[0][strlen(argv[0]) - 1] == '%') + argv[0][strlen(argv[0]) - 1] = '\0'; percent = strtonum(argv[0], 0, 100, &percent_error); if (percent_error) errx(1, "Cannot parse brightness level %s: %s", From owner-svn-src-head@freebsd.org Tue Oct 6 08:06: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 1626042C039; Tue, 6 Oct 2020 08:06:57 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C596S574Bz46wj; Tue, 6 Oct 2020 08:06:56 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (120.89-11-192.nextgentel.com [89.11.192.120]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 7AD082602B9; Tue, 6 Oct 2020 10:06:48 +0200 (CEST) Subject: Re: svn commit: r366471 - head/usr.bin/backlight To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202010060805.09685J6l009787@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Tue, 6 Oct 2020 10:06:13 +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: <202010060805.09685J6l009787@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4C596S574Bz46wj 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:24940, ipnet:2a01:4f8::/29, country: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: Tue, 06 Oct 2020 08:06:57 -0000 On 2020-10-06 10:05, Baptiste Daroussin wrote: > Author: bapt > Date: Tue Oct 6 08:05:19 2020 > New Revision: 366471 > URL: https://svnweb.freebsd.org/changeset/base/366471 > > Log: > backlight: accept '%' in the brightness input value > > Improve friendlyness of the command line by accepting the percent brightness > in both format: with or without a trailing '%' > > Reviewed by: manu > Differential Revision: https://reviews.freebsd.org/D26692 > > Modified: > head/usr.bin/backlight/backlight.8 > head/usr.bin/backlight/backlight.c > > Modified: head/usr.bin/backlight/backlight.8 > ============================================================================== > --- head/usr.bin/backlight/backlight.8 Tue Oct 6 06:45:52 2020 (r366470) > +++ head/usr.bin/backlight/backlight.8 Tue Oct 6 08:05:19 2020 (r366471) > @@ -22,7 +22,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd October 02, 2020 > +.Dd October 06, 2020 > .Dt BACKLIGHT 8 > .Os > .Sh NAME > @@ -63,6 +63,7 @@ When querying the brightness level only print the valu > Query information about the backlight (name, type). > .It Ar value > Set the brightness level to this value, must be between 0 and 100. > +A trailing '%' is valid. > .It Ar incr | + > .Op Ar value > Decrement the backlight level. > > Modified: head/usr.bin/backlight/backlight.c > ============================================================================== > --- head/usr.bin/backlight/backlight.c Tue Oct 6 06:45:52 2020 (r366470) > +++ head/usr.bin/backlight/backlight.c Tue Oct 6 08:05:19 2020 (r366471) > @@ -144,6 +144,9 @@ main(int argc, char *argv[]) > action = BACKLIGHT_SET_BRIGHTNESS; > > if (argc == 1) { > + /* ignore a trailing % for user friendlyness */ > + if (argv[0][strlen(argv[0]) - 1] == '%') > + argv[0][strlen(argv[0]) - 1] = '\0'; > percent = strtonum(argv[0], 0, 100, &percent_error); > if (percent_error) > errx(1, "Cannot parse brightness level %s: %s", > Should there be a check here that strlen(xxx) > 0 ? --HPS From owner-svn-src-head@freebsd.org Tue Oct 6 08:18: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 8F4B942C588; Tue, 6 Oct 2020 08:18:10 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C59MQ372Gz47fr; Tue, 6 Oct 2020 08:18:10 +0000 (UTC) (envelope-from bapt@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 49C8C238D6; Tue, 6 Oct 2020 08:18:10 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0968IANS016329; Tue, 6 Oct 2020 08:18:10 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0968IABV016328; Tue, 6 Oct 2020 08:18:10 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202010060818.0968IABV016328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 6 Oct 2020 08:18:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366472 - head/usr.bin/backlight X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/backlight X-SVN-Commit-Revision: 366472 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, 06 Oct 2020 08:18:10 -0000 Author: bapt Date: Tue Oct 6 08:18:09 2020 New Revision: 366472 URL: https://svnweb.freebsd.org/changeset/base/366472 Log: backlight: check the lenght if the input before trimming '%' Reported by: hps Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D26693 Modified: head/usr.bin/backlight/backlight.c Modified: head/usr.bin/backlight/backlight.c ============================================================================== --- head/usr.bin/backlight/backlight.c Tue Oct 6 08:05:19 2020 (r366471) +++ head/usr.bin/backlight/backlight.c Tue Oct 6 08:18:09 2020 (r366472) @@ -145,7 +145,8 @@ main(int argc, char *argv[]) if (argc == 1) { /* ignore a trailing % for user friendlyness */ - if (argv[0][strlen(argv[0]) - 1] == '%') + if (strlen(argv[0]) > 0 && + argv[0][strlen(argv[0]) - 1] == '%') argv[0][strlen(argv[0]) - 1] = '\0'; percent = strtonum(argv[0], 0, 100, &percent_error); if (percent_error) From owner-svn-src-head@freebsd.org Tue Oct 6 09:51: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 8A7C142E650; Tue, 6 Oct 2020 09:51:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C5CRK3Fghz4FtJ; Tue, 6 Oct 2020 09:51:41 +0000 (UTC) (envelope-from tuexen@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 5446424D1B; Tue, 6 Oct 2020 09:51:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0969pftT072354; Tue, 6 Oct 2020 09:51:41 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0969pfpN072353; Tue, 6 Oct 2020 09:51:41 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202010060951.0969pfpN072353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 6 Oct 2020 09:51:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366474 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 366474 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, 06 Oct 2020 09:51:41 -0000 Author: tuexen Date: Tue Oct 6 09:51:40 2020 New Revision: 366474 URL: https://svnweb.freebsd.org/changeset/base/366474 Log: Whitespace changes. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Tue Oct 6 09:28:24 2020 (r366473) +++ head/sys/netinet/sctp_input.c Tue Oct 6 09:51:40 2020 (r366474) @@ -1510,7 +1510,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle * ----INIT-ACK(tag=t)--> * ----INIT(tag=t)------> *1 * <---INIT-ACK(tag=a)--- - * <----CE(tag=t)------------- *2 + * <----CE(tag=t)------------- *2 * * At point *1 we should be generating a different * tag t'. Which means we would throw away the CE and send @@ -1741,8 +1741,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && (!SCTP_IS_LISTENING(inp))) { - stcb->sctp_ep->sctp_flags |= - SCTP_PCB_FLAGS_CONNECTED; + stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; soisconnected(stcb->sctp_socket); } if (SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED) From owner-svn-src-head@freebsd.org Tue Oct 6 10:35: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 3F99442EEE6; Tue, 6 Oct 2020 10:35:04 +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 4C5DPN0nYzz4JXw; Tue, 6 Oct 2020 10:35:04 +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 EE37025614; Tue, 6 Oct 2020 10:35:03 +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 096AZ3fK002278; Tue, 6 Oct 2020 10:35:03 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096AZ37t002277; Tue, 6 Oct 2020 10:35:03 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202010061035.096AZ37t002277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 6 Oct 2020 10:35:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366475 - 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: 366475 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, 06 Oct 2020 10:35:04 -0000 Author: manu Date: Tue Oct 6 10:35:03 2020 New Revision: 366475 URL: https://svnweb.freebsd.org/changeset/base/366475 Log: linuxkpi: Add gcd function This compute the common greater divider Taken from OpenBSD Reviewed by: bz, imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26674 Added: head/sys/compat/linuxkpi/common/include/linux/gcd.h (contents, props changed) Added: head/sys/compat/linuxkpi/common/include/linux/gcd.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/gcd.h Tue Oct 6 10:35:03 2020 (r366475) @@ -0,0 +1,50 @@ +/*- + * Copyright (c) 2000 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Dieter Baron and Thomas Klausner. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_GCD_H_ +#define _LINUX_GCD_H_ + +static inline unsigned long +gcd(unsigned long a, unsigned long b) +{ + unsigned long c; + + c = a % b; + while (c != 0) { + a = b; + b = c; + c = a % b; + } + + return (b); +} + +#endif From owner-svn-src-head@freebsd.org Tue Oct 6 10:36: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 0F48942EEFA; Tue, 6 Oct 2020 10:36:17 +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 4C5DQm67t3z4Jhk; Tue, 6 Oct 2020 10:36:16 +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 B626425615; Tue, 6 Oct 2020 10:36:16 +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 096AaGal002376; Tue, 6 Oct 2020 10:36:16 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096AaGMq002375; Tue, 6 Oct 2020 10:36:16 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202010061036.096AaGMq002375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 6 Oct 2020 10:36:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366476 - 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: 366476 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, 06 Oct 2020 10:36:17 -0000 Author: manu Date: Tue Oct 6 10:36:16 2020 New Revision: 366476 URL: https://svnweb.freebsd.org/changeset/base/366476 Log: linuxkpi: Add numa.h Only contain NUMA_NO_NODE needed by drm Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26676 Added: head/sys/compat/linuxkpi/common/include/linux/numa.h (contents, props changed) Added: head/sys/compat/linuxkpi/common/include/linux/numa.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/numa.h Tue Oct 6 10:36:16 2020 (r366476) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Emmanuel Vadot under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_NUMA_H_ +#define _LINUX_NUMA_H_ + +#define NUMA_NO_NODE -1 + +#endif /* _LINUX_NUMA_H_ */ From owner-svn-src-head@freebsd.org Tue Oct 6 10:37: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 2982542F1D5; Tue, 6 Oct 2020 10:37:22 +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 4C5DS15rW0z4JdY; Tue, 6 Oct 2020 10:37:21 +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 ABC3B2553C; Tue, 6 Oct 2020 10:37:21 +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 096AbLl0002478; Tue, 6 Oct 2020 10:37:21 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096AbLlu002477; Tue, 6 Oct 2020 10:37:21 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202010061037.096AbLlu002477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 6 Oct 2020 10:37:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366477 - 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: 366477 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, 06 Oct 2020 10:37:22 -0000 Author: manu Date: Tue Oct 6 10:37:21 2020 New Revision: 366477 URL: https://svnweb.freebsd.org/changeset/base/366477 Log: linuxkpi: Add prefetch.h Only add prefetchw as it is the only function used by drm. Simply use the __builtin_prefetch which is available in all compiler for a long time. Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26677 Added: head/sys/compat/linuxkpi/common/include/linux/prefetch.h (contents, props changed) Added: head/sys/compat/linuxkpi/common/include/linux/prefetch.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/prefetch.h Tue Oct 6 10:37:21 2020 (r366477) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Emmanuel Vadot under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_PREFETCH_H_ +#define _LINUX_PREFETCH_H_ + +#define prefetchw(x) __builtin_prefetch(x,1) + +#endif /* _LINUX_PREFETCH_H_ */ From owner-svn-src-head@freebsd.org Tue Oct 6 10:39: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 5315542F4B3; Tue, 6 Oct 2020 10:39:41 +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 4C5DVj1ZNPz4Jq1; Tue, 6 Oct 2020 10:39:41 +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 19185253E1; Tue, 6 Oct 2020 10:39:41 +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 096AdegB002628; Tue, 6 Oct 2020 10:39:40 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096AdeLG002627; Tue, 6 Oct 2020 10:39:40 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202010061039.096AdeLG002627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 6 Oct 2020 10:39:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366478 - 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: 366478 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, 06 Oct 2020 10:39:41 -0000 Author: manu Date: Tue Oct 6 10:39:40 2020 New Revision: 366478 URL: https://svnweb.freebsd.org/changeset/base/366478 Log: linuxkpi: Add power_supply.h Add power_supply_is_system_supplied which is needed by drm. Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26679 Added: head/sys/compat/linuxkpi/common/include/linux/power_supply.h (contents, props changed) Added: head/sys/compat/linuxkpi/common/include/linux/power_supply.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/power_supply.h Tue Oct 6 10:39:40 2020 (r366478) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Emmanuel Vadot under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_POWER_SUPPLY_H_ +#define _LINUX_POWER_SUPPLY_H_ + +#include +#include + +static inline int +power_supply_is_system_supplied(void) +{ + + return (power_profile_get_state() == POWER_PROFILE_PERFORMANCE); +} + +#endif From owner-svn-src-head@freebsd.org Tue Oct 6 10:41: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 6D61242F53F; Tue, 6 Oct 2020 10:41:01 +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 4C5DXF2JtFz4JwD; Tue, 6 Oct 2020 10:41:01 +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 32A60255B0; Tue, 6 Oct 2020 10:41:01 +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 096Af1Se003517; Tue, 6 Oct 2020 10:41:01 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096Af16f003516; Tue, 6 Oct 2020 10:41:01 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202010061041.096Af16f003516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 6 Oct 2020 10:41:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366479 - 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: 366479 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, 06 Oct 2020 10:41:01 -0000 Author: manu Date: Tue Oct 6 10:41:00 2020 New Revision: 366479 URL: https://svnweb.freebsd.org/changeset/base/366479 Log: linuxkpi: Add pagemap.h Add release_pages needed by drm which simply calls put_page for all the pages provided Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26680 Added: head/sys/compat/linuxkpi/common/include/linux/pagemap.h (contents, props changed) Added: head/sys/compat/linuxkpi/common/include/linux/pagemap.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/pagemap.h Tue Oct 6 10:41:00 2020 (r366479) @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Emmanuel Vadot under sponsorship + * from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_PAGEMAP_H_ +#define _LINUX_PAGEMAP_H_ + +#include + +static inline void +release_pages(struct page **pages, int nr) +{ + int i; + + for (i = 0; i < nr; i++) + put_page(pages[i]); +} + +#endif From owner-svn-src-head@freebsd.org Tue Oct 6 10:41: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 2160B42F440; Tue, 6 Oct 2020 10:41:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C5DXK3hxXz4KJM; Tue, 6 Oct 2020 10:41:05 +0000 (UTC) (envelope-from tuexen@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 5DB1D2561A; Tue, 6 Oct 2020 10:41:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 096Af5C1003567; Tue, 6 Oct 2020 10:41:05 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096Af51g003566; Tue, 6 Oct 2020 10:41:05 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202010061041.096Af51g003566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 6 Oct 2020 10:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366480 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 366480 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, 06 Oct 2020 10:41:06 -0000 Author: tuexen Date: Tue Oct 6 10:41:04 2020 New Revision: 366480 URL: https://svnweb.freebsd.org/changeset/base/366480 Log: Cleanup, no functional change intended. MFC after: 3 days Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Tue Oct 6 10:41:00 2020 (r366479) +++ head/sys/netinet/sctp_usrreq.c Tue Oct 6 10:41:04 2020 (r366480) @@ -3077,43 +3077,27 @@ flags_out: break; } case SCTP_RECVRCVINFO: - { - int onoff; - - if (*optsize < sizeof(int)) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); - error = EINVAL; - } else { - SCTP_INP_RLOCK(inp); - onoff = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO); - SCTP_INP_RUNLOCK(inp); - } - if (error == 0) { - /* return the option value */ - *(int *)optval = onoff; - *optsize = sizeof(int); - } - break; + if (*optsize < sizeof(int)) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } else { + SCTP_INP_RLOCK(inp); + *(int *)optval = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO); + SCTP_INP_RUNLOCK(inp); + *optsize = sizeof(int); } + break; case SCTP_RECVNXTINFO: - { - int onoff; - - if (*optsize < sizeof(int)) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); - error = EINVAL; - } else { - SCTP_INP_RLOCK(inp); - onoff = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVNXTINFO); - SCTP_INP_RUNLOCK(inp); - } - if (error == 0) { - /* return the option value */ - *(int *)optval = onoff; - *optsize = sizeof(int); - } - break; + if (*optsize < sizeof(int)) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } else { + SCTP_INP_RLOCK(inp); + *(int *)optval = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVNXTINFO); + SCTP_INP_RUNLOCK(inp); + *optsize = sizeof(int); } + break; case SCTP_DEFAULT_SNDINFO: { struct sctp_sndinfo *info; From owner-svn-src-head@freebsd.org Tue Oct 6 10:51: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 CFB8D42F895; Tue, 6 Oct 2020 10:51:47 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C5Dmg55M9z4Khs; Tue, 6 Oct 2020 10:51:47 +0000 (UTC) (envelope-from gbe@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 92296257AF; Tue, 6 Oct 2020 10:51:47 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 096Aplcw011401; Tue, 6 Oct 2020 10:51:47 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096AplSk011400; Tue, 6 Oct 2020 10:51:47 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010061051.096AplSk011400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Tue, 6 Oct 2020 10:51:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366481 - head/share/man/man3 X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/share/man/man3 X-SVN-Commit-Revision: 366481 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, 06 Oct 2020 10:51:47 -0000 Author: gbe (doc committer) Date: Tue Oct 6 10:51:47 2020 New Revision: 366481 URL: https://svnweb.freebsd.org/changeset/base/366481 Log: intro(3): Update the list of included libraries - Extend the list of main libraries of section 3 - Extend the library functions that are included in the libc MFC after: 2 weeks Submitted by: Naga Chaitanya Vellanki Approved by: gbe Differential Revision: https://reviews.freebsd.org/D26476 Modified: head/share/man/man3/intro.3 Modified: head/share/man/man3/intro.3 ============================================================================== --- head/share/man/man3/intro.3 Tue Oct 6 10:41:04 2020 (r366480) +++ head/share/man/man3/intro.3 Tue Oct 6 10:51:47 2020 (r366481) @@ -28,12 +28,17 @@ .\" @(#)intro.3 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd March 22, 2017 +.Dd October 6, 2020 .Dt INTRO 3 .Os .Sh NAME .Nm intro .Nd introduction to the C libraries +.Sh SYNOPSIS +.Nm cc +.Op Ar flags +.Ar +.Op Fl llibrary .Sh DESCRIPTION This section provides an overview of the C library functions, their error returns and other @@ -47,7 +52,11 @@ must be indicated at compile time with the option of the compiler. .Pp The various libraries (followed by the loader flag): -.Bl -tag -width "libc (-lc)" +.Bl -tag -width "libbluetooth (-lbluetooth)" +.It Em libbluetooth Pq Fl l Ns Ar bluetooth +The bluetooth library. +See +.Xr bluetooth 3 . .It Em libc Pq Fl l Ns Ar c Standard C library functions. When using the C compiler @@ -57,21 +66,58 @@ to supply the loader flag .Fl l Ns Ar c for these functions. There are several `libraries' or groups of functions included inside of -.Em libc -: the standard -.Tn I/O -routines, -database routines, -bit operators, -string operators, -character tests and character operators, -des encryption routines, -storage allocation, time functions, signal handling and more. +.Em libc : +.Bl -tag -width "XXXXXX" +.It standard I/O routines +see +.Xr stdio 3 +.It database routines +see +.Xr db 3 +.It bit operators +see +.Xr bitstring 3 +.It string operators +see +.Xr string 3 +.It character tests and character operators +.It storage allocation +see +.Xr mpool 3 +.It regular-expressions +see +.Xr regex 3 +.It remote procedure calls (RPC) +see +.Xr rpc 3 +.It time functions +see +.Xr time 3 +.It signal handling +see +.Xr signal 3 +.El +.It Em libcalendar Pq Fl l Ns Ar calendar +The calendar arithmetic library. +See +.Xr calendar 3 . +.It Em libcam Pq Fl l Ns Ar cam +The common access method user library. +See +.Xr cam 3 . +.It Em libcrypt Pq Fl l Ns Ar crypt +The crypt library. +See +.Xr crypt 3 . .It Em libcurses Pq Fl l Ns Ar curses Fl l Ns Ar termcap Terminal independent screen management routines for two dimensional non-bitmap display terminals. -(See -.Xr ncurses 3 . ) +See +.Xr ncurses 3 . +.It Em libcuse Pq Fl l Ns Ar cuse +The userland character device library. +See +.Xr cuse 3 . .It Em libcompat Pq Fl l Ns Ar compat Functions which are obsolete but are available for compatibility with .Bx 4.3 . @@ -82,32 +128,106 @@ have been included for source code compatibility. Use of these routines should, for the most part, be avoided. The manual page entry for each compatibility routine indicates the proper interface to use. +.It Em libdevinfo Pq Fl l Ns Ar devinfo +The Device and Resource Information Utility library. +See +.Xr devinfo 3 . +.It Em libdevstat Pq Fl l Ns Ar devstat +The Device Statistics library. +See +.Xr devstat 3 . +.It Em libdwarf Pq Fl l Ns Ar dwarf +The DWARF access library. +See +.Xr dwarf 3 . +.It Em libelf Pq Fl l Ns Ar elf +The ELF access library. +See +.Xr elf 3 . +.It Em libfetch Pq Fl l Ns Ar fetch +The file transfer library. +See +.Xr fetch 3 . +.It Em libfigpar Pq Fl l Ns Ar figpar +The configuration file parsing library. +See +.Xr figpar 3 . +.It Em libgpio Pq Fl l Ns Ar gpio +The general-purpose input output library (GPIO). +See +.Xr gpio 3 . +.It Em libgssapi Pq Fl l Ns Ar gssapi +The generic security service application programming +interface. +See +.Xr gssapi 3 . +.It Em libjail Pq Fl l Ns Ar jail +The jail library. +See +.Xr jail 3 . .It Em libkvm Pq Fl l Ns Ar kvm Functions used to access kernel memory are in this library. They can be used against both a running system and a crash dump. -(See -.Xr kvm 3 . ) +See +.Xr kvm 3 . .It Em libl Pq Fl l Ns Ar l The library for .Xr lex 1 . .It Em libm Pq Fl l Ns Ar m -The math library, -.Em libm . -The math library is loaded as needed by the Pascal compiler, -but not by the C compiler which requires the -.Fl l Ns Ar m -flag. -(See -.Xr math 3 . ) +The math library. +See +.Xr math 3 . +.It Em libmd Pq Fl l Ns Ar md +The message digest library. +See +.Xr md4 3 , +.Xr md5 3 , +.Xr sha 3 , +.Xr sha256 3 , +.Xr sha512 3 , +.Xr ripemd 3 , +.Xr skein 3 . .It Em libmp Pq Fl l Ns Ar mp +.It Em libpam Pq Fl l Ns Ar pam +The pluggable authentication module library. +See +.Xr pam 3 . +.It Em libpcap Pq Fl l Ns Ar pcap +The packet capture library. +See +.Xr pcap 3 . +.It Em libpmc Pq Fl l Ns Ar pmc +The performance counters library. +See +.Xr pmc 3 . +.It Em libpthread Pq Fl l Ns Ar pthread +The POSIX threads library. +See +.Xr pthread 3 . +.It Em libsysdecode Pq Fl l Ns Ar sysdecode +The system argument decoding library. +See +.Xr sysdecode 3 . .It Em libtermcap Pq Fl l Ns Ar termcap The terminal independent operation library package. -(See -.Xr termcap 3 . ) +See +.Xr termcap 3 . +.It Em libusb Pq Fl l Ns Ar usb +The USB access library. +See +.Xr usb 3 . +.It Em libvgl Pq Fl l Ns Ar vgl +The video graphics library. +See +.Xr vgl 3 . .It Em liby Pq Fl l Ns Ar y The library for .Xr yacc 1 . +.It Em libz Pq Fl l Ns Ar z +The general-purpose data compression library. +See +.Xr zlib 3 . .El .Sh FILES .Bl -tag -width /usr/lib/libm_p.a -compact From owner-svn-src-head@freebsd.org Tue Oct 6 11:08: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 1284342FD77; Tue, 6 Oct 2020 11:08:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C5F8P6frrz4Lvt; Tue, 6 Oct 2020 11:08:53 +0000 (UTC) (envelope-from tuexen@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 C380625D8A; Tue, 6 Oct 2020 11:08:53 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 096B8rKd020953; Tue, 6 Oct 2020 11:08:53 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096B8rbo020950; Tue, 6 Oct 2020 11:08:53 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202010061108.096B8rbo020950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 6 Oct 2020 11:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366482 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 366482 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, 06 Oct 2020 11:08:54 -0000 Author: tuexen Date: Tue Oct 6 11:08:52 2020 New Revision: 366482 URL: https://svnweb.freebsd.org/changeset/base/366482 Log: Remove dead stores reported by clang static code analysis MFC after: 3 days Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Tue Oct 6 10:51:47 2020 (r366481) +++ head/sys/netinet/sctp_input.c Tue Oct 6 11:08:52 2020 (r366482) @@ -4116,7 +4116,6 @@ sctp_handle_packet_dropped(struct sctp_pktdrop_chunk * struct sctp_idata_chunk *idata_chunk; uint32_t bottle_bw, on_queue; uint32_t offset, chk_len; - uint16_t trunc_len; uint16_t pktdrp_len; uint8_t pktdrp_flags; @@ -4126,13 +4125,10 @@ sctp_handle_packet_dropped(struct sctp_pktdrop_chunk * pktdrp_len = ntohs(cp->ch.chunk_length); KASSERT(limit <= pktdrp_len, ("Inconsistent limit")); if (pktdrp_flags & SCTP_PACKET_TRUNCATED) { - trunc_len = ntohs(cp->trunc_len); - if (trunc_len <= pktdrp_len - sizeof(struct sctp_pktdrop_chunk)) { + if (ntohs(cp->trunc_len) <= pktdrp_len - sizeof(struct sctp_pktdrop_chunk)) { /* The peer plays games with us. */ return; } - } else { - trunc_len = 0; } limit -= sizeof(struct sctp_pktdrop_chunk); offset = 0; Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Tue Oct 6 10:51:47 2020 (r366481) +++ head/sys/netinet/sctp_output.c Tue Oct 6 11:08:52 2020 (r366482) @@ -8793,7 +8793,7 @@ no_data_fill: * the top of the for, but just to make sure * I will reset these again here. */ - ctl_cnt = bundle_at = 0; + ctl_cnt = 0; continue; /* This takes us back to the * for() for the nets. */ } else { @@ -9392,7 +9392,7 @@ sctp_chunk_retransmission(struct sctp_inpcb *inp, uint32_t dmtu = 0; SCTP_TCB_LOCK_ASSERT(stcb); - tmr_started = ctl_cnt = bundle_at = error = 0; + tmr_started = ctl_cnt = 0; no_fragmentflg = 1; fwd_tsn = 0; *cnt_out = 0; Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue Oct 6 10:51:47 2020 (r366481) +++ head/sys/netinet/sctp_pcb.c Tue Oct 6 11:08:52 2020 (r366482) @@ -4345,7 +4345,7 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockadd LIST_INSERT_HEAD(head, stcb, sctp_asocs); SCTP_INP_INFO_WUNLOCK(); - if ((err = sctp_add_remote_addr(stcb, firstaddr, NULL, port, SCTP_DO_SETSCOPE, SCTP_ALLOC_ASOC))) { + if (sctp_add_remote_addr(stcb, firstaddr, NULL, port, SCTP_DO_SETSCOPE, SCTP_ALLOC_ASOC)) { /* failure.. memory error? */ if (asoc->strmout) { SCTP_FREE(asoc->strmout, SCTP_M_STRMO); Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Tue Oct 6 10:51:47 2020 (r366481) +++ head/sys/netinet/sctputil.c Tue Oct 6 11:08:52 2020 (r366482) @@ -1725,7 +1725,6 @@ sctp_timeout_handler(void *t) net = (struct sctp_nets *)tmr->net; CURVNET_SET((struct vnet *)tmr->vnet); NET_EPOCH_ENTER(et); - did_output = 1; released_asoc_reference = false; #ifdef SCTP_AUDITING_ENABLED @@ -1994,7 +1993,6 @@ sctp_timeout_handler(void *t) op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), "Shutdown guard timer expired"); sctp_abort_an_association(inp, stcb, op_err, SCTP_SO_NOT_LOCKED); - did_output = true; /* no need to unlock on tcb its gone */ goto out_decr; case SCTP_TIMER_TYPE_AUTOCLOSE: @@ -2071,7 +2069,6 @@ sctp_timeout_handler(void *t) #ifdef INVARIANTS panic("Unknown timer type %d", type); #else - did_output = false; goto out; #endif } @@ -2155,7 +2152,6 @@ sctp_timer_start(int t_type, struct sctp_inpcb *inp, s ("sctp_timer_start of type %d: inp = %p, stcb->sctp_ep %p", t_type, stcb, stcb->sctp_ep)); tmr = NULL; - to_ticks = 0; if (stcb != NULL) { SCTP_TCB_LOCK_ASSERT(stcb); } else if (inp != NULL) { From owner-svn-src-head@freebsd.org Tue Oct 6 11:29: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 CE52B430565; Tue, 6 Oct 2020 11:29:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C5Fbn5B6Mz4Mxj; Tue, 6 Oct 2020 11:29:09 +0000 (UTC) (envelope-from tuexen@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 951EE25FE2; Tue, 6 Oct 2020 11:29:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 096BT971033487; Tue, 6 Oct 2020 11:29:09 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096BT9cf033485; Tue, 6 Oct 2020 11:29:09 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202010061129.096BT9cf033485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 6 Oct 2020 11:29:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366483 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 366483 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, 06 Oct 2020 11:29:09 -0000 Author: tuexen Date: Tue Oct 6 11:29:08 2020 New Revision: 366483 URL: https://svnweb.freebsd.org/changeset/base/366483 Log: Ensure variables are initialized before used. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Tue Oct 6 11:08:52 2020 (r366482) +++ head/sys/netinet/sctp_input.c Tue Oct 6 11:29:08 2020 (r366483) @@ -5553,7 +5553,9 @@ sctp_common_input_processing(struct mbuf **mm, int iph stcb = NULL; goto out; } - data_processed = 1; + if (retval == 0) { + data_processed = 1; + } /* * Anything important needs to have been m_copy'ed in * process_data Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue Oct 6 11:08:52 2020 (r366482) +++ head/sys/netinet/sctp_pcb.c Tue Oct 6 11:29:08 2020 (r366483) @@ -6047,6 +6047,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, s peer_supports_prsctp = 0; peer_supports_auth = 0; peer_supports_asconf = 0; + peer_supports_asconf_ack = 0; peer_supports_reconfig = 0; peer_supports_nrsack = 0; peer_supports_pktdrop = 0; From owner-svn-src-head@freebsd.org Tue Oct 6 12:56: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 ACB72432837; Tue, 6 Oct 2020 12:56:30 +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 4C5HXZ43qqz4S9M; Tue, 6 Oct 2020 12:56:30 +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 6AA1A27105; Tue, 6 Oct 2020 12:56:30 +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 096CuUG4088179; Tue, 6 Oct 2020 12:56:30 GMT (envelope-from jrtc27@FreeBSD.org) Received: (from jrtc27@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096CuU2d088178; Tue, 6 Oct 2020 12:56:30 GMT (envelope-from jrtc27@FreeBSD.org) Message-Id: <202010061256.096CuU2d088178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jrtc27 set sender to jrtc27@FreeBSD.org using -f From: Jessica Clarke Date: Tue, 6 Oct 2020 12:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366484 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jrtc27 X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 366484 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, 06 Oct 2020 12:56:30 -0000 Author: jrtc27 Date: Tue Oct 6 12:56:29 2020 New Revision: 366484 URL: https://svnweb.freebsd.org/changeset/base/366484 Log: riscv: De-Arm a few names These names were inherited from the arm64 port and should be changed to the RISC-V terminology. Reviewed by: jhb (mentor), kp, markj Approved by: jhb (mentor), kp, markj Differential Revision: https://reviews.freebsd.org/D26671 Modified: head/sys/riscv/riscv/exception.S head/sys/riscv/riscv/trap.c Modified: head/sys/riscv/riscv/exception.S ============================================================================== --- head/sys/riscv/riscv/exception.S Tue Oct 6 11:29:08 2020 (r366483) +++ head/sys/riscv/riscv/exception.S Tue Oct 6 12:56:29 2020 (r366484) @@ -40,12 +40,12 @@ __FBSDID("$FreeBSD$"); #include #include -.macro save_registers el +.macro save_registers mode addi sp, sp, -(TF_SIZE) sd ra, (TF_RA)(sp) -.if \el == 0 /* We came from userspace. */ +.if \mode == 0 /* We came from userspace. */ sd gp, (TF_GP)(sp) .option push .option norelax @@ -88,7 +88,7 @@ __FBSDID("$FreeBSD$"); sd a6, (TF_A + 6 * 8)(sp) sd a7, (TF_A + 7 * 8)(sp) -.if \el == 1 +.if \mode == 1 /* Store kernel sp */ li t1, TF_SIZE add t0, sp, t1 @@ -110,9 +110,9 @@ __FBSDID("$FreeBSD$"); sd t0, (TF_SCAUSE)(sp) .endm -.macro load_registers el +.macro load_registers mode ld t0, (TF_SSTATUS)(sp) -.if \el == 0 +.if \mode == 0 /* Ensure user interrupts will be enabled on eret */ li t1, SSTATUS_SPIE or t0, t0, t1 @@ -130,7 +130,7 @@ __FBSDID("$FreeBSD$"); ld t0, (TF_SEPC)(sp) csrw sepc, t0 -.if \el == 0 +.if \mode == 0 /* We go to userspace. Load user sp */ ld t0, (TF_SP)(sp) csrw sscratch, t0 Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Tue Oct 6 11:29:08 2020 (r366483) +++ head/sys/riscv/riscv/trap.c Tue Oct 6 12:56:29 2020 (r366484) @@ -158,7 +158,7 @@ dump_regs(struct trapframe *frame) } static void -svc_handler(struct trapframe *frame) +ecall_handler(struct trapframe *frame) { struct thread *td; @@ -172,7 +172,7 @@ svc_handler(struct trapframe *frame) } static void -data_abort(struct trapframe *frame, int usermode) +page_fault_handler(struct trapframe *frame, int usermode) { struct vm_map *map; uint64_t stval; @@ -290,7 +290,7 @@ do_trap_supervisor(struct trapframe *frame) break; case EXCP_STORE_PAGE_FAULT: case EXCP_LOAD_PAGE_FAULT: - data_abort(frame, 0); + page_fault_handler(frame, 0); break; case EXCP_BREAKPOINT: #ifdef KDTRACE_HOOKS @@ -353,11 +353,11 @@ do_trap_user(struct trapframe *frame) case EXCP_STORE_PAGE_FAULT: case EXCP_LOAD_PAGE_FAULT: case EXCP_INST_PAGE_FAULT: - data_abort(frame, 1); + page_fault_handler(frame, 1); break; case EXCP_USER_ECALL: frame->tf_sepc += 4; /* Next instruction */ - svc_handler(frame); + ecall_handler(frame); break; case EXCP_ILLEGAL_INSTRUCTION: #ifdef FPE From owner-svn-src-head@freebsd.org Tue Oct 6 12:57: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 088E04328C3; Tue, 6 Oct 2020 12:57:55 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C5HZB6QQ1z4SKl; Tue, 6 Oct 2020 12:57:54 +0000 (UTC) (envelope-from lwhsu@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 C0AA526EDD; Tue, 6 Oct 2020 12:57:54 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 096CvsfD088291; Tue, 6 Oct 2020 12:57:54 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096CvsAU088290; Tue, 6 Oct 2020 12:57:54 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202010061257.096CvsAU088290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 6 Oct 2020 12:57:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366485 - head/tests/sys/capsicum X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/capsicum X-SVN-Commit-Revision: 366485 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, 06 Oct 2020 12:57:55 -0000 Author: lwhsu Date: Tue Oct 6 12:57:54 2020 New Revision: 366485 URL: https://svnweb.freebsd.org/changeset/base/366485 Log: Temporarily skip failing test cases in CI: sys.capsicum.functional.ForkedOpenatTest_WithFlagInCapabilityMode___ sys.capsicum.functional.OpenatTest__WithFlag PR: 249960 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/capsicum/functional.sh Modified: head/tests/sys/capsicum/functional.sh ============================================================================== --- head/tests/sys/capsicum/functional.sh Tue Oct 6 12:56:29 2020 (r366484) +++ head/tests/sys/capsicum/functional.sh Tue Oct 6 12:57:54 2020 (r366485) @@ -40,6 +40,13 @@ check() ${SRCDIR}/${CAPSICUM_TEST_BIN} --gtest_filter=${tc} } +skip() +{ + local reason=${1} + + atf_skip "${reason}" +} + add_testcase() { local tc=${1} @@ -48,7 +55,20 @@ add_testcase() tc_escaped=$(echo ${tc} | sed -e 's/\./__/') atf_test_case ${tc_escaped} - eval "${tc_escaped}_body() { check ${tc}; }" + + if [ "$(atf_config_get ci false)" = "true" ]; then + case "${tc_escaped}" in + ForkedOpenatTest_WithFlagInCapabilityMode___|OpenatTest__WithFlag) + eval "${tc_escaped}_body() { skip \"http://bugs.freebsd.org/249960\"; }" + ;; + *) + eval "${tc_escaped}_body() { check ${tc}; }" + ;; + esac + else + eval "${tc_escaped}_body() { check ${tc}; }" + fi + atf_add_test_case ${tc_escaped} } From owner-svn-src-head@freebsd.org Tue Oct 6 13:02: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 CC225432B97; Tue, 6 Oct 2020 13:02:20 +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 4C5HgJ56ssz4Sjr; Tue, 6 Oct 2020 13:02:20 +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 946D82738C; Tue, 6 Oct 2020 13:02:20 +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 096D2KI0093533; Tue, 6 Oct 2020 13:02:20 GMT (envelope-from jrtc27@FreeBSD.org) Received: (from jrtc27@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096D2KJE093532; Tue, 6 Oct 2020 13:02:20 GMT (envelope-from jrtc27@FreeBSD.org) Message-Id: <202010061302.096D2KJE093532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jrtc27 set sender to jrtc27@FreeBSD.org using -f From: Jessica Clarke Date: Tue, 6 Oct 2020 13:02:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366486 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jrtc27 X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 366486 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, 06 Oct 2020 13:02:20 -0000 Author: jrtc27 Date: Tue Oct 6 13:02:20 2020 New Revision: 366486 URL: https://svnweb.freebsd.org/changeset/base/366486 Log: riscv: Handle supervisor instruction page faults We should never take instruction page faults when in the kernel, but by using the standard page fault code we should get a more-informative message about faulting on a NOFAULT page rather than branching to the default case here and printing an "Unknown kernel exception ..." message. Reviewed by: jhb (mentor), markj Approved by: jhb (mentor), markj Differential Revision: https://reviews.freebsd.org/D26685 Modified: head/sys/riscv/riscv/trap.c Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Tue Oct 6 12:57:54 2020 (r366485) +++ head/sys/riscv/riscv/trap.c Tue Oct 6 13:02:20 2020 (r366486) @@ -290,6 +290,7 @@ do_trap_supervisor(struct trapframe *frame) break; case EXCP_STORE_PAGE_FAULT: case EXCP_LOAD_PAGE_FAULT: + case EXCP_INST_PAGE_FAULT: page_fault_handler(frame, 0); break; case EXCP_BREAKPOINT: From owner-svn-src-head@freebsd.org Tue Oct 6 13:03: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 C31FA432E15; Tue, 6 Oct 2020 13:03:31 +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 4C5Hhg4QQ7z4Shh; Tue, 6 Oct 2020 13:03:31 +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 7BB2C27199; Tue, 6 Oct 2020 13:03:31 +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 096D3VBR094298; Tue, 6 Oct 2020 13:03:31 GMT (envelope-from jrtc27@FreeBSD.org) Received: (from jrtc27@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096D3VG6094297; Tue, 6 Oct 2020 13:03:31 GMT (envelope-from jrtc27@FreeBSD.org) Message-Id: <202010061303.096D3VG6094297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jrtc27 set sender to jrtc27@FreeBSD.org using -f From: Jessica Clarke Date: Tue, 6 Oct 2020 13:03:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366487 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jrtc27 X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 366487 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, 06 Oct 2020 13:03:31 -0000 Author: jrtc27 Date: Tue Oct 6 13:03:31 2020 New Revision: 366487 URL: https://svnweb.freebsd.org/changeset/base/366487 Log: riscv: Remove outdated condition in page_fault_handler Since r366355 and r366284 we panic on access faults rather than treating them like page faults so this condition is never true. Reviewed by: jhb (mentor), markj, mhorne Approved by: jhb (mentor), markj, mhorne Differential Revision: https://reviews.freebsd.org/D26686 Modified: head/sys/riscv/riscv/trap.c Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Tue Oct 6 13:02:20 2020 (r366486) +++ head/sys/riscv/riscv/trap.c Tue Oct 6 13:03:31 2020 (r366487) @@ -220,8 +220,7 @@ page_fault_handler(struct trapframe *frame, int usermo va = trunc_page(stval); - if ((frame->tf_scause == EXCP_FAULT_STORE) || - (frame->tf_scause == EXCP_STORE_PAGE_FAULT)) { + if (frame->tf_scause == EXCP_STORE_PAGE_FAULT) { ftype = VM_PROT_WRITE; } else if (frame->tf_scause == EXCP_INST_PAGE_FAULT) { ftype = VM_PROT_EXECUTE; From owner-svn-src-head@freebsd.org Tue Oct 6 14:26: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 698604346A8; Tue, 6 Oct 2020 14:26:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C5KWy2B3hz4Y0G; Tue, 6 Oct 2020 14:26:06 +0000 (UTC) (envelope-from tuexen@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 2E2F227B73; Tue, 6 Oct 2020 14:26:06 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 096EQ66L043844; Tue, 6 Oct 2020 14:26:06 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096EQ60D043843; Tue, 6 Oct 2020 14:26:06 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202010061426.096EQ60D043843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 6 Oct 2020 14:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366489 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 366489 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, 06 Oct 2020 14:26:06 -0000 Author: tuexen Date: Tue Oct 6 14:26:05 2020 New Revision: 366489 URL: https://svnweb.freebsd.org/changeset/base/366489 Log: Reset delayed SACK state when restarting an SCTP association. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Tue Oct 6 14:03:59 2020 (r366488) +++ head/sys/netinet/sctp_input.c Tue Oct 6 14:26:05 2020 (r366489) @@ -1830,17 +1830,14 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle /* move to OPEN state, if not in SHUTDOWN_SENT */ SCTP_SET_STATE(stcb, SCTP_STATE_OPEN); } - asoc->pre_open_streams = - ntohs(initack_cp->init.num_outbound_streams); + asoc->pre_open_streams = ntohs(initack_cp->init.num_outbound_streams); asoc->init_seq_number = ntohl(initack_cp->init.initial_tsn); asoc->sending_seq = asoc->asconf_seq_out = asoc->str_reset_seq_out = asoc->init_seq_number; asoc->asconf_seq_out_acked = asoc->asconf_seq_out - 1; - asoc->asconf_seq_in = asoc->last_acked_seq = asoc->init_seq_number - 1; - asoc->str_reset_seq_in = asoc->init_seq_number; - asoc->advanced_peer_ack_point = asoc->last_acked_seq; + asoc->send_sack = 1; if (asoc->mapping_array) { memset(asoc->mapping_array, 0, asoc->mapping_array_size); From owner-svn-src-head@freebsd.org Tue Oct 6 17:59: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 74178438396; Tue, 6 Oct 2020 17:59:00 +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 4C5QFc2ZQhz3VQH; Tue, 6 Oct 2020 17:59:00 +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 3B507AB86; Tue, 6 Oct 2020 17:59:00 +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 096Hx0hi072682; Tue, 6 Oct 2020 17:59:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096HwuYR072660; Tue, 6 Oct 2020 17:58:56 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202010061758.096HwuYR072660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 6 Oct 2020 17:58:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366491 - in head/sys: dev/cxgbe dev/cxgbe/crypto dev/mlx5/mlx5_en kern net sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: dev/cxgbe dev/cxgbe/crypto dev/mlx5/mlx5_en kern net sys X-SVN-Commit-Revision: 366491 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, 06 Oct 2020 17:59:00 -0000 Author: jhb Date: Tue Oct 6 17:58:56 2020 New Revision: 366491 URL: https://svnweb.freebsd.org/changeset/base/366491 Log: Store the send tag type in the common send tag header. Both cxgbe(4) and mlx5(4) wrapped the existing send tag header with their own identical headers that stored the type that the type-specific tag structures inherited from, so in practice it seems drivers need this in the tag anyway. This permits removing these extra header indirections (struct cxgbe_snd_tag and struct mlx5e_snd_tag). In addition, this permits driver-independent code to query the type of a tag, e.g. to know what type of tag is being queried via if_snd_query. Reviewed by: gallatin, hselasky, np, kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D26689 Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/crypto/t4_kern_tls.c head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sched.c head/sys/dev/cxgbe/t4_sge.c head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/en_hw_tls.h head/sys/dev/mlx5/mlx5_en/en_rl.h head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c head/sys/kern/kern_mbuf.c head/sys/net/if_lagg.c head/sys/net/if_vlan.c head/sys/sys/mbuf.h Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Tue Oct 6 15:17:41 2020 (r366490) +++ head/sys/dev/cxgbe/adapter.h Tue Oct 6 17:58:56 2020 (r366491) @@ -1202,7 +1202,6 @@ int update_mac_settings(struct ifnet *, int); int adapter_full_init(struct adapter *); int adapter_full_uninit(struct adapter *); uint64_t cxgbe_get_counter(struct ifnet *, ift_counter); -void cxgbe_snd_tag_init(struct cxgbe_snd_tag *, struct ifnet *, int); int vi_full_init(struct vi_info *); int vi_full_uninit(struct vi_info *); void vi_sysctls(struct vi_info *); Modified: head/sys/dev/cxgbe/crypto/t4_kern_tls.c ============================================================================== --- head/sys/dev/cxgbe/crypto/t4_kern_tls.c Tue Oct 6 15:17:41 2020 (r366490) +++ head/sys/dev/cxgbe/crypto/t4_kern_tls.c Tue Oct 6 17:58:56 2020 (r366491) @@ -156,7 +156,7 @@ struct tls_keyctx { #define KEY_DELETE_TX 0x8 struct tlspcb { - struct cxgbe_snd_tag com; + struct m_snd_tag com; struct vi_info *vi; /* virtual interface */ struct adapter *sc; struct l2t_entry *l2te; /* L2 table entry used by this connection */ @@ -205,7 +205,7 @@ static int ktls_setup_keys(struct tlspcb *tlsp, static inline struct tlspcb * mst_to_tls(struct m_snd_tag *t) { - return ((struct tlspcb *)mst_to_cst(t)); + return (__containerof(t, struct tlspcb, com)); } /* XXX: There are similar versions of these two in tom/t4_tls.c. */ @@ -240,7 +240,7 @@ alloc_tlspcb(struct ifnet *ifp, struct vi_info *vi, in if (tlsp == NULL) return (NULL); - cxgbe_snd_tag_init(&tlsp->com, ifp, IF_SND_TAG_TYPE_TLS); + m_snd_tag_init(&tlsp->com, ifp, IF_SND_TAG_TYPE_TLS); tlsp->vi = vi; tlsp->sc = sc; tlsp->ctrlq = &sc->sge.ctrlq[pi->port_id]; @@ -484,7 +484,7 @@ ktls_set_tcb_fields(struct tlspcb *tlsp, struct tcpcb tlsp->tid); return (ENOMEM); } - m->m_pkthdr.snd_tag = m_snd_tag_ref(&tlsp->com.com); + m->m_pkthdr.snd_tag = m_snd_tag_ref(&tlsp->com); m->m_pkthdr.csum_flags |= CSUM_SND_TAG; /* FW_ULPTX_WR */ @@ -727,13 +727,13 @@ cxgbe_tls_tag_alloc(struct ifnet *ifp, union if_snd_ta else txq->kern_tls_cbc++; TXQ_UNLOCK(txq); - *pt = &tlsp->com.com; + *pt = &tlsp->com; return (0); failed: if (atid >= 0) free_atid(sc, atid); - m_snd_tag_rele(&tlsp->com.com); + m_snd_tag_rele(&tlsp->com); return (error); } @@ -836,7 +836,7 @@ ktls_setup_keys(struct tlspcb *tlsp, const struct ktls tlsp->tid); return (ENOMEM); } - m->m_pkthdr.snd_tag = m_snd_tag_ref(&tlsp->com.com); + m->m_pkthdr.snd_tag = m_snd_tag_ref(&tlsp->com); m->m_pkthdr.csum_flags |= CSUM_SND_TAG; kwr = mtod(m, void *); memset(kwr, 0, len); Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Tue Oct 6 15:17:41 2020 (r366490) +++ head/sys/dev/cxgbe/offload.h Tue Oct 6 17:58:56 2020 (r366491) @@ -87,13 +87,8 @@ enum { EO_FLUSH_RPL_PENDING = (1 << 3), /* credit flush rpl due back */ }; -struct cxgbe_snd_tag { - struct m_snd_tag com; - int type; -}; - struct cxgbe_rate_tag { - struct cxgbe_snd_tag com; + struct m_snd_tag com; struct adapter *adapter; u_int flags; struct mtx lock; @@ -112,17 +107,10 @@ struct cxgbe_rate_tag { uint8_t ncompl; /* # of completions outstanding. */ }; -static inline struct cxgbe_snd_tag * -mst_to_cst(struct m_snd_tag *t) -{ - - return (__containerof(t, struct cxgbe_snd_tag, com)); -} - static inline struct cxgbe_rate_tag * mst_to_crt(struct m_snd_tag *t) { - return ((struct cxgbe_rate_tag *)mst_to_cst(t)); + return (__containerof(t, struct cxgbe_rate_tag, com)); } union etid_entry { Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Oct 6 15:17:41 2020 (r366490) +++ head/sys/dev/cxgbe/t4_main.c Tue Oct 6 17:58:56 2020 (r366491) @@ -2186,9 +2186,6 @@ cxgbe_transmit(struct ifnet *ifp, struct mbuf *m) struct port_info *pi = vi->pi; struct adapter *sc; struct sge_txq *txq; -#ifdef RATELIMIT - struct cxgbe_snd_tag *cst; -#endif void *items[1]; int rc; @@ -2212,8 +2209,7 @@ cxgbe_transmit(struct ifnet *ifp, struct mbuf *m) } #ifdef RATELIMIT if (m->m_pkthdr.csum_flags & CSUM_SND_TAG) { - cst = mst_to_cst(m->m_pkthdr.snd_tag); - if (cst->type == IF_SND_TAG_TYPE_RATE_LIMIT) + if (m->m_pkthdr.snd_tag->type == IF_SND_TAG_TYPE_RATE_LIMIT) return (ethofld_transmit(ifp, m)); } #endif @@ -2374,14 +2370,6 @@ cxgbe_get_counter(struct ifnet *ifp, ift_counter c) } #if defined(KERN_TLS) || defined(RATELIMIT) -void -cxgbe_snd_tag_init(struct cxgbe_snd_tag *cst, struct ifnet *ifp, int type) -{ - - m_snd_tag_init(&cst->com, ifp); - cst->type = type; -} - static int cxgbe_snd_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params, struct m_snd_tag **pt) @@ -2402,8 +2390,6 @@ cxgbe_snd_tag_alloc(struct ifnet *ifp, union if_snd_ta default: error = EOPNOTSUPP; } - if (error == 0) - MPASS(mst_to_cst(*pt)->type == params->hdr.type); return (error); } @@ -2411,10 +2397,8 @@ static int cxgbe_snd_tag_modify(struct m_snd_tag *mst, union if_snd_tag_modify_params *params) { - struct cxgbe_snd_tag *cst; - cst = mst_to_cst(mst); - switch (cst->type) { + switch (mst->type) { #ifdef RATELIMIT case IF_SND_TAG_TYPE_RATE_LIMIT: return (cxgbe_rate_tag_modify(mst, params)); @@ -2428,10 +2412,8 @@ static int cxgbe_snd_tag_query(struct m_snd_tag *mst, union if_snd_tag_query_params *params) { - struct cxgbe_snd_tag *cst; - cst = mst_to_cst(mst); - switch (cst->type) { + switch (mst->type) { #ifdef RATELIMIT case IF_SND_TAG_TYPE_RATE_LIMIT: return (cxgbe_rate_tag_query(mst, params)); @@ -2444,10 +2426,8 @@ cxgbe_snd_tag_query(struct m_snd_tag *mst, static void cxgbe_snd_tag_free(struct m_snd_tag *mst) { - struct cxgbe_snd_tag *cst; - cst = mst_to_cst(mst); - switch (cst->type) { + switch (mst->type) { #ifdef RATELIMIT case IF_SND_TAG_TYPE_RATE_LIMIT: cxgbe_rate_tag_free(mst); Modified: head/sys/dev/cxgbe/t4_sched.c ============================================================================== --- head/sys/dev/cxgbe/t4_sched.c Tue Oct 6 15:17:41 2020 (r366490) +++ head/sys/dev/cxgbe/t4_sched.c Tue Oct 6 17:58:56 2020 (r366491) @@ -788,7 +788,7 @@ failed: mtx_init(&cst->lock, "cst_lock", NULL, MTX_DEF); mbufq_init(&cst->pending_tx, INT_MAX); mbufq_init(&cst->pending_fwack, INT_MAX); - cxgbe_snd_tag_init(&cst->com, ifp, IF_SND_TAG_TYPE_RATE_LIMIT); + m_snd_tag_init(&cst->com, ifp, IF_SND_TAG_TYPE_RATE_LIMIT); cst->flags |= EO_FLOWC_PENDING | EO_SND_TAG_REF; cst->adapter = sc; cst->port_id = pi->port_id; @@ -805,7 +805,7 @@ failed: * Queues will be selected later when the connection flowid is available. */ - *pt = &cst->com.com; + *pt = &cst->com; return (0); } Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Tue Oct 6 15:17:41 2020 (r366490) +++ head/sys/dev/cxgbe/t4_sge.c Tue Oct 6 17:58:56 2020 (r366491) @@ -2404,10 +2404,10 @@ set_mbuf_eo_tsclk_tsoff(struct mbuf *m, uint8_t tsclk_ } static inline int -needs_eo(struct cxgbe_snd_tag *cst) +needs_eo(struct m_snd_tag *mst) { - return (cst != NULL && cst->type == IF_SND_TAG_TYPE_RATE_LIMIT); + return (mst != NULL && mst->type == IF_SND_TAG_TYPE_RATE_LIMIT); } #endif @@ -2716,7 +2716,7 @@ parse_pkt(struct mbuf **mp, bool vm_wr) struct tcphdr *tcp; #endif #if defined(KERN_TLS) || defined(RATELIMIT) - struct cxgbe_snd_tag *cst; + struct m_snd_tag *mst; #endif uint16_t eh_type; uint8_t cflags; @@ -2740,12 +2740,12 @@ restart: nsegs = count_mbuf_nsegs(m0, 0, &cflags); #if defined(KERN_TLS) || defined(RATELIMIT) if (m0->m_pkthdr.csum_flags & CSUM_SND_TAG) - cst = mst_to_cst(m0->m_pkthdr.snd_tag); + mst = m0->m_pkthdr.snd_tag; else - cst = NULL; + mst = NULL; #endif #ifdef KERN_TLS - if (cst != NULL && cst->type == IF_SND_TAG_TYPE_TLS) { + if (mst != NULL && mst->type == IF_SND_TAG_TYPE_TLS) { int len16; cflags |= MC_TLS; @@ -2794,17 +2794,17 @@ restart: * checksumming is enabled. needs_outer_l4_csum happens to check for * all the right things. */ - if (__predict_false(needs_eo(cst) && !needs_outer_l4_csum(m0))) { + if (__predict_false(needs_eo(mst) && !needs_outer_l4_csum(m0))) { m_snd_tag_rele(m0->m_pkthdr.snd_tag); m0->m_pkthdr.snd_tag = NULL; m0->m_pkthdr.csum_flags &= ~CSUM_SND_TAG; - cst = NULL; + mst = NULL; } #endif if (!needs_hwcsum(m0) #ifdef RATELIMIT - && !needs_eo(cst) + && !needs_eo(mst) #endif ) return (0); @@ -2923,7 +2923,7 @@ restart: #endif } #ifdef RATELIMIT - if (needs_eo(cst)) { + if (needs_eo(mst)) { u_int immhdrs; /* EO WRs have the headers in the WR and not the GL. */ @@ -6484,7 +6484,7 @@ ethofld_tx(struct cxgbe_rate_tag *cst) cst->tx_credits -= next_credits; cst->tx_nocompl += next_credits; compl = cst->ncompl == 0 || cst->tx_nocompl >= cst->tx_total / 2; - ETHER_BPF_MTAP(cst->com.com.ifp, m); + ETHER_BPF_MTAP(cst->com.ifp, m); write_ethofld_wr(cst, wr, m, compl); commit_wrq_wr(cst->eo_txq, wr, &cookie); if (compl) { @@ -6505,7 +6505,7 @@ ethofld_tx(struct cxgbe_rate_tag *cst) */ m->m_pkthdr.snd_tag = NULL; m->m_pkthdr.csum_flags &= ~CSUM_SND_TAG; - m_snd_tag_rele(&cst->com.com); + m_snd_tag_rele(&cst->com); mbufq_enqueue(&cst->pending_fwack, m); } @@ -6559,10 +6559,10 @@ ethofld_transmit(struct ifnet *ifp, struct mbuf *m0) * ethofld_tx() in case we are sending the final mbuf after * the inp was freed. */ - m_snd_tag_ref(&cst->com.com); + m_snd_tag_ref(&cst->com); ethofld_tx(cst); mtx_unlock(&cst->lock); - m_snd_tag_rele(&cst->com.com); + m_snd_tag_rele(&cst->com); return (0); done: @@ -6633,12 +6633,12 @@ ethofld_fw4_ack(struct sge_iq *iq, const struct rss_he * As with ethofld_transmit(), hold an extra reference * so that the tag is stable across ethold_tx(). */ - m_snd_tag_ref(&cst->com.com); + m_snd_tag_ref(&cst->com); m = mbufq_first(&cst->pending_tx); if (m != NULL && cst->tx_credits >= mbuf_eo_len16(m)) ethofld_tx(cst); mtx_unlock(&cst->lock); - m_snd_tag_rele(&cst->com.com); + m_snd_tag_rele(&cst->com); } else { /* * There shouldn't be any pending packets if the tag Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Tue Oct 6 15:17:41 2020 (r366490) +++ head/sys/dev/mlx5/mlx5_en/en.h Tue Oct 6 17:58:56 2020 (r366491) @@ -791,11 +791,6 @@ enum { MLX5E_SQ_FULL }; -struct mlx5e_snd_tag { - struct m_snd_tag m_snd_tag; /* send tag */ - u32 type; /* tag type */ -}; - struct mlx5e_sq { /* persistant fields */ struct mtx lock; @@ -876,7 +871,7 @@ mlx5e_sq_queue_level(struct mlx5e_sq *sq) struct mlx5e_channel { struct mlx5e_rq rq; - struct mlx5e_snd_tag tag; + struct m_snd_tag tag; struct mlx5e_sq sq[MLX5E_MAX_TX_NUM_TC]; struct mlx5e_priv *priv; struct completion completion; Modified: head/sys/dev/mlx5/mlx5_en/en_hw_tls.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en_hw_tls.h Tue Oct 6 15:17:41 2020 (r366490) +++ head/sys/dev/mlx5/mlx5_en/en_hw_tls.h Tue Oct 6 17:58:56 2020 (r366491) @@ -44,7 +44,7 @@ enum { }; struct mlx5e_tls_tag { - struct mlx5e_snd_tag tag; + struct m_snd_tag tag; STAILQ_ENTRY(mlx5e_tls_tag) entry; volatile s32 refs; /* number of pending mbufs */ uint32_t tisn; /* HW TIS context number */ Modified: head/sys/dev/mlx5/mlx5_en/en_rl.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en_rl.h Tue Oct 6 15:17:41 2020 (r366490) +++ head/sys/dev/mlx5/mlx5_en/en_rl.h Tue Oct 6 17:58:56 2020 (r366491) @@ -129,7 +129,7 @@ struct mlx5e_rl_channel_param { }; struct mlx5e_rl_channel { - struct mlx5e_snd_tag tag; + struct m_snd_tag tag; STAILQ_ENTRY(mlx5e_rl_channel) entry; struct mlx5e_sq * volatile sq; struct mlx5e_rl_worker *worker; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c Tue Oct 6 15:17:41 2020 (r366490) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c Tue Oct 6 17:58:56 2020 (r366491) @@ -303,7 +303,6 @@ mlx5e_tls_snd_tag_alloc(struct ifnet *ifp, /* setup TLS tag */ ptag->tls = &priv->tls; - ptag->tag.type = params->hdr.type; /* check if there is no TIS context */ if (ptag->tisn == 0) { @@ -378,7 +377,7 @@ mlx5e_tls_snd_tag_alloc(struct ifnet *ifp, goto failure; } - switch (ptag->tag.type) { + switch (params->hdr.type) { #if defined(RATELIMIT) && defined(IF_SND_TAG_TYPE_TLS_RATE_LIMIT) case IF_SND_TAG_TYPE_TLS_RATE_LIMIT: memset(&rl_params, 0, sizeof(rl_params)); @@ -410,9 +409,9 @@ mlx5e_tls_snd_tag_alloc(struct ifnet *ifp, } /* store pointer to mbuf tag */ - MPASS(ptag->tag.m_snd_tag.refcount == 0); - m_snd_tag_init(&ptag->tag.m_snd_tag, ifp); - *ppmt = &ptag->tag.m_snd_tag; + MPASS(ptag->tag.refcount == 0); + m_snd_tag_init(&ptag->tag, ifp, params->hdr.type); + *ppmt = &ptag->tag; queue_work(priv->tls.wq, &ptag->work); flush_work(&ptag->work); @@ -429,12 +428,12 @@ mlx5e_tls_snd_tag_modify(struct m_snd_tag *pmt, union { #if defined(RATELIMIT) && defined(IF_SND_TAG_TYPE_TLS_RATE_LIMIT) struct if_snd_tag_rate_limit_params rl_params; + struct mlx5e_tls_tag *ptag = + container_of(pmt, struct mlx5e_tls_tag, tag); int error; #endif - struct mlx5e_tls_tag *ptag = - container_of(pmt, struct mlx5e_tls_tag, tag.m_snd_tag); - switch (ptag->tag.type) { + switch (pmt->type) { #if defined(RATELIMIT) && defined(IF_SND_TAG_TYPE_TLS_RATE_LIMIT) case IF_SND_TAG_TYPE_TLS_RATE_LIMIT: memset(&rl_params, 0, sizeof(rl_params)); @@ -452,10 +451,10 @@ int mlx5e_tls_snd_tag_query(struct m_snd_tag *pmt, union if_snd_tag_query_params *params) { struct mlx5e_tls_tag *ptag = - container_of(pmt, struct mlx5e_tls_tag, tag.m_snd_tag); + container_of(pmt, struct mlx5e_tls_tag, tag); int error; - switch (ptag->tag.type) { + switch (pmt->type) { #if defined(RATELIMIT) && defined(IF_SND_TAG_TYPE_TLS_RATE_LIMIT) case IF_SND_TAG_TYPE_TLS_RATE_LIMIT: error = mlx5e_rl_snd_tag_query(ptag->rl_tag, params); @@ -475,10 +474,10 @@ void mlx5e_tls_snd_tag_free(struct m_snd_tag *pmt) { struct mlx5e_tls_tag *ptag = - container_of(pmt, struct mlx5e_tls_tag, tag.m_snd_tag); + container_of(pmt, struct mlx5e_tls_tag, tag); struct mlx5e_priv *priv; - switch (ptag->tag.type) { + switch (pmt->type) { #if defined(RATELIMIT) && defined(IF_SND_TAG_TYPE_TLS_RATE_LIMIT) case IF_SND_TAG_TYPE_TLS_RATE_LIMIT: mlx5e_rl_snd_tag_free(ptag->rl_tag); @@ -495,7 +494,7 @@ mlx5e_tls_snd_tag_free(struct m_snd_tag *pmt) ptag->state = MLX5E_TLS_ST_FREED; MLX5E_TLS_TAG_UNLOCK(ptag); - priv = ptag->tag.m_snd_tag.ifp->if_softc; + priv = ptag->tag.ifp->if_softc; queue_work(priv->tls.wq, &ptag->work); } @@ -699,7 +698,7 @@ int mlx5e_sq_tls_xmit(struct mlx5e_sq *sq, struct mlx5e_xmit_args *parg, struct mbuf **ppmb) { struct mlx5e_tls_tag *ptls_tag; - struct mlx5e_snd_tag *ptag; + struct m_snd_tag *ptag; const struct tcphdr *th; struct mbuf *mb = *ppmb; u64 rcd_sn; @@ -709,8 +708,7 @@ mlx5e_sq_tls_xmit(struct mlx5e_sq *sq, struct mlx5e_xm if ((mb->m_pkthdr.csum_flags & CSUM_SND_TAG) == 0) return (MLX5E_TLS_CONTINUE); - ptag = container_of(mb->m_pkthdr.snd_tag, - struct mlx5e_snd_tag, m_snd_tag); + ptag = mb->m_pkthdr.snd_tag; if ( #if defined(RATELIMIT) && defined(IF_SND_TAG_TYPE_TLS_RATE_LIMIT) Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue Oct 6 15:17:41 2020 (r366490) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Tue Oct 6 17:58:56 2020 (r366491) @@ -2141,8 +2141,7 @@ mlx5e_chan_static_init(struct mlx5e_priv *priv, struct c->ix = ix; /* setup send tag */ - c->tag.type = IF_SND_TAG_TYPE_UNLIMITED; - m_snd_tag_init(&c->tag.m_snd_tag, c->priv->ifp); + m_snd_tag_init(&c->tag, c->priv->ifp, IF_SND_TAG_TYPE_UNLIMITED); init_completion(&c->completion); @@ -2166,7 +2165,7 @@ static void mlx5e_chan_wait_for_completion(struct mlx5e_channel *c) { - m_snd_tag_rele(&c->tag.m_snd_tag); + m_snd_tag_rele(&c->tag); wait_for_completion(&c->completion); } @@ -4087,8 +4086,8 @@ mlx5e_ul_snd_tag_alloc(struct ifnet *ifp, /* check if send queue is not running */ if (unlikely(pch->sq[0].running == 0)) return (ENXIO); - m_snd_tag_ref(&pch->tag.m_snd_tag); - *ppmt = &pch->tag.m_snd_tag; + m_snd_tag_ref(&pch->tag); + *ppmt = &pch->tag; return (0); } } @@ -4097,7 +4096,7 @@ int mlx5e_ul_snd_tag_query(struct m_snd_tag *pmt, union if_snd_tag_query_params *params) { struct mlx5e_channel *pch = - container_of(pmt, struct mlx5e_channel, tag.m_snd_tag); + container_of(pmt, struct mlx5e_channel, tag); params->unlimited.max_rate = -1ULL; params->unlimited.queue_level = mlx5e_sq_queue_level(&pch->sq[0]); @@ -4108,7 +4107,7 @@ void mlx5e_ul_snd_tag_free(struct m_snd_tag *pmt) { struct mlx5e_channel *pch = - container_of(pmt, struct mlx5e_channel, tag.m_snd_tag); + container_of(pmt, struct mlx5e_channel, tag); complete(&pch->completion); } @@ -4142,10 +4141,8 @@ mlx5e_snd_tag_alloc(struct ifnet *ifp, static int mlx5e_snd_tag_modify(struct m_snd_tag *pmt, union if_snd_tag_modify_params *params) { - struct mlx5e_snd_tag *tag = - container_of(pmt, struct mlx5e_snd_tag, m_snd_tag); - switch (tag->type) { + switch (pmt->type) { #ifdef RATELIMIT case IF_SND_TAG_TYPE_RATE_LIMIT: return (mlx5e_rl_snd_tag_modify(pmt, params)); @@ -4166,10 +4163,8 @@ mlx5e_snd_tag_modify(struct m_snd_tag *pmt, union if_s static int mlx5e_snd_tag_query(struct m_snd_tag *pmt, union if_snd_tag_query_params *params) { - struct mlx5e_snd_tag *tag = - container_of(pmt, struct mlx5e_snd_tag, m_snd_tag); - switch (tag->type) { + switch (pmt->type) { #ifdef RATELIMIT case IF_SND_TAG_TYPE_RATE_LIMIT: return (mlx5e_rl_snd_tag_query(pmt, params)); @@ -4236,10 +4231,8 @@ mlx5e_ratelimit_query(struct ifnet *ifp __unused, stru static void mlx5e_snd_tag_free(struct m_snd_tag *pmt) { - struct mlx5e_snd_tag *tag = - container_of(pmt, struct mlx5e_snd_tag, m_snd_tag); - switch (tag->type) { + switch (pmt->type) { #ifdef RATELIMIT case IF_SND_TAG_TYPE_RATE_LIMIT: mlx5e_rl_snd_tag_free(pmt); Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c Tue Oct 6 15:17:41 2020 (r366490) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c Tue Oct 6 17:58:56 2020 (r366491) @@ -1128,9 +1128,9 @@ mlx5e_rl_snd_tag_alloc(struct ifnet *ifp, } /* store pointer to mbuf tag */ - MPASS(channel->tag.m_snd_tag.refcount == 0); - m_snd_tag_init(&channel->tag.m_snd_tag, ifp); - *ppmt = &channel->tag.m_snd_tag; + MPASS(channel->tag.refcount == 0); + m_snd_tag_init(&channel->tag, ifp, IF_SND_TAG_TYPE_RATE_LIMIT); + *ppmt = &channel->tag; done: return (error); } @@ -1140,7 +1140,7 @@ int mlx5e_rl_snd_tag_modify(struct m_snd_tag *pmt, union if_snd_tag_modify_params *params) { struct mlx5e_rl_channel *channel = - container_of(pmt, struct mlx5e_rl_channel, tag.m_snd_tag); + container_of(pmt, struct mlx5e_rl_channel, tag); return (mlx5e_rl_modify(channel->worker, channel, params->rate_limit.max_rate)); } @@ -1149,7 +1149,7 @@ int mlx5e_rl_snd_tag_query(struct m_snd_tag *pmt, union if_snd_tag_query_params *params) { struct mlx5e_rl_channel *channel = - container_of(pmt, struct mlx5e_rl_channel, tag.m_snd_tag); + container_of(pmt, struct mlx5e_rl_channel, tag); return (mlx5e_rl_query(channel->worker, channel, params)); } @@ -1158,7 +1158,7 @@ void mlx5e_rl_snd_tag_free(struct m_snd_tag *pmt) { struct mlx5e_rl_channel *channel = - container_of(pmt, struct mlx5e_rl_channel, tag.m_snd_tag); + container_of(pmt, struct mlx5e_rl_channel, tag); mlx5e_rl_free(channel->worker, channel); } Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Tue Oct 6 15:17:41 2020 (r366490) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Tue Oct 6 17:58:56 2020 (r366491) @@ -90,7 +90,6 @@ static struct mlx5e_sq * mlx5e_select_queue_by_send_tag(struct ifnet *ifp, struct mbuf *mb) { struct m_snd_tag *mb_tag; - struct mlx5e_snd_tag *ptag; struct mlx5e_sq *sq; mb_tag = mb->m_pkthdr.snd_tag; @@ -99,29 +98,27 @@ mlx5e_select_queue_by_send_tag(struct ifnet *ifp, stru top: #endif /* get pointer to sendqueue */ - ptag = container_of(mb_tag, struct mlx5e_snd_tag, m_snd_tag); - - switch (ptag->type) { + switch (mb_tag->type) { #ifdef RATELIMIT case IF_SND_TAG_TYPE_RATE_LIMIT: - sq = container_of(ptag, + sq = container_of(mb_tag, struct mlx5e_rl_channel, tag)->sq; break; #if defined(KERN_TLS) && defined(IF_SND_TAG_TYPE_TLS_RATE_LIMIT) case IF_SND_TAG_TYPE_TLS_RATE_LIMIT: - mb_tag = container_of(ptag, struct mlx5e_tls_tag, tag)->rl_tag; + mb_tag = container_of(mb_tag, struct mlx5e_tls_tag, tag)->rl_tag; goto top; #endif #endif case IF_SND_TAG_TYPE_UNLIMITED: - sq = &container_of(ptag, + sq = &container_of(mb_tag, struct mlx5e_channel, tag)->sq[0]; - KASSERT((ptag->m_snd_tag.refcount > 0), + KASSERT((mb_tag->refcount > 0), ("mlx5e_select_queue: Channel refs are zero for unlimited tag")); break; #ifdef KERN_TLS case IF_SND_TAG_TYPE_TLS: - mb_tag = container_of(ptag, struct mlx5e_tls_tag, tag)->rl_tag; + mb_tag = container_of(mb_tag, struct mlx5e_tls_tag, tag)->rl_tag; goto top; #endif default: Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Tue Oct 6 15:17:41 2020 (r366490) +++ head/sys/kern/kern_mbuf.c Tue Oct 6 17:58:56 2020 (r366491) @@ -1526,12 +1526,13 @@ m_freem(struct mbuf *mb) } void -m_snd_tag_init(struct m_snd_tag *mst, struct ifnet *ifp) +m_snd_tag_init(struct m_snd_tag *mst, struct ifnet *ifp, u_int type) { if_ref(ifp); mst->ifp = ifp; refcount_init(&mst->refcount, 1); + mst->type = type; counter_u64_add(snd_tag_count, 1); } Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Tue Oct 6 15:17:41 2020 (r366490) +++ head/sys/net/if_lagg.c Tue Oct 6 17:58:56 2020 (r366491) @@ -1686,7 +1686,7 @@ lagg_snd_tag_alloc(struct ifnet *ifp, return (error); } - m_snd_tag_init(&lst->com, ifp); + m_snd_tag_init(&lst->com, ifp, lst->tag->type); *ppmt = &lst->com; return (0); Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Tue Oct 6 15:17:41 2020 (r366490) +++ head/sys/net/if_vlan.c Tue Oct 6 17:58:56 2020 (r366491) @@ -2066,7 +2066,7 @@ vlan_snd_tag_alloc(struct ifnet *ifp, return (error); } - m_snd_tag_init(&vst->com, ifp); + m_snd_tag_init(&vst->com, ifp, vst->tag->type); *ppmt = &vst->com; return (0); Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Tue Oct 6 15:17:41 2020 (r366490) +++ head/sys/sys/mbuf.h Tue Oct 6 17:58:56 2020 (r366491) @@ -141,6 +141,7 @@ struct m_tag { struct m_snd_tag { struct ifnet *ifp; /* network interface tag belongs to */ volatile u_int refcount; + u_int type; /* One of IF_SND_TAG_TYPE_*. */ }; /* @@ -833,7 +834,7 @@ int m_sanity(struct mbuf *, int); struct mbuf *m_split(struct mbuf *, int, int); struct mbuf *m_uiotombuf(struct uio *, int, int, int, int); struct mbuf *m_unshare(struct mbuf *, int); -void m_snd_tag_init(struct m_snd_tag *, struct ifnet *); +void m_snd_tag_init(struct m_snd_tag *, struct ifnet *, u_int); void m_snd_tag_destroy(struct m_snd_tag *); static __inline int From owner-svn-src-head@freebsd.org Tue Oct 6 18: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 DFA964383B0; Tue, 6 Oct 2020 18:02: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 4C5QKj5b2Pz3Vfh; Tue, 6 Oct 2020 18:02: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 A30C8ABB0; Tue, 6 Oct 2020 18:02: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 096I2Xmq078538; Tue, 6 Oct 2020 18:02:33 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096I2XiW078537; Tue, 6 Oct 2020 18:02:33 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202010061802.096I2XiW078537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 6 Oct 2020 18:02:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366492 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 366492 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, 06 Oct 2020 18:02:33 -0000 Author: jhb Date: Tue Oct 6 18:02:33 2020 New Revision: 366492 URL: https://svnweb.freebsd.org/changeset/base/366492 Log: Check if_capenable, not if_capabilities when enabling rate limiting. if_capabilities is a read-only mask of supported capabilities. if_capenable is a mask under administrative control via ifconfig(8). Reviewed by: gallatin Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D26690 Modified: head/sys/netinet/tcp_ratelimit.c Modified: head/sys/netinet/tcp_ratelimit.c ============================================================================== --- head/sys/netinet/tcp_ratelimit.c Tue Oct 6 17:58:56 2020 (r366491) +++ head/sys/netinet/tcp_ratelimit.c Tue Oct 6 18:02:33 2020 (r366492) @@ -1137,7 +1137,7 @@ tcp_rl_ifnet_link(void *arg __unused, struct ifnet *if int error; struct tcp_rate_set *rs; - if (((ifp->if_capabilities & IFCAP_TXRTLMT) == 0) || + if (((ifp->if_capenable & IFCAP_TXRTLMT) == 0) || (link_state != LINK_STATE_UP)) { /* * We only care on an interface going up that is rate-limit @@ -1224,7 +1224,7 @@ tcp_set_pacing_rate(struct tcpcb *tp, struct ifnet *if /* * We are setting up a rate for the first time. */ - if ((ifp->if_capabilities & IFCAP_TXRTLMT) == 0) { + if ((ifp->if_capenable & IFCAP_TXRTLMT) == 0) { /* Not supported by the egress */ if (error) *error = ENODEV; From owner-svn-src-head@freebsd.org Tue Oct 6 18:07: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 6A48B43846A; Tue, 6 Oct 2020 18:07:53 +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 4C5QRs27kZz3Vr1; Tue, 6 Oct 2020 18:07:53 +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 2821EA973; Tue, 6 Oct 2020 18:07:53 +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 096I7r1W078929; Tue, 6 Oct 2020 18:07:53 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096I7riR078928; Tue, 6 Oct 2020 18:07:53 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202010061807.096I7riR078928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 6 Oct 2020 18:07:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366493 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 366493 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, 06 Oct 2020 18:07:53 -0000 Author: jhb Date: Tue Oct 6 18:07:52 2020 New Revision: 366493 URL: https://svnweb.freebsd.org/changeset/base/366493 Log: Simplify swcr_authcompute() after removal of deprecated algorithms. - Just use sw->octx != NULL to handle the HMAC case when finalizing the MAC. - Explicitly zero the on-stack auth context. Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D26688 Modified: head/sys/opencrypto/cryptosoft.c Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Tue Oct 6 18:02:33 2020 (r366492) +++ head/sys/opencrypto/cryptosoft.c Tue Oct 6 18:07:52 2020 (r366493) @@ -341,7 +341,7 @@ swcr_authcompute(struct swcr_session *ses, struct cryp err = crypto_apply(crp, crp->crp_aad_start, crp->crp_aad_length, axf->Update, &ctx); if (err) - return err; + goto out; if (CRYPTO_HAS_OUTPUT_BUFFER(crp) && CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) @@ -352,38 +352,13 @@ swcr_authcompute(struct swcr_session *ses, struct cryp err = crypto_apply(crp, crp->crp_payload_start, crp->crp_payload_length, axf->Update, &ctx); if (err) - return err; + goto out; - switch (axf->type) { - case CRYPTO_SHA1: - case CRYPTO_SHA2_224: - case CRYPTO_SHA2_256: - case CRYPTO_SHA2_384: - case CRYPTO_SHA2_512: - axf->Final(aalg, &ctx); - break; - - case CRYPTO_SHA1_HMAC: - case CRYPTO_SHA2_224_HMAC: - case CRYPTO_SHA2_256_HMAC: - case CRYPTO_SHA2_384_HMAC: - case CRYPTO_SHA2_512_HMAC: - case CRYPTO_RIPEMD160_HMAC: - if (sw->sw_octx == NULL) - return EINVAL; - - axf->Final(aalg, &ctx); + axf->Final(aalg, &ctx); + if (sw->sw_octx != NULL) { bcopy(sw->sw_octx, &ctx, axf->ctxsize); axf->Update(&ctx, aalg, axf->hashsize); axf->Final(aalg, &ctx); - break; - - case CRYPTO_BLAKE2B: - case CRYPTO_BLAKE2S: - case CRYPTO_NULL_HMAC: - case CRYPTO_POLY1305: - axf->Final(aalg, &ctx); - break; } if (crp->crp_op & CRYPTO_OP_VERIFY_DIGEST) { @@ -398,6 +373,8 @@ swcr_authcompute(struct swcr_session *ses, struct cryp crypto_copyback(crp, crp->crp_digest_start, sw->sw_mlen, aalg); } explicit_bzero(aalg, sizeof(aalg)); +out: + explicit_bzero(&ctx, sizeof(ctx)); return (err); } From owner-svn-src-head@freebsd.org Tue Oct 6 18:13: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 3DFF4438893; Tue, 6 Oct 2020 18:13: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 4C5QZ40tqNz3WXm; Tue, 6 Oct 2020 18:13: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 02359ACFE; Tue, 6 Oct 2020 18:13:16 +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 096IDFB4085167; Tue, 6 Oct 2020 18:13:15 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096IDFVT085166; Tue, 6 Oct 2020 18:13:15 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202010061813.096IDFVT085166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 6 Oct 2020 18:13:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366494 - head/sys/dev/drm2 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/drm2 X-SVN-Commit-Revision: 366494 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, 06 Oct 2020 18:13:16 -0000 Author: jhb Date: Tue Oct 6 18:13:15 2020 New Revision: 366494 URL: https://svnweb.freebsd.org/changeset/base/366494 Log: Don't permit DRM buffer mappings to be upgraded to executable. Reviewed by: kib MFC after: 1 month Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26697 Modified: head/sys/dev/drm2/drm_bufs.c Modified: head/sys/dev/drm2/drm_bufs.c ============================================================================== --- head/sys/dev/drm2/drm_bufs.c Tue Oct 6 18:07:52 2020 (r366493) +++ head/sys/dev/drm2/drm_bufs.c Tue Oct 6 18:13:15 2020 (r366494) @@ -1635,14 +1635,12 @@ int drm_mapbufs(struct drm_device *dev, void *data, goto done; } retcode = vm_mmap(&vms->vm_map, &virtual, map->size, - VM_PROT_READ | VM_PROT_WRITE, VM_PROT_ALL, - MAP_SHARED | MAP_NOSYNC, OBJT_DEVICE, - file_priv->minor->device, token); + VM_PROT_RW, VM_PROT_RW, MAP_SHARED | MAP_NOSYNC, + OBJT_DEVICE, file_priv->minor->device, token); } else { retcode = vm_mmap(&vms->vm_map, &virtual, dma->byte_count, - VM_PROT_READ | VM_PROT_WRITE, VM_PROT_ALL, - MAP_SHARED | MAP_NOSYNC, OBJT_DEVICE, - file_priv->minor->device, 0); + VM_PROT_RW, VM_PROT_RW, MAP_SHARED | MAP_NOSYNC, + OBJT_DEVICE, file_priv->minor->device, 0); } if (retcode) { /* Real error */ From owner-svn-src-head@freebsd.org Tue Oct 6 19:19: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 CA596439E2A; Tue, 6 Oct 2020 19:19:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C5S305FZtz3Zl5; Tue, 6 Oct 2020 19:19:56 +0000 (UTC) (envelope-from kp@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 979FBB547; Tue, 6 Oct 2020 19:19:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 096JJu2d022294; Tue, 6 Oct 2020 19:19:56 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096JJuJ8022293; Tue, 6 Oct 2020 19:19:56 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202010061919.096JJuJ8022293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 6 Oct 2020 19:19:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366500 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 366500 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, 06 Oct 2020 19:19:56 -0000 Author: kp Date: Tue Oct 6 19:19:56 2020 New Revision: 366500 URL: https://svnweb.freebsd.org/changeset/base/366500 Log: bridge: call member interface ioctl() without NET_EPOCH We're not allowed to hold NET_EPOCH while sleeping, so when we call ioctl() handlers for member interfaces we cannot be in NET_EPOCH. We still need some protection of our CK_LISTs, so hold BRIDGE_LOCK instead. That requires changing BRIDGE_LOCK into a sleepable lock, and separating the BRIDGE_RT_LOCK, to protect bridge_rtnode lists. That lock is taken in the data path (while in NET_EPOCH), so it cannot be a sleepable lock. While here document the locking strategy. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D26418 Modified: head/sys/net/if_bridge.c Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Tue Oct 6 19:15:11 2020 (r366499) +++ head/sys/net/if_bridge.c Tue Oct 6 19:19:56 2020 (r366500) @@ -186,17 +186,41 @@ extern void nd6_setmtu(struct ifnet *); /* * Bridge locking + * + * The bridge relies heavily on the epoch(9) system to protect its data + * structures. This means we can safely use CK_LISTs while in NET_EPOCH, but we + * must ensure there is only one writer at a time. + * + * That is: for read accesses we only need to be in NET_EPOCH, but for write + * accesses we must hold: + * + * - BRIDGE_RT_LOCK, for any change to bridge_rtnodes + * - BRIDGE_LOCK, for any other change + * + * The BRIDGE_LOCK is a sleepable lock, because it is held accross ioctl() + * calls to bridge member interfaces and these ioctl()s can sleep. + * The BRIDGE_RT_LOCK is a non-sleepable mutex, because it is sometimes + * required while we're in NET_EPOCH and then we're not allowed to sleep. */ #define BRIDGE_LOCK_INIT(_sc) do { \ - mtx_init(&(_sc)->sc_mtx, "if_bridge", NULL, MTX_DEF); \ + sx_init(&(_sc)->sc_sx, "if_bridge"); \ + mtx_init(&(_sc)->sc_rt_mtx, "if_bridge rt", NULL, MTX_DEF); \ } while (0) #define BRIDGE_LOCK_DESTROY(_sc) do { \ - mtx_destroy(&(_sc)->sc_mtx); \ + sx_destroy(&(_sc)->sc_sx); \ + mtx_destroy(&(_sc)->sc_rt_mtx); \ } while (0) -#define BRIDGE_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) -#define BRIDGE_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) -#define BRIDGE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) -#define BRIDGE_UNLOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_NOTOWNED) +#define BRIDGE_LOCK(_sc) sx_xlock(&(_sc)->sc_sx) +#define BRIDGE_UNLOCK(_sc) sx_xunlock(&(_sc)->sc_sx) +#define BRIDGE_LOCK_ASSERT(_sc) sx_assert(&(_sc)->sc_sx, SX_XLOCKED) +#define BRIDGE_LOCK_OR_NET_EPOCH_ASSERT(_sc) \ + MPASS(in_epoch(net_epoch_preempt) || sx_xlocked(&(_sc)->sc_sx)) +#define BRIDGE_UNLOCK_ASSERT(_sc) sx_assert(&(_sc)->sc_sx, SX_UNLOCKED) +#define BRIDGE_RT_LOCK(_sc) mtx_lock(&(_sc)->sc_rt_mtx) +#define BRIDGE_RT_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_rt_mtx) +#define BRIDGE_RT_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_rt_mtx, MA_OWNED) +#define BRIDGE_RT_LOCK_OR_NET_EPOCH_ASSERT(_sc) \ + MPASS(in_epoch(net_epoch_preempt) || mtx_owned(&(_sc)->sc_rt_mtx)) /* * Bridge interface list entry. @@ -235,7 +259,8 @@ struct bridge_rtnode { struct bridge_softc { struct ifnet *sc_ifp; /* make this an interface */ LIST_ENTRY(bridge_softc) sc_list; - struct mtx sc_mtx; + struct sx sc_sx; + struct mtx sc_rt_mtx; uint32_t sc_brtmax; /* max # of addresses */ uint32_t sc_brtcnt; /* cur. # of addresses */ uint32_t sc_brttimeout; /* rt timeout in seconds */ @@ -252,8 +277,8 @@ struct bridge_softc { struct epoch_context sc_epoch_ctx; }; -VNET_DEFINE_STATIC(struct mtx, bridge_list_mtx); -#define V_bridge_list_mtx VNET(bridge_list_mtx) +VNET_DEFINE_STATIC(struct sx, bridge_list_sx); +#define V_bridge_list_sx VNET(bridge_list_sx) static eventhandler_tag bridge_detach_cookie; int bridge_rtable_prune_period = BRIDGE_RTABLE_PRUNE_PERIOD; @@ -536,11 +561,11 @@ const int bridge_control_table_size = nitems(bridge_co VNET_DEFINE_STATIC(LIST_HEAD(, bridge_softc), bridge_list); #define V_bridge_list VNET(bridge_list) -#define BRIDGE_LIST_LOCK_INIT(x) mtx_init(&V_bridge_list_mtx, \ - "if_bridge list", NULL, MTX_DEF) -#define BRIDGE_LIST_LOCK_DESTROY(x) mtx_destroy(&V_bridge_list_mtx) -#define BRIDGE_LIST_LOCK(x) mtx_lock(&V_bridge_list_mtx) -#define BRIDGE_LIST_UNLOCK(x) mtx_unlock(&V_bridge_list_mtx) +#define BRIDGE_LIST_LOCK_INIT(x) sx_init(&V_bridge_list_sx, \ + "if_bridge list") +#define BRIDGE_LIST_LOCK_DESTROY(x) sx_destroy(&V_bridge_list_sx) +#define BRIDGE_LIST_LOCK(x) sx_xlock(&V_bridge_list_sx) +#define BRIDGE_LIST_UNLOCK(x) sx_xunlock(&V_bridge_list_sx) VNET_DEFINE_STATIC(struct if_clone *, bridge_cloner); #define V_bridge_cloner VNET(bridge_cloner) @@ -670,7 +695,7 @@ bridge_clone_create(struct if_clone *ifc, int unit, ca /* Initialize our routing table. */ bridge_rtable_init(sc); - callout_init_mtx(&sc->sc_brcallout, &sc->sc_mtx, 0); + callout_init_mtx(&sc->sc_brcallout, &sc->sc_rt_mtx, 0); CK_LIST_INIT(&sc->sc_iflist); CK_LIST_INIT(&sc->sc_spanlist); @@ -722,7 +747,6 @@ bridge_clone_destroy(struct ifnet *ifp) struct bridge_iflist *bif; struct epoch_tracker et; - NET_EPOCH_ENTER(et); BRIDGE_LOCK(sc); bridge_stop(ifp, 1); @@ -740,6 +764,8 @@ bridge_clone_destroy(struct ifnet *ifp) BRIDGE_UNLOCK(sc); + NET_EPOCH_ENTER(et); + callout_drain(&sc->sc_brcallout); BRIDGE_LIST_LOCK(); @@ -778,9 +804,8 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t da struct ifdrv *ifd = (struct ifdrv *) data; const struct bridge_control *bc; int error = 0, oldmtu; - struct epoch_tracker et; - NET_EPOCH_ENTER(et); + BRIDGE_LOCK(sc); switch (cmd) { case SIOCADDMULTI: @@ -826,9 +851,7 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t da } oldmtu = ifp->if_mtu; - BRIDGE_LOCK(sc); error = (*bc->bc_func)(sc, &args); - BRIDGE_UNLOCK(sc); if (error) break; @@ -855,16 +878,16 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t da * If interface is marked down and it is running, * then stop and disable it. */ - BRIDGE_LOCK(sc); bridge_stop(ifp, 1); - BRIDGE_UNLOCK(sc); } else if ((ifp->if_flags & IFF_UP) && !(ifp->if_drv_flags & IFF_DRV_RUNNING)) { /* * If interface is marked up and it is stopped, then * start it. */ + BRIDGE_UNLOCK(sc); (*ifp->if_init)(sc); + BRIDGE_LOCK(sc); } break; @@ -877,7 +900,6 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t da sc->sc_ifp->if_mtu = ifr->ifr_mtu; break; } - BRIDGE_LOCK(sc); CK_LIST_FOREACH(bif, &sc->sc_iflist, bif_next) { if (bif->bif_ifp->if_mtu != ifr->ifr_mtu) { log(LOG_NOTICE, "%s: invalid MTU: %u(%s)" @@ -890,18 +912,19 @@ bridge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t da } if (!error) sc->sc_ifp->if_mtu = ifr->ifr_mtu; - BRIDGE_UNLOCK(sc); break; default: /* * drop the lock as ether_ioctl() will call bridge_start() and * cause the lock to be recursed. */ + BRIDGE_UNLOCK(sc); error = ether_ioctl(ifp, cmd, data); + BRIDGE_LOCK(sc); break; } - NET_EPOCH_EXIT(et); + BRIDGE_UNLOCK(sc); return (error); } @@ -933,9 +956,7 @@ bridge_mutecaps(struct bridge_softc *sc) /* strip off mask bits and enable them again if allowed */ enabled &= ~BRIDGE_IFCAPS_MASK; enabled |= mask; - BRIDGE_UNLOCK(sc); bridge_set_ifcap(sc, bif, enabled); - BRIDGE_LOCK(sc); } } @@ -946,8 +967,6 @@ bridge_set_ifcap(struct bridge_softc *sc, struct bridg struct ifreq ifr; int error, mask, stuck; - BRIDGE_UNLOCK_ASSERT(sc); - bzero(&ifr, sizeof(ifr)); ifr.ifr_reqcap = set; @@ -977,7 +996,7 @@ bridge_lookup_member(struct bridge_softc *sc, const ch struct bridge_iflist *bif; struct ifnet *ifp; - NET_EPOCH_ASSERT(); + BRIDGE_LOCK_OR_NET_EPOCH_ASSERT(sc); CK_LIST_FOREACH(bif, &sc->sc_iflist, bif_next) { ifp = bif->bif_ifp; @@ -998,7 +1017,7 @@ bridge_lookup_member_if(struct bridge_softc *sc, struc { struct bridge_iflist *bif; - NET_EPOCH_ASSERT(); + BRIDGE_LOCK_OR_NET_EPOCH_ASSERT(sc); CK_LIST_FOREACH(bif, &sc->sc_iflist, bif_next) { if (bif->bif_ifp == member_ifp) @@ -1061,14 +1080,15 @@ bridge_delete_member(struct bridge_softc *sc, struct b bridge_linkcheck(sc); bridge_mutecaps(sc); /* recalcuate now this interface is removed */ + BRIDGE_RT_LOCK(sc); bridge_rtdelete(sc, ifs, IFBF_FLUSHALL); + BRIDGE_RT_UNLOCK(sc); KASSERT(bif->bif_addrcnt == 0, ("%s: %d bridge routes referenced", __func__, bif->bif_addrcnt)); ifs->if_bridge_output = NULL; ifs->if_bridge_input = NULL; ifs->if_bridge_linkstate = NULL; - BRIDGE_UNLOCK(sc); if (!gone) { switch (ifs->if_type) { case IFT_ETHER: @@ -1095,7 +1115,6 @@ bridge_delete_member(struct bridge_softc *sc, struct b bridge_set_ifcap(sc, bif, bif->bif_savedcaps); } bstp_destroy(&bif->bif_stp); /* prepare to free */ - BRIDGE_LOCK(sc); NET_EPOCH_CALL(bridge_delete_member_cb, &bif->bif_epoch_ctx); } @@ -1173,9 +1192,7 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg) */ CK_LIST_FOREACH(bif, &sc->sc_iflist, bif_next) { if (in6ifa_llaonifp(bif->bif_ifp)) { - BRIDGE_UNLOCK(sc); in6_ifdetach(bif->bif_ifp); - BRIDGE_LOCK(sc); if_printf(sc->sc_ifp, "IPv6 addresses on %s have been removed " "before adding it as a member to prevent " @@ -1184,9 +1201,7 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg) } } if (in6ifa_llaonifp(ifs)) { - BRIDGE_UNLOCK(sc); in6_ifdetach(ifs); - BRIDGE_LOCK(sc); if_printf(sc->sc_ifp, "IPv6 addresses on %s have been removed " "before adding it as a member to prevent " @@ -1244,9 +1259,7 @@ bridge_ioctl_add(struct bridge_softc *sc, void *arg) switch (ifs->if_type) { case IFT_ETHER: case IFT_L2VLAN: - BRIDGE_UNLOCK(sc); error = ifpromisc(ifs, 1); - BRIDGE_LOCK(sc); break; } @@ -1428,10 +1441,8 @@ bridge_ioctl_gifs(struct bridge_softc *sc, void *arg) len -= sizeof(breq); } - BRIDGE_UNLOCK(sc); bifc->ifbic_len = sizeof(breq) * count; error = copyout(outbuf, bifc->ifbic_req, bifc->ifbic_len); - BRIDGE_LOCK(sc); free(outbuf, M_TEMP); return (error); } @@ -1481,10 +1492,8 @@ bridge_ioctl_rts(struct bridge_softc *sc, void *arg) len -= sizeof(bareq); } out: - BRIDGE_UNLOCK(sc); bac->ifbac_len = sizeof(bareq) * count; error = copyout(outbuf, bac->ifbac_req, bac->ifbac_len); - BRIDGE_LOCK(sc); free(outbuf, M_TEMP); return (error); } @@ -1494,19 +1503,20 @@ bridge_ioctl_saddr(struct bridge_softc *sc, void *arg) { struct ifbareq *req = arg; struct bridge_iflist *bif; + struct epoch_tracker et; int error; - NET_EPOCH_ASSERT(); - + NET_EPOCH_ENTER(et); bif = bridge_lookup_member(sc, req->ifba_ifsname); - if (bif == NULL) + if (bif == NULL) { + NET_EPOCH_EXIT(et); return (ENOENT); + } /* bridge_rtupdate() may acquire the lock. */ - BRIDGE_UNLOCK(sc); error = bridge_rtupdate(sc, req->ifba_dst, req->ifba_vlan, bif, 1, req->ifba_flags); - BRIDGE_LOCK(sc); + NET_EPOCH_EXIT(et); return (error); } @@ -1542,7 +1552,10 @@ bridge_ioctl_flush(struct bridge_softc *sc, void *arg) { struct ifbreq *req = arg; + BRIDGE_RT_LOCK(sc); bridge_rtflush(sc, req->ifbr_ifsflags); + BRIDGE_RT_UNLOCK(sc); + return (0); } @@ -1810,10 +1823,8 @@ bridge_ioctl_gifsstp(struct bridge_softc *sc, void *ar len -= sizeof(bpreq); } - BRIDGE_UNLOCK(sc); bifstp->ifbpstp_len = sizeof(bpreq) * count; error = copyout(outbuf, bifstp->ifbpstp_req, bifstp->ifbpstp_len); - BRIDGE_LOCK(sc); free(outbuf, M_TEMP); return (error); } @@ -1845,7 +1856,6 @@ bridge_ifdetach(void *arg __unused, struct ifnet *ifp) { struct bridge_softc *sc = ifp->if_bridge; struct bridge_iflist *bif; - struct epoch_tracker et; if (ifp->if_flags & IFF_RENAMING) return; @@ -1856,7 +1866,6 @@ bridge_ifdetach(void *arg __unused, struct ifnet *ifp) */ return; } - NET_EPOCH_ENTER(et); /* Check if the interface is a bridge member */ if (sc != NULL) { BRIDGE_LOCK(sc); @@ -1866,7 +1875,6 @@ bridge_ifdetach(void *arg __unused, struct ifnet *ifp) bridge_delete_member(sc, bif, 1); BRIDGE_UNLOCK(sc); - NET_EPOCH_EXIT(et); return; } @@ -1883,7 +1891,6 @@ bridge_ifdetach(void *arg __unused, struct ifnet *ifp) BRIDGE_UNLOCK(sc); } BRIDGE_LIST_UNLOCK(); - NET_EPOCH_EXIT(et); } /* @@ -1920,16 +1927,18 @@ bridge_stop(struct ifnet *ifp, int disable) { struct bridge_softc *sc = ifp->if_softc; - NET_EPOCH_ASSERT(); BRIDGE_LOCK_ASSERT(sc); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; + BRIDGE_RT_LOCK(sc); callout_stop(&sc->sc_brcallout); + bstp_stop(&sc->sc_stp); bridge_rtflush(sc, IFBF_FLUSHDYN); + BRIDGE_RT_UNLOCK(sc); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; } @@ -2659,8 +2668,7 @@ bridge_rtupdate(struct bridge_softc *sc, const uint8_t struct bridge_rtnode *brt; int error; - NET_EPOCH_ASSERT(); - BRIDGE_UNLOCK_ASSERT(sc); + BRIDGE_LOCK_OR_NET_EPOCH_ASSERT(sc); /* Check the source address is valid and not multicast. */ if (ETHER_IS_MULTICAST(dst) || @@ -2677,24 +2685,24 @@ bridge_rtupdate(struct bridge_softc *sc, const uint8_t * update it, otherwise create a new one. */ if ((brt = bridge_rtnode_lookup(sc, dst, vlan)) == NULL) { - BRIDGE_LOCK(sc); + BRIDGE_RT_LOCK(sc); /* Check again, now that we have the lock. There could have * been a race and we only want to insert this once. */ if ((brt = bridge_rtnode_lookup(sc, dst, vlan)) != NULL) { - BRIDGE_UNLOCK(sc); + BRIDGE_RT_UNLOCK(sc); return (0); } if (sc->sc_brtcnt >= sc->sc_brtmax) { sc->sc_brtexceeded++; - BRIDGE_UNLOCK(sc); + BRIDGE_RT_UNLOCK(sc); return (ENOSPC); } /* Check per interface address limits (if enabled) */ if (bif->bif_addrmax && bif->bif_addrcnt >= bif->bif_addrmax) { bif->bif_addrexceeded++; - BRIDGE_UNLOCK(sc); + BRIDGE_RT_UNLOCK(sc); return (ENOSPC); } @@ -2705,7 +2713,7 @@ bridge_rtupdate(struct bridge_softc *sc, const uint8_t */ brt = uma_zalloc(V_bridge_rtnode_zone, M_NOWAIT | M_ZERO); if (brt == NULL) { - BRIDGE_UNLOCK(sc); + BRIDGE_RT_UNLOCK(sc); return (ENOMEM); } brt->brt_vnet = curvnet; @@ -2720,22 +2728,22 @@ bridge_rtupdate(struct bridge_softc *sc, const uint8_t if ((error = bridge_rtnode_insert(sc, brt)) != 0) { uma_zfree(V_bridge_rtnode_zone, brt); - BRIDGE_UNLOCK(sc); + BRIDGE_RT_UNLOCK(sc); return (error); } brt->brt_dst = bif; bif->bif_addrcnt++; - BRIDGE_UNLOCK(sc); + BRIDGE_RT_UNLOCK(sc); } if ((brt->brt_flags & IFBAF_TYPEMASK) == IFBAF_DYNAMIC && brt->brt_dst != bif) { - BRIDGE_LOCK(sc); + BRIDGE_RT_LOCK(sc); brt->brt_dst->bif_addrcnt--; brt->brt_dst = bif; brt->brt_dst->bif_addrcnt++; - BRIDGE_UNLOCK(sc); + BRIDGE_RT_UNLOCK(sc); } if ((flags & IFBAF_TYPEMASK) == IFBAF_DYNAMIC) @@ -2777,7 +2785,7 @@ bridge_rttrim(struct bridge_softc *sc) struct bridge_rtnode *brt, *nbrt; NET_EPOCH_ASSERT(); - BRIDGE_LOCK_ASSERT(sc); + BRIDGE_RT_LOCK_ASSERT(sc); /* Make sure we actually need to do this. */ if (sc->sc_brtcnt <= sc->sc_brtmax) @@ -2806,10 +2814,8 @@ static void bridge_timer(void *arg) { struct bridge_softc *sc = arg; - struct epoch_tracker et; - NET_EPOCH_ENTER(et); - BRIDGE_LOCK_ASSERT(sc); + BRIDGE_RT_LOCK_ASSERT(sc); /* Destruction of rtnodes requires a proper vnet context */ CURVNET_SET(sc->sc_ifp->if_vnet); @@ -2819,7 +2825,6 @@ bridge_timer(void *arg) callout_reset(&sc->sc_brcallout, bridge_rtable_prune_period * hz, bridge_timer, sc); CURVNET_RESTORE(); - NET_EPOCH_EXIT(et); } /* @@ -2832,8 +2837,7 @@ bridge_rtage(struct bridge_softc *sc) { struct bridge_rtnode *brt, *nbrt; - NET_EPOCH_ASSERT(); - BRIDGE_LOCK_ASSERT(sc); + BRIDGE_RT_LOCK_ASSERT(sc); CK_LIST_FOREACH_SAFE(brt, &sc->sc_rtlist, brt_list, nbrt) { if ((brt->brt_flags & IFBAF_TYPEMASK) == IFBAF_DYNAMIC) { @@ -2853,8 +2857,7 @@ bridge_rtflush(struct bridge_softc *sc, int full) { struct bridge_rtnode *brt, *nbrt; - NET_EPOCH_ASSERT(); - BRIDGE_LOCK_ASSERT(sc); + BRIDGE_RT_LOCK_ASSERT(sc); CK_LIST_FOREACH_SAFE(brt, &sc->sc_rtlist, brt_list, nbrt) { if (full || (brt->brt_flags & IFBAF_TYPEMASK) == IFBAF_DYNAMIC) @@ -2873,8 +2876,7 @@ bridge_rtdaddr(struct bridge_softc *sc, const uint8_t struct bridge_rtnode *brt; int found = 0; - NET_EPOCH_ASSERT(); - BRIDGE_LOCK_ASSERT(sc); + BRIDGE_RT_LOCK(sc); /* * If vlan is zero then we want to delete for all vlans so the lookup @@ -2885,6 +2887,8 @@ bridge_rtdaddr(struct bridge_softc *sc, const uint8_t found = 1; } + BRIDGE_RT_UNLOCK(sc); + return (found ? 0 : ENOENT); } @@ -2898,8 +2902,7 @@ bridge_rtdelete(struct bridge_softc *sc, struct ifnet { struct bridge_rtnode *brt, *nbrt; - NET_EPOCH_ASSERT(); - BRIDGE_LOCK_ASSERT(sc); + BRIDGE_RT_LOCK_ASSERT(sc); CK_LIST_FOREACH_SAFE(brt, &sc->sc_rtlist, brt_list, nbrt) { if (brt->brt_ifp == ifp && (full || @@ -3003,7 +3006,7 @@ bridge_rtnode_lookup(struct bridge_softc *sc, const ui uint32_t hash; int dir; - NET_EPOCH_ASSERT(); + BRIDGE_RT_LOCK_OR_NET_EPOCH_ASSERT(sc); hash = bridge_rthash(sc, addr); CK_LIST_FOREACH(brt, &sc->sc_rthash[hash], brt_hash) { @@ -3030,7 +3033,7 @@ bridge_rtnode_insert(struct bridge_softc *sc, struct b uint32_t hash; int dir; - BRIDGE_LOCK_ASSERT(sc); + BRIDGE_RT_LOCK_ASSERT(sc); hash = bridge_rthash(sc, brt->brt_addr); @@ -3086,8 +3089,7 @@ bridge_rtnode_destroy_cb(struct epoch_context *ctx) static void bridge_rtnode_destroy(struct bridge_softc *sc, struct bridge_rtnode *brt) { - NET_EPOCH_ASSERT(); - BRIDGE_LOCK_ASSERT(sc); + BRIDGE_RT_LOCK_ASSERT(sc); CK_LIST_REMOVE(brt, brt_hash); @@ -3108,11 +3110,9 @@ bridge_rtable_expire(struct ifnet *ifp, int age) { struct bridge_softc *sc = ifp->if_bridge; struct bridge_rtnode *brt; - struct epoch_tracker et; - NET_EPOCH_ENTER(et); CURVNET_SET(ifp->if_vnet); - BRIDGE_LOCK(sc); + BRIDGE_RT_LOCK(sc); /* * If the age is zero then flush, otherwise set all the expiry times to @@ -3129,9 +3129,8 @@ bridge_rtable_expire(struct ifnet *ifp, int age) brt->brt_expire = time_uptime + age; } } - BRIDGE_UNLOCK(sc); + BRIDGE_RT_UNLOCK(sc); CURVNET_RESTORE(); - NET_EPOCH_EXIT(et); } /* @@ -3659,7 +3658,7 @@ bridge_linkcheck(struct bridge_softc *sc) struct bridge_iflist *bif; int new_link, hasls; - NET_EPOCH_ASSERT(); + BRIDGE_LOCK_OR_NET_EPOCH_ASSERT(sc); new_link = LINK_STATE_DOWN; hasls = 0; From owner-svn-src-head@freebsd.org Tue Oct 6 21:31: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 A753543C0DB; Tue, 6 Oct 2020 21:31:05 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C5VyK3pTtz3y19; Tue, 6 Oct 2020 21:31:05 +0000 (UTC) (envelope-from pfg@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 66BA0D0BC; Tue, 6 Oct 2020 21:31:05 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 096LV5gx002513; Tue, 6 Oct 2020 21:31:05 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096LV56E002512; Tue, 6 Oct 2020 21:31:05 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <202010062131.096LV56E002512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 6 Oct 2020 21:31:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366501 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 366501 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, 06 Oct 2020 21:31:05 -0000 Author: pfg Date: Tue Oct 6 21:31:04 2020 New Revision: 366501 URL: https://svnweb.freebsd.org/changeset/base/366501 Log: ext2fs: minor typo. Obtained from: Dragonfly MFC after: 3 days Modified: head/sys/fs/ext2fs/ext2_alloc.c Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Tue Oct 6 19:19:56 2020 (r366500) +++ head/sys/fs/ext2fs/ext2_alloc.c Tue Oct 6 21:31:04 2020 (r366501) @@ -193,7 +193,7 @@ static SYSCTL_NODE(_vfs, OID_AUTO, ext2fs, CTLFLAG_RW static int doasyncfree = 1; SYSCTL_INT(_vfs_ext2fs, OID_AUTO, doasyncfree, CTLFLAG_RW, &doasyncfree, 0, - "Use asychronous writes to update block pointers when freeing blocks"); + "Use asynchronous writes to update block pointers when freeing blocks"); static int doreallocblks = 0; From owner-svn-src-head@freebsd.org Tue Oct 6 22:53: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 5432143D8B0; Tue, 6 Oct 2020 22:53:12 +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 4C5Xn41Rc1z43cX; Tue, 6 Oct 2020 22:53:12 +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 14DADDF4D; Tue, 6 Oct 2020 22:53:12 +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 096MrBxp057759; Tue, 6 Oct 2020 22:53:11 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096MrBUO057758; Tue, 6 Oct 2020 22:53:11 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <202010062253.096MrBUO057758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Tue, 6 Oct 2020 22:53:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366502 - head/share/man/man8 X-SVN-Group: head X-SVN-Commit-Author: jmg X-SVN-Commit-Paths: head/share/man/man8 X-SVN-Commit-Revision: 366502 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, 06 Oct 2020 22:53:12 -0000 Author: jmg Date: Tue Oct 6 22:53:11 2020 New Revision: 366502 URL: https://svnweb.freebsd.org/changeset/base/366502 Log: add the FILESYSTEMS placeholder and note that it's the default early_late_divider Modified: head/share/man/man8/rc.8 Modified: head/share/man/man8/rc.8 ============================================================================== --- head/share/man/man8/rc.8 Tue Oct 6 21:31:04 2020 (r366501) +++ head/share/man/man8/rc.8 Tue Oct 6 22:53:11 2020 (r366502) @@ -31,7 +31,7 @@ .\" @(#)rc.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd September 6, 2019 +.Dd October 6, 2020 .Dt RC 8 .Os .Sh NAME @@ -242,7 +242,11 @@ Scripts that are .Dq placeholders to ensure that certain operations are performed before others. In order of startup, these are: -.Bl -tag -width ".Pa NETWORKING" +.Bl -tag -width ".Pa FILESYSTEMS" +.It Pa FILESYSTEMS +Ensure that root and other critical file systems are mounted. +This is the default +.Va $early_late_divider . .It Pa NETWORKING Ensure basic network services are running, including general network configuration. From owner-svn-src-head@freebsd.org Tue Oct 6 23:16: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 0B0C843DF97; Tue, 6 Oct 2020 23:16:58 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C5YJT6Wcpz44fG; Tue, 6 Oct 2020 23:16:57 +0000 (UTC) (envelope-from mhorne@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 C2D14E64A; Tue, 6 Oct 2020 23:16:57 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 096NGveF070654; Tue, 6 Oct 2020 23:16:57 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096NGvnW070651; Tue, 6 Oct 2020 23:16:57 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202010062316.096NGvnW070651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Tue, 6 Oct 2020 23:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366503 - in head/sys: kern sys x86/x86 X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in head/sys: kern sys x86/x86 X-SVN-Commit-Revision: 366503 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, 06 Oct 2020 23:16:58 -0000 Author: mhorne Date: Tue Oct 6 23:16:56 2020 New Revision: 366503 URL: https://svnweb.freebsd.org/changeset/base/366503 Log: Remove unused function cpu_boot() The prototype was added with the creation of kern_shutdown.c in r17658, but it appears to have never been implemented. Remove it now. Reviewed by: cem, kib Differential Revision: https://reviews.freebsd.org/D26702 Modified: head/sys/kern/kern_shutdown.c head/sys/sys/systm.h head/sys/x86/x86/cpu_machdep.c Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Tue Oct 6 22:53:11 2020 (r366502) +++ head/sys/kern/kern_shutdown.c Tue Oct 6 23:16:56 2020 (r366503) @@ -668,7 +668,6 @@ shutdown_reset(void *junk, int howto) spinlock_enter(); #endif - /* cpu_boot(howto); */ /* doesn't do anything at the moment */ cpu_reset(); /* NOTREACHED */ /* assuming reset worked */ } Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Tue Oct 6 22:53:11 2020 (r366502) +++ head/sys/sys/systm.h Tue Oct 6 23:16:56 2020 (r366503) @@ -268,7 +268,6 @@ void *phashinit_flags(int count, struct malloc_type *t int flags); void g_waitidle(void); -void cpu_boot(int); void cpu_flush_dcache(void *, size_t); void cpu_rootconf(void); void critical_enter_KBI(void); Modified: head/sys/x86/x86/cpu_machdep.c ============================================================================== --- head/sys/x86/x86/cpu_machdep.c Tue Oct 6 22:53:11 2020 (r366502) +++ head/sys/x86/x86/cpu_machdep.c Tue Oct 6 23:16:56 2020 (r366503) @@ -194,17 +194,6 @@ SYSCTL_BOOL(_machdep, OID_AUTO, mwait_cpustop_broken, "Can not reliably wake MONITOR/MWAIT cpus without interrupts"); /* - * Machine dependent boot() routine - * - * I haven't seen anything to put here yet - * Possibly some stuff might be grafted back here from boot() - */ -void -cpu_boot(int howto) -{ -} - -/* * Flush the D-cache for non-DMA I/O so that the I-cache can * be made coherent later. */ From owner-svn-src-head@freebsd.org Tue Oct 6 23:33: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 067C243E043; Tue, 6 Oct 2020 23:33:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C5Yh46P4Zz45Cs; Tue, 6 Oct 2020 23:33:56 +0000 (UTC) (envelope-from imp@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 BED25EA21; Tue, 6 Oct 2020 23:33:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 096NXuaq082758; Tue, 6 Oct 2020 23:33:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096NXuVp082757; Tue, 6 Oct 2020 23:33:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010062333.096NXuVp082757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 6 Oct 2020 23:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366504 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 366504 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, 06 Oct 2020 23:33:57 -0000 Author: imp Date: Tue Oct 6 23:33:56 2020 New Revision: 366504 URL: https://svnweb.freebsd.org/changeset/base/366504 Log: cam: Assert we have a reference when freeing sim Before we decrement refcount to sleep on the sim, assert that the refcount >= 1. If it were 0 here, we'd never wake up. Modified: head/sys/cam/cam_sim.c Modified: head/sys/cam/cam_sim.c ============================================================================== --- head/sys/cam/cam_sim.c Tue Oct 6 23:16:56 2020 (r366503) +++ head/sys/cam/cam_sim.c Tue Oct 6 23:33:56 2020 (r366504) @@ -134,6 +134,7 @@ cam_sim_free(struct cam_sim *sim, int free_devq) mtx = sim->mtx; mtx_assert(mtx, MA_OWNED); } + KASSERT(sim->refcount >= 1, ("sim->refcount >= 1")); sim->refcount--; if (sim->refcount > 0) { error = msleep(sim, mtx, PRIBIO, "simfree", 0); From owner-svn-src-head@freebsd.org Tue Oct 6 23:35: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 BBB1F43DE7F; Tue, 6 Oct 2020 23:35:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C5Yjp4bKxz45Vq; Tue, 6 Oct 2020 23:35:26 +0000 (UTC) (envelope-from imp@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 81016E4C5; Tue, 6 Oct 2020 23:35:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 096NZQaQ082893; Tue, 6 Oct 2020 23:35:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 096NZQmE082892; Tue, 6 Oct 2020 23:35:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010062335.096NZQmE082892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 6 Oct 2020 23:35:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366505 - head/sys/cam/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/nvme X-SVN-Commit-Revision: 366505 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, 06 Oct 2020 23:35:26 -0000 Author: imp Date: Tue Oct 6 23:35:26 2020 New Revision: 366505 URL: https://svnweb.freebsd.org/changeset/base/366505 Log: nvme: Note where the CCB was released for passthrough command Modified: head/sys/cam/nvme/nvme_da.c Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Tue Oct 6 23:33:56 2020 (r366504) +++ head/sys/cam/nvme/nvme_da.c Tue Oct 6 23:35:26 2020 (r366505) @@ -1257,6 +1257,7 @@ ndadone(struct cam_periph *periph, union ccb *done_ccb /* No-op. We're polling */ return; case NDA_CCB_PASS: + /* NVME_PASSTHROUGH_CMD runs this CCB and releases it */ return; default: break; From owner-svn-src-head@freebsd.org Wed Oct 7 05:36: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 447FF3FC121; Wed, 7 Oct 2020 05:36:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C5jjy159Yz4M83; Wed, 7 Oct 2020 05:36:06 +0000 (UTC) (envelope-from imp@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 09DAC12C2C; Wed, 7 Oct 2020 05:36:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0975a5kP003737; Wed, 7 Oct 2020 05:36:05 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0975a5Hg003736; Wed, 7 Oct 2020 05:36:05 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010070536.0975a5Hg003736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 7 Oct 2020 05:36:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366506 - head/sbin/nvmecontrol/modules/wdc X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/nvmecontrol/modules/wdc X-SVN-Commit-Revision: 366506 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, 07 Oct 2020 05:36:06 -0000 Author: imp Date: Wed Oct 7 05:36:05 2020 New Revision: 366506 URL: https://svnweb.freebsd.org/changeset/base/366506 Log: nvmecontrol: Update wdc module for newer WDC NVMe products Update the to log fetch operation for latest WDC NVMe products. Tested on HGST SN100 (a few years old) and WDC SN720 (more recent). Submitted by: Akhilesh Rn (minor style tweak by me) Github PR: 435 Modified: head/sbin/nvmecontrol/modules/wdc/wdc.c Modified: head/sbin/nvmecontrol/modules/wdc/wdc.c ============================================================================== --- head/sbin/nvmecontrol/modules/wdc/wdc.c Tue Oct 6 23:35:26 2020 (r366505) +++ head/sbin/nvmecontrol/modules/wdc/wdc.c Wed Oct 7 05:36:05 2020 (r366506) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "nvmecontrol.h" @@ -61,14 +62,18 @@ static struct options { const char *template; const char *dev; + uint8_t data_area; } opt = { .template = NULL, .dev = NULL, + .data_area = 0, }; static const struct opts opts[] = { OPT("template", 'o', arg_string, opt, template, "Template for paths to use for different logs"), + OPT("data-area", 'd', arg_uint8, opt, data_area, + "Data-area to retrieve up to"), OPT_END }; @@ -88,11 +93,27 @@ static struct cmd cap_diag_cmd = { CMD_SUBCOMMAND(wdc_cmd, cap_diag_cmd); -#define WDC_NVME_TOC_SIZE 8 +#define WDC_NVME_VID 0x1c58 +#define WDC_NVME_VID_2 0x1b96 +#define WDC_NVME_VID_3 0x15b7 -#define WDC_NVME_CAP_DIAG_OPCODE 0xe6 -#define WDC_NVME_CAP_DIAG_CMD 0x0000 +#define WDC_NVME_TOC_SIZE 0x8 +#define WDC_NVME_LOG_SIZE_HDR_LEN 0x8 +#define WDC_NVME_CAP_DIAG_OPCODE_E6 0xe6 +#define WDC_NVME_CAP_DIAG_CMD 0x0000 +#define WDC_NVME_CAP_DIAG_OPCODE_FA 0xfa +#define WDC_NVME_DUI_MAX_SECTIONS_V0 0x3c +#define WDC_NVME_DUI_MAX_SECTIONS_V1 0x3a +#define WDC_NVME_DUI_MAX_SECTIONS_V2 0x26 +#define WDC_NVME_DUI_MAX_SECTIONS_V3 0x23 +typedef enum wdc_dui_header { + WDC_DUI_HEADER_VER_0 = 0, + WDC_DUI_HEADER_VER_1, + WDC_DUI_HEADER_VER_2, + WDC_DUI_HEADER_VER_3, +} wdc_dui_header; + static void wdc_append_serial_name(int fd, char *buf, size_t len, const char *suffix) { @@ -108,25 +129,26 @@ wdc_append_serial_name(int fd, char *buf, size_t len, while (walker > sn && *walker == ' ') walker--; *++walker = '\0'; - snprintf(buf, len, "%s%s.bin", sn, suffix); + snprintf(buf, len, "_%s_%s.bin", sn, suffix); } static void wdc_get_data(int fd, uint32_t opcode, uint32_t len, uint32_t off, uint32_t cmd, - uint8_t *buffer, size_t buflen) + uint8_t *buffer, size_t buflen, bool e6lg_flag) { struct nvme_pt_command pt; memset(&pt, 0, sizeof(pt)); pt.cmd.opc = opcode; - pt.cmd.cdw10 = htole32(len / sizeof(uint32_t)); /* - 1 like all the others ??? */ - pt.cmd.cdw11 = htole32(off / sizeof(uint32_t)); + pt.cmd.cdw10 = htole32(len / sizeof(uint32_t)); pt.cmd.cdw12 = htole32(cmd); + if (e6lg_flag) + pt.cmd.cdw11 = htole32(off / sizeof(uint32_t)); + else + pt.cmd.cdw13 = htole32(off / sizeof(uint32_t)); pt.buf = buffer; pt.len = buflen; pt.is_read = 1; -// printf("opcode %#x cdw10(len) %#x cdw11(offset?) %#x cdw12(cmd/sub) %#x buflen %zd\n", -// (int)opcode, (int)cdw10, (int)cdw11, (int)cdw12, buflen); if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) err(1, "wdc_get_data request failed"); @@ -135,17 +157,29 @@ wdc_get_data(int fd, uint32_t opcode, uint32_t len, ui } static void -wdc_do_dump(int fd, char *tmpl, const char *suffix, uint32_t opcode, +wdc_do_dump_e6(int fd, char *tmpl, const char *suffix, uint32_t opcode, uint32_t cmd, int len_off) { int first; int fd2; - uint8_t *buf; + uint8_t *buf, *hdr; uint32_t len, offset; size_t resid; + bool e6lg_flag = false; wdc_append_serial_name(fd, tmpl, MAXPATHLEN, suffix); + /* Read Log Dump header */ + len = WDC_NVME_LOG_SIZE_HDR_LEN; + offset = 0; + hdr = malloc(len); + if (hdr == NULL) + errx(1, "Can't get buffer to read dump"); + wdc_get_data(fd, opcode, len, offset, cmd, hdr, len, false); + if (memcmp("E6LG", hdr, 4) == 0) { + e6lg_flag = true; + } + /* XXX overwrite protection? */ fd2 = open(tmpl, O_WRONLY | O_CREAT | O_TRUNC, 0644); if (fd2 < 0) @@ -159,15 +193,13 @@ wdc_do_dump(int fd, char *tmpl, const char *suffix, ui do { resid = len > NVME_MAX_XFER_SIZE ? NVME_MAX_XFER_SIZE : len; - wdc_get_data(fd, opcode, resid, offset, cmd, buf, resid); + wdc_get_data(fd, opcode, resid, offset, cmd, buf, resid, e6lg_flag); if (first) { len = be32dec(buf + len_off); if (len == 0) errx(1, "No data for %s", suffix); - if (memcmp("E6LG", buf, 4) != 0) - printf("Expected header of E6LG, found '%4.4s' instead\n", - buf); + printf("Dumping %d bytes of version %d.%d log to %s\n", len, buf[8], buf[9], tmpl); /* @@ -184,15 +216,153 @@ wdc_do_dump(int fd, char *tmpl, const char *suffix, ui offset += resid; len -= resid; } while (len > 0); + free(hdr); free(buf); close(fd2); } static void +wdc_get_data_dui(int fd, uint32_t opcode, uint32_t len, uint64_t off, + uint8_t *buffer, size_t buflen) +{ + struct nvme_pt_command pt; + + memset(&pt, 0, sizeof(pt)); + pt.cmd.opc = opcode; + pt.cmd.nsid = NONE; + pt.cmd.cdw10 = htole32((len / sizeof(uint32_t)) - 1) ; + pt.cmd.cdw12 = htole32(off & 0xFFFFFFFFu); + pt.cmd.cdw13 = htole32(off >> 32); + pt.buf = buffer; + pt.len = buflen; + pt.is_read = 1; + + if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) + err(1, "wdc_get_data_dui request failed"); + if (nvme_completion_is_error(&pt.cpl)) + errx(1, "wdc_get_data_dui request returned error"); +} + +static uint8_t +wdc_get_dui_max_sections(uint16_t header_ver) +{ + switch (header_ver) { + case WDC_DUI_HEADER_VER_0: + return WDC_NVME_DUI_MAX_SECTIONS_V0; + case WDC_DUI_HEADER_VER_1: + return WDC_NVME_DUI_MAX_SECTIONS_V1; + case WDC_DUI_HEADER_VER_2: + return WDC_NVME_DUI_MAX_SECTIONS_V2; + case WDC_DUI_HEADER_VER_3: + return WDC_NVME_DUI_MAX_SECTIONS_V3; + } + return 0; +} + +static void +wdc_get_dui_log_size(int fd, uint32_t opcode, uint8_t data_area, + uint64_t *log_size, int len_off) +{ + uint8_t *hdr; + uint8_t max_sections; + int i, j; + uint16_t hdr_ver; + uint16_t len; + uint64_t dui_size; + + dui_size = 0; + len = 1024; + hdr = (uint8_t*)malloc(len); + if (hdr == NULL) + errx(1, "Can't get buffer to read header"); + wdc_get_data_dui(fd, opcode, len, 0, hdr, len); + + hdr += len_off; + hdr_ver = ((*hdr & 0xF) != 0)? *hdr : le16dec(hdr); + max_sections = wdc_get_dui_max_sections(hdr_ver); + + if (hdr_ver == 0 || hdr_ver == 1) { + dui_size = (uint64_t)le32dec(hdr + 4); + if (dui_size == 0) { + hdr += 8; + for (i = 0, j = 0; i < (int)max_sections; i++, j+=8) + dui_size += (uint64_t)le32dec(hdr + j + 4); + } + } else if (hdr_ver == 2 || hdr_ver == 3) { + if (data_area == 0) { + dui_size = le64dec(hdr + 4); + if (dui_size == 0) { + hdr += 12; + for (i = 0, j = 0 ; i < (int)max_sections; i++, j+=12) + dui_size += le64dec(hdr + j + 4); + } + } else { + hdr += 12; + for (i = 0, j = 0; i < (int)max_sections; i++, j+=12) { + if (le16dec(hdr + j + 2) <= data_area) + dui_size += le64dec(hdr + j + 4); + else + break; + } + } + } + else + errx(1, "ERROR : No valid header "); + + *log_size = dui_size; + free(hdr); +} + +static void +wdc_do_dump_dui(int fd, char *tmpl, uint8_t data_area, + const char *suffix, uint32_t opcode, int len_off) +{ + int fd2, first; + uint8_t *buf; + uint16_t hdr_ver; + uint64_t log_len, offset; + size_t resid; + + wdc_append_serial_name(fd, tmpl, MAXPATHLEN, suffix); + wdc_get_dui_log_size(fd, opcode, data_area, &log_len, len_off); + if (log_len == 0) + errx(1, "No data for %s", suffix); + fd2 = open(tmpl, O_WRONLY | O_CREAT | O_TRUNC, 0644); + if (fd2 < 0) + err(1, "open %s", tmpl); + buf = aligned_alloc(PAGE_SIZE, NVME_MAX_XFER_SIZE); + if (buf == NULL) + errx(1, "Can't get buffer to read dump"); + offset = 0; + first = 1; + + while (log_len > 0) { + resid = log_len > NVME_MAX_XFER_SIZE ? NVME_MAX_XFER_SIZE : log_len; + wdc_get_data_dui(fd, opcode, resid, offset, buf, resid); + if (first) { + hdr_ver = ((buf[len_off] & 0xF) != 0) ? + (buf[len_off]) : (le16dec(buf + len_off)); + printf("Dumping %ld bytes of version %d log to %s\n", log_len, + hdr_ver, tmpl); + first = 0; + } + if (write(fd2, buf, resid) != (ssize_t)resid) + err(1, "write"); + offset += resid; + log_len -= resid; + } + + free(buf); + close(fd2); +} + +static void wdc_cap_diag(const struct cmd *f, int argc, char *argv[]) { char tmpl[MAXPATHLEN]; int fd; + struct nvme_controller_data cdata; + uint32_t vid; if (arg_parse(argc, argv, f)) return; @@ -200,11 +370,28 @@ wdc_cap_diag(const struct cmd *f, int argc, char *argv fprintf(stderr, "Missing template arg.\n"); arg_help(argc, argv, f); } + if (opt.data_area > 4) { + fprintf(stderr, "Data area range 1-4, supplied %d.\n", opt.data_area); + arg_help(argc, argv, f); + } strlcpy(tmpl, opt.template, sizeof(tmpl)); open_dev(opt.dev, &fd, 1, 1); - wdc_do_dump(fd, tmpl, "cap_diag", WDC_NVME_CAP_DIAG_OPCODE, - WDC_NVME_CAP_DIAG_CMD, 4); + read_controller_data(fd, &cdata); + vid = cdata.vid; + switch (vid) { + case WDC_NVME_VID : + case WDC_NVME_VID_2 : + wdc_do_dump_e6(fd, tmpl, "cap_diag", WDC_NVME_CAP_DIAG_OPCODE_E6, + WDC_NVME_CAP_DIAG_CMD, 4); + break; + case WDC_NVME_VID_3 : + wdc_do_dump_dui(fd, tmpl, opt.data_area, "cap_diag", + WDC_NVME_CAP_DIAG_OPCODE_FA, 512); + break; + default: + errx(1, "ERROR : WDC: unsupported device (%#x) for this command", vid); + } close(fd); exit(1); From owner-svn-src-head@freebsd.org Wed Oct 7 05:44: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 944373FC0F3; Wed, 7 Oct 2020 05:44:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C5jvm3Qttz4Mmn; Wed, 7 Oct 2020 05:44:36 +0000 (UTC) (envelope-from imp@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 591B512AEC; Wed, 7 Oct 2020 05:44:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0975iaG3010032; Wed, 7 Oct 2020 05:44:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0975iaDE010031; Wed, 7 Oct 2020 05:44:36 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010070544.0975iaDE010031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 7 Oct 2020 05:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366507 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 366507 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, 07 Oct 2020 05:44:36 -0000 Author: imp Date: Wed Oct 7 05:44:35 2020 New Revision: 366507 URL: https://svnweb.freebsd.org/changeset/base/366507 Log: cam: Add quirk for Samsung MZ7* behind a SATA-to-SAS interposer Sometimes, this drive will be present in the system such that the the firmware identification string doesn't start with ATA, such as when it's behind a SATA-to-SAS interposer. Add another quirk for that. Submitted by: github user mr44er Github PR: 423 Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Wed Oct 7 05:36:05 2020 (r366506) +++ head/sys/cam/scsi/scsi_da.c Wed Oct 7 05:44:35 2020 (r366507) @@ -1417,6 +1417,15 @@ static struct da_quirk_entry da_quirk_table[] = }, { /* + * Same as above but enable the quirks for SSD SAMSUNG MZ7* + * connected via SATA-to-SAS interposer and because of this + * starting without "ATA" + */ + { T_DIRECT, SIP_MEDIA_FIXED, "SAMSUNG", "MZ7*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* * SuperTalent TeraDrive CT SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ From owner-svn-src-head@freebsd.org Wed Oct 7 06:16: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 CA6033FC7D8; Wed, 7 Oct 2020 06:16:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C5kcl52NBz4PLS; Wed, 7 Oct 2020 06:16:39 +0000 (UTC) (envelope-from imp@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 75E4512F6D; Wed, 7 Oct 2020 06:16:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0976GdiW028369; Wed, 7 Oct 2020 06:16:39 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0976Gclk028363; Wed, 7 Oct 2020 06:16:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010070616.0976Gclk028363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 7 Oct 2020 06:16:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366508 - in head/sys: dev/rt geom/eli kern sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: dev/rt geom/eli kern sys X-SVN-Commit-Revision: 366508 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, 07 Oct 2020 06:16:39 -0000 Author: imp Date: Wed Oct 7 06:16:37 2020 New Revision: 366508 URL: https://svnweb.freebsd.org/changeset/base/366508 Log: Move kernel env global variables, etc to sys/kenv.h The kernel globals for kenv are confined to 2 files that need them and a few that likely shouldn't (but as written the code does). Move them from sys/systm.h to sys/kenv.h. This removed a XXX from systm.h and cleans it up a little bit... Modified: head/sys/dev/rt/if_rt.c head/sys/geom/eli/g_eli.c head/sys/kern/kern_environment.c head/sys/kern/subr_hints.c head/sys/sys/kenv.h head/sys/sys/systm.h Modified: head/sys/dev/rt/if_rt.c ============================================================================== --- head/sys/dev/rt/if_rt.c Wed Oct 7 05:44:35 2020 (r366507) +++ head/sys/dev/rt/if_rt.c Wed Oct 7 06:16:37 2020 (r366508) @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); #include "if_rtvar.h" #include "if_rtreg.h" +#include + #include #include #include Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Wed Oct 7 05:44:35 2020 (r366507) +++ head/sys/geom/eli/g_eli.c Wed Oct 7 06:16:37 2020 (r366508) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/kern/kern_environment.c ============================================================================== --- head/sys/kern/kern_environment.c Wed Oct 7 05:44:35 2020 (r366507) +++ head/sys/kern/kern_environment.c Wed Oct 7 06:16:37 2020 (r366508) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/kern/subr_hints.c ============================================================================== --- head/sys/kern/subr_hints.c Wed Oct 7 05:44:35 2020 (r366507) +++ head/sys/kern/subr_hints.c Wed Oct 7 06:16:37 2020 (r366508) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/sys/kenv.h ============================================================================== --- head/sys/sys/kenv.h Wed Oct 7 05:44:35 2020 (r366507) +++ head/sys/sys/kenv.h Wed Oct 7 06:16:37 2020 (r366508) @@ -42,4 +42,18 @@ #define KENV_MNAMELEN 128 /* Maximum name length (for the syscall) */ #define KENV_MVALLEN 128 /* Maximum value length (for the syscall) */ +#ifdef _KERNEL +/* + * Most of these variables should be const. + */ +extern bool dynamic_kenv; +extern struct mtx kenv_lock; +extern char *kern_envp; +extern char *md_envp; +extern char static_env[]; +extern char static_hints[]; /* by config for now */ + +extern char **kenvp; +#endif /* _KERNEL */ + #endif /* !_SYS_KENV_H_ */ Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Wed Oct 7 05:44:35 2020 (r366507) +++ head/sys/sys/systm.h Wed Oct 7 06:16:37 2020 (r366508) @@ -204,21 +204,7 @@ void kassert_panic(const char *fmt, ...) __printflike }) #define SCHEDULER_STOPPED() SCHEDULER_STOPPED_TD(curthread) -/* - * XXX the hints declarations are even more misplaced than most declarations - * in this file, since they are needed in one file (per arch) and only used - * in two files. - * XXX most of these variables should be const. - */ extern int osreldate; -extern bool dynamic_kenv; -extern struct mtx kenv_lock; -extern char *kern_envp; -extern char *md_envp; -extern char static_env[]; -extern char static_hints[]; /* by config for now */ - -extern char **kenvp; extern const void *zero_region; /* address space maps to a zeroed page */ From owner-svn-src-head@freebsd.org Wed Oct 7 07:23: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 332053FE1E3; Wed, 7 Oct 2020 07:23:30 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C5m5t0Z9lz4SFh; Wed, 7 Oct 2020 07:23:30 +0000 (UTC) (envelope-from lwhsu@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 EAC1B13DED; Wed, 7 Oct 2020 07:23:29 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0977NT6E071319; Wed, 7 Oct 2020 07:23:29 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0977NTYS071318; Wed, 7 Oct 2020 07:23:29 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202010070723.0977NTYS071318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 7 Oct 2020 07:23:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366509 - head/tests/sys/capsicum X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/capsicum X-SVN-Commit-Revision: 366509 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, 07 Oct 2020 07:23:30 -0000 Author: lwhsu Date: Wed Oct 7 07:23:29 2020 New Revision: 366509 URL: https://svnweb.freebsd.org/changeset/base/366509 Log: Skip test written in Googltest in the wrapper script This leaves the main test body untouched and only skip running in the CI env, makes doing local test easier while developing. PR: 244165 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/capsicum/functional.sh Modified: head/tests/sys/capsicum/functional.sh ============================================================================== --- head/tests/sys/capsicum/functional.sh Wed Oct 7 06:16:37 2020 (r366508) +++ head/tests/sys/capsicum/functional.sh Wed Oct 7 07:23:29 2020 (r366509) @@ -59,7 +59,10 @@ add_testcase() if [ "$(atf_config_get ci false)" = "true" ]; then case "${tc_escaped}" in ForkedOpenatTest_WithFlagInCapabilityMode___|OpenatTest__WithFlag) - eval "${tc_escaped}_body() { skip \"http://bugs.freebsd.org/249960\"; }" + eval "${tc_escaped}_body() { skip \"https://bugs.freebsd.org/249960\"; }" + ;; + PipePdfork__WildcardWait) + eval "${tc_escaped}_body() { skip \"https://bugs.freebsd.org/244165\"; }" ;; *) eval "${tc_escaped}_body() { check ${tc}; }" From owner-svn-src-head@freebsd.org Wed Oct 7 07:55: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 DDBC53FF63B; Wed, 7 Oct 2020 07:55:55 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C5mqH5d3Bz4Vhf; Wed, 7 Oct 2020 07:55:55 +0000 (UTC) (envelope-from lwhsu@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 A033814631; Wed, 7 Oct 2020 07:55:55 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0977ttpL089740; Wed, 7 Oct 2020 07:55:55 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0977tt4X089739; Wed, 7 Oct 2020 07:55:55 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202010070755.0977tt4X089739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 7 Oct 2020 07:55:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366510 - head/contrib/capsicum-test X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/contrib/capsicum-test X-SVN-Commit-Revision: 366510 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, 07 Oct 2020 07:55:55 -0000 Author: lwhsu Date: Wed Oct 7 07:55:55 2020 New Revision: 366510 URL: https://svnweb.freebsd.org/changeset/base/366510 Log: Revert r358001 in favor of r366509 Sponsored by: The FreeBSD Foundation Modified: head/contrib/capsicum-test/procdesc.cc Modified: head/contrib/capsicum-test/procdesc.cc ============================================================================== --- head/contrib/capsicum-test/procdesc.cc Wed Oct 7 07:23:29 2020 (r366509) +++ head/contrib/capsicum-test/procdesc.cc Wed Oct 7 07:55:55 2020 (r366510) @@ -763,7 +763,6 @@ TEST_F(PipePdfork, ModeBits) { #endif TEST_F(PipePdfork, WildcardWait) { - TEST_SKIPPED("https://bugs.freebsd.org/244165"); // TODO(FreeBSD): make wildcard wait ignore pdfork()ed children // https://bugs.freebsd.org/201054 TerminateChild(); From owner-svn-src-head@freebsd.org Wed Oct 7 07: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 0C42C3FF468; Wed, 7 Oct 2020 07:55:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C5mqH6b8fz4VfM; Wed, 7 Oct 2020 07:55:55 +0000 (UTC) (envelope-from imp@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 C237514632; Wed, 7 Oct 2020 07:55:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0977ttbQ089742; Wed, 7 Oct 2020 07:55:55 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0977ttxU089741; Wed, 7 Oct 2020 07:55:55 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010070755.0977ttxU089741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 7 Oct 2020 07:55:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366511 - head/sbin/nvmecontrol/modules/wdc X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/nvmecontrol/modules/wdc X-SVN-Commit-Revision: 366511 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, 07 Oct 2020 07:55:56 -0000 Author: imp Date: Wed Oct 7 07:55:55 2020 New Revision: 366511 URL: https://svnweb.freebsd.org/changeset/base/366511 Log: Use intmax_t to print uint64_t values. This fixes the 32-bit build where the types are different. Modified: head/sbin/nvmecontrol/modules/wdc/wdc.c Modified: head/sbin/nvmecontrol/modules/wdc/wdc.c ============================================================================== --- head/sbin/nvmecontrol/modules/wdc/wdc.c Wed Oct 7 07:55:55 2020 (r366510) +++ head/sbin/nvmecontrol/modules/wdc/wdc.c Wed Oct 7 07:55:55 2020 (r366511) @@ -342,8 +342,8 @@ wdc_do_dump_dui(int fd, char *tmpl, uint8_t data_area, if (first) { hdr_ver = ((buf[len_off] & 0xF) != 0) ? (buf[len_off]) : (le16dec(buf + len_off)); - printf("Dumping %ld bytes of version %d log to %s\n", log_len, - hdr_ver, tmpl); + printf("Dumping %jd bytes of version %d log to %s\n", + (uintmax_t)log_len, hdr_ver, tmpl); first = 0; } if (write(fd2, buf, resid) != (ssize_t)resid) From owner-svn-src-head@freebsd.org Wed Oct 7 09:53: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 B60FE42AB27; Wed, 7 Oct 2020 09:53:25 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C5qQs4VPRz4clK; Wed, 7 Oct 2020 09:53:25 +0000 (UTC) (envelope-from lwhsu@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 7F157154FA; Wed, 7 Oct 2020 09:53:25 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0979rPa0063359; Wed, 7 Oct 2020 09:53:25 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0979rPPl063358; Wed, 7 Oct 2020 09:53:25 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202010070953.0979rPPl063358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 7 Oct 2020 09:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366512 - head/tests/sys/capsicum X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/capsicum X-SVN-Commit-Revision: 366512 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, 07 Oct 2020 09:53:25 -0000 Author: lwhsu Date: Wed Oct 7 09:53:24 2020 New Revision: 366512 URL: https://svnweb.freebsd.org/changeset/base/366512 Log: Temporarily skip failing test cases in CI: sys.capsicum.functional.Capability__NoBypassDAC sys.capsicum.functional.Pdfork__OtherUserForked PR: 250178, 250179 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/capsicum/functional.sh Modified: head/tests/sys/capsicum/functional.sh ============================================================================== --- head/tests/sys/capsicum/functional.sh Wed Oct 7 07:55:55 2020 (r366511) +++ head/tests/sys/capsicum/functional.sh Wed Oct 7 09:53:24 2020 (r366512) @@ -64,6 +64,12 @@ add_testcase() PipePdfork__WildcardWait) eval "${tc_escaped}_body() { skip \"https://bugs.freebsd.org/244165\"; }" ;; + Capability__NoBypassDAC) + eval "${tc_escaped}_body() { skip \"https://bugs.freebsd.org/250178\"; }" + ;; + Pdfork__OtherUserForked) + eval "${tc_escaped}_body() { skip \"https://bugs.freebsd.org/250179\"; }" + ;; *) eval "${tc_escaped}_body() { check ${tc}; }" ;; From owner-svn-src-head@freebsd.org Wed Oct 7 10:58: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 B959D42BA64; Wed, 7 Oct 2020 10:58:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C5rtS4Yd8z4gb9; Wed, 7 Oct 2020 10:58:56 +0000 (UTC) (envelope-from kib@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 7FFC31664E; Wed, 7 Oct 2020 10:58:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 097AwuI0001036; Wed, 7 Oct 2020 10:58:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 097AwuwC001035; Wed, 7 Oct 2020 10:58:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010071058.097AwuwC001035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 7 Oct 2020 10:58:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366514 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 366514 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, 07 Oct 2020 10:58:56 -0000 Author: kib Date: Wed Oct 7 10:58:56 2020 New Revision: 366514 URL: https://svnweb.freebsd.org/changeset/base/366514 Log: Fix typo. Sponsored by: Mellanox Technologies/NVIDIA Networking MFC after: 3 days Modified: head/sys/net/if.h Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Wed Oct 7 10:43:29 2020 (r366513) +++ head/sys/net/if.h Wed Oct 7 10:58:56 2020 (r366514) @@ -209,7 +209,7 @@ struct if_data { * contains the enabled optional feature & capabilites that can be used * individually per packet and are specified in the mbuf pkthdr.csum_flags * field. IFCAP_* and CSUM_* do not match one to one and CSUM_* may be - * more detailed or differenciated than IFCAP_*. + * more detailed or differentiated than IFCAP_*. * Hwassist features are defined CSUM_* in sys/mbuf.h * * Capabilities that cannot be arbitrarily changed with ifconfig/ioctl From owner-svn-src-head@freebsd.org Wed Oct 7 12:11: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 B966342DD4E; Wed, 7 Oct 2020 12:11:11 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C5tTq4XBBz4lRt; Wed, 7 Oct 2020 12:11:11 +0000 (UTC) (envelope-from trasz@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 7F512176E7; Wed, 7 Oct 2020 12:11:11 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 097CBB3G044906; Wed, 7 Oct 2020 12:11:11 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 097CBBr4044905; Wed, 7 Oct 2020 12:11:11 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010071211.097CBBr4044905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 7 Oct 2020 12:11:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366515 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 366515 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, 07 Oct 2020 12:11:11 -0000 Author: trasz Date: Wed Oct 7 12:11:11 2020 New Revision: 366515 URL: https://svnweb.freebsd.org/changeset/base/366515 Log: Don't use critical section when calling intr_irq_handler() - that function enters critical section by itself anyway. Reviewed by: kp Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26694 Modified: head/sys/riscv/riscv/intr_machdep.c Modified: head/sys/riscv/riscv/intr_machdep.c ============================================================================== --- head/sys/riscv/riscv/intr_machdep.c Wed Oct 7 10:58:56 2020 (r366514) +++ head/sys/riscv/riscv/intr_machdep.c Wed Oct 7 12:11:11 2020 (r366515) @@ -158,8 +158,6 @@ riscv_cpu_intr(struct trapframe *frame) struct intr_irqsrc *isrc; int active_irq; - critical_enter(); - KASSERT(frame->tf_scause & EXCP_INTR, ("riscv_cpu_intr: wrong frame passed")); @@ -169,18 +167,16 @@ riscv_cpu_intr(struct trapframe *frame) case IRQ_SOFTWARE_USER: case IRQ_SOFTWARE_SUPERVISOR: case IRQ_TIMER_SUPERVISOR: + critical_enter(); isrc = &isrcs[active_irq].isrc; if (intr_isrc_dispatch(isrc, frame) != 0) printf("stray interrupt %d\n", active_irq); + critical_exit(); break; case IRQ_EXTERNAL_SUPERVISOR: intr_irq_handler(frame); break; - default: - break; } - - critical_exit(); } #ifdef SMP From owner-svn-src-head@freebsd.org Wed Oct 7 12:38: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 DDB6642E892; Wed, 7 Oct 2020 12:38:04 +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 4C5v4r5WQdz4mRv; Wed, 7 Oct 2020 12:38:04 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) (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 9C0BA154A2; Wed, 7 Oct 2020 12:38:04 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f53.google.com with SMTP id db4so1017566qvb.4; Wed, 07 Oct 2020 05:38:04 -0700 (PDT) X-Gm-Message-State: AOAM533PFXEBrQAIlsnGrVKtJ0j03c3Q1C879kloOIa0duDy9tYHPvpo uUWbzs9/tSC/4/6Sc4abcsxPDDgXgVw3aclBbag= X-Google-Smtp-Source: ABdhPJx4uF1wOLWiDkyD7OvPjEDDPNPaxHAV02jU1UzeBtBGresckIE+Z8kIlH3Y5CAGB3O9B974Ug4nt+5c77Ussv4= X-Received: by 2002:a0c:f0d1:: with SMTP id d17mr2992370qvl.34.1602074284072; Wed, 07 Oct 2020 05:38:04 -0700 (PDT) MIME-Version: 1.0 References: <202010070616.0976Gclk028363@repo.freebsd.org> In-Reply-To: <202010070616.0976Gclk028363@repo.freebsd.org> From: Kyle Evans Date: Wed, 7 Oct 2020 07:37:51 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366508 - in head/sys: dev/rt geom/eli kern sys To: Warner Losh 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: Wed, 07 Oct 2020 12:38:04 -0000 On Wed, Oct 7, 2020 at 1:16 AM Warner Losh wrote: > > Author: imp > Date: Wed Oct 7 06:16:37 2020 > New Revision: 366508 > URL: https://svnweb.freebsd.org/changeset/base/366508 > > Log: > Move kernel env global variables, etc to sys/kenv.h > > The kernel globals for kenv are confined to 2 files that need them and > a few that likely shouldn't (but as written the code does). Move them > from sys/systm.h to sys/kenv.h. This removed a XXX from systm.h and > cleans it up a little bit... > https://reviews.freebsd.org/D26562 can be closed now From owner-svn-src-head@freebsd.org Wed Oct 7 14:43: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 BEA82431582; Wed, 7 Oct 2020 14:43:16 +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 4C5xsJ4d0Nz4vMl; Wed, 7 Oct 2020 14:43:16 +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 8219A18FFA; Wed, 7 Oct 2020 14:43:16 +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 097EhGiI043581; Wed, 7 Oct 2020 14:43:16 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 097EhGiA043580; Wed, 7 Oct 2020 14:43:16 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202010071443.097EhGiA043580@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: Wed, 7 Oct 2020 14:43:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366516 - head/usr.bin/ul X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/usr.bin/ul X-SVN-Commit-Revision: 366516 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, 07 Oct 2020 14:43:16 -0000 Author: fernape (ports committer) Date: Wed Oct 7 14:43:16 2020 New Revision: 366516 URL: https://svnweb.freebsd.org/changeset/base/366516 Log: ul(1): Remove references to colcrt(1) and nroff(1) colcrt(1) and nroff(1) where removed in r319664. Remove references to these commands in ul(1) man page. PR: 244127 Reported by: freebsd@tim.thechases.com Approved by: manpages (gbe@) Differential Revision: https://reviews.freebsd.org/D2614 Modified: head/usr.bin/ul/ul.1 Modified: head/usr.bin/ul/ul.1 ============================================================================== --- head/usr.bin/ul/ul.1 Wed Oct 7 12:11:11 2020 (r366515) +++ head/usr.bin/ul/ul.1 Wed Oct 7 14:43:16 2020 (r366516) @@ -28,7 +28,7 @@ .\" @(#)ul.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd August 4, 2004 +.Dd October 7, 2020 .Dt UL 1 .Os .Sh NAME @@ -64,11 +64,7 @@ The following options are available: .It Fl i Underlining is indicated by a separate line containing appropriate dashes -.Ql \- ; -this is useful when you want to look at the underlining -which is present in an -.Xr nroff 1 -output stream on a CRT-terminal. +.Ql \- . .It Fl t Ar terminal Overrides the terminal type specified in the environment with .Ar terminal . @@ -85,18 +81,10 @@ as described in .Sh EXIT STATUS .Ex -std .Sh SEE ALSO -.Xr colcrt 1 , .Xr man 1 , -.Xr nroff 1 +.Xr mandoc 1 .Sh HISTORY The .Nm command appeared in .Bx 3.0 . -.Sh BUGS -The -.Xr nroff 1 -command usually outputs a series of backspaces and underlines intermixed -with the text to indicate underlining. -No attempt is made to optimize -the backward motion. From owner-svn-src-head@freebsd.org Wed Oct 7 15:22: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 89882431E25; Wed, 7 Oct 2020 15:22:49 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C5ykx2mL8z3SSx; Wed, 7 Oct 2020 15:22:49 +0000 (UTC) (envelope-from tuexen@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 424AD195FF; Wed, 7 Oct 2020 15:22:49 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 097FMnMw067859; Wed, 7 Oct 2020 15:22:49 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 097FMmY8067857; Wed, 7 Oct 2020 15:22:48 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202010071522.097FMmY8067857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 7 Oct 2020 15:22:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366517 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 366517 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, 07 Oct 2020 15:22:49 -0000 Author: tuexen Date: Wed Oct 7 15:22:48 2020 New Revision: 366517 URL: https://svnweb.freebsd.org/changeset/base/366517 Log: Minor cleanups. MFC after: 3 days Modified: head/sys/netinet/sctp_cc_functions.c head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Wed Oct 7 14:43:16 2020 (r366516) +++ head/sys/netinet/sctp_cc_functions.c Wed Oct 7 15:22:48 2020 (r366517) @@ -1993,12 +1993,12 @@ htcp_alpha_update(struct htcp *ca) scale = min(max(scale, 1U << 2), 10U << 3); /* clamping ratio to * interval [0.5,10]<<3 */ factor = (factor << 3) / scale; - if (!factor) + if (factor != 0) factor = 1; } ca->alpha = 2 * factor * ((1 << 7) - ca->beta); - if (!ca->alpha) + if (ca->alpha != 0) ca->alpha = ALPHA_BASE; } Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Wed Oct 7 14:43:16 2020 (r366516) +++ head/sys/netinet/sctp_output.c Wed Oct 7 15:22:48 2020 (r366517) @@ -2774,8 +2774,7 @@ sctp_select_nth_preferred_addr_from_ifn_boundall(struc uint8_t dest_is_priv, int addr_wanted, sa_family_t fam, - sctp_route_t *ro -) + sctp_route_t *ro) { struct sctp_ifa *ifa, *sifa; int num_eligible_addr = 0; From owner-svn-src-head@freebsd.org Wed Oct 7 17:46: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 19765434A91; Wed, 7 Oct 2020 17:46:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C61x56wmFz3Zj5; Wed, 7 Oct 2020 17:46:49 +0000 (UTC) (envelope-from hselasky@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 D10621B514; Wed, 7 Oct 2020 17:46:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 097HknnL054241; Wed, 7 Oct 2020 17:46:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 097Hkneh054240; Wed, 7 Oct 2020 17:46:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010071746.097Hkneh054240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 7 Oct 2020 17:46:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366518 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 366518 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, 07 Oct 2020 17:46:50 -0000 Author: hselasky Date: Wed Oct 7 17:46:49 2020 New Revision: 366518 URL: https://svnweb.freebsd.org/changeset/base/366518 Log: Properly cleanup driver during remove_one() in mlx5core. Cleanup all host resources, SYSCTLs, MSIX vectors and memory used by the host and only leave the device allocated memory behind, if any, because it may still be in use, when the PCI remove function is called. Else future probe calls may fail due to SYSCTLs already existing. MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Oct 7 15:22:48 2020 (r366517) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Oct 7 17:46:49 2020 (r366518) @@ -1665,9 +1665,8 @@ static void remove_one(struct pci_dev *pdev) struct mlx5_priv *priv = &dev->priv; if (mlx5_unload_one(dev, priv, true)) { - mlx5_core_err(dev, "mlx5_unload_one failed\n"); - mlx5_health_cleanup(dev); - return; + mlx5_core_err(dev, "mlx5_unload_one() failed, leaked %lld bytes\n", + (long long)(dev->priv.fw_pages * MLX5_ADAPTER_PAGE_SIZE)); } mlx5_pagealloc_cleanup(dev); From owner-svn-src-head@freebsd.org Wed Oct 7 18:48: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 51D6A435C6B; Wed, 7 Oct 2020 18:48:12 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C63Hw1SjXz3dqB; Wed, 7 Oct 2020 18:48:12 +0000 (UTC) (envelope-from mhorne@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 157261C020; Wed, 7 Oct 2020 18:48:12 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 097ImBXB091106; Wed, 7 Oct 2020 18:48:11 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 097ImAxg091098; Wed, 7 Oct 2020 18:48:10 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202010071848.097ImAxg091098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Wed, 7 Oct 2020 18:48:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366519 - in head/sys: amd64/amd64 arm/arm arm64/arm64 i386/i386 mips/mips powerpc/powerpc riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm/arm arm64/arm64 i386/i386 mips/mips powerpc/powerpc riscv/riscv X-SVN-Commit-Revision: 366519 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, 07 Oct 2020 18:48:12 -0000 Author: mhorne Date: Wed Oct 7 18:48:10 2020 New Revision: 366519 URL: https://svnweb.freebsd.org/changeset/base/366519 Log: Print symbol index for unsupported relocation types It is unlikely, but possible, that an unrecognized or unsupported relocation type is encountered while trying to load a kernel module. If this occurs we should offer the symbol index as a hint to the user. While here, fix some small style issues. Reviewed by: markj, kib (amd64 part, in D26701) Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Modified: head/sys/amd64/amd64/elf_machdep.c head/sys/arm/arm/elf_machdep.c head/sys/arm64/arm64/elf_machdep.c head/sys/i386/i386/elf_machdep.c head/sys/mips/mips/elf_machdep.c head/sys/powerpc/powerpc/elf32_machdep.c head/sys/powerpc/powerpc/elf64_machdep.c head/sys/riscv/riscv/elf_machdep.c Modified: head/sys/amd64/amd64/elf_machdep.c ============================================================================== --- head/sys/amd64/amd64/elf_machdep.c Wed Oct 7 17:46:49 2020 (r366518) +++ head/sys/amd64/amd64/elf_machdep.c Wed Oct 7 18:48:10 2020 (r366519) @@ -309,11 +309,11 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas case R_X86_64_NONE: /* none */ break; - case R_X86_64_64: /* S + A */ + case R_X86_64_64: /* S + A */ error = lookup(lf, symidx, 1, &addr); val = addr + addend; if (error != 0) - return -1; + return (-1); if (*where != val) *where = val; break; @@ -325,7 +325,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas where32 = (Elf32_Addr *)where; val32 = (Elf32_Addr)(addr + addend - (Elf_Addr)where); if (error != 0) - return -1; + return (-1); if (*where32 != val32) *where32 = val32; break; @@ -335,7 +335,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas val32 = (Elf32_Addr)(addr + addend); where32 = (Elf32_Addr *)where; if (error != 0) - return -1; + return (-1); if (*where32 != val32) *where32 = val32; break; @@ -345,14 +345,15 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas * There shouldn't be copy relocations in kernel * objects. */ - printf("kldload: unexpected R_COPY relocation\n"); + printf("kldload: unexpected R_COPY relocation, " + "symbol index %ld\n", symidx); return (-1); case R_X86_64_GLOB_DAT: /* S */ case R_X86_64_JMP_SLOT: /* XXX need addend + offset */ error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); if (*where != addr) *where = addr; break; @@ -372,8 +373,8 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas break; default: - printf("kldload: unexpected relocation type %ld\n", - rtype); + printf("kldload: unexpected relocation type %ld, " + "symbol index %ld\n", rtype, symidx); return (-1); } return (0); Modified: head/sys/arm/arm/elf_machdep.c ============================================================================== --- head/sys/arm/arm/elf_machdep.c Wed Oct 7 17:46:49 2020 (r366518) +++ head/sys/arm/arm/elf_machdep.c Wed Oct 7 18:48:10 2020 (r366519) @@ -236,7 +236,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas case R_ARM_ABS32: error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); store_ptr(where, addr + load_ptr(where)); break; @@ -245,8 +245,9 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas * There shouldn't be copy relocations in kernel * objects. */ - printf("kldload: unexpected R_COPY relocation\n"); - return -1; + printf("kldload: unexpected R_COPY relocation, " + "symbol index %d\n", symidx); + return (-1); break; case R_ARM_JUMP_SLOT: @@ -260,9 +261,9 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas break; default: - printf("kldload: unexpected relocation type %d\n", - rtype); - return -1; + printf("kldload: unexpected relocation type %d, " + "symbol index %d\n", rtype, symidx); + return (-1); } return(0); } Modified: head/sys/arm64/arm64/elf_machdep.c ============================================================================== --- head/sys/arm64/arm64/elf_machdep.c Wed Oct 7 17:46:49 2020 (r366518) +++ head/sys/arm64/arm64/elf_machdep.c Wed Oct 7 18:48:10 2020 (r366519) @@ -227,7 +227,8 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas *where = val; break; default: - printf("kldload: unexpected relocation type %d\n", rtype); + printf("kldload: unexpected relocation type %d, " + "symbol index %d\n", rtype, symidx); return (-1); } return (error); Modified: head/sys/i386/i386/elf_machdep.c ============================================================================== --- head/sys/i386/i386/elf_machdep.c Wed Oct 7 17:46:49 2020 (r366518) +++ head/sys/i386/i386/elf_machdep.c Wed Oct 7 18:48:10 2020 (r366519) @@ -213,7 +213,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas case R_386_32: /* S + A */ error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); addr += addend; if (*where != addr) *where = addr; @@ -222,7 +222,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas case R_386_PC32: /* S + A - P */ error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); addr += addend - (Elf_Addr)where; if (*where != addr) *where = addr; @@ -233,14 +233,15 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas * There shouldn't be copy relocations in kernel * objects. */ - printf("kldload: unexpected R_COPY relocation\n"); - return -1; + printf("kldload: unexpected R_COPY relocation, " + "symbol index %d\n", symidx); + return (-1); break; case R_386_GLOB_DAT: /* S */ error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); if (*where != addr) *where = addr; break; @@ -255,9 +256,9 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas *where = addr; break; default: - printf("kldload: unexpected relocation type %d\n", - rtype); - return -1; + printf("kldload: unexpected relocation type %d, " + "symbol index %d\n", rtype, symidx); + return (-1); } return(0); } Modified: head/sys/mips/mips/elf_machdep.c ============================================================================== --- head/sys/mips/mips/elf_machdep.c Wed Oct 7 17:46:49 2020 (r366518) +++ head/sys/mips/mips/elf_machdep.c Wed Oct 7 18:48:10 2020 (r366519) @@ -454,12 +454,12 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas break; default: - printf("kldload: unexpected relocation type %d\n", - rtype); + printf("kldload: unexpected relocation type %d, " + "symbol index %d\n", rtype, symidx); return (-1); } - return(0); + return (0); } int Modified: head/sys/powerpc/powerpc/elf32_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf32_machdep.c Wed Oct 7 17:46:49 2020 (r366518) +++ head/sys/powerpc/powerpc/elf32_machdep.c Wed Oct 7 18:48:10 2020 (r366519) @@ -262,14 +262,14 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas case R_PPC_ADDR32: /* word32 S + A */ error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); *where = elf_relocaddr(lf, addr + addend); break; case R_PPC_ADDR16_LO: /* #lo(S) */ error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); /* * addend values are sometimes relative to sections * (i.e. .rodata) in rela, where in reality they @@ -284,7 +284,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas case R_PPC_ADDR16_HA: /* #ha(S) */ error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); /* * addend values are sometimes relative to sections * (i.e. .rodata) in rela, where in reality they @@ -311,7 +311,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas */ error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); *where = elf_relocaddr(lf, addr + addend); break; @@ -323,11 +323,11 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas break; default: - printf("kldload: unexpected relocation type %d\n", - (int) rtype); - return -1; + printf("kldload: unexpected relocation type %d, " + "symbol index %d\n", (int)rtype, symidx); + return (-1); } - return(0); + return (0); } void Modified: head/sys/powerpc/powerpc/elf64_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf64_machdep.c Wed Oct 7 17:46:49 2020 (r366518) +++ head/sys/powerpc/powerpc/elf64_machdep.c Wed Oct 7 18:48:10 2020 (r366519) @@ -342,7 +342,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas case R_PPC64_ADDR64: /* doubleword64 S + A */ error = lookup(lf, symidx, 1, &addr); if (error != 0) - return -1; + return (-1); addr += addend; *where = addr; break; @@ -369,11 +369,11 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas break; default: - printf("kldload: unexpected relocation type %d\n", - (int) rtype); - return -1; + printf("kldload: unexpected relocation type %d, " + "symbol index %d\n", (int)rtype, symidx); + return (-1); } - return(0); + return (0); } void Modified: head/sys/riscv/riscv/elf_machdep.c ============================================================================== --- head/sys/riscv/riscv/elf_machdep.c Wed Oct 7 17:46:49 2020 (r366518) +++ head/sys/riscv/riscv/elf_machdep.c Wed Oct 7 18:48:10 2020 (r366519) @@ -479,7 +479,8 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbas break; default: - printf("kldload: unexpected relocation type %ld\n", rtype); + printf("kldload: unexpected relocation type %ld, " + "symbol index %ld\n", rtype, symidx); return (-1); } From owner-svn-src-head@freebsd.org Wed Oct 7 20:31:14 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 66A1D43842B; Wed, 7 Oct 2020 20:31:14 +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 4C65Zp28KLz41ND; Wed, 7 Oct 2020 20:31:14 +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 2CCAC1D696; Wed, 7 Oct 2020 20:31:14 +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 097KVElg053355; Wed, 7 Oct 2020 20:31:14 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 097KVExc053354; Wed, 7 Oct 2020 20:31:14 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202010072031.097KVExc053354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 7 Oct 2020 20:31:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366521 - head/usr.sbin/bhyveload X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/bhyveload X-SVN-Commit-Revision: 366521 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, 07 Oct 2020 20:31:14 -0000 Author: cem Date: Wed Oct 7 20:31:13 2020 New Revision: 366521 URL: https://svnweb.freebsd.org/changeset/base/366521 Log: bhyveload(8): Implement loader_callbacks::diskwrite The method was optional prior to r365938, which made it mandatory but did add any test that an implementation provides the method nor implement it for bhyveload. The code path might not be hit unless the user's loader was configured to write to a file on disk, such as with nextboot(8). Reviewed by: grehan, tsoome Approved by: bhyve X-MFC-With: r365938 Differential Revision: https://reviews.freebsd.org/D26710 Modified: head/usr.sbin/bhyveload/bhyveload.c Modified: head/usr.sbin/bhyveload/bhyveload.c ============================================================================== --- head/usr.sbin/bhyveload/bhyveload.c Wed Oct 7 20:09:26 2020 (r366520) +++ head/usr.sbin/bhyveload/bhyveload.c Wed Oct 7 20:31:13 2020 (r366521) @@ -300,11 +300,11 @@ cb_stat(void *arg, void *h, struct stat *sbp) static int cb_diskread(void *arg, int unit, uint64_t from, void *to, size_t size, - size_t *resid) + size_t *resid) { ssize_t n; - if (unit < 0 || unit >= ndisks ) + if (unit < 0 || unit >= ndisks) return (EIO); n = pread(disk_fd[unit], to, size, from); if (n < 0) @@ -314,6 +314,21 @@ cb_diskread(void *arg, int unit, uint64_t from, void * } static int +cb_diskwrite(void *arg, int unit, uint64_t offset, void *src, size_t size, + size_t *resid) +{ + ssize_t n; + + if (unit < 0 || unit >= ndisks) + return (EIO); + n = pwrite(disk_fd[unit], src, size, offset); + if (n < 0) + return (errno); + *resid = size - n; + return (0); +} + +static int cb_diskioctl(void *arg, int unit, u_long cmd, void *data) { struct stat sb; @@ -611,6 +626,7 @@ static struct loader_callbacks cb = { .stat = cb_stat, .diskread = cb_diskread, + .diskwrite = cb_diskwrite, .diskioctl = cb_diskioctl, .copyin = cb_copyin, From owner-svn-src-head@freebsd.org Wed Oct 7 21:56: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 9D417439B89; Wed, 7 Oct 2020 21:56:59 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C67Tl3g3rz45Rn; Wed, 7 Oct 2020 21:56:59 +0000 (UTC) (envelope-from bz@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 610C01E601; Wed, 7 Oct 2020 21:56:59 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 097LuxDd007964; Wed, 7 Oct 2020 21:56:59 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 097Luwbe007960; Wed, 7 Oct 2020 21:56:58 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202010072156.097Luwbe007960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 7 Oct 2020 21:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366522 - in head: lib/lib80211 sbin/ifconfig sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head: lib/lib80211 sbin/ifconfig sys/net80211 X-SVN-Commit-Revision: 366522 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, 07 Oct 2020 21:56:59 -0000 Author: bz Date: Wed Oct 7 21:56:58 2020 New Revision: 366522 URL: https://svnweb.freebsd.org/changeset/base/366522 Log: 80211: non-functional changes Sort a few VHT160 and 80+80 lines, update some comments, and remove a superfluous ','. No functional changes intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/lib/lib80211/lib80211_regdomain.c head/sbin/ifconfig/ifieee80211.c head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_node.h Modified: head/lib/lib80211/lib80211_regdomain.c ============================================================================== --- head/lib/lib80211/lib80211_regdomain.c Wed Oct 7 20:31:13 2020 (r366521) +++ head/lib/lib80211/lib80211_regdomain.c Wed Oct 7 21:56:58 2020 (r366522) @@ -191,11 +191,11 @@ decode_flag(struct mystate *mt, const char *p, int len FLAG(IEEE80211_CHAN_VHT20), FLAG(IEEE80211_CHAN_VHT40), FLAG(IEEE80211_CHAN_VHT80), + FLAG(IEEE80211_CHAN_VHT160), /* * XXX VHT80P80? This likely should be done by * 80MHz chan logic in net80211 / ifconfig. */ - FLAG(IEEE80211_CHAN_VHT160), FLAG(IEEE80211_CHAN_ST), FLAG(IEEE80211_CHAN_TURBO), FLAG(IEEE80211_CHAN_PASSIVE), Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Wed Oct 7 20:31:13 2020 (r366521) +++ head/sbin/ifconfig/ifieee80211.c Wed Oct 7 21:56:58 2020 (r366522) @@ -2385,8 +2385,7 @@ regdomain_makechannels( &dc->dc_chaninfo); } - /* VHT80 */ - /* XXX dc_vhtcap? */ + /* VHT80 is mandatory (and so should be VHT40 above). */ if (1) { regdomain_addchans(ci, &rd->bands_11ac, reg, IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U | Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Wed Oct 7 20:31:13 2020 (r366521) +++ head/sys/net80211/ieee80211.c Wed Oct 7 21:56:58 2020 (r366522) @@ -158,7 +158,7 @@ ieee80211_chan_init(struct ieee80211com *ic) /* * Setup the HT40/VHT40 upper/lower bits. - * The VHT80 math is done elsewhere. + * The VHT80/... math is done elsewhere. */ if (IEEE80211_IS_CHAN_HT40(c) && c->ic_extieee == 0) c->ic_extieee = ieee80211_mhz2ieee(c->ic_freq + @@ -167,8 +167,8 @@ ieee80211_chan_init(struct ieee80211com *ic) /* Update VHT math */ /* - * XXX VHT again, note that this assumes VHT80 channels - * are legit already + * XXX VHT again, note that this assumes VHT80/... channels + * are legit already. */ set_vht_extchan(c); @@ -712,8 +712,8 @@ ieee80211_vap_attach(struct ieee80211vap *vap, ifm_cha ieee80211_syncflag_vht_locked(ic, IEEE80211_FVHT_VHT); ieee80211_syncflag_vht_locked(ic, IEEE80211_FVHT_USEVHT40); ieee80211_syncflag_vht_locked(ic, IEEE80211_FVHT_USEVHT80); - ieee80211_syncflag_vht_locked(ic, IEEE80211_FVHT_USEVHT80P80); ieee80211_syncflag_vht_locked(ic, IEEE80211_FVHT_USEVHT160); + ieee80211_syncflag_vht_locked(ic, IEEE80211_FVHT_USEVHT80P80); IEEE80211_UNLOCK(ic); return 1; @@ -767,8 +767,8 @@ ieee80211_vap_detach(struct ieee80211vap *vap) ieee80211_syncflag_vht_locked(ic, IEEE80211_FVHT_VHT); ieee80211_syncflag_vht_locked(ic, IEEE80211_FVHT_USEVHT40); ieee80211_syncflag_vht_locked(ic, IEEE80211_FVHT_USEVHT80); - ieee80211_syncflag_vht_locked(ic, IEEE80211_FVHT_USEVHT80P80); ieee80211_syncflag_vht_locked(ic, IEEE80211_FVHT_USEVHT160); + ieee80211_syncflag_vht_locked(ic, IEEE80211_FVHT_USEVHT80P80); /* NB: this handles the bpfdetach done below */ ieee80211_syncflag_ext_locked(ic, IEEE80211_FEXT_BPF); @@ -1160,7 +1160,7 @@ struct vht_chan_range vht80_chan_ranges[] = { { 5570, 5650 }, { 5650, 5730 }, { 5735, 5815 }, - { 0, 0, } + { 0, 0 } }; static int Modified: head/sys/net80211/ieee80211_node.h ============================================================================== --- head/sys/net80211/ieee80211_node.h Wed Oct 7 20:31:13 2020 (r366521) +++ head/sys/net80211/ieee80211_node.h Wed Oct 7 21:56:58 2020 (r366522) @@ -70,7 +70,7 @@ struct ieee80211vap; struct ieee80211_scanparams; /* - * Information element ``blob''. We use this structure + * Information element (IE) ``blob''. We use this structure * to capture management frame payloads that need to be * retained. Information elements within the payload that * we need to consult have references recorded. From owner-svn-src-head@freebsd.org Wed Oct 7 22:07: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 3E133439C95; Wed, 7 Oct 2020 22:07:27 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C67jq0wD4z45rV; Wed, 7 Oct 2020 22:07:27 +0000 (UTC) (envelope-from bz@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 F25B31E540; Wed, 7 Oct 2020 22:07:26 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 097M7QKf014015; Wed, 7 Oct 2020 22:07:26 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 097M7QU0014014; Wed, 7 Oct 2020 22:07:26 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202010072207.097M7QU0014014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 7 Oct 2020 22:07:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366523 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 366523 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, 07 Oct 2020 22:07:27 -0000 Author: bz Date: Wed Oct 7 22:07:26 2020 New Revision: 366523 URL: https://svnweb.freebsd.org/changeset/base/366523 Log: LinuxKPI: add a bitfield.h implementation. This code was iteratively implemented during the work on various WiFi drivers -- from individual functions to a macro-created implementations for the various bit sized needed (and then extended to more for comepleteness). Some of the bit combinations do not seem to make sense so are left out. The __bf_shf(x) was obtained from D26681 [1]. Requested by: manu [1] Reviewed by: hselasky, manu MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26708 Added: head/sys/compat/linuxkpi/common/include/linux/bitfield.h (contents, props changed) Added: head/sys/compat/linuxkpi/common/include/linux/bitfield.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/bitfield.h Wed Oct 7 22:07:26 2020 (r366523) @@ -0,0 +1,105 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Björn Zeeb under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_BITFIELD_H +#define _LINUX_BITFIELD_H + +#include +#include + +/* Use largest possible type. */ +static inline uint64_t ___lsb(uint64_t f) { return (f & -f); } +static inline uint64_t ___bitmask(uint64_t f) { return (f / ___lsb(f)); } + +#define _uX_get_bits(_n) \ + static __inline uint ## _n ## _t \ + u ## _n ## _get_bits(uint ## _n ## _t v, uint ## _n ## _t f) \ + { \ + return ((v & f) / ___lsb(f)); \ + } + +_uX_get_bits(64) +_uX_get_bits(32) +_uX_get_bits(16) +_uX_get_bits(8) + +#define _leX_get_bits(_n) \ + static __inline uint ## _n ## _t \ + le ## _n ## _get_bits(__le ## _n v, uint ## _n ## _t f) \ + { \ + return ((le ## _n ## _to_cpu(v) & f) / ___lsb(f)); \ + } + +_leX_get_bits(64) +_leX_get_bits(32) +_leX_get_bits(16) + +#define _uX_encode_bits(_n) \ + static __inline uint ## _n ## _t \ + u ## _n ## _encode_bits(uint ## _n ## _t v, uint ## _n ## _t f) \ + { \ + return ((v & ___bitmask(f)) * ___lsb(f)); \ + } + +_uX_encode_bits(64) +_uX_encode_bits(32) +_uX_encode_bits(16) +_uX_encode_bits(8) + +#define _leX_encode_bits(_n) \ + static __inline uint ## _n ## _t \ + le ## _n ## _encode_bits(__le ## _n v, uint ## _n ## _t f)\ + { \ + return (cpu_to_le ## _n((v & ___bitmask(f)) * ___lsb(f))); \ + } + +_leX_encode_bits(64) +_leX_encode_bits(32) +_leX_encode_bits(16) + +static __inline void +le32p_replace_bits(uint32_t *p, uint32_t v, uint32_t f) +{ + + *p = (*p & ~(cpu_to_le32(v))) | le32_encode_bits(v, f); + return; +} + +#define __bf_shf(x) (__builtin_ffsll(x) - 1) + +#define FIELD_PREP(_mask, _value) \ + (((typeof(_mask))(_value) << __bf_shf(_mask)) & (_mask)) + +#define FIELD_GET(_mask, _value) \ + ((typeof(_mask))(((_value) & (_mask)) >> __bf_shf(_mask))) + +#endif /* _LINUX_BITFIELD_H */ From owner-svn-src-head@freebsd.org Wed Oct 7 22:29: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 8B19E43A3D0; Wed, 7 Oct 2020 22:29:27 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C68CC28SHz47CY; Wed, 7 Oct 2020 22:29:27 +0000 (UTC) (envelope-from bz@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 2DCE11EBDF; Wed, 7 Oct 2020 22:29:27 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 097MTR3T026474; Wed, 7 Oct 2020 22:29:27 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 097MTRol026473; Wed, 7 Oct 2020 22:29:27 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202010072229.097MTRol026473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 7 Oct 2020 22:29:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366524 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 366524 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, 07 Oct 2020 22:29:27 -0000 Author: bz Date: Wed Oct 7 22:29:26 2020 New Revision: 366524 URL: https://svnweb.freebsd.org/changeset/base/366524 Log: 80211: ifconfig replace MS() with _IEEE80211_MASKSHIFT() As we did in the kernel in r366112 replace the MS() macro with the version(s) added to the kernel: _IEEE80211_MASKSHIFT(). Also provide its counter part. This will later allow use to use other macros defined in net80211 headers here in ifconfig. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Wed Oct 7 22:07:26 2020 (r366523) +++ head/sbin/ifconfig/ifieee80211.c Wed Oct 7 22:29:26 2020 (r366524) @@ -138,6 +138,14 @@ #define IEEE80211_FVHT_USEVHT80P80 0x000000010 /* CONF: Use VHT 80+80 */ #endif +/* Helper macros unified. */ +#ifndef _IEEE80211_MASKSHIFT +#define _IEEE80211_MASKSHIFT(_v, _f) (((_v) & _f) >> _f##_S) +#endif +#ifndef _IEEE80211_SHIFTMASK +#define _IEEE80211_SHIFTMASK(_v, _f) (((_v) << _f##_S) & _f) +#endif + #define MAXCHAN 1536 /* max 1.5K channels */ #define MAXCOL 78 @@ -2706,7 +2714,6 @@ printie(const char* tag, const uint8_t *ie, size_t iel static void printwmeparam(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen) { -#define MS(_v, _f) (((_v) & _f) >> _f##_S) static const char *acnames[] = { "BE", "BK", "VO", "VI" }; const struct ieee80211_wme_param *wme = (const struct ieee80211_wme_param *) ie; @@ -2721,17 +2728,17 @@ printwmeparam(const char *tag, const u_int8_t *ie, siz const struct ieee80211_wme_acparams *ac = &wme->params_acParams[i]; - printf(" %s[%saifsn %u cwmin %u cwmax %u txop %u]" - , acnames[i] - , MS(ac->acp_aci_aifsn, WME_PARAM_ACM) ? "acm " : "" - , MS(ac->acp_aci_aifsn, WME_PARAM_AIFSN) - , MS(ac->acp_logcwminmax, WME_PARAM_LOGCWMIN) - , MS(ac->acp_logcwminmax, WME_PARAM_LOGCWMAX) - , LE_READ_2(&ac->acp_txop) - ); + printf(" %s[%saifsn %u cwmin %u cwmax %u txop %u]", acnames[i], + _IEEE80211_MASKSHIFT(ac->acp_aci_aifsn, WME_PARAM_ACM) ? + "acm " : "", + _IEEE80211_MASKSHIFT(ac->acp_aci_aifsn, WME_PARAM_AIFSN), + _IEEE80211_MASKSHIFT(ac->acp_logcwminmax, + WME_PARAM_LOGCWMIN), + _IEEE80211_MASKSHIFT(ac->acp_logcwminmax, + WME_PARAM_LOGCWMAX), + LE_READ_2(&ac->acp_txop)); } printf(">"); -#undef MS } static void From owner-svn-src-head@freebsd.org Wed Oct 7 22:52: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 B93B743AA22; Wed, 7 Oct 2020 22:52:24 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C68jh4ZVfz49Kf; Wed, 7 Oct 2020 22:52:24 +0000 (UTC) (envelope-from bz@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 814BF1EFF5; Wed, 7 Oct 2020 22:52:24 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 097MqO87044463; Wed, 7 Oct 2020 22:52:24 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 097MqOUP044462; Wed, 7 Oct 2020 22:52:24 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202010072252.097MqOUP044462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 7 Oct 2020 22:52:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366525 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 366525 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, 07 Oct 2020 22:52:24 -0000 Author: bz Date: Wed Oct 7 22:52:24 2020 New Revision: 366525 URL: https://svnweb.freebsd.org/changeset/base/366525 Log: net80211: whitespace Fix indentation for the multi-line copies of ieee80211_add_channel_list_5ghz() for the 3 bands. MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/net80211/ieee80211_regdomain.c Modified: head/sys/net80211/ieee80211_regdomain.c ============================================================================== --- head/sys/net80211/ieee80211_regdomain.c Wed Oct 7 22:29:26 2020 (r366524) +++ head/sys/net80211/ieee80211_regdomain.c Wed Oct 7 22:52:24 2020 (r366525) @@ -158,14 +158,14 @@ ieee80211_init_channels(struct ieee80211com *ic, IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK) == 2) cbw_flags |= NET80211_CBW_FLAG_VHT80P80; ieee80211_add_channel_list_5ghz(chans, IEEE80211_CHAN_MAX, - nchans, def_chan_5ghz_band1, nitems(def_chan_5ghz_band1), - bands, cbw_flags); + nchans, def_chan_5ghz_band1, nitems(def_chan_5ghz_band1), + bands, cbw_flags); ieee80211_add_channel_list_5ghz(chans, IEEE80211_CHAN_MAX, nchans, def_chan_5ghz_band2, nitems(def_chan_5ghz_band2), - bands, cbw_flags); + bands, cbw_flags); ieee80211_add_channel_list_5ghz(chans, IEEE80211_CHAN_MAX, nchans, def_chan_5ghz_band3, nitems(def_chan_5ghz_band3), - bands, cbw_flags); + bands, cbw_flags); } if (rd != NULL) ic->ic_regdomain = *rd; From owner-svn-src-head@freebsd.org Wed Oct 7 23:14: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 D5ED443A769; Wed, 7 Oct 2020 23:14:49 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C69CY55Xyz4B79; Wed, 7 Oct 2020 23:14:49 +0000 (UTC) (envelope-from mhorne@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 915CD1F451; Wed, 7 Oct 2020 23:14:49 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 097NEnbT056875; Wed, 7 Oct 2020 23:14:49 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 097NEnp0056874; Wed, 7 Oct 2020 23:14:49 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202010072314.097NEnp0056874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Wed, 7 Oct 2020 23:14:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366526 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366526 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, 07 Oct 2020 23:14:49 -0000 Author: mhorne Date: Wed Oct 7 23:14:49 2020 New Revision: 366526 URL: https://svnweb.freebsd.org/changeset/base/366526 Log: Handle kmod local relocation failures gracefully It is possible for elf_reloc_local() to fail in the unlikely case of an unsupported relocation type. If this occurs, do not continue to process the file. Reviewed by: kib, markj (earlier version) MFC after: 1 week Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26701 Modified: head/sys/kern/link_elf_obj.c Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Wed Oct 7 22:52:24 2020 (r366525) +++ head/sys/kern/link_elf_obj.c Wed Oct 7 23:14:49 2020 (r366526) @@ -1676,9 +1676,11 @@ link_elf_reloc_local(linker_file_t lf, bool ifuncs) if (ELF_ST_BIND(sym->st_info) != STB_LOCAL) continue; if ((ELF_ST_TYPE(sym->st_info) == STT_GNU_IFUNC || - elf_is_ifunc_reloc(rel->r_info)) == ifuncs) - elf_reloc_local(lf, base, rel, ELF_RELOC_REL, - elf_obj_lookup); + elf_is_ifunc_reloc(rel->r_info)) != ifuncs) + continue; + if (elf_reloc_local(lf, base, rel, ELF_RELOC_REL, + elf_obj_lookup) != 0) + return (ENOEXEC); } } @@ -1704,9 +1706,11 @@ link_elf_reloc_local(linker_file_t lf, bool ifuncs) if (ELF_ST_BIND(sym->st_info) != STB_LOCAL) continue; if ((ELF_ST_TYPE(sym->st_info) == STT_GNU_IFUNC || - elf_is_ifunc_reloc(rela->r_info)) == ifuncs) - elf_reloc_local(lf, base, rela, ELF_RELOC_RELA, - elf_obj_lookup); + elf_is_ifunc_reloc(rela->r_info)) != ifuncs) + continue; + if (elf_reloc_local(lf, base, rela, ELF_RELOC_RELA, + elf_obj_lookup) != 0) + return (ENOEXEC); } } return (0); From owner-svn-src-head@freebsd.org Thu Oct 8 00:35: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 BBB3E43C305; Thu, 8 Oct 2020 00:35:38 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6C0p4k5qz4GQT; Thu, 8 Oct 2020 00:35:38 +0000 (UTC) (envelope-from philip@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 8626A1FE4C; Thu, 8 Oct 2020 00:35:38 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0980Zcs6005835; Thu, 8 Oct 2020 00:35:38 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0980Zb6X005827; Thu, 8 Oct 2020 00:35:37 GMT (envelope-from philip@FreeBSD.org) Message-Id: <202010080035.0980Zb6X005827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Thu, 8 Oct 2020 00:35:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366529 - head/contrib/tzdata X-SVN-Group: head X-SVN-Commit-Author: philip X-SVN-Commit-Paths: head/contrib/tzdata X-SVN-Commit-Revision: 366529 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, 08 Oct 2020 00:35:38 -0000 Author: philip Date: Thu Oct 8 00:35:36 2020 New Revision: 366529 URL: https://svnweb.freebsd.org/changeset/base/366529 Log: Import tzdata 2020b Changes: https://github.com/eggert/tz/blob/2020b/NEWS MFC after: 3 days Modified: head/contrib/tzdata/Makefile head/contrib/tzdata/NEWS head/contrib/tzdata/README head/contrib/tzdata/africa head/contrib/tzdata/antarctica head/contrib/tzdata/asia head/contrib/tzdata/australasia head/contrib/tzdata/backzone head/contrib/tzdata/europe head/contrib/tzdata/leap-seconds.list head/contrib/tzdata/leapseconds head/contrib/tzdata/leapseconds.awk head/contrib/tzdata/northamerica head/contrib/tzdata/southamerica head/contrib/tzdata/theory.html head/contrib/tzdata/version head/contrib/tzdata/zishrink.awk head/contrib/tzdata/zoneinfo2tdf.pl Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/Makefile ============================================================================== --- head/contrib/tzdata/Makefile Thu Oct 8 00:29:52 2020 (r366528) +++ head/contrib/tzdata/Makefile Thu Oct 8 00:35:36 2020 (r366529) @@ -22,13 +22,13 @@ BUGEMAIL= tz@iana.org # DATAFORM= main # To wait even longer for new features, use: # DATAFORM= rearguard +# Rearguard users might also want "ZFLAGS = -b fat"; see below. DATAFORM= main # Change the line below for your timezone (after finding the one you want in # one of the $(TDATA) source files, or adding it to a source file). # Alternatively, if you discover you've got the wrong timezone, you can just -# zic -l rightzone -# to correct things. +# 'zic -l -' to remove it, or 'zic -l rightzone' to change it. # Use the command # make zonenames # to get a list of the values you can use for LOCALTIME. @@ -37,33 +37,30 @@ LOCALTIME= GMT # The POSIXRULES macro controls interpretation of nonstandard and obsolete # POSIX-like TZ settings like TZ='EET-2EEST' that lack DST transition rules. -# In the reference implementation, if you want something other than Eastern -# United States time as a template for handling these settings, you can -# change the line below (after finding the timezone you want in the -# one of the $(TDATA) source files, or adding it to a source file). -# A setting like TZ='EET-2EEST' is supposed to use the rules in the -# template file to determine "spring forward" and "fall back" days and -# times; the environment variable itself specifies UT offsets of standard and -# daylight saving time. -# Alternatively, if you discover you've got the wrong timezone, you can just -# zic -p rightzone -# to correct things. -# Use the command -# make zonenames -# to get a list of the values you can use for POSIXRULES. +# Such a setting uses the rules in a template file to determine +# "spring forward" and "fall back" days and times; the environment +# variable itself specifies UT offsets of standard and daylight saving time. # -# If POSIXRULES is empty, no template is installed; this is the intended -# future default for POSIXRULES. +# If POSIXRULES is '-', no template is installed; this is the default. # -# Nonempty POSIXRULES is obsolete and should not be relied on, because: +# Any other value for POSIXRULES is obsolete and should not be relied on, as: # * It does not work correctly in popular implementations such as GNU/Linux. # * It does not work in the tzdb implementation for timestamps after 2037. # * It is incompatible with 'zic -b slim' if POSIXRULES specifies transitions # at standard time or UT rather than at local time. # In short, software should avoid ruleless settings like TZ='EET-2EEST' # and so should not depend on the value of POSIXRULES. +# +# If, despite the above, you want a template for handling these settings, +# you can change the line below (after finding the timezone you want in the +# one of the $(TDATA) source files, or adding it to a source file). +# Alternatively, if you discover you've got the wrong timezone, you can just +# 'zic -p -' to remove it, or 'zic -p rightzone' to change it. +# Use the command +# make zonenames +# to get a list of the values you can use for POSIXRULES. -POSIXRULES= America/New_York +POSIXRULES= - # Also see TZDEFRULESTRING below, which takes effect only # if the time zone files cannot be accessed. @@ -172,9 +169,6 @@ TZDATA_TEXT= leapseconds tzdata.zi # For backward-compatibility links for old zone names, use # BACKWARD= backward -# If you also want the link US/Pacific-New, even though it is confusing -# and is planned to be removed from the database eventually, use -# BACKWARD= backward pacificnew # To omit these links, use # BACKWARD= @@ -192,10 +186,6 @@ PACKRATDATA= UTF8_LOCALE= en_US.utf8 -# Since "." may not be in PATH... - -YEARISTYPE= ./yearistype - # Non-default libraries needed to link. LDLIBS= @@ -253,13 +243,12 @@ LDLIBS= # other than simply getting garbage data # -DUSE_LTZ=0 to build zdump with the system time zone library # Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below. -# -DZIC_BLOAT_DEFAULT=\"slim\" to default zic's -b option to "slim", and -# similarly for "fat". Fat TZif files work around incompatibilities +# -DZIC_BLOAT_DEFAULT=\"fat\" to default zic's -b option to "fat", and +# similarly for "slim". Fat TZif files work around incompatibilities # and bugs in some TZif readers, notably readers that mishandle 64-bit # data in TZif files. Slim TZif files are more efficient and do not # work around these incompatibilities and bugs. If not given, the -# current default is "fat" but this is intended to change as readers -# requiring fat files often mishandle timestamps after 2037 anyway. +# default is "slim". # -DZIC_MAX_ABBR_LEN_WO_WARN=3 # (or some other number) to set the maximum time zone abbreviation length # that zic will accept without a warning (the default is 6) @@ -333,9 +322,8 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # add # -DSTD_INSPIRED # to the end of the "CFLAGS=" line. This arranges for the functions -# "tzsetwall", "offtime", "timelocal", "timegm", "timeoff", +# "offtime", "timelocal", "timegm", "timeoff", # "posix2time", and "time2posix" to be added to the time conversion library. -# "tzsetwall" is deprecated and is intended to be removed soon; see NEWS. # "offtime" is like "gmtime" except that it accepts a second (long) argument # that gives an offset to add to the time_t when converting it. # "timelocal" is equivalent to "mktime". @@ -395,7 +383,7 @@ ZIC= $(zic) $(ZFLAGS) # To shrink the size of installed TZif files, # append "-r @N" to omit data before N-seconds-after-the-Epoch. -# You can also append "-b slim" if that is not already the default; +# To grow the files and work around older application bugs, append "-b fat"; # see ZIC_BLOAT_DEFAULT above. # See the zic man page for more about -b and -r. ZFLAGS= @@ -424,26 +412,6 @@ CURL= curl # Name of GNU Privacy Guard , used to sign distributions. GPG= gpg -# The path where SGML DTDs are kept and the catalog file(s) to use when -# validating HTML 4.01. The default should work on both Debian and Red Hat. -SGML_TOPDIR= /usr -SGML_DTDDIR= $(SGML_TOPDIR)/share/xml/w3c-sgml-lib/schema/dtd -SGML_SEARCH_PATH= $(SGML_DTDDIR)/REC-html401-19991224 -SGML_CATALOG_FILES= \ - $(SGML_TOPDIR)/share/doc/w3-recs/html/www.w3.org/TR/1999/REC-html401-19991224/HTML4.cat:$(SGML_TOPDIR)/share/sgml/html/4.01/HTML4.cat - -# The name, arguments and environment of a program to validate HTML 4.01. -# See for a validator, and -# for a validation library. -# Set VALIDATE=':' if you do not have such a program. -VALIDATE = nsgmls -VALIDATE_FLAGS = -s -B -wall -wno-unused-param -VALIDATE_ENV = \ - SGML_CATALOG_FILES='$(SGML_CATALOG_FILES)' \ - SGML_SEARCH_PATH='$(SGML_SEARCH_PATH)' \ - SP_CHARSET_FIXED=YES \ - SP_ENCODING=UTF-8 - # This expensive test requires USE_LTZ. # To suppress it, define this macro to be empty. CHECK_TIME_T_ALTERNATIVES = check_time_t_alternatives @@ -538,8 +506,8 @@ DOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES) PRIMARY_YDATA= africa antarctica asia australasia \ europe northamerica southamerica YDATA= $(PRIMARY_YDATA) etcetera -NDATA= systemv factory -TDATA_TO_CHECK= $(YDATA) $(NDATA) backward pacificnew +NDATA= factory +TDATA_TO_CHECK= $(YDATA) $(NDATA) backward TDATA= $(YDATA) $(NDATA) $(BACKWARD) ZONETABLES= zone1970.tab zone.tab TABDATA= iso3166.tab $(TZDATA_TEXT) $(ZONETABLES) @@ -547,7 +515,7 @@ LEAP_DEPS= leapseconds.awk leap-seconds.list TZDATA_ZI_DEPS= ziguard.awk zishrink.awk version $(TDATA) $(PACKRATDATA) DSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA) DATA= $(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \ - leapseconds yearistype.sh $(ZONETABLES) + leapseconds $(ZONETABLES) AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk \ ziguard.awk zishrink.awk MISC= $(AWK_SCRIPTS) zoneinfo2tdf.pl @@ -573,12 +541,10 @@ VERSION_DEPS= \ etcetera europe factory iso3166.tab \ leap-seconds.list leapseconds.awk localtime.c \ newctime.3 newstrftime.3 newtzset.3 northamerica \ - pacificnew private.h \ - southamerica strftime.c systemv theory.html \ + private.h southamerica strftime.c theory.html \ time2posix.3 tz-art.html tz-how-to.html tz-link.html \ tzfile.5 tzfile.h tzselect.8 tzselect.ksh \ - workman.sh yearistype.sh \ - zdump.8 zdump.c zic.8 zic.c \ + workman.sh zdump.8 zdump.c zic.8 zic.c \ ziguard.awk zishrink.awk \ zone.tab zone1970.tab zoneinfo2tdf.pl @@ -587,7 +553,7 @@ VERSION_DEPS= \ SHELL= /bin/sh -all: tzselect yearistype zic zdump libtz.a $(TABDATA) \ +all: tzselect zic zdump libtz.a $(TABDATA) \ vanguard.zi main.zi rearguard.zi ALL: all date $(ENCHILADA) @@ -657,10 +623,6 @@ zdump: $(TZDOBJS) zic: $(TZCOBJS) $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS) -yearistype: yearistype.sh - cp yearistype.sh yearistype - chmod +x yearistype - leapseconds: $(LEAP_DEPS) $(AWK) -v EXPIRES_LINE=$(EXPIRES_LINE) \ -f leapseconds.awk leap-seconds.list >$@.out @@ -675,10 +637,9 @@ INSTALLARGS = \ PACKRATDATA='$(PACKRATDATA)' \ TZDEFAULT='$(TZDEFAULT)' \ TZDIR='$(TZDIR)' \ - YEARISTYPE='$(YEARISTYPE)' \ ZIC='$(ZIC)' -INSTALL_DATA_DEPS = zic leapseconds yearistype tzdata.zi +INSTALL_DATA_DEPS = zic leapseconds tzdata.zi # 'make install_data' installs one set of TZif files. install_data: $(INSTALL_DATA_DEPS) @@ -793,7 +754,7 @@ check_character_set: $(ENCHILADA) ! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_'$(OK_CHAR)'*$$' \ Makefile && \ ! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \ - leapseconds yearistype.sh zone.tab && \ + leapseconds zone.tab && \ ! grep -Env $(OK_LINE) $(ENCHILADA); \ } touch $@ @@ -845,15 +806,13 @@ check_tzs: $(TZS) $(TZS_NEW) check_web: $(CHECK_WEB_PAGES) check_theory.html: theory.html check_tz-art.html: tz-art.html +check_tz-how-to.html: tz-how-to.html check_tz-link.html: tz-link.html -check_theory.html check_tz-art.html check_tz-link.html: +check_theory.html check_tz-art.html check_tz-how-to.html check_tz-link.html: $(CURL) -sS --url https://validator.w3.org/nu/ -F out=gnu \ -F file=@$$(expr $@ : 'check_\(.*\)') -o $@.out && \ test ! -s $@.out || { cat $@.out; exit 1; } mv $@.out $@ -check_tz-how-to.html: tz-how-to.html - $(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html - touch $@ # Check that zishrink.awk does not alter the data, and that ziguard.awk # preserves main-format data. @@ -883,7 +842,7 @@ clean_misc: rm -fr check_*.dir rm -f *.o *.out $(TIME_T_ALTERNATIVES) \ check_* core typecheck_* \ - date tzselect version.h zdump zic yearistype libtz.a + date tzselect version.h zdump zic libtz.a clean: clean_misc rm -fr *.dir tzdb-*/ rm -f *.zi $(TZS_NEW) Modified: head/contrib/tzdata/NEWS ============================================================================== --- head/contrib/tzdata/NEWS Thu Oct 8 00:29:52 2020 (r366528) +++ head/contrib/tzdata/NEWS Thu Oct 8 00:35:36 2020 (r366529) @@ -1,5 +1,76 @@ News for the tz database +Release 2020b - 2020-10-06 18:35:04 -0700 + + Briefly: + Revised predictions for Morocco's changes starting in 2023. + Canada's Yukon changes to -07 on 2020-11-01, not 2020-03-08. + Macquarie Island has stayed in sync with Tasmania since 2011. + Casey, Antarctica is at +08 in winter and +11 in summer. + zic no longer supports -y, nor the TYPE field of Rules. + + Changes to future timestamps + + Morocco's spring-forward after Ramadan is now predicted to occur + no sooner than two days after Ramadan, instead of one day. + (Thanks to Milamber.) The first altered prediction is for 2023, + now predicted to spring-forward on April 30 instead of April 23. + + Changes to past and future timestamps + + Casey Station, Antarctica has been using +08 in winter and +11 in + summer since 2018. The most recent transition from +08 to +11 was + 2020-10-04 00:01. Also, Macquarie Island has been staying in + sync with Tasmania since 2011. (Thanks to Steffen Thorsen.) + + Changes to past and future time zone abbreviations and DST flags + + Canada's Yukon, represented by America/Whitehorse and + America/Dawson, changes its time zone rules from -08/-07 to + permanent -07 on 2020-11-01, not on 2020-03-08 as 2020a had it. + This change affects only the time zone abbreviation (MST vs PDT) + and daylight saving flag for the period between the two dates. + (Thanks to Andrew G. Smith.) + + Changes to past timestamps + + Correct several transitions for Hungary for 1918/1983. + For example, the 1983-09-25 fall-back was at 01:00, not 03:00. + (Thanks to Géza Nyáry.) Also, the 1890 transition to standard + time was on 11-01, not 10-01 (thanks to Michael Deckers). + + The 1891 French transition was on March 16, not March 15. The + 1911-03-11 French transition was at midnight, not a minute later. + Monaco's transitions were on 1892-06-01 and 1911-03-29, not + 1891-03-15 and 1911-03-11. (Thanks to Michael Deckers.) + + Changes to code + + Support for zic's long-obsolete '-y YEARISTYPE' option has been + removed and, with it, so has support for the TYPE field in Rule + lines, which is now reserved for compatibility with earlier zic. + These features were previously deprecated in release 2015f. + (Thanks to Tim Parenti.) + + zic now defaults to '-b slim' instead of to '-b fat'. + + zic's new '-l -' and '-p -' options uninstall any existing + localtime and posixrules files, respectively. + + The undocumented and ineffective tzsetwall function has been + removed. + + Changes to build procedure + + The Makefile now defaults POSIXRULES to '-', so the posixrules + feature (obsolete as of 2019b) is no longer installed by default. + + Changes to documentation and commentary + + The long-obsolete files pacificnew, systemv, and yearistype.sh have + been removed from the distribution. (Thanks to Tim Parenti.) + + Release 2020a - 2020-04-23 16:03:47 -0700 Briefly: Modified: head/contrib/tzdata/README ============================================================================== --- head/contrib/tzdata/README Thu Oct 8 00:29:52 2020 (r366528) +++ head/contrib/tzdata/README Thu Oct 8 00:35:36 2020 (r366529) @@ -20,6 +20,8 @@ substituting your desired installation directory for " make TOPDIR=$HOME/tzdir install $HOME/tzdir/usr/bin/zdump -v America/Los_Angeles +See the file tz-how-to.html for examples of how to read the data files. + This database of historical local time information has several goals: * Provide a compendium of data about the history of civil time that Modified: head/contrib/tzdata/africa ============================================================================== --- head/contrib/tzdata/africa Thu Oct 8 00:29:52 2020 (r366528) +++ head/contrib/tzdata/africa Thu Oct 8 00:35:36 2020 (r366529) @@ -64,7 +64,7 @@ # Corrections are welcome. # Algeria -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Algeria 1916 only - Jun 14 23:00s 1:00 S Rule Algeria 1916 1919 - Oct Sun>=1 23:00s 0 - Rule Algeria 1917 only - Mar 24 23:00s 1:00 S @@ -87,10 +87,9 @@ Rule Algeria 1978 only - Mar 24 1:00 1:00 S Rule Algeria 1978 only - Sep 22 3:00 0 - Rule Algeria 1980 only - Apr 25 0:00 1:00 S Rule Algeria 1980 only - Oct 31 2:00 0 - -# Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's -# more precise 0:09:21. +# See Europe/Paris for PMT-related transitions. # Zone NAME STDOFF RULES FORMAT [UNTIL] -Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 15 0:01 +Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 16 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time 0:00 Algeria WE%sT 1940 Feb 25 2:00 1:00 Algeria CE%sT 1946 Oct 7 @@ -176,7 +175,7 @@ Link Africa/Abidjan Atlantic/St_Helena # St Helena # Egypt was mean noon at the Great Pyramid, 2:04:30.5, but apparently this # did not apply to Cairo, Alexandria, or Port Said. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Egypt 1940 only - Jul 15 0:00 1:00 S Rule Egypt 1940 only - Oct 1 0:00 0 - Rule Egypt 1941 only - Apr 15 0:00 1:00 S @@ -411,7 +410,7 @@ Zone Africa/Cairo 2:05:09 - LMT 1900 Oct # now Ghana observed different DST regimes in different years. For # lack of better info, use Shanks except treat the minus sign as a # typo, and assume DST started in 1920 not 1936. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Ghana 1920 1942 - Sep 1 0:00 0:20 - Rule Ghana 1920 1942 - Dec 31 0:00 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] @@ -501,7 +500,7 @@ Zone Africa/Monrovia -0:43:08 - LMT 1882 # From Paul Eggert (2013-10-25): # For now, assume they're reverting to the pre-2012 rules of permanent UT +02. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Libya 1951 only - Oct 14 2:00 1:00 S Rule Libya 1952 only - Jan 1 0:00 0 - Rule Libya 1953 only - Oct 9 2:00 1:00 S @@ -624,7 +623,7 @@ Zone Africa/Tripoli 0:52:44 - LMT 1920 # "The trial ended on March 29, 2009, when the clocks moved back by one hour # at 2am (or 02:00) local time..." -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Mauritius 1982 only - Oct 10 0:00 1:00 - Rule Mauritius 1983 only - Mar 21 0:00 0 - Rule Mauritius 2008 only - Oct lastSun 2:00 1:00 - @@ -875,17 +874,30 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis # https://maroc-diplomatique.net/maroc-le-retour-a-lheure-gmt-est-prevu-dimanche-prochain/ # http://aujourdhui.ma/actualite/gmt1-retour-a-lheure-normale-dimanche-prochain-1 # -# From Paul Eggert (2020-04-14): +# From Milamber (2020-05-31) +# In Morocco (where I live), the end of Ramadan (Arabic month) is followed by +# the Eid al-Fitr, and concretely it's 1 or 2 day offs for the people (with +# traditional visiting of family, big lunches/dinners, etc.). So for this +# year the astronomical calculations don't include the following 2 days off in +# the calc. These 2 days fall in a Sunday/Monday, so it's not acceptable by +# people to have a time shift during these 2 days off. Perhaps you can modify +# the (predicted) rules for next years: if the end of Ramadan is a (probable) +# Friday or Saturday (and so the 2 days off are on a weekend), the next time +# shift will be the next weekend. +# +# From Paul Eggert (2020-05-31): # For now, guess that in the future Morocco will fall back at 03:00 # the last Sunday before Ramadan, and spring forward at 02:00 the -# first Sunday after the day after Ramadan. To implement this, -# transition dates for 2021 through 2087 were determined by running -# the following program under GNU Emacs 26.3. -# (let ((islamic-year 1442)) +# first Sunday after two days after Ramadan. To implement this, +# transition dates and times for 2019 through 2087 were determined by +# running the following program under GNU Emacs 26.3. (This algorithm +# also produces the correct transition dates for 2016 through 2018, +# though the times differ due to Morocco's time zone change in 2018.) +# (let ((islamic-year 1440)) # (require 'cal-islam) # (while (< islamic-year 1511) # (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) -# (b (1+ (calendar-islamic-to-absolute (list 10 1 islamic-year)))) +# (b (+ 2 (calendar-islamic-to-absolute (list 10 1 islamic-year)))) # (sunday 0)) # (while (/= sunday (mod (setq a (1- a)) 7))) # (while (/= sunday (mod b 7)) @@ -900,7 +912,7 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis # (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) # (setq islamic-year (+ 1 islamic-year)))) -# RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Morocco 1939 only - Sep 12 0:00 1:00 - Rule Morocco 1939 only - Nov 19 0:00 0 - Rule Morocco 1940 only - Feb 25 0:00 1:00 - @@ -951,7 +963,7 @@ Rule Morocco 2021 only - May 16 2:00 0 - Rule Morocco 2022 only - Mar 27 3:00 -1:00 - Rule Morocco 2022 only - May 8 2:00 0 - Rule Morocco 2023 only - Mar 19 3:00 -1:00 - -Rule Morocco 2023 only - Apr 23 2:00 0 - +Rule Morocco 2023 only - Apr 30 2:00 0 - Rule Morocco 2024 only - Mar 10 3:00 -1:00 - Rule Morocco 2024 only - Apr 14 2:00 0 - Rule Morocco 2025 only - Feb 23 3:00 -1:00 - @@ -967,7 +979,7 @@ Rule Morocco 2029 only - Feb 18 2:00 0 - Rule Morocco 2029 only - Dec 30 3:00 -1:00 - Rule Morocco 2030 only - Feb 10 2:00 0 - Rule Morocco 2030 only - Dec 22 3:00 -1:00 - -Rule Morocco 2031 only - Jan 26 2:00 0 - +Rule Morocco 2031 only - Feb 2 2:00 0 - Rule Morocco 2031 only - Dec 14 3:00 -1:00 - Rule Morocco 2032 only - Jan 18 2:00 0 - Rule Morocco 2032 only - Nov 28 3:00 -1:00 - @@ -983,7 +995,7 @@ Rule Morocco 2036 only - Nov 23 2:00 0 - Rule Morocco 2037 only - Oct 4 3:00 -1:00 - Rule Morocco 2037 only - Nov 15 2:00 0 - Rule Morocco 2038 only - Sep 26 3:00 -1:00 - -Rule Morocco 2038 only - Oct 31 2:00 0 - +Rule Morocco 2038 only - Nov 7 2:00 0 - Rule Morocco 2039 only - Sep 18 3:00 -1:00 - Rule Morocco 2039 only - Oct 23 2:00 0 - Rule Morocco 2040 only - Sep 2 3:00 -1:00 - @@ -999,7 +1011,7 @@ Rule Morocco 2044 only - Aug 28 2:00 0 - Rule Morocco 2045 only - Jul 9 3:00 -1:00 - Rule Morocco 2045 only - Aug 20 2:00 0 - Rule Morocco 2046 only - Jul 1 3:00 -1:00 - -Rule Morocco 2046 only - Aug 5 2:00 0 - +Rule Morocco 2046 only - Aug 12 2:00 0 - Rule Morocco 2047 only - Jun 23 3:00 -1:00 - Rule Morocco 2047 only - Jul 28 2:00 0 - Rule Morocco 2048 only - Jun 7 3:00 -1:00 - @@ -1015,7 +1027,7 @@ Rule Morocco 2052 only - Jun 2 2:00 0 - Rule Morocco 2053 only - Apr 13 3:00 -1:00 - Rule Morocco 2053 only - May 25 2:00 0 - Rule Morocco 2054 only - Apr 5 3:00 -1:00 - -Rule Morocco 2054 only - May 10 2:00 0 - +Rule Morocco 2054 only - May 17 2:00 0 - Rule Morocco 2055 only - Mar 28 3:00 -1:00 - Rule Morocco 2055 only - May 2 2:00 0 - Rule Morocco 2056 only - Mar 12 3:00 -1:00 - @@ -1031,7 +1043,7 @@ Rule Morocco 2060 only - Mar 7 2:00 0 - Rule Morocco 2061 only - Jan 16 3:00 -1:00 - Rule Morocco 2061 only - Feb 27 2:00 0 - Rule Morocco 2062 only - Jan 8 3:00 -1:00 - -Rule Morocco 2062 only - Feb 12 2:00 0 - +Rule Morocco 2062 only - Feb 19 2:00 0 - Rule Morocco 2062 only - Dec 31 3:00 -1:00 - Rule Morocco 2063 only - Feb 4 2:00 0 - Rule Morocco 2063 only - Dec 16 3:00 -1:00 - @@ -1047,7 +1059,7 @@ Rule Morocco 2067 only - Dec 11 2:00 0 - Rule Morocco 2068 only - Oct 21 3:00 -1:00 - Rule Morocco 2068 only - Dec 2 2:00 0 - Rule Morocco 2069 only - Oct 13 3:00 -1:00 - -Rule Morocco 2069 only - Nov 17 2:00 0 - +Rule Morocco 2069 only - Nov 24 2:00 0 - Rule Morocco 2070 only - Oct 5 3:00 -1:00 - Rule Morocco 2070 only - Nov 9 2:00 0 - Rule Morocco 2071 only - Sep 20 3:00 -1:00 - @@ -1063,7 +1075,7 @@ Rule Morocco 2075 only - Sep 15 2:00 0 - Rule Morocco 2076 only - Jul 26 3:00 -1:00 - Rule Morocco 2076 only - Sep 6 2:00 0 - Rule Morocco 2077 only - Jul 18 3:00 -1:00 - -Rule Morocco 2077 only - Aug 22 2:00 0 - +Rule Morocco 2077 only - Aug 29 2:00 0 - Rule Morocco 2078 only - Jul 10 3:00 -1:00 - Rule Morocco 2078 only - Aug 14 2:00 0 - Rule Morocco 2079 only - Jun 25 3:00 -1:00 - @@ -1073,13 +1085,13 @@ Rule Morocco 2080 only - Jul 21 2:00 0 - Rule Morocco 2081 only - Jun 1 3:00 -1:00 - Rule Morocco 2081 only - Jul 13 2:00 0 - Rule Morocco 2082 only - May 24 3:00 -1:00 - -Rule Morocco 2082 only - Jun 28 2:00 0 - +Rule Morocco 2082 only - Jul 5 2:00 0 - Rule Morocco 2083 only - May 16 3:00 -1:00 - Rule Morocco 2083 only - Jun 20 2:00 0 - Rule Morocco 2084 only - Apr 30 3:00 -1:00 - Rule Morocco 2084 only - Jun 11 2:00 0 - Rule Morocco 2085 only - Apr 22 3:00 -1:00 - -Rule Morocco 2085 only - May 27 2:00 0 - +Rule Morocco 2085 only - Jun 3 2:00 0 - Rule Morocco 2086 only - Apr 14 3:00 -1:00 - Rule Morocco 2086 only - May 19 2:00 0 - Rule Morocco 2087 only - Mar 30 3:00 -1:00 - @@ -1180,7 +1192,7 @@ Link Africa/Maputo Africa/Lusaka # Zambia # Use plain "WAT" and "CAT" for the time zone abbreviations, to be compatible # with Namibia's neighbors. -# RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S # Vanguard section, for zic and other parsers that support negative DST. Rule Namibia 1994 only - Mar 21 0:00 -1:00 WAT Rule Namibia 1994 2017 - Sep Sun>=1 2:00 0 CAT @@ -1303,7 +1315,7 @@ Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # Victoria # See Africa/Nairobi. # South Africa -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule SA 1942 1943 - Sep Sun>=15 2:00 1:00 - Rule SA 1943 1944 - Mar Sun>=15 2:00 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] @@ -1336,7 +1348,7 @@ Link Africa/Johannesburg Africa/Mbabane # Eswatini # Abdalla of NTC, archived at: # https://mm.icann.org/pipermail/tz/2017-October/025333.html -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Sudan 1970 only - May 1 0:00 1:00 S Rule Sudan 1970 1985 - Oct 15 0:00 0 - Rule Sudan 1971 only - Apr 30 0:00 1:00 S @@ -1424,7 +1436,7 @@ Zone Africa/Juba 2:06:28 - LMT 1931 # http://www.almadenahnews.com/newss/news.php?c=118&id=38036 # http://www.worldtimezone.com/dst_news/dst_news_tunis02.html -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Tunisia 1939 only - Apr 15 23:00s 1:00 S Rule Tunisia 1939 only - Nov 18 23:00s 0 - Rule Tunisia 1940 only - Feb 25 23:00s 1:00 S @@ -1451,9 +1463,7 @@ Rule Tunisia 2005 only - Sep 30 1:00s 0 - Rule Tunisia 2006 2008 - Mar lastSun 2:00s 1:00 S Rule Tunisia 2006 2008 - Oct lastSun 2:00s 0 - -# Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's -# more precise 0:09:21. -# Shanks & Pottenger say the 1911 switch was on Mar 9; go with Howse's Mar 11. +# See Europe/Paris for PMT-related transitions. # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Tunis 0:40:44 - LMT 1881 May 12 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time Modified: head/contrib/tzdata/antarctica ============================================================================== --- head/contrib/tzdata/antarctica Thu Oct 8 00:29:52 2020 (r366528) +++ head/contrib/tzdata/antarctica Thu Oct 8 00:35:36 2020 (r366529) @@ -70,15 +70,30 @@ # Australian Antarctica Division informed us that Casey changed time # zone to UTC+11 in "the morning of 22nd October 2016". +# From Steffen Thorsen (2020-10-02, as corrected): +# Based on information we have received from the Australian Antarctic +# Division, Casey station and Macquarie Island station will move to Tasmanian +# daylight savings time on Sunday 4 October. This will take effect from 0001 +# hrs on Sunday 4 October 2020 and will mean Casey and Macquarie Island will +# be on the same time zone as Hobart. Some past dates too for this 3 hour +# time change back and forth between UTC+8 and UTC+11 for Casey: +# - 2018 Oct 7 4:00 - 2019 Mar 17 3:00 - 2019 Oct 4 3:00 - 2020 Mar 8 3:00 +# and now - 2020 Oct 4 0:01 + # Zone NAME STDOFF RULES FORMAT [UNTIL] -Zone Antarctica/Casey 0 - -00 1969 - 8:00 - +08 2009 Oct 18 2:00 +Zone Antarctica/Casey 0 - -00 1969 + 8:00 - +08 2009 Oct 18 2:00 11:00 - +11 2010 Mar 5 2:00 - 8:00 - +08 2011 Oct 28 2:00 + 8:00 - +08 2011 Oct 28 2:00 11:00 - +11 2012 Feb 21 17:00u - 8:00 - +08 2016 Oct 22 + 8:00 - +08 2016 Oct 22 11:00 - +11 2018 Mar 11 4:00 - 8:00 - +08 + 8:00 - +08 2018 Oct 7 4:00 + 11:00 - +11 2019 Mar 17 3:00 + 8:00 - +08 2019 Oct 4 3:00 + 11:00 - +11 2020 Mar 8 3:00 + 8:00 - +08 2020 Oct 4 0:01 + 11:00 - +11 Zone Antarctica/Davis 0 - -00 1957 Jan 13 7:00 - +07 1964 Nov 0 - -00 1969 Feb @@ -224,7 +239,7 @@ Zone Antarctica/Syowa 0 - -00 1957 Jan 29 # suggested by Bengt-Inge Larsson comment them out for now, and approximate # with only UTC and CEST. Uncomment them when 2014b is more prevalent. # -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S #Rule Troll 2005 max - Mar 1 1:00u 1:00 +01 Rule Troll 2005 max - Mar lastSun 1:00u 2:00 +02 #Rule Troll 2005 max - Oct lastSun 1:00u 1:00 +01 Modified: head/contrib/tzdata/asia ============================================================================== --- head/contrib/tzdata/asia Thu Oct 8 00:29:52 2020 (r366528) +++ head/contrib/tzdata/asia Thu Oct 8 00:35:36 2020 (r366529) @@ -70,7 +70,7 @@ ############################################################################### # These rules are stolen from the 'europe' file. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule EUAsia 1981 max - Mar lastSun 1:00u 1:00 S Rule EUAsia 1979 1995 - Sep lastSun 1:00u 0 - Rule EUAsia 1996 max - Oct lastSun 1:00u 0 - @@ -114,7 +114,7 @@ Zone Asia/Kabul 4:36:48 - LMT 1890 # or # (brief) # http://www.worldtimezone.com/dst_news/dst_news_armenia03.html -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Armenia 2011 only - Mar lastSun 2:00s 1:00 - Rule Armenia 2011 only - Oct lastSun 2:00s 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] @@ -140,7 +140,7 @@ Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2 # http://vestnikkavkaza.net/news/Azerbaijani-Cabinet-of-Ministers-cancels-daylight-saving-time.html # http://en.apa.az/xeber_azerbaijan_abolishes_daylight_savings_ti_240862.html -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Azer 1997 2015 - Mar lastSun 4:00 1:00 - Rule Azer 1997 2015 - Oct lastSun 5:00 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] @@ -227,7 +227,7 @@ Zone Asia/Baku 3:19:24 - LMT 1924 May 2 # http://www.thedailystar.net/newDesign/latest_news.php?nid=22817 # http://www.worldtimezone.com/dst_news/dst_news_bangladesh06.html -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Dhaka 2009 only - Jun 19 23:00 1:00 - Rule Dhaka 2009 only - Dec 31 24:00 0 - @@ -303,7 +303,7 @@ Zone Asia/Yangon 6:24:47 - LMT 1880 # or Rangoo # generally esteemed a success, it was announced early in 1920 that it would # not be repeated." # -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Shang 1919 only - Apr 12 24:00 1:00 D Rule Shang 1919 only - Sep 30 24:00 0 S @@ -399,7 +399,7 @@ Rule Shang 1919 only - Sep 30 24:00 0 S # the Yangtze river delta area during that period of time although the scope # of such use will need to be investigated to determine. # -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Shang 1940 only - Jun 1 0:00 1:00 D Rule Shang 1940 only - Oct 12 24:00 0 S Rule Shang 1941 only - Mar 15 0:00 1:00 D @@ -462,7 +462,7 @@ Rule Shang 1948 1949 - Sep 30 24:00 0 S #plan # to begin on 17 April. # http://data.people.com.cn/pic/101p/1988/04/1988041201.jpg -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule PRC 1986 only - May 4 2:00 1:00 D Rule PRC 1986 1991 - Sep Sun>=11 2:00 0 S Rule PRC 1987 1991 - Apr Sun>=11 2:00 1:00 D @@ -846,7 +846,7 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # or dates for the 1942 and 1945 transitions. # The Japanese occupation of Hong Kong began 1941-12-25. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule HK 1946 only - Apr 21 0:00 1:00 S Rule HK 1946 only - Dec 1 3:30s 0 - Rule HK 1947 only - Apr 13 3:30s 1:00 S @@ -973,7 +973,7 @@ Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 0:36:42 # until 1945-09-21 at 01:00, overriding Shanks & Pottenger. # Likewise, use Yu-Cheng Chuang's data for DST in Taiwan. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Taiwan 1946 only - May 15 0:00 1:00 D Rule Taiwan 1946 only - Oct 1 0:00 0 S Rule Taiwan 1947 only - Apr 15 0:00 1:00 D @@ -1099,7 +1099,7 @@ Zone Asia/Taipei 8:06:00 - LMT 1896 Jan 1 # The 1904 decree says that Macau changed from the meridian of # Fortaleza do Monte, presumably the basis for the 7:34:10 for LMT. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Macau 1942 1943 - Apr 30 23:00 1:00 - Rule Macau 1942 only - Nov 17 23:00 0 - Rule Macau 1943 only - Sep 30 23:00 0 S @@ -1157,7 +1157,7 @@ Zone Asia/Macau 7:34:10 - LMT 1904 Oct 30 # Cyprus to remain united in time. Cyprus Mail 2017-10-17. # https://cyprus-mail.com/2017/10/17/cyprus-remain-united-time/ -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Cyprus 1975 only - Apr 13 0:00 1:00 S Rule Cyprus 1975 only - Oct 12 0:00 0 - Rule Cyprus 1976 only - May 15 0:00 1:00 S @@ -1534,7 +1534,7 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov # be changed back to its previous state on the 24 hours of the # thirtieth day of Shahrivar. # -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Iran 1978 1980 - Mar 20 24:00 1:00 - Rule Iran 1978 only - Oct 20 24:00 0 - Rule Iran 1979 only - Sep 18 24:00 0 - @@ -1676,7 +1676,7 @@ Zone Asia/Tehran 3:25:44 - LMT 1916 # We have published a short article in English about the change: # https://www.timeanddate.com/news/time/iraq-dumps-daylight-saving.html -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Iraq 1982 only - May 1 0:00 1:00 - Rule Iraq 1982 1984 - Oct 1 0:00 0 - Rule Iraq 1983 only - Mar 31 0:00 1:00 - @@ -1699,6 +1699,10 @@ Zone Asia/Baghdad 2:57:40 - LMT 1890 # Israel +# For more info about the motivation for DST in Israel, see: +# Barak Y. Israel's Daylight Saving Time controversy. Israel Affairs. +# 2020-08-11. https://doi.org/10.1080/13537121.2020.1806564 + # From Ephraim Silverberg (2001-01-11): # # I coined "IST/IDT" circa 1988. Until then there were three @@ -1720,7 +1724,7 @@ Zone Asia/Baghdad 2:57:40 - LMT 1890 # family is from India). # From Shanks & Pottenger: -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Zion 1940 only - Jun 1 0:00 1:00 D Rule Zion 1942 1944 - Nov 1 0:00 0 S Rule Zion 1943 only - Apr 1 2:00 1:00 D @@ -1812,7 +1816,7 @@ Rule Zion 1988 only - Sep 4 0:00 0 S # (except in 2002) is three nights before Yom Kippur [Day of Atonement] # (the eve of the 7th of Tishrei in the lunar Hebrew calendar). -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Zion 1989 only - Apr 30 0:00 1:00 D Rule Zion 1989 only - Sep 3 0:00 0 S Rule Zion 1990 only - Mar 25 0:00 1:00 D @@ -1828,7 +1832,7 @@ Rule Zion 1993 only - Sep 5 0:00 0 S # Ministry of Interior, Jerusalem, Israel. The spokeswoman can be reached by # calling the office directly at 972-2-6701447 or 972-2-6701448. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Zion 1994 only - Apr 1 0:00 1:00 D Rule Zion 1994 only - Aug 28 0:00 0 S Rule Zion 1995 only - Mar 31 0:00 1:00 D @@ -1848,7 +1852,7 @@ Rule Zion 1995 only - Sep 3 0:00 0 S # # where YYYY is the relevant year. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Zion 1996 only - Mar 15 0:00 1:00 D Rule Zion 1996 only - Sep 16 0:00 0 S Rule Zion 1997 only - Mar 21 0:00 1:00 D @@ -1871,7 +1875,7 @@ Rule Zion 1999 only - Sep 3 2:00 0 S # # ftp://ftp.cs.huji.ac.il/pub/tz/announcements/2000-2004.ps.gz -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Zion 2000 only - Apr 14 2:00 1:00 D Rule Zion 2000 only - Oct 6 1:00 0 S Rule Zion 2001 only - Apr 9 1:00 1:00 D @@ -1893,7 +1897,7 @@ Rule Zion 2004 only - Sep 22 1:00 0 S # # ftp://ftp.cs.huji.ac.il/pub/tz/announcements/2005+beyond.ps -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Zion 2005 2012 - Apr Fri<=1 2:00 1:00 D Rule Zion 2005 only - Oct 9 2:00 0 S Rule Zion 2006 only - Oct 1 2:00 0 S @@ -1913,7 +1917,7 @@ Rule Zion 2012 only - Sep 23 2:00 0 S # As of 2013, DST starts at 02:00 on the Friday before the last Sunday # in March. DST ends at 02:00 on the last Sunday of October. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Zion 2013 max - Mar Fri>=23 2:00 1:00 D Rule Zion 2013 max - Oct lastSun 2:00 0 S @@ -2013,7 +2017,7 @@ Zone Asia/Jerusalem 2:20:54 - LMT 1880 # do in any POSIX or C platform. The "25:00" assumes zic from 2007 or later, # which should be safe now. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Japan 1948 only - May Sat>=1 24:00 1:00 D Rule Japan 1948 1951 - Sep Sat>=8 25:00 0 S Rule Japan 1949 only - Apr Sat>=1 24:00 1:00 D @@ -2090,7 +2094,7 @@ Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 31 15:00u # From Paul Eggert (2013-12-11): # As Steffen suggested, consider the past 21-month experiment to be DST. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Jordan 1973 only - Jun 6 0:00 1:00 S Rule Jordan 1973 1975 - Oct 1 0:00 0 - Rule Jordan 1974 1977 - May 1 0:00 1:00 S @@ -2416,7 +2420,7 @@ Zone Asia/Oral 3:25:24 - LMT 1924 May 2 # or Ural'sk # Our government cancels daylight saving time 6th of August 2005. # From 2005-08-12 our GMT-offset is +6, w/o any daylight saving. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Kyrgyz 1992 1996 - Apr Sun>=7 0:00s 1:00 - Rule Kyrgyz 1992 1996 - Sep lastSun 0:00 0 - Rule Kyrgyz 1997 2005 - Mar lastSun 2:30 1:00 - @@ -2472,7 +2476,7 @@ Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2 # follow and continued to use GMT+9:00 for interoperability. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule ROK 1948 only - Jun 1 0:00 1:00 D Rule ROK 1948 only - Sep 12 24:00 0 S Rule ROK 1949 only - Apr 3 0:00 1:00 D @@ -2560,7 +2564,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 Apr 1 # Lebanon -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Lebanon 1920 only - Mar 28 0:00 1:00 S Rule Lebanon 1920 only - Oct 25 0:00 0 - Rule Lebanon 1921 only - Apr 3 0:00 1:00 S @@ -2590,7 +2594,7 @@ Zone Asia/Beirut 2:22:00 - LMT 1880 2:00 Lebanon EE%sT # Malaysia -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule NBorneo 1935 1941 - Sep 14 0:00 0:20 - Rule NBorneo 1935 1941 - Dec 14 0:00 0 - # @@ -2735,7 +2739,7 @@ Zone Indian/Maldives 4:54:00 - LMT 1880 # Malé # September daylight saving time ends. Source: # http://zasag.mn/news/view/8969 -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Mongol 1983 1984 - Apr 1 0:00 1:00 - Rule Mongol 1983 only - Oct 1 0:00 0 - # Shanks & Pottenger and IATA SSIM say 1990s switches occurred at 00:00, @@ -2923,7 +2927,7 @@ Zone Asia/Kathmandu 5:41:16 - LMT 1920 # "People laud PM's announcement to end DST" # http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=99374&Itemid=2 -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Pakistan 2002 only - Apr Sun>=2 0:00 1:00 S Rule Pakistan 2002 only - Oct Sun>=2 0:00 0 - Rule Pakistan 2008 only - Jun 1 0:00 1:00 S @@ -3225,7 +3229,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # From Tim Parenti (2016-10-19): # Predict fall transitions on October's last Saturday at 01:00 from now on. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S Rule EgyptAsia 1957 1958 - Oct 1 0:00 0 - Rule EgyptAsia 1958 only - May 1 0:00 1:00 S @@ -3325,7 +3329,7 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # influence of the sources. There is no current abbreviation for DST, # so use "PDT", the usual American style. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Phil 1936 only - Nov 1 0:00 1:00 D Rule Phil 1937 only - Feb 1 0:00 0 S Rule Phil 1954 only - Apr 12 0:00 1:00 D @@ -3473,7 +3477,7 @@ Zone Asia/Colombo 5:19:24 - LMT 1880 5:30 - +0530 # Syria -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Syria 1920 1923 - Apr Sun>=15 2:00 1:00 S Rule Syria 1920 1923 - Oct Sun>=1 2:00 0 - Rule Syria 1962 only - Apr 29 2:00 1:00 S Modified: head/contrib/tzdata/australasia ============================================================================== --- head/contrib/tzdata/australasia Thu Oct 8 00:29:52 2020 (r366528) +++ head/contrib/tzdata/australasia Thu Oct 8 00:35:36 2020 (r366529) @@ -13,7 +13,7 @@ # Please see the notes below for the controversy about "EST" versus "AEST" etc. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule Aus 1917 only - Jan 1 0:01 1:00 D Rule Aus 1917 only - Mar 25 2:00 0 S Rule Aus 1942 only - Jan 1 2:00 1:00 D @@ -32,7 +32,7 @@ Zone Australia/Darwin 8:43:20 - LMT 1895 Feb 9:30 Aus AC%sT # Western Australia # -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule AW 1974 only - Oct lastSun 2:00s 1:00 D Rule AW 1975 only - Mar Sun>=1 2:00s 0 S Rule AW 1983 only - Oct lastSun 2:00s 1:00 D @@ -70,7 +70,7 @@ Zone Australia/Eucla 8:35:28 - LMT 1895 Dec # applies to all of the Whitsundays. # http://www.australia.gov.au/about-australia/australian-story/austn-islands # -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule AQ 1971 only - Oct lastSun 2:00s 1:00 D Rule AQ 1972 only - Feb lastSun 2:00s 0 S Rule AQ 1989 1991 - Oct lastSun 2:00s 1:00 D @@ -86,7 +86,7 @@ Zone Australia/Lindeman 9:55:56 - LMT 1895 10:00 Holiday AE%sT # South Australia -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule AS 1971 1985 - Oct lastSun 2:00s 1:00 D Rule AS 1986 only - Oct 19 2:00s 1:00 D Rule AS 1987 2007 - Oct lastSun 2:00s 1:00 D @@ -114,7 +114,7 @@ Zone Australia/Adelaide 9:14:20 - LMT 1895 Feb # http://www.bom.gov.au/climate/averages/tables/dst_times.shtml # says King Island didn't observe DST from WWII until late 1971. # -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule AT 1967 only - Oct Sun>=1 2:00s 1:00 D Rule AT 1968 only - Mar lastSun 2:00s 0 S Rule AT 1968 1985 - Oct lastSun 2:00s 1:00 D @@ -147,7 +147,7 @@ Zone Australia/Currie 9:35:28 - LMT 1895 Sep 10:00 AT AE%sT # Victoria -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule AV 1971 1985 - Oct lastSun 2:00s 1:00 D Rule AV 1972 only - Feb lastSun 2:00s 0 S Rule AV 1973 1985 - Mar Sun>=1 2:00s 0 S @@ -168,7 +168,7 @@ Zone Australia/Melbourne 9:39:52 - LMT 1895 Feb 10:00 AV AE%sT # New South Wales -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule AN 1971 1985 - Oct lastSun 2:00s 1:00 D Rule AN 1972 only - Feb 27 2:00s 0 S Rule AN 1973 1981 - Mar Sun>=1 2:00s 0 S @@ -197,7 +197,7 @@ Zone Australia/Broken_Hill 9:25:48 - LMT 1895 Feb 9:30 AS AC%sT # Lord Howe Island -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule LH 1981 1984 - Oct lastSun 2:00 1:00 - Rule LH 1982 1985 - Mar Sun>=1 2:00 0 - Rule LH 1985 only - Oct lastSun 2:00 0:30 - @@ -252,8 +252,9 @@ Zone Antarctica/Macquarie 0 - -00 1899 Nov *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Oct 8 10:00:14 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 35DB73FBE85; Thu, 8 Oct 2020 10:00:14 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6RXG0hT0z3Zql; Thu, 8 Oct 2020 10:00:14 +0000 (UTC) (envelope-from np@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 EEF4C26AF8; Thu, 8 Oct 2020 10:00:13 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 098A0DT0051830; Thu, 8 Oct 2020 10:00:13 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 098A0Dfv051828; Thu, 8 Oct 2020 10:00:13 GMT (envelope-from np@FreeBSD.org) Message-Id: <202010081000.098A0Dfv051828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 8 Oct 2020 10:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366532 - in head: share/man/man4 sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/cxgbe X-SVN-Commit-Revision: 366532 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, 08 Oct 2020 10:00:14 -0000 Author: np Date: Thu Oct 8 10:00:13 2020 New Revision: 366532 URL: https://svnweb.freebsd.org/changeset/base/366532 Log: cxgbe(4): knobs to drop various kinds of undesirable frames on ingress. These kind of drops come for free in the sense that they do not use the filter TCAM or any other resource that wouldn't normally be used during rx. Frames dropped by the hardware get counted in the MAC's rx stats but are not delivered to the driver. hw.cxgbe.attack_filter Set to 1 to enable the "attack filter". Default is 0. The attack filter will drop an incoming frame if any of these conditions is true: src ip/ip6 == dst ip/ip6; tcp and src/dst ip is not unicast; src/dst ip is loopback (127.x.y.z); src ip6 is not unicast; src/dst ip6 is loopback (::1/128) or unspecified (::/128); tcp and src/dst ip6 is mcast (ff00::/8). hw.cxgbe.drop_ip_fragments Set to 1 to drop all incoming IP fragments. Default is 0. Note that this drops valid frames. hw.cxgbe.drop_pkts_with_l2_errors Set to 1 to drop incoming frames with Layer 2 length or checksum errors. Default is 1. hw.cxgbe.drop_pkts_with_l3_errors Set to 1 to drop incoming frames with IP version, length, or checksum errors. Default is 0. hw.cxgbe.drop_pkts_with_l4_errors Set to 1 to drop incoming frames with Layer 4 length, checksum, or other errors. Default is 0. MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/share/man/man4/cxgbe.4 head/sys/dev/cxgbe/t4_main.c Modified: head/share/man/man4/cxgbe.4 ============================================================================== --- head/share/man/man4/cxgbe.4 Thu Oct 8 04:00:31 2020 (r366531) +++ head/share/man/man4/cxgbe.4 Thu Oct 8 10:00:13 2020 (r366532) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17, 2020 +.Dd October 8, 2020 .Dt CXGBE 4 .Os .Sh NAME @@ -362,6 +362,26 @@ The default value is 0 and should be changed only if P to communicate with each other. Different interfaces can be assigned different values using the dev..X.tx_vm_wr sysctl when the interface is administratively down. +.It Va hw.cxgbe.attack_filter +Set to 1 to enable the "attack filter". +Default is 0. +The attack filter will drop an incoming frame if any of these conditions is +true: src ip/ip6 == dst ip/ip6; tcp and src/dst ip is not unicast; src/dst ip is +loopback (127.x.y.z); src ip6 is not unicast; src/dst ip6 is loopback (::1/128) +or unspecified (::/128); tcp and src/dst ip6 is mcast (ff00::/8). +.It Va hw.cxgbe.drop_ip_fragments +Set to 1 to drop all incoming IP fragments. +Default is 0. +Note that this drops valid frames. +.It Va hw.cxgbe.drop_pkts_with_l2_errors +Set to 1 to drop incoming frames with Layer 2 length or checksum errors. +Default is 1. +.It Va hw.cxgbe.drop_pkts_with_l3_errors +Set to 1 to drop incoming frames with IP version, length, or checksum errors. +Default is 0. +.It Va hw.cxgbe.drop_pkts_with_l4_errors +Set to 1 to drop incoming frames with Layer 4 length, checksum, or other errors. +Default is 0. .El .Sh SUPPORT For general information and support, Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Oct 8 04:00:31 2020 (r366531) +++ head/sys/dev/cxgbe/t4_main.c Thu Oct 8 10:00:13 2020 (r366532) @@ -595,6 +595,46 @@ static int t4_tx_vm_wr = 0; SYSCTL_INT(_hw_cxgbe, OID_AUTO, tx_vm_wr, CTLFLAG_RWTUN, &t4_tx_vm_wr, 0, "Use VM work requests to transmit packets."); +/* + * Set to non-zero to enable the attack filter. A packet that matches any of + * these conditions will get dropped on ingress: + * 1) IP && source address == destination address. + * 2) TCP/IP && source address is not a unicast address. + * 3) TCP/IP && destination address is not a unicast address. + * 4) IP && source address is loopback (127.x.y.z). + * 5) IP && destination address is loopback (127.x.y.z). + * 6) IPv6 && source address == destination address. + * 7) IPv6 && source address is not a unicast address. + * 8) IPv6 && source address is loopback (::1/128). + * 9) IPv6 && destination address is loopback (::1/128). + * 10) IPv6 && source address is unspecified (::/128). + * 11) IPv6 && destination address is unspecified (::/128). + * 12) TCP/IPv6 && source address is multicast (ff00::/8). + * 13) TCP/IPv6 && destination address is multicast (ff00::/8). + */ +static int t4_attack_filter = 0; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, attack_filter, CTLFLAG_RDTUN, + &t4_attack_filter, 0, "Drop suspicious traffic"); + +static int t4_drop_ip_fragments = 0; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, drop_ip_fragments, CTLFLAG_RDTUN, + &t4_drop_ip_fragments, 0, "Drop IP fragments"); + +static int t4_drop_pkts_with_l2_errors = 1; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, drop_pkts_with_l2_errors, CTLFLAG_RDTUN, + &t4_drop_pkts_with_l2_errors, 0, + "Drop all frames with Layer 2 length or checksum errors"); + +static int t4_drop_pkts_with_l3_errors = 0; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, drop_pkts_with_l3_errors, CTLFLAG_RDTUN, + &t4_drop_pkts_with_l3_errors, 0, + "Drop all frames with IP version, length, or checksum errors"); + +static int t4_drop_pkts_with_l4_errors = 0; +SYSCTL_INT(_hw_cxgbe, OID_AUTO, drop_pkts_with_l4_errors, CTLFLAG_RDTUN, + &t4_drop_pkts_with_l4_errors, 0, + "Drop all frames with Layer 4 length, checksum, or other errors"); + #ifdef TCP_OFFLOAD /* * TOE tunables. @@ -4740,7 +4780,7 @@ t4_enable_kern_tls(struct adapter *sc) static int set_params__post_init(struct adapter *sc) { - uint32_t param, val; + uint32_t mask, param, val; #ifdef TCP_OFFLOAD int i, v, shift; #endif @@ -4760,6 +4800,33 @@ set_params__post_init(struct adapter *sc) val = 1 << (G_MASKSIZE(t4_read_reg(sc, A_TP_RSS_CONFIG_TNL)) - 1); t4_set_reg_field(sc, A_TP_RSS_CONFIG_TNL, V_MASKFILTER(M_MASKFILTER), V_MASKFILTER(val - 1)); + + mask = F_DROPERRORANY | F_DROPERRORMAC | F_DROPERRORIPVER | + F_DROPERRORFRAG | F_DROPERRORATTACK | F_DROPERRORETHHDRLEN | + F_DROPERRORIPHDRLEN | F_DROPERRORTCPHDRLEN | F_DROPERRORPKTLEN | + F_DROPERRORTCPOPT | F_DROPERRORCSUMIP | F_DROPERRORCSUM; + val = 0; + if (t4_attack_filter != 0) { + t4_set_reg_field(sc, A_TP_GLOBAL_CONFIG, F_ATTACKFILTERENABLE, + F_ATTACKFILTERENABLE); + val |= F_DROPERRORATTACK; + } + if (t4_drop_ip_fragments != 0) { + t4_set_reg_field(sc, A_TP_GLOBAL_CONFIG, F_FRAGMENTDROP, + F_FRAGMENTDROP); + val |= F_DROPERRORFRAG; + } + if (t4_drop_pkts_with_l2_errors != 0) + val |= F_DROPERRORMAC | F_DROPERRORETHHDRLEN; + if (t4_drop_pkts_with_l3_errors != 0) { + val |= F_DROPERRORIPVER | F_DROPERRORIPHDRLEN | + F_DROPERRORCSUMIP; + } + if (t4_drop_pkts_with_l4_errors != 0) { + val |= F_DROPERRORTCPHDRLEN | F_DROPERRORPKTLEN | + F_DROPERRORTCPOPT | F_DROPERRORCSUM; + } + t4_set_reg_field(sc, A_TP_ERR_CONFIG, mask, val); #ifdef TCP_OFFLOAD /* From owner-svn-src-head@freebsd.org Thu Oct 8 10:59: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 21F863FD0C9; Thu, 8 Oct 2020 10:59:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6Ss16x4lz3d9d; Thu, 8 Oct 2020 10:59:49 +0000 (UTC) (envelope-from hselasky@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 CE0DE279A2; Thu, 8 Oct 2020 10:59:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 098AxnAu088316; Thu, 8 Oct 2020 10:59:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 098Axn9K088315; Thu, 8 Oct 2020 10:59:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010081059.098Axn9K088315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Oct 2020 10:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366533 - head/sys/dev/evdev X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/evdev X-SVN-Commit-Revision: 366533 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, 08 Oct 2020 10:59:50 -0000 Author: hselasky Date: Thu Oct 8 10:59:49 2020 New Revision: 366533 URL: https://svnweb.freebsd.org/changeset/base/366533 Log: Allow evdev's rcpt_mask and sysmouse_t_axis parameters to be specified in /boot/loader.conf . MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/dev/evdev/evdev.c Modified: head/sys/dev/evdev/evdev.c ============================================================================== --- head/sys/dev/evdev/evdev.c Thu Oct 8 10:00:13 2020 (r366532) +++ head/sys/dev/evdev/evdev.c Thu Oct 8 10:59:49 2020 (r366533) @@ -77,10 +77,10 @@ int evdev_sysmouse_t_axis = 0; SYSCTL_NODE(_kern, OID_AUTO, evdev, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Evdev args"); #ifdef EVDEV_SUPPORT -SYSCTL_INT(_kern_evdev, OID_AUTO, rcpt_mask, CTLFLAG_RW, &evdev_rcpt_mask, 0, +SYSCTL_INT(_kern_evdev, OID_AUTO, rcpt_mask, CTLFLAG_RWTUN, &evdev_rcpt_mask, 0, "Who is receiving events: bit0 - sysmouse, bit1 - kbdmux, " "bit2 - mouse hardware, bit3 - keyboard hardware"); -SYSCTL_INT(_kern_evdev, OID_AUTO, sysmouse_t_axis, CTLFLAG_RW, +SYSCTL_INT(_kern_evdev, OID_AUTO, sysmouse_t_axis, CTLFLAG_RWTUN, &evdev_sysmouse_t_axis, 0, "Extract T-axis from 0-none, 1-ums, 2-psm"); #endif SYSCTL_NODE(_kern_evdev, OID_AUTO, input, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, From owner-svn-src-head@freebsd.org Thu Oct 8 11:04: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 6DFEF3FCFD3; Thu, 8 Oct 2020 11:04:33 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6SyT2L5zz3dc3; Thu, 8 Oct 2020 11:04:33 +0000 (UTC) (envelope-from trasz@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 2F3B8277E3; Thu, 8 Oct 2020 11:04:33 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 098B4WEc094308; Thu, 8 Oct 2020 11:04:32 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 098B4WkE094307; Thu, 8 Oct 2020 11:04:32 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202010081104.098B4WkE094307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 8 Oct 2020 11:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366534 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 366534 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, 08 Oct 2020 11:04:33 -0000 Author: trasz Date: Thu Oct 8 11:04:32 2020 New Revision: 366534 URL: https://svnweb.freebsd.org/changeset/base/366534 Log: Remove yet another useless assignment, adding a KASSERT just in case. Reviewed by: kp Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26698 Modified: head/sys/riscv/riscv/trap.c Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Thu Oct 8 10:59:49 2020 (r366533) +++ head/sys/riscv/riscv/trap.c Thu Oct 8 11:04:32 2020 (r366534) @@ -158,15 +158,12 @@ dump_regs(struct trapframe *frame) } static void -ecall_handler(struct trapframe *frame) +ecall_handler(void) { struct thread *td; td = curthread; - KASSERT(td->td_frame == frame, - ("%s: td_frame %p != frame %p", __func__, td->td_frame, frame)); - syscallenter(td); syscallret(td); } @@ -324,9 +321,11 @@ do_trap_user(struct trapframe *frame) struct pcb *pcb; td = curthread; - td->td_frame = frame; pcb = td->td_pcb; + KASSERT(td->td_frame == frame, + ("%s: td_frame %p != frame %p", __func__, td->td_frame, frame)); + /* Ensure we came from usermode, interrupts disabled */ KASSERT((csr_read(sstatus) & (SSTATUS_SPP | SSTATUS_SIE)) == 0, ("Came from U mode with interrupts enabled")); @@ -357,7 +356,7 @@ do_trap_user(struct trapframe *frame) break; case EXCP_USER_ECALL: frame->tf_sepc += 4; /* Next instruction */ - ecall_handler(frame); + ecall_handler(); break; case EXCP_ILLEGAL_INSTRUCTION: #ifdef FPE From owner-svn-src-head@freebsd.org Thu Oct 8 11: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 D66583FD9A9; Thu, 8 Oct 2020 11:25:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6TQR59j2z3fP4; Thu, 8 Oct 2020 11:25:19 +0000 (UTC) (envelope-from hselasky@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 90A448151; Thu, 8 Oct 2020 11:25:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 098BPJh7006492; Thu, 8 Oct 2020 11:25:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 098BPJjI006491; Thu, 8 Oct 2020 11:25:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010081125.098BPJjI006491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Oct 2020 11:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366535 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366535 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, 08 Oct 2020 11:25:19 -0000 Author: hselasky Date: Thu Oct 8 11:25:19 2020 New Revision: 366535 URL: https://svnweb.freebsd.org/changeset/base/366535 Log: The ethernet header structure is read-only. Add const keyword. (This is a diff reduction towards D26254) MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/kern/uipc_mbufhash.c Modified: head/sys/kern/uipc_mbufhash.c ============================================================================== --- head/sys/kern/uipc_mbufhash.c Thu Oct 8 11:04:32 2020 (r366534) +++ head/sys/kern/uipc_mbufhash.c Thu Oct 8 11:25:19 2020 (r366535) @@ -78,7 +78,7 @@ m_ether_tcpip_hash(const uint32_t flags, const struct struct ether_vlan_header vlan; uint32_t port; } buf; - struct ether_header *eh; + const struct ether_header *eh; const struct ether_vlan_header *vlan; #ifdef INET const struct ip *ip; From owner-svn-src-head@freebsd.org Thu Oct 8 11:30: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 1A8F53FD83F; Thu, 8 Oct 2020 11:30:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6TXG71qgz3fSk; Thu, 8 Oct 2020 11:30:22 +0000 (UTC) (envelope-from hselasky@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 D484D27971; Thu, 8 Oct 2020 11:30:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 098BUMuj006775; Thu, 8 Oct 2020 11:30:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 098BUMe9006774; Thu, 8 Oct 2020 11:30:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202010081130.098BUMe9006774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Oct 2020 11:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366536 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 366536 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, 08 Oct 2020 11:30:23 -0000 Author: hselasky Date: Thu Oct 8 11:30:22 2020 New Revision: 366536 URL: https://svnweb.freebsd.org/changeset/base/366536 Log: Try a bit harder to get the USB device descriptor in case the initial read fails. MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking Modified: head/sys/dev/usb/usb_request.c Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Thu Oct 8 11:25:19 2020 (r366535) +++ head/sys/dev/usb/usb_request.c Thu Oct 8 11:30:22 2020 (r366536) @@ -1973,9 +1973,23 @@ usbd_setup_device_desc(struct usb_device *udev, struct /* get partial device descriptor, some devices crash on this */ err = usbd_req_get_desc(udev, mtx, NULL, &udev->ddesc, USB_MAX_IPACKET, USB_MAX_IPACKET, 0, UDESC_DEVICE, 0, 0); - if (err != 0) - break; - + if (err != 0) { + DPRINTF("Trying fallback for getting the USB device descriptor\n"); + /* try 8 bytes bMaxPacketSize */ + udev->ddesc.bMaxPacketSize = 8; + /* get full device descriptor */ + err = usbd_req_get_device_desc(udev, mtx, &udev->ddesc); + if (err == 0) + break; + /* try 16 bytes bMaxPacketSize */ + udev->ddesc.bMaxPacketSize = 16; + /* get full device descriptor */ + err = usbd_req_get_device_desc(udev, mtx, &udev->ddesc); + if (err == 0) + break; + /* try 32/64 bytes bMaxPacketSize */ + udev->ddesc.bMaxPacketSize = 32; + } /* get the full device descriptor */ err = usbd_req_get_device_desc(udev, mtx, &udev->ddesc); break; From owner-svn-src-head@freebsd.org Thu Oct 8 11: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 86C513FE087; Thu, 8 Oct 2020 11:45:11 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6TsM33Bjz3g4C; Thu, 8 Oct 2020 11:45:11 +0000 (UTC) (envelope-from kaktus@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 4BF998511; Thu, 8 Oct 2020 11:45:11 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 098BjBaO018734; Thu, 8 Oct 2020 11:45:11 GMT (envelope-from kaktus@FreeBSD.org) Received: (from kaktus@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 098BjBun018733; Thu, 8 Oct 2020 11:45:11 GMT (envelope-from kaktus@FreeBSD.org) Message-Id: <202010081145.098BjBun018733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kaktus set sender to kaktus@FreeBSD.org using -f From: Pawel Biernacki Date: Thu, 8 Oct 2020 11:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366537 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: kaktus X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 366537 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, 08 Oct 2020 11:45:11 -0000 Author: kaktus Date: Thu Oct 8 11:45:10 2020 New Revision: 366537 URL: https://svnweb.freebsd.org/changeset/base/366537 Log: [pf] /etc/rc.d/pf should REQUIRE routing When a system with pf_enable="YES" in /etc/rc.conf uses hostnames in /etc/pf.conf, these hostnames cannot be resolved via external nameservers because the default route is not yet set. This results in an empty (all open) ruleset. Since r195026 already put netif back to REQUIRE, this change does not affect the issue that the firewall should rather have been setup before any network traffic can occur. PR: 211928 Submitted by: Robert Schulze Reported by: Robert Schulze Tested by: Mateusz Kwiatkowski No objections from: kp MFC after: 3 days Modified: head/libexec/rc/rc.d/pf Modified: head/libexec/rc/rc.d/pf ============================================================================== --- head/libexec/rc/rc.d/pf Thu Oct 8 11:30:22 2020 (r366536) +++ head/libexec/rc/rc.d/pf Thu Oct 8 11:45:10 2020 (r366537) @@ -4,8 +4,7 @@ # # PROVIDE: pf -# REQUIRE: FILESYSTEMS netif pflog pfsync -# BEFORE: routing +# REQUIRE: FILESYSTEMS netif pflog pfsync routing # KEYWORD: nojailvnet . /etc/rc.subr From owner-svn-src-head@freebsd.org Thu Oct 8 17:30: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 321C142C98A; Thu, 8 Oct 2020 17:30:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6dWL0YSCz4GkN; Thu, 8 Oct 2020 17:30:06 +0000 (UTC) (envelope-from imp@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 EBAEDC076; Thu, 8 Oct 2020 17:30:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 098HU5qv028183; Thu, 8 Oct 2020 17:30:05 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 098HU5kY028182; Thu, 8 Oct 2020 17:30:05 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010081730.098HU5kY028182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 8 Oct 2020 17:30:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366541 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 366541 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, 08 Oct 2020 17:30:06 -0000 Author: imp Date: Thu Oct 8 17:30:05 2020 New Revision: 366541 URL: https://svnweb.freebsd.org/changeset/base/366541 Log: Race in 32-bit fixed Use install insteald of install.sh for 32-bit builds to fight races there. Reviewed by: markj Modified: head/Makefile.libcompat Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Thu Oct 8 16:45:27 2020 (r366540) +++ head/Makefile.libcompat Thu Oct 8 17:30:05 2020 (r366541) @@ -10,7 +10,7 @@ __<${_this:T}>__: # Yes, the flags are redundant. LIBCOMPATWMAKEENV+= \ - INSTALL="sh ${.CURDIR}/tools/install.sh" \ + INSTALL="${INSTALL_CMD} -U" \ PATH=${TMPPATH} \ SYSROOT=${LIBCOMPATTMP} \ LIBDIR=/usr/lib${libcompat} \ From owner-svn-src-head@freebsd.org Thu Oct 8 18:02: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 A707C42DCCB; Thu, 8 Oct 2020 18:02:07 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6fDH40n4z4KJd; Thu, 8 Oct 2020 18:02:07 +0000 (UTC) (envelope-from mhorne@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 6E1D6CC15; Thu, 8 Oct 2020 18:02:07 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 098I27Kj052302; Thu, 8 Oct 2020 18:02:07 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 098I26Rq052294; Thu, 8 Oct 2020 18:02:06 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202010081802.098I26Rq052294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Thu, 8 Oct 2020 18:02:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366542 - in head/sys: amd64/amd64 arm/arm arm64/arm64 kern riscv/riscv sys X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm/arm arm64/arm64 kern riscv/riscv sys X-SVN-Commit-Revision: 366542 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, 08 Oct 2020 18:02:07 -0000 Author: mhorne Date: Thu Oct 8 18:02:05 2020 New Revision: 366542 URL: https://svnweb.freebsd.org/changeset/base/366542 Log: Add a routine to dump boot metadata The boot metadata (also referred to as modinfo, or preload metadata) provides information about the size and location of the kernel, pre-loaded modules, and other metadata (e.g. the EFI framebuffer) to be consumed during by the kernel during early boot. It is encoded as a series of type-length-value entries and is usually constructed by loader(8) and passed to the kernel. It is also faked on some architectures when booted by other means. Although much of the module information is available via kldstat(8), there is no easy way to debug the metadata in its entirety. Add some routines to parse this data and allow it to be printed to the console during early boot or output via a sysctl. Since the output can be lengthly, printing to the console is gated behind the debug.dump_modinfo_at_boot kenv variable as well as the BOOTVERBOSE flag. The sysctl to print the metadata is named debug.dump_modinfo. Reviewed by: tsoome Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26687 Modified: head/sys/amd64/amd64/machdep.c head/sys/arm/arm/machdep.c head/sys/arm64/arm64/machdep.c head/sys/kern/subr_module.c head/sys/riscv/riscv/machdep.c head/sys/sys/linker.h Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Thu Oct 8 17:30:05 2020 (r366541) +++ head/sys/amd64/amd64/machdep.c Thu Oct 8 18:02:05 2020 (r366542) @@ -1853,6 +1853,15 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) if (late_console) cninit(); + /* + * Dump the boot metadata. We have to wait for cninit() since console + * output is required. If it's grossly incorrect the kernel will never + * make it this far. + */ + if ((boothowto & RB_VERBOSE) && + getenv_is_true("debug.dump_modinfo_at_boot")) + preload_dump(); + #ifdef DEV_ISA #ifdef DEV_ATPIC elcr_probe(); Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Thu Oct 8 17:30:05 2020 (r366541) +++ head/sys/arm/arm/machdep.c Thu Oct 8 18:02:05 2020 (r366542) @@ -1027,6 +1027,15 @@ initarm(struct arm_boot_params *abp) debugf(" dtbp = 0x%08x\n", (uint32_t)dtbp); arm_print_kenv(); + /* + * Dump the boot metadata. We have to wait for cninit() since console + * output is required. If it's grossly incorrect the kernel will never + * make it this far. + */ + if ((boothowto & RB_VERBOSE) && + getenv_is_true("debug.dump_modinfo_at_boot")) + preload_dump(); + env = kern_getenv("kernelname"); if (env != NULL) { strlcpy(kernelname, env, sizeof(kernelname)); Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Thu Oct 8 17:30:05 2020 (r366541) +++ head/sys/arm64/arm64/machdep.c Thu Oct 8 18:02:05 2020 (r366542) @@ -1242,6 +1242,15 @@ initarm(struct arm64_bootparams *abp) panic("Invalid bus configuration: %s", kern_getenv("kern.cfg.order")); + /* + * Dump the boot metadata. We have to wait for cninit() since console + * output is required. If it's grossly incorrect the kernel will never + * make it this far. + */ + if ((boothowto & RB_VERBOSE) && + getenv_is_true("debug.dump_modinfo_at_boot")) + preload_dump(); + init_proc0(abp->kern_stack); msgbufinit(msgbufp, msgbufsize); mutex_init(); Modified: head/sys/kern/subr_module.c ============================================================================== --- head/sys/kern/subr_module.c Thu Oct 8 17:30:05 2020 (r366541) +++ head/sys/kern/subr_module.c Thu Oct 8 18:02:05 2020 (r366542) @@ -3,6 +3,8 @@ * * Copyright (c) 1998 Michael Smith * All rights reserved. + * Copyright (c) 2020 NetApp Inc. + * Copyright (c) 2020 Klara Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +34,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include + #include #include @@ -304,3 +310,249 @@ preload_bootstrap_relocate(vm_offset_t offset) } } } + +/* + * Parse the modinfo type and append to the provided sbuf. + */ +static void +preload_modinfo_type(struct sbuf *sbp, int type) +{ + + if ((type & MODINFO_METADATA) == 0) { + switch (type) { + case MODINFO_END: + sbuf_cat(sbp, "MODINFO_END"); + break; + case MODINFO_NAME: + sbuf_cat(sbp, "MODINFO_NAME"); + break; + case MODINFO_TYPE: + sbuf_cat(sbp, "MODINFO_TYPE"); + break; + case MODINFO_ADDR: + sbuf_cat(sbp, "MODINFO_ADDR"); + break; + case MODINFO_SIZE: + sbuf_cat(sbp, "MODINFO_SIZE"); + break; + case MODINFO_EMPTY: + sbuf_cat(sbp, "MODINFO_EMPTY"); + break; + case MODINFO_ARGS: + sbuf_cat(sbp, "MODINFO_ARGS"); + break; + default: + sbuf_cat(sbp, "unrecognized modinfo attribute"); + } + + return; + } + + sbuf_cat(sbp, "MODINFO_METADATA | "); + switch (type & ~MODINFO_METADATA) { + case MODINFOMD_ELFHDR: + sbuf_cat(sbp, "MODINFOMD_ELFHDR"); + break; + case MODINFOMD_SSYM: + sbuf_cat(sbp, "MODINFOMD_SSYM"); + break; + case MODINFOMD_ESYM: + sbuf_cat(sbp, "MODINFOMD_ESYM"); + break; + case MODINFOMD_DYNAMIC: + sbuf_cat(sbp, "MODINFOMD_DYNAMIC"); + break; + case MODINFOMD_ENVP: + sbuf_cat(sbp, "MODINFOMD_ENVP"); + break; + case MODINFOMD_HOWTO: + sbuf_cat(sbp, "MODINFOMD_HOWTO"); + break; + case MODINFOMD_KERNEND: + sbuf_cat(sbp, "MODINFOMD_KERNEND"); + break; + case MODINFOMD_SHDR: + sbuf_cat(sbp, "MODINFOMD_SHDR"); + break; + case MODINFOMD_CTORS_ADDR: + sbuf_cat(sbp, "MODINFOMD_CTORS_ADDR"); + break; + case MODINFOMD_CTORS_SIZE: + sbuf_cat(sbp, "MODINFOMD_CTORS_SIZE"); + break; + case MODINFOMD_FW_HANDLE: + sbuf_cat(sbp, "MODINFOMD_FW_HANDLE"); + break; + case MODINFOMD_KEYBUF: + sbuf_cat(sbp, "MODINFOMD_KEYBUF"); + break; +#ifdef MODINFOMD_SMAP + case MODINFOMD_SMAP: + sbuf_cat(sbp, "MODINFOMD_SMAP"); + break; +#endif +#ifdef MODINFOMD_SMAP_XATTR + case MODINFOMD_SMAP_XATTR: + sbuf_cat(sbp, "MODINFOMD_SMAP_XATTR"); + break; +#endif +#ifdef MODINFOMD_DTBP + case MODINFOMD_DTBP: + sbuf_cat(sbp, "MODINFOMD_DTBP"); + break; +#endif +#ifdef MODINFOMD_EFI_MAP + case MODINFOMD_EFI_MAP: + sbuf_cat(sbp, "MODINFOMD_EFI_MAP"); + break; +#endif +#ifdef MODINFOMD_EFI_FB + case MODINFOMD_EFI_FB: + sbuf_cat(sbp, "MODINFOMD_EFI_FB"); + break; +#endif +#ifdef MODINFOMD_MODULEP + case MODINFOMD_MODULEP: + sbuf_cat(sbp, "MODINFOMD_MODULEP"); + break; +#endif + default: + sbuf_cat(sbp, "unrecognized metadata type"); + } +} + +/* + * Print the modinfo value, depending on type. + */ +static void +preload_modinfo_value(struct sbuf *sbp, uint32_t *bptr, int type, int len) +{ +#ifdef __LP64__ +#define sbuf_print_vmoffset(sb, o) sbuf_printf(sb, "0x%016lx", o); +#else +#define sbuf_print_vmoffset(sb, o) sbuf_printf(sb, "0x%08x", o); +#endif + + switch (type) { + case MODINFO_NAME: + case MODINFO_TYPE: + case MODINFO_ARGS: + sbuf_printf(sbp, "%s", (char *)bptr); + break; + case MODINFO_SIZE: + case MODINFO_METADATA | MODINFOMD_CTORS_SIZE: + sbuf_printf(sbp, "%lu", *(u_long *)bptr); + break; + case MODINFO_ADDR: + case MODINFO_METADATA | MODINFOMD_SSYM: + case MODINFO_METADATA | MODINFOMD_ESYM: + case MODINFO_METADATA | MODINFOMD_DYNAMIC: + case MODINFO_METADATA | MODINFOMD_KERNEND: + case MODINFO_METADATA | MODINFOMD_ENVP: + case MODINFO_METADATA | MODINFOMD_CTORS_ADDR: +#ifdef MODINFOMD_SMAP + case MODINFO_METADATA | MODINFOMD_SMAP: +#endif +#ifdef MODINFOMD_SMAP_XATTR + case MODINFO_METADATA | MODINFOMD_SMAP_XATTR: +#endif +#ifdef MODINFOMD_DTBP + case MODINFO_METADATA | MODINFOMD_DTBP: +#endif +#ifdef MODINFOMD_EFI_FB + case MODINFO_METADATA | MODINFOMD_EFI_FB: +#endif + sbuf_print_vmoffset(sbp, *(vm_offset_t *)bptr); + break; + case MODINFO_METADATA | MODINFOMD_HOWTO: + sbuf_printf(sbp, "0x%08x", *bptr); + break; + case MODINFO_METADATA | MODINFOMD_SHDR: + case MODINFO_METADATA | MODINFOMD_ELFHDR: + case MODINFO_METADATA | MODINFOMD_FW_HANDLE: + case MODINFO_METADATA | MODINFOMD_KEYBUF: +#ifdef MODINFOMD_EFI_MAP + case MODINFO_METADATA | MODINFOMD_EFI_MAP: +#endif + /* Don't print data buffers. */ + sbuf_cat(sbp, "buffer contents omitted"); + break; + default: + break; + } +#undef sbuf_print_vmoffset +} + +static void +preload_dump_internal(struct sbuf *sbp) +{ + uint32_t *bptr, type, len; + + KASSERT(preload_metadata != NULL, + ("%s called without setting up preload_metadata", __func__)); + + /* + * Iterate through the TLV-encoded sections. + */ + bptr = (uint32_t *)preload_metadata; + sbuf_putc(sbp, '\n'); + while (bptr[0] != MODINFO_END || bptr[0] != MODINFO_END) { + sbuf_printf(sbp, " %p:\n", bptr); + type = *bptr++; + len = *bptr++; + + sbuf_printf(sbp, "\ttype:\t(%#04x) ", type); + preload_modinfo_type(sbp, type); + sbuf_putc(sbp, '\n'); + sbuf_printf(sbp, "\tlen:\t%u\n", len); + sbuf_cat(sbp, "\tvalue:\t"); + preload_modinfo_value(sbp, bptr, type, len); + sbuf_putc(sbp, '\n'); + + bptr += roundup(len, sizeof(u_long)) / sizeof(uint32_t); + } +} + +/* + * Print the preloaded data to the console. Called from the machine-dependent + * initialization routines, e.g. hammer_time(). + */ +void +preload_dump(void) +{ + char buf[512]; + struct sbuf sb; + + /* + * This function is expected to be called before malloc is available, + * so use a static buffer and struct sbuf. + */ + sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN); + sbuf_set_drain(&sb, sbuf_printf_drain, NULL); + preload_dump_internal(&sb); + + sbuf_finish(&sb); + sbuf_delete(&sb); +} + +static int +sysctl_preload_dump(SYSCTL_HANDLER_ARGS) +{ + struct sbuf sb; + int error; + + if (preload_metadata == NULL) + return (EINVAL); + + sbuf_new_for_sysctl(&sb, NULL, 512, req); + preload_dump_internal(&sb); + + error = sbuf_finish(&sb); + sbuf_delete(&sb); + + return (error); +} +SYSCTL_PROC(_debug, OID_AUTO, dump_modinfo, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, 0, sysctl_preload_dump, "A", + "pretty-print the bootloader metadata"); Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Thu Oct 8 17:30:05 2020 (r366541) +++ head/sys/riscv/riscv/machdep.c Thu Oct 8 18:02:05 2020 (r366542) @@ -949,6 +949,15 @@ initriscv(struct riscv_bootparams *rvbp) cninit(); + /* + * Dump the boot metadata. We have to wait for cninit() since console + * output is required. If it's grossly incorrect the kernel will never + * make it this far. + */ + if ((boothowto & RB_VERBOSE) && + getenv_is_true("debug.dump_modinfo_at_boot")) + preload_dump(); + init_proc0(rvbp->kern_stack); msgbufinit(msgbufp, msgbufsize); Modified: head/sys/sys/linker.h ============================================================================== --- head/sys/sys/linker.h Thu Oct 8 17:30:05 2020 (r366541) +++ head/sys/sys/linker.h Thu Oct 8 18:02:05 2020 (r366542) @@ -257,6 +257,7 @@ extern caddr_t preload_search_next_name(caddr_t _base extern caddr_t preload_search_info(caddr_t _mod, int _inf); extern void preload_delete_name(const char *_name); extern void preload_bootstrap_relocate(vm_offset_t _offset); +extern void preload_dump(void); #ifdef KLD_DEBUG From owner-svn-src-head@freebsd.org Thu Oct 8 18:15: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 AE43842E2FD; Thu, 8 Oct 2020 18:15:02 +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 4C6fWB4Bmlz4LLQ; Thu, 8 Oct 2020 18:15:02 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-vk1-f174.google.com (mail-vk1-f174.google.com [209.85.221.174]) (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 6E6C0225F4; Thu, 8 Oct 2020 18:15:02 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-vk1-f174.google.com with SMTP id n141so1520517vke.9; Thu, 08 Oct 2020 11:15:02 -0700 (PDT) X-Gm-Message-State: AOAM530n8sZ2Wu4wgR2ZiC8K3Q2lkpumfEx9mBJuC/Md/jJcKrBKbVgr aOCAAhqMng7tjwcngisGhwKSYM1+QPiwIwmAeSc= X-Google-Smtp-Source: ABdhPJwNpxFoNHCKcrMLj+U7wZbmMQm1AZESSCeUPGl4r1fP9cw423Pb6JqqvwXp6S/XzpxhPP0kYUFxeXKvqRshjrw= X-Received: by 2002:a1f:3a09:: with SMTP id h9mr5587639vka.6.1602180901810; Thu, 08 Oct 2020 11:15:01 -0700 (PDT) MIME-Version: 1.0 References: <202010081802.098I26Rq052294@repo.freebsd.org> In-Reply-To: <202010081802.098I26Rq052294@repo.freebsd.org> From: Kyle Evans Date: Thu, 8 Oct 2020 13:14:42 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366542 - in head/sys: amd64/amd64 arm/arm arm64/arm64 kern riscv/riscv sys To: Mitchell Horne 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, 08 Oct 2020 18:15:02 -0000 On Thu, Oct 8, 2020 at 1:02 PM Mitchell Horne wrote: > > Author: mhorne > Date: Thu Oct 8 18:02:05 2020 > New Revision: 366542 > URL: https://svnweb.freebsd.org/changeset/base/366542 > > Log: > Add a routine to dump boot metadata > > The boot metadata (also referred to as modinfo, or preload metadata) > provides information about the size and location of the kernel, > pre-loaded modules, and other metadata (e.g. the EFI framebuffer) to be > consumed during by the kernel during early boot. It is encoded as a > series of type-length-value entries and is usually constructed by > loader(8) and passed to the kernel. It is also faked on some > architectures when booted by other means. > > Although much of the module information is available via kldstat(8), > there is no easy way to debug the metadata in its entirety. Add some > routines to parse this data and allow it to be printed to the console > during early boot or output via a sysctl. > > Since the output can be lengthly, printing to the console is gated > behind the debug.dump_modinfo_at_boot kenv variable as well as the > BOOTVERBOSE flag. The sysctl to print the metadata is named > debug.dump_modinfo. > Hi, Why both a tunable and boot -v? The tunable is already specifically scoped to just this operation, it seems a little odd to double-gate it. Thanks, Kyle Evans From owner-svn-src-head@freebsd.org Thu Oct 8 18:19: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 60A8A42E736; Thu, 8 Oct 2020 18:19:57 +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 4C6fcs22Wjz4LCl; Thu, 8 Oct 2020 18:19:57 +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 8545022F1F; Thu, 8 Oct 2020 18:19:56 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.41.20091302 Date: Thu, 08 Oct 2020 11:19:51 -0700 Subject: Re: svn commit: r366542 - in head/sys: amd64/amd64 arm/arm arm64/arm64 kern riscv/riscv sys From: Ravi Pokala To: Mitchell Horne , , , Message-ID: <3173155C-6862-4DC6-964E-4F1B1FA941E9@panasas.com> Thread-Topic: svn commit: r366542 - in head/sys: amd64/amd64 arm/arm arm64/arm64 kern riscv/riscv sys References: <202010081802.098I26Rq052294@repo.freebsd.org> In-Reply-To: <202010081802.098I26Rq052294@repo.freebsd.org> 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, 08 Oct 2020 18:19:57 -0000 Hi Mitchell, +static void +preload_dump_internal(struct sbuf *sbp) +{ + uint32_t *bptr, type, len; + + KASSERT(preload_metadata !=3D NULL, + ("%s called without setting up preload_metadata", __func__)); + + /* + * Iterate through the TLV-encoded sections. + */ + bptr =3D (uint32_t *)preload_metadata; + sbuf_putc(sbp, '\n'); + while (bptr[0] !=3D MODINFO_END || bptr[0] !=3D MODINFO_END) { The same expression is on both sides of the "||" ...? Thanks, Ravi (rpokala@) + sbuf_printf(sbp, " %p:\n", bptr); + type =3D *bptr++; + len =3D *bptr++; + + sbuf_printf(sbp, "\ttype:\t(%#04x) ", type); + preload_modinfo_type(sbp, type); + sbuf_putc(sbp, '\n'); + sbuf_printf(sbp, "\tlen:\t%u\n", len); + sbuf_cat(sbp, "\tvalue:\t"); + preload_modinfo_value(sbp, bptr, type, len); + sbuf_putc(sbp, '\n'); + + bptr +=3D roundup(len, sizeof(u_long)) / sizeof(uint32_t); + } +} =EF=BB=BF-----Original Message----- From: on behalf of Mitchell Horne Date: 2020-10-08, Thursday at 11:02 To: , , Subject: svn commit: r366542 - in head/sys: amd64/amd64 arm/arm arm64/arm64= kern riscv/riscv sys Author: mhorne Date: Thu Oct 8 18:02:05 2020 New Revision: 366542 URL: https://svnweb.freebsd.org/changeset/base/366542 Log: Add a routine to dump boot metadata The boot metadata (also referred to as modinfo, or preload metadata) provides information about the size and location of the kernel, pre-loaded modules, and other metadata (e.g. the EFI framebuffer) to = be consumed during by the kernel during early boot. It is encoded as a series of type-length-value entries and is usually constructed by loader(8) and passed to the kernel. It is also faked on some architectures when booted by other means. Although much of the module information is available via kldstat(8), there is no easy way to debug the metadata in its entirety. Add some routines to parse this data and allow it to be printed to the console during early boot or output via a sysctl. Since the output can be lengthly, printing to the console is gated behind the debug.dump_modinfo_at_boot kenv variable as well as the BOOTVERBOSE flag. The sysctl to print the metadata is named debug.dump_modinfo. Reviewed by: tsoome Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26687 Modified: head/sys/amd64/amd64/machdep.c head/sys/arm/arm/machdep.c head/sys/arm64/arm64/machdep.c head/sys/kern/subr_module.c head/sys/riscv/riscv/machdep.c head/sys/sys/linker.h Modified: head/sys/amd64/amd64/machdep.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/amd64/amd64/machdep.c Thu Oct 8 17:30:05 2020 (r366541) +++ head/sys/amd64/amd64/machdep.c Thu Oct 8 18:02:05 2020 (r366542) @@ -1853,6 +1853,15 @@ hammer_time(u_int64_t modulep, u_int64_t physfre= e) if (late_console) cninit(); + /* + * Dump the boot metadata. We have to wait for cninit() since console + * output is required. If it's grossly incorrect the kernel will neve= r + * make it this far. + */ + if ((boothowto & RB_VERBOSE) && + getenv_is_true("debug.dump_modinfo_at_boot")) + preload_dump(); + #ifdef DEV_ISA #ifdef DEV_ATPIC elcr_probe(); Modified: head/sys/arm/arm/machdep.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/arm/arm/machdep.c Thu Oct 8 17:30:05 2020 (r366541) +++ head/sys/arm/arm/machdep.c Thu Oct 8 18:02:05 2020 (r366542) @@ -1027,6 +1027,15 @@ initarm(struct arm_boot_params *abp) debugf(" dtbp =3D 0x%08x\n", (uint32_t)dtbp); arm_print_kenv(); + /* + * Dump the boot metadata. We have to wait for cninit() since console + * output is required. If it's grossly incorrect the kernel will neve= r + * make it this far. + */ + if ((boothowto & RB_VERBOSE) && + getenv_is_true("debug.dump_modinfo_at_boot")) + preload_dump(); + env =3D kern_getenv("kernelname"); if (env !=3D NULL) { strlcpy(kernelname, env, sizeof(kernelname)); Modified: head/sys/arm64/arm64/machdep.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/arm64/arm64/machdep.c Thu Oct 8 17:30:05 2020 (r366541) +++ head/sys/arm64/arm64/machdep.c Thu Oct 8 18:02:05 2020 (r366542) @@ -1242,6 +1242,15 @@ initarm(struct arm64_bootparams *abp) panic("Invalid bus configuration: %s", kern_getenv("kern.cfg.order")); + /* + * Dump the boot metadata. We have to wait for cninit() since console + * output is required. If it's grossly incorrect the kernel will neve= r + * make it this far. + */ + if ((boothowto & RB_VERBOSE) && + getenv_is_true("debug.dump_modinfo_at_boot")) + preload_dump(); + init_proc0(abp->kern_stack); msgbufinit(msgbufp, msgbufsize); mutex_init(); Modified: head/sys/kern/subr_module.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/kern/subr_module.c Thu Oct 8 17:30:05 2020 (r366541) +++ head/sys/kern/subr_module.c Thu Oct 8 18:02:05 2020 (r366542) @@ -3,6 +3,8 @@ * * Copyright (c) 1998 Michael Smith * All rights reserved. + * Copyright (c) 2020 NetApp Inc. + * Copyright (c) 2020 Klara Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,7 +34,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include + #include #include @@ -304,3 +310,249 @@ preload_bootstrap_relocate(vm_offset_t offset) } } } + +/* + * Parse the modinfo type and append to the provided sbuf. + */ +static void +preload_modinfo_type(struct sbuf *sbp, int type) +{ + + if ((type & MODINFO_METADATA) =3D=3D 0) { + switch (type) { + case MODINFO_END: + sbuf_cat(sbp, "MODINFO_END"); + break; + case MODINFO_NAME: + sbuf_cat(sbp, "MODINFO_NAME"); + break; + case MODINFO_TYPE: + sbuf_cat(sbp, "MODINFO_TYPE"); + break; + case MODINFO_ADDR: + sbuf_cat(sbp, "MODINFO_ADDR"); + break; + case MODINFO_SIZE: + sbuf_cat(sbp, "MODINFO_SIZE"); + break; + case MODINFO_EMPTY: + sbuf_cat(sbp, "MODINFO_EMPTY"); + break; + case MODINFO_ARGS: + sbuf_cat(sbp, "MODINFO_ARGS"); + break; + default: + sbuf_cat(sbp, "unrecognized modinfo attribute"); + } + + return; + } + + sbuf_cat(sbp, "MODINFO_METADATA | "); + switch (type & ~MODINFO_METADATA) { + case MODINFOMD_ELFHDR: + sbuf_cat(sbp, "MODINFOMD_ELFHDR"); + break; + case MODINFOMD_SSYM: + sbuf_cat(sbp, "MODINFOMD_SSYM"); + break; + case MODINFOMD_ESYM: + sbuf_cat(sbp, "MODINFOMD_ESYM"); + break; + case MODINFOMD_DYNAMIC: + sbuf_cat(sbp, "MODINFOMD_DYNAMIC"); + break; + case MODINFOMD_ENVP: + sbuf_cat(sbp, "MODINFOMD_ENVP"); + break; + case MODINFOMD_HOWTO: + sbuf_cat(sbp, "MODINFOMD_HOWTO"); + break; + case MODINFOMD_KERNEND: + sbuf_cat(sbp, "MODINFOMD_KERNEND"); + break; + case MODINFOMD_SHDR: + sbuf_cat(sbp, "MODINFOMD_SHDR"); + break; + case MODINFOMD_CTORS_ADDR: + sbuf_cat(sbp, "MODINFOMD_CTORS_ADDR"); + break; + case MODINFOMD_CTORS_SIZE: + sbuf_cat(sbp, "MODINFOMD_CTORS_SIZE"); + break; + case MODINFOMD_FW_HANDLE: + sbuf_cat(sbp, "MODINFOMD_FW_HANDLE"); + break; + case MODINFOMD_KEYBUF: + sbuf_cat(sbp, "MODINFOMD_KEYBUF"); + break; +#ifdef MODINFOMD_SMAP + case MODINFOMD_SMAP: + sbuf_cat(sbp, "MODINFOMD_SMAP"); + break; +#endif +#ifdef MODINFOMD_SMAP_XATTR + case MODINFOMD_SMAP_XATTR: + sbuf_cat(sbp, "MODINFOMD_SMAP_XATTR"); + break; +#endif +#ifdef MODINFOMD_DTBP + case MODINFOMD_DTBP: + sbuf_cat(sbp, "MODINFOMD_DTBP"); + break; +#endif +#ifdef MODINFOMD_EFI_MAP + case MODINFOMD_EFI_MAP: + sbuf_cat(sbp, "MODINFOMD_EFI_MAP"); + break; +#endif +#ifdef MODINFOMD_EFI_FB + case MODINFOMD_EFI_FB: + sbuf_cat(sbp, "MODINFOMD_EFI_FB"); + break; +#endif +#ifdef MODINFOMD_MODULEP + case MODINFOMD_MODULEP: + sbuf_cat(sbp, "MODINFOMD_MODULEP"); + break; +#endif + default: + sbuf_cat(sbp, "unrecognized metadata type"); + } +} + +/* + * Print the modinfo value, depending on type. + */ +static void +preload_modinfo_value(struct sbuf *sbp, uint32_t *bptr, int type, int = len) +{ +#ifdef __LP64__ +#define sbuf_print_vmoffset(sb, o) sbuf_printf(sb, "0x%016lx", o); +#else +#define sbuf_print_vmoffset(sb, o) sbuf_printf(sb, "0x%08x", o); +#endif + + switch (type) { + case MODINFO_NAME: + case MODINFO_TYPE: + case MODINFO_ARGS: + sbuf_printf(sbp, "%s", (char *)bptr); + break; + case MODINFO_SIZE: + case MODINFO_METADATA | MODINFOMD_CTORS_SIZE: + sbuf_printf(sbp, "%lu", *(u_long *)bptr); + break; + case MODINFO_ADDR: + case MODINFO_METADATA | MODINFOMD_SSYM: + case MODINFO_METADATA | MODINFOMD_ESYM: + case MODINFO_METADATA | MODINFOMD_DYNAMIC: + case MODINFO_METADATA | MODINFOMD_KERNEND: + case MODINFO_METADATA | MODINFOMD_ENVP: + case MODINFO_METADATA | MODINFOMD_CTORS_ADDR: +#ifdef MODINFOMD_SMAP + case MODINFO_METADATA | MODINFOMD_SMAP: +#endif +#ifdef MODINFOMD_SMAP_XATTR + case MODINFO_METADATA | MODINFOMD_SMAP_XATTR: +#endif +#ifdef MODINFOMD_DTBP + case MODINFO_METADATA | MODINFOMD_DTBP: +#endif +#ifdef MODINFOMD_EFI_FB + case MODINFO_METADATA | MODINFOMD_EFI_FB: +#endif + sbuf_print_vmoffset(sbp, *(vm_offset_t *)bptr); + break; + case MODINFO_METADATA | MODINFOMD_HOWTO: + sbuf_printf(sbp, "0x%08x", *bptr); + break; + case MODINFO_METADATA | MODINFOMD_SHDR: + case MODINFO_METADATA | MODINFOMD_ELFHDR: + case MODINFO_METADATA | MODINFOMD_FW_HANDLE: + case MODINFO_METADATA | MODINFOMD_KEYBUF: +#ifdef MODINFOMD_EFI_MAP + case MODINFO_METADATA | MODINFOMD_EFI_MAP: +#endif + /* Don't print data buffers. */ + sbuf_cat(sbp, "buffer contents omitted"); + break; + default: + break; + } +#undef sbuf_print_vmoffset +} + +static void +preload_dump_internal(struct sbuf *sbp) +{ + uint32_t *bptr, type, len; + + KASSERT(preload_metadata !=3D NULL, + ("%s called without setting up preload_metadata", __func__)); + + /* + * Iterate through the TLV-encoded sections. + */ + bptr =3D (uint32_t *)preload_metadata; + sbuf_putc(sbp, '\n'); + while (bptr[0] !=3D MODINFO_END || bptr[0] !=3D MODINFO_END) { + sbuf_printf(sbp, " %p:\n", bptr); + type =3D *bptr++; + len =3D *bptr++; + + sbuf_printf(sbp, "\ttype:\t(%#04x) ", type); + preload_modinfo_type(sbp, type); + sbuf_putc(sbp, '\n'); + sbuf_printf(sbp, "\tlen:\t%u\n", len); + sbuf_cat(sbp, "\tvalue:\t"); + preload_modinfo_value(sbp, bptr, type, len); + sbuf_putc(sbp, '\n'); + + bptr +=3D roundup(len, sizeof(u_long)) / sizeof(uint32_t); + } +} + +/* + * Print the preloaded data to the console. Called from the machine-de= pendent + * initialization routines, e.g. hammer_time(). + */ +void +preload_dump(void) +{ + char buf[512]; + struct sbuf sb; + + /* + * This function is expected to be called before malloc is available, + * so use a static buffer and struct sbuf. + */ + sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN); + sbuf_set_drain(&sb, sbuf_printf_drain, NULL); + preload_dump_internal(&sb); + + sbuf_finish(&sb); + sbuf_delete(&sb); +} + +static int +sysctl_preload_dump(SYSCTL_HANDLER_ARGS) +{ + struct sbuf sb; + int error; + + if (preload_metadata =3D=3D NULL) + return (EINVAL); + + sbuf_new_for_sysctl(&sb, NULL, 512, req); + preload_dump_internal(&sb); + + error =3D sbuf_finish(&sb); + sbuf_delete(&sb); + + return (error); +} +SYSCTL_PROC(_debug, OID_AUTO, dump_modinfo, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, 0, sysctl_preload_dump, "A", + "pretty-print the bootloader metadata"); Modified: head/sys/riscv/riscv/machdep.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/riscv/riscv/machdep.c Thu Oct 8 17:30:05 2020 (r366541) +++ head/sys/riscv/riscv/machdep.c Thu Oct 8 18:02:05 2020 (r366542) @@ -949,6 +949,15 @@ initriscv(struct riscv_bootparams *rvbp) cninit(); + /* + * Dump the boot metadata. We have to wait for cninit() since console + * output is required. If it's grossly incorrect the kernel will neve= r + * make it this far. + */ + if ((boothowto & RB_VERBOSE) && + getenv_is_true("debug.dump_modinfo_at_boot")) + preload_dump(); + init_proc0(rvbp->kern_stack); msgbufinit(msgbufp, msgbufsize); Modified: head/sys/sys/linker.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/sys/linker.h Thu Oct 8 17:30:05 2020 (r366541) +++ head/sys/sys/linker.h Thu Oct 8 18:02:05 2020 (r366542) @@ -257,6 +257,7 @@ extern caddr_t preload_search_next_name(caddr_t _b= ase extern caddr_t preload_search_info(caddr_t _mod, int _inf); extern void preload_delete_name(const char *_name); extern void preload_bootstrap_relocate(vm_offset_t _offset); +extern void preload_dump(void); #ifdef KLD_DEBUG From owner-svn-src-head@freebsd.org Thu Oct 8 18:29: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 C409342E8CB; Thu, 8 Oct 2020 18:29:17 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6fqd4npPz4M9t; Thu, 8 Oct 2020 18:29:17 +0000 (UTC) (envelope-from mhorne@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 89386CF2D; Thu, 8 Oct 2020 18:29:17 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 098ITHkj065742; Thu, 8 Oct 2020 18:29:17 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 098ITHNE065741; Thu, 8 Oct 2020 18:29:17 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202010081829.098ITHNE065741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Thu, 8 Oct 2020 18:29:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366543 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366543 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, 08 Oct 2020 18:29:17 -0000 Author: mhorne Date: Thu Oct 8 18:29:17 2020 New Revision: 366543 URL: https://svnweb.freebsd.org/changeset/base/366543 Log: Fix a loop condition The correct way to identify the end of the metadata is two adjacent entries set to zero/MODINFO_END. I made a typo and this was checking the first entry twice. Reported by: rpokala Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Modified: head/sys/kern/subr_module.c Modified: head/sys/kern/subr_module.c ============================================================================== --- head/sys/kern/subr_module.c Thu Oct 8 18:02:05 2020 (r366542) +++ head/sys/kern/subr_module.c Thu Oct 8 18:29:17 2020 (r366543) @@ -496,7 +496,7 @@ preload_dump_internal(struct sbuf *sbp) */ bptr = (uint32_t *)preload_metadata; sbuf_putc(sbp, '\n'); - while (bptr[0] != MODINFO_END || bptr[0] != MODINFO_END) { + while (bptr[0] != MODINFO_END || bptr[1] != MODINFO_END) { sbuf_printf(sbp, " %p:\n", bptr); type = *bptr++; len = *bptr++; From owner-svn-src-head@freebsd.org Thu Oct 8 18:31: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 2ED3A42EB80; Thu, 8 Oct 2020 18:31:42 +0000 (UTC) (envelope-from mhorne@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 4C6ftQ0pYmz4M8v; Thu, 8 Oct 2020 18:31:42 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) (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: mhorne) by smtp.freebsd.org (Postfix) with ESMTPSA id EE8C223244; Thu, 8 Oct 2020 18:31:41 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: by mail-yb1-f182.google.com with SMTP id h6so5236595ybi.11; Thu, 08 Oct 2020 11:31:41 -0700 (PDT) X-Gm-Message-State: AOAM5317XwCzKnLCGW1VrfjeOzWvnCF3q7IrVkEkPgfTxonieDj6Hx9j QCX5Rm4e8YMkOT7/CKgOqRMn5JVZr2Tt4HObbHw= X-Google-Smtp-Source: ABdhPJwBsEYzPFEqvJ064owZZ4NdQCNwiVjRZSzea4QH7gQvyZKKBmByo8ackAPSs+qklqJvc1VDBaH38L+ppemKLBk= X-Received: by 2002:a25:ca02:: with SMTP id a2mr14603996ybg.36.1602181901361; Thu, 08 Oct 2020 11:31:41 -0700 (PDT) MIME-Version: 1.0 References: <202010081802.098I26Rq052294@repo.freebsd.org> <3173155C-6862-4DC6-964E-4F1B1FA941E9@panasas.com> In-Reply-To: <3173155C-6862-4DC6-964E-4F1B1FA941E9@panasas.com> From: Mitchell Horne Date: Thu, 8 Oct 2020 15:31:29 -0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366542 - in head/sys: amd64/amd64 arm/arm arm64/arm64 kern riscv/riscv sys To: Ravi Pokala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org 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, 08 Oct 2020 18:31:42 -0000 On Thu, Oct 8, 2020 at 3:19 PM Ravi Pokala wrote: > > Hi Mitchell, > > +static void > +preload_dump_internal(struct sbuf *sbp) > +{ > + uint32_t *bptr, type, len; > + > + KASSERT(preload_metadata !=3D NULL, > + ("%s called without setting up preload_metadata", __func__)); > + > + /* > + * Iterate through the TLV-encoded sections. > + */ > + bptr =3D (uint32_t *)preload_metadata; > + sbuf_putc(sbp, '\n'); > + while (bptr[0] !=3D MODINFO_END || bptr[0] !=3D MODINFO_END) { > > The same expression is on both sides of the "||" ...? > > Thanks, > > Ravi (rpokala@) Thank you for catching this --- it should be checking bptr[0] and bptr[1]. Fixed in r366543. Mitchell > > + sbuf_printf(sbp, " %p:\n", bptr); > + type =3D *bptr++; > + len =3D *bptr++; > + > + sbuf_printf(sbp, "\ttype:\t(%#04x) ", type); > + preload_modinfo_type(sbp, type); > + sbuf_putc(sbp, '\n'); > + sbuf_printf(sbp, "\tlen:\t%u\n", len); > + sbuf_cat(sbp, "\tvalue:\t"); > + preload_modinfo_value(sbp, bptr, type, len); > + sbuf_putc(sbp, '\n'); > + > + bptr +=3D roundup(len, sizeof(u_long)) / sizeof(uint32_t)= ; > + } > +} > > > > > =EF=BB=BF-----Original Message----- > From: on behalf of Mitchell Horne > Date: 2020-10-08, Thursday at 11:02 > To: , , > Subject: svn commit: r366542 - in head/sys: amd64/amd64 arm/arm arm64/arm= 64 kern riscv/riscv sys > > Author: mhorne > Date: Thu Oct 8 18:02:05 2020 > New Revision: 366542 > URL: https://svnweb.freebsd.org/changeset/base/366542 > > Log: > Add a routine to dump boot metadata > > The boot metadata (also referred to as modinfo, or preload metadata= ) > provides information about the size and location of the kernel, > pre-loaded modules, and other metadata (e.g. the EFI framebuffer) t= o be > consumed during by the kernel during early boot. It is encoded as a > series of type-length-value entries and is usually constructed by > loader(8) and passed to the kernel. It is also faked on some > architectures when booted by other means. > > Although much of the module information is available via kldstat(8)= , > there is no easy way to debug the metadata in its entirety. Add som= e > routines to parse this data and allow it to be printed to the conso= le > during early boot or output via a sysctl. > > Since the output can be lengthly, printing to the console is gated > behind the debug.dump_modinfo_at_boot kenv variable as well as the > BOOTVERBOSE flag. The sysctl to print the metadata is named > debug.dump_modinfo. > > Reviewed by: tsoome > Sponsored by: NetApp, Inc. > Sponsored by: Klara, Inc. > Differential Revision: https://reviews.freebsd.org/D26687 > > Modified: > head/sys/amd64/amd64/machdep.c > head/sys/arm/arm/machdep.c > head/sys/arm64/arm64/machdep.c > head/sys/kern/subr_module.c > head/sys/riscv/riscv/machdep.c > head/sys/sys/linker.h > > Modified: head/sys/amd64/amd64/machdep.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > --- head/sys/amd64/amd64/machdep.c Thu Oct 8 17:30:05 2020 (= r366541) > +++ head/sys/amd64/amd64/machdep.c Thu Oct 8 18:02:05 2020 (= r366542) > @@ -1853,6 +1853,15 @@ hammer_time(u_int64_t modulep, u_int64_t physf= ree) > if (late_console) > cninit(); > > + /* > + * Dump the boot metadata. We have to wait for cninit() since con= sole > + * output is required. If it's grossly incorrect the kernel will = never > + * make it this far. > + */ > + if ((boothowto & RB_VERBOSE) && > + getenv_is_true("debug.dump_modinfo_at_boot")) > + preload_dump(); > + > #ifdef DEV_ISA > #ifdef DEV_ATPIC > elcr_probe(); > > Modified: head/sys/arm/arm/machdep.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > --- head/sys/arm/arm/machdep.c Thu Oct 8 17:30:05 2020 (= r366541) > +++ head/sys/arm/arm/machdep.c Thu Oct 8 18:02:05 2020 (= r366542) > @@ -1027,6 +1027,15 @@ initarm(struct arm_boot_params *abp) > debugf(" dtbp =3D 0x%08x\n", (uint32_t)dtbp); > arm_print_kenv(); > > + /* > + * Dump the boot metadata. We have to wait for cninit() since con= sole > + * output is required. If it's grossly incorrect the kernel will = never > + * make it this far. > + */ > + if ((boothowto & RB_VERBOSE) && > + getenv_is_true("debug.dump_modinfo_at_boot")) > + preload_dump(); > + > env =3D kern_getenv("kernelname"); > if (env !=3D NULL) { > strlcpy(kernelname, env, sizeof(kernelname)); > > Modified: head/sys/arm64/arm64/machdep.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > --- head/sys/arm64/arm64/machdep.c Thu Oct 8 17:30:05 2020 (= r366541) > +++ head/sys/arm64/arm64/machdep.c Thu Oct 8 18:02:05 2020 (= r366542) > @@ -1242,6 +1242,15 @@ initarm(struct arm64_bootparams *abp) > panic("Invalid bus configuration: %s", > kern_getenv("kern.cfg.order")); > > + /* > + * Dump the boot metadata. We have to wait for cninit() since con= sole > + * output is required. If it's grossly incorrect the kernel will = never > + * make it this far. > + */ > + if ((boothowto & RB_VERBOSE) && > + getenv_is_true("debug.dump_modinfo_at_boot")) > + preload_dump(); > + > init_proc0(abp->kern_stack); > msgbufinit(msgbufp, msgbufsize); > mutex_init(); > > Modified: head/sys/kern/subr_module.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > --- head/sys/kern/subr_module.c Thu Oct 8 17:30:05 2020 (= r366541) > +++ head/sys/kern/subr_module.c Thu Oct 8 18:02:05 2020 (= r366542) > @@ -3,6 +3,8 @@ > * > * Copyright (c) 1998 Michael Smith > * All rights reserved. > + * Copyright (c) 2020 NetApp Inc. > + * Copyright (c) 2020 Klara Inc. > * > * Redistribution and use in source and binary forms, with or withou= t > * modification, are permitted provided that the following condition= s > @@ -32,7 +34,11 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > +#include > > +#include > + > #include > #include > > @@ -304,3 +310,249 @@ preload_bootstrap_relocate(vm_offset_t offset) > } > } > } > + > +/* > + * Parse the modinfo type and append to the provided sbuf. > + */ > +static void > +preload_modinfo_type(struct sbuf *sbp, int type) > +{ > + > + if ((type & MODINFO_METADATA) =3D=3D 0) { > + switch (type) { > + case MODINFO_END: > + sbuf_cat(sbp, "MODINFO_END"); > + break; > + case MODINFO_NAME: > + sbuf_cat(sbp, "MODINFO_NAME"); > + break; > + case MODINFO_TYPE: > + sbuf_cat(sbp, "MODINFO_TYPE"); > + break; > + case MODINFO_ADDR: > + sbuf_cat(sbp, "MODINFO_ADDR"); > + break; > + case MODINFO_SIZE: > + sbuf_cat(sbp, "MODINFO_SIZE"); > + break; > + case MODINFO_EMPTY: > + sbuf_cat(sbp, "MODINFO_EMPTY"); > + break; > + case MODINFO_ARGS: > + sbuf_cat(sbp, "MODINFO_ARGS"); > + break; > + default: > + sbuf_cat(sbp, "unrecognized modinfo attribute"); > + } > + > + return; > + } > + > + sbuf_cat(sbp, "MODINFO_METADATA | "); > + switch (type & ~MODINFO_METADATA) { > + case MODINFOMD_ELFHDR: > + sbuf_cat(sbp, "MODINFOMD_ELFHDR"); > + break; > + case MODINFOMD_SSYM: > + sbuf_cat(sbp, "MODINFOMD_SSYM"); > + break; > + case MODINFOMD_ESYM: > + sbuf_cat(sbp, "MODINFOMD_ESYM"); > + break; > + case MODINFOMD_DYNAMIC: > + sbuf_cat(sbp, "MODINFOMD_DYNAMIC"); > + break; > + case MODINFOMD_ENVP: > + sbuf_cat(sbp, "MODINFOMD_ENVP"); > + break; > + case MODINFOMD_HOWTO: > + sbuf_cat(sbp, "MODINFOMD_HOWTO"); > + break; > + case MODINFOMD_KERNEND: > + sbuf_cat(sbp, "MODINFOMD_KERNEND"); > + break; > + case MODINFOMD_SHDR: > + sbuf_cat(sbp, "MODINFOMD_SHDR"); > + break; > + case MODINFOMD_CTORS_ADDR: > + sbuf_cat(sbp, "MODINFOMD_CTORS_ADDR"); > + break; > + case MODINFOMD_CTORS_SIZE: > + sbuf_cat(sbp, "MODINFOMD_CTORS_SIZE"); > + break; > + case MODINFOMD_FW_HANDLE: > + sbuf_cat(sbp, "MODINFOMD_FW_HANDLE"); > + break; > + case MODINFOMD_KEYBUF: > + sbuf_cat(sbp, "MODINFOMD_KEYBUF"); > + break; > +#ifdef MODINFOMD_SMAP > + case MODINFOMD_SMAP: > + sbuf_cat(sbp, "MODINFOMD_SMAP"); > + break; > +#endif > +#ifdef MODINFOMD_SMAP_XATTR > + case MODINFOMD_SMAP_XATTR: > + sbuf_cat(sbp, "MODINFOMD_SMAP_XATTR"); > + break; > +#endif > +#ifdef MODINFOMD_DTBP > + case MODINFOMD_DTBP: > + sbuf_cat(sbp, "MODINFOMD_DTBP"); > + break; > +#endif > +#ifdef MODINFOMD_EFI_MAP > + case MODINFOMD_EFI_MAP: > + sbuf_cat(sbp, "MODINFOMD_EFI_MAP"); > + break; > +#endif > +#ifdef MODINFOMD_EFI_FB > + case MODINFOMD_EFI_FB: > + sbuf_cat(sbp, "MODINFOMD_EFI_FB"); > + break; > +#endif > +#ifdef MODINFOMD_MODULEP > + case MODINFOMD_MODULEP: > + sbuf_cat(sbp, "MODINFOMD_MODULEP"); > + break; > +#endif > + default: > + sbuf_cat(sbp, "unrecognized metadata type"); > + } > +} > + > +/* > + * Print the modinfo value, depending on type. > + */ > +static void > +preload_modinfo_value(struct sbuf *sbp, uint32_t *bptr, int type, in= t len) > +{ > +#ifdef __LP64__ > +#define sbuf_print_vmoffset(sb, o) sbuf_printf(sb, "0x%016lx", o); > +#else > +#define sbuf_print_vmoffset(sb, o) sbuf_printf(sb, "0x%08x", o); > +#endif > + > + switch (type) { > + case MODINFO_NAME: > + case MODINFO_TYPE: > + case MODINFO_ARGS: > + sbuf_printf(sbp, "%s", (char *)bptr); > + break; > + case MODINFO_SIZE: > + case MODINFO_METADATA | MODINFOMD_CTORS_SIZE: > + sbuf_printf(sbp, "%lu", *(u_long *)bptr); > + break; > + case MODINFO_ADDR: > + case MODINFO_METADATA | MODINFOMD_SSYM: > + case MODINFO_METADATA | MODINFOMD_ESYM: > + case MODINFO_METADATA | MODINFOMD_DYNAMIC: > + case MODINFO_METADATA | MODINFOMD_KERNEND: > + case MODINFO_METADATA | MODINFOMD_ENVP: > + case MODINFO_METADATA | MODINFOMD_CTORS_ADDR: > +#ifdef MODINFOMD_SMAP > + case MODINFO_METADATA | MODINFOMD_SMAP: > +#endif > +#ifdef MODINFOMD_SMAP_XATTR > + case MODINFO_METADATA | MODINFOMD_SMAP_XATTR: > +#endif > +#ifdef MODINFOMD_DTBP > + case MODINFO_METADATA | MODINFOMD_DTBP: > +#endif > +#ifdef MODINFOMD_EFI_FB > + case MODINFO_METADATA | MODINFOMD_EFI_FB: > +#endif > + sbuf_print_vmoffset(sbp, *(vm_offset_t *)bptr); > + break; > + case MODINFO_METADATA | MODINFOMD_HOWTO: > + sbuf_printf(sbp, "0x%08x", *bptr); > + break; > + case MODINFO_METADATA | MODINFOMD_SHDR: > + case MODINFO_METADATA | MODINFOMD_ELFHDR: > + case MODINFO_METADATA | MODINFOMD_FW_HANDLE: > + case MODINFO_METADATA | MODINFOMD_KEYBUF: > +#ifdef MODINFOMD_EFI_MAP > + case MODINFO_METADATA | MODINFOMD_EFI_MAP: > +#endif > + /* Don't print data buffers. */ > + sbuf_cat(sbp, "buffer contents omitted"); > + break; > + default: > + break; > + } > +#undef sbuf_print_vmoffset > +} > + > +static void > +preload_dump_internal(struct sbuf *sbp) > +{ > + uint32_t *bptr, type, len; > + > + KASSERT(preload_metadata !=3D NULL, > + ("%s called without setting up preload_metadata", __func__)); > + > + /* > + * Iterate through the TLV-encoded sections. > + */ > + bptr =3D (uint32_t *)preload_metadata; > + sbuf_putc(sbp, '\n'); > + while (bptr[0] !=3D MODINFO_END || bptr[0] !=3D MODINFO_END) { > + sbuf_printf(sbp, " %p:\n", bptr); > + type =3D *bptr++; > + len =3D *bptr++; > + > + sbuf_printf(sbp, "\ttype:\t(%#04x) ", type); > + preload_modinfo_type(sbp, type); > + sbuf_putc(sbp, '\n'); > + sbuf_printf(sbp, "\tlen:\t%u\n", len); > + sbuf_cat(sbp, "\tvalue:\t"); > + preload_modinfo_value(sbp, bptr, type, len); > + sbuf_putc(sbp, '\n'); > + > + bptr +=3D roundup(len, sizeof(u_long)) / sizeof(uint32_t)= ; > + } > +} > + > +/* > + * Print the preloaded data to the console. Called from the machine-= dependent > + * initialization routines, e.g. hammer_time(). > + */ > +void > +preload_dump(void) > +{ > + char buf[512]; > + struct sbuf sb; > + > + /* > + * This function is expected to be called before malloc is availa= ble, > + * so use a static buffer and struct sbuf. > + */ > + sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN); > + sbuf_set_drain(&sb, sbuf_printf_drain, NULL); > + preload_dump_internal(&sb); > + > + sbuf_finish(&sb); > + sbuf_delete(&sb); > +} > + > +static int > +sysctl_preload_dump(SYSCTL_HANDLER_ARGS) > +{ > + struct sbuf sb; > + int error; > + > + if (preload_metadata =3D=3D NULL) > + return (EINVAL); > + > + sbuf_new_for_sysctl(&sb, NULL, 512, req); > + preload_dump_internal(&sb); > + > + error =3D sbuf_finish(&sb); > + sbuf_delete(&sb); > + > + return (error); > +} > +SYSCTL_PROC(_debug, OID_AUTO, dump_modinfo, > + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, > + NULL, 0, sysctl_preload_dump, "A", > + "pretty-print the bootloader metadata"); > > Modified: head/sys/riscv/riscv/machdep.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > --- head/sys/riscv/riscv/machdep.c Thu Oct 8 17:30:05 2020 (= r366541) > +++ head/sys/riscv/riscv/machdep.c Thu Oct 8 18:02:05 2020 (= r366542) > @@ -949,6 +949,15 @@ initriscv(struct riscv_bootparams *rvbp) > > cninit(); > > + /* > + * Dump the boot metadata. We have to wait for cninit() since con= sole > + * output is required. If it's grossly incorrect the kernel will = never > + * make it this far. > + */ > + if ((boothowto & RB_VERBOSE) && > + getenv_is_true("debug.dump_modinfo_at_boot")) > + preload_dump(); > + > init_proc0(rvbp->kern_stack); > > msgbufinit(msgbufp, msgbufsize); > > Modified: head/sys/sys/linker.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > --- head/sys/sys/linker.h Thu Oct 8 17:30:05 2020 (r366541) > +++ head/sys/sys/linker.h Thu Oct 8 18:02:05 2020 (r366542) > @@ -257,6 +257,7 @@ extern caddr_t preload_search_next_name(= caddr_t _base > extern caddr_t preload_search_info(caddr_t _mod, int _in= f); > extern void preload_delete_name(const char *_name); > extern void preload_bootstrap_relocate(vm_offset_t _o= ffset); > +extern void preload_dump(void); > > #ifdef KLD_DEBUG > > > From owner-svn-src-head@freebsd.org Thu Oct 8 18:35: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 7B9B042EF08; Thu, 8 Oct 2020 18:35:22 +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 4C6fyf2kgpz4MxS; Thu, 8 Oct 2020 18:35:22 +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 B24BB2313C; Thu, 8 Oct 2020 18:35:21 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.41.20091302 Date: Thu, 08 Oct 2020 11:35:18 -0700 Subject: Re: svn commit: r366543 - head/sys/kern From: Ravi Pokala To: Mitchell Horne , , , Message-ID: <3C85CF6B-CB67-4446-879B-21FFB52A1AF4@panasas.com> Thread-Topic: svn commit: r366543 - head/sys/kern References: <202010081829.098ITHNE065741@repo.freebsd.org> In-Reply-To: <202010081829.098ITHNE065741@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" 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, 08 Oct 2020 18:35:22 -0000 -----Original Message----- From: on behalf of Mitchell Horne Date: 2020-10-08, Thursday at 11:29 To: , , Subject: svn commit: r366543 - head/sys/kern Author: mhorne Date: Thu Oct 8 18:29:17 2020 New Revision: 366543 URL: https://svnweb.freebsd.org/changeset/base/366543 Log: Fix a loop condition The correct way to identify the end of the metadata is two adjacent entries set to zero/MODINFO_END. I made a typo and this was checking the first entry twice. Reported by: rpokala Thanks! :-) Ravi (rpokala@) Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Modified: head/sys/kern/subr_module.c Modified: head/sys/kern/subr_module.c ============================================================================== --- head/sys/kern/subr_module.c Thu Oct 8 18:02:05 2020 (r366542) +++ head/sys/kern/subr_module.c Thu Oct 8 18:29:17 2020 (r366543) @@ -496,7 +496,7 @@ preload_dump_internal(struct sbuf *sbp) */ bptr = (uint32_t *)preload_metadata; sbuf_putc(sbp, '\n'); - while (bptr[0] != MODINFO_END || bptr[0] != MODINFO_END) { + while (bptr[0] != MODINFO_END || bptr[1] != MODINFO_END) { sbuf_printf(sbp, " %p:\n", bptr); type = *bptr++; len = *bptr++; From owner-svn-src-head@freebsd.org Thu Oct 8 18:50: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 135B742EF38; Thu, 8 Oct 2020 18:50:28 +0000 (UTC) (envelope-from mhorne@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 4C6gJ36kJgz4NGk; Thu, 8 Oct 2020 18:50:27 +0000 (UTC) (envelope-from mhorne@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: mhorne) by smtp.freebsd.org (Postfix) with ESMTPSA id C474B2332C; Thu, 8 Oct 2020 18:50:27 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: by mail-yb1-f178.google.com with SMTP id x8so5275061ybe.12; Thu, 08 Oct 2020 11:50:27 -0700 (PDT) X-Gm-Message-State: AOAM530WWEhEEvkFmuKe9ylOTYhtD5lcsBDq4eVZVMhvHaLt1DAljjCC Ypy2ivwAzAPMIpiX9am8ceN7Xx84mCyY52M7q4w= X-Google-Smtp-Source: ABdhPJwqzfSqDhQYlKfd7Iew0ey8L8NxGv4kPE7NmWpZw6eFSi4JBuH7LSdJTmrjzmB+C+HTIBBoPxaBSY2FJ4mKcsc= X-Received: by 2002:a25:5507:: with SMTP id j7mr13114944ybb.214.1602183027289; Thu, 08 Oct 2020 11:50:27 -0700 (PDT) MIME-Version: 1.0 References: <202010081802.098I26Rq052294@repo.freebsd.org> In-Reply-To: From: Mitchell Horne Date: Thu, 8 Oct 2020 15:50:15 -0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r366542 - in head/sys: amd64/amd64 arm/arm arm64/arm64 kern riscv/riscv sys 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, 08 Oct 2020 18:50:28 -0000 On Thu, Oct 8, 2020 at 3:15 PM Kyle Evans wrote: > > On Thu, Oct 8, 2020 at 1:02 PM Mitchell Horne wrote: > > > > Author: mhorne > > Date: Thu Oct 8 18:02:05 2020 > > New Revision: 366542 > > URL: https://svnweb.freebsd.org/changeset/base/366542 > > > > Log: > > Add a routine to dump boot metadata > > > > The boot metadata (also referred to as modinfo, or preload metadata) > > provides information about the size and location of the kernel, > > pre-loaded modules, and other metadata (e.g. the EFI framebuffer) to be > > consumed during by the kernel during early boot. It is encoded as a > > series of type-length-value entries and is usually constructed by > > loader(8) and passed to the kernel. It is also faked on some > > architectures when booted by other means. > > > > Although much of the module information is available via kldstat(8), > > there is no easy way to debug the metadata in its entirety. Add some > > routines to parse this data and allow it to be printed to the console > > during early boot or output via a sysctl. > > > > Since the output can be lengthly, printing to the console is gated > > behind the debug.dump_modinfo_at_boot kenv variable as well as the > > BOOTVERBOSE flag. The sysctl to print the metadata is named > > debug.dump_modinfo. > > > > Hi, > > Why both a tunable and boot -v? The tunable is already specifically > scoped to just this operation, it seems a little odd to double-gate > it. > Hey Kyle, The original patch was gated behind just boot -v. In testing I realized this change is potentially quite noisy (even by bootverbose standards), so I added the tunable to make it opt-in. The thinking is that you could set debug.dump_modinfo_at_boot=1 once in loader.conf and forget it, as you wouldn't see the preload_dump() output on a normal boot. Thinking about it again, this might be overly complicated for what is at best a niche debugging feature. If gating it behind just the tunable is more in line with how other things work then I'm happy to change it. Mitchell > Thanks, > > Kyle Evans From owner-svn-src-head@freebsd.org Thu Oct 8 20: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 AD330431122; Thu, 8 Oct 2020 20:55:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6k4r3znWz4TMs; Thu, 8 Oct 2020 20:55:56 +0000 (UTC) (envelope-from imp@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 67F5BEC7F; Thu, 8 Oct 2020 20:55:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 098Ktu2A057313; Thu, 8 Oct 2020 20:55:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 098KtuKC057312; Thu, 8 Oct 2020 20:55:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010082055.098KtuKC057312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 8 Oct 2020 20:55:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366544 - in head/sys/modules: . apm X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/modules: . apm X-SVN-Commit-Revision: 366544 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, 08 Oct 2020 20:55:56 -0000 Author: imp Date: Thu Oct 8 20:55:55 2020 New Revision: 366544 URL: https://svnweb.freebsd.org/changeset/base/366544 Log: Remove apm module The apm code is about to be removed. Remove the module since it's about to be useless. Deleted: head/sys/modules/apm/Makefile Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Oct 8 18:29:17 2020 (r366543) +++ head/sys/modules/Makefile Thu Oct 8 20:55:55 2020 (r366544) @@ -41,7 +41,6 @@ SUBDIR= \ amr \ ${_an} \ ${_aout} \ - ${_apm} \ ${_arcmsr} \ ${_allwinner} \ ${_armv8crypto} \ @@ -744,7 +743,6 @@ _vmm= vmm # XXX some of these can move now, but are untested on other architectures. _3dfx= 3dfx _3dfx_linux= 3dfx_linux -_apm= apm .if ${MK_SOURCELESS_HOST} != "no" _ce= ce .endif From owner-svn-src-head@freebsd.org Thu Oct 8 20:56: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 B1238430EC0; Thu, 8 Oct 2020 20:56:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6k4y6J8gz4T8Z; Thu, 8 Oct 2020 20:56:02 +0000 (UTC) (envelope-from imp@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 DA2DCEB2C; Thu, 8 Oct 2020 20:56:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 098Ku1i2057373; Thu, 8 Oct 2020 20:56:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 098Ku14p057370; Thu, 8 Oct 2020 20:56:01 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010082056.098Ku14p057370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 8 Oct 2020 20:56:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366545 - in head/sys: conf i386/conf modules/syscons modules/syscons/apm X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: conf i386/conf modules/syscons modules/syscons/apm X-SVN-Commit-Revision: 366545 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, 08 Oct 2020 20:56:06 -0000 Author: imp Date: Thu Oct 8 20:56:00 2020 New Revision: 366545 URL: https://svnweb.freebsd.org/changeset/base/366545 Log: Remove apm screen saver. APM BIOS support is about to be removed. Remove the apm screen saver and its module. They are about to be irrelevant. Deleted: head/sys/modules/syscons/apm/Makefile Modified: head/sys/conf/files.i386 head/sys/i386/conf/NOTES head/sys/modules/syscons/Makefile Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Thu Oct 8 20:55:55 2020 (r366544) +++ head/sys/conf/files.i386 Thu Oct 8 20:56:00 2020 (r366545) @@ -119,7 +119,6 @@ dev/sbni/if_sbni_isa.c optional sbni isa dev/sbni/if_sbni_pci.c optional sbni pci dev/speaker/spkr.c optional speaker dev/superio/superio.c optional superio isa -dev/syscons/apm/apm_saver.c optional apm_saver apm dev/syscons/scvesactl.c optional sc vga vesa dev/syscons/scvgarndr.c optional sc vga dev/tpm/tpm.c optional tpm Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Thu Oct 8 20:55:55 2020 (r366544) +++ head/sys/i386/conf/NOTES Thu Oct 8 20:56:00 2020 (r366545) @@ -275,7 +275,6 @@ device nvram # Access to rtc cmos via /dev/nvram device speaker #Play IBM BASIC-style noises out your speaker envvar hint.speaker.0.at="isa" envvar hint.speaker.0.port="0x61" -device apm_saver # Requires APM ##################################################################### Modified: head/sys/modules/syscons/Makefile ============================================================================== --- head/sys/modules/syscons/Makefile Thu Oct 8 20:55:55 2020 (r366544) +++ head/sys/modules/syscons/Makefile Thu Oct 8 20:56:00 2020 (r366545) @@ -1,7 +1,6 @@ # $FreeBSD$ -SUBDIR= ${_apm} \ - beastie \ +SUBDIR= beastie \ blank \ daemon \ dragon \ @@ -14,9 +13,5 @@ SUBDIR= ${_apm} \ snake \ star \ warp - -.if ${MACHINE_CPUARCH} == "i386" -_apm= apm -.endif .include From owner-svn-src-head@freebsd.org Thu Oct 8 20:56: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 D32B24310E6; Thu, 8 Oct 2020 20:56:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6k533tYLz4TL8; Thu, 8 Oct 2020 20:56:07 +0000 (UTC) (envelope-from imp@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 5B7C9ED80; Thu, 8 Oct 2020 20:56:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 098Ku758057427; Thu, 8 Oct 2020 20:56:07 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 098Ku67C057424; Thu, 8 Oct 2020 20:56:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010082056.098Ku67C057424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 8 Oct 2020 20:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366546 - in head/sys: conf dev/syscons/apm i386/bios i386/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: conf dev/syscons/apm i386/bios i386/conf X-SVN-Commit-Revision: 366546 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, 08 Oct 2020 20:56:08 -0000 Author: imp Date: Thu Oct 8 20:56:06 2020 New Revision: 366546 URL: https://svnweb.freebsd.org/changeset/base/366546 Log: Remove APM BIOS support APM BIOS was relevant only to early laptops (approximately P166 or P200 and slower). These have not been relevant for a long time, and this code has been untested for a long time (as far as I can tell). The APM compat code in ACPI and the apm(8) command is not being retired. Both of these items are still in use (apm(8) is more scriptable than the replacement acpiconf, for the most part). This has been commented out of i386 GENERIC since 2002. This code is not relevant to any other port. Discussed on: arch@ Deleted: head/sys/dev/syscons/apm/apm_saver.c head/sys/i386/bios/apm.c head/sys/i386/bios/apm.h Modified: head/sys/conf/files.i386 head/sys/i386/conf/GENERIC head/sys/i386/conf/NOTES Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Thu Oct 8 20:56:00 2020 (r366545) +++ head/sys/conf/files.i386 Thu Oct 8 20:56:06 2020 (r366546) @@ -162,7 +162,6 @@ acpi_wakedata.h optional acpi \ no-obj no-implicit-rule before-depend \ clean "acpi_wakedata.h" # -i386/bios/apm.c optional apm i386/bios/smapi.c optional smapi i386/bios/smapi_bios.S optional smapi i386/cloudabi32/cloudabi32_sysvec.c optional compat_cloudabi32 Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Thu Oct 8 20:56:00 2020 (r366545) +++ head/sys/i386/conf/GENERIC Thu Oct 8 20:56:06 2020 (r366546) @@ -198,9 +198,6 @@ device vt_vga device agp # support several AGP chipsets -# Power management support (see NOTES for more options) -#device apm - # PCCARD (PCMCIA) support # PCMCIA and cardbus bridge support device cbb # cardbus (yenta) bridge Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Thu Oct 8 20:56:00 2020 (r366545) +++ head/sys/i386/conf/NOTES Thu Oct 8 20:56:06 2020 (r366546) @@ -729,7 +729,6 @@ device hyperv # HyperV drivers # # Miscellaneous hardware: # -# apm: Laptop Advanced Power Management (experimental) # ipmi: Intelligent Platform Management Interface # smapi: System Management Application Program Interface driver # smbios: DMI/SMBIOS entry point @@ -739,10 +738,6 @@ device hyperv # HyperV drivers # si: Specialix International SI/XIO or SX intelligent serial card driver # tpm: Trusted Platform Module -# Notes on APM -# The flags takes the following meaning for apm0: -# 0x0020 Statclock is broken. - # Notes on the Specialix SI/XIO driver: # The host card is memory, not IO mapped. # The Rev 1 host cards use a 64K chunk, on a 32K boundary. @@ -761,8 +756,6 @@ device hyperv # HyperV drivers # is the only thing truly supported, but apparently a fair percentage # of the Vaio extra features are controlled by this device. -device apm -envvar hint.apm.0.flags="0x20" device ipmi device smapi device smbios From owner-svn-src-head@freebsd.org Thu Oct 8 20:56:14 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 E711E431413; Thu, 8 Oct 2020 20:56:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6k5B2FGsz4TFr; Thu, 8 Oct 2020 20:56:13 +0000 (UTC) (envelope-from imp@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 75E3DED0E; Thu, 8 Oct 2020 20:56:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 098KuCKJ057481; Thu, 8 Oct 2020 20:56:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 098KuCpU057480; Thu, 8 Oct 2020 20:56:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010082056.098KuCpU057480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 8 Oct 2020 20:56:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366547 - in head/sys: i386/include x86/isa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: i386/include x86/isa X-SVN-Commit-Revision: 366547 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, 08 Oct 2020 20:56:15 -0000 Author: imp Date: Thu Oct 8 20:56:11 2020 New Revision: 366547 URL: https://svnweb.freebsd.org/changeset/base/366547 Log: timer_restore is now unused, remove it apm was the only consumer of timer_restore. Now that it's gone, this can be removed. Modified: head/sys/i386/include/clock.h head/sys/x86/isa/clock.c Modified: head/sys/i386/include/clock.h ============================================================================== --- head/sys/i386/include/clock.h Thu Oct 8 20:56:06 2020 (r366546) +++ head/sys/i386/include/clock.h Thu Oct 8 20:56:11 2020 (r366547) @@ -30,7 +30,6 @@ void clock_init(void); */ void startrtclock(void); -void timer_restore(void); void init_TSC(void); void resume_TSC(void); Modified: head/sys/x86/isa/clock.c ============================================================================== --- head/sys/x86/isa/clock.c Thu Oct 8 20:56:06 2020 (r366546) +++ head/sys/x86/isa/clock.c Thu Oct 8 20:56:11 2020 (r366547) @@ -388,26 +388,6 @@ i8254_restore(void) set_i8254_freq(MODE_STOP, 0); } -#ifndef __amd64__ -/* - * Restore all the timers non-atomically (XXX: should be atomically). - * - * This function is called from pmtimer_resume() to restore all the timers. - * This should not be necessary, but there are broken laptops that do not - * restore all the timers on resume. The APM spec was at best vague on the - * subject. - * pmtimer is used only with the old APM power management, and not with - * acpi, which is required for amd64, so skip it in that case. - */ -void -timer_restore(void) -{ - - i8254_restore(); /* restore i8254_freq and hz */ - atrtc_restore(); /* reenable RTC interrupts */ -} -#endif - /* This is separate from startrtclock() so that it can be called early. */ void i8254_init(void) From owner-svn-src-head@freebsd.org Thu Oct 8 22:00: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 E65C543252E; Thu, 8 Oct 2020 22:00:31 +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 4C6lWM5m31z4XSX; Thu, 8 Oct 2020 22:00:31 +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 AA65AF780; Thu, 8 Oct 2020 22:00:31 +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 098M0V5f095151; Thu, 8 Oct 2020 22:00:31 GMT (envelope-from alfredo@FreeBSD.org) Received: (from alfredo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 098M0VOG095150; Thu, 8 Oct 2020 22:00:31 GMT (envelope-from alfredo@FreeBSD.org) Message-Id: <202010082200.098M0VOG095150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alfredo set sender to alfredo@FreeBSD.org using -f From: "Alfredo Dal'Ava Junior" Date: Thu, 8 Oct 2020 22:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366548 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: alfredo X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 366548 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, 08 Oct 2020 22:00:32 -0000 Author: alfredo Date: Thu Oct 8 22:00:31 2020 New Revision: 366548 URL: https://svnweb.freebsd.org/changeset/base/366548 Log: [PowerPC] add machdep.uprintf_signal sysctl Add support for sysctl 'machdep.uprintf_signal' that prints debugging information on trap signal. Reviewed by: jhibbits, luporl, bdragon Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D26004 Modified: head/sys/powerpc/powerpc/trap.c Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Thu Oct 8 20:56:11 2020 (r366547) +++ head/sys/powerpc/powerpc/trap.c Thu Oct 8 22:00:31 2020 (r366548) @@ -153,6 +153,11 @@ static struct powerpc_exception powerpc_exceptions[] = { EXC_LAST, NULL } }; +static int uprintf_signal; +SYSCTL_INT(_machdep, OID_AUTO, uprintf_signal, CTLFLAG_RWTUN, + &uprintf_signal, 0, + "Print debugging information on trap signal to ctty"); + #define ESR_BITMASK \ "\20" \ "\040b0\037b1\036b2\035b3\034PIL\033PRR\032PTR\031FP" \ @@ -489,6 +494,14 @@ trap(struct trapframe *frame) ksi.ksi_code = (int) ucode; /* XXX, not POSIX */ ksi.ksi_addr = (void *)addr; ksi.ksi_trapno = type; + if (uprintf_signal) { + uprintf("pid %d comm %s: signal %d code %d type %d " + "addr 0x%lx r1 0x%lx srr0 0x%lx srr1 0x%lx\n", + p->p_pid, p->p_comm, sig, ucode, type, + (u_long)addr, (u_long)frame->fixreg[1], + (u_long)frame->srr0, (u_long)frame->srr1); + } + trapsignal(td, &ksi); } From owner-svn-src-head@freebsd.org Thu Oct 8 22:31: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 9FE98432D31; Thu, 8 Oct 2020 22:31:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6mBm3qXgz4Yf2; Thu, 8 Oct 2020 22:31:12 +0000 (UTC) (envelope-from kib@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 67693FC2B; Thu, 8 Oct 2020 22:31:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 098MVCp1016808; Thu, 8 Oct 2020 22:31:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 098MVCQm016807; Thu, 8 Oct 2020 22:31:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010082231.098MVCQm016807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 8 Oct 2020 22:31:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366549 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366549 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, 08 Oct 2020 22:31:12 -0000 Author: kib Date: Thu Oct 8 22:31:11 2020 New Revision: 366549 URL: https://svnweb.freebsd.org/changeset/base/366549 Log: Do not allow to use O_BENEATH as an oracle. Specifically, if lookup() returned any error and the topping directory was not latched, which means that (non-existent) path did not returned to the topping location, give ENOTCAPABLE a priority over the lookup() error. PR: 249960 Reviewed by: emaste, ngie Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26695 Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Thu Oct 8 22:00:31 2020 (r366548) +++ head/sys/kern/vfs_lookup.c Thu Oct 8 22:31:11 2020 (r366549) @@ -595,8 +595,17 @@ namei(struct nameidata *ndp) for (;;) { ndp->ni_startdir = dp; error = lookup(ndp); - if (error != 0) + if (error != 0) { + /* + * Override an error to not allow user to use + * BENEATH as an oracle. + */ + if ((ndp->ni_lcf & (NI_LCF_LATCH | + NI_LCF_BENEATH_LATCHED)) == NI_LCF_LATCH) + error = ENOTCAPABLE; goto out; + } + /* * If not a symbolic link, we're done. */ From owner-svn-src-head@freebsd.org Thu Oct 8 22:34: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 B2EC4432EA5; Thu, 8 Oct 2020 22:34:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6mGg4JDxz4Yj7; Thu, 8 Oct 2020 22:34:35 +0000 (UTC) (envelope-from kib@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 72D26FB59; Thu, 8 Oct 2020 22:34:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 098MYZgX019460; Thu, 8 Oct 2020 22:34:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 098MYZmB019459; Thu, 8 Oct 2020 22:34:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010082234.098MYZmB019459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 8 Oct 2020 22:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366550 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366550 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, 08 Oct 2020 22:34:35 -0000 Author: kib Date: Thu Oct 8 22:34:34 2020 New Revision: 366550 URL: https://svnweb.freebsd.org/changeset/base/366550 Log: sig_intr(9): return early if AST is not scheduled. Check td_flags for relevant AST requests lock-less. This opens the race slightly wider where sig_intr() returns false negative, but might be it is worth it. Requested by: mjg Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Thu Oct 8 22:31:11 2020 (r366549) +++ head/sys/kern/kern_sig.c Thu Oct 8 22:34:34 2020 (r366550) @@ -3212,6 +3212,9 @@ sig_intr(void) int ret; td = curthread; + if ((td->td_flags & (TDF_NEEDSIGCHK | TDF_NEEDSUSPCHK)) == 0) + return (0); + p = td->td_proc; PROC_LOCK(p); From owner-svn-src-head@freebsd.org Thu Oct 8 22:41: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 8252F433189; Thu, 8 Oct 2020 22:41:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6mQ72X7kz4Z6S; Thu, 8 Oct 2020 22:41:03 +0000 (UTC) (envelope-from kib@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 3A458FDA3; Thu, 8 Oct 2020 22:41:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 098Mf3mc022275; Thu, 8 Oct 2020 22:41:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 098Mf3qB022274; Thu, 8 Oct 2020 22:41:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010082241.098Mf3qB022274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 8 Oct 2020 22:41:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366551 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 366551 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, 08 Oct 2020 22:41:03 -0000 Author: kib Date: Thu Oct 8 22:41:02 2020 New Revision: 366551 URL: https://svnweb.freebsd.org/changeset/base/366551 Log: Do not leak B_BARRIER. Normally when a buffer with B_BARRIER is written, the flag is cleared by g_vfs_strategy() when creating bio. But in some cases FFS buffer might not reach g_vfs_strategy(), for instance when copy-on-write reports an error like ENOSPC. In this case buffer is returned to dirty queue and might be written later by other means. Among then bdwrite() reasonably asserts that B_BARRIER is not set. In fact, the only current use of B_BARRIER is for lazy inode block initialization, where write of the new inode block is fenced against cylinder group write to mark inode as used. The situation could be seen that we break dependency by updating cg without written out inode. Practically since CoW was not able to find space for a copy of inode block, for the same reason cg group block write should fail. Reported by: pho Discussed with: chs, imp, mckusick Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26511 Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Thu Oct 8 22:34:34 2020 (r366550) +++ head/sys/ufs/ffs/ffs_vfsops.c Thu Oct 8 22:41:02 2020 (r366551) @@ -2582,6 +2582,7 @@ ffs_geom_strategy(struct bufobj *bo, struct buf *bp) error != EOPNOTSUPP) { bp->b_error = error; bp->b_ioflags |= BIO_ERROR; + bp->b_flags &= ~B_BARRIER; bufdone(bp); return; } @@ -2594,6 +2595,7 @@ ffs_geom_strategy(struct bufobj *bo, struct buf *bp) if (error != 0 && error != EOPNOTSUPP) { bp->b_error = error; bp->b_ioflags |= BIO_ERROR; + bp->b_flags &= ~B_BARRIER; bufdone(bp); return; } From owner-svn-src-head@freebsd.org Thu Oct 8 22:46: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 E1E684331A9; Thu, 8 Oct 2020 22:46:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6mX75fswz4ZRM; Thu, 8 Oct 2020 22:46:15 +0000 (UTC) (envelope-from kib@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 A5A70F7F6; Thu, 8 Oct 2020 22:46:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 098MkFrq025640; Thu, 8 Oct 2020 22:46:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 098MkFBE025639; Thu, 8 Oct 2020 22:46:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202010082246.098MkFBE025639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 8 Oct 2020 22:46:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366552 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 366552 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, 08 Oct 2020 22:46:15 -0000 Author: kib Date: Thu Oct 8 22:46:15 2020 New Revision: 366552 URL: https://svnweb.freebsd.org/changeset/base/366552 Log: vm_page_dump_index_to_pa(): Add braces to the expression involving + and &. The precedence of the '&' operator is less than of '+'. Added braces do change the order of evaluation into the natural one, in my opinion. On the other hand, the value of the expression should not change since all elements should have page-aligned values. This fixes a gcc warning reported. Reported by: adrian Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Thu Oct 8 22:41:02 2020 (r366551) +++ head/sys/vm/vm_page.h Thu Oct 8 22:46:15 2020 (r366552) @@ -639,7 +639,7 @@ vm_page_dump_index_to_pa(int bit) dump_avail[i] / PAGE_SIZE; if (bit < tot) return ((vm_paddr_t)bit * PAGE_SIZE + - dump_avail[i] & ~PAGE_MASK); + (dump_avail[i] & ~PAGE_MASK)); bit -= tot; } return ((vm_paddr_t)NULL); From owner-svn-src-head@freebsd.org Fri Oct 9 00:16: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 5430B435006; Fri, 9 Oct 2020 00:16:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6pXC1cKVz4dxb; Fri, 9 Oct 2020 00:16:27 +0000 (UTC) (envelope-from imp@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 00E3110EC1; Fri, 9 Oct 2020 00:16:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0990GQDj080875; Fri, 9 Oct 2020 00:16:26 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0990GQq2080874; Fri, 9 Oct 2020 00:16:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010090016.0990GQq2080874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 9 Oct 2020 00:16:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366554 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 366554 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, 09 Oct 2020 00:16:27 -0000 Author: imp Date: Fri Oct 9 00:16:26 2020 New Revision: 366554 URL: https://svnweb.freebsd.org/changeset/base/366554 Log: Initial support for implementing the bootXXX.efi workaround Too many version of UEFI firmware (so far only confirmed on amd64) don't really support efibootmgr selection of boot. That's the most reliable, when it works, since there's no guesswork. However, many do not save, unmolested, the variables that efibootmgr sets, so as a fallback we also install loader.efi as bootXXX.efi (where XXX is either aa64 or x64) if it doesn't already exist in /efi/boot on the ESP. The standard only defines this for removable devices, but it's almost ubiquitously used as a fallback. Many BIOSes implement a drive selection feature that takes over the efibootmgr protocol, rendinering it useless (either generally, or for those vendors not on the short list). bootxxx.efi works around this. However, we don't install it unconditionally there, as that breaks some popular multi-boot setups. MFC After: 1 week Differential Revision: https://reviews.freebsd.org/D26428 Modified: head/usr.sbin/bsdinstall/scripts/bootconfig Modified: head/usr.sbin/bsdinstall/scripts/bootconfig ============================================================================== --- head/usr.sbin/bsdinstall/scripts/bootconfig Thu Oct 8 23:59:58 2020 (r366553) +++ head/usr.sbin/bsdinstall/scripts/bootconfig Fri Oct 9 00:16:26 2020 (r366554) @@ -124,6 +124,15 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" done fi + case $(uname -m) in + arm64) ARCHBOOTNAME=aa64 ;; + amd64) ARCHBOOTNAME=x64 ;; + # arm) ARCHBOOTNAME=arm ;; # No other support for arm install + # i386) ARCHBOOTNAME=ia32 ;; # no support for this in i386 kernels, rare machines + *) die "Unsupported arch $(uname -m) for UEFI install" + esac + BOOTNAME="/EFI/BOOT/BOOT${ARCHBOOTNAME}.EFI" + for esp in $ESPS; do f_dprintf "Formatting /dev/${esp} as FAT32" newfs_msdos -F 32 -c 1 -L EFISYS "/dev/$esp" > /dev/null 2>&1 @@ -141,6 +150,21 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" f_dprintf "Installing loader.efi onto ESP" mkdir -p "$mntpt/EFI/freebsd" cp "$BSDINSTALL_CHROOT/boot/loader.efi" "${mntpt}/EFI/freebsd/loader.efi" + + # + # The following shouldn't be necessary. UEFI defines a way to + # specifically select what to boot (which we do via + # efibootmgr). However, virtual environments often times lack + # support for the NV variables efibootmgr sets. In addition, + # some UEFI implementations have features that interfere with + # the setting of these variables. To combat that, we install the + # default removable media boot file as a fallback if it doesn't + # exist. We don't install it all the time since that can + # interfere with other installations on the drive (like rEFInd). + # + if [ ! -f "${mntpt}/${BOOTNAME}" ]; then + cp "$BSDINSTALL_CHROOT/boot/loader.efi" "${mntpt}/${BOOTNAME}" + fi if [ "$num_esps" -gt 1 ]; then bootlabel="FreeBSD (${esp})" From owner-svn-src-head@freebsd.org Fri Oct 9 00:27: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 444FF435292; Fri, 9 Oct 2020 00:27:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6pn90qbKz4g3j; Fri, 9 Oct 2020 00:27:41 +0000 (UTC) (envelope-from imp@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 EEFA310E44; Fri, 9 Oct 2020 00:27:40 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0990ReAp087034; Fri, 9 Oct 2020 00:27:40 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0990Rex8087033; Fri, 9 Oct 2020 00:27:40 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010090027.0990Rex8087033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 9 Oct 2020 00:27:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366555 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 366555 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, 09 Oct 2020 00:27:41 -0000 Author: imp Date: Fri Oct 9 00:27:40 2020 New Revision: 366555 URL: https://svnweb.freebsd.org/changeset/base/366555 Log: Eliminate building LINT makefiles LINT config files are about to be checked in directly. Eliminate building them by hand here from NOTES files. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D26540 Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Fri Oct 9 00:16:26 2020 (r366554) +++ head/Makefile Fri Oct 9 00:27:40 2020 (r366555) @@ -682,13 +682,6 @@ universe_${target}_${target_arch}: universe_${target}_ universe_${target}_done: universe_${target}_kernels .PHONY universe_${target}_kernels: universe_${target}_worlds .PHONY universe_${target}_kernels: universe_${target}_prologue .MAKE .PHONY - @if [ -e "${KERNSRCDIR}/${target}/conf/NOTES" ]; then \ - (cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=/dev/null \ - ${SUB_MAKE} LINT \ - > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ - (echo "${target} 'make LINT' failed," \ - "check _.${target}.makeLINT for details"| ${MAKEFAIL})); \ - fi @cd ${.CURDIR}; ${SUB_MAKE} ${.MAKEFLAGS} TARGET=${target} \ universe_kernels .endif # ${__DO_KERNELS} == "yes" @@ -760,9 +753,6 @@ universe_epilogue: .PHONY fi .endif .endif - -buildLINT: .PHONY - ${MAKE} -C ${.CURDIR}/sys/${_TARGET}/conf LINT .if defined(.PARSEDIR) # This makefile does not run in meta mode From owner-svn-src-head@freebsd.org Fri Oct 9 00:27: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 5A7DE434D6D; Fri, 9 Oct 2020 00:27:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6pnH017gz4g4B; Fri, 9 Oct 2020 00:27:46 +0000 (UTC) (envelope-from imp@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 3FD39111B2; Fri, 9 Oct 2020 00:27:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0990RknO087090; Fri, 9 Oct 2020 00:27:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0990RkFC087089; Fri, 9 Oct 2020 00:27:46 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010090027.0990RkFC087089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 9 Oct 2020 00:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366556 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 366556 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, 09 Oct 2020 00:27:47 -0000 Author: imp Date: Fri Oct 9 00:27:45 2020 New Revision: 366556 URL: https://svnweb.freebsd.org/changeset/base/366556 Log: Stop ignoring makeLINT generated files We're going to check these files in shortly since we don't need to generate them anymore. Generated files cause issues for different work flows anyway. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D26540 Modified: head/.gitignore Modified: head/.gitignore ============================================================================== --- head/.gitignore Fri Oct 9 00:27:40 2020 (r366555) +++ head/.gitignore Fri Oct 9 00:27:45 2020 (r366556) @@ -17,19 +17,3 @@ GTAGS ID cscope.out ?cscope.out -# Ignore LINT generated configs. -/sys/amd64/conf/LINT -/sys/amd64/conf/LINT-NOINET -/sys/amd64/conf/LINT-NOINET6 -/sys/amd64/conf/LINT-NOIP -/sys/arm/conf/LINT -/sys/arm/conf/LINT-V5 -/sys/arm/conf/LINT-V7 -/sys/arm64/conf/LINT -/sys/i386/conf/LINT -/sys/i386/conf/LINT-NOINET -/sys/i386/conf/LINT-NOINET6 -/sys/i386/conf/LINT-NOIP -/sys/powerpc/conf/LINT -/sys/powerpc/conf/LINT64 -/sys/sparc64/conf/LINT From owner-svn-src-head@freebsd.org Fri Oct 9 01:04: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 E69AB435A1E; Fri, 9 Oct 2020 01:04:28 +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 4C6qbc5XqCz3SMB; Fri, 9 Oct 2020 01:04:28 +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 A1A4911AA4; Fri, 9 Oct 2020 01:04:28 +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 09914STc011335; Fri, 9 Oct 2020 01:04:28 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09914S2U011334; Fri, 9 Oct 2020 01:04:28 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202010090104.09914S2U011334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 9 Oct 2020 01:04:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366557 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366557 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, 09 Oct 2020 01:04:29 -0000 Author: rmacklem Date: Fri Oct 9 01:04:28 2020 New Revision: 366557 URL: https://svnweb.freebsd.org/changeset/base/366557 Log: Make vn_generic_copy_file_range() interruptible via a signal. Without this patch, when vn_generic_copy_file_range() is doing a large copy, it will remain in the function for a considerable amount of time, delaying handling of any outstanding signals until the copy completes. This patch adds checks for signals that need to be processed after each successful data copy cycle. When sig_intr() returns non-zero, vn_generic_copy_file_range() will return. The check "if (len < savlen)" ensures that some data has been copied, so that progress will be made. Note that, since copy_file_range(2) is allowed to return fewer bytes copied than requested, it will never return EINTR/ERESTART when sig_intr() returns non-zero. Reviewed by: kib, asomers Differential Revision: https://reviews.freebsd.org/D26620 Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Fri Oct 9 00:27:45 2020 (r366556) +++ head/sys/kern/vfs_vnops.c Fri Oct 9 01:04:28 2020 (r366557) @@ -3017,7 +3017,7 @@ vn_generic_copy_file_range(struct vnode *invp, off_t * struct uio io; off_t startoff, endoff, xfer, xfer2; u_long blksize; - int error; + int error, interrupted; bool cantseek, readzeros, eof, lastblock; ssize_t aresid; size_t copylen, len, rem, savlen; @@ -3027,6 +3027,7 @@ vn_generic_copy_file_range(struct vnode *invp, off_t * holein = holeout = 0; savlen = len = *lenp; error = 0; + interrupted = 0; dat = NULL; error = vn_lock(invp, LK_SHARED); @@ -3116,7 +3117,7 @@ vn_generic_copy_file_range(struct vnode *invp, off_t * * support holes on the server, but do not support FIOSEEKHOLE. */ eof = false; - while (len > 0 && error == 0 && !eof) { + while (len > 0 && error == 0 && !eof && interrupted == 0) { endoff = 0; /* To shut up compilers. */ cantseek = true; startoff = *inoffp; @@ -3177,6 +3178,8 @@ vn_generic_copy_file_range(struct vnode *invp, off_t * *inoffp += xfer; *outoffp += xfer; len -= xfer; + if (len < savlen) + interrupted = sig_intr(); } } copylen = MIN(len, endoff - startoff); @@ -3198,7 +3201,7 @@ vn_generic_copy_file_range(struct vnode *invp, off_t * xfer -= (*inoffp % blksize); } /* Loop copying the data block. */ - while (copylen > 0 && error == 0 && !eof) { + while (copylen > 0 && error == 0 && !eof && interrupted == 0) { if (copylen < xfer) xfer = copylen; error = vn_lock(invp, LK_SHARED); @@ -3239,6 +3242,8 @@ vn_generic_copy_file_range(struct vnode *invp, off_t * *outoffp += xfer; copylen -= xfer; len -= xfer; + if (len < savlen) + interrupted = sig_intr(); } } xfer = blksize; From owner-svn-src-head@freebsd.org Fri Oct 9 01:37:18 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 41FCC436317; Fri, 9 Oct 2020 01:37:18 +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 4C6rKT4Tlmz3TbW; Fri, 9 Oct 2020 01:37:17 +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 7824C118F8; Fri, 9 Oct 2020 01:37:17 +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 0991bH9f029927; Fri, 9 Oct 2020 01:37:17 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0991bHIG029926; Fri, 9 Oct 2020 01:37:17 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202010090137.0991bHIG029926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 9 Oct 2020 01:37:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366558 - in head/sys: amd64/conf arm/conf arm64/conf i386/conf mips/conf powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: amd64/conf arm/conf arm64/conf i386/conf mips/conf powerpc/conf X-SVN-Commit-Revision: 366558 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, 09 Oct 2020 01:37:18 -0000 Author: kevans Date: Fri Oct 9 01:37:17 2020 New Revision: 366558 URL: https://svnweb.freebsd.org/changeset/base/366558 Log: sys/*/conf: drop the svn:ignore We're going to commit the LINT. Modified: Directory Properties: head/sys/amd64/conf/ (props changed) head/sys/arm/conf/ (props changed) head/sys/arm64/conf/ (props changed) head/sys/i386/conf/ (props changed) head/sys/mips/conf/ (props changed) head/sys/powerpc/conf/ (props changed) From owner-svn-src-head@freebsd.org Fri Oct 9 01:48: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 9BD99436428; Fri, 9 Oct 2020 01:48:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6rZ93YZmz3Txd; Fri, 9 Oct 2020 01:48:17 +0000 (UTC) (envelope-from imp@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 5CEFE11976; Fri, 9 Oct 2020 01:48:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0991mH3X036089; Fri, 9 Oct 2020 01:48:17 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0991mEjc036077; Fri, 9 Oct 2020 01:48:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010090148.0991mEjc036077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 9 Oct 2020 01:48:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366559 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/i386/conf sys/powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/i386/conf sys/powerpc/conf X-SVN-Commit-Revision: 366559 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, 09 Oct 2020 01:48:17 -0000 Author: imp Date: Fri Oct 9 01:48:14 2020 New Revision: 366559 URL: https://svnweb.freebsd.org/changeset/base/366559 Log: Create in-tree LINT files Now that config(8) has supported include for 19 years, transition to including the NOTES files. include support didn't exist at the time, nor did the envvar stuff recently added. Now that it does, eliminate the building of LINT files by just including everything you need. Note: This may cause conflicts with updating in some cases. find sys -name LINT\* -rm is suggested across this commit to remove the generated LINT files. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D26540 Added: head/sys/amd64/conf/LINT (contents, props changed) head/sys/amd64/conf/LINT-NOINET (contents, props changed) head/sys/amd64/conf/LINT-NOINET6 (contents, props changed) head/sys/amd64/conf/LINT-NOIP (contents, props changed) head/sys/arm/conf/LINT (contents, props changed) head/sys/arm64/conf/LINT (contents, props changed) head/sys/i386/conf/LINT (contents, props changed) head/sys/i386/conf/LINT-NOINET (contents, props changed) head/sys/i386/conf/LINT-NOINET6 (contents, props changed) head/sys/i386/conf/LINT-NOIP (contents, props changed) head/sys/powerpc/conf/LINT (contents, props changed) head/sys/powerpc/conf/LINT64 (contents, props changed) Deleted: head/sys/amd64/conf/Makefile head/sys/arm/conf/Makefile head/sys/arm64/conf/Makefile head/sys/i386/conf/Makefile head/sys/powerpc/conf/Makefile Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Oct 9 01:37:17 2020 (r366558) +++ head/UPDATING Fri Oct 9 01:48:14 2020 (r366559) @@ -26,6 +26,19 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20200923: + LINT files are no longer generated. We now include the relevant NOTES + files. Note: This may cause conflicts with updating in some cases. + find sys -name LINT\* -rm + is suggested across this commit to remove the generated LINT files. + + If you have tried to update with generated files there, the svn + command you want to un-auger the tree is + cd sys/amd64/conf + svn revert -R . + and then do the above find from the top level. Substitute 'amd64' + above with where the error message indicates a conflict. + 20200824: OpenZFS support has been integrated. Do not upgrade root pools until the loader is updated to support zstd. Furthermore, we caution against Added: head/sys/amd64/conf/LINT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/conf/LINT Fri Oct 9 01:48:14 2020 (r366559) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +include "../../conf/NOTES" +include "../../x86/conf/NOTES" +include NOTES Added: head/sys/amd64/conf/LINT-NOINET ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/conf/LINT-NOINET Fri Oct 9 01:48:14 2020 (r366559) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +include LINT +ident LINT-NOINET +makeoptions MKMODULESENV+="WITHOUT_INET_SUPPORT=" +nooptions INET +nodevice gre +nodevice netmap Added: head/sys/amd64/conf/LINT-NOINET6 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/conf/LINT-NOINET6 Fri Oct 9 01:48:14 2020 (r366559) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +include LINT +ident LINT-NOINET6 +makeoptions MKMODULESENV+="WITHOUT_INET6_SUPPORT=" +nooptions INET6 Added: head/sys/amd64/conf/LINT-NOIP ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/conf/LINT-NOIP Fri Oct 9 01:48:14 2020 (r366559) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +include LINT +ident LINT-NOIP +makeoptions MKMODULESENV+="WITHOUT_INET_SUPPORT=" +makeoptions MKMODULESENV+="WITHOUT_INET6_SUPPORT=" +nooptions INET +nooptions INET6 +nodevice age +nodevice alc +nodevice ale +nodevice bxe +nodevice em +nodevice fxp +nodevice jme +nodevice msk +nodevice mxge +nodevice sge +nodevice sk +nodevice txp +nodevice netmap Added: head/sys/arm/conf/LINT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/LINT Fri Oct 9 01:48:14 2020 (r366559) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +include "../../conf/NOTES" +include NOTES Added: head/sys/arm64/conf/LINT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/conf/LINT Fri Oct 9 01:48:14 2020 (r366559) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +include "../../conf/NOTES" +include NOTES Added: head/sys/i386/conf/LINT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/i386/conf/LINT Fri Oct 9 01:48:14 2020 (r366559) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +include "../../conf/NOTES" +include "../../x86/conf/NOTES" +include NOTES Added: head/sys/i386/conf/LINT-NOINET ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/i386/conf/LINT-NOINET Fri Oct 9 01:48:14 2020 (r366559) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +include LINT +ident LINT-NOINET +makeoptions MKMODULESENV+="WITHOUT_INET_SUPPORT=" +nooptions INET +nodevice gre +nodevice netmap Added: head/sys/i386/conf/LINT-NOINET6 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/i386/conf/LINT-NOINET6 Fri Oct 9 01:48:14 2020 (r366559) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +include LINT +ident LINT-NOINET6 +makeoptions MKMODULESENV+="WITHOUT_INET6_SUPPORT=" +nooptions INET6 Added: head/sys/i386/conf/LINT-NOIP ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/i386/conf/LINT-NOIP Fri Oct 9 01:48:14 2020 (r366559) @@ -0,0 +1,20 @@ +# $FreeBSD$ +include LINT +ident LINT-NOIP +makeoptions MKMODULESENV+="WITHOUT_INET_SUPPORT=" +makeoptions MKMODULESENV+="WITHOUT_INET6_SUPPORT=" +nooptions INET +nooptions INET6 +nodevice age +nodevice alc +nodevice ale +nodevice bxe +nodevice em +nodevice fxp +nodevice jme +nodevice msk +nodevice mxge +nodevice sge +nodevice sk +nodevice txp +nodevice netmap Added: head/sys/powerpc/conf/LINT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/conf/LINT Fri Oct 9 01:48:14 2020 (r366559) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +include "../../conf/NOTES" +include NOTES +machine powerpc powerpc +nodevice mlx5 +nodevice mlx5en +nodevice mlx5ib +nooptions RATELIMIT Added: head/sys/powerpc/conf/LINT64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/conf/LINT64 Fri Oct 9 01:48:14 2020 (r366559) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +include "../../conf/NOTES" +include NOTES +machine powerpc powerpc64 From owner-svn-src-head@freebsd.org Fri Oct 9 01:48: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 09EBA4364AC; Fri, 9 Oct 2020 01:48:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6rZG1pRJz3VFK; Fri, 9 Oct 2020 01:48:22 +0000 (UTC) (envelope-from imp@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 8A48A11EC7; Fri, 9 Oct 2020 01:48:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0991mLuZ036142; Fri, 9 Oct 2020 01:48:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0991mL57036141; Fri, 9 Oct 2020 01:48:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010090148.0991mL57036141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 9 Oct 2020 01:48:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366560 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 366560 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, 09 Oct 2020 01:48:23 -0000 Author: imp Date: Fri Oct 9 01:48:21 2020 New Revision: 366560 URL: https://svnweb.freebsd.org/changeset/base/366560 Log: Remove now-unused files makeLINT.mk isn't needed or used anymore, remove it and all the files it uses. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D26540 Deleted: head/sys/conf/makeLINT.mk head/sys/conf/makeLINT.sed From owner-svn-src-head@freebsd.org Fri Oct 9 02: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 E16E5436D39; Fri, 9 Oct 2020 02:18:00 +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 4C6sDS2QK6z3WG9; Fri, 9 Oct 2020 02:17:59 +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 0992HqFn009695; Thu, 8 Oct 2020 19:17:52 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 0992HpT9009694; Thu, 8 Oct 2020 19:17:52 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202010090217.0992HpT9009694@gndrsh.dnsmgr.net> Subject: Re: svn commit: r366537 - head/libexec/rc/rc.d In-Reply-To: <202010081145.098BjBun018733@repo.freebsd.org> To: Pawel Biernacki Date: Thu, 8 Oct 2020 19:17:51 -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: 4C6sDS2QK6z3WG9 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: Fri, 09 Oct 2020 02:18:01 -0000 > Author: kaktus > Date: Thu Oct 8 11:45:10 2020 > New Revision: 366537 > URL: https://svnweb.freebsd.org/changeset/base/366537 > > Log: > [pf] /etc/rc.d/pf should REQUIRE routing > > When a system with pf_enable="YES" in /etc/rc.conf uses hostnames in > /etc/pf.conf, these hostnames cannot be resolved via external nameservers > because the default route is not yet set. This results in an empty > (all open) ruleset. Use of hostnames in pf, or any firewall for that mater tends to make my hair stand on end, unless those hostnames resolve via /etc/hosts or a link local resolver. > > Since r195026 already put netif back to REQUIRE, this change does not affect > the issue that the firewall should rather have been setup before any > network traffic can occur. This well cause any system that requires pf rules before routing can work to fail, aka almost any real router running a real routing protocol well now fail or have issues during route daemon start up as without firewall rules the default is to deny the routing protocol packets. This should be reverted, or at least made knobable in some way. > > PR: 211928 > Submitted by: Robert Schulze > Reported by: Robert Schulze > Tested by: Mateusz Kwiatkowski > No objections from: kp > MFC after: 3 days > > Modified: > head/libexec/rc/rc.d/pf > > Modified: head/libexec/rc/rc.d/pf > ============================================================================== > --- head/libexec/rc/rc.d/pf Thu Oct 8 11:30:22 2020 (r366536) > +++ head/libexec/rc/rc.d/pf Thu Oct 8 11:45:10 2020 (r366537) > @@ -4,8 +4,7 @@ > # > > # PROVIDE: pf > -# REQUIRE: FILESYSTEMS netif pflog pfsync > -# BEFORE: routing > +# REQUIRE: FILESYSTEMS netif pflog pfsync routing > # KEYWORD: nojailvnet > > . /etc/rc.subr > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Oct 9 04:03: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 64B454384F0; Fri, 9 Oct 2020 04:03:58 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6vZk1tdpz3bKk; Fri, 9 Oct 2020 04:03:58 +0000 (UTC) (envelope-from lwhsu@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 237DE1377C; Fri, 9 Oct 2020 04:03:58 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09943wB9023156; Fri, 9 Oct 2020 04:03:58 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09943wIX023155; Fri, 9 Oct 2020 04:03:58 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202010090403.09943wIX023155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Fri, 9 Oct 2020 04:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366561 - head X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 366561 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, 09 Oct 2020 04:03:58 -0000 Author: lwhsu Date: Fri Oct 9 04:03:57 2020 New Revision: 366561 URL: https://svnweb.freebsd.org/changeset/base/366561 Log: Correct the primary to find(1) Sponsored by: The FreeBSD Foundation Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Oct 9 01:48:21 2020 (r366560) +++ head/UPDATING Fri Oct 9 04:03:57 2020 (r366561) @@ -29,7 +29,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: 20200923: LINT files are no longer generated. We now include the relevant NOTES files. Note: This may cause conflicts with updating in some cases. - find sys -name LINT\* -rm + find sys -name LINT\* -delete is suggested across this commit to remove the generated LINT files. If you have tried to update with generated files there, the svn From owner-svn-src-head@freebsd.org Fri Oct 9 05:27: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 EF7B24391D1; Fri, 9 Oct 2020 05:27:08 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C6xQh67sqz3dtb; Fri, 9 Oct 2020 05:27:08 +0000 (UTC) (envelope-from jkim@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 B599614561; Fri, 9 Oct 2020 05:27:08 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0995R8Kq075040; Fri, 9 Oct 2020 05:27:08 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0995R27I075009; Fri, 9 Oct 2020 05:27:02 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <202010090527.0995R27I075009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 9 Oct 2020 05:27:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366562 - in head/sys/contrib/dev/acpica: . common compiler components/debugger components/disassembler components/events components/executer components/namespace components/parser comp... X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head/sys/contrib/dev/acpica: . common compiler components/debugger components/disassembler components/events components/executer components/namespace components/parser components/utilities include X-SVN-Commit-Revision: 366562 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, 09 Oct 2020 05:27:09 -0000 Author: jkim Date: Fri Oct 9 05:27:02 2020 New Revision: 366562 URL: https://svnweb.freebsd.org/changeset/base/366562 Log: MFV: r366539 Merge ACPICA 20200925. Modified: head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/ahpredef.c head/sys/contrib/dev/acpica/common/ahuuids.c head/sys/contrib/dev/acpica/common/dmtbinfo1.c head/sys/contrib/dev/acpica/compiler/aslcompiler.l head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/aslmessages.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/aslparseop.c head/sys/contrib/dev/acpica/compiler/aslprepkg.c head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/compiler/aslxref.c head/sys/contrib/dev/acpica/components/debugger/dbexec.c head/sys/contrib/dev/acpica/components/debugger/dbinput.c head/sys/contrib/dev/acpica/components/debugger/dbmethod.c head/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c head/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c head/sys/contrib/dev/acpica/components/events/evrgnini.c head/sys/contrib/dev/acpica/components/executer/exregion.c head/sys/contrib/dev/acpica/components/namespace/nsalloc.c head/sys/contrib/dev/acpica/components/namespace/nsarguments.c head/sys/contrib/dev/acpica/components/namespace/nsxfobj.c head/sys/contrib/dev/acpica/components/parser/psparse.c head/sys/contrib/dev/acpica/components/utilities/utpredef.c head/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c head/sys/contrib/dev/acpica/include/acconfig.h head/sys/contrib/dev/acpica/include/acdebug.h head/sys/contrib/dev/acpica/include/acexcep.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/acpredef.h head/sys/contrib/dev/acpica/include/actbl1.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/include/acuuid.h Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Fri Oct 9 04:03:57 2020 (r366561) +++ head/sys/contrib/dev/acpica/changes.txt Fri Oct 9 05:27:02 2020 (r366562) @@ -1,6 +1,80 @@ ---------------------------------------- +25 September 2020. Summary of changes for version 20200925: + +This release is available at https://acpica.org/downloads + + +1) ACPICA kernel-resident subsystem: + +Preserve memory opregion mappings. The ACPICA's strategy with respect to +the handling of memory mappings associated with memory operation regions +is to avoid mapping the entire region at once which may be problematic at +least in principle (for example, it may lead to conflicts with +overlapping mappings having different attributes created by drivers). It +may also be wasteful, because memory opregions on some systems take up +vastchunks of address space while the fields in those regions actually +accessed by AML are sparsely distributed. + +For this reason, a one-page "window" is mapped for a given opregion on +the first memory access through it and if that "window" does not cover an +address range accessed through that opregion subsequently, it is unmapped +and a new "window" is mapped to replace it. Next, if the new "window" is +not sufficient to access memory through the opregion in question in the +future, it will be replaced with yet another "window" and so on. That +may lead to a suboptimal sequence of memory mapping and unmapping +operations, for example if two fields in one opregion separated from each +other by a sufficiently wide chunk of unused address space are accessed +in an alternating pattern. + +Added support for 64 bit risc-v compilation. Useful for acpica tools and +incorporating ACPICA into the Firmware Test Suite. Colin Ian King +. + +Added support for SMBus predefined names (from SMBus Control Method +Interface Specification, Version 1.0, December 10, 1999. New predefined +names: + _SBA + _SBI + _SBR + _SBT + _SBW + +AML Disassembler: Added a new command, "All Object = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, TargetNode); + Node->Type = TargetNode->Type; + if (Node->Type == ACPI_TYPE_METHOD) + { + /* Save the parameter count for methods */ + + Node->Value = TargetNode->Value; + } } return (AE_OK); Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.c Fri Oct 9 04:03:57 2020 (r366561) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.c Fri Oct 9 05:27:02 2020 (r366562) @@ -381,6 +381,9 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_DUPLICATE_EXTERN_MISMATCH */ "Type mismatch between multiple external declarations detected", /* ASL_MSG_DUPLICATE_EXTERN_FOUND_HERE */"Duplicate external declaration:", /* ASL_MSG_CONDREF_NEEDS_EXTERNAL_DECL */"CondRefOf parameter requires External() declaration", +/* ASL_MSG_EXTERNAL_FOUND_HERE */ "External declaration below ", +/* ASL_MSG_LOWER_CASE_NAMESEG */ "At least one lower case letter found in NameSeg, ASL is case insensitive - converting to upper case", +/* ASL_MSG_LOWER_CASE_NAMEPATH */ "At least one lower case letter found in NamePath, ASL is case insensitive - converting to upper case", }; /* Table compiler */ Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.h Fri Oct 9 04:03:57 2020 (r366561) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.h Fri Oct 9 05:27:02 2020 (r366562) @@ -383,6 +383,9 @@ typedef enum ASL_MSG_DUPLICATE_EXTERN_MISMATCH, ASL_MSG_DUPLICATE_EXTERN_FOUND_HERE, ASL_MSG_CONDREF_NEEDS_EXTERNAL_DECL, + ASL_MSG_EXTERNAL_FOUND_HERE, + ASL_MSG_LOWER_CASE_NAMESEG, + ASL_MSG_LOWER_CASE_NAMEPATH, /* These messages are used by the Data Table compiler only */ Modified: head/sys/contrib/dev/acpica/compiler/aslparseop.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslparseop.c Fri Oct 9 04:03:57 2020 (r366561) +++ head/sys/contrib/dev/acpica/compiler/aslparseop.c Fri Oct 9 05:27:02 2020 (r366562) @@ -388,6 +388,8 @@ TrCreateValuedLeafOp ( UINT64 Value) { ACPI_PARSE_OBJECT *Op; + UINT32 i; + char *StringPtr = NULL; Op = TrAllocateOp (ParseOpcode); @@ -408,11 +410,35 @@ TrCreateValuedLeafOp ( case PARSEOP_NAMESEG: + /* Check for mixed case (or all lower case). Issue a remark in this case */ + + for (i = 0; i < ACPI_NAMESEG_SIZE; i++) + { + if (islower (Op->Asl.Value.Name[i])) + { + AcpiUtStrupr (&Op->Asl.Value.Name[i]); + AslError (ASL_REMARK, ASL_MSG_LOWER_CASE_NAMESEG, Op, Op->Asl.Value.Name); + break; + } + } DbgPrint (ASL_PARSE_OUTPUT, "NAMESEG->%s", Op->Asl.Value.String); break; case PARSEOP_NAMESTRING: + /* Check for mixed case (or all lower case). Issue a remark in this case */ + + StringPtr = Op->Asl.Value.Name; + for (i = 0; *StringPtr; i++) + { + if (islower (*StringPtr)) + { + AcpiUtStrupr (&Op->Asl.Value.Name[i]); + AslError (ASL_REMARK, ASL_MSG_LOWER_CASE_NAMEPATH, Op, Op->Asl.Value.Name); + break; + } + StringPtr++; + } DbgPrint (ASL_PARSE_OUTPUT, "NAMESTRING->%s", Op->Asl.Value.String); break; Modified: head/sys/contrib/dev/acpica/compiler/aslprepkg.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslprepkg.c Fri Oct 9 04:03:57 2020 (r366561) +++ head/sys/contrib/dev/acpica/compiler/aslprepkg.c Fri Oct 9 05:27:02 2020 (r366562) @@ -318,6 +318,17 @@ ApCheckPackage ( */ for (i = 0; i < Count; i++) { + if (!Op) + { + /* + * If we get to this point, it means that the package length + * is larger than the initializer list. Stop processing the + * package and return because we have run out of package + * elements to analyze. + */ + return; + } + ApCheckObjectType (Predefined->Info.Name, Op, Package->RetInfo.ObjectType1, i); Op = Op->Asl.Next; @@ -917,7 +928,7 @@ ApPackageTooSmall ( UINT32 ExpectedCount) { - sprintf (AslGbl_MsgBuffer, "%s: length %u, required minimum is %u", + sprintf (AslGbl_MsgBuffer, "%4.4s: length %u, required minimum is %u", PredefinedName, Count, ExpectedCount); AslError (ASL_ERROR, ASL_MSG_RESERVED_PACKAGE_LENGTH, Op, AslGbl_MsgBuffer); @@ -946,7 +957,7 @@ ApZeroLengthPackage ( ACPI_PARSE_OBJECT *Op) { - sprintf (AslGbl_MsgBuffer, "%s: length is zero", PredefinedName); + sprintf (AslGbl_MsgBuffer, "%4.4s: length is zero", PredefinedName); AslError (ASL_ERROR, ASL_MSG_RESERVED_PACKAGE_LENGTH, Op, AslGbl_MsgBuffer); } @@ -975,7 +986,7 @@ ApPackageTooLarge ( UINT32 ExpectedCount) { - sprintf (AslGbl_MsgBuffer, "%s: length is %u, only %u required", + sprintf (AslGbl_MsgBuffer, "%4.4s: length is %u, only %u required", PredefinedName, Count, ExpectedCount); AslError (ASL_REMARK, ASL_MSG_RESERVED_PACKAGE_LENGTH, Op, AslGbl_MsgBuffer); Modified: head/sys/contrib/dev/acpica/compiler/aslutils.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslutils.c Fri Oct 9 04:03:57 2020 (r366561) +++ head/sys/contrib/dev/acpica/compiler/aslutils.c Fri Oct 9 05:27:02 2020 (r366562) @@ -1074,14 +1074,16 @@ UtDoConstant ( { ACPI_STATUS Status; UINT64 ConvertedInteger; - char ErrBuf[64]; + char ErrBuf[128]; + const ACPI_EXCEPTION_INFO *ExceptionInfo; Status = AcpiUtStrtoul64 (String, &ConvertedInteger); if (ACPI_FAILURE (Status)) { - sprintf (ErrBuf, "While creating 64-bit constant: %s\n", - AcpiFormatException (Status)); + ExceptionInfo = AcpiUtValidateException ((ACPI_STATUS) Status); + sprintf (ErrBuf, " %s while converting to 64-bit integer", + ExceptionInfo->Description); AslCommonError (ASL_ERROR, ASL_MSG_SYNTAX, AslGbl_CurrentLineNumber, AslGbl_LogicalLineNumber, AslGbl_CurrentLineOffset, Modified: head/sys/contrib/dev/acpica/compiler/aslxref.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslxref.c Fri Oct 9 04:03:57 2020 (r366561) +++ head/sys/contrib/dev/acpica/compiler/aslxref.c Fri Oct 9 05:27:02 2020 (r366562) @@ -433,6 +433,7 @@ XfNamespaceLocateBegin ( UINT32 i; ACPI_NAMESPACE_NODE *DeclarationParentMethod; ACPI_PARSE_OBJECT *ReferenceParentMethod; + char *ExternalPath; ACPI_FUNCTION_TRACE_PTR (XfNamespaceLocateBegin, Op); @@ -1263,7 +1264,15 @@ XfNamespaceLocateBegin ( Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_CONDREFOF && !XfRefIsGuardedByIfCondRefOf (Node, Op)) { - AslError (ASL_ERROR, ASL_MSG_UNDEFINED_EXTERNAL, Op, NULL); + ExternalPath = AcpiNsGetNormalizedPathname (Node, TRUE); + sprintf (AslGbl_MsgBuffer, "full path of external object: %s", + ExternalPath); + AslDualParseOpError (ASL_ERROR, ASL_MSG_UNDEFINED_EXTERNAL, Op, NULL, + ASL_MSG_EXTERNAL_FOUND_HERE, Node->Op, AslGbl_MsgBuffer); + if (ExternalPath) + { + ACPI_FREE (ExternalPath); + } } /* 5) Check for a connection object */ Modified: head/sys/contrib/dev/acpica/components/debugger/dbexec.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbexec.c Fri Oct 9 04:03:57 2020 (r366561) +++ head/sys/contrib/dev/acpica/components/debugger/dbexec.c Fri Oct 9 05:27:02 2020 (r366562) @@ -252,7 +252,8 @@ AcpiDbDeleteObjects ( * * RETURN: Status * - * DESCRIPTION: Execute a control method. + * DESCRIPTION: Execute a control method. Used to evaluate objects via the + * "EXECUTE" or "EVALUATE" commands. * ******************************************************************************/ @@ -504,11 +505,12 @@ AcpiDbExecutionWalk ( Status = AcpiEvaluateObject (Node, NULL, NULL, &ReturnObj); + AcpiGbl_MethodExecuting = FALSE; + AcpiOsPrintf ("Evaluation of [%4.4s] returned %s\n", AcpiUtGetNodeName (Node), AcpiFormatException (Status)); - AcpiGbl_MethodExecuting = FALSE; return (AE_OK); } @@ -525,7 +527,8 @@ AcpiDbExecutionWalk ( * RETURN: None * * DESCRIPTION: Execute a control method. Name is relative to the current - * scope. + * scope. Function used for the "EXECUTE", "EVALUATE", and + * "ALL" commands * ******************************************************************************/ @@ -569,6 +572,12 @@ AcpiDbExecute ( return; } + if ((Flags & EX_ALL) && (strlen (Name) > 4)) + { + AcpiOsPrintf ("Input name (%s) must be a 4-char NameSeg\n", Name); + return; + } + NameString = ACPI_ALLOCATE (strlen (Name) + 1); if (!NameString) { @@ -588,14 +597,28 @@ AcpiDbExecute ( return; } - AcpiGbl_DbMethodInfo.Name = NameString; - AcpiGbl_DbMethodInfo.Args = Args; - AcpiGbl_DbMethodInfo.Types = Types; - AcpiGbl_DbMethodInfo.Flags = Flags; + /* Command (ALL ) to execute all methods of a particular name */ - ReturnObj.Pointer = NULL; - ReturnObj.Length = ACPI_ALLOCATE_BUFFER; + else if (Flags & EX_ALL) + { + AcpiGbl_DbMethodInfo.Name = NameString; + ReturnObj.Pointer = NULL; + ReturnObj.Length = ACPI_ALLOCATE_BUFFER; + AcpiDbEvaluateAll (NameString); + ACPI_FREE (NameString); + return; + } + else + { + AcpiGbl_DbMethodInfo.Name = NameString; + AcpiGbl_DbMethodInfo.Args = Args; + AcpiGbl_DbMethodInfo.Types = Types; + AcpiGbl_DbMethodInfo.Flags = Flags; + ReturnObj.Pointer = NULL; + ReturnObj.Length = ACPI_ALLOCATE_BUFFER; + } + Status = AcpiDbExecuteSetup (&AcpiGbl_DbMethodInfo); if (ACPI_FAILURE (Status)) { @@ -655,6 +678,7 @@ AcpiDbExecute ( (UINT32) ReturnObj.Length); AcpiDbDumpExternalObject (ReturnObj.Pointer, 1); + AcpiOsPrintf ("\n"); /* Dump a _PLD buffer if present */ Modified: head/sys/contrib/dev/acpica/components/debugger/dbinput.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbinput.c Fri Oct 9 04:03:57 2020 (r366561) +++ head/sys/contrib/dev/acpica/components/debugger/dbinput.c Fri Oct 9 05:27:02 2020 (r366562) @@ -195,6 +195,7 @@ enum AcpiExDebuggerCommands { CMD_NOT_FOUND = 0, CMD_NULL, + CMD_ALL, CMD_ALLOCATIONS, CMD_ARGS, CMD_ARGUMENTS, @@ -275,6 +276,7 @@ static const ACPI_DB_COMMAND_INFO AcpiGbl_DbCommands { {"", 0}, {"", 0}, + {"ALL", 1}, {"ALLOCATIONS", 0}, {"ARGS", 0}, {"ARGUMENTS", 0}, @@ -377,6 +379,7 @@ static const ACPI_DB_COMMAND_HELP AcpiGbl_DbCommandH {1, " Type ", "Display object type\n"}, {0, "\nControl Method Execution:", "\n"}, + {1, " All ", "Evaluate all objects named NameSeg\n"}, {1, " Evaluate [Arguments]", "Evaluate object or control method\n"}, {1, " Execute [Arguments]", "Synonym for Evaluate\n"}, #ifdef ACPI_APPLICATION @@ -599,7 +602,7 @@ AcpiDbDisplayHelp ( } else { - /* Display help for all commands that match the subtring */ + /* Display help for all commands that match the substring */ AcpiDbDisplayCommandInfo (Command, TRUE); } @@ -945,6 +948,13 @@ AcpiDbCommandDispatch ( { return (AE_OK); } + break; + + case CMD_ALL: + + AcpiOsPrintf ("Executing all objects with NameSeg: %s\n", AcpiGbl_DbArgs[1]); + AcpiDbExecute (AcpiGbl_DbArgs[1], + &AcpiGbl_DbArgs[2], &AcpiGbl_DbArgTypes[2], EX_NO_SINGLE_STEP | EX_ALL); break; case CMD_ALLOCATIONS: Modified: head/sys/contrib/dev/acpica/components/debugger/dbmethod.c ============================================================================== --- head/sys/contrib/dev/acpica/components/debugger/dbmethod.c Fri Oct 9 04:03:57 2020 (r366561) +++ head/sys/contrib/dev/acpica/components/debugger/dbmethod.c Fri Oct 9 05:27:02 2020 (r366562) @@ -170,7 +170,11 @@ AcpiDbWalkForExecute ( void *Context, void **ReturnValue); +static ACPI_STATUS +AcpiDbEvaluateObject ( + ACPI_NAMESPACE_NODE *Node); + /******************************************************************************* * * FUNCTION: AcpiDbSetMethodBreakpoint @@ -542,47 +546,30 @@ AcpiDbDisassembleMethod ( /******************************************************************************* * - * FUNCTION: AcpiDbWalkForExecute + * FUNCTION: AcpiDbEvaluateObject * - * PARAMETERS: Callback from WalkNamespace + * PARAMETERS: Node - Namespace node for the object * * RETURN: Status * - * DESCRIPTION: Batch execution module. Currently only executes predefined - * ACPI names. + * DESCRIPTION: Main execution function for the Evaluate/Execute/All debugger + * commands. * ******************************************************************************/ static ACPI_STATUS -AcpiDbWalkForExecute ( - ACPI_HANDLE ObjHandle, - UINT32 NestingLevel, - void *Context, - void **ReturnValue) +AcpiDbEvaluateObject ( + ACPI_NAMESPACE_NODE *Node) { - ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle; - ACPI_DB_EXECUTE_WALK *Info = (ACPI_DB_EXECUTE_WALK *) Context; - ACPI_BUFFER ReturnObj; - ACPI_STATUS Status; char *Pathname; UINT32 i; ACPI_DEVICE_INFO *ObjInfo; ACPI_OBJECT_LIST ParamObjects; ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS]; - const ACPI_PREDEFINED_INFO *Predefined; + ACPI_BUFFER ReturnObj; + ACPI_STATUS Status; - Predefined = AcpiUtMatchPredefinedMethod (Node->Name.Ascii); - if (!Predefined) - { - return (AE_OK); - } - - if (Node->Type == ACPI_TYPE_LOCAL_SCOPE) - { - return (AE_OK); - } - Pathname = AcpiNsGetExternalPathname (Node); if (!Pathname) { @@ -591,7 +578,7 @@ AcpiDbWalkForExecute ( /* Get the object info for number of method parameters */ - Status = AcpiGetObjectInfo (ObjHandle, &ObjInfo); + Status = AcpiGetObjectInfo (Node, &ObjInfo); if (ACPI_FAILURE (Status)) { ACPI_FREE (Pathname); @@ -624,13 +611,70 @@ AcpiDbWalkForExecute ( AcpiGbl_MethodExecuting = TRUE; Status = AcpiEvaluateObject (Node, NULL, &ParamObjects, &ReturnObj); + AcpiGbl_MethodExecuting = FALSE; AcpiOsPrintf ("%-32s returned %s\n", Pathname, AcpiFormatException (Status)); - AcpiGbl_MethodExecuting = FALSE; + if (ReturnObj.Length) + { + AcpiOsPrintf ("Evaluation of %s returned object %p, " + "external buffer length %X\n", + Pathname, ReturnObj.Pointer, (UINT32) ReturnObj.Length); + + AcpiDbDumpExternalObject (ReturnObj.Pointer, 1); + AcpiOsPrintf ("\n"); + } + ACPI_FREE (Pathname); /* Ignore status from method execution */ + return (AE_OK); + + /* Update count, check if we have executed enough methods */ + +} + +/******************************************************************************* + * + * FUNCTION: AcpiDbWalkForExecute + * + * PARAMETERS: Callback from WalkNamespace + * + * RETURN: Status + * + * DESCRIPTION: Batch execution function. Evaluates all "predefined" objects -- + * the nameseg begins with an underscore. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDbWalkForExecute ( + ACPI_HANDLE ObjHandle, + UINT32 NestingLevel, + void *Context, + void **ReturnValue) +{ + ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle; + ACPI_DB_EXECUTE_WALK *Info = (ACPI_DB_EXECUTE_WALK *) Context; + ACPI_STATUS Status; + const ACPI_PREDEFINED_INFO *Predefined; + + + Predefined = AcpiUtMatchPredefinedMethod (Node->Name.Ascii); + if (!Predefined) + { + return (AE_OK); + } + + if (Node->Type == ACPI_TYPE_LOCAL_SCOPE) + { + return (AE_OK); + } + + AcpiDbEvaluateObject (Node); + + /* Ignore status from object evaluation */ + Status = AE_OK; /* Update count, check if we have executed enough methods */ @@ -647,6 +691,56 @@ AcpiDbWalkForExecute ( /******************************************************************************* * + * FUNCTION: AcpiDbWalkForExecuteAll + * + * PARAMETERS: Callback from WalkNamespace + * + * RETURN: Status + * + * DESCRIPTION: Batch execution function. Evaluates all objects whose path ends + * with the nameseg "Info->NameSeg". Used for the "ALL" command. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDbWalkForExecuteAll ( + ACPI_HANDLE ObjHandle, + UINT32 NestingLevel, + void *Context, + void **ReturnValue) +{ + ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle; + ACPI_DB_EXECUTE_WALK *Info = (ACPI_DB_EXECUTE_WALK *) Context; + ACPI_STATUS Status; + + + if (!ACPI_COMPARE_NAMESEG (Node->Name.Ascii, Info->NameSeg)) + { + return (AE_OK); + } + + if (Node->Type == ACPI_TYPE_LOCAL_SCOPE) + { + return (AE_OK); + } + + /* Now evaluate the input object (node) */ + + AcpiDbEvaluateObject (Node); + + /* Ignore status from method execution */ + + Status = AE_OK; + + /* Update count of executed methods/objects */ + + Info->Count++; + return (Status); +} + + +/******************************************************************************* + * * FUNCTION: AcpiDbEvaluatePredefinedNames * * PARAMETERS: None @@ -674,4 +768,39 @@ AcpiDbEvaluatePredefinedNames ( AcpiDbWalkForExecute, NULL, (void *) &Info, NULL); AcpiOsPrintf ("Evaluated %u predefined names in the namespace\n", Info.Count); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDbEvaluateAll + * + * PARAMETERS: NoneAcpiGbl_DbMethodInfo + * + * RETURN: None + * + * DESCRIPTION: Namespace batch execution. Implements the "ALL" command. + * Execute all namepaths whose final nameseg matches the + * input nameseg. + * + ******************************************************************************/ + +void +AcpiDbEvaluateAll ( + char *NameSeg) +{ + ACPI_DB_EXECUTE_WALK Info; + + + Info.Count = 0; + Info.MaxCount = ACPI_UINT32_MAX; + ACPI_COPY_NAMESEG (Info.NameSeg, NameSeg); + Info.NameSeg[ACPI_NAMESEG_SIZE] = 0; + + /* Search all nodes in namespace */ + + (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, + AcpiDbWalkForExecuteAll, NULL, (void *) &Info, NULL); + + AcpiOsPrintf ("Evaluated %u names in the namespace\n", Info.Count); } Modified: head/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c ============================================================================== --- head/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c Fri Oct 9 04:03:57 2020 (r366561) +++ head/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c Fri Oct 9 05:27:02 2020 (r366562) @@ -494,6 +494,10 @@ AcpiDmUuid ( { AcpiOsPrintf (" /* %s */", Description); } + else + { + AcpiOsPrintf (" /* Unknown UUID */"); + } } Modified: head/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c ============================================================================== --- head/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c Fri Oct 9 04:03:57 2020 (r366561) +++ head/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c Fri Oct 9 05:27:02 2020 (r366562) @@ -744,7 +744,7 @@ AcpiDmIsOptimizationIgnored ( * Only a small subset of ASL/AML operators can be optimized. * Can only optimize/fold if there is no target (or targets) * specified for the operator. And of course, the operator - * is surrrounded by a Store() operator. + * is surrounded by a Store() operator. */ switch (StoreArgument->Common.AmlOpcode) { Modified: head/sys/contrib/dev/acpica/components/events/evrgnini.c ============================================================================== --- head/sys/contrib/dev/acpica/components/events/evrgnini.c Fri Oct 9 04:03:57 2020 (r366561) +++ head/sys/contrib/dev/acpica/components/events/evrgnini.c Fri Oct 9 05:27:02 2020 (r366562) @@ -183,6 +183,7 @@ AcpiEvSystemMemoryRegionSetup ( { ACPI_OPERAND_OBJECT *RegionDesc = (ACPI_OPERAND_OBJECT *) Handle; ACPI_MEM_SPACE_CONTEXT *LocalRegionContext; + ACPI_MEM_MAPPING *Mm; ACPI_FUNCTION_TRACE (EvSystemMemoryRegionSetup); @@ -194,12 +195,14 @@ AcpiEvSystemMemoryRegionSetup ( { LocalRegionContext = (ACPI_MEM_SPACE_CONTEXT *) *RegionContext; - /* Delete a cached mapping if present */ + /* Delete memory mappings if present */ - if (LocalRegionContext->MappedLength) + while (LocalRegionContext->FirstMm) { - AcpiOsUnmapMemory (LocalRegionContext->MappedLogicalAddress, - LocalRegionContext->MappedLength); + Mm = LocalRegionContext->FirstMm; + LocalRegionContext->FirstMm = Mm->NextMm; + AcpiOsUnmapMemory(Mm->LogicalAddress, Mm->Length); + ACPI_FREE(Mm); } ACPI_FREE (LocalRegionContext); *RegionContext = NULL; Modified: head/sys/contrib/dev/acpica/components/executer/exregion.c ============================================================================== --- head/sys/contrib/dev/acpica/components/executer/exregion.c Fri Oct 9 04:03:57 2020 (r366561) +++ head/sys/contrib/dev/acpica/components/executer/exregion.c Fri Oct 9 05:27:02 2020 (r366562) @@ -188,6 +188,7 @@ AcpiExSystemMemorySpaceHandler ( ACPI_STATUS Status = AE_OK; void *LogicalAddrPtr = NULL; ACPI_MEM_SPACE_CONTEXT *MemInfo = RegionContext; + ACPI_MEM_MAPPING *Mm = MemInfo->CurMm; UINT32 Length; ACPI_SIZE MapLength; ACPI_SIZE PageBoundaryMapLength; @@ -247,23 +248,48 @@ AcpiExSystemMemorySpaceHandler ( * Is 1) Address below the current mapping? OR * 2) Address beyond the current mapping? */ - if ((Address < MemInfo->MappedPhysicalAddress) || - (((UINT64) Address + Length) > - ((UINT64) - MemInfo->MappedPhysicalAddress + MemInfo->MappedLength))) + if (!Mm || (Address < Mm->PhysicalAddress) || + ((UINT64) Address + Length > (UINT64) Mm->PhysicalAddress + Mm->Length)) { /* - * The request cannot be resolved by the current memory mapping; - * Delete the existing mapping and create a new one. + * The request cannot be resolved by the current memory mapping. + * + * Look for an existing saved mapping covering the address range + * at hand. If found, save it as the current one and carry out + * the access. */ - if (MemInfo->MappedLength) + for (Mm = MemInfo->FirstMm; Mm; Mm = Mm->NextMm) { - /* Valid mapping, delete it */ + if (Mm == MemInfo->CurMm) + { + continue; + } - AcpiOsUnmapMemory (MemInfo->MappedLogicalAddress, - MemInfo->MappedLength); + if (Address < Mm->PhysicalAddress) + { + continue; + } + + if ((UINT64) Address + Length > (UINT64) Mm->PhysicalAddress + Mm->Length) + { + continue; + } + + MemInfo->CurMm = Mm; + goto access; } + /* Create a new mappings list entry */ + + Mm = ACPI_ALLOCATE_ZEROED(sizeof(*Mm)); + if (!Mm) + { + ACPI_ERROR((AE_INFO, + "Unable to save memory mapping at 0x%8.8X%8.8X, size %u", + ACPI_FORMAT_UINT64(Address), Length)); + return_ACPI_STATUS(AE_NO_MEMORY); + } + /* * October 2009: Attempt to map from the requested address to the * end of the region. However, we will never map more than one @@ -297,28 +323,38 @@ AcpiExSystemMemorySpaceHandler ( /* Create a new mapping starting at the address given */ - MemInfo->MappedLogicalAddress = AcpiOsMapMemory (Address, MapLength); - if (!MemInfo->MappedLogicalAddress) + LogicalAddrPtr = AcpiOsMapMemory(Address, MapLength); + if (!LogicalAddrPtr) { ACPI_ERROR ((AE_INFO, "Could not map memory at 0x%8.8X%8.8X, size %u", ACPI_FORMAT_UINT64 (Address), (UINT32) MapLength)); - MemInfo->MappedLength = 0; + ACPI_FREE(Mm); return_ACPI_STATUS (AE_NO_MEMORY); } /* Save the physical address and mapping size */ - MemInfo->MappedPhysicalAddress = Address; - MemInfo->MappedLength = MapLength; + Mm->LogicalAddress = LogicalAddrPtr; + Mm->PhysicalAddress = Address; + Mm->Length = MapLength; + + /* + * Add the new entry to the mappigs list and save it as the + * current mapping. + */ + Mm->NextMm = MemInfo->FirstMm; + MemInfo->FirstMm = Mm; + MemInfo->CurMm = Mm; } +access: /* * Generate a logical pointer corresponding to the address we want to * access */ - LogicalAddrPtr = MemInfo->MappedLogicalAddress + - ((UINT64) Address - (UINT64) MemInfo->MappedPhysicalAddress); + LogicalAddrPtr = Mm->LogicalAddress + + ((UINT64) Address - (UINT64) Mm->PhysicalAddress); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "System-Memory (width %u) R/W %u Address=%8.8X%8.8X\n", Modified: head/sys/contrib/dev/acpica/components/namespace/nsalloc.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nsalloc.c Fri Oct 9 04:03:57 2020 (r366561) +++ head/sys/contrib/dev/acpica/components/namespace/nsalloc.c Fri Oct 9 05:27:02 2020 (r366562) @@ -481,7 +481,7 @@ AcpiNsDeleteChildren ( NodeToDelete = NextNode; NextNode = NextNode->Peer; AcpiNsDeleteNode (NodeToDelete); - }; + } /* Clear the parent's child pointer */ Modified: head/sys/contrib/dev/acpica/components/namespace/nsarguments.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nsarguments.c Fri Oct 9 04:03:57 2020 (r366561) +++ head/sys/contrib/dev/acpica/components/namespace/nsarguments.c Fri Oct 9 05:27:02 2020 (r366562) @@ -205,7 +205,9 @@ AcpiNsCheckArgumentTypes ( ArgType = METHOD_GET_NEXT_TYPE (ArgTypeList); UserArgType = Info->Parameters[i]->Common.Type; - if (UserArgType != ArgType) + /* No typechecking for ACPI_TYPE_ANY */ + + if ((UserArgType != ArgType) && (ArgType != ACPI_TYPE_ANY)) { ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, ACPI_WARN_ALWAYS, "Argument #%u type mismatch - " Modified: head/sys/contrib/dev/acpica/components/namespace/nsxfobj.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nsxfobj.c Fri Oct 9 04:03:57 2020 (r366561) +++ head/sys/contrib/dev/acpica/components/namespace/nsxfobj.c Fri Oct 9 05:27:02 2020 (r366562) @@ -169,7 +169,8 @@ * * RETURN: Status * - * DESCRIPTION: This routine returns the type associatd with a particular handle + * DESCRIPTION: This routine returns the type associated with a particular + * handle * ******************************************************************************/ Modified: head/sys/contrib/dev/acpica/components/parser/psparse.c ============================================================================== --- head/sys/contrib/dev/acpica/components/parser/psparse.c Fri Oct 9 04:03:57 2020 (r366561) +++ head/sys/contrib/dev/acpica/components/parser/psparse.c Fri Oct 9 05:27:02 2020 (r366562) @@ -662,8 +662,8 @@ AcpiPsParseAml ( } /* - * If the transfer to the new method method call worked - *, a new walk state was created -- get it + * If the transfer to the new method method call worked, + * a new walk state was created -- get it */ WalkState = AcpiDsGetCurrentWalkState (Thread); continue; Modified: head/sys/contrib/dev/acpica/components/utilities/utpredef.c ============================================================================== --- head/sys/contrib/dev/acpica/components/utilities/utpredef.c Fri Oct 9 04:03:57 2020 (r366561) +++ head/sys/contrib/dev/acpica/components/utilities/utpredef.c Fri Oct 9 05:27:02 2020 (r366562) @@ -317,7 +317,7 @@ AcpiUtGetArgumentTypes ( static const char *UtExternalTypeNames[] = /* Indexed by ACPI_TYPE_* */ { - ", UNSUPPORTED-TYPE", + ", Type_ANY", ", Integer", ", String", ", Buffer", @@ -499,7 +499,7 @@ AcpiUtGetArgumentTypes ( { ThisArgumentType = METHOD_GET_NEXT_TYPE (ArgumentTypes); - if (!ThisArgumentType || (ThisArgumentType > METHOD_MAX_ARG_TYPE)) + if (ThisArgumentType > METHOD_MAX_ARG_TYPE) { printf ("**** Invalid argument type (%u) " "in predefined info structure\n", ThisArgumentType); Modified: head/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c ============================================================================== --- head/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c Fri Oct 9 04:03:57 2020 (r366561) +++ head/sys/contrib/dev/acpica/components/utilities/utstrsuppt.c Fri Oct 9 05:27:02 2020 (r366562) @@ -207,10 +207,16 @@ AcpiUtConvertOctalString ( while (*String) { - /* Character must be ASCII 0-7, otherwise terminate with no error */ - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Oct 9 10:07: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 9B5E143DF42; Fri, 9 Oct 2020 10:07:42 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C73fQ3gqBz494Q; Fri, 9 Oct 2020 10:07:42 +0000 (UTC) (envelope-from rscheff@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 5D26317F90; Fri, 9 Oct 2020 10:07:42 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 099A7gax048974; Fri, 9 Oct 2020 10:07:42 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 099A7fJb048970; Fri, 9 Oct 2020 10:07:41 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202010091007.099A7fJb048970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Fri, 9 Oct 2020 10:07:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366566 - head/usr.bin/netstat X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: head/usr.bin/netstat X-SVN-Commit-Revision: 366566 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, 09 Oct 2020 10:07:42 -0000 Author: rscheff Date: Fri Oct 9 10:07:41 2020 New Revision: 366566 URL: https://svnweb.freebsd.org/changeset/base/366566 Log: Extend netstat to display TCP stack and detailed congestion state Adding the "-c" option used to show detailed per-connection congestion control state for TCP sessions. This is one summary patch, which adds the relevant variables into xtcpcb. As previous "spare" space is used, these changes are ABI compatible. Reviewed by: tuexen MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26518 Modified: head/usr.bin/netstat/inet.c head/usr.bin/netstat/main.c head/usr.bin/netstat/netstat.1 head/usr.bin/netstat/netstat.h Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Fri Oct 9 09:37:43 2020 (r366565) +++ head/usr.bin/netstat/inet.c Fri Oct 9 10:07:41 2020 (r366566) @@ -85,6 +85,8 @@ __FBSDID("$FreeBSD$"); #include "netstat.h" #include "nl_defs.h" +#define max(a, b) (((a) > (b)) ? (a) : (b)) + #ifdef INET static void inetprint(const char *, struct in_addr *, int, const char *, int, const int); @@ -204,6 +206,7 @@ protopr(u_long off, const char *name, int af1, int pro struct xinpcb *inp; struct xinpgen *xig, *oxig; struct xsocket *so; + int fnamelen, cnamelen; istcp = 0; switch (proto) { @@ -236,6 +239,28 @@ protopr(u_long off, const char *name, int af1, int pro if (!pcblist_sysctl(proto, name, &buf)) return; + if (cflag || Cflag) { + fnamelen = strlen("Stack"); + cnamelen = strlen("CC"); + oxig = xig = (struct xinpgen *)buf; + for (xig = (struct xinpgen*)((char *)xig + xig->xig_len); + xig->xig_len > sizeof(struct xinpgen); + xig = (struct xinpgen *)((char *)xig + xig->xig_len)) { + if (istcp) { + tp = (struct xtcpcb *)xig; + inp = &tp->xt_inp; + } else { + continue; + } + if (so->xso_protocol != proto) + continue; + if (inp->inp_gencnt > oxig->xig_gen) + continue; + fnamelen = max(fnamelen, (int)strlen(tp->xt_stack)); + cnamelen = max(cnamelen, (int)strlen(tp->xt_cc)); + } + } + oxig = xig = (struct xinpgen *)buf; for (xig = (struct xinpgen *)((char *)xig + xig->xig_len); xig->xig_len > sizeof(struct xinpgen); @@ -341,9 +366,19 @@ protopr(u_long off, const char *name, int af1, int pro xo_emit(" {T:/%8.8s} {T:/%5.5s}", "flowid", "ftype"); } + if (cflag) { + xo_emit(" {T:/%-*.*s}", + fnamelen, fnamelen, "Stack"); + } if (Cflag) - xo_emit(" {T:/%-*.*s}", TCP_CA_NAME_MAX, - TCP_CA_NAME_MAX, "CC"); + xo_emit(" {T:/%-*.*s} {T:/%10.10s}" + " {T:/%10.10s} {T:/%5.5s}" + " {T:/%3.3s}", cnamelen, + cnamelen, "CC", + "cwin", + "ssthresh", + "MSS", + "ECN"); if (Pflag) xo_emit(" {T:/%s}", "Log ID"); xo_emit("\n"); @@ -518,9 +553,24 @@ protopr(u_long off, const char *name, int af1, int pro inp->inp_flowtype); } if (istcp) { + if (cflag) + xo_emit(" {:stack/%-*.*s}", + + fnamelen, fnamelen, tp->xt_stack); if (Cflag) - xo_emit(" {:cc/%-*.*s}", TCP_CA_NAME_MAX, - TCP_CA_NAME_MAX, tp->xt_cc); + xo_emit(" {:cc/%-*.*s}" + " {:snd-cwnd/%10lu}" + " {:snd-ssthresh/%10lu}" + " {:t-maxseg/%5u} {:ecn/%3s}", + cnamelen, cnamelen, tp->xt_cc, + tp->t_snd_cwnd, tp->t_snd_ssthresh, + tp->t_maxseg, + (tp->t_state >= TCPS_ESTABLISHED ? + (tp->xt_ecn > 0 ? + (tp->xt_ecn == 1 ? + "ecn" : "ace") + : "off") + : "n/a")); if (Pflag) xo_emit(" {:log-id/%s}", tp->xt_logid[0] == '\0' ? Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Fri Oct 9 09:37:43 2020 (r366565) +++ head/usr.bin/netstat/main.c Fri Oct 9 10:07:41 2020 (r366566) @@ -205,7 +205,8 @@ int Aflag; /* show addresses of protocol control bloc int aflag; /* show all sockets (including servers) */ static int Bflag; /* show information about bpf consumers */ int bflag; /* show i/f total bytes in/out */ -int Cflag; /* show congestion control */ +int cflag; /* show TCP congestion control stack */ +int Cflag; /* show congestion control algo and vars */ int dflag; /* show i/f dropped packets */ int gflag; /* show group (multicast) routing or stats */ int hflag; /* show counters in human readable format */ @@ -251,7 +252,7 @@ main(int argc, char *argv[]) if (argc < 0) exit(EXIT_FAILURE); - while ((ch = getopt(argc, argv, "46AaBbCdF:f:ghI:iLlM:mN:nOoPp:Qq:RrSTsuWw:xz")) + while ((ch = getopt(argc, argv, "46AaBbCcdF:f:ghI:iLlM:mN:nOoPp:Qq:RrSTsuWw:xz")) != -1) switch(ch) { case '4': @@ -280,6 +281,9 @@ main(int argc, char *argv[]) case 'b': bflag = 1; break; + case 'c': + cflag = 1; + break; case 'C': Cflag = 1; break; @@ -886,7 +890,7 @@ static void usage(void) { (void)xo_error("%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", -"usage: netstat [-46AaLnRSTWx] [-f protocol_family | -p protocol]\n" +"usage: netstat [-46AaCcLnRSTWx] [-f protocol_family | -p protocol]\n" " [-M core] [-N system]", " netstat -i | -I interface [-46abdhnW] [-f address_family]\n" " [-M core] [-N system]", Modified: head/usr.bin/netstat/netstat.1 ============================================================================== --- head/usr.bin/netstat/netstat.1 Fri Oct 9 09:37:43 2020 (r366565) +++ head/usr.bin/netstat/netstat.1 Fri Oct 9 10:07:41 2020 (r366566) @@ -28,7 +28,7 @@ .\" @(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd September 13, 2020 +.Dd September 25, 2020 .Dt NETSTAT 1 .Os .Sh NAME @@ -172,8 +172,10 @@ associated with a socket; used for debugging. .It Fl a Show the state of all sockets; normally sockets used by server processes are not shown. +.It Fl c +Show the used TCP stack for each session. .It Fl C -Show the congestion control of TCP sockets. +Show the congestion control algorithm and diagnostic information of TCP sockets. .It Fl L Show the size of the various listen queues. The first count shows the number of unaccepted connections, Modified: head/usr.bin/netstat/netstat.h ============================================================================== --- head/usr.bin/netstat/netstat.h Fri Oct 9 09:37:43 2020 (r366565) +++ head/usr.bin/netstat/netstat.h Fri Oct 9 10:07:41 2020 (r366566) @@ -41,7 +41,8 @@ extern int Aflag; /* show addresses of protocol control block */ extern int aflag; /* show all sockets (including servers) */ extern int bflag; /* show i/f total bytes in/out */ -extern int Cflag; /* show congestion control */ +extern int cflag; /* show congestion control stats */ +extern int Cflag; /* show congestion control algo and stack */ extern int dflag; /* show i/f dropped packets */ extern int gflag; /* show group (multicast) routing or stats */ extern int hflag; /* show counters in human readable format */ From owner-svn-src-head@freebsd.org Fri Oct 9 10:55: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 B35A443EE47; Fri, 9 Oct 2020 10:55:20 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C74jN4Cbnz4DjF; Fri, 9 Oct 2020 10:55:20 +0000 (UTC) (envelope-from rscheff@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 740E9187AC; Fri, 9 Oct 2020 10:55:20 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 099AtKoT079817; Fri, 9 Oct 2020 10:55:20 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 099AtKVN079816; Fri, 9 Oct 2020 10:55:20 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202010091055.099AtKVN079816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Fri, 9 Oct 2020 10:55:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366567 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 366567 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, 09 Oct 2020 10:55:20 -0000 Author: rscheff Date: Fri Oct 9 10:55:19 2020 New Revision: 366567 URL: https://svnweb.freebsd.org/changeset/base/366567 Log: Extend netstat to display TCP stack and detailed congestion state (2) Extend netstat to display TCP stack and detailed congestion state Adding the "-c" option used to show detailed per-connection congestion control state for TCP sessions. This is one summary patch, which adds the relevant variables into xtcpcb. As previous "spare" space is used, these changes are ABI compatible. Reviewed by: tuexen MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26518 Modified: head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Fri Oct 9 10:07:41 2020 (r366566) +++ head/sys/netinet/tcp_subr.c Fri Oct 9 10:55:19 2020 (r366567) @@ -3437,6 +3437,13 @@ tcp_inptoxtp(const struct inpcb *inp, struct xtcpcb *x xt->t_sndzerowin = tp->t_sndzerowin; xt->t_sndrexmitpack = tp->t_sndrexmitpack; xt->t_rcvoopack = tp->t_rcvoopack; + xt->t_rcv_wnd = tp->rcv_wnd; + xt->t_snd_wnd = tp->snd_wnd; + xt->t_snd_cwnd = tp->snd_cwnd; + xt->t_snd_ssthresh = tp->snd_ssthresh; + xt->t_maxseg = tp->t_maxseg; + xt->xt_ecn = (tp->t_flags2 & TF2_ECN_PERMIT) ? 1 : 0 + + (tp->t_flags2 & TF2_ACE_PERMIT) ? 2 : 0; now = getsbinuptime(); #define COPYTIMER(ttt) do { \ Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Fri Oct 9 10:07:41 2020 (r366566) +++ head/sys/netinet/tcp_var.h Fri Oct 9 10:55:19 2020 (r366567) @@ -768,7 +768,13 @@ struct xtcpcb { int32_t tt_2msl; /* (s) */ int32_t tt_delack; /* (s) */ int32_t t_logstate; /* (3) */ - int32_t spare32[32]; + uint32_t t_snd_cwnd; /* (s) */ + uint32_t t_snd_ssthresh; /* (s) */ + uint32_t t_maxseg; /* (s) */ + uint32_t t_rcv_wnd; /* (s) */ + uint32_t t_snd_wnd; /* (s) */ + uint32_t xt_ecn; /* (s) */ + int32_t spare32[26]; } __aligned(8); #ifdef _KERNEL From owner-svn-src-head@freebsd.org Fri Oct 9 11:24: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 2876743F059; Fri, 9 Oct 2020 11:24:20 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C75Lr09vrz4Fbp; Fri, 9 Oct 2020 11:24:20 +0000 (UTC) (envelope-from ae@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 DE50618CD0; Fri, 9 Oct 2020 11:24:19 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 099BOJed098227; Fri, 9 Oct 2020 11:24:19 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 099BOJuc098226; Fri, 9 Oct 2020 11:24:19 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202010091124.099BOJuc098226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 9 Oct 2020 11:24:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366568 - head/usr.bin/cpuset X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/usr.bin/cpuset X-SVN-Commit-Revision: 366568 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, 09 Oct 2020 11:24:20 -0000 Author: ae Date: Fri Oct 9 11:24:19 2020 New Revision: 366568 URL: https://svnweb.freebsd.org/changeset/base/366568 Log: Fix EINVAL message when CPU binding information is requested for IRQ. `cpuset -g -x N` along with requested information always prints message `cpuset: getdomain: Invalid argument'. The EINVAL is returned from kern_cpuset_getdomain(), since it doesn't expect CPU_LEVEL_WHICH and CPU_WHICH_IRQ parameters. To fix the error, do not call cpuset_getdomain() when `-x' is specified. MFC after: 1 week Modified: head/usr.bin/cpuset/cpuset.c Modified: head/usr.bin/cpuset/cpuset.c ============================================================================== --- head/usr.bin/cpuset/cpuset.c Fri Oct 9 10:55:19 2020 (r366567) +++ head/usr.bin/cpuset/cpuset.c Fri Oct 9 11:24:19 2020 (r366568) @@ -253,7 +253,7 @@ printaffinity(void) printf("%s %jd%s mask: ", whichnames[which], (intmax_t)id, levelnames[level]); printset((struct bitset *)&mask, CPU_SETSIZE); - if (dflag) + if (dflag || xflag) goto out; if (cpuset_getdomain(level, which, id, sizeof(domain), &domain, &policy) != 0) From owner-svn-src-head@freebsd.org Fri Oct 9 12:06: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 6B0E93F8B5E; Fri, 9 Oct 2020 12:06:45 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C76Hn25vfz4Jc1; Fri, 9 Oct 2020 12:06:45 +0000 (UTC) (envelope-from rscheff@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 2CB1C190FD; Fri, 9 Oct 2020 12:06:45 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 099C6jDD025010; Fri, 9 Oct 2020 12:06:45 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 099C6hPe025004; Fri, 9 Oct 2020 12:06:43 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202010091206.099C6hPe025004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Fri, 9 Oct 2020 12:06:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366569 - in head/sys: net netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: in head/sys: net netinet netinet6 X-SVN-Commit-Revision: 366569 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, 09 Oct 2020 12:06:45 -0000 Author: rscheff Date: Fri Oct 9 12:06:43 2020 New Revision: 366569 URL: https://svnweb.freebsd.org/changeset/base/366569 Log: Add IP(V6)_VLAN_PCP to set 802.1 priority per-flow. This adds a new IP_PROTO / IPV6_PROTO setsockopt (getsockopt) option IP(V6)_VLAN_PCP, which can be set to -1 (interface default), or explicitly to any priority between 0 and 7. Note that for untagged traffic, explicitly adding a priority will insert a special 801.1Q vlan header with vlan ID = 0 to carry the priority setting Reviewed by: gallatin, rrs MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26409 Modified: head/sys/net/if_ethersubr.c head/sys/netinet/in.h head/sys/netinet/in_pcb.h head/sys/netinet/ip_output.c head/sys/netinet6/in6.h head/sys/netinet6/ip6_output.c Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Fri Oct 9 11:24:19 2020 (r366568) +++ head/sys/net/if_ethersubr.c Fri Oct 9 12:06:43 2020 (r366569) @@ -1388,6 +1388,13 @@ ether_8021q_frame(struct mbuf **mp, struct ifnet *ife, } /* + * If PCP is set in mbuf, use it + */ + if ((*mp)->m_flags & M_VLANTAG) { + pcp = EVL_PRIOFTAG((*mp)->m_pkthdr.ether_vtag); + } + + /* * If underlying interface can do VLAN tag insertion itself, * just pass the packet along. However, we need some way to * tell the interface where the packet came from so that it Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Fri Oct 9 11:24:19 2020 (r366568) +++ head/sys/netinet/in.h Fri Oct 9 12:06:43 2020 (r366569) @@ -483,6 +483,10 @@ __END_DECLS /* The following option is private; do not use it from user applications. */ #define IP_MSFILTER 74 /* set/get filter list */ +/* The following option deals with the 802.1Q Ethernet Priority Code Point */ +#define IP_VLAN_PCP 75 /* int; set/get PCP used for packet, */ + /* -1 use interface default */ + /* Protocol Independent Multicast API [RFC3678] */ #define MCAST_JOIN_GROUP 80 /* join an any-source group */ #define MCAST_LEAVE_GROUP 81 /* leave all sources for group */ Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Fri Oct 9 11:24:19 2020 (r366568) +++ head/sys/netinet/in_pcb.h Fri Oct 9 12:06:43 2020 (r366569) @@ -748,6 +748,13 @@ int inp_so_options(const struct inpcb *inp); #define INP_SUPPORTS_MBUFQ 0x00004000 /* Supports the mbuf queue method of LRO */ #define INP_MBUF_QUEUE_READY 0x00008000 /* The transport is pacing, inputs can be queued */ #define INP_DONT_SACK_QUEUE 0x00010000 /* If a sack arrives do not wake me */ +#define INP_2PCP_SET 0x00020000 /* If the Eth PCP should be set explicitly */ +#define INP_2PCP_BIT0 0x00040000 /* Eth PCP Bit 0 */ +#define INP_2PCP_BIT1 0x00080000 /* Eth PCP Bit 1 */ +#define INP_2PCP_BIT2 0x00100000 /* Eth PCP Bit 2 */ +#define INP_2PCP_BASE INP_2PCP_BIT0 +#define INP_2PCP_MASK (INP_2PCP_BIT0 | INP_2PCP_BIT1 | INP_2PCP_BIT2) +#define INP_2PCP_SHIFT 18 /* shift PCP field in/out of inp_flags2 */ /* * Flags passed to in_pcblookup*() functions. */ Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Fri Oct 9 11:24:19 2020 (r366568) +++ head/sys/netinet/ip_output.c Fri Oct 9 12:06:43 2020 (r366569) @@ -62,7 +62,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include #include #include @@ -324,6 +326,7 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct rou int hlen = sizeof (struct ip); int mtu = 0; int error = 0; + int vlan_pcp = -1; struct sockaddr_in *dst, sin; const struct sockaddr_in *gw; struct in_ifaddr *ia = NULL; @@ -345,6 +348,9 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct rou m->m_pkthdr.flowid = inp->inp_flowid; M_HASHTYPE_SET(m, inp->inp_flowtype); } + if ((inp->inp_flags2 & INP_2PCP_SET) != 0) + vlan_pcp = (inp->inp_flags2 & INP_2PCP_MASK) >> + INP_2PCP_SHIFT; #ifdef NUMA m->m_pkthdr.numa_domain = inp->inp_numa_domain; #endif @@ -717,6 +723,9 @@ sendit: } } + if (vlan_pcp > -1) + EVL_APPLY_PRI(m, vlan_pcp); + /* IN_LOOPBACK must not appear on the wire - RFC1122. */ if (IN_LOOPBACK(ntohl(ip->ip_dst.s_addr)) || IN_LOOPBACK(ntohl(ip->ip_src.s_addr))) { @@ -1210,6 +1219,7 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt) #ifdef RSS case IP_RECVRSSBUCKETID: #endif + case IP_VLAN_PCP: error = sooptcopyin(sopt, &optval, sizeof optval, sizeof optval); if (error) @@ -1305,6 +1315,28 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt) OPTSET2(INP_RECVRSSBUCKETID, optval); break; #endif + case IP_VLAN_PCP: + if ((optval >= -1) && (optval <= + (INP_2PCP_MASK >> INP_2PCP_SHIFT))) { + if (optval == -1) { + INP_WLOCK(inp); + inp->inp_flags2 &= + ~(INP_2PCP_SET | + INP_2PCP_MASK); + INP_WUNLOCK(inp); + } else { + INP_WLOCK(inp); + inp->inp_flags2 |= + INP_2PCP_SET; + inp->inp_flags2 &= + ~INP_2PCP_MASK; + inp->inp_flags2 |= + optval << INP_2PCP_SHIFT; + INP_WUNLOCK(inp); + } + } else + error = EINVAL; + break; } break; #undef OPTSET @@ -1425,6 +1457,7 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt) case IP_RSSBUCKETID: case IP_RECVRSSBUCKETID: #endif + case IP_VLAN_PCP: switch (sopt->sopt_name) { case IP_TOS: optval = inp->inp_ip_tos; @@ -1511,6 +1544,14 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt) #endif case IP_BINDMULTI: optval = OPTBIT2(INP_BINDMULTI); + break; + case IP_VLAN_PCP: + if (OPTBIT2(INP_2PCP_SET)) { + optval = (inp->inp_flags2 & + INP_2PCP_MASK) >> INP_2PCP_SHIFT; + } else { + optval = -1; + } break; } error = sooptcopyout(sopt, &optval, sizeof optval); Modified: head/sys/netinet6/in6.h ============================================================================== --- head/sys/netinet6/in6.h Fri Oct 9 11:24:19 2020 (r366568) +++ head/sys/netinet6/in6.h Fri Oct 9 12:06:43 2020 (r366569) @@ -511,6 +511,10 @@ struct route_in6 { * set/get multicast source filter list. */ +/* The following option deals with the 802.1Q Ethernet Priority Code Point */ +#define IPV6_VLAN_PCP 75 /* int; set/get PCP used for packet, */ + /* -1 use interface default */ + /* to define items, should talk with KAME guys first, for *BSD compatibility */ #define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor. XXX old spec */ Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Fri Oct 9 11:24:19 2020 (r366568) +++ head/sys/netinet6/ip6_output.c Fri Oct 9 12:06:43 2020 (r366569) @@ -92,7 +92,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include #include #include @@ -436,6 +438,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, u_char *nexthdrp; int tlen, len; int error = 0; + int vlan_pcp = -1; struct in6_ifaddr *ia = NULL; u_long mtu; int alwaysfrag, dontfrag; @@ -460,6 +463,9 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, m->m_pkthdr.flowid = inp->inp_flowid; M_HASHTYPE_SET(m, inp->inp_flowtype); } + if ((inp->inp_flags2 & INP_2PCP_SET) != 0) + vlan_pcp = (inp->inp_flags2 & INP_2PCP_MASK) >> + INP_2PCP_SHIFT; #ifdef NUMA m->m_pkthdr.numa_domain = inp->inp_numa_domain; #endif @@ -1098,6 +1104,8 @@ nonh6lookup: } passout: + if (vlan_pcp > -1) + EVL_APPLY_PRI(m, vlan_pcp); /* * Send the packet to the outgoing interface. * If necessary, do IPv6 fragmentation before sending. @@ -1265,6 +1273,8 @@ sendorfree: counter_u64_add(ia->ia_ifa.ifa_obytes, m->m_pkthdr.len); } + if (vlan_pcp > -1) + EVL_APPLY_PRI(m, vlan_pcp); error = ip6_output_send(inp, ifp, origifp, m, dst, ro, true); } else @@ -1752,6 +1762,7 @@ ip6_ctloutput(struct socket *so, struct sockopt *sopt) #ifdef RSS case IPV6_RSS_LISTEN_BUCKET: #endif + case IPV6_VLAN_PCP: if (optname == IPV6_BINDANY && td != NULL) { error = priv_check(td, PRIV_NETINET_BINDANY); @@ -1945,6 +1956,29 @@ do { \ } break; #endif + case IPV6_VLAN_PCP: + if ((optval >= -1) && (optval <= + (INP_2PCP_MASK >> INP_2PCP_SHIFT))) { + if (optval == -1) { + INP_WLOCK(inp); + inp->inp_flags2 &= + ~(INP_2PCP_SET | + INP_2PCP_MASK); + INP_WUNLOCK(inp); + } else { + INP_WLOCK(inp); + inp->inp_flags2 |= + INP_2PCP_SET; + inp->inp_flags2 &= + ~INP_2PCP_MASK; + inp->inp_flags2 |= + optval << + INP_2PCP_SHIFT; + INP_WUNLOCK(inp); + } + } else + error = EINVAL; + break; } break; @@ -2168,6 +2202,7 @@ do { \ case IPV6_RECVRSSBUCKETID: #endif case IPV6_BINDMULTI: + case IPV6_VLAN_PCP: switch (optname) { case IPV6_RECVHOPOPTS: optval = OPTBIT(IN6P_HOPOPTS); @@ -2264,7 +2299,18 @@ do { \ case IPV6_BINDMULTI: optval = OPTBIT2(INP_BINDMULTI); break; + + case IPV6_VLAN_PCP: + if (OPTBIT2(INP_2PCP_SET)) { + optval = (inp->inp_flags2 & + INP_2PCP_MASK) >> + INP_2PCP_SHIFT; + } else { + optval = -1; + } + break; } + if (error) break; error = sooptcopyout(sopt, &optval, From owner-svn-src-head@freebsd.org Fri Oct 9 12:44: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 A9AC13F8B6F; Fri, 9 Oct 2020 12:44:57 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C777s43tLz4L9N; Fri, 9 Oct 2020 12:44:57 +0000 (UTC) (envelope-from rscheff@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 69FE519E27; Fri, 9 Oct 2020 12:44:57 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 099Civ4P049455; Fri, 9 Oct 2020 12:44:57 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 099CivKY049453; Fri, 9 Oct 2020 12:44:57 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202010091244.099CivKY049453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Fri, 9 Oct 2020 12:44:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366570 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 366570 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, 09 Oct 2020 12:44:57 -0000 Author: rscheff Date: Fri Oct 9 12:44:56 2020 New Revision: 366570 URL: https://svnweb.freebsd.org/changeset/base/366570 Log: Stop sending tiny new data segments during SACK recovery Consider the currently in-use TCP options when calculating the amount of new data to be injected during SACK loss recovery. That addresses the effect that very small (new) segments could be injected on partial ACKs while still performing a SACK loss recovery. Reported by: Liang Tian Reviewed by: tuexen, chengc_netapp.com MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26446 Modified: head/sys/netinet/tcp_output.c head/sys/netinet/tcp_sack.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Fri Oct 9 12:06:43 2020 (r366569) +++ head/sys/netinet/tcp_output.c Fri Oct 9 12:44:56 2020 (r366570) @@ -336,7 +336,7 @@ again: sendalot = 1; TCPSTAT_INC(tcps_sack_rexmits); TCPSTAT_ADD(tcps_sack_rexmit_bytes, - min(len, tp->t_maxseg)); + min(len, tcp_maxseg(tp))); } } after_sack_rexmit: @@ -858,7 +858,6 @@ send: if (flags & TH_SYN) to.to_flags |= TOF_SACKPERM; else if (TCPS_HAVEESTABLISHED(tp->t_state) && - (tp->t_flags & TF_SACK_PERMIT) && tp->rcv_numsacks > 0) { to.to_flags |= TOF_SACK; to.to_nsacks = tp->rcv_numsacks; Modified: head/sys/netinet/tcp_sack.c ============================================================================== --- head/sys/netinet/tcp_sack.c Fri Oct 9 12:06:43 2020 (r366569) +++ head/sys/netinet/tcp_sack.c Fri Oct 9 12:44:56 2020 (r366570) @@ -787,15 +787,16 @@ void tcp_sack_partialack(struct tcpcb *tp, struct tcphdr *th) { int num_segs = 1; + u_int maxseg = tcp_maxseg(tp); INP_WLOCK_ASSERT(tp->t_inpcb); tcp_timer_activate(tp, TT_REXMT, 0); tp->t_rtttime = 0; /* Send one or 2 segments based on how much new data was acked. */ - if ((BYTES_THIS_ACK(tp, th) / tp->t_maxseg) >= 2) + if ((BYTES_THIS_ACK(tp, th) / maxseg) >= 2) num_segs = 2; tp->snd_cwnd = (tp->sackhint.sack_bytes_rexmit + - (tp->snd_nxt - tp->snd_recover) + num_segs * tp->t_maxseg); + (tp->snd_nxt - tp->snd_recover) + num_segs * maxseg); if (tp->snd_cwnd > tp->snd_ssthresh) tp->snd_cwnd = tp->snd_ssthresh; tp->t_flags |= TF_ACKNOW; From owner-svn-src-head@freebsd.org Fri Oct 9 13:11:14 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 E5A423FA4D8; Fri, 9 Oct 2020 13:11:14 +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 4C77kB5t9Wz4N6N; Fri, 9 Oct 2020 13:11:14 +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 AE7561A02A; Fri, 9 Oct 2020 13:11:14 +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 099DBEdb065036; Fri, 9 Oct 2020 13:11:14 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 099DBEpM065035; Fri, 9 Oct 2020 13:11:14 GMT (envelope-from br@FreeBSD.org) Message-Id: <202010091311.099DBEpM065035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 9 Oct 2020 13:11:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366571 - head/sys/dev/iommu X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/iommu X-SVN-Commit-Revision: 366571 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, 09 Oct 2020 13:11:15 -0000 Author: br Date: Fri Oct 9 13:11:14 2020 New Revision: 366571 URL: https://svnweb.freebsd.org/changeset/base/366571 Log: Add iommu_get_dev_ctx() helper that allows to instantiate an iommu context for a given device_t. Submitted by: andrew Reviewed by: kib Sponsored by: DARPA, AFRL Modified: head/sys/dev/iommu/busdma_iommu.c head/sys/dev/iommu/iommu.h Modified: head/sys/dev/iommu/busdma_iommu.c ============================================================================== --- head/sys/dev/iommu/busdma_iommu.c Fri Oct 9 12:44:56 2020 (r366570) +++ head/sys/dev/iommu/busdma_iommu.c Fri Oct 9 13:11:14 2020 (r366571) @@ -269,14 +269,12 @@ iommu_instantiate_ctx(struct iommu_unit *unit, device_ return (ctx); } -bus_dma_tag_t -iommu_get_dma_tag(device_t dev, device_t child) +struct iommu_ctx * +iommu_get_dev_ctx(device_t dev) { struct iommu_unit *unit; - struct iommu_ctx *ctx; - bus_dma_tag_t res; - unit = iommu_find(child, bootverbose); + unit = iommu_find(dev, bootverbose); /* Not in scope of any IOMMU ? */ if (unit == NULL) return (NULL); @@ -288,8 +286,20 @@ iommu_get_dma_tag(device_t dev, device_t child) dmar_instantiate_rmrr_ctxs(unit); #endif - ctx = iommu_instantiate_ctx(unit, child, false); - res = ctx == NULL ? NULL : (bus_dma_tag_t)ctx->tag; + return (iommu_instantiate_ctx(unit, dev, false)); +} + +bus_dma_tag_t +iommu_get_dma_tag(device_t dev, device_t child) +{ + struct iommu_ctx *ctx; + bus_dma_tag_t res; + + ctx = iommu_get_dev_ctx(child); + if (ctx == NULL) + return (NULL); + + res = (bus_dma_tag_t)ctx->tag; return (res); } Modified: head/sys/dev/iommu/iommu.h ============================================================================== --- head/sys/dev/iommu/iommu.h Fri Oct 9 12:44:56 2020 (r366570) +++ head/sys/dev/iommu/iommu.h Fri Oct 9 13:11:14 2020 (r366571) @@ -233,6 +233,7 @@ int bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_d vm_paddr_t start, vm_size_t length, int flags); bus_dma_tag_t iommu_get_dma_tag(device_t dev, device_t child); +struct iommu_ctx *iommu_get_dev_ctx(device_t dev); SYSCTL_DECL(_hw_iommu); From owner-svn-src-head@freebsd.org Fri Oct 9 14:03: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 84C2E3FBA20; Fri, 9 Oct 2020 14:03:49 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C78ts3JHXz4QNM; Fri, 9 Oct 2020 14:03:49 +0000 (UTC) (envelope-from gbe@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 3B8FA1A767; Fri, 9 Oct 2020 14:03:49 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 099E3nZG098291; Fri, 9 Oct 2020 14:03:49 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 099E3kVO098275; Fri, 9 Oct 2020 14:03:46 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010091403.099E3kVO098275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Fri, 9 Oct 2020 14:03:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366572 - in head: sbin/devmatch sbin/fsck sbin/ifconfig sbin/mount_msdosfs usr.bin/chat usr.bin/du usr.bin/setchannel usr.bin/tftp usr.sbin/ctladm usr.sbin/extattrctl usr.sbin/i2c usr.... X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: in head: sbin/devmatch sbin/fsck sbin/ifconfig sbin/mount_msdosfs usr.bin/chat usr.bin/du usr.bin/setchannel usr.bin/tftp usr.sbin/ctladm usr.sbin/extattrctl usr.sbin/i2c usr.sbin/mountd usr.sbin/nfsu... X-SVN-Commit-Revision: 366572 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, 09 Oct 2020 14:03:49 -0000 Author: gbe (doc committer) Date: Fri Oct 9 14:03:45 2020 New Revision: 366572 URL: https://svnweb.freebsd.org/changeset/base/366572 Log: Fix a few mandoc issues - no blank before trailing delimiter - whitespace at end of input line - sections out of conventional order - normalizing date format - AUTHORS section without An macro Modified: head/sbin/devmatch/devmatch.8 head/sbin/fsck/fsck.8 head/sbin/ifconfig/ifconfig.8 head/sbin/mount_msdosfs/mount_msdosfs.8 head/usr.bin/chat/chat.8 head/usr.bin/du/du.1 head/usr.bin/setchannel/setchannel.1 head/usr.bin/tftp/tftp.1 head/usr.sbin/ctladm/ctladm.8 head/usr.sbin/extattrctl/extattrctl.8 head/usr.sbin/i2c/i2c.8 head/usr.sbin/mountd/exports.5 head/usr.sbin/nfsuserd/nfsuserd.8 head/usr.sbin/pmcstudy/pmcstudy.8 head/usr.sbin/traceroute6/traceroute6.8 Modified: head/sbin/devmatch/devmatch.8 ============================================================================== --- head/sbin/devmatch/devmatch.8 Fri Oct 9 13:11:14 2020 (r366571) +++ head/sbin/devmatch/devmatch.8 Fri Oct 9 14:03:45 2020 (r366572) @@ -69,6 +69,8 @@ Produce more verbose output. .Sh SEE ALSO .Xr devinfo 8 , .Xr MODULE_PNP_INFO 9 +.Sh AUTHORS +.An Warner Losh Aq Mt imp@FreeBSD.org .Sh BUGS The kernel has hints in it, but we exclude it from the list of modules to suggest for unmatched devices. @@ -92,5 +94,3 @@ logical equivalent in USB, PCI, and others. .Pp Many drivers currently lack proper PNP table decorations and need to be updated. -.Sh AUTHORS -.An Warner Losh Aq Mt imp@FreeBSD.org Modified: head/sbin/fsck/fsck.8 ============================================================================== --- head/sbin/fsck/fsck.8 Fri Oct 9 13:11:14 2020 (r366571) +++ head/sbin/fsck/fsck.8 Fri Oct 9 14:03:45 2020 (r366572) @@ -143,7 +143,7 @@ only if is compiled to support it. .It Fl f Force checking of file systems. -Running +Running .Dq Li fsck -f ignores the journal and does a full consistency check of the disk so will find and fix the errors about which the Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Fri Oct 9 13:11:14 2020 (r366571) +++ head/sbin/ifconfig/ifconfig.8 Fri Oct 9 14:03:45 2020 (r366572) @@ -592,7 +592,7 @@ Note that this must be configured on a physical interf not on a .Xr vlan 4 interface itself. -.It Fl vlanmtu , vlanhwtag, vlanhwfilter, vlanhwtso +.It Fl vlanmtu , vlanhwtag , vlanhwfilter , vlanhwtso If the driver offers user-configurable VLAN support, disable reception of extended frames, tag processing in hardware, frame filtering in hardware, or TSO on VLAN, Modified: head/sbin/mount_msdosfs/mount_msdosfs.8 ============================================================================== --- head/sbin/mount_msdosfs/mount_msdosfs.8 Fri Oct 9 13:11:14 2020 (r366571) +++ head/sbin/mount_msdosfs/mount_msdosfs.8 Fri Oct 9 14:03:45 2020 (r366572) @@ -202,7 +202,7 @@ and first appeared in was renamed to the more aptly-named .Nm in -.Fx 5.0. +.Fx 5.0 . The character code conversion routine was added in 2003. .Sh AUTHORS Initial implementation as Modified: head/usr.bin/chat/chat.8 ============================================================================== --- head/usr.bin/chat/chat.8 Fri Oct 9 13:11:14 2020 (r366571) +++ head/usr.bin/chat/chat.8 Fri Oct 9 14:03:45 2020 (r366572) @@ -291,7 +291,8 @@ The .Dv SAY strings could be used to give progress messages in sections of the script where you want to have 'ECHO OFF' but still let the user -know what is happening. An example is: +know what is happening. +An example is: .Bd -literal -offset indent ABORT BUSY ECHO OFF Modified: head/usr.bin/du/du.1 ============================================================================== --- head/usr.bin/du/du.1 Fri Oct 9 13:11:14 2020 (r366571) +++ head/usr.bin/du/du.1 Fri Oct 9 14:03:45 2020 (r366572) @@ -63,7 +63,7 @@ Calculate block counts in .Ar blocksize byte blocks. This is different from the -.Fl h, k, m, +.Fl h , k , m , .Fl Fl si and .Fl g @@ -172,7 +172,7 @@ options override each other and the command's actions by the last one specified. .Pp The -.Fl h, k, m +.Fl h , k , m and .Fl Fl si options all override each other; the last one specified determines @@ -183,7 +183,7 @@ the block counts used. If the environment variable .Ev BLOCKSIZE is set, and the -.Fl h, k, m +.Fl h , k , m or .Fl Fl si options are not specified, the block counts will be displayed in units of @@ -191,7 +191,7 @@ that block size. If .Ev BLOCKSIZE is not set, and the -.Fl h, k, m +.Fl h , k , m or .Fl Fl si options are not specified, the block counts will be displayed in 512-byte Modified: head/usr.bin/setchannel/setchannel.1 ============================================================================== --- head/usr.bin/setchannel/setchannel.1 Fri Oct 9 13:11:14 2020 (r366571) +++ head/usr.bin/setchannel/setchannel.1 Fri Oct 9 14:03:45 2020 (r366572) @@ -61,8 +61,8 @@ Select svideo input. .It Fl t Select tuner. .It Fl g Cm geom -Select geometry. The first resolution is for NTSC, the second for -PAL. +Select geometry. +The first resolution is for NTSC, the second for PAL. .Pp VCD: 352x240 or 352x288 SVCD: 480x480 or 480x576 @@ -91,7 +91,8 @@ Frequency in MHz (must include decimal point). .Sh HISTORY The .Nm -program first appeared in the -multimedia mailing-list in January 2004. The +program first appeared in the -multimedia mailing-list in January 2004. +The .Nm program first appeared in the FreeBSD Ports collection in October 2004. .Sh AUTHORS Modified: head/usr.bin/tftp/tftp.1 ============================================================================== --- head/usr.bin/tftp/tftp.1 Fri Oct 9 13:11:14 2020 (r366571) +++ head/usr.bin/tftp/tftp.1 Fri Oct 9 14:03:45 2020 (r366572) @@ -74,7 +74,8 @@ Shorthand for "mode binary" Sets the TFTP blksize option in TFTP Read Request or Write Request packets to .Ar [size] -as specified in RFC 2348. Valid values are between 8 and 65464. +as specified in RFC 2348. +Valid values are between 8 and 65464. If no blocksize is specified, then by default a blocksize of 512 bytes will be used. .Pp @@ -82,8 +83,8 @@ will be used. Sets the TFTP blksize2 option in TFTP Read Request or Write Request packets to .Ar [size] . -Values are restricted to powers of 2 between 8 and 32768. This is a -non-standard TFTP option. +Values are restricted to powers of 2 between 8 and 32768. +This is a non-standard TFTP option. .Pp .It Cm connect Ar host Op Ar port Set the @@ -109,7 +110,8 @@ or commands. .Pp .It Cm debug Ar level -Enable or disable debugging levels during verbose output. The value of +Enable or disable debugging levels during verbose output. +The value of .Ar level can be one of .Cm packet , simple , options , @@ -156,7 +158,8 @@ The default is .It Cm packetdrop [arg] Randomly drop .Ar arg -out of 100 packets during a transfer. This is a debugging feature. +out of 100 packets during a transfer. +This is a debugging feature. .Pp .It Cm put Ar file Op Oo Ar host : Oc Ns Ar remotename .It Cm put Ar file1 file2 ... fileN Op Oo Ar host : Oc Ns Ar remote-directory @@ -178,7 +181,8 @@ see the example under the command. .Pp .It Cm options Ar [arg] -Enable or disable support for TFTP options. The valid values of +Enable or disable support for TFTP options. +The valid values of .Ar arg are .Cm on @@ -198,8 +202,8 @@ Set the per-packet retransmission timeout, in seconds. .Pp .It Cm rollover [arg] Specify the rollover option in TFTP Read Request or Write -Request packets. After 65535 packets have been transmitted, set the block -counter to +Request packets. +After 65535 packets have been transmitted, set the block counter to .Ar arg . Valid values of .Ar arg Modified: head/usr.sbin/ctladm/ctladm.8 ============================================================================== --- head/usr.sbin/ctladm/ctladm.8 Fri Oct 9 13:11:14 2020 (r366571) +++ head/usr.sbin/ctladm/ctladm.8 Fri Oct 9 14:03:45 2020 (r366572) @@ -233,8 +233,8 @@ utility take the following optional arguments: .It Fl C Ar retries Specify the number of times to retry a command in the event of failure. .It Fl D Ar device -Specify the device to open. This allows opening a device other than the -default device, +Specify the device to open. +This allows opening a device other than the default device, .Pa /dev/cam/ctl , to be opened for sending commands. .It Fl I Ar id @@ -272,29 +272,31 @@ READ command to the device, and write the requested da stdout. .Bl -tag -width 12n .It Fl l Ar lba -Specify the starting Logical Block Address for the READ. This can be -specified in decimal, octal (starting with 0), hexadecimal (starting with -0x) or any other base supported by +Specify the starting Logical Block Address for the READ. +This can be specified in decimal, octal (starting with 0), +hexadecimal (starting with 0x) or any other base supported by .Xr strtoull 3 . .It Fl d Ar datalen Specify the length, in 512 byte blocks, of the READ request. .It Fl f Ar file -Specify the destination for the data read by the READ command. Either a -filename or +Specify the destination for the data read by the READ command. +Either a filename or .Sq - for stdout may be specified. .It Fl c Ar cdbsize Specify the minimum .Tn SCSI -CDB (Command Data Block) size to be used for the READ request. Allowable -values are 6, 10, 12 and 16. Depending upon the LBA and amount of data -requested, a larger CDB size may be used to satisfy the request. (e.g., -for LBAs above 0xffffffff, READ(16) must be used to satisfy the request.) +CDB (Command Data Block) size to be used for the READ request. +Allowable values are 6, 10, 12 and 16. +Depending upon the LBA and amount of data requested, a larger CDB +size may be used to satisfy the request. (e.g., for LBAs above 0xffffffff, +READ(16) must be used to satisfy the request.) .It Fl b Ar blocksize Specify the blocksize of the underlying .Tn SCSI device, so the transfer length -can be calculated accurately. The blocksize can be obtained via the +can be calculated accurately. +The blocksize can be obtained via the .Tn SCSI READ CAPACITY command. .It Fl N @@ -310,29 +312,31 @@ Read data from a file or stdin, and write the data to WRITE command. .Bl -tag -width 12n .It Fl l Ar lba -Specify the starting Logical Block Address for the WRITE. This can be -specified in decimal, octal (starting with 0), hexadecimal (starting with -0x) or any other base supported by +Specify the starting Logical Block Address for the WRITE. +This can be specified in decimal, octal (starting with 0), hexadecimal +(starting with 0x) or any other base supported by .Xr strtoull 3 . .It Fl d Ar atalen Specify the length, in 512 byte blocks, of the WRITE request. .It Fl f Ar file -Specify the source for the data to be written by the WRITE command. Either a -filename or +Specify the source for the data to be written by the WRITE command. +Either a filename or .Sq - for stdin may be specified. .It Fl c Ar cdbsize Specify the minimum .Tn SCSI -CDB (Command Data Block) size to be used for the READ request. Allowable -values are 6, 10, 12 and 16. Depending upon the LBA and amount of data -requested, a larger CDB size may be used to satisfy the request. (e.g., -for LBAs above 0xffffffff, READ(16) must be used to satisfy the request.) +CDB (Command Data Block) size to be used for the READ request. +Allowable values are 6, 10, 12 and 16. +Depending upon the LBA and amount of data requested, a larger CDB size +may be used to satisfy the request. (e.g., for LBAs above 0xffffffff, READ(16) +must be used to satisfy the request.) .It Fl b Ar blocksize Specify the blocksize of the underlying .Tn SCSI device, so the transfer length -can be calculated accurately. The blocksize can be obtained via the +can be calculated accurately. +The blocksize can be obtained via the .Tn SCSI READ CAPACITY command. .It Fl N @@ -346,18 +350,20 @@ This is to be used for performance testing. Send the .Tn SCSI READ CAPACITY command to the device and display the device size and device -block size. By default, READ CAPACITY(10) is -used. If the device returns a maximum LBA of 0xffffffff, however, +block size. +By default, READ CAPACITY(10) is used. +If the device returns a maximum LBA of 0xffffffff, however, .Nm will automatically issue a READ CAPACITY(16), which is implemented as a -service action of the SERVICE ACTION IN(16) opcode. The user can specify -the minimum CDB size with the +service action of the SERVICE ACTION IN(16) opcode. +The user can specify the minimum CDB size with the .Fl c -argument. Valid values for the +argument. +Valid values for the .Fl c -option are 10 and 16. If a 10 byte CDB is specified, the request will be -automatically reissued with a 16 byte CDB if the maximum LBA returned is -0xffffffff. +option are 10 and 16. +If a 10 byte CDB is specified, the request will be automatically reissued +with a 16 byte CDB if the maximum LBA returned is 0xffffffff. .It Ic modesense Send a .Tn SCSI @@ -365,17 +371,21 @@ MODE SENSE command to the device, and display the requ page list. .Bl -tag -width 10n .It Fl m Ar page -Specify the mode page to display. This option and the +Specify the mode page to display. +This option and the .Fl l -option are mutually exclusive. One of the two must be specified, though. +option are mutually exclusive. +One of the two must be specified, though. Mode page numbers may be specified in decimal or hexadecimal. .It Fl l Request that the list of mode pages supported by the device be returned. This option and the .Fl m -option are mutually exclusive. One of the two must be specified, though. +option are mutually exclusive. +One of the two must be specified, though. .It Fl P Ar pc -Specify the mode page control value. Possible values are: +Specify the mode page control value. +Possible values are: .Bl -tag -width 2n -compact .It 0 Current values. @@ -391,8 +401,8 @@ Disable block descriptors when sending the mode sense .It Fl S Ar subpage Specify the subpage used with the mode sense request. .It Fl c Ar cdbsize -Specify the CDB size used for the mode sense request. Supported values are -6 and 10. +Specify the CDB size used for the mode sense request. +Supported values are 6 and 10. .El .It Ic start Send the @@ -401,54 +411,56 @@ START STOP UNIT command to the specified LUN with the bit set. .Bl -tag -width 4n .It Fl i -Set the immediate bit in the CDB. Note that CTL does not support the -immediate bit, so this is primarily useful for making sure that CTL returns -the proper error. +Set the immediate bit in the CDB. +Note that CTL does not support the immediate bit, so this is primarily +useful for making sure that CTL returns the proper error. .El .It Ic stop Send the .Tn SCSI START STOP UNIT command to the specified LUN with the start -bit cleared. We use an ordered tag to stop the LUN, so we can guarantee -that all pending I/O executes before it is stopped. (CTL guarantees this -anyway, but +bit cleared. +We use an ordered tag to stop the LUN, so we can guarantee that all pending +I/O executes before it is stopped. +(CTL guarantees this anyway, but .Nm sends an ordered tag for completeness.) .Bl -tag -width 4n .It Fl i -Set the immediate bit in the CDB. Note that CTL does not support the -immediate bit, so this is primarily useful for making sure that CTL returns -the proper error. +Set the immediate bit in the CDB. +Note that CTL does not support the immediate bit, so this is primarily +useful for making sure that CTL returns the proper error. .El .It Ic synccache Send the .Tn SCSI -SYNCHRONIZE CACHE command to the device. By default, SYNCHRONIZE -CACHE(10) is used. If the specified starting LBA is greater than -0xffffffff or the length is greater than 0xffff, though, -SYNCHRONIZE CACHE(16) will be used. The 16 byte command will also be used -if the user specifies a 16 byte CDB with the +SYNCHRONIZE CACHE command to the device. +By default, SYNCHRONIZE CACHE(10) is used. +If the specified starting LBA is greater than 0xffffffff or the length is +greater than 0xffff, though, SYNCHRONIZE CACHE(16) will be used. +The 16 byte command will also be used if the user specifies a 16 byte CDB with the .Fl c argument. .Bl -tag -width 14n .It Fl l Ar lba -Specify the starting LBA of the cache region to synchronize. This option is a -no-op for CTL. If you send a SYNCHRONIZE CACHE command, it will sync the -cache for the entire LUN. +Specify the starting LBA of the cache region to synchronize. +This option is a no-op for CTL. +If you send a SYNCHRONIZE CACHE command, it will sync the cache for the entire LUN. .It Fl b Ar blockcount -Specify the length of the cache region to synchronize. This option is a -no-op for CTL. If you send a SYNCHRONIZE CACHE command, it will sync the -cache for the entire LUN. +Specify the length of the cache region to synchronize. +This option is a no-op for CTL. +If you send a SYNCHRONIZE CACHE command, it will sync the cache for the entire LUN. .It Fl r -Specify relative addressing for the starting LBA. CTL does not support -relative addressing, since it only works for linked commands, and CTL -does not support linked commands. +Specify relative addressing for the starting LBA. +CTL does not support relative addressing, since it only works for linked commands, +and CTL does not support linked commands. .It Fl i Tell the target to return status immediately after issuing the SYNCHRONIZE CACHE -command rather than waiting for the cache to finish syncing. CTL does not -support this bit. +command rather than waiting for the cache to finish syncing. +CTL does not support this bit. .It Fl c Ar cdbsize -Specify the minimum CDB size. Valid values are 10 and 16 bytes. +Specify the minimum CDB size. +Valid values are 10 and 16 bytes. .El .It Ic lunlist List all LUNs registered with CTL. @@ -457,14 +469,15 @@ Because this command uses the ioctl port, it will only This command is the equivalent of doing a REPORT LUNS on one LUN and then an INQUIRY on each LUN in the system. .It Ic delay -Delay commands at the given location. There are two places where commands -may be delayed currently: before data is transferred +Delay commands at the given location. +There are two places where commands may be delayed currently: before data is transferred .Pq Dq datamove and just prior to sending status to the host .Pq Dq done . One of the two must be supplied as an argument to the .Fl l -option. The +option. +The .Fl t option must also be specified. .Bl -tag -width 12n @@ -473,9 +486,10 @@ Delay command(s) at the specified location. This can either be at the data movement stage (datamove) or prior to command completion (done). .It Fl t Ar delaytime -Delay command(s) for the specified number of seconds. This must be -specified. If set to 0, it will clear out any previously set delay for -this particular location (datamove or done). +Delay command(s) for the specified number of seconds. +This must be specified. +If set to 0, it will clear out any previously set delay for this particular +location (datamove or done). .It Fl T Ar delaytype Specify the delay type. By default, the @@ -898,11 +912,12 @@ as write protected. Set to "on", makes LUN removable. .It Va reordering Set to "unrestricted", allows target to process commands with SIMPLE task -attribute in arbitrary order. Any data integrity exposures related to -command sequence order shall be explicitly handled by the application -client through the selection of appropriate commands and task attributes. -The default value is "restricted". It improves data integrity, but may -introduce some additional delays. +attribute in arbitrary order. +Any data integrity exposures related to command sequence order shall be +explicitly handled by the application client through the selection of +appropriate commands and task attributes. +The default value is "restricted". +It improves data integrity, but may introduce some additional delays. .It Va serseq Set to "on" to serialize consecutive reads/writes. Set to "read" to serialize consecutive reads. Modified: head/usr.sbin/extattrctl/extattrctl.8 ============================================================================== --- head/usr.sbin/extattrctl/extattrctl.8 Fri Oct 9 13:11:14 2020 (r366571) +++ head/usr.sbin/extattrctl/extattrctl.8 Fri Oct 9 14:03:45 2020 (r366572) @@ -178,4 +178,4 @@ and introduced in It was developed to support security extensions requiring additional labels to be associated with each file or directory. .Sh AUTHORS -Robert N M Watson +.An Robert N M Watson Modified: head/usr.sbin/i2c/i2c.8 ============================================================================== --- head/usr.sbin/i2c/i2c.8 Fri Oct 9 13:11:14 2020 (r366571) +++ head/usr.sbin/i2c/i2c.8 Fri Oct 9 14:03:45 2020 (r366572) @@ -55,8 +55,8 @@ The .Nm utility can be used to perform raw data transfers (read or write) with devices -on the I2C bus. It can also scan the bus for available devices and reset the -I2C controller. +on the I2C bus. +It can also scan the bus for available devices and reset the I2C controller. .Pp The options are as follows: .Bl -tag -width ".Fl d Ar direction" @@ -124,10 +124,10 @@ Zero means that the offset is ignored and not passed t .Sh WARNINGS Great care must be taken when manipulating slave I2C devices with the .Nm -utility. Often times important configuration data for the system is kept in -non-volatile but write enabled memories located on the I2C bus, for example -Ethernet hardware addresses, RAM module parameters (SPD), processor reset -configuration word etc. +utility. +Often times important configuration data for the system is kept in non-volatile +but write enabled memories located on the I2C bus, for example Ethernet hardware +addresses, RAM module parameters (SPD), processor reset configuration word etc. .Pp It is very easy to render the whole system unusable when such configuration data is deleted or altered, so use the @@ -135,13 +135,14 @@ data is deleted or altered, so use the (write) command only if you know exactly what you are doing. .Pp Also avoid ungraceful interrupting of an ongoing transaction on the I2C bus, -as it can lead to potentially dangerous effects. Consider the following -scenario: when the host CPU is reset (for whatever reason) in the middle of a -started I2C transaction, the I2C slave device could be left in write mode -waiting for data or offset to arrive. When the CPU reinitializes itself and -talks to this I2C slave device again, the commands and other control info it -sends are treated by the slave device as data or offset it was waiting for, -and there's great potential for corruption if such a write is performed. +as it can lead to potentially dangerous effects. +Consider the following scenario: when the host CPU is reset (for whatever reason) +in the middle of a started I2C transaction, the I2C slave device could be left +in write mode waiting for data or offset to arrive. +When the CPU reinitializes itself and talks to this I2C slave device again, +the commands and other control info it sends are treated by the slave device +as data or offset it was waiting for, and there's great potential for +corruption if such a write is performed. .Sh EXAMPLES .Bl -bullet .It Modified: head/usr.sbin/mountd/exports.5 ============================================================================== --- head/usr.sbin/mountd/exports.5 Fri Oct 9 13:11:14 2020 (r366571) +++ head/usr.sbin/mountd/exports.5 Fri Oct 9 14:03:45 2020 (r366572) @@ -28,7 +28,7 @@ .\" @(#)exports.5 8.3 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd Feb 11, 2019 +.Dd February 11, 2019 .Dt EXPORTS 5 .Os .Sh NAME @@ -316,9 +316,10 @@ There can only be one NFSv4 root directory per server. As such, all entries of this form must specify the same directory path. For file systems other than ZFS, this location can be any directory and does not -need to be within an exported file system. If it is not in an exported -file system, a very limited set of operations are permitted, so that an -NFSv4 client can traverse the tree to an exported file system. +need to be within an exported file system. +If it is not in an exported file system, a very limited set of operations +are permitted, so that an NFSv4 client can traverse the tree to an +exported file system. Although parts of the NFSv4 tree can be non-exported, the entire NFSv4 tree must consist of local file systems capable of being exported via NFS. All ZFS file systems in the subtree below the NFSv4 tree root must be @@ -330,10 +331,11 @@ mount points. The .Fl sec option on these line(s) specifies what security flavors may be used for -NFSv4 operations that do not use file handles. Since these operations -(SetClientID, SetClientIDConfirm, Renew, DelegPurge and ReleaseLockOnwer) -allocate/modify state in the server, it is possible to restrict some clients to -the use of the krb5[ip] security flavors, via this option. +NFSv4 operations that do not use file handles. +Since these operations (SetClientID, SetClientIDConfirm, Renew, DelegPurge +and ReleaseLockOnwer) allocate/modify state in the server, it is possible +to restrict some clients to the use of the krb5[ip] security flavors, +via this option. See the .Sx EXAMPLES section below. @@ -507,12 +509,13 @@ V4: /wingsdl/nfsv4 .Ed .Pp Only one V4: line is needed or allowed to declare where NFSv4 is -rooted. The other lines declare specific exported directories with +rooted. +The other lines declare specific exported directories with their absolute paths given in /etc/exports. .Pp The exported directories' paths are used for both v3 and v4. -However, they are interpreted differently for v3 and v4. A client -mount command for usr-ports would use the server-absolute name when +However, they are interpreted differently for v3 and v4. +A client mount command for usr-ports would use the server-absolute name when using nfsv3: .Bd -literal -offset indent mount server:/wingsdl/nfsv4/usr-ports /mnt/tmp @@ -525,8 +528,9 @@ mount server:/usr-ports /mnt/tmp .Ed .Pp This also differentiates which version you want if the client can do -both v3 and v4. The former will only ever do a v3 mount and the -latter will only ever do a v4 mount. +both v3 and v4. +The former will only ever do a v3 mount and the latter will only ever +do a v4 mount. .Pp Note that due to different mount behavior between NFSv3 and NFSv4 a NFSv4 mount request for a directory that the client does not have Modified: head/usr.sbin/nfsuserd/nfsuserd.8 ============================================================================== --- head/usr.sbin/nfsuserd/nfsuserd.8 Fri Oct 9 13:11:14 2020 (r366571) +++ head/usr.sbin/nfsuserd/nfsuserd.8 Fri Oct 9 14:03:45 2020 (r366572) @@ -53,11 +53,12 @@ owner and owner_group strings. It also provides support for manage-gids and must be running on the server if this is being used for any version of NFS. .Pp -Upon startup, it loads the machines DNS domain name, plus timeout and -cache size limit into the kernel. It then preloads the cache with group -and user information, up to the cache size limit and forks off N children -(default 4), that service requests from the kernel for cache misses. The -master server is there for the sole purpose of killing off the slaves. +Upon startup, it loads the machines DNS domain name, plus timeout and cache size +limit into the kernel. +It then preloads the cache with group and user information, up to the cache size +limit and forks off N children (default 4), that service requests from the kernel +for cache misses. +The master server is there for the sole purpose of killing off the slaves. To stop the nfsuserd, send a SIGUSR1 to the master server. .Pp The following options are available: @@ -72,13 +73,14 @@ reported by Overrides the default timeout for cache entries, in minutes. The longer the time out, the better the performance, but the longer it takes for replaced -entries to be seen. If your user/group database management system almost -never re-uses the same names or id numbers, a large timeout is recommended. +entries to be seen. +If your user/group database management system almost never re-uses the same names +or id numbers, a large timeout is recommended. The default is 1 minute. .It Fl usermax Ar max_cache_size -Overrides the default upper bound on the cache size. The larger the cache, -the more kernel memory is used, but the better the performance. If your -system can afford the memory use, make this the sum of the number of +Overrides the default upper bound on the cache size. +The larger the cache, the more kernel memory is used, but the better the performance. +If your system can afford the memory use, make this the sum of the number of entries in your group and password databases. The default is 200 entries. .It Fl verbose @@ -98,12 +100,13 @@ on the server instead of the list of groups provided i This can be used to avoid the 16 group limit for AUTH_SYS. .It Ar num_servers Specifies how many servers to create (max 20). -The default of 4 may be sufficient. You should run enough servers, so that +The default of 4 may be sufficient. +You should run enough servers, so that .Xr ps 1 shows almost no running time for one or two of the slaves after the system -has been running for a long period. Running too few will have a major -performance impact, whereas running too many will only tie up some resources, -such as a process table entry and swap space. +has been running for a long period. +Running too few will have a major performance impact, whereas running too many +will only tie up some resources, such as a process table entry and swap space. .El .Sh SEE ALSO .Xr getgrent 3 , @@ -126,7 +129,8 @@ use and .Xr getpwent 3 library calls to resolve requests and will hang if the servers handling -those requests fail and the library functions don't return. See +those requests fail and the library functions don't return. +See .Xr group 5 and .Xr passwd 5 Modified: head/usr.sbin/pmcstudy/pmcstudy.8 ============================================================================== --- head/usr.sbin/pmcstudy/pmcstudy.8 Fri Oct 9 13:11:14 2020 (r366571) +++ head/usr.sbin/pmcstudy/pmcstudy.8 Fri Oct 9 14:03:45 2020 (r366572) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Mar 26, 2015 +.Dd March 26, 2015 .Dt PMCSTUDY 8 .Os .Sh NAME @@ -140,6 +140,6 @@ Run all canned tests. The .Nm utility first appeared in -.Fx 11.0. +.Fx 11.0 . .Sh AUTHORS .An Randall Stewart Aq Mt rrs@FreeBSD.org Modified: head/usr.sbin/traceroute6/traceroute6.8 ============================================================================== --- head/usr.sbin/traceroute6/traceroute6.8 Fri Oct 9 13:11:14 2020 (r366571) +++ head/usr.sbin/traceroute6/traceroute6.8 Fri Oct 9 14:03:45 2020 (r366572) @@ -99,7 +99,8 @@ Debug mode. .It Fl f Ar firsthop Specify how many hops to skip in trace. .It Fl g Ar gateway -Specify intermediate gateway. Please note that +Specify intermediate gateway. +Please note that .Nm tries to use routing headers. .It Fl I @@ -150,7 +151,8 @@ The size of probe packets must be a multiple of 4. If .Ar datalen is up to 28, probe packets consist of a SHUTDOWN-ACK chunk possibly bundled -with a PAD chunk. For larger probe packets, an INIT chunk is used. +with a PAD chunk. +For larger probe packets, an INIT chunk is used. .It Fl t Ar tclass .Ar tclass specifies the From owner-svn-src-head@freebsd.org Fri Oct 9 14: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 331423FC733; Fri, 9 Oct 2020 14:33:11 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C79Xl0d60z4T9q; Fri, 9 Oct 2020 14:33:11 +0000 (UTC) (envelope-from rscheff@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 EDAC91AD72; Fri, 9 Oct 2020 14:33:10 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 099EXA9o019084; Fri, 9 Oct 2020 14:33:10 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 099EX9gT019077; Fri, 9 Oct 2020 14:33:09 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202010091433.099EX9gT019077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Fri, 9 Oct 2020 14:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366573 - in head: sys/dev/iscsi usr.bin/iscsictl usr.sbin/iscsid X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: in head: sys/dev/iscsi usr.bin/iscsictl usr.sbin/iscsid X-SVN-Commit-Revision: 366573 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, 09 Oct 2020 14:33:11 -0000 Author: rscheff Date: Fri Oct 9 14:33:09 2020 New Revision: 366573 URL: https://svnweb.freebsd.org/changeset/base/366573 Log: Add DSCP support for network QoS to iscsi initiator. Allow the DSCP codepoint also to be configurable for the traffic in the direction from the initiator to the target, such that writes and any requests are also treated in the appropriate QoS class. Reviewed by: mav MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26714 Modified: head/sys/dev/iscsi/iscsi_ioctl.h head/usr.bin/iscsictl/Makefile head/usr.bin/iscsictl/iscsi.conf.5 head/usr.bin/iscsictl/iscsictl.c head/usr.bin/iscsictl/iscsictl.h head/usr.bin/iscsictl/parse.y head/usr.bin/iscsictl/token.l head/usr.sbin/iscsid/iscsid.c Modified: head/sys/dev/iscsi/iscsi_ioctl.h ============================================================================== --- head/sys/dev/iscsi/iscsi_ioctl.h Fri Oct 9 14:03:45 2020 (r366572) +++ head/sys/dev/iscsi/iscsi_ioctl.h Fri Oct 9 14:33:09 2020 (r366573) @@ -70,7 +70,8 @@ struct iscsi_session_conf { int isc_iser; char isc_offload[ISCSI_OFFLOAD_LEN]; int isc_enable; - int isc_spare[4]; + int isc_dscp; + int isc_spare[3]; }; /* Modified: head/usr.bin/iscsictl/Makefile ============================================================================== --- head/usr.bin/iscsictl/Makefile Fri Oct 9 14:03:45 2020 (r366572) +++ head/usr.bin/iscsictl/Makefile Fri Oct 9 14:33:09 2020 (r366573) @@ -7,7 +7,7 @@ CFLAGS+= -I${.CURDIR} CFLAGS+= -I${SRCTOP}/sys/dev/iscsi MAN= iscsi.conf.5 iscsictl.8 -LIBADD= xo +LIBADD= util xo YFLAGS+= -v LFLAGS+= -i Modified: head/usr.bin/iscsictl/iscsi.conf.5 ============================================================================== --- head/usr.bin/iscsictl/iscsi.conf.5 Fri Oct 9 14:03:45 2020 (r366572) +++ head/usr.bin/iscsictl/iscsi.conf.5 Fri Oct 9 14:33:09 2020 (r366573) @@ -145,6 +145,16 @@ for iSCSI over RDMA, or .Qq Ar iSCSI . Default is .Qq Ar iSCSI . +.It Cm dscp +The DiffServ Codepoint used for sending data. The DSCP can be +set to numeric, or hexadecimal values directly, as well as the +well-defined +.Qq Ar cs +and +.Qq Ar af +codepoints. +Default is no specified dscp codepoint, which means the default +of the outgoing interface is used. .El .Sh FILES .Bl -tag -width indent Modified: head/usr.bin/iscsictl/iscsictl.c ============================================================================== --- head/usr.bin/iscsictl/iscsictl.c Fri Oct 9 14:03:45 2020 (r366572) +++ head/usr.bin/iscsictl/iscsictl.c Fri Oct 9 14:33:09 2020 (r366573) @@ -87,6 +87,7 @@ target_new(struct conf *conf) if (targ == NULL) xo_err(1, "calloc"); targ->t_conf = conf; + targ->t_dscp = -1; TAILQ_INSERT_TAIL(&conf->conf_targets, targ, t_next); return (targ); @@ -358,6 +359,7 @@ conf_from_target(struct iscsi_session_conf *conf, conf->isc_data_digest = ISCSI_DIGEST_CRC32C; else conf->isc_data_digest = ISCSI_DIGEST_NONE; + conf->isc_dscp = targ->t_dscp; } static int @@ -535,6 +537,9 @@ kernel_list(int iscsi_fd, const struct target *targ __ "Target portal:", conf->isc_target_addr); xo_emit("{L:/%-26s}{V:alias/%s}\n", "Target alias:", state->iss_target_alias); + if (conf->isc_dscp != -1) + xo_emit("{L:/%-26s}{V:dscp/0x%02x}\n", + "Target DSCP:", conf->isc_dscp); xo_close_container("target"); xo_open_container("auth"); Modified: head/usr.bin/iscsictl/iscsictl.h ============================================================================== --- head/usr.bin/iscsictl/iscsictl.h Fri Oct 9 14:03:45 2020 (r366572) +++ head/usr.bin/iscsictl/iscsictl.h Fri Oct 9 14:33:09 2020 (r366573) @@ -78,6 +78,7 @@ struct target { int t_session_type; int t_enable; int t_protocol; + int t_dscp; char *t_offload; char *t_user; char *t_secret; Modified: head/usr.bin/iscsictl/parse.y ============================================================================== --- head/usr.bin/iscsictl/parse.y Fri Oct 9 14:03:45 2020 (r366572) +++ head/usr.bin/iscsictl/parse.y Fri Oct 9 14:33:09 2020 (r366573) @@ -44,6 +44,8 @@ #include #include "iscsictl.h" +#include +#include extern FILE *yyin; extern char *yytext; @@ -61,7 +63,9 @@ extern void yyrestart(FILE *); %token AUTH_METHOD ENABLE HEADER_DIGEST DATA_DIGEST TARGET_NAME TARGET_ADDRESS %token INITIATOR_NAME INITIATOR_ADDRESS INITIATOR_ALIAS USER SECRET %token MUTUAL_USER MUTUAL_SECRET SEMICOLON SESSION_TYPE PROTOCOL OFFLOAD -%token IGNORED EQUALS OPENING_BRACKET CLOSING_BRACKET +%token IGNORED EQUALS OPENING_BRACKET CLOSING_BRACKET DSCP +%token AF11 AF12 AF13 AF21 AF22 AF23 AF31 AF32 AF33 AF41 AF42 AF43 +%token BE EF CS0 CS1 CS2 CS3 CS4 CS5 CS6 CS7 %union { @@ -127,6 +131,8 @@ target_entry: protocol | ignored + | + dscp ; target_name: TARGET_NAME EQUALS STR @@ -294,6 +300,48 @@ ignored: IGNORED EQUALS STR { xo_warnx("obsolete statement ignored at line %d", lineno); } + ; + +dscp: DSCP EQUALS STR + { + uint64_t tmp; + + if (strcmp($3, "0x") == 0) { + tmp = strtol($3 + 2, NULL, 16); + } else if (expand_number($3, &tmp) != 0) { + yyerror("invalid numeric value"); + free($3); + return(1); + } + if (tmp >= 0x40) { + yyerror("invalid dscp value"); + return(1); + } + + target->t_dscp = tmp; + } + | DSCP EQUALS BE { target->t_dscp = IPTOS_DSCP_CS0 >> 2 ; } + | DSCP EQUALS EF { target->t_dscp = IPTOS_DSCP_EF >> 2 ; } + | DSCP EQUALS CS0 { target->t_dscp = IPTOS_DSCP_CS0 >> 2 ; } + | DSCP EQUALS CS1 { target->t_dscp = IPTOS_DSCP_CS1 >> 2 ; } + | DSCP EQUALS CS2 { target->t_dscp = IPTOS_DSCP_CS2 >> 2 ; } + | DSCP EQUALS CS3 { target->t_dscp = IPTOS_DSCP_CS3 >> 2 ; } + | DSCP EQUALS CS4 { target->t_dscp = IPTOS_DSCP_CS4 >> 2 ; } + | DSCP EQUALS CS5 { target->t_dscp = IPTOS_DSCP_CS5 >> 2 ; } + | DSCP EQUALS CS6 { target->t_dscp = IPTOS_DSCP_CS6 >> 2 ; } + | DSCP EQUALS CS7 { target->t_dscp = IPTOS_DSCP_CS7 >> 2 ; } + | DSCP EQUALS AF11 { target->t_dscp = IPTOS_DSCP_AF11 >> 2 ; } + | DSCP EQUALS AF12 { target->t_dscp = IPTOS_DSCP_AF12 >> 2 ; } + | DSCP EQUALS AF13 { target->t_dscp = IPTOS_DSCP_AF13 >> 2 ; } + | DSCP EQUALS AF21 { target->t_dscp = IPTOS_DSCP_AF21 >> 2 ; } + | DSCP EQUALS AF22 { target->t_dscp = IPTOS_DSCP_AF22 >> 2 ; } + | DSCP EQUALS AF23 { target->t_dscp = IPTOS_DSCP_AF23 >> 2 ; } + | DSCP EQUALS AF31 { target->t_dscp = IPTOS_DSCP_AF31 >> 2 ; } + | DSCP EQUALS AF32 { target->t_dscp = IPTOS_DSCP_AF32 >> 2 ; } + | DSCP EQUALS AF33 { target->t_dscp = IPTOS_DSCP_AF33 >> 2 ; } + | DSCP EQUALS AF41 { target->t_dscp = IPTOS_DSCP_AF41 >> 2 ; } + | DSCP EQUALS AF42 { target->t_dscp = IPTOS_DSCP_AF42 >> 2 ; } + | DSCP EQUALS AF43 { target->t_dscp = IPTOS_DSCP_AF43 >> 2 ; } ; %% Modified: head/usr.bin/iscsictl/token.l ============================================================================== --- head/usr.bin/iscsictl/token.l Fri Oct 9 14:03:45 2020 (r366572) +++ head/usr.bin/iscsictl/token.l Fri Oct 9 14:33:09 2020 (r366573) @@ -68,6 +68,7 @@ enable { return ENABLE; } protocol { return PROTOCOL; } offload { return OFFLOAD; } port { return IGNORED; } +dscp { return DSCP; } MaxConnections { return IGNORED; } TargetAlias { return IGNORED; } TargetPortalGroupTag { return IGNORED; } @@ -86,6 +87,28 @@ tags { return IGNORED; } maxluns { return IGNORED; } sockbufsize { return IGNORED; } chapDigest { return IGNORED; } +af11 { return AF11; } +af12 { return AF12; } +af13 { return AF13; } +af21 { return AF21; } +af22 { return AF22; } +af23 { return AF23; } +af31 { return AF31; } +af32 { return AF32; } +af33 { return AF33; } +af41 { return AF41; } +af42 { return AF42; } +af43 { return AF43; } +be { return CS0; } +ef { return EF; } +cs0 { return CS0; } +cs1 { return CS1; } +cs2 { return CS2; } +cs3 { return CS3; } +cs4 { return CS4; } +cs5 { return CS5; } +cs6 { return CS6; } +cs7 { return CS7; } \"[^"]+\" { yylval.str = strndup(yytext + 1, strlen(yytext) - 2); return STR; } [a-zA-Z0-9\.\-_/\:\[\]]+ { yylval.str = strdup(yytext); return STR; } Modified: head/usr.sbin/iscsid/iscsid.c ============================================================================== --- head/usr.sbin/iscsid/iscsid.c Fri Oct 9 14:03:45 2020 (r366572) +++ head/usr.sbin/iscsid/iscsid.c Fri Oct 9 14:33:09 2020 (r366573) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -276,6 +277,25 @@ connection_new(int iscsi_fd, const struct iscsi_daemon if (setsockopt(conn->conn_socket, SOL_SOCKET, SO_SNDBUF, &sockbuf, sizeof(sockbuf)) == -1) log_warn("setsockopt(SO_SNDBUF) failed"); + if (conn->conn_conf.isc_dscp != -1) { + int tos = conn->conn_conf.isc_dscp << 2; + if (to_ai->ai_family == AF_INET) { + if (setsockopt(conn->conn_socket, + IPPROTO_IP, IP_TOS, + &tos, sizeof(tos)) == -1) + log_warn("setsockopt(IP_TOS) " + "failed for %s", + from_addr); + } else + if (to_ai->ai_family == AF_INET6) { + if (setsockopt(conn->conn_socket, + IPPROTO_IPV6, IPV6_TCLASS, + &tos, sizeof(tos)) == -1) + log_warn("setsockopt(IPV6_TCLASS) " + "failed for %s", + from_addr); + } + } if (from_ai != NULL) { error = bind(conn->conn_socket, from_ai->ai_addr, from_ai->ai_addrlen); From owner-svn-src-head@freebsd.org Fri Oct 9 14:45: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 83D653FCD1C; Fri, 9 Oct 2020 14:45:42 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C79qB2pznz4TgM; Fri, 9 Oct 2020 14:45:42 +0000 (UTC) (envelope-from mhorne@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 3FB8E1AE79; Fri, 9 Oct 2020 14:45:42 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 099EjfKb025071; Fri, 9 Oct 2020 14:45:41 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 099EjfFf025070; Fri, 9 Oct 2020 14:45:41 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202010091445.099EjfFf025070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 9 Oct 2020 14:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366574 - head/sys/riscv/conf X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/riscv/conf X-SVN-Commit-Revision: 366574 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, 09 Oct 2020 14:45:42 -0000 Author: mhorne Date: Fri Oct 9 14:45:41 2020 New Revision: 366574 URL: https://svnweb.freebsd.org/changeset/base/366574 Log: RISC-V LINT kernel config Create the RISC-V NOTES and LINT files. As of r366559, LINT configs are no longer generated but checked in to the tree. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D26502 Added: head/sys/riscv/conf/LINT (contents, props changed) head/sys/riscv/conf/NOTES (contents, props changed) Added: head/sys/riscv/conf/LINT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/conf/LINT Fri Oct 9 14:45:41 2020 (r366574) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +include "../../conf/NOTES" +include NOTES Added: head/sys/riscv/conf/NOTES ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/conf/NOTES Fri Oct 9 14:45:41 2020 (r366574) @@ -0,0 +1,96 @@ +# +# NOTES -- Lines that can be cut/pasted into kernel and hints configs. +# +# This file contains machine dependent kernel configuration notes. For +# machine independent notes, look in /sys/conf/NOTES. +# +# $FreeBSD$ +# + +cpu RISCV + +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support + +options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. +options KDTRACE_FRAME # Ensure frames are compiled in +options KDTRACE_HOOKS # Kernel DTrace hooks +options DDB_CTF # Kernel ELF linker loads CTF data +options FPE # Floating-point extension support +options RACCT_DEFAULT_TO_DISABLED # Set kern.racct.enable=0 by default +options INTRNG # Include INTRNG framework + +# RISC-V SBI console +device rcons + +# EXT_RESOURCES pseudo devices +options EXT_RESOURCES +device clk +device phy +device regulator +device syscon +device syscon_power +device riscv_syscon + +# Backlight subsystem +device backlight + +# VirtIO support +device virtio # Generic VirtIO bus (required) +device virtio_pci # VirtIO PCI device +device vtnet # VirtIO Ethernet device +device virtio_blk # VirtIO Block device +device virtio_mmio # VirtIO MMIO bus +device virtio_random # VirtIO Entropy device + +# NOTE: dtrace introduces CDDL-licensed components into the kernel +device dtrace # dtrace core +device dtraceall # include all dtrace modules + +# Serial (COM) ports +device uart_lowrisc # lowRISC UART driver +device uart_ns8250 # ns8250-type UART driver + +# RTC +device goldfish_rtc # QEMU RTC + +# Ethernet drivers +device xae # Xilinx AXI Ethernet MAC + +# DMA support +device xdma # DMA interface +device axidma # Xilinx AXI DMA Controller + +# SPI +device xilinx_spi # Xilinx AXI Quad-SPI Controller + +# SOC-specific +device fe310aon +device fu540spi +files "../sifive/files.sifive" + +# Flattened Device Tree +options FDT +makeoptions MODULES_EXTRA+="dtb/sifive" + +# FreeBSD/riscv didn't exist for these releases +nooptions COMPAT_FREEBSD4 +nooptions COMPAT_FREEBSD5 +nooptions COMPAT_FREEBSD6 +nooptions COMPAT_FREEBSD7 +nooptions COMPAT_FREEBSD9 +nooptions COMPAT_FREEBSD10 +nooptions COMPAT_FREEBSD11 + +# No support for remote GDB +nooptions GDB + +# riscv doesn't support inb/outb, so disable chipset probing which needs it +nooptions PPC_PROBE_CHIPSET + +# Makes assumptions about bus tags that aren't true on riscv +nodevice snd_cmi + +# Don't yet have hwpmc(4) +nodevice hwpmc +nooptions HWPMC_HOOKS From owner-svn-src-head@freebsd.org Fri Oct 9 15:14: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 CC19D3FC9E5; Fri, 9 Oct 2020 15:14:21 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C7BSF5PsFz4W0v; Fri, 9 Oct 2020 15:14:21 +0000 (UTC) (envelope-from gbe@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 984561BB0C; Fri, 9 Oct 2020 15:14:21 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 099FEL8I043334; Fri, 9 Oct 2020 15:14:21 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 099FEJKF043324; Fri, 9 Oct 2020 15:14:19 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010091514.099FEJKF043324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Fri, 9 Oct 2020 15:14:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366575 - in head: libexec/rtld-elf share/man/man4 share/man/man4/man4.i386 share/man/man4/man4.powerpc stand/defaults stand/forth tools/tools/ether_reflect tools/tools/vimage X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: in head: libexec/rtld-elf share/man/man4 share/man/man4/man4.i386 share/man/man4/man4.powerpc stand/defaults stand/forth tools/tools/ether_reflect tools/tools/vimage X-SVN-Commit-Revision: 366575 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, 09 Oct 2020 15:14:21 -0000 Author: gbe (doc committer) Date: Fri Oct 9 15:14:19 2020 New Revision: 366575 URL: https://svnweb.freebsd.org/changeset/base/366575 Log: Fix a few mandoc issues - whitespace at end of input line - skipping paragraph macro: Pp at the end of Sh - new sentence, new line - consider using OS macro: Fx - AUTHORS section without An macro - skipping paragraph macro: Pp before Ss Modified: head/libexec/rtld-elf/rtld.1 head/share/man/man4/acpi_ibm.4 head/share/man/man4/man4.i386/glxiic.4 head/share/man/man4/man4.powerpc/smu.4 head/share/man/man4/ng_checksum.4 head/stand/defaults/loader.conf.5 head/stand/forth/beastie.4th.8 head/stand/forth/brand.4th.8 head/tools/tools/ether_reflect/ether_reflect.1 head/tools/tools/vimage/vimage.8 Modified: head/libexec/rtld-elf/rtld.1 ============================================================================== --- head/libexec/rtld-elf/rtld.1 Fri Oct 9 14:45:41 2020 (r366574) +++ head/libexec/rtld-elf/rtld.1 Fri Oct 9 15:14:19 2020 (r366575) @@ -360,7 +360,7 @@ In the direct execution mode, .Nm emulates verification of the binary execute permission for the current user. -This is done to avoid breaking user expectations in naively restricted +This is done to avoid breaking user expectations in naively restricted execution environments. The verification only uses Unix .Dv DACs , Modified: head/share/man/man4/acpi_ibm.4 ============================================================================== --- head/share/man/man4/acpi_ibm.4 Fri Oct 9 14:45:41 2020 (r366574) +++ head/share/man/man4/acpi_ibm.4 Fri Oct 9 15:14:19 2020 (r366575) @@ -274,7 +274,7 @@ Speaker volume. .It Va dev.acpi_ibm.0.mute Indicates, whether the speakers are muted or not. .It Va dev.acpi_ibm.0.mic_mute -Indicates, whether the microphone led (present on some model) is on or not. +Indicates, whether the microphone led (present on some model) is on or not. Note that this does not mean that the microphone input is muted. .It Va dev.acpi_ibm.0.thinklight Indicates, whether the ThinkLight keyboard light is activated or not. @@ -452,8 +452,8 @@ case ${NOTIFY} in if [ $LEVEL -eq 0 ]; then sysctl dev.acpi_ibm.0.mic_led=1 mixer rec 0 - fi - if [ $LEVEL -eq 1 ]; then + fi + if [ $LEVEL -eq 1 ]; then sysctl dev.acpi_ibm.0.mic_led=0 mixer rec 30 fi Modified: head/share/man/man4/man4.i386/glxiic.4 ============================================================================== --- head/share/man/man4/man4.i386/glxiic.4 Fri Oct 9 14:45:41 2020 (r366574) +++ head/share/man/man4/man4.i386/glxiic.4 Fri Oct 9 15:14:19 2020 (r366575) @@ -50,8 +50,8 @@ glxiic_load="YES" The .Nm driver supports the System Management Bus controller of the Geode LX -series CS5536 Companion Device. The Geode LX is a member of the AMD -Geode family of integrated x86 system chips. +series CS5536 Companion Device. +The Geode LX is a member of the AMD Geode family of integrated x86 system chips. .Pp Although AMD refers to this device as a System Management Bus (SMBus) controller, it is really an I2C controller (it lacks SMBus ALERT# and @@ -70,17 +70,18 @@ and tunable: .Bl -tag -width indent .It Va dev.glxiic.0.timeout -This variable controls the I2C bus timeout in milliseconds. The -default timeout is 35 milliseconds. A value of zero disables the -timeout. +This variable controls the I2C bus timeout in milliseconds. +The default timeout is 35 milliseconds. +A value of zero disables the timeout. .El .Sh CAVEAT The .Nm driver uses the interrupt line number configured by the board firmware -by default. If no interrupt line number has been configured by the -board firmware (or to override the interrupt line number configured by -board firmware), place the following line in +by default. +If no interrupt line number has been configured by the board firmware +(or to override the interrupt line number configured by board firmware), +place the following line in .Xr device.hints 5 : .Bd -ragged -offset indent hint.glxiic.0.irq="10" Modified: head/share/man/man4/man4.powerpc/smu.4 ============================================================================== --- head/share/man/man4/man4.powerpc/smu.4 Fri Oct 9 14:45:41 2020 (r366574) +++ head/share/man/man4/man4.powerpc/smu.4 Fri Oct 9 15:14:19 2020 (r366575) @@ -60,45 +60,47 @@ Apple System Management Unit .Sh THERMAL MANAGEMENT The .Nm -driver provides basic automatic thermal management. Without a userspace -daemon providing more advanced control, the driver will attempt to maintain -system temperatures in a conservative range through coarse-grained control of -system cooling devices (see below). Automatic kernel-level thermal control -will take over if more than 3 seconds elapses between userspace cooling -setting adjustments. +driver provides basic automatic thermal management. +Without a userspace daemon providing more advanced control, the driver will +attempt to maintain system temperatures in a conservative range through +coarse-grained control of system cooling devices (see below). +Automatic kernel-level thermal control will take over if more than 3 +seconds elapses between userspace cooling setting adjustments. .Sh SYSCTL VARIABLES The .Nm driver provides power management services and thermal readout through a sysctl interface. -The following sysctls can be used to control the -power management behavior and to examine current system power and -thermal conditions. +The following sysctls can be used to control the power management behavior +and to examine current system power and thermal conditions. .Bl -tag -width indent .It Va dev.smu.%d.server_mode Restart after power failure behavior (1 causes system to reboot after power cut, 0 causes system to remain off). .It Va dev.smu.%d.target_temp -Target system temperature, in degrees Celsius. The +Target system temperature, in degrees Celsius. +The .Nm driver will attempt to adjust fans to maintain the temperature of the warmest component in the system at or below this level. .It Va dev.smu.%d.critical_temp -System critical temperature, in degrees Celsius. If any component in -the system exceeds this temperature, the machine will be shut down within -500 ms. +System critical temperature, in degrees Celsius. +If any component in the system exceeds this temperature, the machine +will be shut down within 500 ms. .It Va dev.smu.%d.fans.%s.minrpm Minimum allowed speed for this fan. .It Va dev.smu.%d.fans.%s.maxrpm Maximum allowed speed for this fan. .It Va dev.smu.%d.fans.%s.rpm -Current speed for this fan. The fan speed can be adjusted by changing this -sysctl. If more than 3 seconds elapses between fan speed adjustments, the -kernel will resume automatic control of the fan. +Current speed for this fan. +The fan speed can be adjusted by changing this sysctl. +If more than 3 seconds elapses between fan speed adjustments, the kernel will +resume automatic control of the fan. .It Va dev.smu.%d.sensors.%s -Current reading from this sensor. Four sensor types are supported. Temperature -sensors are in units of degrees Celsius, current sensors in milliamps, voltage -sensors in millivolts, and power sensors in milliwatts. +Current reading from this sensor. +Four sensor types are supported. +Temperature sensors are in units of degrees Celsius, current sensors in +milliamps, voltage sensors in millivolts, and power sensors in milliwatts. .El .Sh LED INTERFACE The Modified: head/share/man/man4/ng_checksum.4 ============================================================================== --- head/share/man/man4/ng_checksum.4 Fri Oct 9 14:45:41 2020 (r366574) +++ head/share/man/man4/ng_checksum.4 Fri Oct 9 15:14:19 2020 (r366575) @@ -44,7 +44,8 @@ This node type has two hooks: Packets received on this hook are processed according to settings specified in config and then forwarded to the .Ar out -hook, if it exists and is connected. Otherwise they are reflected back to the +hook, if it exists and is connected. +Otherwise they are reflected back to the .Ar in hook. .It Va out @@ -58,13 +59,15 @@ This node type supports the generic control messages, .It Dv NGM_CHECKSUM_SETDLT Pq Ic setdlt Sets the data link type on the .Va in -hook. Currently, supported types are +hook. +Currently, supported types are .Cm DLT_RAW (raw IP datagrams) and .Cm DLT_EN10MB (Ethernet). DLT_ definitions can be found in the .In net/bpf.h -header. Currently used values are +header. +Currently used values are .Cm DLT_EN10MB = 1 and .Cm DLT_RAW @@ -74,7 +77,8 @@ This control message obtains the data link type on the .Va in hook. .It Dv NGM_CHECKSUM_SETCONFIG Pq Ic setconfig -Sets the node configuration. The following +Sets the node configuration. +The following .Vt "struct ng_checksum_config" must be supplied as an argument: .Bd -literal -offset 4n Modified: head/stand/defaults/loader.conf.5 ============================================================================== --- head/stand/defaults/loader.conf.5 Fri Oct 9 14:45:41 2020 (r366574) +++ head/stand/defaults/loader.conf.5 Fri Oct 9 15:14:19 2020 (r366575) @@ -38,7 +38,6 @@ it you can specify the kernel to be booted, parameters it, and additional modules to be loaded; and generally set all variables described in .Xr loader 8 . -.Pp .Sh SYNTAX Though .Nm Ns 's Modified: head/stand/forth/beastie.4th.8 ============================================================================== --- head/stand/forth/beastie.4th.8 Fri Oct 9 14:45:41 2020 (r366574) +++ head/stand/forth/beastie.4th.8 Fri Oct 9 15:14:19 2020 (r366575) @@ -103,7 +103,8 @@ The default behavior is to not delay. The environment variables that effect its behavior are: .Bl -tag -width bootfile -offset indent .It Va loader_logo -Selects the desired logo in the beastie boot menu. Possible values are: +Selects the desired logo in the beastie boot menu. +Possible values are: .Dq Li fbsdbw , .Dq Li beastie , .Dq Li beastiebw , @@ -112,9 +113,11 @@ Selects the desired logo in the beastie boot menu. Pos (default), and .Dq Li none . .It Va loader_logo_x -Sets the desired column position of the logo. Default is 46. +Sets the desired column position of the logo. +Default is 46. .It Va loader_logo_y -Sets the desired row position of the logo. Default is 4. +Sets the desired row position of the logo. +Default is 4. .It Va beastie_disable If set to .Dq YES , @@ -122,9 +125,10 @@ the beastie boot menu will be skipped. The beastie boot menu is always skipped if running non-x86 hardware. .It Va loader_delay If set to a number higher than zero, introduces a delay before starting the -beastie boot menu. During the delay the user can press either Ctrl-C to skip -the menu or ENTER to proceed to the menu. The default is to not delay when -loading the menu. +beastie boot menu. +During the delay the user can press either Ctrl-C to skip the menu or ENTER +to proceed to the menu. +The default is to not delay when loading the menu. .El .Sh FILES .Bl -tag -width /boot/loader.4th -compact Modified: head/stand/forth/brand.4th.8 ============================================================================== --- head/stand/forth/brand.4th.8 Fri Oct 9 14:45:41 2020 (r366574) +++ head/stand/forth/brand.4th.8 Fri Oct 9 15:14:19 2020 (r366575) @@ -81,14 +81,17 @@ The default values are 2 (x) and 1 (y). The environment variables that effect its behavior are: .Bl -tag -width bootfile -offset indent .It Va loader_brand -Selects the desired brand in the beastie boot menu. Possible values are: +Selects the desired brand in the beastie boot menu. +Possible values are: .Dq Li fbsd (default) or .Dq Li none . .It Va loader_brand_x -Sets the desired column position of the brand. Default is 2. +Sets the desired column position of the brand. +Default is 2. .It Va loader_brand_y -Sets the desired row position of the brand. Default is 1. +Sets the desired row position of the brand. +Default is 1. .El .Sh FILES .Bl -tag -width /boot/loader.4th -compact Modified: head/tools/tools/ether_reflect/ether_reflect.1 ============================================================================== --- head/tools/tools/ether_reflect/ether_reflect.1 Fri Oct 9 14:45:41 2020 (r366574) +++ head/tools/tools/ether_reflect/ether_reflect.1 Fri Oct 9 15:14:19 2020 (r366575) @@ -45,11 +45,13 @@ command implements a simple ethernet packet reflector .Xr PCAP 3 library and .Xr bpf 4 , -the Berkeley Packet Filter. The program is useful primarily to test -the low level round trip time of packets through an Ethernet interface -and/or a switch. Network protocols, such as IP, and the network stack -in general are never invoked, only the device driver that implements -the particular interface is executed. As the +the Berkeley Packet Filter. +The program is useful primarily to test the low level round trip time +of packets through an Ethernet interface and/or a switch. +Network protocols, such as IP, and the network stack in general are never +invoked, only the device driver that implements the particular interface +is executed. +As the .Nm command uses the .Xr bpf 4 @@ -67,13 +69,14 @@ ether type for driver testing. .It Fl i Ar interface Network interface, which can be found with ifconfig(1). .It Fl t Ar timeout -The time, in milliseconds, to wait for a packet. Lower times decrease -latency at the cost of CPU. +The time, in milliseconds, to wait for a packet. +Lower times decrease latency at the cost of CPU. .It Fl p -Set the device into promiscuous mode before testing. This is not -usually necessary. +Set the device into promiscuous mode before testing. +This is not usually necessary. .It Fl d -Debug output. Print various small pieces of debug information. +Debug output. +Print various small pieces of debug information. .El .Sh EXAMPLES The following is an example of a typical usage @@ -84,7 +87,8 @@ command: .Dl "ether_reflect -i em0 -t 1" .Pp Reflect all test packets, those with an ether type of 0x8822, which -are seen on ineterface em0. The timeout is 1 millisecond. +are seen on ineterface em0. +The timeout is 1 millisecond. .Pp .Dl "ether_reflect -i em0 -a 00:00:00:aa:bb:cc -t 1" .Pp Modified: head/tools/tools/vimage/vimage.8 ============================================================================== --- head/tools/tools/vimage/vimage.8 Fri Oct 9 14:45:41 2020 (r366574) +++ head/tools/tools/vimage/vimage.8 Fri Oct 9 15:14:19 2020 (r366575) @@ -65,20 +65,17 @@ and . .Ss Overview A virtual image or vimage is a jail with its own independent network -stack instance. Every process, socket and network interface present -in the system is always attached to one, and only one, virtual network -stack instance (vnet). -During system bootup sequence a default vnet -is created to which all the configured interfaces and user processes -are initially attached. -Assuming that enough system resources are -are available, a user with sufficient privileges can create and manage -a hierarchy of subordinated virtual images. +stack instance. +Every process, socket and network interface present in the system is always +attached to one, and only one, virtual network stack instance (vnet). +During system bootup sequence a default vnet is created to which all the configured +interfaces and user processes are initially attached. +Assuming that enough system resources are are available, a user with sufficient +privileges can create and manage a hierarchy of subordinated virtual images. The .Nm command allows for creation, deletion and monitoring of virtual images, -as well as for execution of arbitrary processes in a targeted virtual -image. +as well as for execution of arbitrary processes in a targeted virtual image. .Ss Invocation If invoked with no modifiers, the .Nm @@ -109,12 +106,13 @@ using the same syntax as with the -c form of the comma Delete the virtual image .Ar vname . No processes and/or sockets should exist in the target virtual image -in order for the delete request to succeed. Non-loopback interfaces -residing in the target virtual image will be reassigned to the virtual -image's parent. +in order for the delete request to succeed. +Non-loopback interfaces residing in the target virtual image +will be reassigned to the virtual image's parent. .It Fl l -List the properties and statistics for virtual images one level -below the current one in the hierarchy. If an optional argument +List the properties and statistics for virtual images one level below +the current one in the hierarchy. +If an optional argument .Ar vname is provided, only the information regarding the target virtual image .Ar vname @@ -183,11 +181,12 @@ command exits 0 on success, and >0 if an error occurs. .Xr jls 8 .Sh HISTORY Network stack virtualization framework first appeared as a patchset -against the FreeBSD 4.7 kernel in 2002, and was maintained outside -of the main FreeBSD tree. +against the +.Fx 4.7 +kernel in 2002, and was maintained outside of the main FreeBSD tree. As a result of a project sponsored by the FreeBSD Foundation and -Stiching NLNet, integrated virtualized network stack first appeared -in FreeBSD 8.0. +Stiching NLNet, integrated virtualized network stack first appeared in +.Fx 8.0 . .Sh AUTHORS .An Marko Zec Aq Mt zec@fer.hr .Sh BUGS From owner-svn-src-head@freebsd.org Fri Oct 9 15:19: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 339633FD2B9; Fri, 9 Oct 2020 15:19:30 +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 4C7BZB0LYgz4W1x; Fri, 9 Oct 2020 15:19:30 +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 DE9A01BA85; Fri, 9 Oct 2020 15:19:29 +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 099FJT15043609; Fri, 9 Oct 2020 15:19:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 099FJTtR043608; Fri, 9 Oct 2020 15:19:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010091519.099FJTtR043608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 9 Oct 2020 15:19:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366576 - head/usr.sbin/syslogd X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.sbin/syslogd X-SVN-Commit-Revision: 366576 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, 09 Oct 2020 15:19:30 -0000 Author: markj Date: Fri Oct 9 15:19:29 2020 New Revision: 366576 URL: https://svnweb.freebsd.org/changeset/base/366576 Log: syslogd: Avoid trimming host names in RFC 5424 mode RFC 5424 says that implementations should log hostnames in FQDN format. Only trim host names in RFC 3164 mode. PR: 250014 Submitted by: Dmitry Wagin MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D26644 Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Fri Oct 9 15:14:19 2020 (r366575) +++ head/usr.sbin/syslogd/syslogd.c Fri Oct 9 15:19:29 2020 (r366576) @@ -2300,7 +2300,9 @@ cvthname(struct sockaddr *f) hl = strlen(hname); if (hl > 0 && hname[hl-1] == '.') hname[--hl] = '\0'; - trimdomain(hname, hl); + /* RFC 5424 prefers logging FQDNs. */ + if (RFC3164OutputFormat) + trimdomain(hname, hl); return (hname); } @@ -2927,7 +2929,9 @@ cfline(const char *line, const char *prog, const char hl = strlen(f->f_host); if (hl > 0 && f->f_host[hl-1] == '.') f->f_host[--hl] = '\0'; - trimdomain(f->f_host, hl); + /* RFC 5424 prefers logging FQDNs. */ + if (RFC3164OutputFormat) + trimdomain(f->f_host, hl); } /* save program name if any */ From owner-svn-src-head@freebsd.org Fri Oct 9 15:27: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 31CA83FD2DA; Fri, 9 Oct 2020 15:27: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 4C7Blc0JQNz4W9b; Fri, 9 Oct 2020 15:27: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 DD2A81BAA3; Fri, 9 Oct 2020 15:27:39 +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 099FRdhj049513; Fri, 9 Oct 2020 15:27:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 099FRcVh049505; Fri, 9 Oct 2020 15:27:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202010091527.099FRcVh049505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 9 Oct 2020 15:27:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366577 - in head/usr.bin/col: . tests X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/usr.bin/col: . tests X-SVN-Commit-Revision: 366577 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, 09 Oct 2020 15:27:40 -0000 Author: markj Date: Fri Oct 9 15:27:37 2020 New Revision: 366577 URL: https://svnweb.freebsd.org/changeset/base/366577 Log: col(1): Fix a couple of bugs - When flushing extra lines after all input has been processed, make sure that local state is reinitialized correctly. - When -f is specified, make sure to end output with a full newline. - Fix some style issues and update comments. - Add some regression tests. PR: 249308 Submitted by: Yang Zhong MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26536 Added: head/usr.bin/col/tests/hlf.in (contents, props changed) head/usr.bin/col/tests/hlf2.in (contents, props changed) head/usr.bin/col/tests/nl.in (contents, props changed) head/usr.bin/col/tests/nl2.in (contents, props changed) head/usr.bin/col/tests/nl3.in (contents, props changed) head/usr.bin/col/tests/rlf3.in (contents, props changed) Modified: head/usr.bin/col/col.c head/usr.bin/col/tests/Makefile head/usr.bin/col/tests/col_test.sh (contents, props changed) Modified: head/usr.bin/col/col.c ============================================================================== --- head/usr.bin/col/col.c Fri Oct 9 15:19:29 2020 (r366576) +++ head/usr.bin/col/col.c Fri Oct 9 15:27:37 2020 (r366577) @@ -100,7 +100,7 @@ struct line_str { }; static void addto_lineno(int *, int); -static LINE *alloc_line(void); +static LINE *alloc_line(void); static void dowarn(int); static void flush_line(LINE *); static void flush_lines(int); @@ -109,7 +109,7 @@ static void free_line(LINE *); static void usage(void); static CSET last_set; /* char_set of last char printed */ -static LINE *lines; +static LINE *lines; static int compress_spaces; /* if doing space -> tab conversion */ static int fine; /* if `fine' resolution (half lines) */ static int max_bufd_lines; /* max # of half lines to keep in memory */ @@ -340,8 +340,16 @@ main(int argc, char **argv) } if (ferror(stdin)) err(1, NULL); - if (extra_lines) + if (extra_lines) { + /* + * Extra lines only exist if no lines have been flushed + * yet. This means that 'lines' must point to line zero + * after we flush the extra lines. + */ flush_lines(extra_lines); + l = lines; + this_line = 0; + } /* goto the last line that had a character on it */ for (; l->l_next; l = l->l_next) @@ -353,14 +361,22 @@ main(int argc, char **argv) PUTC(SI); /* flush out the last few blank lines */ - if (max_line > this_line) - nblank_lines = max_line - this_line; - if (max_line & 1) - nblank_lines++; + if (max_line >= this_line) + nblank_lines = max_line - this_line + (max_line & 1); + if (nblank_lines == 0) + /* end with a newline even if the source doesn't */ + nblank_lines = 2; flush_blanks(); exit(0); } +/* + * Prints the first 'nflush' lines. Printed lines are freed. + * After this function returns, 'lines' points to the first + * of the remaining lines, and 'nblank_lines' will have the + * number of half line feeds between the final flushed line + * and the first remaining line. + */ static void flush_lines(int nflush) { @@ -372,11 +388,10 @@ flush_lines(int nflush) if (l->l_line) { flush_blanks(); flush_line(l); + free(l->l_line); } - if (l->l_line || l->l_next) + if (l->l_next) nblank_lines++; - if (l->l_line) - (void)free(l->l_line); free_line(l); } if (lines) @@ -384,9 +399,8 @@ flush_lines(int nflush) } /* - * Print a number of newline/half newlines. If fine flag is set, nblank_lines - * is the number of half line feeds, otherwise it is the number of whole line - * feeds. + * Print a number of newline/half newlines. + * nblank_lines is the number of half line feeds. */ static void flush_blanks(void) Modified: head/usr.bin/col/tests/Makefile ============================================================================== --- head/usr.bin/col/tests/Makefile Fri Oct 9 15:19:29 2020 (r366576) +++ head/usr.bin/col/tests/Makefile Fri Oct 9 15:27:37 2020 (r366577) @@ -4,8 +4,14 @@ PACKAGE= tests ATF_TESTS_SH= col_test -${PACKAGE}FILES+= \ +${PACKAGE}FILES+= \ + hlf.in \ + hlf2.in \ + nl.in \ + nl2.in \ + nl3.in \ rlf.in \ - rlf2.in + rlf2.in \ + rlf3.in .include Modified: head/usr.bin/col/tests/col_test.sh ============================================================================== --- head/usr.bin/col/tests/col_test.sh Fri Oct 9 15:19:29 2020 (r366576) +++ head/usr.bin/col/tests/col_test.sh Fri Oct 9 15:27:37 2020 (r366577) @@ -1,5 +1,44 @@ # $FreeBSD$ +atf_test_case nl + +nl_head() +{ + atf_set "descr" "testing just newlines" +} +nl_body() +{ + atf_check \ + -o inline:"a\nb\n" \ + -e empty \ + -s exit:0 \ + col < $(atf_get_srcdir)/nl.in + + atf_check \ + -o inline:"a\nb\n" \ + -e empty \ + -s exit:0 \ + col -f < $(atf_get_srcdir)/nl.in + + atf_check \ + -o inline:"a\nb\n" \ + -e empty \ + -s exit:0 \ + col < $(atf_get_srcdir)/nl2.in + + atf_check \ + -o inline:"a\nb\n" \ + -e empty \ + -s exit:0 \ + col -f < $(atf_get_srcdir)/nl2.in + + atf_check \ + -o inline:"a\n\nb\n\n" \ + -e empty \ + -s exit:0 \ + col < $(atf_get_srcdir)/nl3.in +} + atf_test_case rlf rlf_head() @@ -25,9 +64,50 @@ rlf_body() -e empty \ -s exit:0 \ col -x < $(atf_get_srcdir)/rlf2.in + + atf_check \ + -o inline:" b\na\n" \ + -e empty \ + -s exit:0 \ + col < $(atf_get_srcdir)/rlf3.in } +atf_test_case hlf + +hlf_head() +{ + atf_set "descr" "testing half line feed" +} +hlf_body() +{ + atf_check \ + -o inline:"a f\naf\n" \ + -e empty \ + -s exit:0 \ + col < $(atf_get_srcdir)/hlf.in + + atf_check \ + -o inline:"a f9 f9 a\n" \ + -e empty \ + -s exit:0 \ + col -f < $(atf_get_srcdir)/hlf.in + + atf_check \ + -o inline:"a\n f\n" \ + -e empty \ + -s exit:0 \ + col < $(atf_get_srcdir)/hlf2.in + + atf_check \ + -o inline:"a9 f\n9" \ + -e empty \ + -s exit:0 \ + col -f < $(atf_get_srcdir)/hlf2.in +} + atf_init_test_cases() { + atf_add_test_case nl atf_add_test_case rlf + atf_add_test_case hlf } Added: head/usr.bin/col/tests/hlf.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/col/tests/hlf.in Fri Oct 9 15:27:37 2020 (r366577) @@ -0,0 +1,2 @@ +a +a8f8f Added: head/usr.bin/col/tests/hlf2.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/col/tests/hlf2.in Fri Oct 9 15:27:37 2020 (r366577) @@ -0,0 +1 @@ +a9f Added: head/usr.bin/col/tests/nl.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/col/tests/nl.in Fri Oct 9 15:27:37 2020 (r366577) @@ -0,0 +1,2 @@ +a +b Added: head/usr.bin/col/tests/nl2.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/col/tests/nl2.in Fri Oct 9 15:27:37 2020 (r366577) @@ -0,0 +1,2 @@ +a +b \ No newline at end of file Added: head/usr.bin/col/tests/nl3.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/col/tests/nl3.in Fri Oct 9 15:27:37 2020 (r366577) @@ -0,0 +1,4 @@ +a + +b + Added: head/usr.bin/col/tests/rlf3.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/col/tests/rlf3.in Fri Oct 9 15:27:37 2020 (r366577) @@ -0,0 +1 @@ +a b From owner-svn-src-head@freebsd.org Fri Oct 9 15:29: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 9122E3FD42E; Fri, 9 Oct 2020 15:29:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C7BnG3Ggkz4WmS; Fri, 9 Oct 2020 15:29:06 +0000 (UTC) (envelope-from imp@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 539641B74A; Fri, 9 Oct 2020 15:29:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 099FT6eR049636; Fri, 9 Oct 2020 15:29:06 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 099FT6Ab049635; Fri, 9 Oct 2020 15:29:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010091529.099FT6Ab049635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 9 Oct 2020 15:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366578 - head/sbin/devd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/devd X-SVN-Commit-Revision: 366578 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, 09 Oct 2020 15:29:06 -0000 Author: imp Date: Fri Oct 9 15:29:05 2020 New Revision: 366578 URL: https://svnweb.freebsd.org/changeset/base/366578 Log: Avoid using single quotes in arguments to logger. Single quotes interfere with the workaround put in with r335753 and aren't necessary in this case. I believe that all the underling issues with r335753 have been corrected, but need to do more extensive followup before reverting it as a bad idea. PR: 240411 MFC After: 2 days (to give it time to get into 12.2) Modified: head/sbin/devd/zfs.conf Modified: head/sbin/devd/zfs.conf ============================================================================== --- head/sbin/devd/zfs.conf Fri Oct 9 15:27:37 2020 (r366577) +++ head/sbin/devd/zfs.conf Fri Oct 9 15:29:05 2020 (r366578) @@ -5,73 +5,73 @@ notify 10 { match "system" "ZFS"; match "type" "ereport.fs.zfs.checksum"; - action "logger -p local7.warn -t ZFS 'checksum mismatch, zpool=$pool path=$vdev_path offset=$zio_offset size=$zio_size'"; + action "logger -p local7.warn -t ZFS checksum mismatch, zpool=$pool path=$vdev_path offset=$zio_offset size=$zio_size"; }; notify 10 { match "system" "ZFS"; match "type" "ereport.fs.zfs.io"; - action "logger -p local7.warn -t ZFS 'vdev I/O failure, zpool=$pool path=$vdev_path offset=$zio_offset size=$zio_size error=$zio_err'"; + action "logger -p local7.warn -t ZFS vdev I/O failure, zpool=$pool path=$vdev_path offset=$zio_offset size=$zio_size error=$zio_err"; }; notify 10 { match "system" "ZFS"; match "type" "ereport.fs.zfs.data"; - action "logger -p local7.warn -t ZFS 'pool I/O failure, zpool=$pool error=$zio_err'"; + action "logger -p local7.warn -t ZFS pool I/O failure, zpool=$pool error=$zio_err"; }; notify 10 { match "system" "ZFS"; match "type" "ereport.fs.zfs.zpool"; - action "logger -p local7.err -t ZFS 'failed to load zpool $pool'"; + action "logger -p local7.err -t ZFS failed to load zpool $pool"; }; notify 10 { match "system" "ZFS"; match "type" "ereport.fs.zfs.vdev\..*"; - action "logger -p local7.err -t ZFS 'vdev problem, zpool=$pool path=$vdev_path type=$type'"; + action "logger -p local7.err -t ZFS vdev problem, zpool=$pool path=$vdev_path type=$type"; }; notify 10 { match "system" "ZFS"; match "type" "ereport.fs.zfs.io_failure"; - action "logger -p local7.alert -t ZFS 'catastrophic pool I/O failure, zpool=$pool'"; + action "logger -p local7.alert -t ZFS catastrophic pool I/O failure, zpool=$pool"; }; notify 10 { match "system" "ZFS"; match "type" "ereport.fs.zfs.probe_failure"; - action "logger -p local7.err -t ZFS 'vdev probe failure, zpool=$pool path=$vdev_path'"; + action "logger -p local7.err -t ZFS vdev probe failure, zpool=$pool path=$vdev_path"; }; notify 10 { match "system" "ZFS"; match "type" "ereport.fs.zfs.log_replay"; - action "logger -p local7.err -t ZFS 'pool log replay failure, zpool=$pool'"; + action "logger -p local7.err -t ZFS pool log replay failure, zpool=$pool"; }; notify 10 { match "system" "ZFS"; match "type" "ereport.fs.zfs.config_cache_write"; - action "logger -p local7.warn -t ZFS 'failed to write zpool.cache, zpool=$pool'"; + action "logger -p local7.warn -t ZFS failed to write zpool.cache, zpool=$pool"; }; notify 10 { match "system" "ZFS"; match "type" "resource.fs.zfs.removed"; - action "logger -p local7.notice -t ZFS 'vdev is removed, pool_guid=$pool_guid vdev_guid=$vdev_guid'"; + action "logger -p local7.notice -t ZFS vdev is removed, pool_guid=$pool_guid vdev_guid=$vdev_guid"; }; notify 10 { match "system" "ZFS"; match "type" "resource.fs.zfs.autoreplace"; - action "logger -p local7.info -t ZFS 'autoreplace is configured for vdev, pool_guid=$pool_guid vdev_guid=$vdev_guid'"; + action "logger -p local7.info -t ZFS autoreplace is configured for vdev, pool_guid=$pool_guid vdev_guid=$vdev_guid"; }; notify 10 { match "system" "ZFS"; match "type" "resource.fs.zfs.statechange"; - action "logger -p local7.notice -t ZFS 'vdev state changed, pool_guid=$pool_guid vdev_guid=$vdev_guid'"; + action "logger -p local7.notice -t ZFS vdev state changed, pool_guid=$pool_guid vdev_guid=$vdev_guid"; }; From owner-svn-src-head@freebsd.org Fri Oct 9 15:45: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 0A5303FDC48; Fri, 9 Oct 2020 15:45:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C7C8G6V7Hz4XpG; Fri, 9 Oct 2020 15:45:34 +0000 (UTC) (envelope-from imp@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 C29001BCC6; Fri, 9 Oct 2020 15:45:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 099FjYS4062102; Fri, 9 Oct 2020 15:45:34 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 099FjY2F062101; Fri, 9 Oct 2020 15:45:34 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202010091545.099FjY2F062101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 9 Oct 2020 15:45:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366579 - head/sbin/devd X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/devd X-SVN-Commit-Revision: 366579 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, 09 Oct 2020 15:45:35 -0000 Author: imp Date: Fri Oct 9 15:45:34 2020 New Revision: 366579 URL: https://svnweb.freebsd.org/changeset/base/366579 Log: Remove gratuitous use of '' around arguments There's no need to use ' here, so remove it. This use causes no problems, but is a bad example. Modified: head/sbin/devd/devd.conf Modified: head/sbin/devd/devd.conf ============================================================================== --- head/sbin/devd/devd.conf Fri Oct 9 15:29:05 2020 (r366578) +++ head/sbin/devd/devd.conf Fri Oct 9 15:45:34 2020 (r366579) @@ -229,7 +229,7 @@ notify 10 { match "system" "ACPI"; match "subsystem" "Thermal"; match "notify" "0xcc"; - action "logger -p kern.emerg 'WARNING: system temperature too high, shutting down soon!'"; + action "logger -p kern.emerg WARNING: system temperature too high, shutting down soon!"; }; # User requested suspend, so perform preparation steps and then execute From owner-svn-src-head@freebsd.org Fri Oct 9 15:50: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 1695D3FDEA8; Fri, 9 Oct 2020 15:50:51 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C7CGL6sSKz4Xf1; Fri, 9 Oct 2020 15:50:50 +0000 (UTC) (envelope-from gbe@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 B57271BCC9; Fri, 9 Oct 2020 15:50:50 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 099Foo39063004; Fri, 9 Oct 2020 15:50:50 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 099FooNU062998; Fri, 9 Oct 2020 15:50:50 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010091550.099FooNU062998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Fri, 9 Oct 2020 15:50:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366580 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 366580 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, 09 Oct 2020 15:50:51 -0000 Author: gbe (doc committer) Date: Fri Oct 9 15:50:50 2020 New Revision: 366580 URL: https://svnweb.freebsd.org/changeset/base/366580 Log: bpf(4): Update the man page to reflect reality PR: 131918 Submitted by: guy at alum dot mit dot edu Reviewed by: gnn, gbe Approved by: gnn MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25993 Modified: head/share/man/man4/bpf.4 Modified: head/share/man/man4/bpf.4 ============================================================================== --- head/share/man/man4/bpf.4 Fri Oct 9 15:45:34 2020 (r366579) +++ head/share/man/man4/bpf.4 Fri Oct 9 15:50:50 2020 (r366580) @@ -49,7 +49,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 21, 2016 +.Dd October 9, 2020 .Dt BPF 4 .Os .Sh NAME @@ -73,12 +73,6 @@ ioctl. A given interface can be shared by multiple listeners, and the filter underlying each descriptor will see an identical packet stream. .Pp -A separate device file is required for each minor device. -If a file is in use, the open will fail and -.Va errno -will be set to -.Er EBUSY . -.Pp Associated with each open instance of a .Nm file is a user-settable packet filter. @@ -86,19 +80,6 @@ Whenever a packet is received by an interface, all file descriptors listening on that interface apply their filter. Each descriptor that accepts the packet receives its own copy. .Pp -The packet filter will support any link level protocol that has fixed length -headers. -Currently, only Ethernet, -.Tn SLIP , -and -.Tn PPP -drivers have been modified to interact with -.Nm . -.Pp -Since packet data is in network byte order, applications should use the -.Xr byteorder 3 -macros to extract multi-byte values. -.Pp A packet can be sent out on the network by writing to a .Nm file descriptor. @@ -313,7 +294,7 @@ with If the requested buffer size cannot be accommodated, the closest allowable size will be set and returned in the argument. A read call will result in -.Er EIO +.Er EINVAL if it is passed a buffer that is not this size. .It Dv BIOCGDLT .Pq Li u_int @@ -324,6 +305,43 @@ The device types, prefixed with .Dq Li DLT_ , are defined in .In net/bpf.h . +.It Dv BIOCGDLTLIST +.Pq Li "struct bpf_dltlist" +Returns an array of the available types of the data link layer +underlying the attached interface: +.Bd -literal -offset indent +struct bpf_dltlist { + u_int bfl_len; + u_int *bfl_list; +}; +.Ed +.Pp +The available types are returned in the array pointed to by the +.Va bfl_list +field while their length in u_int is supplied to the +.Va bfl_len +field. +.Er ENOMEM +is returned if there is not enough buffer space and +.Er EFAULT +is returned if a bad address is encountered. +The +.Va bfl_len +field is modified on return to indicate the actual length in u_int +of the array returned. +If +.Va bfl_list +is +.Dv NULL , +the +.Va bfl_len +field is set to indicate the required length of an array in u_int. +.It Dv BIOCSDLT +.Pq Li u_int +Changes the type of the data link layer underlying the attached interface. +.Er EINVAL +is returned if no interface has been specified or the specified +type is not available for the interface. .It Dv BIOCPROMISC Forces the interface into promiscuous mode. All packets, not just those destined for the local host, are processed. @@ -331,6 +349,9 @@ Since more than one file can be listening on a given i a listener that opened its interface non-promiscuously may receive packets promiscuously. This problem can be remedied with an appropriate filter. +.Pp +The interface remains in promiscuous mode until all files listening +promiscuously are closed. .It Dv BIOCFLUSH Flushes the buffer of incoming packets, and resets the statistics that are returned by BIOCGSTATS. @@ -344,7 +365,7 @@ structure. All other fields are undefined. .It Dv BIOCSETIF .Pq Li "struct ifreq" -Sets the hardware interface associate with the file. +Sets the hardware interface associated with the file. This command must be performed before any packets can be read. The device is indicated by name using the @@ -357,7 +378,7 @@ Additionally, performs the actions of .It Dv BIOCSRTIMEOUT .It Dv BIOCGRTIMEOUT .Pq Li "struct timeval" -Set or get the read timeout parameter. +Sets or gets the read timeout parameter. The argument specifies the length of time to wait before timing out on a read request. @@ -387,7 +408,7 @@ kernel because of buffer overflows .El .It Dv BIOCIMMEDIATE .Pq Li u_int -Enable or disable +Enables or disables .Dq immediate mode , based on the truth value of the argument. When immediate mode is enabled, reads return immediately upon packet @@ -407,7 +428,7 @@ An array of instructions and its length is passed in u the following structure: .Bd -literal struct bpf_program { - int bf_len; + u_int bf_len; struct bpf_insn *bf_insns; }; .Ed @@ -469,10 +490,18 @@ An incompatible filter may result in undefined behavior (most likely, an error returned by .Fn ioctl or haphazard packet matching). +.It Dv BIOCGRSIG +.It Dv BIOCSRSIG +.Pq Li u_int +Sets or gets the receive signal. +This signal will be sent to the process or process group specified by +.Dv FIOSETOWN . +It defaults to +.Dv SIGIO . .It Dv BIOCSHDRCMPLT .It Dv BIOCGHDRCMPLT .Pq Li u_int -Set or get the status of the +Sets or gets the status of the .Dq header complete flag. Set to zero if the link level source address should be filled in automatically @@ -489,7 +518,7 @@ Use and .Dv BIOCGDIRECTION instead. -Set or get the flag determining whether locally generated packets on the +Sets or gets the flag determining whether locally generated packets on the interface should be returned by BPF. Set to zero to see only incoming packets on the interface. Set to one to see packets originating locally and remotely on the interface. @@ -497,7 +526,7 @@ This flag is initialized to one by default. .It Dv BIOCSDIRECTION .It Dv BIOCGDIRECTION .Pq Li u_int -Set or get the setting determining whether incoming, outgoing, or all packets +Sets or gets the setting determining whether incoming, outgoing, or all packets on the interface should be returned by BPF. Set to .Dv BPF_D_IN @@ -631,6 +660,57 @@ therefore ownership is not assigned, the user process against .Vt bzh_user_gen . .El +.Sh STANDARD IOCTLS +.Nm +now supports several standard +.Xr ioctl 2 Ns 's +which allow the user to do async and/or non-blocking I/O to an open +.I bpf +file descriptor. +.Bl -tag -width SIOCGIFADDR +.It Dv FIONREAD +.Pq Li int +Returns the number of bytes that are immediately available for reading. +.It Dv SIOCGIFADDR +.Pq Li "struct ifreq" +Returns the address associated with the interface. +.It Dv FIONBIO +.Pq Li int +Sets or clears non-blocking I/O. +If arg is non-zero, then doing a +.Xr read 2 +when no data is available will return -1 and +.Va errno +will be set to +.Er EAGAIN . +If arg is zero, non-blocking I/O is disabled. +Note: setting this overrides the timeout set by +.Dv BIOCSRTIMEOUT . +.It Dv FIOASYNC +.Pq Li int +Enables or disables async I/O. +When enabled (arg is non-zero), the process or process group specified by +.Dv FIOSETOWN +will start receiving +.Dv SIGIO 's +when packets arrive. +Note that you must do an +.Dv FIOSETOWN +in order for this to take affect, +as the system will not default this for you. +The signal may be changed via +.Dv BIOCSRSIG . +.It Dv FIOSETOWN +.It Dv FIOGETOWN +.Pq Li int +Sets or gets the process or process group (if negative) that should +receive +.Dv SIGIO +when packets are available. +The signal may be changed using +.Dv BIOCSRSIG +(see above). +.El .Sh BPF HEADER One of the following structures is prepended to each packet returned by .Xr read 2 @@ -750,10 +830,10 @@ and implicit program counter. The following structure defines the instruction format: .Bd -literal struct bpf_insn { - u_short code; - u_char jt; - u_char jf; - u_long k; + u_short code; + u_char jt; + u_char jf; + bpf_u_int32 k; }; .Ed .Pp @@ -964,7 +1044,7 @@ variables controls the behaviour of the .Nm subsystem .Bl -tag -width indent -.It Va net.bpf.optimize_writers: No 0 +.It Va net.bpf.optimize_writers : No 0 Various programs use BPF to send (but not receive) raw packets (cdpd, lldpd, dhcpd, dhcp relays, etc. are good examples of such programs). They do not need incoming packets to be send to them. @@ -973,20 +1053,20 @@ makes new BPF users to be attached to write-only inter explicitly specifies read filter via .Fn pcap_set_filter . This removes any performance degradation for high-speed interfaces. -.It Va net.bpf.stats: +.It Va net.bpf.stats : Binary interface for retrieving general statistics. -.It Va net.bpf.zerocopy_enable: No 0 +.It Va net.bpf.zerocopy_enable : No 0 Permits zero-copy to be used with net BPF readers. Use with caution. -.It Va net.bpf.maxinsns: No 512 +.It Va net.bpf.maxinsns : No 512 Maximum number of instructions that BPF program can contain. Use .Xr tcpdump 1 .Fl d option to determine approximate number of instruction for any filter. -.It Va net.bpf.maxbufsize: No 524288 +.It Va net.bpf.maxbufsize : No 524288 Maximum buffer size to allocate for packets buffer. -.It Va net.bpf.bufsize: No 4096 +.It Va net.bpf.bufsize : No 4096 Default buffer size to allocate for packets buffer. .El .Sh EXAMPLES @@ -1052,7 +1132,6 @@ struct bpf_insn insns[] = { .Xr kqueue 2 , .Xr poll 2 , .Xr select 2 , -.Xr byteorder 3 , .Xr ng_bpf 4 , .Xr bpf 9 .Rs @@ -1100,8 +1179,6 @@ This could be fixed in the kernel with additional proc However, we favor the model where all files must assume that the interface is promiscuous, and if so desired, must utilize a filter to reject foreign packets. -.Pp -Data link protocols with variable length headers are not currently supported. .Pp The .Dv SEESENT , From owner-svn-src-head@freebsd.org Fri Oct 9 16:19: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 EE0C73FDF44; Fri, 9 Oct 2020 16:19:12 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) (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 4C7Cv41BY6z4Z93; Fri, 9 Oct 2020 16:19:11 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qk1-x742.google.com with SMTP id w12so11135871qki.6; Fri, 09 Oct 2020 09:19:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=eZ4Zb6YkjaSjgBE3z+bh6aa9Kz7SvAogIr4EzUjXJAI=; b=J6ZOHW9/svdeV412msjzSoXYuqUtzyguiBZ5Hi/D9U9olFY95fvGgjyAVxKGjOhIe2 y6ZDCP8dnZUoF+TOjvBy7FXjLb1wsa2FAFpl/c9w6HoD7pgejxM8Fg4taFd+MhjGFSjo NMJ5/K5ev7VukaItOyFABVCsviMaKbbO91gMcU+AS9yEbjY7eQsF0LSXIxAtKP4Dok15 NlMZgg9CAkHb3TJro/MDMY/o63bG4gVtW2uw/JbeP9RiCj8tV+G+10XJuS7wJmVQneiq ZmycZaGlp/Km0Z28/V2Kngmbuu3HgG+UyRawwBU6LCvGBCoY3AqlXnGqGq/m5wQvccGa fHRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=eZ4Zb6YkjaSjgBE3z+bh6aa9Kz7SvAogIr4EzUjXJAI=; b=N8OUGsl5ZTZIclWyIensmyyQZA8Kto39kCz6iqPPrcM9K9mpe8QZClsCERVGPOzVJ1 YZlvVq3BFxqDmRfarfV5+1dBKswjh2Jn1uG2XfW2N5iDpTmv19sgcxz6aIdWF6Fb9M6V 7BzFyESsbLt4Zo1aAe9H39gOvmI42RHNijCeqkhdgS1PCro0aHLuBEZjY+dCK/Ve0aKs wqjQcqFmQppBXip9q482Hp+WdPvCN30AbwscX9BVqcpkO0vp/7c7OOkbpifejqUrl7zY Gn6mNbERe9A7GQ/6pVYd/gvmnwBZKATOWQhCOSQpCdvGk+lVS7hEq3xIF3KZMbCiOrQj inYg== X-Gm-Message-State: AOAM533Zf8xxjnJvvcnlMYyf0d6s9Vkbm3XbOr9r3I+heAX8JieVfLjU 0vWlQb5xQyytAohQgobaXK+ofO61a+M= X-Google-Smtp-Source: ABdhPJwZT7eAzk/3e8laLlvv3QHkIbn2ZMLzy/GoT4HUZBKBsZuZhkfcyKsy8APRWc1uQrjTYFU9ew== X-Received: by 2002:a05:620a:1275:: with SMTP id b21mr13306273qkl.135.1602260350775; Fri, 09 Oct 2020 09:19:10 -0700 (PDT) Received: from mbp.home (200-12-5-188.rev.tribenet.com.br. [200.12.5.188]) by smtp.gmail.com with ESMTPSA id k4sm1251013qkj.46.2020.10.09.09.19.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Oct 2020 09:19:09 -0700 (PDT) Sender: Renato Botelho Subject: Re: svn commit: r366578 - head/sbin/devd To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202010091529.099FT6Ab049635@repo.freebsd.org> From: Renato Botelho Message-ID: Date: Fri, 9 Oct 2020 13:19:06 -0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 MIME-Version: 1.0 In-Reply-To: <202010091529.099FT6Ab049635@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4C7Cv41BY6z4Z93 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=J6ZOHW9/; dmarc=none; spf=pass (mx1.freebsd.org: domain of gargabsd@gmail.com designates 2607:f8b0:4864:20::742 as permitted sender) smtp.mailfrom=gargabsd@gmail.com X-Spamd-Result: default: False [-3.06 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-0.97)[-0.968]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.99)[-0.993]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.90)[-0.896]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::742:from]; FORGED_SENDER(0.30)[garga@FreeBSD.org,gargabsd@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[garga@FreeBSD.org,gargabsd@gmail.com]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] 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, 09 Oct 2020 16:19:13 -0000 On 09/10/20 12:29, Warner Losh wrote: > Author: imp > Date: Fri Oct 9 15:29:05 2020 > New Revision: 366578 > URL: https://svnweb.freebsd.org/changeset/base/366578 > > Log: > Avoid using single quotes in arguments to logger. > > Single quotes interfere with the workaround put in with r335753 and > aren't necessary in this case. I believe that all the underling issues > with r335753 have been corrected, but need to do more extensive > followup before reverting it as a bad idea. Hi Warner, How to proceed if it's needed to pass multiple parameters to a command in following format? cmd param1 'param2 has spaces and a $variable' -- Renato Botelho From owner-svn-src-head@freebsd.org Fri Oct 9 16:58: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 6ED083FF16F for ; Fri, 9 Oct 2020 16:58:01 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com [IPv6:2607:f8b0:4864:20::f2b]) (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 4C7Dlr4FdLz4bTr for ; Fri, 9 Oct 2020 16:58:00 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf2b.google.com with SMTP id t20so5073534qvv.8 for ; Fri, 09 Oct 2020 09:58:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bFzenl8q6mRh1QA1QrALHI2ofIATACNohrXdRR91tKI=; b=ADO3TObjm+WNgZZSqsuOoOczQLqnnZyJlDgtVCZZ51e6VgTUbqpG0Zl1PYdCnhIZ+6 DwPc/M+lClBGkXTv+e+BKrrFBq5u/jX9vkNaLTPUx8wZxijrNPfib/nqCg/Hl4VmV1vF RkJYvjX8T+dLzJX9rQqDSCyzeN5aQh7zTJQ2R0ZF/9xzIt+e+dsIHqzxbGKbt9lnjvk1 nCDij1sVT+7E8VQ6JCIn1tm11PoAhVe5WVFMxwPthOSFmBD60l6Xu7HtlBImPQSb4kcC +G3ozr+2ZkZ1LhnVVHotvDLpmG27g04Yer0darFPhjk5TDduuA0CFueiXcTWVzGdKwjz nnDA== 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=bFzenl8q6mRh1QA1QrALHI2ofIATACNohrXdRR91tKI=; b=E9gLIuzQw3mpCREcEhJ+F6j9B2TFDeg1AHwdx5MaN54LrS9Jmg8VatO4vp12lp/16z SC7dMj28NU/U/sJFDIG31w+SsvaQYvqFmiMiNo9iboC0rBlVZfNcg+P/qyDSc21hrY01 D45gZ/P8nyQw1DSOlZNL8mcf3SCOto4bCYPymoC9EQYhZATAnYiTa5fso4JnSB2FpZIk miOXg51TvaOg8yaOatxOqmxUIanzMqMdyiB5Ku1MhYh3X79qBGCNB0KYzrRvw0J2moc5 q0Txe63iw+j2fGHiBj+lKeKzNSwbgjrnNNm8hI8TRJK+IMIYXLYXD6M8y8xY1jrnodW7 Btlw== X-Gm-Message-State: AOAM532ipzNCdBBSvX1ZNF2y1M9tkmMLeeDgT3hC7h7ff8wKN798gL1U xmqeRpx8uQicjU3LZ46jKbZWsPaBiAhM+MpXEPFGEQ== X-Google-Smtp-Source: ABdhPJz/qqSj4EImb66toGfe5Z18UxwiRuK+T0uWpZTaJ3r1yElKjwv2XsqrXY2gVa/A0Bvezb07kUukebH3b/Cq920= X-Received: by 2002:ad4:544a:: with SMTP id h10mr14026153qvt.35.1602262679475; Fri, 09 Oct 2020 09:57:59 -0700 (PDT) MIME-Version: 1.0 References: <202010091529.099FT6Ab049635@repo.freebsd.org> In-Reply-To: From: Warner Losh Date: Fri, 9 Oct 2020 10:57:48 -0600 Message-ID: Subject: Re: svn commit: r366578 - head/sbin/devd To: Renato Botelho Cc: Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4C7Dlr4FdLz4bTr X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=ADO3TObj; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::f2b) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.28 / 15.00]; ARC_NA(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.96)[-0.960]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.99)[-0.987]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.33)[-0.330]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f2b:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] 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: Fri, 09 Oct 2020 16:58:01 -0000 On Fri, Oct 9, 2020 at 10:19 AM Renato Botelho wrote: > On 09/10/20 12:29, Warner Losh wrote: > > Author: imp > > Date: Fri Oct 9 15:29:05 2020 > > New Revision: 366578 > > URL: https://svnweb.freebsd.org/changeset/base/366578 > > > > Log: > > Avoid using single quotes in arguments to logger. > > > > Single quotes interfere with the workaround put in with r335753 and > > aren't necessary in this case. I believe that all the underling issues > > with r335753 have been corrected, but need to do more extensive > > followup before reverting it as a bad idea. > > Hi Warner, > > How to proceed if it's needed to pass multiple parameters to a command > in following format? > > cmd param1 'param2 has spaces and a $variable' > action "cmd param1 'param2 has spaces and a '$variable"; should do the trick. I'm documenting this now... Warner From owner-svn-src-head@freebsd.org Fri Oct 9 18:16: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 AC95F4281B2; Fri, 9 Oct 2020 18:16:44 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) (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 4C7GVg5RYhz4fRD; Fri, 9 Oct 2020 18:16:43 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qk1-x741.google.com with SMTP id s7so11491728qkh.11; Fri, 09 Oct 2020 11:16:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=40i5Zjl1Dsky5Um6Z6CDbvnXpgGiZPs2ZSei7LjAcpU=; b=l4fzf4bqlJC7r+nFyMO/ca67SEC3RkzbybD4Qf5Qh3KUWxZcYlMaePOPDZ58yTUkpy f5EiBPNstr9+A+Gng74DR9DbfkY4lYeGZsNe4H+cJUZyZ02a7s94ravkXW+bmzfTOJiQ QZsi0RV2vPA6Zb7YcEa74aivjbuSgxZrmbDbGd4lLz77DblJ7Aj7Qyriu1oR1OoNkF9y loEM64wtQswjkLD1HigIzmAzd8uTqz5A86AW+yKmA2VcNKfa7qKw8N1swg/GEj3VdVGD zxfBs0bS9/Ozd2EbKQog27qlIWQBnMyDxiPrRxG38Artz3IYCdsFcpscRDmQ0feKqGoy YnbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=40i5Zjl1Dsky5Um6Z6CDbvnXpgGiZPs2ZSei7LjAcpU=; b=Ft4e8w4r+HSvqA2yQnAk+Py3dKbW74DhakBM9ZaMK35nVkKrZ14BmFxmpKQ7YfVKJ5 WuaQyTSq0wlSsr8oNI4K6bCKNhNWnO3veyMqDIQlXn3nPWNNwkE3dt4BSCXCm84XM+Cf NNp0r9l5ae2KY+6fx982srN6oBZaOiSSFDuFFu8xo5aQDo/f+YOxSC6WdOgQt8gL6Ahi eXq9UoLhPGM7zY9YlXbD8vtluEMBP8ZiAE/FeYSXDJ8XUqRu2TbkKxZ3b58UA0KmAA32 ZqulG/kYr132krNDEwO4NDhWthAvfAvYgtS+SepA6QhCc8VgUxlQ5zh7cZFVV6ial/pA m+8w== X-Gm-Message-State: AOAM533f7o+KbOz7VeMXC5C78JziwWtpXgw3Cv/BCUshHcDKzRI6SiO9 i60mUO1UB3gpHfeWbRfL5+5nbAPEv9I= X-Google-Smtp-Source: ABdhPJzcxjb8goKwldQRrSbRSE7Qeo3XALxRNMxzL7MgSEJRyEFIoOaXrXtdCS8vhOYgEdjR6L3MPw== X-Received: by 2002:a05:620a:958:: with SMTP id w24mr15348180qkw.65.1602267402626; Fri, 09 Oct 2020 11:16:42 -0700 (PDT) Received: from mbp.home (200-12-5-188.rev.tribenet.com.br. [200.12.5.188]) by smtp.gmail.com with ESMTPSA id d12sm7025950qtb.9.2020.10.09.11.16.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Oct 2020 11:16:41 -0700 (PDT) Sender: Renato Botelho Subject: Re: svn commit: r366578 - head/sbin/devd To: Warner Losh Cc: Warner Losh , src-committers , svn-src-all , svn-src-head References: <202010091529.099FT6Ab049635@repo.freebsd.org> From: Renato Botelho Message-ID: <2f49af1f-f0fb-f5f0-82bf-8b46ead027c1@FreeBSD.org> Date: Fri, 9 Oct 2020 15:16:38 -0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4C7GVg5RYhz4fRD X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=l4fzf4bq; dmarc=none; spf=pass (mx1.freebsd.org: domain of gargabsd@gmail.com designates 2607:f8b0:4864:20::741 as permitted sender) smtp.mailfrom=gargabsd@gmail.com X-Spamd-Result: default: False [-3.02 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.003]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; ARC_NA(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-0.80)[-0.796]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::741:from]; NEURAL_HAM_MEDIUM(-1.02)[-1.018]; FORGED_SENDER(0.30)[garga@FreeBSD.org,gargabsd@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[garga@FreeBSD.org,gargabsd@gmail.com]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] 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, 09 Oct 2020 18:16:44 -0000 On 09/10/20 13:57, Warner Losh wrote: > > > On Fri, Oct 9, 2020 at 10:19 AM Renato Botelho > wrote: > > On 09/10/20 12:29, Warner Losh wrote: > > Author: imp > > Date: Fri Oct  9 15:29:05 2020 > > New Revision: 366578 > > URL: https://svnweb.freebsd.org/changeset/base/366578 > > > > > Log: > >    Avoid using single quotes in arguments to logger. > > > >    Single quotes interfere with the workaround put in with > r335753 and > >    aren't necessary in this case. I believe that all the > underling issues > >    with r335753 have been corrected, but need to do more extensive > >    followup before reverting it as a bad idea. > > Hi Warner, > > How to proceed if it's needed to pass multiple parameters to a command > in following format? > > cmd param1 'param2 has spaces and a $variable' > > > action "cmd param1 'param2 has spaces and a '$variable"; > > should do the trick. I'm documenting this now... It worked!! Thanks! From owner-svn-src-head@freebsd.org Fri Oct 9 18:20: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 E905D4282CC; Fri, 9 Oct 2020 18:20:51 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) (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 4C7GbR2Q2fz4fyb; Fri, 9 Oct 2020 18:20:50 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qk1-x736.google.com with SMTP id v123so11529871qkd.9; Fri, 09 Oct 2020 11:20:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=8zdOJNgO7FqDolUaVZ3t7pdohdNRne2h8mcl06Luck8=; b=gCSZD0w8UifIvA1+X6tTscThFMKavHO16Vucy4fm2UlhNprx5gGY2AOdjhD8N+1/LN M5eVmAy9RGFNGO2kcx4j9XDNHGH4ycDaN6HggG/wszbah7OgpQy2l3n1ha5pUyUqhq2o YmWHwGikH5WxWTbwdBAUiC3okqTCWU/6U9LbTlbUDiPFpVqJRxHcUZC+E1b1849Stnuq rzTpibBpXV7SGvnan+Cwodh+e6oqcZoopp3FjZJ39cotoHvxuN2BPf4NjfUHwPMiu1l0 DXKwbvlWmIw5P5Vb/RJWPjLsXR/CIZHBNCr4nv0prD7m6EmyqFOVtxjalmI7PvdcDnkJ tepg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:cc:references:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=8zdOJNgO7FqDolUaVZ3t7pdohdNRne2h8mcl06Luck8=; b=hSCyXwJTMgB917UAh6nfQCZU9X1fv7jZPs3XISEQFI5Lfsx20Ded3vI78v30DcPhVm 462bZettG/3RdP5RfbH8CoyJ8uR7zp7FU66PNxvii6NSIzlaFfsm5oJ7wfKhPlGcGyvF 9ExV4Mvc9q99UK/yVrJqXUyldlq7qv7coqedYLU1Y2c7M9rbHd1WutNKCks0eOJGfBFV G1NpEOWjdsSm2y48QoLgt5PAW1jdmHHdR6GfYFL+gfZMIYPUOruca28BOXHm7yeCs2Py eQXivV2WKz5EQnO+c8zkfXPn61P50yxxkDpdXFfa1Dyqc/2wvCsseLOwvfJ/e20O+V+B WQ7A== X-Gm-Message-State: AOAM533c9c+yYraHOZ1GGt/Ob4i30sc/izaOcvUnwSbyqVThTn8X03if Qb2aK/sVYr2LUG65ZvxubRevZiEvcFM= X-Google-Smtp-Source: ABdhPJxTA69ntoKKbIZVkOVsTj1XYni2528uoEoOsEx2p30LL47/ve8ToWeuyyTVPy3m+cEokXTatw== X-Received: by 2002:a05:620a:142e:: with SMTP id k14mr9531795qkj.483.1602267650125; Fri, 09 Oct 2020 11:20:50 -0700 (PDT) Received: from mbp.home (200-12-5-188.rev.tribenet.com.br. [200.12.5.188]) by smtp.gmail.com with ESMTPSA id i19sm6426858qti.71.2020.10.09.11.20.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Oct 2020 11:20:49 -0700 (PDT) Sender: Renato Botelho Subject: Re: svn commit: r366578 - head/sbin/devd From: Renato Botelho To: Warner Losh Cc: Warner Losh , src-committers , svn-src-all , svn-src-head References: <202010091529.099FT6Ab049635@repo.freebsd.org> <2f49af1f-f0fb-f5f0-82bf-8b46ead027c1@FreeBSD.org> Message-ID: <563930e3-19ec-44dd-fd6f-1d55859d9235@FreeBSD.org> Date: Fri, 9 Oct 2020 15:20:46 -0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 MIME-Version: 1.0 In-Reply-To: <2f49af1f-f0fb-f5f0-82bf-8b46ead027c1@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4C7GbR2Q2fz4fyb X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=gCSZD0w8; dmarc=none; spf=pass (mx1.freebsd.org: domain of gargabsd@gmail.com designates 2607:f8b0:4864:20::736 as permitted sender) smtp.mailfrom=gargabsd@gmail.com X-Spamd-Result: default: False [-3.28 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-1.00)[-1.004]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-1.06)[-1.058]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::736:from]; NEURAL_HAM_MEDIUM(-1.02)[-1.017]; FORGED_SENDER(0.30)[garga@FreeBSD.org,gargabsd@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[garga@FreeBSD.org,gargabsd@gmail.com]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] 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, 09 Oct 2020 18:20:52 -0000 On 09/10/20 15:16, Renato Botelho wrote: > On 09/10/20 13:57, Warner Losh wrote: >> >> >> On Fri, Oct 9, 2020 at 10:19 AM Renato Botelho > > wrote: >> >>     On 09/10/20 12:29, Warner Losh wrote: >>      > Author: imp >>      > Date: Fri Oct  9 15:29:05 2020 >>      > New Revision: 366578 >>      > URL: https://svnweb.freebsd.org/changeset/base/366578 >>     >>      > >>      > Log: >>      >    Avoid using single quotes in arguments to logger. >>      > >>      >    Single quotes interfere with the workaround put in with >>     r335753 and >>      >    aren't necessary in this case. I believe that all the >>     underling issues >>      >    with r335753 have been corrected, but need to do more extensive >>      >    followup before reverting it as a bad idea. >> >>     Hi Warner, >> >>     How to proceed if it's needed to pass multiple parameters to a >> command >>     in following format? >> >>     cmd param1 'param2 has spaces and a $variable' >> >> >> action "cmd param1 'param2 has spaces and a '$variable"; >> >> should do the trick. I'm documenting this now... > > It worked!! Thanks! Oooops, too fast. I wrote this script: #!/bin/sh echo "Param1 = '${1}'" >> /root/log echo "Param2 = '${2}'" >> /root/log And added this action on devd config: notify 0 { match "system" "IFNET"; match "type" "LINK_UP"; media-type "ethernet"; action "/root/log.sh -c 'interface linkup start '$subsystem"; }; notify 0 { match "system" "IFNET"; match "type" "LINK_DOWN"; media-type "ethernet"; action "/root/log.sh -c 'interface linkup stop '$subsystem"; }; And got the following output on /root/log: Param1 = '-c' Param2 = 'interface linkup start $em0' From owner-svn-src-head@freebsd.org Fri Oct 9 18:47: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 EFE22428B91 for ; Fri, 9 Oct 2020 18:47:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) (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 4C7HBL2mfTz4hBj for ; Fri, 9 Oct 2020 18:47:38 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x733.google.com with SMTP id a23so11576761qkg.13 for ; Fri, 09 Oct 2020 11:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rtM+ywnkXWfrOb7ty7VXxqr0q9zt3m2p+Sv8oy4Z/rE=; b=v7ORr8goSEoqzu/AWwgfjbDkPyDCsQ904heLSnp3WnXCWJ/2lP18nj2+E3zLJF40uQ gxmlTkjsWm5GWD50QuusZzjK6PW2zeYnw04VRijIscsv8zVHyRvock1ubySVnx/v/Nfy MMXjznhp4bTWFHRJrDmLMn7gTGnevP3ClxHVT9HwiT0tFuXYCtiAiB/d3gXwYK1JPAT+ bY1bD/X0kEZQ2Q2NMWO7ZZCjnnMHiKxQ8dc7HRyc5NcnfmVCL9h7rR2l2kasArsGEHZr A16beZrkQ5/01ilvDSKx/xTf3dcBVkccQa237HqKPSy4qHKYTvKlbGdyznww0+WeEaP9 88HQ== 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=rtM+ywnkXWfrOb7ty7VXxqr0q9zt3m2p+Sv8oy4Z/rE=; b=nvTeLMkWuNgrP/FN13+kSNuKYRDPYQnrV5YyTcjkEKZ3RkPQSrYCroqUYKuPZgfybF vfTg0IjDmd48STd5NjIoJSi/yohphrvHriulgym3I+3f1YF2oDY8ZLxbyvQDOzZQ6C39 h3tg8tlvc5Sm10bIA0Z5N1qEKG1i3AJ3ZKwS2oA1cA45EK4zomhJ+Kb7yxNxm3mIETRK t2jjYNRCABn+U30/a5vUM6ikZBdp8AD9nhy2kyIUkddiodb4S0hyvgxro4hJqepYCYmm hJ7RDiXlAxVJmxpiNiJ54FXe0cgSQJgtSQeEVH56Qelqp5tdfg2A+CCjXdC7AFrWJoVK 52Nw== X-Gm-Message-State: AOAM533KVVGGrLSXr/EUUitQJJ4sfWdiy2vnUFvMT6Pj84J40MtN4I4h mSWdh7pVuXErYsZ2sKwLgjHyeRFQTyglgrgNlLqeE0//agVr0w== X-Google-Smtp-Source: ABdhPJxX/BPn+2ecmijz+aZDrER8TDO2L4ElLnjjJdN6WLASKrgx0A+FavpzmL8nNhXO4fPEMu25+2HPCh2UP0GW460= X-Received: by 2002:ae9:ee06:: with SMTP id i6mr14577167qkg.380.1602269257645; Fri, 09 Oct 2020 11:47:37 -0700 (PDT) MIME-Version: 1.0 References: <202010091529.099FT6Ab049635@repo.freebsd.org> <2f49af1f-f0fb-f5f0-82bf-8b46ead027c1@FreeBSD.org> <563930e3-19ec-44dd-fd6f-1d55859d9235@FreeBSD.org> In-Reply-To: <563930e3-19ec-44dd-fd6f-1d55859d9235@FreeBSD.org> From: Warner Losh Date: Fri, 9 Oct 2020 12:47:25 -0600 Message-ID: Subject: Re: svn commit: r366578 - head/sbin/devd To: Renato Botelho Cc: Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4C7HBL2mfTz4hBj X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=v7ORr8go; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::733) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.95 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.96)[-0.962]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.99)[-0.987]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::733:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; MAILMAN_DEST(0.00)[svn-src-head]; RCVD_COUNT_TWO(0.00)[2] 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: Fri, 09 Oct 2020 18:47:39 -0000 On Fri, Oct 9, 2020, 12:20 PM Renato Botelho wrote: > On 09/10/20 15:16, Renato Botelho wrote: > > On 09/10/20 13:57, Warner Losh wrote: > >> > >> > >> On Fri, Oct 9, 2020 at 10:19 AM Renato Botelho >> > wrote: > >> > >> On 09/10/20 12:29, Warner Losh wrote: > >> > Author: imp > >> > Date: Fri Oct 9 15:29:05 2020 > >> > New Revision: 366578 > >> > URL: https://svnweb.freebsd.org/changeset/base/366578 > >> > >> > > >> > Log: > >> > Avoid using single quotes in arguments to logger. > >> > > >> > Single quotes interfere with the workaround put in with > >> r335753 and > >> > aren't necessary in this case. I believe that all the > >> underling issues > >> > with r335753 have been corrected, but need to do more > extensive > >> > followup before reverting it as a bad idea. > >> > >> Hi Warner, > >> > >> How to proceed if it's needed to pass multiple parameters to a > >> command > >> in following format? > >> > >> cmd param1 'param2 has spaces and a $variable' > >> > >> > >> action "cmd param1 'param2 has spaces and a '$variable"; > >> > >> should do the trick. I'm documenting this now... > > > > It worked!! Thanks! > > Oooops, too fast. > > I wrote this script: > > #!/bin/sh > > echo "Param1 = '${1}'" >> /root/log > echo "Param2 = '${2}'" >> /root/log > > And added this action on devd config: > > notify 0 { > match "system" "IFNET"; > match "type" "LINK_UP"; > media-type "ethernet"; > action "/root/log.sh -c 'interface linkup start '$subsystem"; > }; > > notify 0 { > match "system" "IFNET"; > match "type" "LINK_DOWN"; > media-type "ethernet"; > action "/root/log.sh -c 'interface linkup stop '$subsystem"; > }; > > And got the following output on /root/log: > > Param1 = '-c' > Param2 = 'interface linkup start $em0' > Doh. I'll dig deeper. Warner > From owner-svn-src-head@freebsd.org Fri Oct 9 19:10: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 2B177429912; Fri, 9 Oct 2020 19:10:01 +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 4C7Hh902qRz4kpv; Fri, 9 Oct 2020 19:10:01 +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 C02FE1E421; Fri, 9 Oct 2020 19:10:00 +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 099JA0Yd087373; Fri, 9 Oct 2020 19:10:00 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 099JA08f087371; Fri, 9 Oct 2020 19:10:00 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010091910.099JA08f087371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 9 Oct 2020 19:10:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366582 - in head/sys: fs/deadfs kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: fs/deadfs kern X-SVN-Commit-Revision: 366582 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, 09 Oct 2020 19:10:01 -0000 Author: mjg Date: Fri Oct 9 19:10:00 2020 New Revision: 366582 URL: https://svnweb.freebsd.org/changeset/base/366582 Log: cache: fix vexec panic when racing against vgone Use of dead_vnodeops would result in a panic instead of returning the intended EOPNOTSUPP error. While here make sure to abort, not just try to return a partial result. The former allows the regular lookup to restart from scratch, while the latter makes it stuck with an unusable vnode. Reported by: kevans Modified: head/sys/fs/deadfs/dead_vnops.c head/sys/kern/vfs_cache.c Modified: head/sys/fs/deadfs/dead_vnops.c ============================================================================== --- head/sys/fs/deadfs/dead_vnops.c Fri Oct 9 18:30:49 2020 (r366581) +++ head/sys/fs/deadfs/dead_vnops.c Fri Oct 9 19:10:00 2020 (r366582) @@ -79,6 +79,7 @@ struct vop_vector dead_vnodeops = { .vop_vptocnp = VOP_EBADF, .vop_unset_text = dead_unset_text, .vop_write = dead_write, + .vop_fplookup_vexec = VOP_EOPNOTSUPP, }; VFS_VOP_VECTOR_REGISTER(dead_vnodeops); Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Fri Oct 9 18:30:49 2020 (r366581) +++ head/sys/kern/vfs_cache.c Fri Oct 9 19:10:00 2020 (r366582) @@ -4040,32 +4040,46 @@ cache_fplookup_parse_advance(struct cache_fpl *fpl) } } +/* + * See the API contract for VOP_FPLOOKUP_VEXEC. + */ static int __noinline cache_fplookup_failed_vexec(struct cache_fpl *fpl, int error) { + struct vnode *dvp; + seqc_t dvp_seqc; + dvp = fpl->dvp; + dvp_seqc = fpl->dvp_seqc; + /* * Hack: they may be looking up foo/bar, where foo is a * regular file. In such a case we need to turn ENOTDIR, * but we may happen to get here with a different error. */ - if (fpl->dvp->v_type != VDIR) { + if (dvp->v_type != VDIR) { + /* + * The check here is predominantly to catch + * EOPNOTSUPP from dead_vnodeops. If the vnode + * gets doomed past this point it is going to + * fail seqc verification. + */ + if (VN_IS_DOOMED(dvp)) { + return (cache_fpl_aborted(fpl)); + } error = ENOTDIR; } switch (error) { case EAGAIN: - /* - * Can happen when racing against vgone. - * */ - case EOPNOTSUPP: - cache_fpl_partial(fpl); + if (!vn_seqc_consistent(dvp, dvp_seqc)) { + error = cache_fpl_aborted(fpl); + } else { + cache_fpl_partial(fpl); + } break; default: - /* - * See the API contract for VOP_FPLOOKUP_VEXEC. - */ - if (!vn_seqc_consistent(fpl->dvp, fpl->dvp_seqc)) { + if (!vn_seqc_consistent(dvp, dvp_seqc)) { error = cache_fpl_aborted(fpl); } else { cache_fpl_smr_exit(fpl); From owner-svn-src-head@freebsd.org Fri Oct 9 19:12: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 4B73642966A; Fri, 9 Oct 2020 19:12:56 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C7HlX1WHfz4lKm; Fri, 9 Oct 2020 19:12:56 +0000 (UTC) (envelope-from gbe@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 1748A1E619; Fri, 9 Oct 2020 19:12:56 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 099JCt7t093387; Fri, 9 Oct 2020 19:12:55 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 099JCjYf093334; Fri, 9 Oct 2020 19:12:45 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010091912.099JCjYf093334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Fri, 9 Oct 2020 19:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366583 - in head: lib/libc/capability lib/libc/sys lib/libgssapi lib/libmd lib/libmt lib/libpathconv lib/libpmc lib/libradius lib/librpcsec_gss lib/libsysdecode lib/libusb lib/libutil ... X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: in head: lib/libc/capability lib/libc/sys lib/libgssapi lib/libmd lib/libmt lib/libpathconv lib/libpmc lib/libradius lib/librpcsec_gss lib/libsysdecode lib/libusb lib/libutil lib/msun/man share/man/ma... X-SVN-Commit-Revision: 366583 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, 09 Oct 2020 19:12:56 -0000 Author: gbe (doc committer) Date: Fri Oct 9 19:12:44 2020 New Revision: 366583 URL: https://svnweb.freebsd.org/changeset/base/366583 Log: Fix a few mandoc issues - skipping paragraph macro: Pp after Sh - sections out of conventional order: Sh EXAMPLES - whitespace at end of input line - normalizing date format Modified: head/lib/libc/capability/cap_rights_init.3 head/lib/libc/sys/cpuset_getaffinity.2 head/lib/libc/sys/cpuset_getdomain.2 head/lib/libc/sys/fhlink.2 head/lib/libc/sys/getitimer.2 head/lib/libc/sys/getsockopt.2 head/lib/libgssapi/gss_accept_sec_context.3 head/lib/libmd/mdX.3 head/lib/libmd/ripemd.3 head/lib/libmd/sha.3 head/lib/libmd/sha256.3 head/lib/libmd/sha512.3 head/lib/libmd/skein.3 head/lib/libmt/mt.3 head/lib/libpathconv/abs2rel.3 head/lib/libpmc/pmc.sandybridge.3 head/lib/libpmc/pmc.sandybridgeuc.3 head/lib/libradius/libradius.3 head/lib/librpcsec_gss/rpc_gss_set_callback.3 head/lib/libsysdecode/sysdecode_mask.3 head/lib/libusb/libusb20.3 head/lib/libutil/login_ok.3 head/lib/msun/man/sincos.3 head/share/man/man4/fdt_pinctrl.4 head/share/man/man4/ig4.4 head/share/man/man4/man4.i386/ce.4 head/share/man/man4/mlx5io.4 head/share/man/man4/mrsas.4 head/share/man/man4/ng_pppoe.4 head/share/man/man4/qlxgbe.4 head/share/man/man4/rtwn.4 head/share/man/man4/sa.4 head/share/man/man4/smartpqi.4 head/share/man/man4/spigen.4 head/share/man/man4/syscons.4 head/share/man/man4/udbp.4 head/share/man/man9/OF_finddevice.9 head/share/man/man9/backlight.9 head/share/man/man9/vnet.9 head/usr.bin/dpv/dpv.1 head/usr.bin/indent/indent.1 head/usr.bin/localedef/localedef.1 head/usr.bin/mkimg/mkimg.1 head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 head/usr.sbin/camdd/camdd.8 head/usr.sbin/mlx5tool/mlx5tool.8 head/usr.sbin/nfsd/pnfsserver.4 head/usr.sbin/zonectl/zonectl.8 Modified: head/lib/libc/capability/cap_rights_init.3 ============================================================================== --- head/lib/libc/capability/cap_rights_init.3 Fri Oct 9 19:10:00 2020 (r366582) +++ head/lib/libc/capability/cap_rights_init.3 Fri Oct 9 19:12:44 2020 (r366583) @@ -239,7 +239,7 @@ The functions .Fn cap_rights_is_set , .Fn cap_rights_is_valid , .Fn cap_rights_merge , -.Fn cap_rights_remove +.Fn cap_rights_remove and .Fn cap_rights_contains first appeared in Modified: head/lib/libc/sys/cpuset_getaffinity.2 ============================================================================== --- head/lib/libc/sys/cpuset_getaffinity.2 Fri Oct 9 19:10:00 2020 (r366582) +++ head/lib/libc/sys/cpuset_getaffinity.2 Fri Oct 9 19:12:44 2020 (r366583) @@ -149,7 +149,7 @@ was either preposterously large or smaller than the ke The calling process did not have the credentials required to complete the operation. .It Bq Er ECAPMODE -The calling process attempted to act on a process other than itself, while +The calling process attempted to act on a process other than itself, while in capability mode. See .Xr capsicum 4 . Modified: head/lib/libc/sys/cpuset_getdomain.2 ============================================================================== --- head/lib/libc/sys/cpuset_getdomain.2 Fri Oct 9 19:10:00 2020 (r366582) +++ head/lib/libc/sys/cpuset_getdomain.2 Fri Oct 9 19:12:44 2020 (r366583) @@ -119,7 +119,8 @@ Memory is allocated on a round-robin basis by cycling .Fa mask . .It Dv DOMAINSET_POLICY_FIRSTTOUCH Memory is allocated on the domain local to the CPU the requesting thread is -running on. Failure to allocate from this domain will fallback to round-robin. +running on. +Failure to allocate from this domain will fallback to round-robin. .It Dv DOMAINSET_POLICY_PREFER Memory is allocated preferentially from the single domain specified in the mask. If memory is unavailable the domains listed in the parent cpuset will be @@ -167,7 +168,7 @@ was either preposterously large or smaller than the ke The calling process did not have the credentials required to complete the operation. .It Bq Er ECAPMODE -The calling process attempted to act on a process other than itself, while +The calling process attempted to act on a process other than itself, while in capability mode. See .Xr capsicum 4 . Modified: head/lib/libc/sys/fhlink.2 ============================================================================== --- head/lib/libc/sys/fhlink.2 Fri Oct 9 19:10:00 2020 (r366582) +++ head/lib/libc/sys/fhlink.2 Fri Oct 9 19:12:44 2020 (r366583) @@ -178,7 +178,7 @@ The link count of the file pointed at by .Fa fhp would exceed 32767. .It Bq Er EACCES -A component of +A component of .Fa to prefix denies search permission. .It Bq Er EACCES Modified: head/lib/libc/sys/getitimer.2 ============================================================================== --- head/lib/libc/sys/getitimer.2 Fri Oct 9 19:10:00 2020 (r366582) +++ head/lib/libc/sys/getitimer.2 Fri Oct 9 19:12:44 2020 (r366583) @@ -28,7 +28,7 @@ .\" @(#)getitimer.2 8.3 (Berkeley) 5/16/95 .\" $FreeBSD$ .\" -.Dd May 1, 2020 +.Dd May 1, 2020 .Dt GETITIMER 2 .Os .Sh NAME Modified: head/lib/libc/sys/getsockopt.2 ============================================================================== --- head/lib/libc/sys/getsockopt.2 Fri Oct 9 19:10:00 2020 (r366582) +++ head/lib/libc/sys/getsockopt.2 Fri Oct 9 19:12:44 2020 (r366583) @@ -28,7 +28,7 @@ .\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd June 03, 2020 +.Dd June 3, 2020 .Dt GETSOCKOPT 2 .Os .Sh NAME @@ -219,7 +219,8 @@ if they all set before binding the port. Incoming TCP and UDP connections are distributed among the sharing processes based on a hash function of local port number, foreign IP -address and port number. A maximum of 256 processes can share one socket. +address and port number. +A maximum of 256 processes can share one socket. .Pp .Dv SO_KEEPALIVE enables the Modified: head/lib/libgssapi/gss_accept_sec_context.3 ============================================================================== --- head/lib/libgssapi/gss_accept_sec_context.3 Fri Oct 9 19:10:00 2020 (r366582) +++ head/lib/libgssapi/gss_accept_sec_context.3 Fri Oct 9 19:12:44 2020 (r366583) @@ -52,8 +52,9 @@ .Fa "gss_cred_id_t *delegated_cred_handle" .Fc .Sh DESCRIPTION -Allows a remotely initiated security context between the application -and a remote peer to be established. The routine may return a +Allows a remotely initiated security context between the application and a remote +peer to be established. +The routine may return a .Fa output_token which should be transferred to the peer application, where the peer application will present it to @@ -78,7 +79,8 @@ parameters. .Pp Portable applications should be constructed to use the token length and return status to determine whether a token needs to be sent or -waited for. Thus a typical portable caller should always invoke +waited for. +Thus a typical portable caller should always invoke .Fn gss_accept_sec_context within a loop: .Bd -literal @@ -166,10 +168,9 @@ returned to a caller (i.e. when accompanied by a .Dv GSS_S_COMPLETE status code), applications -should not rely on this behavior as the flag was not defined in -Version 1 of the GSS-API. Instead, applications should be prepared to -use per-message services after a successful context establishment, -according to the +should not rely on this behavior as the flag was not defined in Version 1 of the GSS-API. +Instead, applications should be prepared to use per-message services after a +successful context establishment, according to the .Dv GSS_C_INTEG_FLAG and .Dv GSS_C_CONF_FLAG values. @@ -190,9 +191,10 @@ fails, the implementation should not create a context object, and should leave the value of the context_handle parameter set to .Dv GSS_C_NO_CONTEXT to -indicate this. In the event of a failure on a subsequent call, the -implementation is permitted to delete the "half-built" security -context (in which case it should set the +indicate this. +In the event of a failure on a subsequent call, the implementation is +permitted to delete the "half-built" security context (in which case it +should set the .Fa context_handle parameter to .Dv GSS_C_NO_CONTEXT ), but the preferred behavior is to leave the Modified: head/lib/libmd/mdX.3 ============================================================================== --- head/lib/libmd/mdX.3 Fri Oct 9 19:10:00 2020 (r366582) +++ head/lib/libmd/mdX.3 Fri Oct 9 19:12:44 2020 (r366583) @@ -157,7 +157,7 @@ The .Fn MDXFile and .Fn MDXFileChunk -may return NULL when underlying +may return NULL when underlying .Xr open 2 , .Xr fstat 2 , .Xr lseek 2 , Modified: head/lib/libmd/ripemd.3 ============================================================================== --- head/lib/libmd/ripemd.3 Fri Oct 9 19:10:00 2020 (r366582) +++ head/lib/libmd/ripemd.3 Fri Oct 9 19:12:44 2020 (r366583) @@ -137,7 +137,7 @@ The .Fn RIPEMD160_File and .Fn RIPEMD160_FileChunk -may return NULL when underlying +may return NULL when underlying .Xr open 2 , .Xr fstat 2 , .Xr lseek 2 , Modified: head/lib/libmd/sha.3 ============================================================================== --- head/lib/libmd/sha.3 Fri Oct 9 19:10:00 2020 (r366582) +++ head/lib/libmd/sha.3 Fri Oct 9 19:12:44 2020 (r366583) @@ -168,7 +168,7 @@ The .Fn SHA1_File and .Fn SHA1_FileChunk -may return NULL when underlying +may return NULL when underlying .Xr open 2 , .Xr fstat 2 , .Xr lseek 2 , Modified: head/lib/libmd/sha256.3 ============================================================================== --- head/lib/libmd/sha256.3 Fri Oct 9 19:10:00 2020 (r366582) +++ head/lib/libmd/sha256.3 Fri Oct 9 19:12:44 2020 (r366583) @@ -159,7 +159,7 @@ The .Fn SHA256_File and .Fn SHA256_FileChunk -may return NULL when underlying +may return NULL when underlying .Xr open 2 , .Xr fstat 2 , .Xr lseek 2 , Modified: head/lib/libmd/sha512.3 ============================================================================== --- head/lib/libmd/sha512.3 Fri Oct 9 19:10:00 2020 (r366582) +++ head/lib/libmd/sha512.3 Fri Oct 9 19:12:44 2020 (r366583) @@ -203,7 +203,7 @@ The .Fn SHA512_File and .Fn SHA512_FileChunk -may return NULL when underlying +may return NULL when underlying .Xr open 2 , .Xr fstat 2 , .Xr lseek 2 , Modified: head/lib/libmd/skein.3 ============================================================================== --- head/lib/libmd/skein.3 Fri Oct 9 19:10:00 2020 (r366582) +++ head/lib/libmd/skein.3 Fri Oct 9 19:12:44 2020 (r366583) @@ -201,7 +201,7 @@ The .Fn SKEIN256_File and .Fn SKEIN256_FileChunk -may return NULL when underlying +may return NULL when underlying .Xr open 2 , .Xr fstat 2 , .Xr lseek 2 , @@ -220,15 +220,15 @@ These functions appeared in .Fx 11.0 . .Sh AUTHORS .An -nosplit -The core hash routines were imported from version 1.3 of the optimized +The core hash routines were imported from version 1.3 of the optimized Skein reference implementation written by .An Doug Whiting as submitted to the NSA SHA-3 contest. The algorithms were developed by -.An Niels Ferguson , +.An Niels Ferguson , .An Stefan Lucks , -.An Bruce Schneier , -.An Doug Whiting , +.An Bruce Schneier , +.An Doug Whiting , .An Mihir Bellare , .An Tadayoshi Kohno , .An Jon Callas, Modified: head/lib/libmt/mt.3 ============================================================================== --- head/lib/libmt/mt.3 Fri Oct 9 19:10:00 2020 (r366582) +++ head/lib/libmt/mt.3 Fri Oct 9 19:12:44 2020 (r366583) @@ -1,7 +1,7 @@ -.\" +.\" .\" Copyright (c) 2013, 2015 Spectra Logic Corporation .\" All rights reserved. -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -13,7 +13,7 @@ .\" ("Disclaimer") and any redistribution must be conditioned upon .\" including a substantially similar Disclaimer requirement for further .\" binary redistribution. -.\" +.\" .\" NO WARRANTY .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS .\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT @@ -26,9 +26,9 @@ .\" 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 DAMAGES. -.\" +.\" .\" Authors: Ken Merry (Spectra Logic Corporation) -.\" +.\" .\" $FreeBSD$ .\" .Dd February 13, 2015 @@ -177,7 +177,7 @@ driver returns some status data as XML-formatted strin the primary purpose of this library is to make it easier for the software developer to parse those strings and extract the status values. .Pp -The +The .Fn mt_start_element , .Fn mt_end_element , and @@ -310,7 +310,7 @@ except that it prints the results to standard output i .Pp .Fn mt_param_entry_sbuf prints the -.Ar entry +.Ar entry to the given sbuf .Ar sb . The argument @@ -361,7 +361,7 @@ See below for notes on the return values. Returns the bits per inch or bits per mm values for a given density entry specified by the .Ar density_num . -If the +If the .Ar bpi argument is non-zero, the bits per inch value is returned. Otherwise, the bits per mm value is returned. @@ -375,8 +375,8 @@ to the supplied density name. gets the current XML status / parameter string from the sa(4) driver instance referenced by the open file descriptor .Ar mtfd . -The -.Xr mtio 4 +The +.Xr mtio 4 .Xr ioctl 2 to be used is supplied as the .Ar cmd @@ -425,7 +425,7 @@ If the density is not known, will return "UNKNOWN". .Pp .Fn mt_density_bp -returns the bits per inch value for the given density (if the +returns the bits per inch value for the given density (if the .Ar bpi field is non-zero), the bits per mm value otherwise, or 0 if the supplied .Ar density_num Modified: head/lib/libpathconv/abs2rel.3 ============================================================================== --- head/lib/libpathconv/abs2rel.3 Fri Oct 9 19:10:00 2020 (r366582) +++ head/lib/libpathconv/abs2rel.3 Fri Oct 9 19:12:44 2020 (r366583) @@ -119,8 +119,8 @@ yields: path == "../../../sys/kern" /* It's correct but ... */ -That is correct, but a little redundant. If you wish get the simple -answer 'kern', do the following. +That is correct, but a little redundant. +If you wish get the simple answer 'kern', do the following. path = abs2rel(realpath("/sys/kern", r1), realpath("/sys", r2), result, MAXPATHLEN); Modified: head/lib/libpmc/pmc.sandybridge.3 ============================================================================== --- head/lib/libpmc/pmc.sandybridge.3 Fri Oct 9 19:10:00 2020 (r366582) +++ head/lib/libpmc/pmc.sandybridge.3 Fri Oct 9 19:12:44 2020 (r366583) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2012 Davide Italiano +.\" Copyright (c) 2012 Davide Italiano .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without Modified: head/lib/libpmc/pmc.sandybridgeuc.3 ============================================================================== --- head/lib/libpmc/pmc.sandybridgeuc.3 Fri Oct 9 19:10:00 2020 (r366582) +++ head/lib/libpmc/pmc.sandybridgeuc.3 Fri Oct 9 19:12:44 2020 (r366583) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2012 Davide Italiano +.\" Copyright (c) 2012 Davide Italiano .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without Modified: head/lib/libradius/libradius.3 ============================================================================== --- head/lib/libradius/libradius.3 Fri Oct 9 19:10:00 2020 (r366582) +++ head/lib/libradius/libradius.3 Fri Oct 9 19:12:44 2020 (r366583) @@ -485,7 +485,8 @@ To free the resources used by the RADIUS library, call .Fn rad_close . .Ss Server operation Server mode operates much alike to client mode, except packet send and receive -steps are swapped. To operate as server you should obtain server context with +steps are swapped. +To operate as server you should obtain server context with .Fn rad_server_open function, passing opened and bound UDP socket file descriptor as argument. You should define allowed clients and their secrets using @@ -493,9 +494,9 @@ You should define allowed clients and their secrets us function. port, timeout and max_tries arguments are ignored in server mode. You should call .Fn rad_receive_request -function to receive request from client. If you do not want to block on socket -read, you are free to use any poll(), select() or non-blocking sockets for -the socket. +function to receive request from client. +If you do not want to block on socket read, you are free to use any +poll(), select() or non-blocking sockets for the socket. Received request can be parsed with same parsing functions as for client. To respond to the request you should call .Fn rad_create_response Modified: head/lib/librpcsec_gss/rpc_gss_set_callback.3 ============================================================================== --- head/lib/librpcsec_gss/rpc_gss_set_callback.3 Fri Oct 9 19:10:00 2020 (r366582) +++ head/lib/librpcsec_gss/rpc_gss_set_callback.3 Fri Oct 9 19:12:44 2020 (r366583) @@ -74,7 +74,8 @@ GSS-API delegated credentials (if any) .It gss_context The GSS-API context .It lock -A structure used to enforce a particular QOP and service. Set +A structure used to enforce a particular QOP and service. +Set .Fa lock->locked to .Dv TRUE Modified: head/lib/libsysdecode/sysdecode_mask.3 ============================================================================== --- head/lib/libsysdecode/sysdecode_mask.3 Fri Oct 9 19:10:00 2020 (r366582) +++ head/lib/libsysdecode/sysdecode_mask.3 Fri Oct 9 19:12:44 2020 (r366583) @@ -194,17 +194,17 @@ and .Xr fcntl 2 commands. .It Fn sysdecode_sctp_nxt_flags -The +The .Fa nxt_flags member of a .Vt struct sctp_nxtinfo . .It Fn sysdecode_sctp_rcv_flags -The +The .Fa rcv_flags member of a .Vt struct sctp_rcvinfo . .It Fn sysdecode_sctp_snd_flags -The +The .Fa snd_flags member of a .Vt struct sctp_sndinfo . Modified: head/lib/libusb/libusb20.3 ============================================================================== --- head/lib/libusb/libusb20.3 Fri Oct 9 19:10:00 2020 (r366582) +++ head/lib/libusb/libusb20.3 Fri Oct 9 19:12:44 2020 (r366583) @@ -314,15 +314,16 @@ This function returns NULL in case of failure. . .Fn libusb20_tr_get_time_complete will return the completion time of an USB transfer in -millisecond units. This function is most useful for isochronous USB -transfers when doing echo cancelling. +millisecond units. +This function is most useful for isochronous USB transfers when doing echo +cancelling. . .Pp . .Fn libusb20_tr_get_actual_frames will return the actual number of USB frames after an USB -transfer completed. A value of zero means that no data was transferred. -. +transfer completed. +A value of zero means that no data was transferred. .Pp . .Fn libusb20_tr_get_actual_length @@ -691,9 +692,11 @@ Before this call will succeed the USB device must be o .Fa setup is a pointer to a decoded and host endian SETUP packet. .Fa data -is a pointer to a data transfer buffer associated with the control transaction. This argument can be NULL. +is a pointer to a data transfer buffer associated with the control transaction. +This argument can be NULL. .Fa pactlen -is a pointer to a variable that will hold the actual transfer length after the control transaction is complete. +is a pointer to a variable that will hold the actual transfer length after the +control transaction is complete. .Fa timeout is the transaction timeout given in milliseconds. A timeout of zero means no timeout. @@ -792,10 +795,11 @@ The USB device need not be opened when calling this fu .Pp . .Fn libusb20_dev_alloc_config -will read out and decode the USB config descriptor for -the given USB device and config index. This function returns a pointer -to the decoded configuration which must eventually be passed to -free(). NULL is returned in case of failure. +will read out and decode the USB config descriptor for the given USB device +and config index. +This function returns a pointer to the decoded configuration which must eventually +be passed to free(). +NULL is returned in case of failure. . .Pp . @@ -902,8 +906,8 @@ will set the global USB device side mode template to The new template is not activated until after the next USB enumeration. The template number decides how the USB device will present itself to -the USB Host, like Mass Storage Device, USB Ethernet Device. Also see -the +the USB Host, like Mass Storage Device, USB Ethernet Device. +Also see the .Xr usb2_template 4 module. This function returns zero on success else a LIBUSB20_ERROR value is @@ -966,10 +970,9 @@ returned. .Fn libusb20_be_alloc_default .Fn libusb20_be_alloc_freebsd .Fn libusb20_be_alloc_linux -These functions are used to allocate a specific USB backend or the -operating system default USB backend. Allocating a backend is a way to -scan for currently present USB devices. -. +These functions are used to allocate a specific USB backend or the operating system +default USB backend. +Allocating a backend is a way to scan for currently present USB devices. .Pp . .Fn libusb20_be_device_foreach Modified: head/lib/libutil/login_ok.3 ============================================================================== --- head/lib/libutil/login_ok.3 Fri Oct 9 19:10:00 2020 (r366582) +++ head/lib/libutil/login_ok.3 Fri Oct 9 19:12:44 2020 (r366583) @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 10, 2020 +.Dd May 10, 2020 .Dt LOGIN_OK 3 .Os .Sh NAME Modified: head/lib/msun/man/sincos.3 ============================================================================== --- head/lib/msun/man/sincos.3 Fri Oct 9 19:10:00 2020 (r366582) +++ head/lib/msun/man/sincos.3 Fri Oct 9 19:12:44 2020 (r366583) @@ -50,33 +50,33 @@ and functions compute the sine and cosine of .Fa x . Using these functions allows argument reduction to occur only -once instead of twice with individual invocations of +once instead of twice with individual invocations of .Fn sin -and +and .Fn cos . -Like +Like .Fn sin -and +and .Fn cos , a large magnitude argument may yield a result with little or no significance. .Sh RETURN VALUES -Upon returning from +Upon returning from .Fn sincos , .Fn sincosf , and .Fn sincosl , -the memory pointed to by -.Ar "*s" +the memory pointed to by +.Ar "*s" and -.Ar "*c" +.Ar "*c" are assigned the values of sine and cosine, respectively. .Sh SEE ALSO .Xr cos 3 , .Xr sin 3 , .Sh HISTORY -These functions were added to +These functions were added to .Fx 9.0 -to aid in writing various complex function contained in +to aid in writing various complex function contained in .St -isoC-99 . Modified: head/share/man/man4/fdt_pinctrl.4 ============================================================================== --- head/share/man/man4/fdt_pinctrl.4 Fri Oct 9 19:10:00 2020 (r366582) +++ head/share/man/man4/fdt_pinctrl.4 Fri Oct 9 19:12:44 2020 (r366583) @@ -33,10 +33,9 @@ .Sh SYNOPSIS .Cd "device fdt_pinctrl" .Sh DESCRIPTION -.Pp Pin multiplexing is a technology used to re-purpose a single physical connection (depending on chip packaging it may be -pin, ball, or pad) by routing its signal to any one of several +pin, ball, or pad) by routing its signal to any one of several different SoC internal devices. For example, based on the actual device design, a single SoC chip pin might perform any of these roles: SPI clock, I2C Modified: head/share/man/man4/ig4.4 ============================================================================== --- head/share/man/man4/ig4.4 Fri Oct 9 19:10:00 2020 (r366582) +++ head/share/man/man4/ig4.4 Fri Oct 9 19:12:44 2020 (r366583) @@ -71,7 +71,7 @@ device with the same unit number. .An -nosplit The .Nm -driver was written for +driver was written for .Dx by .An Matthew Dillon Modified: head/share/man/man4/man4.i386/ce.4 ============================================================================== --- head/share/man/man4/man4.i386/ce.4 Fri Oct 9 19:10:00 2020 (r366582) +++ head/share/man/man4/man4.i386/ce.4 Fri Oct 9 19:12:44 2020 (r366583) @@ -9,7 +9,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" +.\" .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/share/man/man4/mlx5io.4 ============================================================================== --- head/share/man/man4/mlx5io.4 Fri Oct 9 19:10:00 2020 (r366582) +++ head/share/man/man4/mlx5io.4 Fri Oct 9 19:12:44 2020 (r366583) @@ -10,7 +10,7 @@ .\" 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 Modified: head/share/man/man4/mrsas.4 ============================================================================== --- head/share/man/man4/mrsas.4 Fri Oct 9 19:10:00 2020 (r366582) +++ head/share/man/man4/mrsas.4 Fri Oct 9 19:12:44 2020 (r366583) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Mar 13, 2019 +.Dd March 13, 2019 .Dt MRSAS 4 .Os .Sh NAME Modified: head/share/man/man4/ng_pppoe.4 ============================================================================== --- head/share/man/man4/ng_pppoe.4 Fri Oct 9 19:10:00 2020 (r366582) +++ head/share/man/man4/ng_pppoe.4 Fri Oct 9 19:12:44 2020 (r366583) @@ -110,9 +110,9 @@ using the .Qq Li [AC-Name\\][Host-Uniq|]Service-Name syntax. To set a binary Host-Uniq, it must be encoded as a hexadecimal lowercase -string and prefixed with +string and prefixed with .Qq Li 0x , -for example +for example .Qq Li 0x6d792d746167 is equivalent to .Qq Li my-tag . Modified: head/share/man/man4/qlxgbe.4 ============================================================================== --- head/share/man/man4/qlxgbe.4 Fri Oct 9 19:10:00 2020 (r366582) +++ head/share/man/man4/qlxgbe.4 Fri Oct 9 19:12:44 2020 (r366583) @@ -53,7 +53,7 @@ TCP and UDP checksum offload for both IPv4 and IPv6, Large Segment Offload for both IPv4 and IPv6, Jumbo frames, VLAN Tag, and Receive Side scaling, ability to select either HW or Software LRO, -when LRO is enabled (default HW LRO). +when LRO is enabled (default HW LRO). For further hardware information, see .Pa http://www.qlogic.com/ . .Sh HARDWARE Modified: head/share/man/man4/rtwn.4 ============================================================================== --- head/share/man/man4/rtwn.4 Fri Oct 9 19:10:00 2020 (r366582) +++ head/share/man/man4/rtwn.4 Fri Oct 9 19:12:44 2020 (r366583) @@ -150,9 +150,9 @@ prompt before booting the kernel or stored in .It Va dev.rtwn.%d.hwcrypto This tunable controls how key slots are assigned: .br -0 - disable h/w crypto support. Features that require access -to frame contents (e.g., TCP/UDP/IP Rx checksum validation) -will not work; +0 - disable h/w crypto support. +Features that require access to frame contents (e.g., TCP/UDP/IP Rx +checksum validation) will not work; .br 1 - use h/w crypto support for pairwise keys only; .br Modified: head/share/man/man4/sa.4 ============================================================================== --- head/share/man/man4/sa.4 Fri Oct 9 19:10:00 2020 (r366582) +++ head/share/man/man4/sa.4 Fri Oct 9 19:12:44 2020 (r366583) @@ -251,7 +251,7 @@ The user can query parameters using (which uses the .Dv MTIOCPARAMGET ioctl) and the user can set parameters using -.Dq mt param -s +.Dq mt param -s (which uses the .Dv MTIOCPARAMSET ioctl). @@ -281,13 +281,13 @@ driver reports entering Programmable Early Warning, Ea of Media conditions by returning a write with 0 bytes written, and .Dv errno set to 0. -If +If .Va eot_warn is set to 1, the .Nm driver will set .Dv errno -to +to .Dv ENOSPC when it enters any of the out of space conditions. .It protection.protection_supported @@ -353,10 +353,10 @@ In addition, when EOM is injected, the tape position s to temporarily show Beyond of the Programmable Early Warning (BPEW) status. To see BPEW status, use the .Dv MTIOCEXTGET -ioctl, which is used by the -.Dq mt status +ioctl, which is used by the +.Dq mt status command. -To inject an EOM notification, set the +To inject an EOM notification, set the .Pp .Va kern.cam.sa.%d.inject_eom .Pp Modified: head/share/man/man4/smartpqi.4 ============================================================================== --- head/share/man/man4/smartpqi.4 Fri Oct 9 19:10:00 2020 (r366582) +++ head/share/man/man4/smartpqi.4 Fri Oct 9 19:12:44 2020 (r366583) @@ -71,7 +71,7 @@ driver include: .It HPE Gen10 Smart Array Controller Family .It -OEM Controllers based on the Microsemi Chipset +OEM Controllers based on the Microsemi Chipset .El .Sh FILES .Bl -tag -width /boot/kernel/aac.ko -compact Modified: head/share/man/man4/spigen.4 ============================================================================== --- head/share/man/man4/spigen.4 Fri Oct 9 19:10:00 2020 (r366582) +++ head/share/man/man4/spigen.4 Fri Oct 9 19:12:44 2020 (r366583) @@ -58,7 +58,7 @@ line on the bus, and all I/O performed through that in with that chip-select line asserted. .Pp SPI data transfers are inherently bi-directional; there are not separate -read and write operations. +read and write operations. When commands and data are sent to a device, data also comes back from the device, although in some cases the data may not be useful (or even documented or predictable for some devices). @@ -129,7 +129,7 @@ The setting remains in effect for subsequent transfers is not necessary to reset this before each transfer. .El .Sh HINTS CONFIGURATION -On a +On a .Xr device.hints 5 based system, such as .Li MIPS , Modified: head/share/man/man4/syscons.4 ============================================================================== --- head/share/man/man4/syscons.4 Fri Oct 9 19:10:00 2020 (r366582) +++ head/share/man/man4/syscons.4 Fri Oct 9 19:12:44 2020 (r366583) @@ -422,7 +422,7 @@ These options remove the .Qq dumb , .Qq sc , and -.Qq scteken +.Qq scteken terminal emulators, respectively. .El .Ss Driver Flags Modified: head/share/man/man4/udbp.4 ============================================================================== --- head/share/man/man4/udbp.4 Fri Oct 9 19:10:00 2020 (r366582) +++ head/share/man/man4/udbp.4 Fri Oct 9 19:12:44 2020 (r366583) @@ -118,7 +118,7 @@ has been expressly designed to follow its specificatio .Xr ngctl 8 .\" .Rs -.%B Universal Serial Bus: Communications Class Subclass Specification for Ethernet Emulation Model Devices +.%B Universal Serial Bus: Communications Class Subclass Specification for Ethernet Emulation Model Devices .%N Revision 1.0 .%D February 2, 2005 .%I USB Implementers Forum, Inc. @@ -136,8 +136,8 @@ makes them unsuitable as a "drop-in" replacement for a for a USB 3.0 SuperSpeed cable, latency is comparable to 100BaseTX Ethernet (but often worse), with throughput comparable to 2.5GBASE-T. .Pp -However, their energy efficiency makes them attractive for embedded -applications. A Plugable PL27A1 cable claims 24mA of USB3 bus power, +However, their energy efficiency makes them attractive for embedded applications. +A Plugable PL27A1 cable claims 24mA of USB3 bus power, as compared to 150mA for a typical USB 3.0 to Gigabit Ethernet interface. .Sh HISTORY The @@ -160,6 +160,6 @@ and .An Nick Hibma Aq Mt n_hibma@FreeBSD.org . .Pp This manual page was written by -.An Nick Hibma Aq Mt n_hibma@FreeBSD.org +.An Nick Hibma Aq Mt n_hibma@FreeBSD.org and updated by .An Bruce Simpson Aq Mt bms@FreeBSD.org . Modified: head/share/man/man9/OF_finddevice.9 ============================================================================== --- head/share/man/man9/OF_finddevice.9 Fri Oct 9 19:10:00 2020 (r366582) +++ head/share/man/man9/OF_finddevice.9 Fri Oct 9 19:12:44 2020 (r366583) @@ -37,23 +37,10 @@ .Ft phandle_t .Fn OF_finddevice "const char *path" .Sh DESCRIPTION -.Pp .Fn OF_finddevice returns the phandle for the node specified by the .Fa path . Returns -1 if the path cannot be found in the tree. -.Sh CAVEATS -The return value should only be checked with equality -operators (equal to, not equal to) and not relational comparison -(less than, greater than ). -There is a discrepancy between IEEE 1275 standard and -.Fx Ns 's -internal representation of a phandle: IEEE 1275 -requires the return value of this function to be -1 if the path -is not found. -But phandle_t is an unsigned type, so it cannot -be relationally compared with -1 or 0, this comparison -is always true or always false. .Sh EXAMPLES .Bd -literal phandle_t root, i2c; @@ -72,3 +59,15 @@ is always true or always false. .An -nosplit This manual page was written by .An Oleksandr Tymoshenko Aq Mt gonzo@FreeBSD.org . +.Sh CAVEATS +The return value should only be checked with equality +operators (equal to, not equal to) and not relational comparison +(less than, greater than ). +There is a discrepancy between IEEE 1275 standard and +.Fx Ns 's +internal representation of a phandle: IEEE 1275 +requires the return value of this function to be -1 if the path +is not found. +But phandle_t is an unsigned type, so it cannot +be relationally compared with -1 or 0, this comparison +is always true or always false. Modified: head/share/man/man9/backlight.9 ============================================================================== --- head/share/man/man9/backlight.9 Fri Oct 9 19:10:00 2020 (r366582) +++ head/share/man/man9/backlight.9 Fri Oct 9 19:12:44 2020 (r366583) @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 02, 2020 +.Dd October 2, 2020 .Dt BACKLIGHT 9 .Os .Sh NAME Modified: head/share/man/man9/vnet.9 ============================================================================== --- head/share/man/man9/vnet.9 Fri Oct 9 19:10:00 2020 (r366582) +++ head/share/man/man9/vnet.9 Fri Oct 9 19:12:44 2020 (r366583) @@ -39,7 +39,6 @@ .Cd "options VNET_DEBUG" .Pp .In sys/vnet.h -.Pp .\"------------------------------------------------------------ .Ss "Constants and Global Variables" .\" Modified: head/usr.bin/dpv/dpv.1 ============================================================================== --- head/usr.bin/dpv/dpv.1 Fri Oct 9 19:10:00 2020 (r366582) +++ head/usr.bin/dpv/dpv.1 Fri Oct 9 19:12:44 2020 (r366583) @@ -144,7 +144,8 @@ Prevent visually distracting initialization/exit routi .Xr dialog 1 several times. .It Fl l -Line mode. Read lines from input instead of bytes. +Line mode. +Read lines from input instead of bytes. .It Fl L Ar size Label size. If negative, shrink to longest label width. Modified: head/usr.bin/indent/indent.1 ============================================================================== --- head/usr.bin/indent/indent.1 Fri Oct 9 19:10:00 2020 (r366582) +++ head/usr.bin/indent/indent.1 Fri Oct 9 19:12:44 2020 (r366583) @@ -122,7 +122,8 @@ is named .Sq Pa /blah/blah/file , the backup file is named .Sq Pa file.BAK -by default. The extension used for the backup file may be overridden using the +by default. +The extension used for the backup file may be overridden using the .Ev SIMPLE_BACKUP_SUFFIX environment variable. .Pp Modified: head/usr.bin/localedef/localedef.1 ============================================================================== --- head/usr.bin/localedef/localedef.1 Fri Oct 9 19:10:00 2020 (r366582) +++ head/usr.bin/localedef/localedef.1 Fri Oct 9 19:12:44 2020 (r366583) @@ -124,9 +124,9 @@ See .Sx NOTES . .It Fl U Ignore the presence of character symbols that have no matching character -definition. This facilitates the use of a common locale definition file -to be used across multiple encodings, even when some symbols are not -present in a given encoding. +definition. +This facilitates the use of a common locale definition file to be used across multiple +encodings, even when some symbols are not present in a given encoding. .It Fl v Emit verbose debugging output on standard output. .It Fl w Ar widthfile Modified: head/usr.bin/mkimg/mkimg.1 ============================================================================== --- head/usr.bin/mkimg/mkimg.1 Fri Oct 9 19:10:00 2020 (r366582) +++ head/usr.bin/mkimg/mkimg.1 Fri Oct 9 19:12:44 2020 (r366583) @@ -223,8 +223,8 @@ The preferred file extension is ".qcow" and ".qcow2" f (resp.), but ".qcow" is sometimes used for version 2 files as well. .Ss RAW file format This file format is a sector by sector representation of an actual disk. -There is no extra information that describes or relates to the format -itself. The size of the file is the size of the (virtual) disk. +There is no extra information that describes or relates to the format itself. +The size of the file is the size of the (virtual) disk. This file format is suitable for being copyied onto a disk with utilities like .Nm dd . Modified: head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 ============================================================================== --- head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 Fri Oct 9 19:10:00 2020 (r366582) +++ head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 Fri Oct 9 19:12:44 2020 (r366583) @@ -148,7 +148,8 @@ Information (SMIv2). The context to query with SNMPv3 PDUs. .Bl -tag -width \& .It Cm context=name -The context name. Default is "" (empty). +The context name. +Default is "" (empty). .It Cm context-engine=engine-id The SNMP Engine ID of the context to query with SNMPv3 PDUs, represented as binary octet string. Modified: head/usr.sbin/camdd/camdd.8 ============================================================================== --- head/usr.sbin/camdd/camdd.8 Fri Oct 9 19:10:00 2020 (r366582) +++ head/usr.sbin/camdd/camdd.8 Fri Oct 9 19:12:44 2020 (r366583) @@ -1,7 +1,7 @@ -.\" +.\" .\" Copyright (c) 2015 Spectra Logic Corporation .\" All rights reserved. -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -13,7 +13,7 @@ .\" ("Disclaimer") and any redistribution must be conditioned upon .\" including a substantially similar Disclaimer requirement for further .\" binary redistribution. -.\" +.\" .\" NO WARRANTY .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS .\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT @@ -26,11 +26,11 @@ .\" 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 DAMAGES. -.\" +.\" .\" Authors: Ken Merry (Spectra Logic Corporation) -.\" -.\" $FreeBSD$ .\" +.\" $FreeBSD$ +.\ .Dd November 11, 2015 .Dt CAMDD 8 .Os @@ -70,7 +70,7 @@ The following options are available: .Bl -tag -width 12n .It Fl i | o Ar args Specify the input and output device or file. -Both +Both .Fl i and .Fl o @@ -96,7 +96,7 @@ name and unit number, for instance or a regular peripheral driver name and unit number, for instance .Dq da5 . It can also be the path of a -.Xr pass 4 +.Xr pass 4 or other disk device, like .Dq /dev/da5 . It may also be a bus:target:lun, for example: @@ -127,7 +127,7 @@ It does support probing disk sector size and capacity blocksize and maximum transfer size information. The file interface supports standard files, disks, tape drives, special devices, pipes and standard input and output. -If the file is specified as a +If the file is specified as a .Dq - , standard input or standard output are used. For tape devices, the specified blocksize will be the size that @@ -138,7 +138,7 @@ size. So, that means .Nm will not write anything smaller than the sector size. -At the end of a transfer, if there isn't sufficient data from the reader +At the end of a transfer, if there isn't sufficient data from the reader to yield a full block, .Nm will add zeros on the end of the data from the reader to make up a full @@ -171,7 +171,7 @@ Specify a desired queue depth for the input or output will attempt to keep the requested number of requests of the specified blocksize queued to the input or output device. Queue depths greater than 1 are only supported for the asynchronous -.Xr pass 4 +.Xr pass 4 output method. The queue depth is maintained on a best effort basis, and may not be possible to maintain for especially fast devices. @@ -261,7 +261,7 @@ Stop the transfer after 100MB has been written. Copy disk da8 using a 1MB blocksize and desired queue depth of 3 to the file disk.img. .Pp -.Dl camdd -i file=/etc/rc -o file=- +.Dl camdd -i file=/etc/rc -o file=- .Pp Read the file /etc/rc and write it to standard output. .Pp Modified: head/usr.sbin/mlx5tool/mlx5tool.8 ============================================================================== --- head/usr.sbin/mlx5tool/mlx5tool.8 Fri Oct 9 19:10:00 2020 (r366582) +++ head/usr.sbin/mlx5tool/mlx5tool.8 Fri Oct 9 19:12:44 2020 (r366583) @@ -10,7 +10,7 @@ .\" 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 Modified: head/usr.sbin/nfsd/pnfsserver.4 ============================================================================== --- head/usr.sbin/nfsd/pnfsserver.4 Fri Oct 9 19:10:00 2020 (r366582) +++ head/usr.sbin/nfsd/pnfsserver.4 Fri Oct 9 19:12:44 2020 (r366583) @@ -266,7 +266,7 @@ Note that the must be the exac string used when the DS was mounted on the MDS. .Pp Once the mirrored DS has been disabled, the pNFS service should continue to -function, but file updates will only happen on the DS(s) +function, but file updates will only happen on the DS(s) that have not been disabled. Assuming two way mirroring, that implies the one DS of the pair stored in the .Dq pnfsd.dsfile Modified: head/usr.sbin/zonectl/zonectl.8 ============================================================================== --- head/usr.sbin/zonectl/zonectl.8 Fri Oct 9 19:10:00 2020 (r366582) +++ head/usr.sbin/zonectl/zonectl.8 Fri Oct 9 19:12:44 2020 (r366583) @@ -1,7 +1,7 @@ -.\" +.\" .\" Copyright (c) 2015 Spectra Logic Corporation .\" All rights reserved. -.\" +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -13,7 +13,7 @@ .\" ("Disclaimer") and any redistribution must be conditioned upon .\" including a substantially similar Disclaimer requirement for further .\" binary redistribution. -.\" +.\" .\" NO WARRANTY .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS .\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT @@ -26,11 +26,11 @@ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Oct 9 20:13: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 80B0642BE57 for ; Fri, 9 Oct 2020 20:13:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) (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 4C7K5D0F6zz4pwZ for ; Fri, 9 Oct 2020 20:13:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf35.google.com with SMTP id bl9so5354697qvb.10 for ; Fri, 09 Oct 2020 13:13:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=E4DvHZfegp7U1G8Cos7RjkcaKeraE3GXOQH80Do5jIA=; b=YDenw7cpv2a5vAxIMUyC7AzyhTZyX6jD9W1Oitbd1ocM+DXIb/+1/aMaK52gf0AQrX pGnSG3Jcyrp8I+F8UOjVirJ4D0VO+EwzjDo2b2RjyoViG8hLr/IJgiWV3FWYV9/zXwEc NeW97b+rIYLh4gWsdsaKalRZkpdP7ARgWMv4ao3hUQmBSlcViqFwuVM81W5sWWoQK4+W wAe8vlEO/8Lq2M2HvbuS0mOwx9PvjZnLr0Mz99pjKIxm00KqnxzCuyThNzYyOleRntjw VHxqWHIpA5s2ZGAJ6wEeZhx10EF4ssmdXDue2YXtsDDL6azeLl+xCKH803aeZ6JAcxDk 6+/g== 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=E4DvHZfegp7U1G8Cos7RjkcaKeraE3GXOQH80Do5jIA=; b=UqGGMEqi0bq3+aS8GyhPjNAC+jOAYIi4r0Jd/4aevHpTquzVWBE6Xzi00Y8mG+RZET 6qPzfl2zXucy+JtvdJx8/q3csOq7jS3OhwfWw/eyBLu9KAJZyhN+qspDXfcxhiahDNEj lSQuiiW0zqJzlxYqERmhYH2Uju1qNaI6X64admx3Y1xIDs+b8fDMMkFF+HT0igf15VOW hmUKChTMZTi2FyIpwWW3i3Tb4LpNKwVTtZOIuD0BH4SSW11ldvXdZlkgRyyeZ+VRmgQW nxx2GZ++XpVOfVx1jeg9ALSYfOLg4/RPeR7miH5kkqMM75jDWfn98WxjvnjggkBImrPN BN4w== X-Gm-Message-State: AOAM5308PlRlCNsgoWjS5Ese+vhP3Tc/T66cih+0QFAVu6uOVHDfw7Av Rg2K6Ry/nkxrZL40NI2i7lDBPRyJfEOc1wOXuVr9NzeXJ2EjcQ== X-Google-Smtp-Source: ABdhPJwh+gi0Zw9hEH4A3yuaDL+3EJgHSeZobwUl+Ymd0KG9chWiIyVCuomHiIyxIZFcSV+GSUl43CT8e4dKh5UcpKc= X-Received: by 2002:a05:6214:174f:: with SMTP id dc15mr14059435qvb.26.1602274399025; Fri, 09 Oct 2020 13:13:19 -0700 (PDT) MIME-Version: 1.0 References: <202010091529.099FT6Ab049635@repo.freebsd.org> <2f49af1f-f0fb-f5f0-82bf-8b46ead027c1@FreeBSD.org> <563930e3-19ec-44dd-fd6f-1d55859d9235@FreeBSD.org> In-Reply-To: From: Warner Losh Date: Fri, 9 Oct 2020 14:13:08 -0600 Message-ID: Subject: Re: svn commit: r366578 - head/sbin/devd To: Renato Botelho Cc: Warner Losh , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4C7K5D0F6zz4pwZ X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=YDenw7cp; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::f35) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.65 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.95)[-0.954]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.98)[-0.979]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.72)[-0.716]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f35:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; MAILMAN_DEST(0.00)[svn-src-head]; RCVD_COUNT_TWO(0.00)[2] 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: Fri, 09 Oct 2020 20:13:21 -0000 On Fri, Oct 9, 2020 at 12:47 PM Warner Losh wrote: > > > On Fri, Oct 9, 2020, 12:20 PM Renato Botelho wrote: > >> On 09/10/20 15:16, Renato Botelho wrote: >> > On 09/10/20 13:57, Warner Losh wrote: >> >> >> >> >> >> On Fri, Oct 9, 2020 at 10:19 AM Renato Botelho > >> > wrote: >> >> >> >> On 09/10/20 12:29, Warner Losh wrote: >> >> > Author: imp >> >> > Date: Fri Oct 9 15:29:05 2020 >> >> > New Revision: 366578 >> >> > URL: https://svnweb.freebsd.org/changeset/base/366578 >> >> >> >> > >> >> > Log: >> >> > Avoid using single quotes in arguments to logger. >> >> > >> >> > Single quotes interfere with the workaround put in with >> >> r335753 and >> >> > aren't necessary in this case. I believe that all the >> >> underling issues >> >> > with r335753 have been corrected, but need to do more >> extensive >> >> > followup before reverting it as a bad idea. >> >> >> >> Hi Warner, >> >> >> >> How to proceed if it's needed to pass multiple parameters to a >> >> command >> >> in following format? >> >> >> >> cmd param1 'param2 has spaces and a $variable' >> >> >> >> >> >> action "cmd param1 'param2 has spaces and a '$variable"; >> >> >> >> should do the trick. I'm documenting this now... >> > >> > It worked!! Thanks! >> >> Oooops, too fast. >> >> I wrote this script: >> >> #!/bin/sh >> >> echo "Param1 = '${1}'" >> /root/log >> echo "Param2 = '${2}'" >> /root/log >> >> And added this action on devd config: >> >> notify 0 { >> match "system" "IFNET"; >> match "type" "LINK_UP"; >> media-type "ethernet"; >> action "/root/log.sh -c 'interface linkup start '$subsystem"; >> }; >> >> notify 0 { >> match "system" "IFNET"; >> match "type" "LINK_DOWN"; >> media-type "ethernet"; >> action "/root/log.sh -c 'interface linkup stop '$subsystem"; >> }; >> >> And got the following output on /root/log: >> >> Param1 = '-c' >> Param2 = 'interface linkup start $em0' >> > > Doh. I'll dig deeper. > It works for me. Did you remember to kill -HUP devd? Warner From owner-svn-src-head@freebsd.org Fri Oct 9 20:20: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 5E9A742C08C; Fri, 9 Oct 2020 20:20:43 +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 4C7KFl1tPwz4qCS; Fri, 9 Oct 2020 20:20:43 +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 1FC301EF58; Fri, 9 Oct 2020 20:20:43 +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 099KKhOP030800; Fri, 9 Oct 2020 20:20:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 099KKgPM030799; Fri, 9 Oct 2020 20:20:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202010092020.099KKgPM030799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 9 Oct 2020 20:20:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366584 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366584 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, 09 Oct 2020 20:20:43 -0000 Author: jhb Date: Fri Oct 9 20:20:42 2020 New Revision: 366584 URL: https://svnweb.freebsd.org/changeset/base/366584 Log: Don't invoke semunload() if seminit() fails during MOD_LOAD. The module handler code invokes a MOD_UNLOAD event immediately if MOD_LOAD fails. The result was that if seminit() failed, semunload() was invoked twice. semunload() is not idempotent however and would try to remove it's process_exit eventhandler twice resulting in a panic. Reviewed by: kib, markj Obtained from: CheriBSD MFC after: 1 month Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26696 Modified: head/sys/kern/sysv_sem.c Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Fri Oct 9 19:12:44 2020 (r366583) +++ head/sys/kern/sysv_sem.c Fri Oct 9 20:20:42 2020 (r366584) @@ -381,8 +381,6 @@ sysvsem_modload(struct module *module, int cmd, void * switch (cmd) { case MOD_LOAD: error = seminit(); - if (error != 0) - semunload(); break; case MOD_UNLOAD: error = semunload(); From owner-svn-src-head@freebsd.org Fri Oct 9 20:31: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 7F69C42C504; Fri, 9 Oct 2020 20:31:43 +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 4C7KVR2pspz4rD5; Fri, 9 Oct 2020 20:31:43 +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 42B261F0C1; Fri, 9 Oct 2020 20:31:43 +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 099KVhjT040735; Fri, 9 Oct 2020 20:31:43 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 099KVhxm040734; Fri, 9 Oct 2020 20:31:43 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010092031.099KVhxm040734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 9 Oct 2020 20:31:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366587 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 366587 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, 09 Oct 2020 20:31:43 -0000 Author: mjg Date: Fri Oct 9 20:31:42 2020 New Revision: 366587 URL: https://svnweb.freebsd.org/changeset/base/366587 Log: vfs: fix a panic when truncating comming from copy_file_range Truncating requires an exclusive lock, but it was not taken if the filesystem indicates support for shared writes. This only concerns ZFS. In particular fixes cp of files which have trailing holes. Reported by: bdrewery Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Fri Oct 9 20:30:27 2020 (r366586) +++ head/sys/kern/vfs_vnops.c Fri Oct 9 20:31:42 2020 (r366587) @@ -2975,18 +2975,22 @@ vn_write_outvp(struct vnode *outvp, char *dat, off_t o bwillwrite(); mp = NULL; error = vn_start_write(outvp, &mp, V_WAIT); - if (error == 0) { + if (error != 0) + break; + if (growfile) { + error = vn_lock(outvp, LK_EXCLUSIVE); + if (error == 0) { + error = vn_truncate_locked(outvp, outoff + xfer, + false, cred); + VOP_UNLOCK(outvp); + } + } else { if (MNT_SHARED_WRITES(mp)) lckf = LK_SHARED; else lckf = LK_EXCLUSIVE; error = vn_lock(outvp, lckf); - } - if (error == 0) { - if (growfile) - error = vn_truncate_locked(outvp, outoff + xfer, - false, cred); - else { + if (error == 0) { error = vn_rdwr(UIO_WRITE, outvp, dat, xfer2, outoff, UIO_SYSSPACE, IO_NODELOCKED, curthread->td_ucred, cred, NULL, curthread); From owner-svn-src-head@freebsd.org Fri Oct 9 22:23: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 3F6B342F282; Fri, 9 Oct 2020 22:23:40 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C7Mzc1Jbrz3VLv; Fri, 9 Oct 2020 22:23:40 +0000 (UTC) (envelope-from np@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 EB3DC20577; Fri, 9 Oct 2020 22:23:39 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 099MNdIt012570; Fri, 9 Oct 2020 22:23:39 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 099MNdOD012568; Fri, 9 Oct 2020 22:23:39 GMT (envelope-from np@FreeBSD.org) Message-Id: <202010092223.099MNdOD012568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 9 Oct 2020 22:23:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366589 - in head/sys/dev/cxgbe: . common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 366589 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, 09 Oct 2020 22:23:40 -0000 Author: np Date: Fri Oct 9 22:23:39 2020 New Revision: 366589 URL: https://svnweb.freebsd.org/changeset/base/366589 Log: cxgbe(4): More fixes for the T6 FCS error counter. r365732 was the first attempt to get an accurate count but it was writing to some read-only registers to clear them and that obviously didn't work. Instead, note the counter's value when it is supposed to be cleared and subtract it from future readings. dev..stats.rx_fcs_error should not be serviced from the MPS register for T6. The stats.* sysctls should all use T5_PORT_REG for T5 and above. This must have been missed in the initial T5 support years ago. Fix it while here. MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Fri Oct 9 21:01:53 2020 (r366588) +++ head/sys/dev/cxgbe/adapter.h Fri Oct 9 22:23:39 2020 (r366589) @@ -314,6 +314,8 @@ struct port_info { struct port_stats stats; u_int tnl_cong_drops; u_int tx_parse_error; + int fcs_reg; + uint64_t fcs_base; u_long tx_toe_tls_records; u_long tx_toe_tls_octets; u_long rx_toe_tls_records; Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Fri Oct 9 21:01:53 2020 (r366588) +++ head/sys/dev/cxgbe/common/t4_hw.c Fri Oct 9 22:23:39 2020 (r366589) @@ -6852,8 +6852,8 @@ void t4_get_port_stats_offset(struct adapter *adap, in */ void t4_get_port_stats(struct adapter *adap, int idx, struct port_stats *p) { - u32 bgmap = adap2pinfo(adap, idx)->mps_bg_map; - struct link_config *lc = &adap->port[idx]->link_cfg; + struct port_info *pi = adap->port[idx]; + u32 bgmap = pi->mps_bg_map; u32 stat_ctl = t4_read_reg(adap, A_MPS_STAT_CTL); #define GET_STAT(name) \ @@ -6922,25 +6922,8 @@ void t4_get_port_stats(struct adapter *adap, int idx, p->rx_ppp6 = GET_STAT(RX_PORT_PPP6); p->rx_ppp7 = GET_STAT(RX_PORT_PPP7); - /* - * The T6's MPS's RX_PORT_CRC_ERROR register doesn't actually count CRC - * errors so get that information from the MAC instead. Which MAC is in - * use depends on speed and FEC. The MAC counters clear on reset or - * link state change so we are only reporting errors for this - * incarnation of the link here. - */ - if (chip_id(adap) != CHELSIO_T6) - p->rx_fcs_err = GET_STAT(RX_PORT_CRC_ERROR); - else if (lc->link_ok) { - if (lc->speed > 25000 || - (lc->speed == 25000 && lc->fec == FEC_RS)) { - p->rx_fcs_err = t4_read_reg64(adap, T5_PORT_REG(idx, - A_MAC_PORT_AFRAMECHECKSEQUENCEERRORS)); - } else { - p->rx_fcs_err = t4_read_reg64(adap, T5_PORT_REG(idx, - A_MAC_PORT_MTIP_1G10G_RX_CRCERRORS)); - } - } + if (pi->fcs_reg != -1) + p->rx_fcs_err = t4_read_reg64(adap, pi->fcs_reg) - pi->fcs_base; if (chip_id(adap) >= CHELSIO_T5) { if (stat_ctl & F_COUNTPAUSESTATRX) { @@ -10769,12 +10752,6 @@ void t4_clr_port_stats(struct adapter *adap, int idx) t4_write_reg(adap, A_MPS_STAT_RX_BG_0_MAC_TRUNC_FRAME_L + i * 8, 0); } - if (chip_id(adap) == CHELSIO_T6) { - t4_write_reg64(adap, T5_PORT_REG(idx, - A_MAC_PORT_AFRAMECHECKSEQUENCEERRORS), 0); - t4_write_reg64(adap, T5_PORT_REG(idx, - A_MAC_PORT_MTIP_1G10G_RX_CRCERRORS), 0); - } } /** Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Oct 9 21:01:53 2020 (r366588) +++ head/sys/dev/cxgbe/t4_main.c Fri Oct 9 22:23:39 2020 (r366589) @@ -1253,6 +1253,23 @@ t4_attach(device_t dev) mtx_init(&pi->pi_lock, pi->lockname, 0, MTX_DEF); sc->chan_map[pi->tx_chan] = i; + /* + * The MPS counter for FCS errors doesn't work correctly on the + * T6 so we use the MAC counter here. Which MAC is in use + * depends on the link settings which will be known when the + * link comes up. + */ + if (is_t6(sc)) { + pi->fcs_reg = -1; + } else if (is_t4(sc)) { + pi->fcs_reg = PORT_REG(pi->tx_chan, + A_MPS_PORT_STAT_RX_PORT_CRC_ERROR_L); + } else { + pi->fcs_reg = T5_PORT_REG(pi->tx_chan, + A_MPS_PORT_STAT_RX_PORT_CRC_ERROR_L); + } + pi->fcs_base = 0; + /* All VIs on this port share this media. */ ifmedia_init(&pi->media, IFM_IMASK, cxgbe_media_change, cxgbe_media_status); @@ -7049,155 +7066,88 @@ cxgbe_sysctls(struct port_info *pi) &pi->tx_parse_error, 0, "# of tx packets with invalid length or # of segments"); -#define SYSCTL_ADD_T4_REG64(pi, name, desc, reg) \ - SYSCTL_ADD_OID(ctx, children, OID_AUTO, name, \ - CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, reg, \ +#define T4_REGSTAT(name, stat, desc) \ + SYSCTL_ADD_OID(ctx, children, OID_AUTO, #name, \ + CTLTYPE_U64 | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, \ + (is_t4(sc) ? PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_##stat##_L) : \ + T5_PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_##stat##_L)), \ sysctl_handle_t4_reg64, "QU", desc) - SYSCTL_ADD_T4_REG64(pi, "tx_octets", "# of octets in good frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_BYTES_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_frames", "total # of good frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_FRAMES_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_bcast_frames", "# of broadcast frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_BCAST_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_mcast_frames", "# of multicast frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_MCAST_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_ucast_frames", "# of unicast frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_UCAST_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_error_frames", "# of error frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_ERROR_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_frames_64", - "# of tx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_64B_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_frames_65_127", - "# of tx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_65B_127B_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_frames_128_255", - "# of tx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_128B_255B_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_frames_256_511", - "# of tx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_256B_511B_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_frames_512_1023", - "# of tx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_512B_1023B_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_frames_1024_1518", - "# of tx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_1024B_1518B_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_frames_1519_max", - "# of tx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_1519B_MAX_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_drop", "# of dropped tx frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_DROP_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_pause", "# of pause frames transmitted", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_PAUSE_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_ppp0", "# of PPP prio 0 frames transmitted", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_PPP0_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_ppp1", "# of PPP prio 1 frames transmitted", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_PPP1_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_ppp2", "# of PPP prio 2 frames transmitted", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_PPP2_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_ppp3", "# of PPP prio 3 frames transmitted", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_PPP3_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_ppp4", "# of PPP prio 4 frames transmitted", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_PPP4_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_ppp5", "# of PPP prio 5 frames transmitted", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_PPP5_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_ppp6", "# of PPP prio 6 frames transmitted", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_PPP6_L)); - SYSCTL_ADD_T4_REG64(pi, "tx_ppp7", "# of PPP prio 7 frames transmitted", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_TX_PORT_PPP7_L)); - - SYSCTL_ADD_T4_REG64(pi, "rx_octets", "# of octets in good frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_BYTES_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_frames", "total # of good frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_FRAMES_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_bcast_frames", "# of broadcast frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_BCAST_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_mcast_frames", "# of multicast frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_MCAST_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_ucast_frames", "# of unicast frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_UCAST_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_too_long", "# of frames exceeding MTU", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_MTU_ERROR_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_jabber", "# of jabber frames", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_MTU_CRC_ERROR_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_fcs_err", - "# of frames received with bad FCS", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_CRC_ERROR_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_len_err", - "# of frames received with length error", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_LEN_ERROR_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_symbol_err", "symbol errors", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_SYM_ERROR_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_runt", "# of short frames received", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_LESS_64B_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_frames_64", - "# of rx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_64B_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_frames_65_127", - "# of rx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_65B_127B_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_frames_128_255", - "# of rx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_128B_255B_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_frames_256_511", - "# of rx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_256B_511B_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_frames_512_1023", - "# of rx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_512B_1023B_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_frames_1024_1518", - "# of rx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_1024B_1518B_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_frames_1519_max", - "# of rx frames in this range", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_1519B_MAX_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_pause", "# of pause frames received", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_PAUSE_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_ppp0", "# of PPP prio 0 frames received", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_PPP0_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_ppp1", "# of PPP prio 1 frames received", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_PPP1_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_ppp2", "# of PPP prio 2 frames received", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_PPP2_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_ppp3", "# of PPP prio 3 frames received", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_PPP3_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_ppp4", "# of PPP prio 4 frames received", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_PPP4_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_ppp5", "# of PPP prio 5 frames received", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_PPP5_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_ppp6", "# of PPP prio 6 frames received", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_PPP6_L)); - SYSCTL_ADD_T4_REG64(pi, "rx_ppp7", "# of PPP prio 7 frames received", - PORT_REG(pi->tx_chan, A_MPS_PORT_STAT_RX_PORT_PPP7_L)); - -#undef SYSCTL_ADD_T4_REG64 - -#define SYSCTL_ADD_T4_PORTSTAT(name, desc) \ +/* We get these from port_stats and they may be stale by up to 1s */ +#define T4_PORTSTAT(name, desc) \ SYSCTL_ADD_UQUAD(ctx, children, OID_AUTO, #name, CTLFLAG_RD, \ &pi->stats.name, desc) - /* We get these from port_stats and they may be stale by up to 1s */ - SYSCTL_ADD_T4_PORTSTAT(rx_ovflow0, - "# drops due to buffer-group 0 overflows"); - SYSCTL_ADD_T4_PORTSTAT(rx_ovflow1, - "# drops due to buffer-group 1 overflows"); - SYSCTL_ADD_T4_PORTSTAT(rx_ovflow2, - "# drops due to buffer-group 2 overflows"); - SYSCTL_ADD_T4_PORTSTAT(rx_ovflow3, - "# drops due to buffer-group 3 overflows"); - SYSCTL_ADD_T4_PORTSTAT(rx_trunc0, - "# of buffer-group 0 truncated packets"); - SYSCTL_ADD_T4_PORTSTAT(rx_trunc1, - "# of buffer-group 1 truncated packets"); - SYSCTL_ADD_T4_PORTSTAT(rx_trunc2, - "# of buffer-group 2 truncated packets"); - SYSCTL_ADD_T4_PORTSTAT(rx_trunc3, - "# of buffer-group 3 truncated packets"); + T4_REGSTAT(tx_octets, TX_PORT_BYTES, "# of octets in good frames"); + T4_REGSTAT(tx_frames, TX_PORT_FRAMES, "total # of good frames"); + T4_REGSTAT(tx_bcast_frames, TX_PORT_BCAST, "# of broadcast frames"); + T4_REGSTAT(tx_mcast_frames, TX_PORT_MCAST, "# of multicast frames"); + T4_REGSTAT(tx_ucast_frames, TX_PORT_UCAST, "# of unicast frames"); + T4_REGSTAT(tx_error_frames, TX_PORT_ERROR, "# of error frames"); + T4_REGSTAT(tx_frames_64, TX_PORT_64B, "# of tx frames in this range"); + T4_REGSTAT(tx_frames_65_127, TX_PORT_65B_127B, "# of tx frames in this range"); + T4_REGSTAT(tx_frames_128_255, TX_PORT_128B_255B, "# of tx frames in this range"); + T4_REGSTAT(tx_frames_256_511, TX_PORT_256B_511B, "# of tx frames in this range"); + T4_REGSTAT(tx_frames_512_1023, TX_PORT_512B_1023B, "# of tx frames in this range"); + T4_REGSTAT(tx_frames_1024_1518, TX_PORT_1024B_1518B, "# of tx frames in this range"); + T4_REGSTAT(tx_frames_1519_max, TX_PORT_1519B_MAX, "# of tx frames in this range"); + T4_REGSTAT(tx_drop, TX_PORT_DROP, "# of dropped tx frames"); + T4_REGSTAT(tx_pause, TX_PORT_PAUSE, "# of pause frames transmitted"); + T4_REGSTAT(tx_ppp0, TX_PORT_PPP0, "# of PPP prio 0 frames transmitted"); + T4_REGSTAT(tx_ppp1, TX_PORT_PPP1, "# of PPP prio 1 frames transmitted"); + T4_REGSTAT(tx_ppp2, TX_PORT_PPP2, "# of PPP prio 2 frames transmitted"); + T4_REGSTAT(tx_ppp3, TX_PORT_PPP3, "# of PPP prio 3 frames transmitted"); + T4_REGSTAT(tx_ppp4, TX_PORT_PPP4, "# of PPP prio 4 frames transmitted"); + T4_REGSTAT(tx_ppp5, TX_PORT_PPP5, "# of PPP prio 5 frames transmitted"); + T4_REGSTAT(tx_ppp6, TX_PORT_PPP6, "# of PPP prio 6 frames transmitted"); + T4_REGSTAT(tx_ppp7, TX_PORT_PPP7, "# of PPP prio 7 frames transmitted"); -#undef SYSCTL_ADD_T4_PORTSTAT + T4_REGSTAT(rx_octets, RX_PORT_BYTES, "# of octets in good frames"); + T4_REGSTAT(rx_frames, RX_PORT_FRAMES, "total # of good frames"); + T4_REGSTAT(rx_bcast_frames, RX_PORT_BCAST, "# of broadcast frames"); + T4_REGSTAT(rx_mcast_frames, RX_PORT_MCAST, "# of multicast frames"); + T4_REGSTAT(rx_ucast_frames, RX_PORT_UCAST, "# of unicast frames"); + T4_REGSTAT(rx_too_long, RX_PORT_MTU_ERROR, "# of frames exceeding MTU"); + T4_REGSTAT(rx_jabber, RX_PORT_MTU_CRC_ERROR, "# of jabber frames"); + if (is_t6(sc)) { + T4_PORTSTAT(rx_fcs_err, + "# of frames received with bad FCS since last link up"); + } else { + T4_REGSTAT(rx_fcs_err, RX_PORT_CRC_ERROR, + "# of frames received with bad FCS"); + } + T4_REGSTAT(rx_len_err, RX_PORT_LEN_ERROR, "# of frames received with length error"); + T4_REGSTAT(rx_symbol_err, RX_PORT_SYM_ERROR, "symbol errors"); + T4_REGSTAT(rx_runt, RX_PORT_LESS_64B, "# of short frames received"); + T4_REGSTAT(rx_frames_64, RX_PORT_64B, "# of rx frames in this range"); + T4_REGSTAT(rx_frames_65_127, RX_PORT_65B_127B, "# of rx frames in this range"); + T4_REGSTAT(rx_frames_128_255, RX_PORT_128B_255B, "# of rx frames in this range"); + T4_REGSTAT(rx_frames_256_511, RX_PORT_256B_511B, "# of rx frames in this range"); + T4_REGSTAT(rx_frames_512_1023, RX_PORT_512B_1023B, "# of rx frames in this range"); + T4_REGSTAT(rx_frames_1024_1518, RX_PORT_1024B_1518B, "# of rx frames in this range"); + T4_REGSTAT(rx_frames_1519_max, RX_PORT_1519B_MAX, "# of rx frames in this range"); + T4_REGSTAT(rx_pause, RX_PORT_PAUSE, "# of pause frames received"); + T4_REGSTAT(rx_ppp0, RX_PORT_PPP0, "# of PPP prio 0 frames received"); + T4_REGSTAT(rx_ppp1, RX_PORT_PPP1, "# of PPP prio 1 frames received"); + T4_REGSTAT(rx_ppp2, RX_PORT_PPP2, "# of PPP prio 2 frames received"); + T4_REGSTAT(rx_ppp3, RX_PORT_PPP3, "# of PPP prio 3 frames received"); + T4_REGSTAT(rx_ppp4, RX_PORT_PPP4, "# of PPP prio 4 frames received"); + T4_REGSTAT(rx_ppp5, RX_PORT_PPP5, "# of PPP prio 5 frames received"); + T4_REGSTAT(rx_ppp6, RX_PORT_PPP6, "# of PPP prio 6 frames received"); + T4_REGSTAT(rx_ppp7, RX_PORT_PPP7, "# of PPP prio 7 frames received"); + T4_PORTSTAT(rx_ovflow0, "# drops due to buffer-group 0 overflows"); + T4_PORTSTAT(rx_ovflow1, "# drops due to buffer-group 1 overflows"); + T4_PORTSTAT(rx_ovflow2, "# drops due to buffer-group 2 overflows"); + T4_PORTSTAT(rx_ovflow3, "# drops due to buffer-group 3 overflows"); + T4_PORTSTAT(rx_trunc0, "# of buffer-group 0 truncated packets"); + T4_PORTSTAT(rx_trunc1, "# of buffer-group 1 truncated packets"); + T4_PORTSTAT(rx_trunc2, "# of buffer-group 2 truncated packets"); + T4_PORTSTAT(rx_trunc3, "# of buffer-group 3 truncated packets"); + +#undef T4_REGSTAT +#undef T4_PORTSTAT + SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "tx_toe_tls_records", CTLFLAG_RD, &pi->tx_toe_tls_records, "# of TOE TLS records transmitted"); @@ -10560,6 +10510,12 @@ clear_stats(struct adapter *sc, u_int port_id) /* MAC stats */ t4_clr_port_stats(sc, pi->tx_chan); + if (is_t6(sc)) { + if (pi->fcs_reg != -1) + pi->fcs_base = t4_read_reg64(sc, pi->fcs_reg); + else + pi->stats.rx_fcs_err = 0; + } pi->tx_parse_error = 0; pi->tnl_cong_drops = 0; mtx_lock(&sc->reg_lock); @@ -10732,17 +10688,37 @@ t4_os_link_changed(struct port_info *pi) { struct vi_info *vi; struct ifnet *ifp; - struct link_config *lc; + struct link_config *lc = &pi->link_cfg; + struct adapter *sc = pi->adapter; int v; PORT_LOCK_ASSERT_OWNED(pi); + if (is_t6(sc)) { + if (lc->link_ok) { + if (lc->speed > 25000 || + (lc->speed == 25000 && lc->fec == FEC_RS)) { + pi->fcs_reg = T5_PORT_REG(pi->tx_chan, + A_MAC_PORT_AFRAMECHECKSEQUENCEERRORS); + } else { + pi->fcs_reg = T5_PORT_REG(pi->tx_chan, + A_MAC_PORT_MTIP_1G10G_RX_CRCERRORS); + } + pi->fcs_base = t4_read_reg64(sc, pi->fcs_reg); + pi->stats.rx_fcs_err = 0; + } else { + pi->fcs_reg = -1; + } + } else { + MPASS(pi->fcs_reg != -1); + MPASS(pi->fcs_base == 0); + } + for_each_vi(pi, v, vi) { ifp = vi->ifp; if (ifp == NULL) continue; - lc = &pi->link_cfg; if (lc->link_ok) { ifp->if_baudrate = IF_Mbps(lc->speed); if_link_state_change(ifp, LINK_STATE_UP); From owner-svn-src-head@freebsd.org Fri Oct 9 23:49: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 D2140430BCA; Fri, 9 Oct 2020 23:49:43 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C7Ptv51v2z3ZTc; Fri, 9 Oct 2020 23:49:43 +0000 (UTC) (envelope-from bdrewery@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 904ED219A0; Fri, 9 Oct 2020 23:49:43 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 099NnhHO062778; Fri, 9 Oct 2020 23:49:43 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 099Nngbw062774; Fri, 9 Oct 2020 23:49:42 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <202010092349.099Nngbw062774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 9 Oct 2020 23:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366594 - in head/sys: kern sys vm X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head/sys: kern sys vm X-SVN-Commit-Revision: 366594 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, 09 Oct 2020 23:49:43 -0000 Author: bdrewery Date: Fri Oct 9 23:49:42 2020 New Revision: 366594 URL: https://svnweb.freebsd.org/changeset/base/366594 Log: Use unlocked page lookup for inmem() to avoid object lock contention Reviewed By: kib, markj Submitted by: mlaier Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D26653 Modified: head/sys/kern/vfs_bio.c head/sys/sys/buf.h head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri Oct 9 23:02:09 2020 (r366593) +++ head/sys/kern/vfs_bio.c Fri Oct 9 23:49:42 2020 (r366594) @@ -154,7 +154,6 @@ caddr_t __read_mostly unmapped_buf; /* Used below and for softdep flushing threads in ufs/ffs/ffs_softdep.c */ struct proc *bufdaemonproc; -static int inmem(struct vnode *vp, daddr_t blkno); static void vm_hold_free_pages(struct buf *bp, int newbsize); static void vm_hold_load_pages(struct buf *bp, vm_offset_t from, vm_offset_t to); @@ -3585,48 +3584,54 @@ incore(struct bufobj *bo, daddr_t blkno) * associated VM object. This is like incore except * it also hunts around in the VM system for the data. */ - -static int +bool inmem(struct vnode * vp, daddr_t blkno) { vm_object_t obj; vm_offset_t toff, tinc, size; - vm_page_t m; + vm_page_t m, n; vm_ooffset_t off; + int valid; ASSERT_VOP_LOCKED(vp, "inmem"); if (incore(&vp->v_bufobj, blkno)) - return 1; + return (true); if (vp->v_mount == NULL) - return 0; + return (false); obj = vp->v_object; if (obj == NULL) - return (0); + return (false); size = PAGE_SIZE; if (size > vp->v_mount->mnt_stat.f_iosize) size = vp->v_mount->mnt_stat.f_iosize; off = (vm_ooffset_t)blkno * (vm_ooffset_t)vp->v_mount->mnt_stat.f_iosize; - VM_OBJECT_RLOCK(obj); for (toff = 0; toff < vp->v_mount->mnt_stat.f_iosize; toff += tinc) { - m = vm_page_lookup(obj, OFF_TO_IDX(off + toff)); - if (!m) - goto notinmem; + m = vm_page_lookup_unlocked(obj, OFF_TO_IDX(off + toff)); +recheck: + if (m == NULL) + return (false); + tinc = size; if (tinc > PAGE_SIZE - ((toff + off) & PAGE_MASK)) tinc = PAGE_SIZE - ((toff + off) & PAGE_MASK); - if (vm_page_is_valid(m, - (vm_offset_t) ((toff + off) & PAGE_MASK), tinc) == 0) - goto notinmem; + /* + * Consider page validity only if page mapping didn't change + * during the check. + */ + valid = vm_page_is_valid(m, + (vm_offset_t)((toff + off) & PAGE_MASK), tinc); + n = vm_page_lookup_unlocked(obj, OFF_TO_IDX(off + toff)); + if (m != n) { + m = n; + goto recheck; + } + if (!valid) + return (false); } - VM_OBJECT_RUNLOCK(obj); - return 1; - -notinmem: - VM_OBJECT_RUNLOCK(obj); - return (0); + return (true); } /* Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Fri Oct 9 23:02:09 2020 (r366593) +++ head/sys/sys/buf.h Fri Oct 9 23:49:42 2020 (r366594) @@ -549,6 +549,7 @@ int vfs_bio_awrite(struct buf *); void vfs_busy_pages_acquire(struct buf *bp); void vfs_busy_pages_release(struct buf *bp); struct buf *incore(struct bufobj *, daddr_t); +bool inmem(struct vnode *, 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); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Oct 9 23:02:09 2020 (r366593) +++ head/sys/vm/vm_page.c Fri Oct 9 23:49:42 2020 (r366594) @@ -1698,6 +1698,21 @@ vm_page_lookup(vm_object_t object, vm_pindex_t pindex) } /* + * vm_page_lookup_unlocked: + * + * Returns the page associated with the object/offset pair specified; + * if none is found, NULL is returned. The page may be no longer be + * present in the object at the time that this function returns. Only + * useful for opportunistic checks such as inmem(). + */ +vm_page_t +vm_page_lookup_unlocked(vm_object_t object, vm_pindex_t pindex) +{ + + return (vm_radix_lookup_unlocked(&object->rtree, pindex)); +} + +/* * vm_page_relookup: * * Returns a page that must already have been busied by Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Fri Oct 9 23:02:09 2020 (r366593) +++ head/sys/vm/vm_page.h Fri Oct 9 23:49:42 2020 (r366594) @@ -700,6 +700,7 @@ int vm_page_insert (vm_page_t, vm_object_t, vm_pindex_ void vm_page_invalid(vm_page_t m); void vm_page_launder(vm_page_t m); vm_page_t vm_page_lookup(vm_object_t, vm_pindex_t); +vm_page_t vm_page_lookup_unlocked(vm_object_t, vm_pindex_t); vm_page_t vm_page_next(vm_page_t m); void vm_page_pqbatch_drain(void); void vm_page_pqbatch_submit(vm_page_t m, uint8_t queue); From owner-svn-src-head@freebsd.org Sat Oct 10 00:01: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 2E84A430E2D; Sat, 10 Oct 2020 00:01:41 +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 4C7Q8j0TlBz3Zsr; Sat, 10 Oct 2020 00:01:41 +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 E8F87217FD; Sat, 10 Oct 2020 00:01:40 +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 09A01eLj072591; Sat, 10 Oct 2020 00:01:40 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09A01ew2072529; Sat, 10 Oct 2020 00:01:40 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <202010100001.09A01ew2072529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 10 Oct 2020 00:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366595 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 366595 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, 10 Oct 2020 00:01:41 -0000 Author: rmacklem Date: Sat Oct 10 00:01:40 2020 New Revision: 366595 URL: https://svnweb.freebsd.org/changeset/base/366595 Log: Modify mountd.c so that it does not always malloc 4K for the map credentials. r362163 upgraded mountd so that it could handle MAX_NGROUPS groups for the anonymous user credentials (the ones provided by -maproot and -mapall exports options). The problem is that this resulted in every export structure growing by about 4Kbytes, because the cr_groups field went from 16->MAX_NGROUPS. This patch fixes this by only including a small 32 element cr_groups in the structure and then malloc()'ng cr_groups when a larger one is needed. The value of SMALLNGROUPS is arbitrarily set to 32, assuming most users used by -maproot or -mapall will be in <= 32 groups. Reviewed by: kib, freqlabs Differential Revision: https://reviews.freebsd.org/D26521 Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Fri Oct 9 23:49:42 2020 (r366594) +++ head/usr.sbin/mountd/mountd.c Sat Oct 10 00:01:40 2020 (r366595) @@ -115,11 +115,15 @@ struct dirlist { /* * maproot/mapall credentials. + * cr_smallgrps can be used for a group list up to SMALLNGROUPS in size. + * Larger group lists are malloc'd/free'd. */ +#define SMALLNGROUPS 32 struct expcred { uid_t cr_uid; int cr_ngroups; - gid_t cr_groups[NGROUPS_MAX + 1]; + gid_t cr_smallgrps[SMALLNGROUPS]; + gid_t *cr_groups; }; struct exportlist { @@ -1514,6 +1518,7 @@ get_exportlist_one(int passno) uint64_t exflags; v4root_phase = 0; + anon.cr_groups = NULL; dirhead = (struct dirlist *)NULL; while (get_line()) { if (debug) @@ -1527,6 +1532,7 @@ get_exportlist_one(int passno) * Set defaults. */ has_host = FALSE; + anon.cr_groups = anon.cr_smallgrps; anon.cr_uid = UID_NOBODY; anon.cr_ngroups = 1; anon.cr_groups[0] = GID_NOGROUP; @@ -1822,6 +1828,10 @@ nextline: free_dir(dirhead); dirhead = (struct dirlist *)NULL; } + if (anon.cr_groups != anon.cr_smallgrps) { + free(anon.cr_groups); + anon.cr_groups = NULL; + } } } @@ -2905,6 +2915,8 @@ free_exp(struct exportlist *ep) grp = grp->gr_next; free_grp(tgrp); } + if (ep->ex_defanon.cr_groups != ep->ex_defanon.cr_smallgrps) + free(ep->ex_defanon.cr_groups); free((caddr_t)ep); } @@ -3457,14 +3469,17 @@ static void parsecred(char *namelist, struct expcred *cr) { char *name; - int cnt; + int inpos; char *names; struct passwd *pw; struct group *gr; + gid_t groups[NGROUPS_MAX + 1]; + int ngroups; /* * Set up the unprivileged user. */ + cr->cr_groups = cr->cr_smallgrps; cr->cr_uid = UID_NOBODY; cr->cr_groups[0] = GID_NOGROUP; cr->cr_ngroups = 1; @@ -3487,24 +3502,28 @@ parsecred(char *namelist, struct expcred *cr) return; } cr->cr_uid = pw->pw_uid; - cr->cr_ngroups = NGROUPS_MAX + 1; - if (getgrouplist(pw->pw_name, pw->pw_gid, cr->cr_groups, - &cr->cr_ngroups)) { + ngroups = NGROUPS_MAX + 1; + if (getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups)) { syslog(LOG_ERR, "too many groups"); - cr->cr_ngroups = NGROUPS_MAX + 1; + ngroups = NGROUPS_MAX + 1; } /* * Compress out duplicate. */ - if (cr->cr_ngroups > 1 && cr->cr_groups[0] == - cr->cr_groups[1]) { - for (cnt = 2; cnt < cr->cr_ngroups; cnt++) - cr->cr_groups[cnt - 1] = cr->cr_groups[cnt]; - cr->cr_ngroups--; - } - if (cr->cr_ngroups > NGROUPS_MAX) - cr->cr_ngroups = NGROUPS_MAX; + if (ngroups > 1 && groups[0] == groups[1]) { + ngroups--; + inpos = 2; + } else + inpos = 1; + if (ngroups > NGROUPS_MAX) + ngroups = NGROUPS_MAX; + if (ngroups > SMALLNGROUPS) + cr->cr_groups = malloc(ngroups * sizeof(gid_t)); + cr->cr_ngroups = ngroups; + cr->cr_groups[0] = groups[0]; + memcpy(&cr->cr_groups[1], &groups[inpos], (ngroups - 1) * + sizeof(gid_t)); return; } /* @@ -3523,17 +3542,20 @@ parsecred(char *namelist, struct expcred *cr) while (names != NULL && *names != '\0' && cr->cr_ngroups < NGROUPS_MAX) { name = strsep_quote(&names, ":"); if (isdigit(*name) || *name == '-') { - cr->cr_groups[cr->cr_ngroups++] = atoi(name); + groups[cr->cr_ngroups++] = atoi(name); } else { if ((gr = getgrnam(name)) == NULL) { syslog(LOG_ERR, "unknown group: %s", name); continue; } - cr->cr_groups[cr->cr_ngroups++] = gr->gr_gid; + groups[cr->cr_ngroups++] = gr->gr_gid; } } if (names != NULL && *names != '\0' && cr->cr_ngroups == NGROUPS_MAX) syslog(LOG_ERR, "too many groups"); + if (cr->cr_ngroups > SMALLNGROUPS) + cr->cr_groups = malloc(cr->cr_ngroups * sizeof(gid_t)); + memcpy(cr->cr_groups, groups, cr->cr_ngroups * sizeof(gid_t)); } #define STRSIZ (MNTNAMLEN+MNTPATHLEN+50) @@ -3642,6 +3664,8 @@ free_grp(struct grouplist *grp) if (grp->gr_ptr.gt_net.nt_name) free(grp->gr_ptr.gt_net.nt_name); } + if (grp->gr_anon.cr_groups != grp->gr_anon.cr_smallgrps) + free(grp->gr_anon.cr_groups); free((caddr_t)grp); } @@ -3860,6 +3884,10 @@ cp_cred(struct expcred *outcr, struct expcred *incr) outcr->cr_uid = incr->cr_uid; outcr->cr_ngroups = incr->cr_ngroups; + if (outcr->cr_ngroups > SMALLNGROUPS) + outcr->cr_groups = malloc(outcr->cr_ngroups * sizeof(gid_t)); + else + outcr->cr_groups = outcr->cr_smallgrps; memcpy(outcr->cr_groups, incr->cr_groups, incr->cr_ngroups * sizeof(gid_t)); } From owner-svn-src-head@freebsd.org Sat Oct 10 01: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 94BE4433D31; Sat, 10 Oct 2020 01:13:15 +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 4C7RlH3Tslz3gm2; Sat, 10 Oct 2020 01:13:15 +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 5B3A2224EC; Sat, 10 Oct 2020 01:13:15 +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 09A1DF0N018924; Sat, 10 Oct 2020 01:13:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09A1DFUN018923; Sat, 10 Oct 2020 01:13:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202010100113.09A1DFUN018923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 10 Oct 2020 01:13:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366596 - head/sys/modules/crypto X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/modules/crypto X-SVN-Commit-Revision: 366596 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, 10 Oct 2020 01:13:15 -0000 Author: emaste Date: Sat Oct 10 01:13:14 2020 New Revision: 366596 URL: https://svnweb.freebsd.org/changeset/base/366596 Log: modules/crypto: reenable assembly optimized skein implementation r366344 corrected the optimized amd64 skein assembly implementation, so we can now enable it again. Also add a dependency on this Makefile for the skein_block object, so that it will be rebuit (similar to r366362). PR: 248221 Sponsored by: The FreeBSD Foundation Modified: head/sys/modules/crypto/Makefile Modified: head/sys/modules/crypto/Makefile ============================================================================== --- head/sys/modules/crypto/Makefile Sat Oct 10 00:01:40 2020 (r366595) +++ head/sys/modules/crypto/Makefile Sat Oct 10 01:13:14 2020 (r366596) @@ -28,14 +28,18 @@ SRCS += sha1.c sha256c.c sha512c.c SRCS += skein.c skein_block.c # unroll the 256 and 512 loops, half unroll the 1024 CFLAGS.skein_block.c += -DSKEIN_LOOP=995 -#.if exists(${MACHINE_ARCH}/skein_block_asm.S) -#.PATH: ${SRCTOP}/sys/crypto/skein/${MACHINE_ARCH} -#SRCS += skein_block_asm.S -#CFLAGS += -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792 -#ACFLAGS += -DELF -Wa,--noexecstack -## Fully unroll all loops in the assembly optimized version -#ACFLAGS += -DSKEIN_LOOP=0 -#.endif +.if exists(${MACHINE_ARCH}/skein_block_asm.S) +.PATH: ${SRCTOP}/sys/crypto/skein/${MACHINE_ARCH} +SRCS += skein_block_asm.S +CFLAGS += -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792 +ACFLAGS += -DELF -Wa,--noexecstack +# Fully unroll all loops in the assembly optimized version +ACFLAGS += -DSKEIN_LOOP=0 +# 20201002 Add explict Makefile dependency for reenabled assembly optimized +# version. SKEIN_USE_ASM determines which routines should come from the assembly +# vs C versions, and skein_block needs to be rebuilt if it changes. +skein_block.o: Makefile +.endif SRCS += siphash.c SRCS += gmac.c gfmult.c SRCS += blake2b-ref.c From owner-svn-src-head@freebsd.org Sat Oct 10 03:48:18 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 B260E43A226; Sat, 10 Oct 2020 03:48:18 +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 4C7WBB4Kfgz47Fy; Sat, 10 Oct 2020 03:48:18 +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 794492447C; Sat, 10 Oct 2020 03:48: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 09A3mIvt014382; Sat, 10 Oct 2020 03:48:18 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09A3mHSo014380; Sat, 10 Oct 2020 03:48:17 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010100348.09A3mHSo014380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 10 Oct 2020 03:48:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366597 - 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: 366597 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, 10 Oct 2020 03:48:18 -0000 Author: mjg Date: Sat Oct 10 03:48:17 2020 New Revision: 366597 URL: https://svnweb.freebsd.org/changeset/base/366597 Log: vfs: support lockless dirfd lookups Modified: head/sys/kern/kern_descrip.c head/sys/kern/vfs_cache.c head/sys/sys/file.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sat Oct 10 01:13:14 2020 (r366596) +++ head/sys/kern/kern_descrip.c Sat Oct 10 03:48:17 2020 (r366597) @@ -2708,6 +2708,111 @@ get_locked: return (error); } +#ifdef CAPABILITIES +int +fgetvp_lookup_smr(int fd, struct nameidata *ndp, struct vnode **vpp, bool *fsearch) +{ + const struct filedescent *fde; + const struct fdescenttbl *fdt; + struct filedesc *fdp; + struct file *fp; + struct vnode *vp; + const cap_rights_t *haverights; + cap_rights_t rights; + seqc_t seq; + + VFS_SMR_ASSERT_ENTERED(); + + rights = *ndp->ni_rightsneeded; + cap_rights_set_one(&rights, CAP_LOOKUP); + + fdp = curproc->p_fd; + fdt = fdp->fd_files; + if (__predict_false((u_int)fd >= fdt->fdt_nfiles)) + return (EBADF); + seq = seqc_read_any(fd_seqc(fdt, fd)); + if (__predict_false(seqc_in_modify(seq))) + return (EAGAIN); + fde = &fdt->fdt_ofiles[fd]; + haverights = cap_rights_fde_inline(fde); + fp = fde->fde_file; + if (__predict_false(fp == NULL)) + return (EAGAIN); + if (__predict_false(cap_check_inline_transient(haverights, &rights))) + return (EAGAIN); + *fsearch = ((fp->f_flag & FSEARCH) != 0); + vp = fp->f_vnode; + if (__predict_false(vp == NULL || vp->v_type != VDIR)) { + return (EAGAIN); + } + if (!filecaps_copy(&fde->fde_caps, &ndp->ni_filecaps, false)) { + return (EAGAIN); + } + /* + * Use an acquire barrier to force re-reading of fdt so it is + * refreshed for verification. + */ + atomic_thread_fence_acq(); + fdt = fdp->fd_files; + if (__predict_false(!seqc_consistent_nomb(fd_seqc(fdt, fd), seq))) + return (EAGAIN); + /* + * If file descriptor doesn't have all rights, + * all lookups relative to it must also be + * strictly relative. + * + * Not yet supported by fast path. + */ + CAP_ALL(&rights); + if (!cap_rights_contains(&ndp->ni_filecaps.fc_rights, &rights) || + ndp->ni_filecaps.fc_fcntls != CAP_FCNTL_ALL || + ndp->ni_filecaps.fc_nioctls != -1) { +#ifdef notyet + ndp->ni_lcf |= NI_LCF_STRICTRELATIVE; +#else + return (EAGAIN); +#endif + } + *vpp = vp; + return (0); +} +#else +int +fgetvp_lookup_smr(int fd, struct nameidata *ndp, struct vnode **vpp, bool *fsearch) +{ + const struct fdescenttbl *fdt; + struct filedesc *fdp; + struct file *fp; + struct vnode *vp; + + VFS_SMR_ASSERT_ENTERED(); + + fdp = curproc->p_fd; + fdt = fdp->fd_files; + if (__predict_false((u_int)fd >= fdt->fdt_nfiles)) + return (EBADF); + fp = fdt->fdt_ofiles[fd].fde_file; + if (__predict_false(fp == NULL)) + return (EAGAIN); + *fsearch = ((fp->f_flag & FSEARCH) != 0); + vp = fp->f_vnode; + if (__predict_false(vp == NULL || vp->v_type != VDIR)) { + return (EAGAIN); + } + /* + * Use an acquire barrier to force re-reading of fdt so it is + * refreshed for verification. + */ + atomic_thread_fence_acq(); + fdt = fdp->fd_files; + if (__predict_false(fp != fdt->fdt_ofiles[fd].fde_file)) + return (EAGAIN); + filecaps_fill(&ndp->ni_filecaps); + *vpp = vp; + return (0); +} +#endif + int fget_unlocked_seq(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, struct file **fpp, seqc_t *seqp) Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Oct 10 01:13:14 2020 (r366596) +++ head/sys/kern/vfs_cache.c Sat Oct 10 03:48:17 2020 (r366597) @@ -3189,6 +3189,7 @@ struct cache_fpl { int line; enum cache_fpl_status status:8; bool in_smr; + bool fsearch; }; static void @@ -3346,10 +3347,6 @@ cache_can_fplookup(struct cache_fpl *fpl) cache_fpl_aborted(fpl); return (false); } - if (ndp->ni_dirfd != AT_FDCWD) { - cache_fpl_aborted(fpl); - return (false); - } if (IN_CAPABILITY_MODE(td)) { cache_fpl_aborted(fpl); return (false); @@ -3365,6 +3362,23 @@ cache_can_fplookup(struct cache_fpl *fpl) return (true); } +static int +cache_fplookup_dirfd(struct cache_fpl *fpl, struct vnode **vpp) +{ + struct nameidata *ndp; + int error; + bool fsearch; + + ndp = fpl->ndp; + error = fgetvp_lookup_smr(ndp->ni_dirfd, ndp, vpp, &fsearch); + if (__predict_false(error != 0)) { + cache_fpl_smr_exit(fpl); + return (cache_fpl_aborted(fpl)); + } + fpl->fsearch = fsearch; + return (0); +} + static bool cache_fplookup_vnode_supported(struct vnode *vp) { @@ -4046,9 +4060,11 @@ cache_fplookup_parse_advance(struct cache_fpl *fpl) static int __noinline cache_fplookup_failed_vexec(struct cache_fpl *fpl, int error) { + struct componentname *cnp; struct vnode *dvp; seqc_t dvp_seqc; + cnp = fpl->cnp; dvp = fpl->dvp; dvp_seqc = fpl->dvp_seqc; @@ -4070,6 +4086,32 @@ cache_fplookup_failed_vexec(struct cache_fpl *fpl, int error = ENOTDIR; } + /* + * Hack: handle O_SEARCH. + * + * Open Group Base Specifications Issue 7, 2018 edition states: + * If the access mode of the open file description associated with the + * file descriptor is not O_SEARCH, the function shall check whether + * directory searches are permitted using the current permissions of + * the directory underlying the file descriptor. If the access mode is + * O_SEARCH, the function shall not perform the check. + * + * Regular lookup tests for the NOEXECCHECK flag for every path + * component to decide whether to do the permission check. However, + * since most lookups never have the flag (and when they do it is only + * present for the first path component), lockless lookup only acts on + * it if there is a permission problem. Here the flag is represented + * with a boolean so that we don't have to clear it on the way out. + * + * For simplicity this always aborts. + * TODO: check if this is the first lookup and ignore the permission + * problem. Note the flag has to survive fallback (if it happens to be + * performed). + */ + if (fpl->fsearch) { + return (cache_fpl_aborted(fpl)); + } + switch (error) { case EAGAIN: if (!vn_seqc_consistent(dvp, dvp_seqc)) { @@ -4308,6 +4350,7 @@ cache_fplookup(struct nameidata *ndp, enum cache_fpl_s cache_fpl_checkpoint(&fpl, &orig); cache_fpl_smr_enter_initial(&fpl); + fpl.fsearch = false; pwd = pwd_get_smr(); fpl.pwd = pwd; ndp->ni_rootdir = pwd->pwd_rdir; @@ -4318,13 +4361,20 @@ cache_fplookup(struct nameidata *ndp, enum cache_fpl_s if (cnp->cn_pnbuf[0] == '/') { cache_fpl_handle_root(ndp, &dvp); } else { - MPASS(ndp->ni_dirfd == AT_FDCWD); - dvp = pwd->pwd_cdir; + if (ndp->ni_dirfd == AT_FDCWD) { + dvp = pwd->pwd_cdir; + } else { + error = cache_fplookup_dirfd(&fpl, &dvp); + if (__predict_false(error != 0)) { + goto out; + } + } } SDT_PROBE4(vfs, namei, lookup, entry, dvp, cnp->cn_pnbuf, cnp->cn_flags, true); error = cache_fplookup_impl(dvp, &fpl); +out: cache_fpl_smr_assert_not_entered(&fpl); SDT_PROBE3(vfs, fplookup, lookup, done, ndp, fpl.line, fpl.status); Modified: head/sys/sys/file.h ============================================================================== --- head/sys/sys/file.h Sat Oct 10 01:13:14 2020 (r366596) +++ head/sys/sys/file.h Sat Oct 10 03:48:17 2020 (r366597) @@ -52,6 +52,7 @@ struct thread; struct uio; struct knote; struct vnode; +struct nameidata; #endif /* _KERNEL */ @@ -279,6 +280,7 @@ int fgetvp_read(struct thread *td, int fd, cap_rights_ struct vnode **vpp); int fgetvp_write(struct thread *td, int fd, cap_rights_t *rightsp, struct vnode **vpp); +int fgetvp_lookup_smr(int fd, struct nameidata *ndp, struct vnode **vpp, bool *fsearch); static __inline __result_use_check bool fhold(struct file *fp) From owner-svn-src-head@freebsd.org Sat Oct 10 04:18: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 B4FCA43B005; Sat, 10 Oct 2020 04:18:49 +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 4C7WsP4LQRz49jG; Sat, 10 Oct 2020 04:18:49 +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 73C2E24F12; Sat, 10 Oct 2020 04:18:49 +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 09A4InJm033578; Sat, 10 Oct 2020 04:18:49 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09A4InV6033577; Sat, 10 Oct 2020 04:18:49 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202010100418.09A4InV6033577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 10 Oct 2020 04:18:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366598 - head/sys/contrib/openzfs/module/os/freebsd/zfs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/contrib/openzfs/module/os/freebsd/zfs X-SVN-Commit-Revision: 366598 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, 10 Oct 2020 04:18:49 -0000 Author: mjg Date: Sat Oct 10 04:18:49 2020 New Revision: 366598 URL: https://svnweb.freebsd.org/changeset/base/366598 Log: zfs: use cache_rename Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c Modified: head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c ============================================================================== --- head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c Sat Oct 10 03:48:17 2020 (r366597) +++ head/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vnops.c Sat Oct 10 04:18:49 2020 (r366598) @@ -4165,10 +4165,7 @@ zfs_rename_(vnode_t *sdvp, vnode_t **svpp, struct comp } } if (error == 0) { - cache_purge(*svpp); - if (*tvpp != NULL) - cache_purge(*tvpp); - cache_purge_negative(tdvp); + cache_rename(sdvp, *svpp, tdvp, *tvpp, scnp, tcnp); } } From owner-svn-src-head@freebsd.org Sat Oct 10 07:18: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 A091143E706; Sat, 10 Oct 2020 07:18:52 +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 4C7bs83gRZz4KDk; Sat, 10 Oct 2020 07:18:52 +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 6152526772; Sat, 10 Oct 2020 07:18:52 +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 09A7Iqt8044200; Sat, 10 Oct 2020 07:18:52 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09A7IpsX044196; Sat, 10 Oct 2020 07:18:51 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202010100718.09A7IpsX044196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 10 Oct 2020 07:18:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366599 - in head/sys: conf dts gnu/dts tools/fdt X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: conf dts gnu/dts tools/fdt X-SVN-Commit-Revision: 366599 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, 10 Oct 2020 07:18:52 -0000 Author: manu Date: Sat Oct 10 07:18:51 2020 New Revision: 366599 URL: https://svnweb.freebsd.org/changeset/base/366599 Log: Brand our DTS with the Linux version it was imported from DTS must be synced with the kernel, add a freebsd,dts-version string in the root node of each DTS that we compile so we can later in the kernel check that it contain a correct value. Reviewed by: imp, mmel Differential Revision: https://reviews.freebsd.org/D26724 Added: head/sys/dts/freebsd-compatible.dts (contents, props changed) head/sys/gnu/dts/Makefile (contents, props changed) Modified: head/sys/conf/Makefile.arm head/sys/tools/fdt/make_dtb.sh Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Sat Oct 10 04:18:49 2020 (r366598) +++ head/sys/conf/Makefile.arm Sat Oct 10 07:18:51 2020 (r366599) @@ -32,6 +32,9 @@ S= ../../.. INCLUDES+= -I$S/contrib/libfdt -I$S/gnu/dts/include +LINUX_DTS_VERSION!= make -C $S/gnu/dts/ -V LINUX_DTS_VERSION +CFLAGS += -DLINUX_DTS_VERSION=\"${LINUX_DTS_VERSION}\" + .if !defined(DEBUG) && !defined(PROFLEVEL) STRIP_FLAGS = -S .endif Added: head/sys/dts/freebsd-compatible.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dts/freebsd-compatible.dts Sat Oct 10 07:18:51 2020 (r366599) @@ -0,0 +1,3 @@ +/ { + freebsd,dts-version = LINUX_DTS_VERSION; +}; Added: head/sys/gnu/dts/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/Makefile Sat Oct 10 07:18:51 2020 (r366599) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +LINUX_DTS_VERSION=5.8 Modified: head/sys/tools/fdt/make_dtb.sh ============================================================================== --- head/sys/tools/fdt/make_dtb.sh Sat Oct 10 04:18:49 2020 (r366598) +++ head/sys/tools/fdt/make_dtb.sh Sat Oct 10 07:18:51 2020 (r366599) @@ -20,9 +20,11 @@ fi : "${ECHO:=echo}" : "${CPP:=cpp}" +LINUX_DTS_VERSION=$(make -C $S/gnu/dts -V LINUX_DTS_VERSION) + for d in ${dts}; do dtb="${dtb_path}/$(basename "$d" .dts).dtb" ${ECHO} "converting $d -> $dtb" - ${CPP} -P -x assembler-with-cpp -I "$S/gnu/dts/include" -I "$S/dts/${MACHINE}" -I "$S/gnu/dts/${MACHINE}" -I "$S/gnu/dts/" -include "$d" /dev/null | + ${CPP} -DLINUX_DTS_VERSION=\"${LINUX_DTS_VERSION}\" -P -x assembler-with-cpp -I "$S/gnu/dts/include" -I "$S/dts/${MACHINE}" -I "$S/gnu/dts/${MACHINE}" -I "$S/gnu/dts/" -include "$d" -include "$S/dts/freebsd-compatible.dts" /dev/null | ${DTC} -@ -O dtb -o "$dtb" -b 0 -p 1024 -i "$S/dts/${MACHINE}" -i "$S/gnu/dts/${MACHINE}" -i "$S/gnu/dts/" done From owner-svn-src-head@freebsd.org Sat Oct 10 07:21: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 54E1E43E2FB; Sat, 10 Oct 2020 07:21: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 4C7bvc1c6yz4KQX; Sat, 10 Oct 2020 07:21: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 1A08E27112; Sat, 10 Oct 2020 07:21: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 09A7KxrN048651; Sat, 10 Oct 2020 07:20:59 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09A7KxE1048650; Sat, 10 Oct 2020 07:20:59 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202010100720.09A7KxE1048650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 10 Oct 2020 07:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366600 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 366600 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, 10 Oct 2020 07:21:00 -0000 Author: manu Date: Sat Oct 10 07:20:59 2020 New Revision: 366600 URL: https://svnweb.freebsd.org/changeset/base/366600 Log: arm: Check dtb version against the one we're expecting to find Reviewed by: imp, emaste, mmel Differential Revision: https://reviews.freebsd.org/D26725 Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat Oct 10 07:18:51 2020 (r366599) +++ head/sys/arm/arm/machdep.c Sat Oct 10 07:20:59 2020 (r366600) @@ -1111,6 +1111,8 @@ initarm(struct arm_boot_params *abp) char *env; void *kmdp; int err_devmap, mem_regions_sz; + phandle_t root; + char dts_version[255]; #ifdef EFI struct efi_map_header *efihdr; #endif @@ -1272,6 +1274,18 @@ initarm(struct arm_boot_params *abp) err_devmap); platform_late_init(); + + root = OF_finddevice("/"); + if (OF_getprop(root, "freebsd,dts-version", dts_version, sizeof(dts_version)) > 0) { + if (strcmp(LINUX_DTS_VERSION, dts_version) != 0) + printf("WARNING: DTB version is %s while kernel expects %s, " + "please update the DTB in the ESP\n", + dts_version, + LINUX_DTS_VERSION); + } else { + printf("WARNING: Cannot find freebsd,dts-version property, " + "cannot check DTB compliance\n"); + } /* * We must now clean the cache again.... From owner-svn-src-head@freebsd.org Sat Oct 10 12: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 D15CB445C0C; Sat, 10 Oct 2020 12:05:54 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C7kDL57b4z4djM; Sat, 10 Oct 2020 12:05:54 +0000 (UTC) (envelope-from gbe@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 94ADCA984; Sat, 10 Oct 2020 12:05:54 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09AC5sA5029201; Sat, 10 Oct 2020 12:05:54 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09AC5sZb029200; Sat, 10 Oct 2020 12:05:54 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010101205.09AC5sZb029200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 10 Oct 2020 12:05:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366609 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 366609 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, 10 Oct 2020 12:05:54 -0000 Author: gbe (doc committer) Date: Sat Oct 10 12:05:54 2020 New Revision: 366609 URL: https://svnweb.freebsd.org/changeset/base/366609 Log: dtrace_audit(4): Fix a typo - asynchonously -> asynchronously MFC after: 1 week Modified: head/share/man/man4/dtrace_audit.4 Modified: head/share/man/man4/dtrace_audit.4 ============================================================================== --- head/share/man/man4/dtrace_audit.4 Sat Oct 10 09:52:41 2020 (r366608) +++ head/share/man/man4/dtrace_audit.4 Sat Oct 10 12:05:54 2020 (r366609) @@ -119,7 +119,7 @@ remains available for capture by the script. .Pp The .Fn audit:event:aue_*:bsm -probes fire asynchonously from system-call return, following BSM conversion +probes fire asynchronously from system-call return, following BSM conversion and just prior to being written to disk, giving access to four arguments: a .Vt char * audit event name, the From owner-svn-src-head@freebsd.org Sat Oct 10 12:06: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 96263445C16; Sat, 10 Oct 2020 12:06:40 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C7kFD3QrBz4fGx; Sat, 10 Oct 2020 12:06:40 +0000 (UTC) (envelope-from gbe@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 58C7AAA02; Sat, 10 Oct 2020 12:06:40 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09AC6eep029279; Sat, 10 Oct 2020 12:06:40 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09AC6e6e029278; Sat, 10 Oct 2020 12:06:40 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010101206.09AC6e6e029278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 10 Oct 2020 12:06:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366610 - head/share/man/man3 X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/share/man/man3 X-SVN-Commit-Revision: 366610 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, 10 Oct 2020 12:06:40 -0000 Author: gbe (doc committer) Date: Sat Oct 10 12:06:39 2020 New Revision: 366610 URL: https://svnweb.freebsd.org/changeset/base/366610 Log: sigevent(3): Fix a typo - asychronous -> asynchronous MFC after: 1 week Modified: head/share/man/man3/sigevent.3 Modified: head/share/man/man3/sigevent.3 ============================================================================== --- head/share/man/man3/sigevent.3 Sat Oct 10 12:05:54 2020 (r366609) +++ head/share/man/man3/sigevent.3 Sat Oct 10 12:06:39 2020 (r366610) @@ -34,7 +34,7 @@ .Sh SYNOPSIS .In signal.h .Sh DESCRIPTION -Some operations permit threads to request asychronous notification of events +Some operations permit threads to request asynchronous notification of events via a .Vt struct sigevent structure. From owner-svn-src-head@freebsd.org Sat Oct 10 13:01: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 88E1F446BFA; Sat, 10 Oct 2020 13:01:05 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C7lS137R3z3TQl; Sat, 10 Oct 2020 13:01:05 +0000 (UTC) (envelope-from gbe@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 4EC83B444; Sat, 10 Oct 2020 13:01:05 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09AD15ad061531; Sat, 10 Oct 2020 13:01:05 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09AD15Do061530; Sat, 10 Oct 2020 13:01:05 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010101301.09AD15Do061530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 10 Oct 2020 13:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366611 - head/usr.bin/cpuset X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/usr.bin/cpuset X-SVN-Commit-Revision: 366611 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, 10 Oct 2020 13:01:05 -0000 Author: gbe (doc committer) Date: Sat Oct 10 13:01:04 2020 New Revision: 366611 URL: https://svnweb.freebsd.org/changeset/base/366611 Log: cpuset(1): Fix a typo - 'at at' -> 'at a' MFC after: 1 week Modified: head/usr.bin/cpuset/cpuset.1 Modified: head/usr.bin/cpuset/cpuset.1 ============================================================================== --- head/usr.bin/cpuset/cpuset.1 Sat Oct 10 12:06:39 2020 (r366610) +++ head/usr.bin/cpuset/cpuset.1 Sat Oct 10 13:01:04 2020 (r366611) @@ -152,7 +152,7 @@ Ranges may be specified as in Valid policies include first-touch (ft), round-robin (rr), prefer and interleave (il). First-touch allocates on the local domain when memory is available. -Round-robin alternates between every possible domain page at at time. +Round-robin alternates between every possible domain page at a time. The prefer policy accepts only a single domain in the set. The parent of the set is consulted if the preferred domain is unavailable. Interleave operates like round-robin with an implementation defined stripe From owner-svn-src-head@freebsd.org Sat Oct 10 13:39:14 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 14631447E8A; Sat, 10 Oct 2020 13:39:14 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C7mJ16lsgz3WF4; Sat, 10 Oct 2020 13:39:13 +0000 (UTC) (envelope-from gbe@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 C6C57B544; Sat, 10 Oct 2020 13:39:13 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09ADdDjN085653; Sat, 10 Oct 2020 13:39:13 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09ADdDL6085652; Sat, 10 Oct 2020 13:39:13 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010101339.09ADdDL6085652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 10 Oct 2020 13:39:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366613 - head/bin/ls X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/bin/ls X-SVN-Commit-Revision: 366613 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, 10 Oct 2020 13:39:14 -0000 Author: gbe (doc committer) Date: Sat Oct 10 13:39:13 2020 New Revision: 366613 URL: https://svnweb.freebsd.org/changeset/base/366613 Log: ls(1): Use \& as an escape character for the ',' option Reported by: karels@, xtouqh at hotmail dot com MFC after: 1 day Modified: head/bin/ls/ls.1 Modified: head/bin/ls/ls.1 ============================================================================== --- head/bin/ls/ls.1 Sat Oct 10 13:33:57 2020 (r366612) +++ head/bin/ls/ls.1 Sat Oct 10 13:39:13 2020 (r366613) @@ -40,7 +40,7 @@ .Nd list directory contents .Sh SYNOPSIS .Nm -.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1 , +.Op Fl ABCFGHILPRSTUWZabcdfghiklmnopqrstuwxy1\&, .Op Fl -color Ns = Ns Ar when .Op Fl D Ar format .Op Ar From owner-svn-src-head@freebsd.org Sat Oct 10 14:20: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 8B3193F85F2; Sat, 10 Oct 2020 14:20:08 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C7nCD3BFjz3YKk; Sat, 10 Oct 2020 14:20:08 +0000 (UTC) (envelope-from gbe@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 500E0BD5C; Sat, 10 Oct 2020 14:20:08 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09AEK8pF015045; Sat, 10 Oct 2020 14:20:08 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09AEK72M015043; Sat, 10 Oct 2020 14:20:07 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010101420.09AEK72M015043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 10 Oct 2020 14:20:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366615 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 366615 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, 10 Oct 2020 14:20:08 -0000 Author: gbe (doc committer) Date: Sat Oct 10 14:20:07 2020 New Revision: 366615 URL: https://svnweb.freebsd.org/changeset/base/366615 Log: man5: Fix a few typos spotted by igor - fstab(5): conjuction -> conjunction - mount.conf(5): repeated 'the' - periodic.conf(5): Partion -> Partition MFC after: 1 week Modified: head/share/man/man5/fstab.5 head/share/man/man5/mount.conf.5 head/share/man/man5/periodic.conf.5 Modified: head/share/man/man5/fstab.5 ============================================================================== --- head/share/man/man5/fstab.5 Sat Oct 10 13:46:48 2020 (r366614) +++ head/share/man/man5/fstab.5 Sat Oct 10 14:20:07 2020 (r366615) @@ -205,7 +205,7 @@ is applied automatically. .Pp The .Dq update -option is typically used in conjuction with two +option is typically used in conjunction with two .Nm files. The first Modified: head/share/man/man5/mount.conf.5 ============================================================================== --- head/share/man/man5/mount.conf.5 Sat Oct 10 13:46:48 2020 (r366614) +++ head/share/man/man5/mount.conf.5 Sat Oct 10 14:20:07 2020 (r366615) @@ -123,8 +123,7 @@ is performed. When the kernel processes this line, a .Li mountroot> command-line prompt is displayed. -At this prompt, the operator can enter the -the root mount. +At this prompt, the operator can enter the root mount. .It Ic .md Ar file Create a memory backed .Xr md 4 Modified: head/share/man/man5/periodic.conf.5 ============================================================================== --- head/share/man/man5/periodic.conf.5 Sat Oct 10 13:46:48 2020 (r366614) +++ head/share/man/man5/periodic.conf.5 Sat Oct 10 14:20:07 2020 (r366615) @@ -256,7 +256,7 @@ as configured in .Pq Vt bool Set to .Dq Li YES -to create backup of EFI System Partion (ESP). +to create backup of EFI System Partition (ESP). .It Va daily_backup_gpart_enable .Pq Vt bool Set to From owner-svn-src-head@freebsd.org Sat Oct 10 14:36: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 636F03F8FDD; Sat, 10 Oct 2020 14:36:17 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C7nYs21Zvz3Z2c; Sat, 10 Oct 2020 14:36:17 +0000 (UTC) (envelope-from gbe@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 28C10C39C; Sat, 10 Oct 2020 14:36:17 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09AEaHsh026773; Sat, 10 Oct 2020 14:36:17 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09AEaHjQ026772; Sat, 10 Oct 2020 14:36:17 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010101436.09AEaHjQ026772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 10 Oct 2020 14:36:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366616 - head/usr.sbin/cxgbetool X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/usr.sbin/cxgbetool X-SVN-Commit-Revision: 366616 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, 10 Oct 2020 14:36:17 -0000 Author: gbe (doc committer) Date: Sat Oct 10 14:36:16 2020 New Revision: 366616 URL: https://svnweb.freebsd.org/changeset/base/366616 Log: cxgbetool(8): Remove dublicate word 'whether' MFC after: 1 week Modified: head/usr.sbin/cxgbetool/cxgbetool.8 Modified: head/usr.sbin/cxgbetool/cxgbetool.8 ============================================================================== --- head/usr.sbin/cxgbetool/cxgbetool.8 Sat Oct 10 14:20:07 2020 (r366615) +++ head/usr.sbin/cxgbetool/cxgbetool.8 Sat Oct 10 14:36:16 2020 (r366616) @@ -547,7 +547,7 @@ There is an implicit rule that disables offload for co match anything in the policy. .Pp Each rule consists of a filter part, which determines what connections the -rule applies to, and a settings part, which determines whether whether matching +rule applies to, and a settings part, which determines whether matching connections will be offloaded and, if so, with what settings. The general form of a rule is .Bl -ohang -offset indent From owner-svn-src-head@freebsd.org Sat Oct 10 14:38: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 8F7273F961B; Sat, 10 Oct 2020 14:38:02 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-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 4C7nbt3MRPz3ZDn; Sat, 10 Oct 2020 14:38:02 +0000 (UTC) (envelope-from gbe@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 399F8C22A; Sat, 10 Oct 2020 14:38:02 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09AEc2cT026885; Sat, 10 Oct 2020 14:38:02 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09AEc22u026884; Sat, 10 Oct 2020 14:38:02 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202010101438.09AEc22u026884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Sat, 10 Oct 2020 14:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366617 - head/usr.sbin/pnfsdsfile X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/usr.sbin/pnfsdsfile X-SVN-Commit-Revision: 366617 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, 10 Oct 2020 14:38:02 -0000 Author: gbe (doc committer) Date: Sat Oct 10 14:38:01 2020 New Revision: 366617 URL: https://svnweb.freebsd.org/changeset/base/366617 Log: pnfsdsfile(8): Remove dublicate word 'the' MFC after: 1 week Modified: head/usr.sbin/pnfsdsfile/pnfsdsfile.8 Modified: head/usr.sbin/pnfsdsfile/pnfsdsfile.8 ============================================================================== --- head/usr.sbin/pnfsdsfile/pnfsdsfile.8 Sat Oct 10 14:36:16 2020 (r366616) +++ head/usr.sbin/pnfsdsfile/pnfsdsfile.8 Sat Oct 10 14:38:01 2020 (r366617) @@ -117,7 +117,7 @@ After being re-enabled, the command with the .Dq -r option -will be used to copy the the file's data to this repaired DS and then update the +will be used to copy the file's data to this repaired DS and then update the extended attribute to use it. .Pp A typical use of this will be within a From owner-svn-src-head@freebsd.org Sat Oct 10 21: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 960CB42B0E7; Sat, 10 Oct 2020 21:46:01 +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 4C7z5j3T2yz4K4g; Sat, 10 Oct 2020 21:46:01 +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 56B20112C3; Sat, 10 Oct 2020 21:46: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 09ALk1ep098651; Sat, 10 Oct 2020 21:46:01 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09ALjxbF098638; Sat, 10 Oct 2020 21:45:59 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202010102145.09ALjxbF098638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 10 Oct 2020 21:45:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366620 - in head/sys: conf dev/random/fenestrasX X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: conf dev/random/fenestrasX X-SVN-Commit-Revision: 366620 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, 10 Oct 2020 21:46:01 -0000 Author: cem Date: Sat Oct 10 21:45:59 2020 New Revision: 366620 URL: https://svnweb.freebsd.org/changeset/base/366620 Log: Add "Fenestras X" alternative /dev/random implementation Fortuna remains the default; no functional change to GENERIC. Big picture: - Scalable entropy generation with per-CPU, buffered local generators. - "Push" system for reseeding child generators when root PRNG is reseeded. (Design can be extended to arc4random(9) and userspace generators.) - Similar entropy pooling system to Fortuna, but starts with a single pool to quickly bootstrap as much entropy as possible early on. - Reseeding from pooled entropy based on time schedule. The time interval starts small and grows exponentially until reaching a cap. Again, the goal is to have the RNG state depend on as much entropy as possible quickly, but still periodically incorporate new entropy for the same reasons as Fortuna. Notable design choices in this implementation that differ from those specified in the whitepaper: - Blake2B instead of SHA-2 512 for entropy pooling - Chacha20 instead of AES-CTR DRBG - Initial seeding. We support more platforms and not all of them use loader(8). So we have to grab the initial entropy sources in kernel mode instead, as much as possible. Fortuna didn't have any mechanism for this aside from the special case of loader-provided previous-boot entropy, so most of these sources remain TODO after this commit. Reviewed by: markm Approved by: csprng (markm) Differential Revision: https://reviews.freebsd.org/D22837 Added: head/sys/dev/random/fenestrasX/ head/sys/dev/random/fenestrasX/fx_brng.c (contents, props changed) head/sys/dev/random/fenestrasX/fx_brng.h (contents, props changed) head/sys/dev/random/fenestrasX/fx_hash.h (contents, props changed) head/sys/dev/random/fenestrasX/fx_main.c (contents, props changed) head/sys/dev/random/fenestrasX/fx_pool.c (contents, props changed) head/sys/dev/random/fenestrasX/fx_pool.h (contents, props changed) head/sys/dev/random/fenestrasX/fx_priv.h (contents, props changed) head/sys/dev/random/fenestrasX/fx_rng.c (contents, props changed) head/sys/dev/random/fenestrasX/fx_rng.h (contents, props changed) Modified: head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sat Oct 10 18:22:12 2020 (r366619) +++ head/sys/conf/NOTES Sat Oct 10 21:45:59 2020 (r366620) @@ -2772,6 +2772,8 @@ options RCTL options MAXFILES=999 # Random number generator +# Alternative algorithm. +#options RANDOM_FENESTRASX # Allow the CSPRNG algorithm to be loaded as a module. #options RANDOM_LOADABLE # Select this to allow high-rate but potentially expensive Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Oct 10 18:22:12 2020 (r366619) +++ head/sys/conf/files Sat Oct 10 21:45:59 2020 (r366620) @@ -722,7 +722,7 @@ contrib/zstd/lib/decompress/zstd_decompress_block.c op compile-with "${ZSTD_C} ${ZSTD_DECOMPRESS_BLOCK_FLAGS}" contrib/zstd/lib/decompress/huf_decompress.c optional zstdio compile-with ${ZSTD_C} # Blake 2 -contrib/libb2/blake2b-ref.c optional crypto | ipsec | ipsec_support \ +contrib/libb2/blake2b-ref.c optional crypto | ipsec | ipsec_support | !random_loadable random_fenestrasx \ compile-with "${NORMAL_C} -I$S/crypto/blake2 -Wno-cast-qual -DSUFFIX=_ref -Wno-unused-function" contrib/libb2/blake2s-ref.c optional crypto | ipsec | ipsec_support \ compile-with "${NORMAL_C} -I$S/crypto/blake2 -Wno-cast-qual -DSUFFIX=_ref -Wno-unused-function" @@ -2820,7 +2820,14 @@ rt2860.fw optional rt2860fw | ralfw \ dev/random/random_infra.c standard dev/random/random_harvestq.c standard dev/random/randomdev.c optional !random_loadable -dev/random/fortuna.c optional !random_loadable +dev/random/fenestrasX/fx_brng.c optional !random_loadable random_fenestrasx +dev/random/fenestrasX/fx_main.c optional !random_loadable random_fenestrasx \ + compile-with "${NORMAL_C} -I$S/crypto/blake2" +dev/random/fenestrasX/fx_pool.c optional !random_loadable random_fenestrasx \ + compile-with "${NORMAL_C} -I$S/crypto/blake2" +dev/random/fenestrasX/fx_rng.c optional !random_loadable random_fenestrasx \ + compile-with "${NORMAL_C} -I$S/crypto/blake2" +dev/random/fortuna.c optional !random_loadable !random_fenestrasx dev/random/hash.c optional !random_loadable dev/rccgpio/rccgpio.c optional rccgpio gpio dev/re/if_re.c optional re Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sat Oct 10 18:22:12 2020 (r366619) +++ head/sys/conf/options Sat Oct 10 21:45:59 2020 (r366620) @@ -966,6 +966,8 @@ RACCT_DEFAULT_TO_DISABLED opt_global.h RCTL opt_global.h # Random number generator(s) +# Alternative RNG algorithm. +RANDOM_FENESTRASX opt_global.h # With this, no entropy processor is loaded, but the entropy # harvesting infrastructure is present. This means an entropy # processor may be loaded as a module. Added: head/sys/dev/random/fenestrasX/fx_brng.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/random/fenestrasX/fx_brng.c Sat Oct 10 21:45:59 2020 (r366620) @@ -0,0 +1,295 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Conrad Meyer + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include + +/* + * Implementation of a buffered RNG, described in § 1.2-1.4 of the whitepaper. + */ + +/* + * Initialize a buffered rng instance (either the static root instance, or a + * per-cpu instance on the heap. Both should be zero initialized before this + * routine. + */ +void +fxrng_brng_init(struct fxrng_buffered_rng *rng) +{ + fxrng_rng_init(&rng->brng_rng, rng == &fxrng_root); + + /* I.e., the buffer is empty. */ + rng->brng_avail_idx = sizeof(rng->brng_buffer); + + /* + * It is fine and correct for brng_generation and brng_buffer to be + * zero values. + * + * brng_prf and brng_generation must be initialized later. + * Initialization is special for the root BRNG. PCPU child instances + * use fxrng_brng_produce_seed_data_internal() below. + */ +} + +/* + * Directly reseed the root BRNG from a first-time entropy source, + * incorporating the existing BRNG state. The main motivation for doing so "is + * to ensure that as soon as an entropy source produces data, PRNG output + * depends on the data from that source." (§ 3.1) + * + * The root BRNG is locked on entry and initial keying (brng_generation > 0) + * has already been performed. The root BRNG is unlocked on return. + */ +void +fxrng_brng_src_reseed(const struct harvest_event *event) +{ + struct fxrng_buffered_rng *rng; + + rng = &fxrng_root; + FXRNG_BRNG_ASSERT(rng); + ASSERT_DEBUG(rng->brng_generation > 0, "root RNG not seeded"); + + fxrng_rng_src_reseed(&rng->brng_rng, event); + FXRNG_BRNG_ASSERT(rng); + + /* + * Bump root generation (which is costly) to force downstream BRNGs to + * reseed and quickly incorporate the new entropy. The intuition is + * that this tradeoff is worth it because new sources show up extremely + * rarely (limiting cost) and if they can contribute any entropy to a + * weak state, we want to propagate it to all generators ASAP. + */ + rng->brng_generation++; + atomic_store_rel_64(&fxrng_root_generation, rng->brng_generation); + FXRNG_BRNG_UNLOCK(rng); +} + +/* + * Reseed a brng from some amount of pooled entropy (determined in fx_pool.c by + * fxent_timer_reseed_npools). For initial seeding, we pool entropy in a + * single pool and use this API as well (fxrng_alg_seeded). + */ +void +fxrng_brng_reseed(const void *entr, size_t sz) +{ + struct fxrng_buffered_rng *rng; + + rng = &fxrng_root; + FXRNG_BRNG_LOCK(rng); + + fxrng_rng_reseed(&rng->brng_rng, (rng->brng_generation > 0), entr, sz); + FXRNG_BRNG_ASSERT(rng); + + rng->brng_generation++; + atomic_store_rel_64(&fxrng_root_generation, rng->brng_generation); + FXRNG_BRNG_UNLOCK(rng); +} + +/* + * Grab some bytes off an initialized, current generation RNG. + * + * (Does not handle reseeding if our generation is stale.) + * + * Locking protocol is a bit odd. The RNG is locked on entrance, but the lock + * is dropped on exit. This avoids holding a lock during expensive and slow + * RNG generation. + */ +static void +fxrng_brng_getbytes_internal(struct fxrng_buffered_rng *rng, void *buf, + size_t nbytes) +{ + + FXRNG_BRNG_ASSERT(rng); + + /* Make the zero request impossible for the rest of the logic. */ + if (__predict_false(nbytes == 0)) { + FXRNG_BRNG_UNLOCK(rng); + goto out; + } + + /* Fast/easy case: Use some bytes from the buffer. */ + if (rng->brng_avail_idx + nbytes <= sizeof(rng->brng_buffer)) { + memcpy(buf, &rng->brng_buffer[rng->brng_avail_idx], nbytes); + explicit_bzero(&rng->brng_buffer[rng->brng_avail_idx], nbytes); + rng->brng_avail_idx += nbytes; + FXRNG_BRNG_UNLOCK(rng); + goto out; + } + + /* Buffer case: */ + if (nbytes < sizeof(rng->brng_buffer)) { + size_t rem; + + /* Drain anything left in the buffer first. */ + if (rng->brng_avail_idx < sizeof(rng->brng_buffer)) { + rem = sizeof(rng->brng_buffer) - rng->brng_avail_idx; + ASSERT_DEBUG(nbytes > rem, "invariant"); + + memcpy(buf, &rng->brng_buffer[rng->brng_avail_idx], rem); + + buf = (uint8_t*)buf + rem; + nbytes -= rem; + ASSERT_DEBUG(nbytes != 0, "invariant"); + } + + /* + * Partial fill from first buffer, have to rekey and generate a + * new buffer to do the rest. + */ + fxrng_rng_genrandom_internal(&rng->brng_rng, rng->brng_buffer, + sizeof(rng->brng_buffer), false); + FXRNG_BRNG_ASSERT(rng); + rng->brng_avail_idx = 0; + + memcpy(buf, &rng->brng_buffer[rng->brng_avail_idx], nbytes); + explicit_bzero(&rng->brng_buffer[rng->brng_avail_idx], nbytes); + rng->brng_avail_idx += nbytes; + FXRNG_BRNG_UNLOCK(rng); + goto out; + } + + /* Large request; skip the buffer. */ + fxrng_rng_genrandom_internal(&rng->brng_rng, buf, nbytes, true); + +out: + FXRNG_BRNG_ASSERT_NOT(rng); + return; +} + +/* + * API to get a new key for a downstream RNG. Returns the new key in 'buf', as + * well as the generator's reseed_generation. + * + * 'rng' is locked on entry and unlocked on return. + * + * Only valid after confirming the caller's seed version or reseed_generation + * matches roots (or we are root). (For now, this is only used to reseed the + * per-CPU generators from root.) + */ +void +fxrng_brng_produce_seed_data_internal(struct fxrng_buffered_rng *rng, + void *buf, size_t keysz, uint64_t *seed_generation) +{ + FXRNG_BRNG_ASSERT(rng); + ASSERT_DEBUG(keysz == FX_CHACHA20_KEYSIZE, "keysz: %zu", keysz); + + *seed_generation = rng->brng_generation; + fxrng_brng_getbytes_internal(rng, buf, keysz); + FXRNG_BRNG_ASSERT_NOT(rng); +} + +/* + * Read from an allocated and initialized buffered BRNG. This a high-level + * API, but doesn't handle PCPU BRNG allocation. + * + * BRNG is locked on entry. It is unlocked on return. + */ +void +fxrng_brng_read(struct fxrng_buffered_rng *rng, void *buf, size_t nbytes) +{ + uint8_t newkey[FX_CHACHA20_KEYSIZE]; + + FXRNG_BRNG_ASSERT(rng); + + /* Fast path: there hasn't been a global reseed since last read. */ + if (rng->brng_generation == atomic_load_acq_64(&fxrng_root_generation)) + goto done_reseeding; + + ASSERT(rng != &fxrng_root, "root rng inconsistent seed version"); + + /* + * Slow path: We need to rekey from the parent BRNG to incorporate new + * entropy material. + * + * Lock order is always root -> percpu. + */ + FXRNG_BRNG_UNLOCK(rng); + FXRNG_BRNG_LOCK(&fxrng_root); + FXRNG_BRNG_LOCK(rng); + + /* + * If we lost the reseeding race when the lock was dropped, don't + * duplicate work. + */ + if (__predict_false(rng->brng_generation == + atomic_load_acq_64(&fxrng_root_generation))) { + FXRNG_BRNG_UNLOCK(&fxrng_root); + goto done_reseeding; + } + + fxrng_brng_produce_seed_data_internal(&fxrng_root, newkey, + sizeof(newkey), &rng->brng_generation); + + FXRNG_BRNG_ASSERT_NOT(&fxrng_root); + FXRNG_BRNG_ASSERT(rng); + + fxrng_rng_setkey(&rng->brng_rng, newkey, sizeof(newkey)); + explicit_bzero(newkey, sizeof(newkey)); + + /* + * A reseed invalidates any previous buffered contents. Here, we + * forward the available index to the end of the buffer, i.e., empty. + * Requests that would use the buffer (< 128 bytes) will refill its + * contents on demand. + * + * It is explicitly ok that we do not zero out any remaining buffer + * bytes; they will never be handed out to callers, and they reveal + * nothing about the reseeded key (which came from the root BRNG). + * (§ 1.3) + */ + rng->brng_avail_idx = sizeof(rng->brng_buffer); + +done_reseeding: + if (rng != &fxrng_root) + FXRNG_BRNG_ASSERT_NOT(&fxrng_root); + FXRNG_BRNG_ASSERT(rng); + + fxrng_brng_getbytes_internal(rng, buf, nbytes); + FXRNG_BRNG_ASSERT_NOT(rng); +} Added: head/sys/dev/random/fenestrasX/fx_brng.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/random/fenestrasX/fx_brng.h Sat Oct 10 21:45:59 2020 (r366620) @@ -0,0 +1,66 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Conrad Meyer + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#pragma once + +#include + +#define FXRNG_BUFRNG_SZ 128 + +/* + * An object representing a buffered random number generator with forward + * secrecy (aka "fast-key-erasure"). + * + * There is a single static root instance of this object associated with the + * entropy harvester, as well as additional instances per CPU, lazily allocated + * in NUMA-local memory, seeded from output of the root generator. + */ +struct fxrng_buffered_rng { + struct fxrng_basic_rng brng_rng; +#define FXRNG_BRNG_LOCK(brng) mtx_lock(&(brng)->brng_rng.rng_lk) +#define FXRNG_BRNG_UNLOCK(brng) mtx_unlock(&(brng)->brng_rng.rng_lk) +#define FXRNG_BRNG_ASSERT(brng) mtx_assert(&(brng)->brng_rng.rng_lk, MA_OWNED) +#define FXRNG_BRNG_ASSERT_NOT(brng) \ + mtx_assert(&(brng)->brng_rng.rng_lk, MA_NOTOWNED) + + /* Entropy reseed generation ("seed version"). */ + uint64_t brng_generation; + + /* Buffered output for quick access by small requests. */ + uint8_t brng_buffer[FXRNG_BUFRNG_SZ]; + uint8_t brng_avail_idx; +}; + +void fxrng_brng_init(struct fxrng_buffered_rng *); +void fxrng_brng_produce_seed_data_internal(struct fxrng_buffered_rng *, void *, + size_t, uint64_t *seed_generation); +void fxrng_brng_read(struct fxrng_buffered_rng *, void *, size_t); + +void fxrng_brng_reseed(const void *, size_t); +struct harvest_event; +void fxrng_brng_src_reseed(const struct harvest_event *); Added: head/sys/dev/random/fenestrasX/fx_hash.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/random/fenestrasX/fx_hash.h Sat Oct 10 21:45:59 2020 (r366620) @@ -0,0 +1,72 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Conrad Meyer + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#pragma once + +#include +#define blake2b_init blake2b_init_ref +#define blake2b_update blake2b_update_ref +#define blake2b_final blake2b_final_ref +#include + +#define FXRNG_HASH_SZ BLAKE2B_OUTBYTES /* 64 */ + +/* + * Wrappers for hash function abstraction. + */ +struct fxrng_hash { + blake2b_state state; +}; + +static inline void +fxrng_hash_init(struct fxrng_hash *h) +{ + int rc; + + rc = blake2b_init(&h->state, FXRNG_HASH_SZ); + ASSERT(rc == 0, "blake2b_init"); +} + +static inline void +fxrng_hash_update(struct fxrng_hash *h, const void *buf, size_t sz) +{ + int rc; + + rc = blake2b_update(&h->state, buf, sz); + ASSERT(rc == 0, "blake2b_update"); +} + +static inline void +fxrng_hash_finish(struct fxrng_hash *h, uint8_t buf[static FXRNG_HASH_SZ], size_t sz) +{ + int rc; + + rc = blake2b_final(&h->state, buf, sz); + ASSERT(rc == 0, "blake2b_final(sz=%zu)", sz); + explicit_bzero(h, sizeof(*h)); +} Added: head/sys/dev/random/fenestrasX/fx_main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/random/fenestrasX/fx_main.c Sat Oct 10 21:45:59 2020 (r366620) @@ -0,0 +1,274 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Conrad Meyer + * + * 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. + */ + +/* + * This random algorithm is derived in part from the "Windows 10 random number + * generation infrastructure" whitepaper published by Niels Ferguson and + * Microsoft: https://aka.ms/win10rng + * + * It is also inspired by DJB's writing on buffered key-erasure PRNGs: + * https://blog.cr.yp.to/20170723-random.html + * + * The Windows 10 RNG bears some similarity to Fortuna, which Ferguson was also + * involved with. Notable differences include: + * - Extended to multi-CPU design + * - Extended to pre-buffer some PRNG output + * - Pool-based reseeding is solely time-based (rather than on-access w/ + * pacing) + * - Extended to specify efficient userspace design + * - Always-available design (requires the equivalent of loader(8) for all + * boots; probably relatively easy given the limited platforms Windows 10 + * supports) + * + * Some aspects of the design document I found confusing and may have + * misinterpreted: + * - Relationship between root PRNG seed version and periodic reseed pool use. + * I interpreted these as separate sequences. The root PRNG seed version is + * bumped both by the periodic pool based reseed, and also special + * conditions such as the first time an entropy source provides entropy. I + * don't think first-time entropy sources should cause us to skip an entropy + * pool reseed. + * - Initial seeding. The paper is pretty terse on the subject. My + * interpretation of the document is that the Windows RNG infrastructure + * relies on the loader(8)-provided material for initial seeding and either + * ignores or doesn't start entropy sources until after that time. So when + * the paper says that first-time entropy source material "bypasses the + * pools," the root PRNG state already has been keyed for the first time and + * can generate 256 bits, mix it with the first-time entropy, and reseed + * immediately. + * + * Some notable design choices in this implementation divergent from that + * specified in the document above: + * - Blake2b instead of SHA-2 512 for entropy pooling + * - Chacha20 instead of AES-CTR DRBG for PRF + * - Initial seeding. We treat the 0->1 seed version (brng_generation) edge + * as the transition from blocked to unblocked. That edge is also the first + * time the key of the root BRNG's PRF is set. We perform initial seeding + * when the first request for entropy arrives. + * • As a result: Entropy callbacks prior to this edge do not have a keyed + * root PRNG, so bypassing the pools is kind of meaningless. Instead, + * they feed into pool0. (They also do not set the root PRNG key or bump + * the root PRNG seed version.) + * • Entropy callbacks after the edge behave like the specification. + * • All one-off sources are fed into pool0 and the result used to seed the + * root BRNG during the initial seed step. + * • All memory needed for initial seeding must be preallocated or static or + * fit on the stack; random reads can occur in nonsleepable contexts and + * we cannot allocate M_WAITOK. (We also cannot fail to incorporate any + * present one-off source, to the extent it is in the control of + * software.) + * - Timer interval reseeding. We also start the timer-based reseeding at + * initial seed, but unlike the design, our initial seed is some time after + * load (usually within the order of micro- or milliseconds due to + * stack_guard on x86, but conceivably later if nothing reads from random for + * a while). + * + * Not yet implemented, not in scope, or todo: + * - arc4random(9) injection/replacement + * - Userspace portions -- shared page, like timehands vdso? + */ + +#include +__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 + +struct fxrng_buffered_rng fxrng_root; +uint64_t __read_mostly fxrng_root_generation; +DPCPU_DEFINE_STATIC(struct fxrng_buffered_rng *, fxrng_brng); + +/* + * Top-level read API from randomdev. Responsible for NOWAIT-allocating + * per-cpu NUMA-local BRNGs, if needed and satisfiable; subroutines handle + * reseeding if the local BRNG is stale and rekeying when necessary. In + * low-memory conditions when a local BRNG cannot be allocated, the request is + * simply forwarded to the root BRNG. + * + * It is a precondition is that the root BRNG initial seeding has completed and + * the root generation number >0. + */ +static void +fxrng_alg_read(uint8_t *output, size_t nbytes) +{ + struct fxrng_buffered_rng **pcpu_brng_p, *rng, *tmp; + struct pcpu *pcpu; + + pcpu = get_pcpu(); + + /* + * The following statement directly accesses an implementation detail + * of DPCPU, but the macros cater only to pinned threads; we want to + * operate on our initial CPU, without pinning, *even if* we migrate. + */ + pcpu_brng_p = _DPCPU_PTR(pcpu->pc_dynamic, fxrng_brng); + + rng = (void *)atomic_load_acq_ptr((uintptr_t *)pcpu_brng_p); + + /* + * Usually the pcpu BRNG has already been allocated, but we do it + * on-demand and need to check first. BRNGs are never deallocated and + * are valid as soon as the pointer is initialized. + */ + if (__predict_false(rng == NULL)) { + uint8_t newkey[FX_CHACHA20_KEYSIZE]; + struct domainset *ds; + int domain; + + domain = pcpu->pc_domain; + + /* + * Allocate pcpu BRNGs off-domain on weird NUMA machines like + * AMD Threadripper 2990WX, which has 2 NUMA nodes without + * local memory controllers. The PREF policy is automatically + * converted to something appropriate when domains are empty. + * (FIXED is not.) + * + * Otherwise, allocate strictly CPU-local memory. The + * rationale is this: if there is a memory shortage such that + * PREF policy would fallback to RR, we have no business + * wasting memory on a faster BRNG. So, use a FIXED domainset + * policy. If we cannot allocate, that's fine! We fall back + * to invoking the root BRNG. + */ + if (VM_DOMAIN_EMPTY(domain)) + ds = DOMAINSET_PREF(domain); + else + ds = DOMAINSET_FIXED(domain); + + rng = malloc_domainset(sizeof(*rng), M_ENTROPY, ds, + M_NOWAIT | M_ZERO); + if (rng == NULL) { + /* Relatively easy case: fall back to root BRNG. */ + rng = &fxrng_root; + goto have_valid_rng; + } + + fxrng_brng_init(rng); + + /* + * The root BRNG is always up and available. Requests are + * always satisfiable. This is a design invariant. + */ + ASSERT_DEBUG(atomic_load_acq_64(&fxrng_root_generation) != 0, + "%s: attempting to seed child BRNG when root hasn't " + "been initialized yet.", __func__); + + FXRNG_BRNG_LOCK(&fxrng_root); +#ifdef WITNESS + /* Establish lock order root->pcpu for WITNESS. */ + FXRNG_BRNG_LOCK(rng); + FXRNG_BRNG_UNLOCK(rng); +#endif + fxrng_brng_produce_seed_data_internal(&fxrng_root, newkey, + sizeof(newkey), &rng->brng_generation); + FXRNG_BRNG_ASSERT_NOT(&fxrng_root); + + fxrng_rng_setkey(&rng->brng_rng, newkey, sizeof(newkey)); + explicit_bzero(newkey, sizeof(newkey)); + + /* + * We have a valid RNG. Try to install it, or grab the other + * one if we lost the race. + */ + tmp = NULL; + while (tmp == NULL) + if (atomic_fcmpset_ptr((uintptr_t *)pcpu_brng_p, + (uintptr_t *)&tmp, (uintptr_t)rng)) + goto have_valid_rng; + + /* + * We lost the race. There's nothing sensitive about + * our BRNG's PRF state, because it will never be used + * for anything and the key doesn't expose any + * information about the parent (root) generator's + * state -- it has already rekeyed. The generation + * number is public, and a zero counter isn't sensitive. + */ + free(rng, M_ENTROPY); + /* + * Use the winner's PCPU BRNG. + */ + rng = tmp; + } + +have_valid_rng: + /* At this point we have a valid, initialized and seeded rng pointer. */ + FXRNG_BRNG_LOCK(rng); + fxrng_brng_read(rng, output, nbytes); + FXRNG_BRNG_ASSERT_NOT(rng); +} + +static void +fxrng_init_alg(void *dummy __unused) +{ + DPCPU_ZERO(fxrng_brng); + fxrng_brng_init(&fxrng_root); + fxrng_pools_init(); +} +SYSINIT(random_alg, SI_SUB_RANDOM, SI_ORDER_SECOND, fxrng_init_alg, NULL); + +/* + * Public visibility struct referenced directly by other parts of randomdev. + */ +const struct random_algorithm random_alg_context = { + .ra_ident = "fenestrasX", + .ra_pre_read = (void (*)(void))nullop, + .ra_read = fxrng_alg_read, + .ra_seeded = fxrng_alg_seeded, + .ra_event_processor = fxrng_event_processor, + .ra_poolcount = FXRNG_NPOOLS, +}; Added: head/sys/dev/random/fenestrasX/fx_pool.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/random/fenestrasX/fx_pool.c Sat Oct 10 21:45:59 2020 (r366620) @@ -0,0 +1,615 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Conrad Meyer + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include + +/* + * Timer-based reseed interval growth factor and limit in seconds. (§ 3.2) + */ +#define FXENT_RESSED_INTVL_GFACT 3 +#define FXENT_RESEED_INTVL_MAX 3600 + +/* + * Pool reseed schedule. Initially, only pool 0 is active. Until the timer + * interval reaches INTVL_MAX, only pool 0 is used. + * + * After reaching INTVL_MAX, pool k is either activated (if inactive) or used + * (if active) every 3^k timer reseeds. (§ 3.3) + * + * (Entropy harvesting only round robins across active pools.) + */ +#define FXENT_RESEED_BASE 3 + +/* + * Number of bytes from high quality sources to allocate to pool 0 before + * normal round-robin allocation after each timer reseed. (§ 3.4) + */ +#define FXENT_HI_SRC_POOL0_BYTES 32 + +/* + * § 3.1 + * + * Low sources provide unconditioned entropy, such as mouse movements; high + * sources are assumed to provide high-quality random bytes. Pull sources are + * those which can be polled, i.e., anything randomdev calls a "random_source." + * + * In the whitepaper, low sources are pull. For us, at least in the existing + * design, low-quality sources push into some global ring buffer and then get + * forwarded into the RNG by a thread that continually polls. Presumably their + * design batches low entopy signals in some way (SHA512?) and only requests + * them dynamically on reseed. I'm not sure what the benefit is vs feeding + * into the pools directly. + */ +enum fxrng_ent_access_cls { + FXRNG_PUSH, + FXRNG_PULL, +}; +enum fxrng_ent_source_cls { + FXRNG_HI, + FXRNG_LO, + FXRNG_GARBAGE, +}; +struct fxrng_ent_cls { + enum fxrng_ent_access_cls entc_axx_cls; + enum fxrng_ent_source_cls entc_src_cls; +}; + +static const struct fxrng_ent_cls fxrng_hi_pull = { + .entc_axx_cls = FXRNG_PULL, + .entc_src_cls = FXRNG_HI, +}; +static const struct fxrng_ent_cls fxrng_hi_push = { + .entc_axx_cls = FXRNG_PUSH, + .entc_src_cls = FXRNG_HI, +}; +static const struct fxrng_ent_cls fxrng_lo_push = { + .entc_axx_cls = FXRNG_PUSH, + .entc_src_cls = FXRNG_LO, +}; +static const struct fxrng_ent_cls fxrng_garbage = { + .entc_axx_cls = FXRNG_PUSH, + .entc_src_cls = FXRNG_GARBAGE, +}; + +/* + * This table is a mapping of randomdev's current source abstractions to the + * designations above; at some point, if the design seems reasonable, it would + * make more sense to pull this up into the abstraction layer instead. + */ +static const struct fxrng_ent_char { + const struct fxrng_ent_cls *entc_cls; +} fxrng_ent_char[ENTROPYSOURCE] = { + [RANDOM_CACHED] = { + .entc_cls = &fxrng_hi_push, + }, + [RANDOM_ATTACH] = { + .entc_cls = &fxrng_lo_push, + }, + [RANDOM_KEYBOARD] = { + .entc_cls = &fxrng_lo_push, + }, + [RANDOM_MOUSE] = { + .entc_cls = &fxrng_lo_push, + }, + [RANDOM_NET_TUN] = { + .entc_cls = &fxrng_lo_push, + }, + [RANDOM_NET_ETHER] = { + .entc_cls = &fxrng_lo_push, + }, + [RANDOM_NET_NG] = { + .entc_cls = &fxrng_lo_push, + }, + [RANDOM_INTERRUPT] = { + .entc_cls = &fxrng_lo_push, + }, + [RANDOM_SWI] = { + .entc_cls = &fxrng_lo_push, + }, + [RANDOM_FS_ATIME] = { + .entc_cls = &fxrng_lo_push, + }, + [RANDOM_UMA] = { + .entc_cls = &fxrng_lo_push, + }, + [RANDOM_PURE_OCTEON] = { + .entc_cls = &fxrng_hi_push, /* Could be made pull. */ + }, + [RANDOM_PURE_SAFE] = { + .entc_cls = &fxrng_hi_push, + }, + [RANDOM_PURE_GLXSB] = { + .entc_cls = &fxrng_hi_push, + }, + [RANDOM_PURE_HIFN] = { + .entc_cls = &fxrng_hi_push, + }, + [RANDOM_PURE_RDRAND] = { + .entc_cls = &fxrng_hi_pull, + }, + [RANDOM_PURE_NEHEMIAH] = { + .entc_cls = &fxrng_hi_pull, + }, + [RANDOM_PURE_RNDTEST] = { + .entc_cls = &fxrng_garbage, + }, + [RANDOM_PURE_VIRTIO] = { + .entc_cls = &fxrng_hi_pull, + }, + [RANDOM_PURE_BROADCOM] = { + .entc_cls = &fxrng_hi_push, + }, + [RANDOM_PURE_CCP] = { + .entc_cls = &fxrng_hi_pull, + }, + [RANDOM_PURE_DARN] = { + .entc_cls = &fxrng_hi_pull, + }, + [RANDOM_PURE_TPM] = { + .entc_cls = &fxrng_hi_push, + }, + [RANDOM_PURE_VMGENID] = { + .entc_cls = &fxrng_hi_push, + }, +}; + +/* Useful for single-bit-per-source state. */ +BITSET_DEFINE(fxrng_bits, ENTROPYSOURCE); + +/* XXX Borrowed from not-yet-committed D22702. */ +#ifndef BIT_TEST_SET_ATOMIC_ACQ +#define BIT_TEST_SET_ATOMIC_ACQ(_s, n, p) \ + (atomic_testandset_acq_long( \ + &(p)->__bits[__bitset_word((_s), (n))], (n)) != 0) +#endif +#define FXENT_TEST_SET_ATOMIC_ACQ(n, p) \ + BIT_TEST_SET_ATOMIC_ACQ(ENTROPYSOURCE, n, p) + +/* For special behavior on first-time entropy sources. (§ 3.1) */ +static struct fxrng_bits __read_mostly fxrng_seen; + +/* For special behavior for high-entropy sources after a reseed. (§ 3.4) */ +_Static_assert(FXENT_HI_SRC_POOL0_BYTES <= UINT8_MAX, ""); +static uint8_t __read_mostly fxrng_reseed_seen[ENTROPYSOURCE]; + +/* Entropy pools. Lock order is ENT -> RNG(root) -> RNG(leaf). */ +static struct mtx fxent_pool_lk; +MTX_SYSINIT(fx_pool, &fxent_pool_lk, "fx entropy pool lock", MTX_DEF); +#define FXENT_LOCK() mtx_lock(&fxent_pool_lk) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Oct 10 21:48: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 C63E842B3B4; Sat, 10 Oct 2020 21:48:08 +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 4C7z884q3kz4KXM; Sat, 10 Oct 2020 21:48:08 +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 6F73F10C7F; Sat, 10 Oct 2020 21:48:08 +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 09ALm8Xt098787; Sat, 10 Oct 2020 21:48:08 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09ALm6Sm098779; Sat, 10 Oct 2020 21:48:06 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202010102148.09ALm6Sm098779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 10 Oct 2020 21:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366621 - in head/sys: dev/random dev/random/fenestrasX libkern sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: dev/random dev/random/fenestrasX libkern sys X-SVN-Commit-Revision: 366621 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, 10 Oct 2020 21:48:08 -0000 Author: cem Date: Sat Oct 10 21:48:06 2020 New Revision: 366621 URL: https://svnweb.freebsd.org/changeset/base/366621 Log: arc4random(9): Integrate with RANDOM_FENESTRASX push-reseed There is no functional change for the existing Fortuna random(4) implementation, which remains the default in GENERIC. In the FenestrasX model, when the root CSPRNG is reseeded from pools due to an (infrequent) timer, child CSPRNGs can cheaply detect this condition and reseed. To do so, they just need to track an additional 64-bit value in the associated state, and compare it against the root seed version (generation) on random reads. This revision integrates arc4random(9) into that model without substantially changing the design or implementation of arc4random(9). The motivation is that arc4random(9) is immediately reseeded when the backing random(4) implementation has additional entropy. This is arguably most important during boot, when fenestrasX is reseeding at 1, 3, 9, 27, etc., second intervals. Today, arc4random(9) has a hardcoded 300 second reseed window. Without this mechanism, if arc4random(9) gets weak entropy during initial seed (and arc4random(9) is used early in boot, so this is quite possible), it may continue to emit poorly seeded output for 5 minutes. The FenestrasX push-reseed scheme corrects consumers, like arc4random(9), as soon as possible. Reviewed by: markm Approved by: csprng (markm) Differential Revision: https://reviews.freebsd.org/D22838 Added: head/sys/dev/random/fenestrasX/fx_pub.h (contents, props changed) Modified: head/sys/dev/random/fenestrasX/fx_brng.c head/sys/dev/random/fenestrasX/fx_main.c head/sys/dev/random/fenestrasX/fx_pool.c head/sys/dev/random/fenestrasX/fx_priv.h head/sys/dev/random/randomdev.c head/sys/libkern/arc4random.c head/sys/sys/libkern.h Modified: head/sys/dev/random/fenestrasX/fx_brng.c ============================================================================== --- head/sys/dev/random/fenestrasX/fx_brng.c Sat Oct 10 21:45:59 2020 (r366620) +++ head/sys/dev/random/fenestrasX/fx_brng.c Sat Oct 10 21:48:06 2020 (r366621) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include /* Modified: head/sys/dev/random/fenestrasX/fx_main.c ============================================================================== --- head/sys/dev/random/fenestrasX/fx_main.c Sat Oct 10 21:45:59 2020 (r366620) +++ head/sys/dev/random/fenestrasX/fx_main.c Sat Oct 10 21:48:06 2020 (r366621) @@ -88,7 +88,6 @@ * a while). * * Not yet implemented, not in scope, or todo: - * - arc4random(9) injection/replacement * - Userspace portions -- shared page, like timehands vdso? */ @@ -125,6 +124,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include struct fxrng_buffered_rng fxrng_root; @@ -142,7 +142,7 @@ DPCPU_DEFINE_STATIC(struct fxrng_buffered_rng *, fxrng * the root generation number >0. */ static void -fxrng_alg_read(uint8_t *output, size_t nbytes) +_fxrng_alg_read(uint8_t *output, size_t nbytes, uint64_t *seed_version_out) { struct fxrng_buffered_rng **pcpu_brng_p, *rng, *tmp; struct pcpu *pcpu; @@ -248,8 +248,30 @@ fxrng_alg_read(uint8_t *output, size_t nbytes) have_valid_rng: /* At this point we have a valid, initialized and seeded rng pointer. */ FXRNG_BRNG_LOCK(rng); + if (seed_version_out != NULL) + *seed_version_out = rng->brng_generation; fxrng_brng_read(rng, output, nbytes); FXRNG_BRNG_ASSERT_NOT(rng); +} + +static void +fxrng_alg_read(uint8_t *output, size_t nbytes) +{ + _fxrng_alg_read(output, nbytes, NULL); +} + +/* + * External API for arc4random(9) to fetch new key material and associated seed + * version in chacha20_randomstir(). + */ +void +read_random_key(void *output, size_t nbytes, uint64_t *seed_version_out) +{ + /* Ensure _fxrng_alg_read invariant. */ + if (__predict_false(atomic_load_acq_64(&fxrng_root_generation) == 0)) + (void)fxrng_alg_seeded(); + + _fxrng_alg_read(output, nbytes, seed_version_out); } static void Modified: head/sys/dev/random/fenestrasX/fx_pool.c ============================================================================== --- head/sys/dev/random/fenestrasX/fx_pool.c Sat Oct 10 21:45:59 2020 (r366620) +++ head/sys/dev/random/fenestrasX/fx_pool.c Sat Oct 10 21:48:06 2020 (r366621) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* * Timer-based reseed interval growth factor and limit in seconds. (§ 3.2) Modified: head/sys/dev/random/fenestrasX/fx_priv.h ============================================================================== --- head/sys/dev/random/fenestrasX/fx_priv.h Sat Oct 10 21:45:59 2020 (r366620) +++ head/sys/dev/random/fenestrasX/fx_priv.h Sat Oct 10 21:48:06 2020 (r366621) @@ -46,4 +46,3 @@ #endif extern struct fxrng_buffered_rng fxrng_root; -extern uint64_t __read_mostly fxrng_root_generation; Added: head/sys/dev/random/fenestrasX/fx_pub.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/random/fenestrasX/fx_pub.h Sat Oct 10 21:48:06 2020 (r366621) @@ -0,0 +1,53 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Conrad Meyer + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#pragma once + +#include + +/* + * The root BRNG seed version, or generation. + * + * FenestrasX-aware downstream CSPRNGs (i.e., arc4random(9)) should track the + * generation number they seeded from, using the read_random_key(9) API below. + * If their current seed version is older than the root generation, they should + * reseed before producing output. + * + * The variable is read-only outside of the fenestrasX implementation and + * should be accessed using 'atomic_load_acq_64(&fxrng_root_generation)'. + * Reseeds are extremely infrequent, so callers may wish to hint to the + * compiler that a matching generation is the expected case, with + * __predict_true() or __predict_false(). + */ +extern uint64_t __read_mostly fxrng_root_generation; + +/* + * A routine for generating seed/key material + * Bypasses random(4) for now, but conceivably could be incorporated into that. + */ +void read_random_key(void *buf, size_t nbytes, uint64_t *seed_version_out); Modified: head/sys/dev/random/randomdev.c ============================================================================== --- head/sys/dev/random/randomdev.c Sat Oct 10 21:45:59 2020 (r366620) +++ head/sys/dev/random/randomdev.c Sat Oct 10 21:48:06 2020 (r366621) @@ -373,8 +373,10 @@ randomdev_unblock(void) selwakeuppri(&rsel, PUSER); wakeup(p_random_alg_context); printf("random: unblocking device.\n"); +#ifndef RANDOM_FENESTRASX /* Do random(9) a favour while we are about it. */ (void)atomic_cmpset_int(&arc4rand_iniseed_state, ARC4_ENTR_NONE, ARC4_ENTR_HAVE); +#endif } /* ARGSUSED */ Modified: head/sys/libkern/arc4random.c ============================================================================== --- head/sys/libkern/arc4random.c Sat Oct 10 21:45:59 2020 (r366620) +++ head/sys/libkern/arc4random.c Sat Oct 10 21:48:06 2020 (r366621) @@ -40,10 +40,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include -#include +#ifdef RANDOM_FENESTRASX +#include +#endif #define CHACHA20_RESEED_BYTES 65536 #define CHACHA20_RESEED_SECONDS 300 @@ -52,7 +56,9 @@ __FBSDID("$FreeBSD$"); CTASSERT(CHACHA20_KEYBYTES*8 >= CHACHA_MINKEYLEN); +#ifndef RANDOM_FENESTRASX int arc4rand_iniseed_state = ARC4_ENTR_NONE; +#endif MALLOC_DEFINE(M_CHACHA20RANDOM, "chacha20random", "chacha20random structures"); @@ -62,6 +68,9 @@ struct chacha20_s { time_t t_reseed; u_int8_t m_buffer[CHACHA20_BUFFER_SIZE]; struct chacha_ctx ctx; +#ifdef RANDOM_FENESTRASX + uint64_t seed_version; +#endif } __aligned(CACHE_LINE_SIZE); static struct chacha20_s *chacha20inst = NULL; @@ -79,7 +88,10 @@ chacha20_randomstir(struct chacha20_s *chacha20) { struct timeval tv_now; u_int8_t key[CHACHA20_KEYBYTES]; +#ifdef RANDOM_FENESTRASX + uint64_t seed_version; +#else if (__predict_false(random_bypass_before_seeding && !is_random_seeded())) { SHA256_CTX ctx; uint64_t cc; @@ -106,6 +118,10 @@ chacha20_randomstir(struct chacha20_s *chacha20) "make sure 256 bits is still 256 bits"); SHA256_Final(key, &ctx); } else { +#endif +#ifdef RANDOM_FENESTRASX + read_random_key(key, CHACHA20_KEYBYTES, &seed_version); +#else /* * If the loader(8) did not have an entropy stash from the * previous shutdown to load, then we will block. The answer is @@ -117,6 +133,7 @@ chacha20_randomstir(struct chacha20_s *chacha20) */ read_random(key, CHACHA20_KEYBYTES); } +#endif getmicrouptime(&tv_now); mtx_lock(&chacha20->mtx); chacha_keysetup(&chacha20->ctx, key, CHACHA20_KEYBYTES*8); @@ -124,6 +141,9 @@ chacha20_randomstir(struct chacha20_s *chacha20) /* Reset for next reseed cycle. */ chacha20->t_reseed = tv_now.tv_sec + CHACHA20_RESEED_SECONDS; chacha20->numbytes = 0; +#ifdef RANDOM_FENESTRASX + chacha20->seed_version = seed_version; +#endif mtx_unlock(&chacha20->mtx); } @@ -173,9 +193,13 @@ arc4rand(void *ptr, u_int len, int reseed) u_int length; u_int8_t *p; +#ifdef RANDOM_FENESTRASX + if (__predict_false(reseed)) +#else if (__predict_false(reseed || (arc4rand_iniseed_state == ARC4_ENTR_HAVE && atomic_cmpset_int(&arc4rand_iniseed_state, ARC4_ENTR_HAVE, ARC4_ENTR_SEED)))) +#endif CHACHA20_FOREACH(chacha20) chacha20_randomstir(chacha20); @@ -185,8 +209,18 @@ arc4rand(void *ptr, u_int len, int reseed) if ((chacha20->numbytes > CHACHA20_RESEED_BYTES) || (tv.tv_sec > chacha20->t_reseed)) chacha20_randomstir(chacha20); - p = ptr; mtx_lock(&chacha20->mtx); +#ifdef RANDOM_FENESTRASX + if (__predict_false( + atomic_load_acq_64(&fxrng_root_generation) != chacha20->seed_version + )) { + mtx_unlock(&chacha20->mtx); + chacha20_randomstir(chacha20); + mtx_lock(&chacha20->mtx); + } +#endif + + p = ptr; while (len) { length = MIN(CHACHA20_BUFFER_SIZE, len); chacha_encrypt_bytes(&chacha20->ctx, chacha20->m_buffer, p, length); Modified: head/sys/sys/libkern.h ============================================================================== --- head/sys/sys/libkern.h Sat Oct 10 21:45:59 2020 (r366620) +++ head/sys/sys/libkern.h Sat Oct 10 21:48:06 2020 (r366621) @@ -116,10 +116,12 @@ static __inline int abs(int a) { return (a < 0 ? -a : static __inline long labs(long a) { return (a < 0 ? -a : a); } static __inline quad_t qabs(quad_t a) { return (a < 0 ? -a : a); } +#ifndef RANDOM_FENESTRASX #define ARC4_ENTR_NONE 0 /* Don't have entropy yet. */ #define ARC4_ENTR_HAVE 1 /* Have entropy. */ #define ARC4_ENTR_SEED 2 /* Reseeding. */ extern int arc4rand_iniseed_state; +#endif /* Prototypes for non-quad routines. */ struct malloc_type; From owner-svn-src-head@freebsd.org Sat Oct 10 21:52: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 2AA1642B6A4; Sat, 10 Oct 2020 21:52:05 +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 4C7zDj0bSrz4Kwm; Sat, 10 Oct 2020 21:52:05 +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 D19BB11548; Sat, 10 Oct 2020 21:52:04 +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 09ALq41s004261; Sat, 10 Oct 2020 21:52:04 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09ALq0js004240; Sat, 10 Oct 2020 21:52:00 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202010102152.09ALq0js004240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 10 Oct 2020 21:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366622 - in head: lib/libc/gen sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/compat/ia32 sys/dev/random/fenestrasX sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/... X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: lib/libc/gen sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/compat/ia32 sys/dev/random/fenestrasX sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sys X-SVN-Commit-Revision: 366622 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, 10 Oct 2020 21:52:05 -0000 Author: cem Date: Sat Oct 10 21:52:00 2020 New Revision: 366622 URL: https://svnweb.freebsd.org/changeset/base/366622 Log: random(4) FenestrasX: Push root seed version to arc4random(3) Push the root seed version to userspace through the VDSO page, if the RANDOM_FENESTRASX algorithm is enabled. Otherwise, there is no functional change. The mechanism can be disabled with debug.fxrng_vdso_enable=0. arc4random(3) obtains a pointer to the root seed version published by the kernel in the shared page at allocation time. Like arc4random(9), it maintains its own per-process copy of the seed version corresponding to the root seed version at the time it last rekeyed. On read requests, the process seed version is compared with the version published in the shared page; if they do not match, arc4random(3) reseeds from the kernel before providing generated output. This change does not implement the FenestrasX concept of PCPU userspace generators seeded from a per-process base generator. That change is left for future discussion/work. Reviewed by: kib (previous version) Approved by: csprng (me -- only touching FXRNG here) Differential Revision: https://reviews.freebsd.org/D22839 Modified: head/lib/libc/gen/arc4random.c head/lib/libc/gen/arc4random.h head/lib/libc/gen/auxv.c head/sys/amd64/amd64/elf_machdep.c head/sys/arm/arm/elf_machdep.c head/sys/arm64/arm64/elf32_machdep.c head/sys/arm64/arm64/elf_machdep.c head/sys/compat/ia32/ia32_sysvec.c head/sys/dev/random/fenestrasX/fx_brng.c head/sys/dev/random/fenestrasX/fx_main.c head/sys/i386/i386/elf_machdep.c head/sys/kern/imgact_elf.c head/sys/kern/kern_sharedpage.c head/sys/mips/mips/elf_machdep.c head/sys/mips/mips/freebsd32_machdep.c head/sys/powerpc/powerpc/elf32_machdep.c head/sys/powerpc/powerpc/elf64_machdep.c head/sys/riscv/riscv/elf_machdep.c head/sys/sys/elf_common.h head/sys/sys/sysent.h head/sys/sys/vdso.h Modified: head/lib/libc/gen/arc4random.c ============================================================================== --- head/lib/libc/gen/arc4random.c Sat Oct 10 21:48:06 2020 (r366621) +++ head/lib/libc/gen/arc4random.c Sat Oct 10 21:52:00 2020 (r366622) @@ -27,6 +27,9 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" +#if defined(__FreeBSD__) +#include +#endif #include #include #include @@ -68,6 +71,9 @@ static struct _rs { static struct _rsx { chacha_ctx rs_chacha; /* chacha context for random keystream */ u_char rs_buf[RSBUFSZ]; /* keystream blocks */ +#ifdef __FreeBSD__ + uint32_t rs_seed_generation; /* 32-bit userspace RNG version */ +#endif } *rsx; static inline int _rs_allocate(struct _rs **, struct _rsx **); @@ -96,11 +102,43 @@ _rs_stir(void) { u_char rnd[KEYSZ + IVSZ]; +#if defined(__FreeBSD__) + bool need_init; + + /* + * De-couple allocation (which locates the vdso_fxrngp pointer in + * auxinfo) from initialization. This allows us to read the root seed + * version before we fetch system entropy, maintaining the invariant + * that the PRF was seeded with entropy from rs_seed_generation or a + * later generation. But never seeded from an earlier generation. + * This invariant prevents us from missing a root reseed event. + */ + need_init = false; + if (rs == NULL) { + if (_rs_allocate(&rs, &rsx) == -1) + abort(); + need_init = true; + } + /* + * Transition period: new userspace on old kernel. This should become + * a hard error at some point, if the scheme is adopted. + */ + if (vdso_fxrngp != NULL) + rsx->rs_seed_generation = + fxrng_load_acq_generation(&vdso_fxrngp->fx_generation32); +#endif + if (getentropy(rnd, sizeof rnd) == -1) _getentropy_fail(); +#if !defined(__FreeBSD__) if (!rs) _rs_init(rnd, sizeof(rnd)); +#else /* __FreeBSD__ */ + assert(rs != NULL); + if (need_init) + _rs_init(rnd, sizeof(rnd)); +#endif else _rs_rekey(rnd, sizeof(rnd)); explicit_bzero(rnd, sizeof(rnd)); /* discard source seed */ Modified: head/lib/libc/gen/arc4random.h ============================================================================== --- head/lib/libc/gen/arc4random.h Sat Oct 10 21:48:06 2020 (r366621) +++ head/lib/libc/gen/arc4random.h Sat Oct 10 21:52:00 2020 (r366622) @@ -24,10 +24,34 @@ /* * Stub functions for portability. */ +#include +#include #include +#include /* for sys/vdso.h only. */ +#include +#include +#include +#include #include +#include +#include +/* + * The kernel root seed version is a 64-bit counter, but we truncate it to a + * 32-bit value in userspace for the convenience of 32-bit platforms. 32-bit + * rollover is not possible with the current reseed interval (1 hour at limit) + * without dynamic addition of new random devices (which also force a reseed in + * the FXRNG design). We don't have any dynamic device mechanism at this + * time, and anyway something else is very wrong if billions of new devices are + * being added. + * + * As is, it takes roughly 456,000 years of runtime to overflow the 32-bit + * version. + */ +#define fxrng_load_acq_generation(x) atomic_load_acq_32(x) +static struct vdso_fxrng_generation_1 *vdso_fxrngp; + static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER; #define _ARC4_LOCK() \ do { \ @@ -47,6 +71,28 @@ _getentropy_fail(void) raise(SIGKILL); } +static inline void +_rs_initialize_fxrng(void) +{ + struct vdso_fxrng_generation_1 *fxrngp; + int error; + + error = _elf_aux_info(AT_FXRNG, &fxrngp, sizeof(fxrngp)); + if (error != 0) { + /* + * New userspace on an old or !RANDOM_FENESTRASX kernel; or an + * arch that does not have a VDSO page. + */ + return; + } + + /* Old userspace on newer kernel. */ + if (fxrngp->fx_vdso_version != VDSO_FXRNG_VER_1) + return; + + vdso_fxrngp = fxrngp; +} + static inline int _rs_allocate(struct _rs **rsp, struct _rsx **rsxp) { @@ -65,12 +111,33 @@ _rs_allocate(struct _rs **rsp, struct _rsx **rsxp) return (-1); } #endif + + _rs_initialize_fxrng(); + *rsp = &p->rs; *rsxp = &p->rsx; return (0); } +/* + * This isn't only detecting fork. We're also using the existing callback from + * _rs_stir_if_needed() to force arc4random(3) to reseed if the fenestrasX root + * seed version has changed. (That is, the root random(4) has reseeded from + * pooled entropy.) + */ static inline void _rs_forkdetect(void) { + /* Detect fork (minherit(2) INHERIT_ZERO). */ + if (__predict_false(rs == NULL || rsx == NULL)) + return; + /* If present, detect kernel FenestrasX seed version change. */ + if (vdso_fxrngp == NULL) + return; + if (__predict_true(rsx->rs_seed_generation == + fxrng_load_acq_generation(&vdso_fxrngp->fx_generation32))) + return; + + /* Invalidate rs_buf to force "stir" (reseed). */ + memset(rs, 0, sizeof(*rs)); } Modified: head/lib/libc/gen/auxv.c ============================================================================== --- head/lib/libc/gen/auxv.c Sat Oct 10 21:48:06 2020 (r366621) +++ head/lib/libc/gen/auxv.c Sat Oct 10 21:52:00 2020 (r366622) @@ -72,6 +72,7 @@ static int hwcap_present, hwcap2_present; static char *canary, *pagesizes, *execpath; static void *ps_strings, *timekeep; static u_long hwcap, hwcap2; +static void *fxrng_seed_version; #ifdef __powerpc__ static int powerpc_new_auxv_format = 0; @@ -139,6 +140,10 @@ init_aux(void) case AT_PS_STRINGS: ps_strings = aux->a_un.a_ptr; break; + + case AT_FXRNG: + fxrng_seed_version = aux->a_un.a_ptr; + break; #ifdef __powerpc__ /* * Since AT_STACKPROT is always set, and the common @@ -349,6 +354,16 @@ _elf_aux_info(int aux, void *buf, int buflen) if (buflen == sizeof(void *)) { if (ps_strings != NULL) { *(void **)buf = ps_strings; + res = 0; + } else + res = ENOENT; + } else + res = EINVAL; + break; + case AT_FXRNG: + if (buflen == sizeof(void *)) { + if (fxrng_seed_version != NULL) { + *(void **)buf = fxrng_seed_version; res = 0; } else res = ENOENT; Modified: head/sys/amd64/amd64/elf_machdep.c ============================================================================== --- head/sys/amd64/amd64/elf_machdep.c Sat Oct 10 21:48:06 2020 (r366621) +++ head/sys/amd64/amd64/elf_machdep.c Sat Oct 10 21:52:00 2020 (r366622) @@ -72,7 +72,7 @@ struct sysentvec elf64_freebsd_sysvec_la48 = { .sv_fixlimit = NULL, .sv_maxssiz = NULL, .sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_LP64 | SV_SHP | - SV_TIMEKEEP, + SV_TIMEKEEP | SV_RNG_SEED_VER, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, @@ -107,7 +107,7 @@ struct sysentvec elf64_freebsd_sysvec_la57 = { .sv_fixlimit = NULL, .sv_maxssiz = NULL, .sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_LP64 | SV_SHP | - SV_TIMEKEEP, + SV_TIMEKEEP | SV_RNG_SEED_VER, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, Modified: head/sys/arm/arm/elf_machdep.c ============================================================================== --- head/sys/arm/arm/elf_machdep.c Sat Oct 10 21:48:06 2020 (r366621) +++ head/sys/arm/arm/elf_machdep.c Sat Oct 10 21:52:00 2020 (r366622) @@ -86,7 +86,7 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_maxssiz = NULL, .sv_flags = #if __ARM_ARCH >= 6 - SV_ASLR | SV_SHP | SV_TIMEKEEP | + SV_ASLR | SV_SHP | SV_TIMEKEEP | SV_RNG_SEED_VER | #endif SV_ABI_FREEBSD | SV_ILP32 | SV_ASLR, .sv_set_syscall_retval = cpu_set_syscall_retval, Modified: head/sys/arm64/arm64/elf32_machdep.c ============================================================================== --- head/sys/arm64/arm64/elf32_machdep.c Sat Oct 10 21:48:06 2020 (r366621) +++ head/sys/arm64/arm64/elf32_machdep.c Sat Oct 10 21:52:00 2020 (r366622) @@ -96,7 +96,8 @@ static struct sysentvec elf32_freebsd_sysvec = { .sv_setregs = freebsd32_setregs, .sv_fixlimit = NULL, // XXX .sv_maxssiz = NULL, - .sv_flags = SV_ABI_FREEBSD | SV_ILP32 | SV_SHP | SV_TIMEKEEP, + .sv_flags = SV_ABI_FREEBSD | SV_ILP32 | SV_SHP | SV_TIMEKEEP | + SV_RNG_SEED_VER, .sv_set_syscall_retval = freebsd32_set_syscall_retval, .sv_fetch_syscall_args = freebsd32_fetch_syscall_args, .sv_syscallnames = freebsd32_syscallnames, Modified: head/sys/arm64/arm64/elf_machdep.c ============================================================================== --- head/sys/arm64/arm64/elf_machdep.c Sat Oct 10 21:48:06 2020 (r366621) +++ head/sys/arm64/arm64/elf_machdep.c Sat Oct 10 21:52:00 2020 (r366622) @@ -81,7 +81,7 @@ static struct sysentvec elf64_freebsd_sysvec = { .sv_fixlimit = NULL, .sv_maxssiz = NULL, .sv_flags = SV_SHP | SV_TIMEKEEP | SV_ABI_FREEBSD | SV_LP64 | - SV_ASLR, + SV_ASLR | SV_RNG_SEED_VER, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, Modified: head/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- head/sys/compat/ia32/ia32_sysvec.c Sat Oct 10 21:48:06 2020 (r366621) +++ head/sys/compat/ia32/ia32_sysvec.c Sat Oct 10 21:52:00 2020 (r366622) @@ -118,7 +118,7 @@ struct sysentvec ia32_freebsd_sysvec = { .sv_fixlimit = ia32_fixlimit, .sv_maxssiz = &ia32_maxssiz, .sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_IA32 | SV_ILP32 | - SV_SHP | SV_TIMEKEEP, + SV_SHP | SV_TIMEKEEP | SV_RNG_SEED_VER, .sv_set_syscall_retval = ia32_set_syscall_retval, .sv_fetch_syscall_args = ia32_fetch_syscall_args, .sv_syscallnames = freebsd32_syscallnames, Modified: head/sys/dev/random/fenestrasX/fx_brng.c ============================================================================== --- head/sys/dev/random/fenestrasX/fx_brng.c Sat Oct 10 21:48:06 2020 (r366621) +++ head/sys/dev/random/fenestrasX/fx_brng.c Sat Oct 10 21:52:00 2020 (r366622) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -108,6 +109,8 @@ fxrng_brng_src_reseed(const struct harvest_event *even */ rng->brng_generation++; atomic_store_rel_64(&fxrng_root_generation, rng->brng_generation); + /* Update VDSO version. */ + fxrng_push_seed_generation(rng->brng_generation); FXRNG_BRNG_UNLOCK(rng); } @@ -129,8 +132,25 @@ fxrng_brng_reseed(const void *entr, size_t sz) rng->brng_generation++; atomic_store_rel_64(&fxrng_root_generation, rng->brng_generation); + /* Update VDSO version. */ + fxrng_push_seed_generation(rng->brng_generation); FXRNG_BRNG_UNLOCK(rng); } + +/* + * Sysentvec and VDSO are initialized much later than SI_SUB_RANDOM. When + * they're online, go ahead and push an initial root seed version. + * INIT_SYSENTVEC runs at SI_SUB_EXEC:SI_ORDER_ANY, and SI_ORDER_ANY is the + * maximum value, so we must run at SI_SUB_EXEC+1. + */ +static void +fxrng_vdso_sysinit(void *dummy __unused) +{ + FXRNG_BRNG_LOCK(&fxrng_root); + fxrng_push_seed_generation(fxrng_root.brng_generation); + FXRNG_BRNG_UNLOCK(&fxrng_root); +} +SYSINIT(fxrng_vdso, SI_SUB_EXEC + 1, SI_ORDER_ANY, fxrng_vdso_sysinit, NULL); /* * Grab some bytes off an initialized, current generation RNG. Modified: head/sys/dev/random/fenestrasX/fx_main.c ============================================================================== --- head/sys/dev/random/fenestrasX/fx_main.c Sat Oct 10 21:48:06 2020 (r366621) +++ head/sys/dev/random/fenestrasX/fx_main.c Sat Oct 10 21:52:00 2020 (r366622) @@ -88,7 +88,8 @@ * a while). * * Not yet implemented, not in scope, or todo: - * - Userspace portions -- shared page, like timehands vdso? + * - Various initial seeding sources we don't have yet + * - In particular, VM migration/copy detection */ #include Modified: head/sys/i386/i386/elf_machdep.c ============================================================================== --- head/sys/i386/i386/elf_machdep.c Sat Oct 10 21:48:06 2020 (r366621) +++ head/sys/i386/i386/elf_machdep.c Sat Oct 10 21:52:00 2020 (r366622) @@ -74,7 +74,7 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_fixlimit = NULL, .sv_maxssiz = NULL, .sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_IA32 | SV_ILP32 | - SV_SHP | SV_TIMEKEEP, + SV_SHP | SV_TIMEKEEP | SV_RNG_SEED_VER, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Sat Oct 10 21:48:06 2020 (r366621) +++ head/sys/kern/imgact_elf.c Sat Oct 10 21:52:00 2020 (r366622) @@ -1389,6 +1389,8 @@ __elfN(freebsd_copyout_auxargs)(struct image_params *i AUXARGS_ENTRY(pos, AT_ENVC, imgp->args->envc); AUXARGS_ENTRY_PTR(pos, AT_ENVV, imgp->envv); AUXARGS_ENTRY_PTR(pos, AT_PS_STRINGS, imgp->ps_strings); + if (imgp->sysent->sv_fxrng_gen_base != 0) + AUXARGS_ENTRY(pos, AT_FXRNG, imgp->sysent->sv_fxrng_gen_base); AUXARGS_ENTRY(pos, AT_NULL, 0); free(imgp->auxargs, M_TEMP); Modified: head/sys/kern/kern_sharedpage.c ============================================================================== --- head/sys/kern/kern_sharedpage.c Sat Oct 10 21:48:06 2020 (r366621) +++ head/sys/kern/kern_sharedpage.c Sat Oct 10 21:52:00 2020 (r366622) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -60,6 +61,14 @@ static vm_object_t shared_page_obj; static int shared_page_free; char *shared_page_mapping; +#ifdef RANDOM_FENESTRASX +static struct vdso_fxrng_generation *fxrng_shpage_mapping; + +static bool fxrng_enabled = true; +SYSCTL_BOOL(_debug, OID_AUTO, fxrng_vdso_enable, CTLFLAG_RWTUN, &fxrng_enabled, + 0, "Enable FXRNG VDSO"); +#endif + void shared_page_write(int base, int size, const void *data) { @@ -256,10 +265,49 @@ alloc_sv_tk_compat32(void) } #endif +#ifdef RANDOM_FENESTRASX void +fxrng_push_seed_generation(uint64_t gen) +{ + if (fxrng_shpage_mapping == NULL || !fxrng_enabled) + return; + KASSERT(gen < INT32_MAX, + ("fxrng seed version shouldn't roll over a 32-bit counter " + "for approximately 456,000 years")); + atomic_store_rel_32(&fxrng_shpage_mapping->fx_generation32, + (uint32_t)gen); +} + +static void +alloc_sv_fxrng_generation(void) +{ + int base; + + /* + * Allocate a full cache line for the fxrng root generation (64-bit + * counter, or truncated 32-bit counter on ILP32 userspace). It is + * important that the line is not shared with frequently dirtied data, + * and the shared page allocator lacks a __read_mostly mechanism. + * However, PAGE_SIZE is typically large relative to the amount of + * stuff we've got in it so far, so maybe the possible waste isn't an + * issue. + */ + base = shared_page_alloc(CACHE_LINE_SIZE, CACHE_LINE_SIZE); + KASSERT(base != -1, ("%s: base allocation failed", __func__)); + fxrng_shpage_mapping = (void *)(shared_page_mapping + base); + *fxrng_shpage_mapping = (struct vdso_fxrng_generation) { + .fx_vdso_version = VDSO_FXRNG_VER_CURR, + }; +} +#endif /* RANDOM_FENESTRASX */ + +void exec_sysvec_init(void *param) { struct sysentvec *sv; +#ifdef RANDOM_FENESTRASX + ptrdiff_t base; +#endif sv = (struct sysentvec *)param; if ((sv->sv_flags & SV_SHP) == 0) @@ -287,6 +335,18 @@ exec_sysvec_init(void *param) } #endif } +#ifdef RANDOM_FENESTRASX + if ((sv->sv_flags & SV_RNG_SEED_VER) != 0) { + /* + * Only allocate a single VDSO entry for multiple sysentvecs, + * i.e., native and COMPAT32. + */ + if (fxrng_shpage_mapping == NULL) + alloc_sv_fxrng_generation(); + base = (char *)fxrng_shpage_mapping - shared_page_mapping; + sv->sv_fxrng_gen_base = sv->sv_shared_page_base + base; + } +#endif } void @@ -295,6 +355,8 @@ exec_sysvec_init_secondary(struct sysentvec *sv, struc MPASS((sv2->sv_flags & SV_ABI_MASK) == (sv->sv_flags & SV_ABI_MASK)); MPASS((sv2->sv_flags & SV_TIMEKEEP) == (sv->sv_flags & SV_TIMEKEEP)); MPASS((sv2->sv_flags & SV_SHP) != 0 && (sv->sv_flags & SV_SHP) != 0); + MPASS((sv2->sv_flags & SV_RNG_SEED_VER) == + (sv->sv_flags & SV_RNG_SEED_VER)); sv2->sv_shared_page_obj = sv->sv_shared_page_obj; sv2->sv_sigcode_base = sv2->sv_shared_page_base + @@ -304,5 +366,9 @@ exec_sysvec_init_secondary(struct sysentvec *sv, struc if ((sv2->sv_flags & SV_TIMEKEEP) != 0) { sv2->sv_timekeep_base = sv2->sv_shared_page_base + (sv->sv_timekeep_base - sv->sv_shared_page_base); + } + if ((sv2->sv_flags & SV_RNG_SEED_VER) != 0) { + sv2->sv_fxrng_gen_base = sv2->sv_shared_page_base + + (sv->sv_fxrng_gen_base - sv->sv_shared_page_base); } } Modified: head/sys/mips/mips/elf_machdep.c ============================================================================== --- head/sys/mips/mips/elf_machdep.c Sat Oct 10 21:48:06 2020 (r366621) +++ head/sys/mips/mips/elf_machdep.c Sat Oct 10 21:52:00 2020 (r366622) @@ -77,10 +77,11 @@ static struct sysentvec elf_freebsd_sysvec = { .sv_setregs = exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, + .sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_RNG_SEED_VER | #ifdef __mips_n64 - .sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_ASLR, + SV_LP64, #else - .sv_flags = SV_ABI_FREEBSD | SV_ILP32 | SV_ASLR, + SV_ILP32, #endif .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, Modified: head/sys/mips/mips/freebsd32_machdep.c ============================================================================== --- head/sys/mips/mips/freebsd32_machdep.c Sat Oct 10 21:48:06 2020 (r366621) +++ head/sys/mips/mips/freebsd32_machdep.c Sat Oct 10 21:52:00 2020 (r366622) @@ -97,7 +97,7 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_setregs = exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_FREEBSD | SV_ILP32, + .sv_flags = SV_ABI_FREEBSD | SV_ILP32 | SV_RNG_SEED_VER, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = freebsd32_syscallnames, Modified: head/sys/powerpc/powerpc/elf32_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf32_machdep.c Sat Oct 10 21:48:06 2020 (r366621) +++ head/sys/powerpc/powerpc/elf32_machdep.c Sat Oct 10 21:52:00 2020 (r366622) @@ -121,7 +121,7 @@ struct sysentvec elf32_freebsd_sysvec = { #endif .sv_maxssiz = NULL, .sv_flags = SV_ABI_FREEBSD | SV_ILP32 | SV_SHP | SV_ASLR | - SV_TIMEKEEP, + SV_TIMEKEEP | SV_RNG_SEED_VER, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_shared_page_base = FREEBSD32_SHAREDPAGE, Modified: head/sys/powerpc/powerpc/elf64_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf64_machdep.c Sat Oct 10 21:48:06 2020 (r366621) +++ head/sys/powerpc/powerpc/elf64_machdep.c Sat Oct 10 21:52:00 2020 (r366622) @@ -82,7 +82,7 @@ struct sysentvec elf64_freebsd_sysvec_v1 = { .sv_fixlimit = NULL, .sv_maxssiz = NULL, .sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_SHP | SV_ASLR | - SV_TIMEKEEP, + SV_TIMEKEEP | SV_RNG_SEED_VER, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, @@ -118,7 +118,7 @@ struct sysentvec elf64_freebsd_sysvec_v2 = { .sv_fixlimit = NULL, .sv_maxssiz = NULL, .sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_SHP | - SV_TIMEKEEP, + SV_TIMEKEEP | SV_RNG_SEED_VER, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, Modified: head/sys/riscv/riscv/elf_machdep.c ============================================================================== --- head/sys/riscv/riscv/elf_machdep.c Sat Oct 10 21:48:06 2020 (r366621) +++ head/sys/riscv/riscv/elf_machdep.c Sat Oct 10 21:52:00 2020 (r366622) @@ -84,7 +84,8 @@ struct sysentvec elf64_freebsd_sysvec = { .sv_setregs = exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_SHP | SV_ASLR, + .sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_SHP | SV_ASLR | + SV_RNG_SEED_VER, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Sat Oct 10 21:48:06 2020 (r366621) +++ head/sys/sys/elf_common.h Sat Oct 10 21:52:00 2020 (r366622) @@ -967,8 +967,9 @@ typedef struct { #define AT_ENVC 30 /* Environment count */ #define AT_ENVV 31 /* Environment vector */ #define AT_PS_STRINGS 32 /* struct ps_strings */ +#define AT_FXRNG 33 /* Pointer to root RNG seed version. */ -#define AT_COUNT 33 /* Count of defined aux entry types. */ +#define AT_COUNT 34 /* Count of defined aux entry types. */ /* * Relocation types. Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Sat Oct 10 21:48:06 2020 (r366621) +++ head/sys/sys/sysent.h Sat Oct 10 21:52:00 2020 (r366622) @@ -144,6 +144,7 @@ struct sysentvec { u_long *sv_hwcap; /* Value passed in AT_HWCAP. */ u_long *sv_hwcap2; /* Value passed in AT_HWCAP2. */ const char *(*sv_machine_arch)(struct proc *); + vm_offset_t sv_fxrng_gen_base; }; #define SV_ILP32 0x000100 /* 32-bit executable. */ @@ -154,6 +155,7 @@ struct sysentvec { #define SV_CAPSICUM 0x020000 /* Force cap_enter() on startup. */ #define SV_TIMEKEEP 0x040000 /* Shared page timehands. */ #define SV_ASLR 0x080000 /* ASLR allowed. */ +#define SV_RNG_SEED_VER 0x100000 /* random(4) reseed generation. */ #define SV_ABI_MASK 0xff #define SV_PROC_FLAG(p, x) ((p)->p_sysent->sv_flags & (x)) Modified: head/sys/sys/vdso.h ============================================================================== --- head/sys/sys/vdso.h Sat Oct 10 21:48:06 2020 (r366621) +++ head/sys/sys/vdso.h Sat Oct 10 21:52:00 2020 (r366622) @@ -59,6 +59,18 @@ struct vdso_timekeep { #define VDSO_TH_ALGO_3 0x3 #define VDSO_TH_ALGO_4 0x4 +struct vdso_fxrng_generation_1 { + uint32_t fx_vdso_version; /* 1 */ + uint32_t fx_generation32; + uint64_t _fx_reserved; +}; +_Static_assert(sizeof(struct vdso_fxrng_generation_1) == 16, ""); +#define vdso_fxrng_generation vdso_fxrng_generation_1 + +/* fx_vdso_version values: */ +#define VDSO_FXRNG_VER_1 0x1 +#define VDSO_FXRNG_VER_CURR VDSO_FXRNG_VER_1 + #ifndef _KERNEL struct timespec; @@ -82,6 +94,9 @@ struct vdso_sv_tk { uint32_t sv_timekeep_gen; }; +#ifdef RANDOM_FENESTRASX +void fxrng_push_seed_generation(uint64_t gen); +#endif void timekeep_push_vdso(void); uint32_t tc_fill_vdso_timehands(struct vdso_timehands *vdso_th);