194153 Commits

Author SHA1 Message Date
brooks
3ef292db62 MFC r256911, r256936
MFP4: 223121 (PIC portion), 225861, 227822, 229692 (PIC only), 229693,
230523, 1123614

Implement a driver for Robert Norton's PIC as an FDT interrupt
controller.  Devices whose interrupt-parent property points to a beripic

device will have their interrupt allocation, activation, and setup
operations routed through the IC rather than down the traditional bus
hierarchy.

This driver largely abstracts the underlying CPU away allowing the
PIC to be implemented on CPU's other than BERI.  Due to insufficient
abstractions a small amount of MIPS specific code is currently required
in fdt_mips.c and to implement counters.

Sponsored by:	DARPA/AFRL
Approved by:	re (gjb)
2013-11-01 20:28:13 +00:00
delphij
03c171750e MFC r257369:
Don't reference pointer before testing whether it is
NULL.

Submitted by:	Clement Lecigne <clecigne google com>
Reviewed by:	grehan
Approved by:	re (kib)
2013-11-01 17:39:59 +00:00
gjb
d1f5c9bfc2 MFC r257329 (nyan):
Fix build, both clang and gcc are required on pc98.

Approved by:	re (kib)
Sponsored by:	The FreeBSD Foundation
2013-11-01 16:48:30 +00:00
jlh
bc89db057b MFC r257361:
Fix compatibility function for old daily_status_security_${name}_enable
  variables.

  PR:           conf/183137

MFC r257364:
  Fix indentation.

Approved by:	re (gjb)
2013-11-01 16:03:38 +00:00
gjb
8141a12b1d MFC r256540, r256544:
r256540 (dteske):
 Add loader.conf(5) entries to import bootpool after boot when
 using full-disk encryption and ZFS.

 r256544 (dteske):
 Fix loader.conf(5) entries from r256540.

Approved by:	re (hrs)
Sponsored by:	The FreeBSD Foundation
2013-11-01 15:54:57 +00:00
kib
7933da6e9a MFC r257072:
Make pci_get_dma_tag() non-static.

Approved by:	re (glebius)
2013-11-01 06:33:17 +00:00
kib
a9830491c8 MFC r257071:
Add some definitions for the bits in root control and status PCIe cap
registers.

Approved by:	re (glebius)
2013-11-01 06:32:16 +00:00
kib
e31542bdb5 MFC r257070:
Move the PCI_DMA_BOUNDARY definition into the pcivar.h.

Approved by:	re (glebius)
2013-11-01 06:31:02 +00:00
kib
0c11a37a6f MFC r257069:
Add ddb 'show ioapic' and 'show all ioapics' commands.

Approved by:	re (glebius)
2013-11-01 06:29:38 +00:00
kib
71633650c4 MFC r256670:
Rewrite RDRAND support:
Remove the excessive memory accesses to temporary buffer.
Streamline the assembly and unify it between i386 and amd64.

Approved by:	re (glebius)
2013-11-01 06:26:37 +00:00
trociny
6952838572 MFC r257154:
Merging local and remote bitmaps must be protected by hr_amp lock.

This is believed to fix hastd crashes, which might occur during
synchronization, triggered by the failed assertion:

 Assertion failed: (amp->am_memtab[ext] > 0),
 function activemap_write_complete, file activemap.c, line 351.

Approved by:	re (glebius)
2013-10-31 20:30:26 +00:00
brooks
5c41fcfa55 Notional MFC of r257139:
Regerate after r257460 swapped the default to WITH_NMTREE.

Approved by:	re (gjb)
2013-10-31 18:11:50 +00:00
brooks
ec13d5fe2b MFC r257138:
Switch the default mtree to nmtree our new NetBSD derived mtree.

Exp-runs by:	bdrewery (ports/182438)
Sponsored by:	DARPA/AFRL
Approved by:	re (gjb)
2013-10-31 18:06:32 +00:00
brooks
5ed44e47ad MFC r257268:
Enable the --sysroot=/foo option in ld by always building with a sysroot
defined. When not building as a cross linker, the sysroot is set to "/".

