svn commit: r364449 - head/bin/ls

2020-08-20 Thread Gordon Bergling
Author: gbe (doc committer)
Date: Fri Aug 21 06:20:11 2020
New Revision: 364449
URL: https://svnweb.freebsd.org/changeset/base/364449

Log:
  ls(1): Update POSIX conformance from 2001 to 2008
  
  - Update the options that are non-existing in POSIX from 2001 to 2008
  - Update POSIX conformance in the STANDARDS section from 2001 to 2008
  
  Verified by checking [1].
  
  [1] https://pubs.opengroup.org/onlinepubs/9699919799.2016edition/toc.htm
  
  PR:   140435
  Submitted by: Dan Lukes 
  Reviewed by:  bcr
  Approved by:  bcr
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D26096

Modified:
  head/bin/ls/ls.1

Modified: head/bin/ls/ls.1
==
--- head/bin/ls/ls.1Fri Aug 21 03:50:25 2020(r364448)
+++ head/bin/ls/ls.1Fri Aug 21 06:20:11 2020(r364449)
@@ -32,7 +32,7 @@
 .\" @(#)ls.1   8.7 (Berkeley) 7/29/94
 .\" $FreeBSD$
 .\"
-.Dd May 21, 2020
+.Dd August 21, 2020
 .Dt LS 1
 .Os
 .Sh NAME
@@ -89,7 +89,7 @@ where
 .Va xxx
 is the numeric value of the character in octal.
 This option is not defined in
-.St -p1003.1-2001 .
+.St -p1003.1-2008 .
 .It Fl C
 Force multi-column output; this is the default when output is to a terminal.
 .It Fl D Ar format
@@ -108,7 +108,7 @@ This option overrides the
 .Fl T
 option.
 This option is not defined in
-.St -p1003.1-2001 .
+.St -p1003.1-2008 .
 .It Fl F
 Display a slash
 .Pq Ql /
@@ -141,7 +141,7 @@ in the environment and setting
 This functionality can be compiled out by removing the definition of
 .Ev COLORLS .
 This option is not defined in
-.St -p1003.1-2001 .
+.St -p1003.1-2008 .
 .It Fl H
 Symbolic links on the command line are followed.
 This option is assumed if
@@ -155,7 +155,7 @@ Prevent
 .Fl A
 from being automatically set for the super-user.
 This option is not defined in
-.St -p1003.1-2001 .
+.St -p1003.1-2008 .
 .It Fl L
 If argument is a symbolic link, list the file or directory the link references
 rather than the link itself.
@@ -184,15 +184,15 @@ The
 .Fl D
 option gives even more control over the output format.
 This option is not defined in
-.St -p1003.1-2001 .
+.St -p1003.1-2008 .
 .It Fl U
 Use time when file was created for sorting or printing.
 This option is not defined in
-.St -p1003.1-2001 .
+.St -p1003.1-2008 .
 .It Fl W
 Display whiteouts when scanning directories.
 This option is not defined in
-.St -p1003.1-2001 .
+.St -p1003.1-2008 .
 .It Fl Z
 Display each file's MAC label; see
 .Xr maclabel 7 .
@@ -895,13 +895,13 @@ and
 the
 .Nm
 utility conforms to
-.St -p1003.1-2001 .
+.St -p1003.1-2008 .
 The options
 .Fl B , D , G , I , T , U , W , Z , b , h , w , y
 and
 .Fl ,
 are compatible extensions not defined in
-.St -p1003.1-2001 .
+.St -p1003.1-2008 .
 .Pp
 The ACL support is compatible with
 .Tn IEEE
___
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: r364448 - stable/12/lib/libc/sys

2020-08-20 Thread Kyle Evans
Author: kevans
Date: Fri Aug 21 03:50:25 2020
New Revision: 364448
URL: https://svnweb.freebsd.org/changeset/base/364448

Log:
  MFC r363398 (asomers): document close_range(2) as async-signal-safe

Modified:
  stable/12/lib/libc/sys/sigaction.2
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libc/sys/sigaction.2
==
--- stable/12/lib/libc/sys/sigaction.2  Fri Aug 21 03:31:01 2020
(r364447)
+++ stable/12/lib/libc/sys/sigaction.2  Fri Aug 21 03:50:25 2020
(r364448)
@@ -28,7 +28,7 @@
 .\"From: @(#)sigaction.2   8.2 (Berkeley) 4/3/94
 .\" $FreeBSD$
 .\"
-.Dd June 28, 2018
+.Dd June 29, 2020
 .Dt SIGACTION 2
 .Os
 .Sh NAME
@@ -569,6 +569,7 @@ Extension Interfaces:
 .Pp
 .Fn accept4 ,
 .Fn bindat ,
+.Fn close_range ,
 .Fn closefrom ,
 .Fn connectat ,
 .Fn eaccess ,
___
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: r364447 - head/sys/powerpc/aim

2020-08-20 Thread Brandon Bergren
Author: bdragon
Date: Fri Aug 21 03:31:01 2020
New Revision: 364447
URL: https://svnweb.freebsd.org/changeset/base/364447

Log:
  [PowerPC] Fix translation-related crashes during startup
  
  After spending a lot of time trying to track down what was going on, I have
  isolated the "black screen" failures when using boot1 to boot a G4 machine.
  
  It turns out we were replacing the traps before installing the temporary
  BAT entry for the bottom of physical memory. That meant that until the MMU
  was bootstrapped, the cached translations were the only thing keeping us
  from losing.
  
  Throwing boot1 into the mix was affecting execution flow enough to cause us
  to hit an uncached page and crash.
  
  Fix this by properly setting up the initial BAT entry at the same time we
  are replacing the OpenFirmware traps, so we can continue executing in
  segment 0 until the rest of the DMAP has been set up.
  
  A second thing discovered while researching this is that we were entering a
  BAT region for segment 16. It turns out this range was a) considered part
  of KVA, and b) has firmware mappings with varying attributes.
  
  If we ever accessed an unmapped page in segment 16, it would cause a BAT
  entry to be installed for the whole segment, which would bypass the
  existing mappings until it was flushed out again.
  
  Instead, translate the OFW memory attributes into VM memory attributes and
  install the ranges into the kernel address space properly.
  
  Reviewed by:  adalava
  MFC after:3 weeks
  Sponsored by: Tag1 Consulting, Inc.
  Differential Revision:https://reviews.freebsd.org/D25547

Modified:
  head/sys/powerpc/aim/aim_machdep.c
  head/sys/powerpc/aim/mmu_oea.c

Modified: head/sys/powerpc/aim/aim_machdep.c
==
--- head/sys/powerpc/aim/aim_machdep.c  Fri Aug 21 03:23:10 2020
(r364446)
+++ head/sys/powerpc/aim/aim_machdep.c  Fri Aug 21 03:31:01 2020
(r364447)
@@ -390,6 +390,25 @@ aim_cpu_init(vm_offset_t toc)
bcopy(&restorebridge, (void *)EXC_MCHK, trap_offset);
bcopy(&restorebridge, (void *)EXC_TRC, trap_offset);
bcopy(&restorebridge, (void *)EXC_BPT, trap_offset);
+   } else {
+
+   /*
+* Use an IBAT and a DBAT to map the bottom 256M segment.
+*
+* It is very important to do it *now* to avoid taking a
+* fault in .text / .data before the MMU is bootstrapped,
+* because until then, the translation data has not been
+* copied over from OpenFirmware, so our DSI/ISI will fail
+* to find a match.
+*/
+
+   battable[0x0].batl = BATL(0x, BAT_M, BAT_PP_RW);
+   battable[0x0].batu = BATU(0x, BAT_BL_256M, BAT_Vs);
+
+   __asm (".balign 32; \n"
+   "mtibatu 0,%0; mtibatl 0,%1; isync; \n"
+   "mtdbatu 0,%0; mtdbatl 0,%1; isync"
+   :: "r"(battable[0].batu), "r"(battable[0].batl));
}
#else
trapsize = (size_t)&hypertrapcodeend - (size_t)&hypertrapcode;

Modified: head/sys/powerpc/aim/mmu_oea.c
==
--- head/sys/powerpc/aim/mmu_oea.c  Fri Aug 21 03:23:10 2020
(r364446)
+++ head/sys/powerpc/aim/mmu_oea.c  Fri Aug 21 03:31:01 2020
(r364447)
@@ -420,6 +420,32 @@ moea_calc_wimg(vm_paddr_t pa, vm_memattr_t ma)
return pte_lo;
 }
 
