197971 Commits

Author SHA1 Message Date
mav
e99b295765 MFC r275459: Unify function names after r275458. 2014-12-18 08:32:56 +00:00
mav
510c6d695e MFC r275458:
Do not pre-allocate UNIT ATTENTIONs storage for every possible initiator.

Abusing ability of major UAs cover minor ones we may not account UAs for
inactive ports.  Allocate UAs storage for port and start accounting only
after some initiator from that port fetched its first POWER ON OCCURRED.

This reduces per-LUN CTL memory usage from >1MB to less then 100K.
2014-12-18 08:32:06 +00:00
mav
e998495ddf MFC r275455: Remove some unused code. 2014-12-18 08:31:13 +00:00
mav
ef698a8b3d MFC r275447:
Do not pre-allocate reservation keys memory for every possible initiator.

In configurations with many ports, like iSCSI, each LUN is typically
accessed only by limited subset of ports.  Allocating that memory on
demand allows to reduce CTL memory usage from 5.3MB/LUN to 1.3MB/LUN.
2014-12-18 08:30:28 +00:00
mav
a4403fd4b3 MFC r275405: Convert persis_offset from global variable to softc field. 2014-12-18 08:28:44 +00:00
mav
be8a551758 MFC r275404: Reduce code duplication by creating ctl_set_res_ua() helper. 2014-12-18 08:27:46 +00:00
mav
f47cf8ca42 MFC r275403: Removed unused variable and unify some names. 2014-12-18 08:27:00 +00:00
mav
08d09659c7 MFC r275365: Move ctlfe_onoffline() out of lock to let it sleep when needed.
Do some more other polishing while there.
2014-12-18 08:26:11 +00:00
mav
19cc556c2a MFC r275058: Coalesce last data move and command status for read commands.
Make CTL core and block backend set success status before initiating last
data move for read commands.  Make CAM target and iSCSI frontends detect
such condition and send command status together with data.  New I/O flag
allows to skip duplicate status sending on later fe_done() call.

For Fibre Channel this change saves one of three interrupts per read command,
increasing performance from 126K to 160K IOPS.  For iSCSI this change saves
one of three PDUs per read command, increasing performance from 1M to 1.2M
IOPS.

Sponsored by:   iXsystems, Inc.
2014-12-18 08:25:00 +00:00
mav
67f35b59b5 MFC r275032: Decouple datamove/done logic from CTL status set. 2014-12-18 08:23:59 +00:00
mav
347eb16c88 MFC r275009: Use ctl_set_success() instead of direct inlining. 2014-12-18 08:23:04 +00:00
mav
91695c330f MFC r274962: Replace home-grown CTL IO allocator with UMA.
Old allocator created significant lock congestion protecting its lists
of preallocated I/Os, while UMA provides much better SMP scalability.
The downside of UMA is lack of reliable preallocation, that could guarantee
successful allocation in non-sleepable environments.  But careful code
review shown, that only CAM target frontend really has that requirement.
Fix that making that frontend preallocate and statically bind CTL I/O for
every ATIO/INOT it preallocates any way.  That allows to avoid allocations
in hot I/O path.  Other frontends either may sleep in allocation context
or can properly handle allocation errors.

On 40-core server with 6 ZVOL-backed LUNs and 7 iSCSI client connections
this change increases peak performance from ~700K to >1M IOPS!  Yay! :)

Sponsored by:	iXsystems, Inc.
2014-12-18 08:22:16 +00:00
mav
bed1ef29db MFC r275475:
Decode some binary fields of Intel metadata.

Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2014-12-18 07:37:21 +00:00
dim
4e01cb7539 MFC r275759:
Pull in r221170 from upstream clang trunk (by Roman Divacky):

  Implement vaarg lowering for ppc32. Lowering of scalars and
  aggregates is supported. Complex numbers are not.

This adds va_args support for PowerPC (32 bit) to clang.

Reviewed by:	jhibbits
Differential Revision: https://reviews.freebsd.org/D1308
2014-12-17 21:36:45 +00:00
delphij
18a8a69694 MFC r275852: MFV r275844:
Fix unbound remote denial of service vulnerability.