Exp-run by:	bdrewery (ports/183206)
Approved by:	re (gjb)
2013-10-31 17:56:27 +00:00
brooks
7e2e9ae1af MFC r256861:
MFP4: 223121 (FDT infrastructure portion)

Implement support for interrupt-parent nodes in simplebus.  The current
implementation requires that device declarations have an interrupt-parent
node and that it point to a device that has registered itself as a
interrupt controller in fdt_ic_list_head and implements the fdt_ic
interface.

Sponsored by:   DARPA/AFRL
Approved by:    re (gjb)
2013-10-31 16:18:36 +00:00
brooks
8b58367431 MFC r256865
Remove the isf(4) driver.  It was created by accident and is subset of
the cfi(4) driver.  It remained in the tree longer than would be ideal
due to the time required to bring cfi(4) to feature parity.

Sponsored by:	DARPA/AFRL
Approved by:	re (gjb)
2013-10-31 16:16:52 +00:00
brooks
02057ca62a Notional MFC of r257057:
Regen documentation post r257449:

Stop conflating WITHOUT_CLANG with WITHOUT_CLANG_IS_CC.  This allows
bootstrapping a copy of clang without building clang for the base system
which is useful for nanobsd and similar setups.  It's still probably
wrong to conflate what is installed as /usr/bin/cc with the selection
of a bootstrap compiler under WITH*_CLANG_IS_CC, but that's for another
day.

Sponsored by:	DARPA/AFRL
Approved by:	re (gjb)
2013-10-31 14:11:14 +00:00
brooks
c8322d287b MFC r256915
Stop conflating WITHOUT_CLANG with WITHOUT_CLANG_IS_CC.  This allows
bootstrapping a copy of clang without building clang for the base system

which is useful for nanobsd and similar setups.  It's still probably
wrong to conflate what is installed as /usr/bin/cc with the selection
of a bootstrap compiler under WITH*_CLANG_IS_CC, but that's for another
day.

Sponsored by:	DARPA/AFRL
Approved by:	re (gjb)
2013-10-31 14:07:00 +00:00
brooks
1fe9c90df1 MFC r256752, r256946
MFP4: 221483, 221567, 221568, 221670, 221677, 221678, 221800, 221801,
221804, 221805, 222004, 222006, 222055, 222820, 1135077, 1135118,
1136259

Add atse(4), a driver for the Altera Triple Speed Ethernet MegaCore.

The current driver support gigabit Ethernet speeds only and works with
the MegaCore only in the internal FIFO configuration in the soon to be
open sourced BERI CPU configuration.

MFP4: 1187103, 222076, 222057, 222051, 221799

Add atsectl, a simple utility to read and update MAC addresses stored in

the default flash location on Altera DE4 boards.  Typically used once
when setting up a board so leaving in tools rather than inflicting on
all users.

To build with world add LOCAL_DIRS=tools/tools/atsectl to the make
command line.

Submitted by:	bz
Sponsored by:	DARPA/AFRL
Approved by:	re (glebius)
2013-10-31 13:54:55 +00:00
brooks
01a0280e09 MFC: r256743, r256744
MFP4:
Change 227594 by brooks@brooks_zenith on 2013/04/11 17:10:14

	When we fail, print the error that occurred if we are giving
	up or if bootverbose is set.

MFP4 (driver change only):
Change 231100 by brooks@brooks_zenith on 2013/07/12 21:01:31

	Add a new option ALTERA_SDCARD_FAST_SIM which checks immediately
	for success of I/O operations rather than queuing a task.

Sponsored by:   DARPA/AFRL
Approved by:	re (glebius)
2013-10-31 13:47:39 +00:00
kib
c291b4b61f MFC r257221:
Fix typo.

Approved by:	re (glebius)
2013-10-31 10:12:25 +00:00
grehan
382c310190 MFC r257092
Fix bug in the ioapic emulation for level-triggered interrupts,
  where a pin assertion while a source was masked would result in
  the interrupt being lost, with the symptom being a console hang.
  The condition is now recorded, and the interrupt generated when
  the source is unmasked.

