svn commit: r358061 - head/share/vt/keymaps

2020-02-17 Thread Hiroki Sato
Author: hrs
Date: Tue Feb 18 01:50:44 2020
New Revision: 358061
URL: https://svnweb.freebsd.org/changeset/base/358061

Log:
  Use 0x5c for the scan code 0x7d.
  
  Japanese keyboards traditionally use 0x5c for
  both Japanese yen sign key and backslash key.
  While a Japanese yen sign is depicted on the keytop,
  most of Japanese expect that the scan code 0x7d gives
  a backslash (0x5c), not a Japanese yen sign (0xa5).
  
  This is because JIS X 0201 encoding (aka ISO/IEC 646-JA,
  an extended version of ASCII which is very popular
  in Japan) has Japanese yen sign at 0x5c and
  no backslash.  On the other hand, ISO/IEC 8859-1
  has Japanese yen sign at 0xa5.  This difference has
  caused a confusion after Unicode became popular since
  ISO/IEC 10646 adopted 8859-1 for the plane 0.
  
  MFC after:1 week

Modified:
  head/share/vt/keymaps/jp.capsctrl.kbd
  head/share/vt/keymaps/jp.kbd

Modified: head/share/vt/keymaps/jp.capsctrl.kbd
==
--- head/share/vt/keymaps/jp.capsctrl.kbd   Tue Feb 18 01:21:56 2020
(r358060)
+++ head/share/vt/keymaps/jp.capsctrl.kbd   Tue Feb 18 01:50:44 2020
(r358061)
@@ -117,4 +117,4 @@
   115   '\''_'fs us '\''_'fs us  O
   121   ' '' 'nul' '' '' 'susp   ' ' O
   123   ' '' 'nul' '' '' 'susp   ' ' O
-  125   0xa5   '|'fs us 0xa5   '|'fs us  O
+  125   '\''|'fs us 0xa5   '|'fs us  O

Modified: head/share/vt/keymaps/jp.kbd
==
--- head/share/vt/keymaps/jp.kbdTue Feb 18 01:21:56 2020
(r358060)
+++ head/share/vt/keymaps/jp.kbdTue Feb 18 01:50:44 2020
(r358061)
@@ -115,4 +115,4 @@
   115   '\''_'fs us '\''_'fs us  O
   121   ' '' 'nul' '' '' 'susp   ' ' O
   123   ' '' 'nul' '' '' 'susp   ' ' O
-  125   0xa5   '|'fs us 0xa5   '|'fs us  O
+  125   '\''|'fs us 0xa5   '|'fs us  O
___
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-unsubscr...@freebsd.org"


svn commit: r358060 - in stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys

2020-02-17 Thread Alexander Motin
Author: mav
Date: Tue Feb 18 01:21:56 2020
New Revision: 358060
URL: https://svnweb.freebsd.org/changeset/base/358060

Log:
  MFC r357502: Few microoptimizations to dbuf layer.
  
  Move db_link into the same cache line as db_blkid and db_level.
  It allows significantly reduce avl_add() time in dbuf_create() on
  systems with large RAM and huge number of dbufs per dnode.
  
  Avoid few accesses to dbuf_caches[].size, which is highly congested
  under high IOPS and never stays in cache for a long time.  Use local
  value we are receiving from zfs_refcount_add_many() any way.
  
  Remove cache_size_bytes_max bump from dbuf_evict_one().  I don't see
  a point to do it on dbuf eviction after we done it on insertion in
  dbuf_rele_and_unlock().

Modified:
  stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
  stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
==
--- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Tue Feb 
18 01:19:32 2020(r358059)
+++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Tue Feb 
18 01:21:56 2020(r358060)
@@ -671,13 +671,6 @@ dbuf_cache_lowater_bytes(void)
 }
 
 static inline boolean_t