+/*
+ * Translate OFW translations into VM attributes.
+ */
+static __inline vm_memattr_t
+moea_bootstrap_convert_wimg(uint32_t mode)
+{
+
+   switch (mode) {
+   case (PTE_I | PTE_G):
+   /* PCI device memory */
+   return VM_MEMATTR_UNCACHEABLE;
+   case (PTE_M):
+   /* Explicitly coherent */
+   return VM_MEMATTR_CACHEABLE;
+   case 0: /* Default claim */
+   case 2: /* Alternate PP bits set by OF for the original payload */
+   /* "Normal" memory. */
+   return VM_MEMATTR_DEFAULT;
+
+   default:
+   /* Err on the side of caution for unknowns */
+   /* XXX should we panic instead? */
+   return VM_MEMATTR_UNCACHEABLE;
+   }
+}
+
 static void
 tlbie(vm_offset_t va)
 {
@@ -670,14 +696,7 @@ moea_bootstrap(vm_offset_t kernelstart, vm_offset_t ke
vm_size_t   size, physsz, hwphyssz;
vm_offset_t pa, va, off;
void*dpcpu;
-   register_t  msr;
 
-/*
- * Set up BAT0 to map the lowest 256 MB area
- */
-battable[0x0].batl = BATL(0x, BAT_M, BAT_PP_RW);
-battable[0x0].batu = BATU(0x, BAT_BL_256M, BAT_Vs);
-
/*
 * Map PCI memory space.
 */
@@ -693,25 +712,8 @@ moea_bootstrap(vm_offset_t kernelstart, vm_offset_t ke

svn commit: r364446 - head/sys/powerpc/powernv

2020-08-20 Thread Brandon Bergren
Author: bdragon
Date: Fri Aug 21 03:23:10 2020
New Revision: 364446
URL: https://svnweb.freebsd.org/changeset/base/364446

Log:
  [PowerPC64] Fix invalid OPAL call in xive_bind().
  
  This fixes spurious "XIVE[ IC 00  ] ISN 1 lead to invalid IVE !" messages
  generated by OPAL when running with the debug level cranked up.
  
  Discussed with jhibbits.
  
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/sys/powerpc/powernv/opal.h
  head/sys/powerpc/powernv/xive.c

Modified: head/sys/powerpc/powernv/opal.h
==
--- head/sys/powerpc/powernv/opal.h Fri Aug 21 00:59:15 2020
(r364445)
+++ head/sys/powerpc/powernv/opal.h Fri Aug 21 03:23:10 2020
(r364446)
@@ -173,6 +173,9 @@ int opal_call(uint64_t token, ...);
 #defineOPAL_XIVE_XICS_MODE_EMU 0
 #defineOPAL_XIVE_XICS_MODE_EXP 1
 
+#defineOPAL_XIVE_SYNC_EAS  0x0001
+#defineOPAL_XIVE_SYNC_QUEUE0x0002
+
 #defineOPAL_XIVE_VP_ENABLED0x0001
 #defineOPAL_XIVE_VP_SINGLE_ESCALATION  0x0002
 

Modified: head/sys/powerpc/powernv/xive.c
==
--- head/sys/powerpc/powernv/xive.c Fri Aug 21 00:59:15 2020
(r364445)
+++ head/sys/powerpc/powernv/xive.c Fri Aug 21 03:23:10 2020
(r364446)
@@ -466,7 +466,7 @@ xive_bind(device_t dev, u_int irq, cpuset_t cpumask, v
ncpus++;
}
 
-   opal_call(OPAL_XIVE_SYNC);
+   opal_call(OPAL_XIVE_SYNC, OPAL_XIVE_SYNC_QUEUE, irq);

irqd->vp = pcpu_find(cpu)->pc_hwref;
error = opal_call(OPAL_XIVE_SET_IRQ_CONFIG, irq, irqd->vp,
___
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: r364379 - head/sys/dev/usb/controller

2020-08-20 Thread Nathan Whitehorn



On 2020-08-20 13:47, Hans Petter Selasky wrote:
> On 2020-08-20 18:21, Hans Petter Selasky wrote:
>> On 2020-08-20 18:14, Hans Petter Selasky wrote:
>>> On 2020-08-20 17:51, Nathan Whitehorn wrote:
 Either this or r364347 has broken Yubikeys (at least Yubikey 4)
 plugged
 into XHCI ports, which are completely invisible to the USB stack after
 the change. I'm going to try to debug further, but wanted to give
 you a
 heads-up in case you can get there first.
 -Nathan

>>>
>>> Let me know if you can isolate the commit. There has been two
>>> commits recently in the XHCI code.
>>
>> I'm on it. Let me run some test here.
>>
>
> See:
> https://svnweb.freebsd.org/changeset/base/364433
>
> Thanks to Ed Maste who quickly tested my patch.
>
> --HPS
>

That was incredibly fast! Everything works fine again. Thanks much!
-Nathan
___
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: r364445 - in stable/12/sys: kern sys

2020-08-20 Thread Mark Johnston
Author: markj
Date: Fri Aug 21 00:59:15 2020
New Revision: 364445
URL: https://svnweb.freebsd.org/changeset/base/364445

Log:
  MFC r364235:
  Rename the pipe_map field of struct pipe.

Modified:
  stable/12/sys/kern/sys_pipe.c
  stable/12/sys/sys/pipe.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/sys_pipe.c
==
--- stable/12/sys/kern/sys_pipe.c   Fri Aug 21 00:34:33 2020
(r36)
+++ stable/12/sys/kern/sys_pipe.c   Fri Aug 21 00:59:15 2020
(r364445)
@@ -736,19 +736,19 @@ pipe_read(struct file *fp, struct uio *uio, struct ucr
/*
 * Direct copy, bypassing a kernel buffer.
 */
-   } else if ((size = rpipe->pipe_map.cnt) != 0) {
+   } else if ((size = rpipe->pipe_pages.cnt) != 0) {
if (size > uio->uio_resid)
size = (u_int) uio->uio_resid;
PIPE_UNLOCK(rpipe);
-   error = uiomove_fromphys(rpipe->pipe_map.ms,
-   rpipe->pipe_map.pos, size, uio);
+   error = uiomove_fromphys(rpipe->pipe_pages.ms,
+   rpipe->pipe_pages.pos, size, uio);
PIPE_LOCK(rpipe);
if (error)
break;
nread += size;
-   rpipe->pipe_map.pos += size;
-   rpipe->pipe_map.cnt -= size;
-   if (rpipe->pipe_map.cnt == 0) {
+   rpipe->pipe_pages.pos += size;
+   rpipe->pipe_pages.cnt -= size;
+   if (rpipe->pipe_pages.cnt == 0) {
rpipe->pipe_state &= ~PIPE_WANTW;
wakeup(rpipe);
}
@@ -852,7 +852,7 @@ pipe_build_write_buffer(struct pipe *wpipe, struct uio
PIPE_LOCK_ASSERT(wpipe, MA_OWNED);
KASSERT((wpipe->pipe_state & PIPE_DIRECTW) == 0,
("%s: PIPE_DIRECTW set on %p", __func__, wpipe));
-   KASSERT(wpipe->pipe_map.cnt == 0,
+   KASSERT(wpipe->pipe_pages.cnt == 0,
("%s: pipe map for %p contains residual data", __func__, wpipe));
 
if (uio->uio_iov->iov_len > wpipe->pipe_buffer.size)
@@ -864,17 +864,17 @@ pipe_build_write_buffer(struct pipe *wpipe, struct uio
PIPE_UNLOCK(wpipe);
i = vm_fault_quick_hold_pages(&curproc->p_vmspace->vm_map,
(vm_offset_t)uio->uio_iov->iov_base, size, VM_PROT_READ,
-   wpipe->pipe_map.ms, PIPENPAGES);
+   wpipe->pipe_pages.ms, PIPENPAGES);
PIPE_LOCK(wpipe);
if (i < 0) {
wpipe->pipe_state &= ~PIPE_DIRECTW;
return (EFAULT);
}
 
-   wpipe->pipe_map.npages = i;
-   wpipe->pipe_map.pos =
+   wpipe->pipe_pages.npages = i;
+   wpipe->pipe_pages.pos =
((vm_offset_t) uio->uio_iov->iov_base) & PAGE_MASK;
-   wpipe->pipe_map.cnt = size;
+   wpipe->pipe_pages.cnt = size;
 
uio->uio_iov->iov_len -= size;
uio->uio_iov->iov_base = (char *)uio->uio_iov->iov_base + size;
@@ -895,12 +895,12 @@ pipe_destroy_write_buffer(struct pipe *wpipe)
PIPE_LOCK_ASSERT(wpipe, MA_OWNED);
KASSERT((wpipe->pipe_state & PIPE_DIRECTW) != 0,
("%s: PIPE_DIRECTW not set on %p", __func__, wpipe));
-   KASSERT(wpipe->pipe_map.cnt == 0,
+   KASSERT(wpipe->pipe_pages.cnt == 0,
("%s: pipe map for %p contains residual data", __func__, wpipe));
 
wpipe->pipe_state &= ~PIPE_DIRECTW;
-   vm_page_unhold_pages(wpipe->pipe_map.ms, wpipe->pipe_map.npages);
-   wpipe->pipe_map.npages = 0;
+   vm_page_unhold_pages(wpipe->pipe_pages.ms, wpipe->pipe_pages.npages);
+   wpipe->pipe_pages.npages = 0;
 }
 
 /*
@@ -920,9 +920,9 @@ pipe_clone_write_buffer(struct pipe *wpipe)
KASSERT((wpipe->pipe_state & PIPE_DIRECTW) != 0,
("%s: PIPE_DIRECTW not set on %p", __func__, wpipe));
 
-   size = wpipe->pipe_map.cnt;
-   pos = wpipe->pipe_map.pos;
-   wpipe->pipe_map.cnt = 0;
+   size = wpipe->pipe_pages.cnt;
+   pos = wpipe->pipe_pages.pos;
+   wpipe->pipe_pages.cnt = 0;
 
wpipe->pipe_buffer.in = size;
wpipe->pipe_buffer.out = 0;
@@ -938,7 +938,7 @@ pipe_clone_write_buffer(struct pipe *wpipe)
uio.uio_segflg = UIO_SYSSPACE;
uio.uio_rw = UIO_READ;
uio.uio_td = curthread;
-   uiomove_fromphys(wpipe->pipe_map.ms, pos, size, &uio);
+   uiomove_fromphys(wpipe->pipe_pages.ms, pos, size, &uio);
PIPE_LOCK(wpipe);
pipe_destroy_write_buffer(wpipe);
 }
@@ -1002,7 +1002,7 @@ retry:
goto error1;
}
 
-   while (wpipe->pipe_map.cnt != 0 &&
+   while (wpipe->pipe_pages.cnt != 0 &&
(wpipe->pipe_state & PIPE_EOF) ==

svn commit: r364444 - head/sys/dev/cxgbe/cxgbei

2020-08-20 Thread Navdeep Parhar
Author: np
Date: Fri Aug 21 00:34:33 2020
New Revision: 36
URL: https://svnweb.freebsd.org/changeset/base/36

Log:
  cxgbei: destroy the worker threads' CV and mutex in stop_worker_threads.
  
  Reported by:  bz@
  MFC after:3 days

Modified:
  head/sys/dev/cxgbe/cxgbei/cxgbei.c

Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c
==
--- head/sys/dev/cxgbe/cxgbei/cxgbei.c  Fri Aug 21 00:27:06 2020
(r364443)
+++ head/sys/dev/cxgbe/cxgbei/cxgbei.c  Fri Aug 21 00:34:33 2020
(r36)
@@ -715,6 +715,8 @@ stop_worker_threads(void)
cv_wait(&cwt->cwt_cv, &cwt->cwt_lock);
} while (cwt->cwt_state != CWT_STOPPED);
mtx_unlock(&cwt->cwt_lock);
+   mtx_destroy(&cwt->cwt_lock);
+   cv_destroy(&cwt->cwt_cv);
}
free(cwt_softc, M_CXGBE);
 }
___
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: r364443 - head/lib/libsecureboot

2020-08-20 Thread Simon J. Gerraty
Author: sjg
Date: Fri Aug 21 00:27:06 2020
New Revision: 364443
URL: https://svnweb.freebsd.org/changeset/base/364443

Log:
  veloader: insist on verifying .4th .lua etc
  
  When files are read from .rc or .4th, verify_file is asked to
  guess the severity (VE_TRY,VE_WANT,VE_MUST)
  
  Reviewed by:  stevek
  MFC after:1 week
  Sponsored by: Juniper Networks

Modified:
  head/lib/libsecureboot/verify_file.c

Modified: head/lib/libsecureboot/verify_file.c
==
--- head/lib/libsecureboot/verify_file.cFri Aug 21 00:03:24 2020
(r364442)
+++ head/lib/libsecureboot/verify_file.cFri Aug 21 00:27:06 2020
(r364443)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2017-2018, Juniper Networks, Inc.
+ * Copyright (c) 2017-2020, Juniper Networks, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -255,6 +255,10 @@ severity_guess(const char *filename)
strcmp(cp, ".cookie") == 0 ||
strcmp(cp, ".hints") == 0)
return (VE_TRY);
+   if (strcmp(cp, ".4th") == 0 ||
+   strcmp(cp, ".lua") == 0 ||
+   strcmp(cp, ".rc") == 0)
+   return (VE_MUST);
}
return (VE_WANT);
 }
___
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: r364442 - in head/sys: cam cddl/compat/opensolaris/kern geom kern net netinet

2020-08-20 Thread Warner Losh
Author: imp
Date: Fri Aug 21 00:03:24 2020
New Revision: 364442
URL: https://svnweb.freebsd.org/changeset/base/364442

Log:
  Use devctl.h instead of bus.h to reduce newbus pollution.
  
  There's no need for these parts of the kernel to know about newbus,
  so narrow what is included to devctl.h for device_notify_*.
  
  Suggested by: kib@

Modified:
  head/sys/cam/cam_periph.c
  head/sys/cddl/compat/opensolaris/kern/opensolaris_sysevent.c
  head/sys/geom/geom_dev.c
  head/sys/geom/geom_disk.c
  head/sys/kern/kern_conf.c
  head/sys/kern/kern_rctl.c
  head/sys/kern/kern_sig.c
  head/sys/kern/vfs_mount.c
  head/sys/net/if_ethersubr.c
  head/sys/netinet/ip_carp.c

Modified: head/sys/cam/cam_periph.c
==
--- head/sys/cam/cam_periph.c   Thu Aug 20 20:31:47 2020(r364441)
+++ head/sys/cam/cam_periph.c   Fri Aug 21 00:03:24 2020(r364442)
@@ -39,12 +39,12 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_sysevent.c
==
--- head/sys/cddl/compat/opensolaris/kern/opensolaris_sysevent.cThu Aug 
20 20:31:47 2020(r364441)
+++ head/sys/cddl/compat/opensolaris/kern/opensolaris_sysevent.cFri Aug 
21 00:03:24 2020(r364442)
@@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 

Modified: head/sys/geom/geom_dev.c
==
--- head/sys/geom/geom_dev.cThu Aug 20 20:31:47 2020(r364441)
+++ head/sys/geom/geom_dev.cFri Aug 21 00:03:24 2020(r364442)
@@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 

Modified: head/sys/geom/geom_disk.c
==
--- head/sys/geom/geom_disk.c   Thu Aug 20 20:31:47 2020(r364441)
+++ head/sys/geom/geom_disk.c   Fri Aug 21 00:03:24 2020(r364442)
@@ -45,8 +45,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
+#include 
 #include 
 #include 
 #include 

Modified: head/sys/kern/kern_conf.c
==
--- head/sys/kern/kern_conf.c   Thu Aug 20 20:31:47 2020(r364441)
+++ head/sys/kern/kern_conf.c   Fri Aug 21 00:03:24 2020(r364442)
@@ -32,8 +32,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
+#include 
 #include 
 #include 
 #include 

Modified: head/sys/kern/kern_rctl.c
==
--- head/sys/kern/kern_rctl.c   Thu Aug 20 20:31:47 2020(r364441)
+++ head/sys/kern/kern_rctl.c   Fri Aug 21 00:03:24 2020(r364442)
@@ -35,7 +35,7 @@
 __FBSDID("$FreeBSD$");
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 

Modified: head/sys/kern/kern_sig.c
==
--- head/sys/kern/kern_sig.cThu Aug 20 20:31:47 2020(r364441)
+++ head/sys/kern/kern_sig.cFri Aug 21 00:03:24 2020(r364442)
@@ -47,10 +47,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

Modified: head/sys/kern/vfs_mount.c
==
--- head/sys/kern/vfs_mount.c   Thu Aug 20 20:31:47 2020(r364441)
+++ head/sys/kern/vfs_mount.c   Fri Aug 21 00:03:24 2020(r364442)
@@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 

Modified: head/sys/net/if_ethersubr.c
==
--- head/sys/net/if_ethersubr.c Thu Aug 20 20:31:47 2020(r364441)
+++ head/sys/net/if_ethersubr.c Fri Aug 21 00:03:24 2020(r364442)
@@ -40,7 +40,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 

Modified: head/sys/netinet/ip_carp.c
==
--- head/sys/netinet/ip_carp.c  Thu Aug 20 20:31:47 2020(r364441)
+++ head/sys/netinet/ip_carp.c  Fri Aug 21 00:03:24 2020(r364442)
@@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
___
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: r364441 - head/stand/i386/zfsboot

2020-08-20 Thread Gleb Smirnoff
Author: glebius
Date: Thu Aug 20 20:31:47 2020
New Revision: 364441
URL: https://svnweb.freebsd.org/changeset/base/364441

Log:
  When we have a command returned by zfs_nextboot() that is longer
  than command in the loader.conf, the latter needs to be nul terminated,
  otherwise garbage trailer left from zfs_nextboot() will be passed to
  parse_cmd() together with loader.conf command.
  
  While here, reset cmd to empty string if read() returns error.
  
  Reviewed by:  tsoome

Modified:
  head/stand/i386/zfsboot/zfsboot.c

Modified: head/stand/i386/zfsboot/zfsboot.c
==
--- head/stand/i386/zfsboot/zfsboot.c   Thu Aug 20 20:11:58 2020
(r364440)
+++ head/stand/i386/zfsboot/zfsboot.c   Thu Aug 20 20:31:47 2020
(r364441)
@@ -248,7 +248,12 @@ main(void)
fd = open(PATH_DOTCONFIG, O_RDONLY);
 
if (fd != -1) {
-   read(fd, cmd, sizeof (cmd));
+   ssize_t cmdlen;
+
+   if ((cmdlen = read(fd, cmd, sizeof(cmd))) > 0)
+   cmd[cmdlen] = '\0';
+   else
+   *cmd = '\0';
close(fd);
}
 
___
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: r364440 - head/cddl/contrib/opensolaris/lib/libdtrace/common

2020-08-20 Thread Mark Johnston
Author: markj
Date: Thu Aug 20 20:11:58 2020
New Revision: 364440
URL: https://svnweb.freebsd.org/changeset/base/364440

Log:
  Fix a typo in r364438.
  
  Reported by:  Jenkins
  MFC with: r364438

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.cThu Aug 
20 19:51:25 2020(r364439)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.cThu Aug 
20 20:11:58 2020(r364440)
@@ -773,7 +773,7 @@ dt_symtab_lookup(Elf_Data *data_sym, int start, int en
 #defineDT_OP_RET   0xd65f03c0
 #defineDT_OP_CALL260x9400
 #defineDT_OP_JUMP260x1400
-#defineDT_REL_NONE R_AACH64_NONE
+#defineDT_REL_NONE R_AARCH64_NONE
 
 static int
 dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela,
___
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: r364439 - head/sys/conf

2020-08-20 Thread Warner Losh
Author: imp
Date: Thu Aug 20 19:51:25 2020
New Revision: 364439
URL: https://svnweb.freebsd.org/changeset/base/364439

Log:
  Unbreak LINT
  
  Remove ufm from the NOTES file.

Modified:
  head/sys/conf/NOTES

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Thu Aug 20 19:28:19 2020(r364438)
+++ head/sys/conf/NOTES Thu Aug 20 19:51:25 2020(r364439)
@@ -2445,8 +2445,6 @@ deviceusb
 #
 # USB Double Bulk Pipe devices
 device udbp
-# USB Fm Radio
-device ufm
 # USB temperature meter
 device ugold
 # USB LED
___
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: r364430 - in head: share/man/man4 sys/dev/an sys/dev/ata sys/dev/cmx sys/dev/fdc sys/dev/if_ndis sys/dev/puc sys/dev/uart sys/dev/wi sys/netgraph/bluetooth/drivers/bt3c

2020-08-20 Thread Warner Losh
https://reviews.freebsd.org/D26138 has the code review.

Warner

On Thu, Aug 20, 2020 at 1:41 PM Warner Losh  wrote:

>
>
> On Thu, Aug 20, 2020 at 1:13 PM Rodney W. Grimes <
> free...@gndrsh.dnsmgr.net> wrote:
>
>> > Author: imp
>> > Date: Thu Aug 20 17:19:40 2020
>> > New Revision: 364430
>> > URL: https://svnweb.freebsd.org/changeset/base/364430
>> >
>> > Log:
>> >   Tag pccard drivers with gone in 13.
>> >
>> >   MFC After: 3 days
>> >   Reviewed by: emaste, brooks, adrian (on twitter)
>> >   Differential Revision: https://reviews.freebsd.org/D26095
>> >
>> > Modified:
>> >   head/share/man/man4/an.4
>>
>> This device has a PCI version, so why is it going away with PC card?
>> Typically these are plx9050 bridge cards which makes the AN device
>> appear like any other PCI device.
>>
>
> Because it is no longer relevant. The device that an supports was a
> relatively rare mini-pci version of the card that was sold for maybe a year
> in a few laptops before those designed moved on to the atheros cards. It
> couldn't do the newer crypto, nor the newer than 802.11b standard. Since
> the crypto it could to was flabwed and long since abandoned, most of these
> cards were replaced by some variation of atheros cards by FreeBSD since
> they were usually a drop-in replacement. IIRC, there was no raw interface
> for this card, so you were stuck with what the firmware did and Cisco never
> produced a newer firmware.
>
>
>> It looks as if you only tagged if_an_pccard.c, so the man page
>> change is all that is wrong.
>>
>
> I just didn't tag the if_an_pci.c version too.
>
>
>> >   head/share/man/man4/ata.4
>> >   head/share/man/man4/cmx.4
>> >   head/share/man/man4/fdc.4
>> >   head/share/man/man4/ndis.4
>> >   head/share/man/man4/ng_bt3c.4
>> >   head/share/man/man4/pccard.4
>> >   head/share/man/man4/puc.4
>> >   head/share/man/man4/uart.4
>> >   head/share/man/man4/wi.4
>>
>> These are also often plx9050 based, and your only doing
>> the if_wi_pccard.c file, so probably also a man page error.
>>
>
> Some here. I got Adrian's approval for wi specifically. These are just too
> old and don't support the relevant standards. The PCI attachments were
> relatively rare in the day for both of these devices (though the wi ones
> were a little more common than than an ones). Usually wi got connected to
> the PCI bus via a full PCMCIA/CardBus bridge since those were off-the-shelf
> components that the makers of these cards shifted too when then one-off PLX
> solution ran out of steam. The wi cards theoretically could be updated to
> the new crypto standards, but nobody has bothered to do that for the
> FreeBSD driver in the 15 or so years since they became necessary.
>
> I'll update the pci attachment code for wi too, since it's not worth
> keeping around. Adrian has volunteered to create a port and put it on
> github if anybody is actually still using this card. Though Adrian has also
> said that there's a fair amount of cleanup we could do to the 802.11 stack
> if we were to get rid of all the old 802.11b-only cards. wi and an were the
> last two as far as I can tell...
>
> I get that these were once quite popular and ubiquitous. But it's 15 years
> later and they don't follow enough of the standards to be a viable option
> for all but the most niche deployments. And those niche deployments do not
> buy us enough to be worth the bother.
>
> Warner
>
>
>> >   head/sys/dev/an/if_an_pccard.c
>> >   head/sys/dev/ata/ata-card.c
>> >   head/sys/dev/cmx/cmx_pccard.c
>> >   head/sys/dev/fdc/fdc_pccard.c
>> >   head/sys/dev/if_ndis/if_ndis_pccard.c
>> >   head/sys/dev/puc/puc_pccard.c
>> >   head/sys/dev/uart/uart_bus_pccard.c
>> >   head/sys/dev/wi/if_wi_pccard.c
>> >   head/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c
>> >
>> > Modified: head/share/man/man4/an.4
>> >
>> ==
>> > --- head/share/man/man4/an.4  Thu Aug 20 17:14:44 2020(r364429)
>> > +++ head/share/man/man4/an.4  Thu Aug 20 17:19:40 2020(r364430)
>> > @@ -51,6 +51,9 @@ module at boot time, place the following line in
>> >  .Bd -literal -offset indent
>> >  if_an_load="YES"
>> >  .Ed
>> > +.Sh DEPRECATION NOTICE
>> > +This driver is scheduled for removal prior to the release of
>> > +.Fx 13.0
>> >  .Sh DESCRIPTION
>> >  The
>> >  .Nm
>> >
>> > Modified: head/share/man/man4/ata.4
>> >
>> ==
>> > --- head/share/man/man4/ata.4 Thu Aug 20 17:14:44 2020(r364429)
>> > +++ head/share/man/man4/ata.4 Thu Aug 20 17:19:40 2020(r364430)
>> > @@ -222,6 +222,9 @@ Unknown ATA chipsets are supported in PIO modes,
>> and i
>> >  busmaster DMA registers are present and contain valid setup, DMA is
>> >  also enabled, although the max mode is limited to UDMA33, as it is
>> >  not known what the chipset can do and how to program it.
>> > +.Sh DEPRECATION NOTICE
>> > +The PC Card attachment of this dr

Re: svn commit: r364430 - in head: share/man/man4 sys/dev/an sys/dev/ata sys/dev/cmx sys/dev/fdc sys/dev/if_ndis sys/dev/puc sys/dev/uart sys/dev/wi sys/netgraph/bluetooth/drivers/bt3c

2020-08-20 Thread Warner Losh
On Thu, Aug 20, 2020 at 1:13 PM Rodney W. Grimes 
wrote:

> > Author: imp
> > Date: Thu Aug 20 17:19:40 2020
> > New Revision: 364430
> > URL: https://svnweb.freebsd.org/changeset/base/364430
> >
> > Log:
> >   Tag pccard drivers with gone in 13.
> >
> >   MFC After: 3 days
> >   Reviewed by: emaste, brooks, adrian (on twitter)
> >   Differential Revision: https://reviews.freebsd.org/D26095
> >
> > Modified:
> >   head/share/man/man4/an.4
>
> This device has a PCI version, so why is it going away with PC card?
> Typically these are plx9050 bridge cards which makes the AN device
> appear like any other PCI device.
>

Because it is no longer relevant. The device that an supports was a
relatively rare mini-pci version of the card that was sold for maybe a year
in a few laptops before those designed moved on to the atheros cards. It
couldn't do the newer crypto, nor the newer than 802.11b standard. Since
the crypto it could to was flabwed and long since abandoned, most of these
cards were replaced by some variation of atheros cards by FreeBSD since
they were usually a drop-in replacement. IIRC, there was no raw interface
for this card, so you were stuck with what the firmware did and Cisco never
produced a newer firmware.


> It looks as if you only tagged if_an_pccard.c, so the man page
> change is all that is wrong.
>

I just didn't tag the if_an_pci.c version too.


> >   head/share/man/man4/ata.4
> >   head/share/man/man4/cmx.4
> >   head/share/man/man4/fdc.4
> >   head/share/man/man4/ndis.4
> >   head/share/man/man4/ng_bt3c.4
> >   head/share/man/man4/pccard.4
> >   head/share/man/man4/puc.4
> >   head/share/man/man4/uart.4
> >   head/share/man/man4/wi.4
>
> These are also often plx9050 based, and your only doing
> the if_wi_pccard.c file, so probably also a man page error.
>

Some here. I got Adrian's approval for wi specifically. These are just too
old and don't support the relevant standards. The PCI attachments were
relatively rare in the day for both of these devices (though the wi ones
were a little more common than than an ones). Usually wi got connected to
the PCI bus via a full PCMCIA/CardBus bridge since those were off-the-shelf
components that the makers of these cards shifted too when then one-off PLX
solution ran out of steam. The wi cards theoretically could be updated to
the new crypto standards, but nobody has bothered to do that for the
FreeBSD driver in the 15 or so years since they became necessary.

I'll update the pci attachment code for wi too, since it's not worth
keeping around. Adrian has volunteered to create a port and put it on
github if anybody is actually still using this card. Though Adrian has also
said that there's a fair amount of cleanup we could do to the 802.11 stack
if we were to get rid of all the old 802.11b-only cards. wi and an were the
last two as far as I can tell...

I get that these were once quite popular and ubiquitous. But it's 15 years
later and they don't follow enough of the standards to be a viable option
for all but the most niche deployments. And those niche deployments do not
buy us enough to be worth the bother.

Warner


> >   head/sys/dev/an/if_an_pccard.c
> >   head/sys/dev/ata/ata-card.c
> >   head/sys/dev/cmx/cmx_pccard.c
> >   head/sys/dev/fdc/fdc_pccard.c
> >   head/sys/dev/if_ndis/if_ndis_pccard.c
> >   head/sys/dev/puc/puc_pccard.c
> >   head/sys/dev/uart/uart_bus_pccard.c
> >   head/sys/dev/wi/if_wi_pccard.c
> >   head/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c
> >
> > Modified: head/share/man/man4/an.4
> >
> ==
> > --- head/share/man/man4/an.4  Thu Aug 20 17:14:44 2020(r364429)
> > +++ head/share/man/man4/an.4  Thu Aug 20 17:19:40 2020(r364430)
> > @@ -51,6 +51,9 @@ module at boot time, place the following line in
> >  .Bd -literal -offset indent
> >  if_an_load="YES"
> >  .Ed
> > +.Sh DEPRECATION NOTICE
> > +This driver is scheduled for removal prior to the release of
> > +.Fx 13.0
> >  .Sh DESCRIPTION
> >  The
> >  .Nm
> >
> > Modified: head/share/man/man4/ata.4
> >
> ==
> > --- head/share/man/man4/ata.4 Thu Aug 20 17:14:44 2020(r364429)
> > +++ head/share/man/man4/ata.4 Thu Aug 20 17:19:40 2020(r364430)
> > @@ -222,6 +222,9 @@ Unknown ATA chipsets are supported in PIO modes, and
> i
> >  busmaster DMA registers are present and contain valid setup, DMA is
> >  also enabled, although the max mode is limited to UDMA33, as it is
> >  not known what the chipset can do and how to program it.
> > +.Sh DEPRECATION NOTICE
> > +The PC Card attachment of this driver is scheduled for removal prior to
> the release of
> > +.Fx 13.0
> >  .Sh NOTES
> >  Please remember that in order to use UDMA4/ATA66 and above modes you
> >  .Em must
> >
> > Modified: head/share/man/man4/cmx.4
> >
> =

svn commit: r364438 - in head/cddl: contrib/opensolaris/lib/libdtrace/common usr.sbin/dtrace/tests/tools

2020-08-20 Thread Mark Johnston
Author: markj
Date: Thu Aug 20 19:28:19 2020
New Revision: 364438
URL: https://svnweb.freebsd.org/changeset/base/364438

Log:
  Enable creation of static userspace probes in incremental builds.
  
  To define USDT probes, dtrace -G makes use of relocations for undefined
  symbols: the target address is overwritten with NOPs and the location is
  recorded in the DOF section of the output object file.  To avoid link
  errors, the original relocation is destroyed.  However, this means that
  the same input object file cannot be processed multiple times, as
  happens during incremental rebuilds.  Instead, only set the relocation
  type to NONE, so that all information required to reconstruct USDT
  probes is preserved.
  
  Reported by:  bdrewery
  MFC after:3 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.h
  head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.cThu Aug 
20 19:27:49 2020(r364437)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.cThu Aug 
20 19:28:19 2020(r364438)
@@ -773,6 +773,7 @@ dt_symtab_lookup(Elf_Data *data_sym, int start, int en
 #defineDT_OP_RET   0xd65f03c0
 #defineDT_OP_CALL260x9400
 #defineDT_OP_JUMP260x1400
+#defineDT_REL_NONE R_AACH64_NONE
 
 static int
 dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela,
@@ -831,7 +832,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, 
return (0);
 }
 #elif defined(__arm__)
-/* XXX */
+#defineDT_REL_NONE R_ARM_NONE
+
 static int
 dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela,
 uint32_t *off)
@@ -841,7 +843,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, 
return (-1);
 }
 #elif defined(__mips__)
-/* XXX */
+#defineDT_REL_NONE R_MIPS_NONE
+
 static int
 dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela,
 uint32_t *off)
@@ -861,7 +864,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, 
 #define DT_IS_BRANCH(inst) ((inst & 0xfc00) == 0x4800)
 #define DT_IS_BL(inst) (DT_IS_BRANCH(inst) && (inst & 0x01))
 
-/* XXX */
+#defineDT_REL_NONE R_PPC_NONE
+
 static int
 dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela,
 uint32_t *off)
@@ -878,7 +882,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, 
 * We only know about some specific relocation types.
 */
if (GELF_R_TYPE(rela->r_info) != R_PPC_REL24 &&
-   GELF_R_TYPE(rela->r_info) != R_PPC_PLTREL24)
+   GELF_R_TYPE(rela->r_info) != R_PPC_PLTREL24 &&
+   GELF_R_TYPE(rela->r_info) != R_PPC_NONE)
return (-1);
 
/*
@@ -932,7 +937,7 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, 
return (0);
 }
 #elif defined(__riscv)
-/* XXX */
+#defineDT_REL_NONE R_RISCV_NONE
 static int
 dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela,
 uint32_t *off)
@@ -952,6 +957,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, 
 #defineDT_OP_XOR_EAX_0 0x33
 #defineDT_OP_XOR_EAX_1 0xc0
 
+#defineDT_REL_NONE R_386_NONE
+
 static int
 dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela,
 uint32_t *off)
@@ -974,7 +981,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, 
 * x86 architectures.
 */
if (GELF_R_TYPE(rela->r_info) != R_386_PC32 &&
-   GELF_R_TYPE(rela->r_info) != R_386_PLT32)
+   GELF_R_TYPE(rela->r_info) != R_386_PLT32 &&
+   GELF_R_TYPE(rela->r_info) != R_386_NONE)
return (-1);
 
