svn commit: r327073 - head/sys/fs/nfsclient

2017-12-21 Thread Konstantin Belousov
Author: kib Date: Thu Dec 21 23:08:10 2017 New Revision: 327073 URL: https://svnweb.freebsd.org/changeset/base/327073 Log: Fix build for LP64 arches with gcc. gcc complaints that the comparision is always false due to the value range, and the cast does not prevent the analysis. Split the

svn commit: r327074 - in head/sys/mips: include mips

2017-12-21 Thread Konstantin Belousov
Author: kib Date: Thu Dec 21 23:39:00 2017 New Revision: 327074 URL: https://svnweb.freebsd.org/changeset/base/327074 Log: Fix mips build after introduction of MD definitions of atomic_load_64 and atomic_store_64. The MD definitions are provided for LP64 only, while mips also uses them

svn commit: r327088 - head/share/man/man9

2017-12-22 Thread Konstantin Belousov
Author: kib Date: Fri Dec 22 17:52:38 2017 New Revision: 327088 URL: https://svnweb.freebsd.org/changeset/base/327088 Log: Update HISTORY section for the atomic(9) page. In collaboration with:alc Sponsored by: The FreeBSD Foundation (kib) MFC after:1 week Modified: head/s

svn commit: r327097 - in head/sys/mips: include mips

2017-12-22 Thread Konstantin Belousov
Author: kib Date: Fri Dec 22 23:27:03 2017 New Revision: 327097 URL: https://svnweb.freebsd.org/changeset/base/327097 Log: Remove mips MD atomic_load_64 and atomic_store_64. The only users of the functions were db_read_bytes() and db_write_bytes() ddb(4) interfaces. Replace the calls wit

svn commit: r327118 - in head/sys/x86: include x86

2017-12-23 Thread Konstantin Belousov
Author: kib Date: Sat Dec 23 21:32:50 2017 New Revision: 327118 URL: https://svnweb.freebsd.org/changeset/base/327118 Log: Add missed AVX512VL (128 and 256 bit vector length) extension identification bit. Sponsored by: The FreeBSD Foundation MFC after:3 days Modified: head/sys/x8

svn commit: r327283 - head/usr.sbin/cpucontrol

2017-12-28 Thread Konstantin Belousov
Author: kib Date: Thu Dec 28 12:59:48 2017 New Revision: 327283 URL: https://svnweb.freebsd.org/changeset/base/327283 Log: Complete r327264 by fixing yet another return without cleanup. Sponsored by: The FreeBSD Foundation MFC after:1 week Modified: head/usr.sbin/cpucontrol/intel.c

svn commit: r327284 - head/usr.sbin/cpucontrol

2017-12-28 Thread Konstantin Belousov
Author: kib Date: Thu Dec 28 13:01:27 2017 New Revision: 327284 URL: https://svnweb.freebsd.org/changeset/base/327284 Log: Style. Remove useless return. Sponsored by: The FreeBSD Foundation MFC after:1 week Modified: head/usr.sbin/cpucontrol/intel.c Modified: head/usr.sbin/cpucon

svn commit: r327285 - in head/sys: kern sys

2017-12-28 Thread Konstantin Belousov
Author: kib Date: Thu Dec 28 13:16:32 2017 New Revision: 327285 URL: https://svnweb.freebsd.org/changeset/base/327285 Log: Make kern_proc_vmmap_resident() externally accesible, and move the vmmap_skip_res_cnt control check inside it. Sponsored by: The FreeBSD Foundation MFC after:1

svn commit: r327286 - head/sys/fs/procfs

2017-12-28 Thread Konstantin Belousov
Author: kib Date: Thu Dec 28 13:23:13 2017 New Revision: 327286 URL: https://svnweb.freebsd.org/changeset/base/327286 Log: Reuse kern_proc_vmmap_resident() for procfs_map resident count. The existing algorithm in procfs_map() to calculate count of resident pages in an entry is too primiti

Re: svn commit: r327287 - head/sys/i386/isa

2017-12-28 Thread Konstantin Belousov
On Thu, Dec 28, 2017 at 02:14:36PM +, Pedro F. Giffuni wrote: > Author: pfg > Date: Thu Dec 28 14:14:35 2017 > New Revision: 327287 > URL: https://svnweb.freebsd.org/changeset/base/327287 > > Log: > sys/i386/isa/elink*: sync with (older) NetBSD. > > Make it easier to identify the point

svn commit: r327316 - head/sys/vm

2017-12-28 Thread Konstantin Belousov
Author: kib Date: Thu Dec 28 22:56:30 2017 New Revision: 327316 URL: https://svnweb.freebsd.org/changeset/base/327316 Log: In vm_swapout_map_deactivate_pages(), it is enough to lock the map for read. Reviewed by: alc, markj (as part of the larger patch) Tested by:pho (again, as part

svn commit: r327319 - head/sys/vm

2017-12-28 Thread Konstantin Belousov
Author: kib Date: Thu Dec 28 23:50:21 2017 New Revision: 327319 URL: https://svnweb.freebsd.org/changeset/base/327319 Log: Clean up the comment. Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after:1 week Differential revision:https://reviews.freebsd.org

svn commit: r327354 - head/sys/vm

