Commit Graph

103684 Commits

Author SHA1 Message Date
Zbigniew Bodek
988b7f6045 Introduce ddb(4) support for ARM64
Obtained from: Semihalf
Reviewed by:   emaste
Sponsored by:  The FreeBSD Foundation
2015-04-27 09:12:54 +00:00
Alexander V. Chernikov
74b22066b0 Make rule table kernel-index rewriting support any kind of objects.
Currently we have tables identified by their names in userland
with internal kernel-assigned indices. This works the following way:

When userland wishes to communicate with kernel to add or change rule(s),
it makes indexed sorted array of table names
(internally ipfw_obj_ntlv entries), and refer to indices in that
array in rule manipulation.
Prior to committing new rule to the ruleset kernel
a) finds all referenced tables, bump their refcounts and change
 values inside the opcodes to be real kernel indices
b) auto-creates all referenced but not existing tables and then
 do a) for them.

Kernel does almost the same when exporting rules to userland:
 prepares array of used tables in all rules in range, and
 prepends it before the actual ruleset retaining actual in-kernel
 indexes for that.

There is also special translation layer for legacy clients which is
able to provide 'real' indices for table names (basically doing atoi()).

While it is arguable that every subsystem really needs names instead of
numbers, there are several things that should be noted:

1) every non-singleton subsystem needs to store its runtime state
somewhere inside ipfw chain (and be able to get it fast)
2) we can't assume object numbers provided by humans will be dense.

Existing nat implementation (O(n) access and LIST inside chain) is a
good example.

Hence the following:
* Convert table-centric rewrite code to be more generic, callback-based
* Move most of the code from ip_fw_table.c to ip_fw_sockopt.c
* Provide abstract API to permit subsystems convert their objects
  between userland string identifier and in-kernel index.
  (See struct opcode_obj_rewrite) for more details
* Create another per-chain index (in next commit) shared among all subsystems
* Convert current NAT44 implementation to use new API, O(1) lookups,
 shared index and names instead of numbers (in next commit).

Sponsored by:	Yandex LLC
2015-04-27 08:29:39 +00:00
Scott Long
710dc398a2 Small change in header order to allow this to compile.
Obtained from:	Netflix, Inc.
MFC after:	3 days
2015-04-27 07:38:46 +00:00
Gleb Smirnoff
fdf6290ea9 Fix memory leak.
PR:		199670
Reviewed by:	ae
2015-04-27 05:44:09 +00:00
Luiz Otavio O Souza
723af368a1 Pass the supplied buffer length instead of a fixed size. 2015-04-27 01:36:16 +00:00
Andrey V. Elsukov
a9b9f6b6c6 Make ipsec_in_reject() static. We use ipsec[46]_in_reject() instead.
Sponsored by:	Yandex LLC
2015-04-27 01:12:51 +00:00
Andrey V. Elsukov
3e92c37f32 Remove now unneded KEY_FREESP() for case when ipsec[46]_process_packet()
returns EJUSTRETURN.

Sponsored by:	Yandex LLC
2015-04-27 01:11:09 +00:00
Andrey V. Elsukov
3d80e82d60 Fix possible use after free due to security policy deletion.
When we are passing mbuf to IPSec processing via ipsec[46]_process_packet(),
we hold one reference to security policy and release it just after return
from this function. But IPSec processing can be deffered and when we release
reference to security policy after ipsec[46]_process_packet(), user can
delete this security policy from SPDB. And when IPSec processing will be
done, xform's callback function will do access to already freed memory.

To fix this move KEY_FREESP() into callback function. Now IPSec code will
release reference to SP after processing will be finished.

Differential Revision:	https://reviews.freebsd.org/D2324
No objections from:	#network
Sponsored by:	Yandex LLC
2015-04-27 00:55:56 +00:00
Ganbold Tsagaankhuu
c34625f7b7 Enable root mounting from mmc/sd card. 2015-04-27 00:39:57 +00:00
Michael Tuexen
55f8a4bb1b Don't panic under INVARIANTS when receiving a SACK which cumacks
a TSN never sent.
While there, fix two typos.