/*
@@ -1273,6 +1281,11 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e
 * We take a first pass through all the relocations to
 * populate our string table and count the number of extra
 * symbols we'll require.
+*
+* We also handle the case where the object has already been
+* processed, to support incremental rebuilds.  Relocations
+* of interest are converted to type NONE, but all information
+* needed to reconstruct the output DOF is retained.
 */
strtab = dt_strtab_create(1);
nsym = 0;
@@ -1280,7 +1293,6 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e
istr = data_str->d_size;
 

svn commit: r364437 - head/cddl/contrib/opensolaris/lib/libdtrace/common

2020-08-20 Thread Mark Johnston
Author: markj
Date: Thu Aug 20 19:27:49 2020
New Revision: 364437
URL: https://svnweb.freebsd.org/changeset/base/364437

Log:
  Remove non-FreeBSD ifdefs from dt_link.c.
  
  This file is too complicated as it is and has diverged a fair bit from
  illumos due to toolchain differences, so just drop unused code
  (including SPARC support).
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.cThu Aug 
20 19:14:53 2020(r364436)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.cThu Aug 
20 19:27:49 2020(r364437)
@@ -25,38 +25,23 @@
  * Copyright 2017-2018 Mark Johnston 
  */
 
-#pragma ident  "%Z%%M% %I% %E% SMI"
+#include 
+#include 
+#include 
 
-#defineELF_TARGET_ALL
+#include 
 #include 
-
-#include 
-#ifdef illumos
-#include 
-#else
-#defineP2ROUNDUP(x, align) (-(-(x) & -(align)))
-#endif
-
-#include 
-#include 
-#ifdef illumos
-#include 
-#endif
+#include 
+#include 
 #include 
 #include 
-#include 
 #include 
-#include 
+#include 
+#include 
 #include 
