Re: svn commit: r333387 - head/usr.bin/svn

2018-05-08 Thread O. Hartmann
On Tue, 8 May 2018 21:01:05 + (UTC)
Peter Wemm  wrote:

> Author: peter
> Date: Tue May  8 21:01:04 2018
> New Revision: 87
> URL: https://svnweb.freebsd.org/changeset/base/87
> 
> Log:
>   Update svn_private_config.h - I misread an autoconf change.
>   SVN_LIBSVN_CLIENT_LINKS_RA_LOCAL -> SVN_LIBSVN_RA_LINKS_RA_LOCAL
>   SVN_LIBSVN_CLIENT_LINKS_RA_SERF -> SVN_LIBSVN_RA_LINKS_RA_SERF
>   SVN_LIBSVN_CLIENT_LINKS_RA_SVN -> SVN_LIBSVN_RA_LINKS_RA_SVN
> 
> Modified:
>   head/usr.bin/svn/svn_private_config.h
> 
> Modified: head/usr.bin/svn/svn_private_config.h
> ==
> --- head/usr.bin/svn/svn_private_config.h Tue May  8 20:39:35
> 2018  (r86) +++ head/usr.bin/svn/svn_private_config.h Tue
> May  8 21:01:04 2018  (r87) @@ -154,6 +154,9 @@
>  /* Defined if plaintext password/passphrase storage is disabled */
>  /* #undef SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE */
>  
> +/* Shared library file name suffix format */
> +#undef SVN_DSO_SUFFIX_FMT
> +
>  /* The desired major version for the Berkeley DB */
>  #define SVN_FS_WANT_DB_MAJOR 4
>  
> @@ -175,12 +178,18 @@
>  /* Is Mac OS KeyChain support enabled? */
>  /* #undef SVN_HAVE_KEYCHAIN_SERVICES */
>  
> +/* Defined if KF5 available */
> +#undef SVN_HAVE_KF5
> +
>  /* Defined if KWallet support is enabled */
>  /* #undef SVN_HAVE_KWALLET */
>  
>  /* Defined if libmagic support is enabled */
>  #define SVN_HAVE_LIBMAGIC 1
>  
> +/* Is libsecret support enabled? */
> +#undef SVN_HAVE_LIBSECRET
> +
>  /* Is Mach-O low-level _dyld API available? */
>  /* #undef SVN_HAVE_MACHO_ITERATE */
>  
> @@ -199,15 +208,6 @@
>  /* Defined if support for Serf is enabled */
>  #define SVN_HAVE_SERF 1
>  
> -/* Defined if libsvn_client should link against libsvn_ra_local */
> -#define SVN_LIBSVN_CLIENT_LINKS_RA_LOCAL 1
> -
> -/* Defined if libsvn_client should link against libsvn_ra_serf */
> -#define SVN_LIBSVN_CLIENT_LINKS_RA_SERF 1
> -
> -/* Defined if libsvn_client should link against libsvn_ra_svn */
> -#define SVN_LIBSVN_CLIENT_LINKS_RA_SVN 1
> -
>  /* Defined if libsvn_fs should link against libsvn_fs_base */
>  /* #undef SVN_LIBSVN_FS_LINKS_FS_BASE */
>  
> @@ -216,6 +216,15 @@
>  
>  /* Defined if libsvn_fs should link against libsvn_fs_x */
>  #define SVN_LIBSVN_FS_LINKS_FS_X 1
> +
> +/* Defined if libsvn_ra should link against libsvn_ra_local */
> +#define SVN_LIBSVN_RA_LINKS_RA_LOCAL 1
> +
> +/* Defined if libsvn_ra should link against libsvn_ra_serf */
> +#define SVN_LIBSVN_RA_LINKS_RA_SERF 1
> +
> +/* Defined if libsvn_ra should link against libsvn_ra_svn */
> +#define SVN_LIBSVN_RA_LINKS_RA_SVN 1
>  
>  /* Defined to be the path to the installed locale dirs */
>  #define SVN_LOCALE_DIR "NONE/share/locale"
> ___
> 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"

Hello.


On boxes where I updates CURRENT to the most recent version (as of today), and
where 

WITH_SVN= YES

is set in /etc/src.conf and 

SVN_UPDATE= YES
SVN=/usr/bin/svn
SVNFLAGS=   -r HEAD

is set in /etc/make.conf, I can not update /usr/ports any more and receive

Updating '.':
svn: E17: Unrecognized URL scheme for 'https://svn.freebsd.org/ports/head'

In /usr/src this weird behaviour doesn't happen.

Kind regards,
Oliver
___
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: r333394 - in head/sys/dev/cxgbe: . common firmware tom

2018-05-08 Thread Navdeep Parhar
Author: np
Date: Wed May  9 04:09:49 2018
New Revision: 94
URL: https://svnweb.freebsd.org/changeset/base/94

Log:
  cxgbe(4): Add support for hash filters.
  
  These filters reside in the card's memory instead of its TCAM and can be
  configured via a new "hashfilter" subcommand in cxgbetool.  Hash and
  normal TCAM filters can be used together.  The hardware does an
  exact-match of packet fields for hash filters, unlike the masked match
  performed for TCAM filters.  Any T5/T6 card with memory can support at
  least half a million hash filters.  The sample config file with the
  driver configures 512K of these, it is possible to double this to 1
  million+ in some cases.
  
  The chip does an exact-match of fields of incoming datagrams with hash
  filters and performs the action configured for the filter if it matches.
  The fields to match are specified in a "filter mask" in the firmware
  config file.  The filter mask always includes the 5-tuple (sip, dip,
  sport, dport, ipproto).  It can, optionally, also include any subset of
  the filter mode (see filterMode and filterMask in the firmware config
  file).
  
  For example:
  filterMode = fragmentation, mpshittype, protocol, vlan, port, fcoe
  filterMask = protocol, port, vlan
  
  Exact values of the 5-tuple, the physical port, and VLAN tag would have
  to be provided while setting up a hash filter with the chip
  configuration above.
  
  Hash filters support all actions supported by TCAM filters.  A packet
  that hits a hash filter can be dropped, let through (with optional
  steering to a specific queue or RSS region), switched out of another
  port (with optional L2 rewrite of DMAC, SMAC, VLAN tag), or get NAT'ed.
  (Support for some of these will show up in the driver in a follow-up
  commit very shortly).
  
  Sponsored by: Chelsio Communications

Added:
  head/sys/dev/cxgbe/firmware/t6fw_cfg_hashfilter.txt   (contents, props 
changed)
Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/common/common.h
  head/sys/dev/cxgbe/common/t4_msg.h
  head/sys/dev/cxgbe/offload.h
  head/sys/dev/cxgbe/t4_filter.c
  head/sys/dev/cxgbe/t4_ioctl.h
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_sge.c
  head/sys/dev/cxgbe/tom/t4_connect.c
  head/sys/dev/cxgbe/tom/t4_cpl_io.c

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hWed May  9 02:07:09 2018
(r93)
+++ head/sys/dev/cxgbe/adapter.hWed May  9 04:09:49 2018
(r94)
@@ -371,7 +371,7 @@ enum {
CPL_COOKIE_DDP0,
CPL_COOKIE_DDP1,
CPL_COOKIE_TOM,
-   CPL_COOKIE_AVAILABLE1,
+   CPL_COOKIE_HASHFILTER,
CPL_COOKIE_AVAILABLE2,
CPL_COOKIE_AVAILABLE3,
 
@@ -1244,6 +1244,9 @@ int get_filter(struct adapter *, struct t4_filter *);
 int set_filter(struct adapter *, struct t4_filter *);
 int del_filter(struct adapter *, struct t4_filter *);
 int t4_filter_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *);
+int t4_hashfilter_ao_rpl(struct sge_iq *, const struct rss_header *, struct 
mbuf *);
+int t4_hashfilter_tcb_rpl(struct sge_iq *, const struct rss_header *, struct 
mbuf *);
+int t4_del_hashfilter_rpl(struct sge_iq *, const struct rss_header *, struct 
mbuf *);
 
 static inline struct wrqe *
 alloc_wrqe(int wr_len, struct sge_wrq *wrq)

Modified: head/sys/dev/cxgbe/common/common.h
==
--- head/sys/dev/cxgbe/common/common.h  Wed May  9 02:07:09 2018
(r93)
+++ head/sys/dev/cxgbe/common/common.h  Wed May  9 04:09:49 2018
(r94)
@@ -370,6 +370,7 @@ struct adapter_params {
   resources for TOE operation. */
unsigned int bypass:1;  /* this is a bypass card */
unsigned int ethoffload:1;
+   unsigned int hash_filter:1;
 
unsigned int ofldq_wr_cred;
unsigned int eo_wr_cred;
@@ -456,6 +457,11 @@ static inline int is_offload(const struct adapter *ada
 static inline int is_ethoffload(const struct adapter *adap)
 {
return adap->params.ethoffload;
+}
+
+static inline int is_hashfilter(const struct adapter *adap)
+{
+   return adap->params.hash_filter;
 }
 
 static inline int chip_id(struct adapter *adap)

Modified: head/sys/dev/cxgbe/common/t4_msg.h
==
--- head/sys/dev/cxgbe/common/t4_msg.h  Wed May  9 02:07:09 2018
(r93)
+++ head/sys/dev/cxgbe/common/t4_msg.h  Wed May  9 04:09:49 2018
(r94)
@@ -197,6 +197,30 @@ static inline int act_open_has_tid(int status)
status != CPL_ERR_CONN_EXIST);
 }
 
+/*
+ * Convert an ACT_OPEN_RPL status to an errno.
+ */
+static inline int
+act_open_rpl_status_to_errno(int status)
+{
+
+   switch (status) {
+   case CPL_ERR_CONN_RESET:
+   return (ECONNREFUSED);
+   case 

svn commit: r333393 - head/sys/contrib/ipfilter/netinet

2018-05-08 Thread Cy Schubert
Author: cy
Date: Wed May  9 02:07:09 2018
New Revision: 93
URL: https://svnweb.freebsd.org/changeset/base/93

Log:
  Document intentional fallthrough. (CID 976535)
  
  MFC after:1 week

Modified:
  head/sys/contrib/ipfilter/netinet/fil.c

Modified: head/sys/contrib/ipfilter/netinet/fil.c
==
--- head/sys/contrib/ipfilter/netinet/fil.c Wed May  9 02:02:58 2018
(r92)
+++ head/sys/contrib/ipfilter/netinet/fil.c Wed May  9 02:07:09 2018
(r93)
@@ -1299,6 +1299,7 @@ ipf_pr_icmp(fin)
}
}
 #endif
+   /* fallthrough is intentional */
case ICMP_SOURCEQUENCH :
case ICMP_REDIRECT :
case ICMP_TIMXCEED :
___
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: r333391 - in head: . share/examples/drivers share/examples/etc share/examples/mdoc

2018-05-08 Thread Warner Losh
Author: imp
Date: Wed May  9 02:02:49 2018
New Revision: 91
URL: https://svnweb.freebsd.org/changeset/base/91

Log:
  Remove 'All Rights Reserved' from the collection copyright and templates.
  
  The original Berkeley Software Distributions were made in the 1980's
  and 1990's. At that time, the Buenos Ares Convention of 1910 was in
  force in most of the countries in the Americas. It required an
  affirmative statement of rights reservation, typically using 'All
  Rights Reserved.' The Regents included this phrase in their copyright
  notices to invoke this treaty to ensure maximal copyright protection.
  
  In the 1990's, Latin America coutries ratifeid the Berne Convention on
  copyrights which prohibited them from requiring an affirmative
  statement to reserve the rights. When Nicaragua ratified in 2000, the
  Buenos Ares Convention of 1910 was effectively repealed. This made all
  the 'All Rights Reserved' phrases obsolete and legal deadweight most
  of the time, and certainly in the cases removed here.
  
  Since it's no longer required, and is in fact meaningless, core has
  decided to dropped it from the project's collection copyright and
  sample templates. It encourages other rights holders to do the same
  after consultation with their legal department.
  
  More see https://en.wikipedia.org/wiki/Buenos_Aires_Convention for
  more information.
  
  Approved by: core@ (emaste@, jhb@)
  Differential Review:  https://reviews.freebsd.org/D15264

Modified:
  head/COPYRIGHT
  head/share/examples/drivers/make_device_driver.sh
  head/share/examples/drivers/make_pseudo_driver.sh
  head/share/examples/etc/bsd-style-copyright
  head/share/examples/mdoc/POSIX-copyright
  head/share/examples/mdoc/example.1
  head/share/examples/mdoc/example.3
  head/share/examples/mdoc/example.4
  head/share/examples/mdoc/example.9

