svn commit: r322392 - in head/sys/compat/linuxkpi/common: include/linux src

2017-08-10 Thread Mark Johnston
Author: markj
Date: Fri Aug 11 03:59:48 2017
New Revision: 322392
URL: https://svnweb.freebsd.org/changeset/base/322392

Log:
  Add a specialized function for DRM drivers to register themselves.
  
  Such drivers attach to a vgapci bus rather than directly to a pci bus. For
  the rest of the LinuxKPI to work correctly in this case, we override the
  vgapci bus' ivars with those of the grandparent.
  
  Reviewed by:  hselasky
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D11932

Modified:
  head/sys/compat/linuxkpi/common/include/linux/pci.h
  head/sys/compat/linuxkpi/common/src/linux_pci.c

Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h
==
--- head/sys/compat/linuxkpi/common/include/linux/pci.h Fri Aug 11 03:09:11 
2017(r322391)
+++ head/sys/compat/linuxkpi/common/include/linux/pci.h Fri Aug 11 03:59:48 
2017(r322392)
@@ -187,8 +187,14 @@ struct pci_driver {
devclass_t  bsdclass;
struct device_driverdriver;
const struct pci_error_handlers   *err_handler;
+   boolisdrm;
 };
 
+struct pci_bus {
+   struct pci_dev  *self;
+   int number;
+};
+
 extern struct list_head pci_drivers;
 extern struct list_head pci_devices;
 extern spinlock_t pci_lock;
