svn commit: r362828 - head/sys/kern

2020-06-30 Thread Mateusz Guzik
Author: mjg
Date: Wed Jul  1 05:59:08 2020
New Revision: 362828
URL: https://svnweb.freebsd.org/changeset/base/362828

Log:
  cache: lockless forward lookup with smr
  
  This eliminates the need to take bucket locks in the common case.
  
  Concurrent lookup utilizng the same vnodes is still bottlenecked on 
referencing
  and locking path components, this will be taken care of separately.
  
  Reviewed by:  kib
  Tested by:pho
  Differential Revision:https://reviews.freebsd.org/D23913

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Wed Jul  1 05:56:29 2020(r362827)
+++ head/sys/kern/vfs_cache.c   Wed Jul  1 05:59:08 2020(r362828)
@@ -56,11 +56,13 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #ifdef KTRACE
 #include 
 #endif
@@ -104,7 +106,7 @@ SDT_PROBE_DEFINE2(vfs, namecache, shrink_negative, don
  */
 
 struct namecache {
-   LIST_ENTRY(namecache) nc_hash;  /* hash chain */
+   CK_LIST_ENTRY(namecache) nc_hash;/* hash chain */
LIST_ENTRY(namecache) nc_src;   /* source vnode list */
TAILQ_ENTRY(namecache) nc_dst;  /* destination vnode list */
struct  vnode *nc_dvp;  /* vnode of parent of name */
@@ -143,7 +145,26 @@ struct namecache_ts {
 #defineNCF_DVDROP  0x10
 #defineNCF_NEGATIVE0x20
 #defineNCF_HOTNEGATIVE 0x40
+#define NCF_INVALID0x80
 
+static bool
+cache_ncp_invalid(struct namecache *ncp)
+{
+
+   atomic_thread_fence_acq();
+   return ((ncp->nc_flag & NCF_INVALID) != 0);
+}
+
+static void
+cache_ncp_invalidate(struct namecache *ncp)
+{
+
+   atomic_thread_fence_rel();
+   KASSERT((ncp->nc_flag & NCF_INVALID) == 0,
+   ("%s: entry %p already invalid", __func__, ncp));
+   ncp->nc_flag |= NCF_INVALID;
+}
+
 /*
  * Name caching works as follows:
  *
@@ -192,12 +213,14 @@ structnamecache_ts {
  * the first node, locking everything in order and revalidating the state.
  */
 
+VFS_SMR_DECLARE;
+
 /*
  * Structures associated with name caching.
  */
 #define NCHHASH(hash) \
([(hash) & nchash])
-static __read_mostly LIST_HEAD(nchashhead, namecache) *nchashtbl;/* Hash Table 
*/
+static __read_mostly CK_LIST_HEAD(nchashhead, namecache) *nchashtbl;/* Hash 
Table */
 static u_long __read_mostlynchash; /* size of hash table */
 SYSCTL_ULONG(_debug, OID_AUTO, nchash, CTLFLAG_RD, , 0,
 "Size of namecache hash table");
@@ -275,15 +298,15 @@ cache_alloc(int len, int ts)
 
if (__predict_false(ts)) {
if (len <= CACHE_PATH_CUTOFF)
-   ncp_ts = uma_zalloc(cache_zone_small_ts, M_WAITOK);
+   ncp_ts = uma_zalloc_smr(cache_zone_small_ts, M_WAITOK);
else
-   ncp_ts = uma_zalloc(cache_zone_large_ts, M_WAITOK);
+   ncp_ts = uma_zalloc_smr(cache_zone_large_ts, M_WAITOK);
ncp = _ts->nc_nc;
} else {
if (len <= CACHE_PATH_CUTOFF)
-   ncp = uma_zalloc(cache_zone_small, M_WAITOK);
+   ncp = uma_zalloc_smr(cache_zone_small, M_WAITOK);
else
-   ncp = uma_zalloc(cache_zone_large, M_WAITOK);
+   ncp = uma_zalloc_smr(cache_zone_large, M_WAITOK);
}
return (ncp);
 }
@@ -300,14 +323,14 @@ cache_free(struct namecache *ncp)
if (__predict_false(ncp->nc_flag & NCF_TS)) {
ncp_ts = __containerof(ncp, struct namecache_ts, nc_nc);
if (ncp->nc_nlen <= CACHE_PATH_CUTOFF)
-   uma_zfree(cache_zone_small_ts, ncp_ts);
+   uma_zfree_smr(cache_zone_small_ts, ncp_ts);
else
-   uma_zfree(cache_zone_large_ts, ncp_ts);
+   uma_zfree_smr(cache_zone_large_ts, ncp_ts);
} else {
if (ncp->nc_nlen <= CACHE_PATH_CUTOFF)
-   uma_zfree(cache_zone_small, ncp);
+   uma_zfree_smr(cache_zone_small, ncp);
else
-   uma_zfree(cache_zone_large, ncp);
+   uma_zfree_smr(cache_zone_large, ncp);
}
 }
 
@@ -606,7 +629,7 @@ retry:
}
/* Scan hash tables counting entries */
for (ncpp = nchashtbl, i = 0; i < n_nchash; ncpp++, i++)
-   LIST_FOREACH(ncp, ncpp, nc_hash)
+   CK_LIST_FOREACH(ncp, ncpp, nc_hash)
cntbuf[i]++;
cache_unlock_all_buckets();
for (error = 0, i = 0; i < n_nchash; i++)
@@ -639,7 +662,7 @@ sysctl_debug_hashstat_nchash(SYSCTL_HANDLER_ARGS)
/* Scan hash tables for applicable entries */
for (ncpp = nchashtbl; n_nchash > 0; n_nchash--, ncpp++) {
 

svn commit: r362827 - in head/sys: kern sys

2020-06-30 Thread Mateusz Guzik
Author: mjg
Date: Wed Jul  1 05:56:29 2020
New Revision: 362827
URL: https://svnweb.freebsd.org/changeset/base/362827

Log:
  vfs: protect vnodes with smr
  
  vget_prep_smr and vhold_smr can be used to ref a vnode while within vfs_smr
  section, allowing consumers to get away without locking.
  
  See vhold_smr and vdropl for comments explaining caveats.
  
  Reviewed by:  kib
  Testec by:pho
  Differential Revision:https://reviews.freebsd.org/D23913

Modified:
  head/sys/kern/vfs_subr.c
  head/sys/sys/vnode.h

Modified: head/sys/kern/vfs_subr.c
==
--- head/sys/kern/vfs_subr.cWed Jul  1 04:12:41 2020(r362826)
+++ head/sys/kern/vfs_subr.cWed Jul  1 05:56:29 2020(r362827)
@@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -238,6 +239,8 @@ static uma_zone_t buf_trie_zone;
 static uma_zone_t vnode_zone;
 static uma_zone_t vnodepoll_zone;
 
+__read_frequently smr_t vfs_smr;
+
 /*
  * The workitem queue.
  *
@@ -661,7 +664,8 @@ vntblinit(void *dummy __unused)
vnode_list_reclaim_marker = vn_alloc_marker(NULL);
TAILQ_INSERT_HEAD(_list, vnode_list_reclaim_marker, v_vnodelist);
vnode_zone = uma_zcreate("VNODE", sizeof (struct vnode), NULL, NULL,
-   vnode_init, vnode_fini, UMA_ALIGN_PTR, 0);
+   vnode_init, vnode_fini, UMA_ALIGN_PTR, UMA_ZONE_SMR);
+   vfs_smr = uma_zone_get_smr(vnode_zone);
vnodepoll_zone = uma_zcreate("VNODEPOLL", sizeof (struct vpollinfo),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
/*
@@ -1603,7 +1607,7 @@ alloc:
if (vnlru_under(rnumvnodes, vlowat))
vnlru_kick();
mtx_unlock(_list_mtx);
-   return (uma_zalloc(vnode_zone, M_WAITOK));
+   return (uma_zalloc_smr(vnode_zone, M_WAITOK));
 }
 
 static struct vnode *
@@ -1619,7 +1623,7 @@ vn_alloc(struct mount *mp)
return (vn_alloc_hard(mp));
}
 
-   return (uma_zalloc(vnode_zone, M_WAITOK));
+   return (uma_zalloc_smr(vnode_zone, M_WAITOK));
 }
 
 static void
@@ -1627,7 +1631,7 @@ vn_free(struct vnode *vp)
 {
 
atomic_subtract_long(, 1);
-   uma_zfree(vnode_zone, vp);
+   uma_zfree_smr(vnode_zone, vp);
 }
 
 /*
@@ -1758,7 +1762,7 @@ freevnode(struct vnode *vp)
CTR2(KTR_VFS, "%s: destroying the vnode %p", __func__, vp);
bo = >v_bufobj;
VNASSERT(vp->v_data == NULL, vp, ("cleaned vnode isn't"));
-   VNASSERT(vp->v_holdcnt == 0, vp, ("Non-zero hold count"));
+   VNPASS(vp->v_holdcnt == VHOLD_NO_SMR, vp);
VNASSERT(vp->v_usecount == 0, vp, ("Non-zero use count"));
VNASSERT(vp->v_writecount == 0, vp, ("Non-zero write count"));
VNASSERT(bo->bo_numoutput == 0, vp, ("Clean vnode has pending I/O's"));
@@ -2848,8 +2852,30 @@ v_decr_devcount(struct vnode *vp)
  *
  * holdcnt can be manipulated using atomics without holding any locks,
  * except when transitioning 1<->0, in which case the interlock is held.
+ *
+ * Consumers which don't guarantee liveness of the vnode can use SMR to
+ * try to get a reference. Note this operation can fail since the vnode
+ * may be awaiting getting freed by the time they get to it.
  */
 enum vgetstate
+vget_prep_smr(struct vnode *vp)
+{
+   enum vgetstate vs;
+
+   VFS_SMR_ASSERT_ENTERED();
+
+   if (refcount_acquire_if_not_zero(>v_usecount)) {
+   vs = VGET_USECOUNT;
+   } else {
+   if (vhold_smr(vp))
+   vs = VGET_HOLDCNT;
+   else
+   vs = VGET_NONE;
+   }
+   return (vs);
+}
+
+enum vgetstate
 vget_prep(struct vnode *vp)
 {
enum vgetstate vs;
@@ -2919,6 +2945,7 @@ vget_finish(struct vnode *vp, int flags, enum vgetstat
ASSERT_VI_LOCKED(vp, __func__);
else
ASSERT_VI_UNLOCKED(vp, __func__);
+   VNPASS(vs == VGET_HOLDCNT || vs == VGET_USECOUNT, vp);
VNPASS(vp->v_holdcnt > 0, vp);
VNPASS(vs == VGET_HOLDCNT || vp->v_usecount > 0, vp);
 
@@ -3380,7 +3407,8 @@ vhold(struct vnode *vp)
 
CTR2(KTR_VFS, "%s: vp %p", __func__, vp);
old = atomic_fetchadd_int(>v_holdcnt, 1);
-   VNASSERT(old >= 0, vp, ("%s: wrong hold count %d", __func__, old));
+   VNASSERT(old >= 0 && (old & VHOLD_ALL_FLAGS) == 0, vp,
+   ("%s: wrong hold count %d", __func__, old));
if (old != 0)
return;
critical_enter();
@@ -3405,12 +3433,40 @@ vholdnz(struct vnode *vp)
CTR2(KTR_VFS, "%s: vp %p", __func__, vp);
 #ifdef INVARIANTS
int old = atomic_fetchadd_int(>v_holdcnt, 1);
-   VNASSERT(old > 0, vp, ("%s: wrong hold count %d", __func__, old));
+   VNASSERT(old > 0 && (old & VHOLD_ALL_FLAGS) == 0, vp,
+   ("%s: wrong hold count %d", __func__, old));
 #else
atomic_add_int(>v_holdcnt, 1);
 #endif
 }
 
+/*
+ * Grab a 

svn commit: r362825 - head/sys/netgraph/bluetooth/socket

2020-06-30 Thread Takanori Watanabe
Author: takawata
Date: Wed Jul  1 04:00:54 2020
New Revision: 362825
URL: https://svnweb.freebsd.org/changeset/base/362825

Log:
  Allow some Bluetooth LE related HCI request to non-root user.
  
  PR:   247588
  Reported by:  Greg V (greg@unrelenting.technology)
  Reviewed by:  emax
  Differential Revision:https://reviews.freebsd.org/D25516

Modified:
  head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c

Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c
==
--- head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.cWed Jul  1 
02:32:41 2020(r362824)
+++ head/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.cWed Jul  1 
04:00:54 2020(r362825)
@@ -861,6 +861,7 @@ ng_btsocket_hci_raw_init(void)
bit_set(f, NG_HCI_OCF_READ_IAC_LAP - 1);
bit_set(f, NG_HCI_OCF_READ_PAGE_SCAN_PERIOD - 1);
bit_set(f, NG_HCI_OCF_READ_PAGE_SCAN - 1);
+   bit_set(f, NG_HCI_OCF_READ_LE_HOST_SUPPORTED -1);
 
/* Commands - Informational */
f = ng_btsocket_hci_raw_sec_filter->commands[NG_HCI_OGF_INFO - 1];
@@ -881,6 +882,11 @@ ng_btsocket_hci_raw_init(void)
bit_set(f, NG_HCI_OCF_READ_LOOPBACK_MODE - 1);
/*Commands - LE*/
f = ng_btsocket_hci_raw_sec_filter->commands[NG_HCI_OGF_LE -1];
+   bit_set(f, NG_HCI_OCF_LE_SET_SCAN_ENABLE - 1);
+   bit_set(f, NG_HCI_OCF_LE_SET_SCAN_PARAMETERS - 1);
+   bit_set(f, NG_HCI_OCF_LE_READ_LOCAL_SUPPORTED_FEATURES - 1);
+   bit_set(f, NG_HCI_OCF_LE_READ_BUFFER_SIZE - 1);
+   bit_set(f, NG_HCI_OCF_LE_READ_WHITE_LIST_SIZE - 1);
 
 } /* ng_btsocket_hci_raw_init */
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r358181 - head/usr.sbin/pstat

2020-06-30 Thread csjp
Piotr,

Thanks for the heads up. I will fix this shortly.

On Mon, Jun 22, 2020 at 11:53:15PM +0200, Piotr P. Stefaniak wrote:
> On 2020-02-20 21:12:10, Christian S.J. Peron wrote:
> >Author: csjp
> >Date: Thu Feb 20 21:12:10 2020
> >New Revision: 358181
> >URL: https://svnweb.freebsd.org/changeset/base/358181
> >
> >Log:
> > - Implement -h (human readable) for the size of the underlying block disk.
> >   Currently, the size of the swap device is unconditionally reported using
> >   blocks, even if -h has been used.
> > - While here, switch to CONVERT_BLOCKS() instead of CONVERT() which will
> >   avoid overflowing size counters (in human readable form see: r196244)
> > - Update the column headers to reflect that a size is being reported instead
> >   of the block size units being used
> >
> > Before:
> >
> > $ swapinfo
> > Device  1K-blocks UsedAvail Capacity
> > /dev/gpt/swapfs   10485760  1048576 0%
> 
> In the above, the "1K-blocks" and "1048576" line up because both the
> header and the value have field width of hlen which is always set by
> getbsize(, ). In other words, the header name sets the
> width for the column. It is especially apparent when you compare output
> with BLOCKSIZE=10 and BLOCKSIZE=1K.
> 
> > After:
> >
> > $ swapinfo -h
> > Device   Size UsedAvail Capacity
> > /dev/gpt/swapfs1.0G   0B 1.0G 0%
> 
> Here the width for the header is sizeof "Size" and the width for values
> of the size is 8, so the header and the values don't make up a column.
> 
> Since field width for all values of Size, Used, and Avail are hardcoded
> to 8 as well as the column headers, I think the best suggestion I can
> give is to change it like this:
> 
> @@ -475,7 +475,7 @@ print_swap_header(void)
> if (humanflag) {
> header = SIZEHDR;
> -   hlen = sizeof(SIZEHDR);
> +   hlen = 8; /* as the hardcoded field width of values */
> } else {
> header = getbsize(, );
> }
> 
> Although 8 seems to me a bit high. And too bad that humanize_number() is
> locale-agnostic.
> 
> > Differential Revision:  https://reviews.freebsd.org/D23758
> > Reviewed by:kevans
> > MFC after:  3 weeks
> >
> >Modified:
> > head/usr.sbin/pstat/pstat.c
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362824 - in head: lib/libifconfig sbin/ifconfig sys/net

2020-06-30 Thread Ryan Moeller
Author: freqlabs
Date: Wed Jul  1 02:32:41 2020
New Revision: 362824
URL: https://svnweb.freebsd.org/changeset/base/362824

Log:
  libifconfig: Add function to get bridge status
  
  The new function operates similarly to ifconfig_lagg_get_lagg_status and
  likewise is accompanied by a function to free the bridge status data 
structure.
  
  I have included in this patch the relocation of some strings describing STP
  parameters and the PV2ID macro from ifconfig into net/if_bridgevar.h as they
  are useful for consumers of libifconfig.
  
  Reviewed by:  kp, melifaro, mmacy
  Approved by:  mmacy (mentor)
  MFC after:1 week
  Relnotes: yes
  Differential Revision:https://reviews.freebsd.org/D25460

Added:
  head/lib/libifconfig/libifconfig_bridge.c   (contents, props changed)
Modified:
  head/lib/libifconfig/Makefile
  head/lib/libifconfig/libifconfig.h
  head/sbin/ifconfig/ifbridge.c
  head/sys/net/if_bridgevar.h

Modified: head/lib/libifconfig/Makefile
==
--- head/lib/libifconfig/Makefile   Wed Jul  1 02:16:36 2020
(r362823)
+++ head/lib/libifconfig/Makefile   Wed Jul  1 02:32:41 2020
(r362824)
@@ -6,9 +6,14 @@ INTERNALLIB=   true
 
 SHLIBDIR?= /lib
 SHLIB_MAJOR=   1
-SRCS=  libifconfig.c libifconfig_carp.c libifconfig_inet.c
-SRCS+= libifconfig_inet6.c libifconfig_internal.c libifconfig_lagg.c
-SRCS+= libifconfig_media.c
+SRCS=  libifconfig.c \
+   libifconfig_bridge.c \
+   libifconfig_carp.c \
+   libifconfig_inet.c \
+   libifconfig_inet6.c \
+   libifconfig_internal.c \
+   libifconfig_lagg.c \
+   libifconfig_media.c
 
 # If libifconfig become public uncomment those two lines
 #INCSDIR=  ${INCLUDEDIR}

Modified: head/lib/libifconfig/libifconfig.h
==
--- head/lib/libifconfig/libifconfig.h  Wed Jul  1 02:16:36 2020
(r362823)
+++ head/lib/libifconfig/libifconfig.h  Wed Jul  1 02:32:41 2020
(r362824)
@@ -49,12 +49,23 @@ typedef struct ifconfig_handle ifconfig_handle_t;
 
 struct carpreq;
 struct ifaddrs;
+struct ifbropreq;
+struct ifbreq;
 struct in6_ndireq;
 struct lagg_reqall;
 struct lagg_reqflags;
 struct lagg_reqopts;
 struct lagg_reqport;
 
+/** Stores extra info associated with a bridge(4) interface */
+struct ifconfig_bridge_status {
+   struct ifbropreq *params;   /**< current operational parameters */
+   struct ifbreq *members; /**< list of bridge members */
+   size_t members_count;   /**< how many member interfaces */
+   uint32_t cache_size;/**< size of address cache */
+   uint32_t cache_lifetime;/**< address cache entry lifetime */
+};
+
 struct ifconfig_capabilities {
/** Current capabilities (ifconfig prints this as 'options')*/
int curcap;
@@ -217,6 +228,16 @@ int ifconfig_inet_get_addrinfo(ifconfig_handle_t *h,
 int ifconfig_inet6_get_addrinfo(ifconfig_handle_t *h,
 const char *name, struct ifaddrs *ifa, struct ifconfig_inet6_addr *addr);
 
+/** Retrieve additional information about a bridge(4) interface */
+int ifconfig_bridge_get_bridge_status(ifconfig_handle_t *h,
+const char *name, struct ifconfig_bridge_status **bridge);
+
+/** Frees the structure returned by ifconfig_bridge_get_bridge_status.  Does
+ * nothing if the argument is NULL
+ * @param bridge   Pointer to the structure to free
+ */
+void ifconfig_bridge_free_bridge_status(struct ifconfig_bridge_status *bridge);
+
 /** Retrieve additional information about a lagg(4) interface */
 int ifconfig_lagg_get_lagg_status(ifconfig_handle_t *h,
 const char *name, struct ifconfig_lagg_status **lagg_status);
@@ -225,8 +246,8 @@ int ifconfig_lagg_get_lagg_status(ifconfig_handle_t *h
 int ifconfig_lagg_get_laggport_status(ifconfig_handle_t *h,
 const char *name, struct lagg_reqport *rp);
 
-/** Frees the structure returned by ifconfig_lagg_get_status.  Does nothing if
- * the argument is NULL
+/** Frees the structure returned by ifconfig_lagg_get_lagg_status.  Does
+ * nothing if the argument is NULL
  * @param laggstat Pointer to the structure to free
  */
 void ifconfig_lagg_free_lagg_status(struct ifconfig_lagg_status *laggstat);

Added: head/lib/libifconfig/libifconfig_bridge.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libifconfig/libifconfig_bridge.c   Wed Jul  1 02:32:41 2020
(r362824)
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2020, Ryan Moeller 
+ *
+ * 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
+ *

svn commit: r362823 - in head/sys: amd64/conf conf geom/part i386/conf

2020-06-30 Thread Conrad Meyer
Author: cem
Date: Wed Jul  1 02:16:36 2020
New Revision: 362823
URL: https://svnweb.freebsd.org/changeset/base/362823

Log:
  geom(4): Kill GEOM_PART_EBR_COMPAT option
  
  Take advantage of Warner's nice new real GEOM aliasing system and use it for
  aliased partition names that actually work.
  
  Our canonical EBR partition name is the weird, not-default-on-x86-prior-to-
  this-revision "da1p4+1234."  However, if compatibility mode (tunable
  kern.geom.part.ebr.compat_aliases) is enabled (1, default), we continue to
  provide the alias names like "da1p5" in addition to the weird canonical
  names.
  
  Naming partition providers was just one aspect of the COMPAT knob; in
  addition it limited mutability, in part because it did not preserve existing
  EBR header content aside from that of LBA 0.  This change saves the EBR
  header for LBA 0, as well as for every EBR partition encountered.  That way,
  when we write out the EBR partition table on modification, we can restore
  any bootloader or other metadata in both LBA0 (the first data-containing EBR
  may start after 0) as well as every logical EBR we read from the disk, and
  only update the geometry metadata and linked list pointers that describe the
  actual partitioning.
  
  (This change does not add support for the 'bootcode' verb to EBR.)
  
  PR:   232463
  Reported by:  Manish Jain 
  Discussed with:   ae (no objection)
  Relnotes: maybe
  Differential Revision:https://reviews.freebsd.org/D24939

Modified:
  head/sys/amd64/conf/DEFAULTS
  head/sys/conf/NOTES
  head/sys/conf/options
  head/sys/geom/part/g_part_ebr.c
  head/sys/i386/conf/DEFAULTS

Modified: head/sys/amd64/conf/DEFAULTS
==
--- head/sys/amd64/conf/DEFAULTSWed Jul  1 02:13:16 2020
(r362822)
+++ head/sys/amd64/conf/DEFAULTSWed Jul  1 02:16:36 2020
(r362823)
@@ -18,7 +18,6 @@ deviceuart_ns8250
 # Default partitioning schemes
 optionsGEOM_PART_BSD
 optionsGEOM_PART_EBR
-optionsGEOM_PART_EBR_COMPAT
 optionsGEOM_PART_MBR
 optionsGEOM_PART_GPT
 

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Wed Jul  1 02:13:16 2020(r362822)
+++ head/sys/conf/NOTES Wed Jul  1 02:16:36 2020(r362823)
@@ -171,7 +171,6 @@ options GEOM_PART_APM   # Apple partitioning
 optionsGEOM_PART_BSD   # BSD disklabel
 optionsGEOM_PART_BSD64 # BSD disklabel64
 optionsGEOM_PART_EBR   # Extended Boot Records
-optionsGEOM_PART_EBR_COMPAT# Backward compatible partition names
 optionsGEOM_PART_GPT   # GPT partitioning
 optionsGEOM_PART_LDM   # Logical Disk Manager
 optionsGEOM_PART_MBR   # MBR partitioning

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Wed Jul  1 02:13:16 2020(r362822)
+++ head/sys/conf/options   Wed Jul  1 02:16:36 2020(r362823)
@@ -125,7 +125,6 @@ GEOM_PART_APM   opt_geom.h
 GEOM_PART_BSD  opt_geom.h
 GEOM_PART_BSD64opt_geom.h
 GEOM_PART_EBR  opt_geom.h
-GEOM_PART_EBR_COMPAT   opt_geom.h
 GEOM_PART_GPT  opt_geom.h
 GEOM_PART_LDM  opt_geom.h
 GEOM_PART_MBR  opt_geom.h

Modified: head/sys/geom/part/g_part_ebr.c
==
--- head/sys/geom/part/g_part_ebr.c Wed Jul  1 02:13:16 2020
(r362822)
+++ head/sys/geom/part/g_part_ebr.c Wed Jul  1 02:16:36 2020
(r362823)
@@ -52,40 +52,48 @@ __FBSDID("$FreeBSD$");
 
 FEATURE(geom_part_ebr,
 "GEOM partitioning class for extended boot records support");
-#if defined(GEOM_PART_EBR_COMPAT)
 FEATURE(geom_part_ebr_compat,
 "GEOM EBR partitioning class: backward-compatible partition names");
-#endif
 
+SYSCTL_DECL(_kern_geom_part);
+static SYSCTL_NODE(_kern_geom_part, OID_AUTO, ebr, CTLFLAG_RW | CTLFLAG_MPSAFE,
+0, "GEOM_PART_EBR Extended Boot Record");
+
+static bool compat_aliases = true;
+SYSCTL_BOOL(_kern_geom_part_ebr, OID_AUTO, compat_aliases,
+CTLFLAG_RDTUN, _aliases, 0,
+"Set non-zero to enable EBR compatibility alias names (e.g., ada0p5)");
+
+#defineEBRNAMFMT   "+%08u"
 #defineEBRSIZE 512
 
 struct g_part_ebr_table {
struct g_part_table base;
-#ifndef GEOM_PART_EBR_COMPAT
-   u_char  ebr[EBRSIZE];
-#endif
+   u_char  lba0_ebr[EBRSIZE];
 };
 
 struct g_part_ebr_entry {
struct g_part_entry base;
struct dos_partitionent;
+   u_char  ebr[EBRSIZE];
+   u_int   ebr_compat_idx;
 };
 
 static int g_part_ebr_add(struct g_part_table *, struct g_part_entry *,
 struct g_part_parms *);
+static void 

svn commit: r362818 - in head/secure/lib: libcrypto libssl

2020-06-30 Thread Conrad Meyer
Author: cem
Date: Wed Jul  1 00:59:28 2020
New Revision: 362818
URL: https://svnweb.freebsd.org/changeset/base/362818

Log:
  Replace OPENSSL_NO_SSL3_METHODs with dummies
  
  SSLv3 has been deprecated since 2015 (and broken since 2014: "POODLE"); it
  should not have shipped in FreeBSD 11 (2016) or 12 (2018).  No one should use
  it, and if they must, they can use some implementation outside of base.
  
  There are three symbols removed with OPENSSL_NO_SSL3_METHOD:
  
  SSLv3_client_method
  SSLv3_method
  SSLv3_server_method
  
  These symbols exist to request an explicit SSLv3 connection to a server.
  There is no good reason for an application to link or invoke these symbols
  instead of TLS_method(), et al (née SSLv23_method, et al).  Applications
  that do so have broken cryptography.
  
  Define these symbols for some pedantic definition of ABI stability, but
  remove the functionality again (r361392) after r362620.
  
  Reviewed by:  gordon, jhb (earlier-but-equivalent version both)
  Discussed with:   bjk, kib
  Differential Revision:https://reviews.freebsd.org/D25493

Added:
  head/secure/lib/libssl/dummy_abi.c   (contents, props changed)
Modified:
  head/secure/lib/libcrypto/opensslconf.h.in
  head/secure/lib/libssl/Makefile

Modified: head/secure/lib/libcrypto/opensslconf.h.in
==
--- head/secure/lib/libcrypto/opensslconf.h.in  Wed Jul  1 00:33:16 2020
(r362817)
+++ head/secure/lib/libcrypto/opensslconf.h.in  Wed Jul  1 00:59:28 2020
(r362818)
@@ -79,6 +79,9 @@ extern "C" {
 #ifndef OPENSSL_NO_SSL3
 # define OPENSSL_NO_SSL3
 #endif
+#ifndef OPENSSL_NO_SSL3_METHOD
+# define OPENSSL_NO_SSL3_METHOD
+#endif
 #ifndef OPENSSL_NO_UBSAN
 # define OPENSSL_NO_UBSAN
 #endif

Modified: head/secure/lib/libssl/Makefile
==
--- head/secure/lib/libssl/Makefile Wed Jul  1 00:33:16 2020
(r362817)
+++ head/secure/lib/libssl/Makefile Wed Jul  1 00:59:28 2020
(r362818)
@@ -22,6 +22,8 @@ SRCS+=ssl3_record.c ssl3_record_tls13.c
 SRCS+= extensions.c extensions_clnt.c extensions_cust.c extensions_srvr.c
 SRCS+= statem.c statem_clnt.c statem_dtls.c statem_lib.c statem_srvr.c
 
+SRCS+= dummy_abi.c
+
 LIBADD=crypto
 
 CFLAGS+=   -I${LCRYPTO_SRC}/ssl

Added: head/secure/lib/libssl/dummy_abi.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/secure/lib/libssl/dummy_abi.c  Wed Jul  1 00:59:28 2020
(r362818)
@@ -0,0 +1,46 @@
+/* This file is in the public domain. */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+
+#include 
+
+static inline void
+__SSLv3_dummy_method_impl(void)
+{
+   static const char warning[] = "SSLv3 use is deprecated.\n";
+   static bool once = false;
+
+   if (once)
+   return;
+
+   once = true;
+   write(STDERR_FILENO, warning, sizeof(warning) - 1);
+}
+
+const SSL_METHOD *
+__SSLv3_method_fbsd12(void)
+{
+   __SSLv3_dummy_method_impl();
+   return (NULL);
+}
+__sym_compat(SSLv3_method, __SSLv3_method_fbsd12, OPENSSL_1_1_0);
+
+const SSL_METHOD *
+__SSLv3_client_method_fbsd12(void)
+{
+   __SSLv3_dummy_method_impl();
+   return (NULL);
+}
+__sym_compat(SSLv3_client_method, __SSLv3_client_method_fbsd12, OPENSSL_1_1_0);
+
+const SSL_METHOD *
+__SSLv3_server_method_fbsd12(void)
+{
+   __SSLv3_dummy_method_impl();
+   return (NULL);
+}
+__sym_compat(SSLv3_server_method, __SSLv3_server_method_fbsd12, OPENSSL_1_1_0);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362817 - in head/sys: arm/freescale/imx arm64/conf arm64/freescale arm64/freescale/imx arm64/freescale/imx/clk conf dev/ffec dev/uart modules/dtb/imx8

2020-06-30 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Wed Jul  1 00:33:16 2020
New Revision: 362817
URL: https://svnweb.freebsd.org/changeset/base/362817

Log:
  Add i.MX 8M Quad support
  
  - Add CCM driver and clocks implementations for i.MX 8M
  - Add GPC driver for iMX8
  - Add clock tree for i.MX 8M Quad
  - Add clocks support and new compat strings (where required) for existing 
i.MX 6 UART, I2C, and GPIO drivers
  - Enable aarch64-compatible drivers form i.MX 6 in arm64 GENERIC kernel config
  - Add dtb/imx8 kernel module with DTBs for Nitrogen8M and iMX8MQ EVK
  
  With this patch both Nitrogen8M and iMX8MQ EVK boot with NFS root up to 
multiuser login prompt
  
  Reviewed by:  manu
  Differential Revision:https://reviews.freebsd.org/D25274

Added:
  head/sys/arm64/freescale/
  head/sys/arm64/freescale/imx/
  head/sys/arm64/freescale/imx/clk/
  head/sys/arm64/freescale/imx/clk/imx_clk_composite.c   (contents, props 
changed)
  head/sys/arm64/freescale/imx/clk/imx_clk_composite.h   (contents, props 
changed)
  head/sys/arm64/freescale/imx/clk/imx_clk_frac_pll.c   (contents, props 
changed)
  head/sys/arm64/freescale/imx/clk/imx_clk_frac_pll.h   (contents, props 
changed)
  head/sys/arm64/freescale/imx/clk/imx_clk_gate.c   (contents, props changed)
  head/sys/arm64/freescale/imx/clk/imx_clk_gate.h   (contents, props changed)
  head/sys/arm64/freescale/imx/clk/imx_clk_mux.c   (contents, props changed)
  head/sys/arm64/freescale/imx/clk/imx_clk_mux.h   (contents, props changed)
  head/sys/arm64/freescale/imx/clk/imx_clk_sscg_pll.c   (contents, props 
changed)
  head/sys/arm64/freescale/imx/clk/imx_clk_sscg_pll.h   (contents, props 
changed)
  head/sys/arm64/freescale/imx/imx7gpc.c   (contents, props changed)
  head/sys/arm64/freescale/imx/imx8mq_ccm.c   (contents, props changed)
  head/sys/arm64/freescale/imx/imx8mq_ccm.h   (contents, props changed)
  head/sys/arm64/freescale/imx/imx_ccm_clk.h   (contents, props changed)
  head/sys/modules/dtb/imx8/
  head/sys/modules/dtb/imx8/Makefile   (contents, props changed)
Modified:
  head/sys/arm/freescale/imx/imx_gpio.c
  head/sys/arm/freescale/imx/imx_i2c.c
  head/sys/arm/freescale/imx/imx_iomux.c
  head/sys/arm64/conf/GENERIC
  head/sys/conf/files
  head/sys/conf/files.arm64
  head/sys/conf/options.arm64
  head/sys/dev/ffec/if_ffec.c
  head/sys/dev/uart/uart_dev_imx.c

Modified: head/sys/arm/freescale/imx/imx_gpio.c
==
--- head/sys/arm/freescale/imx/imx_gpio.c   Wed Jul  1 00:24:55 2020
(r362816)
+++ head/sys/arm/freescale/imx/imx_gpio.c   Wed Jul  1 00:33:16 2020
(r362817)
@@ -57,6 +57,14 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#if defined(EXT_RESOURCES) && defined(__aarch64__)
+#defineIMX_ENABLE_CLOCKS
+#endif
+
+#ifdef IMX_ENABLE_CLOCKS
+#include 
+#endif
+
 #include "gpio_if.h"
 
 #ifdef INTRNG
@@ -119,13 +127,17 @@ struct imx51_gpio_softc {
 #ifdef INTRNG
struct gpio_irqsrc  gpio_pic_irqsrc[NGPIO];
 #endif
+#ifdef IMX_ENABLE_CLOCKS
+   clk_t   clk;
+#endif
 };
 
 static struct ofw_compat_data compat_data[] = {
-   {"fsl,imx6q-gpio",  1},
-   {"fsl,imx53-gpio",  1},
-   {"fsl,imx51-gpio",  1},
-   {NULL,  0}
+   {"fsl,imx8mq-gpio", 1},
+   {"fsl,imx6q-gpio",  1},
+   {"fsl,imx53-gpio",  1},
+   {"fsl,imx51-gpio",  1},
+   {NULL,  0}
 };
 
 static struct resource_spec imx_gpio_spec[] = {
@@ -788,6 +800,9 @@ imx51_gpio_attach(device_t dev)
 {
struct imx51_gpio_softc *sc;
int i, irq, unit;
+#ifdef IMX_ENABLE_CLOCKS
+   int err;
+#endif
 
sc = device_get_softc(dev);
sc->dev = dev;
@@ -795,6 +810,19 @@ imx51_gpio_attach(device_t dev)
 
mtx_init(>sc_mtx, device_get_nameunit(sc->dev), NULL, MTX_SPIN);
 
+#ifdef IMX_ENABLE_CLOCKS
+   if (clk_get_by_ofw_index(sc->dev, 0, 0, >clk) != 0) {
+   device_printf(dev, "could not get clock");
+   return (ENOENT);
+   }
+
+   err = clk_enable(sc->clk);
+   if (err != 0) {
+   device_printf(sc->dev, "could not enable ipg clock\n");
+   return (err);
+   }
+#endif
+
if (bus_alloc_resources(dev, imx_gpio_spec, sc->sc_res)) {
device_printf(dev, "could not allocate resources\n");
bus_release_resources(dev, imx_gpio_spec, sc->sc_res);
@@ -850,8 +878,19 @@ imx51_gpio_detach(device_t dev)
 {
int irq;
struct imx51_gpio_softc *sc;
+#ifdef IMX_ENABLE_CLOCKS
+   int error;
+#endif
 
sc = device_get_softc(dev);
+
+#ifdef IMX_ENABLE_CLOCKS
+   error = clk_disable(sc->clk);
+   if (error != 0) {
+   device_printf(sc->dev, "could not disable ipg clock\n");
+   return (error);
+   }
+#endif
 
gpiobus_detach_bus(dev);
for (irq = 0; irq < NUM_IRQRES; irq++) {

Modified: head/sys/arm/freescale/imx/imx_i2c.c

svn commit: r362816 - head/sys/net80211

2020-06-30 Thread Adrian Chadd
Author: adrian
Date: Wed Jul  1 00:24:55 2020
New Revision: 362816
URL: https://svnweb.freebsd.org/changeset/base/362816

Log:
  [net80211] Commit files missing in the previous commit
  
  These belong to my previous commit, but apparently I typed ieee80211_vhf.[ch]
  and forgot ht.h.  Le oops.

Modified:
  head/sys/net80211/ieee80211_ht.h
  head/sys/net80211/ieee80211_vht.c
  head/sys/net80211/ieee80211_vht.h

Modified: head/sys/net80211/ieee80211_ht.h
==
--- head/sys/net80211/ieee80211_ht.hWed Jul  1 00:23:49 2020
(r362815)
+++ head/sys/net80211/ieee80211_ht.hWed Jul  1 00:24:55 2020
(r362816)
@@ -210,8 +210,8 @@ struct ieee80211_channel *ieee80211_ht_adjust_channel(
 void   ieee80211_ht_wds_init(struct ieee80211_node *);
 void   ieee80211_ht_node_join(struct ieee80211_node *);
 void   ieee80211_ht_node_leave(struct ieee80211_node *);
-void   ieee80211_htprot_update(struct ieee80211com *, int protmode);
-void   ieee80211_ht_timeout(struct ieee80211com *);
+void   ieee80211_htprot_update(struct ieee80211vap *, int protmode);
+void   ieee80211_ht_timeout(struct ieee80211vap *);
 void   ieee80211_parse_htcap(struct ieee80211_node *, const uint8_t *);
 void   ieee80211_parse_htinfo(struct ieee80211_node *, const uint8_t *);
 void   ieee80211_ht_updateparams(struct ieee80211_node *, const uint8_t *,
@@ -241,5 +241,6 @@ voidieee80211_ampdu_rx_stop_ext(struct 
ieee80211_node
 intieee80211_ampdu_tx_request_ext(struct ieee80211_node *ni, int tid);
 intieee80211_ampdu_tx_request_active_ext(struct ieee80211_node *ni,
int tid, int status);
+void   ieee80211_htinfo_notify(struct ieee80211vap *vap);
 
 #endif /* _NET80211_IEEE80211_HT_H_ */

Modified: head/sys/net80211/ieee80211_vht.c
==
--- head/sys/net80211/ieee80211_vht.c   Wed Jul  1 00:23:49 2020
(r362815)
+++ head/sys/net80211/ieee80211_vht.c   Wed Jul  1 00:24:55 2020
(r362816)
@@ -312,7 +312,7 @@ ieee80211_setup_vht_rates(struct ieee80211_node *ni,
 }
 
 void
-ieee80211_vht_timeout(struct ieee80211com *ic)
+ieee80211_vht_timeout(struct ieee80211vap *vap)
 {
 }
 

Modified: head/sys/net80211/ieee80211_vht.h
==
--- head/sys/net80211/ieee80211_vht.h   Wed Jul  1 00:23:49 2020
(r362815)
+++ head/sys/net80211/ieee80211_vht.h   Wed Jul  1 00:24:55 2020
(r362816)
@@ -45,7 +45,7 @@ int   ieee80211_vht_updateparams(struct ieee80211_node *
 void   ieee80211_setup_vht_rates(struct ieee80211_node *,
const uint8_t *, const uint8_t *);
 
-void   ieee80211_vht_timeout(struct ieee80211com *ic);
+void   ieee80211_vht_timeout(struct ieee80211vap *vap);
 
 void   ieee80211_vht_node_join(struct ieee80211_node *ni);
 void   ieee80211_vht_node_leave(struct ieee80211_node *ni);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362815 - head/sys/net80211

2020-06-30 Thread Adrian Chadd
Author: adrian
Date: Wed Jul  1 00:23:49 2020
New Revision: 362815
URL: https://svnweb.freebsd.org/changeset/base/362815

Log:
  [net80211] Migrate HT/legacy protection mode and preamble calculation to 
per-VAP flags
  
  The later firmware devices (including iwn!) support multiple configuration
  contexts for a lot of things, leaving it up to the firmware to decide
  which channel and vap is active.  This allows for things like off-channel
  p2p sta/ap operation and other weird things.
  
  However, net80211 is still focused on a "net80211 drives all" when it comes 
to driving
  the NIC, and as part of this history a lot of these options are global and 
not per-VAP.
  This is fine when net80211 drives things and all VAPs share a single channel 
- these
  parameters importantly really reflect the state of the channel! - but it will 
increasingly
  be not fine when we start supporting more weird configurations and more 
recent NICs.
  Yeah, recent like iwn/iwm.
  
  Anyway - so, migrate all of the HT protection, legacy protection and preamble
  stuff to be per-VAP.  The global flags are still there; they're now calculated
  in a deferred taskqueue that mirrors the old behaviour.  Firmware based 
drivers
  which have per-VAP configuration of these parameters can now just listen to 
the
  per-VAP options.
  
  What do I mean by per-channel? Well, the above configuration parameters really
  are about interoperation with other devices on the same channel. Eg, HT 
protection
  mode will flip to legacy/mixed if it hears ANY BSS that supports non-HT 
stations or
  indicates it has non-HT stations associated.  So, these flags really should be
  per-channel rather than per-VAP, and then for things like "do i need short 
preamble
  or long preamble?" turn into a "do I need it for this current operating 
channel".
  Then any VAP using it can query the channel that it's on, reflecting the real
  required state.
  
  This patch does none of the above paragraph just yet.
  
  I'm also cheating a bit - I'm currently not using separate taskqueues for
  the beacon updates and the per-VAP configuration updates.  I can always 
further
  split it later if I need to but I didn't think it was SUPER important here.
  
  So:
  
  * Create vap taskqueue entries for ERP/protection, HT protection and 
short/long
preamble;
  * Migrate the HT station count, short/long slot station count, etc - into 
per-VAP
variables rather than global;
  * Fix a bug with my WME work from a while ago which made it per-VAP - do the 
WME
beacon update /after/ the WME update taskqueue runs, not before;
  * Any time the HT protmode configuration changes or the ERP protection mode
config changes - schedule the task, which will call the driver without the
net80211 lock held and all correctly serialised;
  * Use the global flags for beacon IEs and VAP flags for probe responses and
other IE situations.
  
  The primary consumer of this is ath10k.  iwn could use it when sending RXON,
  but we don't support IBSS or AP modes on it yet, and I'm not yet sure whether
  it's required in STA mode (ie whether the firmware parses beacons to change
  protection mode or whether we need to.)
  
  Tested:
  
  * AR9280, STA/AP
  * AR9380, DWDS STA+STA/AP
  * ath10k work, STA/AP
  * Intel 6235, STA
  * Various rtwn / run NICs, DWDS STA and STA configurations

Modified:
  head/sys/net80211/ieee80211_ddb.c
  head/sys/net80211/ieee80211_hostap.c
  head/sys/net80211/ieee80211_ht.c
  head/sys/net80211/ieee80211_ioctl.c
  head/sys/net80211/ieee80211_node.c
  head/sys/net80211/ieee80211_node.h
  head/sys/net80211/ieee80211_output.c
  head/sys/net80211/ieee80211_power.c
  head/sys/net80211/ieee80211_proto.c
  head/sys/net80211/ieee80211_proto.h
  head/sys/net80211/ieee80211_sta.c
  head/sys/net80211/ieee80211_var.h

Modified: head/sys/net80211/ieee80211_ddb.c
==
--- head/sys/net80211/ieee80211_ddb.c   Tue Jun 30 22:01:21 2020
(r362814)
+++ head/sys/net80211/ieee80211_ddb.c   Wed Jul  1 00:23:49 2020
(r362815)
@@ -483,6 +483,17 @@ _db_show_vap(const struct ieee80211vap *vap, int showm
if (vap->iv_tdma != NULL)
_db_show_tdma("\t", vap->iv_tdma, showprocs);
 #endif /* IEEE80211_SUPPORT_TDMA */
+
+   db_printf("\tsta_assoc %u", vap->iv_sta_assoc);
+   db_printf(" ht_sta_assoc %u", vap->iv_ht_sta_assoc);
+   db_printf(" ht40_sta_assoc %u", vap->iv_ht40_sta_assoc);
+   db_printf("\n");
+   db_printf(" nonerpsta %u", vap->iv_nonerpsta);
+   db_printf(" longslotsta %u", vap->iv_longslotsta);
+   db_printf(" lastnonerp %d", vap->iv_lastnonerp);
+   db_printf(" lastnonht %d", vap->iv_lastnonht);
+   db_printf("\n");
+
if (showprocs) {
DB_PRINTSYM("\t", "iv_key_alloc", vap->iv_key_alloc);
DB_PRINTSYM("\t", "iv_key_delete", vap->iv_key_delete);
@@ -608,17 +619,8 @@ 

Re: svn commit: r362809 - head/contrib/mandoc

2020-06-30 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> Author: gbe (doc committer)
> Date: Tue Jun 30 18:08:59 2020
> New Revision: 362809
> URL: https://svnweb.freebsd.org/changeset/base/362809
> 
> Log:
>   Mention FreeBSD in the HISTORY sections of apropos(1) and makewhatis(8).
>   
>   PR: 223520, 223521
>   Reviewed by:bcr (mentor)
>   Approved by:bcr (mentor)
>   Differential Revision:  https://reviews.freebsd.org/D25521
> 
> Modified:
>   head/contrib/mandoc/apropos.1
>   head/contrib/mandoc/makewhatis.8
> 
> Modified: head/contrib/mandoc/apropos.1
> ==
> --- head/contrib/mandoc/apropos.1 Tue Jun 30 17:21:28 2020
> (r362808)
> +++ head/contrib/mandoc/apropos.1 Tue Jun 30 18:08:59 2020
> (r362809)
> @@ -15,7 +15,7 @@
>  .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
>  .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
>  .\"
> -.Dd $Mdocdate: November 22 2018 $
> +.Dd $Mdocdate: June 30 2020 $
>  .Dt APROPOS 1
>  .Os
>  .Sh NAME
> @@ -493,6 +493,12 @@ The options
>  .Fl acfhIKklOTWw
>  appeared in
>  .Ox 5.7 .
> +.Pp
> +The
> +.Nm
> +utility was integrated into
> +.Fx 11.1
> +as part of the switch to mandoc.

Huh?  FreeBSD has had apropos since 1.0 and my 5.4 system clearly has it:
freebsd {110}% uname -a
FreeBSD pdx.rh.CN85.dnsmgr.net 5.4-RELEASE-p8 FreeBSD 5.4-RELEASE-p8 #1: Mon 
Jul  1 17:58:50 PDT 2019 
r...@pdx.rh.cn85.dnsmgr.net:/usr/src/sys/i386/compile/PDXMXPIE  i386
pdx.rh.CN85.dnsmgr.net:freebsd {111}% which apropos
/usr/bin/apropos

And a man page for it too:
APROPOS(1)  FreeBSD General Commands Manual APROPOS(1)

NAME
 apropos, whatis -- search the whatis database

SYNOPSIS
 apropos keyword ...
 whatis keyword ...

DESCRIPTION
 apropos searches a set of database files containing short descriptions of
 system commands for keywords and displays the result on the standard out-
 put.  whatis displays only complete word matches.

 keyword really is an extended regular expression, please read grep(1)
 manual page for more information about its format.

DIAGNOSTICS
 The apropos utility exits 0 on success, and 1 if no keyword matched.

SEE ALSO
 grep(1), makewhatis(1), man(1)

FreeBSD 5.4January 15, 1991FreeBSD 5.4

>  .Sh AUTHORS
>  .An -nosplit
>  .An Bill Joy
> 
> Modified: head/contrib/mandoc/makewhatis.8
> ==
> --- head/contrib/mandoc/makewhatis.8  Tue Jun 30 17:21:28 2020
> (r362808)
> +++ head/contrib/mandoc/makewhatis.8  Tue Jun 30 18:08:59 2020
> (r362809)
> @@ -15,7 +15,7 @@
>  .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
>  .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
>  .\"
> -.Dd $Mdocdate: May 17 2017 $
> +.Dd $Mdocdate: June 30 2020 $
>  .Dt MAKEWHATIS 8
>  .Os
>  .Sh NAME
> @@ -211,6 +211,12 @@ and the options
>  .Fl aCDnQT
>  in
>  .Ox 5.6 .
> +.Pp
> +The
> +.Nm
> +utility was integrated into
> +.Fx 11.1
> +as part of the switch to mandoc.

Ditto

>  .Sh AUTHORS
>  .An -nosplit
>  .An Bill Joy
> 

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r362681 - in head: contrib/bc contrib/bc/gen contrib/bc/include contrib/bc/locales contrib/bc/manuals contrib/bc/src contrib/bc/src/bc contrib/bc/src/dc contrib/bc/src/history contrib/

2020-06-30 Thread Stefan Eßer


Am 30.06.20 um 23:29 schrieb Dimitry Andric:
> On 30 Jun 2020, at 22:01, Stefan Eßer  wrote:
>>
>> Am 29.06.20 um 20:09 schrieb Ed Maste:
>>> On Mon, 29 Jun 2020 at 11:27, John Baldwin  wrote:

 I suspect just doing the 'merge --record-only' is the simplest method
 assuming Git handles it ok.  I suspect since Git ignores mergeinfo this
 is fine, but it would be good for Ed to confirm.  You can always restore
 the tests in the future in contrib/bc when you want to add them.
>>>
>>> I think a --record-only merge is the best approach; in any case we
>>> have a number of these in the tree already and Git will have to deal
>>> with them.
>>
>> $ cd /usr/svn/base/head/contrib/bc
>>
>> $ svn merge --record-only ^/vendor/bc/dist
>> svn: E195016: 'svn+ssh://repo.freebsd.org/base/vendor/bc/dist@362810'
>> must be ancestrally related to
>> 'svn+ssh://repo.freebsd.org/base/head/contrib/bc@362810'
> 
> This is because you are supposed to commit stuff to ^/base/vendor/xxx
> first, then svn cp it to ^/head/contrib/xxx, at least from Subversion
> 1.8 onwards. The 'cp' action establishes the ancestral relation.

Yes, I thought so - the problem I want to fix is the premature import
to /contrib and I had been hoping that it was possible to use the
--record-only merge to edit the merge history (as suggested by John
Baldwin and Ed Maste).

> Some of our older contrib areas were imported using cvs2svn, and these
> also suffer the same problem, i.e. Subversion complains that the vendor
> and contrib areas are not ancestrally related.

I see.

>> Adding the option --ignore-ancestry to the merge command does not help.
> ...
>> Any idea how to merge from the vendor area in this situation?
> 
> As far as I know, you have these alternatives:
> 
> * Delete the contrib/bc tree, and do a fresh svn cp from the vendor
>   area. You will have to apply any customizations on top again. I did
>   something like this to fixup contrib/libc++ in
>   https://svnweb.freebsd.org/base?view=revision=287679

Yes, I could delete the files in contrib/bc and then immediately
svn copy over the contents of vendor/bc/dist - and I guess that is
the only real "clean" way forward.

> * Figure out the right value of the svn:mergeinfo property, and apply
>   that by hand, using svn propset. This will be tricky, and has to be
>   re-done manually every time you want to merge again.

Not my preferred approach ...

> * Merge with Subversion 1.7 or earlier.

If this would result in a sane state of the repository I might give
it a try.

> * Ignore all this, merge patches by hand and wait for the Git
>   transition to be completed.

I want to upgrade to the next release and I'm wondering whether it
would be possible to just svn copy that new version over from the
vendor directory to the contrib directory. The import to the vendor
area and the contrib directory have very similar commit messages and
thus there would be no loss of commit history.

If this is possible and does not cause problems for the SVN repo or
the Git conversion, this might be the simplest solution.

Thank you for your reply and the clarification of the situation!

Best regards, STefan
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362814 - head/sys/opencrypto

2020-06-30 Thread Mark Johnston
Author: markj
Date: Tue Jun 30 22:01:21 2020
New Revision: 362814
URL: https://svnweb.freebsd.org/changeset/base/362814

Log:
  Convert cryptostats to a counter_u64 array.
  
  The global counters were not SMP-friendly.  Use per-CPU counters
  instead.
  
  Reviewed by:  jhb
  Sponsored by: Rubicon Communications, LLC (Netgate)
  Differential Revision:https://reviews.freebsd.org/D25466

Modified:
  head/sys/opencrypto/crypto.c
  head/sys/opencrypto/cryptodev.h

Modified: head/sys/opencrypto/crypto.c
==
--- head/sys/opencrypto/crypto.cTue Jun 30 21:50:05 2020
(r362813)
+++ head/sys/opencrypto/crypto.cTue Jun 30 22:01:21 2020
(r362814)
@@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -232,10 +232,32 @@ staticint crypto_kinvoke(struct cryptkop *krp);
 static void crypto_task_invoke(void *ctx, int pending);
 static void crypto_batch_enqueue(struct cryptop *crp);
 
-static struct cryptostats cryptostats;
-SYSCTL_STRUCT(_kern_crypto, OID_AUTO, stats, CTLFLAG_RW, ,
-   cryptostats, "Crypto system statistics");
+static counter_u64_t cryptostats[sizeof(struct cryptostats) / 
sizeof(uint64_t)];
+SYSCTL_COUNTER_U64_ARRAY(_kern_crypto, OID_AUTO, stats, CTLFLAG_RW,
+cryptostats, nitems(cryptostats),
+"Crypto system statistics");
 
+#defineCRYPTOSTAT_INC(stat) do {   
\
+   counter_u64_add(\
+   cryptostats[offsetof(struct cryptostats, stat) / sizeof(uint64_t)],\
+   1); \
+} while (0)
+
+static void
+cryptostats_init(void *arg __unused)
+{
+   COUNTER_ARRAY_ALLOC(cryptostats, nitems(cryptostats), M_WAITOK);
+}
+SYSINIT(cryptostats_init, SI_SUB_COUNTER, SI_ORDER_ANY, cryptostats_init, 
NULL);
+
+static void
+cryptostats_fini(void *arg __unused)
+{
+   COUNTER_ARRAY_FREE(cryptostats, nitems(cryptostats));
+}
+SYSUNINIT(cryptostats_fini, SI_SUB_COUNTER, SI_ORDER_ANY, cryptostats_fini,
+NULL);
+
 /* Try to avoid directly exposing the key buffer as a symbol */
 static struct keybuf *keybuf;
 
@@ -1399,7 +1421,7 @@ crypto_dispatch(struct cryptop *crp)
crp_sanity(crp);
 #endif
 
-   cryptostats.cs_ops++;
+   CRYPTOSTAT_INC(cs_ops);
 
crp->crp_retw_id = ((uintptr_t)crp->crp_session) % crypto_workers_num;
 
@@ -1460,7 +1482,7 @@ crypto_kdispatch(struct cryptkop *krp)
 {
int error;
 
-   cryptostats.cs_kops++;
+   CRYPTOSTAT_INC(cs_kops);
 
krp->krp_cap = NULL;
error = crypto_kinvoke(krp);
@@ -1767,7 +1789,7 @@ crypto_done(struct cryptop *crp)
("crypto_done: op already done, flags 0x%x", crp->crp_flags));
crp->crp_flags |= CRYPTO_F_DONE;
if (crp->crp_etype != 0)
-   cryptostats.cs_errs++;
+   CRYPTOSTAT_INC(cs_errs);
 
/*
 * CBIMM means unconditionally do the callback immediately;
@@ -1839,7 +1861,7 @@ crypto_kdone(struct cryptkop *krp)
struct cryptocap *cap;
 
if (krp->krp_status != 0)
-   cryptostats.cs_kerrs++;
+   CRYPTOSTAT_INC(cs_kerrs);
CRYPTO_DRIVER_LOCK();
cap = krp->krp_cap;
KASSERT(cap->cc_koperations > 0, ("cc_koperations == 0"));
@@ -1979,7 +2001,7 @@ crypto_proc(void)
 */
cap->cc_qblocked = 1;
TAILQ_INSERT_HEAD(_q, submit, crp_next);
-   cryptostats.cs_blocks++;
+   CRYPTOSTAT_INC(cs_blocks);
}
}
 
@@ -2016,7 +2038,7 @@ crypto_proc(void)
 */
krp->krp_cap->cc_kqblocked = 1;
TAILQ_INSERT_HEAD(_kq, krp, krp_next);
-   cryptostats.cs_kblocks++;
+   CRYPTOSTAT_INC(cs_kblocks);
}
}
 
@@ -2038,7 +2060,7 @@ crypto_proc(void)
crp_sleep = 0;
if (cryptoproc == NULL)
break;
-   cryptostats.cs_intrs++;
+   CRYPTOSTAT_INC(cs_intrs);
}
}
CRYPTO_Q_UNLOCK();
@@ -2099,7 +2121,7 @@ crypto_ret_proc(struct crypto_ret_worker *ret_worker)
"crypto_ret_wait", 0);
if (ret_worker->cryptoretproc == NULL)
break;
-   cryptostats.cs_rets++;
+   CRYPTOSTAT_INC(cs_rets);
}
}
CRYPTO_RETW_UNLOCK(ret_worker);

Modified: head/sys/opencrypto/cryptodev.h

svn commit: r362813 - head/sys/netinet

2020-06-30 Thread Michael Tuexen
Author: tuexen
Date: Tue Jun 30 21:50:05 2020
New Revision: 362813
URL: https://svnweb.freebsd.org/changeset/base/362813

Log:
  Fix a bug introduced in https://svnweb.freebsd.org/changeset/base/362173
  
  Reported by:  syzbot+f3a6fccfa6ae9d3de...@syzkaller.appspotmail.com
  MFC after:1 week

Modified:
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctputil.c
==
--- head/sys/netinet/sctputil.c Tue Jun 30 21:48:58 2020(r362812)
+++ head/sys/netinet/sctputil.c Tue Jun 30 21:50:05 2020(r362813)
@@ -5247,7 +5247,11 @@ sctp_find_ifa_in_ep(struct sctp_inpcb *inp, struct soc
if (holds_lock == 0) {
SCTP_INP_RUNLOCK(inp);
}
-   return (laddr->ifa);
+   if (laddr != NULL) {
+   return (laddr->ifa);
+   } else {
+   return (NULL);
+   }
 }
 
 uint32_t
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362812 - head/stand/efi/boot1

2020-06-30 Thread Toomas Soome
Author: tsoome
Date: Tue Jun 30 21:48:58 2020
New Revision: 362812
URL: https://svnweb.freebsd.org/changeset/base/362812

Log:
  boot1.efi: use malloc family from libsa
  
  The zfs reader development did reach to the point where linking boot1,
  we will get errors about duplicate symbols Malloc, Free, Calloc.
  
  We can just use libsa version, just as loader.efi does. The only concern is,
  libsa zalloc is using fixed size heap region, I did pick 64MB as other
  stage instances are using, but this size is likely not optimal. In any case,
  with limited memory setups, we should boot loader.efi directly.
  
  Sponsored by: Netflix, Klara Inc.

Modified:
  head/stand/efi/boot1/boot1.c

Modified: head/stand/efi/boot1/boot1.c
==
--- head/stand/efi/boot1/boot1.cTue Jun 30 21:40:34 2020
(r362811)
+++ head/stand/efi/boot1/boot1.cTue Jun 30 21:48:58 2020
(r362812)
@@ -53,43 +53,9 @@ static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL;
 static EFI_GUID LoadedImageGUID = LOADED_IMAGE_PROTOCOL;
 static EFI_GUID ConsoleControlGUID = EFI_CONSOLE_CONTROL_PROTOCOL_GUID;
 
-/*
- * Provide Malloc / Free / Calloc backed by EFIs AllocatePool / FreePool which 
ensures
- * memory is correctly aligned avoiding EFI_INVALID_PARAMETER returns from
- * EFI methods.
- */
+static EFI_PHYSICAL_ADDRESS heap;
+static UINTN heapsize;
 
-void *
-Malloc(size_t len, const char *file __unused, int line __unused)
-{
-   void *out;
-
-   if (BS->AllocatePool(EfiLoaderData, len, ) == EFI_SUCCESS)
-   return (out);
-
-   return (NULL);
-}
-
-void
-Free(void *buf, const char *file __unused, int line __unused)
-{
-   if (buf != NULL)
-   (void)BS->FreePool(buf);
-}
-
-void *
-Calloc(size_t n1, size_t n2, const char *file, int line)
-{
-   size_t bytes;
-   void *res;
-
-   bytes = n1 * n2;
-   if ((res = Malloc(bytes, file, line)) != NULL)
-   bzero(res, bytes);
-
-   return (res);
-}
-
 /*
  * try_boot only returns if it fails to load the loader. If it succeeds
  * it simply boots, otherwise it returns the status of last EFI call.
@@ -201,6 +167,18 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab)
BS = ST->BootServices;
RS = ST->RuntimeServices;
 
+   heapsize = 64 * 1024 * 1024;
+   status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData,
+   EFI_SIZE_TO_PAGES(heapsize), );
+   if (status != EFI_SUCCESS) {
+   ST->ConOut->OutputString(ST->ConOut,
+   __DECONST(CHAR16 *,
+   L"Failed to allocate memory for heap.\r\n"));
+   BS->Exit(IH, status, 0, NULL);
+   }
+
+   setheap((void *)(uintptr_t)heap, (void *)(uintptr_t)(heap + heapsize));
+
/* Set up the console, so printf works. */
status = BS->LocateProtocol(, NULL,
(VOID **));
@@ -296,6 +274,8 @@ add_device(dev_info_t **devinfop, dev_info_t *devinfo)
 void
 efi_exit(EFI_STATUS s)
 {
+
+   BS->FreePages(heap, EFI_SIZE_TO_PAGES(heapsize));
BS->Exit(IH, s, 0, NULL);
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362811 - head/usr.sbin/acpi/acpidump

2020-06-30 Thread Alexander Motin
Author: mav
Date: Tue Jun 30 21:40:34 2020
New Revision: 362811
URL: https://svnweb.freebsd.org/changeset/base/362811

Log:
  Decode APEI tables (BERT, EINJ, ERST, HEST).
  
  MFC after:2 weeks

Modified:
  head/usr.sbin/acpi/acpidump/acpi.c
  head/usr.sbin/acpi/acpidump/acpidump.8

Modified: head/usr.sbin/acpi/acpidump/acpi.c
==
--- head/usr.sbin/acpi/acpidump/acpi.c  Tue Jun 30 19:34:36 2020
(r362810)
+++ head/usr.sbin/acpi/acpidump/acpi.c  Tue Jun 30 21:40:34 2020
(r362811)
@@ -3,6 +3,7 @@
  *
  * Copyright (c) 1998 Doug Rabson
  * Copyright (c) 2000 Mitsuru IWASAKI 
+ * Copyright (c) 2020 Alexander Motin 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -177,23 +178,17 @@ acpi_print_gas(ACPI_GENERIC_ADDRESS *gas)
 {
switch(gas->SpaceId) {
case ACPI_GAS_MEMORY:
-   if (gas->BitWidth <= 32)
-   printf("0x%08x:%u[%u] (Memory)",
-   (u_int)gas->Address, gas->BitOffset,
-   gas->BitWidth);
-   else
-   printf("0x%016jx:%u[%u] (Memory)",
-   (uintmax_t)gas->Address, gas->BitOffset,
-   gas->BitWidth);
+   printf("0x%016jx:%u[%u] (Memory)", (uintmax_t)gas->Address,
+   gas->BitOffset, gas->BitWidth);
break;
case ACPI_GAS_IO:
-   printf("0x%02x:%u[%u] (IO)", (u_int)gas->Address,
+   printf("0x%02jx:%u[%u] (IO)", (uintmax_t)gas->Address,
gas->BitOffset, gas->BitWidth);
break;
case ACPI_GAS_PCI:
-   printf("%x:%x+0x%x (PCI)", (uint16_t)(gas->Address >> 32),
+   printf("%x:%x+0x%x:%u[%u] (PCI)", (uint16_t)(gas->Address >> 
32),
   (uint16_t)((gas->Address >> 16) & 0x),
-  (uint16_t)gas->Address);
+  (uint16_t)gas->Address, gas->BitOffset, gas->BitWidth);
break;
/* XXX How to handle these below? */
case ACPI_GAS_EMBEDDED:
@@ -594,6 +589,269 @@ acpi_handle_madt(ACPI_TABLE_HEADER *sdp)
 }
 
 static void
+acpi_handle_bert(ACPI_TABLE_HEADER *sdp)
+{
+   ACPI_TABLE_BERT *bert;
+
+   printf(BEGIN_COMMENT);
+   acpi_print_sdt(sdp);
+   bert = (ACPI_TABLE_BERT *)sdp;
+   printf("\tRegionLength=%d\n", bert->RegionLength);
+   printf("\tAddress=0x%016jx\n", bert->Address);
+   printf(END_COMMENT);
+}
+
+static void
+acpi_print_whea(ACPI_WHEA_HEADER *w)
+{
+
+   printf("\n\tAction=%d\n", w->Action);
+   printf("\tInstruction=%d\n", w->Instruction);
+   printf("\tFlags=%02x\n", w->Flags);
+   printf("\tRegisterRegion=");
+   acpi_print_gas(>RegisterRegion);
+   printf("\n\tValue=0x%016jx\n", w->Value);
+   printf("\tMask=0x%016jx\n", w->Mask);
+}
+
+static void
+acpi_handle_einj(ACPI_TABLE_HEADER *sdp)
+{
+   ACPI_TABLE_EINJ *einj;
+   ACPI_WHEA_HEADER *w;
+   u_int i;
+
+   printf(BEGIN_COMMENT);
+   acpi_print_sdt(sdp);
+   einj = (ACPI_TABLE_EINJ *)sdp;
+   printf("\tHeaderLength=%d\n", einj->HeaderLength);
+   printf("\tFlags=0x%02x\n", einj->Flags);
+   printf("\tEntries=%d\n", einj->Entries);
+   w = (ACPI_WHEA_HEADER *)(einj + 1);
+   for (i = 0; i < MIN(einj->Entries, (sdp->Length -
+   sizeof(ACPI_TABLE_EINJ)) / sizeof(ACPI_WHEA_HEADER)); i++)
+   acpi_print_whea(w + i);
+   printf(END_COMMENT);
+}
+
+static void
+acpi_handle_erst(ACPI_TABLE_HEADER *sdp)
+{
+   ACPI_TABLE_ERST *erst;
+   ACPI_WHEA_HEADER *w;
+   u_int i;
+
+   printf(BEGIN_COMMENT);
+   acpi_print_sdt(sdp);
+   erst = (ACPI_TABLE_ERST *)sdp;
+   printf("\tHeaderLength=%d\n", erst->HeaderLength);
+   printf("\tEntries=%d\n", erst->Entries);
+   w = (ACPI_WHEA_HEADER *)(erst + 1);
+   for (i = 0; i < MIN(erst->Entries, (sdp->Length -
+   sizeof(ACPI_TABLE_ERST)) / sizeof(ACPI_WHEA_HEADER)); i++)
+   acpi_print_whea(w + i);
+   printf(END_COMMENT);
+}
+
+static void
+acpi_print_hest_bank(ACPI_HEST_IA_ERROR_BANK *b)
+{
+
+   printf("\tBank:\n");
+   printf("\t\tBankNumber=%d\n", b->BankNumber);
+   printf("\t\tClearStatusOnInit=%d\n", b->ClearStatusOnInit);
+   printf("\t\tStatusFormat=%d\n", b->StatusFormat);
+   printf("\t\tControlRegister=%x\n", b->ControlRegister);
+   printf("\t\tControlData=%jx\n", b->ControlData);
+   printf("\t\tStatusRegister=%x\n", b->StatusRegister);
+   printf("\t\tAddressRegister=%x\n", b->AddressRegister);
+   printf("\t\tMiscRegister=%x\n", b->MiscRegister);
+}
+
+static void
+acpi_print_hest_notify(ACPI_HEST_NOTIFY *n)
+{
+
+   printf("\t\tType=%d\n", n->Type);
+   printf("\t\tLength=%d\n", n->Length);
+   

Re: svn commit: r362681 - in head: contrib/bc contrib/bc/gen contrib/bc/include contrib/bc/locales contrib/bc/manuals contrib/bc/src contrib/bc/src/bc contrib/bc/src/dc contrib/bc/src/history contrib/

2020-06-30 Thread Dimitry Andric
On 30 Jun 2020, at 22:01, Stefan Eßer  wrote:
> 
> Am 29.06.20 um 20:09 schrieb Ed Maste:
>> On Mon, 29 Jun 2020 at 11:27, John Baldwin  wrote:
>>> 
>>> I suspect just doing the 'merge --record-only' is the simplest method
>>> assuming Git handles it ok.  I suspect since Git ignores mergeinfo this
>>> is fine, but it would be good for Ed to confirm.  You can always restore
>>> the tests in the future in contrib/bc when you want to add them.
>> 
>> I think a --record-only merge is the best approach; in any case we
>> have a number of these in the tree already and Git will have to deal
>> with them.
> 
> $ cd /usr/svn/base/head/contrib/bc
> 
> $ svn merge --record-only ^/vendor/bc/dist
> svn: E195016: 'svn+ssh://repo.freebsd.org/base/vendor/bc/dist@362810'
> must be ancestrally related to
> 'svn+ssh://repo.freebsd.org/base/head/contrib/bc@362810'

This is because you are supposed to commit stuff to ^/base/vendor/xxx
first, then svn cp it to ^/head/contrib/xxx, at least from Subversion
1.8 onwards. The 'cp' action establishes the ancestral relation.

Some of our older contrib areas were imported using cvs2svn, and these
also suffer the same problem, i.e. Subversion complains that the vendor
and contrib areas are not ancestrally related.



> Adding the option --ignore-ancestry to the merge command does not help.
...
> Any idea how to merge from the vendor area in this situation?

As far as I know, you have these alternatives:

* Delete the contrib/bc tree, and do a fresh svn cp from the vendor
  area. You will have to apply any customizations on top again. I did
  something like this to fixup contrib/libc++ in
  https://svnweb.freebsd.org/base?view=revision=287679
* Figure out the right value of the svn:mergeinfo property, and apply
  that by hand, using svn propset. This will be tricky, and has to be
  re-done manually every time you want to merge again.
* Merge with Subversion 1.7 or earlier.
* Ignore all this, merge patches by hand and wait for the Git
  transition to be completed.

-Dimitry



signature.asc
Description: Message signed with OpenPGP


Re: svn commit: r362681 - in head: contrib/bc contrib/bc/gen contrib/bc/include contrib/bc/locales contrib/bc/manuals contrib/bc/src contrib/bc/src/bc contrib/bc/src/dc contrib/bc/src/history contrib/

2020-06-30 Thread Stefan Eßer
Am 29.06.20 um 20:09 schrieb Ed Maste:
> On Mon, 29 Jun 2020 at 11:27, John Baldwin  wrote:
>>
>> I suspect just doing the 'merge --record-only' is the simplest method
>> assuming Git handles it ok.  I suspect since Git ignores mergeinfo this
>> is fine, but it would be good for Ed to confirm.  You can always restore
>> the tests in the future in contrib/bc when you want to add them.
> 
> I think a --record-only merge is the best approach; in any case we
> have a number of these in the tree already and Git will have to deal
> with them.

$ cd /usr/svn/base/head/contrib/bc

$ svn merge --record-only ^/vendor/bc/dist
svn: E195016: 'svn+ssh://repo.freebsd.org/base/vendor/bc/dist@362810'
must be ancestrally related to
'svn+ssh://repo.freebsd.org/base/head/contrib/bc@362810'

Adding the option --ignore-ancestry to the merge command does not help.

I have performed a clean check-out of base/head and base/vendor, but
the error message stays the same ...


SVN info for the relevant directories involved in the merge attempt:

$ svn info /usr/svn/base/head/contrib/bc /usr/svn/base/vendor/bc/dist
Path: usr/svn/base/head/contrib/bc
Working Copy Root Path: /usr/svn/base
URL: svn+ssh://repo.freebsd.org/base/head/contrib/bc
Relative URL: ^/head/contrib/bc
Repository Root: svn+ssh://repo.freebsd.org/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 362810
Node Kind: directory
Schedule: normal
Last Changed Author: se
Last Changed Rev: 362681
Last Changed Date: 2020-06-27 14:02:01 +0200 (Sat, 27 Jun 2020)

Path: usr/svn/base/vendor/bc/dist
Working Copy Root Path: /usr/svn/base
URL: svn+ssh://repo.freebsd.org/base/vendor/bc/dist
Relative URL: ^/vendor/bc/dist
Repository Root: svn+ssh://repo.freebsd.org/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 362810
Node Kind: directory
Schedule: normal
Last Changed Author: se
Last Changed Rev: 362697
Last Changed Date: 2020-06-27 17:03:19 +0200 (Sat, 27 Jun 2020)


Any idea how to merge from the vendor area in this situation?

Regards, STefan
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362809 - head/contrib/mandoc

2020-06-30 Thread Gordon Bergling
Author: gbe (doc committer)
Date: Tue Jun 30 18:08:59 2020
New Revision: 362809
URL: https://svnweb.freebsd.org/changeset/base/362809

Log:
  Mention FreeBSD in the HISTORY sections of apropos(1) and makewhatis(8).
  
  PR:   223520, 223521
  Reviewed by:  bcr (mentor)
  Approved by:  bcr (mentor)
  Differential Revision:https://reviews.freebsd.org/D25521

Modified:
  head/contrib/mandoc/apropos.1
  head/contrib/mandoc/makewhatis.8

Modified: head/contrib/mandoc/apropos.1
==
--- head/contrib/mandoc/apropos.1   Tue Jun 30 17:21:28 2020
(r362808)
+++ head/contrib/mandoc/apropos.1   Tue Jun 30 18:08:59 2020
(r362809)
@@ -15,7 +15,7 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd $Mdocdate: November 22 2018 $
+.Dd $Mdocdate: June 30 2020 $
 .Dt APROPOS 1
 .Os
 .Sh NAME
@@ -493,6 +493,12 @@ The options
 .Fl acfhIKklOTWw
 appeared in
 .Ox 5.7 .
+.Pp
+The
+.Nm
+utility was integrated into
+.Fx 11.1
+as part of the switch to mandoc.
 .Sh AUTHORS
 .An -nosplit
 .An Bill Joy

Modified: head/contrib/mandoc/makewhatis.8
==
--- head/contrib/mandoc/makewhatis.8Tue Jun 30 17:21:28 2020
(r362808)
+++ head/contrib/mandoc/makewhatis.8Tue Jun 30 18:08:59 2020
(r362809)
@@ -15,7 +15,7 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd $Mdocdate: May 17 2017 $
+.Dd $Mdocdate: June 30 2020 $
 .Dt MAKEWHATIS 8
 .Os
 .Sh NAME
@@ -211,6 +211,12 @@ and the options
 .Fl aCDnQT
 in
 .Ox 5.6 .
+.Pp
+The
+.Nm
+utility was integrated into
+.Fx 11.1
+as part of the switch to mandoc.
 .Sh AUTHORS
 .An -nosplit
 .An Bill Joy
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362808 - head/usr.sbin/iovctl

2020-06-30 Thread Gordon Bergling
Author: gbe (doc committer)
Date: Tue Jun 30 17:21:28 2020
New Revision: 362808
URL: https://svnweb.freebsd.org/changeset/base/362808

Log:
  iovctl(8): Correct a typo in the manpage and correct the SYNOPSIS
  
  PR:   246831
  Submitted by: Jose Luis Duran 
  Reviewed by:  bcr (mentor)
  Approved by:  bcr (mentor)
  MFC after:7 days

Modified:
  head/usr.sbin/iovctl/iovctl.8
  head/usr.sbin/iovctl/iovctl.conf.5

Modified: head/usr.sbin/iovctl/iovctl.8
==
--- head/usr.sbin/iovctl/iovctl.8   Tue Jun 30 16:49:43 2020
(r362807)
+++ head/usr.sbin/iovctl/iovctl.8   Tue Jun 30 17:21:28 2020
(r362808)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 8, 2015
+.Dd May 31, 2020
 .Dt IOVCTL 8
 .Os
 .Sh NAME
@@ -34,7 +34,7 @@
 .Sh SYNOPSIS
 .Nm
 .Fl C
-.Op Fl f Ar config-file
+.Fl f Ar config-file
 .Op Fl n
 .Nm
 .Fl D

Modified: head/usr.sbin/iovctl/iovctl.conf.5
==
--- head/usr.sbin/iovctl/iovctl.conf.5  Tue Jun 30 16:49:43 2020
(r362807)
+++ head/usr.sbin/iovctl/iovctl.conf.5  Tue Jun 30 17:21:28 2020
(r362808)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 8, 2015
+.Dd May 29, 2020
 .Dt IOVCTL.CONF 5
 .Os
 .Sh NAME
@@ -43,7 +43,7 @@ device.
 To configure SR-IOV on multiple PF devices, use one configuration file for each
 PF.
 The locations of all
-.Xr iovctl 9
+.Xr iovctl 8
 configuration files are specified in
 .Xr rc.conf 5 .
 .Pp
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r362794 - head/sys/compat/linuxkpi/common/include/linux

2020-06-30 Thread Ravi Pokala
Thank you!

-Ravi (rpokala@)


-Original Message-
From:  on behalf of Hans Petter Selasky 

Date: 2020-06-30, Tuesday at 01:41
To: , , 

Subject: svn commit: r362794 - head/sys/compat/linuxkpi/common/include/linux

Author: hselasky
Date: Tue Jun 30 08:41:33 2020
New Revision: 362794
URL: https://svnweb.freebsd.org/changeset/base/362794

Log:
  Document the is_signed(), type_max() and type_min() function macros in the
  LinuxKPI. Try to make the function argument more readable.

  Suggested by: several
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/kernel.h

Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h

==
--- head/sys/compat/linuxkpi/common/include/linux/kernel.h  Tue Jun 30 
07:37:24 2020(r362793)
+++ head/sys/compat/linuxkpi/common/include/linux/kernel.h  Tue Jun 30 
08:41:33 2020(r362794)
@@ -564,20 +564,33 @@ linux_ratelimited(linux_ratelimit_t *rl)
 #define__is_constexpr(x) \
__builtin_constant_p(x)

-#defineis_signed(x) (((x)-1 / (x)2) == (x)0)
+/*
+ * The is_signed() macro below returns true if the passed data type is
+ * signed. Else false is returned.
+ */
+#defineis_signed(datatype) (((datatype)-1 / (datatype)2) == 
(datatype)0)

-#definetype_max(x) (   \
-  (sizeof(x) >= 8) ? (is_signed(x) ? INT64_MAX : UINT64_MAX) : \
-  (sizeof(x) >= 4) ? (is_signed(x) ? INT32_MAX : UINT32_MAX) : \
-  (sizeof(x) >= 2) ? (is_signed(x) ? INT16_MAX : UINT16_MAX) : \
-(is_signed(x) ? INT8_MAX : UINT8_MAX)  \
+/*
+ * The type_max() macro below returns the maxium positive value the
+ * passed data type can hold.
+ */
+#definetype_max(datatype) ( \
+  (sizeof(datatype) >= 8) ? (is_signed(datatype) ? INT64_MAX : UINT64_MAX) 
: \
+  (sizeof(datatype) >= 4) ? (is_signed(datatype) ? INT32_MAX : UINT32_MAX) 
: \
+  (sizeof(datatype) >= 2) ? (is_signed(datatype) ? INT16_MAX : UINT16_MAX) 
: \
+   (is_signed(datatype) ? INT8_MAX : UINT8_MAX) \
 )

-#definetype_min(x) (   \
-  (sizeof(x) >= 8) ? (is_signed(x) ? INT64_MIN : 0) :  \
-  (sizeof(x) >= 4) ? (is_signed(x) ? INT32_MIN : 0) :  \
-  (sizeof(x) >= 2) ? (is_signed(x) ? INT16_MIN : 0) :  \
-(is_signed(x) ? INT8_MIN : 0)  \
+/*
+ * The type_min() macro below returns the minimum value the passed
+ * data type can hold. For unsigned types the minimum value is always
+ * zero. For signed types it may vary.
+ */
+#definetype_min(datatype) ( \
+  (sizeof(datatype) >= 8) ? (is_signed(datatype) ? INT64_MIN : 0) : \
+  (sizeof(datatype) >= 4) ? (is_signed(datatype) ? INT32_MIN : 0) : \
+  (sizeof(datatype) >= 2) ? (is_signed(datatype) ? INT16_MIN : 0) : \
+   (is_signed(datatype) ? INT8_MIN : 0) \
 )

 #endif /* _LINUX_KERNEL_H_ */


___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362807 - head/usr.sbin/sesutil

2020-06-30 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Jun 30 16:49:43 2020
New Revision: 362807
URL: https://svnweb.freebsd.org/changeset/base/362807

Log:
  Fix misplaced voltages/temperatures labels in 'sesutil show'.
  
  PR:   bin/247384
  Reported by:  brd
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D25353

Modified:
  head/usr.sbin/sesutil/sesutil.c

Modified: head/usr.sbin/sesutil/sesutil.c
==
--- head/usr.sbin/sesutil/sesutil.c Tue Jun 30 16:24:28 2020
(r362806)
+++ head/usr.sbin/sesutil/sesutil.c Tue Jun 30 16:49:43 2020
(r362807)
@@ -831,7 +831,7 @@ show(int argc, char **argv __unused)
break;
case ELMTYP_THERM:
if (e_ptr[j].elm_type != prev_type)
-   xo_emit("\nVoltages: ");
+   xo_emit("\nTemperatures: ");
else
xo_emit(", ");
prev_type = e_ptr[j].elm_type;
@@ -839,7 +839,7 @@ show(int argc, char **argv __unused)
break;
case ELMTYP_VOM:
if (e_ptr[j].elm_type != prev_type)
-   xo_emit("\nTemperatures: ");
+   xo_emit("\nVoltages: ");
else
xo_emit(", ");
prev_type = e_ptr[j].elm_type;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r362806 - head/sys/compat/linprocfs

2020-06-30 Thread Mateusz Piotrowski
Hi,

On 6/30/20 6:24 PM, Edward Tomasz Napierala wrote:
> Author: trasz
> Date: Tue Jun 30 16:24:28 2020
> New Revision: 362806
> URL: https://svnweb.freebsd.org/changeset/base/362806
>
> Log:
>   Make linprocfs(5) create the /proc//task/ directores.
>   This is to silence down some Chromium assertions.
>   
>   PR: kern/240991
>   Analyzed by:Alex S 
>   MFC after:  2 weeks
>   Sponsored by:   The FreeBSD Foundation
>   Differential Revision:  https://reviews.freebsd.org/D25256

Hmm, could something similar be done to the following warning which is being 
printed
when service fahclient is started (from the biology/linux-foldingathome port):

16:25:39:WARNING:Exception: Failed to open '/proc/bus/pci/devices': Failed to 
open
'/proc/bus/pci/devices': No such file or directory: No such file or directory

Cheers!

Mateusz

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362806 - head/sys/compat/linprocfs

2020-06-30 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Jun 30 16:24:28 2020
New Revision: 362806
URL: https://svnweb.freebsd.org/changeset/base/362806

Log:
  Make linprocfs(5) create the /proc//task/ directores.
  This is to silence down some Chromium assertions.
  
  PR:   kern/240991
  Analyzed by:  Alex S 
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D25256

Modified:
  head/sys/compat/linprocfs/linprocfs.c

Modified: head/sys/compat/linprocfs/linprocfs.c
==
--- head/sys/compat/linprocfs/linprocfs.c   Tue Jun 30 16:23:51 2020
(r362805)
+++ head/sys/compat/linprocfs/linprocfs.c   Tue Jun 30 16:24:28 2020
(r362806)
@@ -1620,6 +1620,28 @@ out:
 }
 
 /*
+ * The point of the following two functions is to work around
+ * an assertion in Chromium; see kern/240991 for details.
+ */
+static int
+linprocfs_dotaskattr(PFS_ATTR_ARGS)
+{
+
+   vap->va_nlink = 3;
+   return (0);
+}
+
+/*
+ * Filler function for proc//task/.dummy
+ */
+static int
+linprocfs_dotaskdummy(PFS_FILL_ARGS)
+{
+
+   return (0);
+}
+
+/*
  * Filler function for proc/sys/kernel/random/uuid
  */
 static int
@@ -1758,6 +1780,11 @@ linprocfs_init(PFS_INIT_ARGS)
pfs_create_file(dir, "auxv", _doauxv,
NULL, _candebug, NULL, PFS_RD|PFS_RAWRD);
pfs_create_file(dir, "limits", _doproclimits,
+   NULL, NULL, NULL, PFS_RD);
+
+   /* /proc//task/... */
+   dir = pfs_create_dir(dir, "task", linprocfs_dotaskattr, NULL, NULL, 0);
+   pfs_create_file(dir, ".dummy", _dotaskdummy,
NULL, NULL, NULL, PFS_RD);
 
/* /proc/scsi/... */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362805 - in head/share/man: man5 man9

2020-06-30 Thread Mateusz Piotrowski
Author: 0mp (doc,ports committer)
Date: Tue Jun 30 16:23:51 2020
New Revision: 362805
URL: https://svnweb.freebsd.org/changeset/base/362805

Log:
  Cross-reference style(9) and style.mdoc(5)
  
  Suggested by: yuripv
  MFC after:3 days

Modified:
  head/share/man/man5/style.mdoc.5
  head/share/man/man9/style.9

Modified: head/share/man/man5/style.mdoc.5
==
--- head/share/man/man5/style.mdoc.5Tue Jun 30 16:18:09 2020
(r362804)
+++ head/share/man/man5/style.mdoc.5Tue Jun 30 16:23:51 2020
(r362805)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 10, 2019
+.Dd June 30, 2020
 .Dt STYLE.MDOC 5
 .Os
 .Sh NAME
@@ -242,7 +242,8 @@ that would be rendered as:
 .Sh SEE ALSO
 .Xr man 1 ,
 .Xr mandoc 1 ,
-.Xr mdoc 7
+.Xr mdoc 7 ,
+.Xr style 9
 .Sh HISTORY
 This manual page first appeared in
 .Fx 13.0 .

Modified: head/share/man/man9/style.9
==
--- head/share/man/man9/style.9 Tue Jun 30 16:18:09 2020(r362804)
+++ head/share/man/man9/style.9 Tue Jun 30 16:23:51 2020(r362805)
@@ -25,7 +25,7 @@
 .\"From: @(#)style 1.14 (Berkeley) 4/28/95
 .\" $FreeBSD$
 .\"
-.Dd January 10, 2020
+.Dd June 30, 2020
 .Dt STYLE 9
 .Os
 .Sh NAME
@@ -916,6 +916,7 @@ indentation rules.
 .Xr err 3 ,
 .Xr warn 3 ,
 .Xr style.Makefile 5 ,
+.Xr style.mdoc 5 ,
 .Xr style.lua 9
 .Sh HISTORY
 This manual page is largely based on the
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362804 - head/sys/compat/linux

2020-06-30 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Jun 30 16:18:09 2020
New Revision: 362804
URL: https://svnweb.freebsd.org/changeset/base/362804

Log:
  Make linux(4) ignore SA_INTERRUPT.  The zsh(1) binary from Bionic uses it.
  
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D25499

Modified:
  head/sys/compat/linux/linux_signal.c

Modified: head/sys/compat/linux/linux_signal.c
==
--- head/sys/compat/linux/linux_signal.cTue Jun 30 15:58:29 2020
(r362803)
+++ head/sys/compat/linux/linux_signal.cTue Jun 30 16:18:09 2020
(r362804)
@@ -102,6 +102,10 @@ linux_to_bsd_sigaction(l_sigaction_t *lsa, struct siga
flags &= ~LINUX_SA_RESTART;
bsa->sa_flags |= SA_RESTART;
}
+   if (lsa->lsa_flags & LINUX_SA_INTERRUPT) {
+   flags &= ~LINUX_SA_INTERRUPT;
+   /* Documented to be a "historical no-op". */
+   }
if (lsa->lsa_flags & LINUX_SA_ONESHOT) {
flags &= ~LINUX_SA_ONESHOT;
bsa->sa_flags |= SA_RESETHAND;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362803 - in head/sys: conf dev/usb/controller mips/mediatek

2020-06-30 Thread Andrew Turner
Author: andrew
Date: Tue Jun 30 15:58:29 2020
New Revision: 362803
URL: https://svnweb.freebsd.org/changeset/base/362803

Log:
  Add dwc_otg_acpi
  
  Create an acpi attachment for the DWC USB OTG device. This is present in
  the Raspberry Pi 4 in the USB-C port normally used to power the board. Some
  firmware presents the kernel with ACPI tables rather than FDT so we need
  an ACPI attachment.
  
  Submitted by: Greg V 
  Approved by:  hselasky (removal of All rights reserved)
  Differential Revision:https://reviews.freebsd.org/D25203

Added:
  head/sys/dev/usb/controller/dwc_otg_acpi.c   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/dev/usb/controller/dwc_otg.c
  head/sys/dev/usb/controller/dwc_otg_fdt.c
  head/sys/mips/mediatek/mtk_dotg.c

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue Jun 30 15:57:11 2020(r362802)
+++ head/sys/conf/files Tue Jun 30 15:58:29 2020(r362803)
@@ -3189,6 +3189,7 @@ dev/uart/uart_tty.c   optional uart
 dev/usb/controller/musb_otg.c  optional musb
 dev/usb/controller/dwc_otg.c   optional dwcotg
 dev/usb/controller/dwc_otg_fdt.c   optional dwcotg fdt
+dev/usb/controller/dwc_otg_acpi.c  optional dwcotg acpi
 dev/usb/controller/ehci.c  optional ehci
 dev/usb/controller/ehci_msm.c  optional ehci_msm fdt
 dev/usb/controller/ehci_pci.c  optional ehci pci

Modified: head/sys/dev/usb/controller/dwc_otg.c
==
--- head/sys/dev/usb/controller/dwc_otg.c   Tue Jun 30 15:57:11 2020
(r362802)
+++ head/sys/dev/usb/controller/dwc_otg.c   Tue Jun 30 15:58:29 2020
(r362803)
@@ -66,6 +66,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -3873,12 +3874,40 @@ int
 dwc_otg_init(struct dwc_otg_softc *sc)
 {
uint32_t temp;
+   int err;
 
DPRINTF("start\n");
 
+   sc->sc_io_tag = rman_get_bustag(sc->sc_io_res);
+   sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res);
+   sc->sc_io_size = rman_get_size(sc->sc_io_res);
+
/* set up the bus structure */
+   sc->sc_bus.devices = sc->sc_devices;
+   sc->sc_bus.devices_max = DWC_OTG_MAX_DEVICES;
+   sc->sc_bus.dma_bits = 32;
sc->sc_bus.usbrev = USB_REV_2_0;
sc->sc_bus.methods = _otg_bus_methods;
+
+   /* get all DMA memory */
+   if (usb_bus_mem_alloc_all(>sc_bus,
+   USB_GET_DMA_TAG(sc->sc_bus.parent), NULL)) {
+   return (ENOMEM);
+   }
+
+   sc->sc_bus.bdev = device_add_child(sc->sc_bus.parent, "usbus", -1);
+   if (sc->sc_bus.bdev == NULL)
+   return (ENXIO);
+
+   device_set_ivars(sc->sc_bus.bdev, >sc_bus);
+
+   err = bus_setup_intr(sc->sc_bus.parent, sc->sc_irq_res,
+   INTR_TYPE_TTY | INTR_MPSAFE, _otg_filter_interrupt,
+   _otg_interrupt, sc, >sc_intr_hdl);
+   if (err) {
+   sc->sc_intr_hdl = NULL;
+   return (ENXIO);
+   }
 
usb_callout_init_mtx(>sc_timer,
>sc_bus.bus_mtx, 0);

Added: head/sys/dev/usb/controller/dwc_otg_acpi.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/usb/controller/dwc_otg_acpi.c  Tue Jun 30 15:58:29 2020
(r362803)
@@ -0,0 +1,184 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2012 Hans Petter Selasky.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include "opt_acpi.h"
+

svn commit: r362801 - head/sys/opencrypto

2020-06-30 Thread Mark Johnston
Author: markj
Date: Tue Jun 30 15:56:54 2020
New Revision: 362801
URL: https://svnweb.freebsd.org/changeset/base/362801

Log:
  Remove CRYPTO_TIMING.
  
  It was added a very long time ago.  It is single-threaded, so only
  really useful for basic measurements, and in the meantime we've gotten
  some more sophisticated profiling tools.
  
  Reviewed by:  cem, delphij, jhb
  Sponsored by: Rubicon Communications, LLC (Netgate)
  Differential Revision:https://reviews.freebsd.org/D25464

Modified:
  head/sys/opencrypto/crypto.c
  head/sys/opencrypto/cryptodev.h

Modified: head/sys/opencrypto/crypto.c
==
--- head/sys/opencrypto/crypto.cTue Jun 30 15:53:52 2020
(r362800)
+++ head/sys/opencrypto/crypto.cTue Jun 30 15:56:54 2020
(r362801)
@@ -54,8 +54,6 @@ __FBSDID("$FreeBSD$");
  * PURPOSE.
  */
 
-#defineCRYPTO_TIMING   /* enable timing 
support */
-
 #include "opt_compat.h"
 #include "opt_ddb.h"
 
@@ -238,12 +236,6 @@ static struct cryptostats cryptostats;
 SYSCTL_STRUCT(_kern_crypto, OID_AUTO, stats, CTLFLAG_RW, ,
cryptostats, "Crypto system statistics");
 
-#ifdef CRYPTO_TIMING
-static int crypto_timing = 0;
-SYSCTL_INT(_debug, OID_AUTO, crypto_timing, CTLFLAG_RW,
-  _timing, 0, "Enable/disable crypto timing support");
-#endif
-
 /* Try to avoid directly exposing the key buffer as a symbol */
 static struct keybuf *keybuf;
 
@@ -1409,11 +1401,6 @@ crypto_dispatch(struct cryptop *crp)
 
cryptostats.cs_ops++;
 
-#ifdef CRYPTO_TIMING
-   if (crypto_timing)
-   binuptime(>crp_tstamp);
-#endif
-
crp->crp_retw_id = ((uintptr_t)crp->crp_session) % crypto_workers_num;
 
if (CRYPTOP_ASYNC(crp)) {
@@ -1647,33 +1634,7 @@ crypto_kinvoke(struct cryptkop *krp)
return (0);
 }
 
-#ifdef CRYPTO_TIMING
 static void
-crypto_tstat(struct cryptotstat *ts, struct bintime *bt)
-{
-   struct bintime now, delta;
-   struct timespec t;
-   uint64_t u;
-
-   binuptime();
-   u = now.frac;
-   delta.frac = now.frac - bt->frac;
-   delta.sec = now.sec - bt->sec;
-   if (u < delta.frac)
-   delta.sec--;
-   bintime2timespec(, );
-   timespecadd(>acc, , >acc);
-   if (timespeccmp(, >min, <))
-   ts->min = t;
-   if (timespeccmp(, >max, >))
-   ts->max = t;
-   ts->count++;
-
-   *bt = now;
-}
-#endif
-
-static void
 crypto_task_invoke(void *ctx, int pending)
 {
struct cryptocap *cap;
@@ -1700,10 +1661,6 @@ crypto_invoke(struct cryptocap *cap, struct cryptop *c
KASSERT(crp->crp_session != NULL,
("%s: crp->crp_session == NULL", __func__));
 
-#ifdef CRYPTO_TIMING
-   if (crypto_timing)
-   crypto_tstat(_invoke, >crp_tstamp);
-#endif
if (cap->cc_flags & CRYPTOCAP_F_CLEANUP) {
struct crypto_session_params csp;
crypto_session_t nses;
@@ -1811,10 +1768,7 @@ crypto_done(struct cryptop *crp)
crp->crp_flags |= CRYPTO_F_DONE;
if (crp->crp_etype != 0)
cryptostats.cs_errs++;
-#ifdef CRYPTO_TIMING
-   if (crypto_timing)
-   crypto_tstat(_done, >crp_tstamp);
-#endif
+
/*
 * CBIMM means unconditionally do the callback immediately;
 * CBIFSYNC means do the callback immediately only if the
@@ -1831,20 +1785,7 @@ crypto_done(struct cryptop *crp)
 * callback routine does very little (e.g. the
 * /dev/crypto callback method just does a wakeup).
 */
-#ifdef CRYPTO_TIMING
-   if (crypto_timing) {
-   /*
-* NB: We must copy the timestamp before
-* doing the callback as the cryptop is
-* likely to be reclaimed.
-*/
-   struct bintime t = crp->crp_tstamp;
-   crypto_tstat(_cb, );
-   crp->crp_callback(crp);
-   crypto_tstat(_finis, );
-   } else
-#endif
-   crp->crp_callback(crp);
+   crp->crp_callback(crp);
} else {
struct crypto_ret_worker *ret_worker;
bool wake;
@@ -2144,22 +2085,8 @@ crypto_ret_proc(struct crypto_ret_worker *ret_worker)
/*
 * Run callbacks unlocked.
 */
-   if (crpt != NULL) {
-#ifdef CRYPTO_TIMING
-   if (crypto_timing) {
-   /*
-* NB: We must copy the timestamp before
-* doing the callback as the cryptop is
-* likely to be reclaimed.
-*/

svn commit: r362802 - head/sys/opencrypto

2020-06-30 Thread Mark Johnston
Author: markj
Date: Tue Jun 30 15:57:11 2020
New Revision: 362802
URL: https://svnweb.freebsd.org/changeset/base/362802

Log:
  Remove unused 32-bit compatibility structures from cryptodev.
  
  The counters are exported by a sysctl and have the same width on all
  platforms anyway.
  
  Reviewed by:  cem, delphij, jhb
  Sponsored by: Rubicon Communications, LLC (Netgate)
  Differential Revision:https://reviews.freebsd.org/D25465

Modified:
  head/sys/opencrypto/cryptodev.c

Modified: head/sys/opencrypto/cryptodev.c
==
--- head/sys/opencrypto/cryptodev.c Tue Jun 30 15:56:54 2020
(r362801)
+++ head/sys/opencrypto/cryptodev.c Tue Jun 30 15:57:11 2020
(r362802)
@@ -117,28 +117,6 @@ struct crypt_kop32 {
struct crparam32crk_param[CRK_MAXPARAM];
 };
 
-struct cryptotstat32 {
-   struct timespec32   acc;
-   struct timespec32   min;
-   struct timespec32   max;
-   u_int32_t   count;
-};
-
-struct cryptostats32 {
-   u_int32_t   cs_ops;
-   u_int32_t   cs_errs;
-   u_int32_t   cs_kops;
-   u_int32_t   cs_kerrs;
-   u_int32_t   cs_intrs;
-   u_int32_t   cs_rets;
-   u_int32_t   cs_blocks;
-   u_int32_t   cs_kblocks;
-   struct cryptotstat32 cs_invoke;
-   struct cryptotstat32 cs_done;
-   struct cryptotstat32 cs_cb;
-   struct cryptotstat32 cs_finis;
-};
-
 #defineCIOCGSESSION32  _IOWR('c', 101, struct session_op32)
 #defineCIOCCRYPT32 _IOWR('c', 103, struct crypt_op32)
 #defineCIOCKEY32   _IOWR('c', 104, struct crypt_kop32)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362794 - head/sys/compat/linuxkpi/common/include/linux

2020-06-30 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Jun 30 08:41:33 2020
New Revision: 362794
URL: https://svnweb.freebsd.org/changeset/base/362794

Log:
  Document the is_signed(), type_max() and type_min() function macros in the
  LinuxKPI. Try to make the function argument more readable.
  
  Suggested by: several
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/kernel.h

Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h
==
--- head/sys/compat/linuxkpi/common/include/linux/kernel.h  Tue Jun 30 
07:37:24 2020(r362793)
+++ head/sys/compat/linuxkpi/common/include/linux/kernel.h  Tue Jun 30 
08:41:33 2020(r362794)
@@ -564,20 +564,33 @@ linux_ratelimited(linux_ratelimit_t *rl)
 #define__is_constexpr(x) \
__builtin_constant_p(x)
 
-#defineis_signed(x) (((x)-1 / (x)2) == (x)0)
+/*
+ * The is_signed() macro below returns true if the passed data type is
+ * signed. Else false is returned.
+ */
+#defineis_signed(datatype) (((datatype)-1 / (datatype)2) == 
(datatype)0)
 
-#definetype_max(x) (   \
-  (sizeof(x) >= 8) ? (is_signed(x) ? INT64_MAX : UINT64_MAX) : \
-  (sizeof(x) >= 4) ? (is_signed(x) ? INT32_MAX : UINT32_MAX) : \
-  (sizeof(x) >= 2) ? (is_signed(x) ? INT16_MAX : UINT16_MAX) : \
-(is_signed(x) ? INT8_MAX : UINT8_MAX)  \
+/*
+ * The type_max() macro below returns the maxium positive value the
+ * passed data type can hold.
+ */
+#definetype_max(datatype) ( \
+  (sizeof(datatype) >= 8) ? (is_signed(datatype) ? INT64_MAX : UINT64_MAX) : \
+  (sizeof(datatype) >= 4) ? (is_signed(datatype) ? INT32_MAX : UINT32_MAX) : \
+  (sizeof(datatype) >= 2) ? (is_signed(datatype) ? INT16_MAX : UINT16_MAX) : \
+   (is_signed(datatype) ? INT8_MAX : UINT8_MAX) \
 )
 
-#definetype_min(x) (   \
-  (sizeof(x) >= 8) ? (is_signed(x) ? INT64_MIN : 0) :  \
-  (sizeof(x) >= 4) ? (is_signed(x) ? INT32_MIN : 0) :  \
-  (sizeof(x) >= 2) ? (is_signed(x) ? INT16_MIN : 0) :  \
-(is_signed(x) ? INT8_MIN : 0)  \
+/*
+ * The type_min() macro below returns the minimum value the passed
+ * data type can hold. For unsigned types the minimum value is always
+ * zero. For signed types it may vary.
+ */
+#definetype_min(datatype) ( \
+  (sizeof(datatype) >= 8) ? (is_signed(datatype) ? INT64_MIN : 0) : \
+  (sizeof(datatype) >= 4) ? (is_signed(datatype) ? INT32_MIN : 0) : \
+  (sizeof(datatype) >= 2) ? (is_signed(datatype) ? INT16_MIN : 0) : \
+   (is_signed(datatype) ? INT8_MIN : 0) \
 )
 
 #endif /* _LINUX_KERNEL_H_ */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r362781 - head/sys/compat/linuxkpi/common/include/linux

2020-06-30 Thread Hans Petter Selasky

On 2020-06-29 22:32, Ian Lepore wrote:

On Mon, 2020-06-29 at 14:26 -0600, Warner Losh wrote:

On Mon, Jun 29, 2020, 2:15 PM Ravi Pokala 
wrote:


-Original Message-
From:  on behalf of Hans Petter
Selasky

Date: 2020-06-29, Monday at 06:08
To: , , <
svn-src-head@freebsd.org>
Subject: svn commit: r362781 -
head/sys/compat/linuxkpi/common/include/linux

 Author: hselasky
 Date: Mon Jun 29 13:08:40 2020
 New Revision: 362781
 URL: https://svnweb.freebsd.org/changeset/base/362781

 Log:
   Implement is_signed(), type_max() and type_min() function
macros in
the
   LinuxKPI.

   MFC after:1 week
   Sponsored by: Mellanox Technologies

 Modified:
   head/sys/compat/linuxkpi/common/include/linux/kernel.h

 Modified:
head/sys/compat/linuxkpi/common/include/linux/kernel.h

===
===
 --- head/sys/compat/linuxkpi/common/include/linux/kernel.h  Mon
Jun 29
12:59:09 2020(r362780)
 +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h  Mon
Jun 29
13:08:40 2020(r362781)
 @@ -564,4 +564,20 @@ linux_ratelimited(linux_ratelimit_t *rl)
  #define__is_constexpr(x) \
 __builtin_constant_p(x)

Hi Hans,

 +#defineis_signed(x) (((x)-1 / (x)2) == (x)0)

It took me several reads to understand this, until I figured out
that 'x'
is not a variable, it's the name of a *type*.

If 'x' is a variable, then '(x)-1' is subtraction, but '(x)2' and
'(x)0'
are nonsensical.

If 'x' is a *type*, then '(x)-1' is typecasting '-1', and similarly
for
'(x)2' and '(x)0'.

So, perhaps a comment, or a better name for 'x'?



I had similar thoughts. Maybe 't' instead?



Or maybe since there's no one-character restriction on macro variable
names, something actually descriptive like 'datatype'.

-- Ian


Warner

Thanks,


Ravi (rpokala@)



Thanks for the feedback. I'll have a look at using a more descriptive 
name there for the macro argument.


--HPS

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362791 - head/release/tools

2020-06-30 Thread Colin Percival
Author: cperciva
Date: Tue Jun 30 06:14:34 2020
New Revision: 362791
URL: https://svnweb.freebsd.org/changeset/base/362791

Log:
  Make EC2 AMIs use portsnap and freebsd-update mirrors hosted in AWS
  
  This adjusts freebsd-update.conf and portsnap.conf files in EC2 AMIs to
  point at the new AWS-hosted mirror network.
  
  Approved by:  re (delphij)
  MFC after:1 month
  Differential Revision:https://reviews.freebsd.org/D25498

Modified:
  head/release/tools/ec2.conf

Modified: head/release/tools/ec2.conf
==
--- head/release/tools/ec2.conf Mon Jun 29 22:12:23 2020(r362790)
+++ head/release/tools/ec2.conf Tue Jun 30 06:14:34 2020(r362791)
@@ -108,6 +108,12 @@ vm_extra_pre_umount() {
's/^#ChallengeResponseAuthentication 
yes/ChallengeResponseAuthentication no/' \
${DESTDIR}/etc/ssh/sshd_config
 
+   # Use FreeBSD Update and Portsnap mirrors hosted in AWS
+   sed -i '' -e 's/update.FreeBSD.org/aws.update.FreeBSD.org/' \
+   ${DESTDIR}/etc/freebsd-update.conf
+   sed -i '' -e 's/portsnap.FreeBSD.org/aws.portsnap.FreeBSD.org/' \
+   ${DESTDIR}/etc/portsnap.conf
+
# Use the NTP service provided by Amazon
sed -i '' -e 's/^pool/#pool/' \
-e '1,/^#server/s/^#server.*/server 169.254.169.123 iburst/' \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"