Commit Graph

97822 Commits

Author SHA1 Message Date
Nathan Whitehorn
40adc3db02 Fix buildworld. I had some local bits in my build tree that caused this
to work by accident.
2014-04-13 06:24:01 +00:00
Warner Losh
3bdf775801 NO_MAN= has been deprecated in favor of MAN= for some time, go ahead
and finish the job. ncurses is now the only Makefile in the tree that
uses it since it wasn't a simple mechanical change, and will be
addressed in a future commit.
2014-04-13 05:21:56 +00:00
Davide Italiano
2f9e29745c Fix a panic in zfs_rename().
this is due to a wrong dereference of a vnode when it's not locked and
can be (potentially) recycled. 'sdvp' cannot be locked on zfs_rename()
entry point because the VFS can't be sure that this scenario is
LOR-free (it might violate the parent->child lock acquisition rule).
Dereference 'tdvp' instead, which is already locked on entry, and access
'sdvp' fields only when it's safe, i.e. under ZFS_ENTER scope.

While at it, remove the usage of VOP_REALVP, as long as this is a NOP
on FreeBSD.

Discussed with:	avg
Reviewed by:	pjd
2014-04-13 01:15:37 +00:00
Nathan Whitehorn
337bb26472 Add a simple EFI stub loader. This is a quick and dirty of boot1.chrp from
the PowerPC port with all the Open Firmware bits removed and replaced by
their EFI counterparts. On the whole, I think I prefer Open Firmware.

This code is supposed to be an immutable shim that sits on the EFI system
partition, loads /boot/loader.efi from UFS and tells the real loader what
disk/partition to look at. It finds the UFS root partition by the somewhat
braindead approach of picking the first UFS partition it can find. Better
approaches are called for, but this works for now. This shim loader will
also be useful for secure boot in the future, which will require some
rearchitecture.
2014-04-13 01:14:25 +00:00
Rui Paulo
48e3689098 Fix the style of ata_interrupt_locked(). 2014-04-12 23:40:54 +00:00
Davide Italiano
4bc38a5ab0 Hide internal details of sbintime_t implementation wrapping INT64_MAX into
SBT_MAX, to make it more robust in case internal type representation will
change in the future. All the consumers were migrated to SBT_MAX and
every new consumer (if any) should from now use this interface.

Requested by:	bapt, jmg, Ryan Lortie (implictly)
Reviewed by:	mav, bde
2014-04-12 23:29:29 +00:00
Bryan Drewery
97c0df733f Use proper MFSNAMELEN for fs type.
MFC after:	2 weeks
Reviewed by:	rodrigc
Also spotted by:ambrisko
2014-04-12 21:39:17 +00:00
Marcel Moolenaar
4787115d04 Align and round the partitionable disk space to 4K by default.
Since this would also apply when recovering, make sure not to
align or round when that would have a partition fall outside
the partitionable area.
2014-04-12 20:28:39 +00:00
Andrey V. Elsukov
4fd913364f Properly release the in6_multi lock.
MFC after:	1 week
Sponsored by:	Yandex LLC
2014-04-12 02:05:31 +00:00
John Baldwin
b8c8c8c3c7 Some whitespace and style fixes.
Submitted by:	bde
2014-04-11 21:00:59 +00:00
Alexander Motin
1f6b2af297 Remove unused val argument value from SYSCTL_INT() calls. 2014-04-11 20:44:09 +00:00
Sean Bruno
739a93997c Fix insta-panic on assert of unlocked periph mtx in ciss(4) when
logical volume state changes.

Currently, I view this as a critical fix for users and will MFC this rapidly as
my testing has shown data loss when the disk is failed by removing it when
under some amount of write activity and this code panics the box.

Reviewed by:	mav@ scottl@
MFC after:	3 days
Sponsored by:	Yahoo! Inc.
2014-04-11 20:19:01 +00:00
Neel Natu
81d597b736 There is no need to save and restore the host's return address in the
'struct vmxctx'. It is preserved on the host stack across a guest entry
and exit and just restoring the host's '%rsp' is sufficient.

