summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* New pmap implementation for 64-bit PowerPC processors. The main focus ofnwhitehorn2015-02-247-1097/+1097
| | | | | | | | | | | | | | | | | | | | | | | this change is to improve concurrency: - Drop global state stored in the shadow overflow page table (and all other global state) - Remove all global locks - Use per-PTE lock bits to allow parallel page insertion - Reconstruct state when requested for evicted PTEs instead of buffering it during overflow This drops total wall time for make buildworld on a 32-thread POWER8 system by a factor of two and system time by a factor of three, providing performance 20% better than similarly clocked Core i7 Xeons per-core. Performance on smaller SMP systems, where PMAP lock contention was not as much of an issue, is nearly unchanged. Tested on: POWER8, POWER5+, G5 UP, G5 SMP (64-bit and 32-bit kernels) Merged from: user/nwhitehorn/ppc64-pmap-rework Looked over by: jhibbits, andreast MFC after: 3 months Relnotes: yes Sponsored by: FreeBSD Foundation
* cxgbe(4): allow tx hardware checksumming on the netmap interface.np2015-02-241-6/+9
| | | | | | | | | It is disabled by default but users can set IFCAP_TXCSUM on the netmap ifnet (ifconfig ncxl0 txcsum) to override netmap and force the hardware to calculate and insert proper IP and L4 checksums in outbound frames. MFC after: 2 weeks
* Remove a stale comment.gjb2015-02-241-2/+0
| | | | | | MFC after: 1 week X-MFC-with: r279249 Sponsored by: The FreeBSD Foundation
* Add 'cloudware-install' target to handle copying cloudgjb2015-02-242-4/+23
| | | | | | | | | | | | | | | | | disk images to a directory within DESTDIR. Add CLOUDINSTALL variable to automatically generate the actual list of install targets. While here, rename the cloud-specific names from 'vm-' to 'cw-' to avoid naming collisions. Add AZURE_DISK, GCE_DISK, and OPENSTACK_DISK output file variables. Add 'cloudware-install' to the 'install' target. MFC after: 1 week Sponsored by: The FreeBSD Foundation
* Unconditionally install debug directory hierarchyemaste2015-02-241-8/+3
| | | | | | | | | | | | This avoids various failure modes (e.g., when building and installing a single binary with debug data on a system that otherwise does not have it enabled). It is also consistent with the way other directory hierarchies are handled (e.g. share/man). Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D1962
* If sys.mk were found via the magic path .../share/mksjg2015-02-241-0/+10
| | | | | | | replace it with the absolute path of .PARSEDIR, so that sub-makes launched from objdirs (eg kernel) can still find the correct mk files. Reviewed by: obrien
* cxgbe(4): set up congestion management for netmap rx queues.np2015-02-243-4/+38
| | | | | The hw.cxgbe.cong_drop knob controls the response of the chip when netmap queues are congested.
* cxgbe(4): do not set the netmap rxq interrupts on a hair-trigger.np2015-02-241-2/+4
| | | | MFC after: 2 weeks
* cxgbe(4): wait for the hardware to catch up before destroying a netmap txq.np2015-02-241-5/+10
| | | | MFC after: 2 weeks
* cxgbe(4): request an automatic tx update when a netmap txq idles.np2015-02-241-1/+2
| | | | MFC after: 2 weeks
* Pass macro arguments properly.hselasky2015-02-241-2/+2
| | | | MFC after: 1 week
* Fix order of arguments in the TRACEBUF_INITIALIZER macro so that wehselasky2015-02-241-1/+1
| | | | | | can define QUEUE_MACRO_DEBUG to debug list problems. MFC after: 1 week
* msun: drop unnecessary checks (part 2).pfg2015-02-244-4/+4
| | | | | | Drop an unnecessary check in some calculations. The check would have Coverity falsely conclude that a variable could be left undefined.
* Enable 'receive timeout' interrupt allowing us to notbr2015-02-241-10/+25
| | | | | | | | loose 'rx buffer full' event. This fixes operation on ARMv8 Foundation Model. Sponsored by: DARPA, AFRL
* Keep a reference on the coredump vnode for vn_fullpath() call. Do itkib2015-02-241-8/+6
| | | | | | | | by moving vn_close() after the point where notification is sent. Reported by: sbruno Tested by: pho, sbruno Sponsored by: The FreeBSD Foundation
* Change struct attribute to avoid aligned operations mismatchzbb2015-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous __alignment(4) allowed compiler to assume that operations are performed on aligned region. On ARM processor, this led to alignment fault as shown below: trapframe: 0xda9e5b10 FSR=00000001, FAR=a67b680e, spsr=60000113 r0 =00000000, r1 =00000068, r2 =0000007c, r3 =00000000 r4 =a67b6826, r5 =a67b680e, r6 =00000014, r7 =00000068 r8 =00000068, r9 =da9e5bd0, r10=00000011, r11=da9e5c10 r12=da9e5be0, ssp=da9e5b60, slr=a054f164, pc =a054f2cc <...> udp_input+0x264: ldmia r5, {r0-r3, r6} udp_input+0x268: stmia r12, {r0-r3, r6} This was due to instructions which do not support unaligned access, whereas for __alignment(2) compiler replaced ldmia/stmia with some logically equivalent memcpy operations. In fact, the assumption that 'struct ip' is always 4-byte aligned is definitely false, as we have no impact on data alignment of packet stream received. Another possible solution would be to explicitely perform memcpy() on objects of 'struct ip' type, which, however, would suffer from performance drop, and be merely a problem hiding. Please, note that this has nothing to do with ARM32_DISABLE_ALIGNMENT_FAULTS option, but is related strictly to compiler behaviour. Submitted by: Wojciech Macek <wma@semihalf.com> Reviewed by: glebius, ian Obtained from: Semihalf
* Fix endianness on FDT read in ARM GICzbb2015-02-241-4/+4
| | | | | | Submitted by: Jakub Palider <jpa@semihalf.com> Reviewed by: ian, nwhitehorn Obtained from: Semihalf
* Fix possible memory leak and several races in the IPsec policy managementae2015-02-242-1/+18
| | | | | | | | | | | | | | | | | | | | | code. Resurrect the state field in the struct secpolicy, it has IPSEC_SPSTATE_ALIVE value when security policy linked in the chain, and IPSEC_SPSTATE_DEAD value in all other cases. This field protects from trying to unlink one security policy several times from the different threads. Take additional reference in the key_flush_spd() to be sure that policy won't be freed from the different thread while we are sending SPDEXPIRE message. Add KEY_FREESP() call to the key_unlink() to release additional reference that we take when use key_getsp*() functions. Differential Revision: https://reviews.freebsd.org/D1914 Tested by: Emeric POUPON <emeric.poupon at stormshield dot eu> Reviewed by: hrs Sponsored by: Yandex LLC
* Ensure that the XHCI driver will refresh the control endpoint settingshselasky2015-02-241-0/+7
| | | | | | | when re-enumerating a FULL speed device. Else the wrong max packet setting might be used when trying to re-enumerate a FULL speed device. MFC after: 3 days
* Add native netmap support to ixl.luigi2015-02-243-0/+514
| | | | | | | | | | | | | Preliminary tests indicate 32 Mpps on tx, 24 Mpps on rx with source and receiver on two different ports of the same 40G card. Optimizations are likely possible. The code follows closely the one for ixgbe so i do not expect stability issues. Hardware kindly supplied by Intel. Reviewed by: Jack Vogel MFC after: 1 week
* sfxge: add put-list high watermarkarybchik2015-02-242-0/+9
| | | | | | | It is interesting to know how long put-list grows. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor)
* sfxge: use goto to cleanup to avoid duplicate cleanup codearybchik2015-02-241-11/+13
| | | | | Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor)
* Fix printf format warnings on sparc64 and mips.ken2015-02-241-3/+3
| | | | | Sponsored by: Spectra Logic MFC after: 1 month
* Always emulate MSR_PAT on Intel processors and don't rely on PAT save/restoreneel2015-02-244-22/+56
| | | | | | | | | | | | | capability of VT-x. This lets bhyve run nested in older VMware versions that don't support the PAT save/restore capability. Note that the actual value programmed by the guest in MSR_PAT is irrelevant because bhyve sets the 'Ignore PAT' bit in the nested PTE. Reported by: marcel Tested by: Leon Dang (ldang@nahannisys.com) Sponsored by: Nahanni Systems MFC after: 2 weeks
* Emulate MSR 0xC0011024 when running on AMD processors.neel2015-02-241-0/+9
| | | | | | | | OpenBSD guests test bit 0 of this MSR to detect whether the workaround for erratum 721 has been applied. Reported by: Jason Tubnor (jason@tubnor.net) MFC after: 1 week
* Add "-u" option to bhyve(8) to indicate that the RTC should maintain UTC time.neel2015-02-244-13/+21
| | | | | | | | | | The default remains localtime for compatibility with the original device model in bhyve(8). This is required for OpenBSD guests which assume that the RTC keeps UTC time. Reviewed by: grehan Pointed out by: Jason Tubnor (jason@tubnor.net) MFC after: 2 weeks
* Correct a typo.yongari2015-02-241-1/+1
| | | | Reported by: jmg
* Improve memory detection in biosmem.cgrembo2015-02-231-6/+112
| | | | | | | | | | | | - Add a quirk to allow ignoring e820 extended memory detection. - Improve memory detection through e801. - Add bootloader command "biosmem". See differential revision for more details. Reviewed by: jhb, adrian Approved by: adrian Differential Revision: https://reviews.freebsd.org/D1741
* Bump __FreeBSD_version for the mtio(4) / sa(4) ioctl and API additionsken2015-02-231-1/+1
| | | | | | | in revision 279219. Sponsored by: Spectra Logic MFC after: 1 month
* Don't close a block context if it couldn't be opened,grehan2015-02-231-1/+2
| | | | | | | | for example if the backing file doesn't exist, avoiding a null deref. Reviewed by: neel MFC after: 1 week.
* Significant upgrades to sa(4) and mt(1).ken2015-02-2318-378/+6041
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The primary focus of these changes is to modernize FreeBSD's tape infrastructure so that we can take advantage of some of the features of modern tape drives and allow support for LTFS. Significant changes and new features include: o sa(4) driver status and parameter information is now exported via an XML structure. This will allow for changes and improvements later on that will not break userland applications. The old MTIOCGET status ioctl remains, so applications using the existing interface will not break. o 'mt status' now reports drive-reported tape position information as well as the previously available calculated tape position information. These numbers will be different at times, because the drive-reported block numbers are relative to BOP (Beginning of Partition), but the block numbers calculated previously via sa(4) (and still provided) are relative to the last filemark. Both numbers are now provided. 'mt status' now also shows the drive INQUIRY information, serial number and any position flags (BOP, EOT, etc.) provided with the tape position information. 'mt status -v' adds information on the maximum possible I/O size, and the underlying values used to calculate it. o The extra sa(4) /dev entries (/dev/saN.[0-3]) have been removed. The extra devices were originally added as place holders for density-specific device nodes. Some OSes (NetBSD, NetApp's OnTap and Solaris) have had device nodes that, when you write to them, will automatically select a given density for particular tape drives. This is a convenient way of switching densities, but it was never implemented in FreeBSD. Only the device nodes were there, and that sometimes confused users. For modern tape devices, the density is generally not selectable (e.g. with LTO) or defaults to the highest availble density when the tape is rewritten from BOT (e.g. TS11X0). So, for most users, density selection won't be necessary. If they do need to select the density, it is easy enough to use 'mt density' to change it. o Protection information is now supported. This is either a Reed-Solomon CRC or CRC32 that is included at the end of each block read and written. On write, the tape drive verifies the CRC, and on read, the tape drive provides a CRC for the userland application to verify. o New, extensible tape driver parameter get/set interface. o Density reporting information. For drives that support it, 'mt getdensity' will show detailed information on what formats the tape drive supports, and what formats the tape drive supports. o Some mt(1) functionality moved into a new mt(3) library so that external applications can reuse the code. o The new mt(3) library includes helper routines to aid in parsing the XML output of the sa(4) driver, and build a tree of driver metadata. o Support for the MTLOAD (load a tape in the drive) and MTWEOFI (write filemark immediate) ioctls needed by IBM's LTFS implementation. o Improve device departure behavior for the sa(4) driver. The previous implementation led to hangs when the device was open. o This has been tested on the following types of drives: IBM TS1150 IBM TS1140 IBM LTO-6 IBM LTO-5 HP LTO-2 Seagate DDS-4 Quantum DLT-4000 Exabyte 8505 Sony DDS-2 contrib/groff/tmac/doc-syms, share/mk/bsd.libnames.mk, lib/Makefile, Add libmt. lib/libmt/Makefile, lib/libmt/mt.3, lib/libmt/mtlib.c, lib/libmt/mtlib.h, New mt(3) library that contains functions moved from mt(1) and new functions needed to interact with the updated sa(4) driver. This includes XML parser helper functions that application writers can use when writing code to query tape parameters. rescue/rescue/Makefile: Add -lmt to CRUNCH_LIBS. src/share/man/man4/mtio.4 Clarify this man page a bit, and since it contains what is essentially the mtio.h header file, add new ioctls and structure definitions from mtio.h. src/share/man/man4/sa.4 Update BUGS and maintainer section. sys/cam/scsi/scsi_all.c, sys/cam/scsi/scsi_all.h: Add SCSI SECURITY PROTOCOL IN/OUT CDB definitions and CDB building functions. sys/cam/scsi/scsi_sa.c sys/cam/scsi/scsi_sa.h Many tape driver changes, largely outlined above. Increase the sa(4) driver read/write timeout from 4 to 32 minutes. This is based on the recommended values for IBM LTO 5/6 drives. This may also avoid timeouts for other tape hardware that can take a long time to do retries and error recovery. Longer term, a better way to handle this is to ask the drive for recommended timeout values using the REPORT SUPPORTED OPCODES command. Modern IBM and Oracle tape drives at least support that command, and it would allow for more accurate timeout values. Add XML status generation. This is done with a series of macros to eliminate as much duplicate code as possible. The new XML-based status values are reported through the new MTIOCEXTGET ioctl. Add XML driver parameter reporting, using the new MTIOCPARAMGET ioctl. Add a new driver parameter setting interface, using the new MTIOCPARAMSET and MTIOCSETLIST ioctls. Add a new MTIOCRBLIM ioctl to get block limits information. Add CCB/CDB building routines scsi_locate_16, scsi_locate_10, and scsi_read_position_10(). scsi_locate_10 implements the LOCATE command, as does the existing scsi_set_position() command. It just supports additional arguments and features. If/when we figure out a good way to provide backward compatibility for older applications using the old function API, we can just revamp scsi_set_position(). The same goes for scsi_read_position_10() and the existing scsi_read_position() function. Revamp sasetpos() to take the new mtlocate structure as an argument. It now will use either scsi_locate_10() or scsi_locate_16(), depending upon the arguments the user supplies. As before, once we change position we don't have a clear idea of what the current logical position of the tape drive is. For tape drives that support long form position data, we read the current position and store that for later reporting after changing the position. This should help applications like Bacula speed tape access under FreeBSD once they are modified to support the new ioctls. Add a new quirk, SA_QUIRK_NO_LONG_POS, that is set for all drives that report SCSI-2 or older, as well as drives that report an Illegal Request type error for READ POSITION with the long format. So we should automatically detect drives that don't support the long form and stop asking for it after an initial try. Add a partition number to the sa(4) softc. Improve device departure handling. The previous implementation led to hangs when the device was open. If an application had the sa(4) driver open, and attempted to close it after it went away, the cam_periph_release() call in saclose() would cause the periph to get destroyed because that was the last reference to it. Because destroy_dev() was called from the sa(4) driver's cleanup routine (sacleanup()), and would block waiting for the close to happen, a deadlock would result. So instead of calling destroy_dev() from the cleanup routine, call destroy_dev_sched_cb() from saoninvalidate() and wait for the callback. Acquire a reference for devfs in saregister(), and release it in the new sadevgonecb() routine when all devfs devices for the particular sa(4) driver instance are gone. Add a new function, sasetupdev(), to centralize setting per-instance devfs device parameters instead of repeating the code in saregister(). Add an open count to the softc, so we know how many peripheral driver references are a result of open sessions. Add the D_TRACKCLOSE flag to the cdevsw flags so that we get a 1:1 mapping of open to close calls instead of a N:1 mapping. This should be a no-op for everything except the control device, since we don't allow more than one open on non-control devices. However, since we do allow multiple opens on the control device, the combination of the open count and the D_TRACKCLOSE flag should result in an accurate peripheral driver reference count, and an accurate open count. The accurate open count allows us to release all peripheral driver references that are the result of open contexts once we get the callback from devfs. sys/sys/mtio.h: Add a number of new mt(4) ioctls and the requisite data structures. None of the existing interfaces been removed or changed. This includes definitions for the following new ioctls: MTIOCRBLIM /* get block limits */ MTIOCEXTLOCATE /* seek to position */ MTIOCEXTGET /* get tape status */ MTIOCPARAMGET /* get tape params */ MTIOCPARAMSET /* set tape params */ MTIOCSETLIST /* set N params */ usr.bin/mt/Makefile: mt(1) now depends on libmt, libsbuf and libbsdxml. usr.bin/mt/mt.1: Document new mt(1) features and subcommands. usr.bin/mt/mt.c: Implement support for mt(1) subcommands that need to use getopt(3) for their arguments. Implement a new 'mt status' command to replace the old 'mt status' command. The old status command has been renamed 'ostatus'. The new status function uses the MTIOCEXTGET ioctl, and therefore parses the XML data to determine drive status. The -x argument to 'mt status' allows the user to dump out the raw XML reported by the kernel. The new status display is mostly the same as the old status display, except that it doesn't print the redundant density mode information, and it does print the current partition number and position flags. Add a new command, 'mt locate', that will supersede the old 'mt setspos' and 'mt sethpos' commands. 'mt locate' implements all of the functionality of the MTIOCEXTLOCATE ioctl, and allows the user to change the logical position of the tape drive in a number of ways. (Partition, block number, file number, set mark number, end of data.) The immediate bit and the explicit address bits are implemented, but not documented in the man page. Add a new 'mt weofi' command to use the new MTWEOFI ioctl. This allows the user to ask the drive to write a filemark without waiting around for the operation to complete. Add a new 'mt getdensity' command that gets the XML-based tape drive density report from the sa(4) driver and displays it. This uses the SCSI REPORT DENSITY SUPPORT command to get comprehensive information from the tape drive about what formats it is able to read and write. Add a new 'mt protect' command that allows getting and setting tape drive protection information. The protection information is a CRC tacked on to the end of every read/write from and to the tape drive. Sponsored by: Spectra Logic MFC after: 1 month
* Fix race in interrupt handling that could cause IO to hang up under heavynwhitehorn2015-02-231-6/+7
| | | | load.
* There is no reason to do i+dcache writeback and invalidate when changingian2015-02-231-4/+0
| | | | | | | | the translation table (this may be left over from armv5 days). It's especially bad to do so using a cache operation that isn't coherent on SMP systems. Submitted by: Michal Meloun
* A lot of current code in network stack expects mbufs not havingglebius2015-02-231-0/+1
| | | | | | m_nextpkt pointer, assuming that if there is one, then this is a packet batch. Thus, mbufq_dequeue() needs to clear it on mbuf that is being returned.
* Previous version of mbufq were fine initialized by M_ZERO, whileglebius2015-02-231-0/+3
| | | | | | new one require explicti initialization. Reported by: royger
* Add support for the DWC OTG v2 chipset found in the STM32F4 series ofhselasky2015-02-232-11/+48
| | | | | | | processors. Make sure we pullup the data lines in device mode when we power on the port. MFC after: 1 week
* soreceive_generic() still has similar KASSERT(), therefore instead ofae2015-02-231-0/+2
| | | | | | | remove KASSERT(), change it to check mbuf isn't NULL. Suggested by: kib MFC after: 1 week
* In some cases soreceive_dgram() can return no data, but has controlae2015-02-231-5/+5
| | | | | | | | | | | | message. This can happen when application is sending packets too big for the path MTU and recvmsg() will return zero (indicating no data) but there will be a cmsghdr with cmsg_type set to IPV6_PATHMTU. Remove KASSERT() which does NULL pointer dereference in such case. Also call m_freem() only when m isn't NULL. PR: 197882 MFC after: 1 week Sponsored by: Yandex LLC
* Macro fixes:hselasky2015-02-232-1/+3
| | | | | | | | - Add missing "order_base_2()" macro. - Fix BUILD_BUG_ON() macro. MFC after: 1 month Sponsored by: Mellanox Technologies
* add MODULE_VERSION, needed to track module dependenciesluigi2015-02-231-0/+1
| | | | MFC after: 3 days
* Fill in missing dependencies for dtrace related tools so the bootstrap-toolsngie2015-02-231-0/+3
| | | | | | | | compiles properly on older hosts Pointyhat to: me X-MFC with: r279197 MFC after: 2 weeks
* Parallelize building bootstrap-toolsngie2015-02-231-1/+19
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1901 MFC after: 2 weeks Reviewed by: ian No serious objections from: imp
* Kernel support for the Vector-Scalar eXtension (VSX) found on the POWER7nwhitehorn2015-02-2213-61/+138
| | | | | | | | | | | | | | | | and POWER8. This instruction set unifies the 32 64-bit scalar floating point registers with the 32 128-bit vector registers into a single bank of 64 128-bit registers. Kernel support mostly amounts to saving and restoring the wider version of the floating point registers and making sure that both scalar FP and vector registers are enabled once a VSX instruction is executed. get_mcontext() and friends currently cannot see the high bits, which will require a little more work. As the system compiler (GCC 4.2) does not support VSX, making use of this from userland requires either newer GCC or clang. Relnotes: yes Sponsored by: FreeBSD Foundation
* sh: Add details about importing the environment and initializing OPTIND.jilles2015-02-221-7/+14
|
* Add some opcodes for assembling forthcoming VSX (Vector-Scalar eXtension)nwhitehorn2015-02-221-0/+5
| | | | | support in the kernel. Userspace programs are expected to rely on LLVM's integrated assembler or newer binutils.
* setmode(3): Make sure that setmode sets errno on failure.pfg2015-02-222-20/+47
| | | | | | | | | | Our man page already documented this partially but now we have some consistent behavior. PR: 136669 Obtained from: NetBSD (CVS rev. 1.31, 1.33) Relnotes: yes MFC after: 3 weeks
* o Typo: securiy -> security.maxim2015-02-221-6/+6
| | | | | | PR: 197927 Submitted by: mike.543@comcast.net MFC after: 1 week
* sfxge: implement if_get_counter callbackarybchik2015-02-225-2/+91
| | | | | Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor)
* sfxge: add common code support for changing TX queue pacearybchik2015-02-223-0/+73
| | | | | | | | | | | | | To delay packets from a particular TX queue by a particular time, write a value into the TX Pace table s.t. pace time <= TX Pace Clock Period * (2 ^ pace value) - the TX pace clock is 1/13 of the system clock, so its period should be 104 or 52 ns depending on whether turbo mode is active. EFX_TX_PACE_CLOCK_BASE added by me. Submitted by: Mark Spender <mspender at solarflare.com> Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor)
* sfxge: correct event queue interrupt moderation timer quantaarybchik2015-02-225-7/+11
| | | | | | Submitted by: Andrew Lee <alee at solarflare.com> Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor)
OpenPOWER on IntegriCloud