the jail(8) command. [10:04]
Fix a one-NUL-byte buffer overflow in libopie. [10:05]
Correctly sanity-check a buffer length in nfs mount. [10:06]
Approved by: so (cperciva)
Approved by: re (kensmith)
Security: FreeBSD-SA-10:04.jail
Security: FreeBSD-SA-10:05.opie
Security: FreeBSD-SA-10:06.nfsclient
protocol flaw. [09:15]
Correctly handle failures from unsetenv resulting from a corrupt
environment in rtld-elf. [09:16]
Fix permissions in freebsd-update in order to prevent leakage of
sensitive files. [09:17]
Approved by: so (cperciva)
Security: FreeBSD-SA-09:15.ssl
Security: FreeBSD-SA-09:16.rtld
Security: FreeBSD-SA-09:17.freebsd-udpate
MFS r191867: Correctly set IP packet length for TSO in fxp(4). [EN-09:03]
MFS r191767: Fix a lock order reversal bug that could cause deadlock during
fork(2). [EN-09:04]
Submitted by: re (kensmith)
Approved by: so (cperciva)
Errata: FreeBSD-SA-09:02.bce
Errata: FreeBSD-SA-09:03.fxp
Errata: FreeBSD-SA-09:04.fork
DDB show mount added,
sparc64 US III support,
DRM r600/r700,
ae(4) WoL support,
hardware MAC stats: cxgb(4), msk(4), nfe(4),
re(4) hw.re.prefer_iomap,
sis(4) VLAN tagging bugfix,
txp(4) update,
TCP MD5 signature option for IPv6,
gpart(8) updated; APM and EBR scheme support,
mpt(4) in GENERIC on sparc64,
vfs.nfs.prime_access_cache for NFSv3,
ncal(1) multibyte support,
csup CVSMode support,
du(1) -A and -B option added,
makefs(8) added, and
mergemaster(8) -F option added.
Approved by: re (implicit)
type of shm_segsz in struct shmid_ds to size_t from int,
AltiVec support on powerpc,
INTx disabled when MSI/MSIX enabled,
sysctl leaf node now has an MPSAFE flag,
hw.drm.msi tunable added,
ale(4) in GENERIC on amd64 and i386,
ata-raid(4) initial support for DDF metadata,
cam(4) kern.cam.cd.retry_count sysctl,
ciss(4) max device openings count fix,
btpand(8) for NAP, GN, PANU profiles of bluetooth added, and
improve description of the fetch(1) If-Modified-Since support.
Approved by: re (implicit)
jail improvements: IPv4, IPv6, no address support, SCTP fix,
cpuset(1) support, ddb show jails, version number bump,
KTR_CALLOUT new tracepoint added,
Superpages on amd64 and i386,
acpu_asus(4) Asus A8Sr support added,
axe(4) reduced csw for better performance,
fxp(4) improvements including checksum offload, TSO, WoL, and VLAN,
msk(4) hang up issue due to misalignment workaround,
mxge(4) newer hardware support and media types,
re(4) better miibus interaction support,
rl(4) better miibus interaction support and fixes for >4GB system,
IPv4 source address selection,
tap(4) TAPGIFNAME ioctl added,
unix(4) MPSAFE,
sdhci(4) kernel dump support,
EA semantics of [am]time update changed,
atacontrol(8) minor nits fixed,
dirname(1) multiple arguments support,
dumpfs(8) -f flag added,
fsck(8) s/-C/-D/,
ln(1) -w flag added,
netstat(1) unix sockets stats in -L flag,
pciconf(8) -b flag added, and
stat(1) octal s[gu]id in -x flag.
Approved by: re (implicit)
FREEBSD32 syscall translation layer now supports
addition/removal of syscall from kernel module,
VFS_AIO syscalls added to FREEBSD32,
ktr(4) new tracepoint for callout added,
cpufreq(4) hw.est.msr_info added,
kern.timecounter.invariant_tsc for i386 and amd64 added,
vfs.lookup_shared improvement and removal of LOOKUP_SHARED option, and
netstat(1) -ss for icmp6 section fixed.
Approved by: re (implicit)
amd64 KVA space to 6GB,
variable reference in loader(8) script fixed,
debug.batt.batt_sleep_ms added,
snd_au88x0(4) removed,
typo in igb(4) hw.igb.ave_latency fixed,
gvinum plex access permission issue fixed,
du(1) -l flag added,
"netstat -m -N foo" issue fixed, and
wc(1) -L flag added.
Approved by: re (implicit)
Sync the sparc64 hardware notes with reality, mainly regarding support
of sun4u-machines based on USIII and beyond in 7.2-RELEASE.
Approved by: re (blackend)
In sysctl_ifdata(), query the ifnet pointer using the index only
once, rather than querying it, validating it, and then re-querying
it without validating it. This may avoid a NULL pointer
dereference and resulting kernel page fault if an interface is
being deleted while bsnmp or other tools are querying data on the
interface.
The full fix, to properly refcount the interface for the duration
of the sysctl, is in 8.x, but is considered too high-risk for
7.2, so instead will appear in 7.3 (if all goes well).
Reported by: mdtancsa
Approved by: re (kensmith)
Don't try to setup interrupts for drivers that don't support them.
This causes sis and probably a couple of other driver to panic and fail.
Tested by: cpghost <[email protected]>
Approved by: re (kib)
Sanity-check string lengths in order to stop OpenSSL crashing
when printing corrupt BMPString or UniversalString objects. [09:08]
Security: FreeBSD-SA-09:07.libc
Security: FreeBSD-SA-09:08.openssl
Security: CVE-2009-0590
Approved by: re (kensmith)
Approved by: so (cperciva)
Back out r186308 (r191014 in stable/7):
In case of AF_LINK, which the kernel still returns for an RTAX_GATEWAY
as an empty sockaddr_dl in the classic tun<n> case:
copying the address into the message payload, but not the RTA_GATEWAY
flag results in rt_xaddrs() in the kernel tripping over that and parsing
the next attribute set with a flag, i.e. RTA_NETMASK, with the gateway
address, resulting in bogus route entry.
Approved by: re (kensmith)
For reasons of stack alignment, it does not appear that this is exploitable
on any systems FreeBSD runs on, so this will not be getting a security
advisory.
Approved by: re (kib)
Prevent atkbd(4) interrupt handler from calling keyboard callback function
when polled mode is enabled. This should help with duplicated/missing
characters problem at mountroot, geli, etc. prompts on multi CPU systems
while kbdmux(4) is enabled.
Tested by: Tobias Grosser <grosser -at- fim -dot- uni-passau -dot- de>
Tested by: Fabian Keil <freebsd-listen -at- fabiankeil -dot- de>
Approved by: re (kib)
- Remove the second license as I'm also fine with the first one.
- Remove redundant softc members for RIDs.
- Change some softc members to be unsigned where more appropriate.
- Add some missing const.
- Remove support for mmap(2)'ing VGA I/O as it was broken [1] and
not required by X.Org anyway.
- Fix some confusion between bus, physical and virtual addresses
which mostly consisted in using members of struct video_adapter
inappropriately but wasn't fatal except for the regular framebuffer
mmap(2)'ing.
- Remove redundant bzero(9)'ing of the softc.
- Don't map the framebuffer twice in case the firmware has already
mapped it as besides wasting resources this isn't possible with
all MMUs. This is a bit tricky as a) just because the firmware
provides a property with a virtual address doesn't mean it's
actually mapped (but typically is when the framebuffer is the
console) and b) the firmware doesn't necessarily map it with
the same byteorder as we do. This makes machfb(4) work on machines
with cheetah-class MMUs (including X.Org).
Reported by: Michael Plass [1]
Approved by: re (kib)
More fallout from negative dotdot caching. Negative entries should
be removed from and reinserted to proper ncneg list.
Reported by: pho
Submitted by: kib
Approved by: re (kib)
Fix KBI breakage by r190520 which affects older linux.ko binaries:
1) Move the new field (brand_note) to the end of the Brandinfo structure.
2) Add a new flag BI_BRAND_NOTE that indicates that the brand_note pointer
is valid.
3) Use the brand_note field if the flag BI_BRAND_NOTE is set and as old
modules won't have the flag set, so the new field brand_note would be
ignored.
Suggested by: jhb
Reviewed by: jhb
Approved by: re (Ken Smith), kib (mentor)
Defer setting either PG_CACHED or PG_FREE until after the free page
queues lock is acquired. Otherwise, the state of a reservation's
pages' flags and its population count can be inconsistent. That could
result in a page being freed twice.
(This change should have been included in the MFC of the superpages
support.)
Thanks to: pho for an illuminating crash
Approved by: re (kib)
This fixes some problems at boot for some that are happening in fairly
rare cases. It's just a hack, though, which is why it's only going into
stable/7 for now. Note that this hack has a side effect of possibly not
scanning the AMR buses for /dev/passN devices at boot. These devices are
not required for access to the RAID arrays, and only a few tools use them.
If this affects you, let me know.
Approved by: re
Fix a bug in the recent update to the Chelsio driver.
The tick routine was not being restarted in the init_locked routine
which could resulted in loss of carrier when updating the MTU.
Approved by: re (kensmith)
Obtained from: Chelsio Inc.
than planned but coordinated with and approved by RE.
Most important reason for this was so that FreeBSD 7.2
will have native support for the 82599 controller which
is part of the Nehalem launch.
The driver now does pluggable optics, multispeed fiber,
and header split. I am adding this to the GENERIC kernel
only in the amd64 architecture since its where I expect
most use and others were untested.
Enjoy!
Approved by: re
Remove interfaces from interface groups on detach.
Reported by: various
Submitted by: Mikolaj Golub (r190895)
PR: kern/130977, kern/131310
Approved by: re (gnn)
The ppp application relies on the if_tun interface to properly
install a ptp host route between the end points. The ppp module
upates this router based on user configuration later on. The
rt_Update() seems to always set the RTF_GATEWAY flag, which is
broken.
PR: bin/130159
Approved by: re (kensmith)
Fix recognition of kernel-mode traps that pass through the KDB trap handler
but do not actually invoke KDB. This includes recoverable machine checks
encountered in kernel mode.
This patch causes machines with Grackle host-PCI bridges to be able to
correctly enumerate them again.
Reviewed by: marcel
Approved by: re
When writing out updated pollfd records when returning from
poll(), only copy out the revents field, not the whole pollfd
structure. Otherwise, if the events field is updated
concurrently by another thread, that update may be lost.
This issue apparently causes problems for the JDK on FreeBSD,
which expects the Linux behavior of not updating all fields
(somewhat oddly, Solaris does not implement the required
behavior, but presumably our adaptation of the JDK is based
on the Linux port?).
MFC after: 2 weeks
PR: kern/130924
Submitted by: Kurt Miller <kurt @ intricatesoftware.com>
Discussed with: kib
Approved by: re (kib)
- Jordan went into DST in the last Thursday in March instead of the
last Friday in March.
- Palestine has extended the DST time with one week before and one
month after.
Approved by: re (kip)
- Morocco will observe DST from 2009-06-01 00:00 to 2009-08-21 00:00
- Tunisia will not observe DST this year.
- Syria will start DST on 2009-03-27 00:00 this year
- the Province of San Luis will go to utc-04:00
Approved by: re (kib)
Fix logic in MOD_LOAD handler to call dcons_attach after all successful
dcons_drv_init invocations. Testing return value for 0 does not work for
cases where dcons_drv_init was called already as part of low level
onsole initialization.
Approved by: re(kib)
Replace v_dd vnode pointer with v_cache_dd pointer to struct namecache
in directory vnodes. Allow namecache dotdot entry to be created pointing
from child vnode to parent vnode if no existing links in opposite
direction exist. Use direct link from parent to child for dotdot lookups
otherwise.
This restores more efficient dotdot caching in NFS filesystems which
was lost when vnodes stoppped being type stable.
Majority of backporting work for this was done by jhb.
Reviewed by: jhb, kib
Approved by: re (kib)
- getaddrinfo(3) should accept numeric when ai_socktype is not
specified in hint or hints is NULL.
- Add support for SCTP to getaddrinfo(3).
Now, getaddrinfo(3) returns two SOCK_STREAMs, IPPROTO_TCP and
IPPROTO_SCTP. It confuses some programs. If getaddrinfo(3) returns
IPPROTO_SCTP when SOCK_STREAM is specified by hints.ai_socktype, at
least Apache doesn't work. So, I made getaddrinfo(3) to return
IPPROTO_SCTP with SOCK_STREAM only when IPPROTO_SCTP is specified
explicitly by hints.ai_protocol.
- Query DNS only once per an address family.
Approved by: re (kib)
Change vfs_busy to wait until an outcome of pending unmount
operation is known and to retry or fail accordingly to that
outcome. This fixes the problem with namespace traversing
programs failing with random ENOENT errors if someone just
happened to try to unmount that same filesystem at the same
time.
Prodded by: dhw, obrien
Approved by: re(kib)
Sponsored by: Juniper Networks, Inc.
Update driver to vendor 1.16 plus some local changes to maintain our old
tweaks/behavor and to fix a bug with multiple cards.
Approved by: re (kensmith)
r186211:
Remove obsolete AT_DEBUG stuff. It never should have been committed
in the first place, let alone migrated to linux emulation.
r189362:
Add AT_PLATFORM, AT_HWCAP and AT_CLKTCK auxiliary vector entries which
are used by glibc. This silents the message "2.4+ kernel w/o ELF notes?"
from some programs at start, among them are top and pkill.
Do the assignment of the vector entries in elf_linux_fixup()
as it is done in glibc.
Fix some minor style issues.
Approved by: re (Ken Smith), kib(mentor)
With the right comparison we get a proper wscale value and thus
more adequate TCP performance with IPv6.
Changes for IPv4, r166403 and r172795, both ignored the
IPv6 counterpart and left it in the state of art of year 2000.
The same logic in syncache already shares code between v4 and v6 so
things do not need to be adapted there.
Reported by: Steinar Haug (sthaug nethelp.no)
Tested by: Steinar Haug (sthaug nethelp.no)
Approved by: re (kib)
be used to reference UFS-carrying devices by the unique file system id.
An example of this new label is: /dev/ufsid/48e69c8b5c8e1b43.
The benefit of using GEOM labels in general is to avoid problems of
device renaming when shifting drives or controllers.
Reviewed by: pjd
Approved by: re (kib)
Approved by: gnn (mentor) (original)
- Add ipfw_nat to the list of required modules if "firewall_nat_enable"
is set and "natd_enable" is NOT set;
- Accept and pass firewall type to the external firewall script.
Submitted by: Yuri Kurenkov < y -dot- kurenkov -at- init -dot- ru >
No response from: freebsd-rc
Approved by: re (kib)
- Add missing include.
- Style: size_t can't be negative.
- Don't exit with a zero status code when no jails are configured
on a system.
- Style: simplify some code constructs.
- If a single jail cannot be found, let the caller print a proper
diagnostic message.
Approved by: re (kib)
Make it possible to use gjournal for the root filesystem. Previously,
an unclean shutdown would make it impossible to mount rootfs at boot.
Approved by: re (kib)
- Add proper error checking and printing to the CVSMode code when reading and
writing from/to streams, as leaving them out stops csup from cleaning up on
SIGINT and friends properly.
Approved by: re (kib)
Check for device_set_devclass() errors and skip driver probe/attach if any.
Attach called without devclass set crashes the system.
On attach/resume some ATA drivers sometimes trying to create duplicate adX
device. It is surely their own problem, but it is not a reason to crash here.
Approved by: re (kib)
fix a bug of uses after free.
Pointed by: dchagin
MFC r190544:
handles more exceptional cases when the driver failed to attach.
MFC r190550:
corrects a error message.
MFC r190590:
fix a bug that it passed a incorrect flag BUS_DMA_ALLOCNOW to create
a device specific DMA tag. On amd64 it could exhaust all of bounce
pages when bus_dma_tag_create(9) is called at malo_pci_attach() then
as result in next turn it returns ENOMEM. This fix a attach fail on
amd64.
Pointed by: yongari
Tested by: dchagin
Approved by: re (kib)
It seems that RTL8168D and RTL8102EL requires additional settle
time to complete RL_PHYAR register write. Accessing RL_PHYAR
register right after the write causes errors for subsequent PHY
register accesses.
Tested by: george at luckytele dot com,
Steve Wills < STEVE at stevenwills dot com >
Approved by: re (Kostik Belousov)
We don't know what these pages are going to be used for, they should be
un-cached. This got lost somewhere with all the bus_dma fixups.
Approved by: re (kib)
Fix up the flags to bus_dmamem again. The man page incorrectly showed
the BUS_DMA_NOCACHE flags as being a valid flag for load instead of alloc.
Approved by: re (kib)
Document the "-o large" option.
PR: 129792
And r186768:
Add missing qualifier which was missed in the previous commit.
Noticed by: brooks
Approved by: re (kib)
- Add several HP OEM parts' PCI IDs (187133+187317)
- Remove intermediate variable busaddr and have bus_* operate
directly on softc members upon initialization. (187204)
- Only enable split header operation when ZERO_COPY_SOCKETS is
enabled in the kernel. (189117)
- Updated firmware to latest 4.6.X release. (189325)
- Added missing firmware for 5709 A1 controllers. (189325)
- Changed some debug statistic variable names to be more
consistent. (189325)
Approved by: re (kensmith)
to prevent individual transactions from crossing a 4GB address boundary.
Due to bus_size_t type limitations, the driver uses a 2GB boundary in PAE
kernels.
Approved by: re (kensmith)
and into acpi_cpu_startup() which is where all the other code to update this
global variable lives. This fixes a bug where cpu_cx_count was not updated
correctly if acpi_cpu_generic_cx_probe() returned early.
Approved by: re (kensmith)
Remove unreachable code for generating RST segments from tcp_twcheck();
this code became stale when T/TCP support was removed.
Discussed with: bz, sam
Approved by: re (kensmith)
Fixup relative pointers after channel realloc. It fixes crash on systems
with several HDA codecs per controller.
While I am there, remove some unneeded dereferences.
MFCed earlier than it should be so that it can be part of 7.2-BETA1.
PR: kern/131785
Submitted by: Tor Egge <[email protected]>
Approved by: re (kensmith)
r189771:
Implement new way of branding ELF binaries by looking to a
".note.ABI-tag" section.
The search order of a brand is changed, now first of all the
".note.ABI-tag" is looked through.
Move code which fetch osreldate for ELF binary to check_note() handler.
r189919:
Use the properly sized types for ELF object header and program headers.
This fixes osrel fetching from the FreeBSD branding note for the 64bit
platforms (bug introduced by r189771).
r190264:
Fix several issues with parsing the notes for ELF objects.
Badly formed ELF note may cause the caclulated pointer to the next note
to point both after the note region, that was checked in the code, but
also to point before the region, that was not checked [1]. Remember the
first note location in note0 and leap out if the note is not between
note0 and note_end.
In the similar way, badly formed note may cause infinite loop by
pointing next note into the same or previous note. Guard against this
by
limiting amount of loop iterations by arbitrary choosen big number.
For clarity, check the calculated note alignment in each iteration.
PR: kern/132886
Approved by: re(Ken Smith)
When copying file data to the archive, don't write more
than was read. This seems to have only affected the shar
writer, since other formats proactively truncate output
to the originally-advertised size.
PR: bin/131244
Approved by: re (Ken Smith)
Before this fix, pax would stop the restore sequence for
symlinks after setting the owner. As a result, mode
and timestamp were not restored. This patch corrects the
problem by simply removing the short-circuit for symlinks
and using lchown()/lchmod()/lutimes() always for restoring
metadata.
PR: bin/91316
Submitted by: Jaakko Heinonen
Reviewed by: Joerg Sonnenberger
Approved by: re (Ken Smith)
to a significant performance improvement for multi-threaded UDP socket
receive, such as found in BIND, memcached, VoIP applications, etc.
Requested by: Florian Smeets <flo at kasimir.com>
Approved by: re (kib)
- Ensure that INTx isn't disabled, as these chips apparently have a
quirk requiring it to be enabled even when using MSI. This makes
the latter work again after r189568.
- Remove a comment which no longer applies since r190335.
Approved by: re (kib)
The non-modifying EA VOPs are executed with only shared vnode lock taken.
Provide a custom lock around initializing and tearing down EA area,
to prevent both memory leaks and double-free of it. Count the number
of EA area accessors.
Put the new field i_ea_refs to the end of the struct inode to keep
structure layout stable on releng branch for the benefit of lsof.
MFC r190469:
Correct typo.
ABI issue pointed out by: kensmith
Approved by: re (kensmith)
Remove now-unused INP_UNMAPPABLEOPTS.
Discussd with: bz
r189637:
Avoid use of IPv6 macro aliases to inpcb fields and inp_flags; we don't
remove their defintions as some third-party tools may use them (such as
net-snmp), unlike in the 8.x change.
References to in6p_lport and in6_fport in sockstat are also replaced with
normal inp_lport and inp_fport references.
Reviewed by: bz
r189848:
Correct a number of evolved problems with inp_vflag and inp_flags:
certain flags that should have been in inp_flags ended up in inp_vflag,
meaning that they were inconsistently locked, and in one case,
interpreted. Move the following flags from inp_vflag to gaps in the
inp_flags space (and clean up the inp_flags constants to make gaps
more obvious to future takers):
INP_TIMEWAIT
INP_SOCKREF
INP_ONESBCAST
INP_DROPPED
Some aspects of this change have no effect on kernel ABI at all, as these
are UDP/TCP/IP-internal uses; however, netstat and sockstat detect
INP_TIMEWAIT when listing TCP sockets, so any MFC will need to take this
into account.
MFC after: 1 week (or after dependencies are MFC'd)
Reviewed by: bz
Note that this change requires netstat, systat, and sockstat to be
recompiled in order to properly print TIMEWAIT connection state; this
minor API change (documented in UPDATING) is considered worth it in
order to fix the above bugs. This change fixes the INP_ONESBCAST bug
describted in kern/124282 by disambiguating flag use.
Approved by: re (kib)
PR: kern/124282
r189637 discussed with: pav
Add INP_INHASHLIST flag for inpcb->inp_flags to indicate whether
or not the inpcb is currenty on various hash lookup lists, rather
than using (lport != 0) to detect this. This means that the full
4-tuple of a connection can be retained after close, which should
lead to more sensible netstat output in the window between TCP
close and socket close.
Approved by: re (kib)
Update a comment which to my reading had been misplaced in rev. 1.12
already (but probably had been way above as the code was there twice)
and describe what was last changed in rev. 1.199 there (which now is
in sync with in6_src.c r184096(HEAD), r189956(stable/7)).
Approved by: re (rwatson)
amd64 and i386. This fixes a bug were 32-bit binaries would run with a
different floating point exception mask under FreeBSD/amd64 vs FreeBSD/i386.
This commit also includes a few other minor changes to keep the code in
sync with 8.
Approved by: re (kib)
Handle nForce MCP67 and MCP73 SATA controllers as AHCI. They report
itself as ATA RAID, but generic ATAPCI driver unable to detect drives
there. AHCI driver reported to handle them fine. Linux does the same.
Submitted by: Andrey V. Elsukov on stable@
PR: kern/125713
Approved by: re (kib)
from HEAD.
Since libkse is still built on RELENG_7, pthread_cleanup_push/pop
are left as the functions, but the support code in libthr is present for
the macro versions.
Malloc in RELENG_7 does not require thread exit hook, but I decided
to add empty handler for it, instead of removing callback from thr_exit().
No mergeinfo since this change is prepared by patching libthr and then
bringing in required missed bits.
Requested by: bms
Reviewed by: davidxu
Tested by: bms, Mykola Dzham <i levsha org ua>
Approved by: re (kensmith)
the src level.
(turns out svn+ssh://[email protected]/base/head and
svn+ssh://svn.freebsd.org/base/stable/7 are seen as two totally different
repositories... Jeez subversion can be dumb...)
burncd during operation. Add signal handling by doing a CDRIOCFLUSH ioctl
to attempt to leave burner in a sane state when burning is interrupted with
SIGHUP, SIGINT, SIGTERM, or in case an I/O error occurs during write.
r189397: Add a -o mountprog parameter to mount which explicitly allows an
alternative program to be used for mounting a file system.
r187035/r187093/r187130: Don't overflow buffers when processing -o options.
r173412: Cleanup of userland __P use.
r187943: Run with -B and just .POSIX.
r173067: Include <stdlib.h> for the right prototype for exit(3).
r173065: Set the program name if the crunched program is selected
through argv[1] to mimic crt0 behaviour.
r187475: Remove inlining of functions that are used mostly in different
object files. This lets use to remove NO_WERROR.
r186558: Consistently use Var_SetGlobal().
r186713: Add the -Q be-quiet flag for parallel jobs.
r186279: Exit with error code 2 when run with -k (continue if errors)
and build failed.
r186559: Add the ability to tweak the token output before targets in job mode.
r181021: Add POSIX -p flag to make(1).
r186502: Clarify the behaviour of conditionals when dealing with comparisons.
- In bge_ifmedia_upd_locked() take advantrage of LIST_FOREACH().
- If boot verbose, print asicrev, chiprev and bus type on attach.
- For PCI Express devices:
1) Adjust max read request size to 4Kbytes
2) Turn on FIFO_LONG_BURST in RDMA during bge_blockinit()
Though 1) does not seem to have much to do with the poor TX performance
observed on PCI Express bge(4), 2) does fix the problem. [1]
- Nuke the RX CPU self-diag, which prevents working cards from working
(Linux tg3 does not have this diag neither does OpenBSD's bge(4)).
The increasing of the firmware handshaking timeout to 20000 retries
done as part of the original commit isn't merged as way already have a
way higher BGE_TIMEOUT of 100000.
PR: 119361 [1]
Obtained from: tg3 via DragonflyBSD [1], DragonflyBSD
r189864:
Default to AF_LOCAL instead of AF_INET sockets for non-family-specific
operations. This allows the query operations to work in non-IPv4 jails,
and will be necessary in a future of possible non-INET networking.
(reprise r189970)
r190151:
Call the interface's if_ioctl from ifioctl(), if the protocol didn't
handle the ioctl. There are other paths that already call it, but this
allows for a non-interface socket (like AF_LOCAL which ifconfig now
uses) to use a broader class of interface ioctls.
Approved by: bz (mentor)
to fit more digits.
MFC r183665: batch mode.
MFC r189738: fix man page sinopsys; remove BUG section.
MFC r189739: turn the batch mode on if stdout is not tty.
r187524:
Latest bulletin C from Daniel GAMBIS: no leap at the end of june 2009.
r188436:
MFV of tzdata2009b.
- Updated leapseconds
r189923:
MFV of tzdata2009c
- Cuba has DST again.
Add the SIOCSIFMTU ioctl handling directly to tap(4) permitting it to have
its MTU set higher than 1500 (ETHERMTU). Its new limit is now 65535 as
enforced by ifhwioctl() in if.c
This allows a tap(4) device to be added to a bridge, which requires all
interface members to have the same MTU, with an interface configured for
jumbo frames. QEMU may now connect to a network via tap(4) without
requiring the real interface to have its MTU set to 1500 or lower.
Reviewed by: rpaulo, bms
Merge r189907 from head to stable/7:
Remove the splimp()/splx() calls around the setting of the MTU. They are
no-op's that I inadvertently added. Even if locking is needed in general
for the ioctl's, setting a single long will not need it due to the
operation being atomic.
Reported by: rwatson
Change the PVO zone for fictitious pages to the unmanaged PVO zone, to match
the unmanaged flag set in the PVO attributes. Without doing this,
pmap_remove() could try to remove fictitious pages (like those created
by mmap of physical memory) from the wrong UMA zone, causing a panic.
Reported by: Justin Hibbits
Limit the size of malloced buffer when dumping environment
variables. [EN-09:01]
Approved by: so (cperciva)
Approved by: re (kensmith)
Security: FreeBSD-SA-09:06.ktimer
Errata: FreeBSD-EN-09:01.kenv
that are currently in the process of being passed
between processes as alive and does not
try to garbage collect them.
The full description of the problem and a test
program to reproduce it can be found in PR 112554.
This fix was inspired by similar fixes in NetBSD and BSD/OS.
However, it does not apply to FreeBSD 8 and above -
when this code was rewritten and optimized, the bug
was fixed in a different way. The test program in the
PR passes on 8-current with flying colors.
PR: 112554
Submitted by: Spencer Minear
Reviewed by: Mike Silbersack
Obtained from: Secure Computing Corp
MFC after: 4 weeks
Add a driver for `Schizo' Fireplane/Safari to PCI 2.1 and `Tomatillo'
JBus to PCI 2.2 bridges including subsequent fixes and improvements
as of r190108.
- Set MIIF_NOLOOP and don't add IFM_LOOP as loopback apparently isn't
supported with these pseudo-PHYs. The MIIF_NOLOOP flag currently triggers
nothing but hopefully will be respected by mii_phy_setmedia() later on.
- Don't add IFM_NONE as isolation isn't supported by these pseudo-PHYs.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
- As suggested by OpenSolaris use up-burst-sizes for determining the
supported burst sizes.
- Add support for 64-bit burst sizes (required for SBus GEM).
- Register our interrupt filters with the revived INTR_FAST so
they these interrupts can even interrupt filters of device
drivers as necessary.
- Failing to register as interrupt controller during attach shouldn't
be fatal so just inform about this instead of panicing.
- Take advantage of KOBJMETHOD_END.
- Remove some redundant variables.
- Add missing const.
- Ensure we find no unexpected partner.
- Failing to register as interrupt controller during attach shouldn't
be fatal so just inform about this instead of panicing.
- Disable rerun of the streaming cache as workaround for a silicon bug
of certain Psycho versions.
- Remove the comment regarding lack of newbus'ified bus_dma(9) as being
able to associate a DMA tag with a device would allow to implement
CDMA flushing/syncing in bus_dmamap_sync(9) but that would totally
kill performance. Given that for devices not behind a PCI-PCI bridge
the host-to-PCI bridges also only do CDMA flushing/syncing based on
interrupts there's no additional disadvantage for polling(4) callbacks
in the case schizo(4) has to do the CDMA flushing/syncing but rather a
general problem.
- Don't panic if the power failure, power management or over-temperature
interrupts doesn't exist as these aren't mandatory and not available
with all controllers (not even Psychos). [1]
- Take advantage of KOBJMETHOD_END.
- Remove some redundant variables.
- Add missing const.
PR: 131371 [1]
- There's no need to wrap kdb_active and kdb_trap() in #ifdef KDB as
they're always available.
- Remove unused variable. [1]
- Add a missing const.
- Sort includes.
Submitted by: Christoph Mallon [1]
- Failing to register as interrupt controller during attach shouldn't
be fatal so just inform about this instead of panicing.
- Sort device methods.
- Take advantage of KOBJMETHOD_END.
- Remove some redundant variables.
o Introduce KOBJMETHOD_END for the end of the kobj list.
o Fix a minor indentation problem.
o Put in the extra-strict KOBJMETHOD define, but commented out since
the tree isn't yet ready.
Reviewed by: (1) was posted to arch@ without objection (and 1 go for it)
Optimize free_pv_entry(); specifically, avoid repeated TAILQ_REMOVE()s.
Update the pmap's resident page count when a page table page is freed in
pmap_remove_pde() and pmap_remove_pages().
Update stale comments. The alternate address space mapping was eliminated
when PAE support was added to i386. The direct mapping exists on amd64.
This includes changes to ubsa (removing attachment from that device),
and small changes to ucom.
Note: A change to umass reducing the attach priority for it was committed
already.
- Newer firmware versions no longer provide SUNW,stop-self so just
disable interrupts and loop forever instead. We still could use
SUNW,stop-self if implemented but acording to comments in OpenBSD,
E{2,4}50 tend to have fragile firmware versions which wedge when
using the OFW test service, so given that we don't really depend
on SUNW,stop-self just nuke it altogether instead of risking
problems.
- Hide all MP-related bits in <machine/smp.h> underneath #ifdef SMP.
- Inline ipi_all_but_self(9) and ipi_selected(9). We don't expose any
additional bits but save a few cycles by doing so.
- Remove ipi_all(9), which actually only called panic(9). It can't be
implemented natively anyway and having it removed at least causes
MI users to already fail when linking.
- At least Fire V880 have a small hardware glitch which causes the
reception of IDR_NACKs for CPUs we actually haven't tried to send
an IPI to, even not as part of the initial try. According to tests
this apparently can be safely ignored though, so just return if
checking for the individual IDR_NACKs indicates no outstanding
dispatch. Serializing the sending of IPIs between MD and MI code
by the combined usage of smp_ipi_mtx makes no difference to this
phenomenon. [1]
- Provide relevant debugging bits already with the initial panic
in case of problems with the IPI dispatch, which would have
allowed to diagnose the above problem without a specially built
kernel.
- In case of cheetah_ipi_selected() base the delay we wait for
other CPUs which also might want to dispatch IPIs on the total
amount of CPUs instead of just the number of CPUs we let this
CPU send IPIs to because in the worst case all CPUs also want
to IPI us at the same time.
- There's no need to wrap kdb_active in #ifdef KDB as it's always
available.
Reported and access for extensive tests provided by: beat [1]
Add drivers for the power management devices found on Fireplane/
Safari- and JBus-based machines. Currently the main purpose of
these drivers is debugging of the resource allocation on nexus(4)
and the register content of these devices though.
Don't disable CR-to-NL translation when waiting for data to arrive.
A difference between the old and the new TTY layer is that the new
implementation does not perform any post-processing before returning
data back to userspace when calling read().
sh(1)'s read turns the TTY into a raw mode before calling select(). This
means that the first character will not receive any ICRNL processing.
Inherit this flag from the original terminal attributes.
Even though this issue is not present on RELENG_*, I'm MFCing it to make
sh(1) in jails behave better.
PR: bin/129566
bus_dma(9) conversion and make txp(4) work on all architectures.
o Header file cleanup.
o bus_dma(9) conversion.
- Removed all consumers of vtophys(9) and converted to use
bus_dma(9).
- Typhoon2 functional specification says the controller supports
64bit DMA addressing. However all Typhoon controllers are known
to lack of DAC support so 64bit DMA support was disabled.
- The hardware can't handle more 16 fragmented Tx DMA segments so
teach txp(4) to collapse these segments to be less than 16.
- Added Rx buffer alignment requirements(4 bytes alignment) and
implemented fixup code to align receive frame. Previously
txp(4) always copied Rx frame to align it on 2 byte boundary
but its copy overhead is much higher than unaligned access on
i386/amd64. Alignment fixup code is now applied only for
strict-alignment architectures. With this change i386 and
amd64 will get instant Rx performance boost. Typhoon2 datasheet
mentions a command that pads arbitrary bytes in Rx buffer but
that command does not work.
- Nuked pointer trick in descriptor ring. This does not work on
sparc64 and replaced it with bcopy. Alternatively txp(4) can
embed a 32 bits index value into the descriptor and compute
real buffer address but it may make code complicated.
- Added endianness support code in various Tx/Rx/command/response
descriptor access. With this change txp(4) should work on all
architectures.
o Added comments for known firmware bugs(Tx checksum offloading,
TSO, VLAN stripping and Rx buffer padding control).
o Prefer faster memory space register access to I/O space access.
Added fall-back mechanism to use alternative I/O space access.
The hardware supports both memory and I/O mapped access. Users
can still force to use old I/O space access by setting
hw.txp.prefer_iomap tunable to 1 in /boot/loader.conf.
o Added experimental suspend/resume methods.
o Nuke error prone Rx buffer handling code and implemented local
buffer management with TAILQ. Be definition the controller can't
pass the last received frame to host if no Rx free buffers are
available to use as head and tail pointer of Rx descriptor ring
can't have the same value. In that case the Rx buffer pointer in
Rx buffer ring still holds a valid buffer and txp_rxbuf_reclaim()
can't fill Rx buffers as the first buffer is still valid. Instead
of relying on the value of Rx buffer ring, introduce local buffer
management code to handle empty buffer situation. This should fix
a long standing bug which completely hangs the controller under
high network load. I could easily trigger the issue by sending 64
bytes UDP frames with netperf. I have no idea how this bugs was
not fixed for a long time.
o Converted ithread interrupt handler to filter based one.
o Rearranged txp_detach routine such that it's now used for general
clean-up routine.
o Show sleep image version on device attach time. This will help
to know what action should be taken depending on sleep image
version. The version information in datasheet was wrong for newer
NV images so I followed Linux which seems to correctly extract
version numbers from response descriptors.
o Firmware image is no longer downloaded in device attach time. Now
it is reloaded whenever if_init is invoked. This is to ensure
correct operation of hardware when something goes wrong.
Previously the controller always run without regard to running
state of firmware. This change will add additional controller
initialization time but it give more robust operation as txp(4)
always start off from a known state. The controller is put into
sleep state until administrator explicitly up the interface.
o As firmware is loaded in if_init handler, it's now possible to
implement real watchdog timeout handler. When watchdog timer is
expired, full-reset the controller and initialize the hardware
again as most other drivers do. While I'm here use our own timer
for watchdog instead of using if_watchdog/if_timer interface.
o Instead of masking specific interrupts with TXP_IMR register,
program TXP_IER register with the interrupts to be raised and
use TXP_IMR to toggle interrupt generation.
o Implemented txp_wait() to wait a specific state of a controller.
o Separate boot related code from txp_download_fw() and name it
txp_boot() to handle boot process.
o Added bus_barrier(9) to host to ARM communication.
o Added endianness to all typhoon command processing. The ARM93C
always expects little-endian format of command/data.
o Removed __STRICT_ALIGNMENT which is not valid on FreeBSD.
__NO_STRICT_ALIGNMENT is provided for that purpose on FreeBSD.
Previously __STRICT_ALIGNMENT was unconditionally defined for
all architectures.
o Rewrote SIOCSIFCAP ioctl handler such that each capability can be
controlled by ifconfig(8). Note, disabling VLAN hardware tagging
has no effect due to the bug of firmware.
o Don't send TXP_CMD_CLEAR_STATISTICS to clear MAC statistics in
txp_tick(). The command is not atomic. Instead, just read the
statistics and reflect saved statistics to the statistics.
dev.txp.%d.stats sysctl node provides detailed MAC statistics.
This also reduces a lot of waste of CPU cycles as processing a
command ring takes a very long time on ARM93C. Note, Rx
multicast and broadcast statistics does not seem to right. It
might be another bug of firmware.
o Implemented link state change handling in txp_tick(). Now sending
packets is allowed only after establishing a valid link. Also
invoke link state change notification whenever its state is
changed so pseudo drivers like lagg(4) that relies on link state
can work with failover or link aggregation without hacks.
if_baudrate is updated to resolved speed so SNMP agents can get
correct bandwidth parameters.
o Overhauled Tx routine such that it now honors number of allowable
DMA segments and checks for 4 free descriptors before trying to
send a frame. A frame may require 4 descriptors(1 frame
descriptor, 1 or more frame descriptors, 1 TSO option descriptor,
one free descriptor to prevent descriptor wrap-around) at least
so it's necessary to check available free descriptors prior to
setting up DMA operation.
o Added a sysctl variable dev.txp.%d.process_limit to control
how many received frames should be served in Rx handler. Valid
ranges are 16 to 128(default 64) in unit of frames.
o Added ALTQ(4) support.
o Added missing IFCAP_VLAN_HWCSUM as txp(4) can offload checksum
calculation as well as VLAN tag insertion/stripping.
o Fixed media header length for VLAN.
o Don't set if_mtu in device attach, it's already set in
ether_ifattach().
o Enabled MWI.
o Fixed module unload panic when bpf listeners are active.
o Rearranged ethernet address programming logic such that it works
on strict-alignment architectures.
o Removed unused member variables in softc.
o Added support for WOL.
o Removed now unused TXP_PCI_LOMEM/TXP_PCI_LOIO.
o Added wakeup command TXP_BOOTCMD_WAKEUP definition.
o Added a new firmware version query command, TXP_CMD_READ_VERSION.
o Removed volatile keyword in softc as bus_dmamap_sync(9) should
take care of this.
o Removed embedded union trick of a structure used to to access
a pointer on LP64 systems.
o Added a few TSO related definitions for struct txp_tcpseg_desc.
However TSO is not used at all due to the limitation of hardware.
o Redefined PKT_MAX_PKTLEN to theoretical maximum size of a frame.
o Switched from bus_space_{read|write}_4 to bus_{read|write}_4.
o Added a new macro TXP_DESC_INC to compute next descriptor index.
Tested by: don.nasco <> gmail dot com
1. Fix creation and saving of the new mtree file with the -D option
2. Clean up usage() and man page so the options are all listed consistently
3. Add -F option
4. More man page cleanups for CVS -> VCS, punctuation, etc.
Add the ability to run /usr/sbin/crashinfo on a new core dump automatically
during boot. Right now this is disabled by default, but it can be enabled
by setting 'crashinfo_enable=YES' in rc.conf.
Another step assimilating IPv[46] PCB code - directly use
the inpcb names rather than the following IPv6 compat macros:
in6pcb, in6p_sp, in6p_ip6_nxt, in6p_flowinfo, in6p_vflag,
in6p_flags, in6p_socket, in6p_lport, in6p_fport, in6p_ppcb and
sotoin6pcb().
Apart from removing duplicate code in netipsec, this is a pure
whitespace, not a functional change.
Replace most INP_CHECK_SOCKAF() uses checking if it is an
IPv6 socket by comparing a constant inp vflag.
This is expected to help to reduce extra locking.
Merge in6_pcbfree() into in_pcbfree() which after the previous
IPsec change in r185366 (r185366 for stable/7) only differed in
two additonal IPv6 lines.
Rather than splattering conditional code everywhere add the v6
check centrally at this single place.
Unify ipsec[46]_delete_pcbpolicy in ipsec_delete_pcbpolicy.
Ignoring different names because of macros (in6pcb, in6p_sp) and
inp vs. in6p variable name both functions were entirely identical.
s/succeded/succeeded/ in comments.
Fix spelling in message.
Remove CD input hack for ALC268 based Acer systems. Latest systems does not
implement CD input in hardware, while unconditional showing it confuse users.
Also it was made in the way that sometimes improper with present driver.
Add patch for ALC268 based Acer TM5320 to make headphones jack sensing work.
Default configuration defines two separate playback associations, which
current driver unable to trace properly due to order they are defined and
limited codec uniformity.
To avoid one doubtless netgraph SMP scalability limitation point, switch
node queues processing from single swi:net thread to several specialized
threads.
not nfs_getattr() will use an ACCESS RPC to prime the access cache instead
of a simple GETATTR RPC. The sysctl defaults to enabled to maintain the
previous behavior.
- Make it possible to disable GPT support by setting LOADER_NO_GPT_SUPPORT
in make.conf or src.conf.
- When GPT is enabled (which it is by default), use memory above 1 MB and
leave the memory from the end of the bss to the end of the 640k window
purely for the stack. The loader has grown and now it is much more
common for the heap and stack to grow into each other when both are
located in the 640k window.
- device_shutdown returns an int.
- Don't reset the PHY probe retry counter within the loop so
it will eventually terminate as intended. [1]
Submitted by: Helen Zhang [1]
- Currently the PMAP code is laid out to let the kernel TSB cover the
whole KVA space using one locked 4MB dTLB entry per GB of physical
memory. On Cheetah-class machines only the dt16 can hold locked
entries though, which would be completely consumed for the kernel
TSB on machines with >= 16GB. Therefore limit the KVA space to use
no more than half of the lockable dTLB slots, given that we need
them also for other things.
- Add sanity checks which ensure that we don't exhaust the (lockable)
TLB slots.
Don't try reading the SXP_PINS_DIFF on the 10160 and 12160 SCSI
controllers. Reading this register, for which there are indications
that it doesn't really exist, returns 0 on at least some 12160
and doing so on Sun Fire V880 causes a data access error exception.
Reported and tested by: Beat Gaetzi
Approved by: mjacob
Obtained from: OpenBSD (modulo setting isp_lvdmode)
Use the interrupt level right below PIL_FAST for executing interrupt
filters instead of PIL_FAST and allow special filters and handlers
for interrupts which need to be able to interrupt even filters, f.e.
bus error interrupts, to be registered with the revived INTR_FAST
at PIL_FAST.
- Allow the front-end to specify that iommu(4) should disable
rerun of the streaming cache for silicon bug workarounds.
- Announce the presence of a streaming cache on attach for
informational purposes.
- For performance reasons don't do unnecessary flushes of the
streaming cache when coherent mappings are synced.
- Fix some minor style issues.
Use the spitfire VIS block copy/zero functions also with cheetah-
class CPUs. In theory one could also use versions additionally
taking advantage of the prefetch cache with cheetah-class CPUs,
in my worldstone runs these either didn't provide extra speedup
(USIII+) in comparison to the existing spitfire versions or were
even slightly slower (USIIIi) though, so they aren't committed
for now.
The basic problem leading to the VIS-based copy/zero functions
being initially disabled for cheetah-class CPUs was solved by
letting cheetah_init() clear DCR_IFPOE.
Micro-optimize spitfire_block_{copy,zero}():
- Predict the loop as taken as it's more likely that there's still
data to copy and memory to zero respectively.
- Don't waste the delay slot.
Enable mpt(4) as some later models have on-board Fusion-MPT
controllers and it's sufficient endian-clean since r189999.
While at it, remove the commented out ncr(4) as it doesn't
even use bus_dma(9), which isn't worth fixing though as sym(4)
already supports a superset of the controllers driven by ncr(4).
Some of the assembly files depend on v9a/v9b-only instructions so
compile these with -mcpu=ultrasparc (which is the hard-coded default
of our system compiler), which allows the remainder of the kernel to
be compiled with "only" -mcpu=v9 for reference and testing purposes.
Clear any possibly pending PCI error bits left by the firmware. These
could trigger an error interrupt that we can't actually to do anything
against as soon as enabling the error handlers.
While at it don't bother about writing only to the write-one-to-clear
bits when clearing error bits.
Work around Cheetah+ erratum 34 (USIII+ erratum #10) by relocating
the locked entry in it16 slot 0, which typically is occupied by the
PROM, and manually entering locked entries in slots != 0.
Thanks to Hubert Feyrer for donating the Blade 2000 this change was
developed on.
For cheetah-class CPUs ensure that the dt512_0 is set to hold 8k pages
for all three contexts and configure the dt512_1 to hold 4MB pages for
them (e.g. for direct mappings).
This might allow for additional optimization by using the faulting
page sizes provided by AA_DMMU_TAG_ACCESS_EXT for bypassing the page
size walker for the dt512 in the superpage support code.
Submitted by: nwhitehorn (initial patch)
USIII and beyond CPUs have stricter requirements when it comes
to synchronization needed after stores to internal ASIs in order
to make side-effects visible. This mainly requires the MEMBAR #Sync
after such stores to be replaced with a FLUSH. We use KERNBASE in
the kernel and the newly introduced PROMBASE for the loader as the
addresses to FLUSH as these are guaranteed to not trap. Actually,
the USII synchronization rules also already require a FLUSH in
pretty much all of the cases changed.
We're also hitting an additional USIII synchronization rule which
requires stores to AA_IMMU_SFSR to be immediately followed by a DONE,
FLUSH or RETRY. Doing so triggers a RED state exception though so
leave the MEMBAR #Sync. Linux apparently also has gotten away with
doing the same for quite some time now, apart from the fact that
it's not clear to me why we need to clear the valid bit from the
SFSR in the first place.
Reviewed by: nwhitehorn
Recognize et(4), igb(4), ixgbe(4) and nxge(4) devices.
Correct some minor whitespace in the ae(4) entry.
The iwn(4) entry was left out as the driver has not been merged.
Use the PROM provided SUNW,set-trap-table to take over the trap
table. This is required in order to set obp-control-relinquished
within the PROM, allowing to safely read the OFW translations node.
Without this, f.e. a `ofwdump -ap` triggers a fatal reset error or
worse things on machines based on USIII and beyond.
In theory this should allow to remove touching %tba in cpu_setregs(),
in practice we seem to currently face a chicken and egg problem when
doing so however.
The physical address space of cheetah-class CPUs has been extended
to 43 bits so update TD_PA_BITS accordingly. For the most part this
increase is transparent to the existing code except for when reading
the physical address from ASI_{D,I}TLB_DATA_ACCESS_REG, which we
only do in the loader and which was already adjusted in r190002, or
from the OFW translations node.
While at it, ensure we are only taking valid OFW mapping entries
into account.
- USIII-based machines can consist of CPUs running at different
frequencies (and having different cache sizes) so use the STICK
(System TICK) timer, which was introduced due to this and is
driven by the same frequency across all CPUs, instead of the
TICK timer, whose frequency varies with the CPU clock, to drive
hardclock. We use the STICK timers only when absolutely necessary
though as the STICK timers are driven at frequencies as low as
5MHz, resulting in bad granularity compared to the TICK timers.
However, don't employ the workaround for the BlackBird erratum #1
when using the TICK timer on machines with cheetah-class CPUs for
performance reasons.
Note that using the STICK counter also causes a hang with USIIIi
MP machines for reasons unknown, but these can only consist of
identical CPUs anyway.
- Given that we only (try to) synchronize the (S)TICK timers of APs
with the BSP during startup, we could end up spinning forever in
DELAY(9) if that function is migrated to another CPU while we're
spinning due to clock drift afterwards, so pin to the CPU in order
to avoid migration. Unfortunately, pinning doesn't work at the
point DELAY(9) is required by the low-level console drivers, yet,
so switch to a function pointer, which is updated accordingly, for
implementing DELAY(9). For USIII and beyond, this would also allow
to easily use the STICK counter instead of the TICK one here,
there's no benefit in doing so however.
While at it, use cpu_spinwait(9) for spinning in the delay-
functions. This currently is a NOP though.
- Don't set the TICK timer of the BSP to 0 during startup as there's
no need to do so.
- Implement cpu_est_clockrate().
- Unfortunately, USIIIi-based machines don't provide a timecounter
device besides the STICK and TICK counters (well, in theory the
Tomatillo bridges have a performance counter that can be (ab)used
as timecounter by configuring it to count bus cycles, though unlike
the performance counter of Schizo bridges, the Tomatillo one is
broken and counts Sun knows what in this mode). This means that
we've to use a (S)TICK counter for timecounting, which has the old
problem of not being in sync across CPUs, so provide an additional
timecounter function which binds itself to the BSP but has an
adequate low priority.
Switch sun4v to back to using its own clock.c, which was ressurected
in r190005, as the sparc64 version is going to be rototilled and sun4v
currently can't be verified to still work with the new sparc64 one
due to its overall state.
o Add support for multiple attributes.
o Parse the error string returned by the kernel.
o Prefer the start and end attributes over the offset and size attributes.
Add hardware MAC statistics support. Also added some reserved
statistics register definition. Users can get current MAC
statistics from dev.msk.%d.stats sysctl node(%d is unit number of
a device).
Update to latest 3Com firmware image. The latest fimware is
required to make 3CR990 familiy controllers run on NV flash
firmware version 03.001.008.
The latest firmware added HMAC digest information so teach txp(4)
to pass them to sleep image before downloading is started.
While I'm here restore previous IMR/IER register if firmware
downloading have failed.
PR: kern/89876, kern/132047
Receving VLAN oversized frames raise SIS_ISR_RX_ERR interrupt, so
make sis_rxeof() handle that too. Previously it used to receive the
frame and reset controller.
PR: kern/131414
Fix a long standing VLAN tagged frame handling bug.
When VLAN tagged frame is received the hardware sets 'LONG' bit of
Rx status word. It is always set when the size of received frame
exceeded 1518 bytes, including CRC. This VLAN tagged frame clears
'OK' bit of Rx status word such that driver should not rely on 'OK'
bit of Rx status word to pass the VLAN tagged frame to upper stack.
To fix the bug, don't use SIS_CMDSTS_PKT_OK for Rx error check and
introduce SIS_RXSTAT_ERROR macro that checks Rx errors. If we are
configured to accept VLAN tagged frames and the received frame size
is less than or equal to maximum allowed length of VLAN tagged
frame, clear 'LONG' bit of Rx status word before checking Rx
errors.
Reported by: Vladimir Ermako < samflanker <> gmail DOT com >
Tested by: Vladimir Ermako < samflanker <> gmail DOT com >
- USIII-based machines can consist of CPUs having different cache
sizes (and running at different frequencies) so move the cacheinfo
to the PCPU data. While at it, remove some redundant and/or unused
members from struct cacheinfo.
- In sparc64_init don't assume the first CPU node we find in the OFW
device tree is the BSP.
- Read ASI_{D,I}TLB_DATA_ACCESS_REG twice in order to work around
errata of USIII and beyond (USIII erratum #19, USIII+ erratum #1,
USIIIi erratum #1).
- Use the cheetah PA mask in {d,i}tlb_va_to_pa_sun4u() for USIII
and beyond. This is done so that these functions will still mask
the debug bits of spitfire-class CPUs once we increase TD_PA_BITS
to match the number of bits used for the PA by cheetah-class CPUs.
- Change {d,i}tlb_enter_sun4u() to also set TLB_CTX_KERNEL as the
context of the mappings entered. This is more or less cosmetic as
TLB_CTX_KERNEL is 0.
- Now that we have to distinguish between different sun4u CPUs in
the loader anyway, no longer do trial and error when reading the
portid property.
- Reimplement {d,i}tlb_enter() and {d,i}tlb_va_to_pa() in C. There's
no particular reason for them to be implemented in assembler and
having them in C allows easier extension as well as using more C
macros and {d,i}tlb_slot_max rather than hard-coding magic (and
actually spitfire-only) values.
- Fix the compilation of pmap_print_tte().
- Change pmap_print_tlb() to use ldxa() rather than re-rolling it
inline as well as TLB_DAR_SLOT and {d,i}tlb_slot_max rather than
hardcoding magic (and actually spitfire-only) values.
- While at it, suffix the above mentioned functions with "_sun4u" to
underline they're architecture-specific.
- Use __FBSDID and macros instead of magic values in locore.S.
- Remove unused includes and smp_stack in locore.S.
Make the whole initiator mode part of mpt(4) endian-clean,
specifically SPI controllers now also work in big-endian
machines and some conversions relevant for FC and SAS
controllers as well as support for ILP32 machines which all
were omitted in previous attempts are now also implemented.
The IOCTL-interface is intentionally left (and where needed
actually changed) to be completely little-endian as otherwise
we would have to add conversion code for every possible
configuration page to mpt(4), which didn't seem the right
thing to do, neither did converting only half of the user-
interface to the native byte order.
This change was tested on amd64 (SAS+SPI), i386 (SAS) and
sparc64 (SAS+SPI). Due to lack of the necessary hardware
the target mode code is still left to be made endian-clean.
Reviewed by: scottl
On architectures with strict alignment requirements compensate
the misalignment of the IP header that prepending the EtherIP
header might have caused.
PR: 131921
MFC is ahead of schedule due to request.
Add Bluetooth compatibility shims. Inspired by Linux BlueZ and NetBSD.
Discussed with: Iain Hibbert plunky -at- rya-online -dot- net of NetBSD
Requested by: Bruce Simpson bms -at- incunabulum -dot- net
Tested by: Bruce Simpson bms -at- incunabulum -dot- net
Add a knob to allow just the kernels to be built during a 'make universe'.
MFC r185250 by des:
Change the universe target to warn the user for every world or kernel that
fails. The error message includes a reference to the relevant log file.
- If the g_access() call for the initial root mount fails, then fully
cleanup. Before the GEOM consumer would not have been closed.
- Bump the reference on the character device being mounted while the
associated devfs vnode is locked.
Default to AF_LOCAL instead of AF_INET sockets for non-family-specific
operations. This allows the query operations to work in non-IPv4 jails,
and will be necessary in a future of possible non-INET networking.
Approved by: bz (mentor)
Merge Wake-on-Lan (WOL) support for the Attansic/Atheros L2.
This was left out of the backport to RELENG_7 as the WOL
infrastructure had not yet been backported to RELENG_7 when
the ae(4) driver was merged.
Tested OK on an ASUS EeePC 701 using ports/net/wol.
Submitted by: yongari
Eliminate redundant code from vm_page_startup().
(In retrospect, this change should have been included in the superpages
MFC. This change subsumes r189750.)
Discussed with: jhb
Use inc_flags instead of the inc_isipv6 alias which so far
had been the only flag with random usage patterns.
Switch inc_flags to be used as a real bit field by using
INC_ISIPV6 with bitops to check for the 'isipv6' condition.
While here fix a place or two where in case of v4 inc_flags
were not properly initialized before.[1]
Found by: rwatson during review [1]
Style changes only. Put the return type on an extra line[1] and
add an empty line at the beginning as we do not have any local
variables.
Submitted by: rwatson [1]
Make sure nmbclusters are initialized before maxsockets
by running the tunable_mbinit() SYSINIT at SI_ORDER_MIDDLE
before the init_maxsockets() SYSINT at SI_ORDER_ANY.
Fix a credential reference leak. [1]
Close subtle but relatively unlikely race conditions when
propagating the vnode write error to other active sessions
tracing to the same vnode, without holding a reference on
the vnode anymore. [2]
PR: kern/126368 [1]
Submitted by: rwatson [2]
Reviewed by: kib, rwatson
Bring over the change switching from using sequential to random
ephemeral port allocation as implemented in netinet/in_pcb.c rev. 1.143
(initially from OpenBSD) and follow-up commits during the last four and
a half years including rev. 1.157, 1.162 and 1.199.
This now is relying on the same infrastructure as has been implemented
in in_pcb.c since rev. 1.199.
Reviewed by: rwatson (UPDATING)
For IP1001 PHYs, read auto-negotiation advertisement register to
get default next page configuration. While I'm here explicitly set
IP1000PHY_ANAR_CSMA bit. This bit is read-only and always set
by hardware so setting it has no effect but it would clear the
intention. With this change controllers that couldn't establish
1000baseT link should work.
PR: kern/130846
r183561:
Add hardware MAC statistics support. Register information was
obtained from Linux forcedeth driver.
While I'm here move creating a sysctl node for process_limit to
function nfe_sysctl_node().
Tested by: "Arno J. Klaassen" < arno <at> heho dot snv dot jussieu dot fr >
r186346:
Fix a typo.
Submitted by: clemens fischer via Shigeaki Tagashira
Add a new tunable hw.re.prefer_iomap which disables memory register
mapping. The tunable is OFF for all controllers except RTL8169SC
family. RTL8169SC seems to require more magic to use memory
register mapping. r187483 added a fix for RTL8169SCe controller but
it does not looke like fix other variants of RTL8169SC.
Tested by: Gavin Stone-Tolcher g.stone-tolcher <> its dot uq dot edu dot au
Reclaim transmitted frames in re_tick(). This is for PCIe
controllers that lose Tx completion interrupts under certain
conditions. With this change it's safe to use MSI on PCIe
controllers so enable MSI on these controllers.
- Add support for 8110SCe part. Some magic registers were taken from
Linux driver.
- Swap hardware revisions for 8110S and 8169S as Linux driver claims.
- Do not read and write RX configuration register multiple times.
- Always program RX configuration register from scratch instead of
doing read/modify/write.
- Rename re_setmulti() to re_set_rxmode() to be reflect reality.
- Simplify hash filter logic a little while I am here.
o APM scheme supports Tivo Series 1 partitions (read only).
o Bootcode support added to BSD scheme.
o New EBR scheme to support Extended Boot Records (logical partitions).
o PC98 scheme fixes (credits to nyan@)
o VTOC8 scheme fixes (credits to marius@)
- Remove kH (kp_kll) from screen. It has the identical key sequence as
@7 (kp_end). As ncurses has the limitation that it returns the first
matched key symbol, you can not use END in ncurses based program under
screen (like ports/misc/mc).
We did similar changes to xterm entry last year for exactly the same reason.
PR: 132199
Submitted by: Timur I. Bakeyev <timur at FreeBSD.org>
In tcp_usr_shutdown() and tcp_usr_send(), I missed converting NULL
checks for the tcpcb, previously used to detect complete disconnection,
with INP_DROPPED checks. Correct that, preventing shutdown() from
improperly generating a TCP segment with destination IP and port of
0.0.0.0:0.
PR: kern/132050
Reported by: david gueluy <david.gueluy at netasq.com>
r186781
Merge support for CVSMode (aka. mirror mode) into csup. This means csup can now
fetch a complete CVS repository. Support for rsync update of regular files are
also included, but are not yet enabled. The change should not have an impact on
existing csup usage, as little of the existing code has changed.
r186871
- Update manpage now that cvs mode is supported.
r188405
- Fix an issue where file attributes were not installed correctly during a Touch
and SetAttrs operation.
- SetAttrs and Touch were incorrectly switched.
r188644
- Do not free the pattern lists immediately after use, as they might be needed
again in case the connection is interrupted and csup have to reconnect. The
lists will be freed after the collection has been completely processed.
r189455
- Try to handle rcsfile write failures in the same way as cvsup, as they are not
necessarily fatal. If the file was incorrectly written, the checksum will
detect it and the file will be retransferred.
In in_rtqkill(), assert the radix head lock, and pass RTF_RNH_LOCKED
to in_rtrequest(); the radix head lock is already acquired before
rnh_walktree is called in in_rtqtimo_one(). This avoids a recursive
acquisition that is no longer permitted in 8.x due to use of an rwlock
for the radix head lock.
Reported by: dikshie <dikshie at gmail.com>
While not strictly required in 7.x, I am merging this to keep locking as
consistent as possible in the routing code between 7.x and 8.x. Note
that because the rwlock change has not been merged, this becomes
LOCK_ASSERT rather than WLOCK_ASSERT.
By default, don't compile in counters of calls to various time
query functions in the kernel, as these effectively serialize
parallel calls to the gettimeofday(2) system call, as well as
other kernel services that use timestamps.
Use the NetBSD version of the fix (kern_tc.c:1.32 by ad@) as
they have picked up our timecounter code and also ran into the
same problem.
Reported by: kris
Obtained from: NetBSD
Add a new thread-private flag, TDP_AUDITREC, to indicate whether or
not there is an audit record hung off of td_ar on the current thread.
Test this flag instead of td_ar when auditing syscall arguments or
checking for an audit record to commit on syscall return. Under
these circumstances, td_pflags is much more likely to be in the cache
(especially if there is no auditing of the current system call), so
this should help reduce cache misses in the system call return path.
Reported by: kris
Obtained from: TrustedBSD Project
In AUDIT_SYSCALL_EXIT(), invoke audit_syscall_exit() only if an audit
record is active on the current thread--historically we may always
have wanted to enter the audit code if auditing was enabled, but now
we just commit the audit record so don't need to enter if there isn't
one.
Obtained from: TrustedBSD Project
Sponsored by: Apple, Inc.
Change the flags to bus_dmamem around to allow it to sleep waiting for
resources during allocation, but not during map load. Also, zero the
buffers here.
Fix the flags to bus_dmamem_* to allow the allocation to sleep while
waiting for resources. It is really the load that we can't defer.
BUS_DMA_NOCACHE belongs on bus_dmamap_load() as well.
This is the radeon r600+ code with fixes. A few days early,
but it seems to fix some other vblank related issues as well.
189499:
Import support for ATI Radeon R600 and R700 series chips.
Tested on an HD3850 (RV670) on loan from Warren Block.
Currently, you need one of the following for this to be useful:
x11-drivers/xf86-video-radeonhd-devel (not tested)
xf86-video-ati from git (EXA works, xv is too fast)
xf86-video-radeonhd from git (EXA works, xv works)
There is no 3d support available from dri just yet.
189557:
Call the right function for the right chipset.
189558:
-Make the PCI(E)/AGP calculations consistent
-Calculate the scratch address correctly
- r184733, r184742
Add -A and -B options
- r184654, r184656
style(9) changes
- r173387, r173431 (by kevlo)
Check return value for setenv()
In effect sync head and releng/7.
Ensure that the semaphore value is re-checked after sem_lock
is re-acquired, after the condition variable is signalled.
Early MFC, as the test case in the PR is fairly complete and the
submitter also re-ran test case on -STABLE. It also bites Python
fairly hard, which will otherwise try to use POSIX sems for its
internal thread synchronization; this needs more in-depth testing.
PR: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/127545
Reviewed by: attilio
Extract the no_poll() and vop_nopoll() code into the common routine
poll_no_poll().
Return a poll_no_poll() result from devfs_poll_f() when
filedescriptor does not reference the live cdev, instead of ENXIO.
platforms with superpages currently because the pages used by
vm_reserv_startup() are incorrectly included in the 'npages' count. I
haven't removed the assertion as I think this is a real bug, but the side
effect is just that some memory is wasted on never-used vm_page structures.
The assertion was removed from HEAD which is why the bug wasn't noticed
there (and thus this is a direct commit to 7).
Correct types of variables used to track amount of allocated SysV shared
memory from int to size_t. Implement a workaround for current ABI not
allowing to properly save size for and report more then 2GB sized segment
of shared memory.
This makes it possible to use > 2 GB shared memory segments on 64bit
architectures. Please note the new BUGS section in shmctl(2) and
UPDATING note for limitations of this temporal solution.
MFC r189398:
Systematically use vm_size_t to specify the size of the segment for VM KPI.
Do not overload the local variable size in kern_shmat() due to vm_size_t
change.
Fix style bug by adding explicit comparision with 0.
MFC r189399:
Improve the grammar and wording in the changes to shmctl(2) manpage.
Put an UPDATING entry and bump __FreeBSD_version for the change.
This adds support for the AH_SUPPORT_AR5416 kernel
configuration option, and removes the ath_rate*
and ath_hal modules. Their kernel options are not
however removed -- please see UPDATING.
Tested on an IBM/Lenovo T43 and ASUS EeePC 701 in both
STA and HostAP modes.
Submitted by: sam
Initialize the vblank structures at load time. Previously we did this
at irq install/uninstall time, but when we vt switch, we uninstall the
irq handler. When the irq handler is reinstalled, the modeset ioctl
happens first. The modeset ioctl is supposed to tell us that we can
disable vblank interrupts if there are no active consumers. This will
fail after a vt switch until another modeset ioctl is called via dpms
or xrandr. Leading to cases where either interrupts are on and can't
be disabled, or worse, no interrupts at all.
This was part of a sync to the code that Intel is shipping in linux.
- Remove the old TTM interface
- Move register definitions to i915_reg.h
- Overhaul the irq handler
Check the exit flag at the start of the taskqueue loop rather than the end. It
is possible to tear down the taskqueue before the thread has run and the
taskqueue loop would sleep forever.
following nodes as MPSAFE:
- All standalone INT/LONG sysctls.
- kern.proc.*
- All name-cache related sysctls.
- vm.loadavg
- vm.vmtotal
- vm.stats.(sys|vm).*
- sysctl.name2oid
- kern.ident, kern.osrelease, kern.version, etc.
- kern.arandom
- security.jail.jailed
- kern.devname
Other changes:
- Remove GIANT_REQUIRED from vmtotal().
- Add conditional Giant locking around the vrele() in
sysctl_kern_proc_pathname().
itself. This also includes changes to the ia64 machine check code to
defer adding machine check records to the sysctl tree, removing Giant
from the CAM code that created dynamic sysctls, and tweaking the teardown
of da(4) and cd(4) peripheral devices to not hold locks when freeing the
sysctl tree.
Extend the management of PCIM_CMD_INTxDIS.
We now explicitly enable INTx during bus_setup_intr() if it is needed.
Several of the ata drivers were managing this bit internally. This is
better handled in pci and it should work for all drivers now.
We also mask INTx during bus_teardown_intr() by setting this bit.
Disable INTx when enabling MSI/MSIX
This addresses interrupt storms that were noticed after enabling MSI
in drm. I think this is due to a loose interpretation of the PCI 2.3
spec, which states that a function using MSI is prohibitted from using
INTx. It appears that some vendors interpretted that to mean that they
should handle it in hardware, while others felt it was the drivers
responsibility.
This fix will also likely resolve interrupt storm related issues with
devices other than drm.
Dont leak the rnh lock on error.
Original change was from thompsa. This may correct routing-related panics
seen by uses of ppp, including the following PRs:
PR: 132215, 132222, 132404
Reported by: Ethan <hsiao.ethan at gmail.com>
Clarify and reimplement the bioq API so that bioq_disksort() has
the correct behaviour (sorting by distance from the current head position
in the scan direction) and bioq_insert_head() and bioq_insert_tail()
have a well defined (and useful) behaviour, especially when intermixed
with calls to bioq_disksort().
See the original commit log for more details.
NO API/ABI changes (except from fixing bugs and defining
unspecified behaviour that no code should rely on).
Add btpand(8) daemon from NetBSD. This daemon provides support for
Bluetooth Network Access Point (NAP), Group Ad-hoc Network (GN) and
Personal Area Network User (PANU) profiles.
MFC r188013
Fix client mode. Pick up service availability changes.
MFC r188014
Hook up btpand(8) to the build
Obtained from: NetBSD
In detail:
+ we used SYSCTL_LONG to show a 64-bit variable. For the time being
just remove the variable from the list of sysctl-exported values.
Unfortunately our SYSCTL macros do not do proper type checking
of the arguments so we might have some more bugs of this kind
across the codebase;
+ fw_debug has not been used for ages, so remove it;
+ gcc 4.2.4 tells me that src_ip.s_addr may be not initialized,
so make sure it is.
I need to check what is the status of this field in head.
Fix an edge-case of the linux readdir: We need the size of a linux dirent
structure, not the size of a pointer to it.
PR: 131099
Submitted by: Andreas Kies <[email protected]>
Make core dumping to ad not to freeze even if interrupts, not disabled
for some reason (noticed on SMP), stealing our events.
ata_interrupt() does not need to return anything. It is not it's business
to report request completion, expecially when it is not reliable.
PR: kern/114370, kern/115801
Set the lower bound on queue size for an audit pipe to 1 instead of 0,
as an audit pipe with a queue length of 0 is less useful.
Obtained from: TrustedBSD Project
Sponsored by: Apple, Inc.
Change various routines that are responsible for transforming audit
event IDs based on arguments to return au_event_t rather than int.
Obtained from: TrustedBSD Project
Sponsored by: Apple, Inc.
When a statically linked binary is executed (or at least, one without
an interpreter definition in its program header), set the auxiliary
ELF argument AT_BASE to 0 rather than to the address that we would
have mapped the interpreter at if there had been one.
The ELF ABI specifications appear to be ambiguous as to the desired
behavior in this situation, as they define AT_BASE as the base address
of the interpreter, but do not mention what to do if there is none.
On Solaris, AT_BASE will be set to the base address of the static
binary if there is no interpreter, and on Linux, AT_BASE is set to 0.
We go with the Linux semantics as they are of more immediate utility
and allow the early runtime environment to know that the kernel has
not mapped an interpreter, but because AT_PHDR points at the ELF
header for the running binary, it is still possible to retrieve all
required mapping information when the process starts should it be
required. Either approach would be preferable to our current behavior
of passing a pointer to an unmapped region of user memory as AT_BASE.
Sponsored by: Google
The most relevant changes are the building of libraries
in the --init call, and the ability to use /boot/loader
(on by default) which seems to be necessary for large kernels.
Make sure the cdev doesn't go away while the filesystem is still mounted.
Otherwise dev2udev() could return garbage.
Reviewed by: kib
Approved by: rwatson (mentor)
Sponsored by: FreeBSD Foundation
When a device containing mounted UFS filesystem disappears, the type
of devvp becomes VBAD, which UFS incorrectly interprets as snapshot
vnode, which in turns causes panic. Fix it by replacing '!= VCHR'
with '== VREG'.
With this fix in place, you should no longer be able to panic the system
by removing a device with an UFS filesystem mounted from it - assuming
you don't use softupdates.
Reviewed by: kib
Tested by: pho
Approved by: rwatson (mentor)
Sponsored by: FreeBSD Foundation
Turn a "panic: non-decreasing id" into an error printf. This seems
to be caused by a metadata corruption that occurs quite often after
unplugging a pendrive during write activity.
Reviewed by: scottl
Approved by: rwatson (mentor)
Sponsored by: FreeBSD Foundation
Don't panic with "vinvalbuf: dirty bufs" when the mounted device that was
being written to goes away.
Reviewed by: kib, scottl
Approved by: rwatson (mentor)
Sponsored by: FreeBSD Foundation
According to phk@, VOP_STRATEGY should never, _ever_, return
anything other than 0. Make it so. This fixes
"panic: VOP_STRATEGY failed bp=0xc320dd90 vp=0xc3b9f648",
encountered when writing to an orphaned filesystem. Reason
for the panic was the following assert:
KASSERT(i == 0, ("VOP_STRATEGY failed bp=%p vp=%p", bp, bp->b_vp));
at vfs_bio:bufstrategy().
Reviewed by: scottl, phk
Approved by: rwatson (mentor)
Sponsored by: FreeBSD Foundation
Reviewed by: imp
Approved by: rwatson (mentor)
Original commit log:
A partial solution to some of the 'pull the umass device with a
mounted FS' problems. These are more along the lines of 'avoiding an
avoidable panic' than a complete solution to removable devices. We
now close the barn door after the horse has gotten lose and has been
hit by a truck, as it were. The barn no longer catches fire in this
case, but the horse is still dead :-).
The vfs_bio.c fix causes us not to put a failed write back into the
dirty pool if the error returned was ENXIO. In that case, the buffer
is treated like any other clean buffer that's being retured. ENXIO
means the device isn't there anymore and will never be there again in
the future, so retrying is futile.
The vfs_mount.c fix treats 'ENXIO' as success for unmounting a file
system. If the device is gone, retrying later won't help and we'll
never be able to unmount the device.
These two are part of a larger patch set submitted by the author. The
other patches will be forth coming. I added comments to these two
patches.
Submitted by: Henrik Gulbrandsen
Reviewed by: phk@
PR: usb/46176 (partial)
Prevent a panic that happens on SMP machines when removing a disk with
many writes queued up.
Reviewed by: phk, scottl
Approved by: rwatson (mentor)
Sponsored by: FreeBSD Foundation
Implement g_vfs_orphan(). Without it, the filesystem never closes
the device, which means refcount on periph drivers never drops,
which means cam_sim_free() never returns, which results in umass
sleeping there ad infinitum.
Submitted by: pjd
Reviewed by: scottl, pjd
Approved by: rwatson (mentor)
Sponsored by: FreeBSD Foundation
Don't call destroy_dev(9) with a mutex held. While here, shuffle
things around so the periph destructors look alike. Based on a patch
by Jaakko Heinonen.
Submitted by: Jaakko Heinonen
Reviewed by: scottl
Approved by: rwatson (mentor)
Sponsored by: FreeBSD Foundation
Make "kldunload atapicam" return EBUSY instead of deadlocking when a device
created by atapicam is being kept opened or mounted. This is probably just
a temporary solution until we invent something better.
Reviewed by: scottl
Approved by: rwatson (mentor)
Sponsored by: FreeBSD Foundation
Reported by: Jaakko Heinonen
Move mtx_assert lower, when we can be sure that the pointer
to the mutex is valid.
Reviewed by: scottl
Approved by: rwatson (mentor)
Sponsored by: FreeBSD Foundation
Add SIM refcounting. This is slightly different from what DragonFly
does - in DragonFly, it's cam_sim_release() what actually frees the
SIM; cam_sim_free does nothing more than calling cam_sim_release().
Here, we drain in cam_sim_free, waiting for refcount to drop to zero.
We cannot do the same think DragonFly does, because after cam_sim_free
returns, client would destroy the sim->mtx, and CAM would trip over
an initialized mutex.
Reviewed by: scottl
Approved by: rwatson (mentor)
Sponsored by: FreeBSD Foundation
Get rid of dead_sim. There is no way to make it work - any attempt
to actually use it would panic on mtx operation, as dead_sim doesn't
have a proper mutex. Even if it had a properly initialized mutex,
it wouldn't have properly locked and owned one.
Reviewed by: scottl
Approved by: rwatson (mentor)
Sponsored by: FreeBSD Foundation
were tested prior to the MFC of the 6GB KVA changes, and I failed to do
an extra sanity check yesterday. This should fix the pmap_init() panics.
Pointy hat to: jhb
superpage reservation system to the machine-independent VM system as well as
changes to the pmap code for amd64 and i386 to support superpages.
Reviewed by: alc
Tested by: ps
Modify fdcopy() so that, during fork(2), it won't copy file descriptors
from the parent to the child process if they have an operation vector
of &badfileops. This narrows a set of races involving system calls that
allocate a new file descriptor, potentially block for some extended
period, and then return the file descriptor, when invoked by a threaded
program that concurrently invokes fork(2). Similar approches are used
in both Solaris and Linux, and the wideness of this race was introduced
in FreeBSD when we moved to a more optimistic implementation of
accept(2) in order to simplify locking.
A small race necessarily remains because the fork(2) might occur after
the finit() in accept(2) but before the system call has returned, but
that appears unavoidable using current APIs. However, this race is
vastly narrower.
The fix can be validated using the newfileops_on_fork regression test.
PR: kern/130348
Reported by: Ivan Shcheklein <shcheklein at gmail dot com>
Reviewed by: jhb, kib
Remove local variable 'ddp' from DDP's attach and detach routines; they
were used only for assertions, and rather than ifdef'ing them
INVARIANTS and using local variables, just directly access so_pcb.
Submitted by: Christoph Mallon <christoph dot mallon at gmx dot de>
Eliminate the local variable 'ape' in audit_pipe_kqread(), as it's only
used for an assertion that we don't really need anymore.
Reported by: Christoph Mallon <christoph dot mallon at gmx dot de>
Remove stale comment about filtering in audit pipe ioctl routine: we do
support filtering now, although we may want to make it more interesting
in the future.
Update introductory comment for audit pipes.
Sponsored by: Apple, Inc.
We only allow a partial read of the first record in an audit pipe
record queue, so move the offset field from the per-record
audit_pipe_entry structure to the audit_pipe structure.
Now that we support reading more than one record at a time, add a
new summary field to audit_pipe, ap_qbyteslen, which tracks the
total number of bytes present in a pipe, and return that (minus
the current offset) via FIONREAD and kqueue's data variable for
the pending byte count rather than the number of bytes remaining
in only the first record.
Add a number of asserts to confirm that these counts and offsets
following the expected rules.
Sponsored by: Apple, Inc.
Allow a single read(2) system call on an audit pipe to retrieve data from
more than one audit record at a time in order to improve efficiency.
Sponsored by: Apple, Inc.
Since there is no longer the opportunity for record truncation, just
return 0 if the truncation counter is queried on an audit pipe.
Sponsored by: Apple, Inc.
Historically, /dev/auditpipe has allows only whole records to be read via
read(2), which meant that records longer than the buffer passed to read(2)
were dropped. Instead take the approach of allowing partial reads to be
continued across multiple system calls more in the style of streaming
character device.
This means retaining a record on the per-pipe queue in a partially read
state, so maintain a current offset into the record. Keep the record on
the queue during a read, so add a new lock, ap_sx, to serialize removal
of records from the queue by either read(2) or ioctl(2) requesting a pipe
flush. Modify the kqueue handler to return bytes left in the current
record rather than simply the size of the current record.
It is now possible to use praudit, which used the standard FILE * buffer
sizes, to track much larger record sizes from /dev/auditpipe, such as
very long command lines to execve(2).
Sponsored by: Apple, Inc.
Do a lockless read of the audit pipe list before grabbing the audit pipe
lock in order to avoid the lock acquire hit if the pipe list is very
likely empty.
Obtained from: TrustedBSD Project
Sponsored by: Apple, Inc.
- In the event that a gateway route has to be looked up, drop the lock
on 'rt' before reacquiring it 'rt0' in order to avoid deadlock.
- In the event the original route has evaporated or is no longer up
after the gateway route lookup, call RTFREE() on the gateway route
before retrying.
This is a potential errata candidate patch.
PR: kern/130652
Submitted by: Dmitrij Tejblum <tejblum at yandex-team.ru>
Reviewed by: bz
Tested by: Pete French <petefrench at ticketswitch.com>
r186052 from head to stable/7; note that only the locking fixes and
invariants checking are added from r185747, but not the move to an
rwlock which would modify the kernel binary interface, nor the move
to a non-recursible lock, which is still seeing problem reports in
head. This corrects, among other things, a deadlock that may occur
when processing incoming ICMP redirects.
r185747:
- convert radix node head lock from mutex to rwlock
- make radix node head lock not recursive
- fix LOR in rtexpunge
- fix LOR in rtredirect
Reviewed by: sam
r185774:
- avoid recursively locking the radix node head lock
- assert that it is held if RTF_RNH_LOCKED is not passed
r185807:
Fix a bug introduced in r185747: rather than dereferencing an
uninitialized *rt to something undefined, use the fibnum that came in
as function argument.
Found with: Coverity Prevent(tm)
CID: 4168
r185849:
fix a reported panic when adding a route and one hit here when deleting
a route
- pass RTF_RNH_LOCKED to rtalloc1_fib in 2 cases where the lock is held
- make sure the rnh lock is held across rt_setgate and rt_getifa_fib
r185964:
Pass RTF_RNH_LOCKED to rtalloc1 sunce the node head is locked, this
avoids a recursive lock panic on inet6 detach.
Reviewed by: kmacy
r185965:
RTF_RNH_LOCKED needs to be passed in the flags arg not report,
apologies to thompsa
r186051:
in6_addroute is called through rnh_addadr which is always called with
the radix node head lock held exclusively. Pass RTF_RNH_LOCKED to
rtalloc so that rtalloc1_fib will not try to re-acquire the lock.
r186052:
don't acquire lock recursively
Oiginal commits to head were by kmacy, except r185964 by thompsa and
r185807 by bz.
A subset of this is a potential errata patch candidate.
Reviewed by: bz, kmacy
Tested by: Pete French <petefrench at ticketswi
Fix a typo which caused ifmcstat's sysctl path
to print the network-layer endpoint address of the
group membership, rather than its link-layer mapping
as intended.
The KVM path is not affected.
Lookup up the directory entry for the tmpfs node that are deleted by
both node pointer and name component. This does the right thing for
hardlinks to the same node in the same directory.
PR: kern/131356
Move the code from ufs_lookup.c used to do dotdot lookup, into
the helper function. It is supposed to be useful for any filesystem
that has to unlock dvp to walk to the ".." entry in lookup routine.
The only new feature is that now one can write
"table all {flush | list}" to act on all tables.
Just for the records, there is one difference which probably
has no practical importance; two "tos" flags are represented
differently now:
@@ -182,8 +182,8 @@ static struct _s_x f_iptos[] = {
{ "throughput", IPTOS_THROUGHPUT},
{ "reliability", IPTOS_RELIABILITY},
{ "mincost", IPTOS_MINCOST},
- { "congestion", IPTOS_CE},
- { "ecntransport", IPTOS_ECT},
+ { "congestion", IPTOS_ECN_CE},
+ { "ecntransport", IPTOS_ECN_ECT0},
{ "ip tos option", 0},
{ NULL, 0 }
};
IPTOS_ECT = IPTOS_ECN_ECT0 = 2 so 'ecntransport' is the same.
IPTOS_CE = 1, IPTOS_ECN_CE = 3 so 'congestion' is represented by a
different codepoint, but this also reflects a different specification
(RFC3168 obsoletes RFC2481) so the change is just adopting the new
spec.
MFC r182781 (by pjd):
Catch up after last insmntque() changes:
- The vnode has to be locked exclusively before calling insmntque().
- Until I find a way to handle insmntque() failures use VV_FORCEINSMQ flag
to force insmntque() to always succeed.
MFC r182824 (by pjd):
Lock vnode exclusively around insmntque().
MFC r182840 (by pjd):
Initialize vp, so we don't call VOP_UNLOCK() with NULL vnode pointer.
Tested by: cy, pjd
No objections by: pjd
r188144:
Standardize the various prison_foo_ip[46] functions and prison_if to
return zero on success and an error code otherwise. The possible errors
are EADDRNOTAVAIL if an address being checked for doesn't match the
prison, and EAFNOSUPPORT if the prison doesn't have any addresses in
that address family. For most callers of these functions, use the
returned error code instead of e.g. a hard-coded EADDRNOTAVAIL or
EINVAL.
Always include a jailed() check in these functions, where a non-jailed
cred always returns success (and makes no changes). Remove the explicit
jailed() checks that preceded many of the function calls.
r188146:
Don't allow creating a socket with a protocol family that the current
jail doesn't support. This involves a new function prison_check_af,
like prison_check_ip[46] but that checks only the family.
With this change, most of the errors generated by jailed sockets
shouldn't ever occur, at least until jails are changeable.
r188148:
Remove redundant calls of prison_local_ip4 in in_pcbbind_setup, and of
prison_local_ip6 in in6_pcbbind.
r188149:
Call prison_if from rtm_get_jailed, instead of splitting it out into
prison_check_ip4 and prison_check_ip6. As prison_if includes a jailed()
check, remove that check before calling rtm_get_jailed.
r188151:
Don't bother null-checking the thread pointer before the prison checks
in udp6_connect (td is already dereferenced elsewhere without such a
check). This makes the conversion from a sockaddr to a sockaddr_in6
always happen, so convert once at the beginning of the function rather
than twice in the middle.
Approved by: bz (mentor)
access(), chdir(), chroot(), eaccess(), fchdir(), fpathconf(), fstat(),
fstatfs(), lseek() (when figuring out the current size of the file in the
SEEK_END case), pathconf(), readlink(), and statfs() system calls.
semaphores. Specifically, semaphores are now represented as new file
descriptor type that is set to close on exec. This removes the need for
all of the manual process reference counting (and fork, exec, and exit
event handlers) as the normal file descriptor operations handle all of
that for us nicely. It is also suggested as one possible implementation
in the spec and at least one other OS (OS X) uses this approach.
Refer to the original commit for more details on specific bug fixes, etc.
A notable difference in this MFC relative to the original commit to HEAD
is that the MAC entry points are unchanged to preserve the ABI for MAC
policy modules. fstat() on a POSIX semaphore in 7 uses the
mac_check_posix_sem_getvalue() hook to determine access as that is the
closest match to stat() of the available hooks.
Discussed with: rwatson (MAC bits (or lack thereof))
'lib32' for 32-bit binaries on amd64 and 'lib' for 64-bit binaries. Remove
an #ifdef __i386__ that defined use32 to the wrong value on i386 to
workaround the bug in the terenary operator.
Since r188030 the error value for attach is returned, this means if kbdmux
fails to attach (possibly due to disable hints) then we get called back for
unload. Correctly handle the case where the keyboard isnt found rather than
calling panic.
Submitted by: thompsa
- remove 3 unneeded headers (this is not applicable to head);
- replace netinet/if_ether.h with net/ethernet.h which is really needed;
- add missing #ifdef SYSCTL_NODE / #endif
- use the 'ch' argument instead of &layer3_chain when adding entries to
a table;
- remove an assigment within a conditional;
- properly initialize a couple of variables
- use a constant format string in a log message
- remove unnecessary braces and simplify the error
messages in IP_FW_NAT_* handler
When attempt is made to suspend a filesystem that is already syspended,
wait until the current suspension is lifted instead of silently returning
success immediately. The consequences of calling vfs_write() resume when
not owning the suspension are not well-defined at best.
Add the vfs_susp_clean() mount method to be called from
vfs_write_resume(). Set it to process_deferred_inactive() for ffs, and
stop calling it manually.
Add the thread flag TDP_IGNSUSP that allows to bypass the suspension
point in the vn_start_write. It is intended for use by VFS in the
situations where the suspender want to do some i/o requiring calls to
vn_start_write(), and this i/o cannot be done later.
Note that addition of the mount method and new struct mount field change
the KBI. This was approved by re and no objections on stable@ were
raised.
Add the ffs structures introspection functions for ddb.
Show the b_dep value for the buffer in the show buffer command.
Add a comand to dump the dirty/clean buffer list for vnode.
When downgrading the read-write mount to read-only, do_unmount() sets
MNT_RDONLY flag before the VFS_MOUNT() is called. In ufs_inactive()
and ufs_itimes_locked(), UFS verifies whether the fs is read-only by
checking MNT_RDONLY, but this may cause loss of the IN_MODIFIED flag
for inode on the fs being remounted rw->ro.
Introduce UFS_RDONLY() struct ufsmount' method that reports the value
of the fs_ronly. The later is set to 1 only after the remount is
finished.
In ffs_valloc(), ffs_vget() may fail because insmntque() refused to
insert new vnode into the mount vnode list. Then, for the SU-enabled
mount, ffs_vfree could create freefile dependency. This dependency can
hang around forever since inode is not marked as IN_MODIFIED and
correspondingly inodeblock may be not marked as dirty.
After ffs_vget() fails, retry with FFSV_FORCEINSMQ, mark the inode as
modified, and vput() it immediately. Take care of the dup alloc.
Softdep code may need to instantiate vnode when processing
dependencies. In particular, it may need this while syncing filesystem
being unmounted. Since during unmount MNTK_NOINSMNTQUE flag is set,
that could sometimes disallow insertion of the vnode into the vnode
mount list, softdep code needs to overwrite the MNTK_NOINSMNTQUE flag.
Create the ffs_vgetf() function that sets the VV_FORCEINSMQ flag for
new vnode and use it consistently from the softdep code instead of
ffs_vget().
Add the retry logic to the softdep_flushfiles() to flush the vnodes
that could be instantiated while flushing softdep dependencies.
Introduce the VV_FORCEINSMQ vnode flag. It instructs the insmnque() function
to ignore the unmounting and forces insertion of the vnode into the mount
vnode list.
Change insmntque() to fail when forced unmount is in progress and
VV_FORCEINSMQ is not specified.
Add an assertion to the insmntque(), requiring the vnode to be
exclusively locked for mp-safe filesystems.
MFC note: because zfs in stable/7 does not follow the insmntque() protocol,
the assertion is commented out.
Use the VV_FORCEINSMQ for the creation of the syncvnode.
Code from the hack-session known as the IETF (and a
bit of debugging afterwards):
- Fix protection code for notification generation.
- Decouple associd from vtag
- Allow vtags to have less strigent requirements in non-uniqueness.
o don't pre-hash them when you issue one in a cookie.
o Allow duplicates and use addresses and ports to
discriminate amongst the duplicates during lookup.
- Add support for the NAT draft draft-ietf-behave-sctpnat-00, this
is still experimental and needs more extensive testing with the
Jason Butt ipfw changes.
- Support for the SENDER_DRY event to get DTLS in OpenSSL working
with a set of patches from Michael Tuexen (hopefully heading to
OpenSSL soon).
- Update the support of SCTP-AUTH by Peter Lei.
- Use macros for refcounting.
- Fix MTU for UDP encapsulation.
- Fix reporting back of unsent data.
- Update assoc send counter handling to be consistent with endpoint
sent counter.
- Fix a bug in PR-SCTP.
- Fix so we only send another FWD-TSN when a SACK arrives IF and only
if the adv-peer-ack point progressed. However we still make sure
a timer is running if we do have an adv_peer_ack point.
- Fix PR-SCTP bug where chunks were retransmitted if they are sent
unreliable but not abandoned yet.
With the help of: Michael Teuxen and Peter Lei :-)
-Improvement: Add '\n' on debug output in sctp_lower_sosend().
-Improvement: panic() on INVARIANTS kernels if memory allocation
fails for a tagblock in sctp_add_vtag_to_timewait().
-Bugfix: Protect code in sctp_is_in_timewait() by
SCTP_INP_INFO_WLOCK/SCTP_INP_INFO_WUNLOCK.
-Cleanup: Get rid of unused variable now in sctp_init_asoc().
-Bugfix: Reuse the correct vtag in sctp_add_vtag_to_timewait().
-Cleanup: Get rid of unused constant SCTP_TIME_WAIT_SHORT
in sctp_constants.h.
-Improvement: Use all hash buckets of the vtag hash table.
-Cleanup: Get rid of then unused constant SCTP_STACK_VTAG_HASH_SIZE_A.
-Bugfix: Handle SHUTDOWN;SACK packet correctly.
-Bugfix: Last TSN in a gap ack block was not being "ack'd"
in the internal scoreboard.
Obtained from: (with help from Michael Tuexen)
More issues with pre-blocking:
a) Need for EEOR mode to take the min of the socket buffer size and the
add more threshold, otherwise if you are so silly as to set a send
buf size less than the add-more you could block forever in eeor mode.
b) We were incorrectly using the sysctl vs the calculated value. This
causes us to block forever if the addmore theshold is larger than
then the socket buffer size.
Reported by Yehuda Weinraub ([email protected]) - CRC32C algorithm
uses incorrect init_bytes value. It SHOULD have the number
of bytes to get to a 4 byte boundary.
PR: 128134
- Make strict-sacks be the default.
- Change it so that without INVARIANTs there are
no panics in SCTP.
- sctp_timer changes so that we have a recovery mechanism
when the sent list is out of order.
<AND>
Fixes compile error when INVARIANTs is on. Adds an
empty goto to keep the compiler happy.
Two inter-related bugs.
- If we send EXACTLY the size left in the send buffer
and then send again, we end up with exactly 0 bytes and
don't hit the pre-block code to wait for more space.
- If we fall into the loop with our max_len == 0 (the bug
above) we then call in to copy out the data, setup the length
of the waiting to transmit data to 0 and call the mbuf copy routine
which 0 indicates copy all the data to the mbuf chain.. which it
does. This then leaves a "stuck" message on the stream queue with
its size exactly 0 bytes but all the data there and thus nothing
left in the uio structure. We then reach a stuck forever state
never being able to send data.
Add uuid_enc,dec_le,be() functions to Symbol.map
Pointy hat goes to me.
MFC r183192
Move uuid_enc_le, uuid_dec_le, uuid_enc_be and uuid_dec_be symbols
into FBSD_1.1 section where they should be (as Pointed out by: kib,
deischen)
Straighten out those pesky SDP records for the Bluetooth
Service Discovery Application Profile.
Discussed with: Iain Hibbert of NetBSD plunky at rya dash online dot net
Add new TAPGIFNAME tap(4) character device ioctl. This is a
convenient shortcut to obtain network interface name using
file descriptor for character device.
Obtained from: NetBSD
Change vinvalbuf() to not remove any pages from the object when
V_NORMAL or V_ALT are specified. Instead, the only in-tree caller
in ffs_inode.c:ffs_truncate() that specifies V_ALT explicitely
removes the corresponding page range. The V_NORMAL caller
does vnode_pager_setsize(vp, 0) immediately after the call to
vinvalbuf(V_NORMAL) already.
MFC r187490:
The r187467 should remove all pages for V_NORMAL case too, because
indirect block pages are not removed by the mentioned invocation of
the vnode_pager_setsize().
Put a common code into the helper function ffs_pages_remove().
r188112 | cognet | 2009-02-04 02:14:06 +0100 (Wed, 04 Feb 2009) | 8 lines
Erm... Report the buffer as being bounced even when it's the entire buffer,
or we would end up invalidating the cache line for what we just copied...
Properly return error code to the caller. This should fix the following
panic in ng_l2cap(4).
panic: ng_l2cap_l2ca_con_req: ubt0l2cap - could not find connection!
While i'm here get rid of few goto's.
The kernel may do unbalanced calls to fifo_close() for fifo vnode,
without corresponding number of fifo_open(). This causes assertion
failure in fifo_close() due to vp->v_fifoinfo being NULL for kernel
with INVARIANTS, or NULL pointer dereference otherwise. In fact, we may
ignore excess calls to fifo_close() without bad consequences.
Turn KASSERT() into the return, and print warning for now.
Always check whether dma map is valid before unloading the map.
When fxp(4) intializes Rx buffers for the first time, there is no
loaded dma map so attempting to unload it is an invalid operation.
It seems that we don't need to reserve a TBD to set total TCP
payload length in TSO case. Leaving unused TBD also seem to cause
SCB timeouts under certain conditions when TSO/non-TSO traffics
are active at the same time.
Add VLAN hardware tag insertion/stripping support. Tx/Rx checksum
offload for VLAN frames are also supported. The VLAN hardware
assistance is available only on 82550/82551 based controllers.
While I'm here change the confusing name of bit1 in byte 22 of
configuration block to vlan_drop_en. The bit controls whether
hardware strips VLAN tagged frame or not. Special thanks to wpaul
who sent valuable VLAN related information to me.
r185354:
Add basic WOL support for 82550/82551/82558 and 82559 based
controllers. ICH based controllers are treated as 82559. 82557,
earlier revision of 82558 and 82559ER have no WOL capability.
o WOL support requires help of a firmware so add check whether
hardware is capable of handling magic frames by reading EEPROM.
o Enable accepting WOL frames only when hardware is about to
suspend or shutdown. Previously fxp(4) used to allow receipt of
magic frame under normal operation mode which could cause
hardware hang if magic frame is received by hardware. Datasheet
clearly states driver should not allow WOL frames under normal
operation mode.
o Disable WOL frame reception in device attach so have fxp(4)
immunize against system hang which can be triggered by magic
packets when the hardware is not in fully initialized state.
o Don't reset all hardware configuration data in fxp_stop()
otherwise important configuration data is lost and this would
reset WOL configuration to default state which in turn cause
hardware hang on receipt of magic frames. To fix the issue,
preserve hardware configuration data by issuing a selective
reset.
o Explicitly disable interrupts after issuing selective reset as
reset may unmask interrupts.
r185538:
Make sure to clear PMDR register by writing back power management
events. Just reading PMDR register was not enough to have fxp(4)
immuninize against received magic packets during system boot.
Implement TSO for 82550/82551 controllers.
o Configure controller to use dynamic TBD as TSO requires that
operation mode.
o Add a dummy TBD to tx_cb_u as TSO can access one more TBD in TSO
operation.
o Increase a DMA segment size to 4096 to hold a full IP segment
with link layer header.
o Unlike other TSO capable controllers, 82550/82551 does not
modify the first IP packet in TSO operation so driver should
create an IP packet with proper header. Subsequent IP packets
are generated from the header information in the first IP packet
header. Likewise pseudo checksum also should be computed by
driver for the first packet.
o TSO requires one more TBD to hold total TCP payload. To make
code simple for TSO/non-TSO case, increase the index of the
first available TBD array.
o Remove KASSERT that checks the size of a DMA segment should be
less than or equal to MCLBYTES as it's no longer valid in TSO.
o Tx threshold and number of TBDs field is used to store MSS in
TSO. So don't set the Tx threshold in TSO case.
Implement Rx checksum offload for 82559 or later controllers.
82559 or later controllers added simple checksum calculation logic
in RU. For backward compatibility the computed checksum is appended
at the end of the data posted to Rx buffer. This type of simple
checksum calculation support had been used on several vendors such
as Sun HME/GEM, SysKonnect GENESIS and Marvell Yukon controllers.
Because this type of checksum offload support requires parsing of
received frame and pseudo checksum calculation with software
routine it still consumes more CPU cycles than that of full-fledged
checksum offload controller. But it's still better than software
checksum calculation.
o Introduce a new function, fxp_new_rfabuf which allocates a new
Rx buffer and loads DMA map. Also add a function
fxp_discard_rfabuf that handles reusing Rx buffer/DMA map. With
this change fxp_add_rfabuf just handles appending a new RFA to
existing chain.
o Initialize mbuf length in fxp_new_rfabuf.
o Don't reset rnr and have fxp(4) handle received frames even if
it couldn't allocate new Rx buffer. This will make fxp(4) reload
updated RFA under rnr case. The rnr would still be reset to 0 if
polling is active and fxp(4) processed number of allowed Rx
events.
o Update if_iqdrops if fxp(4) couldn't allocate Rx buffer.
Previously fxp(4) used to try to reuse Rx buffer when new buffer
allocation is failed. But fxp(4) didn't take into account loaded
DMA map such that the same DMA map was loaded again without
unloading the map. There is no reason to unload the loaded map and
reload the same map again, just reusing the map is enough. I
believe the spare DMA map in softc was introduced to implement this
behaviour. Also fxp(4) used to stop Rx processing if once Rx buffer
allocation or DMA map load fails which in turn resulted in losing
incoming frames under heavy network load. With this change fxp(4)
should survive from resource shortage condition.
- Allow fxp_encap() enqueue failed transmissions and set
IFF_DRV_OACTIVE to note resource shortage to upper stack.
- Don't count number of mbuf chains. Default 32 DMA segments for a
frame is enough for most cases. If bus_dmamap_mbuf_sg fails use
m_collapse(9) to collapse the mbuf chain instead of relying on
expensive m_defrag(9).
- Move bpf handling to fxp_start_body() which is supposed to be
more appropriate place.
- Always arm watchdog timer whenever a new Tx request is made.
Previously fxp(4) used to arm watchdog timer only when
FXP_CXINT_THRESH-th Tx request is made. Because fxp(4) does not
rely on Tx interrupt to reclaim transmitted mbufs it's better to
arm watchdog timer to detect potential lockups.
- Add more aggresive Tx buffer reclaiming in fxp_start_body to make
room for new Tx requests. Since fxp(4) does not request Tx
completion interrupt for every frames it's necessary to clean
TXCBs in advance to saturate link.
- Make fxp(4) try to start more packets transmitting regardless of
interrupt type in fxp_intr_body.
Move unarming watchdog timer and pending multicast configuration
check to fxp_txeof(). While I'm here unarm watchdog timer only if
there are no pending queued Tx requests.
Previously the watchdog timer was unarmed whenever Tx interrupt is
raised. This could be resulted in hiding root cause of watchdog
timeouts.
Fix Tx/Rx checksum offload ioctl handling and make Rx handler honor
checksum offload configuration. Now checksum offload can be
controlled by ifconfig(8).
While I'm here add an additional check for interface capabilities
before applying user's request.
Reuse the mbuf that was just retrieved from the receive ring if mbuf
exhaustion is encountered. There was a fix made previously for this
problem but the solution (breaking out of the receive loop) does not
seem to work. mbuf reuse strategy is already adopted by other drivers
such as if_bge. The problem was recreated and the patch is also
verified in the same test environment.
Remove local jumbo locator and switch to UMA backed page allocator
for jumbo frame.
o Nuke unneeded jlist lock which was used to protect jumbo buffer
management in local allocator.
o Added a new tunable hw.mskc.jumbo_disable to disable jumbo
frame support for the driver. The tunable could be set for
systems that do not need to use jumbo frames and it would
save (9K * number of Rx descriptors) bytes kernel memory.
o Jumbo buffer allocation failure is no longer critical error
for the operation of msk(4). If msk(4) encounter the allocation
failure it just disables jumbo frame support and continues to
work without your intervention.
Using local allocator had several drawbacks such as requirement of
large amount of continuous kernel memory and fixed (small) number
of available buffers. The need for large continuous memory resulted
in failure of loading driver with kldload on running systems.
Also small number of buffer used in local allocator showed poor
performance for some applications.
r183485:
Always pullup mbuf prior to accessing TCP header.
This should fix occasional Tx checksum corruption issue.
r183486:
If mbuf is not writable get a writable copy before invoking
m_pullup(9).
Add another hardware bug workaround for Yukon II controllers that
have hardware ram buffer. The silicon bug seem to be triggered by
pause frames if receive buffer is not aligned on FIFO word(8 bytes).
To workaround the issue, make sure to align Rx buffers on 8 bytes.
Unfortunately this workaround requires yet another Rx fixup for
strict alignment architecture machines to align IP header.
For newer hardwares that lacks ram buffer may not have this bug so
check number of available ram buffer size to see the existence of
ram buffer.
r186214:
It seems that RealTek PCIe controllers require an explicit Tx poll
command whenever Tx completion interrupt is raised. The Tx poll
bit is cleared when all packets waiting to be transferred have been
processed. This means the second Tx poll command can be silently
ignored as the Tx poll bit could be still active while processing
of previous Tx poll command is in progress.
To address the issue re(4) used to invoke the Tx poll command in Tx
completion handler whenever it detects there are pending packets in
TxQ. However that still does not seem to completely eliminate
watchdog timeouts seen on RealTek PCIe controllers. To fix the
issue kick Tx poll command only after Tx completion interrupt is
raised as this would indicate Tx is now idle state such that it can
accept new Tx poll command again. While here apply this workaround
for PCIe based controllers as other controllers does not seem to
have this limitation.
r186389:
Since we don't request reset for rlphy(4), the link state 'UP'
event from mii(4) may not be delivered if valid link was already
established. To address the issue, check current link state after
driving MII_TICK. This should fix a regression introduced in
r185753 on fast ethernet controllers.
r187417:
Sometimes RTL8168B seems to take long time to access GMII registers
in device attach phase. Double GMII register access timeout value
to fix the issue.
For RTL8168C SPIN2 controllers, make sure to take the controller
out of sleep mode prior to accessing to PHY. This should fix device
attach failure seen on these controllers. Also enable the sleep
mode when device is put into sleep state.
PR: kern/123123, kern/123053
r185897:
Always put controller into known state before device intialization.
While here remove re_reset calls invoked in system error case as
controller reset is always done in device initialization.
r185900:
Newer RealTek controllers requires setting stop request bit to
terminate active Tx/Rx operation.
r185901:
Don't access undocumented register 0x82 on controllers that
have no such register. While here clear undocumented PHY
register 0x0B for RTL8110S.
r185903:
Make WOL work on RTL8168B. This controller seems to require
explicit command to enable Rx MAC prior to entering D3.
r185752:
Make sure to return the result of meida change request.
Previously it used to return success regardless of the result.
r185753:
o Implemented miibus_statchg handler. It detects whether re(4)
established a valid link or not. In miibus_statchg handler add a
check for established link is valid one for the controller(e.g.
1000baseT is not a valid link for fastethernet controllers.)
o Added a flag RE_FLAG_FASTETHER to mark fastethernet controllers.
o Added additional check to know whether we've really encountered
watchdog timeouts or missed Tx completion interrupts. This change
may help to track down the cause of watchdog timeouts.
o In interrupt handler, removed a check for link state change
interrupt. Not all controllers have the bit and re(4) did not
rely on the event for a long time. In addition, re(4) didn't
request the interrupt in RL_IMR register.
r185756:
Reduce spin wait time consumed in GMII register access routines.
Waiting for 1ms for each GMII register access looks overkill and it
may also decrease overall performance of driver because re(4)
invokes mii_tick for every hz.
r185896:
Partly revert r185756. RTL8169SC doesn't like reduced delays in
GMII access while Tx/Rx is in progress.
Fix my previous commit. We actually should pass evaluation args in
AcpiEvaluateObject() calls, otherwise, we are not able to bring devices
back up (NULL means 0, hence always off).
While there add missing WLAN on/off support.
Without including bsd.own.mk KMODOWN/KMODGRP are not defined
which after r188288 broke installkernel.
Reported by: kib, Herbert J. Skuhra <[email protected]>
Reviewed by: kib
Pointy hat to: bz
Permit digits in the kernel config file names for `make universe'.
This catches a few more kernel config for various architectures
and permits having local configs named like NOINET6.
r186854
Using KMODOWN/KMODGRP rather than hard coding root/wheel for
installing the kernel allows one, like with modules, to override
the default user/group and install as non-su to a temporary
directory to test, create images or seed a tftp dir.
r186894
Document that we started using KMODOWN/KMODGRP for the kernel
as well and no longer only for modules.
Update jail startup script for multi-IPv4/v6/no-IP jails.
Note: this is only really necessary because of the ifconfig
logic to add/remove the jail IPs upon start/stop.
Consensus among simon and I is that the logic should
really be factored out from the startup script and put
into a proper management solution.
- We now support starting of no-IP jails.
- Implement jail_<jname>_ip options to support both
address familes with regard to ifconfig logic.
- Implement _multi<n> support suffix to the jail_<jname>_ip
option to configure additional addresses to avoid overlong,
unreadbale jail_<jname>_ip lines with lots of addresses.
Make SIOCGIFADDR and related, as well as SIOCGIFADDR_IN6 and related
jail-aware. Up to now we returned the first address of the interface
for SIOCGIFADDR w/o an ifr_addr in the query. This caused problems for
programs querying for an address but running inside a jail, as the
address returned usually did not belong to the jail.
Like for v6, if there was an ifr_addr given on v4, you could probe
for more addresses on the interfaces that you were not allowed to see
from inside a jail. Return an error (EADDRNOTAVAIL) in that case
now unless the address is on the given interface and valid for the
jail.
PR: kern/114325
r186956
Take the cred from curthread rather than curproc as curproc would need
locking but the credential from curthread (usually) never changes.
r186980
Restrict arp, ndp and theoretically the FIB listing (if not
read with libkvm) to the addresses of a prison, when inside a
jail.
While touching RTM_GET in route_output(), consistently use
curthread credentials rather than the creds from the socket
there.
r186986
Rather than using the cred from curthread, take it from the thread
referenced in the sysctl req argument.
r185435:
This enhances the current jail implementation to permit multiple
addresses per jail. In addtion to IPv4, IPv6 is supported as well.
Due to updated checks it is even possible to have jails without
an IP address at all, which basically gives one a chroot with
restricted process view, no networking,..
SCTP support was updated and supports IPv6 in jails as well.
Cpuset support permits jails to be bound to specific processor
sets after creation.
Jails can have an unrestricted (no duplicate protection, etc.) name
in addition to the hostname. The jail name cannot be changed from
within a jail and is considered to be used for management purposes
or as audit-token in the future.
DDB 'show jails' command was added to aid debugging.
Proper compat support permits 32bit jail binaries to be used on 64bit
systems to manage jails. Also backward compatibility was preserved where
possible: for jail v1 syscalls, as well as with user space management
utilities.
Both jail as well as prison version were updated for the new features.
A gap was intentionally left as the intermediate versions had been
used by various patches floating around the last years.
Bump __FreeBSD_version for the afore mentioned and in kernel changes.
r185441:
Unbreak the no-networks (no INET/6) build.
r185899:
Correctly check the number of prison states to not access anything
outside the prison_states array.
When checking if there is a name configured for the prison, check the
first character to not be '\0' instead of checking if the char array
is present, which it always is. Note, that this is different for the
*jailname in the syscall.
Found with: Coverity Prevent(tm)
CID: 4156, 4155
r186085:
Make sure that the direct jls invocations prints something
reasonable close to and in the same format as it had always.
r186606:
Make sure that unused j->ip[46] are cleared.
r186834:
Document the special loopback address behaviour of jails.
PR: kern/103464
r186841:
Put the devfs ruleset next to devfs enable, add a comment about
the suggested ruleset[1].
While here use an IP from the 'test-net' prefix for docs.
PR: kern/130102
r187059:
Add a short section talking about jails and file systems; mention the
mountand jail-aware file systems as well as quota.
PR: kern/68192
r187092:
Sort .Xr.
r187365:
s,unmount 8,umount 8, it is unmount(2) which I did not mean.
r187669:
Update the description of the '-h' option wrt to primary addresses
per address family and add a reference to the ip-addresses option.
r187670:
New sentence starts on a new line.
Alow dirname(1) to accept multiple arguments in the same way that
basename(1) does.
(Two different PRs contained identical patches, both cited below)
PR: 121520, 86148
Submitted by: Ighighi <ighighi at gmail dot com>
Submitted by: Leif Neland <leif at neland dot dk>
Add a new flag to dumpfs(8), -f, which causes dumpfs to list all free
fragments in the file system by fragment (block) number. This new
mode does the necessary arithmetic to generate absolute fragment
numbers rather than than the cg-relative numbers printed in the default
mode.
If -f is passed once, contiguous fragment ranges are collapsed into
an X-Y format as free block lists are currently printed in regular
dumpfs output, but if specified twice, all block numbers are printed
individually, allowing both compact and more script-friendly
representation.
This proves quite handy when attempting to recover deleted data, as it
allows exclusion of non-deleted data from blocks searched.
Discussed with: jeff, Richard Clayton <richard dot clayton at cl.cam.ac.uk>
Sponsored by: Google, Inc.
Print disk offets as %jd rather than %lld; I fixed one before committing
but missed the other, which breaks 64-bit builds.
Reported by: bf <bf2006a at yahoo dot com>
Reviewed by: mckusick
r183571:
Implement IPv4 source address selection for unbound sockets.
This also changes the semantics of selecting the IP for processes within
a jail as it now uses the same logic as outside the jail (with additional
checks) but no longer is on a mutually exclusive code path.
r186086:
With the special check for FreeBSD before 8 a destination route via
a loopback interface is treated as a valid and reachable thing for
IPv4 source address selection, even though nothing of that network
is ever directly reachable, but it is more like a blackhole route.
With this the source address will be selected and IPsec can grab the
packets before we would discard them at a later point, encapsulate them
and send them out from a different tunnel endpoint IP.
This is needed to not change the expected behaviour on a stable branch.
- Add private tx/rx buffer management to support large frame sizes and update
the rx code to handle multiple frames in a single usb transfer. AX772 parts
(at least) exhibit many input errors when operated with a 2K rx buffer and
no errors w/ a 4K rx buffer (it's unclear what the cause of the errors is
for 2K so this may just be covering up the real issue). Larger rx buffer
sizes show no significant performance improvement for AX772. Bypassing the
common buffer management routines also eliminates an extra context switch on
every packet which noticeably improves performance (TCP netperf rx goes from
45 Mb/s to 85 MB/s).
- Apply le*toh() or htole*() to the variables of which we use the address as
the buffer pointer in the call to axe_cmd(). This is needed to make the code
work on big-endian machines.
- Add support for the Apple USB Ethernet adapter. Work around the "latch in
at the first working PHY address hack", that fails for this adapter because
it returns 0xffff when reading from lower PHY addresses. Also add more
debugging printfs
Following a fair amount of real world experience with ACLs and
extended attributes since FreeBSD 5, make the following semantic
changes:
- Don't update the inode modification time (mtime) when extended
attributes (and hence also ACLs) are added, modified, or removed.
- Don't update the inode access tie (atime) when extended attributes
(and hence also ACLs) are queried.
This means that rsync (and related tools) won't improperly think
that the data in the file has changed when only the ACL has changed.
Note that ffs_reallocblks() has not been changed to not update on an
IO_EXT transaction, but currently EAs don't use the cluster write
routines so this shouldn't be a problem. If EAs grow support for
clustering, then VOP_REALLOCBLKS() will need to grow a flag argument
to carry down IO_EXT to UFS.
PR: ports/125739
Reported by: Alexander Zagrebin <[email protected]>
Tested by: pluknet <[email protected]>,
Greg Byshenk <[email protected]>
Discussed with: kib, kientzle, timur, Alexander Bokovoy <[email protected]>
If a process is a zombie and we couldn't identify another useful state,
print out the state as "zombine" in preference to "unknown" when ^T is
pressed.
Sponsored by: Google, Inc.
(Note that this change appears in tty.c in 7.x vs tty_info.c in 8.x)
Rename mbcnt to mbcnt_delta in uipc_send() -- unlike other local
variables named mbcnt in uipc_usrreq.c, this instance is a delta
rather than a cache of sb_mbcnt.
Break out single audit_pipe_mtx into two types of locks: a global rwlock
protecting the list of audit pipes, and a per-pipe mutex protecting the
queue.
Likewise, replace the single global condition variable used to signal
delivery of a record to one or more pipes, and add a per-pipe condition
variable to avoid spurious wakeups when event subscriptions differ
across multiple pipes.
This slightly increases the cost of delivering to audit pipes, but should
reduce lock contention in the presence of multiple readers as only the
per-pipe lock is required to read from a pipe, as well as avoid
overheading when different pipes are used in different ways.
Sponsored by: Apple, Inc.
When we drop an audit record going to and audit pipe because the audit
pipe has overflowed, drop the newest, rather than oldest, record. This
makes overflow drop behavior consistent with memory allocation failure
leading to drop, avoids touching the consumer end of the queue from a
producer, and lowers the CPU overhead of dropping a record by dropping
before memory allocation and copying.
Obtained from: Apple, Inc.
Add missing "goto set_head" for SO_IPX_CHECKSUM; otherwise we fall through
to the SO_HEADERS_ON_OUTPUT case and set that instead.
Found with: Coverity Prevent(tm)
Coverity ID: 3988
When repeatedly accessing a thread credential, cache the credential
pointer in a local thread. While this is unlikely to significantly
improve performance given modern compiler behavior, it makes the code
more readable and reduces diffs to the Mac OS X version of the same
code (which stores things in creds in the same way, but where the
cred for a thread is reached quite differently).
Discussed with: sson
Sponsored by: Apple Inc.
Obtained from: TrustedBSD Project
Protect the event->class lookup database using an rwlock instead of a
mutex, as it's rarely changed but frequently accessed read-only from
multiple threads, so a potentially significant source of contention.
Sponsored by: Apple, Inc.
The audit queue limit variables are size_t, so use size_t for the audit
queue length variables as well, avoiding storing the limit in a larger
type than the length.
Submitted by: sson
Sponsored by: Apple Inc.
- Use a separate pointer to the allocated memory for freeing, as strsep may
modify the pointer argument passed to it. This triggered an assert in malloc
when a geom command being run under the livefs environment.
PR: bin/130632
Submitted by: Dimitry Andric <dimitry -at- andric.com>
Add two more nVidia HDMI codec IDs.
Specify analog beep pin widget for several AD codecs.
It gives working speaker control for that systems.
Fix bug in hint.hdac.X.config parsing.
- Rename adding_user(8) to adding_user(7). There's no adding_user utility,
but the man page describes conceptual information about the process of
adding a user, thus it should belong to section 7.
- Remove HISTORY and BUGS sections because of the aforementioned reason.
PR: docs/130151
Submitted by: Marian Cerny <[email protected]>
Fix the code to conform to the "or more" part of the following POSIX
specification and regression test regress:25.
"A function can be preceded by one or more '!' characters, in which
case the function shall be applied if the addresses do not select
the pattern space."
Sometimes, depending on the bpf filter rules used in $PATTERN,
the example script of the manpage feeds awk(1) with values larger
than UINT32_MAX. Then awk prints a negative value, and this
messes up $BPFPROG. Trying to load the resulting bpf byte codes
with ngctl then fails.
For example, the output for PATTERN="udp and dst net 255.255.0.0/16"
should be (all in one line):
bpf_prog_len=10
bpf_prog=[
{ code=40 jt=0 jf=0 k=12 }
{ code=21 jt=7 jf=0 k=34525 }
{ code=21 jt=0 jf=6 k=2048 }
{ code=48 jt=0 jf=0 k=23 }
{ code=21 jt=0 jf=4 k=17 }
{ code=32 jt=0 jf=0 k=30 }
{ code=84 jt=0 jf=0 k=4294901760 }
{ code=21 jt=0 jf=1 k=4294901760 }
{ code=6 jt=0 jf=0 k=8192 }
{ code=6 jt=0 jf=0 k=0 }
]
The two k=4294901760 values are displayed as k=-2147483648 by awk.
Replace the awk script of the manpage example with a slower but
safer version, that doesn't really attempt to convert the byte
code printed by tcpdump from string to number and back.
PR: docs/123255
Submitted by: Eugenio Maffione, eugenio.maffione at telecomitalia.it
Allow the IP_MINTTL socket option to be set to 0 so that it can be
disabled entirely, which is its default state before set to a
non-zero value.
PR: 128790
Submitted by: Nick Hilliard <nick at foobar dot org>
Remove strict limitation on minimal multilink MRRU. RFC claims that MRRU
of 1500 must be supported, but allows smaller values to be negotiated.
Enforce specified MRRU for outgoing frames.
Check for infinite recursion possible on some broken PPTP/L2TP/... VPN setups.
Mark packets with mbuf_tag on first interface passage and drop on second.
PR: ports/129625, ports/125303
Use m_unshare()+m_copyback() instead of m_freem()+m_devget() to keep
original mbuf chain headers. It can be less efficient in some cases, but it
looks better then mess of copying headers into the nonempty chain.
Add an example of using bs=2048 to duplicate data CD-ROMs.
This should be a bit useful for users who look at the manpage and
then try to copy data CD-ROM disks using dd. A lot of us know
that bs=2048 is required, but it still manages to cause a bit of
grief to those who haven't heard about it.
PR: bin/130857
Submitted by: Tri Brotoharsono < mail at tribrotoharsono.net >
The struct inode *ip supplied to softdep_freefile is not neccessary the
inode having number ino. In r170991, the ip was marked IN_MODIFIED, that
is not quite correct.
Mark only the right inode modified by checking inode number.
When the insmntque() in the pfs_vncache_alloc() fails, vop_reclaim calls
pfs_vncache_free() that removes pvd from the list, while it is not yet
put on the list.
Prevent the invalid removal from the list by clearing pvd_next and
pvd_prev for the newly allocated pvd, and only move pfs_vncache list
head when the pvd was at the head.
vm_map_lock_read() does not increment map->timestamp, so we should
compare map->timestamp with saved timestamp after map read lock is
reacquired, not with saved timestamp + 1. The only consequence of the +1
was unconditional lookup of the next map entry, though.
After the pfs_vncache_mutex is dropped, another thread may attempt to
do pfs_vncache_alloc() for the same pfs_node and pid. In this case, we
could end up with two vnodes for the pair. Recheck the cache under the
locked pfs_vncache_mutex after all sleeping operations are done.
Do not call free() on the struct pfs_vdata after insmntque() failure,
because vp->v_data points to the structure, and pseudofs_reclaim()
frees it by the call to pfs_vncache_free().
MFC r186981 (by marcus):
vput the vnode.
- Asia/Katmandu -> Asia/Kathmandu
- Fix historical references to DST in Switzerland
- Correct rules for America/Resolute (Nunavut)
- Cuba didn't have DST in 2005.
Do not call namei() while having another user-controlled vnode
locked. Lookup could attempt to recursively lock that vnode.
Do not call vn_start_write(V_WAIT) while vnode is locked, this may
result in a deadlock with suspension.
vfs_busy() the mountpoint before dropping vnode lock for vnode
that was used to look up the mountpoint, to prevent unmount in
between.
Clear the pointers to the file in the struct filedesc before file is closed
in fdfree. Otherwise, sysctl_kern_proc_filedesc may dereference stale
struct file * values.
bitmaps. Prior to this change, hostap would queue packets for power-saved
stations but not indicate in the beacon that the station should wake up
and poll for those queued packets.
Reviewed by: sam
Remove Giant locking from domains list.
During boot, the domain list is locked with Giant. It is not possible to
register any protocols after the system has booted, so the lock is only
used to protect insertion of entries.
There is already a mutex in uipc_domain.c called dom_mtx. Use this mutex
to lock the list, instead of using Giant. It won't matter anything with
respect to performance, but we'll never get rid of Giant if we don't
remove from places where we don't need it.
Approved by: rwatson
MFC after: 3 weeks
Remove unused variable nosleepwithlocks.
PR: 126609
Submitted by: Mateusz Guzik
MFC after: 1 month
X-MFC: to stable/7 only, this variable is still used in stable/6
Reviewed by: rwatson
Add a -w warning flag to ln(1). When the -w option is enabled,
ln(1) checks to see if the source of a symlink, i.e. the file it
should point to actually exists. The default is the old ln
behavior, that does not check, to avoid surprising people who may
be using ln(1) in scripts or other non-interactive places.
PR: bin/7265
Submitted by: Joel Ray Holveck, detlev!joelh at mail.camalott.com
Express in the usage() and SYNOPSIS that -F depends on -s, and
that -f and -i are exclusive.
This reduces diffs of stable/7 from /head, in preparation for more MFCs.
Add 32-bit compat support for AIO.
As I had comitted this as a fix for r185878 in HEAD, it seems
this was missed with the MFC at r187559. Unbreak the build.
- Remove a redundant MOD_LOAD function
- Reduce the attach priority for the attach function to give other
drivers, like the to be committed u3g driver a better chance at
attaching to the 3G devices with a ZeroCD / TruInstall mass storage
device.
- Revive fdc(4) per-device flag 0x10, which was removed in r1.284[1].
- If the flag is set and auto-select fails, assume disk is not present.
- Set disk empty flag only when the floppy controller reset is needed.
It fixes regression introduced in r1.311, which prevented it from ignoring
errors. Now fdformat(1) and dd(1) with conv=noerror option can continue
when read/write errors occur as they should.
- Do not retry disk probing as it is extremely slow and pointless.
- Move the disk probing code into a separate function.
- Do not reset disk empty flag if write-protect check fails somehow.
PR: kern/116538[1]
Initialize birthtime fields in vn_stat() to prevent stat(2) from
returning uninitialized birthtime. Most file systems don't initialize
birthtime properly in their VOP_GETTATTR().
MFC r183212:
Initialize va_flags and va_filerev properly in VOP_GETATTR(). Don't
initialize va_vaflags and va_spare because they are not part of the
VOP_GETATTR() API. Also don't initialize birthtime to ctime or zero.
MFC rr183213:
Initialize va_rdev to NODEV and va_fsid to VNOVAL before the
VOP_GETATTR() call in vn_stat(). Thus if a file system doesn't
initialize those fields in VOP_GETATTR() they will have a sane default
value.
MFC r183214:
Initialize va_rdev to NODEV instead of 0 or VNOVAL in VOP_GETATTR().
NODEV is more appropriate when va_rdev doesn't have a meaningful value.
MFC r183215:
fdescfs, devfs, mqueuefs, nfs, portalfs, pseudofs, tmpfs and xfs
initialize the vattr structure in VOP_GETATTR() with VATTR_NULL(),
vattr_null() or by zeroing it. Remove these to allow preinitialization
of fields work in vn_stat(). This is needed to get birthtime initialized
correctly.
static tables, then attempt to build a simple list containing just the high
and low frequencies if the hw.est.msr_info tunable is set to 1. By default
this is disabled.
Make pmap_is_prefaultable() more TLB friendly. Specifically, make it use
the kernel's direct map instead of the pmap's recursive mapping to access
the lowest level in the page table.
Optimize pmap_pml4e() and pmap_pdpe() based upon two observations: The
given pmap is never NULL, and therefore pmap_pml4e() can never return
NULL. The pervasive use of these inline functions throughout the pmap
makes these simple changes worthwhile.
Fix REDZONE(9) on amd64 and perhaps other 64 bit targets -- ensure the
space that redzone adds to the allocation for storing its metadata is at
least as large as the metadata that it will store there.
PR: kern/128744
obsoleted by Peter's rewrite of the pv entry allocator. To avoid ABI
breakage, the field in 'struct mdpage' has not been removed, but it has
been renamed to 'pv_unused'.
with UFS and enable shared lookups for UFS.
- Change the name cache to fail lookups with EBADF if a directory vnode
is recycled while it waits for a lock upgrade.
- Rework the locking of the dirhash to use an sx lock and reference count
on each hash structure. Using an sx lock instead of a mutex allows the
lock to be held across disk I/O closing a number of races when using
shared vnode locks that were previously handled by exclusive vnode
locks.
- Remove the 'i_ino' and 'i_reclen' fields from the i-node. i_ino is now
a local variable in ufs_lookup(), and i_reclen is not needed since
ufs_dirremove() always has the entire block holding the directory
entry in memory when it updates the directory.
- 'i_diroff' and 'i_offset' are now local variables in ufs_lookup().
'i_diroff' is updated after a successful lookup.
- Only set i_offset in the parent directory's i-node during a lookup for
non-LOOKUP operations.
- Remove the LOOKUP_SHARED option. One can set vfs.lookup_shared to 1
in either loader.conf or sysctl.conf instead. The default setting for
vfs.lookup_shared is not changed and remains off by default.
Increase the size of the kernel virtual address space to 6GB.
Increase the ceiling on the kmem map's size to 3.6GB. Also, define the
ceiling as a fraction of the kernel map's size rather than an absolute
quantity. Thus, scaling of the kmem map's size will be automatic with
changes to the kernel map's size.
Prepare for a larger kernel virtual address space. Specifically, once
KERNBASE and VM_MIN_KERNEL_ADDRESS are no longer the same, the physical
memory allocated during bootstrap will be offset from the low-end of the
kernel's page table.
Change create_pagetables() and pmap_init() so that many fewer page table
pages have to be preallocated by create_pagetables().
Eliminate pmap_growkernel()'s dependence on create_pagetables() preallocating
page directory pages from VM_MIN_KERNEL_ADDRESS through the end of the
kernel's bss. Specifically, the dependence was in pmap_growkernel()'s one-
time initialization of kernel_vm_end, not in its main body. (I could not,
however, resist the urge to optimize the main body.)
Reduce the number of preallocated page directory pages to just those needed
to support NKPT page table pages. (In fact, this allows me to revert a
couple of my earlier changes to create_pagetables().)
Fix lines that are too long in pmap_growkernel() by substituting shorter
but equivalent expressions.
Provide a legitimate pindex to vm_page_alloc() in pmap_growkernel()
instead of writing apologetic comments.
Correct a nearby style error: Pointers should be compared to NULL.
Don't cross-reference gem(4) and hme(4); maybe this made some sense
back when these two were the only two NIC drivers working on sparc64
but it no longer does nowadays.
Mention support for the 5722 driver in bge.4 as well.
- MFC: 187315
Sync the description of jumbo frame support with reality as of r187309;
it's also supported with BCM5702 (matched by BGE_ASICREV_BCM5703) but
bge(4) currently doesn't with neither BCM5714 nor BCM5780.
Strictly speaking, the definition of VM_MAX_KERNEL_ADDRESS is wrong.
However, in practice, the error (currently) makes no difference because
the computation performed by KVADDR() hides the error. This revision
fixes the error.
Also, eliminate a (now) unused definition.
Make preparations for increasing the size of the kernel virtual
address space on the amd64 architecture:
Rev 180333, ``Change create_pagetables() and pmap_init() so that many
fewer page table pages have to be preallocated ...'', violates an
assumption made by minidumpsys(): kernel_vm_end is the highest virtual
address that has ever been used by the kernel. Now, however, the kernel
code, data, and bss may reside at addresses beyond kernel_vm_end. This
revision modifies the upper bound on minidumpsys()'s two page table
traversals to account for this possibility.
- Fix an issue with access permissions to underlying disks used by a gvinum
plex. If the plex is a raid5 plex, and is being written to, parity data might
have to be read from the underlying disks, requiring them to be opened for
reading as well as writing.
KERNBASE is not necessarily an address within the kernel map, e.g.,
PowerPC/AIM. Consequently, it should not be used to determine the maximum
number of kernel map entries. Instead, use VM_MIN_KERNEL_ADDRESS, which
marks the start of the kernel map on all architectures.
Try to look for MAC address in all SA registers, not only in the
first one. U-boot, for example, uses the second register to store
MAC.[1]
Use random MAC address if none configured instead of failing.
Submitted by: Bjorn Konig <[email protected]> [1]
Get rid of unused variable in KTR checks. This allows ktr(4) enabled
ARM kernel to compile.
PR: rm/128897
Submitted by: Pankov Pavel <[email protected]>
Extend the struct vm_page wire_count to u_int to avoid the overflow of
the counter, that may happen when too many sendfile(2) calls are being
executed with this vnode.
To keep the size of the struct vm_page and offsets of the fields
accessed by out-of-tree modules, swap the types and locations of the
wire_count and cow fields. Add safety checks to detect cow overflow and
force fallback to the normal copy code for zero-copy sockets.
Change configuration order to enable output only after codec is configured.
Mute all mixer controllable amplifiers initially to let mixer to unmute
only some of them later. This should reduce clicks and noises during boot.
Improve AD1983 codec support:
- force playback via mixer to get PCM volume control,
- make cleanup on recoring source selection.
- Use bus_{read,write}_*(9) instead of bus_space_{read,write}_*(9) etc
and take advantage of rman_get_rid(9) in order to save some softc
members.
- Provide and consume module dependency information for lebuffer(4).
Do as the Linux tg3 driver does and enable MSI support also
for the BCM5714 revision A0 when in a multi-port configuration
and unconditionally for the remainder of the class of BCM575X
and beyond chips.
- Don't read the identifier string from the VPD if there's no chip
containing an Ethernet address fitted as this is yet another thing
that fails in that case in order to avoid the one second delay
until pci_read_vpd_reg() times out.
- Const'ify the bge_devs array.
Add a -L option to wc(1), for finger compatibility with the GNU
wc utility. The -L option can be used to report the length of
the longest line wc has seen in one or more files. It is
disabled by default, and wc uses the standard `-lwc'.
Submitted by: Sheldon Givens, sheldon at sigsegv.ca
Repeat vmstat header after window.rows instead of a hardcoded 20.
Use ioctl() to get the window size in vmstat(8), and force a new
header to be prepended to the output every time the current window
size changes. Change the number of lines before each header to the
current lines of the terminal when the terminal is resized, so that
the full terminal length can be used for output lines.
Add two example regexps: (1) one for matching all the characters
that belong in a character class, and (2) one for matching all
the characters *not* in a character class.
Submitted by: Mark B, mkbucc at gmail.com
Implement from scratch a -l option for du(1), to match the same option
of the GNU utility. The default behavior of our original `du' is to
count hardlinked files only once for each invocation of the utility.
With the new -l option they count towards the final size every time
they are found.
Repeat iostat header after rows-3 instead of a hardcoded 20.
Use ioctl() to get the window size in iostat(8), and force a new
header to be prepended to the output every time the current
window size changes. Change the number of lines before each
header to `rows - 3' when the terminal is resized, so that the
full terminal length can be used for output lines.
* Expand the example descriptions, fix mdoc-bugs in "(-a and -t
vnode are implied)" and reuse it near the cd9660 example.
* Spell 'backing store' as two words.
Check the return values of contigmalloc(9) as well as bus_dma(9)
functions and stop attaching of dcons(4) and dcons_crom(4) if
they indicate failure. This fixes a panic seen on sparc64 machines
with no free physical memory in the requested 32-bit region but
still doesn't make dcons(4)/dcons_crom(4) these work.
Given that the buffer dcons_crom(4) exposes is used for both input
and output, set BUS_DMA_COHERENT when creating the DMA map used for
loading the buffer. As a side-effect this solves locking issues on
sparc64 when dcons(4) calls bus_dmamap_sync(9) while in an interrupt
filter, which are executed in a critical section, and iommu(4) has
to use a sleep lock when taking advantage of the streaming buffer.
Reported and tested by: kensmith
Approved by: simokawa
misc fixes and cleanup of the Forth scripts used by the loader,
see the original commits for details.
The only visible change is that now setting
loader_conf_files="foo bar ${some.var}"
works as expected, and expands variables correctly.
Also, ${variables} can be used consistently in all assignments
in *.conf files managed by the loader.
NOTE: this commit has nothing to do with the pxeboot and /boot/loader
problems that people are seeing on 6.4 and 7.2 -- those are related
to issues with the loader code, not with the scripts that the
loader processes.
- Remove snd_au88x0 which seems never got compiled into kernel nor as a kernel
module. These files cause manual interaction when building
ports/audio/aureal-kmod which provides a usable i386-only driver (it requires
linking against some linux object files distributed by vendor which bankrupted
back in 2000).
MFC after: 1 week
PR: 124343
various cleanups including:
+ check a possible buffer overflow when creating a temp file,
submitted by Christoph Mallon
+ remove stale struct definitions
+ clarify the use of dflag and remove useless checks
+ Make the linker.hints file have mode 644 instead of 600.
+ fix a couple of innocuous compiler warnings
+ correct description of how a string is stored, fix a few
typos and reference the kernel file which processes this info.
Some libstand/bootp.c extension (written by Danny Braniss, slightly
revised/modified by me) to store dhcp options into kenv variables,
so the information is available to the boot loader and can be used
to customize the boot process.
and matching modifications to boot0cfg.
The most noticeable features are preserving the 4-byte volume ID
that certain Windows versions put in the MBR, and an option (F6)
to boot through INT18 that on some modern BIOSes invokes PXE.
Add external connector jack color into widget names.
It should help users to identify them while reading verbose messages.
Add one more bunch of controller and codec IDs.
Fix unwanted crosschannel mixing, possible on some codecs like
VIA VT1708B and Realtek ALC268.
First revision of usr.sbin/cpucontrol was
merged directly into usr.sbin since there're
no such directory in stable/7 yet. Subsequient
changes went into usr.sbin/cpucontrol.
Approved by: kib (mentor)
Since we don't request reset for rlphy(4), the link state 'UP'
event from mii(4) may not be delivered if valid link was already
established. To address the issue, check current link state after
driving MII_TICK. This should fix a regression introduced in
r184245.
r184245:
Implement miibus_statchg handler. It detects whether rl(4)
established a valid link or not.
In rl_start_locked, don't try to send packets unless we have valid
link. While I'm here add a check that verifies whether driver can
accept Tx requests by inspecting IFF_DRV_OACTIVE/IFF_DRV_RUNNING
flag.
r185575:
Update if_iqdrops instead of if_ierrors when m_devget(9) fails.
r184241:
Don't rearm watchdog timer in rl_txeof(). The watchdog timer was
already set in rl_start_locked(). Touching the watchdog timer in
other places will hide the root cause of watchdog timeouts.
r184282:
Make rl_init_locked() call rl_reset. This will put hardware into
sane state after resume/watchdog timeouts.
r184283:
After sending stop command to MAC, give hardware chance to drain
active DMA operation.
Various bus_dma(9) fixes.
- The hardware does not support DAC so limit DMA address space to
4GB.
- Removed BUS_DMA_ALLOC_NOW flag.
- Created separated Tx buffer and Rx buffer DMA tags. Previously
it used to single DMA tag and it was not possible to specify
different DMA restrictions.
- Apply 4 bytes alignment limitation of Tx buffer.
- Apply 8 bytes alignment limitation of Rx buffer.
- Tx side bus_dmamap_load_mbuf_sg(9) support.
- Preallocate Tx DMA maps as creating DMA maps take very long time
on architectures that require real DMA maps.
- Adjust guard buffer size to 1522 + 8 as it should include VLAN
and additional reserved bytes in Rx buffer.
- Plug memory leak in device detach. Previously wrong buffer
address was used to free allocated memory.
- Added rl_list_rx_init() to clear Rx buffer and cleared the
buffer.
- Don't destroy DMA maps in rl_txeof() as the DMA map should be
reused. There is no reason to destroy/recreate the DMA maps in
this driver.
- Removed rl_dma_map_rxbuf()/rl_dma_map_txbuf() callbacks.
- The hardware does not support descriptor based DMA on Tx side
and the Tx buffer address should be aligned on 4 bytes boundary
as well as manual padding for short frames. Because of this
hardware limitation rl(4) always used to invoke m_defrag(9) to
get a 4 bytes aligned single buffer. However m_defrag(9) takes
a lot of CPU cycles on slow machines and not all packets need
the help of m_defrag(9). Armed with the information, don't
invoke m_defrag(9) if the following conditions are true.
1. Buffer is not fragmented.
2. Buffer is aligned on 4 bytes boundary.
3. Manual padding is not necessary.
4. Or padding is necessary but upper stack passed a writable
buffer and the space needed for padding is satisfied.
This change combined with preallocated DMA maps greatly
increased Tx performance of driver on sparc64.
- Moved bus_dmamap_sync(9) in rl_start_locked() to rl_encap() and
corrected memory synchronization operation specifier of
bus_dmamap_sync(9).
- Removed bus_dmamap_unload(9) in rl_stop(). There is no need to
reload/unload Rx buffer as rl(4) always have to copy from the
buffer. It just needs proper bus_dmamap_sync(9) calls before
copying the received frame.
With this change rl(4) should work on systems with more than 4GB
memory.
PR: kern/128143
Fix Rx/Tx checksum offload ioctl handling. Now checksum offload
can be controlled by ifconfig(8). Note, VLAN hardware tagging
controls still lacks required handler but it requires more driver
cleanups so I didn't touch that part.
PR: kern/128766
Add support for newer JMC250/JMC260 revisions.
o Chip full mask revision 2 or later controllers have to
set correct Tx MAC and Tx offload clock depending on negotiated
link speed.
o JMC260 chip full mask revision 2 has a silicon bug that can't
handle 64bit DMA addressing. Add workaround to the bug by
limiting DMA address space to be within 32bit.
o Valid FIFO space of receive control and status register was
changed on chip full mask revision 2 or later controllers. For
these controllers, use default 16QW as it's supposed to be the
safest value for maximum PCIe compatibility. JMicron confirmed
performance will not be reduced even if the FIFO space is set
to 16QW.
o When interface is put into suspend/shutdown state, remove Tx MAC
and Tx offload clock to save more power. We don't need Tx clock
at all in this state.
o Added new register definition for chip full mask revision 2 or
later controllers.
Allow multiple makeoption lines to be used with the += operator, this permits
the following syntax in the kernel config.
makeoptions MODULES_OVERRIDE=foo
makeoptions MODULES_OVERRIDE+=bar
makeoptions MODULES_OVERRIDE+=baz
Bump config minor version to 600007.
Save extended address register prior to switching to 1000BASE-X
only mode and restore original value of extended address register
instead of overwriting it with page 1. There are still instance
information passing issue(e.g configured media type: fiber or
copper) from driver to PHY layer but this change make the selected
PHY work with 88E1112 PHY.
Reported by: Krzysztof Jedruczyk < beaker <at> hot dot pl >
Tested by: Krzysztof Jedruczyk < beaker <at> hot dot pl >
r183492:
Add Vitesse VSC8211 PHY which is found on Planex GU-1000T.
HW donated by: nork
r184192:
Correct PHY description and OUI of VSC8211. Previously VSC8211 was
not recognized by ciphy(4) due to the incorrect OUI.
Reported by: nork
Tested by: nork
r183488:
Announce link loss right after it happens.
r183489:
Use mii_anegticks instead of hardcoded MII_ANEGTICKS.
r183490:
Report current link state while auto-negotiation is in progress.
r183491:
Explicitly mark IFM_HDX for half-duplex media.
By default assume a 8139 chip if the EEPROM contents prove inconclusive.
The same LOM hardware with goofed-up EEPROM programming also needed reading
the Ethernet address from the chips registers as the EEPROM did not have a
sensible address programmed.
Patch developed by: pyun@
Funky hardware on loan: www.id-it.nl
Improve periodic/security/550.ipfwlimit a bit:
- don't run it if net.inet.ip.fw.verbose = 0 as it is pointless
- handle rules without logging limit correctly [1]
(those rules show up without logamount in "ipfw -a list")
PR: conf/126060 [1]
MFC after: 1 month
- Spell cam correctly (scbus), this makes it possible to compile hptiop
in GENERIC and LINT. [1]
- Rename hpt_dbg_level to hpt_iop_dbg_level to avoid multiple definition
of hpt_dbg_level (hptmv also has hpt_dbg_level).
PR: 127551 [1]
Reviewed by: scottl@
MFC after: 1 month
Merged /head/sys:r186295,186299-186300,186386,186465
This brings 7 up to date with HEAD.
- Use bus_dma to allocate scatter/gather pages for pci GART.
This fixes "garbled" screen issues on pci based radeons.
- Prevent drm from attaching to secondary devices even if they
have the the same pci id.
- Attempt at making DRM_DEBUG c99 compliant (needs more work)
Approved by: kib
This brings in the following:
Merged /head/sys:r182080,182467-182469,182883-182884,183573,
183603-183605,183828,183830-183834,184212-184213,184263,
184373-184375
- Support for latest Intel chips
- Support and fixes for many AMD/ATI chips r500 and below
- Support AMD/ATI IGP based chips (rs690/rs485)
- Lots of code cleanups
- Lots of other fixes and changes since the existing drm
is 2+ years old
Approved by: kib
1. Make it more SMP polite. Previous version uses average CPU load that
often leads to load underestimation. It make powerd with default
configuration unusable on systems with more then 2 CPUs. I propose to use
summary load instead of average one. IMO this is the best we can do without
specially tuned scheduler. Also as soon as measuring total load on SMP
systems is more useful then total idle, I have switched to it.
2. Make powerd's operation independent from number and size of frequency
levels. I have added internal frequency counter which translated into real
frequencies only on a last stage and only as good as gone. Some systems may
have only several power levels, while others - many of them, so adaptation
time with previous approach was completely different.
3. As part of previous I have changed adaptive mode to rise frequency on
demand up to 2 times and fall on 1/8 per time internal.
4. For desktop (AC-powered) systems I have added one more mode - "hiadaptive".
It rises frequency twice faster, drops it 4 times slower, prefers twice
lower CPU load and has additional delay before leaving the highest frequency
after the period of maximum load. This mode was specially made to improve
interactivity of the systems where operation capabilities are more
significant then power consumption, but keeping maximum frequency all the
time is not needed.
5. I have reduced default polling interval from 1/2 to 1/4 of second.
It is not so important for algorithm math now, but gives better system
interactivity.
6. Restore original frequency on exit.
7. getopt(3) returns -1, not EOF.
Discussed on: mobile@
We can't implicitly trust the hook on NGQF_FN/NGQF_FN2 processing in
ng_apply_item(). There are possible (and I have got one) use-after-free
class panics because of it.
If hook is specified, require it to be valid at the apply time. The only
exceptions are the internal ng_con_part2(), ng_con_part3() and
ng_rmhook_part2() functions which are specially made to work with invalid
hooks.
Add ability to generate egress netflow instead or in addition to ingress.
Use mbuf tagging for accounted packets to not account packets twice when
both ingress and egress netflow enabled.
To keep compatibility new "setconfig" message added to control new
functionality. By default node works as before, doing only ingress
accounting without using mbuf tags.
Reviewed by: glebius
If possible, try to obtain max_mhz on cpufreq attach instead of first request.
On HyperThreading CPUs logical cores have same frequency, so setting it
on any core will change the other's one. In most cases first request
to the second core will be the "set" request, done after setting frequency
of the first core. In such case second CPU will obtain throttled frequency
of the first core as it's max_mhz making cpufreq broken due to different
frequency sets.
and 186677:186749:
o Removal of 184781, 184804, and 184832 (automatic installation of files
that differ only by VCS Id)
o Fix cross-platform builds
o Various improvements to the mtree (-U) feature
o Remove the last of the MAKEDEV stuff
o Switch to using the top level (e.g., /usr/src) Makefile, and specify
that we should use the *.mk files from the source directory instead of
the installed versions.
o Check for the deprecated 'nodev' option in /etc/fstab
o Add support for the IGNORE_FILES variable
o Before installing a file check to make sure that the target does not
already exist as a directory
o Check to be sure that the file installed and error out if not
o We only need to check for the presence of the target of $PAGER
if that variable is actually set
Change the static struct sysentvec and struct Elf_Brandinfo initializers
to the C99 style.
Explicitely initialize sysentvec.sv_maxssiz that was missed in most
sysvecs.
Order the str*.c files mostly alphabetical.
MFC r185690:
Import the strndup(3) function.
MFC r185777:
Add strndup(3) prototype to string.h. Manually change
#undef HAVE_STRNDUP to #define HAVE_STRNDUP 1 for the configure.h
files that need it.
style(9) fixes.
Fixed style issues with variable ordering and naming, spacing and
parentheses.
Fixed alignment issue in gr_dup() in its assignment of gr_mem using a
struct to force alignment without performing alignment mathematics.
This
was noticed recently with libutil was built with WARNS=6 on platform
such
as sparc64.
Added checks to gr_dup(), gr_equal() and gr_make() to prevent segfaults
when examining struct group's with the struct members pointing to
NULL's.
Unlike r185237, did not enable WARNS?=6 since other changes would need
to be MFC'd first.
Reviewed by: des
long commands into multiple requests. [09:01]
Fix incorrect OpenSSL checks for malformed signatures due to invalid
check of return value from EVP_VerifyFinal(), DSA_verify, and
DSA_do_verify. [09:02]
Security: FreeBSD-SA-09:01.lukemftpd
Security: FreeBSD-SA-09:02.openssl
Obtained from: NetBSD [SA-09:01]
Obtained from: OpenSSL Project [SA-09:02]
Approved by: so (simon)
This update gives:
- multiple codec per HDA bus support;
- multiple functional groups per codec support;
- multiple audio devices per functional group support;
- digital (SPDIF/HDMI) audio input/output support;
- better UAA specification compliance with wide configureability;
- headphones redirection controlled by UAA configuration instead of quirks;
- improved codec parser, that gives working playback and recording with all
of the long list of tested codecs and systems;
- suspend/resume support;
- part of multichannel audio support (requires OSS improvement to be used);
Note, that due to added HDMI audio and logical audio devices support, updated
driver often provides several PCM devices. In some cases it can make system
default audio device no longer corresponding to the users's habbitual audio
connectors. In such cases wanted device can be specified in audio application
setup or defined globally via hw.snd.default_unit sysctl according to
sound(4) man page.
Additional information information about driver operation can be obtained
from the updated man page and verbose boot messages.
PR: kern/119181, kern/120144, kern/117599, kern/117729,
kern/119671, kern/124645, kern/125822, kern/126217,
kern/127105
In r185557, the check for existing negative entry for the given name
did not compared nc_dvp with supplied parent directory vnode pointer.
Add the check and note that now branches for vp != NULL and vp == NULL
are the same, thus can be merged.
Tested by: kensmith
Carefully handle memory errors to keep peers compression/encryption state
consistent. There are some cases reported where peers fatally getting out
of sync without any visible reason. I hope this solve the problem.
Unroll two loops of SHA1Update(). 60 bytes of static memory is not a price.
Avoid 256 integer divisions per rc4_init() call. Replace it with using
separate index variable.
It gives more then double rc4_init() performance increase on tested i386 P4.
It also gives about 15% speedup to PPTP VPN with stateless MPPE encryption
(by ng_mppc) which calls rc4_init() for every packet.
Fix up handling of Intel G4X chips some more.
Note that you need at least xf86-video-intel 2.4.3 for this to work.
The G4X doesn't put the GATT into the same area of stolen memory
as all the other chips and older versions of the driver didn't
handle that properly.
Approved by: kib
- Whenever a password/shell is changed via rpc.yppasswdd, the daemon leaves
one zombie process because it does not do the cleanup. For a long running
NIS/YP server, it will have lots of zombie processes on it. Fix that by
ignoring the SIGCHLD signal since we don't really care about the exit
status in this case.
PR: bin/91980
Reported by: Arjan van der Velde <dj_noresult at hotmail.com>
Submitted by: Jui-Nan Lin" <jnlin at csie.nctu.edu.tw>
Reviewed by: delphij
- Bump version numbers.
- Document Errata items for 7.1R:
em(4) -> igb(4) change,
ae(4) missing in 7.1R relnotes, and
s/get_setaffinity()/sched_setaffinity()/ in 7.1R relnotes.
Approved by: re (implicit)
long commands into multiple requests. [08:12]
Avoid calling uninitialized function pointers in protocol switch
code. [08:13]
Merry Christmas everybody...
Approved by: so (cperciva)
Approved by: re (kensmith)
Security: FreeBSD-SA-08:12.ftpd, FreeBSD-SA-08:13.protosw
of FreeBSD.
These changes provide the following features:
Allow users of more than one Firewire board to execute commands
Allow users to pass more than one command line argument at a time
Provide NetBSD code support
Cleanup Mergeinfo and mark the branch in sync
Reviewed by: slong ([email protected]) Mentor
Approved by: re Ken ([email protected])
Make sure we are maintaining the reference count on the route eliminating
another:
rtfree: 0xc841ee88 has 1 refs
Reviewed by: bz
Approved by: re@ (gnn)
Do not segfault when procstat -f or procstat -v is called on a process not
owned by the current user. If kinfo_getfile() or kinfo_getvmmap() return
NULL, simply exit, and do not try and derefernce the memory.
Approved by: re (kib)
Initialize the cntp pointer to 0 prior to doing any work so that callers
don't try to iterate through garbage or NULL memory. Additionally, return
NULL instead of 0 on error.
Approved by: re (kib)
The userland_sysctl() function retries sysctl_root() until returned
error is not EAGAIN. Several sysctls that inspect another process use
p_candebug() for checking access right for the curproc. p_candebug()
returns EAGAIN for some reasons, in particular, for the process doing
exec() now. If execing process tries to lock Giant, we get a livelock,
because sysctl handlers are covered by Giant, and often do not sleep.
Break the livelock by dropping Giant and allowing other threads to
execute in the EAGAIN loop.
This commit does not merge the following change, as was discussed with jhb:
[Also, do not return EAGAIN from p_candebug() when process is executing,
use more appropriate EBUSY error.]
MFC r185987:
Uio_yield() already does DROP_GIANT/PICKUP_GIANT, no need to repeat this
around the call.
Approved by: re (kensmith)
Make two style changes to create new commit and document proper commit
message for r185765.
Commit message for r185765 should be:
In procfs map handler, and in linprocfs maps handler, do not call
vn_fullpath() while having vm map locked. This is done in anticipation
of the vop_vptocnp commit, that would make vn_fullpath sometime
acquire vnode lock.
Also, in linprocfs, maps handler already acquires vnode lock.
MFC r185864:
Relock user map earlier, to have the lock held when break leaves the
loop earlier due to sbuf error.
Approved by: re (kensmith)
> Handle VFS_VGET() failing with an error other than EOPNOTSUPP in addition
> to failing with that error.
>
> PR: 125149
> Submitted by: Jaakko Heinonen (jh <at> saunalahti <dot> fi)
> Reviewed by: mohans, kan
Approved by: re (kib)
Don't count InFramesL2FilterDiscards into Ierr. This value does not represent
a real packet error but simply indicate that an unexpected unicast or multicast
error was received by the NIC, which was not counted in the past as well.
Reported by: many (on -stable@)
Reviewed by: davidch
Approved by: re (kensmith)
Test whether sc->tx_mbuf_map[i], not whether sc->tx_mbuf_map is NULL before
doing bus_dmamap_sync() since it operates on the former, not the latter.
Approved by: re (kensmith)
Update our resolver to BIND 9.4.3.
Merge the resolver part of BIND 9.4.3 into HEAD.
It includes the following fix:
2426. [bug] libbind: inet_net_pton() can sometimes return the
wrong value if excessively large netmasks are
supplied. [RT #18512]
Reported by: Maksymilian Arciemowicz <cxib__at__securityreason.com>
Approved by: re (kib)
Update the list of Intel chips with EM64T for FreeBSD/amd64 and
increase the known maximum memory configuration from 8gb to 32gb.
Approved by: re (hrs)
- According to the corresponding Linux, NetBSD and OpenSolaris
drivers, there should be a 1us delay after every write when
bit-banging the MII. Also insert barriers in order to ensure
the intended ordering. These changes hopefully will solve the
bus wedging occasionally experienced with DM9102A since r182461.
- Deobfuscate dc_mii_readreg() a bit.
Approved by: re (kib)
causes data corruption in combination with certain bridges.
Information about this problem was kindly provided by davidch. [1]
- As BGE_FLAG_PCIX is meant to indicate that the controller is in
PCI-X mode, revert to the pre __FreeBSD_version 602101 method of
reading the bus mode register rather than checking the mere
existence of a PCI-X capability, which is also there when the
NIC f.e. is put into a 32-bit slot causing it not to be in PCI-X
mode. Setting BGE_FLAG_PCIX inappropriately could cause the NIC
to be tuned incorrectly.
PR: 128833 [1]
Reviewed by: jhb
Approved by: re (kib)
this like I should have been. Mis-understanding is cleared up I think.
Change default operating system for upcoming release. Add release names
not in contrib/groff/tmac/doc-common yet.
Submitted by: ru
Approved by: re (implicit)
Move flag definitions for t_flags and t_oobflags below the definition of
struct tcpcb so that the structure definition is a bit more vertically
compact. Can't yet fit it on one printed page, though.
Approved by: re (gnn)
Update comment on INP_TIMEWAIT to say what it's about, as we caution
regarding the misplacement of flags in inp_vflag in an earlier comment.
Approved by: re (gnn)
Move macros defining flags and shortcuts to nested structure fields in
inpcbinfo below the structure definition in order to make inpcbinfo
fit on a single printed page; related style tweaks.
Approved by: re (kib)
Bug fix from Chelsio which addresses the issue of the device resetting
when it sees only received packets. In some cases where a device only
recieves data it mistakenly thinks that its transmitting side is broken
and resets the device.
Fix a bug with the ael1006 PHY. The bug shows up as persistent but incomplete
packet loss, of between 10-30%. The fix is to put the PHY into
and take it out of local loopback mode when resetting the interface.
Bug fix to support N310 version of Chelsio cards (board ID 1088).
Obtained from: Chelsio Inc.
Approved by: re@
Recheck the DQ_MOD after the dqh lock is relocked. Repeat dqsync() if
the dq is dirty. This ensures that up to date dq is written in the quota
file and fixes assertion in dqget().
Approved by: re (kensmith)
Add new KERN_PROC_* handlers with 32/64 bit stable interfaces. Pack
records from sysctl to reduce copyout size. Add helper to unpack and
provide a more stable interface.
Approved by: re (kensmith)
The times(3) function returns the number of CLK_TCKs since the
startup time of FreeBSD, not since the UNIX Epoch.
PR: docs/122359
Submitted by: Viktor Štujber
Approved by: re (kib)
* Document quotachecks use of the passno field.
* Explain how the passno field in /etc/fstab works with fsck and
quotacheck in some more detail.
* Explain in more detail how the pass number field works.
* Remove information about block devices; we don't have this sort
of separation between character and block devices anymore.
* Enhance the explanation of using filesystem-specific mount
options, and add a mount_msdosfs example.
Approved by: re (kib)
Document that loader(8) stops reading `loader.conf' when it
encounters a syntax error, and add a tip about adding first
the `vital' options and then experimental ones.
PR: docs/119658
Submitted by: Julian Stacey, jhs at berklix.org
Approved by: re (kib)
Add some PHY magic to enable PHY hibernation and 1000baseT/10baseT
power adjustment. This change is required to guarantee correct
operation on certain switches.
MFC r185577:
AR8113 also need to set DMA read burst value. This should fix
occasional DMA read error seen on AR8113.
Approved by: re (kensmith)
183648 (simon): Document that the bce(4) driver works with Dell PowerEdge
1950/2950 NIC's.
185574 (delphij): Update bce(4)'s hardware list to reflect the recent
update to driver.
Approved by: re (kib)
Don't attempt to clear status updates if we did not do a link state
change. As a side effect, this makes the excessive interrupts to
disappear which has been observed as a regression in recent stable/7.
Reported by: many (on -stable@)
Reviewed by: davidch
Approved by: re (kensmith, kib)
Work-around a compiler optimization bug, that broke libthr. Massive
inlining resulted in constant propagation to the extend that cmpval
was known to the compiler to be URWLOCK_WRITE_OWNER (= 0x80000000U).
Unfortunately, instead of zero-extending the unsigned constant, it
was sign-extended. As such, the cmpxchg instruction was comparing
0x0000000080000000LU to 0xffffffff80000000LU and obviously didn't
perform the exchange.
But, since the value returned by cmpxhg equalled cmpval (when zero-
extended), the _thr_rtld_lock_release() function thought the exchange
did happen and as such returned as if having released the lock. This
was not the case. Subsequent locking requests found rw_state non-zero
and the thread in question entered the kernel and block indefinitely.
The work-around is to zero-extend by casting to uint64_t.
Approved by: re (kensmith)
driver, however the fix required a shared code change that
involves both em and igb, requiring some compatibility
changes throughout.
Also, the igb driver now has header split. This is a hardware
assist that is able to seperate the payload and header into
seperate buffers. Using jumbo frames and 4K mbuf clusters, this
should allow the use of ZERO COPY, but that has yet to be
implemented.
Approved by:re
183967:
Track number of packets transmitted and number of packets received
PR: 125806
184861:
Update firmware version check
make ddp a tunable
Obtained from: Chelsio Inc.
185157:
Several small additions to the Chelsio 10G driver.
1) Fix a bug in dealing with the Alerus 1006 PHY which prevented the
device from ever coming back up once it had been set to down.
2) Add a kernel tunable (hw.cxgb.snd_queue_len) which makes it possible
to give the device more than IFQ_MAXLEN entries in its send queue. The
default remains 50.
3) Add code to place the card'd identification and serial number into
its description (%desc) so that users can tell which card they have
installed.
Approved by: re
chips.
g33 based chips use a different method of identifying the gtt size.
g45 based chips gtt is located in a different area of stolen memory.
Approved by: re@ (kensmith)
When encoding an smb name, truncate one byte earlier in order than we did
previously in order to ensure it fit properly in the bufer when encoded.
This prevents a debugging printf from firing if a source or destination
host name for an smb mount exceeds 15 characters.
Obtained from: Apple, Inc.
Approved by: re (kensmith)
archive_entry attributes to be explicitly "unset".
This fixes a number of issues:
* Zip archives with "length at end" can now be
extracted correctly, since the Zip extractor
can simply mark the size as "unknown."
* Extract-to-disk can now accurately handle
cases with partial time information (e.g.,
mtime is known but not atime)
* We get more accurate handling of different
hardlink extraction cases; sometimes a hardlink
entry has definitive size information and sometimes
not.
Approved by: re
Fix a scope problem in the multiple routing table code that
stopped the SO_SETFIB socket option from working correctly.
Approved by: re (kensmith, kostik)
Obtained from: Ironport
Fix typo. It restuled in activating unwanted Rx filtering as well
as resetting Rx threshold configuration.
Submitted by: Joost Mulders < Joost.Mulders <> Sun DOT COM >
Approved by: re (kib)
Add ale(4), a driver for Atheros AR8121/AR8113/AR8114 PCIe ethernet
controller. The controller is also known as L1E(AR8121) and
L2E(AR8113/AR8114). Unlike its predecessor Attansic L1,
AR8121/AR8113/AR8114 uses completely different Rx logic such that
it requires separate driver. Datasheet for AR81xx is not available
to open source driver writers but it shares large part of Tx and
PHY logic of L1. I still don't understand some part of register
meaning and some MAC statistics counters but the driver seems to
have no critical issues for performance and stability.
The AR81xx requires copy operation to pass received frames to upper
stack such that ale(4) consumes a lot of CPU cycles than that of
other controller. A couple of silicon bugs also adds more CPU
cycles to address the known hardware bug. However, if you have fast
CPU you can still saturate the link.
Currently ale(4) supports the following hardware features.
- MSI.
- TCP Segmentation offload.
- Hardware VLAN tag insertion/stripping with checksum offload.
- Tx TCP/UDP checksum offload and Rx IP/TCP/UDP checksum offload.
- Tx/Rx interrupt moderation.
- Hardware statistics counters.
- Jumbo frame.
- WOL.
AR81xx PCIe ethernet controllers are mainly found on ASUS EeePC or
P5Q series of ASUS motherboards. Special thanks to Jeremy Chadwick
who sent the hardware to me. Without his donation writing a driver
for AR81xx would never have been possible. Big thanks to all people
who reported feedback or tested patches.
HW donated by: koitsu
Tested by: bsam, Joao Barros <joao.barros <> gmail DOT com >
Jan Henrik Sylvester <me <> janh DOT de >
Ivan Brawley < ivan <> brawley DOT id DOT au >,
CURRENT ML
Approved by: re (kib)
Note, GENERIC kernel does NOT include ale(4) but users can still
kldload it. It was requested by re.
- For maximum flexibility, sparc64 supports BUS_DMA_COHERENT also
with bus_dmamap_create() and not only bus_dmamem_alloc() so move
the description of this flag up accordingly in order to document
this fact. While at it, refine this description with an application
example.
- Reword the description of BUS_DMA_NOCACHE as this flag is also
implemented on sparc64.
Approved by: re (kib)
Instead of forcing vn_start_write() to reset mp back to NULL for the
failed calls with non-NULL vp, explicitely clear mp after failure.
Approved by: re (kensmith)
PR: 123768
parenthesized subexpression is defined. For example, the
following command line caused unexpected behavior like
segmentation fault:
% echo test | sed -e 's/test/\1/'
Approved by: re (kib)
PR: bin/126682
For now on every 10 cyclinder groups flush the buffer cache to free
up space. If the buffer cache fills up then the disk systems can
grind to a halt.
PR: 128832
Approved by: re (kensmith)
This addresses:
1) New HW support from LSI (they want to get the HW support
into a FreeBSD release before the HW comes out!).
2) Bug fix in the ioctl path with zero length command.
3) Adds functional support so that SCSI sense will work
when requested from user-land. This is a little strange,
since they store a user-land pointer in the "data" space
of the ioctl packet. So copy the data out into another
structure that is a union of the data and pointer (mfi_sense_ptr
union). This way we can cleanly use the pointer, as pointer on
both 64bit and 32bit machines (i386/amd64).
Submitted by: LSI
Approved by: re (kib)
Adapt the locking of esp(4) to MPSAFE cam(4) (so that ncr53c9x_intr()
actually is INTR_MPSAFE now) and fix a couple of bugs which lead to
panics, amongst other improvements.
Approved by: re (kib)
o Fix style(9) bugs and similar nits.
o Merge ncr53c9x.c from NetBSD:
1.115: fix variable shadowing
1.118: __inline -> inline
1.121: fix empty if
Approved by: re (kib)
Add AS lookup functionality. On each hop we query a whois server to
find the corresponding AS for that IP (-a switch).
We can also choose a different whois server with the -A switch. The
default is whois.radb.net.
Obtained from: NetBSD
Approved by: re
The code in linux_proc_exit() contains a race when multiple linux based
processes exits at the same time. The linux_emuldata structure is freed
but p->p_emuldata is left as a dangling pointer to the just freed
memory.
The check for W_EXIT in the loop scanning the child processes isn't safe
since the state of the child process can change right afterwards. Lock
the process and check the W_EXIT before delivering signal.
Approved by: re (kensmith)
When running a "chio return" operation using a physical source unit
rather than a voltag name, do not set the CESR_VOLTAGS flags in the
CHIOGSTATUS command requesting the current status. As voltags are an
optional feature that must be handled as "reserved" by media changers
not implementing the feature, always setting CESR_VOLTAGS resulted in
the command being aborted with an `Invalid field in CDB', and
consequently the "chio return" failed, for media changers that do not
support voltags.
Approved by: re (kib)
In both dropwithreset paths in tcp_input.c, drop the tcbinfo lock
sooner to decomplicate locking and eliminate the need for a rather
chatty comment about why we have to handle the global lock in a
special way for the benefit of ipfw and pf cred rules.
Approved by: re (kib)
r176448,178132,178853,179436,179695,179771,182293
r176448 (davidch)
- Added loose RX MTU functionality to allow frames larger than 1500
bytes to be accepted even though the interface MTU is set to 1500.
- Implemented new TCP header splitting/jumbo frame support which uses
two chains for receive traffic rather than the original single
receive chain.
- Added additional debug support code.
r178132 (davidch)
- Fixed a problem with the send chain consumer index which would cause
TX traffic to sit in the send chain until a received packet kick
started the interrupt handler. This would cause extremely slow
performance when used with NFS over UDP.
- Removed untested polling code.
- Updated copyright year in the file header.
- Removed inadvertent ^M's created by DOS text editor.
r178853 (scottl)
The BCE chips appear to have an undocumented requirement that RX frames
be aligned on an 8 byte boundary. Prior to rev 1.36 (now r176448) this
wasn't a problem because mbuf clusters tend be naturally aligned. The
switch to using split buffers with the first buffer being the embedded
data area of the mbuf has broken this assumption, at least on i386,
causing a complete failure of RX functionality. Fix this for now by
using a full cluster for the first RX buffer. A more sophisticated
approach could be done with the old buffer scheme to realign the m_data
pointer with m_adj(), but I'm also not clear on performance benefits of
this old scheme or the performance implications of adding an m_adj()
call to every allocation.
r179436 (jhb)
Trim an extra semi-colon.
r179695 (davidch)
- Fixed kern/123696 by increasing firmware timeout value from 100 to
1000.
- Fixed a problem on i386 architecture when using split header/jumbo
frame firmware caused by hardware alignment requirements.
- Added #define BCE_USE_SPLIT_HEADER to allow the feature to be
enabled/disabled. Enabled by default.
PR: kern/123696
r179771 (davidch)
- Added support for BCM5709 and BCM5716 controllers.
r182293 (davidch)
- Updated support for 5716.
- Added some additional code for debug builds.
- Fixed a problem printing physical memory on 64bit system during
debugging.
- Modified some of the context memory and mailbox register names to
more clearly distinguish their use.
- Added memory barriers for Intel CPUs when accessing host memory data
structures which are written by hardware.
Approved by: re (kib)
Remove endearing but syntactically unnecessary "return;" statements
directly before the final closeing brackets of some TCP functions.
Approved by: re (gnn)
Revert to preferring mmap(2) over sbrk(2) when mapping memory, due
to potential extreme contention in the kernel for multi-threaded
applications on SMP systems.
Approved by: re (kib)
(which was missed with r184739: r183013,r183017,r183032,r183034)
Original commit message from HEAD:
Julian: "oops commit the version that compiles"
Unbreak RELENG_7 including the missing sys/proc.h header file.
Approved by: re (kib)
Make sure internal rtld malloc routines are not called from unlocked
contexts as rtld's malloc is not thread safe and is only supposed to be
called with exclusive bind lock already held.
Approved by: re (kensmith), kan
Allow strong symbols to override weak ones for lookups done through
dlsym with RTLD_NEXT/RTLD_SELF handles.
Allow symbols from ld-elf.so to be located this way too.
Approved by: re (kensmith), kan
Supply a valid Connect ID when issuing XPT_DEV_MATCH, which
according to my reading of the CAM draft is mandatory for
all CCB function calls and enforced by xptioctl() since at
least r168752. Previously we happened to use 0 as the Path
ID, causing the XPT_DEV_MATCH call to fail if there's no
SCSI bus 0. Basically the same bug was also fixed the same
way for camcontrol(8) as part of r126514.
PR: 127605
Approved by: re (kib)
Protect check for v_pollinfo == NULL and assignment of the newly allocated
vpollinfo with vnode interlock. Fully initialize vpollinfo before putting
pointer to it into vp->v_pollinfo.
Approved by: re (kensmith)
- In GCC 4.2 __builtin_frame_address() was fixed to include the
V9 stack bias so we no longer need to add it in db_backtrace()
and stack_capture() respectively. This also reverts r182168,
which kludged around the resulting unaligned access.
- Sync the sun4v versions of db_trace.c and stack_machdep.c with
the sparc64 ones and fix some style bugs.
Approved by: re (kib)
MNTK_UNMOUNT before, and mnt_mtx is used as interlock. vfs_busy() always
tries to obtain a shared lock on mnt_lock, the other user is unmount who
tries to drain it, setting MNTK_UNMOUNT before.
Approved by: re (kensmith)
Assert that v_holdcnt is non-zero before entering lockmgr in vn_lock and
ffs_lock. This cannot catch situations where holdcnt is incremented not
by curthread, but I think it is useful.
Approved by: re (kensmith)
Add explicit PCI IDs for the following Adaptec RAID Series 2 adapters:
Adaptec RAID 2045
Adaptec RAID 2405
Adaptec RAID 2445
Adaptec RAID 2805
Without this change these devices are supported by the driver's family
support, but they then appear as "Adaptec RAID Controller" in boot
messages and the dev.aac.0.%desc sysctl.
Approved by: re (kib)
Add cr_canseeinpcb() doing checks using the cached socket
credentials from inp_cred which is also available after the
socket is gone.
Switch cr_canseesocket consumers to cr_canseeinpcb.
This removes an extra acquisition of the socket lock.
Approved by: re (rwatson)
Workaround possible q_time overflow (will happen after 2^32/(86400*hz)
days of uptime (~50days for hz = 1000)), which may lead to:
- broken shaping in 'fast' io mode.
- incorrect average queue length calculation in RED/GRED algorithm.
PR: kern/128401
Approved by: re (kensmith)
Add mac_check_inpcb_visible MAC Framework entry point, which is similar
to mac_check_socket_visible but operates on the inpcb.
Approved by: re (rwatson)
> Allow multiple locks to be acquired by detecting corresponding
> bit flag, otherwise if a thread acquired a lock, another thread
> or the current thread itself can no longer acquire another lock
> because thread_mask_set() return whole flag word, this results
> bit leaking in the word and misbehavior in later locking and
> unlocking.
Approved by: re (kib)
Cache so_cred as inp_cred in the inpcb.
This means that inp_cred is always there, even after the socket
has gone away. It also means that it is constant for the lifetime
of the inp.
Both facts lead to simpler code and possibly less locking.
Approved by: re (gnn)
mld_timerresid() returns ms so instead of doing the maths in usec
and then dividing down to ms, do the maths in ms.
Obtained from: NetBSD mld6.c rev. 1.47
Approved by: re (gnn)
Make the checks for ptp interfaces in ifa_ifwithdstaddr() and
ifa_ifwithnet() look more similar by comparing the pointer to NULL
in both cases.
Approved by: re (gnn)
There is no real consumer of ip6_plen (IPv6 payload length)
as set in tcpip_fillheaders().
ip6_output() will calculate it based of the length from the
mbuf packet header itself.
Initialize the value in tcpip_fillheaders() in correct
(network) byte order.
With the above change, all places calling tcp_trace() pass in
the ip6 header serialized in the mbuf as ipgen and with
ip6_plen in network byte order. Thus convert the IPv6 payload
length to host byte order before printing.
Approved by: re (gnn)
Expand DBDMA API to allow setting device-dependent control bits and allow
DBDMA registers to lie in a subregion of a resource.
Also import changes to the BMAC driver to handle these changes and
change the way we enable the BMAC cell in macio. Instead of calling the
macio's enable-enet word, which apparently does nothing on some machines,
open an OF instance of the ethernet controller. This fixes cold booting
from disk on my Blue & White G3.
Approved by: re (gnn)
Prefix the static shl function with '__' like its parent function __qdivrem to
avoid being picked up by the DTrace fbt provider.
This is called by __udivdi3() for doing 64bit division on a 32bit arch and may
be called from within the dtrace context causing a double fault.
Approved by: re (kib)
of refinement later, as bde says that 4BSD expects stathz of 128, while
in this case stathz would be in the range 40-128.
Approved by: re (kib, kensmith)
- r183613 by delphij
Note recently added ICH10 support
- r183570 by brueffer
ITE IT8213F support.
- r181826 by simon
Fix mdoc markup in r181825.
Approved by: re (kib)
- r183380 (sos)
Add support for the ITE 8213 controller.
Thanks goes to ITE who provided docs and feedback and made this possible.
Minor fixups to the Intel ICH code for bugs found while doing this.
(ITE8213 is very semilar to an Intel ICH)
- r183552 (sos)
Add ICH10 PCI id's.
Fix the number of PATA ports on newer ICHX chips, they have just 1 port
not 2.
Approved by: re (kib)
- Reduce the scope of the vnode lock such that it does not
cover the various copyouts associated with initializing
the process's argv/env data in userspace. It is possible
that these copyout operations can fault under memory
pressure, possibly resulting in dead locks.
Approved by: re@ (kib)
Fall back to the binary-specified interpreter (ld-elf.so.1) if the
ABI override binary isn't found.
MFC r183694:
If the ABI-overriden interpreter was not loaded, do not set have_interp
to TRUE.
Approved by: re (kensmith)
Small cleanups to openpty().
- Pass O_NOCTTY to posix_openpt(2). This makes the implementation work
consistently on implementations that make the PTY the controlling TTY
by default.
- Call unlockpt() before opening the slave device. POSIX mentions that
de slave device should only be opened after grantpt() and unlockpt()
have been called.
- Replace some redundant code by a label.
As a safety net, add a call to revoke() to unlockpt(). All applications
out there use openpty(), explicitly call revoke() or implement their own
PTY allocation routines. Adding the call to unlockpt() won't hurt, but
will prevent foot-shooting.
Reviewed by: jhb, kib
Approved by: re
Wireless Mouse device of Sony VGP-WRC1 mouse/keyboard receiver has the
same program interface as Microsoft Wireless Notebook Optical Mouse and
needs a quirk.
PR: usb/122712
Approved by: re (kensmith)
Ktr(9) stores format string and arguments in the event circular buffer,
not the string formatted at the time of CTRX() call. Stack_ktr(9) uses
an on-stack buffer for the symbol name, that is supplied as an argument
to ktr. As result, stack_ktr() traces show garbage or cause page faults.
Fix stack_ktr() by using pointer to module symbol table that is supposed
to have a longer lifetime.
Approved by: re (kensmith)
In realtimer_delete(), clear timer's value and interval to tell
realtimer_expire() to not rearm the timer, otherwise there is a
chance that a callout will be left there and be tiggered in future
unexpectly.
Approved by: re (kib)
When we notice the INDEX had volume numbers (so the media the packages
are coming from has multiple volumes) walk through the dependency tree
for the packages selected by the user once for each volume, only
installing packages on the current volume. If we can't install the
package because its on a higher volume just note that we have looked
at it during the pass for this volume to cut down on time spent checking
dependencies. This stops the excessive disc swapping that users have
complained (a lot...) about.
Approved by: re (kib)
Return G_PART_PROBE_PRI_HIGH instead of G_PART_PROBE_PRI_NORM
if the probe succeeds. This guarantees that the BSD scheme
wins over the MBR scheme when MBR gets to probe first.
Approved by: re (kib@)
setting the ACL changes the mtime. (Plus a new test to exercise
basic ACL restore logic.)
PR: kern/128203
Submitted by: Udo Schweigert
Approved by: re (Kostik Belousov)
Some 88E1149 PHY's page select is initialized to point to other
bank instead of copper/fiber bank which in turn resulted in
wrong registers were accessed during PHY operation. It is
believed that page 0 should be used for copper PHY so reinitialize
E1000_EADR to select default copper PHY.
This fixes link establishment issue of nfe(4) on Sun Fire X4140.
OpenBSD also has similimar patch but they just reset the E1000_EADR
register to page 0. However some Marvell PHYs((88E3082, 88E1000)
don't have the extended address register and the meaning of the
register is quite different for each PHY model. So selecting copper
PHY is limited to 88E1149 PHY which seems to be the only one that
exhibits link establishment problem. If parent device know the type
of PHY(either copper or fiber) that information should be notified
to PHY driver but there is no good way to pass this information yet.
Reported by: thompsa
Reviewed by: thompsa
Approved by: re (gnn)
r183771:
Add a build knob MAKE_DVD to control on a per-architecture basis whether
or not to build a tree used for the creation of a DVD image. If that is
enabled set up a DVD tree by installing everything we normally install
to the individual CDROM trees into the one DVD tree. The result is one
image with all the install bits, livefs bits, and doc bits suitable for
burning to a DVD instead of CDROM.
Enable building the DVD for amd64 and i386.
r183860:
The thought of making more than one DVD image for a release really
freaks me out. But it turns out we might be able to generalize
a few of the other things RE uses to assemble the package trees
for releases if the DVDs use a naming theme close to what is used
for the CDROMS (disc1, disc2, etc). So change the name to dvd1.
Hopefully this way src/release/scripts/{package-split.py,package-trees.sh}
can be generalized instead of copied-and-hacked.
Approved by: re (kib)
Turn XXX's for unlocked writes of NFS server statistics to simple notes,
as we consider it a feature to exchange performance for consistency.
Approved by: re (kib)
When disconnecting a UDPv6 socket, acquire the socket lock around the
changing of the so_state field, as is done in UDPv4. Remove XXX
locking comment.
Approved by: re (kib)
The locking in portalfs's socket connect code is no less correct than
identical code in connect(2), so remove XXX that it might be incorrect.
Approved by: re (kib)
Implement sched_setaffinity and get_setaffinity using real cpu affinity
setting primitives.
MFC r177604 (by ru):
Fix build.
MFC r183612:
Use FreeBSD size of cpuset_t for bitmap size parameter and return EINVAL
if length of user space bitmap less than our size of cpuset_t.
Approved by: re (kensmith)
Read PCI device id instead of PCI revision id. Also checks the read
device id is JMC260 family. Previously it just verified the deivce
is JMC260 Rev A0. This will make it easy for newer JMC2xx support.
Pointed out by: bouyer at NetBSD
MFC r183859:
Make sure to read the last byte of EEPROM descriptor. Previously
the last byte of the ethernet address was not read which in turn
resulted in getting 5 out of the 6 bytes of ethernet address and
always returned ENOENT. I did not notice the bug on FPGA version
because of additional configuration data in EEPROM.
Pointed out by: bouyer at NetBSD
Approved by: re (gnn)
sc->ndis_txidx should be cycle between 0 and sc->ndis_maxpkts, not
NDIS_TXPKTS and don't allocate unused extra spaces for
sc->ndis_txarray and sc->ndis_txpool.
PR: kern/127644
Submitted by: Antoine Pelisse <apelisse_at_gmail.com>
Approved by: re (gnn)
In soreceive_dgram, when a 0-length buffer is passed into recv(2) and
no data is ready, return 0 rather than blocking or returning EAGAIN.
This is consistent with the behavior of soreceive_generic (soreceive)
in earlier versions of FreeBSD, and restores this behavior for UDP.
Discussed with: jhb, sam
Approved by: re (kib)
the unlocked route caching in if_stf. Add a mutex that protects
access to cached route. Various versions of this patch were tested
by Pekka Savola, Nick Sayer and Wouter Snels.
Approved by: re (gnn)
MFV of r183861
MFC of r183864
- Minor update for Mauritius (which I don't understand)
- Syria goes to DST at 1 November instead of 1 October.
- Niue is now located at the right side of the equator.
Approved by: re (blackend)
Remove temporary debugging KASSERT's introduced to detect protocols
improperly invoking sosend(), soreceive(), and sopoll() instead of
attach either specialized or _generic() versions of those functions
to their pru_sosend, pru_soreceive, and pru_sopoll protosw methods.
Approved by: re (kib)
Don't pass curthread to sbreserve_locked() in tcp_do_segment(), as the
netisr or ithread's socket buffer size limit is not the right limit to
use. Instead, pass NULL as the other two calls to sbreserve_locked()
in the TCP input path (tcp_mss()) do.
In practice, this is a no-op, as ithreads and the netisr run without a
process limit on socket buffer use, and a NULL thread pointer leads to
not using the process's limit, if any. However, if tcp_input() is
called in other contexts that do have limits, this may prevent the
incorrect limit from being used.
Rewrite sbreserve_locked()'s comment on NULL thread pointers, eliminating
an XXXRW about the comment being stale.
Approved by: re (gnn)
Lock receive socket buffer in soo_stat() rather than commenting that
we should lock it, which may marginally improve the consistency of
the results. Remove comment.
Approved by: re (gnn)
stable/7:
Further minor cleanups to UNIX domain sockets:
- Staticize and locally prototype functions uipc_ctloutput(),
unp_dispose(), unp_init(), and unp_externalize(), none of which have
been required outside of uipc_usrreq.c since uipc_proto.c was removed.
- Remove stale prototype for uipc_usrreq(), which has not existed in the
code since 1997
- Forward declare and staticize uipc_usrreqs structure in uipc_usrreq.c
and not un.h.
- Comment on why uipc_connect2() is still non-static -- it is used
directly by fifofs.
- Remove stale comments, tidy up whitespace.
Use soconnect2() rather than directly invoking uipc_connect2() to
interconnect two UNIX domain sockets.
Now that portalfs doesn't directly invoke uipc_connect2(), make it a
static symbol.
Remove stale comment (and XXX saying so) about why we zero the file
descriptor pointer in unp_freerights: we can no longer recurse into
unp_gc due to unp_gc being invoked in a deferred way, but it's still
a good idea.
Remove stale comment: while uipc_connect2() was, until recently, not
static so it could be used by fifofs (actually portalfs), it is now
static.
Submitted by: kensmith
Approved by: re (kensmith)
Disable ATAPI DMA as it's once again broken in that it causes data
corruption with the on-board AcerLabs M5229 controllers. While at
it, remove the pointless "nothing to autoload yet." message.
Approved by: re (blackend)
Add freebsd32 compat shim for nmount(2). Also 32-bit ioctl shims
for MDIO, CDIOREADTOCHEADER and CDIOREADTOCENTRYS requests.
Fix bug which removed the 32-bit swapon(2) interface. style(9).
Approved by: re(kostikbel)
Various cleanups for soreceive_dgram():
- Update or remove comments that were left over from the original
soreceive_generic() implementation. Quite a few were misleading in the
context of the new code.
- Since soreceive_dgram() has a simpler structure, replace several gotos
with a while loop making the invariants more clear.
- In the blocking while loop, don't try to handle cases incompatible with
the loop invariant (since m is always NULL, don't check for and handle
non-NULL).
- Don't drop and re-acquire the socket buffer lock unnecessarily after
sbwait() returns, which may help reduce lock contention (etc).
- Assume PR_ATOMIC since we assert it at the top of the function.
Approved by: re (gnn)
rev. 1.7 net/if_enc.c
rev. 1.14 netipsec/ipsec.h, 1.20 netipsec/ipsec_input.c
rev. 1.17 netipsec/ipsec_output.c
rev. 1.4 netipsec/xform.h, 1.16 netipsec/xform_ipip.c
SVN r174054, 174055
Add sysctls to if_enc(4) to control whether the firewalls or
bpf will see inner and outer headers or just inner or outer
headers for incoming and outgoing IPsec packets.
This is useful in bpf to not have over long lines for debugging
or selcting packets based on the inner headers.
It also properly defines the behavior of what the firewalls see.
Last but not least it gives you if_enc(4) for IPv6 as well.
[ As some auxiliary state was not available in the later
input path we save it in the tdbi. That way tcpdump can give a
consistent view of either of (authentic,confidential) for both
before and after states. ]
Note: The defaults were not changed but you may want to do that.
See the the man page for more details.
PR: kern/127785
Approved by: re (gnn)
Differentiate between interrupt frames, trap interrupt frames and timer
frame in the kgdb, to allow it to properly backtrace over the interrupt
stacks.
Approved by: re (kensmith)
Frames created by the Xcpustop, Xrendezvous, Xipi_intr_bitmap_handler
and Xlazypmap differ from the frame for Xtimerint. The Xtimerint puts
pointer to the frame between return address and frame body, while rest
of the functions listed above do not. Correct offset calculation to
allow the ddb backtrace to step over such frames.
Approved by: re (kensmith)
If the panic thread is preempted after setting panicstr but before
setting TDF_INPANIC then it will never be rescheduled again. Wrap
setting the panic condition with the critical section.
Approved by: re (kensmith)
fix two panics:
1. panic: rtalloc1_fib: bad fibnum
2. panic: Lock tcpinp not exclusively locked
@ /usr/src/sys/netinet/in_pcb.c:1284
Submitted by: Chelsio Inc.
Approved by: re
copy out the size of the user's buffer. In the case of a program using
the older (smaller) structure, the previous code would trash memory after
the end of the user's kld_stat struct. This was missed in the DTrace
MFC.
Submitted by: Jaakko Heinonen jh saunalahti.fi
Approved by: re (kib)
Save previous content of the td_fpop before storing the current
filedescriptor into it. Make sure that td_fpop is NULL when calling
d_mmap from dev_pager_getpages().
Approved by: re (kensmith)
When an inpcb doesn't have a socket but the inpcb is passed to ipfw
in the transmit path, such as TCPS_TIMEWAIT, fail the credential
extraction immediately rather than acquiring locks and looking up
the inpcb on the global lists in order to reach the conclusion that
the credential extraction has failed.
This is more efficient, but more importantly, it avoids lock
recursion on the inpcbinfo, which is no longer allowed with rwlocks.
This appears to have been responsible for at least two reported
panics.
Reported by: ganbold
Approved by: re (kib)
Rather than shadowing global variable 'lookup' in check_uidgid(), rename
it to ugid_lookupp. This should make debugging issues with ipfw uid
rules easier.
Approved by: re (kib)
As a follow-on to r183323, correct another case where ip_output() was
called without an inpcb pointer despite holding the tcbinfo global
lock, which lead to a deadlock or panic when ipfw tried to further
acquire it recursively.
Reported by: Stefan Ehmann <shoesoft at gmx dot net>
Approved by: re (kib)
When dropping a packet and issuing a reset during TCP segment handling,
unconditionally drop the tcbinfo lock (after all, we assert it lines
before), but call tcp_dropwithreset() under both inpcb and inpcbinfo
locks only if we pass in an tcpcb. Otherwise, if the pointer is NULL,
firewall code may later recurse the global tcbinfo lock trying to look
up an inpcb.
This is an instance where a layering violation leads not only
potentially to code reentrace and recursion, but also to lock
recursion, and was revealed by the conversion to rwlocks because
acquiring a read lock on an rwlock already held with a write lock is
forbidden. When these locks were mutexes, they simply recursed.
Reported by: Stefan Ehmann <shoesoft at gmx dot net>
Approved by: re (kib)
Don't terminate if we are listing devices, a controller might
legitimately not be there.
Submitted by: Andrey V. Elsukov <[email protected]>
Approved by: re (gnn), phk
Add workaround for occasional packet loss issue of JMC250 A2
when it runs on half-duplex media.
While I'm here add register definition for GPREG1. ATM the GPREG1
register is only valid for JMC250 A1/A2.
Submitted by: Ethan at JMicron
Approved by: re (kensmith)
- Clean up the code that checks the types of address so that it is
done by understandable macros.
- Fix the bug that prevented the system from responding on interfaces with
link local addresses assigned.
Approved by: re (gnn)
Lockf was exiting with status 1 if the command did not exit normally.
This is easy to confuse with the actual exit status of the program.
Instead exit with EX_SOFTWARE if the command doesn't exit normally.
Approved by: re (kib)
- Correct a long-standing error in vm_object_deallocate(). Specifically,
only anonymous default (OBJT_DEFAULT) and swap (OBJT_SWAP) objects should
ever have OBJ_ONEMAPPING set. However, vm_object_deallocate() was
setting it on device (OBJT_DEVICE) objects. As a result,
vm_object_page_remove() could be called on a device object and if that
occurred pmap_remove_all() would be called on the device object's pages.
However, a device object's pages are fictitious, and fictitious pages do
not have an initialized pv list (struct md_page).
- Correct a long-standing error in vm_object_page_remove(). Specifically,
pmap_remove_all() must not be called on fictitious pages. To date,
fictitious pages have been allocated from zeroed memory, effectively
hiding this problem because the fictitious pages appear to have an empty
pv list.
- Rewrite the comments describing vm_object_page_remove() to better
describe what it does. Add an assertion.
Approved by: re (kib), alc
When invoking the udp_send() from udp6_send() due to use of a v6-mapped
IPv4 address, first drop the udbinfo and inpcb locks, which will otherwise
be recursed. This leads to a potential minor race, but is preferable to a
deadlock when acquiring a read lock after a write lock on the inpcb.
MFC after: 3 days
Reported by: Norbert Papke <[email protected]>, lioux
Approved by: re (kib)
Tested by: Norbert Papke <[email protected]>, lioux
When doing rfork(0), i.e. separating curproc VM from any other user of
the same vmspace, decrement the reference count of the shared LDT instead
of a newly-made copy. Code factually removed LDT from the process that
did rfork(0).
Introduce user_ldt_deref() function that does decrement of refcount for
the struct proc_ldt, and call it in the rfork(0) case on the shared LDT.
Approved by: re (kensmith)
The user_ldt_alloc() function shall return with dt_lock locked.
The user_ldt_free() function shall return with dt_lock unlocked.
Error handling code in both functions do not handle this, fix it by
doing necessary lock/unlock.
While there, fix minor style nits.
Approved by: re (kensmith)
Remove warning about static LDT segment allocation. Applications
continue using it after ~7 years since warning was introduced, and there
is no reason to discourage them.
Approved by: re (kensmith)
To date, our implementation of munmap(2) has required that the
entirety of the specified range be mapped. Specifically, it has
returned EINVAL if the entire range is not mapped. There is not,
however, any basis for this in either SuSv2 or our own man page.
Moreover, neither Linux nor Solaris impose this requirement. This
revision removes this requirement.
Approved by: re (kib)
Essentially, neither madvise(..., MADV_DONTNEED) nor madvise(..., MADV_FREE)
work. (Moreover, I don't believe that they have ever worked as intended.)
The explanation is fairly simple. Both MADV_DONTNEED and MADV_FREE perform
vm_page_dontneed() on each page within the range given to madvise(). This
function moves the page to the inactive queue. Specifically, if the page is
clean, it is moved to the head of the inactive queue where it is first in
line for processing by the page daemon. On the other hand, if it is dirty,
it is placed at the tail. Let's further examine the case in which the page
is clean. Recall that the page is at the head of the line for processing by
the page daemon. The expectation of vm_page_dontneed()'s author was that
the page would be transferred from the inactive queue to the cache queue by
the page daemon. (Once the page is in the cache queue, it is, in effect,
free, that is, it can be reallocated to a new vm object by vm_page_alloc()
if it isn't reactivated quickly enough by a user of the old vm object.) The
trouble is that nowhere in the execution of either MADV_DONTNEED or
MADV_FREE is either the machine-independent reference flag (PG_REFERENCED)
or the reference bit in any page table entry (PTE) mapping the page cleared.
Consequently, the immediate reaction of the page daemon is to reactivate the
page because it is referenced. In effect, the madvise() was for naught.
The case in which the page was dirty is not too different. Instead of being
laundered, the page is reactivated.
Note: The essential difference between MADV_DONTNEED and MADV_FREE is
that MADV_FREE clears a page's dirty field. So, MADV_FREE is always
executing the clean case above.
This revision changes vm_page_dontneed() to clear both the machine-
independent reference flag (PG_REFERENCED) and the reference bit in all PTEs
mapping the page.
Approved by: re (kib), alc
Check whether we've recorded this tick in ts_ticks on another cpu in
sched_tick() to prevent multiple increments for one tick. This pushes
the value out of range and breaks priority calculation.
Approved by: re (rwatson)
New Revision: 182818
URL: http://svn.freebsd.org/changeset/base/182818
Log:
Export the IPFW_DEFAULT_RULE outside ip_fw2.c. This number in not only
the default rule number but also the maximum rule number. User space
software such as ipfw and natd should be aware of its value. The
software that already includes ip_fw.h should use the defined value. All
other a expected to use sysctl (as discussed on net@).
MFC after: 5 days.
Discussed on: net@
Modified:
head/sys/netinet/ip_fw.h
head/sys/netinet/ip_fw2.c
New Revision: 182823
URL: http://svn.freebsd.org/changeset/base/182823
Log:
Use IPFW_DEFAULT_RULE instead of hardcoded value since now it is
available.
MFC after: 5 days.
Modified:
head/sbin/ipfw/ipfw2.c
New Revision: 182825
URL: http://svn.freebsd.org/changeset/base/182825
Log:
Check rule numbers against maximum value to avoid rules cleanup due
to overflow.
MFC after: 5 days.
Modified:
head/sbin/natd/natd.c
New Revision: 183012
URL: http://svn.freebsd.org/changeset/base/183012
Log:
Make the commet for the default rule number more clear.
Submitted by: yar@
Modified:
head/sys/netinet/ip_fw.h
Approved by: re (kensmith)
change the code to include "thread" argument to the vn_lock()
which got removed in HEAD:
Getdents requires padding with 2 bytes instead of 1 byte
as with getdents64. The last byte is used for storing
the d_type, add this to plain getdents case where it was
missing before. Also change the code to use strlcpy instead
of plain strcpy. This changes fix the getdents crash we
had reports about (hl2 server etc.)
PR: kern/117010
MFC after: 1 week
Submitted by: Dmitry Chagin (dchagin@)
Tested by: MITA Yoshio <mita ee.t.u-tokyo.ac jp>
Approved by: kib (mentor)
Approved by: re (kensmith)
Implement WNOWAIT flag for wait4(2). It specifies that process whose status
is returned shall be kept in the waitable state.
Add WSTOPPED as an alias for WUNTRACED.
MFC r182424 (by davidxu):
Don't remove queued SIGCHLD if options contain WNOWAIT, so other
threads still can be notified by the signal.
Approved by: re (kensmith)
Read ethernet address from ID registers for RTL8102E/RTL8102EL as
reading from EEPROM doesn't seem to work on these controllers.
Reported by: Milan Obuch ( freebsd-net at dino dot sk )
Tested by: Milan Obuch ( freebsd-net at dino dot sk )
Approved by: re (kensmith)
Remove the alignment of the align parameter. This is up to the caller to pass
in and it breaks tap(4) on strict alignment machines as m_uiotombuf is called
with ETHER_ALIGN.
Approved by: re (kensmith)
bge_tick(): do not touch PHY if link is up. This should solve problem with
extra input errors for some BCM57XX chips.
PR: kern/122295
Approved by: re (kensmith)
In FreeBSD 7.0 and beyond, pmap_growkernel() should pass VM_ALLOC_INTERRUPT
to vm_page_alloc() instead of VM_ALLOC_SYSTEM. VM_ALLOC_SYSTEM was the
logical choice before FreeBSD 7.0 because VM_ALLOC_INTERRUPT could not
reclaim a cached page. Simply put, there was no ordering between
VM_ALLOC_INTERRUPT and VM_ALLOC_SYSTEM as to which "dug deeper" into the
cache and free queues. Now, there is; VM_ALLOC_INTERRUPT dominates
VM_ALLOC_SYSTEM.
While I'm here, teach pmap_growkernel() to request a prezeroed page.
Approved by: re (kib), alc
Improve get_pv_entry()'s handling of low-memory conditions. After page
allocation fails and pv entries are reclaimed, there may be an unused pv
entry in a pv chunk that survived the reclamation. However, previously,
after reclamation, get_pv_entry() did not look for an unused pv entry in
a surviving pv chunk; it simply retried the page allocation. Now, it
does look for an unused pv entry before retrying the page allocation.
Note: This only applies to RELENG_7. Earlier branches use a different
pv entry allocator.
Approved by: re (kib), alc
- Tidy up: Add comments. Eliminate the pointless
malloc_type_allocated(..., 0) calls that occur when contigmalloc() has
failed. Eliminate the acquisition and release of the page queues lock
from vm_page_release_contig(). Rename contigmalloc2() to
contigmapping(), reflecting what it does.
- Make contigmalloc(9)'s page laundering more robust. Specifically, use
vm_pageout_fallback_object_lock() in vm_contig_launder_page() to better
handle a lock-ordering problem. Consequently, trylock's failure on the
page's containing object no longer implies that the page cannot be
laundered.
Approved by: re (kib), alc
r182887:
Fix typo which resulted in invalid configuration for JMC260.
r182888:
Add workaround for CRC errors seen at 100Mbps on JMC250 A2.
While here update chip revision number of JMC250/JMC260 from the
latest datasheet.
Approved by: re (kensmith)
on #ifdef INET, as we don't define udp6_usrreqs when IPv6 isn't
compiled into the kernel.
Reported by: bf <bf2006a at yahoo dot com>,
Kovacs Robert <robi at datanet.hu>
Approved by: re (kib)
Add soreceive_dgram(9), an optimized socket receive function for use by
datagram-only protocols, such as UDP. This version removes use of
sblock(), which is not required due to an inability to interlace data
improperly with datagrams, as well as avoiding some of the larger loops
and state management that don't apply on datagram sockets.
This is experimental code, so hook it up only for UDPv4 for testing; if
there are problems we may need to revise it or turn it off by default,
but it offers *significant* performance improvements for threaded UDP
applications such as BIND9, nsd, and memcached using UDP.
Tested by: kris, ps
Update copyright date in light of soreceive_dgram(9).
Use soreceive_dgram() and sosend_dgram() with UDPv6, as we do with UDPv4.
Tested by: ps
Remove XXXRW in soreceive_dgram that proves unnecessary.
Remove unused orig_resid variable in soreceive_dgram.
Submitted by: alfred
Note: in the MFC, we do enable sosend_dgram for UDPv6 by default (it was
already used for UDPv4), but use of soreceive_dgram for both UDPv4 and
UDPv6 is controlled by a new loader tunable,
net.inet.udp.soreceive_dgram_enabled as soreceive_dgram has less testing
exposure than sosend_dgram. We may wish to change the default (and
eliminate the tunable) in 7.2.
MFC requested by: gnn, kris, ps
Approved by: re (kib)
The pcb_gs32p should be per-cpu, not per-thread pointer. This is
location in GDT where the segment descriptor from pcb_gs32sd is
copied, and the location is in GDT local to CPU.
Approved by: re (kensmith)
Segment registers are stored in the uc_mcontext member of the struct
l_ucontext. To restore the registers content, trampoline needs to
dereference uc_mcontext instead of taking some undefined values from
l_ucontext.
Approved by: re (kensmith)
Bypass isa_probe_children(9) and directly call bus_generic_attach(9)
in order to avoid the invasive probes done by identify-routines of
ISA drivers, which may access unassigned addresses or those of
unrelated devices and thus in turn can trigger master/target aborts
as revealed by r182108 and ahc(4). I think that this is also the
cause of the hang previously seen on B100 blades during boot.
Bypassing isa_probe_children(9) also avoids adding ISA hints, which
just can be wrong for sparc64.
Approved by: re (kib)
Add one more SII3132 chip PCI ID found on Adaptec Serial ATA II RAID 1220SA.
Submitted by: Dmitry S. Luhtionov <[email protected]>
Approved by: re (kib)
and decrementing unp_rights, which may otherwise be corrupted. Be
slightly more conversative in where we read unp_rights.
This relates to one of the symptoms reported in the noted PR, but may not
correct the actual high system time problem. The reporter has confirmed
stability but not that the problem is eliminated. However, this is a
useful fix to a clear locking bug.
Note that this is not an MFC as the UNIX domain socket garbage collector
has been replaced in 8.x.
PR: 127024
Reported by: Anton Yuzhaninov <citrin at citrin dot ru>
Reviewed by: kib
Approved by: re (kib)
Apply updated patch from bin/92839 to avoid two possible buffer overflows.
PR: bin/92839
Submitted by: Helge Oldach <[email protected]>
Approved by: re (gnn)
Work around an integer division resulting in 0 and thus the
congestion window not being incremented, if cwnd > maxseg^2.
As suggested in RFC2581 increment the cwnd by 1 in this case.
See http://caia.swin.edu.au/reports/080829A/CAIA-TR-080829A.pdf
for more details.
Submitted by: Alana Huebner, Lawrence Stewart,
Grenville Armitage (caia.swin.edu.au)
Reviewed by: dwmalone, gnn, rpaulo, silby
Approved by: re (gnn)
Fix deactivation of speakers while plugging in headphones on Fujitsu
U1010, Lenovo 3k N200 and Acer Aspire 4715Z.
Reviewed by: attilio
PR: 126216, 126244, 127034
Submitted by: Anton E. Kartashev <[email protected]>,
Ganael Laplanche <[email protected]>,
Dennis Generaloff <[email protected]>
Requested by: joel
Approved by: re (kib, via joel), imp (mentor, implicit)
Obtained from: joel
firewall configurations to be configured (interfaces and attached networks)
from rc.conf rather than requiring users to edit /etc/rc.firewall directly.
Approved by: re (kensmith)
Validate scratch memory addresses for BPF_STX and BPF_LDX|BPF_MEM.
A badly written filter was able to reference invalid addresses,
even cause kernel crash.
Approved by: re (kensmith)
- r182172:
Embed scratch memory in the filter structure.
- r182173:
Fix a typo in copyrights.
- r182220:
Move empty filter handling to MI source.
- r182376:
Initialize scratch memory for JIT-compiled filter when it is allocated.
Previously it may have contained unnecessary (even sensitive) data from
the previous allocation.
As a (good) side effect, scratch memory may be used to store the previous
filter state(s) safely because it is allocated and freed with filter itself.
However, use it carefully because bpf_filter(9) does not have this behavior.
Approved by: re (kensmith)
In rev. 1.17 (r33548) of msdosfs_fat.c, relative cluster numbers were
replaced by file relative sector numbers as the buffer block number
when zero-padding a file during extension. Revert the change, it causes
wrong blocks filled with zeroes on seeking beyond end of file.
PR: kern/47628
Approved by: re (kensmith)
- When executing FreeBSD/amd64 binaries from FreeBSD/i386 or Linux/i386
processes, clear PCB_32BIT and PCB_GS32BIT bits.
- Reread the fs and gs bases from the msr unconditionally, not believing
the values in pcb_fsbase and pcb_gsbase, since usermode may reload
segment registers, invalidating the cache.
Approved by: re (kensmith)
causes packets that are looped back to have the wrong checksum when
transmitted on the wire.
PR: kern/119635
Reviewed by: rwatson
Approved by: re (rwatson)
In UDPv6, reduce scope of global udbinfo lock during append to last
matching socket by dropping it before udp6_append(), and remove
duplicate unlocks of udbinfo and inpcb in sysctl return path.
Approved by: re (kensmith)
Fix a bug, when a specially crafted ICMPV6 MLD packet could lead
to an integer divide by zero panic in the kernel, if the kernel was
run with hz<1000.
Neither i386, pc98, amd64 or sparc64 are affected in the currently
supported branches and default configuration.
Submitted by: Miikka Saukko, Ossi Herrala and Jukka Taimisto from
the CROSS project at Codenomicon Ltd. via CERT-FI.
Reviewed by: bz, rwatson
Approved by: re (SA blanket)
Approved by: so (simon)
Security: CVE-2008-2464
be part of the next version of sendmail. Putting it in now for the
upcoming 7-BETA and 6-BETA test releases.
Submitted by: Mike Tancsa
Approved by: re (kensmith)
+ Open ctty in non-blocking mode to avoid hangs during open and close(waiting
for the port to drain).
+ Handle "*" as a priority properly.
+ Test what is free'ed.
+ Dynamically determine length vs. hardcoding it.
+ Free the previous message buffer (f_prevline) only after logging all the
messages and just before the process exit. Also check f_prevline for NULL
before using it.
+ The time displayed is not synchornized with the other log destinations.
+ Fix a comment.
+ Remove extraneous NULL pointer check - the pointer is guaranteed to be
non-NULL.
For chips with a broken DC_ISR_RX_STATE which f.e. never signals
stopped nor the waiting state and also no other means to check
whether the receiver is idle (see also r163774), we have no choice
than to call mii_tick(9) unconditionally even in the case of the
DC_REDUCED_MII_POLL handling as far as the RX side is concerned.
This isn't necessarily worse than checking whether RX is idle
though because unlike as with TX we're racing with the hardware,
which might receive packets any time while we poll the MII, anyway.
Reported and tested by: Jacob Owens
Reviewed by: yongari
When getaudit(2) is unable to fit the terminal IPv6 address into the
space provided by its argument structure, return EOVERFLOW instead of
E2BIG. The latter is documented in Solaris's man page, but the
former is implemented. In either case, the caller should use
getaudit_addr(2) to return the IPv6 address.
Submitted by: sson
Obtained from: Apple, Inc.
Use ERANGE instead of EOVERFLOW selected in r182059, this seems more
appropriate even if Solaris doesn't document it (E2BIG) or use it
(EOVERFLOW).
Submitted by: nectar at apple dot com
Sponsored by: Apple, Inc.
Remove comments and #ifdef notyet'd code relating to directly dispatching
the IP multicast input code from the output path; we don't allow
reentrance of the input path from the IP output path, it must use the
netisr due to potential lock recursion.
When copying in and out current ICMPv6 filters on a raw IPv6 socket,
lock the inpcb and use a local stack variable to copy to/from userspace
so that sooptcopyin()/sooptcopyout() aren't called while holding an
rwlock.
While here, fix a bug in which a failed sooptcopyin() might lead to
partially consistent ICMPv6 filters on the socket by not ignoring the
error returned by sooptcopyin().
Remove broken code to replace st_mode value with ACCESSPERMS when
lstat(2) is called on symlinks -- this code appears never to have
worked. The PR this addresses suggests that the intended
original behavior is the right one, but as bde points out in the
PR comments, we do actually support storing a mode on symlinks,
so returning it seems reasonable.
This is consistent with Mac OS X, which despite documentation to
the contrary does return the mode set on a symlink, but not some
other platforms. The Single Unix Spec requires only that the
returned bits be "meaningful", which seems at best unhelpful as
advice goes.
PR: 25018
DDB scripting, textdumps, output capture, etc, all will appear in
FreeBSD 7.1 before 8.0 ships.
Spotted by: Ulrich Spoerlein <uspoerlein at gmail dot com>
DDB scripting, textdumps, output capture, etc, all will appear in
FreeBSD 7.1 before 8.0 ships.
Spotted by: Ulrich Spoerlein <uspoerlein at gmail dot com>
Adopt the slightly weaker consistency locking approach used in IPv4 raw
sockets for IPv6 raw sockets: separately lock the inpcb for determining
the destination address for a connect()'d raw socket at the rip6_send()
layer, and then re-acquire the inpcb lock in the rip6_output() layer to
query other options on the socket. Previously, the global raw IP socket
lock was used, which while correct and marginally more consistent, could
add significantly to global raw IP socket lock contention.
Decrease ping6's minimum allowed interval
from .01 to .000001.
Note that due to the architecture of ping6,
you are still limited to kern.hz pings per
second.
In mac_bsdextended's auditctl and acct policy access control checks,
return success if the passed vnode pointer is NULL (rather than
panicking). This can occur if either audit or accounting are
disabled while the policy is running.
Since the swapoff control has no real relevance to this policy,
which is concerned about intent to write rather than water under the
bridge, remove it.
PR: kern/126100
Reported by: Alan Amesbury <amesbury at umn dot edu>
- Fix baud on the Oxford OX16PCI954
- Add the Avlab Technology PCI IO 4S-850 4 port serial card.
- Add the VScom PCI-100L card.
- Add the Decision Computer Inc, PCCOM 8-port serial card.
PR: kern/110797, kern/72352, kern/69730
Further synchronization of copyrights, licenses, white space, etc from
Apple and from the OpenBSM vendor tree.
Obtained from: Apple Inc., TrustedBSD Project
Marginally decomplicate set/getsockopt code in ip6_output.c by simply
using the passed arguments explicitly and unconditionally rather than
testing them and calling panic(). The result is the same but easier
to read.
Rather than checking for a NULL so_pcb in raw_attach(), assert that
it's non-NULL, as all callers can and should already do the required
checking. Update comments a bit more to talk about rawcb allocation
for consumers.
Reviewed by: bz
Add sysctl subtree net.raw for generic raw socket infrastructure;
expose default send and receive socket buffer sizes using sysctls
so that they can be administered centrally.
Reviewed by: bz
Remove unused support for local and foreign addresses in generic raw
socket support. These utility routines are used only for routing and
pfkey sockets, neither of which have a notion of address, so were
required to mock up fake socket addresses to avoid connection
requirements for applications that did not specify their own fake
addresses (most of them).
Quite a bit of the removed code is #ifdef notdef, since raw sockets
don't support bind() or connect() in practice. Removing this
simplifies the raw socket implementation, and removes two (commented
out) uses of dtom(9).
Fake addresses passed to sendto(2) by applications are ignored for
compatibility reasons, but this is now done in a more consistent way
(and with a comment). Possibly, EINVAL could be returned here in
the future if it is determined that no applications depend on the
semantic inconsistency of specifying a destination address for a
protocol without address support, but this will require some amount
of careful surveying.
NB: This does not affect netinet, netinet6, or other wire protocol
raw sockets, which provide their own independent infrastructure with
control block address support specific to the protocol.
Reviewed by: bz
and r180715 from head to stable/7:
Minor white space synchronization to Apple version of security audit.
Comment typo fix.
Comment fix.
Use #define<tab> rather than #define<space>.
Generally avoid <space><tab> as a white space anomoly.
Further minor white space tweaks.
Remove unneeded \ at the end of a macro.
Further minor style fixes to audit.
Obtained from: Apple, Inc.
In preparation to sync Apple and FreeBSD versions of security audit,
pick up the Apple Computer -> Apple change in their copyright and
license templates.
Obtained from: Apple Inc.
Explicitly tell that one needs to start a context address with a
backslash if he/she wants to use a non-traditional delimiter, i.e.,
anything other than a slash. That is, /abc/ works as is, but xabcx
needs to be spelled as \xabcx.
Add appropriate markup.
Bump Dd.
The libc acl_valid(3) function validates the contents of a POSIX.1e ACL.
This change removes the requirement that an ACL contain no ACL_USER
entries with a uid the same as those of a file, or ACL_GROUP entries
with a gid the same as those of a file. This requirement is not in the
specification, and not enforced by the kernel's ACL implementation.
Reported by: Iustin Pop <iusty at k1024 dot org>
Invoke err() with a format string rather than directly with a passed
command line argument.
Submitted by: Alfredo Ortega <alfredo at coresecurity dot com>
Thanks to: Core Security Technologies
Clarify comments and prototypes in raw_cb.h:
- the protosw entries are used directly
- the usrreq functions are library routines, generally wrapped by
consumers rather than being used directly
- the usrreq structure entries are likewise typically wrapped
Remove the rather incorrect #if 0'd pr_input_t prototype for raw_input.
Remove two netatm-specific test parts.
Spotted by: bz
For reasons not entirely clear to me, svn merge didn't merge the deletions,
so I had to do that manually and apply mergeinfo using --record-only.
Remove netatm from HEAD as it is not MPSAFE and relies on the now removed
NET_NEEDS_GIANT. netatm has been disconnected from the build for ten
months in HEAD/RELENG_7. Specifics:
- netatm include files
- netatm command line management tools
- libatm
- ATM parts in rescue and sysinstall
- sample configuration files and documents
- kernel support as a module or in NOTES
- netgraph wrapper nodes for netatm
- ctags data for netatm.
- netatm-specific device drivers.
Reviewed by: bz
Discussed with: bms, bz, harti
MFC discussed with: des, peter
Revert the r167541: "Remove unneeded getinoquota() call in the
ufs_access()." The call to getinoquota in ufs_access() serves the
purpose of instantiating inode dquot from the vn_open(). Since quotas
are accounted only for the inodes with already attached dquot, removal
of the call prevented opened inodes from participation in the quota
calculations.
Since ufs_access() may be called with the vnode being only shared
locked, upgrade (and then downgrade) vnode lock if calling
getinoquota().
MFC r182115:
Put the relocked variable from the r182111 into the #ifdef QUOTA braces
to prevent warning about unused var on the !QUOTA kernels.
In nmount(), when we see the "force" option,
set the MNT_FORCE flag, but do not persist "force"
in the options list, since it is a command, not a persistent property
of a mount.
Similarly, when we see "reload", set MNT_RELOAD,
but delete "reload" from the options list.
Cache the cred locally in _syncache_add() while holding the locks, so
we can be sure that it's valid.
In case we abort early free it again else put it into the syncache.
We need the cred in the syncache to be able to restrict what will be
exportet by the sysctl helper function syncache_pcblist() (to netstat)
within jails.
PR: kern/126493
the kernel with CTF symbols by default. This fixes builds of 7.x on 6.x
machines. The build of dtrace tools can be re-enabled when it is fixed to
not break 6.x upgrades. I'm not sure if we need to bootstrap the library
bits differently (perhaps the libegacy needs to include libelf and
libdwarf?).
Because bfe(4) knows interrupt mask value there is no need to read
interrupt mask register again. This saves one register access per
each interrupt.
Also don't try to process frames when driver is not running.
Remove bfe_link in softc and introduce two new flags to mark
link state and detach request.
While I'm here make sure established link is IFM_10_T or
IFM_100_TX as bfe(4) just supports 10/100Mbps media.
o Sort includes and add <endian.h> to support endianness.
o Removed unneeded header files.
o bus_dma(9) fix:
- created parent tag with 1GB dma address limit with no
alignment restrictions.
- set 4096 alignment limit for Tx/Rx descriptor rings.
- separate Rx buffer tag from Tx buffer tag such that Tx tag
allows up-to 16 segments while Rx buffer tag only allows
single segment.
- it seems the controller has no alignment restrictions on Tx/Rx
buffers. Remove ETHER_ALIGN alignment restriction in Tx/Rx
buffers.
- created a spare Rx dma map which would be used to cope with
failure of loading a dma map.
- make sure to load full Tx/Rx descriptor size for Tx/Rx
descriptor dma maps, previously bfe(4) used to load single
descriptor size for each descriptor rings. I have no idea how
it could be run without problems.
- don't blindly cast bus_addr_t type to 32bits in bfe_dma_map().
- created bfe_dma_free() to free allocated dma memory/tags.
- make sure to invoke bus_dmamap_sync(9) before/after processing
descriptor rings/buffers. Because the hardware has severe dma
address space limitation, bounce-buffers would be always used
on systems with more than 1GB memory during
descriptors/buffers access.
- added Tx descriptor ring initialization function,
bfe_list_tx_init().
- moved producer/consumer index initialization to
bfe_list_tx_init() and bfe_list_rx_init() from
bfe_chip_reset().
- added bfe_discard_buf() which will update loaded descriptors
without unloading/reloading the dma map to speed up error
recovery.
- implemented Tx side bus_dmamap_load_mbuf_sg(9). The number of
segments allowed was chosen to be 16 which should be enough for
non-TSO capable hardwares. Setting SOF bit of Tx descriptor is
done in the last to avoid potential race.
- don't give up sending frames in bfe_start() until the hardware
lacks free descriptors.
- added XXX comment to second kick command and possible workaround.
- implemented Rx side bus_dmamap_load_mbuf_sg(9).
- removed bfe_dma_map_desc() as it's not needed anymore after
the conversion to bus_dmamap_load_mbuf_sg(9).
- added endianness support. With this change bfe(4) should work
on any architectures that can create bounce buffers within 1GB
address range.
- add missing bus_dmamap_sync() in bfe_tx_eof()/bfe_rx_eof().
o Use PCI_BAR instead of hardcoded value to set BARs.
Simplified register access with bus_write_4(9)/bus_read_4(9) and
removed bfe_btag, bfe_bhandle, bfe_vhandle in softc as it's not
used anymore.
o Reorder device detach logic such that bfe_detach() is also used
for handling driver attach failure case.
o Remove unnecessary KASSERT in bfe_detach().
o Remove bfe_rx_cnt, bfe_up, bfe_vpd_prodname, bfe_vpd_readonly in
softc. It's not used at all.
o Remove BFE_RX_RING_SIZE/BFE_RX_RING_SIZE/BFE_LINK_DOWN.
Import the uuid_enc_le(), uuid_dec_le(), uuid_enc_be() and
uuid_dec_be() functions. These routines are not part of the
DCE RPC API. They are provided for convenience.
Reviewed by: marcel
Obtained from: NetBSD
There's a race in kmem(4) between checking whether a page is resident
in the kernel and copying it out, causing a panic when faulting on a
nofault entry. Handle this case gracefully by letting the kernel copy
functions return EFAULT instead. As such this change addresses the
same problem as r154721 does for i386.
MFamd64: r133413
In syscall, always make a copy of parameters from trapframe, this
becauses some syscalls using set_mcontext can sneakily change
parameters and later when those syscalls references parameters,
they will wrongly use register values in mcontext_t.
PR: 72998
The PCI specifications don't explain the details on how to calculate
the latency based on the Min_Gnt register so use the algorithm found
in OpenSolaris as they probably know how to interpret the value Sun
puts into these registers (previously, the latency calculated for
66MHz was most likely wrong) and for bridges additionally set up the
secondary latency register. Also set up the bridge control register
the way it's done in OpenSolaris. As the latency register don't apply
to PCI-Express and the bridge control setup wasn't tested on sun4v
(besides most likely not being needed), expand the #ifndef SUN4V
accordingly.
Support for Apple BMAC ethernet controller and associated DBDMA support and required changes to macio and scc(4) to support multiple interrupts on macio children.
Approved by: grehan (mentor)
- Don't IPI the current CPU.
- Don't remove the current CPU from the rendezvous mask. Otherwise the
smp_rendezvous_action routine will get an incorrect count of CPUs and
won't wait for all CPUs at each barrier (it will wait for N-1).
r180955
- Out with some printfs.
- Fix a initialization of last_tsn_used
- Fix handling of mapped IPv4 addresses
r180956
Fix build breakage - kthread_exit() in 8 now has no arguments
<AND>
- Add back 0 argument for 7.
1) Adds the rest of the VIMAGE change macros
2) Adds some __UserSpace__ on some of the common defines that
the user space code needs
3) Fixes a bug when we send up data to a user that failed. We
need to a) trim off the data chunk headers, if present, and
b) make sure the frag bit is communicated properly for the
msgs coming off the stream queues... i.e. we see if some
of the msg has been taken.
Obtained from: jeli contributed the VIMAGE changes on this pass Thanks Julain!
From:r179783
- Macro-izes the packed declaration in all headers.
- Vimage prep - these are major restructures to move
all global variables to be accessed via a macro or two.
The variables all go into a single structure.
- Asconf address addition tweaks (add_or_del Interfaces)
- Fix rwnd calcualtion to be more conservative.
- Support SACK_IMMEDIATE flag to skip delayed sack
by demand of peer.
- Comment updates in the sack mapping calculations
- Invarients panic added.
- Pre-support for UDP tunneling (we can do this on
MAC but will need added support from UDP to
get a "pipe" of UDP packets in.
- clear trace buffer sysctl added when local tracing on.
From:r179786
- Fixes foobar on my part. Some missing virtualization macros from
specific logging cases.
From r179803
- only one functino to destroy an SCTP stack sctp_finish()
- Make it so this function also arranges for any threads
created by the image to do a kthread_exit()
- sctputil.c - If debug is on, the INPKILL timer can deref a freed value.
Change so that we save off a type field for display and
NULL inp just for good measure.
- sctp_output.c - Fix it so in sending to the loopback we use the
src address of the inbound INIT. We don't want
to do this for non local addresses since otherwise
we might be ingressed filtered so we need to use
the best src address and list the address sent to.
Obtained from: time bug - Neil Wilson
- Adds support for the multi-asconf (From Kozuka-san)
- Adds some prepwork (Not all yet) for vimage in particular
support the delete the sctppcbinfo.xx structs. There is
still a leak in here if it were to be called plus we stil
need the regrouping (From Me and Michael Tuexen)
- Adds support for UDP tunneling. For BSD there is no
socket yet setup so its disabled, but major argument
changes are in here to emcompass the passing of the port
number (zero when you don't have a udp tunnel, the default
for BSD). Will add some hooks in UDP here shortly (discussed
with Robert) that will allow easy tunneling. (Mainly from
Peter Lei and Michael Tuexen with some BSD work from me :-D)
- Some ease for windows, evidently leave is reserved by their
compile move label leave: -> out:
- Define changes in sctp.h
- Bug in CA that does not get us incrementing the PBA properly which
made us more conservative.
- comment updated in sctp_input.c
- memsets added before we log
- added arg to hmac id's
Bring in support for the MC8755 Sierra UMTS card.
Submitted by: Robert Blacquiere <robert at blacquiere dot nl>
Approved by: imp (mentor, implicit)
MFC after: 1 week
Approved by: imp (mentor, implicit)
With MFC help from: des (thanks!)
pattern-matching tests. Two bug fixes:
* Don't remove leading '/' from patterns to be matched.
This aligns the pattern-matching with GNU tar and with earlier
versions of bsdtar.
* Write unedited paths for -t. This makes the pattern-matching
behavior, in particular, a lot more transparent. The cost is
that you have no good way to preview the effects of pathname
substitutions.
PR: bin/117909
With SECURE_NODOTDOT, this isn't needed because we refuse to restore
anything with '..' in the path. Without, we used to refuse path/..
as a special case (on the grounds that it was silly), but "cpio -p .."
is a common and perfectly valid idiom that incidentally copies "."
to "..".
Before this, the often-recommended incantation
find -d . | cpio -p <target>
fails to properly carry through dir metadata because each
file copy implicitly creates the parent dir, which cpio subsequently
refuses to overwrite. With this patch, the incantation works
with or without the -d option to find because without it, there
is no implicit dir creation, and with it, the subsequent dir
restore will update the metadata on the dir.
- Use m_collapse(9) instead of m_defrag(9) if possible. This results
in a noticeable reduction in system time spent.
- If bus_dmamap_load_mbuf_sg(9) fails with EFBIG and we already have
defragmented the mbuf chain, don't bother to defragment and load it
a second time just yet as it's likely to fail again anyway.
Update the comment regarding the workaround for the BlackBird
TICK_COMPARE bug and the instruction alignment used for it based
on information found in the OpenSolaris source.
PHY only and not also in the case of an external PHY currently
doing full duplex, which accidentally got broken in r172334.
It's still not clear to me why we need to enable the buffer for
an internal PHY though.
- Count excess and late collisions as output errors. [1]
- Count receive errors as input errors. [1]
Obtained from: NetBSD [1]
- Add kbdmux(4); since sunkbd(4) was tought to emulate atkbd(4) like
ukbd(4) does and that emulation was enabled by default, all three of
them work together with kbdmux(4) out of the box just fine.
- Fix some whitespace bugs.
Don't use memcpy() to copy several bytes.
Store IDs is host order. It is not so important to bloat code for it.
Combine m_adj() and M_PREPEND() into single M_PREPEND().
Add hash table lookup for a fully connected raw sockets.
This gives significant performance improvements when many raw sockets used.
Benchmarks of mpd handeling 1000 simultaneous PPTP connections show up to 50%
performance boost. With higher number of connections benefit becomes even
bigger. PopTop snd others should also get some benefits.
MFC r180833, r180874
According to in_pcb.h protocol binding information has double locking.
It allows access it while list travercing holding only global pcbinfo lock.
This relaxed locking noticably increses receive socket lookup performance.
Increase UDBHASHSIZE from 16 to 128 items.
Previous value was chosen 10 years ago and not very effective now.
This change gives several percents speedup on 1000 L2TP mpd links.
- r179967, r179968, r179977, r179978:
Rehash and clean up BPF JIT compiler macros to emit opcodes closer
to GNU as(1) generated codes and micro-optimize.
- r181644, r181645:
Replace number of stack usages with registers. Note amd64 version
does not use stack any more because it has more registers.
- r181697:
Remove unnecessary jump instructions of zero offsets.
- r181700, r181848, r181853:
Correctly check unsignedness of all registers used for load instructions
with (in)direct offsets and sync. with sys/net/bpf_filter.c
- r181648, r181649, 181846:
Update copyrights, fix style(9) nits, remove unused macros, and make
JIT compilers compilable on user land.
In the hid parser, if a INPUT/OUTPUT/FEATURE item is skipped, its
corresponding USAGE should be skipped as well.
Tested by: Grzegorz Blach
PR: usb/125941
Introduce a new loader tunable "hw.ata.ata_dma_check_80pin", defaulting
to 1. This can be used to disable the 80pin cable check on systems which
forget to set the bit -- such as certain laptops and Soekris boards.
Sync sys/compat/ndis to HEAD.
- Correct the calculation for the number of 100ns intervals since January 1,
1601. The 1601 - 1970 period was in seconds rather than 100ns units.
- Remove duplication by having NdisGetCurrentSystemTime call ntoskrnl_time.
- Implement functions required by some ndis drivers.
- Fix a panic when it occurred during initializing the ndis driver because it
try to read network address through ifnet structure which is NULL until the
ndis driver's initialization is finished.
- fix a page fault that it occurred during ifp is NULL. This bug happens when
NDIS driver's initialization is failed and NDIS driver's trying to call
NdisWriteErrorLogEntry().
when NDIS framework try to query/set informations NDIS drivers can
return NDIS_STATUS_PENDING. In this case, it's waiting for 5 secs to
get the response from drivers now. However, some NDIS drivers can send
the response before NDIS framework gets ready to receive it so we might
always be blocked for 5 secs in current implementation. NDIS framework
should reset the event before calling NDIS driver's callback not after.
handle .INF files for PCMCIA correctly that specify multiple entries in
their [Manufacturer] sections and prevent a case that NDIS_PCI_DEV_TABLE
definition was always emitted that it's only emitted once if a .INF file
is for PCI.
Fix a panic that a priority value which is passed to cv_broadcastpri(9)
can be < 0. We don't ignore a `increment' argument but at least we keep
a priority value of NDIS threads over PRI_MIN_KERN.
Reviewed by: thompsa
s/printf/device_printf/g
Don't hard code function name in device_printf() and use __func__.
While I'm here nuke bfe_unit in softc as it's not needed anymore.
Add glxsb(4) driver for the Security Block in AMD Geode LX processors (as
found in Soekris hardware, for instance). The hardware supports
acceleration of AES-128-CBC accessible through crypto(4) and supplies
entropy to random(4).
Nuke local jumbo allocator and switch to use of UMA backed page
allocator for jumbo frame.
o Removed unneeded jlist lock which was used to manage jumbo
buffers.
o Don't reinitialize hardware if MTU was not changed.
o Added additional check for minimal MTU size.
o Added a new tunable hw.skc.jumbo_disable to disable jumbo frame
support for the driver. The tunable could be set for systems that
do not need to use jumbo frames and it would save
(9K * number of Rx descriptors) bytes kernel memory.
o Jumbo buffer allocation failure is no longer critical error for
the operation of sk(4). If sk(4) encounter the allocation failure
it just disables jumbo frame support and continues to work without
user intervention.
With these changes jumbo frame performance of sk(4) was slightly
increased and users should not encounter jumbo buffer allocation
failure. Previously sk(4) tried to allocate physically contiguous
memory, 3388KB for 256 Rx descriptors. Sometimes that amount of
contiguous memory region could not be available for running systems
which in turn resulted in failure of loading the driver.
Nuke local jumbo allocator and switch to use of UMA backed page
allocator for jumbo frame. Also remove unneeded jlist lock which
is no longer required to protect jumbo buffers.
With these changes jumbo frame performance of nfe(4) was slightly
increased and users should not encounter jumbo buffer allocation
failure anymore.
Restore link state handling which was broken in rev 1.69.
Also report current link state while auto-negotiation is in
progress.
With this change link loss should be reported within a second
and drivers that rely on link state should work.
Implement the per-open file data for the cdev.
The td_fpop member of the struct thread is appended to the end, and cleared
in the thread allocator to keep struct thread KBI-compatible on RELENG_7.
MFC r181635:
Remove unnecessary locking around pointer fetch.
Introduce an UMA backend page allocator for the jumbo frame zones that
allocates physically contiguous memory.
MFC after: 3 months
Requested and reviewed by: Kip Macy
Tested by: Andrew Gallatin and Pyun YongHyeon
Approved by: alc
Reintroduce UMA_SLAB_KMAP; however, change its spelling to
UMA_SLAB_KERNEL for consistency with its sibling UMA_SLAB_KMEM.
(UMA_SLAB_KMAP met its original demise in revision 1.30 of
vm/uma_core.c.) UMA_SLAB_KERNEL is now required by the jumbo frame
allocators. Without it, UMA cannot correctly return pages from the
jumbo frame zones to the VM system because it resets the pages' object
field to NULL instead of the kernel object. In more detail, the jumbo
frame zones are created with the option UMA_ZONE_REFCNT. This causes
UMA to overwrite the pages' object field with the address of the slab.
However, when UMA wants to release these pages, it doesn't know how to
restore the object field, so it sets it to NULL. This change teaches
UMA how to reset the object field to the kernel object.
Crashes reported by: kris
Fix tested by: kris
Approved by: alc
Fix a regression introduced in r179289 splitting up ip6_savecontrol()
into v4-only vs. v6-only inp_flags processing.
When ip6_savecontrol_v4() is called from ip6_savecontrol() we
were not passing back the **mp thus the information will be missing
in userland.
Istead of going with a *** as suggested in the PR we are returning
**mp now and passing in the v4only flag as a pointer argument.
PR: kern/126349
r178376, r178377, r178378, r178419, r179412, r179414, r180127, r180338,
r180343, r180344, r180346, r180348, r180368, r180422, r180429, r180536,
r180558, r180589, r181364, r181365 from head to stable/7:
Introduce and use rwlocks throughout the inpcbinfo and inpcb infrastructure,
and protocols that depend on that infrastructure, including UDP, TCP, and
IP raw sockets. Significant parts of this work were reviewed by Bjoern Zeeb,
and tested by Paul Saab, Kris Keneway, and George Neville-Neil, whose
contributions to this work are greatly appreciated.
Tested by: ps, kris, gnn, Mike Tancsa <mike at sentex dot net>
Reviewed by: bz, des
5416 and similar chips grew another region in the pci clock domain
where register accesses do not pass through the byte-lane hardware;
extend the register op macros to deal with this
* Enhance the chunk map to support run coalescing, and substantially reduce
the number of red-black tree operations performed.
* Remove unused code.
* Fix arena_run_reg_dalloc() to use the entire precomputed division table.
* Improve lock preemption performance for hyperthreaded CPUs.
Don't forget to set MAKEFLAGS in the childs' environment
from the .MAKEFLAGS global variable even if it's empty or
unset. This means setting MAKEFLAGS to just an empty string
in the latter case.
The non-POSIX environment variable MAKE was superseded
by MAKEFLAGS ages ago, so don't mention it in comments.
Update the manpage accordingly and make the whole description of
MAKEFLAGS and .MAKEFLAGS more consistent as this change indeed
brings more consistency into the reliable behaviour of make(1).
Give more details in the manpage on the following topics:
o How global, command-line, and environment variables relate.
o What peculiarities the -f option has WRT ${MAKEFLAGS}.
(.Dd in the manpage is already beyond the date of those changes
in HEAD.)
Add a new ioctl for changing the read filter (BIOCSETFNR). This is
just like BIOCSETF but it doesn't drop all the packets buffered on
the discriptor and reset the statistics.
Also, when setting the write filter, don't drop packets waiting to
be read or reset the statistics.
(Micro)optimization of cpu_switch for amd64.
Because r173004 (pure kernel threads) is not MFCed to stable/7, I use
P_KTHREAD flag from curthread->td_proc->p_flag instead of TDP_KTHREAD
flag from curthread->td_pflags to test whether the fs/gs bases need to
be restored [1].
No objections for MFC from: peter
Suggested by: jhb [1]
MFC r180992:
Bring back the save/restore of the %ds, %es, %fs and %gs registers for
the 32bit images on amd64.
The end result is almost complete syncronization of the
amd64/amd64/cpu_switch.S between head and stable/7, besides TDP_KTHREAD
difference.
Set magic fbsd:nokeywords property
Remove Theory, which isn't part of the zoneinfo module but came out
of /head/usr.sbin/zic (and isn't installed from there neither).
MFC of tzdata2008c
- Africa/Morocco will have DST in 2008.
- Asia/Choibalsan should be GMT+08:00.
- Asia/Pakistan will have DST in 2008.
MFC of tzdata2008d
- Mauritius will have a DST experiment between 2008-11-01 and 2009-03-31.
- Add/Fix historical data for C-Eur, the SovietZone, Germany,
Bahamas, San Luis.
- Add information about West Para (America/Santarem)
- America/Eirunepe and America/Rio_Branco go to UTC-4
MFC on tzdata2008e:
- Fix dates in 2008/2009 for Africa/Mauritius.
- Leap second notification for the end of 2008.
Update the units library file.
- Merge changes from NetBSD and OpenBSD.
- Add the Euro as a primitive unit, add old converted currency and
pegged currency (Obtained from Wikipedia)
- Rename "dollar" to "usdollar" as primitive unit, remove non-pegged
currency and add pegged currency (Obtained from Wikipedia)
- Updated the accuracy of a lot of constants (Obtained from Wikipedia)
PR: bin/106545 bin/88252
Submitted by: trasz<[email protected]>, J Vinopal <[email protected]>
Note that some of the changes that were mfc'ed to powerpc actually affect
other platforms. This hoisting brings those changes to the others.
This adds atomic_fetchadd_long to the rest, and adds
atomic_readandclear_ptr to ia64. While I have not compile tested this, it
looks harmless.
had several "all revs" merges. If this is exported up to the root of sys
as-is, then it records that 'all revs' of head have been merged for the
entire sys tree, which they have not.
Work is in progress to sanitize the current state and prevent it from
happening again.
User may do "mount -o snapshot ...", that causes new FFS mount to be
performed with snapshot option, while the mp->mnt_opt is NULL.
Protect against NULL pointer dereference.
MFC r181528:
Revert r181345.
Move the NULL pointer check to the vfs_deleteopt() function.
Delete unused files in the window(1) directory that contain a colon.
During the import of the 4.4BSD Lite sources, four files got added to
the repository called :tt, :tty, :var and :ww. They seem to contain some
kind of debug information. These files aren't used/installed anywhere.
Unfortunately the colons in the filenames prevents us from checking out
the source tree on file systems that don't support colons (such as FAT).
Just remove these unneeded files to keep SVN happy.
Reported by: Rohit Tripathi <rohit trip gmail com>
Improve VT_WAITACTIVE semantics.
- Wait for requested vty activation regardless its open state.
- Remove redundant console cleanup.
MFC r181286:
Lower the priority of the sleep in the syscons for "waitvt" wchan to
PZERO + 1.
Calling linker_load_dependencies() while holding the module'
vnode lock may cause a LOR between kld_sx lock and vnode lock.
linker_load_dependencies() drops kld_sx, and another thread may attempt
to load the same kld.
Cumulatively, these implement CRC32 validation when reading Zip
archives and the test suite updates to ensure that CRC32
checking really will fail on a damaged entry and succeed on
a valid one.
> Check that lseek(2) succeeds and puts us where we expect. [1]
>
> While we're here, fix a long-standing bug in the handling of write(2)
> errors: The API changed from "return # of bytes written" to "return
> status code" almost 4 years ago, so instead of returning (-1) we need
> to return ARCHIVE_FATAL.
>
> Found by: Coverity Prevent [1]
> We only use the string "?rwxrwxrwx " once, so inline it rather than
> declaring a variable which points to it. Aside from eliminating a
> line of code and one level of unnecessary indirection, this eliminates
> a false positive in Coverity.
stable/7/lib/libarchive was already almost identical to
head/lib/libarchive@177777. This matches it up exactly
(except that I declined to resurrect the .cvsignore file)
and records that alignment in svn:mergeinfo.
r181272:
Use ANSI C declarations for all functions.
r181273:
Remove register keyword.
r181274:
Remove return keyword at the end of functions that return void.
r181275:
Rearrange conditional compilation directives. This makes syntax
highlighting work in vim.
Don't enable TSO by default. Users of RTL8169/8110 reported
watchdog timeout issues and the root cause seems to stem from
silicon bug of controller. Personally I couldn't reproduce it on
RTL8169 controller but it seems it's dependent on usage pattern.
For newer PCIe based controllers I have no TSO complaints but
turning off TSO would be more safe. Users who are sure that
their controller works with TSO can still reenable the TSO with
ifconfig(8).
The number of bits reserved for MSS in RealTek controllers is
11bits. This limits the maximum interface MTU size in TSO case
as upper stack should not generate TCP segments with MSS greater
than the limit. Armed with this information, disable TSO if
interface MTU is greater than the limit.
Implement ratelimiting for debug messages. For now, allow at most
one message per second. In the future might add a sysctl knob for
each socket family to fine tune this.
Add rw_try_rlock() and rw_try_wlock() to rwlocks.
These functions try the specified operation (rlocking and wlocking) and
true is returned if the operation completes, false otherwise.
The KPI is enriched by this commit, so __FreeBSD_version bumping and
manpage updating will happen soon.
Requested by: jeff, kris
Trylocks were implemented, remove stale comment
Discussed with: attilio, jhb
Detect if the application has cleared the environ variable by setting
the first value (environ[0]) to NULL. This is in addition to the
current detection of environ being replaced, which includes being set to
NULL. Without this fix, the environment is not truly wiped, but appears
to be by getenv() until an *env() call is made to alter the enviroment.
This change is necessary to support those applications that use this
method for clearing environ such as Dovecot and Postfix. Applications
such as Sendmail and the base system's env replace environ (already
detected). While neither of these methods are defined by SUSv3, it is
best to support them due to historic reasons and in lieu of a clean,
defined method.
Add extra units tests for clearing environ using four different methods:
1. Set environ to NULL pointer.
2. Set environ[0] to NULL pointer.
3. Set environ to calloc()'d NULL-terminated array.
4. Set environ to static NULL-terminated array.
Noticed by: Timo Sirainen
Reviewed by: ache
- Bring in auditing support of coredumps
- Merge supporting tweaks which initialized some variables and
fixed a proc lock leak in certain error conditions.
Add support for the ASUS P535 PDA
PR: kern/126097
Submitted by: Anton Kartashev <[email protected]>
Approved by: imp (mentor, implicit)
MFC after: 3 days
Approved by: imp (mentor, implicit)
- Never use getenv("HOME") without checking for NULL and non-zero (kevlo)
- If we can't open a calendar file, don't guess why. Check the error
return and print a useful message (grog)
The TrustedBSD MAC Framework named struct ipq instances 'ipq', which is the
same as the global variable defined in ip_input.c. Instead, adopt the name
'q' as found in about 1/2 of uses in ip_input.c, preventing a collision on
the name. This is non-harmful, but means that search and replace on the
global works less well (as in the virtualization work), as well as indexing
tools.
Reported by: julian
Introduce locking around use of ifindex_table, whose use was previously
unsynchronized. While races were extremely rare, we've now had a
couple of reports of panics in environments involving large numbers of
IPSEC tunnels being added very quickly on an active system.
- Add accessor functions ifnet_byindex(), ifaddr_byindex(),
ifdev_byindex() to replace existing accessor macros. These functions
now acquire the ifnet lock before derefencing the table.
- Add IFNET_WLOCK_ASSERT().
- Add static accessor functions ifnet_setbyindex(), ifdev_setbyindex(),
which set values in the table either asserting of acquiring the ifnet
lock.
- Use accessor functions throughout if.c to modify and read
ifindex_table.
- Rework ifnet attach/detach to lock around ifindex_table modification.
Note that these changes simply close races around use of ifindex_table,
and make no attempt to solve the probem of disappearing ifnets. Further
refinement of this work, including with respect to ifindex_table
resizing, is still required.
In a future change, the ifnet lock should be converted from a mutex to an
rwlock in order to reduce contention.
Reviewed and tested by: brooks
Update this manual page to describe the extattr_list_file() and the
extattr_list_fd() functions.
PR: 108142
Submitted by: Richard Dawe <[email protected]>
Reviewed by: kientzle
Be smarter about disabling interface capabilities. TOE/TSO/TXCSUM will only be
disabled if one (or more) of the member interfaces does not support it. Always
turn off LRO since we can not bridge a combined frame.
to those in r172955, only don't rename any externally accessible symbols.
This moves the policy modules in stable/7 to being closer to those in
head without disrupting the KBI. While here, also synchronize some
amount of white space.
Obtained from: TrustedBSD Project
Rename raw_append() to rip_append(): the raw_ prefix is generally used
for functions in the generic raw socket library (raw_cb.c, raw_usrreq.c),
and they are not used for IPv4 raw sockets.
Rename several functions in if_lmc with potential name collisions with
global symbols, such as raw_input and raw_output, to have lmc_ prefixes.
This doesn't affect actual functionality since the functions are static,
but will limit the opportunities for current confusion and future
difficulty.
cvs rev. 1.208 in_pcb.c, 1.108 in_pcb.h, 1.92 in6_pcb.c, 1.21 in6_pcb.h
For consistency take lport as u_short in in{,6}_pcblookup_local.
All callers either pass in an u_short or u_int16_t.
cvs rev. 1.91 in6_pcb.c, 1.52,1.53 in6_src.c, 1.43 ip6_var.h
rev. 1.80 raw_ip6.c, 1.91 udp6_usrreq.c
Change the parameters to in6_selectsrc():
- pass in the inp instead of both in6p_moptions and laddr.
- pass in cred for upcoming prison checks.
Document required locking in in6_sleectsrc() in case an inp is
passed in by adding an assert.
Requested by: rwatson
Change the exit status for 0 and 2 to be the same as with ping(1)
and be usable in scripts, etc.
This also changes the semantics in case when we lose one of n packets.
In that case, before we exited by SIG, now we exit with return(0).
Submitted by: Gert Doering (gert space.net)
Add new device id for ICH8M, which supports greater than UDMA33 mode
when it worked as generic IDE.
PR: 125422
Submitted by: Andrey V. Elsukov <bu7cher at yandex dot ru>
Approved by: imp (mentor, implicit)
MFC after: 1 week
Approved by: imp (mentor, implicit)
Add support for the ICH9 in non AHCI mode (RAID mode).
Submitted by: Andrey V. Elsukov <bu7cher at yandex dot ru>
Tested by: Vitalij L. Fadeev <fvl at mail dot ru>
Approved by: imp (mentor, implicit)
MFC after: 1 week
Approved by: imp (mentor, implicit)
Add an XXX comment regarding a bug I introduced when modifying the behavior
of audit log vnode rotation: on shutdown, we may not properly drain all
pending records, which could lead to lost records during system shutdown.
When allocating temporary storage to hold a TCP/IP packet header
template, use an M_TEMP malloc(9) allocation rather than an mbuf
with mtod(9) and dtom(9). This eliminates the last use of
dtom(9) in TCP.
Move the head of byte-level advisory lock list from the
filesystem-specific vnode data to the struct vnode. Provide the
default implementation for the vop_advlock and vop_advlockasync.
Purge the locks on the vnode reclaim by using the lf_purgelocks().
The default implementation is augmented for the nfs and smbfs.
In the nfs_advlock, push the Giant inside the nfs_dolock.
Before the change, the vop_advlock and vop_advlockasync have taken the
unlocked vnode and dereferenced the fs-private inode data, racing with
with the vnode reclamation due to forced unmount. Now, the vop_getattr
under the shared vnode lock is used to obtain the inode size, and
later, in the lf_advlockasync, after locking the vnode interlock, the
VI_DOOMED flag is checked to prevent an operation on the doomed vnode.
MFC r178247:
Fix compilation with LOCKF_DEBUG.
As was announced on the stable@, the MFC changes the VFS KBI on RELENG_7.
Approved by: re (kensmith)
Fix empty mailto (-m "") handling: somehow I missed all checks but the first,
hence output would be written to the wrong filehandle.
Submitted by: reg
Approved by: yar (implicit)
MFC after: ASAP
Pointy hat to: marck
Use logic or, not binary or, when deciding whether or not a system call
exit requires entering the audit code. The result is much the same,
but they mean different things.
Submitted by: Diego Giagio <dgiagio at gmail dot com>
Pair the VOP_OPEN call from do_execve() with the reciprocal VOP_CLOSE.
Note: the change needed small adaptation to RELENG_7 because fexecve(2)
is not merged into the branch.
- Add socket option for setting and retrieving the congestion control algorithm.
The name used is to allow compatibility with Linux.
- add rcv_nxt, snd_nxt, and toe offload id to FreeBSD-specific
extension fields for tcp_info
Factor out the v4-only vs. the v6-only inp_flags processing in
ip6_savecontrol in preparation for udp_append() to no longer
need an WLOCK as we will no longer be modifying socket options.
Requested by: rwatson
Reviewed by: gnn
Move IFF_NEEDSGIANT warning from if_ethersubr.c to if.c so it is displayed
for all network interfaces, not just ethernet-like ones.
Upgrade it to a louder WARNING and be explicit that the flag is obsolete.
Support for IFF_NEEDSGIANT will be removed in a few months (see arch@ for
details) and will not appear in 8.0.
Upgrade if_watchdog to a WARNING.
After the commit of SVN rev 180236, wilko@ noticed that the approach
doesn't work on the Alpha platform: machine/elf.h doesn't include
sys/elf32.h there.
PR: related to bin/124906
Approved by: bde@
- Increase the size of the salt in pw(8) from 8 to 32 (same as in pam_unix(8)).
This makes blowfish password hashes look normal when set using
pw(8)/adduser(8). [1]
- Make it possible to have a '/' in the salt.
PR: 121146 [1]
Submitted by: Jaakko Heinonen [1]
Approved by: rwatson (mentor)
MFC after: 1 month
Since we create a DMA tag "mtag" for TX map with bus_dmamap_create(),
we must synchronize such a map against "mtag" with bus_dmamap_sync(),
not the tag designated for RX map.
Don't let hacksync() call bus_dmamap_sync(9) on DMA maps which
are not initialized. This fixes a panic on sparc64 where calling
bus_dmamap_sync(9) on NULL DMA maps is fatal.
Refactor certain ARM bus space methods: instead of having multiple copies of
the same code introduce sys/arm/arm/bus_space_generic.c for a shared set of
routines.
Take the first baby step towards unifying and cleaning up arminit():
- Pull all the code to deal with the trampoline stuff into one
centeralized place and use it from everywhere.
- Some minor style tidiness
KERNBASE + 0x00200000 is the same thing as KERNVIRTADDR on this
platform, so use the latter in preference to the former. This makes
the fake_preload setup be the same between kb920x_machdep.c and
avila_machdep.c....
Improve mac+phy configuration so that hints can be used to describe
layouts different than the defaults:
o hint.npe.0.mac="A", "B", etc. specifies the window for MAC register accesses
o hint.npe.0.mii="A", "B", etc. specifies PHY registers
o hint.npe.1.phy=%d specifies the PHY to map to a port
Workaround design botch in usb: blindly mixing bus_dma with PIO does not
work on architectures with a write-back cache as the PIO writes end up
in the cache which the sync(BUS_DMASYNC_POSTREAD) in usb_transfer_complete
then discards; compensate in the xfer methods that do PIO by pushing the
writes out of the cache before usb_transfer_complete is called.
Correct cache handling for xfer requests marked URQ_REQUEST: many (if not
all uses) involve a read but usbd_start_transfer only does a PREWRITE; change
this to BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE as I'm not sure if any
users do write+read.
Correct the logic : we can just invalidate the cache lines, and not
write-back them, only if PREWRITE is not set, and if the buffer is
cache-line aligned.
Add DDB "show conifhk" command, which lists hooks currently waiting
for completion in run_interrupt_driven_config_hooks(). This is
helpful when trying to figure out which device drivers have gone
into la-la land during boot-time autoconfiguration.
Rather than simply waiting silently and indefinitely for all
interrupt-driven configuration handlers to complete, print out a
diagnostic message every 60 second indicating which handlers are
still running. Do this at most 5 times per run so as to avoid
scrolling out any useful information from the kernel message
buffer.
The interval of 60 seconds was selected based on a best guess as
to the nature of "long enough" and may want to be tuned higher
or lower depending on real-world tolerances.
If run_interrupt_driven_config_hooks() waits 360 seconds and INVARIANTS
is compiled into the kernel, then panic.
Discussed with: scottl
Add -m option to cron(8), overriding default mail recipient for cron
mails, unless explicitly provided by MAILTO= line in crontab. This
feature can be useful in massive hosting environment, where most users
do not care about autogenerated mails.
Setting recipient to null string disables default mails at all.
Approved by: yar
introduced for the KSE case in the r177083. Both were done by jeff,
MFC is needed due to recent cpuset(2) commit to RELENG_7.
r177083:
KSE may free a thread that was never actually forked. This will leave
td_cpuset NULL. Check for this condition before dereferencing the
cpuset.
r177369:
Restore the NULL check for td_cpuset. This can happen if a partially
constructed thread was torn down as is the case when we fail to allocate
a kernel stack.
and assignment. This is mostly synched up with what is in HEAD with the
following exceptions:
- I didn't MFC any of the interrupt binding stuff as it requires other
changes and I figured this change was large enough as it is.
- The sched_affinity() implementation for ULE in HEAD depends on the newer
CPU topology stuff as well as other changes in ULE. Rather than
backport all of that, I implemented sched_affinity() using the existing
CPU topology and ULE code in 7.x. Thus, any bugs in the ULE affinity
stuff in 7 are purely my fault and not Jeff's.
Note that, just as in HEAD, cpusets currently don't work on SCHED_4BSD (the
syscalls will succeed, but they don't have any effect).
Tested by: brooks, ps
Make it atomic for the devfs_populate_loop() to see the setting of
SI_ALIAS flag and initialization of the si_parent when alias is created.
Assert that supplied parent device is not NULL.
Fix a multicast handling regression on VT6105M introduced in
vr(4) overhauling(r177050).
It seems that filtering multicast addresses with multicast CAM
entries require accessing 'CAM enable bit' for each CAM entry.
Subsequent accessing multicast CAM control register without
toggling the 'CAM enable bit' seem to no effects.
In order to fix that separate CAM setup from CAM mask configuration
and CAM entry modification. While I'm here add VLAN CAM filtering
feature which will be enabled in future(FreeBSD now can receive
VLAN id insertion/removal event from vlan(4) on the fly).
For VT6105M hardware, explicitly disable VLAN hardware tag
insertion/stripping and enable VLAN CAM filtering for VLAN id 0.
This shall make non-VLAN frames set VR_RXSTAT_VIDHIT bit in Rx
status word.
Added multicast/VLAN CAM address definition to header file.
PR: kern/125010, kern/125024
Fix VR_RXSTAT_RX_OK bit definition which lasted for more than 9
years. All datasheet I have indicates the bit 15 is the
VR_RXSTAT_RX_OK. The bit 14 is reserved for all Rhine family
except VT6105M. VT6105M uses that bit to indicate a VLAN frame
with matching CAM VLAN id.
Use the VR_RXSTAT_RX_OK instead of VR_RXSTAT_RXERR when vr(4)
checks the validity of received frame.
This should fix occasional dropping frames on VT6105M.
* Fix typos in znew(1) script (yar, r176133 + r180136);
* Make it clear that gzcat expects each argument to be
separate files. (r180126).
* License change in unbzip2.c (r180135)
In keeping with style(9)'s recommendations on macros, use a ';'
after each SYSINIT() macro invocation. This makes a number of
lightweight C parsers much happier with the FreeBSD kernel
source, including cflow's prcc and lxr.
Discussed with: imp, rink
The requirement to place a ; after each SYSINIT definition has not been
MFC'd, as this might break the compile third-party modules, but merging
the actual ; additions reduces diffs against 8.x making it easier to
merge other changes.
- Use __FBSDID.
- Merge macros depending on the flags being preserved between calls
into a single "__asm"-statement as GCC doesn't guarantee their
consecutive output even when using consecutive "__asm __volatile"-
statement for them. Remove the otherwise unnecessary "__volatile". [1]
- The inline assembler instructions used here alter the condition
codes so add them to the clobber list accordingly.
- The inline assembler instructions used here uses output operands
before all input operands are consumed so add appropriate modifiers.
Pointed out by: bde [1]
The kqueue_register() function assumes that it is called from the top of
the syscall code and acquires various event subsystem locks as needed.
The handling of the NOTE_TRACK for EVFILT_PROC is currently done by
calling the kqueue_register() from filt_proc() filter, causing recursive
entrance of the kqueue code. This results in the LORs and recursive
acquisition of the locks.
Implement the variant of the knote() function designed to only handle
the fork() event. It mostly copies the knote() body, but also handles
the NOTE_TRACK, removing the handling from the filt_proc(), where it
causes problems described above. The function is called from the fork1()
instead of knote().
When encountering NOTE_TRACK knote, it marks the knote as influx
and drops the knlist and kqueue lock. In this context call to
kqueue_register is safe from the problems.
An error from the kqueue_register() is reported to the observer as
NOTE_TRACKERR fflag.
PR: 108201
Fix a longstanding bug, from Otto Moerbeck:
if we're reducing a rule that has an empty
right hand side and the yacc stackpointer is pointing at the very
end of the allocated stack, we end up accessing the stack out of
bounds by the implicit $$ = $1 action
Obtained from: OpenBSD
Add a diagnostic note about "transmission error ... tx underrun, increasing
tx start threshold ..." Looking around on the mailing lists, and even having
one of these cards I agree the messages should be documented.
Bump doc date.
PR: 88477
In case of interface initialization failure remove struct in_ifaddr* from
in_ifaddrhashtbl in in_ifinit because error handler in in_control removes
entries only for AF_INET addresses. If in_ifinit is called for the cloned
inteface that has just been created its address family is not AF_INET and
therefor LIST_REMOVE is not called for respective LIST_INSERT_HEAD and
freed entries remain in in_ifaddrhashtbl and lead to memory corruption.
PR: kern/124384
MFC after: 3 weeks
Keep proper track of nsegs counter: sem_free is called for all
allocated semaphores, so it's wrong to increase it conditionally,
in this case for every over-the-limit semaphore nsegs is decreased
without being previously increased.
PR: kern/123685
MFC after: more then 1 month
Renew semaphore's pointer after wakeup since during msleep
sem_base may have been modified by destroying one of semaphores
and semptr would not be valid in this case.
PR: kern/123731
MFC after: 1 month
Silence warning about missing IoGetDeviceObjectPointer by implementing
a simple stub that always returns STATUS_SUCCESS.
Submitted by: Paul B. Mahol <[email protected]>
Reviewed by: thompsa
Add driver support for PCIe adapters based on JMicron JMC250
gigabit ethernet and JMC260 fast ethernet controllers. ATM jme(4)
supports all hardware features except RSS and multiple Tx/Rx queue.
In these days most ethernet controller vendors take a ply of
concealing hardware detailes from open source developers. As
contrasted with these vendors JMicron provided all necessary
information needed to write a stable driver during driver writing
and answered many questions I had. They even helped fixing driver
bugs with protocol analyzer. Many thanks to JMicron for their
support of FreeBSD.
H/W donated by: JMicron
Add driver support for RTL8102E and RTL8102EL which is the second
generation of RTL810x PCIe fast ethernet controller. Note, Tx/Rx
descriptor format is different from that of first generation of
RTL8101E series. Jumbo frame is not supported for RTL810x
family.
Add basic support for RTL8168C, RTL8168CP, RTL8111C and RTL8111CP.
ATM Tx/Rx checksum offload is supported but TSO and jumbo frame is
not yet supported. Because these newer controllers use different
descriptor formats, a flag RL_FLAG_DESCV2 flag was introduced to
handle that case in Tx/Rx handler. Also newer controllers seems to
require to not touch 'enable Tx/Rx bit' in RL_CPLUS_CMD register
so don't blindly try to set that bits.
Note, it seems that there is still power-saving related issue where
driver fails to attach PHY. Rebooting seems to fix that issue but
number of required reboots varys.
Many thanks to users that helped during developement. I really
appreciate their patient and test/feedbacks.
Display detected chip revision in device attach. This will help to
diagnose revision specific issues in future. Also add 0x to notify
that the revision number is in hex form.
In device detach don't access ifnet structure unless device is
attached. This fixes NULL pointer dereference when polling(9) is
active and unsupported hardware is detected in device attach.
Improve the output of kldload(8) to show which module can't be loaded.
Was: kldload: Unsupported file type
Is now: kldload: /boot/modules/test.ko: Unsupported file type
PR: kern/121276
Submitted by: Edwin Groothuis <[email protected]>
Approved by: bde (mentor)
MFC after: 1 week
Instead of allocating variables for each events/hardware flags, use
a dedicated flag that represents controller capabilities/events.
This will simplify many part of code that requires different
workaround for each controller revisions and will enhance
readability.
While I'm here move PHY wakeup code up before mii_phy_probe() which
seems to help to wake PHY in some cases.
After the change of r176757 re(4) no longer relys on reading
RL_TXCFG register to identify a device in device probe. Reflect the
fact by modifing device description with general ethernet
controller family.
Note, rl_basetype in struct rl_type is not used and the more
detailed information is provided with rl_hwrev structure.
gaames/fortune: add FORTUNE_PATH env var, so ports of fortunes can work sanely
This patch adds an environment variable FORTUNE_PATH, which
works like PATH for fortune files.
PR: bin/36867
Submitted by: Alan Eldridge <[email protected]>
[patch] fortune -e implementation bug
Fix the behaviour of "-e file1 file2" to equally pick them
instead of only picking the first one.
PR: bin/70182
Submitted by: Martin Kulas <[email protected]>
SVN rev 180349 on 2008-07-07 13:08:30Z by remko
Fix some spelling errors (improper review from my
side).
Submitted by: ed, danger
Submitted by: Florian Smeets
o The FreeBSD bus_dmamap_sync(9) supports ored together flags for quite
some time now so collapse calls accordingly.
o Given that gem_load_txmbuf() is allowed to fail resulting in a packet
drop also for quite some time now implement the functionality of
gem_txcksum() by means of m_pullup(9), which de-obfuscates the code
and allows to always retrieve the correct length of the IP header.
o Add missing BUS_DMASYNC_PREREAD when syncing the control DMA maps in
gem_rint() and gem_start_locked().
o Correct some bus_barrier(9) calls to do a read/write barrier as we
do a read after a write. Add some missing ones in gem_mii_readreg()
and gem_mii_writereg().
o According to the Apple GMAC driver, the GEM ASIC specification and
the OpenSolaris eri(7D) the TX FIFO threshold has to be set to 0x4ff
for the Gigabit variants and 0x100 for the ERI in order do avoid TX
underruns.
o In gem_init_locked():
- be conservative and enable the RX and TX MACs,
- don't clear GEM_LINK otherwise we don't ever mark the link as up
again if gem_init_locked() is called from gem_watchdog(),
- remove superfluous setting of sc_ifflags.
o Don't bother to check whether the interface is running or whether its
queue is empty before calling gem_start_locked() in gem_tint(), the
former will check these anyway.
o Call gem_start_locked() in gem_watchdog() in order to try to get
some more packets going.
o In gem_mii_writereg() after reseting the PCS restore its configuration.
GMAC testing: grehan, marcel
Add missing information for geom_mirror metadata.
PR: 124434
Submitted by: Philip M. Golluci <pgolluci at p6m7g8 dot com>
MFC after: 3 days
Prodded through: bugbusters@
Approved by: imp (mentor, implicit)
Remove a bogusly introduced rtalloc_ign() in rev. 1.335/SVN 178029,
generating an RTM_MISS for every IP packet forwarded making user space
routing daemons unhappy.
PR: kern/123621, kern/124540, kern/122338
The config-recursive target is not run during the normal install process, move
it down to where it belongs.
Document 'all-depends-list' target and bump doc date.
PR: 119519
Submitted by: Yuri Pankov <[email protected]>
Reviewed by: flz
- This code was intially obtained from NetBSD, but it's missing licence
statement. Add the one from the current NetBSD version.
- Add description about a missing return value [1]
PR: docs/75995
Submitted by: Tarc <[email protected]>
- sched_4bsd is no longer a default system scheduler on some
architectures, so call it "traditional" instead.
- sched_ule is no longer buggy or experimental (according to
rev. 1.7 of sched_ule(4)), so don't call it experimental
(reported by a user on stable@).
On 64 bit architectures, you can run 32 bit executables and the rtld can trace them, but ldd(1) doesn't know yet how to detect them:
[/] root@ed-exigent>ldd `which httpd`
ldd: /usr/local/sbin/httpd: can't read program header
ldd: /usr/local/sbin/httpd: not a dynamic executable
But...
[/] root@ed-exigent>LD_32_TRACE_LOADED_OBJECTS==1 `which httpd`
libm.so.4 => /lib32//libm.so.4 (0x280c8000)
libaprutil-1.so.2 => /usr/local/lib/libaprutil-1.so.2 (0x280de000)
libexpat.so.6 => /usr/local/lib/libexpat.so.6 (0x280f2000)
libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x28110000)
libapr-1.so.2 => /usr/local/lib/libapr-1.so.2 (0x281fd000)
libcrypt.so.3 => /lib32//libcrypt.so.3 (0x2821d000)
libpthread.so.2 => not found (0x0)
libc.so.6 => /lib32//libc.so.6 (0x28235000)
libpthread.so.2 => /usr/lib32/libpthread.so.2 (0x2830d000)
Added support in ldd(1) for the LD_32_xxx environment variables if
the architecture of the machine is >32 bits. If we ever go to 128
bit architectures this excercise will have to be repeated but thanks
to earlier commits today it will be relative simple.
PR: bin/124906
Submitted by: edwin
Approved by: bde (mentor)
Add age(4), a driver for Attansic/Atheros L1 gigabit ethernet
controller. L1 has several threshold/timer registers and they
seem to require careful tuned parameters to get best
performance. Datasheet for L1 is not available to open source
driver writers so age(4) focus on stability and correctness of
basic Tx/Rx operation. ATM the performance of age(4) is far from
optimal which in turn means there are mis-programmed registers or
incorrectly configured registers.
Currently age(4) supports all known hardware assistance including
- MSI support.
- TCP Segmentation Offload.
- Hardware VLAN tag insertion/stripping.
- TCP/UDP checksum offload.
- Interrupt moderation.
- Hardware statistics counter support.
- Jumbo frame support.
- WOL support.
L1 gigabit ethernet controller is mainly found on ASUS
motherboards. Note, it seems that there are other variants of
hardware as known as L2(Fast ethernet) and newer gigabit ethernet
(AR81xx) from Atheros. These are not supported by age(4) and
requires a seperate driver. Big thanks to all people who reported
feedback or tested patches.
Tested by: kevlo, bsam, Francois Ranchin < fyr AT fyrou DOT net >
Thomas Nystroem < thn AT saeab DOT se >
Roman Pogosyan < asternetadmin AT gmail DOT com >
Derek Tattersal < dlt AT mebtel DOT net >
Oliver Seitz < karlkiste AT yahoo DOT com >
Set bridge MAC addresses to the MAC address of their first interface unless
locally configured. This is more in line with the behaviour of other popular
bridging implementations and makes bridges more predictable after reboots for
example.
Add support for PORT/EPRT FTP commands in lowercase.
Use strncasecmp() instead of huge local implementation to reduce code size.
Check space presence after command/code.
PR: kern/73034
r180312, r180313, r180326):
A driver to monitor AMD K8 CPU temperature via builtin sensors.
This should now be fairly stable as all known bugs have been corrected.
Rev. 1.8 broke matching on lines where the failure mode is at the head
of the message, such as:
Jun 30 10:49:21 rogue sshd[17553]: Invalid user iceman from 127.0.0.1
PR: conf/124569
Submitted by: Taku <[email protected]>
- install the example wpa_supplicant.conf file to the share/examples/etc
directory [1]
- add the FILES section to the wpa_supplicant.conf.5 file, so that people
will be able to detect the example configuration file easier. [2]
PR: docs/121821 [2]
Add et(4), a port of DragonFly's Agere ET1310 10/100/Gigabit
Ethernet device driver, written by sephe@
Obtained from: DragonFly
Sponsored by: iXsystems
MFC after: 2 weeks
- markup fixes
- advise to use rc script to SIGHUP mountd
- add some missing words
- add information about possiblity of using /prefix network notation [1]
PR: docs/124373 [1]
Obtained from: NetBSD [1]
When NETATALK is compiled into the kernel, at_rmx.c is required regardless
of whether NETATALKDEBUG is enabled, so make building it conditional on
NETATALK instead. This problem appears to have been present from the time
that the netatalk implementation was imported.
PR: 124456
Submitted by: Nathan Whitehorn <whitehorn at wisc dot edu>
stable/7:
Consistently check IPFW and DUMMYNET privileges in the configuration
routines for those modules, rather than in the raw socket code. This
each privilege check to occur in exactly once place and avoids
duplicate checks across layers.
Sponsored by: nCircle Network Security, Inc.
When sendto(2) is called with an explicit destination address
argument, call mac_socket_check_connect() on that address before
proceeding with the send. Otherwise policies instrumenting the
connect entry point for the purposes of checking destination
addresses will not have the opportunity to check implicit
connect requests.
Sponsored by: nCircle Network Security, Inc.
Don't use LK_DRAIN before calling VOP_FSYNC() in the panic case for
audit trail failure -- this doesn't contribute anything, and might
arguably be wrong.
MFC after: 1 week
Requested by: attilio
Notice that the previous commit merging r179178 was in fact for
audit_worker.c:1.25, but the same description applies.
Don't use LK_DRAIN before calling VOP_FSYNC() in the panic case for
audit trail failure -- this doesn't contribute anything, and might
arguably be wrong.
Requested by: attilio
Support for filtering on major device number was removed in rev. 1.7 or
rule.c. Update man page example accordingly.
Submitted by: Mateusz Guzik <[email protected]>
PR: docs/124892
Fix test for waiting AIFs in aac_poll(). This seems to solve the
problem where Adaptec's arcconf monitoring tool hangs after producing
its expected output.
Add the missing support for Asus Eee PC in acpi_asus(4).
This includes hotkeys support and sysctl variables to control camera
and card reader. These new sysctls don't have CTFLAG_ANYBODY set.
While there add entries to devd.conf related to the Eee volume keys.
Reviewed by: phillip
Also tested by: lme (previous version)
When testing whether to enter the audit argument gathering code, rather
than checking whether audit is enabled globally, instead check whether
the current thread has an audit record. This avoids entering the audit
code to collect argument data if auditing is enabled but the current
system call is not of interest to audit.
Sponsored by: Apple, Inc.
Rename debug.ddb.capture.bytes sysctl to debug.ddb.capture.bufoff in
order to match the internal variable name.
Add a new sysctl debug.ddb.capture.inprogress to export the inprogress
variable.
Add USB ids for the Epson DX7400 / CX7300 multifunction scanner printer
card reader.
On passing, also MFC similar entries for other epson MFP devices.
MFC after: 3 days
stable/7:
Continue on-going campaign to replace lockmgr locks with sx locks where
the specific semantics of lockmgr aren't required: update UFS1 extended
attributes to protect its data structures using an sx lock.
While here, update comments on lock granularity.
- Add locking to all filesystem operations in fdescfs and flag it as MPSAFE.
- Use proper synhronization primitives to protect the internal fdesc node cache
used in fdescfs.
- Properly initialize and uninitalize hash.
- Remove unused functions.
Since fdescfs might recurse on itself, adding proper locking to it needed some
tricky workarounds in some parts to make it work. For instance, a descriptor in
fdescfs could refer to an open descriptor to itself, thus forcing the thread to
recurse on vnode locks. Because of this, other race conditions also had to be
fixed.
Approved by: kib (mentor)
Reviewed by: kib (mentor)
Tested by: pho
resource to a CPU. A bus_bind_intr(9) wrapper routine similar to
bus_setup/teardown_intr() is added for device drivers to use. Currently
it is supported on amd64, i386, and sparc64 via nexus(4) methods that
simply call the intr_bind() routine.
- Add a new method to interrupt events (ie_assign_cpu) for binding events
to CPUs.
- Bind ithreads to CPUs in their main loop (this is the original
implementation, it may be changed if the cpuset stuff is MFC'd).
- Add intr_event_bind().
- Implement ie_assign_cpu() and a 'intr_bind()' wrapper on amd64, i386,
and sparc64.
Honour the logical current working directory ($PWD) when using config's
-d destdir option. For an automounted src tree using the logical cwd
in the Makefile keeps amd(8)'s mount timeout refreshed. Code to check
$PWD's validity cribbed from pwd(1).
Discussed on hackers@.
MFC 179269-179270
- delete "snapshot" from options list after we convert mount option to MNT_SNAPSHOT flag
- do not perform string to flag conversions for mount option which are converted
further up in vfs_donmount() in vfs_mount.c
vfs_mount.c:
MFC 179268
- Do not convert the "snapshot" string to the MNT_SNAPSHOT flag here, since
we do it further down in ffs_vfsops.c
PR: 122833
Rewrite node's r/w/q-lock semantics using only atomics instead of mutex
and atomics combination. Mutex is now used only for queue protection.
Also avoid unneded extra swi scheduling calls.
Add memory barriers to the node locking operations.
Add some comments.
Sort IP addresses before hashing them for the signature. Otherwise carp
is sensitive to address configuration order.
PR: kern/121574
Reported by: Douglas K. Rand, Wouter de Jong
Obtained from: OpenBSD (rev 1.114 + fixes)
Make m_megapullup() more intelligent:
- to increase performance do not reallocate mbuf when possible,
- to support up to 16K packets (was 2K max) use mbuf cluster of proper size.
This change depends on recent ng_nat and ip_fw_nat changes.
Increase LINK_TABLE_OUT_SIZE from 101 to 4001 like LINK_TABLE_IN_SIZE
to reduce performance degradation under heavy outgoing scan/flood.
Scalability is now much more important then several kilobytes of RAM.
Remove unneded TCP-specific expiration handeling. Before this connected
TCP sessions could never expire. Now connected TCP sessions will expire
after 24hours of inactivity.
Simplify HouseKeeping() to avoid several mul/div-s per packet. Taking into
account increased LINK_TABLE_OUT_SIZE, precision is still much more then
required.
Pass really available buffer size to libalias instead of MCLBYTES constant.
MCLBYTES constant were used with believe that m_megapullup() always moves
date into a fresh cluster that may become not so.
PKT_ALIAS_FOUND_HEADER_FRAGMENT result is not an error, so pass that packet.
This fixes packet fragmentation handeling.
Pass really available buffer size to libalias instead of MCLBYTES constant.
MCLBYTES constant were used with believe that m_megapullup() always moves
date into a fresh cluster that sometimes may become not so.
Ethernet hardware address stored in DC_AL_PAR0/DC_AL_PAR1 register
is in little endian form. Likewise setting DC_AL_PAR0/DC_AL_PAR1
register expect the address to be in little endian form. For big
endian architectures the address should be swapped to get correct
one.
Change setting/getting ethernet hardware address to big endian
architecture frendly.
Reported by: Robert Murillo ( billypilgrim782001 at yahoo dot com )
Tested by: Robert Murillo ( billypilgrim782001 at yahoo dot com )
* Implement more compact red-black trees, thus reducing memory usage
by ~0.5-1%.
* Add a separate tree to track dirty-page-containing chunks, thus
improving worst case allocation performance.
* Fix a deadlock in base_alloc() for the error (OOM) path.
* Catch integer overflow for huge allocations when using sbrk(2).
* Fix bit vector initialization for run headers. This fix has no
practical impact for correct programs. Incorrect programs will
potentially experience allocation failures rather than memory
corruption, both of which are "undefined behavior".
- Fix some style bugs and remove another banal comment missed in
rev. 1.46.
- Move the KASSERT on gem_add_rxbuf() to the right spot and add an
equivalent one to gem_disable_tx().
- Split the registers into two halves in preparation for SBus
support. [1]
Obtained from: NetBSD (loosely) [1]
- Use the revamped code from the gem(4) PCI front-end, which
doesn't require parts of the Expansion ROM to be copied around,
for obtaining the MAC address on !OFW platforms.
- Don't unnecessarily cache bus space tag and handle nor RIDs
in the softcs of the front-ends.
- Don't use function calls in initializers.
- Let the SBus front-end depend on sbus(4).
o Disable HMEDEBUG by default.
o Add CTASSERTs ensuring that HME_NRXDESC and HME_NTXDESC are set to
legal values.
o Use appropriate maxsize, nsegments and maxsegsize parameters when
creating DMA tags and correct some comments related to them.
o The FreeBSD bus_dmamap_sync(9) supports ored together flags for quite
some time now so collapse calls accordingly.
o Add missing BUS_DMASYNC_PREREAD when syncing the control DMA maps in
hme_rint() and hme_start_locked().
o Keep state of the link state and use it to enable or disable the MAC
in hme_mii_statchg() accordingly as well as to return early from
hme_start_locked() in case the link is down.
o Introduce a sc_flags and use it to replace individual members like
sc_pci.
o Add bus_barrier(9) calls to hme_mac_bitflip(), hme_mii_readreg(),
hme_mii_writereg() and hme_stop() to ensure the respective bit
has been written before we starting polling on it and for the right
bits to change.
o Rather just returning in case hme_mac_bitflip() fails and leaving us
in an undefined state report the problem and move on; chances are
the requested configuration will become active shortly after.
o Don't call hme_start_locked() in hme_init_locked() unconditionally
but only after calls to hme_init_locked() when it's appropriate, i.e.
in hme_watchdog().
o Add a KASSERT which asserts nsegs is valid also to hme_load_txmbuf().
o In hme_load_txmbuf():
- use a maximum of the newly introduced HME_NTXSEGS segments instead
of the incorrect HME_NTXQ, which reflects the maximum TX queue
length, for loading the mbufs and put the DMA segments back onto
the stack instead of the softc as 16 should be ok there.
- use the common errno(2) return values instead of homegrown ones,
- given that hme_load_txmbuf() is allowed to fail resulting in a
packet drop for quite some time now implement the functionality of
hme_txcksum() by means of m_pullup(9), which de-obfuscates the code
and allows to always retrieve the correct length of the IP header, [1]
- also add a KASSERT which asserts nsegs is valid,
- take advantage of m_collapse(9) instead of m_defrag(9) for
performance reasons.
o Don't bother to check whether the interface is running or whether its
queue is empty before calling hme_start_locked() in hme_tint(), the
former will check these anyway.
o In hme_intr() call hme_rint() before hme_tint() as gem_tint() may
take quite a while to return when it calls hme_start_locked().
o Get rid of sc_debug and just check if_flags for IFF_DEBUG directly.
o Add a shadow sc_ifflags so we don't reset the chip when unnecessary.
o Handle IFF_ALLMULTI correctly. [2]
o Use PCIR_BAR instead of a homegrown macro.
o Replace sc_enaddr[6] with sc_enaddr[ETHER_ADDR_LEN].
o Use the maximum of 256 TX descriptors for better performance as using
all of them has no additional static cost rather than using just half
of them.
Reported by: rwatson [2]
Suggested by: yongari [1]
Reviewed by: yongari
o Redefine G_PART_SCHEME_DECLARE() from populating a private
linker set to declaring a proper module.
o Add support for PC-9800 partition tables.
o Change the order from SI_ORDER_FIRST to SI_ORDER_ANY (within
SI_SUB_DRIVERS) to avoid loading schemes before all the GEOM
classes have been loaded and initialized.
o Add the bootcode verb for installing boot code.
o Implement the G_PART_DUMPCONF method for all 6 schemes.
Fix remaining nits from PR bin/39905.
Check for write failure while building temp files.
Correctly set file group when restore is run by a user other than root.
Use safer string handling.
Fixes the "getfile: lost data" panic when restoring older dumps.
Fix spurious "Header with wrong dumpdate" message.
Try to detect a Synaptics touchpad before IntelliMouse. Some touchpads will
pretend to be IntelliMouse (which have a few more features than generic mice)
causing the IntelliMouse probe to work and the Synaptics code never to be
called.
This should not break "real" IntelliMouse because the Synaptics detection code
is fairly specific.
PR: kern/120833
Submitted by: Eygene Ryabinkin <rea-fbsd -at- codelabs.ru>
rev. 1.30 of sys/sys/pipe.h
AKA r179243.
Another problem caused by the knlist_cleardel() potentially dropping
PIPE_MTX().
Since the pipe_present is cleared before (potentially) sleeping, the
second thread may enter the pipeclose() for the reciprocal pipe end.
The test at the end of the pipeclose() for the pipe_present == 0 would
succeed, allowing the second thread to free the pipe memory. First
threads then accesses the freed memory after being woken up.
Properly track the closing state of the pipe in the pipe_present.
Introduce the intermediate state that marks the pipe as mostly
dismantled but might be sleeping waiting for the knote list to be
cleared. Free the pipe pair memory only when both ends pass that point.
Use INSERT_OBJECT_INT_LINK_INDEX macro instead of TAILQ_INSERT_TAIL when
filling the table of ALTQ queues retrieved from the kernel.
It is possible for the kernel to return the queues not by pa.altq.qid order.
When this happens, pf_snmp would only partially fill its table.
PR: bin/120974
Submitted by: Mykola Dzham <i -at- levsha.org.ua>
We can call ia64_flush_dirty() when the corresponding process is
locked or not. As such, use PROC_LOCKED() to determine which case
it is and lock the process when not.
This is a manual merge. No merge history is created.
sys/sparc64/isa/isa.c 1.21; sys/sparc64/pci/ofw_pci.h 1.12;
sys/sparc64/pci/ofw_pci_if.m 1.10; sys/sparc64/pci/psycho.c 1.76;
sys/sun4v/sun4v/hv_pci.c 1.5
Remove the MD isa_irq_pending() and the underlying PCI-specific
infrastructure. Its only consumer ever was sio(4) and thus was
unused on sparc64 since removing the last traces of sio(4) in
sparc64 configuration files in favor for uart(4) over three
years ago. If similar functionality is required again it should
be brought back as an MD intr_pending() which works for all
busses by using for example interrupt controller hooks.
sym_hipd.c 1.70
- Const'ify firmware and lookup-tables.
- Obsolete redundant inst_name and unit members of struct sym_hcb.
- Fix three more NULL vs. 0 confusions.
- Use device_set_softc(9) to tell the bus layer that this driver
allocates a instance of struct sym_hcb itself.
- Use bus_{read,write}_*(9) instead of bus_space_{read,write}_*(9)
in order to get rid of bus space handle and tag in struct sym_hcb.
- Remove unused members related to bus addresses in struct sym_hcb.
- sym(4) takes care of allocating an instance of struct sym_hcb
itself so don't let newbus allocate it as an unused softc also.
- Add basic MPSAFE locking. This includes changing the sym(4) CCBs
to be allocated up-front instead of on demand as needed. Besides
making these allocations more likely to succeed, this also solves
the problem of calling bus_dmamap_create(9) with the SIM mutex
held.
- Use NULL instead of 0 for pointers.
- Remove superfluous returns in functions returning void.
- In sym_alloc_lcb_tags() return directly instead of jumping
to a label which just returns.
- Fix some spelling in comments.
- Remove trailing whitespace.
- Make failure to route a ISA interrupt non fatal. Apparently the
Blade 1500/SX1500 boards have inherited the firmware bug of the
AX1105 mainboards to not include an interrupt map entry for the
parallel port controller (for the AX1105 the heuristic code for
E450s probably erroneously kicks in and guesses an interrupt).
- Take advantage of bus_generic_setup_intr(9).
- Fix some whitespace bugs.
intr_machdep.h 1.19 (partial); mp_machdep.c 1.40; psycho.c 1.75;
sbus.c 1.47; upa.c 1.10
o Rename ic_eoi to ic_clear to emphasize the functions it points
don't send and EOI which works like on amd64/i386 and blocks all
interrupts on the relevant interrupt controller.
o Replace the post_filter and post_inthread hooks registered when
creating the interrupt events with just ic_clear as on sparc64 we
don't need to do any disable->EOI->enable dance to unblock all but
the relevant interrupt while running the filter or handler; just
not clearing the interrupt already has the same effect.
o Merge from amd64/i386:
- Split the intr_table_lock into an sx lock used for most things,
and a spin lock to protect intrcnt_index.
- Add support for binding interrupts to CPUs and initial shuffling
interrupts arround in a round-robin fashion.
Rev. 1.274 put the ttyrel() call before the destroy_dev() in the
ttyfree(), freeing the tty. Since destroy_dev() may call d_purge()
cdevsw method, that is the ttypurge() for the tty, the code ends up
accessing freed tty structure.
Put the ttyrel() after destroy_dev() in the ttyfree. To prevent the
panic the rev. 1.274 provided fix for, check the TS_GONE in sysctl
handler and refuse to provide information on such tty.
The dev_refthread() in the tty_gettp() may fail, because Giant is taken
in the giant_trick routines after the dev_refthread increments the
si_threadcount. Remove assert, do not perform dev_relthread() for failed
dev_refthread(), and handle failure in the tty_gettp() callers (cdevsw
tty methods).
Bluetooth SIG is being difficult and keep moving specification
documents away from being public accessible. Replace link to
the Bluetooth specification document with the document name.
Pointed out by: SoftLover < slserg at uic dot tula dot ru >
Release pcm mutex before calling snd_clone_unref(), which in turns might
calling destroy_dev() with sleepable malloc(9). The entire opetation
is being serialized through pcm cv from top down, so dropping mutex is
rather safe.
Reported by: delphij
Move "1000baseT" from IFM_SUBTYPE_ETHERNET_DESCRIPTIONS to
IFM_SUBTYPE_ETHERNET_ALIASES: there is already "1000baseTX" in
IFM_SUBTYPE_ETHERNET_DESCRIPTIONS. This doesn't change ifconfig
behaviour.
PR: 45793 (maybe)
Approved by: rwatson (mentor)
MFC after: 1 month
hu_HU.ISO8859-2.src r1.9
hu_HU.UTF-8.src r1.4
- The names of the months and the days are in lowercase according to the
Hungarian spelling, change them accordingly
devctl_process_running(): Check for devsoftc.inuse == 1 instead of
devsoftc.async_proc != NULL because the latter might not be true
sometimes.
This way /etc/rc.suspend gets executed.
Reviwed by: njl
Submitted by: Mitsuru IWASAKI <iwasaki at jp.FreeBSD.org>
Tested also by: Andreas Wetzel <mickey242 at gmx.net>
if_bge.c rev. 1.205, 1.209, 1.210
Summary:
In some situations we were not clearing pending link state attentions.
Because of this we were not getting further interrupts for link state
changes, thus never went into iface UP state and thus could not transmit.
The only way out of this was an incoming packet generating an rx interrupt
and making us call into bge_link_upd.
What we do now is force an interrupt at the end of bge_ifmedia_upd_locked
so we will call bge_link_upd, clear the link state attention and get
further interrupts.
While the initial version was not expected to work with all chips
the later update in rev. 1.210 is.
PR: kern/111804
Tested by: phk, scottl (initial version)
Thanks for your help to: davidch, Broadcom
devclass_get_maxunit() returns n+1 with n starting at 0.
So if we have channel 0..3 devclass_get_maxunit is 4.
It's never been a problem as devclass_get_device() has
caught any possibly bad input.
Add ';' missed with the SYSINIT changes.
Not noticed by tb as TCP_SIGNATURE is not in LINT.
(this MFC ahead of the MFC of the other SYSINIT ';' chnages)
Kqueue_scan() may sleep when encountered the influx knotes. On the other
hand, it may cause other threads to sleep since kqueue_scan() may mark
some knotes as infux. This could lead to the deadlock.
Before kqueue_scan() sleeps, wakeup the threads that are waiting for the
influx knotes produced by this thread.
The kqueue_close() encountering the KN_INFLUX knotes on the kq being
closed is the legitimate situation. For instance, filedescriptor with
registered events may be closed in parallel with closing the kqueue.
Properly handle the case instead of asserting that this cannot happen.
code, this can cause a panic due to a recusion on the TX Lock.
Also sync up other changes in HEAD, all trivial, added PCI ID
and #ifdef's to make the driver compile on 6.3.
Dummynet has a limit of 100 slots queue size (or 1MB, if you give
the limit in bytes) hard coded into both the kernel and userland.
Make both these limits a sysctl, so it is easy to change the limit.
If we are walking the IPv6 header chain and we hit an IPPROTO_NONE
header, then don't try to pullup anything, because there is no next
header if we hit IPPROTO_NONE. Set ulp to a non-NULL value so the
search for an upper layer header terinates.
moused.8 rev 1.62
Improve the virtual scrolling mechanism to make middle clicking less
difficult. Add a -L option (yet another option, indeed!) which changes
the speed of scrolling and change -U to only affect the scroll threshold.
This should make middle-clicking a much more pleasant experience.
Submitted by: Aragon Gouveia <aragon -at- phat.za.net>
rev. 1.126 of libexec/rtld-elf/rtld.c
rev. 1.5 of libexec/rtld-elf/rtld_lock.c
rev. 1.3 of libexec/rtld-elf/rtld_lock.h
Fix the problem with the C++ exception handling for the multithreaded
programs.
From the PR description:
The gcc runtime's _Unwind_Find_FDE function, invoked during exception
handling's stack unwinding, is not safe to execute from within multiple
threads. FreeBSD' s dl_iterate_phdr() however permits multiple threads
to pass through it though. The result is surprisingly reliable infinite
looping of one or more threads if they just happen to be unwinding at
the same time.
Introduce the new lock that is write locked around the dl_iterate_pdr,
thus providing required exclusion for the stack unwinders.
PR: threads/123062
Submitted by: Andy Newman <an at atrn org>
Reviewed by: kan
ofw_pcib_subr.h 1.4; ofw_pcibus.c 1.18; psycho.c 1.74; psychovar.h 1.18
On sparc64 machines with multiple host-PCI-bridges these bridges
have separate configuration spaces so by definition they implement
different PCI domains. Thus change psycho(4) to use PCI domains
instead of reenumerating all PCI busses so they have globally unique
bus numbers and drop support for reenumerating busses in the OFW PCI
code.
Make -t <tty> optional in server mode. If not specified use stdin/stdout.
Document this. Do not require channel number in server mode. If not
specified - bind to ''wildcard'' channel zero. Real channel number will
be obtained automatically and registered with local sdpd(8). While I'm
here fix serial port service registration.
Submitted by: luigi
Tested by: Helge Oldach <freebsd-bluetooth at oldach dot net>
rev. 1.15 of lib/libc/gen/readdir.c
rev. 1.11 of lib/libc/gen/telldir.c
rev. 1.3 of lib/libc/gen/telldir.h
Do not read away the target directory entry when encountering deleted
files after a seekdir().
The seekdir shall set the position for the next readdir operation.
When the _readdir_unlocked() encounters deleted entry, dd_loc is
already advanced. Continuing the loop leads to premature read of
the target entry.
Submitted by: Marc Balmer <mbalmer at openbsd org>
Obtained from: OpenBSD
Only return 1 from sync_vnode() in cases where the vnode is still at the
head of the sync list. This prevents sched_sync() from re-queueing a
vnode which may have been freed already.
Approved by: jeff
Use separate UMA zone for data items allocation. It is a partial
rev. 1.149 rework.
It allows to save several percents of CPU time on SMP by using UMA's
internal per-CPU allocation limits instead of own global variable
each time updated with atomics.
Also it restores NG_WAITOK flag processing.
PR: kern/123741
The first of thirteen patches by Ed that resolves a documentation
issue in termios.4, ttydefaults.h does not exist in /usr/include
but in /usr/include/sys.
MFC after: 3 days
Submitted by: Ed Schouten (ed at 80386 dot nl)
Add four utility functions related to struct grp processing modeled in-part
after similar calls related to struct pwd in libutil/pw_util.c:
- gr_equal()
Perform a deep comparison of two struct grp's. It does a thorough, yet
unoptimized comparison of all the members regardless of order.
- gr_make()
Create a string (see group(5)) from a struct grp.
- gr_dup()
Duplicate a struct grp. Returns a value that is a single contiguous
block of memory.
- gr_scan()
Create a struct grp from a string (as produced by gr_make()).
src/lib/libutil/Makefile: rev 1.66 -> 1.67
src/lib/libutil/gr_util.c: rev 0 -> 1.1
src/lib/libutil/libutil.h: rev 1.46 -> 1.47
Define the size_t type since readpassphrase(3) requires it in its
definition and sys/types.h is not listed within the synopsis of the man
page.
src/include/readpassphrase.h: rev 1.2 -> 1.3
- Remove the BUS_HANDLE_MIN checking in the __BUS_DEBUG_ACCESS macro;
for UPA it should have fulfilled its purpose by now and Fireplane-
and JBus-based machines are way to messy in organization to implement
something equivalent.
- Fix a bunch of style(9) bugs.
only work if there's just one interface doing dhcp. This version implements
the same logic as the version in the PR, but uses pgrep to be less verbose.
PR: conf/95905
counter.c 1.7; iommu.c 1.47
- Use the name returned by device_get_nameunit(9) for the name of the
counter-timer timecounter so the associated SYSCTL nodes don't clash on
machines having multiple U2P and U2S bridges as well as establishing a
clear mapping between these bridges and their timecounter device.
- Don't bother setting up a "nice" name for the IOMMU, just use the name
returned by device_get_nameunit(9), too.
- Fix some minor style(9) bugs.
- Use __FBSDID in counter.c
- Use more appropriate maxsize, nsegments and maxsegsize parameters
when creating the parent bus DMA tag. While at it correct the style
and a nearby comment.
- Take advantage of m_collapse(9) for performance reasons.
unset the given variable name (removing it from the environment, instead
of just setting it to a null value).
[* = 1.10->1.11 env.1, 1.20 env.c]
PR: bin/65649
o Change the warning dialog for the 'W' command in both the label
and partition editors to reflect the fact that this is a stand-alone
application, not sysinstall(8).
o Change an instance of sade(8) refering to itself as sysinstall(8) in
a confirmation dialog.
don't set sniffer mode to ON when the driver is running with the
monitor mode. This solves a problem that sometimes mangled frames
are passed.
Submitted by: Werner Backes <werner_at_bit-1.de>
Tested by: Werner Backes <werner_at_bit-1.de>
PR: kern/121608
Approved by: thompsa (mentor)
from HEAD to RELENG_7:
Add "ddb capture print" and "ddb capture status" commands do ddb(8),
alowing the DDB output capture buffer to be easily extracted from
user space. Both of these commands include -M/-N arguments, allowing
them to be used with kernel crash dumps (or /dev/mem).
This makes it easier to use DDB scripting and output capture with
minidumps or full dumps rather than with text dumps, allowing DDB
output (scripted or otherwise) to be easily extracted from a crash
dump.
Discussed with: brooks, jhb
When writing trailers in sendfile(2), don't call kern_writev()
while holding the socket buffer lock. These leads to an
immediate panic due to recursing the socket buffer lock. This
bug was introduced in uipc_syscalls.c:1.240, but masked by
another bug until that was fixed in uipc_syscalls.c:1.269.
Note that the current fix isn't perfect, but better than
panicking: normally we guarantee that simultaneous invocations
of a system call to write on a stream socket won't be
interlaced, which is ensured by use of the socket buffer sleep
lock. This is guaranteed for the sendfile headers, but not
trailers. In practice, this is likely not a problem, but
should be fixed.
Pointy hat to: andre (1.240), cperciva (1.269)
of the archive structure, not the write-specific portion.
(This is a bungle from back when the generic and write-specific portions
were first separated and the write-specific part accidentally ended
up with copies of some of the generic fields.) In particular,
archive_format() and archive_format_name() now work correctly
on write handles.
Coerce if_loop.c in the general direction of style(9):
- Use ANSI function declarations
- Remove use of 'register' keyword
- Prefer style(9) return parens, white space
- Trim trailing whitespace at ends of lines.
which are also likely to be irrelevant for sun4v (there's no SBus on sun4v
and only some EBus devices). While at it fix some style bugs according to
style.Makefile(5) where appropriate.
Add system hang-up process when VOP_READDIR of unionfs_nodeget()
returns not end of the file status on debug mode (DIAGNOSTIC defined)
kernel.
Submitted by: Masanori OZAWA ([email protected])
Add a dummynet_enable knob to go with firewall_enable. If this knob
is enabled dummynet(4) is added to the list of required modules.
Discussed on: #freebsd-bugbusters (rwatson, trhodes)
PR: conf/79196
date: 2008/03/06 14:01:10; author: mtm; state: Exp; lines: +1 -1
The rarpd(8) daemon must be instructed to start on all interfaces or a
specific one. Instruct it to listen on all interfaces so that enabling
it in rc.conf(5) works "out of the box."
PR: conf/121406
Submited by: trasz
scandir(3) previously used st_size to obtain an initial estimate
of the array length needed to store all the directory entries.
Although BSD has historically guaranteed that st_size is the size
of the directory file, POSIX does not, and more to the point, some
recent filesystems such as ZFS use st_size to mean something else.
The fix is to not stat the directory at all, set the initial
array size to 32 entries, and realloc it in powers of 2 if that
proves insufficient.
PR: 113668
Use LOCK_FILE and LOCK_LINE with lockmgr(), add the wrapper protecting for
the public namespace for userland inclusion.
Now lockmgr depends by sys/lock.h header on RELENG_7 too.
Have the man page catch up with the namespace pollution cleanup that
occurred between 2001-2003. Thanks to bde for the history lesson[1]
concerning sys/types.h and the many system calls that at one time
(pre-2001) were required by POSIX to include it.
1. http://lists.freebsd.org/pipermail/freebsd-arch/2008-April/008126.html
src/lib/libc/sys/mkdir.2: rev 1.25 -> 1.26
revision 1.219
Replace the non-MPSAFE timeout(9) API in ffs_softdep.c with the MPSAFE
callout_* API (e.g. callout_init_mtx(9)). This was one of the numerous
items on the http://wiki.freebsd.org/SMPTODO list.
When sending packets directly to the DHCP server, use a socket and send
directly rather than bogusly sending it out as a link layer broadcast
(which fails to be received on some networks).
PR: bin/96018
MFC after: 2 weeks
Delay the global registration of the struct ifnet in if_alloc() until after
we're certain the allocation will entierly succeed. This fixes a leak in a
fairly unlikely case.
Reported by: vijay singh <vijjus at rocketmail dot com>
In in_pcbnotifyall() and in6_pcbnotify(), use LIST_FOREACH_SAFE() and
eliminate unnecessary local variable caching of the list head pointer,
making the code a bit easier to read.
Remove Giant acquisition around soreceive() and sosend() in fifofs.
The bug that caused us to reintroduce it is believed to be fixed,
and Kris says he no longer sees problems with fifofs in highly
parallel builds.
Pointed out by: kris
Provide more detailed information about each procstat(1) display mode,
including a key to fields in each mode and flag abbreviations.
Note: mention of POSIX shared memory in the man page has been removed
in the MFC, as explicit kernel support for pshm hasn't been merged to
RELENG_7 yet.
dereferencing uap throughout. On ia64 uap points into the trapframe
and the call to set_mcontext() in this function will change the
trapframe. Consequently, when we dereference uap afterwards we can
best qualify the behaviour as undefined. By putting the arguments
in local variables we also improve code-generation, because the
compiler is not forced to reload after every function call.
Caught by: Christian Kandeler <[email protected]>
Initialize variable "now" before using it (it is used by the LEFTEARTH
macro)
PR: 121418
Submitted by: Atsuo Ohki
Approved by: rwatson (mentor)
MFC after: 1 month
src/sys/netinet/ip_dummynet.h 1.41
src/sys/netinet/ip_dummynet.c 1.111-1.114
src/sys/netinet/ip_fw_pfil.c 1.26
src/sys/net/if_bridge.c 1.107
src/sys/net/if_ethersubr.c 1.240
src/sbin/ipfw/ipfw.8 1.206
- style(9) cleanup.
- dummynet_io() declaration has changed.
- Alter packet flow inside dummynet and introduce 'fast' mode of dummynet
operation: allow certain packets to bypass dummynet scheduler. Benefits are:
-- lower latency: if packet flow does not exceed pipe bandwidth, packets
will not be (up to tick) delayed (due to dummynet's scheduler granularity).
-- lower overhead: if packet avoids dummynet scheduler it shouldn't reenter
ip stack later. Such packets can be fastforwarded.
-- recursion (which can lead to kernel stack exhaution) eliminated. This fix
long existed panic, which can be triggered this way:
kldload dummynet
sysctl net.inet.ip.fw.one_pass=0
ipfw pipe 1 config bw 0
for i in `jot 30`; do ipfw add 1 pipe 1 icmp from any to any; done
ping -c 1 localhost
- New sysctl nodes:
net.inet.ip.dummynet.io_fast - enables 'fast' dummynet io
net.inet.ip.dummynet.io_pkt - packets passed to dummynet
net.inet.ip.dummynet.io_pkt_fast - packets avoided dummynet scheduler
net.inet.ip.dummynet.io_pkt_drop - packets dropped by dummynet
- Workaround p->numbytes overflow, which can result in infinite loop inside
dummynet module (prerequisite is using queues with "fat" pipe).
PR: kern/113548 kern/121955
o Rename cpu_thread_setup() to cpu_thread_alloc() to better communicate that
it relates to (is called by) thread_alloc()
o Add cpu_thread_free() which is called from thread_free() to counter-act
cpu_thread_alloc().
i386: Have cpu_thread_free() call cpu_thread_clean() to preserve behaviour.
ia64: Have cpu_thread_free() call mtx_destroy() for the mutex initialized
in cpu_thread_alloc().
files: sys/amd64/amd64/vm_machdep.c:1.256
sys/arm/arm/vm_machdep.c:1.35
sys/i386/i386/vm_machdep.c1.284
sys/ia64/ia64/machdep.c:1.227
sys/ia64/ia64/vm_machdep.c:1.95
sys/kern/kern_thread.c:1.260
sys/powerpc/powerpc/vm_machdep.c:1.117
sys/sparc64/sparc64/vm_machdep.c:1.77
sys/sun4v/sun4v/vm_machdep.c:1.8
sys/sys/proc.h:1.495
- Take advantage of bus_dmamap_load_mbuf_sg(9).
- Take advantage of m_collapse(9).
- Sync with other NIC drivers and prepend a TX mbuf if the first attempt
to load it fails with an error other than EFBIG and stop trying instead
of freeing it and keeping on trying to enqueue more mbufs. Also ensure
the driver queue isn't empty before trying to enqueue mbufs in order to
reduce locking operations.
- In xl_ifmedia_upd() add a missing XL_UNLOCK(). [1]
- Const'ify the xl_devs array.
- Remove an outdated comment.
PR: 113406 [1]
- Const'ify the bus_stream_asi and bus_type_asi arrays.
- Replace hard-coded functions names missed in bus_machdep.c rev. 1.44
with __func__.
- Break some long lines.
Take the route mtu into account, if available, when sending an
ICMP unreach, frag needed. Up to now we only looked at the
interface MTU. Make sure to only use the minimum of the two.
In case IPSEC is compiled in, loop the mtu through ip_ipsec_mtu()
to avoid any further conditional maths.
Without this, PMTU was broken in those cases when there was a
route with a lower MTU than the MTU of the outgoing interface.
PR: kern/122338
Tested by: Mark Cammidge mark peralex.com
Back out rev. 1.161 (1.157.2.2) and
switch back to optimized TCP options ordering.
A lot of testing has shown that the problem people were seeing was due
to invalid padding after the end of option list option, which was corrected
in tcp_output.c rev. 1.146 (1.141.2.4).
Thanks to: anders@, s3raphi, Matt Reimer
Thanks to: Doug Hardie and Randy Rose, John Mayer, Susan Guzzardi
Special thanks to: dwhite@ and BitGravity
Discussed with: silby
Don't touch MSI enable bit in RL_CFG2 register. For unknown reason
clearing MSI enable bit for MSI capable hardwares resulted in Tx
problems. MSI enable bit is set only when MSI is requested from
user.
In revision 1.70, 1.71 and 1.84 re(4) tried to workaround checksum
offload bugs by manual padding for short IP/UDP frames. Unfortunately
it seems that these workaround does not work reliably on newer PCIe
variants of RealTek chips.
To workaround the hardware bug, always pad short frames if Tx IP
checksum offload is requested. It seems that the hardware has a
bug in IP checksum offload handling. NetBSD manually pads short
frames only when the length of IP frame is less than 28 bytes but I
chose 60 bytes to safety. Also unconditionally set IP checksum
offload bit in Tx descriptor if any TCP or UDP checksum offload is
requested. This is the same way as Linux does but it's not
mentioned in data sheet.
For MSI capable hardwares, enable MSI enable bit in RL_CFG2
register. If MSI was disabled by hw.re.msi_disable tunable
expliclty clear the MSI enable bit.
VLAN hardware tag information should be set for all desciptors of a
multi-descriptor transmission attempt. Datasheet said nothing about
this requirements. This should fix a long-standing VLAN hardware
tagging issues with re(4).
Always honor configured VLAN/checksum offload capabilities.
Previously re(4) used to blindly enable VLAN hardware tag stripping
and Rx checksum offload regardless of enabled optional features of
interface.
Don't map memory/IO resource in device probe and just use PCI
vendor/revision/sub device id of the hardware to probe it.
This is the same way as NetBSD does and it enhances readabilty
a lot.
Overhaul re(4).
o Increased number of Rx/Tx descriptors to 256 for 8169 GigEs
because it's hard to push the hardware to the limit with default
64 descriptors.
TSO requires large number of Tx descriptors to pass a full sized
TCP segment(65535 bytes IP packet) to hardware. Previously it
consumed 32 Tx descriptors, assuming MCLBYTES DMA segment size,
to send the TCP segment which means re(4) couldn't queue more
than two full sized IP packets.
For 8139C+ it still uses 64 Rx/Tx descriptors due to its hardware
limitations. With this changes there are (very) small waste of
memory for 8139C+ users but I don't think it would affect 8139C+
users for most cases.
o Various bus_dma(9) fixes.
- The hardware supports DAC so allow 64bit DMA operations.
- Removed BUS_DMA_ALLOC_NOW flag.
- Increased DMA segment size to 4096 from MCLBYTES because TSO
consumes too many descriptors with MCLBYTES DMA segment size.
- Tx/Rx side bus_dmamap_load_mbuf_sg(9) support. With these
changes the code is more readable than previous one and got a
(slightly) better performance as it doesn't need to pass/
decode arguments to/from callback function.
- Removed unnecessary callback function re_dmamap_desc() and
nuked rl_dmaload_arg structure which was used in the callback.
- Additional protection for DMA map load failure. In case of
failure reuse current map instead of returning a bogus DMA
map.
- Deferred DMA map unloading/sync operation for maximum
performance until we really need to load new DMA map. If we
happen to reuse current map(e.g. input error) there is no need
to sync/unload/load again.
- The number of allowable Tx DMA segments for a mbuf chains are
now 32 instead of magic nseg value. If the number of available
Tx descriptors are short enough to send highly fragmented mbuf
chains an optimized re_defrag() is called to collapse mbuf
chains which is supposed to be much faster than m_defrag(9).
re_defrag() was borrowed from ath(4).
- Separated Rx/Tx DMA tag from a common DMA tag such that Rx DMA
tag correctly uses DMA maps that were created with DMA alignment
restriction(8bytes alignments). Tx DMA tag does not have such
alignment limitation.
- Added additional sanity checks for DMA ring map load failure.
- Added additional spare Rx DMA map for graceful handling of Rx
DMA map load failure.
- Fixed misused bus_dmamap_sync(9) and added missing
bus_dmamap_sync(9) in re_encap()/re_txeof()/re_rxeof().
o Enabled TSO again as re(4) have reasonable number of Tx
descriptors.
o Don't touch DMA address of a Tx descriptor in re_txeof(). It's
not needed.
o Fix incorrect update of if_ierrors counter. For Rx buffer
shortage it should update if_qdrops as the buffer is reused.
o Added checks for unsupported H/W revisions and return ENXIO for
these hardwares. This is required to remove resource allocation
code in re_probe as other drivers do in device probe routine.
o Modified descriptor index manipulation macros as it's now possible
to have different number of descriptors for Rx/Tx.
o In re_start, to save a lock operation, use IFQ_DRV_IS_EMPTY before
trying to invoke IFQ_DRV_DEQUEUE. Also don't blindly call re_encap
since we already know the number of available Tx descriptors in
advance.
o Removed RL_TX_DESC_THLD which was used to reserve RL_TX_DESC_THLD
descriptors in Tx path. There is no such a limitation mentioned in
8139C+/8169/8110/8168/8101/8111 datasheet and it seems to work ok
without reserving RL_TX_DESC_THLD descriptors.
o Fix a comment for RL_GTXSTART. The register is 8bits register.
o Added comments for 8169/8139C+ hardware restrictions on descriptors.
o Removed forward declaration for "struct rl_softc", it's not needed.
o Added a new structure rl_txdesc for Tx descriptor managements and
a structure rl_rxdesc for Rx descriptor managements.
o Removed unused member variable rl_intlock in driver softc. There are
still several unused member variables which are supposed to be used
to access hardware statistics counters. But it seems that accessing
hardware counters were not implemented yet.
The final stage of the big CDDL file move. These files were repo
copied in head to their new location under the 'cddl' directories
of src and src/sys and then added for this branch. The build has
been using the files in their new locations for a few days now.
Introduce a new F_DUP2FD command to fcntl(2), for compatibility with
Solaris and AIX.
fcntl(fd, F_DUP2FD, arg) and dup2(fd, arg) are functionnaly equivalent.
Document it.
Add some regression tests (identical to the dup2(2) regression tests).
PR: 120233
Submitted by: Jukka Ukkonen
Approved by: rwaston (mentor)
MFC after: 1 month
audit_bsm_klib.c:1.15, audit_bsm_token.c:1.15, audit_pipe.c:1.15,
audit_syscalls.c:1.26, audit_trigger.c:1.8, audit_worker.c:1.23
from HEAD to RELENG_7:
Use __FBSDID() for $FreeBSD$ IDs in the audit code.
Merge changes from NetBSD on humanize_number.c, 1.8 -> 1.13
Significant changes:
- rev. 1.11: Use PRId64 instead of a cast to long long and %lld to print
an int64_t.
- rev. 1.12: Fix a bug that humanize_number() produces "1000" where it
should be "1.0G" or "1.0M". The bug reported by Greg Troxel.
PR: 118461
PR: 102694
Approved by: rwatson (mentor)
Obtained from: NetBSD
MFC after: 1 month
from HEAD to REENG_7:
Make naming of include guards for MAC Framework include files more
consistent with other kernel include guards (don't start with _SYS).
rev. 1.151: Remove impossible (hk_peer == NULL) check.
rev. 1.152: Remove ng_setisr() call from ng_dequeue().
rev. 1.153: There is no need to erase hook->hk_node before freeing hook.
rev. 1.154: Use new atomic_fetchadd() primitive instead of looping atomic_cmpset().
rev. 1.158: ng_address_hook() microoptimization.
- add support for T3C
- add multicast support
- update copyrights
- add infrastructure for multiple transmit queues
- add support for compiling firmware in to the kernel
- add conditional define for enabling link at device attach
- exit tick handler if shutdown is in progress
- add sysctls for dumping transmit queues
- use jumbo clusters for large packets
- add pcpu caching
- add inline mbuf header on receive
- upgrade to version 5.0 of the firmware
Supported by: Chelsio Inc.
Fix possible buffer overrun on 64-bit arch when generating MAC
address for tap interface.
Reported by: Marc Lorner < marc dot loerner at hob dot de >
Reviewed by: bms
It seems that RealTek 8129/8139 chip reports invalid length of
received frame under certain conditions. wpaul said the length
0xfff0 is special meaning that indicates hardware is in the
process of copying a packet into host memory. But it seems
there are other cases that hardware is busy or stuck in bad
situation even if the received frame length is not 0xfff0.
To work-around this condition, add a check that verifys that
recevied frame length is in valid range. If received length is out
of range reinitialize hardware to recover from stuck condition.
These files were repocopied for HEAD. The repo copy process renames
tags, adding a prefix of 'old_', so the history for these files is
in old_RELENG_7 etc.
Add missing device in tunefs entry.
PR: docs/122702
Submitted by: Yoshihiro Ota <[email protected]>
MFC After: 3 days
MFC rev 1.5 gjournal.8
I keep taking timemachines to get back in time. Update the
year to 2008.
Noticed by: ceri
Remove ftp.hk.super.net, the DNS isn't pointing to anything at the moment.
I tested this as well as the submitter and couldn't resolve this either,
since I dont want to "announce" dead mirrors, I'll remove it from the
list.
PR: 122567
Submitted by: vs
Approved by: imp (mentor, implicit for trivial changes)
MFC after: 1 week
Approved by: imp (mentor, implicit)
Avoid error cascades when trying to monitor a host that doesn't resolve in
DNS. Tighten error handling when attempting to communicate with the userland
part of rpc.lockd.
Add rfcomm_pppd_server rc script to allow start rfcomm_pppd(8) in server
mode at boot time. Multiple profiles can be started at the same time.
The whole idea is very similar to the ppp rc script.
Document Bluetooth knobs in rc.conf(5)
Set defaults for the rfcomm_pppd_server rc script
- Add write(2) support for psm(4) in native operation level. Now arbitrary
commands can be written to /dev/psm%d and status can be read back from it.
- Clean up and fix style(9) nits.
o sf(4) repocopied from sys/pci to sys/dev/sf
Overhaul sf(4) to make it run on all architectures and implement
checksum offoload by downloading AIC-6915 firmware. Changes are
o Header file cleanup.
o Simplified probe logic.
o s/u_int{8,16,32}_t/uint{8,16,32}_t/g
o K&R -> ANSI C.
o In register access function, added support both memory mapped and
IO space register acccess. The function will dynamically detect
which method would be choosed.
o sf_setperf() was modified to support strict-alignment
architectures.
o Use SF_MII_DATAPORT instead of hardcoded value 0xffff.
o Added link state/speed, duplex changes handling task q. The task q
is also responsible for flow control settings.
o Always hornor link up/down state reported by mii layers. The link
state information is used in sf_start() to determine whether we
got a valid link.
o Added experimental flow-control setup. It was commented out but
will be activated once we have flow-cotrol infrastructure in mii
layer.
o Simplify IFF_UP/IFCAP_POLLING and IFF_PROMISC handling logic. Rx
filter always honors promiscuous mode.
o Implemented suspend/resume methods.
o Reorganized Rx filter routine so promiscuous mode changes doesn't
require interface re-initialization.
o Reimplemnted driver probe routine such that it looks for matching
device from supported hardware list table. This change will help to
add newer hardware revision to the driver.
o Use ETHER_ADDR_LEN instead of hardcoded value.
o Prefer memory space register mapping over I/O space as the hardware
requires lots of register access to get various consumer/producer
index. Failing to get memory space mapping, sf(4) falls back to I/O
space mapping. Use of memory space register mapping requires
somewhat large memory space(512K), though.
o Switch to simpler bus_{read,write}_{1,2,4}.
o Use PCIR_BAR macro to get BARs.
o Program PCI cache line size if the cache line size was set to 0
and enable PCI MWI.
o Add a new sysctl node 'dev.sf.N.stats' that shows various MAC
counters for Rx/Tx statistics.
o Add a sysctl node to configure interrupt moderation timer. The
timer defers interrupts generation until time specified in timer
control register is expired. The value in the timer register is in
units of 102.4us. The allowable range for the timer is 0 - 31
(0 ~ 3.276ms).
The default value is 1(102.4us). Users can change the timer value
with dev.sf.N.int_mod sysctl(8) variable/loader(8) tunable.
o bus_dma(9) conversion
- Enable 64bit DMA addressing.
- Enable 64bit descriptor format support.
- Apply descriptor ring alignment requirements(256 bytes alignment).
- Apply Rx buffer address alignment requirements(4 bytes alignment).
- Apply 4GB boundary restrictions(Tx/Rx ring and its completion ring
should live in the same 4GB address space.)
- Set number of allowable number of DMA segments to 16. In fact,
AIC-6915 doesn't have a limit for number of DMA segments but it
would be waste of Tx descriptor resource if we allow more than 16.
- Rx/Tx side bus_dmamap_load_mbuf_sg(9) support.
- Added alignment fixup code for strict-alignment architectures.
- Added endianness support code in Tx/Rx descriptor access.
With these changes sf(4) should work on all platforms.
o Don't set if_mtu in device attach, it's handled in ether_ifattach.
o Use our own callout to drive watchdog timer.
o Enable VLAN oversized frames and announce sf(4)'s VLAN capability
to upper layer.
o In sf_detach(), remove mtx_initialized KASSERT as it's not possible
to get there without initialzing the mutex. Also mark that we're
about to detaching so active bpf listeners do not panic the system.
o To reduce PCI register access cycles, Rx completion ring is
directly scanned instead of reading consumer/producer index
registers. In theory, Tx completion ring also can be directly
scanned. However the completion ring is composed of two types
completion(1 for Tx done and 1 and DMA done). So reading producer
index via register access would be more safer way to detect the
ring wrap-around.
o In sf_rxeof(), don't use m_devget(9) to align recevied frames. The
alignment is required only for strict-alignment architectures and
now the alignment is handled by sf_fixup_rx() if required. The
removal of the copy operation in fast path should increase Rx
performance a lot on non-strict-alignemnt architectures such as
i386 and amd64.
o In sf_newbuf(), don't set descriptor valid bit as sf(4) is
programmed to run with normal mode. In normal mode, the valid bit
have no meaning. The valid bit should be used only when the
hardware uses polling(prefetch) mode. The end of descriptor queue
bit could be used if needed, but sf(4) relys on auto-wrapping of
hardware on 256 descriptor queue entries so both valid and
descriptor end bit are not used anymore.
o Don't disable generation of Tx DMA completion as said in datasheet
and use the Tx DMA completion entry instead of relying on Tx done
completion entry. Also added additional Tx completion entry type
check in Tx completion handler.
o Don't blindly reset watchdog timer in sf_txeof(). sf(4) now unarm
the the watchdog only if there are no active Tx descriptors in Tx
queue.
o Don't manually update various counters in driver, instead, use
built-in MAC statistic registers to update them. The statistic
registers are updated in every second.
o Modified Tx underrun handlers to increase the threshold value
in units of 256 bytes. Previously it used to increase 16 bytes
at a time which seems to take too long to stabalize whenever Tx
underrun occurrs.
o In interrupt handler, additional check for the interrupt is
performed such that interrupts only for this device is allowed to
process descriptor rings. Because reading SF_ISR register clears
all interrtups, nuke writing to a SF_ISR register.
o Tx underrun is abonormal condition and SF_ISR_ABNORMALINTR includes
the interrupt. So there is no need to inspect the Tx underrun again
in main interrupt loop.
o Don't blindly reinitialize hardware for abnormal interrupt
condition. sf(4) reintializes the hardware only when it encounters
DMA error which requires an explicit hardware reinitialization.
o Fix a long standing bug that incorrectly clears MAC statistic
registers in sf_init_locked.
o Added strict-alignment safe way of ethernet address reprogramming
as IF_LLADDR may return unaligned address.
o Move sf_reset() to sf_init_locked in order to always reset the
hardware to a known state prior to configuring hardware.
o Set default Rx DMA, Tx DMA paramters as shown in datasheet.
o Enable PCI busmaster logic and autopadding for VLAN frames.
o Rework sf_encap.
- Previously sf(4) used to type 0 of Tx descriptor with padding
enabled to store driver private data. Emebedding private data
structures into descriptors is bad idea as the structure size
would be different between 64bit and 32bit architectures. The
type 0 descriptor allows fixed number of DMA segments in
a descriptor format and provides relatively simple interface to
manage multi-fragmented frames.
However, it wastes lots of Tx descriptors as not all frames are
fragmented as the number of allowable segments in a descriptor.
- To overcome the limitation of type 0 descriptor, switch to type
2 descriptor which allows 64bit DMA addressing and can handle
unliumited number of fragmented DMA segments. The drawback of
type 2 descriptor is in its complexity in managing descriptors
as driver should handle the end of Tx ring manually.
- Manually set Tx desciptor queue end mark and record number of
used descriptors to reclaim used descriptors in sf_txeof().
o Rework sf_start.
- Honor link up/down state before attempting transmission.
- Because sf(4) uses only one of two Tx queues, use low priority
queue instead of high one. This will remove one shift operation
in each Tx kick command.
- Cache last produder index into softc such that subsequenet Tx
operation doesn't need to access producer index register.
o Rewrote sf_stats_update to include all available MAC statistic
counters.
o Employ AIC-6915 firmware from Adaptec and implement firmware
download routine and TCP/UDP checksum offload.
Partial checksum offload support was commented out due to the
possibility of firmware bug in RxGFP.
The firmware can strip VLAN tag in Rx path but the lack of firmware
assistance of VLAN tag insertion in transmit side made it useless
on FreeBSD. Unlike checksum offload, FreeBSD requires both Tx/Rx
hardware VLAN assistance capability. The firmware may also detect
wakeup frame and can wake system up from states other than D0.
However, the lack of wakeup support form D3cold state keep me from
adding WOL capability. Also detecting WOL frame requires firmware
support but it's not yet known to me whether the firmware can
process the WOL frame.
o Changed *_ADDR_HIADDR to *_ADDR_HI to match other definitions of
registers.
o Added definitioan to interrupt moderation related constants.
o Redefined SF_INTRS to include Tx DMA done and DMA errors. Removed
Tx done as it's not needed anymore.
o Added definition for Rx/Tx DMA high priority threshold.
o Nuked unused marco SF_IDX_LO, SF_IDX_HI.
o Added complete MAC statistic register definition.
o Modified sf_stats structure to hold all MAC statistic regiters.
o Nuke various driver private padding data in Tx/Rx descriptor
definition. sf(4) no longer requires private padding. Also remove
unused padding related definitions. This greatly simplifies
descriptor manipulation on 64bit architectures.
o Becase we no longer pad driver private data into descriptor,
remove deprecated/not-applicable comments for padding.
o Redefine Rx/Tx desciptor status. sf(4) doesn't use bit fileds
anymore to support endianness.
o Import AIC-6915 firmware for GFP from Adaptec.
Make ALTQ cope with disappearing interfaces (particularly common with mpd
and netgraph in gernal). This also allows to add queues for an interface
that is not yet existing (you have to provide the bandwidth for the
interface, however).
PR: kern/106400, kern/117827
Tested by: Florian Smeets, Boris S.
pmap.c 1.171; spitfire.c 1.6; tlb.c 1.9
- Do as the comment in pmap_bootstrap() suggests and flush all non-locked
TLB entries possibly left over by the firmware and also do so while
bootstrapping APs.
- Use __FBSDID.
- add _umtx_op_err function to improve stability because of errno
changed by application signal handler code.
- use kernel based userland rwlock to implement pthread_rwlock,
improve performance in most cases.
- Const'ify the dc_devs array.
- Correct the maxsize parameter when creating the mbufs busdma tag to
reflect the actual requirement of dc(4).
- Move the KASSERT in dc_newbuf() to the right spot.
- Also convert the TX side to take advantage of bus_dmamap_load_mbuf_sg(9).
- Move the comment regarding dc_start_locked() to the right spot.
Add support for displaying a process' current working directory, root
directory, and jail directory within procstat. While this functionality
is available already in fstat, encapsulating it in the kern.proc.filedesc
sysctl makes it accessible without using kvm and thus without needing
elevated permissions.
The new procstat output looks like:
PID COMM FD T V FLAGS REF OFFSET PRO NAME
76792 tcsh cwd v d -------- - - - /usr/src
76792 tcsh root v d -------- - - - /
76792 tcsh 15 v c rw------ 16 9130 - -
76792 tcsh 16 v c rw------ 16 9130 - -
76792 tcsh 17 v c rw------ 16 9130 - -
76792 tcsh 18 v c rw------ 16 9130 - -
76792 tcsh 19 v c rw------ 16 9130 - -
I am also bumping __FreeBSD_version for this as this new feature will be
used in at least one port.
Reviewed by: rwatson
Approved by: rwatson
Note that in the MFC, __FreeBSD_version is not bumped as we will bump it
once (shortly) for all procstat(1) MFC changes together.
procstat_kstack.c:1.3, procstat_threads.c:1.3, procstat_vm.c:1.2 from
HEAD to RELENG_7:
WARNS fixes: mainly constness and avoid comparing signed with
unsigned by making array indicies unsigned. Also note one or two
unused parameters.
kern_sync.c:1.305, proc.h:1.499 from HEAD to RELENG_7:
Don't zero td_runtime when billing thread CPU usage to the process;
maintain a separate td_incruntime to hold unbilled CPU usage for
the thread that has the previous properties of td_runtime.
When thread information is requested using the thread monitoring
sysctls, export thread td_runtime instead of process rusage runtime
in kinfo_proc.
This restores the display of individual ithread and other kernel
thread CPU usage since inception in ps -H and top -SH, as well for
libthr user threads, valuable debugging information lost with the
move to try kthreads since they are no longer independent processes.
There is universal agreement that we should rewrite the process and
thread export sysctls, but this commit gets things going a bit
better in the mean time. Likewise, there are resevations about the
continued validity of statclock given the speed of modern processors.
Reviewed by: attilio, emaste, jhb, julian
Note: in MFC, td_incruntime is added to the end of struc thread,
rather than the pre-zero'd section, and manually zero'd on thread
creation, in order to avoid a negative ABI impact for third-party
kernel modules.
In "show lockedvnods" DDB command, use db_printf() rather than printf()
so that the results end up in the DDB output stream rather than the
console output stream.
This should likely also be done for the vprint() function it calls.
Return ESRCH when a kernel stack is queried on a process in execve() --
p_candebug() will return EAGAIN which, if the other process never
leaves execve(), will result in the sysctl spinning and never returning
to userspace. Processes should always eventually leave execve(), but
spinning in kernel while we wait is bad for countless reasons, and
particularly harmful if execve() itself is deadlocked.
Possibly we should return another error, or return a marker indicating
the thread is in execve() so it can be reported that way in userspace.
Reported by: kris
and procstat_files.c:1.2 from HEAD to RELENG_7:
Add 'COMM' column to a few more output modes of procstat(1). The only
one it's missing from is the VM display, where there's really not room,
and the file output display is looking quite cramped.
Use m_collapse(9) to collapse mbuf chains instead of relying on
shortest possible chain of mbufs of m_defrag(9). What we want is
chains of mbufs that can be safely stored to a Tx descriptor which
can have up to STGE_MAXTXSEGS mbufs. The ethernet controller does
not need to align Tx buffers on 32bit boundary. So the use of
m_defrag(9) was waste of time.
Implement WOL capability.
- Turn on WOL bits in suspend/shutdown method.
- WOL is disabled in resume routine as WOL can interfere normal
Rx operation.
- Move stge_reset() to stge_init_locked() as resetting hardware
clears configured Rx information which in turn results in
non-working Rx module after suspend/shutdown operation.
o vr(4) repocopied from sys/pci to sys/dev/vr.
Teach vr(4) to use bus_dma(9) and major overhauling to handle link
state change and reliable error recovery.
o Moved vr_softc structure and relevant macros to header file.
o Use PCIR_BAR macro to get BARs.
o Implemented suspend/resume methods.
o Implemented automatic Tx threshold configuration which will be
activated when it suffers from Tx underrun. Also Tx underrun
will try to restart only Tx path and resort to previous
full-reset(both Rx/Tx) operation if restarting Tx path have failed.
o Removed old bit-banging MII interface. Rhine provides simple and
efficient MII interface. While I'm here show PHY address and PHY
register number when its read/write operation was failed.
o Define VR_MII_TIMEOUT constant and use it in MII access routines.
o Always honor link up/down state reported by mii layers. The link
state information is used in vr_start() to determine whether we
got a valid link.
o Removed vr_setcfg() which is now handled in vr_link_task(), link
state taskqueue handler. When mii layer reports link state changes
the taskqueue handler reprograms MAC to reflect negotiated duplex
settings. Flow-control changes are not handled yet and it should
be revisited when mii layer knows the notion of flow-control.
o Added a new sysctl interface to get statistics of an instance of
the driver.(sysctl dev.vr.0.stats=1)
o Chip name was renamed to reflect the official name of the chips
described in VIA Rhine I/II/III datasheet.
REV_ID_3065_A -> REV_ID_VT6102_A
REV_ID_3065_B -> REV_ID_VT6102_B
REV_ID_3065_C -> REV_ID_VT6102_C
REV_ID_3106_J -> REV_ID_VT6105_A0
REV_ID_3106_S -> REV_ID_VT6105M_A0
The following chip revisions were added.
#define REV_ID_VT6105_B0 0x83
#define REV_ID_VT6105_LOM 0x8A
#define REV_ID_VT6107_A0 0x8C
#define REV_ID_VT6107_A1 0x8D
#define REV_ID_VT6105M_B1 0x94
o Always show chip revision number in device attach. This shall help
identifying revision specific issues.
o Check whether EEPROM reloading is complete by inspecting the state
of VR_EECSR_LOAD bit. This bit is self-cleared after the EEPROM
reloading. Previously vr(4) blindly spins for 200us which may/may
not enough to complete the EEPROM reload.
o Removed if_mtu setup. It's done in ether_ifattach().
o Use our own callout to drive watchdog timer.
o In vr_attach disable further interrupts after reset. For VT6102 or
newer hardwares, diable MII state change interrupt as well because
mii state handling is done by mii layer.
o Add more sane register initialization for VT6102 or newer chips.
- Have NIC report error instead of retrying forever.
- Let hardware detect MII coding error.
- Enable MODE10T mode.
- Enable memory-read-multiple for VT6107.
o PHY address for VT6105 or newer chips is located at fixed address 1.
For older chips the PHY address is stored in VR_PHYADDR register.
Armed with these information, there is no need to re-read
VR_PHYADDR register in miibus handler to get PHY address. This
saves one register access cycle for each MII access.
o Don't reprogram VR_PHYADDR register whenever access to a register
located at a PHY address is made. Rhine fmaily allows reprogramming
PHY address location via VR_PHYADDR register depending on
VR_MIISTAT_PHYOPT bit of VR_MIISTAT register. This used to lead
numerous phantom PHYs attached to miibus during phy probe phase and
driver used to limit allowable PHY address in mii register accessors
for certain chip revisions. This removes one more register access
cycle for each MII access.
o Correctly set VLAN header length.
o bus_dma(9) conversion.
- Limit DMA access to be in range of 32bit address space. Hardware
doesn't support DAC.
- Apply descriptor ring alignment requirements(16 bytes alignment)
- Apply Rx buffer address alignment requirements(4 bytes alignment)
- Apply Tx buffer address alignment requirements(4 bytes alignment)
for Rhine I chip. Rhine II or III has no Tx buffer address
alignment restrictions, though.
- Reduce number of allowable number of DMA segments to 8.
- Removed the atomic(9) used in descriptor ownership managements
as it's job of bus_dmamap_sync(9).
With these change vr(4) should work on all platforms.
o Rhine uses two separated 8bits command registers to control Tx/Rx
MAC. So don't access it as a single 16bit register.
o For non-strict alignment architectures vr(4) no longer require
time-consuming copy operation for received frames to align IP
header. This greatly improves Rx performance on i386/amd64
platforms. However the alignment is still necessary for
strict-alignment platforms(e.g. sparc64). The alignment is handled
in new fuction vr_fixup_rx().
o vr_rxeof() now rejects multiple-segmented(fragmented) frames as
vr(4) is not ready to handle this situation. Datasheet said nothing
about the reason when/why it happens.
o In vr_newbuf() don't set VR_RXSTAT_FIRSTFRAG/VR_RXSTAT_LASTFRAG
bits as it's set by hardware.
o Don't pass checksum offload information to upper layer for
fragmented frames. The hardware assisted checksum is valid only
when the frame is non-fragmented IP frames. Also mark the checksum
is valid for corrupted frames such that upper layers doesn't need
to recompute the checksum with software routine.
o Removed vr_rxeoc(). RxDMA doesn't seem to need to be idle before
sending VR_CMD_RX_GO command. Previously it used to stop RxDMA
first which in turn resulted in long delays in Rx error recovery.
o Rewrote Tx completion handler.
- Always check VR_TXSTAT_OWN bit in status word prior to
inspecting other status bits in the status word.
- Collision counter updates were corrected as VT3071 or newer
ones use different bits to notify collisions.
- Unlike other chip revisions, VT86C100A uses different bit to
indicate Tx underrun. For VT3071 or newer ones, check both
VR_TXSTAT_TBUFF and VR_TXSTAT_UDF bits to see whether Tx
underrun was happend. In case of Tx underrun requeue the failed
frame and restart stalled Tx SM. Also double Tx DMA threshold
size on each failure to mitigate future Tx underruns.
- Disarm watchdog timer only if we have no queued packets,
otherwise don't touch watchdog timer.
o Rewrote interrupt handler.
- status word in Tx/Rx descriptors indicates more detailed error
state required to recover from the specific error. There is no
need to rely on interrupt status word to recover from Tx/Rx
error except PCI bus error. Other event notifications like
statistics counter overflows or link state events will be
handled in main interrupt handler.
- Don't touch VR_IMR register if we are in suspend mode. Touching
the register may hang the hardware if we are in suspended state.
Previously it seems that touching VR_IMR register in interrupt
handler was to work-around panic occurred in system shutdown
stage on SMP systems. I think that work-around would hide
root-cause of the panic and I couldn't reproduce the panic
with multiple attempts on my box.
o While padding space to meet minimum frame size, zero the pad data
in order to avoid possibly leaking sensitive data.
o Rewrote vr_start_locked().
- Don't try to queue packets if number of available Tx descriptors
are short than that of required one.
o Don't reinitialize hardware whenever media configuration is
changed. Media/link state changes are reported from mii layer if
this happens and vr_link_task() will perform necessary changes.
o Don't reinitialize hardware if only PROMISC bit was changed. Just
toggle the PROMISC bit in hardware is sufficient to reflect the
request.
o Rearrganed the IFCAP_POLLING/IFCAP_HWCSUM handling in vr_ioctl().
o Generate Tx completion interrupts for every VR_TX_INTR_THRESH-th
frames. This reduces Tx completion interrupts under heavy network
loads.
o Since vr(4) doesn't request Tx interrupts for every queued frames,
reclaim any pending descriptors not handled in Tx completion
handler before actually firing up watchdog timeouts.
o Added vr_tx_stop()/vr_rx_stop() to wait for the end of active
TxDMA/RxDMA cycles(draining). These routines are used in vr_stop()
to ensure sane state of MAC before releasing allocated Tx/Rx
buffers. vr_link_task() also takes advantage of these functions to
get to idle state prior to restarting Tx/Rx.
o Added vr_tx_start()/vr_rx_start() to restart Rx/Tx. By separating
Rx operation from Tx operation vr(4) no longer need to full-reset
the hardware in case of Tx/Rx error recovery.
o Implemented WOL.
o Added VT6105M specific register definitions. VT6105M has the
following hardware capabilities.
- Tx/Rx IP/TCP/UDP checksum offload.
- VLAN hardware tag insertion/extraction. Due to lack of information
for getting extracted VLAN tag in Rx path, VLAN hardware support
was not implemented yet.
- CAM(Content Addressable Memory) based 32 entry perfect multicast/
VLAN filtering.
- 8 priority queues.
o Implemented CAM based 32 entry perfect multicast filtering for
VT6105M. If number of multicast entry is greater than 32, vr(4)
uses traditional hash based filtering.
o Reflect real Tx/Rx descriptor structure. Previously vr(4) used to
embed other driver (private) data into these structure. This type
of embedding make it hard to work on LP64 systems.
o Removed unused vr_mii_frame structure and MII bit-baning
definitions.
o Added new PCI configuration registers that controls mii operation
and mode selection.
o Reduced number of Tx/Rx descriptors to 128 from 256. From my
testing, increasing number of descriptors above than 64 didn't help
increasing performance at all. Experimentations show 128 Rx
descriptors seems to help a lot reducing Rx FIFO overruns under
high system loads. It seems the poor Tx performance of Rhine
hardwares comes from the limitation of hardware. You wouldn't
satuarte the link with vr(4) no matter how fast CPU/large number of
descriptors are used.
o Added vr_statistics structure to hold various counter values.
Add a new function is_default_interface() which determines if this
interface is one with the default route (or there isn't one). Use it to
decide if we should adjust the default route and /etc/resolv.conf.
Fix the delete of the default route. The if statement was totally bogus
and the delete only worked due to a typo. [1]
Reported by: Jordan Coleman <jordan at JordanColeman dot com> [1]
Check for P_WEXIT before PHOLD() on a process in kstack and vm query
sysctls, as PHOLD() asserts !P_WEXIT.
Reported by: Michael Plass <mfp49_freebsd at plass-family dot net>
RELENG_7:
Display per-thread command line in TDNAME field for -k and -t; if
no per-thread name is available or the name is identical to the
process name, display "-" instead. Very slightly shrink the COMM
entry to make a bit more room, although this doesn't help with
stack traces much.
Suggested by: thompsa
When a symbol name can't be resolved, return "??" as the name, rather
than "Unknown func", in order to avoid putting spaces in what ideally
is a string separated by white space.
procstat_args.c:1.1, procstat_basic.c:1.1, procstat_bin.c:1.1,
procstat_cred.c:1.1, procstat_files.c:1.1, procstat_kstack.c:1.1,
procstat_threads.c:1.1, and procstat_vm.c:1.1 from HEAD to RELENG_7:
Add procstat(1), a process inspection utility. This provides both some
of the missing functionality from procfs(4) and new functionality for
monitoring and debugging specific processes. procstat(1) operates in
the following modes:
-b Display binary information for the process.
-c Display command line arguments for the process.
-f Display file descriptor information for the process.
-k Display the stacks of kernel threads in the process.
-s Display security credential information for the process.
-t Display thread information for the process.
-v Display virtual memory mappings for the process.
Further revision and modes are expected.
Testing, ideas, etc: cognet, sam, Skip Ford <skip at menantico dot com>
Wesley Shields <wxs at atarininja dot org>
RELENG_7:
Add another new sysctl in support of the forthcoming procstat(1) to
support its -k argument:
kern.proc.kstack - dump the kernel stack of a process, if debugging
is permitted.
This sysctl is present if either "options DDB" or "options STACK" is
compiled into the kernel. Having support for tracing the kernel
stacks of processes from user space makes it much easier to debug
(or understand) specific wmesg's while avoiding the need to enter
DDB in order to determine the path by which a process came to be
blocked on a particular wait channel or lock.
date: 2008/03/07 00:01:19; author: delphij; state: Exp; lines: +61 -68
Merge revisions 1.10 and 1.11 from DragonFly:
- Use real getopt() handling instead of the hand-rolled and
IOCCC-worthy "Micro getopt()" macros, plus clean up to the
option handling code:
* Sort the options in the switch statement;
* Plug piddling memory leaks when processing repeated options
by freeing strings before allocating them for a second time;
* Die with a fatal error if the requested report file cannot
be opened for appending;
* Don't call init() before usage() (to prevent the usage
message being mangled by changes to the terminal settings;)
- Clean up the usage message, both in usage() and in the main
program comment, both stylistically (sort and combine options)
and for accuracy (following the manual page, make note of the -s
and -S flags, and use the term 'send' instead of 'say' to reduce
confusion (SAY is the name of a command for output to the user,
not the connection.))
Obtained from: DragonFly
amd64/conf/GENERIC:1.489, amd64/include/stack.h:1.1, arm/db_trace.c:1.14,
arm/stack_machdep.c:1.1, arm/include/stack.h:1.1, NOTES:1.1457,
files:1.1254, files.amd64:1.115, files.arm:1.19, files.i386:1.588,
files.ia64:1.94, files.powerpc:1.67, files.sparc64:1.93, files.sun4v:1.13,
options:1.610, i386/conf/GENERIC:1.478, i386/db_trace.c:1.80,
i386/stack_machdep.c:1.1, i386/include/stack.h:1.1, ia64/conf/GENERIC:1.93,
ia64/db_machdep.c:1.6, ia64/stack_machdep.c:1.1, kern/subr_stack.c:1.5,
pc98/conf/GENERIC:1.299, powerpc/conf/GENERIC:1.73,
powerpc/include/stack.h:1.1, powerpc/db_trace.c:1.14,
powerpc/stack_machdep.c:1.1, sparc64/conf/GENERIC:1.129,
sparc64/include/stack.h:1.1, sparc64/db_trace.c:1.27,
sparc64/stack_machdep.c:1.1, sun4v/conf/GENERIC:1.16,
sun4v/include/stack.h:1.1, sun4v/db_trace.c:1.2, sun4v/stack_machdep.c:1.1,
sys/stack.h:1.4 from HEAD to RELENG_7:
Break out stack(9) from ddb(4):
- Introduce per-architecture stack_machdep.c to hold stack_save(9).
- Introduce per-architecture machine/stack.h to capture any common
definitions required between db_trace.c and stack_machdep.c.
- Add new kernel option "options STACK"; we will build in stack(9) if it
is defined, or also if "options DDB" is defined to provide
compatibility with existing users of stack(9).
Add new stack_save_td(9) function, which allows the capture of a
stacktrace of another thread rather than the current thread, which the
existing stack_save(9) was limited to. It requires that the thread be
neither swapped out nor running, which is the responsibility of the
consumer to enforce.
Update stack(9) man page.
Build tested: amd64, arm, i386, ia64, powerpc, sparc64, sun4v
Runtime tested: amd64 (rwatson), arm (cognet), i386 (rwatson)
Merge i386/stack_machdep.c:1.2 from HEAD to RELENG_7:
Remove duplicate $FreeBSD$ tag.
Merge files.pc98:1.359, pc98/include/stack.h:1.1 from HEAD to RELENG_7:
Catch up pc98 for i386 stack(9) changes:
Add stub stack.h for pc98 that includes i386 pc98.
Add i386 stack_machdep.c to files.pc98.
Spotted by: tinderbox
user.h:1.71 from HEAD to RELENG_7:
Add two new sysctls in support of the forthcoming procstat(1) to support
its -f and -v arguments:
kern.proc.filedesc - dump file descriptor information for a process, if
debugging is permitted, including socket addresses, open flags, file
offsets, file paths, etc.
kern.proc.vmmap - dump virtual memory mapping information for a process,
if debugging is permitted, including layout and information on
underlying objects, such as the type of object and path.
These provide a superset of the information historically available
through the now-deprecated procfs(4), and are intended to be exported
in an ABI-robust form.
stack.h:1.3, redzone.c:1.2 from HEAD to RELENG_7:
Modify stack(9) stack_print() and stack_sbuf_print() routines to use new
linker interfaces for looking up function names and offsets from
instruction pointers. Create two variants of each call: one that is
"DDB-safe" and avoids locking in the linker, and one that is safe for
use in live kernels, by virtue of observing locking, and in particular
safe when kernel modules are being loaded and unloaded simultaneous to
their use. This will allow them to be used outside of debugging
contexts.
Modify two of three current stack(9) consumers to use the DDB-safe
interfaces, as they run in low-level debugging contexts, such as inside
lockmgr(9) and the kernel memory allocator.
Update man page.
The kernel linker includes a number of utility functions to look up symbol
information in support of DDB(4); these functions bypass normal linker
locking as they may run in contexts where locking is unsafe (such as the
kernel debugger).
Add a new interface linker_ddb_search_symbol_name(), which looks up a
symbol name and offset given an address, and also
linker_search_symbol_name() which does the same but *does* follow the
locking conventions of the linker.
Unlike existing functions, these functions place the name in a
caller-provided buffer, which is stable even after linker locks have been
released. These functions will be used in upcoming revisions to stack(9)
to support kernel stack trace generation in contexts as part of a live,
rather than suspended, kernel.
audit_private.h:1.17 from HEAD to RELENG_7:
Rename several audit functions in the global kernel symbol namespace to
have audit_ on the front:
- canon_path -> audit_canon_path
- msgctl_to_event -> audit_msgctl_to_event
- semctl_to_event -> audit_semctl_to_event
Note that audit.c:1.38 is not merged as changes it depends on have also not
yet been merged.
- Simplify the error handling
- Nuke licence clause 3 & 4
- Drop frames to any of the reserved multicast addresses
- Remove duplicated code for testing local packets.
that we can remove the file as early as possible, but shut up nextboot at this
moment if the operation is failed, because /boot is not necessarily a part of /;
the newly added second run is placed in rc.d/mountlate after all filesystems were
mounted.
Bring the DIAGNOSTICS section in ed.4 closer to reality by removing missing
diagnostic messages and adding a few found in the code.
PR: 51891
Properly Xref device.hints(5).
Sync with rev 1.63 of NetBSD's ums.c:
If a mouse has both a wheel and a Z direction we report both.
XXX Due to tradition the wheel is reported as the Z direction (and the Z
direction as W).
Now Apple's Mighty Mouse is fully supported, except the X11 mouse driver
doesn't know what to do with the new coordinate.
Calling RequestSupplementAdapterInfo before RequestAdapterInfo appears
to trip a bug causing the latter to return a zeroed struct
aac_adapter_info. This causes two issues. One is cosmetic only --
a verbose boot prints information about the controller, and shows all
zero:
aac0: Unknown processor 0MHz, 0MB memory (0MB cache, 0MB execution),
unknown battery platform
The second problem is that the firmware version information is stored
away for aac_rev_check, for userland tools (like aaccli) to query via
the FSACTL_MINIPORT_REV_CHECK and FSACTL_LNX_MINIPORT_REV_CHECK ioctls.
When aaccli encounters this issue it prints
Command Error: <The current AFAAPI.DLL is too old to work with the
current controller software.>
Move the RequestSupplementAdapterInfo call after RequestAdapterInfo,
which seems to fix both problems.
imp@ has already done this in HEAD, refer to revision 1.476 of
i386/conf/GENERIC and revision 1.486 of amd64/conf/GENERIC. It seems only fair
to do the same in RELENG_7.
Discussed with: imp
Approved by: re (bmah, kensmith)
Rather than copying out the full audit trigger record, which includes
a queue entry field, just copy out the unsigned int that is the trigger
message. In practice, auditd always requested sizeof(unsigned int), so
the extra bytes were ignored, but copying them out was not the intent.
Replace somewhat awkward audit trail rotation scheme, which involved the
global audit mutex and condition variables, with an sx lock which protects
the trail vnode and credential while in use, and is acquired by the system
call code when rotating the trail. Previously, a "message" would be sent
to the kernel audit worker, which did the rotation, but the new code is
simpler and (hopefully) less error-prone.
Obtained from: TrustedBSD Project
rev. 1.277 of sys/kern/vfs_mount.c
rev. 1.332 of sys/sys/vnode.h
rev. 1.222 of sys/ufs/ffs/ffs_softdep.c
Yield the cpu in the kernel while iterating the list of the
vnodes belonging to the mountpoint. Also, yield when in the
softdep_process_worklist() even when we are not going to sleep due to
buffer drain.
Fix a buffer overflow in the processing of various SCSI commands. This
likely fixes a great number of weird problems that have been reported
with this driver.
Use the new command file feature of ddb(8) to support setting ddb(4)
scripts at boot. This is currently disabled by default. /etc/ddb.conf
contains some potentially reasonable default scripts.
PR: conf/119995
Submitted by: Scot Hetzel <swhetzel at gmail dot com> (Earlier version)
- Switch from timeval to bintime, to use 1/(2^20) of seconds instead of
microseconds. It allows to use bit shifts instead of some heavy 64bit
mul/div math operations.
- Account all node stats at the shape mode.
- Do not check destination hook presence, it will be done by netgraph.
- Use u_int instead of int in some places to simplify type conversions.
- Use NG_SEND_DATA_ONLY() macro instead of selfmade equivalent.
Add a /S mode to DDB "ex" command, which interprets and prints the
value at the requested address as a symbol. For example, "ex /S
aio_swake" prints the name of the function currently registered in
via aio_swake hook.
The change as committed differs slightly from the patch in the PR,
as I force the size of the retrieved value (and the automatic
address increment) to be sizeof(void *). This seems to provide
the most useful auto-increment behavior, and defaults using the
default size (4), which is not sizeof(void *) on 64-bit platforms.
PR: 57976
Submitted by: Dan Strick <strick at covad.net>
Use dump_write() instead of direct calls to di->dumper() in textdumps.
Textdumps already do pretty much the same sanity checking, but
abstractions and seatbelts are both useful.
Allow DDB_CAPTURE_DEFAULTBUFSIZE and DDB_CAPTURE_MAXBUFSIZE to be
overridden at compile-time using kernel options of the same names.
Rather than doing a compile-time CTASSERT of buffer sizes being
even multiples of block sizes, just adjust them at boottime, as
the failure mode is more user-friendly.
MFC after: 2 months
PR: 119993
Suggested by: Scot Hetzel <swhetzel at gmail dot com>
Some PS/2 mice (at least the A4Tech X-7xx) need to be set to Intelli mode
first before they can be set to Explorer mode.
PR: kern/118578
Submitted by: Andriy Gapon <[email protected]> (I added some comments)
Reviewed by: philip
Import uslcom(4) from OpenBSD - this is a driver for Silicon Laboratories
CP2101/CP2102 based USB serial adapters.
Reviewed by: imp, emaste
Obtained from: OpenBSD
Rename DB_ constants in db_capture.c to DDB_ so that when they are
exposed as kernel compile options, they have more meaningful names.
PR: 119993
MFC after: 2 months
Suggested by: Scot Hetzel <swhetzel at gmail dot com>
Teach savecore(8) how to extract textdump(4) dumps.
Update savecore(8) man page to reflect textdump additions.
Merge savecore.c:1.80 from HEAD to RELENG_7:
Compare kernel dump header magic with textdump magic using strncmp()
rather than the memcmp() which is used for regular dumps: the
textdump string is one character shorter, so we need to stop
comparing at the end of the string.
Use independent version checking logic for architecture-specific
version number vs. textdump version number, as the version sequences
may (someday) differ.
Run into by: rrs
Add textdump(4) man page to describe the textdump facility and provide
some stock formulas for use.
Update ddb(4) to reference the textdump(4) page, list the textdump
commands, and suggest using them with scripts and output capture.
Update HISTORY section.
Hook up textdump(4) to build.
db_textdump.c:1.1, ddb.h:1.46, kern_shutdown.c:1.187 from HEAD to
RELENG_7:
Add textdump(4) facility, which provides an alternative form of kernel
dump using mechanically generated/extracted debugging output rather than
a simple memory dump. Current sources of debugging output are:
- DDB output capture buffer, if there is captured output to save
- Kernel message buffer
- Kernel configuration, if included in kernel
- Kernel version string
- Panic message
Textdumps are stored in swap/dump partitions as with regular dumps, but
are laid out as ustar files in order to allow multiple parts to be stored
as a stream of sequentially written blocks. Blocks are written out in
reverse order, as the size of a textdump isn't known a priori. As with
regular dumps, they will be extracted using savecore(8).
One new DDB(4) command is added, "textdump", which accepts "set",
"unset", and "status" arguments. By default, normal kernel dumps are
generated unless "textdump set" is run in order to schedule a textdump.
It can be canceled using "textdump unset" to restore generation of a
normal kernel dump.
Several sysctls exist to configure aspects of textdumps;
debug.ddb.textdump.pending can be set to check whether a textdump is
pending, or set/unset in order to control whether the next kernel dump
will be a textdump from userspace.
While textdumps don't have to be generated as a result of a DDB script
run automatically as part of a kernel panic, this is a particular useful
way to use them, as instead of generating a complete memory dump, a
simple transcript of an automated DDB session can be captured using the
DDB output capture and textdump facilities. This can be used to
generate quite brief kernel bug reports rich in debugging information
but not dependent on kernel symbol tables or precisely synchronized
source code. Most textdumps I generate are less than 100k including
the full message buffer. Using textdumps with an interactive debugging
session is also useful, with capture being enabled/disabled in order to
record some but not all of the DDB session.
aac.c 1.134, aac_disk.c 1.45, aacreg.h 1.25, aacvar.h 1.51:
Add 64-bit array support for RAIDs > 2TB. This corresponds to ~ Adaptec
driver build 15317.
Tested on:
Adaptec 2230S, Firmware 4.2-0 (8205)
ICP ICP5085BL, Firmware 5.2-0 (12814)
aac.c 1.136, aac_ioctl.h 1.13:
Implement FSACTL_LNX_GET_FEATURES and FSACTL_GET_FEATURES ioctls. RAID
tools (e.g. arcconf) need this to be able to create arrays larger than 2TB.
Submitted by: Adaptec, via driver build 15317
The RELENG_7 and HEAD drivers are in sync as of this commit.
aac.c 1.131:
Diff reduction to Adaptec driver build 15317 (refactoring and code shuffling):
- Resource allocation in aac_alloc (moved from from aac_init)
- Interrupt setup in aac_setup_intr (from aac_attach)
- Container probing in aac_get_container_info (from aac_startup and
aac_handle_aif)
- Firmware status check moved to aac_check_firmware from aac_init
aac.c 1.132, aac_cam.c 1.31, aad_debug.c 1.24, aac_disk.c 1.44,
aac_pci.c 1.67, aacvar.h 1.50:
Diff reduction to Adaptec's driver (around build 15317): catch up with a
change in debugging routines.
The fwprintf macro in the AAC_DEBUG case (mapping to printf) isn't from the
Adaptec driver.
aac.c 1.135:
Add \n to the end of a printf string and remove it from panic strings.
Define a new kernel dump "architecture", TEXTDUMPMAGIC, which is used
to identify textdumps in the swap/dump partition. While textdumps
aren't really an architecture, they are architecture-neutral and so
don't really correspond to any existing architecture.
Define a version number for textdumps, KERNELDUMP_TEXT_VERSION, of 1.
ddb.h:1.1, ddb_script.c:1.1 from HEAD to RELENG_7:
Add command-line tool ddb(8), which allows DDB(4) scripts to be
managed from userspace. It is largely a wrapper for sysctl()
calls, but because the sysctls for adding and removing scripts
are awkward to use directly, this provides an easier-to-use
interface.
db_lex.h:1.15, db_main.c:1.7, db_script.c:1.1-1.2, ddb.h:1.45 from HEAD
to RELENG_7:
Add a simple scripting facility to DDB(4), allowing the user to
define a set of named scripts. Each script consists of a list of DDB
commands separated by ";"s that will be executed verbatim. No higher
level language constructs, such as branching, are provided for:
scripts are executed by sequentially injecting commands into the DDB
input buffer.
Four new commands are present in DDB: "run" to run a specific script,
"script" to define or print a script, "scripts" to list currently
defined scripts, and "unscript" to delete a script, modeled on shell
alias commands. Scripts may also be manipulated using sysctls in the
debug.ddb.scripting MIB space, although users will prefer to use the
soon-to-be-added ddb(8) tool for usability reasons.
Scripts with certain names are automatically executed on various DDB
events, such as entering the debugger via a panic, a witness error,
watchdog, breakpoint, sysctl, serial break, etc, allowing customized
handling.
Remove duplicate $FreeBSD$ that snuck in.
uart_dev_at91usart.c:1.13, scsi_low.h:1.9, subr_ntoskrnl.c:1.94,
OsdDebug.c:1.14, dcons_os.c:1.20, ofw_consle.c:1.37,
dev/sio.c:1.473, syscons.c:1.454, uart_core.c:1.23,
union_subr.c:1.96, i386/machdep.c:1.664, i386/mp_watchdog.c:1.6,
ia64/machdep.c:1.228, kern_clock.c:1.206, kern_shutdown.c:1.186,
subr_kdb.c:1.25, subr_witness.c:1.239, vfs_subr.c:1.711,
ng_base.c:1.140, cbus/sio.c:1.247, pc98/machdep.c:1.399,
aim/machdep.c:1.107, pswitch.c:1.7, mac_test.c:19.3,
psycho.c:1.73, sparc64/machdep.c:1.140, sparc64/trap.c:1.89,
hvcons.c:1.7, sun4v/machdep.c:1.17, sun4v/trap.c:1.17, kdb.h:1.6
from HEAD to RELENG_7:
Add a new 'why' argument to kdb_enter(), and a set of constants to use
for that argument. This will allow DDB to detect the broad category of
reason why the debugger has been entered, which it can use for the
purposes of deciding which DDB script to run.
Assign approximate why values to all current consumers of the
kdb_enter() interface.
For ABI/KPI reasons, the MFC creates a new function, kdb_enter_why(),
with the new argument, updating existing consumers to use that,
preserving kdb_enter() with the current argument, and wrapping it around
kdb_enter_why().
Rewrite node to support multiple hooks, alike to ng_l2tp, to use one pair
of pptpgre and ksocket nodes for all calls between two peers. This patch
modifies node's API by adding new "session_%04x" hook names support, while
keeping backward compatibility.
stdio.h: 1.61
Allow an application to define FOPEN_MAX (like we allow for OPEN_MAX
in sys/syslimits.h).
awk/Makefile: 1.17
Allow awk to handle 64 files instead of just 20.
Import change from KAME, rev. 1.362 kame/kame/sys/netkey/key.c
In case of "new SA", we must check the hard lifetime of the old SA
to find out if it is not permanent and we can delete it.
Document the removal data for usbdevs.h and usbdevs_data.h,
sort the entry into it's correct place (behind 200407XX before
200406XX because we have an explicit date here).
PR: misc/122098
Submitted by: "John Hein" <[email protected]>
MFC after: 3 days
Approved by: imp (mentor, implicit)
In route.c in newroute() there's a call to exit(0) if the command was
'get'. Since rtmsg() always gets called and returns 0 on success and -1
on failure, it's possible to exit with a suitable exit code by calling
exit(ret != 0) instead, as is done at the end of newroute().
PR: bin/112303
Submitted by: [email protected]
MFC after: 1 week
Approved by: imp (mentor, implicit)
MFC rev. 1.3 of sys/compat/linux/linux_futex.h:
o Add stub support for some new futex operations,
so the annoying message is not printed.
o Don't warn about FUTEX_FD not being implemented
and return ENOSYS instead of 0 (eg. success).
o Clear FUTEX_PRIVATE_FLAG as we actually implement
only private futexes so there is no reason to
return ENOSYS when app asks for a private futex.
We don't reject shared futexes because they worked
just fine with our implementation so far.
Approved by: kib (mentor)
Tested by: bsam
aac.c r1.129 aac_ioctl.h r1.12:
Add ioctls FSACTL_SEND_LARGE_FIB, FSACTL_SEND_RAW_SRB,
FSACTL_LNX_SEND_LARGE_FIB, and FSACTL_LNX_SEND_RAW_SRB, and correct size
checks on FIBs passed in from userspace. Both changes were obtained from
Adaptec's driver build 15317. Adaptec's commandline RAID tool arcconf uses
these ioctls when creating a RAID-10 array (and probably other operations
too).
aac.c r1.130:
Restore creation of passthrough devices with newer controller firmware by
putting the correct size in the fib header. Presumably the older firmware
silently ignored a bad size field.
(This change tested with a 3805 controller. Passthrough devices were
created when running firmware build 12814, but not 15323 or later. With
this change they're created for both old and new firmware versions.)
Submitted by: Adaptec
rev. 1.682 of sys/amd64/amd64/machdep.c
rev. 1.16 of sys/amd64/ia32/ia32_signal.c
rev. 1.33 of sys/amd64/linux32/linux32_sysvec.c
rev. 1.666 of sys/i386/i386/machdep.c
rev. 1.152 of sys/i386/linux/linux_sysvec.c
rev. 1.39 of sys/i386/svr4/svr4_machdep.c
rev. 1.402 of sys/pc98/pc98/machdep.c
Modify the signal handler frame setup code to clear the DF {e,r}flags
bit on the amd64/i386 for the signal handlers.
db_main.c:1.6, db_output.c:1.38, ddb.h:1.44 from HEAD to RELENG_7:
Add a new DDB(4) facility, output capture. Input and output from DDB
may be captured to a memory buffer for later inspection using sysctl(8),
or in the future, to a textdump.
A new DDB command, "capture", is added, which accepts arguments "on",
"off", "reset", and "status".
A new DDB sysctl tree, debug.ddb.capture, is added, which can be used to
resize the capture buffer and extract buffer contents.
- Check device masks and bypass printing headers if capable device does
not exist. /etc/rc.d/mixer tried to restore non-existent recording
source because /var/var/db/mixer*-state contains '=rec' for example.
- Remove hardcoded mixer2 and mixer3 and do the right thing.
- Replace getopt(3) with hand-rolled option parser. It was not able
to handle 'mixer -rec mic' although it is a valid command.
- Make '-s' and '-S' mutualy exclusive as mixer(8) says.
- Do not re-read recording source unless it has been modified.
- Clean up code and fix style(9) nits.
Prefer clock_gettime(2) over gettimeofday(2) and use CLOCK_MONOTONIC_FAST.
It is only used to track elapsed time and it does not have to be precise.
Fix compiler warnings and style(9) bugs.
Separate SDP parameters data structures for the BNEP based profiles.
Generalize Service Availability SDP parameter creation.
Add mandatory "security description" SDP parameter to the PANU profile
Pointed-out by: Iain Hibbert < plunky at rya-online dot net >
Make sysctl_kern_arnd return a random buffer instead of a random long,
as it is expected by userland (stack protector guard setup for example).
PR: 119129
Approved by: rwatson (mentor)
MFC after: 1 month
rev. 1.24 of sys/fs/devfs/devfs_rule.c
rev 1.218 of sys/vm/vm_mmap.c
Do not dereference cdev->si_cdevsw, use the dev_refthread() to properly
obtain the reference.
rev. 1.210 of sys/kern/kern_conf.c
rev. 1.236 of sys/sys/conf.h
Fix two races in the handling of the d_gianttrick for the D_NEEDGIANT
drivers.
Do not free the memory allocated for the gianttrick cdevsw while holding
the dev_mtx.
Replace reference from vinum.8 to gvinum.8, it was advised in the PR to
replace this with vinum.4, but that's the kernel interface manual, which
is not appropriate in my understanding. I think that gvinum is a suitable
replacement for this.
PR: docs/121938
Submitted by: "Federico" <federicogalvezdurand at yahoo dot com>
MFC after: 3 days
Alert properly when we have stale mounts left after interupting
a tinybsd build. If we do not do this, we can accidentally remove
critical files from directories like /lib (if mounted).
PR: misc/121763
Submitted by: Richard Arends < richard at unixguru dot nl >
MFC after: 3 days
Approved by: imp (mentor, implicit)
Correct IPsec behaviour with a 'use' level in SP but no SA available.
In that case return an continue processing the packet without IPsec.
PR: 121384
Reported by: Cyrus Rahman (crahman gmail.com)
Tested by: Cyrus Rahman (crahman gmail.com) [slightly older version]
Remove the "Fast " from the
"Fast IPsec: Initialized Security Association Processing." printf.
People kept asking questions about this after the IPsec shuffle.
This still is the Fast IPsec implementation so no worries that it would
be any slower now. There are no functional changes.
Correct reference counting on the SP for outgoing IPv6 IPsec connections.
PR: 121374
Reported by: Cyrus Rahman (crahman gmail.com)
Tested by: Cyrus Rahman (crahman gmail.com)
#if 0 out a currently unsued (and incomplete) function: ip6_ipsec_mtu().
No need to compile 'dead' code.
I am leaving it in because we will have to review the concept and
should use the common function in various places.
The check for errors from the mount command did not work as
intended because another command (echo) is executed between
the mount command and the check.
Reported by: Sergey Baturov <[email protected]>
Add session ID hashing to speedup incoming packets dispatch in case
of many connections working via the same tunnel. For example, in case
of full "client <-> LAC <-> LNS" setup.
Move setting of MNTK_MPSAFE flag before UFS1 extended attribute
auto-start so that the flag is set before we start performing I/O
in the auto-start routine.
Suggested by: kib
HEAD to RELENG_7:
Remove custom queue macros in Coda, replacing them with queue(9) tailq
macros. The only semantic change was the need to add a vc_opened field
to struct vcomm since we can no longer use the request queue returning
to an uninitialized state to hold whether or not the device is open.
Fix link state handling in bfe(4).
o conversion to callout(9) API.
o add a missing driver lock in bfe_ifmedia_sts().
o use our callout to drive watchdog timer.
o restart Tx routine if pending queued packets are present in
watchdog handler.
o unarm watchdog timer only if there are no queued packets.
o don't blindly reset phy and let phy driver handle link change
request in bfe_init_locked().
o return the status of mii_mediachg() to caller in
bfe_ifmedia_upd(). Previously it always returned 0 to caller.
o add check for IFF_DRV_RUNNING flag as well as IFF_DRV_OACTIVE
in bfe_start_locked().
o implement miibus_statchg method that keeps track of current
link state changes as well as negotiated speed/duplex/
flow-control configuration.
Reprogram MAC to appropriate duplex state. Flow-control
configuration was also implemented but commented out at the
moment. The flow-control configuration will be enabled again
after we have general flow-control framework in mii layer.
Plug memory leak in jumbo buffer allocation failure path.
Patch in the PR was modified to check active jumbo buffers in use
and other possible jumbo buffer leak.
Jumbo buffer usage in lge(4) still wouldn't be reliable due to lack
of driver lock in local jumbo buffer allocator. Either introduce
a new lock to protect jumbo buffer or switch to UMA backed page
allocator for jumbo frame is required.
PR: kern/78072
To overcome hardware checksum offload bug msk(4) used to compute
TCP/UDP checksum in driver for short frames. For frames that requires
hardware VLAN tag insertion, the checksum offload trick does not
work due to changes of checksum offset in mbuf after the VLAN tag.
Disable hardware checksum offload for VLAN interface to fix the bug.
Workaround GMAC hardware hang of Yukon II on the receipt of pause
frames. This bug seems to happen on certain hardware model/revision
(e.g. 88E8053) but it's not identified which hardwares are affected.
Revision 1.4 of if_mskreg.h was not enough to workaround the bug.
To workaround it, inrease GMAC FIFO threshold by one FIFO word to
flush received pause frames.
- Retire npe_defrag(), gem_defrag(), msk_defrag(), nfe_defrag(), and
re_defrag() and use m_collapse() instead.
- Replace a reference to ath_defrag() in a comment in if_wpi.c with
m_collapse().
Add support for the NAP, GN and PANU profiles to the sdpd(8).
It should be mentioned that a somewhat similar patch was
submitted by Rako < rako29 at gmail dot com >
Add structures to hold SDP parameters for the NAP, GN and PANU profiles.
It should be mentioned that a somewhat similar patch was submitted by
Rako < rako29 at gmail dot com >
o In preparation for basing a new driver on this one:
- ANSIfy
- try to bring closer to style(9)
- remove banal comments.
o Add my copyright for having done lots of fixes and improvements.
Some PIIX4 chipsets need to be told to generate Stop Breaks by
setting
the appropriate bit in the DEVACTB register.
This change allows the C2 state on those systems to work as expected.
Reviewed by: njl
Submitted by: Andriy Gapon <avg at icyb.net.ua>
- Make Disk_Names() behave as documented in libdisk(3): return an array
of disk names, where you must free each pointer, as well as the array
by hand. [1]
- Destaticize "disks" in Disk_Names, it has no reasons to be static.
PR: kern/96077 [1]
PR: kern/114110 [1]
MFC after: 1 month
Approved by: rwatson (mentor)
Remove a superfluous line in run_interrupt_driven_config_hooks(),
next_entry is already initialized during TAILQ_FOREACH_SAFE().
PR: kern/119604
Approved by: rwatson (mentor)
MFC after: 1 month
o Add support for BSD disklabels (option GEOM_PART_BSD)
o Add support for VTOC8 disklabels (option GEOM_PART_VTOC8)
o Avoid false positives detecting MBRs
Improve apply callback error reporting:
Before this patch callback returned result of the last finished call chain.
Now it returns last nonzero result from all call chain results in this request.
As soon as this improvement gives reliable error reporting, it is now possible
to remove dirty workaround in ng_socket, made to return ENOBUFS error statuses
of request-response operations. That workaround was responsible for returning
ENOBUFS errors to completely unrelated requests working at the same time
on socket.
Enhance realpath(1) in a number of ways:
- Allow realpath to accept multiple paths on the command line.
- Add -q to suppress warnings if some paths can't be processed, and use
getopt(3) to process flags.
- Print the path being requested rather than a possibly partially
processed path when a failure occurs so that you can tell which of
several passed paths did fail.
PR: 112920
Submitted by: Ighighi <[email protected]>
Make chflags(1) more chmod(1)-like (and more feature complete):
- Add -v to print file names as they are processed; -vv prints the flags
change as well.
- Add -f to ignore failures with the same semantics as chflags(1), neither
printing an error nor affecting the return code.
- Don't try to set the flags if they won't change.
I made minor cosmetic tweaks to the code in the patch.
PR: 112827
Submitted by: Ighighi <ighighi at gmail.com>
When gzipping to a target file, only set the source file flags on the
target file after the timestamp has been set; otherwise setting the
timestamp will fail if the flags don't permit it (i.e., uchg).
PR: 120208
Submitted by: Ighighi <ighighi at gmail.com>
Don't auto-start or allow extattrctl for UFS2 file systems, as UFS2 has
native extended attributes. This didn't interfere with the operation of
UFS2 extended attributes, but the code shouldn't be running for UFS2.
The possibly interruptible msleep in coda_call() means well, but is
fundamentally fairly confused about how signals work and when it is
appropriate for upcalls to be interrupted. In particular, we should
be exempting certain upcalls from interruption, we should not always
eventually time out sleeping on a upcall, and we should not be
interrupting the sleep for certain signals that we currently are
(including SIGINFO). This code needs to be reworked in the style of
NFS interruptible mounts.
Use sbuf routines to construct core dump filenames rather than custom
string buffer handling, making the code both easier to read and more
robust against string-handling bugs.
In Coda, flush the attribute cache for a cnode when its fid is
changed, as its synthesized inode number may have changed and we
want stat(2) to pick up the new inode number.
Update cache flushing behavior in light of recent namecache and
access cache improvements:
- Flush just access control state on CODA_PURGEUSER, not the full
namecache for /coda.
- When replacing a fid on a cnode as a result of, e.g.,
reintegration after offline operation, we no longer need to
purge the namecache entries associated with its vnode.
RELENG_7:
Implement a rudimentary access cache for the Coda kernel module,
modeled on the access cache found in NFS, smbfs, and the Linux coda
module. This is a positive access cache of a single entry per file,
tracking recently granted rights, but unlike NFS and smbfs,
supporting explicit invalidation by the distributed file system.
For each cnode, maintain a C_ACCCACHE flag indicating the validity
of the cache, and a cached uid and mode tracking recently granted
positive access control decisions.
Prefer the cache to venus_access() in VOP_ACCESS() if it is valid,
and when we must fall back to venus_access(), update the cache.
Allow Venus to clear the access cache, either the whole cache on
CODA_FLUSH, or just entries for a specific uid on CODA_PURGEUSER.
Unlike the Coda module on Linux, we don't flush all entries on a
user purge using a generation number, we instead walk present
cnodes and clear only entries for the specific user, meaning it is
somewhat more expensive but won't hit all users.
Since the Coda module is agressive about not keeping around
unopened cnodes, the utility of the cache is somewhat limited for
files, but works will for directories. We should make Coda less
agressive about GCing cnodes in VOP_INACTIVE() in order to improve
the effectiveness of in-kernel caching of attributes and access
rights.
coda_subr.h:1.12, coda_vnops.c:1.94, coda_vnops.h:1.24,
coda_namecache.c:1.26, coda_namecache.h:1.15, Makefile:1.18,
from HEAD to RELENG_7:
Rather than having the Coda module use its own namecache, use the global
VFS namecache, as is done by the Coda module on Linux. Unlike the Coda
namecache, the global VFS namecache isn't tagged by credential, so use
ore conservative flushing behavior (for now) when CODA_PURGEUSER is
issued by Venus.
This improves overall integration with the FreeBSD VFS, including
allowing __getcwd() to work better, procfs/procstat monitoring, and so
on. This improves shell behavior in many cases, and improves ".."
handling. It may lead to some slowdown until we've implemented a
specific access cache, which should net improve performance, but in the
mean time, lookup access control now always goes to Venus, whereas
previously it didn't.
Add an option to register DUN (Dial-Up Networking) service on the same
RFCOMM channel if needed. There is really no good reason to not to support
this. AT-command exchange can be faked with chat script in ppp.conf.
Padding after EOL option must be zeros according to RFC793 but
the NOPs used are 0x01.
While we could simply pad with EOLs (which are 0x00), rather use an
explicit 0x00 constant there to not confuse poeple with 'EOL padding'.
Put in a comment saying just that.
Early MFC requested by: silby
because of more people reporting problems on net@
stdio is currently limited to file descriptors not greater than
{SHRT_MAX}, so {STREAM_MAX} should be no greater than that. (This
does not exactly meet the letter of POSIX but comes reasonably close
to it in spirit.)
When the state of the interface changes rapidly enough there is a race
where dhclient is in the process of exiting due to the link going down
when the link coming up causes devd to try and start a new one. This
results is the link being up, but no dhclient running.
Work around this race by checking a second time after a one second delay
before refusing to start a dhclient instance due to one already being
running.
During PREINIT, when giving the interface the address 0.0.0.0, do it as an
alias to avoid distrubing other addresses.
PR: bin/119255
Submitted by: Jaakko Heinonen <jh at saunalahti dot fi>
Teach gunzip that .tbz and .tbz2 uncompress to .tar, in a manner similar to
its existing understanding that .tgz uncompresses to .tar.
PR: 121519
Submitted by: Ighighi <ighighi at gmail.com>
Improve handling of the tinybsd application wrt ports. Ports that
have dependencies or need to install a new user/group, are not
problematic anymore.
PR: 121367
Submitted by: Richard Arends < richard at unixguru dot nl >
MFC after: 3 days
Approved by: imp (mentor, implicit)
To avoid control data losses, do not acknowledge recieving of control packet
if netgraph reported error while delivering to destination.
Reset 'next send' counter to the last requested by peer on ack timeout,
to resend all subsequest packets after lost one again without additional hints.
Send only one incoming notification at a time to reduce queue
trashing and improve performance.
Remove waitflag argument from ng_ksocket_incoming2(), it means nothing
as function call was queued by netgraph.
Remove node validity check, as node validity guarantied by netgraph.
Update comments.
coda_kernel.h:1.7, coda_namecache.c:1.25, coda_namecache.h:1.14,
coda_opstats.h:1.8, coda_pioctl.h:1.10, coda_psdev.c:1.43,
coda_psdev.h:1.8, coda_subr.c:1.35, coda_subr.h:1.11,
coda_venus.c:1.30, coda_venus.h:1.11, coda_vfsops.c:1.79,
coda_vfsops.h:1.14, coda_vnops.c:1.92, coda_vnops.h:1.23 from HEAD
to RELENG_7:
Since we're now actively maintaining the Coda module in the FreeBSD source
tree, restyle everything but coda.h (which is more explicitly shared
across systems) into a closer approximation to style(9).
Remove a few more unused function prototypes.
Add or clarify some comments.
Minor differences required in the MFC due to diverging VFS locking in
HEAD vs RELENG_7.
Add "show sysregs" command to ddb. On i386, this gives gdt, idt, ldt,
cr0-4, etc. Support should be added for other platforms that have a
different set of registers for system use.
When killing a user process from DDB, check that the requested signal is
> 0 rather than >= 0, or we will panic when trying to deliver the signal.
PR: 100802
Submitted by: Valerio Daelli <valerio.daelli at gmail.com>
Reserve two bytes at the end of the DDB input line in db_readline() to
hold the newline and nul terminator. Otherwise, there are cases where
garbage may end up in the command history due to a lack of a nul
terminator, or input may end up without room for a newline.
PR: 119079
Submitted by: Michael Plass <[email protected]>
coda_psdev.c:1.42, coda_psdev.h:1.7, coda_venus.c:1.29,
coda_vfsops.c:1.78, coda_vfsops.h:1.13, coda_vnops.c:1.91,
coda_vnops.h:1.22 from HEAD to RELENG_7:
Various further non-functional cleanups to coda:
- Rename print_vattr to coda_print_vattr and make static, rename
print_cred to coda_print_cred.
- Remove unused coda_vop_nop.
- Add XXX comment because coda_readdir forwards to the cache vnode's
readdir rather than venus_readdir, and annotate venus_readdir as
unused.
- Rename vc_nb_* to vc_*.
- Use d_open_t, d_close_t, d_read_t, d_write_t, d_ioctl_t and d_poll_t
for prototyping vc_* as that is the intent, don't use our own
definitions.
- Rename coda_nb_statfs to coda_statfs, rename NB_SFS_SIZ to
CODA_SFS_SIZ.
- Replace one more OBE reference to NetBSD with a reference to FreeBSD.
- Tidy up a little vertical whitespace here and there.
- Annotate coda_nc_zapvnode as unused.
- Remove unused vcodattach.
- Annotate VM_INTR as unused.
- Annotate that coda_fhtovp is unused and doesn't match the FreeBSD
prototype, so isn't hooked up to vfs_fhtovp. If we want NFS export of
Coda to work someday, this needs to be fixed.
- Remove unused getNewVnode.
- Remove unused coda_vget, coda_init, coda_quotactl prototypes.
Remove unused devtomp(), which exploited UFS-specific knowledge to find
the mountpoint for a specific device. This was implemented incorrectly,
a bad idea in a fundamental sense, and also never used, so presumably
a long-idle debugging function.
Since Coda is effectively a stacked file system, use VOP_EOPNOTSUPP
for vop_bmap; delete the existing stub that returned either EINVAL
or EOPNOTSUPP, and had unreachable calls to VOP_BMAP on the cache
vnode.
1.278 sys/netinet/ip_output.c
1.114 sys/netinet6/ip6_output.c
1.26 sys/netipsec/ipsec.c
1.15 sys/netipsec/ipsec.h
1.4 sys/netipsec/ipsec6.h
Rather than passing around a cached 'priv', pass in an ucred to
ipsec*_set_policy and do the privilege check only if needed.
Try to assimilate both ip*_ctloutput code blocks calling ipsec*_set_policy.
Implement 128 items node name hash for faster name search.
Increase node ID hash size from 32 to 128 items.
Increase default queue items allocation limit from 512 to 4096 items
to avoid terrible unpredicted effects for netgraph operation of their
exhaustion while allocating control messages.
Add separate configurable 512 items limit for data items allocation
for DoS/overload protection.
1.75 sys/kern/kern_jail.c
1.8 sys/netinet/ip_options.c
1.78 sys/netinet6/in6.c
1.113 sys/netinet6/ip6_output.c
1.41 sys/netinet6/ip6_var.h
1.76 sys/netinet6/raw_ip6.c
1.85 sys/netinet6/udp6_usrreq.c
[ previously MFCed by rwatson 1.18 sys/sys/priv.h belonging to this change ]
Replace the last susers calls in netinet6/ with privilege checks.
Introduce a new privilege allowing to set certain IP header options
(hop-by-hop, routing headers).
Leave a few comments that we would like to address later.
Discussed with: rwatson
coda_vfsops.c:1.74, coda_vnops.c:1.87, coda_vnops.h:1.20 from HEAD
to RELENG_7:
The Coda module was originally ported to NetBSD from Mach by rvb, and
then later to FreeBSD. Update various NetBSD-related comments: in some
cases delete them because they don't appply, in others update to say
FreeBSD as they still apply but in FreeBSD (and might for that matter
no longer apply on NetBSD), and flag one case where I'm not sure
whether it applies.
Before invoking vnode operations on cache vnodes, acquire the vnode
locks of those vnodes. Probably, Coda should do the same lock sharing/
pass-through that is done for nullfs, but in the mean time this ensures
that locks are adequately held to prevent corruption of data structures
in the cache file system.
Assuming most operations came from the top layer of Coda and weren't
performed directly on the cache vnodes, in practice this corruption was
relatively unlikely as the Coda vnode locks were ensuring exclusive
access for most consumers.
This causes WITNESS to squeal like a pig immediately when Coda is used,
rather than waiting until file close; I noticed these problems because
of the lack of said squealing.
NB: Because WITNESS in RELENG_7 doesn't yet support lockmgr, said
squealing doesn't yet happen in RELENG_7, but will do if/when lockmgr
grows support for WITNESS there.
Remove undefined coda excluded by #if 1 #else, which previously protected
vget() calls using inode numbers to query the root of /coda, which is not
needed since we now cache the root vnode with the mountpoint.
When redrawing an input line, count backspaces to get to the beginning of
the input field from the current cursor location, rather than the end of
the input line, as the cursor may not be at the end of the line.
Otherwise, we may overshoot, overwriting a bit of the previous line and
failing to fully overwrite the current line.
PR: 119079
Submitted by: Michael Plass <[email protected]>
sys/sparc64/sparc64/ata_machdep.c 1.1
The Sun disk label only uses 16-bit fields for cylinders, heads and
sectors so the geometry of large IDE disks has to be adjusted.
Though we are currently not interested in the EDD3 flag,
Enhanced Disk Drive Specification Ver 3.0 defines that the version
of extension in AH would be 30h.
Correct the check for that to be >=30h instead of >3h.
rev. 1.372
Fix indentation (whitespace changes only).
rev. 1.373
Some "cleanup" of tcp_mss():
- Move the assigment of the socket down before we first need it.
No need to do it at the beginning and then drop out the function
by one of the returns before using it 100 lines further down.
- Use t_maxopd which was assigned the "tcp_mssdflt" for the corrrect
AF already instead of another #ifdef ? : #endif block doing the same.
- Remove an unneeded (duplicate) assignment of mss to t_maxseg just before
we possibly change mss and re-do the assignment without using t_maxseg
in between.
Fix bugs when allocating and passing information of current lifetime and
soft lifetime [1] introduced in rev. 1.21 of key.c.
Along with that, fix a related problem in key_debug
printing the correct data.
While there replace a printf by panic in a sanity check.
PR: 120751
Submitted by: Kazuaki ODA (kazuaki aliceblue.jp) [1]
Validate the id16 values gathered from ACPI (previously a TODO
item).
Style changes by me and njl.
Submitted by: Takeharu KATO <takeharu1219 at ybb.ne.jp>
PR: 119350
Log:
- Remove kH and *6 from xterm. They are defined to the same key as @7 (kp_end).
As ncurses has the limitation that it returns the first matched key symbol,
you can not use END in ncurses based program, like mutt, with xterm.
- Add @8 (kp_enter) definition for xterm so you can use ENTER in xterm with
ncurses based program.
I also found that NetBSD's xterm does the same thing.
PR: 100150
Reported by: Arseny Nasokin <tarc at tarc.po.cs.msu.su>
Discussed with: Thomas Dickey, Ulrich Spoerlein <uspoerlein at gmail.com>
Reviewed by: freebsd-arch@
* Avoid re-zeroing memory in calloc() when possible.
* Use pthread mutexes where possible instead of libc "spinlocks", and
actually spin some during contention before blocking.
* Implement dynamic load balancing of thread-->arena mapping.
* Avoid floating point math in order to avoid increased context switch
overhead for applications that otherwise would not use floating point
math.
* Restructure how sbrk() and mmap() are used to acquire memory mappings.
This provides a way to force malloc to only use sbrk(), which can be
useful in the context of resource limits.
* Reduce the number of mmap() calls typically necessary when allocating
a chunk.
* Track dirty unused pages so that they can be purged if they exceed a
threshold.
* Try to realloc() large objects in place.
* Manage page runs with trees instead of chunk maps, which allows
logarithmic-time run allocation.
Make session ID generator to use session ID hash.
Make session ID generator thread-safe.
Use more compact LIST instead of TAILQ for session hash.
Add all listening hooks into LIST to simplify searches.
Use ng_findhook() instead of own equal implementation.
Replace the use of warnx() with direct output to stderr using _write().
This reduces the size of a statically-linked binary by approximately 100KB
in a trivial "return (0)" test application. readelf -S was used to verify
that the .text section was reduced and that using strlen() saved a few
more bytes over using sizeof(). Since the section of code is only called
when environ is corrupt (program bug), I went with fewer bytes over fewer
cycles.
I made minor edits to the submitted patch to make the output resemble
warnx().
src/lib/libc/stdlib/getenv.c: rev 1.12 -> 1.13
Submitted by: kib bz
Approved by: wes (mentor)
Add the -M command-line option, which will set home directory
permissions. Works both in interactive or batch mode. This is
a heavily modified version of the patch submitted in the PR.
PR: bin/105060
date: 2008/02/16 00:16:49; author: delphij; state: Exp; lines: +2 -1
Allow underscore in domain names while resolving. While having underscore
is a violation of RFC 1034 [STD 13], it is accepted by certain name servers
as well as other popular operating systems' resolver library.
Bugs are mine.
Obtained from: ume
Zero sc->vnode if mdsetcred() fails.
This fixes the panic which happens when mdcreate_vnode() calls vn_close()
and mddestroy() calls it again further down the error handling path.
HEAD to RELENG_7:
Further clean up sorflush:
- Expose sbrelease_internal(), a variant of sbrelease() with no
expectations about the validity of locks in the socket buffer.
- Use sbrelease_internel() in sorflush(), and as a result avoid
initializing and destroying a socket buffer lock for the temporary
stack copy of the actual buffer, asb.
- Add a comment indicating why we do what we do, and remove an XXX
since things have gotten less ugly in sorflush() lately.
This makes socket close cleaner, and possibly also marginally faster.
Properly return the error from mls_subject_privileged() in the ifnet
relabel check for MLS rather than returning 0 directly.
This problem didn't result in a vulnerability currently as the central
implementation of ifnet relabeling also checks for UNIX privilege, and
we currently don't guarantee containment for the root user in mac_mls,
but we should be using the MLS definition of privilege as well as the
UNIX definition in anticipation of supporting root containment at some
point.
Submitted by: Zhouyi Zhou <zhouzhouyi at gmail dot com>
Sponsored by: Google SoC 2007
In tcp_ctloutput(), don't hold the inpcb lock over sooptcopyin(), rather,
drop the lock and then re-acquire it, revalidating TCP connection state
assumptions when we do so. This avoids a potential lock order reversal
(and potential deadlock, although none have been reported) due to the
inpcb lock being held over a page fault.
PR: 102752
Reviewed by: bz
Reported by: Václav Haisman <v dot haisman at sh dot cvut dot cz>
Update netisr comment for the SMPng world order: netisr is no longer
implemented using the ISR facility, and cannot be triggered by calling
splnet()/splx().
Linuxulator mmap(2) issue, re(4) data corruption issue, TCP options
issue, page footer in release documentation, wrong KDE version number.
Reviewed by: kensmith
Submitted by: a cast of several
rev. 1.3 of linux_misc.h,
rev. 1.217 of linux_misc.c:
Sanitize arguments to linux_mremap().
Check that only MREMAP_FIXED and MREMAP_MAYMOVE flags are specified.
Check for the page alignment of the addr argument.
Add the groupmod '-d' option to pw to allow the deletion of existing users
from a group without the need to perform the same operation by replacing
the existing list via the '-M' option. The '-M' option requires someone
to fetch the existing members with pw, deleting the undesired members from
the list and sending the altered list back to pw.
src/usr.sbin/pw/pw.c: rev 1.32 -> 1.33
src/usr.sbin/pw/pw_group.c: rev 1.15 -> 1.16
src/usr.sbin/pw/pw.8: rev 1.42 -> 1.43
Approved by: wes (mentor)
in the wrong place, which could cause a incorrect accounting undre
certain error conditions. And worse when we have a duplicate
connect we called TCB_LOCK() not TCB_UNLOCK().... which will
lead to a system lockup (escalting lock wait scenario).
- Add a new 'add-kld <kld>' command to locate a kld and load its symbols.
- If the quiet flag is specified, don't dump the unread portion of the
message buffer on startup.
- Remove the warnx() from kgdb_lookup() and add it in callers where a
failed lookup is warning worthy.
- Add a shared library backend for kernel files that treats klds as shared
libraries and auto-load symbols for klds on startup.
- Build a section table from the kernel file so that 'info files' output
looks sane.
rev 1.597
Give usr.bin/kdump/kdump_subr.c the same treatment as usr.bin/kdump/ioctl.c
and usr.bin/truss/ioctl.c. This is the correct way to address the problem
that arises when doing an incremental build after a header used by kdump
has been removed (cf. i4b disconnect a while ago)
Explained by: ru
MFC after: 2 weeks
rev 1.598
Satisfy a particularly obstinate nit-picker :)
Approved by: imp (mentor, implicit for trivial changes), des
(I am doing several MFC's for him)
rev 1.10
Rewrite to consume significantly less memory, by using find -s instead of
find | sort. As a bonus, this simplifies the logic considerably. Also
remove the bogus "overruning the args to ls" comment and the corresponding
"-n 20" argument to xargs; the whole point with xargs is precisely that it
knows how large the argument list can safely get.
Note that the first run of the updated script may hypotheticall produce
false positives due to differences between find's and sort's sorting
algorithm. I haven't seen this during testing, but others might.
MFC after: 2 weeks
Approved by: imp (mentor, implicit for trivial changes), des
(doing some MFC's for him)
commas due to our deconstruction of the line in cf/feature/dnsbl.m4.
PR: 120038
Submitted by: mattijs vreeling
Revision Changes Path
1.36 +1 -1 src/etc/sendmail/freebsd.mc
MFOpenBSD rev 1.393 pf.conf.5
do not describe `/' as solidus; from Allen (freebsd pr120484);
PR: 120484
Submitted by: Allen <alandsidel at 1001islington dot com>
MFC After: 3 days
src/etc/defaults/rc.conf 1.323
src/etc/rc.firewall 1.54
src/share/man/man5/rc.conf.5 1.333 (by chinsan)
Original log:
Improve kernel NAT support in rc.firewall
- Allow IP in firewall_nat_interface, just like natd_interface
- Allow additional configuration parameters passed to ipfw via
firewall_nat_flags
- Document firewall_nat_* in defaults/rc.conf
Tested by: Albert B. Wang <abwang at gmail.com> MFC after: 1 month
Introduce a new privilege allowing to set certain IP header options
(hop-by-hop, routing headers).
Leave a few comments to be addressed later.
(Note: This does not MFC the use of the privilege, only the definition of
the privilege.)
Fix calculation of descriptor tag checksums. According to ECMA-167, Part 4,
7.2.3, bytes 0-3 and 5-15 are used to calculate the checksum of a descriptor
tag.
Approved by: emax (mentor)
Add privilege PRIV_NNPFS_DEBUG for use with Arla/nnpfs. This privilege
will authorize debugging system calls.
(Slightly sooner than the 1 month MFC time I specified, but it's just a
privilege definition, not a use of the privilege).
date: 2007/10/21 22:50:11; author: rwatson; state: Exp; lines: +1 -0
Add PRIV_VFS_STAT privilege, which will allow overriding policy limits on
the right to stat() a file, such as in mac_bsdextended.
Obtained from: TrustedBSD Project
- Remove duplicate tputs.3 from MLINK. As we use termcap in the bsae, remove
the one links to curs_terminfo.
Submitted by: David Naylor <blackdragon at highveldmail.co.za>
On Montecito processors, the instruction cache is in fact not
coherent with the data caches. Implement a quick fix to allow
us to boot on Montecito, while I'm working on a better fix in
the mean time.
Commit made on Montecito-based Itanium...
Add `hw.ciss.nop_message_heartbeat' tunable (default disabled) for
NOP-message polling in ciss_periodic().
Note that setting the tunable to non-zero can be workaround only for
`ADAPTER HEARTBEAT FAILED' problem, and may freeze the system w/o
the problem.
- Fix a typo in a comment.
- Fix whitespace according to style(9).
- Sync the comment describing why we have to wait in nsphy_reset()
with nsphyter_reset(). It's true that the manual tells to not do a
reset within 500us of applying power but that's unlikely the cause
of problems seen here. Generally having to wait 500us after a reset
however is.
* Formats are now only bid once per file, not once per entry
(Affects archive_read.c, most format readers, internals manpage)
* Correct tar/cpio history in libarchive_formats manpage
* Avoid unnecessary copies in {write,read}_compression_none
(significant performance boost for uncompressed archives!)
* Protect against zero-length writes in gzip/bzip2 compressors
* Tar reader: improve hardlink length heuristics, GNU tar --posix
--sparse support, related fixes to SCHILY.realsize handling
* Cpio reader: recover from sync errors
* Cpio writer: pad symlinks properly in newc format
* Ar writer: close out empty archive correctly
* Zip reader: ignore PK00 header, code cleanups from des@
* Iso9660 reader: support device node entries
* archive_write_disk: support hardlinks with bodies, enforce
maximum file size
* Reconnect progress callback from archive_read_extract()
* New: archive_entry_strmode()
* New: mtree reader
* New: "linkresolver" makes it easier to do hardlink resolution
* UUencode test reference files (be nice to CVS)
* New test: exercise very large entries (2G up to 1T) in tar archives
* New test: Detailed verification of cpio odc and newc formats
* New test: Various strategies for restoring multiple links to a file
* New tests: Various compatibility checks against gzip, zip, old tar, etc.
* New test: cpio recovery from damaged archives
* New test: mtree reading
* Improved statistics reporting from test harness
* Plus minor portability improvements
date: 2008/01/12 00:54:47; author: delphij; state: Exp; lines: +4 -0
Plug memory leaks that is observed when argbuf or argspc is used in the
context.
Submitted by: Michal Vranek <michal.vran
* -l now always has the POSIX behavior (GNU tar recently adjusted their
-l to comply with POSIX, so bsdtar no longer has to guess what the
user really meant).
* More complete COPYING information.
* Various portability fixes and minor configuration changes.
This brings bsdtar into line with -CURRENT, except for one change that
relies on a new libarchive feature that hasn't been MFCed yet.
Add 1000baseTX support for the nve driver, which is known here and there.
Also mention that the driver sometimes returns '10baseTX' as output instead
of 100baseTX (which is the case at that moment).
PR: docs/115284
Submitted by: Julian Stacey Jhs <jhs at berklix dot org>
MFC After: 3 days
Attempt to describe the ''auto'' type a bit better in the default
section (if nothing had been specified, or if the auto type had
been specified, a default layout is used).
PR: docs/116047
Submitted by: Ian Smith <smithi at nimnet dot asn dot au>
Minor modifications by me.
Make the warning a bit less 'broad' then it used to be. The access
is seems to be a problem for SUID applications, which we like to
prevent as much as possible.
PR: docs/39530
Submitted by: Soren Spies <sspies at apple dot com>
MFC After: 3 days
Improve readability for the hosts.equiv file regarding the notation
of hostnames.
PR: docs/35953
Submitted by: "Gary W. Swearingen" <swear at blarg dot net>
With minor modifications by me.
Use nfsrv_destroycache() only once, else it crashes the server.
PR: kern/118152
Submitted by: Bjoern Groenvall <bg at sics dot se>
Approved by: imp (mentor, a while ago already), jhb
MFC After: 3 days
Approved by: imp (mentor, implicit)
- Add extra paths for GEOM_LIBRARY_PATH to the fixit environment to enable all
geom commands in a chrooted environment on the livefs cd.
PR: misc/120169
Approved by: pjd (mentor)
Allow watch(8) to use more than 10 snp* devices. This limitation was purely
due to the way watch(8) looks for available snoop devices.
PR: bin/118286
Submitted by: Mykola Zubach <[email protected]>
Reviewed by: rwatson, csjp, imp (all a long time ago)
Approved by: imp (mentor) (long time ago)
Fix bootparamd on 64 bit platforms - at least amd64 was broken due to the
code believing long == 64 bits and using it to store/compare IPv4 addresses.
PR: bin/112163
Submitted by: Tyler Spivey <[email protected]>
Reviewed by: imp
Approved by: imp (mentor)
bytes >= 0x80 were formatted as 0xff, causing the authentication
to fail.
Note: fast MFC to RELENG_7 and RELENG_7_0 to get the changes in
time for 7.0-RC2.
Approved by: re (kensmith)
Implement stack protection based on GET_STACK_USAGE() macro.
This fixes system panics possible with complicated netgraph setups
and allows to avoid unneded extra queueing for stack unwrapping.
Implement stack protection based on GET_STACK_USAGE() macro.
This fixes system panics possible with complicated netgraph setups
and allows to avoid unneded extra queueing for stack unwrapping.
Enter the sleep state immediately without waiting for timeout if
devd(8) is not running such as the system in single user mode.
Approved by: re (kensmith)
- Avoid data copying when it is possible. bpf_filter() is able to work
directly on mbuf chain
- Prepare hooks direct pointers on setup to avoid heavy ng_findhook() calls
during operarion.
Unbreak detection of cryptodev support for FreeBSD which was broken
with OpenSSL 0.9.8 import.
Note that this does not enable cryptodev by default, as it was the
case with OpenSSL 0.9.7 in FreeBSD base, but this change makes it
possible to enable cryptodev at all.
this copes with the fact that during a fork the child may get
really screwy state in the threading system due to the
sudden vaporisation of it's sibling threads.
down some DCMD's without any data. Thanks to Dell and LSI for helping
to provide clues to figure out this problem. Now MegaCli can upgrade
the firmware and should work identical when run on Linux.
Add device id for 88E8058(Yukon EC Ultra) which is found on 3rd
generation MacBooks.
Unfortunately 88E8058 supports one MSI message so msk(4) needs more
generic way to handle the MSI capability.
PR: 118110
Make phy respond only at address 0. This makes phy driver attached
only at address 0 which is supposed to be the only valid phy address
on Marvell PHY. The more correct solution would be masking PHY
address ranges allowable in PHY probe routine. Unfortunately,
FreeBSD has no way to retrict the PHY address ranges or to pass special
flags to PHY driver.
This change assumes that PHY hardwares attached to msk(4) would be
Marvell made 88E11xx PHY.
With this changes the phantom phys attached on 88E8036(Yukon FE)
should disappear.
o Don't hardcode that Yukon FE has 16KB SRAM. In fact, Yukon FE has
only 4KB SRAM.
o Rework setting Tx/Rx RAM buffer size. Give receiver 2/3 of memory
and round it down to the multiple of 1024. The RAM buffer size of
Yukon II should be multiple of 1024. This fixes bogus RAM buffer
configuration used in Yukon FE.
Drop maintaing hardware feature(bug) lists for Yukon II. We don't have
publicly available datasheet for Yukon II and don't know what
bug/workaround exist for the specific hardware revision. Also I don't
think the vendor will release hardware errata in near future.
The hardware feature lists were not used at all except setting water
mark registers. Since msk(4) should know exact chip model/revision
number to decide which hardware capability could be used the extra
feature lists were redundant.
Various fixes for EC Ultra.
o Enable jumbo frame support for EC Ultra and disable jumbo frame
for FE.
o Enable store and forward mode for standard MTU sized frame.
o Enable TSO for EC Ultra. However TSO/checksum offload is disabled
for jumbo frame case. Because EC Ultra can't use store and forward
mode for jumbo frame TSO/checksum offload is not available.
o Adjust Tx GMAC almost empty threshold value and add a jumbo frame
water mark. The maic value was obtained from Marvell's sk98lin
driver.
o Fix EC Ultra chip revision number.
By definition promiscuous mode should see all unicast frames as well
as multicast/broadcast frames. Previously re(4) ignored multicast
frames in promiscuous mode. The RTL8169 datasheet was not clear
how it handles multicast frames in promiscuous mode.
PR: kern/118572
IEEE 802.3 Annex 28B.3 explicitly specifies the following relative
priorities of the technologies supported by 802.3 Selector Field
value.
1000BASE-T full duplex
1000BASE-T
100BASE-T2 full duplex
100BASE-TX full duplex
100BASE-T2
100BASE-T4
100BASE-TX
10BASE-T full duplex
10BAST-T
However PHY drivers didn't honor the order such that 100BASE-T4 had
higher priority than 100BASE-TX full duplex. Fix that long standing
bugs such that have PHY drivers choose the highest common denominator
ability.
Fix a bug in dcphy which inadvertently aceepts 100BASE-T4.
PR: 92599
sctp_input.c:1.67, sctp_peeloff.c:1.17, sctputil.c:1.73,
socketvar.h:1.161 from HEAD to RELENG_7:
Correct two problems relating to sorflush(), which is called to flush
read socket buffers in shutdown() and close():
- Call socantrcvmore() before sblock() to dislodge any threads that
might be sleeping (potentially indefinitely) while holding sblock(),
such as a thread blocked in recv().
- Flag the sblock() call as non-interruptible so that a signal
delivered to the thread calling sorflush() doesn't cause sblock() to
fail. The sblock() is required to ensure that all other socket
consumer threads have, in fact, left, and do not enter, the socket
buffer until we're done flushin it.
To implement the latter, change the 'flags' argument to sblock() to
accept two flags, SBL_WAIT and SBL_NOINTR, rather than one M_WAITOK
flag. When SBL_NOINTR is set, it forces a non-interruptible sx
acquisition, regardless of the setting of the disposition of SB_NOINTR
on the socket buffer; without this change it would be possible for
another thread to clear SB_NOINTR between when the socket buffer mutex
is released and sblock() is invoked.
Reviewed by: bz, kmacy
Reported by: Jos Backus <jos at catnook dot com>
a socket is closed as it gets auth'd data in. (sctp_auth.c)
- Reverts the priority back to 0, do not change prioritys (sctp_bsd_addr.c)
- Fixes a wrap error in calculation of gap ack segments that
wrap the TSN number. (sctp_indata.c)
- Fixes a comment, and also moves a lock up to cover the pulling
of the VRF from the inp structure. (sctp_pcb.c)
Annotate two possible bugs in a comment: (1) we allocate and explicitly
prepend a data mbuf in front of a header mbuf without moving the header
to the new mbuf, and (2) a possible alignment problem on architectures
with strict alignment as reported in kern/4184.
PR: kern/4184 (1)
Add additional robustness to at_aarpinput() by testing for broadcast
addresses as the source of an AARP request. While this PR was submitted
in the context of work in OpenBSD to port netatalk (in 1997), I've
synchronized the code more to our ARP input routine, which had similar
requirements.
Submitted by: Denton Gentry
PR: kern/4184
> revision 1.7
> date: 2008/01/16 13:54:40; author: remko; state: Exp; lines: +9 -6
> Dont accidentally remove a filesocket which is still in use. This gives
> problems when the DRM driver is loaded and the AIXGL extension is loaded
> , the AIXGL driver requests a drm_close and this will cause the radeon
> driver to fail while starting X windows.
>
> PR: kern/114688
> Submitted by: vehemens <vehemens at verizon dot net>
> Prodded by: Robert Noland
> Approved by: imp (mentor, a while ago already), anholt
1. yar's "dry run" patch to Makefile
2. Add zfs to the list of filesystems to check in
periodic/security/100.chksetuid
3. GC the nfslocking script, which has been superseded by lockd and statd
4. Add security warning to rc.d/jail
5. Add stop_cmd=':' to those rc.d scripts that do not start services,
but did not already have a stop_cmd.
Rev. 1.6 made it impossible to use rc.d/kerberos with the krb5 port.
Re-implement the change so that the script once again works with
the krb5 port.
Submitted by: kensmith (slightly modified)
Hide ipfw internal data structures behind IPFW_INTERNAL rather than
exposing them to all consumers of ip_fw.h. These structures are
used in both ipfw(8) and ipfw(4), but not part of the user<->kernel
interface for other applications to use, rather, shared
implementation.
Reported by: Paul Vixie <paul at vix dot com>
sys/kern/vfs_aio.c; revision 1.237
sys/sys/event.h; revision 1.38
When asked to use kqueue, AIO stores its internal state in the
`kn_sdata' member of the newly registered knote. The problem is that
this member is overwritten by a call to kevent(2) with the EV_ADD flag,
targetted at the same kevent/knote. For instance, a userland application
may set the pointer to NULL, leading to a panic.
A testcase was provided by the submitter.
PR: kern/118911
Submitted by: MOROHOSHI Akihiko <[email protected]>
Fix an error in bit shifting logic for network addresses. The route
command would add incorrect routing entries if network numbers weren't
fully "spelled" out according to their class. For example:
# route add 128.0/16 (works)
# route add 128/16 (doesn't work)
# route add 193.0.0/24 (works)
# route add 193/24 (doesn't work)
Also, rework the way a netmask is deduced from network number if
it [netmask] is not specified.
Submitted by: Nuno Antunes <[email protected]> (mostly)
the rejected mail reports to tally the rejects per blacklist without
providing details about individual sender hosts. The default configuration
keeps the reports in their original form.
In rev. 1.156, the convertion of the minor number to the unit number
resulted in the argument to the make_dev() to be a unit number.
Correct this by supplying a minor number to make_dev(), and using
the unit number for the calculation of the slave tty name.
- Follow POSIX specification when moving a directory to an existing
directory across devices.
- Improve consistency and remove some style bugs of earlier versions.
This version passes all tests of tools/regression/bin/mv/regress.sh 1.6
PR: bin/118367
Add support for optional "AC-Name\Service-Name" syntax at NGM_PPPOE_CONNECT
argument. It allows ppp, mpd or any other node consumer to request
connection to specified access concentrator.
Proposed by: Alexander A. Burylov <[email protected]>
Remove ng_pppoe_sendpacket() function to simplify code as it is called
as much times as it has cases inside of it.
Split ng_pppoe_rcvdata() function into three hook-specific ones
to simplify code and reduce stack usage.
date: 2008/01/12 00:11:26; author: delphij; state: Exp; lines: +4 -4
- Handle the case where interface from "middle" is missing by
more carefully inspecting the return value from sysctl(3). [1]
- Use calloc instead of malloc+memset of zero.
Submitted by: Alexander Chernikov <admin su29 net> [1]
PR: bin/119581
MFC after: 2 weeks
----------------------------------------------------------------------------
Instead of manually freeing the packet options structure (and not even doing
a good job of it) in the copypktopts() function, just call ip6_clearpktopts()
directly. Otherwise, the callers of this function would end up freeing the
memory twice.
Reviewed by: jinmei
PR: kern/116360
----------------------------------------------------------------------------
udf_vget() shall vgone() the vnode when the file_entry cannot be allocated
or read from the volume. Otherwise, half-constructed vnode could be found
later and cause panic when accessed.
PR: 118322
tcp_usrreq.c:1.313 removed tcbinfo locking from tcp_usr_accept(), which
while in principle a good idea, opened us up to a race inherrent to
the syncache's direct insertion of incoming TCP connections into the
"completed connection" listen queue, as it transpires that the socket
is inserted before the inpcb is fully filled in by syncache_expand().
The bug manifested with the occasional returning of 0.0.0.0:0 in the
address returned by the accept() system call, which occurred if accept
managed to execute tcp_usr_accept() before syncache_expand() had copied
the endpoint addresses into inpcb connection state.
Re-add tcbinfo locking around the address copyout, which has the effect
of delaying the copy until syncache_expand() has finished running, as
it is run while the tcbinfo lock is held. This is undesirable in that
it increases contention on tcbinfo further, but a more significant
change will be required to how the syncache inserts new sockets in
order to fix this and keep more granular locking here. In particular,
either more state needs to be passed into sonewconn() so that
pru_attach() can fill in the fields *before* the socket is inserted, or
the socket needs to be inserted in the incomplete connection queue
until it is actually ready to be used.
Reported by: glebius (and kris)
Tested by: glebius
Approved: re (kensmith)
Add fsck_4.2bsd and fsck_ufs as hard links to fsck_ffs in /stand on
the MFS image so that (for example) "fsck /dev/ad0s1a" will work.
Without this you needed (for example) "fsck -t ffs /dev/ad0s1a" (or
needed to run fsck_ffs instead of fsck).
Versions being MFCed:
1.62 src/release/amd64/boot_crunch.conf
1.62 src/release/i386/boot_crunch.conf
1.12 src/release/ia64/boot_crunch.conf
1.63 src/release/pc98/boot_crunch.conf
1.5 src/release/powerpc/boot_crunch.conf
1.9 src/release/sparc64/boot_crunch.conf
1.2 src/release/sun4v/boot_crunch.conf
Move unlock of global UNIX domain socket lock slightly lower in
unp_connect(): it is expected to return with the lock held, and two
possible error paths otherwise returned with it unlocked.
The fix committed here is slightly different from the patch in the
PR, but along an alternative line suggested in the PR.
PR: 119778
Submitted by: James Juran <james dot juran at baesystems dot com>
Approved by: re (gnn)
coda_vnops.c:1.79:
Borrow the VM object associated with an underlying cache vnode with the
Coda vnode derived from it, in the style of nullfs. This allows files
in the Coda file system to be memory-mapped, such as with execve(2) or
mmap(2).
Reported by: Rune <u+openafsdev-sr55 at chalmers dot se>
coda_vnops.c:1.80:
Lock the new directory vnode returned by coda_mkdir(), as this is required
by FreeBSD's vnode locking protocol.
coda_vnops.c:1.81:
Use VOP_NULL rather than VOP_PANIC for Coda's vop_print routine, so as
to avoid panicking in DDB show lockedvnods.
cnode.h:1.22, coda_namecache.h:1.12, coda_psdev.c:1.40, coda_vfsops.c:1.70:
Don't declare functions as extern.
Move all extern variable definitions to associated .h files, move some
extern variable definitions between include files to place them more
appropriately.
coda_vnops.c:1.82:
Don't acquire an additional vnode reference to a vnode when it is opened
and then release it when it is closed: we rely on the caller to keep the
vnode around with a valid reference. This avoids vrele() destroying the
vnode vop_close() is being called from during a call to vop_close(), and
a crash due to lockmgr recursing the vnode lock when a Coda unmount
occurs.
coda_vfsops.c:1.71:
Zero mi_rotovp and coda_ctlvp immediately after calling vrele() on the
vnodes during coda_unmount() in order to detect errant use of them
after the vnode references may no longer be valid.
No need to clear the VV_ROOT flag on mi_rootvp flag (especially after
the vnode reference is no longer valid) as this isn't done on other
file systems.
coda_vfsops.c:
Rework coda_statfs(): no longer need to zero the statfs structure or
fill out all fields, just fill out the ones the file system knows
about. Among other things, this causes the outpuf of "mount" and
"df" to make quite a bit more sense as /dev/cfs0 is specified as the
mountfrom name.
coda_vnops.c:1.83:
Improve default vnode operation handling for Coda:
- Don't specify vnode operations for mknod, lease, and advlock--let them
fall through to vop_default.
- Implement vop_default with &default_vnodeops, rather than with
VOP_PANIC, so that unimplemented vnode operations are handled in more
sensible ways than panicking, such as EOPNOTSUPP on ACL queries
generated by bsdtar, or mknod.
coda_namecache.h:1.13:
Remove unused oldhash definition from Coda namecache.
coda_vnops.c:1.84:
Replace references to VOP_LOCK() w/o LK_RETRY to vn_lock() with LK_RETRY,
avoiding extra error handling, or in some cases, missing error handling.
Discussed with: kib
coda_vnops.c:1.85:
Put "coda_rdwr: Internally Opening" printf generated by in-kernel writes
to files, such as ktrace output, under CODA_VERBOSE. Otherwise, each
such call to VOP_WRITE() results in a kernel printf.
Obtained from: NetBSD
In the rev. 1.153, the one place for converting minor number to unit
was missed. As result, pty_create_slave() may index out of the names[]
bounds, creating wrong slave tty names.
ffs_balloc_ufsX() routines, in the case of recovering from the failed
allocation, free the indirect blocks before clearing the disk pointers,
that could lead to the softupdate inconsistencies in the case of the
machine or disk crash at the wrong time.
Rearrange the recover code to do the ffs_blkfree() after the second
ffs_syncvnode(), that clears the pointers chain.
The ffs_balloc() routines, whan allocating the indirect blocks for
the inode, do the rollback in case the allocation failed (due to
insufficient free space or quota limits). But, the code does leaves the
buffers corresponding to the inoirect blocks on the vnode bufobj list.
This causes several assertion failures (for instance, "ffs_truncate3"
in ffs_truncate()) to fail, and could result in the indirect block
aliasing problem, like writing the context of such blocks to random
disk location.
Remove the buffers from the bufobj properly.
silent NULL pointer dereference in the i386 and sparc64 pmap_pinit()
when the kmem_alloc_nofault() failed to allocate address space. Both
functions now return error instead of panicing or dereferencing NULL.
The reason for MFCing this so late in release cycle is, according to
marius@, because
> it fixes the crashing (though no panic) of the test suite
> of the graphic/OpenEXR port on sparc64. This test suite is run
> (and required to succeed) during the package build and that's
> why portmgr@ bitch about at it as OpenEXR is a dependency of KDE
> which in turn is supposed to end up on the release CD images.
Revisions MFCed:
1.677 of src/sys/amd64/amd64/machdep.c
1.592 of src/sys/amd64/amd64/pmap.c
1.88 of src/sys/arm/arm/pmap.c
1.27 of src/sys/arm/at91/kb920x_machdep.c
1.22 of src/sys/arm/sa11x0/assabet_machdep.c
1.8 of src/sys/arm/xscale/i80321/ep80219_machdep.c
1.29 of src/sys/arm/xscale/i80321/iq31244_machdep.c
1.3 of src/sys/arm/xscale/i8134x/crb_machdep.c
1.6 of src/sys/arm/xscale/ixp425/avila_machdep.c
1.41 of src/sys/compat/pecoff/imgact_pecoff.c
1.26 of src/sys/compat/svr4/imgact_svr4.c
1.660 of src/sys/i386/i386/machdep.c
1.596 of src/sys/i386/i386/pmap.c
1.68 of src/sys/i386/ibcs2/imgact_coff.c
1.56 of src/sys/i386/linux/imgact_linux.c
1.226 of src/sys/ia64/ia64/machdep.c
1.192 of src/sys/ia64/ia64/pmap.c
1.102 of src/sys/kern/imgact_aout.c
1.179 of src/sys/kern/imgact_elf.c
1.56 of src/sys/kern/imgact_gzip.c
1.310 of src/sys/kern/kern_exec.c
1.287 of src/sys/kern/kern_fork.c
1.236 of src/sys/kern/kern_kse.c
1.253 of src/sys/kern/kern_proc.c
1.352 of src/sys/kern/kern_sig.c
1.63 of src/sys/kern/kern_thr.c
1.257 of src/sys/kern/kern_thread.c
1.397 of src/sys/pc98/pc98/machdep.c
1.104 of src/sys/powerpc/powerpc/machdep.c
1.10 of src/sys/powerpc/powerpc/pmap_dispatch.c
1.139 of src/sys/sparc64/sparc64/machdep.c
1.167 of src/sys/sparc64/sparc64/pmap.c
1.16 of src/sys/sun4v/sun4v/machdep.c
1.40 of src/sys/sun4v/sun4v/pmap.c
1.493 of src/sys/sys/proc.h
1.78 of src/sys/sys/signalvar.h
1.80 of src/sys/vm/pmap.h
1.79 of src/sys/vm/vm_extern.h
1.226 of src/sys/vm/vm_glue.c
1.390 of src/sys/vm/vm_map.c
Requested by: marius
Tested by: Peter Holm, marius (make universe and sparc64 runs)
Approved by: re (kensmith)
Fix unload of the fdc.ko:
Wakeup the thread doing the fdc_detach() when the fdc worker thread exits.
Write access to the write-protected floppy shall call device_unbusy() to
pair the device_busy() in the fd_access().
Call zil_commit() (if ZIL is not disabled) after every non-read request
(BIO_WRITE and BIO_FLUSH) as it is done is Solaris. The difference is
that Solaris calls it only for sync requests, but we can't say in GEOM
if the request is sync or async, so we do it for every request.
Approved by: re (gnn)
This fixes replacing drive in place, eg. zpool replace tank da1 da1.
Before the fix, it complained that device is already open.
Obtained from: OpenSolaris
Approved by: re (gnn)
When one tries to allocate memory with the M_WAITOK flag and we are short in
address space in kmem map call vm_lowmem event in a loop and wait a bit for
subsystems to reclaim some memory which in turn will reclaim address space as
well.
Note, this is a work-around.
Reviewed by: alc
Approved by: alc, re (gnn)
- In vfs_scanopt(), make sure that the mount option value is not NULL
before calling vsscanf().
PR: 118531
MFC: 1.268
- Internally convert "rdonly" mount option to "ro".
Approved by: re (kensmith)
Back when I committed the arm port, I've been asked to move
memcpy/memset/memcmp and friends from libkern/arm to arm/arm/support.S, and so
I did, but in the process, I didn't add the appropriate copyrights.
This is a major oversight from me, and I apology to the NetBSD people for it.
Approved by: re (mux)
> Change sysinstall's handling of X11 stuff. Doing it in pieces was
> probably the right thing to do a while ago but xorg has progressed
> to the point that for novice users (who are the ones expected to think
> installing X11 during an install...) it's best to just install the
> whole x11/xorg metaport for them. This removes the X11 sub-menus
> and sets it up so you just select whether or not you want X11. While
> here garbage collect an X11 configuration menu I missed removing when
> I removed support for attempting xorg configuration from inside sysinstall
> a while ago.
Approved by: re (hrs)
Fix some bugs in the FreeBSD 4/5/6 pci(4) IOCTLs compatibility code:
- Use the correct offsets when copying out the results of PCIOCGETCONF_OLD.
This happened to not affect the 64-bit architectures because there the
addition of pc_domain to struct pcisel didn't change the overall size of
struct pci_conf.
- Always copy the name and unit information to conf_old so it's also part
of the output once this information is cached in dinfo.
- Use the correct type for flags in struct pci_match_conf_old. This
change is more or less cosmetic though.
Approved by: re (gnn)
Increase control channel xmit queue to 128 packets.
Previous value 16 was too small for real LAC as temporal activity
spike cound easily overflow queue demanding tunnel disconnection due
to possible state inconsistency.
Approved by: re (gnn)
Add a workaround for a deadlock between the rt_setgate() and rt_check()
functions. It is easily triggered by running routed, and, I expect, by
running any other daemon that uses routing sockets.
Approved by: re (kensmith)
Implement a workaround of the datacorruption problem on ServerWorks
HT1000 chipsets. The HT1000 DMA engine seems to not always like 64K
transfers and sometimes barfs data all over memory leading to instant
chrash and burn.
Also fix 48bit adressing issues, apparently newer chips needs 16bit
writes and not the usual fifo thing.
HW donated by: Travis Mikalson at TerraNovaNet
Original work: sos
Approved by: re (kensmith)
order to determine whether a program is running with multithreading
support. This check causes __gthread_active_p() to always return 1
however, regardless of whether the program was actually compiled with
-pthread or not, due to the fact that the FreeBSD libc contains a
pthread_cancel() stub. Fix this by using the __gthread_active_p()
version that GCC uses for Solaris and which actively checks for a
working POSIX threads implementation (if such functions exist) instead
of checking for the mere existence of corresponding functions.
On platforms without TLS support, i.e. on arm and sparc64 due to the
lack of GNU TLS support for these archs in binutils 2.15., the false
positives returned by __gthread_active_p() for non-threaded programs
cause the exception handling implementation GCC uses in this case to
crash. This is because GCC assumes that the POSIX threading functions
actually work when __gthread_active_p() returns 1 while in fact the
corresponding stubs in libc just immediately return.
Given that __gthread_active_p() is also used in a couple of other
places besides exception handling, this bug has great potential to
also cause problems in other areas and on all archs.
This is committed to RELENG_7 directly in order to get a fix into
RELENG_7_0 as soon as possible while allowing to loop the official
fix back into the vendor branch and not taking gthr-posix.h off the
vendor branch in HEAD.
PR: 119289
Reviewed by: obrien (plus style fix)
Approved by: re (kensmith)
r1.62:
- Document icase variable of make search, which can be used to control
case-sensitivity
r1.63:
- Document PORT_DBDIR
r1.64:
- Remove incomplete sentence fragment
Approved by: re (hrs)
Do not allow the SNPSTTY ioctl for the snoop device that has a tty
attached. Otherwise, the snp->snp_tty would be overwritten, while the
tty line discipline still set to the snpdisc. Then snplwrite() causes
panic because ttytosnp() cannot find the snp. (And do it at the proper
place, from rev. 1.107).
MFC rev. 1.107:
The snp_target == NULL implies the snp_tty == NULL. Remove the code
that is put under snp_target == NULL and snp_tty != NULL clause.
In snpclose(), do the snp_detach() before scheduling the snp device
destruction. Otherwise, after the return from snpclose(), the snp
device is already removed from the snp_list, but tty is still in
snooped state. Any attempt to do i/o on such tty cause panic because
ttytosnp() returns NULL.
Approved by: re (kensmith)
Fix a panic where if the mbuf was consumed by the filter for requeueing
(dummynet), ipsec_filter() would return the empty error code and the ipsec
code would continue to forward/deference the null mbuf.
Approved by: re (gnn)
> Plug a memory leak. Once any given package (e.g. perl) was installed
> we would leak a saved screen for every other package we tried to install
> that listed perl as one of its dependencies. When installing things
> like gnome and kde that wound up being a LOT of leaked memory.
Approved by: re (bmah)
Remove process limits for datasize and stacksize which are unlimited
during a "normal login" (thanks to /etc/login.conf) but not when
sysinstall is running as part of an installation. Fixups for error
messages and a comment that became untrue.
Approved by: re (bmah)
> For the INDEX file to be used on disc1 of the 7.0-RELEASE the longest
> "build dependencies" field is 5,108 characters which overflows the
> length of the junk buffer by a teeny bit. This whole section needs
> much more error checking but for now just completely ignore stuff
> we have no interest in instead of copying it to someplace we don't
> use in the process.
Approved by: re (bmah)
In openprom_ioctl() ensure appropriate permissions and that data isn't
NULL and doesn't point to a NULL pointer before dereferencing it.
Approved by: re (kensmith)
When IPSEC fails to allocate policy state for an inpcb, and MAC is in use,
free the MAC label on the inpcb before freeing the inpcb.
Submitted by: tanyong <tanyong at ercist dot iscas dot ac dot cn>,
zhouzhouyi
Approved by: re (kensmith)
> Add support for disc3. Depending on architecture the combination of
> kde3 and gnome2 is at least 670Mb which would mean if we stick with
> just disc1/disc2 the only packages we could provide on the iso's
> would be X11, kde3, and gnome2...
Approved by: re (rwatson)
> A few more adjustments needed because of changes in xorg. Just installing
> xorg-server doesn't include any video drivers so install xorg-drivers as
> well. And if font-alias isn't installed the X server won't start,
> complaining it can't find the font "fixed".
Approved by: re (rwatson)
Fix a MAC label leak for POSIX semaphores, in which per-policy labels
would be properly disposed of, but the global label structure for the
semaphore wouldn't be freed.
Reported by: tanyong <tanyong at ercist dot iscas dot ac dot cn>,
zhouzhouyi
Approved by: re (kensmith)
Fix leaking MAC labels for IPv6 inpcbs by adding missing MAC label
destroy call; this transpired because the inpcb alloc path for IPv4/IPv6
is the same code, but IPv6 has a separate free path. The results was
that as new IPv6 TCP connections were created, kernel memory would
gradually leak.
Reported by: tanyong <tanyong at ercist dot iscas dot ac dot cn>,
zhouzhouyi
Approved by: re (kensmith)
- Use the macro to check the port status has it will also test if its
administratively down (!IFF_UP)
- Use the same parameters to lagg_link_active() to get the backup port as in
the output path, this didnt actually matter in practice as sc_primary is
always the first on the port list.
Approved by: re (kensmith)
When the bridge has an address and a packet comes in for it then drop it if
the link has been marked discarding by Spanning Tree.
Approved by: re (kensmith)
Disallow the legacy USB circuit to generate an SMI# via an ICH
register (MacBooks only).
This allows MacBooks to boot in SMP mode without any trick and
solves
the timer problems with HZ=1000.
Approved by: re (kensmith), njl (mentor)
Disallow the legacy USB circuit to generate an SMI# via an ICH
register (MacBooks only).
This allows MacBooks to boot in SMP mode without any trick and solves
the timer problems with HZ=1000.
Approved by: re (kensmith), njl (mentor)
4k/9k and 16k clusters, the old sysctl's were just empty
things that just set delusional numbers that had no effect :-(
- Add an initial limit each to be 1/2 of the previous value starting
at 2k.. i.e. limit for 4k = 1/2 of 2k, limit for 9k = 1/2 4k etc.
Reviewed by: [email protected]
Approved by: [email protected] (gnn)
date: 2007/11/03 17:33:41; author: scottl; state: Exp; lines: +2 -1
Ever since the module registration system was introduced to this driver,
it's been printing out scary messages about "Unhanded Event Notify Frame"
that are needlessly worrisome to users. Change this warning to only print
out at an elevated debugging level.
Approved by: re (kensmith)
Limit total hardware playback channels to just 1. The reliability of
it's multi DAC / playback channels is not that good. Enabling vchans
make the bug more visible since playback allocation will look for
possible free hardware channels first (i.e: the next DAC, the very first
has been consumed by vchan mixer) which in this case has been proven faulty.
Tested by: Dominic Fandrey <LoN_Kamikaze at gmx dot de>
URL: http://lists.freebsd.org/pipermail/freebsd-stable/2007-December/039022.html
Approved by: re (kensmith)
Disable AC97 microphone channel. Due to the channel allocation priority
that favours true hardware channel, the first instance of recording
request will grab this channel (the first channel is being used as
vchan master). In many cases, it is not really work as intended and give
false impression of broken recording.
PR: kern/118546
Approved by: re (kensmith)
- nid 28 for Acer @ ALC268 should be identified as analog CD input pin,
though it doesn't provides proper (sane, valid, usable, etc) analog CD
playback due to its stripped down nature.
- Add speaker/headphone controls for HP Compaq DC7700 Small Form Factor PC
@ ALC262. [1]
Submitted by: [1] Carlos A. M. dos Santos <unixmania at gmail dot com>
Approved by: re (kensmith)
Eliminate compilation warnings due to the use of non-static inlines
through the introduction and use of the __gnu89_inline attribute.
Approved by: re (kensmith)
Use curthread instead of the FIRST_THREAD_IN_PROC for vnlru and syncer,
when applicable.
Aquire Giant slightly later for vnlru.
In the syncer, aquire the Giant only when a vnode belongs to the
non-MPsafe fs.
In both speedup_syncer() and syncer_shutdown(), remove the syncer thread from
the lbolt sleep queue after the syncer state is modified, not before.
Approved by: re (kensmith)
aac.c:1.124
aacvar.h:1.49
Allow simultaneous opens of the device for issuing commands to the
controller. This is merged from Adaptec driver build 11669.
aac.c:1.125
aac_pci.c:1.66
aacreg.h:1.24
Add family support to allow the driver to attach to new devices that
share the same interface.
aac_cam.c:1.30
Merge from Adaptec a 64 bit fix and a workaround for luns != 0
returning CAM_SEL_TIMEOUT on SAS controllers, which prevented
passthrough devices from being created.
Approved by: re (kensmith)
Teach dhclient(8) about net80211 link (association) status.
Especially it helps ndis(4) where it is used with wpa_supplicant(8)
since 0.5.8 is imported. Previously ndis_events(8) was used to notify
link status to wpa_supplicant but it is defuct now, i. e., external event
notification mechanism is removed by the vendor and there is no substitute
for ndisulator yet.
Reviewed by: brooks
OK'd by: sam
Approved by: re (kensmith)
sending, once the locks are all unlocked to
do the copy's in, its possible that other
events could then raise the number of bytes
outstanding pushing it so not all the message
would fit. This would then cause us to send
only part of the message. This fix makes it
so we keep a "reserved" amount that can be
kept in mind when making calculations to send.
- rcv msg args with a NULL/NULL for to/tolen will return
an error incorrectly for the 1-2-1 model.
- We were not doing 0 len return correctly and not
setting socantrcv() more correctly. Previouly we "fixed"
this area by taking out the socantrcv()
since we then could not get the data out. The correct fix
is to still flag the socket but alow a by-pass route to
continue to read until all data is consumed.
- Fix the initial buf calculation to be more friendly, calc is
the same but we use different variable to make it easier
amongst the different code versions.
- Signedness issue with one of the new var's (this is an issue
mainly in apple but with the right -Wall it could effect us too).
- optimize the initialization of the SB max variables.
- Missing lock(s) when sending data and moving it to the
outqueue.
- If a mbuf alloc fails during moving to outqueue the
reassembly of the old mbuf chain was incorrect.
- some_taken becomes a counter in sctputil.c instead of a set to 1.
- Fix a panic to be only under invarients and have a proper recovery
in reading messages.
- msg_flags needed to be set to the value collected not or'd.
- More fixes for lock misses on the transfer of data to
the sent_queue. Sometimes I wonder why any code
ever works :-)
- Fix the pad of the last mbuf routine, It was working improperly
on non-4 byte aligned chunks which could cause memory overruns.
Approved by: [email protected](gnn)
* Add preliminary SATA ATAPI support for sii 3132/3124 chips.
* Fix speed report on Intel SATA chips in compat mode.
* Fix broken detect of JMicron 368.
Related revisions:
- ata-chipset.c: 1.208, 1.210
- ata-disk.c.c: 1.205
Approved by: re (kensmith), sos
MFC rev 1.2 if_wpireg.h
MFC rev 1.1 if_wpivar.h
MFC rev 1.3 wpi.4
o Initial Import of Intel 3945abg Wireless Lan Controller (wpi) driver
o Turn off debug output
o Fix WEP compatiblity
o Handle missed beacons correctly
MFC includes firmware & LICENSE as well.
Approved by: re (kensmith), mlaier (comentor)
Correct an error under COUNT_IPIS within pmap_lazyfix_action(): Increment
the counter that the pointer refers to, not the pointer.
Approved by: re (kensmith)
Fix a potential bug in pmap :
We used to allocate the domains 0-14 for userland, and leave the domain 15
for the kernel. Now supersections requires the use of domain 0, so we
switched the kernel domain to 0, and use 1-15 for userland.
How it's done currently, the kernel domain could be allocated for a
userland process.
So switch back to the previous way we did things, set the first available
domain to 0, and just add 1 to get the real domain number in the struct pmap.
Reported by: Mark Tinguely <tinguely AT casselton DOT net>
Approved by: re (kensmith)
sys/arm/include/asmacros.h rev 1.7
sys/arm/include/atomic.h rev 1.23
Close a race.
The RAS implementation would set the end address, then the start
address. These were used by the kernel to restart a RAS sequence if
it was interrupted. When the thread switching code ran, it would
check these values and adjust the PC and clear them if it did.
However, there's a small flaw in this scheme. Thread T1, sets the end
address and gets preempted. Thread T2 runs and also does a RAS
operation. This resets end to zero. Thread T1 now runs again and
sets start and then begins the RAS sequence, but is preempted before
the RAS sequence executes its last instruction. The kernel code that
would ordinarily restart the RAS sequence doesn't because the PC isn't
between start and 0, so the PC isn't set to the start of the sequence.
So when T1 is resumed again, it is at the wrong location for RAS to
produce the correct results. This causes the wrong results for the
atomic sequence.
The window for the first race is 3 instructions. The window for the
second race is 5-10 instructions depending on the atomic operation.
This makes this failure fairly rare and hard to reproduce.
Mutexs are implemented in libthr using atomic operations. When the
above race would occur, a lock could get stuck locked, causing many
downstream problems, as you might expect.
Also, make sure to reset the start and end address when doing a syscall, or
a malicious process could set them before doing a syscall.
Reviewed by: imp, ups (thanks guys)
Approved by: re (kensmith)
Pointy hat to: cognet
date: 2007/11/26 19:08:08; author: sos; state: Exp; lines: +1 -1
Use device_set_desc_copy in the generic ident as its used on a temp buffer.
Approved by: re (kensmith)
zic(8) should exit the loop when the end of the string is reached
due to the call to error(). The problem found by doing fuzz testing.
Approved by: re (kensmith)
To reduce the impact of possible removal of the syscalls required by
libkse in FreeBSD 8.0, do not build or install static versions of libkse
(i.e. libkse*.a) in the default case. Static versions will be built and
installed if libthr is not built or if libkse is the default threading
library.
Discussed on: freebsd-arch
Approved by: re (kensmith)
rev 1.323 of src/sys/amd64/amd64/trap.c
rev 1.310 of src/sys/i386/i386/trap.c
Fix the ABI change of the signal delivered on the access to the page
with insufficient protection mode.
Approved by: re (kensmith)
rev 1.182 of src/sys/kern/imgact_elf.c
rev 1.288 of src/sys/kern/init_main.c
rev 1.312 of src/sys/kern/kern_exec.c
rev 1.85 of src/sys/kern/kern_mib.c
rev 1.496 of src/sys/sys/proc.h
rev 1.262 of src/sys/sys/systm.h
Implement fetching of the __FreeBSD_version from the ELF ABI-tag note.
The value is read into the p_osrel member of the struct proc. p_osrel
is set to 0 for the binaries without the note.
Approved by: re (kensmith)
Check for the program headers alignment of the ELF images before
dereferencing. Unaligned access could cause panic on strict alignment
architectures.
Approved by: re (kensmith)
principle, the current devfs-based cloning facilit makes the current
user<->kernel protocol for allocating new pts nodes difficult or
impossible to do without leading to resource leaks or race conditions.
We tentatively plan to reintroduce ptmx/pts support in FreeBSD 7.1 once
a fixed version has settled out in HEAD. People who really want to run
with the current code can re-enable it but it will require tweaking
conf files and unifdef'ing it. By removing it now before the release,
we avoid having to support the current allocation protocol in future
releases in order to provide backwards compatibility with older libc's.
Discussed with: cognet, erwin
Approved by: re (kensmith)
Plug two potential (root-only, local) information leaks. buf is not
initialized before use and returned integrally instead of up to size.
Submitted by: Ilja van Sprundel <ilja -at- netric.org>
Reviewed by: secteam
Approved by: re (kensmith)
Plug two potential (root-only, local) information leaks. buf is not
initialized before use and returned integrally instead of up to size.
Submitted by: Ilja van Sprundel <ilja -at- netric.org>
Reviewed by: secteam
Approved by: re (kensmith)
Always honor promiscuous flag prior to programming Rx multicast
filter. This fixes a regression introduced in rev 1.89.
PR: 114632
Approved by: re (kensmith)
Apparently some NVIDIA NICs store ethernet address in reverse order
while other variants have inorder ethernet address for the same
chipset. Override ethernet address ordering if we already know how
it was stored. This fixes the use of inversed ethernet address on
MCP67.
Approved by: re (kensmith)
Make TSO work with IPSEC compiled into the kernel.
The lookup hurts a bit for connections but had been there anyway
if IPSEC was compiled in. So moving the lookup up a bit gives us
TSO support at not extra cost.
Approved by: re (kensmith)
sys/sparc64/pci/psycho.c 1.71, 1.72;
sys/sparc64/pci/psychovar.h 1.17
- Add the PCI side of the HOST-PCI bridge itself to the bus. This
is required by the X.Org PCI domains code and additionally needs
a workaround for Hummingbird and Sabre bridges as these don't
allow their config headers to be read at any width, which is an
unusual behavior.
- In psycho(4) take advantage of DEFINE_CLASS_0 and use more
appropriate types for some softc members.
Approved by: re (kensmith)
"Revert revision 1.4.
Intel CPUs with family 0x6, model 0xE and later (i.e., Intel Core(TM))
have a PMC architecture that differs somewhat from previous CPUs in
family 0x6. Even though the basic programming model is similar, the
documented set of legal values that may be loaded into their PMC MSRs
differs from that of the previous PMCs in family 0x6 and reusing bit
values legal for the older PMCs could result in undefined behaviour in
the general case."
Approved by: re (gnn)
arm/at91/kb920x_machdep.c rev 1.24, 1.25 and 1.26
arm/at91/std.at91 rev 1.4
arm/at91/std.kb920x rev 1.5
arm/at91/at91rm92reg.h rev 1.6
conf/options.arm 1.18
Small tweaks to be able to load the kernel at a different address than
0x20000000 + add an option to override the default value of the master clock
frequency.
arm/at91/if_ate.c rev 1.21:
In ate_get_mac(), try to get the mac address in the right order, at least
in the same order as it's set in ate_set_mac.
arm/conf/HL200: config file for the Hot-e HL200
Approved by: re (kensmith)
Let opt be an array. Though &opt[0] == opt == &opt, &opt is highly
confusing and hard to understand so change it to just opt and
remove the extra cast no longer/not needed.
Approved by: re (kensmith)
Expand the EXAMPLES section for atacontrol.8
PR: docs/117310
Submitted by: Ted Mittelstaedt <tedm at ipinc dot net>
with minor modifications by me.
Approved by: re (hrs)
Remove mentionings of kern.dumpdev which is no longer available.
PR: docs/113570
Submitted by: lawrance
MFC After: 3 days (where applicable)
Approved by: re (hrs)
Sync with md(4)'s information regarding the swap backend.
PR: docs/115721
Submitted by: Stefan Lambrev <[email protected]>
MFC After: 3 days
Every newline should start on it's own line. I didn't do that in the
previous commit, so make it happen now.
Prodded by: brueffer
Approved by: re (hrs)
The nfe driver will first appear in 7.0 and not in 6.x
PR: i386/118264
Submitted by: "Julian H. Stacey" <jhs at berklix dot org>
Nod from: yongari
Approved by: re (hrs)
Add information about the ICH6 and ICH7 being supported since recently.
MFC rev 1.20 ichsmb_pci.c
Add the Intel 82801FB (ICH6) SMBus controller and the
Intel 82801GB (ICH7) SMBus controller.
PR: 85106 [1]
PR: 99663 [2]
Approved by: imp (mentor), jhb
Submitted by: Oliver Fromme <olli at lurza.secnetix dot de>, [1]
Arthur Hartwig <arthur dot hartwig at nokia dot com>, [1]
Lowell Gilbert <lgfbsd at be-well dot ilk dot org> [2]@
MFC After: 3 days
Approved by: re (hrs), imp (mentor, implicit)
Add information about the 845M card that I recently committed support
for.
MFC rev 1.44 agp_i810.c
Add the 845M GMCH controller.
PR: 114802
Approved by: imp (mentor), anholt (private mail)
Submitted by: Alex Goncharov <algo1 at comcast dot net>
MFC After: 3 days
Approved by: re (hrs), imp (mentor, implicit)
Simplify adaptive spinning algorithm which should make things faster
when sleeping / waking up waiters.
Also fix a bug with rw_try_upgrade() when adaptive spinning is enabled
as turnstile_lookup() will recurse on ts_lock that will never be
released [1].
[1] Reported by: jeff with Nokia help
Tested by: pho, kris (earlier, bugged version of rwlock part)
Discussed with: jhb, jeff
Approved by: re
Fix 3 issues relating to the use of "auth" rules in IPFilter, from sourceforge:
1837014 Kernel panics after authentication of an outgoing packet
1836992 Potential bugs in packet auth code (w/patches)
1836967 Kernel panic when using auth rule with keep state
and another reported only to FreeBSD by Andiry (see PR)
PR: kern/118251
Submitted by: Andriy Syrovenko <[email protected]>
Reviewed by: darrenr
Approved by: re
- Remove magic number and fit max rx buffer size accurately.
- Patch registers CR47 and CR157 on devices that require it.
- Fix power calibration setting on ZD1211B.
Obtained from: OpenBSD
- Fix multicast transfer by properly reprogram multicast global
hash table, which in turns fix promiscuous mode and IPv6
autoconfiguration / local networking.
Reviewed by: sam, Weongyo Jeong
Tested using: Aztech WL230 , Belkin F5D7050, Unicorn WL-54G,
3COM 3CRUSB10075
Approved by: re (kensmith)
- Add missing MCP65 id which was accidentally removed in previous commit.
- Add Analog Devices AD1984 codec id.
- Enable pcbeep control for Acer + ALC268 (nid 29). Give enough (fake)
hints so the parser will grab it and allocate "speaker" control.
- Fix regression while preparing DAC and ADC for multichannel
format. Since playback policy is to output to every possible path,
ensure that each DAC is started.
Reported / Tested by: Guy Brand
Approved by: re (kensmith)
other routing daemons still rely on this interface and otherwise do not
function on 7.0. It has not been restored to 8-CURRENT, so this is not
an MFC.
Reviewed by: bms
Submitted by: Marko Zec <zec icir org>
Tested by: kensmith
Approved by: re (kensmith)
Newer Intel processors have better hyperthreading implementations than
the original ones, and FreeBSD's SMP and scheduler code has greatly
improved between 6.x and 7.x; so hyperthreading now provides a
non-trivial performance win.
Note that security issues involving shared caches and other
microarchitectural features (e.g., dynamic branch prediction tables)
still exist; consequently, it is recommended that hyperthreading be
turned off on systems with untrusted local users. This can be
performed by setting machdep.hyperthreading_allowed=0 in
/boot/loader.conf.
Hyperthreading will continue to be disabled by default on FreeBSD 6.x.
Requested by: core
Approved by: re (kensmith)
Security: See FreeBSD-SA-05:09.htt for background information.
When reactivating a cached page, reset the page's pool to the default
pool. (Not doing this before was a performance pessimization but not
a cause for panic.)
Approved by: re (kensmith)
o Acer Aspire 4520 laptop
- jack sensing / automute
o Toshiba Satellite A135-S4527 laptop
- jack sensing / automute
Tested by: lioux
o Apple Macbook 3 (is it?)
- require gpio0 (for speakers) and ovref50 (for headphone)
to make it works
- jack sensing / automute
Tested by: Ed Schouten
* Add Nvidia MCP67 controller ids.
* Be sensible about simmilar controller with multiple pci ids.
* Connect unused DAC/ADC to stream#0 rather than forcing each of them
managing their own stream.
Approved by: re (kensmith)
Remove kernel and module symbol files from disc1 (and the livecd if it
is enabled). This saves around 80MB (for i386) on the ISO images.
Note that this is only from the install media, not the installed
system where the symbols are still installed, if part of the release.
Should anybody want the symbols which match disc1/livecd, they can
just be extracted from the kernel distribution files.
Approved by: re (kensmith)
More carefully handle various cases in sysctl_drop(), such as unlocking
the inpcb when there's an inpcb without associated timewait state, and
not unlocking when the inpcb has been freed. This avoids a kernel panic
when tcpdrop(8) is run on a socket in the TIMEWAIT state.
Reported by: Rako <rako29 at gmail dot com>
Approved by: re (kensmith)
Remove hacks from the NFSv2/3 client intended to handle a lack of a
server-side RPC retranmission cache for non-idempotent operations: these
hacks substituted 0 (success) for the expected EEXIST in the event that
a target name already existed for LINK, SYMLINK, and MKDIR operations,
under the assumption that EEXIST represented a second application of the
original RPC rather than a true failure.
Background: certain NFS operations (in this case, LINK, SYMLINK, and
MKDIR) are not idempotent, as they leave behind persisting state on the
server that prevents them from being replayed without an error;if an UDP
RPC reply is lost leading to a retransmission by theclient, the second
reply will return EEXIST rather than success, asthe new object has
already been created. The NFS client previouslysilently mapped the
EEXIST return into success to paper over thisproblem.
However, in all modern NFS server implementations, a reply cache is kept
in order to retransmit the original reply to a retransmitted request,
rather than performing the operation a second time, allowing this hack
to be avoided. This allows link()-based filelocking over NFS to operate
correctly, as an application requestingthe creation of a new link for a
file to tell if it succeededatomically or not.
Other NFS clients, including Solaris and Linux, generally follow this
behavior for the same reasons. Most clients also now default to TCP,
which also helps avoid the issue of retransmitted but non-idempotent
requests in most cases.
Reported by: Adam McDougall <mcdouga9 at egr dot msu dot edu>,
Timo Sirainen <tss at iki dot fi>
Reviewed by: mohans
Approved by: re (kensmith)
Let sunkbd(4) emulate an AT keyboard by default.
This has the following benefits:
- allows to use the AT keyboard maps in share/syscons/keymaps with
sunkbd(4),
- allows to use kbdmux(4) with sunkbd(4),
- allows Sun RS232 keyboards to be configured and used the same
way as Sun USB keyboards driven by ukbd(4) (which also does AT
keyboard emulation) with X.Org, putting an end to the problem
of native support for the former in X.Org being broken over and
over again.
Approved by: re (kensmith)
Make VPD register access more robust:
- Implement timing out of VPD register access.
- Fix an off-by-one error of freeing malloc'd space when checksum is invalid.
- Fix style(9) bugs, i.e., sizeof cannot be followed by space.
- Retire now obsolete 'hw.pci.enable_vpd' tunable.
Approved by: re (kensmith)
Do not report MAC, TX, and RX stats via sysctl(8) with BCM5705+.
The register layout is little different from memory-mapped stats
in the previous generation chips. In fact, it is bad because
registers in this range are cleared after reading them.
Approved by: re (kensmith)
strees2 suite, to quote his letter, this change:
1. It removes the tn_lookup_dirent stuff. I think this cannot be fixed,
because nothing protects vnode/tmpfs node between lookup is done, and
actual operation is performed, in the case the vnode lock is dropped.
At least, this is the case with the from vnode for rename.
For now, we do the linear lookup in the parent node. This has its own
drawbacks. Not mentioning speed (that could be fixed by using hash), the
real problem is the situation where several hardlinks exist in the dvp.
But, I think this is fixable.
2. The patch restores the VV_ROOT flag on the root vnode after it became
reclaimed and allocated again. This fixes MPASS assertion at the start
of the tmpfs_lookup() reported by many.
Submitted by: kib
Approved by: re (kensmith)
Reloop OpenBSD rev. 1.563:
In pf_test_fragment(), ignore protocol-specific criteria for packets of
different protocols.
Cleanup pf interface mangement - esp. remove EVENTHANDLER before
unloading the coresponding code. This was lost during 4.1 import.
Bring back pf_if.c revs 1.8 and 1.6 also lost during last import:
- Use correct time for tzero when compiled in
- Don't use bogus interface addresses on ptp-interfaces with :0
Approved by: re (kensmith)
Garbage collect now-unused nfsrv_setcred() -- it's not only unused, but
also a purveyor of unfortunate (and now unsupported) direct frobbing of
struct ucred.
Approved by: re (kensmith)
The kernel uses two ways to write data on a pipe:
o buffered write, for chunks smaller than PIPE_MINDIRECT bytes
o direct write, for everything else
A call to writev(2) may receive struct iov of various size and the
kernel may have to switch from one solution to the other. Before doing
this, it must wake reader processes and any select/poll/kqueue up.
This commit fixes a bug where select/poll/kqueue are not triggered
when switching from buffered write to direct write. It adds calls to
pipeselwakeup().
I give more details on freebsd-arch@:
http://lists.freebsd.org/pipermail/freebsd-arch/2007-September/006790.html
This should fix issues with Erlang (lang/erlang) and kqueue.
Reported by: Rickard Green (Erlang)
Approved by: re (kensmith)
Test that p_textvp is non-NULL be dereferencing, as no executable vnode is
set for kernel processes.
Reported by: Skip Ford <skip at menantico dot com>
Approved by: re (kensmith)
date: 2007/10/18 08:41:52; author: delphij; state: Exp; lines: +2 -2
Do not bail out for cleanworld target just because
chflags is failed.
Approved by: re (kensmith)
- Merge all the ng_send_fn2* functions into one - ng_send_fn2(),
removing some copy&pasted code.
- Reduce copy and paste in ng_apply_item().
- Resurrect ng_send_fn() as a valid symbol, not a define.
Reviewed by: mav, julian
Approved by: re (kensmith)
Fix picobsd builds. Changes include:
- use proper make configuration for the build, using
${BINMAKE} as evaluated by ${VERSION}/src/Makefile
- remove -lmytinfo from crunch.conf
- remove support for login_access in tinyware/login
- remove "machine i386" from the kernel config file
It might actually be interesting to extend the script to do
a cross build for !i386 ...
Approved by: re
reducing the chance of device removal(PCCARD) panic by replacing the
timeout(9) with callout(9) APIs.
Tested by: dhw
Approved by: re (kensmith)
MFC after: 3 days
date: 2007/11/12 18:57:33; author: delphij; state: Exp; lines: +1 -1
Correct a stack overflow which will trigger panics when
mode= is specified, caused by incorrect format string
specified to vfs_scanopt() and subsequently vsscanf().
Pointed out by: kib
Submitted by: des
Approved by: re (kensmith)
> While checking over the libraries for 7.0-REL Kris found the following
> libraries had not had their versions bumped relative to 6.3-REL but
> had indeed been changed. We need to bump their version so they can be
> properly added to the compat6x port:
>
> libasn1.so.8 libgssapi.so.8 libhdb.so.8 libkadm5clnt.so.8
> libkadm5srv.so.8 libkafs5.so.8 libkrb5.so.8 libobjc.so.2
Versions being MFCed:
gnu/lib/libobjc/Makefile: 1.33
kerberos5/lib/Makefile.inc: 1.8
lib/libgssapi/Makefile: 1.3
Approved by: re (bmah)
Move the priv check before the malloc call for so_pcb.
In case attach fails because of the priv check we leaked the
memory and left so_pcb as fodder for invariants.
Approved by: re (kensmith)
Limit total playback channels to just 1, for ALi M5451.
The reliability of it's multi DAC / playback channels is
not that good. Enabling vchans make the bug more visible
since playback allocation will look for possible free
hardware channels first (i.e: the next DAC, the very first
has been consumed by vchan mixer) which in this case has
been proven faulty.
Reported / Tested by: Sascha Klauder
Approved by: re (kensmith)
layout. xorg-printserver still exists in the ports tree but it's marked
as depreciated and scheduled for removal.
Versions MFCed:
dist.c: 1.252
dist.h: 1.70
menus.c: 1.428
Approved by: re (bmah)
advertisement during low mem conditions.
- Fixes a compile error on mac-os (signedness stuff).
- Touches up some comments.
Approved by: [email protected] (Ken Smith)
Add SMB support for the MCP61 chipset.
PR: 108830
Submitted by: Edwin Mons <freebsd at edwinm dot ik dot nu>
Approbed by: imp (mentor)
Approved by: imp (mentor, implicit)
Approved by: re (kensmith)
Split decr_init() into two, with the section that reads the timebase
frequency from OpenFirmware moved out and into a routine that is called
from cpu_startup().
This allows correct reporting of the CPU clockspeed when printing out
CPU information at boot time.
Approved by: re (Ken Smith)
Add a missing priv check in key_attach to prevent non-su users
from messing with the spdb and sadb.
Problem sneaked in with the fast_ipsec+v6->ipsec merger by no
longer going via raw_usrreqs.pr_attach.
Approved by: re (kensmith)
1.75: Make ukbd_getc respect non-blocking behavior if one is requested;
1.76: Do not pass an address of local stack variable to
usbd_set_report_async.
Approved by: re (kensmith)
Update pf examples from OpenBSD to catch up with new stateful defaults and
other syntax changes. Move pf.conf from /etc to examples, too.
Approved by: re (kensmith)
Correct a copy and paste'o in phys_pager.c, we are talking about phys here
and not about devices.
PR: 93755
Approved by: imp (mentor, implicit when re-assigning the ticket to me).
Approved by: re (kensmith), imp (mentor)
In _pthread_key_create() ensure that libthr is initialized. This
fixes a NULL-dereference of curthread when libstdc+ initializes
the exception handling globals on archs we can't use GNU TLS due
to lack of support in binutils 2.15 (i.e. arm and sparc64), yet,
thus making threaded C++ programs compiled with GCC 4.2.1 work
again on these archs.
Approved by: re (kensmith)
Revision Changes Path
1.123 +5 -2 src/sys/dev/aac/aac.c
1.29 +17 -17 src/sys/dev/aac/aac_cam.c
Rework aac locking for MPSAFE CAM. This fixes a Giant mutex assertion
reported on freebsd-current [1].
Also dequeue all events in aac_release_command (instead of just one)
so that there's no risk of them getting stranded.
Reported by: Steven Brown [1]
Submitted by: scottl@
[1] http://lists.freebsd.org/pipermail/freebsd-current/2007-October/077928.html
Approved by: re
on duplicated code and support 64-bit LBAs for GPT. This also changes the
code to always use EDD on devices that support it which matches the rest of
the x86 bootstrap.
Approved by: re (kensmith)
where the L1 cache is shared between CPUs) to disabled for security
reasons. As in earlier releases, this can be changed by setting
machdep.hyperthreading_allowed=1 in /boot/loader.conf.
This is not an MFC -- no seatbelts in CURRENT.
Approved by: re (kensmith)
Security: See FreeBSD-SA-05:09.htt for background material.
Add comments explaining why all stores updating a non-kernel page table
must be globally performed before calling any of the TLB invalidation
functions.
With one exception, on amd64, this requirement was already met. Fix this
one case. Also, as a clarification, change an existing atomic op into a
release.
Approved by: re (kensmith)
Change wpa_supplicant to down the interface at the start of the init routine.
wpa_supplicant expects that it has exclusive access to the net80211 state so
when its starts poking in the WEP/WPA settings and the card is already
scanning it can cause net80211 to try and associate incorrectly with a
protected AP.
This is an inconvenience for firmware based cards such as iwi where it can be
sent an auth instruction with incomplete security info and cause a firmware
error.
Remove the 'ifconfig up' from network.subr since wpa_supplicant will
immediately down the interface again.
Approved by: re (gnn)
Eliminate spurious "Approaching the limit on PV entries, ..."
warnings by get_pv_entry().
Eliminate the direct call to pagedaemon_wakeup() by get_pv_entry().
Approved by: re (gnn)
used to configure a bridge on both and adds room for later MFCs.
The struct is part of the API/ABI and shouldnt be changed again (c/o rwatson)
Approved by: re (rwatson)
Allow RFCOMM servers to bind to a ''wildcard'' RFCOMM channel
zero (0). Actual RFCOMM channel will be assigned after listen(2)
call is done on a RFCOMM socket bound to a ''wildcard'' RFCOMM
channel zero (0).
Address locking issues in ng_btsocket_rfcomm_bind()
Submitted by: Heiko Wundram (Beenic) < wundram at beenic dot net >
Approved by: re (kensmith)
If the INDEX file cannot be opened, print the actual filename / path
pkg_version tried to open instead of just "INDEX" to make the actual
problem more clear (e.g. missing INDEX-8).
Approved by: re (kensmith)
mac_biba.c:1.108, mac_mls.c:1.89, mac_stub.c:1.69, mac_test.c:1.79 from
HEAD to RELENG_7:
Canonicalize naming of local variables for struct ksem and associated
labels to 'ks' and 'kslabel' to reflect the convention in posix_sem.c.
Obtained from: TrustedBSD Project
Approved by: re (kensmith)
- Select a tag gains ability to optionally save new tags
off in the timewait system.
- When looking up associations do not give back a stcb that
is in the about-to-be-freed state, and instead continue
looking for other candiates.
- New function to query to see if value is in time-wait.
- Timewait had a time comparison error that caused very
few vtags to actually stay in time-wait.
- When setting tags in time-wait, we now use the time
requested NOT a fixed constant value.
- sstat now gets the proper associd when we do the query.
- When we process an association, we expect the tag chosen
(if we have one from a cookie) to be in time-wait. Before
we would NOT allow the assoc up by checking if its good.
In theory this should have caused almost all assoc not
to come up except for the time-comparison bug above (this
bug was hidden by the time comparison bug :-D).
- Don't save tags for nonce values in the time-wait cache
since these are used only during cookie collisions and do
not matter if they are unique or not.
Approved by: [email protected] (Ken Smith)
Revisions:
1.21 src/sys/dev/sound/pci/atiixp.c
1.4 src/sys/dev/sound/pci/atiixp.h
Add support for trimmed down version of ATI SB600 AC97 audio
controller.
URL: http://www.ipc2u.de/catalog/P/PE/36486.html
PR: kern/117813
Submitted by: Klaus Mayr
Approved by: re (kensmith)
rgephy.c rev 1.17, rgephyreg.h rev 1.3
Add support for RealTek RTL8211B(L) PHY. It's based on the patch
made by Michael Eisele and the patch was slightly modified by me.
With this change several NVIDIA ethernet controllers(e.g. MCP61)
works.
RTL8211B(L) is RealTek's new gigabit PHY. The PHY has several
features including crossover correction, polarity correction as
well as supporting triple speed(10/100/1000bps). Data transfer
between MAC and PHY is via RGMII for 1000baseT, MII for
10baseT/100baseTX.
Unfortunately, RealTek used the same model number for RTL8211B(L)
PHY so there is no way to discriminate between RTL8211B(L) and its
predecessors. ATM RTL8211B uses revision number 2 so checking the
revision number seems to be only way to identify it.
rgephyreg.c rev 1.18
Setting sc->mii_anegticks to MII_ANEGTICKS_GIGE in rgephy_attach()
is redundant. mii_phy_add_media() already takes care of that.
Approved by: re (kensmith)
o RTL8169S/8110S integrated PHY and RTL8211B are gigabit PHYs so set
mii_anegticks to MII_ANEGTICKS_GIGE and use it. Previously it used
to MII_ANEGTICKS which may not be enough to wait before retrying
autonegotiation process at 1000bps.
o Reset autonegotation timer if media option is not IFM_AUTO or we
got a valid link.
o Announce link loss right after it happends.
o Autonegiation is retried every mii_anegticks seconds.
o Report link state changes right after setting autonegotiation.
Approved by: re (kensmith)
- Remove AU_.* hard-coded audit class constants, as udit classes are now
entirely dynamically configured using /etc/security/audit_class.
Obtained from: TrustedBSD Project
Approved by: re (kensmith)
- Fix bug in auditreduce(8) which resulted in a memory fault/crash when
the user specified an event name with -m.
- Remove AU_.* hard-coded audit class constants, as audit classes are now
entirely dynamically configured using /etc/security/audit_class.
Obtained from: TrustedBSD Project
Approved by: re (kensmith)
Replace use of AU_NULL with 0 when no audit classes are in use; this
supports the removal of hard-coded audit class constants in OpenBSM
1.0. All audit classes are now dynamically configured via the
audit_class database.
Obtained from: TrustedBSD Project
Approved by: re (kensmith)
of the full request size. This avoids a 32-bit overflow
problem skipping an exact multiple of 4GB and is faster
anyway because it allows the underlying I/O framework
to minimize copying.
In particular, this fixes bsdtar failing to properly skip
entries in uncompressed tar archives that are an exact
multiple of 4GB.
Approved by: re (Ken Smith)
01 - Enhanced LRO:
LRO feature is extended to support multi-buffer mode. Previously,
Ethernet frames received in contiguous buffers were offloaded.
Now, frames received in multiple non-contiguous buffers can be
offloaded, as well. The driver now supports LRO for jumbo frames.
02 - Locks Optimization:
The driver code was re-organized to limit the use of locks.
Moreover, lock contention was reduced by replacing wait locks
with try locks.
03 - Code Optimization:
The driver code was re-factored to eliminate some memcpy
operations. Fast path loops were optimized.
04 - Tag Creations:
Physical Buffer Tags are now optimized based upon frame size.
For better performance, Physical Memory Maps are now re-used.
05 - Configuration:
Features such as TSO, LRO, and Interrupt Mode can be configured
either at load or at run time. Rx buffer mode (mode 1 or mode 2)
can be configured at load time through kenv.
06 - Driver Statistics:
Run time statistics are enhanced to provide better visibility
into the driver performance.
07 - Bug Fixes:
The driver contains fixes for the problems discovered and
reported since last submission.
08 - MSI support:
Added Message Signaled Interrupt feature which currently uses 1
message.
message.
09 Removed feature:
Rx 3 buffer mode feature has been removed. Driver now supports 1,
2 and 5 buffer modes of which 2 and 5 buffer modes can be used
for header separation.
10 Compiler warning:
Fixed compiler warning when compiled for 32 bit system.
11 Copyright notice:
Source files are updated with the proper copyright notice.
Submitted by: Alicia Pena <Alicia dot Pena at neterion dot com>,
Muhammad Shafiq <Muhammad dot Shafiq at neterion dot com>
Approved by: re (gnn, kensmith)
In nmount(), if MNT_ROOT is in the mount flags, filter it
out instead of returning an error.
(1) This makes the behavior consistent with mount(2).
(2) This makes update mounts on the root file system work properly.
(3) The explicit checks for MNT_ROOTFS in src/sbin/fsck_ffs/main.c
and src/usr.sbin/mountd/mountd.c which were put in to
eliminate errors during update mounts on the root file system
can be removed.
The only place were MNT_ROOTFS can be validly set
is inside the kernel, i.e. with vfs_mountroot_try().
Approved by: re (gnn)
sysinstall had made bad assumptions about the behavior of getenv(3)
and the new getenv(3) doesn't behave the same as the old one did
if you call it with getenv("amd_enable=YES").
It was noted during review that the use of strdup(3) here is wrong
and should be checked for NULL. It's worth noting that's what I meant
when I said I conformed to sysinstall's style despite urges to do otherwise
in the original commit. sysinstall is in desperate need of some major
rototilling (or being thrown out...).
Approved by: re (rwatson)
Teach /etc/rc.d/ppp to start multiple instances of ppp.
ppp_profile variable can now contain multiple profiles.
Overrides for ppp mode and nat can go into ppp_$profile_mode
and ppp_$profile_nat variables respectively. If those are
not specified, defaults from ppp_mode and ppp_nat are used.
MFC: etc/rc.d/ppp v1.15
Teach /etc/rc.d/ppp how to start/stop individual instances
of ppp. This is an extension of previous commit.
Submitted by: Yuri Kurenkov < y dot kurenkov at init dot ru >
Reviewed by: mtm
Approved by: re (kensmith)
Apply a few changes from ipfilter-current:
* Do not hold any locks over calls to copyin/copyout.
* Clean up some #ifdefs
* fix a possible mbuf leak when NAT fails on policy routed packets
PR: 117216
Approved by: re
Correct an error in vm_map_sync(), nee vm_map_clean(), that has existed
since revision 1.1. Specifically, neither traversal of the vm map checks
whether the end of the vm map has been reached. Consequently, the first
traversal can wrap around and bogusly return an error.
Approved by: re (kensmith)
Change vm_page_cache_transfer() such that it does not transfer pages
that would have an offset beyond the end of the target object. Such
pages should remain in the source object.
Approved by: re (kensmith)
Small improvement for __isctype(): don't use __mb_sb_limit but
hardcode 128 here instead, since default locale never define anything
above 127 char.
Approved by: re (kensmith)
This matches the 6.x and earlier behavior where there is no (marginally
useful) /dev/nvram. When it was in isa/clock.c, it was mandatory.
Approved by: re (kensmith)
to store size. In particular, the pax 'size' attribute is required
for any file over 8G.
This seems to fix tar -cf - | tar -xf - when there are files
over 8G in the heirarchy being copied.
Approved by: re (Ken Smith)
Allow adding a user(s) to additional groups in batch mode as well.
Submitted by: Eygene Ryabinkin <[email protected]>
(modulo minor changes)
Approved by: re (kensmith)
The amd_map_program knob can potentially contain a command whose output
is then used as an argument to the amd program. This outpu may contain
newlines, but the script did not take care to strip those newlines before
apending it to rc_flags. Revision 1.72 of rc.subr(8) introduced changes that
exposed this problem (specifically putting the final eval'ed command in
quotes).[1]
Also, for correctness' sake, shell directives appended to the command-line
by the script should go into command_args, and not appended directly
to rc_flags.
Approved by: re (kensmith)
Properly drop the pf mutex around all copyout (consistency still
protected by the sx) and avoid a WITNESS panic. Overlooked during last
import.
Reported and tested by: Max N. Boyarov
Approved by: re (kensmith)
Implement new apply callback mechanism to handle item forwarding.
When item forwarded, refence counter is incremented, when item
processed, counter decremented. When counter reaches zero,
apply handler is getting called.
It allows to report connect() call status only when it is really completed.
Reviewed by: julian
Approved by: re (kensmith)
sys/sys/param.h 1.312, sys/sys/pciio.h 1.8
Add ABI backwards compatibility to the FreeBSD 4/5/6 versions of
the PCIOCGETCONF, PCIOCREAD and PCIOCWRITE IOCTLs, which was broken
with the introduction of PCI domain support.
As the size of struct pci_conf_io wasn't changed with that commit,
this unfortunately requires the ABI of PCIOCGETCONF to be broken
again in order to be able to provide backwards compatibility to
the old version of that IOCTL.
Approved by: re (kensmith)
older versions, update the "older" version to match what shipped in
6.2-RELEASE.
Also remove lukemftpd and OpenSSH notes, since those versions already
appeared in 6.2-RELEASE.
Approved by: re (implicitly)
The bridging output function puts the mbuf directly on the interfaces send
queue so the output network card must support the same tagging mechanism as
how the frame was input (prepended Ethernet header tag or stripped HW mflag).
Now the vlan Ethernet header is _always_ stripped in ether_input and the mbuf
flagged, only only network cards with VLAN_HWTAGGING enabled would properly
re-tag any outgoing vlan frames.
If the outgoing interface does not support hardware tagging then readd the vlan
header to the front of the frame. Move the common vlan encapsulation in to
ether_vlanencap().
Approved by: re (kensmith)
aligned, GCC 4.2.1 also generates code for sendudp() that assumes
this alignment. GCC 4.2.1 however doesn't 32-bit align wbuf, causing
the loader to crash due to an unaligned access of wbuf in sendudp()
when netbooting sparc64. Solve this by specifying wbuf as packed and
32-bit aligned, too. As for lastdata and readudp() this currently is
no issue when compiled with GCC 4.2.1, though give lastdata the same
treatment as wbuf for consistency and possibility of being affected
in the future.
- Sprinkle const on a lookup table.
Approved by: re (kensmith)
their MFC markers on RELENG_7): snd_envy24(4), snd_envy24ht(4),
snd_hda(4), snd_spicds(4), cxgb(4), fdisk(8) -p, etc/rc.d/sendmail
alias rebuild change.
For some important ports that were upgraded from some older version,
match the older version with the version that shipped with
6.2-RELEASE: GNOME, KDE, X.org.
Approved by: re (implicitly)
1. Determine the location of the rndc* binaries relative to $command
2. Make the stop routine work more like rc.subr's, but try rndc first
3. Allow the rndc.key file to be owned by root OR the named_uid user
Approved by: re (kensmith)
etc. that appeared in prior FreeBSD releases. This change is based on
reviewing the release notes for 6.1-RELEASE and 6.2-RELEASE.
There's still some more work to be done here but this is a good
checkpoint.
Approved by: re (implicitly)
Discussed with: hrs
Install getaudit_addr(2) and setaudit_addr(2) links to getaudit(2) and
setaudit(2).
Approved by: re (kensmith)
Submitted by: csjp
Obtained from: TrustedBSD Project
rev. 1.18 sys/i386/include/in_cksum.h
Fold multiple asm statements into one so that the compiler at a certain
optimization level (-march=pentium-mmx for example) does not insert
intermediate ops which would trash the carry.
Change both sys/i386/i386/in_cksum.c[1] and sys/i386/include/in_cksum.h.
To my best understanding the same problem was addressed in rev. 1.16
of src/sys/i386/include/in_cksum.h for just a single function 3y ago.
Reviewed by: jhb
Submitted by: Zhouyi ZHOU <zhouzhouyi FreeBSD.org> (intial version of [1])
PR: 115678, 69257
Approved by: re (kensmith)
tcp_syncache.c rev 1.131
tcp_usrreq.c rev 1.164
Pick the smallest possible TCP window scaling factor that will still allow
us to scale up to sb_max, aka kern.ipc.maxsockbuf.
Approved by: re (kensmith)
Correct an error of omission in the reimplementation of the page
cache: vnode_pager_setsize() must handle the case where a file is
truncated to a non-page-size-aligned boundary and there is a cached
page underlying the new end of file.
Approved by: re (gnn)
- fix a bug during cookie collision that prevented an
association from coming up in a specific restart case.
- Fix it so the shutdown-pending flag gets removed (this is
more for correctness then needed) when we enter shutdown-sent
or shutdown-ack-sent states.
- Fix a bug that caused the receiver to sometimes NOT send
a SACK when a duplicate TSN arrived. Without this fix
it was possible for the association to fall down if the
- Deleted primary destination is also stored when SCTP_MOBILITY_BASE.
(Previously, it is stored when only SCTP_MOBILITY_FASTHANDOFF)
- Fix a locking issue where we might call send_initiate_ack() and
incorrectly state the lock held/not held. Also fix it so that
when we release the lock the inp cannot be deleted on us.
- Add the debug option that can cause the stack to panic instead
of aborting an assoc. This does not and should never show up
in options but is useful for debugging unexpected aborts.
- Add cumack_log sent to track sending cumack information for
the debug case where we are running a special log per assoc.
- Added extra () aroudn sctp_sbspace macro to avoid compile warnings.
Approved by: [email protected] (Ken Smith)
proper attribution. See also http://www.theguyintheglass.com/
MFC fortunes 1.243, fortunes-o.real 1.23, and limerick 1.12:
Fix a few small typos and remove a duplicate
Approved by: re (kensmith)
This changes give nullfs correctly work with latest unionfs.
Submitted by: Masanori Ozawa <[email protected]> (unionfs developer)
Reviewed by: jeff, kensmith
Approved by: re (kensmith)
Added whiteout behavior option. ``-o whiteout=always'' is default mode
(it is established practice) and ``-o whiteout=whenneeded'' is less
disk-space using mode especially for resource restricted environments
like embedded environments. (Contributed by Ed Schouten. Thanks)
Submitted by: Masanori Ozawa <[email protected]> (unionfs developer)
Reviewed by: jeff, kensmith
Approved by: re (kensmith)
Default copy mode has been changed from traditional-mode to transparent-mode.
Some folks who have reported some issues have solved with transparent mode.
We guess it is time to change the default copy mode. The transparent-mode is
the best in most situations.
Submitted by: Masanori Ozawa <[email protected]> (unionfs developer)
Reviewed by: jeff, kensmith
Approved by: re (kensmith)
- It has been become MPSAFE.
- Fixed lock panic issue under MPSAFE.
- Fixed panic issue whenever it locks vnode with reclaim.
- Fixed lock implementations not conforming to vnode_if.src style.
Submitted by: Masanori Ozawa <[email protected]> (unionfs developer)
Reviewed by: jeff, kensmith
Approved by: re (kensmith)
- Added support for vfs_cache on unionfs. As a result, you can use
applications that use procfs on unionfs.
- Removed unionfs internal cache mechanism because it has
vfs_cache support instead. As a result, it just simplified code of
unionfs.
- Fixed kern/111262 issue.
Submitted by: Masanori Ozawa <[email protected]> (unionfs developer)
Reviewed by: jeff, kensmith
Approved by: re (kensmith)
MFC: archive_write_set_format_cpio_newc.c 1.2
Non-regular files should have zero-length bodies. libarchive
flags this to clients by updating the entry description when
it writes the header.
Approved by: re (Ken Smith)
sys/sparc64/sparc64/elf_machdep.c 1.24
- Fix the handling of R_SPARC_OLO10, which is a bit of a special case
in the way we implement handling of relocations.
As for the kernel part this fixes the loading of lots of modules,
which failed to load due to unresolvable symbols when built after
the GCC 4.2.0 import. This wasn't due to a change in GCC itself
though but one of several changes in configuration done along the
import. Specfically, HAVE_AS_REGISTER_PSEUDO_OP, which causes GCC
to denote global registers used for scratch purposes and in turn
GAS uses R_SPARC_OLO10 relocations for, is now defined.
While at it replace some more ELF_R_TYPE which should have been
ELF64_R_TYPE_ID but didn't cause problems so far.
- Sync a sanity check between kernel and rtld(1) and change it to be
maintenance free regarding the type used for the lookup table.
- Sprinkle const on lookup tables.
- Use __FBSDID.
Approved by: re (kensmith)
date: 2007/10/16 18:32:37; author: cognet; state: Exp; lines: +3 -1
Backout rev 1.62, and revert to use -march=armv5te -D__XSCALE__ instead
of -mcpu=xscale for XScale.
gcc still has issues with -mcpu=xscale, and now crashes while building
systat.
Approved by: re (kensmith)
codecs. Codec at address 0 seems purely digital, or perhaps an HDMI
interface. Let the driver skip it and continue scanning the codecs
starting with address 2 (Realtek ALC885).
* Due to possibilities of future similar cases, put enough logic
in hdac_scan_codecs() to force codec scanning starting from
XX address via tunable "hint.pcm.%d.codec_index".
Reported / Tested by: Toomas Pelberg <[email protected]>
- Trivial headphone / speaker automute fixup for Fujitsu-Siemens
AMILO Si 1848 laptop.
Reported / Tested by: Ed <[email protected]>
- Trivial headphone / speaker automute fixup for Fujitsu-Siemens
Lifebook S7020D laptop.
Reported / Tested by: Jaromir Dvoracek <[email protected]>
- Some smart vendor trying to create interplanetary wormhole by
screwing pci config space during their BIOS update. The side effects
of their failure attempt includes mutilated hardware id, broken
speaker automuting and loosing the entire analog CD connectivity,
thus causing enough collateral damages to collapse the entire
universe. Move along with it.
Please exercise extra cautious when applying BIOS updates.
Reported / Tested by: Pietro Cerutti <[email protected]>
- assembled laptop, based on the MSI-1034
(662) which is now becoming MSI-034A.
- Fix no sound issues (on headphones) for Lenovo ThinkCentre A55 due
to global automute table entry which is not applicable for
non-laptops.
Reported / Tested by: Piotr Smyrak <[email protected]>
- Speaker mute control for HP DC7700 since the front headphone jack
does not generate any interesting unsolicited signal/response.
Reported / Tested by: tyop @ irc.freenode.net
Approved by: re (kensmith)
rev. 1.10
The POP daemon's temporary mail file has a leading dot ('.').
This was lost in the shell script rewrite of the rmuser command.
Approved by: re (kensmith)
The previous revision, updating vm_object_page_remove() for the new page
cache, did not account for the case where the vm object has nothing but
cached pages.
Approved by: re (kensmith)
Requested by: kensmith
Teach makewhatis.c to treat .SS with the same severity as .SH.
At least one port (net-mgmt/net-snmp) creates man-pages which are
in the format:
.SH NAME
The Net-SNMP agent \- The snmp agent responds to SNMP queries from manag
ement stations.
.PP
.SS "Modules"
At this moment, makewhatis determines the end of the .SH NAME section
as where it finds .SH again, but there is none here, is it "terminated"
by the .SS.
PR: bin/116706
Submitted by: edwin@
Approved by: re (Ken Smith), grog (mentor)
return EOF immediately on any attempts to read their data.
(Previously, it would return a zero-length block, then EOF,
which elicited bogus warnings from bsdtar.)
Also, correct the EOF return to correctly identify EOF
as part of an empty block at the correct offset.
Approved by: re (Ken Smith)
Fix two panics in lagg.
1. The locking was changed to shared but roundrobin mode still updated a
pointer in the softc with the next tx interface to use. This will panic
under high load. Change this to an atomically incremented sequence number
in order to choose the tx port in round robin.
2. IFQ_HANDOFF will free the mbuf if the queue is full, this will then be
freed again by lagg_start() and panic. Reorganised the error handling and
freeing to fix this.
Approved by: re (kensmith)
Print the ZFS ereport to the console if vfs.zfs.debug is set to help diagnose
problems with zfs-on-root since devd isnt running yet.
Approved by: re (kensmith)
revert 1.18: the negotiated rate set may not match the hal rate
tables, so using the hal's rateCodeToIndex array will produce wrong
indices for the negotiated rate set
Approved by: re (kensmith)
rev. 1.8 of src/lib/libutil/pidfile.c:
When pidfile is already locked and has zero length, do not return
success and zero pid from pidfile_read(). Return EAGAIN instead. Sleep
up to three times for 5 ms while waiting for pidfile to be written.
Approved by: re (kensmith)
NFS MP scaling changes.
- Eliminate the hideous nfs_sndlock that serialized NFS/TCP request senders
thru the sndlock.
- Institute a new nfs_connectlock that serializes NFS/TCP reconnects. Add
logic to wait for pending request senders to finish sending before
reconnecting. Dial down the sb_timeo for NFS/TCP sockets to 1 sec.
- Break out the nfs xid manipulation under a new nfs xid lock, rather than
over loading the nfs request lock for this purpose.
- Fix some of the locking in nfs_request.
Many thanks to Kris Kennaway for his help with this and for initiating the
MP scaling analysis and work. Kris also tested this patch thorougly.
Approved by: re@ (Ken Smith)
Technically, "7-STABLE" isn't the right name for
this directory but it will be after 7.0-RELEASE, and naming the
directory this way means we don't have to go fix it up later.
Approved by: re (implicitly)
Set the NFS server sockbuf high watermarks to the system defaults
(up form 32KB). The low highwatermark setting caused UDP fullsock
request drops, throttling thruput greatly.
Reported by: Kris Kennaway
Approved by: re@ (Ken Smith)
Not all VIA Rhine chips support 256 register space. So touching
VR_STICKHW register would result in unexpected results on these
hardwares. wpaul said the following for the issue.
The vr_attach() routine unconditionally does this for all supported
chips:
/*
* Windows may put the chip in suspend mode when it
* shuts down. Be sure to kick it in the head to wake it
* up again.
*/
VR_CLRBIT(sc, VR_STICKHW, (VR_STICKHW_DS0|VR_STICKHW_DS1));
The problem is, the VR_STICKHW register is not valid on all Rhine
devices. The VT86C100A chip, which is present on the D-Link DFE-530TX
boards, doesn't support power management, and its register space is
only 128 bytes wide. The VR_STICKHW register offset falls outside this
range. This may go unnoticed in most scenarios, but if you happen to have
another PCI device in your system which is assigned the register
space immediately after that of the Rhine, the vr(4) driver will
incorrectly stomp it. In my case, the BIOS on my test board decided
to put the register space for my PRO/100 ethernet board right next
to the Rhine, and the Rhine driver ended up clobbering the IMR register
of the PRO/100 device. (Long story short: the board kept locking up on
boot. Took me the better part of the morning suss out why.)
The strictly correct thing to do would be to check the PCI config space
to make sure the device supports the power management capability and only
write to the VR_STICKHW register if it does.
Instead of inspecting chip revision numbers for the availability of
VR_STICKHW register, check the existence of power management capability
of the hardware as wpaul suggested.
Reported by: wpaul
Suggested by: wpaul
OK'ed by: jhb
Approved by: re (kensmith)
- Mention that less v408 was MFC'ed.
- Mention tzdata2007h update. An in advance &merged; is
added so that we don't have to change this again when
it is actually MFC'ed.
Approved by: re (bmah)
DTrace is a comprehensive dynamic tracing framework for the Solaris Operating System. DTrace provides a powerful infrastructure that permits administrators, developers, and service personnel to concisely answer arbitrary questions about the behavior of the operating system and user programs.
.sp
.LP
The \fISolaris Dynamic Tracing Guide\fR describes how to use DTrace to observe, debug, and tune system behavior. Refer to this book for a detailed description of DTrace features, including the bundled DTrace observability
tools, instrumentation providers, and the D programming language.
.sp
.LP
The \fBdtrace\fR command provides a generic interface to the essential services provided by the DTrace facility, including:
.RS+4
.TP
.iet\(bu
.elo
Options that list the set of probes and providers currently published by DTrace
.RE
.RS+4
.TP
.iet\(bu
.elo
Options that enable probes directly using any of the probe description specifiers (provider, module, function, name)
.RE
.RS+4
.TP
.iet\(bu
.elo
Options that run the D compiler and compile one or more D program files or programs written directly on the command line
.RE
.RS+4
.TP
.iet\(bu
.elo
Options that generate anonymous tracing programs
.RE
.RS+4
.TP
.iet\(bu
.elo
Options that generate program stability reports
.RE
.RS+4
.TP
.iet\(bu
.elo
Options that modify DTrace tracing and buffering behavior and enable additional D compiler features
.RE
.sp
.LP
You can use \fBdtrace\fR to create D scripts by using it in a \fB#!\fR declaration to create an interpreter file. You can also use \fBdtrace\fR to attempt to compile D programs and determine their properties without actually enabling tracing using the \fB-e\fR option. See \fBOPTIONS\fR. See the \fISolaris Dynamic Tracing Guide\fR for detailed examples of how to use the \fBdtrace\fR utility to perform these tasks.
.SHOPTIONS
.sp
.LP
The arguments accepted by the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, and \fB-i\fR options can include an optional D language \fIpredicate\fR enclosed in slashes \fB//\fR and optional D language \fIaction\fR statement list enclosed in braces \fB{}\fR. D program code specified on the command line must be appropriately quoted to avoid intepretation of meta-characters by the shell.
.sp
.LP
The following options are supported:
.sp
.ne2
.mk
.na
\fB\fB-32\fR | \fB-64\fR\fR
.ad
.sp.6
.RS4n
The D compiler produces programs using the native data model of the operating system kernel. You can use the \fBisainfo\fR\fB-b\fR command to determine the current operating system data model. If the \fB-32\fR option is specified, \fBdtrace\fR forces
the D compiler to compile a D program using the 32-bit data model. If the \fB-64\fR option is specified, \fBdtrace\fR forces the D compiler to compile a D program using the 64-bit data model. These options are typically not required as \fBdtrace\fR selects the
native data model as the default. The data model affects the sizes of integer types and other language properties. D programs compiled for either data model can be executed on both 32-bit and 64-bit kernels. The \fB-32\fR and \fB-64\fR options also determine the ELF file format
(ELF32 or ELF64) produced by the \fB-G\fR option.
.RE
.sp
.ne2
.mk
.na
\fB\fB-a\fR\fR
.ad
.sp.6
.RS4n
Claim anonymous tracing state and display the traced data. You can combine the \fB-a\fR option with the \fB-e\fR option to force \fBdtrace\fR to exit immediately after consuming the anonymous tracing state rather than continuing to wait for new
data. See the \fISolaris Dynamic Tracing Guide\fR for more information about anonymous tracing.
.RE
.sp
.ne2
.mk
.na
\fB\fB-A\fR\fR
.ad
.sp.6
.RS4n
Generate \fBdriver.conf\fR(4) directives for anonymous tracing. This option constructs a set of \fBdtrace\fR(7D) configuration file directives to enable the specified probes for anonymous tracing and then exits. By default, \fBdtrace\fR attempts to store the directives to the file \fB/kernel/drv/dtrace.conf\fR. You can modify this behavior if you use the \fB-o\fR option to specify an alternate output file.
.RE
.sp
.ne2
.mk
.na
\fB\fB-b\fR\fIbufsz\fR\fR
.ad
.sp.6
.RS4n
Set principal trace buffer size (\fIbufsz\fR). The trace buffer size can include any of the size suffixes \fBk\fR, \fBm\fR, \fBg\fR, or \fBt\fR. If the buffer space cannot be allocated, \fBdtrace\fR attempts
to reduce the buffer size or exit depending on the setting of the \fBbufresize\fR property.
.RE
.sp
.ne2
.mk
.na
\fB\fB-c\fR\fIcmd\fR\fR
.ad
.sp.6
.RS4n
Run the specified command \fIcmd\fR and exit upon its completion. If more than one \fB-c\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status for each child process as it
terminates. The process-ID of the first command is made available to any D programs specified on the command line or using the \fB-s\fR option through the \fB$target\fR macro variable. Refer to the \fISolaris Dynamic Tracing Guide\fR for more information
on macro variables.
.RE
.sp
.ne2
.mk
.na
\fB\fB-C\fR\fR
.ad
.sp.6
.RS4n
Run the C preprocessor \fBcpp\fR(1) over D programs before compiling them. You can pass options to the C preprocessor using the \fB-D\fR, \fB-U\fR, \fB-I\fR, and \fB-H\fR options. You can select the degree of C standard conformance if you use the \fB-X\fR option. For a description of the set of tokens defined by the D compiler when invoking the C preprocessor, see \fB-X\fR.
Define \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). If you specify the equals sign (\fB=\fR)
and additional \fIvalue\fR, the name is assigned the corresponding value. This option passes the \fB-D\fR option to each \fBcpp\fR invocation.
.RE
.sp
.ne2
.mk
.na
\fB\fB-e\fR\fR
.ad
.sp.6
.RS4n
Exit after compiling any requests and consuming anonymous tracing state (\fB-a\fR option) but prior to enabling any probes. You can combine this option with the \fB-a\fR option to print anonymous tracing data and exit. You can also combine this option with D
compiler options. This combination verifies that the programs compile without actually executing them and enabling the corresponding instrumentation.
Specify function name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function\fR, \fImodule:function\fR, or \fIfunction\fR.
Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIfunction\fR are specified in the description, all probes with the corresponding \fIfunction\fR are matched.
The \fB-f\fR argument can be suffixed with an optional D probe clause. You can specify more than one \fB-f\fR option on the command line at a time.
.RE
.sp
.ne2
.mk
.na
\fB\fB-F\fR\fR
.ad
.sp.6
.RS4n
Coalesce trace output by identifying function entry and return. Function entry probe reports are indented and their output is prefixed with \fB->\fR. Function return probe reports are unindented and their output is prefixed with \fB<-\fR\&. System call
entry probe reports are indented and their output is prefixed with \fB=>\fR. System call return probe reports are unindented and their output is prefixed with \fB<=\fR\&.
.RE
.sp
.ne2
.mk
.na
\fB\fB-G\fR\fR
.ad
.sp.6
.RS4n
Generate an ELF file containing an embedded DTrace program. The DTrace probes specified in the program are saved inside of a relocatable ELF object which can be linked into another program. If the \fB-o\fR option is present, the ELF file is saved using the pathname specified
as the argument for this operand. If the \fB-o\fR option is not present and the DTrace program is contained with a file whose name is \fB\fIfilename\fR.d\fR, then the ELF file is saved using the name \fB\fIfilename\fR.o\fR.
Otherwise the ELF file is saved using the name \fBd.out\fR.
.RE
.sp
.ne2
.mk
.na
\fB\fB-H\fR\fR
.ad
.sp.6
.RS4n
Print the pathnames of included files when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This option passes the \fB-H\fR option
to each \fBcpp\fR invocation, causing it to display the list of pathnames, one for each line, to \fBstderr\fR.
.RE
.sp
.ne2
.mk
.na
\fB\fB-h\fR\fR
.ad
.sp.6
.RS4n
Generate a header file containing macros that correspond to probes in the specified provider definitions. This option should be used to generate a header file that is included by other source files for later use with the \fB-G\fR option. If the \fB-o\fR option
is present, the header file is saved using the pathname specified as the argument for that option. If the \fB-o\fR option is not present and the DTrace program is contained with a file whose name is \fIfilename\fR\fB\&.d\fR, then the header file is saved
Specify probe identifier (\fIprobe-id\fR) to trace or list (\fB-l\fR option). You can specify probe IDs using decimal integers as shown by \fBdtrace\fR\fB-l\fR. The \fB-i\fR argument can be suffixed with an optional
D probe clause. You can specify more than one \fB-i\fR option at a time.
.RE
.sp
.ne2
.mk
.na
\fB\fB-I\fR\fIpath\fR\fR
.ad
.sp.6
.RS4n
Add the specified directory \fIpath\fR to the search path for \fB#include\fR files when invoking \fBcpp\fR(1) (enabled
using the \fB-C\fR option). This option passes the \fB-I\fR option to each \fBcpp\fR invocation. The specified \fIpath\fR is inserted into the search path ahead of the default directory list.
.RE
.sp
.ne2
.mk
.na
\fB\fB-L\fR\fIpath\fR\fR
.ad
.sp.6
.RS4n
Add the specified directory \fIpath\fR to the search path for DTrace libraries. DTrace libraries are used to contain common definitions that can be used when writing D programs. The specified \fIpath\fR is added after the default library
search path.
.RE
.sp
.ne2
.mk
.na
\fB\fB-l\fR\fR
.ad
.sp.6
.RS4n
List probes instead of enabling them. If the \fB-l\fR option is specified, \fBdtrace\fR produces a report of the probes matching the descriptions given using the \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, \fB-i\fR,
and \fB-s\fR options. If none of these options are specified, this option lists all probes.
Specify module name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module\fR or \fImodule\fR. Unspecified probe description fields are left blank and match
any probes regardless of the values in those fields. If no qualifiers other than \fImodule\fR are specified in the description, all probes with a corresponding \fImodule\fR are matched. The \fB-m\fR argument can be suffixed with an optional D
probe clause. More than one \fB-m\fR option can be specified on the command line at a time.
Specify probe name to trace or list (\fB-l\fR option). The corresponding argument can include any of the probe description forms \fIprovider:module:function:name\fR, \fImodule:function:name\fR, \fIfunction:name\fR,
or \fIname\fR. Unspecified probe description fields are left blank and match any probes regardless of the values in those fields. If no qualifiers other than \fIname\fR are specified in the description, all probes with a corresponding \fIname\fR are
matched. The \fB-n\fR argument can be suffixed with an optional D probe clause. More than one \fB-n\fR option can be specified on the command line at a time.
.RE
.sp
.ne2
.mk
.na
\fB\fB-o\fR\fIoutput\fR\fR
.ad
.sp.6
.RS4n
Specify the \fIoutput\fR file for the \fB-A\fR , \fB-G\fR, and \fB-l\fR options, or for the traced data itself. If the \fB-A\fR option is present and \fB-o\fR is not present, the default output file is \fB/kernel/drv/dtrace.conf\fR. If the \fB-G\fR option is present and the \fB-s\fR option's argument is of the form \fB\fIfilename\fR.d\fR and \fB-o\fR is not present, the default output file is \fB\fIfilename\fR.o\fR.
Otherwise the default output file is \fBd.out\fR.
.RE
.sp
.ne2
.mk
.na
\fB\fB-p\fR\fIpid\fR\fR
.ad
.sp.6
.RS4n
Grab the specified process-ID \fIpid\fR, cache its symbol tables, and exit upon its completion. If more than one \fB-p\fR option is present on the command line, \fBdtrace\fR exits when all commands have exited, reporting the exit status
for each process as it terminates. The first process-ID is made available to any D programs specified on the command line or using the \fB-s\fR option through the \fB$target\fR macro variable. Refer to the \fISolaris Dynamic Tracing Guide\fR for
Specify provider name to trace or list (\fB-l\fR option). The remaining probe description fields module, function, and name are left blank and match any probes regardless of the values in those fields. The \fB-P\fR argument can be suffixed with an optional D
probe clause. You can specify more than one \fB-P\fR option on the command line at a time.
.RE
.sp
.ne2
.mk
.na
\fB\fB-q\fR\fR
.ad
.sp.6
.RS4n
Set quiet mode. \fBdtrace\fR suppresses messages such as the number of probes matched by the specified options and D programs and does not print column headers, the CPU ID, the probe ID, or insert newlines into the output. Only data traced and formatted by D program
statements such as \fBtrace()\fR and \fBprintf()\fR is displayed to \fBstdout\fR.
.RE
.sp
.ne2
.mk
.na
\fB\fB-s\fR\fR
.ad
.sp.6
.RS4n
Compile the specified D program source file. If the \fB-e\fR option is present, the program is compiled but instrumentation is not enabled. If the \fB-l\fR option is present, the program is compiled and the set of probes matched by it is listed, but instrumentation
is not enabled. If none of \fB-e\fR, \fB-l\fR, \fB-G\fR, or \fB-A\fR are present, the instrumentation specified by the D program is enabled and tracing begins.
.RE
.sp
.ne2
.mk
.na
\fB\fB-S\fR\fR
.ad
.sp.6
.RS4n
Show D compiler intermediate code. The D compiler produces a report of the intermediate code generated for each D program to \fBstderr\fR.
.RE
.sp
.ne2
.mk
.na
\fB\fB-U\fR\fIname\fR\fR
.ad
.sp.6
.RS4n
Undefine the specified \fIname\fR when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option). This option passes the \fB-U\fR option to each \fBcpp\fR invocation.
.RE
.sp
.ne2
.mk
.na
\fB\fB-v\fR\fR
.ad
.sp.6
.RS4n
Set verbose mode. If the \fB-v\fR option is specified, \fBdtrace\fR produces a program stability report showing the minimum interface stability and dependency level for the specified D programs. DTrace stability levels are explained in further detail in the \fISolaris Dynamic Tracing Guide\fR.
.RE
.sp
.ne2
.mk
.na
\fB\fB-V\fR\fR
.ad
.sp.6
.RS4n
Report the highest D programming interface version supported by \fBdtrace\fR. The version information is printed to \fBstdout\fR and the \fBdtrace\fR command exits. Refer to the \fISolaris Dynamic Tracing Guide\fR for
more information about DTrace versioning features.
.RE
.sp
.ne2
.mk
.na
\fB\fB-w\fR\fR
.ad
.sp.6
.RS4n
Permit destructive actions in D programs specified using the \fB-s\fR, \fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options. If the \fB-w\fR option is not specified, \fBdtrace\fR does not
permit the compilation or enabling of a D program that contains destructive actions.
.RE
.sp
.ne2
.mk
.na
\fB\fB-x\fR\fIarg\fR [\fI=val\fR]\fR
.ad
.sp.6
.RS4n
Enable or modify a DTrace runtime option or D compiler option. The list of options is found in the \fISolaris Dynamic Tracing Guide\fR. Boolean options are enabled by specifying their name. Options with values are set by separating the option name and
value with an equals sign (\fB=\fR).
.RE
.sp
.ne2
.mk
.na
\fB\fB-X\fR\fBa | c | s | t\fR\fR
.ad
.sp.6
.RS4n
Specify the degree of conformance to the ISO C standard that should be selected when invoking \fBcpp\fR(1) (enabled using the \fB-C\fR option).
The \fB-X\fR option argument affects the value and presence of the \fB__STDC__\fR macro depending upon the value of the argument letter.
.sp
The \fB-X\fR option supports the following arguments:
.sp
.ne2
.mk
.na
\fB\fBa\fR\fR
.ad
.RS5n
.rt
Default. ISO C plus K&R compatibility extensions, with semantic changes required by ISO C. This is the default mode if \fB-X\fR is not specified. The predefined macro \fB__STDC__\fR has a value of 0 when \fBcpp\fR is invoked in conjunction
with the \fB-Xa\fR option.
.RE
.sp
.ne2
.mk
.na
\fB\fBc\fR\fR
.ad
.RS5n
.rt
Conformance. Strictly conformant ISO C, without K&R C compatibility extensions. The predefined macro \fB__STDC__\fR has a value of 1 when \fBcpp\fR is invoked in conjunction with the \fB-Xc\fR option.
.RE
.sp
.ne2
.mk
.na
\fB\fBs\fR\fR
.ad
.RS5n
.rt
K&R C only. The macro \fB__STDC__\fR is not defined when \fBcpp\fR is invoked in conjunction with the \fB-Xs\fR option.
.RE
.sp
.ne2
.mk
.na
\fB\fBt\fR\fR
.ad
.RS5n
.rt
Transition. ISO C plus K&R C compatibility extensions, without semantic changes required by ISO C. The predefined macro \fB__STDC__\fR has a value of 0 when \fBcpp\fR is invoked in conjunction with the \fB-Xt\fR option.
.RE
As the \fB-X\fR option only affects how the D compiler invokes the C preprocessor, the \fB-Xa\fR and \fB-Xt\fR options are equivalent from the perspective of D and both are provided only to ease re-use of settings from a C build environment.
.sp
Regardless of the \fB-X\fR mode, the following additional C preprocessor definitions are always specified and valid in all modes:
.RS+4
.TP
.iet\(bu
.elo
\fB__sun\fR
.RE
.RS+4
.TP
.iet\(bu
.elo
\fB__unix\fR
.RE
.RS+4
.TP
.iet\(bu
.elo
\fB__SVR4\fR
.RE
.RS+4
.TP
.iet\(bu
.elo
\fB__sparc\fR (on SPARC systems only)
.RE
.RS+4
.TP
.iet\(bu
.elo
\fB__sparcv9\fR (on SPARC systems only when 64-bit programs are compiled)
.RE
.RS+4
.TP
.iet\(bu
.elo
\fB__i386\fR (on x86 systems only when 32-bit programs are compiled)
.RE
.RS+4
.TP
.iet\(bu
.elo
\fB__amd64\fR (on x86 systems only when 64-bit programs are compiled)
.RE
.RS+4
.TP
.iet\(bu
.elo
\fB__\fI`uname -s`\fR_\fI`uname -r`\fR\fR (for example, \fB__SunOS_5_10\fR)
.RE
.RS+4
.TP
.iet\(bu
.elo
\fB__SUNW_D=1\fR
.RE
.RS+4
.TP
.iet\(bu
.elo
\fB__SUNW_D_VERSION=0x\fIMMmmmuuu\fR\fR
.sp
Where \fIMM\fR is the major release value in hexadecimal, \fImmm\fR is the minor release value in hexadecimal, and \fIuuu\fR is the
micro release value in hexadecimal. Refer to the \fISolaris Dynamic Tracing Guide\fR for more information about DTrace versioning.
.RE
.RE
.sp
.ne2
.mk
.na
\fB\fB-Z\fR\fR
.ad
.sp.6
.RS4n
Permit probe descriptions that match zero probes. If the \fB-Z\fR option is not specified, \fBdtrace\fR reports an error and exits if any probe descriptions specified in D program files (\fB-s\fR option) or on the command line (\fB-P\fR, \fB-m\fR, \fB-f\fR, \fB-n\fR, or \fB-i\fR options) contain descriptions that do not match any known probes.
.RE
.SHOPERANDS
.sp
.LP
You can specify zero or more additional arguments on the \fBdtrace\fR command line to define a set of macro variables (\fB$1\fR, \fB$2\fR, and so forth). The additional arguments can be used in D programs specified using the \fB-s\fR option
or on the command line. The use of macro variables is described further in the \fISolaris Dynamic Tracing Guide\fR.
.SHEXITSTATUS
.sp
.LP
The following exit values are returned:
.sp
.ne2
.mk
.na
\fB0\fR
.ad
.RS5n
.rt
Successful completion.
.sp
For D program requests, an exit status of \fB0\fR indicates that programs were successfully compiled, probes were successfully enabled, or anonymous state was successfully retrieved. \fBdtrace\fR returns \fB0\fR even if the specified tracing requests
encountered errors or drops.
.RE
.sp
.ne2
.mk
.na
\fB\fB1\fR\fR
.ad
.RS5n
.rt
An error occurred.
.sp
For D program requests, an exit status of \fB1\fR indicates that program compilation failed or that the specified request could not be satisfied.
.RE
.sp
.ne2
.mk
.na
\fB\fB2\fR\fR
.ad
.RS5n
.rt
Invalid command line options or arguments were specified.
.RE
.SHATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
.sp
.TS
tab() box;
cw(2.75i) |cw(2.75i)
lw(2.75i) |lw(2.75i)
.
ATTRIBUTE TYPEATTRIBUTE VALUE
_
AvailabilitySUNWdtrc
_
Interface StabilitySee below.
.TE
.sp
.LP
The command-line syntax is Committed. The human-readable output is Uncommitted.
Loaded 100 of 9031 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.