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

2019-10-12 Thread Scott Long
Author: scottl
Date: Sun Oct 13 05:11:53 2019
New Revision: 353462
URL: https://svnweb.freebsd.org/changeset/base/353462

Log:
  Fix the botched field ordering in the last commit.  While here, fix
  whitespace, and also reorder the fields so they are easier to read on
  an 80 column display (the lines wrapped even before these changes).
  Also fix non-standard nomenclature in the Caps code, and update the
  man page.
  
  Reported by:  rpokala

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

Modified: head/usr.sbin/pciconf/cap.c
==
--- head/usr.sbin/pciconf/cap.c Sun Oct 13 04:25:16 2019(r353461)
+++ head/usr.sbin/pciconf/cap.c Sun Oct 13 05:11:53 2019(r353462)
@@ -371,9 +371,12 @@ static void
 cap_subvendor(int fd, struct pci_conf *p, uint8_t ptr)
 {
uint32_t id;
+   uint16_t ssid, ssvid;
 
id = read_config(fd, >pc_sel, ptr + PCIR_SUBVENDCAP_ID, 4);
-   printf("PCI Bridge card=0x%08x", id);
+   ssid = id >> 16;
+   ssvid = id & 0x;
+   printf("PCI Bridge subvendor=0x%04x subdevice=0x%04x", ssvid, ssid);
 }
 
 #defineMAX_PAYLOAD(field)  (128 << (field))

Modified: head/usr.sbin/pciconf/pciconf.8
==
--- head/usr.sbin/pciconf/pciconf.8 Sun Oct 13 04:25:16 2019
(r353461)
+++ head/usr.sbin/pciconf/pciconf.8 Sun Oct 13 05:11:53 2019
(r353462)
@@ -60,16 +60,16 @@ option,
 .Nm
 lists PCI devices in the following format:
 .Bd -literal
-foo0@pci0:0:4:0: class=0x01 card=0x chip=0x000f1000 rev=0x01 \
-hdr=0x00
-bar0@pci0:0:5:0: class=0x000100 card=0x chip=0x88c15333 rev=0x00 \
-hdr=0x00
-none0@pci0:0:6:0: class=0x02 card=0x chip=0x802910ec rev=0x00 \
-hdr=0x00
+foo0@pci0:0:4:0: class=0x01 rev=0x01 hdr=0x00 vendor=0x1000 device=0x000f \
+subvendor=0x subdevice=0x
+bar0@pci0:0:5:0: class=0x000100 rev=0x00 hdr=0x00 vendor=0x88c1 device=0x5333 \
+subvendor=0x subdevice=0x
+none0@pci0:0:6:0: class=0x02 rev=0x00 hdr=0x00 vendor=0x10ec device=0x8029 
\
+subvendor=0x subdevice=0x
 .Ed
 .Pp
 The first column gives the
-driver name, unit number, and selector .
+driver name, unit number, and selector.
 If there is no driver attached to the
 .Tn PCI
 device in question, the driver name will be
@@ -80,21 +80,10 @@ The selector
 is in a form which may directly be used for the other forms of the command.
 The second column is the class code, with the class byte printed as two
 hex digits, followed by the sub-class and the interface bytes.
-The third column gives the contents of the subvendorid register, introduced
-in revision 2.1 of the
-.Tn PCI
-standard.
-Note that it will be 0 for older cards.
-The field consists of the card ID in the upper
-half and the card vendor ID in the lower half of the value.
+The third column prints the device's revision.
+The fourth column describes the header type.
 .Pp
-The fourth column contains the chip device ID, which identifies the chip
-this card is based on.
-It consists of two fields, identifying the chip and
-its vendor, as above.
-The fifth column prints the chip's revision.
-The sixth column describes the header type.
-Currently assigned header types include 0 for most devices,
+Currently assigned header types include 0 for standard devices,
 1 for
 .Tn PCI
 to
@@ -112,6 +101,14 @@ device, it is a
 .Em multi-function
 device, which contains several (similar or independent) functions on
 one chip.
+.Pp
+The sixth and seventh columns contain the vendor ID and the device ID of the
+device.
+The eigth and ninth columns contain subvendor and subdevice IDs, introduced
+in revision 2.1 of the
+.Tn PCI
+standard.
+Note that they will be 0 for older cards.
 .Pp
 If the
 .Fl B

Modified: head/usr.sbin/pciconf/pciconf.c
==
--- head/usr.sbin/pciconf/pciconf.c Sun Oct 13 04:25:16 2019
(r353461)
+++ head/usr.sbin/pciconf/pciconf.c Sun Oct 13 05:11:53 2019
(r353462)
@@ -261,8 +261,10 @@ list_devs(const char *name, int verbose, int bars, int
return;
}
for (p = conf; p < [pc.num_matches]; p++) {
-   printf("%s%d@pci%d:%d:%d:%d:\tclass=0x%06x 
subvendor=0x%04x subdevice=0x%04x "
-   "vendor=0x%04x device=0x%04x rev=0x%02x 
hdr=0x%02x\n",
+   printf("%s%d@pci%d:%d:%d:%d:"
+   "\tclass=0x%06x rev=0x%02x hdr=0x%02x "
+   "vendor=0x%04x device=0x%04x "
+   "subvendor=0x%04x subdevice=0x%04x\n",
*p->pd_name ? p->pd_name :
"none",
*p->pd_name ? (int)p->pd_unit :
@@ -270,9 

svn commit: r353461 - head/sys/netinet6

2019-10-12 Thread Gleb Smirnoff
Author: glebius
Date: Sun Oct 13 04:25:16 2019
New Revision: 353461
URL: https://svnweb.freebsd.org/changeset/base/353461

Log:
  Don't cover in6_ifattach() with network epoch, as it may call into
  network drivers ioctls, that may sleep.
  
  PR:   241223

Modified:
  head/sys/netinet6/in6.c
  head/sys/netinet6/in6_ifattach.c
  head/sys/netinet6/nd6.c

Modified: head/sys/netinet6/in6.c
==
--- head/sys/netinet6/in6.c Sun Oct 13 00:08:17 2019(r353460)
+++ head/sys/netinet6/in6.c Sun Oct 13 04:25:16 2019(r353461)
@@ -1930,12 +1930,12 @@ in6_if_up(struct ifnet *ifp)
arc4random() % (MAX_RTR_SOLICITATION_DELAY * hz));
}
}
+   NET_EPOCH_EXIT(et);
 
/*
 * special cases, like 6to4, are handled in in6_ifattach
 */
in6_ifattach(ifp, NULL);
-   NET_EPOCH_EXIT(et);
 }
 
 int

