svn commit: r331981 - head/sys/dev/vt

2018-04-03 Thread Gordon Tetlow
Author: gordon
Date: Wed Apr  4 05:21:46 2018
New Revision: 331981
URL: https://svnweb.freebsd.org/changeset/base/331981

Log:
  Limit glyph count in vtfont_load to avoid integer overflow.
  
  Invalid font data passed to PIO_VFONT can result in an integer overflow
  in glyphsize.  Characters may then be drawn on the console using glyph
  map entries that point beyond the end of allocated glyph memory,
  resulting in a kernel memory disclosure.
  
  Submitted by: emaste
  Reported by:  Dr. Silvio Cesare of InfoSect
  Security: CVE-2018-6917
  Security: FreeBSD-SA-18:04.vt
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/vt/vt_font.c

Modified: head/sys/dev/vt/vt_font.c
==
--- head/sys/dev/vt/vt_font.c   Wed Apr  4 04:26:21 2018(r331980)
+++ head/sys/dev/vt/vt_font.c   Wed Apr  4 05:21:46 2018(r331981)
@@ -44,6 +44,7 @@ static MALLOC_DEFINE(M_VTFONT, "vtfont", "vt font");
 
 /* Some limits to prevent abnormal fonts from being loaded. */
 #defineVTFONT_MAXMAPPINGS  65536
+#defineVTFONT_MAXGLYPHS131072
 #defineVTFONT_MAXGLYPHSIZE 2097152
 #defineVTFONT_MAXDIMENSION 128
 
@@ -173,7 +174,8 @@ vtfont_load(vfnt_t *f, struct vt_font **ret)
/* Make sure the dimensions are valid. */
if (f->width < 1 || f->height < 1)
return (EINVAL);
-   if (f->width > VTFONT_MAXDIMENSION || f->height > VTFONT_MAXDIMENSION)
+   if (f->width > VTFONT_MAXDIMENSION || f->height > VTFONT_MAXDIMENSION ||
+   f->glyph_count > VTFONT_MAXGLYPHS)
return (E2BIG);
 
/* Not too many mappings. */
___
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: r331976 - head/sys/modules/cam

2018-04-03 Thread Warner Losh
Author: imp
Date: Wed Apr  4 02:37:05 2018
New Revision: 331976
URL: https://svnweb.freebsd.org/changeset/base/331976

Log:
  Add nvme_da back.
  
  Now that it can co-exist in the kernel with nvd, add it back to the
  cam module.
  
  Sponsored by: Netflix

Modified:
  head/sys/modules/cam/Makefile

Modified: head/sys/modules/cam/Makefile
==
--- head/sys/modules/cam/Makefile   Wed Apr  4 02:35:48 2018
(r331975)
+++ head/sys/modules/cam/Makefile   Wed Apr  4 02:37:05 2018
(r331976)
@@ -46,6 +46,7 @@ SRCS+=ata_machdep.c
 SRCS+= ata_pmp.c
 SRCS+= nvme_all.c
 SRCS+= nvme_xpt.c
+SRCS+= nvme_da.c
 
 EXPORT_SYMS=   YES # XXX evaluate
 
___
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: r331975 - head/sys/sys

2018-04-03 Thread Warner Losh
Author: imp
Date: Wed Apr  4 02:35:48 2018
New Revision: 331975
URL: https://svnweb.freebsd.org/changeset/base/331975

Log:
  Fix minor whitespace nits

Modified:
  head/sys/sys/module.h

Modified: head/sys/sys/module.h
==
--- head/sys/sys/module.h   Wed Apr  4 02:31:14 2018(r331974)
+++ head/sys/sys/module.h   Wed Apr  4 02:35:48 2018(r331975)
@@ -141,7 +141,7 @@ struct mod_pnp_match_info 
 
 #defineDECLARE_MODULE_WITH_MAXVER(name, data, sub, order, maxver)  
