pfg [Sat, 22 Jun 2013 02:22:12 +0000 (02:22 +0000)]
MFC r251212, r251480:
GCC: bring back experimental support for amdfam10/barcelona CPUs.
This is a revised subset of the support initially brought in in r236962
and later reverted. The collateral efects seem to have disappeared but
it is still recommended to set the CPUTYPE with caution.
While here also install AMD intrinsics header ammintrin.h
gnn [Fri, 21 Jun 2013 21:38:48 +0000 (21:38 +0000)]
MFC: 249514
Point args[0] not at the thread that is ending but at the one that
is starting. This is in line with practice in OpenSolaris.
Note that this change is only in ULE and not in the 4BSD scheduler.
Once this change settles in (MFC timeout has expired) we'll try it out
on 4BSD as well.
rmacklem [Fri, 21 Jun 2013 20:16:41 +0000 (20:16 +0000)]
MFC: r251444, r251476
Add a "-v" (verbose) option to the gssd daemon, to help
with diagnosis of kerberized NFS mount problems. When set,
messages are sent to syslog() (or fprintf(stderr,...) if
"-d" is also specified) to indicate activity/results of
kgssapi upcalls.
jhb [Fri, 21 Jun 2013 19:28:58 +0000 (19:28 +0000)]
MFC 251637:
Borrow the algorithm from kvm_getprocs() to fix procstat_getprocs() to
handle the case where the process tables grows in between the calls to
fetch the size and fetch the table.
jhb [Thu, 20 Jun 2013 19:56:26 +0000 (19:56 +0000)]
MFC 251617:
Store a reference to the vnode associated with a file descriptor in the
linux_file structure and use it instead of directly accessing td_fpop
when destroying the linux_file structure. The td_fpop pointer is not
valid when a cdevpriv destructor is run, and the type-specific close
method has already been called, so f_vnode may not be valid (and the
vnode might have been recycled without our own reference).
gahr [Thu, 20 Jun 2013 16:51:25 +0000 (16:51 +0000)]
MFC: r249406
- Do not bail out if stat(2) fails with ENOENT in the spool directory. This
happens if another atrm process removes a job while we're scanning through
the directory.
- While at it, optimize a bit the directory scanning, so that we quit
looping as soon as all jobs specified in argv have been dealt with.
hrs [Thu, 20 Jun 2013 07:23:04 +0000 (07:23 +0000)]
MFC r250251:
Use FF02:0:0:0:0:2:FF00::/104 prefix for IPv6 Node Information Group
Address. Although KAME implementation used FF02:0:0:0:0:2::/96 based on
older versions of draft-ietf-ipngwg-icmp-name-lookup, it has been changed
in RFC 4620.
The kernel always joins the /104-prefixed address, and additionally does
/96-prefixed one only when net.inet6.icmp6.nodeinfo_oldmcprefix=1.
The default value of the sysctl is 1.
ping6(8) -N flag now uses /104-prefixed one. When this flag is specified
twice, it uses /96-prefixed one instead.
Reviewed by: ume
Based on work by: Thomas Scheffler
PR: conf/174957
jh [Wed, 19 Jun 2013 18:00:00 +0000 (18:00 +0000)]
MFC r251485:
Revert r238399.
The "failok" option doesn't have any effect at all unless specified in
fstab(5) and combined with the -a flag. The "failok" option is already
documented in fstab(5).
marius [Wed, 19 Jun 2013 15:12:10 +0000 (15:12 +0000)]
MFC: r238172 (partial)
Don't use Maxmem when the amount of memory is meant. Use realmem instead.
Maxmem is not only a MD variable, it represents the highest physical memory
address in use. On systems where memory is sparsely layed-out the highest
memory address and the amount of memory are not interchangeable. Scaling the
AGP aperture based on the actual amount of memory (= realmem) rather than
the available memory (= physmem) makes sure there's consistent behaviour
across architectures.
scottl [Wed, 19 Jun 2013 04:57:47 +0000 (04:57 +0000)]
Tweak the CAM_DATA flags that were added with r251874 to allow source
compatibility and almost 100% binary compatibility. The old
CAM_SG_LIST_PHYS flag is essentially lost in binary compatibility for
legacy SIM drivers. The use of this flag is excedingly rare.
gibbs [Tue, 18 Jun 2013 23:14:21 +0000 (23:14 +0000)]
MFC Xen fixes:
svn rev 250081 Author:gibbs Date:2013-04-29T23:08:13.552620Z
==============
xenstore/xenstore.c:
Prevent access to invalid memory region when listing an empty
directory in the XenStore.
Reported by: Bei Guan
svn rev 250913 Author:gibbs Date:2013-05-22T17:13:03.545339Z
==============
Correct panic on detach of Xen PV network interfaces.
dev/xen/netfront:
In netif_free(), properly stop the interface and drain any pending
timers prior to disconnecting from the backend device.
Remove all media and detach our interface object from the system
prior to deleting it.
svn rev 250917 Author:gibbs Date:2013-05-22T19:22:44.923351Z
==============
Fix loss of the emulated keyboard on Xen PV HVM domains.
xen/xenbus/xenbusb.c:
In xenbusb_probe_children(), do not modify the XenBus state of
devices for which we have no PV driver support. An emulated device
we do support may share this backend. Hide the node from XenBus
instead.
This prevents closing the vkbd device, which Qemu's emulated keyboard
device is using as the source for keyboard events.
Tested with qemu-xen-traditional, qemu-xen and qemu stubdomains, all
working as expected.
svn rev 251175 Author:gibbs Date:2013-05-31T04:43:19.944993Z
==============
Apply the ad* => ada* IDE device name transition to the Xen block
front driver.
svn rev 251729 Author:gibbs Date:2013-06-14T03:31:11.033200Z
==============
sys/dev/xen/netfront/netfront.c:
In netif_free(), call ifmedia_removeall() after ether_ifdetach()
so that bpf listeners are detached, any link state processing
is completed, and there is no chance for external reference to media
information.
marius [Tue, 18 Jun 2013 21:14:05 +0000 (21:14 +0000)]
MFC: r238184
Hide the creation of phys_avail behind an API to make it easier to do it
correctly. We now iterate the EFI memory descriptors once and collect all
the information in a single pass.
marius [Tue, 18 Jun 2013 15:17:29 +0000 (15:17 +0000)]
MFC: r245263
Clang complains about the comparision of fak < 0 always being
false. It is right. Delete it because on the next line we catch all
'negative' cases with the test > 2, since 'negative' numbers are just
really big unsigned numbers and we do an identical action.
marius [Tue, 18 Jun 2013 15:06:02 +0000 (15:06 +0000)]
MFC: r247264
Turn off fast posting for the ISP2100- I'd forgotten that it actually
might have been enabled for them- now that we use all 32 bits of handle.
Fast Posting doesn't pass the full 32 bits.
marius [Tue, 18 Jun 2013 14:35:09 +0000 (14:35 +0000)]
MFC: r247165
Fix command timeout caused by data underrun during fetching ATAPI sense
data, introduced by r246713 (MFC'ed to stable/9 in r251874). There are two
places where ata_request is filled in ATA_CAM: ata_cam_begin_transaction()
and ata_cam_request_sense(). In the first case DMA should be done for
addresses from the CCB. In second case, DMA should be done to the different
address, the address of the sense buffer inside the CCB structure itself.
marius [Tue, 18 Jun 2013 14:20:14 +0000 (14:20 +0000)]
MFC: r248804
deferal -> deferral
MFC: r248891
Pass correct parameter to CTR5() in bus_dmamap_load_uio.
MFC: r248892
Do not add 1 to nsegs before passing to CTR5(), since nsegs
has already been incremented before these calls.
MFC: r248893
Add CTR5() to bus_dmamap_load_ccb, similar to other bus_dmamap_load_*
functions.
MFC: r248896
Add bus_dmamap_load_bio for non-CAM disk drivers that wish to enable
unmapped I/O.
MFC: r249025
Add support for XPT_CONT_TARGET_IO CCBs in _bus_dmamap_load_ccb().
Declare CCB types in their respective switch blocks.
MFC: r249538
Some compilers issue a warning when wider integer is casted to narrow
pointer. Supposedly shut down the warning by casting through
uintptr_t.
MFC: r251221
Move an assertion to the right spot; only bus_dmamap_load_mbuf(9)
requires a pkthdr being present but that's not the case for either
_bus_dmamap_load_mbuf_sg() or bus_dmamap_load_mbuf_sg(9).
mav [Tue, 18 Jun 2013 13:38:10 +0000 (13:38 +0000)]
MFC r248583 (by kib):
Fix twa(4) after the r246713. The driver copies data around to
satisfy some alignment restrictions. Do not set TW_OSLI_REQ_FLAGS_CCB
flag for mapped data, pass the csio->data_ptr in the req->data.
Do not put the ccb pointer into req->data ever, ccb is stored in
req->orig_req already.
mav [Tue, 18 Jun 2013 09:47:56 +0000 (09:47 +0000)]
MFC r251616:
Don't update provider properties and don't set DISKFLAG_OPEN if d_open()
disk method call returned error. GEOM considers devices in such case as
still closed, and won't call symmetric d_close() for them.
mav [Tue, 18 Jun 2013 09:39:52 +0000 (09:39 +0000)]
MFC r248722:
geom_slice.c and its consumers like GEOM_LABEL are not touching the data
unless hotspots are used. Pass G_PF_ACCEPT_UNMAPPED flag through except
such rare cases (obsolete GEOM_SUNLABEL and GEOM_BSD).
mav [Tue, 18 Jun 2013 09:31:06 +0000 (09:31 +0000)]
MFC r248696:
Make GEOM MULTIPATH to report unmapped bio support if underling path report
it. GEOM MULTIPATH itself never touches the data and so transparent.
mav [Tue, 18 Jun 2013 09:26:01 +0000 (09:26 +0000)]
MFC r248295 (by pjd):
We don't need buffer to handle BIO_DELETE, so don't check buffer size for it.
This fixes handling BIO_DELETE larger than MAXPHYS.
mav [Tue, 18 Jun 2013 09:21:21 +0000 (09:21 +0000)]
MFC r248068 (by sbruno):
Add legacy support to geom raid to create a /dev/arX device for support
of upgrading older machines using ataraid(4) to newer releases.
This optional parameter is controlled via kern.geom.raid.legacy_aliases
and will create a /dev/ar0 device that will point at /dev/raid/r0 for
example.
Tested on Dell SC 1425 DDF-1 format software raid controllers installing from
stable/7 and upgrading to stable/9 without having to adjust /etc/fstab
des [Tue, 18 Jun 2013 07:04:19 +0000 (07:04 +0000)]
Fix a bug that allowed a tracing process (e.g. gdb) to write
to a memory-mapped file in the traced process's address space
even if neither the traced process nor the tracing process had
write access to that file.
Security: CVE-2013-2171
Security: FreeBSD-SA-13:06.mmap
Approved by: so
scottl [Tue, 18 Jun 2013 05:21:40 +0000 (05:21 +0000)]
Merge the second part of the unmapped I/O changes. This enables the
infrastructure in the block layer and UFS filesystem as well as a few
drivers. The list of MFC revisions is long, so I won't quote changelogs.
scottl [Tue, 18 Jun 2013 00:36:53 +0000 (00:36 +0000)]
Big MFC of the physbio changes necessary for unmapped I/O. These changes
have been in production at Netflix for several months with significant
success.
MFC r246713:
Reform the busdma API so that new types may be added without modifying
every architecture's busdma_machdep.c. It is done by unifying the
bus_dmamap_load_buffer() routines so that they may be called from MI
code. The MD busdma is then given a chance to do any final processing
in the complete() callback.
MFC r249538:
Some compilers issue a warning when wider integer is casted to narrow
pointer. Supposedly shut down the warning by casting through
uintptr_t.
MFC r251479:
Simplify the checking of flags for cam_periph_mapmem(). This gets rid of
a lot of code redundancy and grossness at very minor expense.
MFC r251837:
MFC r251842:
Add infrastructure for doing compatibility shims, as has been sorely
needed for the last 10 years. Far too much of the internal API is
exposed, and every small adjustment causes applications to stop working.
To kick this off, bump the API version to 0x17 as should have been done
with r246713, but add shims to compensate. Thanks to the shims, there
should be no visible change in application behavior.
scottl [Mon, 17 Jun 2013 23:21:18 +0000 (23:21 +0000)]
MFC r244575:
The manpage states that bus_dmamap_create(9) returns ENOMEM if it can't
allocate a map or mapping resources. That seems to imply that any memory
allocations it does must use M_NOWAIT and check for NULL.
MFC 246158:
Use pmap_kextract() instead of inlining the page table walk.
Remove the comment referencing non-existing code.
Submitted by: kib, cognet
Approved by: marius
Obtained from: Netflix
scottl [Mon, 17 Jun 2013 20:40:16 +0000 (20:40 +0000)]
MFC r240177:
Dynamically allocate the S/G lists passed to callback routines rather than
allocating them on the stack of various bus_dmamap_load*() functions. The
S/G lists are stored in the DMA tags. This matches the implementation on
all other platforms.
Submitted by: jhb
Approved by: marius, adrian
Obtained from: Netflix
brooks [Mon, 17 Jun 2013 19:54:47 +0000 (19:54 +0000)]
MFC r251689
Be more agressive about bootstrapping ctfmerge and ctfconvert so
builds from existing releases have a chance of working properly when
WITH_CLANG_IS_CC is enabled.
gnn [Mon, 17 Jun 2013 15:42:21 +0000 (15:42 +0000)]
MFC: 248848
Commit a patch that fixes a problem in the #pragma statement when searching
for and loading dependent modules. This addresses a bug seen with
io.d where it was being doubly included.
mav [Mon, 17 Jun 2013 14:55:02 +0000 (14:55 +0000)]
MFC r251661:
Replicate r242422 from ata(4) to mvs(4):
Only four specific ATA PIO commands transfer several sectors per DRQ block
(interrupt). All other ATA PIO commands transfer one sector or 512 bytes
at one time. Hardcode these exceptions in mvs(4).
This fixes timeout of READ LOG EXT command used by `smartctl -x /dev/adaX`.
Also it fixes timeout of DOWNLOAD_MICROCODE on `camcontrol fwdownload`.
mav [Mon, 17 Jun 2013 14:52:39 +0000 (14:52 +0000)]
MFC r251654, r251664:
Make CAM return and GEOM DISK pass through new GEOM::lunid attribute.
SPC-4 specification states that serial number may be property of device,
but not a specific logical unit. People reported about FC storages using
serial number in that way, making it unusable for purposes of LUN multipath
detection. SPC-4 states that designators associated with logical unit from
the VPD page 83h "Device Identification" should be used for that purpose.
Report first of them in the new attribute in such preference order: NAA,
EUI-64, T10 and SCSI name string.
While there, make GEOM DISK properly report GEOM::ident in XML output also
using d_getattr() method, if available. This fixes serial numbers reporting
for SCSI disks in `geom disk list` output and confxml.
mav [Mon, 17 Jun 2013 14:21:31 +0000 (14:21 +0000)]
MFC r249205:
Replicate r245306 from SCSI to ATA. The problem didn't appear so far,
covered by multilevel freeze mechanism, but it is better to be safe.
kib [Mon, 17 Jun 2013 06:21:42 +0000 (06:21 +0000)]
MFC r251322:
Instead of yielding, pause for 1 tick when donating the current thread
time to the owner of the vnode lock while iterating over the free vnode
list.
yongari [Mon, 17 Jun 2013 04:40:27 +0000 (04:40 +0000)]
MFC r251600:
Avoid unnecessary controller reinitialization by checking driver
running state. fxp(4) requires controller reinitialization for the
following cases.
o RX lockup condition on i82557
o promiscuous mode change
o multicast filter change
o WOL configuration
o TSO/VLAN hardware tagging/checksum offloading configuration
o MAC reprogramming after speed/duplex/flow-control resolution
o Any events that result in MAC reprogramming(link UP/DOWN,
remote link partner's restart of auto-negotiation etc)
o Microcode loading/unloading
Apart from above cases which come from hardware limitation, upper
stack also blindly reinitializes controller whenever an IP address
is assigned. After r194573, fxp(4) no longer needs to reinitialize
the controller to program multicast filter after upping the
interface. So keeping track of driver running state should remove
all unnecessary controller reinitializations.
This change will also address endless controller reinitialization
triggered by dhclient(8).
hrs [Sun, 16 Jun 2013 18:27:53 +0000 (18:27 +0000)]
MFC r245177,r245346,r246283,r251650:
- Set WITHOUT_SVN=yes for textproc/docproj.
- Add CHECKSUM.* support in Makefile.
- Use ln -fs to create a symlink.
- Remove pkgadd for docports.
- Use WITHOUT_JADETEX=yes instead of WITH_JADETEX=no.
- Add {WORLD,KERNEL}_FLAGS to [BTWK]MAKE.
- Use makefs(8) and gpart(8) for sparc64 ISO image.
- Add publisher option to makefs(8).
- Add missing copyright notice.
- ISO 9660 specification allows only "d-characters" and "a-characters"
in the Volume Descriptor (section 7.4). In short, uppercase
alphanumeric + some symbols only. While the makefs utility automatically
converts the characters, $LABEL should be consistent in the scripts.
These fix a specification violation in 9.X iso9660 images, and cdrtools
dependency and endianness issue for sparc64 release media. The label is
now in uppercase letters only in all platforms.
hrs [Sun, 16 Jun 2013 07:18:07 +0000 (07:18 +0000)]
MFC r251580:
- Add file system type number (vfc_typenum) in the list. This is useful
for debugging when changing vfs.typenumhash configuration.
- Refactor fmt_flags().
pfg [Sun, 16 Jun 2013 00:59:24 +0000 (00:59 +0000)]
MFC r251677:
Relax some unnecessary unsigned type changes in ext2fs.
While the changes in r245820 are in line with the ext2 spec,
the code derived from UFS can use negative values so it is
better to relax some types to keep them as they were, and
somewhat more similar to UFS. While here clean some casts.
jhb [Fri, 14 Jun 2013 21:56:10 +0000 (21:56 +0000)]
MFC 250220:
Fix FIONREAD on regular files. The computed result was being ignored and
it was being passed down to VOP_IOCTL() where it promptly resulted in
ENOTTY due to a missing else for the past 8 years. While here, use a
shared vnode lock while fetching the current file's size.
ghelmer [Fri, 14 Jun 2013 18:56:37 +0000 (18:56 +0000)]
MFC r244090, r250945
Changes to resolve races in bpfread() and catchpacket() that, at worst,
cause kernel panics.
Add a flag to the bpf descriptor to indicate whether the hold buffer
is in use. In bpfread(), set the "hold buffer in use" flag before
dropping the descriptor lock during the call to bpf_uiomove().
Everywhere else the hold buffer is used or changed, wait while
the hold buffer is in use by bpfread(). Add a KASSERT in bpfread()
after re-acquiring the descriptor lock to assist uncovering any
additional hold buffer races.
While waiting for the bpf hold buffer to become idle, check
the return value from mtx_sleep() and exit bpfread() on
errors such as EINTR.
jhb [Fri, 14 Jun 2013 18:30:43 +0000 (18:30 +0000)]
MFC 249767:
- Some BIOSes use an Extended IRQ resource descriptor in _PRS for a link
that uses non-ISA IRQs but use a plain IRQ resource in _CRS. However,
a non-ISA IRQ can't fit into a plain IRQ resource. If we encounter a
link like this, build the resource buffer from _PRS instead of _CRS.
- Set the correct size of the end tag in a resource buffer.
pfg [Fri, 14 Jun 2013 02:51:03 +0000 (02:51 +0000)]
MFC r251561:
libstand: Reset the seek pointer in ext2fs as done in UFS.
Reset the seek pointer to 0 when a file is successfully opened,
since otherwise the initial seek offset will contain the directory
offset of the filesystem block that contained its directory entry.
This bug was mostly harmless because typically the directory is
less than one filesystem block in size so the offset would be zero.
It did however generally break loading a kernel from the (large)
kernel compile directory.
Also reset the seek pointer when a new inode is opened in read_inode(),
though this is not actually necessary now because all callers set
it afterwards.
PR: 177328
Submitted by: Eric van Gyzen
Reviewed by: iedowse
hrs [Fri, 14 Jun 2013 02:21:32 +0000 (02:21 +0000)]
MFC 228990,243232,243233:
Overhaul of route6d(8):
- Use queue(3) for linked-list.
- Use a consistent naming scheme for struct members.
- Use ANSI C style function declaration.
- Add check of RTM_VERSION mismatch.
- Increase the number of retry for NET_RT_DUMP from 5 to 15.
- Use 2001:db8:: as an example instead of deprecated 3ffe:: address block.
- Add check for connected routes.
- Add support of RTM_IFANNOUNCE for dyanmically-added/removed interfaces.
- Add support of *, ?, and [ in the interface list.
- Add -P number to specify route flag which will never expire.
- Add -Q number to specify route flag which route6d will add to routes via RIP.
- Add -p pidfile to specify the process ID file.
jhb [Thu, 13 Jun 2013 20:29:06 +0000 (20:29 +0000)]
MFC 249315:
Proxy allocation requests for the PCI ROM BAR from child devices similar
to how the VGA bus driver currently proxies allocation requests for other
PCI BARs.