Modified: head/COPYRIGHT
==
--- head/COPYRIGHT  Wed May  9 00:00:47 2018(r90)
+++ head/COPYRIGHT  Wed May  9 02:02:49 2018(r91)
@@ -4,7 +4,7 @@
 The compilation of software known as FreeBSD is distributed under the
 following terms:
 
-Copyright (c) 1992-2018 The FreeBSD Project. All rights reserved.
+Copyright (c) 1992-2018 The FreeBSD Project.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions

Modified: head/share/examples/drivers/make_device_driver.sh
==
--- head/share/examples/drivers/make_device_driver.sh   Wed May  9 00:00:47 
2018(r90)
+++ head/share/examples/drivers/make_device_driver.sh   Wed May  9 02:02:49 
2018(r91)
@@ -115,7 +115,6 @@ fi
 cat >${TOP}/dev/${1}/${1}.c <${TOP}/dev/${1}/${1}.c 

svn commit: r333392 - head/sys/contrib/ipfilter/netinet

2018-05-08 Thread Cy Schubert
Author: cy
Date: Wed May  9 02:02:58 2018
New Revision: 92
URL: https://svnweb.freebsd.org/changeset/base/92

Log:
  Fix memory leak. (CID 1199373).
  
  MFC after:1 week

Modified:
  head/sys/contrib/ipfilter/netinet/ip_dstlist.c

Modified: head/sys/contrib/ipfilter/netinet/ip_dstlist.c
==
--- head/sys/contrib/ipfilter/netinet/ip_dstlist.c  Wed May  9 02:02:49 
2018(r91)
+++ head/sys/contrib/ipfilter/netinet/ip_dstlist.c  Wed May  9 02:02:58 
2018(r92)
@@ -690,6 +690,7 @@ ipf_dstlist_node_del(softc, arg, op, uid)
err = COPYIN(op->iplo_struct, temp, size);
if (err != 0) {
IPFERROR(120027);
+   KFREES(temp, size);
return EFAULT;
}
 
___
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: r333345 - head/sys/dev/e1000

2018-05-08 Thread Mark Johnston
On Tue, May 08, 2018 at 04:37:52PM -0700, Matthew Macy wrote:
> Nix that. The panic is incorrect, we simply don't have anything to do
> in the default case.

Indeed, getting rid of the panic allows my workstation to boot.

> On Tue, May 8, 2018 at 4:31 PM, Matthew Macy  wrote:
> > Can you please try the attached patch? (Note that gmail may insert
> > carriage returns)
> >
> > -M
> >
> > On Tue, May 8, 2018 at 3:10 PM, Mark Johnston  wrote:
> >> On Tue, May 08, 2018 at 01:39:45AM +, Matt Macy wrote:
> >>> Author: mmacy
> >>> Date: Tue May  8 01:39:45 2018
> >>> New Revision: 45
> >>> URL: https://svnweb.freebsd.org/changeset/base/45
> >>>
> >>> Log:
> >>>   Sleep rather than spin in e1000 when doing long running config 
> >>> operations.
> >>>
> >>>   With r333218 it is now possible for drivers to use an sx lock and thus 
> >>> sleep while
> >>>   waiting on long running operations rather than DELAY().
> >>>
> >>>   Reported by:gallatin
> >>>   Reviewed by:sbruno
> >>>   Approved by:sbruno
> >>>   MFC after:  1 month
> >>>   Sponsored by:   Limelight Networks
> >>>   Differential Revision:  https://reviews.freebsd.org/D14984
> >>
> >> I'm getting a panic during boot with this change: "unknown mac type d".
> >>
> >> It occurs while the driver is attaching to:
> >>
> >> em0@pci0:1:0:0: class=0x02 card=0x7044103c chip=0x105e8086 rev=0x06 
> >> hdr=0x00
> >> vendor = 'Intel Corporation'
> >> device = '82571EB Gigabit Ethernet Controller'
> >> class  = network
> >> subclass   = ethernet

> diff --git a/sys/dev/e1000/e1000_82571.c b/sys/dev/e1000/e1000_82571.c
> index 57c47a5ebd6..348a3daa3c0 100644
> --- a/sys/dev/e1000/e1000_82571.c
> +++ b/sys/dev/e1000/e1000_82571.c
> @@ -1000,7 +1000,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
>   e1000_put_hw_semaphore_82574(hw);
>   break;
>   default:
> - panic("unknown mac type %x\n", hw->mac.type);
> + /* we didn't get the semaphore no need to put it */
>   break;
>   }
>  

___
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: r333390 - in head/sys: kern sys

2018-05-08 Thread Matt Macy
Author: mmacy
Date: Wed May  9 00:00:47 2018
New Revision: 90
URL: https://svnweb.freebsd.org/changeset/base/90

Log:
  Reduce overhead of ktrace checks in the common case.
  
  KTRPOINT() checks both if we are tracing _and_ if we are recursing within
  ktrace. The second condition is only ever executed if ktrace is actually
  enabled. This change moves the check out of the hot path in to the functions
  themselves.
  
  Discussed with mjg@
  
  Reported by:  mjg@
  Approved by:  sbruno@

Modified:
  head/sys/kern/kern_ktrace.c
  head/sys/sys/ktrace.h

Modified: head/sys/kern/kern_ktrace.c
==
--- head/sys/kern/kern_ktrace.c Tue May  8 23:13:11 2018(r89)
+++ head/sys/kern/kern_ktrace.c Wed May  9 00:00:47 2018(r90)
@@ -448,6 +448,9 @@ ktrsyscall(int code, int narg, register_t args[])
size_t buflen;
char *buf = NULL;
 