Security:	FreeBSD-SA-14:30.unbound
Security:	CVE-2014-8602
Approved by:	so
2014-12-17 06:58:00 +00:00
jhb
9adaeb5452 MFC 273053:
Decode the arguments passed to _umtx_op().  In particular, decode the
opcode.
2014-12-16 21:57:55 +00:00
pfg
7cc43d5ff8 MFC r275553, r275612;
patch(1): Bring fixes from OpenBSD

Check fstat return value.  Use off_t for file size and offsets.
Avoid iterating over end of string.

Introduce strtolinenum to properly check line numbers while parsing:
no signs, no spaces, just digits, 0 <= x <= LONG_MAX

Properly validate line ranges supplied in diff file to prevent overflows.
Also fixes an out of boundary memory access because the resulting values
are used as array indices.

PR:		195436
Obtained from:	OpenBSD
2014-12-16 21:13:55 +00:00
pfg
8631101d5a MFC r275531, r275581, r275582;
patch(1): Small changes to sync with OpenBSD

Update OpenBSD CVS revision tag for our r255232.
Prefer setvbuf() to setlinebuf().
Small space changes, mostly to keep in sync with OpenBSD

Obtained from:	OpenBSD
2014-12-16 21:05:28 +00:00
jhb
adf7828a9b MFC 271635,271722:
- Only the manpage updates from 271635 are merged to give additional
  heads up for the stricter checks in 11, but the kernel in 10 remains
  permissive.
  - Fail with EINVAL if an invalid protection mask is passed to mmap().
  - Fail with EINVAL if an unknown flag is passed to mmap().
  - Fail with EINVAL if both MAP_PRIVATE and MAP_SHARED are passed to
    mmap().
  - Require one of either MAP_PRIVATE or MAP_SHARED for non-anonymous
    mappings.
- Remove mention of MAP_INHERIT.  It hasn't been implemented for thirteen
  years.
- Remove mention of unimplemented MAP_SWAP.  There are no future plans to
  implement it.
2014-12-16 20:05:10 +00:00
jhb
9dc1ff0ea4 MFC 272897:
Various fixes to stats:
- Read the counts of received, dropped, and transmitted management
  packets and add sysctl nodes for them.
- Fix the total octets received/transmitted to read all 64 bits of
  the counters.
- Add missing sysctl nodes for rlec, tncrs, fcruc, tor, and tot.
- Remove spurious spaces.
2014-12-16 19:45:56 +00:00
pfg
3933e2285a MFC r275645;
ext2fs: Fix old out-of-bounds access.

Overrunning buffer pointed to by (caddr_t)&oip->i_db[0] of 48 bytes by
passing it to a function which accesses it at byte offset 59 using
argument 60UL.

The issue was inherited from an older FFS implementation and
fixed there with by merging UFS2 in r98542. We follow the
FFS fix.

CID:		1007665
Discussed with:	bde
2014-12-16 18:45:31 +00:00
ae
3e533b7379 MFC r275394:
Remove unneded check. No need to do m_pullup to the size that we prepended.

Sponsored by:	Yandex LLC
2014-12-16 11:53:45 +00:00
ae
257146dad4 MFC r275393:
Remove unneded check. No need to do m_pullup to the size that we prepended.

MFC r275473:
  Fix style(9) and remove m_freem(NULL).
  Add XXX comment, it looks incorrect, because m_pkthdr.len is already
  incremented by M_PREPEND().

Sponsored by:	Yandex LLC
2014-12-16 11:45:33 +00:00
ae
6fc2bb76af MFC r275575:
key_getspacq() returns holding the spacq_lock. Unlock it in all cases.

Sponsored by:	Yandex LLC
2014-12-16 11:24:07 +00:00
sbruno
a82091426b Correct to the stable/10 commit in UPDATING and specify the correct ports/UPDATING
note.
2014-12-15 21:22:42 +00:00
andrew
498f8a6312 Revert r275778, gcc 4.2.1 doesn't handle -march=armv7. 2014-12-15 18:13:03 +00:00
sbruno
743cbe79f3 MFC r271982 and r271990 to support CentOS 6 ports. 2014-12-15 16:14:49 +00:00
kib
d05fefb955 MFC r275620:
Add functions syncer_suspend() and syncer_resume().