Approved by:  re (glebius)
2013-10-30 21:12:27 +00:00
neel
249db5aac3 MFC r257293.
Add support for PCI-to-ISA LPC bridge emulation. If the LPC bus is attached
to a virtual machine then we implicitly create COM1 and COM2 ISA devices.

Prior to this change the only way of attaching a COM port to the virtual
machine was by presenting it as a PCI device that is mapped at the legacy
I/O address 0x3F8 or 0x2F8.

There were some issues with the original approach:
- It did not work at all with UEFI because UEFI will reprogram the PCI device
  BARs and remap the COM1/COM2 ports at non-legacy addresses.
- OpenBSD GENERIC kernel does not create a /dev/console because it expects
  the uart device at the legacy 0x3F8/0x2F8 address to be an ISA device.
- It was functional with a FreeBSD guest but caused the console to appear
  on /dev/ttyu2 which was not intuitive.

The uart emulation is now independent of the bus on which it resides. Thus it
is possible to have uart devices on the PCI bus in addition to the legacy
COM1/COM2 devices behind the LPC bus.

The command line option to attach ISA COM1/COM2 ports to a virtual machine is
"-s <bus>,lpc -l com1,stdio".

The command line option to create a PCI-attached uart device is:
"-s <bus>,uart[,stdio]"

The command line option to create PCI-attached COM1/COM2 device is:
"-S <bus>,uart[,stdio]". This style of creating COM ports is deprecated.

Approved by:	re (glebius)
2013-10-30 20:42:09 +00:00
hselasky
9a9c7f1310 MFC r257206:
Fix a deadlock when trying to power off a USB device. The deadlock
happens because the code in question is trying to modify the parent
USB port registers outside the USB explore thread.

Approved by:	re (glebius)
2013-10-30 08:05:39 +00:00
andre
82fad41b08 MFC r256920:
The TCP delayed ACK logic isn't aware of LRO passing up large aggregated
  segments thinking it received only one segment. This causes it to enable
  the delay the ACK for 100ms to wait for another segment which may never
  come because all the data was received already.

  Doing delayed ACK for LRO segments is bogus for two reasons: a) it pushes
  us further away from acking every other packet; b) it introduces additional
  delay in responding to the sender.  The latter is especially bad because it
  is in the nature of LRO to aggregated all segments of a burst with no more
  coming until an ACK is sent back.

  Change the delayed ACK logic to detect LRO segments by being larger than
  the MSS for this connection and issuing an immediate ACK for them to keep
  the ACK clock ticking without interruption.

  Reported by:  julian, cperciva
  Tested by:    cperciva
  Reviewed by:  lstewart

Approved by:    re (glebius)
2013-10-29 21:00:54 +00:00
dumbbell
0d7fc2d687 MFC r256771:
drm/radeon: radeonkms depends on firmware(9)

Submitted by:	tijl@
Approved by:	re (kib)
2013-10-29 19:50:40 +00:00
bdrewery
46ae5525e3 MFC r257151:
Document /var/cache/pkg into hier(7) which pkg(8) uses.

Approved by:	bapt
Approved by:	re (glebius)
2013-10-29 18:37:38 +00:00
bdrewery
7046958142 MFC: r256770,r257142,r257145,r257146,r257147,r257148,
r257149,r257150,r257158,r257159,r257164,r257168,
     r257193

  - Support checking signature for pkg bootstrap from remote
    and for 'pkg add ./pkg.txz'

  - Be verbose on where pkg is being bootstrapped from.

  - Add support for reading configuration files from /etc/pkg.
    For now only /etc/pkg/FreeBSD.conf is supported.

  - Add test package signing key fingerprint into /etc/keys/pkg/trusted.

  - Disable fingerprint checking by default for now as the official
    packages are not yet signed.

Approved by:	bapt
Approved by:	re (glebius)
2013-10-29 18:36:44 +00:00
trasz
2d60d1851a MFC r257061:
Don't spin with mutex hold when there is not enough room in the send socket
buffer.  While here, make the code flow somewhat nicer.