MFC after: 1 week
2015-04-26 21:47:15 +00:00
Gleb Smirnoff
a5e0fa4063 Don't use ifm_data. It was used only for self checking debug.
Reviewed by:	np
2015-04-26 21:31:30 +00:00
Mateusz Guzik
8d0a4ab212 fd: plug an always overwritten initialization in fdalloc 2015-04-26 17:27:55 +00:00
Mateusz Guzik
203322f966 Consistently use p instead of td->td_proc in create_thread
No functional changes.
2015-04-26 17:22:59 +00:00
Andrew Turner
2d8bbd0b6d Cleanup a little more:
- Remove whitespace at the end of lines
 - Use a tab after instructions, not spaces
2015-04-26 16:37:27 +00:00
Andrew Turner
ed5bb96b5d Fix the style of locore-v4.S and locore-v6.S to help find any common code. 2015-04-26 16:18:41 +00:00
Andrew Turner
365a1e502e Remove the armv6 code from locore-v4.S, it's not needed there. 2015-04-26 15:57:02 +00:00
Andrew Turner
61e9519f63 Use ARMv7 style unaligned access on ARMv6. We set this bit in locore, but
it was missing from here.
2015-04-26 11:54:25 +00:00
Baptiste Daroussin
c37a0a8285 mdoc: fix rendering issues 2015-04-26 11:39:25 +00:00
Hans Petter Selasky
d3f37016f7 Allow DSP basename cloning to be disabled or enabled at boot and
runtime. This is useful when implementing OSS sound stacks in
userspace via libcuse for example.

MFC after:	2 weeks
2015-04-26 11:39:13 +00:00
Luiz Otavio O Souza
d24e6f4add Set ARM_L2_PIPT for A10 and RPI2, they are probably missing by accident.
Noted by:	Michal Meloun <meloun@miracle.cz>
2015-04-25 22:42:03 +00:00
Luiz Otavio O Souza
0261c55538 Make the pcf8563 RTC work on FDT systems and on interrupt based i2c
controllers.

Call iicbus_transfer() from the device context and not from the iicbus
context.

I am committing a slightly different patch, so if something break, it is
probably my fault.

PR:		199496
Submitted by:	Juraj Lutter <otis@sk.FreeBSD.org>
2015-04-25 21:43:29 +00:00
Tycho Nightingale
57f7026c0f STOS/STOSB/STOSW/STOSD/STOSQ instruction emulation.
Reviewed by:	neel
2015-04-25 19:02:06 +00:00
Pedro F. Giffuni
0e5e31a6c6 Cleanup a bit the clang attributes for type safety checking.
Cleanup r281861 by moving the definitions to their own section but
still leave the definitions out of lint.

In addition to the 'argument_with_type_tag' attribute, bring
'type_tag_for_datatype' which is necessary for annotating the
data types.
2015-04-25 18:17:08 +00:00
Michael Gmelin
202379af84 Expand SMBUS API to add smbus_trans() function.
Differential Revision:	https://reviews.freebsd.org/D1955
Reviewed by:	adrian, jhb, wblock
Approved by:	adrian, jhb
2015-04-25 16:15:01 +00:00
Hiren Panchasara
a9467c3c45 Currently there is no easy way to specify net.isr.maxthreads = all cpus. We need
to specify exact number of cpus in loader.conf which get annoying when you have
mix of machines which don't have equal number of total cpus. I propose "-1" as
that value. When loader.conf has net.isr.maxthreads = -1, netisr will use all
available cpus.

In collaboration with:	davide
Reviewed by:	gnn
Differential Revision:	https://reviews.freebsd.org/D2318
MFC after:	2 weeks
Sponsored by:	Limelight Networks
2015-04-25 16:12:06 +00:00
Robert Watson
a12df97ed2 Adjust PROF_ARTIFICIAL_FRAMES in the DTrace profile provider on ARM to
skip 10, rather than 9, frames.  This appears to work quite well in
practice on the BeagleBone Black, so remove a comment about the value
being bogus and replace it with a slightly less negative one.  However,
the number of frames to skip is quite sensitive to details of the timer
and interrupt handling paths, so this is necessarily fragile -- but no
more so than on x86.