2017-12-29 Thread Konstantin Belousov
Author: kib Date: Fri Dec 29 19:05:07 2017 New Revision: 327354 URL: https://svnweb.freebsd.org/changeset/base/327354 Log: Style. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after:1 week Differential revision:https://reviews.freebsd.org/D13678 Modified: h

svn commit: r327359 - head/sys/vm

2017-12-29 Thread Konstantin Belousov
Author: kib Date: Fri Dec 29 20:33:56 2017 New Revision: 327359 URL: https://svnweb.freebsd.org/changeset/base/327359 Log: Do not lock vm map in swapout_procs(). Neither swapout_procs() nor swapout() access the map. Since the process' vmspace is referenced only to obtain the pointer to t

svn commit: r327380 - in head/sys: conf i386/i386 i386/isa

2017-12-30 Thread Konstantin Belousov
Author: kib Date: Sat Dec 30 11:33:04 2017 New Revision: 327380 URL: https://svnweb.freebsd.org/changeset/base/327380 Log: Move i386/isa/npx.c to i386i386/npx.c. The i386 FPU (AKA npx) code does not depend on ISA devices at all, after the support for IRQ13 FPU exceptions was removed. Put

svn commit: r327381 - in head/sys: conf dev/ep i386/isa modules modules/elink modules/ep

2017-12-30 Thread Konstantin Belousov
Author: kib Date: Sat Dec 30 11:42:49 2017 New Revision: 327381 URL: https://svnweb.freebsd.org/changeset/base/327381 Log: Move i386/isa/elink.[hc] to dev/ep. The ep(4) driver is the only consumer of the two functions from elink.c. I removed the standalone module as well, and most likely

Re: svn commit: r327381 - in head/sys: conf dev/ep i386/isa modules modules/elink modules/ep

2017-12-30 Thread Konstantin Belousov
On Sat, Dec 30, 2017 at 04:02:39PM -0500, Pedro Giffuni wrote: > Hi; > > On 30/12/2017 06:42, Konstantin Belousov wrote: > > Author: kib > > Date: Sat Dec 30 11:42:49 2017 > > New Revision: 327381 > > URL: https://svnweb.freebsd.org/changeset/base/327381 > &

svn commit: r327437 - head/sys/amd64/amd64

2017-12-31 Thread Konstantin Belousov
Author: kib Date: Sun Dec 31 17:07:59 2017 New Revision: 327437 URL: https://svnweb.freebsd.org/changeset/base/327437 Log: Remove MP SAFE marks and stray register name in comments. Sponsored by: The FreeBSD Foundation MFC after:3 days Modified: head/sys/amd64/amd64/support.S Modif

svn commit: r327468 - head/sys/vm

2018-01-01 Thread Konstantin Belousov
Author: kib Date: Mon Jan 1 19:27:33 2018 New Revision: 327468 URL: https://svnweb.freebsd.org/changeset/base/327468 Log: Do not let vm_daemon run unbounded. On a load where single anonymous object consumes almost all memory on the large system, swapout code executes the iteration over t

svn commit: r327472 - in head/sys: amd64/amd64 i386/i386

2018-01-01 Thread Konstantin Belousov
Author: kib Date: Mon Jan 1 20:47:03 2018 New Revision: 327472 URL: https://svnweb.freebsd.org/changeset/base/327472 Log: Avoid re-check of usermode condition. It does not change anything in the behavior of trap_pfault(), while eliminating obfuscation of jumping to the code which checks

svn commit: r327469 - head/sys/x86/include

2018-01-01 Thread Konstantin Belousov
Author: kib Date: Mon Jan 1 19:34:19 2018 New Revision: 327469 URL: https://svnweb.freebsd.org/changeset/base/327469 Log: Add CR4.SMAP control bit. Sponsored by: The FreeBSD Foundation MFC after:3 days Modified: head/sys/x86/include/specialreg.h Modified: head/sys/x86/include/spe

svn commit: r327517 - head/sys/x86/x86

2018-01-03 Thread Konstantin Belousov
Author: kib Date: Wed Jan 3 11:23:47 2018 New Revision: 327517 URL: https://svnweb.freebsd.org/changeset/base/327517 Log: Use the new SDM-approved way to serialize x2APIC MSR writes. SDM editions 64 and below stated that it is enough to use MFENCe or LFENCE to serialize x2APIC register w

svn commit: r327555 - head/sys/vm

2018-01-04 Thread Konstantin Belousov
Author: kib Date: Thu Jan 4 18:14:58 2018 New Revision: 327555 URL: https://svnweb.freebsd.org/changeset/base/327555 Log: Restructure swapout tests after vm map locking was removed. Consolidate the regions covered by the process lock. Combine similar conditions tests into one, e.g. all p

svn commit: r327597 - in head: sys/amd64/amd64 sys/dev/cpuctl sys/sys sys/x86/include sys/x86/x86 usr.sbin/cpucontrol

2018-01-05 Thread Konstantin Belousov
Author: kib Date: Fri Jan 5 21:06:19 2018 New Revision: 327597 URL: https://svnweb.freebsd.org/changeset/base/327597 Log: Make it possible to re-evaluate cpu_features. Add cpuctl(4) ioctl CPUCTL_EVAL_CPU_FEATURES which forces re-read of cpu_features, cpu_features2, cpu_stdext_features, a

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