Thanks to mav@ for tracking it down.

Approved by:	re (glebius)
2013-10-29 14:07:42 +00:00
melifaro
c259ad5c52 MFC r256624:
Fix long-standing issue with incorrect radix mask calculation.

Usual symptoms are messages like
rn_delete: inconsistent annotation
rn_addmask: mask impossibly already in tree
routing daemon constantly deleting IPv6 default route
or inability to flush/delete particular prefix in ipfw table.

Changes:
* Assume 32 bytes as maximum radix key length
* Remove rn_init()
* Statically allocate rn_ones/rn_zeroes
* Make separate mask tree for each "normal" tree instead of system
global one
* Remove "optimization" on masks reusage and key zeroying
* Change rn_addmask() arguments to accept tree pointer (no users in base)

MFC changes:
* keep rn_init()
* create global mask tree, protected with mutex, for old rn_addmask
users (currently 0 in base)
* Add new rn_addmask_r() function (rn_addmask in head) with additional
argument to accept tree pointer

PR:		kern/182851, kern/169206, kern/135476, kern/134531
Found by:	Slawa Olhovchenkov <slw@zxy.spb.ru>
Reviewed by:	glebius (previous versions)
Sponsored by:	Yandex LLC
Approved by:	re (glebius)
2013-10-29 12:53:23 +00:00
bdrewery
b8f1640fa0 MFC r257051:
Add support for using "pkg+http://" for the PACKAGESITE.

  pkg 1.2 is adding this support as well. This should help
  lessen the confusion on why the default SRV PACKAGESITE
  does not load in a browser.

Approved by:	bapt
Approved by:	re (glebius)
2013-10-29 12:25:22 +00:00
smh
7fcf8773f4 MFC r257109:
Add clang-CC and CC to list of hints allowing clang to identify its operating
mode as c++ instead of defaulting to c for the binary names CC and clang-CC.

This fixes builds that use cmake which automatically sets CXX to
/usr/bin/CC by default.

PR:		bin/182442
Approved by:	re (glebius)
2013-10-29 11:36:31 +00:00
glebius
60686beab7 Merge r256824 from head:
Provide a working example line for an interface with 1 address running
  with CARP.

  Currently, we've got a problem that interface isn't IFF_UP at the time
  we assign it a redundant address, and the latter gets stuck in INIT state.
  Additional SIOCSIFFLAGS from ifconfig(8) kicks it to a working state.

  A proper fix is kernel side and appeared to be non-trivial, not to be
  checked in before 10.0-RELEASE.

  Submitted by:   Ole Myhre <ole.myhre dataoppdrag.no>

Approved by:	re (kib)
2013-10-29 09:24:39 +00:00
glebius
5d5c0c1a43 Merge r256537 from head:
Make getutxent(3) more robust against bad utx.log files. Whenever we read
  zeroes, don't stop processing the file, but read until its end or valid
  data.

  In collaboration with:	ed

Approved by:	re (kib)
2013-10-29 09:23:51 +00:00
kib
492a1ca90c MFC r256848:
Use plain register read for waiting of the reset completion
notification, to avoid gt_lock recursion.

Approved by:	re (glebius)
2013-10-29 07:35:19 +00:00
kib
aaa21934ba MFC r256847:
Print more useful information about the transfer that trigger the assertion.

Approved by:	re (glebius)
2013-10-29 07:33:55 +00:00
bapt
22acce6ad4 MFC: r256968, r256971, r256978
Improve SRV records support for the pkg(8) bootstrap:
- order srv records by priorities
- for all entries of the same priority, order randomly respect the weight
- select the port where to fetch from respect the port provided in the SRV
record

Allow to bootstrap by doing pkg add ./a/path/to/a/pkg_package.txz

Approved by:	re (glebius)
2013-10-29 07:33:53 +00:00
nwhitehorn
e5d79eff87 MFC r256777-256779,256788:
Add driver for POWER hypervisor interpartition ethernet.

Approved by:	re (glebius)
2013-10-28 23:47:52 +00:00
cperciva
6fe3b99530 MFC r257129:
Remove time and date stamps from svn* binaries, in order to make the
  builds reproducible.