Sponsored by:	DARPA, AFRL
2015-04-25 15:43:12 +00:00
Rick Macklem
2fbb9d563b Fix the NFS server's handling of a bogus NFSv2 ROOT RPC.
The ROOT RPC is deprecated in the NFSv2 RFC, RFC-1094
and should never be used by a client.

Tested by:	thmu@freenet.de
MFC after:	1 week
2015-04-25 00:58:24 +00:00
Rick Macklem
7cfdc2a7bc MAXBSIZE defines both the largest UFS block size and the
largest size for a buffer in the buffer cache. This patch
defines a new constant MAXBCACHEBUF, which is the largest
size for a buffer in the buffer cache. Having a separate
constant allows MAXBCACHEBUF to be set larger than MAXBSIZE
on a per-architecture basis, so that NFS can do larger read/writes
for these architectures. It modifies sys/param.h so that BKVASIZE
can also be set on a per-architecture basis.
A couple of cases where NFS used MAXBSIZE instead of NFS_MAXBSIZE
is fixed as well.

Differential Revision:	https://reviews.freebsd.org/D2330
Reviewed by:	mav, kib
MFC after:	2 weeks
2015-04-25 00:52:01 +00:00
Kirk McKusick
74a87c3804 Limit the number of cylinder groups that will be searched when
trying to build a cluster. The limit is tunable using the sysctl
vfs.ffs.maxclustersearch. The current limit is 10 cylinder groups
per block allocation. It was previously limited to the number of
cylinder groups in the filesystem per block allocation. When there
were no clusters of the needed size left, it repeatedly searched
the whole filesystem for a non-existent cluster on every block
allocation. The result was very slow filesystem allocation with
100% CPU utilization. The old behavior can be had by setting
vfs.ffs.maxclustersearch to a huge number (1,000,000).

This change affects only the layout policy routines so is not able
to interfere with the integrity of the filesystem.

Reported by: Dmitry Sivachenko (demon@)
Tested by:   Dmitry Sivachenko (demon@)
MFC after:   2 weeks
2015-04-24 23:27:50 +00:00
Konstantin Belousov
b9062c934a Use correct length for sparse uiomove(). It must be the clipped to
the page size, len is the total transfer length, which may be larger
than zero_region.

Reported and tested by:	clusteradm (gjb)
Sponsored by:	The FreeBSD Foundation
X-MFC-With:	r281442
2015-04-24 22:05:12 +00:00
Andrey V. Elsukov
1ffc12bc42 Fix possible reference leak.
Sponsored by:	Yandex LLC
2015-04-24 21:05:29 +00:00
Pedro F. Giffuni
e8968b7eaf Add definition to support alloc_align attribute.
gcc 4.9 added support for new alignment attribute alloc_align:

The alloc_align attribute is used to tell the compiler that the function
return value points to memory, where the returned pointer minimum
alignment is given by one of the functions parameters. GCC uses this
information to improve pointer alignment analysis.

This attribute is not (yet) available on clang.
2015-04-24 18:07:34 +00:00
Ed Maste
382abd8c81 vt(4): Simplify mouse area detection
vt_is_cursor_in_area needs to return true if any part of the mouse
cursor is visible in the rectangle area. Replace the existing test with
a simpler version of a test for overlapping rectangles.

Differential Revision:	https://reviews.freebsd.org/D2356
Reviewed by:	ray
Sponsored by:	The FreeBSD Foundation
2015-04-24 17:36:26 +00:00
Scott Long
43ffa928f9 Revert r281451. It causes a panic/hang early in boot for a number of
users, myself included.  The original code is likely papering over a
larger bug that needs to be explored, but for now get things back to
a working state.