2018-01-06 Thread Konstantin Belousov
Author: kib Date: Sat Jan 6 16:29:00 2018 New Revision: 327625 URL: https://svnweb.freebsd.org/changeset/base/327625 Log: Document kern.smp.disabled tunable. Sponsored by: The FreeBSD Foundation MFC after:3 days Modified: head/share/man/man4/smp.4 Modified: head/share/man/man4/sm

Re: svn commit: r327675 - head/sys/netpfil/pf

2018-01-07 Thread Konstantin Belousov
On Sun, Jan 07, 2018 at 01:35:15PM +, Kristof Provost wrote: > Author: kp > Date: Sun Jan 7 13:35:15 2018 > New Revision: 327675 > URL: https://svnweb.freebsd.org/changeset/base/327675 > > Log: > pf: Avoid integer overflow issues by using mallocarray() iso. malloc() > > pfioctl() handl

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

2018-01-09 Thread Konstantin Belousov
Author: kib Date: Tue Jan 9 10:33:11 2018 New Revision: 327721 URL: https://svnweb.freebsd.org/changeset/base/327721 Log: Postpone the disassotiation of the background write buffer with devvp so that buf_complete() sees fully constructed buffer. This is a NOP right now, but will be neede

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

2018-01-09 Thread Konstantin Belousov
Author: kib Date: Tue Jan 9 10:44:17 2018 New Revision: 327722 URL: https://svnweb.freebsd.org/changeset/base/327722 Log: When handling write completion, take SU lock around calls to handle_written_XXX() in case of processing the buffer with an error. Tested by:pho (as part of the bi

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

2018-01-09 Thread Konstantin Belousov
Author: kib Date: Tue Jan 9 10:51:44 2018 New Revision: 327723 URL: https://svnweb.freebsd.org/changeset/base/327723 Log: Generalize the fix from r322757 and apply it to several more places. The code accesses bp->b_dep without owning the ufs mount softdep lock, which makes it possible fo

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

2018-01-09 Thread Konstantin Belousov
Author: kib Date: Tue Jan 9 16:28:45 2018 New Revision: 327730 URL: https://svnweb.freebsd.org/changeset/base/327730 Log: Fix year. Noted by: oshogbo Sponsored by: The FreeBSD Foundation MFC after:3 days Modified: head/share/man/man4/smp.4 Modified: head/share/man/man4/smp.

svn commit: r327816 - in head/sys: amd64/amd64 i386/i386

2018-01-11 Thread Konstantin Belousov
Author: kib Date: Thu Jan 11 12:07:24 2018 New Revision: 327816 URL: https://svnweb.freebsd.org/changeset/base/327816 Log: Update comment explaining the check, to reality. Discussed with: jhb Sponsored by: The FreeBSD Foundation MFC after:3 days Modified: head/sys/amd64/amd

svn commit: r327817 - head/sys/amd64/amd64

2018-01-11 Thread Konstantin Belousov
Author: kib Date: Thu Jan 11 12:28:08 2018 New Revision: 327817 URL: https://svnweb.freebsd.org/changeset/base/327817 Log: Rename COMMON_TSS_RSP0 to TSS_RSP0. The symbol is just an offset in the hardware TSS structure, it is not limited to the common_tss instance. Sponsored by: The F

svn commit: r327818 - in head/sys/amd64: amd64 include

2018-01-11 Thread Konstantin Belousov
Author: kib Date: Thu Jan 11 12:40:43 2018 New Revision: 327818 URL: https://svnweb.freebsd.org/changeset/base/327818 Log: Move the hardware setup for fast syscalls into a common function. Discussed with: jhb Sponsored by: The FreeBSD Foundation MFC after:1 week Modified: h

svn commit: r327819 - head/sys/amd64/amd64

2018-01-11 Thread Konstantin Belousov
Author: kib Date: Thu Jan 11 12:54:33 2018 New Revision: 327819 URL: https://svnweb.freebsd.org/changeset/base/327819 Log: Do not clear %RFLAGS.DF on fast syscall entry. Hardware already did it for us due to the mask loaded into the MSR_SF_MASK msr register. Reviewed by: jhb Spons

svn commit: r327820 - in head/sys: amd64/amd64 i386/i386

2018-01-11 Thread Konstantin Belousov
Author: kib Date: Thu Jan 11 13:22:13 2018 New Revision: 327820 URL: https://svnweb.freebsd.org/changeset/base/327820 Log: Remove redundand CLD instructions. We already clear %RFLAGS.DF on the kernel entry due to the compiler's ABI requirements. Suggested by: jhb Sponsored by: The

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

2018-01-11 Thread Konstantin Belousov
Author: kib Date: Thu Jan 11 13:37:45 2018 New Revision: 327821 URL: https://svnweb.freebsd.org/changeset/base/327821 Log: Softlink inodes can own buffers with dependencies. At least, softlinks longer than 120 bytes have data fragments. Submitted by: mckusick MFC after:5 days Mo

svn commit: r327822 - head/stand/common

2018-01-11 Thread Konstantin Belousov
Author: kib Date: Thu Jan 11 13:57:30 2018 New Revision: 327822 URL: https://svnweb.freebsd.org/changeset/base/327822 Log: Skip IRELATIVE relocations when loader processes ELF files. ifuncs can be only called in the (early boot) kernel environment, so postpone resolving until early stage

