svn commit: r358905 - stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2020-03-11 Thread Alexander Motin
Author: mav
Date: Thu Mar 12 03:59:51 2020
New Revision: 358905
URL: https://svnweb.freebsd.org/changeset/base/358905

Log:
  MFC r358683: Remove vfs.zfs.top_maxinflight tunable/sysctl.
  
  It is dead since sorted scrub import at r334844.

Modified:
  stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
==
--- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Thu Mar 
12 03:56:54 2020(r358904)
+++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Thu Mar 
12 03:59:51 2020(r358905)
@@ -137,12 +137,6 @@ extern int zfs_vdev_async_write_active_min_dirty_perce
  */
 int zfs_scan_strict_mem_lim = B_FALSE;
 
-/*
- * Maximum number of parallelly executing I/Os per top-level vdev.
- * Tune with care. Very high settings (hundreds) are known to trigger
- * some firmware bugs and resets on certain SSDs.
- */
-int zfs_top_maxinflight = 32;  /* maximum I/Os per top-level */
 unsigned int zfs_resilver_delay = 2;   /* number of ticks to delay resilver -- 
2 is a good number */
 unsigned int zfs_scrub_delay = 4;  /* number of ticks to delay scrub -- 4 
is a good number */
 unsigned int zfs_scan_idle = 50;   /* idle window in clock ticks */
@@ -186,8 +180,6 @@ boolean_t zfs_no_scrub_io = B_FALSE; /* set to disable
 boolean_t zfs_no_scrub_prefetch = B_FALSE; /* set to disable scrub prefetch */
 
 SYSCTL_DECL(_vfs_zfs);
-SYSCTL_UINT(_vfs_zfs, OID_AUTO, top_maxinflight, CTLFLAG_RWTUN,
-_top_maxinflight, 0, "Maximum I/Os per top-level vdev");
 SYSCTL_UINT(_vfs_zfs, OID_AUTO, resilver_delay, CTLFLAG_RWTUN,
 _resilver_delay, 0, "Number of ticks to delay resilver");
 SYSCTL_UINT(_vfs_zfs, OID_AUTO, scrub_delay, CTLFLAG_RWTUN,
@@ -1538,7 +1530,6 @@ dsl_scan_prefetch_thread(void *arg)
dsl_scan_t *scn = arg;
spa_t *spa = scn->scn_dp->dp_spa;
vdev_t *rvd = spa->spa_root_vdev;
-   uint64_t maxinflight = rvd->vdev_children * zfs_top_maxinflight;
scan_prefetch_issue_ctx_t *spic;
 
/* loop until we are told to stop */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r358904 - head/usr.sbin/services_mkdb

2020-03-11 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Mar 12 03:56:54 2020
New Revision: 358904
URL: https://svnweb.freebsd.org/changeset/base/358904

Log:
  style(9): Fix space after #define.
  
  No functional change.

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

Modified: head/usr.sbin/services_mkdb/services_mkdb.c
==
--- head/usr.sbin/services_mkdb/services_mkdb.c Thu Mar 12 03:03:38 2020
(r358903)
+++ head/usr.sbin/services_mkdb/services_mkdb.c Thu Mar 12 03:56:54 2020
(r358904)
@@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$");
 static char tname[MAXPATHLEN];
 
 #definePMASK   0x
-#define PROTOMAX   6
+#definePROTOMAX6
 
 static voidadd(DB *, StringList *, size_t, const char *, size_t *, int);
 static StringList ***parseservices(const char *, StringList *);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r358891 - head/share/man/man5

2020-03-11 Thread Ed Maste
On Wed, 11 Mar 2020 at 16:42, Ian Lepore  wrote:
>
> Well, my point is that it looked better because there were 3 extra
> spaces, so you can get that spacing by adding 3 extra chars to the
> column headings in the .Bl line.  They don't have be "Sy " at the
> front, I think just spaces at the end of each heading (inside the
> quotes) would do it.

Oh, good point - thanks. Intentional extra space to improve the
rendered output would be better than an unintended side effect, but
anyhow I think it's not worth changing it again.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r358903 - in stable/11: etc usr.sbin/services_mkdb

2020-03-11 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Mar 12 03:03:38 2020
New Revision: 358903
URL: https://svnweb.freebsd.org/changeset/base/358903

Log:
  MFC r358154 (by delphij)
  Bump PROTOMAX: this matches the value on NetBSD and will be necessary for
  future updates.
  
  MFC r358448; (--ignore-ancestry due to merge conflicts)
  /etc/services: attempt to bring the database to this century.
  
  This is the result of splitting r358153 in two, in order to avoid a build
  system bug and being able to merge the change to previous releases..
  
  Document better this file, updating the URL to the IANA registry and closely
  match the official services.
  
  For system ports (0 to 1023) we now try to follow the registry closely, noting
  some historical differences where applicable.
  
  As a side effect: drop references to unofficial Kerberos IV which was EOL'ed
  on Oct 2006[1]. While it is conceivable some people may still use it in some
  very old FreeBSD machines that can't be replaced easily, the use of it is
  considered a security risk. Also drop the unofficial netatalk, which we
  supported long ago in the kernel but was dropped long ago.
  
  Leave for now smtps, even though it conflicts with IANA's submissions.
  The change should have very little visibility, if any, but should be a
  step closer to the current IANA database.
  
  [1] https://web.mit.edu/kerberos/krb4-end-of-life.html

Modified:
  stable/11/etc/services
  stable/11/usr.sbin/services_mkdb/services_mkdb.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/services
==
--- stable/11/etc/services  Wed Mar 11 23:34:44 2020(r358902)
+++ stable/11/etc/services  Thu Mar 12 03:03:38 2020(r358903)
@@ -1,65 +1,62 @@
 #
 # Network services, Internet style
 #
-# Note that it is presently the policy of IANA to assign a single well-known
-# port number for both TCP and UDP; hence, most entries here have two entries
-# even if the protocol doesn't support UDP operations.
+# Service names and port numbers are used to distinguish between different
+# services that run over transport protocols such as TCP, UDP, DCCP, and
+# SCTP.
 #
 # The latest IANA port assignments can be gotten from
 #
-#  http://www.iana.org/assignments/port-numbers
+#  https://www.iana.org/assignments/service-names-port-numbers/
 #
-# The Well Known Ports are those from 0 through 1023.
-# The Registered Ports are those from 1024 through 49151
-# The Dynamic and/or Private Ports are those from 49152 through 65535
+# System Ports are those from 0 through 1023.
+# User Ports are those from 1024 through 49151.
+# Dynamic and/or Private Ports are those from 49152 through 65535.
 #
-# Kerberos services are for Kerberos v4, and are unofficial.  Sites running
-# v5 should uncomment v5 entries and comment v4 entries.
+# Note that it is presently the policy of IANA to assign a single well-known
+# port number for both TCP and UDP; hence, most entries here have two entries
+# even if the protocol doesn't support UDP operations.
 #
 # $FreeBSD$
 #  From: @(#)services  5.8 (Berkeley) 5/9/91
 #
 # WELL KNOWN PORT NUMBERS
 #
-rtmp 1/ddp#Routing Table Maintenance Protocol
 tcpmux   1/tcp#TCP Port Service Multiplexer
 tcpmux   1/udp#TCP Port Service Multiplexer
-nbp  2/ddp#Name Binding Protocol
 compressnet  2/tcp#Management Utility
 compressnet  2/udp#Management Utility
 compressnet  3/tcp#Compression Process
 compressnet  3/udp#Compression Process
-echo 4/ddp#AppleTalk Echo Protocol
 rje  5/tcp#Remote Job Entry
 rje  5/udp#Remote Job Entry
-zip  6/ddp#Zone Information Protocol
-echo 7/sctp
 echo 7/tcp
 echo 7/udp
-discard  9/sctp   sink null
+echo 7/sctp
 discard  9/tcpsink null
 discard  9/udpsink null
+discard  9/sctp   sink null
 systat  11/tcpusers#Active Users
 systat  11/udpusers#Active Users
-daytime 13/sctp
 daytime 13/tcp
 daytime 13/udp
+daytime 13/sctp
 qotd17/tcpquote#Quote of the Day
 qotd17/udpquote#Quote of the Day
 msp 18/tcp#Message Send Protocol
 msp 18/udp#Message Send Protocol
-chargen 19/sctp   ttytst source#Character Generator
 chargen 19/tcpttytst source#Character Generator
 chargen 19/udpttytst source#Character Generator
-ftp-data20/sctp   #File Transfer [Default Data]
+chargen 19/sctp   ttytst source#Character Generator
 ftp-data20/tcp#File Transfer [Default Data]
 ftp-data

Re: svn commit: r358733 - head/sys/sys

2020-03-11 Thread Mateusz Guzik
On 3/10/20, Konstantin Belousov  wrote:
> On Tue, Mar 10, 2020 at 12:22:09AM +0100, Mateusz Guzik wrote:
>> On 3/9/20, Konstantin Belousov  wrote:
>> > On Mon, Mar 09, 2020 at 01:56:17AM +0100, Mateusz Guzik wrote:
>> >> On 3/8/20, Mateusz Guzik  wrote:
>> >> > Author: mjg
>> >> > Date: Sun Mar  8 00:22:32 2020
>> >> > New Revision: 358733
>> >> > URL: https://svnweb.freebsd.org/changeset/base/358733
>> >> >
>> >> > Log:
>> >> >   seqc: tidy up
>> >> >
>> >> >   - avoid hand-rolled read
>> >> >   - match begin/end in terms of fence style
>> >> >
>> >>
>> >> There were off lists questions about this so let me clarify.
>> >>
>> >> The first bit is a cosmetic change, but the second one is not.
>> >>
>> >> > Modified:
>> >> >   head/sys/sys/seqc.h
>> >> >
>> >> > Modified: head/sys/sys/seqc.h
>> >> > ==
>> >> > --- head/sys/sys/seqc.h Sat Mar  7 15:37:23 2020(r358732)
>> >> > +++ head/sys/sys/seqc.h Sun Mar  8 00:22:32 2020(r358733)
>> >> > @@ -66,7 +66,8 @@ static __inline void
>> >> >  seqc_write_end(seqc_t *seqcp)
>> >> >  {
>> >> >
>> >> > -   atomic_store_rel_int(seqcp, *seqcp + 1);
>> >> > +   atomic_thread_fence_rel();
>> >> > +   *seqcp += 1;
>> >> > MPASS(!seqc_in_modify(*seqcp));
>> >> > critical_exit();
>> >> >  }
>> >>
>> >> For correct operation the counter has to be modified *before* any work
>> >> is done and *after* it is completed.
>> >>
>> >> Consider a trivial case:
>> >> seqc++;
>> >> foo[0] = 0;
>> >> foo[1] = 1;
>> >> seqc++;
>> >>
>> >> There are 2 ways in which this can be mucked with:
>> >> - the compiler can be looking at reordering or reworking the increment
>> >> (e.g., to collapse it to just += 2 instead). a compiler barrier
>> >> prevents that.
>> >> - even with generated machine code which increments in correct places
>> >> the cpu can be looking at reordering the operation (which is heavily
>> >> dependent on architecture), in particular it could end up issuing
>> >> seqc++; foo[1] = 1; which would defeat the point. This is where
>> >> release fences come in.
>> >>
>> >> With the patched code there is:
>> >> seqc++;
>> >> atomic_thread_fence_rel(); /* make sure seqc++ is issued before foo
>> >> starts getting modified */
>> >> foo[0] = 0;
>> >> foo[1] = 1;
>> >> atomic_thread_fence_rel(); /* make sure modifications to foo don't
>> >> leak past this spot */
>> >> seqc++;
>> >>
>> >> In comparison, the previous code was:
>> >> seqc++;
>> >> atomic_thread_fence_rel(); /* make sure seqc++ is issued before foo
>> >> starts getting modified */
>> >> foo[0] = 0;
>> >> foo[1] = 1;
>> >> atomic_store_rel_int(seqcp, *seqcp + 1); /* make sure modifications to
>> >> too don't leak past this spot and update seqc immediately */
>> >>
>> >> There are 2 differences here -- one is an improvement and second one
>> >> does not matter:
>> >> the win is: the previous code forces the compiler to compute an
>> >> incremented value and then store it. On amd64 this translates to the
>> >> following (with rdx holding the address of the counter):
>> >>
>> >> mov(%rdx),%eax /* load the value */
>> >> add$0x1,%eax/* add 1 */
>> >> mov%eax,(%rdx) /* store it */
>> >>
>> >> On patched kernel this is:
>> >> addl   $0x1,(%rdx)
>> >>
>> >> which is clearly much nicer.
>> > I am not sure that the new code on amd64 is much nicer.
>> >
>> > But the point was that on non-amd64, i.e. armv8 and potentially on
>> > powerpc 3.0, the patch substitutes release store with full barrier. The
>> > later is (much) slower.
>> >
>>
>> If an arch performs something significantly more expensive here it's
>> probably a performance bug in the port.
> It is a question of how much hardware support for fine-grained fences.
> Relaxed architectures add some optimized operations already, but did not
> (yet) implemented complete C11 optimized set.
> I think they eventually converge.
>
> Until they did not, I think it is more important to not pessimize
> to-be Tier1 arches than to collapse three fast integer instructions
> on amd64 into one rw op.
>
>> But perhaps more importantly
>> there are significantly more frequent users of
>> atomic_thread_fence_rel, like refcount(9). If the issue is real that
>> should be looked at.
> For refcount(9) use of release fence removal, we would need
>   atomic_fetchadd_rel_int().
>

To reiterate, if atomic_thread_fence_rel is indeed very expensive on
certain architectures compared to other _rel variants, the kernel is
already heavily pessimized because of use of said standalone fence in
refcount(9) and few other places and this needs to be fixed.

If the cost can't be reduced (e.g., perhaps this can do a no-op store
+ fence somewhere akin to how lock xadd 0,(%esp) trickery used to
work), then the atomic APIs do indeed not to be completed w.r.t.
adding all the missing acq/rel variants (that's at least fetchadd and
swap).

We can also extend the API to do relevant 

svn commit: r358902 - head/lib/libc/powerpc64/string

2020-03-11 Thread Brandon Bergren
Author: bdragon
Date: Wed Mar 11 23:34:44 2020
New Revision: 358902
URL: https://svnweb.freebsd.org/changeset/base/358902

Log:
  Fix r358688 -- Remember to actually save r3 before processing.
  
  Crash was noticed by pkubaj building gcc9.
  
  Apparently non dword-aligned char pointers are somewhat rare in the wild.
  
  Reported by:  pkubaj
  Sponsored by: Tag1 Consulting, Inc.

Modified:
  head/lib/libc/powerpc64/string/memcpy.S

Modified: head/lib/libc/powerpc64/string/memcpy.S
==
--- head/lib/libc/powerpc64/string/memcpy.S Wed Mar 11 22:25:45 2020
(r358901)
+++ head/lib/libc/powerpc64/string/memcpy.S Wed Mar 11 23:34:44 2020
(r358902)
@@ -58,8 +58,8 @@ ENTRY(FN_NAME)
andi.   %r7, %r4, ALIGN_MASK
cmpd%r8, %r7
mr  %r7, %r5
-   bne .Lcopy_remaining_fix_index_byte
mr  %r8, %r3/* save dst */
+   bne .Lcopy_remaining_fix_index_byte
 