@@ -199,6 +205,7 @@ struct pci_dev {
struct device   dev;
struct list_headlinks;
struct pci_driver   *pdrv;
+   struct pci_bus  *bus;
uint64_tdma_mask;
uint16_tdevice;
uint16_tvendor;
@@ -502,8 +509,12 @@ pci_write_config_dword(struct pci_dev *pdev, int where
return (0);
 }
 
-extern int pci_register_driver(struct pci_driver *pdrv);
-extern void pci_unregister_driver(struct pci_driver *pdrv);
+intlinux_pci_register_driver(struct pci_driver *pdrv);
+intlinux_pci_register_drm_driver(struct pci_driver *pdrv);
+void   linux_pci_unregister_driver(struct pci_driver *pdrv);
+
+#definepci_register_driver(pdrv)   linux_pci_register_driver(pdrv)
+#definepci_unregister_driver(pdrv) 
linux_pci_unregister_driver(pdrv)
 
 struct msix_entry {
int entry;

Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c
==
--- head/sys/compat/linuxkpi/common/src/linux_pci.c Fri Aug 11 03:09:11 
2017(r322391)
+++ head/sys/compat/linuxkpi/common/src/linux_pci.c Fri Aug 11 03:59:48 
2017(r322392)
@@ -118,17 +118,29 @@ static int
 linux_pci_attach(device_t dev)
 {
struct resource_list_entry *rle;
+   struct pci_bus *pbus;
struct pci_dev *pdev;
struct pci_devinfo *dinfo;
struct pci_driver *pdrv;
const struct pci_device_id *id;
+   device_t parent;
+   devclass_t devclass;
int error;
 
-   dinfo = device_get_ivars(dev);
-
linux_set_current(curthread);
+
pdrv = linux_pci_find(dev, );
pdev = device_get_softc(dev);
+
+   parent = device_get_parent(dev);
+   devclass = device_get_devclass(parent);
+   if (pdrv->isdrm) {
+   dinfo = device_get_ivars(parent);
+   device_set_ivars(dev, dinfo);
+   } else {
+   dinfo = device_get_ivars(dev);
+   }
+
pdev->dev.parent = _root_device;
pdev->dev.bsddev = dev;
INIT_LIST_HEAD(>dev.irqents);
@@ -151,6 +163,13 @@ linux_pci_attach(device_t dev)
else
pdev->dev.irq = LINUX_IRQ_INVALID;
pdev->irq = pdev->dev.irq;
+
+   if (pdev->bus == NULL) {
+   pbus = malloc(sizeof(*pbus), M_DEVBUF, M_WAITOK | M_ZERO);
+   pbus->self = pdev;
+   pdev->bus = pbus;
+   }
+
DROP_GIANT();
spin_lock(_lock);
list_add(>links, _devices);
@@ -246,14 +265,11 @@ linux_pci_shutdown(device_t dev)
return (0);
 }
 
-int
-pci_register_driver(struct pci_driver *pdrv)
+static int
+_linux_pci_register_driver(struct pci_driver *pdrv, devclass_t dc)
 {
-   devclass_t bus;
-   int error = 0;
+   int error;
 
-   bus = devclass_find("pci");
-
linux_set_current(curthread);
spin_lock(_lock);
list_add(>links, _drivers);
@@ -263,16 +279,39 @@ pci_register_driver(struct pci_driver *pdrv)
pdrv->bsddriver.size = sizeof(struct pci_dev);
 
mtx_lock();
-   if (bus != NULL) {
-   error = devclass_add_driver(bus, >bsddriver,
-   BUS_PASS_DEFAULT, >bsdclass);
-   }
+   error = devclass_add_driver(dc, >bsddriver,
+   BUS_PASS_DEFAULT, >bsdclass);
mtx_unlock();
return (-error);
 }
 
+int
+linux_pci_register_driver(struct pci_driver *pdrv)
+{
+   devclass_t dc;
+
+   dc = devclass_find("pci");
+ 

Re: svn commit: r322380 - in head/contrib/subversion: . subversion/include subversion/libsvn_client subversion/libsvn_fs_fs subversion/libsvn_fs_x subversion/libsvn_ra_svn subversion/libsvn_repos s

2017-08-10 Thread Cy Schubert
In message <201708102203.v7am3qj7022...@repo.freebsd.org>, Peter Wemm 
writes:
> Author: peter
> Date: Thu Aug 10 22:03:26 2017
> New Revision: 322380
> URL: https://svnweb.freebsd.org/changeset/base/322380
> 
> Log:
>   Update subversion 1.9.5 -> 1.9.7

Cool. Thanks.

I'll submit a PR or phab diff for the port... Currently build/run testing 
here.


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX:     Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


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


svn commit: r322391 - head/sys/vm

2017-08-10 Thread Mark Johnston
Author: markj
Date: Fri Aug 11 03:09:11 2017
New Revision: 322391
URL: https://svnweb.freebsd.org/changeset/base/322391

Log:
  Micro-optimize kmem_unback().
  
  We can remove some unnecessary object radix tree lookups by using the
  object memq to iterate over pages in the specified range. This does not,
  however, eliminate the lookup needed in vm_page_free_toq() to remove each
  tree entry.
  
  Reviewed by:  alc, kib (previous revision)
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D11945

Modified:
  head/sys/vm/vm_kern.c

Modified: head/sys/vm/vm_kern.c
==
--- head/sys/vm/vm_kern.c   Fri Aug 11 00:43:50 2017(r322390)
+++ head/sys/vm/vm_kern.c   Fri Aug 11 03:09:11 2017(r322391)
@@ -386,17 +386,19 @@ retry:
 void
 kmem_unback(vm_object_t object, vm_offset_t addr, vm_size_t size)
 {
-   vm_page_t m;
-   vm_offset_t i, offset;
+   vm_page_t m, next;
+   vm_offset_t end, offset;
 
KASSERT(object == kmem_object || object == kernel_object,
("kmem_unback: only supports kernel objects."));
 
pmap_remove(kernel_pmap, addr, addr + size);
offset = addr - VM_MIN_KERNEL_ADDRESS;
+   end = offset + size;
VM_OBJECT_WLOCK(object);
-   for (i = 0; i < size; i += PAGE_SIZE) {
-   m = vm_page_lookup(object, atop(offset + i));
+   for (m = vm_page_lookup(object, atop(offset)); offset < end;
+   offset += PAGE_SIZE, m = next) {
+   next = vm_page_next(m);
vm_page_unwire(m, PQ_NONE);
vm_page_free(m);
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322386 - in head/contrib/sqlite3: . tea tea/generic

2017-08-10 Thread Peter Wemm
Author: peter
Date: Fri Aug 11 00:00:01 2017
New Revision: 322386
URL: https://svnweb.freebsd.org/changeset/base/322386

Log:
  Update from sqlite3-3.14.1 to sqlite3-3.20.0.  This is a private lib.
  This fixes a possible client-side crash when parsing corrupt databases.

Modified:
  head/contrib/sqlite3/Makefile.msc
  head/contrib/sqlite3/configure
  head/contrib/sqlite3/configure.ac
  head/contrib/sqlite3/shell.c
  head/contrib/sqlite3/sqlite3.c
  head/contrib/sqlite3/sqlite3.h
  head/contrib/sqlite3/sqlite3ext.h
  head/contrib/sqlite3/tea/configure
  head/contrib/sqlite3/tea/configure.ac
  head/contrib/sqlite3/tea/generic/tclsqlite3.c
Directory Properties:
  head/contrib/sqlite3/   (props changed)

Modified: head/contrib/sqlite3/Makefile.msc
==
--- head/contrib/sqlite3/Makefile.msc   Thu Aug 10 23:45:32 2017
(r322385)
+++ head/contrib/sqlite3/Makefile.msc   Fri Aug 11 00:00:01 2017
(r322386)
@@ -21,9 +21,16 @@ TOP = .
 # Set this non-0 to enable full warnings (-W4, etc) when compiling.
 #
 !IFNDEF USE_FULLWARN
-USE_FULLWARN = 0
+USE_FULLWARN = 1
 !ENDIF
 
+# Set this non-0 to enable treating warnings as errors (-WX, etc) when
+# compiling.
+#
+!IFNDEF USE_FATAL_WARN
+USE_FATAL_WARN = 0
+!ENDIF
+
 # Set this non-0 to enable full runtime error checks (-RTC1, etc).  This
 # has no effect if (any) optimizations are enabled.
 #
@@ -31,6 +38,13 @@ USE_FULLWARN = 0
 USE_RUNTIME_CHECKS = 0
 !ENDIF
 
+# Set this non-0 to create a SQLite amalgamation file that excludes the
+# various built-in extensions.
+#
+!IFNDEF MINIMAL_AMALGAMATION
+MINIMAL_AMALGAMATION = 0
+!ENDIF
+
 # Set this non-0 to use "stdcall" calling convention for the core library
 # and shell executable.
 #
@@ -255,12 +269,15 @@ SQLITE3EXEPDB = /pdb:sqlite3sh.pdb
 !ENDIF
 !ENDIF
 
+
 # These are the "standard" SQLite compilation options used when compiling for
 # the Windows platform.
 #
 !IFNDEF OPT_FEATURE_FLAGS
+!IF $(MINIMAL_AMALGAMATION)==0
 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1
 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1
+!ENDIF
 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
 !ENDIF
 
@@ -444,6 +461,12 @@ TCC = $(CC) -nologo -W4 -DINCLUDE_MSVC_H=1 $(CCOPTS) $
 TCC = $(CC) -nologo -W3 $(CCOPTS) $(TCCOPTS)
 !ENDIF
 
+# Check if warnings should be treated as errors when compiling.
+#
+!IF $(USE_FATAL_WARN)!=0
+TCC = $(TCC) -WX
+!ENDIF
+
 TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -fp:precise
 RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) $(RCOPTS) $(RCCOPTS)
 
@@ -622,7 +645,11 @@ RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR=1
 !IF $(DEBUG)>2
 TCC = $(TCC) -DSQLITE_DEBUG=1
 RCC = $(RCC) -DSQLITE_DEBUG=1
+!IF $(DYNAMIC_SHELL)==0
+TCC = $(TCC) -DSQLITE_ENABLE_WHERETRACE -DSQLITE_ENABLE_SELECTTRACE
+RCC = $(RCC) -DSQLITE_ENABLE_WHERETRACE -DSQLITE_ENABLE_SELECTTRACE
 !ENDIF
+!ENDIF
 
 !IF $(DEBUG)>4 || $(OSTRACE)!=0
 TCC = $(TCC) -DSQLITE_FORCE_OS_TRACE=1 -DSQLITE_DEBUG_OS_TRACE=1
@@ -900,7 +927,7 @@ LIBRESOBJS =
 # when the shell is not being dynamically linked.
 #
 !IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0
-SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 
-DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS
+SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 
-DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_STMTVTAB
 !ENDIF
 
 
@@ -927,7 +954,7 @@ Replace.exe:
 sqlite3.def:   Replace.exe $(LIBOBJ)
echo EXPORTS > sqlite3.def
dumpbin /all $(LIBOBJ) \
-   | .\Replace.exe 
"^\s+/EXPORT:_?(sqlite3_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \
+   | .\Replace.exe 
"^\s+/EXPORT:_?(sqlite3(?:session|changeset|changegroup)?_[^@,]*)(?:@\d+|,DATA)?$$"
 $$1 true \
| sort >> sqlite3.def
 
 $(SQLITE3EXE): $(TOP)\shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) 
$(SHELL_CORE_SRC) $(SQLITE3H)

Modified: head/contrib/sqlite3/configure
==
--- head/contrib/sqlite3/configure  Thu Aug 10 23:45:32 2017
(r322385)
+++ head/contrib/sqlite3/configure  Fri Aug 11 00:00:01 2017
(r322386)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for sqlite 3.14.1.
+# Generated by GNU Autoconf 2.69 for sqlite 3.20.0.
 #
 # Report bugs to .
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='sqlite'
 PACKAGE_TARNAME='sqlite'
-PACKAGE_VERSION='3.14.1'
-PACKAGE_STRING='sqlite 3.14.1'
+PACKAGE_VERSION='3.20.0'
+PACKAGE_STRING='sqlite 3.20.0'
 PACKAGE_BUGREPORT='http://www.sqlite.org'
 PACKAGE_URL=''
 
@@ -1330,7 +1330,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat 

svn commit: r322383 - head/sys/vm

2017-08-10 Thread Mark Johnston
Author: markj
Date: Thu Aug 10 22:43:38 2017
New Revision: 322383
URL: https://svnweb.freebsd.org/changeset/base/322383

Log:
  Make vm_page_sunbusy() assert that the page is unlocked.
  
  Reviewed by:  kib
  MFC after:1 week
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D11946

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Thu Aug 10 22:15:42 2017(r322382)
+++ head/sys/vm/vm_page.c   Thu Aug 10 22:43:38 2017(r322383)
@@ -757,6 +757,7 @@ vm_page_sunbusy(vm_page_t m)
 {
u_int x;
 
+   vm_page_lock_assert(m, MA_NOTOWNED);
vm_page_assert_sbusied(m);
 
for (;;) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322380 - in head/contrib/subversion: . subversion/include subversion/libsvn_client subversion/libsvn_fs_fs subversion/libsvn_fs_x subversion/libsvn_ra_svn subversion/libsvn_repos subve...

2017-08-10 Thread Peter Wemm
Author: peter
Date: Thu Aug 10 22:03:26 2017
New Revision: 322380
URL: https://svnweb.freebsd.org/changeset/base/322380

Log:
  Update subversion 1.9.5 -> 1.9.7
  
  This includes a client-side fix for CVE-2017-9800.

Modified:
  head/contrib/subversion/CHANGES
  head/contrib/subversion/NOTICE
  head/contrib/subversion/build-outputs.mk
  head/contrib/subversion/configure
  head/contrib/subversion/subversion/include/svn_version.h
  head/contrib/subversion/subversion/libsvn_client/copy.c
  head/contrib/subversion/subversion/libsvn_client/merge.c
  head/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c
  head/contrib/subversion/subversion/libsvn_fs_fs/cached_data.h
  head/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h
  head/contrib/subversion/subversion/libsvn_fs_fs/rep-cache.c
  head/contrib/subversion/subversion/libsvn_fs_fs/transaction.c
  head/contrib/subversion/subversion/libsvn_fs_x/rep-cache-db.h
  head/contrib/subversion/subversion/libsvn_ra_svn/client.c
  head/contrib/subversion/subversion/libsvn_repos/dump.c
  head/contrib/subversion/subversion/libsvn_subr/config_file.c
  head/contrib/subversion/subversion/libsvn_subr/internal_statements.h
  head/contrib/subversion/subversion/libsvn_subr/io.c
  head/contrib/subversion/subversion/libsvn_subr/version.c
  head/contrib/subversion/subversion/libsvn_wc/wc-checks.h
  head/contrib/subversion/subversion/libsvn_wc/wc-metadata.h
  head/contrib/subversion/subversion/libsvn_wc/wc-queries.h
  head/contrib/subversion/subversion/svnadmin/svnadmin.c
  head/contrib/subversion/win-tests.py
Directory Properties:
  head/contrib/subversion/   (props changed)

Modified: head/contrib/subversion/CHANGES
==
--- head/contrib/subversion/CHANGES Thu Aug 10 22:00:08 2017
(r322379)
+++ head/contrib/subversion/CHANGES Thu Aug 10 22:03:26 2017
(r322380)
@@ -1,3 +1,63 @@
+Version 1.9.7
+(10 Aug 2017, from /branches/1.9.x)
+http://svn.apache.org/repos/asf/subversion/tags/1.9.7
+
+ User-visible changes:
+  - Client-side bugfixes:
+* Fix arbitrary code execution vulnerability CVE-2017-9800
+See 
+for details.
+
+  - Server-side bugfixes:
+(none)
+
+  - Bindings bugfixes:
+(none)
+
+ Developer-visible changes:
+  - General:
+(none)
+
+  - API changes:
+(none)
+
+
+Version 1.9.6
+(5 Jul 2017, from /branches/1.9.x)
+http://svn.apache.org/repos/asf/subversion/tags/1.9.6
+
+ User-visible changes:
+  - Client-side bugfixes:
+* cp/mv: improve error message when target is an unversioned dir (r1779948)
+* merge: reduce memory usage with large amounts of mergeinfo (issue #4667)
+
+  - Server-side bugfixes:
+* 'svnadmin freeze': document the purpose more clearly (r1774109)
+* dump: fix segfault when a revision has no revprops (r1781507)
+* fsfs: improve error message upon failure to open rep-cache (r1781655)
+* fsfs: never attempt to share directory representations (r1785053)
+* fsfs: make consistency independent of hash algorithms (r1785737 et al)
+   This change makes Subversion resilient to collision attacks, including
+   SHA-1 collision attacks such as .  See also our
+   documentation at  and
+   .
+
+  - Client-side and server-side bugfixes:
+* work around an APR bug related to file truncation (r1759116)
+
+  - Bindings bugfixes:
+* javahl: follow redirects when opening a connection (r1667738, r1796720)
+
+ Developer-visible changes:
+  - General:
+* win_tests.py: make the --bin option work, rather than abort (r1706432)
+  (regression introduced in 1.9.2)
+* windows: support building with 'zlibstat.lib' in install-layout 
(r1783704)
+
+  - API changes:
+(none)
+
+
 Version 1.9.5
 (29 Nov 2016, from /branches/1.9.x)
 http://svn.apache.org/repos/asf/subversion/tags/1.9.5
@@ -19,7 +79,7 @@ http://svn.apache.org/repos/asf/subversion/tags/1.9.5
 * fsfs: fix "offset too large" error during pack (issue #4657)
 * svnserve: enable hook script environments (r1769152)
 * fsfs: fix possible data reconstruction error (issue #4658)
-* fix source of spurious 'incoming edit' tree conflicts (r1770108)
+* fix source of spurious 'incoming edit' tree conflicts (r1760570)
 * fsfs: improve caching for large directories (r1721285)
 * fsfs: fix crash when encountering all-zero checksums (r1759686)
 * fsfs: fix potential source of repository corruptions (r1756266)
@@ -34,19 +94,19 @@ http://svn.apache.org/repos/asf/subversion/tags/1.9.5
 
   - Bindings bugfixes:
 * swig-pl: do not corrupt "{DATE}" revision variable (r1767768)
-* javahl: fix temporary accepting SSL server certificates (r1764851)
+* javahl: fix temporarily accepting SSL server 

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

2017-08-10 Thread Ed Maste
Author: emaste
Date: Thu Aug 10 20:26:07 2017
New Revision: 322374
URL: https://svnweb.freebsd.org/changeset/base/322374

Log:
  bsdinstall: record DHCP config after obtaining lease
  
  Previously we added an ifconfig_$INTERFACE line to rc.conf for each
  unsuccessful DCHP attempt.
  
  PR:   219515
  Reviewed by:  allanjude
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D11967

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

Modified: head/usr.sbin/bsdinstall/scripts/netconfig_ipv4
==
--- head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Thu Aug 10 19:42:30 
2017(r322373)
+++ head/usr.sbin/bsdinstall/scripts/netconfig_ipv4 Thu Aug 10 20:26:07 
2017(r322374)
@@ -48,8 +48,6 @@ esac
 
 dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' --yesno 
'Would you like to use DHCP to configure this interface?' 0 0
 if [ $? -eq $DIALOG_OK ]; then
-   echo ifconfig_$INTERFACE=\"${IFCONFIG_PREFIX}DHCP\" >> 
$BSDINSTALL_TMPETC/._rc.conf.net
-
if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then
dialog --backtitle 'FreeBSD Installer' --infobox "Acquiring 
DHCP lease..." 0 0
err=$( dhclient $INTERFACE 2>&1 )
@@ -59,6 +57,7 @@ if [ $? -eq $DIALOG_OK ]; then
exec $0 ${INTERFACE} "${IFCONFIG_PREFIX}"
fi
fi
+   echo ifconfig_$INTERFACE=\"${IFCONFIG_PREFIX}DHCP\" >> 
$BSDINSTALL_TMPETC/._rc.conf.net
exit 0
 fi
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322373 - head/sys/arm/ti/am335x

2017-08-10 Thread Ian Lepore
Author: ian
Date: Thu Aug 10 19:42:30 2017
New Revision: 322373
URL: https://svnweb.freebsd.org/changeset/base/322373

Log:
  Ensure the clocks driver is attached before any drivers that need to enable
  clocks in their attach().

Modified:
  head/sys/arm/ti/am335x/am335x_prcm.c

Modified: head/sys/arm/ti/am335x/am335x_prcm.c
==
--- head/sys/arm/ti/am335x/am335x_prcm.cThu Aug 10 17:46:57 2017
(r322372)
+++ head/sys/arm/ti/am335x/am335x_prcm.cThu Aug 10 19:42:30 2017
(r322373)
@@ -465,8 +465,8 @@ static driver_t am335x_prcm_driver = {
 
 static devclass_t am335x_prcm_devclass;
 
-DRIVER_MODULE(am335x_prcm, simplebus, am335x_prcm_driver,
-   am335x_prcm_devclass, 0, 0);
+EARLY_DRIVER_MODULE(am335x_prcm, simplebus, am335x_prcm_driver,
+   am335x_prcm_devclass, 0, 0, BUS_PASS_TIMER + BUS_PASS_ORDER_EARLY);
 MODULE_VERSION(am335x_prcm, 1);
 MODULE_DEPEND(am335x_prcm, ti_scm, 1, 1, 1);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r322347 - in head/sys/x86: acpica include x86 xen

2017-08-10 Thread Roger Pau Monné
On Thu, Aug 10, 2017 at 10:20:59AM -0400, Ed Maste wrote:
> On 10 August 2017 at 05:15, Roger Pau Monné  wrote:
> > Author: royger
> > Date: Thu Aug 10 09:15:18 2017
> > New Revision: 322347
> > URL: https://svnweb.freebsd.org/changeset/base/322347
> >
> > Log:
> >   apic_enumerator: only set mp_ncpus and mp_maxid at probe cpus phase
> 
> i386 is failing with:

Thanks for the heads up! Should be fixed in r322372, will keep an eye on
the CI.

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


svn commit: r322372 - in head/sys/x86: acpica x86

2017-08-10 Thread Roger Pau Monné
Author: royger
Date: Thu Aug 10 17:46:57 2017
New Revision: 322372
URL: https://svnweb.freebsd.org/changeset/base/322372

Log:
  mptable: fix i386 build failure
  
  Reported by:  emaste
  X-MFC-with:   r322347

Modified:
  head/sys/x86/acpica/madt.c
  head/sys/x86/x86/mptable.c

Modified: head/sys/x86/acpica/madt.c
==
--- head/sys/x86/acpica/madt.c  Thu Aug 10 17:03:46 2017(r322371)
+++ head/sys/x86/acpica/madt.c  Thu Aug 10 17:46:57 2017(r322372)
@@ -325,12 +325,17 @@ static void
 madt_parse_cpu(unsigned int apic_id, unsigned int flags)
 {
 
-   if (!(flags & ACPI_MADT_ENABLED) || mp_ncpus == MAXCPU ||
+   if (!(flags & ACPI_MADT_ENABLED) ||
+#ifdef SMP
+   mp_ncpus == MAXCPU ||
+#endif
apic_id > MAX_APIC_ID)
return;
 
+#ifdef SMP
mp_ncpus++;
mp_maxid = mp_ncpus - 1;
+#endif
max_apic_id = max(apic_id, max_apic_id);
 }
 

Modified: head/sys/x86/x86/mptable.c
==
--- head/sys/x86/x86/mptable.c  Thu Aug 10 17:03:46 2017(r322371)
+++ head/sys/x86/x86/mptable.c  Thu Aug 10 17:46:57 2017(r322372)
@@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #ifdef NEW_PCIB
 #include 
 #endif
@@ -330,8 +331,10 @@ mptable_probe_cpus(void)
 
/* Is this a pre-defined config? */
if (mpfps->config_type != 0) {
+#ifdef SMP
mp_ncpus = 2;
mp_maxid = 1;
+#endif
max_apic_id = 1;
} else {
mptable_walk_table(mptable_probe_cpus_handler, _mask);
@@ -346,6 +349,7 @@ static int
 mptable_setup_local(void)
 {
vm_paddr_t addr;
+   u_int cpu_mask;
 
/* Is this a pre-defined config? */
printf("MPTable: <");
@@ -478,8 +482,10 @@ mptable_probe_cpus_handler(u_char *entry, void *arg)
proc = (proc_entry_ptr)entry;
if (proc->cpu_flags & PROCENTRY_FLAG_EN &&
proc->apic_id < MAX_LAPIC_ID && mp_ncpus < MAXCPU) {
+#ifdef SMP
mp_ncpus++;
mp_maxid = mp_ncpus - 1;
+#endif
max_apic_id = max(max_apic_id, proc->apic_id);
}
break;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322371 - head/lib/libc/tests/gen

2017-08-10 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Aug 10 17:03:46 2017
New Revision: 322371
URL: https://svnweb.freebsd.org/changeset/base/322371

Log:
  fnmatch(3): Update testcase for r322368.

Modified:
  head/lib/libc/tests/gen/fnmatch_testcases.h

Modified: head/lib/libc/tests/gen/fnmatch_testcases.h
==
--- head/lib/libc/tests/gen/fnmatch_testcases.h Thu Aug 10 16:50:13 2017
(r322370)
+++ head/lib/libc/tests/gen/fnmatch_testcases.h Thu Aug 10 17:03:46 2017
(r322371)
@@ -131,7 +131,7 @@ struct testcase {
{ "\\(", "\\(", 0, FNM_NOMATCH },
{ "\\a", "\\a", 0, FNM_NOMATCH },
{ "\\", "\\", 0, FNM_NOMATCH },
-   { "\\", "", 0, 0 },
+   { "\\", "", 0, FNM_NOMATCH },
{ "\\*", "\\*", FNM_NOESCAPE, 0 },
{ "\\?", "\\?", FNM_NOESCAPE, 0 },
{ "\\", "\\", FNM_NOESCAPE, 0 },
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322370 - head/lib/libutil

2017-08-10 Thread Mariusz Zaborski
Author: oshogbo
Date: Thu Aug 10 16:50:13 2017
New Revision: 322370
URL: https://svnweb.freebsd.org/changeset/base/322370

Log:
  Limit descriptors stored in the pidfh structure.
  
  Reviewed by:  markj, cem
  Differential Revision:https://reviews.freebsd.org/D11741

Modified:
  head/lib/libutil/pidfile.c

Modified: head/lib/libutil/pidfile.c
==
--- head/lib/libutil/pidfile.c  Thu Aug 10 16:45:05 2017(r322369)
+++ head/lib/libutil/pidfile.c  Thu Aug 10 16:50:13 2017(r322370)
@@ -28,6 +28,7 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 #include 
 
@@ -103,6 +104,7 @@ pidfile_open(const char *path, mode_t mode, pid_t *pid
struct stat sb;
int error, fd, dirfd, dirlen, filenamelen, count;
struct timespec rqtp;
+   cap_rights_t caprights;
 
pfh = malloc(sizeof(*pfh));
if (pfh == NULL)
@@ -179,21 +181,35 @@ pidfile_open(const char *path, mode_t mode, pid_t *pid
 * to the proper descriptor.
 */
if (fstat(fd, ) == -1) {
-   error = errno;
-   unlinkat(dirfd, pfh->pf_filename, 0);
-   close(dirfd);
-   close(fd);
-   free(pfh);
-   errno = error;
-   return (NULL);
+   goto failed;
}
 
+   if (cap_rights_limit(dirfd,
+   cap_rights_init(, CAP_UNLINKAT)) < 0 && errno != ENOSYS) {
+   goto failed;
+   }
+
+   if (cap_rights_limit(fd, cap_rights_init(, CAP_PWRITE,
+   CAP_FSTAT, CAP_FTRUNCATE)) < 0 &&
+   errno != ENOSYS) {
+   goto failed;
+   }
+
pfh->pf_dirfd = dirfd;
pfh->pf_fd = fd;
pfh->pf_dev = sb.st_dev;
pfh->pf_ino = sb.st_ino;
 
return (pfh);
+
+failed:
+   error = errno;
+   unlinkat(dirfd, pfh->pf_filename, 0);
+   close(dirfd);
+   close(fd);
+   free(pfh);
+   errno = error;
+   return (NULL);
 }
 
 int
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322369 - head/lib/libutil

2017-08-10 Thread Mariusz Zaborski
Author: oshogbo
Date: Thu Aug 10 16:45:05 2017
New Revision: 322369
URL: https://svnweb.freebsd.org/changeset/base/322369

Log:
  Store directory descriptor in the pidfh structure and use unlinkat(2)
  function instead of unlink(2).
  
  Now when pidfile_remove() uses unlinkat(2) to remove the pidfile
  it is safe to use this function in capability mode.
  
  Style fix: sort headers.
  
  PR:   220524
  Reviewed by:  markj
  Differential Revision:https://reviews.freebsd.org/D11692

Modified:
  head/lib/libutil/pidfile.c

Modified: head/lib/libutil/pidfile.c
==
--- head/lib/libutil/pidfile.c  Thu Aug 10 15:42:25 2017(r322368)
+++ head/lib/libutil/pidfile.c  Thu Aug 10 16:45:05 2017(r322369)
@@ -31,19 +31,22 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
-#include 
-#include 
-#include 
+#include 
 
 struct pidfh {
+   int pf_dirfd;
int pf_fd;
-   charpf_path[MAXPATHLEN + 1];
+   charpf_dir[MAXPATHLEN + 1];
+   charpf_filename[MAXPATHLEN + 1];
dev_t   pf_dev;
ino_t   pf_ino;
 };
@@ -68,12 +71,12 @@ pidfile_verify(const struct pidfh *pfh)
 }
 
 static int
-pidfile_read(const char *path, pid_t *pidptr)
+pidfile_read(int dirfd, const char *filename, pid_t *pidptr)
 {
char buf[16], *endptr;
int error, fd, i;
 
-   fd = open(path, O_RDONLY | O_CLOEXEC);
+   fd = openat(dirfd, filename, O_RDONLY | O_CLOEXEC);
if (fd == -1)
return (errno);
 
@@ -98,32 +101,50 @@ pidfile_open(const char *path, mode_t mode, pid_t *pid
 {
struct pidfh *pfh;
struct stat sb;
-   int error, fd, len, count;
+   int error, fd, dirfd, dirlen, filenamelen, count;
struct timespec rqtp;
 
pfh = malloc(sizeof(*pfh));
if (pfh == NULL)
return (NULL);
 
-   if (path == NULL)
-   len = snprintf(pfh->pf_path, sizeof(pfh->pf_path),
-   "/var/run/%s.pid", getprogname());
-   else
-   len = snprintf(pfh->pf_path, sizeof(pfh->pf_path),
+   if (path == NULL) {
+   dirlen = snprintf(pfh->pf_dir, sizeof(pfh->pf_dir),
+   "/var/run/");
+   filenamelen = snprintf(pfh->pf_filename,
+   sizeof(pfh->pf_filename), "%s.pid", getprogname());
+   } else {
+   dirlen = snprintf(pfh->pf_dir, sizeof(pfh->pf_dir),
"%s", path);
-   if (len >= (int)sizeof(pfh->pf_path)) {
+   filenamelen = snprintf(pfh->pf_filename,
+   sizeof(pfh->pf_filename), "%s", path);
+
+   dirname(pfh->pf_dir);
+   basename(pfh->pf_filename);
+   }
+
+   if (dirlen >= (int)sizeof(pfh->pf_dir) ||
+   filenamelen >= (int)sizeof(pfh->pf_filename)) {
free(pfh);
errno = ENAMETOOLONG;
return (NULL);
}
 
+   dirfd = open(pfh->pf_dir, O_CLOEXEC | O_DIRECTORY | O_NONBLOCK);
+   if (dirfd == -1) {
+   error = errno;
+   free(pfh);
+   errno = error;
+   return (NULL);
+   }
+
/*
 * Open the PID file and obtain exclusive lock.
 * We truncate PID file here only to remove old PID immediately,
 * PID file will be truncated again in pidfile_write(), so
 * pidfile_write() can be called multiple times.
 */
-   fd = flopen(pfh->pf_path,
+   fd = flopenat(dirfd, pfh->pf_filename,
O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC | O_NONBLOCK, mode);
if (fd == -1) {
if (errno == EWOULDBLOCK) {
@@ -134,8 +155,8 @@ pidfile_open(const char *path, mode_t mode, pid_t *pid
rqtp.tv_sec = 0;
rqtp.tv_nsec = 500;
for (;;) {
-   errno = pidfile_read(pfh->pf_path,
-   pidptr);
+   errno = pidfile_read(dirfd,
+   pfh->pf_filename, pidptr);
if (errno != EAGAIN || --count == 0)
break;
nanosleep(, 0);
@@ -146,7 +167,10 @@ pidfile_open(const char *path, mode_t mode, pid_t *pid
errno = EEXIST;
}
}
+   error = errno;
+   close(dirfd);
free(pfh);
+   errno = error;
return (NULL);
}
 
@@ -156,13 +180,15 @@ pidfile_open(const char *path, mode_t mode, pid_t *pid
 */
if (fstat(fd, ) == -1) {
   

svn commit: r322368 - head/lib/libc/gen

2017-08-10 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Aug 10 15:42:25 2017
New Revision: 322368
URL: https://svnweb.freebsd.org/changeset/base/322368

Log:
  fnmatch(3): improve POSIX conformance.
  
  In a recent interpretation[1], "\\" shall return a non-zero value
  (indicating either no match or an error).
  
  The fix involves a change over r254091 and now the behavior matches the
  Sun/IBM/HP closed source implementations and also likely musl libc.
  
  Submitted by: Joerg Schilling 
  MFC after:1 week
  
  [1] http://austingroupbugs.net/view.php?id=806

Modified:
  head/lib/libc/gen/fnmatch.c

Modified: head/lib/libc/gen/fnmatch.c
==
--- head/lib/libc/gen/fnmatch.c Thu Aug 10 15:34:50 2017(r322367)
+++ head/lib/libc/gen/fnmatch.c Thu Aug 10 15:42:25 2017(r322368)
@@ -184,7 +184,8 @@ fnmatch1(const char *pattern, const char *string, cons
if (!(flags & FNM_NOESCAPE)) {
pclen = mbrtowc(, pattern, MB_LEN_MAX,
);
-   if (pclen == (size_t)-1 || pclen == (size_t)-2)
+   if (pclen == 0 || pclen == (size_t)-1 ||
+   pclen == (size_t)-2)
return (FNM_NOMATCH);
pattern += pclen;
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322365 - head/usr.bin/calendar/calendars

2017-08-10 Thread Ruey-Cherng Yu
Author: rcyu (doc committer)
Date: Thu Aug 10 15:31:45 2017
New Revision: 322365
URL: https://svnweb.freebsd.org/changeset/base/322365

Log:
   Add myself.
  
  Reported by:  mckusick

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdThu Aug 10 14:59:17 
2017(r322364)
+++ head/usr.bin/calendar/calendars/calendar.freebsdThu Aug 10 15:31:45 
2017(r322365)
@@ -144,6 +144,7 @@
 04/11  Bruce A. Mah  born in Fresno, California, United 
States, 1969
 04/12  Patrick Gardella  born in Columbus, Ohio, United 
States, 1967
 04/12  Ed Schouten  born in Oss, the Netherlands, 1986
+04/12  Ruey-Cherng Yu  born in Keelung, Taiwan, 1978
 04/13  Oliver Braun  born in Nuremberg, Bavaria, Germany, 
1972
 04/14  Crist J. Clark  born in Milwaukee, Wisconsin, United 
States, 1970
 04/14  Glen J. Barber  born in Wilkes-Barre, Pennsylvania, 
United States, 1981
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322364 - in head/sys/dev: mpr mps

2017-08-10 Thread Kenneth D. Merry
Author: ken
Date: Thu Aug 10 14:59:17 2017
New Revision: 322364
URL: https://svnweb.freebsd.org/changeset/base/322364

Log:
  Changes to make mps(4) and mpr(4) handle reinit with reallocation.
  
  When the mps(4) and mpr(4) drivers need to reinitialize the
  firmware, they sometimes need to reallocate all of the memory
  allocated by the driver.  The reallocation happens whenever the IOC
  Facts change.  That should only happen after a firmware upgrade.
  
  If the reinitialization happens as a result of a timed out command
  sent to the card, the command that timed out and triggered the
  reinit may have been freed if iocfacts_allocate() reallocated all
  memory.  If the caller attempts to access the command after that,
  the kernel will panic because the caller will be dereferencing
  freed memory.
  
  The solution is to set a flag in the softc when we reallocate,
  and avoid dereferencing the command strucure if we've reallocated.
  
  The changes are largely the same in both drivers, since mpr(4) is a
  derivative of mps(4).
  
   o In iocfacts_allocate(), if the IOC Facts have changed and we
 need to reallocate, set the REALLOCATED flag in the softc.
  
   o Change wait_command() to take a struct mps_command ** instead of
 a struct mps_command *.  This allows us to NULL out the caller's
 command pointer if we have to reinit the controller and the data
 structures get reallocated.  (The REALLOCATED flag will be set
 in the softc if that has happened.)
  
   o In every place that calls wait_command(), make sure we handle
 the case where the command is NULL after the call.
  
   o The mpr(4) driver has mpr_request_polled() which can also
 reinitialize the card.  Also check for reallocation there.
  
  Reviewed by:  scottl, slm
  MFC after:1 week
  Sponsored by: Spectra Logic

Modified:
  head/sys/dev/mpr/mpr.c
  head/sys/dev/mpr/mpr_config.c
  head/sys/dev/mpr/mpr_sas.c
  head/sys/dev/mpr/mpr_sas_lsi.c
  head/sys/dev/mpr/mpr_user.c
  head/sys/dev/mpr/mprvar.h
  head/sys/dev/mps/mps.c
  head/sys/dev/mps/mps_config.c
  head/sys/dev/mps/mps_sas.c
  head/sys/dev/mps/mps_sas_lsi.c
  head/sys/dev/mps/mps_user.c
  head/sys/dev/mps/mpsvar.h

Modified: head/sys/dev/mpr/mpr.c
==
--- head/sys/dev/mpr/mpr.c  Thu Aug 10 14:54:36 2017(r322363)
+++ head/sys/dev/mpr/mpr.c  Thu Aug 10 14:59:17 2017(r322364)
@@ -436,6 +436,8 @@ mpr_iocfacts_allocate(struct mpr_softc *sc, uint8_t at
 
/* Only deallocate and reallocate if relevant IOC Facts have changed */
reallocating = FALSE;
+   sc->mpr_flags &= ~MPR_FLAGS_REALLOCATED;
+
if ((!attaching) &&
((saved_facts.MsgVersion != sc->facts->MsgVersion) ||
(saved_facts.HeaderVersion != sc->facts->HeaderVersion) ||
@@ -458,6 +460,9 @@ mpr_iocfacts_allocate(struct mpr_softc *sc, uint8_t at
(saved_facts.MaxPersistentEntries !=
sc->facts->MaxPersistentEntries))) {
reallocating = TRUE;
+
+   /* Record that we reallocated everything */
+   sc->mpr_flags |= MPR_FLAGS_REALLOCATED;
}
 
/*
@@ -2229,8 +2234,8 @@ mpr_update_events(struct mpr_softc *sc, struct mpr_eve
 uint8_t *mask)
 {
MPI2_EVENT_NOTIFICATION_REQUEST *evtreq;
-   MPI2_EVENT_NOTIFICATION_REPLY *reply;
-   struct mpr_command *cm;
+   MPI2_EVENT_NOTIFICATION_REPLY *reply = NULL;
+   struct mpr_command *cm = NULL;
struct mpr_event_handle *eh;
int error, i;
 
@@ -2263,8 +2268,9 @@ mpr_update_events(struct mpr_softc *sc, struct mpr_eve
cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
cm->cm_data = NULL;
 
-   error = mpr_request_polled(sc, cm);
-   reply = (MPI2_EVENT_NOTIFICATION_REPLY *)cm->cm_reply;
+   error = mpr_request_polled(sc, );
+   if (cm != NULL)
+   reply = (MPI2_EVENT_NOTIFICATION_REPLY *)cm->cm_reply;
if ((reply == NULL) ||
(reply->IOCStatus & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS)
error = ENXIO;
@@ -2274,7 +2280,8 @@ mpr_update_events(struct mpr_softc *sc, struct mpr_eve
 
mpr_dprint(sc, MPR_TRACE, "%s finished error %d\n", __func__, error);
 
-   mpr_free_command(sc, cm);
+   if (cm != NULL)
+   mpr_free_command(sc, cm);
return (error);
 }
 
@@ -3260,11 +3267,12 @@ mpr_map_command(struct mpr_softc *sc, struct mpr_comma
  * be executed and enqueued automatically.  Other errors come from msleep().
  */
 int
-mpr_wait_command(struct mpr_softc *sc, struct mpr_command *cm, int timeout,
+mpr_wait_command(struct mpr_softc *sc, struct mpr_command **cmp, int timeout,
 int sleep_flag)
 {
int error, rc;
struct timeval cur_time, start_time;
+   struct mpr_command *cm = *cmp;
 
if (sc->mpr_flags & MPR_FLAGS_DIAGRESET) 
return  

svn commit: r322363 - head/sys/dev/e1000

2017-08-10 Thread Sean Bruno
Author: sbruno
Date: Thu Aug 10 14:54:36 2017
New Revision: 322363
URL: https://svnweb.freebsd.org/changeset/base/322363

Log:
  Purge deprecated locking macros.
  
  Submitted by: Matt Macy 
  Sponsored by: Limelight Networks

Modified:
  head/sys/dev/e1000/if_em.h

Modified: head/sys/dev/e1000/if_em.h
==
--- head/sys/dev/e1000/if_em.h  Thu Aug 10 14:18:58 2017(r322362)
+++ head/sys/dev/e1000/if_em.h  Thu Aug 10 14:54:36 2017(r322363)
@@ -555,26 +555,6 @@ typedef struct _em_vendor_info_t {
 
 void em_dump_rs(struct adapter *);
 
-#defineEM_CORE_LOCK_INIT(_sc, _name) \
-   mtx_init(&(_sc)->core_mtx, _name, "EM Core Lock", MTX_DEF)
-#defineEM_TX_LOCK_INIT(_sc, _name) \
-   mtx_init(&(_sc)->tx_mtx, _name, "EM TX Lock", MTX_DEF)
-#defineEM_RX_LOCK_INIT(_sc, _name) \
-   mtx_init(&(_sc)->rx_mtx, _name, "EM RX Lock", MTX_DEF)
-#defineEM_CORE_LOCK_DESTROY(_sc)   mtx_destroy(&(_sc)->core_mtx)
-#defineEM_TX_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->tx_mtx)
-#defineEM_RX_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->rx_mtx)
-#defineEM_CORE_LOCK(_sc)   mtx_lock(&(_sc)->core_mtx)
-#defineEM_TX_LOCK(_sc) mtx_lock(&(_sc)->tx_mtx)
-#defineEM_TX_TRYLOCK(_sc)  mtx_trylock(&(_sc)->tx_mtx)
-#defineEM_RX_LOCK(_sc) mtx_lock(&(_sc)->rx_mtx)
-#defineEM_CORE_UNLOCK(_sc) mtx_unlock(&(_sc)->core_mtx)
-#defineEM_TX_UNLOCK(_sc)   mtx_unlock(&(_sc)->tx_mtx)
-#defineEM_RX_UNLOCK(_sc)   mtx_unlock(&(_sc)->rx_mtx)
-#defineEM_CORE_LOCK_ASSERT(_sc)mtx_assert(&(_sc)->core_mtx, 
MA_OWNED)
-#defineEM_TX_LOCK_ASSERT(_sc)  mtx_assert(&(_sc)->tx_mtx, 
MA_OWNED)
-#defineEM_RX_LOCK_ASSERT(_sc)  mtx_assert(&(_sc)->rx_mtx, 
MA_OWNED)
-
 #define EM_RSSRK_SIZE  4
 #define EM_RSSRK_VAL(key, i)   (key[(i) * EM_RSSRK_SIZE] | \
 key[(i) * EM_RSSRK_SIZE + 1] << 8 | \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r322347 - in head/sys/x86: acpica include x86 xen

2017-08-10 Thread Ed Maste
On 10 August 2017 at 05:15, Roger Pau Monné  wrote:
> Author: royger
> Date: Thu Aug 10 09:15:18 2017
> New Revision: 322347
> URL: https://svnweb.freebsd.org/changeset/base/322347
>
> Log:
>   apic_enumerator: only set mp_ncpus and mp_maxid at probe cpus phase

i386 is failing with:

13:55:08 --- mptable.o ---
13:55:08 /usr/src/sys/x86/x86/mptable.c:333:3: error: use of
undeclared identifier 'mp_ncpus'
13:55:08 mp_ncpus = 2;
13:55:08 ^
13:55:08 /usr/src/sys/x86/x86/mptable.c:334:3: error: use of
undeclared identifier 'mp_maxid'
13:55:08 mp_maxid = 1;
13:55:08 ^
13:55:08 /usr/src/sys/x86/x86/mptable.c:359:3: error: use of
undeclared identifier 'cpu_mask'
13:55:08 cpu_mask = 0;
13:55:08 ^
13:55:08 /usr/src/sys/x86/x86/mptable.c:360:51: error: use of
undeclared identifier 'cpu_mask'
13:55:08
mptable_walk_table(mptable_setup_cpus_handler, _mask);
13:55:08 ^
13:55:08 /usr/src/sys/x86/x86/mptable.c:480:39: error: use of
undeclared identifier 'mp_ncpus'
13:55:08 proc->apic_id < MAX_LAPIC_ID && mp_ncpus
< MAXCPU) {
13:55:08 ^
13:55:08 /usr/src/sys/x86/x86/mptable.c:481:4: error: use of
undeclared identifier 'mp_ncpus'
13:55:08 mp_ncpus++;
13:55:08 ^
13:55:08 /usr/src/sys/x86/x86/mptable.c:482:4: error: use of
undeclared identifier 'mp_maxid'
13:55:08 mp_maxid = mp_ncpus - 1;
13:55:08 ^
13:55:08 /usr/src/sys/x86/x86/mptable.c:482:15: error: use of
undeclared identifier 'mp_ncpus'
13:55:08 mp_maxid = mp_ncpus - 1;
13:55:08^
13:55:08 8 errors generated.
13:55:08 *** [mptable.o] Error code 1

https://ci.freebsd.org/job/FreeBSD-head-i386-build/3457/console
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

svn commit: r322362 - head

2017-08-10 Thread Glen Barber
Author: gjb
Date: Thu Aug 10 14:18:58 2017
New Revision: 322362
URL: https://svnweb.freebsd.org/changeset/base/322362

Log:
  Indent nested conditionals for readability.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Thu Aug 10 14:18:09 2017(r322361)
+++ head/Makefile.inc1  Thu Aug 10 14:18:58 2017(r322362)
@@ -1632,7 +1632,7 @@ create-world-package-${pkgname}: .PHONY
 create-kernel-packages:.PHONY
 _default_flavor=   -default
 .if exists(${KSTAGEDIR}/kernel.meta)
-.for flavor in "" -debug
+. for flavor in "" -debug
 create-kernel-packages: 
create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}
 create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}: 
_pkgbootstrap .PHONY
@cd ${KSTAGEDIR}/${DISTDIR} ; \
@@ -1658,12 +1658,12 @@ create-kernel-packages-flavor${flavor:C,^""$,${_defaul
-p 
${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.plist \
-r ${KSTAGEDIR}/${DISTDIR} \
-o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh 
config ABI)/${PKG_VERSION}
-.endfor
+. endfor
 .endif
 .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
-.for _kernel in ${BUILDKERNELS:[2..-1]}
-.if exists(${KSTAGEDIR}/kernel.${_kernel}.meta)
-.for flavor in "" -debug
+. for _kernel in ${BUILDKERNELS:[2..-1]}
+.  if exists(${KSTAGEDIR}/kernel.${_kernel}.meta)
+.   for flavor in "" -debug
 create-kernel-packages: 
create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kernel}
 
create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kernel}:
 _pkgbootstrap .PHONY
@cd ${KSTAGEDIR}/kernel.${_kernel} ; \
@@ -1689,9 +1689,9 @@ create-kernel-packages-extra-flavor${flavor:C,^""$,${_
-p 
${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.plist \
-r ${KSTAGEDIR}/kernel.${_kernel} \
-o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh 
config ABI)/${PKG_VERSION}
-.endfor
-.endif
-.endfor
+.   endfor
+.  endif
+. endfor
 .endif
 
 sign-packages: _pkgbootstrap .PHONY
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322361 - in head: lib/csu/riscv lib/libc/riscv/gen libexec/rtld-elf/riscv share/mk sys/boot/fdt/dts/riscv sys/conf sys/riscv/conf sys/riscv/include sys/riscv/riscv

2017-08-10 Thread Ruslan Bukin
Author: br
Date: Thu Aug 10 14:18:09 2017
New Revision: 322361
URL: https://svnweb.freebsd.org/changeset/base/322361

Log:
  Support for v1.10 (latest) of RISC-V privilege specification.
  
  New version is not compatible on supervisor mode with v1.9.1
  (previous version).
  
  Highlights:
  o BBL (Berkeley Boot Loader) provides no initial page tables
anymore allowing us to choose VM, to build page tables manually
and enable MMU in S-mode.
  o SBI interface changed.
  o GENERIC kernel.
FDT is now chosen standard for RISC-V hardware description.
DTB is now provided by Spike (golden model simulator). This
allows us to introduce GENERIC kernel. However, description
for console and timer devices is not provided in DTB, so move
these devices temporary to nexus bus.
  o Supervisor can't access userspace by default. Solution is to
set SUM (permit Supervisor User Memory access) bit in sstatus
register.
  o Compressed extension is now turned on by default.
  o External GCC 7.1 compiler used.
  o _gp renamed to __global_pointer$
  o Compiler -march= string is now in use allowing us to choose
required extensions (compressed, FPU, atomic, etc).
  
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D11800

Deleted:
  head/sys/boot/fdt/dts/riscv/
  head/sys/riscv/conf/LOWRISC
  head/sys/riscv/conf/LOWRISC.hints
  head/sys/riscv/conf/QEMU
  head/sys/riscv/conf/ROCKET
  head/sys/riscv/conf/SPIKE
  head/sys/riscv/riscv/sbi.S
Modified:
  head/lib/csu/riscv/crt1.c
  head/lib/csu/riscv/crti.S
  head/lib/libc/riscv/gen/fabs.S
  head/libexec/rtld-elf/riscv/reloc.c
  head/share/mk/bsd.cpu.mk
  head/share/mk/bsd.stand.mk
  head/sys/conf/Makefile.riscv
  head/sys/conf/files.riscv
  head/sys/conf/kern.mk
  head/sys/riscv/conf/GENERIC
  head/sys/riscv/include/machdep.h
  head/sys/riscv/include/riscvreg.h
  head/sys/riscv/include/sbi.h
  head/sys/riscv/riscv/cpufunc_asm.S
  head/sys/riscv/riscv/exception.S
  head/sys/riscv/riscv/intr_machdep.c
  head/sys/riscv/riscv/locore.S
  head/sys/riscv/riscv/machdep.c
  head/sys/riscv/riscv/nexus.c
  head/sys/riscv/riscv/pmap.c
  head/sys/riscv/riscv/riscv_console.c
  head/sys/riscv/riscv/swtch.S
  head/sys/riscv/riscv/timer.c
  head/sys/riscv/riscv/trap.c
  head/sys/riscv/riscv/vm_machdep.c

Modified: head/lib/csu/riscv/crt1.c
==
--- head/lib/csu/riscv/crt1.c   Thu Aug 10 13:51:04 2017(r322360)
+++ head/lib/csu/riscv/crt1.c   Thu Aug 10 14:18:09 2017(r322361)
@@ -1,7 +1,7 @@
 /* LINTLIBRARY */
 /*-
  * Copyright 1996-1998 John D. Polstra.
- * Copyright (c) 2015 Ruslan Bukin 
+ * Copyright (c) 2015-2017 Ruslan Bukin 
  * All rights reserved.
  *
  * Portions of this software were developed by SRI International and the
@@ -64,7 +64,10 @@ __asm("  .text   \n"
 "  sllit0, a0, 3   \n" /* mult by arg size */
 "  add a2, a1, t0  \n" /* env is after argv */
 "  addia2, a2, 8   \n" /* argv is null terminated */
-"  lla gp, _gp \n" /* load global pointer */
+"  .option push\n"
+"  .option norelax \n"
+"  lla gp, __global_pointer$\n"
+"  .option pop \n"
 "  call__start");
 
 void

Modified: head/lib/csu/riscv/crti.S
==
--- head/lib/csu/riscv/crti.S   Thu Aug 10 13:51:04 2017(r322360)
+++ head/lib/csu/riscv/crti.S   Thu Aug 10 14:18:09 2017(r322361)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2015 Ruslan Bukin 
+ * Copyright (c) 2015-2017 Ruslan Bukin 
  * All rights reserved.
  *
  * Portions of this software were developed by SRI International and the
@@ -35,12 +35,13 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-# this puts _gp into .dynsym, so symlook_obj can now find that (see reloc.c)
-   .weak   _gp
-_gp:
+# this puts __global_pointer$ into .dynsym, so symlook_obj can now find that
+# (see reloc.c)
+   .weak   __global_pointer$
+__global_pointer$:
 
.section .init,"ax",@progbits
-   .align  2
+   .align  0
.globl  _init
.type   _init,@function
 _init:
@@ -48,7 +49,7 @@ _init:
sd  ra, 0(sp)
 
.section .fini,"ax",@progbits
-   .align  2
+   .align  0
.globl  _fini
.type   _fini,@function
 _fini:

Modified: head/lib/libc/riscv/gen/fabs.S
==
--- head/lib/libc/riscv/gen/fabs.S  Thu Aug 10 13:51:04 2017
(r322360)
+++ head/lib/libc/riscv/gen/fabs.S  Thu Aug 10 14:18:09 2017
(r322361)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2015 Ruslan Bukin 
+ * Copyright (c) 2015-2017 Ruslan Bukin 

svn commit: r322360 - head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD

2017-08-10 Thread Ed Maste
Author: emaste
Date: Thu Aug 10 13:51:04 2017
New Revision: 322360
URL: https://svnweb.freebsd.org/changeset/base/322360

Log:
  lldb: Report inferior signals as signals, not exceptions, on FreeBSD
  
  This is the FreeBSD equivalent of LLVM r238549.
  
  This serves 2 purposes:
  
  * LLDB should handle inferior process signals SIGSEGV/SIGILL/SIGBUS/
SIGFPE the way it is suppose to be handled. Prior to this fix these
signals will neither create a coredump, nor exit from the debugger
or work for signal handling scenario.
  * eInvalidCrashReason need not report "unknown crash reason" if we have
a valid si_signo
  
  llvm.org/pr23699
  
  Patch by Karnajit Wangkhem
  
  Differential Revision:  https://reviews.llvm.org/D35223
  
  Submitted by: Karnajit Wangkhem
  Obtained from:LLVM r310591

Modified:
  head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
  head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.cpp
  head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.h
  head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp

Modified: 
head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
==
--- 
head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp   
Thu Aug 10 13:45:56 2017(r322359)
+++ 
head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp   
Thu Aug 10 13:51:04 2017(r322360)
@@ -375,6 +375,7 @@ void FreeBSDThread::Notify(const ProcessMessage 
 LimboNotify(message);
 break;
 
+  case ProcessMessage::eCrashMessage:
   case ProcessMessage::eSignalMessage:
 SignalNotify(message);
 break;
@@ -395,10 +396,6 @@ void FreeBSDThread::Notify(const ProcessMessage 
 WatchNotify(message);
 break;
 
-  case ProcessMessage::eCrashMessage:
-CrashNotify(message);
-break;
-
   case ProcessMessage::eExecMessage:
 ExecNotify(message);
 break;
@@ -577,27 +574,19 @@ void FreeBSDThread::LimboNotify(const ProcessMessage &
 
 void FreeBSDThread::SignalNotify(const ProcessMessage ) {
   int signo = message.GetSignal();
-  SetStopInfo(StopInfo::CreateStopReasonWithSignal(*this, signo));
+  if (message.GetKind() == ProcessMessage::eCrashMessage) {
+std::string stop_description = GetCrashReasonString(
+message.GetCrashReason(), message.GetFaultAddress());
+SetStopInfo(StopInfo::CreateStopReasonWithSignal(
+*this, signo, stop_description.c_str()));
+  } else {
+SetStopInfo(StopInfo::CreateStopReasonWithSignal(*this, signo));
+  }
 }
 
 void FreeBSDThread::SignalDeliveredNotify(const ProcessMessage ) {
   int signo = message.GetSignal();
   SetStopInfo(StopInfo::CreateStopReasonWithSignal(*this, signo));
-}
-
-void FreeBSDThread::CrashNotify(const ProcessMessage ) {
-  // FIXME: Update stop reason as per bugzilla 14598
-  int signo = message.GetSignal();
-
-  assert(message.GetKind() == ProcessMessage::eCrashMessage);
-
-  Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_THREAD));
-  if (log)
-log->Printf("FreeBSDThread::%s () signo = %i, reason = '%s'", __FUNCTION__,
-signo, message.PrintCrashReason());
-
-  SetStopInfo(lldb::StopInfoSP(new POSIXCrashStopInfo(
-  *this, signo, message.GetCrashReason(), message.GetFaultAddress(;
 }
 
 unsigned FreeBSDThread::GetRegisterIndexFromOffset(unsigned offset) {

Modified: 
head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.cpp
==
--- 
head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.cpp   
Thu Aug 10 13:45:56 2017(r322359)
+++ 
head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.cpp   
Thu Aug 10 13:51:04 2017(r322360)
@@ -28,22 +28,6 @@ bool POSIXLimboStopInfo::ShouldStop(Event *event_ptr) 
 bool POSIXLimboStopInfo::ShouldNotify(Event *event_ptr) { return false; }
 
 
//===--===//
-// POSIXCrashStopInfo
-
-POSIXCrashStopInfo::POSIXCrashStopInfo(FreeBSDThread , uint32_t status,
-   CrashReason reason,
-   lldb::addr_t fault_addr)
-: POSIXStopInfo(thread, status) {
-  m_description = ::GetCrashReasonString(reason, fault_addr);
-}
-
-POSIXCrashStopInfo::~POSIXCrashStopInfo() {}
-
-lldb::StopReason POSIXCrashStopInfo::GetStopReason() const {
-  return lldb::eStopReasonException;
-}
-
-//===--===//
 // POSIXNewThreadStopInfo
 
 POSIXNewThreadStopInfo::~POSIXNewThreadStopInfo() {}

Modified: 
head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.h

svn commit: r322359 - head/sys/dev/ofw

2017-08-10 Thread Marcin Wojtas
Author: mw
Date: Thu Aug 10 13:45:56 2017
New Revision: 322359
URL: https://svnweb.freebsd.org/changeset/base/322359

Log:
  Enable OF_setprop API function to add property in FDT
  
  This patch modifies function ofw_fdt_setprop (called by OF_setprop),
  so that it can add property, when replacing is not possible.
  Adding property is needed to fixup FDT's that have missing
  properties.
  
  Submitted by: Patryk Duda 
  Reviewed by: nwhitehorn, cognet (mentor)
  Approved by: cognet (mentor)
  Obtained from: Semihalf
  Differential Revision: https://reviews.freebsd.org/D11879

Modified:
  head/sys/dev/ofw/ofw_fdt.c

Modified: head/sys/dev/ofw/ofw_fdt.c
==
--- head/sys/dev/ofw/ofw_fdt.c  Thu Aug 10 13:32:04 2017(r322358)
+++ head/sys/dev/ofw/ofw_fdt.c  Thu Aug 10 13:45:56 2017(r322359)
@@ -381,7 +381,11 @@ ofw_fdt_setprop(ofw_t ofw, phandle_t package, const ch
if (offset < 0)
return (-1);
 
-   return (fdt_setprop_inplace(fdtp, offset, propname, buf, len));
+   if (fdt_setprop_inplace(fdtp, offset, propname, buf, len) != 0)
+   /* Try to add property, when setting value inplace failed */
+   return (fdt_setprop(fdtp, offset, propname, buf, len));
+
+   return (0);
 }
 
 /* Convert a device specifier to a fully qualified pathname. */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322358 - head/release/packages

2017-08-10 Thread Glen Barber
Author: gjb
Date: Thu Aug 10 13:32:04 2017
New Revision: 322358
URL: https://svnweb.freebsd.org/changeset/base/322358

Log:
  Further revise r322327 and r322352 in release/packages/kernel.ucl.
  
  Use PPID and PID to kill off the pre-install and parent pkg(8)
  processes unless 'Y' or 'y' are entered at the prompt if the user
  wants to proceed with upgrading the kernel and userland at the same
  time.
  
  This restores some of the logic and intent of r322327, with the
  caveat of printing "child process terminated unexpectedly."
  
  MFC after:5 days
  MFC with: r322327, r322352
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/packages/kernel.ucl

Modified: head/release/packages/kernel.ucl
==
--- head/release/packages/kernel.uclThu Aug 10 13:05:40 2017
(r322357)
+++ head/release/packages/kernel.uclThu Aug 10 13:32:04 2017
(r322358)
@@ -40,7 +40,17 @@ scripts: {
echo "  pkg upgrade"
echo
echo ""
-   sleep 5
+   echo
+   echo "Do you want to continue anyway? (N/y)"
+   read ANSWER
+   case ${ANSWER} in
+   [Yy])
+   exit 0
+   ;;
+   *)
+   kill ${PPID} ${PID}
+   ;;
+   esac
 EOD
 
post-install = 

svn commit: r322357 - in head/sys/compat/linuxkpi/common: include/linux src

2017-08-10 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Aug 10 13:05:40 2017
New Revision: 322357
URL: https://svnweb.freebsd.org/changeset/base/322357

Log:
  Use integer type to pass around jiffies and/or ticks values in the
  LinuxKPI because in FreeBSD ticks are 32-bit.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/completion.h
  head/sys/compat/linuxkpi/common/include/linux/jiffies.h
  head/sys/compat/linuxkpi/common/include/linux/timer.h
  head/sys/compat/linuxkpi/common/src/linux_compat.c

Modified: head/sys/compat/linuxkpi/common/include/linux/completion.h
==
--- head/sys/compat/linuxkpi/common/include/linux/completion.h  Thu Aug 10 
13:01:19 2017(r322356)
+++ head/sys/compat/linuxkpi/common/include/linux/completion.h  Thu Aug 10 
13:05:40 2017(r322357)
@@ -61,8 +61,8 @@ struct completion {
linux_completion_done(c)
 
 extern void linux_complete_common(struct completion *, int);
-extern long linux_wait_for_common(struct completion *, int);
-extern long linux_wait_for_timeout_common(struct completion *, long, int);
+extern int linux_wait_for_common(struct completion *, int);
+extern int linux_wait_for_timeout_common(struct completion *, int, int);
 extern int linux_try_wait_for_completion(struct completion *);
 extern int linux_completion_done(struct completion *);
 

Modified: head/sys/compat/linuxkpi/common/include/linux/jiffies.h
==
--- head/sys/compat/linuxkpi/common/include/linux/jiffies.h Thu Aug 10 
13:01:19 2017(r322356)
+++ head/sys/compat/linuxkpi/common/include/linux/jiffies.h Thu Aug 10 
13:05:40 2017(r322357)
@@ -141,7 +141,7 @@ get_jiffies_64(void)
 }
 
 static inline int
-linux_timer_jiffies_until(unsigned long expires)
+linux_timer_jiffies_until(int expires)
 {
int delta = expires - jiffies;
/* guard against already expired values */

Modified: head/sys/compat/linuxkpi/common/include/linux/timer.h
==
--- head/sys/compat/linuxkpi/common/include/linux/timer.h   Thu Aug 10 
13:01:19 2017(r322356)
+++ head/sys/compat/linuxkpi/common/include/linux/timer.h   Thu Aug 10 
13:05:40 2017(r322357)
@@ -41,7 +41,7 @@ struct timer_list {
struct callout timer_callout;
void(*function) (unsigned long);
unsigned long data;
-   unsigned long expires;
+   int expires;
 };
 
 extern unsigned long linux_timer_hz_mask;
@@ -65,7 +65,7 @@ extern unsigned long linux_timer_hz_mask;
callout_init(&(timer)->timer_callout, 1);   \
 } while (0)
 
-extern void mod_timer(struct timer_list *, unsigned long);
+extern void mod_timer(struct timer_list *, int);
 extern void add_timer(struct timer_list *);
 extern void add_timer_on(struct timer_list *, int cpu);
 
@@ -73,7 +73,7 @@ extern void add_timer_on(struct timer_list *, int cpu)
 #definedel_timer_sync(timer)   callout_drain(&(timer)->timer_callout)
 #definetimer_pending(timer)callout_pending(&(timer)->timer_callout)
 #defineround_jiffies(j)\
-   ((unsigned long)(((j) + linux_timer_hz_mask) & ~linux_timer_hz_mask))
+   ((int)(((j) + linux_timer_hz_mask) & ~linux_timer_hz_mask))
 #defineround_jiffies_relative(j) round_jiffies(j)
 #defineround_jiffies_up(j) round_jiffies(j)
 #defineround_jiffies_up_relative(j) round_jiffies_up(j)

Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c
==
--- head/sys/compat/linuxkpi/common/src/linux_compat.c  Thu Aug 10 13:01:19 
2017(r322356)
+++ head/sys/compat/linuxkpi/common/src/linux_compat.c  Thu Aug 10 13:05:40 
2017(r322357)
@@ -1598,7 +1598,7 @@ linux_timer_callback_wrapper(void *context)
 }
 
 void
-mod_timer(struct timer_list *timer, unsigned long expires)
+mod_timer(struct timer_list *timer, int expires)
 {
 
timer->expires = expires;
@@ -1660,10 +1660,10 @@ linux_complete_common(struct completion *c, int all)
 /*
  * Indefinite wait for done != 0 with or without signals.
  */
-long
+int
 linux_wait_for_common(struct completion *c, int flags)
 {
-   long error;
+   int error;
 
if (SCHEDULER_STOPPED())
return (0);
@@ -1700,10 +1700,11 @@ intr:
 /*
  * Time limited wait for done != 0 with or without signals.
  */
-long
-linux_wait_for_timeout_common(struct completion *c, long timeout, int flags)
+int
+linux_wait_for_timeout_common(struct completion *c, int timeout, int flags)
 {
-   long end = jiffies + timeout, error;
+   int end = jiffies + timeout;
+   int error;
int ret;
 
if (SCHEDULER_STOPPED())
___

svn commit: r322356 - head/share/mk

2017-08-10 Thread Ed Maste
Author: emaste
Date: Thu Aug 10 13:01:19 2017
New Revision: 322356
URL: https://svnweb.freebsd.org/changeset/base/322356

Log:
  Mark PROFILE option as broken when targetting mips64
  
  The assembly in sys/mips/include/profile.h will only work for o32 ABI.
  
  Submitted by: Alexander Richardson
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D11950

Modified:
  head/share/mk/src.opts.mk

Modified: head/share/mk/src.opts.mk
==
--- head/share/mk/src.opts.mk   Thu Aug 10 13:00:10 2017(r322355)
+++ head/share/mk/src.opts.mk   Thu Aug 10 13:01:19 2017(r322356)
@@ -282,7 +282,10 @@ BROKEN_OPTIONS+=SSP
 .if ${__T:Mmips*} || ${__T:Mpowerpc*} || ${__T:Msparc64} || ${__T:Mriscv*}
 BROKEN_OPTIONS+=EFI
 .endif
-
+.if ${__T:Mmips64*}
+# profiling won't work on MIPS64 because there is only assembly for o32
+BROKEN_OPTIONS+=PROFILE
+.endif
 .if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \
 ${__T} == "powerpc64" || ${__T} == "sparc64"
 __DEFAULT_YES_OPTIONS+=CXGBETOOL
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322355 - head/sys/compat/linuxkpi/common/include/linux

2017-08-10 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Aug 10 13:00:10 2017
New Revision: 322355
URL: https://svnweb.freebsd.org/changeset/base/322355

Log:
  Fixes for wait event in the LinuxKPI. These are regression issues
  after r319757.
  
  1) Correct the return value from __wait_event_common() from 1 to 0 in
  case the timeout is specified as MAX_SCHEDULE_TIMEOUT. In the other
  case __ret is zero and will be substituted in the last part of the
  macro with the appropriate value before return.
  
  2) Make sure the "timeout" argument is casted to "int" before
  evaluating negativity. Else the signedness of a "long" might be
  checked instead of the signedness of an integer.
  
  3) The wait_event() function should not have a return value.
  
  Found by: KrishnamRaju ErapaRaju 
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/wait.h

Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h
==
--- head/sys/compat/linuxkpi/common/include/linux/wait.hThu Aug 10 
12:51:04 2017(r322354)
+++ head/sys/compat/linuxkpi/common/include/linux/wait.hThu Aug 10 
13:00:10 2017(r322355)
@@ -127,16 +127,14 @@ int linux_wait_event_common(wait_queue_head_t *, wait_
  */
 #define__wait_event_common(wqh, cond, timeout, state, lock) ({ \
DEFINE_WAIT(__wq);  \
-   const int __timeout = (timeout) < 1 ? 1 : (timeout);\
+   const int __timeout = ((int)(timeout)) < 1 ? 1 : (timeout); \
int __start = ticks;\
int __ret = 0;  \
\
for (;;) {  \
linux_prepare_to_wait(&(wqh), &__wq, state);\
-   if (cond) { \
-   __ret = 1;  \
+   if (cond)   \
break;  \
-   }   \
__ret = linux_wait_event_common(&(wqh), &__wq,  \
__timeout, state, lock);\
if (__ret != 0) \
@@ -158,10 +156,10 @@ int linux_wait_event_common(wait_queue_head_t *, wait_
__ret;  \
 })
 
-#definewait_event(wqh, cond) ({
\
-   __wait_event_common(wqh, cond, MAX_SCHEDULE_TIMEOUT,\
+#definewait_event(wqh, cond) do {  
\
+   (void) __wait_event_common(wqh, cond, MAX_SCHEDULE_TIMEOUT, \
TASK_UNINTERRUPTIBLE, NULL);\
-})
+} while (0)
 
 #definewait_event_timeout(wqh, cond, timeout) ({   
\
__wait_event_common(wqh, cond, timeout, TASK_UNINTERRUPTIBLE,   \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322354 - head/sys/compat/linuxkpi/common/src

2017-08-10 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Aug 10 12:51:04 2017
New Revision: 322354
URL: https://svnweb.freebsd.org/changeset/base/322354

Log:
  Make sure the linux_wait_event_common() function in the LinuxKPI properly
  handles a timeout value of MAX_SCHEDULE_TIMEOUT which basically means there
  is no timeout. This is a regression issue after r319757.
  
  While at it change the type of returned variable from "long" to "int" to
  match the actual return type.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/src/linux_schedule.c

Modified: head/sys/compat/linuxkpi/common/src/linux_schedule.c
==
--- head/sys/compat/linuxkpi/common/src/linux_schedule.cThu Aug 10 
12:31:55 2017(r322353)
+++ head/sys/compat/linuxkpi/common/src/linux_schedule.cThu Aug 10 
12:51:04 2017(r322354)
@@ -213,12 +213,18 @@ linux_wait_event_common(wait_queue_head_t *wqh, wait_q
 unsigned int state, spinlock_t *lock)
 {
struct task_struct *task;
-   long ret;
+   int ret;
 
if (lock != NULL)
spin_unlock_irq(lock);
 
DROP_GIANT();
+
+   /* range check timeout */
+   if (timeout < 1)
+   timeout = 1;
+   else if (timeout == MAX_SCHEDULE_TIMEOUT)
+   timeout = 0;
 
task = current;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322353 - head/usr.bin/calendar/calendars

2017-08-10 Thread Oleg Bulyzhin
Author: oleg
Date: Thu Aug 10 12:31:55 2017
New Revision: 322353
URL: https://svnweb.freebsd.org/changeset/base/322353

Log:
  Add myself.
  
  Reported by:  mckusick

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdThu Aug 10 12:30:34 
2017(r322352)
+++ head/usr.bin/calendar/calendars/calendar.freebsdThu Aug 10 12:31:55 
2017(r322353)
@@ -155,6 +155,7 @@
 04/22  Jakub Klama  born in Blachownia, Silesia, Poland, 
1989
 04/25  Richard Gallamore  born in Kissimmee, Florida, 
United States, 1987
 04/26  Rene Ladan  born in Geldrop, the Netherlands, 1980
+04/28  Oleg Bulyzhin  born in Kharkov, USSR, 1976
 04/28  Andriy Voskoboinyk  born in Bila Tserkva, Ukraine, 
1992
 04/29  Adam Weinberger  born in Berkeley, California, 
United States, 1980
 04/29  Eric Anholt  born in Portland, Oregon, United 
States, 1983
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322352 - head/release/packages

2017-08-10 Thread Glen Barber
Author: gjb
Date: Thu Aug 10 12:30:34 2017
New Revision: 322352
URL: https://svnweb.freebsd.org/changeset/base/322352

Log:
  Revise part of r322327 in release/packages/kernel.ucl.
  
  It appears I misunderstand process forking and signal handling in
  how the pre-/post-install scripts are executed internally by pkg(8).
  In some cases (not all), ^C when prompted to cancel the kernel
  package update will stop the pre-install script from executing, but
  allow pkg(8) to continue extracting the package when it is not the
  intent.
  
  In order to keep somewhat of an anti-footshooting measure in place,
  print the recommendation to install the kernel package first if
  ASSUME_ALWAYS_YES is false and TERM is set, then sleep for 5 seconds
  to allow the user to see the message.
  
  MFC after:5 days
  MFC with: r322327
  X-MFC-Note:   Maybe not until I am happy with this..
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/packages/kernel.ucl

Modified: head/release/packages/kernel.ucl
==
--- head/release/packages/kernel.uclThu Aug 10 10:59:05 2017
(r322351)
+++ head/release/packages/kernel.uclThu Aug 10 12:30:34 2017
(r322352)
@@ -25,6 +25,9 @@ scripts: {
continue
;;
esac
+   if [ -z "${TERM}" ]; then
+   exit 0
+   fi
echo ""
echo "It is recommended to install the FreeBSD-%PKGNAME% package"
echo "with:"
@@ -37,16 +40,7 @@ scripts: {
echo "  pkg upgrade"
echo
echo ""
-   echo
-   echo "Do you want to continue anyway?"
-   echo "[Enter] to continue, ^C to cancel."
-   echo
-   read ANSWER
-   case ${ANSWER} in
-   *)
-   continue
-   ;;
-   esac
+   sleep 5
 EOD
 
post-install = 

svn commit: r322351 - head/usr.sbin/acpi/acpidump

2017-08-10 Thread Alexander Motin
Author: mav
Date: Thu Aug 10 10:59:05 2017
New Revision: 322351
URL: https://svnweb.freebsd.org/changeset/base/322351

Log:
  Add two NFIT fields missed in r321298.
  
  MFC after:2 weeks

Modified:
  head/usr.sbin/acpi/acpidump/acpi.c

Modified: head/usr.sbin/acpi/acpidump/acpi.c
==
--- head/usr.sbin/acpi/acpidump/acpi.c  Thu Aug 10 09:17:16 2017
(r322350)
+++ head/usr.sbin/acpi/acpidump/acpi.c  Thu Aug 10 10:59:05 2017
(r322351)
@@ -1236,6 +1236,7 @@ acpi_print_nfit(ACPI_NFIT_HEADER *nfit)
(uintmax_t)mmap->RegionOffset);
printf("\tAddress=0x%016jx\n", (uintmax_t)mmap->Address);
printf("\tInterleaveIndex=%u\n", (u_int)mmap->InterleaveIndex);
+   printf("\tInterleaveWays=%u\n", (u_int)mmap->InterleaveWays);
 
 #define PRINTFLAG(var, flag)   printflag((var), ACPI_NFIT_MEM_## flag, #flag)
 
@@ -1283,6 +1284,7 @@ acpi_print_nfit(ACPI_NFIT_HEADER *nfit)
(u_int)ctlreg->ManufacturingDate);
printf("\tSerialNumber=%u\n",
(u_int)ctlreg->SerialNumber);
+   printf("\tCode=0x%04x\n", (u_int)ctlreg->Code);
printf("\tWindows=%u\n", (u_int)ctlreg->Windows);
printf("\tWindowSize=0x%016jx\n",
(uintmax_t)ctlreg->WindowSize);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322350 - head/usr.bin/calendar/calendars

2017-08-10 Thread Roger Pau Monné
Author: royger
Date: Thu Aug 10 09:17:16 2017
New Revision: 322350
URL: https://svnweb.freebsd.org/changeset/base/322350

Log:
  calendars: add myself to the FreeBSD calendar
  
  Reported by:  mckusick

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdThu Aug 10 09:16:40 
2017(r322349)
+++ head/usr.bin/calendar/calendars/calendar.freebsdThu Aug 10 09:17:16 
2017(r322350)
@@ -223,6 +223,7 @@
 06/06  Alan Eldridge  died in Denver, Colorado, 2003
 06/07  Jimmy Olgeni  born in Milano, Italy, 1976
 06/07  Benjamin Close  born in Adelaide, Australia, 1978
+06/07  Roger Pau Monne  born in Reus, Catalunya, Spain, 
1986
 06/08  Ravi Pokala  born in Royal Oak, Michigan, United 
States, 1980
 06/09  Stanislav Galabov  born in Sofia, Bulgaria 1978
 06/11  Alonso Cardenas Marquez  born in Arequipa, Peru, 1979
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r322349 - in head/sys/x86: acpica include x86

2017-08-10 Thread Roger Pau Monné
Author: royger
Date: Thu Aug 10 09:16:40 2017
New Revision: 322349
URL: https://svnweb.freebsd.org/changeset/base/322349

Log:
  x86: bump MAX_APIC_ID to 512
  
  Introduce a new define to take int account the xAPIC ID limit, for
  systems where x2APIC is not available/reliable.
  
  Also change some of the usages of the APIC ID to use an unsigned int
  (which is the correct storage type to deal with x2APIC IDs as found in
  x2APIC MADT entries).
  
  This allows booting FreeBSD on a box with 256 CPUs and APIC IDs up to
  295:
  
  FreeBSD/SMP: Multiprocessor System Detected: 256 CPUs
  FreeBSD/SMP: 1 package(s) x 64 core(s) x 4 hardware threads
  Package HW ID = 0
Core HW ID = 0
CPU0 (BSP): APIC ID: 0
CPU1 (AP/HT): APIC ID: 1
CPU2 (AP/HT): APIC ID: 2
CPU3 (AP/HT): APIC ID: 3
  [...]
Core HW ID = 73
CPU252 (AP): APIC ID: 292
CPU253 (AP/HT): APIC ID: 293
CPU254 (AP/HT): APIC ID: 294
CPU255 (AP/HT): APIC ID: 295
  
  Submitted by: kib (previous version)
  Relnotes: yes
  MFC after:1 month
  Reviewed by:  kib
  Differential revision:https://reviews.freebsd.org/D11913

Modified:
  head/sys/x86/acpica/madt.c
  head/sys/x86/include/apicvar.h
  head/sys/x86/x86/mp_x86.c
  head/sys/x86/x86/mptable.c

Modified: head/sys/x86/acpica/madt.c
==
--- head/sys/x86/acpica/madt.c  Thu Aug 10 09:16:03 2017(r322348)
+++ head/sys/x86/acpica/madt.c  Thu Aug 10 09:16:40 2017(r322349)
@@ -212,6 +212,14 @@ madt_setup_local(void)
}
}
 
+   /*
+* Truncate max_apic_id if not in x2APIC mode. Some structures
+* will already be allocated with the previous max_apic_id, but
+* at least we can prevent wasting more memory elsewhere.
+*/
+   if (!x2apic_mode)
+   max_apic_id = min(max_apic_id, xAPIC_MAX_APIC_ID);
+
madt = pmap_mapbios(madt_physaddr, madt_length);
lapics = malloc(sizeof(*lapics) * (max_apic_id + 1), M_MADT,
M_WAITOK | M_ZERO);
@@ -250,7 +258,7 @@ madt_setup_io(void)
panic("Using MADT but ACPI doesn't work");
}
 
-   ioapics = malloc(sizeof(*ioapics) * (MAX_APIC_ID + 1), M_MADT,
+   ioapics = malloc(sizeof(*ioapics) * (IOAPIC_MAX_ID + 1), M_MADT,
M_WAITOK | M_ZERO);
 
/* First, we run through adding I/O APIC's. */
@@ -277,7 +285,7 @@ madt_setup_io(void)
}
 
/* Third, we register all the I/O APIC's. */
-   for (i = 0; i <= MAX_APIC_ID; i++)
+   for (i = 0; i <= IOAPIC_MAX_ID; i++)
if (ioapics[i].io_apic != NULL)
ioapic_register(ioapics[i].io_apic);
 
@@ -408,7 +416,7 @@ madt_parse_apics(ACPI_SUBTABLE_HEADER *entry, void *ar
"MADT: Found IO APIC ID %u, Interrupt %u at %p\n",
apic->Id, apic->GlobalIrqBase,
(void *)(uintptr_t)apic->Address);
-   if (apic->Id > MAX_APIC_ID)
+   if (apic->Id > IOAPIC_MAX_ID)
panic("%s: I/O APIC ID %u too high", __func__,
apic->Id);
if (ioapics[apic->Id].io_apic != NULL)
@@ -501,7 +509,7 @@ madt_find_interrupt(int intr, void **apic, u_int *pin)
int i, best;
 
best = -1;
-   for (i = 0; i <= MAX_APIC_ID; i++) {
+   for (i = 0; i <= IOAPIC_MAX_ID; i++) {
if (ioapics[i].io_apic == NULL ||
ioapics[i].io_vector > intr)
continue;

Modified: head/sys/x86/include/apicvar.h
==
--- head/sys/x86/include/apicvar.h  Thu Aug 10 09:16:03 2017
(r322348)
+++ head/sys/x86/include/apicvar.h  Thu Aug 10 09:16:40 2017
(r322349)
@@ -74,8 +74,12 @@
  * I/O device!
  */
 
-#defineMAX_APIC_ID 0xfe
-#defineAPIC_ID_ALL 0xff
+#definexAPIC_MAX_APIC_ID   0xfe
+#definexAPIC_ID_ALL0xff
+#defineMAX_APIC_ID 0x200
+#defineAPIC_ID_ALL 0x
+
+#defineIOAPIC_MAX_ID   xAPIC_MAX_APIC_ID
 
 /* I/O Interrupts are used for external devices such as ISA, PCI, etc. */
 #defineAPIC_IO_INTS(IDT_IO_INTS + 16)

Modified: head/sys/x86/x86/mp_x86.c
==
--- head/sys/x86/x86/mp_x86.c   Thu Aug 10 09:16:03 2017(r322348)
+++ head/sys/x86/x86/mp_x86.c   Thu Aug 10 09:16:40 2017(r322349)
@@ -137,6 +137,10 @@ volatile int aps_ready = 0;
 struct cpu_info *cpu_info;
 int *apic_cpuids;
 int cpu_apic_ids[MAXCPU];
+_Static_assert(MAXCPU <= MAX_APIC_ID,
+"MAXCPU cannot be larger that 

svn commit: r322348 - in head/sys/x86: acpica include x86

2017-08-10 Thread Roger Pau Monné
Author: royger
Date: Thu Aug 10 09:16:03 2017
New Revision: 322348
URL: https://svnweb.freebsd.org/changeset/base/322348

Log:
  x86: make the arrays that depend on MAX_APIC_ID dynamic
  
  So that MAX_APIC_ID can be bumped without wasting memory.
  
  Note that the usage of MAX_APIC_ID in the SRAT parsing forces the
  parser to allocate memory directly from the phys_avail physical memory
  array, which is not the best approach probably, but I haven't found
  any other way to allocate memory so early in boot. This memory is not
  returned to the system afterwards, but at least it's sized according
  to the maximum APIC ID found in the MADT table.
  
  Sponsored by: Citrix Systems R
  MFC after:1 month
  Reviewed by:  kib
  Differential revision:https://reviews.freebsd.org/D11912

Modified:
  head/sys/x86/acpica/madt.c
  head/sys/x86/acpica/srat.c
  head/sys/x86/include/apicvar.h
  head/sys/x86/include/x86_smp.h
  head/sys/x86/x86/local_apic.c
  head/sys/x86/x86/mp_x86.c

Modified: head/sys/x86/acpica/madt.c
==
--- head/sys/x86/acpica/madt.c  Thu Aug 10 09:15:18 2017(r322347)
+++ head/sys/x86/acpica/madt.c  Thu Aug 10 09:16:03 2017(r322348)
@@ -59,7 +59,7 @@ static struct {
 static struct lapic_info {
u_int la_enabled;
u_int la_acpi_id;
-} lapics[MAX_APIC_ID + 1];
+} *lapics;
 
 int madt_found_sci_override;
 static ACPI_TABLE_MADT *madt;
@@ -141,8 +141,6 @@ madt_setup_local(void)
int user_x2apic;
bool bios_x2apic;
 
-   madt = pmap_mapbios(madt_physaddr, madt_length);
-   madt_walk_table(madt_setup_cpus_handler, NULL);
if ((cpu_feature2 & CPUID2_X2APIC) != 0) {
reason = NULL;
 
@@ -214,6 +212,11 @@ madt_setup_local(void)
}
}
 
+   madt = pmap_mapbios(madt_physaddr, madt_length);
+   lapics = malloc(sizeof(*lapics) * (max_apic_id + 1), M_MADT,
+   M_WAITOK | M_ZERO);
+   madt_walk_table(madt_setup_cpus_handler, NULL);
+
lapic_init(madt->Address);
printf("ACPI APIC Table: <%.*s %.*s>\n",
(int)sizeof(madt->Header.OemId), madt->Header.OemId,
@@ -236,6 +239,8 @@ madt_setup_io(void)
u_int pin;
int i;
 
+   KASSERT(lapics != NULL, ("local APICs not initialized"));
+
/* Try to initialize ACPI so that we can access the FADT. */
i = acpi_Startup();
if (ACPI_FAILURE(i)) {
@@ -282,6 +287,10 @@ madt_setup_io(void)
free(ioapics, M_MADT);
ioapics = NULL;
 
+   /* NB: this is the last use of the lapics array. */
+   free(lapics, M_MADT);
+   lapics = NULL;
+
return (0);
 }
 
@@ -332,7 +341,7 @@ madt_add_cpu(u_int acpi_id, u_int apic_id, u_int flags
"enabled" : "disabled");
if (!(flags & ACPI_MADT_ENABLED))
return;
-   if (apic_id > MAX_APIC_ID) {
+   if (apic_id > max_apic_id) {
printf("MADT: Ignoring local APIC ID %u (too high)\n",
apic_id);
return;
@@ -471,7 +480,7 @@ madt_find_cpu(u_int acpi_id, u_int *apic_id)
 {
int i;
 
-   for (i = 0; i <= MAX_APIC_ID; i++) {
+   for (i = 0; i <= max_apic_id; i++) {
if (!lapics[i].la_enabled)
continue;
if (lapics[i].la_acpi_id != acpi_id)
@@ -723,6 +732,9 @@ madt_set_ids(void *dummy)
 
if (madt == NULL)
return;
+
+   KASSERT(lapics != NULL, ("local APICs not initialized"));
+
CPU_FOREACH(i) {
pc = pcpu_find(i);
KASSERT(pc != NULL, ("no pcpu data for CPU %u", i));

Modified: head/sys/x86/acpica/srat.c
==
--- head/sys/x86/acpica/srat.c  Thu Aug 10 09:15:18 2017(r322347)
+++ head/sys/x86/acpica/srat.c  Thu Aug 10 09:16:03 2017(r322348)
@@ -55,11 +55,11 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #if MAXMEMDOM > 1
-struct cpu_info {
+static struct cpu_info {
int enabled:1;
int has_memory:1;
int domain;
-} cpus[MAX_APIC_ID + 1];
+} *cpus;
 
 struct mem_affinity mem_info[VM_PHYSSEG_MAX + 1];
 int num_mem;
@@ -204,7 +204,7 @@ srat_parse_entry(ACPI_SUBTABLE_HEADER *entry, void *ar
"enabled" : "disabled");
if (!(cpu->Flags & ACPI_SRAT_CPU_ENABLED))
break;
-   if (cpu->ApicId > MAX_APIC_ID) {
+   if (cpu->ApicId > max_apic_id) {
printf("SRAT: Ignoring local APIC ID %u (too high)\n",
cpu->ApicId);
break;
@@ -228,7 +228,7 @@ srat_parse_entry(ACPI_SUBTABLE_HEADER *entry, void *ar
"enabled" : "disabled");
if (!(x2apic->Flags & ACPI_SRAT_CPU_ENABLED))
break;
-   if 

svn commit: r322347 - in head/sys/x86: acpica include x86 xen

2017-08-10 Thread Roger Pau Monné
Author: royger
Date: Thu Aug 10 09:15:18 2017
New Revision: 322347
URL: https://svnweb.freebsd.org/changeset/base/322347

Log:
  apic_enumerator: only set mp_ncpus and mp_maxid at probe cpus phase
  
  Populate the lapics arrays and call cpu_add/lapic_create in the setup
  phase instead. Also store the max APIC ID found in the newly
  introduced max_apic_id global variable.
  
  This is a requirement in order to make the static arrays currently
  using MAX_LAPIC_ID dynamic.
  
  Sponsored by: Citrix Systems R
  MFC after:1 month
  Reviewed by:  kib
  Differential revision:https://reviews.freebsd.org/D11911

Modified:
  head/sys/x86/acpica/madt.c
  head/sys/x86/acpica/srat.c
  head/sys/x86/include/x86_var.h
  head/sys/x86/x86/local_apic.c
  head/sys/x86/x86/mp_x86.c
  head/sys/x86/x86/mptable.c
  head/sys/x86/xen/pvcpu_enum.c

Modified: head/sys/x86/acpica/madt.c
==
--- head/sys/x86/acpica/madt.c  Thu Aug 10 09:02:44 2017(r322346)
+++ head/sys/x86/acpica/madt.c  Thu Aug 10 09:15:18 2017(r322347)
@@ -83,6 +83,8 @@ static intmadt_probe(void);
 static int madt_probe_cpus(void);
 static voidmadt_probe_cpus_handler(ACPI_SUBTABLE_HEADER *entry,
void *arg __unused);
+static voidmadt_setup_cpus_handler(ACPI_SUBTABLE_HEADER *entry,
+   void *arg __unused);
 static voidmadt_register(void *dummy);
 static int madt_setup_local(void);
 static int madt_setup_io(void);
@@ -140,6 +142,7 @@ madt_setup_local(void)
bool bios_x2apic;
 
madt = pmap_mapbios(madt_physaddr, madt_length);
+   madt_walk_table(madt_setup_cpus_handler, NULL);
if ((cpu_feature2 & CPUID2_X2APIC) != 0) {
reason = NULL;
 
@@ -302,6 +305,19 @@ madt_walk_table(acpi_subtable_handler *handler, void *
 }
 
 static void
+madt_parse_cpu(unsigned int apic_id, unsigned int flags)
+{
+
+   if (!(flags & ACPI_MADT_ENABLED) || mp_ncpus == MAXCPU ||
+   apic_id > MAX_APIC_ID)
+   return;
+
+   mp_ncpus++;
+   mp_maxid = mp_ncpus - 1;
+   max_apic_id = max(apic_id, max_apic_id);
+}
+
+static void
 madt_add_cpu(u_int acpi_id, u_int apic_id, u_int flags)
 {
struct lapic_info *la;
@@ -331,6 +347,24 @@ madt_add_cpu(u_int acpi_id, u_int apic_id, u_int flags
 
 static void
 madt_probe_cpus_handler(ACPI_SUBTABLE_HEADER *entry, void *arg)
+{
+   ACPI_MADT_LOCAL_APIC *proc;
+   ACPI_MADT_LOCAL_X2APIC *x2apic;
+
+   switch (entry->Type) {
+   case ACPI_MADT_TYPE_LOCAL_APIC:
+   proc = (ACPI_MADT_LOCAL_APIC *)entry;
+   madt_parse_cpu(proc->Id, proc->LapicFlags);
+   break;
+   case ACPI_MADT_TYPE_LOCAL_X2APIC:
+   x2apic = (ACPI_MADT_LOCAL_X2APIC *)entry;
+   madt_parse_cpu(x2apic->LocalApicId, x2apic->LapicFlags);
+   break;
+   }
+}
+
+static void
+madt_setup_cpus_handler(ACPI_SUBTABLE_HEADER *entry, void *arg)
 {
ACPI_MADT_LOCAL_APIC *proc;
ACPI_MADT_LOCAL_X2APIC *x2apic;

Modified: head/sys/x86/acpica/srat.c
==
--- head/sys/x86/acpica/srat.c  Thu Aug 10 09:02:44 2017(r322346)
+++ head/sys/x86/acpica/srat.c  Thu Aug 10 09:15:18 2017(r322347)
@@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 
 #include 

Modified: head/sys/x86/include/x86_var.h
==
--- head/sys/x86/include/x86_var.h  Thu Aug 10 09:02:44 2017
(r322346)
+++ head/sys/x86/include/x86_var.h  Thu Aug 10 09:15:18 2017
(r322347)
@@ -78,6 +78,7 @@ externint _ufssel;
 extern int _ugssel;
 extern int use_xsave;
 extern uint64_t xsave_mask;
+extern u_int   max_apic_id;
 
 struct pcb;
 struct thread;

Modified: head/sys/x86/x86/local_apic.c
==
--- head/sys/x86/x86/local_apic.c   Thu Aug 10 09:02:44 2017
(r322346)
+++ head/sys/x86/x86/local_apic.c   Thu Aug 10 09:15:18 2017
(r322347)
@@ -184,6 +184,7 @@ static struct eventtimer lapic_et;
 #ifdef SMP
 static uint64_t lapic_ipi_wait_mult;
 #endif
+unsigned int max_apic_id;
 
 SYSCTL_NODE(_hw, OID_AUTO, apic, CTLFLAG_RD, 0, "APIC options");
 SYSCTL_INT(_hw_apic, OID_AUTO, x2apic_mode, CTLFLAG_RD, _mode, 0, "");

Modified: head/sys/x86/x86/mp_x86.c
==
--- head/sys/x86/x86/mp_x86.c   Thu Aug 10 09:02:44 2017(r322346)
+++ head/sys/x86/x86/mp_x86.c   Thu Aug 10 09:15:18 2017(r322347)
@@ -825,10 +825,6 @@ cpu_add(u_int apic_id, char boot_cpu)
boot_cpu_id = apic_id;
cpu_info[apic_id].cpu_bsp = 1;
}
-   if (mp_ncpus < 

Re: svn commit: r322318 - in head: share/man/man4 sys/conf sys/geom

2017-08-10 Thread Bruce Evans

On Wed, 9 Aug 2017, Warner Losh wrote:


Log:
 Mark geom classes as deprecated.

 geom_bsd, geom_mbr and geom_sunlabel have been obsolete since Marcel
 Moolenaar's geom_part was in FreeBSD 7. They haven't been in GENERIC
 since FreeBSD 8. Add warning when used.

 geom_vol_ffs has been obsolete since ufs support to geom_label was
 committed in FreeBSD 5. It hasn't been in GENERIC since FreeBSD 5.
 Add warning when used.

 geom_fox has been obsolete since gmultipath was committed in FreeBSD 7.
 (no warning added, since this is a very obscure class).

 These will all be removed in FreeBSD 12.


geom_bsd (and possibly geom_mbr) can't be remove because they provide more
features than geom_part*.

The only loss that I noticed is for nested partitions on a backup drive:

GEOM_BSD + GEOM_MBR gives:

da1 da1s4aa da1s4be da1s4cs3d   da1s4e
da1s1   da1s4ac da1s4c  da1s4cs4da1s4f
da1s1a  da1s4ad da1s4cs1da1s4cs4a   da1s4g
da1s1c  da1s4b  da1s4cs2da1s4cs4c
da1s3   da1s4ba da1s4cs3da1s4cs4d
da1s4   da1s4bc da1s4cs3a   da1s4cs4e
da1s4a  da1s4bd da1s4cs3c   da1s4d

Here da1s4 = da1s4c contains an image backup of a whole drive modified
to hold a BSD label in the second sector.  The first sector contains
a copy of the MBR of the original drive, with offsets adjusted.  This
works right nested, but can only point to 4 slices.  The BSD label
points to these 4 and has 2 extras (for damaged and/or recovery areas).

The nested MBR gives slices da1s4cs[1-4].  da1s4cs[3-4] are BSD slices
containing nested labels.  These give the nested partitions
da1s4cs[3-4][a-h].

The BSD label in da1s4 gives aliases for da1s4cs[1-4].  2 of these
are for BSD slices (da1s4a == da1s4cs3 and da1s4b == da1s4cs4).  Nested
labels in these give the nested alasias da1s4[a-b][a-h].

GEOM_PART_BSD + GEOM_PART_EBR + GEM_PART_EBR_COMPAT + GEOM_PART_MBR only
gives:

da1 da1s1a  da1s4   da1s4b  da1s4e  da1s4g
da1s1   da1s3   da1s4a  da1s4d  da1s4f

It doesn't give any nesting.  It doesn't create 'c' devices for this or
any other drive.

Nesting and aliases give large complications, and I don't like even the
2-level MBR+label nesting that I normally use, but the above is what
turned up naturally and it is too hard to untangle it.

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