+   if (__predict_false(curthread->td_pflags & TDP_INKTRACE))
+   return;
+
buflen = sizeof(register_t) * narg;
if (buflen > 0) {
buf = malloc(buflen, M_KTRACE, M_WAITOK);
@@ -475,6 +478,9 @@ ktrsysret(int code, int error, register_t retval)
struct ktr_request *req;
struct ktr_sysret *ktp;
 
+   if (__predict_false(curthread->td_pflags & TDP_INKTRACE))
+   return;
+
req = ktr_getrequest(KTR_SYSRET);
if (req == NULL)
return;
@@ -729,6 +735,9 @@ ktrcsw(int out, int user, const char *wmesg)
struct ktr_request *req;
struct ktr_csw *kc;
 
+   if (__predict_false(curthread->td_pflags & TDP_INKTRACE))
+   return;
+
req = ktr_getrequest(KTR_CSW);
if (req == NULL)
return;
@@ -750,6 +759,9 @@ ktrstruct(const char *name, const void *data, size_t d
char *buf;
size_t buflen, namelen;
 
+   if (__predict_false(curthread->td_pflags & TDP_INKTRACE))
+   return;
+
if (data == NULL)
datalen = 0;
namelen = strlen(name) + 1;
@@ -776,6 +788,9 @@ ktrstructarray(const char *name, enum uio_seg seg, con
size_t buflen, datalen, namelen;
int max_items;
 
+   if (__predict_false(curthread->td_pflags & TDP_INKTRACE))
+   return;
+
/* Trim array length to genio size. */
max_items = ktr_geniosize / struct_size;
if (num_items > max_items) {
@@ -820,6 +835,9 @@ ktrcapfail(enum ktr_cap_fail_type type, const cap_righ
struct ktr_request *req;
struct ktr_cap_fail *kcf;
 
+   if (__predict_false(curthread->td_pflags & TDP_INKTRACE))
+   return;
+
req = ktr_getrequest(KTR_CAPFAIL);
if (req == NULL)
return;
@@ -844,6 +862,9 @@ ktrfault(vm_offset_t vaddr, int type)
struct ktr_request *req;
struct ktr_fault *kf;
 
+   if (__predict_false(curthread->td_pflags & TDP_INKTRACE))
+   return;
+
req = ktr_getrequest(KTR_FAULT);
if (req == NULL)
return;
@@ -860,6 +881,9 @@ ktrfaultend(int result)
struct thread *td = curthread;
struct ktr_request *req;
struct ktr_faultend *kf;
+
+   if (__predict_false(curthread->td_pflags & TDP_INKTRACE))
+   return;
 
req = ktr_getrequest(KTR_FAULTEND);
if (req == NULL)

Modified: head/sys/sys/ktrace.h
==
--- head/sys/sys/ktrace.h   Tue May  8 23:13:11 2018(r89)
+++ head/sys/sys/ktrace.h   Wed May  9 00:00:47 2018(r90)
@@ -70,8 +70,7 @@ struct ktr_header {
  * is the public interface.
  */
 #defineKTRCHECK(td, type)  ((td)->td_proc->p_traceflag & (1 << 
type))
-#define KTRPOINT(td, type) \
-   (KTRCHECK((td), (type)) && !((td)->td_pflags & TDP_INKTRACE))
+#define KTRPOINT(td, type)  (__predict_false(KTRCHECK((td), (type
 #defineKTRCHECKDRAIN(td)   (!(STAILQ_EMPTY(&(td)->td_proc->p_ktr)))
 #defineKTRUSERRET(td) do { 
\
if (KTRCHECKDRAIN(td))  \
___
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: r333345 - head/sys/dev/e1000

2018-05-08 Thread Mark Johnston
On Tue, May 8, 2018, 19:09 Matthew Macy,  wrote:

> Is the e1000 driver compiled in or loaded as a module?
>

It's compiled in to the kernel.


> On Tue, May 8, 2018 at 3:10 PM, Mark Johnston  wrote:
> > On Tue, May 08, 2018 at 01:39:45AM +, Matt Macy wrote:
> >> Author: mmacy
> >> Date: Tue May  8 01:39:45 2018
> >> New Revision: 45
> >> URL: https://svnweb.freebsd.org/changeset/base/45
> >>
> >> Log:
> >>   Sleep rather than spin in e1000 when doing long running config
> operations.
> >>
> >>   With r333218 it is now possible for drivers to use an sx lock and
> thus sleep while
> >>   waiting on long running operations rather than DELAY().
> >>
> >>   Reported by:gallatin
> >>   Reviewed by:sbruno
> >>   Approved by:sbruno
> >>   MFC after:  1 month
> >>   Sponsored by:   Limelight Networks
> >>   Differential Revision:  https://reviews.freebsd.org/D14984
> >
> > I'm getting a panic during boot with this change: "unknown mac type d".
> >
> > It occurs while the driver is attaching to:
> >
> > em0@pci0:1:0:0: class=0x02 card=0x7044103c chip=0x105e8086 rev=0x06
> hdr=0x00
> > vendor = 'Intel Corporation'
> > device = '82571EB Gigabit Ethernet Controller'
> > class  = network
> > subclass   = ethernet
>
___
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: r333345 - head/sys/dev/e1000

2018-05-08 Thread Matthew Macy
Nix that. The panic is incorrect, we simply don't have anything to do
in the default case.

On Tue, May 8, 2018 at 4:31 PM, Matthew Macy  wrote:
> Can you please try the attached patch? (Note that gmail may insert
> carriage returns)
>
> -M
>
> On Tue, May 8, 2018 at 3:10 PM, Mark Johnston  wrote:
>> On Tue, May 08, 2018 at 01:39:45AM +, Matt Macy wrote:
>>> Author: mmacy
>>> Date: Tue May  8 01:39:45 2018
>>> New Revision: 45
>>> URL: https://svnweb.freebsd.org/changeset/base/45
>>>
>>> Log:
>>>   Sleep rather than spin in e1000 when doing long running config operations.
>>>
>>>   With r333218 it is now possible for drivers to use an sx lock and thus 
>>> sleep while
>>>   waiting on long running operations rather than DELAY().
>>>
>>>   Reported by:gallatin
>>>   Reviewed by:sbruno
>>>   Approved by:sbruno
>>>   MFC after:  1 month
>>>   Sponsored by:   Limelight Networks
>>>   Differential Revision:  https://reviews.freebsd.org/D14984
>>
>> I'm getting a panic during boot with this change: "unknown mac type d".
>>
>> It occurs while the driver is attaching to:
>>
>> em0@pci0:1:0:0: class=0x02 card=0x7044103c chip=0x105e8086 rev=0x06 
>> hdr=0x00
>> vendor = 'Intel Corporation'
>> device = '82571EB Gigabit Ethernet Controller'
>> class  = network
>> subclass   = ethernet
diff --git a/sys/dev/e1000/e1000_82571.c b/sys/dev/e1000/e1000_82571.c
index 57c47a5ebd6..348a3daa3c0 100644
--- a/sys/dev/e1000/e1000_82571.c
+++ b/sys/dev/e1000/e1000_82571.c
@@ -1000,7 +1000,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
 			e1000_put_hw_semaphore_82574(hw);
 		break;
 	default:
-		panic("unknown mac type %x\n", hw->mac.type);
+		/* we didn't get the semaphore no need to put it */
 		break;
 	}
 
___
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: r333345 - head/sys/dev/e1000

2018-05-08 Thread Matthew Macy
Can you please try the attached patch? (Note that gmail may insert
carriage returns)

-M

On Tue, May 8, 2018 at 3:10 PM, Mark Johnston  wrote:
> On Tue, May 08, 2018 at 01:39:45AM +, Matt Macy wrote:
>> Author: mmacy
>> Date: Tue May  8 01:39:45 2018
>> New Revision: 45
>> URL: https://svnweb.freebsd.org/changeset/base/45
>>
>> Log:
>>   Sleep rather than spin in e1000 when doing long running config operations.
>>
>>   With r333218 it is now possible for drivers to use an sx lock and thus 
>> sleep while
>>   waiting on long running operations rather than DELAY().
>>
>>   Reported by:gallatin
>>   Reviewed by:sbruno
>>   Approved by:sbruno
>>   MFC after:  1 month
>>   Sponsored by:   Limelight Networks
>>   Differential Revision:  https://reviews.freebsd.org/D14984
>
> I'm getting a panic during boot with this change: "unknown mac type d".
>
> It occurs while the driver is attaching to:
>
> em0@pci0:1:0:0: class=0x02 card=0x7044103c chip=0x105e8086 rev=0x06 
> hdr=0x00
> vendor = 'Intel Corporation'
> device = '82571EB Gigabit Ethernet Controller'
> class  = network
> subclass   = ethernet
diff --git a/sys/dev/e1000/e1000_mac.c b/sys/dev/e1000/e1000_mac.c
index da7934f9fb6..79283cf3296 100644
--- a/sys/dev/e1000/e1000_mac.c
+++ b/sys/dev/e1000/e1000_mac.c
@@ -2196,7 +2196,6 @@ s32 e1000_get_hw_semaphore(struct e1000_hw *hw)
 	s32 i = 0;
 	
 	DEBUGFUNC("e1000_get_hw_semaphore");
-#ifdef notyet
 	/* _82571 */
 	/* If we have timedout 3 times on trying to acquire
 	 * the inter-port SMBI semaphore, there is old code
@@ -2208,7 +2207,6 @@ s32 e1000_get_hw_semaphore(struct e1000_hw *hw)
 	if (hw->dev_spec._82571.smb_counter > 2)
 		sw_timeout = 1;
 
-#endif
 	/* Get the SW semaphore */
 	while (i < timeout) {
 		swsm = E1000_READ_REG(hw, E1000_SWSM);
@@ -2220,7 +2218,7 @@ s32 e1000_get_hw_semaphore(struct e1000_hw *hw)
 	}
 
 	if (i == timeout) {
-#ifdef notyet
+
 		/*
 		 * XXX This sounds more like a driver bug whereby we either
 		 * recursed accidentally or missed clearing it previously
@@ -2239,7 +2237,6 @@ s32 e1000_get_hw_semaphore(struct e1000_hw *hw)
usec_delay(50);
}
}
-#endif
 
 		DEBUGOUT("Driver can't access device - SMBI bit is set.\n");
 		return -E1000_ERR_NVM;
___
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: r333389 - in head: crypto/openssh crypto/openssh/contrib crypto/openssh/contrib/aix crypto/openssh/contrib/redhat crypto/openssh/contrib/suse crypto/openssh/openbsd-compat crypto/openss...

2018-05-08 Thread Dag-Erling Smørgrav
Author: des
Date: Tue May  8 23:13:11 2018
New Revision: 89
URL: https://svnweb.freebsd.org/changeset/base/89

Log:
  Upgrade to OpenSSH 7.6p1.  This will be followed shortly by 7.7p1.
  
  This completely removes client-side support for the SSH 1 protocol,
  which was already disabled in 12 but is still enabled in 11.  For that
  reason, we will not be able to merge 7.6p1 or newer back to 11.

Added:
  head/crypto/openssh/.gitignore
 - copied unchanged from r333296, vendor-crypto/openssh/dist/.gitignore
  head/crypto/openssh/freebsd-namespace.sh   (contents, props changed)
  head/crypto/openssh/openbsd-compat/bsd-getpagesize.c
 - copied unchanged from r333296, 
vendor-crypto/openssh/dist/openbsd-compat/bsd-getpagesize.c
  head/crypto/openssh/openbsd-compat/bsd-malloc.c
 - copied unchanged from r333296, 
vendor-crypto/openssh/dist/openbsd-compat/bsd-malloc.c
  head/crypto/openssh/openbsd-compat/freezero.c
 - copied unchanged from r333296, 
vendor-crypto/openssh/dist/openbsd-compat/freezero.c
  head/crypto/openssh/openbsd-compat/recallocarray.c
 - copied unchanged from r333296, 
vendor-crypto/openssh/dist/openbsd-compat/recallocarray.c
  head/crypto/openssh/platform-misc.c
 - copied unchanged from r333296, vendor-crypto/openssh/dist/platform-misc.c
  head/crypto/openssh/regress/authinfo.sh
 - copied unchanged from r333296, 
vendor-crypto/openssh/dist/regress/authinfo.sh
  head/crypto/openssh/regress/misc/fuzz-harness/
 - copied from r333296, 
vendor-crypto/openssh/dist/regress/misc/fuzz-harness/
Deleted:
  head/crypto/openssh/cipher-3des1.c
  head/crypto/openssh/cipher-bf1.c
  head/crypto/openssh/deattack.c
  head/crypto/openssh/deattack.h
  head/crypto/openssh/md-sha256.c
  head/crypto/openssh/rsa.c
  head/crypto/openssh/rsa.h
  head/crypto/openssh/ssh1.h
  head/crypto/openssh/sshconnect1.c
Modified:
  head/crypto/openssh/.skipped-commit-ids
  head/crypto/openssh/ChangeLog
  head/crypto/openssh/FREEBSD-upgrade
  head/crypto/openssh/INSTALL
  head/crypto/openssh/LICENCE
  head/crypto/openssh/Makefile.in
  head/crypto/openssh/PROTOCOL
  head/crypto/openssh/PROTOCOL.agent
  head/crypto/openssh/PROTOCOL.certkeys
  head/crypto/openssh/README
  head/crypto/openssh/auth-options.c
  head/crypto/openssh/auth-options.h
  head/crypto/openssh/auth-pam.c
  head/crypto/openssh/auth.c
  head/crypto/openssh/auth.h
  head/crypto/openssh/auth2-chall.c
  head/crypto/openssh/auth2-gss.c
  head/crypto/openssh/auth2-hostbased.c
  head/crypto/openssh/auth2-kbdint.c
  head/crypto/openssh/auth2-none.c
  head/crypto/openssh/auth2-passwd.c
  head/crypto/openssh/auth2-pubkey.c
  head/crypto/openssh/auth2.c
  head/crypto/openssh/authfd.c
  head/crypto/openssh/authfd.h
  head/crypto/openssh/authfile.c
  head/crypto/openssh/bitmap.c
  head/crypto/openssh/bufbn.c
  head/crypto/openssh/buffer.h
  head/crypto/openssh/channels.c
  head/crypto/openssh/channels.h
  head/crypto/openssh/cipher.c
  head/crypto/openssh/cipher.h
  head/crypto/openssh/clientloop.c
  head/crypto/openssh/clientloop.h
  head/crypto/openssh/compat.c
  head/crypto/openssh/compat.h
  head/crypto/openssh/config.h
  head/crypto/openssh/configure.ac
  head/crypto/openssh/contrib/aix/README
  head/crypto/openssh/contrib/redhat/openssh.spec
  head/crypto/openssh/contrib/ssh-copy-id
  head/crypto/openssh/contrib/suse/openssh.spec
  head/crypto/openssh/defines.h
  head/crypto/openssh/digest-libc.c
  head/crypto/openssh/digest-openssl.c
  head/crypto/openssh/digest.h
  head/crypto/openssh/dispatch.c
  head/crypto/openssh/dispatch.h
  head/crypto/openssh/dns.c
  head/crypto/openssh/dns.h
  head/crypto/openssh/gss-serv.c
  head/crypto/openssh/hostfile.c
  head/crypto/openssh/includes.h
  head/crypto/openssh/kex.c
  head/crypto/openssh/kex.h
  head/crypto/openssh/kexc25519c.c
  head/crypto/openssh/kexc25519s.c
  head/crypto/openssh/kexdhc.c
  head/crypto/openssh/kexdhs.c
  head/crypto/openssh/kexecdhc.c
  head/crypto/openssh/kexecdhs.c
  head/crypto/openssh/kexgexc.c
  head/crypto/openssh/kexgexs.c
  head/crypto/openssh/key.c
  head/crypto/openssh/key.h
  head/crypto/openssh/krl.c
  head/crypto/openssh/log.c
  head/crypto/openssh/log.h
  head/crypto/openssh/mac.c
  head/crypto/openssh/misc.c
  head/crypto/openssh/misc.h
  head/crypto/openssh/monitor.c
  head/crypto/openssh/monitor_wrap.c
  head/crypto/openssh/monitor_wrap.h
  head/crypto/openssh/mux.c
  head/crypto/openssh/myproposal.h
  head/crypto/openssh/nchan.c
  head/crypto/openssh/opacket.c
  head/crypto/openssh/opacket.h
  head/crypto/openssh/openbsd-compat/Makefile.in
  head/crypto/openssh/openbsd-compat/bsd-err.c
  head/crypto/openssh/openbsd-compat/bsd-misc.c
  head/crypto/openssh/openbsd-compat/bsd-misc.h
  head/crypto/openssh/openbsd-compat/explicit_bzero.c
  head/crypto/openssh/openbsd-compat/fmt_scaled.c
  head/crypto/openssh/openbsd-compat/openbsd-compat.h
  head/crypto/openssh/openbsd-compat/port-tun.c
  head/crypto/openssh/openbsd-compat/port-tun.h
  

Re: svn commit: r333345 - head/sys/dev/e1000

2018-05-08 Thread Matthew Macy
Is the e1000 driver compiled in or loaded as a module?

-M


On Tue, May 8, 2018 at 3:10 PM, Mark Johnston  wrote:
> On Tue, May 08, 2018 at 01:39:45AM +, Matt Macy wrote:
>> Author: mmacy
>> Date: Tue May  8 01:39:45 2018
>> New Revision: 45
>> URL: https://svnweb.freebsd.org/changeset/base/45
>>
>> Log:
>>   Sleep rather than spin in e1000 when doing long running config operations.
>>
>>   With r333218 it is now possible for drivers to use an sx lock and thus 
>> sleep while
>>   waiting on long running operations rather than DELAY().
>>
>>   Reported by:gallatin
>>   Reviewed by:sbruno
>>   Approved by:sbruno
>>   MFC after:  1 month
>>   Sponsored by:   Limelight Networks
>>   Differential Revision:  https://reviews.freebsd.org/D14984
>
> I'm getting a panic during boot with this change: "unknown mac type d".
>
> It occurs while the driver is attaching to:
>
> em0@pci0:1:0:0: class=0x02 card=0x7044103c chip=0x105e8086 rev=0x06 
> hdr=0x00
> vendor = 'Intel Corporation'
> device = '82571EB Gigabit Ethernet Controller'
> class  = network
> subclass   = ethernet
___
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: r333345 - head/sys/dev/e1000

2018-05-08 Thread Mark Johnston
On Tue, May 08, 2018 at 01:39:45AM +, Matt Macy wrote:
> Author: mmacy
> Date: Tue May  8 01:39:45 2018
> New Revision: 45
> URL: https://svnweb.freebsd.org/changeset/base/45
> 
> Log:
>   Sleep rather than spin in e1000 when doing long running config operations.
>   
>   With r333218 it is now possible for drivers to use an sx lock and thus 
> sleep while
>   waiting on long running operations rather than DELAY().
>   
>   Reported by:gallatin
>   Reviewed by:sbruno
>   Approved by:sbruno
>   MFC after:  1 month
>   Sponsored by:   Limelight Networks
>   Differential Revision:  https://reviews.freebsd.org/D14984

I'm getting a panic during boot with this change: "unknown mac type d".

It occurs while the driver is attaching to:

em0@pci0:1:0:0: class=0x02 card=0x7044103c chip=0x105e8086 rev=0x06 hdr=0x00
vendor = 'Intel Corporation'
device = '82571EB Gigabit Ethernet Controller'
class  = network
subclass   = ethernet
___
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: r333388 - in head: . share/man/man4 sys/conf sys/dev/nxge sys/modules sys/modules/nxge tools/kerneldoc/subsys tools/tools tools/tools/nxge usr.sbin/bsdconfig/share

2018-05-08 Thread Sean Bruno
https://reviews.freebsd.org/D15292

*shakes fist at self*

sean

On 05/08/18 15:14, Sean Bruno wrote:
> Author: sbruno
> Date: Tue May  8 21:14:29 2018
> New Revision: 88
> URL: https://svnweb.freebsd.org/changeset/base/88
> 
> Log:
>   nxge(4):
>   Remove nxge(4) and associated man page and tools in FreeBSD 12.0.
>   
>   Submitted by:   kbowling
>   Reviewed by:brooks
>   Relnotes:   yes
>   Sponsored by:   Limelight Networks
>   Differential Revision:  https://reviews.freebsd.org/D1529
> 
> Deleted:
>   head/share/man/man4/nxge.4
>   head/sys/dev/nxge/
>   head/sys/modules/nxge/
>   head/tools/kerneldoc/subsys/Doxyfile-dev_nxge
>   head/tools/tools/nxge/
> Modified:
>   head/ObsoleteFiles.inc
>   head/UPDATING
>   head/share/man/man4/Makefile
>   head/share/man/man4/vlan.4
>   head/sys/conf/NOTES
>   head/sys/conf/files
>   head/sys/modules/Makefile
>   head/tools/tools/README
>   head/usr.sbin/bsdconfig/share/device.subr
> 
> Modified: head/ObsoleteFiles.inc
> ==
> --- head/ObsoleteFiles.incTue May  8 21:01:04 2018(r87)
> +++ head/ObsoleteFiles.incTue May  8 21:14:29 2018(r88)
> @@ -38,6 +38,9 @@
>  #   xargs -n1 | sort | uniq -d;
>  # done
>  
> +# 20180508: retire nxge
> +OLD_FILES+=usr/share/man/man4/if_nxge.4.gz
> +OLD_FILES+=usr/share/man/man4/nxge.4.gz
>  # 20180505: rhosts
>  OLD_FILES+=usr/share/skel/dot.rhosts
>  # 20180502: retire ixgb
> 
> Modified: head/UPDATING
> ==
> --- head/UPDATING Tue May  8 21:01:04 2018(r87)
> +++ head/UPDATING Tue May  8 21:14:29 2018(r88)
> @@ -51,6 +51,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
>  
>  ** SPECIAL WARNING: 
> **
>  
> +20180508:
> + The nxge(4) driver has been removed.  This driver was for PCI-X 10g
> + cards made by s2io/Neterion.  The company was aquired by Exar and
> + no longer sells or supports Ethernet products.  If you have device
> + nxge in your kernel config file it must be removed.
> +
>  20180504:
>   The tz database (tzdb) has been updated to 2018e.  This version more
>   correctly models time stamps in time zones with negative DST such as
> 
> Modified: head/share/man/man4/Makefile
> ==
> --- head/share/man/man4/Makefile  Tue May  8 21:01:04 2018
> (r87)
> +++ head/share/man/man4/Makefile  Tue May  8 21:14:29 2018
> (r88)
> @@ -397,7 +397,6 @@ MAN=  aac.4 \
>   ${_nvme.4} \
>   ${_nvram.4} \
>   ${_nvram2env.4} \
> - ${_nxge.4} \
>   oce.4 \
>   ocs_fc.4\
>   ohci.4 \
> @@ -706,7 +705,6 @@ MLINKS+=netintro.4 net.4 \
>   netintro.4 networking.4
>  MLINKS+=${_nfe.4} ${_if_nfe.4}
>  MLINKS+=nge.4 if_nge.4
> -MLINKS+=${_nxge.4} ${_if_nxge.4}
>  MLINKS+=ow.4 onewire.4
>  MLINKS+=pccbb.4 cbb.4
>  MLINKS+=pcm.4 snd.4 \
> @@ -823,7 +821,6 @@ _ichwd.4= ichwd.4
>  _if_bxe.4=   if_bxe.4
>  _if_ndis.4=  if_ndis.4
>  _if_nfe.4=   if_nfe.4
> -_if_nxge.4=  if_nxge.4
>  _if_urtw.4=  if_urtw.4
>  _if_vmx.4=   if_vmx.4
>  _if_vtnet.4= if_vtnet.4
> @@ -840,7 +837,6 @@ _nfsmb.4= nfsmb.4
>  _nvd.4=  nvd.4
>  _nvme.4= nvme.4
>  _nvram.4=nvram.4
> -_nxge.4= nxge.4
>  _virtio.4=   virtio.4
>  _virtio_balloon.4=virtio_balloon.4
>  _virtio_blk.4=   virtio_blk.4
> 
> Modified: head/share/man/man4/vlan.4
> ==
> --- head/share/man/man4/vlan.4Tue May  8 21:01:04 2018
> (r87)
> +++ head/share/man/man4/vlan.4Tue May  8 21:14:29 2018
> (r88)
> @@ -25,7 +25,7 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd August 28, 2017
> +.Dd May 8, 2018
>  .Dt VLAN 4
>  .Os
>  .Sh NAME
> @@ -137,7 +137,6 @@ in hardware:
>  .Xr liquidio 4 ,
>  .Xr msk 4 ,
>  .Xr mxge 4 ,
> -.Xr nxge 4 ,
>  .Xr nge 4 ,
>  .Xr re 4 ,
>  .Xr sge 4 ,
> 
> Modified: head/sys/conf/NOTES
> ==
> --- head/sys/conf/NOTES   Tue May  8 21:01:04 2018(r87)
> +++ head/sys/conf/NOTES   Tue May  8 21:14:29 2018(r88)
> @@ -2131,7 +2131,6 @@ device  ix  # Intel Pro/10Gbe PCIE 
> Ethernet
>  device   ixv # Intel Pro/10Gbe PCIE Et

svn commit: r333388 - in head: . share/man/man4 sys/conf sys/dev/nxge sys/modules sys/modules/nxge tools/kerneldoc/subsys tools/tools tools/tools/nxge usr.sbin/bsdconfig/share

2018-05-08 Thread Sean Bruno
Author: sbruno
Date: Tue May  8 21:14:29 2018
New Revision: 88
URL: https://svnweb.freebsd.org/changeset/base/88

Log:
  nxge(4):
  Remove nxge(4) and associated man page and tools in FreeBSD 12.0.
  
  Submitted by: kbowling
  Reviewed by:  brooks
  Relnotes: yes
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D1529

Deleted:
  head/share/man/man4/nxge.4
  head/sys/dev/nxge/
  head/sys/modules/nxge/
  head/tools/kerneldoc/subsys/Doxyfile-dev_nxge
  head/tools/tools/nxge/
Modified:
  head/ObsoleteFiles.inc
  head/UPDATING
  head/share/man/man4/Makefile
  head/share/man/man4/vlan.4
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/modules/Makefile
  head/tools/tools/README
  head/usr.sbin/bsdconfig/share/device.subr

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Tue May  8 21:01:04 2018(r87)
+++ head/ObsoleteFiles.inc  Tue May  8 21:14:29 2018(r88)
@@ -38,6 +38,9 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20180508: retire nxge
+OLD_FILES+=usr/share/man/man4/if_nxge.4.gz
+OLD_FILES+=usr/share/man/man4/nxge.4.gz
 # 20180505: rhosts
 OLD_FILES+=usr/share/skel/dot.rhosts
 # 20180502: retire ixgb

Modified: head/UPDATING
==
--- head/UPDATING   Tue May  8 21:01:04 2018(r87)
+++ head/UPDATING   Tue May  8 21:14:29 2018(r88)
@@ -51,6 +51,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
 
 ** SPECIAL WARNING: **
 
+20180508:
+   The nxge(4) driver has been removed.  This driver was for PCI-X 10g
+   cards made by s2io/Neterion.  The company was aquired by Exar and
+   no longer sells or supports Ethernet products.  If you have device
+   nxge in your kernel config file it must be removed.
+
 20180504:
The tz database (tzdb) has been updated to 2018e.  This version more
correctly models time stamps in time zones with negative DST such as

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileTue May  8 21:01:04 2018
(r87)
+++ head/share/man/man4/MakefileTue May  8 21:14:29 2018
(r88)
@@ -397,7 +397,6 @@ MAN=aac.4 \
${_nvme.4} \
${_nvram.4} \
${_nvram2env.4} \
-   ${_nxge.4} \
oce.4 \
ocs_fc.4\
ohci.4 \
@@ -706,7 +705,6 @@ MLINKS+=netintro.4 net.4 \
netintro.4 networking.4
 MLINKS+=${_nfe.4} ${_if_nfe.4}
 MLINKS+=nge.4 if_nge.4
-MLINKS+=${_nxge.4} ${_if_nxge.4}
 MLINKS+=ow.4 onewire.4
 MLINKS+=pccbb.4 cbb.4
 MLINKS+=pcm.4 snd.4 \
@@ -823,7 +821,6 @@ _ichwd.4=   ichwd.4
 _if_bxe.4= if_bxe.4
 _if_ndis.4=if_ndis.4
 _if_nfe.4= if_nfe.4
-_if_nxge.4=if_nxge.4
 _if_urtw.4=if_urtw.4
 _if_vmx.4= if_vmx.4
 _if_vtnet.4=   if_vtnet.4
@@ -840,7 +837,6 @@ _nfsmb.4=   nfsmb.4
 _nvd.4=nvd.4
 _nvme.4=   nvme.4
 _nvram.4=  nvram.4
-_nxge.4=   nxge.4
 _virtio.4= virtio.4
 _virtio_balloon.4=virtio_balloon.4
 _virtio_blk.4= virtio_blk.4

Modified: head/share/man/man4/vlan.4
==
--- head/share/man/man4/vlan.4  Tue May  8 21:01:04 2018(r87)
+++ head/share/man/man4/vlan.4  Tue May  8 21:14:29 2018(r88)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 28, 2017
+.Dd May 8, 2018
 .Dt VLAN 4
 .Os
 .Sh NAME
@@ -137,7 +137,6 @@ in hardware:
 .Xr liquidio 4 ,
 .Xr msk 4 ,
 .Xr mxge 4 ,
-.Xr nxge 4 ,
 .Xr nge 4 ,
 .Xr re 4 ,
 .Xr sge 4 ,

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Tue May  8 21:01:04 2018(r87)
+++ head/sys/conf/NOTES Tue May  8 21:14:29 2018(r88)
@@ -2131,7 +2131,6 @@ deviceix  # Intel Pro/10Gbe PCIE 
Ethernet
 device ixv # Intel Pro/10Gbe PCIE Ethernet VF
 device le  # AMD Am7900 LANCE and Am79C9xx PCnet
 device mxge# Myricom Myri-10G 10GbE NIC
-device nxge# Neterion Xframe 10GbE Server/Storage Adapter
 device oce # Emulex 10 GbE (OneConnect Ethernet)
 device ti  # Alteon Networks Tigon I/II gigabit Ethernet
 device txp # 3Com 3cR990 (``Typhoon'')

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue May  8 21:01:04 2018(r87)
+++ head/sys/conf/files Tue May  8 21:14:29 2018(r88)
@@ -2541,25 +2541,6 @@ dev/netmap/netmap_legacy.c   optional netmap
 # compile-with "${NORMAL_C} 

svn commit: r333387 - head/usr.bin/svn

2018-05-08 Thread Peter Wemm
Author: peter
Date: Tue May  8 21:01:04 2018
New Revision: 87
URL: https://svnweb.freebsd.org/changeset/base/87

Log:
  Update svn_private_config.h - I misread an autoconf change.
  SVN_LIBSVN_CLIENT_LINKS_RA_LOCAL -> SVN_LIBSVN_RA_LINKS_RA_LOCAL
  SVN_LIBSVN_CLIENT_LINKS_RA_SERF -> SVN_LIBSVN_RA_LINKS_RA_SERF
  SVN_LIBSVN_CLIENT_LINKS_RA_SVN -> SVN_LIBSVN_RA_LINKS_RA_SVN

Modified:
  head/usr.bin/svn/svn_private_config.h

Modified: head/usr.bin/svn/svn_private_config.h
==
--- head/usr.bin/svn/svn_private_config.h   Tue May  8 20:39:35 2018
(r86)
+++ head/usr.bin/svn/svn_private_config.h   Tue May  8 21:01:04 2018
(r87)
@@ -154,6 +154,9 @@
 /* Defined if plaintext password/passphrase storage is disabled */
 /* #undef SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE */
 
+/* Shared library file name suffix format */
+#undef SVN_DSO_SUFFIX_FMT
+
 /* The desired major version for the Berkeley DB */
 #define SVN_FS_WANT_DB_MAJOR 4
 
@@ -175,12 +178,18 @@
 /* Is Mac OS KeyChain support enabled? */
 /* #undef SVN_HAVE_KEYCHAIN_SERVICES */
 
+/* Defined if KF5 available */
+#undef SVN_HAVE_KF5
+
 /* Defined if KWallet support is enabled */
 /* #undef SVN_HAVE_KWALLET */
 
 /* Defined if libmagic support is enabled */
 #define SVN_HAVE_LIBMAGIC 1
 
+/* Is libsecret support enabled? */
+#undef SVN_HAVE_LIBSECRET
+
 /* Is Mach-O low-level _dyld API available? */
 /* #undef SVN_HAVE_MACHO_ITERATE */
 
@@ -199,15 +208,6 @@
 /* Defined if support for Serf is enabled */
 #define SVN_HAVE_SERF 1
 
-/* Defined if libsvn_client should link against libsvn_ra_local */
-#define SVN_LIBSVN_CLIENT_LINKS_RA_LOCAL 1
-
-/* Defined if libsvn_client should link against libsvn_ra_serf */
-#define SVN_LIBSVN_CLIENT_LINKS_RA_SERF 1
-
-/* Defined if libsvn_client should link against libsvn_ra_svn */
-#define SVN_LIBSVN_CLIENT_LINKS_RA_SVN 1
-
 /* Defined if libsvn_fs should link against libsvn_fs_base */
 /* #undef SVN_LIBSVN_FS_LINKS_FS_BASE */
 
@@ -216,6 +216,15 @@
 
 /* Defined if libsvn_fs should link against libsvn_fs_x */
 #define SVN_LIBSVN_FS_LINKS_FS_X 1
+
+/* Defined if libsvn_ra should link against libsvn_ra_local */
+#define SVN_LIBSVN_RA_LINKS_RA_LOCAL 1
+
+/* Defined if libsvn_ra should link against libsvn_ra_serf */
+#define SVN_LIBSVN_RA_LINKS_RA_SERF 1
+
+/* Defined if libsvn_ra should link against libsvn_ra_svn */
+#define SVN_LIBSVN_RA_LINKS_RA_SVN 1
 
 /* Defined to be the path to the installed locale dirs */
 #define SVN_LOCALE_DIR "NONE/share/locale"
___
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: r333351 - head/usr.bin/grep

2018-05-08 Thread Kyle Evans
On Tue, May 8, 2018 at 3:36 PM, Ronald Klop  wrote:
> On Tue, 08 May 2018 16:49:12 +0200, Alexey Dokuchaev 
> wrote:
>
>> On Tue, May 08, 2018 at 09:36:21AM -0500, Kyle Evans wrote:
>>>
>>> On Tue, May 8, 2018 at 5:58 AM, Alexey Dokuchaev 
>>> wrote:
>>> >>
>>> >> - if ((f = fopen(fn, "r")) == NULL)
>>> >> + if (strcmp(fn, "-") == 0)
>>> >> + f = stdin;
>>> >
>>> > This makes sense: when `fn' is "-", `f' is stdin.
>>> >
>>> >> - fclose(f);
>>> >> + if (strcmp(fn, "-") != 0)
>>> >> + fclose(f);
>>> >
>>> > But not this one: why are you checking `fn' again?  Shouldn't you
>>> > fclose(f) if it's not stdin?
>>> >
>>> > if (f != stdin)
>>> > fclose(f);
>>> >
>>>
>>> You say potato, I say potato. =) In this case, it's low overhead in a
>>> not particularly performance critical bit and drawing a connection
>>> between this and the opening of 'f' above in an extremely obvious way.
>>
>>
>> Well, I'm not worried about the overhead or performance issues, they are
>> negligible.  I just find second strcmp(fn, "-") to be semantically wrong
>> (and that's why you need implicit "there's only one way to get stdin here"
>> assert).  You assign `f' to stdin based on `fn' being "-", but you
>> fclose(f) when it's not stdin; the value of `fn' is irrelevant this time.
>> As a nice bonus, you only spell strcmp(fn, "-") once and do not need to
>> implicitly assert that there's only one way to get stdin here.
>>
>>> This also might get ripped out soon -- we'll see how things go.
>>
>>
>> I see, understood.
>>
>> ./danfe
>
>
> What is the result of "-f /dev/stdin"? Of does that fopen return a different
> filedesc?
>

Indeed- /dev/stdin will force it to open another filedesc and read
from stdin all the same.

Thanks,

Kyle Evans
___
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: r333386 - head/sys/netinet

2018-05-08 Thread Michael Tuexen
Author: tuexen
Date: Tue May  8 20:39:35 2018
New Revision: 86
URL: https://svnweb.freebsd.org/changeset/base/86

Log:
  Fix two typos reported by N. J. Mann, which were introduced in
  https://svnweb.freebsd.org/changeset/base/82 by me.
  
  MFC after:3 days

Modified:
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctputil.c
==
--- head/sys/netinet/sctputil.c Tue May  8 20:02:44 2018(r85)
+++ head/sys/netinet/sctputil.c Tue May  8 20:39:35 2018(r86)
@@ -2662,7 +2662,7 @@ sctp_notify_assoc_change(uint16_t state, struct sctp_t
abort_len = ntohs(abort->ch.chunk_length);
/*
 * Only SCTP_CHUNK_BUFFER_SIZE are guaranteed to be
-* contiguos.
+* contiguous.
 */
if (abort_len > SCTP_CHUNK_BUFFER_SIZE) {
abort_len = SCTP_CHUNK_BUFFER_SIZE;
@@ -3574,7 +3574,7 @@ sctp_notify_remote_error(struct sctp_tcb *stcb, uint16
chunk_len = ntohs(chunk->ch.chunk_length);
/*
 * Only SCTP_CHUNK_BUFFER_SIZE are guaranteed to be
-* contiguos.
+* contiguous.
 */
if (chunk_len > SCTP_CHUNK_BUFFER_SIZE) {
chunk_len = SCTP_CHUNK_BUFFER_SIZE;
___
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: r333351 - head/usr.bin/grep

2018-05-08 Thread Ronald Klop
On Tue, 08 May 2018 16:49:12 +0200, Alexey Dokuchaev   
wrote:



On Tue, May 08, 2018 at 09:36:21AM -0500, Kyle Evans wrote:
On Tue, May 8, 2018 at 5:58 AM, Alexey Dokuchaev   
wrote:

>>
>> - if ((f = fopen(fn, "r")) == NULL)
>> + if (strcmp(fn, "-") == 0)
>> + f = stdin;
>
> This makes sense: when `fn' is "-", `f' is stdin.
>
>> - fclose(f);
>> + if (strcmp(fn, "-") != 0)
>> + fclose(f);
>
> But not this one: why are you checking `fn' again?  Shouldn't you
> fclose(f) if it's not stdin?
>
> if (f != stdin)
> fclose(f);
>

You say potato, I say potato. =) In this case, it's low overhead in a
not particularly performance critical bit and drawing a connection
between this and the opening of 'f' above in an extremely obvious way.


Well, I'm not worried about the overhead or performance issues, they are
negligible.  I just find second strcmp(fn, "-") to be semantically wrong
(and that's why you need implicit "there's only one way to get stdin  
here"

assert).  You assign `f' to stdin based on `fn' being "-", but you
fclose(f) when it's not stdin; the value of `fn' is irrelevant this time.
As a nice bonus, you only spell strcmp(fn, "-") once and do not need to
implicitly assert that there's only one way to get stdin here.


This also might get ripped out soon -- we'll see how things go.


I see, understood.

./danfe


What is the result of "-f /dev/stdin"? Of does that fopen return a  
different filedesc?


Ronald.
___
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: r333385 - head/usr.sbin/efibootmgr

2018-05-08 Thread Warner Losh
Author: imp
Date: Tue May  8 20:02:44 2018
New Revision: 85
URL: https://svnweb.freebsd.org/changeset/base/85

Log:
  Remove ignored command line options
  
  The --device and --part command line options were planned for Linux
  compatibility mode. However, that mode will never happen, so remove
  them as last vestiges of a false start.
  
  Submitted by: Vlad Movchan

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

Modified: head/usr.sbin/efibootmgr/efibootmgr.c
==
--- head/usr.sbin/efibootmgr/efibootmgr.c   Tue May  8 20:02:39 2018
(r84)
+++ head/usr.sbin/efibootmgr/efibootmgr.c   Tue May  8 20:02:44 2018
(r85)
@@ -102,7 +102,6 @@ static struct option lopts[] = {
{"del-timout", no_argument, NULL, 'T'},
{"delete", required_argument, NULL, 'B'},
{"delete-bootnext", required_argument, NULL, 'N'},
-   {"device", required_argument, NULL, 'd'},
{"dry-run", no_argument, NULL, 'D'},
{"env", required_argument, NULL, 'e'},
{"help", no_argument, NULL, 'h'},
@@ -110,7 +109,6 @@ static struct option lopts[] = {
{"label", required_argument, NULL, 'L'},
{"loader", required_argument, NULL, 'l'},
{"once", no_argument, NULL, 'O'},
-   {"partition", required_argument, NULL, 'p'},
{"set-timeout", required_argument, NULL, 't'},
{"verbose", no_argument, NULL, 'v'},
{ NULL, 0, NULL, 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: r333384 - head/usr.sbin/efibootmgr

2018-05-08 Thread Warner Losh
Author: imp
Date: Tue May  8 20:02:39 2018
New Revision: 84
URL: https://svnweb.freebsd.org/changeset/base/84

Log:
  efibootmgr.8: fix example
  
  The example given was for the old, and now deleted, Linux
  compatibility mode. Update the example for the current code.
  
  Submitted by: Vlad Movchan

Modified:
  head/usr.sbin/efibootmgr/efibootmgr.8

Modified: head/usr.sbin/efibootmgr/efibootmgr.8
==
--- head/usr.sbin/efibootmgr/efibootmgr.8   Tue May  8 19:43:57 2018
(r83)
+++ head/usr.sbin/efibootmgr/efibootmgr.8   Tue May  8 20:02:39 2018
(r84)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 8, 2017
+.Dd May 8, 2018
 .Dt EFIBOOTMGR 8
 .Os
 .Sh NAME
@@ -111,10 +111,10 @@ variable.
 The
 .Nm
 program can be used to create new EFI boot variables. To create a new
-boot var pointing to an installation on partition 1 of device ada0 using
-the given loader with a description FreeBSD-11: 
+boot var pointing to an installation with its EFI partition mounted
+under /mnt, the given loader and a label "FreeBSD-11":
 .Pp
-.Dl efibootmgr -c -d ada0 -p 1 -l/EFI/BOOT/BOOTX64.EFI -L FreeBSD-11
+.Dl efibootmgr -c -l /mnt/EFI/BOOT/BOOTX64.EFI -L FreeBSD-11
 .Pp
 This will result in the next available BootVarNum being assigned to a
 new UEFI load variable, and given the label "FreeBSD-11" such as:
___
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: r333383 - head/usr.sbin/efibootmgr

2018-05-08 Thread Warner Losh
Author: imp
Date: Tue May  8 19:43:57 2018
New Revision: 83
URL: https://svnweb.freebsd.org/changeset/base/83

Log:
  Improve printing the boot variables.
  
  Print the boot variables in the order in the BootOrder variable, if it
  exists, and then in verbose mode print any unreferneced Boot
  variables. If BootOrder isn't set, fall back to printing all the
  variables.
  
  Sponsored by: Netflix

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

Modified: head/usr.sbin/efibootmgr/efibootmgr.c
==
--- head/usr.sbin/efibootmgr/efibootmgr.c   Tue May  8 18:48:51 2018
(r82)
+++ head/usr.sbin/efibootmgr/efibootmgr.c   Tue May  8 19:43:57 2018
(r83)
@@ -67,7 +67,7 @@ __FBSDID("$FreeBSD$");
 #endif
 
 #define BAD_LENGTH ((size_t)-1)
-   
+
 typedef struct _bmgr_opts {
char*env;
char*loader;
@@ -130,7 +130,8 @@ struct entry {
char*name;
char*label;
int idx;
-   int part;
+   int flags;
+#define SEEN   1
 
LIST_ENTRY(entry) entries;
 };
@@ -758,6 +759,31 @@ get_descr(uint8_t *data)
 }
 
 
+static bool
+print_boot_var(const char *name, bool verbose, bool curboot)
+{
+   size_t size;
+   uint32_t load_attrs;
+   uint8_t *data;
+   int ret;
+   char *d;
+
+   ret = efi_get_variable(EFI_GLOBAL_GUID, name, , , NULL);
+   if (ret < 0)
+   return false;
+   load_attrs = le32dec(data);
+   d = get_descr(data);
+   printf("%c%s%c %s", curboot ? '+' : ' ', name,
+   ((load_attrs & LOAD_OPTION_ACTIVE) ? '*': ' '), d);
+   free(d);
+   if (verbose)
+   print_loadopt_str(data, size);
+   else
+   printf("\n");
+   return true;
+}
+
+
 /* Cmd epilogue, or just the default with no args.
  * The order is [bootnext] bootcurrent, timeout, order, and the bootvars [-v]
  */
@@ -770,10 +796,10 @@ print_boot_vars(bool verbose)
 */
struct entry *v;
uint8_t *data;
-   char *d;
size_t size;
-   uint32_t attrs, load_attrs;
-   int ret;
+   uint32_t attrs;
+   int ret, bolen;
+   uint16_t *boot_order = NULL, current;
 
ret = efi_get_variable(EFI_GLOBAL_GUID, "BootNext", , , 
);
if (ret > 0) {
@@ -781,39 +807,58 @@ print_boot_vars(bool verbose)
}
 
ret = efi_get_variable(EFI_GLOBAL_GUID, "BootCurrent", , 
,);
-   printf("BootCurrent: %04x\n", le16dec(data));
+   current = le16dec(data);
+   printf("BootCurrent: %04x\n", current);
 
ret = efi_get_variable(EFI_GLOBAL_GUID, "Timeout", , , 
);
if (ret > 0) {
-   printf("Timeout : %d seconds\n", le16dec(data));
+   printf("Timeout: %d seconds\n", le16dec(data));
}
 
if (efi_get_variable(EFI_GLOBAL_GUID, "BootOrder", , , 
) > 0) {
if (size % 2 == 1)
warn("Bad BootOrder variable: odd length %d", 
(int)size);
-   printf("BootOrder : ");
-   for (size_t i = 0; i < size; i += 2)
-   printf("%04x%s", le16dec(data + i), i == size - 2 ? 
"\n" : ", ");
+   boot_order = malloc(size);
+   bolen = size / 2;
+   printf("BootOrder  : ");
+   for (size_t i = 0; i < size; i += 2) {
+   boot_order[i / 2] = le16dec(data + i);
+   printf("%04X%s", boot_order[i / 2], i == size - 2 ? 
"\n" : ", ");
+   }
}
 
-   /* now we want to fetch 'em all fresh again
-* which possibly includes a newly created bootvar
-*/
-   LIST_FOREACH(v, , entries) {
-   attrs = 0;
-   ret = efi_get_variable(EFI_GLOBAL_GUID, v->name, ,
-   , );
-   if (ret < 0)
-   continue; /* we must have deleted it */
-   load_attrs = le32dec(data);
-   d = get_descr(data);
-   printf("%s%c %s", v->name,
-   ((load_attrs & LOAD_OPTION_ACTIVE) ? '*': ' '), d);
-   free(d);
-   if (verbose)
-   print_loadopt_str(data, size);
-   else
-   printf("\n");
+   if (boot_order == NULL) {
+   /*
+* now we want to fetch 'em all fresh again
+* which possibly includes a newly created bootvar
+*/
+   LIST_FOREACH(v, , entries) {
+   print_boot_var(v->name, verbose, v->idx == current);
+   }
+   } else {
+   LIST_FOREACH(v, , entries) {
+   v->flags = 0;
+   }
+   for (int i = 0; i < bolen; i++) {
+   char buffer[10];
+
+   snprintf(buffer, 

svn commit: r333382 - head/sys/netinet

2018-05-08 Thread Michael Tuexen
Author: tuexen
Date: Tue May  8 18:48:51 2018
New Revision: 82
URL: https://svnweb.freebsd.org/changeset/base/82

Log:
  When reporting ERROR or ABORT chunks, don't use more data
  that is guaranteed to be contigous.
  Thanks to Felix Weinrank for finding and reporting this bug
  by fuzzing the usrsctp stack.
  
  MFC after:3 days

Modified:
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctputil.c
==
--- head/sys/netinet/sctputil.c Tue May  8 18:25:37 2018(r81)
+++ head/sys/netinet/sctputil.c Tue May  8 18:48:51 2018(r82)
@@ -2660,6 +2660,13 @@ sctp_notify_assoc_change(uint16_t state, struct sctp_t
notif_len = (unsigned int)sizeof(struct sctp_assoc_change);
if (abort != NULL) {
abort_len = ntohs(abort->ch.chunk_length);
+   /*
+* Only SCTP_CHUNK_BUFFER_SIZE are guaranteed to be
+* contiguos.
+*/
+   if (abort_len > SCTP_CHUNK_BUFFER_SIZE) {
+   abort_len = SCTP_CHUNK_BUFFER_SIZE;
+   }
} else {
abort_len = 0;
}
@@ -3565,6 +3572,13 @@ sctp_notify_remote_error(struct sctp_tcb *stcb, uint16
}
if (chunk != NULL) {
chunk_len = ntohs(chunk->ch.chunk_length);
+   /*
+* Only SCTP_CHUNK_BUFFER_SIZE are guaranteed to be
+* contiguos.
+*/
+   if (chunk_len > SCTP_CHUNK_BUFFER_SIZE) {
+   chunk_len = SCTP_CHUNK_BUFFER_SIZE;
+   }
} else {
chunk_len = 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: r333381 - head/usr.sbin/efibootmgr

2018-05-08 Thread Warner Losh
Author: imp
Date: Tue May  8 18:25:37 2018
New Revision: 81
URL: https://svnweb.freebsd.org/changeset/base/81

Log:
  Inline print_order(). It's used one palce.

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

Modified: head/usr.sbin/efibootmgr/efibootmgr.c
==
--- head/usr.sbin/efibootmgr/efibootmgr.c   Tue May  8 18:18:27 2018
(r80)
+++ head/usr.sbin/efibootmgr/efibootmgr.c   Tue May  8 18:25:37 2018
(r81)
@@ -279,27 +279,6 @@ parse_args(int argc, char *argv[])
 
 
 static void
-print_order(void)
-{
-   uint32_t attrs;
-   uint8_t *data;
-   size_t size, i;
-
-   if (efi_get_variable(EFI_GLOBAL_GUID, "BootOrder", , , 
) < 0) {
-   printf("BootOrder : Couldn't get value for BootOrder\n");
-   return;
-   }
-
-   if (size % 2 == 1)
-   errx(1, "Bad BootOrder variable: odd length");
-
-   printf("BootOrder : ");
-   for (i = 0; i < size; i += 2)
-   printf("%04x%s", le16dec(data + i), i == size - 2 ? "\n" : ", 
");
-}
-
-
-static void
 read_vars(void)
 {
 
@@ -808,7 +787,14 @@ print_boot_vars(bool verbose)
if (ret > 0) {
printf("Timeout : %d seconds\n", le16dec(data));
}
-   print_order();
+
+   if (efi_get_variable(EFI_GLOBAL_GUID, "BootOrder", , , 
) > 0) {
+   if (size % 2 == 1)
+   warn("Bad BootOrder variable: odd length %d", 
(int)size);
+   printf("BootOrder : ");
+   for (size_t i = 0; i < size; i += 2)
+   printf("%04x%s", le16dec(data + i), i == size - 2 ? 
"\n" : ", ");
+   }
 
/* now we want to fetch 'em all fresh again
 * which possibly includes a newly created bootvar
___
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: r333380 - in head/sys/contrib/dev/acpica: . components/executer components/namespace components/utilities include

2018-05-08 Thread Jung-uk Kim
Author: jkim
Date: Tue May  8 18:18:27 2018
New Revision: 80
URL: https://svnweb.freebsd.org/changeset/base/80

Log:
  MFV:  r78
  
  Import ACPICA 20180508.

Modified:
  head/sys/contrib/dev/acpica/changes.txt
  head/sys/contrib/dev/acpica/components/executer/exconfig.c
  head/sys/contrib/dev/acpica/components/namespace/nsinit.c
  head/sys/contrib/dev/acpica/components/utilities/utbuffer.c
  head/sys/contrib/dev/acpica/include/aclocal.h
  head/sys/contrib/dev/acpica/include/acnamesp.h
  head/sys/contrib/dev/acpica/include/acpixf.h
Directory Properties:
  head/sys/contrib/dev/acpica/   (props changed)

Modified: head/sys/contrib/dev/acpica/changes.txt
==
--- head/sys/contrib/dev/acpica/changes.txt Tue May  8 18:11:26 2018
(r79)
+++ head/sys/contrib/dev/acpica/changes.txt Tue May  8 18:18:27 2018
(r80)
@@ -1,4 +1,25 @@
 
+8 May 2018. Summary of changes for version 20180508:
+
+
+1) ACPICA kernel-resident subsystem:
+
+Completed the new (recently deployed) package resolution mechanism for 
+the Load and LoadTable ASL/AML operators. This fixes a regression that 
+was introduced in version 20180209 that could result in an 
+AE_AML_INTERNAL exception during the loading of a dynamic ACPI/AML table 
+(SSDT) that contains package objects.
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+AcpiDump and AcpiXtract: Implemented support for ACPI tables larger than 
+1 MB. This change allows for table offsets within the acpidump file to be 
+up to 8 characters. These changes are backwards compatible with existing 
+acpidump files.
+
+
+
 27 April 2018. Summary of changes for version 20180427: 
 
 

Modified: head/sys/contrib/dev/acpica/components/executer/exconfig.c
==
--- head/sys/contrib/dev/acpica/components/executer/exconfig.c  Tue May  8 
18:11:26 2018(r79)
+++ head/sys/contrib/dev/acpica/components/executer/exconfig.c  Tue May  8 
18:18:27 2018(r80)
@@ -342,6 +342,11 @@ AcpiExLoadTableOp (
 return_ACPI_STATUS (Status);
 }
 
+/* Complete the initialization/resolution of package objects */
+
+Status = AcpiNsWalkNamespace (ACPI_TYPE_PACKAGE, ACPI_ROOT_OBJECT,
+ACPI_UINT32_MAX, 0, AcpiNsInitOnePackage, NULL, NULL, NULL);
+
 /* Parameter Data (optional) */
 
 if (ParameterNode)
@@ -614,6 +619,11 @@ AcpiExLoadOp (
 
 return_ACPI_STATUS (Status);
 }
+
+/* Complete the initialization/resolution of package objects */
+
+Status = AcpiNsWalkNamespace (ACPI_TYPE_PACKAGE, ACPI_ROOT_OBJECT,
+ACPI_UINT32_MAX, 0, AcpiNsInitOnePackage, NULL, NULL, NULL);
 
 /* Store the DdbHandle into the Target operand */
 

Modified: head/sys/contrib/dev/acpica/components/namespace/nsinit.c
==
--- head/sys/contrib/dev/acpica/components/namespace/nsinit.c   Tue May  8 
18:11:26 2018(r79)
+++ head/sys/contrib/dev/acpica/components/namespace/nsinit.c   Tue May  8 
18:18:27 2018(r80)
@@ -408,6 +408,65 @@ ErrorExit:
 
 
/***
  *
+ * FUNCTION:AcpiNsInitOnePackage
+ *
+ * PARAMETERS:  ObjHandle   - Node
+ *  Level   - Current nesting level
+ *  Context - Not used
+ *  ReturnValue - Not used
+ *
+ * RETURN:  Status
+ *
+ * DESCRIPTION: Callback from AcpiWalkNamespace. Invoked for every package
+ *  within the namespace. Used during dynamic load of an SSDT.
+ *
+ 
**/
+
+ACPI_STATUS
+AcpiNsInitOnePackage (
+ACPI_HANDLE ObjHandle,
+UINT32  Level,
+void*Context,
+void**ReturnValue)
+{
+ACPI_STATUS Status;
+ACPI_OPERAND_OBJECT *ObjDesc;
+ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
+
+
+ObjDesc = AcpiNsGetAttachedObject (Node);
+if (!ObjDesc)
+{
+return (AE_OK);
+}
+
+/* Exit if package is already initialized */
+
+if (ObjDesc->Package.Flags & AOPOBJ_DATA_VALID)
+{
+return (AE_OK);
+}
+
+Status = AcpiDsGetPackageArguments (ObjDesc);
+if (ACPI_FAILURE (Status))
+{
+return (AE_OK);
+}
+
+Status = AcpiUtWalkPackageTree (ObjDesc, NULL, AcpiDsInitPackageElement,
+NULL);
+if (ACPI_FAILURE (Status))
+{
+return (AE_OK);
+}
+
+ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
+return (AE_OK);
+}
+
+
+/***
+ *
  * FUNCTION:AcpiNsInitOneObject
  *
  * 

svn commit: r333373 - head/sys/net

2018-05-08 Thread Stephen Hurd
Author: shurd
Date: Tue May  8 17:15:10 2018
New Revision: 73
URL: https://svnweb.freebsd.org/changeset/base/73

Log:
  iflib: print message when iflib_tx_structures_setup fails
  
  Print a message when iflib_tx_structures_setup fails, like we do for
  iflib_rx_structures_setup.
  
  Now that we always print a message from within
  iflib_qset_structures_setup when it fails, stop printing one in
  iflib_device_register() at the call site.
  
  Submitted by: Jacob Keller 
  Reviewed by:  gallatin
  MFC after:3 days
  Sponsored by: Intel Corporation
  Differential Revision:https://reviews.freebsd.org/D15300

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cTue May  8 17:14:54 2018(r72)
+++ head/sys/net/iflib.cTue May  8 17:15:10 2018(r73)
@@ -4398,10 +4398,8 @@ iflib_device_register(device_t dev, void *sc, if_share
goto fail;
}
 
-   if ((err = iflib_qset_structures_setup(ctx))) {
-   device_printf(dev, "qset structure setup failed %d\n", err);
+   if ((err = iflib_qset_structures_setup(ctx)))
goto fail_queues;
-   }
 
/*
 * Group taskqueues aren't properly set up until SMP is started,
@@ -5070,8 +5068,10 @@ iflib_qset_structures_setup(if_ctx_t ctx)
 * It is expected that the caller takes care of freeing queues if this
 * fails.
 */
-   if ((err = iflib_tx_structures_setup(ctx)) != 0)
+   if ((err = iflib_tx_structures_setup(ctx)) != 0) {
+   device_printf(ctx->ifc_dev, "iflib_tx_structures_setup failed: 
%d\n", err);
return (err);
+   }
 
if ((err = iflib_rx_structures_setup(ctx)) != 0)
device_printf(ctx->ifc_dev, "iflib_rx_structures_setup failed: 
%d\n", err);
___
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: r333374 - head/release

2018-05-08 Thread Glen Barber
Author: gjb
Date: Tue May  8 17:15:12 2018
New Revision: 74
URL: https://svnweb.freebsd.org/changeset/base/74

Log:
  Use vMMDD in the timestamp suffix for Google Compute Engine
  snapshot images for consistency with other OSes.
  
  MFC after:3 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/Makefile.gce

Modified: head/release/Makefile.gce
==
--- head/release/Makefile.gce   Tue May  8 17:15:10 2018(r73)
+++ head/release/Makefile.gce   Tue May  8 17:15:12 2018(r74)
@@ -23,7 +23,8 @@ GCE_FAMILY=   ${TYPE:tl}-${REVISION:S,.,-,}
 .endif
 
 .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == 
"PRERELEASE"
-SNAPSHOT_DATE!=date +-%Y-%m-%d
+_SNAPSHOT_DATE!=   date +%Y%m%d
+SNAPSHOT_DATE= -v${_SNAPSHOT_DATE}
 GCE_FAMILY_SUFX=   -snap
 .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: r333368 - in head/sys: amd64/amd64 i386/i386

2018-05-08 Thread Konstantin Belousov
Author: kib
Date: Tue May  8 17:00:34 2018
New Revision: 68
URL: https://svnweb.freebsd.org/changeset/base/68

Log:
  Prepare DB# handler for deferred trigger of watchpoints.
  
  Since pop %ss/mov %ss instructions defer all interrupts and exceptions
  for the next instruction, it is possible that the userspace watchpoint
  trap executes on the first instruction of the kernel entry for
  syscall/bpt.
  
  In this case, DB# should be treated similarly to NMI: on amd64 we must
  always load GSBASE even if the trap comes from kernel mode, and load
  the kernel page table root into %cr3.  Moreover, the trap must
  use the dedicated stack, because we are still on the user stack when
  trapped on syscall entry.
  
  For i386, we must reload %cr3.  The syscall instruction is not configured,
  so there is no issue with executing on user stack when trapping.
  
  Due to some CPU erratas it is not always possible to detect that the
  userspace watchpoint triggered by inspecting %dr6.  In trap(), compare the
  trap %rip with the known unsafe entry points and if matched pretend that
  the watchpoint did not fire at all.
  
  Thank you to the MSRC Incident Response Team, and in particular Greg
  Lenti and Nate Warfield, for coordinating the response to this issue
  across multiple vendors.
  
  Thanks to Computer Recycling at The Working Center of Kitchener for
  making hardware available to allow us to test the patch on additional
  CPU families.
  
  Reviewed by:  jhb
  Discussed with:   Matthew Dillon
  Tested by:emaste
  Sponsored by: The FreeBSD Foundation
  Security: CVE-2018-8897
  Security: FreeBSD-SA-18:06.debugreg

Modified:
  head/sys/amd64/amd64/exception.S
  head/sys/amd64/amd64/machdep.c
  head/sys/amd64/amd64/mp_machdep.c
  head/sys/amd64/amd64/pmap.c
  head/sys/amd64/amd64/trap.c
  head/sys/i386/i386/exception.s
  head/sys/i386/i386/trap.c

Modified: head/sys/amd64/amd64/exception.S
==
--- head/sys/amd64/amd64/exception.STue May  8 16:56:14 2018
(r67)
+++ head/sys/amd64/amd64/exception.STue May  8 17:00:34 2018
(r68)
@@ -115,7 +115,6 @@ X\l:subq $TF_RIP,%rsp
jmp alltraps_noen
.endm
 
-   TRAP_NOEN   dbg, T_TRCTRAP
TRAP_NOEN   bpt, T_BPTFLT
 #ifdef KDTRACE_HOOKS
TRAP_NOEN   dtrace_ret, T_DTRACE_RET
@@ -536,6 +535,121 @@ fast_syscall_common:
  */
 IDTVEC(fast_syscall32)
sysret
+
+/*
+ * DB# handler is very similar to NM#, because 'mov/pop %ss' delay
+ * generation of exception until the next instruction is executed,
+ * which might be a kernel entry.  So we must execute the handler
+ * on IST stack and be ready for non-kernel GSBASE.
+ */
+IDTVEC(dbg)
+   subq$TF_RIP,%rsp
+   movl$(T_TRCTRAP),TF_TRAPNO(%rsp)
+   movq$0,TF_ADDR(%rsp)
+   movq$0,TF_ERR(%rsp)
+   movq%rdi,TF_RDI(%rsp)
+   movq%rsi,TF_RSI(%rsp)
+   movq%rdx,TF_RDX(%rsp)
+   movq%rcx,TF_RCX(%rsp)
+   movq%r8,TF_R8(%rsp)
+   movq%r9,TF_R9(%rsp)
+   movq%rax,TF_RAX(%rsp)
+   movq%rbx,TF_RBX(%rsp)
+   movq%rbp,TF_RBP(%rsp)
+   movq%r10,TF_R10(%rsp)
+   movq%r11,TF_R11(%rsp)
+   movq%r12,TF_R12(%rsp)
+   movq%r13,TF_R13(%rsp)
+   movq%r14,TF_R14(%rsp)
+   movq%r15,TF_R15(%rsp)
+   SAVE_SEGS
+   movl$TF_HASSEGS,TF_FLAGS(%rsp)
+   cld
+   testb   $SEL_RPL_MASK,TF_CS(%rsp)
+   jnz dbg_fromuserspace
+   /*
+* We've interrupted the kernel.  Preserve GS.base in %r12,
+* %cr3 in %r13, and possibly lower half of MSR_IA32_SPEC_CTL in %r14d.
+*/
+   movl$MSR_GSBASE,%ecx
+   rdmsr
+   movq%rax,%r12
+   shlq$32,%rdx
+   orq %rdx,%r12
+   /* Retrieve and load the canonical value for GS.base. */
+   movqTF_SIZE(%rsp),%rdx
+   movl%edx,%eax
+   shrq$32,%rdx
+   wrmsr
+   movq%cr3,%r13
+   movqPCPU(KCR3),%rax
+   cmpq$~0,%rax
+   je  1f
+   movq%rax,%cr3
+1: testl   $CPUID_STDEXT3_IBPB,cpu_stdext_feature3(%rip)
+   je  2f
+   movl$MSR_IA32_SPEC_CTRL,%ecx
+   rdmsr
+   movl%eax,%r14d
+   callhandle_ibrs_entry
+2: FAKE_MCOUNT(TF_RIP(%rsp))
+   movq%rsp,%rdi
+   calltrap
+   MEXITCOUNT
+   testl   $CPUID_STDEXT3_IBPB,cpu_stdext_feature3(%rip)
+   je  3f
+   movl%r14d,%eax
+   xorl%edx,%edx
+   movl$MSR_IA32_SPEC_CTRL,%ecx
+   wrmsr
+   /*
+* Put back the preserved MSR_GSBASE value.
+*/
+3: movl$MSR_GSBASE,%ecx
+   movq%r12,%rdx
+   movl%edx,%eax
+   shrq$32,%rdx
+   wrmsr
+   movq%r13,%cr3
+   RESTORE_REGS
+   addq$TF_RIP,%rsp
+   jmp doreti_iret
+dbg_fromuserspace:
+   /*
+ 

svn commit: r333366 - head/sys/net

2018-05-08 Thread Stephen Hurd
Author: shurd
Date: Tue May  8 16:56:02 2018
New Revision: 66
URL: https://svnweb.freebsd.org/changeset/base/66

Log:
  iflib: cleanup queues when iflib_device_register fail
  
  Submitted by: Jacob Keller 
  Reviewed by:  gallatin
  MFC after:3 days
  Sponsored by: Intel Corporation
  Differential Revision:https://reviews.freebsd.org/D15299

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cTue May  8 16:16:56 2018(r65)
+++ head/sys/net/iflib.cTue May  8 16:56:02 2018(r66)
@@ -4453,7 +4453,8 @@ fail_intr_free:
if (scctx->isc_intr == IFLIB_INTR_MSIX || scctx->isc_intr == 
IFLIB_INTR_MSI)
pci_release_msi(ctx->ifc_dev);
 fail_queues:
-   /* XXX free queues */
+   iflib_tx_structures_free(ctx);
+   iflib_rx_structures_free(ctx);
 fail:
IFDI_DETACH(ctx);
CTX_UNLOCK(ctx);
@@ -5065,14 +5066,16 @@ iflib_qset_structures_setup(if_ctx_t ctx)
 {
int err;
 
+   /*
+* It is expected that the caller takes care of freeing queues if this
+* fails.
+*/
if ((err = iflib_tx_structures_setup(ctx)) != 0)
return (err);
 
-   if ((err = iflib_rx_structures_setup(ctx)) != 0) {
+   if ((err = iflib_rx_structures_setup(ctx)) != 0)
device_printf(ctx->ifc_dev, "iflib_rx_structures_setup failed: 
%d\n", err);
-   iflib_tx_structures_free(ctx);
-   iflib_rx_structures_free(ctx);
-   }
+
return (err);
 }
 
___
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: r333365 - head/stand/common

2018-05-08 Thread Warner Losh
Author: imp
Date: Tue May  8 16:16:56 2018
New Revision: 65
URL: https://svnweb.freebsd.org/changeset/base/65

Log:
  We don't use f_devdata, so don't set it. Should that need to change
  later, we can. This leaves ZFS as the only irregular f_devdata
  user in the tree.

Modified:
  head/stand/common/dev_net.c

Modified: head/stand/common/dev_net.c
==
--- head/stand/common/dev_net.c Tue May  8 15:51:40 2018(r64)
+++ head/stand/common/dev_net.c Tue May  8 16:16:56 2018(r65)
@@ -190,7 +190,6 @@ net_open(struct open_file *f, ...)
 
}
netdev_opens++;
-   f->f_devdata = _sock;
return (error);
 }
 
@@ -202,9 +201,6 @@ net_close(struct open_file *f)
if (debug)
printf("net_close: opens=%d\n", netdev_opens);
 #endif
-
-   f->f_devdata = NULL;
-
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"


Re: svn commit: r333351 - head/usr.bin/grep

2018-05-08 Thread Alexey Dokuchaev
On Tue, May 08, 2018 at 09:36:21AM -0500, Kyle Evans wrote:
> On Tue, May 8, 2018 at 5:58 AM, Alexey Dokuchaev  wrote:
> >>
> >> - if ((f = fopen(fn, "r")) == NULL)
> >> + if (strcmp(fn, "-") == 0)
> >> + f = stdin;
> >
> > This makes sense: when `fn' is "-", `f' is stdin.
> >
> >> - fclose(f);
> >> + if (strcmp(fn, "-") != 0)
> >> + fclose(f);
> >
> > But not this one: why are you checking `fn' again?  Shouldn't you
> > fclose(f) if it's not stdin?
> >
> > if (f != stdin)
> > fclose(f);
> >
> 
> You say potato, I say potato. =) In this case, it's low overhead in a
> not particularly performance critical bit and drawing a connection
> between this and the opening of 'f' above in an extremely obvious way.

Well, I'm not worried about the overhead or performance issues, they are
negligible.  I just find second strcmp(fn, "-") to be semantically wrong
(and that's why you need implicit "there's only one way to get stdin here"
assert).  You assign `f' to stdin based on `fn' being "-", but you
fclose(f) when it's not stdin; the value of `fn' is irrelevant this time.
As a nice bonus, you only spell strcmp(fn, "-") once and do not need to
implicitly assert that there's only one way to get stdin here.

> This also might get ripped out soon -- we'll see how things go.

I see, understood.

./danfe
___
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: r333351 - head/usr.bin/grep

2018-05-08 Thread Kyle Evans
On Tue, May 8, 2018 at 5:58 AM, Alexey Dokuchaev  wrote:
> On Tue, May 08, 2018 at 03:53:47AM +, Kyle Evans wrote:
>> New Revision: 51
>> URL: https://svnweb.freebsd.org/changeset/base/51
>>
>> Log:
>>   bsdgrep: Allow "-" to be passed to -f to mean "standard input"
>>
>>   A version of this patch was originally sent to me by se@, matching behavior
>>   from newer versions of GNU grep.
>>
>> - if ((f = fopen(fn, "r")) == NULL)
>> + if (strcmp(fn, "-") == 0)
>> + f = stdin;
>
> This makes sense: when `fn' is "-", `f' is stdin.
>
>> - fclose(f);
>> + if (strcmp(fn, "-") != 0)
>> + fclose(f);
>
> But not this one: why are you checking `fn' again?  Shouldn't you fclose(f)
> if it's not stdin?
>
> if (f != stdin)
> fclose(f);
>

You say potato, I say potato. =) In this case, it's low overhead in a
not particularly performance critical bit and drawing a connection
between this and the opening of 'f' above in an extremely obvious way.
Granted, there's only one way to get stdin here.

This also might get ripped out soon- we'll see how things go.
___
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: r333363 - head/sys/powerpc/pseries

2018-05-08 Thread Justin Hibbits
Author: jhibbits
Date: Tue May  8 13:23:39 2018
New Revision: 63
URL: https://svnweb.freebsd.org/changeset/base/63

Log:
  Fix wrong cpu0 identification
  
  Summary:
  chrp_cpuref_init() was relying on the boot strap processor to be
  the first child of /cpus. That was not always the case, specially
  on pseries with FDT.
  
  This change uses the "reg" property of each CPU instead and also
  adds several sanity checks to avoid unexpected behavior (maybe
  too many panics?).
  
  The main observed symptom was interrupts being missed by the main
  processor, leading to timeouts and the kernel aborting the boot.
  
  Submitted by: Leandro Lupori
  Reviewed by:  nwhitehorn
  Differential Revision: https://reviews.freebsd.org/D15174

Modified:
  head/sys/powerpc/pseries/platform_chrp.c

Modified: head/sys/powerpc/pseries/platform_chrp.c
==
--- head/sys/powerpc/pseries/platform_chrp.cTue May  8 11:39:01 2018
(r62)
+++ head/sys/powerpc/pseries/platform_chrp.cTue May  8 13:23:39 2018
(r63)
@@ -350,14 +350,26 @@ chrp_smp_get_bsp(platform_t plat, struct cpuref *cpure
return (0);
 }
 
+static void
+get_cpu_reg(phandle_t cpu, cell_t *reg)
+{
+   int res;
+
+   res = OF_getproplen(cpu, "reg");
+   if (res != sizeof(cell_t))
+   panic("Unexpected length for CPU property reg on Open 
Firmware\n");
+   OF_getencprop(cpu, "reg", reg, res);
+}
+
 static int
 chrp_cpuref_init(void)
 {
-   phandle_t cpu, dev;
+   phandle_t cpu, dev, chosen, pbsp;
+   ihandle_t ibsp;
char buf[32];
-   int a, res;
-   cell_t interrupt_servers[32];
-   uint64_t bsp;
+   int a, bsp, res, res2, tmp_cpuref_cnt;
+   static struct cpuref tmp_cpuref[MAXCPU];
+   cell_t interrupt_servers[32], addr_cells, size_cells, reg, bsp_reg;
 
if (platform_cpuref_valid)
return (0);
@@ -371,25 +383,77 @@ chrp_cpuref_init(void)
dev = OF_peer(dev);
}
 
-   bsp = 0;
+   /* Make sure that cpus reg property have 1 address cell and 0 size 
cells */
+   res = OF_getproplen(dev, "#address-cells");
+   res2 = OF_getproplen(dev, "#size-cells");
+   if (res != res2 || res != sizeof(cell_t))
+   panic("CPU properties #address-cells and #size-cells not found 
on Open Firmware\n");
+   OF_getencprop(dev, "#address-cells", _cells, sizeof(addr_cells));
+   OF_getencprop(dev, "#size-cells", _cells, sizeof(size_cells));
+   if (addr_cells != 1 || size_cells != 0)
+   panic("Unexpected values for CPU properties #address-cells and 
#size-cells on Open Firmware\n");
+
+   /* Look for boot CPU in /chosen/cpu and /chosen/fdtbootcpu */
+
+   chosen = OF_finddevice("/chosen");
+   if (chosen == -1)
+   panic("Device /chosen not found on Open Firmware\n");
+
+   bsp_reg = -1;
+
+   /* /chosen/cpu */
+   if (OF_getproplen(chosen, "cpu") == sizeof(ihandle_t)) {
+   OF_getprop(chosen, "cpu", , sizeof(ibsp));
+   pbsp = OF_instance_to_package(ibsp);
+   if (pbsp != -1)
+   get_cpu_reg(pbsp, _reg);
+   }
+
+   /* /chosen/fdtbootcpu */
+   if (bsp_reg == -1) {
+   if (OF_getproplen(chosen, "fdtbootcpu") == sizeof(cell_t))
+   OF_getprop(chosen, "fdtbootcpu", _reg, 
sizeof(bsp_reg));
+   }
+
+   if (bsp_reg == -1)
+   panic("Boot CPU not found on Open Firmware\n");
+
+   bsp = -1;
+   tmp_cpuref_cnt = 0;
for (cpu = OF_child(dev); cpu != 0; cpu = OF_peer(cpu)) {
res = OF_getprop(cpu, "device_type", buf, sizeof(buf));
if (res > 0 && strcmp(buf, "cpu") == 0) {
res = OF_getproplen(cpu, "ibm,ppc-interrupt-server#s");
if (res > 0) {
-
-
OF_getencprop(cpu, "ibm,ppc-interrupt-server#s",
interrupt_servers, res);
 
-   for (a = 0; a < res/sizeof(cell_t); a++) {
-   
platform_cpuref[platform_cpuref_cnt].cr_hwref = interrupt_servers[a];
-   
platform_cpuref[platform_cpuref_cnt].cr_cpuid = platform_cpuref_cnt;
+   get_cpu_reg(cpu, );
+   if (reg == bsp_reg)
+   bsp = tmp_cpuref_cnt;
 
-   platform_cpuref_cnt++;
+   for (a = 0; a < res/sizeof(cell_t); a++) {
+   tmp_cpuref[tmp_cpuref_cnt].cr_hwref = 
interrupt_servers[a];
+   tmp_cpuref[tmp_cpuref_cnt].cr_cpuid = 
tmp_cpuref_cnt;
+   tmp_cpuref_cnt++;
}
 

svn commit: r333362 - head/sys/netinet6

2018-05-08 Thread Hans Petter Selasky
Author: hselasky
Date: Tue May  8 11:39:01 2018
New Revision: 62
URL: https://svnweb.freebsd.org/changeset/base/62

Log:
  Fix for missing network interface address event when adding the default IPv6
  based link-local address.
  
  The default link local address for IPv6 is added as part of bringing the
  network interface up. Move the call to "EVENTHANDLER_INVOKE(ifaddr_event,)"
  from the SIOCAIFADDR_IN6 ioctl(2) handler to in6_notify_ifa() which should
  catch all the cases of adding IPv6 based addresses to a network interface.
  Add a witness warning in case the event handler is not allowed to sleep.
  
  Reviewed by:  network (ae), kib
  Differential Revision:https://reviews.freebsd.org/D13407
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/netinet6/in6.c

Modified: head/sys/netinet6/in6.c
==
--- head/sys/netinet6/in6.c Tue May  8 10:56:06 2018(r61)
+++ head/sys/netinet6/in6.c Tue May  8 11:39:01 2018(r62)
@@ -686,7 +686,6 @@ aifaddr_out:
 * The failure means address duplication was detected.
 */
}
-   EVENTHANDLER_INVOKE(ifaddr_event, ifp);
break;
}
 
@@ -1399,7 +1398,7 @@ in6_notify_ifa(struct ifnet *ifp, struct in6_ifaddr *i
if (ifacount <= 1 && ifp->if_ioctl) {
error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia);
if (error)
-   return (error);
+   goto done;
}
 
/*
@@ -1439,7 +1438,7 @@ in6_notify_ifa(struct ifnet *ifp, struct in6_ifaddr *i
ia->ia_flags |= IFA_RTSELF;
error = rtinit(>ia_ifa, RTM_ADD, ia->ia_flags | rtflags);
if (error)
-   return (error);
+   goto done;
ia->ia_flags |= IFA_ROUTE;
}
 
@@ -1452,6 +1451,11 @@ in6_notify_ifa(struct ifnet *ifp, struct in6_ifaddr *i
if (error == 0)
ia->ia_flags |= IFA_RTSELF;
}
+done:
+   WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL,
+   "Invoking IPv6 network device address event may sleep");
+
+   EVENTHANDLER_INVOKE(ifaddr_event, ifp);
 
return (error);
 }
___
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: r333351 - head/usr.bin/grep

2018-05-08 Thread Alexey Dokuchaev
On Tue, May 08, 2018 at 03:53:47AM +, Kyle Evans wrote:
> New Revision: 51
> URL: https://svnweb.freebsd.org/changeset/base/51
> 
> Log:
>   bsdgrep: Allow "-" to be passed to -f to mean "standard input"
>   
>   A version of this patch was originally sent to me by se@, matching behavior
>   from newer versions of GNU grep.
>  
> - if ((f = fopen(fn, "r")) == NULL)
> + if (strcmp(fn, "-") == 0)
> + f = stdin;

This makes sense: when `fn' is "-", `f' is stdin.

> - fclose(f);
> + if (strcmp(fn, "-") != 0)
> + fclose(f);

But not this one: why are you checking `fn' again?  Shouldn't you fclose(f)
if it's not stdin?

if (f != stdin)
fclose(f);

./danfe
___
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: r333358 - head/lib/libsqlite3

2018-05-08 Thread Peter Wemm
Author: peter
Date: Tue May  8 06:09:49 2018
New Revision: 58
URL: https://svnweb.freebsd.org/changeset/base/58

Log:
  Revert r53 - FTS5 uses log(3) which currently breakes non-amd64 builds.
  
  Reported by:  lwhsu

Modified:
  head/lib/libsqlite3/Makefile

Modified: head/lib/libsqlite3/Makefile
==
--- head/lib/libsqlite3/MakefileTue May  8 05:11:06 2018
(r57)
+++ head/lib/libsqlite3/MakefileTue May  8 06:09:49 2018
(r58)
@@ -36,7 +36,6 @@ CFLAGS+=  -I${SQLITE} \
-DSQLITE_THREADSAFE=1 \
-DSQLITE_ENABLE_FTS3 \
-DSQLITE_ENABLE_FTS4 \
-   -DSQLITE_ENABLE_FTS5 \
-DSQLITE_ENABLE_RTREE
 
 .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"