MFC r275637:
Remove local variable for real.
2014-12-15 11:05:53 +00:00
kib
679b472095 MFC r275619:
Check for bo_bufobj->bo_object for NULL and cache the value in local
variable to avoid NULL dereference in getnewbuf_reuse_bp(). The vnode
owning the buffer is not locked there.
2014-12-15 11:00:56 +00:00
kib
1eabc00156 MFC r275618:
Check for stop condition in nfsd threads.
2014-12-15 10:58:02 +00:00
kib
7ad7084d8f MFC r275617:
Do some refactoring and minor cleanups of the thread_single() code.
2014-12-15 10:50:26 +00:00
kib
014daa8f25 MFC r275616:
Thread waiting for the vfork(2)-ed child to exec or exit, must allow
for the suspension.

MFC r275683 (by andreast):
Fix build for powerpc(32|64) kernels.

MFC r275686 (by andreast):
Fix kernel build for booke.

r275639 (by andrew) is not merged, since arm/arm/syscall.c is not
present on the stable/10 branch, and arm/arm/trap.c already includes
sys/kernel.h.
2014-12-15 10:46:07 +00:00
kib
f3b24d37fe MFC r275615:
When process is exiting, check for suspension regardless of
multithreaded status of the process.
2014-12-15 10:29:02 +00:00
hselasky
2ff1bd7eec MFC r275606:
Add more U3G USB IDs.
2014-12-15 08:35:07 +00:00
hselasky
9b3fc5a494 MFC r275624:
Add port routing support for Wildcat Point.

PR:		195793
2014-12-15 08:26:36 +00:00
andrew
7f8f9c5128 MFC 275379:
Set the correct architecture when targeting ARMv7

Sponsored by:	ABT Systems Ltd
2014-12-14 18:51:13 +00:00
jilles
df71c47219 MFC r268576: sh: Correctly handle positional parameters beyond INT_MAX on
64-bit systems.

Currently, there can be no more than INT_MAX positional parameters. Make
sure to treat all higher ones as unset to avoid incorrect results and
crashes.

On 64-bit systems, our atoi() takes the low 32 bits of the strtol() and
sign-extends them.

On 32-bit systems, the call to atoi() returned INT_MAX for too high values
and there is not enough address space for so many positional parameters, so
there was no issue.

PR:		195918
2014-12-14 18:30:30 +00:00
andrew
af32fb7fce MFC 275564:
Use the unified syntax when generating assembly for clang. The clang 3.5
integrated assembler only accepts it.

Sponsored by:	ABT Systems Ltd
2014-12-14 18:28:01 +00:00
andrew
56edfadd1e MFC 275378:
Pull in the NetBSD global offset table handling code. Clang 3.5 creates
relocations the linker complains about.

Obtained from:	NetBSD
2014-12-14 18:23:30 +00:00
andrew
8889da9263 MFC 275337:
There is no need to use FUNC_END with aeabi_ldiv0 or aeabi_idiv0 as they
are aliases.

Sponsored by:	ABT Systems Ltd

MFC 275380:

Use the floating-point instruction on ARMv7 as the clang 3.5 integrated
assembler doesn't allow these two instructions to use co-processor 11.

Sponsored by:	ABT Systems Ltd
2014-12-14 18:01:09 +00:00
andrew
ab2a78a144 MFC 275415:
Allow the UAL APSR_nzcv format for the mrc and mrc2 instructions. The clang
integrated assembler only allows these forms so binutils will need to
support them.

Sponsored by:	ABT Systems Ltd

MFC 275584:

Fix mrc and mrc2 with APSR_nzcv. Binutils encodes it internally as 0 where
we need it to be set to 15 for it to be equivalent to r15.

Sponsored by:	ABT Systems Ltd
2014-12-14 17:38:43 +00:00
andrew
23e47daf28 MFC 275336:
Use llabs when getting the absolute value of a long long.

Sponsored by:	ABT Ststems Ltd
2014-12-14 17:28:02 +00:00
andrew
90fc0dee7a Clean up our ARM assembly:
MFC 275256:

Switch to the ARM unified assembly language as the clang integrated as only
supports it. Binutils supports it when the ".syntax unified" directive
is set.

Sponsored by:   ABT Systems Ltd

MFC 275264:

Update _ENTRY to use _EENTRY to reduce the common code.