Obtained from:	Netflix, Inc.
MFC after:	immediately
2015-04-24 17:03:53 +00:00
John Baldwin
9662eef57a Watchdog drivers need to support rearming the watchdog in contexts which
are not permitted to sleep.  Only use the IPMI watchdog with backends
which poll driver-initiated requests to meet this requirement.

In practice this means that watchdogs will no longer be used on systems
that use the SSIF backend.

Differential Revision:	https://reviews.freebsd.org/D2062
MFC after:	2 weeks
2015-04-24 16:56:23 +00:00
Konstantin Belousov
02c26f81a7 Move common code from sys/i386/i386/mp_machdep.c and
sys/amd64/amd64/mp_machdep.c, to the new common x86 source
sys/x86/x86/mp_x86.c.

Proposed and reviewed by:	jhb
Review:	https://reviews.freebsd.org/D2347
Sponsored by:	The FreeBSD Foundation
2015-04-24 16:20:56 +00:00
John Baldwin
12b4b5a0da Rename the kld for oce(4) to if_oce.ko. ifconfig(8) has special knowledge
about kld filenames for network drivers that requires them to follow the
pattern of if_<foo>.  This also fixes the existing documentation in the
manpage which says to use if_oce_load=YES in loader.conf.

PR:		199095
MFC after:	1 week
2015-04-24 14:47:53 +00:00
John Baldwin
5abf821641 Update this driver to not save copies of registers that are no longer used
after r281874.  While here, also update it to always write the parent's
PCI bus number to the primary bus register.
2015-04-24 13:12:04 +00:00
Takanori Watanabe
7a4864d1bb Add Lynx-Point LP smbus controller ID. 2015-04-24 07:24:31 +00:00
Kevin Lo
0339d2cfcc - Fix the length of efuse content.
- Replace the magic numbers with something more readable.
2015-04-24 04:57:18 +00:00
Mark Johnston
8241ee3b2c Fix DTrace's panic() action.
It would previously call into some unfinished Solaris compatibility code and
return without actually calling panic(9). The compatibility code is
unneeded, however, so just remove it and have dtrace_panic() call vpanic(9)
directly.

Differential Revision:	https://reviews.freebsd.org/D2349
Reviewed by:	avg
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-04-24 03:19:30 +00:00
Mark Johnston
da10a60340 Make vpanic() externally visible so that it can be called as part of the
DTrace panic() action.

Differential Revision:	https://reviews.freebsd.org/D2349
Reviewed by:	avg
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-04-24 03:17:21 +00:00
Andrew Turner
092b8f61cd Add the SOC_IMX51, SOC_IMX53, and SOC_IMX6 options. These are used to
select which SoCs the kernel config will support.

Use these options to merge files.imx51 and files.imx53.
2015-04-23 22:20:43 +00:00
Andrew Turner
bb135ad6af Reduce the diff between files.imx51 and files.imx53 2015-04-23 21:39:32 +00:00
Andrew Turner
bb456994ee Pull out the common parts of the ODROIDC1 and VSATV102 kernels to a new
kernel config. This also removes the per-board config files from universe.
2015-04-23 21:31:06 +00:00
Andrew Turner
442938a94f Remove the need for board specific std files on aml8726 by moving the
options they set to the main kernel config.
2015-04-23 20:53:29 +00:00
Andrew Turner
4ca6cef0b5 Move KERNVIRTADDR to the common std.aml8726. 2015-04-23 20:43:24 +00:00
Andrew Turner
7a26ccdd87 - Move files selected in files.smp to files.aml8726 and remove it.
- Remove a redundant file from files.aml8726
2015-04-23 20:39:40 +00:00
Andrew Turner
3aaf2b23e7 Update the ODROIDC1 and VSATV102 to reduce the diff to the other armv6
kernel config files.
2015-04-23 20:28:56 +00:00
Ed Maste
2a4b3913bb Revert r281889, it broke keyboard input 2015-04-23 20:26:22 +00:00