Re: svn commit: r338172 - Now deprecating DRM

2018-08-23 Thread Matthew Macy
Rodney - we appreciate your emotional investment in the project. And as
convenient as it would be for me to take all the blame the imminent removal
of drm2 was communicated on public lists. Your soul contribution to the
discussion was to bemoan the fact that i386 would no longer have special
advantages over people using newer hardware. During this discussion you,
RE, or core could have chimed in with guidelines for a smooth deprecation
process. None of them did. To chime in now as if you were wounded by a
rogue actor is extremely disingenuous.  And as Kevin keeps point you keep
pointing at strawmen. This isn't how we'll grow the user base. (Assuming
that that's something you value as well).

And please don't forget that process exists to serve users not for its own
sake.

Thanks for all of your efforts on our behalf.

-M


On Thu, Aug 23, 2018 at 10:55 AM Rodney W. Grimes <
free...@pdx.rh.cn85.dnsmgr.net> wrote:

> [ Charset UTF-8 unsupported, converting... ]
> > On Wed, Aug 22, 2018 at 10:08 AM Rodney W. Grimes <
> > free...@pdx.rh.cn85.dnsmgr.net> wrote:
> >
> > > I think this deprecation is a rather serious deviation
> > > from the stated policy, in that 0 notification was
> > > made, core IMHO, has overstepped some boundaries in
> > > that respect.   These policies are promises to the
> > > downstream consumers, and violating them is very
> > > poor planning.
> > >
> >
> > Despite what the commit said, core didn't actually formally approve it
> > before the fact. That was one of the many miscommunications surrounding
> > this episode.
>
> Well I would say inlight of that fact a revert should be a no questions
> asked, doing much else risks build breakage within hours of code freeze.
>
>
> > I don't think you'll find anybody who would say this was well planned or
> > well executed.
>
> Agreed, so lets be simple in correcting it?
>
> From some investigation even the claim that "in base drm conflicts with
> ports drm" is not totally true, you just have to take a few steps to
> be sure you do not load the base versions, and do load the ports version.
>
> There is still time to revert this, add the gone_in(13) glue and have
> 12.0 go out in that state.
>
> I am concerned that if 1 person came forward right off the bat with
> this change, and we try to do something that takes care of just that
> issue we are going to have others come forward in time with similiar
> issues and we are going to look bad for failing to follow our own
> published guidelines.
>
> I see no smoking gun reason that this code has to die today,
> the ports are already setup with instructions on how to deal
> with the inbase drm.
>
> --
> Rod Grimes
> rgri...@freebsd.org
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r338290 - stable/11/share/man/man7

2018-08-23 Thread Kyle Evans
Author: kevans
Date: Fri Aug 24 02:23:25 2018
New Revision: 338290
URL: https://svnweb.freebsd.org/changeset/base/338290

Log:
  MFC r337906: Document KERNCONFDIR

Modified:
  stable/11/share/man/man7/build.7
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man7/build.7
==
--- stable/11/share/man/man7/build.7Fri Aug 24 02:21:14 2018
(r338289)
+++ stable/11/share/man/man7/build.7Fri Aug 24 02:23:25 2018
(r338290)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 11, 2017
+.Dd August 16, 2018
 .Dt BUILD 7
 .Os
 .Sh NAME
@@ -422,6 +422,14 @@ Overrides which kernel to build and install for the va
 make targets.
 It defaults to
 .Cm GENERIC .
+.It Va KERNCONFDIR
+Overrides the directory in which
+.Va KERNCONF
+and any files included by
+.Va KERNCONF
+should be found.
+Defaults to
+.Pa sys/${ARCH}/conf .
 .It Va KERNFAST
 If set, the build target
 .Cm buildkernel
___
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: r338289 - stable/11/sys/kern

2018-08-23 Thread Kyle Evans
Author: kevans
Date: Fri Aug 24 02:21:14 2018
New Revision: 338289
URL: https://svnweb.freebsd.org/changeset/base/338289

Log:
  MFC r338020: res_find: Fix fallback logic
  
  The fallback logic was broken if hints were found in multiple environments.
  If we found a hint in either the loader environment or the static
  environment, fallback would be incremented excessively when we returned to
  the environment-selection bits. These checks should have also been guarded
  by the fbacklvl checks. As a result, fbacklvl could quickly get to a point
  where we skip either the static environment and/or the static hints
  depending on which environments contained valid hints.
  
  The impact of this bug is minimal, mostly affecting mips boards that use
  static hints and may have hints in either the loader environment or the
  static environment.
  
  There may be better ways to express the searchable environments and
  describing their characteristics (immutable, already searched, etc.) but
  this may be revisited after 12 branches.

Modified:
  stable/11/sys/kern/subr_hints.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/subr_hints.c
==
--- stable/11/sys/kern/subr_hints.c Fri Aug 24 01:59:25 2018
(r338288)
+++ stable/11/sys/kern/subr_hints.c Fri Aug 24 02:21:14 2018
(r338289)
@@ -172,30 +172,37 @@ fallback:
if (dyn_used || fbacklvl >= FBACK_STATIC)
return (ENOENT);
 
-   if (fbacklvl <= FBACK_MDENV &&
-   _res_checkenv(md_envp)) {
-   hintp = md_envp;
-   goto found;
-   }
-   fbacklvl++;
+   switch (fbacklvl) {
+   case FBACK_MDENV:
+   fbacklvl++;
+   if (_res_checkenv(md_envp)) {
+   hintp = md_envp;
+   break;
+   }
 
-   if (!stenv_skip && fbacklvl <= FBACK_STENV &&
-   _res_checkenv(kern_envp)) {
-   hintp = kern_envp;
-   goto found;
-   } else
-   stenv_skip = true;
+   /* FALLTHROUGH */
+   case FBACK_STENV:
+   fbacklvl++;
+   if (!stenv_skip && _res_checkenv(kern_envp)) {
+   hintp = kern_envp;
+   break;
+   } else
+   stenv_skip = true;
 
-   fbacklvl++;
+   /* FALLTHROUGH */
+   case FBACK_STATIC:
+   fbacklvl++;
+   /* We'll fallback to static_hints if needed/can 
*/
+   if (!sthints_skip &&
+   _res_checkenv(static_hints))
+   hintp = static_hints;
+   else
+   sthints_skip = true;
 
-   /* We'll fallback to static_hints if needed/can */
-   if (!sthints_skip && fbacklvl <= FBACK_STATIC &&
-   _res_checkenv(static_hints))
-   hintp = static_hints;
-   else
-   sthints_skip = true;
-found:
-   fbacklvl++;
+   break;
+   default:
+   return (ENOENT);
+   }
}
 
if (hintp == 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: r338288 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2018-08-23 Thread Alexander Motin
Author: mav
Date: Fri Aug 24 01:59:25 2018
New Revision: 338288
URL: https://svnweb.freebsd.org/changeset/base/338288

Log:
  Unblock speculative prefetcher also on pool creation.
  
  Fix at r331950 appeared to be incomplete, fixing only case of pool
  import, but not pool creation, leaving prefetcher still blocked for
  newly created pools.
  
  Approved by:  re (gjb)
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c   Fri Aug 24 
00:25:25 2018(r338287)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c   Fri Aug 24 
01:59:25 2018(r338288)
@@ -4793,6 +4793,7 @@ spa_create(const char *pool, nvlist_t *nvroot, nvlist_
spa->spa_removing_phys.sr_state = DSS_NONE;
spa->spa_removing_phys.sr_removing_vdev = -1;
spa->spa_removing_phys.sr_prev_indirect_vdev = -1;
+   spa->spa_indirect_vdevs_loaded = B_TRUE;
 
/*
 * Create "The Godfather" zio to hold all async IOs
___
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: r338287 - head/sys/conf

2018-08-23 Thread Glen Barber
Author: gjb
Date: Fri Aug 24 00:25:25 2018
New Revision: 338287
URL: https://svnweb.freebsd.org/changeset/base/338287

Log:
  Update head from ALPHA2 to ALPHA3 as part of the 12.0-RELEASE
  cycle.
  
  Approved by:  re (implicit)
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/conf/newvers.sh

Modified: head/sys/conf/newvers.sh
==
--- head/sys/conf/newvers.shFri Aug 24 00:10:31 2018(r338286)
+++ head/sys/conf/newvers.shFri Aug 24 00:25:25 2018(r338287)
@@ -46,7 +46,7 @@
 
 TYPE="FreeBSD"
 REVISION="12.0"
-BRANCH="ALPHA2"
+BRANCH="ALPHA3"
 if [ -n "${BRANCH_OVERRIDE}" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi
___
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: r338286 - svnadmin/conf

2018-08-23 Thread Glen Barber
Author: gjb
Date: Fri Aug 24 00:10:31 2018
New Revision: 338286
URL: https://svnweb.freebsd.org/changeset/base/338286

Log:
  Require explicit re@ approval for commits to -CURRENT, marking the
  official code freeze for 12.0-RELEASE.
  
  Approved by:  re (implicit)
  Sponsored by: The FreeBSD Foundation

Modified:
  svnadmin/conf/approvers

Modified: svnadmin/conf/approvers
==
--- svnadmin/conf/approvers Fri Aug 24 00:02:00 2018(r338285)
+++ svnadmin/conf/approvers Fri Aug 24 00:10:31 2018(r338286)
@@ -16,7 +16,7 @@
 #
 # $FreeBSD$
 #
-#^head/re
+^head/ re
 #^stable/11/   re
 ^release/  re
 ^releng/11.[0-2]/  (security-officer|so)
___
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: r338285 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/contrib/dev/drm2 sys/dev/drm sys/dev/drm2 sys/dev/drm2/i915 sys/dev/drm2/radeon sys/dev/drm2/radeon/reg_srcs sys/dev/drm2/t...

2018-08-23 Thread Warner Losh
Author: imp
Date: Fri Aug 24 00:02:00 2018
New Revision: 338285
URL: https://svnweb.freebsd.org/changeset/base/338285

Log:
  Revert drm2 removal.
  
  Revert r338177, r338176, r338175, r338174, r338172
  
  After long consultations with re@, core members and mmacy, revert
  these changes. Followup changes will be made to mark them as
  deprecated and prent a message about where to find the up-to-date
  driver.  Followup commits will be made to make this clear in the
  installer. Followup commits to reduce POLA in ways we're still
  exploring.
  
  It's anticipated that after the freeze, this will be removed in
  13-current (with the residual of the drm2 code copied to
  sys/arm/dev/drm2 for the TEGRA port's use w/o the intel or
  radeon drivers).
  
  Due to the impending freeze, there was no formal core vote for
  this. I've been talking to different core members all day, as well as
  Matt Macey and Glen Barber. Nobody is completely happy, all are
  grudgingly going along with this. Work is in progress to mitigate
  the negative effects as much as possible.
  
  Requested by: re@ (gjb, rgrimes)

Added:
  head/sys/contrib/dev/drm2/
 - copied from r338175, head/sys/contrib/dev/drm2/
  head/sys/dev/drm/
 - copied from r338174, head/sys/dev/drm/
  head/sys/dev/drm/ati_pcigart.c
 - copied unchanged from r338171, head/sys/dev/drm/ati_pcigart.c
  head/sys/dev/drm/drm.h
 - copied unchanged from r338171, head/sys/dev/drm/drm.h
  head/sys/dev/drm/drmP.h
 - copied unchanged from r338171, head/sys/dev/drm/drmP.h
  head/sys/dev/drm/drm_agpsupport.c
 - copied unchanged from r338171, head/sys/dev/drm/drm_agpsupport.c
  head/sys/dev/drm/drm_atomic.h
 - copied unchanged from r338171, head/sys/dev/drm/drm_atomic.h
  head/sys/dev/drm/drm_auth.c
 - copied unchanged from r338171, head/sys/dev/drm/drm_auth.c
  head/sys/dev/drm/drm_bufs.c
 - copied unchanged from r338171, head/sys/dev/drm/drm_bufs.c
  head/sys/dev/drm/drm_context.c
 - copied unchanged from r338171, head/sys/dev/drm/drm_context.c
  head/sys/dev/drm/drm_dma.c
 - copied unchanged from r338171, head/sys/dev/drm/drm_dma.c
  head/sys/dev/drm/drm_drawable.c
 - copied unchanged from r338171, head/sys/dev/drm/drm_drawable.c
  head/sys/dev/drm/drm_drv.c
 - copied unchanged from r338171, head/sys/dev/drm/drm_drv.c
  head/sys/dev/drm/drm_fops.c
 - copied unchanged from r338171, head/sys/dev/drm/drm_fops.c
  head/sys/dev/drm/drm_hashtab.c
 - copied unchanged from r338171, head/sys/dev/drm/drm_hashtab.c
  head/sys/dev/drm/drm_hashtab.h
 - copied unchanged from r338171, head/sys/dev/drm/drm_hashtab.h
  head/sys/dev/drm/drm_internal.h
 - copied unchanged from r338171, head/sys/dev/drm/drm_internal.h
  head/sys/dev/drm/drm_ioctl.c
 - copied unchanged from r338171, head/sys/dev/drm/drm_ioctl.c
  head/sys/dev/drm/drm_irq.c
 - copied unchanged from r338171, head/sys/dev/drm/drm_irq.c
  head/sys/dev/drm/drm_linux_list.h
 - copied unchanged from r338171, head/sys/dev/drm/drm_linux_list.h
  head/sys/dev/drm/drm_lock.c
 - copied unchanged from r338171, head/sys/dev/drm/drm_lock.c
  head/sys/dev/drm/drm_memory.c
 - copied unchanged from r338171, head/sys/dev/drm/drm_memory.c
  head/sys/dev/drm/drm_mm.c
 - copied unchanged from r338171, head/sys/dev/drm/drm_mm.c
  head/sys/dev/drm/drm_mm.h
 - copied unchanged from r338171, head/sys/dev/drm/drm_mm.h
  head/sys/dev/drm/drm_pci.c
 - copied unchanged from r338171, head/sys/dev/drm/drm_pci.c
  head/sys/dev/drm/drm_pciids.h
 - copied unchanged from r338171, head/sys/dev/drm/drm_pciids.h
  head/sys/dev/drm/drm_sarea.h
 - copied unchanged from r338171, head/sys/dev/drm/drm_sarea.h
  head/sys/dev/drm/drm_scatter.c
 - copied unchanged from r338171, head/sys/dev/drm/drm_scatter.c
  head/sys/dev/drm/drm_sman.c
 - copied unchanged from r338171, head/sys/dev/drm/drm_sman.c
  head/sys/dev/drm/drm_sman.h
 - copied unchanged from r338171, head/sys/dev/drm/drm_sman.h
  head/sys/dev/drm/drm_sysctl.c
 - copied unchanged from r338171, head/sys/dev/drm/drm_sysctl.c
  head/sys/dev/drm/drm_vm.c
 - copied unchanged from r338171, head/sys/dev/drm/drm_vm.c
  head/sys/dev/drm/mach64_dma.c
 - copied unchanged from r338171, head/sys/dev/drm/mach64_dma.c
  head/sys/dev/drm/mach64_drm.h
 - copied unchanged from r338171, head/sys/dev/drm/mach64_drm.h
  head/sys/dev/drm/mach64_drv.c
 - copied unchanged from r338171, head/sys/dev/drm/mach64_drv.c
  head/sys/dev/drm/mach64_drv.h
 - copied unchanged from r338171, head/sys/dev/drm/mach64_drv.h
  head/sys/dev/drm/mach64_irq.c
 - copied unchanged from r338171, head/sys/dev/drm/mach64_irq.c
  head/sys/dev/drm/mach64_state.c
 - copied unchanged from r338171, head/sys/dev/drm/mach64_state.c
  head/sys/dev/drm/mga_dma.c
 - copied unchanged from r338171, head/sys/dev/drm/mga_dma.c
  head/sys/dev/drm/mga_drm.h
 - copied unchanged from r338171, head/sys/dev/drm/mga_drm.h
  h

Re: svn commit: r338172 - Now deprecating DRM

2018-08-23 Thread Kevin Bowling
On Thu, Aug 23, 2018 at 10:55 AM, Rodney W. Grimes
 wrote:
> [ Charset UTF-8 unsupported, converting... ]
>> On Wed, Aug 22, 2018 at 10:08 AM Rodney W. Grimes <
>> free...@pdx.rh.cn85.dnsmgr.net> wrote:
>>
>> > I think this deprecation is a rather serious deviation
>> > from the stated policy, in that 0 notification was
>> > made, core IMHO, has overstepped some boundaries in
>> > that respect.   These policies are promises to the
>> > downstream consumers, and violating them is very
>> > poor planning.
>> >
>>
>> Despite what the commit said, core didn't actually formally approve it
>> before the fact. That was one of the many miscommunications surrounding
>> this episode.
>
> Well I would say inlight of that fact a revert should be a no questions
> asked, doing much else risks build breakage within hours of code freeze.
>
>
>> I don't think you'll find anybody who would say this was well planned or
>> well executed.
>
> Agreed, so lets be simple in correcting it?

This is feeding more unnecessary inflammation.  I disagree with this
statement and so do a lot of other people including multiple on core.
There is certainly an opportunity to do better, but the policy and
procedures being spoken are not installed yet, we're under hard
deadline to lock down the 12.x ABI and the proposed review for a
tegra124-private drm2 addresses all who have standing in the matter.

Matt Joras offered a very professional and rational take on things on
developers@.  I would encourage people to noodle on that before
continuing to inflame the issues.

> From some investigation even the claim that "in base drm conflicts with
> ports drm" is not totally true, you just have to take a few steps to
> be sure you do not load the base versions, and do load the ports version.

It does.  The graphics team unilaterally agrees.
___
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: r338284 - head/sys/vm

2018-08-23 Thread Gleb Smirnoff
Author: glebius
Date: Thu Aug 23 23:24:28 2018
New Revision: 338284
URL: https://svnweb.freebsd.org/changeset/base/338284

Log:
  Fix comment. The actual meaning of ub_cnt is the opposite.

Modified:
  head/sys/vm/uma_int.h

Modified: head/sys/vm/uma_int.h
==
--- head/sys/vm/uma_int.h   Thu Aug 23 22:57:42 2018(r338283)
+++ head/sys/vm/uma_int.h   Thu Aug 23 23:24:28 2018(r338284)
@@ -188,7 +188,7 @@ struct uma_hash {
 
 struct uma_bucket {
LIST_ENTRY(uma_bucket)  ub_link;/* Link into the zone */
-   int16_t ub_cnt; /* Count of free items. */
+   int16_t ub_cnt; /* Count of allocated items. */
int16_t ub_entries; /* Max items. */
void*ub_bucket[];   /* actual allocation storage */
 };
___
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: r338283 - head/tools/boot

2018-08-23 Thread Marius Strobl
Author: marius
Date: Thu Aug 23 22:57:42 2018
New Revision: 338283
URL: https://svnweb.freebsd.org/changeset/base/338283

Log:
  Following r335259, don't copy boot1 from the running system for sparc64
  either.

Modified:
  head/tools/boot/rootgen.sh

Modified: head/tools/boot/rootgen.sh
==
--- head/tools/boot/rootgen.sh  Thu Aug 23 22:50:11 2018(r338282)
+++ head/tools/boot/rootgen.sh  Thu Aug 23 22:57:42 2018(r338283)
@@ -792,8 +792,6 @@ DESTDIR=${OBJDIR}/boot-tree
 rm -rf ${DESTDIR}
 mkdir -p ${DESTDIR}/boot/defaults
 mkdir -p ${DESTDIR}/boot/kernel
-# XXX boot1 exists only on sparc64
-cp /boot/boot1 ${DESTDIR}/boot
 cp /boot/kernel/kernel ${DESTDIR}/boot/kernel
 echo -h -D -S115200 > ${DESTDIR}/boot.config
 cat > ${DESTDIR}/boot/loader.conf 

svn commit: r338282 - head/usr.sbin/bsdinstall/scripts

2018-08-23 Thread Allan Jude
Author: allanjude
Date: Thu Aug 23 22:50:11 2018
New Revision: 338282
URL: https://svnweb.freebsd.org/changeset/base/338282

Log:
  bsdinstall/zfsboot: Enable new UEFI+GELI support
  
  After r336252 it is no longer necessary to have a separate bootpool when
  booting from an encrypted disk with UEFI.
  
  This change also switches the EFI System Partition contents from
  the 800 KB boot1.efifat to a new 200 MB filesystem created with newfs_msdos
  and uses loader.efi directly, instead of boot1.efi.
  
  PR:   228916
  Reviewed by:  dteske
  MFC after:1 month
  Relnotes: yes
  Sponsored by: Klara Systems
  Differential Revision:https://reviews.freebsd.org/D12315

Modified:
  head/usr.sbin/bsdinstall/scripts/zfsboot

Modified: head/usr.sbin/bsdinstall/scripts/zfsboot
==
--- head/usr.sbin/bsdinstall/scripts/zfsbootThu Aug 23 22:35:14 2018
(r338281)
+++ head/usr.sbin/bsdinstall/scripts/zfsbootThu Aug 23 22:50:11 2018
(r338282)
@@ -185,9 +185,11 @@ FSTAB_FMT="%s\t\t%s\t%s\t%s\t\t%s\t%s\n"
 #
 # Command strings for various tasks
 #
+COPY='cp "%s" "%s"'
 CHMOD_MODE='chmod %s "%s"'
 DD_WITH_OPTIONS='dd if="%s" of="%s" %s'
 ECHO_APPEND='echo "%s" >> "%s"'
+ECHO_OVERWRITE='echo "%s" > "%s"'
 GELI_ATTACH='geli attach -j - -k "%s" "%s"'
 GELI_ATTACH_NOKEY='geli attach -j - "%s"'
 GELI_DETACH_F='geli detach -f "%s"'
@@ -211,6 +213,7 @@ KLDLOAD='kldload %s'
 LN_SF='ln -sf "%s" "%s"'
 MKDIR_P='mkdir -p "%s"'
 MOUNT_TYPE='mount -t %s "%s" "%s"'
+NEWFS_ESP='newfs_msdos -F %s -L "%s" "%s"'
 PRINTF_CONF="printf '%s=\"%%s\"\\\n' %s >> \"%s\""
 PRINTF_FSTAB='printf "$FSTAB_FMT" "%s" "%s" "%s" "%s" "%s" "%s" >> "%s"'
 SHELL_TRUNCATE=':> "%s"'
@@ -841,18 +844,34 @@ zfs_create_diskpart()
# 2. Add small freebsd-boot and/or efi partition
#
if [ "$ZFSBOOT_BOOT_TYPE" = "UEFI" -o "$ZFSBOOT_BOOT_TYPE" = 
"BIOS+UEFI" ]; then
-   #
-   # Enable boot pool if encryption is desired
-   #
-   [ "$ZFSBOOT_GELI_ENCRYPTION" ] && ZFSBOOT_BOOT_POOL=1
-
f_eval_catch $funcname gpart \
 "$GPART_ADD_ALIGN_LABEL_WITH_SIZE" \
-"$align_small" efiboot$index efi 200M 
$disk ||
+"$align_small" efiboot$index efi 200M \
+$disk ||
 return $FAILURE
-   f_eval_catch $funcname gpart "$GPART_BOOTCODE_PARTONLY" 
\
-/boot/boot1.efifat 1 $disk ||
-return $FAILURE
+
+   f_eval_catch $funcname mkdir "$MKDIR_P" \
+"$BSDINSTALL_TMPETC/esp" || return $FAILURE
+   f_eval_catch $funcname newfs_msdos "$NEWFS_ESP" "16" \
+"EFISYS" "/dev/${disk}p1" ||
+return $FAILURE
+   f_eval_catch $funcname mount "$MOUNT_TYPE" "msdosfs" \
+"/dev/${disk}p1" \
+"$BSDINSTALL_TMPETC/esp" ||
+return $FAILURE
+   f_eval_catch $funcname mkdir "$MKDIR_P" \
+"$BSDINSTALL_TMPETC/esp/efi/boot" ||
+return $FAILURE
+   f_eval_catch $funcname cp "$COPY" "/boot/loader.efi" \
+
"$BSDINSTALL_TMPETC/esp/efi/boot/$ZFSBOOT_ESP_NAME" ||
+return $FAILURE
+   f_eval_catch $funcname echo "$ECHO_OVERWRITE" \
+"$ZFSBOOT_ESP_NAME" \
+
"$BSDINSTALL_TMPETC/esp/efi/boot/startup.nsh" ||
+return $FAILURE
+   f_eval_catch $funcname umount "$UMOUNT" \
+"$BSDINSTALL_TMPETC/esp" ||
+return $FAILURE
fi
 
if [ "$ZFSBOOT_BOOT_TYPE" = "BIOS" -o "$ZFSBOOT_BOOT_TYPE" = 
"BIOS+UEFI" ]; then
@@ -1574,6 +1593,20 @@ arm64)
: ${ZFSBOOT_PARTITION_SCHEME:=GPT}
fi
;;
+esac
+
+#
+# The EFI loader installed in the ESP (EFI System Partition) must
+# have the expected name in order to load correctly.
+#
+[ "$ZFSBOOT_ESP_NAME" ] || case "${UNAME_m:-$( uname -m )}" in
+   arm64) ZFSBOOT_ESP_NAME=BOOTaa64.efi ;;
+   arm) ZFSBOOT_ESP_NAME=BOOTarm.efi ;;
+   i386) ZFSBOOT_ESP_NAME=BOOTia32.efi ;;
+   amd64) ZFSBOOT_ESP_NAME=BOOTx64.efi ;;
+   *)
+   f_dprintf "Unsupported architecture: %s" $UNAME_m
+   f_die
 esac
 
 #

