Re: Only install relevant "intrinsics" header files

2017-01-06 Thread Jonathan Gray
On Fri, Jan 06, 2017 at 10:31:21PM +0100, Mark Kettenis wrote:
> > Date: Sat, 7 Jan 2017 08:10:02 +1100
> > From: Jonathan Gray 
> > 
> > On Fri, Jan 06, 2017 at 05:26:36PM +0100, Mark Kettenis wrote:
> > > These are hardware-specific, so it makes sense to only install the
> > > ones relevant for the (target) hardware.
> > > 
> > > ok?
> > 
> > Looking at the cmake files there is also a arm_neon.h
> > generated by llvm's tablegen.
> 
> I suppose that needs some additional Makefile magic.  I'd say it's a
> separate issue though.  So ok in this diff as a first step?

Intrin.h is only used by windows, vecintrin.h only by s390intrin.h
the rest look fine as well.

The believe the reason clang installs all of these normally is as by
default the clang binary supports multiple targets but we enable
just one and the cross makefiles should pull the right headers
when needed, so yes ok jsg@

> 
> > > Index: gnu/usr.bin/clang/include/clang/intrin/Makefile
> > > ===
> > > RCS file: /cvs/src/gnu/usr.bin/clang/include/clang/intrin/Makefile,v
> > > retrieving revision 1.3
> > > diff -u -p -r1.3 Makefile
> > > --- gnu/usr.bin/clang/include/clang/intrin/Makefile   6 Jan 2017 
> > > 14:44:34 -   1.3
> > > +++ gnu/usr.bin/clang/include/clang/intrin/Makefile   6 Jan 2017 
> > > 16:24:41 -
> > > @@ -7,70 +7,70 @@ CLANG_INTR_INCDIR=  /usr/lib/clang/${LLVM
> > >  
> > >  .PATH:   ${.CURDIR}/../../../../../llvm/tools/clang/lib/Headers
> > >  
> > > -HEADERS=adxintrin.h \
> > > - altivec.h \
> > > - ammintrin.h \
> > > - arm_acle.h \
> > > - avx2intrin.h \
> > > - avx512bwintrin.h \
> > > - avx512cdintrin.h \
> > > - avx512erintrin.h \
> > > - avx512fintrin.h \
> > > - avx512vlbwintrin.h \
> > > - avx512vlintrin.h \
> > > - avx512dqintrin.h \
> > > - avx512vldqintrin.h \
> > > - pkuintrin.h \
> > > - avxintrin.h \
> > > - bmi2intrin.h \
> > > - bmiintrin.h \
> > > - __clang_cuda_runtime_wrapper.h \
> > > - cpuid.h \
> > > - cuda_builtin_vars.h \
> > > - emmintrin.h \
> > > - f16cintrin.h \
> > > - fma4intrin.h \
> > > - fmaintrin.h \
> > > - fxsrintrin.h \
> > > - htmintrin.h \
> > > - htmxlintrin.h \
> > > - ia32intrin.h \
> > > - immintrin.h \
> > > - Intrin.h \
> > > - lzcntintrin.h \
> > > - mm3dnow.h \
> > > - mmintrin.h \
> > > - mm_malloc.h \
> > > - module.modulemap \
> > > - nmmintrin.h \
> > > - pmmintrin.h \
> > > - popcntintrin.h \
> > > - prfchwintrin.h \
> > > - rdseedintrin.h \
> > > - rtmintrin.h \
> > > - s390intrin.h \
> > > - shaintrin.h \
> > > - smmintrin.h \
> > > - stdalign.h \
> > > - stdatomic.h \
> > > - stdnoreturn.h \
> > > - tbmintrin.h \
> > > - tgmath.h \
> > > - tmmintrin.h \
> > > - unwind.h \
> > > - varargs.h \
> > > - vecintrin.h \
> > > - __wmmintrin_aes.h \
> > > - wmmintrin.h \
> > > - __wmmintrin_pclmul.h \
> > > - x86intrin.h \
> > > - xmmintrin.h \
> > > - xopintrin.h \
> > > - xsaveintrin.h \
> > > - xsaveoptintrin.h \
> > > - xsavecintrin.h \
> > > - xsavesintrin.h \
> > > - xtestintrin.h
> > > +HEADERS= stdalign.h \
> > > + stdatomic.h \
> > > + stdnoreturn.h \
> > > + tgmath.h \
> > > + unwind.h \
> > > + varargs.h \
> > > + module.modulemap \
> > > +
> > > +.if ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "arm"
> > > +HEADERS+=arm_acle.h
> > > +.elif ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
> > > +HEADERS+=adxintrin.h \
> > > + ammintrin.h \
> > > + avx2intrin.h \
> > > + avx512bwintrin.h \
> > > + avx512cdintrin.h \
> > > + avx512erintrin.h \
> > > + avx512fintrin.h \
> > > + avx512vlbwintrin.h \
> > > + avx512vlintrin.h \
> > > + avx512dqintrin.h \
> > > + avx512vldqintrin.h \
> > > + pkuintrin.h \
> > > + avxintrin.h \
> > > + bmi2intrin.h \
> > > + bmiintrin.h \
> > > + cpuid.h \
> > > + emmintrin.h \
> > > + f16cintrin.h \
> > > + fma4intrin.h \
> > > + fmaintrin.h \
> > > + fxsrintrin.h \
> > > + ia32intrin.h \
> > > + immintrin.h \
> > > + lzcntintrin.h \
> > > + mm3dnow.h \
> > > + mmintrin.h \
> > > + mm_malloc.h \
> > > + nmmintrin.h \
> > > + pmmintrin.h \
> > > + popcntintrin.h \
> > > + prfchwintrin.h \
> > > + rdseedintrin.h \
> > > + rtmintrin.h \
> > > + shaintrin.h \
> > > + smmintrin.h \
> > > + tbmintrin.h \
> > > + tmmintrin.h \
> > > + __wmmintrin_aes.h \
> > > + wmmintrin.h \
> > > + __wmmintrin_pclmul.h \
> > > + x86intrin.h \
> > > + xmmintrin.h \
> > > + xopintrin.h \
> > > + xsaveintrin.h \
> > > + xsaveoptintrin.h \
> > > + xsavecintrin.h \
> > > + xsavesintrin.h \
> > > + xtestintrin.h
> > > +.elif 

Re: Only install relevant "intrinsics" header files

2017-01-06 Thread Mark Kettenis
> Date: Sat, 7 Jan 2017 08:10:02 +1100
> From: Jonathan Gray 
> 
> On Fri, Jan 06, 2017 at 05:26:36PM +0100, Mark Kettenis wrote:
> > These are hardware-specific, so it makes sense to only install the
> > ones relevant for the (target) hardware.
> > 
> > ok?
> 
> Looking at the cmake files there is also a arm_neon.h
> generated by llvm's tablegen.

I suppose that needs some additional Makefile magic.  I'd say it's a
separate issue though.  So ok in this diff as a first step?

> > Index: gnu/usr.bin/clang/include/clang/intrin/Makefile
> > ===
> > RCS file: /cvs/src/gnu/usr.bin/clang/include/clang/intrin/Makefile,v
> > retrieving revision 1.3
> > diff -u -p -r1.3 Makefile
> > --- gnu/usr.bin/clang/include/clang/intrin/Makefile 6 Jan 2017 14:44:34 
> > -   1.3
> > +++ gnu/usr.bin/clang/include/clang/intrin/Makefile 6 Jan 2017 16:24:41 
> > -
> > @@ -7,70 +7,70 @@ CLANG_INTR_INCDIR=/usr/lib/clang/${LLVM
> >  
> >  .PATH: ${.CURDIR}/../../../../../llvm/tools/clang/lib/Headers
> >  
> > -HEADERS=adxintrin.h \
> > -   altivec.h \
> > -   ammintrin.h \
> > -   arm_acle.h \
> > -   avx2intrin.h \
> > -   avx512bwintrin.h \
> > -   avx512cdintrin.h \
> > -   avx512erintrin.h \
> > -   avx512fintrin.h \
> > -   avx512vlbwintrin.h \
> > -   avx512vlintrin.h \
> > -   avx512dqintrin.h \
> > -   avx512vldqintrin.h \
> > -   pkuintrin.h \
> > -   avxintrin.h \
> > -   bmi2intrin.h \
> > -   bmiintrin.h \
> > -   __clang_cuda_runtime_wrapper.h \
> > -   cpuid.h \
> > -   cuda_builtin_vars.h \
> > -   emmintrin.h \
> > -   f16cintrin.h \
> > -   fma4intrin.h \
> > -   fmaintrin.h \
> > -   fxsrintrin.h \
> > -   htmintrin.h \
> > -   htmxlintrin.h \
> > -   ia32intrin.h \
> > -   immintrin.h \
> > -   Intrin.h \
> > -   lzcntintrin.h \
> > -   mm3dnow.h \
> > -   mmintrin.h \
> > -   mm_malloc.h \
> > -   module.modulemap \
> > -   nmmintrin.h \
> > -   pmmintrin.h \
> > -   popcntintrin.h \
> > -   prfchwintrin.h \
> > -   rdseedintrin.h \
> > -   rtmintrin.h \
> > -   s390intrin.h \
> > -   shaintrin.h \
> > -   smmintrin.h \
> > -   stdalign.h \
> > -   stdatomic.h \
> > -   stdnoreturn.h \
> > -   tbmintrin.h \
> > -   tgmath.h \
> > -   tmmintrin.h \
> > -   unwind.h \
> > -   varargs.h \
> > -   vecintrin.h \
> > -   __wmmintrin_aes.h \
> > -   wmmintrin.h \
> > -   __wmmintrin_pclmul.h \
> > -   x86intrin.h \
> > -   xmmintrin.h \
> > -   xopintrin.h \
> > -   xsaveintrin.h \
> > -   xsaveoptintrin.h \
> > -   xsavecintrin.h \
> > -   xsavesintrin.h \
> > -   xtestintrin.h
> > +HEADERS=   stdalign.h \
> > +   stdatomic.h \
> > +   stdnoreturn.h \
> > +   tgmath.h \
> > +   unwind.h \
> > +   varargs.h \
> > +   module.modulemap \
> > +
> > +.if ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "arm"
> > +HEADERS+=  arm_acle.h
> > +.elif ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
> > +HEADERS+=  adxintrin.h \
> > +   ammintrin.h \
> > +   avx2intrin.h \
> > +   avx512bwintrin.h \
> > +   avx512cdintrin.h \
> > +   avx512erintrin.h \
> > +   avx512fintrin.h \
> > +   avx512vlbwintrin.h \
> > +   avx512vlintrin.h \
> > +   avx512dqintrin.h \
> > +   avx512vldqintrin.h \
> > +   pkuintrin.h \
> > +   avxintrin.h \
> > +   bmi2intrin.h \
> > +   bmiintrin.h \
> > +   cpuid.h \
> > +   emmintrin.h \
> > +   f16cintrin.h \
> > +   fma4intrin.h \
> > +   fmaintrin.h \
> > +   fxsrintrin.h \
> > +   ia32intrin.h \
> > +   immintrin.h \
> > +   lzcntintrin.h \
> > +   mm3dnow.h \
> > +   mmintrin.h \
> > +   mm_malloc.h \
> > +   nmmintrin.h \
> > +   pmmintrin.h \
> > +   popcntintrin.h \
> > +   prfchwintrin.h \
> > +   rdseedintrin.h \
> > +   rtmintrin.h \
> > +   shaintrin.h \
> > +   smmintrin.h \
> > +   tbmintrin.h \
> > +   tmmintrin.h \
> > +   __wmmintrin_aes.h \
> > +   wmmintrin.h \
> > +   __wmmintrin_pclmul.h \
> > +   x86intrin.h \
> > +   xmmintrin.h \
> > +   xopintrin.h \
> > +   xsaveintrin.h \
> > +   xsaveoptintrin.h \
> > +   xsavecintrin.h \
> > +   xsavesintrin.h \
> > +   xtestintrin.h
> > +.elif ${MACHINE_ARCH} == "powerpc"
> > +HEADERS+=  altivec.h \
> > +   htmintrin.h \
> > +   htmxlintrin.h
> > +.endif
> >  
> >  all:   ${HEADERS}
> >  
> > 
> 



Re: Only install relevant "intrinsics" header files

2017-01-06 Thread Jonathan Gray
On Fri, Jan 06, 2017 at 05:26:36PM +0100, Mark Kettenis wrote:
> These are hardware-specific, so it makes sense to only install the
> ones relevant for the (target) hardware.
> 
> ok?

Looking at the cmake files there is also a arm_neon.h
generated by llvm's tablegen.

> 
> 
> Index: gnu/usr.bin/clang/include/clang/intrin/Makefile
> ===
> RCS file: /cvs/src/gnu/usr.bin/clang/include/clang/intrin/Makefile,v
> retrieving revision 1.3
> diff -u -p -r1.3 Makefile
> --- gnu/usr.bin/clang/include/clang/intrin/Makefile   6 Jan 2017 14:44:34 
> -   1.3
> +++ gnu/usr.bin/clang/include/clang/intrin/Makefile   6 Jan 2017 16:24:41 
> -
> @@ -7,70 +7,70 @@ CLANG_INTR_INCDIR=  /usr/lib/clang/${LLVM
>  
>  .PATH:   ${.CURDIR}/../../../../../llvm/tools/clang/lib/Headers
>  
> -HEADERS=adxintrin.h \
> - altivec.h \
> - ammintrin.h \
> - arm_acle.h \
> - avx2intrin.h \
> - avx512bwintrin.h \
> - avx512cdintrin.h \
> - avx512erintrin.h \
> - avx512fintrin.h \
> - avx512vlbwintrin.h \
> - avx512vlintrin.h \
> - avx512dqintrin.h \
> - avx512vldqintrin.h \
> - pkuintrin.h \
> - avxintrin.h \
> - bmi2intrin.h \
> - bmiintrin.h \
> - __clang_cuda_runtime_wrapper.h \
> - cpuid.h \
> - cuda_builtin_vars.h \
> - emmintrin.h \
> - f16cintrin.h \
> - fma4intrin.h \
> - fmaintrin.h \
> - fxsrintrin.h \
> - htmintrin.h \
> - htmxlintrin.h \
> - ia32intrin.h \
> - immintrin.h \
> - Intrin.h \
> - lzcntintrin.h \
> - mm3dnow.h \
> - mmintrin.h \
> - mm_malloc.h \
> - module.modulemap \
> - nmmintrin.h \
> - pmmintrin.h \
> - popcntintrin.h \
> - prfchwintrin.h \
> - rdseedintrin.h \
> - rtmintrin.h \
> - s390intrin.h \
> - shaintrin.h \
> - smmintrin.h \
> - stdalign.h \
> - stdatomic.h \
> - stdnoreturn.h \
> - tbmintrin.h \
> - tgmath.h \
> - tmmintrin.h \
> - unwind.h \
> - varargs.h \
> - vecintrin.h \
> - __wmmintrin_aes.h \
> - wmmintrin.h \
> - __wmmintrin_pclmul.h \
> - x86intrin.h \
> - xmmintrin.h \
> - xopintrin.h \
> - xsaveintrin.h \
> - xsaveoptintrin.h \
> - xsavecintrin.h \
> - xsavesintrin.h \
> - xtestintrin.h
> +HEADERS= stdalign.h \
> + stdatomic.h \
> + stdnoreturn.h \
> + tgmath.h \
> + unwind.h \
> + varargs.h \
> + module.modulemap \
> +
> +.if ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "arm"
> +HEADERS+=arm_acle.h
> +.elif ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
> +HEADERS+=adxintrin.h \
> + ammintrin.h \
> + avx2intrin.h \
> + avx512bwintrin.h \
> + avx512cdintrin.h \
> + avx512erintrin.h \
> + avx512fintrin.h \
> + avx512vlbwintrin.h \
> + avx512vlintrin.h \
> + avx512dqintrin.h \
> + avx512vldqintrin.h \
> + pkuintrin.h \
> + avxintrin.h \
> + bmi2intrin.h \
> + bmiintrin.h \
> + cpuid.h \
> + emmintrin.h \
> + f16cintrin.h \
> + fma4intrin.h \
> + fmaintrin.h \
> + fxsrintrin.h \
> + ia32intrin.h \
> + immintrin.h \
> + lzcntintrin.h \
> + mm3dnow.h \
> + mmintrin.h \
> + mm_malloc.h \
> + nmmintrin.h \
> + pmmintrin.h \
> + popcntintrin.h \
> + prfchwintrin.h \
> + rdseedintrin.h \
> + rtmintrin.h \
> + shaintrin.h \
> + smmintrin.h \
> + tbmintrin.h \
> + tmmintrin.h \
> + __wmmintrin_aes.h \
> + wmmintrin.h \
> + __wmmintrin_pclmul.h \
> + x86intrin.h \
> + xmmintrin.h \
> + xopintrin.h \
> + xsaveintrin.h \
> + xsaveoptintrin.h \
> + xsavecintrin.h \
> + xsavesintrin.h \
> + xtestintrin.h
> +.elif ${MACHINE_ARCH} == "powerpc"
> +HEADERS+=altivec.h \
> + htmintrin.h \
> + htmxlintrin.h
> +.endif
>  
>  all: ${HEADERS}
>  
> 



Only install relevant "intrinsics" header files

2017-01-06 Thread Mark Kettenis
These are hardware-specific, so it makes sense to only install the
ones relevant for the (target) hardware.

ok?


Index: gnu/usr.bin/clang/include/clang/intrin/Makefile
===
RCS file: /cvs/src/gnu/usr.bin/clang/include/clang/intrin/Makefile,v
retrieving revision 1.3
diff -u -p -r1.3 Makefile
--- gnu/usr.bin/clang/include/clang/intrin/Makefile 6 Jan 2017 14:44:34 
-   1.3
+++ gnu/usr.bin/clang/include/clang/intrin/Makefile 6 Jan 2017 16:24:41 
-
@@ -7,70 +7,70 @@ CLANG_INTR_INCDIR=/usr/lib/clang/${LLVM
 
 .PATH: ${.CURDIR}/../../../../../llvm/tools/clang/lib/Headers
 
-HEADERS=adxintrin.h \
-   altivec.h \
-   ammintrin.h \
-   arm_acle.h \
-   avx2intrin.h \
-   avx512bwintrin.h \
-   avx512cdintrin.h \
-   avx512erintrin.h \
-   avx512fintrin.h \
-   avx512vlbwintrin.h \
-   avx512vlintrin.h \
-   avx512dqintrin.h \
-   avx512vldqintrin.h \
-   pkuintrin.h \
-   avxintrin.h \
-   bmi2intrin.h \
-   bmiintrin.h \
-   __clang_cuda_runtime_wrapper.h \
-   cpuid.h \
-   cuda_builtin_vars.h \
-   emmintrin.h \
-   f16cintrin.h \
-   fma4intrin.h \
-   fmaintrin.h \
-   fxsrintrin.h \
-   htmintrin.h \
-   htmxlintrin.h \
-   ia32intrin.h \
-   immintrin.h \
-   Intrin.h \
-   lzcntintrin.h \
-   mm3dnow.h \
-   mmintrin.h \
-   mm_malloc.h \
-   module.modulemap \
-   nmmintrin.h \
-   pmmintrin.h \
-   popcntintrin.h \
-   prfchwintrin.h \
-   rdseedintrin.h \
-   rtmintrin.h \
-   s390intrin.h \
-   shaintrin.h \
-   smmintrin.h \
-   stdalign.h \
-   stdatomic.h \
-   stdnoreturn.h \
-   tbmintrin.h \
-   tgmath.h \
-   tmmintrin.h \
-   unwind.h \
-   varargs.h \
-   vecintrin.h \
-   __wmmintrin_aes.h \
-   wmmintrin.h \
-   __wmmintrin_pclmul.h \
-   x86intrin.h \
-   xmmintrin.h \
-   xopintrin.h \
-   xsaveintrin.h \
-   xsaveoptintrin.h \
-   xsavecintrin.h \
-   xsavesintrin.h \
-   xtestintrin.h
+HEADERS=   stdalign.h \
+   stdatomic.h \
+   stdnoreturn.h \
+   tgmath.h \
+   unwind.h \
+   varargs.h \
+   module.modulemap \
+
+.if ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "arm"
+HEADERS+=  arm_acle.h
+.elif ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
+HEADERS+=  adxintrin.h \
+   ammintrin.h \
+   avx2intrin.h \
+   avx512bwintrin.h \
+   avx512cdintrin.h \
+   avx512erintrin.h \
+   avx512fintrin.h \
+   avx512vlbwintrin.h \
+   avx512vlintrin.h \
+   avx512dqintrin.h \
+   avx512vldqintrin.h \
+   pkuintrin.h \
+   avxintrin.h \
+   bmi2intrin.h \
+   bmiintrin.h \
+   cpuid.h \
+   emmintrin.h \
+   f16cintrin.h \
+   fma4intrin.h \
+   fmaintrin.h \
+   fxsrintrin.h \
+   ia32intrin.h \
+   immintrin.h \
+   lzcntintrin.h \
+   mm3dnow.h \
+   mmintrin.h \
+   mm_malloc.h \
+   nmmintrin.h \
+   pmmintrin.h \
+   popcntintrin.h \
+   prfchwintrin.h \
+   rdseedintrin.h \
+   rtmintrin.h \
+   shaintrin.h \
+   smmintrin.h \
+   tbmintrin.h \
+   tmmintrin.h \
+   __wmmintrin_aes.h \
+   wmmintrin.h \
+   __wmmintrin_pclmul.h \
+   x86intrin.h \
+   xmmintrin.h \
+   xopintrin.h \
+   xsaveintrin.h \
+   xsaveoptintrin.h \
+   xsavecintrin.h \
+   xsavesintrin.h \
+   xtestintrin.h
+.elif ${MACHINE_ARCH} == "powerpc"
+HEADERS+=  altivec.h \
+   htmintrin.h \
+   htmxlintrin.h
+.endif
 
 all:   ${HEADERS}
 



Re: Allow install from https server w/ self signed cert

2017-01-06 Thread RD Thrush
On 01/06/17 06:28, Stuart Henderson wrote:
> Related to this (and particularly thinking about autoinstalls),
> would it make sense to allow explicit protocols in the hostname?
> 
> some.host -> https with http fallback
> http://some.host/ -> http only
> https://some.host/ -> https only, no fallback

That would totally work for my install problem.

FWIW, instead of running a patched install.sub, "rm /etc/ssl/cert.pem" makes 
the install bypass the https attempt.



Re: vndcompress et al import?

2017-01-06 Thread Stuart Henderson
On 2017/01/06 15:36, Franco Fichtner wrote:
> Hi Ted,
> 
> Thanks, this is very helpful.  Don't mind exploring other
> routes as long as they are sustainable within OpenBSD, e.g.
> if kernel changes are needed that they are provided by the
> standard kernel eventually.
> 
> > On 3 Jan 2017, at 9:44 PM, Ted Unangst  wrote:
> > 
> > Timo Buhrmester wrote:
> >>> delete [vnd] entirely
> >> Out of curiosity (I'm mostly a NetBSD user), without vnd what would be
> >> the OpenBSD-way of providing a disk-ish interface to a file?
> > 
> > Well, the biggest use of vnd in base was just replaced with the makefs. 
> > (from
> > netbsd, actually.) vnd isn't going to be deleted, but it's pretty easy to
> > make a vscsi provider that talks to a file. If i had a pressing need to 
> > mount
> > compressed disk images, I'd start there. (I had some code for this, but it's
> > in another castle. It's pretty short, only like 20 lines anyway.)
> 
> 
> Can you give just a little more pointers or the code if it
> can be rescued?  Or specifically, is this something that needs
> to be added in the kernel or is it portable in userland?
> 
> 
> Cheers,
> Franco

Userland. vscsi is very roughly something like a scsi equivalent of tun.
For example OpenBSD's iSCSI implementation iscsid(8) is userland and
uses this to interface with the kernel (this has quite a lot more code
than Ted's suggestion though).



Re: vndcompress et al import?

2017-01-06 Thread Franco Fichtner
Hi Ted,

Thanks, this is very helpful.  Don't mind exploring other
routes as long as they are sustainable within OpenBSD, e.g.
if kernel changes are needed that they are provided by the
standard kernel eventually.

> On 3 Jan 2017, at 9:44 PM, Ted Unangst  wrote:
> 
> Timo Buhrmester wrote:
>>> delete [vnd] entirely
>> Out of curiosity (I'm mostly a NetBSD user), without vnd what would be
>> the OpenBSD-way of providing a disk-ish interface to a file?
> 
> Well, the biggest use of vnd in base was just replaced with the makefs. (from
> netbsd, actually.) vnd isn't going to be deleted, but it's pretty easy to
> make a vscsi provider that talks to a file. If i had a pressing need to mount
> compressed disk images, I'd start there. (I had some code for this, but it's
> in another castle. It's pretty short, only like 20 lines anyway.)


Can you give just a little more pointers or the code if it
can be rescued?  Or specifically, is this something that needs
to be added in the kernel or is it portable in userland?


Cheers,
Franco


Re: [diff] url rewriting for httpd

2017-01-06 Thread Gregory Edigarov

Thanks for supporting and rebasing the diff.


On 06.01.17 13:21, Atanas Vladimirov wrote:

On Mon, Dec 05, 2016 at 04:20:02PM +0200, Gregory Edigarov wrote:

Hello,

I know, it considered featuritis, but still, hey, it should go somewhere.
This diff is based on the diff sent here by Stanislav Adaszewski
(s.adaszev...@gmail.com),
some time ago.
I've added one option 'test', i.e.: pass rewrite [test] index.php?q=%1, so
it will not rewrite
if file or directory present, and a manual page section, describing the
rule.
For those like me, trying to stick with base as much as possible.

suggestions?


Hello,

The diff is malformed and cannot be applied.
The patch below is re-based against -current.
I exclude the httpd.conf example bits.
They can be added later as separate patch.

Index: httpd.conf.5
===
RCS file: /home/vlado/cvsync/cvsroot/src/usr.sbin/httpd/httpd.conf.5,v
retrieving revision 1.76
diff -u -p -r1.76 httpd.conf.5
--- httpd.conf.514 Nov 2016 10:28:31 -  1.76
+++ httpd.conf.56 Jan 2017 09:47:53 -
@@ -388,6 +388,8 @@ The pattern may contain captures that ca
  .Ar uri
  of an enclosed
  .Ic block return
+or
+.Ic pass rewrite
  option.
  .It Oo Ic no Oc Ic log Op Ar option
  Set the specified logging options.
@@ -446,6 +448,17 @@ instead of the log files.
  Disable any previous
  .Ic block
  in a location.
+.It Ic pass rewrite Oo Ic test Oc Ic Ar uri
+Disable any previous block in location, the path gets rewritten as
+specified in
+.Ic block return
+statement. If
+.Ic test
+option is present, the rewrite will
+.Em not
+happen if file or directory referenced by the
+.Ar uri
+present.
  .It Ic root Ar option
  Configure the document root and options for the request path.
  Valid options are:
Index: httpd.h
===
RCS file: /home/vlado/cvsync/cvsroot/src/usr.sbin/httpd/httpd.h,v
retrieving revision 1.124
diff -u -p -r1.124 httpd.h
--- httpd.h 17 Nov 2016 14:52:48 -  1.124
+++ httpd.h 6 Jan 2017 09:47:53 -
@@ -73,6 +73,7 @@
  #define SERVER_MAX_PREFETCH   256
  #define SERVER_MIN_PREFETCHED 32
  #define SERVER_HSTS_DEFAULT_AGE   31536000
+#define SERVER_MAX_RECUR_REWR  0
  
  #define MEDIATYPE_NAMEMAX	128	/* file name extension */

  #define MEDIATYPE_TYPEMAX 64  /* length of type/subtype */
@@ -364,13 +365,15 @@ SPLAY_HEAD(client_tree, client);
  #define SRVFLAG_SERVER_MATCH  0x0020
  #define SRVFLAG_SERVER_HSTS   0x0040
  #define SRVFLAG_DEFAULT_TYPE  0x0080
+#define SRVFLAG_REWRITE0x0100
+#define SRVFLAG_TEST   0x0200
  
  #define SRVFLAG_BITS			\

"\10\01INDEX\02NO_INDEX\03AUTO_INDEX\04NO_AUTO_INDEX" \
"\05ROOT\06LOCATION\07FCGI\10NO_FCGI\11LOG\12NO_LOG\13SOCKET" \
"\14SYSLOG\15NO_SYSLOG\16TLS\17ACCESS_LOG\20ERROR_LOG"\
"\21AUTH\22NO_AUTH\23BLOCK\24NO_BLOCK\25LOCATION_MATCH"   \
-   "\26SERVER_MATCH\27SERVER_HSTS\30DEFAULT_TYPE"
+   "\26SERVER_MATCH\27SERVER_HSTS\30DEFAULT_TYPE\31REWRITE\32TEST"
  
  #define TCPFLAG_NODELAY		0x01

  #define TCPFLAG_NNODELAY  0x02
@@ -472,6 +475,7 @@ struct server_config {
int  return_code;
char*return_uri;
off_treturn_uri_len;
+   char rewrite_uri[PATH_MAX];
  
  	int			 hsts_max_age;

uint8_t  hsts_flags;
Index: parse.y
===
RCS file: /home/vlado/cvsync/cvsroot/src/usr.sbin/httpd/parse.y,v
retrieving revision 1.87
diff -u -p -r1.87 parse.y
--- parse.y 5 Jan 2017 13:53:09 -   1.87
+++ parse.y 6 Jan 2017 09:47:53 -
@@ -134,7 +134,7 @@ typedef struct {
  %tokenLOCATION LOG LOGDIR MATCH MAXIMUM NO NODELAY OCSP ON PORT 
PREFORK
  %tokenPROTOCOLS REQUESTS ROOT SACK SERVER SOCKET STRIP STYLE SYSLOG 
TCP TIMEOUT
  %tokenTLS TYPE TYPES HSTS MAXAGE SUBDOMAINS DEFAULT PRELOAD REQUEST
-%token ERROR INCLUDE AUTHENTICATE WITH BLOCK DROP RETURN PASS
+%token ERROR INCLUDE AUTHENTICATE WITH BLOCK DROP RETURN PASS REWRITE TEST
  %tokenSTRING
  %tokenNUMBER
  %type   port
@@ -971,6 +971,29 @@ filter : block RETURN NUMBER optstring 
/* Forbidden */
srv_conf->return_code = 403;
}
+   | PASS REWRITE STRING   {
+   srv_conf->flags |= SRVFLAG_REWRITE;
+   if (strlcpy(srv_conf->rewrite_uri, $3,
+   sizeof(srv_conf->rewrite_uri)) >=
+   sizeof(srv_conf->rewrite_uri)) {
+   yyerror("url rewrite string too long");
+   free($3);
+   YYERROR;
+  

Display color depth when attaching inteldrm and radeondrm

2017-01-06 Thread Frederic Cambus
Hi tech@,

Here's a diff to display color depth alongside resolution when attaching
inteldrm and radeondrm, using the same scheme as efifb(4). This is the
first step in trying to have all frame buffer drivers display resolution
and depth the same way.

Tested only with inteldrm.

On this machine, it now displays: inteldrm0: 1600x900, 32bpp

Comments? OK?

Index: sys/dev/pci/drm/i915/i915_drv.c
===
RCS file: /cvs/src/sys/dev/pci/drm/i915/i915_drv.c,v
retrieving revision 1.100
diff -u -p -r1.100 i915_drv.c
--- sys/dev/pci/drm/i915/i915_drv.c 8 Apr 2016 08:27:53 -   1.100
+++ sys/dev/pci/drm/i915/i915_drv.c 5 Jan 2017 21:45:13 -
@@ -1508,8 +1508,8 @@ inteldrm_attach(struct device *parent, s
efifb_cndetach();
 #endif
 
-   printf("%s: %dx%d\n", dev_priv->sc_dev.dv_xname,
-   ri->ri_width, ri->ri_height);
+   printf("%s: %dx%d, %dbpp\n", dev_priv->sc_dev.dv_xname,
+   ri->ri_width, ri->ri_height, ri->ri_depth);
 
intel_fbdev_restore_mode(dev);
 
Index: sys/dev/pci/drm/radeon/radeon_kms.c
===
RCS file: /cvs/src/sys/dev/pci/drm/radeon/radeon_kms.c,v
retrieving revision 1.48
diff -u -p -r1.48 radeon_kms.c
--- sys/dev/pci/drm/radeon/radeon_kms.c 8 Apr 2016 08:27:53 -   1.48
+++ sys/dev/pci/drm/radeon/radeon_kms.c 5 Jan 2017 21:45:13 -
@@ -769,7 +769,8 @@ radeondrm_attachhook(struct device *self
radeon_vga_set_state(rdev, false);
pci_disable_legacy_vga(>dev);
 
-   printf("%s: %dx%d\n", rdev->dev.dv_xname, ri->ri_width, ri->ri_height);
+   printf("%s: %dx%d, %dbpp\n", rdev->dev.dv_xname,
+   ri->ri_width, ri->ri_height, ri->ri_depth);
 
config_found_sm(>dev, , wsemuldisplaydevprint,
wsemuldisplaydevsubmatch);



Re: pf_purge_thread() needs NET_LOCK()

2017-01-06 Thread Alexandr Nedvedicky
On Fri, Jan 06, 2017 at 12:21:19PM +0100, Martin Pieuchot wrote:
> Right now for pfsync(4), but later it will need it to serialize access
> to PF data structures.
> 
>   splassert: ip_output: want 1 have 0
>   ip_output() at ip_output+0x7d
>   pfsync_sendout() at pfsync_sendout+0x499
>   pfsync_q_ins() at pfsync_q_ins+0x78
>   pf_remove_state() at pf_remove_state+0x5d
>   pf_purge_expired_states() at pf_purge_expired_states+0x7b
>   pf_purge_thread() at pf_purge_thread+0x5c
> 
> ok?

looks good to me.

ok, sashan

> 
> Index: net/pf.c
> ===
> RCS file: /cvs/src/sys/net/pf.c,v
> retrieving revision 1.1009
> diff -u -p -r1.1009 pf.c
> --- net/pf.c  29 Dec 2016 13:01:48 -  1.1009
> +++ net/pf.c  6 Jan 2017 11:18:41 -
> @@ -1184,7 +1184,7 @@ pf_purge_thread(void *v)
>   for (;;) {
>   tsleep(pf_purge_thread, PWAIT, "pftm", 1 * hz);
>  
> - s = splsoftnet();
> + NET_LOCK(s);
>  
>   /* process a fraction of the state table every second */
>   pf_purge_expired_states(1 + (pf_status.states
> @@ -1198,7 +1198,7 @@ pf_purge_thread(void *v)
>   nloops = 0;
>   }
>  
> - splx(s);
> + NET_UNLOCK(s);
>   }
>  }
>  
> 



Re: Allow install from https server w/ self signed cert

2017-01-06 Thread viq
On Fri, Jan 6, 2017 at 12:33 PM, viq  wrote:

> I have another issue. I'm preparing OpenBSD vagrant boxes using
> https://packer.io and use it's built in http server to serve install.conf
> file and siteXY.tgz. The whole setup can be seen at
> https://github.com/viq/packer-templates/ and specifically https://github.
> com/viq/packer-templates/blob/master/openbsd-current/http/
> install_amd64.conf
> The trick is, I have to specify the port that server is listening on,
> which causes install to try to connect to that port using https, and drop
> dead there and then as that fails.
>

And no, there isn't really an option to make it serve https short of
stunnel, and that would still leave an issue of presenting a certificate.

-- 
viq


Re: Allow install from https server w/ self signed cert

2017-01-06 Thread viq
I have another issue. I'm preparing OpenBSD vagrant boxes using
https://packer.io and use it's built in http server to serve install.conf
file and siteXY.tgz. The whole setup can be seen at
https://github.com/viq/packer-templates/ and specifically
https://github.com/viq/packer-templates/blob/master/openbsd-current/http/install_amd64.conf
The trick is, I have to specify the port that server is listening on, which
causes install to try to connect to that port using https, and drop dead
there and then as that fails.


Re: Allow install from https server w/ self signed cert

2017-01-06 Thread Landry Breuil
On Fri, Jan 06, 2017 at 11:28:34AM +, Stuart Henderson wrote:
> Related to this (and particularly thinking about autoinstalls),
> would it make sense to allow explicit protocols in the hostname?
> 
> some.host -> https with http fallback
> http://some.host/ -> http only
> https://some.host/ -> https only, no fallback

Definitely in favor of less implicit/magic behaviour..



Re: Allow install from https server w/ self signed cert

2017-01-06 Thread Stuart Henderson
Related to this (and particularly thinking about autoinstalls),
would it make sense to allow explicit protocols in the hostname?

some.host -> https with http fallback
http://some.host/ -> http only
https://some.host/ -> https only, no fallback



Re: C11 max_align_t

2017-01-06 Thread Mark Kettenis
> From: "Todd C. Miller" 
> Date: Thu, 05 Jan 2017 15:50:02 -0700
> 
> I think you need to also define __CLANG_MAX_ALIGN_T_DEFINED and
> perhaps _GCC_MAX_ALIGN_T to avoid libcxx from redefining max_align_t
> as a different type.  E.g. in src/lib/libcxx/include/stddef.h
> 
> // Re-use the compiler's  max_align_t where possible.
> #if !defined(__CLANG_MAX_ALIGN_T_DEFINED) && !defined(_GCC_MAX_ALIGN_T)
> typedef long double max_align_t;
> #endif
> 
> FreeBSD defines both __CLANG_MAX_ALIGN_T_DEFINED and _GCC_MAX_ALIGN_T
> when defining max_align_t in stddef.h, we probably need to as well.

Good point.  I don't really see a reason to define _GCC_MAX_ALIGN_T as
libstdc++ doesn't try to define its own max_align_t like libc++ does.
We do need to make sure that we define max_align_t for C++11 and up
though.

New diff below.

ok?


Index: include/stddef.h
===
RCS file: /cvs/src/include/stddef.h,v
retrieving revision 1.13
diff -u -p -r1.13 stddef.h
--- include/stddef.h9 Sep 2016 18:12:37 -   1.13
+++ include/stddef.h6 Jan 2017 11:19:39 -
@@ -71,4 +71,14 @@ typedef  __mbstate_t mbstate_t;
 #defineoffsetof(type, member)  ((size_t)(&((type *)0)->member))
 #endif
 
+#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103
+#ifndef __CLANG_MAX_ALIGN_T_DEFINED
+#define __CLANG_MAX_ALIGN_T_DEFINED
+typedef struct {
+   long long __max_align_ll __aligned(__alignof__(long long));
+   long double __max_align_ld __aligned(__alignof__(long double));
+} max_align_t;
+#endif
+#endif
+
 #endif /* _STDDEF_H_ */
Index: sys/sys/cdefs.h
===
RCS file: /cvs/src/sys/sys/cdefs.h,v
retrieving revision 1.39
diff -u -p -r1.39 cdefs.h
--- sys/sys/cdefs.h 18 Apr 2014 11:51:17 -  1.39
+++ sys/sys/cdefs.h 6 Jan 2017 11:19:39 -
@@ -375,14 +375,19 @@
 #endif
 
 /*
- * _ISOC99_SOURCE and __STDC_VERSION__ override any of the other macros since
- * they are non-exclusive.
+ * _ISOC99_SOURCE, _ISOC11_SOURCE and __STDC_VERSION__ override any of
+ * the other macros since they are non-exclusive.
  */
 #if defined(_ISOC99_SOURCE) || \
 (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901) || \
 (defined(__cplusplus) && __cplusplus >= 201103)
 # undef __ISO_C_VISIBLE
 # define __ISO_C_VISIBLE   1999
+#endif
+#if defined(_ISOC11_SOURCE) || \
+(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112)
+# undef __ISO_C_VISIBLE
+# define __ISO_C_VISIBLE   2011
 #endif
 
 /*



Re: [diff] url rewriting for httpd

2017-01-06 Thread Atanas Vladimirov
On Mon, Dec 05, 2016 at 04:20:02PM +0200, Gregory Edigarov wrote:
> Hello,
> 
> I know, it considered featuritis, but still, hey, it should go somewhere.
> This diff is based on the diff sent here by Stanislav Adaszewski
> (s.adaszev...@gmail.com),
> some time ago.
> I've added one option 'test', i.e.: pass rewrite [test] index.php?q=%1, so
> it will not rewrite
> if file or directory present, and a manual page section, describing the
> rule.
> For those like me, trying to stick with base as much as possible.
> 
> suggestions?
> 

Hello,

The diff is malformed and cannot be applied.
The patch below is re-based against -current.
I exclude the httpd.conf example bits.
They can be added later as separate patch.

Index: httpd.conf.5
===
RCS file: /home/vlado/cvsync/cvsroot/src/usr.sbin/httpd/httpd.conf.5,v
retrieving revision 1.76
diff -u -p -r1.76 httpd.conf.5
--- httpd.conf.514 Nov 2016 10:28:31 -  1.76
+++ httpd.conf.56 Jan 2017 09:47:53 -
@@ -388,6 +388,8 @@ The pattern may contain captures that ca
 .Ar uri
 of an enclosed
 .Ic block return
+or
+.Ic pass rewrite
 option.
 .It Oo Ic no Oc Ic log Op Ar option
 Set the specified logging options.
@@ -446,6 +448,17 @@ instead of the log files.
 Disable any previous
 .Ic block
 in a location.
+.It Ic pass rewrite Oo Ic test Oc Ic Ar uri
+Disable any previous block in location, the path gets rewritten as 
+specified in
+.Ic block return
+statement. If
+.Ic test
+option is present, the rewrite will
+.Em not
+happen if file or directory referenced by the
+.Ar uri
+present.
 .It Ic root Ar option
 Configure the document root and options for the request path.
 Valid options are:
Index: httpd.h
===
RCS file: /home/vlado/cvsync/cvsroot/src/usr.sbin/httpd/httpd.h,v
retrieving revision 1.124
diff -u -p -r1.124 httpd.h
--- httpd.h 17 Nov 2016 14:52:48 -  1.124
+++ httpd.h 6 Jan 2017 09:47:53 -
@@ -73,6 +73,7 @@
 #define SERVER_MAX_PREFETCH256
 #define SERVER_MIN_PREFETCHED  32
 #define SERVER_HSTS_DEFAULT_AGE31536000
+#define SERVER_MAX_RECUR_REWR  0
 
 #define MEDIATYPE_NAMEMAX  128 /* file name extension */
 #define MEDIATYPE_TYPEMAX  64  /* length of type/subtype */
@@ -364,13 +365,15 @@ SPLAY_HEAD(client_tree, client);
 #define SRVFLAG_SERVER_MATCH   0x0020
 #define SRVFLAG_SERVER_HSTS0x0040
 #define SRVFLAG_DEFAULT_TYPE   0x0080
+#define SRVFLAG_REWRITE0x0100
+#define SRVFLAG_TEST   0x0200
 
 #define SRVFLAG_BITS   \
"\10\01INDEX\02NO_INDEX\03AUTO_INDEX\04NO_AUTO_INDEX"   \
"\05ROOT\06LOCATION\07FCGI\10NO_FCGI\11LOG\12NO_LOG\13SOCKET"   \
"\14SYSLOG\15NO_SYSLOG\16TLS\17ACCESS_LOG\20ERROR_LOG"  \
"\21AUTH\22NO_AUTH\23BLOCK\24NO_BLOCK\25LOCATION_MATCH" \
-   "\26SERVER_MATCH\27SERVER_HSTS\30DEFAULT_TYPE"
+   "\26SERVER_MATCH\27SERVER_HSTS\30DEFAULT_TYPE\31REWRITE\32TEST"
 
 #define TCPFLAG_NODELAY0x01
 #define TCPFLAG_NNODELAY   0x02
@@ -472,6 +475,7 @@ struct server_config {
int  return_code;
char*return_uri;
off_treturn_uri_len;
+   char rewrite_uri[PATH_MAX];
 
int  hsts_max_age;
uint8_t  hsts_flags;
Index: parse.y
===
RCS file: /home/vlado/cvsync/cvsroot/src/usr.sbin/httpd/parse.y,v
retrieving revision 1.87
diff -u -p -r1.87 parse.y
--- parse.y 5 Jan 2017 13:53:09 -   1.87
+++ parse.y 6 Jan 2017 09:47:53 -
@@ -134,7 +134,7 @@ typedef struct {
 %token LOCATION LOG LOGDIR MATCH MAXIMUM NO NODELAY OCSP ON PORT PREFORK
 %token PROTOCOLS REQUESTS ROOT SACK SERVER SOCKET STRIP STYLE SYSLOG TCP 
TIMEOUT
 %token TLS TYPE TYPES HSTS MAXAGE SUBDOMAINS DEFAULT PRELOAD REQUEST
-%token ERROR INCLUDE AUTHENTICATE WITH BLOCK DROP RETURN PASS
+%token ERROR INCLUDE AUTHENTICATE WITH BLOCK DROP RETURN PASS REWRITE TEST
 %token   STRING
 %token   NUMBER
 %type  port
@@ -971,6 +971,29 @@ filter : block RETURN NUMBER optstring 
/* Forbidden */
srv_conf->return_code = 403;
}
+   | PASS REWRITE STRING   {
+   srv_conf->flags |= SRVFLAG_REWRITE;
+   if (strlcpy(srv_conf->rewrite_uri, $3,
+   sizeof(srv_conf->rewrite_uri)) >=
+   sizeof(srv_conf->rewrite_uri)) {
+   yyerror("url rewrite string too long");
+   free($3);
+   YYERROR;
+   }
+   

pf_purge_thread() needs NET_LOCK()

2017-01-06 Thread Martin Pieuchot
Right now for pfsync(4), but later it will need it to serialize access
to PF data structures.

splassert: ip_output: want 1 have 0
ip_output() at ip_output+0x7d
pfsync_sendout() at pfsync_sendout+0x499
pfsync_q_ins() at pfsync_q_ins+0x78
pf_remove_state() at pf_remove_state+0x5d
pf_purge_expired_states() at pf_purge_expired_states+0x7b
pf_purge_thread() at pf_purge_thread+0x5c

ok?

Index: net/pf.c
===
RCS file: /cvs/src/sys/net/pf.c,v
retrieving revision 1.1009
diff -u -p -r1.1009 pf.c
--- net/pf.c29 Dec 2016 13:01:48 -  1.1009
+++ net/pf.c6 Jan 2017 11:18:41 -
@@ -1184,7 +1184,7 @@ pf_purge_thread(void *v)
for (;;) {
tsleep(pf_purge_thread, PWAIT, "pftm", 1 * hz);
 
-   s = splsoftnet();
+   NET_LOCK(s);
 
/* process a fraction of the state table every second */
pf_purge_expired_states(1 + (pf_status.states
@@ -1198,7 +1198,7 @@ pf_purge_thread(void *v)
nloops = 0;
}
 
-   splx(s);
+   NET_UNLOCK(s);
}
 }