-#ifdef illumos
-#include 
-#else
-#include 
+#include 
+
 #include 
-#include 
-#include 
-#endif
-#include 
 
 #include 
 #include 
@@ -82,11 +67,7 @@ static const char DTRACE_SHSTRTAB32[] = "\0"
 ".SUNW_dof\0"  /* 11 */
 ".strtab\0"/* 21 */
 ".symtab\0"/* 29 */
-#ifdef __sparc
-".rela.SUNW_dof";  /* 37 */
-#else
 ".rel.SUNW_dof";   /* 37 */
-#endif
 
 static const char DTRACE_SHSTRTAB64[] = "\0"
 ".shstrtab\0"  /* 1 */
@@ -106,11 +87,7 @@ typedef struct dt_link_pair {
 
 typedef struct dof_elf32 {
uint32_t de_nrel;   /* relocation count */
-#ifdef __sparc
-   Elf32_Rela *de_rel; /* array of relocations for sparc */
-#else
Elf32_Rel *de_rel;  /* array of relocations for x86 */
-#endif
uint32_t de_nsym;   /* symbol count */
Elf32_Sym *de_sym;  /* array of symbols */
uint32_t de_strlen; /* size of of string table */
@@ -130,11 +107,7 @@ prepare_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof,
uint32_t count = 0;
size_t base;
Elf32_Sym *sym;
-#ifdef __sparc
-   Elf32_Rela *rel;
-#else
Elf32_Rel *rel;
-#endif
 
/*LINTED*/
dofs = (dof_sec_t *)((char *)dof + dof->dofh_secoff);
@@ -324,11 +297,7 @@ prepare_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof,
char *strtab;
int i, j, nrel;
size_t strtabsz = 1;
-#ifdef illumos
-   uint32_t count = 0;
-#else
uint64_t count = 0;
-#endif
size_t base;
Elf64_Sym *sym;
Elf64_Rela *rel;
@@ -530,9 +499,7 @@ dump_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, in
 #else
elf_file.ehdr.e_ident[EI_DATA] = ELFDATA2LSB;
 #endif
-#if defined(__FreeBSD__)
elf_file.ehdr.e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
-#endif
elf_file.ehdr.e_type = ET_REL;
 #if defined(__arm__)
elf_file.ehdr.e_machine = EM_ARM;
@@ -540,8 +507,6 @@ dump_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, in
elf_file.ehdr.e_machine = EM_MIPS;
 #elif defined(__powerpc__)
elf_file.ehdr.e_machine = EM_PPC;
-#elif defined(__sparc)
-   elf_file.ehdr.e_machine = EM_SPARC;
 #elif defined(__i386) || defined(__amd64)
elf_file.ehdr.e_machine = EM_386;
 #elif defined(__aarch64__)
@@ -562,7 +527,7 @@ dump_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, in
shp->sh_offset = off;
shp->sh_size = sizeof (DTRACE_SHSTRTAB32);
shp->sh_addralign = sizeof (char);
-   off = P2ROUNDUP(shp->sh_offset + shp->sh_size, 8);
+   off = roundup2(shp->sh_offset + shp->sh_size, 8);
 
shp = &elf_file.shdr[ESHDR_DOF];
shp->sh_name = 11; /* DTRACE_SHSTRTAB32[11] = ".SUNW_dof" */
@@ -580,7 +545,7 @@ dump_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, in
shp->sh_offset = off;
shp->sh_size = de.de_strlen;
shp->sh_addralign = sizeof (char);
-   off = P2ROUNDUP(shp->sh_offset + shp->sh_size, 4);
+   off = roundup2(shp->sh_offset + shp->sh_size, 4);
 
shp = &elf_file.shdr[ESHDR_SYMTAB];
shp->sh_name = 29; /* DTRACE_SHSTRTAB32[29] = ".symtab" */
@@ -592,7 +557,7 @@ dump_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, in
shp->sh_info = de.de_global;
shp->sh_size = de.de_nsym * sizeof (Elf32_Sym);
shp->sh_addralign = 4;
-   off = P2ROUNDUP(shp->sh_offset + shp->sh_size, 4);
+   off = roundup2(shp->sh_offset + shp->sh_size, 4);
 
if (de.de_nrel == 0) {
if (dt_write(dtp, fd, &elf_file,
@@ -607,11 +572,7 @@ dump_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, in

Re: svn commit: r364435 - head/usr.sbin/kldxref

2020-08-20 Thread Brandon Bergren
>   Note that we may still do some tweaking of our kernel linker scripts, to
>   lower the number of segments, although the exact benefit is not entirely
>   clear.
> 

No real benefit, except for when using loading via sources other than 
loader(8). If any platforms other than powerpc64 need this, they can get full 
control over the image generation with the PHDRS directive like we do there.

IIRC there are benefits to *having* more segments on i386/amd64 as it makes 
link_elf_protect() more effective in some cases.

-- 
  Brandon Bergren
  bdra...@freebsd.org
___
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: r364436 - head

2020-08-20 Thread Niclas Zeising
Author: zeising (doc,ports committer)
Date: Thu Aug 20 19:14:53 2020
New Revision: 364436
URL: https://svnweb.freebsd.org/changeset/base/364436

Log:
  Add ufm(4) to ObsoleteFiles.inc
  
  The ufm driver was removed in r364432, add the manual to ObsoleteFiles.
  
  OK by:imp

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Thu Aug 20 18:50:46 2020(r364435)
+++ head/ObsoleteFiles.inc  Thu Aug 20 19:14:53 2020(r364436)
@@ -36,6 +36,9 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20200820: Removal of the ufm driver.
+OLD_FILES+=usr/share/man/man4/ufm.4.gz
+
 # 20200816: new clang import which bumps version from 10.0.1 to 11.0.0.
 OLD_FILES+=usr/lib/clang/10.0.1/include/cuda_wrappers/algorithm
 OLD_FILES+=usr/lib/clang/10.0.1/include/cuda_wrappers/complex
___
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: r364430 - in head: share/man/man4 sys/dev/an sys/dev/ata sys/dev/cmx sys/dev/fdc sys/dev/if_ndis sys/dev/puc sys/dev/uart sys/dev/wi sys/netgraph/bluetooth/drivers/bt3c

2020-08-20 Thread Rodney W. Grimes
> Author: imp
> Date: Thu Aug 20 17:19:40 2020
> New Revision: 364430
> URL: https://svnweb.freebsd.org/changeset/base/364430
> 
> Log:
>   Tag pccard drivers with gone in 13.
>   
>   MFC After: 3 days
>   Reviewed by: emaste, brooks, adrian (on twitter)
>   Differential Revision: https://reviews.freebsd.org/D26095
> 
> Modified:
>   head/share/man/man4/an.4

This device has a PCI version, so why is it going away with PC card?
Typically these are plx9050 bridge cards which makes the AN device
appear like any other PCI device.

It looks as if you only tagged if_an_pccard.c, so the man page
change is all that is wrong.

>   head/share/man/man4/ata.4
>   head/share/man/man4/cmx.4
>   head/share/man/man4/fdc.4
>   head/share/man/man4/ndis.4
>   head/share/man/man4/ng_bt3c.4
>   head/share/man/man4/pccard.4
>   head/share/man/man4/puc.4
>   head/share/man/man4/uart.4
>   head/share/man/man4/wi.4

These are also often plx9050 based, and your only doing
the if_wi_pccard.c file, so probably also a man page error.


>   head/sys/dev/an/if_an_pccard.c
>   head/sys/dev/ata/ata-card.c
>   head/sys/dev/cmx/cmx_pccard.c
>   head/sys/dev/fdc/fdc_pccard.c
>   head/sys/dev/if_ndis/if_ndis_pccard.c
>   head/sys/dev/puc/puc_pccard.c
>   head/sys/dev/uart/uart_bus_pccard.c
>   head/sys/dev/wi/if_wi_pccard.c
>   head/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c
> 
> Modified: head/share/man/man4/an.4
> ==
> --- head/share/man/man4/an.4  Thu Aug 20 17:14:44 2020(r364429)
> +++ head/share/man/man4/an.4  Thu Aug 20 17:19:40 2020(r364430)
> @@ -51,6 +51,9 @@ module at boot time, place the following line in
>  .Bd -literal -offset indent
>  if_an_load="YES"
>  .Ed
> +.Sh DEPRECATION NOTICE
> +This driver is scheduled for removal prior to the release of
> +.Fx 13.0
>  .Sh DESCRIPTION
>  The
>  .Nm
> 
> Modified: head/share/man/man4/ata.4
> ==
> --- head/share/man/man4/ata.4 Thu Aug 20 17:14:44 2020(r364429)
> +++ head/share/man/man4/ata.4 Thu Aug 20 17:19:40 2020(r364430)
> @@ -222,6 +222,9 @@ Unknown ATA chipsets are supported in PIO modes, and i
>  busmaster DMA registers are present and contain valid setup, DMA is
>  also enabled, although the max mode is limited to UDMA33, as it is
>  not known what the chipset can do and how to program it.
> +.Sh DEPRECATION NOTICE
> +The PC Card attachment of this driver is scheduled for removal prior to the 
> release of
> +.Fx 13.0
>  .Sh NOTES
>  Please remember that in order to use UDMA4/ATA66 and above modes you
>  .Em must
> 
> Modified: head/share/man/man4/cmx.4
> ==
> --- head/share/man/man4/cmx.4 Thu Aug 20 17:14:44 2020(r364429)
> +++ head/share/man/man4/cmx.4 Thu Aug 20 17:19:40 2020(r364430)
> @@ -34,6 +34,9 @@
>  .Nd Omnikey CardMan 4040 smartcard reader device driver
>  .Sh SYNOPSIS
>  .Cd device cmx
> +.Sh DEPRECATION NOTICE
> +This driver is scheduled for removal prior to the release of
> +.Fx 13.0
>  .Sh DESCRIPTION
>  The
>  .Nm
> 
> Modified: head/share/man/man4/fdc.4
> ==
> --- head/share/man/man4/fdc.4 Thu Aug 20 17:14:44 2020(r364429)
> +++ head/share/man/man4/fdc.4 Thu Aug 20 17:19:40 2020(r364430)
> @@ -313,6 +313,9 @@ Third argument is a pointer to
>  This type is the same as being used in the per-drive configuration
>  flags, or in the CMOS configuration data or ACPI namespace on IA32 systems.
>  .El
> +.Sh DEPRECATION NOTICE
> +The PC Card attachment of this driver is scheduled for removal prior to the 
> release of
> +.Fx 13.0
>  .Sh FILES
>  .Bl -tag -width ".Pa /dev/fd*" -compact
>  .It Pa /dev/fd*
> 
> Modified: head/share/man/man4/ndis.4
> ==
> --- head/share/man/man4/ndis.4Thu Aug 20 17:14:44 2020
> (r364429)
> +++ head/share/man/man4/ndis.4Thu Aug 20 17:19:40 2020
> (r364430)
> @@ -120,6 +120,9 @@ driver-specific registry keys to control the media set
>  which can be configured via the
>  .Xr sysctl 8
>  command.
> +.Sh DEPRECATION NOTICE
> +The PC Card attachment of this driver is scheduled for removal prior to the 
> release of
> +.Fx 13.0
>  .Sh DIAGNOSTICS
>  .Bl -diag
>  .It "ndis%d: watchdog timeout"
> 
> Modified: head/share/man/man4/ng_bt3c.4
> ==
> --- head/share/man/man4/ng_bt3c.4 Thu Aug 20 17:14:44 2020
> (r364429)
> +++ head/share/man/man4/ng_bt3c.4 Thu Aug 20 17:19:40 2020
> (r364430)
> @@ -34,6 +34,9 @@
>  .Sh SYNOPSIS
>  .In sys/types.h
>  .In netgraph/bluetooth/include/ng_bt3c.h
> +.Sh DEPRECATION NOTICE
> +This driver is scheduled for removal prior to the release of
> 

svn commit: r364435 - head/usr.sbin/kldxref

2020-08-20 Thread Dimitry Andric
Author: dim
Date: Thu Aug 20 18:50:46 2020
New Revision: 364435
URL: https://svnweb.freebsd.org/changeset/base/364435

Log:
  Bump kldxref's MAXSEGS to 16, to stop complaints about the kernel
  supposedly having too many segments, when lld 11 links it. Such kernels
  should load just fine.
  
  Note that we may still do some tweaking of our kernel linker scripts, to
  lower the number of segments, although the exact benefit is not entirely
  clear.

Modified:
  head/usr.sbin/kldxref/ef.c

Modified: head/usr.sbin/kldxref/ef.c
==
--- head/usr.sbin/kldxref/ef.c  Thu Aug 20 18:31:50 2020(r364434)
+++ head/usr.sbin/kldxref/ef.c  Thu Aug 20 18:50:46 2020(r364435)
@@ -49,7 +49,7 @@
 
 #include "ef.h"
 
-#defineMAXSEGS 3
+#defineMAXSEGS 16
 struct ef_file {
char*ef_name;
struct elf_file *ef_efile;
___
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: r364434 - head/share/man/man4

2020-08-20 Thread Warner Losh
Author: imp
Date: Thu Aug 20 18:31:50 2020
New Revision: 364434
URL: https://svnweb.freebsd.org/changeset/base/364434

Log:
  Remove ufm.4 from the Makefile

Modified:
  head/share/man/man4/Makefile

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileThu Aug 20 17:45:54 2020
(r364433)
+++ head/share/man/man4/MakefileThu Aug 20 18:31:50 2020
(r364434)
@@ -976,7 +976,6 @@ MAN+=   \
udbp.4 \
udl.4 \
uep.4 \
-   ufm.4 \
ufoma.4 \
uftdi.4 \
ugen.4 \
___
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: r364379 - head/sys/dev/usb/controller

2020-08-20 Thread Hans Petter Selasky

On 2020-08-20 18:21, Hans Petter Selasky wrote:

On 2020-08-20 18:14, Hans Petter Selasky wrote:

On 2020-08-20 17:51, Nathan Whitehorn wrote:

Either this or r364347 has broken Yubikeys (at least Yubikey 4) plugged
into XHCI ports, which are completely invisible to the USB stack after
the change. I'm going to try to debug further, but wanted to give you a
heads-up in case you can get there first.
-Nathan



Let me know if you can isolate the commit. There has been two commits 
recently in the XHCI code.


I'm on it. Let me run some test here.



See:
https://svnweb.freebsd.org/changeset/base/364433

Thanks to Ed Maste who quickly tested my patch.

--HPS

___
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: r364433 - head/sys/dev/usb/controller

2020-08-20 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Aug 20 17:45:54 2020
New Revision: 364433
URL: https://svnweb.freebsd.org/changeset/base/364433

Log:
  Fix regression after r364379.
  
  The AMD's Ryzen 3 3200g XHCI controllers apparently need the evaluate
  control endpoint context command, but we don't need to issue this
  command when the bMaxPacketSize is received after the read of the USB
  device descriptor, because this part should be handled automatically.
  
  PR:   248784
  Tested by:emaste, hselasky
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/usb/controller/xhci.c

Modified: head/sys/dev/usb/controller/xhci.c
==
--- head/sys/dev/usb/controller/xhci.c  Thu Aug 20 17:35:47 2020
(r364432)
+++ head/sys/dev/usb/controller/xhci.c  Thu Aug 20 17:45:54 2020
(r364433)
@@ -3904,10 +3904,8 @@ xhci_configure_reset_endpoint(struct usb_xfer *xfer)
if (!(sc->sc_hw.devs[index].ep_configured & mask)) {
sc->sc_hw.devs[index].ep_configured |= mask;
err = xhci_cmd_configure_ep(sc, buf_inp.physaddr, 0, index);
-   } else if (epno != 1) {
-   err = xhci_cmd_evaluate_ctx(sc, buf_inp.physaddr, index);
} else {
-   err = 0;
+   err = xhci_cmd_evaluate_ctx(sc, buf_inp.physaddr, index);
}
 
if (err != 0) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r364432 - in head: share/man/man4 sys/conf sys/dev/usb/misc sys/modules/usb sys/modules/usb/ufm

2020-08-20 Thread Warner Losh
Author: imp
Date: Thu Aug 20 17:35:47 2020
New Revision: 364432
URL: https://svnweb.freebsd.org/changeset/base/364432

Log:
  Remove the long obsolete ufm driver.
  
  It was a driver for a USB FM tuner that was available in the market in 2002. I
  wrote the driver in 2003. I've not used it since 2005 or so, so it's time to
  retire this driver. No userland code ever interfaced to the special device it
  created. There's no user base: the last bug I received on this driver was in
  2004.
  
  Relnotes: Yes

Deleted:
  head/share/man/man4/ufm.4
  head/sys/dev/usb/misc/ufm.c
  head/sys/modules/usb/ufm/
Modified:
  head/sys/conf/files
  head/sys/modules/usb/Makefile

Modified: head/sys/conf/files
==
--- head/sys/conf/files Thu Aug 20 17:35:09 2020(r364431)
+++ head/sys/conf/files Thu Aug 20 17:35:47 2020(r364432)
@@ -3332,7 +3332,6 @@ dev/usb/serial/usb_serial.c   optional ucom | u3g | 
uar
 # USB misc drivers
 #
 dev/usb/misc/cp2112.c  optional cp2112
-dev/usb/misc/ufm.c optional ufm
 dev/usb/misc/udbp.coptional udbp
 dev/usb/misc/ugold.c   optional ugold
 dev/usb/misc/uled.coptional uled

Modified: head/sys/modules/usb/Makefile
==
--- head/sys/modules/usb/Makefile   Thu Aug 20 17:35:09 2020
(r364431)
+++ head/sys/modules/usb/Makefile   Thu Aug 20 17:35:47 2020
(r364432)
@@ -47,7 +47,7 @@ SUBDIR = usb
 SUBDIR += ${_dwc_otg} ehci ${_musb} ohci uhci xhci ${_uss820dci} \
  ${_atmegadci} ${_avr32dci} ${_rsu} ${_rsufw} ${_saf1761otg}
 SUBDIR += ${_rum} ${_run} ${_runfw} ${_uath} upgt usie ural ${_zyd} ${_urtw} 
-SUBDIR += atp cfumass uhid uhid_snes ukbd ums udbp ufm uep wmt wsp ugold uled
+SUBDIR += atp cfumass uhid uhid_snes ukbd ums udbp uep wmt wsp ugold uled
 SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt 
\
  umct umcs umodem umoscom uplcom uslcom uvisor uvscom
 SUBDIR += cp2112
___
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: r364431 - in stable/12: share/man/man4 sys/dev/usb/misc

2020-08-20 Thread Warner Losh
Author: imp
Date: Thu Aug 20 17:35:09 2020
New Revision: 364431
URL: https://svnweb.freebsd.org/changeset/base/364431

Log:
  MFC: 359521 ufm removal
  
  ufm will be removed from 13, note it here.
  
  Relnotes: Yes (maybe, very obscure)

Modified:
  stable/12/share/man/man4/ufm.4
  stable/12/sys/dev/usb/misc/ufm.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/share/man/man4/ufm.4
==
--- stable/12/share/man/man4/ufm.4  Thu Aug 20 17:19:40 2020
(r364430)
+++ stable/12/share/man/man4/ufm.4  Thu Aug 20 17:35:09 2020
(r364431)
@@ -44,6 +44,12 @@ module at boot time, place the following line in
 .Bd -literal -offset indent
 ufm_load="YES"
 .Ed
+.Sh DEPRECATION NOTICE
+The
+.Nm
+driver is not present in
+.Fx 13.0
+and later.
 .Sh DESCRIPTION
 The
 .Nm

Modified: stable/12/sys/dev/usb/misc/ufm.c
==
--- stable/12/sys/dev/usb/misc/ufm.cThu Aug 20 17:19:40 2020
(r364430)
+++ stable/12/sys/dev/usb/misc/ufm.cThu Aug 20 17:35:09 2020
(r364431)
@@ -165,6 +165,7 @@ ufm_attach(device_t dev)
if (error) {
goto detach;
}
+   gone_in_dev(dev, 13, "Driver no longer relevant");
return (0); /* success */
 
 detach:
___
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: r364430 - in head: share/man/man4 sys/dev/an sys/dev/ata sys/dev/cmx sys/dev/fdc sys/dev/if_ndis sys/dev/puc sys/dev/uart sys/dev/wi sys/netgraph/bluetooth/drivers/bt3c

2020-08-20 Thread Warner Losh
Author: imp
Date: Thu Aug 20 17:19:40 2020
New Revision: 364430
URL: https://svnweb.freebsd.org/changeset/base/364430

Log:
  Tag pccard drivers with gone in 13.
  
  MFC After: 3 days
  Reviewed by: emaste, brooks, adrian (on twitter)
  Differential Revision: https://reviews.freebsd.org/D26095

Modified:
  head/share/man/man4/an.4
  head/share/man/man4/ata.4
  head/share/man/man4/cmx.4
  head/share/man/man4/fdc.4
  head/share/man/man4/ndis.4
  head/share/man/man4/ng_bt3c.4
  head/share/man/man4/pccard.4
  head/share/man/man4/puc.4
  head/share/man/man4/uart.4
  head/share/man/man4/wi.4
  head/sys/dev/an/if_an_pccard.c
  head/sys/dev/ata/ata-card.c
  head/sys/dev/cmx/cmx_pccard.c
  head/sys/dev/fdc/fdc_pccard.c
  head/sys/dev/if_ndis/if_ndis_pccard.c
  head/sys/dev/puc/puc_pccard.c
  head/sys/dev/uart/uart_bus_pccard.c
  head/sys/dev/wi/if_wi_pccard.c
  head/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c

Modified: head/share/man/man4/an.4
==
--- head/share/man/man4/an.4Thu Aug 20 17:14:44 2020(r364429)
+++ head/share/man/man4/an.4Thu Aug 20 17:19:40 2020(r364430)
@@ -51,6 +51,9 @@ module at boot time, place the following line in
 .Bd -literal -offset indent
 if_an_load="YES"
 .Ed
+.Sh DEPRECATION NOTICE
+This driver is scheduled for removal prior to the release of
+.Fx 13.0
 .Sh DESCRIPTION
 The
 .Nm

Modified: head/share/man/man4/ata.4
==
--- head/share/man/man4/ata.4   Thu Aug 20 17:14:44 2020(r364429)
+++ head/share/man/man4/ata.4   Thu Aug 20 17:19:40 2020(r364430)
@@ -222,6 +222,9 @@ Unknown ATA chipsets are supported in PIO modes, and i
 busmaster DMA registers are present and contain valid setup, DMA is
 also enabled, although the max mode is limited to UDMA33, as it is
 not known what the chipset can do and how to program it.
+.Sh DEPRECATION NOTICE
+The PC Card attachment of this driver is scheduled for removal prior to the 
release of
+.Fx 13.0
 .Sh NOTES
 Please remember that in order to use UDMA4/ATA66 and above modes you
 .Em must

Modified: head/share/man/man4/cmx.4
==
--- head/share/man/man4/cmx.4   Thu Aug 20 17:14:44 2020(r364429)
+++ head/share/man/man4/cmx.4   Thu Aug 20 17:19:40 2020(r364430)
@@ -34,6 +34,9 @@
 .Nd Omnikey CardMan 4040 smartcard reader device driver
 .Sh SYNOPSIS
 .Cd device cmx
+.Sh DEPRECATION NOTICE
+This driver is scheduled for removal prior to the release of
+.Fx 13.0
 .Sh DESCRIPTION
 The
 .Nm

Modified: head/share/man/man4/fdc.4
==
--- head/share/man/man4/fdc.4   Thu Aug 20 17:14:44 2020(r364429)
+++ head/share/man/man4/fdc.4   Thu Aug 20 17:19:40 2020(r364430)
@@ -313,6 +313,9 @@ Third argument is a pointer to
 This type is the same as being used in the per-drive configuration
 flags, or in the CMOS configuration data or ACPI namespace on IA32 systems.
 .El
+.Sh DEPRECATION NOTICE
+The PC Card attachment of this driver is scheduled for removal prior to the 
release of
+.Fx 13.0
 .Sh FILES
 .Bl -tag -width ".Pa /dev/fd*" -compact
 .It Pa /dev/fd*

Modified: head/share/man/man4/ndis.4
==
--- head/share/man/man4/ndis.4  Thu Aug 20 17:14:44 2020(r364429)
+++ head/share/man/man4/ndis.4  Thu Aug 20 17:19:40 2020(r364430)
@@ -120,6 +120,9 @@ driver-specific registry keys to control the media set
 which can be configured via the
 .Xr sysctl 8
 command.
+.Sh DEPRECATION NOTICE
+The PC Card attachment of this driver is scheduled for removal prior to the 
release of
+.Fx 13.0
 .Sh DIAGNOSTICS
 .Bl -diag
 .It "ndis%d: watchdog timeout"

Modified: head/share/man/man4/ng_bt3c.4
==
--- head/share/man/man4/ng_bt3c.4   Thu Aug 20 17:14:44 2020
(r364429)
+++ head/share/man/man4/ng_bt3c.4   Thu Aug 20 17:19:40 2020
(r364430)
@@ -34,6 +34,9 @@
 .Sh SYNOPSIS
 .In sys/types.h
 .In netgraph/bluetooth/include/ng_bt3c.h
+.Sh DEPRECATION NOTICE
+This driver is scheduled for removal prior to the release of
+.Fx 13.0
 .Sh DESCRIPTION
 The
 .Nm btccc

Modified: head/share/man/man4/pccard.4
==
--- head/share/man/man4/pccard.4Thu Aug 20 17:14:44 2020
(r364429)
+++ head/share/man/man4/pccard.4Thu Aug 20 17:19:40 2020
(r364430)
@@ -33,7 +33,7 @@
 .Cd device pccard
 .Sh DEPRECATION NOTICE
 This driver is scheduled for removal prior to the release of
-.Fx 13.0
+.Fx 13.0 .
 .Sh DESCRIPTION
 The
 .Nm

Modified: head/share/man/man4/puc.4
==
--- head/share

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

2020-08-20 Thread Warner Losh
Author: imp
Date: Thu Aug 20 17:14:33 2020
New Revision: 364427
URL: https://svnweb.freebsd.org/changeset/base/364427

Log:
  Make devctl_queue_data_f and devctl_queue_data private.
  
  I thought we'd need them, but nobody is using them. Narrow the interface. This
  will facilitate changes in the future.

Modified:
  head/sys/kern/subr_bus.c
  head/sys/sys/bus.h

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cThu Aug 20 16:56:13 2020(r364426)
+++ head/sys/kern/subr_bus.cThu Aug 20 17:14:33 2020(r364427)
@@ -607,7 +607,7 @@ devctl_process_running(void)
  * assumed that @p data is properly formatted.  It is further assumed
  * that @p data is allocated using the M_BUS malloc type.
  */
-void
+static void
 devctl_queue_data_f(char *data, int flags)
 {
struct dev_event_info *n1 = NULL, *n2 = NULL;
@@ -653,7 +653,7 @@ out:
return;
 }
 
-void
+static void
 devctl_queue_data(char *data)
 {
devctl_queue_data_f(data, M_NOWAIT);

Modified: head/sys/sys/bus.h
==
--- head/sys/sys/bus.h  Thu Aug 20 16:56:13 2020(r364426)
+++ head/sys/sys/bus.h  Thu Aug 20 17:14:33 2020(r364427)
@@ -156,16 +156,13 @@ struct devreq {
 
 /**
  * devctl hooks.  Typically one should use the devctl_notify
- * hook to send the message.  However, devctl_queue_data is also
- * included in case devctl_notify isn't sufficiently general.
+ * hook to send the message.
  */
 boolean_t devctl_process_running(void);
 void devctl_notify_f(const char *__system, const char *__subsystem,
 const char *__type, const char *__data, int __flags);
 void devctl_notify(const char *__system, const char *__subsystem,
 const char *__type, const char *__data);
-void devctl_queue_data_f(char *__data, int __flags);
-void devctl_queue_data(char *__data);
 struct sbuf;
 void devctl_safe_quote_sb(struct sbuf *__sb, const char *__src);
 
___
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: r364428 - head/sys/sys

2020-08-20 Thread Warner Losh
Author: imp
Date: Thu Aug 20 17:14:39 2020
New Revision: 364428
URL: https://svnweb.freebsd.org/changeset/base/364428

Log:
  Move devctl_notify* to devctl.h.

Added:
  head/sys/sys/devctl.h   (contents, props changed)
Modified:
  head/sys/sys/bus.h

Modified: head/sys/sys/bus.h
==
--- head/sys/sys/bus.h  Thu Aug 20 17:14:33 2020(r364427)
+++ head/sys/sys/bus.h  Thu Aug 20 17:14:39 2020(r364428)
@@ -153,18 +153,7 @@ struct devreq {
 #include 
 #include 
 #include 
-
-/**
- * devctl hooks.  Typically one should use the devctl_notify
- * hook to send the message.
- */
-boolean_t devctl_process_running(void);
-void devctl_notify_f(const char *__system, const char *__subsystem,
-const char *__type, const char *__data, int __flags);
-void devctl_notify(const char *__system, const char *__subsystem,
-const char *__type, const char *__data);
-struct sbuf;
-void devctl_safe_quote_sb(struct sbuf *__sb, const char *__src);
+#include 
 
 /**
  * Device name parsers.  Hook to allow device enumerators to map

Added: head/sys/sys/devctl.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/sys/devctl.h   Thu Aug 20 17:14:39 2020(r364428)
@@ -0,0 +1,46 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright 2020 M. Warner Losh.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
+ */
+
+#ifndef _SYS_DEVCTL_H_
+#define _SYS_DEVCTL_H_
+
+/**
+ * devctl hooks.  Typically one should use the devctl_notify
+ * hook to send the message.
+ */
+boolean_t devctl_process_running(void);
+void devctl_notify_f(const char *__system, const char *__subsystem,
+const char *__type, const char *__data, int __flags);
+void devctl_notify(const char *__system, const char *__subsystem,
+const char *__type, const char *__data);
+struct sbuf;
+void devctl_safe_quote_sb(struct sbuf *__sb, const char *__src);
+
+#endif /* _SYS_DEVCTL_H_ */
___
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: r364429 - head/sys/kern

2020-08-20 Thread Warner Losh
Author: imp
Date: Thu Aug 20 17:14:44 2020
New Revision: 364429
URL: https://svnweb.freebsd.org/changeset/base/364429

Log:
  Move from TAILQ to STAILQ because the nodes are a bit smaller.

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cThu Aug 20 17:14:39 2020(r364428)
+++ head/sys/kern/subr_bus.cThu Aug 20 17:14:44 2020(r364429)
@@ -408,10 +408,10 @@ static struct cdevsw dev_cdevsw = {
 struct dev_event_info
 {
char *dei_data;
-   TAILQ_ENTRY(dev_event_info) dei_link;
+   STAILQ_ENTRY(dev_event_info) dei_link;
 };
 
-TAILQ_HEAD(devq, dev_event_info);
+STAILQ_HEAD(devq, dev_event_info);
 
 static struct dev_softc
 {
@@ -444,7 +444,7 @@ devinit(void)
UID_ROOT, GID_WHEEL, 0600, "devctl");
mtx_init(&devsoftc.mtx, "dev mtx", "devd", MTX_DEF);
cv_init(&devsoftc.cv, "dev cv");
-   TAILQ_INIT(&devsoftc.devq);
+   STAILQ_INIT(&devsoftc.devq);
knlist_init_mtx(&devsoftc.sel.si_note, &devsoftc.mtx);
devctl2_init();
 }
@@ -491,7 +491,7 @@ devread(struct cdev *dev, struct uio *uio, int ioflag)
int rv;
 
mtx_lock(&devsoftc.mtx);
-   while (TAILQ_EMPTY(&devsoftc.devq)) {
+   while (STAILQ_EMPTY(&devsoftc.devq)) {
if (devsoftc.nonblock) {
mtx_unlock(&devsoftc.mtx);
return (EAGAIN);
@@ -505,8 +505,8 @@ devread(struct cdev *dev, struct uio *uio, int ioflag)
return (rv);
}
}
-   n1 = TAILQ_FIRST(&devsoftc.devq);
-   TAILQ_REMOVE(&devsoftc.devq, n1, dei_link);
+   n1 = STAILQ_FIRST(&devsoftc.devq);
+   STAILQ_REMOVE_HEAD(&devsoftc.devq, dei_link);
devsoftc.queued--;
mtx_unlock(&devsoftc.mtx);
rv = uiomove(n1->dei_data, strlen(n1->dei_data), uio);
@@ -554,7 +554,7 @@ devpoll(struct cdev *dev, int events, struct thread *t
 
mtx_lock(&devsoftc.mtx);
if (events & (POLLIN | POLLRDNORM)) {
-   if (!TAILQ_EMPTY(&devsoftc.devq))
+   if (!STAILQ_EMPTY(&devsoftc.devq))
revents = events & (POLLIN | POLLRDNORM);
else
selrecord(td, &devsoftc.sel);
@@ -629,13 +629,13 @@ devctl_queue_data_f(char *data, int flags)
}
/* Leave at least one spot in the queue... */
while (devsoftc.queued > devctl_queue_length - 1) {
-   n2 = TAILQ_FIRST(&devsoftc.devq);
-   TAILQ_REMOVE(&devsoftc.devq, n2, dei_link);
+   n2 = STAILQ_FIRST(&devsoftc.devq);
+   STAILQ_REMOVE_HEAD(&devsoftc.devq, dei_link);
free(n2->dei_data, M_BUS);
free(n2, M_BUS);
devsoftc.queued--;
}
-   TAILQ_INSERT_TAIL(&devsoftc.devq, n1, dei_link);
+   STAILQ_INSERT_TAIL(&devsoftc.devq, n1, dei_link);
devsoftc.queued++;
cv_broadcast(&devsoftc.cv);
KNOTE_LOCKED(&devsoftc.sel.si_note, 0);
@@ -811,9 +811,9 @@ sysctl_devctl_disable(SYSCTL_HANDLER_ARGS)
if (mtx_initialized(&devsoftc.mtx))
mtx_lock(&devsoftc.mtx);
if (dis) {
-   while (!TAILQ_EMPTY(&devsoftc.devq)) {
-   n1 = TAILQ_FIRST(&devsoftc.devq);
-   TAILQ_REMOVE(&devsoftc.devq, n1, dei_link);
+   while (!STAILQ_EMPTY(&devsoftc.devq)) {
+   n1 = STAILQ_FIRST(&devsoftc.devq);
+   STAILQ_REMOVE_HEAD(&devsoftc.devq, dei_link);
free(n1->dei_data, M_BUS);
free(n1, M_BUS);
}
@@ -843,8 +843,8 @@ sysctl_devctl_queue(SYSCTL_HANDLER_ARGS)
mtx_lock(&devsoftc.mtx);
devctl_queue_length = q;
while (devsoftc.queued > devctl_queue_length) {
-   n1 = TAILQ_FIRST(&devsoftc.devq);
-   TAILQ_REMOVE(&devsoftc.devq, n1, dei_link);
+   n1 = STAILQ_FIRST(&devsoftc.devq);
+   STAILQ_REMOVE_HEAD(&devsoftc.devq, dei_link);
free(n1->dei_data, M_BUS);
free(n1, M_BUS);
devsoftc.queued--;
___
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: r364426 - head/sys/netpfil/ipfw

2020-08-20 Thread Ed Maste
Author: emaste
Date: Thu Aug 20 16:56:13 2020
New Revision: 364426
URL: https://svnweb.freebsd.org/changeset/base/364426

Log:
  ipfw: style(9) fixes
  
  Submitted by: Neel Chauhan 
  Reviewed by:  emaste, glebius
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D26126

Modified:
  head/sys/netpfil/ipfw/ip_fw2.c

Modified: head/sys/netpfil/ipfw/ip_fw2.c
==
--- head/sys/netpfil/ipfw/ip_fw2.c  Thu Aug 20 16:52:48 2020
(r364425)
+++ head/sys/netpfil/ipfw/ip_fw2.c  Thu Aug 20 16:56:13 2020
(r364426)
@@ -757,17 +757,17 @@ ipfw_send_pkt(struct mbuf *replyto, struct ipfw_flow_i
  * ipv6 specific rules here...
  */
 static __inline int
-icmp6type_match (int type, ipfw_insn_u32 *cmd)
+icmp6type_match(int type, ipfw_insn_u32 *cmd)
 {
return (type <= ICMP6_MAXTYPE && (cmd->d[type/32] & (1<<(type%32)) ) );
 }
 
 static int
-flow6id_match( int curr_flow, ipfw_insn_u32 *cmd )
+flow6id_match(int curr_flow, ipfw_insn_u32 *cmd)
 {
int i;
-   for (i=0; i <= cmd->o.arg1; ++i )
-   if (curr_flow == cmd->d[i] )
+   for (i=0; i <= cmd->o.arg1; ++i)
+   if (curr_flow == cmd->d[i])
return 1;
return 0;
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r364424 - head/share/man/man9

2020-08-20 Thread Warner Losh
Author: imp
Date: Thu Aug 20 16:52:34 2020
New Revision: 364424
URL: https://svnweb.freebsd.org/changeset/base/364424

Log:
  Fix function name in zone.9
  
  uma_zone_prealloc -> uma_prealloc. There's no uma_zone_prealloc defined and 
the
  docs for it describe uma_prealloc exactly.

Modified:
  head/share/man/man9/zone.9

Modified: head/share/man/man9/zone.9
==
--- head/share/man/man9/zone.9  Thu Aug 20 15:19:09 2020(r364423)
+++ head/share/man/man9/zone.9  Thu Aug 20 16:52:34 2020(r364424)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 3, 2020
+.Dd August 20, 2020
 .Dt UMA 9
 .Os
 .Sh NAME
@@ -394,7 +394,7 @@ This uses a guaranteed but slow path in the allocator 
 concurrency.
 .Pp
 The
-.Fn uma_zone_prealloc
+.Fn uma_prealloc
 function allocates slabs for the requested number of items, typically following
 the initial creation of a zone.
 Subsequent allocations from the zone will be satisfied using the pre-allocated
@@ -402,7 +402,7 @@ slabs.
 Note that slab allocation is performed with the
 .Dv M_WAITOK
 flag, so
-.Fn uma_zone_prealloc
+.Fn uma_prealloc
 may sleep.
 .Pp
 The
___
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: r364425 - head/sys/kern

2020-08-20 Thread Warner Losh
Author: imp
Date: Thu Aug 20 16:52:48 2020
New Revision: 364425
URL: https://svnweb.freebsd.org/changeset/base/364425

Log:
  Use names suggested by kib@ in review D25969, move call for unmount to not 
call
  with vnode locked, use NOWAIT alloc and only report when we don't overflow.
  
  These changes were accidentally omitted from r364402, except for the not
  reporting on overflow. They were lumped in with a debugging commit in my tree
  that I omitted w/o realizing this.
  
  Other issues from the review are pending some other changes I need to do 
first.

Modified:
  head/sys/kern/vfs_mount.c

Modified: head/sys/kern/vfs_mount.c
==
--- head/sys/kern/vfs_mount.c   Thu Aug 20 16:52:34 2020(r364424)
+++ head/sys/kern/vfs_mount.c   Thu Aug 20 16:52:48 2020(r364425)
@@ -102,7 +102,7 @@ MTX_SYSINIT(mountlist, &mountlist_mtx, "mountlist", MT
 EVENTHANDLER_LIST_DEFINE(vfs_mounted);
 EVENTHANDLER_LIST_DEFINE(vfs_unmounted);
 
-static void dev_vfs_event(const char *type, struct mount *mp, bool donew);
+static void mount_devctl_event(const char *type, struct mount *mp, bool donew);
 
 /*
  * Global opts, taken by all filesystems
@@ -1023,7 +1023,7 @@ vfs_domount_first(
VOP_UNLOCK(vp);
EVENTHANDLER_DIRECT_INVOKE(vfs_mounted, mp, newdp, td);
VOP_UNLOCK(newdp);
-   dev_vfs_event("MOUNT", mp, false);
+   mount_devctl_event("MOUNT", mp, false);
mountcheckdirs(vp, newdp);
vn_seqc_write_end(vp);
vn_seqc_write_end(newdp);
@@ -1225,7 +1225,7 @@ vfs_domount_update(
if (error != 0)
goto end;
 
-   dev_vfs_event("REMOUNT", mp, true);
+   mount_devctl_event("REMOUNT", mp, true);
if (mp->mnt_opt != NULL)
vfs_freeopts(mp->mnt_opt);
mp->mnt_opt = mp->mnt_optnew;
@@ -1844,13 +1844,13 @@ dounmount(struct mount *mp, int flags, struct thread *
TAILQ_REMOVE(&mountlist, mp, mnt_list);
mtx_unlock(&mountlist_mtx);
EVENTHANDLER_DIRECT_INVOKE(vfs_unmounted, mp, td);
-   dev_vfs_event("UNMOUNT", mp, false);
if (coveredvp != NULL) {
coveredvp->v_mountedhere = NULL;
vn_seqc_write_end(coveredvp);
VOP_UNLOCK(coveredvp);
vdrop(coveredvp);
}
+   mount_devctl_event("UNMOUNT", mp, false);
if (rootvp != NULL) {
vn_seqc_write_end(rootvp);
vdrop(rootvp);
@@ -2439,7 +2439,7 @@ static struct mntoptnames optnames[] = {
 };
 
 static void
-dev_vfs_event_mntopt(struct sbuf *sb, const char *what, struct vfsoptlist 
*opts)
+mount_devctl_event_mntopt(struct sbuf *sb, const char *what, struct vfsoptlist 
*opts)
 {
struct vfsopt *opt;
 
@@ -2461,7 +2461,7 @@ dev_vfs_event_mntopt(struct sbuf *sb, const char *what
 
 #define DEVCTL_LEN 1024
 static void
-dev_vfs_event(const char *type, struct mount *mp, bool donew)
+mount_devctl_event(const char *type, struct mount *mp, bool donew)
 {
const uint8_t *cp;
struct mntoptnames *fp;
@@ -2469,7 +2469,7 @@ dev_vfs_event(const char *type, struct mount *mp, bool
struct statfs *sfp = &mp->mnt_stat;
char *buf;
 
-   buf = malloc(DEVCTL_LEN, M_MOUNT, M_WAITOK);
+   buf = malloc(DEVCTL_LEN, M_MOUNT, M_NOWAIT);
if (buf == NULL)
return;
sbuf_new(&sb, buf, DEVCTL_LEN, SBUF_FIXEDLEN);
@@ -2491,12 +2491,13 @@ dev_vfs_event(const char *type, struct mount *mp, bool
}
}
sbuf_putc(&sb, '"');
-   dev_vfs_event_mntopt(&sb, "opt", mp->mnt_opt);
+   mount_devctl_event_mntopt(&sb, "opt", mp->mnt_opt);
if (donew)
-   dev_vfs_event_mntopt(&sb, "optnew", mp->mnt_optnew);
+   mount_devctl_event_mntopt(&sb, "optnew", mp->mnt_optnew);
sbuf_finish(&sb);
 
-   devctl_notify("VFS", "FS", type, sbuf_data(&sb));
+   if (sbuf_error(&sb) == 0)
+   devctl_notify("VFS", "FS", type, sbuf_data(&sb));
sbuf_delete(&sb);
free(buf, M_MOUNT);
 }
___
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: r364379 - head/sys/dev/usb/controller

2020-08-20 Thread Hans Petter Selasky

On 2020-08-20 18:14, Hans Petter Selasky wrote:

On 2020-08-20 17:51, Nathan Whitehorn wrote:

Either this or r364347 has broken Yubikeys (at least Yubikey 4) plugged
into XHCI ports, which are completely invisible to the USB stack after
the change. I'm going to try to debug further, but wanted to give you a
heads-up in case you can get there first.
-Nathan



Let me know if you can isolate the commit. There has been two commits 
recently in the XHCI code.


I'm on it. Let me run some test here.

--HPS

___
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: r364379 - head/sys/dev/usb/controller

2020-08-20 Thread Hans Petter Selasky

On 2020-08-20 17:51, Nathan Whitehorn wrote:

Either this or r364347 has broken Yubikeys (at least Yubikey 4) plugged
into XHCI ports, which are completely invisible to the USB stack after
the change. I'm going to try to debug further, but wanted to give you a
heads-up in case you can get there first.
-Nathan



Let me know if you can isolate the commit. There has been two commits 
recently in the XHCI code.


--HPS

___
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: r364379 - head/sys/dev/usb/controller

2020-08-20 Thread Nathan Whitehorn
Either this or r364347 has broken Yubikeys (at least Yubikey 4) plugged
into XHCI ports, which are completely invisible to the USB stack after
the change. I'm going to try to debug further, but wanted to give you a
heads-up in case you can get there first.
-Nathan

On 2020-08-19 07:50, Hans Petter Selasky wrote:
> Author: hselasky
> Date: Wed Aug 19 11:50:12 2020
> New Revision: 364379
> URL: https://svnweb.freebsd.org/changeset/base/364379
>
> Log:
>   Avoid evaluating the XHCI control endpoint context.
>   
>   The XHCI specification says that the XHCI controller should detect
>   reception of the USB device descriptors, and automatically update
>   the max packet size in the control endpoint context.
>   
>   Differential Revision:  https://reviews.freebsd.org/D26104
>   Reviewed by:kp@
>   MFC after:  1 week
>   Sponsored by:   Mellanox Technologies
>
> Modified:
>   head/sys/dev/usb/controller/xhci.c
>   head/sys/dev/usb/controller/xhci.h
>
> Modified: head/sys/dev/usb/controller/xhci.c
> ==
> --- head/sys/dev/usb/controller/xhci.cWed Aug 19 10:40:02 2020
> (r364378)
> +++ head/sys/dev/usb/controller/xhci.cWed Aug 19 11:50:12 2020
> (r364379)
> @@ -2398,8 +2398,6 @@ xhci_configure_endpoint(struct usb_device *udev,
>  
>   /* store endpoint mode */
>   pepext->trb_ep_mode = ep_mode;
> - /* store bMaxPacketSize for control endpoints */
> - pepext->trb_ep_maxp = edesc->wMaxPacketSize[0];
>   usb_pc_cpu_flush(pepext->page_cache);
>  
>   if (ep_mode == USB_EP_MODE_STREAMS) {
> @@ -2929,17 +2927,6 @@ xhci_transfer_insert(struct usb_xfer *xfer)
>   return (USB_ERR_NOMEM);
>   }
>  
> - /* check if bMaxPacketSize changed */
> - if (xfer->flags_int.control_xfr != 0 &&
> - pepext->trb_ep_maxp != xfer->endpoint->edesc->wMaxPacketSize[0]) {
> -
> - DPRINTFN(8, "Reconfigure control endpoint\n");
> -
> - /* force driver to reconfigure endpoint */
> - pepext->trb_halted = 1;
> - pepext->trb_running = 0;
> - }
> -
>   /* check for stopped condition, after putting transfer on interrupt 
> queue */
>   if (pepext->trb_running == 0) {
>   struct xhci_softc *sc = XHCI_BUS2SC(xfer->xroot->bus);
> @@ -3917,8 +3904,10 @@ xhci_configure_reset_endpoint(struct usb_xfer *xfer)
>   if (!(sc->sc_hw.devs[index].ep_configured & mask)) {
>   sc->sc_hw.devs[index].ep_configured |= mask;
>   err = xhci_cmd_configure_ep(sc, buf_inp.physaddr, 0, index);
> - } else {
> + } else if (epno != 1) {
>   err = xhci_cmd_evaluate_ctx(sc, buf_inp.physaddr, index);
> + } else {
> + err = 0;
>   }
>  
>   if (err != 0) {
>
> Modified: head/sys/dev/usb/controller/xhci.h
> ==
> --- head/sys/dev/usb/controller/xhci.hWed Aug 19 10:40:02 2020
> (r364378)
> +++ head/sys/dev/usb/controller/xhci.hWed Aug 19 11:50:12 2020
> (r364379)
> @@ -393,7 +393,6 @@ struct xhci_endpoint_ext {
>   uint8_t trb_halted;
>   uint8_t trb_running;
>   uint8_t trb_ep_mode;
> - uint8_t trb_ep_maxp;
>  };
>  
>  enum {
>

___
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: r364423 - head/lib/libc/gen

2020-08-20 Thread Konstantin Belousov
Author: kib
Date: Thu Aug 20 15:19:09 2020
New Revision: 364423
URL: https://svnweb.freebsd.org/changeset/base/364423

Log:
  dl_iterate_phdr(3): provide exclusive locking for callback when statically 
linked.
  
  Apparently llvm unwinder depends on the external locking for callback.
  
  Reviewed by:  cem, emaste
  Tested by:emaste
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D26109

Modified:
  head/lib/libc/gen/dlfcn.c

Modified: head/lib/libc/gen/dlfcn.c
==
--- head/lib/libc/gen/dlfcn.c   Thu Aug 20 14:07:29 2020(r364422)
+++ head/lib/libc/gen/dlfcn.c   Thu Aug 20 15:19:09 2020(r364423)
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include "un-namespace.h"
 #include "libc_private.h"
+#include "reentrant.h"
 
 static char sorry[] = "Service unavailable";
 
@@ -164,6 +165,7 @@ _rtld_thread_init(void *li __unused)
 #ifndef IN_LIBDL
 static pthread_once_t dl_phdr_info_once = PTHREAD_ONCE_INIT;
 static struct dl_phdr_info phdr_info;
+static mutex_t dl_phdr_info_lock = MUTEX_INITIALIZER;
 
 static void
 dl_init_phdr_info(void)
@@ -204,13 +206,17 @@ int
 dl_iterate_phdr(int (*callback)(struct dl_phdr_info *, size_t, void *) 
__unused,
 void *data __unused)
 {
-
 #ifndef IN_LIBDL
+   int ret;
+
__init_elf_aux_vector();
if (__elf_aux_vector == NULL)
return (1);
_once(&dl_phdr_info_once, dl_init_phdr_info);
-   return (callback(&phdr_info, sizeof(phdr_info), data));
+   mutex_lock(&dl_phdr_info_lock);
+   ret = callback(&phdr_info, sizeof(phdr_info), data);
+   mutex_unlock(&dl_phdr_info_lock);
+   return (ret);
 #else
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: r364422 - stable/12/usr.sbin/certctl

2020-08-20 Thread Kyle Evans
Author: kevans
Date: Thu Aug 20 14:07:29 2020
New Revision: 364422
URL: https://svnweb.freebsd.org/changeset/base/364422

Log:
  MFC r361397, r361683: certctl(8) unprivileged mode
  
  r361397:
  Add an unprivileged mode where calls to install are passed appropriate
  flags.  For ease of integration, use the same flags as install:
  
   -U   unprivileged mode
   -D  Specify DESTDIR (overrides the environment)
   -M  Full path to METALOG file
  
  r361683:
  certctl: fix test syntax
  
  test doesn't understand &&, but it does understand -a.

Modified:
  stable/12/usr.sbin/certctl/certctl.8
  stable/12/usr.sbin/certctl/certctl.sh
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/certctl/certctl.8
==
--- stable/12/usr.sbin/certctl/certctl.8Thu Aug 20 12:50:49 2020
(r364421)
+++ stable/12/usr.sbin/certctl/certctl.8Thu Aug 20 14:07:29 2020
(r364422)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 30, 2020
+.Dd August 20, 2020
 .Dt CERTCTL 8
 .Os
 .Sh NAME
@@ -40,7 +40,9 @@
 .Op Fl v
 .Ic blacklisted
 .Nm
-.Op Fl nv
+.Op Fl nUv
+.Op Fl D Ar destdir
+.Op Fl M Ar metalog
 .Ic rehash
 .Nm
 .Op Fl nv
@@ -56,10 +58,17 @@ applications that use OpenSSL.
 .Pp
 Flags:
 .Bl -tag -width 4n
+.It Fl D Ar destdir
+Specify the DESTDIR (overriding values from the environment).
+.It Fl M Ar metalog
+Specify the path of the METALOG file (default: $DESTDIR/METALOG).
 .It Fl n
 No-Op mode, do not actually perform any actions.
 .It Fl v
 be verbose, print details about actions before performing them.
+.It Fl U
+Unprivileged mode, do not change the ownership of created links.
+Do record the ownership in the METALOG file.
 .El
 .Pp
 Primary command functions:

Modified: stable/12/usr.sbin/certctl/certctl.sh
==
--- stable/12/usr.sbin/certctl/certctl.sh   Thu Aug 20 12:50:49 2020
(r364421)
+++ stable/12/usr.sbin/certctl/certctl.sh   Thu Aug 20 14:07:29 2020
(r364422)
@@ -30,10 +30,6 @@
  CONFIGURATION
 
 : ${DESTDIR:=}
-: 
${TRUSTPATH:=${DESTDIR}/usr/share/certs/trusted:${DESTDIR}/usr/local/share/certs:${DESTDIR}/usr/local/etc/ssl/certs}
-: 
${BLACKLISTPATH:=${DESTDIR}/usr/share/certs/blacklisted:${DESTDIR}/usr/local/etc/ssl/blacklisted}
-: ${CERTDESTDIR:=${DESTDIR}/etc/ssl/certs}
-: ${BLACKLISTDESTDIR:=${DESTDIR}/etc/ssl/blacklisted}
 : ${FILEPAT:="\.pem$|\.crt$|\.cer$|\.crl$|\.0$"}
 : ${VERBOSE:=0}
 
@@ -42,6 +38,7 @@
 SCRIPTNAME="${0##*/}"
 ERRORS=0
 NOOP=0
+UNPRIV=0
 
  FUNCTIONS
 
@@ -69,7 +66,7 @@ create_trusted_link()
return 1
fi
[ $VERBOSE -gt 0 ] && echo "Adding $hash.0 to trust store"
-   [ $NOOP -eq 0 ] && install -lrs $(realpath "$1") "$CERTDESTDIR/$hash.0"
+   [ $NOOP -eq 0 ] && install ${INSTALLFLAGS} -lrs $(realpath "$1") 
"$CERTDESTDIR/$hash.0"
 }
 
 create_blacklisted()
@@ -88,7 +85,7 @@ create_blacklisted()
return
fi
[ $VERBOSE -gt 0 ] && echo "Adding $filename to blacklist"
-   [ $NOOP -eq 0 ] && install -lrs "$srcfile" "$BLACKLISTDESTDIR/$filename"
+   [ $NOOP -eq 0 ] && install ${INSTALLFLAGS} -lrs "$srcfile" 
"$BLACKLISTDESTDIR/$filename"
 }
 
 do_scan()
@@ -105,7 +102,7 @@ do_scan()
[ -d "$CPATH" ] || continue
echo "Scanning $CPATH for certificates..."
for CFILE in $(ls -1 "${CPATH}" | grep -Ee "${FILEPAT}"); do
-   [ -e "$CPATH/$CFILE" ] || continue
+   [ -e "$CPATH/$CFILE" -a $UNPRIV -eq 0 ] || continue
[ $VERBOSE -gt 0 ] && echo "Reading $CFILE"
"$CFUNC" "$CPATH/$CFILE"
done
@@ -209,7 +206,7 @@ usage()
echo "  List trusted certificates"
echo "  $SCRIPTNAME [-v] blacklisted"
echo "  List blacklisted certificates"
-   echo "  $SCRIPTNAME [-nv] rehash"
+   echo "  $SCRIPTNAME [-nUv] [-D ] [-M ] rehash"
echo "  Generate hash links for all certificates"
echo "  $SCRIPTNAME [-nv] blacklist "
echo "  Add  to the list of blacklisted certificates"
@@ -220,13 +217,24 @@ usage()
 
  MAIN
 
-while getopts nv flag; do
+while getopts D:M:nUv flag; do
case "$flag" in
+   D) DESTDIR=${OPTARG} ;;
+   M) METALOG=${OPTARG} ;;
n) NOOP=1 ;;
+   U) UNPRIV=1 ;;
v) VERBOSE=$(( $VERBOSE + 1 )) ;;
esac
 done
 shift $(( $OPTIND - 1 ))
+
+: ${METALOG:=${DESTDIR}/METALOG}
+INSTALLFLAGS=
+[ $UNPRIV -eq 1 ] && INSTALLFLAGS=-U -M ${METALOG} -D ${DESTDIR}
+: 
${TRUSTPATH:=${DESTDIR}/usr/share/certs/trusted:${DESTDIR}/usr/local/share/certs:${DESTDIR}/usr/local/e

Re: svn commit: r364421 - head/stand/libsa

2020-08-20 Thread Emmanuel Vadot
On Thu, 20 Aug 2020 12:50:50 + (UTC)
Emmanuel Vadot  wrote:

> Author: manu
> Date: Thu Aug 20 12:50:49 2020
> New Revision: 364421
> URL: https://svnweb.freebsd.org/changeset/base/364421
> 
> Log:
>   libsa: smbios: Parse the chassis type and export it as smbios.chassis.type
>   
>   It can be useful to know what type of machine we are running on for desktop
>   related thing.
>   It also allow us to support all the DMI variable that linux driver can 
> fetch.
>   
>   MFC after:  1 week
>   Sponsored by:   Sponsored-by: The FreeBSD Foundation

 Differential Revision: https://reviews.freebsd.org/D26045
 Reviewed by: emaste

> Modified:
>   head/stand/libsa/smbios.c
> 
> Modified: head/stand/libsa/smbios.c
> ==
> --- head/stand/libsa/smbios.c Thu Aug 20 10:06:50 2020(r364420)
> +++ head/stand/libsa/smbios.c Thu Aug 20 12:50:49 2020(r364421)
> @@ -209,6 +209,90 @@ smbios_setuuid(const char *name, const caddr_t addr, c
>  
>  #endif
>  
> +static const char *
> +smbios_parse_chassis_type(caddr_t addr)
> +{
> + int type;
> +
> + type = SMBIOS_GET8(addr, 0x5);
> + switch (type) {
> + case 0x1:
> + return ("Other");
> + case 0x2:
> + return ("Unknown");
> + case 0x3:
> + return ("Desktop");
> + case 0x4:
> + return ("Low Profile Desktop");
> + case 0x5:
> + return ("Pizza Box");
> + case 0x6:
> + return ("Mini Tower");
> + case 0x7:
> + return ("Tower");
> + case 0x8:
> + return ("Portable");
> + case 0x9:
> + return ("Laptop");
> + case 0xA:
> + return ("Notebook");
> + case 0xB:
> + return ("Hand Held");
> + case 0xC:
> + return ("Docking Station");
> + case 0xD:
> + return ("All in One");
> + case 0xE:
> + return ("Sub Notebook");
> + case 0xF:
> + return ("Lunch Box");
> + case 0x10:
> + return ("Space-saving");
> + case 0x11:
> + return ("Main Server Chassis");
> + case 0x12:
> + return ("Expansion Chassis");
> + case 0x13:
> + return ("SubChassis");
> + case 0x14:
> + return ("Bus Expansion Chassis");
> + case 0x15:
> + return ("Peripheral Chassis");
> + case 0x16:
> + return ("RAID Chassis");
> + case 0x17:
> + return ("Rack Mount Chassis");
> + case 0x18:
> + return ("Sealed-case PC");
> + case 0x19:
> + return ("Multi-system chassis");
> + case 0x1A:
> + return ("Compact PCI");
> + case 0x1B:
> + return ("Advanced TCA");
> + case 0x1C:
> + return ("Blade");
> + case 0x1D:
> + return ("Blade Enclosure");
> + case 0x1E:
> + return ("Tablet");
> + case 0x1F:
> + return ("Convertible");
> + case 0x20:
> + return ("Detachable");
> + case 0x21:
> + return ("IoT Gateway");
> + case 0x22:
> + return ("Embedded PC");
> + case 0x23:
> + return ("Mini PC");
> + case 0x24:
> + return ("Stick PC");
> + }
> +
> + return ("Undefined");
> +}
> +
>  static caddr_t
>  smbios_parse_table(const caddr_t addr)
>  {
> @@ -251,6 +335,7 @@ smbios_parse_table(const caddr_t addr)
>  
>   case 3: /* 3.3.4 System Enclosure or Chassis (Type 3) */
>   smbios_setenv("smbios.chassis.maker", addr, 0x04);
> + setenv("smbios.chassis.type", smbios_parse_chassis_type(addr), 
> 1);
>   smbios_setenv("smbios.chassis.version", addr, 0x06);
>  #ifdef SMBIOS_SERIAL_NUMBERS
>   smbios_setenv("smbios.chassis.serial", addr, 0x07);


-- 
Emmanuel Vadot  
___
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: r364421 - head/stand/libsa

2020-08-20 Thread Emmanuel Vadot
Author: manu
Date: Thu Aug 20 12:50:49 2020
New Revision: 364421
URL: https://svnweb.freebsd.org/changeset/base/364421

Log:
  libsa: smbios: Parse the chassis type and export it as smbios.chassis.type
  
  It can be useful to know what type of machine we are running on for desktop
  related thing.
  It also allow us to support all the DMI variable that linux driver can fetch.
  
  MFC after:1 week
  Sponsored by: Sponsored-by: The FreeBSD Foundation

Modified:
  head/stand/libsa/smbios.c

Modified: head/stand/libsa/smbios.c
==
--- head/stand/libsa/smbios.c   Thu Aug 20 10:06:50 2020(r364420)
+++ head/stand/libsa/smbios.c   Thu Aug 20 12:50:49 2020(r364421)
@@ -209,6 +209,90 @@ smbios_setuuid(const char *name, const caddr_t addr, c
 
 #endif
 
+static const char *
+smbios_parse_chassis_type(caddr_t addr)
+{
+   int type;
+
+   type = SMBIOS_GET8(addr, 0x5);
+   switch (type) {
+   case 0x1:
+   return ("Other");
+   case 0x2:
+   return ("Unknown");
+   case 0x3:
+   return ("Desktop");
+   case 0x4:
+   return ("Low Profile Desktop");
+   case 0x5:
+   return ("Pizza Box");
+   case 0x6:
+   return ("Mini Tower");
+   case 0x7:
+   return ("Tower");
+   case 0x8:
+   return ("Portable");
+   case 0x9:
+   return ("Laptop");
+   case 0xA:
+   return ("Notebook");
+   case 0xB:
+   return ("Hand Held");
+   case 0xC:
+   return ("Docking Station");
+   case 0xD:
+   return ("All in One");
+   case 0xE:
+   return ("Sub Notebook");
+   case 0xF:
+   return ("Lunch Box");
+   case 0x10:
+   return ("Space-saving");
+   case 0x11:
+   return ("Main Server Chassis");
+   case 0x12:
+   return ("Expansion Chassis");
+   case 0x13:
+   return ("SubChassis");
+   case 0x14:
+   return ("Bus Expansion Chassis");
+   case 0x15:
+   return ("Peripheral Chassis");
+   case 0x16:
+   return ("RAID Chassis");
+   case 0x17:
+   return ("Rack Mount Chassis");
+   case 0x18:
+   return ("Sealed-case PC");
+   case 0x19:
+   return ("Multi-system chassis");
+   case 0x1A:
+   return ("Compact PCI");
+   case 0x1B:
+   return ("Advanced TCA");
+   case 0x1C:
+   return ("Blade");
+   case 0x1D:
+   return ("Blade Enclosure");
+   case 0x1E:
+   return ("Tablet");
+   case 0x1F:
+   return ("Convertible");
+   case 0x20:
+   return ("Detachable");
+   case 0x21:
+   return ("IoT Gateway");
+   case 0x22:
+   return ("Embedded PC");
+   case 0x23:
+   return ("Mini PC");
+   case 0x24:
+   return ("Stick PC");
+   }
+
+   return ("Undefined");
+}
+
 static caddr_t
 smbios_parse_table(const caddr_t addr)
 {
@@ -251,6 +335,7 @@ smbios_parse_table(const caddr_t addr)
 
case 3: /* 3.3.4 System Enclosure or Chassis (Type 3) */
smbios_setenv("smbios.chassis.maker", addr, 0x04);
+   setenv("smbios.chassis.type", smbios_parse_chassis_type(addr), 
1);
smbios_setenv("smbios.chassis.version", addr, 0x06);
 #ifdef SMBIOS_SERIAL_NUMBERS
smbios_setenv("smbios.chassis.serial", addr, 0x07);
___
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: r364420 - head/sys/kern

2020-08-20 Thread Mateusz Guzik
Author: mjg
Date: Thu Aug 20 10:06:50 2020
New Revision: 364420
URL: https://svnweb.freebsd.org/changeset/base/364420

Log:
  cache: don't use cache_purge_negative when renaming
  
  It avoidably scans (and evicts) unrelated entries. Instead take
  advantage of passed componentname and perform a hash lookup
  for the exact one.
  
  Sample data from buildworld probed on cache_purge_negative extended
  to count both scanned and evicted entries on each call are below.
  At most it has to evict 1.
  
evicted
 value  - Distribution - count
-1 | 0
 0 |@@@  19506
 1 |@5820
 2 |@@   7751
 4 |@6506
 8 |@5996
16 |@@@  4029
32 |@1489
64 | 193
   128 | 109
   256 | 56
   512 | 16
  1024 | 7
  2048 | 3
  4096 | 1
  8192 | 1
 16384 | 0
  
scanned
 value  - Distribution - count
-1 | 0
 0 |@@   2456
 1 |@1496
 2 |@@   2728
 4 |@@@  4171
 8 | 5122
16 | 5335
32 |@6279
64 | 5671
   128 | 4558
   256 |@@   3123
   512 |@@   2790
  1024 |@@   2449
  2048 |@@   3021
  4096 |@1398
  8192 |@886
 16384 | 0

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Thu Aug 20 10:05:46 2020(r364419)
+++ head/sys/kern/vfs_cache.c   Thu Aug 20 10:06:50 2020(r364420)
@@ -2351,9 +2351,13 @@ cache_rename(struct vnode *fdvp, struct vnode *fvp, st
ASSERT_VOP_IN_SEQC(tvp);
 
cache_purge(fvp);
-   if (tvp != NULL)
+   if (tvp != NULL) {
cache_purge(tvp);
-   cache_purge_negative(tdvp);
+   KASSERT(!cache_remove_cnp(tdvp, tcnp),
+   ("%s: lingering negative entry", __func__));
+   } else {
+   cache_remove_cnp(tdvp, tcnp);
+   }
 }
 
 /*
___
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: r364418 - head/sys/kern

2020-08-20 Thread Mateusz Guzik
Author: mjg
Date: Thu Aug 20 10:05:19 2020
New Revision: 364418
URL: https://svnweb.freebsd.org/changeset/base/364418

Log:
  cache: reimplement cache_lookup_nomakeentry as cache_remove_cnp
  
  This in particular removes unused arguments.

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Thu Aug 20 05:18:08 2020(r364417)
+++ head/sys/kern/vfs_cache.c   Thu Aug 20 10:05:19 2020(r364418)
@@ -97,6 +97,10 @@ SDT_PROBE_DEFINE2(vfs, namecache, lookup, hit__negativ
 "struct vnode *", "char *");
 SDT_PROBE_DEFINE2(vfs, namecache, lookup, miss, "struct vnode *",
 "char *");
+SDT_PROBE_DEFINE2(vfs, namecache, removecnp, hit, "struct vnode *",
+"struct componentname *");
+SDT_PROBE_DEFINE2(vfs, namecache, removecnp, miss, "struct vnode *",
+"struct componentname *");
 SDT_PROBE_DEFINE1(vfs, namecache, purge, done, "struct vnode *");
 SDT_PROBE_DEFINE1(vfs, namecache, purge_negative, done, "struct vnode *");
 SDT_PROBE_DEFINE1(vfs, namecache, purgevfs, done, "struct mount *");
@@ -1306,8 +1310,7 @@ cache_lookup_dot(struct vnode *dvp, struct vnode **vpp
 }
 
 static __noinline int
-cache_lookup_nomakeentry(struct vnode *dvp, struct vnode **vpp,
-struct componentname *cnp, struct timespec *tsp, int *ticksp)
+cache_remove_cnp(struct vnode *dvp, struct componentname *cnp)
 {
struct namecache *ncp;
struct rwlock *blp;
@@ -1317,18 +1320,16 @@ cache_lookup_nomakeentry(struct vnode *dvp, struct vno
 
if (cnp->cn_namelen == 2 &&
cnp->cn_nameptr[0] == '.' && cnp->cn_nameptr[1] == '.') {
-   counter_u64_add(dotdothits, 1);
dvlp = VP2VNODELOCK(dvp);
dvlp2 = NULL;
mtx_lock(dvlp);
 retry_dotdot:
ncp = dvp->v_cache_dd;
if (ncp == NULL) {
-   SDT_PROBE3(vfs, namecache, lookup, miss, dvp,
-   "..", NULL);
mtx_unlock(dvlp);
if (dvlp2 != NULL)
mtx_unlock(dvlp2);
+   SDT_PROBE2(vfs, namecache, removecnp, miss, dvp, cnp);
return (0);
}
if ((ncp->nc_flag & NCF_ISDOTDOT) != 0) {
@@ -1350,7 +1351,8 @@ retry_dotdot:
if (dvlp2 != NULL)
mtx_unlock(dvlp2);
}
-   return (0);
+   SDT_PROBE2(vfs, namecache, removecnp, hit, dvp, cnp);
+   return (1);
}
 
hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp);
@@ -1381,9 +1383,10 @@ retry:
}
counter_u64_add(numposzaps, 1);
cache_free(ncp);
-   return (0);
+   SDT_PROBE2(vfs, namecache, removecnp, hit, dvp, cnp);
+   return (1);
 out_no_entry:
-   SDT_PROBE3(vfs, namecache, lookup, miss, dvp, cnp->cn_nameptr, NULL);
+   SDT_PROBE2(vfs, namecache, removecnp, miss, dvp, cnp);
counter_u64_add(nummisszap, 1);
return (0);
 }
@@ -1448,8 +1451,10 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, st
if (__predict_false(cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.'))
return (cache_lookup_dot(dvp, vpp, cnp, tsp, ticksp));
 
-   if ((cnp->cn_flags & MAKEENTRY) == 0)
-   return (cache_lookup_nomakeentry(dvp, vpp, cnp, tsp, ticksp));
+   if ((cnp->cn_flags & MAKEENTRY) == 0) {
+   cache_remove_cnp(dvp, cnp);
+   return (0);
+   }
 
try_smr = true;
if (cnp->cn_nameiop == CREATE)
___
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: r364419 - in head/sys: fs/tmpfs kern sys ufs/ufs

2020-08-20 Thread Mateusz Guzik
Author: mjg
Date: Thu Aug 20 10:05:46 2020
New Revision: 364419
URL: https://svnweb.freebsd.org/changeset/base/364419

Log:
  cache: add cache_rename, a dedicated helper to use for renames
  
  While here make both tmpfs and ufs use it.
  
  No fuctional changes.

Modified:
  head/sys/fs/tmpfs/tmpfs_vnops.c
  head/sys/kern/vfs_cache.c
  head/sys/sys/vnode.h
  head/sys/ufs/ufs/ufs_vnops.c

Modified: head/sys/fs/tmpfs/tmpfs_vnops.c
==
--- head/sys/fs/tmpfs/tmpfs_vnops.c Thu Aug 20 10:05:19 2020
(r364418)
+++ head/sys/fs/tmpfs/tmpfs_vnops.c Thu Aug 20 10:05:46 2020
(r364419)
@@ -1144,10 +1144,7 @@ tmpfs_rename(struct vop_rename_args *v)
tmpfs_dir_attach(tdvp, de);
 
if (tmpfs_use_nc(fvp)) {
-   cache_purge(fvp);
-   if (tvp != NULL)
-   cache_purge(tvp);
-   cache_purge_negative(tdvp);
+   cache_rename(fdvp, fvp, tdvp, tvp, fcnp, tcnp);
}
 
error = 0;

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Thu Aug 20 10:05:19 2020(r364418)
+++ head/sys/kern/vfs_cache.c   Thu Aug 20 10:05:46 2020(r364419)
@@ -2339,6 +2339,23 @@ cache_purge_negative(struct vnode *vp)
}
 }
 
+void
+cache_rename(struct vnode *fdvp, struct vnode *fvp, struct vnode *tdvp,
+struct vnode *tvp, struct componentname *fcnp, struct componentname *tcnp)
+{
+
+   ASSERT_VOP_IN_SEQC(fdvp);
+   ASSERT_VOP_IN_SEQC(fvp);
+   ASSERT_VOP_IN_SEQC(tdvp);
+   if (tvp != NULL)
+   ASSERT_VOP_IN_SEQC(tvp);
+
+   cache_purge(fvp);
+   if (tvp != NULL)
+   cache_purge(tvp);
+   cache_purge_negative(tdvp);
+}
+
 /*
  * Flush all entries referencing a particular filesystem.
  */

Modified: head/sys/sys/vnode.h
==
--- head/sys/sys/vnode.hThu Aug 20 10:05:19 2020(r364418)
+++ head/sys/sys/vnode.hThu Aug 20 10:05:46 2020(r364419)
@@ -642,6 +642,8 @@ voidcache_vnode_init(struct vnode *vp);
 void   cache_purge(struct vnode *vp);
 void   cache_purge_vgone(struct vnode *vp);
 void   cache_purge_negative(struct vnode *vp);
+void   cache_rename(struct vnode *fdvp, struct vnode *fvp, struct vnode *tdvp,
+struct vnode *tvp, struct componentname *fcnp, struct componentname *tcnp);
 void   cache_purgevfs(struct mount *mp, bool force);
 intchange_dir(struct vnode *vp, struct thread *td);
 void   cvtstat(struct stat *st, struct ostat *ost);

Modified: head/sys/ufs/ufs/ufs_vnops.c
==
--- head/sys/ufs/ufs/ufs_vnops.cThu Aug 20 10:05:19 2020
(r364418)
+++ head/sys/ufs/ufs/ufs_vnops.cThu Aug 20 10:05:46 2020
(r364419)
@@ -1629,10 +1629,7 @@ relock:
 * name that references the old i-node if it has other links
 * or open file descriptors.
 */
-   cache_purge(fvp);
-   if (tvp)
-   cache_purge(tvp);
-   cache_purge_negative(tdvp);
+   cache_rename(fdvp, fvp, tdvp, tvp, fcnp, tcnp);
 
 unlockout:
if (want_seqc_end) {
___
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"