syslogd close at EAGAIN

2017-09-15 Thread Alexander Bluhm
Hi,

syslogd tries to ignore EAGAIN for tty.  Unfortunately it closes
the file descriptor before checking the errno.  So f_file contains
a bad file descriptor that may be reused at the next open.

I think f_file should not be closed if the errno is EAGAIN.

If I move the close down, f_file is overwritten in all cases.

ok?

bluhm

Index: usr.sbin/syslogd/syslogd.c
===
RCS file: /data/mirror/openbsd/cvs/src/usr.sbin/syslogd/syslogd.c,v
retrieving revision 1.246
diff -u -p -r1.246 syslogd.c
--- usr.sbin/syslogd/syslogd.c  12 Sep 2017 15:17:20 -  1.246
+++ usr.sbin/syslogd/syslogd.c  16 Sep 2017 00:16:38 -
@@ -2045,7 +2045,6 @@ fprintlog(struct filed *f, int flags, ch
break;
}
 
-   (void)close(f->f_file);
/*
 * Check for errors on TTY's or program pipes.
 * Errors happen due to loss of tty or died programs.
@@ -2056,7 +2055,10 @@ fprintlog(struct filed *f, int flags, ch
 * This can happen when logging to a locked tty.
 */
break;
-   } else if ((e == EIO || e == EBADF) &&
+   }
+
+   (void)close(f->f_file);
+   if ((e == EIO || e == EBADF) &&
f->f_type != F_FILE && f->f_type != F_PIPE &&
!retryonce) {
f->f_file = priv_open_tty(f->f_un.f_fname);



Re: magic.5: Add missing types

2017-09-15 Thread Klemens Nanni
On Tue, Jul 25, 2017 at 08:54:15PM +, Klemens Nanni wrote:
> On Tue, Jul 25, 2017 at 09:43:48PM +0100, Stuart Henderson wrote:
> > On 2017/07/25 20:57, Klemens Nanni wrote:
> > > I didn't touch the manual's first sentence mentioning file(1)'s version
> > > since nicm@ reimplemented file(1) with revision 1.11 on 2015/04/24. He
> > > or someone else more knowledgable in this regard might want to bump it
> > > accordingly.
> > 
> > OpenBSD's /etc/magic doesn't match that provided with any particular
> > version of file, parts have been updated as people have run into a need
> > or bug, but there's been no wholesale update. Perhaps this would do?
> > 
> > diff --git usr.bin/file/magic.5 usr.bin/file/magic.5
> > index 812c4c31095..f9ea22c3cc4 100644
> > --- usr.bin/file/magic.5
> > +++ usr.bin/file/magic.5
> > @@ -41,10 +41,9 @@
> >  This manual page documents the format of the magic file as
> >  used by the
> >  .Xr file 1
> > -command, version 4.24.
> > -The
> > +command.
> >  .Xr file 1
> > -command identifies the type of a file using,
> > +identifies the type of a file using,
> >  among other tests,
> >  a test for whether the file contains certain
> >  .Dq "magic patterns" .
> Already thought as much, looks fine to me.
>  
> > > -.Dd $Mdocdate: April 24 2016 $
> > > +.Dd $Mdocdate: July 25 2017 $
> > 
> > btw, it's better to leave the CVS keywords ($Mdocdate$, $OpenBSD$, etc)
> > alone, changing them guarantees a conflict if commits are made to the file.
> Ah, sure (I knew about this in my first diff).
Here's an updated diff I simply forgot to send back then.

Feedback, more comments or improvements?


diff --git a/usr.bin/file/magic.5 b/usr.bin/file/magic.5
index 812c4c31095..b2f3a27671a 100644
--- a/usr.bin/file/magic.5
+++ b/usr.bin/file/magic.5
@@ -41,10 +41,9 @@
 This manual page documents the format of the magic file as
 used by the
 .Xr file 1
-command, version 4.24.
-The
+command.
 .Xr file 1
-command identifies the type of a file using,
+identifies the type of a file using,
 among other tests,
 a test for whether the file contains certain
 .Dq "magic patterns" .
@@ -218,6 +217,28 @@ This is intended to be used with the test
 .Em x
 (which is always true) and a message that is to be used if there are
 no other matches.
+.It Dv clear
+This test is always true and clears the match flag for that level.
+It is intended to be used with the default test.
+.It Dv name
+Define a named magic instance that can be called from another
+.Dv use
+magic entry, like a subroutine call.
+Named instance direct magic offsets are relative to the offset of the
+previous matched entry, but indirect offsets are relative to the
+beginning of the file as usual.
+Named magic entries always match.
+.It Dv use
+Recursively call the named magic starting from the current offset.
+If the name of the referenced instance begins with a
+.Dv ^
+then the endianness of the magic is switched; if the magic mentioned
+.Dv leshort
+for example,
+it is treated as
+.Dv beshort
+and vice versa.
+This is useful to avoid duplicating the rules for different endianness.
 .El
 .Pp
 Each top-level magic pattern (see below for an explanation of levels)



Re: ptrace, copyin, uvm fault errno

2017-09-15 Thread Alexander Bluhm
Fine, then let's change it to EFAULT.

OK bluhm@



Re: elf.h

2017-09-15 Thread Karel Gardas

Hi,

below is last version of my attempt to migrate elf_abi.h to elf.h. This version 
solves devel/libdwarf and devel/valgrind failures reported on ports@ by 
Christian Weisgerber

Thanks,
Karel


? .cvsignore
Index: distrib/sets/lists/comp/mi
===
RCS file: /cvs/src/distrib/sets/lists/comp/mi,v
retrieving revision 1.1369
diff -u -p -u -r1.1369 mi
--- distrib/sets/lists/comp/mi  5 Sep 2017 03:16:14 -   1.1369
+++ distrib/sets/lists/comp/mi  15 Sep 2017 21:01:18 -
@@ -825,7 +825,7 @@
 ./usr/include/dirent.h
 ./usr/include/disktab.h
 ./usr/include/dlfcn.h
-./usr/include/elf_abi.h
+./usr/include/elf.h
 ./usr/include/endian.h
 ./usr/include/err.h
 ./usr/include/errno.h
Index: games/hangman/ksyms.c
===
RCS file: /cvs/src/games/hangman/ksyms.c,v
retrieving revision 1.10
diff -u -p -u -r1.10 ksyms.c
--- games/hangman/ksyms.c   8 Jan 2016 13:40:05 -   1.10
+++ games/hangman/ksyms.c   15 Sep 2017 21:01:49 -
@@ -18,7 +18,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
Index: include/Makefile
===
RCS file: /cvs/src/include/Makefile,v
retrieving revision 1.219
diff -u -p -u -r1.219 Makefile
--- include/Makefile17 Apr 2017 15:53:21 -  1.219
+++ include/Makefile15 Sep 2017 21:04:50 -
@@ -11,7 +11,7 @@
 
 FILES= a.out.h ar.h asr.h assert.h bitstring.h blf.h bsd_auth.h \
complex.h cpio.h ctype.h curses.h db.h dirent.h disktab.h \
-   dlfcn.h elf_abi.h err.h errno.h fenv.h float.h fnmatch.h fstab.h fts.h \
+   dlfcn.h elf.h err.h errno.h fenv.h float.h fnmatch.h fstab.h fts.h \
ftw.h getopt.h glob.h grp.h icdb.h ieeefp.h ifaddrs.h inttypes.h \
iso646.h kvm.h langinfo.h libgen.h limits.h link.h link_elf.h \
locale.h login_cap.h math.h md5.h memory.h ndbm.h netdb.h netgroup.h \
Index: include/elf.h
===
RCS file: include/elf.h
diff -N include/elf.h
--- /dev/null   1 Jan 1970 00:00:00 -
+++ include/elf.h   15 Sep 2017 21:04:50 -
@@ -0,0 +1,33 @@
+/* $OpenBSD: elf.h,v 1.4 1996/05/22 07:46:22 etheisen Exp $*/
+/*
+ * Copyright (c) 1996 Erik Theisen
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _ELF_H_
+#define _ELF_H_
+
+#include 
+
+#endif /* _ELF_H_ */
Index: include/elf_abi.h
===
RCS file: include/elf_abi.h
diff -N include/elf_abi.h
--- include/elf_abi.h   22 May 1996 07:46:22 -  1.4
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,33 +0,0 @@
-/* $OpenBSD: elf_abi.h,v 1.4 1996/05/22 07:46:22 etheisen Exp $*/
-/*
- * Copyright (c) 1996 Erik Theisen
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *notice, this list of conditions and the following disclaimer in the
- *documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- *derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS 

Re: ptrace, copyin, uvm fault errno

2017-09-15 Thread Philip Guenther
On Fri, Sep 15, 2017 at 10:45 AM, Theo de Raadt  wrote:

> > On Sat, Sep 09, 2017 at 04:31:47PM -0700, Philip Guenther wrote:
> > > Currently on amd64, the copyin(9) family of calls will pass through the
> > > return value of uvm_fault() and thus return not just EFAULT but
> possibly
> > > EACCES, ENOMEM, and EIO.  Since the return value of those functions is
> > > usually passed through to userspace, that's a Bad Thing IMO and we
> need to
> > > fix them to always return EFAULT when uvm_fault() fails.
> >
> > Personally I prefer to see the real error number in user land.  It
> > makes it easier to track down the cause of problems if you know the
> > original errno.
>
> But that would change the errno return values from a vast number of
> system calls.  That feels like a huge departure from historical Unix.
>
> For instance, open(2) says:
>
>  [EFAULT]   path points outside the process's allocated address
> space.
>
> I think copyout should only return EFAULT, like it always did, so that
> the return values remain from such failures remain unchanged.
>

Right.  Do we really think it's going to be helpful to update stat(2) and
change this:

 [EACCES]   Search permission is denied for a component of the
path prefix.

To instead read:
 [EACCES]   Search permission is denied for a component of the
path prefix, or 'sb' points to memory that is
mapped but not writable.

As as both a user and developer, I think that makes my job debugging harder
as now I'm getting the same errno for two conditions, one of which is 100%
programmer error ("passed an unwritable pointer to stat()") and the other
of which is both data dependent and possibly legit and recoverable from
("search permission denied").  Program error and user error mixed in one
message just makes pointing the finger harder.


If I understand Philip, the occurance of other error numbers are just
> an artifacts of in-kernel implementation choices.
>

uvm_fault()'s return value itself propagates up in other internal kernel
interfaces (vslock(), physio(), ...) and controls whether a fatal userspace
page fault generates SIGSEGV or SIGKILL; the artifact here is amd64
ignoring what all the existing archs do and returning it to the copyin
family, a choice which goes back to r1.1


Philip Guenther


Re: ptrace, copyin, uvm fault errno

2017-09-15 Thread Theo de Raadt
> On Sat, Sep 09, 2017 at 04:31:47PM -0700, Philip Guenther wrote:
> > Currently on amd64, the copyin(9) family of calls will pass through the 
> > return value of uvm_fault() and thus return not just EFAULT but possibly 
> > EACCES, ENOMEM, and EIO.  Since the return value of those functions is 
> > usually passed through to userspace, that's a Bad Thing IMO and we need to 
> > fix them to always return EFAULT when uvm_fault() fails.
> 
> Personally I prefer to see the real error number in user land.  It
> makes it easier to track down the cause of problems if you know the
> original errno.

But that would change the errno return values from a vast number of
system calls.  That feels like a huge departure from historical Unix.

For instance, open(2) says:

 [EFAULT]   path points outside the process's allocated address
space.

I think copyout should only return EFAULT, like it always did, so that
the return values remain from such failures remain unchanged.

If I understand Philip, the occurance of other error numbers are just
an artifacts of in-kernel implementation choices.



ptrace, copyin, uvm fault errno

2017-09-15 Thread Alexander Bluhm
On Sat, Sep 09, 2017 at 04:31:47PM -0700, Philip Guenther wrote:
> Currently on amd64, the copyin(9) family of calls will pass through the 
> return value of uvm_fault() and thus return not just EFAULT but possibly 
> EACCES, ENOMEM, and EIO.  Since the return value of those functions is 
> usually passed through to userspace, that's a Bad Thing IMO and we need to 
> fix them to always return EFAULT when uvm_fault() fails.

Personally I prefer to see the real error number in user land.  It
makes it easier to track down the cause of problems if you know the
original errno.

Of course amd64 and i386 should behave identically.  Could we convert
i386 instead?  Are there arguments for always using EFAULT?

bluhm



Re: sysctl_int(), sysctl_struct() & MP work

2017-09-15 Thread Alexander Bluhm
On Wed, Sep 13, 2017 at 10:33:01AM +0200, Martin Pieuchot wrote:
> diff -u -p -r1.512 if.c
> --- net/if.c  22 Aug 2017 15:02:34 -  1.512
> +++ net/if.c  13 Sep 2017 08:28:27 -
> @@ -2666,10 +2666,14 @@ ifpromisc(struct ifnet *ifp, int pswitch
>   return ((*ifp->if_ioctl)(ifp, SIOCSIFFLAGS, (caddr_t)));
>  }
>  
> +/* XXX move to kern/uipc_mbuf.c */
>  int
>  sysctl_mq(int *name, u_int namelen, void *oldp, size_t *oldlenp,
>  void *newp, size_t newlen, struct mbuf_queue *mq)
>  {
> + unsigned int maxlen;
> + int error;
> +
>   /* All sysctl names at this level are terminal. */
>   if (namelen != 1)
>   return (ENOTDIR);
> @@ -2678,8 +2682,14 @@ sysctl_mq(int *name, u_int namelen, void
>   case IFQCTL_LEN:
>   return (sysctl_rdint(oldp, oldlenp, newp, mq_len(mq)));
>   case IFQCTL_MAXLEN:
> - return (sysctl_int(oldp, oldlenp, newp, newlen,
> - >mq_maxlen)); /* XXX directly accessing maxlen */
> + maxlen = mq->mq_maxlen;
> + error = sysctl_int(oldp, oldlenp, newp, newlen, );
> + if (!error && maxlen != mq->mq_maxlen) {
> + mtx_enter(>mq_mtx);
> + mq->mq_maxlen = maxlen;
> + mtx_leave(>mq_mtx);
> + }
> + return (error);
>   case IFQCTL_DROPS:
>   return (sysctl_rdint(oldp, oldlenp, newp, mq_drops(mq)));
>   default:

Is it safe to access int values that are used by more than one CPU
without lock or memory barrier?
- is it safe for all architectures?
- is it safe for reading?
- is it safe for writing?

mq_len(), mq_drops() and mq_set_maxlen() are provided as public
interfaces without lock.  This implies that it should be safe.

So you should use mq_set_maxlen() instead of using the mutex here.
If using this function without lock is wrong, the defines in mbuf.h
should be converted to functions with proper locking.

Checking "maxlen != mq->mq_maxlen" without lock and assigning
"mq->mq_maxlen = maxlen" with a mutex just looks wrong.  Reading
the old "maxlen = mq->mq_maxlen" without guarantee this is the value
that will be changed by the current CPU feels strange.

You can commit it anyway, it is not worse than before.

OK bluhm@



Re: Mention start, stop, restart, reload, and check in rcctl.8

2017-09-15 Thread Antoine Jacoutot
On Fri, Sep 15, 2017 at 10:16:22AM +0100, George Brown wrote:
> Arguably these options are fairly obvious but I was prompted by the fact
> that "check" is not mentioned in the man page and this differs from the
> nomenclature of "status" often used in other systems.
> 
> This is the first time I've sent a diff so I've gone for minimal change
> only mentioning these in the synopsis and have not expanded up these in
> the description. This is akin to the FreeBSD man page for service(8).
> Arguably the fact "reload" sends SIGHUP could be worth mentioning but as
> a sysadmin it's the behavior I'd be expecting anyway.

These are documented in rc.d(8).


> 
> diff --git usr.sbin/rcctl/rcctl.8 usr.sbin/rcctl/rcctl.8
> index cbce9623720..4188fd26f2c 100644
> --- usr.sbin/rcctl/rcctl.8
> +++ usr.sbin/rcctl/rcctl.8
> @@ -22,6 +22,9 @@
>  .Nd configure and control daemons and services
>  .Sh SYNOPSIS
>  .Nm rcctl
> +.Cm start Ns | Ns Cm stop Ns | Ns Cm restart Ns | Ns Cm reload Ns | Ns Cm 
> check
> +.Op Ar daemon ...
> +.Nm rcctl
>  .Cm get Ns | Ns Cm getdef Ns | Ns Cm set
>  .Ar service | daemon Op Ar variable Op Ar arguments
>  .Nm rcctl
> 

-- 
Antoine



Mention start, stop, restart, reload, and check in rcctl.8

2017-09-15 Thread George Brown
Arguably these options are fairly obvious but I was prompted by the fact
that "check" is not mentioned in the man page and this differs from the
nomenclature of "status" often used in other systems.

This is the first time I've sent a diff so I've gone for minimal change
only mentioning these in the synopsis and have not expanded up these in
the description. This is akin to the FreeBSD man page for service(8).
Arguably the fact "reload" sends SIGHUP could be worth mentioning but as
a sysadmin it's the behavior I'd be expecting anyway.

diff --git usr.sbin/rcctl/rcctl.8 usr.sbin/rcctl/rcctl.8
index cbce9623720..4188fd26f2c 100644
--- usr.sbin/rcctl/rcctl.8
+++ usr.sbin/rcctl/rcctl.8
@@ -22,6 +22,9 @@
 .Nd configure and control daemons and services
 .Sh SYNOPSIS
 .Nm rcctl
+.Cm start Ns | Ns Cm stop Ns | Ns Cm restart Ns | Ns Cm reload Ns | Ns Cm check
+.Op Ar daemon ...
+.Nm rcctl
 .Cm get Ns | Ns Cm getdef Ns | Ns Cm set
 .Ar service | daemon Op Ar variable Op Ar arguments
 .Nm rcctl



Re: Improve the accuracy of the TSC frequency calibration - Updated Patch

2017-09-15 Thread Jonathan Gray
On Thu, Sep 14, 2017 at 03:41:25PM +0200, Reyk Floeter wrote:
> 
> On Fri, Aug 25, 2017 at 12:43:44PM +0200, Mike Belopuhov wrote:
> > On Fri, Aug 25, 2017 at 00:40 -0700, Mike Larkin wrote:
> > > On Thu, Aug 24, 2017 at 12:39:33PM +0800, Adam Steen wrote:
> > > > On Thu, Aug 24, 2017 at 2:35 AM, Mike Larkin  
> > > > wrote:
> > > > > On Wed, Aug 23, 2017 at 09:29:15PM +0800, Adam Steen wrote:
> > > > >>
> > > > >> Thank you Mike on the feedback on the last patch, please see the diff
> > > > >> below, update with your input and style(9)
> > > > >>
> > > > >> I have continued to use tsc as my timecounter and /var/db/ntpd.driff
> > > > >> has stayed under 10.
> > > > >>
> > > > >> cat /var/db/ntpd.drift
> > > > >> 6.665
> > > > >>
> > > > >> ntpctl -s all
> > > > >> 4/4 peers valid, constraint offset -1s, clock synced, stratum 3
> > > > >>
> > > > >> peer
> > > > >>wt tl st  next  poll  offset   delay  jitter
> > > > >> 144.48.166.166 from pool pool.ntp.org
> > > > >> 1 10  24s   32s-3.159ms87.723ms10.389ms
> > > > >> 13.55.50.68 from pool pool.ntp.org
> > > > >> 1 10  3   11s   32s-3.433ms86.053ms18.095ms
> > > > >> 14.202.204.182 from pool pool.ntp.org
> > > > >> 1 10  1   14s   32s 1.486ms86.545ms16.483ms
> > > > >> 27.124.125.250 from pool pool.ntp.org
> > > > >>  *  1 10  2   12s   30s   -10.275ms54.156ms70.389ms
> > > > >>
> > > > >> Cheers
> > > > >> Adam
> > > > >
> > > > > IIRC you have an x220, right?
> > > > >
> > > > > If so, could you try letting the clock run for a bit (while using tsc
> > > > > timecounter selection) after apm -L to drop the speed? (make sure
> > > > > apm shows that it dropped).
> > > > >
> > > > > Even though my x230 supposedly has a constant/invar TSC (according to
> > > > > cpuid), the TSC drops from 2.5GHz to 1.2GHz when apm -L runs, which
> > > > > causes time to run too slowly when tsc is selected there.
> > > > >
> > > > > -ml
> > > > >
> > > >
> > > > Yes, x220
> > > > (bios: LENOVO version "8DET69WW (1.39 )" date 07/18/2013)
> > > > (cpu: Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz, 2491.91 MHz)
> > > >
> > > > I took some measurements to before starting the test.
> > > >
> > > > note: the laptop has been up for a few days with apm -A set via 
> > > > rc.conf.local
> > > > and sysctl kern.timecounter.hardware as tsc via sysctl.conf and mostly
> > > > idle.
> > > >
> > > > cat /var/db/ntpd.drift
> > > > 6.459
> > > >
> > > > apm -v
> > > > Battery state: high, 100% remaining, unknown life estimate
> > > > A/C adapter state: connected
> > > > Performance adjustment mode: auto (800 MHz)
> > > >
> > > > 6 hours ago i ran apm -L, verified it was running slowly (800 MHz),
> > > > and got the following results
> > > >
> > > > The clock appears correct (comparing to other computers)
> > > >
> > > > apm -v
> > > > Battery state: high, 100% remaining, unknown life estimate
> > > > A/C adapter state: connected
> > > > Performance adjustment mode: manual (800 MHz)
> > > >
> > > > cat /var/db/ntpd.drift
> > > > 6.385
> > > >
> > > > ntpctl -s all
> > > > 4/4 peers valid, constraint offset 0s, clock synced, stratum 4
> > > >
> > > > peer
> > > >wt tl st  next  poll  offset   delay  jitter
> > > > 203.23.237.200 from pool pool.ntp.org
> > > > 1 10  2  153s 1505s   -25.546ms73.450ms 2.644ms
> > > > 203.114.73.24 from pool pool.ntp.org
> > > > 1 10  2  253s 1560s-1.042ms75.133ms 0.752ms
> > > > 192.189.54.33 from pool pool.ntp.org
> > > >  *  1 10  2  204s 1558s31.644ms70.910ms 3.388ms
> > > > 54.252.165.245 from pool pool.ntp.org
> > > > 1 10  2  238s 1518s 0.146ms73.005ms 2.025ms
> > > >
> > > > I will leave the laptop in lower power mode over the weekend and see
> > > > what happens.
> > > >
> > >
> > > No need, I think you've convinced me that it works :)
> > 
> > But does it actually work on x230 as well?  I'm surprised to learn
> > that you've observed TSC frequency change on Ivy Bridge.  I was
> > under impression that everything since at least Sandy Bridge (x220)
> > has constant and invariant TSC as advertised.
> > 
> > Adam, I've readjusted and simplified your diff a bit.  The biggest
> > change is that we can select the reference tc based on it's quality
> > so there's no need to have acpitimer and acpihpet specific functions
> > and variables.
> > 
> > There's one big thing missing here: increasing the timecounter
> > quality so that OS can pick it.  Something like this:
> > 
> > https://github.com/mbelop/src/commit/99d6ef3ae95bbd8ea93c27e0425eb65e5a3359a1
> > 
> > I'd say we should try getting this in after 6.3 unlock unless there
> > are objections.  Further cleanup and testing is welcome of course.
> > 
> > 
> 
> I'd like to raise another point: as we figured out, the TSC frequency
> can be different than the CPU frequency on modern Intel CPUs.  The
> const+invar 

UPDATE: net/wifind 0.5 -> 0.7

2017-09-15 Thread Ray Lai
Hi ports,

Attached is a diff to update wifind to 0.7. This release merges
changes from and fixes bugs reported by qbit, iandarwin, and kpcyrd:

- support percentage-based signal strength reporting (iwm)
- support for interface descriptions
- don't die if we don't have an existing hostname.if
- don't validate empty wpakey

Thanks!

Index: Makefile
===
RCS file: /home/cvs/ports/net/wifind/Makefile,v
retrieving revision 1.3
diff -u -p -r1.3 Makefile
--- Makefile4 Jun 2016 20:08:47 -   1.3
+++ Makefile15 Sep 2017 07:14:10 -
@@ -4,7 +4,7 @@ COMMENT=wifi automagic connector
 
 GH_ACCOUNT=raylai
 GH_PROJECT=wifind
-GH_TAGNAME=0.5
+GH_TAGNAME=0.7
 
 CATEGORIES=net
 
Index: distinfo
===
RCS file: /home/cvs/ports/net/wifind/distinfo,v
retrieving revision 1.2
diff -u -p -r1.2 distinfo
--- distinfo4 Jun 2016 15:58:10 -   1.2
+++ distinfo15 Sep 2017 07:14:25 -
@@ -1,2 +1,2 @@
-SHA256 (wifind-0.5.tar.gz) = OMAKolOf3Z+kdV+z6Ra/wcl9+7UyrCdYfLaEzuLDCnI=
-SIZE (wifind-0.5.tar.gz) = 3482
+SHA256 (wifind-0.7.tar.gz) = 1N7WPmlJj18QPOJ2Gl93Eb076R69A/BY/t2uhav9wHM=
+SIZE (wifind-0.7.tar.gz) = 3646