aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* | Followup to r268466.Konstantin Belousov2014-07-151-28/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move the code to calculate resident count into separate function. It reduces the indent level and makes the operation of vmmap_skip_res_cnt tunable more clear. - Optimize the calculation of the resident page count for map entry. Skip directly to the next lowest available index and page among the whole shadow chain. - Restore the use of pmap_incore(9), only to verify that current mapping is indeed superpage. - Note the issue with the invalid pages. Suggested and reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=268712
* | Change the calculation of the kinfo_vmentry field kve_private_residentKonstantin Belousov2014-07-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | to reflect its name. Noted and reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=268711
* | cxgbe(4): Display CF facility correctly in the device log.Navdeep Parhar2014-07-151-0/+1
| | | | | | | | | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=268706
* | Add support for operand size and address size override prefixes in bhyve'sNeel Natu2014-07-155-123/+234
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instruction emulation [1]. Fix bug in emulation of opcode 0x8A where the destination is a legacy high byte register and the guest vcpu is in 32-bit mode. Prior to this change instead of modifying %ah, %bh, %ch or %dh the emulation would end up modifying %spl, %bpl, %sil or %dil instead. Add support for moffsets by treating it as a 2, 4 or 8 byte immediate value during instruction decoding. Fix bug in verify_gla() where the linear address computed after decoding the instruction was not being truncated to the effective address size [2]. Tested by: Leon Dang [1] Reported by: Peter Grehan [2] Sponsored by: Nahanni Systems Notes: svn path=/head/; revision=268701
* | Actually set the "no execute" bit on 1 MB page mappings in pmap_protect().Alan Cox2014-07-151-1/+1
| | | | | | | | | | | | | | | | | | | | Previously, the "no execute" bit was being set directly in the PTE, instead of the local variable in which the new PTE value is being constructed. So, when the local variable was finally assigned to the PTE, the "no execute" bit setting was lost. Notes: svn path=/head/; revision=268693
* | Fix build with SMP disabled.John Baldwin2014-07-152-0/+8
| | | | | | | | | | | | | | | | CR: https://phabric.freebsd.org/D407 Reviewed by: royger Notes: svn path=/head/; revision=268672
* | Add a comment to explain the EAGAIN is only there for POSIX complianceBaptiste Daroussin2014-07-151-0/+1
| | | | | | | | | | | | | | | | Resquested by: kib Reviewed by: des Notes: svn path=/head/; revision=268671
* | Make amd64 pmap_copy_pages() functional for pages not mapped by DMAP.Konstantin Belousov2014-07-151-5/+53
| | | | | | | | | | | | | | | | | | | | Requested and reviewed by: royger Tested by: pho, royger Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=268660
* | Eliminate repeated calculation of next_bucket in pmap_protect() andAlan Cox2014-07-151-13/+12
| | | | | | | | | | | | | | | | pmap_remove(). Eliminate an unnecessary variable from pmap_remove() and pmap_advise(). Notes: svn path=/head/; revision=268655
* | Add image_data() for checking whether a sequence of blocks has data.Marcel Moolenaar2014-07-154-14/+77
| | | | | | | | | | | | | | | | | | | | | | | | Use this for VHD and VMDK to avoid allocating space in the image for empty sectors. Note that this negatively affects performance because mkimg uses a temporary file for the intermediate storage. When mkimg has better internal book keeping, performance can be significantly improved. Notes: svn path=/head/; revision=268646
* | libc/stdlib: Minor cleanups to code originating in NetBSDPedro F. Giffuni2014-07-153-22/+14
| | | | | | | | | | | | | | | | | | | | Mostly ANSIfication and typos. Obtained from: NetBSD MFC after: 5 days Notes: svn path=/head/; revision=268644
* | Document that listen(2) can fail with EDESTADDRREQ.Kevin Lo2014-07-151-1/+4
| | | | | | | | Notes: svn path=/head/; revision=268643
* | libc/gen: small updates to code originating at OpenBSDPedro F. Giffuni2014-07-152-19/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arc4random.c - CVS rev. 1.22 Change arc4random_uniform() to calculate ``2**32 % upper_bound'' as ``-upper_bound % upper_bound''. Simplifies the code and makes it the same on both ILP32 and LP64 architectures, and also slightly faster on LP64 architectures by using a 32-bit remainder instead of a 64-bit remainder. - CVS rev. 1.23 Spacing readpassphrase.c -CVS rev. v 1.24 most obvious unsigned char casts for ctype Obtained from: OpenBSD MFC after: 5 days Notes: svn path=/head/; revision=268642
* | Fix an issue with service(8) where utilities such as screen(1) and tmux(1)Devin Teske2014-07-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | would behave differently when utilizing rc-script was invoked manually vs. service(8). The issue being that these utilities require the TERM environ variable to be set and service(8) was not passing it down. Reported by: Michael Dexter <editor@callfortesting.org> PR: bin/191869 Reviewed by: allanjude MFC after: 3 days X-MFC-to: stable/10, stable/9 Notes: svn path=/head/; revision=268641
* | Allow multi-byte reads in the private CHELSIO_T4_GET_I2C ioctl. TheNavdeep Parhar2014-07-153-37/+92
| | | | | | | | | | | | | | | | | | | | | | firmware allows up to 48B to be read this way but the driver limits itself to 8B at a time to remain compatible with old cxgbetool binaries. MFC after: 1 week Notes: svn path=/head/; revision=268640
* | Use the blockif CHS routine to create fake CHS values,Peter Grehan2014-07-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | and then populate them in the identity page. This fixes a divide-by-zero error at probe time with NetBSD. MFC after: 1 week. Notes: svn path=/head/; revision=268639
* | Add a call to synthesize a C/H/S value for block emulationsPeter Grehan2014-07-152-0/+51
| | | | | | | | | | | | | | | | that require it (ahci). The algorithm used is from the VHD specification. Notes: svn path=/head/; revision=268638
* | fortune(8): Search fortune files installed by ports/packages as well asGavin Atkinson2014-07-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | those supplied by the base system. PR: 191800 Submitted by: Andy Kosela MFC after: 1 week Notes: svn path=/head/; revision=268637
* | Plug p_pptr null test in do_execve. It is always true.Mateusz Guzik2014-07-141-1/+1
| | | | | | | | Notes: svn path=/head/; revision=268636
* | newfs_msdosfs: Respect FSFIXFATPedro F. Giffuni2014-07-142-4/+4
| | | | | | | | | | | | | | | | | | | | Fix some whitespace issues while here. Obtained from: NetBSD (rev. 1.9) MFC after: 3 days Notes: svn path=/head/; revision=268635
* | Manage struct sigacts refcnt with atomics instead of a mutex.Mateusz Guzik2014-07-142-11/+8
| | | | | | | | | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=268634
* | Fix the Zedboard/Zynq ethernet driver to handle media speed changes soIan Lepore2014-07-144-36/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that it can connect to switches at speeds other than 1gb. This requires changing the reference clock speed. Since we still don't have a general clock API that lets a SoC-independant driver manipulate its own clocks, this change includes a weak reference to a routine named cgem_set_ref_clk(). The default implementation is a no-op; SoC-specific code can provide an implementation that actually changes the speed. Submitted by: Thomas Skibo <ThomasSkibo@sbcglobal.net> Notes: svn path=/head/; revision=268633
* | msdosfs: Assorted fixes from other BSDs.Pedro F. Giffuni2014-07-142-15/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When truncating cluster chains fix the length of the cluster head. http://marc.info/?t=140304310700005&r=1&w=2 Avoid infinite loops in cluster chain linked lists. http://marc.info/?l=openbsd-tech&m=140275150804337&w=2 Avoid off-by-one on FAT12 filesystems. http://marc.info/?l=openbsd-tech&m=140234174104724&w=2 Obtained from: NetBSD (from OpenBSD) MFC after: 1 week Notes: svn path=/head/; revision=268632
* | fsck_msdosfs: be a bit more permissivePedro F. Giffuni2014-07-141-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The free space value in the FSInfo block is merely unitialized when it is 0xffffffff. This fixes a bug found in NetBSD. It must be noted that we never supported all the checks that NetBSD does as some of them would cause failures with a freshly created FAT32 from MS-Windows. While here, bring some space fixes. Obtained from: NetBSD (rev. 1.22) MFC after: 3 days Notes: svn path=/head/; revision=268631
* | Minor (mostly cosmetic) cleanupsPedro F. Giffuni2014-07-142-3/+1
| | | | | | | | | | | | | | | | | | | | | | Several whitespace fixes convert *rootDir from external to static. Obtained from: NetBSD, OpenBSD (partial) MFC after: 3 days Notes: svn path=/head/; revision=268628
* | Bump mdoc date after r268621.Xin LI2014-07-141-1/+1
| | | | | | | | | | | | | | X-MFC-With: r268621 Notes: svn path=/head/; revision=268625
* | On my Lenovo laptop, the firmware maps the EFI framebuffer with MTRRs setNathan Whitehorn2014-07-141-3/+25
| | | | | | | | | | | | | | | | | | | | | | to uncacheable. This leads to execrable console performance. Once PMAP is up, remap the framebuffer as write-combining. This reduces boot time on my laptop by 60% when booting with EFI. MFC after: 2 weeks Notes: svn path=/head/; revision=268624
* | Eliminate dead code. There is no direct map. This code was cut-and-pastedAlan Cox2014-07-141-10/+0
| | | | | | | | | | | | | | from amd64. Notes: svn path=/head/; revision=268623
* | Don't report non-native block-size pools under zpool status -xSteven Hartland2014-07-142-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | zpool status -x is used to identify pools that are exhibiting errors or are otherwise unavailable, therefore non-native block-size pools shouldn't be reported. Also update man page to clarify other additional conditions which won't cause a pool to be displayed under zpool status -x. Sponsored by: Multiplay Notes: svn path=/head/; revision=268621
* | Make generation of nslexer.c more robust.Julio Merino2014-07-141-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that lex errors fail the build instead of being silently ignored due to the piped call. Also postpone the update of the nslexer.c file until we are sure we have generated it properly. These changes fix some very obscure build failures I encountered while building FreeBSD within a chroot that did not have devfs mounted. The specific errors looked like: .../libc.so.7: undefined reference to `_nsyyerror' .../libc.so.7: undefined reference to `_nsyyin' .../libc.so.7: undefined reference to `_nsyylex' .../libc.so.7: undefined reference to `_nsyylineno' .../libc.so.7: undefined reference to `_nsyytext' and were caused due to a mangled nslexer.c being linked into libc. Notes: svn path=/head/; revision=268620
* | Unbreak the build by re-enabling exceptions.Pietro Cerutti2014-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disabling them breaks build on archs using GCC. The problem is at line 156 of bits/basic_ios.h: if (this->exceptions() & __state) __throw_exception_again; With exceptions disabled __throw_exception_again is defined as #define __throw_exception_again at line 45 of exception_defines.h and the code results in an empty loop body, which fails because of -Werror. Approved by: cognet Notes: svn path=/head/; revision=268619
* | Rework the tmpfs unmount.Konstantin Belousov2014-07-143-27/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Suspend filesystem for unmount. This prevents new tmpfs nodes from instantiating, and also ensures that only unmount thread can destroy nodes. - Do not start tmpfs node deletion until all vnodes are reclaimed, which guarantees that no thread can access tmpfs data. For this, call vflush() in the loop, until the mnt_nvnodelistsize is non-zero. Note that after mnt_nvnodelistsize becomes 0, insmntque() blocks insertion of a vnode germ into the mount list of vnodes. - Fail node allocation when the filesystem is being unmounted. This is race-free due to the vflush() call in loop. This is mostly cosmetic, avoiding some more work which might be done until suspension in unmount is started. Note that there is currently no way to prevent new vnode instantiation from readers during the unmount. Due to this, forced unmount might live-lock if vflush() loop cannot get to the zero vnode count due to races with readers. The unmount would proceed after the load is lifted. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=268617
* | Change forgotten in r268615. Set the OBJ_TMPFS_NODE flag forKonstantin Belousov2014-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | vm_object of VREG tmpfs node. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=268616
* | The OBJ_TMPFS flag of vm_object means that there is unreclaimed tmpfsKonstantin Belousov2014-07-142-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vnode for the tmpfs node owning this object. The flag is currently used for two purposes. First, it allows to correctly handle VV_TEXT for tmpfs vnode when the ref count on the object is decremented to 1, similar to vnode_pager_dealloc() for regular filesystems. Second, it prevents some operations, which are done on OBJT_SWAP vm objects backing user anonymous memory, but are incorrect for the object owned by tmpfs node. The second kind of use of the OBJ_TMPFS flag is incorrect, since the vnode might be reclaimed, which clears the flag, but vm object operations must still be disallowed. Introduce one more flag, OBJ_TMPFS_NODE, which is permanently set on the object for VREG tmpfs node, and used instead of OBJ_TMPFS to test whether vm object collapse and similar actions should be disabled. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=268615
* | Use tmpfs_vn_get_ino_gen() to handle the races with reclaim in tmpfsKonstantin Belousov2014-07-141-13/+13
| | | | | | | | | | | | | | | | | | | | | | dotdot lookup. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=268614
* | Style. Add comment about lock mode.Konstantin Belousov2014-07-142-1/+2
| | | | | | | | | | | | | | | | | | Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=268613
* | Extract the code to put a filesystem into the suspended state (at theKonstantin Belousov2014-07-143-44/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unmount time) in the helper vfs_write_suspend_umnt(). Use it instead of two inline copies in FFS. Fix the bug in the FFS unmount, when suspension failed, the ufs extattrs were not reinitialized. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=268612
* | In tmpfs_alloc_file(), code after the 'out' label does only 'returnKonstantin Belousov2014-07-141-9/+5
| | | | | | | | | | | | | | | | | | | | | | error;'. Replace goto's with the return. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=268611
* | Add convenience macro to assert tmpfs node lock.Konstantin Belousov2014-07-142-1/+3
| | | | | | | | | | | | | | | | | | Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=268610
* | Add some assertions for the code handling vm_object for tmpfs vnode.Konstantin Belousov2014-07-142-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In particular, vnode must be exclusively locked when the tmpfs vnode and object are divorced. When the vnode is opened, the object must be still alive, since only live vnode can be opened, and the tmpfs node owns a reference on the object. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=268609
* | The tmpfs_link() must not dereference the filesystem-specific data forKonstantin Belousov2014-07-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | a vnode until it is verified that the vnode indeed belongs to tmpfs mount. Otherwise, it might access random memory, at least in the debug kernel. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=268608
* | In kern_linkat(), avoid passing doomed vnode to the VOP.Konstantin Belousov2014-07-141-2/+8
| | | | | | | | | | | | | | | | | | Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=268607
* | Generalize vn_get_ino() to allow filesystems to use custom vnodeKonstantin Belousov2014-07-144-89/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | producer, instead of hard-coding VFS_VGET(). New function, which takes callback, is called vn_get_ino_gen(), standard callback for vn_get_ino() is provided. Convert inline copies of vn_get_ino() in msdosfs and cd9660 into the uses of vn_get_ino_gen(). Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=268606
* | Remove code separator lines which do not conform to style(9).Konstantin Belousov2014-07-147-132/+0
| | | | | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=268605
* | Make bind(2) and connect(2) return EAFNOSUPPORT for AF_UNIX on wrongKevin Lo2014-07-141-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | address family. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191586 for the original discussion. Reviewed by: terry Notes: svn path=/head/; revision=268601
* | Invoke the DTrace trap handler before calling trap() on amd64. This matchesMark Johnston2014-07-1410-41/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the upstream implementation and helps ensure that a trap induced by tracing fbt::trap:entry is handled without recursively generating another trap. This makes it possible to run most (but not all) of the DTrace tests under common/safety/ without triggering a kernel panic. Submitted by: Anton Rang <anton.rang@isilon.com> (original version) Phabric: D95 Notes: svn path=/head/; revision=268600
* | Explicitly disable the build of tests when building bmake.Julio Merino2014-07-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During "make buildworld", building bmake is (one of) the very first steps and we should not be building any of its tests. Conceptually, this is the right thing to do 1) for build simplicity reasons and 2) because there is no need to build any tests this early on. In practice, this fixes tinderbox builds of CURRENT from 9.x when MK_TESTS is enabled. This is because bsd.test.mk needs some modern bmake features not present in 9.x (:tW) and tinderbox is forcing the build to use the CURRENT share/mk files from the very beginning (see r266617). By skipping the build of the tests when still using the host make, we omit the problem. Arguably, what tinderbox is doing is wrong and needs to be addressed, but that is a separate issue. Notes: svn path=/head/; revision=268598
* | * Update the comments to agree with commit r226595.Steve Kargl2014-07-131-4/+4
| | | | | | | | | | | | | | * While here, fix a nearby typo in a comment. Notes: svn path=/head/; revision=268597
* | Eliminate an unused variable. Refresh two comments.Alan Cox2014-07-131-5/+2
| | | | | | | | Notes: svn path=/head/; revision=268596
* | * Makefile:Steve Kargl2014-07-138-19/+696
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | . Add s_erfl.c to building libm. . Add MLINKS for erfl.3 and erfcl.3. * Symbol.map: . Move erfl and erfcl to their proper location. * ld128/s_erfl.c: . Implementations of erfl and erfcl in the IEEE 754 128-bit format. * ld80/s_erfl.c: . Implementations of erfl and erfcl in the Intel 80-bit format. * man/erf.3: . Document the new functions. . While here, remove an incomplete sentence. * src/imprecise.c: . Remove the stupidity of mapping erfl and erfcl to erf and erfc. * src/math.h: . Move the declarations of erfl and erfcl to their proper place. * src/s_erf.c: . For architectures where double and long double are the same floating point format, use weak references to map erfl to erf and ercl to erfc. Reviewed by: bde (many earlier versions) Notes: svn path=/head/; revision=268593