/* align src */
 .Lalignment_loop:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r358901 - head/sys/vm

2020-03-11 Thread Jeff Roberson
Author: jeff
Date: Wed Mar 11 22:25:45 2020
New Revision: 358901
URL: https://svnweb.freebsd.org/changeset/base/358901

Log:
  Check for busy or wired in vm_page_relookup().  Some callers will only keep
  a page wired and expect it to still be present.
  
  Reported by:  delp...@freebsd.org
  Reviewed by:  kib

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Wed Mar 11 22:05:41 2020(r358900)
+++ head/sys/vm/vm_page.c   Wed Mar 11 22:25:45 2020(r358901)
@@ -1672,7 +1672,7 @@ vm_page_relookup(vm_object_t object, vm_pindex_t pinde
vm_page_t m;
 
m = vm_radix_lookup_unlocked(>rtree, pindex);
-   KASSERT(m != NULL && vm_page_busied(m) &&
+   KASSERT(m != NULL && (vm_page_busied(m) || vm_page_wired(m)) &&
m->object == object && m->pindex == pindex,
("vm_page_relookup: Invalid page %p", m));
return (m);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r326052 - head/usr.bin/gzip

2020-03-11 Thread Xin Li
On 3/10/20 18:26, Conrad Meyer wrote:
> Hi Xin Li,
> 
> Sorry to reply to an old commit.
> 
> On Tue, Nov 21, 2017 at 12:14 AM Xin LI  wrote:
>>
>> Author: delphij
>> Date: Tue Nov 21 08:14:30 2017
>> New Revision: 326052
>> URL: https://svnweb.freebsd.org/changeset/base/326052
>>
>> Log:
>>   Support SIGINFO.
>> ...
>> --- head/usr.bin/gzip/unpack.c  Tue Nov 21 07:35:29 2017(r326051)
>> +++ head/usr.bin/gzip/unpack.c  Tue Nov 21 08:14:30 2017(r326052)
>> ...
>> @@ -152,6 +155,9 @@ unpack_parse_header(int in, int out, char *pre, size_t
>> ssize_t bytesread;  /* Bytes read from the file */
>> int i, j, thisbyte;
>>
>> +   if (prelen > sizeof hdr)
>> +   maybe_err("prelen too long");
> 
> This check should perhaps be >=, rather than >.
> 
>> +
>> /* Prepend the header buffer if we already read some data */
>> if (prelen != 0)
>> memcpy(hdr, pre, prelen);
>> @@ -160,6 +166,7 @@ unpack_parse_header(int in, int out, char *pre, size_t
>> bytesread = read(in, hdr + prelen, PACK_HEADER_LENGTH - prelen);
> 
> In the case where prelen == sizeof(hdr), we invoke read(, pointer past
> end of hdr, 0) above.  This should have no effect, but looks
> unintended, and tickles Coverity (CID 1383554).

Thanks for the analysis.  It seems that this is a false positive because
the situation can never happen with the current code (the passed prelen
has to be either 0 or 4).

I've created a changeset at: https://reviews.freebsd.org/D24034 to
address it.

Cheers,





signature.asc
Description: OpenPGP digital signature


svn commit: r358899 - in head: lib/libc/sys sys/ufs/ffs

2020-03-11 Thread Kirk McKusick
Author: mckusick
Date: Wed Mar 11 21:00:40 2020
New Revision: 358899
URL: https://svnweb.freebsd.org/changeset/base/358899

Log:
  When mounting a UFS filesystem, return EINTEGRITY rather than EIO
  when a superblock check-hash error is detected. This change clarifies
  a mount that failed due to media hardware failures (EIO) from a mount
  that failed due to media errors (EINTEGRITY) that can be corrected by
  running fsck(8).
  
  Sponsored by: Netflix

Modified:
  head/lib/libc/sys/mount.2
  head/sys/ufs/ffs/ffs_subr.c

Modified: head/lib/libc/sys/mount.2
==
--- head/lib/libc/sys/mount.2   Wed Mar 11 20:40:24 2020(r358898)
+++ head/lib/libc/sys/mount.2   Wed Mar 11 21:00:40 2020(r358899)
@@ -307,6 +307,10 @@ No space remains in the mount table.
 .It Bq Er EINVAL
 The super block for the file system had a bad magic
 number or an out of range block size.
+.It Bq Er EINTEGRITY
+The super block for the file system had a bad check hash.
+The check hash can usually be corrected by running
+.Xr fsck 8 .
 .It Bq Er ENOMEM
 Not enough memory was available to read the cylinder
 group information for the file system.

Modified: head/sys/ufs/ffs/ffs_subr.c
==
--- head/sys/ufs/ffs/ffs_subr.c Wed Mar 11 20:40:24 2020(r358898)
+++ head/sys/ufs/ffs/ffs_subr.c Wed Mar 11 21:00:40 2020(r358899)
@@ -416,7 +416,7 @@ readsuper(void *devfd, struct fs **fsp, off_t sblocklo
return (0);
}
fs->fs_fmod = 0;
-   return (EINVAL);
+   return (EINTEGRITY);
}
/* Have to set for old filesystems that predate this field */
fs->fs_sblockactualloc = sblockloc;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r358891 - head/share/man/man5

2020-03-11 Thread Ian Lepore
On Wed, 2020-03-11 at 16:37 -0400, Ed Maste wrote:
> On Wed, 11 Mar 2020 at 16:27, Ian Lepore  wrote:
> > 
> > With, there are 3 extra spaces.  "Sy ".
> 
> Right, I mean the extraneous Sy had the side effect of improving (in
> my opinion) the rendered table. Anyhow, they're removed now.

Well, my point is that it looked better because there were 3 extra
spaces, so you can get that spacing by adding 3 extra chars to the
column headings in the .Bl line.  They don't have be "Sy " at the
front, I think just spaces at the end of each heading (inside the
quotes) would do it.

-- Ian

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


svn commit: r358898 - head/share/man/man7

2020-03-11 Thread Ed Maste
Author: emaste
Date: Wed Mar 11 20:40:24 2020
New Revision: 358898
URL: https://svnweb.freebsd.org/changeset/base/358898

Log:
  arch.7: remove extraneous markup from header table sizing
  
  Reported by:  0mp (in response to r358891)

Modified:
  head/share/man/man7/arch.7

Modified: head/share/man/man7/arch.7
==
--- head/share/man/man7/arch.7  Wed Mar 11 20:23:36 2020(r358897)
+++ head/share/man/man7/arch.7  Wed Mar 11 20:40:24 2020(r358898)
@@ -87,7 +87,7 @@ This table shows the first
 release to support each architecture, and, for discontinued
 architectures, the final release.
 .Pp
-.Bl -column -offset indent "Sy Architecture" "Sy Initial Release" "Sy Final 
Release"
+.Bl -column -offset indent "Architecture" "Initial Release" "Final Release"
 .It Sy Architecture Ta Sy Initial Release Ta Sy Final Release
 .It aarch64 Ta 11.0
 .It alpha   Ta 3.2   Ta 6.4
@@ -150,7 +150,7 @@ execution environment is accompanied by the
 .Dv ILP32
 environment, which was the historical 32-bit predecessor for 64-bit evolution.
 Examples are:
-.Bl -column -offset indent "Dv powerpc64" "Sy ILP32 counterpart"
+.Bl -column -offset indent "powerpc64" "ILP32 counterpart"
 .It Sy LP64Ta Sy ILP32 counterpart
 .It Dv amd64   Ta Dv i386
 .It Dv powerpc64   Ta Dv powerpc
@@ -188,7 +188,7 @@ Most ILP32 ABIs, except
 require only 4-byte alignment for 64-bit integers.
 .Pp
 Machine-dependent type sizes:
-.Bl -column -offset indent "Sy Architecture" "Sy void *" "Sy long double" "Sy 
time_t"
+.Bl -column -offset indent "Architecture" "void *" "long double" "time_t"
 .It Sy Architecture Ta Sy void * Ta Sy long double Ta Sy time_t
 .It aarch64 Ta 8 Ta 16 Ta 8
 .It amd64   Ta 8 Ta 16 Ta 8
@@ -214,7 +214,7 @@ Machine-dependent type sizes:
 .Sy time_t
 is 8 bytes on all supported architectures except i386.
 .Ss Endianness and Char Signedness
-.Bl -column -offset indent "Sy Architecture" "Sy Endianness" "Sy char 
Signedness"
+.Bl -column -offset indent "Architecture" "Endianness" "char Signedness"
 .It Sy Architecture Ta Sy Endianness Ta Sy char Signedness
 .It aarch64 Ta little Ta unsigned
 .It amd64   Ta little Ta   signed
@@ -237,7 +237,7 @@ is 8 bytes on all supported architectures except i386.
 .It riscv64sf   Ta little Ta   signed
 .El
 .Ss Page Size
-.Bl -column -offset indent "Sy Architecture" "Sy Page Sizes"
+.Bl -column -offset indent "Architecture" "Page Sizes"
 .It Sy Architecture Ta Sy Page Sizes
 .It aarch64 Ta 4K, 2M, 1G
 .It amd64   Ta 4K, 2M, 1G
@@ -260,7 +260,7 @@ is 8 bytes on all supported architectures except i386.
 .It riscv64sf   Ta 4K
 .El
 .Ss Floating Point
-.Bl -column -offset indent "Sy Architecture" "Sy float, double" "Sy long 
double"
+.Bl -column -offset indent "Architecture" "float, double" "long double"
 .It Sy Architecture Ta Sy float, double Ta Sy long double
 .It aarch64 Ta hard Ta soft, quad precision
 .It amd64   Ta hard Ta hard, 80 bit
@@ -295,7 +295,7 @@ and Binutils
 .Xr ld 1 ,
 or an external toolchain compiler and linker provided by a port or package.
 This table shows the default tool chain for each architecture.
-.Bl -column -offset indent "Sy Architecture" "Sy Compiler" "Sy Linker"
+.Bl -column -offset indent "Architecture" "Compiler" "Linker"
 .It Sy Architecture Ta Sy Compiler Ta Sy Linker
 .It aarch64 Ta Clang Ta lld
 .It amd64   Ta Clang Ta lld
@@ -352,7 +352,7 @@ cc -x c -dM -E /dev/null
 .Ed
 .Pp
 Common type size and endianness macros:
-.Bl -column -offset indent "BYTE_ORDER" "Sy Meaning"
+.Bl -column -offset indent "BYTE_ORDER" "Meaning"
 .It Sy Macro Ta Sy Meaning
 .It Dv __LP64__ Ta 64-bit (8-byte) long and pointer, 32-bit (4-byte) int
 .It Dv __ILP32__ Ta 32-bit (4-byte) int, long and pointer
@@ -363,7 +363,7 @@ is not used on
 .El
 .Pp
 Architecture-specific macros:
-.Bl -column -offset indent "Sy Architecture" "Sy Predefined macros"
+.Bl -column -offset indent "Architecture" "Predefined macros"
 .It Sy Architecture Ta Sy Predefined macros
 .It aarch64 Ta Dv __aarch64__
 .It amd64   Ta Dv __amd64__, Dv __x86_64__
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r358891 - head/share/man/man5

2020-03-11 Thread Ed Maste
On Wed, 11 Mar 2020 at 16:27, Ian Lepore  wrote:
>
> With, there are 3 extra spaces.  "Sy ".

Right, I mean the extraneous Sy had the side effect of improving (in
my opinion) the rendered table. Anyhow, they're removed now.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r358891 - head/share/man/man5

2020-03-11 Thread Ian Lepore
On Wed, 2020-03-11 at 16:01 -0400, Ed Maste wrote:
> On Wed, 11 Mar 2020 at 15:07, Mateusz Piotrowski <0...@freebsd.org>
> wrote:
> > 
> > Hi,
> > 
> > On 3/11/20 7:15 PM, Ed Maste wrote:
> > > Author: emaste
> > > Date: Wed Mar 11 18:15:18 2020
> > > New Revision: 358891
> > > URL: https://svnweb.freebsd.org/changeset/base/358891
> > > 
> > > Log:
> > >elf.5: start documenting ELF note sections
> > 
> > ...
> > > Modified: head/share/man/man5/elf.5
> > > =
> > > =
> > > --- head/share/man/man5/elf.5 Wed Mar 11 15:12:31
> > > 2020(r358890)
> > > +++ head/share/man/man5/elf.5 Wed Mar 11 18:15:18
> > > 2020(r358891)
> > > @@ -24,7 +24,7 @@
> > 
> > ...
> > > +.Bl -column -offset indent "Sy Field" "Sy Size" "Sy Description"
> > 
> > The "Sy" macros can be dropped from those strings specifying the
> > width
> > of columns. They are not expanded there anyway.
> 
> Interesting, thanks for the note. I probably copied them from arch.7,
> so it might need similar treatment.
> 
> They did have a side-effect of putting more space between columns
> though; with extra Sy:
> 
>Field   Size   Description
>namesz  32 bitsSize of name
>descsz  32 bitsSize of desc
>type32 bitsOS-dependent note type
>namenamesz Null-terminated originator name
>descdescsz OS-dependent note data
> 
> Without:
> 
>FieldSizeDescription
>namesz   32 bits Size of name
>descsz   32 bits Size of desc
>type 32 bits OS-dependent note type
>name namesz  Null-terminated originator name
>desc descsz  OS-dependent note data

With, there are 3 extra spaces.  "Sy ".

-- Ian

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


svn commit: r358897 - head/share/man/man4

2020-03-11 Thread Bjoern A. Zeeb
Author: bz
Date: Wed Mar 11 20:23:36 2020
New Revision: 358897
URL: https://svnweb.freebsd.org/changeset/base/358897

Log:
  Correctly spell TUNABLES.

Modified:
  head/share/man/man4/liquidio.4

Modified: head/share/man/man4/liquidio.4
==
--- head/share/man/man4/liquidio.4  Wed Mar 11 20:20:21 2020
(r358896)
+++ head/share/man/man4/liquidio.4  Wed Mar 11 20:23:36 2020
(r358897)
@@ -77,7 +77,7 @@ LiquidIO II CN2350 210SV/225SV
 .It
 LiquidIO II CN2360 210SV/225SV
 .El
-.Sh LOADER TUBABLES
+.Sh LOADER TUNABLES
 Tunables can be set at the
 .Xr loader 8
 prompt before booting the kernel or stored in
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r358895 - head/sys/dev/usb/input

2020-03-11 Thread Vladimir Kondratyev
Author: wulf
Date: Wed Mar 11 20:05:49 2020
New Revision: 358895
URL: https://svnweb.freebsd.org/changeset/base/358895

Log:
  wmt(4): Reapply r358872 (by hselasky) modified to use
  maximal input report size instead of wMaxPacketSize.
  
  If the USB frame length is set to 1024 bytes, WMT_BSIZE, the EETI controller
  will pack multiple touch events in the packet and the current code will only
  process the first touch event.
  
  As a result some important events are lost like releasing the finger from the
  touchscreen.
  
  Use the maximal input report size as buffer size instead.
  
  PR:   244718
  Tested by:Oskar Holmlund , wulf
  MFC after:3 days
  Discussed with:   hselasky

Modified:
  head/sys/dev/usb/input/wmt.c

Modified: head/sys/dev/usb/input/wmt.c
==
--- head/sys/dev/usb/input/wmt.cWed Mar 11 20:05:06 2020
(r358894)
+++ head/sys/dev/usb/input/wmt.cWed Mar 11 20:05:49 2020
(r358895)
@@ -201,6 +201,7 @@ struct wmt_softc
uint32_tcaps;
uint32_tisize;
uint32_tnconts_max;
+   uint32_treport_len;
uint8_t report_id;
 
struct hid_location cont_max_loc;
@@ -492,10 +493,11 @@ wmt_intr_callback(struct usb_xfer *xfer, usb_error_t e
 
DPRINTFN(6, "sc=%p actlen=%d\n", sc, len);
 
-   if (len >= (int)sc->isize || (len > 0 && sc->report_id != 0)) {
+   if (len >= (int)sc->report_len ||
+   (len > 0 && sc->report_id != 0)) {
/* Limit report length to the maximum */
-   if (len > (int)sc->isize)
-   len = sc->isize;
+   if (len > (int)sc->report_len)
+   len = sc->report_len;
 
usbd_copy_out(pc, 0, buf, len);
 
@@ -504,8 +506,8 @@ wmt_intr_callback(struct usb_xfer *xfer, usb_error_t e
goto tr_ignore;
 
/* Make sure we don't process old data */
-   if (len < sc->isize)
-   bzero(buf + len, sc->isize - len);
+   if (len < sc->report_len)
+   bzero(buf + len, sc->report_len - len);
 
/* Strip leading "report ID" byte */
if (sc->report_id) {
@@ -521,7 +523,7 @@ tr_ignore:
 
case USB_ST_SETUP:
 tr_setup:
-   usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer));
+   usbd_xfer_set_frame_len(xfer, 0, sc->isize);
usbd_transfer_submit(xfer);
break;
default:
@@ -807,7 +809,9 @@ wmt_hid_parse(struct wmt_softc *sc, const void *d_ptr,
sc->ai[WMT_ORIENTATION].max = 1;
}
 
-   sc->isize = wmt_hid_report_size(d_ptr, d_len, hid_input, report_id);
+   sc->isize = hid_report_size(d_ptr, d_len, hid_input, NULL);
+   sc->report_len = wmt_hid_report_size(d_ptr, d_len, hid_input,
+   report_id);
sc->cont_max_rlen = wmt_hid_report_size(d_ptr, d_len, hid_feature,
cont_max_rid);
if (thqa_cert_rid > 0)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r358894 - head/share/man/man5

2020-03-11 Thread Ed Maste
Author: emaste
Date: Wed Mar 11 20:05:06 2020
New Revision: 358894
URL: https://svnweb.freebsd.org/changeset/base/358894

Log:
  Remove extra Sy from table header
  
  Reported by:  0mp

Modified:
  head/share/man/man5/elf.5

Modified: head/share/man/man5/elf.5
==
--- head/share/man/man5/elf.5   Wed Mar 11 19:59:29 2020(r358893)
+++ head/share/man/man5/elf.5   Wed Mar 11 20:05:06 2020(r358894)
@@ -1278,7 +1278,7 @@ stored into the relocatable field.
 .El
 .Ss Note Section
 ELF note sections consist of entries with the following format.
-.Bl -column -offset indent "Sy Field" "Sy Size" "Sy Description"
+.Bl -column -offset indent "Field" "Size" "Description"
 .It Sy Field Ta Sy Size Ta Sy Description
 .It namesz   Ta 32 bits Ta Size of "name"
 .It descsz   Ta 32 bits Ta Size of "desc"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r358891 - head/share/man/man5

2020-03-11 Thread Ed Maste
On Wed, 11 Mar 2020 at 15:07, Mateusz Piotrowski <0...@freebsd.org> wrote:
>
> Hi,
>
> On 3/11/20 7:15 PM, Ed Maste wrote:
> > Author: emaste
> > Date: Wed Mar 11 18:15:18 2020
> > New Revision: 358891
> > URL: https://svnweb.freebsd.org/changeset/base/358891
> >
> > Log:
> >elf.5: start documenting ELF note sections
> ...
> > Modified: head/share/man/man5/elf.5
> > ==
> > --- head/share/man/man5/elf.5 Wed Mar 11 15:12:31 2020(r358890)
> > +++ head/share/man/man5/elf.5 Wed Mar 11 18:15:18 2020(r358891)
> > @@ -24,7 +24,7 @@
> ...
> > +.Bl -column -offset indent "Sy Field" "Sy Size" "Sy Description"
>
> The "Sy" macros can be dropped from those strings specifying the width
> of columns. They are not expanded there anyway.

Interesting, thanks for the note. I probably copied them from arch.7,
so it might need similar treatment.

They did have a side-effect of putting more space between columns
though; with extra Sy:

   Field   Size   Description
   namesz  32 bitsSize of name
   descsz  32 bitsSize of desc
   type32 bitsOS-dependent note type
   namenamesz Null-terminated originator name
   descdescsz OS-dependent note data

Without:

   FieldSizeDescription
   namesz   32 bits Size of name
   descsz   32 bits Size of desc
   type 32 bits OS-dependent note type
   name namesz  Null-terminated originator name
   desc descsz  OS-dependent note data
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r358892 - head/sys/dev/usb/input

2020-03-11 Thread Vladimir Kondratyev
Author: wulf
Date: Wed Mar 11 19:57:43 2020
New Revision: 358892
URL: https://svnweb.freebsd.org/changeset/base/358892

Log:
  wmt(4): revert r358872 (by hselasky)
  
  Limiting frame size to maximum packet size breaks devices which have input
  report size larger than wMaxPacketSize. Maximal input report size should be
  used instead.
  Revert the commit as it have not been MFC-ed yet.
  
  Discussed with:   hselasky

Modified:
  head/sys/dev/usb/input/wmt.c

Modified: head/sys/dev/usb/input/wmt.c
==
--- head/sys/dev/usb/input/wmt.cWed Mar 11 18:15:18 2020
(r358891)
+++ head/sys/dev/usb/input/wmt.cWed Mar 11 19:57:43 2020
(r358892)
@@ -251,7 +251,7 @@ static const struct usb_config wmt_config[WMT_N_TRANSF
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_IN,
.flags = { .pipe_bof = 1, .short_xfer_ok = 1 },
-   .bufsize = 0,   /* use wMaxPacketSize */
+   .bufsize = WMT_BSIZE,
.callback = _intr_callback,
},
 };
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r358891 - head/share/man/man5

2020-03-11 Thread Mateusz Piotrowski

Hi,

On 3/11/20 7:15 PM, Ed Maste wrote:

Author: emaste
Date: Wed Mar 11 18:15:18 2020
New Revision: 358891
URL: https://svnweb.freebsd.org/changeset/base/358891

Log:
   elf.5: start documenting ELF note sections

...

Modified: head/share/man/man5/elf.5
==
--- head/share/man/man5/elf.5   Wed Mar 11 15:12:31 2020(r358890)
+++ head/share/man/man5/elf.5   Wed Mar 11 18:15:18 2020(r358891)
@@ -24,7 +24,7 @@

...

+.Bl -column -offset indent "Sy Field" "Sy Size" "Sy Description"


The "Sy" macros can be dropped from those strings specifying the width 
of columns. They are not expanded there anyway.


Cheers,

Mateusz Piotrowski


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


Re: svn commit: r358870 - stable/12/usr.sbin/services_mkdb

2020-03-11 Thread Pedro Giffuni



On 11/03/2020 07:50, Kyle Evans wrote:

On Wed, Mar 11, 2020 at 12:45 AM Pedro F. Giffuni  wrote:

Author: pfg
Date: Wed Mar 11 05:45:33 2020
New Revision: 358870
URL: https://svnweb.freebsd.org/changeset/base/358870

Log:
   MFC r358154 (by delphij)
   Bump PROTOMAX: this matches the value on NetBSD and will be necessary for
   future updates.

   MFC r r358448;
   /etc/services: attempt to bring the database to this century.

   This is the result of splitting r358153 in two, in order to avoid a build
   system bug and being able to merge the change to previous releases..

   Document better this file, updating the URL to the IANA registry and closely
   match the official services.

   For system ports (0 to 1023) we now try to follow the registry closely, 
noting
   some historical differences where applicable.

   As a side effect: drop references to unofficial Kerberos IV which was EOL'ed
   on Oct 2006[1]. While it is conceivable some people may still use it in some
   very old FreeBSD machines that can't be replaced easily, the use of it is
   considered a security risk. Also drop the unofficial netatalk, which we
   supported long ago in the kernel but was dropped long ago.

   Leave for now smtps, even though it conflicts with IANA's submissions.
   The change should have very little visibility, if any, but should be a
   step closer to the current IANA database.

   [1] https://web.mit.edu/kerberos/krb4-end-of-life.html



r358154 at the very least should still go back to stable/11 if there's
going to be a later change to /etc/services that will still require
it.


Yes (I am just a bit busy ATM), but it goes a bit further, it has to 
make it into a release before I can commit the update in -current or 
we'll break some CI builds.


Pedro.

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


svn commit: r358891 - head/share/man/man5

2020-03-11 Thread Ed Maste
Author: emaste
Date: Wed Mar 11 18:15:18 2020
New Revision: 358891
URL: https://svnweb.freebsd.org/changeset/base/358891

Log:
  elf.5: start documenting ELF note sections
  
  I intend to document FreeBSD's ELF notes (see review D23982), but start
  with a section documenting the format of the note section itself.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/share/man/man5/elf.5

Modified: head/share/man/man5/elf.5
==
--- head/share/man/man5/elf.5   Wed Mar 11 15:12:31 2020(r358890)
+++ head/share/man/man5/elf.5   Wed Mar 11 18:15:18 2020(r358891)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 18, 2005
+.Dd March 11, 2020
 .Dt ELF 5
 .Os
 .Sh NAME
@@ -1276,6 +1276,26 @@ member.
 This member specifies a constant addend used to compute the value to be
 stored into the relocatable field.
 .El
+.Ss Note Section
+ELF note sections consist of entries with the following format.
+.Bl -column -offset indent "Sy Field" "Sy Size" "Sy Description"
+.It Sy Field Ta Sy Size Ta Sy Description
+.It namesz   Ta 32 bits Ta Size of "name"
+.It descsz   Ta 32 bits Ta Size of "desc"
+.It type Ta 32 bits Ta OS-dependent note type
+.It name Ta namesz  Ta Null-terminated originator name
+.It desc Ta descsz  Ta OS-dependent note data
+.El
+.Pp
+The
+.Sy name
+and
+.Sy desc
+fields are padded to ensure 4-byte alignemnt.
+.Sy namesz
+and
+.Sy descsz
+specify the unpadded length.
 .Sh SEE ALSO
 .Xr as 1 ,
 .Xr gdb 1 ,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r358890 - in head/sys/cam: . scsi

2020-03-11 Thread Warner Losh
Author: imp
Date: Wed Mar 11 15:12:31 2020
New Revision: 358890
URL: https://svnweb.freebsd.org/changeset/base/358890

Log:
  Remove redundantly repetitive static __inline forward function
  declarations.
  
  We typically don't use them elsewhere in the kernel, and they aren't
  needed here: the actual functions are a few lines away and aren't
  mutually recursive.

Modified:
  head/sys/cam/cam.h
  head/sys/cam/cam_sim.h
  head/sys/cam/cam_xpt.c
  head/sys/cam/scsi/scsi_all.h

Modified: head/sys/cam/cam.h
==
--- head/sys/cam/cam.h  Wed Mar 11 13:51:01 2020(r358889)
+++ head/sys/cam/cam.h  Wed Mar 11 15:12:31 2020(r358890)
@@ -403,11 +403,9 @@ void   cam_error_print(struct cam_device *device, 
union 
 __END_DECLS
 
 #ifdef _KERNEL
-static __inline void cam_init_pinfo(cam_pinfo *pinfo);
-
 static __inline void cam_init_pinfo(cam_pinfo *pinfo)
 {
-   pinfo->priority = CAM_PRIORITY_NONE;
+   pinfo->priority = CAM_PRIORITY_NONE;
pinfo->index = CAM_UNQUEUED_INDEX;
 }
 #endif

Modified: head/sys/cam/cam_sim.h
==
--- head/sys/cam/cam_sim.h  Wed Mar 11 13:51:01 2020(r358889)
+++ head/sys/cam/cam_sim.h  Wed Mar 11 15:12:31 2020(r358890)
@@ -79,16 +79,6 @@ void   cam_sim_release(struct cam_sim *sim);
 void   cam_sim_set_path(struct cam_sim *sim, u_int32_t path_id);
 
 
-
-/* Convenience routines for accessing sim attributes. */
-static __inline u_int32_tcam_sim_path(const struct cam_sim *sim);
-static __inline const char * cam_sim_name(const struct cam_sim *sim);
-static __inline void *  cam_sim_softc(const struct cam_sim *sim);
-static __inline u_int32_tcam_sim_unit(const struct cam_sim *sim);
-static __inline u_int32_tcam_sim_bus(const struct cam_sim *sim);
-
-
-
 /* Generically useful offsets into the sim private area */
 #define spriv_ptr0 sim_priv.entries[0].ptr
 #define spriv_ptr1 sim_priv.entries[1].ptr

Modified: head/sys/cam/cam_xpt.c
==
--- head/sys/cam/cam_xpt.c  Wed Mar 11 13:51:01 2020(r358889)
+++ head/sys/cam/cam_xpt.c  Wed Mar 11 15:12:31 2020(r358890)
@@ -323,7 +323,6 @@ static xpt_devicefunc_t xptsetasyncfunc;
 static xpt_busfunc_t   xptsetasyncbusfunc;
 static cam_status  xptregister(struct cam_periph *periph,
void *arg);
-static __inline int device_is_queued(struct cam_ed *device);
 
 static __inline int
 xpt_schedule_devq(struct cam_devq *devq, struct cam_ed *dev)

Modified: head/sys/cam/scsi/scsi_all.h
==
--- head/sys/cam/scsi/scsi_all.hWed Mar 11 13:51:01 2020
(r358889)
+++ head/sys/cam/scsi/scsi_all.hWed Mar 11 15:12:31 2020
(r358890)
@@ -4324,17 +4324,6 @@ int scsi_get_asc(struct scsi_sense_data *sense, u_int 
 int show_errors);
 int scsi_get_ascq(struct scsi_sense_data *sense, u_int sense_len,
  int show_errors);
-static __inline void scsi_ulto2b(u_int32_t val, u_int8_t *bytes);
-static __inline void scsi_ulto3b(u_int32_t val, u_int8_t *bytes);
-static __inline void scsi_ulto4b(u_int32_t val, u_int8_t *bytes);
-static __inline void scsi_u64to8b(u_int64_t val, u_int8_t *bytes);
-static __inline uint32_t scsi_2btoul(const uint8_t *bytes);
-static __inline uint32_t scsi_3btoul(const uint8_t *bytes);
-static __inline int32_t scsi_3btol(const uint8_t *bytes);
-static __inline uint32_t scsi_4btoul(const uint8_t *bytes);
-static __inline uint64_t scsi_8btou64(const uint8_t *bytes);
-static __inline void *find_mode_page_6(struct scsi_mode_header_6 *mode_header);
-static __inline void *find_mode_page_10(struct scsi_mode_header_10 
*mode_header);
 
 static __inline void
 scsi_ulto2b(u_int32_t val, u_int8_t *bytes)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r358861 - head/share/examples/etc

2020-03-11 Thread Ed Maste
On Tue, 10 Mar 2020 at 18:59, Jung-uk Kim  wrote:
>
> Author: jkim
> Date: Tue Mar 10 22:59:01 2020
> New Revision: 358861
> URL: https://svnweb.freebsd.org/changeset/base/358861
>
> Log:
>   - Remove CPUTYPE examples for sparc64.  It is not supported since r358345.
>   - Clean up CPUTYPE examples for x86.  GCC 4.2.1 was removed by r358454.

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


svn commit: r358889 - head/usr.bin/elfctl

2020-03-11 Thread Ed Maste
Author: emaste
Date: Wed Mar 11 13:51:01 2020
New Revision: 358889
URL: https://svnweb.freebsd.org/changeset/base/358889

Log:
  elfctl: remove memory leak
  
  CID:  1420356
  Reported by:  Coverity Scan
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.bin/elfctl/elfctl.c

Modified: head/usr.bin/elfctl/elfctl.c
==
--- head/usr.bin/elfctl/elfctl.cWed Mar 11 13:45:53 2020
(r35)
+++ head/usr.bin/elfctl/elfctl.cWed Mar 11 13:51:01 2020
(r358889)
@@ -352,6 +352,7 @@ get_file_features(Elf *elf, int phcount, int fd, uint3
descsz = roundup2(note.n_descsz, 4);
if (read(fd, name, namesz) < namesz) {
warnx("elf note name too short");
+   free(name);
return (false);
}
read_total += namesz;
@@ -386,6 +387,7 @@ get_file_features(Elf *elf, int phcount, int fd, uint3
if (read(fd, features, sizeof(uint32_t)) <
(ssize_t)sizeof(uint32_t)) {
warnx("feature note data too short");
+   free(name);
return (false);
}
if (off != NULL)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r358888 - stable/12/sbin/pfctl/tests/files

2020-03-11 Thread Li-Wen Hsu
Author: lwhsu
Date: Wed Mar 11 13:45:53 2020
New Revision: 35
URL: https://svnweb.freebsd.org/changeset/base/35

Log:
  MFC r358463:
  
  Fix test cases after r358448 (r358870 in stable/12)
  
  sbin.pfctl.pfctl_test.pf0087
  sbin.pfctl.pfctl_test.selfpf0087
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/12/sbin/pfctl/tests/files/pf0087.ok
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/pfctl/tests/files/pf0087.ok
==
--- stable/12/sbin/pfctl/tests/files/pf0087.ok  Wed Mar 11 12:43:54 2020
(r358887)
+++ stable/12/sbin/pfctl/tests/files/pf0087.ok  Wed Mar 11 13:45:53 2020
(r35)
@@ -5,7 +5,7 @@ pass in on lo100 inet proto udp from any to 10.0.0
 pass in inet proto tcp from any to 10.0.0.1 port = http flags S/SA keep state
 pass out on lo101 inet proto udp from any to 10.0.0.2 port = domain keep 
state
 pass in inet proto tcp from any to 10.0.0.3 port = http flags S/SA keep state
-pass out inet proto tcp from any to 10.0.0.1 port = hosts2-ns flags S/SA keep 
state
+pass out inet proto tcp from any to 10.0.0.1 port = 81 flags S/SA keep state
 pass in inet proto udp from any to 10.0.0.3 port = domain keep state
 pass in on lo101 inet proto udp from 10.0.0.2 port = domain to 10.0.0.2 
keep state
 pass out inet proto udp from any to 10.0.0.1 port = domain keep state
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r358870 - stable/12/usr.sbin/services_mkdb

2020-03-11 Thread Kyle Evans
On Wed, Mar 11, 2020 at 12:45 AM Pedro F. Giffuni  wrote:
>
> Author: pfg
> Date: Wed Mar 11 05:45:33 2020
> New Revision: 358870
> URL: https://svnweb.freebsd.org/changeset/base/358870
>
> Log:
>   MFC r358154 (by delphij)
>   Bump PROTOMAX: this matches the value on NetBSD and will be necessary for
>   future updates.
>
>   MFC r r358448;
>   /etc/services: attempt to bring the database to this century.
>
>   This is the result of splitting r358153 in two, in order to avoid a build
>   system bug and being able to merge the change to previous releases..
>
>   Document better this file, updating the URL to the IANA registry and closely
>   match the official services.
>
>   For system ports (0 to 1023) we now try to follow the registry closely, 
> noting
>   some historical differences where applicable.
>
>   As a side effect: drop references to unofficial Kerberos IV which was EOL'ed
>   on Oct 2006[1]. While it is conceivable some people may still use it in some
>   very old FreeBSD machines that can't be replaced easily, the use of it is
>   considered a security risk. Also drop the unofficial netatalk, which we
>   supported long ago in the kernel but was dropped long ago.
>
>   Leave for now smtps, even though it conflicts with IANA's submissions.
>   The change should have very little visibility, if any, but should be a
>   step closer to the current IANA database.
>
>   [1] https://web.mit.edu/kerberos/krb4-end-of-life.html
>


r358154 at the very least should still go back to stable/11 if there's
going to be a later change to /etc/services that will still require
it.

Thanks,

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


svn commit: r358887 - in head/lib: libproc/tests msun/tests

2020-03-11 Thread Li-Wen Hsu
Author: lwhsu
Date: Wed Mar 11 12:43:54 2020
New Revision: 358887
URL: https://svnweb.freebsd.org/changeset/base/358887

Log:
  Temporarily skip 2 failing tests after llvm10 import
  
  PR:   244732
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libproc/tests/proc_test.c
  head/lib/msun/tests/ctrig_test.c

Modified: head/lib/libproc/tests/proc_test.c
==
--- head/lib/libproc/tests/proc_test.c  Wed Mar 11 10:42:05 2020
(r358886)
+++ head/lib/libproc/tests/proc_test.c  Wed Mar 11 12:43:54 2020
(r358887)
@@ -270,6 +270,9 @@ ATF_TC_BODY(symbol_lookup, tc)
u_long saved;
int error;
 
+   if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
+   atf_tc_skip("https://bugs.freebsd.org/244732;);
+
phdl = start_prog(tc, false);
 
error = proc_name2sym(phdl, target_prog_file, "main", _sym, NULL);

Modified: head/lib/msun/tests/ctrig_test.c
==
--- head/lib/msun/tests/ctrig_test.cWed Mar 11 10:42:05 2020
(r358886)
+++ head/lib/msun/tests/ctrig_test.cWed Mar 11 12:43:54 2020
(r358887)
@@ -248,6 +248,9 @@ ATF_TC_BODY(test_inf_inputs, tc)
long double complex z, c, s;
unsigned i;
 
+   if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false))
+   atf_tc_skip("https://bugs.freebsd.org/244732;);
+
/*
 * IN   CSINH   CCOSH   CTANH
 * Inf,Inf  +-Inf,NaN inval +-Inf,NaN inval 1,+-0
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r358886 - head/tests/sys/geom/class/gate

2020-03-11 Thread Li-Wen Hsu
Author: lwhsu
Date: Wed Mar 11 10:42:05 2020
New Revision: 358886
URL: https://svnweb.freebsd.org/changeset/base/358886

Log:
  Temporarily skip sys.geom.class.gate.ggate_test.ggated in CI
  
  PR:   244737
  Sponsored by: The FreeBSD Foundation

Modified:
  head/tests/sys/geom/class/gate/ggate_test.sh

Modified: head/tests/sys/geom/class/gate/ggate_test.sh
==
--- head/tests/sys/geom/class/gate/ggate_test.shWed Mar 11 08:51:19 
2020(r358885)
+++ head/tests/sys/geom/class/gate/ggate_test.shWed Mar 11 10:42:05 
2020(r358886)
@@ -16,6 +16,10 @@ ggated_head()
 
 ggated_body()
 {
+   if [ "$(atf_config_get ci false)" = "true" ]; then
+   atf_skip "https://bugs.freebsd.org/244737;
+   fi
+
load_ggate
 
us=$(alloc_ggate_dev)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r358858 - head/sbin/ipfw

2020-03-11 Thread O. Hartmann
On Wed, 11 Mar 2020 08:10:13 +
Alexander V. Chernikov  wrote:

> 11.03.2020, 07:14, "O. Hartmann" :
> > On Tue, 10 Mar 2020 20:30:21 + (UTC)
> > "Alexander V. Chernikov"  wrote:
> >  
> >>  Author: melifaro
> >>  Date: Tue Mar 10 20:30:21 2020
> >>  New Revision: 358858
> >>  URL: https://svnweb.freebsd.org/changeset/base/358858
> >>
> >>  Log:
> >>    Don't assume !IPv6 is IPv4 in ipfw(8) add_src() and add_dst().
> >>
> >>    Submitted by: Neel Chauhan 
> >>    MFC after: 2 weeks
> >>    Differential Revision: https://reviews.freebsd.org/D21812
> >>
> >>  Modified:
> >>    head/sbin/ipfw/ipfw2.c
> >>
> >>  Modified: head/sbin/ipfw/ipfw2.c
> >>  
> >> ==
> >>  --- head/sbin/ipfw/ipfw2.c Tue Mar 10 20:25:36 2020 (r358857)
> >>  +++ head/sbin/ipfw/ipfw2.c Tue Mar 10 20:30:21 2020 (r358858)
> >>  @@ -3717,11 +3717,10 @@ add_src(ipfw_insn *cmd, char *av, u_char proto,
> >> int cb if (proto == IPPROTO_IPV6 || strcmp(av, "me6") == 0 ||
> >>   inet_pton(AF_INET6, host, ) == 1)
> >>   ret = add_srcip6(cmd, av, cblen, tstate);
> >>  - /* XXX: should check for IPv4, not !IPv6 */
> >>  - if (ret == NULL && (proto == IPPROTO_IP || strcmp(av, "me") == 0 ||
> >>  - inet_pton(AF_INET6, host, ) != 1))
> >>  + else if (proto == IPPROTO_IP || strcmp(av, "me") == 0 ||
> >>  + inet_pton(AF_INET, host, ) == 1)
> >>   ret = add_srcip(cmd, av, cblen, tstate);
> >>  - if (ret == NULL && strcmp(av, "any") != 0)
> >>  + else if (ret == NULL && strcmp(av, "any") != 0)
> >>   ret = cmd;
> >>
> >>   return ret;
> >>  @@ -3748,11 +3747,10 @@ add_dst(ipfw_insn *cmd, char *av, u_char proto,
> >> int cb if (proto == IPPROTO_IPV6 || strcmp(av, "me6") == 0 ||
> >>   inet_pton(AF_INET6, host, ) == 1)
> >>   ret = add_dstip6(cmd, av, cblen, tstate);
> >>  - /* XXX: should check for IPv4, not !IPv6 */
> >>  - if (ret == NULL && (proto == IPPROTO_IP || strcmp(av, "me") == 0 ||
> >>  - inet_pton(AF_INET6, host, ) != 1))
> >>  + else if (proto == IPPROTO_IP || strcmp(av, "me") == 0 ||
> >>  + inet_pton(AF_INET, host, ) == 1)
> >>   ret = add_dstip(cmd, av, cblen, tstate);
> >>  - if (ret == NULL && strcmp(av, "any") != 0)
> >>  + else if (ret == NULL && strcmp(av, "any") != 0)
> >>   ret = cmd;
> >>
> >>   return ret;
> >>  ___
> >>  svn-src-h...@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"  
> >
> > This seems to trigger some issues in CURRENT's ipfw script handling rules.
> > On all CURRENT boxes running  
> >>  FreeBSD 13.0-CURRENT #0 r358851: Tue Mar 10 21:17:39 CET 2020 amd64, the
> >> boxes  
> >
> > aren't accessible via net due to errors occuring when loading ipfw rules:  
> Whoops.
> Terribly sorry for breaking your setup. Reverted in r358871.

It is not a specific setup of mine, since we use the standard supplied by
FreeBSD, just filling some variables.

So, in theory, the patch should have broken much more setups if people use
FreeBSD's ipfw.

Thanks for reverting.

> >
> > [/etc/rc.conf]
> > firewall_type="WORKSTATION"
> > firewall_myservices="22/tcp 80/tcp 443/tcp" # List of TCP ports on
> > which this host
> > # offers services for "workstation"
> > firewall. firewall_allowservices="192.168.0.0/24 fd11:43:2::/64" # List of
> > IPs which have access to
> > # $firewall_myservices for "workstation"
> > # firewall.
> > firewall_trusted="" # List of IPs which have full access to this
> > # host for "workstation" firewall.
> >
> > [...]
> > # service ipfw restart
> > Flushed all rules.
> > 00100 allow ip from any to any via lo0
> > 00200 deny ip from any to 127.0.0.0/8
> > 00300 deny ip from 127.0.0.0/8 to any
> > 00400 deny ip from any to ::1
> > 00500 deny ip from ::1 to any
> > 00600 allow ipv6-icmp from :: to ff02::/16
> > 00700 allow ipv6-icmp from fe80::/10 to fe80::/10
> > 00800 allow ipv6-icmp from fe80::/10 to ff02::/16
> > ipfw: bad source address any
> > ipfw: bad source address any
> > 0 check-state :default
> > ipfw: bad destination address any
> > ipfw: bad destination address any
> > ipfw: bad destination address any
> > ipfw: bad destination address any
> > ipfw: bad destination address any
> > 01000 allow udp from 0.0.0.0 68 to 255.255.255.255 67 out
> > ipfw: bad source address any
> > ipfw: bad source address any
> > 01100 allow udp from fe80::/10 to me 546 in
> > ipfw: bad source address any
> > ipfw: bad source address any
> > ipfw: bad source address any
> > ipfw: bad source address any
> > [...]
> >
> > The problem also occur if set
> >
> > firewall_allowservices="any"
> >
> > in /etc/rc.conf  


svn commit: r358885 - in stable/12/sys/dev/mlx5: . mlx5_en mlx5_ib

2020-03-11 Thread Konstantin Belousov
Author: kib
Date: Wed Mar 11 08:51:19 2020
New Revision: 358885
URL: https://svnweb.freebsd.org/changeset/base/358885

Log:
  MFC r358624:
  mlx5en: Support 50GBase-KR4 media type in mlx5en driver.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
  stable/12/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
  stable/12/sys/dev/mlx5/port.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==
--- stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c   Wed Mar 11 08:34:29 
2020(r358884)
+++ stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c   Wed Mar 11 08:51:19 
2020(r358885)
@@ -166,6 +166,10 @@ static const struct media mlx5e_mode_table[MLX5E_LINK_
.subtype = IFM_50G_KR2,
.baudrate = IF_Gbps(50ULL),
},
+   [MLX5E_50GBASE_KR4][MLX5E_KR4] = {
+   .subtype = IFM_50G_KR4,
+   .baudrate = IF_Gbps(50ULL),
+   },
 };
 
 static const struct media 
mlx5e_ext_mode_table[MLX5E_EXT_LINK_SPEEDS_NUMBER][MLX5E_LINK_MODES_NUMBER] = {
@@ -312,6 +316,10 @@ static const struct media mlx5e_ext_mode_table[MLX5E_E
},
[MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2][MLX5E_KR2] = {
.subtype = IFM_50G_KR2,
+   .baudrate = IF_Gbps(50ULL),
+   },
+   [MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2][MLX5E_KR4] = {
+   .subtype = IFM_50G_KR4,
.baudrate = IF_Gbps(50ULL),
},
[MLX5E_50GAUI_2_LAUI_2_50GBASE_CR2_KR2][MLX5E_SR2] = {

Modified: stable/12/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
==
--- stable/12/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c   Wed Mar 11 08:34:29 
2020(r358884)
+++ stable/12/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c   Wed Mar 11 08:51:19 
2020(r358885)
@@ -199,6 +199,7 @@ static int translate_eth_proto_oper(u32 eth_proto_oper
break;
case MLX5E_PROT_MASK(MLX5E_50GBASE_CR2):
case MLX5E_PROT_MASK(MLX5E_50GBASE_KR2):
+   case MLX5E_PROT_MASK(MLX5E_50GBASE_KR4):
case MLX5E_PROT_MASK(MLX5E_50GBASE_SR2):
*active_width = IB_WIDTH_1X;
*active_speed = IB_SPEED_HDR;

Modified: stable/12/sys/dev/mlx5/port.h
==
--- stable/12/sys/dev/mlx5/port.h   Wed Mar 11 08:34:29 2020
(r358884)
+++ stable/12/sys/dev/mlx5/port.h   Wed Mar 11 08:51:19 2020
(r358885)
@@ -95,6 +95,7 @@ enum mlx5e_link_speed {
MLX5E_40GBASE_SR4= 15,
MLX5E_40GBASE_LR4_ER4= 16,
MLX5E_50GBASE_SR2= 18,
+   MLX5E_50GBASE_KR4= 19,
MLX5E_100GBASE_CR4   = 20,
MLX5E_100GBASE_SR4   = 21,
MLX5E_100GBASE_KR4   = 22,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r358884 - stable/11/sys/dev/acpica

2020-03-11 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar 11 08:34:29 2020
New Revision: 358884
URL: https://svnweb.freebsd.org/changeset/base/358884

Log:
  MFC r358537:
  Expose the ACPI power button, sleep button and LID state as evdev's.
  
  This allows libinput to disable touchpads when the lid is closed and
  various desktop environments can show power-off dialogs when the power
  button is pressed. While the latter is doable with devd a
  cross-platform solution is nicer.
  
  Submitted by: Greg V 
  Differential Revision:https://reviews.freebsd.org/D23863
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/dev/acpica/acpi_button.c
  stable/11/sys/dev/acpica/acpi_lid.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/acpica/acpi_button.c
==
--- stable/11/sys/dev/acpica/acpi_button.c  Wed Mar 11 08:32:15 2020
(r358883)
+++ stable/11/sys/dev/acpica/acpi_button.c  Wed Mar 11 08:34:29 2020
(r358884)
@@ -30,6 +30,7 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_acpi.h"
+#include "opt_evdev.h"
 #include 
 #include 
 #include 
@@ -40,6 +41,11 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#ifdef EVDEV_SUPPORT
+#include 
+#include 
+#endif
+
 /* Hooks for the ACPI CA debugging infrastructure */
 #define _COMPONENT ACPI_BUTTON
 ACPI_MODULE_NAME("BUTTON")
@@ -51,6 +57,9 @@ struct acpi_button_softc {
 #defineACPI_POWER_BUTTON   0
 #defineACPI_SLEEP_BUTTON   1
 boolean_t  fixed;
+#ifdef EVDEV_SUPPORT
+struct evdev_dev *button_evdev;
+#endif
 };
 
 #defineACPI_NOTIFY_BUTTON_PRESSED_FOR_SLEEP0x80
@@ -139,6 +148,20 @@ acpi_button_attach(device_t dev)
 event = (sc->button_type == ACPI_SLEEP_BUTTON) ?
ACPI_EVENT_SLEEP_BUTTON : ACPI_EVENT_POWER_BUTTON;
 
+#ifdef EVDEV_SUPPORT
+sc->button_evdev = evdev_alloc();
+evdev_set_name(sc->button_evdev, device_get_desc(dev));
+evdev_set_phys(sc->button_evdev, device_get_nameunit(dev));
+evdev_set_id(sc->button_evdev, BUS_HOST, 0, 0, 1);
+evdev_support_event(sc->button_evdev, EV_SYN);
+evdev_support_event(sc->button_evdev, EV_KEY);
+evdev_support_key(sc->button_evdev,
+   (sc->button_type == ACPI_SLEEP_BUTTON) ? KEY_SLEEP : KEY_POWER);
+
+if (evdev_register(sc->button_evdev))
+return (ENXIO);
+#endif
+
 /* 
  * Install the new handler.  We could remove any fixed handlers added
  * from the FADT once we have a duplicate from the AML but some systems
@@ -245,6 +268,9 @@ static void 
 acpi_button_notify_handler(ACPI_HANDLE h, UINT32 notify, void *context)
 {
 struct acpi_button_softc   *sc;
+#ifdef EVDEV_SUPPORT
+uint16_t key;
+#endif
 
 ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, notify);
 
@@ -260,6 +286,14 @@ acpi_button_notify_handler(ACPI_HANDLE h, UINT32 notif
device_printf(sc->button_dev, "unknown notify %#x\n", notify);
break;
 }
+
+#ifdef EVDEV_SUPPORT
+key = (sc->button_type == ACPI_SLEEP_BUTTON) ? KEY_SLEEP : KEY_POWER;
+evdev_push_key(sc->button_evdev, key, 1);
+evdev_sync(sc->button_evdev);
+evdev_push_key(sc->button_evdev, key, 0);
+evdev_sync(sc->button_evdev);
+#endif
 }
 
 static ACPI_STATUS 

Modified: stable/11/sys/dev/acpica/acpi_lid.c
==
--- stable/11/sys/dev/acpica/acpi_lid.c Wed Mar 11 08:32:15 2020
(r358883)
+++ stable/11/sys/dev/acpica/acpi_lid.c Wed Mar 11 08:34:29 2020
(r358884)
@@ -31,6 +31,7 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_acpi.h"
+#include "opt_evdev.h"
 #include 
 #include 
 #include 
@@ -42,6 +43,11 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#ifdef EVDEV_SUPPORT
+#include 
+#include 
+#endif
+
 /* Hooks for the ACPI CA debugging infrastructure */
 #define _COMPONENT ACPI_BUTTON
 ACPI_MODULE_NAME("LID")
@@ -50,6 +56,9 @@ struct acpi_lid_softc {
 device_t   lid_dev;
 ACPI_HANDLElid_handle;
 intlid_status; /* open or closed */
+#ifdef EVDEV_SUPPORT
+struct evdev_dev *lid_evdev;
+#endif
 };
 
 ACPI_HANDLE acpi_lid_handle;
@@ -103,6 +112,12 @@ acpi_lid_status_update(struct acpi_lid_softc *sc)
 
/* range check value */
sc->lid_status = lid_status ? 1 : 0;
+
+#ifdef EVDEV_SUPPORT
+   /* Notify evdev about lid status */
+   evdev_push_sw(sc->lid_evdev, SW_LID, lid_status ? 0 : 1);
+   evdev_sync(sc->lid_evdev);
+#endif
 }
 
 static int
@@ -129,6 +144,20 @@ acpi_lid_attach(device_t dev)
 sc = device_get_softc(dev);
 sc->lid_dev = dev;
 acpi_lid_handle = sc->lid_handle = acpi_get_handle(dev);
+
+#ifdef EVDEV_SUPPORT
+/* Register evdev device before initial status update */
+sc->lid_evdev = evdev_alloc();
+evdev_set_name(sc->lid_evdev, device_get_desc(dev));
+evdev_set_phys(sc->lid_evdev, device_get_nameunit(dev));
+

svn commit: r358883 - stable/12/sys/dev/acpica

2020-03-11 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar 11 08:32:15 2020
New Revision: 358883
URL: https://svnweb.freebsd.org/changeset/base/358883

Log:
  MFC r358537:
  Expose the ACPI power button, sleep button and LID state as evdev's.
  
  This allows libinput to disable touchpads when the lid is closed and
  various desktop environments can show power-off dialogs when the power
  button is pressed. While the latter is doable with devd a
  cross-platform solution is nicer.
  
  Submitted by: Greg V 
  Differential Revision:https://reviews.freebsd.org/D23863
  Sponsored by: Mellanox Technologies

Modified:
  stable/12/sys/dev/acpica/acpi_button.c
  stable/12/sys/dev/acpica/acpi_lid.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/acpica/acpi_button.c
==
--- stable/12/sys/dev/acpica/acpi_button.c  Wed Mar 11 08:28:57 2020
(r358882)
+++ stable/12/sys/dev/acpica/acpi_button.c  Wed Mar 11 08:32:15 2020
(r358883)
@@ -30,6 +30,7 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_acpi.h"
+#include "opt_evdev.h"
 #include 
 #include 
 #include 
@@ -40,6 +41,11 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#ifdef EVDEV_SUPPORT
+#include 
+#include 
+#endif
+
 /* Hooks for the ACPI CA debugging infrastructure */
 #define _COMPONENT ACPI_BUTTON
 ACPI_MODULE_NAME("BUTTON")
@@ -51,6 +57,9 @@ struct acpi_button_softc {
 #defineACPI_POWER_BUTTON   0
 #defineACPI_SLEEP_BUTTON   1
 boolean_t  fixed;
+#ifdef EVDEV_SUPPORT
+struct evdev_dev *button_evdev;
+#endif
 };
 
 #defineACPI_NOTIFY_BUTTON_PRESSED_FOR_SLEEP0x80
@@ -139,6 +148,20 @@ acpi_button_attach(device_t dev)
 event = (sc->button_type == ACPI_SLEEP_BUTTON) ?
ACPI_EVENT_SLEEP_BUTTON : ACPI_EVENT_POWER_BUTTON;
 
+#ifdef EVDEV_SUPPORT
+sc->button_evdev = evdev_alloc();
+evdev_set_name(sc->button_evdev, device_get_desc(dev));
+evdev_set_phys(sc->button_evdev, device_get_nameunit(dev));
+evdev_set_id(sc->button_evdev, BUS_HOST, 0, 0, 1);
+evdev_support_event(sc->button_evdev, EV_SYN);
+evdev_support_event(sc->button_evdev, EV_KEY);
+evdev_support_key(sc->button_evdev,
+   (sc->button_type == ACPI_SLEEP_BUTTON) ? KEY_SLEEP : KEY_POWER);
+
+if (evdev_register(sc->button_evdev))
+return (ENXIO);
+#endif
+
 /* 
  * Install the new handler.  We could remove any fixed handlers added
  * from the FADT once we have a duplicate from the AML but some systems
@@ -245,6 +268,9 @@ static void 
 acpi_button_notify_handler(ACPI_HANDLE h, UINT32 notify, void *context)
 {
 struct acpi_button_softc   *sc;
+#ifdef EVDEV_SUPPORT
+uint16_t key;
+#endif
 
 ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, notify);
 
@@ -260,6 +286,14 @@ acpi_button_notify_handler(ACPI_HANDLE h, UINT32 notif
device_printf(sc->button_dev, "unknown notify %#x\n", notify);
break;
 }
+
+#ifdef EVDEV_SUPPORT
+key = (sc->button_type == ACPI_SLEEP_BUTTON) ? KEY_SLEEP : KEY_POWER;
+evdev_push_key(sc->button_evdev, key, 1);
+evdev_sync(sc->button_evdev);
+evdev_push_key(sc->button_evdev, key, 0);
+evdev_sync(sc->button_evdev);
+#endif
 }
 
 static ACPI_STATUS 

Modified: stable/12/sys/dev/acpica/acpi_lid.c
==
--- stable/12/sys/dev/acpica/acpi_lid.c Wed Mar 11 08:28:57 2020
(r358882)
+++ stable/12/sys/dev/acpica/acpi_lid.c Wed Mar 11 08:32:15 2020
(r358883)
@@ -31,6 +31,7 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_acpi.h"
+#include "opt_evdev.h"
 #include 
 #include 
 #include 
@@ -42,6 +43,11 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#ifdef EVDEV_SUPPORT
+#include 
+#include 
+#endif
+
 /* Hooks for the ACPI CA debugging infrastructure */
 #define _COMPONENT ACPI_BUTTON
 ACPI_MODULE_NAME("LID")
@@ -50,6 +56,9 @@ struct acpi_lid_softc {
 device_t   lid_dev;
 ACPI_HANDLElid_handle;
 intlid_status; /* open or closed */
+#ifdef EVDEV_SUPPORT
+struct evdev_dev *lid_evdev;
+#endif
 };
 
 ACPI_HANDLE acpi_lid_handle;
@@ -103,6 +112,12 @@ acpi_lid_status_update(struct acpi_lid_softc *sc)
 
/* range check value */
sc->lid_status = lid_status ? 1 : 0;
+
+#ifdef EVDEV_SUPPORT
+   /* Notify evdev about lid status */
+   evdev_push_sw(sc->lid_evdev, SW_LID, lid_status ? 0 : 1);
+   evdev_sync(sc->lid_evdev);
+#endif
 }
 
 static int
@@ -129,6 +144,20 @@ acpi_lid_attach(device_t dev)
 sc = device_get_softc(dev);
 sc->lid_dev = dev;
 acpi_lid_handle = sc->lid_handle = acpi_get_handle(dev);
+
+#ifdef EVDEV_SUPPORT
+/* Register evdev device before initial status update */
+sc->lid_evdev = evdev_alloc();
+evdev_set_name(sc->lid_evdev, device_get_desc(dev));
+evdev_set_phys(sc->lid_evdev, device_get_nameunit(dev));
+

svn commit: r358882 - stable/11/sys/compat/linuxkpi/common/src

2020-03-11 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar 11 08:28:57 2020
New Revision: 358882
URL: https://svnweb.freebsd.org/changeset/base/358882

Log:
  MFC r358586:
  When closing a LinuxKPI file always use the real release function to avoid
  resource leakage when destroying a LinuxKPI character device.
  
  Submitted by: Andrew Boyer 
  Reviewed by:  kib@
  PR:   244572
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/compat/linuxkpi/common/src/linux_compat.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c
==
--- stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Wed Mar 11 
08:28:12 2020(r358881)
+++ stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Wed Mar 11 
08:28:57 2020(r358882)
@@ -1493,6 +1493,7 @@ static int
 linux_file_close(struct file *file, struct thread *td)
 {
struct linux_file *filp;
+   int (*release)(struct inode *, struct linux_file *);
const struct file_operations *fop;
struct linux_cdev *ldev;
int error;
@@ -1510,8 +1511,13 @@ linux_file_close(struct file *file, struct thread *td)
linux_set_current(td);
linux_poll_wait_dequeue(filp);
linux_get_fop(filp, , );
-   if (fop->release != NULL)
-   error = -OPW(file, td, fop->release(filp->f_vnode, filp));
+   /*
+* Always use the real release function, if any, to avoid
+* leaking device resources:
+*/
+   release = filp->f_op->release;
+   if (release != NULL)
+   error = -OPW(file, td, release(filp->f_vnode, filp));
funsetown(>f_sigio);
if (filp->f_vnode != NULL)
vdrop(filp->f_vnode);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r358881 - stable/12/sys/compat/linuxkpi/common/src

2020-03-11 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar 11 08:28:12 2020
New Revision: 358881
URL: https://svnweb.freebsd.org/changeset/base/358881

Log:
  MFC r358586:
  When closing a LinuxKPI file always use the real release function to avoid
  resource leakage when destroying a LinuxKPI character device.
  
  Submitted by: Andrew Boyer 
  Reviewed by:  kib@
  PR:   244572
  Sponsored by: Mellanox Technologies

Modified:
  stable/12/sys/compat/linuxkpi/common/src/linux_compat.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linuxkpi/common/src/linux_compat.c
==
--- stable/12/sys/compat/linuxkpi/common/src/linux_compat.c Wed Mar 11 
08:26:52 2020(r358880)
+++ stable/12/sys/compat/linuxkpi/common/src/linux_compat.c Wed Mar 11 
08:28:12 2020(r358881)
@@ -1493,6 +1493,7 @@ static int
 linux_file_close(struct file *file, struct thread *td)
 {
struct linux_file *filp;
+   int (*release)(struct inode *, struct linux_file *);
const struct file_operations *fop;
struct linux_cdev *ldev;
int error;
@@ -1510,8 +1511,13 @@ linux_file_close(struct file *file, struct thread *td)
linux_set_current(td);
linux_poll_wait_dequeue(filp);
linux_get_fop(filp, , );
-   if (fop->release != NULL)
-   error = -OPW(file, td, fop->release(filp->f_vnode, filp));
+   /*
+* Always use the real release function, if any, to avoid
+* leaking device resources:
+*/
+   release = filp->f_op->release;
+   if (release != NULL)
+   error = -OPW(file, td, release(filp->f_vnode, filp));
funsetown(>f_sigio);
if (filp->f_vnode != NULL)
vdrop(filp->f_vnode);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r358880 - stable/9/sys/dev/sound/pcm

2020-03-11 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar 11 08:26:52 2020
New Revision: 358880
URL: https://svnweb.freebsd.org/changeset/base/358880

Log:
  MFC r358629:
  Implement a detaching flag for the sound(4) subsystem to take
  appropriate actions when we are trying to detach an audio device,
  but cannot because someone is using it.
  
  This avoids applications having to wait for the DSP read data
  timeout before they receive any error indication.
  Tested with virtual_oss(8).
  
  Remove some unused definitions while at it.
  
  PR:   194727
  Sponsored by: Mellanox Technologies

Modified:
  stable/9/sys/dev/sound/pcm/dsp.c
  stable/9/sys/dev/sound/pcm/mixer.c
  stable/9/sys/dev/sound/pcm/sound.c
  stable/9/sys/dev/sound/pcm/sound.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/dev/sound/pcm/dsp.c
==
--- stable/9/sys/dev/sound/pcm/dsp.cWed Mar 11 08:26:11 2020
(r358879)
+++ stable/9/sys/dev/sound/pcm/dsp.cWed Mar 11 08:26:52 2020
(r358880)
@@ -457,7 +457,7 @@ dsp_open(struct cdev *i_dev, int flags, int mode, stru
return (ENODEV);
 
d = dsp_get_info(i_dev);
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
return (EBADF);
 
PCM_GIANT_ENTER(d);
@@ -827,7 +827,7 @@ dsp_io_ops(struct cdev *i_dev, struct uio *buf)
("%s(): io train wreck!", __func__));
 
d = dsp_get_info(i_dev);
-   if (!DSP_REGISTERED(d, i_dev))
+   if (PCM_DETACHING(d) || !DSP_REGISTERED(d, i_dev))
return (EBADF);
 
PCM_GIANT_ENTER(d);
@@ -1072,7 +1072,7 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg,
int *arg_i, ret, tmp;
 
d = dsp_get_info(i_dev);
-   if (!DSP_REGISTERED(d, i_dev))
+   if (PCM_DETACHING(d) || !DSP_REGISTERED(d, i_dev))
return (EBADF);
 
PCM_GIANT_ENTER(d);
@@ -2167,9 +2167,11 @@ dsp_poll(struct cdev *i_dev, int events, struct thread
int ret, e;
 
d = dsp_get_info(i_dev);
-   if (!DSP_REGISTERED(d, i_dev))
-   return (EBADF);
-
+   if (PCM_DETACHING(d) || !DSP_REGISTERED(d, i_dev)) {
+   /* XXX many clients don't understand POLLNVAL */
+   return (events & (POLLHUP | POLLPRI | POLLIN |
+   POLLRDNORM | POLLOUT | POLLWRNORM));
+   }
PCM_GIANT_ENTER(d);
 
wrch = NULL;
@@ -2240,7 +2242,7 @@ dsp_mmap_single(struct cdev *i_dev, vm_ooffset_t *offs
return (EINVAL);
 
d = dsp_get_info(i_dev);
-   if (!DSP_REGISTERED(d, i_dev))
+   if (PCM_DETACHING(d) || !DSP_REGISTERED(d, i_dev))
return (EINVAL);
 
PCM_GIANT_ENTER(d);

Modified: stable/9/sys/dev/sound/pcm/mixer.c
==
--- stable/9/sys/dev/sound/pcm/mixer.c  Wed Mar 11 08:26:11 2020
(r358879)
+++ stable/9/sys/dev/sound/pcm/mixer.c  Wed Mar 11 08:26:52 2020
(r358880)
@@ -152,7 +152,7 @@ mixer_set_softpcmvol(struct snd_mixer *m, struct sndde
struct pcm_channel *c;
int dropmtx, acquiremtx;
 
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
return (EINVAL);
 
if (mtx_owned(m->lock))
@@ -205,7 +205,7 @@ mixer_set_eq(struct snd_mixer *m, struct snddev_info *
else
return (EINVAL);
 
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
return (EINVAL);
 
if (mtx_owned(m->lock))
@@ -1045,7 +1045,7 @@ mixer_open(struct cdev *i_dev, int flags, int mode, st
 
m = i_dev->si_drv1;
d = device_get_softc(m->dev);
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
return (EBADF);
 
/* XXX Need Giant magic entry ??? */
@@ -1201,7 +1201,7 @@ mixer_ioctl(struct cdev *i_dev, u_long cmd, caddr_t ar
return (EBADF);
 
d = device_get_softc(((struct snd_mixer *)i_dev->si_drv1)->dev);
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
return (EBADF);
 
PCM_GIANT_ENTER(d);
@@ -1412,7 +1412,7 @@ mixer_oss_mixerinfo(struct cdev *i_dev, oss_mixerinfo 
for (i = 0; pcm_devclass != NULL &&
i < devclass_get_maxunit(pcm_devclass); i++) {
d = devclass_get_softc(pcm_devclass, i);
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
continue;
 
/* XXX Need Giant magic entry */

Modified: stable/9/sys/dev/sound/pcm/sound.c
==
--- stable/9/sys/dev/sound/pcm/sound.c  Wed Mar 11 08:26:11 2020
(r358879)
+++ stable/9/sys/dev/sound/pcm/sound.c  Wed Mar 11 08:26:52 2020 

svn commit: r358879 - stable/10/sys/dev/sound/pcm

2020-03-11 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar 11 08:26:11 2020
New Revision: 358879
URL: https://svnweb.freebsd.org/changeset/base/358879

Log:
  MFC r358629:
  Implement a detaching flag for the sound(4) subsystem to take
  appropriate actions when we are trying to detach an audio device,
  but cannot because someone is using it.
  
  This avoids applications having to wait for the DSP read data
  timeout before they receive any error indication.
  Tested with virtual_oss(8).
  
  Remove some unused definitions while at it.
  
  PR:   194727
  Sponsored by: Mellanox Technologies

Modified:
  stable/10/sys/dev/sound/pcm/dsp.c
  stable/10/sys/dev/sound/pcm/mixer.c
  stable/10/sys/dev/sound/pcm/sound.c
  stable/10/sys/dev/sound/pcm/sound.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sound/pcm/dsp.c
==
--- stable/10/sys/dev/sound/pcm/dsp.c   Wed Mar 11 08:25:33 2020
(r358878)
+++ stable/10/sys/dev/sound/pcm/dsp.c   Wed Mar 11 08:26:11 2020
(r358879)
@@ -459,7 +459,7 @@ dsp_open(struct cdev *i_dev, int flags, int mode, stru
return (ENODEV);
 
d = dsp_get_info(i_dev);
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
return (EBADF);
 
PCM_GIANT_ENTER(d);
@@ -829,7 +829,7 @@ dsp_io_ops(struct cdev *i_dev, struct uio *buf)
("%s(): io train wreck!", __func__));
 
d = dsp_get_info(i_dev);
-   if (!DSP_REGISTERED(d, i_dev))
+   if (PCM_DETACHING(d) || !DSP_REGISTERED(d, i_dev))
return (EBADF);
 
PCM_GIANT_ENTER(d);
@@ -1074,7 +1074,7 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg,
int *arg_i, ret, tmp;
 
d = dsp_get_info(i_dev);
-   if (!DSP_REGISTERED(d, i_dev))
+   if (PCM_DETACHING(d) || !DSP_REGISTERED(d, i_dev))
return (EBADF);
 
PCM_GIANT_ENTER(d);
@@ -2169,9 +2169,11 @@ dsp_poll(struct cdev *i_dev, int events, struct thread
int ret, e;
 
d = dsp_get_info(i_dev);
-   if (!DSP_REGISTERED(d, i_dev))
-   return (EBADF);
-
+   if (PCM_DETACHING(d) || !DSP_REGISTERED(d, i_dev)) {
+   /* XXX many clients don't understand POLLNVAL */
+   return (events & (POLLHUP | POLLPRI | POLLIN |
+   POLLRDNORM | POLLOUT | POLLWRNORM));
+   }
PCM_GIANT_ENTER(d);
 
wrch = NULL;
@@ -2242,7 +2244,7 @@ dsp_mmap_single(struct cdev *i_dev, vm_ooffset_t *offs
return (EINVAL);
 
d = dsp_get_info(i_dev);
-   if (!DSP_REGISTERED(d, i_dev))
+   if (PCM_DETACHING(d) || !DSP_REGISTERED(d, i_dev))
return (EINVAL);
 
PCM_GIANT_ENTER(d);

Modified: stable/10/sys/dev/sound/pcm/mixer.c
==
--- stable/10/sys/dev/sound/pcm/mixer.c Wed Mar 11 08:25:33 2020
(r358878)
+++ stable/10/sys/dev/sound/pcm/mixer.c Wed Mar 11 08:26:11 2020
(r358879)
@@ -152,7 +152,7 @@ mixer_set_softpcmvol(struct snd_mixer *m, struct sndde
struct pcm_channel *c;
int dropmtx, acquiremtx;
 
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
return (EINVAL);
 
if (mtx_owned(m->lock))
@@ -205,7 +205,7 @@ mixer_set_eq(struct snd_mixer *m, struct snddev_info *
else
return (EINVAL);
 
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
return (EINVAL);
 
if (mtx_owned(m->lock))
@@ -1045,7 +1045,7 @@ mixer_open(struct cdev *i_dev, int flags, int mode, st
 
m = i_dev->si_drv1;
d = device_get_softc(m->dev);
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
return (EBADF);
 
/* XXX Need Giant magic entry ??? */
@@ -1201,7 +1201,7 @@ mixer_ioctl(struct cdev *i_dev, u_long cmd, caddr_t ar
return (EBADF);
 
d = device_get_softc(((struct snd_mixer *)i_dev->si_drv1)->dev);
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
return (EBADF);
 
PCM_GIANT_ENTER(d);
@@ -1412,7 +1412,7 @@ mixer_oss_mixerinfo(struct cdev *i_dev, oss_mixerinfo 
for (i = 0; pcm_devclass != NULL &&
i < devclass_get_maxunit(pcm_devclass); i++) {
d = devclass_get_softc(pcm_devclass, i);
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
continue;
 
/* XXX Need Giant magic entry */

Modified: stable/10/sys/dev/sound/pcm/sound.c
==
--- stable/10/sys/dev/sound/pcm/sound.c Wed Mar 11 08:25:33 2020
(r358878)
+++ stable/10/sys/dev/sound/pcm/sound.c Wed Mar 11 08:26:11 2020 

svn commit: r358878 - stable/11/sys/dev/sound/pcm

2020-03-11 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar 11 08:25:33 2020
New Revision: 358878
URL: https://svnweb.freebsd.org/changeset/base/358878

Log:
  MFC r358629:
  Implement a detaching flag for the sound(4) subsystem to take
  appropriate actions when we are trying to detach an audio device,
  but cannot because someone is using it.
  
  This avoids applications having to wait for the DSP read data
  timeout before they receive any error indication.
  Tested with virtual_oss(8).
  
  Remove some unused definitions while at it.
  
  PR:   194727
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/dev/sound/pcm/dsp.c
  stable/11/sys/dev/sound/pcm/mixer.c
  stable/11/sys/dev/sound/pcm/sound.c
  stable/11/sys/dev/sound/pcm/sound.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sound/pcm/dsp.c
==
--- stable/11/sys/dev/sound/pcm/dsp.c   Wed Mar 11 08:24:50 2020
(r358877)
+++ stable/11/sys/dev/sound/pcm/dsp.c   Wed Mar 11 08:25:33 2020
(r358878)
@@ -458,7 +458,7 @@ dsp_open(struct cdev *i_dev, int flags, int mode, stru
return (ENODEV);
 
d = dsp_get_info(i_dev);
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
return (EBADF);
 
PCM_GIANT_ENTER(d);
@@ -828,7 +828,7 @@ dsp_io_ops(struct cdev *i_dev, struct uio *buf)
("%s(): io train wreck!", __func__));
 
d = dsp_get_info(i_dev);
-   if (!DSP_REGISTERED(d, i_dev))
+   if (PCM_DETACHING(d) || !DSP_REGISTERED(d, i_dev))
return (EBADF);
 
PCM_GIANT_ENTER(d);
@@ -1073,7 +1073,7 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg,
int *arg_i, ret, tmp;
 
d = dsp_get_info(i_dev);
-   if (!DSP_REGISTERED(d, i_dev))
+   if (PCM_DETACHING(d) || !DSP_REGISTERED(d, i_dev))
return (EBADF);
 
PCM_GIANT_ENTER(d);
@@ -2168,9 +2168,11 @@ dsp_poll(struct cdev *i_dev, int events, struct thread
int ret, e;
 
d = dsp_get_info(i_dev);
-   if (!DSP_REGISTERED(d, i_dev))
-   return (EBADF);
-
+   if (PCM_DETACHING(d) || !DSP_REGISTERED(d, i_dev)) {
+   /* XXX many clients don't understand POLLNVAL */
+   return (events & (POLLHUP | POLLPRI | POLLIN |
+   POLLRDNORM | POLLOUT | POLLWRNORM));
+   }
PCM_GIANT_ENTER(d);
 
wrch = NULL;
@@ -2241,7 +2243,7 @@ dsp_mmap_single(struct cdev *i_dev, vm_ooffset_t *offs
return (EINVAL);
 
d = dsp_get_info(i_dev);
-   if (!DSP_REGISTERED(d, i_dev))
+   if (PCM_DETACHING(d) || !DSP_REGISTERED(d, i_dev))
return (EINVAL);
 
PCM_GIANT_ENTER(d);

Modified: stable/11/sys/dev/sound/pcm/mixer.c
==
--- stable/11/sys/dev/sound/pcm/mixer.c Wed Mar 11 08:24:50 2020
(r358877)
+++ stable/11/sys/dev/sound/pcm/mixer.c Wed Mar 11 08:25:33 2020
(r358878)
@@ -151,7 +151,7 @@ mixer_set_softpcmvol(struct snd_mixer *m, struct sndde
struct pcm_channel *c;
int dropmtx, acquiremtx;
 
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
return (EINVAL);
 
if (mtx_owned(m->lock))
@@ -204,7 +204,7 @@ mixer_set_eq(struct snd_mixer *m, struct snddev_info *
else
return (EINVAL);
 
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
return (EINVAL);
 
if (mtx_owned(m->lock))
@@ -1044,7 +1044,7 @@ mixer_open(struct cdev *i_dev, int flags, int mode, st
 
m = i_dev->si_drv1;
d = device_get_softc(m->dev);
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
return (EBADF);
 
/* XXX Need Giant magic entry ??? */
@@ -1200,7 +1200,7 @@ mixer_ioctl(struct cdev *i_dev, u_long cmd, caddr_t ar
return (EBADF);
 
d = device_get_softc(((struct snd_mixer *)i_dev->si_drv1)->dev);
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
return (EBADF);
 
PCM_GIANT_ENTER(d);
@@ -1409,7 +1409,7 @@ mixer_oss_mixerinfo(struct cdev *i_dev, oss_mixerinfo 
for (i = 0; pcm_devclass != NULL &&
i < devclass_get_maxunit(pcm_devclass); i++) {
d = devclass_get_softc(pcm_devclass, i);
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
continue;
 
/* XXX Need Giant magic entry */

Modified: stable/11/sys/dev/sound/pcm/sound.c
==
--- stable/11/sys/dev/sound/pcm/sound.c Wed Mar 11 08:24:50 2020
(r358877)
+++ stable/11/sys/dev/sound/pcm/sound.c Wed Mar 11 08:25:33 2020 

svn commit: r358877 - stable/12/sys/dev/sound/pcm

2020-03-11 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar 11 08:24:50 2020
New Revision: 358877
URL: https://svnweb.freebsd.org/changeset/base/358877

Log:
  MFC r358629:
  Implement a detaching flag for the sound(4) subsystem to take
  appropriate actions when we are trying to detach an audio device,
  but cannot because someone is using it.
  
  This avoids applications having to wait for the DSP read data
  timeout before they receive any error indication.
  Tested with virtual_oss(8).
  
  Remove some unused definitions while at it.
  
  PR:   194727
  Sponsored by: Mellanox Technologies

Modified:
  stable/12/sys/dev/sound/pcm/dsp.c
  stable/12/sys/dev/sound/pcm/mixer.c
  stable/12/sys/dev/sound/pcm/sound.c
  stable/12/sys/dev/sound/pcm/sound.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/sound/pcm/dsp.c
==
--- stable/12/sys/dev/sound/pcm/dsp.c   Wed Mar 11 08:23:14 2020
(r358876)
+++ stable/12/sys/dev/sound/pcm/dsp.c   Wed Mar 11 08:24:50 2020
(r358877)
@@ -460,7 +460,7 @@ dsp_open(struct cdev *i_dev, int flags, int mode, stru
return (ENODEV);
 
d = dsp_get_info(i_dev);
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
return (EBADF);
 
PCM_GIANT_ENTER(d);
@@ -830,7 +830,7 @@ dsp_io_ops(struct cdev *i_dev, struct uio *buf)
("%s(): io train wreck!", __func__));
 
d = dsp_get_info(i_dev);
-   if (!DSP_REGISTERED(d, i_dev))
+   if (PCM_DETACHING(d) || !DSP_REGISTERED(d, i_dev))
return (EBADF);
 
PCM_GIANT_ENTER(d);
@@ -1075,7 +1075,7 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg,
int *arg_i, ret, tmp;
 
d = dsp_get_info(i_dev);
-   if (!DSP_REGISTERED(d, i_dev))
+   if (PCM_DETACHING(d) || !DSP_REGISTERED(d, i_dev))
return (EBADF);
 
PCM_GIANT_ENTER(d);
@@ -2170,9 +2170,11 @@ dsp_poll(struct cdev *i_dev, int events, struct thread
int ret, e;
 
d = dsp_get_info(i_dev);
-   if (!DSP_REGISTERED(d, i_dev))
-   return (EBADF);
-
+   if (PCM_DETACHING(d) || !DSP_REGISTERED(d, i_dev)) {
+   /* XXX many clients don't understand POLLNVAL */
+   return (events & (POLLHUP | POLLPRI | POLLIN |
+   POLLRDNORM | POLLOUT | POLLWRNORM));
+   }
PCM_GIANT_ENTER(d);
 
wrch = NULL;
@@ -2246,7 +2248,7 @@ dsp_mmap_single(struct cdev *i_dev, vm_ooffset_t *offs
return (EINVAL);
 
d = dsp_get_info(i_dev);
-   if (!DSP_REGISTERED(d, i_dev))
+   if (PCM_DETACHING(d) || !DSP_REGISTERED(d, i_dev))
return (EINVAL);
 
PCM_GIANT_ENTER(d);

Modified: stable/12/sys/dev/sound/pcm/mixer.c
==
--- stable/12/sys/dev/sound/pcm/mixer.c Wed Mar 11 08:23:14 2020
(r358876)
+++ stable/12/sys/dev/sound/pcm/mixer.c Wed Mar 11 08:24:50 2020
(r358877)
@@ -153,7 +153,7 @@ mixer_set_softpcmvol(struct snd_mixer *m, struct sndde
struct pcm_channel *c;
int dropmtx, acquiremtx;
 
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
return (EINVAL);
 
if (mtx_owned(m->lock))
@@ -206,7 +206,7 @@ mixer_set_eq(struct snd_mixer *m, struct snddev_info *
else
return (EINVAL);
 
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
return (EINVAL);
 
if (mtx_owned(m->lock))
@@ -1046,7 +1046,7 @@ mixer_open(struct cdev *i_dev, int flags, int mode, st
 
m = i_dev->si_drv1;
d = device_get_softc(m->dev);
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
return (EBADF);
 
/* XXX Need Giant magic entry ??? */
@@ -1202,7 +1202,7 @@ mixer_ioctl(struct cdev *i_dev, u_long cmd, caddr_t ar
return (EBADF);
 
d = device_get_softc(((struct snd_mixer *)i_dev->si_drv1)->dev);
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
return (EBADF);
 
PCM_GIANT_ENTER(d);
@@ -1411,7 +1411,7 @@ mixer_oss_mixerinfo(struct cdev *i_dev, oss_mixerinfo 
for (i = 0; pcm_devclass != NULL &&
i < devclass_get_maxunit(pcm_devclass); i++) {
d = devclass_get_softc(pcm_devclass, i);
-   if (!PCM_REGISTERED(d))
+   if (PCM_DETACHING(d) || !PCM_REGISTERED(d))
continue;
 
/* XXX Need Giant magic entry */

Modified: stable/12/sys/dev/sound/pcm/sound.c
==
--- stable/12/sys/dev/sound/pcm/sound.c Wed Mar 11 08:23:14 2020
(r358876)
+++ stable/12/sys/dev/sound/pcm/sound.c Wed Mar 11 08:24:50 2020 

svn commit: r358876 - in stable/9/sys/dev/usb: . controller

2020-03-11 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar 11 08:23:14 2020
New Revision: 358876
URL: https://svnweb.freebsd.org/changeset/base/358876

Log:
  MFC r358738:
  Remove the power bit from the super speed root hub port status register
  because it clobbers the super speed link status when a device is in super
  speed mode. Currently the power bit is not needed for anything in the USB
  hub driver.
  
  This fixes USB warm reset for super speed devices.
  
  Tested by:shichun...@dell.com
  Sponsored by: Mellanox Technologies

Modified:
  stable/9/sys/dev/usb/controller/xhci.c
  stable/9/sys/dev/usb/usb_hub.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/dev/usb/controller/xhci.c
==
--- stable/9/sys/dev/usb/controller/xhci.c  Wed Mar 11 08:21:48 2020
(r358875)
+++ stable/9/sys/dev/usb/controller/xhci.c  Wed Mar 11 08:23:14 2020
(r358876)
@@ -3514,13 +3514,10 @@ xhci_roothub_exec(struct usb_device *udev,
i |= UPS_OVERCURRENT_INDICATOR;
if (v & XHCI_PS_PR)
i |= UPS_RESET;
-   if (v & XHCI_PS_PP) {
-   /*
-* The USB 3.0 RH is using the
-* USB 2.0's power bit
-*/
-   i |= UPS_PORT_POWER;
-   }
+#if 0
+   if (v & XHCI_PS_PP)
+   /* XXX undefined */
+#endif
USETW(sc->sc_hub_desc.ps.wPortStatus, i);
 
i = 0;

Modified: stable/9/sys/dev/usb/usb_hub.c
==
--- stable/9/sys/dev/usb/usb_hub.c  Wed Mar 11 08:21:48 2020
(r358875)
+++ stable/9/sys/dev/usb/usb_hub.c  Wed Mar 11 08:23:14 2020
(r358876)
@@ -646,7 +646,7 @@ repeat:
break;
case USB_SPEED_SUPER:
if (udev->parent_hub == NULL)
-   power_mask = UPS_PORT_POWER;
+   power_mask = 0; /* XXX undefined */
else
power_mask = UPS_PORT_POWER_SS;
break;
@@ -654,7 +654,7 @@ repeat:
power_mask = 0;
break;
}
-   if (!(sc->sc_st.port_status & power_mask)) {
+   if ((sc->sc_st.port_status & power_mask) != power_mask) {
DPRINTF("WARNING: strange, connected port %d "
"has no power\n", portno);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r358875 - in stable/10/sys/dev/usb: . controller

2020-03-11 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar 11 08:21:48 2020
New Revision: 358875
URL: https://svnweb.freebsd.org/changeset/base/358875

Log:
  MFC r358738:
  Remove the power bit from the super speed root hub port status register
  because it clobbers the super speed link status when a device is in super
  speed mode. Currently the power bit is not needed for anything in the USB
  hub driver.
  
  This fixes USB warm reset for super speed devices.
  
  Tested by:shichun...@dell.com
  Sponsored by: Mellanox Technologies

Modified:
  stable/10/sys/dev/usb/controller/xhci.c
  stable/10/sys/dev/usb/usb_hub.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/usb/controller/xhci.c
==
--- stable/10/sys/dev/usb/controller/xhci.c Wed Mar 11 08:21:04 2020
(r358874)
+++ stable/10/sys/dev/usb/controller/xhci.c Wed Mar 11 08:21:48 2020
(r358875)
@@ -3591,13 +3591,10 @@ xhci_roothub_exec(struct usb_device *udev,
i |= UPS_OVERCURRENT_INDICATOR;
if (v & XHCI_PS_PR)
i |= UPS_RESET;
-   if (v & XHCI_PS_PP) {
-   /*
-* The USB 3.0 RH is using the
-* USB 2.0's power bit
-*/
-   i |= UPS_PORT_POWER;
-   }
+#if 0
+   if (v & XHCI_PS_PP)
+   /* XXX undefined */
+#endif
USETW(sc->sc_hub_desc.ps.wPortStatus, i);
 
i = 0;

Modified: stable/10/sys/dev/usb/usb_hub.c
==
--- stable/10/sys/dev/usb/usb_hub.c Wed Mar 11 08:21:04 2020
(r358874)
+++ stable/10/sys/dev/usb/usb_hub.c Wed Mar 11 08:21:48 2020
(r358875)
@@ -692,7 +692,7 @@ repeat:
break;
case USB_SPEED_SUPER:
if (udev->parent_hub == NULL)
-   power_mask = UPS_PORT_POWER;
+   power_mask = 0; /* XXX undefined */
else
power_mask = UPS_PORT_POWER_SS;
break;
@@ -700,7 +700,7 @@ repeat:
power_mask = 0;
break;
}
-   if (!(sc->sc_st.port_status & power_mask)) {
+   if ((sc->sc_st.port_status & power_mask) != power_mask) {
DPRINTF("WARNING: strange, connected port %d "
"has no power\n", portno);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r358874 - in stable/11/sys/dev/usb: . controller

2020-03-11 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar 11 08:21:04 2020
New Revision: 358874
URL: https://svnweb.freebsd.org/changeset/base/358874

Log:
  MFC r358738:
  Remove the power bit from the super speed root hub port status register
  because it clobbers the super speed link status when a device is in super
  speed mode. Currently the power bit is not needed for anything in the USB
  hub driver.
  
  This fixes USB warm reset for super speed devices.
  
  Tested by:shichun...@dell.com
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/dev/usb/controller/xhci.c
  stable/11/sys/dev/usb/usb_hub.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/usb/controller/xhci.c
==
--- stable/11/sys/dev/usb/controller/xhci.c Wed Mar 11 08:20:14 2020
(r358873)
+++ stable/11/sys/dev/usb/controller/xhci.c Wed Mar 11 08:21:04 2020
(r358874)
@@ -3588,13 +3588,10 @@ xhci_roothub_exec(struct usb_device *udev,
i |= UPS_OVERCURRENT_INDICATOR;
if (v & XHCI_PS_PR)
i |= UPS_RESET;
-   if (v & XHCI_PS_PP) {
-   /*
-* The USB 3.0 RH is using the
-* USB 2.0's power bit
-*/
-   i |= UPS_PORT_POWER;
-   }
+#if 0
+   if (v & XHCI_PS_PP)
+   /* XXX undefined */
+#endif
USETW(sc->sc_hub_desc.ps.wPortStatus, i);
 
i = 0;

Modified: stable/11/sys/dev/usb/usb_hub.c
==
--- stable/11/sys/dev/usb/usb_hub.c Wed Mar 11 08:20:14 2020
(r358873)
+++ stable/11/sys/dev/usb/usb_hub.c Wed Mar 11 08:21:04 2020
(r358874)
@@ -689,7 +689,7 @@ repeat:
break;
case USB_SPEED_SUPER:
if (udev->parent_hub == NULL)
-   power_mask = UPS_PORT_POWER;
+   power_mask = 0; /* XXX undefined */
else
power_mask = UPS_PORT_POWER_SS;
break;
@@ -697,7 +697,7 @@ repeat:
power_mask = 0;
break;
}
-   if (!(sc->sc_st.port_status & power_mask)) {
+   if ((sc->sc_st.port_status & power_mask) != power_mask) {
DPRINTF("WARNING: strange, connected port %d "
"has no power\n", portno);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r358873 - in stable/12/sys/dev/usb: . controller

2020-03-11 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar 11 08:20:14 2020
New Revision: 358873
URL: https://svnweb.freebsd.org/changeset/base/358873

Log:
  MFC r358738:
  Remove the power bit from the super speed root hub port status register
  because it clobbers the super speed link status when a device is in super
  speed mode. Currently the power bit is not needed for anything in the USB
  hub driver.
  
  This fixes USB warm reset for super speed devices.
  
  Tested by:shichun...@dell.com
  Sponsored by: Mellanox Technologies

Modified:
  stable/12/sys/dev/usb/controller/xhci.c
  stable/12/sys/dev/usb/usb_hub.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/usb/controller/xhci.c
==
--- stable/12/sys/dev/usb/controller/xhci.c Wed Mar 11 08:16:13 2020
(r358872)
+++ stable/12/sys/dev/usb/controller/xhci.c Wed Mar 11 08:20:14 2020
(r358873)
@@ -3590,13 +3590,10 @@ xhci_roothub_exec(struct usb_device *udev,
i |= UPS_OVERCURRENT_INDICATOR;
if (v & XHCI_PS_PR)
i |= UPS_RESET;
-   if (v & XHCI_PS_PP) {
-   /*
-* The USB 3.0 RH is using the
-* USB 2.0's power bit
-*/
-   i |= UPS_PORT_POWER;
-   }
+#if 0
+   if (v & XHCI_PS_PP)
+   /* XXX undefined */
+#endif
USETW(sc->sc_hub_desc.ps.wPortStatus, i);
 
i = 0;

Modified: stable/12/sys/dev/usb/usb_hub.c
==
--- stable/12/sys/dev/usb/usb_hub.c Wed Mar 11 08:16:13 2020
(r358872)
+++ stable/12/sys/dev/usb/usb_hub.c Wed Mar 11 08:20:14 2020
(r358873)
@@ -691,7 +691,7 @@ repeat:
break;
case USB_SPEED_SUPER:
if (udev->parent_hub == NULL)
-   power_mask = UPS_PORT_POWER;
+   power_mask = 0; /* XXX undefined */
else
power_mask = UPS_PORT_POWER_SS;
break;
@@ -699,7 +699,7 @@ repeat:
power_mask = 0;
break;
}
-   if (!(sc->sc_st.port_status & power_mask)) {
+   if ((sc->sc_st.port_status & power_mask) != power_mask) {
DPRINTF("WARNING: strange, connected port %d "
"has no power\n", portno);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r358872 - head/sys/dev/usb/input

2020-03-11 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar 11 08:16:13 2020
New Revision: 358872
URL: https://svnweb.freebsd.org/changeset/base/358872

Log:
  If the USB frame length is set to 1024 bytes, WMT_BSIZE, the EETI controller
  will pack multiple touch events in the packet and the current code will only
  process the first touch event.
  
  As a result some important events are lost like releasing the finger from the
  touchscreen.
  
  Use the maximum maximum packet size as buffer size instead.
  
  Submitted by: Oskar Holmlund 
  PR:   244718
  MFC after:3 days
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/usb/input/wmt.c

Modified: head/sys/dev/usb/input/wmt.c
==
--- head/sys/dev/usb/input/wmt.cWed Mar 11 08:08:53 2020
(r358871)
+++ head/sys/dev/usb/input/wmt.cWed Mar 11 08:16:13 2020
(r358872)
@@ -251,7 +251,7 @@ static const struct usb_config wmt_config[WMT_N_TRANSF
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_IN,
.flags = { .pipe_bof = 1, .short_xfer_ok = 1 },
-   .bufsize = WMT_BSIZE,
+   .bufsize = 0,   /* use wMaxPacketSize */
.callback = _intr_callback,
},
 };
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


PU Coated Fabric

2020-03-11 Thread Eason


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


Re: svn commit: r358858 - head/sbin/ipfw

2020-03-11 Thread Alexander V . Chernikov
11.03.2020, 07:14, "O. Hartmann" :
> On Tue, 10 Mar 2020 20:30:21 + (UTC)
> "Alexander V. Chernikov"  wrote:
>
>>  Author: melifaro
>>  Date: Tue Mar 10 20:30:21 2020
>>  New Revision: 358858
>>  URL: https://svnweb.freebsd.org/changeset/base/358858
>>
>>  Log:
>>    Don't assume !IPv6 is IPv4 in ipfw(8) add_src() and add_dst().
>>
>>    Submitted by: Neel Chauhan 
>>    MFC after: 2 weeks
>>    Differential Revision: https://reviews.freebsd.org/D21812
>>
>>  Modified:
>>    head/sbin/ipfw/ipfw2.c
>>
>>  Modified: head/sbin/ipfw/ipfw2.c
>>  
>> ==
>>  --- head/sbin/ipfw/ipfw2.c Tue Mar 10 20:25:36 2020 (r358857)
>>  +++ head/sbin/ipfw/ipfw2.c Tue Mar 10 20:30:21 2020 (r358858)
>>  @@ -3717,11 +3717,10 @@ add_src(ipfw_insn *cmd, char *av, u_char proto, int 
>> cb
>>   if (proto == IPPROTO_IPV6 || strcmp(av, "me6") == 0 ||
>>   inet_pton(AF_INET6, host, ) == 1)
>>   ret = add_srcip6(cmd, av, cblen, tstate);
>>  - /* XXX: should check for IPv4, not !IPv6 */
>>  - if (ret == NULL && (proto == IPPROTO_IP || strcmp(av, "me") == 0 ||
>>  - inet_pton(AF_INET6, host, ) != 1))
>>  + else if (proto == IPPROTO_IP || strcmp(av, "me") == 0 ||
>>  + inet_pton(AF_INET, host, ) == 1)
>>   ret = add_srcip(cmd, av, cblen, tstate);
>>  - if (ret == NULL && strcmp(av, "any") != 0)
>>  + else if (ret == NULL && strcmp(av, "any") != 0)
>>   ret = cmd;
>>
>>   return ret;
>>  @@ -3748,11 +3747,10 @@ add_dst(ipfw_insn *cmd, char *av, u_char proto, int 
>> cb
>>   if (proto == IPPROTO_IPV6 || strcmp(av, "me6") == 0 ||
>>   inet_pton(AF_INET6, host, ) == 1)
>>   ret = add_dstip6(cmd, av, cblen, tstate);
>>  - /* XXX: should check for IPv4, not !IPv6 */
>>  - if (ret == NULL && (proto == IPPROTO_IP || strcmp(av, "me") == 0 ||
>>  - inet_pton(AF_INET6, host, ) != 1))
>>  + else if (proto == IPPROTO_IP || strcmp(av, "me") == 0 ||
>>  + inet_pton(AF_INET, host, ) == 1)
>>   ret = add_dstip(cmd, av, cblen, tstate);
>>  - if (ret == NULL && strcmp(av, "any") != 0)
>>  + else if (ret == NULL && strcmp(av, "any") != 0)
>>   ret = cmd;
>>
>>   return ret;
>>  ___
>>  svn-src-h...@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"
>
> This seems to trigger some issues in CURRENT's ipfw script handling rules. On
> all CURRENT boxes running
>>  FreeBSD 13.0-CURRENT #0 r358851: Tue Mar 10 21:17:39 CET 2020 amd64, the 
>> boxes
>
> aren't accessible via net due to errors occuring when loading ipfw rules:
Whoops.
Terribly sorry for breaking your setup. Reverted in r358871.
>
> [/etc/rc.conf]
> firewall_type="WORKSTATION"
> firewall_myservices="22/tcp 80/tcp 443/tcp" # List of TCP ports on
> which this host
> # offers services for "workstation" firewall.
> firewall_allowservices="192.168.0.0/24 fd11:43:2::/64" # List of
> IPs which have access to
> # $firewall_myservices for "workstation"
> # firewall.
> firewall_trusted="" # List of IPs which have full access to this
> # host for "workstation" firewall.
>
> [...]
> # service ipfw restart
> Flushed all rules.
> 00100 allow ip from any to any via lo0
> 00200 deny ip from any to 127.0.0.0/8
> 00300 deny ip from 127.0.0.0/8 to any
> 00400 deny ip from any to ::1
> 00500 deny ip from ::1 to any
> 00600 allow ipv6-icmp from :: to ff02::/16
> 00700 allow ipv6-icmp from fe80::/10 to fe80::/10
> 00800 allow ipv6-icmp from fe80::/10 to ff02::/16
> ipfw: bad source address any
> ipfw: bad source address any
> 0 check-state :default
> ipfw: bad destination address any
> ipfw: bad destination address any
> ipfw: bad destination address any
> ipfw: bad destination address any
> ipfw: bad destination address any
> 01000 allow udp from 0.0.0.0 68 to 255.255.255.255 67 out
> ipfw: bad source address any
> ipfw: bad source address any
> 01100 allow udp from fe80::/10 to me 546 in
> ipfw: bad source address any
> ipfw: bad source address any
> ipfw: bad source address any
> ipfw: bad source address any
> [...]
>
> The problem also occur if set
>
> firewall_allowservices="any"
>
> in /etc/rc.conf
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r358871 - head/sbin/ipfw

2020-03-11 Thread Alexander V. Chernikov
Author: melifaro
Date: Wed Mar 11 08:08:53 2020
New Revision: 358871
URL: https://svnweb.freebsd.org/changeset/base/358871

Log:
  Revert r358858 as it breaks some ipfw(8) setups.
  
  Reported by:  O. Hartmann 

Modified:
  head/sbin/ipfw/ipfw2.c

Modified: head/sbin/ipfw/ipfw2.c
==
--- head/sbin/ipfw/ipfw2.c  Wed Mar 11 05:45:33 2020(r358870)
+++ head/sbin/ipfw/ipfw2.c  Wed Mar 11 08:08:53 2020(r358871)
@@ -3717,10 +3717,11 @@ add_src(ipfw_insn *cmd, char *av, u_char proto, int cb
if (proto == IPPROTO_IPV6  || strcmp(av, "me6") == 0 ||
inet_pton(AF_INET6, host, ) == 1)
ret = add_srcip6(cmd, av, cblen, tstate);
-   else if (proto == IPPROTO_IP || strcmp(av, "me") == 0 ||
-   inet_pton(AF_INET, host, ) == 1)
+   /* XXX: should check for IPv4, not !IPv6 */
+   if (ret == NULL && (proto == IPPROTO_IP || strcmp(av, "me") == 0 ||
+   inet_pton(AF_INET6, host, ) != 1))
ret = add_srcip(cmd, av, cblen, tstate);
-   else if (ret == NULL && strcmp(av, "any") != 0)
+   if (ret == NULL && strcmp(av, "any") != 0)
ret = cmd;
 
return ret;
@@ -3747,10 +3748,11 @@ add_dst(ipfw_insn *cmd, char *av, u_char proto, int cb
if (proto == IPPROTO_IPV6  || strcmp(av, "me6") == 0 ||
inet_pton(AF_INET6, host, ) == 1)
ret = add_dstip6(cmd, av, cblen, tstate);
-   else if (proto == IPPROTO_IP || strcmp(av, "me") == 0 ||
-   inet_pton(AF_INET, host, ) == 1)
+   /* XXX: should check for IPv4, not !IPv6 */
+   if (ret == NULL && (proto == IPPROTO_IP || strcmp(av, "me") == 0 ||
+   inet_pton(AF_INET6, host, ) != 1))
ret = add_dstip(cmd, av, cblen, tstate);
-   else if (ret == NULL && strcmp(av, "any") != 0)
+   if (ret == NULL && strcmp(av, "any") != 0)
ret = cmd;
 
return ret;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r358858 - head/sbin/ipfw

2020-03-11 Thread O. Hartmann
On Tue, 10 Mar 2020 20:30:21 + (UTC)
"Alexander V. Chernikov"  wrote:

> Author: melifaro
> Date: Tue Mar 10 20:30:21 2020
> New Revision: 358858
> URL: https://svnweb.freebsd.org/changeset/base/358858
>
> Log:
>   Don't assume !IPv6 is IPv4 in ipfw(8) add_src() and add_dst().
>
>   Submitted by:   Neel Chauhan 
>   MFC after:  2 weeks
>   Differential Revision:  https://reviews.freebsd.org/D21812
>
> Modified:
>   head/sbin/ipfw/ipfw2.c
>
> Modified: head/sbin/ipfw/ipfw2.c
> ==
> --- head/sbin/ipfw/ipfw2.cTue Mar 10 20:25:36 2020(r358857)
> +++ head/sbin/ipfw/ipfw2.cTue Mar 10 20:30:21 2020(r358858)
> @@ -3717,11 +3717,10 @@ add_src(ipfw_insn *cmd, char *av, u_char proto, int cb
>   if (proto == IPPROTO_IPV6  || strcmp(av, "me6") == 0 ||
>   inet_pton(AF_INET6, host, ) == 1)
>   ret = add_srcip6(cmd, av, cblen, tstate);
> - /* XXX: should check for IPv4, not !IPv6 */
> - if (ret == NULL && (proto == IPPROTO_IP || strcmp(av, "me") == 0 ||
> - inet_pton(AF_INET6, host, ) != 1))
> + else if (proto == IPPROTO_IP || strcmp(av, "me") == 0 ||
> + inet_pton(AF_INET, host, ) == 1)
>   ret = add_srcip(cmd, av, cblen, tstate);
> - if (ret == NULL && strcmp(av, "any") != 0)
> + else if (ret == NULL && strcmp(av, "any") != 0)
>   ret = cmd;
>
>   return ret;
> @@ -3748,11 +3747,10 @@ add_dst(ipfw_insn *cmd, char *av, u_char proto, int cb
>   if (proto == IPPROTO_IPV6  || strcmp(av, "me6") == 0 ||
>   inet_pton(AF_INET6, host, ) == 1)
>   ret = add_dstip6(cmd, av, cblen, tstate);
> - /* XXX: should check for IPv4, not !IPv6 */
> - if (ret == NULL && (proto == IPPROTO_IP || strcmp(av, "me") == 0 ||
> - inet_pton(AF_INET6, host, ) != 1))
> + else if (proto == IPPROTO_IP || strcmp(av, "me") == 0 ||
> + inet_pton(AF_INET, host, ) == 1)
>   ret = add_dstip(cmd, av, cblen, tstate);
> - if (ret == NULL && strcmp(av, "any") != 0)
> + else if (ret == NULL && strcmp(av, "any") != 0)
>   ret = cmd;
>
>   return ret;
> ___
> svn-src-h...@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"

This seems to trigger some issues in  CURRENT's ipfw script handling rules. On
all CURRENT boxes running
> FreeBSD 13.0-CURRENT #0 r358851: Tue Mar 10 21:17:39 CET 2020 amd64, the boxes
aren't accessible via net due to errors occuring when loading ipfw rules:


[/etc/rc.conf]
firewall_type="WORKSTATION"
firewall_myservices="22/tcp 80/tcp 443/tcp"  # List of TCP ports on
which this host
# offers services for "workstation" firewall.
firewall_allowservices="192.168.0.0/24 fd11:43:2::/64"   # List of
IPs which have access to
# $firewall_myservices for "workstation"
# firewall.
firewall_trusted="" # List of IPs which have full access to this
# host for "workstation" firewall.


[...]
# service ipfw restart
Flushed all rules.
00100 allow ip from any to any via lo0
00200 deny ip from any to 127.0.0.0/8
00300 deny ip from 127.0.0.0/8 to any
00400 deny ip from any to ::1
00500 deny ip from ::1 to any
00600 allow ipv6-icmp from :: to ff02::/16
00700 allow ipv6-icmp from fe80::/10 to fe80::/10
00800 allow ipv6-icmp from fe80::/10 to ff02::/16
ipfw: bad source address any
ipfw: bad source address any
0 check-state :default
ipfw: bad destination address any
ipfw: bad destination address any
ipfw: bad destination address any
ipfw: bad destination address any
ipfw: bad destination address any
01000 allow udp from 0.0.0.0 68 to 255.255.255.255 67 out
ipfw: bad source address any
ipfw: bad source address any
01100 allow udp from fe80::/10 to me 546 in
ipfw: bad source address any
ipfw: bad source address any
ipfw: bad source address any
ipfw: bad source address any
[...]

The problem also occur if set


firewall_allowservices="any"

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