svn commit: r350191 - head/sys/arm64/arm64

2019-07-20 Thread Alan Cox
Author: alc
Date: Sun Jul 21 03:26:26 2019
New Revision: 350191
URL: https://svnweb.freebsd.org/changeset/base/350191

Log:
  Introduce pmap_store(), and use it to replace pmap_load_store() in places
  where the page table entry was previously invalid.  (Note that I did not
  replace pmap_load_store() when it was followed by a TLB invalidation, even
  if we are not using the return value from pmap_load_store().)
  
  Correct an error in pmap_enter().  A test for determining when to set
  PGA_WRITEABLE was always true, even if the mapping was read only.
  
  In pmap_enter_l2(), when replacing an empty kernel page table page by a
  superpage mapping, clear the old l2 entry and issue a TLB invalidation.  My
  reading of the ARM architecture manual leads me to believe that the TLB
  could hold an intermediate entry referencing the empty kernel page table
  page even though it contains no valid mappings.
  
  Replace a couple direct uses of atomic_clear_64() by the new
  pmap_clear_bits().
  
  In a couple comments, replace the term "paging-structure caches", which is
  an Intel-specific term for the caches that hold intermediate entries in the
  page table, with wording that is more consistent with the ARM architecture
  manual.
  
  Reviewed by:  markj
  X-MFC after:  r350004
  Differential Revision:https://reviews.freebsd.org/D20998

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

Modified: head/sys/arm64/arm64/pmap.c
==
--- head/sys/arm64/arm64/pmap.c Sun Jul 21 03:19:54 2019(r350190)
+++ head/sys/arm64/arm64/pmap.c Sun Jul 21 03:26:26 2019(r350191)
@@ -328,6 +328,7 @@ static __inline vm_page_t pmap_remove_pt_page(pmap_t p
 #definepmap_load_clear(table)  atomic_swap_64(table, 0)
 #definepmap_load_store(table, entry)   atomic_swap_64(table, entry)
 #definepmap_set_bits(table, bits)  atomic_set_64(table, bits)
+#definepmap_store(table, entry)atomic_store_64(table, entry)
 
 //
 /* Inline functions */
@@ -637,7 +638,7 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t mi
(vm_offset_t)l2);
freemempos += PAGE_SIZE;
 
-   pmap_load_store(_dmap[l1_slot],
+   pmap_store(_dmap[l1_slot],
(l2_pa & ~Ln_TABLE_MASK) | L1_TABLE);
 
memset(l2, 0, PAGE_SIZE);
@@ -655,7 +656,7 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t mi
 
l2_slot = pmap_l2_index(va);
KASSERT(l2_slot != 0, ("..."));
-   pmap_load_store([l2_slot],
+   pmap_store([l2_slot],
(pa & ~L2_OFFSET) | ATTR_DEFAULT | ATTR_XN |
ATTR_IDX(CACHED_MEMORY) | L2_BLOCK);
}
@@ -667,7 +668,7 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t mi
(physmap[i + 1] - pa) >= L1_SIZE;
pa += L1_SIZE, va += L1_SIZE) {
l1_slot = ((va - DMAP_MIN_ADDRESS) >> L1_SHIFT);
-   pmap_load_store(_dmap[l1_slot],
+   pmap_store(_dmap[l1_slot],
(pa & ~L1_OFFSET) | ATTR_DEFAULT | ATTR_XN |
ATTR_IDX(CACHED_MEMORY) | L1_BLOCK);
}
@@ -682,7 +683,7 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t mi
(vm_offset_t)l2);
freemempos += PAGE_SIZE;
 