-dbuf_cache_above_hiwater(void)
-{
-   return (zfs_refcount_count(_caches[DB_DBUF_CACHE].size) >
-   dbuf_cache_hiwater_bytes());
-}
-
-static inline boolean_t
 dbuf_cache_above_lowater(void)
 {
return (zfs_refcount_count(_caches[DB_DBUF_CACHE].size) >
@@ -717,8 +710,6 @@ dbuf_evict_one(void)
ASSERT3U(db->db_caching_status, ==, DB_DBUF_CACHE);
db->db_caching_status = DB_NO_CACHE;
dbuf_destroy(db);
-   DBUF_STAT_MAX(cache_size_bytes_max,
-   zfs_refcount_count(_caches[DB_DBUF_CACHE].size));
DBUF_STAT_BUMP(cache_total_evicts);
} else {
multilist_sublist_unlock(mls);
@@ -778,16 +769,15 @@ dbuf_evict_thread(void *unused __unused)
  * dbuf cache using the callers context.
  */
 static void
-dbuf_evict_notify(void)
+dbuf_evict_notify(uint64_t size)
 {
/*
 * We check if we should evict without holding the dbuf_evict_lock,
 * because it's OK to occasionally make the wrong decision here,
 * and grabbing the lock results in massive lock contention.
 */
-   if (zfs_refcount_count(_caches[DB_DBUF_CACHE].size) >
-   dbuf_cache_max_bytes) {
-   if (dbuf_cache_above_hiwater())
+   if (size > dbuf_cache_max_bytes) {
+   if (size > dbuf_cache_hiwater_bytes())
dbuf_evict_one();
cv_signal(_evict_cv);
}
@@ -3186,6 +3176,7 @@ void
 dbuf_rele_and_unlock(dmu_buf_impl_t *db, void *tag, boolean_t evicting)
 {
int64_t holds;
+   uint64_t size;
 
ASSERT(MUTEX_HELD(>db_mtx));
DBUF_VERIFY(db);
@@ -3282,15 +3273,14 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, void *tag, bo
db->db_caching_status = dcs;
 
multilist_insert(dbuf_caches[dcs].cache, db);
-   (void) zfs_refcount_add_many(
+   size = zfs_refcount_add_many(
_caches[dcs].size, db->db.db_size, db);
 
if (dcs == DB_DBUF_METADATA_CACHE) {
DBUF_STAT_BUMP(metadata_cache_count);
DBUF_STAT_MAX(
metadata_cache_size_bytes_max,
-   zfs_refcount_count(
-   _caches[dcs].size));
+   size);
} else {
DBUF_STAT_BUMP(
cache_levels[db->db_level]);
@@ -3299,15 +3289,12 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, void *tag, bo
cache_levels_bytes[db->db_level],
db->db.db_size);
DBUF_STAT_MAX(cache_size_bytes_max,
-   zfs_refcount_count(
-   _caches[dcs].size));
+   size);
}
mutex_exit(>db_mtx);
 
-   if (db->db_caching_status == DB_DBUF_CACHE &&
-   !evicting) {
-   dbuf_evict_notify();
-   }
+   if (dcs == DB_DBUF_CACHE && 

svn commit: r358059 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2020-02-17 Thread Alexander Motin
Author: mav
Date: Tue Feb 18 01:19:32 2020
New Revision: 358059
URL: https://svnweb.freebsd.org/changeset/base/358059

Log:
  MFC r357453: Unblock kstat.zfs.misc.dbufstats sysctls.
  
  It is not so much broken to hide it after we wasted time to collect it.

Modified:
  stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
==
--- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Tue Feb 
18 00:02:20 2020(r358058)
+++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Tue Feb 
18 01:19:32 2020(r358059)
@@ -747,6 +747,10 @@ dbuf_evict_thread(void *unused __unused)
(void) cv_timedwait_hires(_evict_cv,
_evict_lock, SEC2NSEC(1), MSEC2NSEC(1), 0);
CALLB_CPR_SAFE_END(, _evict_lock);
+#ifdef __FreeBSD__
+   if (dbuf_ksp != NULL)
+   dbuf_ksp->ks_update(dbuf_ksp, KSTAT_READ);
+#endif
}
mutex_exit(_evict_lock);
 
@@ -880,18 +884,10 @@ retry:
dbuf_cache_evict_thread = thread_create(NULL, 0, dbuf_evict_thread,
NULL, 0, , TS_RUN, minclsyspri);
 
-#ifdef __linux__
-   /*
-* XXX FreeBSD's SPL lacks KSTAT_TYPE_NAMED support - TODO 
-*/
dbuf_ksp = kstat_create("zfs", 0, "dbufstats", "misc",
KSTAT_TYPE_NAMED, sizeof (dbuf_stats) / sizeof (kstat_named_t),
KSTAT_FLAG_VIRTUAL);
if (dbuf_ksp != NULL) {
-   dbuf_ksp->ks_data = _stats;
-   dbuf_ksp->ks_update = dbuf_kstat_update;
-   kstat_install(dbuf_ksp);
-
for (i = 0; i < DN_MAX_LEVELS; i++) {
snprintf(dbuf_stats.cache_levels[i].name,
KSTAT_STRLEN, "cache_level_%d", i);
@@ -902,8 +898,10 @@ retry:
dbuf_stats.cache_levels_bytes[i].data_type =
KSTAT_DATA_UINT64;
}
+   dbuf_ksp->ks_data = _stats;
+   dbuf_ksp->ks_update = dbuf_kstat_update;
+   kstat_install(dbuf_ksp);
}
-#endif 
 }
 
 void
___
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-unsubscr...@freebsd.org"


Re: svn commit: r358013 - in head/sys: net netinet netinet6

2020-02-17 Thread Gleb Smirnoff
On Mon, Feb 17, 2020 at 09:46:32AM +, Hans Petter Selasky wrote:
H> Author: hselasky
H> Date: Mon Feb 17 09:46:32 2020
H> New Revision: 358013
H> URL: https://svnweb.freebsd.org/changeset/base/358013
H> 
H> Log:
H>   Fix kernel panic while trying to read multicast stream.
H>   
H>   When VIMAGE is enabled make sure the "m_pkthdr.rcvif" pointer is set
H>   for all mbufs being input by the IGMP/MLD6 code. Else there will be a
H>   NULL-pointer dereference in the netisr code when trying to set the
H>   VNET based on the incoming mbuf. Add an assert to catch this when
H>   queueing mbufs on a netisr to make debugging of similar cases easier.
H>   
H>   Found by:  Vladislav V. Prodan
H>   PR:244002
H>   Reviewed by:   bz@
H>   MFC after: 1 week
H>   Sponsored by:  Mellanox Technologies
H> 
H> Modified:
H>   head/sys/net/netisr.c
H>   head/sys/netinet/igmp.c
H>   head/sys/netinet6/mld6.c
H> 
H> Modified: head/sys/net/netisr.c
H> 
==
H> --- head/sys/net/netisr.cMon Feb 17 01:59:55 2020(r358012)
H> +++ head/sys/net/netisr.cMon Feb 17 09:46:32 2020(r358013)
H> @@ -1056,6 +1056,8 @@ netisr_queue_src(u_int proto, uintptr_t source, struct
H>  if (m != NULL) {
H>  KASSERT(!CPU_ABSENT(cpuid), ("%s: CPU %u absent", __func__,
H>  cpuid));
H> +VNET_ASSERT(m->m_pkthdr.rcvif != NULL,
H> +("%s:%d rcvif == NULL: m=%p", __func__, __LINE__, m));
H>  error = netisr_queue_internal(proto, m, cpuid);
H>  } else
H>  error = ENOBUFS;
H> 
H> Modified: head/sys/netinet/igmp.c
H> 
==
H> --- head/sys/netinet/igmp.c  Mon Feb 17 01:59:55 2020(r358012)
H> +++ head/sys/netinet/igmp.c  Mon Feb 17 09:46:32 2020(r358013)
H> @@ -303,6 +303,7 @@ igmp_save_context(struct mbuf *m, struct ifnet *ifp)
H>  #ifdef VIMAGE
H>  m->m_pkthdr.PH_loc.ptr = ifp->if_vnet;
H>  #endif /* VIMAGE */
H> +m->m_pkthdr.rcvif = ifp;
H>  m->m_pkthdr.flowid = ifp->if_index;
H>  }
H>  
H> 
H> Modified: head/sys/netinet6/mld6.c
H> 
==
H> --- head/sys/netinet6/mld6.c Mon Feb 17 01:59:55 2020(r358012)
H> +++ head/sys/netinet6/mld6.c Mon Feb 17 09:46:32 2020(r358013)
H> @@ -283,6 +283,7 @@ mld_save_context(struct mbuf *m, struct ifnet *ifp)
H>  #ifdef VIMAGE
H>  m->m_pkthdr.PH_loc.ptr = ifp->if_vnet;
H>  #endif /* VIMAGE */
H> +m->m_pkthdr.rcvif = ifp;
H>  m->m_pkthdr.flowid = ifp->if_index;
H>  }

This functions igmp_save_context() and mld_save_context() were clearly
designed to avoid dereferencing an ifnet pointer after a packet has been
queued and dequeued on IGMP/MLD internal queue.

This patch now replicates the exactly same problem but with netisr
queue. Of course netisr not always queues, sometimes dispatches
directly, but it may do queue.

I think same thing needs to be done to netisr internally - don't
dereference m->m_pkthdr.rcvif on dequeued packets, but store the
vnet info in the m->m_pkthdr.PH_loc.ptr before queueing.

-- 
Gleb Smirnoff
___
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-unsubscr...@freebsd.org"


svn commit: r358058 - head/sys/amd64/amd64

2020-02-17 Thread Chuck Silvers
Author: chs
Date: Tue Feb 18 00:02:20 2020
New Revision: 358058
URL: https://svnweb.freebsd.org/changeset/base/358058

Log:
  amd64: keep PTE bitmasks in sync with target pmap during pv reclaim
  
  in reclaim_pv_chunk_domain(), when we switch to a new target pmap from which
  we are trying to reclaim a pv chunk, always update the current PTE bitmasks
  to match.
  
  Reviewed by:  kib, markj
  Approved by:  imp (mentor)
  Sponsored by: Netflix

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Tue Feb 18 00:01:18 2020(r358057)
+++ head/sys/amd64/amd64/pmap.c Tue Feb 18 00:02:20 2020(r358058)
@@ -4298,7 +4298,7 @@ reclaim_pv_chunk_domain(pmap_t locked_pmap, struct rwl
struct spglist free;
uint64_t inuse;
int bit, field, freed;
-   bool start_di;
+   bool start_di, restart;
 
PMAP_LOCK_ASSERT(locked_pmap, MA_OWNED);
KASSERT(lockp != NULL, ("reclaim_pv_chunk: lockp is NULL"));
@@ -4343,6 +4343,7 @@ reclaim_pv_chunk_domain(pmap_t locked_pmap, struct rwl
 * corresponding pmap is locked.
 */
if (pmap != next_pmap) {
+   restart = false;
reclaim_pv_chunk_leave_pmap(pmap, locked_pmap,
start_di);
pmap = next_pmap;
@@ -4353,13 +4354,13 @@ reclaim_pv_chunk_domain(pmap_t locked_pmap, struct rwl
if (start_di)
pmap_delayed_invl_start();
mtx_lock(>pvc_lock);
-   continue;
+   restart = true;
} else if (pmap != locked_pmap) {
if (PMAP_TRYLOCK(pmap)) {
if (start_di)
pmap_delayed_invl_start();
mtx_lock(>pvc_lock);
-   continue;
+   restart = true;
} else {
pmap = NULL; /* pmap is not locked */
mtx_lock(>pvc_lock);
@@ -4375,6 +4376,8 @@ reclaim_pv_chunk_domain(pmap_t locked_pmap, struct rwl
PG_A = pmap_accessed_bit(pmap);
PG_M = pmap_modified_bit(pmap);
PG_RW = pmap_rw_bit(pmap);
+   if (restart)
+   continue;
}
 
/*
___
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-unsubscr...@freebsd.org"


svn commit: r358057 - stable/12/share/misc

2020-02-17 Thread Ryan Moeller
Author: freqlabs
Date: Tue Feb 18 00:01:18 2020
New Revision: 358057
URL: https://svnweb.freebsd.org/changeset/base/358057

Log:
  MFC r357850:
  Add myself (freqlabs) as a src committer
  
  Approved by:mav (mentor)

Modified:
  stable/12/share/misc/committers-src.dot
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/misc/committers-src.dot
==
--- stable/12/share/misc/committers-src.dot Mon Feb 17 21:33:58 2020
(r358056)
+++ stable/12/share/misc/committers-src.dot Tue Feb 18 00:01:18 2020
(r358057)
@@ -171,6 +171,7 @@ fabient [label="Fabien Thomas\nfabi...@freebsd.org\n20
 fanf [label="Tony Finch\nf...@freebsd.org\n2002/05/05"]
 fjoe [label="Max Khon\nf...@freebsd.org\n2001/08/06"]
 flz [label="Florent Thoumie\n...@freebsd.org\n2006/03/30"]
+freqlabs [label="Ryan Moeller\nfreql...@freebsd.org\n2020/02/10"]
 fsu [label="Fedor Uporov\n...@freebsd.org\n2017/08/28"]
 gabor [label="Gabor Kovesdan\nga...@freebsd.org\n2010/02/02"]
 gad [label="Garance A. Drosehn\n...@freebsd.org\n2000/10/27"]
@@ -697,6 +698,7 @@ markm -> sheldonh
 
 mav -> ae
 mav -> eugen
+mav -> freqlabs
 mav -> ram
 
 mdf -> gleb
@@ -709,6 +711,8 @@ mlaier -> benjsc
 mlaier -> dhartmei
 mlaier -> thompsa
 mlaier -> eri
+
+mmacy -> freqlabs
 
 msmith -> cokane
 msmith -> jasone
___
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-unsubscr...@freebsd.org"


svn commit: r358048 - head/contrib/capsicum-test

2020-02-17 Thread Li-Wen Hsu
Author: lwhsu
Date: Mon Feb 17 20:25:33 2020
New Revision: 358048
URL: https://svnweb.freebsd.org/changeset/base/358048

Log:
  Really skip the tests in capsicum tests
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/contrib/capsicum-test/capsicum-test.h

Modified: head/contrib/capsicum-test/capsicum-test.h
==
--- head/contrib/capsicum-test/capsicum-test.h  Mon Feb 17 20:25:29 2020
(r358047)
+++ head/contrib/capsicum-test/capsicum-test.h  Mon Feb 17 20:25:33 2020
(r358048)
@@ -248,6 +248,7 @@ void TestSkipped(const char *testcase, const char *tes
 const ::testing::TestInfo* const info = 
::testing::UnitTest::GetInstance()->current_test_info(); \
 std::cerr << "Skipping " << info->test_case_name() << "::" << info->name() 
<< " because: " << reason << std::endl; \
 TestSkipped(info->test_case_name(), info->name(), reason);  \
+GTEST_SKIP(); \
   } while (0)
 
 // Mark a test that can only be run as root.
___
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-unsubscr...@freebsd.org"


svn commit: r358046 - head/lib/libc/quad

2020-02-17 Thread Dimitry Andric
Author: dim
Date: Mon Feb 17 20:24:21 2020
New Revision: 358046
URL: https://svnweb.freebsd.org/changeset/base/358046

Log:
  Merge r358042 from the clang1000-import branch:
  
  Add casts and L suffixes to libc quad support, to work around various
  -Werror warnings from clang 10.0.0, such as:
  
  lib/libc/quad/fixdfdi.c:57:12: error: implicit conversion from 'long long' to 
'double' changes value from 9223372036854775807 to 9223372036854775808 
[-Werror,-Wimplicit-int-float-conversion]
  if (x >= QUAD_MAX)
~~ ^~~~
  /usr/obj/usr/src/powerpc.powerpc/tmp/usr/include/sys/limits.h:89:19: note: 
expanded from macro 'QUAD_MAX'
  #define QUAD_MAX(__QUAD_MAX)/* max value for a quad_t */
   ^~
  /usr/obj/usr/src/powerpc.powerpc/tmp/usr/include/machine/_limits.h:91:20: 
note: expanded from macro '__QUAD_MAX'
  #define __QUAD_MAX  __LLONG_MAX /* max value for a quad_t */
  ^~~
  /usr/obj/usr/src/powerpc.powerpc/tmp/usr/include/machine/_limits.h:75:21: 
note: expanded from macro '__LLONG_MAX'
  #define __LLONG_MAX 0x7fffLL/* max value for a long long 
*/
  ^~~~
  
  and many instances of:
  
  lib/libc/quad/fixunsdfdi.c:73:17: error: shift count >= width of type 
[-Werror,-Wshift-count-overflow]
  toppart = (x - ONE_HALF) / ONE;
 ^~~~
  lib/libc/quad/fixunsdfdi.c:45:19: note: expanded from macro 'ONE_HALF'
  #define ONE_HALF(ONE_FOURTH * 2.0)
   ^~
  lib/libc/quad/fixunsdfdi.c:44:23: note: expanded from macro 'ONE_FOURTH'
  #define ONE_FOURTH  (1 << (LONG_BITS - 2))
 ^  ~~~
  lib/libc/quad/fixunsdfdi.c:73:29: error: shift count >= width of type 
[-Werror,-Wshift-count-overflow]
  toppart = (x - ONE_HALF) / ONE;
 ^~~
  lib/libc/quad/fixunsdfdi.c:46:15: note: expanded from macro 'ONE'
  #define ONE (ONE_FOURTH * 4.0)
   ^~
  lib/libc/quad/fixunsdfdi.c:44:23: note: expanded from macro 'ONE_FOURTH'
  #define ONE_FOURTH  (1 << (LONG_BITS - 2))
 ^  ~~~
  
  MFC after:3 days

Modified:
  head/lib/libc/quad/fixdfdi.c
  head/lib/libc/quad/fixsfdi.c
  head/lib/libc/quad/fixunsdfdi.c
  head/lib/libc/quad/fixunssfdi.c
  head/lib/libc/quad/floatdidf.c
  head/lib/libc/quad/floatdisf.c
  head/lib/libc/quad/floatunsdidf.c
  head/lib/libc/quad/qdivrem.c
  head/lib/libc/quad/quad.h
Directory Properties:
  head/   (props changed)

Modified: head/lib/libc/quad/fixdfdi.c
==
--- head/lib/libc/quad/fixdfdi.cMon Feb 17 20:23:26 2020
(r358045)
+++ head/lib/libc/quad/fixdfdi.cMon Feb 17 20:24:21 2020
(r358046)
@@ -49,12 +49,12 @@ quad_t
 __fixdfdi(double x)
 {
if (x < 0)
-   if (x <= QUAD_MIN)
+   if (x <= (double)QUAD_MIN)
return (QUAD_MIN);
else
return ((quad_t)-(u_quad_t)-x);
else
-   if (x >= QUAD_MAX)
+   if (x >= (double)QUAD_MAX)
return (QUAD_MAX);
else
return ((quad_t)(u_quad_t)x);

Modified: head/lib/libc/quad/fixsfdi.c
==
--- head/lib/libc/quad/fixsfdi.cMon Feb 17 20:23:26 2020
(r358045)
+++ head/lib/libc/quad/fixsfdi.cMon Feb 17 20:24:21 2020
(r358046)
@@ -51,12 +51,12 @@ long long
 __fixsfdi(float x)
 {
if (x < 0)
-   if (x <= QUAD_MIN)
+   if (x <= (float)QUAD_MIN)
return (QUAD_MIN);
else
return ((quad_t)-(u_quad_t)-x);
else
-   if (x >= QUAD_MAX)
+   if (x >= (float)QUAD_MAX)
return (QUAD_MAX);
else
return ((quad_t)(u_quad_t)x);

Modified: head/lib/libc/quad/fixunsdfdi.c
==
--- head/lib/libc/quad/fixunsdfdi.c Mon Feb 17 20:23:26 2020
(r358045)
+++ head/lib/libc/quad/fixunsdfdi.c Mon Feb 17 20:24:21 2020
(r358046)
@@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$");
 
 #include "quad.h"
 
-#defineONE_FOURTH  (1 << (LONG_BITS - 2))
+#defineONE_FOURTH  (1L << (LONG_BITS - 2))
 #defineONE_HALF(ONE_FOURTH * 2.0)
 #defineONE (ONE_FOURTH * 4.0)
 
@@ -84,11 +84,11 @@ __fixunsdfdi(double x)
x -= (double)t.uq;
if (x < 0) {
t.ul[H]--;
-   x += ULONG_MAX;
+   x += (double)ULONG_MAX;
}
-   if (x > 

svn commit: r358045 - head/sys/powerpc/conf/dpaa

2020-02-17 Thread Dimitry Andric
Author: dim
Date: Mon Feb 17 20:23:26 2020
New Revision: 358045
URL: https://svnweb.freebsd.org/changeset/base/358045

Log:
  Merge r358034 from the clang1000-import branch:
  
  Disable new clang 10.0.0 warnings about misleading indentation in
  sys/contrib/ncsw/Peripherals/FM/fman_ncsw.c.
  
  This is horribly formatted contributed code, and fixing it is not worth
  the effort.
  
  MFC after:3 days

Modified:
  head/sys/powerpc/conf/dpaa/files.dpaa
Directory Properties:
  head/   (props changed)

Modified: head/sys/powerpc/conf/dpaa/files.dpaa
==
--- head/sys/powerpc/conf/dpaa/files.dpaa   Mon Feb 17 20:22:10 2020
(r358044)
+++ head/sys/powerpc/conf/dpaa/files.dpaa   Mon Feb 17 20:23:26 2020
(r358045)
@@ -74,7 +74,7 @@ contrib/ncsw/Peripherals/FM/fm_muram.c
optional dpaa
 contrib/ncsw/Peripherals/FM/fm_ncsw.c  optional dpaa   \
no-depend compile-with "${DPAA_COMPILE_CMD}"
 contrib/ncsw/Peripherals/FM/fman_ncsw.coptional dpaa   
\
-   no-depend compile-with "${DPAA_COMPILE_CMD}"
+   no-depend compile-with "${DPAA_COMPILE_CMD} 
${NO_WMISLEADING_INDENTATION}"
 contrib/ncsw/Peripherals/QM/qm.c   optional dpaa   \
no-depend compile-with "${DPAA_COMPILE_CMD}"
 contrib/ncsw/Peripherals/QM/qm_portal_fqr.coptional dpaa   \
___
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-unsubscr...@freebsd.org"


svn commit: r358044 - head/sys/arm/allwinner

2020-02-17 Thread Dimitry Andric
Author: dim
Date: Mon Feb 17 20:22:10 2020
New Revision: 358044
URL: https://svnweb.freebsd.org/changeset/base/358044

Log:
  Merge r358030 from the clang1000-import branch:
  
  Work around new clang 10.0.0 -Werror warning:
  
  sys/arm/allwinner/aw_cir.c:208:41: error: converting the result of '<<' to a 
boolean; did you mean '((1 & 255) << 23) != 0'? [-Werror,-Wint-in-bool-context]
  active_delay = (AW_IR_ACTIVE_T + 1) * (AW_IR_ACTIVE_T_C ? 128 : 1);
 ^
  sys/arm/allwinner/aw_cir.c:130:39: note: expanded from macro 
'AW_IR_ACTIVE_T_C'
  #define AW_IR_ACTIVE_T_C((1 & 0xff) << 23)
  ^
  
  Add the != 0 part to indicate that we indeed want to compare against
  zero.
  
  MFC after:3 days

Modified:
  head/sys/arm/allwinner/aw_cir.c
Directory Properties:
  head/   (props changed)

Modified: head/sys/arm/allwinner/aw_cir.c
==
--- head/sys/arm/allwinner/aw_cir.c Mon Feb 17 20:19:43 2020
(r358043)
+++ head/sys/arm/allwinner/aw_cir.c Mon Feb 17 20:22:10 2020
(r358044)
@@ -205,7 +205,7 @@ aw_ir_decode_packets(struct aw_ir_softc *sc)
device_printf(sc->dev, "sc->dcnt = %d\n", sc->dcnt);
 
/* Find Lead 1 (bit separator) */
-   active_delay = (AW_IR_ACTIVE_T + 1) * (AW_IR_ACTIVE_T_C ? 128 : 1);
+   active_delay = (AW_IR_ACTIVE_T + 1) * (AW_IR_ACTIVE_T_C != 0 ? 128 : 1);
len = 0;
len += (active_delay >> 1);
if (bootverbose)
___
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-unsubscr...@freebsd.org"


svn commit: r358041 - head/sys/dev/altera/sdcard

2020-02-17 Thread Scott Long
Author: scottl
Date: Mon Feb 17 20:12:34 2020
New Revision: 358041
URL: https://svnweb.freebsd.org/changeset/base/358041

Log:
  Fix syntax error from r357647.  Adjust a variable name to make the use more
  clear.
  
  Reported by:  dim

Modified:
  head/sys/dev/altera/sdcard/altera_sdcard_io.c

Modified: head/sys/dev/altera/sdcard/altera_sdcard_io.c
==
--- head/sys/dev/altera/sdcard/altera_sdcard_io.c   Mon Feb 17 20:09:06 
2020(r358040)
+++ head/sys/dev/altera/sdcard/altera_sdcard_io.c   Mon Feb 17 20:12:34 
2020(r358041)
@@ -293,27 +293,31 @@ recheck:
 }
 
 static void
-altera_sdcard_io_start_internal(struct altera_sdcard_softc *sc, struct bio 
**bp)
+altera_sdcard_io_start_internal(struct altera_sdcard_softc *sc,
+struct bio **bpp)
 {
+   struct bio *bp;
 
-   switch (*bp->bio_cmd) {
+   bp = *bpp;
+
+   switch (bp->bio_cmd) {
case BIO_READ:
-   altera_sdcard_write_cmd_arg(sc, *bp->bio_pblkno *
+   altera_sdcard_write_cmd_arg(sc, bp->bio_pblkno *
ALTERA_SDCARD_SECTORSIZE);
altera_sdcard_write_cmd(sc, ALTERA_SDCARD_CMD_READ_BLOCK);
break;
 
case BIO_WRITE:
-   altera_sdcard_write_rxtx_buffer(sc, *bp->bio_data,
-   *bp->bio_bcount);
-   altera_sdcard_write_cmd_arg(sc, *bp->bio_pblkno *
+   altera_sdcard_write_rxtx_buffer(sc, bp->bio_data,
+   bp->bio_bcount);
+   altera_sdcard_write_cmd_arg(sc, bp->bio_pblkno *
ALTERA_SDCARD_SECTORSIZE);
altera_sdcard_write_cmd(sc, ALTERA_SDCARD_CMD_WRITE_BLOCK);
break;
 
default:
-   biofinish(*bp, NULL, EOPNOTSUPP);
-   *bp = NULL;
+   biofinish(bp, NULL, EOPNOTSUPP);
+   *bpp = NULL;
}
 }
 
@@ -333,7 +337,7 @@ altera_sdcard_io_start(struct altera_sdcard_softc *sc,
KASSERT(bp->bio_bcount == ALTERA_SDCARD_SECTORSIZE,
("%s: I/O size not %d", __func__, ALTERA_SDCARD_SECTORSIZE));
altera_sdcard_io_start_internal(sc, );
-   sc->as_currentbio = *bp;
+   sc->as_currentbio = bp;
sc->as_retriesleft = ALTERA_SDCARD_RETRY_LIMIT;
 }
 
___
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-unsubscr...@freebsd.org"


svn commit: r358037 - stable/11/sys/fs/nfsserver

2020-02-17 Thread Rick Macklem
Author: rmacklem
Date: Mon Feb 17 19:40:26 2020
New Revision: 358037
URL: https://svnweb.freebsd.org/changeset/base/358037

Log:
  MFC: r357149
  Fix a crash in the NFSv4 server.
  
  The PR reported a crash that occurred when a file was removed while
  client(s) were actively doing lock operations on it.
  Since nfsvno_getvp() will return NULL when the file does not exist,
  the bug was obvious and easy to fix via this patch. It is a little
  surprising that this wasn't found sooner, but I guess the above
  case rarely occurs.
  
  PR:   242768

Modified:
  stable/11/sys/fs/nfsserver/nfs_nfsdstate.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/fs/nfsserver/nfs_nfsdstate.c
==
--- stable/11/sys/fs/nfsserver/nfs_nfsdstate.c  Mon Feb 17 19:32:54 2020
(r358036)
+++ stable/11/sys/fs/nfsserver/nfs_nfsdstate.c  Mon Feb 17 19:40:26 2020
(r358037)
@@ -1483,7 +1483,8 @@ nfsrv_freeallnfslocks(struct nfsstate *stp, vnode_t vp
tvp = NULL;
else if (vp == NULL && cansleep != 0) {
tvp = nfsvno_getvp(>lf_fh);
-   NFSVOPUNLOCK(tvp, 0);
+   if (tvp != NULL)
+   NFSVOPUNLOCK(tvp, 0);
} else
tvp = vp;
gottvp = 1;
___
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-unsubscr...@freebsd.org"


svn commit: r358036 - stable/12/sys/fs/nfsserver

2020-02-17 Thread Rick Macklem
Author: rmacklem
Date: Mon Feb 17 19:32:54 2020
New Revision: 358036
URL: https://svnweb.freebsd.org/changeset/base/358036

Log:
  MFC: r357149
  Fix a crash in the NFSv4 server.
  
  The PR reported a crash that occurred when a file was removed while
  client(s) were actively doing lock operations on it.
  Since nfsvno_getvp() will return NULL when the file does not exist,
  the bug was obvious and easy to fix via this patch. It is a little
  surprising that this wasn't found sooner, but I guess the above
  case rarely occurs.
  
  PR:   242768

Modified:
  stable/12/sys/fs/nfsserver/nfs_nfsdstate.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/fs/nfsserver/nfs_nfsdstate.c
==
--- stable/12/sys/fs/nfsserver/nfs_nfsdstate.c  Mon Feb 17 19:31:34 2020
(r358035)
+++ stable/12/sys/fs/nfsserver/nfs_nfsdstate.c  Mon Feb 17 19:32:54 2020
(r358036)
@@ -1555,7 +1555,8 @@ nfsrv_freeallnfslocks(struct nfsstate *stp, vnode_t vp
tvp = NULL;
else if (vp == NULL && cansleep != 0) {
tvp = nfsvno_getvp(>lf_fh);
-   NFSVOPUNLOCK(tvp, 0);
+   if (tvp != NULL)
+   NFSVOPUNLOCK(tvp, 0);
} else
tvp = vp;
gottvp = 1;
___
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-unsubscr...@freebsd.org"


svn commit: r358035 - stable/10/sys/fs/nfsserver

2020-02-17 Thread Rick Macklem
Author: rmacklem
Date: Mon Feb 17 19:31:34 2020
New Revision: 358035
URL: https://svnweb.freebsd.org/changeset/base/358035

Log:
  MFC: r357149
  Fix a crash in the NFSv4 server.
  
  The PR reported a crash that occurred when a file was removed while
  client(s) were actively doing lock operations on it.
  Since nfsvno_getvp() will return NULL when the file does not exist,
  the bug was obvious and easy to fix via this patch. It is a little
  surprising that this wasn't found sooner, but I guess the above
  case rarely occurs.
  
  PR:   242768

Modified:
  stable/10/sys/fs/nfsserver/nfs_nfsdstate.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/nfsserver/nfs_nfsdstate.c
==
--- stable/10/sys/fs/nfsserver/nfs_nfsdstate.c  Mon Feb 17 19:20:47 2020
(r358034)
+++ stable/10/sys/fs/nfsserver/nfs_nfsdstate.c  Mon Feb 17 19:31:34 2020
(r358035)
@@ -1488,7 +1488,8 @@ nfsrv_freeallnfslocks(struct nfsstate *stp, vnode_t vp
tvp = NULL;
else if (vp == NULL && cansleep != 0) {
tvp = nfsvno_getvp(>lf_fh);
-   NFSVOPUNLOCK(tvp, 0);
+   if (tvp != NULL)
+   NFSVOPUNLOCK(tvp, 0);
} else
tvp = vp;
gottvp = 1;
___
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-unsubscr...@freebsd.org"


svn commit: r358032 - stable/12/contrib/elftoolchain/addr2line

2020-02-17 Thread Mark Johnston
Author: markj
Date: Mon Feb 17 18:40:00 2020
New Revision: 358032
URL: https://svnweb.freebsd.org/changeset/base/358032

Log:
  MFC r357450, r357462:
  addr2line: Cache CU DIEs upon a successful address lookup.

Modified:
  stable/12/contrib/elftoolchain/addr2line/addr2line.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/elftoolchain/addr2line/addr2line.c
==
--- stable/12/contrib/elftoolchain/addr2line/addr2line.cMon Feb 17 
18:39:38 2020(r358031)
+++ stable/12/contrib/elftoolchain/addr2line/addr2line.cMon Feb 17 
18:40:00 2020(r358032)
@@ -25,6 +25,7 @@
  */
 
 #include 
+#include 
 
 #include 
 #include 
@@ -39,7 +40,6 @@
 #include 
 #include 
 
-#include "uthash.h"
 #include "_elftc.h"
 
 ELFTC_VCSID("$Id: addr2line.c 3544 2017-06-05 14:51:44Z emaste $");
@@ -57,13 +57,14 @@ struct Func {
 };
 
 struct CU {
+   RB_ENTRY(CU) entry;
Dwarf_Off off;
Dwarf_Unsigned lopc;
Dwarf_Unsigned hipc;
char **srcfiles;
Dwarf_Signed nsrcfiles;
STAILQ_HEAD(, Func) funclist;
-   UT_hash_handle hh;
+   Dwarf_Die die;
 };
 
 static struct option longopts[] = {
@@ -80,11 +81,23 @@ static struct option longopts[] = {
{"version", no_argument, NULL, 'V'},
{NULL, 0, NULL, 0}
 };
+
 static int demangle, func, base, inlines, print_addr, pretty_print;
 static char unknown[] = { '?', '?', '\0' };
 static Dwarf_Addr section_base;
-static struct CU *culist;
+/* Need a new curlopc that stores last lopc value. */
+static Dwarf_Unsigned curlopc = ~0ULL;
+static RB_HEAD(cutree, CU) cuhead = RB_INITIALIZER();
 
+static int
+lopccmp(struct CU *e1, struct CU *e2)
+{
+   return (e1->lopc < e2->lopc ? -1 : e1->lopc > e2->lopc);
+}
+
+RB_PROTOTYPE(cutree, CU, entry, lopccmp);
+RB_GENERATE(cutree, CU, entry, lopccmp)
+
 #defineUSAGE_MESSAGE   "\
 Usage: %s [options] hexaddress...\n\
   Map program addresses to source file names and line numbers.\n\n\
@@ -378,6 +391,26 @@ print_inlines(struct CU *cu, struct Func *f, Dwarf_Uns
f->call_line);
 }
 
+static struct CU *
+culookup(Dwarf_Unsigned addr)
+{
+   struct CU find, *res;
+
+   find.lopc = addr;
+   res = RB_NFIND(cutree, , );
+   if (res != NULL) {
+   if (res->lopc != addr)
+   res = RB_PREV(cutree, , res);
+   if (res != NULL && addr >= res->lopc && addr < res->hipc)
+   return (res);
+   } else {
+   res = RB_MAX(cutree, );
+   if (res != NULL && addr >= res->lopc && addr < res->hipc)
+   return (res);
+   }
+   return (NULL);
+}
+
 static void
 translate(Dwarf_Debug dbg, Elf *e, const char* addrstr)
 {
@@ -400,11 +433,30 @@ translate(Dwarf_Debug dbg, Elf *e, const char* addrstr
addr += section_base;
lineno = 0;
file = unknown;
-   cu = NULL;
die = NULL;
+   ret = DW_DLV_OK;
 
-   while ((ret = dwarf_next_cu_header(dbg, NULL, NULL, NULL, NULL, NULL,
-   )) ==  DW_DLV_OK) {
+   cu = culookup(addr);
+   if (cu != NULL) {
+   die = cu->die;
+   goto status_ok;
+   }
+
+   while (true) {
+   /*
+* We resume the CU scan from the last place we found a match.
+* Because when we have 2 sequential addresses, and the second
+* one is of the next CU, it is faster to just go to the next CU
+* instead of starting from the beginning.
+*/
+   ret = dwarf_next_cu_header(dbg, NULL, NULL, NULL, NULL, NULL,
+   );
+   if (ret == DW_DLV_NO_ENTRY) {
+   if (curlopc == ~0ULL)
+   goto out;
+   ret = dwarf_next_cu_header(dbg, NULL, NULL, NULL, NULL,
+   NULL, );
+   }
die = NULL;
while (dwarf_siblingof(dbg, die, _die, ) == DW_DLV_OK) {
if (die != NULL)
@@ -420,12 +472,15 @@ translate(Dwarf_Debug dbg, Elf *e, const char* addrstr
if (tag == DW_TAG_compile_unit)
break;
}
+
if (ret_die == NULL) {
warnx("could not find DW_TAG_compile_unit die");
goto next_cu;
}
if (dwarf_attrval_unsigned(die, DW_AT_low_pc, , ) ==
DW_DLV_OK) {
+   if (lopc == curlopc)
+   goto out;
if (dwarf_attrval_unsigned(die, DW_AT_high_pc, ,
   ) == DW_DLV_OK) {
/*
@@ -440,31 +495,27 @@ translate(Dwarf_Debug dbg, Elf *e, const char* addrstr
hipc = 

svn commit: r358031 - stable/12/contrib/elftoolchain/addr2line

2020-02-17 Thread Mark Johnston
Author: markj
Date: Mon Feb 17 18:39:38 2020
New Revision: 358031
URL: https://svnweb.freebsd.org/changeset/base/358031

Log:
  MFC r350515:
  Capsicumize addr2line(1).

Modified:
  stable/12/contrib/elftoolchain/addr2line/addr2line.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/elftoolchain/addr2line/addr2line.c
==
--- stable/12/contrib/elftoolchain/addr2line/addr2line.cMon Feb 17 
18:37:15 2020(r358030)
+++ stable/12/contrib/elftoolchain/addr2line/addr2line.cMon Feb 17 
18:39:38 2020(r358031)
@@ -25,6 +25,8 @@
  */
 
 #include 
+
+#include 
 #include 
 #include 
 #include 
@@ -649,6 +651,7 @@ find_section_base(const char *exe, Elf *e, const char 
 int
 main(int argc, char **argv)
 {
+   cap_rights_t rights;
Elf *e;
Dwarf_Debug dbg;
Dwarf_Error de;
@@ -705,6 +708,16 @@ main(int argc, char **argv)
 
if ((fd = open(exe, O_RDONLY)) < 0)
err(EXIT_FAILURE, "%s", exe);
+
+   if (caph_rights_limit(fd, cap_rights_init(, CAP_FSTAT,
+   CAP_MMAP_R)) < 0)
+   errx(EXIT_FAILURE, "caph_rights_limit");
+
+   caph_cache_catpages();
+   if (caph_limit_stdio() < 0)
+   errx(EXIT_FAILURE, "failed to limit stdio rights");
+   if (caph_enter() < 0)
+   errx(EXIT_FAILURE, "failed to enter capability mode");
 
if (dwarf_init(fd, DW_DLC_READ, NULL, NULL, , ))
errx(EXIT_FAILURE, "dwarf_init: %s", dwarf_errmsg(de));
___
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-unsubscr...@freebsd.org"


Re: svn commit: r357833 - head/tests/sys/pjdfstest/tests

2020-02-17 Thread Enji Cooper (yaneurabeya)

> On Feb 12, 2020, at 14:01, Ed Maste  wrote:
> 
> On Wed, 12 Feb 2020 at 15:34, Enji Cooper  > wrote:
>> 
>> On Wed, Feb 12, 2020 at 9:37 AM Ed Maste  wrote:
>>> 
>>> Author: emaste
>>> Date: Wed Feb 12 17:37:32 2020
>>> New Revision: 357833
>>> URL: https://svnweb.freebsd.org/changeset/base/357833
>>> 
>>> Log:
>>>  Tag pjdfstest symlink with pkgbase package
>>> 
>>>  As with the rest of pjdfstest, tag the symlink with package=tests.
>>>  The tests -> . symlink seems a little strange but that's independent
>>>  of pkgbase.
>> 
>> Sidenote: the reason for the symlink was to facilitate integrating the
>> test suite without having to completely refactor the code.
> 
> Thanks for the note - this probably ought to be a comment by the
> symlink; I'll add it at some point if you don't get to it first.

I’ll do that in a bit. I need to dust off the cobwebs with my src bit anyhow, 
lest the reaper reap it :).
-Enji
___
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-unsubscr...@freebsd.org"


Re: svn commit: r357647 - in head/sys: cam/ata cam/mmc cam/nvme cam/scsi dev/aac dev/altera/avgen dev/altera/sdcard dev/amr dev/cfi dev/flash dev/ida dev/ips dev/mfi dev/mlx dev/mmc dev/nvme dev/pst d

2020-02-17 Thread Dimitry Andric
On 7 Feb 2020, at 10:22, Scott Long  wrote:
> 
> Author: scottl
> Date: Fri Feb  7 09:22:08 2020
> New Revision: 357647
> URL: https://svnweb.freebsd.org/changeset/base/357647
> 
> Log:
>  Ever since the block layer expanded its command syntax beyond just
>  BIO_READ and BIO_WRITE, we've handled this expanded syntax poorly in
>  drivers when the driver doesn't support a particular command.  Do a
>  sweep and fix that.
...
> Modified: head/sys/dev/altera/sdcard/altera_sdcard_io.c
> ==
> --- head/sys/dev/altera/sdcard/altera_sdcard_io.c Fri Feb  7 08:39:00 
> 2020(r357646)
> +++ head/sys/dev/altera/sdcard/altera_sdcard_io.c Fri Feb  7 09:22:08 
> 2020(r357647)
> @@ -293,27 +293,27 @@ recheck:
> }
> 
> static void
> -altera_sdcard_io_start_internal(struct altera_sdcard_softc *sc, struct bio 
> *bp)
> +altera_sdcard_io_start_internal(struct altera_sdcard_softc *sc, struct bio 
> **bp)
> {
> 
> - switch (bp->bio_cmd) {
> + switch (*bp->bio_cmd) {
>   case BIO_READ:
> - altera_sdcard_write_cmd_arg(sc, bp->bio_pblkno *
> + altera_sdcard_write_cmd_arg(sc, *bp->bio_pblkno *
>   ALTERA_SDCARD_SECTORSIZE);
>   altera_sdcard_write_cmd(sc, ALTERA_SDCARD_CMD_READ_BLOCK);
>   break;
> 
>   case BIO_WRITE:
> - altera_sdcard_write_rxtx_buffer(sc, bp->bio_data,
> - bp->bio_bcount);
> - altera_sdcard_write_cmd_arg(sc, bp->bio_pblkno *
> + altera_sdcard_write_rxtx_buffer(sc, *bp->bio_data,
> + *bp->bio_bcount);
> + altera_sdcard_write_cmd_arg(sc, *bp->bio_pblkno *
>   ALTERA_SDCARD_SECTORSIZE);
>   altera_sdcard_write_cmd(sc, ALTERA_SDCARD_CMD_WRITE_BLOCK);
>   break;
> 
>   default:
> - panic("%s: unsupported I/O operation %d", __func__,
> - bp->bio_cmd);
> + biofinish(*bp, NULL, EOPNOTSUPP);
> + *bp = NULL;
>   }
> }
> 

This gets the indirections wrong, leading to errors with at least clang 10:

sys/dev/altera/sdcard/altera_sdcard_io.c: In function 
'altera_sdcard_io_start_internal':
sys/dev/altera/sdcard/altera_sdcard_io.c:299:13: error: '*bp' is a pointer; did 
you mean to use '->'?
  switch (*bp->bio_cmd) {
 ^~
 ->
sys/dev/altera/sdcard/altera_sdcard_io.c:301:38: error: '*bp' is a pointer; did 
you mean to use '->'?
   altera_sdcard_write_cmd_arg(sc, *bp->bio_pblkno *
  ^~
  ->
sys/dev/altera/sdcard/altera_sdcard_io.c:307:42: error: '*bp' is a pointer; did 
you mean to use '->'?
   altera_sdcard_write_rxtx_buffer(sc, *bp->bio_data,
  ^~
  ->
sys/dev/altera/sdcard/altera_sdcard_io.c:308:10: error: '*bp' is a pointer; did 
you mean to use '->'?
   *bp->bio_bcount);
  ^~
  ->
sys/dev/altera/sdcard/altera_sdcard_io.c:309:38: error: '*bp' is a pointer; did 
you mean to use '->'?
   altera_sdcard_write_cmd_arg(sc, *bp->bio_pblkno *
  ^~
  ->

In this case, (*bp)->fieldname is the correct way to specify the struct fields.


> @@ -332,8 +332,8 @@ altera_sdcard_io_start(struct altera_sdcard_softc *sc,
>*/
>   KASSERT(bp->bio_bcount == ALTERA_SDCARD_SECTORSIZE,
>   ("%s: I/O size not %d", __func__, ALTERA_SDCARD_SECTORSIZE));
> - altera_sdcard_io_start_internal(sc, bp);
> - sc->as_currentbio = bp;
> + altera_sdcard_io_start_internal(sc, );
> + sc->as_currentbio = *bp;
>   sc->as_retriesleft = ALTERA_SDCARD_RETRY_LIMIT;
> }

And a similar error here:

sys/dev/altera/sdcard/altera_sdcard_io.c: In function 'altera_sdcard_io_start':
sys/dev/altera/sdcard/altera_sdcard_io.c:336:20: error: incompatible types when 
assigning to type 'struct bio *' from type 'struct bio'
  sc->as_currentbio = *bp;
^

As sc->as_currentbio is already a pointer, there is no need to dereference bp 
again.

I submitted https://reviews.freebsd.org/D23730 to get this fixed.

-Dimitry



signature.asc
Description: Message signed with OpenPGP


svn commit: r358028 - head/sys/netinet

2020-02-17 Thread Michael Tuexen
Author: tuexen
Date: Mon Feb 17 18:05:03 2020
New Revision: 358028
URL: https://svnweb.freebsd.org/changeset/base/358028

Log:
  Fix the non-default stream schedulers such that do not interleave
  user messages when it is now allowed.
  
  Thanks to Christian Wright for reporting the issue for the userland
  stack and providing a fix for the priority scheduler.
  
  MFC after:1 week

Modified:
  head/sys/netinet/sctp_ss_functions.c

Modified: head/sys/netinet/sctp_ss_functions.c
==
--- head/sys/netinet/sctp_ss_functions.cMon Feb 17 15:32:21 2020
(r358027)
+++ head/sys/netinet/sctp_ss_functions.cMon Feb 17 18:05:03 2020
(r358028)
@@ -517,6 +517,9 @@ sctp_ss_prio_select(struct sctp_tcb *stcb SCTP_UNUSED,
 {
struct sctp_stream_out *strq, *strqt, *strqn;
 
+   if (asoc->ss_data.locked_on_sending) {
+   return (asoc->ss_data.locked_on_sending);
+   }
strqt = asoc->ss_data.last_out_stream;
 prio_again:
/* Find the next stream to use */
@@ -694,6 +697,9 @@ sctp_ss_fb_select(struct sctp_tcb *stcb SCTP_UNUSED, s
 {
struct sctp_stream_out *strq = NULL, *strqt;
 
+   if (asoc->ss_data.locked_on_sending) {
+   return (asoc->ss_data.locked_on_sending);
+   }
if (asoc->ss_data.last_out_stream == NULL ||
TAILQ_FIRST(>ss_data.out.wheel) == 
TAILQ_LAST(>ss_data.out.wheel, sctpwheel_listhead)) {
strqt = TAILQ_FIRST(>ss_data.out.wheel);
@@ -900,6 +906,9 @@ sctp_ss_fcfs_select(struct sctp_tcb *stcb SCTP_UNUSED,
struct sctp_stream_out *strq;
struct sctp_stream_queue_pending *sp;
 
+   if (asoc->ss_data.locked_on_sending) {
+   return (asoc->ss_data.locked_on_sending);
+   }
sp = TAILQ_FIRST(>ss_data.out.list);
 default_again:
if (sp != NULL) {
___
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-unsubscr...@freebsd.org"


svn commit: r358027 - head/sys/dev/acpica

2020-02-17 Thread Andrew Turner
Author: andrew
Date: Mon Feb 17 15:32:21 2020
New Revision: 358027
URL: https://svnweb.freebsd.org/changeset/base/358027

Log:
  Use EARLY_DRIVER_MODULE in the acpi bus.
  
  We need this to use EARLY_DRIVER_MODULE in child drivers on arm64. This
  should be a no-op on x86 as it has DRIVER_MODULE in the nexus driver making
  all later drivers attach in the last pass.
  
  Reviewed by:  imp
  MFC after:1 month
  Sponsored by: Innovate UK
  Differential Revision:https://reviews.freebsd.org/D23717

Modified:
  head/sys/dev/acpica/acpi.c

Modified: head/sys/dev/acpica/acpi.c
==
--- head/sys/dev/acpica/acpi.c  Mon Feb 17 15:11:07 2020(r358026)
+++ head/sys/dev/acpica/acpi.c  Mon Feb 17 15:32:21 2020(r358027)
@@ -237,7 +237,8 @@ static driver_t acpi_driver = {
 };
 
 static devclass_t acpi_devclass;
-DRIVER_MODULE(acpi, nexus, acpi_driver, acpi_devclass, acpi_modevent, 0);
+EARLY_DRIVER_MODULE(acpi, nexus, acpi_driver, acpi_devclass, acpi_modevent, 0,
+BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE);
 MODULE_VERSION(acpi, 1);
 
 ACPI_SERIAL_DECL(acpi, "ACPI root bus");
___
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-unsubscr...@freebsd.org"


svn commit: r358026 - in head: lib/libkvm sys/vm

2020-02-17 Thread Mark Johnston
Author: markj
Date: Mon Feb 17 15:11:07 2020
New Revision: 358026
URL: https://svnweb.freebsd.org/changeset/base/358026

Log:
  Remove swblk_t.
  
  It was used only to store the bounds of each swap device.  However,
  since swblk_t is a signed 32-bit int and daddr_t is a signed 64-bit
  int, swp_pager_isondev() may return an invalid result if swap devices
  are repeatedly added and removed and sw_end for a device ends up
  becoming a negative number.
  
  Note that the removed comment about maximum swap size still applies.
  
  Reviewed by:  jeff, kib
  Tested by:pho
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D23666

Modified:
  head/lib/libkvm/kvm_getswapinfo.c
  head/sys/vm/swap_pager.c
  head/sys/vm/swap_pager.h

Modified: head/lib/libkvm/kvm_getswapinfo.c
==
--- head/lib/libkvm/kvm_getswapinfo.c   Mon Feb 17 15:10:41 2020
(r358025)
+++ head/lib/libkvm/kvm_getswapinfo.c   Mon Feb 17 15:11:07 2020
(r358026)
@@ -115,8 +115,7 @@ int
 kvm_getswapinfo_kvm(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max,
 int flags)
 {
-   int i;
-   swblk_t ttl;
+   int i, ttl;
TAILQ_HEAD(, swdevt) swtailq;
struct swdevt *sp, swinfo;
struct kvm_swap tot;
@@ -167,8 +166,7 @@ int
 kvm_getswapinfo_sysctl(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max,
 int flags)
 {
-   int ti;
-   swblk_t ttl;
+   int ti, ttl;
size_t mibi, len;
int soid[SWI_MAXMIB];
struct xswdev xsd;

Modified: head/sys/vm/swap_pager.c
==
--- head/sys/vm/swap_pager.cMon Feb 17 15:10:41 2020(r358025)
+++ head/sys/vm/swap_pager.cMon Feb 17 15:11:07 2020(r358026)
@@ -2334,7 +2334,7 @@ swaponsomething(struct vnode *vp, void *id, u_long nbl
 sw_strategy_t *strategy, sw_close_t *close, dev_t dev, int flags)
 {
struct swdevt *sp, *tsp;
-   swblk_t dvbase;
+   daddr_t dvbase;
u_long mblocks;
 
/*

Modified: head/sys/vm/swap_pager.h
==
--- head/sys/vm/swap_pager.hMon Feb 17 15:10:41 2020(r358025)
+++ head/sys/vm/swap_pager.hMon Feb 17 15:11:07 2020(r358026)
@@ -38,14 +38,9 @@
  */
 
 #ifndef_VM_SWAP_PAGER_H_
-#define_VM_SWAP_PAGER_H_ 1
+#define_VM_SWAP_PAGER_H_
 
-typedefint32_t swblk_t;/*
-* swap offset.  This is the type used to
-* address the "virtual swap device" and
-* therefore the maximum swap space is
-* 2^32 pages.
-*/
+#include 
 
 struct buf;
 struct swdevt;
@@ -62,8 +57,8 @@ struct swdevt {
dev_t   sw_dev;
struct vnode *sw_vp;
void*sw_id;
-   swblk_t sw_first;
-   swblk_t sw_end;
+   __daddr_t sw_first;
+   __daddr_t sw_end;
struct blist *sw_blist;
TAILQ_ENTRY(swdevt) sw_list;
sw_strategy_t   *sw_strategy;
___
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-unsubscr...@freebsd.org"


svn commit: r358025 - head/sys/vm

2020-02-17 Thread Mark Johnston
Author: markj
Date: Mon Feb 17 15:10:41 2020
New Revision: 358025
URL: https://svnweb.freebsd.org/changeset/base/358025

Log:
  Fix a swap block allocation race.
  
  putpages' allocation of swap blocks is done under the global sw_dev
  lock.  Previously it would drop that lock before inserting the allocated
  blocks into the object's trie, creating a window in which swap blocks
  are allocated but are not visible to swapoff.  This can cause
  swp_pager_strategy() to fail and panic the system.
  
  Fix the problem bluntly, by allocating swap blocks under the object
  lock.
  
  Reviewed by:  jeff, kib
  Tested by:pho
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D23665

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==
--- head/sys/vm/swap_pager.cMon Feb 17 15:09:40 2020(r358024)
+++ head/sys/vm/swap_pager.cMon Feb 17 15:10:41 2020(r358025)
@@ -1453,18 +1453,6 @@ swap_pager_putpages(vm_object_t object, vm_page_t *ma,
/* Maximum I/O size is limited by maximum swap block size. */
n = min(count - i, nsw_cluster_max);
 
-   /* Get a block of swap of size up to size n. */
-   blk = swp_pager_getswapspace(, 4);
-   if (blk == SWAPBLK_NONE) {
-   for (j = 0; j < n; ++j)
-   rtvals[i + j] = VM_PAGER_FAIL;
-   continue;
-   }
-
-   /*
-* All I/O parameters have been satisfied.  Build the I/O
-* request and assign the swap space.
-*/
if (async) {
mtx_lock(_mtx);
while (nsw_wcount_async == 0)
@@ -1473,19 +1461,20 @@ swap_pager_putpages(vm_object_t object, vm_page_t *ma,
nsw_wcount_async--;
mtx_unlock(_mtx);
}
-   bp = uma_zalloc(swwbuf_zone, M_WAITOK);
-   if (async)
-   bp->b_flags = B_ASYNC;
-   bp->b_flags |= B_PAGING;
-   bp->b_iocmd = BIO_WRITE;
 
-   bp->b_rcred = crhold(thread0.td_ucred);
-   bp->b_wcred = crhold(thread0.td_ucred);
-   bp->b_bcount = PAGE_SIZE * n;
-   bp->b_bufsize = PAGE_SIZE * n;
-   bp->b_blkno = blk;
-
+   /* Get a block of swap of size up to size n. */
VM_OBJECT_WLOCK(object);
+   blk = swp_pager_getswapspace(, 4);
+   if (blk == SWAPBLK_NONE) {
+   VM_OBJECT_WUNLOCK(object);
+   mtx_lock(_mtx);
+   if (++nsw_wcount_async == 1)
+   wakeup(_wcount_async);
+   mtx_unlock(_mtx);
+   for (j = 0; j < n; ++j)
+   rtvals[i + j] = VM_PAGER_FAIL;
+   continue;
+   }
for (j = 0; j < n; ++j) {
mreq = ma[i + j];
vm_page_aflag_clear(mreq, PGA_SWAP_FREE);
@@ -1496,10 +1485,24 @@ swap_pager_putpages(vm_object_t object, vm_page_t *ma,
addr);
MPASS(mreq->dirty == VM_PAGE_BITS_ALL);
mreq->oflags |= VPO_SWAPINPROG;
-   bp->b_pages[j] = mreq;
}
VM_OBJECT_WUNLOCK(object);
+
+   bp = uma_zalloc(swwbuf_zone, M_WAITOK);
+   if (async)
+   bp->b_flags = B_ASYNC;
+   bp->b_flags |= B_PAGING;
+   bp->b_iocmd = BIO_WRITE;
+
+   bp->b_rcred = crhold(thread0.td_ucred);
+   bp->b_wcred = crhold(thread0.td_ucred);
+   bp->b_bcount = PAGE_SIZE * n;
+   bp->b_bufsize = PAGE_SIZE * n;
+   bp->b_blkno = blk;
+   for (j = 0; j < n; j++)
+   bp->b_pages[j] = ma[i + j];
bp->b_npages = n;
+
/*
 * Must set dirty range for NFS to work.
 */
@@ -2059,7 +2062,7 @@ allocated:
 * Free the swblk if we end up with the empty page run.
 */
if (swapblk == SWAPBLK_NONE)
-   swp_pager_free_empty_swblk(object, sb);
+   swp_pager_free_empty_swblk(object, sb);
return (prev_swapblk);
 }
 
___
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-unsubscr...@freebsd.org"


svn commit: r358024 - head/sys/vm

2020-02-17 Thread Mark Johnston
Author: markj
Date: Mon Feb 17 15:09:40 2020
New Revision: 358024
URL: https://svnweb.freebsd.org/changeset/base/358024

Log:
  Fix object locking races in swapoff(2).
  
  swap_pager_swapoff_object()'s goal is to allocate pages for all valid
  swap blocks belonging to the object, for which there is no resident
  page.  If the page corresponding to a block is already resident and
  valid, the block can simply be discarded.
  
  The existing implementation tries to minimize the number of I/Os used.
  For each cluster of swap blocks, it finds maximal runs of valid swap
  blocks not resident in memory, and valid resident pages.  During this
  processing, the object lock may be dropped in several places: when
  calling getpages, or when blocking on a busy page in
  vm_page_grab_pages().  While the lock is dropped, another thread may
  free swap blocks, causing getpages to page in stale data.
  
  Fix the problem following a suggestion from Jeff: use getpages'
  readahead capability to perform clustering rather than doing it
  ourselves.  The simplies the code a bit without reintroducing the old
  behaviour of performing one I/O per page.
  
  Reviewed by:  jeff
  Reported by:  dhw, gallatin
  Tested by:pho
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D23664

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==
--- head/sys/vm/swap_pager.cMon Feb 17 14:54:21 2020(r358023)
+++ head/sys/vm/swap_pager.cMon Feb 17 15:09:40 2020(r358024)
@@ -1188,8 +1188,8 @@ swap_pager_unswapped(vm_page_t m)
  * The pages in "ma" must be busied and will remain busied upon return.
  */
 static int
-swap_pager_getpages(vm_object_t object, vm_page_t *ma, int count, int *rbehind,
-int *rahead)
+swap_pager_getpages_locked(vm_object_t object, vm_page_t *ma, int count,
+int *rbehind, int *rahead)
 {
struct buf *bp;
vm_page_t bm, mpred, msucc, p;
@@ -1197,7 +1197,7 @@ swap_pager_getpages(vm_object_t object, vm_page_t *ma,
daddr_t blk;
int i, maxahead, maxbehind, reqcount;
 
-   VM_OBJECT_WLOCK(object);
+   VM_OBJECT_ASSERT_WLOCKED(object);
reqcount = count;
 
KASSERT(object->type == OBJT_SWAP,
@@ -1352,6 +1352,15 @@ swap_pager_getpages(vm_object_t object, vm_page_t *ma,
 */
 }
 
+static int
+swap_pager_getpages(vm_object_t object, vm_page_t *ma, int count,
+int *rbehind, int *rahead)
+{
+
+   VM_OBJECT_WLOCK(object);
+   return (swap_pager_getpages_locked(object, ma, count, rbehind, rahead));
+}
+
 /*
  * swap_pager_getpages_async():
  *
@@ -1712,72 +1721,11 @@ swp_pager_force_dirty(vm_page_t m)
 {
 
vm_page_dirty(m);
-#ifdef INVARIANTS
-   if (!vm_page_wired(m) && m->a.queue == PQ_NONE)
-   panic("page %p is neither wired nor queued", m);
-#endif
-   vm_page_xunbusy(m);
swap_pager_unswapped(m);
-}
-
-static void
-swp_pager_force_launder(vm_page_t m)
-{
-
-   vm_page_dirty(m);
vm_page_launder(m);
-   vm_page_xunbusy(m);
-   swap_pager_unswapped(m);
 }
 
 /*
- * SWP_PAGER_FORCE_PAGEIN() - force swap blocks to be paged in
- *
- * This routine dissociates pages starting at the given index within an
- * object from their backing store, paging them in if they do not reside
- * in memory.  Pages that are paged in are marked dirty and placed in the
- * laundry queue.  Pages are marked dirty because they no longer have
- * backing store.  They are placed in the laundry queue because they have
- * not been accessed recently.  Otherwise, they would already reside in
- * memory.
- */
-static void
-swp_pager_force_pagein(vm_object_t object, vm_pindex_t pindex, int npages)
-{
-   vm_page_t ma[npages];
-   int i, j;
-
-   KASSERT(npages > 0, ("%s: No pages", __func__));
-   KASSERT(npages <= MAXPHYS / PAGE_SIZE,
-   ("%s: Too many pages: %d", __func__, npages));
-   KASSERT(object->type == OBJT_SWAP,
-   ("%s: Object not swappable", __func__));
-   vm_object_pip_add(object, npages);
-   vm_page_grab_pages(object, pindex, VM_ALLOC_NORMAL, ma, npages);
-   for (i = j = 0;; i++) {
-   /* Count nonresident pages, to page-in all at once. */
-   if (i < npages && ma[i]->valid != VM_PAGE_BITS_ALL)
-   continue;
-   if (j < i) {
-   VM_OBJECT_WUNLOCK(object);
-   /* Page-in nonresident pages. Mark for laundering. */
-   if (swap_pager_getpages(object, [j], i - j, NULL,
-   NULL) != VM_PAGER_OK)
-   panic("%s: read from swap failed", __func__);
-   VM_OBJECT_WLOCK(object);
-   do {
-   

svn commit: r358023 - head/sys/netinet

2020-02-17 Thread Michael Tuexen
Author: tuexen
Date: Mon Feb 17 14:54:21 2020
New Revision: 358023
URL: https://svnweb.freebsd.org/changeset/base/358023

Log:
  Don't use uninitialised stack memory if the sysctl variable
  net.inet.tcp.hostcache.enable is set to 0.
  The bug resulted in using possibly a too small MSS value or wrong
  initial retransmission timer settings. Possibly the value used
  for ssthresh was also wrong.
  
  Submitted by: Richard Scheffenegger
  Reviewed by:  Cheng Cui, rgrimes@, tuexen@
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D23687

Modified:
  head/sys/netinet/tcp_hostcache.c

Modified: head/sys/netinet/tcp_hostcache.c
==
--- head/sys/netinet/tcp_hostcache.cMon Feb 17 13:31:30 2020
(r358022)
+++ head/sys/netinet/tcp_hostcache.cMon Feb 17 14:54:21 2020
(r358023)
@@ -437,8 +437,10 @@ tcp_hc_get(struct in_conninfo *inc, struct hc_metrics_
 {
struct hc_metrics *hc_entry;
 
-   if (!V_tcp_use_hostcache)
+   if (!V_tcp_use_hostcache) {
+   bzero(hc_metrics_lite, sizeof(*hc_metrics_lite));
return;
+   }
 
/*
 * Find the right bucket.
___
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-unsubscr...@freebsd.org"


svn commit: r358022 - head/usr.sbin/pciconf

2020-02-17 Thread Konstantin Belousov
Author: kib
Date: Mon Feb 17 13:31:30 2020
New Revision: 358022
URL: https://svnweb.freebsd.org/changeset/base/358022

Log:
  pciconf: List names of all known extended PCIe capabilities.
  
  Some ids are redundand because the list_ecaps() function decodes them
  by explicit switch case.  But listing them all makes it easier to not
  miss ecaps, while not changing the functionality.
  
  Initial submission by:Dmitry Luhtionov 
  Sponsored by: The FreeBSD Foundation
  MFC after:3 days

Modified:
  head/usr.sbin/pciconf/cap.c

Modified: head/usr.sbin/pciconf/cap.c
==
--- head/usr.sbin/pciconf/cap.c Mon Feb 17 13:26:36 2020(r358021)
+++ head/usr.sbin/pciconf/cap.c Mon Feb 17 13:31:30 2020(r358022)
@@ -986,20 +986,35 @@ static struct {
uint16_t id;
const char *name;
 } ecap_names[] = {
+   { PCIZ_AER, "AER" },
+   { PCIZ_VC, "Virtual Channel" },
+   { PCIZ_SERNUM, "Device Serial Number" },
{ PCIZ_PWRBDGT, "Power Budgeting" },
{ PCIZ_RCLINK_DCL, "Root Complex Link Declaration" },
{ PCIZ_RCLINK_CTL, "Root Complex Internal Link Control" },
{ PCIZ_RCEC_ASSOC, "Root Complex Event Collector ASsociation" },
{ PCIZ_MFVC, "MFVC" },
+   { PCIZ_VC2, "Virtual Channel 2" },
{ PCIZ_RCRB, "RCRB" },
+   { PCIZ_CAC, "Configuration Access Correction" },
{ PCIZ_ACS, "ACS" },
{ PCIZ_ARI, "ARI" },
{ PCIZ_ATS, "ATS" },
+   { PCIZ_SRIOV, "SRIOV" },
+   { PCIZ_MRIOV, "MRIOV" },
{ PCIZ_MULTICAST, "Multicast" },
+   { PCIZ_PAGE_REQ, "Page Page Request" },
+   { PCIZ_AMD, "AMD proprietary "},
{ PCIZ_RESIZE_BAR, "Resizable BAR" },
{ PCIZ_DPA, "DPA" },
{ PCIZ_TPH_REQ, "TPH Requester" },
{ PCIZ_LTR, "LTR" },
+   { PCIZ_SEC_PCIE, "Secondary PCI Express" },
+   { PCIZ_PMUX, "Protocol Multiplexing" },
+   { PCIZ_PASID, "Process Address Space ID" },
+   { PCIZ_LN_REQ, "LN Requester" },
+   { PCIZ_DPC, "Downstream Port Containment" },
+   { PCIZ_L1PM, "L1 PM Substates" },
{ 0, NULL }
 };
 
___
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-unsubscr...@freebsd.org"


svn commit: r358021 - head/sys/dev/pci

2020-02-17 Thread Konstantin Belousov
Author: kib
Date: Mon Feb 17 13:26:36 2020
New Revision: 358021
URL: https://svnweb.freebsd.org/changeset/base/358021

Log:
  Fix typo.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:3 days

Modified:
  head/sys/dev/pci/pcireg.h

Modified: head/sys/dev/pci/pcireg.h
==
--- head/sys/dev/pci/pcireg.h   Mon Feb 17 11:08:50 2020(r358020)
+++ head/sys/dev/pci/pcireg.h   Mon Feb 17 13:26:36 2020(r358021)
@@ -192,7 +192,7 @@
 #definePCIZ_PMUX   0x001a  /* Protocol Multiplexing */
 #definePCIZ_PASID  0x001b  /* Process Address Space ID */
 #definePCIZ_LN_REQ 0x001c  /* LN Requester */
-#definePCIZ_DPC0x001d  /* Downstream Porto Containment */
+#definePCIZ_DPC0x001d  /* Downstream Port Containment */
 #definePCIZ_L1PM   0x001e  /* L1 PM Substates */
 
 /* config registers for header type 0 devices */
___
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-unsubscr...@freebsd.org"


Re: svn commit: r357361 - in head/sys: kern sys ufs/ufs vm

2020-02-17 Thread Mateusz Guzik
On 2/11/20, John Baldwin  wrote:
> On 2/10/20 11:54 AM, Mateusz Guzik wrote:
>> On 2/3/20, John Baldwin  wrote:
>>> On 1/31/20 10:46 PM, Mateusz Guzik wrote:
 Author: mjg
 Date: Sat Feb  1 06:46:55 2020
 New Revision: 357361
 URL: https://svnweb.freebsd.org/changeset/base/357361

 Log:
   vfs: replace VOP_MARKATIME with VOP_MMAPPED

   The routine is only provided by ufs and is only used on mmap and
 exec.

   Reviewed by: kib
   Differential Revision:   https://reviews.freebsd.org/D23422

 Modified:
   head/sys/kern/kern_exec.c
   head/sys/kern/vfs_subr.c
   head/sys/kern/vnode_if.src
   head/sys/sys/vnode.h
   head/sys/ufs/ufs/ufs_vnops.c
   head/sys/vm/vm_mmap.c

 Modified: head/sys/ufs/ufs/ufs_vnops.c
 ==
 --- head/sys/ufs/ufs/ufs_vnops.c   Sat Feb  1 06:41:44 2020
 (r357360)
 +++ head/sys/ufs/ufs/ufs_vnops.c   Sat Feb  1 06:46:55 2020
 (r357361)
 @@ -108,7 +108,7 @@ static vop_getattr_t   ufs_getattr;
  static vop_ioctl_tufs_ioctl;
  static vop_link_t ufs_link;
  static int ufs_makeinode(int mode, struct vnode *, struct vnode **,
 struct componentname *, const char *);
 -static vop_markatime_tufs_markatime;
 +static vop_mmapped_t  ufs_mmapped;
  static vop_mkdir_tufs_mkdir;
  static vop_mknod_tufs_mknod;
  static vop_open_t ufs_open;
 @@ -676,19 +676,22 @@ out:
  }
  #endif /* UFS_ACL */

 -/*
 - * Mark this file's access time for update for vfs_mark_atime().  This
 - * is called from execve() and mmap().
 - */
>>>
>>> Why remove this comment rather than update it?  It is largely still
>>> true and explains the purpose of the VOP (update the atime) which is
>>> now no longer obvious from the name.
>>>
>>
>> I don't think a fs-specific implementation of a VOP is the right place to
>> state where it is called from. I would argue the name could be better as
>> the execve bit is definitely not obvious, but interested parties can
>> always grep.
>
> This (always grep) is why comments matter.  If we wanted people to just use
> grep and always UTSL, we wouldn't bother having any comments at all.  One
> of the purposes of comments is to allow a human reader to understand the
> code
> in context without needing several different windows open to piece together
> what is happening.  In particular, the comment gives a better hint as to
> _why_ we are updating the atime.  The old name did a better job of this
> than
> the new one which is more bland, but presumably you have future changes to
> add that are beyond just changing the atime and that is why you renamed it?
>

But this is an example of something which can be grepped for very easily.
A comment who is calling given routine is warranted if there is only one such
user or there are very special circumstances for it. As it is, should there be
another user, the removed comment was prone to getting out of date and if
anything was making things more confusing -- why is mark atime routine
only called from mmap and exec, when there are so many other ways to
trigger atime update?

In my opinion comments are there to explain thing which are not obvious
or not immediately resolvable (e.g., with said grep). Easy example would
be what data is protected with what mechanism, or what can be racing
with what. I think my recent additions to vput & friends are a decent
example of what in my opinion warrants a comment.

-- 
Mateusz Guzik 
___
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-unsubscr...@freebsd.org"


svn commit: r358020 - in head: . lib/libkvm sys/net sys/sys

2020-02-17 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Feb 17 11:08:50 2020
New Revision: 358020
URL: https://svnweb.freebsd.org/changeset/base/358020

Log:
  Partially revert VNET change and expand VNET structure.
  
  Revert parts of r353274 replacing vnet_state with a shutdown flag.
  
  Not having the state flag for the current SI_SUB_* makes it harder to debug
  kernel or module panics related to VNET bringup or teardown.
  Not having the state also does not allow us to check for other dependency
  levels between components, e.g. for moving interfaces.
  
  Expand the VNET structure with the new boolean flag indicating that we are
  doing a shutdown of a given vnet and update the vnet magic cookie for the
  change.
  
  Update libkvm to compile with a bool in the kernel struct.
  
  Bump __FreeBSD_version for (external) module builds to more easily detect
  the change.
  
  Reviewed by:  hselasky
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D23097

Modified:
  head/UPDATING
  head/lib/libkvm/kvm.c
  head/lib/libkvm/kvm_private.c
  head/lib/libkvm/kvm_vnet.c
  head/sys/net/if.c
  head/sys/net/vnet.c
  head/sys/net/vnet.h
  head/sys/sys/param.h

Modified: head/UPDATING
==
--- head/UPDATING   Mon Feb 17 09:59:28 2020(r358019)
+++ head/UPDATING   Mon Feb 17 11:08:50 2020(r358020)
@@ -26,6 +26,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20200217:
+   The size of struct vnet and the magic cookie have changed.
+   Users need to recompile libkvm and all modules using VIMAGE
+   together with their new kernel.
+
 20200212:
Defining the long deprecated NO_CTF, NO_DEBUG_FILES, NO_INSTALLLIB,
NO_MAN, NO_PROFILE, and NO_WARNS variables is now an error.  Update

Modified: head/lib/libkvm/kvm.c
==
--- head/lib/libkvm/kvm.c   Mon Feb 17 09:59:28 2020(r358019)
+++ head/lib/libkvm/kvm.c   Mon Feb 17 11:08:50 2020(r358020)
@@ -49,6 +49,7 @@ __SCCSID("@(#)kvm.c   8.2 (Berkeley) 2/13/94");
 #include 
 #include 
 
+#include 
 #include 
 
 #include 

Modified: head/lib/libkvm/kvm_private.c
==
--- head/lib/libkvm/kvm_private.c   Mon Feb 17 09:59:28 2020
(r358019)
+++ head/lib/libkvm/kvm_private.c   Mon Feb 17 11:08:50 2020
(r358020)
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
 #include 
 
 #include 

Modified: head/lib/libkvm/kvm_vnet.c
==
--- head/lib/libkvm/kvm_vnet.c  Mon Feb 17 09:59:28 2020(r358019)
+++ head/lib/libkvm/kvm_vnet.c  Mon Feb 17 11:08:50 2020(r358020)
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
 #include 
 
 #include 

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Mon Feb 17 09:59:28 2020(r358019)
+++ head/sys/net/if.c   Mon Feb 17 11:08:50 2020(r358020)
@@ -322,6 +322,11 @@ SX_SYSINIT_FLAGS(ifnet_sx, _sxlock, "ifnet_sx", 
  */
 #defineIFNET_HOLD  (void *)(uintptr_t)(-1)
 
+#ifdef VIMAGE
+#defineVNET_IS_SHUTTING_DOWN(_vnet)
\
+((_vnet)->vnet_shutdown && (_vnet)->vnet_state < SI_SUB_VNET_DONE)
+#endif
+
 static if_com_alloc_t *if_com_alloc[256];
 static if_com_free_t *if_com_free[256];
 
@@ -1080,7 +1085,7 @@ if_detach_internal(struct ifnet *ifp, int vmove, struc
 #ifdef VIMAGE
bool shutdown;
 
-   shutdown = ifp->if_vnet->vnet_shutdown;
+   shutdown = VNET_IS_SHUTTING_DOWN(ifp->if_vnet);
 #endif
IFNET_WLOCK();
CK_STAILQ_FOREACH(iter, _ifnet, if_link)
@@ -1339,6 +1344,7 @@ if_vmove_loan(struct thread *td, struct ifnet *ifp, ch
struct prison *pr;
struct ifnet *difp;
int error;
+   bool shutdown;
 
/* Try to find the prison within our visibility. */
sx_slock(_lock);
@@ -1366,7 +1372,8 @@ if_vmove_loan(struct thread *td, struct ifnet *ifp, ch
}
 
/* Make sure the VNET is stable. */
-   if (ifp->if_vnet->vnet_shutdown) {
+   shutdown = VNET_IS_SHUTTING_DOWN(ifp->if_vnet);
+   if (shutdown) {
CURVNET_RESTORE();
prison_free(pr);
return (EBUSY);
@@ -1391,6 +1398,7 @@ if_vmove_reclaim(struct thread *td, char *ifname, int 
struct vnet *vnet_dst;
struct ifnet *ifp;
int error;
+   bool shutdown;
 
/* Try to find the prison within our visibility. */
sx_sloc

svn commit: r358019 - stable/11/sys/dev/usb/controller

2020-02-17 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Feb 17 09:59:28 2020
New Revision: 358019
URL: https://svnweb.freebsd.org/changeset/base/358019

Log:
  MFC r356597:
  Define the XHCI endpoint states.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/dev/usb/controller/xhci.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/usb/controller/xhci.h
==
--- stable/11/sys/dev/usb/controller/xhci.h Mon Feb 17 09:58:55 2020
(r358018)
+++ stable/11/sys/dev/usb/controller/xhci.h Mon Feb 17 09:59:28 2020
(r358019)
@@ -113,6 +113,14 @@ struct xhci_endp_ctx {
volatile uint32_t   dwEpCtx0;
 #defineXHCI_EPCTX_0_EPSTATE_SET(x) ((x) & 0x7)
 #defineXHCI_EPCTX_0_EPSTATE_GET(x) ((x) & 0x7)
+#defineXHCI_EPCTX_0_EPSTATE_DISABLED   0
+#defineXHCI_EPCTX_0_EPSTATE_RUNNING1
+#defineXHCI_EPCTX_0_EPSTATE_HALTED 2
+#defineXHCI_EPCTX_0_EPSTATE_STOPPED3
+#defineXHCI_EPCTX_0_EPSTATE_ERROR  4
+#defineXHCI_EPCTX_0_EPSTATE_RESERVED_5 5
+#defineXHCI_EPCTX_0_EPSTATE_RESERVED_6 6
+#defineXHCI_EPCTX_0_EPSTATE_RESERVED_7 7
 #defineXHCI_EPCTX_0_MULT_SET(x)(((x) & 0x3) << 8)
 #defineXHCI_EPCTX_0_MULT_GET(x)(((x) >> 8) & 0x3)
 #defineXHCI_EPCTX_0_MAXP_STREAMS_SET(x)(((x) & 0x1F) << 10)
___
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-unsubscr...@freebsd.org"


svn commit: r358018 - stable/12/sys/dev/usb/controller

2020-02-17 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Feb 17 09:58:55 2020
New Revision: 358018
URL: https://svnweb.freebsd.org/changeset/base/358018

Log:
  MFC r356597:
  Define the XHCI endpoint states.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/12/sys/dev/usb/controller/xhci.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/usb/controller/xhci.h
==
--- stable/12/sys/dev/usb/controller/xhci.h Mon Feb 17 09:57:40 2020
(r358017)
+++ stable/12/sys/dev/usb/controller/xhci.h Mon Feb 17 09:58:55 2020
(r358018)
@@ -115,6 +115,14 @@ struct xhci_endp_ctx {
volatile uint32_t   dwEpCtx0;
 #defineXHCI_EPCTX_0_EPSTATE_SET(x) ((x) & 0x7)
 #defineXHCI_EPCTX_0_EPSTATE_GET(x) ((x) & 0x7)
+#defineXHCI_EPCTX_0_EPSTATE_DISABLED   0
+#defineXHCI_EPCTX_0_EPSTATE_RUNNING1
+#defineXHCI_EPCTX_0_EPSTATE_HALTED 2
+#defineXHCI_EPCTX_0_EPSTATE_STOPPED3
+#defineXHCI_EPCTX_0_EPSTATE_ERROR  4
+#defineXHCI_EPCTX_0_EPSTATE_RESERVED_5 5
+#defineXHCI_EPCTX_0_EPSTATE_RESERVED_6 6
+#defineXHCI_EPCTX_0_EPSTATE_RESERVED_7 7
 #defineXHCI_EPCTX_0_MULT_SET(x)(((x) & 0x3) << 8)
 #defineXHCI_EPCTX_0_MULT_GET(x)(((x) >> 8) & 0x3)
 #defineXHCI_EPCTX_0_MAXP_STREAMS_SET(x)(((x) & 0x1F) << 10)
___
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-unsubscr...@freebsd.org"


svn commit: r358017 - stable/11/sys/dev/usb/controller

2020-02-17 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Feb 17 09:57:40 2020
New Revision: 358017
URL: https://svnweb.freebsd.org/changeset/base/358017

Log:
  MFC r357726:
  Add USB host controller PCI ID's for Hygon.
  
  Differential Revision:https://reviews.freebsd.org/D23564
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/dev/usb/controller/ehci_pci.c
  stable/11/sys/dev/usb/controller/ohci_pci.c
  stable/11/sys/dev/usb/controller/xhci_pci.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/usb/controller/ehci_pci.c
==
--- stable/11/sys/dev/usb/controller/ehci_pci.c Mon Feb 17 09:57:03 2020
(r358016)
+++ stable/11/sys/dev/usb/controller/ehci_pci.c Mon Feb 17 09:57:40 2020
(r358017)
@@ -84,6 +84,7 @@ __FBSDID("$FreeBSD$");
 #definePCI_EHCI_VENDORID_APPLE 0x106b
 #definePCI_EHCI_VENDORID_ATI   0x1002
 #definePCI_EHCI_VENDORID_CMDTECH   0x1095
+#definePCI_EHCI_VENDORID_HYGON 0x1d94
 #definePCI_EHCI_VENDORID_INTEL 0x8086
 #definePCI_EHCI_VENDORID_NEC   0x1033
 #definePCI_EHCI_VENDORID_OPTI  0x1045
@@ -369,6 +370,9 @@ ehci_pci_attach(device_t self)
break;
case PCI_EHCI_VENDORID_CMDTECH:
sprintf(sc->sc_vendor, "CMDTECH");
+   break;
+   case PCI_EHCI_VENDORID_HYGON:
+   sprintf(sc->sc_vendor, "Hygon");
break;
case PCI_EHCI_VENDORID_INTEL:
sprintf(sc->sc_vendor, "Intel");

Modified: stable/11/sys/dev/usb/controller/ohci_pci.c
==
--- stable/11/sys/dev/usb/controller/ohci_pci.c Mon Feb 17 09:57:03 2020
(r358016)
+++ stable/11/sys/dev/usb/controller/ohci_pci.c Mon Feb 17 09:57:40 2020
(r358017)
@@ -81,6 +81,7 @@ __FBSDID("$FreeBSD$");
 #definePCI_OHCI_VENDORID_APPLE 0x106b
 #definePCI_OHCI_VENDORID_ATI   0x1002
 #definePCI_OHCI_VENDORID_CMDTECH   0x1095
+#definePCI_OHCI_VENDORID_HYGON 0x1d94
 #definePCI_OHCI_VENDORID_NEC   0x1033
 #definePCI_OHCI_VENDORID_NVIDIA0x12D2
 #definePCI_OHCI_VENDORID_NVIDIA2   0x10DE
@@ -277,6 +278,9 @@ ohci_pci_attach(device_t self)
break;
case PCI_OHCI_VENDORID_CMDTECH:
sprintf(sc->sc_vendor, "CMDTECH");
+   break;
+   case PCI_OHCI_VENDORID_HYGON:
+   sprintf(sc->sc_vendor, "Hygon");
break;
case PCI_OHCI_VENDORID_NEC:
sprintf(sc->sc_vendor, "NEC");

Modified: stable/11/sys/dev/usb/controller/xhci_pci.c
==
--- stable/11/sys/dev/usb/controller/xhci_pci.c Mon Feb 17 09:57:03 2020
(r358016)
+++ stable/11/sys/dev/usb/controller/xhci_pci.c Mon Feb 17 09:57:40 2020
(r358017)
@@ -105,6 +105,9 @@ xhci_pci_match(device_t self)
case 0x78141022:
return ("AMD FCH USB 3.0 controller");
 
+   case 0x145f1d94:
+   return ("Hygon USB 3.0 controller");
+
case 0x01941033:
return ("NEC uPD720200 USB 3.0 controller");
case 0x00151912:
___
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-unsubscr...@freebsd.org"


svn commit: r358016 - stable/12/sys/dev/usb/controller

2020-02-17 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Feb 17 09:57:03 2020
New Revision: 358016
URL: https://svnweb.freebsd.org/changeset/base/358016

Log:
  MFC r357726:
  Add USB host controller PCI ID's for Hygon.
  
  Differential Revision:https://reviews.freebsd.org/D23564
  Sponsored by: Mellanox Technologies

Modified:
  stable/12/sys/dev/usb/controller/ehci_pci.c
  stable/12/sys/dev/usb/controller/ohci_pci.c
  stable/12/sys/dev/usb/controller/xhci_pci.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/usb/controller/ehci_pci.c
==
--- stable/12/sys/dev/usb/controller/ehci_pci.c Mon Feb 17 09:54:50 2020
(r358015)
+++ stable/12/sys/dev/usb/controller/ehci_pci.c Mon Feb 17 09:57:03 2020
(r358016)
@@ -86,6 +86,7 @@ __FBSDID("$FreeBSD$");
 #definePCI_EHCI_VENDORID_APPLE 0x106b
 #definePCI_EHCI_VENDORID_ATI   0x1002
 #definePCI_EHCI_VENDORID_CMDTECH   0x1095
+#definePCI_EHCI_VENDORID_HYGON 0x1d94
 #definePCI_EHCI_VENDORID_INTEL 0x8086
 #definePCI_EHCI_VENDORID_NEC   0x1033
 #definePCI_EHCI_VENDORID_OPTI  0x1045
@@ -371,6 +372,9 @@ ehci_pci_attach(device_t self)
break;
case PCI_EHCI_VENDORID_CMDTECH:
sprintf(sc->sc_vendor, "CMDTECH");
+   break;
+   case PCI_EHCI_VENDORID_HYGON:
+   sprintf(sc->sc_vendor, "Hygon");
break;
case PCI_EHCI_VENDORID_INTEL:
sprintf(sc->sc_vendor, "Intel");

Modified: stable/12/sys/dev/usb/controller/ohci_pci.c
==
--- stable/12/sys/dev/usb/controller/ohci_pci.c Mon Feb 17 09:54:50 2020
(r358015)
+++ stable/12/sys/dev/usb/controller/ohci_pci.c Mon Feb 17 09:57:03 2020
(r358016)
@@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$");
 #definePCI_OHCI_VENDORID_APPLE 0x106b
 #definePCI_OHCI_VENDORID_ATI   0x1002
 #definePCI_OHCI_VENDORID_CMDTECH   0x1095
+#definePCI_OHCI_VENDORID_HYGON 0x1d94
 #definePCI_OHCI_VENDORID_NEC   0x1033
 #definePCI_OHCI_VENDORID_NVIDIA0x12D2
 #definePCI_OHCI_VENDORID_NVIDIA2   0x10DE
@@ -279,6 +280,9 @@ ohci_pci_attach(device_t self)
break;
case PCI_OHCI_VENDORID_CMDTECH:
sprintf(sc->sc_vendor, "CMDTECH");
+   break;
+   case PCI_OHCI_VENDORID_HYGON:
+   sprintf(sc->sc_vendor, "Hygon");
break;
case PCI_OHCI_VENDORID_NEC:
sprintf(sc->sc_vendor, "NEC");

Modified: stable/12/sys/dev/usb/controller/xhci_pci.c
==
--- stable/12/sys/dev/usb/controller/xhci_pci.c Mon Feb 17 09:54:50 2020
(r358015)
+++ stable/12/sys/dev/usb/controller/xhci_pci.c Mon Feb 17 09:57:03 2020
(r358016)
@@ -107,6 +107,9 @@ xhci_pci_match(device_t self)
case 0x78141022:
return ("AMD FCH USB 3.0 controller");
 
+   case 0x145f1d94:
+   return ("Hygon USB 3.0 controller");
+
case 0x01941033:
return ("NEC uPD720200 USB 3.0 controller");
case 0x00151912:
___
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-unsubscr...@freebsd.org"


svn commit: r358015 - in stable/11/sys/dev/mlx5: . mlx5_core

2020-02-17 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Feb 17 09:54:50 2020
New Revision: 358015
URL: https://svnweb.freebsd.org/changeset/base/358015

Log:
  MFC r357801:
  Add support for disabling and polling MSIX interrupts in mlx5core.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/dev/mlx5/driver.h
  stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c
  stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/driver.h
==
--- stable/11/sys/dev/mlx5/driver.h Mon Feb 17 09:53:23 2020
(r358014)
+++ stable/11/sys/dev/mlx5/driver.h Mon Feb 17 09:54:50 2020
(r358015)
@@ -1146,4 +1146,7 @@ static inline int mlx5_core_is_pf(struct mlx5_core_dev
return !(dev->priv.pci_dev_data & MLX5_PCI_DEV_IS_VF);
 }
 
+void mlx5_disable_interrupts(struct mlx5_core_dev *);
+void mlx5_poll_interrupts(struct mlx5_core_dev *);
+
 #endif /* MLX5_DRIVER_H */

Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c
==
--- stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c  Mon Feb 17 09:53:23 2020
(r358014)
+++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c  Mon Feb 17 09:54:50 2020
(r358015)
@@ -739,3 +739,28 @@ static void mlx5_port_general_notification_event(struc
}
 }
 
+void
+mlx5_disable_interrupts(struct mlx5_core_dev *dev)
+{
+   int nvec = dev->priv.eq_table.num_comp_vectors + MLX5_EQ_VEC_COMP_BASE;
+   int x;
+
+   for (x = 0; x != nvec; x++)
+   disable_irq(dev->priv.msix_arr[x].vector);
+}
+
+void
+mlx5_poll_interrupts(struct mlx5_core_dev *dev)
+{
+   struct mlx5_eq *eq;
+
+   if (unlikely(dev->priv.disable_irqs != 0))
+   return;
+
+   mlx5_eq_int(dev, >priv.eq_table.cmd_eq);
+   mlx5_eq_int(dev, >priv.eq_table.async_eq);
+   mlx5_eq_int(dev, >priv.eq_table.pages_eq);
+
+   list_for_each_entry(eq, >priv.eq_table.comp_eqs_list, list)
+   mlx5_eq_int(dev, eq);
+}

Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c
==
--- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.cMon Feb 17 09:53:23 
2020(r358014)
+++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.cMon Feb 17 09:54:50 
2020(r358015)
@@ -1567,7 +1567,7 @@ done:
return 0;
 }
 
-static void mlx5_disable_interrupts(struct mlx5_core_dev *mdev)
+static void mlx5_shutdown_disable_interrupts(struct mlx5_core_dev *mdev)
 {
int nvec = mdev->priv.eq_table.num_comp_vectors + MLX5_EQ_VEC_COMP_BASE;
int x;
@@ -1591,7 +1591,7 @@ static void shutdown_one(struct pci_dev *pdev)
set_bit(MLX5_INTERFACE_STATE_TEARDOWN, >intf_state);
 
/* disable all interrupts */
-   mlx5_disable_interrupts(dev);
+   mlx5_shutdown_disable_interrupts(dev);
 
err = mlx5_try_fast_unload(dev);
if (err)
___
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-unsubscr...@freebsd.org"


svn commit: r358014 - in stable/12/sys/dev/mlx5: . mlx5_core

2020-02-17 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Feb 17 09:53:23 2020
New Revision: 358014
URL: https://svnweb.freebsd.org/changeset/base/358014

Log:
  MFC r357801:
  Add support for disabling and polling MSIX interrupts in mlx5core.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/12/sys/dev/mlx5/driver.h
  stable/12/sys/dev/mlx5/mlx5_core/mlx5_eq.c
  stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/mlx5/driver.h
==
--- stable/12/sys/dev/mlx5/driver.h Mon Feb 17 09:46:32 2020
(r358013)
+++ stable/12/sys/dev/mlx5/driver.h Mon Feb 17 09:53:23 2020
(r358014)
@@ -1184,4 +1184,7 @@ static inline bool mlx5_rl_is_supported(struct mlx5_co
 }
 #endif
 
+void mlx5_disable_interrupts(struct mlx5_core_dev *);
+void mlx5_poll_interrupts(struct mlx5_core_dev *);
+
 #endif /* MLX5_DRIVER_H */

Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_eq.c
==
--- stable/12/sys/dev/mlx5/mlx5_core/mlx5_eq.c  Mon Feb 17 09:46:32 2020
(r358013)
+++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_eq.c  Mon Feb 17 09:53:23 2020
(r358014)
@@ -739,3 +739,28 @@ static void mlx5_port_general_notification_event(struc
}
 }
 
+void
+mlx5_disable_interrupts(struct mlx5_core_dev *dev)
+{
+   int nvec = dev->priv.eq_table.num_comp_vectors + MLX5_EQ_VEC_COMP_BASE;
+   int x;
+
+   for (x = 0; x != nvec; x++)
+   disable_irq(dev->priv.msix_arr[x].vector);
+}
+
+void
+mlx5_poll_interrupts(struct mlx5_core_dev *dev)
+{
+   struct mlx5_eq *eq;
+
+   if (unlikely(dev->priv.disable_irqs != 0))
+   return;
+
+   mlx5_eq_int(dev, >priv.eq_table.cmd_eq);
+   mlx5_eq_int(dev, >priv.eq_table.async_eq);
+   mlx5_eq_int(dev, >priv.eq_table.pages_eq);
+
+   list_for_each_entry(eq, >priv.eq_table.comp_eqs_list, list)
+   mlx5_eq_int(dev, eq);
+}

Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c
==
--- stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.cMon Feb 17 09:46:32 
2020(r358013)
+++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.cMon Feb 17 09:53:23 
2020(r358014)
@@ -1585,7 +1585,7 @@ done:
return 0;
 }
 
-static void mlx5_disable_interrupts(struct mlx5_core_dev *mdev)
+static void mlx5_shutdown_disable_interrupts(struct mlx5_core_dev *mdev)
 {
int nvec = mdev->priv.eq_table.num_comp_vectors + MLX5_EQ_VEC_COMP_BASE;
int x;
@@ -1609,7 +1609,7 @@ static void shutdown_one(struct pci_dev *pdev)
set_bit(MLX5_INTERFACE_STATE_TEARDOWN, >intf_state);
 
/* disable all interrupts */
-   mlx5_disable_interrupts(dev);
+   mlx5_shutdown_disable_interrupts(dev);
 
err = mlx5_try_fast_unload(dev);
if (err)
___
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-unsubscr...@freebsd.org"


svn commit: r358013 - in head/sys: net netinet netinet6

2020-02-17 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Feb 17 09:46:32 2020
New Revision: 358013
URL: https://svnweb.freebsd.org/changeset/base/358013

Log:
  Fix kernel panic while trying to read multicast stream.
  
  When VIMAGE is enabled make sure the "m_pkthdr.rcvif" pointer is set
  for all mbufs being input by the IGMP/MLD6 code. Else there will be a
  NULL-pointer dereference in the netisr code when trying to set the
  VNET based on the incoming mbuf. Add an assert to catch this when
  queueing mbufs on a netisr to make debugging of similar cases easier.
  
  Found by: Vladislav V. Prodan
  PR:   244002
  Reviewed by:  bz@
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/net/netisr.c
  head/sys/netinet/igmp.c
  head/sys/netinet6/mld6.c

Modified: head/sys/net/netisr.c
==
--- head/sys/net/netisr.c   Mon Feb 17 01:59:55 2020(r358012)
+++ head/sys/net/netisr.c   Mon Feb 17 09:46:32 2020(r358013)
@@ -1056,6 +1056,8 @@ netisr_queue_src(u_int proto, uintptr_t source, struct
if (m != NULL) {
KASSERT(!CPU_ABSENT(cpuid), ("%s: CPU %u absent", __func__,
cpuid));
+   VNET_ASSERT(m->m_pkthdr.rcvif != NULL,
+   ("%s:%d rcvif == NULL: m=%p", __func__, __LINE__, m));
error = netisr_queue_internal(proto, m, cpuid);
} else
error = ENOBUFS;

Modified: head/sys/netinet/igmp.c
==
--- head/sys/netinet/igmp.c Mon Feb 17 01:59:55 2020(r358012)
+++ head/sys/netinet/igmp.c Mon Feb 17 09:46:32 2020(r358013)
@@ -303,6 +303,7 @@ igmp_save_context(struct mbuf *m, struct ifnet *ifp)
 #ifdef VIMAGE
m->m_pkthdr.PH_loc.ptr = ifp->if_vnet;
 #endif /* VIMAGE */
+   m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.flowid = ifp->if_index;
 }
 

Modified: head/sys/netinet6/mld6.c
==
--- head/sys/netinet6/mld6.cMon Feb 17 01:59:55 2020(r358012)
+++ head/sys/netinet6/mld6.cMon Feb 17 09:46:32 2020(r358013)
@@ -283,6 +283,7 @@ mld_save_context(struct mbuf *m, struct ifnet *ifp)
 #ifdef VIMAGE
m->m_pkthdr.PH_loc.ptr = ifp->if_vnet;
 #endif /* VIMAGE */
+   m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.flowid = ifp->if_index;
 }
 
___
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-unsubscr...@freebsd.org"