MFC 275321:

Remove extra labels, ENTRY_NP already provides them.

Sponsored by:   ABT Systems Ltd

MFC 275322:

Correctly a few incorrect uses of ENTRY/EENTRY and END/EEND

Sponsored by:   ABT Systems Ltd

MFC 275416:

Fix the name of the coprocessor to include the "p" prefix, the clang
integrated assembler expects this.

Sponsored by:   ABT Systems Ltd

MFC 275418:

Switch to unified syntax so these can be built with clang 3.5.

Sponsored by:   ABT Systems Ltd

MFC 275519:

Add missing END macros to some of the xscale functions.

Sponsored by:   ABT Systems Ltd

MFC 275520:

Use the unified syntax in a few more assembly files

Sponsored by:   ABT Systems Ltd

MFC 275521:

Set the alignment to 4-bytes after a string as clang 3.5 can switch to
thumb mode if this is incorrect.

Sponsored by:   ABT Systems Ltd

MFC 275522:

Place the literal pool after a RET otherwise clang 3.5 tries to put it too
far away from a ldr psuedo instruction. With this clang will place the
literal value here where it's close enough to be loaded.

Sponsored by:   ABT Systems Ltd

MFC 275523:

Switch to an armv6k cpu, without this clang 3.5 complains "bx lr" is
unsupported as it needs a newer cpu.

Sponsored by:   ABT Systems Ltd

MFC 275524:

Switch to a .cpu directive. These will work when clang 3.5 is imported
where the .arch directive is a nop.

Sponsored by:   ABT Systems Ltd
2014-12-14 16:28:53 +00:00
andrew
041226eb03 MFC 275207:
We don't use the hypervisor interrupt, make it optional in the device tree.

Submitted by:   Julien Grall <julien.grall AT linaro.org>

MFC 275208:

Some device tree configurations place the generic timer under the root
of the tree and not under simplebus. Update the driver to handle this.

Submitted by:   Julien Grall <julien.grall AT linaro.org>
2014-12-14 15:41:56 +00:00
andrew
35401942c2 MFC 273927:
Move the definitions of the fdt functions from a uboot header to a new fdt
header. There is nothing in the fdt spec that ties it to U-Boot.

While here sort and fix the signature of fdt_setup_fdtp.

MFC 273934:

Start to allow platforms other than U-Boot to use the FDT code in loader by
moving U-Boot specific code from libfdt.a to a new libuboot_fdt.a. This
needs to be a new library for linking to work correctly.

Differential Revision:  https://reviews.freebsd.org/D1054
Reviewed by:    ian, rpaulo (earlier version)
2014-12-14 15:33:45 +00:00
andrew
26961b2547 MFC r273913:
Clean up the types of a few strings to make them const when they are never
written to.

MFC r273914:

The command name is a constant, use the correct type.
2014-12-14 15:03:11 +00:00
trasz
8a9a84f3d8 MFC r274495:
Add missing commas to .Xr.

Sponsored by:	The FreeBSD Foundation
2014-12-14 11:03:22 +00:00
kib
88eaa27723 MFC r275347:
Provide mutual exclusion between zone allocation/destruction and
uma_reclaim().
2014-12-14 09:34:55 +00:00
dim
3156db9097 MFC r275633:
Pull in r223171 from upstream llvm trunk (by Michael Zolotukhin):

  PR21302. Vectorize only bottom-tested loops.

  rdar://problem/18886083

This fixes a bug in the llvm vectorizer, which could sometimes cause
vectorized loops to perform an additional iteration, leading to possible
buffer overruns.  Symptoms of this, which are usually segfaults, were
first noticed when building gcc ports, here:

https://lists.freebsd.org/pipermail/freebsd-ports/2014-September/095466.html
https://lists.freebsd.org/pipermail/freebsd-toolchain/2014-September/001211.html

Since this fix is very important for ports, bump __FreeBSD_version to
make it easier for port maintainers to test whether the fix has been
applied.

Upstream PR:	http://llvm.org/PR21302
2014-12-13 12:14:26 +00:00
kib
8b3b3c8447 MFC r275513:
When the last reference on the vnode' vm object is dropped, read the
vp->v_vflag without taking vnode lock and without bypass.
2014-12-12 09:22:52 +00:00