svn commit: r327834 - in head/sys: amd64/amd64 i386/i386

2018-01-11 Thread Konstantin Belousov
Author: kib Date: Thu Jan 11 16:50:03 2018 New Revision: 327834 URL: https://svnweb.freebsd.org/changeset/base/327834 Log: Fix grammar. Submitted by: alc MFC after:3 days Modified: head/sys/amd64/amd64/support.S head/sys/i386/i386/support.s Modified: head/sys/amd64/amd64/support

svn commit: r327917 - head/sys/kern

2018-01-13 Thread Konstantin Belousov
Author: kib Date: Sat Jan 13 11:59:49 2018 New Revision: 327917 URL: https://svnweb.freebsd.org/changeset/base/327917 Log: Add sysctl debug.kdb.stack_overflow to conveniently test kernel handling of the kstack overflow. Sponsored by: The FreeBSD Foundation MFC after:1 week Modified

Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3

2018-01-13 Thread Konstantin Belousov
On Sat, Jan 13, 2018 at 11:14:53PM +, Nathan Whitehorn wrote: > +/* > + * We (usually) have a direct map of all physical memory. All > + * uses of this macro must be gated by a check on hw_direct_map! > + * The location of the direct map may not be 1:1 in future, so use > + * of the macro is re

Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3

2018-01-14 Thread Konstantin Belousov
On Sat, Jan 13, 2018 at 08:31:40PM -0800, Nathan Whitehorn wrote: > > > On 01/13/18 15:28, Nathan Whitehorn wrote: > > > > > > On 01/13/18 15:24, Konstantin Belousov wrote: > >> On Sat, Jan 13, 2018 at 11:14:53PM +, Nathan Whitehorn wrote: > >>&

svn commit: r327963 - head/sys/dev/cpuctl

2018-01-14 Thread Konstantin Belousov
Author: kib Date: Sun Jan 14 12:33:05 2018 New Revision: 327963 URL: https://svnweb.freebsd.org/changeset/base/327963 Log: When re-evaluating cpu_features, also re-print CPU identification. Sponsored by: The FreeBSD Foundation MFC after:1 week Modified: head/sys/dev/cpuctl/cpuctl.c

svn commit: r327964 - in head/sys/x86: include x86

2018-01-14 Thread Konstantin Belousov
Author: kib Date: Sun Jan 14 12:36:23 2018 New Revision: 327964 URL: https://svnweb.freebsd.org/changeset/base/327964 Log: Enumerate and print Intel CPU features for Speculative Execution Side Channel Mitigations. The definitions are taken from the document 336996-001. Sponsored by:

svn commit: r327965 - head/sys/amd64/include

2018-01-14 Thread Konstantin Belousov
Author: kib Date: Sun Jan 14 12:39:50 2018 New Revision: 327965 URL: https://svnweb.freebsd.org/changeset/base/327965 Log: Add STAC and CLAC instructions wrappers. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after:1 week Differential revision:https://reviews

Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3

2018-01-14 Thread Konstantin Belousov
On Sun, Jan 14, 2018 at 08:06:19AM -0800, Nathan Whitehorn wrote: > > > On 01/14/18 00:30, Konstantin Belousov wrote: > > On Sat, Jan 13, 2018 at 08:31:40PM -0800, Nathan Whitehorn wrote: > >> > >> On 01/13/18 15:28, Nathan Whitehorn wrote: > >>>

Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3

2018-01-14 Thread Konstantin Belousov
On Sun, Jan 14, 2018 at 09:30:53AM -0800, Nathan Whitehorn wrote: > The immediate consequence of that is that no MI code that knows about > direct maps can possibly take advantage of the direct map on this > platform. Do we really want that to save some conditional logic that > would get optimiz

Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3

2018-01-15 Thread Konstantin Belousov
On Sun, Jan 14, 2018 at 03:46:38PM -0800, Nathan Whitehorn wrote: > > > On 01/14/18 15:42, Nathan Whitehorn wrote: > > > > > > On 01/14/18 09:57, Nathan Whitehorn wrote: > >> > >> > >> On 01/14/18 09:52, Konstantin Belousov wrote: > >&

Re: svn commit: r327996 - in head/sys: cam/scsi geom

2018-01-15 Thread Konstantin Belousov
On Mon, Jan 15, 2018 at 11:20:00AM +, Andriy Gapon wrote: > Author: avg > Date: Mon Jan 15 11:20:00 2018 > New Revision: 327996 > URL: https://svnweb.freebsd.org/changeset/base/327996 > > Log: > geom_disk / scsi_da: deny opening write-protected disks for writing > > Ths change consists

Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3

2018-01-15 Thread Konstantin Belousov
On Mon, Jan 15, 2018 at 07:33:01AM -0800, Nathan Whitehorn wrote: > > > On 01/15/18 03:18, Konstantin Belousov wrote: > > On Sun, Jan 14, 2018 at 03:46:38PM -0800, Nathan Whitehorn wrote: > >> > >> On 01/14/18 15:42, Nathan Whitehorn wrote: > >>> &g

Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3

2018-01-15 Thread Konstantin Belousov
On Mon, Jan 15, 2018 at 09:32:56AM -0800, Nathan Whitehorn wrote: > That seems fine to me. I don't think a less-clumsy way that does not > involve extra indirection is possible. The PHYS_TO_DMAP() returning NULL > is about the best thing I can come up with from a clumsiness standpoint > since pl

Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3

2018-01-15 Thread Konstantin Belousov
On Mon, Jan 15, 2018 at 03:20:49PM -0800, Nathan Whitehorn wrote: > Fair enough. Here's a patch with a new flag (DIRECT_MAP_AVAILABLE). I've > also retooled the sfbuf code to use this rather than its own flags that > mean the same things. The sparc64 part of the patch is untested. > -Nathan > In

Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3

2018-01-17 Thread Konstantin Belousov
On Tue, Jan 16, 2018 at 09:30:29PM -0800, Nathan Whitehorn wrote: > > > On 01/16/18 11:32, Marius Strobl wrote: > > On Mon, Jan 15, 2018 at 03:20:49PM -0800, Nathan Whitehorn wrote: > >> > >> On 01/15/18 09:53, Konstantin Belousov wrote: > >>> On

svn commit: r328082 - in head/sys/amd64: amd64 include

2018-01-17 Thread Konstantin Belousov
Author: kib Date: Wed Jan 17 11:21:03 2018 New Revision: 328082 URL: https://svnweb.freebsd.org/changeset/base/328082 Log: Amd64 user_ldt_deref() is not used outside sys_machdep.c. Mark it as static. Sponsored by: The FreeBSD Foundation MFC after:1 week Modified: head/sys/amd64/

svn commit: r328083 - in head/sys: amd64/amd64 amd64/ia32 amd64/include amd64/vmm amd64/vmm/intel dev/hyperv/vmbus dev/hyperv/vmbus/amd64 dev/hyperv/vmbus/i386 i386/i386 x86/include x86/isa x86/x86

2018-01-17 Thread Konstantin Belousov
+ * All rights reserved. * + * Portions of this software were developed by + * Konstantin Belousov under sponsorship from + * the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are

svn commit: r328120 - in head/sys/amd64: amd64 include

2018-01-18 Thread Konstantin Belousov
Author: kib Date: Thu Jan 18 11:21:03 2018 New Revision: 328120 URL: https://svnweb.freebsd.org/changeset/base/328120 Log: Fix compilation with gcc. etext is already declared in machine/cpu.h, move kernphys declaration there too. Based on the patch by:bde MFC after:13 d

svn commit: r328116 - head/sys/amd64/amd64

2018-01-18 Thread Konstantin Belousov
Author: kib Date: Thu Jan 18 11:01:41 2018 New Revision: 328116 URL: https://svnweb.freebsd.org/changeset/base/328116 Log: Remove the 'last' argument from the pmap_pti_free_page(). It is in fact unused. Noted and reviewed by:markj Sponsored by: The FreeBSD Foundation MFC af

svn commit: r328119 - head/sys/amd64/include

2018-01-18 Thread Konstantin Belousov
Author: kib Date: Thu Jan 18 11:19:58 2018 New Revision: 328119 URL: https://svnweb.freebsd.org/changeset/base/328119 Log: Fix compilation with gas. Submitted by: bde MFC after:13 days Modified: head/sys/amd64/include/asmacros.h Modified: head/sys/amd64/include/asmacros.h

Re: svn commit: r328083 - in head/sys: amd64/amd64 amd64/ia32 amd64/include amd64/vmm amd64/vmm/intel dev/hyperv/vmbus dev/hyperv/vmbus/amd64 dev/hyperv/vmbus/i386 i386/i386 x86/include x86/isa x86/x8

2018-01-18 Thread Konstantin Belousov
On Wed, Jan 17, 2018 at 07:38:03PM -0800, Conrad Meyer wrote: > On Wed, Jan 17, 2018 at 3:44 AM, Konstantin Belousov wrote: > > Author: kib > > Date: Wed Jan 17 11:44:21 2018 > > New Revision: 328083 > > URL: https://svnweb.freebsd.org/changeset/base/328083 >

svn commit: r328128 - in head/sys/amd64: amd64 include

2018-01-18 Thread Konstantin Belousov
Author: kib Date: Thu Jan 18 15:15:35 2018 New Revision: 328128 URL: https://svnweb.freebsd.org/changeset/base/328128 Log: Move the kernphys declaration to machine/md_var.h. Apparently machinde/cpu.h is supposed to contain MD implementations of MI interfaces. Also, remove kernphys declar

Re: svn commit: r327950 - in head/sys/powerpc: aim include powerpc ps3

2018-01-18 Thread Konstantin Belousov
On Thu, Jan 18, 2018 at 07:24:11AM -0800, Nathan Whitehorn wrote: > > > On 01/17/18 01:44, Konstantin Belousov wrote: > > On Tue, Jan 16, 2018 at 09:30:29PM -0800, Nathan Whitehorn wrote: > >> > >> On 01/16/18 11:32, Marius Strobl wrote: > >>> On

svn commit: r328177 - in head/sys/amd64: amd64 include

2018-01-19 Thread Konstantin Belousov
Author: kib Date: Fri Jan 19 22:10:29 2018 New Revision: 328177 URL: https://svnweb.freebsd.org/changeset/base/328177 Log: PTI: Trap if we returned to userspace with kernel (full) page table still active. Map userspace portion of VA in the PTI kernel-mode page table as non-executable. T

Re: svn commit: r328159 - head/sys/modules

2018-01-20 Thread Konstantin Belousov
On Sat, Jan 20, 2018 at 07:57:55PM +1100, Bruce Evans wrote: > The not-unused x86 arch is one that does this. IIRC, some history of this > is: > > - on the 8086, the shift count was taken mod 32. 16 bits was enough for >anyone, and shifting left or right by 16 through 31 (but not by 32) >

svn commit: r328192 - head/sys/vm

2018-01-20 Thread Konstantin Belousov
Author: kib Date: Sat Jan 20 12:19:02 2018 New Revision: 328192 URL: https://svnweb.freebsd.org/changeset/base/328192 Log: Assign map->header values to avoid boundary checks. In several places, entry start and end field are checked, after excluding the possibility that the entry is map->h

svn commit: r328202 - head/sys/amd64/amd64

2018-01-20 Thread Konstantin Belousov
Author: kib Date: Sat Jan 20 17:46:09 2018 New Revision: 328202 URL: https://svnweb.freebsd.org/changeset/base/328202 Log: Use predefined symbol for the CR3.PCID mask. Sponsored by: The FreeBSD Foundation MFC after:11 days Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/a

svn commit: r328205 - head/sys/amd64/amd64

2018-01-20 Thread Konstantin Belousov
Author: kib Date: Sat Jan 20 18:05:14 2018 New Revision: 328205 URL: https://svnweb.freebsd.org/changeset/base/328205 Log: Use correct symbol name in r328202. Sponsored by: The FreeBSD Foundation MFC after:11 days Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd6

Re: svn commit: r328202 - head/sys/amd64/amd64

2018-01-20 Thread Konstantin Belousov
On Sat, Jan 20, 2018 at 06:50:09PM +0100, O. Hartmann wrote: > This commit breaks buildkernel: > > > [...] > /usr/src/sys/amd64/amd64/trap.c:710:33: error: use of undeclared identifier > 'PMAP_PCID_MASK' (curpcb->pcb_saved_ucr3 & ~PMAP_PCID_MASK)== This should be fixed by r328205. __

Re: svn commit: r328240 - in head: etc/mtree lib lib/libc/regex lib/libc/tests/regex lib/libregex lib/libregex/tests share/mk

2018-01-22 Thread Konstantin Belousov
On Mon, Jan 22, 2018 at 02:44:41AM +, Kyle Evans wrote: > Author: kevans > Date: Mon Jan 22 02:44:41 2018 > New Revision: 328240 > URL: https://svnweb.freebsd.org/changeset/base/328240 > > Log: > Add libregex, connect it to the build > > libregex is a regex(3) implementation intended to

Re: svn commit: r328240 - in head: etc/mtree lib lib/libc/regex lib/libc/tests/regex lib/libregex lib/libregex/tests share/mk

2018-01-22 Thread Konstantin Belousov
On Mon, Jan 22, 2018 at 08:05:30AM -0600, Kyle Evans wrote: > On Mon, Jan 22, 2018 at 4:26 AM, Konstantin Belousov > wrote: > > On Mon, Jan 22, 2018 at 02:44:41AM +, Kyle Evans wrote: > >> Author: kevans > >> Date: Mon Jan 22 02:44:41 2018 > >&g

Re: svn commit: r328240 - in head: etc/mtree lib lib/libc/regex lib/libc/tests/regex lib/libregex lib/libregex/tests share/mk

2018-01-22 Thread Konstantin Belousov
On Mon, Jan 22, 2018 at 11:43:34AM -0600, Kyle Evans wrote: > On Mon, Jan 22, 2018 at 9:53 AM, Konstantin Belousov > wrote: > > On Mon, Jan 22, 2018 at 08:05:30AM -0600, Kyle Evans wrote: > >> On Mon, Jan 22, 2018 at 4:26 AM, Konstantin Belousov > >> wrote: > &

svn commit: r328264 - head/sys/net

2018-01-22 Thread Konstantin Belousov
Author: kib Date: Mon Jan 22 20:49:17 2018 New Revision: 328264 URL: https://svnweb.freebsd.org/changeset/base/328264 Log: Fix compat32 for sysctl net.PF_ROUTE...NET_RT_IFLISTL. Route messages are aligned to the host long type alignment, which breaks 32bit. Reported and tested by:

Re: svn commit: r328218 - in head/sys: amd64/amd64 arm/xscale/ixp425 arm64/arm64 cam cam/ctl compat/ndis dev/aacraid dev/advansys dev/ath dev/beri/virtio dev/bnxt dev/bwn dev/ciss dev/cxgbe/crypto dev

2018-01-24 Thread Konstantin Belousov
On Wed, Jan 24, 2018 at 11:05:24AM -0700, Warner Losh wrote: > Let's start with his point about u_long vs size_t causing problems: > > void*malloc(unsigned long size, struct malloc_type *type, int flags) > vs > void*mallocarray(size_t nmemb, size_t size, struct malloc_type *type, > > Sinc

svn commit: r328468 - head/sys/x86/x86

2018-01-27 Thread Konstantin Belousov
Author: kib Date: Sat Jan 27 11:33:21 2018 New Revision: 328468 URL: https://svnweb.freebsd.org/changeset/base/328468 Log: Fix native_lapic_ipi_alloc(). When PTI is enabled, empty IDT slots point to rsvd_pti. Reported by: Dexuan-BSD Cui Sponsored by: The FreeBSD Foundation MFC af

Re: svn commit: r328166 - in head/sys: amd64/amd64 x86/include x86/x86

2018-01-27 Thread Konstantin Belousov
On Sat, Jan 27, 2018 at 12:56:47AM -0800, Dexuan-BSD Cui wrote: > Hi, > Today I found the KPTI patch broke FreeBSD VM running on Hyper-V: the VM > can't boot due to: > > vmbus0: cannot find free IDT vector > > This is the related snippet: > > dev/hyperv/vmbus/vmbus.c: vmbus_intr_setup() -> lapic

svn commit: r328470 - in head/sys: amd64/amd64 amd64/include i386/i386 x86/include x86/x86

2018-01-27 Thread Konstantin Belousov
Author: kib Date: Sat Jan 27 11:49:37 2018 New Revision: 328470 URL: https://svnweb.freebsd.org/changeset/base/328470 Log: Use PCID to optimize PTI. Use PCID to avoid complete TLB shootdown when switching between user and kernel mode with PTI enabled. I use the model close to what I

Re: svn commit: r328479 - in head/sys: fs/ext2fs ufs/ufs

2018-01-27 Thread Konstantin Belousov
On Sat, Jan 27, 2018 at 03:33:52PM +, Pedro F. Giffuni wrote: > Author: pfg > Date: Sat Jan 27 15:33:52 2018 > New Revision: 328479 > URL: https://svnweb.freebsd.org/changeset/base/328479 > > Log: > {ext2|ufs}_readdir: Set limit on valid ncookies values. > > Sanitize the values that wil

Re: svn commit: r331279 - in head: include lib/libc/gen lib/libc/sys lib/libc/tests/gen sys/compat/freebsd32 sys/conf sys/kern sys/sys tests/sys/kern usr.bin/truss

2018-03-21 Thread Konstantin Belousov
On Wed, Mar 21, 2018 at 09:42:26AM -0600, Warner Losh wrote: > On Wed, Mar 21, 2018 at 9:37 AM, Conrad Meyer wrote: > > > On Wed, Mar 21, 2018 at 8:23 AM, Konstantin Belousov > > wrote: > > > On Wed, Mar 21, 2018 at 08:03:16AM -0700, Conrad Meyer wrote: > > &

Re: svn commit: r331298 - head/sys/dev/syscons

2018-03-21 Thread Konstantin Belousov
On Thu, Mar 22, 2018 at 04:53:22AM +1100, Bruce Evans wrote: > Serial console drivers with fast interrupt handlers have much more > broken locking for ddb special keys. It is invalid to either drop locks > or call the "any" function from a fast interrupt handler, but buggy > serial console drivers

Re: svn commit: r331298 - head/sys/dev/syscons

2018-03-22 Thread Konstantin Belousov
On Thu, Mar 22, 2018 at 05:50:57PM +1100, Bruce Evans wrote: > On Wed, 21 Mar 2018, Warner Losh wrote: > > > On Wed, Mar 21, 2018 at 2:27 PM, Konstantin Belousov > > wrote: > >> ... > >> Are you saying that fast interrupt handlers call shutdown_nice() ? This

Re: svn commit: r331298 - head/sys/dev/syscons

2018-03-22 Thread Konstantin Belousov
On Fri, Mar 23, 2018 at 01:21:43AM +1100, Bruce Evans wrote: > I don't like having a whole task for this. The whole thing is just a > hack to work around some the upper layers of the tty driver and some > lower layers not having any input [escape] sequences to control the > kernel. Only the sysco

svn commit: r331374 - head/sys/amd64/amd64

2018-03-22 Thread Konstantin Belousov
Author: kib Date: Thu Mar 22 20:44:27 2018 New Revision: 331374 URL: https://svnweb.freebsd.org/changeset/base/331374 Log: Fixes for ptrace(PT_GETXSTATE_INFO) related to the padding in struct ptrace_xstate_info). struct ptrace_xstate_info has 64bit member but ends up with 32bit one. As

svn commit: r331375 - head/sys/kern

2018-03-22 Thread Konstantin Belousov
Author: kib Date: Thu Mar 22 20:47:25 2018 New Revision: 331375 URL: https://svnweb.freebsd.org/changeset/base/331375 Log: Do not send signals to init directly from shutdown_nice(9), do it from the task context. shutdown_nice() is used from the fast interrupt handlers, mostly for consol

svn commit: r331431 - head/sys/i386/i386

2018-03-23 Thread Konstantin Belousov
Author: kib Date: Fri Mar 23 15:44:31 2018 New Revision: 331431 URL: https://svnweb.freebsd.org/changeset/base/331431 Log: Update comment to match current field names. Sponsored by: The FreeBSD Foundation MFC after:3 days Modified: head/sys/i386/i386/vm86.c Modified: head/sys/i386

svn commit: r331432 - head/sys/i386/i386

2018-03-23 Thread Konstantin Belousov
Author: kib Date: Fri Mar 23 15:46:53 2018 New Revision: 331432 URL: https://svnweb.freebsd.org/changeset/base/331432 Log: There is no need to disable interrupts around npxsave call. i386 was changed to only require critical section around the thread FPU state manipulations, and vm86_bios

svn commit: r331486 - head/sys/amd64/ia32

2018-03-24 Thread Konstantin Belousov
Author: kib Date: Sat Mar 24 12:57:58 2018 New Revision: 331486 URL: https://svnweb.freebsd.org/changeset/base/331486 Log: Improve the lcall $7,$0 syscall emulation on amd64. Current code, which copies the potential syscall arguments into the current frame, puts an arbitrary limit on the

svn commit: r331487 - head/sys/kern

2018-03-24 Thread Konstantin Belousov
Author: kib Date: Sat Mar 24 13:13:52 2018 New Revision: 331487 URL: https://svnweb.freebsd.org/changeset/base/331487 Log: In vn_io_fault1(), reduce the scope where pagefaults are disabled. Most important for the future use, do not call vm_fault_quick_hold_pages() with disabled pagefaults

svn commit: r331489 - head/sys/vm

2018-03-24 Thread Konstantin Belousov
Author: kib Date: Sat Mar 24 13:48:53 2018 New Revision: 331489 URL: https://svnweb.freebsd.org/changeset/base/331489 Log: For vm_zone_stats() sysctl handler, do not drain sbuf calling copyout(9) while owning zone lock. Despite old value sysctl buffer is wired, spurious faults might still

svn commit: r331490 - in head/sys: kern sys vm

2018-03-24 Thread Konstantin Belousov
Author: kib Date: Sat Mar 24 13:51:27 2018 New Revision: 331490 URL: https://svnweb.freebsd.org/changeset/base/331490 Log: Account the size of the vslock-ed memory by the thread. Assert that all such memory is unwired on return to usermode. The count of the wired memory will be used to de

svn commit: r331557 - head/sys/vm

2018-03-26 Thread Konstantin Belousov
Author: kib Date: Mon Mar 26 16:31:12 2018 New Revision: 331557 URL: https://svnweb.freebsd.org/changeset/base/331557 Log: Allow to specify for vm_fault_quick_hold_pages() that nofault mode should be honored. We must not sleep or acquire any MI VM locks if TDP_NOFAULTING is specified.

svn commit: r331622 - in head: sbin/ifconfig sys/net sys/sys

2018-03-27 Thread Konstantin Belousov
Author: kib Date: Tue Mar 27 15:29:32 2018 New Revision: 331622 URL: https://svnweb.freebsd.org/changeset/base/331622 Log: Allow to specify PCP on packets not belonging to any VLAN. According to 802.1Q-2014, VLAN tagged packets with VLAN id 0 should be considered as untagged, and only PCP

svn commit: r331640 - in head/sys: compat/freebsd32 dev/pci kern

2018-03-27 Thread Konstantin Belousov
Author: kib Date: Tue Mar 27 18:05:51 2018 New Revision: 331640 URL: https://svnweb.freebsd.org/changeset/base/331640 Log: Fix several leaks of kernel stack data through paddings. It is random collection of fixes for issues not yet corrected, reported at https://tsyrklevi.ch/clang_analyze

Re: svn commit: r331666 - in head/sys: cddl/contrib/opensolaris/uts/common/fs kern sys

2018-03-28 Thread Konstantin Belousov
On Wed, Mar 28, 2018 at 08:55:31AM +, Andriy Gapon wrote: > +static __inline int > +refcount_acquire_if_not_zero(volatile u_int *count) What about refcount_acquire_nz() > +static __inline int > +refcount_release_if_not_last(volatile u_int *count) refcount_release_nz() _

svn commit: r331760 - head/sys/vm

2018-03-30 Thread Konstantin Belousov
Author: kib Date: Fri Mar 30 10:55:31 2018 New Revision: 331760 URL: https://svnweb.freebsd.org/changeset/base/331760 Log: Make vm_map_max/min/pmap KBI stable. There are out of tree consumers of vm_map_min() and vm_map_max(), and I believe there are consumers of vm_map_pmap(), although th

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/Sym

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/

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

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: hea

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

svn commit: r332060 - head/sys/amd64/amd64

2018-04-05 Thread Konstantin Belousov
Author: kib Date: Thu Apr 5 11:03:05 2018 New Revision: 332060 URL: https://svnweb.freebsd.org/changeset/base/332060 Log: Make the INTO instruction operational in 32bit mode. Having the IDT entry specify ring 0 DPL caused delivery of #GP instead of #OF. The instruction is not valid

svn commit: r332061 - head/sys/amd64/ia32

2018-04-05 Thread Konstantin Belousov
Author: kib Date: Thu Apr 5 11:03:21 2018 New Revision: 332061 URL: https://svnweb.freebsd.org/changeset/base/332061 Log: Fix ERESTART for lcall $7,$0 syscalls. The lcall trampoline enters kernel by int $0x80, which sets up invalid length of the instruction for %rip rewind. Reviewed

Re: svn commit: r331976 - head/sys/modules/cam

2018-04-05 Thread Konstantin Belousov
On Wed, Apr 04, 2018 at 02:37:05AM +, Warner Losh wrote: > 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 >

<    1   2   3   4   5   6   7   8   9   10   >