Modified: head/sys/netinet6/in6_ifattach.c
==
--- head/sys/netinet6/in6_ifattach.cSun Oct 13 00:08:17 2019
(r353460)
+++ head/sys/netinet6/in6_ifattach.cSun Oct 13 04:25:16 2019
(r353461)
@@ -423,6 +423,7 @@ in6_ifattach_linklocal(struct ifnet *ifp, struct ifnet
struct in6_ifaddr *ia;
struct in6_aliasreq ifra;
struct nd_prefixctl pr0;
+   struct epoch_tracker et;
struct nd_prefix *pr;
int error;
 
@@ -437,7 +438,10 @@ in6_ifattach_linklocal(struct ifnet *ifp, struct ifnet
ifra.ifra_addr.sin6_addr.s6_addr32[2] = 0;
ifra.ifra_addr.sin6_addr.s6_addr32[3] = htonl(1);
} else {
-   if (get_ifid(ifp, altifp, _addr.sin6_addr) != 0) {
+   NET_EPOCH_ENTER(et);
+   error = get_ifid(ifp, altifp, _addr.sin6_addr);
+   NET_EPOCH_EXIT(et);
+   if (error != 0) {
nd6log((LOG_ERR,
"%s: no ifid available\n", if_name(ifp)));
return (-1);
@@ -472,7 +476,9 @@ in6_ifattach_linklocal(struct ifnet *ifp, struct ifnet
return (-1);
}
 
+   NET_EPOCH_ENTER(et);
ia = in6ifa_ifpforlinklocal(ifp, 0);
+   NET_EPOCH_EXIT(et);
if (ia == NULL) {
/*
 * Another thread removed the address that we just added.
@@ -667,8 +673,6 @@ in6_ifattach(struct ifnet *ifp, struct ifnet *altifp)
 {
struct in6_ifaddr *ia;
 
-   NET_EPOCH_ASSERT();
-
if (ifp->if_afdata[AF_INET6] == NULL)
return;
/*
@@ -718,7 +722,11 @@ in6_ifattach(struct ifnet *ifp, struct ifnet *altifp)
 */
if (!(ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) &&
ND_IFINFO(ifp)->flags & ND6_IFF_AUTO_LINKLOCAL) {
+   struct epoch_tracker et;
+
+   NET_EPOCH_ENTER(et);
ia = in6ifa_ifpforlinklocal(ifp, 0);
+   NET_EPOCH_EXIT(et);
if (ia == NULL)
in6_ifattach_linklocal(ifp, altifp);
else

Modified: head/sys/netinet6/nd6.c
==
--- head/sys/netinet6/nd6.c Sun Oct 13 00:08:17 2019(r353460)
+++ head/sys/netinet6/nd6.c Sun Oct 13 04:25:16 2019(r353461)
@@ -1691,7 +1691,6 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
struct ifaddr *ifa;
struct in6_ifaddr *ia;
 
-   NET_EPOCH_ENTER(et);
if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) &&
!(ND.flags & ND6_IFF_IFDISABLED)) {
/* ifdisabled 1->0 transision */
@@ -1702,6 +1701,7 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
 * do not clear ND6_IFF_IFDISABLED.
 * See RFC 4862, Section 5.4.5.
 */
+   NET_EPOCH_ENTER(et);
CK_STAILQ_FOREACH(ifa, >if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
@@ -1710,6 +1710,7 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
IN6_IS_ADDR_LINKLOCAL(IA6_IN6(ia)))
break;
}
+   NET_EPOCH_EXIT(et);
 
if (ifa != NULL) {
/* LLA is duplicated. */
@@ -1730,6 +1731,7 @@ nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp)
ND_IFINFO(ifp)->flags |= ND6_IFF_IFDISABLED;
if (V_ip6_dad_count > 0 &&
(ND_IFINFO(ifp)->flags & ND6_IFF_NO_DAD) == 0) {
+   NET_EPOCH_ENTER(et);
   

Re: svn commit: r353456 - head/usr.sbin/pciconf

2019-10-12 Thread Scott Long


> On Oct 12, 2019, at 7:10 PM, Rodney W. Grimes  
> wrote:
> 
>> Author: scottl
>> Date: Sat Oct 12 22:27:57 2019
>> New Revision: 353456
>> URL: https://svnweb.freebsd.org/changeset/base/353456
>> 
>> Log:
>>  Change from the non-standard nomenclature of "chip" and "card" to the
>>  standard nomenclature of "device" and "vendor" with the "sub" variants.
>>  This changes the printed format, so anything that scrapes and parses
>>  this will need to be adapted.  No compatibility shims are provided,
>>  but this will not be MFC'd.
> 
> I can not "adapt" google easily, seaching for these strings are
> often very usefull in finding stuff like bug reports and ohers
> with similiar issues.  I am not sure the gain of this is positive
> over the loss of that.

It’s never too early to change bad habits =-)

Every time I write a driver, or even just evaluate an existing driver against 
new hardware (which happens frequently for me now, you should have been at my 
talk yesterday), I stumble over the non-standard nomenclature.  It doesn’t 
match the published spec, it doesn’t match the kernel API, and it doesn’t match 
any other OS.  John, Warner, and I have been talking about this for at least 10 
years, and it was time to rip off the band-aid and just do it.

Scott

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


Re: svn commit: r353456 - head/usr.sbin/pciconf

2019-10-12 Thread Rodney W. Grimes
> Author: scottl
> Date: Sat Oct 12 22:27:57 2019
> New Revision: 353456
> URL: https://svnweb.freebsd.org/changeset/base/353456
> 
> Log:
>   Change from the non-standard nomenclature of "chip" and "card" to the
>   standard nomenclature of "device" and "vendor" with the "sub" variants.
>   This changes the printed format, so anything that scrapes and parses
>   this will need to be adapted.  No compatibility shims are provided,
>   but this will not be MFC'd.

I can not "adapt" google easily, seaching for these strings are
often very usefull in finding stuff like bug reports and ohers
with similiar issues.  I am not sure the gain of this is positive
over the loss of that.

>   
>   Reviewed by:jhb, emaste, gtetlow
>   Approved by:jhb, emaste, gtetlow
> 
> Modified:
>   head/usr.sbin/pciconf/pciconf.c
> 
> Modified: head/usr.sbin/pciconf/pciconf.c
> ==
> --- head/usr.sbin/pciconf/pciconf.c   Sat Oct 12 20:53:40 2019
> (r353455)
> +++ head/usr.sbin/pciconf/pciconf.c   Sat Oct 12 22:27:57 2019
> (r353456)
> @@ -261,8 +261,8 @@ list_devs(const char *name, int verbose, int bars, int
>   return;
>   }
>   for (p = conf; p < [pc.num_matches]; p++) {
> - printf("%s%d@pci%d:%d:%d:%d:\tclass=0x%06x card=0x%08x "
> - "chip=0x%08x rev=0x%02x hdr=0x%02x\n",
> + printf("%s%d@pci%d:%d:%d:%d:\tclass=0x%06x 
> subvendor=0x%04x subdevice=0x%04x "
> + "vendor=0x%04x device=0x%04x rev=0x%02x 
> hdr=0x%02x\n",
>   *p->pd_name ? p->pd_name :
>   "none",
>   *p->pd_name ? (int)p->pd_unit :
> @@ -270,8 +270,8 @@ list_devs(const char *name, int verbose, int bars, int
>   p->pc_sel.pc_bus, p->pc_sel.pc_dev,
>   p->pc_sel.pc_func, (p->pc_class << 16) |
>   (p->pc_subclass << 8) | p->pc_progif,
> - (p->pc_subdevice << 16) | p->pc_subvendor,
> - (p->pc_device << 16) | p->pc_vendor,
> + p->pc_subdevice, p->pc_subvendor,
> + p->pc_device,  p->pc_vendor,
>   p->pc_revid, p->pc_hdr);
>   if (verbose)
>   list_verbose(p);
> 

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


svn commit: r353460 - head/sys/netpfil/pf

2019-10-12 Thread Mark Johnston
Author: markj
Date: Sun Oct 13 00:08:17 2019
New Revision: 353460
URL: https://svnweb.freebsd.org/changeset/base/353460

Log:
  Fix the build after r353458.
  
  MFC with: r353458
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/netpfil/pf/pf.c

Modified: head/sys/netpfil/pf/pf.c
==
--- head/sys/netpfil/pf/pf.cSat Oct 12 23:16:17 2019(r353459)
+++ head/sys/netpfil/pf/pf.cSun Oct 13 00:08:17 2019(r353460)
@@ -103,6 +103,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #endif /* INET6 */
 
+#ifdef SCTP
+#include 
+#endif
+
 #include 
 #include 
 
@@ -5589,7 +5593,7 @@ pf_route(struct mbuf **m, struct pf_rule *r, int dir, 
}
 #ifdef SCTP
if (m0->m_pkthdr.csum_flags & CSUM_SCTP & ~ifp->if_hwassist) {
-   sctp_delayed_cksum(m, (uint32_t)(ip->ip_hl << 2));
+   sctp_delayed_cksum(m0, (uint32_t)(ip->ip_hl << 2));
m0->m_pkthdr.csum_flags &= ~CSUM_SCTP;
}
 #endif
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r352707 - in head/sys: conf kern net sys

2019-10-12 Thread Warner Losh
I talked to Gleb and this will move to opt_global.h. this will fix all
these problems.

Warner

On Thu, Sep 26, 2019, 2:08 PM Cy Schubert  wrote:

> In message <6f50f518-0f8e-4e82-a9e9-b9db14cdb...@www.fastmail.com>, "Josh
> Paetz
> el" writes:
> >
> >
> > On Thu, Sep 26, 2019, at 12:34 PM, Warner Losh wrote:
> > > Kinda my point exactly...
> > >
> > > Warner
> > >
> > > On Thu, Sep 26, 2019 at 11:25 AM Ryan Stone  wrote:
> > >> We also shouldn't have ifdef's that change the size of a kernel
> > >>  structure that's part of the KBI. Isn't struct epoch_tracker part of
> > >>  the KBI?
> > >>
> > >>  On Thu, Sep 26, 2019 at 12:46 PM Warner Losh  wrote:
> > >>  >
> > >>  > But we shouldn't be including opt_foo.h files in sys/*.h files.
> That's
> > the root cause of trouble here.
> > >>  >
> > >>  > Warner
> > >>  >
> > >>  > On Thu, Sep 26, 2019 at 9:11 AM Niclas Zeising <
> zeis...@freebsd.org> wr
> > ote:
> > >>  >>
> > >>  >> On 2019-09-26 17:03, Charlie Li via freebsd-x11 wrote:
> > >>  >> > Kyle Evans wrote:
> > >>  >> >> On Thu, Sep 26, 2019 at 9:49 AM Charlie Li wrote:
> > >>  >> >>> This breaks building the drm-kmod ports, as the build cannot
> find
> > >>  >> >>> opt_epoch.h (drm-devel-kmod example shown, drm-current-kmod
> dies t
> > he
> > >>  >> >>> exact same way):
> > >>  >> >>>
> > >>  >> >>> --- linux_anon_inodes.o ---
> > >>  >> >>> cc -O2 -pipe -fno-strict-aliasing -include
> > >>  >> >>>
> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/dr
> > ivers/gpu/drm/drm_os_config.h
> > >>  >> >>> '-DKBUILD_MODNAME="linuxkpi_gplv2"' -Werror -D_KERNEL
> -DKLD_MODULE
> > >>  >> >>> -nostdinc
> > >>  >> >>>
> -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/
> > include
> -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/lin
> > uxkpi/dummy/include
> > >>  >> >>>
> -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/
> > linuxkpi/gplv2/include
> > >>  >> >>> -I/usr/src/sys/compat/linuxkpi/common/include -I.
> -I/usr/src/sys
> > >>  >> >>> -I/usr/src/sys/contrib/ck/include -fno-common
> -fno-omit-frame-poin
> > ter
> > >>  >> >>> -mno-omit-leaf-frame-pointer
> > >>  >> >>> -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include
> > >>  >> >>> -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -MD
> > >>  >> >>> -MF.depend.linux_anon_inodes.o -MTlinux_anon_inodes.o
> -mcmodel=ker
> > nel
> > >>  >> >>> -mno-red-zone -mno-mmx -mno-sse -msoft-float
> > >>  >> >>> -fno-asynchronous-unwind-tables -ffreestanding -fwrapv
> -fstack-pro
> > tector
> > >>  >> >>> -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes
> > >>  >> >>> -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef
> > >>  >> >>> -Wno-pointer-sign -D__printf__=__freebsd_kprintf__
> > >>  >> >>> -Wmissing-include-dirs -fdiagnostics-show-option
> -Wno-unknown-prag
> > mas
> > >>  >> >>> -Wno-error-tautological-compare -Wno-error-empty-body
> > >>  >> >>> -Wno-error-parentheses-equality -Wno-error-unused-function
> > >>  >> >>> -Wno-error-pointer-sign -Wno-error-shift-negative-value
> > >>  >> >>> -Wno-address-of-packed-member -Wno-format-zero-length
> -Wno-pointer
> > -arith
> > >>  >> >>> -mno-aes -mno-avx -std=iso9899:1999 -c
> > >>  >> >>>
> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/li
> > nuxkpi/gplv2/src/linux_anon_inodes.c
> > >>  >> >>> -o linux_anon_inodes.o
> > >>  >> >>> In file included from
> > >>  >> >>>
> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/li
> > nuxkpi/gplv2/src/linux_anon_inodes.c:12:
> > >>  >> >>> In file included from
> > >>  >> >>>
> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/li
> > nuxkpi/gplv2/include/linux/anon_inodes.h:4:
> > >>  >> >>> In file included from
> > >>  >> >>>
> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/li
> > nuxkpi/gplv2/include/linux/fs.h:6:
> > >>  >> >>> In file included from
> > >>  >> >>>
> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/li
> > nuxkpi/gplv2/include/linux/shrinker.h:5:
> > >>  >> >>> In file included from
> > >>  >> >>> /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56:
> > >>  >> >>> In file included from /usr/src/sys/net/if_var.h:83:
> > >>  >> >>> /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h'
> file no
> > t found
> > >>  >> >>> #include "opt_epoch.h"
> > >>  >> >>> ^
> > >>  >> >>> --- linux_anon_inodefs.o ---
> > >>  >> >>> In file included from
> > >>  >> >>>
> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/li
> > nuxkpi/gplv2/src/linux_anon_inodefs.c:45:
> > >>  >> >>> In file included from
> > >>  >> >>>
> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/li
> > nuxkpi/gplv2/include/linux/debugfs.h:18:
> > >>  >> >>> In file included from
> > >>  >> >>>
> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/li
> > nuxkpi/gplv2/include/linux/fs.h:6:
> > >>  >> >>> In file included from
> > >>  >> >>>
> 

Re: svn commit: r346017 - in head: libexec/rc libexec/rc/rc.d share/man/man5

2019-10-12 Thread Rodney W. Grimes
> On 09/04/2019 20:59, Chris Rees wrote:
> > On 9 April 2019 20:55:07 BST, "Rodney W. Grimes" 
> >  wrote:
> >>> On 09/04/2019 21:33, Rodney W. Grimes wrote:
>  I think the trigger issue is:
>  grep zfs /etc/rc.d/zvol
>  rcvar="zfs_enable"
>  required_modules="zfs"
> 
>  that module requires may be going south with the
>  new code when the module is built into the kernel.
> >>> Maybe it's because the module's name is zfsctrl (for whatever reason)
> >> while the
> >>> module file is named zfs.ko.
> >> I suspect that could also lead to issues with the new code.
> >> It seems to be failing to detect that zfs is infact functional in the
> >> kernel,
> >> and blindly, or not so blindly, trying to load zfs,ko, which when you
> >> build
> >> it into the kernel you usually do so without any modules built, so
> >> there is
> >> no /boot/kernel/zfs.ko, and even if you did build it any attempt to
> >> load
> >> it would return an error.
> > Loading with it built in isn't a problem, as I showed earlier.
> >
> > Loading when it doesn't exist *is*.
> >
> > I'm torn.  Either we could revert this, or add a check to the 
> > required_modules function instead, which I think is the better solution.
> 
> Hang on,
> 
> [crees@pegasus]~% sudo kldload -n zfsctrl && echo yes
> yes

I think your testing the return value of sudo here?

> [crees@pegasus]~% find /boot -name zfsctrl\*
> [crees@pegasus]~%
> 
> I think that, rather than speculating, we should wait for Oliver to 
> confirm that this is actually the problem, because I still don't think 
> it is.
> 
> Chris
> 
> 
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> 
> 

-- 
Rod Grimes rgri...@freebsd.org


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


Re: svn commit: r352707 - in head/sys: conf kern net sys

2019-10-12 Thread Josh Paetzel



On Thu, Sep 26, 2019, at 12:34 PM, Warner Losh wrote:
> Kinda my point exactly...
> 
> Warner
> 
> On Thu, Sep 26, 2019 at 11:25 AM Ryan Stone  wrote:
>> We also shouldn't have ifdef's that change the size of a kernel
>>  structure that's part of the KBI. Isn't struct epoch_tracker part of
>>  the KBI?
>> 
>>  On Thu, Sep 26, 2019 at 12:46 PM Warner Losh  wrote:
>>  >
>>  > But we shouldn't be including opt_foo.h files in sys/*.h files. That's 
>> the root cause of trouble here.
>>  >
>>  > Warner
>>  >
>>  > On Thu, Sep 26, 2019 at 9:11 AM Niclas Zeising  
>> wrote:
>>  >>
>>  >> On 2019-09-26 17:03, Charlie Li via freebsd-x11 wrote:
>>  >> > Kyle Evans wrote:
>>  >> >> On Thu, Sep 26, 2019 at 9:49 AM Charlie Li wrote:
>>  >> >>> This breaks building the drm-kmod ports, as the build cannot find
>>  >> >>> opt_epoch.h (drm-devel-kmod example shown, drm-current-kmod dies the
>>  >> >>> exact same way):
>>  >> >>>
>>  >> >>> --- linux_anon_inodes.o ---
>>  >> >>> cc -O2 -pipe -fno-strict-aliasing -include
>>  >> >>> 
>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/drivers/gpu/drm/drm_os_config.h
>>  >> >>> '-DKBUILD_MODNAME="linuxkpi_gplv2"' -Werror -D_KERNEL -DKLD_MODULE
>>  >> >>> -nostdinc
>>  >> >>> 
>> -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/include 
>> -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/dummy/include
>>  >> >>> 
>> -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include
>>  >> >>> -I/usr/src/sys/compat/linuxkpi/common/include -I. -I/usr/src/sys
>>  >> >>> -I/usr/src/sys/contrib/ck/include -fno-common -fno-omit-frame-pointer
>>  >> >>> -mno-omit-leaf-frame-pointer
>>  >> >>> -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include
>>  >> >>> -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -MD
>>  >> >>> -MF.depend.linux_anon_inodes.o -MTlinux_anon_inodes.o -mcmodel=kernel
>>  >> >>> -mno-red-zone -mno-mmx -mno-sse -msoft-float
>>  >> >>> -fno-asynchronous-unwind-tables -ffreestanding -fwrapv 
>> -fstack-protector
>>  >> >>> -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes
>>  >> >>> -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef
>>  >> >>> -Wno-pointer-sign -D__printf__=__freebsd_kprintf__
>>  >> >>> -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas
>>  >> >>> -Wno-error-tautological-compare -Wno-error-empty-body
>>  >> >>> -Wno-error-parentheses-equality -Wno-error-unused-function
>>  >> >>> -Wno-error-pointer-sign -Wno-error-shift-negative-value
>>  >> >>> -Wno-address-of-packed-member -Wno-format-zero-length 
>> -Wno-pointer-arith
>>  >> >>> -mno-aes -mno-avx -std=iso9899:1999 -c
>>  >> >>> 
>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c
>>  >> >>> -o linux_anon_inodes.o
>>  >> >>> In file included from
>>  >> >>> 
>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodes.c:12:
>>  >> >>> In file included from
>>  >> >>> 
>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/anon_inodes.h:4:
>>  >> >>> In file included from
>>  >> >>> 
>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6:
>>  >> >>> In file included from
>>  >> >>> 
>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5:
>>  >> >>> In file included from
>>  >> >>> /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56:
>>  >> >>> In file included from /usr/src/sys/net/if_var.h:83:
>>  >> >>> /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not 
>> found
>>  >> >>> #include "opt_epoch.h"
>>  >> >>> ^
>>  >> >>> --- linux_anon_inodefs.o ---
>>  >> >>> In file included from
>>  >> >>> 
>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/src/linux_anon_inodefs.c:45:
>>  >> >>> In file included from
>>  >> >>> 
>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/debugfs.h:18:
>>  >> >>> In file included from
>>  >> >>> 
>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/fs.h:6:
>>  >> >>> In file included from
>>  >> >>> 
>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/linuxkpi/gplv2/include/linux/shrinker.h:5:
>>  >> >>> In file included from
>>  >> >>> /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56:
>>  >> >>> In file included from /usr/src/sys/net/if_var.h:83:
>>  >> >>> /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file not 
>> found
>>  >> >>> #include "opt_epoch.h"
>>  >> >>> ^
>>  >> >>> --- linux_anon_inodes.o ---
>>  >> >>> 1 error generated.
>>  >> >>> *** [linux_anon_inodes.o] Error code 1
>>  >> >>>
>>  >> >>> make[2]: stopped in
>>  >> >>> 
>> 

Re: svn commit: r352707 - in head/sys: conf kern net sys

2019-10-12 Thread Cy Schubert
In message <6f50f518-0f8e-4e82-a9e9-b9db14cdb...@www.fastmail.com>, "Josh 
Paetz
el" writes:
>
>
> On Thu, Sep 26, 2019, at 12:34 PM, Warner Losh wrote:
> > Kinda my point exactly...
> > 
> > Warner
> > 
> > On Thu, Sep 26, 2019 at 11:25 AM Ryan Stone  wrote:
> >> We also shouldn't have ifdef's that change the size of a kernel
> >>  structure that's part of the KBI. Isn't struct epoch_tracker part of
> >>  the KBI?
> >> 
> >>  On Thu, Sep 26, 2019 at 12:46 PM Warner Losh  wrote:
> >>  >
> >>  > But we shouldn't be including opt_foo.h files in sys/*.h files. That's 
> the root cause of trouble here.
> >>  >
> >>  > Warner
> >>  >
> >>  > On Thu, Sep 26, 2019 at 9:11 AM Niclas Zeising  wr
> ote:
> >>  >>
> >>  >> On 2019-09-26 17:03, Charlie Li via freebsd-x11 wrote:
> >>  >> > Kyle Evans wrote:
> >>  >> >> On Thu, Sep 26, 2019 at 9:49 AM Charlie Li wrote:
> >>  >> >>> This breaks building the drm-kmod ports, as the build cannot find
> >>  >> >>> opt_epoch.h (drm-devel-kmod example shown, drm-current-kmod dies t
> he
> >>  >> >>> exact same way):
> >>  >> >>>
> >>  >> >>> --- linux_anon_inodes.o ---
> >>  >> >>> cc -O2 -pipe -fno-strict-aliasing -include
> >>  >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/dr
> ivers/gpu/drm/drm_os_config.h
> >>  >> >>> '-DKBUILD_MODNAME="linuxkpi_gplv2"' -Werror -D_KERNEL -DKLD_MODULE
> >>  >> >>> -nostdinc
> >>  >> >>> -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/
> include -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/lin
> uxkpi/dummy/include
> >>  >> >>> -I/wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/
> linuxkpi/gplv2/include
> >>  >> >>> -I/usr/src/sys/compat/linuxkpi/common/include -I. -I/usr/src/sys
> >>  >> >>> -I/usr/src/sys/contrib/ck/include -fno-common -fno-omit-frame-poin
> ter
> >>  >> >>> -mno-omit-leaf-frame-pointer
> >>  >> >>> -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include
> >>  >> >>> -fdebug-prefix-map=./x86=/usr/src/sys/x86/include -MD
> >>  >> >>> -MF.depend.linux_anon_inodes.o -MTlinux_anon_inodes.o -mcmodel=ker
> nel
> >>  >> >>> -mno-red-zone -mno-mmx -mno-sse -msoft-float
> >>  >> >>> -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-pro
> tector
> >>  >> >>> -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes
> >>  >> >>> -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef
> >>  >> >>> -Wno-pointer-sign -D__printf__=__freebsd_kprintf__
> >>  >> >>> -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-prag
> mas
> >>  >> >>> -Wno-error-tautological-compare -Wno-error-empty-body
> >>  >> >>> -Wno-error-parentheses-equality -Wno-error-unused-function
> >>  >> >>> -Wno-error-pointer-sign -Wno-error-shift-negative-value
> >>  >> >>> -Wno-address-of-packed-member -Wno-format-zero-length -Wno-pointer
> -arith
> >>  >> >>> -mno-aes -mno-avx -std=iso9899:1999 -c
> >>  >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/li
> nuxkpi/gplv2/src/linux_anon_inodes.c
> >>  >> >>> -o linux_anon_inodes.o
> >>  >> >>> In file included from
> >>  >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/li
> nuxkpi/gplv2/src/linux_anon_inodes.c:12:
> >>  >> >>> In file included from
> >>  >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/li
> nuxkpi/gplv2/include/linux/anon_inodes.h:4:
> >>  >> >>> In file included from
> >>  >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/li
> nuxkpi/gplv2/include/linux/fs.h:6:
> >>  >> >>> In file included from
> >>  >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/li
> nuxkpi/gplv2/include/linux/shrinker.h:5:
> >>  >> >>> In file included from
> >>  >> >>> /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56:
> >>  >> >>> In file included from /usr/src/sys/net/if_var.h:83:
> >>  >> >>> /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file no
> t found
> >>  >> >>> #include "opt_epoch.h"
> >>  >> >>> ^
> >>  >> >>> --- linux_anon_inodefs.o ---
> >>  >> >>> In file included from
> >>  >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/li
> nuxkpi/gplv2/src/linux_anon_inodefs.c:45:
> >>  >> >>> In file included from
> >>  >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/li
> nuxkpi/gplv2/include/linux/debugfs.h:18:
> >>  >> >>> In file included from
> >>  >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/li
> nuxkpi/gplv2/include/linux/fs.h:6:
> >>  >> >>> In file included from
> >>  >> >>> /wrkdirs/usr/ports/graphics/drm-devel-kmod/work/kms-drm-dc414a9/li
> nuxkpi/gplv2/include/linux/shrinker.h:5:
> >>  >> >>> In file included from
> >>  >> >>> /usr/src/sys/compat/linuxkpi/common/include/linux/list.h:56:
> >>  >> >>> In file included from /usr/src/sys/net/if_var.h:83:
> >>  >> >>> /usr/src/sys/sys/epoch.h:44:10: fatal error: 'opt_epoch.h' file no
> t found
> >>  >> >>> #include "opt_epoch.h"
> >>  >> >>> ^

Re: svn commit: r346017 - in head: libexec/rc libexec/rc/rc.d share/man/man5

2019-10-12 Thread Jilles Tjoelker
On Tue, Apr 09, 2019 at 10:24:16PM +0100, Chris Rees wrote:
> On 9 April 2019 22:13:29 BST, Chris Rees  wrote:
> >On 9 April 2019 22:08:35 BST, "Rodney W. Grimes"
> > wrote:
> >>> On 09/04/2019 20:59, Chris Rees wrote:
> >>> > On 9 April 2019 20:55:07 BST, "Rodney W. Grimes"
> >> wrote:
> >>> >>> On 09/04/2019 21:33, Rodney W. Grimes wrote:
> >>>  I think the trigger issue is:
> >>>  grep zfs /etc/rc.d/zvol
> >>>  rcvar="zfs_enable"
> >>>  required_modules="zfs"

> >>>  that module requires may be going south with the
> >>>  new code when the module is built into the kernel.
> >>> >>> Maybe it's because the module's name is zfsctrl (for whatever
> >>reason)
> >>> >> while the
> >>> >>> module file is named zfs.ko.
> >>> >> I suspect that could also lead to issues with the new code.
> >>> >> It seems to be failing to detect that zfs is infact functional in
> >>the
> >>> >> kernel,
> >>> >> and blindly, or not so blindly, trying to load zfs,ko, which when
> >>you
> >>> >> build
> >>> >> it into the kernel you usually do so without any modules built,
> >so
> >>> >> there is
> >>> >> no /boot/kernel/zfs.ko, and even if you did build it any attempt
> >>to
> >>> >> load
> >>> >> it would return an error.
> >>> > Loading with it built in isn't a problem, as I showed earlier.

> >>> > Loading when it doesn't exist *is*.

> >>> > I'm torn.  Either we could revert this, or add a check to the
> >>required_modules function instead, which I think is the better solution.

> >>> Hang on,

> >>> [crees@pegasus]~% sudo kldload -n zfsctrl && echo yes
> >>> yes

> >>I think your testing the return value of sudo here?

> >Sudo returns the child's return value.

> Turns out Oliver had also reported this to current@ with a log

> https://lists.freebsd.org/pipermail/freebsd-current/2019-April/073148.html

> Jilles@, mind if I revert this while I get some testing on this
> scenario done?

> It seems to me that zfs may not be included in the kernel, just
> zfsctrl, or something like that.

It seems like kldload -n does not work as expected for zfs, so reverting
seems the right approach.

-- 
Jilles Tjoelker


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


Re: svn commit: r346017 - in head: libexec/rc libexec/rc/rc.d share/man/man5

2019-10-12 Thread Chris Rees
Hi again,

On 9 April 2019 22:13:29 BST, Chris Rees  wrote:
>
>
>On 9 April 2019 22:08:35 BST, "Rodney W. Grimes"
> wrote:
>>> On 09/04/2019 20:59, Chris Rees wrote:
>>> > On 9 April 2019 20:55:07 BST, "Rodney W. Grimes"
>> wrote:
>>> >>> On 09/04/2019 21:33, Rodney W. Grimes wrote:
>>>  I think the trigger issue is:
>>>  grep zfs /etc/rc.d/zvol
>>>  rcvar="zfs_enable"
>>>  required_modules="zfs"
>>> 
>>>  that module requires may be going south with the
>>>  new code when the module is built into the kernel.
>>> >>> Maybe it's because the module's name is zfsctrl (for whatever
>>reason)
>>> >> while the
>>> >>> module file is named zfs.ko.
>>> >> I suspect that could also lead to issues with the new code.
>>> >> It seems to be failing to detect that zfs is infact functional in
>>the
>>> >> kernel,
>>> >> and blindly, or not so blindly, trying to load zfs,ko, which when
>>you
>>> >> build
>>> >> it into the kernel you usually do so without any modules built,
>so
>>> >> there is
>>> >> no /boot/kernel/zfs.ko, and even if you did build it any attempt
>>to
>>> >> load
>>> >> it would return an error.
>>> > Loading with it built in isn't a problem, as I showed earlier.
>>> >
>>> > Loading when it doesn't exist *is*.
>>> >
>>> > I'm torn.  Either we could revert this, or add a check to the
>>required_modules function instead, which I think is the better
>>solution.
>>> 
>>> Hang on,
>>> 
>>> [crees@pegasus]~% sudo kldload -n zfsctrl && echo yes
>>> yes
>>
>>I think your testing the return value of sudo here?
>
>Sudo returns the child's return value.
>

Turns out Oliver had also reported this to current@ with a log

https://lists.freebsd.org/pipermail/freebsd-current/2019-April/073148.html

Jilles@, mind if I revert this while I get some testing on this scenario done?

It seems to me that zfs may not be included in the kernel, just zfsctrl, or 
something like that.

Chris
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



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


Re: svn commit: r346017 - in head: libexec/rc libexec/rc/rc.d share/man/man5

2019-10-12 Thread Rodney W. Grimes
> On 9 April 2019 22:08:35 BST, "Rodney W. Grimes"  
> wrote:
> >> On 09/04/2019 20:59, Chris Rees wrote:
> >> > On 9 April 2019 20:55:07 BST, "Rodney W. Grimes"
> > wrote:
> >> >>> On 09/04/2019 21:33, Rodney W. Grimes wrote:
> >>  I think the trigger issue is:
> >>  grep zfs /etc/rc.d/zvol
> >>  rcvar="zfs_enable"
> >>  required_modules="zfs"
> >> 
> >>  that module requires may be going south with the
> >>  new code when the module is built into the kernel.
> >> >>> Maybe it's because the module's name is zfsctrl (for whatever
> >reason)
> >> >> while the
> >> >>> module file is named zfs.ko.
> >> >> I suspect that could also lead to issues with the new code.
> >> >> It seems to be failing to detect that zfs is infact functional in
> >the
> >> >> kernel,
> >> >> and blindly, or not so blindly, trying to load zfs,ko, which when
> >you
> >> >> build
> >> >> it into the kernel you usually do so without any modules built, so
> >> >> there is
> >> >> no /boot/kernel/zfs.ko, and even if you did build it any attempt
> >to
> >> >> load
> >> >> it would return an error.
> >> > Loading with it built in isn't a problem, as I showed earlier.
> >> >
> >> > Loading when it doesn't exist *is*.
> >> >
> >> > I'm torn.  Either we could revert this, or add a check to the
> >required_modules function instead, which I think is the better
> >solution.
> >> 
> >> Hang on,
> >> 
> >> [crees@pegasus]~% sudo kldload -n zfsctrl && echo yes
> >> yes
> >
> >I think your testing the return value of sudo here?
> 
> Sudo returns the child's return value.

Do you have a static linked zfs in your kernel
without a zfs.ko in /boot?

kldstat | grep zfs


> 
> Chris
> 
> >> [crees@pegasus]~% find /boot -name zfsctrl\*
find /boot -name zfs
the module file is called zfs.ko

> >> [crees@pegasus]~%
> >> 
> >> I think that, rather than speculating, we should wait for Oliver to 
> >> confirm that this is actually the problem, because I still don't
> >think 
> >> it is.
> >> 
> >> Chris
-- 
Rod Grimes rgri...@freebsd.org


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


svn commit: r353459 - head/sys/contrib/ncsw/user/env

2019-10-12 Thread Brandon Bergren
Author: bdragon
Date: Sat Oct 12 23:16:17 2019
New Revision: 353459
URL: https://svnweb.freebsd.org/changeset/base/353459

Log:
  Fix read past end of struct in ncsw glue code.
  
  The logic in XX_IsPortalIntr() was reading past the end of XX_PInfo.
  This was causing it to erroneously return 1 instead of 0 in some
  circumstances, causing a panic on the AmigaOne X5000 due to mixing
  exclusive and nonexclusive interrupts on the same interrupt line.
  
  Since this code is only called a couple of times during startup, use
  a simple double loop instead of the complex read-ahead single loop.
  
  This also fixes a bug where it would never check cpu=0 on type=1.
  
  Approved by: jhibbits (mentor)
  Differential Revision: https://reviews.freebsd.org/D21988

Modified:
  head/sys/contrib/ncsw/user/env/xx.c

Modified: head/sys/contrib/ncsw/user/env/xx.c
==
--- head/sys/contrib/ncsw/user/env/xx.c Sat Oct 12 23:01:16 2019
(r353458)
+++ head/sys/contrib/ncsw/user/env/xx.c Sat Oct 12 23:16:17 2019
(r353459)
@@ -288,16 +288,10 @@ XX_IsPortalIntr(uintptr_t irq)
 {
int cpu, type;
/* Check interrupt numbers of all available portals */
-   for (cpu = 0, type = 0; XX_PInfo.portal_intr[type][cpu] != 0; cpu++) {
-   if (irq == XX_PInfo.portal_intr[type][cpu]) {
-   /* Found it! */
-   return (1);
-   }
-   if (XX_PInfo.portal_intr[type][cpu + 1] == 0) {
-   type++;
-   cpu = 0;
-   }
-   }
+   for (type = 0; type < 2; type++)
+   for (cpu = 0; cpu < MAXCPU; cpu++)
+   if (irq == XX_PInfo.portal_intr[type][cpu])
+   return (1);
 
return (0);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r353458 - in head/sys: modules/pf netpfil/pf

2019-10-12 Thread Mark Johnston
Author: markj
Date: Sat Oct 12 23:01:16 2019
New Revision: 353458
URL: https://svnweb.freebsd.org/changeset/base/353458

Log:
  Add a missing include of opt_sctp.h.
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/modules/pf/Makefile
  head/sys/netpfil/pf/pf.c

Modified: head/sys/modules/pf/Makefile
==
--- head/sys/modules/pf/MakefileSat Oct 12 22:58:33 2019
(r353457)
+++ head/sys/modules/pf/MakefileSat Oct 12 23:01:16 2019
(r353458)
@@ -6,7 +6,7 @@ KMOD=   pf
 SRCS=  pf.c pf_if.c pf_lb.c pf_osfp.c pf_ioctl.c pf_norm.c pf_table.c \
pf_ruleset.c in4_cksum.c \
bus_if.h device_if.h \
-   opt_pf.h opt_inet.h opt_inet6.h opt_bpf.h opt_global.h
+   opt_pf.h opt_inet.h opt_inet6.h opt_bpf.h opt_sctp.h opt_global.h
 
 .if !defined(KERNBUILDDIR)
 # pflog can be loaded as a module, have the additional checks turned on

Modified: head/sys/netpfil/pf/pf.c
==
--- head/sys/netpfil/pf/pf.cSat Oct 12 22:58:33 2019(r353457)
+++ head/sys/netpfil/pf/pf.cSat Oct 12 23:01:16 2019(r353458)
@@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
 #include "opt_inet6.h"
 #include "opt_bpf.h"
 #include "opt_pf.h"
+#include "opt_sctp.h"
 
 #include 
 #include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r353457 - head/sys/netinet6

2019-10-12 Thread Mark Johnston
Author: markj
Date: Sat Oct 12 22:58:33 2019
New Revision: 353457
URL: https://svnweb.freebsd.org/changeset/base/353457

Log:
  Add a missing include of opt_sctp.h.
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/netinet6/ip6_forward.c

Modified: head/sys/netinet6/ip6_forward.c
==
--- head/sys/netinet6/ip6_forward.c Sat Oct 12 22:27:57 2019
(r353456)
+++ head/sys/netinet6/ip6_forward.c Sat Oct 12 22:58:33 2019
(r353457)
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
 #include "opt_inet6.h"
 #include "opt_ipsec.h"
 #include "opt_ipstealth.h"
+#include "opt_sctp.h"
 
 #include 
 #include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r353456 - head/usr.sbin/pciconf

2019-10-12 Thread Shawn Webb
On Sat, Oct 12, 2019 at 10:27:57PM +, Scott Long wrote:
> Author: scottl
> Date: Sat Oct 12 22:27:57 2019
> New Revision: 353456
> URL: https://svnweb.freebsd.org/changeset/base/353456
> 
> Log:
>   Change from the non-standard nomenclature of "chip" and "card" to the
>   standard nomenclature of "device" and "vendor" with the "sub" variants.
>   This changes the printed format, so anything that scrapes and parses
>   this will need to be adapted.  No compatibility shims are provided,
>   but this will not be MFC'd.
>   
>   Reviewed by:jhb, emaste, gtetlow
>   Approved by:jhb, emaste, gtetlow

Relnotes:   ?
RELNOTES:   ?
UPDATING:   ?

-- 
Shawn Webb
Cofounder / Security Engineer
HardenedBSD

Tor-ified Signal:+1 443-546-8752
Tor+XMPP+OTR:latt...@is.a.hacker.sx
GPG Key ID:  0xFF2E67A277F8E1FA
GPG Key Fingerprint: D206 BB45 15E0 9C49 0CF9  3633 C85B 0AF8 AB23 0FB2


signature.asc
Description: PGP signature


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

2019-10-12 Thread Scott Long
Author: scottl
Date: Sat Oct 12 22:27:57 2019
New Revision: 353456
URL: https://svnweb.freebsd.org/changeset/base/353456

Log:
  Change from the non-standard nomenclature of "chip" and "card" to the
  standard nomenclature of "device" and "vendor" with the "sub" variants.
  This changes the printed format, so anything that scrapes and parses
  this will need to be adapted.  No compatibility shims are provided,
  but this will not be MFC'd.
  
  Reviewed by:  jhb, emaste, gtetlow
  Approved by:  jhb, emaste, gtetlow

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

Modified: head/usr.sbin/pciconf/pciconf.c
==
--- head/usr.sbin/pciconf/pciconf.c Sat Oct 12 20:53:40 2019
(r353455)
+++ head/usr.sbin/pciconf/pciconf.c Sat Oct 12 22:27:57 2019
(r353456)
@@ -261,8 +261,8 @@ list_devs(const char *name, int verbose, int bars, int
return;
}
for (p = conf; p < [pc.num_matches]; p++) {
-   printf("%s%d@pci%d:%d:%d:%d:\tclass=0x%06x card=0x%08x "
-   "chip=0x%08x rev=0x%02x hdr=0x%02x\n",
+   printf("%s%d@pci%d:%d:%d:%d:\tclass=0x%06x 
subvendor=0x%04x subdevice=0x%04x "
+   "vendor=0x%04x device=0x%04x rev=0x%02x 
hdr=0x%02x\n",
*p->pd_name ? p->pd_name :
"none",
*p->pd_name ? (int)p->pd_unit :
@@ -270,8 +270,8 @@ list_devs(const char *name, int verbose, int bars, int
p->pc_sel.pc_bus, p->pc_sel.pc_dev,
p->pc_sel.pc_func, (p->pc_class << 16) |
(p->pc_subclass << 8) | p->pc_progif,
-   (p->pc_subdevice << 16) | p->pc_subvendor,
-   (p->pc_device << 16) | p->pc_vendor,
+   p->pc_subdevice, p->pc_subvendor,
+   p->pc_device,  p->pc_vendor,
p->pc_revid, p->pc_hdr);
if (verbose)
list_verbose(p);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r353455 - head/lib/csu/powerpc

2019-10-12 Thread Justin Hibbits
Author: jhibbits
Date: Sat Oct 12 20:53:40 2019
New Revision: 353455
URL: https://svnweb.freebsd.org/changeset/base/353455

Log:
  [PowerPC] force applications linked with lib CSU to have .got
  
  Summary:
  This forces applications linked with lib CSU to have a .got, fixing binaries
  linked with LLD9 after secure-plt was enabled on FreeBSD.
  
  Submitted by: Alfredo Dal'Ava Junior (alfredo.junior_eldorado.org.br)
  Differential Revision:https://reviews.freebsd.org/D21476

Modified:
  head/lib/csu/powerpc/crt1.c

Modified: head/lib/csu/powerpc/crt1.c
==
--- head/lib/csu/powerpc/crt1.c Sat Oct 12 19:03:07 2019(r353454)
+++ head/lib/csu/powerpc/crt1.c Sat Oct 12 20:53:40 2019(r353455)
@@ -102,3 +102,9 @@ __asm__(".text");
 __asm__("eprol:");
 __asm__(".previous");
 #endif
+
+#ifndef PIC
+__asm__(".text\n"
+   "\t.global _GLOBAL_OFFSET_TABLE_\n"
+   "\t.reloc 0, R_PPC_NONE, _GLOBAL_OFFSET_TABLE_");
+#endif
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r353454 - head/sys/kern

2019-10-12 Thread Alexander Motin
Author: mav
Date: Sat Oct 12 19:03:07 2019
New Revision: 353454
URL: https://svnweb.freebsd.org/changeset/base/353454

Log:
  Allocate device softc from the device domain.
  
  Since we are trying to bind device interrupt threads to the device domain,
  it should have sense to make memory often accessed by them local. If domain
  is not known, fall back to round-robin.
  
  MFC after:2 weeks
  Sponsored by: iXsystems, Inc.

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cSat Oct 12 18:18:11 2019(r353453)
+++ head/sys/kern/subr_bus.cSat Oct 12 19:03:07 2019(r353454)
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2541,7 +2542,7 @@ void
 device_set_softc(device_t dev, void *softc)
 {
if (dev->softc && !(dev->flags & DF_EXTERNALSOFTC))
-   free(dev->softc, M_BUS_SC);
+   free_domain(dev->softc, M_BUS_SC);
dev->softc = softc;
if (dev->softc)
dev->flags |= DF_EXTERNALSOFTC;
@@ -2558,7 +2559,7 @@ device_set_softc(device_t dev, void *softc)
 void
 device_free_softc(void *softc)
 {
-   free(softc, M_BUS_SC);
+   free_domain(softc, M_BUS_SC);
 }
 
 /**
@@ -2817,6 +2818,9 @@ device_is_devclass_fixed(device_t dev)
 int
 device_set_driver(device_t dev, driver_t *driver)
 {
+   int domain;
+   struct domainset *policy;
+
if (dev->state >= DS_ATTACHED)
return (EBUSY);
 
@@ -2824,7 +2828,7 @@ device_set_driver(device_t dev, driver_t *driver)
return (0);
 
if (dev->softc && !(dev->flags & DF_EXTERNALSOFTC)) {
-   free(dev->softc, M_BUS_SC);
+   free_domain(dev->softc, M_BUS_SC);
dev->softc = NULL;
}
device_set_desc(dev, NULL);
@@ -2833,8 +2837,12 @@ device_set_driver(device_t dev, driver_t *driver)
if (driver) {
kobj_init((kobj_t) dev, (kobj_class_t) driver);
if (!(dev->flags & DF_EXTERNALSOFTC) && driver->size > 0) {
-   dev->softc = malloc(driver->size, M_BUS_SC,
-   M_NOWAIT | M_ZERO);
+   if (bus_get_domain(dev, ) == 0)
+   policy = DOMAINSET_PREF(domain);
+   else
+   policy = DOMAINSET_RR();
+   dev->softc = malloc_domainset(driver->size, M_BUS_SC,
+   policy, M_NOWAIT | M_ZERO);
if (!dev->softc) {
kobj_delete((kobj_t) dev, NULL);
kobj_init((kobj_t) dev, _class);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r353292 - in head/sys: contrib/ipfilter/netinet dev/firewire dev/iicbus dev/usb/net kern net netgraph netinet netinet6 netipsec netpfil/ipfw netpfil/pf ofed/drivers/infiniband/ulp/ipoi

2019-10-12 Thread Kristof Provost

On 11 Oct 2019, at 16:29, Kristof Provost wrote:

On 7 Oct 2019, at 15:40, Gleb Smirnoff wrote:

Author: glebius
Date: Mon Oct  7 22:40:05 2019
New Revision: 353292
URL: https://svnweb.freebsd.org/changeset/base/353292

Log:
  Widen NET_EPOCH coverage.

  When epoch(9) was introduced to network stack, it was basically
  dropped in place of existing locking, which was mutexes and
  rwlocks. For the sake of performance mutex covered areas were
  as small as possible, so became epoch covered areas.

  However, epoch doesn't introduce any contention, it just delays
  memory reclaim. So, there is no point to minimise epoch covered
  areas in sense of performance. Meanwhile entering/exiting epoch
  also has non-zero CPU usage, so doing this less often is a win.

  Not the least is also code maintainability. In the new paradigm
  we can assume that at any stage of processing a packet, we are
  inside network epoch. This makes coding both input and output
  path way easier.

  On output path we already enter epoch quite early - in the
  ip_output(), in the ip6_output().

  This patch does the same for the input path. All ISR processing,
  network related callouts, other ways of packet injection to the
  network stack shall be performed in net_epoch. Any leaf function
  that walks network configuration now asserts epoch.

  Tricky part is configuration code paths - ioctls, sysctls. They
  also call into leaf functions, so some need to be changed.

  This patch would introduce more epoch recursions (see EPOCH_TRACE)
  than we had before. They will be cleaned up separately, as several
  of them aren't trivial. Note, that unlike a lock recursion the
  epoch recursion is safe and just wastes a bit of resources.

  Reviewed by:  gallatin, hselasky, cy, adrian, kristof
  Differential Revision:https://reviews.freebsd.org/D19111


This appears to have broken vlan.

To reproduce do:

sudo ifconfig epair create
sudo ifconfig vlan create vlandev epair0a vlan 42

I see the following panic:

	panic: Assertion in_epoch(net_epoch_preempt) failed at 
/usr/src/sys/net/if_vlan.c:1353

cpuid = 5
time = 1570828155
KDB: stack backtrace:
	db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 
0xfe0060d894c0

vpanic() at vpanic+0x17e/frame 0xfe0060d89520
panic() at panic+0x43/frame 0xfe0060d89580
vlan_config() at vlan_config+0x599/frame 0xfe0060d895c0
	vlan_clone_create() at vlan_clone_create+0x29b/frame 
0xfe0060d89630
	if_clone_createif() at if_clone_createif+0x4a/frame 
0xfe0060d89680

ifioctl() at ifioctl+0x6f4/frame 0xfe0060d89750
kern_ioctl() at kern_ioctl+0x295/frame 0xfe0060d897b0
sys_ioctl() at sys_ioctl+0x15c/frame 0xfe0060d89880
amd64_syscall() at amd64_syscall+0x2b5/frame 0xfe0060d899b0
	fast_syscall_common() at fast_syscall_common+0x101/frame 
0xfe0060d899b0
	--- syscall (54, FreeBSD ELF64, sys_ioctl), rip = 0x80047dc2a, rsp = 
0x7fffe1a8, rbp = 0x7fffe1b0 ---


I guess that we need to enter net_epoch in vlan_clone_create(). Or 
perhaps that’s something that’s generically needed and it should 
be done on if_clone_createif().


Alternatively, this test case seems to trigger a number of different 
issues (I’ve tried entering the epoch and removing the assertions and 
keep running into different issues):


diff --git a/tests/sys/net/Makefile b/tests/sys/net/Makefile
index 03e0631f625..bf8fb174e47 100644
--- a/tests/sys/net/Makefile
+++ b/tests/sys/net/Makefile
@@ -8,6 +8,7 @@ BINDIR= ${TESTSDIR}
 ATF_TESTS_SH+= if_lagg_test
 ATF_TESTS_SH+= if_clone_test
 ATF_TESTS_SH+= if_tun_test
+ATF_TESTS_SH+= if_vlan

	 # The tests are written to be run in parallel, but doing so leads to 
random
	 # panics.  I think it's because the kernel's list of interfaces isn't 
properly

diff --git a/tests/sys/net/if_vlan.sh b/tests/sys/net/if_vlan.sh
new file mode 100644
index 000..020ec59830f
--- /dev/null
+++ b/tests/sys/net/if_vlan.sh
@@ -0,0 +1,38 @@
+# $FreeBSD$
+
+. $(atf_get_srcdir)/../common/vnet.subr
+
+atf_test_case "basic" "cleanup"
+basic_head()
+{
+   atf_set descr 'Basic VLAN test'
+   atf_set require.user root
+}
+
+basic_body()
+{
+   vnet_init
+
+   epair_vlan=$(vnet_mkepair)
+
+   vnet_mkjail alcatraz ${epair_vlan}a
+   vnet_mkjail singsing ${epair_vlan}b
+
	+   vlan0=$(jexec alcatraz ifconfig vlan create vlandev 
${epair_vlan}a vlan 42)

+   jexec alcatraz ifconfig ${vlan0} 10.0.0.1/24 up
+
	+   vlan1=$(jexec singsing ifconfig vlan create vlandev 
${epair_vlan}b vlan 42)

+   jexec singsing ifconfig ${vlan1} 10.0.0.2/24 up
+
 

svn commit: r353453 - head/sys/riscv/riscv

2019-10-12 Thread Philip Paeps
Author: philip
Date: Sat Oct 12 18:18:11 2019
New Revision: 353453
URL: https://svnweb.freebsd.org/changeset/base/353453

Log:
  A comment in subr_devmap.c mentions that devmap_print_table() should
  be called on bootverbose.  Do so on RISV-V too.
  
  Submitted by: Nicholas O'Brien 
  Reviewed by:  imp, kp
  Sponsored by: Axiado
  Differential Revision:https://reviews.freebsd.org/D21998

Modified:
  head/sys/riscv/riscv/machdep.c

Modified: head/sys/riscv/riscv/machdep.c
==
--- head/sys/riscv/riscv/machdep.c  Sat Oct 12 17:57:03 2019
(r353452)
+++ head/sys/riscv/riscv/machdep.c  Sat Oct 12 18:18:11 2019
(r353453)
@@ -158,6 +158,8 @@ cpu_startup(void *dummy)
printf("avail memory = %ju (%ju MB)\n",
ptoa((uintmax_t)vm_free_count()),
ptoa((uintmax_t)vm_free_count()) / (1024 * 1024));
+   if (bootverbose)
+   devmap_print_table();
 
bufinit();
vm_pager_bufferinit();
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r353452 - head/sys/netinet

2019-10-12 Thread Michael Tuexen
Author: tuexen
Date: Sat Oct 12 17:57:03 2019
New Revision: 353452
URL: https://svnweb.freebsd.org/changeset/base/353452

Log:
  Ensure that local variables are reset to their initial value when
  dealing with error cases in a loop over all remote addresses.
  This issue was found and reported by OSS_Fuzz in:
  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18080
  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18086
  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18121
  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18163
  
  MFC after:3 days

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==
--- head/sys/netinet/sctp_output.c  Sat Oct 12 17:15:32 2019
(r353451)
+++ head/sys/netinet/sctp_output.c  Sat Oct 12 17:57:03 2019
(r353452)
@@ -7872,8 +7872,8 @@ sctp_med_chunk_output(struct sctp_inpcb *inp,
int bundle_at, ctl_cnt, no_data_chunks, eeor_mode;
unsigned int mtu, r_mtu, omtu, mx_mtu, to_out;
int tsns_sent = 0;
-   uint32_t auth_offset = 0;
-   struct sctp_auth_chunk *auth = NULL;
+   uint32_t auth_offset;
+   struct sctp_auth_chunk *auth;
uint16_t auth_keyid;
int override_ok = 1;
int skip_fill_up = 0;
@@ -8068,6 +8068,8 @@ again_one_more_time:
}
bundle_at = 0;
endoutchain = outchain = NULL;
+   auth = NULL;
+   auth_offset = 0;
no_fragmentflg = 1;
one_chunk = 0;
if (net->dest_state & SCTP_ADDR_UNCONFIRMED) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"