-   pmap_load_store(_dmap[l1_slot],
+   pmap_store(_dmap[l1_slot],
(l2_pa & ~Ln_TABLE_MASK) | L1_TABLE);
 
memset(l2, 0, PAGE_SIZE);
@@ -692,7 +693,7 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t mi
for (; va < DMAP_MAX_ADDRESS && pa < physmap[i + 1];
pa += L2_SIZE, va += L2_SIZE) {
l2_slot = pmap_l2_index(va);
-   pmap_load_store([l2_slot],
+   pmap_store([l2_slot],
(pa & ~L2_OFFSET) | ATTR_DEFAULT | ATTR_XN |
ATTR_IDX(CACHED_MEMORY) | L2_BLOCK);
}
@@ -727,7 +728,7 @@ pmap_bootstrap_l2(vm_offset_t l1pt, vm_offset_t va, vm
KASSERT(l1_slot < Ln_ENTRIES, ("Invalid L1 index"));
 
pa = pmap_early_vtophys(l1pt, l2pt);
-   pmap_load_store([l1_slot],
+   pmap_store([l1_slot],
(pa & ~Ln_TABLE_MASK) | L1_TABLE);
l2pt += PAGE_SIZE;
}
@@ -757,7 +758,7 @@ pmap_bootstrap_l3(vm_offset_t 

svn commit: r350190 - head/sys/powerpc/aim

2019-07-20 Thread Justin Hibbits
Author: jhibbits
Date: Sun Jul 21 03:19:54 2019
New Revision: 350190
URL: https://svnweb.freebsd.org/changeset/base/350190

Log:
  powerpc: Remove an unnecessary #ifdef guard from slb.c
  
  slb.c is only compiled for powerpc64, so no need for the #ifdef in this block.

Modified:
  head/sys/powerpc/aim/slb.c

Modified: head/sys/powerpc/aim/slb.c
==
--- head/sys/powerpc/aim/slb.c  Sun Jul 21 00:47:06 2019(r350189)
+++ head/sys/powerpc/aim/slb.c  Sun Jul 21 03:19:54 2019(r350190)
@@ -545,7 +545,6 @@ slb_free_user_cache(struct slb **slb)
uma_zfree(slb_cache_zone, slb);
 }
 
-#if defined(__powerpc64__)
 /* Handle kernel SLB faults -- runs in real mode, all seat belts off */
 void
 handle_kernel_slb_spill(int type, register_t dar, register_t srr0)
@@ -626,4 +625,3 @@ handle_user_slb_spill(pmap_t pm, vm_offset_t addr)
 
return (0);
 }
-#endif
___
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: r350189 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet

2019-07-20 Thread Cy Schubert
Author: cy
Date: Sun Jul 21 00:47:06 2019
New Revision: 350189
URL: https://svnweb.freebsd.org/changeset/base/350189

Log:
  MFC r349980:
  
  Calculate the offset of the interface name using FR_NAME rather than
  calclulating it "by hand". This improves consistency with the rest of
  the code and is in line with planned fixes and other work.

Modified:
  stable/11/sys/contrib/ipfilter/netinet/ip_state.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/sys/contrib/ipfilter/netinet/ip_state.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/sys/contrib/ipfilter/netinet/ip_state.c
==
--- stable/11/sys/contrib/ipfilter/netinet/ip_state.c   Sun Jul 21 00:44:52 
2019(r350188)
+++ stable/11/sys/contrib/ipfilter/netinet/ip_state.c   Sun Jul 21 00:47:06 
2019(r350189)
@@ -980,7 +980,7 @@ ipf_state_putent(softc, softs, data)
fr->fr_ifas[i] = NULL;
continue;
}
-   name = fr->fr_names + fr->fr_ifnames[i];
+   name = FR_NAME(fr, fr_ifnames[i]);
fr->fr_ifas[i] = ipf_resolvenic(softc, name,
fr->fr_family);
}
@@ -1794,7 +1794,7 @@ ipf_state_add(softc, fin, stsave, flags)
 fr->fr_names[fr->fr_ifnames[out << 1] + 1] == '\0')) {
is->is_ifp[out << 1] = fr->fr_ifas[0];
strncpy(is->is_ifname[out << 1],
-   fr->fr_names + fr->fr_ifnames[0],
+   FR_NAME(fr, fr_ifnames[0]),
sizeof(fr->fr_ifnames[0]));
} else {
is->is_ifp[out << 1] = fin->fin_ifp;
@@ -1805,21 +1805,21 @@ ipf_state_add(softc, fin, stsave, flags)
is->is_ifp[(out << 1) + 1] = fr->fr_ifas[1];
if (fr->fr_ifnames[1] != -1) {
strncpy(is->is_ifname[(out << 1) + 1],
-   fr->fr_names + fr->fr_ifnames[1],
+   FR_NAME(fr, fr_ifnames[1]),
sizeof(fr->fr_ifnames[1]));
}
 
is->is_ifp[(1 - out) << 1] = fr->fr_ifas[2];
if (fr->fr_ifnames[2] != -1) {
strncpy(is->is_ifname[((1 - out) << 1)],
-   fr->fr_names + fr->fr_ifnames[2],
+   FR_NAME(fr, fr_ifnames[2]),
sizeof(fr->fr_ifnames[2]));
}
 
is->is_ifp[((1 - out) << 1) + 1] = fr->fr_ifas[3];
if (fr->fr_ifnames[3] != -1) {
strncpy(is->is_ifname[((1 - out) << 1) + 1],
-   fr->fr_names + fr->fr_ifnames[3],
+   FR_NAME(fr, fr_ifnames[3]),
sizeof(fr->fr_ifnames[3]));
}
} else {
___
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: r350189 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet

2019-07-20 Thread Cy Schubert
Author: cy
Date: Sun Jul 21 00:47:06 2019
New Revision: 350189
URL: https://svnweb.freebsd.org/changeset/base/350189

Log:
  MFC r349980:
  
  Calculate the offset of the interface name using FR_NAME rather than
  calclulating it "by hand". This improves consistency with the rest of
  the code and is in line with planned fixes and other work.

Modified:
  stable/12/sys/contrib/ipfilter/netinet/ip_state.c
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/contrib/ipfilter/netinet/ip_state.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/sys/contrib/ipfilter/netinet/ip_state.c
==
--- stable/12/sys/contrib/ipfilter/netinet/ip_state.c   Sun Jul 21 00:44:52 
2019(r350188)
+++ stable/12/sys/contrib/ipfilter/netinet/ip_state.c   Sun Jul 21 00:47:06 
2019(r350189)
@@ -980,7 +980,7 @@ ipf_state_putent(softc, softs, data)
fr->fr_ifas[i] = NULL;
continue;
}
-   name = fr->fr_names + fr->fr_ifnames[i];
+   name = FR_NAME(fr, fr_ifnames[i]);
fr->fr_ifas[i] = ipf_resolvenic(softc, name,
fr->fr_family);
}
@@ -1794,7 +1794,7 @@ ipf_state_add(softc, fin, stsave, flags)
 fr->fr_names[fr->fr_ifnames[out << 1] + 1] == '\0')) {
is->is_ifp[out << 1] = fr->fr_ifas[0];
strncpy(is->is_ifname[out << 1],
-   fr->fr_names + fr->fr_ifnames[0],
+   FR_NAME(fr, fr_ifnames[0]),
sizeof(fr->fr_ifnames[0]));
} else {
is->is_ifp[out << 1] = fin->fin_ifp;
@@ -1805,21 +1805,21 @@ ipf_state_add(softc, fin, stsave, flags)
is->is_ifp[(out << 1) + 1] = fr->fr_ifas[1];
if (fr->fr_ifnames[1] != -1) {
strncpy(is->is_ifname[(out << 1) + 1],
-   fr->fr_names + fr->fr_ifnames[1],
+   FR_NAME(fr, fr_ifnames[1]),
sizeof(fr->fr_ifnames[1]));
}
 
is->is_ifp[(1 - out) << 1] = fr->fr_ifas[2];
if (fr->fr_ifnames[2] != -1) {
strncpy(is->is_ifname[((1 - out) << 1)],
-   fr->fr_names + fr->fr_ifnames[2],
+   FR_NAME(fr, fr_ifnames[2]),
sizeof(fr->fr_ifnames[2]));
}
 
is->is_ifp[((1 - out) << 1) + 1] = fr->fr_ifas[3];
if (fr->fr_ifnames[3] != -1) {
strncpy(is->is_ifname[((1 - out) << 1) + 1],
-   fr->fr_names + fr->fr_ifnames[3],
+   FR_NAME(fr, fr_ifnames[3]),
sizeof(fr->fr_ifnames[3]));
}
} else {
___
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: r350188 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet

2019-07-20 Thread Cy Schubert
Author: cy
Date: Sun Jul 21 00:44:52 2019
New Revision: 350188
URL: https://svnweb.freebsd.org/changeset/base/350188

Log:
  MFC r349979:
  
  Recycle the unused FR_CMPSIZ macro which became orphaned in ipfilter 5
  prior to its import into FreeBSD. This macro calculates the size to be
  compared within the frentry structure. The ipfilter 4 version of the
  macro calculated the compare size based upon the static size of the
  frentry struct. Today it uses the ipfilter 5 method of calculating the
  size based upon the new to ipfilter 5 fr_size value found in the
  frentry struct itself.
  
  No effective change in code is intended.

Modified:
  stable/11/sys/contrib/ipfilter/netinet/fil.c
  stable/11/sys/contrib/ipfilter/netinet/ip_fil.h
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/sys/contrib/ipfilter/netinet/fil.c
  stable/12/sys/contrib/ipfilter/netinet/ip_fil.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c
==
--- stable/11/sys/contrib/ipfilter/netinet/fil.cSat Jul 20 21:39:32 
2019(r350187)
+++ stable/11/sys/contrib/ipfilter/netinet/fil.cSun Jul 21 00:44:52 
2019(r350188)
@@ -4436,8 +4436,8 @@ ipf_rule_compare(frentry_t *fr1, frentry_t *fr2)
return (2);
if (fr1->fr_dsize != fr2->fr_dsize)
return (3);
-   if (bcmp((char *)>fr_func, (char *)>fr_func,
-fr1->fr_size - offsetof(struct frentry, fr_func)) != 0)
+   if (bcmp((char *)>fr_func, (char *)>fr_func, FR_CMPSIZ(fr1))
+   != 0)
return (4);
if (fr1->fr_data && !fr2->fr_data)
return (5);

Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil.h
==
--- stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Sat Jul 20 21:39:32 
2019(r350187)
+++ stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Sun Jul 21 00:44:52 
2019(r350188)
@@ -827,7 +827,7 @@ typedef struct  frentry {
 
 #defineFR_NOLOGTAG 0
 
-#defineFR_CMPSIZ   (sizeof(struct frentry) - \
+#defineFR_CMPSIZ(_f)   ((_f)->fr_size - \
 offsetof(struct frentry, fr_func))
 #defineFR_NAME(_f, _n) (_f)->fr_names + (_f)->_n
 
___
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: r350188 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet

2019-07-20 Thread Cy Schubert
Author: cy
Date: Sun Jul 21 00:44:52 2019
New Revision: 350188
URL: https://svnweb.freebsd.org/changeset/base/350188

Log:
  MFC r349979:
  
  Recycle the unused FR_CMPSIZ macro which became orphaned in ipfilter 5
  prior to its import into FreeBSD. This macro calculates the size to be
  compared within the frentry structure. The ipfilter 4 version of the
  macro calculated the compare size based upon the static size of the
  frentry struct. Today it uses the ipfilter 5 method of calculating the
  size based upon the new to ipfilter 5 fr_size value found in the
  frentry struct itself.
  
  No effective change in code is intended.

Modified:
  stable/12/sys/contrib/ipfilter/netinet/fil.c
  stable/12/sys/contrib/ipfilter/netinet/ip_fil.h
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/contrib/ipfilter/netinet/fil.c
  stable/11/sys/contrib/ipfilter/netinet/ip_fil.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c
==
--- stable/12/sys/contrib/ipfilter/netinet/fil.cSat Jul 20 21:39:32 
2019(r350187)
+++ stable/12/sys/contrib/ipfilter/netinet/fil.cSun Jul 21 00:44:52 
2019(r350188)
@@ -4436,8 +4436,8 @@ ipf_rule_compare(frentry_t *fr1, frentry_t *fr2)
return (2);
if (fr1->fr_dsize != fr2->fr_dsize)
return (3);
-   if (bcmp((char *)>fr_func, (char *)>fr_func,
-fr1->fr_size - offsetof(struct frentry, fr_func)) != 0)
+   if (bcmp((char *)>fr_func, (char *)>fr_func, FR_CMPSIZ(fr1))
+   != 0)
return (4);
if (fr1->fr_data && !fr2->fr_data)
return (5);

Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil.h
==
--- stable/12/sys/contrib/ipfilter/netinet/ip_fil.h Sat Jul 20 21:39:32 
2019(r350187)
+++ stable/12/sys/contrib/ipfilter/netinet/ip_fil.h Sun Jul 21 00:44:52 
2019(r350188)
@@ -827,7 +827,7 @@ typedef struct  frentry {
 
 #defineFR_NOLOGTAG 0
 
-#defineFR_CMPSIZ   (sizeof(struct frentry) - \
+#defineFR_CMPSIZ(_f)   ((_f)->fr_size - \
 offsetof(struct frentry, fr_func))
 #defineFR_NAME(_f, _n) (_f)->fr_names + (_f)->_n
 
___
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: r350187 - head/sbin/fsck_ffs

2019-07-20 Thread Kirk McKusick
Author: mckusick
Date: Sat Jul 20 21:39:32 2019
New Revision: 350187
URL: https://svnweb.freebsd.org/changeset/base/350187

Log:
  Treat any inode with bad content as unknown (i.e., ask if it should
  be cleared).
  
  Sponsored by: Netflix

Modified:
  head/sbin/fsck_ffs/pass1.c

Modified: head/sbin/fsck_ffs/pass1.c
==
--- head/sbin/fsck_ffs/pass1.c  Sat Jul 20 21:20:40 2019(r350186)
+++ head/sbin/fsck_ffs/pass1.c  Sat Jul 20 21:39:32 2019(r350187)
@@ -251,7 +251,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r
int j, ret, offset;
 
if ((dp = getnextinode(inumber, rebuildcg)) == NULL)
-   return (0);
+   goto unknown;
mode = DIP(dp, di_mode) & IFMT;
if (mode == 0) {
if ((sblock.fs_magic == FS_UFS1_MAGIC &&
___
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: r350186 - head/sbin/fsck_ffs

2019-07-20 Thread Kirk McKusick
Author: mckusick
Date: Sat Jul 20 21:20:40 2019
New Revision: 350186
URL: https://svnweb.freebsd.org/changeset/base/350186

Log:
  When running with journaled soft updates, some updated inodes were not
  having their check hashes recomputed which resulted in spurious inode
  check-hash errors when the system came back up after a crash.
  
  Reported by:  Alan Somers
  Sponsored by: Netflix

Modified:
  head/sbin/fsck_ffs/suj.c

Modified: head/sbin/fsck_ffs/suj.c
==
--- head/sbin/fsck_ffs/suj.cSat Jul 20 21:10:27 2019(r350185)
+++ head/sbin/fsck_ffs/suj.cSat Jul 20 21:20:40 2019(r350186)
@@ -431,17 +431,28 @@ ino_dirty(ino_t ino)
struct iblkhd *hd;
struct suj_cg *sc;
ufs2_daddr_t blk;
+   int off;
 
blk = ino_to_fsba(fs, ino);
sc = cg_lookup(ino_to_cg(fs, ino));
iblk = sc->sc_lastiblk;
if (iblk && iblk->ib_blk == blk) {
+   if (fs->fs_magic == FS_UFS2_MAGIC) {
+   off = ino_to_fsbo(fs, ino);
+   ffs_update_dinode_ckhash(fs,
+   &((struct ufs2_dinode *)iblk->ib_buf)[off]);
+   }
iblk->ib_dirty = 1;
return;
}
hd = >sc_iblkhash[SUJ_HASH(fragstoblks(fs, blk))];
LIST_FOREACH(iblk, hd, ib_next) {
if (iblk->ib_blk == blk) {
+   if (fs->fs_magic == FS_UFS2_MAGIC) {
+   off = ino_to_fsbo(fs, ino);
+   ffs_update_dinode_ckhash(fs,
+   &((struct ufs2_dinode *)iblk->ib_buf)[off]);
+   }
iblk->ib_dirty = 1;
return;
}
___
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: r350185 - head/sys/dev/iicbus

2019-07-20 Thread Ian Lepore
Author: ian
Date: Sat Jul 20 21:10:27 2019
New Revision: 350185
URL: https://svnweb.freebsd.org/changeset/base/350185

Log:
  Rewrite the nxprtc chip init to extend battery life by using power-saving
  features offered by the chips.
  
  For 2127 and 2129 chips, fix the detection of when chip-init is needed.  The
  chip config needs to be reset whenever power was lost, but the logic was
  wrong for 212x chips (it only worked for 8523).  Now the "oscillator
  stopped" bit rather than the power manager mode is used to detect startup
  after powerfail.
  
  For all chips, disable the clock output pin.
  
  For chips that have a timestamp/tamper-monitor feature, turn off monitoring
  of the timestamp trigger pin.
  
  The 8523, 2127, and 2129 chips have a "power manager" feature that offers
  several options.  We've been using the default mode which enables
  everything.  Now the code sets the power manager options to
  
   - direct-switch (when Vdd < Vbat, without extra threshold check)
   - no battery monitor
   - no external powerfail monitor
  
  This reduces the current draw while running on battery from 1930nA to 880nA,
  which should roughly double the lifespan of the battery under load.
  
  Because battery checking is a nice thing to have, the code now does a check
  at startup, and then once a day after that, instead of checking continuously
  (but only actually reporting at startup).  The battery check is now done by
  setting the power manager back to default mode, sleeping briefly while it
  makes a voltage measurement, then switching back to power-saving mode.

Modified:
  head/sys/dev/iicbus/nxprtc.c

Modified: head/sys/dev/iicbus/nxprtc.c
==
--- head/sys/dev/iicbus/nxprtc.cSat Jul 20 20:56:31 2019
(r350184)
+++ head/sys/dev/iicbus/nxprtc.cSat Jul 20 21:10:27 2019
(r350185)
@@ -106,6 +106,9 @@ __FBSDID("$FreeBSD$");
 #definePCF2127_B_TMR_CD0x40/* Run in countdown mode */
 #definePCF2127_B_TMR_64HZ  0x01/* Timer frequency 64Hz */
 
+#definePCF2127_R_TS_CTL0x12/* Timestamp control */
+#definePCF2127_B_TSOFF 0x40/* Turn off timestamp function 
*/
+
 /*
  * PCA/PCF2129-specific registers, bits, and masks.
  */
@@ -134,12 +137,16 @@ __FBSDID("$FreeBSD$");
 #definePCF8523_M_CS3_PM0xE0/* Power mode mask */
 #definePCF8523_B_CS3_PM_NOBAT  0xE0/* PM bits: no battery usage */
 #definePCF8523_B_CS3_PM_STD0x00/* PM bits: standard */
+#definePCF8523_B_CS3_PM_DSNBM  0xa0/* PM bits: direct switch, no 
bat mon */
 #definePCF8523_B_CS3_BLF   0x04/* Battery Low Flag bit */
 
 /*
  * PCF8563-specific registers, bits, and masks.
  */
 #definePCF8563_R_SECOND0x02/* Seconds */
+
+#definePCF8563_R_CLKOUT0x0d/* Clock output control */
+
 #definePCF8563_R_TMR_CTRL  0x0e/* Timer control */
 #definePCF8563_R_TMR_COUNT 0x0f/* Timer count */
 
@@ -196,10 +203,12 @@ struct nxprtc_softc {
config_hook;
u_int   flags;  /* SC_F_* flags */
u_int   chiptype;   /* Type of PCF85xx chip */
+   time_t  bat_time;   /* Next time to check battery */
uint8_t secaddr;/* Address of seconds register */
uint8_t tmcaddr;/* Address of timer count register */
booluse_timer;  /* Use timer for fractional sec */
booluse_ampm;   /* Chip is set to use am/pm mode */
+   boolis212x; /* Chip type is 2127 or 2129 */
 };
 
 #defineSC_F_CPOL   (1 << 0)/* Century bit means 19xx */
@@ -347,108 +356,153 @@ write_timeregs(struct nxprtc_softc *sc, struct time_re
 }
 
 static int
-pcf8523_start(struct nxprtc_softc *sc)
+pcf8523_battery_check(struct nxprtc_softc *sc)
 {
+   struct timespec ts;
int err;
-   uint8_t cs1, cs3, clkout;
-   bool is212x;
+   uint8_t cs3;
 
-   switch (sc->chiptype) {
-   case TYPE_PCF2127:
-   case TYPE_PCA2129:
-   case TYPE_PCF2129:
-   is212x = true;
-   break;
-   default:
-   is212x = false;
-   break;
-   }
+   /* We check the battery when starting up, and then only once a day. */
+   getnanouptime();
+   if (ts.tv_sec < sc->bat_time)
+   return (0);
+   sc->bat_time = ts.tv_sec + (60 * 60 * 24);
 
-   /* Read and sanity-check the control registers. */
-   if ((err = read_reg(sc, PCF85xx_R_CS1, )) != 0) {
-   device_printf(sc->dev, "cannot read RTC CS1 control\n");
+   /*
+* The 8523, 2127, and 2129 chips have a "power manager" which includes
+* an optional battery voltage monitor and several choices for power
+* 

svn commit: r350184 - in head: libexec/rc/rc.d release/picobsd/tinyware/login share/man/man5 usr.bin/login

2019-07-20 Thread Conrad Meyer
Author: cem
Date: Sat Jul 20 20:56:31 2019
New Revision: 350184
URL: https://svnweb.freebsd.org/changeset/base/350184

Log:
  motd: Generate from template to /var/run
  
  Update login(1), its manual pages, similar utilities, and motd.5 to refer to
  the new location.
  
  Suggested by: delphij@ (re: r349256)
  Reviewed by:  bcr (manpages), delphij
  Differential Revision:https://reviews.freebsd.org/D20721

Added:
  head/usr.bin/login/motd.template
 - copied, changed from r350183, head/usr.bin/login/motd
Deleted:
  head/usr.bin/login/motd
Modified:
  head/libexec/rc/rc.d/motd
  head/release/picobsd/tinyware/login/pathnames.h
  head/share/man/man5/motd.5
  head/usr.bin/login/Makefile
  head/usr.bin/login/login.1
  head/usr.bin/login/login.conf
  head/usr.bin/login/pathnames.h

Modified: head/libexec/rc/rc.d/motd
==
--- head/libexec/rc/rc.d/motd   Sat Jul 20 20:47:07 2019(r350183)
+++ head/libexec/rc/rc.d/motd   Sat Jul 20 20:56:31 2019(r350184)
@@ -4,48 +4,52 @@
 #
 
 # PROVIDE: motd
-# REQUIRE: mountcritremote
+# REQUIRE: mountcritremote FILESYSTEMS
 # BEFORE:  LOGIN
 
 . /etc/rc.subr
 
 name="motd"
-desc="Update /etc/motd"
+desc="Update /var/run/motd"
 rcvar="update_motd"
 start_cmd="motd_start"
 stop_cmd=":"
 
+COMPAT_MOTD="/etc/motd"
+TARGET="/var/run/motd"
+TEMPLATE="/etc/motd.template"
 PERMS="644"
 
 motd_start()
 {
-   #   Update kernel info in /etc/motd
+   #   Update kernel info in /var/run/motd
#   Must be done *before* interactive logins are possible
#   to prevent possible race conditions.
#
check_startmsgs && echo -n 'Updating motd:'
-   if [ ! -f /etc/motd ]; then
-   install -c -o root -g wheel -m ${PERMS} /dev/null /etc/motd
+   if [ ! -f "${TEMPLATE}" ]; then
+   # Create missing template from existing regular motd file, if
+   # one exists.
+   if [ -f "${COMPAT_MOTD}" ]; then
+   sed '1{/^FreeBSD.*/{d;};};' "${COMPAT_MOTD}" > 
"${TEMPLATE}"
+   chmod $PERMS "${TEMPLATE}"
+   rm -f "${COMPAT_MOTD}"
+   else
+   # Otherwise, create an empty template file.
+   install -c -o root -g wheel -m ${PERMS} /dev/null 
"${TEMPLATE}"
+   fi
+   # Provide compatibility symlink:
+   if [ ! -h "${COMPAT_MOTD}" ]; then
+   ln -sF "${TARGET}" "${COMPAT_MOTD}"
+   fi
fi
 
-   if [ ! -w /etc/motd ]; then
-   echo ' /etc/motd is not writable, update failed.'
-   return
-   fi
-
T=`mktemp -t motd`
uname -v | sed -e 's,^\([^#]*\) #\(.* 
[1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > ${T}
-   awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} 
else {print}}' < /etc/motd >> ${T}
+   cat "${TEMPLATE}" >> ${T}
 
-   if ! cmp -s $T /etc/motd; then
-   mv -f $T /etc/.motd.tmp
-   fsync /etc/.motd.tmp
-   mv -f /etc/.motd.tmp /etc/motd
-   chmod ${PERMS} /etc/motd
-   fsync /etc
-   else
-   rm -f $T
-   fi
+   install -C -o root -g wheel -m "${PERMS}" "$T" "${TARGET}"
+   rm -f "$T"
 
check_startmsgs && echo '.'
 }

Modified: head/release/picobsd/tinyware/login/pathnames.h
==
--- head/release/picobsd/tinyware/login/pathnames.h Sat Jul 20 20:47:07 
2019(r350183)
+++ head/release/picobsd/tinyware/login/pathnames.h Sat Jul 20 20:56:31 
2019(r350184)
@@ -39,7 +39,7 @@
 #include 
 
 #define_PATH_HUSHLOGIN ".hushlogin"
-#define_PATH_MOTDFILE  "/etc/motd"
+#define_PATH_MOTDFILE  "/var/run/motd"
 #define _PATH_LOGACCESS"/etc/login.access"
 #define _PATH_FBTAB"/etc/fbtab"
 #define _PATH_LOGINDEVPERM "/etc/logindevperm"

Modified: head/share/man/man5/motd.5
==
--- head/share/man/man5/motd.5  Sat Jul 20 20:47:07 2019(r350183)
+++ head/share/man/man5/motd.5  Sat Jul 20 20:56:31 2019(r350184)
@@ -3,7 +3,7 @@
 .\" This file is in the public domain.
 .\" $FreeBSD$
 .\"
-.Dd February 13, 1997
+.Dd July 20, 2019
 .Dt MOTD 5
 .Os
 .Sh NAME
@@ -11,13 +11,16 @@
 .Nd file containing message(s) of the day
 .Sh DESCRIPTION
 The file
-.Pa /etc/motd
+.Pa /var/run/motd
 is normally displayed by
 .Xr login 1
 after a user has logged in but before the shell is run.
 It is generally used for important system-wide announcements.
 During system startup, a line containing the kernel version string is
-prepended to this file.
+prepended to
+.Pa /etc/motd.template
+and the contents are written to
+.Pa 

svn commit: r350183 - head/sbin/swapon

2019-07-20 Thread Doug Moore
Author: dougm
Date: Sat Jul 20 20:47:07 2019
New Revision: 350183
URL: https://svnweb.freebsd.org/changeset/base/350183

Log:
  In trimming on startup, invoke swapon before closing the fd used for
  trimming so that a geli device isn't detached before swapon is
  invoked.
  
  Submitted by: sigsys_gmail.com
  Discussed with: alc
  Approved by: markj (mentor)
  Differential Revision:https://reviews.freebsd.org/D21006

Modified:
  head/sbin/swapon/swapon.c

Modified: head/sbin/swapon/swapon.c
==
--- head/sbin/swapon/swapon.c   Sat Jul 20 18:25:41 2019(r350182)
+++ head/sbin/swapon/swapon.c   Sat Jul 20 20:47:07 2019(r350183)
@@ -739,12 +739,12 @@ run_cmd(int *ofd, const char *cmdline, ...)
return (WEXITSTATUS(status));
 }
 
-static void
-swap_trim(const char *name)
+static int
+swapon_trim(const char *name)
 {
struct stat sb;
off_t ioarg[2], sz;
-   int fd;
+   int error, fd;
 
fd = open(name, O_WRONLY);
if (fd < 0)
@@ -762,7 +762,16 @@ swap_trim(const char *name)
ioarg[1] = sz;
if (ioctl(fd, DIOCGDELETE, ioarg) != 0)
warn("ioctl(DIOCGDELETE)");
+
+   /*
+* swapon is invoked after trimming, so that the trimming doesn't happen
+* after the device is in use for swapping, but before the fd is closed,
+* for the benefit of geli, which could otherwise detach the device,
+* before swapon, on close.
+*/
+   error = swapon(name);
close(fd);
+   return (error);
 }
 
 static const char *
@@ -770,11 +779,9 @@ swap_on_off_sfile(const char *name, int doingall)
 {
int error;
 
-   if (which_prog == SWAPON) {
-   if (Eflag)
-   swap_trim(name);
-   error = swapon(name);
-   } else /* SWAPOFF */
+   if (which_prog == SWAPON)
+   error = Eflag ? swapon_trim(name) : swapon(name);
+   else /* SWAPOFF */
error = swapoff(name);
 
if (error == -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"


Re: svn commit: r350179 - head/lib/libutil

2019-07-20 Thread Bruce Evans

On Sat, 20 Jul 2019, John Baldwin wrote:


Log:
 expand_number(3) parses suffixes, not prefixes.


This is not quite correct, although conflating prefixes and suffixes is
one of the bugs that I pointed out in mails about [de]humanize_number and
expand_number() long ago.

Bugs in expand_number() start with its name.  It doesn't expand numbers.
It parses strings and produces integers with a wrong limited type/range
(uint64_t instead of uintmax_t plus sign info).  I don't know what it
means to expand a number, but this is close to the opposite.

expand_number() is not nearly as badly designed as humanize_number().
humanize_number() doesn't humanize numbers.  It converts integers with
a different wrong limited type/range (int64_t instead of uint64_t plus
sign info) to a hideous/dehumanized string format.  The humanized format
would be decimal decimal.  humanize_number() produces a scientific format.

humanize_number() still documents SI prefixes, and has a suffix arg which
gives the units.  Its SI prefixes are prefixes to the suffix.  E.g., a
prefix of "K" and a suffix of "B" gives units of non-disk-marketers
kilobytes.  It is only when the suffix is null that the prefix becomes
a suffix.  Most quantities have units, but it is common to omit the units
in the string representation to save space.  expand_number() doesn't even
support units, except it treats the suffix "B" or "b" as a null unit
provided it doesn't have a prefix (e.g., "1B" gives 1, byut "1KB" is a 
syntax error).


strtonum() uses the long long abomination instead of the correct type
(uintmax_t with sign info).  Its name is better, but uses the precious
str* namespace for a badly designed API.

I would prefer a strtonum() that is more like expand_number() (not too
much error handling) but handles any number of suffixes and multipliers
like the number-parsing function in dd.  This should be almost as easy
to use as atoi(), but have some error handling.  E.g.,

uintmax_t strtonum(const char *nptr, const char *errspec, ...);

where simple uses use errspec = NULL to get default error handling
similar to expand_number().  errspec would need 3 specifiers to specify
the last 3 args in the current strtonum().


Modified: head/lib/libutil/expand_number.3
==
--- head/lib/libutil/expand_number.3Sat Jul 20 15:59:49 2019
(r350178)
+++ head/lib/libutil/expand_number.3Sat Jul 20 16:03:54 2019
(r350179)
@@ -42,11 +42,10 @@
.Sh DESCRIPTION
The
.Fn expand_number
-function unformats the
+function parses the


Better.

The supported formats are still undocumented.  Not even that they are
integers.  They may have leading whitespace and signs, or hex and octal
prefixes (anything parseable by strtoumax(), with special treatment of
a single optional suffix character).


.Fa buf
-string and stores a unsigned 64-bit quantity at address pointed out by the
-.Fa num
-argument.
+string and stores a unsigned 64-bit quantity at
+.Fa *num .


"unsigned 64-bit quantity" is a bad way of spelling of "uint64_t".
uint64_t's aren't quantities.


.Pp
The
.Fn expand_number
@@ -54,9 +53,9 @@ function
is case-insensitive and
follows the SI power of two convention.


There is no SI power of 2 convention according to Wikipedia.

humanize_number() and its bugs must be understood to see what this means.

Google gives approximately zero hits for "SI suffix".  It automatically
translates "SI suffix" to "SI prefix" and of course finds zillions of hits
for that.  humanize_number(3) says that it "follows the traditional
computer science conventions by default, rather than the IEE/IEC (and now
also SI) power of two convention...", but according to Wikipedia, IEC
60027-2 Amendment 2 confirms that SI only supports power of 10 prefixes.

According to Wikipedia, the power of 2 convention is IEC for kibi
through yobi, and JEDEC has the better traditional prefixes and names for
K/kilo though G/Giga.

k is documented to mean 1000 and K 1024 for humanize_number(), but
expand_number() treats both as 1024.  The other prefixes can't be
disambiguated like this.


.Pp
-The prefixes are:
-.Bl -column "Prefix" "Description" "100" -offset indent
-.It Sy "Prefix" Ta Sy "Description" Ta Sy "Multiplier"
+The suffixes are:
+.Bl -column "Suffix" "Description" "100" -offset indent
+.It Sy "Suffix" Ta Sy "Description" Ta Sy "Multiplier"
.It Li K Ta No kilo Ta 1024
.It Li M Ta No mega Ta 1048576
.It Li G Ta No giga Ta 1073741824
@@ -74,7 +73,7 @@ function will fail if:
.It Bq Er EINVAL
The given string contains no digits.
.It Bq Er EINVAL
-An unrecognized prefix was given.
+An unrecognized suffix was given.
.It Bq Er ERANGE
Result doesn't fit into 64 bits.
.El


Bruce
___
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: r350182 - head/sys/vm

2019-07-20 Thread Mark Johnston
Author: markj
Date: Sat Jul 20 18:25:41 2019
New Revision: 350182
URL: https://svnweb.freebsd.org/changeset/base/350182

Log:
  Rename vm_page_{import,release}() to vm_page_zone_{import,release}().
  
  I would like to use the name vm_page_release() for a different purpose,
  and vm_page_{import,release}() are local to vm_page.c.
  
  Reviewed by:  kib
  MFC after:1 week

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Sat Jul 20 18:22:01 2019(r350181)
+++ head/sys/vm/vm_page.c   Sat Jul 20 18:25:41 2019(r350182)
@@ -168,9 +168,9 @@ static int vm_page_reclaim_run(int req_class, int doma
 vm_page_t m_run, vm_paddr_t high);
 static int vm_domain_alloc_fail(struct vm_domain *vmd, vm_object_t object,
 int req);
-static int vm_page_import(void *arg, void **store, int cnt, int domain,
+static int vm_page_zone_import(void *arg, void **store, int cnt, int domain,
 int flags);
-static void vm_page_release(void *arg, void **store, int cnt);
+static void vm_page_zone_release(void *arg, void **store, int cnt);
 
 SYSINIT(vm_page, SI_SUB_VM, SI_ORDER_SECOND, vm_page_init, NULL);
 
@@ -210,7 +210,7 @@ vm_page_init_cache_zones(void *dummy __unused)
pgcache->pool = pool;
pgcache->zone = uma_zcache_create("vm pgcache",
sizeof(struct vm_page), NULL, NULL, NULL, NULL,
-   vm_page_import, vm_page_release, pgcache,
+   vm_page_zone_import, vm_page_zone_release, pgcache,
UMA_ZONE_MAXBUCKET | UMA_ZONE_VM);
(void)uma_zone_set_maxcache(pgcache->zone, 0);
}
@@ -2208,7 +2208,7 @@ again:
 }
 
 static int
-vm_page_import(void *arg, void **store, int cnt, int domain, int flags)
+vm_page_zone_import(void *arg, void **store, int cnt, int domain, int flags)
 {
struct vm_domain *vmd;
struct vm_pgcache *pgcache;
@@ -2231,7 +2231,7 @@ vm_page_import(void *arg, void **store, int cnt, int d
 }
 
 static void
-vm_page_release(void *arg, void **store, int cnt)
+vm_page_zone_release(void *arg, void **store, int cnt)
 {
struct vm_domain *vmd;
struct vm_pgcache *pgcache;
___
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: r350181 - head/sys/powerpc/booke

2019-07-20 Thread Justin Hibbits
Author: jhibbits
Date: Sat Jul 20 18:22:01 2019
New Revision: 350181
URL: https://svnweb.freebsd.org/changeset/base/350181

Log:
  powerpc/SPE: Enable SPV bit for EFSCFD instruction emulation
  
  EFSCFD (floating point single convert from double) emulation requires saving
  the high word of the register, which uses SPE instructions.  Enable the SPE
  to avoid an SPV Unavailable exception.
  
  MFC after:1 week

Modified:
  head/sys/powerpc/booke/spe.c

Modified: head/sys/powerpc/booke/spe.c
==
--- head/sys/powerpc/booke/spe.cSat Jul 20 17:42:46 2019
(r350180)
+++ head/sys/powerpc/booke/spe.cSat Jul 20 18:22:01 2019
(r350181)
@@ -572,6 +572,7 @@ spe_handle_fpdata(struct trapframe *frame)
frame->fixreg[rd] = frame->fixreg[ra] ^ (1U << 31);
break;
case EFSCFD:
+   mtmsr(msr | PSL_VEC);
spe_explode(, _f3, DOUBLE,
spe_save_reg_high(rb), frame->fixreg[rb]);
result = _f3;
___
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: r350180 - in head/sys: dts/arm/overlays modules/dtb/allwinner

2019-07-20 Thread Emmanuel Vadot
Author: manu
Date: Sat Jul 20 17:42:46 2019
New Revision: 350180
URL: https://svnweb.freebsd.org/changeset/base/350180

Log:
  dtso: allwinner: Add an overlay for H3 i2c0
  
  Most of the H3 boards don't enable i2c as it is unused.
  Add an overlay so it's easier for user to use i2c device.

Added:
  head/sys/dts/arm/overlays/sun8i-h3-i2c0.dtso   (contents, props changed)
Modified:
  head/sys/modules/dtb/allwinner/Makefile

Added: head/sys/dts/arm/overlays/sun8i-h3-i2c0.dtso
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dts/arm/overlays/sun8i-h3-i2c0.dtsoSat Jul 20 17:42:46 
2019(r350180)
@@ -0,0 +1,12 @@
+/dts-v1/;
+/plugin/;
+
+/ {
+   compatible = "allwinner,sun8i-h3";
+};
+
+&{/soc/i2c@1c2ac00} {
+   status = "okay";
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins>;
+};

Modified: head/sys/modules/dtb/allwinner/Makefile
==
--- head/sys/modules/dtb/allwinner/Makefile Sat Jul 20 16:03:54 2019
(r350179)
+++ head/sys/modules/dtb/allwinner/Makefile Sat Jul 20 17:42:46 2019
(r350180)
@@ -24,6 +24,7 @@ DTS=  \
sun8i-h3-orangepi-plus2e.dts
 
 DTSO=  sun8i-a83t-sid.dtso \
+   sun8i-h3-i2c0.dtso \
sun8i-h3-sid.dtso
 
 LINKS= \
___
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"


Budget Cleaners Tax Invoice

2019-07-20 Thread Budget Cleaners ® via svn-src-all


 
You have received an Invoice
Budget Cleaners
from Budget Cleaners



View your invoice online:

https://accounting.sageone.co.za/customerzone/invoice/viewinvoice?TypeId=1=ffd62228-a6b3-4a8a-bb26-2ca3c5165bba=1=30491393


Dear Valued Client.
Thank You, for using Budget Cleaners, please kindly make payment for your Tax 
invoice as stated on the above link.
Please Note, all accounts are STRICTLY payable by the 20th of each month, 
unless prior arrangements have been made with the Accounts Dept.

Thank You.
Kind Regards.
Budget Cleaners Management.


Generated by Accounting

___
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: r350179 - head/lib/libutil

2019-07-20 Thread John Baldwin
Author: jhb
Date: Sat Jul 20 16:03:54 2019
New Revision: 350179
URL: https://svnweb.freebsd.org/changeset/base/350179

Log:
  expand_number(3) parses suffixes, not prefixes.
  
  While here, tidy the opening sentence a bit.
  
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D20791

Modified:
  head/lib/libutil/expand_number.3

Modified: head/lib/libutil/expand_number.3
==
--- head/lib/libutil/expand_number.3Sat Jul 20 15:59:49 2019
(r350178)
+++ head/lib/libutil/expand_number.3Sat Jul 20 16:03:54 2019
(r350179)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 15, 2010
+.Dd July 20, 2019
 .Dt EXPAND_NUMBER 3
 .Os
 .Sh NAME
@@ -42,11 +42,10 @@
 .Sh DESCRIPTION
 The
 .Fn expand_number
-function unformats the
+function parses the
 .Fa buf
-string and stores a unsigned 64-bit quantity at address pointed out by the
-.Fa num
-argument.
+string and stores a unsigned 64-bit quantity at
+.Fa *num .
 .Pp
 The
 .Fn expand_number
@@ -54,9 +53,9 @@ function
 is case-insensitive and
 follows the SI power of two convention.
 .Pp
-The prefixes are:
-.Bl -column "Prefix" "Description" "100" -offset indent
-.It Sy "Prefix" Ta Sy "Description" Ta Sy "Multiplier"
+The suffixes are:
+.Bl -column "Suffix" "Description" "100" -offset indent
+.It Sy "Suffix" Ta Sy "Description" Ta Sy "Multiplier"
 .It Li K Ta No kilo Ta 1024
 .It Li M Ta No mega Ta 1048576
 .It Li G Ta No giga Ta 1073741824
@@ -74,7 +73,7 @@ function will fail if:
 .It Bq Er EINVAL
 The given string contains no digits.
 .It Bq Er EINVAL
-An unrecognized prefix was given.
+An unrecognized suffix was given.
 .It Bq Er ERANGE
 Result doesn't fit into 64 bits.
 .El
___
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: r350178 - head/sys/amd64/vmm/io

2019-07-20 Thread John Baldwin
Author: jhb
Date: Sat Jul 20 15:59:49 2019
New Revision: 350178
URL: https://svnweb.freebsd.org/changeset/base/350178

Log:
  Improve the precision of bhyve's vPIT.
  
  Use 'struct bintime' instead of 'sbintime_t' to manage times in vPIT
  to postpone rounding to final results rather than intermediate
  results.  In tests performed by Joyent, this reduced the error measured
  by Linux guests by 59 ppm.
  
  Smart OS bug: https://smartos.org/bugview/OS-6923
  Submitted by: Patrick Mooney
  Reviewed by:  rgrimes
  Obtained from:SmartOS / Joyent
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D20335

Modified:
  head/sys/amd64/vmm/io/vatpit.c

Modified: head/sys/amd64/vmm/io/vatpit.c
==
--- head/sys/amd64/vmm/io/vatpit.c  Sat Jul 20 15:26:21 2019
(r350177)
+++ head/sys/amd64/vmm/io/vatpit.c  Sat Jul 20 15:59:49 2019
(r350178)
@@ -2,6 +2,7 @@
  * Copyright (c) 2014 Tycho Nightingale 

  * Copyright (c) 2011 NetApp, Inc.
  * All rights reserved.
+ * Copyright (c) 2018 Joyent, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -78,7 +79,7 @@ struct vatpit_callout_arg {
 struct channel {
int mode;
uint16_tinitial;/* initial counter value */
-   sbintime_t  now_sbt;/* uptime when counter was loaded */
+   struct bintime  now_bt; /* uptime when counter was loaded */
uint8_t cr[2];
uint8_t ol[2];
boolslatched;   /* status latched */
@@ -87,7 +88,7 @@ struct channel {
int olbyte;
int frbyte;
struct callout  callout;
-   sbintime_t  callout_sbt;/* target time */
+   struct bintime  callout_bt; /* target time */
struct vatpit_callout_arg callout_arg;
 };
 
@@ -95,26 +96,41 @@ struct vatpit {
struct vm   *vm;
struct mtx  mtx;
 
-   sbintime_t  freq_sbt;
+   struct bintime  freq_bt;
 
struct channel  channel[3];
 };
 
 static void pit_timer_start_cntr0(struct vatpit *vatpit);
 
+static uint64_t
+vatpit_delta_ticks(struct vatpit *vatpit, struct channel *c)
+{
+   struct bintime delta;
+   uint64_t result;
+
+   binuptime();
+   bintime_sub(, >now_bt);
+
+   result = delta.sec * PIT_8254_FREQ;
+   result += delta.frac / vatpit->freq_bt.frac;
+
+   return (result);
+}
+
 static int
 vatpit_get_out(struct vatpit *vatpit, int channel)
 {
struct channel *c;
-   sbintime_t delta_ticks;
+   uint64_t delta_ticks;
int out;
 
c = >channel[channel];
 
switch (c->mode) {
case TIMER_INTTC:
-   delta_ticks = (sbinuptime() - c->now_sbt) / vatpit->freq_sbt;
-   out = ((c->initial - delta_ticks) <= 0);
+   delta_ticks = vatpit_delta_ticks(vatpit, c);
+   out = (delta_ticks >= c->initial);
break;
default:
out = 0;
@@ -164,24 +180,28 @@ static void
 pit_timer_start_cntr0(struct vatpit *vatpit)
 {
struct channel *c;
-   sbintime_t now, delta, precision;
+   struct bintime now, delta;
+   sbintime_t precision;
 
c = >channel[0];
if (c->initial != 0) {
-   delta = c->initial * vatpit->freq_sbt;
-   precision = delta >> tc_precexp;
-   c->callout_sbt = c->callout_sbt + delta;
+   delta.sec = 0;
+   delta.frac = vatpit->freq_bt.frac * c->initial;
+   bintime_add(>callout_bt, );
+   precision = bttosbt(delta) >> tc_precexp;
 
/*
-* Reset 'callout_sbt' if the time that the callout
+* Reset 'callout_bt' if the time that the callout
 * was supposed to fire is more than 'c->initial'
 * ticks in the past.
 */
-   now = sbinuptime();
-   if (c->callout_sbt < now)
-   c->callout_sbt = now + delta;
+   binuptime();
+   if (bintime_cmp(>callout_bt, , <)) {
+   c->callout_bt = now;
+   bintime_add(>callout_bt, );
+   }
 
-   callout_reset_sbt(>callout, c->callout_sbt,
+   callout_reset_sbt(>callout, bttosbt(c->callout_bt),
precision, vatpit_callout_handler, >callout_arg,
C_ABSOLUTE);
}
@@ -191,7 +211,7 @@ static uint16_t
 pit_update_counter(struct vatpit *vatpit, struct channel *c, bool latch)
 {
uint16_t lval;
-   sbintime_t delta_ticks;
+   uint64_t delta_ticks;
 
/* cannot latch a new value until the old one has been consumed */
if (latch && c->olbyte != 0)
@@ -207,12 

svn commit: r350177 - in head: contrib/libunwind/src contrib/llvm/tools/clang/lib/Basic lib/clang/include/clang/Basic lib/clang/include/lld/Common lib/clang/include/llvm/Support

2019-07-20 Thread Dimitry Andric
Author: dim
Date: Sat Jul 20 15:26:21 2019
New Revision: 350177
URL: https://svnweb.freebsd.org/changeset/base/350177

Log:
  Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
  8.0.1 final release r366581.  The only functional change is a fix for a
  mismerge of upstream r360816, which properly restores the r2 register
  when unwinding on PowerPC64 (See https://reviews.freebsd.org/D20337).
  
  Relnotes: yes
  PR:   236062
  MFC after:3 days
  X-MFC-With:   r349004

Modified:
  head/contrib/libunwind/src/assembly.h
  head/contrib/llvm/tools/clang/lib/Basic/Version.cpp
  head/lib/clang/include/clang/Basic/Version.inc
  head/lib/clang/include/lld/Common/Version.inc
  head/lib/clang/include/llvm/Support/VCSRevision.h
Directory Properties:
  head/contrib/compiler-rt/   (props changed)
  head/contrib/libc++/   (props changed)
  head/contrib/libunwind/   (props changed)
  head/contrib/llvm/   (props changed)
  head/contrib/llvm/tools/clang/   (props changed)
  head/contrib/llvm/tools/lld/   (props changed)
  head/contrib/llvm/tools/lldb/   (props changed)
  head/contrib/openmp/   (props changed)

Modified: head/contrib/libunwind/src/assembly.h
==
--- head/contrib/libunwind/src/assembly.h   Sat Jul 20 14:44:49 2019
(r350176)
+++ head/contrib/libunwind/src/assembly.h   Sat Jul 20 15:26:21 2019
(r350177)
@@ -117,7 +117,9 @@
   .globl SYMBOL_NAME(name) SEPARATOR  \
   HIDDEN_SYMBOL(SYMBOL_NAME(name)) SEPARATOR  \
   SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \
-  SYMBOL_NAME(name):
+  PPC64_OPD1  \
+  SYMBOL_NAME(name):  \
+  PPC64_OPD2
 
 #if defined(__arm__)
 #if !defined(__ARM_ARCH)

Modified: head/contrib/llvm/tools/clang/lib/Basic/Version.cpp
==
--- head/contrib/llvm/tools/clang/lib/Basic/Version.cpp Sat Jul 20 14:44:49 
2019(r350176)
+++ head/contrib/llvm/tools/clang/lib/Basic/Version.cpp Sat Jul 20 15:26:21 
2019(r350177)
@@ -36,7 +36,7 @@ std::string getClangRepositoryPath() {
 
   // If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us
   // pick up a tag in an SVN export, for example.
-  StringRef SVNRepository("$URL: 
https://llvm.org/svn/llvm-project/cfe/branches/release_80/lib/Basic/Version.cpp 
$");
+  StringRef SVNRepository("$URL: 
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_801/final/lib/Basic/Version.cpp
 $");
   if (URL.empty()) {
 URL = SVNRepository.slice(SVNRepository.find(':'),
   SVNRepository.find("/lib/Basic"));

Modified: head/lib/clang/include/clang/Basic/Version.inc
==
--- head/lib/clang/include/clang/Basic/Version.inc  Sat Jul 20 14:44:49 
2019(r350176)
+++ head/lib/clang/include/clang/Basic/Version.inc  Sat Jul 20 15:26:21 
2019(r350177)
@@ -8,4 +8,4 @@
 
 #defineCLANG_VENDOR"FreeBSD "
 
-#defineSVN_REVISION"364487"
+#defineSVN_REVISION"366581"

Modified: head/lib/clang/include/lld/Common/Version.inc
==
--- head/lib/clang/include/lld/Common/Version.inc   Sat Jul 20 14:44:49 
2019(r350176)
+++ head/lib/clang/include/lld/Common/Version.inc   Sat Jul 20 15:26:21 
2019(r350177)
@@ -7,4 +7,4 @@
 
 #define LLD_REPOSITORY_STRING "FreeBSD"
 // -
-#define LLD_REVISION_STRING "364487-134"
+#define LLD_REVISION_STRING "366581-134"

Modified: head/lib/clang/include/llvm/Support/VCSRevision.h
==
--- head/lib/clang/include/llvm/Support/VCSRevision.h   Sat Jul 20 14:44:49 
2019(r350176)
+++ head/lib/clang/include/llvm/Support/VCSRevision.h   Sat Jul 20 15:26:21 
2019(r350177)
@@ -1,2 +1,2 @@
 /* $FreeBSD$ */
-#define LLVM_REVISION "svn-r364487"
+#define LLVM_REVISION "svn-r366581"
___
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: r350176 - vendor/llvm-openmp/openmp-release_801-r366581

2019-07-20 Thread Dimitry Andric
Author: dim
Date: Sat Jul 20 14:44:49 2019
New Revision: 350176
URL: https://svnweb.freebsd.org/changeset/base/350176

Log:
  Tag LLVM openmp 8.0.1 release r366581.

Added:
  vendor/llvm-openmp/openmp-release_801-r366581/
 - copied from r350175, vendor/llvm-openmp/dist-release_80/
___
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: r350175 - vendor/lldb/lldb-release_801-r366581

2019-07-20 Thread Dimitry Andric
Author: dim
Date: Sat Jul 20 14:44:46 2019
New Revision: 350175
URL: https://svnweb.freebsd.org/changeset/base/350175

Log:
  Tag lldb 8.0.1 release r366581.

Added:
  vendor/lldb/lldb-release_801-r366581/
 - copied from r350174, vendor/lldb/dist-release_80/
___
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: r350173 - vendor/llvm-libunwind/libunwind-release_801-r366581

2019-07-20 Thread Dimitry Andric
Author: dim
Date: Sat Jul 20 14:44:35 2019
New Revision: 350173
URL: https://svnweb.freebsd.org/changeset/base/350173

Log:
  Tag LLVM libunwind 8.0.1 release r366581.

Added:
  vendor/llvm-libunwind/libunwind-release_801-r366581/
 - copied from r350172, vendor/llvm-libunwind/dist-release_80/
___
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: r350168 - vendor/clang/dist-release_80/lib/Basic

2019-07-20 Thread Dimitry Andric
Author: dim
Date: Sat Jul 20 14:44:17 2019
New Revision: 350168
URL: https://svnweb.freebsd.org/changeset/base/350168

Log:
  Vendor import of clang 8.0.1 release r366581:
  https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_801/final@366581

Modified:
  vendor/clang/dist-release_80/lib/Basic/Version.cpp

Modified: vendor/clang/dist-release_80/lib/Basic/Version.cpp
==
--- vendor/clang/dist-release_80/lib/Basic/Version.cpp  Sat Jul 20 14:44:06 
2019(r350167)
+++ vendor/clang/dist-release_80/lib/Basic/Version.cpp  Sat Jul 20 14:44:17 
2019(r350168)
@@ -36,7 +36,7 @@ std::string getClangRepositoryPath() {
 
   // If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us
   // pick up a tag in an SVN export, for example.
-  StringRef SVNRepository("$URL: 
https://llvm.org/svn/llvm-project/cfe/branches/release_80/lib/Basic/Version.cpp 
$");
+  StringRef SVNRepository("$URL: 
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_801/final/lib/Basic/Version.cpp
 $");
   if (URL.empty()) {
 URL = SVNRepository.slice(SVNRepository.find(':'),
   SVNRepository.find("/lib/Basic"));
___
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: r350171 - vendor/libc++/libc++-release_801-r366581

2019-07-20 Thread Dimitry Andric
Author: dim
Date: Sat Jul 20 14:44:30 2019
New Revision: 350171
URL: https://svnweb.freebsd.org/changeset/base/350171

Log:
  Tag libc++ 8.0.1 release r366581.

Added:
  vendor/libc++/libc++-release_801-r366581/
 - copied from r350170, vendor/libc++/dist-release_80/
___
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: r350172 - vendor/llvm-libunwind/dist-release_80/src

2019-07-20 Thread Dimitry Andric
Author: dim
Date: Sat Jul 20 14:44:33 2019
New Revision: 350172
URL: https://svnweb.freebsd.org/changeset/base/350172

Log:
  Vendor import of LLVM libunwind 8.0.1 release r366581:
  https://llvm.org/svn/llvm-project/libunwind/tags/RELEASE_801/final@366581

Modified:
  vendor/llvm-libunwind/dist-release_80/src/assembly.h

Modified: vendor/llvm-libunwind/dist-release_80/src/assembly.h
==
--- vendor/llvm-libunwind/dist-release_80/src/assembly.hSat Jul 20 
14:44:30 2019(r350171)
+++ vendor/llvm-libunwind/dist-release_80/src/assembly.hSat Jul 20 
14:44:33 2019(r350172)
@@ -117,7 +117,9 @@
   .globl SYMBOL_NAME(name) SEPARATOR  \
   HIDDEN_SYMBOL(SYMBOL_NAME(name)) SEPARATOR  \
   SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \
-  SYMBOL_NAME(name):
+  PPC64_OPD1  \
+  SYMBOL_NAME(name):  \
+  PPC64_OPD2
 
 #if defined(__arm__)
 #if !defined(__ARM_ARCH)
___
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: r350174 - vendor/lld/lld-release_801-r366581

2019-07-20 Thread Dimitry Andric
Author: dim
Date: Sat Jul 20 14:44:40 2019
New Revision: 350174
URL: https://svnweb.freebsd.org/changeset/base/350174

Log:
  Tag lld 8.0.1 release r366581.

Added:
  vendor/lld/lld-release_801-r366581/
 - copied from r350173, vendor/lld/dist-release_80/
___
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: r350169 - vendor/clang/clang-release_801-r366581

2019-07-20 Thread Dimitry Andric
Author: dim
Date: Sat Jul 20 14:44:19 2019
New Revision: 350169
URL: https://svnweb.freebsd.org/changeset/base/350169

Log:
  Tag clang 8.0.1 release r366581.

Added:
  vendor/clang/clang-release_801-r366581/
 - copied from r350168, vendor/clang/dist-release_80/
___
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: r350170 - vendor/compiler-rt/compiler-rt-release_801-r366581

2019-07-20 Thread Dimitry Andric
Author: dim
Date: Sat Jul 20 14:44:24 2019
New Revision: 350170
URL: https://svnweb.freebsd.org/changeset/base/350170

Log:
  Tag compiler-rt 8.0.1 release r366581.

Added:
  vendor/compiler-rt/compiler-rt-release_801-r366581/
 - copied from r350169, vendor/compiler-rt/dist-release_80/
___
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: r350167 - vendor/llvm/llvm-release_801-r366581

2019-07-20 Thread Dimitry Andric
Author: dim
Date: Sat Jul 20 14:44:06 2019
New Revision: 350167
URL: https://svnweb.freebsd.org/changeset/base/350167

Log:
  Tag llvm 8.0.1 release r366581.

Added:
  vendor/llvm/llvm-release_801-r366581/
 - copied from r350166, vendor/llvm/dist-release_80/
___
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: r350166 - in head/sys/arm64: arm64 include

2019-07-20 Thread Emmanuel Vadot
Author: manu
Date: Sat Jul 20 14:29:11 2019
New Revision: 350166
URL: https://svnweb.freebsd.org/changeset/base/350166

Log:
  arm64: Implement HWCAP
  
  Add HWCAP support for arm64.
  defines are the same as in Linux and a userland program can use
  elf_aux_info to get the data.
  We only save the common denominator for all cores in case the
  big and little cluster have different support (this is known to
  exists even if we don't support those SoCs in FreeBSD)
  
  Differential Revision:https://reviews.freebsd.org/D17137

Modified:
  head/sys/arm64/arm64/elf_machdep.c
  head/sys/arm64/arm64/identcpu.c
  head/sys/arm64/include/cpu.h
  head/sys/arm64/include/elf.h

Modified: head/sys/arm64/arm64/elf_machdep.c
==
--- head/sys/arm64/arm64/elf_machdep.c  Sat Jul 20 08:40:31 2019
(r350165)
+++ head/sys/arm64/arm64/elf_machdep.c  Sat Jul 20 14:29:11 2019
(r350166)
@@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$");
 
 #include "linker_if.h"
 
+u_long elf_hwcap;
+
 static struct sysentvec elf64_freebsd_sysvec = {
.sv_size= SYS_MAXSYSCALL,
.sv_table   = sysent,
@@ -88,6 +90,7 @@ static struct sysentvec elf64_freebsd_sysvec = {
.sv_schedtail   = NULL,
.sv_thread_detach = NULL,
.sv_trap= NULL,
+   .sv_hwcap   = _hwcap,
 };
 INIT_SYSENTVEC(elf64_sysvec, _freebsd_sysvec);
 

Modified: head/sys/arm64/arm64/identcpu.c
==
--- head/sys/arm64/arm64/identcpu.c Sat Jul 20 08:40:31 2019
(r350165)
+++ head/sys/arm64/arm64/identcpu.c Sat Jul 20 14:29:11 2019
(r350166)
@@ -44,8 +44,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 static int ident_lock;
+static void print_cpu_features(u_int cpu);
+static u_long parse_cpu_features_hwcap(u_int cpu);
 
 char machine[] = "arm64";
 
@@ -412,10 +415,14 @@ update_user_regs(u_int cpu)
}
 }
 
+/* HWCAP */
+extern u_long elf_hwcap;
+
 static void
 identify_cpu_sysinit(void *dummy __unused)
 {
int cpu;
+   u_long hwcap;
 
/* Create a user visible cpu description with safe values */
memset(_cpu_desc, 0, sizeof(user_cpu_desc));
@@ -427,6 +434,11 @@ identify_cpu_sysinit(void *dummy __unused)
 
CPU_FOREACH(cpu) {
print_cpu_features(cpu);
+   hwcap = parse_cpu_features_hwcap(cpu);
+   if (elf_hwcap == 0)
+   elf_hwcap = hwcap;
+   else
+   elf_hwcap &= hwcap;
update_user_regs(cpu);
}
 
@@ -434,7 +446,95 @@ identify_cpu_sysinit(void *dummy __unused)
 }
 SYSINIT(idenrity_cpu, SI_SUB_SMP, SI_ORDER_ANY, identify_cpu_sysinit, NULL);
 
-void
+static u_long
+parse_cpu_features_hwcap(u_int cpu)
+{
+   u_long hwcap = 0;
+
+   if (ID_AA64ISAR0_DP(cpu_desc[cpu].id_aa64isar0) == ID_AA64ISAR0_DP_IMPL)
+   hwcap |= HWCAP_ASIMDDP;
+
+   if (ID_AA64ISAR0_SM4(cpu_desc[cpu].id_aa64isar0) == 
ID_AA64ISAR0_SM4_IMPL)
+   hwcap |= HWCAP_SM4;
+
+   if (ID_AA64ISAR0_SM3(cpu_desc[cpu].id_aa64isar0) == 
ID_AA64ISAR0_SM3_IMPL)
+   hwcap |= HWCAP_SM3;
+
+   if (ID_AA64ISAR0_RDM(cpu_desc[cpu].id_aa64isar0) == 
ID_AA64ISAR0_RDM_IMPL)
+   hwcap |= HWCAP_ASIMDRDM;
+
+   if (ID_AA64ISAR0_Atomic(cpu_desc[cpu].id_aa64isar0) == 
ID_AA64ISAR0_Atomic_IMPL)
+   hwcap |= HWCAP_ATOMICS;
+
+   if (ID_AA64ISAR0_CRC32(cpu_desc[cpu].id_aa64isar0) == 
ID_AA64ISAR0_CRC32_BASE)
+   hwcap |= HWCAP_CRC32;
+
+   switch (ID_AA64ISAR0_SHA2(cpu_desc[cpu].id_aa64isar0)) {
+   case ID_AA64ISAR0_SHA2_BASE:
+   hwcap |= HWCAP_SHA2;
+   break;
+   case ID_AA64ISAR0_SHA2_512:
+   hwcap |= HWCAP_SHA2 | HWCAP_SHA512;
+   break;
+   default:
+   break;
+   }
+
+   if (ID_AA64ISAR0_SHA1(cpu_desc[cpu].id_aa64isar0))
+   hwcap |= HWCAP_SHA1;
+
+   switch (ID_AA64ISAR0_AES(cpu_desc[cpu].id_aa64isar0)) {
+   case ID_AA64ISAR0_AES_BASE:
+   hwcap |= HWCAP_AES;
+   break;
+   case ID_AA64ISAR0_AES_PMULL:
+   hwcap |= HWCAP_PMULL | HWCAP_AES;
+   break;
+   default:
+   break;
+   }
+
+   if (ID_AA64ISAR1_LRCPC(cpu_desc[cpu].id_aa64isar1) == 
ID_AA64ISAR1_LRCPC_IMPL)
+   hwcap |= HWCAP_LRCPC;
+
+   if (ID_AA64ISAR1_FCMA(cpu_desc[cpu].id_aa64isar1) == 
ID_AA64ISAR1_FCMA_IMPL)
+   hwcap |= HWCAP_FCMA;
+
+   if (ID_AA64ISAR1_JSCVT(cpu_desc[cpu].id_aa64isar1) == 
ID_AA64ISAR1_JSCVT_IMPL)
+   hwcap |= HWCAP_JSCVT;
+
+   if (ID_AA64ISAR1_DPB(cpu_desc[cpu].id_aa64isar1) == 
ID_AA64ISAR1_DPB_IMPL)
+   hwcap |= HWCAP_DCPOP;
+
+   if 

svn commit: r350165 - stable/12/share/man/man9

2019-07-20 Thread Li-Wen Hsu
Author: lwhsu
Date: Sat Jul 20 08:40:31 2019
New Revision: 350165
URL: https://svnweb.freebsd.org/changeset/base/350165

Log:
  MFC r349543
  
  Fix VOP_PUTPAGES(9) in regards to the use of VM_PAGER_CLUSTER_OK
  
  Submitted by: Ka Ho Ng 
  Reviewed by:  mckusick
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D20695

Modified:
  stable/12/share/man/man9/VOP_GETPAGES.9
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/man/man9/VOP_GETPAGES.9
==
--- stable/12/share/man/man9/VOP_GETPAGES.9 Sat Jul 20 07:04:25 2019
(r350164)
+++ stable/12/share/man/man9/VOP_GETPAGES.9 Sat Jul 20 08:40:31 2019
(r350165)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 7, 2017
+.Dd June 29, 2019
 .Dt VOP_GETPAGES 9
 .Os
 .Sh NAME
@@ -105,7 +105,7 @@ This could occur via a call to
 which puts such pages onto the head of the inactive queue.
 If
 .Dv VM_PAGER_CLUSTER_OK
-is set, writes may be performed asynchronously, so that related writes
+is set, writes may be delayed, so that related writes
 can be coalesced for efficiency, e.g.,
 using the clustering mechanism of the buffer cache.
 .It Fa rtvals
___
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: r350164 - stable/12/tests/sys/opencrypto

2019-07-20 Thread Li-Wen Hsu
Author: lwhsu
Date: Sat Jul 20 07:04:25 2019
New Revision: 350164
URL: https://svnweb.freebsd.org/changeset/base/350164

Log:
  MFC r349872:
  
  Correct definitions in sys.opencrypto.runtests.main for 32bit platform
  
  Reviewed by:  cem, jhb
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D20894

Modified:
  stable/12/tests/sys/opencrypto/cryptodev.py
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/tests/sys/opencrypto/cryptodev.py
==
--- stable/12/tests/sys/opencrypto/cryptodev.py Sat Jul 20 05:21:13 2019
(r350163)
+++ stable/12/tests/sys/opencrypto/cryptodev.py Sat Jul 20 07:04:25 2019
(r350164)
@@ -35,6 +35,7 @@ import array
 import dpkt
 from fcntl import ioctl
 import os
+import platform
 import signal
 from struct import pack as _pack
 
@@ -106,14 +107,19 @@ class CryptAEAD(dpkt.Packet):
 # h2py.py can't handle multiarg macros
 CRIOGET = 3221513060
 CIOCGSESSION = 3224396645
-CIOCGSESSION2 = 3225445226
 CIOCFSESSION = 2147771238
-CIOCCRYPT = 3224396647
 CIOCKEY = 3230688104
 CIOCASYMFEAT = 1074029417
 CIOCKEY2 = 3230688107
 CIOCFINDDEV = 3223610220
-CIOCCRYPTAEAD = 3225445229
+if platform.architecture()[0] == '64bit':
+CIOCGSESSION2 = 3225445226
+CIOCCRYPT = 3224396647
+CIOCCRYPTAEAD = 3225445229
+else:
+CIOCGSESSION2 = 3224396650
+CIOCCRYPT = 3223085927
+CIOCCRYPTAEAD = 3223872365
 
 def _getdev():
fd = os.open('/dev/crypto', os.O_RDWR)
___
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"