Pointed out by:	grehan@
2014-04-11 20:15:53 +00:00
John Baldwin
2ffb755cec The tw_pcbrele() function does not need the global timewait lock.
Submitted by:	Julien Charbon
Suggested by:	glebius
2014-04-11 19:17:45 +00:00
Alexander Motin
35263d6a48 Improve use of socket buffer upcalls.
Use soreadable()/sowriteable() in socket upcalls to avoid extra wakeups
until we have enough data to read or space to write.

Increase partial receive len from 1K to 128K to not wake up on every
received packet.

This significantly reduces locks congestion and CPU usage and improves
throughput for large I/Os on NICs without TSO and LRO.

Reviewed by:	trasz
Sponsored by:	iXsystems, Inc.
2014-04-11 18:26:08 +00:00
Tycho Nightingale
e0f210e6ef Account for the "plus 1" encoding of the CPUID Function 4 reported
core per package and cache sharing values.

Approved by:	grehan (co-mentor)
2014-04-11 18:19:21 +00:00
John Baldwin
9941de49ad Don't leak the TCP pcbinfo lock if a time wait connection is closed
in between grabbing a reference on the connection structure and obtaining
the pcbinfo lock.

Reviewed by:	Julien Charbon
2014-04-11 13:11:43 +00:00
Alexander Motin
f6e1dc83c3 Create zvol devices on zfs clone.
While big and shiny patch is not ready, it is better to have something.

PR:		kern/178999
MFC after:	1 week
2014-04-11 11:56:16 +00:00
Hans Petter Selasky
67eb1bdac2 Correct IMOD default value according to comment.
Reported by:	Daniel O'Connor <doconnor@gsoft.com.au>
MFC after:	1 week
2014-04-11 08:25:54 +00:00
Justin Hibbits
181ca73b1a Small performance optimization. Clobber only cr0, rather than the entire CR.
Discussed with:	rdivacky,nwhitehorn
MFC after:	3 weeks
2014-04-11 06:17:44 +00:00
Marius Strobl
bdc8dbd208 Refine r264257; given that I later on decided to nuke the wildcard for
the Sunix 0x1999 line of chips there actually is no need to explicitly
keep puc(4) from attaching to the single port version anymore.
2014-04-10 21:03:46 +00:00
Peter Grehan
201b1ccc22 Rework r264179.
- remove redundant code
- remove erroneous setting of the error return
  in vmmdev_ioctl()
- use style(9) initialization
- in vmx_inject_pir(), document the race condition
  that the final conditional statement was detecting,

Tested with both gcc and clang builds.

Reviewed by:	neel
2014-04-10 19:15:58 +00:00
Bruce M Simpson
d565e5f206 In if_freemulti(), relax the paranoid KASSERT() on ifma->ifma_protospec.
This KASSERT() existed as a sanity check that upper layers in the network
stack (e.g. inet, inet6) had released their reference to the underlying
driver's multicast memberships (ifmultiaddr{}). However it assumes the
lifecycle of the driver membership corresponds to the lifecycle of the
network layer membership.

In the submitter's case, ieee80211_ioctl_updatemulti() attempts to
reprogram the (parent, physical) ifnet{} memberships in response
to a change in membership on the (child, virtual) VAP ifnet, using
a batched update mechanism. These updates happen independently from
the network layer, causing a "false negative" assertion failure.

There are possibly other use cases where this KASSERT() may be triggered
by other networking stack activity (e.g. where a nesting relationship
exists between multiple ifnet{} instances). This suggests that further
review of FreeBSD's approach to nested ifnet relationships is needed.

MFC after:	6 weeks
Submitted by:	adrian@
2014-04-10 18:43:02 +00:00
John Baldwin
66eefb1eae Currently, the TCP slow timer can starve TCP input processing while it
walks the list of connections in TIME_WAIT closing expired connections
due to contention on the global TCP pcbinfo lock.

To remediate, introduce a new global lock to protect the list of
connections in TIME_WAIT.  Only acquire the TCP pcbinfo lock when
closing an expired connection.  This limits the window of time when
TCP input processing is stopped to the amount of time needed to close
a single connection.