Approved by:	re (glebius)
2013-10-28 22:49:11 +00:00
grehan
2f628a2240 MFC r257078
Fix panic in the tap driver when a tap and vmnet interface were
  created after each other e.g.

   ifconfig tap0
   ifconfig vmnet0
   <panic>

  Appears to be a cut'n'paste error from the tap code to the vmnet
  code where the name string wasn't updated in the call to make_dev().

Approved by:  re (glebius)
2013-10-28 22:41:36 +00:00
delphij
b1f939cc2d MFC r257007:
Update driver to version 10.0.664.0.

Many thanks to Emulex for their continued support of FreeBSD.

Submitted by:	Venkata Duvvuru <VenkatKumar.Duvvuru Emulex Com>
Approved by:	re (glebius)
2013-10-26 19:02:39 +00:00
gjb
b5d80767c9 Update stable/10 to BETA2 as part of the 10.0-RELEASE cycle.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2013-10-26 15:10:58 +00:00
cperciva
cf504dd159 MFC r256646, r256767, r257038:
When installing updates, install new directories first and remove old
  directories last.

  Allow ~ in file names so libtool droppings in contrib don't break updates.
  It has happened twice now, and is likely to happen again.

  Be more selective when filtering for lib*.so.N files.  These are deleted
  at the end of the upgrade process, after warning users to upgrade any
  3rd party software (e.g., from the ports tree) which might link to the
  libraries being removed.

Approved by:	re (gjb)
Errata Notice:	FreeBSD-EN-13:04.freebsd-update
2013-10-26 08:34:35 +00:00
gjb
2074bdb75a MFC r257079:
Fix build host pollution by avoiding calling 'uname -srp' to
 determine values for 'VERSION'.

Approved by:	re (glebius)
2013-10-25 21:27:35 +00:00
grehan
c26ecf0555 MFC r256926, r257005
r256926
  Fix AHCI ATAPI emulation when backed with /dev/cd0

  - remove assumption that the backing file/device had
    512-byte sectors
  - fix incorrect iovec size variable that would result
    in a buffer overrun when an o/s issued an i/o request
    with more s/g elements than the blockif api

r257005
  Export the block size capability to guests.
  - Use #defines for capability bits
  - Export the VTBLK_F_BLK_SIZE capability
  - Fix bug in calculating capacity: it is in
    512-byte units, not the underlying sector size

  This allows virtio-blk to have backing devices
  with non 512-byte sector sizes e.g. /dev/cd0, and
  4K-block harddrives.

Approved by:  re (glebius)
2013-10-25 18:39:01 +00:00
kib
47b928f216 MFC r256504:
Add a sysctl kern.disallow_high_osrel which disables executing the
images compiled on the world with higher major version number than the
high version number of the booted kernel.  Default to disable.

Approved by:	re (glebius)
2013-10-25 16:36:16 +00:00
kib
3056ea94bb MFC r256502:
Similar to debug.iosize_max_clamp sysctl, introduce
devfs_iosize_max_clamp sysctl, which allows/disables SSIZE_MAX-sized
i/o requests on the devfs files.

Approved by:	re (glebius)
2013-10-25 16:33:24 +00:00
kib
f2cf20f78f MFC r256501:
Remove two instances of ARGSUSED comment, and wrap lines nearby the
code that is to be changed.

Approved by:	re (glebius)
2013-10-25 16:31:28 +00:00
tijl
19e284f651 MFC r256925:
Add a dummy statement to the beginning of the pthread_cleanup_pop() macro
to allow a call of the macro to be labelled as in:

label:
  pthread_cleanup_pop();

Reviewed by:	imp
Approved by:	re (glebius)
2013-10-25 13:27:55 +00:00
hselasky
04fdff3ee1 MFC r256750:
Improve XHCI stability. When a command timeout happens, the command
should be aborted else the command queue can stop. Refer to section
"4.6.1.2" of the XHCI specification.

Approved by:	re (glebius)
2013-10-25 10:20:19 +00:00