\
MODULE_DEPEND(name, kernel, __FreeBSD_version,  \
-   __FreeBSD_version, maxver); \
+   __FreeBSD_version, maxver); \
MODULE_METADATA(_md_##name, MDT_MODULE, , __XSTRING(name));\
SYSINIT(name##module, sub, order, module_register_init, ); \
struct __hack
@@ -156,7 +156,7 @@ struct mod_pnp_match_info 
  * Use it for modules that use kernel interfaces that are not stable
  * even on STABLE/X branches.
  */
-#defineDECLARE_MODULE_TIED(name, data, sub, order) 
\
+#defineDECLARE_MODULE_TIED(name, data, sub, order) 
\
DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, __FreeBSD_version)
 
 #defineMODULE_VERSION_CONCAT(module, version)  _##module##_version
___
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: r331970 - head/sys/powerpc/booke

2018-04-03 Thread Justin Hibbits
Author: jhibbits
Date: Wed Apr  4 02:13:27 2018
New Revision: 331970
URL: https://svnweb.freebsd.org/changeset/base/331970

Log:
  Correct the ilog2() for calculating memory sizes.
  
  TLB1 can handle ranges up to 4GB (through e5500, larger in e6500), but
  ilog2() took a unsigned int, which maxes out at 4GB-1, but truncates
  silently.  Increase the input range to the largest supported, at least for
  64-bit targets.  This lets the DMAP be completely mapped, instead of only
  1GB blocks with it assuming being fully mapped.

Modified:
  head/sys/powerpc/booke/pmap.c

Modified: head/sys/powerpc/booke/pmap.c
==
--- head/sys/powerpc/booke/pmap.c   Wed Apr  4 02:00:10 2018
(r331969)
+++ head/sys/powerpc/booke/pmap.c   Wed Apr  4 02:13:27 2018
(r331970)
@@ -234,7 +234,7 @@ static vm_size_t tlb1_mapin_region(vm_offset_t, vm_pad
 
 static vm_size_t tsize2size(unsigned int);
 static unsigned int size2tsize(vm_size_t);
-static unsigned int ilog2(unsigned int);
+static unsigned int ilog2(unsigned long);
 
 static void set_mas4_defaults(void);
 
@@ -4020,12 +4020,17 @@ tlb1_write_entry(tlb_entry_t *e, unsigned int idx)
  * Return the largest uint value log such that 2^log <= num.
  */
 static unsigned int
-ilog2(unsigned int num)
+ilog2(unsigned long num)
 {
-   int lz;
+   long lz;
 
+#ifdef __powerpc64__
+   __asm ("cntlzd %0, %1" : "=r" (lz) : "r" (num));
+   return (63 - lz);
+#else
__asm ("cntlzw %0, %1" : "=r" (lz) : "r" (num));
return (31 - lz);
+#endif
 }
 
 /*
@@ -4163,7 +4168,8 @@ tlb1_mapin_region(vm_offset_t va, vm_paddr_t pa, vm_si
 
for (idx = 0; idx < nents; idx++) {
pgsz = pgs[idx];
-   debugf("%u: %llx -> %x, size=%x\n", idx, pa, va, pgsz);
+   debugf("%u: %llx -> %jx, size=%jx\n", idx, pa,
+   (uintmax_t)va, (uintmax_t)pgsz);
tlb1_set_entry(va, pa, pgsz,
_TLB_ENTRY_SHARED | _TLB_ENTRY_MEM);
pa += pgsz;
___
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: r331969 - head/include

2018-04-03 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Apr  4 02:00:10 2018
New Revision: 331969
URL: https://svnweb.freebsd.org/changeset/base/331969

Log:
  pthread.h: drop nullability attributes.
  
  These have been found to be practically useless. We were actually
  following the Android bionic library and had some interest in replicating
  the same warnings and behaviour but Android has since removed them.
  
  We are still keeping some uses of nullability attributes in other headers,
  somewhat in line with Apple's libc.
  
  MFC after:1 week
  Hinted by: bionic (git 3f66e74b903905e763e104396aff52a81718cfde)

Modified:
  head/include/pthread.h

Modified: head/include/pthread.h
==
--- head/include/pthread.h  Wed Apr  4 01:56:46 2018(r331968)
+++ head/include/pthread.h  Wed Apr  4 02:00:10 2018(r331969)
@@ -48,8 +48,6 @@
 #include 
 #include 
 
-__NULLABILITY_PRAGMA_PUSH
-
 /*
  * Run-time invariant values:
  */
@@ -151,34 +149,33 @@ struct _pthread_cleanup_info {
  */
 __BEGIN_DECLS
 intpthread_atfork(void (*)(void), void (*)(void), void (*)(void));
-intpthread_attr_destroy(pthread_attr_t * _Nonnull);
+intpthread_attr_destroy(pthread_attr_t *);
 intpthread_attr_getstack(
-   const pthread_attr_t * _Nonnull __restrict, 
-   void ** _Nonnull __restrict,
-   size_t * _Nonnull __restrict);
-intpthread_attr_getstacksize(const pthread_attr_t * _Nonnull,
-   size_t * _Nonnull);
-intpthread_attr_getguardsize(const pthread_attr_t * _Nonnull,
-   size_t * _Nonnull);
+   const pthread_attr_t * __restrict, void ** __restrict,
+   size_t * __restrict);
+intpthread_attr_getstacksize(const pthread_attr_t *,
+   size_t *);
+intpthread_attr_getguardsize(const pthread_attr_t *,
+   size_t *);
 intpthread_attr_getstackaddr(const pthread_attr_t *, void **);
-intpthread_attr_getdetachstate(const pthread_attr_t * _Nonnull,
-   int * _Nonnull);
-intpthread_attr_init(pthread_attr_t * _Nonnull);
-intpthread_attr_setstacksize(pthread_attr_t * _Nonnull, size_t);
-intpthread_attr_setguardsize(pthread_attr_t * _Nonnull, size_t);
-intpthread_attr_setstack(pthread_attr_t * _Nonnull, void *,
+intpthread_attr_getdetachstate(const pthread_attr_t *,
+   int *);
+intpthread_attr_init(pthread_attr_t *);
+intpthread_attr_setstacksize(pthread_attr_t *, size_t);
+intpthread_attr_setguardsize(pthread_attr_t *, size_t);
+intpthread_attr_setstack(pthread_attr_t *, void *,
size_t);
 intpthread_attr_setstackaddr(pthread_attr_t *, void *);
-intpthread_attr_setdetachstate(pthread_attr_t * _Nonnull, int);
-intpthread_barrier_destroy(pthread_barrier_t * _Nonnull);
-intpthread_barrier_init(pthread_barrier_t * _Nonnull,
+intpthread_attr_setdetachstate(pthread_attr_t *, int);
+intpthread_barrier_destroy(pthread_barrier_t *);
+intpthread_barrier_init(pthread_barrier_t *,
const pthread_barrierattr_t *, unsigned);
-intpthread_barrier_wait(pthread_barrier_t * _Nonnull);
-intpthread_barrierattr_destroy(pthread_barrierattr_t * _Nonnull);
+intpthread_barrier_wait(pthread_barrier_t *);
+intpthread_barrierattr_destroy(pthread_barrierattr_t *);
 intpthread_barrierattr_getpshared(
-   const pthread_barrierattr_t * _Nonnull, int * _Nonnull);
-intpthread_barrierattr_init(pthread_barrierattr_t * _Nonnull);
-intpthread_barrierattr_setpshared(pthread_barrierattr_t * _Nonnull,
+   const pthread_barrierattr_t *, int *);
+intpthread_barrierattr_init(pthread_barrierattr_t *);
+intpthread_barrierattr_setpshared(pthread_barrierattr_t *,
int);
 
 #definepthread_cleanup_push(cleanup_routine, cleanup_arg)  
\
@@ -194,108 +191,107 @@ int 
pthread_barrierattr_setpshared(pthread_barrieratt
__pthread_cleanup_pop_imp(execute); 
\
}
 
-intpthread_condattr_destroy(pthread_condattr_t * _Nonnull);
-intpthread_condattr_getclock(const pthread_condattr_t * _Nonnull,
-   clockid_t * _Nonnull);
-intpthread_condattr_getpshared(const pthread_condattr_t * _Nonnull,
-   int * _Nonnull);
-intpthread_condattr_init(pthread_condattr_t * _Nonnull);
-intpthread_condattr_setclock(pthread_condattr_t * _Nonnull,
+int

svn commit: r331967 - head/sys/arm64/arm64

2018-04-03 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Wed Apr  4 01:13:28 2018
New Revision: 331967
URL: https://svnweb.freebsd.org/changeset/base/331967

Log:
  Fix arm64 buildkernel target with "nooptions KDB"
  
  Make kdb_trap in breakpoint exception handler conditional. If "options KDB"
  is not present just panic with message that debugger is not enabled.
  
  PR:   224653

Modified:
  head/sys/arm64/arm64/trap.c

Modified: head/sys/arm64/arm64/trap.c
==
--- head/sys/arm64/arm64/trap.c Tue Apr  3 23:49:35 2018(r331966)
+++ head/sys/arm64/arm64/trap.c Wed Apr  4 01:13:28 2018(r331967)
@@ -323,8 +323,12 @@ do_el1h_sync(struct thread *td, struct trapframe *fram
break;
}
 #endif
+#ifdef KDB
kdb_trap(exception, 0,
(td->td_frame != NULL) ? td->td_frame : frame);
+#else
+   panic("No debugger in kernel.\n");
+#endif
frame->tf_elr += 4;
break;
case EXCP_WATCHPT_EL1:
___
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: r331961 - in head/sys: arm/mv dts/arm

2018-04-03 Thread Marcin Wojtas
Hi Manu,

2018-04-04 0:28 GMT+02:00 Emmanuel Vadot :
> On 2018-04-04 00:21, Marcin Wojtas wrote:
>>
>> Author: mw
>> Date: Tue Apr  3 22:21:12 2018
>> New Revision: 331961
>> URL: https://svnweb.freebsd.org/changeset/base/331961
>>
>> Log:
>>   Make Marvell AmadaXP timer driver more generic
>>
>>   Store pointers to SoC specific functions in mv_timer_config structure
>>   and determine proper config in runtime based on compatible string from
>> FDT.
>>   Compatible string for ArmadaXP timers is changed to match Linux FDT.
>>   Armada 38x uses generic Cortex-A9 timer and separate watchdog drivers,
>> so
>>   it does not need to be supported by timer driver.
>>
>>   Submitted by: Rafal Kozik 
>>   Reviewed by: manu
>>   Obtained from: Semihalf
>>   Sponsored by: Stormshield
>>   Differential Revision: https://reviews.freebsd.org/D14741
>
>
>  Hello Marcin,
>
>  I've only reviewed the DTS part.

Right, forgot to add note - sorry.

>  Also you didn't address andrew@ comment, see
> https://reviews.freebsd.org/D14741?id=40452#inline-89719
>

I took the wrong patch version initially (it was fixed in phabricator
long time ago). I applied this improvemnet in r331965.

Thanks,
Marcin
___
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: r331966 - in head/sys: arm/mv dev/ahci

2018-04-03 Thread Marcin Wojtas
Author: mw
Date: Tue Apr  3 23:49:35 2018
New Revision: 331966
URL: https://svnweb.freebsd.org/changeset/base/331966

Log:
  Fix kernel modules names for Marvell armv7
  
  Two modules with the same name cannot be loaded, so Marvell specific drivers
  cannot have the same name as the generic drivers.
  Files with the same name, even in different folders overlaps their .o files,
  so in order to prepare for supporting Marvell platforms in GENERIC armv7
  config, modify conflicting names.
  
  Submitted by: Rafal Kozik 
  Obtained from: Semihalf
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D14743

Modified:
  head/sys/arm/mv/timer.c
  head/sys/dev/ahci/ahci_mv_fdt.c

Modified: head/sys/arm/mv/timer.c
==
--- head/sys/arm/mv/timer.c Tue Apr  3 23:29:34 2018(r331965)
+++ head/sys/arm/mv/timer.c Tue Apr  3 23:49:35 2018(r331966)
@@ -289,7 +289,7 @@ static driver_t mv_timer_driver = {
 
 static devclass_t mv_timer_devclass;
 
-DRIVER_MODULE(timer, simplebus, mv_timer_driver, mv_timer_devclass, 0, 0);
+DRIVER_MODULE(timer_mv, simplebus, mv_timer_driver, mv_timer_devclass, 0, 0);
 
 static unsigned
 mv_timer_get_timecount(struct timecounter *tc)

Modified: head/sys/dev/ahci/ahci_mv_fdt.c
==
--- head/sys/dev/ahci/ahci_mv_fdt.c Tue Apr  3 23:29:34 2018
(r331965)
+++ head/sys/dev/ahci/ahci_mv_fdt.c Tue Apr  3 23:49:35 2018
(r331966)
@@ -151,5 +151,5 @@ static driver_t ahci_driver = {
sizeof(struct ahci_controller)
 };
 
-DRIVER_MODULE(ahci, simplebus, ahci_driver, ahci_devclass, NULL, NULL);
-DRIVER_MODULE(ahci, ofwbus, ahci_driver, ahci_devclass, NULL, NULL);
+DRIVER_MODULE(ahci_mv, simplebus, ahci_driver, ahci_devclass, NULL, NULL);
+DRIVER_MODULE(ahci_mv, ofwbus, ahci_driver, ahci_devclass, NULL, NULL);
___
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: r331965 - head/sys/arm/mv

2018-04-03 Thread Marcin Wojtas
Author: mw
Date: Tue Apr  3 23:29:34 2018
New Revision: 331965
URL: https://svnweb.freebsd.org/changeset/base/331965

Log:
  Split out delay code in Marvell timer driver for PLATFORM
  
  The PLATFORM code will perform the software loop in the early boot,
  so extract the actual delay code to handle situation, when
  the timers are already initialized.
  
  Obtained from: Semihalf
  Sponsored by: Stormshield

Modified:
  head/sys/arm/mv/timer.c

Modified: head/sys/arm/mv/timer.c
==
--- head/sys/arm/mv/timer.c Tue Apr  3 23:27:07 2018(r331964)
+++ head/sys/arm/mv/timer.c Tue Apr  3 23:29:34 2018(r331965)
@@ -124,9 +124,7 @@ static void mv_watchdog_enable_armadaxp(void);
 static void mv_watchdog_disable_armv5(void);
 static void mv_watchdog_disable_armadaxp(void);
 
-#ifdef PLATFORM
-void mv_delay(int usec, void* arg);
-#endif
+static void mv_delay(int usec, void* arg);
 
 static struct mv_timer_config timer_armadaxp_config =
 {
@@ -300,25 +298,12 @@ mv_timer_get_timecount(struct timecounter *tc)
return (INITIAL_TIMECOUNTER - mv_get_timer(1));
 }
 
-#ifdef PLATFORM
-void
+static void
 mv_delay(int usec, void* arg)
-#else
-void
-DELAY(int usec)
-#endif
 {
uint32_tval, val_temp;
int32_t nticks;
 
-   if (!timers_initialized) {
-   for (; usec > 0; usec--)
-   for (val = 100; val > 0; val--)
-   __asm __volatile("nop" ::: "memory");
-   return;
-   }
-   TSENTER();
-
val = mv_get_timer(1);
nticks = ((timer_softc->config->clock_src / 100 + 1) * usec);
 
@@ -331,8 +316,25 @@ DELAY(int usec)
 
val = val_temp;
}
-   TSEXIT();
 }
+
+#ifndef PLATFORM
+void
+DELAY(int usec)
+{
+   uint32_tval;
+
+   if (!timers_initialized) {
+   for (; usec > 0; usec--)
+   for (val = 100; val > 0; val--)
+   __asm __volatile("nop" ::: "memory");
+   } else {
+   TSENTER();
+   mv_delay(usec, NULL);
+   TSEXIT();
+   }
+}
+#endif
 
 static uint32_t
 mv_get_timer_control(void)
___
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: r331964 - head/sys/arm/mv

2018-04-03 Thread Marcin Wojtas
Author: mw
Date: Tue Apr  3 23:27:07 2018
New Revision: 331964
URL: https://svnweb.freebsd.org/changeset/base/331964

Log:
  Add missing flag check in Marvell PCIE driver
  
  Flag was introduced in r331953, but eventually not used.
  
  Obtained from: Semihalf
  Sponsored by: Stormshield

Modified:
  head/sys/arm/mv/mv_pci.c

Modified: head/sys/arm/mv/mv_pci.c
==
--- head/sys/arm/mv/mv_pci.cTue Apr  3 23:11:08 2018(r331963)
+++ head/sys/arm/mv/mv_pci.cTue Apr  3 23:27:07 2018(r331964)
@@ -560,7 +560,8 @@ mv_pcib_enable(struct mv_pcib_softc *sc, uint32_t unit
/*
 * Check if PCIE device is enabled.
 */
-   if (read_cpu_ctrl(CPU_CONTROL) & CPU_CONTROL_PCIE_DISABLE(unit)) {
+   if ((sc->sc_skip_enable_procedure == 0) &&
+   (read_cpu_ctrl(CPU_CONTROL) & CPU_CONTROL_PCIE_DISABLE(unit))) {
write_cpu_ctrl(CPU_CONTROL, read_cpu_ctrl(CPU_CONTROL) &
~(CPU_CONTROL_PCIE_DISABLE(unit)));
 
@@ -1057,7 +1058,7 @@ mv_pcib_root_slot(device_t dev, u_int bus, u_int slot,
struct mv_pcib_softc *sc = device_get_softc(dev);
uint32_t vendor, device;
 
-/* On platforms other than Armada38x, root link is always at slot 0 */
+   /* On platforms other than Armada38x, root link is always at slot 0 */
if (!sc->sc_enable_find_root_slot)
return (slot == 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: r331963 - in head/share: examples/etc mk

2018-04-03 Thread Jung-uk Kim
Author: jkim
Date: Tue Apr  3 23:11:08 2018
New Revision: 331963
URL: https://svnweb.freebsd.org/changeset/base/331963

Log:
  Catch up with Clang 6.0.
  
  MFC after:3 days

Modified:
  head/share/examples/etc/make.conf
  head/share/mk/bsd.cpu.mk

Modified: head/share/examples/etc/make.conf
==
--- head/share/examples/etc/make.conf   Tue Apr  3 22:49:58 2018
(r331962)
+++ head/share/examples/etc/make.conf   Tue Apr  3 23:11:08 2018
(r331963)
@@ -45,7 +45,8 @@
 # Additionally the following CPU types are recognized by clang:
 #   Intel x86 architecture (for both amd64 and i386):
 #   (AMD CPUs) znver1, bdver4, bdver3, bdver2, bdver1, btver2, btver1
-#   (Intel CPUs)   skylake, knl, broadwell, haswell, ivybridge,
+#   (Intel CPUs)   cannonlake, knm, skylake-avx512, knl, goldmont,
+#  skylake, broadwell, haswell, ivybridge,
 #  sandybridge, westmere, nehalem, silvermont, bonnell
 #
 # (?= allows to buildworld for a different CPUTYPE.)

Modified: head/share/mk/bsd.cpu.mk
==
--- head/share/mk/bsd.cpu.mkTue Apr  3 22:49:58 2018(r331962)
+++ head/share/mk/bsd.cpu.mkTue Apr  3 23:11:08 2018(r331963)
@@ -199,14 +199,16 @@ MACHINE_CPU = 3dnow mmx k6 k5 i586
 MACHINE_CPU = mmx k6 k5 i586
 .  elif ${CPUTYPE} == "k5"
 MACHINE_CPU = k5 i586
-.  elif ${CPUTYPE} == "skylake" || ${CPUTYPE} == "knl"
+.  elif ${CPUTYPE} == "cannonlake" || ${CPUTYPE} == "knm" || \
+${CPUTYPE} == "skylake-avx512" || ${CPUTYPE} == "knl"
 MACHINE_CPU = avx512 avx2 avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586
-.  elif ${CPUTYPE} == "broadwell" || ${CPUTYPE} == "haswell"
+.  elif ${CPUTYPE} == "skylake" || ${CPUTYPE} == "broadwell" || \
+${CPUTYPE} == "haswell"
 MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586
 .  elif ${CPUTYPE} == "ivybridge" || ${CPUTYPE} == "sandybridge"
 MACHINE_CPU = avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586
-.  elif ${CPUTYPE} == "westmere" || ${CPUTYPE} == "nehalem" || \
-${CPUTYPE} == "silvermont"
+.  elif ${CPUTYPE} == "goldmont" || ${CPUTYPE} == "westmere" || \
+${CPUTYPE} == "nehalem" || ${CPUTYPE} == "silvermont"
 MACHINE_CPU = sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586
 .  elif ${CPUTYPE} == "penryn"
 MACHINE_CPU = sse41 ssse3 sse3 sse2 sse i686 mmx i586
@@ -260,14 +262,16 @@ MACHINE_CPU = k8 3dnow sse3
 .  elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || \
 ${CPUTYPE} == "athlon-fx" || ${CPUTYPE} == "k8"
 MACHINE_CPU = k8 3dnow
-.  elif ${CPUTYPE} == "skylake" || ${CPUTYPE} == "knl"
+.  elif ${CPUTYPE} == "cannonlake" || ${CPUTYPE} == "knm" || \
+${CPUTYPE} == "skylake-avx512" || ${CPUTYPE} == "knl"
 MACHINE_CPU = avx512 avx2 avx sse42 sse41 ssse3 sse3
-.  elif ${CPUTYPE} == "broadwell" || ${CPUTYPE} == "haswell"
+.  elif ${CPUTYPE} == "skylake" || ${CPUTYPE} == "broadwell" || \
+${CPUTYPE} == "haswell"
 MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3
 .  elif ${CPUTYPE} == "ivybridge" || ${CPUTYPE} == "sandybridge"
 MACHINE_CPU = avx sse42 sse41 ssse3 sse3
-.  elif ${CPUTYPE} == "westmere" || ${CPUTYPE} == "nehalem" || \
-${CPUTYPE} == "silvermont"
+.  elif ${CPUTYPE} == "goldmont" || ${CPUTYPE} == "westmere" || \
+${CPUTYPE} == "nehalem" || ${CPUTYPE} == "silvermont"
 MACHINE_CPU = sse42 sse41 ssse3 sse3
 .  elif ${CPUTYPE} == "penryn"
 MACHINE_CPU = sse41 ssse3 sse3
___
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: r331961 - in head/sys: arm/mv dts/arm

2018-04-03 Thread Emmanuel Vadot

On 2018-04-04 00:21, Marcin Wojtas wrote:

Author: mw
Date: Tue Apr  3 22:21:12 2018
New Revision: 331961
URL: https://svnweb.freebsd.org/changeset/base/331961

Log:
  Make Marvell AmadaXP timer driver more generic

  Store pointers to SoC specific functions in mv_timer_config structure
  and determine proper config in runtime based on compatible string 
from FDT.

  Compatible string for ArmadaXP timers is changed to match Linux FDT.
  Armada 38x uses generic Cortex-A9 timer and separate watchdog 
drivers, so

  it does not need to be supported by timer driver.

  Submitted by: Rafal Kozik 
  Reviewed by: manu
  Obtained from: Semihalf
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D14741


 Hello Marcin,

 I've only reviewed the DTS part.
 Also you didn't address andrew@ comment, see 
https://reviews.freebsd.org/D14741?id=40452#inline-89719


 Cheers,

--
Emmanuel Vadot  
___
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: r331961 - in head/sys: arm/mv dts/arm

2018-04-03 Thread Marcin Wojtas
Author: mw
Date: Tue Apr  3 22:21:12 2018
New Revision: 331961
URL: https://svnweb.freebsd.org/changeset/base/331961

Log:
  Make Marvell AmadaXP timer driver more generic
  
  Store pointers to SoC specific functions in mv_timer_config structure
  and determine proper config in runtime based on compatible string from FDT.
  Compatible string for ArmadaXP timers is changed to match Linux FDT.
  Armada 38x uses generic Cortex-A9 timer and separate watchdog drivers, so
  it does not need to be supported by timer driver.
  
  Submitted by: Rafal Kozik 
  Reviewed by: manu
  Obtained from: Semihalf
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D14741

Modified:
  head/sys/arm/mv/timer.c
  head/sys/dts/arm/db78460.dts

Modified: head/sys/arm/mv/timer.c
==
--- head/sys/arm/mv/timer.c Tue Apr  3 22:15:53 2018(r331960)
+++ head/sys/arm/mv/timer.c Tue Apr  3 22:21:12 2018(r331961)
@@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -60,18 +61,20 @@ __FBSDID("$FreeBSD$");
 #defineMV_WDT  0x2
 #defineMV_NONE 0x0
 
-#if defined(SOC_MV_ARMADAXP) || defined(SOC_MV_ARMADA38X)
-#define MV_CLOCK_SRC   2500/* Timers' 25MHz mode */
-#else
-#define MV_CLOCK_SRC   get_tclk()
-#endif
+#defineMV_CLOCK_SRC_ARMV7  2500/* Timers' 25MHz mode */
 
-#if defined(SOC_MV_ARMADA38X)
-#defineWATCHDOG_TIMER  4
-#else
-#defineWATCHDOG_TIMER  2
-#endif
+#defineWATCHDOG_TIMER_ARMV52
 
+typedef void (*mv_watchdog_enable_t)(void);
+typedef void (*mv_watchdog_disable_t)(void);
+
+struct mv_timer_config {
+   enum soc_family soc_family;
+   mv_watchdog_enable_twatchdog_enable;
+   mv_watchdog_disable_t   watchdog_disable;
+   unsigned intclock_src;
+};
+
 struct mv_timer_softc {
struct resource *   timer_res[2];
bus_space_tag_t timer_bst;
@@ -79,6 +82,7 @@ struct mv_timer_softc {
struct mtx  timer_mtx;
struct eventtimer   et;
boolean_t   has_wdt;
+   struct mv_timer_config* config;
 };
 
 static struct resource_spec mv_timer_spec[] = {
@@ -89,8 +93,9 @@ static struct resource_spec mv_timer_spec[] = {
 
 /* Interrupt is not required by MV_WDT devices */
 static struct ofw_compat_data mv_timer_compat[] = {
+   {"marvell,armada-380-timer",MV_NONE },
+   {"marvell,armada-xp-timer", MV_TMR | MV_WDT },
{"mrvl,timer",  MV_TMR | MV_WDT },
-   {"marvell,armada-380-wdt",  MV_WDT },
{NULL,  MV_NONE }
 };
 
@@ -108,14 +113,42 @@ static void   mv_set_timer_control(uint32_t);
 static uint32_tmv_get_timer(uint32_t);
 static voidmv_set_timer(uint32_t, uint32_t);
 static voidmv_set_timer_rel(uint32_t, uint32_t);
-static voidmv_watchdog_enable(void);
-static voidmv_watchdog_disable(void);
 static voidmv_watchdog_event(void *, unsigned int, int *);
 static int mv_timer_start(struct eventtimer *et,
 sbintime_t first, sbintime_t period);
 static int mv_timer_stop(struct eventtimer *et);
 static voidmv_setup_timers(void);
 
+static void mv_watchdog_enable_armv5(void);
+static void mv_watchdog_enable_armadaxp(void);
+static void mv_watchdog_disable_armv5(void);
+static void mv_watchdog_disable_armadaxp(void);
+
+#ifdef PLATFORM
+void mv_delay(int usec, void* arg);
+#endif
+
+static struct mv_timer_config timer_armadaxp_config =
+{
+   MV_SOC_ARMADA_XP,
+   _watchdog_enable_armadaxp,
+   _watchdog_disable_armadaxp,
+   MV_CLOCK_SRC_ARMV7,
+};
+static struct mv_timer_config timer_armv5_config =
+{
+   MV_SOC_ARMV5,
+   _watchdog_enable_armv5,
+   _watchdog_disable_armv5,
+   0,
+};
+
+static struct ofw_compat_data mv_timer_soc_config[] = {
+   {"marvell,armada-xp-timer", (uintptr_t)_armadaxp_config },
+   {"mrvl,timer",  (uintptr_t)_armv5_config },
+   {NULL,  (uintptr_t)NULL },
+};
+
 static struct timecounter mv_timer_timecounter = {
.tc_get_timecount = mv_timer_get_timecount,
.tc_name = "CPUTimer1",
@@ -144,9 +177,7 @@ mv_timer_attach(device_t dev)
int error;
void*ihl;
struct  mv_timer_softc *sc;
-#if !defined(SOC_MV_ARMADAXP) && !defined(SOC_MV_ARMADA38X)
uint32_t irq_cause, irq_mask;
-#endif
 
if (timer_softc != NULL)
return (ENXIO);
@@ -154,6 +185,12 @@ mv_timer_attach(device_t dev)
sc = (struct mv_timer_softc *)device_get_softc(dev);
timer_softc = sc;
 
+   sc->config = (struct mv_timer_config*)
+   ofw_bus_search_compatible(dev, mv_timer_soc_config)->ocd_data;
+
+   if (sc->config->clock_src == 0)
+  

svn commit: r331960 - in head/sys/arm/mv: . armada

2018-04-03 Thread Marcin Wojtas
Author: mw
Date: Tue Apr  3 22:15:53 2018
New Revision: 331960
URL: https://svnweb.freebsd.org/changeset/base/331960

Log:
  Make Marvell Armada watchdog driver more generic
  
  Store platform dependent functions and constants in mv_wdt_config
  structure and select proper configuration on runtime based on
  compatible string provided in FDT.
  Marvell Armada38X and ArmadaXP non-repetitive registers are moved to
  generic part of code.
  To support armv5 as well, use proper compatible string:
  
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/watchdog/orion_wdt.c?h=v4.13-rc3#n456
  
  Submitted by: Rafal Kozik 
  Obtained from: Semihalf
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D14740

Modified:
  head/sys/arm/mv/armada/wdt.c
  head/sys/arm/mv/mvreg.h

Modified: head/sys/arm/mv/armada/wdt.c
==
--- head/sys/arm/mv/armada/wdt.cTue Apr  3 22:11:39 2018
(r331959)
+++ head/sys/arm/mv/armada/wdt.cTue Apr  3 22:15:53 2018
(r331960)
@@ -53,22 +53,54 @@ __FBSDID("$FreeBSD$");
 
 #define INITIAL_TIMECOUNTER(0x)
 #define MAX_WATCHDOG_TICKS (0x)
+#define WD_RST_OUT_EN   0x0002
 
-#if defined(SOC_MV_ARMADAXP) || defined(SOC_MV_ARMADA38X)
-#define MV_CLOCK_SRC   2500/* Timers' 25MHz mode */
-#else
-#define MV_CLOCK_SRC   get_tclk()
-#endif
+#defineMV_CLOCK_SRC_ARMV7  2500/* Timers' 25MHz mode */
 
-#if defined(SOC_MV_ARMADA38X)
-#defineWATCHDOG_TIMER  4
-#else
-#defineWATCHDOG_TIMER  2
-#endif
+struct mv_wdt_config {
+   enum soc_family wdt_soc;
+   uint32_t wdt_timer;
+   void (*wdt_enable)(void);
+   void (*wdt_disable)(void);
+   unsigned int wdt_clock_src;
+};
 
+static void mv_wdt_enable_armv5(void);
+static void mv_wdt_enable_armada_38x(void);
+static void mv_wdt_enable_armada_xp(void);
+
+static void mv_wdt_disable_armv5(void);
+static void mv_wdt_disable_armada_38x(void);
+static void mv_wdt_disable_armada_xp(void);
+
+static struct mv_wdt_config mv_wdt_armada_38x_config = {
+   .wdt_soc = MV_SOC_ARMADA_38X,
+   .wdt_timer = 4,
+   .wdt_enable = _wdt_enable_armada_38x,
+   .wdt_disable = _wdt_disable_armada_38x,
+   .wdt_clock_src = MV_CLOCK_SRC_ARMV7,
+};
+
+static struct mv_wdt_config mv_wdt_armada_xp_config = {
+   .wdt_soc = MV_SOC_ARMADA_XP,
+   .wdt_timer = 2,
+   .wdt_enable = _wdt_enable_armada_xp,
+   .wdt_disable = _wdt_disable_armada_xp,
+   .wdt_clock_src = MV_CLOCK_SRC_ARMV7,
+};
+
+static struct mv_wdt_config mv_wdt_armv5_config = {
+   .wdt_soc = MV_SOC_ARMV5,
+   .wdt_timer = 2,
+   .wdt_enable = _wdt_enable_armv5,
+   .wdt_disable = _wdt_disable_armv5,
+   .wdt_clock_src = 0,
+};
+
 struct mv_wdt_softc {
struct resource *   wdt_res;
struct mtx  wdt_mtx;
+   struct mv_wdt_config *  wdt_config;
 };
 
 static struct resource_spec mv_wdt_spec[] = {
@@ -77,8 +109,10 @@ static struct resource_spec mv_wdt_spec[] = {
 };
 
 static struct ofw_compat_data mv_wdt_compat[] = {
-   {"marvell,armada-380-wdt",  true},
-   {NULL,  false}
+   {"marvell,armada-380-wdt",  (uintptr_t)_wdt_armada_38x_config},
+   {"marvell,armada-xp-wdt",   (uintptr_t)_wdt_armada_xp_config},
+   {"marvell,orion-wdt",   (uintptr_t)_wdt_armv5_config},
+   {NULL,  (uintptr_t)NULL}
 };
 
 static struct mv_wdt_softc *wdt_softc = NULL;
@@ -91,8 +125,6 @@ static uint32_t  mv_get_timer_control(void);
 static void mv_set_timer_control(uint32_t);
 static void mv_set_timer(uint32_t, uint32_t);
 
-static void mv_watchdog_enable(void);
-static void mv_watchdog_disable(void);
 static void mv_watchdog_event(void *, unsigned int, int *);
 
 static device_method_t mv_wdt_methods[] = {
@@ -145,7 +177,14 @@ mv_wdt_attach(device_t dev)
 
mtx_init(>wdt_mtx, "watchdog", NULL, MTX_DEF);
 
-   mv_watchdog_disable();
+   sc->wdt_config = (struct mv_wdt_config *)
+  ofw_bus_search_compatible(dev, mv_wdt_compat)->ocd_data;
+
+   if (sc->wdt_config->wdt_clock_src == 0)
+   sc->wdt_config->wdt_clock_src = get_tclk();
+
+   if (wdt_softc->wdt_config->wdt_disable != NULL)
+   wdt_softc->wdt_config->wdt_disable();
EVENTHANDLER_REGISTER(watchdog_list, mv_watchdog_event, sc, 0);
 
return (0);
@@ -171,20 +210,37 @@ mv_set_timer(uint32_t timer, uint32_t val)
 
bus_write_4(wdt_softc->wdt_res, CPU_TIMER0 + timer * 0x8, val);
 }
-
 static void
-mv_watchdog_enable(void)
+mv_wdt_enable_armv5(void)
 {
+   uint32_t val, irq_cause, irq_mask;
+
+   irq_cause = read_cpu_ctrl(BRIDGE_IRQ_CAUSE);
+   irq_cause &= IRQ_TIMER_WD_CLR;
+   write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause);
+

svn commit: r331959 - head/sys/opencrypto

2018-04-03 Thread Conrad Meyer
Author: cem
Date: Tue Apr  3 22:11:39 2018
New Revision: 331959
URL: https://svnweb.freebsd.org/changeset/base/331959

Log:
  cryptosoft: Remove a dead store
  
  Introduced in r331639 by removing an instance of undefined behavior.
  
  While we're here, the variable scope can be entirely moved inside the loop.
  
  Reported by:  Coverity
  CID:  1387985
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/opencrypto/cryptosoft.c

Modified: head/sys/opencrypto/cryptosoft.c
==
--- head/sys/opencrypto/cryptosoft.cTue Apr  3 22:10:50 2018
(r331958)
+++ head/sys/opencrypto/cryptosoft.cTue Apr  3 22:11:39 2018
(r331959)
@@ -84,7 +84,7 @@ static int
 swcr_encdec(struct cryptodesc *crd, struct swcr_data *sw, caddr_t buf,
 int flags)
 {
-   unsigned char iv[EALG_MAX_BLOCK_LEN], blk[EALG_MAX_BLOCK_LEN], *idat;
+   unsigned char iv[EALG_MAX_BLOCK_LEN], blk[EALG_MAX_BLOCK_LEN];
unsigned char *ivp, *nivp, iv2[EALG_MAX_BLOCK_LEN];
struct enc_xform *exf;
int i, j, k, blks, ind, count, ivlen;
@@ -249,11 +249,12 @@ swcr_encdec(struct cryptodesc *crd, struct swcr_data *
}
 
while (uio->uio_iov[ind].iov_len >= k + blks && i > 0) {
+   uint8_t *idat;
size_t nb, rem;
 
nb = blks;
rem = uio->uio_iov[ind].iov_len - k;
-   idat = (char *)uio->uio_iov[ind].iov_base + k;
+   idat = (uint8_t *)uio->uio_iov[ind].iov_base + k;
 
if (exf->reinit) {
if ((crd->crd_flags & CRD_F_ENCRYPT) != 0 &&
@@ -296,7 +297,6 @@ swcr_encdec(struct cryptodesc *crd, struct swcr_data *
ivp = nivp;
}
 
-   idat += nb;
count += nb;
k += nb;
i -= nb;
___
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: r331958 - in head/sys/arm/mv: . armada38x armadaxp

2018-04-03 Thread Marcin Wojtas
Author: mw
Date: Tue Apr  3 22:10:50 2018
New Revision: 331958
URL: https://svnweb.freebsd.org/changeset/base/331958

Log:
  Make get_tclk and get_cpu_freq generic for Marvell armv7 SoCs
  
  In GENERIC kernel choosing proper get_tclk and get_cpu_freq implementation 
must
  be done in runtime. Kernel for both SoC need to have implementation of each
  other functions, so common file list mv/files.arm7 is added.
  Marvell armv5 SoC have their own non-generic implementation of those function.
  
  Submitted by: Rafal Kozik 
  Obtained from: Semihalf
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D14739

Added:
  head/sys/arm/mv/files.arm7   (contents, props changed)
Modified:
  head/sys/arm/mv/armada38x/armada38x.c
  head/sys/arm/mv/armada38x/std.armada38x
  head/sys/arm/mv/armadaxp/armadaxp.c
  head/sys/arm/mv/mv_common.c
  head/sys/arm/mv/mvvar.h
  head/sys/arm/mv/std-pj4b.mv

Modified: head/sys/arm/mv/armada38x/armada38x.c
==
--- head/sys/arm/mv/armada38x/armada38x.c   Tue Apr  3 21:54:36 2018
(r331957)
+++ head/sys/arm/mv/armada38x/armada38x.c   Tue Apr  3 22:10:50 2018
(r331958)
@@ -61,7 +61,7 @@ get_sar_value_armada38x(void)
 }
 
 uint32_t
-get_tclk(void)
+get_tclk_armada38x(void)
 {
uint32_t sar;
 
@@ -78,7 +78,7 @@ get_tclk(void)
 }
 
 uint32_t
-get_cpu_freq(void)
+get_cpu_freq_armada38x(void)
 {
uint32_t sar;
 

Modified: head/sys/arm/mv/armada38x/std.armada38x
==
--- head/sys/arm/mv/armada38x/std.armada38x Tue Apr  3 21:54:36 2018
(r331957)
+++ head/sys/arm/mv/armada38x/std.armada38x Tue Apr  3 22:10:50 2018
(r331958)
@@ -1,6 +1,7 @@
 # $FreeBSD$
 files  "../mv/armada38x/files.armada38x"
 files  "../mv/files.mv"
+files  "../mv/files.arm7"
 cpuCPU_CORTEXA
 machinearm armv7
 

Modified: head/sys/arm/mv/armadaxp/armadaxp.c
==
--- head/sys/arm/mv/armadaxp/armadaxp.c Tue Apr  3 21:54:36 2018
(r331957)
+++ head/sys/arm/mv/armadaxp/armadaxp.c Tue Apr  3 22:10:50 2018
(r331958)
@@ -138,7 +138,7 @@ get_sar_value_armadaxp(void)
 }
 
 uint32_t
-get_tclk(void)
+get_tclk_armadaxp(void)
 {
uint32_t cputype;
 
@@ -152,7 +152,7 @@ get_tclk(void)
 }
 
 uint32_t
-get_cpu_freq(void)
+get_cpu_freq_armadaxp(void)
 {
 
return (0);

Added: head/sys/arm/mv/files.arm7
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/mv/files.arm7  Tue Apr  3 22:10:50 2018(r331958)
@@ -0,0 +1,3 @@
+# $FreeBSD$
+arm/mv/armada38x/armada38x.c   standard
+arm/mv/armadaxp/armadaxp.c standard

Modified: head/sys/arm/mv/mv_common.c
==
--- head/sys/arm/mv/mv_common.c Tue Apr  3 21:54:36 2018(r331957)
+++ head/sys/arm/mv/mv_common.c Tue Apr  3 22:10:50 2018(r331958)
@@ -230,6 +230,7 @@ typedef void(*write_cpu_ctrl_t)(uint32_t, uint32_t);
 typedef uint32_t (*win_read_t)(int);
 typedef void (*win_write_t)(int, uint32_t);
 typedef int (*win_cesa_attr_t)(int);
+typedef uint32_t (*get_t)(void);
 
 struct decode_win_spec {
read_cpu_ctrl_t  read_cpu_ctrl;
@@ -249,6 +250,10 @@ struct decode_win_spec {
win_read_t  ddr_sz_read;
win_write_t ddr_br_write;
win_write_t ddr_sz_write;
+#if __ARM_ARCH >= 6
+   get_t   get_tclk;
+   get_t   get_cpu_freq;
+#endif
 };
 
 struct decode_win_spec *soc_decode_win_spec;
@@ -273,6 +278,10 @@ static struct decode_win_spec decode_win_specs[] =
_armv7_sz_read,
_armv7_br_write,
_armv7_sz_write,
+#if __ARM_ARCH >= 6
+   _tclk_armada38x,
+   _cpu_freq_armada38x,
+#endif
},
{
_cpu_ctrl_armv7,
@@ -292,6 +301,10 @@ static struct decode_win_spec decode_win_specs[] =
_armv7_sz_read,
_armv7_br_write,
_armv7_sz_write,
+#if __ARM_ARCH >= 6
+   _tclk_armadaxp,
+   _cpu_freq_armadaxp,
+#endif
},
{
_cpu_ctrl_armv5,
@@ -311,6 +324,10 @@ static struct decode_win_spec decode_win_specs[] =
_armv5_sz_read,
_armv5_br_write,
_armv5_sz_write,
+#if __ARM_ARCH >= 6
+   NULL,
+   NULL,
+#endif
},
 };
 
@@ -2951,6 +2968,28 @@ struct fdt_fixup_entry fdt_fixup_table[] = {
{ "mrvl,DB-78460", _fixup_ranges },
{ NULL, NULL }
 };
+
+#if __ARM_ARCH >= 6
+uint32_t
+get_tclk(void)
+{
+
+   if (soc_decode_win_spec->get_tclk != NULL)
+   

svn commit: r331957 - head/sys/arm/mv

2018-04-03 Thread Marcin Wojtas
Author: mw
Date: Tue Apr  3 21:54:36 2018
New Revision: 331957
URL: https://svnweb.freebsd.org/changeset/base/331957

Log:
  Make mv_common.c generic for Marvell Armada38X and ArmadaXP
  
  Preparation for adding Armada38X and ArmadaXP SoC to GENERIC config.
  Supported platform are listed in soc_family enum.
  struct decode_win_spec contains platform specific functions and constants.
  Function mv_check_soc_family checks SoC type and chooses proper structure
  in runtime, as well as platform-dependent functions.
  Unnecessary dummy functions are removed.
  Because of changing registers name to more generic new definition of
  FDT_DEVMAP_MAX in mv_machdep is added.
  
  Submitted by: Rafal Kozik 
  Obtained from: Semihalf
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D14738

Modified:
  head/sys/arm/mv/mv_common.c
  head/sys/arm/mv/mv_machdep.c
  head/sys/arm/mv/mvreg.h
  head/sys/arm/mv/mvvar.h
  head/sys/arm/mv/mvwin.h

Modified: head/sys/arm/mv/mv_common.c
==
--- head/sys/arm/mv/mv_common.c Tue Apr  3 21:46:28 2018(r331956)
+++ head/sys/arm/mv/mv_common.c Tue Apr  3 21:54:36 2018(r331957)
@@ -76,6 +76,19 @@ MALLOC_DEFINE(M_IDMA, "idma", "idma dma test memory");
 #define MV_DUMP_WIN0
 #endif
 
+static enum soc_family soc_family;
+
+static int mv_win_cesa_attr(int wng_sel);
+static int mv_win_cesa_attr_armv5(int eng_sel);
+static int mv_win_cesa_attr_armada38x(int eng_sel);
+static int mv_win_cesa_attr_armadaxp(int eng_sel);
+
+uint32_t read_cpu_ctrl_armv5(uint32_t reg);
+uint32_t read_cpu_ctrl_armv7(uint32_t reg);
+
+void write_cpu_ctrl_armv5(uint32_t reg, uint32_t val);
+void write_cpu_ctrl_armv7(uint32_t reg, uint32_t val);
+
 static int win_eth_can_remap(int i);
 
 static int decode_win_cesa_valid(void);
@@ -91,9 +104,7 @@ static int decode_win_idma_valid(void);
 static int decode_win_xor_valid(void);
 
 static void decode_win_cpu_setup(void);
-#ifdef SOC_MV_ARMADAXP
 static int decode_win_sdram_fixup(void);
-#endif
 static void decode_win_cesa_setup(u_long);
 static void decode_win_usb_setup(u_long);
 static void decode_win_usb3_setup(u_long);
@@ -117,11 +128,48 @@ static void decode_win_ahci_dump(u_long base);
 static void decode_win_sdhci_dump(u_long);
 static void decode_win_pcie_dump(u_long);
 
+static uint32_t win_cpu_cr_read(int);
+static uint32_t win_cpu_armv5_cr_read(int);
+static uint32_t win_cpu_armv7_cr_read(int);
+static uint32_t win_cpu_br_read(int);
+static uint32_t win_cpu_armv5_br_read(int);
+static uint32_t win_cpu_armv7_br_read(int);
+static uint32_t win_cpu_remap_l_read(int);
+static uint32_t win_cpu_armv5_remap_l_read(int);
+static uint32_t win_cpu_armv7_remap_l_read(int);
+static uint32_t win_cpu_remap_h_read(int);
+static uint32_t win_cpu_armv5_remap_h_read(int);
+static uint32_t win_cpu_armv7_remap_h_read(int);
+
+static void win_cpu_cr_write(int, uint32_t);
+static void win_cpu_armv5_cr_write(int, uint32_t);
+static void win_cpu_armv7_cr_write(int, uint32_t);
+static void win_cpu_br_write(int, uint32_t);
+static void win_cpu_armv5_br_write(int, uint32_t);
+static void win_cpu_armv7_br_write(int, uint32_t);
+static void win_cpu_remap_l_write(int, uint32_t);
+static void win_cpu_armv5_remap_l_write(int, uint32_t);
+static void win_cpu_armv7_remap_l_write(int, uint32_t);
+static void win_cpu_remap_h_write(int, uint32_t);
+static void win_cpu_armv5_remap_h_write(int, uint32_t);
+static void win_cpu_armv7_remap_h_write(int, uint32_t);
+
+static uint32_t ddr_br_read(int);
+static uint32_t ddr_sz_read(int);
+static uint32_t ddr_armv5_br_read(int);
+static uint32_t ddr_armv5_sz_read(int);
+static uint32_t ddr_armv7_br_read(int);
+static uint32_t ddr_armv7_sz_read(int);
+static void ddr_br_write(int, uint32_t);
+static void ddr_sz_write(int, uint32_t);
+static void ddr_armv5_br_write(int, uint32_t);
+static void ddr_armv5_sz_write(int, uint32_t);
+static void ddr_armv7_br_write(int, uint32_t);
+static void ddr_armv7_sz_write(int, uint32_t);
+
 static int fdt_get_ranges(const char *, void *, int, int *, int *);
-#ifdef SOC_MV_ARMADA38X
 int gic_decode_fdt(phandle_t iparent, pcell_t *intr, int *interrupt,
 int *trig, int *pol);
-#endif
 
 static int win_cpu_from_dt(void);
 static int fdt_win_setup(void);
@@ -177,6 +225,95 @@ static struct soc_node_spec soc_nodes[] = {
{ NULL, NULL, NULL, NULL },
 };
 
+typedef uint32_t(*read_cpu_ctrl_t)(uint32_t);
+typedef void(*write_cpu_ctrl_t)(uint32_t, uint32_t);
+typedef uint32_t (*win_read_t)(int);
+typedef void (*win_write_t)(int, uint32_t);
+typedef int (*win_cesa_attr_t)(int);
+
+struct decode_win_spec {
+   read_cpu_ctrl_t  read_cpu_ctrl;
+   write_cpu_ctrl_t write_cpu_ctrl;
+   win_read_t  cr_read;
+   win_read_t  br_read;
+   win_read_t  remap_l_read;
+   win_read_t  remap_h_read;
+   win_write_t cr_write;
+   win_write_t 

svn commit: r331956 - head/sys/arm/mv

2018-04-03 Thread Marcin Wojtas
Author: mw
Date: Tue Apr  3 21:46:28 2018
New Revision: 331956
URL: https://svnweb.freebsd.org/changeset/base/331956

Log:
  Make validation in Marvell mv_common.c generic
  
  Validate only drivers used by given platform.
  Pointers to validation function
  are added to soc_node_spec structure.
  
  Submitted by: Rafal Kozik 
  Reviewed by: andrew
  Obtained from: Semihalf
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D14737

Modified:
  head/sys/arm/mv/mv_common.c

Modified: head/sys/arm/mv/mv_common.c
==
--- head/sys/arm/mv/mv_common.c Tue Apr  3 21:44:43 2018(r331955)
+++ head/sys/arm/mv/mv_common.c Tue Apr  3 21:46:28 2018(r331956)
@@ -138,6 +138,7 @@ const struct decode_win *cpu_wins = cpu_win_tbl;
 
 typedef void (*decode_win_setup_t)(u_long);
 typedef void (*dump_win_t)(u_long);
+typedef int (*valid_t)(void);
 
 /*
  * The power status of device feature is only supported on
@@ -153,22 +154,27 @@ struct soc_node_spec {
const char  *compat;
decode_win_setup_t  decode_handler;
dump_win_t  dump_handler;
+   valid_t valid_handler;
 };
 
 static struct soc_node_spec soc_nodes[] = {
-   { "mrvl,ge", _win_eth_setup, _win_eth_dump },
-   { "marvell,armada-370-neta", _win_neta_setup, 
_win_neta_dump },
-   { "mrvl,usb-ehci", _win_usb_setup, _win_usb_dump },
-   { "marvell,orion-ehci", _win_usb_setup, _win_usb_dump },
-   { "marvell,armada-380-xhci", _win_usb3_setup, 
_win_usb3_dump },
-   { "marvell,armada-380-ahci", _win_ahci_setup, 
_win_ahci_dump },
-   { "marvell,armada-380-sdhci", _win_sdhci_setup, 
_win_sdhci_dump },
-   { "mrvl,sata", _win_sata_setup, NULL },
-   { "mrvl,xor", _win_xor_setup, _win_xor_dump },
-   { "mrvl,idma", _win_idma_setup, _win_idma_dump },
-   { "mrvl,cesa", _win_cesa_setup, _win_cesa_dump },
-   { "mrvl,pcie", _win_pcie_setup, _win_pcie_dump },
-   { NULL, NULL, NULL },
+   { "mrvl,ge", _win_eth_setup, _win_eth_dump, 
_win_eth_valid},
+   { "marvell,armada-370-neta", _win_neta_setup,
+   _win_neta_dump, NULL },
+   { "mrvl,usb-ehci", _win_usb_setup, _win_usb_dump, 
_win_usb_valid},
+   { "marvell,orion-ehci", _win_usb_setup, _win_usb_dump, 
_win_usb_valid },
+   { "marvell,armada-380-xhci", _win_usb3_setup,
+   _win_usb3_dump, _win_usb3_valid },
+   { "marvell,armada-380-ahci", _win_ahci_setup,
+   _win_ahci_dump, NULL },
+   { "marvell,armada-380-sdhci", _win_sdhci_setup,
+   _win_sdhci_dump, _win_sdhci_valid},
+   { "mrvl,sata", _win_sata_setup, NULL, _win_sata_valid},
+   { "mrvl,xor", _win_xor_setup, _win_xor_dump, 
_win_xor_valid},
+   { "mrvl,idma", _win_idma_setup, _win_idma_dump, 
_win_idma_valid},
+   { "mrvl,cesa", _win_cesa_setup, _win_cesa_dump, 
_win_cesa_valid},
+   { "mrvl,pcie", _win_pcie_setup, _win_pcie_dump, 
_win_pcie_valid},
+   { NULL, NULL, NULL, NULL },
 };
 
 struct fdt_pm_mask_entry {
@@ -595,12 +601,6 @@ soc_decode_win(void)
return(err);
 #endif
 
-   if (!decode_win_cpu_valid() || !decode_win_usb_valid() ||
-   !decode_win_eth_valid() || !decode_win_idma_valid() ||
-   !decode_win_pcie_valid() || !decode_win_sata_valid() ||
-   !decode_win_xor_valid() || !decode_win_usb3_valid() ||
-   !decode_win_sdhci_valid() || !decode_win_cesa_valid())
-   return (EINVAL);
 
decode_win_cpu_setup();
if (MV_DUMP_WIN)
@@ -2461,6 +2461,10 @@ fdt_win_process(phandle_t child)
else
base = fdt_data_get([addr_cells - 2], 2);
size = fdt_data_get([addr_cells], size_cells);
+
+   if (soc_node->valid_handler != NULL)
+   if (!soc_node->valid_handler())
+   return (EINVAL);
 
base = (base & 0x000f) | fdt_immr_va;
if (soc_node->decode_handler != NULL)
___
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: r331955 - head/share/man/man8

2018-04-03 Thread Jilles Tjoelker
Author: jilles
Date: Tue Apr  3 21:44:43 2018
New Revision: 331955
URL: https://svnweb.freebsd.org/changeset/base/331955

Log:
  rc.subr.8: Improve documentation of ${name}_limits and ${name}_login_class
  
  Submitted by: 0mp
  Differential Revision:https://reviews.freebsd.org/D14928

Modified:
  head/share/man/man8/rc.subr.8

Modified: head/share/man/man8/rc.subr.8
==
--- head/share/man/man8/rc.subr.8   Tue Apr  3 21:38:11 2018
(r331954)
+++ head/share/man/man8/rc.subr.8   Tue Apr  3 21:44:43 2018
(r331955)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 18, 2016
+.Dd April 3, 2018
 .Dt RC.SUBR 8
 .Os
 .Sh NAME
@@ -584,21 +584,27 @@ Only supported after
 .Pa /usr
 is mounted.
 .It Va ${name}_limits
-.Xr limits 1
-to apply to
+Resource limits to apply to
 .Va command .
 This will be passed as arguments to the
 .Xr limits 1
 utility.
+By default, the resource limits are based on the login class defined in
+.Va ${name}_login_class .
+.It Va ${name}_login_class
+Login class to use with
+.Va ${name}_limits .
+Defaults to
+.Dq Li daemon .
 .It Va ${name}_oomprotect
 .Xr protect 1
 .Va command
 from being killed when swap space is exhausted.
 If
-.Em YES
+.Dq Li YES
 is used, no child processes are protected.
 If
-.Em ALL ,
+.Dq Li ALL ,
 protect all child processes.
 .It Va ${name}_program
 Full path to the command.
___
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: r331954 - in head/sys/arm/mv: . armada38x armadaxp

2018-04-03 Thread Marcin Wojtas
Author: mw
Date: Tue Apr  3 21:38:11 2018
New Revision: 331954
URL: https://svnweb.freebsd.org/changeset/base/331954

Log:
  Split get_sar_value function for Marvell ArmadaXP and Armada38X
  
  get_sar_value is implemented only for ArmadaXP and Armada38X. Splitting it for
  two different functions and change registers names result in more generic 
code.
  
  Submitted by: Rafal Kozik 
  Reviewed by: andrew
  Obtained from: Semihalf
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D14736

Modified:
  head/sys/arm/mv/armada38x/armada38x.c
  head/sys/arm/mv/armadaxp/armadaxp.c
  head/sys/arm/mv/mv_common.c
  head/sys/arm/mv/mvreg.h
  head/sys/arm/mv/mvvar.h

Modified: head/sys/arm/mv/armada38x/armada38x.c
==
--- head/sys/arm/mv/armada38x/armada38x.c   Tue Apr  3 21:25:15 2018
(r331953)
+++ head/sys/arm/mv/armada38x/armada38x.c   Tue Apr  3 21:38:11 2018
(r331954)
@@ -43,11 +43,23 @@ int armada38x_open_bootrom_win(void);
 int armada38x_scu_enable(void);
 int armada38x_win_set_iosync_barrier(void);
 int armada38x_mbus_optimization(void);
+static uint64_t get_sar_value_armada38x(void);
 
 static int hw_clockrate;
 SYSCTL_INT(_hw, OID_AUTO, clockrate, CTLFLAG_RD,
 _clockrate, 0, "CPU instruction clock rate");
 
+static uint64_t
+get_sar_value_armada38x(void)
+{
+   uint32_t sar_low, sar_high;
+
+   sar_high = 0;
+   sar_low = bus_space_read_4(fdtbus_bs_tag, MV_MISC_BASE,
+   SAMPLE_AT_RESET_ARMADA38X);
+   return (((uint64_t)sar_high << 32) | sar_low);
+}
+
 uint32_t
 get_tclk(void)
 {
@@ -57,8 +69,8 @@ get_tclk(void)
 * On Armada38x TCLK can be configured to 250 MHz or 200 MHz.
 * Current setting is read from Sample At Reset register.
 */
-   sar = (uint32_t)get_sar_value();
-   sar = (sar & TCLK_MASK) >> TCLK_SHIFT;
+   sar = (uint32_t)get_sar_value_armada38x();
+   sar = (sar & TCLK_MASK_ARMADA38X) >> TCLK_SHIFT_ARMADA38X;
if (sar == 0)
return (TCLK_250MHZ);
else
@@ -78,7 +90,7 @@ get_cpu_freq(void)
1866, 0, 0, 2000
};
 
-   sar = (uint32_t)get_sar_value();
+   sar = (uint32_t)get_sar_value_armada38x();
sar = (sar & A38X_CPU_DDR_CLK_MASK) >> A38X_CPU_DDR_CLK_SHIFT;
if (sar >= nitems(cpu_frequencies))
return (0);

Modified: head/sys/arm/mv/armadaxp/armadaxp.c
==
--- head/sys/arm/mv/armadaxp/armadaxp.c Tue Apr  3 21:25:15 2018
(r331953)
+++ head/sys/arm/mv/armadaxp/armadaxp.c Tue Apr  3 21:38:11 2018
(r331954)
@@ -55,6 +55,7 @@ static uint32_t count_l2clk(void);
 void armadaxp_l2_init(void);
 void armadaxp_init_coher_fabric(void);
 int platform_get_ncpus(void);
+static uint64_t get_sar_value_armadaxp(void);
 
 #define ARMADAXP_L2_BASE   (MV_BASE + 0x8000)
 #define ARMADAXP_L2_CTRL   0x100
@@ -124,6 +125,18 @@ static uint16_tcpu_clock_table[] = {
 1000, 1066, 1200, 1333, 1500, 1666, 1800, 2000, 600,  667,  800,  1600,
 2133, 2200, 2400 };
 
+static uint64_t
+get_sar_value_armadaxp(void)
+{
+   uint32_t sar_low, sar_high;
+
+   sar_high = bus_space_read_4(fdtbus_bs_tag, MV_MISC_BASE,
+   SAMPLE_AT_RESET_HI);
+   sar_low = bus_space_read_4(fdtbus_bs_tag, MV_MISC_BASE,
+   SAMPLE_AT_RESET_LO);
+   return (((uint64_t)sar_high << 32) | sar_low);
+}
+
 uint32_t
 get_tclk(void)
 {
@@ -153,7 +166,7 @@ count_l2clk(void)
uint8_t  sar_cpu_freq, sar_fab_freq, array_size;
 
/* Get value of the SAR register and process it */
-   sar_reg = get_sar_value();
+   sar_reg = get_sar_value_armadaxp();
sar_cpu_freq = CPU_FREQ_FIELD(sar_reg);
sar_fab_freq = FAB_FREQ_FIELD(sar_reg);
 

Modified: head/sys/arm/mv/mv_common.c
==
--- head/sys/arm/mv/mv_common.c Tue Apr  3 21:25:15 2018(r331953)
+++ head/sys/arm/mv/mv_common.c Tue Apr  3 21:38:11 2018(r331954)
@@ -2664,28 +2664,3 @@ fdt_pic_decode_t fdt_pic_table[] = {
NULL
 };
 #endif
-
-uint64_t
-get_sar_value(void)
-{
-   uint32_t sar_low, sar_high;
-
-#if defined(SOC_MV_ARMADAXP)
-   sar_high = bus_space_read_4(fdtbus_bs_tag, MV_MISC_BASE,
-   SAMPLE_AT_RESET_HI);
-   sar_low = bus_space_read_4(fdtbus_bs_tag, MV_MISC_BASE,
-   SAMPLE_AT_RESET_LO);
-#elif defined(SOC_MV_ARMADA38X)
-   sar_high = 0;
-   sar_low = bus_space_read_4(fdtbus_bs_tag, MV_MISC_BASE,
-   SAMPLE_AT_RESET);
-#else
-   /*
-* TODO: Add getting proper values for other SoC configurations
-*/
-   sar_high = 0;
-   sar_low = 0;
-#endif
-
-   return (((uint64_t)sar_high << 32) | sar_low);
-}

Modified: head/sys/arm/mv/mvreg.h

svn commit: r331953 - head/sys/arm/mv

2018-04-03 Thread Marcin Wojtas
Author: mw
Date: Tue Apr  3 21:25:15 2018
New Revision: 331953
URL: https://svnweb.freebsd.org/changeset/base/331953

Log:
  Make Marvell mv_pci.c driver generic
  
  PCI ports differ between Marvell SoCs, but have the same compatible in FDT.
  Identification is made based on parent compatible during attach.
  For ArmadaXP skipping enable procedure is necessary. To achieve it
  sc_skip_enable_procedure flag is used.
  For Armada38x find root procedure is necessary. For other SoCs root link is
  always at slot 0. sc_enable_find_root_slot flag is used to select proper
  behaviour.
  Marvell armv5 platforms does not support msi.
  
  Submitted by: Rafal Kozik 
  Reviewed by: andrew
  Obtained from: Semihalf
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D14735

Modified:
  head/sys/arm/mv/mv_pci.c
  head/sys/arm/mv/mvwin.h

Modified: head/sys/arm/mv/mv_pci.c
==
--- head/sys/arm/mv/mv_pci.cTue Apr  3 21:22:43 2018(r331952)
+++ head/sys/arm/mv/mv_pci.cTue Apr  3 21:25:15 2018(r331953)
@@ -308,6 +308,9 @@ struct mv_pcib_softc {
int sc_type;
int sc_mode;/* Endpoint / Root Complex */
 
+   int sc_msi_supported;
+   int sc_skip_enable_procedure;
+   int sc_enable_find_root_slot;
struct ofw_bus_iinfosc_pci_iinfo;
 };
 
@@ -341,11 +344,10 @@ static uint32_t mv_pcib_read_config(device_t, u_int, u
 static void mv_pcib_write_config(device_t, u_int, u_int, u_int, u_int,
 uint32_t, int);
 static int mv_pcib_route_interrupt(device_t, device_t, int);
-#if defined(SOC_MV_ARMADAXP)
+
 static int mv_pcib_alloc_msi(device_t, device_t, int, int, int *);
 static int mv_pcib_map_msi(device_t, device_t, int, uint64_t *, uint32_t *);
 static int mv_pcib_release_msi(device_t, device_t, int, int *);
-#endif
 
 /*
  * Bus interface definitions.
@@ -371,11 +373,10 @@ static device_method_t mv_pcib_methods[] = {
DEVMETHOD(pcib_write_config,mv_pcib_write_config),
DEVMETHOD(pcib_route_interrupt, mv_pcib_route_interrupt),
DEVMETHOD(pcib_request_feature, pcib_request_feature_allow),
-#if defined(SOC_MV_ARMADAXP)
+
DEVMETHOD(pcib_alloc_msi,   mv_pcib_alloc_msi),
DEVMETHOD(pcib_release_msi, mv_pcib_release_msi),
DEVMETHOD(pcib_map_msi, mv_pcib_map_msi),
-#endif
 
/* OFW bus interface */
DEVMETHOD(ofw_bus_get_compat,   ofw_bus_gen_get_compat),
@@ -442,9 +443,19 @@ mv_pcib_attach(device_t self)
 
if (ofw_bus_node_is_compatible(node, "mrvl,pcie")) {
sc->sc_type = MV_TYPE_PCIE;
-   sc->sc_win_target = MV_WIN_PCIE_TARGET(port_id);
-   sc->sc_mem_win_attr = MV_WIN_PCIE_MEM_ATTR(port_id);
-   sc->sc_io_win_attr = MV_WIN_PCIE_IO_ATTR(port_id);
+   if (ofw_bus_node_is_compatible(parnode, 
"marvell,armada-370-pcie")) {
+   sc->sc_win_target = 
MV_WIN_PCIE_TARGET_ARMADA38X(port_id);
+   sc->sc_mem_win_attr = 
MV_WIN_PCIE_MEM_ATTR_ARMADA38X(port_id);
+   sc->sc_io_win_attr = 
MV_WIN_PCIE_IO_ATTR_ARMADA38X(port_id);
+   sc->sc_enable_find_root_slot = 1;
+   } else {
+   sc->sc_win_target = MV_WIN_PCIE_TARGET(port_id);
+   sc->sc_mem_win_attr = MV_WIN_PCIE_MEM_ATTR(port_id);
+   sc->sc_io_win_attr = MV_WIN_PCIE_IO_ATTR(port_id);
+#if __ARM_ARCH >= 6
+   sc->sc_skip_enable_procedure = 1;
+#endif
+   }
} else if (ofw_bus_node_is_compatible(node, "mrvl,pci")) {
sc->sc_type = MV_TYPE_PCI;
sc->sc_win_target = MV_WIN_PCI_TARGET;
@@ -541,9 +552,11 @@ static void
 mv_pcib_enable(struct mv_pcib_softc *sc, uint32_t unit)
 {
uint32_t val;
-#if !defined(SOC_MV_ARMADAXP)
int timeout;
 
+   if (sc->sc_skip_enable_procedure)
+   goto pcib_enable_root_mode;
+
/*
 * Check if PCIE device is enabled.
 */
@@ -561,9 +574,8 @@ mv_pcib_enable(struct mv_pcib_softc *sc, uint32_t unit
PCIE_REG_STATUS);
}
}
-#endif
 
-
+pcib_enable_root_mode:
if (sc->sc_mode == MV_MODE_ROOT) {
/*
 * Enable PCI bridge.
@@ -1042,20 +1054,19 @@ mv_pcib_maxslots(device_t dev)
 static int
 mv_pcib_root_slot(device_t dev, u_int bus, u_int slot, u_int func)
 {
-#if defined(SOC_MV_ARMADA38X)
struct mv_pcib_softc *sc = device_get_softc(dev);
uint32_t vendor, device;
 
+/* On platforms other than Armada38x, root link is always at slot 0 */
+   if (!sc->sc_enable_find_root_slot)
+   return (slot == 0);
+
vendor = mv_pcib_hw_cfgread(sc, 

svn commit: r331951 - in head/sys/arm: conf include mv

2018-04-03 Thread Marcin Wojtas
Author: mw
Date: Tue Apr  3 21:17:19 2018
New Revision: 331951
URL: https://svnweb.freebsd.org/changeset/base/331951

Log:
  Enable ArmadaXP using INTRNG interrupt controller
  
  Defining INTRNG remove some necessary registers and declarations of
  pic_init_secondary, pic_ipi_send, pic_ipi_read and pic_ipi_clear.
  Because Marvell ArmadaXP and Armada38X always use INTRNG, include all
  INTRNG code and remove code that does not use it.
  Separate pic registers declarations for Armada38X are unnecessary, it
  works properly with ArmadaXP config.
  
  Submitted by: Rafal Kozik 
  Reviewed by: andrew
  Obtained from: Semihalf
  Sponsored by: Stormshield
  Differential Revision: https://reviews.freebsd.org/D14734

Modified:
  head/sys/arm/conf/ARMADAXP
  head/sys/arm/include/intr.h
  head/sys/arm/mv/mpic.c
  head/sys/arm/mv/mvreg.h

Modified: head/sys/arm/conf/ARMADAXP
==
--- head/sys/arm/conf/ARMADAXP  Tue Apr  3 21:16:41 2018(r331950)
+++ head/sys/arm/conf/ARMADAXP  Tue Apr  3 21:17:19 2018(r331951)
@@ -88,3 +88,5 @@ devicepci
 optionsFDT # Configure using FDT/DTB data
 optionsFDT_DTB_STATIC
 makeoptionsFDT_DTS_FILE=db78460.dts
+
+options INTRNG

Modified: head/sys/arm/include/intr.h
==
--- head/sys/arm/include/intr.h Tue Apr  3 21:16:41 2018(r331950)
+++ head/sys/arm/include/intr.h Tue Apr  3 21:17:19 2018(r331951)
@@ -84,13 +84,6 @@ int intr_pic_ipi_setup(u_int, const char *, intr_ipi_h
 #define NIRQ   288
 #elif defined(CPU_ARM1176)
 #define NIRQ   128
-#elif defined(SOC_MV_ARMADAXP)
-#define MAIN_IRQ_NUM   116
-#define ERR_IRQ_NUM32
-#define ERR_IRQ(MAIN_IRQ_NUM)
-#define MSI_IRQ_NUM32
-#define MSI_IRQ(ERR_IRQ + ERR_IRQ_NUM)
-#define NIRQ   (MAIN_IRQ_NUM + ERR_IRQ_NUM + MSI_IRQ_NUM)
 #else
 #define NIRQ   32
 #endif

Modified: head/sys/arm/mv/mpic.c
==
--- head/sys/arm/mv/mpic.c  Tue Apr  3 21:16:41 2018(r331950)
+++ head/sys/arm/mv/mpic.c  Tue Apr  3 21:17:19 2018(r331951)
@@ -103,12 +103,10 @@ __FBSDID("$FreeBSD$");
 
 #defineMPIC_PPI32
 
-#ifdef INTRNG
 struct mv_mpic_irqsrc {
struct intr_irqsrc  mmi_isrc;
u_int   mmi_irq;
 };
-#endif
 
 struct mv_mpic_softc {
device_tsc_dev;
@@ -120,9 +118,7 @@ struct mv_mpic_softc {
bus_space_tag_t drbl_bst;
bus_space_handle_t  drbl_bsh;
struct mtx  mtx;
-#ifdef INTRNG
struct mv_mpic_irqsrc * mpic_isrcs;
-#endif
int nirqs;
void *  intr_hand;
 };
@@ -155,10 +151,12 @@ static void   mpic_mask_irq(uintptr_t nb);
 static voidmpic_mask_irq_err(uintptr_t nb);
 static voidmpic_unmask_irq_err(uintptr_t nb);
 static boolean_t mpic_irq_is_percpu(uintptr_t);
-#ifdef INTRNG
 static int mpic_intr(void *arg);
-#endif
 static voidmpic_unmask_msi(void);
+void mpic_init_secondary(device_t);
+void mpic_ipi_send(device_t, struct intr_irqsrc*, cpuset_t, u_int);
+int mpic_ipi_read(int);
+void mpic_ipi_clear(int);
 
 #defineMPIC_WRITE(softc, reg, val) \
 bus_space_write_4((softc)->mpic_bst, (softc)->mpic_bsh, (reg), (val))
@@ -189,7 +187,6 @@ mv_mpic_probe(device_t dev)
return (0);
 }
 
-#ifdef INTRNG
 static int
 mv_mpic_register_isrcs(struct mv_mpic_softc *sc)
 {
@@ -221,7 +218,6 @@ mv_mpic_register_isrcs(struct mv_mpic_softc *sc)
}
return (0);
 }
-#endif
 
 static int
 mv_mpic_attach(device_t dev)
@@ -246,13 +242,11 @@ mv_mpic_attach(device_t dev)
device_printf(dev, "could not allocate resources\n");
return (ENXIO);
}
-#ifdef INTRNG
if (sc->mpic_res[3] == NULL)
device_printf(dev, "No interrupt to use.\n");
else
bus_setup_intr(dev, sc->mpic_res[3], INTR_TYPE_CLK,
mpic_intr, NULL, sc, >intr_hand);
-#endif
 
sc->mpic_bst = rman_get_bustag(sc->mpic_res[0]);
sc->mpic_bsh = rman_get_bushandle(sc->mpic_res[0]);
@@ -272,7 +266,6 @@ mv_mpic_attach(device_t dev)
val = MPIC_READ(mv_mpic_sc, MPIC_CTRL);
sc->nirqs = MPIC_CTRL_NIRQS(val);
 
-#ifdef INTRNG
if (mv_mpic_register_isrcs(sc) != 0) {
device_printf(dev, "could not register PIC ISRCs\n");
bus_release_resources(dev, mv_mpic_spec, sc->mpic_res);
@@ -286,7 +279,6 @@ mv_mpic_attach(device_t dev)
bus_release_resources(dev, mv_mpic_spec, sc->mpic_res);
return (ENXIO);
}
-#endif
 
mpic_unmask_msi();
 
@@ 

svn commit: r331950 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2018-04-03 Thread Alexander Motin
Author: mav
Date: Tue Apr  3 21:16:41 2018
New Revision: 331950
URL: https://svnweb.freebsd.org/changeset/base/331950

Log:
  9434 Speculative prefetch is blocked by device removal code.
  
  Device removal code does not set spa_indirect_vdevs_loaded for pools
  that never experienced device removal.  At least one visual consequence
  of it is completely blocked speculative prefetcher.  This patch sets
  the variable in such situations.

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

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_removal.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_removal.c  Tue Apr 
 3 21:08:10 2018(r331949)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_removal.c  Tue Apr 
 3 21:16:41 2018(r331950)
@@ -368,6 +368,7 @@ spa_remove_init(spa_t *spa)
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;
return (0);
} else if (error != 0) {
return (error);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r331949 - in head/usr.bin: . etdump

2018-04-03 Thread Benno Rice
Author: benno
Date: Tue Apr  3 21:08:10 2018
New Revision: 331949
URL: https://svnweb.freebsd.org/changeset/base/331949

Log:
  Add the etdump utility for dumping El Torito boot catalog information.
  
  This can be used to check existing images but will be used in the future to
  find EFI ESP images placed in El Torito catalogs so they can be used for
  hybrid boot purposes.
  
  Reviewed by:  imp (code), sbruno (man page), bcr (man page)
  Sponsored by: iXsystems, Inc.
  Differential Revision:https://reviews.freebsd.org/D14952

Added:
  head/usr.bin/etdump/
  head/usr.bin/etdump/Makefile   (contents, props changed)
  head/usr.bin/etdump/etdump.1   (contents, props changed)
  head/usr.bin/etdump/etdump.c   (contents, props changed)
  head/usr.bin/etdump/etdump.h   (contents, props changed)
  head/usr.bin/etdump/output_shell.c   (contents, props changed)
  head/usr.bin/etdump/output_text.c   (contents, props changed)
Modified:
  head/usr.bin/Makefile

Modified: head/usr.bin/Makefile
==
--- head/usr.bin/Makefile   Tue Apr  3 20:59:46 2018(r331948)
+++ head/usr.bin/Makefile   Tue Apr  3 21:08:10 2018(r331949)
@@ -41,6 +41,7 @@ SUBDIR=   alias \
elfdump \
enigma \
env \
+   etdump \
expand \
false \
fetch \

Added: head/usr.bin/etdump/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/etdump/MakefileTue Apr  3 21:08:10 2018
(r331949)
@@ -0,0 +1,14 @@
+# $FreeBSD$
+
+PROG=  etdump
+
+MAKEFS_SRC=${SRCTOP}/usr.sbin/makefs
+
+CFLAGS+=   -I${SRCTOP}/sys/fs/cd9660 -I${MAKEFS_SRC} \
+   -I${MAKEFS_SRC}/cd9660
+
+.PATH: ${MAKEFS_SRC}/cd9660
+
+SRCS=  etdump.c output_shell.c output_text.c cd9660_conversion.c
+
+.include 

Added: head/usr.bin/etdump/etdump.1
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/etdump/etdump.1Tue Apr  3 21:08:10 2018
(r331949)
@@ -0,0 +1,104 @@
+.\" Copyright (c) 2018 iXsystems, Inc
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd April 3, 2018
+.Dt ETDUMP 8
+.Os
+.Sh NAME
+.Nm etdump
+.Nd Dump El Torito boot catalog information from ISO images
+.Sh SYNOPSIS
+.Nm
+.Op Fl f Ar format
+.Op Fl o Ar file
+.Ar
+.Sh DESCRIPTION
+This program reads El Torito boot catalog information from an ISO image and
+outputs it in various formats.
+It can be used to check the catalog in an image or to output catalog data in
+a format that can be used by other tools such as shell scripts.
+.Pp
+Supported options are:
+.Bl -tag -width flag
+.It Fl f Ar format Fl -format Ar format
+Select the output format.
+Supported output formats are:
+.Bl -tag -width shell -offset indent
+.It Sy text
+Human-readable text (default)
+.It Sy shell
+Each boot entry is emitted as a string suitable for passing to a sh-compatible
+eval command.
+The variables emitted are:
+.Bl -tag -width et_platform -offset indent
+.It et_platform
+The platform ID from the section header.
+Set to 'default' for the initial (default) entry.
+.It et_system
+The system ID from the boot entry.
+.It et_lba
+The starting LBA (2048-byte blocks) of the boot image.
+.It et_sectors
+The number of sectors (512-byte sectors) that comprise the boot image.
+.El
+.El
+.It Fl o Ar file Fl -output Ar file
+Write output to
+.Ar file .
+If '-' is specified then standard out is used.
+.El
+.Sh EXAMPLES

Re: svn commit: r331943 - head/include

2018-04-03 Thread Cy Schubert
In message <20180403204057.gm1...@kib.kiev.ua>, Konstantin Belousov 
writes:
> On Tue, Apr 03, 2018 at 08:14:37PM +, Cy Schubert wrote:
> > Author: cy
> > Date: Tue Apr  3 20:14:37 2018
> > New Revision: 331943
> > URL: https://svnweb.freebsd.org/changeset/base/331943
> > 
> > Log:
> >   Include update to stdio.h missed in r331936.
> >   
> >   In my attempt to limit the commit in r331936 to only the gets_s()
> >   commit and not include unrelated patches in my tree, this patch
> >   was missed.
> >   
> >   Reported by:  pfg
> >   MFC after:2 weeks
> >   X-MFC with:   r331936
> >   Differential Revision:https://reviews.freebsd.org/D12785
> > 
> > Modified:
> >   head/include/stdio.h
> > 
> > Modified: head/include/stdio.h
> > ===
> ===
> > --- head/include/stdio.hTue Apr  3 19:51:23 2018(r331942)
> > +++ head/include/stdio.hTue Apr  3 20:14:37 2018(r331943)
> > @@ -51,6 +51,11 @@ typedef  __size_tsize_t;
> >  #define_SIZE_T_DECLARED
> >  #endif
> >  
> > +#ifndef _RSIZE_T_DEFINED
> > +#define _RSIZE_T_DEFINED
> > +typedef size_t rsize_t;
> > +#endif
> > +
> >  #if __POSIX_VISIBLE >= 200809
> >  #ifndef _OFF_T_DECLARED
> >  #define_OFF_T_DECLARED
> > @@ -265,6 +270,9 @@ size_t   fwrite(const void * __restrict, size_t, size_t
> >  int getc(FILE *);
> >  int getchar(void);
> >  char   *gets(char *);
> > +#if defined(__EXT1_VISIBLE) && __EXT1_VISIBLE == 1
> What is the purpose of the __EXT1_VISIBLE == 1 check ?
> It is against the intended __XX_VISIBLE mechanism construction.

That appears to have been left over in my commit tree.

>
> > +char   *gets_s(char *, rsize_t); 
> > +#endif
> >  voidperror(const char *);
> >  int printf(const char * __restrict, ...);
> >  int putc(int, FILE *);

-- 
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: r331948 - head/include

2018-04-03 Thread Cy Schubert
Author: cy
Date: Tue Apr  3 20:59:46 2018
New Revision: 331948
URL: https://svnweb.freebsd.org/changeset/base/331948

Log:
  Remove redundant check.
  
  Reported by:  kib@
  MFC after:2 weeks
  X-MFC with:   r331936
  Differential Revision:https://reviews.freebsd.org/D12785

Modified:
  head/include/stdio.h

Modified: head/include/stdio.h
==
--- head/include/stdio.hTue Apr  3 20:53:53 2018(r331947)
+++ head/include/stdio.hTue Apr  3 20:59:46 2018(r331948)
@@ -270,7 +270,7 @@ size_t   fwrite(const void * __restrict, size_t, size_t
 int getc(FILE *);
 int getchar(void);
 char   *gets(char *);
-#if defined(__EXT1_VISIBLE) && __EXT1_VISIBLE == 1
+#if __EXT1_VISIBLE
 char   *gets_s(char *, rsize_t);
 #endif
 voidperror(const char *);
___
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: r331945 - head/lib/libc/stdio

2018-04-03 Thread Cy Schubert
In message <20180403205431.go1...@kib.kiev.ua>, Konstantin Belousov 
writes:
> On Tue, Apr 03, 2018 at 08:38:25PM +, Cy Schubert wrote:
> > Author: cy
> > Date: Tue Apr  3 20:38:25 2018
> > New Revision: 331945
> > URL: https://svnweb.freebsd.org/changeset/base/331945
> > 
> > Log:
> >   Correct the version number for gets_s(3).
> >   
> >   Reported by:  kib@
> >   MFC after:2 weeks
> >   X-MFC with:   r331936
> >   Differential Revision:https://reviews.freebsd.org/D12785
> > 
> > Modified:
> >   head/lib/libc/stdio/Symbol.map
> > 
> > Modified: head/lib/libc/stdio/Symbol.map
> > ===
> ===
> > --- head/lib/libc/stdio/Symbol.map  Tue Apr  3 20:22:02 2018(r33194
> 4)
> > +++ head/lib/libc/stdio/Symbol.map  Tue Apr  3 20:38:25 2018(r33194
> 5)
> > @@ -160,12 +160,12 @@ FBSD_1.3 {
> Please re-read my previous mail.

We are out of sync, before you explained it to me.


-- 
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"


Re: svn commit: r331945 - head/lib/libc/stdio

2018-04-03 Thread Konstantin Belousov
On Tue, Apr 03, 2018 at 08:38:25PM +, Cy Schubert wrote:
> Author: cy
> Date: Tue Apr  3 20:38:25 2018
> New Revision: 331945
> URL: https://svnweb.freebsd.org/changeset/base/331945
> 
> Log:
>   Correct the version number for gets_s(3).
>   
>   Reported by:kib@
>   MFC after:  2 weeks
>   X-MFC with: r331936
>   Differential Revision:  https://reviews.freebsd.org/D12785
> 
> Modified:
>   head/lib/libc/stdio/Symbol.map
> 
> Modified: head/lib/libc/stdio/Symbol.map
> ==
> --- head/lib/libc/stdio/Symbol.mapTue Apr  3 20:22:02 2018
> (r331944)
> +++ head/lib/libc/stdio/Symbol.mapTue Apr  3 20:38:25 2018
> (r331945)
> @@ -160,12 +160,12 @@ FBSD_1.3 {
Please re-read my previous mail.

>   open_wmemstream;
>   mkostemp;
>   mkostemps;
> + gets_s;
>  };
>  
>  FBSD_1.4 {
>   fdclose;
>   fopencookie;
> - gets_s;
>  };
>  
>  FBSDprivate_1.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: r331947 - head/lib/libc/stdio

2018-04-03 Thread Cy Schubert
Author: cy
Date: Tue Apr  3 20:53:53 2018
New Revision: 331947
URL: https://svnweb.freebsd.org/changeset/base/331947

Log:
  The correct symbol version for FreeBSD 12 is 1.5.
  
  Reported by:  kib@
  MFC after:2 weeks
  X-MFC with:   r331936
  Differential Revision:https://reviews.freebsd.org/D12785

Modified:
  head/lib/libc/stdio/Symbol.map

Modified: head/lib/libc/stdio/Symbol.map
==
--- head/lib/libc/stdio/Symbol.map  Tue Apr  3 20:41:57 2018
(r331946)
+++ head/lib/libc/stdio/Symbol.map  Tue Apr  3 20:53:53 2018
(r331947)
@@ -160,12 +160,15 @@ FBSD_1.3 {
open_wmemstream;
mkostemp;
mkostemps;
-   gets_s;
 };
 
 FBSD_1.4 {
fdclose;
fopencookie;
+};
+
+FBSD_1.5 {
+   gets_s;
 };
 
 FBSDprivate_1.0 {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r331936 - in head/lib/libc: stdio tests/stdio

2018-04-03 Thread Cy Schubert
In message <20180403204240.gn1...@kib.kiev.ua>, Konstantin Belousov 
writes:
> On Tue, Apr 03, 2018 at 01:24:42PM -0700, Cy Schubert wrote:
> > In message <20180403202010.gk1...@kib.kiev.ua>, Konstantin Belousov 
> > writes:
> > > On Tue, Apr 03, 2018 at 06:52:39PM +, Cy Schubert wrote:
> > > > Modified: head/lib/libc/stdio/Symbol.map
> > > > ===
> 
> > > ===
> > > > --- head/lib/libc/stdio/Symbol.map  Tue Apr  3 18:43:00 2018
>   (r33193
> > > 5)
> > > > +++ head/lib/libc/stdio/Symbol.map  Tue Apr  3 18:52:38 2018
>   (r33193
> > > 6)
> > > > @@ -165,6 +165,7 @@ FBSD_1.3 {
> > > >  FBSD_1.4 {
> > > > fdclose;
> > > > fopencookie;
> > > > +   gets_s;
> > > >  };
> > > This is wrong.
> > 
> > Would you suggest a different version number?
>
> Right version number for HEAD while it is 12 is FBSD_1.5.  You will need
> to add it to stdio/Symbol.map since this is the first symbol in that
> namespace from stdio subdirectory.

Ok. I understand now.


-- 
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"


Re: svn commit: r331936 - in head/lib/libc: stdio tests/stdio

2018-04-03 Thread Konstantin Belousov
On Tue, Apr 03, 2018 at 01:24:42PM -0700, Cy Schubert wrote:
> In message <20180403202010.gk1...@kib.kiev.ua>, Konstantin Belousov 
> writes:
> > On Tue, Apr 03, 2018 at 06:52:39PM +, Cy Schubert wrote:
> > > Modified: head/lib/libc/stdio/Symbol.map
> > > ===
> > ===
> > > --- head/lib/libc/stdio/Symbol.mapTue Apr  3 18:43:00 2018
> > > (r33193
> > 5)
> > > +++ head/lib/libc/stdio/Symbol.mapTue Apr  3 18:52:38 2018
> > > (r33193
> > 6)
> > > @@ -165,6 +165,7 @@ FBSD_1.3 {
> > >  FBSD_1.4 {
> > >   fdclose;
> > >   fopencookie;
> > > + gets_s;
> > >  };
> > This is wrong.
> 
> Would you suggest a different version number?

Right version number for HEAD while it is 12 is FBSD_1.5.  You will need
to add it to stdio/Symbol.map since this is the first symbol in that
namespace from stdio subdirectory.
___
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: r331943 - head/include

2018-04-03 Thread Konstantin Belousov
On Tue, Apr 03, 2018 at 08:14:37PM +, Cy Schubert wrote:
> Author: cy
> Date: Tue Apr  3 20:14:37 2018
> New Revision: 331943
> URL: https://svnweb.freebsd.org/changeset/base/331943
> 
> Log:
>   Include update to stdio.h missed in r331936.
>   
>   In my attempt to limit the commit in r331936 to only the gets_s()
>   commit and not include unrelated patches in my tree, this patch
>   was missed.
>   
>   Reported by:pfg
>   MFC after:  2 weeks
>   X-MFC with: r331936
>   Differential Revision:  https://reviews.freebsd.org/D12785
> 
> Modified:
>   head/include/stdio.h
> 
> Modified: head/include/stdio.h
> ==
> --- head/include/stdio.h  Tue Apr  3 19:51:23 2018(r331942)
> +++ head/include/stdio.h  Tue Apr  3 20:14:37 2018(r331943)
> @@ -51,6 +51,11 @@ typedef__size_tsize_t;
>  #define  _SIZE_T_DECLARED
>  #endif
>  
> +#ifndef _RSIZE_T_DEFINED
> +#define _RSIZE_T_DEFINED
> +typedef size_t rsize_t;
> +#endif
> +
>  #if __POSIX_VISIBLE >= 200809
>  #ifndef _OFF_T_DECLARED
>  #define  _OFF_T_DECLARED
> @@ -265,6 +270,9 @@ size_t fwrite(const void * __restrict, size_t, size_t
>  int   getc(FILE *);
>  int   getchar(void);
>  char *gets(char *);
> +#if defined(__EXT1_VISIBLE) && __EXT1_VISIBLE == 1
What is the purpose of the __EXT1_VISIBLE == 1 check ?
It is against the intended __XX_VISIBLE mechanism construction.

> +char *gets_s(char *, rsize_t);
> +#endif
>  void  perror(const char *);
>  int   printf(const char * __restrict, ...);
>  int   putc(int, FILE *);
___
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: r331936 - in head/lib/libc: stdio tests/stdio

2018-04-03 Thread Cy Schubert
In message <20180403202010.gk1...@kib.kiev.ua>, Konstantin Belousov 
writes:
> On Tue, Apr 03, 2018 at 06:52:39PM +, Cy Schubert wrote:
> > Modified: head/lib/libc/stdio/Symbol.map
> > ===
> ===
> > --- head/lib/libc/stdio/Symbol.map  Tue Apr  3 18:43:00 2018(r33193
> 5)
> > +++ head/lib/libc/stdio/Symbol.map  Tue Apr  3 18:52:38 2018(r33193
> 6)
> > @@ -165,6 +165,7 @@ FBSD_1.3 {
> >  FBSD_1.4 {
> > fdclose;
> > fopencookie;
> > +   gets_s;
> >  };
> This is wrong.

Fixed. Thanks for input Konstantin.


-- 
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: r331945 - head/lib/libc/stdio

2018-04-03 Thread Cy Schubert
Author: cy
Date: Tue Apr  3 20:38:25 2018
New Revision: 331945
URL: https://svnweb.freebsd.org/changeset/base/331945

Log:
  Correct the version number for gets_s(3).
  
  Reported by:  kib@
  MFC after:2 weeks
  X-MFC with:   r331936
  Differential Revision:https://reviews.freebsd.org/D12785

Modified:
  head/lib/libc/stdio/Symbol.map

Modified: head/lib/libc/stdio/Symbol.map
==
--- head/lib/libc/stdio/Symbol.map  Tue Apr  3 20:22:02 2018
(r331944)
+++ head/lib/libc/stdio/Symbol.map  Tue Apr  3 20:38:25 2018
(r331945)
@@ -160,12 +160,12 @@ FBSD_1.3 {
open_wmemstream;
mkostemp;
mkostemps;
+   gets_s;
 };
 
 FBSD_1.4 {
fdclose;
fopencookie;
-   gets_s;
 };
 
 FBSDprivate_1.0 {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r331936 - in head/lib/libc: stdio tests/stdio

2018-04-03 Thread Cy Schubert
In message <20180403202010.gk1...@kib.kiev.ua>, Konstantin Belousov 
writes:
> On Tue, Apr 03, 2018 at 06:52:39PM +, Cy Schubert wrote:
> > Modified: head/lib/libc/stdio/Symbol.map
> > ===
> ===
> > --- head/lib/libc/stdio/Symbol.map  Tue Apr  3 18:43:00 2018(r33193
> 5)
> > +++ head/lib/libc/stdio/Symbol.map  Tue Apr  3 18:52:38 2018(r33193
> 6)
> > @@ -165,6 +165,7 @@ FBSD_1.3 {
> >  FBSD_1.4 {
> > fdclose;
> > fopencookie;
> > +   gets_s;
> >  };
> This is wrong.

Would you suggest a different version number?



-- 
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"


Re: svn commit: r331936 - in head/lib/libc: stdio tests/stdio

2018-04-03 Thread Cy Schubert
In message <20180403202233.gl1...@kib.kiev.ua>, Konstantin Belousov 
writes:
> On Tue, Apr 03, 2018 at 11:20:10PM +0300, Konstantin Belousov wrote:
> > On Tue, Apr 03, 2018 at 06:52:39PM +, Cy Schubert wrote:
> > > Modified: head/lib/libc/stdio/Symbol.map
> > > =
> =
> > > --- head/lib/libc/stdio/Symbol.mapTue Apr  3 18:43:00 2018
>   (r331935)
> > > +++ head/lib/libc/stdio/Symbol.mapTue Apr  3 18:52:38 2018
>   (r331936)
> > > @@ -165,6 +165,7 @@ FBSD_1.3 {
> > >  FBSD_1.4 {
> > >   fdclose;
> > >   fopencookie;
> > > + gets_s;
> > >  };
> > This is wrong.

I replied to this previously.

>
> And then, I noticed that the function is not added to the header file as well
> ,
> am I missing it ?

I my attempt to only commit gets_s() and nothing else I missed 
committing the header file. It's there now.


-- 
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"


Re: svn commit: r331936 - in head/lib/libc: stdio tests/stdio

2018-04-03 Thread Konstantin Belousov
On Tue, Apr 03, 2018 at 11:20:10PM +0300, Konstantin Belousov wrote:
> On Tue, Apr 03, 2018 at 06:52:39PM +, Cy Schubert wrote:
> > Modified: head/lib/libc/stdio/Symbol.map
> > ==
> > --- head/lib/libc/stdio/Symbol.map  Tue Apr  3 18:43:00 2018
> > (r331935)
> > +++ head/lib/libc/stdio/Symbol.map  Tue Apr  3 18:52:38 2018
> > (r331936)
> > @@ -165,6 +165,7 @@ FBSD_1.3 {
> >  FBSD_1.4 {
> > fdclose;
> > fopencookie;
> > +   gets_s;
> >  };
> This is wrong.

And then, I noticed that the function is not added to the header file as well,
am I missing it ?
___
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: r331936 - in head/lib/libc: stdio tests/stdio

2018-04-03 Thread Konstantin Belousov
On Tue, Apr 03, 2018 at 06:52:39PM +, Cy Schubert wrote:
> Modified: head/lib/libc/stdio/Symbol.map
> ==
> --- head/lib/libc/stdio/Symbol.mapTue Apr  3 18:43:00 2018
> (r331935)
> +++ head/lib/libc/stdio/Symbol.mapTue Apr  3 18:52:38 2018
> (r331936)
> @@ -165,6 +165,7 @@ FBSD_1.3 {
>  FBSD_1.4 {
>   fdclose;
>   fopencookie;
> + gets_s;
>  };
This is wrong.
___
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: r331943 - head/include

2018-04-03 Thread Cy Schubert
Author: cy
Date: Tue Apr  3 20:14:37 2018
New Revision: 331943
URL: https://svnweb.freebsd.org/changeset/base/331943

Log:
  Include update to stdio.h missed in r331936.
  
  In my attempt to limit the commit in r331936 to only the gets_s()
  commit and not include unrelated patches in my tree, this patch
  was missed.
  
  Reported by:  pfg
  MFC after:2 weeks
  X-MFC with:   r331936
  Differential Revision:https://reviews.freebsd.org/D12785

Modified:
  head/include/stdio.h

Modified: head/include/stdio.h
==
--- head/include/stdio.hTue Apr  3 19:51:23 2018(r331942)
+++ head/include/stdio.hTue Apr  3 20:14:37 2018(r331943)
@@ -51,6 +51,11 @@ typedef  __size_tsize_t;
 #define_SIZE_T_DECLARED
 #endif
 
+#ifndef _RSIZE_T_DEFINED
+#define _RSIZE_T_DEFINED
+typedef size_t rsize_t;
+#endif
+
 #if __POSIX_VISIBLE >= 200809
 #ifndef _OFF_T_DECLARED
 #define_OFF_T_DECLARED
@@ -265,6 +270,9 @@ size_t   fwrite(const void * __restrict, size_t, size_t
 int getc(FILE *);
 int getchar(void);
 char   *gets(char *);
+#if defined(__EXT1_VISIBLE) && __EXT1_VISIBLE == 1
+char   *gets_s(char *, rsize_t);
+#endif
 voidperror(const char *);
 int printf(const char * __restrict, ...);
 int putc(int, FILE *);
___
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: r331942 - head/lib/libc/stdio

2018-04-03 Thread Cy Schubert
Author: cy
Date: Tue Apr  3 19:51:23 2018
New Revision: 331942
URL: https://svnweb.freebsd.org/changeset/base/331942

Log:
  Add gets_s(3) to the man page title (noticed by ed@).
  
  While I'm at it correct the update date in the man page.
  
  Reported by:  ed@
  MFC after:2 weeks
  X-MFC with:   r331936
  Differential Revision:https://reviews.freebsd.org/D12785

Modified:
  head/lib/libc/stdio/fgets.3

Modified: head/lib/libc/stdio/fgets.3
==
--- head/lib/libc/stdio/fgets.3 Tue Apr  3 19:39:06 2018(r331941)
+++ head/lib/libc/stdio/fgets.3 Tue Apr  3 19:51:23 2018(r331942)
@@ -32,12 +32,13 @@
 .\" @(#)fgets.38.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd May 5, 2012
+.Dd April 3, 2018
 .Dt FGETS 3
 .Os
 .Sh NAME
 .Nm fgets ,
-.Nm gets
+.Nm gets ,
+.Nm gets_s
 .Nd get a line from a stream
 .Sh LIBRARY
 .Lb libc
___
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: r331936 - in head/lib/libc: stdio tests/stdio

2018-04-03 Thread Cy Schubert
Author: cy
Date: Tue Apr  3 18:52:38 2018
New Revision: 331936
URL: https://svnweb.freebsd.org/changeset/base/331936

Log:
  Add new gets_s(3) stdio function.
  
  This implements the gets_s(3) function as documented at
  http://en.cppreference.com/w/c/io/gets. It facilitates the
  optional removal of gets(3).
  
  Reviewed by:  ed
  MFC after:2 weeks
  Relnotes: yes
  Differential Revision:https://reviews.freebsd.org/D12785

Added:
  head/lib/libc/stdio/gets_s.c
 - copied, changed from r326083, head/lib/libc/stdio/gets.c
  head/lib/libc/tests/stdio/gets_s_test.c   (contents, props changed)
Modified:
  head/lib/libc/stdio/Makefile.inc
  head/lib/libc/stdio/Symbol.map
  head/lib/libc/stdio/fgets.3
  head/lib/libc/tests/stdio/Makefile

Modified: head/lib/libc/stdio/Makefile.inc
==
--- head/lib/libc/stdio/Makefile.incTue Apr  3 18:43:00 2018
(r331935)
+++ head/lib/libc/stdio/Makefile.incTue Apr  3 18:52:38 2018
(r331936)
@@ -14,7 +14,7 @@ SRCS+=_flock_stub.c asprintf.c clrerr.c dprintf.c \
fputwc.c fputws.c fread.c freopen.c fscanf.c fseek.c fsetpos.c \
ftell.c funopen.c fvwrite.c fwalk.c fwide.c fwprintf.c fwscanf.c \
fwrite.c getc.c getchar.c getdelim.c getline.c \
-   gets.c getw.c getwc.c getwchar.c makebuf.c mktemp.c \
+   gets.c gets_s.c getw.c getwc.c getwchar.c makebuf.c mktemp.c \
open_memstream.c open_wmemstream.c \
perror.c printf.c printf-pos.c putc.c putchar.c \
puts.c putw.c putwc.c putwchar.c \
@@ -50,6 +50,7 @@ MLINKS+=ferror.3 ferror_unlocked.3 \
ferror.3 fileno.3 ferror.3 fileno_unlocked.3
 MLINKS+=fflush.3 fpurge.3
 MLINKS+=fgets.3 gets.3
+MLINKS+=fgets.3 gets_s.3
 MLINKS+=flockfile.3 ftrylockfile.3 flockfile.3 funlockfile.3
 MLINKS+=fopen.3 fdopen.3 fopen.3 freopen.3 fopen.3 fmemopen.3
 MLINKS+=fputs.3 puts.3

Modified: head/lib/libc/stdio/Symbol.map
==
--- head/lib/libc/stdio/Symbol.map  Tue Apr  3 18:43:00 2018
(r331935)
+++ head/lib/libc/stdio/Symbol.map  Tue Apr  3 18:52:38 2018
(r331936)
@@ -165,6 +165,7 @@ FBSD_1.3 {
 FBSD_1.4 {
fdclose;
fopencookie;
+   gets_s;
 };
 
 FBSDprivate_1.0 {

Modified: head/lib/libc/stdio/fgets.3
==
--- head/lib/libc/stdio/fgets.3 Tue Apr  3 18:43:00 2018(r331935)
+++ head/lib/libc/stdio/fgets.3 Tue Apr  3 18:52:38 2018(r331936)
@@ -46,6 +46,8 @@
 .Ft char *
 .Fn fgets "char * restrict str" "int size" "FILE * restrict stream"
 .Ft char *
+.Fn gets_s "char *str" "rsize_t size"
+.Ft char *
 .Fn gets "char *str"
 .Sh DESCRIPTION
 The
@@ -65,6 +67,17 @@ If any characters are read and there is no error, a
 character is appended to end the string.
 .Pp
 The
+.Fn gets_s
+function
+is equivalent to
+.Fn fgets
+with a
+.Fa stream
+of
+.Dv stdin ,
+except that the newline character (if any) is not stored in the string.
+.Pp
+The
 .Fn gets
 function
 is equivalent to
@@ -80,7 +93,8 @@ It is the caller's responsibility to ensure that the i
 if any, is sufficiently short to fit in the string.
 .Sh RETURN VALUES
 Upon successful completion,
-.Fn fgets
+.Fn fgets ,
+.Fn gets_s ,
 and
 .Fn gets
 return
@@ -94,7 +108,8 @@ they return
 .Dv NULL
 and the buffer contents are indeterminate.
 The
-.Fn fgets
+.Fn fgets ,
+.Fn gets_s ,
 and
 .Fn gets
 functions
@@ -141,6 +156,13 @@ and
 .Fn gets
 conform to
 .St -isoC-99 .
+.Fn gets_s
+conforms to
+.St -isoC-2011
+K.3.7.4.1.
+.Fn gets
+has been removed from
+.St -isoC-2011 .
 .Sh SECURITY CONSIDERATIONS
 The
 .Fn gets

Copied and modified: head/lib/libc/stdio/gets_s.c (from r326083, 
head/lib/libc/stdio/gets.c)
==
--- head/lib/libc/stdio/gets.c  Wed Nov 22 01:53:59 2017(r326083, copy 
source)
+++ head/lib/libc/stdio/gets_s.cTue Apr  3 18:52:38 2018
(r331936)
@@ -3,6 +3,8 @@
  *
  * Copyright (c) 1990, 1993
  * The Regents of the University of California.  All rights reserved.
+ * Copyright (c) 2017, 2018
+ * Cyril S. E. Schubert.  All rights reserved.
  *
  * This code is derived from software contributed to Berkeley by
  * Chris Torek.
@@ -32,49 +34,69 @@
  * SUCH DAMAGE.
  */
 
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)gets.c 8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
 #include 
 __FBSDID("$FreeBSD$");
 
 #include "namespace.h"
+#include 
 #include 
+#include 
 #include 
 #include "un-namespace.h"
 #include "libc_private.h"
 #include "local.h"
 
-__warn_references(gets, "warning: this program uses gets(), which is unsafe.");
-
-char *
-gets(char *buf)
+static inline char *
+_gets_s(char *buf, rsize_t n)
 {
int c;
-   char *s, *ret;
-   static int warned;
-   

svn commit: r331935 - head/usr.bin/vtfontcvt

2018-04-03 Thread Ed Maste
Author: emaste
Date: Tue Apr  3 18:43:00 2018
New Revision: 331935
URL: https://svnweb.freebsd.org/changeset/base/331935

Log:
  vtfontcvt: allow .bdf characters less than full height
  
  Sponsored by: The FreeBSD Foundation

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

Modified: head/usr.bin/vtfontcvt/vtfontcvt.c
==
--- head/usr.bin/vtfontcvt/vtfontcvt.c  Tue Apr  3 18:41:27 2018
(r331934)
+++ head/usr.bin/vtfontcvt/vtfontcvt.c  Tue Apr  3 18:43:00 2018
(r331935)
@@ -265,10 +265,23 @@ parse_bdf(FILE *fp, unsigned int map_idx)
 
if (strncmp(ln, "BITMAP", 6) == 0 &&
(ln[6] == ' ' || ln[6] == '\0')) {
+   /*
+* Assume that the next _height_ lines are bitmap
+* data.  ENDCHAR is allowed to terminate the bitmap
+* early but is not otherwise checked; any extra data
+* is ignored.
+*/
for (i = 0; i < height; i++) {
if ((ln = fgetln(fp, )) == NULL)
errx(1, "Unexpected EOF!");
ln[length - 1] = '\0';
+   if (strcmp(ln, "ENDCHAR") == 0) {
+   memset(bytes + i * wbytes, 0,
+   (height - i) * wbytes);
+   memset(bytes_r + i * wbytes, 0,
+   (height - i) * wbytes);
+   break;
+   }
sscanf(ln, "%x", );
if (parse_bitmap_line(bytes + i * wbytes,
 bytes_r + i * wbytes, line, dwidth) != 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: r331934 - head/sys/compat/linuxkpi/common/src

2018-04-03 Thread Mark Johnston
Author: markj
Date: Tue Apr  3 18:41:27 2018
New Revision: 331934
URL: https://svnweb.freebsd.org/changeset/base/331934

Log:
  Wrap long lines.
  
  MFC after:3 days

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.cTue Apr  3 
18:39:49 2018(r331933)
+++ head/sys/compat/linuxkpi/common/src/linux_schedule.cTue Apr  3 
18:41:27 2018(r331934)
@@ -267,7 +267,8 @@ linux_wait_event_common(wait_queue_head_t *wqh, wait_q
PHOLD(task->task_thread->td_proc);
sleepq_lock(task);
if (atomic_read(>state) != TASK_WAKING) {
-   ret = linux_add_to_sleepqueue(task, task, "wevent", timeout, 
state);
+   ret = linux_add_to_sleepqueue(task, task, "wevent", timeout,
+   state);
} else {
sleepq_release(task);
ret = 0;
@@ -300,7 +301,8 @@ linux_schedule_timeout(int timeout)
sleepq_lock(task);
state = atomic_read(>state);
if (state != TASK_WAKING) {
-   ret = linux_add_to_sleepqueue(task, task, "sched", timeout, 
state);
+   ret = linux_add_to_sleepqueue(task, task, "sched", timeout,
+   state);
} else {
sleepq_release(task);
ret = 0;
@@ -368,7 +370,8 @@ linux_wait_on_bit_timeout(unsigned long *word, int bit
break;
}
set_task_state(task, state);
-   ret = linux_add_to_sleepqueue(wchan, task, "wbit", timeout, 
state);
+   ret = linux_add_to_sleepqueue(wchan, task, "wbit", timeout,
+   state);
if (ret != 0)
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: r331931 - in head/sys: amd64/amd64 i386/i386 x86/x86

2018-04-03 Thread Andriy Gapon
Author: avg
Date: Tue Apr  3 17:16:06 2018
New Revision: 331931
URL: https://svnweb.freebsd.org/changeset/base/331931

Log:
  fix i386 build with CPU_ELAN (LINT for instance) after r331878
  
  x86/cpu_machdep.c now needs to include elan_mmcr.h when CPU_ELAN is set.
  While here, also remove the now unneeded inclusion of isareg.h in i386
  and amd64 vm_machdep.c.
  
  Reported by:  lwhsu
  MFC after:14 days
  X-MFC with:   r331878

Modified:
  head/sys/amd64/amd64/vm_machdep.c
  head/sys/i386/i386/vm_machdep.c
  head/sys/x86/x86/cpu_machdep.c

Modified: head/sys/amd64/amd64/vm_machdep.c
==
--- head/sys/amd64/amd64/vm_machdep.c   Tue Apr  3 15:14:30 2018
(r331930)
+++ head/sys/amd64/amd64/vm_machdep.c   Tue Apr  3 17:16:06 2018
(r331931)
@@ -82,8 +82,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
-
 _Static_assert(OFFSETOF_CURTHREAD == offsetof(struct pcpu, pc_curthread),
 "OFFSETOF_CURTHREAD does not correspond with offset of pc_curthread.");
 _Static_assert(OFFSETOF_CURPCB == offsetof(struct pcpu, pc_curpcb),

Modified: head/sys/i386/i386/vm_machdep.c
==
--- head/sys/i386/i386/vm_machdep.c Tue Apr  3 15:14:30 2018
(r331930)
+++ head/sys/i386/i386/vm_machdep.c Tue Apr  3 17:16:06 2018
(r331931)
@@ -79,18 +79,12 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#ifdef CPU_ELAN
-#include 
-#endif
-
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
-
-#include 
 
 #ifndef NSFBUFS
 #defineNSFBUFS (512 + maxusers * 16)

Modified: head/sys/x86/x86/cpu_machdep.c
==
--- head/sys/x86/x86/cpu_machdep.c  Tue Apr  3 15:14:30 2018
(r331930)
+++ head/sys/x86/x86/cpu_machdep.c  Tue Apr  3 17:16:06 2018
(r331931)
@@ -85,6 +85,9 @@ __FBSDID("$FreeBSD$");
 #ifdef SMP
 #include 
 #endif
+#ifdef CPU_ELAN
+#include 
+#endif
 #include 
 
 #include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r331546 - head/etc/rc.d

2018-04-03 Thread Kristof Provost

On 3 Apr 2018, at 18:06, Gleb Smirnoff wrote:

On Tue, Apr 03, 2018 at 08:49:09AM +0200, Kristof Provost wrote:
K> On 3 Apr 2018, at 0:04, Gleb Smirnoff wrote:
K> > I just want to note that this is a huge change of behaviour
K> > of pf(4) for a user. Over a decade everybody has been used
K> > to the difference between "reload" and "resync".
K>
K> There is no difference. r330105 removed the ‘$pf_program -Fnat 
-Fqueue

K> -Frules -FSources -Finfo -FTables -Fosfp’ line, but this never
K> actually did what the author thought it did.
K> pfctl only ever performed the last ‘-F’, not all of them, so 
all

K> this ever did was flush the OS fingerprints information. Clearly
K> that’s not what was intended.
K>
K> pf never actually breaks existing connections, because existing 
states
K> keep using the rule that created them, regardless of the current 
rules.

K> It wouldn’t have broken connections with resync either. A
K> ‘restart’ will, because ‘start’ does ‘pfctl -F all’.
K>
K> If the flush had actually done what was intended it’d arguably 
have
K> been a security issue, because reloading rules would then (briefly) 
open

K> the firewall, allowing all traffic to pass and establish state.

Hmm, may be I am wrong, but back when I was actively working with pf,
the "reload" command would break the ssh connection I am using, so
I have taught myself to use "resync".

Apparently reload used to have a ‘${pf_program:-/sbin/pfctl} -Fa’, 
which would have flushed everything and killed your connection.
That was removed back in 2005 (April 4th, so pretty much exactly 13 
years ago), and replaced by the erroneous ‘-Fnat -Fqueue -Frules 
-FSources -Finfo -FTables -Fosfp’ version.


Regards,
Kristof
___
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: r331546 - head/etc/rc.d

2018-04-03 Thread Gleb Smirnoff
On Tue, Apr 03, 2018 at 09:06:46AM -0700, Gleb Smirnoff wrote:
T> Hmm, may be I am wrong, but back when I was actively working with pf,
T> the "reload" command would break the ssh connection I am using, so
T> I have taught myself to use "resync".

Just checked on r328916, and it doesn't happen. 

-- 
Gleb Smirnoff
___
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: r331546 - head/etc/rc.d

2018-04-03 Thread Gleb Smirnoff
On Tue, Apr 03, 2018 at 08:49:09AM +0200, Kristof Provost wrote:
K> On 3 Apr 2018, at 0:04, Gleb Smirnoff wrote:
K> > I just want to note that this is a huge change of behaviour
K> > of pf(4) for a user. Over a decade everybody has been used
K> > to the difference between "reload" and "resync".
K> 
K> There is no difference. r330105 removed the ‘$pf_program -Fnat -Fqueue 
K> -Frules -FSources -Finfo -FTables -Fosfp’ line, but this never 
K> actually did what the author thought it did.
K> pfctl only ever performed the last ‘-F’, not all of them, so all 
K> this ever did was flush the OS fingerprints information. Clearly 
K> that’s not what was intended.
K> 
K> pf never actually breaks existing connections, because existing states 
K> keep using the rule that created them, regardless of the current rules.
K> It wouldn’t have broken connections with resync either. A 
K> ‘restart’ will, because ‘start’ does ‘pfctl -F all’.
K> 
K> If the flush had actually done what was intended it’d arguably have 
K> been a security issue, because reloading rules would then (briefly) open 
K> the firewall, allowing all traffic to pass and establish state.

Hmm, may be I am wrong, but back when I was actively working with pf,
the "reload" command would break the ssh connection I am using, so
I have taught myself to use "resync".

If I am wrong, please go forward :)

-- 
Gleb Smirnoff
___
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: r331926 - head/sys/netinet

2018-04-03 Thread Jonathan T. Looney
Author: jtl
Date: Tue Apr  3 13:54:38 2018
New Revision: 331926
URL: https://svnweb.freebsd.org/changeset/base/331926

Log:
  r330675 introduced an extra window check in the LRO code to ensure it
  captured and reported the highest window advertisement with the same
  SEQ/ACK.  However, the window comparison uses modulo 2**16 math, rather
  than directly comparing the absolute values.  Because windows use
  absolute values and not modulo 2**16 math (i.e. they don't wrap), we
  need to compare the absolute values.
  
  Reviewed by:  gallatin
  MFC after:3 days
  Sponsored by: Netflix, Inc.
  Differential Revision:https://reviews.freebsd.org/D14937

Modified:
  head/sys/netinet/tcp_seq.h

Modified: head/sys/netinet/tcp_seq.h
==
--- head/sys/netinet/tcp_seq.h  Tue Apr  3 13:30:40 2018(r331925)
+++ head/sys/netinet/tcp_seq.h  Tue Apr  3 13:54:38 2018(r331926)
@@ -47,10 +47,10 @@
 #defineSEQ_MIN(a, b)   ((SEQ_LT(a, b)) ? (a) : (b))
 #defineSEQ_MAX(a, b)   ((SEQ_GT(a, b)) ? (a) : (b))
 
-#defineWIN_LT(a,b) ((short)(ntohs(a)-ntohs(b)) < 0)
-#defineWIN_LEQ(a,b)((short)(ntohs(a)-ntohs(b)) <= 0)
-#defineWIN_GT(a,b) ((short)(ntohs(a)-ntohs(b)) > 0)
-#defineWIN_GEQ(a,b)((short)(ntohs(a)-ntohs(b)) >= 0)
+#defineWIN_LT(a,b) (ntohs(a) < ntohs(b))
+#defineWIN_LEQ(a,b)(ntohs(a) <= ntohs(b))
+#defineWIN_GT(a,b) (ntohs(a) > ntohs(b))
+#defineWIN_GEQ(a,b)(ntohs(a) >= ntohs(b))
 
 #defineWIN_MIN(a, b)   ((WIN_LT(a, b)) ? (a) : (b))
 #defineWIN_MAX(a, b)   ((WIN_GT(a, b)) ? (a) : (b))
___
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: r331925 - head/sys/dev/fdt

2018-04-03 Thread Andrew Turner
Author: andrew
Date: Tue Apr  3 13:30:40 2018
New Revision: 331925
URL: https://svnweb.freebsd.org/changeset/base/331925

Log:
  Remove fdt_is_enabled, fdt_reg_to_rl, and fdt_get_unit. These are not used
  by anything in the tree.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/dev/fdt/fdt_common.c
  head/sys/dev/fdt/fdt_common.h

Modified: head/sys/dev/fdt/fdt_common.c
==
--- head/sys/dev/fdt/fdt_common.c   Tue Apr  3 11:01:50 2018
(r331924)
+++ head/sys/dev/fdt/fdt_common.c   Tue Apr  3 13:30:40 2018
(r331925)
@@ -335,28 +335,6 @@ fdt_depth_search_compatible(phandle_t start, const cha
 }
 
 int
-fdt_is_enabled(phandle_t node)
-{
-   char *stat;
-   int ena, len;
-
-   len = OF_getprop_alloc(node, "status", sizeof(char),
-   (void **));
-
-   if (len <= 0)
-   /* It is OK if no 'status' property. */
-   return (1);
-
-   /* Anything other than 'okay' means disabled. */
-   ena = 0;
-   if (strncmp((char *)stat, "okay", len) == 0)
-   ena = 1;
-
-   OF_prop_free(stat);
-   return (ena);
-}
-
-int
 fdt_is_type(phandle_t node, const char *typestr)
 {
char type[FDT_TYPE_LEN];
@@ -475,59 +453,6 @@ fdt_regsize(phandle_t node, u_long *base, u_long *size
 }
 
 int
-fdt_reg_to_rl(phandle_t node, struct resource_list *rl)
-{
-   u_long end, count, start;
-   pcell_t *reg, *regptr;
-   pcell_t addr_cells, size_cells;
-   int tuple_size, tuples;
-   int i, rv;
-   long busaddr, bussize;
-
-   if (fdt_addrsize_cells(OF_parent(node), _cells, _cells) != 0)
-   return (ENXIO);
-   if (fdt_get_range(OF_parent(node), 0, , )) {
-   busaddr = 0;
-   bussize = 0;
-   }
-
-   tuple_size = sizeof(pcell_t) * (addr_cells + size_cells);
-   tuples = OF_getprop_alloc(node, "reg", tuple_size, (void **));
-   debugf("addr_cells = %d, size_cells = %d\n", addr_cells, size_cells);
-   debugf("tuples = %d, tuple size = %d\n", tuples, tuple_size);
-   if (tuples <= 0)
-   /* No 'reg' property in this node. */
-   return (0);
-
-   regptr = reg;
-   for (i = 0; i < tuples; i++) {
-
-   rv = fdt_data_to_res(reg, addr_cells, size_cells, ,
-   );
-   if (rv != 0) {
-   resource_list_free(rl);
-   goto out;
-   }
-   reg += addr_cells + size_cells;
-
-   /* Calculate address range relative to base. */
-   start += busaddr;
-   end = start + count - 1;
-
-   debugf("reg addr start = %lx, end = %lx, count = %lx\n", start,
-   end, count);
-
-   resource_list_add(rl, SYS_RES_MEMORY, i, start, end,
-   count);
-   }
-   rv = 0;
-
-out:
-   OF_prop_free(regptr);
-   return (rv);
-}
-
-int
 fdt_get_phyaddr(phandle_t node, device_t dev, int *phy_addr, void **phy_sc)
 {
phandle_t phy_node;
@@ -710,17 +635,6 @@ fdt_get_mem_regions(struct mem_region *mr, int *mrcnt,
rv = 0;
 out:
return (rv);
-}
-
-int
-fdt_get_unit(device_t dev)
-{
-   const char * name;
-
-   name = ofw_bus_get_name(dev);
-   name = strchr(name, '@') + 1;
-
-   return (strtol(name,NULL,0));
 }
 
 int

Modified: head/sys/dev/fdt/fdt_common.h
==
--- head/sys/dev/fdt/fdt_common.h   Tue Apr  3 11:01:50 2018
(r331924)
+++ head/sys/dev/fdt/fdt_common.h   Tue Apr  3 13:30:40 2018
(r331925)
@@ -91,13 +91,10 @@ int fdt_get_range(phandle_t, int, u_long *, u_long *);
 int fdt_immr_addr(vm_offset_t);
 int fdt_regsize(phandle_t, u_long *, u_long *);
 int fdt_is_compatible_strict(phandle_t, const char *);
-int fdt_is_enabled(phandle_t);
 int fdt_pm_is_enabled(phandle_t);
 int fdt_is_type(phandle_t, const char *);
 int fdt_parent_addr_cells(phandle_t);
-int fdt_reg_to_rl(phandle_t, struct resource_list *);
 int fdt_pm(phandle_t);
-int fdt_get_unit(device_t);
 int fdt_get_chosen_bootargs(char *bootargs, size_t max_size);
 
 #endif /* _FDT_COMMON_H_ */
___
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: r331924 - in head/sys: arm/freescale/vybrid arm/mv arm/nvidia arm/nvidia/tegra124 dev/fdt

2018-04-03 Thread Andrew Turner
Author: andrew
Date: Tue Apr  3 11:01:50 2018
New Revision: 331924
URL: https://svnweb.freebsd.org/changeset/base/331924

Log:
  Switch users of fdt_is_enabled to use ofw_bus_node_status_okay. These are
  equivalent, so to prepare to remove the former move users to call the
  latter.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/arm/freescale/vybrid/vf_ccm.c
  head/sys/arm/freescale/vybrid/vf_iomuxc.c
  head/sys/arm/mv/mv_localbus.c
  head/sys/arm/nvidia/as3722_gpio.c
  head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c
  head/sys/arm/nvidia/tegra_pinmux.c
  head/sys/dev/fdt/fdt_pinctrl.c

Modified: head/sys/arm/freescale/vybrid/vf_ccm.c
==
--- head/sys/arm/freescale/vybrid/vf_ccm.c  Tue Apr  3 09:46:28 2018
(r331923)
+++ head/sys/arm/freescale/vybrid/vf_ccm.c  Tue Apr  3 11:01:50 2018
(r331924)
@@ -414,7 +414,7 @@ ccm_fdt_set(struct ccm_softc *sc)
child = OF_child(child);
}
 
-   if (!fdt_is_enabled(child))
+   if (!ofw_bus_node_status_okay(child))
continue;
 
if ((len = OF_getproplen(child, "clock_names")) > 0) {

Modified: head/sys/arm/freescale/vybrid/vf_iomuxc.c
==
--- head/sys/arm/freescale/vybrid/vf_iomuxc.c   Tue Apr  3 09:46:28 2018
(r331923)
+++ head/sys/arm/freescale/vybrid/vf_iomuxc.c   Tue Apr  3 11:01:50 2018
(r331924)
@@ -146,7 +146,7 @@ pinmux_set(struct iomuxc_softc *sc)
child = OF_child(child);
}
 
-   if (!fdt_is_enabled(child))
+   if (!ofw_bus_node_status_okay(child))
continue;
 
if ((len = OF_getproplen(child, "iomux_config")) > 0) {

Modified: head/sys/arm/mv/mv_localbus.c
==
--- head/sys/arm/mv/mv_localbus.c   Tue Apr  3 09:46:28 2018
(r331923)
+++ head/sys/arm/mv/mv_localbus.c   Tue Apr  3 11:01:50 2018
(r331924)
@@ -272,7 +272,7 @@ localbus_attach(device_t dev)
dt_child = OF_peer(dt_child)) {
 
/* Check and process 'status' property. */
-   if (!(fdt_is_enabled(dt_child)))
+   if (!(ofw_bus_node_status_okay(dt_child)))
continue;
 
if (!(fdt_pm_is_enabled(dt_child)))

Modified: head/sys/arm/nvidia/as3722_gpio.c
==
--- head/sys/arm/nvidia/as3722_gpio.c   Tue Apr  3 09:46:28 2018
(r331923)
+++ head/sys/arm/nvidia/as3722_gpio.c   Tue Apr  3 11:01:50 2018
(r331924)
@@ -271,7 +271,7 @@ int as3722_pinmux_configure(device_t dev, phandle_t cf
cfgnode = OF_node_from_xref(cfgxref);
 
for (node = OF_child(cfgnode); node != 0; node = OF_peer(node)) {
-   if (!fdt_is_enabled(node))
+   if (!ofw_bus_node_status_okay(node))
continue;
rv = as3722_pinmux_process_node(sc, node);
if (rv != 0)

Modified: head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c
==
--- head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c  Tue Apr  3 09:46:28 
2018(r331923)
+++ head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c  Tue Apr  3 11:01:50 
2018(r331924)
@@ -968,7 +968,7 @@ process_pad(struct padctl_softc *sc, phandle_t node)
}
 
for (node = OF_child(node); node != 0; node = OF_peer(node)) {
-   if (!fdt_is_enabled(node))
+   if (!ofw_bus_node_status_okay(node))
continue;
 
rv = process_lane(sc, node, pad);
@@ -1079,7 +1079,7 @@ parse_fdt(struct padctl_softc *sc, phandle_t base_node
return (ENXIO);
}
for (node = OF_child(node); node != 0; node = OF_peer(node)) {
-   if (!fdt_is_enabled(node))
+   if (!ofw_bus_node_status_okay(node))
continue;
rv = process_pad(sc, node);
if (rv != 0)
@@ -1092,7 +1092,7 @@ parse_fdt(struct padctl_softc *sc, phandle_t base_node
return (ENXIO);
}
for (node = OF_child(node); node != 0; node = OF_peer(node)) {
-   if (!fdt_is_enabled(node))
+   if (!ofw_bus_node_status_okay(node))
continue;
rv = process_port(sc, node);
if (rv != 0)

Modified: head/sys/arm/nvidia/tegra_pinmux.c
==
--- head/sys/arm/nvidia/tegra_pinmux.c  Tue Apr  3 09:46:28 2018
(r331923)
+++ head/sys/arm/nvidia/tegra_pinmux.c  Tue Apr  3 11:01:50 2018
(r331924)
@@ -710,7 

Re: svn commit: r327056 - in head/sys: kern sys x86/acpica x86/x86

2018-04-03 Thread Andriy Gapon
On 02/04/2018 18:28, Bruce Evans wrote:
> On Mon, 2 Apr 2018, Andriy Gapon wrote:
> 
>> On 21/12/2017 11:17, Bruce Evans wrote:
>>> Author: bde
>>> Date: Thu Dec 21 09:17:48 2017
>>> New Revision: 327056
>>> URL: https://svnweb.freebsd.org/changeset/base/327056
>>>
>>> Log:
>>>   Use resume_cpus() instead of restart_cpus() to resume from ACPI 
>>> suspension.
>>
>> Bruce,
>>
>> do you plan to merge this to stable/11 and maybe stable/10?
> 
> No.  I'm nit (yet?) set up to merge to stable at all, and this is not the
> first thing that I would want to merge.
> 
>> If you'd like, I can do it.  Unless you see any reason not to.
> 
> Please do it.

Done in r327056 and r327056.
All merge bugs are mine.

> It is only a small part of fixing mapping bugs for low memory which first
> showed up s incoherent page tables for vm86 (low memory was left unmapped
> all the time to handle the problem that ACPI resume needs this mapping for
> 1 instruction).  You might need the other fixes.  This one is fairly stand-
> alone but doesn't do much by itself.

I was just interested in fixing the KPI misuse (restart vs resume).
No particular "real" problems that I wanted to address.


-- 
Andriy Gapon
___
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: r331546 - head/etc/rc.d

2018-04-03 Thread Kristof Provost

On 3 Apr 2018, at 0:04, Gleb Smirnoff wrote:

I just want to note that this is a huge change of behaviour
of pf(4) for a user. Over a decade everybody has been used
to the difference between "reload" and "resync".


There is no difference. r330105 removed the ‘$pf_program -Fnat -Fqueue 
-Frules -FSources -Finfo -FTables -Fosfp’ line, but this never 
actually did what the author thought it did.
pfctl only ever performed the last ‘-F’, not all of them, so all 
this ever did was flush the OS fingerprints information. Clearly 
that’s not what was intended.


pf never actually breaks existing connections, because existing states 
keep using the rule that created them, regardless of the current rules.
It wouldn’t have broken connections with resync either. A 
‘restart’ will, because ‘start’ does ‘pfctl -F all’.


If the flush had actually done what was intended it’d arguably have 
been a security issue, because reloading rules would then (briefly) open 
the firewall, allowing all traffic to pass and establish state.



Yes, I admit
that back in 2008 the difference was awkward and annoying, but
todays I'm afraid that change would be more annoying than
keeping status quo.

This definitely shouldn't reach stable/11, absolutely.


I will wait to do the MFC until we’re in agreement about it.

Regards,
Kristof
___
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: r331908 - head/sys/x86/x86

2018-04-03 Thread Andriy Gapon
Author: avg
Date: Tue Apr  3 06:46:26 2018
New Revision: 331908
URL: https://svnweb.freebsd.org/changeset/base/331908

Log:
  fix signatures of cpu_reset_real and cpu_reset_proxy, broken in r331878
  
  When I moved these functions from i386 and amd64 to x86 I dropped their
  prototype declarations (that were correct) and left only their definitions
  that became incorrect.
  
  Reported by:  bde
  MFC after:15 days
  X-MFC with:   r331878

Modified:
  head/sys/x86/x86/cpu_machdep.c

Modified: head/sys/x86/x86/cpu_machdep.c
==
--- head/sys/x86/x86/cpu_machdep.c  Tue Apr  3 06:06:39 2018
(r331907)
+++ head/sys/x86/x86/cpu_machdep.c  Tue Apr  3 06:46:26 2018
(r331908)
@@ -251,7 +251,7 @@ cpu_halt(void)
 }
 
 static void
-cpu_reset_real()
+cpu_reset_real(void)
 {
struct region_descriptor null_idt;
int b;
@@ -324,7 +324,7 @@ cpu_reset_real()
 
 #ifdef SMP
 static void
-cpu_reset_proxy()
+cpu_reset_proxy(void)
 {
 
cpu_reset_proxy_active = 1;
@@ -338,7 +338,7 @@ cpu_reset_proxy()
 #endif
 
 void
-cpu_reset()
+cpu_reset(void)
 {
 #ifdef SMP
cpuset_t map;
___
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"