Submitted by:	Julien Charbon <jcharbon@verisign.com>
Reviewed by:	rwatson, rrs, adrian
MFC after:	2 months
2014-04-10 18:15:35 +00:00
Bryan Drewery
1e4b22b44b Fix spelling error in g_trace() call.
Sponsored by:	EMC / Isilon Storage Division
MFC after:	1 week
2014-04-10 17:00:44 +00:00
Ed Maste
7a5f5e3794 Fix EFI loader object tree creation on 9.x build hosts
Previously ${COMPILER_TYPE} was checked in sys/boot/amd64, and the efi
subdirectory was skipped altogether for gcc (since GCC does not support
a required attribute).  However, during the early buildworld stages
${COMPILER_TYPE} is the existing system compiler (i.e., gcc on 9.x build
hosts), not the compiler that will eventually be used.  This caused
"make obj" to skip the efi subdirectory.  In later build stages
${COMPILER_TYPE} is "clang", and then the efi loader would attempt to
build in the source directory.

Sponsored by:	The FreeBSD Foundation
2014-04-10 16:53:21 +00:00
Alexander Motin
1229e83d2b Fix wrong sizes used to access PD_Type and PD_State DDF metadata fields.
This caused incorrect behavior of arrays with big-endian DDF metadata.
Little-endian (like used by Adaptec controllers) should not be harmed.
Add workaround should be enough to manage compatibility.

MFC after:	2 weeks
2014-04-10 16:00:33 +00:00
Kevin Lo
ed8023f58b Add the Asus USB-N10 NANO.
Tested by:	Kuan-Chung Chiu <buganini@gmail.com>
2014-04-10 14:37:37 +00:00
Alexander Motin
66b92c07fe Do not increment bio_data in case of BIO_DELETE.
This fixes KASSERT() panic in g_io_request().
2014-04-10 10:12:56 +00:00
Steven Hartland
43d0f063c2 Fix build breakage caused by r264295
X-MFC-With: r264295
MFC after:	1 week
2014-04-10 05:04:23 +00:00
David Xu
7d62aec6fe Add kqueue support for devctl.
Reviewed by:	kib,mjg
2014-04-10 02:30:51 +00:00
Alexander Motin
7081bb15b0 Fix three refcounter leaks and lock recursion they covered.
MFC after:	1 week
2014-04-09 19:16:40 +00:00
Sean Bruno
84cb72d1c6 Really, really, really only allow this option for amd64/i386 builds.
Submitted by:	imp@ and tinderbox
2014-04-09 18:44:54 +00:00
Alexander Motin
004008d6e6 Introduce new serialization type CTL_SERIDX_UNMAP.
Unfortunately we can't check range collisions for UNMAP commands alike
to writes, because they include multiple ranges, which are also passed
in data block, not in CDB.  As result, UNMAP commands have to be treated
as colliding with any other command accessing the media.

