MFC: r212043
Add a null_remove() function to nullfs, so that the v_usecount
of the lower level vnode is incremented to greater than 1 when
the upper level vnode's v_usecount is greater than one. This
is necessary for the NFS clients, so that they will do a silly
rename of the file instead of actually removing it when the
file is still in use. It is "racy", since the v_usecount is
incremented in many places in the kernel with
minimal synchronization, but an extraneous silly rename is
preferred to not doing a silly rename when it is required.
The only other file systems that currently check the value
of v_usecount in their VOP_REMOVE() functions are nwfs and
smbfs. These file systems choose to fail a remove when the
v_usecount is greater than 1 and I believe will function
more correctly with this patch, as well.
MFC r211213:
The buffers b_vflags field is not always properly protected by
bufobj lock. If b_bufobj is not NULL, then bufobj lock should be
held when manipulating the flags. Not doing this sometimes leaves
BV_BKGRDINPROG to be erronously set, causing softdep' getdirtybuf() to
stuck indefinitely in "getbuf" sleep, waiting for background write to
finish which is not actually performed.
Add INVARIANTS checking that numfreebufs values are sane. Also add a
per-buf flag to catch if a buf is double-counted in the free count.
This code was useful to debug an instance where a local patch at Isilon
was incorrectly managing numfreebufs for a new buf state.
Since top displays the uptime including seconds, there is no need to add 30
onto it, which may have been used for rounding purposes in other utilities.
PR: bin/147934
Submitted by: Janne Snabb <snabb at epipe.com>
Approved by: rrs (mentor)
It's not necessary to reset the chip every time an input overflow event
occurs. In addition, the delay when programming the short cable fix
should be 100us, not 100ms.
MFC: r211953
Add acquisition of a reference count on nfsv4root_lock in the
nfsd_recalldelegation() function, since this function is called
by nfsd threads when they are handling NFSv2 or NFSv3 RPCs, where
no reference count would have been acquired.
MFC: r211951
The timer routine in the experimental NFS server did not acquire
the correct mutex when checking nfsv4root_lock. Although this
could be fixed by adding mutex lock/unlock calls, zack.kirsch at
isilon.com suggested a better fix that uses a non-blocking
acquisition of a reference count on nfsv4root_lock. This fix
allows the weird NFSLOCKSTATE(); NFSUNLOCKSTATE(); synchronization
to be deleted. This patch applies this fix.
Rework memguard(9) to reserve significantly more KVA to detect
use-after-free over a longer time. Also release the backing pages of
a guarded allocation at free(9) time to reduce the overhead of using
memguard(9). Allow setting and varying the malloc type at run-time.
Add knobs to allow:
- randomly guarding memory
- adding un-backed KVA guard pages to detect underflow and overflow
- a lower limit on the size of allocations that are guarded
r211229:
Fix compile. It seemed better to have memguard.c include opt_vm.h in
case future compile-time knobs were added that it wants to use.
Also add include guards and forward declarations to vm/memguard.h.
r212058:
The realloc case for memguard(9) will copy too many bytes when
reallocating to a smaller-sized allocation. Fix this issue.
r212063:
Have memguard(9) crash with an easier-to-debug message on double-free.
MFC:
r212169: Allow / in the NANO_DEVICE
r209225: Allow boot.config to have different values than just -h.
r209210: Allow population of /cfg and /data. Begin the move to
making all slice creation overrideable too, but there's a few
problems doing that for the duplicated partitions (s1 and s2), so
just comment that it needs work.
r209209: Create a make.conf. not needed for runtime, but some ports
want to spam it at compile or install time.
r209207: make these convenience functions more convenient by accepting
all args, not just the first. makes mechanical conversion of old
style more forgiving.
r207436: Fix typo in usage message. Add -n to the list of valid arguments.
r206276: Fix comment about NANO_ARCH. It can be set now. Also add
a warning about how it confuses TARGET and TARGET_ARCH and the need
to separate the two out into independent variables.
In protosw we define pr_protocol as short, while on the wire
it is an uint8_t. That way we can have "internal" protocols
like DIVERT, SEND or gaps for modules (PROTO_SPACER).
Switch ipproto_{un,}register to accept a short protocol number(*)
and do an upfront check for valid boundries. With this we
also consistently report EPROTONOSUPPORT for out of bounds
protocols, as we did for proto == 0. This allows a caller
to not error for this case, which is especially important
if we want to automatically call these from domain handling.
(*) the functions have been without any in-tree consumer
since the initial introducation, so this is considered save.
Implement ip6proto_{un,}register() similarly to their legacy IP
counter parts to allow modules to hook up dynamically.
When moving an ethernet ifnet from one vnet to another, destroy the
associated ng_ether netgraph node in the current vnet, and create a
new one in the target vnet.
MFC: r212047
If a process is being debugged, skips job control caused by SIGSTOP/SIGCONT
signals, because it is managed by debugger, however a normal signal sent to
a interruptibly sleeping thread wakes up the thread so it will handle the
signal when the process leaves the stopped state.
MFC: r211830
Add mutex locking for the call to replay_prune() in
replay_setsize(), since replay_prune() expects the
rc_lock to be held when it is called.
MFC: r211789
If the first iteration of the do loop in replay_prune()
succeeded and a subsequent interation failed to find an
entry to prune, it could loop infinitely, since the
"freed" variable wasn't reset to FALSE. This patch moves
setting freed FALSE to inside the loop to fix the problem.
MFC r211748:
Move the __stack_chk_fail_local@FBSD_1.0 compat symbol definition into
the separate .o for libc_pic.a. This prevents rtld from making the
symbol global.
MFC r196636:
Connect bwi up to the build. While there are some problems with this
driver still, it generally works well for most people most of the
time. It is still too green for GENERIC, however.
Submitted by: many (latest being kwm@)
Approved by: imp
Requested by: Warren Block <wblock at wonkity dot com>
MFC r209888:
Fixes a bug for LP PHY that some frames have 2 padding bytes at the
start so we should adjust the mbuf if the driver is running in PIO
mode. Now it should work well with WPA authentication and association
for LP PHY devices.
MFC r210923:
Add new make_dev_p(9) flag MAKEDEV_ETERNAL to inform devfs that created
cdev will never be destroyed. Propagate the flag to devfs vnodes as
VV_ETERNVALDEV. Use the flags to avoid acquiring devmtx and taking a
thread reference on such nodes.
r210331:
Add a new ELF type denoting GNU style hash tables.
r210332:
Changes for supporting GNU Hash sections.
r210333:
Note that the *_fsize() functions are only defined for ELF types that
have a fixed size.
r210335:
- Return zero for file sizes of ELF types that have a variable size.
- Neaten a few comments.
r210336:
Reduce verbosity.
r210338:
Perform additional checks when translating between file and memory
representations of ELF types.
The ELF(3) API allows applications to request a conversion that is
`in-place', i.e., with source and destinations data buffers being
the same. However, the file and memory sizes of ELF sections that
have additional internal structure, such as those of type `Elf_Note',
or `Elf_GNU_Hash_Header', can be determined only known after the
type-specific headers that comprise the first few words in these
sections are read and translated.
Pass in the size of destination buffer to type translation routines
in "libelf_convert.m4" and have these routines return an error code
if the translated data would not fit inside the destination buffer.
r210340:
- Document that the *fsize() functions return a size of 1 for Elf
types that don't have a fixed size.
- The *fsize() functions should return a size of 1, for variable length
types.
- Redefine symbol ELF_T_LAST to match the current end of the list.
r210341:
Add support for translating sections of type ELF_T_GNUHASH.
r210351:
* Note that ar(1) archives may also be opened using `elf_memory(3)`.
* Ignore the passed in value of the `fd` argument for ar(1) archives
opened with elf_memory(3).
r210352:
Add a cross-reference to `elf_rawfile(3)`.
r210353:
* Remove a superfluous error description.
* Document an additional error that may be returned: `ELF_E_ARCHIVE`.
r211192:
Add translation support for section type SHT_SUNW_dof.
r210344:
Avoid switching between "unsigned char" and "char" in the C code
generated from "libelf_convert.m4".
r210345:
* Deprecate `elf_getshnum()`, `elf_getphnum()` and `elf_getshstrndx()` in
favour of `elf_getshdrnum()`, `elf_getphdrnum()` and `elf_getshdrstrndx()`
respectively.
* Add new manual pages for `elf_getshdrstrndx()`, `elf_getphdrnum()` and
`elf_getshdrnum()`.
* Add a deprecation warning for `elf_getshstrndx()`, `elf_getphnum()` and
`elf_getshnum()`.
r210348:
Move helper functions `_libelf_ar_get_{name,number,string}()` and
`_libelf_ar_open()` to a new compilation unit "libelf_ar_util.c"
to break the circular dependency between "elf_memory.o" and
"libelf_ar.o".
r210325:
Bug fix: when updating headers using the gelf_update_*() functions,
the appropriate `dirty' bit needs to be set for both the Elf32 and
Elf64 case.
r210326:
Improve compatibility with other implementations of the ELF(3) API:
when an output file has no program headers, set the 'e_phentsize'
field of the ELF executable header to zero.
r210328:
Bug fix: permit the creation of zero-sized sections.
r210324:
- Correctly handle sections of type SHT_NOBITS. For these sections:
- elf_getdata() and elf_rawdata() should return an "Elf_Data" structure
that has its "d_buf" member set to NULL and "d_size" member set to
the nominal 'size' of the section.
- Update the manual page for these functions.
- Fix a memory leak in an error handling path inside elf_getdata().
- Use _libelf_allocate_data() in elf_newdata() for consistency.
r210438: (np)
Catch up with r210324. d_buf will be NULL for SHT_NOBITS sections, do not
attempt to copy from it in that case.
MFC r211922:
Add Intel Cougar Point PCH SATA Controller DeviceIDs. Correct some existing
entries for Intel Ibex Peak (5 Series/3400 Series) PCH SATA controllers.
MFC r211920:
Add Intel Cougar Point PCH SATA Controller DeviceIDs. Correct some existing
entries for Intel Ibex Peak (5 Series/3400 Series) PCH SATA controllers.
MFC r209652: sh: Remove comment that the comma operator is missing
in arithmetic expansion.
The comma operator is not listed in POSIX.1-2008 XCU 1.1.2.1 Arithmetic
Precision and Operations (referenced by XCU 2.6.4 Arithmetic Expansion) and
is therefore not required.
- Fix compilation of the subr_unit.c user space test program.
- Use %zu for size_t in a few format strings.
- Correct a comment typo.
- Assert that low and high are >= 0 in new_unrhdr().
MFC r211800:
- Change the threshold from 'running next scrub the <value+1>th day after the
last one' to 'running next scrub the <value>th day after the last one'.
- Improve wording.
yongari [Tue, 31 Aug 2010 00:15:20 +0000 (00:15 +0000)]
MFC r211648:
It seems some newer RTL8139 controllers provides only memory space
register mapping. I'm not sure whether it comes from the fact that
controllers live behind certain PCI brdge(PLX PCI 6152 33BC) and
the bridge has some issues in handling I/O space register mapping.
Unfortunately it's not possible to narrow down to an exact
controller that shows this issue because RealTek used the same PCI
device/revision id again. In theory, it's possible to check parent
PCI bridge device and change rl(4) to use memory space register
mapping if the parent PCI bridge is PLX PCI 6152. But I didn't try
to do that and we wouldn't get much benefit with added complexity.
Blindly switching to use memory space register mapping for rl(4)
may make most old controllers not to work. At least, I don't want
to take potential risk from such change. So use I/O space register
mapping by default but give users chance to override it via a
tunable. The tunable to use memory space register mapping would be
given by adding the following line to /boot/loader.conf file.
dev.rl.%d.prefer_iomap="0"
This change makes P811B quad-port work with this tunable.
yongari [Mon, 30 Aug 2010 21:15:40 +0000 (21:15 +0000)]
MFC r211105:
Add support for Atheros AR8151/AR8152 PCIe gigabit/fast ethernet
controller. These controllers are known as L1D(AR8151) and
L2CB/B2(AR8152). This change adds supports for the following
controllers.
o AR8151 v1.0(L1D) gigabit ethernet controller
o AR8151 v2.0(L1D) gigabit ethernet controller
o AR8152 v1.1(L2CB) fast ethernet controller
o AR8152 v2.0(L2CB2) fast ethernet controller
These controllers have the same feature of AR8131/AR8132 and
support improved power saving control. The user visible change at
this moment is reduced jumbo frame size from 9KB to 6KB. Many
thanks to Atheros for continuing to support FreeBSD.
yongari [Mon, 30 Aug 2010 21:07:26 +0000 (21:07 +0000)]
MFC r211047-211048,211051-211053,211285:
r211047:
Controller does not seem to support more than 1024 bytes DMA burst.
Limit DMA burst size to be less than or equal to 1024 bytes.
r211048:
Do not touch CMB TX threshold register when CMB is not used.
Note, alc(4) does not use CMB at all due to silicon bug.
r211051:
Always disable ASPM L0s and enable L1 before entering into WOL
suspend state. Also disable master clock after PHY power down,
this is supposed to save more power. The master clock should be
enabled if WOL is active.
r211052:
Remove unnecessary assignment.
r211053:
Cache PCIY_PMG and PCIY_EXPRESS capability pointer to softc and use
it instead of calling pci_find_extcap().
r211285:
Make sure to disable RX MAC in alc_stop_mac(). Previously there
was a logic error which it always enabled RX MAC.
yongari [Mon, 30 Aug 2010 20:49:51 +0000 (20:49 +0000)]
MFC r210904:
Reduce Tx interrupt moderation timer from 50ms to 1ms. The default
value resulted in poor performance for UDP packets. With this
change, UDP bulk transfer performance is more than 940Mbps.
jkim [Mon, 30 Aug 2010 17:34:59 +0000 (17:34 +0000)]
MFC: r211823
Check opcode for short jump as well. Some option ROMs do short jumps
(e.g., some NVIDIA video cards) and we were not able to do POST while
resuming because we only honored long jump.