svn commit: r338281 - head/sys/ufs/ffs

2018-08-23 Thread Kirk McKusick
Author: mckusick
Date: Thu Aug 23 22:35:14 2018
New Revision: 338281
URL: https://svnweb.freebsd.org/changeset/base/338281

Log:
  Proper spelling of consolidation.
  
  Submitted by: Dimitry Andric

Modified:
  head/sys/ufs/ffs/ffs_alloc.c

Modified: head/sys/ufs/ffs/ffs_alloc.c
==
--- head/sys/ufs/ffs/ffs_alloc.cThu Aug 23 21:26:58 2018
(r338280)
+++ head/sys/ufs/ffs/ffs_alloc.cThu Aug 23 22:35:14 2018
(r338281)
@@ -486,7 +486,7 @@ SYSCTL_INT(_vfs_ffs, OID_AUTO, doreallocblks, CTLFLAG_
 
 static int dotrimcons = 0;
 SYSCTL_INT(_vfs_ffs, OID_AUTO, dotrimcons, CTLFLAG_RW, &dotrimcons, 0,
-"enable BIO_DELETE / TRIM consolodation");
+"enable BIO_DELETE / TRIM consolidation");
 
 static int maxclustersearch = 10;
 SYSCTL_INT(_vfs_ffs, OID_AUTO, maxclustersearch, CTLFLAG_RW, &maxclustersearch,
@@ -513,10 +513,10 @@ ffs_reallocblks(ap)
 * the destination for the data is usually moved before the data
 * is written to the initially allocated location, so we rarely
 * suffer the penalty of extra writes. With the addition of the
-* consolodation of contiguous blocks into single BIO_DELETE
+* consolidation of contiguous blocks into single BIO_DELETE
 * operations, having fewer but larger contiguous blocks reduces
 * the number of (slow and expensive) BIO_DELETE operations. So
-* when doing BIO_DELETE consolodation, we do block reallocation.
+* when doing BIO_DELETE consolidation, we do block reallocation.
 *
 * Skip if reallocblks has been disabled globally.
 */
___
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: r338270 - head/lib/libmd

2018-08-23 Thread Brooks Davis
On Thu, Aug 23, 2018 at 02:40:35PM -0700, Conrad Meyer wrote:
> On Thu, Aug 23, 2018 at 11:19 AM, Alex Richardson
>  wrote:
> > Author: arichardson
> > Date: Thu Aug 23 18:19:33 2018
> > New Revision: 338270
> > URL: https://svnweb.freebsd.org/changeset/base/338270
> >
> > Log:
> >   Don't build skein_block_asm.s if we don't have an as binary
> >...
> > It might also be better to just
> >   compile the C file in userspace since the compiler can the use SSE/AVX.
> 
> FYI, in my (limited) testing, the hand-written assembly has something
> like 50% performance advantage over the reference C implementation,
> even with -march=native, etc.  Using the reference C version is
> totally fine for bootstrapping, but the compiler is not yet smart
> enough to write the assembler versions.

Thanks for doing this.  Sounds like we should keep the option to build
if you have a GNU as around.

-- Brooks


signature.asc
Description: PGP signature


Re: svn commit: r338270 - head/lib/libmd

2018-08-23 Thread Conrad Meyer
On Thu, Aug 23, 2018 at 11:19 AM, Alex Richardson
 wrote:
> Author: arichardson
> Date: Thu Aug 23 18:19:33 2018
> New Revision: 338270
> URL: https://svnweb.freebsd.org/changeset/base/338270
>
> Log:
>   Don't build skein_block_asm.s if we don't have an as binary
>...
> It might also be better to just
>   compile the C file in userspace since the compiler can the use SSE/AVX.

FYI, in my (limited) testing, the hand-written assembly has something
like 50% performance advantage over the reference C implementation,
even with -march=native, etc.  Using the reference C version is
totally fine for bootstrapping, but the compiler is not yet smart
enough to write the assembler versions.

Best,
Conrad
___
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: r338238 - in head/sbin/init: . rc.d

2018-08-23 Thread Conrad Meyer
On Wed, Aug 22, 2018 at 10:06 PM, Warner Losh  wrote:
> Author: imp
> Date: Thu Aug 23 05:06:27 2018
> New Revision: 338238
> URL: https://svnweb.freebsd.org/changeset/base/338238
>
> Log:
>   Implement blacklisting for devmatch
>
>   devmatch_blacklist is a space separated list of modules (w/o the .ko
>   or full path) to exclude from devmatch's processing.

Are these module names, or kld names?  They can be distinct and
represent distinct objects.  (I think this should maybe be clarified
in the rc.conf comment.)

Thanks,
Conrad
___
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: r338280 - head/sys/dev/mmc

2018-08-23 Thread Marius Strobl
Author: marius
Date: Thu Aug 23 21:26:58 2018
New Revision: 338280
URL: https://svnweb.freebsd.org/changeset/base/338280

Log:
  - Use le32dec(9) for decoding EXT_CSD values where it makes sense. [1]
  - Locally cache some instance variable values in mmc_discover_cards()
in order to improve the code readability a bit.
  
  Obtained from:NetBSD [1]

Modified:
  head/sys/dev/mmc/mmc.c
  head/sys/dev/mmc/mmcsd.c

Modified: head/sys/dev/mmc/mmc.c
==
--- head/sys/dev/mmc/mmc.c  Thu Aug 23 21:24:22 2018(r338279)
+++ head/sys/dev/mmc/mmc.c  Thu Aug 23 21:26:58 2018(r338280)
@@ -1586,10 +1586,12 @@ mmc_discover_cards(struct mmc_softc *sc)
uint32_t raw_cid[4];
struct mmc_ivars *ivar = NULL;
const struct mmc_quirk *quirk;
+   const uint8_t *ext_csd;
device_t child;
int err, host_caps, i, newcard;
uint32_t resp, sec_count, status;
uint16_t rca = 2;
+   uint8_t card_type;
 
host_caps = mmcbr_get_caps(sc->dev);
if (bootverbose || mmc_debug)
@@ -1786,11 +1788,9 @@ mmc_discover_cards(struct mmc_softc *sc)
"Error reading EXT_CSD %d\n", err);
goto free_ivar;
}
+   ext_csd = ivar->raw_ext_csd;
/* Handle extended capacity from EXT_CSD */
-   sec_count = ivar->raw_ext_csd[EXT_CSD_SEC_CNT] +
-   (ivar->raw_ext_csd[EXT_CSD_SEC_CNT + 1] << 8) +
-   (ivar->raw_ext_csd[EXT_CSD_SEC_CNT + 2] << 16) +
-   (ivar->raw_ext_csd[EXT_CSD_SEC_CNT + 3] << 24);
+   sec_count = le32dec(&ext_csd[EXT_CSD_SEC_CNT]);
if (sec_count != 0) {
ivar->sec_count = sec_count;
ivar->high_cap = 1;
@@ -1798,65 +1798,56 @@ mmc_discover_cards(struct mmc_softc *sc)
/* Find maximum supported bus width. */
ivar->bus_width = mmc_test_bus_width(sc);
/* Get device speeds beyond normal mode. */
-   if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] &
-   EXT_CSD_CARD_TYPE_HS_52) != 0) {
+   card_type = ext_csd[EXT_CSD_CARD_TYPE];
+   if ((card_type & EXT_CSD_CARD_TYPE_HS_52) != 0) {
setbit(&ivar->timings, bus_timing_hs);
ivar->hs_tran_speed = MMC_TYPE_HS_52_MAX;
-   } else if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] &
-   EXT_CSD_CARD_TYPE_HS_26) != 0) {
+   } else if ((card_type & EXT_CSD_CARD_TYPE_HS_26) != 0) {
setbit(&ivar->timings, bus_timing_hs);
ivar->hs_tran_speed = MMC_TYPE_HS_26_MAX;
}
-   if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] &
-   EXT_CSD_CARD_TYPE_DDR_52_1_2V) != 0 &&
+   if ((card_type & EXT_CSD_CARD_TYPE_DDR_52_1_2V) != 0 &&
(host_caps & MMC_CAP_SIGNALING_120) != 0) {
setbit(&ivar->timings, bus_timing_mmc_ddr52);
setbit(&ivar->vccq_120, bus_timing_mmc_ddr52);
}
-   if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] &
-   EXT_CSD_CARD_TYPE_DDR_52_1_8V) != 0 &&
+   if ((card_type & EXT_CSD_CARD_TYPE_DDR_52_1_8V) != 0 &&
(host_caps & MMC_CAP_SIGNALING_180) != 0) {
setbit(&ivar->timings, bus_timing_mmc_ddr52);
setbit(&ivar->vccq_180, bus_timing_mmc_ddr52);
}
-   if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] &
-   EXT_CSD_CARD_TYPE_HS200_1_2V) != 0 &&
+   if ((card_type & EXT_CSD_CARD_TYPE_HS200_1_2V) != 0 &&
(host_caps & MMC_CAP_SIGNALING_120) != 0) {
setbit(&ivar->timings, bus_timing_mmc_hs200);
setbit(&ivar->vccq_120, bus_timing_mmc_hs200);
}
-   if ((ivar->raw_ext_csd[EXT_CSD_CARD_TYPE] &
-   EXT_CSD_CARD_TYPE_HS200_1_8V) != 0 &&
+   if ((card_type & EXT_CSD_CARD_TYPE_HS200_1_8V) != 0 &&
(host_caps & MMC_CAP_SIGNALING_180) != 0) {
setbit(&ivar->timings, bus_timing_mmc_hs200);
setbit(&ivar->vccq_180, bus_timing_mmc_hs200);
}
-   if ((ivar->raw_ext_csd[EXT_CSD_CARD_TY

svn commit: r338279 - stable/11/usr.sbin/route6d

2018-08-23 Thread Mark Johnston
Author: markj
Date: Thu Aug 23 21:24:22 2018
New Revision: 338279
URL: https://svnweb.freebsd.org/changeset/base/338279

Log:
  MFC r337500:
  Use the right variable when updating interface routes.
  
  PR:   229807

Modified:
  stable/11/usr.sbin/route6d/route6d.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/route6d/route6d.c
==
--- stable/11/usr.sbin/route6d/route6d.cThu Aug 23 21:03:45 2018
(r338278)
+++ stable/11/usr.sbin/route6d/route6d.cThu Aug 23 21:24:22 2018
(r338279)
@@ -2203,8 +2203,10 @@ ifrt(struct ifc *ifcp, int again)
goto next;
}
 
-   TAILQ_REMOVE(&riprt_head, rrt, rrt_next);
-   delroute(&rrt->rrt_info, &rrt->rrt_gw);
+   TAILQ_REMOVE(&riprt_head, search_rrt, rrt_next);
+   delroute(&search_rrt->rrt_info,
+   &search_rrt->rrt_gw);
+   free(search_rrt);
}
/* Attach the route to the list */
trace(1, "route: %s/%d: register route (%s)\n",
___
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: r338278 - head/sys/vm

2018-08-23 Thread Mark Johnston
Author: markj
Date: Thu Aug 23 21:03:45 2018
New Revision: 338278
URL: https://svnweb.freebsd.org/changeset/base/338278

Log:
  Add a per-pagequeue pdpages counter.
  
  Expose these counters under the vm.domain sysctl node.  The existing
  vm.stats.vm.v_pdpages sysctl is preserved.
  
  Reviewed by:  alc (previous version)
  Differential Revision:https://reviews.freebsd.org/D14666

Modified:
  head/sys/vm/vm_meter.c
  head/sys/vm/vm_page.c
  head/sys/vm/vm_pageout.c
  head/sys/vm/vm_pagequeue.h

Modified: head/sys/vm/vm_meter.c
==
--- head/sys/vm/vm_meter.c  Thu Aug 23 20:44:26 2018(r338277)
+++ head/sys/vm/vm_meter.c  Thu Aug 23 21:03:45 2018(r338278)
@@ -364,7 +364,6 @@ VM_STATS_VM(v_vnodepgsout, "Vnode pages paged out");
 VM_STATS_VM(v_intrans, "In transit page faults");
 VM_STATS_VM(v_reactivated, "Pages reactivated by pagedaemon");
 VM_STATS_VM(v_pdwakeups, "Pagedaemon wakeups");
-VM_STATS_VM(v_pdpages, "Pages analyzed by pagedaemon");
 VM_STATS_VM(v_pdshortfalls, "Page reclamation shortfalls");
 VM_STATS_VM(v_dfree, "Pages freed by pagedaemon");
 VM_STATS_VM(v_pfree, "Pages freed by exiting processes");
@@ -436,8 +435,7 @@ vm_free_count(void)
return (v);
 }
 
-static
-u_int
+static u_int
 vm_pagequeue_count(int pq)
 {
u_int v;
@@ -454,23 +452,42 @@ u_int
 vm_active_count(void)
 {
 
-   return vm_pagequeue_count(PQ_ACTIVE);
+   return (vm_pagequeue_count(PQ_ACTIVE));
 }
 
 u_int
 vm_inactive_count(void)
 {
 
-   return vm_pagequeue_count(PQ_INACTIVE);
+   return (vm_pagequeue_count(PQ_INACTIVE));
 }
 
 u_int
 vm_laundry_count(void)
 {
 
-   return vm_pagequeue_count(PQ_LAUNDRY);
+   return (vm_pagequeue_count(PQ_LAUNDRY));
 }
 
+static int
+sysctl_vm_pdpages(SYSCTL_HANDLER_ARGS)
+{
+   struct vm_pagequeue *pq;
+   uint64_t ret;
+   int dom, i;
+
+   ret = counter_u64_fetch(vm_cnt.v_pdpages);
+   for (dom = 0; dom < vm_ndomains; dom++)
+   for (i = 0; i < PQ_COUNT; i++) {
+   pq = &VM_DOMAIN(dom)->vmd_pagequeues[i];
+   ret += pq->pq_pdpages;
+   }
+   return (SYSCTL_OUT(req, &ret, sizeof(ret)));
+}
+SYSCTL_PROC(_vm_stats_vm, OID_AUTO, v_pdpages,
+CTLTYPE_U64 | CTLFLAG_MPSAFE | CTLFLAG_RD, NULL, 0, sysctl_vm_pdpages, 
"QU",
+"Pages analyzed by pagedaemon");
+
 static void
 vm_domain_stats_init(struct vm_domain *vmd, struct sysctl_oid *parent)
 {
@@ -486,15 +503,31 @@ vm_domain_stats_init(struct vm_domain *vmd, struct sys
SYSCTL_ADD_UINT(NULL, SYSCTL_CHILDREN(oid), OID_AUTO,
"active", CTLFLAG_RD, &vmd->vmd_pagequeues[PQ_ACTIVE].pq_cnt, 0,
"Active pages");
+   SYSCTL_ADD_U64(NULL, SYSCTL_CHILDREN(oid), OID_AUTO,
+   "actpdpgs", CTLFLAG_RD,
+   &vmd->vmd_pagequeues[PQ_ACTIVE].pq_pdpages, 0,
+   "Active pages scanned by the page daemon");
SYSCTL_ADD_UINT(NULL, SYSCTL_CHILDREN(oid), OID_AUTO,
"inactive", CTLFLAG_RD, &vmd->vmd_pagequeues[PQ_INACTIVE].pq_cnt, 0,
"Inactive pages");
+   SYSCTL_ADD_U64(NULL, SYSCTL_CHILDREN(oid), OID_AUTO,
+   "inactpdpgs", CTLFLAG_RD,
+   &vmd->vmd_pagequeues[PQ_INACTIVE].pq_pdpages, 0,
+   "Inactive pages scanned by the page daemon");
SYSCTL_ADD_UINT(NULL, SYSCTL_CHILDREN(oid), OID_AUTO,
"laundry", CTLFLAG_RD, &vmd->vmd_pagequeues[PQ_LAUNDRY].pq_cnt, 0,
"laundry pages");
+   SYSCTL_ADD_U64(NULL, SYSCTL_CHILDREN(oid), OID_AUTO,
+   "laundpdpgs", CTLFLAG_RD,
+   &vmd->vmd_pagequeues[PQ_LAUNDRY].pq_pdpages, 0,
+   "Laundry pages scanned by the page daemon");
SYSCTL_ADD_UINT(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "unswappable",
CTLFLAG_RD, &vmd->vmd_pagequeues[PQ_UNSWAPPABLE].pq_cnt, 0,
"Unswappable pages");
+   SYSCTL_ADD_U64(NULL, SYSCTL_CHILDREN(oid), OID_AUTO,
+   "unswppdpgs", CTLFLAG_RD,
+   &vmd->vmd_pagequeues[PQ_UNSWAPPABLE].pq_pdpages, 0,
+   "Unswappable pages scanned by the page daemon");
SYSCTL_ADD_UINT(NULL, SYSCTL_CHILDREN(oid), OID_AUTO,
"inactive_target", CTLFLAG_RD, &vmd->vmd_inactive_target, 0,
"Target inactive pages");

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Thu Aug 23 20:44:26 2018(r338277)
+++ head/sys/vm/vm_page.c   Thu Aug 23 21:03:45 2018(r338278)
@@ -481,6 +481,7 @@ vm_page_domain_init(int domain)
TAILQ_INIT(&pq->pq_pl);
mtx_init(&pq->pq_mutex, pq->pq_name, "vm pagequeue",
MTX_DEF | MTX_DUPOK);
+   pq->pq_pdpages = 0;
vm_page_init_marker(&vmd->vmd_markers[i], i, 0);
}
mtx_init(&vmd->vmd_free_mtx, "vm page free queue", NULL, MTX_DEF);

Re: svn commit: r338239 - head

2018-08-23 Thread Piotr P. Stefaniak

On 2018-08-23 05:06:32, Warner Losh wrote:

Author: imp
Date: Thu Aug 23 05:06:31 2018
New Revision: 338239
URL: https://svnweb.freebsd.org/changeset/base/338239

Log:
 Add a special note to UPDATING for the devmatch stuff. While tested,
 there's an elevated risk of trouble, and you must update kernel,
 userland and rc scripts for the best experience.

Modified:
 head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Thu Aug 23 05:06:27 2018(r338238)
+++ head/UPDATING   Thu Aug 23 05:06:31 2018(r338239)
@@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)

+20170822:


Shouldn't that be 20180822?
___
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: r338277 - head/contrib/tcp_wrappers

2018-08-23 Thread Bjoern A. Zeeb
Author: bz
Date: Thu Aug 23 20:44:26 2018
New Revision: 338277
URL: https://svnweb.freebsd.org/changeset/base/338277

Log:
  Reduce the log level of tcpd_warn calls from ERR to WARNING.
  This matches the name and avoids logging of warnings to console with
  default syslog.conf, esp. getting rid of:
warning: /etc/hosts.allow, line ..: can't verify hostname: \
   getaddrinfo(.., AF_INET) failed

Modified:
  head/contrib/tcp_wrappers/diag.c

Modified: head/contrib/tcp_wrappers/diag.c
==
--- head/contrib/tcp_wrappers/diag.cThu Aug 23 20:34:22 2018
(r338276)
+++ head/contrib/tcp_wrappers/diag.cThu Aug 23 20:44:26 2018
(r338277)
@@ -52,7 +52,7 @@ voidVARARGS(tcpd_warn, char *, format)
 va_list ap;
 
 VASTART(ap, char *, format);
-tcpd_diag(LOG_ERR, "warning", format, ap);
+tcpd_diag(LOG_WARNING, "warning", format, ap);
 VAEND(ap);
 }
 
___
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: r338276 - head/sys/vm

2018-08-23 Thread Mark Johnston
Author: markj
Date: Thu Aug 23 20:34:22 2018
New Revision: 338276
URL: https://svnweb.freebsd.org/changeset/base/338276

Log:
  Ensure that queue state is cleared when vm_page_dequeue() returns.
  
  Per-page queue state is updated non-atomically, with either the page
  lock or the page queue lock held.  When vm_page_dequeue() is called
  without the page lock, in rare cases a different thread may be
  concurrently dequeuing the page with the pagequeue lock held.  Because
  of the non-atomic update, vm_page_dequeue() might return before queue
  state is completely updated, which can lead to race conditions.
  
  Restrict the vm_page_dequeue() interface so that it must be called
  either with the page lock held or on a free page, and busy wait when
  a different thread is concurrently updating queue state, which must
  happen in a critical section.
  
  While here, do some related cleanup: inline vm_page_dequeue_locked()
  into its only caller and delete a prototype for the unimplemented
  vm_page_requeue_locked().  Replace the volatile qualifier for "queue"
  added in r333703 with explicit uses of atomic_load_8() where required.
  
  Reported and tested by:   pho
  Reviewed by:  alc
  Differential Revision:https://reviews.freebsd.org/D15980

Modified:
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Thu Aug 23 20:25:27 2018(r338275)
+++ head/sys/vm/vm_page.c   Thu Aug 23 20:34:22 2018(r338276)
@@ -521,7 +521,7 @@ vm_page_init_page(vm_page_t m, vm_paddr_t pa, int segi
m->wire_count = 0;
m->busy_lock = VPB_UNBUSIED;
m->hold_count = 0;
-   m->flags = 0;
+   m->flags = m->aflags = 0;
m->phys_addr = pa;
m->queue = PQ_NONE;
m->psind = 0;
@@ -2148,8 +2148,9 @@ vm_page_alloc_check(vm_page_t m)
 {
 
KASSERT(m->object == NULL, ("page %p has object", m));
-   KASSERT(m->queue == PQ_NONE,
-   ("page %p has unexpected queue %d", m, m->queue));
+   KASSERT(m->queue == PQ_NONE && (m->aflags & PGA_QUEUE_STATE_MASK) == 0,
+   ("page %p has unexpected queue %d, flags %#x",
+   m, m->queue, (m->aflags & PGA_QUEUE_STATE_MASK)));
KASSERT(!vm_page_held(m), ("page %p is held", m));
KASSERT(!vm_page_busied(m), ("page %p is busy", m));
KASSERT(m->dirty == 0, ("page %p is dirty", m));
@@ -3090,7 +3091,7 @@ vm_page_pagequeue_lockptr(vm_page_t m)
 {
uint8_t queue;
 
-   if ((queue = m->queue) == PQ_NONE)
+   if ((queue = atomic_load_8(&m->queue)) == PQ_NONE)
return (NULL);
return (&vm_pagequeue_domain(m)->vmd_pagequeues[queue].pq_mutex);
 }
@@ -3101,6 +3102,7 @@ vm_pqbatch_process_page(struct vm_pagequeue *pq, vm_pa
struct vm_domain *vmd;
uint8_t aflags;
 
+   CRITICAL_ASSERT(curthread);
vm_pagequeue_assert_locked(pq);
KASSERT(pq == vm_page_pagequeue(m),
("page %p doesn't belong to %p", m, pq));
@@ -3267,7 +3269,7 @@ vm_page_dequeue_deferred(vm_page_t m)
 
vm_page_assert_locked(m);
 
-   queue = m->queue;
+   queue = atomic_load_8(&m->queue);
if (queue == PQ_NONE) {
KASSERT((m->aflags & PGA_QUEUE_STATE_MASK) == 0,
("page %p has queue state", m));
@@ -3279,56 +3281,46 @@ vm_page_dequeue_deferred(vm_page_t m)
 }
 
 /*
- * vm_page_dequeue_locked:
- *
- * Remove the page from its page queue, which must be locked.
- * If the page lock is not held, there is no guarantee that the
- * page will not be enqueued by another thread before this function
- * returns.  In this case, it is up to the caller to ensure that
- * no other threads hold a reference to the page.
- *
- * The page queue lock must be held.  If the page is not already
- * logically dequeued, the page lock must be held as well.
- */
-void
-vm_page_dequeue_locked(vm_page_t m)
-{
-   struct vm_pagequeue *pq;
-
-   pq = vm_page_pagequeue(m);
-
-   KASSERT(m->queue != PQ_NONE,
-   ("%s: page %p queue field is PQ_NONE", __func__, m));
-   vm_pagequeue_assert_locked(pq);
-   KASSERT((m->aflags & PGA_DEQUEUE) != 0 ||
-   mtx_owned(vm_page_lockptr(m)),
-   ("%s: queued unlocked page %p", __func__, m));
-
-   if ((m->aflags & PGA_ENQUEUED) != 0) {
-   TAILQ_REMOVE(&pq->pq_pl, m, plinks.q);
-   vm_pagequeue_cnt_dec(pq);
-   }
-   vm_page_dequeue_complete(m);
-}
-
-/*
  * vm_page_dequeue:
  *
  * Remove the page from whichever page queue it's in, if any.
- * If the page lock is not held, there is no guarantee that the
- * page will not be enqueued by another thread before this function
- * returns.  In this case, it is up to the caller to ensure that
- * no other threads hold a reference to the page.
+ * The page must

svn commit: r338275 - head/sys/dev/mmc

2018-08-23 Thread Marius Strobl
Author: marius
Date: Thu Aug 23 20:25:27 2018
New Revision: 338275
URL: https://svnweb.freebsd.org/changeset/base/338275

Log:
  Obtain the bus mode (MMC or SD) from the directly superordinated
  bus rather than reaching up to the bridge and use the cached mode
  in mmcsd_delete(), too.

Modified:
  head/sys/dev/mmc/mmcsd.c

Modified: head/sys/dev/mmc/mmcsd.c
==
--- head/sys/dev/mmc/mmcsd.cThu Aug 23 19:58:24 2018(r338274)
+++ head/sys/dev/mmc/mmcsd.cThu Aug 23 20:25:27 2018(r338275)
@@ -247,7 +247,7 @@ mmcsd_attach(device_t dev)
sc = device_get_softc(dev);
sc->dev = dev;
sc->mmcbus = mmcbus = device_get_parent(dev);
-   sc->mode = mmcbr_get_mode(mmcbus);
+   sc->mode = mmc_get_card_type(dev);
/*
 * Note that in principle with an SDHCI-like re-tuning implementation,
 * the maximum data size can change at runtime due to a device removal/
@@ -1315,7 +1315,7 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp)
memset(&cmd, 0, sizeof(cmd));
cmd.mrq = &req;
req.cmd = &cmd;
-   if (mmc_get_card_type(dev) == mode_sd)
+   if (sc->mode == mode_sd)
cmd.opcode = SD_ERASE_WR_BLK_START;
else
cmd.opcode = MMC_ERASE_GROUP_START;
@@ -1334,7 +1334,7 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp)
memset(&req, 0, sizeof(req));
memset(&cmd, 0, sizeof(cmd));
req.cmd = &cmd;
-   if (mmc_get_card_type(dev) == mode_sd)
+   if (sc->mode == mode_sd)
cmd.opcode = SD_ERASE_WR_BLK_END;
else
cmd.opcode = MMC_ERASE_GROUP_END;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r338274 - head/sys/conf

2018-08-23 Thread Mark Johnston
On Thu, Aug 23, 2018 at 07:58:24PM +, Mark Johnston wrote:
> Author: markj
> Date: Thu Aug 23 19:58:24 2018
> New Revision: 338274
> URL: https://svnweb.freebsd.org/changeset/base/338274
> 
> Log:
>   Configure -zifunc-noplt for amd64 kernels.
>   
>   Per r338251, this ensures that ifunc calls have the same ordinary
>   function calls.

"... the same overhead as ordinary functions calls."
___
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: r338274 - head/sys/conf

2018-08-23 Thread Mark Johnston
Author: markj
Date: Thu Aug 23 19:58:24 2018
New Revision: 338274
URL: https://svnweb.freebsd.org/changeset/base/338274

Log:
  Configure -zifunc-noplt for amd64 kernels.
  
  Per r338251, this ensures that ifunc calls have the same ordinary
  function calls.
  
  Reviewed by:  emaste (previous version)
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D16750

Modified:
  head/sys/conf/kern.pre.mk

Modified: head/sys/conf/kern.pre.mk
==
--- head/sys/conf/kern.pre.mk   Thu Aug 23 19:10:45 2018(r338273)
+++ head/sys/conf/kern.pre.mk   Thu Aug 23 19:58:24 2018(r338274)
@@ -125,7 +125,7 @@ LDFLAGS+=   -Wl,--build-id=sha1
 .if defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mifunc} == ""
 .error amd64 kernel requires linker ifunc support
 .endif
-LDFLAGS+=  -Wl,-z max-page-size=2097152 -Wl,-z common-page-size=4096
+LDFLAGS+=  -Wl,-z max-page-size=2097152 -Wl,-z common-page-size=4096 
-Wl,-z -Wl,ifunc-noplt
 .endif
 
 NORMAL_C= ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.IMPSRC}
___
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: r338273 - head/sys/netinet

2018-08-23 Thread Michael Tuexen
Author: tuexen
Date: Thu Aug 23 19:10:45 2018
New Revision: 338273
URL: https://svnweb.freebsd.org/changeset/base/338273

Log:
  Use arc4rand() instead of read_random() in the SCTP and TCP code.
  
  This was suggested by jmg@.
  
  Reviewed by:  delphij@, jmg@, jtl@
  MFC after:1 month
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D16860

Modified:
  head/sys/netinet/sctp_os_bsd.h
  head/sys/netinet/tcp_subr.c

Modified: head/sys/netinet/sctp_os_bsd.h
==
--- head/sys/netinet/sctp_os_bsd.h  Thu Aug 23 18:46:05 2018
(r338272)
+++ head/sys/netinet/sctp_os_bsd.h  Thu Aug 23 19:10:45 2018
(r338273)
@@ -445,7 +445,7 @@ sctp_get_mbuf_for_msg(unsigned int space_needed,
 /*
  * SCTP AUTH
  */
-#define SCTP_READ_RANDOM(buf, len) read_random(buf, len)
+#define SCTP_READ_RANDOM(buf, len) arc4rand(buf, len, 0)
 
 /* map standard crypto API names */
 #define SCTP_SHA1_CTX  SHA1_CTX

Modified: head/sys/netinet/tcp_subr.c
==
--- head/sys/netinet/tcp_subr.c Thu Aug 23 18:46:05 2018(r338272)
+++ head/sys/netinet/tcp_subr.c Thu Aug 23 19:10:45 2018(r338273)
@@ -1096,7 +1096,7 @@ tcp_init(void)
/* Initialize the TCP logging data. */
tcp_log_init();
 #endif
-   read_random(&V_ts_offset_secret, sizeof(V_ts_offset_secret));
+   arc4rand(&V_ts_offset_secret, sizeof(V_ts_offset_secret), 0);
 
if (tcp_soreceive_stream) {
 #ifdef INET
@@ -2716,7 +2716,7 @@ tcp_new_isn(struct in_conninfo *inc)
if ((V_isn_last_reseed == 0) || ((V_tcp_isn_reseed_interval > 0) &&
 (((u_int)V_isn_last_reseed + (u_int)V_tcp_isn_reseed_interval*hz)
< (u_int)ticks))) {
-   read_random(&V_isn_secret, sizeof(V_isn_secret));
+   arc4rand(&V_isn_secret, sizeof(V_isn_secret), 0);
V_isn_last_reseed = ticks;
}
 
___
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: r338272 - in head/sys: arm/allwinner arm64/conf conf

2018-08-23 Thread Emmanuel Vadot
Author: manu
Date: Thu Aug 23 18:46:05 2018
New Revision: 338272
URL: https://svnweb.freebsd.org/changeset/base/338272

Log:
  a10_timer: Update the driver so we can use it on other SoC
  
  a10_timer is currently use in UP allwinner SoC (A10 and A13).
  Those don't have the generic arm timer.
  The arm generic timecounter is broken in the A64 SoC, some attempts have
  been made to fix the glitch but users still reported some minor ones.
  Since the A64 (and all Allwinner SoC) still have this timer controller, rework
  the driver so we can use it in any SoC.
  Since it doesn't have the 64 bits counter on all SoC, use one of the
  generic 32 bits counter as the timecounter source.
  
  PR:   229644

Modified:
  head/sys/arm/allwinner/a10_timer.c
  head/sys/arm64/conf/GENERIC
  head/sys/conf/files.arm64

Modified: head/sys/arm/allwinner/a10_timer.c
==
--- head/sys/arm/allwinner/a10_timer.c  Thu Aug 23 18:33:42 2018
(r338271)
+++ head/sys/arm/allwinner/a10_timer.c  Thu Aug 23 18:46:05 2018
(r338272)
@@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -46,65 +45,86 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
+#include 
 
-#include 
-
+#if defined(__aarch64__)
+#include "opt_soc.h"
+#else
 #include 
+#endif
 
 /**
  * Timer registers addr
  *
  */
-#define SW_TIMER_IRQ_EN_REG0x00
-#define SW_TIMER_IRQ_STA_REG   0x04
-#define SW_TIMER0_CTRL_REG 0x10
-#define SW_TIMER0_INT_VALUE_REG0x14
-#define SW_TIMER0_CUR_VALUE_REG0x18
+#defineTIMER_IRQ_EN_REG0x00
+#define TIMER_IRQ_ENABLE(x)(1 << x)
 
-#define SW_COUNTER64LO_REG 0xa4
-#define SW_COUNTER64HI_REG 0xa8
-#define CNT64_CTRL_REG 0xa0
+#defineTIMER_IRQ_STA_REG   0x04
+#define TIMER_IRQ_PENDING(x)   (1 << x)
 
-#define CNT64_RL_EN0x02 /* read latch enable */
+/*
+ * On A10, A13, A20 and A31/A31s 6 timers are available
+ */
+#defineTIMER_CTRL_REG(x)   (0x10 + 0x10 * x)
+#define TIMER_CTRL_START   (1 << 0)
+#define TIMER_CTRL_AUTORELOAD  (1 << 1)
+#define TIMER_CTRL_CLKSRC_MASK (3 << 2)
+#define TIMER_CTRL_OSC24M  (1 << 2)
+#define TIMER_CTRL_PRESCALAR_MASK  (0x7 << 4)
+#define TIMER_CTRL_PRESCALAR(x)((x - 1) << 4)
+#define TIMER_CTRL_MODE_MASK   (1 << 7)
+#define TIMER_CTRL_MODE_SINGLE (1 << 7)
+#define TIMER_CTRL_MODE_CONTINUOUS (0 << 7)
+#defineTIMER_INTV_REG(x)   (0x14 + 0x10 * x)
+#defineTIMER_CURV_REG(x)   (0x18 + 0x10 * x)
 
-#define TIMER_ENABLE   (1<<0)
-#define TIMER_AUTORELOAD   (1<<1)
-#define TIMER_OSC24M   (1<<2) /* oscillator = 24mhz */
-#define TIMER_PRESCALAR(0<<4) /* prescalar = 1 */
+/* 64 bit counter, available in A10 and A13 */
+#defineCNT64_CTRL_REG  0xa0
+#define CNT64_CTRL_RL_EN   0x02 /* read latch enable */
+#defineCNT64_LO_REG0xa4
+#defineCNT64_HI_REG0xa8
 
-#define SYS_TIMER_CLKSRC   2400 /* clock source */
+#defineSYS_TIMER_CLKSRC2400 /* clock source */
 
+enum a10_timer_type {
+   A10_TIMER = 1,
+   A23_TIMER,
+};
+
 struct a10_timer_softc {
device_tsc_dev;
struct resource *res[2];
-   bus_space_tag_t sc_bst;
-   bus_space_handle_t sc_bsh;
void*sc_ih; /* interrupt handler */
uint32_tsc_period;
-   uint32_ttimer0_freq;
-   struct eventtimer et;
+   uint64_ttimer0_freq;
+   struct eventtimer   et;
+   enum a10_timer_type type;
 };
 
-int a10_timer_get_timerfreq(struct a10_timer_softc *);
-
 #define timer_read_4(sc, reg)  \
-   bus_space_read_4(sc->sc_bst, sc->sc_bsh, reg)
+   bus_read_4(sc->res[A10_TIMER_MEMRES], reg)
 #define timer_write_4(sc, reg, val)\
-   bus_space_write_4(sc->sc_bst, sc->sc_bsh, reg, val)
+   bus_write_4(sc->res[A10_TIMER_MEMRES], reg, val)
 
 static u_int   a10_timer_get_timecount(struct timecounter *);
 static int a10_timer_timer_start(struct eventtimer *,
 sbintime_t first, sbintime_t period);
 static int a10_timer_timer_stop(struct eventtimer *);
 
-static uint64_t timer_read_counter64(void);
+static uint64_t timer_read_counter64(struct a10_timer_softc *sc);
+static void a10_timer_eventtimer_setup(struct a10_timer_softc *sc);
 
-static int a10_timer_hardclock(void *);
+static void a23_timer_timecounter_setup(struct a10_timer_softc *sc);
+static u_int a23_timer_get_timecount(struct timecounter *tc);
+
+static int a10_timer_irq(void *);
 static int a10_timer_probe(device_t);
 static int a10_timer_attach(device_t);
 
+#if defined(__arm__)
 static delay_func a10_timer_delay;
+#endif
 

svn commit: r338268 - head

2018-08-23 Thread Alex Richardson
Author: arichardson
Date: Thu Aug 23 18:19:10 2018
New Revision: 338268
URL: https://svnweb.freebsd.org/changeset/base/338268

Log:
  Fix non-FreeBSD host lib32 build for TARGET=amd64
  
  When building on non-FreeBSD systems we need to pass an explicit target
  triple to clang otherwise it will attempt to build with the host triple.
  This also has advantages when building on a FreeBSD host: we now tell
  clang that we are targeting at least FreeBSD 12.0 instead of an older
  version so it can enable newer features.
  
  Reviewed By:  brooks (mentor)
  Approved By:  jhb (mentor)
  Differential Revision: https://reviews.freebsd.org/D16842

Modified:
  head/Makefile.libcompat

Modified: head/Makefile.libcompat
==
--- head/Makefile.libcompat Thu Aug 23 18:19:01 2018(r338267)
+++ head/Makefile.libcompat Thu Aug 23 18:19:10 2018(r338268)
@@ -14,6 +14,11 @@ LIB32CPUFLAGS=   -march=i686 -mmmx -msse -msse2
 .else
 LIB32CPUFLAGS= -march=${TARGET_CPUTYPE}
 .endif
+.if ${WANT_COMPILER_TYPE} == gcc || \
+(defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc)
+.else
+LIB32CPUFLAGS+=-target x86_64-unknown-freebsd12.0
+.endif
 LIB32CPUFLAGS+=-m32
 LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \
MACHINE_CPU="i686 mmx sse sse2"
___
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: r338267 - head/sbin/md5

2018-08-23 Thread Alex Richardson
Author: arichardson
Date: Thu Aug 23 18:19:01 2018
New Revision: 338267
URL: https://svnweb.freebsd.org/changeset/base/338267

Log:
  Allow bootstrapping md5 on Linux, MacOS and FreeBSD < 12
  
  In order to build on a Linux host we need to bootstrap md5 since the Linux
  md5sum command produces output in a different format.
  
  Reviewed By:  emaste
  Approved By:  brooks (mentor)
  Differential Revision: https://reviews.freebsd.org/D16846

Modified:
  head/sbin/md5/Makefile
  head/sbin/md5/md5.c

Modified: head/sbin/md5/Makefile
==
--- head/sbin/md5/Makefile  Thu Aug 23 18:18:52 2018(r338266)
+++ head/sbin/md5/Makefile  Thu Aug 23 18:19:01 2018(r338267)
@@ -28,4 +28,12 @@ MLINKS=  md5.1 rmd160.1 \
 
 LIBADD=md
 
+.ifndef(BOOTSTRAPPING)
+# Avoid depending on capsicum during bootstrap. caph_limit_stdout() is not
+# available when building for Linux/MacOS or older FreeBSD hosts.
+# We need to bootstrap md5 when building on Linux since the md5sum command 
there
+# produces different output.
+CFLAGS+=-DHAVE_CAPSICUM
+.endif
+
 .include 

Modified: head/sbin/md5/md5.c
==
--- head/sbin/md5/md5.c Thu Aug 23 18:18:52 2018(r338266)
+++ head/sbin/md5/md5.c Thu Aug 23 18:19:01 2018(r338267)
@@ -21,11 +21,10 @@
 __FBSDID("$FreeBSD$");
 
 #include 
-#include 
 #include 
 #include 
-#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -41,6 +40,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef HAVE_CAPSICUM
+#include 
+#include 
+#endif
+
 /*
  * Length of test block, number of test blocks.
  */
@@ -162,7 +166,9 @@ Arguments (may be any combination):
 int
 main(int argc, char *argv[])
 {
+#ifdef HAVE_CAPSICUM
cap_rights_trights;
+#endif
int ch, fd;
char   *p;
charbuf[HEX_DIGEST_LENGTH];
@@ -215,8 +221,10 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
 
+#ifdef HAVE_CAPSICUM
if (caph_limit_stdout() < 0 || caph_limit_stderr() < 0)
err(1, "unable to limit rights for stdio");
+#endif
 
if (*argv) {
do {
@@ -232,10 +240,12 @@ main(int argc, char *argv[])
 * earlier.
 */
if (*(argv + 1) == NULL) {
+#ifdef HAVE_CAPSICUM
cap_rights_init(&rights, CAP_READ);
if ((cap_rights_limit(fd, &rights) < 0 &&
errno != ENOSYS) || caph_enter() < 0)
err(1, "capsicum");
+#endif
}
if ((p = Algorithm[digest].Fd(fd, buf)) == NULL) {
warn("%s", *argv);
@@ -258,8 +268,10 @@ main(int argc, char *argv[])
}
} while (*++argv);
} else if (!sflag && (optind == 1 || qflag || rflag)) {
+#ifdef HAVE_CAPSICUM
if (caph_limit_stdin() < 0 || caph_enter() < 0)
err(1, "capsicum");
+#endif
MDFilter(&Algorithm[digest], 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: r338265 - head/usr.bin/sort

2018-08-23 Thread Alex Richardson
Author: arichardson
Date: Thu Aug 23 18:18:43 2018
New Revision: 338265
URL: https://svnweb.freebsd.org/changeset/base/338265

Log:
  Don't use absolute path to sed when building usr.bin/join
  
  This is required to build sort on Linux hosts since sed is in /bin there.
  
  Approved By:  jhb (mentor)

Modified:
  head/usr.bin/sort/Makefile

Modified: head/usr.bin/sort/Makefile
==
--- head/usr.bin/sort/Makefile  Thu Aug 23 18:11:55 2018(r338264)
+++ head/usr.bin/sort/Makefile  Thu Aug 23 18:18:43 2018(r338265)
@@ -7,7 +7,7 @@ PROG=   sort
 SRCS=  bwstring.c coll.c file.c mem.c radixsort.c sort.c vsort.c
 
 sort.1: sort.1.in
-   /usr/bin/sed ${MAN_SUB} ${.ALLSRC} >${.TARGET}
+   sed ${MAN_SUB} ${.ALLSRC} >${.TARGET}
 
 CLEANFILES+= sort.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: r338264 - head/sys/dev/ixl

2018-08-23 Thread Marius Strobl
Author: marius
Date: Thu Aug 23 18:11:55 2018
New Revision: 338264
URL: https://svnweb.freebsd.org/changeset/base/338264

Log:
  Remove a duplicated interface capability bit missed in r336313.

Modified:
  head/sys/dev/ixl/ixl.h

Modified: head/sys/dev/ixl/ixl.h
==
--- head/sys/dev/ixl/ixl.h  Thu Aug 23 18:06:31 2018(r338263)
+++ head/sys/dev/ixl/ixl.h  Thu Aug 23 18:11:55 2018(r338264)
@@ -260,7 +260,7 @@
 IFCAP_TXCSUM | IFCAP_TXCSUM_IPV6 | \
 IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6 | \
 IFCAP_VLAN_HWFILTER | IFCAP_VLAN_HWTSO | \
-IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO | \
+IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM | \
 IFCAP_VLAN_MTU | IFCAP_JUMBO_MTU | IFCAP_LRO)
 
 #define IXL_CSUM_TCP \
___
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: r338263 - head/tools/build/mk

2018-08-23 Thread Kyle Evans
Author: kevans
Date: Thu Aug 23 18:06:31 2018
New Revision: 338263
URL: https://svnweb.freebsd.org/changeset/base/338263

Log:
  Remove hyper-v leftovers when WITHOUT_HYPERV is set
  
  hv_vss_daemon was missed.
  
  Submitted by: Oliver Pinter
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D16811

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Thu Aug 23 18:01:34 
2018(r338262)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Thu Aug 23 18:06:31 
2018(r338263)
@@ -9369,6 +9369,7 @@ OLD_FILES+=usr/libexec/hyperv/hv_set_ifconfig
 OLD_FILES+=usr/libexec/hyperv/hv_get_dns_info
 OLD_FILES+=usr/libexec/hyperv/hv_get_dhcp_info
 OLD_FILES+=usr/sbin/hv_kvp_daemon
+OLD_FILES+=usr/sbin/hv_vss_daemon
 OLD_FILES+=usr/share/man/man8/hv_kvp_daemon.8.gz
 .endif
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r338262 - head/stand/fdt

2018-08-23 Thread Kyle Evans
Author: kevans
Date: Thu Aug 23 18:01:34 2018
New Revision: 338262
URL: https://svnweb.freebsd.org/changeset/base/338262

Log:
  stand: fdt: Drop some write-only assignments/variables and leaked bits
  
  Generally straightforward enough; a copy of argv[1] was being made in
  command_fdt_internal, solely used for a comparison within the
  handler-search, then promptly leaked.
  
  Reported by:  ports gcc and clang's static analyzer

Modified:
  head/stand/fdt/fdt_loader_cmd.c

Modified: head/stand/fdt/fdt_loader_cmd.c
==
--- head/stand/fdt/fdt_loader_cmd.c Thu Aug 23 17:50:41 2018
(r338261)
+++ head/stand/fdt/fdt_loader_cmd.c Thu Aug 23 18:01:34 2018
(r338262)
@@ -844,7 +844,6 @@ void
 fdt_fixup_stdout(const char *str)
 {
char *ptr;
-   int serialno;
int len, no, sero;
const struct fdt_property *prop;
char *tmp[10];
@@ -856,7 +855,6 @@ fdt_fixup_stdout(const char *str)
if (ptr == str)
return;
 
-   serialno = (int)strtol(ptr, NULL, 0);
no = fdt_path_offset(fdtp, "/chosen");
if (no < 0)
return;
@@ -913,10 +911,8 @@ fdt_load_dtb_overlays(const char *extras)
 static int
 fdt_fixup(void)
 {
-   int chosen, len;
+   int chosen;
 
-   len = 0;
-
debugf("fdt_fixup()\n");
 
if (fdtp == NULL && fdt_setup_fdtp() != 0)
@@ -973,7 +969,6 @@ command_fdt_internal(int argc, char *argv[])
 {
cmdf_t *cmdh;
int flags;
-   char *cmd;
int i, err;
 
if (argc < 2) {
@@ -984,11 +979,10 @@ command_fdt_internal(int argc, char *argv[])
/*
 * Validate fdt .
 */
-   cmd = strdup(argv[1]);
i = 0;
cmdh = NULL;
while (!(commands[i].name == NULL)) {
-   if (strcmp(cmd, commands[i].name) == 0) {
+   if (strcmp(argv[1], commands[i].name) == 0) {
/* found it */
cmdh = commands[i].handler;
flags = commands[i].flags;
@@ -1512,7 +1506,6 @@ fdt_modprop(int nodeoff, char *propname, void *value, 
sprintf(command_errbuf, "property does not exist!");
return (CMD_ERROR);
}
-   len = strlen(value);
rv = 0;
buf = value;
 
___
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: r338261 - head/sys/dev/sdhci

2018-08-23 Thread Marius Strobl
Author: marius
Date: Thu Aug 23 17:50:41 2018
New Revision: 338261
URL: https://svnweb.freebsd.org/changeset/base/338261

Log:
  - According to section 2.2.5 of the SDHCI specification version 4.20,
SDHCI_TRNS_ACMD12 is to be set only for multiple-block read/write
commands without data length information, so don't unconditionally
set this bit. The result matches what e. g. Linux does.
  - Section 2.2.19 of the SDHCI specification version 4.20 states that
SDHCI_ACMD12_ERR should be only valid if SDHCI_INT_ACMD12ERR is set
and hardware may clear SDHCI_ACMD12_ERR when SDHCI_INT_ACMD12ERR is
cleared (differing silicon behavior is specifically allowed, though).
Thus, read SDHCI_ACMD12_ERR before clearing SDHCI_INT_ACMD12ERR.
While at it, use the 16-bit accessor rather than the 32-bit one for
reading the 16-bit SDHCI_ACMD12_ERR.
  - SDHCI_INT_TUNEERR isn't one of the ROC bits in SDHCI_INT_STATUS so
clear it explicitly.
  - Add missing prototypes and sort them.

Modified:
  head/sys/dev/sdhci/sdhci.c

Modified: head/sys/dev/sdhci/sdhci.c
==
--- head/sys/dev/sdhci/sdhci.c  Thu Aug 23 17:41:39 2018(r338260)
+++ head/sys/dev/sdhci/sdhci.c  Thu Aug 23 17:50:41 2018(r338261)
@@ -90,27 +90,49 @@ SYSCTL_INT(_hw_sdhci, OID_AUTO, quirk_set, CTLFLAG_RWT
 #defineWR_MULTI_4(slot, off, ptr, count)   \
 SDHCI_WRITE_MULTI_4((slot)->bus, (slot), (off), (ptr), (count))
 
+static void sdhci_acmd_irq(struct sdhci_slot *slot, uint16_t acmd_err);
 static void sdhci_card_poll(void *arg);
 static void sdhci_card_task(void *arg, int pending);
+static void sdhci_cmd_irq(struct sdhci_slot *slot, uint32_t intmask);
+static void sdhci_data_irq(struct sdhci_slot *slot, uint32_t intmask);
 static int sdhci_exec_tuning(struct sdhci_slot *slot, bool reset);
+static void sdhci_handle_card_present_locked(struct sdhci_slot *slot,
+bool is_present);
+static void sdhci_finish_command(struct sdhci_slot *slot);
+static void sdhci_init(struct sdhci_slot *slot);
+static void sdhci_read_block_pio(struct sdhci_slot *slot);
+static void sdhci_req_done(struct sdhci_slot *slot);
 static void sdhci_req_wakeup(struct mmc_request *req);
+static void sdhci_reset(struct sdhci_slot *slot, uint8_t mask);
 static void sdhci_retune(void *arg);
 static void sdhci_set_clock(struct sdhci_slot *slot, uint32_t clock);
+static void sdhci_set_power(struct sdhci_slot *slot, u_char power);
+static void sdhci_set_transfer_mode(struct sdhci_slot *slot,
+   struct mmc_data *data);
 static void sdhci_start(struct sdhci_slot *slot);
+static void sdhci_timeout(void *arg);
+static void sdhci_start_command(struct sdhci_slot *slot,
+   struct mmc_command *cmd);
 static void sdhci_start_data(struct sdhci_slot *slot, struct mmc_data *data);
+static void sdhci_write_block_pio(struct sdhci_slot *slot);
+static void sdhci_transfer_pio(struct sdhci_slot *slot);
 
 #ifdef MMCCAM
 /* CAM-related */
-int sdhci_cam_get_possible_host_clock(struct sdhci_slot *slot, int 
proposed_clock);
-static int sdhci_cam_update_ios(struct sdhci_slot *slot);
-static int sdhci_cam_request(struct sdhci_slot *slot, union ccb *ccb);
 static void sdhci_cam_action(struct cam_sim *sim, union ccb *ccb);
+static int sdhci_cam_get_possible_host_clock(struct sdhci_slot *slot,
+int proposed_clock);
+static void sdhci_cam_handle_mmcio(struct cam_sim *sim, union ccb *ccb);
 static void sdhci_cam_poll(struct cam_sim *sim);
+static int sdhci_cam_request(struct sdhci_slot *slot, union ccb *ccb);
 static int sdhci_cam_settran_settings(struct sdhci_slot *slot, union ccb *ccb);
+static int sdhci_cam_update_ios(struct sdhci_slot *slot);
 #endif
 
 /* helper routines */
 static void sdhci_dumpregs(struct sdhci_slot *slot);
+static void sdhci_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs,
+int error);
 static int slot_printf(struct sdhci_slot *slot, const char * fmt, ...)
 __printflike(2, 3);
 static uint32_t sdhci_tuning_intmask(struct sdhci_slot *slot);
@@ -1547,20 +1569,20 @@ sdhci_set_transfer_mode(struct sdhci_slot *slot, struc
return;
 
mode = SDHCI_TRNS_BLK_CNT_EN;
-   if (data->len > 512)
+   if (data->len > 512) {
mode |= SDHCI_TRNS_MULTI;
-   if (data->flags & MMC_DATA_READ)
-   mode |= SDHCI_TRNS_READ;
+   if (__predict_true(
 #ifdef MMCCAM
-   struct ccb_mmcio *mmcio;
-   mmcio = &slot->ccb->mmcio;
-   if (mmcio->stop.opcode == MMC_STOP_TRANSMISSION
-   && !(slot->quirks & SDHCI_QUIRK_BROKEN_AUTO_STOP))
-   mode |= SDHCI_TRNS_ACMD12;
+   slot->ccb->mmcio.stop.opcode == MMC_STOP_TRANSMISSION &&
 #else
-   if (slot->req->stop && !(slot->quirks & SDHCI_QUIRK_BROKEN_AUTO_STOP))
-   mode |= SDHCI_TRNS_ACMD12;
+   slot->req->stop &&
 #endif
+   !(slot->quirks & SDHCI_QUIRK_BROKEN_AUTO_STOP

svn commit: r338259 - head/stand/lua

2018-08-23 Thread Kyle Evans
Author: kevans
Date: Thu Aug 23 17:27:02 2018
New Revision: 338259
URL: https://svnweb.freebsd.org/changeset/base/338259

Log:
  lualoader: Accept that people use unquoted values in loader.conf
  
  While loader.conf(5) suggests that all values should be quoted, reality is
  that this was never strictly enforced and it is used. We already make some
  concession to this in number values, which aren't strictly quoted either.
  
  The compromise here is that multi-word values must be quoted. This lets
  things like `foo_load=YES` work, while denying more complex expressions on
  the right hand side. This likely catches the vast majority of current usage.
  
  A bit of a kludge is needed to accomplish this since Lua regex doesn't
  support branching. I had considered splitting up expressions and generating
  the right-hand side of the expressions completely in config.parse, but
  deemed this too large of an overhaul to take given the current timing. This
  should be re-worked shortly after the thaw.
  
  Reported by:  royger

Modified:
  head/stand/lua/config.lua

Modified: head/stand/lua/config.lua
==
--- head/stand/lua/config.lua   Thu Aug 23 17:00:07 2018(r338258)
+++ head/stand/lua/config.lua   Thu Aug 23 17:27:02 2018(r338259)
@@ -57,6 +57,10 @@ local MSG_MODLOADING = "Loading configured modules..."
 local MSG_MODLOADFAIL = "Could not load one or more modules!"
 
 local MODULEEXPR = '([%w-_]+)'
+local QVALEXPR = "\"([%w%s%p]-)\""
+local QVALREPL = QVALEXPR:gsub('%%', '')
+local WORDEXPR = "([%w]+)"
+local WORDREPL = WORDEXPR:gsub('%%', '')
 
 local function restoreEnv()
-- Examine changed environment variables
@@ -125,11 +129,31 @@ local function processEnvVar(value)
return value
 end
 
+local function checkPattern(line, pattern)
+   local function _realCheck(_line, _pattern)
+   return _line:match(_pattern)
+   end
+
+   if pattern:find('$VALUE') then
+   local k, v, c
+   k, v, c = _realCheck(line, pattern:gsub('$VALUE', QVALREPL))
+   if k ~= nil then
+   return k,v, c
+   end
+   return _realCheck(line, pattern:gsub('$VALUE', WORDREPL))
+   else
+   return _realCheck(line, pattern)
+   end
+end
+
 -- str in this table is a regex pattern.  It will automatically be anchored to
 -- the beginning of a line and any preceding whitespace will be skipped.  The
 -- pattern should have no more than two captures patterns, which correspond to
 -- the two parameters (usually 'key' and 'value') that are passed to the
--- process function.  All trailing characters will be validated.
+-- process function.  All trailing characters will be validated.  Any $VALUE
+-- token included in a pattern will be tried first with a quoted value capture
+-- group, then a single-word value capture group.  This is our kludge for Lua
+-- regex not supporting branching.
 --
 -- We have two special entries in this table: the first is the first entry,
 -- a full-line comment.  The second is for 'exec' handling.  Both have a single
@@ -139,6 +163,7 @@ end
 -- We document the exceptions with a special 'groups' index that indicates
 -- the number of capture groups, if not two.  We'll use this later to do
 -- validation on the proper entry.
+--
 local pattern_table = {
{
str = "(#.*)",
@@ -147,7 +172,7 @@ local pattern_table = {
},
--  module_load="value"
{
-   str = MODULEEXPR .. "_load%s*=%s*\"([%w%s%p]-)\"",
+   str = MODULEEXPR .. "_load%s*=%s*$VALUE",
process = function(k, v)
if modules[k] == nil then
modules[k] = {}
@@ -157,49 +182,49 @@ local pattern_table = {
},
--  module_name="value"
{
-   str = MODULEEXPR .. "_name%s*=%s*\"([%w%s%p]-)\"",
+   str = MODULEEXPR .. "_name%s*=%s*$VALUE",
process = function(k, v)
setKey(k, "name", v)
end,
},
--  module_type="value"
{
-   str = MODULEEXPR .. "_type%s*=%s*\"([%w%s%p]-)\"",
+   str = MODULEEXPR .. "_type%s*=%s*$VALUE",
process = function(k, v)
setKey(k, "type", v)
end,
},
--  module_flags="value"
{
-   str = MODULEEXPR .. "_flags%s*=%s*\"([%w%s%p]-)\"",
+   str = MODULEEXPR .. "_flags%s*=%s*$VALUE",
process = function(k, v)
setKey(k, "flags", v)
end,
},
--  module_before="value"
{
-   str = MODULEEXPR .. "_before%s*=%s*\"([%w%s%p]-)\"",
+   str = MODULEEXPR .. "_before%s*=%s*$VALUE",
process = function(k, v)
setKey(k, "

svn commit: r338271 - head/sys/arm/allwinner

2018-08-23 Thread Emmanuel Vadot
Author: manu
Date: Thu Aug 23 18:33:42 2018
New Revision: 338271
URL: https://svnweb.freebsd.org/changeset/base/338271

Log:
  aw_mmc: Handle MMCBR_IVAR_RETUNE_REQ
  
  Without this the mmc stack sometimes think that we are in in a retune
  operation and some command like switch the bus width to 4 bits failed.
  We now switch correctly to 4 bits mode for sd card.
  
  Reported by:  jmg, others in pine64 irc channel

Modified:
  head/sys/arm/allwinner/aw_mmc.c

Modified: head/sys/arm/allwinner/aw_mmc.c
==
--- head/sys/arm/allwinner/aw_mmc.c Thu Aug 23 18:19:33 2018
(r338270)
+++ head/sys/arm/allwinner/aw_mmc.c Thu Aug 23 18:33:42 2018
(r338271)
@@ -1198,6 +1198,9 @@ aw_mmc_read_ivar(device_t bus, device_t child, int whi
*(int *)result = (sc->aw_mmc_conf->dma_xferlen *
AW_MMC_DMA_SEGS) / MMC_SECTOR_SIZE;
break;
+   case MMCBR_IVAR_RETUNE_REQ:
+   *(int *)result = retune_req_none;
+   break;
}
 
return (0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r338266 - head/include

2018-08-23 Thread Alex Richardson
Author: arichardson
Date: Thu Aug 23 18:18:52 2018
New Revision: 338266
URL: https://svnweb.freebsd.org/changeset/base/338266

Log:
  Handle -DNO_ROOT for `make compat` in include/
  
  Otherwise this step will fail on a Linux host due to missing "wheel" group
  
  Approved By:  brooks (mentor)
  Differential Revision: https://reviews.freebsd.org/D16841

Modified:
  head/include/Makefile

Modified: head/include/Makefile
==
--- head/include/Makefile   Thu Aug 23 18:18:43 2018(r338265)
+++ head/include/Makefile   Thu Aug 23 18:18:52 2018(r338266)
@@ -143,7 +143,7 @@ compat:
rm -f ${SDESTDIR}${INCLUDEDIR}/$i; \
fi
 .endfor
-   mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \
+   mtree -deU ${NO_ROOT:D-W} ${MTREE_FOLLOWS_SYMLINKS} \
-f ${SRCTOP}/etc/mtree/BSD.include.dist \
-p ${SDESTDIR}${INCLUDEDIR} > /dev/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: r338270 - head/lib/libmd

2018-08-23 Thread Alex Richardson
Author: arichardson
Date: Thu Aug 23 18:19:33 2018
New Revision: 338270
URL: https://svnweb.freebsd.org/changeset/base/338270

Log:
  Don't build skein_block_asm.s if we don't have an as binary
  
  This fixes building libmd on MacOS/Linux. The real fix is probably to
  build it as a .S file with $CC instead. It might also be better to just
  compile the C file in userspace since the compiler can the use SSE/AVX.
  
  Reviewed By:  emaste, brooks
  Approved By:  jhb (mentor)
  Differential Revision: https://reviews.freebsd.org/D16844

Modified:
  head/lib/libmd/Makefile

Modified: head/lib/libmd/Makefile
==
--- head/lib/libmd/Makefile Thu Aug 23 18:19:21 2018(r338269)
+++ head/lib/libmd/Makefile Thu Aug 23 18:19:33 2018(r338270)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include 
+
 PACKAGE=lib${LIB}
 LIB=   md
 SHLIB_MAJOR= 6
@@ -114,11 +116,15 @@ SRCS+=rmd160.S
 CFLAGS+= -DRMD160_ASM
 .endif
 .if exists(${MACHINE_ARCH}/skein_block_asm.s)
+.if defined(XAS) || ${MK_BINUTILS_BOOTSTRAP} != "no"
 AFLAGS += --strip-local-absolute
 # Fully unroll all loops in the assembly optimized version
 AFLAGS+= --defsym SKEIN_LOOP=0
 SRCS+= skein_block_asm.s
 CFLAGS+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace 
with assembly: 256+512+1024 = 1792
+.else
+.warning as not available: not using optimized Skein asm
+.endif
 .endif
 .if exists(${MACHINE_ARCH}/sha.S) || exists(${MACHINE_ARCH}/rmd160.S) || 
exists(${MACHINE_ARCH}/skein_block_asm.s)
 ACFLAGS+= -DELF -Wa,--noexecstack
___
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: r338269 - head

2018-08-23 Thread Alex Richardson
Author: arichardson
Date: Thu Aug 23 18:19:21 2018
New Revision: 338269
URL: https://svnweb.freebsd.org/changeset/base/338269

Log:
  Only bootstrap localedef if ${MK_LOCALES} != "no"
  
  During the build it is only used by share/ctypedef and share/colldef
  which will not be built if ${MK_LOCALE} == "no". This saves a tiny bit
  of time when building without locales.
  
  Approved By:  jhb (mentor)

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Thu Aug 23 18:19:10 2018(r338268)
+++ head/Makefile.inc1  Thu Aug 23 18:19:21 2018(r338269)
@@ -2031,6 +2031,10 @@ ${_bt}-usr.bin/yacc: ${_bt}-lib/liby
 _gensnmptree=  usr.sbin/bsnmpd/gensnmptree
 .endif
 
+.if ${MK_LOCALES} != "no"
+_localedef=usr.bin/localedef
+.endif
+
 # We need to build tblgen when we're building clang or lld, either as
 # bootstrap tools, or as the part of the normal build.
 .if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no" || \
@@ -2092,7 +2096,7 @@ bootstrap-tools: .PHONY
 ${_crunchgen} \
 ${_nmtree} \
 ${_vtfontcvt} \
-usr.bin/localedef
+${_localedef}
 ${_bt}-${_tool}: .PHONY .MAKE
${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \
cd ${.CURDIR}/${_tool}; \
___
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: r338172 - Now deprecating DRM

2018-08-23 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> On Wed, Aug 22, 2018 at 10:08 AM Rodney W. Grimes <
> free...@pdx.rh.cn85.dnsmgr.net> wrote:
> 
> > I think this deprecation is a rather serious deviation
> > from the stated policy, in that 0 notification was
> > made, core IMHO, has overstepped some boundaries in
> > that respect.   These policies are promises to the
> > downstream consumers, and violating them is very
> > poor planning.
> >
> 
> Despite what the commit said, core didn't actually formally approve it
> before the fact. That was one of the many miscommunications surrounding
> this episode.

Well I would say inlight of that fact a revert should be a no questions
asked, doing much else risks build breakage within hours of code freeze.


> I don't think you'll find anybody who would say this was well planned or
> well executed.

Agreed, so lets be simple in correcting it?

>From some investigation even the claim that "in base drm conflicts with
ports drm" is not totally true, you just have to take a few steps to
be sure you do not load the base versions, and do load the ports version.

There is still time to revert this, add the gone_in(13) glue and have
12.0 go out in that state.

I am concerned that if 1 person came forward right off the bat with
this change, and we try to do something that takes care of just that
issue we are going to have others come forward in time with similiar
issues and we are going to look bad for failing to follow our own
published guidelines.

I see no smoking gun reason that this code has to die today,
the ports are already setup with instructions on how to deal
with the inbase drm.

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


Re: svn commit: r338257 - head/sys/netinet6

2018-08-23 Thread Bjoern A. Zeeb

On 23 Aug 2018, at 16:54, Bjoern A. Zeeb wrote:


Author: bz
Date: Thu Aug 23 16:54:22 2018
New Revision: 338257
URL: https://svnweb.freebsd.org/changeset/base/338257

Log:
  MFp4 bz_ipv6_fast:

  Migrate udp6_send() v4mapped code to udp6_output() saving us a 
re-lock and

  further simplifying the address-family handling code by eliminating
  AF_INET checks and almost all v4mapped handling right after the 
start

  as cases could actually not happen anymore.

  Rework output path locking similar to UDP4 allowing for better
  parallelism (see r222488, and later versions).

  Sponsored by: The FreeBSD Foundation (2012)
  Sponsored by: iXsystems (2012)
  Differential Revision:https://reviews.freebsd.org/D3721

Modified:
  head/sys/netinet6/udp6_usrreq.c


Yes, this was from a perforce branch (originally) but people might 
remember seeing it on net@.  Not that anyone but me really cared so far.


In case you wonder what the difference once was, there was a local 
benchmark case here showing the difference:
https://people.freebsd.org/~bz/bench/20120408-diff_pps-pps.html   (there 
are some more on those pages or in my old BSDCan presentation).


This latest update also includes the epoch(9) changes and should finally 
get UDP6 on par with UDP4 and has addressed all but one comment from the 
old review.


Happy UDP-encaping or QUICing or ..


/bz
___
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: r338256 - head/sys/dev/xen/netfront

2018-08-23 Thread Kristof Provost
Author: kp
Date: Thu Aug 23 16:52:52 2018
New Revision: 338256
URL: https://svnweb.freebsd.org/changeset/base/338256

Log:
  xen/netfront: Ensure curvnet is set
  
  netfront_backend_changed() is called from the xenwatch_thread(), which means
  that the curvnet is not set. We have to set it before we can call things like
  arp_ifinit().
  
  PR:   230845

Modified:
  head/sys/dev/xen/netfront/netfront.c

Modified: head/sys/dev/xen/netfront/netfront.c
==
--- head/sys/dev/xen/netfront/netfront.cThu Aug 23 16:26:03 2018
(r338255)
+++ head/sys/dev/xen/netfront/netfront.cThu Aug 23 16:52:52 2018
(r338256)
@@ -962,6 +962,8 @@ netfront_backend_changed(device_t dev, XenbusState new
 
DPRINTK("newstate=%d\n", newstate);
 
+   CURVNET_SET(sc->xn_ifp->if_vnet);
+
switch (newstate) {
case XenbusStateInitialising:
case XenbusStateInitialised:
@@ -994,6 +996,8 @@ netfront_backend_changed(device_t dev, XenbusState new
 #endif
break;
}
+
+   CURVNET_RESTORE();
 }
 
 /**
___
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: r338260 - head/sbin/pfctl

2018-08-23 Thread Patrick Kelsey
Author: pkelsey
Date: Thu Aug 23 17:41:39 2018
New Revision: 338260
URL: https://svnweb.freebsd.org/changeset/base/338260

Log:
  Fix warning about crossing INT32_MAX boundary in computation of constant 
value.

Modified:
  head/sbin/pfctl/pfctl_altq.c

Modified: head/sbin/pfctl/pfctl_altq.c
==
--- head/sbin/pfctl/pfctl_altq.cThu Aug 23 17:27:02 2018
(r338259)
+++ head/sbin/pfctl/pfctl_altq.cThu Aug 23 17:41:39 2018
(r338260)
@@ -299,7 +299,7 @@ eval_pfaltq(struct pfctl *pf, struct pf_altq *pa, stru
size = 4;
else if (rate <= 200 * 1000 * 1000)
size = 8;
-   else if (rate <= 2500 * 1000 * 1000)
+   else if (rate <= 2500 * 1000 * 1000ULL)
size = 24;
else
size = 128;
___
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: r338253 - head/sbin/pfctl

2018-08-23 Thread Kristof Provost
This seems to have broken a couple of platforms (aarch64, riscv64, 
sparc64, powerpc at least):


	/usr/src/sbin/pfctl/pfctl_altq.c:302:32: error: overflow in expression; 
result is -1794967296 with type 'int' [-Werror,-Winteger-overflow]

--- all_subdir_lib ---
--- puts.po ---
--- all_subdir_sbin ---
else if (rate <= 2500 * 1000 * 1000)
 ^

Regards,
Kristof

On 23 Aug 2018, at 18:10, Patrick Kelsey wrote:


Author: pkelsey
Date: Thu Aug 23 16:10:28 2018
New Revision: 338253
URL: https://svnweb.freebsd.org/changeset/base/338253

Log:
  Extend tbrsize heuristic in pfctl(8) to provide a sensible value for
  higher bandwidth interfaces.  The new value is used above 2.5 Gbps,
  which is the highest standard rate that could be used prior to
  r338209, so the default behavior for all existing systems should
  remain the same.

  The value of 128 chosen is a balance between being big enough to
  reduce potential precision/quantization effects stemming from 
frequent

  bucket refills over small time intervals and being small enough to
  prevent a greedy driver from burst dequeuing more packets than it 
has
  available hardware ring slots for whenever altq transitions from 
idle

  to backlogged.

  Reviewed by:  jmallett, kp
  MFC after:2 weeks
  Sponsored by: RG Nets
  Differential Revision: https://reviews.freebsd.org/D16852

Modified:
  head/sbin/pfctl/pfctl_altq.c

Modified: head/sbin/pfctl/pfctl_altq.c
==
--- head/sbin/pfctl/pfctl_altq.cThu Aug 23 15:01:27 2018
(r338252)
+++ head/sbin/pfctl/pfctl_altq.cThu Aug 23 16:10:28 2018
(r338253)
@@ -299,8 +299,10 @@ eval_pfaltq(struct pfctl *pf, struct pf_altq *pa, 
stru

size = 4;
else if (rate <= 200 * 1000 * 1000)
size = 8;
-   else
+   else if (rate <= 2500 * 1000 * 1000)
size = 24;
+   else
+   size = 128;
size = size * getifmtu(pa->ifname);
pa->tbrsize = size;
}

___
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: r338172 - Now deprecating DRM

2018-08-23 Thread Warner Losh
On Wed, Aug 22, 2018 at 10:08 AM Rodney W. Grimes <
free...@pdx.rh.cn85.dnsmgr.net> wrote:

> I think this deprecation is a rather serious deviation
> from the stated policy, in that 0 notification was
> made, core IMHO, has overstepped some boundaries in
> that respect.   These policies are promises to the
> downstream consumers, and violating them is very
> poor planning.
>

Despite what the commit said, core didn't actually formally approve it
before the fact. That was one of the many miscommunications surrounding
this episode.

I don't think you'll find anybody who would say this was well planned or
well executed.

Warner
___
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: r338258 - head/usr.bin/tftp

2018-08-23 Thread Alan Somers
Author: asomers
Date: Thu Aug 23 17:00:07 2018
New Revision: 338258
URL: https://svnweb.freebsd.org/changeset/base/338258

Log:
  tftp(1): switch default transfer mode to binary
  
  netascii is obsolete and inefficient. It isn't even supported by many
  clients. Better to use binary mode by default.
  
  Reviewed by:  cem
  Relnotes: yes
  Differential Revision:https://reviews.freebsd.org/D16869

Modified:
  head/usr.bin/tftp/main.c
  head/usr.bin/tftp/tftp.1

Modified: head/usr.bin/tftp/main.c
==
--- head/usr.bin/tftp/main.cThu Aug 23 16:54:22 2018(r338257)
+++ head/usr.bin/tftp/main.cThu Aug 23 17:00:07 2018(r338258)
@@ -184,7 +184,7 @@ main(int argc, char *argv[])
 
acting_as_client = 1;
peer = -1;
-   strcpy(mode, "netascii");
+   strcpy(mode, "octet");
signal(SIGINT, intr);
 
interactive = isatty(STDIN_FILENO);

Modified: head/usr.bin/tftp/tftp.1
==
--- head/usr.bin/tftp/tftp.1Thu Aug 23 16:54:22 2018(r338257)
+++ head/usr.bin/tftp/tftp.1Thu Aug 23 17:00:07 2018(r338258)
@@ -28,7 +28,7 @@
 .\" @(#)tftp.1 8.2 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd June 22, 2011
+.Dd Aug 22, 2018
 .Dt TFTP 1
 .Os
 .Sh NAME
@@ -151,7 +151,7 @@ may be one of
 or
 .Em binary .
 The default is
-.Em ascii .
+.Em binary .
 .Pp
 .It Cm packetdrop [arg]
 Randomly drop
___
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: r338257 - head/sys/netinet6

2018-08-23 Thread Bjoern A. Zeeb
Author: bz
Date: Thu Aug 23 16:54:22 2018
New Revision: 338257
URL: https://svnweb.freebsd.org/changeset/base/338257

Log:
  MFp4 bz_ipv6_fast:
  
  Migrate udp6_send() v4mapped code to udp6_output() saving us a re-lock and
  further simplifying the address-family handling code by eliminating
  AF_INET checks and almost all v4mapped handling right after the start
  as cases could actually not happen anymore.
  
  Rework output path locking similar to UDP4 allowing for better
  parallelism (see r222488, and later versions).
  
  Sponsored by: The FreeBSD Foundation (2012)
  Sponsored by: iXsystems (2012)
  Differential Revision:https://reviews.freebsd.org/D3721

Modified:
  head/sys/netinet6/udp6_usrreq.c

Modified: head/sys/netinet6/udp6_usrreq.c
==
--- head/sys/netinet6/udp6_usrreq.c Thu Aug 23 16:52:52 2018
(r338256)
+++ head/sys/netinet6/udp6_usrreq.c Thu Aug 23 16:54:22 2018
(r338257)
@@ -679,35 +679,38 @@ udp6_getcred(SYSCTL_HANDLER_ARGS)
 SYSCTL_PROC(_net_inet6_udp6, OID_AUTO, getcred, CTLTYPE_OPAQUE|CTLFLAG_RW, 0,
 0, udp6_getcred, "S,xucred", "Get the xucred of a UDP6 connection");
 
+#defineUH_WLOCKED  2
+#defineUH_RLOCKED  1
+#defineUH_UNLOCKED 0
 static int
-udp6_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr6,
-struct mbuf *control, struct thread *td)
+udp6_output(struct socket *so, int flags_arg, struct mbuf *m,
+struct sockaddr *addr6, struct mbuf *control, struct thread *td)
 {
-   u_int32_t ulen = m->m_pkthdr.len;
-   u_int32_t plen = sizeof(struct udphdr) + ulen;
+   struct inpcbinfo *pcbinfo;
+   struct inpcb *inp;
struct ip6_hdr *ip6;
struct udphdr *udp6;
struct in6_addr *laddr, *faddr, in6a;
-   struct sockaddr_in6 *sin6 = NULL;
-   int cscov_partial = 0;
-   int scope_ambiguous = 0;
-   u_short fport;
-   int error = 0;
-   uint8_t nxt;
-   uint16_t cscov = 0;
struct ip6_pktopts *optp, opt;
-   int af = AF_INET6, hlen = sizeof(struct ip6_hdr);
-   int flags;
-   struct sockaddr_in6 tmp;
+   struct sockaddr_in6 *sin6, tmp;
+   struct epoch_tracker et;
+   int cscov_partial, error, flags, hlen, scope_ambiguous;
+   u_int32_t ulen, plen;
+   uint16_t cscov;
+   u_short fport;
+   uint8_t nxt, unlock_udbinfo;
 
-   INP_WLOCK_ASSERT(inp);
-   INP_HASH_WLOCK_ASSERT(inp->inp_pcbinfo);
+   /* addr6 has been validated in udp6_send(). */
+   sin6 = (struct sockaddr_in6 *)addr6;
 
-   if (addr6) {
-   /* addr6 has been validated in udp6_send(). */
-   sin6 = (struct sockaddr_in6 *)addr6;
+   /*
+* In contrast to to IPv4 we do not validate the max. packet length
+* here due to IPv6 Jumbograms (RFC2675).
+*/
 
-   /* protect *sin6 from overwrites */
+   scope_ambiguous = 0;
+   if (sin6) {
+   /* Protect *addr6 from overwrites. */
tmp = *sin6;
sin6 = &tmp;
 
@@ -721,22 +724,86 @@ udp6_output(struct inpcb *inp, struct mbuf *m, struct 
 */
if (sin6->sin6_scope_id == 0 && !V_ip6_use_defzone)
scope_ambiguous = 1;
-   if ((error = sa6_embedscope(sin6, V_ip6_use_defzone)) != 0)
+   if ((error = sa6_embedscope(sin6, V_ip6_use_defzone)) != 0) {
+   if (control)
+   m_freem(control);
+   m_freem(m);
return (error);
+   }
}
 
+   inp = sotoinpcb(so);
+   KASSERT(inp != NULL, ("%s: inp == NULL", __func__));
+   INP_RLOCK(inp);
nxt = (inp->inp_socket->so_proto->pr_protocol == IPPROTO_UDP) ?
IPPROTO_UDP : IPPROTO_UDPLITE;
+
+#ifdef INET
+   if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0) {
+   int hasv4addr;
+
+   if (sin6 == NULL)
+   hasv4addr = (inp->inp_vflag & INP_IPV4);
+   else
+   hasv4addr = IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)
+   ? 1 : 0;
+   if (hasv4addr) {
+   struct pr_usrreqs *pru;
+
+   /*
+* XXXRW: We release UDP-layer locks before calling
+* udp_send() in order to avoid recursion.  However,
+* this does mean there is a short window where inp's
+* fields are unstable.  Could this lead to a
+* potential race in which the factors causing us to
+* select the UDPv4 output routine are invalidated?
+*/
+   INP_RUNLOCK(inp);
+   if (sin6)
+   in6_sin6_2_sin_in_sock((struct sockad

svn commit: r338254 - head/sys/dev/cxgbe

2018-08-23 Thread Navdeep Parhar
Author: np
Date: Thu Aug 23 16:24:27 2018
New Revision: 338254
URL: https://svnweb.freebsd.org/changeset/base/338254

Log:
  cxgbe(4): Use fcmpset instead of cmpset when appropriate.
  
  Suggested by: mjg@
  MFC after:1 month
  Sponsored by: Chelsio Communications

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

Modified: head/sys/dev/cxgbe/t4_mp_ring.c
==
--- head/sys/dev/cxgbe/t4_mp_ring.c Thu Aug 23 16:10:28 2018
(r338253)
+++ head/sys/dev/cxgbe/t4_mp_ring.c Thu Aug 23 16:24:27 2018
(r338254)
@@ -122,11 +122,12 @@ drain_ring(struct mp_ring *r, union ring_state os, uin
n = r->drain(r, cidx, pidx);
if (n == 0) {
critical_enter();
+   os.state = r->state;
do {
-   os.state = ns.state = r->state;
+   ns.state = os.state;
ns.cidx = cidx;
ns.flags = STALLED;
-   } while (atomic_cmpset_64(&r->state, os.state,
+   } while (atomic_fcmpset_64(&r->state, &os.state,
ns.state) == 0);
critical_exit();
if (prev != STALLED)
@@ -149,11 +150,12 @@ drain_ring(struct mp_ring *r, union ring_state os, uin
if (cidx != pidx && pending < 64 && total < budget)
continue;
critical_enter();
+   os.state = r->state;
do {
-   os.state = ns.state = r->state;
+   ns.state = os.state;
ns.cidx = cidx;
ns.flags = state_to_flags(ns, total >= budget);
-   } while (atomic_cmpset_acq_64(&r->state, os.state, ns.state) == 
0);
+   } while (atomic_fcmpset_acq_64(&r->state, &os.state, ns.state) 
== 0);
critical_exit();
 
if (ns.flags == ABDICATED)
@@ -259,8 +261,8 @@ mp_ring_enqueue(struct mp_ring *r, void **items, int n
 * Reserve room for the new items.  Our reservation, if successful, is
 * from 'pidx_start' to 'pidx_stop'.
 */
+   os.state = r->state;
for (;;) {
-   os.state = r->state;
if (n >= space_available(r, os)) {
counter_u64_add(r->drops, n);
MPASS(os.flags != IDLE);
@@ -271,7 +273,7 @@ mp_ring_enqueue(struct mp_ring *r, void **items, int n
ns.state = os.state;
ns.pidx_head = increment_idx(r, os.pidx_head, n);
critical_enter();
-   if (atomic_cmpset_64(&r->state, os.state, ns.state))
+   if (atomic_fcmpset_64(&r->state, &os.state, ns.state))
break;
critical_exit();
cpu_spinwait();
@@ -301,11 +303,12 @@ mp_ring_enqueue(struct mp_ring *r, void **items, int n
 * Update the ring's pidx_tail.  The release style atomic guarantees
 * that the items are visible to any thread that sees the updated pidx.
 */
+   os.state = r->state;
do {
-   os.state = ns.state = r->state;
+   ns.state = os.state;
ns.pidx_tail = pidx_stop;
ns.flags = BUSY;
-   } while (atomic_cmpset_rel_64(&r->state, os.state, ns.state) == 0);
+   } while (atomic_fcmpset_rel_64(&r->state, &os.state, ns.state) == 0);
critical_exit();
counter_u64_add(r->enqueues, n);
 
___
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: r338255 - head/stand/lua

2018-08-23 Thread Kyle Evans
Author: kevans
Date: Thu Aug 23 16:26:03 2018
New Revision: 338255
URL: https://svnweb.freebsd.org/changeset/base/338255

Log:
  lualoader: Fix (add) Xen support
  
  lualoader was not respecting the 'xen_kernel' environment variable, which
  hints to the interpreter that it should load a Xen kernel prior to loading
  any other kernel that might be specified. If a Xen kernel is specified and
  we fail to load it, we should not proceed to boot.
  
  Reported by:  royger
  Tested by:royger

Modified:
  head/stand/lua/config.lua

Modified: head/stand/lua/config.lua
==
--- head/stand/lua/config.lua   Thu Aug 23 16:24:27 2018(r338254)
+++ head/stand/lua/config.lua   Thu Aug 23 16:26:03 2018(r338255)
@@ -50,6 +50,8 @@ local MSG_FAILEXAF = "Failed to execute '%s' after loa
 local MSG_MALFORMED = "Malformed line (%d):\n\t'%s'"
 local MSG_DEFAULTKERNFAIL = "No kernel set, failed to load from module_path"
 local MSG_KERNFAIL = "Failed to load kernel '%s'"
+local MSG_XENKERNFAIL = "Failed to load Xen kernel '%s'"
+local MSG_XENKERNLOADING = "Loading Xen kernel..."
 local MSG_KERNLOADING = "Loading kernel..."
 local MSG_MODLOADING = "Loading configured modules..."
 local MSG_MODLOADFAIL = "Could not load one or more modules!"
@@ -554,9 +556,17 @@ function config.reload(file)
 end
 
 function config.loadelf()
+   local xen_kernel = loader.getenv('xen_kernel')
local kernel = config.kernel_selected or config.kernel_loaded
local loaded
 
+   if xen_kernel ~= nil then
+   print(MSG_XENKERNLOADING)
+   if cli_execute_unparsed('load ' .. xen_kernel) ~= 0 then
+   print(MSG_XENKERNFAIL:format(xen_kernel))
+   return
+   end
+   end
print(MSG_KERNLOADING)
loaded = config.loadKernel(kernel)
 
___
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: r338253 - head/sbin/pfctl

2018-08-23 Thread Patrick Kelsey
Author: pkelsey
Date: Thu Aug 23 16:10:28 2018
New Revision: 338253
URL: https://svnweb.freebsd.org/changeset/base/338253

Log:
  Extend tbrsize heuristic in pfctl(8) to provide a sensible value for
  higher bandwidth interfaces.  The new value is used above 2.5 Gbps,
  which is the highest standard rate that could be used prior to
  r338209, so the default behavior for all existing systems should
  remain the same.
  
  The value of 128 chosen is a balance between being big enough to
  reduce potential precision/quantization effects stemming from frequent
  bucket refills over small time intervals and being small enough to
  prevent a greedy driver from burst dequeuing more packets than it has
  available hardware ring slots for whenever altq transitions from idle
  to backlogged.
  
  Reviewed by:  jmallett, kp
  MFC after:2 weeks
  Sponsored by: RG Nets
  Differential Revision: https://reviews.freebsd.org/D16852

Modified:
  head/sbin/pfctl/pfctl_altq.c

Modified: head/sbin/pfctl/pfctl_altq.c
==
--- head/sbin/pfctl/pfctl_altq.cThu Aug 23 15:01:27 2018
(r338252)
+++ head/sbin/pfctl/pfctl_altq.cThu Aug 23 16:10:28 2018
(r338253)
@@ -299,8 +299,10 @@ eval_pfaltq(struct pfctl *pf, struct pf_altq *pa, stru
size = 4;
else if (rate <= 200 * 1000 * 1000)
size = 8;
-   else
+   else if (rate <= 2500 * 1000 * 1000)
size = 24;
+   else
+   size = 128;
size = size * getifmtu(pa->ifname);
pa->tbrsize = size;
}
___
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: r338252 - head/sys/sys

2018-08-23 Thread Mark Johnston
Author: markj
Date: Thu Aug 23 15:01:27 2018
New Revision: 338252
URL: https://svnweb.freebsd.org/changeset/base/338252

Log:
  Remove a redundant #ifdef _KERNEL.
  
  Submitted by: Sebastian Huber 
  MFC after:3 days

Modified:
  head/sys/sys/malloc.h

Modified: head/sys/sys/malloc.h
==
--- head/sys/sys/malloc.h   Thu Aug 23 14:58:19 2018(r338251)
+++ head/sys/sys/malloc.h   Thu Aug 23 15:01:27 2018(r338252)
@@ -215,7 +215,6 @@ void*malloc(size_t size, struct malloc_type *type, 
in
  * an inline function variant ended up being compiled to a mere malloc call
  * regardless of argument. gcc generates expected code (like the above).
  */
-#ifdef _KERNEL
 #definemalloc(size, type, flags) ({
\
void *_malloc_item; \
size_t _size = (size);  \
@@ -230,7 +229,6 @@ void*malloc(size_t size, struct malloc_type *type, 
in
}   \
_malloc_item;   \
 })
-#endif
 
 void   *malloc_domain(size_t size, struct malloc_type *type, int domain,
int flags) __malloc_like __result_use_check __alloc_size(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: r338251 - in head: contrib/llvm/tools/lld/ELF usr.bin/clang/lld

2018-08-23 Thread Mark Johnston
Author: markj
Date: Thu Aug 23 14:58:19 2018
New Revision: 338251
URL: https://svnweb.freebsd.org/changeset/base/338251

Log:
  Add an lld option to emit PC-relative relocations for ifunc calls.
  
  The current kernel ifunc implementation creates a PLT entry for each
  ifunc definition.  ifunc calls therefore consist of a call to the
  PLT entry followed by an indirect jump.  The jump target is written
  during boot when the kernel linker resolves R_[*]_IRELATIVE relocations.
  This implementation is defined by requirements for userland code, where
  text relocations are avoided.  This requirement is not present for the
  kernel, so the implementation has avoidable overhead (namely, an extra
  indirect jump per call).
  
  Address this for now by adding a special option to the static linker
  to inhibit PLT creation for ifuncs.  Instead, relocations to ifunc call
  sites are passed through to the output file, so the kernel linker can
  enumerate such call sites and apply PC-relative relocations directly
  to the text section.  Thus the overhead of an ifunc call becomes exactly
  the same as that of an ordinary function call.  This option is only for
  use by the kernel and will not work for regular programs.
  
  The final form of this optimization is up for debate; for now, this
  change is simple and static enough to be acceptable as an interim
  solution.
  
  Reviewed by:  emaste
  Discussed with:   arichardson, dim
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D16748

Modified:
  head/contrib/llvm/tools/lld/ELF/Config.h
  head/contrib/llvm/tools/lld/ELF/Driver.cpp
  head/contrib/llvm/tools/lld/ELF/Relocations.cpp
  head/contrib/llvm/tools/lld/ELF/Writer.cpp
  head/usr.bin/clang/lld/ld.lld.1

Modified: head/contrib/llvm/tools/lld/ELF/Config.h
==
--- head/contrib/llvm/tools/lld/ELF/Config.hThu Aug 23 13:38:38 2018
(r338250)
+++ head/contrib/llvm/tools/lld/ELF/Config.hThu Aug 23 14:58:19 2018
(r338251)
@@ -155,6 +155,7 @@ struct Configuration {
   bool ZCombreloc;
   bool ZExecstack;
   bool ZHazardplt;
+  bool ZIfuncnoplt;
   bool ZNocopyreloc;
   bool ZNodelete;
   bool ZNodlopen;

Modified: head/contrib/llvm/tools/lld/ELF/Driver.cpp
==
--- head/contrib/llvm/tools/lld/ELF/Driver.cpp  Thu Aug 23 13:38:38 2018
(r338250)
+++ head/contrib/llvm/tools/lld/ELF/Driver.cpp  Thu Aug 23 14:58:19 2018
(r338251)
@@ -669,6 +669,7 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args
   Config->ZCombreloc = !hasZOption(Args, "nocombreloc");
   Config->ZExecstack = hasZOption(Args, "execstack");
   Config->ZHazardplt = hasZOption(Args, "hazardplt");
+  Config->ZIfuncnoplt = hasZOption(Args, "ifunc-noplt");
   Config->ZNocopyreloc = hasZOption(Args, "nocopyreloc");
   Config->ZNodelete = hasZOption(Args, "nodelete");
   Config->ZNodlopen = hasZOption(Args, "nodlopen");

Modified: head/contrib/llvm/tools/lld/ELF/Relocations.cpp
==
--- head/contrib/llvm/tools/lld/ELF/Relocations.cpp Thu Aug 23 13:38:38 
2018(r338250)
+++ head/contrib/llvm/tools/lld/ELF/Relocations.cpp Thu Aug 23 14:58:19 
2018(r338251)
@@ -374,6 +374,9 @@ static bool isStaticLinkTimeConstant(RelExpr E, RelTyp
  R_PPC_PLT_OPD, R_TLSDESC_CALL, R_TLSDESC_PAGE, R_HINT>(E))
 return true;
 
+  if (Sym.isGnuIFunc() && Config->ZIfuncnoplt)
+return false;
+
   // These never do, except if the entire file is position dependent or if
   // only the low bits are used.
   if (E == R_GOT || E == R_PLT || E == R_TLSDESC)
@@ -921,7 +924,9 @@ static void scanRelocs(InputSectionBase &Sec, ArrayRef
 // Strenghten or relax a PLT access.
 //
 // GNU ifunc symbols must be accessed via PLT because their addresses
-// are determined by runtime.
+// are determined by runtime. If the -z ifunc-noplt option is specified,
+// we permit the optimization of ifunc calls by omitting the PLT entry
+// and preserving relocations at ifunc call sites.
 //
 // On the other hand, if we know that a PLT entry will be resolved within
 // the same ELF module, we can skip PLT access and directly jump to the
@@ -929,7 +934,7 @@ static void scanRelocs(InputSectionBase &Sec, ArrayRef
 // all dynamic symbols that can be resolved within the executable will
 // actually be resolved that way at runtime, because the main exectuable
 // is always at the beginning of a search list. We can leverage that fact.
-if (Sym.isGnuIFunc())
+if (Sym.isGnuIFunc() && !Config->ZIfuncnoplt)
   Expr = toPlt(Expr);
 else if (!Preemptible && Expr == R_GOT_PC && !isAbsoluteValue(Sym))
   Expr =
@@ -1031,6 +1036,16 @@ static void scanRelocs(InputSectionBase

svn commit: r338248 - head/sys/modules/dtb/allwinner

2018-08-23 Thread Emmanuel Vadot
Author: manu
Date: Thu Aug 23 13:24:28 2018
New Revision: 338248
URL: https://svnweb.freebsd.org/changeset/base/338248

Log:
  dtb: Allwinner: Add aarch64 dts files

Modified:
  head/sys/modules/dtb/allwinner/Makefile

Modified: head/sys/modules/dtb/allwinner/Makefile
==
--- head/sys/modules/dtb/allwinner/Makefile Thu Aug 23 13:23:54 2018
(r338247)
+++ head/sys/modules/dtb/allwinner/Makefile Thu Aug 23 13:24:28 2018
(r338248)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 # All the dts files for allwinner systems we support.
+
+.if ${MACHINE_ARCH} == "armv7"
 DTS=   \
sun4i-a10-cubieboard.dts \
sun4i-a10-olinuxino-lime.dts \
@@ -33,5 +35,14 @@ LINKS= \
${DTBDIR}/sun7i-a20-pcduino3.dtb ${DTBDIR}/pcduino3.dtb \
${DTBDIR}/sun8i-a83t-bananapi-m3.dtb ${DTBDIR}/sinovoip-bpi-m3.dtb \
${DTBDIR}/sun8i-a83t-bananapi-m3.dtb 
${DTBDIR}/sun8i-a83t-sinovoip-bpi-m3.dtb
+.elif ${MACHINE_ARCH} == "aarch64"
+DTS=   \
+   allwinner/sun50i-a64-nanopi-a64.dts \
+   allwinner/sun50i-a64-olinuxino.dts \
+   allwinner/sun50i-a64-pine64-plus.dts \
+   allwinner/sun50i-a64-pine64.dts \
+   allwinner/sun50i-a64-sopine-baseboard.dts \
+   allwinner/sun50i-h5-orangepi-pc2.dts
+.endif
 
 .include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r338246 - head/sys/tools/fdt

2018-08-23 Thread Emmanuel Vadot
Author: manu
Date: Thu Aug 23 13:23:21 2018
New Revision: 338246
URL: https://svnweb.freebsd.org/changeset/base/338246

Log:
  make_dtb: Always add root directory in the include path
  
  Some arch like arm and arm64 share DTS files, add the root dts directory
  to the include paths.

Modified:
  head/sys/tools/fdt/make_dtb.sh

Modified: head/sys/tools/fdt/make_dtb.sh
==
--- head/sys/tools/fdt/make_dtb.sh  Thu Aug 23 13:21:01 2018
(r338245)
+++ head/sys/tools/fdt/make_dtb.sh  Thu Aug 23 13:23:21 2018
(r338246)
@@ -21,6 +21,6 @@ fi
 for d in ${dts}; do
 dtb=${dtb_path}/`basename $d .dts`.dtb
 echo "converting $d -> $dtb"
-cpp -P -x assembler-with-cpp -I $S/gnu/dts/include -I $S/dts/${MACHINE} -I 
$S/gnu/dts/${MACHINE} -include $d /dev/null | 
-   ${DTC} -@ -O dtb -o $dtb -b 0 -p 1024 -i $S/dts/${MACHINE} -i 
$S/gnu/dts/${MACHINE}
+cpp -P -x assembler-with-cpp -I $S/gnu/dts/include -I $S/dts/${MACHINE} -I 
$S/gnu/dts/${MACHINE} -I $S/gnu/dts/ -include $d /dev/null | 
+   ${DTC} -@ -O dtb -o $dtb -b 0 -p 1024 -i $S/dts/${MACHINE} -i 
$S/gnu/dts/${MACHINE} -i $S/gnu/dts/
 done
___
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: r338249 - head/sys/arm64/conf

2018-08-23 Thread Emmanuel Vadot
Author: manu
Date: Thu Aug 23 13:25:32 2018
New Revision: 338249
URL: https://svnweb.freebsd.org/changeset/base/338249

Log:
  arm64: GENERIC: Compile allwinner dtbs

Modified:
  head/sys/arm64/conf/GENERIC

Modified: head/sys/arm64/conf/GENERIC
==
--- head/sys/arm64/conf/GENERIC Thu Aug 23 13:24:28 2018(r338248)
+++ head/sys/arm64/conf/GENERIC Thu Aug 23 13:25:32 2018(r338249)
@@ -269,3 +269,6 @@ options THUNDERX_PASS_1_1_ERRATA
 
 optionsFDT
 device acpi
+
+# DTBs
+makeoptionsMODULES_EXTRA="dtb/allwinner"
___
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: r338247 - head/sys/conf

2018-08-23 Thread Emmanuel Vadot
Author: manu
Date: Thu Aug 23 13:23:54 2018
New Revision: 338247
URL: https://svnweb.freebsd.org/changeset/base/338247

Log:
  dtb: aarch64 uses vendor subdirectories, handle that

Modified:
  head/sys/conf/dtb.mk

Modified: head/sys/conf/dtb.mk
==
--- head/sys/conf/dtb.mkThu Aug 23 13:23:21 2018(r338246)
+++ head/sys/conf/dtb.mkThu Aug 23 13:23:54 2018(r338247)
@@ -84,8 +84,14 @@ _dtbinstall:
 # entries in the NO_ROOT case.
test -d ${DESTDIR}${DTBDIR} || ${INSTALL} -d -o ${DTBOWN} -g ${DTBGRP} 
${DESTDIR}${DTBDIR}
 .for _dtb in ${DTB}
+.if ${MACHINE_CPUARCH} == "aarch64"
+   test -d ${DESTDIR}${DTBDIR}/${_dtb:H} || ${INSTALL} -d -o ${DTBOWN} -g 
${DTBGRP} ${DESTDIR}${DTBDIR}/${_dtb:H}
${INSTALL} -o ${DTBOWN} -g ${DTBGRP} -m ${DTBMODE} \
+   ${_INSTALLFLAGS} ${_dtb:T} ${DESTDIR}${DTBDIR}/${_dtb:H}
+.else
+   ${INSTALL} -o ${DTBOWN} -g ${DTBGRP} -m ${DTBMODE} \
${_INSTALLFLAGS} ${_dtb} ${DESTDIR}${DTBDIR}/
+.endif
 .endfor
test -d ${DESTDIR}${DTBODIR} || ${INSTALL} -d -o ${DTBOWN} -g ${DTBGRP} 
${DESTDIR}${DTBODIR}
 .for _dtbo in ${DTBO}
___
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: r338250 - head/stand/efi/loader

2018-08-23 Thread Kyle Evans
Author: kevans
Date: Thu Aug 23 13:38:38 2018
New Revision: 338250
URL: https://svnweb.freebsd.org/changeset/base/338250

Log:
  efiloader: Setup FDT in autoload to fix overlays clobbering kenv
  
  manu found in the noted PR that overlays seemed to be clobbering the kenv
  and killing the boot. Further inspection revealed that one can `fdt ls` at
  the loader prompt for a successful boot, but autoboot breaks it.
  
  In the autoboot case, first setup of FDT is happening in the middle of
  bi_load, which triggers loading of the DTBO from /boot.
  
  This is bad, bad, bad. Files in the loader are loaded somewhere in the
  middle of the address space one after another. bi_load starts building the
  needed kernel bootinfo immediately after the highest-addr loaded file. File
  loads in the middle of bi_load suddenly clobber bootinfo and everything goes
  off the rails.
  
  The solution to this is to use take advantage of arch_autoload to setup FDT
  in efiloader compiled with LOADER_FDT_SUPPORT. This matches how it works in
  ubldr land, and is how it should have worked when overlay support was added
  to efiloader since fdt_setup_fdtp now has the potential to load files
  (courtesy of fdt_platform_load_dtb).
  
  PR:   230804
  Discussed with:   imp
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D16858

Modified:
  head/stand/efi/loader/autoload.c

Modified: head/stand/efi/loader/autoload.c
==
--- head/stand/efi/loader/autoload.cThu Aug 23 13:25:32 2018
(r338249)
+++ head/stand/efi/loader/autoload.cThu Aug 23 13:38:38 2018
(r338250)
@@ -27,11 +27,30 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#if defined(LOADER_FDT_SUPPORT)
+#include 
+#include 
+#endif
+
 #include "loader_efi.h"
 
 int
 efi_autoload(void)
 {
 
+#if defined(LOADER_FDT_SUPPORT)
+   /*
+* Setup the FDT early so that we're not loading files during bi_load.
+* Any such loading is inherently broken since bi_load uses the space
+* just after all currently loaded files for the data that will be
+* passed to the kernel and newly loaded files will be positioned in
+* that same space.
+*
+* We're glossing over errors here because LOADER_FDT_SUPPORT does not
+* imply that we're on a platform where FDT is a requirement.  If we
+* fix this, then the error handling here should be fixed accordingly.
+*/
+   fdt_setup_fdtp();
+#endif
return (0);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r338244 - stable/11/sbin/ipfw

2018-08-23 Thread Andrey V. Elsukov
Author: ae
Date: Thu Aug 23 13:07:22 2018
New Revision: 338244
URL: https://svnweb.freebsd.org/changeset/base/338244

Log:
  MFC r337536:
If -q flag is specified, do not complain when we are trying to delete
nonexistent NAT instance or nonexistent rule.
  
This allows execute batched `delete` commands and do not fail when
found nonexistent rule.
  
  MFC r337574:
Restore the behaviour changed in r337536, when bad `ipfw delete` command
returns error.
  
Now -q option only makes it quiet. And when -f flag is specified, the
command will ignore errors and continue executing with next batched
command.
  
  Obtained from:Yandex LLC
  Sponsored by: Yandex LLC

Modified:
  stable/11/sbin/ipfw/ipfw.8
  stable/11/sbin/ipfw/ipfw2.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/ipfw/ipfw.8
==
--- stable/11/sbin/ipfw/ipfw.8  Thu Aug 23 10:38:59 2018(r338243)
+++ stable/11/sbin/ipfw/ipfw.8  Thu Aug 23 13:07:22 2018(r338244)
@@ -1,7 +1,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 9, 2018
+.Dd August 10, 2018
 .Dt IPFW 8
 .Os
 .Sh NAME
@@ -315,10 +315,15 @@ When listing and
 .Fl d
 is specified, also show expired dynamic rules.
 .It Fl f
-Do not ask for confirmation for commands that can cause problems
-if misused, i.e.,
+Run without prompting for confirmation for commands that can cause problems if 
misused,
+i.e.,
 .Cm flush .
 If there is no tty associated with the process, this is implied.
+The
+.Cm delete
+command with this flag ignores possible errors,
+i.e., nonexistent rule number.
+And for batched commands execution continues with the next command.
 .It Fl i
 When listing a table (see the
 .Sx LOOKUP TABLES

Modified: stable/11/sbin/ipfw/ipfw2.c
==
--- stable/11/sbin/ipfw/ipfw2.c Thu Aug 23 10:38:59 2018(r338243)
+++ stable/11/sbin/ipfw/ipfw2.c Thu Aug 23 13:07:22 2018(r338244)
@@ -3271,9 +3271,11 @@ ipfw_delete(char *av[])
exitval = do_cmd(IP_FW_NAT_DEL, &i, sizeof i);
if (exitval) {
exitval = EX_UNAVAILABLE;
-   warn("rule %u not available", i);
+   if (co.do_quiet)
+   continue;
+   warn("nat %u not available", i);
}
-   } else if (co.do_pipe) {
+   } else if (co.do_pipe) {
exitval = ipfw_delete_pipe(co.do_pipe, i);
} else {
memset(&rt, 0, sizeof(rt));
@@ -3295,10 +3297,14 @@ ipfw_delete(char *av[])
i = do_range_cmd(IP_FW_XDEL, &rt);
if (i != 0) {
exitval = EX_UNAVAILABLE;
+   if (co.do_quiet)
+   continue;
warn("rule %u: setsockopt(IP_FW_XDEL)",
rt.start_rule);
} else if (rt.new_set == 0 && do_set == 0) {
exitval = EX_UNAVAILABLE;
+   if (co.do_quiet)
+   continue;
if (rt.start_rule != rt.end_rule)
warnx("no rules rules in %u-%u range",
rt.start_rule, rt.end_rule);
@@ -3308,7 +3314,7 @@ ipfw_delete(char *av[])
}
}
}
-   if (exitval != EX_OK)
+   if (exitval != EX_OK && co.do_force == 0)
exit(exitval);
 }
 
___
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: r338245 - in head/sys/gnu/dts/arm64: actions al allwinner altera amd amlogic apm arm broadcom broadcom/northstar2 broadcom/stingray cavium exynos freescale hisilicon lg marvell mediatek...

2018-08-23 Thread Emmanuel Vadot
Author: manu
Date: Thu Aug 23 13:21:01 2018
New Revision: 338245
URL: https://svnweb.freebsd.org/changeset/base/338245

Log:
  dts: Import DTS for arm64
  
   - Most of the boards are using U-Boot, u-boot embed a DTB that isn't
  compiled with -@ (overlay ready) so we cannot use overlays. We want
  overlays, overlays are nice.
   - The DTS life is going to linux, then sometimes it's imported in
  U-Boot but it depend on the SoC family, U-Boot doesn't batch import
  every DTS like we do. So sometimes to U-Boot DTS are very old. Or when
  an interesting patch in commited upstream it is in Linux X+2 (roughly 4
  months from now), we then have to wait for U-Boot to catch up, that
  give us between 4 and 6 months to have an update.
   - Some boards like the Marvell ones have 3 DTS, the one in the
  vendor U-Boot made by Marvell themselves, the one in u-boot mainline
  and the one in Linux. I found that the DTS in the Marvell U-Boot have
  some problem with FreeBSD (especially the macchiatobin that declare
  node with the same address but not the same size, that is not something
  that the rman code can handle, it could be modified, I don't know the
  code well enough). Also some compatible are used when they shouldn't,
  for example they declare the gpio being orion-gpio while this binding
  requires interrupts supports, which the node doesn't have.
   - The above situation is mostly the same with RockChip SoCs (possibly
  others, those are the only SoCs I work on that have this problem).
  
   Note that importing the DTS doesn't mean that every board will use
  them, I don't intend to copy the DTB to the GENERIC memstick image for
  the Overdrive 1000/3000 for example, the ones provided by the firmware
  works fine.
   RPI3 will still stay an exception as we use the DTB provided by the
  rpi-firmware package, so they come from the rpi foundation linux fork.

Added:
  head/sys/gnu/dts/arm64/actions/
  head/sys/gnu/dts/arm64/actions/s700-cubieboard7.dts   (contents, props 
changed)
  head/sys/gnu/dts/arm64/actions/s700.dtsi   (contents, props changed)
  head/sys/gnu/dts/arm64/actions/s900-bubblegum-96.dts   (contents, props 
changed)
  head/sys/gnu/dts/arm64/actions/s900.dtsi   (contents, props changed)
  head/sys/gnu/dts/arm64/al/
  head/sys/gnu/dts/arm64/al/alpine-v2-evp.dts   (contents, props changed)
  head/sys/gnu/dts/arm64/al/alpine-v2.dtsi   (contents, props changed)
  head/sys/gnu/dts/arm64/allwinner/
  head/sys/gnu/dts/arm64/allwinner/axp803.dtsi   (contents, props changed)
  head/sys/gnu/dts/arm64/allwinner/sun50i-a64-bananapi-m64.dts   (contents, 
props changed)
  head/sys/gnu/dts/arm64/allwinner/sun50i-a64-nanopi-a64.dts   (contents, props 
changed)
  head/sys/gnu/dts/arm64/allwinner/sun50i-a64-olinuxino.dts   (contents, props 
changed)
  head/sys/gnu/dts/arm64/allwinner/sun50i-a64-orangepi-win.dts   (contents, 
props changed)
  head/sys/gnu/dts/arm64/allwinner/sun50i-a64-pine64-plus.dts   (contents, 
props changed)
  head/sys/gnu/dts/arm64/allwinner/sun50i-a64-pine64.dts   (contents, props 
changed)
  head/sys/gnu/dts/arm64/allwinner/sun50i-a64-sopine-baseboard.dts   (contents, 
props changed)
  head/sys/gnu/dts/arm64/allwinner/sun50i-a64-sopine.dtsi   (contents, props 
changed)
  head/sys/gnu/dts/arm64/allwinner/sun50i-a64-teres-i.dts   (contents, props 
changed)
  head/sys/gnu/dts/arm64/allwinner/sun50i-a64.dtsi   (contents, props changed)
 - copied unchanged from r337701, 
vendor/device-tree/dist/src/arm64/allwinner/sun50i-h5-libretech-all-h3-cc.dts
  head/sys/gnu/dts/arm64/allwinner/sun50i-h5-nanopi-neo-plus2.dts   (contents, 
props changed)
  head/sys/gnu/dts/arm64/allwinner/sun50i-h5-nanopi-neo2.dts   (contents, props 
changed)
  head/sys/gnu/dts/arm64/allwinner/sun50i-h5-orangepi-pc2.dts   (contents, 
props changed)
  head/sys/gnu/dts/arm64/allwinner/sun50i-h5-orangepi-prime.dts   (contents, 
props changed)
  head/sys/gnu/dts/arm64/allwinner/sun50i-h5-orangepi-zero-plus.dts   
(contents, props changed)
  head/sys/gnu/dts/arm64/allwinner/sun50i-h5-orangepi-zero-plus2.dts   
(contents, props changed)
  head/sys/gnu/dts/arm64/allwinner/sun50i-h5.dtsi   (contents, props changed)
  head/sys/gnu/dts/arm64/allwinner/sun50i-h6-pine-h64.dts   (contents, props 
changed)
  head/sys/gnu/dts/arm64/allwinner/sun50i-h6.dtsi   (contents, props changed)
  head/sys/gnu/dts/arm64/altera/
  head/sys/gnu/dts/arm64/altera/socfpga_stratix10.dtsi   (contents, props 
changed)
  head/sys/gnu/dts/arm64/altera/socfpga_stratix10_socdk.dts   (contents, props 
changed)
  head/sys/gnu/dts/arm64/amd/
  head/sys/gnu/dts/arm64/amd/amd-overdrive-rev-b0.dts   (contents, props 
changed)
  head/sys/gnu/dts/arm64/amd/amd-overdrive-rev-b1.dts   (contents, props 
changed)
  head/sys/gnu/dts/arm64/amd/amd-overdrive.dts   (contents, props changed)
  head/sys/gnu/dts/arm64/amd/amd-seattle-clks.dtsi   (contents, props changed)
  head/sys/gnu/dts/arm64/amd/amd-seattle-soc.dtsi   (contents, props changed)
  head/sys/gnu/dts/arm64/amd/a

svn commit: r338243 - head/usr.sbin/ndp

2018-08-23 Thread Renato Botelho
Author: garga (ports committer)
Date: Thu Aug 23 10:38:59 2018
New Revision: 338243
URL: https://svnweb.freebsd.org/changeset/base/338243

Log:
  usr.sbin/ndp: Cleanup in preparation to add libxo support
  
  * Constify rtpref_str declaration
  * Remove unused h_errno declaration
  * Use time_t type for expire
  * Use strlcpy to set static "?" value to ifname
  * Rename local variable 's' to stop shadowing global definition
  * Close socket used in pfx_flush()
  * Use local variables for sock() in setdefif() and getdefif()
  * Increase WARNS to 3
  
  Reviewed by:  allanjude, kevans
  Approved by:  allanjude
  Sponsored by: Rubicon Communications, LLC (Netgate)
  Differential Revision:https://reviews.freebsd.org/D8

Modified:
  head/usr.sbin/ndp/Makefile
  head/usr.sbin/ndp/ndp.c

Modified: head/usr.sbin/ndp/Makefile
==
--- head/usr.sbin/ndp/Makefile  Thu Aug 23 07:34:51 2018(r338242)
+++ head/usr.sbin/ndp/Makefile  Thu Aug 23 10:38:59 2018(r338243)
@@ -22,6 +22,6 @@ SRCS= ndp.c gmt2local.c
 CFLAGS+= -I. -I${.CURDIR} -I${SRCTOP}/contrib/tcpdump
 CFLAGS+= -D_U_=""
 
-WARNS?=1
+WARNS?=3
 
 .include 

Modified: head/usr.sbin/ndp/ndp.c
==
--- head/usr.sbin/ndp/ndp.c Thu Aug 23 07:34:51 2018(r338242)
+++ head/usr.sbin/ndp/ndp.c Thu Aug 23 10:38:59 2018(r338243)
@@ -151,7 +151,7 @@ static void setdefif(char *);
 static char *sec2str(time_t);
 static void ts_print(const struct timeval *);
 
-static char *rtpref_str[] = {
+static const char *rtpref_str[] = {
"medium",   /* 00 */
"high", /* 01 */
"rsv",  /* 10 */
@@ -565,9 +565,8 @@ dump(struct sockaddr_in6 *addr, int cflag)
struct rt_msghdr *rtm;
struct sockaddr_in6 *sin;
struct sockaddr_dl *sdl;
-   extern int h_errno;
struct timeval now;
-   u_long expire;
+   time_t expire;
int addrwidth;
int llwidth;
int ifwidth;
@@ -670,8 +669,10 @@ again:;
if (W_ADDR + W_LL - addrwidth > llwidth)
llwidth = W_ADDR + W_LL - addrwidth;
ifname = if_indextoname(sdl->sdl_index, ifix_buf);
-   if (!ifname)
-   ifname = "?";
+   if (ifname == NULL) {
+   strlcpy(ifix_buf, "?", sizeof(ifix_buf));
+   ifname = ifix_buf;
+   }
ifwidth = strlen(ifname);
if (W_ADDR + W_LL + W_IF - addrwidth - llwidth > ifwidth)
ifwidth = W_ADDR + W_LL + W_IF - addrwidth - llwidth;
@@ -764,22 +765,22 @@ static struct in6_nbrinfo *
 getnbrinfo(struct in6_addr *addr, int ifindex, int warning)
 {
static struct in6_nbrinfo nbi;
-   int s;
+   int sock;
 
-   if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0)
+   if ((sock = socket(AF_INET6, SOCK_DGRAM, 0)) < 0)
err(1, "socket");
 
bzero(&nbi, sizeof(nbi));
if_indextoname(ifindex, nbi.ifname);
nbi.addr = *addr;
-   if (ioctl(s, SIOCGNBRINFO_IN6, (caddr_t)&nbi) < 0) {
+   if (ioctl(sock, SIOCGNBRINFO_IN6, (caddr_t)&nbi) < 0) {
if (warning)
warn("ioctl(SIOCGNBRINFO_IN6)");
-   close(s);
+   close(sock);
return(NULL);
}
 
-   close(s);
+   close(sock);
return(&nbi);
 }
 
@@ -902,19 +903,19 @@ static void
 ifinfo(char *ifname, int argc, char **argv)
 {
struct in6_ndireq nd;
-   int i, s;
+   int i, sock;
u_int32_t newflags;
 #ifdef IPV6CTL_USETEMPADDR
u_int8_t nullbuf[8];
 #endif
 
-   if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
+   if ((sock = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
err(1, "socket");
/* NOTREACHED */
}
bzero(&nd, sizeof(nd));
strlcpy(nd.ifname, ifname, sizeof(nd.ifname));
-   if (ioctl(s, SIOCGIFINFO_IN6, (caddr_t)&nd) < 0) {
+   if (ioctl(sock, SIOCGIFINFO_IN6, (caddr_t)&nd) < 0) {
err(1, "ioctl(SIOCGIFINFO_IN6)");
/* NOTREACHED */
}
@@ -973,7 +974,7 @@ ifinfo(char *ifname, int argc, char **argv)
SETVALUE("curhlim", ND.chlim);
 
ND.flags = newflags;
-   if (ioctl(s, SIOCSIFINFO_IN6, (caddr_t)&nd) < 0) {
+   if (ioctl(sock, SIOCSIFINFO_IN6, (caddr_t)&nd) < 0) {
err(1, "ioctl(SIOCSIFINFO_IN6)");
/* NOTREACHED */
}
@@ -986,7 +987,7 @@ ifinfo(char *ifname, int argc, char **argv)
/* NOTREACHED */
}
 
-   if (ioctl(s, SIOCGIFINFO_IN6, (caddr_t)&nd) < 0) {
+   if (ioctl(sock, SIOCGIFINFO_IN6, (caddr_t)&nd) < 0) {
err(1,

Re: svn commit: r338239 - head

2018-08-23 Thread Gary Jennejohn
On Thu, 23 Aug 2018 05:06:32 + (UTC)
Warner Losh  wrote:

> Author: imp
> Date: Thu Aug 23 05:06:31 2018
> New Revision: 338239
> URL: https://svnweb.freebsd.org/changeset/base/338239
> 
> Log:
>   Add a special note to UPDATING for the devmatch stuff. While tested,
>   there's an elevated risk of trouble, and you must update kernel,
>   userland and rc scripts for the best experience.
> 
> Modified:
>   head/UPDATING
> 
> Modified: head/UPDATING
> ==
> --- head/UPDATING Thu Aug 23 05:06:27 2018(r338238)
> +++ head/UPDATING Thu Aug 23 05:06:31 2018(r338239)
> @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
>   disable the most expensive debugging functionality run
>   "ln -s 'abort:false,junk:false' /etc/malloc.conf".)
>  
> +20170822:
> + devctl freeze/that have gone into the tree, the rc scripts have been
  ===> typo, should be thaw
> + updated to use them and devmatch has been changed.  You should update
> + kernel, userland and rc scripts all at the same time.
> +
>  20180821:
>   drm and drm2 have been removed. Users on powerpc, 32-bit hardware,
>   or with GPUs predating Radeon and i915 will need to install the
>


-- 
Gary Jennejohn
___
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: r338242 - head/usr.sbin/bhyve

2018-08-23 Thread Marcelo Araujo
Author: araujo
Date: Thu Aug 23 07:34:51 2018
New Revision: 338242
URL: https://svnweb.freebsd.org/changeset/base/338242

Log:
  Add manpage entry for the new bhyve options -s "help" and -l "help".
  
  Reported by:  0mp
  Sponsored by: iXsystems Inc.

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

Modified: head/usr.sbin/bhyve/bhyve.8
==
--- head/usr.sbin/bhyve/bhyve.8 Thu Aug 23 06:03:59 2018(r338241)
+++ head/usr.sbin/bhyve/bhyve.8 Thu Aug 23 07:34:51 2018(r338242)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd Jul 11, 2018
+.Dd Aug 23, 2018
 .Dt BHYVE 8
 .Os
 .Sh NAME
@@ -44,10 +44,10 @@
 .Op Ar ,threads=n
 .Oc
 .Op Fl g Ar gdbport
-.Op Fl l Ar lpcdev Ns Op , Ns Ar conf
+.Op Fl l Ar help|lpcdev Ns Op , Ns Ar conf
 .Op Fl m Ar memsize Ns Op Ar K|k|M|m|G|g|T|t
 .Op Fl p Ar vcpu:hostcpu
-.Op Fl s Ar slot,emulation Ns Op , Ns Ar conf
+.Op Fl s Ar help|slot,emulation Ns Op , Ns Ar conf
 .Op Fl G Ar port
 .Op Fl U Ar uuid
 .Ar vmname
@@ -144,7 +144,7 @@ Print help message and exit.
 .It Fl H
 Yield the virtual CPU thread when a HLT instruction is detected.
 If this option is not specified, virtual CPUs will use 100% of a host CPU.
-.It Fl l Ar lpcdev Ns Op , Ns Ar conf
+.It Fl l Op Ar help|lpcdev Ns Op , Ns Ar conf
 Allow devices behind the LPC PCI-ISA bridge to be configured.
 The only supported devices are the TTY-class devices
 .Ar com1
@@ -152,6 +152,9 @@ and
 .Ar com2
 and the boot ROM device
 .Ar bootrom .
+.Pp
+.Ar help
+print a list of supported LPC devices.
 .It Fl m Ar memsize Ns Op Ar K|k|M|m|G|g|T|t
 Guest physical memory size in bytes.
 This must be the same size that was given to
@@ -171,7 +174,7 @@ to
 .Em hostcpu .
 .It Fl P
 Force the guest virtual CPU to exit when a PAUSE instruction is detected.
-.It Fl s Ar slot,emulation Ns Op , Ns Ar conf
+.It Fl s Op Ar help|slot,emulation Ns Op , Ns Ar conf
 Configure a virtual PCI slot and function.
 .Pp
 .Nm
@@ -180,6 +183,8 @@ slots on the bus.
 There are 32 available slots, with the option of providing up to 8 functions
 per slot.
 .Bl -tag -width 10n
+.It Ar help
+print a list of supported PCI devices.
 .It Ar slot
 .Ar pcislot[:function]
 .Ar bus:pcislot:function
___
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: r338214 - in head/sys: conf kern sys

2018-08-23 Thread Andriy Gapon
On 23/08/2018 01:19, Conrad Meyer wrote:
> Author: cem
> Date: Wed Aug 22 22:19:42 2018
> New Revision: 338214
> URL: https://svnweb.freebsd.org/changeset/base/338214
> 
> Log:
>   KASSERT: Make runtime optionality optional

Thank you!

>   Add an option, KASSERT_PANIC_OPTIONAL, that allows runtime KASSERT()
>   behavior changes.  When this option is not enabled, code that allows
>   KASSERTs to become optional is not enabled, and all violated assertions
>   cause termination.
>   
>   The runtime KASSERT behavior was added in r243980.
>   
>   One important distinction here is that panic has __dead2
>   ("attribute((noreturn))"), while kassert_panic does not.  Static analyzers
>   like Coverity understand __dead2.  Without it, KASSERTs go misunderstood,
>   resulting in many false positives that result from violation of program
>   invariants.
>   
>   Reviewed by:jhb, jtl, np, vangyzen
>   Relnotes:   yes
>   Sponsored by:   Dell EMC Isilon
>   Differential Revision:  https://reviews.freebsd.org/D16835


-- 
Andriy Gapon
___
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"