From the other side all UNMAPs are equal (we don't support ANCHOR flag),
so we can execute several UNMAPs same time.
2014-04-09 10:58:52 +00:00
Alexander Motin
8f5a226a3c When splitting huge unmap requests, do it on sector boundary. 2014-04-09 10:44:09 +00:00
Alexander Motin
b8a8ed5664 Remove support of LUN-based CD changers from cd(4) driver.
This code was heavily broken few months ago during CAM locking changes.
Fixing it would require almost complete rewrite.  Since there are no
known devices on market using this interface younger then ~15 years, and
they are CD, not even DVD, I don't see much reason to rewrite it.

This change does not mean those devices won't work.  They will just work
slower due to inefficient disks load/unload schedule if several LUNs
accessed same time.

Discussed with:	ken@
Silence on:	scsi@, hardware@
MFC after:	1 week
2014-04-09 08:57:57 +00:00
Hans Petter Selasky
a955cde712 Fix for infinite XHCI reset loops when the set address USB request fails.
MFC after:	2 days
2014-04-09 06:27:04 +00:00
Pyun YongHyeon
a173db2d8c Add workaround for MCP61 Ethernet controller found on MSI K9
motherboard.  PHY hardware used for the controller responded at
all possible addresses which in turn resulted in having 32 PHYs
for the controller.  If driver detects "MSI K9N6PGM2-V2 (MS-7309)"
motherboard, tell miibus(4) PHY is located at 0.

Tested by:	Chris H
2014-04-09 05:15:40 +00:00
Adrian Chadd
6ed22fae0a Add a function to check whether the given register can be accessed whilst
the chip is asleep.

It's AR5416 and later specific; I'll add a HAL method to generalise it
later.

Tested:

* AR5416, STA mode
2014-04-09 03:51:05 +00:00
Sean Bruno
4ab550cafe Spell imgact_binmisc correctly 2014-04-09 03:46:04 +00:00
Peter Wemm
eccee15da4 Bump osreldate for tracking SA-14:06 2014-04-09 01:26:58 +00:00
Alexander Motin
7e0be0226f Another fix for r264274. Last moment cosmetic changes are evil! 2014-04-08 22:36:39 +00:00
Sean Bruno
b888dae4c8 sys/kern/imgact_binmisc.c -- free the right pointer mask vs magic
sys/sys/imagact_binmisc.h -- cleanup white space tabs vs spaces
                          -- remove stray " in comment

Submitted by:	jmallett@
2014-04-08 22:12:01 +00:00
Sean Bruno
b434acb306 Actually, since this is what I thought I was doing, only allow the
binmisc code to be build on amd64/i386 for the kernel.

Update NOTES with some indication of what this code is used for.

Pointed out by jhb@ ... thanks!

Submitted by:	jhb@
2014-04-08 21:39:51 +00:00
Alexander Motin
f7ad1c4625 Oops! Few quick fixes for r264274. 2014-04-08 21:30:10 +00:00
Alexander Motin
ee7f31c068 Add support for SCSI UNMAP commands to CTL.
This patch adds support for three new SCSI commands: UNMAP, WRITE SAME(10)
and WRITE SAME(16).  WRITE SAME commands support both normal write mode
and UNMAP flag.  To properly report UNMAP capabilities this patch also adds
support for reporting two new VPD pages: Block limits and Logical Block
Provisioning.

UNMAP support can be enabled per-LUN by adding "-o unmap=on" to `ctladm
create` command line or "option unmap on" to lun sections of /etc/ctl.conf.

At this moment UNMAP supported for ramdisks and device-backed block LUNs.
It was tested to work great with ZFS ZVOLs.  For file-backed LUNs UNMAP
support is unfortunately missing due to absence of respective VFS KPI.

Reviewed by:	ken
MFC after:	1 month
Sponsored by:	iXsystems, Inc
2014-04-08 20:50:48 +00:00
Warner Losh
5e9d46791b Put proper ${} around variable expansion. This fixes the build on 9.2
with fmake (which complained). Not sure why bmake didn't complain though...
2014-04-08 20:10:57 +00:00
Sean Bruno
6d75644981 Add Stacey Son's binary activation patches that allow remapping of
execution to a emumation program via parsing of ELF header information.

With this kernel module and userland tool, poudriere is able to build
ports packages via the QEMU userland tools (or another emulator program)
in a different architecture chroot, e.g. TARGET=mips TARGET_ARCH=mips

I'm not connecting this to GENERIC for obvious reasons, but this should
allow the kernel module to be built by default and enable the building
of the userland tool (which automatically loads the kernel module).

Submitted by:	sson@
Reviewed by:	jhb@
2014-04-08 20:10:22 +00:00
Ed Maste
9e61717ac8 (Re)connect sys/boot/amd64 to the build
Sponsored by:	The FreeBSD Foundation
2014-04-08 19:19:58 +00:00
Xin LI
25bfde79d6 Fix NFS deadlock vulnerability. [SA-14:05]
Fix "Heartbleed" vulnerability and ECDSA Cache Side-channel
Attack in OpenSSL. [SA-14:06]
2014-04-08 18:27:32 +00:00