summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* The si_status field of the siginfo_t, provided by the waitid(2) andkib2015-07-1818-74/+99
| | | | | | | | | | | | | | | | SIGCHLD signal, should keep full 32 bits of the status passed to the _exit(2). Split the combined p_xstat of the struct proc into the separate exit status p_xexit for normal process exit, and signalled termination information p_xsig. Kernel-visible macro KW_EXITCODE() reconstructs old p_xstat from p_xexit and p_xsig. p_xexit contains complete status and copied out into si_status. Requested by: Joerg Schilling Reviewed by: jilles (previous version), pho Tested by: pho Sponsored by: The FreeBSD Foundation
* Since the IETF has redefined the meaning of the tos field to accommodatekevlo2015-07-181-10/+11
| | | | | | | | | | a set of differentiated services, set IPTOS_PREC_* macros using IPTOS_DSCP_* macro definitions. While here, add IPTOS_DSCP_VA macro according to RFC 5865. Differential Revision: https://reviews.freebsd.org/D3119 Reviewed by: gnn
* Fix the !KDTRACE_HOOKS build.markj2015-07-181-0/+2
| | | | X-MFC-With: r285664
* Fix contraction spotted by igor(1) and remove 2 .Ed spotted by mandoc(1).araujo2015-07-181-7/+5
| | | | | | | | | Also, don't capitalize "module" and remove a redundant phrase introduced in my previous commit. Differential Revision: D3112 Reviewed by: wblock Sponsored by: gandi.net
* Pass the lock object to lockstat_nsecs() and return immediately ifmarkj2015-07-185-28/+33
| | | | | | | | | LO_NOPROFILE is set. Some timecounter handlers acquire a spin mutex, and we don't want to recurse if lockstat probes are enabled. PR: 201642 Reviewed by: avg MFC after: 3 days
* Modify lockstat_nsecs() to just return unless lockstat probes are actuallymarkj2015-07-183-1/+9
| | | | | | | | | | | | enabled. The cost of a timecounter read can be quite significant, and the problem became more apparent after r284297, since that change resulted in a call to lockstat_nsecs() for each acquisition of an rwlock read lock. PR: 201642 Reviewed by: avg Tested by: Jason Unovitch MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D3073
* Merge driver for PMC Sierra's range of SAS/SATA HBAs.benno2015-07-17142-0/+378010
|\ | | | | | | | | Submitted by: Achim Leubner <Achim.Leubner@pmcs.com> Reviewed by: scottl
| * Enable pms module on amd64 for now.benno2015-07-171-0/+2
| |
| * Disable debugging.benno2015-07-171-4/+4
| | | | | | | | | | Submitted by: Vasanthalakshmi Tharmarajan <Vasanthalakshmi.Tharmarajan@pmcs.com> Reviewed by: scottl
| * Driver 'pmspcv' added. Supports PMC-Sierra ↵achim2015-07-07141-0/+378008
| | | | | | | | PM8001/8081/8088/8089/8074/8076/8077 SAS/SATA HBA Controllers.
* | Undo r285656.ed2015-07-172-63/+64
| | | | | | | | | | | | | | | | It turns out that the CDDL sources already introduce a function called thread_create(). I'll investigate what we can do to make these functions coexist. Reported by: Ivan Klymenko
* | make ctdladm(8) return 0 is everything was ok.bapt2015-07-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | retval is used to test the return of XML_Parse function which is ok if 1 is returned and retval it directly returned to the main function and used as an exit value. if all the parsing part is done reset retval to 0 so that the command return 0 if everything ok Differential Revision: https://reviews.freebsd.org/D3102 Reviewed by: trasz MFC after: 3 days Sponsored by: gandi.net
* | Check TCP timestamp option flag so that the automatic receive bufferpkelsey2015-07-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | scaling code does not use an uninitialized timestamp echo reply value from the stack when timestamps are not enabled. Differential Revision: https://reviews.freebsd.org/D3060 Reviewed by: hiren Approved by: jmallett (mentor) MFC after: 3 days Sponsored by: Norse Corp, Inc.
* | Add an API for easily creating userspace threads in kernelspace.ed2015-07-172-64/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This change refactors the existing create_thread() function to be more generic. It replaces almost all of its arguments by a callback that can be used to extract the thread ID and copy it out to the right place, but also to perform additional initialization steps, such as setting the trapframe. This also makes the difference between thr_new() and thr_create() more clear in my opinion. This function is going to be used by the CloudABI compatibility layer. Reviewed by: kib MFC after: 1 month
* | Fix possible coherency issues between PEs related to I-cachezbb2015-07-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Basing on B.2.3.4: Synchronization and coherency issues between data and instruction accesses. To ensure that modified instructions are visible to all PEs (Processing Elements) in a shareability domain one need to perform following sequence: 1. Clean D-cache 2. Ensure the visibility of data cleaned from cache 3. Invalidate I-cache 4. Ensure completion 5. In SMP system PE must issue isb to ensure execution of the modified instructions Reviewed by: andrew Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3106
* | Fix secondary stacks calculation on ARM64zbb2015-07-171-2/+1
| | | | | | | | | | | | | | | | | | | | Secondary stack calculation is modified to provide stack_top = secondary_stacks + (cpu_id) * PAGE_SIZE * KSTACK_PAGES because on ARM64 the stack grows to lower memory addresses. Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3107
* | Increase DMAP (Direct Map) size on ARM64zbb2015-07-171-2/+2
| | | | | | | | | | | | | | | | | | | | Previous DMAP size was too small for systems with more than 64GB of RAM. Increase it to 128GB to support ThunderX CRB. Reviewed by: andrew Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3113
* | Implement CloudABI memory management system calls.ed2015-07-172-17/+110
| | | | | | | | | | | | | | | | | | | | Add support for the <sys/mman.h> functions by wrapping around our own implementations. There are no kern_*() variants of these system calls, but we also don't need them in this case. It is sufficient to just call into the sys_*() functions. Differential Revision: https://reviews.freebsd.org/D3033 Reviewed by: brooks
* | Move assignments around to avoid a false-positive uninitialized variabledes2015-07-171-2/+2
| | | | | | | | | | | | | | warning which broke the sparc64 build. PR: 201585 MFC after: 3 weeks
* | cxgbe(4): Ask the firmware for the start of the RSS slice for a port andnp2015-07-172-0/+13
| | | | | | | | | | | | | | save it for later. This enables direct manipulation of the indirection tables (although the stock driver doesn't do that right now). MFC after: 1 month
* | Describe how to load gmultipath at boot time.araujo2015-07-171-1/+11
| | | | | | | | | | | | Differential Revision: D3112 Reviewed by: allanjude, bapt Sponsored by: gandi.net
* | Mention the dd-like recoverdisk(1) to help folks find this great BSD command.obrien2015-07-161-0/+1
| |
* | sqlite: clean a couple of invocations of memcpy(3)pfg2015-07-161-2/+2
| | | | | | | | | | | | | | | | Found almost accidentally by our native gcc when enhanced with FORTIFY_SOURCE. Submitted by: Oliver Pinter Sponosored by: Google Inc. GSoC 2015
* | When checking for the valid value of the frame pointer, verify that itkib2015-07-164-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | belongs to the kernel stack address range for the thread. Right now, code checks that new frame is not farther then KSTACK_PAGES pages from the current frame, which allows the address to point past the top of the stack. Reviewed by: andrew, emaste, markj Differential revision: https://reviews.freebsd.org/D3108 Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
* | ssh: canonicize the host name before looking it up in the host filevangyzen2015-07-161-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Re-apply r99054 by des in 2002. This was accidentally dropped by the update to OpenSSH 6.5p1 (r261320). This change is actually taken from r387082 of ports/security/openssh-portable/files/patch-ssh.c PR: 198043 Differential Revision: https://reviews.freebsd.org/D3103 Reviewed by: des Approved by: kib (mentor) MFC after: 3 days Relnotes: yes Sponsored by: Dell Inc.
* | Add a sysentvec for CloudABI on x86-64.ed2015-07-168-23/+416
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: For CloudABI we need to put two things on the stack of new processes: the argument data (a binary blob; not strings) and a startup data structure. The startup data structure contains interesting things such as a pointer to the ELF program header, the thread ID of the initial thread, a stack smashing protection canary, and a pointer to the argument data. Fetching system call arguments and setting the return value is similar to FreeBSD. The only differences are that system call 0 does not exist and that we call into cloudabi_convert_errno() to convert the error code. We also need this function in a couple of other places, so we'd better reuse it here. Reviewers: dchagin, kib Reviewed By: kib Subscribers: imp Differential Revision: https://reviews.freebsd.org/D3098
* | Document r285550, w(1) now displays the full IPv6 address of a remotegjb2015-07-161-0/+4
| | | | | | | | | | | | connected host. Sponsored by: The FreeBSD Foundation
* | Add an adapter CORE lock in the DDB hook em_dump_queue to avoid WITNESSsbruno2015-07-161-0/+2
| | | | | | | | | | | | | | panic in em_init_locked() while debugging. MFC after: 2 weeks Sponsored by: Limelight Networks
* | Optimise the DWC OTG host mode driver's transmit path:hselasky2015-07-163-114/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Use the TX FIFO empty interrupts to poll the transmit FIFO usage, instead of using own software counters and waiting for SOF interrupts. Assume that enough FIFO space is available to execute one USB OUT transfer of any kind when the TX FIFO is empty. 2) Use the host channel halted event to asynchronously wait for host channels to be disabled instead of waiting for SOF interrupts. This results in less turnaround time for re-using host channels and at the same time increases the performance. The network transmit performance measured by "iperf" for the "RPi-B v1 2011/12" board, increased from 45MBit/s to 65Mbit/s after applying the changes above. No regressions seen using: - High Speed (BULK, CONTROL, INTERRUPT) - Full Speed (All transfer types) - Low Speed (Control and Interrupt) MFC after: 1 month Submitted by: Daisuke Aoyama <aoyama@peach.ne.jp>
* | Fix a small typo: "the the".ed2015-07-161-2/+2
| | | | | | | | Spotted by: wblock
* | fd: partially deduplicate fdescfree and fdescfree_remappedmjg2015-07-161-49/+37
| | | | | | | | | | This also moves vrele of cdir/rdir/jdir vnodes earlier, which should not matter.
* | Get rid of lim_update_thread and cred_update_thread.mjg2015-07-166-42/+22
| | | | | | | | | | | | Their primary use was in thread_cow_update to free up old resources. Freeing had to be done with proc lock held and _cow_ funcs already knew how to free old structs.
* | vfs: implement v_holdcnt/v_usecount manipulation using atomic opsmjg2015-07-166-155/+198
| | | | | | | | | | | | | | | | Transitions 0->1 and 1->0 (which decide e.g. on putting the vnode on the free list) of either counter are still guarded with vnode interlock. Reviewed by: kib (earlier version) Tested by: pho
* | Split out the arm and armv6 parts of atomic.h to new files. While here useandrew2015-07-163-1026/+1113
| | | | | | | | | | | | __ARM_ARCH to determine which revision of the architecture is applicable. Sponsored by: ABT Systems Ltd
* | Add a -s option which adds a column listing the connection state ifdes2015-07-162-8/+33
| | | | | | | | | | | | | | applicable (currently only for TCP). PR: 201585 MFC after: 3 weeks
* | Fix warnings about unused functions for UP build.kib2015-07-161-3/+7
| | | | | | | | Sponsored by: The FreeBSD Foundation
* | Actually recognize all Intel Lynx Point devices we have device IDs for.brueffer2015-07-161-0/+29
| | | | | | | | | | | | PR: 195851 Submitted by: ftigeot@wolfpond.org MFC after: 1 week
* | Fix KSTACK_PAGES issue when the default value was changed in KERNCONFzbb2015-07-1620-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If KSTACK_PAGES was changed to anything alse than the default, the value from param.h was taken instead in some places and the value from KENRCONF in some others. This resulted in inconsistency which caused corruption in SMP envorinment. Ensure all places where KSTACK_PAGES are used the opt_kstack_pages.h is included. The file opt_kstack_pages.h could not be included in param.h because was breaking the toolchain compilation. Reviewed by: kib Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3094
* | Set-up proper TCR values for memory related to Translation Table Walkingzbb2015-07-162-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | This commit adds proper cache and shareability attributes to the TCR register. Set memory attributes to Normal, outer and inner cacheable WBWA. Set shareability to inner and outer shareable when SMP is enabled. Reviewed by: andrew Obtained from: Semihalf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3093
* | Fix typo in register definition.kevlo2015-07-161-1/+1
| | | | | | | | | | Submitted by: James Hung Reviewed by: sbruno
* | Implement CloudABI's exec() call.ed2015-07-165-9/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In a runtime that is purely based on capability-based security, there is a strong emphasis on how programs start their execution. We need to make sure that we execute an new program with an exact set of file descriptors, ensuring that credentials are not leaked into the process accidentally. Providing the right file descriptors is just half the problem. There also needs to be a framework in place that gives meaning to these file descriptors. How does a CloudABI mail server know which of the file descriptors corresponds to the socket that receives incoming emails? Furthermore, how will this mail server acquire its configuration parameters, as it cannot open a configuration file from a global path on disk? CloudABI solves this problem by replacing traditional string command line arguments by tree-like data structure consisting of scalars, sequences and mappings (similar to YAML/JSON). In this structure, file descriptors are treated as a first-class citizen. When calling exec(), file descriptors are passed on to the new executable if and only if they are referenced from this tree structure. See the cloudabi-run(1) man page for more details and examples (sysutils/cloudabi-utils). Fortunately, the kernel does not need to care about this tree structure at all. The C library is responsible for serializing and deserializing, but also for extracting the list of referenced file descriptors. The system call only receives a copy of the serialized data and a layout of what the new file descriptor table should look like: int proc_exec(int execfd, const void *data, size_t datalen, const int *fds, size_t fdslen); This change introduces a set of fd*_remapped() functions: - fdcopy_remapped() pulls a copy of a file descriptor table, remapping all of the file descriptors according to the provided mapping table. - fdinstall_remapped() replaces the file descriptor table of the process by the copy created by fdcopy_remapped(). - fdescfree_remapped() frees the table in case we aborted before fdinstall_remapped(). We then add a function exec_copyin_data_fds() that builds on top these functions. It copies in the data and constructs a new remapped file descriptor. This is used by cloudabi_sys_proc_exec(). Test Plan: cloudabi-run(1) is capable of spawning processes successfully, providing it data and file descriptors. procstat -f seems to confirm all is good. Regular FreeBSD processes also work properly. Reviewers: kib, mjg Reviewed By: mjg Subscribers: imp Differential Revision: https://reviews.freebsd.org/D3079
* | Fix formatting.jhibbits2015-07-161-1/+1
| |
* | Fix userland program exception handling for powerpc64.jhibbits2015-07-161-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | It appears that the linker will not handle 64-bit relocations at addresses that are not aligned to 8-byte boundaries. Prior to this change the line: .llong generictrap was aligned to a 4-byte address, and the linker replaced that with an 8-byte 0x0. Aligning that address to 8 bytes caused the linker to generate the proper relocation. As a follow-through, the dblow from trap_subr33.S used the code sequence 'lwz %r1, TRAP_GENTRAP(0)', so this reproduces the analogue of that for 64-bit.
* | If uart interrupts are not functioning then schedule the callout to do theneel2015-07-161-2/+10
| | | | | | | | | | | | | | | | | | polling at device attach time [1]. Add tunables 'debug.uart_force_poll' and 'debug.uart_poll_freq' to control uart polling. Submitted by: Aleksey Kuleshov (rndfax@yandex.ru) [1]
* | Fix a warning spotted by gcc4.9: dereferencing type-punned pointer will breakaraujo2015-07-161-26/+31
| | | | | | | | | | | | | | | | | | | | strict-aliasing rules. Declare some variables as statics as well as some functions that are internal helpers. Update the function broadcast_result() to a post-K&R definition. Differential Revision: D2690 Reviewed by: rodrigc, dim
* | Comment out usr/sbin/mailwrapper removalache2015-07-161-1/+4
| | | | | | | | | | | | | | because for no mailwrapper case we have: /usr/sbin/sendmail -> /usr/sbin/mailwrapper /usr/sbin/mailwrapper -> /usr/libexec/sendmail/sendmail Add comment explaining it.
* | Do not use atomic_swap_int(9), it is not available on allkib2015-07-151-2/+2
| | | | | | | | | | | | | | | | | | | | architectures. Atomic_cmpset_int(9) is a direct replacement, due to loop. The change fixes arm, arm64, mips an sparc64, which lack atomic_swap(). Suggested and reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
* | fix the docs, the number of frags per inode (NFPI) changed in r228794jmg2015-07-151-4/+4
| | | | | | | | | | | | | | | | to 2 from 4, but the man page didn't get updated... other minor changes to make igor happy... MFC after: 3 days
* | Fix trimming spaces writing at index -1 if an empty string is passedbapt2015-07-151-2/+7
| | | | | | | | Submitted by: Gennady Proskurin <gprspb@mail.ru>
* | Reset non-zero it_need indicator to zero atomically with fetching itskib2015-07-151-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | current value. It is believed that the change is the real fix for the issue which was covered over by the r252683. With the current code, if the interrupt handler sets it_need between read and consequent reset, the update could be lost and ithread_execute_handlers() would not be called in response to the lost update. The r252683 could have hide the issue since at the moment of commit, atomic_load_acq_int() did locked cmpxchg on the variable, which puts the cache line into the exclusive owned state and clears store buffers. Then the immediate store of zero has very high chance of reusing the exclusive state of the cache line and make the load and store sequence operate as atomic swap. For now, add the acq+rel fence immediately after the swap, to not disturb current (but excessive) ordering. Acquire is needed for the ih_need reads after the load, while release does not serve a useful purpose [*]. Reviewed by: alc Noted by: alc [*] Discussed with: bde Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
OpenPOWER on IntegriCloud